Skip to contentSkip to conversation

wifi: rtw88: Fix macid assigned to TDLS station

PATCH In review Bitterblue Smith 2 participants 3 messages Jul 13, 2025 – Jul 15, 2025 Realtek wireless driver (rtw88)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: rtw88: Fix macid assigned to TDLS station

When working in station mode, TDLS peers are assigned macid 0, even though 0 was already assigned to the AP. This causes the connection with the AP to stop working after the TDLS connection is torn down.

Assign the next available macid to TDLS peers, same as client stations in AP mode.

Fixes 902cb7b11f9a ("wifi: rtw88: assign mac_id for vif/sta and update to TX desc")
---
 drivers/net/wireless/realtek/rtw88/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtw88/main.c +2 -2
index c0103ace8239..f4a5580b75c1 100644
@@ -349,7 +349,7 @@ int rtw_sta_add(struct rtw_dev *rtwdev, struct ieee80211_sta *sta,
 	struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
 	int i;
 
-	if (vif->type == NL80211_IFTYPE_STATION) {
+	if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls) {
 		si->mac_id = rtwvif->mac_id;
 	} else {
 		si->mac_id = rtw_acquire_macid(rtwdev);
@@ -386,7 +386,7 @@ void rtw_sta_remove(struct rtw_dev *rtwdev, struct ieee80211_sta *sta,
 
 	cancel_work_sync(&si->rc_work);
 
-	if (vif->type != NL80211_IFTYPE_STATION)
+	if (vif->type != NL80211_IFTYPE_STATION || sta->tdls)
 		rtw_release_macid(rtwdev, si->mac_id);
 	if (fw_exist)
 		rtw_fw_media_status_report(rtwdev, si->mac_id, false);
Signature · 1 line
2.50.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Bitterblue Smith

When working in station mode, TDLS peers are assigned macid 0, even though 0 was already assigned to the AP. This causes the connection with the AP to stop working after the TDLS connection is torn down.

Assign the next available macid to TDLS peers, same as client stations in AP mode.

Fixes 902cb7b11f9a ("wifi: rtw88: assign mac_id for vif/sta and update to TX desc")
maintainer
#2 lore raw
In reply to Bitterblue Smith
Quoted 10 lines · Bitterblue Smith

When working in station mode, TDLS peers are assigned macid 0, even though 0 was already assigned to the AP. This causes the connection with the AP to stop working after the TDLS connection is torn down.

Assign the next available macid to TDLS peers, same as client stations in AP mode.

Fixes 902cb7b11f9a ("wifi: rtw88: assign mac_id for vif/sta and update to TX desc")

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

526b000991b5 wifi: rtw88: Fix macid assigned to TDLS station

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