| .. | .. |
|---|
| 11 | 11 | #include <linux/module.h> |
|---|
| 12 | 12 | #include <linux/pci.h> |
|---|
| 13 | 13 | #include "bnxt_hsi.h" |
|---|
| 14 | | -#include <linux/net_dim.h> |
|---|
| 14 | +#include <linux/dim.h> |
|---|
| 15 | 15 | #include "bnxt.h" |
|---|
| 16 | 16 | #include "bnxt_debugfs.h" |
|---|
| 17 | 17 | |
|---|
| .. | .. |
|---|
| 21 | 21 | char __user *buffer, |
|---|
| 22 | 22 | size_t count, loff_t *ppos) |
|---|
| 23 | 23 | { |
|---|
| 24 | | - struct net_dim *dim = filep->private_data; |
|---|
| 24 | + struct dim *dim = filep->private_data; |
|---|
| 25 | 25 | int len; |
|---|
| 26 | 26 | char *buf; |
|---|
| 27 | 27 | |
|---|
| .. | .. |
|---|
| 61 | 61 | .read = debugfs_dim_read, |
|---|
| 62 | 62 | }; |
|---|
| 63 | 63 | |
|---|
| 64 | | -static struct dentry *debugfs_dim_ring_init(struct net_dim *dim, int ring_idx, |
|---|
| 65 | | - struct dentry *dd) |
|---|
| 64 | +static void debugfs_dim_ring_init(struct dim *dim, int ring_idx, |
|---|
| 65 | + struct dentry *dd) |
|---|
| 66 | 66 | { |
|---|
| 67 | 67 | static char qname[16]; |
|---|
| 68 | 68 | |
|---|
| 69 | 69 | snprintf(qname, 10, "%d", ring_idx); |
|---|
| 70 | | - return debugfs_create_file(qname, 0600, dd, |
|---|
| 71 | | - dim, &debugfs_dim_fops); |
|---|
| 70 | + debugfs_create_file(qname, 0600, dd, dim, &debugfs_dim_fops); |
|---|
| 72 | 71 | } |
|---|
| 73 | 72 | |
|---|
| 74 | 73 | void bnxt_debug_dev_init(struct bnxt *bp) |
|---|
| 75 | 74 | { |
|---|
| 76 | 75 | const char *pname = pci_name(bp->pdev); |
|---|
| 77 | | - struct dentry *pdevf; |
|---|
| 76 | + struct dentry *dir; |
|---|
| 78 | 77 | int i; |
|---|
| 79 | 78 | |
|---|
| 80 | 79 | bp->debugfs_pdev = debugfs_create_dir(pname, bnxt_debug_mnt); |
|---|
| 81 | | - if (bp->debugfs_pdev) { |
|---|
| 82 | | - pdevf = debugfs_create_dir("dim", bp->debugfs_pdev); |
|---|
| 83 | | - if (!pdevf) { |
|---|
| 84 | | - pr_err("failed to create debugfs entry %s/dim\n", |
|---|
| 85 | | - pname); |
|---|
| 86 | | - return; |
|---|
| 87 | | - } |
|---|
| 88 | | - bp->debugfs_dim = pdevf; |
|---|
| 89 | | - /* create files for each rx ring */ |
|---|
| 90 | | - for (i = 0; i < bp->cp_nr_rings; i++) { |
|---|
| 91 | | - struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring; |
|---|
| 80 | + dir = debugfs_create_dir("dim", bp->debugfs_pdev); |
|---|
| 92 | 81 | |
|---|
| 93 | | - if (cpr && bp->bnapi[i]->rx_ring) { |
|---|
| 94 | | - pdevf = debugfs_dim_ring_init(&cpr->dim, i, |
|---|
| 95 | | - bp->debugfs_dim); |
|---|
| 96 | | - if (!pdevf) |
|---|
| 97 | | - pr_err("failed to create debugfs entry %s/dim/%d\n", |
|---|
| 98 | | - pname, i); |
|---|
| 99 | | - } |
|---|
| 100 | | - } |
|---|
| 101 | | - } else { |
|---|
| 102 | | - pr_err("failed to create debugfs entry %s\n", pname); |
|---|
| 82 | + /* create files for each rx ring */ |
|---|
| 83 | + for (i = 0; i < bp->cp_nr_rings; i++) { |
|---|
| 84 | + struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring; |
|---|
| 85 | + |
|---|
| 86 | + if (cpr && bp->bnapi[i]->rx_ring) |
|---|
| 87 | + debugfs_dim_ring_init(&cpr->dim, i, dir); |
|---|
| 103 | 88 | } |
|---|
| 104 | 89 | } |
|---|
| 105 | 90 | |
|---|
| .. | .. |
|---|
| 114 | 99 | void bnxt_debug_init(void) |
|---|
| 115 | 100 | { |
|---|
| 116 | 101 | bnxt_debug_mnt = debugfs_create_dir("bnxt_en", NULL); |
|---|
| 117 | | - if (!bnxt_debug_mnt) |
|---|
| 118 | | - pr_err("failed to init bnxt_en debugfs\n"); |
|---|
| 119 | 102 | } |
|---|
| 120 | 103 | |
|---|
| 121 | 104 | void bnxt_debug_exit(void) |
|---|