Sfoglia il codice sorgente

qcacld-3.0: Fix peer phymode for STA while updating opmode

In STA use iface->chanmode which is updated during vdev restart to
set the bss peer channel width.

Also remove the API to set phymode during this as the phymode is
already set during vdev start or restart, so no need to set the
phymode again.

So just check if the new BW is valid for the current phymode
and if so set the BW for the peer.

Change-Id: Ic258703acbab0a97629ff4e1945f6729b3fe517f
CRs-Fixed: 2535576
Abhishek Singh 5 anni fa
parent
commit
89c367457b
1 ha cambiato i file con 29 aggiunte e 27 eliminazioni
  1. 29 27
      core/wma/src/wma_mgmt.c

+ 29 - 27
core/wma/src/wma_mgmt.c

@@ -3543,36 +3543,43 @@ void wma_process_update_opmode(tp_wma_handle wma_handle,
 	struct wlan_objmgr_peer *peer;
 	struct wlan_objmgr_psoc *psoc = wma_handle->psoc;
 	enum wlan_phymode peer_phymode;
-	WLAN_PHY_MODE fw_phymode;
+	uint32_t fw_phymode;
 	enum wlan_peer_type peer_type;
+	struct wma_txrx_node *iface;
 
-	pdev_id = wlan_objmgr_pdev_get_pdev_id(wma_handle->pdev);
-	peer = wlan_objmgr_get_peer(psoc, pdev_id, update_vht_opmode->peer_mac,
-				    WLAN_LEGACY_WMA_ID);
-	if (!peer) {
-		WMA_LOGE("peer object invalid");
-		return;
-	}
+	iface = &wma_handle->interfaces[update_vht_opmode->smesessionId];
 
-	peer_type = wlan_peer_get_peer_type(peer);
-	if (peer_type == WLAN_PEER_SELF) {
-		WMA_LOGE("self peer wrongly used");
-		wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_WMA_ID);
-		return;
-	}
+	if (iface->type == WMI_VDEV_TYPE_STA) {
+		fw_phymode = iface->chanmode;
+	} else {
+		pdev_id = wlan_objmgr_pdev_get_pdev_id(wma_handle->pdev);
+		peer = wlan_objmgr_get_peer(psoc, pdev_id,
+					    update_vht_opmode->peer_mac,
+					    WLAN_LEGACY_WMA_ID);
+		if (!peer) {
+			WMA_LOGE("peer object invalid");
+			return;
+		}
 
-	wlan_peer_obj_lock(peer);
-	peer_phymode = wlan_peer_get_phymode(peer);
-	wlan_peer_obj_unlock(peer);
-	wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_WMA_ID);
+		peer_type = wlan_peer_get_peer_type(peer);
+		if (peer_type == WLAN_PEER_SELF) {
+			WMA_LOGE("self peer wrongly used");
+			wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_WMA_ID);
+			return;
+		}
 
-	fw_phymode = wma_host_to_fw_phymode(peer_phymode);
+		wlan_peer_obj_lock(peer);
+		peer_phymode = wlan_peer_get_phymode(peer);
+		wlan_peer_obj_unlock(peer);
+		wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_WMA_ID);
+
+		fw_phymode = wma_host_to_fw_phymode(peer_phymode);
+	}
 
 	ch_width = wmi_get_ch_width_from_phy_mode(wma_handle->wmi_handle,
-						  (WMI_HOST_WLAN_PHY_MODE)
 						  fw_phymode);
-	WMA_LOGD("%s: peer phymode: %d, ch_width: %d, fw phymode: %d",
-		 __func__, peer_phymode, ch_width, fw_phymode);
+	WMA_LOGD("%s: ch_width: %d, fw phymode: %d", __func__,
+		 ch_width, fw_phymode);
 	if (ch_width < update_vht_opmode->opMode) {
 		WMA_LOGE("%s: Invalid peer bw update %d, self bw %d",
 				__func__, update_vht_opmode->opMode,
@@ -3580,11 +3587,6 @@ void wma_process_update_opmode(tp_wma_handle wma_handle,
 		return;
 	}
 
-	/* Always send phymode before BW to avoid any mismatch in FW */
-	wma_set_peer_param(wma_handle, update_vht_opmode->peer_mac,
-			   WMI_PEER_PHYMODE, fw_phymode,
-			   update_vht_opmode->smesessionId);
-
 	WMA_LOGD("%s: opMode = %d", __func__, update_vht_opmode->opMode);
 	wma_set_peer_param(wma_handle, update_vht_opmode->peer_mac,
 			   WMI_PEER_CHWIDTH, update_vht_opmode->opMode,