If I use a modified usb skeleton driver on Linux and I insmod the module with the USB device already plugged in, the probe function doesn't get called. I need to unplug and replug the device in order for the driver to be activated. This is not the case for e.g. the serial drivers, I made some tests. Is there a reason for this? How do I get the probe function to get called?
相关问题
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- Error building gcc 4.8.3 from source: libstdc++.so
- Why should we check WIFEXITED after wait in order
- Null-terminated string, opening file for reading
You probably need to unbind your device from usbhid and bind it to your driver:
/sys/bus/usb/drivers/usbhid/
echo -n "1-1:1.0" > /sys/bus/usb/drivers/usbhid/unbind
echo <vendor> <product> > /sys/bus/usb/drivers/my_driver/new_id
or if you already have a bus id :echo -n "1-1:1.0" > /sys/bus/usb/drivers/my_driver/bind
see http://www.ha19.no/usb/ see http://lwn.net/Articles/143397/
Some software from us was opening the device from /proc/bus/usb and the device was claimed by the usbfs driver, so the new driver couldn't claim the device.
Almost all USB HID devices are automatically managed by usbhid driver. Try the following: