| Linux - Kernel This forum is for all discussion relating to the Linux kernel. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-24-2012, 02:09 PM
|
#1
|
|
Member
Registered: Jan 2012
Posts: 34
Rep: 
|
driver for a device in linux
I am making a usb module in which I am reading and writing from pen drive. Further its compiled with no errors and when I install the driver it still doesnt work. I know there would be a driver for controlling the device(pen drive) but HOW SHOULD I LOOK FOR THAT DRIVER SO THAT I CAN UNLOAD THE DRIVER AND USE MINE.
|
|
|
|
04-24-2012, 03:57 PM
|
#2
|
|
Senior Member
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware-14.0 on a Lenovo T61 6457-4XG
Posts: 2,789
|
kam, you don't have to capitalize your sentences for them to be read, it's like shouting.
'rmmod usb_storage' will do what you want. Or you can blacklist usb_storage, or recompile your kernel without it.
PS Sorry to be rude, but if you are not able to find such an information by yourself, how come you are able to write a Linux driver?
|
|
|
|
04-25-2012, 12:26 AM
|
#3
|
|
Member
Registered: Jan 2012
Posts: 34
Original Poster
Rep: 
|
Didier,do you think i havn't done that ..... I have but its giving me message as follow
ERROR: Module usb_storage does not exist in /proc/modules
and secondly i was following an example http://www.linuxforu.com/2011/10/usb...rs-in-linux-1/ .
PS: Sorry to be rude and for copying your line but Please only reply if you could solve the doubts.There is no need to comment about the issues which is none of your buisness.
|
|
|
|
04-25-2012, 12:31 AM
|
#4
|
|
Senior Member
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware-14.0 on a Lenovo T61 6457-4XG
Posts: 2,789
|
Quote:
Originally Posted by karan2386
ERROR: Module usb_storage does not exist in /proc/modules
|
May be the driver is not configured as a module, but built-in your kernel? I would check the .config file to make sure.
|
|
|
|
04-25-2012, 12:48 AM
|
#5
|
|
Senior Member
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware-14.0 on a Lenovo T61 6457-4XG
Posts: 2,789
|
BTW something is funny: here (with usb_storage compiled as a module), if I plug-in an USB key and type 'rmmod usb-storage' it works, though the USB key be still attached, but if I type 'rmmod usb_storage' it says 'ERROR: Module usb_storage is in use', which is correct.
Back to the topic, I guess that you have a proc file system, do you? Just wondering, as /proc is in the process of being obsoleted by /sys, may be some day rmmod should relate on a sys structure instead of /proc...
|
|
|
|
04-25-2012, 08:11 AM
|
#6
|
|
Senior Member
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 4,554
|
Okay, I see a couple of possible issues that could be contributing. (And, hey everybody, let's all just be cool here.)
The first question is, whether the module is set up to be loaded automatically (hotplug...), and if it can in fact be loaded, and if the module that you think you're loading actually is the one that is. Some modules are designed to printk() a message to the system console-log when they're loaded or unloaded, just for this reason. Try explicitly loading and unloading it by hand.
Then, the USB device signature is used both by hotplug and (should be...) by the driver to recognize the device that the driver's supposed to be loaded-for and then attached-to.
I always approach debugging tasks like this in more or less the same way: put a debugging symbol with conditional #defines that cause a bunch of messages to be spewed out to the system console log, as the module gives a "play by play account" of exactly what it's doing. (This usually is quickly followed by "d'oh!"  )
|
|
|
|
07-10-2012, 01:59 AM
|
#7
|
|
LQ Newbie
Registered: Jul 2012
Location: Bangalore, India
Distribution: Mageia
Posts: 2
Rep: 
|
Karan, the usb-storage driver is showing "in use" because when you insert a pen drive, nowadays it gets auto-mounted. So, just umount that and then do a rmmod usb_storage, and then you should load the driver you are playing with. With that you should get the results as expected.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:47 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|