Skip to content

Commit bf0212f

Browse files
striebitjmberg-intel
authored andcommitted
wifi: iwlwifi: mvm: add beacon template version 14
In version 14 tim_size became the offset of the broadcast TWT IE. Signed-off-by: striebit <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://msgid.link/20240506095953.76957de93810.I2c718b0d648f2559fe1337df39915c5e772856bc@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 2848df9 commit bf0212f

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

drivers/net/wireless/intel/iwlwifi/fw/api/tx.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
22
/*
3-
* Copyright (C) 2012-2014, 2018-2023 Intel Corporation
3+
* Copyright (C) 2012-2014, 2018-2024 Intel Corporation
44
* Copyright (C) 2016-2017 Intel Deutschland GmbH
55
*/
66
#ifndef __iwl_fw_api_tx_h__
@@ -793,7 +793,8 @@ enum iwl_mac_beacon_flags {
793793
* @reserved: reserved
794794
* @link_id: the firmware id of the link that will use this beacon
795795
* @tim_idx: the offset of the tim IE in the beacon
796-
* @tim_size: the length of the tim IE
796+
* @tim_size: the length of the tim IE (version < 14)
797+
* @btwt_offset: offset to the broadcast TWT IE if present (version >= 14)
797798
* @ecsa_offset: offset to the ECSA IE if present
798799
* @csa_offset: offset to the CSA IE if present
799800
* @frame: the template of the beacon frame
@@ -805,14 +806,18 @@ struct iwl_mac_beacon_cmd {
805806
__le32 reserved;
806807
__le32 link_id;
807808
__le32 tim_idx;
808-
__le32 tim_size;
809+
union {
810+
__le32 tim_size;
811+
__le32 btwt_offset;
812+
};
809813
__le32 ecsa_offset;
810814
__le32 csa_offset;
811815
struct ieee80211_hdr frame[];
812816
} __packed; /* BEACON_TEMPLATE_CMD_API_S_VER_10,
813817
* BEACON_TEMPLATE_CMD_API_S_VER_11,
814818
* BEACON_TEMPLATE_CMD_API_S_VER_12,
815-
* BEACON_TEMPLATE_CMD_API_S_VER_13
819+
* BEACON_TEMPLATE_CMD_API_S_VER_13,
820+
* BEACON_TEMPLATE_CMD_API_S_VER_14
816821
*/
817822

818823
struct iwl_beacon_notif {

drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,13 @@ static int iwl_mvm_mac_ctxt_send_beacon_v9(struct iwl_mvm *mvm,
11631163
WLAN_EID_EXT_CHANSWITCH_ANN,
11641164
beacon->len));
11651165

1166+
if (vif->type == NL80211_IFTYPE_AP &&
1167+
iwl_fw_lookup_cmd_ver(mvm->fw, BEACON_TEMPLATE_CMD, 0) >= 14)
1168+
beacon_cmd.btwt_offset =
1169+
cpu_to_le32(iwl_mvm_find_ie_offset(beacon->data,
1170+
WLAN_EID_S1G_TWT,
1171+
beacon->len));
1172+
11661173
return iwl_mvm_mac_ctxt_send_beacon_cmd(mvm, beacon, &beacon_cmd,
11671174
sizeof(beacon_cmd));
11681175
}

0 commit comments

Comments
 (0)