LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-29-2021, 09:48 AM   #1
somanyquestions
Member
 
Registered: Jan 2019
Distribution: Ubuntu, Debian, Buildroot
Posts: 34

Rep: Reputation: Disabled
Using a detected USB RNDIS gadget as network adapter


I have a RaspberyPi module, with USB connected to another module computer (as USB host) running a down-sized Linux. The RasPi is configured as USB ethernet gadget.

Once I boot the RasPi, and enter dmesg on the host computer, I see:

Code:
[    3.077758] dwc3-of-simple ff9d0000.usb0: dwc3_simple_set_phydata: Can't find usb3-phy
[    3.091950] dwc3-of-simple ff9e0000.usb1: dwc3_simple_set_phydata: Can't find usb3-phy
[    3.115028] usb0: HOST MAC 46:01:81:46:ba:bb
[    3.119307] usb0: MAC e2:8d:53:c9:16:82
...
[ 2918.585759] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[ 2918.738352] usb 1-1: New USB device found, idVendor=0525, idProduct=a4a2, bcdDevice= 5.10
[ 2918.746521] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2918.753649] usb 1-1: Product: RNDIS/Ethernet Gadget
[ 2918.758523] usb 1-1: Manufacturer: Linux 5.10.17-v7+ with 3f980000.usb
So the Raspi is detected as gadget on the USB host computer.
Although I wonder why a "usb0" is indeed assigned a MAC address, and the "usb 1-1" thing is the gadget. Those seem to be different meanings ("name spaces"), as "usb0" has no space before the number, right?

But unlike a previous experiment, where I used yet another RaspberryPi as the host, where it also detected the 1st raspi as gadget and created a usb0 network adapter and assigned an IP configuration to it, this is not the case here. No usb-anything under ifconfig -a. Not listing it with the -a option means that no network device usb0 exists, configured or not, right?

The current host computer runs a rather down-sized Linux based on buildroot/busybox.

Is there perhaps a certain configuration missing that allows using this detected RNDIS gadget for networking - which just happens to be done automatically on the default Raspi Linux distribution - but not necessarily on the buildroot configuration I have?
 
Old 07-30-2021, 07:26 AM   #2
somanyquestions
Member
 
Registered: Jan 2019
Distribution: Ubuntu, Debian, Buildroot
Posts: 34

Original Poster
Rep: Reputation: Disabled
I was looking through the unpacked file that I find in /proc/config.gz on the host system.

Edit: removed another question, now as own question in the kernel subforum.
--
The option # CONFIG_USB_NET_DRIVERS is not set sounds possibly relevant, I have not found an exact definition of what it does, though.

What I also found is that, the host side counterpart to the gadget device's g_ether driver, is supposedly the cdc_ether driver.
I found mentions of CONFIG_USB_NET_CDCETHER, CONFIG_USB_USBNET and other USB_NET options that supposedly need to be on.
But my config file does not contain that text except for the mentioned CONFIG_USB_NET_DRIVERS.
(I currently don't have access to the buildroot config stuff that created this Linux image, so I'm looking for clues in the config as-is on system)

Edit:

As mentioned here: https://www.linuxquestions.org/quest...el-4175698502/,
dependant options may not be included in a config file if the main option is disabled.

My kernel configuration has now these things on and I now get a "usb0" interface shown under "ifconfig -a":
  • CONFIG_USB_NET_DRIVERS
  • CONFIG_USB_USBNET
  • CONFIG_USB_NET_CDCETHER
  • CONFIG_USB_NET_CDC_EEM

next to options generally enabling USB and enable it as a host (or dual role).

Last edited by somanyquestions; 08-02-2021 at 06:47 AM. Reason: SOLVED
 
  


Reply

Tags
buildroot, busybox, gadget, usb



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
[gadget driver] HOST turns unresponsive to gadget driver niroop Linux - Embedded & Single-board computer 4 04-22-2015 08:30 AM
RNDIS - how to get USB->Ethernet mapping? brundlefly Linux - Networking 1 07-02-2012 02:20 PM
RNDIS - how to get USB->Ethernet mapping? brundlefly Linux - General 0 06-30-2012 11:54 AM
USB Device Driver and RNDIS Initialization wcdanie General 0 05-29-2009 12:39 PM
usb-rndis-lite and syncE and PDA's. ...missing cdc_ether. MikeOfAustin Linux - Software 0 06-17-2007 07:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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