uhci-debug.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. /*
  2. * UHCI-specific debugging code. Invaluable when something
  3. * goes wrong, but don't get in my face.
  4. *
  5. * Kernel visible pointers are surrounded in []s and bus
  6. * visible pointers are surrounded in ()s
  7. *
  8. * (C) Copyright 1999 Linus Torvalds
  9. * (C) Copyright 1999-2001 Johannes Erdfelt
  10. */
  11. #include <linux/slab.h>
  12. #include <linux/kernel.h>
  13. #include <linux/debugfs.h>
  14. #include <asm/io.h>
  15. #include "uhci-hcd.h"
  16. #define EXTRA_SPACE 1024
  17. static struct dentry *uhci_debugfs_root;
  18. #ifdef CONFIG_DYNAMIC_DEBUG
  19. /* Handle REALLY large printks so we don't overflow buffers */
  20. static void lprintk(char *buf)
  21. {
  22. char *p;
  23. /* Just write one line at a time */
  24. while (buf) {
  25. p = strchr(buf, '\n');
  26. if (p)
  27. *p = 0;
  28. printk(KERN_DEBUG "%s\n", buf);
  29. buf = p;
  30. if (buf)
  31. buf++;
  32. }
  33. }
  34. static int uhci_show_td(struct uhci_hcd *uhci, struct uhci_td *td, char *buf,
  35. int len, int space)
  36. {
  37. char *out = buf;
  38. char *spid;
  39. u32 status, token;
  40. status = td_status(uhci, td);
  41. out += sprintf(out, "%*s[%p] link (%08x) ", space, "", td,
  42. hc32_to_cpu(uhci, td->link));
  43. out += sprintf(out, "e%d %s%s%s%s%s%s%s%s%s%sLength=%x ",
  44. ((status >> 27) & 3),
  45. (status & TD_CTRL_SPD) ? "SPD " : "",
  46. (status & TD_CTRL_LS) ? "LS " : "",
  47. (status & TD_CTRL_IOC) ? "IOC " : "",
  48. (status & TD_CTRL_ACTIVE) ? "Active " : "",
  49. (status & TD_CTRL_STALLED) ? "Stalled " : "",
  50. (status & TD_CTRL_DBUFERR) ? "DataBufErr " : "",
  51. (status & TD_CTRL_BABBLE) ? "Babble " : "",
  52. (status & TD_CTRL_NAK) ? "NAK " : "",
  53. (status & TD_CTRL_CRCTIMEO) ? "CRC/Timeo " : "",
  54. (status & TD_CTRL_BITSTUFF) ? "BitStuff " : "",
  55. status & 0x7ff);
  56. if (out - buf > len)
  57. goto done;
  58. token = td_token(uhci, td);
  59. switch (uhci_packetid(token)) {
  60. case USB_PID_SETUP:
  61. spid = "SETUP";
  62. break;
  63. case USB_PID_OUT:
  64. spid = "OUT";
  65. break;
  66. case USB_PID_IN:
  67. spid = "IN";
  68. break;
  69. default:
  70. spid = "?";
  71. break;
  72. }
  73. out += sprintf(out, "MaxLen=%x DT%d EndPt=%x Dev=%x, PID=%x(%s) ",
  74. token >> 21,
  75. ((token >> 19) & 1),
  76. (token >> 15) & 15,
  77. (token >> 8) & 127,
  78. (token & 0xff),
  79. spid);
  80. out += sprintf(out, "(buf=%08x)\n", hc32_to_cpu(uhci, td->buffer));
  81. done:
  82. if (out - buf > len)
  83. out += sprintf(out, " ...\n");
  84. return out - buf;
  85. }
  86. static int uhci_show_urbp(struct uhci_hcd *uhci, struct urb_priv *urbp,
  87. char *buf, int len, int space)
  88. {
  89. char *out = buf;
  90. struct uhci_td *td;
  91. int i, nactive, ninactive;
  92. char *ptype;
  93. out += sprintf(out, "urb_priv [%p] ", urbp);
  94. out += sprintf(out, "urb [%p] ", urbp->urb);
  95. out += sprintf(out, "qh [%p] ", urbp->qh);
  96. out += sprintf(out, "Dev=%d ", usb_pipedevice(urbp->urb->pipe));
  97. out += sprintf(out, "EP=%x(%s) ", usb_pipeendpoint(urbp->urb->pipe),
  98. (usb_pipein(urbp->urb->pipe) ? "IN" : "OUT"));
  99. if (out - buf > len)
  100. goto done;
  101. switch (usb_pipetype(urbp->urb->pipe)) {
  102. case PIPE_ISOCHRONOUS: ptype = "ISO"; break;
  103. case PIPE_INTERRUPT: ptype = "INT"; break;
  104. case PIPE_BULK: ptype = "BLK"; break;
  105. default:
  106. case PIPE_CONTROL: ptype = "CTL"; break;
  107. }
  108. out += sprintf(out, "%s%s", ptype, (urbp->fsbr ? " FSBR" : ""));
  109. out += sprintf(out, " Actlen=%d%s", urbp->urb->actual_length,
  110. (urbp->qh->type == USB_ENDPOINT_XFER_CONTROL ?
  111. "-8" : ""));
  112. if (urbp->urb->unlinked)
  113. out += sprintf(out, " Unlinked=%d", urbp->urb->unlinked);
  114. out += sprintf(out, "\n");
  115. if (out - buf > len)
  116. goto done;
  117. i = nactive = ninactive = 0;
  118. list_for_each_entry(td, &urbp->td_list, list) {
  119. if (urbp->qh->type != USB_ENDPOINT_XFER_ISOC &&
  120. (++i <= 10 || debug > 2)) {
  121. out += sprintf(out, "%*s%d: ", space + 2, "", i);
  122. out += uhci_show_td(uhci, td, out,
  123. len - (out - buf), 0);
  124. if (out - buf > len)
  125. goto tail;
  126. } else {
  127. if (td_status(uhci, td) & TD_CTRL_ACTIVE)
  128. ++nactive;
  129. else
  130. ++ninactive;
  131. }
  132. }
  133. if (nactive + ninactive > 0)
  134. out += sprintf(out,
  135. "%*s[skipped %d inactive and %d active TDs]\n",
  136. space, "", ninactive, nactive);
  137. done:
  138. if (out - buf > len)
  139. out += sprintf(out, " ...\n");
  140. tail:
  141. return out - buf;
  142. }
  143. static int uhci_show_qh(struct uhci_hcd *uhci,
  144. struct uhci_qh *qh, char *buf, int len, int space)
  145. {
  146. char *out = buf;
  147. int i, nurbs;
  148. __hc32 element = qh_element(qh);
  149. char *qtype;
  150. switch (qh->type) {
  151. case USB_ENDPOINT_XFER_ISOC: qtype = "ISO"; break;
  152. case USB_ENDPOINT_XFER_INT: qtype = "INT"; break;
  153. case USB_ENDPOINT_XFER_BULK: qtype = "BLK"; break;
  154. case USB_ENDPOINT_XFER_CONTROL: qtype = "CTL"; break;
  155. default: qtype = "Skel" ; break;
  156. }
  157. out += sprintf(out, "%*s[%p] %s QH link (%08x) element (%08x)\n",
  158. space, "", qh, qtype,
  159. hc32_to_cpu(uhci, qh->link),
  160. hc32_to_cpu(uhci, element));
  161. if (qh->type == USB_ENDPOINT_XFER_ISOC)
  162. out += sprintf(out,
  163. "%*s period %d phase %d load %d us, frame %x desc [%p]\n",
  164. space, "", qh->period, qh->phase, qh->load,
  165. qh->iso_frame, qh->iso_packet_desc);
  166. else if (qh->type == USB_ENDPOINT_XFER_INT)
  167. out += sprintf(out, "%*s period %d phase %d load %d us\n",
  168. space, "", qh->period, qh->phase, qh->load);
  169. if (out - buf > len)
  170. goto done;
  171. if (element & UHCI_PTR_QH(uhci))
  172. out += sprintf(out, "%*s Element points to QH (bug?)\n", space, "");
  173. if (element & UHCI_PTR_DEPTH(uhci))
  174. out += sprintf(out, "%*s Depth traverse\n", space, "");
  175. if (element & cpu_to_hc32(uhci, 8))
  176. out += sprintf(out, "%*s Bit 3 set (bug?)\n", space, "");
  177. if (!(element & ~(UHCI_PTR_QH(uhci) | UHCI_PTR_DEPTH(uhci))))
  178. out += sprintf(out, "%*s Element is NULL (bug?)\n", space, "");
  179. if (out - buf > len)
  180. goto done;
  181. if (list_empty(&qh->queue)) {
  182. out += sprintf(out, "%*s queue is empty\n", space, "");
  183. if (qh == uhci->skel_async_qh) {
  184. out += uhci_show_td(uhci, uhci->term_td, out,
  185. len - (out - buf), 0);
  186. if (out - buf > len)
  187. goto tail;
  188. }
  189. } else {
  190. struct urb_priv *urbp = list_entry(qh->queue.next,
  191. struct urb_priv, node);
  192. struct uhci_td *td = list_entry(urbp->td_list.next,
  193. struct uhci_td, list);
  194. if (element != LINK_TO_TD(uhci, td))
  195. out += sprintf(out, "%*s Element != First TD\n",
  196. space, "");
  197. i = nurbs = 0;
  198. list_for_each_entry(urbp, &qh->queue, node) {
  199. if (++i <= 10) {
  200. out += uhci_show_urbp(uhci, urbp, out,
  201. len - (out - buf), space + 2);
  202. if (out - buf > len)
  203. goto tail;
  204. }
  205. else
  206. ++nurbs;
  207. }
  208. if (nurbs > 0)
  209. out += sprintf(out, "%*s Skipped %d URBs\n",
  210. space, "", nurbs);
  211. }
  212. if (out - buf > len)
  213. goto done;
  214. if (qh->dummy_td) {
  215. out += sprintf(out, "%*s Dummy TD\n", space, "");
  216. out += uhci_show_td(uhci, qh->dummy_td, out,
  217. len - (out - buf), 0);
  218. if (out - buf > len)
  219. goto tail;
  220. }
  221. done:
  222. if (out - buf > len)
  223. out += sprintf(out, " ...\n");
  224. tail:
  225. return out - buf;
  226. }
  227. static int uhci_show_sc(int port, unsigned short status, char *buf)
  228. {
  229. return sprintf(buf, " stat%d = %04x %s%s%s%s%s%s%s%s%s%s\n",
  230. port,
  231. status,
  232. (status & USBPORTSC_SUSP) ? " Suspend" : "",
  233. (status & USBPORTSC_OCC) ? " OverCurrentChange" : "",
  234. (status & USBPORTSC_OC) ? " OverCurrent" : "",
  235. (status & USBPORTSC_PR) ? " Reset" : "",
  236. (status & USBPORTSC_LSDA) ? " LowSpeed" : "",
  237. (status & USBPORTSC_RD) ? " ResumeDetect" : "",
  238. (status & USBPORTSC_PEC) ? " EnableChange" : "",
  239. (status & USBPORTSC_PE) ? " Enabled" : "",
  240. (status & USBPORTSC_CSC) ? " ConnectChange" : "",
  241. (status & USBPORTSC_CCS) ? " Connected" : "");
  242. }
  243. static int uhci_show_root_hub_state(struct uhci_hcd *uhci, char *buf)
  244. {
  245. char *rh_state;
  246. switch (uhci->rh_state) {
  247. case UHCI_RH_RESET:
  248. rh_state = "reset"; break;
  249. case UHCI_RH_SUSPENDED:
  250. rh_state = "suspended"; break;
  251. case UHCI_RH_AUTO_STOPPED:
  252. rh_state = "auto-stopped"; break;
  253. case UHCI_RH_RESUMING:
  254. rh_state = "resuming"; break;
  255. case UHCI_RH_SUSPENDING:
  256. rh_state = "suspending"; break;
  257. case UHCI_RH_RUNNING:
  258. rh_state = "running"; break;
  259. case UHCI_RH_RUNNING_NODEVS:
  260. rh_state = "running, no devs"; break;
  261. default:
  262. rh_state = "?"; break;
  263. }
  264. return sprintf(buf, "Root-hub state: %s FSBR: %d\n",
  265. rh_state, uhci->fsbr_is_on);
  266. }
  267. static int uhci_show_status(struct uhci_hcd *uhci, char *buf, int len)
  268. {
  269. char *out = buf;
  270. unsigned short usbcmd, usbstat, usbint, usbfrnum;
  271. unsigned int flbaseadd;
  272. unsigned char sof;
  273. unsigned short portsc1, portsc2;
  274. usbcmd = uhci_readw(uhci, USBCMD);
  275. usbstat = uhci_readw(uhci, USBSTS);
  276. usbint = uhci_readw(uhci, USBINTR);
  277. usbfrnum = uhci_readw(uhci, USBFRNUM);
  278. flbaseadd = uhci_readl(uhci, USBFLBASEADD);
  279. sof = uhci_readb(uhci, USBSOF);
  280. portsc1 = uhci_readw(uhci, USBPORTSC1);
  281. portsc2 = uhci_readw(uhci, USBPORTSC2);
  282. out += sprintf(out, " usbcmd = %04x %s%s%s%s%s%s%s%s\n",
  283. usbcmd,
  284. (usbcmd & USBCMD_MAXP) ? "Maxp64 " : "Maxp32 ",
  285. (usbcmd & USBCMD_CF) ? "CF " : "",
  286. (usbcmd & USBCMD_SWDBG) ? "SWDBG " : "",
  287. (usbcmd & USBCMD_FGR) ? "FGR " : "",
  288. (usbcmd & USBCMD_EGSM) ? "EGSM " : "",
  289. (usbcmd & USBCMD_GRESET) ? "GRESET " : "",
  290. (usbcmd & USBCMD_HCRESET) ? "HCRESET " : "",
  291. (usbcmd & USBCMD_RS) ? "RS " : "");
  292. if (out - buf > len)
  293. goto done;
  294. out += sprintf(out, " usbstat = %04x %s%s%s%s%s%s\n",
  295. usbstat,
  296. (usbstat & USBSTS_HCH) ? "HCHalted " : "",
  297. (usbstat & USBSTS_HCPE) ? "HostControllerProcessError " : "",
  298. (usbstat & USBSTS_HSE) ? "HostSystemError " : "",
  299. (usbstat & USBSTS_RD) ? "ResumeDetect " : "",
  300. (usbstat & USBSTS_ERROR) ? "USBError " : "",
  301. (usbstat & USBSTS_USBINT) ? "USBINT " : "");
  302. if (out - buf > len)
  303. goto done;
  304. out += sprintf(out, " usbint = %04x\n", usbint);
  305. out += sprintf(out, " usbfrnum = (%d)%03x\n", (usbfrnum >> 10) & 1,
  306. 0xfff & (4*(unsigned int)usbfrnum));
  307. out += sprintf(out, " flbaseadd = %08x\n", flbaseadd);
  308. out += sprintf(out, " sof = %02x\n", sof);
  309. if (out - buf > len)
  310. goto done;
  311. out += uhci_show_sc(1, portsc1, out);
  312. if (out - buf > len)
  313. goto done;
  314. out += uhci_show_sc(2, portsc2, out);
  315. if (out - buf > len)
  316. goto done;
  317. out += sprintf(out,
  318. "Most recent frame: %x (%d) Last ISO frame: %x (%d)\n",
  319. uhci->frame_number, uhci->frame_number & 1023,
  320. uhci->last_iso_frame, uhci->last_iso_frame & 1023);
  321. done:
  322. if (out - buf > len)
  323. out += sprintf(out, " ...\n");
  324. return out - buf;
  325. }
  326. static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len)
  327. {
  328. char *out = buf;
  329. int i, j;
  330. struct uhci_qh *qh;
  331. struct uhci_td *td;
  332. struct list_head *tmp, *head;
  333. int nframes, nerrs;
  334. __hc32 link;
  335. __hc32 fsbr_link;
  336. static const char * const qh_names[] = {
  337. "unlink", "iso", "int128", "int64", "int32", "int16",
  338. "int8", "int4", "int2", "async", "term"
  339. };
  340. out += uhci_show_root_hub_state(uhci, out);
  341. if (out - buf > len)
  342. goto done;
  343. out += sprintf(out, "HC status\n");
  344. out += uhci_show_status(uhci, out, len - (out - buf));
  345. if (out - buf > len)
  346. goto tail;
  347. out += sprintf(out, "Periodic load table\n");
  348. for (i = 0; i < MAX_PHASE; ++i) {
  349. out += sprintf(out, "\t%d", uhci->load[i]);
  350. if (i % 8 == 7)
  351. *out++ = '\n';
  352. }
  353. out += sprintf(out, "Total: %d, #INT: %d, #ISO: %d\n",
  354. uhci->total_load,
  355. uhci_to_hcd(uhci)->self.bandwidth_int_reqs,
  356. uhci_to_hcd(uhci)->self.bandwidth_isoc_reqs);
  357. if (debug <= 1)
  358. goto tail;
  359. out += sprintf(out, "Frame List\n");
  360. nframes = 10;
  361. nerrs = 0;
  362. for (i = 0; i < UHCI_NUMFRAMES; ++i) {
  363. __hc32 qh_dma;
  364. if (out - buf > len)
  365. goto done;
  366. j = 0;
  367. td = uhci->frame_cpu[i];
  368. link = uhci->frame[i];
  369. if (!td)
  370. goto check_link;
  371. if (nframes > 0) {
  372. out += sprintf(out, "- Frame %d -> (%08x)\n",
  373. i, hc32_to_cpu(uhci, link));
  374. j = 1;
  375. }
  376. head = &td->fl_list;
  377. tmp = head;
  378. do {
  379. td = list_entry(tmp, struct uhci_td, fl_list);
  380. tmp = tmp->next;
  381. if (link != LINK_TO_TD(uhci, td)) {
  382. if (nframes > 0) {
  383. out += sprintf(out,
  384. " link does not match list entry!\n");
  385. if (out - buf > len)
  386. goto done;
  387. } else
  388. ++nerrs;
  389. }
  390. if (nframes > 0) {
  391. out += uhci_show_td(uhci, td, out,
  392. len - (out - buf), 4);
  393. if (out - buf > len)
  394. goto tail;
  395. }
  396. link = td->link;
  397. } while (tmp != head);
  398. check_link:
  399. qh_dma = uhci_frame_skel_link(uhci, i);
  400. if (link != qh_dma) {
  401. if (nframes > 0) {
  402. if (!j) {
  403. out += sprintf(out,
  404. "- Frame %d -> (%08x)\n",
  405. i, hc32_to_cpu(uhci, link));
  406. j = 1;
  407. }
  408. out += sprintf(out,
  409. " link does not match QH (%08x)!\n",
  410. hc32_to_cpu(uhci, qh_dma));
  411. if (out - buf > len)
  412. goto done;
  413. } else
  414. ++nerrs;
  415. }
  416. nframes -= j;
  417. }
  418. if (nerrs > 0)
  419. out += sprintf(out, "Skipped %d bad links\n", nerrs);
  420. out += sprintf(out, "Skeleton QHs\n");
  421. if (out - buf > len)
  422. goto done;
  423. fsbr_link = 0;
  424. for (i = 0; i < UHCI_NUM_SKELQH; ++i) {
  425. int cnt = 0;
  426. qh = uhci->skelqh[i];
  427. out += sprintf(out, "- skel_%s_qh\n", qh_names[i]);
  428. out += uhci_show_qh(uhci, qh, out, len - (out - buf), 4);
  429. if (out - buf > len)
  430. goto tail;
  431. /* Last QH is the Terminating QH, it's different */
  432. if (i == SKEL_TERM) {
  433. if (qh_element(qh) != LINK_TO_TD(uhci, uhci->term_td)) {
  434. out += sprintf(out,
  435. " skel_term_qh element is not set to term_td!\n");
  436. if (out - buf > len)
  437. goto done;
  438. }
  439. link = fsbr_link;
  440. if (!link)
  441. link = LINK_TO_QH(uhci, uhci->skel_term_qh);
  442. goto check_qh_link;
  443. }
  444. head = &qh->node;
  445. tmp = head->next;
  446. while (tmp != head) {
  447. qh = list_entry(tmp, struct uhci_qh, node);
  448. tmp = tmp->next;
  449. if (++cnt <= 10) {
  450. out += uhci_show_qh(uhci, qh, out,
  451. len - (out - buf), 4);
  452. if (out - buf > len)
  453. goto tail;
  454. }
  455. if (!fsbr_link && qh->skel >= SKEL_FSBR)
  456. fsbr_link = LINK_TO_QH(uhci, qh);
  457. }
  458. if ((cnt -= 10) > 0)
  459. out += sprintf(out, " Skipped %d QHs\n", cnt);
  460. link = UHCI_PTR_TERM(uhci);
  461. if (i <= SKEL_ISO)
  462. ;
  463. else if (i < SKEL_ASYNC)
  464. link = LINK_TO_QH(uhci, uhci->skel_async_qh);
  465. else if (!uhci->fsbr_is_on)
  466. ;
  467. else
  468. link = LINK_TO_QH(uhci, uhci->skel_term_qh);
  469. check_qh_link:
  470. if (qh->link != link)
  471. out += sprintf(out,
  472. " last QH not linked to next skeleton!\n");
  473. if (out - buf > len)
  474. goto done;
  475. }
  476. done:
  477. if (out - buf > len)
  478. out += sprintf(out, " ...\n");
  479. tail:
  480. return out - buf;
  481. }
  482. #ifdef CONFIG_DEBUG_FS
  483. #define MAX_OUTPUT (64 * 1024)
  484. struct uhci_debug {
  485. int size;
  486. char *data;
  487. };
  488. static int uhci_debug_open(struct inode *inode, struct file *file)
  489. {
  490. struct uhci_hcd *uhci = inode->i_private;
  491. struct uhci_debug *up;
  492. unsigned long flags;
  493. up = kmalloc(sizeof(*up), GFP_KERNEL);
  494. if (!up)
  495. return -ENOMEM;
  496. up->data = kmalloc(MAX_OUTPUT, GFP_KERNEL);
  497. if (!up->data) {
  498. kfree(up);
  499. return -ENOMEM;
  500. }
  501. up->size = 0;
  502. spin_lock_irqsave(&uhci->lock, flags);
  503. if (uhci->is_initialized)
  504. up->size = uhci_sprint_schedule(uhci, up->data,
  505. MAX_OUTPUT - EXTRA_SPACE);
  506. spin_unlock_irqrestore(&uhci->lock, flags);
  507. file->private_data = up;
  508. return 0;
  509. }
  510. static loff_t uhci_debug_lseek(struct file *file, loff_t off, int whence)
  511. {
  512. struct uhci_debug *up = file->private_data;
  513. return no_seek_end_llseek_size(file, off, whence, up->size);
  514. }
  515. static ssize_t uhci_debug_read(struct file *file, char __user *buf,
  516. size_t nbytes, loff_t *ppos)
  517. {
  518. struct uhci_debug *up = file->private_data;
  519. return simple_read_from_buffer(buf, nbytes, ppos, up->data, up->size);
  520. }
  521. static int uhci_debug_release(struct inode *inode, struct file *file)
  522. {
  523. struct uhci_debug *up = file->private_data;
  524. kfree(up->data);
  525. kfree(up);
  526. return 0;
  527. }
  528. static const struct file_operations uhci_debug_operations = {
  529. .owner = THIS_MODULE,
  530. .open = uhci_debug_open,
  531. .llseek = uhci_debug_lseek,
  532. .read = uhci_debug_read,
  533. .release = uhci_debug_release,
  534. };
  535. #define UHCI_DEBUG_OPS
  536. #endif /* CONFIG_DEBUG_FS */
  537. #else /* CONFIG_DYNAMIC_DEBUG*/
  538. static inline void lprintk(char *buf)
  539. {}
  540. static inline int uhci_show_qh(struct uhci_hcd *uhci,
  541. struct uhci_qh *qh, char *buf, int len, int space)
  542. {
  543. return 0;
  544. }
  545. static inline int uhci_sprint_schedule(struct uhci_hcd *uhci,
  546. char *buf, int len)
  547. {
  548. return 0;
  549. }
  550. #endif