Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Mapping an unknown USB device to a given driver
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Hardware
View previous topic :: View next topic  
Author Message
kgolding



Joined: Sat Oct 15, 2005 9:48 pm
Posts: 17
Location: Surrey

PostPosted: Fri Apr 13, 2012 10:59 pm    Post subject: Mapping an unknown USB device to a given driver Reply with quote

I have a USB RNDIS device that it not recognised, but I have been told that the Prolific USB RNDIS driver should be compatible.

So, is there a way from me to map the "238b:0a21" id I get from lsusb to a Prolific driver? I'm really of my depth here, but also really want to get it working!

I'm using Debian 6.04, but am happy to use Ubuntu if that makes it easier?

Regards,

Kevin
Back to top
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2435

PostPosted: Tue Apr 17, 2012 4:42 am    Post subject: Reply with quote

You can, but:
1) you really need to know what you're doing and
2) it involves writing some udev rules (that require a certain syntax)

Run
Code:
man udev
for more details on the latter. Note it might break other devices if you associate the driver wrongly....
Back to top
View user's profile Send private message
kgolding



Joined: Sat Oct 15, 2005 9:48 pm
Posts: 17
Location: Surrey

PostPosted: Tue Apr 17, 2012 7:22 am    Post subject: Reply with quote

Thank you for the reply. I have been reading up on udev, and I can see how to add a rule for my device, but I can not see how to force the use of a particular driver?

Kevin
Back to top
View user's profile Send private message
ferrari
LXF regular


Joined: Tue May 03, 2005 12:09 pm
Posts: 133

PostPosted: Tue Apr 17, 2012 10:34 am    Post subject: Reply with quote

Without knowing anything about the driver concerned, in general you can use the 'modinfo' command (or man page if one exists) to determine any driver options available. For example, the usbserial driver can be loaded with particular vendor and product IDs

Code:
 modinfo usbserial
filename:       /lib/modules/2.6.37.6-0.11-desktop/kernel/drivers/usb/serial/usbserial.ko
license:        GPL
description:    USB Serial Driver core
author:         Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux/
srcversion:     3F51183D19FC4ACD9619988
depends:       
vermagic:       2.6.37.6-0.11-desktop SMP preempt mod_unload modversions
parm:           vendor:User specified USB idVendor (ushort)
parm:           product:User specified USB idProduct (ushort)
parm:           debug:Debug enabled or not (bool)

As you can see, this driver has options to parse a specific chipset. So, one might have a particular hardware device that requires this driver to load via a udev rule eg

Code:
SUBSYSTEM==”usb”, \
SYSFS{idVendor}==”19d2″, \
SYSFS{idProduct}==”0001″, \
RUN+=”/sbin/modprobe usbserial vendor=0x19d2 product=0×0001″


You will need to determine what module options are available to you.
Back to top
View user's profile Send private message
kgolding



Joined: Sat Oct 15, 2005 9:48 pm
Posts: 17
Location: Surrey

PostPosted: Tue Apr 17, 2012 10:44 am    Post subject: Reply with quote

Now that looks good!

I'm trying to load the plusb (Prolific USB Network) driver on a proprietary device that I am told should work with said driver.

However, given the output below I don't think the driver will accept the PID/VID override?

Code:
modinfo plusb
filename:       /lib/modules/2.6.32-5-amd64/kernel/drivers/net/usb/plusb.ko
license:        GPL
description:    Prolific PL-2301/2302 USB Host to Host Link Driver
author:         David Brownell
alias:          usb:v067Bp0001d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v067Bp0000d*dc*dsc*dp*ic*isc*ip*
depends:        usbnet,usbcore
vermagic:       2.6.32-5-amd64 SMP mod_unload modversions


In fact... I may only need the usbnet driver:

Code:
modinfo usbnet
filename:       /lib/modules/2.6.32-5-amd64/kernel/drivers/net/usb/usbnet.ko
license:        GPL
description:    USB network driver framework
author:         David Brownell
depends:        mii,usbcore
vermagic:       2.6.32-5-amd64 SMP mod_unload modversions
parm:           msg_level:Override default message level (int)
Back to top
View user's profile Send private message
ferrari
LXF regular


Joined: Tue May 03, 2005 12:09 pm
Posts: 133

PostPosted: Tue Apr 17, 2012 12:28 pm    Post subject: Reply with quote

Quote:
I'm trying to load the plusb (Prolific USB Network) driver on a proprietary device that I am told should work with said driver.


You may not need to do anything explicitly for this device. Plug in your device and post the output of

Code:
dmesg|tail


That will tell us what the kernel makes of it (if anything).

If there is no ethernet device evident, you could try loading the driver manually
Code:
modprobe plusb
Back to top
View user's profile Send private message
kgolding



Joined: Sat Oct 15, 2005 9:48 pm
Posts: 17
Location: Surrey

PostPosted: Sun Apr 22, 2012 12:31 am    Post subject: Reply with quote

