Posted: 30 Dec 2008, 22:28
There is one last desperate measure to try - resetting the device immediately before sending the control sequence. Some more hacking required. Stand by.

Everything Linux and Modeswitching USB Devices
http://www.draisberghof.de/usb_modeswitch/bb/
http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=106
My red led is blinking...Josh wrote: Stand by.
Tabks, I'll test asap, tough today is a busy day for me.I found still annother source of error in our quest.
Would you test this version please?
I provide the source since you are on 64bit; plus you can activate the reset code yourself, if the other trick does not show results. Look for "MD400" in the code.
Code: Select all
-- URB_FUNCTION_SELECT_CONFIGURATION:
ConfigurationDescriptor = 0x85717568 (configure)
ConfigurationDescriptor : bLength = 9
ConfigurationDescriptor : bDescriptorType = 0x00000002
ConfigurationDescriptor : wTotalLength = 0x00000164
ConfigurationDescriptor : bNumInterfaces = 0x0000000a
ConfigurationDescriptor : bConfigurationValue = 0x00000002
ConfigurationDescriptor : iConfiguration = 0x00000006
ConfigurationDescriptor : bmAttributes = 0x00000080
ConfigurationDescriptor : MaxPower = 0x000000fa This is what I got: simply switching back and forth via echoing 1 or 2, but after a reboot I wasn't able to doing it anymore.Josh wrote:Just for clarification, maybe I didn't get it right:
Do you need the custom usb_modeswitch for switching or is the configuration selection via "echo" sufficient without any special tools?
Yes, it works both with or without the usb-sotrage moduleO.K., I'll brush up the code and include that special sequence. No problem to add the configuration selection right away. But first, please give me some answers (as precisely as possible):
- did you test with usb-storage enabled? Does it work as well?
It works without the reset code enabled, if I enable the reset code it works only if the storage driver is missing.- did you have to enable the reset code?
Code: Select all
./usb_modeswitch -v 0x0fce -p 0xd0e1 -H
....
Found default devices (1)
Prepare switching, accessing latest device
Error: sending Sony control message failed (error 3). Aborting
Sorry I can't understand, do you mean rerunning usb_modeswitch during the few seconds when the device is in modem mode or do you mean rerunning usb_modeswitch after the tevices has switched back to storage mode ?- does the recognition of the class work (TargetClass 0x02) if you call usb_modeswitch again after switching?
Code: Select all
./usb_modeswitch_sony -v 0x0fce -p 0xd0e1 -H 1 -C 0x02No, this is what I had only once.Josh wrote: [*]Freshly plugged MD can be switched reliably to modem by setting configuration 2 in the sys tree directly, but not back to storage
CorrectFreshly plugged MD can be switched to modem by the special sequence in usb_modeswitch (test version, no reset), but switches back after some time
No problem at all, you are wellcome !Sorry for pestering you with so many questions; it's the only way to get reliable information since I don't have access to all these devices.
Usb_modeswitch works regardless the usb_driver if the reset code isn't enabledBoth switching methods are working regardless of an active usb-storage driver
The device class of the MD changes to 2 after switching
[...]
If the device is switched to modem already - regardless how it was done - this call should result in doing nothing
Code: Select all
Looking for default devices
Found default devices (1)
OK, found default device not in target class mode
Prepare switching, accessing latest device
Error: sending Sony control message failed (error 3). AbortingCode: Select all
Looking for default devices
Found default devices (1)
All devices in target class mode
No default device found. Is it connected? ByeWhen the device is plugged for the first timeOne last thing (hopefully): what's the output of "udevmonitor" during both ways of switching?
Code: Select all
UEVENT[1230923367.617576] add /devices/pci0000:00/0000:00:13.3/usb1/1-6 (usb)
UEVENT[1230923367.618509] add /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0 (usb)
UEVENT[1230923367.619611] add /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/host24 (scsi)
UEVENT[1230923367.619814] add /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/host24/scsi_host/host24 (scsi_host)
...
UDEV [1230923372.807931] add /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/host24/target24:0:0/24:0:0:1/block/sdi (block)
UDEV [1230923372.868005] add /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/host24/target24:0:0/24:0:0:0/block/sdh (block)
UDEV [1230923372.930772] add /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/host24/target24:0:0/24:0:0:0/block/sdh/sdh1(block)Code: Select all
UEVENT[1230923579.184380] remove /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/usb_endpoint/usbdev1.23_ep01 (usb_endpoint)
UEVENT[1230923579.184472] remove /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/usb_endpoint/usbdev1.23_ep81 (usb_endpoint)
UEVENT[1230923579.184584] remove /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/host24/target24:0:0/24:0:0:0/bsg/24:0:0:0 (bsg)
...
UDEV [1230923652.245125] add /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/host26/target26:0:0/26:0:0:0/block/sdh (block)
UDEV [1230923652.316369] add /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/host26/target26:0:0/26:0:0:0/block/sdh/sdh1(block)
UDEV [1230923652.470600] change /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/host26/target26:0:0/26:0:0:0/block/sdh (block)
No problem at all, You are wellcomeSorry for pestering you with so many questions; it's the only way to get reliable information since I don't have access to all these devices.
Still switches back to config 1Josh wrote:Wow, cool!
Thanks for all the info!
Now I know that the device seems to keep its connections to the USB system open (and not vanishing and coming back like other devices).
I added the configuration change to the "Sony sequence" in the source file (the link that you used before). You can try if this helps in switching permanently.
Good luck! But I think we're close
Code: Select all
Looking for default devices
Found default devices (1)
Prepare switching, accessing latest device
OK, Sony control message successfully sent.
Setting configuration to 2 returned: -16
-> See /proc/bus/usb/devices (or call lsusb) for changes. ByeCode: Select all
UEVENT[1230944628.380975] remove /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/usb_endpoint/usbdev1.24_ep01 (usb_endpoint)
UEVENT[1230944628.382540] remove /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/usb_endpoint/usbdev1.24_ep81 (usb_endpoint)
UDEV [1230944628.382575] remove /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/usb_endpoint/usbdev1.24_ep01 (usb_endpoint)
...
UDEV [1230944700.844006] add /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/host25/target25:0:0/25:0:0:1/scsi_device/25:0:0:1 (scsi_device)
UDEV [1230944701.071195] add /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/host25/target25:0:0/25:0:0:0/block/sdh (block)
UDEV [1230944701.136766] add /devices/pci0000:00/0000:00:13.3/usb1/1-6/1-6:1.0/host25/target25:0:0/25:0:0:0/block/sdh/sdh1 (block)