OpenWrt Forum Archive

Topic: usb modem ndis card init during openwrt boot

The content of this topic has been archived on 29 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi!
I have a Huawei e3272s usb modem.
It doesn't have QMI capability (as long as it has HiSilicon Balong V7R1 chipset, thanks to libqmi-devel guys I know it now).
Anyway before I knew QMI would not work, I installed

opkg install usb-modeswitch kmod-mii kmod-usb-net kmod-usb-wdm kmod-usb-net-qmi-wwan uqmi

following QMI lte HowTO.

And if I plug usb modem then openwrt has alredy booted, it works fine: ndis card appears as eth2, it gets ip adress from modem's dhcp server, sd card reader works as well.

But if I reboot router with the modem plugged in, ndis card is not available after openwrt boots. Although sd card reader works ok.

Could anyone please advise work-around?

Here is dmesg of boot (eth2 is absent):

[    0.000000] Linux version 3.18.18 (sm@ubuntu) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r46307) ) #6 Thu Jul 16 22:40:38 MSK 2015
[    0.000000] MyLoader: sysp=bbcc9f9f, boardp=b21b307a, parts=a3adf85e
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[    0.000000] SoC: Atheros AR9341 rev 3
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x01ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x01ffffff]
[    0.000000] Initmem setup node 0 [mem 0x00000000-0x01ffffff]
[    0.000000] On node 0 totalpages: 8192
[    0.000000] free_area_init_node: node 0, pgdat 8035a0f0, node_mem_map 81000000
[    0.000000]   Normal zone: 64 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 8192 pages, LIFO batch:0
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line:  board=TL-WR842N-v2  console=ttyS0,115200 rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 28456K/32768K available (2484K kernel code, 126K rwdata, 528K rodata, 244K init, 188K bss, 4312K reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:51
[    0.000000] Clocks: CPU:535.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz
[    0.000000] Calibrating delay loop... 266.64 BogoMIPS (lpj=1333248)
[    0.080000] pid_max: default: 32768 minimum: 301
[    0.080000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.100000] NET: Registered protocol family 16
[    0.100000] MIPS: machine is TP-LINK TL-WR842N/ND v2
[    0.560000] Switched to clocksource MIPS
[    0.560000] NET: Registered protocol family 2
[    0.570000] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.570000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.580000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.580000] TCP: reno registered
[    0.590000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.590000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.600000] NET: Registered protocol family 1
[    0.600000] PCI: CLS 0 bytes, default 32
[    0.600000] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.630000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.630000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.640000] msgmni has been set to 55
[    0.650000] io scheduler noop registered
[    0.660000] io scheduler deadline registered (default)
[    0.660000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.670000] console [ttyS0] disabled
[    0.690000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 1562500) is a 16550A
[    0.700000] console [ttyS0] enabled
[    0.710000] bootconsole [early0] disabled
[    0.720000] m25p80 spi0.0: found s25fl064k, expected m25p80
[    0.720000] m25p80 spi0.0: s25fl064k (8192 Kbytes)
[    0.730000] 5 tp-link partitions found on MTD device spi0.0
[    0.740000] Creating 5 MTD partitions on "spi0.0":
[    0.740000] 0x000000000000-0x000000020000 : "u-boot"
[    0.750000] 0x000000020000-0x00000013621c : "kernel"
[    0.750000] 0x00000013621c-0x0000007f0000 : "rootfs"
[    0.760000] mtd: device 2 (rootfs) set to be root filesystem
[    0.760000] 1 squashfs-split partitions found on MTD device rootfs
[    0.770000] 0x000000350000-0x0000007f0000 : "rootfs_data"
[    0.780000] 0x0000007f0000-0x000000800000 : "art"
[    0.780000] 0x000000020000-0x0000007f0000 : "firmware"
[    0.810000] libphy: ag71xx_mdio: probed
[    1.410000] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.1:00 [uid=004dd042, driver=Generic PHY]
[    1.420000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
[    2.010000] ag71xx-mdio.1: Found an AR934X built-in switch
[    2.050000] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:GMII
[    2.060000] TCP: cubic registered
[    2.060000] NET: Registered protocol family 17
[    2.070000] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    2.080000] 8021q: 802.1Q VLAN Support v1.8
[    2.090000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    2.100000] Freeing unused kernel memory: 244K (80373000 - 803b0000)
[    3.120000] init: Console is alive
[    3.120000] init: - watchdog -
[    4.550000] usbcore: registered new interface driver usbfs
[    4.550000] usbcore: registered new interface driver hub
[    4.560000] usbcore: registered new device driver usb
[    4.580000] SCSI subsystem initialized
[    4.590000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.600000] ehci-platform: EHCI generic platform driver
[    4.600000] ehci-platform ehci-platform: EHCI Host Controller
[    4.610000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[    4.620000] ehci-platform ehci-platform: TX-TX IDP fix enabled
[    4.630000] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[    4.650000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[    4.650000] hub 1-0:1.0: USB hub found
[    4.660000] hub 1-0:1.0: 1 port detected
[    4.660000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    4.670000] ohci-platform: OHCI generic platform driver
[    4.680000] uhci_hcd: USB Universal Host Controller Interface driver
[    4.690000] usbcore: registered new interface driver usb-storage
[    5.130000] init: - preinit -
[    5.770000] random: procd urandom read with 9 bits of entropy available
[    9.100000] jffs2: notice: (356) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[    9.130000] mount_root: loading kmods from internal overlay
[    9.450000] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[    9.460000] block: unable to load configuration (fstab: Entry not found)
[    9.470000] block: attempting to load /tmp/jffs_cfg/etc/config/fstab
[    9.480000] block: unable to load configuration (fstab: Entry not found)
[    9.490000] block: attempting to load /etc/config/fstab
[    9.490000] block: unable to load configuration (fstab: Entry not found)
[    9.500000] block: no usable configuration
[    9.510000] mount_root: switching to jffs2 overlay
[    9.560000] procd: - early -
[    9.560000] procd: - watchdog -
[   10.370000] procd: - ubus -
[   11.390000] procd: - init -
[   12.260000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[   12.410000] usb-storage 1-1:1.0: USB Mass Storage device detected
[   12.440000] scsi host0: usb-storage 1-1:1.0
[   12.550000] NET: Registered protocol family 10
[   12.560000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   12.590000] usbcore: registered new interface driver cdc_wdm
[   12.600000] Loading modules backported from Linux version master-2015-06-22-0-g4732c92
[   12.610000] Backport generated by backports.git backports-20150626-0-gc1a4168
[   12.620000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   12.650000] nf_conntrack version 0.5.0 (448 buckets, 1792 max)
[   12.710000] usbcore: registered new interface driver usbserial
[   12.720000] usbcore: registered new interface driver usbserial_generic
[   12.720000] usbserial: USB Serial support registered for generic
[   12.770000] xt_time: kernel timezone is -0000
[   12.780000] usbcore: registered new interface driver cdc_ether
[   12.790000] usbcore: registered new interface driver cdc_ncm
[   12.830000] cfg80211: Calling CRDA to update world regulatory domain
[   12.850000] usbcore: registered new interface driver huawei_cdc_ncm
[   12.860000] cfg80211: World regulatory domain updated:
[   12.860000] cfg80211:  DFS Master region: unset
[   12.860000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[   12.880000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   12.880000] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   12.890000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[   12.900000] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[   12.910000] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[   12.920000] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[   12.930000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[   12.940000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[   13.050000] PPP generic driver version 2.4.2
[   13.070000] NET: Registered protocol family 24
[   13.160000] usbcore: registered new interface driver cdc_mbim
[   13.230000] ath: EEPROM regdomain: 0x0
[   13.230000] ath: EEPROM indicates default country code should be used
[   13.230000] ath: doing EEPROM country->regdmn map search
[   13.230000] ath: country maps to regdmn code: 0x3a
[   13.230000] ath: Country alpha2 being used: US
[   13.230000] ath: Regpair used: 0x3a
[   13.240000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   13.250000] ieee80211 phy0: Atheros AR9340 Rev:3 mem=0xb8100000, irq=47
[   13.260000] cfg80211: Calling CRDA for country: US
[   13.260000] cfg80211: Regulatory domain changed to country: US
[   13.270000] cfg80211:  DFS Master region: FCC
[   13.270000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[   13.280000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 mBm), (N/A)
[   13.290000] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 1700 mBm), (N/A)
[   13.300000] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2300 mBm), (0 s)
[   13.310000] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2300 mBm), (0 s)
[   13.320000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A)
[   13.330000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
[   13.440000] scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[   13.480000] usb 1-1: USB disconnect, device number 2
[   17.200000] usb 1-1: new high-speed USB device number 3 using ehci-platform
[   17.390000] usb-storage 1-1:1.2: USB Mass Storage device detected
[   17.450000] scsi host1: usb-storage 1-1:1.2
[   18.660000] scsi 1:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
[   18.670000] sd 1:0:0:0: [sda] 31422464 512-byte logical blocks: (16.0 GB/14.9 GiB)
[   18.710000] sd 1:0:0:0: [sda] Write Protect is off
[   18.710000] sd 1:0:0:0: [sda] Mode Sense: 0f 00 00 00
[   18.750000] sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   18.760000]  sda: sda1
[   18.770000] sd 1:0:0:0: [sda] Attached SCSI removable disk
[   22.300000] device eth1 entered promiscuous mode
[   22.320000] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   22.350000] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   24.690000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   24.710000] device wlan0 entered promiscuous mode
[   26.320000] br-lan: port 2(wlan0) entered forwarding state
[   26.330000] br-lan: port 2(wlan0) entered forwarding state
[   26.330000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   26.360000] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   28.330000] br-lan: port 2(wlan0) entered forwarding state
[   43.190000] random: nonblocking pool is initialized

and here is dmesg if I plug usb stick in when openwrt is booted

[  120.820000] usb 1-1: USB disconnect, device number 3
[  120.830000] sd 1:0:0:0: [sda] Synchronizing SCSI cache
[  120.840000] sd 1:0:0:0: [sda]  
[  120.840000] Result: hostbyte=0x01 driverbyte=0x00
[  139.600000] usb 1-1: new high-speed USB device number 4 using ehci-platform
[  139.750000] usb-storage 1-1:1.0: USB Mass Storage device detected
[  139.770000] scsi host2: usb-storage 1-1:1.0
[  140.210000] usb 1-1: USB disconnect, device number 4
[  140.660000] usb 1-1: new high-speed USB device number 5 using ehci-platform
[  140.830000] cdc_ether 1-1:1.0 eth2: register 'cdc_ether' at usb-ehci-platform-1, CDC Ethernet Device, 51:2c:81:11:91:61
[  140.840000] usb-storage 1-1:1.2: USB Mass Storage device detected
[  140.850000] scsi host3: usb-storage 1-1:1.2
[  140.870000] cdc_ether 1-1:1.0 eth2: kevent 12 may have been dropped
[  140.880000] cdc_ether 1-1:1.0 eth2: kevent 11 may have been dropped
[  141.850000] scsi 3:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
[  141.860000] sd 3:0:0:0: [sda] 31422464 512-byte logical blocks: (16.0 GB/14.9 GiB)
[  141.900000] sd 3:0:0:0: [sda] Write Protect is off
[  141.900000] sd 3:0:0:0: [sda] Mode Sense: 0f 00 00 00
[  141.910000] sd 3:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  141.950000]  sda: sda1
[  141.960000] sd 3:0:0:0: [sda] Attached SCSI removable disk

no ideas?

The discussion might have continued from here.