Commit c7df64c1 authored by Ping-Ke Shih's avatar Ping-Ke Shih Committed by Kalle Valo
Browse files

rtw89: allocate mac_id for each station in AP mode



In station mode, mac_id of station is the same as rtwvif's one.
In AP mode, each station uses individual mac_id.

Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220107034239.22002-7-pkshih@realtek.com
parent d62816b4
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -1889,6 +1889,9 @@ int rtw89_core_sta_add(struct rtw89_dev *rtwdev,
		rtw89_btc_ntfy_role_info(rtwdev, rtwvif, rtwsta,
		rtw89_btc_ntfy_role_info(rtwdev, rtwvif, rtwsta,
					 BTC_ROLE_MSTS_STA_CONN_START);
					 BTC_ROLE_MSTS_STA_CONN_START);
		rtw89_chip_rfk_channel(rtwdev);
		rtw89_chip_rfk_channel(rtwdev);
	} else if (vif->type == NL80211_IFTYPE_AP) {
		rtwsta->mac_id = rtw89_core_acquire_bit_map(rtwdev->mac_id_map,
							    RTW89_MAX_MAC_ID_NUM);
	}
	}


	return 0;
	return 0;
@@ -2001,6 +2004,8 @@ int rtw89_core_sta_remove(struct rtw89_dev *rtwdev,
	if (vif->type == NL80211_IFTYPE_STATION)
	if (vif->type == NL80211_IFTYPE_STATION)
		rtw89_btc_ntfy_role_info(rtwdev, rtwvif, rtwsta,
		rtw89_btc_ntfy_role_info(rtwdev, rtwvif, rtwsta,
					 BTC_ROLE_MSTS_STA_DIS_CONN);
					 BTC_ROLE_MSTS_STA_DIS_CONN);
	else if (vif->type == NL80211_IFTYPE_AP)
		rtw89_core_release_bit_map(rtwdev->mac_id_map, rtwsta->mac_id);


	return 0;
	return 0;
}
}