diff options
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx_wx.c')
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_wx.c | 107 |
1 files changed, 52 insertions, 55 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c index b45063974ae9..c35cb3a0777e 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c | |||
@@ -55,13 +55,13 @@ static int bcm43xx_wx_get_name(struct net_device *net_dev, | |||
55 | char *extra) | 55 | char *extra) |
56 | { | 56 | { |
57 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); | 57 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); |
58 | unsigned long flags; | ||
59 | int i; | 58 | int i; |
59 | unsigned long flags; | ||
60 | struct bcm43xx_phyinfo *phy; | 60 | struct bcm43xx_phyinfo *phy; |
61 | char suffix[7] = { 0 }; | 61 | char suffix[7] = { 0 }; |
62 | int have_a = 0, have_b = 0, have_g = 0; | 62 | int have_a = 0, have_b = 0, have_g = 0; |
63 | 63 | ||
64 | bcm43xx_lock(bcm, flags); | 64 | bcm43xx_lock_irqsafe(bcm, flags); |
65 | for (i = 0; i < bcm->nr_80211_available; i++) { | 65 | for (i = 0; i < bcm->nr_80211_available; i++) { |
66 | phy = &(bcm->core_80211_ext[i].phy); | 66 | phy = &(bcm->core_80211_ext[i].phy); |
67 | switch (phy->type) { | 67 | switch (phy->type) { |
@@ -77,7 +77,7 @@ static int bcm43xx_wx_get_name(struct net_device *net_dev, | |||
77 | assert(0); | 77 | assert(0); |
78 | } | 78 | } |
79 | } | 79 | } |
80 | bcm43xx_unlock(bcm, flags); | 80 | bcm43xx_unlock_irqsafe(bcm, flags); |
81 | 81 | ||
82 | i = 0; | 82 | i = 0; |
83 | if (have_a) { | 83 | if (have_a) { |
@@ -111,7 +111,7 @@ static int bcm43xx_wx_set_channelfreq(struct net_device *net_dev, | |||
111 | int freq; | 111 | int freq; |
112 | int err = -EINVAL; | 112 | int err = -EINVAL; |
113 | 113 | ||
114 | bcm43xx_lock_mmio(bcm, flags); | 114 | bcm43xx_lock_irqsafe(bcm, flags); |
115 | if ((data->freq.m >= 0) && (data->freq.m <= 1000)) { | 115 | if ((data->freq.m >= 0) && (data->freq.m <= 1000)) { |
116 | channel = data->freq.m; | 116 | channel = data->freq.m; |
117 | freq = bcm43xx_channel_to_freq(bcm, channel); | 117 | freq = bcm43xx_channel_to_freq(bcm, channel); |
@@ -121,7 +121,7 @@ static int bcm43xx_wx_set_channelfreq(struct net_device *net_dev, | |||
121 | } | 121 | } |
122 | if (!bcm43xx_is_valid_channel(bcm, channel)) | 122 | if (!bcm43xx_is_valid_channel(bcm, channel)) |
123 | goto out_unlock; | 123 | goto out_unlock; |
124 | if (bcm->initialized) { | 124 | if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED) { |
125 | //ieee80211softmac_disassoc(softmac, $REASON); | 125 | //ieee80211softmac_disassoc(softmac, $REASON); |
126 | bcm43xx_mac_suspend(bcm); | 126 | bcm43xx_mac_suspend(bcm); |
127 | err = bcm43xx_radio_selectchannel(bcm, channel, 0); | 127 | err = bcm43xx_radio_selectchannel(bcm, channel, 0); |
@@ -131,7 +131,7 @@ static int bcm43xx_wx_set_channelfreq(struct net_device *net_dev, | |||
131 | err = 0; | 131 | err = 0; |
132 | } | 132 | } |
133 | out_unlock: | 133 | out_unlock: |
134 | bcm43xx_unlock_mmio(bcm, flags); | 134 | bcm43xx_unlock_irqsafe(bcm, flags); |
135 | 135 | ||
136 | return err; | 136 | return err; |
137 | } | 137 | } |
@@ -147,11 +147,10 @@ static int bcm43xx_wx_get_channelfreq(struct net_device *net_dev, | |||
147 | int err = -ENODEV; | 147 | int err = -ENODEV; |
148 | u16 channel; | 148 | u16 channel; |
149 | 149 | ||
150 | bcm43xx_lock(bcm, flags); | 150 | bcm43xx_lock_irqsafe(bcm, flags); |
151 | radio = bcm43xx_current_radio(bcm); | 151 | radio = bcm43xx_current_radio(bcm); |
152 | channel = radio->channel; | 152 | channel = radio->channel; |
153 | if (channel == 0xFF) { | 153 | if (channel == 0xFF) { |
154 | assert(!bcm->initialized); | ||
155 | channel = radio->initial_channel; | 154 | channel = radio->initial_channel; |
156 | if (channel == 0xFF) | 155 | if (channel == 0xFF) |
157 | goto out_unlock; | 156 | goto out_unlock; |
@@ -163,7 +162,7 @@ static int bcm43xx_wx_get_channelfreq(struct net_device *net_dev, | |||
163 | 162 | ||
164 | err = 0; | 163 | err = 0; |
165 | out_unlock: | 164 | out_unlock: |
166 | bcm43xx_unlock(bcm, flags); | 165 | bcm43xx_unlock_irqsafe(bcm, flags); |
167 | 166 | ||
168 | return err; | 167 | return err; |
169 | } | 168 | } |
@@ -181,13 +180,13 @@ static int bcm43xx_wx_set_mode(struct net_device *net_dev, | |||
181 | if (mode == IW_MODE_AUTO) | 180 | if (mode == IW_MODE_AUTO) |
182 | mode = BCM43xx_INITIAL_IWMODE; | 181 | mode = BCM43xx_INITIAL_IWMODE; |
183 | 182 | ||
184 | bcm43xx_lock_mmio(bcm, flags); | 183 | bcm43xx_lock_irqsafe(bcm, flags); |
185 | if (bcm->initialized) { | 184 | if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED) { |
186 | if (bcm->ieee->iw_mode != mode) | 185 | if (bcm->ieee->iw_mode != mode) |
187 | bcm43xx_set_iwmode(bcm, mode); | 186 | bcm43xx_set_iwmode(bcm, mode); |
188 | } else | 187 | } else |
189 | bcm->ieee->iw_mode = mode; | 188 | bcm->ieee->iw_mode = mode; |
190 | bcm43xx_unlock_mmio(bcm, flags); | 189 | bcm43xx_unlock_irqsafe(bcm, flags); |
191 | 190 | ||
192 | return 0; | 191 | return 0; |
193 | } | 192 | } |
@@ -200,9 +199,9 @@ static int bcm43xx_wx_get_mode(struct net_device *net_dev, | |||
200 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); | 199 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); |
201 | unsigned long flags; | 200 | unsigned long flags; |
202 | 201 | ||
203 | bcm43xx_lock(bcm, flags); | 202 | bcm43xx_lock_irqsafe(bcm, flags); |
204 | data->mode = bcm->ieee->iw_mode; | 203 | data->mode = bcm->ieee->iw_mode; |
205 | bcm43xx_unlock(bcm, flags); | 204 | bcm43xx_unlock_irqsafe(bcm, flags); |
206 | 205 | ||
207 | return 0; | 206 | return 0; |
208 | } | 207 | } |
@@ -255,7 +254,7 @@ static int bcm43xx_wx_get_rangeparams(struct net_device *net_dev, | |||
255 | IW_ENC_CAPA_CIPHER_TKIP | | 254 | IW_ENC_CAPA_CIPHER_TKIP | |
256 | IW_ENC_CAPA_CIPHER_CCMP; | 255 | IW_ENC_CAPA_CIPHER_CCMP; |
257 | 256 | ||
258 | bcm43xx_lock(bcm, flags); | 257 | bcm43xx_lock_irqsafe(bcm, flags); |
259 | phy = bcm43xx_current_phy(bcm); | 258 | phy = bcm43xx_current_phy(bcm); |
260 | 259 | ||
261 | range->num_bitrates = 0; | 260 | range->num_bitrates = 0; |
@@ -302,7 +301,7 @@ static int bcm43xx_wx_get_rangeparams(struct net_device *net_dev, | |||
302 | } | 301 | } |
303 | range->num_frequency = j; | 302 | range->num_frequency = j; |
304 | 303 | ||
305 | bcm43xx_unlock(bcm, flags); | 304 | bcm43xx_unlock_irqsafe(bcm, flags); |
306 | 305 | ||
307 | return 0; | 306 | return 0; |
308 | } | 307 | } |
@@ -313,14 +312,13 @@ static int bcm43xx_wx_set_nick(struct net_device *net_dev, | |||
313 | char *extra) | 312 | char *extra) |
314 | { | 313 | { |
315 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); | 314 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); |
316 | unsigned long flags; | ||
317 | size_t len; | 315 | size_t len; |
318 | 316 | ||
319 | bcm43xx_lock(bcm, flags); | 317 | bcm43xx_lock_noirq(bcm); |
320 | len = min((size_t)data->data.length, (size_t)IW_ESSID_MAX_SIZE); | 318 | len = min((size_t)data->data.length, (size_t)IW_ESSID_MAX_SIZE); |
321 | memcpy(bcm->nick, extra, len); | 319 | memcpy(bcm->nick, extra, len); |
322 | bcm->nick[len] = '\0'; | 320 | bcm->nick[len] = '\0'; |
323 | bcm43xx_unlock(bcm, flags); | 321 | bcm43xx_unlock_noirq(bcm); |
324 | 322 | ||
325 | return 0; | 323 | return 0; |
326 | } | 324 | } |
@@ -331,15 +329,14 @@ static int bcm43xx_wx_get_nick(struct net_device *net_dev, | |||
331 | char *extra) | 329 | char *extra) |
332 | { | 330 | { |
333 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); | 331 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); |
334 | unsigned long flags; | ||
335 | size_t len; | 332 | size_t len; |
336 | 333 | ||
337 | bcm43xx_lock(bcm, flags); | 334 | bcm43xx_lock_noirq(bcm); |
338 | len = strlen(bcm->nick) + 1; | 335 | len = strlen(bcm->nick) + 1; |
339 | memcpy(extra, bcm->nick, len); | 336 | memcpy(extra, bcm->nick, len); |
340 | data->data.length = (__u16)len; | 337 | data->data.length = (__u16)len; |
341 | data->data.flags = 1; | 338 | data->data.flags = 1; |
342 | bcm43xx_unlock(bcm, flags); | 339 | bcm43xx_unlock_noirq(bcm); |
343 | 340 | ||
344 | return 0; | 341 | return 0; |
345 | } | 342 | } |
@@ -353,7 +350,7 @@ static int bcm43xx_wx_set_rts(struct net_device *net_dev, | |||
353 | unsigned long flags; | 350 | unsigned long flags; |
354 | int err = -EINVAL; | 351 | int err = -EINVAL; |
355 | 352 | ||
356 | bcm43xx_lock(bcm, flags); | 353 | bcm43xx_lock_irqsafe(bcm, flags); |
357 | if (data->rts.disabled) { | 354 | if (data->rts.disabled) { |
358 | bcm->rts_threshold = BCM43xx_MAX_RTS_THRESHOLD; | 355 | bcm->rts_threshold = BCM43xx_MAX_RTS_THRESHOLD; |
359 | err = 0; | 356 | err = 0; |
@@ -364,7 +361,7 @@ static int bcm43xx_wx_set_rts(struct net_device *net_dev, | |||
364 | err = 0; | 361 | err = 0; |
365 | } | 362 | } |
366 | } | 363 | } |
367 | bcm43xx_unlock(bcm, flags); | 364 | bcm43xx_unlock_irqsafe(bcm, flags); |
368 | 365 | ||
369 | return err; | 366 | return err; |
370 | } | 367 | } |
@@ -377,11 +374,11 @@ static int bcm43xx_wx_get_rts(struct net_device *net_dev, | |||
377 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); | 374 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); |
378 | unsigned long flags; | 375 | unsigned long flags; |
379 | 376 | ||
380 | bcm43xx_lock(bcm, flags); | 377 | bcm43xx_lock_irqsafe(bcm, flags); |
381 | data->rts.value = bcm->rts_threshold; | 378 | data->rts.value = bcm->rts_threshold; |
382 | data->rts.fixed = 0; | 379 | data->rts.fixed = 0; |
383 | data->rts.disabled = (bcm->rts_threshold == BCM43xx_MAX_RTS_THRESHOLD); | 380 | data->rts.disabled = (bcm->rts_threshold == BCM43xx_MAX_RTS_THRESHOLD); |
384 | bcm43xx_unlock(bcm, flags); | 381 | bcm43xx_unlock_irqsafe(bcm, flags); |
385 | 382 | ||
386 | return 0; | 383 | return 0; |
387 | } | 384 | } |
@@ -395,7 +392,7 @@ static int bcm43xx_wx_set_frag(struct net_device *net_dev, | |||
395 | unsigned long flags; | 392 | unsigned long flags; |
396 | int err = -EINVAL; | 393 | int err = -EINVAL; |
397 | 394 | ||
398 | bcm43xx_lock(bcm, flags); | 395 | bcm43xx_lock_irqsafe(bcm, flags); |
399 | if (data->frag.disabled) { | 396 | if (data->frag.disabled) { |
400 | bcm->ieee->fts = MAX_FRAG_THRESHOLD; | 397 | bcm->ieee->fts = MAX_FRAG_THRESHOLD; |
401 | err = 0; | 398 | err = 0; |
@@ -406,7 +403,7 @@ static int bcm43xx_wx_set_frag(struct net_device *net_dev, | |||
406 | err = 0; | 403 | err = 0; |
407 | } | 404 | } |
408 | } | 405 | } |
409 | bcm43xx_unlock(bcm, flags); | 406 | bcm43xx_unlock_irqsafe(bcm, flags); |
410 | 407 | ||
411 | return err; | 408 | return err; |
412 | } | 409 | } |
@@ -419,11 +416,11 @@ static int bcm43xx_wx_get_frag(struct net_device *net_dev, | |||
419 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); | 416 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); |
420 | unsigned long flags; | 417 | unsigned long flags; |
421 | 418 | ||
422 | bcm43xx_lock(bcm, flags); | 419 | bcm43xx_lock_irqsafe(bcm, flags); |
423 | data->frag.value = bcm->ieee->fts; | 420 | data->frag.value = bcm->ieee->fts; |
424 | data->frag.fixed = 0; | 421 | data->frag.fixed = 0; |
425 | data->frag.disabled = (bcm->ieee->fts == MAX_FRAG_THRESHOLD); | 422 | data->frag.disabled = (bcm->ieee->fts == MAX_FRAG_THRESHOLD); |
426 | bcm43xx_unlock(bcm, flags); | 423 | bcm43xx_unlock_irqsafe(bcm, flags); |
427 | 424 | ||
428 | return 0; | 425 | return 0; |
429 | } | 426 | } |
@@ -445,8 +442,8 @@ static int bcm43xx_wx_set_xmitpower(struct net_device *net_dev, | |||
445 | return -EOPNOTSUPP; | 442 | return -EOPNOTSUPP; |
446 | } | 443 | } |
447 | 444 | ||
448 | bcm43xx_lock_mmio(bcm, flags); | 445 | bcm43xx_lock_irqsafe(bcm, flags); |
449 | if (!bcm->initialized) | 446 | if (bcm43xx_status(bcm) != BCM43xx_STAT_INITIALIZED) |
450 | goto out_unlock; | 447 | goto out_unlock; |
451 | radio = bcm43xx_current_radio(bcm); | 448 | radio = bcm43xx_current_radio(bcm); |
452 | phy = bcm43xx_current_phy(bcm); | 449 | phy = bcm43xx_current_phy(bcm); |
@@ -469,7 +466,7 @@ static int bcm43xx_wx_set_xmitpower(struct net_device *net_dev, | |||
469 | err = 0; | 466 | err = 0; |
470 | 467 | ||
471 | out_unlock: | 468 | out_unlock: |
472 | bcm43xx_unlock_mmio(bcm, flags); | 469 | bcm43xx_unlock_irqsafe(bcm, flags); |
473 | 470 | ||
474 | return err; | 471 | return err; |
475 | } | 472 | } |
@@ -484,8 +481,8 @@ static int bcm43xx_wx_get_xmitpower(struct net_device *net_dev, | |||
484 | unsigned long flags; | 481 | unsigned long flags; |
485 | int err = -ENODEV; | 482 | int err = -ENODEV; |
486 | 483 | ||
487 | bcm43xx_lock(bcm, flags); | 484 | bcm43xx_lock_irqsafe(bcm, flags); |
488 | if (!bcm->initialized) | 485 | if (bcm43xx_status(bcm) != BCM43xx_STAT_INITIALIZED) |
489 | goto out_unlock; | 486 | goto out_unlock; |
490 | radio = bcm43xx_current_radio(bcm); | 487 | radio = bcm43xx_current_radio(bcm); |
491 | /* desired dBm value is in Q5.2 */ | 488 | /* desired dBm value is in Q5.2 */ |
@@ -496,7 +493,7 @@ static int bcm43xx_wx_get_xmitpower(struct net_device *net_dev, | |||
496 | 493 | ||
497 | err = 0; | 494 | err = 0; |
498 | out_unlock: | 495 | out_unlock: |
499 | bcm43xx_unlock(bcm, flags); | 496 | bcm43xx_unlock_irqsafe(bcm, flags); |
500 | 497 | ||
501 | return err; | 498 | return err; |
502 | } | 499 | } |
@@ -583,8 +580,8 @@ static int bcm43xx_wx_set_interfmode(struct net_device *net_dev, | |||
583 | return -EINVAL; | 580 | return -EINVAL; |
584 | } | 581 | } |
585 | 582 | ||
586 | bcm43xx_lock_mmio(bcm, flags); | 583 | bcm43xx_lock_irqsafe(bcm, flags); |
587 | if (bcm->initialized) { | 584 | if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED) { |
588 | err = bcm43xx_radio_set_interference_mitigation(bcm, mode); | 585 | err = bcm43xx_radio_set_interference_mitigation(bcm, mode); |
589 | if (err) { | 586 | if (err) { |
590 | printk(KERN_ERR PFX "Interference Mitigation not " | 587 | printk(KERN_ERR PFX "Interference Mitigation not " |
@@ -598,7 +595,7 @@ static int bcm43xx_wx_set_interfmode(struct net_device *net_dev, | |||
598 | } else | 595 | } else |
599 | bcm43xx_current_radio(bcm)->interfmode = mode; | 596 | bcm43xx_current_radio(bcm)->interfmode = mode; |
600 | } | 597 | } |
601 | bcm43xx_unlock_mmio(bcm, flags); | 598 | bcm43xx_unlock_irqsafe(bcm, flags); |
602 | 599 | ||
603 | return err; | 600 | return err; |
604 | } | 601 | } |
@@ -612,9 +609,9 @@ static int bcm43xx_wx_get_interfmode(struct net_device *net_dev, | |||
612 | unsigned long flags; | 609 | unsigned long flags; |
613 | int mode; | 610 | int mode; |
614 | 611 | ||
615 | bcm43xx_lock(bcm, flags); | 612 | bcm43xx_lock_irqsafe(bcm, flags); |
616 | mode = bcm43xx_current_radio(bcm)->interfmode; | 613 | mode = bcm43xx_current_radio(bcm)->interfmode; |
617 | bcm43xx_unlock(bcm, flags); | 614 | bcm43xx_unlock_irqsafe(bcm, flags); |
618 | 615 | ||
619 | switch (mode) { | 616 | switch (mode) { |
620 | case BCM43xx_RADIO_INTERFMODE_NONE: | 617 | case BCM43xx_RADIO_INTERFMODE_NONE: |
@@ -644,9 +641,9 @@ static int bcm43xx_wx_set_shortpreamble(struct net_device *net_dev, | |||
644 | int on; | 641 | int on; |
645 | 642 | ||
646 | on = *((int *)extra); | 643 | on = *((int *)extra); |
647 | bcm43xx_lock(bcm, flags); | 644 | bcm43xx_lock_irqsafe(bcm, flags); |
648 | bcm->short_preamble = !!on; | 645 | bcm->short_preamble = !!on; |
649 | bcm43xx_unlock(bcm, flags); | 646 | bcm43xx_unlock_irqsafe(bcm, flags); |
650 | 647 | ||
651 | return 0; | 648 | return 0; |
652 | } | 649 | } |
@@ -660,9 +657,9 @@ static int bcm43xx_wx_get_shortpreamble(struct net_device *net_dev, | |||
660 | unsigned long flags; | 657 | unsigned long flags; |
661 | int on; | 658 | int on; |
662 | 659 | ||
663 | bcm43xx_lock(bcm, flags); | 660 | bcm43xx_lock_irqsafe(bcm, flags); |
664 | on = bcm->short_preamble; | 661 | on = bcm->short_preamble; |
665 | bcm43xx_unlock(bcm, flags); | 662 | bcm43xx_unlock_irqsafe(bcm, flags); |
666 | 663 | ||
667 | if (on) | 664 | if (on) |
668 | strncpy(extra, "1 (Short Preamble enabled)", MAX_WX_STRING); | 665 | strncpy(extra, "1 (Short Preamble enabled)", MAX_WX_STRING); |
@@ -684,11 +681,11 @@ static int bcm43xx_wx_set_swencryption(struct net_device *net_dev, | |||
684 | 681 | ||
685 | on = *((int *)extra); | 682 | on = *((int *)extra); |
686 | 683 | ||
687 | bcm43xx_lock(bcm, flags); | 684 | bcm43xx_lock_irqsafe(bcm, flags); |
688 | bcm->ieee->host_encrypt = !!on; | 685 | bcm->ieee->host_encrypt = !!on; |
689 | bcm->ieee->host_decrypt = !!on; | 686 | bcm->ieee->host_decrypt = !!on; |
690 | bcm->ieee->host_build_iv = !on; | 687 | bcm->ieee->host_build_iv = !on; |
691 | bcm43xx_unlock(bcm, flags); | 688 | bcm43xx_unlock_irqsafe(bcm, flags); |
692 | 689 | ||
693 | return 0; | 690 | return 0; |
694 | } | 691 | } |
@@ -702,9 +699,9 @@ static int bcm43xx_wx_get_swencryption(struct net_device *net_dev, | |||
702 | unsigned long flags; | 699 | unsigned long flags; |
703 | int on; | 700 | int on; |
704 | 701 | ||
705 | bcm43xx_lock(bcm, flags); | 702 | bcm43xx_lock_irqsafe(bcm, flags); |
706 | on = bcm->ieee->host_encrypt; | 703 | on = bcm->ieee->host_encrypt; |
707 | bcm43xx_unlock(bcm, flags); | 704 | bcm43xx_unlock_irqsafe(bcm, flags); |
708 | 705 | ||
709 | if (on) | 706 | if (on) |
710 | strncpy(extra, "1 (SW encryption enabled) ", MAX_WX_STRING); | 707 | strncpy(extra, "1 (SW encryption enabled) ", MAX_WX_STRING); |
@@ -767,11 +764,11 @@ static int bcm43xx_wx_sprom_read(struct net_device *net_dev, | |||
767 | if (!sprom) | 764 | if (!sprom) |
768 | goto out; | 765 | goto out; |
769 | 766 | ||
770 | bcm43xx_lock_mmio(bcm, flags); | 767 | bcm43xx_lock_irqsafe(bcm, flags); |
771 | err = -ENODEV; | 768 | err = -ENODEV; |
772 | if (bcm->initialized) | 769 | if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED) |
773 | err = bcm43xx_sprom_read(bcm, sprom); | 770 | err = bcm43xx_sprom_read(bcm, sprom); |
774 | bcm43xx_unlock_mmio(bcm, flags); | 771 | bcm43xx_unlock_irqsafe(bcm, flags); |
775 | if (!err) | 772 | if (!err) |
776 | data->data.length = sprom2hex(sprom, extra); | 773 | data->data.length = sprom2hex(sprom, extra); |
777 | kfree(sprom); | 774 | kfree(sprom); |
@@ -812,11 +809,11 @@ static int bcm43xx_wx_sprom_write(struct net_device *net_dev, | |||
812 | if (err) | 809 | if (err) |
813 | goto out_kfree; | 810 | goto out_kfree; |
814 | 811 | ||
815 | bcm43xx_lock_mmio(bcm, flags); | 812 | bcm43xx_lock_irqsafe(bcm, flags); |
816 | err = -ENODEV; | 813 | err = -ENODEV; |
817 | if (bcm->initialized) | 814 | if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED) |
818 | err = bcm43xx_sprom_write(bcm, sprom); | 815 | err = bcm43xx_sprom_write(bcm, sprom); |
819 | bcm43xx_unlock_mmio(bcm, flags); | 816 | bcm43xx_unlock_irqsafe(bcm, flags); |
820 | out_kfree: | 817 | out_kfree: |
821 | kfree(sprom); | 818 | kfree(sprom); |
822 | out: | 819 | out: |