Z-Pocket Game Pro(ZPG Pro)
configfs gadget(ethernet)
參考資訊:
1. modern-usb-gadget-on-linux-and-how-to-integrate-it-with-systemd-part-1
ZPG Pro
$ su # insmod libcomposite.ko # insmod usb_f_fs.ko # insmod u_ether.ko # insmod usb_f_ecm.ko # cd /sys/kernel/config/usb_gadget # mkdir g1 # cd g1 # echo 0x1d6b > idVendor # echo 0x104 > idProduct # mkdir strings/0x409 # echo "Collabora" > strings/0x409/manufacturer # echo "ECM" > strings/0x409/product # mkdir configs/c.1 # mkdir functions/ecm.usb0 # ln -s functions/ecm.usb0/ configs/c.1/ # echo ff300000.usb > UDC # ifconfig usb0 10.0.1.3 netmask 255.255.255.0 # ifconfig usb0 usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.0.1.3 netmask 255.255.255.0 broadcast 10.0.1.255 inet6 fe80::4093:adff:fed9:e41d prefixlen 64 scopeid 0x20<link> ether 42:93:ad:d9:e4:1d txqueuelen 1000 (Ethernet) RX packets 12 bytes 1562 (1.5 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6 bytes 508 (508.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
PC
[ 3865.309695] usb 2-2: new high-speed USB device number 8 using xhci_hcd [ 3865.458504] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0104, bcdDevice= 4.04 [ 3865.458507] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 3865.458509] usb 2-2: Product: ECM [ 3865.458510] usb 2-2: Manufacturer: Collabora [ 3865.491238] cdc_ether 2-2:1.0 usb0: register 'cdc_ether' at usb-0000:00:14.0-2, CDC Ethernet Device, 5a:07:74:09:01:f4 [ 3865.492703] usbcore: registered new interface driver cdc_ether [ 3865.500673] cdc_ether 2-2:1.0 enp0s20u2: renamed from usb0 [ 3865.532488] IPv6: ADDRCONF(NETDEV_UP): enp0s20u2: link is not ready