debugfs.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. /*
  2. * Copyright (c) 2012 Qualcomm Atheros, Inc.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #include <linux/module.h>
  17. #include <linux/debugfs.h>
  18. #include <linux/seq_file.h>
  19. #include <linux/pci.h>
  20. #include <linux/rtnetlink.h>
  21. #include "wil6210.h"
  22. #include "txrx.h"
  23. /* Nasty hack. Better have per device instances */
  24. static u32 mem_addr;
  25. static u32 dbg_txdesc_index;
  26. static void wil_print_vring(struct seq_file *s, struct wil6210_priv *wil,
  27. const char *name, struct vring *vring)
  28. {
  29. void __iomem *x = wmi_addr(wil, vring->hwtail);
  30. seq_printf(s, "VRING %s = {\n", name);
  31. seq_printf(s, " pa = 0x%016llx\n", (unsigned long long)vring->pa);
  32. seq_printf(s, " va = 0x%p\n", vring->va);
  33. seq_printf(s, " size = %d\n", vring->size);
  34. seq_printf(s, " swtail = %d\n", vring->swtail);
  35. seq_printf(s, " swhead = %d\n", vring->swhead);
  36. seq_printf(s, " hwtail = [0x%08x] -> ", vring->hwtail);
  37. if (x)
  38. seq_printf(s, "0x%08x\n", ioread32(x));
  39. else
  40. seq_printf(s, "???\n");
  41. if (vring->va && (vring->size < 1025)) {
  42. uint i;
  43. for (i = 0; i < vring->size; i++) {
  44. volatile struct vring_tx_desc *d = &vring->va[i].tx;
  45. if ((i % 64) == 0 && (i != 0))
  46. seq_printf(s, "\n");
  47. seq_printf(s, "%s", (d->dma.status & BIT(0)) ?
  48. "S" : (vring->ctx[i].skb ? "H" : "h"));
  49. }
  50. seq_printf(s, "\n");
  51. }
  52. seq_printf(s, "}\n");
  53. }
  54. static int wil_vring_debugfs_show(struct seq_file *s, void *data)
  55. {
  56. uint i;
  57. struct wil6210_priv *wil = s->private;
  58. wil_print_vring(s, wil, "rx", &wil->vring_rx);
  59. for (i = 0; i < ARRAY_SIZE(wil->vring_tx); i++) {
  60. struct vring *vring = &(wil->vring_tx[i]);
  61. if (vring->va) {
  62. char name[10];
  63. snprintf(name, sizeof(name), "tx_%2d", i);
  64. wil_print_vring(s, wil, name, vring);
  65. }
  66. }
  67. return 0;
  68. }
  69. static int wil_vring_seq_open(struct inode *inode, struct file *file)
  70. {
  71. return single_open(file, wil_vring_debugfs_show, inode->i_private);
  72. }
  73. static const struct file_operations fops_vring = {
  74. .open = wil_vring_seq_open,
  75. .release = single_release,
  76. .read = seq_read,
  77. .llseek = seq_lseek,
  78. };
  79. static void wil_print_ring(struct seq_file *s, const char *prefix,
  80. void __iomem *off)
  81. {
  82. struct wil6210_priv *wil = s->private;
  83. struct wil6210_mbox_ring r;
  84. int rsize;
  85. uint i;
  86. wil_memcpy_fromio_32(&r, off, sizeof(r));
  87. wil_mbox_ring_le2cpus(&r);
  88. /*
  89. * we just read memory block from NIC. This memory may be
  90. * garbage. Check validity before using it.
  91. */
  92. rsize = r.size / sizeof(struct wil6210_mbox_ring_desc);
  93. seq_printf(s, "ring %s = {\n", prefix);
  94. seq_printf(s, " base = 0x%08x\n", r.base);
  95. seq_printf(s, " size = 0x%04x bytes -> %d entries\n", r.size, rsize);
  96. seq_printf(s, " tail = 0x%08x\n", r.tail);
  97. seq_printf(s, " head = 0x%08x\n", r.head);
  98. seq_printf(s, " entry size = %d\n", r.entry_size);
  99. if (r.size % sizeof(struct wil6210_mbox_ring_desc)) {
  100. seq_printf(s, " ??? size is not multiple of %zd, garbage?\n",
  101. sizeof(struct wil6210_mbox_ring_desc));
  102. goto out;
  103. }
  104. if (!wmi_addr(wil, r.base) ||
  105. !wmi_addr(wil, r.tail) ||
  106. !wmi_addr(wil, r.head)) {
  107. seq_printf(s, " ??? pointers are garbage?\n");
  108. goto out;
  109. }
  110. for (i = 0; i < rsize; i++) {
  111. struct wil6210_mbox_ring_desc d;
  112. struct wil6210_mbox_hdr hdr;
  113. size_t delta = i * sizeof(d);
  114. void __iomem *x = wil->csr + HOSTADDR(r.base) + delta;
  115. wil_memcpy_fromio_32(&d, x, sizeof(d));
  116. seq_printf(s, " [%2x] %s %s%s 0x%08x", i,
  117. d.sync ? "F" : "E",
  118. (r.tail - r.base == delta) ? "t" : " ",
  119. (r.head - r.base == delta) ? "h" : " ",
  120. le32_to_cpu(d.addr));
  121. if (0 == wmi_read_hdr(wil, d.addr, &hdr)) {
  122. u16 len = le16_to_cpu(hdr.len);
  123. seq_printf(s, " -> %04x %04x %04x %02x\n",
  124. le16_to_cpu(hdr.seq), len,
  125. le16_to_cpu(hdr.type), hdr.flags);
  126. if (len <= MAX_MBOXITEM_SIZE) {
  127. int n = 0;
  128. char printbuf[16 * 3 + 2];
  129. unsigned char databuf[MAX_MBOXITEM_SIZE];
  130. void __iomem *src = wmi_buffer(wil, d.addr) +
  131. sizeof(struct wil6210_mbox_hdr);
  132. /*
  133. * No need to check @src for validity -
  134. * we already validated @d.addr while
  135. * reading header
  136. */
  137. wil_memcpy_fromio_32(databuf, src, len);
  138. while (n < len) {
  139. int l = min(len - n, 16);
  140. hex_dump_to_buffer(databuf + n, l,
  141. 16, 1, printbuf,
  142. sizeof(printbuf),
  143. false);
  144. seq_printf(s, " : %s\n", printbuf);
  145. n += l;
  146. }
  147. }
  148. } else {
  149. seq_printf(s, "\n");
  150. }
  151. }
  152. out:
  153. seq_printf(s, "}\n");
  154. }
  155. static int wil_mbox_debugfs_show(struct seq_file *s, void *data)
  156. {
  157. struct wil6210_priv *wil = s->private;
  158. wil_print_ring(s, "tx", wil->csr + HOST_MBOX +
  159. offsetof(struct wil6210_mbox_ctl, tx));
  160. wil_print_ring(s, "rx", wil->csr + HOST_MBOX +
  161. offsetof(struct wil6210_mbox_ctl, rx));
  162. return 0;
  163. }
  164. static int wil_mbox_seq_open(struct inode *inode, struct file *file)
  165. {
  166. return single_open(file, wil_mbox_debugfs_show, inode->i_private);
  167. }
  168. static const struct file_operations fops_mbox = {
  169. .open = wil_mbox_seq_open,
  170. .release = single_release,
  171. .read = seq_read,
  172. .llseek = seq_lseek,
  173. };
  174. static int wil_debugfs_iomem_x32_set(void *data, u64 val)
  175. {
  176. iowrite32(val, (void __iomem *)data);
  177. wmb(); /* make sure write propagated to HW */
  178. return 0;
  179. }
  180. static int wil_debugfs_iomem_x32_get(void *data, u64 *val)
  181. {
  182. *val = ioread32((void __iomem *)data);
  183. return 0;
  184. }
  185. DEFINE_SIMPLE_ATTRIBUTE(fops_iomem_x32, wil_debugfs_iomem_x32_get,
  186. wil_debugfs_iomem_x32_set, "0x%08llx\n");
  187. static struct dentry *wil_debugfs_create_iomem_x32(const char *name,
  188. umode_t mode,
  189. struct dentry *parent,
  190. void __iomem *value)
  191. {
  192. return debugfs_create_file(name, mode, parent, (void * __force)value,
  193. &fops_iomem_x32);
  194. }
  195. static int wil6210_debugfs_create_ISR(struct wil6210_priv *wil,
  196. const char *name,
  197. struct dentry *parent, u32 off)
  198. {
  199. struct dentry *d = debugfs_create_dir(name, parent);
  200. if (IS_ERR_OR_NULL(d))
  201. return -ENODEV;
  202. wil_debugfs_create_iomem_x32("ICC", S_IRUGO | S_IWUSR, d,
  203. wil->csr + off);
  204. wil_debugfs_create_iomem_x32("ICR", S_IRUGO | S_IWUSR, d,
  205. wil->csr + off + 4);
  206. wil_debugfs_create_iomem_x32("ICM", S_IRUGO | S_IWUSR, d,
  207. wil->csr + off + 8);
  208. wil_debugfs_create_iomem_x32("ICS", S_IWUSR, d,
  209. wil->csr + off + 12);
  210. wil_debugfs_create_iomem_x32("IMV", S_IRUGO | S_IWUSR, d,
  211. wil->csr + off + 16);
  212. wil_debugfs_create_iomem_x32("IMS", S_IWUSR, d,
  213. wil->csr + off + 20);
  214. wil_debugfs_create_iomem_x32("IMC", S_IWUSR, d,
  215. wil->csr + off + 24);
  216. return 0;
  217. }
  218. static int wil6210_debugfs_create_pseudo_ISR(struct wil6210_priv *wil,
  219. struct dentry *parent)
  220. {
  221. struct dentry *d = debugfs_create_dir("PSEUDO_ISR", parent);
  222. if (IS_ERR_OR_NULL(d))
  223. return -ENODEV;
  224. wil_debugfs_create_iomem_x32("CAUSE", S_IRUGO, d, wil->csr +
  225. HOSTADDR(RGF_DMA_PSEUDO_CAUSE));
  226. wil_debugfs_create_iomem_x32("MASK_SW", S_IRUGO, d, wil->csr +
  227. HOSTADDR(RGF_DMA_PSEUDO_CAUSE_MASK_SW));
  228. wil_debugfs_create_iomem_x32("MASK_FW", S_IRUGO, d, wil->csr +
  229. HOSTADDR(RGF_DMA_PSEUDO_CAUSE_MASK_FW));
  230. return 0;
  231. }
  232. static int wil6210_debugfs_create_ITR_CNT(struct wil6210_priv *wil,
  233. struct dentry *parent)
  234. {
  235. struct dentry *d = debugfs_create_dir("ITR_CNT", parent);
  236. if (IS_ERR_OR_NULL(d))
  237. return -ENODEV;
  238. wil_debugfs_create_iomem_x32("TRSH", S_IRUGO, d, wil->csr +
  239. HOSTADDR(RGF_DMA_ITR_CNT_TRSH));
  240. wil_debugfs_create_iomem_x32("DATA", S_IRUGO, d, wil->csr +
  241. HOSTADDR(RGF_DMA_ITR_CNT_DATA));
  242. wil_debugfs_create_iomem_x32("CTL", S_IRUGO, d, wil->csr +
  243. HOSTADDR(RGF_DMA_ITR_CNT_CRL));
  244. return 0;
  245. }
  246. static int wil_memread_debugfs_show(struct seq_file *s, void *data)
  247. {
  248. struct wil6210_priv *wil = s->private;
  249. void __iomem *a = wmi_buffer(wil, cpu_to_le32(mem_addr));
  250. if (a)
  251. seq_printf(s, "[0x%08x] = 0x%08x\n", mem_addr, ioread32(a));
  252. else
  253. seq_printf(s, "[0x%08x] = INVALID\n", mem_addr);
  254. return 0;
  255. }
  256. static int wil_memread_seq_open(struct inode *inode, struct file *file)
  257. {
  258. return single_open(file, wil_memread_debugfs_show, inode->i_private);
  259. }
  260. static const struct file_operations fops_memread = {
  261. .open = wil_memread_seq_open,
  262. .release = single_release,
  263. .read = seq_read,
  264. .llseek = seq_lseek,
  265. };
  266. static ssize_t wil_read_file_ioblob(struct file *file, char __user *user_buf,
  267. size_t count, loff_t *ppos)
  268. {
  269. enum { max_count = 4096 };
  270. struct debugfs_blob_wrapper *blob = file->private_data;
  271. loff_t pos = *ppos;
  272. size_t available = blob->size;
  273. void *buf;
  274. size_t ret;
  275. if (pos < 0)
  276. return -EINVAL;
  277. if (pos >= available || !count)
  278. return 0;
  279. if (count > available - pos)
  280. count = available - pos;
  281. if (count > max_count)
  282. count = max_count;
  283. buf = kmalloc(count, GFP_KERNEL);
  284. if (!buf)
  285. return -ENOMEM;
  286. wil_memcpy_fromio_32(buf, (const volatile void __iomem *)blob->data +
  287. pos, count);
  288. ret = copy_to_user(user_buf, buf, count);
  289. kfree(buf);
  290. if (ret == count)
  291. return -EFAULT;
  292. count -= ret;
  293. *ppos = pos + count;
  294. return count;
  295. }
  296. static const struct file_operations fops_ioblob = {
  297. .read = wil_read_file_ioblob,
  298. .open = simple_open,
  299. .llseek = default_llseek,
  300. };
  301. static
  302. struct dentry *wil_debugfs_create_ioblob(const char *name,
  303. umode_t mode,
  304. struct dentry *parent,
  305. struct debugfs_blob_wrapper *blob)
  306. {
  307. return debugfs_create_file(name, mode, parent, blob, &fops_ioblob);
  308. }
  309. /*---reset---*/
  310. static ssize_t wil_write_file_reset(struct file *file, const char __user *buf,
  311. size_t len, loff_t *ppos)
  312. {
  313. struct wil6210_priv *wil = file->private_data;
  314. struct net_device *ndev = wil_to_ndev(wil);
  315. /**
  316. * BUG:
  317. * this code does NOT sync device state with the rest of system
  318. * use with care, debug only!!!
  319. */
  320. rtnl_lock();
  321. dev_close(ndev);
  322. ndev->flags &= ~IFF_UP;
  323. rtnl_unlock();
  324. wil_reset(wil);
  325. return len;
  326. }
  327. static const struct file_operations fops_reset = {
  328. .write = wil_write_file_reset,
  329. .open = simple_open,
  330. };
  331. /*---------Tx descriptor------------*/
  332. static int wil_txdesc_debugfs_show(struct seq_file *s, void *data)
  333. {
  334. struct wil6210_priv *wil = s->private;
  335. struct vring *vring = &(wil->vring_tx[0]);
  336. if (!vring->va) {
  337. seq_printf(s, "No Tx VRING\n");
  338. return 0;
  339. }
  340. if (dbg_txdesc_index < vring->size) {
  341. volatile struct vring_tx_desc *d =
  342. &(vring->va[dbg_txdesc_index].tx);
  343. volatile u32 *u = (volatile u32 *)d;
  344. struct sk_buff *skb = vring->ctx[dbg_txdesc_index].skb;
  345. seq_printf(s, "Tx[%3d] = {\n", dbg_txdesc_index);
  346. seq_printf(s, " MAC = 0x%08x 0x%08x 0x%08x 0x%08x\n",
  347. u[0], u[1], u[2], u[3]);
  348. seq_printf(s, " DMA = 0x%08x 0x%08x 0x%08x 0x%08x\n",
  349. u[4], u[5], u[6], u[7]);
  350. seq_printf(s, " SKB = %p\n", skb);
  351. if (skb) {
  352. char printbuf[16 * 3 + 2];
  353. int i = 0;
  354. int len = le16_to_cpu(d->dma.length);
  355. void *p = skb->data;
  356. if (len != skb_headlen(skb)) {
  357. seq_printf(s, "!!! len: desc = %d skb = %d\n",
  358. len, skb_headlen(skb));
  359. len = min_t(int, len, skb_headlen(skb));
  360. }
  361. seq_printf(s, " len = %d\n", len);
  362. while (i < len) {
  363. int l = min(len - i, 16);
  364. hex_dump_to_buffer(p + i, l, 16, 1, printbuf,
  365. sizeof(printbuf), false);
  366. seq_printf(s, " : %s\n", printbuf);
  367. i += l;
  368. }
  369. }
  370. seq_printf(s, "}\n");
  371. } else {
  372. seq_printf(s, "TxDesc index (%d) >= size (%d)\n",
  373. dbg_txdesc_index, vring->size);
  374. }
  375. return 0;
  376. }
  377. static int wil_txdesc_seq_open(struct inode *inode, struct file *file)
  378. {
  379. return single_open(file, wil_txdesc_debugfs_show, inode->i_private);
  380. }
  381. static const struct file_operations fops_txdesc = {
  382. .open = wil_txdesc_seq_open,
  383. .release = single_release,
  384. .read = seq_read,
  385. .llseek = seq_lseek,
  386. };
  387. /*---------beamforming------------*/
  388. static int wil_bf_debugfs_show(struct seq_file *s, void *data)
  389. {
  390. struct wil6210_priv *wil = s->private;
  391. seq_printf(s,
  392. "TSF : 0x%016llx\n"
  393. "TxMCS : %d\n"
  394. "Sectors(rx:tx) my %2d:%2d peer %2d:%2d\n",
  395. wil->stats.tsf, wil->stats.bf_mcs,
  396. wil->stats.my_rx_sector, wil->stats.my_tx_sector,
  397. wil->stats.peer_rx_sector, wil->stats.peer_tx_sector);
  398. return 0;
  399. }
  400. static int wil_bf_seq_open(struct inode *inode, struct file *file)
  401. {
  402. return single_open(file, wil_bf_debugfs_show, inode->i_private);
  403. }
  404. static const struct file_operations fops_bf = {
  405. .open = wil_bf_seq_open,
  406. .release = single_release,
  407. .read = seq_read,
  408. .llseek = seq_lseek,
  409. };
  410. /*---------SSID------------*/
  411. static ssize_t wil_read_file_ssid(struct file *file, char __user *user_buf,
  412. size_t count, loff_t *ppos)
  413. {
  414. struct wil6210_priv *wil = file->private_data;
  415. struct wireless_dev *wdev = wil_to_wdev(wil);
  416. return simple_read_from_buffer(user_buf, count, ppos,
  417. wdev->ssid, wdev->ssid_len);
  418. }
  419. static ssize_t wil_write_file_ssid(struct file *file, const char __user *buf,
  420. size_t count, loff_t *ppos)
  421. {
  422. struct wil6210_priv *wil = file->private_data;
  423. struct wireless_dev *wdev = wil_to_wdev(wil);
  424. struct net_device *ndev = wil_to_ndev(wil);
  425. if (*ppos != 0) {
  426. wil_err(wil, "Unable to set SSID substring from [%d]\n",
  427. (int)*ppos);
  428. return -EINVAL;
  429. }
  430. if (count > sizeof(wdev->ssid)) {
  431. wil_err(wil, "SSID too long, len = %d\n", (int)count);
  432. return -EINVAL;
  433. }
  434. if (netif_running(ndev)) {
  435. wil_err(wil, "Unable to change SSID on running interface\n");
  436. return -EINVAL;
  437. }
  438. wdev->ssid_len = count;
  439. return simple_write_to_buffer(wdev->ssid, wdev->ssid_len, ppos,
  440. buf, count);
  441. }
  442. static const struct file_operations fops_ssid = {
  443. .read = wil_read_file_ssid,
  444. .write = wil_write_file_ssid,
  445. .open = simple_open,
  446. };
  447. /*---------temp------------*/
  448. static void print_temp(struct seq_file *s, const char *prefix, u32 t)
  449. {
  450. switch (t) {
  451. case 0:
  452. case ~(u32)0:
  453. seq_printf(s, "%s N/A\n", prefix);
  454. break;
  455. default:
  456. seq_printf(s, "%s %d.%03d\n", prefix, t / 1000, t % 1000);
  457. break;
  458. }
  459. }
  460. static int wil_temp_debugfs_show(struct seq_file *s, void *data)
  461. {
  462. struct wil6210_priv *wil = s->private;
  463. u32 t_m, t_r;
  464. int rc = wmi_get_temperature(wil, &t_m, &t_r);
  465. if (rc) {
  466. seq_printf(s, "Failed\n");
  467. return 0;
  468. }
  469. print_temp(s, "MAC temperature :", t_m);
  470. print_temp(s, "Radio temperature :", t_r);
  471. return 0;
  472. }
  473. static int wil_temp_seq_open(struct inode *inode, struct file *file)
  474. {
  475. return single_open(file, wil_temp_debugfs_show, inode->i_private);
  476. }
  477. static const struct file_operations fops_temp = {
  478. .open = wil_temp_seq_open,
  479. .release = single_release,
  480. .read = seq_read,
  481. .llseek = seq_lseek,
  482. };
  483. /*----------------*/
  484. int wil6210_debugfs_init(struct wil6210_priv *wil)
  485. {
  486. struct dentry *dbg = wil->debug = debugfs_create_dir(WIL_NAME,
  487. wil_to_wiphy(wil)->debugfsdir);
  488. if (IS_ERR_OR_NULL(dbg))
  489. return -ENODEV;
  490. debugfs_create_file("mbox", S_IRUGO, dbg, wil, &fops_mbox);
  491. debugfs_create_file("vrings", S_IRUGO, dbg, wil, &fops_vring);
  492. debugfs_create_file("txdesc", S_IRUGO, dbg, wil, &fops_txdesc);
  493. debugfs_create_u32("txdesc_index", S_IRUGO | S_IWUSR, dbg,
  494. &dbg_txdesc_index);
  495. debugfs_create_file("bf", S_IRUGO, dbg, wil, &fops_bf);
  496. debugfs_create_file("ssid", S_IRUGO | S_IWUSR, dbg, wil, &fops_ssid);
  497. debugfs_create_u32("secure_pcp", S_IRUGO | S_IWUSR, dbg,
  498. &wil->secure_pcp);
  499. wil6210_debugfs_create_ISR(wil, "USER_ICR", dbg,
  500. HOSTADDR(RGF_USER_USER_ICR));
  501. wil6210_debugfs_create_ISR(wil, "DMA_EP_TX_ICR", dbg,
  502. HOSTADDR(RGF_DMA_EP_TX_ICR));
  503. wil6210_debugfs_create_ISR(wil, "DMA_EP_RX_ICR", dbg,
  504. HOSTADDR(RGF_DMA_EP_RX_ICR));
  505. wil6210_debugfs_create_ISR(wil, "DMA_EP_MISC_ICR", dbg,
  506. HOSTADDR(RGF_DMA_EP_MISC_ICR));
  507. wil6210_debugfs_create_pseudo_ISR(wil, dbg);
  508. wil6210_debugfs_create_ITR_CNT(wil, dbg);
  509. debugfs_create_u32("mem_addr", S_IRUGO | S_IWUSR, dbg, &mem_addr);
  510. debugfs_create_file("mem_val", S_IRUGO, dbg, wil, &fops_memread);
  511. debugfs_create_file("reset", S_IWUSR, dbg, wil, &fops_reset);
  512. debugfs_create_file("temp", S_IRUGO, dbg, wil, &fops_temp);
  513. wil->rgf_blob.data = (void * __force)wil->csr + 0;
  514. wil->rgf_blob.size = 0xa000;
  515. wil_debugfs_create_ioblob("blob_rgf", S_IRUGO, dbg, &wil->rgf_blob);
  516. wil->fw_code_blob.data = (void * __force)wil->csr + 0x40000;
  517. wil->fw_code_blob.size = 0x40000;
  518. wil_debugfs_create_ioblob("blob_fw_code", S_IRUGO, dbg,
  519. &wil->fw_code_blob);
  520. wil->fw_data_blob.data = (void * __force)wil->csr + 0x80000;
  521. wil->fw_data_blob.size = 0x8000;
  522. wil_debugfs_create_ioblob("blob_fw_data", S_IRUGO, dbg,
  523. &wil->fw_data_blob);
  524. wil->fw_peri_blob.data = (void * __force)wil->csr + 0x88000;
  525. wil->fw_peri_blob.size = 0x18000;
  526. wil_debugfs_create_ioblob("blob_fw_peri", S_IRUGO, dbg,
  527. &wil->fw_peri_blob);
  528. wil->uc_code_blob.data = (void * __force)wil->csr + 0xa0000;
  529. wil->uc_code_blob.size = 0x10000;
  530. wil_debugfs_create_ioblob("blob_uc_code", S_IRUGO, dbg,
  531. &wil->uc_code_blob);
  532. wil->uc_data_blob.data = (void * __force)wil->csr + 0xb0000;
  533. wil->uc_data_blob.size = 0x4000;
  534. wil_debugfs_create_ioblob("blob_uc_data", S_IRUGO, dbg,
  535. &wil->uc_data_blob);
  536. return 0;
  537. }
  538. void wil6210_debugfs_remove(struct wil6210_priv *wil)
  539. {
  540. debugfs_remove_recursive(wil->debug);
  541. wil->debug = NULL;
  542. }