Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
resources:tools-software:linuxdsp:docs:linux-kernel-and-drivers:usb:device_mode:gdaget_eth [15 Jul 2020 08:54] – [Example Usage] sullivan liuresources:tools-software:linuxdsp:docs:linux-kernel-and-drivers:usb:device_mode:gdaget_eth [27 Jul 2020 08:05] – [Software Configuration] cathy fang
Line 1: Line 1:
 ====== USB Gadget Ethernet ====== ====== USB Gadget Ethernet ======
-Gadget Ethernet allows [[https://en.wikipedia.org/wiki/Ethernet_over_USB|Ethernet emulation over USB]], allowing the reading/writing at higher speeds than most Wifi connections. This page provides a approach how to use the USB Gadget Ethernet Feature on ADSP-SC5XX board and give a brief Example usage:+Gadget Ethernet allows [[https://en.wikipedia.org/wiki/Ethernet_over_USB|Ethernet emulation over USB]], allowing the reading/writing at higher speeds than most Wifi connections. This page provides a approach how to use the USB Gadget Ethernet Feature on ADSP-SC5xx board and give a brief Example usage:
  
 ---- ----
Line 42: Line 42:
      [*]       RNDIS support      [*]       RNDIS support
 </code> </code>
-<WRAP center round todo 100%> +
-ifconfig and some commands depend on the ethnert feature +
-</WRAP>+
  
 ---- ----
Line 93: Line 91:
 With following command you should be able to see the USB Ethernet device is there on your HOST: With following command you should be able to see the USB Ethernet device is there on your HOST:
 <code c++> <code c++>
-# sudo su +test@madara:~# sudo su 
-test@madara:~# lsusb+root@madara:~# lsusb
 Bus 002 Device 040: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadge Bus 002 Device 040: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadge
-test@madara:~# dmesg+root@madara:~# dmesg
 [84172.819820] usb 2-1.4: new high-speed USB device number 41 using ehci-pci [84172.819820] usb 2-1.4: new high-speed USB device number 41 using ehci-pci
 [84172.929056] usb 2-1.4: New USB device found, idVendor=0525, idProduct=a4a2 [84172.929056] usb 2-1.4: New USB device found, idVendor=0525, idProduct=a4a2
Line 105: Line 103:
 [84172.940300] cdc_ether 2-1.4:1.0 eth2: register 'cdc_ether' at usb-0000:00:1d.0-1.4, CDC Ethernet Device, 00:dc:c8:f7:75:05 [84172.940300] cdc_ether 2-1.4:1.0 eth2: register 'cdc_ether' at usb-0000:00:1d.0-1.4, CDC Ethernet Device, 00:dc:c8:f7:75:05
 </code> </code>
-so the "eth2" is the target USB Ethernet Device.+ 
 <code c++> <code c++>
-test@madara:~# ifconfig eth2 up +test@madara:~# ifconfig 
-test@madara:~# ifconfig eth2 192.168.1.56 +enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500 
-$ ifconfig +        inet 10.99.24.131  netmask 255.255.255.0  broadcast 10.99.24.255 
-eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500 +        inet6 fe80::939d:a9eb:5e47:8d9e  prefixlen 64  scopeid 0x20<link> 
-        inet 192.168.1.56  netmask 255.255.255.0  broadcast 192.168.1.255 +        ether f4:8e:38:a2:b4:a2  txqueuelen 1000  (Ethernet) 
-        inet6 fe80::2dc:c8ff:fef7:7505  prefixlen 64  scopeid 0x20<link>+        RX packets 1927975  bytes 1412135935 (1.4 GB) 
 +        RX errors 0  dropped 0  overruns 0  frame 0 
 +        TX packets 1836232  bytes 1655848202 (1.6 GB) 
 +        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 
 + 
 +enx00dcc8f77505: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500 
 +        inet6 fe80::5e85:dcad:f5f7:1bfc  prefixlen 64  scopeid 0x20<link>
         ether 00:dc:c8:f7:75:05  txqueuelen 1000  (Ethernet)         ether 00:dc:c8:f7:75:05  txqueuelen 1000  (Ethernet)
-        RX packets  bytes 96 (96.0 B)+        RX packets 37  bytes 6943 (6.9 KB)
         RX errors 0  dropped 0  overruns 0  frame 0         RX errors 0  dropped 0  overruns 0  frame 0
-        TX packets 81  bytes 9574 (9.KB)+        TX packets 37  bytes 7288 (7.KB)
         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 +
 +lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
 +        inet 127.0.0.1  netmask 255.0.0.0
 +        inet6 ::1  prefixlen 128  scopeid 0x10<host>
 +        loop  txqueuelen 1000  (Local Loopback)
 +        RX packets 11377  bytes 1017513 (1.0 MB)
 +        RX errors 0  dropped 0  overruns 0  frame 0
 +        TX packets 11377  bytes 1017513 (1.0 MB)
 +        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 +</code>
 +
 +Thought compared the commands output of dmesg and ifconfig, we can see the ether address of enx00dcc8f77505   is same with  CDC Ethernet Device. So the "**enx00dcc8f77505**" is the target USB Ethernet Device.
 +<code c++>
 +test@madara:~# ifconfig enx00dcc8f77505 up
 +test@madara:~# ifconfig enx00dcc8f77505 192.168.1.67
 +
 +enx00dcc8f77505: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
 +        inet 192.168.1.67  netmask 255.255.255.0  broadcast 192.168.1.255
 +        inet6 fe80::5e85:dcad:f5f7:1bfc  prefixlen 64  scopeid 0x20<link>
 +        ether 00:dc:c8:f7:75:05  txqueuelen 1000  (Ethernet)
 +        RX packets 40  bytes 7373 (7.3 KB)
 +        RX errors 0  dropped 0  overruns 0  frame 0
 +        TX packets 86  bytes 18058 (18.0 KB)
 +        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 +</code>
 ---- ----
 Ping the target board: Ping the target board:
resources/tools-software/linuxdsp/docs/linux-kernel-and-drivers/usb/device_mode/gdaget_eth.txt · Last modified: 27 Jan 2021 22:35 by Robin Getz