From b3e1a44d0baf0a14f96cc8987f14ed515aceff27 Mon Sep 17 00:00:00 2001 From: Rakesh Pillai Date: Fri, 25 Dec 2020 23:31:02 -0800 Subject: [PATCH] qcacld-3.0: Init-Deinit changes for WCN7850 Changes to initialize/deinitalize WCN7850 from HDD layer. CRs-Fixed: 2888534 Change-Id: Ia9e44f9fe0b4b6977c55c380756af0656203e4f5 --- .../dispatcher/inc/wlan_cp_stats_mc_tgt_api.h | 1 + core/cds/src/cds_api.c | 30 +++++++++++++++++-- core/dp/htt/htt_monitor_rx.c | 5 ++-- core/hdd/inc/wlan_hdd_main.h | 1 + core/hdd/src/wlan_hdd_main.c | 10 +++---- core/hdd/src/wlan_hdd_tx_rx.c | 17 ++++------- 6 files changed, 42 insertions(+), 22 deletions(-) diff --git a/components/cp_stats/dispatcher/inc/wlan_cp_stats_mc_tgt_api.h b/components/cp_stats/dispatcher/inc/wlan_cp_stats_mc_tgt_api.h index 80d1530cac..cbd4cb23aa 100644 --- a/components/cp_stats/dispatcher/inc/wlan_cp_stats_mc_tgt_api.h +++ b/components/cp_stats/dispatcher/inc/wlan_cp_stats_mc_tgt_api.h @@ -27,6 +27,7 @@ #ifdef QCA_SUPPORT_CP_STATS #include "wlan_cp_stats_mc_defs.h" +//TODO - Check if this is true for hamilton #ifdef QCA_WIFI_QCA6490 #define TGT_MAC_ID_24G 2 #define TGT_MAC_ID_5G 1 diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 7a9851805c..70668547c6 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -783,6 +783,9 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) TARGET_TYPE_QCA6490, TARGET_TYPE_QCA6750); + /* Set default value to false */ + hdd_ctx->is_wifi3_0_target = false; + if (TARGET_TYPE_QCA6290 == hdd_ctx->target_type || TARGET_TYPE_QCA6390 == hdd_ctx->target_type || TARGET_TYPE_QCA6490 == hdd_ctx->target_type || @@ -802,12 +805,32 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) status = QDF_STATUS_E_FAILURE; goto err_soc_detach; } - } - else + hdd_ctx->is_wifi3_0_target = true; + } else if (hdd_ctx->target_type == TARGET_TYPE_WCN7850) { + gp_cds_context->dp_soc = + cdp_soc_attach(BERYLLIUM_DP, + gp_cds_context->hif_context, + htcInfo.target_psoc, + gp_cds_context->htc_ctx, + gp_cds_context->qdf_ctx, + &dp_ol_if_ops); + if (gp_cds_context->dp_soc) + if (!cdp_soc_init(gp_cds_context->dp_soc, BERYLLIUM_DP, + gp_cds_context->hif_context, + htcInfo.target_psoc, + gp_cds_context->htc_ctx, + gp_cds_context->qdf_ctx, + &dp_ol_if_ops)) { + status = QDF_STATUS_E_FAILURE; + goto err_soc_detach; + } + hdd_ctx->is_wifi3_0_target = true; + } else { gp_cds_context->dp_soc = cdp_soc_attach(MOB_DRV_LEGACY_DP, gp_cds_context->hif_context, htcInfo.target_psoc, gp_cds_context->htc_ctx, gp_cds_context->qdf_ctx, &dp_ol_if_ops); + } if (!gp_cds_context->dp_soc) { status = QDF_STATUS_E_FAILURE; @@ -926,7 +949,8 @@ QDF_STATUS cds_dp_open(struct wlan_objmgr_psoc *psoc) if (hdd_ctx->target_type == TARGET_TYPE_QCA6290 || hdd_ctx->target_type == TARGET_TYPE_QCA6390 || hdd_ctx->target_type == TARGET_TYPE_QCA6490 || - hdd_ctx->target_type == TARGET_TYPE_QCA6750) { + hdd_ctx->target_type == TARGET_TYPE_QCA6750 || + hdd_ctx->target_type == TARGET_TYPE_WCN7850) { qdf_status = cdp_pdev_init(cds_get_context(QDF_MODULE_ID_SOC), gp_cds_context->htc_ctx, gp_cds_context->qdf_ctx, 0); diff --git a/core/dp/htt/htt_monitor_rx.c b/core/dp/htt/htt_monitor_rx.c index 3711862734..3c94b5ebaf 100644 --- a/core/dp/htt/htt_monitor_rx.c +++ b/core/dp/htt/htt_monitor_rx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -722,7 +722,8 @@ next_pop: #if defined(FEATURE_MONITOR_MODE_SUPPORT) #if !defined(QCA6290_HEADERS_DEF) && !defined(QCA6390_HEADERS_DEF) && \ - !defined(QCA6490_HEADERS_DEF) && !defined(QCA6750_HEADERS_DEF) + !defined(QCA6490_HEADERS_DEF) && !defined(QCA6750_HEADERS_DEF) && \ + !defined(WCN7850_HEADERS_DEF) static void htt_rx_parse_ppdu_start_status(struct htt_host_rx_desc_base *rx_desc, struct ieee80211_rx_status *rs) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index c3dd95078f..fd81377182 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -2215,6 +2215,7 @@ struct hdd_context { #ifdef WLAN_SUPPORT_TWT qdf_work_t twt_en_dis_work; #endif + bool is_wifi3_0_target; }; /** diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 7f315a7cd9..c1c2bc5045 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -14460,11 +14460,11 @@ int hdd_configure_cds(struct hdd_context *hdd_ctx) if (ret) goto cds_disable; - /* Donot disable rx offload on concurrency for lithium based targets */ - if (!(hdd_ctx->target_type == TARGET_TYPE_QCA6290 || - hdd_ctx->target_type == TARGET_TYPE_QCA6390 || - hdd_ctx->target_type == TARGET_TYPE_QCA6490 || - hdd_ctx->target_type == TARGET_TYPE_QCA6750)) + /* + * Donot disable rx offload on concurrency for lithium and + * beryllium based targets + */ + if (!hdd_ctx->is_wifi3_0_target) if (hdd_ctx->ol_enable) dp_cbs.hdd_disable_rx_ol_in_concurrency = hdd_disable_rx_ol_in_concurrency; diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 17087a394d..61bcb69307 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -1922,12 +1922,12 @@ static void hdd_qdf_lro_flush(void *data) /** * hdd_register_rx_ol() - Register LRO/GRO rx processing callbacks * @hdd_ctx: pointer to hdd_ctx - * @lithium_based_target: whether its a lithium arch based target or not + * @wifi3_0_target: whether its a lithium/beryllium arch based target or not * * Return: none */ static void hdd_register_rx_ol_cb(struct hdd_context *hdd_ctx, - bool lithium_based_target) + bool wifi3_0_target) { void *soc = cds_get_context(QDF_MODULE_ID_SOC); @@ -1944,7 +1944,7 @@ static void hdd_register_rx_ol_cb(struct hdd_context *hdd_ctx, hdd_debug("LRO is enabled"); } else if (hdd_ctx->ol_enable == CFG_GRO_ENABLED) { qdf_atomic_set(&hdd_ctx->dp_agg_param.rx_aggregation, 1); - if (lithium_based_target) { + if (wifi3_0_target) { /* no flush registration needed, it happens in DP thread */ hdd_ctx->receive_offload_cb = hdd_gro_rx_dp_thread; } else { @@ -2011,18 +2011,11 @@ static int hdd_rx_ol_send_config(struct hdd_context *hdd_ctx) int hdd_rx_ol_init(struct hdd_context *hdd_ctx) { int ret = 0; - bool lithium_based_target = false; - - if (hdd_ctx->target_type == TARGET_TYPE_QCA6290 || - hdd_ctx->target_type == TARGET_TYPE_QCA6390 || - hdd_ctx->target_type == TARGET_TYPE_QCA6490 || - hdd_ctx->target_type == TARGET_TYPE_QCA6750) - lithium_based_target = true; hdd_resolve_rx_ol_mode(hdd_ctx); - hdd_register_rx_ol_cb(hdd_ctx, lithium_based_target); + hdd_register_rx_ol_cb(hdd_ctx, hdd_ctx->is_wifi3_0_target); - if (!lithium_based_target) { + if (!hdd_ctx->is_wifi3_0_target) { ret = hdd_rx_ol_send_config(hdd_ctx); if (ret) { hdd_ctx->ol_enable = 0;