android_kernel_xiaomi_sdm845/drivers/usb/host
Sarah Sharp 9238f25d5d USB: xhci: properly set endpoint context fields for periodic eps.
For periodic endpoints, we must let the xHCI hardware know the maximum
payload an endpoint can transfer in one service interval.  The xHCI
specification refers to this as the Maximum Endpoint Service Interval Time
Payload (Max ESIT Payload).  This is used by the hardware for bandwidth
management and scheduling of packets.

For SuperSpeed endpoints, the maximum is calculated by multiplying the max
packet size by the number of bursts and the number of opportunities to
transfer within a service interval (the Mult field of the SuperSpeed
Endpoint companion descriptor).  Devices advertise this in the
wBytesPerInterval field of their SuperSpeed Endpoint Companion Descriptor.

For high speed devices, this is taken by multiplying the max packet size by the
"number of additional transaction opportunities per microframe" (the high
bits of the wMaxPacketSize field in the endpoint descriptor).

For FS/LS devices, this is just the max packet size.

The other thing we must set in the endpoint context is the Average TRB
Length.  This is supposed to be the average of the total bytes in the
transfer descriptor (TD), divided by the number of transfer request blocks
(TRBs) it takes to describe the TD.  This gives the host controller an
indication of whether the driver will be enqueuing a scatter gather list
with many entries comprised of small buffers, or one contiguous buffer.

It also takes into account the number of extra TRBs you need for every TD.
This includes No-op TRBs and Link TRBs used to link ring segments
together.  Some drivers may choose to chain an Event Data TRB on the end
of every TD, thus increasing the average number of TRBs per TD.  The Linux
xHCI driver does not use Event Data TRBs.

In theory, if there was an API to allow drivers to state what their
bandwidth requirements are, we could set this field accurately.  For now,
we set it to the same number as the Max ESIT payload.

