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