From 9d7dc27fe2abf4a95f3164fe9b9b120994e33b89 Mon Sep 17 00:00:00 2001 From: Aniruddha Paul Date: Sun, 11 Feb 2018 19:40:41 +0530 Subject: [PATCH] qcacmn: Masked out the Host Tx Desc allocation for NSS offload Masking out the tx_desc and tx_ext_desc allocations for NSS offloaded radios. CRs-Fixed: 2188417 Change-Id: Ibe949a899da1dd2c815ce6a10c355f7ee5976e7a --- dp/wifi3.0/dp_main.c | 15 ++++++++++++++- dp/wifi3.0/dp_types.h | 14 ++++++++++++++ wlan_cfg/wlan_cfg.c | 20 ++++++++++++++++++++ wlan_cfg/wlan_cfg.h | 34 +++++++++++++++++++++++++++++++++- 4 files changed, 81 insertions(+), 2 deletions(-) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 52b1ed8fa8..771f395326 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -3007,7 +3007,20 @@ static int dp_soc_get_nss_cfg_wifi3(struct cdp_soc_t *cdp_soc) static void dp_soc_set_nss_cfg_wifi3(struct cdp_soc_t *cdp_soc, int config) { struct dp_soc *dsoc = (struct dp_soc *)cdp_soc; - wlan_cfg_set_dp_soc_nss_cfg(dsoc->wlan_cfg_ctx, config); + struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx = dsoc->wlan_cfg_ctx; + + wlan_cfg_set_dp_soc_nss_cfg(wlan_cfg_ctx, config); + + /* + * TODO: masked out based on the per offloaded radio + */ + if (config == dp_nss_cfg_dbdc) { + wlan_cfg_set_num_tx_desc_pool(wlan_cfg_ctx, 0); + wlan_cfg_set_num_tx_ext_desc_pool(wlan_cfg_ctx, 0); + wlan_cfg_set_num_tx_desc(wlan_cfg_ctx, 0); + wlan_cfg_set_num_tx_ext_desc(wlan_cfg_ctx, 0); + } + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, FL("nss-wifi<0> nss config is enabled")); } diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 6bf8802f1f..1d5a2661e0 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -192,6 +192,20 @@ enum dp_ast_type { dp_ast_type_mec, }; +/** + * enum dp_nss_cfg + * @dp_nss_cfg_default: No radios are offloaded + * @dp_nss_cfg_first_radio: First radio offloaded + * @dp_nss_cfg_second_radio: Second radio offloaded + * @dp_nss_cfg_dbdc: Dual radios offloaded + */ +enum dp_nss_cfg { + dp_nss_cfg_default, + dp_nss_cfg_first_radio, + dp_nss_cfg_second_radio, + dp_nss_cfg_dbdc, +}; + /** * struct rx_desc_pool * @pool_size: number of RX descriptor in the pool diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index baf926d986..40215f4ca4 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -584,21 +584,41 @@ int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg) return cfg->num_tx_desc_pool; } +void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool) +{ + cfg->num_tx_desc_pool = num_pool; +} + int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg) { return cfg->num_tx_ext_desc_pool; } +void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool) +{ + cfg->num_tx_ext_desc_pool = num_pool; +} + int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg) { return cfg->num_tx_desc; } +void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc) +{ + cfg->num_tx_desc = num_desc; +} + int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg) { return cfg->num_tx_ext_desc; } +void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc) +{ + cfg->num_tx_ext_desc = num_ext_desc; +} + uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg) { /* TODO: This should be calculated based on target capabilities */ diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index 802860f776..fcd9fa5929 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -1,6 +1,6 @@ /* * * Copyright (c) 2013-2018 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 * above copyright notice and this permission notice appear in all @@ -456,6 +456,14 @@ int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); */ int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); +/* + * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the + * device + * @wlan_cfg_ctx - Configuration Handle + * @num_pool - Number of pool + */ +void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool); + /* * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor * pools @@ -466,6 +474,14 @@ int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); int wlan_cfg_get_num_tx_ext_desc_pool( struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); +/* + * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor + * pools + * @wlan_cfg_ctx - Configuration Handle + * @num_pool - Number of pool + */ +void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool); + /* * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool * @wlan_cfg_ctx - Configuration Handle @@ -474,6 +490,14 @@ int wlan_cfg_get_num_tx_ext_desc_pool( */ int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); +/* + * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool + * + * @wlan_cfg_ctx - Configuration Handle + * @num_desc: Number of descriptor + */ +void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc); + /* * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors * per pool @@ -483,6 +507,14 @@ int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); */ int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); +/* + * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors + * per pool + * @wlan_cfg_ctx - Configuration Handle + * @num_desc: Number of descriptor + */ +void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc); + /* * wlan_cfg_max_peer_id() - Get maximum peer ID * @cfg: Configuration Handle