From 2467ed1445e527cdb777b3dee2fa485657d9a0cb Mon Sep 17 00:00:00 2001 From: Chaithanya Garrepalli Date: Tue, 11 Sep 2018 23:57:43 +0530 Subject: [PATCH] qcacmn: avoid wds source port learning for STA in HKV2 Changes to avoid WDS source port learning in STA mode if ast override feature is supported by HW Change-Id: I248c8815429e7417dcf3f451912ee5f037af9c25 --- dp/wifi3.0/dp_main.c | 8 +++++++- dp/wifi3.0/dp_rx.h | 6 ++++++ dp/wifi3.0/dp_tx.c | 12 +++++++++++- dp/wifi3.0/dp_types.h | 7 +++++++ hal/wifi3.0/hal_tx.h | 4 ++++ 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index cfa1c9a5711d..3a616a3eb149 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -8129,13 +8129,18 @@ void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, target_type = hal_get_target_type(soc->hal_soc); switch (target_type) { case TARGET_TYPE_QCA6290: + wlan_cfg_set_reo_dst_ring_size(soc->wlan_cfg_ctx, + REO_DST_RING_SIZE_QCA6290); + soc->ast_override_support = 1; + break; #ifdef QCA_WIFI_QCA6390 case TARGET_TYPE_QCA6390: -#endif wlan_cfg_set_reo_dst_ring_size(soc->wlan_cfg_ctx, REO_DST_RING_SIZE_QCA6290); wlan_cfg_set_raw_mode_war(soc->wlan_cfg_ctx, true); + soc->ast_override_support = 1; break; +#endif case TARGET_TYPE_QCA8074: wlan_cfg_set_reo_dst_ring_size(soc->wlan_cfg_ctx, REO_DST_RING_SIZE_QCA8074); @@ -8147,6 +8152,7 @@ void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, REO_DST_RING_SIZE_QCA8074); wlan_cfg_set_raw_mode_war(soc->wlan_cfg_ctx, false); soc->hw_nac_monitor_support = 1; + soc->ast_override_support = 1; break; default: qdf_print("%s: Unknown tgt type %d\n", __func__, target_type); diff --git a/dp/wifi3.0/dp_rx.h b/dp/wifi3.0/dp_rx.h index 37aa064b580b..d51f8d5f8c8a 100644 --- a/dp/wifi3.0/dp_rx.h +++ b/dp/wifi3.0/dp_rx.h @@ -416,6 +416,12 @@ dp_rx_wds_srcport_learn(struct dp_soc *soc, if (!(qdf_nbuf_is_rx_chfrag_start(nbuf) && hal_rx_get_mpdu_mac_ad4_valid(rx_tlv_hdr))) return; + } else { + /* For HKv2 Source port learing is not needed in STA mode + * as we have support in HW + */ + if (soc->ast_override_support) + return; } memcpy(wds_src_mac, (qdf_nbuf_data(nbuf) + IEEE80211_ADDR_LEN), diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index b829098ac9d4..ae768f02d2ad 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -923,7 +923,12 @@ static QDF_STATUS dp_tx_hw_enqueue(struct dp_soc *soc, struct dp_vdev *vdev, hal_tx_desc_set_buf_offset(hal_tx_desc_cached, tx_desc->pkt_offset); hal_tx_desc_set_encap_type(hal_tx_desc_cached, tx_desc->tx_encap_type); hal_tx_desc_set_lmac_id(soc->hal_soc, hal_tx_desc_cached, - HAL_TX_DESC_DEFAULT_LMAC_ID); + vdev->pdev->pdev_id); + + hal_tx_desc_set_search_type(soc->hal_soc, hal_tx_desc_cached, + vdev->search_type); + hal_tx_desc_set_search_index(soc->hal_soc, hal_tx_desc_cached, + vdev->bss_ast_hash); hal_tx_desc_set_dscp_tid_table_id(soc->hal_soc, hal_tx_desc_cached, vdev->dscp_tid_map_id); hal_tx_desc_set_encrypt_type(hal_tx_desc_cached, @@ -3214,6 +3219,11 @@ void dp_tx_vdev_update_search_flags(struct dp_vdev *vdev) vdev->hal_desc_addr_search_flags = HAL_TX_DESC_ADDRY_EN; else vdev->hal_desc_addr_search_flags = HAL_TX_DESC_ADDRX_EN; + + if (vdev->opmode == wlan_op_mode_sta) + vdev->search_type = HAL_TX_ADDR_INDEX_SEARCH; + else + vdev->search_type = HAL_TX_ADDR_SEARCH_DEFAULT; } #ifdef QCA_LL_TX_FLOW_CONTROL_V2 diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 498a5718169a..af456870a0f7 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -688,6 +688,9 @@ struct dp_soc { /*cce disable*/ bool cce_disable; + /*ast override support in HW*/ + bool ast_override_support; + /* Link descriptor memory banks */ struct { void *base_vaddr_unaligned; @@ -1407,6 +1410,10 @@ struct dp_vdev { /* SWAR for HW: Enable WEP bit in the AMSDU frames for RAW mode */ bool raw_mode_war; + + /* Address search type to be set in TX descriptor */ + uint8_t search_type; + /* AST hash value for BSS peer in HW valid for STA VAP*/ uint16_t bss_ast_hash; }; diff --git a/hal/wifi3.0/hal_tx.h b/hal/wifi3.0/hal_tx.h index 20c313bd9404..68e717cf90ad 100644 --- a/hal/wifi3.0/hal_tx.h +++ b/hal/wifi3.0/hal_tx.h @@ -116,6 +116,10 @@ do { \ #define HAL_TX_DESC_ADDRY_EN 0x2 #define HAL_TX_DESC_DEFAULT_LMAC_ID 0x3 +#define HAL_TX_ADDR_SEARCH_DEFAULT 0x0 +#define HAL_TX_ADDR_INDEX_SEARCH 0x1 +#define HAL_TX_FLOW_INDEX_SEARCH 0x2 + enum hal_tx_ret_buf_manager { HAL_WBM_SW0_BM_ID = 3, HAL_WBM_SW1_BM_ID = 4,