|
@@ -49,6 +49,7 @@
|
|
|
#include "cfg_ucfg_api.h"
|
|
|
#include "hdd_dp_cfg.h"
|
|
|
#include <wma_api.h>
|
|
|
+#include "wlan_hdd_object_manager.h"
|
|
|
|
|
|
/**
|
|
|
* get_next_line() - find and locate the new line pointer
|
|
@@ -1287,6 +1288,102 @@ QDF_STATUS hdd_get_nss(struct hdd_adapter *adapter, uint8_t *nss)
|
|
|
return status;
|
|
|
}
|
|
|
|
|
|
+QDF_STATUS hdd_get_tx_nss(struct hdd_adapter *adapter, uint8_t *tx_nss)
|
|
|
+{
|
|
|
+ struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
+ struct wlan_mlme_nss_chains *dynamic_cfg;
|
|
|
+ enum band_info operating_band;
|
|
|
+ uint8_t proto_generic_nss;
|
|
|
+
|
|
|
+ vdev = hdd_objmgr_get_vdev(adapter);
|
|
|
+ if (!vdev)
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+
|
|
|
+ proto_generic_nss = wlan_vdev_mlme_get_nss(vdev);
|
|
|
+ if (hdd_ctx->dynamic_nss_chains_support) {
|
|
|
+ dynamic_cfg = mlme_get_dynamic_vdev_config(vdev);
|
|
|
+ if (!dynamic_cfg) {
|
|
|
+ hdd_err("nss chain dynamic config NULL");
|
|
|
+ hdd_objmgr_put_vdev(vdev);
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+ }
|
|
|
+ if (adapter->device_mode == QDF_SAP_MODE ||
|
|
|
+ adapter->device_mode == QDF_P2P_GO_MODE) {
|
|
|
+ operating_band = hdd_get_sap_operating_band(
|
|
|
+ adapter->hdd_ctx);
|
|
|
+ } else {
|
|
|
+ operating_band = hdd_conn_get_connected_band(
|
|
|
+ &adapter->session.station);
|
|
|
+ }
|
|
|
+ switch (operating_band) {
|
|
|
+ case BAND_2G:
|
|
|
+ *tx_nss = dynamic_cfg->tx_nss[NSS_CHAINS_BAND_2GHZ];
|
|
|
+ break;
|
|
|
+ case BAND_5G:
|
|
|
+ *tx_nss = dynamic_cfg->tx_nss[NSS_CHAINS_BAND_5GHZ];
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ *tx_nss = proto_generic_nss;
|
|
|
+ }
|
|
|
+ if (*tx_nss > proto_generic_nss)
|
|
|
+ *tx_nss = proto_generic_nss;
|
|
|
+ } else
|
|
|
+ *tx_nss = proto_generic_nss;
|
|
|
+ hdd_objmgr_put_vdev(vdev);
|
|
|
+
|
|
|
+ return status;
|
|
|
+}
|
|
|
+
|
|
|
+QDF_STATUS hdd_get_rx_nss(struct hdd_adapter *adapter, uint8_t *rx_nss)
|
|
|
+{
|
|
|
+ struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
+ struct wlan_mlme_nss_chains *dynamic_cfg;
|
|
|
+ enum band_info operating_band;
|
|
|
+ uint8_t proto_generic_nss;
|
|
|
+
|
|
|
+ vdev = hdd_objmgr_get_vdev(adapter);
|
|
|
+ if (!vdev)
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+
|
|
|
+ proto_generic_nss = wlan_vdev_mlme_get_nss(vdev);
|
|
|
+ if (hdd_ctx->dynamic_nss_chains_support) {
|
|
|
+ dynamic_cfg = mlme_get_dynamic_vdev_config(vdev);
|
|
|
+ if (!dynamic_cfg) {
|
|
|
+ hdd_err("nss chain dynamic config NULL");
|
|
|
+ hdd_objmgr_put_vdev(vdev);
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+ }
|
|
|
+ if (adapter->device_mode == QDF_SAP_MODE ||
|
|
|
+ adapter->device_mode == QDF_P2P_GO_MODE) {
|
|
|
+ operating_band = hdd_get_sap_operating_band(
|
|
|
+ adapter->hdd_ctx);
|
|
|
+ } else {
|
|
|
+ operating_band = hdd_conn_get_connected_band(
|
|
|
+ &adapter->session.station);
|
|
|
+ }
|
|
|
+ switch (operating_band) {
|
|
|
+ case BAND_2G:
|
|
|
+ *rx_nss = dynamic_cfg->rx_nss[NSS_CHAINS_BAND_2GHZ];
|
|
|
+ break;
|
|
|
+ case BAND_5G:
|
|
|
+ *rx_nss = dynamic_cfg->rx_nss[NSS_CHAINS_BAND_5GHZ];
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ *rx_nss = proto_generic_nss;
|
|
|
+ }
|
|
|
+ if (*rx_nss > proto_generic_nss)
|
|
|
+ *rx_nss = proto_generic_nss;
|
|
|
+ } else
|
|
|
+ *rx_nss = proto_generic_nss;
|
|
|
+ hdd_objmgr_put_vdev(vdev);
|
|
|
+
|
|
|
+ return status;
|
|
|
+}
|
|
|
+
|
|
|
int hdd_vendor_mode_to_phymode(enum qca_wlan_vendor_phy_mode vendor_phy_mode,
|
|
|
eCsrPhyMode *csr_phy_mode)
|
|
|
{
|