LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 12-01-2007, 05:49 PM   #1
netwizio
LQ Newbie
 
Registered: Jul 2003
Posts: 8

Rep: Reputation: 0
USB Storage Device Driver


Hello

I am trying to write a custom driver for my USB storage device so that all the data on the disk can be encrypted while writing.

My module's installation etc goes fine but my probe function is not able to detect the device. I am giving the right vendor id and product id.

The default usb-storage driver (usb-storage.ko) is also present.
Do I have to remove it ? Or there can be two drivers which can receive notification for usb device plugging in etc ?

I would appreciate any help on this issue

Thanks
 
Old 12-02-2007, 11:39 AM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,727

Rep: Reputation: 452Reputation: 452Reputation: 452Reputation: 452Reputation: 452
I would suspect that the standard driver is intercepting the event notification. Try removing the regular module and see if yours works then.
 
Old 12-02-2007, 03:52 PM   #3
netwizio
LQ Newbie
 
Registered: Jul 2003
Posts: 8

Original Poster
Rep: Reputation: 0
I removed the usb-storage module but after that as soon as I insert my flash disk the kernel panics. I suspect that the usb core still thinks that the usb storage device driver is present and attempt to call it results in oops.
 
Old 12-03-2007, 01:41 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,727

Rep: Reputation: 452Reputation: 452Reputation: 452Reputation: 452Reputation: 452
Sounds like your module needs to have extra functionality which is normally supplied by the regular usb-storgae module. You would either need to add this functionality or write it in such a way that it can co-exist with the regular module. Or maybe the usbcore module is being unloaded when you unload usb-storage.
Maybe it would be better to let the regular usb drivers handle the core functionality and setup a udev rule which runs your program when the right kind of device is detected.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB drive not working properly, read only device? (USB key storage device) Arodef Linux - Hardware 14 01-01-2010 07:32 AM
USB storage device uttamsaxena Linux - General 16 09-24-2006 12:16 AM
Assign one USB-storage device to one device file Misel Linux - Hardware 1 08-28-2004 03:52 AM
USB storage device TazLinux Linux - General 9 12-04-2003 12:36 AM
how can I mount this device: da0: <USB 2.0 Storage Device alkad_mzu *BSD 2 11-15-2003 06:15 PM


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