lkml.org 
[lkml]   [2004]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 7/9] USB usbfs: destroy submitted urbs only on the disconnected interface
    Date
    The remaining three patches contain miscellaneous fixes to usbfs.
    This one fixes up the disconnect callback to only shoot down urbs
    on the disconnected interface, and not on all interfaces. It also adds
    a sanity check (this check is pointless because the interface could
    never have been claimed in the first place if it failed, but I feel better
    having it there).

    devio.c | 6 ++++--
    1 files changed, 4 insertions(+), 2 deletions(-)


    diff -Nru a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
    --- a/drivers/usb/core/devio.c Wed Apr 14 12:18:20 2004
    +++ b/drivers/usb/core/devio.c Wed Apr 14 12:18:20 2004
    @@ -341,6 +341,7 @@
    static void driver_disconnect(struct usb_interface *intf)
    {
    struct dev_state *ps = usb_get_intfdata (intf);
    + unsigned int ifnum = intf->altsetting->desc.bInterfaceNumber;

    if (!ps)
    return;
    @@ -349,11 +350,12 @@
    * all pending I/O requests; 2.6 does that.
    */

    - clear_bit(intf->cur_altsetting->desc.bInterfaceNumber, &ps->ifclaimed);
    + if (ifnum < 8*sizeof(ps->ifclaimed))
    + clear_bit(ifnum, &ps->ifclaimed);
    usb_set_intfdata (intf, NULL);

    /* force async requests to complete */
    - destroy_all_async (ps);
    + destroy_async_on_interface(ps, ifnum);
    }

    struct usb_driver usbdevfs_driver = {
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2005-03-22 14:02    [W:4.199 / U:0.656 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site