Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 01-12-2011, 08:43 PM   #1
Registered: Jul 2010
Posts: 56

Rep: Reputation: 15
USB kernel module, how functions get called by kernel

The USB kernel module is called "ums-usbat,ko" for the 2.6.37 kernel found from The source file is "shuttle_usbat.c" which is in linux-2.6.37/drivers/usb/storage directory. It depends on usb-storage.

Much of this will be beginning questions about how the functions get called in the kernel module. In the source file, there are many functions. When the module is inserted, the

static int __init usbat_init(void)
        return usb_register(&usbat_driver);
init function is called. When the module is removed, the

static void __exit usbat_exit(void)
exit function is called. What makes the other functions get called? How can I call one of the functions?

There is also a macro called US_DEBUG. It is defined somewhere else, maybe in the kernel tree. How can I turn this on/off? I am building the module on its own.

When I plug in an RCA k@zoo mp3 player, it does not create a scsi device. How can I find out if the functions are getting called?

What could I do to try to read the device:
usb 3-1: New USB device found, idVendor=069b, idProduct=2220
usb 3-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
usb 3-1: usb_probe_device
usb 3-1: configuration #1 chosen from 1 choice
usb 3-1: adding 3-1:1.0 (config #1, interface 0)
drivers/usb/core/inode.c: creating file '004'
hub 3-0:1.0: state 7 ports 2 chg 0000 evt 0002
hub 1-0:1.0: hub_suspend
usb usb1: bus auto-suspend
ehci_hcd 0000:00:10.4: suspend root hub
Old 01-18-2011, 02:58 PM   #2
Senior Member
Registered: Dec 2008
Posts: 4,668
Blog Entries: 29

Rep: Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916
Originally Posted by falmdavis View Post
What makes the other functions get called? How can I call one of the functions? This might be of some use to both of us. Can you give an example of a function which you wonder how s getting called? Point out to the source too.

Originally Posted by falmdavis View Post
How can I find out if the functions are getting called?
Try dmesg or printk.


kernel module

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
loadable kernel module compilation error for SHA1 functions nikhil86 Programming 1 03-25-2008 10:08 PM
warning undefined functions.....doing kernel module programing swift_a2002 Programming 10 05-24-2007 12:50 PM
LXer: Howto: build Linux kernel module against installed kernel w/o full kernel source tree LXer Syndicated Linux News 0 09-03-2006 09:21 PM

All times are GMT -5. The time now is 12:07 AM.

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