debugfs.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. /*
  2. * Intel Wireless Multicomm 3200 WiFi driver
  3. *
  4. * Copyright (C) 2009 Intel Corporation <ilw@linux.intel.com>
  5. * Samuel Ortiz <samuel.ortiz@intel.com>
  6. * Zhu Yi <yi.zhu@intel.com>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License version
  10. * 2 as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  20. * 02110-1301, USA.
  21. *
  22. */
  23. #include <linux/slab.h>
  24. #include <linux/kernel.h>
  25. #include <linux/bitops.h>
  26. #include <linux/debugfs.h>
  27. #include "iwm.h"
  28. #include "bus.h"
  29. #include "rx.h"
  30. #include "debug.h"
  31. static struct {
  32. u8 id;
  33. char *name;
  34. } iwm_debug_module[__IWM_DM_NR] = {
  35. {IWM_DM_BOOT, "boot"},
  36. {IWM_DM_FW, "fw"},
  37. {IWM_DM_SDIO, "sdio"},
  38. {IWM_DM_NTF, "ntf"},
  39. {IWM_DM_RX, "rx"},
  40. {IWM_DM_TX, "tx"},
  41. {IWM_DM_MLME, "mlme"},
  42. {IWM_DM_CMD, "cmd"},
  43. {IWM_DM_WEXT, "wext"},
  44. };
  45. #define add_dbg_module(dbg, name, id, initlevel) \
  46. do { \
  47. struct dentry *d; \
  48. dbg.dbg_module[id] = (initlevel); \
  49. d = debugfs_create_x8(name, 0600, dbg.dbgdir, \
  50. &(dbg.dbg_module[id])); \
  51. if (!IS_ERR(d)) \
  52. dbg.dbg_module_dentries[id] = d; \
  53. } while (0)
  54. static int iwm_debugfs_u32_read(void *data, u64 *val)
  55. {
  56. struct iwm_priv *iwm = data;
  57. *val = iwm->dbg.dbg_level;
  58. return 0;
  59. }
  60. static int iwm_debugfs_dbg_level_write(void *data, u64 val)
  61. {
  62. struct iwm_priv *iwm = data;
  63. int i;
  64. iwm->dbg.dbg_level = val;
  65. for (i = 0; i < __IWM_DM_NR; i++)
  66. iwm->dbg.dbg_module[i] = val;
  67. return 0;
  68. }
  69. DEFINE_SIMPLE_ATTRIBUTE(fops_iwm_dbg_level,
  70. iwm_debugfs_u32_read, iwm_debugfs_dbg_level_write,
  71. "%llu\n");
  72. static int iwm_debugfs_dbg_modules_write(void *data, u64 val)
  73. {
  74. struct iwm_priv *iwm = data;
  75. int i, bit;
  76. iwm->dbg.dbg_modules = val;
  77. for (i = 0; i < __IWM_DM_NR; i++)
  78. iwm->dbg.dbg_module[i] = 0;
  79. for_each_set_bit(bit, &iwm->dbg.dbg_modules, __IWM_DM_NR)
  80. iwm->dbg.dbg_module[bit] = iwm->dbg.dbg_level;
  81. return 0;
  82. }
  83. DEFINE_SIMPLE_ATTRIBUTE(fops_iwm_dbg_modules,
  84. iwm_debugfs_u32_read, iwm_debugfs_dbg_modules_write,
  85. "%llu\n");
  86. static int iwm_generic_open(struct inode *inode, struct file *filp)
  87. {
  88. filp->private_data = inode->i_private;
  89. return 0;
  90. }
  91. static ssize_t iwm_debugfs_txq_read(struct file *filp, char __user *buffer,
  92. size_t count, loff_t *ppos)
  93. {
  94. struct iwm_priv *iwm = filp->private_data;
  95. char *buf;
  96. int i, buf_len = 4096;
  97. size_t len = 0;
  98. ssize_t ret;
  99. if (*ppos != 0)
  100. return 0;
  101. if (count < sizeof(buf))
  102. return -ENOSPC;
  103. buf = kzalloc(buf_len, GFP_KERNEL);
  104. if (!buf)
  105. return -ENOMEM;
  106. for (i = 0; i < IWM_TX_QUEUES; i++) {
  107. struct iwm_tx_queue *txq = &iwm->txq[i];
  108. struct sk_buff *skb;
  109. int j;
  110. unsigned long flags;
  111. spin_lock_irqsave(&txq->queue.lock, flags);
  112. skb = (struct sk_buff *)&txq->queue;
  113. len += snprintf(buf + len, buf_len - len, "TXQ #%d\n", i);
  114. len += snprintf(buf + len, buf_len - len, "\tStopped: %d\n",
  115. __netif_subqueue_stopped(iwm_to_ndev(iwm),
  116. txq->id));
  117. len += snprintf(buf + len, buf_len - len, "\tConcat count:%d\n",
  118. txq->concat_count);
  119. len += snprintf(buf + len, buf_len - len, "\tQueue len: %d\n",
  120. skb_queue_len(&txq->queue));
  121. for (j = 0; j < skb_queue_len(&txq->queue); j++) {
  122. struct iwm_tx_info *tx_info;
  123. skb = skb->next;
  124. tx_info = skb_to_tx_info(skb);
  125. len += snprintf(buf + len, buf_len - len,
  126. "\tSKB #%d\n", j);
  127. len += snprintf(buf + len, buf_len - len,
  128. "\t\tsta: %d\n", tx_info->sta);
  129. len += snprintf(buf + len, buf_len - len,
  130. "\t\tcolor: %d\n", tx_info->color);
  131. len += snprintf(buf + len, buf_len - len,
  132. "\t\ttid: %d\n", tx_info->tid);
  133. }
  134. spin_unlock_irqrestore(&txq->queue.lock, flags);
  135. spin_lock_irqsave(&txq->stopped_queue.lock, flags);
  136. len += snprintf(buf + len, buf_len - len,
  137. "\tStopped Queue len: %d\n",
  138. skb_queue_len(&txq->stopped_queue));
  139. for (j = 0; j < skb_queue_len(&txq->stopped_queue); j++) {
  140. struct iwm_tx_info *tx_info;
  141. skb = skb->next;
  142. tx_info = skb_to_tx_info(skb);
  143. len += snprintf(buf + len, buf_len - len,
  144. "\tSKB #%d\n", j);
  145. len += snprintf(buf + len, buf_len - len,
  146. "\t\tsta: %d\n", tx_info->sta);
  147. len += snprintf(buf + len, buf_len - len,
  148. "\t\tcolor: %d\n", tx_info->color);
  149. len += snprintf(buf + len, buf_len - len,
  150. "\t\ttid: %d\n", tx_info->tid);
  151. }
  152. spin_unlock_irqrestore(&txq->stopped_queue.lock, flags);
  153. }
  154. ret = simple_read_from_buffer(buffer, len, ppos, buf, buf_len);
  155. kfree(buf);
  156. return ret;
  157. }
  158. static ssize_t iwm_debugfs_tx_credit_read(struct file *filp,
  159. char __user *buffer,
  160. size_t count, loff_t *ppos)
  161. {
  162. struct iwm_priv *iwm = filp->private_data;
  163. struct iwm_tx_credit *credit = &iwm->tx_credit;
  164. char *buf;
  165. int i, buf_len = 4096;
  166. size_t len = 0;
  167. ssize_t ret;
  168. if (*ppos != 0)
  169. return 0;
  170. if (count < sizeof(buf))
  171. return -ENOSPC;
  172. buf = kzalloc(buf_len, GFP_KERNEL);
  173. if (!buf)
  174. return -ENOMEM;
  175. len += snprintf(buf + len, buf_len - len,
  176. "NR pools: %d\n", credit->pool_nr);
  177. len += snprintf(buf + len, buf_len - len,
  178. "pools map: 0x%lx\n", credit->full_pools_map);
  179. len += snprintf(buf + len, buf_len - len, "\n### POOLS ###\n");
  180. for (i = 0; i < IWM_MACS_OUT_GROUPS; i++) {
  181. len += snprintf(buf + len, buf_len - len,
  182. "pools entry #%d\n", i);
  183. len += snprintf(buf + len, buf_len - len,
  184. "\tid: %d\n",
  185. credit->pools[i].id);
  186. len += snprintf(buf + len, buf_len - len,
  187. "\tsid: %d\n",
  188. credit->pools[i].sid);
  189. len += snprintf(buf + len, buf_len - len,
  190. "\tmin_pages: %d\n",
  191. credit->pools[i].min_pages);
  192. len += snprintf(buf + len, buf_len - len,
  193. "\tmax_pages: %d\n",
  194. credit->pools[i].max_pages);
  195. len += snprintf(buf + len, buf_len - len,
  196. "\talloc_pages: %d\n",
  197. credit->pools[i].alloc_pages);
  198. len += snprintf(buf + len, buf_len - len,
  199. "\tfreed_pages: %d\n",
  200. credit->pools[i].total_freed_pages);
  201. }
  202. len += snprintf(buf + len, buf_len - len, "\n### SPOOLS ###\n");
  203. for (i = 0; i < IWM_MACS_OUT_SGROUPS; i++) {
  204. len += snprintf(buf + len, buf_len - len,
  205. "spools entry #%d\n", i);
  206. len += snprintf(buf + len, buf_len - len,
  207. "\tid: %d\n",
  208. credit->spools[i].id);
  209. len += snprintf(buf + len, buf_len - len,
  210. "\tmax_pages: %d\n",
  211. credit->spools[i].max_pages);
  212. len += snprintf(buf + len, buf_len - len,
  213. "\talloc_pages: %d\n",
  214. credit->spools[i].alloc_pages);
  215. }
  216. ret = simple_read_from_buffer(buffer, len, ppos, buf, buf_len);
  217. kfree(buf);
  218. return ret;
  219. }
  220. static ssize_t iwm_debugfs_rx_ticket_read(struct file *filp,
  221. char __user *buffer,
  222. size_t count, loff_t *ppos)
  223. {
  224. struct iwm_priv *iwm = filp->private_data;
  225. struct iwm_rx_ticket_node *ticket;
  226. char *buf;
  227. int buf_len = 4096, i;
  228. size_t len = 0;
  229. ssize_t ret;
  230. if (*ppos != 0)
  231. return 0;
  232. if (count < sizeof(buf))
  233. return -ENOSPC;
  234. buf = kzalloc(buf_len, GFP_KERNEL);
  235. if (!buf)
  236. return -ENOMEM;
  237. spin_lock(&iwm->ticket_lock);
  238. list_for_each_entry(ticket, &iwm->rx_tickets, node) {
  239. len += snprintf(buf + len, buf_len - len, "Ticket #%d\n",
  240. ticket->ticket->id);
  241. len += snprintf(buf + len, buf_len - len, "\taction: 0x%x\n",
  242. ticket->ticket->action);
  243. len += snprintf(buf + len, buf_len - len, "\tflags: 0x%x\n",
  244. ticket->ticket->flags);
  245. }
  246. spin_unlock(&iwm->ticket_lock);
  247. for (i = 0; i < IWM_RX_ID_HASH; i++) {
  248. struct iwm_rx_packet *packet;
  249. struct list_head *pkt_list = &iwm->rx_packets[i];
  250. if (!list_empty(pkt_list)) {
  251. len += snprintf(buf + len, buf_len - len,
  252. "Packet hash #%d\n", i);
  253. spin_lock(&iwm->packet_lock[i]);
  254. list_for_each_entry(packet, pkt_list, node) {
  255. len += snprintf(buf + len, buf_len - len,
  256. "\tPacket id: %d\n",
  257. packet->id);
  258. len += snprintf(buf + len, buf_len - len,
  259. "\tPacket length: %lu\n",
  260. packet->pkt_size);
  261. }
  262. spin_unlock(&iwm->packet_lock[i]);
  263. }
  264. }
  265. ret = simple_read_from_buffer(buffer, len, ppos, buf, buf_len);
  266. kfree(buf);
  267. return ret;
  268. }
  269. static ssize_t iwm_debugfs_fw_err_read(struct file *filp,
  270. char __user *buffer,
  271. size_t count, loff_t *ppos)
  272. {
  273. struct iwm_priv *iwm = filp->private_data;
  274. char buf[512];
  275. int buf_len = 512;
  276. size_t len = 0;
  277. if (*ppos != 0)
  278. return 0;
  279. if (count < sizeof(buf))
  280. return -ENOSPC;
  281. if (!iwm->last_fw_err)
  282. return -ENOMEM;
  283. if (iwm->last_fw_err->line_num == 0)
  284. goto out;
  285. len += snprintf(buf + len, buf_len - len, "%cMAC FW ERROR:\n",
  286. (le32_to_cpu(iwm->last_fw_err->category) == UMAC_SYS_ERR_CAT_LMAC)
  287. ? 'L' : 'U');
  288. len += snprintf(buf + len, buf_len - len,
  289. "\tCategory: %d\n",
  290. le32_to_cpu(iwm->last_fw_err->category));
  291. len += snprintf(buf + len, buf_len - len,
  292. "\tStatus: 0x%x\n",
  293. le32_to_cpu(iwm->last_fw_err->status));
  294. len += snprintf(buf + len, buf_len - len,
  295. "\tPC: 0x%x\n",
  296. le32_to_cpu(iwm->last_fw_err->pc));
  297. len += snprintf(buf + len, buf_len - len,
  298. "\tblink1: %d\n",
  299. le32_to_cpu(iwm->last_fw_err->blink1));
  300. len += snprintf(buf + len, buf_len - len,
  301. "\tblink2: %d\n",
  302. le32_to_cpu(iwm->last_fw_err->blink2));
  303. len += snprintf(buf + len, buf_len - len,
  304. "\tilink1: %d\n",
  305. le32_to_cpu(iwm->last_fw_err->ilink1));
  306. len += snprintf(buf + len, buf_len - len,
  307. "\tilink2: %d\n",
  308. le32_to_cpu(iwm->last_fw_err->ilink2));
  309. len += snprintf(buf + len, buf_len - len,
  310. "\tData1: 0x%x\n",
  311. le32_to_cpu(iwm->last_fw_err->data1));
  312. len += snprintf(buf + len, buf_len - len,
  313. "\tData2: 0x%x\n",
  314. le32_to_cpu(iwm->last_fw_err->data2));
  315. len += snprintf(buf + len, buf_len - len,
  316. "\tLine number: %d\n",
  317. le32_to_cpu(iwm->last_fw_err->line_num));
  318. len += snprintf(buf + len, buf_len - len,
  319. "\tUMAC status: 0x%x\n",
  320. le32_to_cpu(iwm->last_fw_err->umac_status));
  321. len += snprintf(buf + len, buf_len - len,
  322. "\tLMAC status: 0x%x\n",
  323. le32_to_cpu(iwm->last_fw_err->lmac_status));
  324. len += snprintf(buf + len, buf_len - len,
  325. "\tSDIO status: 0x%x\n",
  326. le32_to_cpu(iwm->last_fw_err->sdio_status));
  327. out:
  328. return simple_read_from_buffer(buffer, len, ppos, buf, buf_len);
  329. }
  330. static const struct file_operations iwm_debugfs_txq_fops = {
  331. .owner = THIS_MODULE,
  332. .open = iwm_generic_open,
  333. .read = iwm_debugfs_txq_read,
  334. };
  335. static const struct file_operations iwm_debugfs_tx_credit_fops = {
  336. .owner = THIS_MODULE,
  337. .open = iwm_generic_open,
  338. .read = iwm_debugfs_tx_credit_read,
  339. };
  340. static const struct file_operations iwm_debugfs_rx_ticket_fops = {
  341. .owner = THIS_MODULE,
  342. .open = iwm_generic_open,
  343. .read = iwm_debugfs_rx_ticket_read,
  344. };
  345. static const struct file_operations iwm_debugfs_fw_err_fops = {
  346. .owner = THIS_MODULE,
  347. .open = iwm_generic_open,
  348. .read = iwm_debugfs_fw_err_read,
  349. };
  350. int iwm_debugfs_init(struct iwm_priv *iwm)
  351. {
  352. int i, result;
  353. char devdir[16];
  354. iwm->dbg.rootdir = debugfs_create_dir(KBUILD_MODNAME, NULL);
  355. result = PTR_ERR(iwm->dbg.rootdir);
  356. if (!result || IS_ERR(iwm->dbg.rootdir)) {
  357. if (result == -ENODEV) {
  358. IWM_ERR(iwm, "DebugFS (CONFIG_DEBUG_FS) not "
  359. "enabled in kernel config\n");
  360. result = 0; /* No debugfs support */
  361. }
  362. IWM_ERR(iwm, "Couldn't create rootdir: %d\n", result);
  363. goto error;
  364. }
  365. snprintf(devdir, sizeof(devdir), "%s", wiphy_name(iwm_to_wiphy(iwm)));
  366. iwm->dbg.devdir = debugfs_create_dir(devdir, iwm->dbg.rootdir);
  367. result = PTR_ERR(iwm->dbg.devdir);
  368. if (IS_ERR(iwm->dbg.devdir) && (result != -ENODEV)) {
  369. IWM_ERR(iwm, "Couldn't create devdir: %d\n", result);
  370. goto error;
  371. }
  372. iwm->dbg.dbgdir = debugfs_create_dir("debug", iwm->dbg.devdir);
  373. result = PTR_ERR(iwm->dbg.dbgdir);
  374. if (IS_ERR(iwm->dbg.dbgdir) && (result != -ENODEV)) {
  375. IWM_ERR(iwm, "Couldn't create dbgdir: %d\n", result);
  376. goto error;
  377. }
  378. iwm->dbg.rxdir = debugfs_create_dir("rx", iwm->dbg.devdir);
  379. result = PTR_ERR(iwm->dbg.rxdir);
  380. if (IS_ERR(iwm->dbg.rxdir) && (result != -ENODEV)) {
  381. IWM_ERR(iwm, "Couldn't create rx dir: %d\n", result);
  382. goto error;
  383. }
  384. iwm->dbg.txdir = debugfs_create_dir("tx", iwm->dbg.devdir);
  385. result = PTR_ERR(iwm->dbg.txdir);
  386. if (IS_ERR(iwm->dbg.txdir) && (result != -ENODEV)) {
  387. IWM_ERR(iwm, "Couldn't create tx dir: %d\n", result);
  388. goto error;
  389. }
  390. iwm->dbg.busdir = debugfs_create_dir("bus", iwm->dbg.devdir);
  391. result = PTR_ERR(iwm->dbg.busdir);
  392. if (IS_ERR(iwm->dbg.busdir) && (result != -ENODEV)) {
  393. IWM_ERR(iwm, "Couldn't create bus dir: %d\n", result);
  394. goto error;
  395. }
  396. if (iwm->bus_ops->debugfs_init) {
  397. result = iwm->bus_ops->debugfs_init(iwm, iwm->dbg.busdir);
  398. if (result < 0) {
  399. IWM_ERR(iwm, "Couldn't create bus entry: %d\n", result);
  400. goto error;
  401. }
  402. }
  403. iwm->dbg.dbg_level = IWM_DL_NONE;
  404. iwm->dbg.dbg_level_dentry =
  405. debugfs_create_file("level", 0200, iwm->dbg.dbgdir, iwm,
  406. &fops_iwm_dbg_level);
  407. result = PTR_ERR(iwm->dbg.dbg_level_dentry);
  408. if (IS_ERR(iwm->dbg.dbg_level_dentry) && (result != -ENODEV)) {
  409. IWM_ERR(iwm, "Couldn't create dbg_level: %d\n", result);
  410. goto error;
  411. }
  412. iwm->dbg.dbg_modules = IWM_DM_DEFAULT;
  413. iwm->dbg.dbg_modules_dentry =
  414. debugfs_create_file("modules", 0200, iwm->dbg.dbgdir, iwm,
  415. &fops_iwm_dbg_modules);
  416. result = PTR_ERR(iwm->dbg.dbg_modules_dentry);
  417. if (IS_ERR(iwm->dbg.dbg_modules_dentry) && (result != -ENODEV)) {
  418. IWM_ERR(iwm, "Couldn't create dbg_modules: %d\n", result);
  419. goto error;
  420. }
  421. for (i = 0; i < __IWM_DM_NR; i++)
  422. add_dbg_module(iwm->dbg, iwm_debug_module[i].name,
  423. iwm_debug_module[i].id, IWM_DL_DEFAULT);
  424. iwm->dbg.txq_dentry = debugfs_create_file("queues", 0200,
  425. iwm->dbg.txdir, iwm,
  426. &iwm_debugfs_txq_fops);
  427. result = PTR_ERR(iwm->dbg.txq_dentry);
  428. if (IS_ERR(iwm->dbg.txq_dentry) && (result != -ENODEV)) {
  429. IWM_ERR(iwm, "Couldn't create tx queue: %d\n", result);
  430. goto error;
  431. }
  432. iwm->dbg.tx_credit_dentry = debugfs_create_file("credits", 0200,
  433. iwm->dbg.txdir, iwm,
  434. &iwm_debugfs_tx_credit_fops);
  435. result = PTR_ERR(iwm->dbg.tx_credit_dentry);
  436. if (IS_ERR(iwm->dbg.tx_credit_dentry) && (result != -ENODEV)) {
  437. IWM_ERR(iwm, "Couldn't create tx credit: %d\n", result);
  438. goto error;
  439. }
  440. iwm->dbg.rx_ticket_dentry = debugfs_create_file("tickets", 0200,
  441. iwm->dbg.rxdir, iwm,
  442. &iwm_debugfs_rx_ticket_fops);
  443. result = PTR_ERR(iwm->dbg.rx_ticket_dentry);
  444. if (IS_ERR(iwm->dbg.rx_ticket_dentry) && (result != -ENODEV)) {
  445. IWM_ERR(iwm, "Couldn't create rx ticket: %d\n", result);
  446. goto error;
  447. }
  448. iwm->dbg.fw_err_dentry = debugfs_create_file("last_fw_err", 0200,
  449. iwm->dbg.dbgdir, iwm,
  450. &iwm_debugfs_fw_err_fops);
  451. result = PTR_ERR(iwm->dbg.fw_err_dentry);
  452. if (IS_ERR(iwm->dbg.fw_err_dentry) && (result != -ENODEV)) {
  453. IWM_ERR(iwm, "Couldn't create last FW err: %d\n", result);
  454. goto error;
  455. }
  456. return 0;
  457. error:
  458. return result;
  459. }
  460. void iwm_debugfs_exit(struct iwm_priv *iwm)
  461. {
  462. int i;
  463. for (i = 0; i < __IWM_DM_NR; i++)
  464. debugfs_remove(iwm->dbg.dbg_module_dentries[i]);
  465. debugfs_remove(iwm->dbg.dbg_modules_dentry);
  466. debugfs_remove(iwm->dbg.dbg_level_dentry);
  467. debugfs_remove(iwm->dbg.txq_dentry);
  468. debugfs_remove(iwm->dbg.tx_credit_dentry);
  469. debugfs_remove(iwm->dbg.rx_ticket_dentry);
  470. debugfs_remove(iwm->dbg.fw_err_dentry);
  471. if (iwm->bus_ops->debugfs_exit)
  472. iwm->bus_ops->debugfs_exit(iwm);
  473. debugfs_remove(iwm->dbg.busdir);
  474. debugfs_remove(iwm->dbg.dbgdir);
  475. debugfs_remove(iwm->dbg.txdir);
  476. debugfs_remove(iwm->dbg.rxdir);
  477. debugfs_remove(iwm->dbg.devdir);
  478. debugfs_remove(iwm->dbg.rootdir);
  479. }