mac80211: introduce hw config change flags
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rt2x00 / rt2x00mac.c
index 56829fad3471e87335019c716f7718e32a7e4147..da7b49a364fff45a3e7571619d7fdc96c036035d 100644 (file)
@@ -211,7 +211,7 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
                return -ENODEV;
 
        switch (conf->type) {
-       case IEEE80211_IF_TYPE_AP:
+       case NL80211_IFTYPE_AP:
                /*
                 * We don't support mixed combinations of
                 * sta and ap interfaces.
@@ -227,8 +227,8 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
                        return -ENOBUFS;
 
                break;
-       case IEEE80211_IF_TYPE_STA:
-       case IEEE80211_IF_TYPE_IBSS:
+       case NL80211_IFTYPE_STATION:
+       case NL80211_IFTYPE_ADHOC:
                /*
                 * We don't support mixed combinations of
                 * sta and ap interfaces.
@@ -268,7 +268,7 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
         * increase interface count and start initialization.
         */
 
-       if (conf->type == IEEE80211_IF_TYPE_AP)
+       if (conf->type == NL80211_IFTYPE_AP)
                rt2x00dev->intf_ap_count++;
        else
                rt2x00dev->intf_sta_count++;
@@ -277,7 +277,7 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
        spin_lock_init(&intf->seqlock);
        intf->beacon = entry;
 
-       if (conf->type == IEEE80211_IF_TYPE_AP)
+       if (conf->type == NL80211_IFTYPE_AP)
                memcpy(&intf->bssid, conf->mac_addr, ETH_ALEN);
        memcpy(&intf->mac, conf->mac_addr, ETH_ALEN);
 
@@ -311,11 +311,11 @@ void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
         * no interface is present.
         */
        if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) ||
-           (conf->type == IEEE80211_IF_TYPE_AP && !rt2x00dev->intf_ap_count) ||
-           (conf->type != IEEE80211_IF_TYPE_AP && !rt2x00dev->intf_sta_count))
+           (conf->type == NL80211_IFTYPE_AP && !rt2x00dev->intf_ap_count) ||
+           (conf->type != NL80211_IFTYPE_AP && !rt2x00dev->intf_sta_count))
                return;
 
-       if (conf->type == IEEE80211_IF_TYPE_AP)
+       if (conf->type == NL80211_IFTYPE_AP)
                rt2x00dev->intf_ap_count--;
        else
                rt2x00dev->intf_sta_count--;
@@ -331,13 +331,14 @@ void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
         * are cleared to prevent false ACKing of frames.
         */
        rt2x00lib_config_intf(rt2x00dev, intf,
-                             IEEE80211_IF_TYPE_INVALID, NULL, NULL);
+                             NL80211_IFTYPE_UNSPECIFIED, NULL, NULL);
 }
 EXPORT_SYMBOL_GPL(rt2x00mac_remove_interface);
 
-int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
+int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed)
 {
        struct rt2x00_dev *rt2x00dev = hw->priv;
+       struct ieee80211_conf *conf = &hw->conf;
        int radio_on;
        int status;
 
@@ -543,7 +544,8 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
         * provided but key 0 is not, then the key is not found
         * by the hardware during RX).
         */
-       key->hw_key_idx = 0;
+       if (cmd == SET_KEY)
+               key->hw_key_idx = 0;
 
        if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE)
                set_key = rt2x00dev->ops->lib->config_pairwise_key;