4. imx8mmini新增USB网口
imx8mmini 本身只有一个物理网口,可以使用 usb 接口外接一个usb网口
我使用的是绿联的 USB3.0 HUB转换器:绿联USB3.0 HUB网卡转换器 (lulian.cn)
配置Linux,使用的内核是Linux5.15.114
在 .config 里加入
CONFIG_USB_NET_AX88179_178A=y
重新编译烧录,可以识别到USB网卡,但是报错如下
Press the [f] key and hit [enter] to enter failsafe mode Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level [ 3.300177] usb 1-1.2.1: new high-speed USB device number 4 using ci_hdrc [ 3.728890] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0002: -32 [ 3.746122] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0002: -32 [ 3.971513] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32 [ 4.096640] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to read reg index 0x0006: -32 [ 4.106749] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): invalid MAC address, using random [ 4.124172] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0006: -32 [ 4.142739] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0005: -32 [ 4.159994] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32 [ 4.177027] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32 [ 4.195642] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32 [ 4.212944] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32 [ 4.230024] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0002: -32 [ 4.248937] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32 [ 4.266327] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0002: -32 [ 4.283563] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to read reg index 0x0001: -32 [ 4.302112] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32 [ 4.319381] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x001f: -32 [ 4.336624] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0019: -32 [ 4.355136] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x001f: -32 [ 4.372385] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x000d: -32 [ 4.389615] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x000e: -32 [ 4.408113] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x000d: -32 [ 4.425359] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to read reg index 0x000e: -32 [ 4.442641] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x000d: -32 [ 4.461133] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x000e: -32 [ 4.478378] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x000d: -32 [ 4.495615] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x000e: -32 [ 4.514385] ax88179_178a 1-1.2.1:2.0 (unnamed net_device) (uninitialized): Failed to read reg index 0x0000: -32 [ 4.524951] ax88179_178a 1-1.2.1:2.0 eth1: register 'ax88179_178a' at usb-ci_hdrc.1-1.2.1, ASIX AX88179 USB 3.0 Gigabit Ethernet, 2a:5b:a6:ff:38:64 [ 4.616970] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0002: -32 [ 4.634110] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0002: -32 [ 4.861005] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32 [ 4.983879] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to read reg index 0x0006: -32 [ 4.993982] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): invalid MAC address, using random [ 5.011450] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0006: -32 [ 5.028429] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0005: -32 [ 5.047364] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32 [ 5.064488] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32 [ 5.081886] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32 [ 5.100490] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32 [ 5.117926] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0002: -32 [ 5.135135] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32 [ 5.153865] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0002: -32 [ 5.171136] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to read reg index 0x0001: -32 [ 5.188263] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32 [ 5.206802] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x001f: -32 [ 5.224254] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0019: -32 [ 5.241718] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x001f: -32 [ 5.258320] loop0: detected capacity change from 0 to 213160 [ 5.260541] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x000d: -32 [ 5.280406] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x000e: -32 [ 5.297935] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x000d: -32 [ 5.316575] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to read reg index 0x000e: -32 [ 5.320401] loop0: detected capacity change from 213160 to 206248 [ 5.333717] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x000d: -32 [ 5.334298] mount_root: overlay filesystem in /dev/loop0 has not been formatted yet [ 5.350937] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x000e: -32 [ 5.369596] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x000d: -32 [ 5.386666] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x000e: -32 [ 5.404348] ax88179_178a 1-1.2.1:2.1 (unnamed net_device) (uninitialized): Failed to read reg index 0x0000: -32 [ 5.415046] ax88179_178a 1-1.2.1:2.1 eth2: register 'ax88179_178a' at usb-ci_hdrc.1-1.2.1, ASIX AX88179 USB 3.0 Gigabit Ethernet, 16:43:fe:ad:79:58 [ 6.451641] usb 1-1.2.1: USB disconnect, device number 4 [ 6.457120] ax88179_178a 1-1.2.1:2.0 eth1: unregister 'ax88179_178a' usb-ci_hdrc.1-1.2.1, ASIX AX88179 USB 3.0 Gigabit Ethernet [ 6.487819] ax88179_178a 1-1.2.1:2.0 eth1 (unregistered): Failed to write reg index 0x0002: -19 [ 6.496554] ax88179_178a 1-1.2.1:2.0 eth1 (unregistered): Failed to write reg index 0x0001: -19 [ 6.505268] ax88179_178a 1-1.2.1:2.0 eth1 (unregistered): Failed to write reg index 0x0002: -19 [ 6.514187] ax88179_178a 1-1.2.1:2.1 eth2: unregister 'ax88179_178a' usb-ci_hdrc.1-1.2.1, ASIX AX88179 USB 3.0 Gigabit Ethernet [ 6.539813] ax88179_178a 1-1.2.1:2.1 eth2 (unregistered): Failed to write reg index 0x0002: -19 [ 6.548541] ax88179_178a 1-1.2.1:2.1 eth2 (unregistered): Failed to write reg index 0x0001: -19 [ 6.557255] ax88179_178a 1-1.2.1:2.1 eth2 (unregistered): Failed to write reg index 0x0002: -19 [ 7.360153] usb 1-1.2.1: new high-speed USB device number 5 using ci_hdrc
参考网友的帖子:Ubuntu 22.04 安装使用绿联千兆网口 AX88179 - 九层台 (wj2015.com)
git地址:git clone https://github.com/nothingstopsme/AX88179_178A_Linux_Driver
更替 linux-5.15.114/drivers/net/usb/ax88179_178a.c 驱动文件
重新编译,不会报错了:
Press the [f] key and hit [enter] to enter failsafe mode Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level [ 3.236030] usb 1-1.2.1: new high-speed USB device number 4 using ci_hdrc [ 4.024823] ax88179_178a 1-1.2.1:1.0 (unnamed net_device) (uninitialized): Found invalid EEPROM MAC address value: [ff-ff-ff-ff-ff-ff] [ 4.203706] ax88179_178a 1-1.2.1:1.0 (unnamed net_device) (uninitialized): Found invalid EEPROM part or non-EEPROM [ 4.387176] ax88179_178a 1-1.2.1:1.0 (unnamed net_device) (uninitialized): Failed to read reg index 0x0040: -32 [ 4.593186] ax88179_178a 1-1.2.1:1.0 (unnamed net_device) (uninitialized): ASIX USB Ethernet Adapter:v1.20.0 http://www.asix.com.tw [ 4.605123] ax88179_178a 1-1.2.1:1.0 (unnamed net_device) (uninitialized): mtu 1500 [ 4.613338] ax88179_178a 1-1.2.1:1.0 eth1: register 'ax88179_178a' at usb-ci_hdrc.1-1.2.1, , 00:0e:c6:8e:03:74 [ 5.193878] loop0: detected capacity change from 0 to 213160 [ 5.216335] loop0: detected capacity change from 213160 to 206248 [ 5.224066] mount_root: overlay filesystem in /dev/loop0 has not been formatted yet [ 7.204680] fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx [ 7.212493] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
可以使用两个物理网卡了,eth0 和 eth1(usB网卡)
root@OpenWrt:/# ifconfig br-lan Link encap:Ethernet HWaddr A6:F7:1A:73:9B:2D inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fd4f:9478:947f::1/60 Scope:Global inet6 addr: fe80::a4f7:1aff:fe73:9b2d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:382 errors:0 dropped:0 overruns:0 frame:0 TX packets:343 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:36902 (36.0 KiB) TX bytes:36756 (35.8 KiB) eth0 Link encap:Ethernet HWaddr A6:F7:1A:73:9B:2D UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:382 errors:0 dropped:0 overruns:0 frame:0 TX packets:344 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:44542 (43.4 KiB) TX bytes:36846 (35.9 KiB) eth1 Link encap:Ethernet HWaddr 00:0E:C6:8E:03:74 UP BROADCAST 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) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:32 errors:0 dropped:0 overruns:0 frame:0 TX packets:32 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2496 (2.4 KiB) TX bytes:2496 (2.4 KiB)
posted on 2024-09-11 17:20 f1engmin11 阅读(25) 评论(0) 编辑 收藏 举报