Ver Fonte

qcacld-3.0: Fill vdev mlme bss channel just after vdev start

Copy desire channel to vdev mlme bss channel after vdev start,
several APIs used bss channel before it is filled, issue happens
like wrong max tx power is set.

Change-Id: Ib46b5b9eebc2000d703dc542c97f85281c0f376c
CRs-Fixed: 2636775
Jianmin Zhu há 5 anos atrás
pai
commit
3fa522c495
1 ficheiros alterados com 17 adições e 9 exclusões
  1. 17 9
      core/wma/src/wma_dev_if.c

+ 17 - 9
core/wma/src/wma_dev_if.c

@@ -3344,15 +3344,18 @@ wma_vdev_set_bss_params(tp_wma_handle wma, int vdev_id,
 
 	if (!maxTxPower)
 		WMA_LOGW("Setting Tx power limit to 0");
-	wma_debug("Set maxTx pwr to %d", maxTxPower);
-	ret = wma_vdev_set_param(wma->wmi_handle, vdev_id,
-					      WMI_VDEV_PARAM_TX_PWRLIMIT,
-					      maxTxPower);
-	if (QDF_IS_STATUS_ERROR(ret))
-		WMA_LOGE("failed to set WMI_VDEV_PARAM_TX_PWRLIMIT");
-	else
-		mlme_set_max_reg_power(intr[vdev_id].vdev, maxTxPower);
-
+	wma_debug("Set max Tx power to %d", maxTxPower);
+	if (maxTxPower != INVALID_TXPOWER) {
+		ret = wma_vdev_set_param(wma->wmi_handle, vdev_id,
+					 WMI_VDEV_PARAM_TX_PWRLIMIT,
+					 maxTxPower);
+		if (QDF_IS_STATUS_ERROR(ret))
+			WMA_LOGE("failed to set WMI_VDEV_PARAM_TX_PWRLIMIT");
+		else
+			mlme_set_max_reg_power(intr[vdev_id].vdev, maxTxPower);
+	} else {
+		wma_err("Invalid max Tx power");
+	}
 	/* Slot time */
 	if (shortSlotTimeSupported)
 		slot_time = WMI_VDEV_SLOT_TIME_SHORT;
@@ -3522,6 +3525,11 @@ QDF_STATUS wma_post_vdev_start_setup(uint8_t vdev_id)
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	/* Fill bss_chan after vdev start */
+	qdf_mem_copy(vdev->vdev_mlme.bss_chan,
+		     vdev->vdev_mlme.des_chan,
+		     sizeof(struct wlan_channel));
+
 	bss_power = wlan_reg_get_channel_reg_power_for_freq(wma->pdev,
 							    vdev->vdev_mlme.bss_chan->ch_freq);
 	wma_vdev_set_bss_params(wma, vdev_id,