Here's the output from dmesg after plugging the USB device in:
[ 87.004106] usb 4-1: new full speed USB device number 2 using uhci_hcd
[ 87.128067] usb 4-1: device descriptor read/64, error -71
[ 87.356082] usb 4-1: device descriptor read/64, error -71
[ 87.572077] usb 4-1: new full speed USB device number 3 using uhci_hcd
[ 87.696123] usb 4-1: device descriptor read/64, error -71
[ 87.924079] usb 4-1: device descriptor read/64, error -71
[ 88.084104] hub 4-0:1.0: unable to enumerate USB device on port 1
[ 91.088101] usb 4-1: new full speed USB device number 5 using uhci_hcd
[ 91.398819] usbcore: registered new interface driver cdc_ether
[ 91.400398] usbcore: registered new interface driver rndis_host
[ 91.401664] usbcore: registered new interface driver rndis_wlan


And this is what lsusb shows (just the one line relating to that device):
Bus 004 Device 005: ID 238b:0a11

I think I need to tell the usbnet driver to recognised the "238b:0a11" id somehow?

Regards,

Kevin
Back to top
View user's profile Send private message
ferrari
LXF regular


Joined: Tue May 03, 2005 12:09 pm
Posts: 133

PostPosted: Wed Apr 25, 2012 12:55 am    Post subject: Reply with quote

Code:
[ 91.398819] usbcore: registered new interface driver cdc_ether
[ 91.400398] usbcore: registered new interface driver rndis_host
[ 91.401664] usbcore: registered new interface driver rndis_wlan

This looks promising. The cdc_ether driver depends on usbnet being loaded anyway. The rndis_host driver depends on cdc_ether, and rndis_wlan depends on rndis_host. You can check what is loaded with
Code:
lsmod |grep rndis


Check what network interface are present
Code:
ifconfig -a
Back to top
View user's profile Send private message
kgolding



Joined: Sat Oct 15, 2005 9:48 pm
Posts: 17
Location: Surrey

PostPosted: Wed Apr 25, 2012 1:05 am    Post subject: Reply with quote

Thanks again for the help so far!

lsmod is showing the drivers being loaded, but ifconfig -a is not showing any new interfaces being added.

Is there a way to add an interface and map it to the driver?

Kevin
Back to top
View user's profile Send private message
ferrari
LXF regular


Joined: Tue May 03, 2005 12:09 pm
Posts: 133

PostPosted: Wed Apr 25, 2012 9:45 am    Post subject: Reply with quote

Quote:
lsmod is showing the drivers being loaded, but ifconfig -a is not showing any new interfaces being added.

I'm at the limits of my knowledge here (especially as I don't have such a device to play with).

1. Is your device one of these?

http://linuxusbguide.sourceforge.net/USB-guide-1.0.9/x540.html

That was the basis for considering the plusb driver. If not, we're probably trying to go upstream without a paddle Razz

Otherwise, try loading the plusb driver manually
Code:
modprobe plusb

and check if plusb0 exists with the ifconfig command again.

2. BTW, how are you trying to use this device? The following post hints at this device (driver) only working between two Linux machines

http://www.linuxquestions.org/questions/linux-networking-3/prolific-usb-pl2302-linux-windows-699382/

So, I assume you're not trying to plug it into a router for example?

[/url]
Back to top
View user's profile Send private message
kgolding



Joined: Sat Oct 15, 2005 9:48 pm
Posts: 17
Location: Surrey

PostPosted: Wed Apr 25, 2012 10:00 am    Post subject: Reply with quote

I think I'm at the upstream, lack of paddle place, and in way over my head!

I've posted a job on oDesk in a bid to get a resolution.

Thank you VERY much for all your help.

Kevin
Back to top
View user's profile Send private message
ferrari
LXF regular


Joined: Tue May 03, 2005 12:09 pm
Posts: 133

PostPosted: Wed Apr 25, 2012 10:24 am    Post subject: Reply with quote

I had a quick check of the product and vendor codes here:

http://www.linux-usb.org/usb.ids

You device is not listed. I would have expected the vendor code (238b) to be valid at least. (That doesn't bode well for support with a Linux driver, since the kernel depends on these for device recognition).
Back to top
View user's profile Send private message
ferrari
LXF regular


Joined: Tue May 03, 2005 12:09 pm
Posts: 133

PostPosted: Wed Apr 25, 2012 10:26 am    Post subject: Reply with quote

You're welcome. Good luck!
Back to top
View user's profile Send private message
PCNetSpec
LXF regular


Joined: Sun Feb 21, 2010 3:50 pm
Posts: 631
Location: Cornwall UK

PostPosted: Wed Apr 25, 2012 2:30 pm    Post subject: Reply with quote

Have you tried:-

Code:
modprobe plusb
echo 238b 0a11 > /sys/bus/usb/drivers/plusb/new_id


Then re-plugging the device.
_________________
WARNING: You are logged into reality as 'root'... logging in as 'insane' is the only safe option.
Linux in the UK
The Linux Community Forum
Back to top
View user's profile Send private message
kgolding



Joined: Sat Oct 15, 2005 9:48 pm
Posts: 17
Location: Surrey

PostPosted: Thu Apr 26, 2012 1:08 am    Post subject: Reply with quote

Thank you for the suggestion. I have now tried that both before plugging the device in, and after plugging in it. Either way ifconfig -a is not showing an extra network interface.

Kevin
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Hardware All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast