mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 20:46:48 +02:00
wifi: rtw89: don't re-randomize TSF of AP/GO
When APs or GOs are up, their TSF start point are randomized to avoid collisions. However, the TSF of an existing AP/GO would be randomized multiple times. It caused the TSF is discontinuous to the corresponding STA/GC sides. So, once TSF has been randomized, don't re-randomize it unless SER (system error recovery) happens unfortunately. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20250422014620.18421-7-pkshih@realtek.com
This commit is contained in:
parent
98019abbf9
commit
13bd2b36f2
|
|
@ -3507,6 +3507,7 @@ struct rtw89_vif_link {
|
|||
u8 hit_rule;
|
||||
u8 last_noa_nr;
|
||||
u64 sync_bcn_tsf;
|
||||
bool rand_tsf_done;
|
||||
bool trigger;
|
||||
bool lsig_txop;
|
||||
u8 tgt_ind;
|
||||
|
|
|
|||
|
|
@ -4631,11 +4631,17 @@ static void rtw89_mac_port_tsf_sync_rand(struct rtw89_dev *rtwdev,
|
|||
if (rtwvif_link->net_type != RTW89_NET_TYPE_AP_MODE || rtwvif_link == rtwvif_src)
|
||||
return;
|
||||
|
||||
if (rtwvif_link->rand_tsf_done)
|
||||
goto out;
|
||||
|
||||
/* adjust offset randomly to avoid beacon conflict */
|
||||
offset = offset - offset / 4 + get_random_u32() % (offset / 2);
|
||||
rtw89_mac_port_tsf_sync(rtwdev, rtwvif_link, rtwvif_src,
|
||||
(*n_offset) * offset);
|
||||
|
||||
rtwvif_link->rand_tsf_done = true;
|
||||
|
||||
out:
|
||||
(*n_offset)++;
|
||||
}
|
||||
|
||||
|
|
@ -4866,6 +4872,8 @@ void rtw89_mac_set_he_tb(struct rtw89_dev *rtwdev,
|
|||
void rtw89_mac_stop_ap(struct rtw89_dev *rtwdev, struct rtw89_vif_link *rtwvif_link)
|
||||
{
|
||||
rtw89_mac_port_cfg_func_sw(rtwdev, rtwvif_link);
|
||||
|
||||
rtwvif_link->rand_tsf_done = false;
|
||||
}
|
||||
|
||||
int rtw89_mac_add_vif(struct rtw89_dev *rtwdev, struct rtw89_vif_link *rtwvif_link)
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ static int __rtw89_ops_add_iface_link(struct rtw89_dev *rtwdev,
|
|||
rtwvif_link->chanctx_assigned = false;
|
||||
rtwvif_link->chanctx_idx = RTW89_CHANCTX_0;
|
||||
rtwvif_link->reg_6ghz_power = RTW89_REG_6GHZ_POWER_DFLT;
|
||||
rtwvif_link->rand_tsf_done = false;
|
||||
|
||||
rcu_read_lock();
|
||||
|
||||
|
|
|
|||
|
|
@ -309,6 +309,7 @@ static void ser_reset_vif(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif)
|
|||
rtw89_core_release_bit_map(rtwdev->hw_port, rtwvif_link->port);
|
||||
rtwvif_link->net_type = RTW89_NET_TYPE_NO_LINK;
|
||||
rtwvif_link->trigger = false;
|
||||
rtwvif_link->rand_tsf_done = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user