wifi: iwlwifi: mvm: tell firmware about per-STA MFP enablement
authorJohannes Berg <johannes.berg@intel.com>
Thu, 1 Jun 2023 06:52:46 +0000 (09:52 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 6 Jun 2023 11:40:56 +0000 (13:40 +0200)
Indicate to the firmware for each station whether or not MFP
is used with this station. Note that we indicate MFP for it
before authorized since we don't know yet, and that will make
the firmware not handle should-be-protected management frames
without being able to check them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230601095201.b1052f39af4c.I1b46b751d5808e65ea3d0e7b8b38209c5aecf042@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/file.h
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c

index 42de95a22784b9423a20534072419e2361a81f1f..319ab4d7188e2c671ce29267671b7e8dd10b39d9 100644 (file)
@@ -464,6 +464,7 @@ enum iwl_ucode_tlv_capa {
        IWL_UCODE_TLV_CAPA_SCAN_DONT_TOGGLE_ANT         = (__force iwl_ucode_tlv_capa_t)111,
        IWL_UCODE_TLV_CAPA_PPAG_CHINA_BIOS_SUPPORT      = (__force iwl_ucode_tlv_capa_t)112,
        IWL_UCODE_TLV_CAPA_OFFLOAD_REJ_BTM_SUPPORT      = (__force iwl_ucode_tlv_capa_t)113,
+       IWL_UCODE_TLV_CAPA_STA_EXP_MFP_SUPPORT          = (__force iwl_ucode_tlv_capa_t)114,
 
 #ifdef __CHECKER__
        /* sparse says it cannot increment the previous enum member */
index 401f94bd1f9c62461b7a54e825022fedbd00badb..b3296aa65f2028ba85f470c2675456ced15555e4 100644 (file)
@@ -71,6 +71,11 @@ static int iwl_mvm_mld_add_int_sta_to_fw(struct iwl_mvm *mvm,
 
        cmd.station_type = cpu_to_le32(sta->type);
 
+       if (fw_has_capa(&mvm->fw->ucode_capa,
+                       IWL_UCODE_TLV_CAPA_STA_EXP_MFP_SUPPORT) &&
+           sta->type == STATION_TYPE_BCAST_MGMT)
+               cmd.mfp = cpu_to_le32(1);
+
        if (addr) {
                memcpy(cmd.peer_mld_address, addr, ETH_ALEN);
                memcpy(cmd.peer_link_address, addr, ETH_ALEN);
@@ -442,6 +447,11 @@ static int iwl_mvm_mld_cfg_sta(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
        if (mvm_sta->sta_state >= IEEE80211_STA_ASSOC)
                cmd.assoc_id = cpu_to_le32(sta->aid);
 
+       if (fw_has_capa(&mvm->fw->ucode_capa,
+                       IWL_UCODE_TLV_CAPA_STA_EXP_MFP_SUPPORT) &&
+           (sta->mfp || mvm_sta->sta_state < IEEE80211_STA_AUTHORIZED))
+               cmd.mfp = cpu_to_le32(1);
+
        switch (link_sta->rx_nss) {
        case 1:
                cmd.mimo = cpu_to_le32(0);