usb driver probe problem
hello, im writing a Usb driver and i have an issue.
when i insmod the driver with the device already plugged in before, the probe function is not called. it is only called after i disconnect the device and plug it again. i wanna make it work when i start my pc with the device plugged in. could someone please help me? best regards, jacob. |
The logic escapes me. As I understand (but don't know) it, the probe function is triggered by plugging in a device. Why should that happen when you insert a module if you didn't program that into the module?
Asked the other way round, do the other drivers trigger a probe? If so, find out how they do it. |
well maybe i asked the question the wrong way.
when you start ubuntu for example with some usb device plugged in before system loads you see the device working. in my driver i want the same behavior. at the moment it works only when i plug the device after the driver is already loaded then the probe callback is called and initialization begins. i want it to work if i start the pc with the device plugged. can you help please? |
When do you insert your driver (as a kernel module)? Maybe it is too late to be "connected" to the device like the other usb-devices are?
|
i insmod the driver on a script file i put in /etc/rc.d/init.d/ folder
|
Well, that is definitely lots later than the other drivers get loaded and by an other mechanism too. Is your driver a kernel object, i.e. *.ko module? Then you should use the usual mechanism to load it, too...
|
thank you for your time but i dont know any mechanism to load a KO because i'm new to linux. im using 2.4.23 kernel because i have some old drivers which are not availible on 2.6.
could you give me more information about the mechanism you mentioned earlier. thanks! |
I see. Right now I'm not in front of a linux box. I'll try to look it up tonight. In short, the kernel modules are kept in a directory like /lib/modules/2.4.23/* and get loaded via insmod which is controlled by a list in /etc/<forgot>/<it>. I hope I can five you more details later.
|
hello i copied all modules to the folder you mentioned but nothing new.
did you find the module loading script? |
Yeah, I just remembered. The system uses /sbin/modprobe during the boot process. The controlling file resides in /etc/modprobe.conf (if your system uses that to load modules).
|
im using 2.4 kernel and theres's no such file in /etc
|
Ooops. First make sure that your system has "/sbin/modprobe". Then it is google for you, find out what preceded modprobe.conf and modify that. Sorry, I can't give more help here, I havo no system which is that old.
|
I am not very sure but I feel if you want your module to be loaded when the kernel loads you either need to compile the kernel with the driver so that the kernel image has the driver or, you can add the insmod command in the rc.local script so that the module gets loaded as soon as the system boots up.
|
Quote:
|
hey can anybody send me source code for that in my email sanket94277@gmail.com
|
All times are GMT -5. The time now is 10:20 PM. |