Skip to content

Commit 98b7017

Browse files
striebitjmberg-intel
authored andcommitted
wifi: iwlwifi: mvm: always set the TWT IE offset
In beacon template version 14, make sure to always set the TWT IE offset before sending the beacon template command, also in the debugfs inject_beacon_ie path. If the TWT IE does not exist, the offset will be set to zero. Fixes: bf0212f ("wifi: iwlwifi: mvm: add beacon template version 14") Signed-off-by: Shaul Triebitz <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://msgid.link/20240512152312.eb27175c345a.If30ef24aba10fe47fd42a7a9703eb8903035e294@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 9215879 commit 98b7017

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,6 +1617,15 @@ static int _iwl_dbgfs_inject_beacon_ie(struct iwl_mvm *mvm, char *bin, int len)
16171617
&beacon_cmd.tim_size,
16181618
beacon->data, beacon->len);
16191619

1620+
if (iwl_fw_lookup_cmd_ver(mvm->fw,
1621+
BEACON_TEMPLATE_CMD, 0) >= 14) {
1622+
u32 offset = iwl_mvm_find_ie_offset(beacon->data,
1623+
WLAN_EID_S1G_TWT,
1624+
beacon->len);
1625+
1626+
beacon_cmd.btwt_offset = cpu_to_le32(offset);
1627+
}
1628+
16201629
iwl_mvm_mac_ctxt_send_beacon_cmd(mvm, beacon, &beacon_cmd,
16211630
sizeof(beacon_cmd));
16221631
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ void iwl_mvm_mac_ctxt_set_tim(struct iwl_mvm *mvm,
873873
}
874874
}
875875

876-
static u32 iwl_mvm_find_ie_offset(u8 *beacon, u8 eid, u32 frame_size)
876+
u32 iwl_mvm_find_ie_offset(u8 *beacon, u8 eid, u32 frame_size)
877877
{
878878
struct ieee80211_mgmt *mgmt = (void *)beacon;
879879
const u8 *ie;

drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,6 +1758,7 @@ u8 iwl_mvm_next_antenna(struct iwl_mvm *mvm, u8 valid, u8 last_idx);
17581758
void iwl_mvm_get_sync_time(struct iwl_mvm *mvm, int clock_type, u32 *gp2,
17591759
u64 *boottime, ktime_t *realtime);
17601760
u32 iwl_mvm_get_systime(struct iwl_mvm *mvm);
1761+
u32 iwl_mvm_find_ie_offset(u8 *beacon, u8 eid, u32 frame_size);
17611762

17621763
/* Tx / Host Commands */
17631764
int __must_check iwl_mvm_send_cmd(struct iwl_mvm *mvm,

0 commit comments

Comments
 (0)