Pārlūkot izejas kodu

qcacmn: Fix return codes from A_TARGET_ACCESS_BEGIN_RET

A_TARGET_ACCESS_BEGIN_RET hid nonsensical return values.
Replace nonsensical return values with sensible ones.
In many cases, the returned value is changed and not
just renamed.

Change-Id: I8bf1d4a44d4ebd76e3aa60bc4d24416ce0d45d61
CRs-Fixed: 986480
Houston Hoffman 9 gadi atpakaļ
vecāks
revīzija
987ab445de
2 mainītis faili ar 14 papildinājumiem un 18 dzēšanām
  1. 8 8
      hif/src/ce/ce_diag.c
  2. 6 10
      hif/src/ce/ce_service.c

+ 8 - 8
hif/src/ce/ce_diag.c

@@ -192,11 +192,11 @@ hif_diag_read_mem(struct hif_opaque_softc *hif_ctx, uint32_t address,
 			 *    CE address space
 			 */
 			if (Q_TARGET_ACCESS_BEGIN(scn) < 0)
-				return ATH_ISR_NOSCHED;
+				return QDF_STATUS_E_FAILURE;
 			ce_phy_addr =
 				TARG_CPU_SPACE_TO_CE_SPACE(scn->mem, address);
 			if (Q_TARGET_ACCESS_END(scn) < 0)
-				return ATH_ISR_SCHED;
+				return QDF_STATUS_E_FAILURE;
 
 			status =
 				ce_send(ce_diag, NULL, ce_phy_addr, nbytes,
@@ -276,10 +276,10 @@ QDF_STATUS hif_diag_read_access(struct hif_opaque_softc *hif_ctx,
 					 sizeof(uint32_t));
 	} else {
 		if (Q_TARGET_ACCESS_BEGIN(scn) < 0)
-			return ATH_ISR_NOSCHED;
+			return QDF_STATUS_E_FAILURE;
 		*data = A_TARGET_READ(scn, address);
 		if (Q_TARGET_ACCESS_END(scn) < 0)
-			return ATH_ISR_SCHED;
+			return QDF_STATUS_E_FAILURE;
 
 		return QDF_STATUS_SUCCESS;
 	}
@@ -345,10 +345,10 @@ QDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *hif_ctx,
 	 *    CE address space
 	 */
 	if (Q_TARGET_ACCESS_BEGIN(scn) < 0)
-		return ATH_ISR_NOSCHED;
+		return QDF_STATUS_E_FAILURE;
 	ce_phy_addr = TARG_CPU_SPACE_TO_CE_SPACE(scn->mem, address);
 	if (Q_TARGET_ACCESS_END(scn) < 0)
-		return ATH_ISR_SCHED;
+		return QDF_STATUS_E_FAILURE;
 
 	remaining_bytes = orig_nbytes;
 	CE_data = CE_data_base;
@@ -455,10 +455,10 @@ QDF_STATUS hif_diag_write_access(struct hif_opaque_softc *hif_ctx,
 					  sizeof(uint32_t));
 	} else {
 		if (Q_TARGET_ACCESS_BEGIN(scn) < 0)
-			return ATH_ISR_NOSCHED;
+			return QDF_STATUS_E_FAILURE;
 		A_TARGET_WRITE(scn, address, data);
 		if (Q_TARGET_ACCESS_END(scn) < 0)
-			return ATH_ISR_SCHED;
+			return QDF_STATUS_E_FAILURE;
 
 		return QDF_STATUS_SUCCESS;
 	}

+ 6 - 10
hif/src/ce/ce_service.c

@@ -292,14 +292,12 @@ ce_send_nolock(struct CE_handle *copyeng,
 	struct hif_softc *scn = CE_state->scn;
 
 	if (Q_TARGET_ACCESS_BEGIN(scn) < 0)
-		return ATH_ISR_NOSCHED;
+		return QDF_STATUS_E_FAILURE;
 	if (unlikely(CE_RING_DELTA(nentries_mask,
 				write_index, sw_index - 1) <= 0)) {
 		OL_ATH_CE_PKT_ERROR_COUNT_INCR(scn, CE_RING_DELTA_FAIL);
-		status = QDF_STATUS_E_FAILURE;
-		if (Q_TARGET_ACCESS_END(scn) < 0)
-			return ATH_ISR_SCHED;
-		return status;
+		Q_TARGET_ACCESS_END(scn);
+		return QDF_STATUS_E_FAILURE;
 	}
 	{
 		enum hif_ce_event_type event_type = HIF_TX_GATHER_DESC_POST;
@@ -361,9 +359,7 @@ ce_send_nolock(struct CE_handle *copyeng,
 		src_ring->write_index = write_index;
 		status = QDF_STATUS_SUCCESS;
 	}
-	if (Q_TARGET_ACCESS_END(scn) < 0)
-		return ATH_ISR_SCHED;
-
+	Q_TARGET_ACCESS_END(scn);
 	return status;
 }
 
@@ -1036,11 +1032,11 @@ ce_completed_send_next_nolock(struct CE_state *CE_state,
 		 * value of the HW index has become stale.
 		 */
 		if (Q_TARGET_ACCESS_BEGIN(scn) < 0)
-			return ATH_ISR_NOSCHED;
+			return QDF_STATUS_E_FAILURE;
 		src_ring->hw_index =
 			CE_SRC_RING_READ_IDX_GET_FROM_DDR(scn, ctrl_addr);
 		if (Q_TARGET_ACCESS_END(scn) < 0)
-			return ATH_ISR_SCHED;
+			return QDF_STATUS_E_FAILURE;
 	}
 	read_index = src_ring->hw_index;