The Average TRB Length should also be set for bulk and control endpoints,
but I have no idea how to guess what it should be.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-30 09:25:10 -07:00
..
whci include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ehci-atmel.c USB: ehci-atmel.c: use resource_size() 2010-03-02 14:53:18 -08:00
ehci-au1xxx.c USB: ehci-au1xxx.c: use platform_get_resource() and resource_size() 2010-03-02 14:53:18 -08:00
ehci-dbg.c USB: EHCI: split ehci_qh into hw and sw parts 2009-09-23 06:46:29 -07:00
ehci-fsl.c USB: ehci-fsl: Add power management support 2010-03-02 14:53:15 -08:00
ehci-fsl.h
ehci-hcd.c USB: EHCI: defer reclamation of siTDs 2010-04-22 15:18:28 -07:00
ehci-hub.c usb: Increase timeout value for device reset 2010-04-22 15:18:29 -07:00
ehci-ixp4xx.c USB: EHCI: use the new clear_tt_buffer interface 2009-07-12 15:16:39 -07:00
ehci-mem.c USB: EHCI: defer reclamation of siTDs 2010-04-22 15:18:28 -07:00
ehci-mxc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ehci-omap.c USB: ehci: omap: fix kernel panic with rmmod 2010-04-22 15:18:21 -07:00
ehci-orion.c USB: ehci-orion.c: use resource_size() 2010-03-02 14:53:17 -08:00
ehci-pci.c USB: work around for EHCI with quirky periodic schedules 2009-11-30 16:43:16 -08:00
ehci-ppc-of.c USB: Convert concatenated __FILE__ to %s, __FILE__ 2010-03-02 14:54:59 -08:00
ehci-ps3.c USB: EHCI: use the new clear_tt_buffer interface 2009-07-12 15:16:39 -07:00
ehci-q.c USB: EHCI: fix handling of unusual interrupt intervals 2010-01-20 15:24:34 -08:00
ehci-sched.c USB: EHCI: defer reclamation of siTDs 2010-04-22 15:18:28 -07:00
ehci-w90x900.c USB: Add nuvoton Ehci driver for w90p910 platform 2009-09-23 06:46:20 -07:00
ehci-xilinx-of.c USB: Convert concatenated __FILE__ to %s, __FILE__ 2010-03-02 14:54:59 -08:00
ehci.h USB: EHCI: defer reclamation of siTDs 2010-04-22 15:18:28 -07:00
fhci-dbg.c USB: FHCI: use the new usb debugfs directory 2009-06-15 21:44:43 -07:00
fhci-hcd.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
fhci-hub.c
fhci-mem.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
fhci-q.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
fhci-sched.c kfifo: move struct kfifo in place 2009-12-22 14:17:55 -08:00
fhci-tds.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
fhci.h kfifo: rename kfifo_put... into kfifo_in... and kfifo_get... into kfifo_out... 2009-12-22 14:17:56 -08:00
hwa-hc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
imx21-dbg.c USB: MXC: Add i.MX21 specific USB host controller driver. 2010-03-02 14:52:55 -08:00
imx21-hcd.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
imx21-hcd.h USB: MXC: Add i.MX21 specific USB host controller driver. 2010-03-02 14:52:55 -08:00
isp116x-hcd.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
isp116x.h
isp1362-hcd.c USB: remove obsolete config in kernel source (USB_HCD_DMA) 2010-03-02 14:54:37 -08:00
isp1362.h USB: FIX bitfield istl_flip:1, make it unsigned. 2009-12-11 11:55:20 -08:00
isp1760-hcd.c USB: isp1760: Flush the D-cache for the pipe-in transfer buffers 2010-03-02 14:54:53 -08:00
isp1760-hcd.h USB: isp1760: allow platform devices to customize devflags 2009-09-23 06:46:29 -07:00
isp1760-if.c USB host: make Open Firmware device id constant 2010-03-02 14:54:18 -08:00
Kconfig USB: MXC: Add i.MX21 specific USB host controller driver. 2010-03-02 14:52:55 -08:00
Makefile USB: xhci: rename driver to xhci_hcd 2010-03-19 07:24:08 -07:00
ohci-at91.c USB: modifications for at91sam9g10 2009-12-11 11:55:15 -08:00
ohci-au1xxx.c const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
ohci-da8xx.c USB: OHCI: DA8xx/OMAP-L1x: fix up macro rename 2010-04-22 15:18:24 -07:00
ohci-dbg.c USB: Convert concatenated __FILE__ to %s, __FILE__ 2010-03-02 14:54:59 -08:00
ohci-ep93xx.c USB: ohci-ep93xx.c: remove unused variable 2009-09-23 06:46:34 -07:00
ohci-hcd.c USB: OHCI: DA8xx/OMAP-L1x glue layer 2010-03-02 14:55:06 -08:00
ohci-hub.c USB: OHCI: don't look at the root hub to get the number of ports 2010-04-30 09:25:10 -07:00
ohci-lh7a404.c USB: Convert concatenated __FILE__ to %s, __FILE__ 2010-03-02 14:54:59 -08:00
ohci-mem.c
ohci-omap.c omap: headers: Move remaining headers from include/mach to include/plat 2009-10-20 09:40:47 -07:00
ohci-pci.c USB: ohci: quirk AMD prefetch for USB 1.1 ISO transfer 2009-11-17 16:46:33 -08:00
ohci-pnx4008.c USB: fix I2C API usage in ohci-pnx4008. 2010-03-02 14:55:15 -08:00
ohci-pnx8550.c
ohci-ppc-of.c USB: Convert concatenated __FILE__ to %s, __FILE__ 2010-03-02 14:54:59 -08:00
ohci-ppc-soc.c USB: Convert concatenated __FILE__ to %s, __FILE__ 2010-03-02 14:54:59 -08:00
ohci-ps3.c usb/ps3: Add missing annotations 2009-06-16 14:17:32 +10:00
ohci-pxa27x.c const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
ohci-q.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ohci-s3c2410.c USB: S3C: Move usb-control.h to platform include 2009-03-24 16:20:45 -07:00
ohci-sa1111.c USB: Convert concatenated __FILE__ to %s, __FILE__ 2010-03-02 14:54:59 -08:00
ohci-sh.c
ohci-sm501.c
ohci-ssb.c
ohci-tmio.c
ohci.h USB: ohci: quirk AMD prefetch for USB 1.1 ISO transfer 2009-11-17 16:46:33 -08:00
oxu210hp-hcd.c USB: EHCI: OHCI: Remove unnecessary includes of reboot.h 2009-09-23 06:46:32 -07:00
oxu210hp.h
pci-quirks.c Revert "USB: Work around BIOS bugs by quiescing USB controllers earlier" 2009-10-11 15:57:57 -07:00
pci-quirks.h
r8a66597-hcd.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
r8a66597.h usb: move r8a66597 register defines 2009-07-23 13:04:10 +09:00
sl811_cs.c pcmcia: rework the irq_req_t typedef 2009-11-28 18:03:14 +01:00
sl811-hcd.c USB: host: SL811: fix unaligned accesses 2010-03-02 14:53:26 -08:00
sl811.h
u132-hcd.c
uhci-debug.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
uhci-hcd.c USB: fix crash in uhci_scan_schedule 2010-03-02 14:54:12 -08:00
uhci-hcd.h
uhci-hub.c USB: add missing delay during remote wakeup 2010-01-20 15:24:34 -08:00
uhci-q.c USB: uhci: rm repeatedly evaluation for urbp->qh 2009-09-23 06:46:30 -07:00
xhci-dbg.c USB: xhci: Fix compile issues with xhci_get_slot_state() 2010-03-02 14:54:01 -08:00
xhci-ext-caps.h USB: xhci: Fix finding extended capabilities registers 2010-03-02 14:55:02 -08:00
xhci-hub.c USB: xhci: Allow roothub ports to be disabled. 2010-03-02 14:53:12 -08:00
xhci-mem.c USB: xhci: properly set endpoint context fields for periodic eps. 2010-04-30 09:25:10 -07:00
xhci-pci.c USB: Add call to notify xHC of a device reset. 2010-03-02 14:53:12 -08:00
xhci-ring.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
xhci.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
xhci.h USB: xhci: properly set endpoint context fields for periodic eps. 2010-04-30 09:25:10 -07:00