The C Source, Patches and (shudder!) Bugs
Post Reply
anttix
Posts: 1
Joined: 18 Sep 2010, 21:37

A-Link 3GP fails to properly initialize on Fedora13

Post by anttix » 18 Sep 2010, 23:02

Software versions:
usb_modeswitch-1.1.4-1.fc13.x86_64
usb_modeswitch-data-20100817-1.fc13.noarch
kernel-2.6.34.6-54.fc13.x86_64
udev-153-3.fc13.x86_64

I manually updated /etc/usb_modeswitch.d/1e0e:f000 to the one
found in usb-modeswitch-data-20100826

When device is connected, the following appears in dmesg

Code: Select all

usb 1-5: new high speed USB device using ehci_hcd and address 68
usb 1-5: New USB device found, idVendor=1e0e, idProduct=f000
usb 1-5: New USB device strings: Mfr=3, Product=2, SerialNumber=0
usb 1-5: Product: A-Link  
usb 1-5: Manufacturer: A-Link  
scsi60 : usb-storage 1-5:1.0
usb 1-5: USB disconnect, address 68
usb 1-5: new high speed USB device using ehci_hcd and address 69
usb 1-5: New USB device found, idVendor=1e0e, idProduct=9200
usb 1-5: New USB device strings: Mfr=2, Product=1, SerialNumber=3
usb 1-5: Manufacturer: A-Link  
usb 1-5: SerialNumber: 1234567890ABCDEF
option 1-5:1.0: GSM modem (1-port) converter detected
usb 1-5: GSM modem (1-port) converter now attached to ttyUSB3
option 1-5:1.1: GSM modem (1-port) converter detected
usb 1-5: GSM modem (1-port) converter now attached to ttyUSB4
scsi61 : usb-storage 1-5:1.2
option 1-5:1.3: GSM modem (1-port) converter detected
usb 1-5: GSM modem (1-port) converter now attached to ttyUSB5
usb 1-5: USB disconnect, address 69
option: option_instat_callback: error -108
option1 ttyUSB3: GSM modem (1-port) converter now disconnected from ttyUSB3
usb 1-5: usbfs: USBDEVFS_CONTROL failed cmd usb_modeswitch rqt 128 rq 6 len 255 ret -108
This will be repeated over and over again.

Modeswitch debug log looks like this:

Code: Select all

USB_ModeSwitch log from Sat Sep 18 21:03:53 EEST 2010

Using global config file: /etc/usb_modeswitch.conf
raw args from udev: /1-5:1.0
Bus ID for device not given by udev.
 Trying to determine it from kernel name (1-5:1.0) ...
USB dir exists: /sys/bus/usb/devices/1-5
Warning: USB attribute "serial" not found.
----------------
USB values from sysfs:
  manufacturer  A-Link  
  product       A-Link  
  serial        
----------------
SCSI attributes not needed, moving on
checking config: /etc/usb_modeswitch.d/1e0e:f000
! matched, now switching
 (running command: /usr/sbin/usb_modeswitch -I -W -c /etc/usb_modeswitch.d/1e0e:f000)

verbose output of usb_modeswitch:
--------------------------------
usb_set_debug: Setting debugging level to 15 (on)
usb_os_find_busses: Found 005
usb_os_find_busses: Found 004
usb_os_find_busses: Found 003
usb_os_find_busses: Found 002
usb_os_find_busses: Found 001
usb_os_find_devices: Found 003 on 005
usb_os_find_devices: Found 002 on 005
skipped 1 class/vendor specific interface descriptors
usb_os_find_devices: Found 001 on 005
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Inappropriate ioctl for device
usb_os_find_devices: Found 001 on 004
usb_os_find_devices: Found 002 on 003
skipped 1 class/vendor specific interface descriptors
usb_os_find_devices: Found 001 on 003
error obtaining child information: Inappropriate ioctl for device
usb_os_find_devices: Found 001 on 002
usb_os_find_devices: Found 007 on 001
usb_os_find_devices: Found 006 on 001
usb_os_find_devices: Found 001 on 001
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Inappropriate ioctl for device
Reading config file: /etc/usb_modeswitch.d/1e0e:f000
Warning: TargetProductList overrides TargetProduct!
 * usb_modeswitch: handle USB devices with multiple modes
 * Version 1.1.4 (C) Josua Dietze 2010
 * Based on libusb0 (0.1.12 and above)

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x1e0e
DefaultProduct= 0xf000
TargetVendor=   0x1e0e
TargetProduct=  not set
TargetClass=    not set
TargetProductList="9200,9000"

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
GCTMode=0
MessageEndpoint=  not set
MessageContent="555342431234567800000000000006bd000000020000000000000000000000"
NeedResponse=1
ResponseEndpoint= not set
Interface=0x00

InquireDevice disabled
Success check enabled, max. wait time 20 seconds
System integration mode enabled


Looking for target devices ...
  searching devices, found USB ID 0483:2016
  searching devices, found USB ID 0a5c:2110
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 04e6:5119
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1e0e:f000
   found matching vendor ID
  searching devices, found USB ID 12d1:1001
  searching devices, found USB ID 1d6b:0002
 No devices in target mode or class found
Looking for default devices ...
  searching devices, found USB ID 0483:2016
  searching devices, found USB ID 0a5c:2110
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 04e6:5119
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1e0e:f000
   found matching vendor ID
   found matching product ID
   adding device
  searching devices, found USB ID 12d1:1001
  searching devices, found USB ID 1d6b:0002
 Found devices in default mode or class (1)
Accessing device 007 on bus 001 ...
Using endpoints 0x01 (out) and 0x81 (in)
Using endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: A-Link  
     Product: A-Link  
  Serial No.: not provided
-------------------------
Looking for active driver ...
 OK, driver found ("usb-storage")
 OK, driver "usb-storage" detached
Setting up communication with interface 0 ...
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
USB error: error reaping URB: No such device
USB error: could not clear/halt ep 129: No such device
USB error: could not clear/halt ep 1: No such device
USB error: could not release intf 0: No such device
usb_os_find_devices: Found 003 on 005
usb_os_find_devices: Found 002 on 005
skipped 1 class/vendor specific interface descriptors
usb_os_find_devices: Found 001 on 005
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Inappropriate ioctl for device
usb_os_find_devices: Found 001 on 004
usb_os_find_devices: Found 002 on 003
skipped 1 class/vendor specific interface descriptors
usb_os_find_devices: Found 001 on 003
error obtaining child information: Inappropriate ioctl for device
usb_os_find_devices: Found 001 on 002
usb_os_find_devices: Found 008 on 001
usb_os_find_devices: Found 006 on 001
usb_os_find_devices: Found 001 on 001
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Inappropriate ioctl for device
USB error: error sending control message: Cannot send after transport endpoint shutdown
Error: could not get description string "manufacturer"
USB error: error sending control message: No such device
Error: could not get description string "product"
USB error: error sending control message: No such device
Error: could not get description string "serial number"
 OK, message successfully sent
Reading the response to the message (CSW) ...
 OK, response successfully read (13 bytes).
Resetting response endpoint 0x81
 Error resetting endpoint: -19
Resetting message endpoint 0x01
 Error resetting endpoint: -19
 Device is gone, skipping any further commands

Checking for mode switch (max. 20 times, once per second) ...
 Original device is gone already, not checking
 Searching for target devices ...
  searching devices, found USB ID 0483:2016
  searching devices, found USB ID 0a5c:2110
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 04e6:5119
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1e0e:9200
   found matching vendor ID
   found matching product ID from list
  searching devices, found USB ID 12d1:1001
  searching devices, found USB ID 1d6b:0002

Found target device 008 on bus 001

Target device description data
-------------------------
Manufacturer: 
     Product: 
  Serial No.: 
-------------------------
 Found correct target device

Mode switch succeeded. Bye.

ok:1e0e:9200
--------------------------------
(end of usb_modeswitch output)

Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1

Now checking for newly created serial devices ...
 no new serial devices found
Device directory in sysfs is gone! Something went wrong, aborting

Adding sleep 1 will "fix" the device.

Code: Select all

--- /lib/udev/usb_modeswitch.orig	2010-09-18 23:49:00.000000000 +0300
+++ /lib/udev/usb_modeswitch	2010-09-18 23:47:57.000000000 +0300
@@ -7,6 +7,7 @@
 		sleep 1; \
 		count=$(($count - 1)); \
 	else \
+		sleep 1; \
 		exec /usr/bin/tclsh "$0" "$@" 2>/dev/null & \
 		exit 0; \
 	fi; \
However since only that particular device is affected (Huawei E1752 works flawlessly without the sleep) I think there is a need
for a new configuration option to set a delay before usb_modeswitch
touches a device.

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Post by Josh » 07 Oct 2010, 09:33

Fortunately, the delay option is already there in version 1.1.4.

Use a "WaitBefore=1" line in the config file for a one-second delay.

If it works I'll update the device configuration for the next data release.

Post Reply