Forums » Software Development »
How to make usb to ethernet work ?
Added by Samuel Paul 4 days ago
I am working with Maxim on the same machine.
We would like be able to make usb to ethernet adapter work.
Replies (2)
RE: How to make usb to ethernet work ? - Added by Mike Fiorenza 4 days ago
Hi Samuel,
To use a USB-to-Ethernet adapter, the Linux kernel needs to include the appropriate USB networking driver for the adapter chipset.
For the USB Ethernet adapters we have been using, the required kernel option is:
CONFIG_USB_NET_CDC_NCM
This can be enabled through make menuconfig when configuring the kernel.
From the kernel source directory, run:
make menuconfig
Then navigate to:
Device Drivers
-> Network device support
-> USB Network Adapters
-> CDC NCM support
Enable CDC NCM support as a module:
<M> CDC NCM support
If your adapter uses a different chipset, you may need to enable a different driver in the same USB Network Adapters menu. Common alternatives include:
CONFIG_USB_NET_AX8817X - ASIX AX88xxx based USB 2.0 Ethernet adapters CONFIG_USB_NET_AX88179_178A - ASIX AX88179/178A USB 3.0 Ethernet adapters CONFIG_USB_NET_SMSC75XX - SMSC LAN75XX based USB 2.0 gigabit adapters CONFIG_USB_NET_SMSC95XX - SMSC LAN95XX based USB 2.0 adapters CONFIG_USB_RTL8152 - Realtek RTL8152/RTL8153 USB Ethernet adapters
It is also fine to enable several of these as modules at the same time. When the USB Ethernet adapter is plugged in, the kernel should detect the device ID and load the matching driver module automatically, assuming the module is installed on the target filesystem.
After saving the configuration, rebuild and reinstall the kernel modules. You can follow the instructions on our Linux Kernel wiki page here:
https://support.criticallink.com/redmine/projects/mitysom_a5/wiki/Linux_Kernel
Once the updated modules are installed and the board is rebooted, plug in the USB-to-Ethernet adapter and check whether the driver loads:
dmesg | grep -i usb lsmod ip link
dmesg should show the USB device being detected and the associated network driver binding to it.
lsmod can be used to confirm that the expected module, such as cdc_ncm, ax8817x, ax88179_178a, smsc75xx, smsc95xx, or r8152, is loaded.
ip link should show a new network interface appear, typically with a predictable name such as en*.
- Mike
RE: How to make usb to ethernet work ? - Added by Samuel Paul 4 days ago
Thanks Mike
Now I have 3 ip devices (including the usb/ethernet on usb-c)
root@mity-a5e:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: enu1u3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:e0:4c:21:13:28 brd ff:ff:ff:ff:ff:ff
inet 192.168.64.63/24 metric 10 brd 192.168.64.255 scope global dynamic enu1u3
valid_lft 42660sec preferred_lft 42660sec
inet6 fe80::2e0:4cff:fe21:1328/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
5: enu1u1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:e0:4c:0a:23:14 brd ff:ff:ff:ff:ff:ff
inet 192.168.64.156/24 metric 10 brd 192.168.64.255 scope global dynamic enu1u1
valid_lft 42994sec preferred_lft 42994sec
inet6 fe80::2e0:4cff:fe0a:2314/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
6: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 4e:c4:bc:f6:94:32 brd ff:ff:ff:ff:ff:ff
inet 10.1.47.2/24 brd 10.1.47.255 scope global usb0
valid_lft forever preferred_lft forever
inet6 fe80::4cc4:bcff:fef6:9432/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
root@mity-a5e:~#
Now I have 1000 Mbps on both usb (realtech driver) ethernet driver
root@mity-a5e:~# cat /sys/class/net/enu1u3/speed
1000
root@mity-a5e:~# cat /sys/class/net/enu1u1/speed
1000
