aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_dfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_dfs.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_dfs.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/scsi/qla2xxx/qla_dfs.c b/drivers/scsi/qla2xxx/qla_dfs.c
index 561a4411719d..0e366a1b44b3 100644
--- a/drivers/scsi/qla2xxx/qla_dfs.c
+++ b/drivers/scsi/qla2xxx/qla_dfs.c
@@ -15,10 +15,11 @@ static atomic_t qla2x00_dfs_root_count;
15static int 15static int
16qla2x00_dfs_fce_show(struct seq_file *s, void *unused) 16qla2x00_dfs_fce_show(struct seq_file *s, void *unused)
17{ 17{
18 scsi_qla_host_t *ha = s->private; 18 scsi_qla_host_t *vha = s->private;
19 uint32_t cnt; 19 uint32_t cnt;
20 uint32_t *fce; 20 uint32_t *fce;
21 uint64_t fce_start; 21 uint64_t fce_start;
22 struct qla_hw_data *ha = vha->hw;
22 23
23 mutex_lock(&ha->fce_mutex); 24 mutex_lock(&ha->fce_mutex);
24 25
@@ -51,7 +52,8 @@ qla2x00_dfs_fce_show(struct seq_file *s, void *unused)
51static int 52static int
52qla2x00_dfs_fce_open(struct inode *inode, struct file *file) 53qla2x00_dfs_fce_open(struct inode *inode, struct file *file)
53{ 54{
54 scsi_qla_host_t *ha = inode->i_private; 55 scsi_qla_host_t *vha = inode->i_private;
56 struct qla_hw_data *ha = vha->hw;
55 int rval; 57 int rval;
56 58
57 if (!ha->flags.fce_enabled) 59 if (!ha->flags.fce_enabled)
@@ -60,7 +62,7 @@ qla2x00_dfs_fce_open(struct inode *inode, struct file *file)
60 mutex_lock(&ha->fce_mutex); 62 mutex_lock(&ha->fce_mutex);
61 63
62 /* Pause tracing to flush FCE buffers. */ 64 /* Pause tracing to flush FCE buffers. */
63 rval = qla2x00_disable_fce_trace(ha, &ha->fce_wr, &ha->fce_rd); 65 rval = qla2x00_disable_fce_trace(vha, &ha->fce_wr, &ha->fce_rd);
64 if (rval) 66 if (rval)
65 qla_printk(KERN_WARNING, ha, 67 qla_printk(KERN_WARNING, ha,
66 "DebugFS: Unable to disable FCE (%d).\n", rval); 68 "DebugFS: Unable to disable FCE (%d).\n", rval);
@@ -75,7 +77,8 @@ out:
75static int 77static int
76qla2x00_dfs_fce_release(struct inode *inode, struct file *file) 78qla2x00_dfs_fce_release(struct inode *inode, struct file *file)
77{ 79{
78 scsi_qla_host_t *ha = inode->i_private; 80 scsi_qla_host_t *vha = inode->i_private;
81 struct qla_hw_data *ha = vha->hw;
79 int rval; 82 int rval;
80 83
81 if (ha->flags.fce_enabled) 84 if (ha->flags.fce_enabled)
@@ -86,7 +89,7 @@ qla2x00_dfs_fce_release(struct inode *inode, struct file *file)
86 /* Re-enable FCE tracing. */ 89 /* Re-enable FCE tracing. */
87 ha->flags.fce_enabled = 1; 90 ha->flags.fce_enabled = 1;
88 memset(ha->fce, 0, fce_calc_size(ha->fce_bufs)); 91 memset(ha->fce, 0, fce_calc_size(ha->fce_bufs));
89 rval = qla2x00_enable_fce_trace(ha, ha->fce_dma, ha->fce_bufs, 92 rval = qla2x00_enable_fce_trace(vha, ha->fce_dma, ha->fce_bufs,
90 ha->fce_mb, &ha->fce_bufs); 93 ha->fce_mb, &ha->fce_bufs);
91 if (rval) { 94 if (rval) {
92 qla_printk(KERN_WARNING, ha, 95 qla_printk(KERN_WARNING, ha,
@@ -107,8 +110,9 @@ static const struct file_operations dfs_fce_ops = {
107}; 110};
108 111
109int 112int
110qla2x00_dfs_setup(scsi_qla_host_t *ha) 113qla2x00_dfs_setup(scsi_qla_host_t *vha)
111{ 114{
115 struct qla_hw_data *ha = vha->hw;
112 if (!IS_QLA25XX(ha)) 116 if (!IS_QLA25XX(ha))
113 goto out; 117 goto out;
114 if (!ha->fce) 118 if (!ha->fce)
@@ -130,7 +134,7 @@ create_dir:
130 goto create_nodes; 134 goto create_nodes;
131 135
132 mutex_init(&ha->fce_mutex); 136 mutex_init(&ha->fce_mutex);
133 ha->dfs_dir = debugfs_create_dir(ha->host_str, qla2x00_dfs_root); 137 ha->dfs_dir = debugfs_create_dir(vha->host_str, qla2x00_dfs_root);
134 if (!ha->dfs_dir) { 138 if (!ha->dfs_dir) {
135 qla_printk(KERN_NOTICE, ha, 139 qla_printk(KERN_NOTICE, ha,
136 "DebugFS: Unable to create ha directory.\n"); 140 "DebugFS: Unable to create ha directory.\n");
@@ -152,8 +156,9 @@ out:
152} 156}
153 157
154int 158int
155qla2x00_dfs_remove(scsi_qla_host_t *ha) 159qla2x00_dfs_remove(scsi_qla_host_t *vha)
156{ 160{
161 struct qla_hw_data *ha = vha->hw;
157 if (ha->dfs_fce) { 162 if (ha->dfs_fce) {
158 debugfs_remove(ha->dfs_fce); 163 debugfs_remove(ha->dfs_fce);
159 ha->dfs_fce = NULL; 164 ha->dfs_fce = NULL;