usb_modeswitch: ver. 1.1.9 with data package 2011-08-05
[tomato.git] / release / src / router / usbmodeswitch / usb_modeswitch.1
blob3ab6c2fc6a2554ea76b42768bbb0d856f41410cc
1 .TH "USB_MODESWITCH" "1" 
2 .SH "NAME" 
3 usb_modeswitch - switch mode of "multi-state" USB devices 
4 .SH "SYNOPSIS" 
5 .PP 
6 \fBusb_modeswitch\fR [\fB\-hvpVPmM23rdHn\fP]  [\fB\-c \fIfilename\fP]
7 .SH "DESCRIPTION" 
8 .PP 
9 Several new USB devices have their proprietary Windows drivers onboard,
10 most of them WAN dongles. When plugged in for the first time, they act
11 like a flash storage and start installing the Windows driver from there.
12 If the driver is already installed, it makes the storage device disappear
13 and a new device, mainly composite with modem ports, shows up.
14 .PP 
15 On Linux, in most cases the drivers are available as kernel modules,
16 such as "usbserial" or "option". However, the device shows up as
17 "usb-storage" by default. \fBusb_modeswitch\fR can send a provided bulk
18 message (most likely a mass storage command) to the device which is known
19 to initiate the mode switching.
20 .PP
21 In some cases, USB control commands are used for switching. These cases are
22 handled by custom functions, and no bulk message needs to be provided.
23 .PP
24 Usually, the program is distributed with a set of configurations for many
25 known devices, which in combination with a wrapper script launched from the
26 udev daemon allows a fully automatic handling of a device upon insertion.
28 .SH "OPTIONS" 
29 .PP 
30 This program follows the usual GNU command line syntax,
31 with long options starting with two dashes ('--').  A summary of 
32 options is included below. 
33 .IP "\fB-h\fP \fB\-\-help\fP         " 10 
34 Show summary of options. 
35 .IP "\fB-e\fP \fB\-\-version\fP         " 10 
36 Print version information and exit. 
37 .IP "\fB-v\fP \fB\-\-default-vendor NUM\fP         " 10 
38 Vendor ID to look for (mandatory), usually given as hex number (example: 0x12d1).
39 Each USB device is identified by a number
40 officialy assigned to the vendor by the USB association and a number for the
41 respective model (product ID) chosen by the vendor
42 .IP "\fB-p\fP \fB\-\-default-product NUM\fP         " 10 
43 Product ID to look for (mandatory). 
44 .IP "\fB-V\fP \fB\-\-target-vendor NUM\fP         " 10 
45 Target vendor ID. When given will be searched for and detected initially
46 for information purposes. If success checking (option \-s) is active,
47 providing target IDs (vendor/product) or target class is recommended
48 .IP "\fB-P\fP \fB\-\-target-product NUM\fP         " 10 
49 Target product ID 
50 .IP "\fB-C\fP \fB\-\-target-class NUM\fP         " 10 
51 Target Device Class according to the USB specification. Some devices keep
52 their original vendor/product ID after successful switching. To prevent
53 them from being treated again, the device class can be checked.
54 For unswitched devices it is always 8 (storage class), for switched
55 modems it is often 0xff (vendor specific). In composite modes,
56 the class of the first interface is watched
57 .IP "\fB-m\fP \fB\-\-message-endpoint NUM\fP         " 10 
58 A specific endpoint to use for data transfers. Only for testing purposes; usually
59 endpoints are determined from the device attributes
60 .IP "\fB-M\fP \fB\-\-message-content STRING\fP         " 10 
61 A bulk message to send as a switching command. Provided as a hexadecimal string 
62 .IP "\fB-2, -3\fP  \fB\-\-message-content2, \-\-message-content3 STRING\fP         " 10 
63 Additional bulk messages to send as switching commands. Provided as hexadecimal strings.
64 When used with mass storage commands, setting \fB\-\-need-response\fR is
65 strongly advised to comply with specifications and to avoid likely errors
66 .IP "\fB-w\fP \fB\-\-release-delay NUM\fP         " 10
67 After issuing all bulk messages, wait for NUM milliseconds before releasing the interface.
68 Required for some modems on older systems (especially after an EJECT message)
69 .IP "\fB-n\fP \fB\-\-need-response\fP         " 10
70 Read the response (command status wrapper) to a mass storage command
71 transfer.
72 Some devices have trouble switching if the response is not read; most
73 are disappearing right away. When sending multiple mass storage commands
74 with \fB\-2\fR and \fB\-3\fR, this may need to be set to avoid transfer errors
75 .IP "\fB-r\fP \fB\-\-response-endpoint NUM\fP         " 10 
76 Try to read the response to a storage command from there
77 if option \-n is active. Only for testing purposes; usually
78 endpoints are determined from the device attributes
79 .IP "\fB-d\fP \fB\-\-detach-only\fP         " 10
80 Just detach the current driver. This is sufficient for some
81 devices to switch successfully. Otherwise this feature can
82 be used as a 'scalpel' for special cases
83 .IP "\fB-H\fP \fB\-\-huawei-mode\fP         " 10
84 Send a special control message used by older Huawei devices
85 .IP "\fB-S\fP \fB\-\-sierra-mode\fP         " 10
86 Send a special control message used by Sierra devices
87 .IP "\fB-G\fP \fB\-\-gct-mode\fP         " 10
88 Send a special control message used by GCT chipsets
89 .IP "\fB-T\fP \fB\-\-kobil-mode\fP         " 10
90 Send a special control message used by Kobil devices
91 .IP "\fB-T\fP \fB\-\-sequans-mode\fP         " 10
92 Send a special control message used by Sequans chipset
93 .IP "\fB-T\fP \fB\-\-mobileaction-mode\fP         " 10
94 Send a special control message used by the MobileAction device
95 .IP "\fB-O\fP \fB\-\-sony-mode\fP         " 10
96 Apply a special sequence used by Sony Ericsson devices. Implies option \--success
97 .IP "\fB-L\fP \fB\-\-cisco-mode\fP         " 10
98 Send a sequence of bulk messages used by Cisco devices
99 .IP "\fB-R\fP \fB\-\-reset-usb\fP         " 10
100 Send a USB reset command to the device. Can be combined with any switching
101 method or stand alone. It is always done as the last step of all device
102 interactions.
103 Few devices need it to complete the switching; apart from that it may be
104 useful during testing
105 .IP "\fB-c\fP \fB\-\-config filename\fP         " 10
106 Use a specific config file. If any ID or switching options are given as
107 command line parameters, this option is ignored.
108 In that case all mandatory parameters have to be provided on
109 the command line
110 .IP "\fB-Q\fP \fB\-\-quiet\fP         " 10
111 Don't show progress or error messages 
112 .IP "\fB-W\fP \fB\-\-verbose\fP         " 10
113 Print all settings before running and show libusb debug messages 
114 .IP "\fB-D\fP \fB\-\-sysmode\fP         " 10 
115 Changes the behaviour of the program slightly. A success message including the
116 effective target device ID is put out and a syslog notice is issued. Mainly for 
117 integration with a wrapper script
118 .IP "\fB-s\fP \fB\-\-success NUM\fP         " 10 
119 After switching, keep checking for the result up to max. NUM seconds. If target IDs
120 or target class were provided, their appearance indicates certain success. Otherwise
121 the disconnection of the original device is rated as likely proof
122 .IP "\fB-I\fP \fB\-\-no-inquire\fP         " 10 
123 do not obtain SCSI attributes from device (default is on). For proper identification
124 of differing devices the attributes of the storage part provide valuable information.
125 This is not needed for devices that are known and supported 
126 .IP "\fB-i\fP \fB\-\-interface NUM\fP         " 10 
127 Select initial USB interface (default: 0). Only for testing purposes
128 .IP "\fB-u\fP \fB\-\-configuration NUM\fP         " 10
129 Select USB configuration (applied after switching). Mainly for testing
130 .IP "\fB-a\fP \fB\-\-altsetting NUM\fP         " 10
131 Select alternative USB interface setting (applied after switching). Mainly
132 for testing
133 .SH "AUTHOR" 
134 .PP 
135 This manual page was originally written by Didier Raboud (didier@raboud.com) for 
136 the \fBDebian\fP system. Additions made by Josua Dietze. Permission is 
137 granted to copy, distribute and/or modify this document under 
138 the terms of the GNU General Public License, Version 2 or any 
139 later version published by the Free Software Foundation.
142 The complete text of the current GNU General Public
143 License can be found in http://www.gnu.org/licenses/gpl.txt
145 .\" last edited 2011-08-05 for version 1.1.9