LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 10-28-2005, 03:48 PM   #1
xtom
LQ Newbie
 
Registered: Oct 2005
Posts: 1

Rep: Reputation: 0
USB Driver Probe function not being called


I am trying to write a kernel USB driver. I have loaded the module and see that the core has accepted the registration. I have given the registration the following table for devices that the driver supports- according to all the doumentation I can find, this structure should tell the core to call my probe function for every device that gets plugged in

static struct usb_device_id usb_table[]=
{
{.driver_info= 42},
{}
};
MODULE_DEVICE_TABLE(usb,usb_table);

The usb_driver structure is as follows:
static struct us_driver mydriver=
{
.owner= THIS_MODULE,
.name= "mydriver",
.id_table= usb_table,
.probe= my_usb_probe,
.disconnect= my_usb_disconnect,
};

As I said, I see the core register the driver (through a message in the log file that I see with dmesg), and a driver shows up under /sys/bus/usb/drivers. When I plug in a memory stick, I see the device being added in the log file again (and via a usbview tool) but my probe function does not get called. I have a printk at the start of the probe function but I never see it in the log (I have a similar message in the init function and I do see that one).

Any help is greatly appreciated - I am running 2.6.9-1.667 and the driver sample I got from the Linux Device Drivers 3rd edition book.

Thanks in advance.....
 
Old 11-10-2018, 12:05 PM   #2
ssdubey
LQ Newbie
 
Registered: Nov 2018
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by xtom View Post
I am trying to write a kernel USB driver. I have loaded the module and see that the core has accepted the registration. I have given the registration the following table for devices that the driver supports- according to all the doumentation I can find, this structure should tell the core to call my probe function for every device that gets plugged in

static struct usb_device_id usb_table[]=
{
{.driver_info= 42},
{}
};
MODULE_DEVICE_TABLE(usb,usb_table);

The usb_driver structure is as follows:
static struct us_driver mydriver=
{
.owner= THIS_MODULE,
.name= "mydriver",
.id_table= usb_table,
.probe= my_usb_probe,
.disconnect= my_usb_disconnect,
};

As I said, I see the core register the driver (through a message in the log file that I see with dmesg), and a driver shows up under /sys/bus/usb/drivers. When I plug in a memory stick, I see the device being added in the log file again (and via a usbview tool) but my probe function does not get called. I have a printk at the start of the probe function but I never see it in the log (I have a similar message in the init function and I do see that one).

Any help is greatly appreciated - I am running 2.6.9-1.667 and the driver sample I got from the Linux Device Drivers 3rd edition book.

Thanks in advance.....
Hi, I have kind of same problem as you described here. Can you please offer some guidance. I am new to device drivers. Thanks.
 
  


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
howto know whether a function is called in signal handler snowing Programming 1 11-07-2005 09:55 PM
Driver for Lexmark X6170 multi-function printer q6supvr Linux - Hardware 3 07-24-2005 09:38 PM
how function with argumets called without argumets? cranium2004 Programming 1 03-15-2005 08:32 AM
Why is my Lacie USB CD Writer called a LITE-ON? g4c9z Linux - Hardware 3 08-25-2004 07:36 AM
Redhat 9 install hung up at kernel boot up(usb probe failure) digizer0 Linux - General 0 05-25-2003 08:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 12:17 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