Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93379
b: refs/heads/master
c: fc721f5
h: refs/heads/master
i:
  93377: a8e427c
  93375: 35f9ff3
v: v3
  • Loading branch information
Inaky Perez-Gonzalez authored and Greg Kroah-Hartman committed Apr 25, 2008
1 parent d6f635a commit c6b6737
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 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: 6c529cdca914ba2a08a4bba54f11dedc2d3a7c17
refs/heads/master: fc721f5194dc98c8108fb155a4fbae1cd746cf41
11 changes: 6 additions & 5 deletions trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2211,12 +2211,13 @@ static int hub_port_debounce(struct usb_hub *hub, int port1)
return portstatus;
}

static void ep0_reinit(struct usb_device *udev)
void usb_ep0_reinit(struct usb_device *udev)
{
usb_disable_endpoint(udev, 0 + USB_DIR_IN);
usb_disable_endpoint(udev, 0 + USB_DIR_OUT);
usb_enable_endpoint(udev, &udev->ep0);
}
EXPORT_SYMBOL_GPL(usb_ep0_reinit);

#define usb_sndaddr0pipe() (PIPE_CONTROL << 30)
#define usb_rcvaddr0pipe() ((PIPE_CONTROL << 30) | USB_DIR_IN)
Expand All @@ -2237,7 +2238,7 @@ static int hub_set_address(struct usb_device *udev, int devnum)
if (retval == 0) {
udev->devnum = devnum; /* Device now using proper address */
usb_set_device_state(udev, USB_STATE_ADDRESS);
ep0_reinit(udev);
usb_ep0_reinit(udev);
}
return retval;
}
Expand Down Expand Up @@ -2473,7 +2474,7 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
}
dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
udev->ep0.desc.wMaxPacketSize = cpu_to_le16(i);
ep0_reinit(udev);
usb_ep0_reinit(udev);
}

retval = usb_get_device_descriptor(udev, USB_DT_DEVICE_SIZE);
Expand Down Expand Up @@ -2729,7 +2730,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
loop_disable:
hub_port_disable(hub, port1, 1);
loop:
ep0_reinit(udev);
usb_ep0_reinit(udev);
release_address(udev);
usb_put_dev(udev);
if ((status == -ENOTCONN) || (status == -ENOTSUPP))
Expand Down Expand Up @@ -3164,7 +3165,7 @@ int usb_reset_device(struct usb_device *udev)

/* ep0 maxpacket size may change; let the HCD know about it.
* Other endpoints will be handled by re-enumeration. */
ep0_reinit(udev);
usb_ep0_reinit(udev);
ret = hub_port_init(parent_hub, udev, port1, i);
if (ret >= 0 || ret == -ENOTCONN || ret == -ENODEV)
break;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/usb/core/hub.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,6 @@ struct usb_tt_clear {
};

extern void usb_hub_tt_clear_buffer(struct usb_device *dev, int pipe);
extern void usb_ep0_reinit(struct usb_device *);

#endif /* __LINUX_HUB_H */

0 comments on commit c6b6737

Please sign in to comment.