Explorar el Código

qcacmn: Add SCAN WAR for hawkeye emulation

Emulation being clocked at lowest rate,
SCAN and serialization timers are modified to handle
these scenarios

Change-Id: Ia937930483dbcd0268fd2fe2d0393e49f09b215f
CRs-Fixed: 2009490
Anish Nataraj hace 8 años
padre
commit
da0e2f41b7

+ 16 - 0
umac/cmn_services/serialization/src/wlan_serialization_utils.c

@@ -26,6 +26,7 @@
 #include "wlan_objmgr_vdev_obj.h"
 #include "wlan_objmgr_pdev_obj.h"
 #include "qdf_mc_timer.h"
+#include "wlan_utility.h"
 
 QDF_STATUS
 wlan_serialization_put_back_to_global_list(qdf_list_t *queue,
@@ -243,6 +244,13 @@ wlan_serialization_find_and_stop_timer(struct wlan_objmgr_psoc *psoc,
 		return status;
 	}
 
+	if ((cmd->cmd_timeout_duration == 0) &&
+		(wlan_is_emulation_platform(wlan_psoc_get_nif_phy_version(psoc)
+	))) {
+		serialization_err("[SCAN-EMULATION]: Not performing timer functions\n");
+		return QDF_STATUS_SUCCESS;
+	}
+
 	psoc_ser_obj = wlan_serialization_get_psoc_priv_obj(psoc);
 	/*
 	 * Here cmd_id and cmd_type are used to locate the timer being
@@ -286,6 +294,14 @@ wlan_serialization_find_and_start_timer(struct wlan_objmgr_psoc *psoc,
 		return status;
 	}
 
+	if ((cmd->cmd_timeout_duration == 0) &&
+		(wlan_is_emulation_platform(wlan_psoc_get_nif_phy_version(psoc)
+	))) {
+		serialization_err("[SCAN-EMULATION]: Not performing timer functions\n");
+		return QDF_STATUS_SUCCESS;
+	}
+
+
 	psoc_ser_obj = wlan_serialization_get_psoc_priv_obj(psoc);
 	for (i = 0; psoc_ser_obj->max_active_cmds > i; i++) {
 		/* Keep trying timer */

+ 7 - 0
umac/cmn_services/utils/inc/wlan_utility.h

@@ -64,4 +64,11 @@ uint8_t wlan_freq_to_chan(uint32_t freq);
 uint8_t *wlan_get_vendor_ie_ptr_from_oui(uint8_t *oui,
 	uint8_t oui_size, uint8_t *ie, uint16_t ie_len);
 
+/**
+ * wlan_is_emulation_platform() - check if platform is emulation based
+ * @phy_version - psoc nif phy_version
+ *
+ * Return: boolean value based on platform type
+ */
+bool wlan_is_emulation_platform(uint32_t phy_version);
 #endif /* _WLAN_UTILITY_H_ */

+ 10 - 0
umac/cmn_services/utils/src/wlan_utility.c

@@ -94,3 +94,13 @@ uint8_t *wlan_get_vendor_ie_ptr_from_oui(uint8_t *oui,
 
 	return NULL;
 }
+
+bool wlan_is_emulation_platform(uint32_t phy_version)
+{
+	if ((phy_version == 0xABC0) || (phy_version == 0xABC1) ||
+		(phy_version == 0xABC2) || (phy_version == 0xABC3) ||
+		(phy_version == 0xFFFF) || (phy_version == 0xABCD))
+		return true;
+
+	return false;
+}

+ 14 - 0
umac/scan/core/src/wlan_scan_manager.c

@@ -25,6 +25,7 @@
 #include <wlan_scan_tgt_api.h>
 #include "wlan_scan_main.h"
 #include "wlan_scan_manager.h"
+#include "wlan_utility.h"
 
 static QDF_STATUS
 scm_free_scan_request_mem(struct scan_start_request *req)
@@ -339,6 +340,7 @@ scm_scan_start_req(struct scheduler_msg *msg)
 	struct wlan_serialization_command cmd = {0, };
 	enum wlan_serialization_status ser_cmd_status;
 	struct scan_start_request *req;
+	struct wlan_objmgr_psoc *psoc;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	if (!msg || !msg->bodyptr) {
@@ -358,6 +360,18 @@ scm_scan_start_req(struct scheduler_msg *msg)
 		SCAN_TIMEOUT_GRACE_PERIOD;
 	cmd.vdev = req->vdev;
 
+	wlan_vdev_obj_lock(cmd.vdev);
+	psoc = wlan_vdev_get_psoc(cmd.vdev);
+	wlan_vdev_obj_unlock(cmd.vdev);
+	/*
+	 * Temp Hack to disable Serialization Timer
+	 * Modified Serialization module to ignore timeout of 0 value
+	 */
+	if (wlan_is_emulation_platform(wlan_psoc_get_nif_phy_version(psoc))) {
+		cmd.cmd_timeout_duration = 0;
+		scm_info("[SCAN-EMULATION]: Disabling Serialization Timer for Emulation\n");
+	}
+
 	scm_info("req: 0x%p, reqid: %d, scanid: %d, vdevid: %d",
 		req, req->scan_req.scan_req_id, req->scan_req.scan_id,
 		req->scan_req.vdev_id);

+ 6 - 0
wmi/src/wmi_unified_tlv.c

@@ -14629,6 +14629,7 @@ static QDF_STATUS extract_vdev_scan_ev_param_tlv(wmi_unified_t wmi_handle,
 	evt = param_buf->fixed_param;
 
 	qdf_mem_zero(param, sizeof(*param));
+
 	switch (evt->event) {
 	case WMI_SCAN_EVENT_STARTED:
 		param->type = SCAN_EVENT_TYPE_STARTED;
@@ -14682,7 +14683,12 @@ static QDF_STATUS extract_vdev_scan_ev_param_tlv(wmi_unified_t wmi_handle,
 	case WMI_SCAN_REASON_INTERNAL_FAILURE:
 		param->reason = SCAN_REASON_INTERNAL_FAILURE;
 		break;
+	case WMI_SCAN_REASON_SUSPENDED:
+		param->reason = SCAN_REASON_SUSPENDED;
+		break;
 	case WMI_SCAN_REASON_MAX:
+		param->reason = SCAN_REASON_MAX;
+		break;
 	default:
 		param->reason = SCAN_REASON_MAX;
 		break;