• Robert Sprowson's avatar
    Improve transfer callout handling · 1a1fd436
    Robert Sprowson authored
    xhci.c: Merge changes from NetBSD 1.28.2.51; previously timeouts were only applied to control transfers and were cancelled post transfer complete, now all transfer types are covered and are called prior to usbd_transfer_complete() being called.
    glue.c: More faithfully implement callout_reset(). The spec for this function is supposed to extend a callout for ones that are already running, but since the callx library ultimately uses OS_CallAfter what actually happened was two callafters were scheduled. This caused a NULL pointer exception if USBDriver cancelled a transaction before the timeout completed (because the cancel caused a 2nd OS_CallAfter to be scheduled, but the cancel caused usbd_transfer_complete() to consume then free the xfer, then the 2nd OS_CallAfter fired and passed a free'd list to usbd_transfer_complete()).
    
    Also removed redundant headers usb_mem.h and usb_quirks.h.
    Tested over 3 weeks on a Titanium (waiting for the right sequence of events to cause 2 OS_CallAfters to trigger took several days each!).
    
    Version 0.19. Tagged as 'XHCIDriver-0_19'
    1a1fd436
VersionNum 831 Bytes