将故障情况进行了梳理,整个环境和相关驱动曾经在openwrt15.05cc内核Linux3.18是能正常工作的。但是由于其他需要,升级了系统之后就出现了当前的这些问题。
linux发行版:openwrt r11816-d5ede68f8b
内核版本:Linux 4.14.160
测试了两批次的LTE模组版本,通过 AT+SGSW查询显示为:
AT+SGSW
SoftwareVersion: SLM750-V_4.0.3_EQ100
InnerVersion: SLM750-V_EQ100_00B.B8E980.B8A1B0_190325_403_C00_V03
Build_date: [Mar 25 2019 20:26:16]
OK
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-B7lZeHv4-1581930115267)(en-resource://database/2605:0)]
gobinet驱动手上拿到两个版本原厂驱动,不知哪个版本为最终版,稳定性情况也不一样。分别为:
Meigsmart_Linux_GobiNet_2016-1-6-0002
Meigsmart_Linux_GobiNet_2016-12-15-0001
两个版本的驱动,在内核4.14上是无法通过编译的,对驱动进行了两处修改则能通过编译:
(1)在QMIDevice.c文件中增加#include
./arch/mips/include/asm/atomic.h:33:38: error: 'refcount_t' has no member named 'counter'
(2)在QMIDevice.c文件中将int ref = atomic_read(&pDev->mQMIDev.mCdev.kobj.kref.refcount);替换为int ref = atomic_long_read(&pDev->mQMIDev.mCdev.kobj.kref.refcount);因为内核4.14中没有atomic_read的定义。
此后驱动交叉编译成功,生成gobinet.ko
下面分别测试两个版本驱动故障情况。
首次加载驱动报以下错误。下面一个版本的驱动也存在该错误。
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-V0QAIZVl-1581930115270)(en-resource://database/2607:0)]
日志:
[ 57.978322] GobiNet: Meigsmart_Linux_GobiNet_2016-1-6-0002
[ 58.064703] GobiNet 1-1.4:1.5 eth1: register 'GobiNet' at usb-101c0000.ehci-1.4, GobiNet Ethernet Device, be:b7:c0:ac:f1:37
[ 58.276718] creating qcqmi1
[ 58.282770] usbcore: registered new interface driver GobiNet
[ 58.296605] ------------[ cut here ]------------
[ 58.305998] WARNING: CPU: 0 PID: 1827 at drivers/usb/core/hcd.c:1529 usb_hcd_map_urb_for_dma+0x164/0x5b8 [usbcore]
[ 58.326629] setup packet is on stack
[ 58.333750] Modules linked in: gobinet rt2800soc rt2800mmio rt2800lib pppoe ppp_async option cdc_mbim usb_wwan rt2x00soc rt2x00mmio rt2x00lib qmi_wwan pppox ppp_generic nf_conntrack_ipv6 mac80211 iptable_nat ipt_REJECT ipt_MASQUERADE huawei_cdc_ncm cfg80211 cdc_subset cdc_ncm xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_FLOWOFFLOAD usbserial usbnet ums_usbat ums_sddr55 ums_sddr09 ums_karma ums_jumpshot ums_isd200 ums_freecom ums_datafab ums_cypress ums_alauda slhc nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack iptable_mangle iptable_filter ip_tables crc_ccitt compat cdc_wdm
[ 58.475649] i2c_gpio i2c_algo_bit nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 nfsv3 nfs lockd sunrpc grace uas usb_storage leds_gpio uhci_hcd ohci_platform ohci_hcd ehci_platform sd_mod scsi_mod ehci_hcd gpio_button_hotplug usbcore nls_base usb_common mii
[ 58.531536] CPU: 0 PID: 1827 Comm: qmi_sync/3 Not tainted 4.14.160 #0
[ 58.544372] Stack : 804f0000 804a58e0 00000000 00000000 8047c888 872fbc7c 87d2cf5c 804cfa27
[ 58.561041] 80478818 00000723 80623660 000005f9 014000c0 00000001 872fbc30 ea971289
[ 58.577714] 00000000 00000000 80620000 80627e68 00000000 000000ed 00000007 00000000
[ 58.594383] 00000000 00000000 00081c50 ffffffff 00000000 00000009 00000000 8740874c
[ 58.611052] 8741b5d0 000005f9 014000c0 00000000 00000000 80231914 00000000 80620000
[ 58.627719] ...
[ 58.632596] Call Trace:
[ 58.637482] [<8000ad84>] show_stack+0x58/0x100
[ 58.646346] [<800272e0>] __warn+0xe4/0x144
[ 58.654516] [<80026f2c>] warn_slowpath_fmt+0x30/0x3c
[ 58.664488] [<8740874c>] usb_hcd_map_urb_for_dma+0x164/0x5b8 [usbcore]
[ 58.677580] [<8740951c>] usb_hcd_submit_urb+0x74c/0x990 [usbcore]
[ 58.689803] [<87353204>] WriteSync+0x1d8/0x460 [gobinet]
[ 58.700416] [<873549c0>] QMIReady+0xc8/0x26c [gobinet]
[ 58.710679] [<87355a24>] qmi_sync_thread+0x28/0x204 [gobinet]
[ 58.722155] [<80042764>] kthread+0x134/0x148
[ 58.730679] [<80005ab8>] ret_from_kernel_thread+0x14/0x1c
[ 58.741449] ---[ end trace 18307be955535299 ]---
/dev/qcqmi1有正常创建,但是usb0网络并没有被创建。
反复重新加载,情况一样。
root@zsjk:/# rmmod gobinet.ko
[ 1855.907158] usbcore: deregistering interface driver GobiNet
[ 1855.937269] GobiNet 1-1.4:1.5 eth1: unregister 'GobiNet' usb-101c0000.ehci-1.4, GobiNet Ethernet Device
root@zsjk:/#
root@zsjk:/# insmod gobinet.ko
[ 1868.204223] GobiNet: Meigsmart_Linux_GobiNet_2016-1-6-0002
[ 1868.218260] GobiNet 1-1.4:1.5 eth1: register 'GobiNet' at usb-101c0000.ehci-1.4, GobiNet Ethernet Device, be:b7:c0:ac:f1:37
[ 1868.272195] creating qcqmi1
[ 1868.278277] usbcore: registered new interface driver GobiNet
root@zsjk:/#
root@zsjk:/# ifconfig
br-lan Link encap:Ethernet HWaddr 30:4A:26:5A:64:A8
inet addr:192.168.30.1 Bcast:192.168.30.255 Mask:255.255.255.0
inet6 addr: fd25:7d48:5f1c::1/60 Scope:Global
inet6 addr: fe80::324a:26ff:fe5a:64a8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:2034 (1.9 KiB)
eth0 Link encap:Ethernet HWaddr 8A:AD:CB:2D:D7:85
inet6 addr: fe80::88ad:cbff:fe2d:d785/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2110 errors:0 dropped:1 overruns:0 frame:0
TX packets:3379 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:429599 (419.5 KiB) TX bytes:485495 (474.1 KiB)
Interrupt:5
eth0.1 Link encap:Ethernet HWaddr 8A:AD:CB:2D:D7:85
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:2034 (1.9 KiB)
eth0.2 Link encap:Ethernet HWaddr 30:4A:26:5A:64:A9
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::324a:26ff:fe5a:64a9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:184 errors:0 dropped:0 overruns:0 frame:0
TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19430 (18.9 KiB) TX bytes:17302 (16.8 KiB)
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:156 errors:0 dropped:0 overruns:0 frame:0
TX packets:156 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11509 (11.2 KiB) TX bytes:11509 (11.2 KiB)
root@zsjk:/#
加载驱动,打印一条故障:GobiNet 1-1.4:1.5 usb0: kevent 12 may have been dropped
经过查询,该错误是有usbnet打印。
root@zsjk:/# insmod gobinet.ko
[ 2026.673983] GobiNet: Meigsmart_Linux_GobiNet_2016-12-15-0001
[ 2026.688374] GobiNet 1-1.4:1.5 usb0: register 'GobiNet' at usb-101c0000.ehci-1.4, GobiNet Ethernet Device, be:b7:c0:ac:f1:37
[ 2026.713748] GobiNet 1-1.4:1.5 usb0: kevent 12 may have been dropped
[ 2026.769737] creating qcqmi0
[ 2026.775800] usbcore: registered new interface driver GobiNet
root@zsjk:/# [ 2026.966163] GobiNet 1-1.4:1.5 usb0: kevent 12 may have been dropped
[ 2026.978740] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
root@zsjk:/#
root@zsjk:/#
root@zsjk:/# ls /dev/qcqmi0
/dev/qcqmi0
root@zsjk:/# ifconfig
br-lan Link encap:Ethernet HWaddr 30:4A:26:5A:64:A8
inet addr:192.168.30.1 Bcast:192.168.30.255 Mask:255.255.255.0
inet6 addr: fd25:7d48:5f1c::1/60 Scope:Global
inet6 addr: fe80::324a:26ff:fe5a:64a8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:2602 (2.5 KiB)
eth0 Link encap:Ethernet HWaddr 8A:AD:CB:2D:D7:85
inet6 addr: fe80::88ad:cbff:fe2d:d785/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3067 errors:0 dropped:1 overruns:0 frame:0
TX packets:3484 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:764543 (746.6 KiB) TX bytes:496549 (484.9 KiB)
Interrupt:5
eth0.1 Link encap:Ethernet HWaddr 8A:AD:CB:2D:D7:85
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:2602 (2.5 KiB)
eth0.2 Link encap:Ethernet HWaddr 30:4A:26:5A:64:A9
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::324a:26ff:fe5a:64a9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1096 errors:0 dropped:4 overruns:0 frame:0
TX packets:210 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:334808 (326.9 KiB) TX bytes:27224 (26.5 KiB)
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:164 errors:0 dropped:0 overruns:0 frame:0
TX packets:164 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12141 (11.8 KiB) TX bytes:12141 (11.8 KiB)
usb0 Link encap:Ethernet HWaddr BE:B7:C0:AC:F1:37
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:110 (110.0 B)
root@zsjk:/#
创建dev和usb0均成功,但是拨号始终不成功,如下所示:
AT+CPIN?
+CPIN: SIM PIN
OK
AT+CPIN="****"
OK
+SIGNALIND:0
+NWTYPEIND:31
+SIGNALIND:99
AT+CPIN?
+CPIN: READY
OK
AT+MODODR=2
OK
+SIGNALIND:4
AT+CLCK="SC",2
+CLCK: 1
OK
+NWTYPEIND:40
+SIGNALIND:5
^MODE: 9, 11
AT+CPIN?
+CPIN: READY
OK
AT+CSQ
+CSQ: 27,99
OK
AT+CREG?
+CREG: 0,1
OK
at+cgdcont=1,"IPV4V6","cmnet"
OK
AT^NDISDUP=1,1,"cmnet","","",0
OK
AT^NDISSTATQRY?
^NDISSTATQRY:Idle
OK
AT^NDISDUP=1,1,"cmnet","","",0
OK
AT^NDISSTATQRY?
^NDISSTATQRY:Idle
OK
此后永远是 ^NDISSTATQRY:Idle,不知与GobiNet 1-1.4:1.5 usb0: kevent 12 may have been dropped是否有关联。
因此到目前为止,gobinet方式入网失败,不知该如何解决,因此尝试ECM方式入网
AT命令切换。
AT+SER=2,1
OK
驱动加载情况:
[ 3040.875634] usb 1-1.4: USB disconnect, device number 85
[ 3040.886556] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[ 3040.902751] option 1-1.4:1.0: device disconnected
[ 3040.912771] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[ 3040.928957] option 1-1.4:1.1: device disconnected
[ 3041.013725] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
[ 3041.029857] option 1-1.4:1.2: device disconnected
[ 3041.039835] option1 ttyUSB3: GSM modem (1-port) converter now disconnected from ttyUSB3
[ 3041.056018] option 1-1.4:1.3: device disconnected
[ 3041.136211] GobiNet 1-1.4:1.5 usb0: unregister 'GobiNet' usb-101c0000.ehci-1.4, GobiNet Ethernet Device
[ 3046.548577] usb 1-1.4: new high-speed USB device number 86 using ehci-platform
[ 3046.734971] option 1-1.4:1.0: GSM modem (1-port) converter detected
[ 3046.747902] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB0
[ 3046.844506] option 1-1.4:1.1: GSM modem (1-port) converter detected
[ 3046.857411] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB1
[ 3046.872078] option 1-1.4:1.2: GSM modem (1-port) converter detected
[ 3046.884932] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB2
[ 3046.899607] option 1-1.4:1.3: GSM modem (1-port) converter detected
[ 3046.912492] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB3
[ 3047.034448] cdc_ether 1-1.4:1.5 usb0: register 'cdc_ether' at usb-101c0000.ehci-1.4, CDC Ethernet Device, 4a:8e:54:d2:81:80
[ 3047.062102] cdc_ether 1-1.4:1.5 usb0: kevent 12 may have been dropped
[ 3047.091808] cdc_ether 1-1.4:1.5 usb0: kevent 11 may have been dropped
有生成usb0,但是/dev/中未生成任何东西。
root@zsjk:/# ifconfig
br-lan Link encap:Ethernet HWaddr 30:4A:26:5A:64:A8
inet addr:192.168.30.1 Bcast:192.168.30.255 Mask:255.255.255.0
inet6 addr: fd25:7d48:5f1c::1/60 Scope:Global
inet6 addr: fe80::324a:26ff:fe5a:64a8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:3106 (3.0 KiB)
eth0 Link encap:Ethernet HWaddr 8A:AD:CB:2D:D7:85
inet6 addr: fe80::88ad:cbff:fe2d:d785/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5420 errors:0 dropped:1 overruns:0 frame:0
TX packets:5936 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1121666 (1.0 MiB) TX bytes:949011 (926.7 KiB)
Interrupt:5
eth0.1 Link encap:Ethernet HWaddr 8A:AD:CB:2D:D7:85
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:3106 (3.0 KiB)
eth0.2 Link encap:Ethernet HWaddr 30:4A:26:5A:64:A9
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::324a:26ff:fe5a:64a9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:649 errors:0 dropped:1 overruns:0 frame:0
TX packets:396 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:110470 (107.8 KiB) TX bytes:53651 (52.3 KiB)
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:222 errors:0 dropped:0 overruns:0 frame:0
TX packets:222 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:16500 (16.1 KiB) TX bytes:16500 (16.1 KiB)
usb0 Link encap:Ethernet HWaddr 4A:8E:54:D2:81:80
inet6 addr: fe80::488e:54ff:fed2:8180/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1192 (1.1 KiB) TX bytes:14076 (13.7 KiB)
root@zsjk:/#
拨号仍然是永远返回idle。。。。
AT^NDISDUP=1,1,“cmnet”,"","",0
OK
AT^NDISSTATQRY?
^NDISSTATQRY:Idle
OK
该问题已经困扰本人1星期多了,望大佬指点该如何下手解决,感谢。