Commit 98b7017d authored by Shaul Triebitz's avatar Shaul Triebitz Committed by Johannes Berg
Browse files

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: bf0212fd ("wifi: iwlwifi: mvm: add beacon template version 14")
Signed-off-by: default avatarShaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512152312.eb27175c345a.If30ef24aba10fe47fd42a7a9703eb8903035e294@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 92158790
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1617,6 +1617,15 @@ static int _iwl_dbgfs_inject_beacon_ie(struct iwl_mvm *mvm, char *bin, int len)
					 &beacon_cmd.tim_size,
					 beacon->data, beacon->len);

		if (iwl_fw_lookup_cmd_ver(mvm->fw,
					  BEACON_TEMPLATE_CMD, 0) >= 14) {
			u32 offset = iwl_mvm_find_ie_offset(beacon->data,
							    WLAN_EID_S1G_TWT,
							    beacon->len);

			beacon_cmd.btwt_offset = cpu_to_le32(offset);
		}

		iwl_mvm_mac_ctxt_send_beacon_cmd(mvm, beacon, &beacon_cmd,
						 sizeof(beacon_cmd));
	}
+1 −1
Original line number Diff line number Diff line
@@ -873,7 +873,7 @@ void iwl_mvm_mac_ctxt_set_tim(struct iwl_mvm *mvm,
	}
}

static u32 iwl_mvm_find_ie_offset(u8 *beacon, u8 eid, u32 frame_size)
u32 iwl_mvm_find_ie_offset(u8 *beacon, u8 eid, u32 frame_size)
{
	struct ieee80211_mgmt *mgmt = (void *)beacon;
	const u8 *ie;
+1 −0
Original line number Diff line number Diff line
@@ -1758,6 +1758,7 @@ u8 iwl_mvm_next_antenna(struct iwl_mvm *mvm, u8 valid, u8 last_idx);
void iwl_mvm_get_sync_time(struct iwl_mvm *mvm, int clock_type, u32 *gp2,
			   u64 *boottime, ktime_t *realtime);
u32 iwl_mvm_get_systime(struct iwl_mvm *mvm);
u32 iwl_mvm_find_ie_offset(u8 *beacon, u8 eid, u32 frame_size);

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