Преглед изворни кода

qcacld-3.0: Validate opmode update req before sending to FW

Check the current vdev supported bandwidth values agianst peer
opemode update value and if the peer opmode value is greater than
current supported value then do not send the opmode update request
to FW.

Change-Id: I8f360d769b5aafb90061a6a9d18f1f8062e3534e
CRs-Fixed: 2174050
Kiran Kumar Lokere пре 7 година
родитељ
комит
f7662e5fed
3 измењених фајлова са 21 додато и 2 уклоњено
  1. 8 0
      core/wma/inc/wma.h
  2. 1 1
      core/wma/src/wma_dev_if.c
  3. 12 1
      core/wma/src/wma_mgmt.c

+ 8 - 0
core/wma/inc/wma.h

@@ -2482,6 +2482,14 @@ void wma_vdev_clear_pause_bit(uint8_t vdev_id, wmi_tx_pause_type bit_pos)
 	iface->pause_bitmap &= ~(1 << bit_pos);
 }
 
+/**
+ * chanmode_to_chanwidth() - get channel width through channel mode
+ * @chanmode:   channel phy mode
+ *
+ * Return: channel width
+ */
+wmi_channel_width chanmode_to_chanwidth(WLAN_PHY_MODE chanmode);
+
 /**
  * wma_process_roaming_config() - process roam request
  * @wma_handle: wma handle

+ 1 - 1
core/wma/src/wma_dev_if.c

@@ -1000,7 +1000,7 @@ static const wmi_channel_width mode_to_width[MODE_MAX] = {
  *
  * Return: channel width
  */
-static wmi_channel_width chanmode_to_chanwidth(WLAN_PHY_MODE chanmode)
+wmi_channel_width chanmode_to_chanwidth(WLAN_PHY_MODE chanmode)
 {
 	wmi_channel_width chan_width;
 

+ 12 - 1
core/wma/src/wma_mgmt.c

@@ -2967,8 +2967,19 @@ int wma_mgmt_tx_bundle_completion_handler(void *handle, uint8_t *buf,
 void wma_process_update_opmode(tp_wma_handle wma_handle,
 			       tUpdateVHTOpMode *update_vht_opmode)
 {
-	WMA_LOGD("%s: opMode = %d", __func__, update_vht_opmode->opMode);
+	struct wma_txrx_node *iface;
+	wmi_channel_width ch_width;
+
+	iface = &wma_handle->interfaces[update_vht_opmode->smesessionId];
+	ch_width = chanmode_to_chanwidth(iface->chanmode);
 
+	if (ch_width < update_vht_opmode->opMode) {
+		WMA_LOGE("%s: Invalid peer bw update %d, self bw %d",
+				__func__, update_vht_opmode->opMode,
+				ch_width);
+		return;
+	}
+	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,
 			   update_vht_opmode->smesessionId);