Skip to contentSkip to conversation

wifi: rtw89: mcc: consider time limits not divisible by 1024

PATCH In review Ping-Ke Shih 1 participant 2 messages Jan 3, 2025 – Jan 12, 2025 Realtek wireless driver (rtw89)

lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH 1/1 wifi: rtw89: mcc: consider time limits not divisible by 1024

From: Zong-Zhe Yang <[email protected]>

For each MCC role, time limits, including max_tob_us, max_toa_us, and mac_dur_us, are calculated if there are NoA attributes. The relation between these time limits is "max_dur_us = max_tob_us + max_toa_us". Then, the unit is converted from us to TU. However, originally, each time limit was divided by 1024 independently. It missed to consider the cases that max_tob_us or max_toa_us is not divisible by 1024. It causes the result breaks "max_dur (TU) = max_tob (TU) + max_toa (TU)". Finally, when MCC calculates pattern parameters based on these kinds of time limits, it might not perform well.

Fixes b09df09b55fb ("wifi: rtw89: mcc: initialize start flow")
---
 drivers/net/wireless/realtek/rtw89/chan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw89/chan.c +1 -1
index fb9449930c40..0d12a36be4a0 100644
@@ -801,7 +801,7 @@ static void rtw89_mcc_fill_role_limit(struct rtw89_dev *rtwdev,
 
 	mcc_role->limit.max_toa = max_toa_us / 1024;
 	mcc_role->limit.max_tob = max_tob_us / 1024;
-	mcc_role->limit.max_dur = max_dur_us / 1024;
+	mcc_role->limit.max_dur = mcc_role->limit.max_toa + mcc_role->limit.max_tob;
 	mcc_role->limit.enable = true;
 
 	rtw89_debug(rtwdev, RTW89_DBG_CHAN,
Signature · 1 line
2.25.1
author maintainer
#1 lore raw
Quoted 12 lines · Ping-Ke Shih

From: Zong-Zhe Yang <[email protected]>

For each MCC role, time limits, including max_tob_us, max_toa_us, and mac_dur_us, are calculated if there are NoA attributes. The relation between these time limits is "max_dur_us = max_tob_us + max_toa_us". Then, the unit is converted from us to TU. However, originally, each time limit was divided by 1024 independently. It missed to consider the cases that max_tob_us or max_toa_us is not divisible by 1024. It causes the result breaks "max_dur (TU) = max_tob (TU) + max_toa (TU)". Finally, when MCC calculates pattern parameters based on these kinds of time limits, it might not perform well.

Quoted 3 lines
Fixes b09df09b55fb ("wifi: rtw89: mcc: initialize start flow")

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

35642ba31dc4 wifi: rtw89: mcc: consider time limits not divisible by 1024

---
https://github.com/pkshih/rtw.git