From 972c2441098f0dcfee0a97fb794e13682b9c0360 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Pirla Date: Sat, 25 Feb 2023 03:17:35 -0800 Subject: [PATCH] qcacld-3.0: Refactor Tx/Rx NSS config get APIs Modify the following APIs to take link info as function argument to get the per link Tx/Rx NSS configuration of the corresponding VDEV. The existing callers moved to deflink pointer. 1) hdd_get_tx_nss() 2) hdd_get_rx_nss() Change-Id: Id78d3c90783d443ffa27a499b5d60c0362cb7536 CRs-Fixed: 3521577 --- core/hdd/inc/wlan_hdd_cfg.h | 12 ++++++------ core/hdd/src/wlan_hdd_cfg.c | 14 ++++++++------ core/hdd/src/wlan_hdd_cfg80211.c | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index eaee5a529a..f932783c4f 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -283,8 +283,7 @@ QDF_STATUS hdd_get_nss(struct hdd_adapter *adapter, uint8_t *nss); /** * hdd_get_tx_nss() - Get the number of spatial streams supported by the adapter - * - * @adapter: the pointer to adapter + * @link_info: Link info pointer in HDD adapter * @tx_nss: the number Tx of spatial streams supported by the adapter * * This function is used to get the number of Tx spatial streams supported by @@ -292,12 +291,12 @@ QDF_STATUS hdd_get_nss(struct hdd_adapter *adapter, uint8_t *nss); * * Return: QDF_STATUS */ -QDF_STATUS hdd_get_tx_nss(struct hdd_adapter *adapter, uint8_t *tx_nss); +QDF_STATUS hdd_get_tx_nss(struct wlan_hdd_link_info *link_info, + uint8_t *tx_nss); /** * hdd_get_rx_nss() - Get the number of spatial streams supported by the adapter - * - * @adapter: the pointer to adapter + * @link_info: Link info pointer in HDD adapter * @rx_nss: the number Rx of spatial streams supported by the adapter * * This function is used to get the number of Rx spatial streams supported by @@ -305,7 +304,8 @@ QDF_STATUS hdd_get_tx_nss(struct hdd_adapter *adapter, uint8_t *tx_nss); * * Return: QDF_STATUS */ -QDF_STATUS hdd_get_rx_nss(struct hdd_adapter *adapter, uint8_t *rx_nss); +QDF_STATUS hdd_get_rx_nss(struct wlan_hdd_link_info *link_info, + uint8_t *rx_nss); /** diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index f748fed44f..c51fa426dd 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -1534,15 +1534,16 @@ hdd_get_sta_tx_nss(struct wlan_hdd_link_info *link_info, uint8_t *tx_nss) return QDF_STATUS_SUCCESS; } -QDF_STATUS hdd_get_tx_nss(struct hdd_adapter *adapter, uint8_t *tx_nss) +QDF_STATUS hdd_get_tx_nss(struct wlan_hdd_link_info *link_info, uint8_t *tx_nss) { + struct hdd_adapter *adapter = link_info->adapter; QDF_STATUS status = QDF_STATUS_SUCCESS; if (adapter->device_mode == QDF_SAP_MODE || adapter->device_mode == QDF_P2P_GO_MODE) - status = hdd_get_sap_tx_nss(adapter->deflink, tx_nss); + status = hdd_get_sap_tx_nss(link_info, tx_nss); else - status = hdd_get_sta_tx_nss(adapter->deflink, tx_nss); + status = hdd_get_sta_tx_nss(link_info, tx_nss); return status; } @@ -1659,15 +1660,16 @@ hdd_get_sta_rx_nss(struct wlan_hdd_link_info *link_info, uint8_t *rx_nss) return QDF_STATUS_SUCCESS; } -QDF_STATUS hdd_get_rx_nss(struct hdd_adapter *adapter, uint8_t *rx_nss) +QDF_STATUS hdd_get_rx_nss(struct wlan_hdd_link_info *link_info, uint8_t *rx_nss) { QDF_STATUS status = QDF_STATUS_SUCCESS; + struct hdd_adapter *adapter = link_info->adapter; if (adapter->device_mode == QDF_SAP_MODE || adapter->device_mode == QDF_P2P_GO_MODE) - status = hdd_get_sap_rx_nss(adapter->deflink, rx_nss); + status = hdd_get_sap_rx_nss(link_info, rx_nss); else - status = hdd_get_sta_rx_nss(adapter->deflink, rx_nss); + status = hdd_get_sta_rx_nss(link_info, rx_nss); return status; } diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 07bc036cd5..6b48bfaa3c 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -11737,7 +11737,7 @@ static int hdd_get_tx_nss_config(struct wlan_hdd_link_info *link_info, return -EINVAL; } - status = hdd_get_tx_nss(link_info->adapter, &tx_nss); + status = hdd_get_tx_nss(link_info, &tx_nss); if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("Failed to get nss"); return -EINVAL; @@ -11772,7 +11772,7 @@ static int hdd_get_rx_nss_config(struct wlan_hdd_link_info *link_info, return -EINVAL; } - status = hdd_get_rx_nss(link_info->adapter, &rx_nss); + status = hdd_get_rx_nss(link_info, &rx_nss); if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("Failed to get nss"); return -EINVAL;