diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00mac.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00mac.c | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index 4cac7ad60f47..658542d2efe1 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -268,7 +268,6 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw, | |||
268 | else | 268 | else |
269 | rt2x00dev->intf_sta_count++; | 269 | rt2x00dev->intf_sta_count++; |
270 | 270 | ||
271 | spin_lock_init(&intf->lock); | ||
272 | spin_lock_init(&intf->seqlock); | 271 | spin_lock_init(&intf->seqlock); |
273 | mutex_init(&intf->beacon_skb_mutex); | 272 | mutex_init(&intf->beacon_skb_mutex); |
274 | intf->beacon = entry; | 273 | intf->beacon = entry; |
@@ -282,9 +281,8 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw, | |||
282 | * STA interfaces at this time, since this can cause | 281 | * STA interfaces at this time, since this can cause |
283 | * invalid behavior in the device. | 282 | * invalid behavior in the device. |
284 | */ | 283 | */ |
285 | memcpy(&intf->mac, vif->addr, ETH_ALEN); | ||
286 | rt2x00lib_config_intf(rt2x00dev, intf, vif->type, | 284 | rt2x00lib_config_intf(rt2x00dev, intf, vif->type, |
287 | intf->mac, NULL); | 285 | vif->addr, NULL); |
288 | 286 | ||
289 | /* | 287 | /* |
290 | * Some filters depend on the current working mode. We can force | 288 | * Some filters depend on the current working mode. We can force |
@@ -445,9 +443,7 @@ static void rt2x00mac_set_tim_iter(void *data, u8 *mac, | |||
445 | vif->type != NL80211_IFTYPE_WDS) | 443 | vif->type != NL80211_IFTYPE_WDS) |
446 | return; | 444 | return; |
447 | 445 | ||
448 | spin_lock(&intf->lock); | 446 | set_bit(DELAYED_UPDATE_BEACON, &intf->delayed_flags); |
449 | intf->delayed_flags |= DELAYED_UPDATE_BEACON; | ||
450 | spin_unlock(&intf->lock); | ||
451 | } | 447 | } |
452 | 448 | ||
453 | int rt2x00mac_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, | 449 | int rt2x00mac_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, |
@@ -472,17 +468,17 @@ EXPORT_SYMBOL_GPL(rt2x00mac_set_tim); | |||
472 | static void memcpy_tkip(struct rt2x00lib_crypto *crypto, u8 *key, u8 key_len) | 468 | static void memcpy_tkip(struct rt2x00lib_crypto *crypto, u8 *key, u8 key_len) |
473 | { | 469 | { |
474 | if (key_len > NL80211_TKIP_DATA_OFFSET_ENCR_KEY) | 470 | if (key_len > NL80211_TKIP_DATA_OFFSET_ENCR_KEY) |
475 | memcpy(&crypto->key, | 471 | memcpy(crypto->key, |
476 | &key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY], | 472 | &key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY], |
477 | sizeof(crypto->key)); | 473 | sizeof(crypto->key)); |
478 | 474 | ||
479 | if (key_len > NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY) | 475 | if (key_len > NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY) |
480 | memcpy(&crypto->tx_mic, | 476 | memcpy(crypto->tx_mic, |
481 | &key[NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY], | 477 | &key[NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY], |
482 | sizeof(crypto->tx_mic)); | 478 | sizeof(crypto->tx_mic)); |
483 | 479 | ||
484 | if (key_len > NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY) | 480 | if (key_len > NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY) |
485 | memcpy(&crypto->rx_mic, | 481 | memcpy(crypto->rx_mic, |
486 | &key[NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY], | 482 | &key[NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY], |
487 | sizeof(crypto->rx_mic)); | 483 | sizeof(crypto->rx_mic)); |
488 | } | 484 | } |
@@ -492,7 +488,6 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
492 | struct ieee80211_key_conf *key) | 488 | struct ieee80211_key_conf *key) |
493 | { | 489 | { |
494 | struct rt2x00_dev *rt2x00dev = hw->priv; | 490 | struct rt2x00_dev *rt2x00dev = hw->priv; |
495 | struct rt2x00_intf *intf = vif_to_intf(vif); | ||
496 | int (*set_key) (struct rt2x00_dev *rt2x00dev, | 491 | int (*set_key) (struct rt2x00_dev *rt2x00dev, |
497 | struct rt2x00lib_crypto *crypto, | 492 | struct rt2x00lib_crypto *crypto, |
498 | struct ieee80211_key_conf *key); | 493 | struct ieee80211_key_conf *key); |
@@ -516,7 +511,7 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
516 | if (rt2x00dev->intf_sta_count) | 511 | if (rt2x00dev->intf_sta_count) |
517 | crypto.bssidx = 0; | 512 | crypto.bssidx = 0; |
518 | else | 513 | else |
519 | crypto.bssidx = intf->mac[5] & (rt2x00dev->ops->max_ap_intf - 1); | 514 | crypto.bssidx = vif->addr[5] & (rt2x00dev->ops->max_ap_intf - 1); |
520 | 515 | ||
521 | crypto.cipher = rt2x00crypto_key_to_cipher(key); | 516 | crypto.cipher = rt2x00crypto_key_to_cipher(key); |
522 | if (crypto.cipher == CIPHER_NONE) | 517 | if (crypto.cipher == CIPHER_NONE) |
@@ -534,7 +529,7 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
534 | if (crypto.cipher == CIPHER_TKIP) | 529 | if (crypto.cipher == CIPHER_TKIP) |
535 | memcpy_tkip(&crypto, &key->key[0], key->keylen); | 530 | memcpy_tkip(&crypto, &key->key[0], key->keylen); |
536 | else | 531 | else |
537 | memcpy(&crypto.key, &key->key[0], key->keylen); | 532 | memcpy(crypto.key, &key->key[0], key->keylen); |
538 | /* | 533 | /* |
539 | * Each BSS has a maximum of 4 shared keys. | 534 | * Each BSS has a maximum of 4 shared keys. |
540 | * Shared key index values: | 535 | * Shared key index values: |
@@ -614,22 +609,8 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw, | |||
614 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) | 609 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) |
615 | return; | 610 | return; |
616 | 611 | ||
617 | spin_lock(&intf->lock); | ||
618 | |||
619 | /* | ||
620 | * conf->bssid can be NULL if coming from the internal | ||
621 | * beacon update routine. | ||
622 | */ | ||
623 | if (changes & BSS_CHANGED_BSSID) | ||
624 | memcpy(&intf->bssid, bss_conf->bssid, ETH_ALEN); | ||
625 | |||
626 | spin_unlock(&intf->lock); | ||
627 | |||
628 | /* | 612 | /* |
629 | * Call rt2x00_config_intf() outside of the spinlock context since | 613 | * Update the BSSID. |
630 | * the call will sleep for USB drivers. By using the ieee80211_if_conf | ||
631 | * values as arguments we make keep access to rt2x00_intf thread safe | ||
632 | * even without the lock. | ||
633 | */ | 614 | */ |
634 | if (changes & BSS_CHANGED_BSSID) | 615 | if (changes & BSS_CHANGED_BSSID) |
635 | rt2x00lib_config_intf(rt2x00dev, intf, vif->type, NULL, | 616 | rt2x00lib_config_intf(rt2x00dev, intf, vif->type, NULL, |