On Sun, 13 Aug 2006, Peter Oehry wrote:

> On Sun, 13 Aug 2006 15:04:12 -0400 (EDT)
> Alan Stern <[EMAIL PROTECTED]> wrote:
> 
> > > I'd like so setup something that the configuration will automatically  
> > > be chosen after plugin of the device.
> > > 
> > > 
> > > In the linux/usb.h header it is said, thet a device driver not attempt  
> > > to activate configurations. So my question is where is the right place  
> > > to do this?
> > 
> > The right place to do it is userspace.
> > 
> > > I think a patch for the hub.c (where the default configuration is  
> > > chosen) would also be a bad Idea? Becaus the hub.c would make  
> > > decisions depending on vendor and device ID.
> > > 
> > > Or is there a user space configuration to influence this decision?
> > 
> > You should write a hotplug or udev script that will detect the creation 
> > events for this device and will write the desired configuration number to 
> > /sys/devices/.../bConfigurationValue.
> > 
> 
> This will mean that the usb-driver itself (without an udev or hotplug script)
> will not be able to support the full function of this device.

No, that's not right.  The driver itself will be able to support the full 
function of the device.  However the kernel will put the device in 16-bit 
mode by default, forcing the user to change it to 24-bit mode if the user 
wants to do so.

> So it will be necessary
> to explain every user of this device that he has to have such a script before 
> he
> can use all features of the driver. So at least for the enduser it seems to be
> a bit complicated.

That's right.  It would be a lot like a Windows system, where the user has
to install a special driver along with the device.

> The usb driver will already have some code esspecially for 
> this device. So wouldn't it be consequential that de driver should enter the 
> usb device in the appropriate configuration?

There already is special code for this device?  What driver are you 
talking about?

The decision of whether to use 16-bit or 24-bit audio should be made by
the user, not by the kernel.  By changing the driver the way you want, you
would prevent people from using the device in 16-bit mode.  Assuming you
really want to do that, it wouldn't be too hard to add support for
allowing a driver to change device configurations.  However I don't think
this is the right solution to your problem.

A much better approach would be to have a database in HAL of desired
configuration settings for various USB devices.  The user could set it up
once and then it would work automatically.

Alan Stern


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to