aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c')
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c b/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c
index 2d31737372fd..713ec601c342 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c
@@ -88,7 +88,7 @@ static ssize_t bcm43xx_attr_sprom_show(struct device *dev,
88 GFP_KERNEL); 88 GFP_KERNEL);
89 if (!sprom) 89 if (!sprom)
90 return -ENOMEM; 90 return -ENOMEM;
91 spin_lock_irqsave(&bcm->lock, flags); 91 bcm43xx_lock_mmio(bcm, flags);
92 assert(bcm->initialized); 92 assert(bcm->initialized);
93 err = bcm43xx_sprom_read(bcm, sprom); 93 err = bcm43xx_sprom_read(bcm, sprom);
94 if (!err) { 94 if (!err) {
@@ -97,7 +97,7 @@ static ssize_t bcm43xx_attr_sprom_show(struct device *dev,
97 buf[i * 2 + 1] = (sprom[i] & 0xFF00) >> 8; 97 buf[i * 2 + 1] = (sprom[i] & 0xFF00) >> 8;
98 } 98 }
99 } 99 }
100 spin_unlock_irqrestore(&bcm->lock, flags); 100 bcm43xx_unlock_mmio(bcm, flags);
101 kfree(sprom); 101 kfree(sprom);
102 102
103 return err ? err : BCM43xx_SPROM_SIZE * sizeof(u16); 103 return err ? err : BCM43xx_SPROM_SIZE * sizeof(u16);
@@ -125,10 +125,10 @@ static ssize_t bcm43xx_attr_sprom_store(struct device *dev,
125 sprom[i] = buf[i * 2] & 0xFF; 125 sprom[i] = buf[i * 2] & 0xFF;
126 sprom[i] |= ((u16)(buf[i * 2 + 1] & 0xFF)) << 8; 126 sprom[i] |= ((u16)(buf[i * 2 + 1] & 0xFF)) << 8;
127 } 127 }
128 spin_lock_irqsave(&bcm->lock, flags); 128 bcm43xx_lock_mmio(bcm, flags);
129 assert(bcm->initialized); 129 assert(bcm->initialized);
130 err = bcm43xx_sprom_write(bcm, sprom); 130 err = bcm43xx_sprom_write(bcm, sprom);
131 spin_unlock_irqrestore(&bcm->lock, flags); 131 bcm43xx_unlock_mmio(bcm, flags);
132 kfree(sprom); 132 kfree(sprom);
133 133
134 return err ? err : count; 134 return err ? err : count;
@@ -147,7 +147,7 @@ static ssize_t bcm43xx_attr_interfmode_show(struct device *dev,
147 if (!capable(CAP_NET_ADMIN)) 147 if (!capable(CAP_NET_ADMIN))
148 return -EPERM; 148 return -EPERM;
149 149
150 spin_lock_irqsave(&bcm->lock, flags); 150 bcm43xx_lock(bcm, flags);
151 assert(bcm->initialized); 151 assert(bcm->initialized);
152 152
153 switch (bcm->current_core->radio->interfmode) { 153 switch (bcm->current_core->radio->interfmode) {
@@ -165,7 +165,8 @@ static ssize_t bcm43xx_attr_interfmode_show(struct device *dev,
165 } 165 }
166 err = 0; 166 err = 0;
167 167
168 spin_unlock_irqrestore(&bcm->lock, flags); 168 bcm43xx_unlock(bcm, flags);
169
169 return err ? err : count; 170 return err ? err : count;
170 171
171} 172}
@@ -200,7 +201,7 @@ static ssize_t bcm43xx_attr_interfmode_store(struct device *dev,
200 return -EINVAL; 201 return -EINVAL;
201 } 202 }
202 203
203 spin_lock_irqsave(&bcm->lock, flags); 204 bcm43xx_lock_mmio(bcm, flags);
204 assert(bcm->initialized); 205 assert(bcm->initialized);
205 206
206 err = bcm43xx_radio_set_interference_mitigation(bcm, mode); 207 err = bcm43xx_radio_set_interference_mitigation(bcm, mode);
@@ -209,7 +210,7 @@ static ssize_t bcm43xx_attr_interfmode_store(struct device *dev,
209 "supported by device\n"); 210 "supported by device\n");
210 } 211 }
211 212
212 spin_unlock_irqrestore(&bcm->lock, flags); 213 bcm43xx_unlock_mmio(bcm, flags);
213 214
214 return err ? err : count; 215 return err ? err : count;
215} 216}
@@ -226,7 +227,7 @@ static ssize_t bcm43xx_attr_preamble_show(struct device *dev,
226 if (!capable(CAP_NET_ADMIN)) 227 if (!capable(CAP_NET_ADMIN))
227 return -EPERM; 228 return -EPERM;
228 229
229 spin_lock_irqsave(&bcm->lock, flags); 230 bcm43xx_lock(bcm, flags);
230 assert(bcm->initialized); 231 assert(bcm->initialized);
231 232
232 if (bcm->short_preamble) 233 if (bcm->short_preamble)
@@ -235,7 +236,7 @@ static ssize_t bcm43xx_attr_preamble_show(struct device *dev,
235 count = snprintf(buf, PAGE_SIZE, "0 (Short Preamble disabled)\n"); 236 count = snprintf(buf, PAGE_SIZE, "0 (Short Preamble disabled)\n");
236 237
237 err = 0; 238 err = 0;
238 spin_unlock_irqrestore(&bcm->lock, flags); 239 bcm43xx_unlock(bcm, flags);
239 240
240 return err ? err : count; 241 return err ? err : count;
241} 242}
@@ -255,13 +256,13 @@ static ssize_t bcm43xx_attr_preamble_store(struct device *dev,
255 value = get_boolean(buf, count); 256 value = get_boolean(buf, count);
256 if (value < 0) 257 if (value < 0)
257 return value; 258 return value;
258 spin_lock_irqsave(&bcm->lock, flags); 259 bcm43xx_lock(bcm, flags);
259 assert(bcm->initialized); 260 assert(bcm->initialized);
260 261
261 bcm->short_preamble = !!value; 262 bcm->short_preamble = !!value;
262 263
263 err = 0; 264 err = 0;
264 spin_unlock_irqrestore(&bcm->lock, flags); 265 bcm43xx_unlock(bcm, flags);
265 266
266 return err ? err : count; 267 return err ? err : count;
267} 268}