aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2011-09-13 19:41:12 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-09-20 15:33:49 -0400
commit170c026347c867a71e27713b98c58b266146c468 (patch)
treede0b8e1855b93ecae7d6d6dfe3138c6228b5fb54 /drivers/usb/host
parent75d7cf72ab9fa01dc70877aa5c68e8ef477229dc (diff)
xhci: Fix mult base in endpoint bandwidth info.
The "Mult" bits in the SuperSpeed Endpoint Companion Descriptor are zero-based, and the xHCI host controller wants them to be zero-based in the input context. However, for the bandwidth math, we want them to be one-based. Fix this. Fix the documentation about the endpoint bandwidth mult variable in the xhci.h file, which says it is zero-based. Also fix the documentation about num_packets, which is also one-based, not zero-based. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/xhci-mem.c9
-rw-r--r--drivers/usb/host/xhci.h3
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index c4b8959e01e7..94a8b28d602e 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1473,11 +1473,12 @@ void xhci_update_bw_info(struct xhci_hcd *xhci,
1473 /* Added or changed endpoint */ 1473 /* Added or changed endpoint */
1474 bw_info->ep_interval = CTX_TO_EP_INTERVAL( 1474 bw_info->ep_interval = CTX_TO_EP_INTERVAL(
1475 le32_to_cpu(ep_ctx->ep_info)); 1475 le32_to_cpu(ep_ctx->ep_info));
1476 bw_info->mult = CTX_TO_EP_MULT( 1476 /* Number of packets and mult are zero-based in the
1477 le32_to_cpu(ep_ctx->ep_info)); 1477 * input context, but we want one-based for the
1478 /* Number of packets is zero-based in the input context, 1478 * interval table.
1479 * but we want one-based for the interval table.
1480 */ 1479 */
1480 bw_info->mult = CTX_TO_EP_MULT(
1481 le32_to_cpu(ep_ctx->ep_info)) + 1;
1481 bw_info->num_packets = CTX_TO_MAX_BURST( 1482 bw_info->num_packets = CTX_TO_MAX_BURST(
1482 le32_to_cpu(ep_ctx->ep_info2)) + 1; 1483 le32_to_cpu(ep_ctx->ep_info2)) + 1;
1483 bw_info->max_packet_size = MAX_PACKET_DECODED( 1484 bw_info->max_packet_size = MAX_PACKET_DECODED(
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 13f1c23ed19d..752a500f8695 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -747,8 +747,9 @@ struct xhci_stream_info {
747 * (DMI) also limits the total bandwidth (across all domains) that can be used. 747 * (DMI) also limits the total bandwidth (across all domains) that can be used.
748 */ 748 */
749struct xhci_bw_info { 749struct xhci_bw_info {
750 /* ep_interval is zero-based */
750 unsigned int ep_interval; 751 unsigned int ep_interval;
751 /* mult and num_packets are zero-based */ 752 /* mult and num_packets are one-based */
752 unsigned int mult; 753 unsigned int mult;
753 unsigned int num_packets; 754 unsigned int num_packets;
754 unsigned int max_packet_size; 755 unsigned int max_packet_size;