Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270
b: refs/heads/master
c: a81e7ec
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Greg K-H committed Apr 19, 2005
1 parent 4a87189 commit 3c9f378
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 45f23f189ca66d98b1f8b7f3d30a194d3188039d
refs/heads/master: a81e7ecca369afee0b07b4758d8c32542ffc587a
25 changes: 4 additions & 21 deletions trunk/drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,29 +1133,10 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
/* prevent submissions using previous endpoint settings */
usb_disable_interface(dev, iface);

/* 9.1.1.5 says:
*
* Configuring a device or changing an alternate setting
* causes all of the status and configuration values
* associated with endpoints in the affected interfaces to
* be set to their default values. This includes setting
* the data toggle of any endpoint using data toggles to
* the value DATA0.
*
* Some devices take this too literally and don't reset the data
* toggles if the new altsetting is the same as the old one (the
* command isn't "changing" an alternate setting). We will manually
* reset the toggles when the new and old altsettings are the same.
* Most devices won't need this, but fortunately it doesn't happen
* often.
*/
if (iface->cur_altsetting == alt)
manual = 1;
iface->cur_altsetting = alt;

/* If the interface only has one altsetting and the device didn't
* accept the request (or whenever the old altsetting is the same
* as the new one), we attempt to carry out the equivalent action
* accept the request, we attempt to carry out the equivalent action
* by manually clearing the HALT feature for each endpoint in the
* new altsetting.
*/
Expand Down Expand Up @@ -1202,7 +1183,9 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
*
* Because this affects multiple interfaces, avoid using this with composite
* (multi-interface) devices. Instead, the driver for each interface may
* use usb_set_interface() on the interfaces it claims. Resetting the whole
* use usb_set_interface() on the interfaces it claims. Be careful though;
* some devices don't support the SET_INTERFACE request, and others won't
* reset all the interface state (notably data toggles). Resetting the whole
* configuration would affect other drivers' interfaces.
*
* The caller must own the device lock.
Expand Down

0 comments on commit 3c9f378

Please sign in to comment.