Prechádzať zdrojové kódy

qcacld-3.0: Set sta max tx power a valid value instead of zero

For MDM platform, user space don't call ll_stats_get every 3
seconds for station mode, and txpower value will not update.
If we use iw dev to get max tx power value, the value is 0,
and sync with firmware logic, host driver need set valid value
in cmd WMI_VDEV_START_REQUEST_CMDID.

Change-Id: I4a200b3dc517cfc73e90850becd223f7b4a940fb
CRs-Fixed: 3497587
Chunquan Luo 1 rok pred
rodič
commit
252ca098c3

+ 6 - 2
components/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c

@@ -116,7 +116,7 @@ static void tgt_mc_cp_stats_extract_tx_power(struct wlan_objmgr_psoc *psoc,
 					struct stats_event *ev,
 					bool is_station_stats)
 {
-	int32_t max_pwr;
+	int32_t max_pwr = 0;
 	uint8_t pdev_id;
 	QDF_STATUS status;
 	struct wlan_objmgr_pdev *pdev;
@@ -172,7 +172,11 @@ static void tgt_mc_cp_stats_extract_tx_power(struct wlan_objmgr_psoc *psoc,
 	    pdev_mc_stats->max_pwr != ev->pdev_stats[pdev_id].max_pwr)
 		wlan_son_deliver_tx_power(vdev,
 					  ev->pdev_stats[pdev_id].max_pwr);
-	max_pwr = pdev_mc_stats->max_pwr = ev->pdev_stats[pdev_id].max_pwr;
+	if (policy_mgr_mode_get_macid_by_vdev_id(psoc, last_req.vdev_id) ==
+	    ev->mac_seq_num)
+		max_pwr = pdev_mc_stats->max_pwr =
+			ev->pdev_stats[pdev_id].max_pwr;
+
 	wlan_cp_stats_pdev_obj_unlock(pdev_cp_stats_priv);
 	if (is_station_stats)
 		goto end;

+ 15 - 0
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -3281,6 +3281,21 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
 		session->maxTxPower = lim_get_max_tx_power(mac_ctx, mlme_obj);
 		session->def_max_tx_pwr = session->maxTxPower;
 	}
+
+	/*
+	 * for mdm platform which QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET
+	 * will not call from android framework every 3 seconds, and tx
+	 * power will never update. So we use iw dev get tx power need
+	 * set maxTxPower non-zero value, that firmware can calc a non-zero
+	 * tx power, and update to host driver.
+	 */
+	if (LIM_IS_STA_ROLE(session) && session->maxTxPower == 0) {
+		session->maxTxPower =
+			wlan_reg_get_channel_reg_power_for_freq(mac_ctx->pdev,
+							session->curr_op_freq);
+		pe_debug("session->maxTxPower %u", session->maxTxPower);
+	}
+
 	session->limRFBand = lim_get_rf_band(session->curr_op_freq);
 
 	/* Initialize 11h Enable Flag */