wifi: iwlwifi: mvm: add beacon template version 14
authorstriebit <shaul.triebitz@intel.com>
Mon, 6 May 2024 07:04:16 +0000 (10:04 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 6 May 2024 14:33:26 +0000 (16:33 +0200)
In version 14 tim_size became the offset of the
broadcast TWT IE.

Signed-off-by: striebit <shaul.triebitz@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506095953.76957de93810.I2c718b0d648f2559fe1337df39915c5e772856bc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/api/tx.h
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c

index d9e4c75403b8a3b42c24b64c39e725bac4e53fb9..bbd176d888208c84c2c50cb86847757aa08693d7 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
 /*
- * Copyright (C) 2012-2014, 2018-2023 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2024 Intel Corporation
  * Copyright (C) 2016-2017 Intel Deutschland GmbH
  */
 #ifndef __iwl_fw_api_tx_h__
@@ -793,7 +793,8 @@ enum iwl_mac_beacon_flags {
  * @reserved: reserved
  * @link_id: the firmware id of the link that will use this beacon
  * @tim_idx: the offset of the tim IE in the beacon
- * @tim_size: the length of the tim IE
+ * @tim_size: the length of the tim IE (version < 14)
+ * @btwt_offset: offset to the broadcast TWT IE if present (version >= 14)
  * @ecsa_offset: offset to the ECSA IE if present
  * @csa_offset: offset to the CSA IE if present
  * @frame: the template of the beacon frame
@@ -805,14 +806,18 @@ struct iwl_mac_beacon_cmd {
        __le32 reserved;
        __le32 link_id;
        __le32 tim_idx;
-       __le32 tim_size;
+       union {
+               __le32 tim_size;
+               __le32 btwt_offset;
+       };
        __le32 ecsa_offset;
        __le32 csa_offset;
        struct ieee80211_hdr frame[];
 } __packed; /* BEACON_TEMPLATE_CMD_API_S_VER_10,
             * BEACON_TEMPLATE_CMD_API_S_VER_11,
             * BEACON_TEMPLATE_CMD_API_S_VER_12,
-            * BEACON_TEMPLATE_CMD_API_S_VER_13
+            * BEACON_TEMPLATE_CMD_API_S_VER_13,
+            * BEACON_TEMPLATE_CMD_API_S_VER_14
             */
 
 struct iwl_beacon_notif {
index 2718db5aa3f5cdf16f59859fc7b4463e4be9848f..5a06f887769a6ad2de8f73c59afb1b75aa37aa1f 100644 (file)
@@ -1163,6 +1163,13 @@ static int iwl_mvm_mac_ctxt_send_beacon_v9(struct iwl_mvm *mvm,
                                                   WLAN_EID_EXT_CHANSWITCH_ANN,
                                                   beacon->len));
 
+       if (vif->type == NL80211_IFTYPE_AP &&
+           iwl_fw_lookup_cmd_ver(mvm->fw, BEACON_TEMPLATE_CMD, 0) >= 14)
+               beacon_cmd.btwt_offset =
+                       cpu_to_le32(iwl_mvm_find_ie_offset(beacon->data,
+                                                          WLAN_EID_S1G_TWT,
+                                                          beacon->len));
+
        return iwl_mvm_mac_ctxt_send_beacon_cmd(mvm, beacon, &beacon_cmd,
                                                sizeof(beacon_cmd));
 }