Greg:

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().

Alan Stern


# This is a BitKeeper generated patch for the following project:
# Project Name: greg k-h's linux 2.5 USB kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#                  ChangeSet    1.1661  -> 1.1662 
#       drivers/usb/core/message.c      1.52    -> 1.53   
#       drivers/usb/core/hub.c  1.114   -> 1.115  
#       drivers/usb/core/hcd.h  1.54    -> 1.55   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/08/01      [EMAIL PROTECTED]       1.1662
# Remove usb_set_maxpacket().  Make usb_physical_reset_device() call
# usb_set_configuration() instead.
# --------------------------------------------
#
diff -Nru a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
--- a/drivers/usb/core/hcd.h    Fri Aug  1 12:03:12 2003
+++ b/drivers/usb/core/hcd.h    Fri Aug  1 12:03:12 2003
@@ -251,7 +251,6 @@
 
 /* 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);
 
diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
--- a/drivers/usb/core/hub.c    Fri Aug  1 12:03:12 2003
+++ b/drivers/usb/core/hub.c    Fri Aug  1 12:03:12 2003
@@ -1324,9 +1324,7 @@
                        return 1;
                }
 
-               dev->actconfig = dev->config;
-               usb_set_maxpacket(dev);
-
+               usb_set_configuration(dev, dev->config[0].desc.bConfigurationValue);
                return 1;
        }
 
diff -Nru a/drivers/usb/core/message.c b/drivers/usb/core/message.c
--- a/drivers/usb/core/message.c        Fri Aug  1 12:03:12 2003
+++ b/drivers/usb/core/message.c        Fri Aug  1 12:03:12 2003
@@ -675,41 +675,6 @@
                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



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to