rt2x00: Simplify intf->delayed_flags locking
[pandora-kernel.git] / drivers / net / wireless / rt2x00 / rt2x00mac.c
index 23250a5..297d972 100644 (file)
@@ -282,9 +282,8 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
         * STA interfaces at this time, since this can cause
         * invalid behavior in the device.
         */
-       memcpy(&intf->mac, vif->addr, ETH_ALEN);
        rt2x00lib_config_intf(rt2x00dev, intf, vif->type,
-                             intf->mac, NULL);
+                             vif->addr, NULL);
 
        /*
         * Some filters depend on the current working mode. We can force
@@ -445,9 +444,7 @@ static void rt2x00mac_set_tim_iter(void *data, u8 *mac,
            vif->type != NL80211_IFTYPE_WDS)
                return;
 
-       spin_lock(&intf->lock);
-       intf->delayed_flags |= DELAYED_UPDATE_BEACON;
-       spin_unlock(&intf->lock);
+       set_bit(DELAYED_UPDATE_BEACON, &intf->delayed_flags);
 }
 
 int rt2x00mac_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
@@ -472,17 +469,17 @@ EXPORT_SYMBOL_GPL(rt2x00mac_set_tim);
 static void memcpy_tkip(struct rt2x00lib_crypto *crypto, u8 *key, u8 key_len)
 {
        if (key_len > NL80211_TKIP_DATA_OFFSET_ENCR_KEY)
-               memcpy(&crypto->key,
+               memcpy(crypto->key,
                       &key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY],
                       sizeof(crypto->key));
 
        if (key_len > NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY)
-               memcpy(&crypto->tx_mic,
+               memcpy(crypto->tx_mic,
                       &key[NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY],
                       sizeof(crypto->tx_mic));
 
        if (key_len > NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY)
-               memcpy(&crypto->rx_mic,
+               memcpy(crypto->rx_mic,
                       &key[NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY],
                       sizeof(crypto->rx_mic));
 }
@@ -492,7 +489,6 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
                      struct ieee80211_key_conf *key)
 {
        struct rt2x00_dev *rt2x00dev = hw->priv;
-       struct rt2x00_intf *intf = vif_to_intf(vif);
        int (*set_key) (struct rt2x00_dev *rt2x00dev,
                        struct rt2x00lib_crypto *crypto,
                        struct ieee80211_key_conf *key);
@@ -516,7 +512,7 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
        if (rt2x00dev->intf_sta_count)
                crypto.bssidx = 0;
        else
-               crypto.bssidx = intf->mac[5] & (rt2x00dev->ops->max_ap_intf - 1);
+               crypto.bssidx = vif->addr[5] & (rt2x00dev->ops->max_ap_intf - 1);
 
        crypto.cipher = rt2x00crypto_key_to_cipher(key);
        if (crypto.cipher == CIPHER_NONE)
@@ -534,7 +530,7 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
        if (crypto.cipher == CIPHER_TKIP)
                memcpy_tkip(&crypto, &key->key[0], key->keylen);
        else
-               memcpy(&crypto.key, &key->key[0], key->keylen);
+               memcpy(crypto.key, &key->key[0], key->keylen);
        /*
         * Each BSS has a maximum of 4 shared keys.
         * Shared key index values: