浏览代码

qcacld-3.0: Fix MAXTXPOWER command not applying on STA mode

Current code does not set MAXTXPOWER when using wpa_cli tool.
This is due to current code setting the tx param to the self
MAC address rather than the BSSID during STA mode.
Fix this by checking mode of adapter and setting appropriate
MAC address accordingly.

Change-Id: I32c1609812273184ddf582c404b1a5827c62ca7d
CRs-Fixed: 3552240
Mohammed Ahmed 1 年之前
父节点
当前提交
1899618ebc
共有 1 个文件被更改,包括 12 次插入2 次删除
  1. 12 2
      core/hdd/src/wlan_hdd_ioctl.c

+ 12 - 2
core/hdd/src/wlan_hdd_ioctl.c

@@ -5094,8 +5094,18 @@ static int drv_cmd_max_tx_power(struct wlan_hdd_link_info *link_info,
 	hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
 					   dbgid) {
 		/* Assign correct self MAC address */
-		qdf_copy_macaddr(&bssid,
-				 &adapter->mac_addr);
+		if (adapter->device_mode == QDF_SAP_MODE ||
+		    adapter->device_mode == QDF_P2P_GO_MODE) {
+			qdf_copy_macaddr(&bssid, &adapter->mac_addr);
+		} else {
+			struct hdd_station_ctx *sta_ctx =
+				WLAN_HDD_GET_STATION_CTX_PTR(adapter->deflink);
+
+			if (hdd_cm_is_vdev_associated(adapter->deflink))
+				qdf_copy_macaddr(&bssid,
+						 &sta_ctx->conn_info.bssid);
+		}
+
 		qdf_copy_macaddr(&selfmac,
 				 &adapter->mac_addr);