qcacmn: Fix AST index for STA Vdev overwritten issue

For KIWI, STA AST index lookup search is enabled and remote
AP peer's AST index will be stored in STA Vdev if receive
AP peer htt peer map msg. but if STA TDLS connection happened,
host will receive another peer map msg for remote TDLS STA peer,
this remote TDLS STA peer's AST index will overwrite original AP's
AST index. if TDLS disconnected, STA vdev will still use remote
TDLS STA's AST index for TX, then TX to AP might fail.

Add is_tdls_peer flag in dp peer and configure this value by
cdp_peer_set_peer_as_tdls() from control path right after TDLS peer
created. if is_tdls_peer is true, do not store this TDLS peer's
AST index to STA Vdev, skip bss_peer flag setting as well.

Change-Id: I7b5df1caca6a0b5305a6e867cd92099b5f6a4890
CRs-Fixed: 3151035
This commit is contained in:
Jinwei Chen
2022-03-14 23:23:55 -07:00
committed by Madan Koyyalamudi
parent 5d0d6db673
commit 691ffe9f3f
4 changed files with 60 additions and 13 deletions

View File

@@ -2828,6 +2828,7 @@ dp_rx_peer_map_handler(struct dp_soc *soc, uint16_t peer_id,
uint8_t is_wds)
{
struct dp_peer *peer = NULL;
struct dp_vdev *vdev = NULL;
enum cdp_txrx_ast_entry_type type = CDP_TXRX_AST_TYPE_STATIC;
QDF_STATUS err = QDF_STATUS_SUCCESS;
@@ -2867,19 +2868,23 @@ dp_rx_peer_map_handler(struct dp_soc *soc, uint16_t peer_id,
hw_peer_id, vdev_id);
if (peer) {
if (wlan_op_mode_sta == peer->vdev->opmode &&
qdf_mem_cmp(peer->mac_addr.raw,
peer->vdev->mac_addr.raw,
QDF_MAC_ADDR_SIZE) != 0) {
dp_peer_info("%pK: STA vdev bss_peer!!!!", soc);
peer->bss_peer = 1;
if (peer->txrx_peer)
peer->txrx_peer->bss_peer = 1;
}
vdev = peer->vdev;
/* Only check for STA Vdev and peer is not for TDLS */
if (wlan_op_mode_sta == vdev->opmode &&
!peer->is_tdls_peer) {
if (qdf_mem_cmp(peer->mac_addr.raw,
vdev->mac_addr.raw,
QDF_MAC_ADDR_SIZE) != 0) {
dp_info("%pK: STA vdev bss_peer", soc);
peer->bss_peer = 1;
if (peer->txrx_peer)
peer->txrx_peer->bss_peer = 1;
}
if (peer->vdev->opmode == wlan_op_mode_sta) {
peer->vdev->bss_ast_hash = ast_hash;
peer->vdev->bss_ast_idx = hw_peer_id;
dp_info("bss ast_hash 0x%x, ast_index 0x%x",
ast_hash, hw_peer_id);
vdev->bss_ast_hash = ast_hash;
vdev->bss_ast_idx = hw_peer_id;
}
/* Add ast entry incase self ast entry is
@@ -5398,6 +5403,27 @@ bool dp_find_peer_exist(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
return false;
}
void dp_set_peer_as_tdls_peer(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
uint8_t *peer_mac, bool val)
{
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
struct dp_peer *peer = NULL;
peer = dp_peer_find_hash_find(soc, peer_mac, 0, vdev_id,
DP_MOD_ID_CDP);
if (!peer) {
dp_err("Failed to find peer for:" QDF_MAC_ADDR_FMT,
QDF_MAC_ADDR_REF(peer_mac));
return;
}
dp_info("Set tdls flag %d for peer:" QDF_MAC_ADDR_FMT,
val, QDF_MAC_ADDR_REF(peer_mac));
peer->is_tdls_peer = val;
dp_peer_unref_delete(peer, DP_MOD_ID_CDP);
}
#endif
/**