The C Source, Patches and (shudder!) Bugs
Post Reply
aaa37
Posts: 23
Joined: 08 Oct 2009, 07:59

DetachStorageOnly and HuaweiMode are exclusived?

Post by aaa37 » 09 Oct 2009, 09:01

Hi, all~
In the latest usb_modeswitch version 1.0.5, the source code
usb_modeswitch.c
line 437

Code: Select all

specialMode = DetachStorageOnly + HuaweiMode + SierraMode + SonyMode;
	if ( specialMode > 1 ) {
		SHOW_PROGRESS("Invalid mode combination. Check your configuration. Aborting.\n\n");	
		exit(1);
	}
this will cause most Huawei product's config will not pass this check condition.
There are E169 and E220 in my hand, both can't work in this way.
Because I always use config to do mode switch, so when I update to version 1.0.5(from very old version 0.9.4@@), I find out this problem quickly.
Now my solution is to change config
DetachStorageOnly=1 => DetachStorageOnly=0

Is there any consideration on this check code?
If this is necessary, I suggest the usb_modeswitch.conf should also disable the Huawei product's DetachStorageOnly value.

thanks~

aaa37
Posts: 23
Joined: 08 Oct 2009, 07:59

Post by aaa37 » 09 Oct 2009, 09:29

add some supplement.
here is my useage
# cat configure/huawei_e220.conf

########################################################
# Huawei E220 (aka "Vodafone EasyBox II", aka "T-Mobile wnw Box Micro")
# Huawei E270
# Huawei E870
#
# Two options: 1. removal of "usb-storage" 2. the special control
# message found by Miroslav Bobovsky
#
# Contributor: Hans Kurent, Denis Sutter

DefaultVendor= 0x12d1;
DefaultProduct= 0x1003

# choose one of these:
DetachStorageOnly=0
HuaweiMode=1




# ./usb_modeswitch -c configure/huawei_e220.conf
usb_os_init: Found USB VFS at /proc/bus/usb
usb_os_find_busses: Found 002
usb_os_find_busses: Found 001
usb_os_find_busses: Skipping non bus directory devices
usb_os_find_devices: Found 002 on 002
usb_os_find_devices: Found 001 on 002
error obtaining child information: Inappropriate ioctl for device
usb_os_find_devices: Found 001 on 001

Looking for default devices ...
Found default devices (1)
Accessing device 002 on bus 002 ...
Using endpoints 0x02 (out) and 0x82 (in)
Not a storage device, skipping SCSI inquiry

Device description data (identification)
-------------------------
Manufacturer: HUAWEI Technologies
Product: HUAWEI Mobile
Serial No.: not provided
-------------------------
Sending Huawei control message ...
OK, Huawei control message sent
-> Run lsusb to note any changes. Bye.
although I disable DetachStorageOnly, but I still can use pppd to dial up the modem.

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

Post by Josh » 09 Oct 2009, 22:27

The line "# choose one of these:" means that you have to to choose one and disable the other (delete or comment out).

The "special modes" should not be used in combination (won't make sense anyway), therefore the check.

aaa37
Posts: 23
Joined: 08 Oct 2009, 07:59

Post by aaa37 » 10 Oct 2009, 17:16

Josh wrote:The line "# choose one of these:" means that you have to to choose one and disable the other (delete or comment out).

The "special modes" should not be used in combination (won't make sense anyway), therefore the check.
sorry, I saw this :oops:
thanks for your help :D

Post Reply