aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci.h
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2013-10-11 11:29:03 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-11 19:40:27 -0400
commitffa0248e643175cea3887c7058916af53104d8e5 (patch)
tree3b6604905aaffc4ab60037d265c4f06f1d144f8a /drivers/usb/host/ehci.h
parent91a99b5e78849db90dc2f5e8dfa034af43bdb760 (diff)
USB: EHCI: create a "periodic schedule info" struct
This patch begins the process of unifying the scheduling parameters that ehci-hcd uses for interrupt and isochronous transfers. It creates an ehci_per_sched structure, which will be stored in both ehci_qh and ehci_iso_stream structures, and will contain the common scheduling information needed for both. Initially we merely create the new structure and move some existing fields into it. Later patches will add more fields and utilize these structures in improved scheduling algorithms. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci.h')
-rw-r--r--drivers/usb/host/ehci.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index b93eb59bb529..e2b64c40d94f 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -54,6 +54,19 @@ struct ehci_stats {
54 unsigned long unlink; 54 unsigned long unlink;
55}; 55};
56 56
57/*
58 * Scheduling and budgeting information for periodic transfers, for both
59 * high-speed devices and full/low-speed devices lying behind a TT.
60 */
61struct ehci_per_sched {
62 struct usb_device *udev; /* access to the TT */
63 struct usb_host_endpoint *ep;
64 u16 tt_usecs; /* time on the FS/LS bus */
65 u16 period; /* actual period in frames */
66 u16 phase; /* actual phase, frame part */
67 u8 phase_uf; /* uframe part of the phase */
68 u8 usecs, c_usecs; /* times on the HS bus */
69};
57#define NO_FRAME 29999 /* frame not assigned yet */ 70#define NO_FRAME 29999 /* frame not assigned yet */
58 71
59/* ehci_hcd->lock guards shared data against other CPUs: 72/* ehci_hcd->lock guards shared data against other CPUs:
@@ -387,6 +400,7 @@ struct ehci_qh {
387 struct list_head intr_node; /* list of intr QHs */ 400 struct list_head intr_node; /* list of intr QHs */
388 struct ehci_qtd *dummy; 401 struct ehci_qtd *dummy;
389 struct list_head unlink_node; 402 struct list_head unlink_node;
403 struct ehci_per_sched ps; /* scheduling info */
390 404
391 unsigned unlink_cycle; 405 unsigned unlink_cycle;
392 406
@@ -400,15 +414,8 @@ struct ehci_qh {
400 u8 xacterrs; /* XactErr retry counter */ 414 u8 xacterrs; /* XactErr retry counter */
401#define QH_XACTERR_MAX 32 /* XactErr retry limit */ 415#define QH_XACTERR_MAX 32 /* XactErr retry limit */
402 416
403 /* periodic schedule info */
404 u8 usecs; /* intr bandwidth */
405 u8 gap_uf; /* uframes split/csplit gap */ 417 u8 gap_uf; /* uframes split/csplit gap */
406 u8 c_usecs; /* ... split completion bw */
407 u16 tt_usecs; /* tt downstream bandwidth */
408 unsigned short period; /* polling interval */
409 unsigned short start; /* where polling starts */
410 418
411 struct usb_device *dev; /* access to TT */
412 unsigned is_out:1; /* bulk or intr OUT */ 419 unsigned is_out:1; /* bulk or intr OUT */
413 unsigned clearing_tt:1; /* Clear-TT-Buf in progress */ 420 unsigned clearing_tt:1; /* Clear-TT-Buf in progress */
414 unsigned dequeue_during_giveback:1; 421 unsigned dequeue_during_giveback:1;
@@ -451,20 +458,16 @@ struct ehci_iso_stream {
451 u8 highspeed; 458 u8 highspeed;
452 struct list_head td_list; /* queued itds/sitds */ 459 struct list_head td_list; /* queued itds/sitds */
453 struct list_head free_list; /* list of unused itds/sitds */ 460 struct list_head free_list; /* list of unused itds/sitds */
454 struct usb_device *udev;
455 struct usb_host_endpoint *ep;
456 461
457 /* output of (re)scheduling */ 462 /* output of (re)scheduling */
463 struct ehci_per_sched ps; /* scheduling info */
458 unsigned next_uframe; 464 unsigned next_uframe;
459 __hc32 splits; 465 __hc32 splits;
460 466
461 /* the rest is derived from the endpoint descriptor, 467 /* the rest is derived from the endpoint descriptor,
462 * trusting urb->interval == f(epdesc->bInterval) and
463 * including the extra info for hw_bufp[0..2] 468 * including the extra info for hw_bufp[0..2]
464 */ 469 */
465 u8 usecs, c_usecs; 470 u16 uperiod; /* period in uframes */
466 u16 interval;
467 u16 tt_usecs;
468 u16 maxp; 471 u16 maxp;
469 u16 raw_mask; 472 u16 raw_mask;
470 unsigned bandwidth; 473 unsigned bandwidth;