• Alan Stern's avatar
    [PATCH] USB: Only process ports with change events pending · ce145ab2
    Alan Stern authored
    This patch adds a bit-array to the hub driver's private data structure,
    used for storing the contents of the hub's interrupt status message.  That
    message indicates which ports have events pending (and whether the hub
    itself has events pending).  By only polling the status of the ports
    listed in the bit-array we can save a fair amount of overhead in hub
    communication.
    
    (The #error test added to hub.h is a little awkward, but it's purely
    precautionary -- it won't matter until someone decides to support hubs
    with more than 31 ports!)
    
    Also included in the patch, since this seemed the perfect opportunity for
    it, is Byron's suggestion for handling hub events in the order in which
    they were received.
    Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
    ce145ab2
hub.c 54.5 KB