From 6ba855ca404e9120688c0fdf33662c2c70e3bfc8 Mon Sep 17 00:00:00 2001 From: phadiman Date: Wed, 17 Oct 2018 20:02:37 +0530 Subject: [PATCH] qcacmn: Delete existing AST on different radio In STA roaming scenarios it is possible that an AST entry for a given MAC address already exist on the other radio Delete the existing WDS AST entry on other radio if present before adding the new wds entry on the current radio as part of WDS source port learning Change-Id: I15ef79be0441f3b27fd55e728f5bb27b073c6469 CRs-Fixed: 2334625 --- dp/wifi3.0/dp_peer.c | 24 +----------------------- dp/wifi3.0/dp_rx.h | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c index 0a5605ccd7ce..43a6c3fd78ce 100644 --- a/dp/wifi3.0/dp_peer.c +++ b/dp/wifi3.0/dp_peer.c @@ -550,30 +550,8 @@ int dp_peer_add_ast(struct dp_soc *soc, ast_entry = dp_peer_ast_hash_find_soc(soc, mac_addr); if (ast_entry) { - if (ast_entry->type == CDP_TXRX_AST_TYPE_MEC) { + if (ast_entry->type == CDP_TXRX_AST_TYPE_MEC) ast_entry->is_active = TRUE; - qdf_spin_unlock_bh(&soc->ast_lock); - return 0; - } - - /* - * WAR for HK 1.x AST issue - * If an AST entry with same mac address already - * exists and is mapped to a different radio, and - * if the current radio is primary radio , delete - * the existing AST entry and return. - * - * New AST entry will be created again on next - * SA_invalid frame - */ - if ((ast_entry->pdev_id != vdev->pdev->pdev_id) && - vdev->pdev->is_primary) { - QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, - "Deleting ast_pdev=%d pdev=%d addr=%pM\n", - ast_entry->pdev_id, - vdev->pdev->pdev_id, mac_addr); - dp_peer_del_ast(soc, ast_entry); - } qdf_spin_unlock_bh(&soc->ast_lock); return 0; diff --git a/dp/wifi3.0/dp_rx.h b/dp/wifi3.0/dp_rx.h index a1b9034a6038..cf1d64858a40 100644 --- a/dp/wifi3.0/dp_rx.h +++ b/dp/wifi3.0/dp_rx.h @@ -489,11 +489,22 @@ dp_rx_wds_srcport_learn(struct dp_soc *soc, (ast->type != CDP_TXRX_AST_TYPE_SELF) && (ast->type != CDP_TXRX_AST_TYPE_STA_BSS)) { if (ast->pdev_id != ta_peer->vdev->pdev->pdev_id) { - ret = dp_peer_add_ast(soc, - ta_peer, wds_src_mac, - CDP_TXRX_AST_TYPE_WDS, - flags); + /* This case is when a STA roams from one + * repeater to another repeater, but these + * repeaters are connected to root AP on + * different radios. + * Ex: rptr1 connected to ROOT AP over 5G + * and rptr2 connected to ROOT AP over 2G + * radio + */ + qdf_spin_lock_bh(&soc->ast_lock); + dp_peer_del_ast(soc, ast); + qdf_spin_unlock_bh(&soc->ast_lock); } else { + /* this case is when a STA roams from one + * reapter to another repeater, but inside + * same radio. + */ qdf_spin_lock_bh(&soc->ast_lock); dp_peer_update_ast(soc, ta_peer, ast, flags); qdf_spin_unlock_bh(&soc->ast_lock);