I have a device from a brazilian 4G ISP named "vivo", that is also branded as d-link. Trying to get it going with usb_modeswitch 2.3.0.
On plugging in it identifies itself as 2001:a406. Full descriptors: https://gist.github.com/dsd/dc54fa719e950c67a2b9
There is a Linux driver on the emulated CDROM, which shows that it does a modeswitch with `eject /dev/sr0`.
That works fine. After doing the eject it comes back as 2001:7e19. Descriptors: https://gist.github.com/dsd/5e0bb118b8ebddab7c6a
Now to try to do the same with usb_modeswitch.
Code: Select all
# usb_modeswitch -v 2001 -p a406 -W -K
Take all parameters from the command line
* usb_modeswitch: handle USB devices with multiple modes
* Version 2.3.0 (C) Josua Dietze 2015
* Based on libusb1/libusbx
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x2001
DefaultProduct= 0xa406
StandardEject=1
Look for default devices ...
found USB ID 1d6b:0003
found USB ID 0bda:b719
found USB ID 04f2:b52b
found USB ID 2001:a406
vendor ID matched
product ID matched
found USB ID 1d6b:0002
Found devices in default mode (1)
Access device 012 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
Use endpoints 0x01 (out) and 0x81 (in)
USB description data (for identification)
-------------------------
Manufacturer: Mobile Connect
Product: Mobile Connect
Serial No.: 0123456789ABCDEF
-------------------------
Sending standard EJECT sequence
Looking for active driver ...
OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
OK, message successfully sent
Read the response to message 1 (CSW) ...
Response reading failed (error -7)
Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!
Code: Select all
sd 10:0:0:0: [sdb] Synchronizing SCSI cache
sd 10:0:0:0: [sdb] Synchronize Cache(10) failed: Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 10:0:0:0: [sdb] Sense Key : Illegal Request [current]
sd 10:0:0:0: [sdb] Add. Sense: Invalid command operation code
Code: Select all
# usb_modeswitch -v 2001 -p a406 -W -n -M 555342435b000000000000000001061e000000000000000000000000000000 -2 555342435c000000000000000001061b000000010000000000000000000000 -3 555342435d000000000000000001061b000000020000000000000000000000
Take all parameters from the command line
* usb_modeswitch: handle USB devices with multiple modes
* Version 2.3.0 (C) Josua Dietze 2015
* Based on libusb1/libusbx
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x2001
DefaultProduct= 0xa406
MessageContent="555342435b000000000000000001061e000000000000000000000000000000"
MessageContent2="555342435c000000000000000001061b000000010000000000000000000000"
MessageContent3="555342435d000000000000000001061b000000020000000000000000000000"
Look for default devices ...
found USB ID 1d6b:0003
found USB ID 0bda:b719
found USB ID 04f2:b52b
found USB ID 2001:a406
vendor ID matched
product ID matched
found USB ID 1d6b:0002
Found devices in default mode (1)
Access device 013 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
Use endpoints 0x01 (out) and 0x81 (in)
Error: can't use storage command in MessageContent with interface 0;
interface class is 239, expected 8. Abort
Code: Select all
if (defaultClass == 0)
defaultClass = interfaceClass;
else
if (interfaceClass == LIBUSB_CLASS_MASS_STORAGE && defaultClass != LIBUSB_CLASS_MASS_STORAGE
&& defaultClass != 0xef && defaultClass != LIBUSB_CLASS_VENDOR_SPEC) {
/* Unexpected default class combined with differing interface class */
SHOW_PROGRESS(output,"Bogus Class/InterfaceClass: 0x%02x/0x08\n", defaultClass);
defaultClass = 8;
}
if (strlen(MessageContent) && strncmp("55534243",MessageContent,8) == 0)
if (defaultClass != 8) {
fprintf(stderr, "Error: can't use storage command in MessageContent with interface %d;\n"
" interface class is %d, expected 8. Abort\n\n", Interface, defaultClass);
abortExit();
}
I haven't looked in detail but I guess something is a bit odd with the descriptors. How can we fix up modeswitch to be more tolerant?