Skip to content

Commit

Permalink
wifi: iwlwifi: mvm: add beacon template version 14
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
striebit authored and Johannes Berg committed May 6, 2024
1 parent 2848df9 commit bf0212f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/net/wireless/intel/iwlwifi/fw/api/tx.h
Original file line number Diff line number Diff line change
@@ -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__
Expand Down Expand Up @@ -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
Expand All @@ -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 {
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit bf0212f

Please sign in to comment.