Dear Experts,

I have been experimenting with some code that uses usbfs to implement a 
simple driver in user space.  It basically works, but there are some 
corner-cases where I need to be certain that I'm doing the right thing.

Claiming devices: I understand how the usb core offers new devices to 
kernel drivers based on the struct usb_device_id.  Is there any way for 
my user-space driver to influence this process?  (A sufficient solution 
for me for the time being would be a way to temporarily disable the 
kernel matching while my user-space code is running; for example, I'd 
be happy to load a small kernel module that clobbers the existing 
matching somehow.)

Choosing configurations: It looks as if I get two uevents when a device 
is attached, one for the unconfigured device and another once the core 
has done SetConfiguration.  Is there any way for my driver to influence 
the SetConfiguration process?  Presumably I could do a 
USBDEVFS_SETCONFIGURATION if I were unhappy with the configuration that 
it had chosen.  (Is there any way for a kernel driver to influence the 
SetConfiguration process?)

Order of events: I have some code that listens for KOBJECT_UEVENTs 
using netlink and then opens the corresponding /proc/bus/usb/ file.  
But this sometimes fails, because the uevents are sent before the files 
are created.  I could simply retry, but there's also the converse 
situation where the device has already been removed (e.g. it has 
"bounced") to worry about - is there a better way to do this?

Any advice would be much appreciated.

Regards,

Phil.





-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to