aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2006-08-30 17:50:06 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 14:58:56 -0400
commit53bd6a601a87bb6d0df844872bc15fd4e8d127ce (patch)
treec3437c0846e099c77d820510d822f9d13a2f58e2
parent729ed6d502b45fd3b5c3b21c3ceaa63a8fe7cc43 (diff)
USB: EHCI whitespace fixes (cosmetic)
[ ... when you have an editor set to remind you of whitespace bugs ... ] Cosmetic EHCI changes: remove end-of-line whitespace, spaces before tabs. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/host/ehci-dbg.c14
-rw-r--r--drivers/usb/host/ehci-hcd.c6
-rw-r--r--drivers/usb/host/ehci-hub.c12
-rw-r--r--drivers/usb/host/ehci-mem.c14
-rw-r--r--drivers/usb/host/ehci-q.c20
-rw-r--r--drivers/usb/host/ehci-sched.c26
-rw-r--r--drivers/usb/host/ehci.h36
7 files changed, 64 insertions, 64 deletions
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 215ce6d06394..9cd6270d06bc 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (c) 2001-2002 by David Brownell 2 * Copyright (c) 2001-2002 by David Brownell
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the 5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your 6 * Free Software Foundation; either version 2 of the License, or (at your
@@ -65,7 +65,7 @@ static void dbg_hcs_params (struct ehci_hcd *ehci, char *label)
65 for (i = 0; i < HCS_N_PORTS (params); i++) { 65 for (i = 0; i < HCS_N_PORTS (params); i++) {
66 // FIXME MIPS won't readb() ... 66 // FIXME MIPS won't readb() ...
67 byte = readb (&ehci->caps->portroute[(i>>1)]); 67 byte = readb (&ehci->caps->portroute[(i>>1)]);
68 sprintf(tmp, "%d ", 68 sprintf(tmp, "%d ",
69 ((i & 0x1) ? ((byte)&0xf) : ((byte>>4)&0xf))); 69 ((i & 0x1) ? ((byte)&0xf) : ((byte>>4)&0xf)));
70 strcat(buf, tmp); 70 strcat(buf, tmp);
71 } 71 }
@@ -141,12 +141,12 @@ dbg_qh (const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
141} 141}
142 142
143static void __attribute__((__unused__)) 143static void __attribute__((__unused__))
144dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd) 144dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd)
145{ 145{
146 ehci_dbg (ehci, "%s [%d] itd %p, next %08x, urb %p\n", 146 ehci_dbg (ehci, "%s [%d] itd %p, next %08x, urb %p\n",
147 label, itd->frame, itd, le32_to_cpu(itd->hw_next), itd->urb); 147 label, itd->frame, itd, le32_to_cpu(itd->hw_next), itd->urb);
148 ehci_dbg (ehci, 148 ehci_dbg (ehci,
149 " trans: %08x %08x %08x %08x %08x %08x %08x %08x\n", 149 " trans: %08x %08x %08x %08x %08x %08x %08x %08x\n",
150 le32_to_cpu(itd->hw_transaction[0]), 150 le32_to_cpu(itd->hw_transaction[0]),
151 le32_to_cpu(itd->hw_transaction[1]), 151 le32_to_cpu(itd->hw_transaction[1]),
152 le32_to_cpu(itd->hw_transaction[2]), 152 le32_to_cpu(itd->hw_transaction[2]),
@@ -156,7 +156,7 @@ dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd)
156 le32_to_cpu(itd->hw_transaction[6]), 156 le32_to_cpu(itd->hw_transaction[6]),
157 le32_to_cpu(itd->hw_transaction[7])); 157 le32_to_cpu(itd->hw_transaction[7]));
158 ehci_dbg (ehci, 158 ehci_dbg (ehci,
159 " buf: %08x %08x %08x %08x %08x %08x %08x\n", 159 " buf: %08x %08x %08x %08x %08x %08x %08x\n",
160 le32_to_cpu(itd->hw_bufp[0]), 160 le32_to_cpu(itd->hw_bufp[0]),
161 le32_to_cpu(itd->hw_bufp[1]), 161 le32_to_cpu(itd->hw_bufp[1]),
162 le32_to_cpu(itd->hw_bufp[2]), 162 le32_to_cpu(itd->hw_bufp[2]),
@@ -171,12 +171,12 @@ dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd)
171} 171}
172 172
173static void __attribute__((__unused__)) 173static void __attribute__((__unused__))
174dbg_sitd (const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd) 174dbg_sitd (const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd)
175{ 175{
176 ehci_dbg (ehci, "%s [%d] sitd %p, next %08x, urb %p\n", 176 ehci_dbg (ehci, "%s [%d] sitd %p, next %08x, urb %p\n",
177 label, sitd->frame, sitd, le32_to_cpu(sitd->hw_next), sitd->urb); 177 label, sitd->frame, sitd, le32_to_cpu(sitd->hw_next), sitd->urb);
178 ehci_dbg (ehci, 178 ehci_dbg (ehci,
179 " addr %08x sched %04x result %08x buf %08x %08x\n", 179 " addr %08x sched %04x result %08x buf %08x %08x\n",
180 le32_to_cpu(sitd->hw_fullspeed_ep), 180 le32_to_cpu(sitd->hw_fullspeed_ep),
181 le32_to_cpu(sitd->hw_uframe), 181 le32_to_cpu(sitd->hw_uframe),
182 le32_to_cpu(sitd->hw_results), 182 le32_to_cpu(sitd->hw_results),
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 1c54b303e5fc..4e1a8c308893 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (c) 2000-2004 by David Brownell 2 * Copyright (c) 2000-2004 by David Brownell
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the 5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your 6 * Free Software Foundation; either version 2 of the License, or (at your
@@ -70,7 +70,7 @@
70 * 2002-08-06 Handling for bulk and interrupt transfers is mostly shared; 70 * 2002-08-06 Handling for bulk and interrupt transfers is mostly shared;
71 * only scheduling is different, no arbitrary limitations. 71 * only scheduling is different, no arbitrary limitations.
72 * 2002-07-25 Sanity check PCI reads, mostly for better cardbus support, 72 * 2002-07-25 Sanity check PCI reads, mostly for better cardbus support,
73 * clean up HC run state handshaking. 73 * clean up HC run state handshaking.
74 * 2002-05-24 Preliminary FS/LS interrupts, using scheduling shortcuts 74 * 2002-05-24 Preliminary FS/LS interrupts, using scheduling shortcuts
75 * 2002-05-11 Clear TT errors for FS/LS ctrl/bulk. Fill in some other 75 * 2002-05-11 Clear TT errors for FS/LS ctrl/bulk. Fill in some other
76 * missing pieces: enabling 64bit dma, handoff from BIOS/SMM. 76 * missing pieces: enabling 64bit dma, handoff from BIOS/SMM.
@@ -425,7 +425,7 @@ static int ehci_init(struct usb_hcd *hcd)
425 425
426 /* controllers may cache some of the periodic schedule ... */ 426 /* controllers may cache some of the periodic schedule ... */
427 hcc_params = readl(&ehci->caps->hcc_params); 427 hcc_params = readl(&ehci->caps->hcc_params);
428 if (HCC_ISOC_CACHE(hcc_params)) // full frame cache 428 if (HCC_ISOC_CACHE(hcc_params)) // full frame cache
429 ehci->i_thresh = 8; 429 ehci->i_thresh = 8;
430 else // N microframes cached 430 else // N microframes cached
431 ehci->i_thresh = 2 + HCC_ISOC_THRES(hcc_params); 431 ehci->i_thresh = 2 + HCC_ISOC_THRES(hcc_params);
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index d03e3cad5ca8..a5eeb9cd6ab2 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2001-2004 by David Brownell 2 * Copyright (C) 2001-2004 by David Brownell
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the 5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your 6 * Free Software Foundation; either version 2 of the License, or (at your
@@ -103,10 +103,10 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
103 103
104 /* re-init operational registers in case we lost power */ 104 /* re-init operational registers in case we lost power */
105 if (readl (&ehci->regs->intr_enable) == 0) { 105 if (readl (&ehci->regs->intr_enable) == 0) {
106 /* at least some APM implementations will try to deliver 106 /* at least some APM implementations will try to deliver
107 * IRQs right away, so delay them until we're ready. 107 * IRQs right away, so delay them until we're ready.
108 */ 108 */
109 intr_enable = 1; 109 intr_enable = 1;
110 writel (0, &ehci->regs->segment); 110 writel (0, &ehci->regs->segment);
111 writel (ehci->periodic_dma, &ehci->regs->frame_list); 111 writel (ehci->periodic_dma, &ehci->regs->frame_list);
112 writel ((u32)ehci->async->qh_dma, &ehci->regs->async_next); 112 writel ((u32)ehci->async->qh_dma, &ehci->regs->async_next);
@@ -232,7 +232,7 @@ ehci_hub_status_data (struct usb_hcd *hcd, char *buf)
232 buf [1] = 0; 232 buf [1] = 0;
233 retval++; 233 retval++;
234 } 234 }
235 235
236 /* no hub change reports (bit 0) for now (power, ...) */ 236 /* no hub change reports (bit 0) for now (power, ...) */
237 237
238 /* port N changes (bit N)? */ 238 /* port N changes (bit N)? */
@@ -304,7 +304,7 @@ ehci_hub_descriptor (
304 304
305/*-------------------------------------------------------------------------*/ 305/*-------------------------------------------------------------------------*/
306 306
307#define PORT_WAKE_BITS (PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E) 307#define PORT_WAKE_BITS (PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E)
308 308
309static int ehci_hub_control ( 309static int ehci_hub_control (
310 struct usb_hcd *hcd, 310 struct usb_hcd *hcd,
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c
index 766061e0260a..a8ba2e1497a4 100644
--- a/drivers/usb/host/ehci-mem.c
+++ b/drivers/usb/host/ehci-mem.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (c) 2001 by David Brownell 2 * Copyright (c) 2001 by David Brownell
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the 5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your 6 * Free Software Foundation; either version 2 of the License, or (at your
@@ -25,7 +25,7 @@
25 * - data used only by the HCD ... kmalloc is fine 25 * - data used only by the HCD ... kmalloc is fine
26 * - async and periodic schedules, shared by HC and HCD ... these 26 * - async and periodic schedules, shared by HC and HCD ... these
27 * need to use dma_pool or dma_alloc_coherent 27 * need to use dma_pool or dma_alloc_coherent
28 * - driver buffers, read/written by HC ... single shot DMA mapped 28 * - driver buffers, read/written by HC ... single shot DMA mapped
29 * 29 *
30 * There's also PCI "register" data, which is memory mapped. 30 * There's also PCI "register" data, which is memory mapped.
31 * No memory seen by this driver is pageable. 31 * No memory seen by this driver is pageable.
@@ -119,7 +119,7 @@ static inline void qh_put (struct ehci_qh *qh)
119 119
120/*-------------------------------------------------------------------------*/ 120/*-------------------------------------------------------------------------*/
121 121
122/* The queue heads and transfer descriptors are managed from pools tied 122/* The queue heads and transfer descriptors are managed from pools tied
123 * to each of the "per device" structures. 123 * to each of the "per device" structures.
124 * This is the initialisation and cleanup code. 124 * This is the initialisation and cleanup code.
125 */ 125 */
@@ -165,7 +165,7 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags)
165 int i; 165 int i;
166 166
167 /* QTDs for control/bulk/intr transfers */ 167 /* QTDs for control/bulk/intr transfers */
168 ehci->qtd_pool = dma_pool_create ("ehci_qtd", 168 ehci->qtd_pool = dma_pool_create ("ehci_qtd",
169 ehci_to_hcd(ehci)->self.controller, 169 ehci_to_hcd(ehci)->self.controller,
170 sizeof (struct ehci_qtd), 170 sizeof (struct ehci_qtd),
171 32 /* byte alignment (for hw parts) */, 171 32 /* byte alignment (for hw parts) */,
@@ -175,7 +175,7 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags)
175 } 175 }
176 176
177 /* QHs for control/bulk/intr transfers */ 177 /* QHs for control/bulk/intr transfers */
178 ehci->qh_pool = dma_pool_create ("ehci_qh", 178 ehci->qh_pool = dma_pool_create ("ehci_qh",
179 ehci_to_hcd(ehci)->self.controller, 179 ehci_to_hcd(ehci)->self.controller,
180 sizeof (struct ehci_qh), 180 sizeof (struct ehci_qh),
181 32 /* byte alignment (for hw parts) */, 181 32 /* byte alignment (for hw parts) */,
@@ -189,7 +189,7 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags)
189 } 189 }
190 190
191 /* ITD for high speed ISO transfers */ 191 /* ITD for high speed ISO transfers */
192 ehci->itd_pool = dma_pool_create ("ehci_itd", 192 ehci->itd_pool = dma_pool_create ("ehci_itd",
193 ehci_to_hcd(ehci)->self.controller, 193 ehci_to_hcd(ehci)->self.controller,
194 sizeof (struct ehci_itd), 194 sizeof (struct ehci_itd),
195 32 /* byte alignment (for hw parts) */, 195 32 /* byte alignment (for hw parts) */,
@@ -199,7 +199,7 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags)
199 } 199 }
200 200
201 /* SITD for full/low speed split ISO transfers */ 201 /* SITD for full/low speed split ISO transfers */
202 ehci->sitd_pool = dma_pool_create ("ehci_sitd", 202 ehci->sitd_pool = dma_pool_create ("ehci_sitd",
203 ehci_to_hcd(ehci)->self.controller, 203 ehci_to_hcd(ehci)->self.controller,
204 sizeof (struct ehci_sitd), 204 sizeof (struct ehci_sitd),
205 32 /* byte alignment (for hw parts) */, 205 32 /* byte alignment (for hw parts) */,
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index e469221e7ec3..c0da40bbfa35 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2001-2004 by David Brownell 2 * Copyright (C) 2001-2004 by David Brownell
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the 5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your 6 * Free Software Foundation; either version 2 of the License, or (at your
@@ -31,7 +31,7 @@
31 * ISO traffic uses "ISO TD" (itd, and sitd) records, and (along with 31 * ISO traffic uses "ISO TD" (itd, and sitd) records, and (along with
32 * interrupts) needs careful scheduling. Performance improvements can be 32 * interrupts) needs careful scheduling. Performance improvements can be
33 * an ongoing challenge. That's in "ehci-sched.c". 33 * an ongoing challenge. That's in "ehci-sched.c".
34 * 34 *
35 * USB 1.1 devices are handled (a) by "companion" OHCI or UHCI root hubs, 35 * USB 1.1 devices are handled (a) by "companion" OHCI or UHCI root hubs,
36 * or otherwise through transaction translators (TTs) in USB 2.0 hubs using 36 * or otherwise through transaction translators (TTs) in USB 2.0 hubs using
37 * (b) special fields in qh entries or (c) split iso entries. TTs will 37 * (b) special fields in qh entries or (c) split iso entries. TTs will
@@ -199,7 +199,7 @@ static void qtd_copy_status (
199 && ((token & QTD_STS_MMF) != 0 199 && ((token & QTD_STS_MMF) != 0
200 || QTD_CERR(token) == 0) 200 || QTD_CERR(token) == 0)
201 && (!ehci_is_TDI(ehci) 201 && (!ehci_is_TDI(ehci)
202 || urb->dev->tt->hub != 202 || urb->dev->tt->hub !=
203 ehci_to_hcd(ehci)->self.root_hub)) { 203 ehci_to_hcd(ehci)->self.root_hub)) {
204#ifdef DEBUG 204#ifdef DEBUG
205 struct usb_device *tt = urb->dev->tt->hub; 205 struct usb_device *tt = urb->dev->tt->hub;
@@ -364,7 +364,7 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh, struct pt_regs *regs)
364 */ 364 */
365 if (likely (urb->status == -EINPROGRESS)) 365 if (likely (urb->status == -EINPROGRESS))
366 continue; 366 continue;
367 367
368 /* issue status after short control reads */ 368 /* issue status after short control reads */
369 if (unlikely (do_status != 0) 369 if (unlikely (do_status != 0)
370 && QTD_PID (token) == 0 /* OUT */) { 370 && QTD_PID (token) == 0 /* OUT */) {
@@ -388,7 +388,7 @@ halt:
388 wmb (); 388 wmb ();
389 } 389 }
390 } 390 }
391 391
392 /* remove it from the queue */ 392 /* remove it from the queue */
393 spin_lock (&urb->lock); 393 spin_lock (&urb->lock);
394 qtd_copy_status (ehci, urb, qtd->length, token); 394 qtd_copy_status (ehci, urb, qtd->length, token);
@@ -518,7 +518,7 @@ qh_urb_transaction (
518 /* for zero length DATA stages, STATUS is always IN */ 518 /* for zero length DATA stages, STATUS is always IN */
519 if (len == 0) 519 if (len == 0)
520 token |= (1 /* "in" */ << 8); 520 token |= (1 /* "in" */ << 8);
521 } 521 }
522 522
523 /* 523 /*
524 * data transfer stage: buffer setup 524 * data transfer stage: buffer setup
@@ -759,7 +759,7 @@ qh_make (
759 } 759 }
760 break; 760 break;
761 default: 761 default:
762 dbg ("bogus dev %p speed %d", urb->dev, urb->dev->speed); 762 dbg ("bogus dev %p speed %d", urb->dev, urb->dev->speed);
763done: 763done:
764 qh_put (qh); 764 qh_put (qh);
765 return NULL; 765 return NULL;
@@ -972,7 +972,7 @@ static void end_unlink_async (struct ehci_hcd *ehci, struct pt_regs *regs)
972 // qh->hw_next = cpu_to_le32 (qh->qh_dma); 972 // qh->hw_next = cpu_to_le32 (qh->qh_dma);
973 qh->qh_state = QH_STATE_IDLE; 973 qh->qh_state = QH_STATE_IDLE;
974 qh->qh_next.qh = NULL; 974 qh->qh_next.qh = NULL;
975 qh_put (qh); // refcount from reclaim 975 qh_put (qh); // refcount from reclaim
976 976
977 /* other unlink(s) may be pending (in QH_STATE_UNLINK_WAIT) */ 977 /* other unlink(s) may be pending (in QH_STATE_UNLINK_WAIT) */
978 next = qh->reclaim; 978 next = qh->reclaim;
@@ -1031,7 +1031,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
1031 timer_action_done (ehci, TIMER_ASYNC_OFF); 1031 timer_action_done (ehci, TIMER_ASYNC_OFF);
1032 } 1032 }
1033 return; 1033 return;
1034 } 1034 }
1035 1035
1036 qh->qh_state = QH_STATE_UNLINK; 1036 qh->qh_state = QH_STATE_UNLINK;
1037 ehci->reclaim = qh = qh_get (qh); 1037 ehci->reclaim = qh = qh_get (qh);
@@ -1046,7 +1046,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
1046 1046
1047 if (unlikely (ehci_to_hcd(ehci)->state == HC_STATE_HALT)) { 1047 if (unlikely (ehci_to_hcd(ehci)->state == HC_STATE_HALT)) {
1048 /* if (unlikely (qh->reclaim != 0)) 1048 /* if (unlikely (qh->reclaim != 0))
1049 * this will recurse, probably not much 1049 * this will recurse, probably not much
1050 */ 1050 */
1051 end_unlink_async (ehci, NULL); 1051 end_unlink_async (ehci, NULL);
1052 return; 1052 return;
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 4859900bd135..e5e9c653c907 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Copyright (c) 2001-2004 by David Brownell 2 * Copyright (c) 2001-2004 by David Brownell
3 * Copyright (c) 2003 Michal Sojka, for high-speed iso transfers 3 * Copyright (c) 2003 Michal Sojka, for high-speed iso transfers
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the 6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your 7 * Free Software Foundation; either version 2 of the License, or (at your
@@ -613,7 +613,7 @@ static void intr_deschedule (struct ehci_hcd *ehci, struct ehci_qh *qh)
613/*-------------------------------------------------------------------------*/ 613/*-------------------------------------------------------------------------*/
614 614
615static int check_period ( 615static int check_period (
616 struct ehci_hcd *ehci, 616 struct ehci_hcd *ehci,
617 unsigned frame, 617 unsigned frame,
618 unsigned uframe, 618 unsigned uframe,
619 unsigned period, 619 unsigned period,
@@ -629,7 +629,7 @@ static int check_period (
629 629
630 /* 630 /*
631 * 80% periodic == 100 usec/uframe available 631 * 80% periodic == 100 usec/uframe available
632 * convert "usecs we need" to "max already claimed" 632 * convert "usecs we need" to "max already claimed"
633 */ 633 */
634 usecs = 100 - usecs; 634 usecs = 100 - usecs;
635 635
@@ -659,14 +659,14 @@ static int check_period (
659} 659}
660 660
661static int check_intr_schedule ( 661static int check_intr_schedule (
662 struct ehci_hcd *ehci, 662 struct ehci_hcd *ehci,
663 unsigned frame, 663 unsigned frame,
664 unsigned uframe, 664 unsigned uframe,
665 const struct ehci_qh *qh, 665 const struct ehci_qh *qh,
666 __le32 *c_maskp 666 __le32 *c_maskp
667) 667)
668{ 668{
669 int retval = -ENOSPC; 669 int retval = -ENOSPC;
670 u8 mask = 0; 670 u8 mask = 0;
671 671
672 if (qh->c_usecs && uframe >= 6) /* FSTN territory? */ 672 if (qh->c_usecs && uframe >= 6) /* FSTN territory? */
@@ -701,7 +701,7 @@ static int check_intr_schedule (
701 /* Make sure this tt's buffer is also available for CSPLITs. 701 /* Make sure this tt's buffer is also available for CSPLITs.
702 * We pessimize a bit; probably the typical full speed case 702 * We pessimize a bit; probably the typical full speed case
703 * doesn't need the second CSPLIT. 703 * doesn't need the second CSPLIT.
704 * 704 *
705 * NOTE: both SPLIT and CSPLIT could be checked in just 705 * NOTE: both SPLIT and CSPLIT could be checked in just
706 * one smart pass... 706 * one smart pass...
707 */ 707 */
@@ -728,7 +728,7 @@ done:
728 */ 728 */
729static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh) 729static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh)
730{ 730{
731 int status; 731 int status;
732 unsigned uframe; 732 unsigned uframe;
733 __le32 c_mask; 733 __le32 c_mask;
734 unsigned frame; /* 0..(qh->period - 1), or NO_FRAME */ 734 unsigned frame; /* 0..(qh->period - 1), or NO_FRAME */
@@ -784,7 +784,7 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh)
784 ehci_dbg (ehci, "reused qh %p schedule\n", qh); 784 ehci_dbg (ehci, "reused qh %p schedule\n", qh);
785 785
786 /* stuff into the periodic schedule */ 786 /* stuff into the periodic schedule */
787 status = qh_link_periodic (ehci, qh); 787 status = qh_link_periodic (ehci, qh);
788done: 788done:
789 return status; 789 return status;
790} 790}
@@ -1681,7 +1681,7 @@ static int itd_submit (struct ehci_hcd *ehci, struct urb *urb,
1681 status = -ESHUTDOWN; 1681 status = -ESHUTDOWN;
1682 else 1682 else
1683 status = iso_stream_schedule (ehci, urb, stream); 1683 status = iso_stream_schedule (ehci, urb, stream);
1684 if (likely (status == 0)) 1684 if (likely (status == 0))
1685 itd_link_urb (ehci, urb, ehci->periodic_size << 3, stream); 1685 itd_link_urb (ehci, urb, ehci->periodic_size << 3, stream);
1686 spin_unlock_irqrestore (&ehci->lock, flags); 1686 spin_unlock_irqrestore (&ehci->lock, flags);
1687 1687
@@ -1738,7 +1738,7 @@ sitd_sched_init (
1738 if (packet->buf1 != (buf & ~(u64)0x0fff)) 1738 if (packet->buf1 != (buf & ~(u64)0x0fff))
1739 packet->cross = 1; 1739 packet->cross = 1;
1740 1740
1741 /* OUT uses multiple start-splits */ 1741 /* OUT uses multiple start-splits */
1742 if (stream->bEndpointAddress & USB_DIR_IN) 1742 if (stream->bEndpointAddress & USB_DIR_IN)
1743 continue; 1743 continue;
1744 length = (length + 187) / 188; 1744 length = (length + 187) / 188;
@@ -1925,7 +1925,7 @@ sitd_link_urb (
1925/*-------------------------------------------------------------------------*/ 1925/*-------------------------------------------------------------------------*/
1926 1926
1927#define SITD_ERRS (SITD_STS_ERR | SITD_STS_DBE | SITD_STS_BABBLE \ 1927#define SITD_ERRS (SITD_STS_ERR | SITD_STS_DBE | SITD_STS_BABBLE \
1928 | SITD_STS_XACT | SITD_STS_MMF) 1928 | SITD_STS_XACT | SITD_STS_MMF)
1929 1929
1930static unsigned 1930static unsigned
1931sitd_complete ( 1931sitd_complete (
@@ -2043,7 +2043,7 @@ static int sitd_submit (struct ehci_hcd *ehci, struct urb *urb,
2043 status = -ESHUTDOWN; 2043 status = -ESHUTDOWN;
2044 else 2044 else
2045 status = iso_stream_schedule (ehci, urb, stream); 2045 status = iso_stream_schedule (ehci, urb, stream);
2046 if (status == 0) 2046 if (status == 0)
2047 sitd_link_urb (ehci, urb, ehci->periodic_size << 3, stream); 2047 sitd_link_urb (ehci, urb, ehci->periodic_size << 3, stream);
2048 spin_unlock_irqrestore (&ehci->lock, flags); 2048 spin_unlock_irqrestore (&ehci->lock, flags);
2049 2049
@@ -2226,5 +2226,5 @@ restart:
2226 now_uframe++; 2226 now_uframe++;
2227 now_uframe %= mod; 2227 now_uframe %= mod;
2228 } 2228 }
2229 } 2229 }
2230} 2230}
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 1385ce2b3f0a..bbc3082a73d7 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (c) 2001-2002 by David Brownell 2 * Copyright (c) 2001-2002 by David Brownell
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the 5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your 6 * Free Software Foundation; either version 2 of the License, or (at your
@@ -103,7 +103,7 @@ struct ehci_hcd { /* one per controller */
103#endif 103#endif
104}; 104};
105 105
106/* convert between an HCD pointer and the corresponding EHCI_HCD */ 106/* convert between an HCD pointer and the corresponding EHCI_HCD */
107static inline struct ehci_hcd *hcd_to_ehci (struct usb_hcd *hcd) 107static inline struct ehci_hcd *hcd_to_ehci (struct usb_hcd *hcd)
108{ 108{
109 return (struct ehci_hcd *) (hcd->hcd_priv); 109 return (struct ehci_hcd *) (hcd->hcd_priv);
@@ -178,8 +178,8 @@ struct ehci_caps {
178#define HCS_INDICATOR(p) ((p)&(1 << 16)) /* true: has port indicators */ 178#define HCS_INDICATOR(p) ((p)&(1 << 16)) /* true: has port indicators */
179#define HCS_N_CC(p) (((p)>>12)&0xf) /* bits 15:12, #companion HCs */ 179#define HCS_N_CC(p) (((p)>>12)&0xf) /* bits 15:12, #companion HCs */
180#define HCS_N_PCC(p) (((p)>>8)&0xf) /* bits 11:8, ports per CC */ 180#define HCS_N_PCC(p) (((p)>>8)&0xf) /* bits 11:8, ports per CC */
181#define HCS_PORTROUTED(p) ((p)&(1 << 7)) /* true: port routing */ 181#define HCS_PORTROUTED(p) ((p)&(1 << 7)) /* true: port routing */
182#define HCS_PPC(p) ((p)&(1 << 4)) /* true: port power control */ 182#define HCS_PPC(p) ((p)&(1 << 4)) /* true: port power control */
183#define HCS_N_PORTS(p) (((p)>>0)&0xf) /* bits 3:0, ports on HC */ 183#define HCS_N_PORTS(p) (((p)>>0)&0xf) /* bits 3:0, ports on HC */
184 184
185 u32 hcc_params; /* HCCPARAMS - offset 0x8 */ 185 u32 hcc_params; /* HCCPARAMS - offset 0x8 */
@@ -204,7 +204,7 @@ struct ehci_regs {
204#define CMD_LRESET (1<<7) /* partial reset (no ports, etc) */ 204#define CMD_LRESET (1<<7) /* partial reset (no ports, etc) */
205#define CMD_IAAD (1<<6) /* "doorbell" interrupt async advance */ 205#define CMD_IAAD (1<<6) /* "doorbell" interrupt async advance */
206#define CMD_ASE (1<<5) /* async schedule enable */ 206#define CMD_ASE (1<<5) /* async schedule enable */
207#define CMD_PSE (1<<4) /* periodic schedule enable */ 207#define CMD_PSE (1<<4) /* periodic schedule enable */
208/* 3:2 is periodic frame list size */ 208/* 3:2 is periodic frame list size */
209#define CMD_RESET (1<<1) /* reset HC not bus */ 209#define CMD_RESET (1<<1) /* reset HC not bus */
210#define CMD_RUN (1<<0) /* start/stop HC */ 210#define CMD_RUN (1<<0) /* start/stop HC */
@@ -230,9 +230,9 @@ struct ehci_regs {
230 /* FRINDEX: offset 0x0C */ 230 /* FRINDEX: offset 0x0C */
231 u32 frame_index; /* current microframe number */ 231 u32 frame_index; /* current microframe number */
232 /* CTRLDSSEGMENT: offset 0x10 */ 232 /* CTRLDSSEGMENT: offset 0x10 */
233 u32 segment; /* address bits 63:32 if needed */ 233 u32 segment; /* address bits 63:32 if needed */
234 /* PERIODICLISTBASE: offset 0x14 */ 234 /* PERIODICLISTBASE: offset 0x14 */
235 u32 frame_list; /* points to periodic list */ 235 u32 frame_list; /* points to periodic list */
236 /* ASYNCLISTADDR: offset 0x18 */ 236 /* ASYNCLISTADDR: offset 0x18 */
237 u32 async_next; /* address of next async queue head */ 237 u32 async_next; /* address of next async queue head */
238 238
@@ -301,7 +301,7 @@ struct ehci_dbg_port {
301 301
302/* 302/*
303 * EHCI Specification 0.95 Section 3.5 303 * EHCI Specification 0.95 Section 3.5
304 * QTD: describe data transfer components (buffer, direction, ...) 304 * QTD: describe data transfer components (buffer, direction, ...)
305 * See Fig 3-6 "Queue Element Transfer Descriptor Block Diagram". 305 * See Fig 3-6 "Queue Element Transfer Descriptor Block Diagram".
306 * 306 *
307 * These are associated only with "QH" (Queue Head) structures, 307 * These are associated only with "QH" (Queue Head) structures,
@@ -311,7 +311,7 @@ struct ehci_qtd {
311 /* first part defined by EHCI spec */ 311 /* first part defined by EHCI spec */
312 __le32 hw_next; /* see EHCI 3.5.1 */ 312 __le32 hw_next; /* see EHCI 3.5.1 */
313 __le32 hw_alt_next; /* see EHCI 3.5.2 */ 313 __le32 hw_alt_next; /* see EHCI 3.5.2 */
314 __le32 hw_token; /* see EHCI 3.5.3 */ 314 __le32 hw_token; /* see EHCI 3.5.3 */
315#define QTD_TOGGLE (1 << 31) /* data toggle */ 315#define QTD_TOGGLE (1 << 31) /* data toggle */
316#define QTD_LENGTH(tok) (((tok)>>16) & 0x7fff) 316#define QTD_LENGTH(tok) (((tok)>>16) & 0x7fff)
317#define QTD_IOC (1 << 15) /* interrupt on complete */ 317#define QTD_IOC (1 << 15) /* interrupt on complete */
@@ -348,8 +348,8 @@ struct ehci_qtd {
348/* values for that type tag */ 348/* values for that type tag */
349#define Q_TYPE_ITD __constant_cpu_to_le32 (0 << 1) 349#define Q_TYPE_ITD __constant_cpu_to_le32 (0 << 1)
350#define Q_TYPE_QH __constant_cpu_to_le32 (1 << 1) 350#define Q_TYPE_QH __constant_cpu_to_le32 (1 << 1)
351#define Q_TYPE_SITD __constant_cpu_to_le32 (2 << 1) 351#define Q_TYPE_SITD __constant_cpu_to_le32 (2 << 1)
352#define Q_TYPE_FSTN __constant_cpu_to_le32 (3 << 1) 352#define Q_TYPE_FSTN __constant_cpu_to_le32 (3 << 1)
353 353
354/* next async queue entry, or pointer to interrupt/periodic QH */ 354/* next async queue entry, or pointer to interrupt/periodic QH */
355#define QH_NEXT(dma) (cpu_to_le32(((u32)dma)&~0x01f)|Q_TYPE_QH) 355#define QH_NEXT(dma) (cpu_to_le32(((u32)dma)&~0x01f)|Q_TYPE_QH)
@@ -366,7 +366,7 @@ struct ehci_qtd {
366 * For entries in the async schedule, the type tag always says "qh". 366 * For entries in the async schedule, the type tag always says "qh".
367 */ 367 */
368union ehci_shadow { 368union ehci_shadow {
369 struct ehci_qh *qh; /* Q_TYPE_QH */ 369 struct ehci_qh *qh; /* Q_TYPE_QH */
370 struct ehci_itd *itd; /* Q_TYPE_ITD */ 370 struct ehci_itd *itd; /* Q_TYPE_ITD */
371 struct ehci_sitd *sitd; /* Q_TYPE_SITD */ 371 struct ehci_sitd *sitd; /* Q_TYPE_SITD */
372 struct ehci_fstn *fstn; /* Q_TYPE_FSTN */ 372 struct ehci_fstn *fstn; /* Q_TYPE_FSTN */
@@ -396,7 +396,7 @@ struct ehci_qh {
396#define QH_HUBPORT 0x3f800000 396#define QH_HUBPORT 0x3f800000
397#define QH_MULT 0xc0000000 397#define QH_MULT 0xc0000000
398 __le32 hw_current; /* qtd list - see EHCI 3.6.4 */ 398 __le32 hw_current; /* qtd list - see EHCI 3.6.4 */
399 399
400 /* qtd overlay (hardware parts of a struct ehci_qtd) */ 400 /* qtd overlay (hardware parts of a struct ehci_qtd) */
401 __le32 hw_qtd_next; 401 __le32 hw_qtd_next;
402 __le32 hw_alt_next; 402 __le32 hw_alt_next;
@@ -471,7 +471,7 @@ struct ehci_iso_stream {
471 struct list_head td_list; /* queued itds/sitds */ 471 struct list_head td_list; /* queued itds/sitds */
472 struct list_head free_list; /* list of unused itds/sitds */ 472 struct list_head free_list; /* list of unused itds/sitds */
473 struct usb_device *udev; 473 struct usb_device *udev;
474 struct usb_host_endpoint *ep; 474 struct usb_host_endpoint *ep;
475 475
476 /* output of (re)scheduling */ 476 /* output of (re)scheduling */
477 unsigned long start; /* jiffies */ 477 unsigned long start; /* jiffies */
@@ -491,8 +491,8 @@ struct ehci_iso_stream {
491 unsigned bandwidth; 491 unsigned bandwidth;
492 492
493 /* This is used to initialize iTD's hw_bufp fields */ 493 /* This is used to initialize iTD's hw_bufp fields */
494 __le32 buf0; 494 __le32 buf0;
495 __le32 buf1; 495 __le32 buf1;
496 __le32 buf2; 496 __le32 buf2;
497 497
498 /* this is used to initialize sITD's tt info */ 498 /* this is used to initialize sITD's tt info */
@@ -520,7 +520,7 @@ struct ehci_itd {
520 520
521#define ITD_ACTIVE __constant_cpu_to_le32(EHCI_ISOC_ACTIVE) 521#define ITD_ACTIVE __constant_cpu_to_le32(EHCI_ISOC_ACTIVE)
522 522
523 __le32 hw_bufp [7]; /* see EHCI 3.3.3 */ 523 __le32 hw_bufp [7]; /* see EHCI 3.3.3 */
524 __le32 hw_bufp_hi [7]; /* Appendix B */ 524 __le32 hw_bufp_hi [7]; /* Appendix B */
525 525
526 /* the rest is HCD-private */ 526 /* the rest is HCD-private */
@@ -541,7 +541,7 @@ struct ehci_itd {
541/*-------------------------------------------------------------------------*/ 541/*-------------------------------------------------------------------------*/
542 542
543/* 543/*
544 * EHCI Specification 0.95 Section 3.4 544 * EHCI Specification 0.95 Section 3.4
545 * siTD, aka split-transaction isochronous Transfer Descriptor 545 * siTD, aka split-transaction isochronous Transfer Descriptor
546 * ... describe full speed iso xfers through TT in hubs 546 * ... describe full speed iso xfers through TT in hubs
547 * see Figure 3-5 "Split-transaction Isochronous Transaction Descriptor (siTD) 547 * see Figure 3-5 "Split-transaction Isochronous Transaction Descriptor (siTD)