LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 02-16-2012, 10:12 PM   #1
cytan299
LQ Newbie
 
Registered: Feb 2012
Posts: 7

Rep: Reputation: Disabled
Cannot get g_ether usbnet working


Hi guys,
I have connected with a USB A/B cable from my LINUX host to my ARM. On my ARM, I have loaded g_ether, usbnet, cdc_subset and mii:
***************************************

# lsmod
Module Size Used by Not tainted
cdc_subset 476 0
usbnet 10470 1 cdc_subset
mii 2872 1 usbnet
g_ether 23528 0
af_packet 15388 2
enc28j60 13992 0
unix 16952 10

********************************************

and have ifconfig'd usb0:

***********************************************
usb0 Link encap:Ethernet HWaddr 4E:72:14:45:30:F9
inet addr:192.168.2.10 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
***********************************************

On by LINUX host, I've also loaded g_ether:
************************************************
cytan@ubuntu:/usr/share/wireshark$ lsmod | grep cdc
cdc_ether 13536 0
cdc_subset 12885 0
usbnet 26212 2 cdc_ether,cdc_subset
cytan@ubuntu:/usr/share/wireshark$ lsmod | grep g_ether
g_ether 49416 0
dummy_hcd 23509 1 g_ether

**************************************************

and ifconfig'd usb0 on the LINUX host:

*****************
usb0 Link encap:Ethernet HWaddr c2:25:5f:d4:45:6d
inet addr:192.168.2.5 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::c025:5fff:fed4:456d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:532 errors:0 dropped:0 overruns:0 frame:0
TX packets:433 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:81620 (81.6 KB) TX bytes:87652 (87.6 KB)
********************************

Unfortunately pinging my ARM gadget 192.168.2.10 with my host, there is no route to the gadget. Similarly the other way around. Note: I've also added a default gateway to my ARM: route add default gw 192.168.2.5

I checked that the host is actually seeing the gadget by checking
/sys/kernel/debug/usb/devices

***********************************
T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 12 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 0
P: Vendor=0525 ProdID=a4a2 Rev= 3.12
S: Manufacturer=Linux 2.6.39.4 with s3c2410_udc
S: Product=RNDIS/Ethernet Gadget
*************************************

And so the LINUX host does see my ARM gadget.

Is there something else I need to do to get my gadget recognized by the LINUX host so that I can ping it and get usbnet working?

Thanks!

cytan
 
Old 02-20-2012, 07:01 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
What does the route cache show in the linux side or from the ARM?

Quote:
--# route -n
or
Quote:
--# netstat -r

See that the route i-faces point to your g_ether.

Since it is RNDIS enabled, have you read this already? What linux kernel are you running?
 
Old 02-20-2012, 08:15 PM   #3
cytan299
LQ Newbie
 
Registered: Feb 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hi malek,
Unbelievable, my 3.5 month old ASUS just had a hard drive crash! Fortunately, I actually have backup of the linux partition before the drive complete gave out. But I don't have a LINUX box to run my ARM cross compiler right now and will only have it when I RMA the ASUS.

However, just for your info my ARM is running LINUX 2.6.39.4 and the host is running UBUNTU 11.10.

Reading from your link about rndis, do I actually need a USB hub between my ARM and my LINUX host? Is a simple USB A/B cable is not sufficient?

Also another interesting observation is that running ethtool on the ARM gives "LINK: no". Any thoughts?
 
Old 02-22-2012, 06:23 AM   #4
cytan299
LQ Newbie
 
Registered: Feb 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Another interesting data point: I connected the ARM to my MacBook Pro and ran ethtool on the ARM and I get a Link: yes! Unfortunately, I don't think there is RNDIS available on the Mac. Any words of wisdom?
 
Old 02-24-2012, 07:48 AM   #5
cytan299
LQ Newbie
 
Registered: Feb 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Solved! (at least on Mac OSX and WinXP)

I don't know why usbnet is not working on my LINUX box (it's still being repaired). BUT usbnet works without any changes on WinXP with linux.inf driver from http://code.google.com/p/beagleboard...name=linux.inf loaded.

On Mac OSX, it required the AJZaurusUSB driver from http://projects.goldelico.com/p/AJZaurusUSB/ and then modifying its info.plist file to add the linux product id and vendor id's. (idProduct is 4216 and idVendor is 1317, See http://docwiki.gumstix.org/index.php/Setting_up_USBnet for modification instructions) Then most importantly, g_ether *must* be loaded with the parameter

modprobe g_ether use_eem=0

to disable RNDIS because Mac OSX does not support RNDIS.

I'll have to wait for my LINUX box to be repaired before I can test usbnet with it.

I hope the above info is useful for others.
 
Old 03-05-2012, 07:44 AM   #6
cytan299
LQ Newbie
 
Registered: Feb 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
OK, I got my Ubuntu box back and it also requires use_eem=0 for the gadget to be recognized. It shows up as a USB2 device and needs to be configured using system setup-> network. For some reason using ifconfig on the command line is not sufficient because it keeps getting reset, i.e. gets disconnected on the Ubuntu box.
 
  


Reply



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
[SOLVED] usbnet cables risto.id24 Linux - Hardware 1 07-20-2011 05:46 PM
linux usbnet lemonk Linux - Networking 3 06-17-2009 07:24 PM
g_ether Configuration mpapet Linux - Laptop and Netbook 0 10-16-2006 06:23 PM
USBNet not working... williamjonah Linux - Hardware 1 06-10-2005 05:01 PM
Hotplug usbnet mimsmall Linspire/Freespire 0 01-05-2005 03:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 05:04 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration