• Martin Diehl's avatar
    [PATCH] usb_set_interface: correct toggle reset · 944b9581
    Martin Diehl authored
      
    this is a patch to prevent usb_set_interface() from erroneously resetting
    the toggles for all endpoints instead of only the affected ones from the
    requested interface/altsetting. I've also added some missing parentheses
    to related macros in usb.h as I prefered not to take special care for
    nasty side-effects ;-)
      
    Patch below was created against 2.4.18-pre9 (with some lines of offset it
    applies to 2.5.4-pre5 as well).
      
    Tested in multi-interface configuration to provide evidence it:
    * correctly identifies the affected endpoints and resets the toggles
    * doesn't touch endpoints from other interfaces
    * provides correct handling of shared EP0
    * solves an issue I had with 2.4.18-pre9 where setting one interface
      occasionally caused transfers on other interface to hang due to lost
      toggle synchronisation
    
    Despite being a pure bugfix, well localized and (IMHO) pretty obviously
    correct wrt. USB-spec, I'd like to suggest including this in early
    2.4.19-pre. Just in case some existing driver would somehow workaround
    the currently wrong behavior and might break with this fix. And it's
    not very urgent right now, as we are probably close to 2.4.18-rc1.
      
    Regards,
    Martin
    944b9581
usb.c 85.2 KB