iwlwifi: mvm: prepare for station count change
[linux-block.git] / drivers / net / wireless / intel / iwlwifi / mvm / mac80211.c
index afe0e0f0744fc201d9884b5dcd80021750c5f245..26cf3dfcc108ee2f503707b8b35d9b510a4bc896 100644 (file)
@@ -767,7 +767,7 @@ static bool iwl_mvm_defer_tx(struct iwl_mvm *mvm,
                goto out;
 
        mvmsta = iwl_mvm_sta_from_mac80211(sta);
-       if (mvmsta->sta_id == IWL_MVM_STATION_COUNT ||
+       if (mvmsta->sta_id == IWL_MVM_INVALID_STA ||
            mvmsta->sta_id != mvm->d0i3_ap_sta_id)
                goto out;
 
@@ -1011,7 +1011,7 @@ static void iwl_mvm_cleanup_iterator(void *data, u8 *mac,
        struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
 
        mvmvif->uploaded = false;
-       mvmvif->ap_sta_id = IWL_MVM_STATION_COUNT;
+       mvmvif->ap_sta_id = IWL_MVM_INVALID_STA;
 
        spin_lock_bh(&mvm->time_event_lock);
        iwl_mvm_te_clear_data(mvm, &mvmvif->time_event_data);
@@ -1054,7 +1054,7 @@ static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm)
        ieee80211_iterate_interfaces(mvm->hw, 0, iwl_mvm_cleanup_iterator, mvm);
 
        mvm->p2p_device_vif = NULL;
-       mvm->d0i3_ap_sta_id = IWL_MVM_STATION_COUNT;
+       mvm->d0i3_ap_sta_id = IWL_MVM_INVALID_STA;
 
        iwl_mvm_reset_phy_ctxts(mvm);
        memset(mvm->fw_key_table, 0, sizeof(mvm->fw_key_table));
@@ -1965,7 +1965,7 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
                                                    IWL_MVM_SMPS_REQ_PROT,
                                                    IEEE80211_SMPS_DYNAMIC);
                        }
-               } else if (mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) {
+               } else if (mvmvif->ap_sta_id != IWL_MVM_INVALID_STA) {
                        /*
                         * If update fails - SF might be running in associated
                         * mode while disassociated - which is forbidden.
@@ -1979,8 +1979,8 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
                                IWL_ERR(mvm, "failed to remove AP station\n");
 
                        if (mvm->d0i3_ap_sta_id == mvmvif->ap_sta_id)
-                               mvm->d0i3_ap_sta_id = IWL_MVM_STATION_COUNT;
-                       mvmvif->ap_sta_id = IWL_MVM_STATION_COUNT;
+                               mvm->d0i3_ap_sta_id = IWL_MVM_INVALID_STA;
+                       mvmvif->ap_sta_id = IWL_MVM_INVALID_STA;
                        /* remove quota for this interface */
                        ret = iwl_mvm_update_quotas(mvm, false, NULL);
                        if (ret)
@@ -2391,7 +2391,7 @@ static void __iwl_mvm_mac_sta_notify(struct ieee80211_hw *hw,
                 */
                break;
        case STA_NOTIFY_AWAKE:
-               if (WARN_ON(mvmsta->sta_id == IWL_MVM_STATION_COUNT))
+               if (WARN_ON(mvmsta->sta_id == IWL_MVM_INVALID_STA))
                        break;
 
                if (txqs)
@@ -3961,7 +3961,7 @@ static void iwl_mvm_mac_flush(struct ieee80211_hw *hw,
        mvmvif = iwl_mvm_vif_from_mac80211(vif);
 
        /* flush the AP-station and all TDLS peers */
-       for (i = 0; i < IWL_MVM_STATION_COUNT; i++) {
+       for (i = 0; i < ARRAY_SIZE(mvm->fw_id_to_mac_id); i++) {
                sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i],
                                                lockdep_is_held(&mvm->mutex));
                if (IS_ERR_OR_NULL(sta))