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
This commit is contained in:
Vinod Kumar Pirla
2023-02-25 03:17:35 -08:00
committed by Rahul Choudhary
parent bd1f07ea32
commit 972c244109
3 changed files with 16 additions and 14 deletions

View File

@@ -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 * hdd_get_tx_nss() - Get the number of spatial streams supported by the adapter
* * @link_info: Link info pointer in HDD adapter
* @adapter: the pointer to adapter
* @tx_nss: the number Tx of spatial streams supported by the 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 * 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 * 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 * hdd_get_rx_nss() - Get the number of spatial streams supported by the adapter
* * @link_info: Link info pointer in HDD adapter
* @adapter: the pointer to adapter
* @rx_nss: the number Rx of spatial streams supported by the 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 * 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 * 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);
/** /**

View File

@@ -1534,15 +1534,16 @@ hdd_get_sta_tx_nss(struct wlan_hdd_link_info *link_info, uint8_t *tx_nss)
return QDF_STATUS_SUCCESS; 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; QDF_STATUS status = QDF_STATUS_SUCCESS;
if (adapter->device_mode == QDF_SAP_MODE || if (adapter->device_mode == QDF_SAP_MODE ||
adapter->device_mode == QDF_P2P_GO_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 else
status = hdd_get_sta_tx_nss(adapter->deflink, tx_nss); status = hdd_get_sta_tx_nss(link_info, tx_nss);
return status; 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; 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; QDF_STATUS status = QDF_STATUS_SUCCESS;
struct hdd_adapter *adapter = link_info->adapter;
if (adapter->device_mode == QDF_SAP_MODE || if (adapter->device_mode == QDF_SAP_MODE ||
adapter->device_mode == QDF_P2P_GO_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 else
status = hdd_get_sta_rx_nss(adapter->deflink, rx_nss); status = hdd_get_sta_rx_nss(link_info, rx_nss);
return status; return status;
} }

View File

@@ -11737,7 +11737,7 @@ static int hdd_get_tx_nss_config(struct wlan_hdd_link_info *link_info,
return -EINVAL; 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)) { if (!QDF_IS_STATUS_SUCCESS(status)) {
hdd_err("Failed to get nss"); hdd_err("Failed to get nss");
return -EINVAL; return -EINVAL;
@@ -11772,7 +11772,7 @@ static int hdd_get_rx_nss_config(struct wlan_hdd_link_info *link_info,
return -EINVAL; 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)) { if (!QDF_IS_STATUS_SUCCESS(status)) {
hdd_err("Failed to get nss"); hdd_err("Failed to get nss");
return -EINVAL; return -EINVAL;