[RFC] Configuration generic drivers at runtime

Previous thread: Use of absolute timeouts for oneshot timers by Jeremy Fitzhardinge on Saturday, March 10, 2007 - 3:52 pm. (5 messages)

Next thread: sched rsdl fix for 0.28 by Con Kolivas on Saturday, March 10, 2007 - 5:07 pm. (4 messages)
From: Laurent Pinchart
Date: Saturday, March 10, 2007 - 3:57 pm

Hi everybody,

I'm writing a Linux driver for USB Video Class (UVC) devices. Before 
submitting it to the kernel, there are still a few rough corners I'd like to 
polish. Comments would be appreciated for the following one.

The UVC spec defines a way for device vendors to provide extensions to the 
standard through so-called extension units, identified by a GUID (Globally 
Unique IDentifier). An extension unit can define any number of controls 
(think of controls as simple parameters such as brightness, zoom, pan/tilt, 
shutter speed, ...). Devices advertise in their USB descriptors the extension 
units they support, along with the controls that are supported in each 
extension unit.

To access those extension units from user-space, the UVC driver will offer two 
methods. One of them will map the controls defined by extension units to V4L2 
controls. The question that arises is how to define and store those mappings.

And obvious solution would be to have an ever growing array in the driver, 
storing control information for all possible extension units ever defined by 
webcam vendors. While this is quite straightforward, it might not be the most 
usable solution for device vendors who wouldn't want debug controls to be 
included in the kernel by default, or who wouldn't want to submit new control 
definitions for inclusion in the kernel (with the implied delay) every time a 
new device comes out.

Another solution would be to introduce a way to define controls and mappings 
at runtime. Mappings would be stored in test-based user-space configuration 
files, distributed by vendors. A small user-space utility would add them 
through a few ioctls. This obviously raises some security concerns (regarding 
which users will be allowed to add mappings, or how many of them they can 
add).

I would like comments regarding the second solution. Is this something that is 
likely to be accepted in the mainline kernel ? I don't know of any other 
Linux driver implementing such kind of ...
From: Laurent Pinchart
Date: Monday, March 12, 2007 - 1:39 pm

Hi,

as I got no reply to my previous e-mail, I assume it got stopped by 
grammar-checking filters, so I fixed the subject line :-) (this is what 
happens when you write the first word and the rest of the title 10 minutes 
apart). More seriously, this is a generic architecture issue which I'd like 
to get right. If nobody has any opinion on the subject, I'll just go on and 
implement my idea. But if something isn't going to be accepted in the 
mainline kernel, I'd rather find out now to spend time on finding a better 
idea.

Best regards,

-

Previous thread: Use of absolute timeouts for oneshot timers by Jeremy Fitzhardinge on Saturday, March 10, 2007 - 3:52 pm. (5 messages)

Next thread: sched rsdl fix for 0.28 by Con Kolivas on Saturday, March 10, 2007 - 5:07 pm. (4 messages)