LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-13-2010, 09:55 AM   #1
jzviagin
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Rep: Reputation: 0
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.
 
Old 06-14-2010, 05:08 AM   #2
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
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.

Last edited by JZL240I-U; 06-14-2010 at 05:09 AM.
 
Old 06-14-2010, 05:40 AM   #3
jzviagin
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Original Poster
Rep: Reputation: 0
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?
 
Old 06-14-2010, 05:45 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
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?
 
Old 06-14-2010, 06:21 AM   #5
jzviagin
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Original Poster
Rep: Reputation: 0
i insmod the driver on a script file i put in /etc/rc.d/init.d/ folder
 
Old 06-14-2010, 06:40 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
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...

Last edited by JZL240I-U; 06-14-2010 at 06:49 AM.
 
Old 06-14-2010, 10:19 AM   #7
jzviagin
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Original Poster
Rep: Reputation: 0
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!
 
Old 06-15-2010, 01:05 AM   #8
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
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.
 
Old 06-15-2010, 02:51 AM   #9
jzviagin
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Original Poster
Rep: Reputation: 0
hello i copied all modules to the folder you mentioned but nothing new.
did you find the module loading script?
 
Old 06-15-2010, 03:05 AM   #10
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
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).
 
Old 06-15-2010, 03:18 AM   #11
jzviagin
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Original Poster
Rep: Reputation: 0
im using 2.4 kernel and theres's no such file in /etc
 
Old 06-15-2010, 03:21 AM   #12
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
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.
 
Old 06-15-2010, 07:47 AM   #13
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
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.
 
Old 06-15-2010, 07:52 AM   #14
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Quote:
Originally Posted by bsat View Post
...you can add the insmod command in the rc.local script so that the module gets loaded as soon as the system boots up.
Is that the mechanism for the 2.4.x kernel series? Or is it used in 2.6.y too? Or is it specific for any and all distributions?
 
Old 06-15-2010, 08:17 AM   #15
sanket1512
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Rep: Reputation: 0
hey can anybody send me source code for that in my email sanket94277@gmail.com
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Driver Probe function not being called xtom Fedora 1 11-10-2018 12:05 PM
who will call the probe function of the pci driver in x86 processor joslyn Linux - Software 0 05-17-2010 07:24 AM
How do I start to probe and prod a usb device? stardotstar Programming 2 06-10-2008 04:25 PM
probe method on bus and device driver not being called kunice Linux - Hardware 0 02-24-2008 11:47 AM
USB driver won't call probe function linux=future Linux - Kernel 2 01-13-2007 04:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 08:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration