aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-07-11 11:21:32 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-16 19:50:13 -0400
commit4c53de72109759c931744734ca75f9cecb3baef1 (patch)
tree0f464052baf26967994146bf3b3716b3dd6e6d35 /drivers
parentc83e1a9ff68a6535b81c40dc8fda99348ab480fb (diff)
USB: EHCI: add symbolic constants for QHs
This patch (as1568) introduces symbolic constants for some of the less-frequently used bitfields in the QH structure. This makes the code a little easier to read and understand. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/ehci-dbg.c6
-rw-r--r--drivers/usb/host/ehci-hcd.c2
-rw-r--r--drivers/usb/host/ehci-q.c12
-rw-r--r--drivers/usb/host/ehci.h8
4 files changed, 17 insertions, 11 deletions
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 7561966fbdc4..97338abff296 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -404,9 +404,9 @@ struct debug_buffer {
404 404
405#define speed_char(info1) ({ char tmp; \ 405#define speed_char(info1) ({ char tmp; \
406 switch (info1 & (3 << 12)) { \ 406 switch (info1 & (3 << 12)) { \
407 case 0 << 12: tmp = 'f'; break; \ 407 case QH_FULL_SPEED: tmp = 'f'; break; \
408 case 1 << 12: tmp = 'l'; break; \ 408 case QH_LOW_SPEED: tmp = 'l'; break; \
409 case 2 << 12: tmp = 'h'; break; \ 409 case QH_HIGH_SPEED: tmp = 'h'; break; \
410 default: tmp = '?'; break; \ 410 default: tmp = '?'; break; \
411 }; tmp; }) 411 }; tmp; })
412 412
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 1f8f792eec86..cdb15769468a 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -667,7 +667,7 @@ static int ehci_init(struct usb_hcd *hcd)
667 hw->hw_next = QH_NEXT(ehci, ehci->async->qh_dma); 667 hw->hw_next = QH_NEXT(ehci, ehci->async->qh_dma);
668 hw->hw_info1 = cpu_to_hc32(ehci, QH_HEAD); 668 hw->hw_info1 = cpu_to_hc32(ehci, QH_HEAD);
669#if defined(CONFIG_PPC_PS3) 669#if defined(CONFIG_PPC_PS3)
670 hw->hw_info1 |= cpu_to_hc32(ehci, (1 << 7)); /* I = 1 */ 670 hw->hw_info1 |= cpu_to_hc32(ehci, QH_INACTIVATE);
671#endif 671#endif
672 hw->hw_token = cpu_to_hc32(ehci, QTD_STS_HALT); 672 hw->hw_token = cpu_to_hc32(ehci, QTD_STS_HALT);
673 hw->hw_qtd_next = EHCI_LIST_END(ehci); 673 hw->hw_qtd_next = EHCI_LIST_END(ehci);
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 7d117bbffac1..156504787711 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -100,7 +100,7 @@ qh_update (struct ehci_hcd *ehci, struct ehci_qh *qh, struct ehci_qtd *qtd)
100 * and set the pseudo-toggle in udev. Only usb_clear_halt() will 100 * and set the pseudo-toggle in udev. Only usb_clear_halt() will
101 * ever clear it. 101 * ever clear it.
102 */ 102 */
103 if (!(hw->hw_info1 & cpu_to_hc32(ehci, 1 << 14))) { 103 if (!(hw->hw_info1 & cpu_to_hc32(ehci, QH_TOGGLE_CTL))) {
104 unsigned is_out, epnum; 104 unsigned is_out, epnum;
105 105
106 is_out = qh->is_out; 106 is_out = qh->is_out;
@@ -886,7 +886,7 @@ qh_make (
886 /* using TT? */ 886 /* using TT? */
887 switch (urb->dev->speed) { 887 switch (urb->dev->speed) {
888 case USB_SPEED_LOW: 888 case USB_SPEED_LOW:
889 info1 |= (1 << 12); /* EPS "low" */ 889 info1 |= QH_LOW_SPEED;
890 /* FALL THROUGH */ 890 /* FALL THROUGH */
891 891
892 case USB_SPEED_FULL: 892 case USB_SPEED_FULL:
@@ -894,8 +894,8 @@ qh_make (
894 if (type != PIPE_INTERRUPT) 894 if (type != PIPE_INTERRUPT)
895 info1 |= (EHCI_TUNE_RL_TT << 28); 895 info1 |= (EHCI_TUNE_RL_TT << 28);
896 if (type == PIPE_CONTROL) { 896 if (type == PIPE_CONTROL) {
897 info1 |= (1 << 27); /* for TT */ 897 info1 |= QH_CONTROL_EP; /* for TT */
898 info1 |= 1 << 14; /* toggle from qtd */ 898 info1 |= QH_TOGGLE_CTL; /* toggle from qtd */
899 } 899 }
900 info1 |= maxp << 16; 900 info1 |= maxp << 16;
901 901
@@ -920,11 +920,11 @@ qh_make (
920 break; 920 break;
921 921
922 case USB_SPEED_HIGH: /* no TT involved */ 922 case USB_SPEED_HIGH: /* no TT involved */
923 info1 |= (2 << 12); /* EPS "high" */ 923 info1 |= QH_HIGH_SPEED;
924 if (type == PIPE_CONTROL) { 924 if (type == PIPE_CONTROL) {
925 info1 |= (EHCI_TUNE_RL_HS << 28); 925 info1 |= (EHCI_TUNE_RL_HS << 28);
926 info1 |= 64 << 16; /* usb2 fixed maxpacket */ 926 info1 |= 64 << 16; /* usb2 fixed maxpacket */
927 info1 |= 1 << 14; /* toggle from qtd */ 927 info1 |= QH_TOGGLE_CTL; /* toggle from qtd */
928 info2 |= (EHCI_TUNE_MULT_HS << 30); 928 info2 |= (EHCI_TUNE_MULT_HS << 30);
929 } else if (type == PIPE_BULK) { 929 } else if (type == PIPE_BULK) {
930 info1 |= (EHCI_TUNE_RL_HS << 28); 930 info1 |= (EHCI_TUNE_RL_HS << 28);
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index f7a59f5d70c6..195449db1b18 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -324,7 +324,13 @@ union ehci_shadow {
324struct ehci_qh_hw { 324struct ehci_qh_hw {
325 __hc32 hw_next; /* see EHCI 3.6.1 */ 325 __hc32 hw_next; /* see EHCI 3.6.1 */
326 __hc32 hw_info1; /* see EHCI 3.6.2 */ 326 __hc32 hw_info1; /* see EHCI 3.6.2 */
327#define QH_HEAD 0x00008000 327#define QH_CONTROL_EP (1 << 27) /* FS/LS control endpoint */
328#define QH_HEAD (1 << 15) /* Head of async reclamation list */
329#define QH_TOGGLE_CTL (1 << 14) /* Data toggle control */
330#define QH_HIGH_SPEED (2 << 12) /* Endpoint speed */
331#define QH_LOW_SPEED (1 << 12)
332#define QH_FULL_SPEED (0 << 12)
333#define QH_INACTIVATE (1 << 7) /* Inactivate on next transaction */
328 __hc32 hw_info2; /* see EHCI 3.6.2 */ 334 __hc32 hw_info2; /* see EHCI 3.6.2 */
329#define QH_SMASK 0x000000ff 335#define QH_SMASK 0x000000ff
330#define QH_CMASK 0x0000ff00 336#define QH_CMASK 0x0000ff00