https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289986

            Bug ID: 289986
           Summary: ccde and-or rndis prevents my SIMCOM / QUALCOMM A76XX
                    to be recognized as a 4G/USB/LTE dongle
           Product: Base System
           Version: 14.3-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: usb
          Assignee: [email protected]
          Reporter: [email protected]

Hello.

I went rummaging through the electronic gadgets I purchased several years ago
and found the 4G/USB/LTE dongle SIMCOM / QUALCOMM A76XX.

https://forums.freebsd.org/attachments/dongle-sim-70-jpg.23800/

I want to try to configure it in FreeBSD for placing and receiving phone calls.
I will read docs,but at the moment I need some of your help to understand why
it disconnects in loop when I attach it on the USB port of my PC running with
FreeBSD 14.3...

https://forums.freebsd.org/attachments/freebsd-simcom-1-png.23801/

Instead,it is well recognized by Linux :

https://forums.freebsd.org/attachments/linux-simcom-1-png.23802/

where it doesn't disconnect...

https://forums.freebsd.org/attachments/linux-simcom-2-png.23803/

Below you can see some debug work that I did :

marietto# usbconfig -d ugen1.19 dump_device_desc

ugen1.19: <product 0x9011 Qualcomm / Option> at usbus1, cfg=0 md=HOST spd=HIGH
(480Mbps) pwr=ON (500mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x00ef  <Miscellaneous device>
  bDeviceSubClass = 0x0002
  bDeviceProtocol = 0x0001
  bMaxPacketSize0 = 0x0040
  idVendor = 0x1e0e
  idProduct = 0x9011
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <retrieving string failed>
  iProduct = 0x0002  <retrieving string failed>
  iSerialNumber = 0x0003  <retrieving string failed>
  bNumConfigurations = 0x000

VID/PID ====> 0x1e0e:0x9011

inside /usr/src-143/sys/dev/usb/usbdevs , removed any Alink reference and
added,instead :

Code:

vendor SIMCOM        0x1e0e  SIMCom

/* SIMCOM products */
product SIMCOM DWM652U5        0xce16    DWM-652
product SIMCOM 3G        0x9000    3G modem
product SIMCOM SIM7600E        0x9001    LTE modem
product SIMCOM SIM7600G        0x9011    LTE modem
product SIMCOM 3GU        0x9200    3G modem
product SIMCOM 9011          0x9011  SIMCom USB modem 9011
product SIMCOM 9001        0x9001  SIMCom USB modem 9001


inside /usr/src-143/sys/dev/usb/serial/u3g.c , removed any Alink reference and
added,instead :

Code:

#define    U3G_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) }
        U3G_DEV(SIMCOM, 9011, 0),   /* SIMCom modem 9011 */
        U3G_DEV(SIMCOM, 9001, 0),   /* SIMCom modem 9001 */
    U3G_DEV(SIMCOM, 3G, 0),
    U3G_DEV(SIMCOM, 3GU, 0),
    U3G_DEV(SIMCOM, DWM652U5, 0),
    U3G_DEV(SIMCOM, SIM7600E, 0),
    U3G_DEV(SIMCOM, SIM7600G, 0),

Recompiled u3g module :

Code:

marietto# cd /usr/src-143/sys/modules/u3g
make
make install
OK

Reloaded module :

Code:

marietto# kldunload u3g
marietto# kldload u3g

Checking if a serial / usb port is detected :

Code:

marietto# dmesg | tail -50
marietto# ls /dev/cuaU*
Nothing

Anyway,the disconnections in loop still happen.

Trying to switch from "multi-state" or "flip-flop" USB devices to WWAN
(cellular) and WLAN (wireless) modems :

Code:

#!/bin/sh
/usr/local/sbin/usb_modeswitch -v 0x1e0e -p 0x9011 -c
/usr/local/share/usb_modeswitch/1e0e:9011

Error: Could not find file /usr/local/share/usb_modeswitch/1e0e:9011. Abort

Code:

marietto# find /usr/local/share/usb_modeswitch -name "1e*"
/usr/local/share/usb_modeswitch/1e0e:f000

marietto# /usr/local/sbin/usb_modeswitch -v 0x1e0e -p 0x9011 -c
/usr/local/share/usb_modeswitch/1e0e:f000

Look for target devices ...
 No devices in target mode or class found
Look for default devices ...
 No devices in default mode found. Nothing to do. Bye!

marietto# /usr/local/sbin/usb_modeswitch -v 0x1e0e -p 0x9011 -c
/usr/local/share/usb_modeswitch/1e0e:f000

Look for target devices ...
 No devices in target mode or class found
Look for default devices ...
 Found devices in default mode (1)
Access device 019 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 2
Error: can't use storage command in MessageContent with interface 0; interface
class is 2, expected 8. Abort

marietto# find /usr/local/share/usb_modeswitch -name "*9011"
/usr/local/share/usb_modeswitch/1199:9011

marietto# /usr/local/sbin/usb_modeswitch -v 0x1199 -p 0x9011 -c
/usr/local/share/usb_modeswitch/1199:9011

Look for default devices ...
 No devices in default mode found. Nothing to do. Bye!


cde and rndis sometimes conflict.. not sure if this is the case or if there is
a workaorund, but I found this : 


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220852

and I tried to apply the patch...

Code:

marietto# usbdump -d ugen1.19 -vvv > log.txt

https://pastebin.ubuntu.com/p/2wDYFdMRBr/

marietto# usbconfig -d ugen1.19 dump_curr_config_desc

ugen1.19: <Arom Usb Boot Port ASR Microelectronics> at usbus1, cfg=0 md=HOST
spd=HIGH (480Mbps) pwr=ON (0mA)

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0043
    bNumInterfaces = 0x0002
    bConfigurationValue = 0x0001
    iConfiguration = 0x0004  <CDC ACM Gadget Config>
    bmAttributes = 0x00c0
    bMaxPower = 0x0000

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0002  <Communication device>
      bInterfaceSubClass = 0x0002
      bInterfaceProtocol = 0x0000
      iInterface = 0x0005  <CDC ACM Control Interface>

      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x00
       RAW dump:
       0x00 | 0x05, 0x24, 0x00, 0x00, 0x02


      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x01
       RAW dump:
       0x00 | 0x05, 0x24, 0x01, 0x00, 0x00


      Additional Descriptor

      bLength = 0x04
      bDescriptorType = 0x24
      bDescriptorSubType = 0x02
       RAW dump:
       0x00 | 0x04, 0x24, 0x02, 0x00


      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x06
       RAW dump:
       0x00 | 0x05, 0x24, 0x06, 0x00, 0x01


     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0083  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x000a
        bInterval = 0x0001
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 1
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0001
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x000a  <CDC-data>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0006  <CDC ACM Data Interface>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0002  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

Code:

marietto# cd /usr/src-143
marietto# patch -p1 < USB_RNDIS.patch

marietto# cd /usr/src-143/sys/modules/usb/urndis
marietto# make

[Creating objdir /usr/obj/usr/src-143/amd64.amd64/sys/modules/usb/urndis...]
machine -> /usr/src-143/sys/amd64/include
x86 -> /usr/src-143/sys/x86/include
i386 -> /usr/src-143/sys/i386/include
:> opt_bus.h
:> opt_usb.h
awk -f /usr/src-143/sys/tools/makeobjops.awk /usr/src-143/sys/kern/device_if.m
-h
awk -f /usr/src-143/sys/tools/makeobjops.awk /usr/src-143/sys/kern/bus_if.m -h
awk -f /usr/src-143/sys/tools/makeobjops.awk /usr/src-143/sys/dev/usb/usb_if.m
-h
awk -f /usr/src-143/sys/tools/usbdevs2h.awk /usr/src-143/sys/dev/usb/usbdevs -h
awk -f /usr/src-143/sys/tools/makeobjops.awk
/usr/src-143/sys/dev/mii/miibus_if.m -h
:> opt_platform.h
touch opt_global.h
cc  -O2 -pipe -fno-common  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE
-nostdinc   -include
/usr/obj/usr/src-143/amd64.amd64/sys/modules/usb/urndis/opt_global.h -I.
-I/usr/src-143/sys -I/usr/src-143/sys/contrib/ck/include -fno-common 
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
-fdebug-prefix-map=./machine=/usr/src-143/sys/amd64/include
-fdebug-prefix-map=./x86=/usr/src-143/sys/x86/include
-fdebug-prefix-map=./i386=/usr/src-143/sys/i386/include     -MD 
-MF.depend.if_urndis.o -MTif_urndis.o -mcmodel=kernel -mno-red-zone -mno-mmx
-mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv
-fstack-protector -Wall -Wstrict-prototypes -Wmissing-prototypes
-Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign
-D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs
-fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=tautological-compare
-Wno-error=empty-body -Wno-error=parentheses-equality
-Wno-error=unused-function -Wno-error=pointer-sign
-Wno-error=shift-negative-value -Wno-address-of-packed-member
-Wno-format-zero-length   -mno-aes -mno-avx  -std=gnu99 -c
/usr/src-143/sys/dev/usb/net/if_urndis.c -o if_urndis.o
ld -m elf_x86_64_fbsd -d -warn-common --build-id=sha1 -T
/usr/src-143/sys/conf/ldscript.kmod.amd64 -r  -o if_urndis.ko if_urndis.o
:> export_syms
awk -f /usr/src-143/sys/conf/kmod_syms.awk if_urndis.ko  export_syms | xargs
-J% objcopy % if_urndis.ko
objcopy --strip-debug if_urndis.ko

marietto# make install
install -T release -o root -g wheel -m 444   if_urndis.ko /boot/modules/
kldxref /boot/modules


Jesper Schmitz Mouridsen freebsd_committer
freebsd_triage
2019-12-29 19:48:22 UTC
(In reply to Bipin Chandra from comment #10)
It works on 12.1-RELEASE by kldunload if_cdce.ko, after the Zero has booted.

Patch does not seem to work :

Code:

marietto# kldunload if_cdce.ko
OK

but it still disconnects in loop :


Code:

ugen1.19: <ASR Microelectronics Arom Usb Boot Port> at usbus1
umodem0 on uhub0
umodem0: <ASR Microelectronics Arom Usb Boot Port, class 2/2, rev 2.00/0.00,
addr 57> on usbus1
umodem0: data interface 0, has no CM over data, has no break
umodem0: Can't setup transfer
device_attach: umodem0 attach returned 6
ugen1.19: <ASR Microelectronics Arom Usb Boot Port> at usbus1 (disconnected)
ugen1.19: <vendor 0x1e0e product 0x9011> at usbus1
cdce0 on uhub0
cdce0: <vendor 0x1e0e product 0x9011, class 239/2, rev 2.00/1.00, addr 58> on
usbus1
cdce0: No valid alternate setting found
device_attach: cdce0 attach returned 6
u3g0 on uhub0
u3g0: <vendor 0x1e0e product 0x9011, class 239/2, rev 2.00/1.00, addr 58> on
usbus1
u3g0: Found 3 ports.
ugen1.19: <vendor 0x1e0e product 0x9011> at usbus1 (disconnected)
u3g0: at uhub0, port 6, addr 58 (disconnected)
u3g0: detached

Everytime it disconnects,I can kldunload the module. Even this operation should
be done in loop :


Code:

marietto# kldunload if_cdce.ko
marietto# kldunload if_cdce.ko
marietto# kldunload if_cdce.ko
marietto# kldunload if_cdce.ko
marietto# kldunload if_cdce.ko

Sometimes it finds the module already unloaded...

Code:

kldunload: can't find file if_cdce.ko

but again :

Code:

marietto# kldunload if_cdce.ko
marietto# kldunload if_cdce.ko
marietto# kldunload if_cdce.ko

Code:

kldunload: can't find file if_cdce.ko


Sources where I have got the informations:

https://forums.freebsd.org/threads/simcom-sim7906e.74440/
https://forums.freebsd.org/threads/internet-access-via-4g-dongle-using-rndis.92169/
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220852


The full discussion where I'm trying to be helped is here :


https://forums.freebsd.org/threads/looking-for-a-4g-usb-lte-dongle-that-supports-voice-circuit-switched-voice-or-volte-pcm-audio-audio-over-usb-ideas-and-suggestions.99352/

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to