LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-24-2012, 02:09 PM   #1
karan2386
Member
 
Registered: Jan 2012
Posts: 34

Rep: Reputation: Disabled
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.
 
Old 04-24-2012, 03:57 PM   #2
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 4,020

Rep: Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964
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?
 
Old 04-25-2012, 12:26 AM   #3
karan2386
Member
 
Registered: Jan 2012
Posts: 34

Original Poster
Rep: Reputation: Disabled
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.
 
Old 04-25-2012, 12:31 AM   #4
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 4,020

Rep: Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964
Quote:
Originally Posted by karan2386 View Post
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.
 
Old 04-25-2012, 12:48 AM   #5
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 4,020

Rep: Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964
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...
 
Old 04-25-2012, 08:11 AM   #6
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,263

Rep: Reputation: 1078Reputation: 1078Reputation: 1078Reputation: 1078Reputation: 1078Reputation: 1078Reputation: 1078Reputation: 1078
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!" )
 
Old 07-10-2012, 01:59 AM   #7
anil_pugalia
LQ Newbie
 
Registered: Jul 2012
Location: Bangalore, India
Distribution: Mageia
Posts: 2

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


Reply


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
linux device driver abhikohokade Linux - Kernel 3 04-05-2012 01:59 PM
[SOLVED] USB device is not claimed by any active driver for every device in Linux 2.4 jacquesdirac Linux - Hardware 3 11-12-2010 08:35 AM
linux device driver lincoln.runwal Linux - Newbie 2 12-01-2008 11:18 PM
Multiple Device driver from single device driver???? rickhg12hs Linux - Kernel 3 05-25-2008 12:11 AM
Linux Device Driver malacma Linux - Software 10 10-09-2007 06:14 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration