Skip to content

Commit aa44b2f

Browse files
Carl HuangKalle Valo
authored andcommitted
ath11k: start vdev if a bss peer is already created
For QCA6390, bss peer must be created before vdev is to start. This change is to start vdev if a bss peer is created. Otherwise, ath11k delays to start vdev. This fixes an issue in a case where HT/VHT/HE settings change between authentication and association, e.g., due to the user space request to disable HT. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3597010 commit aa44b2f

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

drivers/net/wireless/ath/ath11k/mac.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3021,6 +3021,7 @@ static int ath11k_mac_station_add(struct ath11k *ar,
30213021
}
30223022

30233023
if (ab->hw_params.vdev_start_delay &&
3024+
!arvif->is_started &&
30243025
arvif->vdev_type != WMI_VDEV_TYPE_AP) {
30253026
ret = ath11k_start_vdev_delay(ar->hw, vif);
30263027
if (ret) {
@@ -5284,7 +5285,8 @@ ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
52845285
/* for QCA6390 bss peer must be created before vdev_start */
52855286
if (ab->hw_params.vdev_start_delay &&
52865287
arvif->vdev_type != WMI_VDEV_TYPE_AP &&
5287-
arvif->vdev_type != WMI_VDEV_TYPE_MONITOR) {
5288+
arvif->vdev_type != WMI_VDEV_TYPE_MONITOR &&
5289+
!ath11k_peer_find_by_vdev_id(ab, arvif->vdev_id)) {
52885290
memcpy(&arvif->chanctx, ctx, sizeof(*ctx));
52895291
ret = 0;
52905292
goto out;
@@ -5295,7 +5297,9 @@ ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
52955297
goto out;
52965298
}
52975299

5298-
if (ab->hw_params.vdev_start_delay) {
5300+
if (ab->hw_params.vdev_start_delay &&
5301+
(arvif->vdev_type == WMI_VDEV_TYPE_AP ||
5302+
arvif->vdev_type == WMI_VDEV_TYPE_MONITOR)) {
52995303
param.vdev_id = arvif->vdev_id;
53005304
param.peer_type = WMI_PEER_TYPE_DEFAULT;
53015305
param.peer_addr = ar->mac_addr;

drivers/net/wireless/ath/ath11k/peer.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,23 @@ struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab,
7676
return NULL;
7777
}
7878

79+
struct ath11k_peer *ath11k_peer_find_by_vdev_id(struct ath11k_base *ab,
80+
int vdev_id)
81+
{
82+
struct ath11k_peer *peer;
83+
84+
spin_lock_bh(&ab->base_lock);
85+
86+
list_for_each_entry(peer, &ab->peers, list) {
87+
if (vdev_id == peer->vdev_id) {
88+
spin_unlock_bh(&ab->base_lock);
89+
return peer;
90+
}
91+
}
92+
spin_unlock_bh(&ab->base_lock);
93+
return NULL;
94+
}
95+
7996
void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id)
8097
{
8198
struct ath11k_peer *peer;

drivers/net/wireless/ath/ath11k/peer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,7 @@ int ath11k_peer_create(struct ath11k *ar, struct ath11k_vif *arvif,
4343
struct ieee80211_sta *sta, struct peer_create_params *param);
4444
int ath11k_wait_for_peer_delete_done(struct ath11k *ar, u32 vdev_id,
4545
const u8 *addr);
46+
struct ath11k_peer *ath11k_peer_find_by_vdev_id(struct ath11k_base *ab,
47+
int vdev_id);
4648

4749
#endif /* _PEER_H_ */

0 commit comments

Comments
 (0)