minidlna support now Samsung TV C550/C650 (thx amir909)
[tomato.git] / release / src / router / usbmodeswitch / usb_modeswitch.1
blobf3a7f0a820540bc6d274f6c730b8b45dd97b0327
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 Detach the storage driver as the only action. This is sufficient for some
81 devices to switch successfully
82 .IP "\fB-H\fP \fB\-\-huawei-mode\fP         " 10 
83 Send a special control message used by older Huawei devices 
84 .IP "\fB-S\fP \fB\-\-sierra-mode\fP         " 10 
85 Send a special control message used by Sierra devices 
86 .IP "\fB-G\fP \fB\-\-gct-mode\fP         " 10 
87 Send a special control message used by GCT chipsets 
88 .IP "\fB-T\fP \fB\-\-kobil-mode\fP         " 10 
89 Send a special control message used by Kobil devices 
90 .IP "\fB-O\fP \fB\-\-sony-mode\fP         " 10 
91 Apply a special sequence used by Sony Ericsson devices. Implies option \-s
92 .IP "\fB-R\fP \fB\-\-reset-usb\fP         " 10 
93 Send a USB reset command to the device. Can be combined with any switching
94 method or stand alone. It is always done as the last step of all device
95 interactions.
96 Few devices need it to complete the switching; apart from that it may be
97 useful during testing
98 .IP "\fB-c\fP \fB\-\-config filename\fP         " 10 
99 Use a specific config file. If any ID or switching options are given as
100 command line parameters, this option is ignored.
101 In that case all mandatory parameters have to be provided on
102 the command line
103 .IP "\fB-Q\fP \fB\-\-quiet\fP         " 10 
104 Don't show progress or error messages 
105 .IP "\fB-W\fP \fB\-\-verbose\fP         " 10 
106 Print all settings before running and show libusb debug messages 
107 .IP "\fB-D\fP \fB\-\-sysmode\fP         " 10 
108 Changes the behaviour of the program slightly. A success message including the
109 effective target device ID is put out and a syslog notice is issued. Mainly for 
110 integration with a wrapper script
111 .IP "\fB-s\fP \fB\-\-success NUM\fP         " 10 
112 After switching, keep checking for the result up to max. NUM seconds. If target IDs
113 or target class were provided, their appearance indicates certain success. Otherwise
114 the disconnection of the original device is rated as likely proof
115 .IP "\fB-I\fP \fB\-\-no-inquire\fP         " 10 
116 do not obtain SCSI attributes from device (default is on). For proper identification
117 of differing devices the attributes of the storage part provide valuable information.
118 This is not needed for devices that are known and supported 
119 .IP "\fB-i\fP \fB\-\-interface NUM\fP         " 10 
120 Select initial USB interface (default: 0). Only for testing purposes
121 .IP "\fB-u\fP \fB\-\-configuration NUM\fP         " 10
122 Select USB configuration (applied after switching). Mainly for testing
123 .IP "\fB-a\fP \fB\-\-altsetting NUM\fP         " 10
124 Select alternative USB interface setting (applied after switching). Mainly
125 for testing
126 .SH "AUTHOR" 
127 .PP 
128 This manual page was originally written by Didier Raboud (didier@raboud.com) for 
129 the \fBDebian\fP system. Additions made by Josua Dietze. Permission is 
130 granted to copy, distribute and/or modify this document under 
131 the terms of the GNU General Public License, Version 2 or any 
132 later version published by the Free Software Foundation.
135 The complete text of the current GNU General Public
136 License can be found in http://www.gnu.org/licenses/gpl.txt
138 .\" last edited 2010-12-22 for version 1.1.6