|
@@ -1124,6 +1124,40 @@ hdd_set_nss_params(struct hdd_adapter *adapter,
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
+static void
|
|
|
+hdd_update_nss_in_vdev(struct hdd_adapter *adapter, mac_handle_t mac_handle,
|
|
|
+ uint8_t tx_nss, uint8_t rx_nss)
|
|
|
+{
|
|
|
+ uint8_t band, max_supp_nss = MAX_VDEV_NSS;
|
|
|
+
|
|
|
+ for (band = NSS_CHAINS_BAND_2GHZ; band < NSS_CHAINS_BAND_MAX;
|
|
|
+ band++) {
|
|
|
+ /* This API will change the global ini in mlme cfg */
|
|
|
+ sme_update_nss_in_mlme_cfg(mac_handle, rx_nss, tx_nss,
|
|
|
+ adapter->device_mode, band);
|
|
|
+ /*
|
|
|
+ * This API will change the vdev nss params in mac
|
|
|
+ * context
|
|
|
+ */
|
|
|
+ sme_update_vdev_type_nss(mac_handle, max_supp_nss,
|
|
|
+ band);
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ * This API will change the ini and dynamic nss params in
|
|
|
+ * mlme vdev priv obj.
|
|
|
+ */
|
|
|
+ hdd_store_nss_chains_cfg_in_vdev(adapter);
|
|
|
+}
|
|
|
+
|
|
|
+static void hdd_set_sap_nss_params(struct hdd_context *hdd_ctx,
|
|
|
+ struct hdd_adapter *adapter,
|
|
|
+ mac_handle_t mac_handle,
|
|
|
+ uint8_t tx_nss, uint8_t rx_nss)
|
|
|
+{
|
|
|
+ hdd_update_nss_in_vdev(adapter, mac_handle, tx_nss, rx_nss);
|
|
|
+ hdd_restart_sap(adapter);
|
|
|
+}
|
|
|
+
|
|
|
QDF_STATUS hdd_update_nss(struct hdd_adapter *adapter, uint8_t tx_nss,
|
|
|
uint8_t rx_nss)
|
|
|
{
|
|
@@ -1138,7 +1172,7 @@ QDF_STATUS hdd_update_nss(struct hdd_adapter *adapter, uint8_t tx_nss,
|
|
|
uint8_t enable2x2;
|
|
|
mac_handle_t mac_handle;
|
|
|
bool bval = 0;
|
|
|
- uint8_t band, max_supp_nss;
|
|
|
+ bool restart_sap = 0;
|
|
|
|
|
|
if ((tx_nss == 2 || rx_nss == 2) && (hdd_ctx->num_rf_chains != 2)) {
|
|
|
hdd_err("No support for 2 spatial streams");
|
|
@@ -1162,7 +1196,6 @@ QDF_STATUS hdd_update_nss(struct hdd_adapter *adapter, uint8_t tx_nss,
|
|
|
hdd_err("NULL MAC handle");
|
|
|
return QDF_STATUS_E_INVAL;
|
|
|
}
|
|
|
- max_supp_nss = MAX_VDEV_NSS;
|
|
|
|
|
|
/*
|
|
|
* If FW is supporting the dynamic nss update, this command is meant to
|
|
@@ -1170,6 +1203,23 @@ QDF_STATUS hdd_update_nss(struct hdd_adapter *adapter, uint8_t tx_nss,
|
|
|
* and not the global param enable2x2
|
|
|
*/
|
|
|
if (hdd_ctx->dynamic_nss_chains_support) {
|
|
|
+ ucfg_mlme_get_restart_sap_on_dynamic_nss_chains_cfg(
|
|
|
+ hdd_ctx->psoc,
|
|
|
+ &restart_sap);
|
|
|
+ if ((adapter->device_mode == QDF_SAP_MODE ||
|
|
|
+ adapter->device_mode == QDF_P2P_GO_MODE) && restart_sap) {
|
|
|
+ if ((tx_nss == 2 && rx_nss == 2) ||
|
|
|
+ (tx_nss == 1 && rx_nss == 1)) {
|
|
|
+ hdd_set_sap_nss_params(hdd_ctx, adapter,
|
|
|
+ mac_handle, tx_nss,
|
|
|
+ rx_nss);
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+ }
|
|
|
+ hdd_err("tx_nss %d rx_nss %d not supported ",
|
|
|
+ tx_nss, rx_nss);
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
+ }
|
|
|
+
|
|
|
if (hdd_is_vdev_in_conn_state(adapter))
|
|
|
return hdd_set_nss_params(adapter, tx_nss, rx_nss);
|
|
|
hdd_debug("Vdev %d in disconnect state, changing ini nss params",
|
|
@@ -1179,23 +1229,7 @@ QDF_STATUS hdd_update_nss(struct hdd_adapter *adapter, uint8_t tx_nss,
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
- for (band = NSS_CHAINS_BAND_2GHZ; band < NSS_CHAINS_BAND_MAX;
|
|
|
- band++) {
|
|
|
- /* This API will change the global ini in mlme cfg */
|
|
|
- sme_update_nss_in_mlme_cfg(mac_handle, rx_nss, tx_nss,
|
|
|
- adapter->device_mode, band);
|
|
|
- /*
|
|
|
- * This API will change the vdev nss params in mac
|
|
|
- * context
|
|
|
- */
|
|
|
- sme_update_vdev_type_nss(mac_handle, max_supp_nss,
|
|
|
- band);
|
|
|
- }
|
|
|
- /*
|
|
|
- * This API will change the ini and dynamic nss params in
|
|
|
- * mlme vdev priv obj.
|
|
|
- */
|
|
|
- hdd_store_nss_chains_cfg_in_vdev(adapter);
|
|
|
+ hdd_update_nss_in_vdev(adapter, mac_handle, tx_nss, rx_nss);
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|