diff options
author | David Howells <dhowells@redhat.com> | 2013-03-28 14:48:35 -0400 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2013-04-03 13:28:33 -0400 |
commit | eb8ccd2b481123e5fe0872a83e07ea8a6e2c4026 (patch) | |
tree | 2a8bc68b0019f2c291654ad6a6345012619740be /drivers/usb | |
parent | 6a5d6943fe0e4b1e4c43c3aa1919360f68ae2f9a (diff) |
xhci: Rename SEGMENT_SIZE and SEGMENT_SHIFT as the former is used in a.out.h
Rename SEGMENT_SIZE and SEGMENT_SHIFT as the former is used in a.out.h.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: linux-usb@vger.kernel.org
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 16 | ||||
-rw-r--r-- | drivers/usb/host/xhci.h | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 6dc238c592bc..965b539bc474 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -51,7 +51,7 @@ static struct xhci_segment *xhci_segment_alloc(struct xhci_hcd *xhci, | |||
51 | return NULL; | 51 | return NULL; |
52 | } | 52 | } |
53 | 53 | ||
54 | memset(seg->trbs, 0, SEGMENT_SIZE); | 54 | memset(seg->trbs, 0, TRB_SEGMENT_SIZE); |
55 | /* If the cycle state is 0, set the cycle bit to 1 for all the TRBs */ | 55 | /* If the cycle state is 0, set the cycle bit to 1 for all the TRBs */ |
56 | if (cycle_state == 0) { | 56 | if (cycle_state == 0) { |
57 | for (i = 0; i < TRBS_PER_SEGMENT; i++) | 57 | for (i = 0; i < TRBS_PER_SEGMENT; i++) |
@@ -467,7 +467,7 @@ struct xhci_ring *xhci_dma_to_transfer_ring( | |||
467 | { | 467 | { |
468 | if (ep->ep_state & EP_HAS_STREAMS) | 468 | if (ep->ep_state & EP_HAS_STREAMS) |
469 | return radix_tree_lookup(&ep->stream_info->trb_address_map, | 469 | return radix_tree_lookup(&ep->stream_info->trb_address_map, |
470 | address >> SEGMENT_SHIFT); | 470 | address >> TRB_SEGMENT_SHIFT); |
471 | return ep->ring; | 471 | return ep->ring; |
472 | } | 472 | } |
473 | 473 | ||
@@ -478,7 +478,7 @@ static struct xhci_ring *dma_to_stream_ring( | |||
478 | u64 address) | 478 | u64 address) |
479 | { | 479 | { |
480 | return radix_tree_lookup(&stream_info->trb_address_map, | 480 | return radix_tree_lookup(&stream_info->trb_address_map, |
481 | address >> SEGMENT_SHIFT); | 481 | address >> TRB_SEGMENT_SHIFT); |
482 | } | 482 | } |
483 | #endif /* CONFIG_USB_XHCI_HCD_DEBUGGING */ | 483 | #endif /* CONFIG_USB_XHCI_HCD_DEBUGGING */ |
484 | 484 | ||
@@ -514,7 +514,7 @@ static int xhci_test_radix_tree(struct xhci_hcd *xhci, | |||
514 | 514 | ||
515 | cur_ring = stream_info->stream_rings[cur_stream]; | 515 | cur_ring = stream_info->stream_rings[cur_stream]; |
516 | for (addr = cur_ring->first_seg->dma; | 516 | for (addr = cur_ring->first_seg->dma; |
517 | addr < cur_ring->first_seg->dma + SEGMENT_SIZE; | 517 | addr < cur_ring->first_seg->dma + TRB_SEGMENT_SIZE; |
518 | addr += trb_size) { | 518 | addr += trb_size) { |
519 | mapped_ring = dma_to_stream_ring(stream_info, addr); | 519 | mapped_ring = dma_to_stream_ring(stream_info, addr); |
520 | if (cur_ring != mapped_ring) { | 520 | if (cur_ring != mapped_ring) { |
@@ -662,7 +662,7 @@ struct xhci_stream_info *xhci_alloc_stream_info(struct xhci_hcd *xhci, | |||
662 | cur_stream, (unsigned long long) addr); | 662 | cur_stream, (unsigned long long) addr); |
663 | 663 | ||
664 | key = (unsigned long) | 664 | key = (unsigned long) |
665 | (cur_ring->first_seg->dma >> SEGMENT_SHIFT); | 665 | (cur_ring->first_seg->dma >> TRB_SEGMENT_SHIFT); |
666 | ret = radix_tree_insert(&stream_info->trb_address_map, | 666 | ret = radix_tree_insert(&stream_info->trb_address_map, |
667 | key, cur_ring); | 667 | key, cur_ring); |
668 | if (ret) { | 668 | if (ret) { |
@@ -693,7 +693,7 @@ cleanup_rings: | |||
693 | if (cur_ring) { | 693 | if (cur_ring) { |
694 | addr = cur_ring->first_seg->dma; | 694 | addr = cur_ring->first_seg->dma; |
695 | radix_tree_delete(&stream_info->trb_address_map, | 695 | radix_tree_delete(&stream_info->trb_address_map, |
696 | addr >> SEGMENT_SHIFT); | 696 | addr >> TRB_SEGMENT_SHIFT); |
697 | xhci_ring_free(xhci, cur_ring); | 697 | xhci_ring_free(xhci, cur_ring); |
698 | stream_info->stream_rings[cur_stream] = NULL; | 698 | stream_info->stream_rings[cur_stream] = NULL; |
699 | } | 699 | } |
@@ -764,7 +764,7 @@ void xhci_free_stream_info(struct xhci_hcd *xhci, | |||
764 | if (cur_ring) { | 764 | if (cur_ring) { |
765 | addr = cur_ring->first_seg->dma; | 765 | addr = cur_ring->first_seg->dma; |
766 | radix_tree_delete(&stream_info->trb_address_map, | 766 | radix_tree_delete(&stream_info->trb_address_map, |
767 | addr >> SEGMENT_SHIFT); | 767 | addr >> TRB_SEGMENT_SHIFT); |
768 | xhci_ring_free(xhci, cur_ring); | 768 | xhci_ring_free(xhci, cur_ring); |
769 | stream_info->stream_rings[cur_stream] = NULL; | 769 | stream_info->stream_rings[cur_stream] = NULL; |
770 | } | 770 | } |
@@ -2305,7 +2305,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2305 | * so we pick the greater alignment need. | 2305 | * so we pick the greater alignment need. |
2306 | */ | 2306 | */ |
2307 | xhci->segment_pool = dma_pool_create("xHCI ring segments", dev, | 2307 | xhci->segment_pool = dma_pool_create("xHCI ring segments", dev, |
2308 | SEGMENT_SIZE, 64, xhci->page_size); | 2308 | TRB_SEGMENT_SIZE, 64, xhci->page_size); |
2309 | 2309 | ||
2310 | /* See Table 46 and Note on Figure 55 */ | 2310 | /* See Table 46 and Note on Figure 55 */ |
2311 | xhci->device_pool = dma_pool_create("xHCI input/output contexts", dev, | 2311 | xhci->device_pool = dma_pool_create("xHCI input/output contexts", dev, |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index ca550ddb0b1d..29c978e37135 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -1238,8 +1238,8 @@ union xhci_trb { | |||
1238 | #define TRBS_PER_SEGMENT 64 | 1238 | #define TRBS_PER_SEGMENT 64 |
1239 | /* Allow two commands + a link TRB, along with any reserved command TRBs */ | 1239 | /* Allow two commands + a link TRB, along with any reserved command TRBs */ |
1240 | #define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3) | 1240 | #define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3) |
1241 | #define SEGMENT_SIZE (TRBS_PER_SEGMENT*16) | 1241 | #define TRB_SEGMENT_SIZE (TRBS_PER_SEGMENT*16) |
1242 | #define SEGMENT_SHIFT (ilog2(SEGMENT_SIZE)) | 1242 | #define TRB_SEGMENT_SHIFT (ilog2(TRB_SEGMENT_SIZE)) |
1243 | /* TRB buffer pointers can't cross 64KB boundaries */ | 1243 | /* TRB buffer pointers can't cross 64KB boundaries */ |
1244 | #define TRB_MAX_BUFF_SHIFT 16 | 1244 | #define TRB_MAX_BUFF_SHIFT 16 |
1245 | #define TRB_MAX_BUFF_SIZE (1 << TRB_MAX_BUFF_SHIFT) | 1245 | #define TRB_MAX_BUFF_SIZE (1 << TRB_MAX_BUFF_SHIFT) |