xhci: Store endpoint bandwidth information.
commit9af5d71d8e1fc404ad2ac1b568dafa1a2f9b3be2
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Fri, 2 Sep 2011 18:05:48 +0000 (2 11:05 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 9 Sep 2011 22:52:53 +0000 (9 15:52 -0700)
treed3f3732ada05aaef7ffb76cfbc5d849b0fc421ac
parent839c817ce67178ca3c7c7ad534c571bba1e69ebe
xhci: Store endpoint bandwidth information.

In the upcoming patches, we'll use some stored endpoint information to
make software keep track of the worst-case bandwidth schedule.  We need to
store several variables associated with each periodic endpoint:
 - the type of endpoint
 - Max Packet Size
 - Mult
 - Max ESIT payload
 - Max Burst Size (aka number of packets, stored in one-based form)
 - the endpoint interval (normalized to powers of 2 microframes)

All this information is available to the hardware, and stored in its
device output context.  However, we need to ensure that the new
information is stored before the xHCI driver drops the xhci->lock to wait
on the Configure Endpoint command, so that another driver requesting a
configuration or alt setting change will see the update.  The Configure
Endpoint command will never fail on the hardware that needs this software
bandwidth checking (assuming the slot is enabled and the flags are set
properly), so updating the endpoint info before the command completes
should be fine.

Until we add in the bandwidth checking code, just update the endpoint
information after the Configure Endpoint command completes, and after a
Reset Device command completes.  Don't bother to clear the endpoint
bandwidth info when a device is being freed, since the xhci_virt_ep is
just going to be freed anyway.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/xhci-mem.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h