Hello everyone!
I buy a usb broadband modem to use on my freebsd machine. Its model is LM003 (LM Technologies) and have a qualcomm chipset.
First time I connected it to my machine it's detected as usb mass storage and two device (cd0 and da0) appeared in /dev. cd0 is somewhat virtual CD drive that contains windows and mac driver and software (it supporting linux too) and da0 is for SD card reader on it. I not loaded u3g driver yet, so I disconnect device and load u3g and reconnect device. this time cd0 and da0 not appeared but u3g not attached too!
From what I read in internet, I need to change the usb mode from storage mode to modem. I found usb_modeswitch for this task. When I use it without u3g loaded it works and umass driver detached but with u3g cannot switch mode:
Before loading u3g driver:
When u3g loaded:
I'm not sure about supporting FreeBSD from this chipset, but I had a look at u3g driver (/usr/src/sys/dev/usb/serial/u3g.c) I tried to see it at least probed or not by adding some printf at u3g_probe function and saw somthing intersting:
In probe function a line checking uaa->info.bInterfaceClass with UICLASS_VENDOR and and returns ENXIO (I sure this statement is executed, I tried that with device printf) may be at related to mode switching that should change interface class?
So I assume something in other usb driver layers prevent to get u3g tries,
but have no idea about what REALLY should I do.
Any help, idea or something are welcome!
I buy a usb broadband modem to use on my freebsd machine. Its model is LM003 (LM Technologies) and have a qualcomm chipset.
Code:
# usbconfig -dugen0.5 -v
ugen0.5: <WL-72B 3.5G MODEM OMEGA TECHNOLOGY> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
ugen0.5.0: umass0: <Qualcomm, Incorporated Qualcomm CDMA Technologies MSM, class 0/0, rev 2.00/0.00, addr 5>
bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0200
bDeviceClass = 0x0000 <Probed by interface class>
bDeviceSubClass = 0x0000
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0040
idVendor = 0x1c9e
idProduct = 0x6061
bcdDevice = 0x0000
iManufacturer = 0x0003 <Qualcomm, Incorporated>
iProduct = 0x0002 <Qualcomm CDMA Technologies MSM>
iSerialNumber = 0x0004 <000000000002>
bNumConfigurations = 0x0001
First time I connected it to my machine it's detected as usb mass storage and two device (cd0 and da0) appeared in /dev. cd0 is somewhat virtual CD drive that contains windows and mac driver and software (it supporting linux too) and da0 is for SD card reader on it. I not loaded u3g driver yet, so I disconnect device and load u3g and reconnect device. this time cd0 and da0 not appeared but u3g not attached too!
Code:
# usbconfig -dugen0.5 -v
ugen0.5: <WL-72B 3.5G MODEM OMEGA TECHNOLOGY> at usbus0, cfg=255 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0200
bDeviceClass = 0x0000 <Probed by interface class>
bDeviceSubClass = 0x0000
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0040
idVendor = 0x1c9e
idProduct = 0x6061
bcdDevice = 0x0000
iManufacturer = 0x0003 <Qualcomm, Incorporated>
iProduct = 0x0002 <Qualcomm CDMA Technologies MSM>
iSerialNumber = 0x0004 <000000000002>
bNumConfigurations = 0x0001
From what I read in internet, I need to change the usb mode from storage mode to modem. I found usb_modeswitch for this task. When I use it without u3g loaded it works and umass driver detached but with u3g cannot switch mode:
Before loading u3g driver:
Code:
# usb_modeswitch -c /usr/local/etc/usb_modeswitch.conf -W
* usb_modeswitch: handle USB devices with multiple modes
* Version 2.6.2 (C) Josua Dietze 2017
* Based on libusb1/libusbx
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x1c9e
DefaultProduct= 0x6061
TargetClass= 0xff
MessageContent="55534243123456780000000000000606f50402527000000000000000000000"
Look for target devices ...
No devices in target mode or class found
Look for default devices ...
found USB ID 0000:0000
found USB ID 0000:0000
found USB ID 8087:0a2a
found USB ID 5986:0366
found USB ID 8087:8001
found USB ID 0fce:7186
found USB ID 1c9e:6061
vendor ID matched
product ID matched
device class 08 not matching target
count device
Found devices in default mode (1)
Access device 005 on bus 000
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
with class 8
Use endpoints 0x01 (out) and 0x81 (in)
USB description data (for identification)
-------------------------
Manufacturer: Qualcomm, Incorporated
Product: Qualcomm CDMA Technologies MSM
Serial No.: 000000000002
-------------------------
Looking for active drivers ...
OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
LIBUSB_FUNCTION: libusb_bulk_transfer enter
LIBUSB_FUNCTION: libusb_submit_transfer enter
LIBUSB_FUNCTION: libusb_submit_transfer leave 0
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter
LIBUSB_FUNCTION: libusb10_handle_events_sub enter
LIBUSB_FUNCTION: libusb10_handle_events_sub complete
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter
LIBUSB_FUNCTION: libusb10_handle_events_sub enter
LIBUSB_TRANSFER: sync I/O done
LIBUSB_FUNCTION: libusb10_handle_events_sub complete
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit
LIBUSB_FUNCTION: libusb_bulk_transfer leave
OK, message successfully sent
Read the response to message 1 (CSW) ...
LIBUSB_FUNCTION: libusb_bulk_transfer enter
LIBUSB_FUNCTION: libusb_submit_transfer enter
LIBUSB_FUNCTION: libusb_submit_transfer leave 0
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter
LIBUSB_FUNCTION: libusb10_handle_events_sub enter
LIBUSB_TRANSFER: sync I/O done
LIBUSB_FUNCTION: libusb10_handle_events_sub complete
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit
LIBUSB_FUNCTION: libusb_bulk_transfer leave
Response successfully read (13 bytes), status 1
Reset response endpoint 0x81
Reset message endpoint 0x01
-> Run lsusb to note any changes. Bye!
When u3g loaded:
Code:
# usb_modeswitch -c /usr/local/etc/usb_modeswitch.conf -W
* usb_modeswitch: handle USB devices with multiple modes
* Version 2.6.2 (C) Josua Dietze 2017
* Based on libusb1/libusbx
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x1c9e
DefaultProduct= 0x6061
TargetClass= 0xff
MessageContent="55534243123456780000000000000606f50402527000000000000000000000"
Look for target devices ...
No devices in target mode or class found
Look for default devices ...
found USB ID 0000:0000
found USB ID 0000:0000
found USB ID 8087:0a2a
found USB ID 5986:0366
found USB ID 8087:8001
found USB ID 0fce:7186
found USB ID 1c9e:6061
vendor ID matched
product ID matched
device class 08 not matching target
count device
Found devices in default mode (1)
Access device 005 on bus 000
Get the current device configuration ...
Determining the active configuration failed (error -5). Abort
I'm not sure about supporting FreeBSD from this chipset, but I had a look at u3g driver (/usr/src/sys/dev/usb/serial/u3g.c) I tried to see it at least probed or not by adding some printf at u3g_probe function and saw somthing intersting:
In probe function a line checking uaa->info.bInterfaceClass with UICLASS_VENDOR and and returns ENXIO (I sure this statement is executed, I tried that with device printf) may be at related to mode switching that should change interface class?
but have no idea about what REALLY should I do.
Any help, idea or something are welcome!