Commit ed93faf0 authored by Johannes Berg's avatar Johannes Berg

wifi: iwlwifi: mvm: don't track used links separately

We track which link is using which FW link ID, so there
really isn't a need to separately track which link IDs
are in use. Remove that code and check the table when
looking for a new link ID to use.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512072733.1a67d8af815f.Ie642c12dce3ab55c688abd9a25918569e83e558a@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 45eeee1f
...@@ -1499,8 +1499,6 @@ int iwl_mvm_up(struct iwl_mvm *mvm) ...@@ -1499,8 +1499,6 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
for (i = 0; i < IWL_MVM_FW_MAX_LINK_ID + 1; i++) for (i = 0; i < IWL_MVM_FW_MAX_LINK_ID + 1; i++)
RCU_INIT_POINTER(mvm->link_id_to_link_conf[i], NULL); RCU_INIT_POINTER(mvm->link_id_to_link_conf[i], NULL);
memset(&mvm->fw_link_ids_map, 0, sizeof(mvm->fw_link_ids_map));
mvm->tdls_cs.peer.sta_id = IWL_MVM_INVALID_STA; mvm->tdls_cs.peer.sta_id = IWL_MVM_INVALID_STA;
/* reset quota debouncing buffer - 0xff will yield invalid data */ /* reset quota debouncing buffer - 0xff will yield invalid data */
......
...@@ -50,26 +50,15 @@ static void iwl_mvm_print_esr_state(struct iwl_mvm *mvm, u32 mask) ...@@ -50,26 +50,15 @@ static void iwl_mvm_print_esr_state(struct iwl_mvm *mvm, u32 mask)
static u32 iwl_mvm_get_free_fw_link_id(struct iwl_mvm *mvm, static u32 iwl_mvm_get_free_fw_link_id(struct iwl_mvm *mvm,
struct iwl_mvm_vif *mvm_vif) struct iwl_mvm_vif *mvm_vif)
{ {
u32 link_id; u32 i;
lockdep_assert_held(&mvm->mutex); lockdep_assert_held(&mvm->mutex);
link_id = ffz(mvm->fw_link_ids_map); for (i = 0; i < ARRAY_SIZE(mvm->link_id_to_link_conf); i++)
if (!rcu_access_pointer(mvm->link_id_to_link_conf[i]))
return i;
/* this case can happen if there're deactivated but not removed links */ return IWL_MVM_FW_LINK_ID_INVALID;
if (link_id > IWL_MVM_FW_MAX_LINK_ID)
return IWL_MVM_FW_LINK_ID_INVALID;
mvm->fw_link_ids_map |= BIT(link_id);
return link_id;
}
static void iwl_mvm_release_fw_link_id(struct iwl_mvm *mvm, u32 link_id)
{
lockdep_assert_held(&mvm->mutex);
if (!WARN_ON(link_id > IWL_MVM_FW_MAX_LINK_ID))
mvm->fw_link_ids_map &= ~BIT(link_id);
} }
static int iwl_mvm_link_cmd_send(struct iwl_mvm *mvm, static int iwl_mvm_link_cmd_send(struct iwl_mvm *mvm,
...@@ -380,7 +369,6 @@ int iwl_mvm_unset_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -380,7 +369,6 @@ int iwl_mvm_unset_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
RCU_INIT_POINTER(mvm->link_id_to_link_conf[link_info->fw_link_id], RCU_INIT_POINTER(mvm->link_id_to_link_conf[link_info->fw_link_id],
NULL); NULL);
iwl_mvm_release_fw_link_id(mvm, link_info->fw_link_id);
return 0; return 0;
} }
......
...@@ -1043,7 +1043,6 @@ struct iwl_mvm { ...@@ -1043,7 +1043,6 @@ struct iwl_mvm {
struct iwl_rx_phy_info last_phy_info; struct iwl_rx_phy_info last_phy_info;
struct ieee80211_sta __rcu *fw_id_to_mac_id[IWL_MVM_STATION_COUNT_MAX]; struct ieee80211_sta __rcu *fw_id_to_mac_id[IWL_MVM_STATION_COUNT_MAX];
struct ieee80211_link_sta __rcu *fw_id_to_link_sta[IWL_MVM_STATION_COUNT_MAX]; struct ieee80211_link_sta __rcu *fw_id_to_link_sta[IWL_MVM_STATION_COUNT_MAX];
unsigned long fw_link_ids_map;
u8 rx_ba_sessions; u8 rx_ba_sessions;
/* configured by mac80211 */ /* configured by mac80211 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment