1 /* override default macros from ../port/usb.h */
6 #define dprint if(ehcidebug)print
7 #define ddprint if(ehcidebug>1)print
8 #define deprint if(ehcidebug || ep->debug)print
9 #define ddeprint if(ehcidebug>1 || ep->debug>1)print
17 Lfstn = 3<<1, /* we don't use these */
20 Cstop = 0x00000, /* stop running */
21 Crun = 0x00001, /* start operation */
22 Chcreset = 0x00002, /* host controller reset */
23 Cflsmask = 0x0000C, /* frame list size bits */
24 Cfls1024 = 0x00000, /* frame list size 1024 */
25 Cfls512 = 0x00004, /* frame list size 512 frames */
26 Cfls256 = 0x00008, /* frame list size 256 frames */
27 Cpse = 0x00010, /* periodic sched. enable */
28 Case = 0x00020, /* async sched. enable */
29 Ciasync = 0x00040, /* interrupt on async advance doorbell */
30 Citc1 = 0x10000, /* interrupt threshold ctl. 1 µframe */
31 Citc4 = 0x40000, /* same. 2 µframes */
33 Citc8 = 0x80000, /* same. 8 µframes (can go up to 64) */
36 Sasyncss = 0x08000, /* aync schedule status */
37 Speriodss = 0x04000, /* periodic schedule status */
38 Srecl = 0x02000, /* reclamnation (empty async sched.) */
39 Shalted = 0x01000, /* h.c. is halted */
40 Sasync = 0x00020, /* interrupt on async advance */
41 Sherr = 0x00010, /* host system error */
42 Sfrroll = 0x00008, /* frame list roll over */
43 Sportchg = 0x00004, /* port change detect */
44 Serrintr = 0x00002, /* error interrupt */
45 Sintr = 0x00001, /* interrupt */
46 Sintrs = 0x0003F, /* interrupts status */
49 Pspresent = 0x00000001, /* device present */
50 Psstatuschg = 0x00000002, /* Pspresent changed */
51 Psenable = 0x00000004, /* device enabled */
52 Pschange = 0x00000008, /* Psenable changed */
53 Psresume = 0x00000040, /* resume detected */
54 Pssuspend = 0x00000080, /* port suspended */
55 Psreset = 0x00000100, /* port reset */
56 Pspower = 0x00001000, /* port power on */
59 Iusb = 0x01, /* intr. on usb */
60 Ierr = 0x02, /* intr. on usb error */
61 Iportchg = 0x04, /* intr. on port change */
62 Ifrroll = 0x08, /* intr. on frlist roll over */
63 Ihcerr = 0x10, /* intr. on host error */
64 Iasync = 0x20, /* intr. on async advance enable */
65 Iall = 0x3F, /* all interrupts */
69 /* hack to disable port handoff */
75 typedef struct Ctlr Ctlr;
77 typedef struct Eopio Eopio;
78 typedef struct Isoio Isoio;
79 typedef struct Poll Poll;
81 typedef struct Qtree Qtree;
83 #pragma incomplete Ctlr
92 /*150*/ ulong reserved1;
97 /*15c*/ ulong _ttctrl;
98 /*160*/ ulong _burstsize;
99 /*164*/ ulong _txfilltuning;
100 /*168*/ ulong _txttfilltuning;
101 /*16c*/ ulong _ic_usb;
102 /*170*/ ulong _ulpi_viewport;
104 /*174*/ ulong reserved2;
106 /*178*/ ulong _endptnak;
107 /*17c*/ ulong _endptnaken;
109 /*180*/ ulong config;
110 /*184*/ ulong portsc[1];
123 Rendez; /* for waiting to async advance doorbell */
124 Lock; /* for ilock. qh lists and basic ctlr I/O */
125 QLock portlck; /* for port resets/enable... (and doorbell) */
126 int active; /* in use or not */
127 void* capio; /* base address for debug info */
128 Eopio* opio; /* Operational i/o regs */
130 void* (*tdalloc)(ulong,int,ulong);
131 void* (*dmaalloc)(ulong);
132 void (*dmafree)(void*);
134 int nframes; /* 1024, 512, or 256 frames in the list */
135 ulong* frames; /* periodic frame list (hw) */
136 Qh* qhs; /* async Qh circular list for bulk/ctl */
137 Qtree* tree; /* tree of Qhs for the periodic list */
138 int ntree; /* number of dummy qhs in tree */
139 Qh* intrqhs; /* list of (not dummy) qhs in tree */
140 Isoio* iso; /* list of active Iso I/O */
143 int nintr; /* number of interrupts attended */
144 int ntdintr; /* number of intrs. with something to do */
145 int nqhintr; /* number of async td intrs. */
146 int nisointr; /* number of periodic td intrs. */
155 extern int ehcidebug;
157 void ehcilinkage(Hci *hp);
158 void ehcimeminit(Ctlr *ctlr);
159 void ehcirun(Ctlr *ctlr, int on);