Browse Source

qcacld-3.0: Move recieve count to CE_state

Removing references to global data in the processing of
copy engine interupts.

Change-Id: I1ecc2ee67526498a56680870969ec529f0ac6e95
CRs-Fixed: 941355
Houston Hoffman 9 years ago
parent
commit
5bf441a495
4 changed files with 10 additions and 10 deletions
  1. 0 3
      core/hif/inc/hif.h
  2. 3 0
      core/hif/src/ce/ce_internal.h
  3. 2 2
      core/hif/src/ce/ce_main.c
  4. 5 5
      core/hif/src/ce/ce_service.c

+ 0 - 3
core/hif/inc/hif.h

@@ -292,9 +292,6 @@ struct ol_softc {
 	 */
 	cdf_spinlock_t target_lock;
 	unsigned int ce_count;  /* Number of Copy Engines supported */
-	unsigned int receive_count;	/* count Num Of Receive Buffers
-					 * handled for one interrupt
-					 * DPC routine */
 	struct CE_state *ce_id_to_state[CE_COUNT_MAX];  /* CE id to CE_state */
 #ifdef FEATURE_NAPI
 	struct qca_napi_data napi_data;

+ 3 - 0
core/hif/src/ce/ce_internal.h

@@ -132,6 +132,9 @@ struct CE_state {
 	bool force_break;	/* Flag to indicate whether to
 				 * break out the DPC context */
 
+	unsigned int receive_count;	/* count Num Of Receive Buffers
+					 * handled for one interrupt
+					 * DPC routine */
 	/* epping */
 	bool timer_inited;
 	cdf_softirq_timer_t poll_timer;

+ 2 - 2
core/hif/src/ce/ce_main.c

@@ -773,9 +773,9 @@ hif_pci_ce_recv_data(struct CE_handle *copyeng, void *ce_context,
 
 		/* Set up force_break flag if num of receices reaches
 		 * MAX_NUM_OF_RECEIVES */
-		scn->receive_count++;
+		ce_state->receive_count++;
 		if (cdf_unlikely(hif_max_num_receives_reached(
-				scn->receive_count))) {
+				ce_state->receive_count))) {
 			ce_state->force_break = 1;
 			break;
 		}

+ 5 - 5
core/hif/src/ce/ce_service.c

@@ -1181,7 +1181,7 @@ int ce_per_engine_service(struct ol_softc *scn, unsigned int CE_id)
 	/* Clear force_break flag and re-initialize receive_count to 0 */
 
 	/* NAPI: scn variables- thread/multi-processing safety? */
-	scn->receive_count = 0;
+	CE_state->receive_count = 0;
 	CE_state->force_break = 0;
 more_completions:
 	if (CE_state->recv_cb) {
@@ -1221,8 +1221,8 @@ more_completions:
 					HOST_IS_COPY_COMPLETE_MASK);
 				if (Q_TARGET_ACCESS_END(scn) < 0)
 					HIF_ERROR("<--[premature rc=%d]\n",
-						  scn->receive_count);
-				return scn->receive_count;
+						  CE_state->receive_count);
+				return CE_state->receive_count;
 			}
 			cdf_spin_lock(&scn->target_lock);
 		}
@@ -1360,8 +1360,8 @@ more_watermarks:
 	cdf_atomic_set(&CE_state->rx_pending, 0);
 
 	if (Q_TARGET_ACCESS_END(scn) < 0)
-		HIF_ERROR("<--[premature rc=%d]\n", scn->receive_count);
-	return scn->receive_count;
+		HIF_ERROR("<--[premature rc=%d]\n", CE_state->receive_count);
+	return CE_state->receive_count;
 }
 
 /*