uhci-debug.c 16 KB

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