aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2005-04-18 20:39:25 -0400
committerGreg K-H <gregkh@suse.de>2005-04-18 20:39:25 -0400
commita81e7ecca369afee0b07b4758d8c32542ffc587a (patch)
tree6abfa1d3a86f3a4f355e9dd11e6c8ee158a0202b /drivers/usb
parent45f23f189ca66d98b1f8b7f3d30a194d3188039d (diff)
[PATCH] USB: revert "fix" to usb_set_interface()
This reverts a recent change to usb_set_interface(). The change worked around a quirk in certain devices, but doing this in usbcore creates needless regressions for other devices. More appropriate fixes won't put such handling in usbcore. Basically it's tricky to do a full software reset of USB device state, since the devices don't all act the same. This adds a note to the kerneldoc for the usb_reset_configuration() call to highlight the quirk this was working around: endpoint data toggles not being reset. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/message.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 40bdb38e7bcb..e12c5be1e0a3 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1133,29 +1133,10 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
1133 /* prevent submissions using previous endpoint settings */ 1133 /* prevent submissions using previous endpoint settings */
1134 usb_disable_interface(dev, iface); 1134 usb_disable_interface(dev, iface);
1135 1135
1136 /* 9.1.1.5 says:
1137 *
1138 * Configuring a device or changing an alternate setting
1139 * causes all of the status and configuration values
1140 * associated with endpoints in the affected interfaces to
1141 * be set to their default values. This includes setting
1142 * the data toggle of any endpoint using data toggles to
1143 * the value DATA0.
1144 *
1145 * Some devices take this too literally and don't reset the data
1146 * toggles if the new altsetting is the same as the old one (the
1147 * command isn't "changing" an alternate setting). We will manually
1148 * reset the toggles when the new and old altsettings are the same.
1149 * Most devices won't need this, but fortunately it doesn't happen
1150 * often.
1151 */
1152 if (iface->cur_altsetting == alt)
1153 manual = 1;
1154 iface->cur_altsetting = alt; 1136 iface->cur_altsetting = alt;
1155 1137
1156 /* If the interface only has one altsetting and the device didn't 1138 /* If the interface only has one altsetting and the device didn't
1157 * accept the request (or whenever the old altsetting is the same 1139 * accept the request, we attempt to carry out the equivalent action
1158 * as the new one), we attempt to carry out the equivalent action
1159 * by manually clearing the HALT feature for each endpoint in the 1140 * by manually clearing the HALT feature for each endpoint in the
1160 * new altsetting. 1141 * new altsetting.
1161 */ 1142 */
@@ -1202,7 +1183,9 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
1202 * 1183 *
1203 * Because this affects multiple interfaces, avoid using this with composite 1184 * Because this affects multiple interfaces, avoid using this with composite
1204 * (multi-interface) devices. Instead, the driver for each interface may 1185 * (multi-interface) devices. Instead, the driver for each interface may
1205 * use usb_set_interface() on the interfaces it claims. Resetting the whole 1186 * use usb_set_interface() on the interfaces it claims. Be careful though;
1187 * some devices don't support the SET_INTERFACE request, and others won't
1188 * reset all the interface state (notably data toggles). Resetting the whole
1206 * configuration would affect other drivers' interfaces. 1189 * configuration would affect other drivers' interfaces.
1207 * 1190 *
1208 * The caller must own the device lock. 1191 * The caller must own the device lock.