Greg and Matt:

I'm beginning the process of converting device drivers to use 
cur_altsetting with usb-storage, the one I know best.  Only a few changes 
are needed (and the first one isn't even really necessary).

Alan Stern


diff -Nru a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
--- a/drivers/usb/storage/usb.c Mon Mar  1 11:40:11 2004
+++ b/drivers/usb/storage/usb.c Mon Mar  1 11:40:11 2004
@@ -423,7 +423,7 @@
        /* Fill in the device-related fields */
        us->pusb_dev = interface_to_usbdev(intf);
        us->pusb_intf = intf;
-       us->ifnum = intf->altsetting->desc.bInterfaceNumber;
+       us->ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
 
        /* Store our private data in the interface and increment the
         * device's reference count */
@@ -452,7 +452,7 @@
 {
        struct usb_device *dev = us->pusb_dev;
        struct usb_interface_descriptor *idesc =
-               &us->pusb_intf->altsetting[us->pusb_intf->act_altsetting].desc;
+               &us->pusb_intf->cur_altsetting->desc;
        struct us_unusual_dev *unusual_dev = &us_unusual_dev_list[id_index];
        struct usb_device_id *id = &storage_usb_ids[id_index];
 
@@ -686,7 +686,7 @@
 static int get_pipes(struct us_data *us)
 {
        struct usb_host_interface *altsetting =
-               &us->pusb_intf->altsetting[us->pusb_intf->act_altsetting];
+               us->pusb_intf->cur_altsetting;
        int i;
        struct usb_endpoint_descriptor *ep;
        struct usb_endpoint_descriptor *ep_in = NULL;
@@ -877,8 +877,9 @@
        int result;
 
        US_DEBUGP("USB Mass Storage device detected\n");
-       US_DEBUGP("act_altsetting is %d, id_index is %d\n",
-                       intf->act_altsetting, id_index);
+       US_DEBUGP("altsetting is %d, id_index is %d\n",
+                       intf->cur_altsetting->desc.bAlternateSetting,
+                       id_index);
 
        /* Allocate the us_data structure and initialize the mutexes */
        us = (struct us_data *) kmalloc(sizeof(*us), GFP_KERNEL);






-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to