diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00mac.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00mac.c | 88 |
1 files changed, 38 insertions, 50 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index c41a0b9e473d..c4c06b4e1f08 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -390,56 +390,6 @@ int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed) | |||
390 | } | 390 | } |
391 | EXPORT_SYMBOL_GPL(rt2x00mac_config); | 391 | EXPORT_SYMBOL_GPL(rt2x00mac_config); |
392 | 392 | ||
393 | int rt2x00mac_config_interface(struct ieee80211_hw *hw, | ||
394 | struct ieee80211_vif *vif, | ||
395 | struct ieee80211_if_conf *conf) | ||
396 | { | ||
397 | struct rt2x00_dev *rt2x00dev = hw->priv; | ||
398 | struct rt2x00_intf *intf = vif_to_intf(vif); | ||
399 | int update_bssid = 0; | ||
400 | int status = 0; | ||
401 | |||
402 | /* | ||
403 | * Mac80211 might be calling this function while we are trying | ||
404 | * to remove the device or perhaps suspending it. | ||
405 | */ | ||
406 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) | ||
407 | return 0; | ||
408 | |||
409 | spin_lock(&intf->lock); | ||
410 | |||
411 | /* | ||
412 | * conf->bssid can be NULL if coming from the internal | ||
413 | * beacon update routine. | ||
414 | */ | ||
415 | if (conf->changed & IEEE80211_IFCC_BSSID && conf->bssid) { | ||
416 | update_bssid = 1; | ||
417 | memcpy(&intf->bssid, conf->bssid, ETH_ALEN); | ||
418 | } | ||
419 | |||
420 | spin_unlock(&intf->lock); | ||
421 | |||
422 | /* | ||
423 | * Call rt2x00_config_intf() outside of the spinlock context since | ||
424 | * the call will sleep for USB drivers. By using the ieee80211_if_conf | ||
425 | * values as arguments we make keep access to rt2x00_intf thread safe | ||
426 | * even without the lock. | ||
427 | */ | ||
428 | rt2x00lib_config_intf(rt2x00dev, intf, vif->type, NULL, | ||
429 | update_bssid ? conf->bssid : NULL); | ||
430 | |||
431 | /* | ||
432 | * Update the beacon. | ||
433 | */ | ||
434 | if (conf->changed & (IEEE80211_IFCC_BEACON | | ||
435 | IEEE80211_IFCC_BEACON_ENABLED)) | ||
436 | status = rt2x00queue_update_beacon(rt2x00dev, vif, | ||
437 | conf->enable_beacon); | ||
438 | |||
439 | return status; | ||
440 | } | ||
441 | EXPORT_SYMBOL_GPL(rt2x00mac_config_interface); | ||
442 | |||
443 | void rt2x00mac_configure_filter(struct ieee80211_hw *hw, | 393 | void rt2x00mac_configure_filter(struct ieee80211_hw *hw, |
444 | unsigned int changed_flags, | 394 | unsigned int changed_flags, |
445 | unsigned int *total_flags, | 395 | unsigned int *total_flags, |
@@ -623,6 +573,44 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw, | |||
623 | struct rt2x00_dev *rt2x00dev = hw->priv; | 573 | struct rt2x00_dev *rt2x00dev = hw->priv; |
624 | struct rt2x00_intf *intf = vif_to_intf(vif); | 574 | struct rt2x00_intf *intf = vif_to_intf(vif); |
625 | unsigned int delayed = 0; | 575 | unsigned int delayed = 0; |
576 | int update_bssid = 0; | ||
577 | |||
578 | /* | ||
579 | * Mac80211 might be calling this function while we are trying | ||
580 | * to remove the device or perhaps suspending it. | ||
581 | */ | ||
582 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) | ||
583 | return; | ||
584 | |||
585 | spin_lock(&intf->lock); | ||
586 | |||
587 | /* | ||
588 | * conf->bssid can be NULL if coming from the internal | ||
589 | * beacon update routine. | ||
590 | */ | ||
591 | if (changes & BSS_CHANGED_BSSID) { | ||
592 | update_bssid = 1; | ||
593 | memcpy(&intf->bssid, bss_conf->bssid, ETH_ALEN); | ||
594 | } | ||
595 | |||
596 | spin_unlock(&intf->lock); | ||
597 | |||
598 | /* | ||
599 | * Call rt2x00_config_intf() outside of the spinlock context since | ||
600 | * the call will sleep for USB drivers. By using the ieee80211_if_conf | ||
601 | * values as arguments we make keep access to rt2x00_intf thread safe | ||
602 | * even without the lock. | ||
603 | */ | ||
604 | if (changes & BSS_CHANGED_BSSID) | ||
605 | rt2x00lib_config_intf(rt2x00dev, intf, vif->type, NULL, | ||
606 | update_bssid ? bss_conf->bssid : NULL); | ||
607 | |||
608 | /* | ||
609 | * Update the beacon. | ||
610 | */ | ||
611 | if (changes & (BSS_CHANGED_BEACON | BSS_CHANGED_BEACON_ENABLED)) | ||
612 | rt2x00queue_update_beacon(rt2x00dev, vif, | ||
613 | bss_conf->enable_beacon); | ||
626 | 614 | ||
627 | /* | 615 | /* |
628 | * When the association status has changed we must reset the link | 616 | * When the association status has changed we must reset the link |