Start of big changes in layout of USB code. Fireball and I are agreeing on these...
[reactos.git] / reactos / drivers / usb / cromwell / usbohci / ohci-dbg.c
1 /*
2 * OHCI HCD (Host Controller Driver) for USB.
3 *
4 * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
5 * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net>
6 *
7 * This file is licenced under the GPL.
8 */
9
10 /*-------------------------------------------------------------------------*/
11
12 #ifdef DEBUG
13
14 #define edstring(ed_type) ({ char *temp; \
15 switch (ed_type) { \
16 case PIPE_CONTROL: temp = "ctrl"; break; \
17 case PIPE_BULK: temp = "bulk"; break; \
18 case PIPE_INTERRUPT: temp = "intr"; break; \
19 default: temp = "isoc"; break; \
20 }; temp;})
21 #define pipestring(pipe) edstring(usb_pipetype(pipe))
22
23 /* debug| print the main components of an URB
24 * small: 0) header + data packets 1) just header
25 */
26 static void __attribute__((unused))
27 urb_print (struct urb * urb, char * str, int small)
28 {
29 unsigned int pipe= urb->pipe;
30
31 if (!urb->dev || !urb->dev->bus) {
32 dbg("%s URB: no dev", str);
33 return;
34 }
35
36 #ifndef OHCI_VERBOSE_DEBUG
37 if (urb->status != 0)
38 #endif
39 dbg("%s %p dev=%d ep=%d%s-%s flags=%x len=%d/%d stat=%d",
40 str,
41 urb,
42 usb_pipedevice (pipe),
43 usb_pipeendpoint (pipe),
44 usb_pipeout (pipe)? "out" : "in",
45 pipestring (pipe),
46 urb->transfer_flags,
47 urb->actual_length,
48 urb->transfer_buffer_length,
49 urb->status);
50
51 #ifdef OHCI_VERBOSE_DEBUG
52 if (!small) {
53 int i, len;
54
55 if (usb_pipecontrol (pipe)) {
56 printk (KERN_DEBUG __FILE__ ": setup(8):");
57 for (i = 0; i < 8 ; i++)
58 printk (" %02x", ((__u8 *) urb->setup_packet) [i]);
59 printk ("\n");
60 }
61 if (urb->transfer_buffer_length > 0 && urb->transfer_buffer) {
62 printk (KERN_DEBUG __FILE__ ": data(%d/%d):",
63 urb->actual_length,
64 urb->transfer_buffer_length);
65 len = usb_pipeout (pipe)?
66 urb->transfer_buffer_length: urb->actual_length;
67 for (i = 0; i < 16 && i < len; i++)
68 printk (" %02x", ((__u8 *) urb->transfer_buffer) [i]);
69 printk ("%s stat:%d\n", i < len? "...": "", urb->status);
70 }
71 }
72 #endif
73 }
74
75 #define ohci_dbg_sw(ohci, next, size, format, arg...) \
76 do { \
77 if (next) { \
78 unsigned s_len; \
79 s_len = snprintf (*next, *size, format, ## arg ); \
80 *size -= s_len; *next += s_len; \
81 } else \
82 ohci_dbg(ohci,format, ## arg ); \
83 } while (0);
84
85
86 static void ohci_dump_intr_mask (
87 struct ohci_hcd *ohci,
88 char *label,
89 u32 mask,
90 char **next,
91 unsigned *size)
92 {
93 ohci_dbg_sw (ohci, next, size, "%s 0x%08x%s%s%s%s%s%s%s%s%s\n",
94 label,
95 mask,
96 (mask & OHCI_INTR_MIE) ? " MIE" : "",
97 (mask & OHCI_INTR_OC) ? " OC" : "",
98 (mask & OHCI_INTR_RHSC) ? " RHSC" : "",
99 (mask & OHCI_INTR_FNO) ? " FNO" : "",
100 (mask & OHCI_INTR_UE) ? " UE" : "",
101 (mask & OHCI_INTR_RD) ? " RD" : "",
102 (mask & OHCI_INTR_SF) ? " SF" : "",
103 (mask & OHCI_INTR_WDH) ? " WDH" : "",
104 (mask & OHCI_INTR_SO) ? " SO" : ""
105 );
106 }
107
108 static void maybe_print_eds (
109 struct ohci_hcd *ohci,
110 char *label,
111 u32 value,
112 char **next,
113 unsigned *size)
114 {
115 if (value)
116 ohci_dbg_sw (ohci, next, size, "%s %08x\n", label, value);
117 }
118
119 static char *hcfs2string (int state)
120 {
121 switch (state) {
122 case OHCI_USB_RESET: return "reset";
123 case OHCI_USB_RESUME: return "resume";
124 case OHCI_USB_OPER: return "operational";
125 case OHCI_USB_SUSPEND: return "suspend";
126 }
127 return "?";
128 }
129
130 // dump control and status registers
131 static void
132 ohci_dump_status (struct ohci_hcd *controller, char **next, unsigned *size)
133 {
134 struct ohci_regs *regs = controller->regs;
135 u32 temp;
136
137 temp = readl (&regs->revision) & 0xff;
138 ohci_dbg_sw (controller, next, size,
139 "OHCI %d.%d, %s legacy support registers\n",
140 0x03 & (temp >> 4), (temp & 0x0f),
141 (temp & 0x10) ? "with" : "NO");
142
143 temp = readl (&regs->control);
144 ohci_dbg_sw (controller, next, size,
145 "control 0x%03x%s%s%s HCFS=%s%s%s%s%s CBSR=%d\n",
146 temp,
147 (temp & OHCI_CTRL_RWE) ? " RWE" : "",
148 (temp & OHCI_CTRL_RWC) ? " RWC" : "",
149 (temp & OHCI_CTRL_IR) ? " IR" : "",
150 hcfs2string (temp & OHCI_CTRL_HCFS),
151 (temp & OHCI_CTRL_BLE) ? " BLE" : "",
152 (temp & OHCI_CTRL_CLE) ? " CLE" : "",
153 (temp & OHCI_CTRL_IE) ? " IE" : "",
154 (temp & OHCI_CTRL_PLE) ? " PLE" : "",
155 temp & OHCI_CTRL_CBSR
156 );
157
158 temp = readl (&regs->cmdstatus);
159 ohci_dbg_sw (controller, next, size,
160 "cmdstatus 0x%05x SOC=%d%s%s%s%s\n", temp,
161 (temp & OHCI_SOC) >> 16,
162 (temp & OHCI_OCR) ? " OCR" : "",
163 (temp & OHCI_BLF) ? " BLF" : "",
164 (temp & OHCI_CLF) ? " CLF" : "",
165 (temp & OHCI_HCR) ? " HCR" : ""
166 );
167
168 ohci_dump_intr_mask (controller, "intrstatus",
169 readl (&regs->intrstatus), next, size);
170 ohci_dump_intr_mask (controller, "intrenable",
171 readl (&regs->intrenable), next, size);
172 // intrdisable always same as intrenable
173
174 maybe_print_eds (controller, "ed_periodcurrent",
175 readl (&regs->ed_periodcurrent), next, size);
176
177 maybe_print_eds (controller, "ed_controlhead",
178 readl (&regs->ed_controlhead), next, size);
179 maybe_print_eds (controller, "ed_controlcurrent",
180 readl (&regs->ed_controlcurrent), next, size);
181
182 maybe_print_eds (controller, "ed_bulkhead",
183 readl (&regs->ed_bulkhead), next, size);
184 maybe_print_eds (controller, "ed_bulkcurrent",
185 readl (&regs->ed_bulkcurrent), next, size);
186
187 maybe_print_eds (controller, "donehead",
188 readl (&regs->donehead), next, size);
189 }
190
191 #define dbg_port_sw(hc,num,value,next,size) \
192 ohci_dbg_sw (hc, next, size, \
193 "roothub.portstatus [%d] " \
194 "0x%08x%s%s%s%s%s%s%s%s%s%s%s%s\n", \
195 num, temp, \
196 (temp & RH_PS_PRSC) ? " PRSC" : "", \
197 (temp & RH_PS_OCIC) ? " OCIC" : "", \
198 (temp & RH_PS_PSSC) ? " PSSC" : "", \
199 (temp & RH_PS_PESC) ? " PESC" : "", \
200 (temp & RH_PS_CSC) ? " CSC" : "", \
201 \
202 (temp & RH_PS_LSDA) ? " LSDA" : "", \
203 (temp & RH_PS_PPS) ? " PPS" : "", \
204 (temp & RH_PS_PRS) ? " PRS" : "", \
205 (temp & RH_PS_POCI) ? " POCI" : "", \
206 (temp & RH_PS_PSS) ? " PSS" : "", \
207 \
208 (temp & RH_PS_PES) ? " PES" : "", \
209 (temp & RH_PS_CCS) ? " CCS" : "" \
210 );
211
212
213 static void
214 ohci_dump_roothub (
215 struct ohci_hcd *controller,
216 int verbose,
217 char **next,
218 unsigned *size)
219 {
220 u32 temp, ndp, i;
221
222 temp = roothub_a (controller);
223 if (temp == ~(u32)0)
224 return;
225 ndp = (temp & RH_A_NDP);
226
227 if (verbose) {
228 ohci_dbg_sw (controller, next, size,
229 "roothub.a %08x POTPGT=%d%s%s%s%s%s NDP=%d\n", temp,
230 ((temp & RH_A_POTPGT) >> 24) & 0xff,
231 (temp & RH_A_NOCP) ? " NOCP" : "",
232 (temp & RH_A_OCPM) ? " OCPM" : "",
233 (temp & RH_A_DT) ? " DT" : "",
234 (temp & RH_A_NPS) ? " NPS" : "",
235 (temp & RH_A_PSM) ? " PSM" : "",
236 ndp
237 );
238 temp = roothub_b (controller);
239 ohci_dbg_sw (controller, next, size,
240 "roothub.b %08x PPCM=%04x DR=%04x\n",
241 temp,
242 (temp & RH_B_PPCM) >> 16,
243 (temp & RH_B_DR)
244 );
245 temp = roothub_status (controller);
246 ohci_dbg_sw (controller, next, size,
247 "roothub.status %08x%s%s%s%s%s%s\n",
248 temp,
249 (temp & RH_HS_CRWE) ? " CRWE" : "",
250 (temp & RH_HS_OCIC) ? " OCIC" : "",
251 (temp & RH_HS_LPSC) ? " LPSC" : "",
252 (temp & RH_HS_DRWE) ? " DRWE" : "",
253 (temp & RH_HS_OCI) ? " OCI" : "",
254 (temp & RH_HS_LPS) ? " LPS" : ""
255 );
256 }
257
258 for (i = 0; i < ndp; i++) {
259 temp = roothub_portstatus (controller, i);
260 dbg_port_sw (controller, i, temp, next, size);
261 }
262 }
263
264 static void ohci_dump (struct ohci_hcd *controller, int verbose)
265 {
266 ohci_dbg (controller, "OHCI controller state\n");
267
268 // dumps some of the state we know about
269 ohci_dump_status (controller, NULL, 0);
270 if (controller->hcca)
271 ohci_dbg (controller,
272 "hcca frame #%04x\n", controller->hcca->frame_no);
273 ohci_dump_roothub (controller, 1, NULL, 0);
274 }
275
276 static const char data0 [] = "DATA0";
277 static const char data1 [] = "DATA1";
278
279 static void ohci_dump_td (struct ohci_hcd *ohci, char *label, struct td *td)
280 {
281 u32 tmp = le32_to_cpup (&td->hwINFO);
282
283 ohci_dbg (ohci, "%s td %p%s; urb %p index %d; hw next td %08x",
284 label, td,
285 (tmp & TD_DONE) ? " (DONE)" : "",
286 td->urb, td->index,
287 le32_to_cpup (&td->hwNextTD));
288 if ((tmp & TD_ISO) == 0) {
289 const char *toggle, *pid;
290 u32 cbp, be;
291
292 switch (tmp & TD_T) {
293 case TD_T_DATA0: toggle = data0; break;
294 case TD_T_DATA1: toggle = data1; break;
295 case TD_T_TOGGLE: toggle = "(CARRY)"; break;
296 default: toggle = "(?)"; break;
297 }
298 switch (tmp & TD_DP) {
299 case TD_DP_SETUP: pid = "SETUP"; break;
300 case TD_DP_IN: pid = "IN"; break;
301 case TD_DP_OUT: pid = "OUT"; break;
302 default: pid = "(bad pid)"; break;
303 }
304 ohci_dbg (ohci, " info %08x CC=%x %s DI=%d %s %s", tmp,
305 TD_CC_GET(tmp), /* EC, */ toggle,
306 (tmp & TD_DI) >> 21, pid,
307 (tmp & TD_R) ? "R" : "");
308 cbp = le32_to_cpup (&td->hwCBP);
309 be = le32_to_cpup (&td->hwBE);
310 ohci_dbg (ohci, " cbp %08x be %08x (len %d)", cbp, be,
311 cbp ? (be + 1 - cbp) : 0);
312 } else {
313 unsigned i;
314 ohci_dbg (ohci, " info %08x CC=%x FC=%d DI=%d SF=%04x", tmp,
315 TD_CC_GET(tmp),
316 (tmp >> 24) & 0x07,
317 (tmp & TD_DI) >> 21,
318 tmp & 0x0000ffff);
319 ohci_dbg (ohci, " bp0 %08x be %08x",
320 le32_to_cpup (&td->hwCBP) & ~0x0fff,
321 le32_to_cpup (&td->hwBE));
322 for (i = 0; i < MAXPSW; i++) {
323 u16 psw = le16_to_cpup (&td->hwPSW [i]);
324 int cc = (psw >> 12) & 0x0f;
325 ohci_dbg (ohci, " psw [%d] = %2x, CC=%x %s=%d", i,
326 psw, cc,
327 (cc >= 0x0e) ? "OFFSET" : "SIZE",
328 psw & 0x0fff);
329 }
330 }
331 }
332
333 /* caller MUST own hcd spinlock if verbose is set! */
334 static void __attribute__((unused))
335 ohci_dump_ed (struct ohci_hcd *ohci, char *label, struct ed *ed, int verbose)
336 {
337 u32 tmp = ed->hwINFO;
338 char *type = "";
339
340 ohci_dbg (ohci, "%s, ed %p state 0x%x type %s; next ed %08x",
341 label,
342 ed, ed->state, edstring (ed->type),
343 le32_to_cpup (&ed->hwNextED));
344 switch (tmp & (ED_IN|ED_OUT)) {
345 case ED_OUT: type = "-OUT"; break;
346 case ED_IN: type = "-IN"; break;
347 /* else from TDs ... control */
348 }
349 ohci_dbg (ohci,
350 " info %08x MAX=%d%s%s%s%s EP=%d%s DEV=%d", le32_to_cpu (tmp),
351 0x03ff & (le32_to_cpu (tmp) >> 16),
352 (tmp & ED_DEQUEUE) ? " DQ" : "",
353 (tmp & ED_ISO) ? " ISO" : "",
354 (tmp & ED_SKIP) ? " SKIP" : "",
355 (tmp & ED_LOWSPEED) ? " LOW" : "",
356 0x000f & (le32_to_cpu (tmp) >> 7),
357 type,
358 0x007f & le32_to_cpu (tmp));
359 ohci_dbg (ohci, " tds: head %08x %s%s tail %08x%s",
360 tmp = le32_to_cpup (&ed->hwHeadP),
361 (ed->hwHeadP & ED_C) ? data1 : data0,
362 (ed->hwHeadP & ED_H) ? " HALT" : "",
363 le32_to_cpup (&ed->hwTailP),
364 verbose ? "" : " (not listing)");
365 if (verbose) {
366 struct list_head *tmp;
367
368 /* use ed->td_list because HC concurrently modifies
369 * hwNextTD as it accumulates ed_donelist.
370 */
371 list_for_each (tmp, &ed->td_list) {
372 struct td *td;
373 td = list_entry (tmp, struct td, td_list);
374 ohci_dump_td (ohci, " ->", td);
375 }
376 }
377 }
378
379 #else
380 static inline void ohci_dump (struct ohci_hcd *controller, int verbose) {}
381
382 #undef OHCI_VERBOSE_DEBUG
383
384 #endif /* DEBUG */
385
386 /*-------------------------------------------------------------------------*/
387
388 #ifdef STUB_DEBUG_FILES
389
390 static inline void create_debug_files (struct ohci_hcd *bus) { }
391 static inline void remove_debug_files (struct ohci_hcd *bus) { }
392
393 #else
394
395 static inline struct ohci_hcd *dev_to_ohci (struct device *dev)
396 {
397 struct usb_hcd *hcd = dev_get_drvdata (dev);
398
399 return hcd_to_ohci (hcd);
400 }
401
402 static ssize_t
403 show_list (struct ohci_hcd *ohci, char *buf, size_t count, struct ed *ed)
404 {
405 unsigned temp, size = count;
406
407 if (!ed)
408 return 0;
409
410 /* print first --> last */
411 while (ed->ed_prev)
412 ed = ed->ed_prev;
413
414 /* dump a snapshot of the bulk or control schedule */
415 while (ed) {
416 u32 info = ed->hwINFO;
417 u32 scratch = cpu_to_le32p (&ed->hwINFO);
418 struct list_head *entry;
419 struct td *td;
420
421 temp = snprintf (buf, size,
422 "ed/%p %cs dev%d ep%d%s max %d %08x%s%s %s",
423 ed,
424 (info & ED_LOWSPEED) ? 'l' : 'f',
425 scratch & 0x7f,
426 (scratch >> 7) & 0xf,
427 (info & ED_IN) ? "in" : "out",
428 0x03ff & (scratch >> 16),
429 scratch,
430 (info & ED_SKIP) ? " s" : "",
431 (ed->hwHeadP & ED_H) ? " H" : "",
432 (ed->hwHeadP & ED_C) ? data1 : data0);
433 size -= temp;
434 buf += temp;
435
436 list_for_each (entry, &ed->td_list) {
437 u32 cbp, be;
438
439 td = list_entry (entry, struct td, td_list);
440 scratch = cpu_to_le32p (&td->hwINFO);
441 cbp = le32_to_cpup (&td->hwCBP);
442 be = le32_to_cpup (&td->hwBE);
443 temp = snprintf (buf, size,
444 "\n\ttd %p %s %d cc=%x urb %p (%08x)",
445 td,
446 ({ char *pid;
447 switch (scratch & TD_DP) {
448 case TD_DP_SETUP: pid = "setup"; break;
449 case TD_DP_IN: pid = "in"; break;
450 case TD_DP_OUT: pid = "out"; break;
451 default: pid = "(?)"; break;
452 } pid;}),
453 cbp ? (be + 1 - cbp) : 0,
454 TD_CC_GET (scratch), td->urb, scratch);
455 size -= temp;
456 buf += temp;
457 }
458
459 temp = snprintf (buf, size, "\n");
460 size -= temp;
461 buf += temp;
462
463 ed = ed->ed_next;
464 }
465 return count - size;
466 }
467
468 static ssize_t
469 show_async (struct device *dev, char *buf)
470 {
471 struct ohci_hcd *ohci;
472 size_t temp;
473 unsigned long flags;
474
475 ohci = dev_to_ohci(dev);
476
477 /* display control and bulk lists together, for simplicity */
478 spin_lock_irqsave (&ohci->lock, flags);
479 temp = show_list (ohci, buf, PAGE_SIZE, ohci->ed_controltail);
480 temp += show_list (ohci, buf + temp, PAGE_SIZE - temp, ohci->ed_bulktail);
481 spin_unlock_irqrestore (&ohci->lock, flags);
482
483 return temp;
484 }
485 static DEVICE_ATTR (async, S_IRUGO, show_async, NULL);
486
487
488 #define DBG_SCHED_LIMIT 64
489
490 static ssize_t
491 show_periodic (struct device *dev, char *buf)
492 {
493 struct ohci_hcd *ohci;
494 struct ed **seen, *ed;
495 unsigned long flags;
496 unsigned temp, size, seen_count;
497 char *next;
498 unsigned i;
499
500 if (!(seen = kmalloc (DBG_SCHED_LIMIT * sizeof *seen, SLAB_ATOMIC)))
501 return 0;
502 seen_count = 0;
503
504 ohci = dev_to_ohci(dev);
505 next = buf;
506 size = PAGE_SIZE;
507
508 temp = snprintf (next, size, "size = %d\n", NUM_INTS);
509 size -= temp;
510 next += temp;
511
512 /* dump a snapshot of the periodic schedule (and load) */
513 spin_lock_irqsave (&ohci->lock, flags);
514 for (i = 0; i < NUM_INTS; i++) {
515 if (!(ed = ohci->periodic [i]))
516 continue;
517
518 temp = snprintf (next, size, "%2d [%3d]:", i, ohci->load [i]);
519 size -= temp;
520 next += temp;
521
522 do {
523 temp = snprintf (next, size, " ed%d/%p",
524 ed->interval, ed);
525 size -= temp;
526 next += temp;
527 for (temp = 0; temp < seen_count; temp++) {
528 if (seen [temp] == ed)
529 break;
530 }
531
532 /* show more info the first time around */
533 if (temp == seen_count) {
534 u32 info = ed->hwINFO;
535 u32 scratch = cpu_to_le32p (&ed->hwINFO);
536
537 temp = snprintf (next, size,
538 " (%cs dev%d%s ep%d%s"
539 " max %d %08x%s%s)",
540 (info & ED_LOWSPEED) ? 'l' : 'f',
541 scratch & 0x7f,
542 (info & ED_ISO) ? " iso" : "",
543 (scratch >> 7) & 0xf,
544 (info & ED_IN) ? "in" : "out",
545 0x03ff & (scratch >> 16),
546 scratch,
547 (info & ED_SKIP) ? " s" : "",
548 (ed->hwHeadP & ED_H) ? " H" : "");
549 size -= temp;
550 next += temp;
551
552 // FIXME some TD info too
553
554 if (seen_count < DBG_SCHED_LIMIT)
555 seen [seen_count++] = ed;
556
557 ed = ed->ed_next;
558
559 } else {
560 /* we've seen it and what's after */
561 temp = 0;
562 ed = 0;
563 }
564
565 } while (ed);
566
567 temp = snprintf (next, size, "\n");
568 size -= temp;
569 next += temp;
570 }
571 spin_unlock_irqrestore (&ohci->lock, flags);
572 kfree (seen);
573
574 return PAGE_SIZE - size;
575 }
576 static DEVICE_ATTR (periodic, S_IRUGO, show_periodic, NULL);
577
578
579 #undef DBG_SCHED_LIMIT
580
581 static ssize_t
582 show_registers (struct device *dev, char *buf)
583 {
584 struct ohci_hcd *ohci;
585 struct ohci_regs *regs;
586 unsigned long flags;
587 unsigned temp, size;
588 char *next;
589 u32 rdata;
590
591 ohci = dev_to_ohci(dev);
592 regs = ohci->regs;
593 next = buf;
594 size = PAGE_SIZE;
595
596 spin_lock_irqsave (&ohci->lock, flags);
597
598 /* dump driver info, then registers in spec order */
599
600 ohci_dbg_sw (ohci, &next, &size,
601 "%s version " DRIVER_VERSION "\n", hcd_name);
602
603 ohci_dump_status(ohci, &next, &size);
604
605 /* hcca */
606 if (ohci->hcca)
607 ohci_dbg_sw (ohci, &next, &size,
608 "hcca frame 0x%04x\n", ohci->hcca->frame_no);
609
610 /* other registers mostly affect frame timings */
611 rdata = readl (&regs->fminterval);
612 temp = snprintf (next, size,
613 "fmintvl 0x%08x %sFSMPS=0x%04x FI=0x%04x\n",
614 rdata, (rdata >> 31) ? " FIT" : "",
615 (rdata >> 16) & 0xefff, rdata & 0xffff);
616 size -= temp;
617 next += temp;
618
619 rdata = readl (&regs->fmremaining);
620 temp = snprintf (next, size, "fmremaining 0x%08x %sFR=0x%04x\n",
621 rdata, (rdata >> 31) ? " FRT" : "",
622 rdata & 0x3fff);
623 size -= temp;
624 next += temp;
625
626 rdata = readl (&regs->periodicstart);
627 temp = snprintf (next, size, "periodicstart 0x%04x\n",
628 rdata & 0x3fff);
629 size -= temp;
630 next += temp;
631
632 rdata = readl (&regs->lsthresh);
633 temp = snprintf (next, size, "lsthresh 0x%04x\n",
634 rdata & 0x3fff);
635 size -= temp;
636 next += temp;
637
638 /* roothub */
639 ohci_dump_roothub (ohci, 1, &next, &size);
640
641 spin_unlock_irqrestore (&ohci->lock, flags);
642
643 return PAGE_SIZE - size;
644 }
645 static DEVICE_ATTR (registers, S_IRUGO, show_registers, NULL);
646
647
648 static inline void create_debug_files (struct ohci_hcd *bus)
649 {
650 device_create_file (bus->hcd.controller, &dev_attr_async);
651 device_create_file (bus->hcd.controller, &dev_attr_periodic);
652 device_create_file (bus->hcd.controller, &dev_attr_registers);
653 ohci_dbg (bus, "created debug files\n");
654 }
655
656 static inline void remove_debug_files (struct ohci_hcd *bus)
657 {
658 device_remove_file (bus->hcd.controller, &dev_attr_async);
659 device_remove_file (bus->hcd.controller, &dev_attr_periodic);
660 device_remove_file (bus->hcd.controller, &dev_attr_registers);
661 }
662
663 #endif
664
665 /*-------------------------------------------------------------------------*/
666