Commit 65a40f8a authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] USB: Remove usb_set_maxpacket()

This is the final part of as66c.  It removes the usb_set_maxpacket()
routine, since the same functionality now exists elsewhere.  The one place
it was used was in the device reset pathway for a device that has changed
somehow since the previous reset.  That code needs to be fixed up anyway;
for now it's enough just to have it call usb_set_configuration().
parent f8159fb5
......@@ -252,7 +252,6 @@ extern void usb_disconnect(struct usb_device **);
/* exported to hub driver ONLY to support usb_reset_device () */
extern int usb_get_configuration(struct usb_device *dev);
extern void usb_set_maxpacket(struct usb_device *dev);
extern void usb_destroy_configuration(struct usb_device *dev);
extern int usb_set_address(struct usb_device *dev);
......
......@@ -1331,9 +1331,7 @@ int usb_physical_reset_device(struct usb_device *dev)
return 1;
}
dev->actconfig = dev->config;
usb_set_maxpacket(dev);
usb_set_configuration(dev, dev->config[0].desc.bConfigurationValue);
return 1;
}
......
......@@ -675,41 +675,6 @@ int usb_get_status(struct usb_device *dev, int type, int target, void *data)
HZ * USB_CTRL_GET_TIMEOUT);
}
// hub-only!! ... and only exported for reset/reinit path.
// otherwise used internally, when setting up a config
void usb_set_maxpacket(struct usb_device *dev)
{
int i, b;
/* NOTE: affects all endpoints _except_ ep0 */
for (i=0; i<dev->actconfig->desc.bNumInterfaces; i++) {
struct usb_interface *ifp = dev->actconfig->interface[i];
struct usb_host_interface *as = ifp->altsetting + ifp->act_altsetting;
struct usb_host_endpoint *ep = as->endpoint;
int e;
for (e=0; e<as->desc.bNumEndpoints; e++) {
struct usb_endpoint_descriptor *d;
d = &ep [e].desc;
b = d->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
if ((d->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_CONTROL) { /* Control => bidirectional */
dev->epmaxpacketout[b] = d->wMaxPacketSize;
dev->epmaxpacketin [b] = d->wMaxPacketSize;
}
else if (usb_endpoint_out(d->bEndpointAddress)) {
if (d->wMaxPacketSize > dev->epmaxpacketout[b])
dev->epmaxpacketout[b] = d->wMaxPacketSize;
}
else {
if (d->wMaxPacketSize > dev->epmaxpacketin [b])
dev->epmaxpacketin [b] = d->wMaxPacketSize;
}
}
}
}
/**
* usb_clear_halt - tells device to clear endpoint halt/stall condition
* @dev: device whose endpoint is halted
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment