Browse Source

qcacld-3.0: Extract spectral phyerr for qca6574

Qca6574 doesn't use phy_err_mask0 to indicate a spectral
scan phyerr, so spectral_phyerr_event_handler will never
be called. So add some logical to extract the correct phyerr
code to obtain the spectral scan results.

Change-Id: Ib1ec1aa98f25827dfe6ab549ff96a5d4139ad106
CRs-Fixed: 2252379
Chaoli Zhou 6 years ago
parent
commit
5d6bad19a9
1 changed files with 36 additions and 1 deletions
  1. 36 1
      core/wma/src/wma_main.c

+ 36 - 1
core/wma/src/wma_main.c

@@ -2756,6 +2756,15 @@ static QDF_STATUS spectral_phyerr_event_handler(void *handle,
 	return status;
 }
 #else
+static QDF_STATUS
+wma_extract_single_phyerr_spectral(void *handle, void *evt_buf,
+				   uint16_t datalen,
+				   uint16_t *buf_offset,
+				   wmi_host_phyerr_t *phyerr)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
 static QDF_STATUS spectral_phyerr_event_handler(void *handle,
 					uint8_t *data, uint32_t datalen)
 {
@@ -2854,6 +2863,10 @@ static int wma_unified_phyerr_rx_event_handler(void *handle,
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	wmi_host_phyerr_t phyerr;
 	uint16_t buf_offset = 0;
+	wmi_single_phyerr_rx_event *ev;
+	uint16_t event_buf_len = 0;
+	wmi_host_phyerr_t phyerr2;
+	bool spectralscan = false;
 
 	if (!wma) {
 		WMA_LOGE("%s: wma handle is null", __func__);
@@ -2867,7 +2880,29 @@ static int wma_unified_phyerr_rx_event_handler(void *handle,
 		WMA_LOGE("%s: extract phyerr failed: %d", __func__, status);
 		return qdf_status_to_os_return(status);
 	}
-
+	ev = (wmi_single_phyerr_rx_event *)phyerr.bufp;
+	event_buf_len = phyerr.buf_len;
+	/* Loop over the bufp, extracting out phyerrors */
+	buf_offset = 0;
+	while (ev && (buf_offset < event_buf_len)) {
+		if (wma_extract_single_phyerr_spectral(handle, ev,
+						       event_buf_len,
+						       &buf_offset,
+						       &phyerr2)) {
+			WMA_LOGE("%s: extract single phy err failed", __func__);
+			return qdf_status_to_os_return(QDF_STATUS_E_FAILURE);
+		}
+		if ((buf_offset != 0) && (phyerr2.phy_err_code == 0x26 ||
+					  phyerr2.phy_err_code == 0x24)) {
+			spectralscan = true;
+		} else {
+			break;
+		}
+	}
+	if (spectralscan) {
+		status = spectral_phyerr_event_handler(wma, data, datalen);
+		return qdf_status_to_os_return(status);
+	}
 	/* handle different PHY Error conditions */
 	if (((phyerr.phy_err_mask0 & (WMI_PHY_ERROR_MASK0_RADAR |
 	    WMI_PHY_ERROR_MASK0_FALSE_RADAR_EXT |