ソースを参照

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
Vinod Kumar Pirla 2 年 前
コミット
972c244109

+ 6 - 6
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);
 
 
 /**

+ 8 - 6
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;
 }

+ 2 - 2
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;