]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: iwlwifi: change link id in time event to s8
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 23 Jan 2024 18:08:16 +0000 (20:08 +0200)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:16:34 +0000 (18:16 -0400)
[ Upstream commit 6c8ce23854b66db94d88e0957e531cb074806c16 ]

Link ID in time event data is -1 when the time event is cleared.
Change the type of the link ID in the time event data structure
and in the affected function from unsigned to signed.

Fixes: 135065837310 ("wifi: iwlwifi: support link_id in SESSION_PROTECTION cmd")
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240123200528.50d4941f946c.Iea990b118c69bc3e1eb61c1d134c9d470b3a17ac@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c

index 81dbef6947f5578dd50e12f157124fa48fcdb728..fe0fa9ff533d748176cb94f700570504ed890d99 100644 (file)
@@ -121,7 +121,7 @@ struct iwl_mvm_time_event_data {
         * if the te is in the time event list or not (when id == TE_MAX)
         */
        u32 id;
-       u8 link_id;
+       s8 link_id;
 };
 
  /* Power management */
index 2e653a417d6269b333ec12e7d15f43f3c66be46b..98c64ae315e68e68a4c79f27503087f6996b442d 100644 (file)
@@ -692,7 +692,7 @@ void iwl_mvm_protect_session(struct iwl_mvm *mvm,
 /* Determine whether mac or link id should be used, and validate the link id */
 static int iwl_mvm_get_session_prot_id(struct iwl_mvm *mvm,
                                       struct ieee80211_vif *vif,
-                                      u32 link_id)
+                                      s8 link_id)
 {
        struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
        int ver = iwl_fw_lookup_cmd_ver(mvm->fw,
@@ -716,7 +716,7 @@ static int iwl_mvm_get_session_prot_id(struct iwl_mvm *mvm,
 
 static void iwl_mvm_cancel_session_protection(struct iwl_mvm *mvm,
                                              struct ieee80211_vif *vif,
-                                             u32 id, u32 link_id)
+                                             u32 id, s8 link_id)
 {
        int mac_link_id = iwl_mvm_get_session_prot_id(mvm, vif, link_id);
        struct iwl_mvm_session_prot_cmd cmd = {
@@ -745,7 +745,7 @@ static bool __iwl_mvm_remove_time_event(struct iwl_mvm *mvm,
        struct ieee80211_vif *vif = te_data->vif;
        struct iwl_mvm_vif *mvmvif;
        enum nl80211_iftype iftype;
-       unsigned int link_id;
+       s8 link_id;
 
        if (!vif)
                return false;
@@ -1297,7 +1297,7 @@ void iwl_mvm_schedule_session_protection(struct iwl_mvm *mvm,
        struct iwl_mvm_time_event_data *te_data = &mvmvif->time_event_data;
        const u16 notif[] = { WIDE_ID(MAC_CONF_GROUP, SESSION_PROTECTION_NOTIF) };
        struct iwl_notification_wait wait_notif;
-       int mac_link_id = iwl_mvm_get_session_prot_id(mvm, vif, link_id);
+       int mac_link_id = iwl_mvm_get_session_prot_id(mvm, vif, (s8)link_id);
        struct iwl_mvm_session_prot_cmd cmd = {
                .id_and_color = cpu_to_le32(mac_link_id),
                .action = cpu_to_le32(FW_CTXT_ACTION_ADD),