diff --git a/core/hif/inc/hif.h b/core/hif/inc/hif.h index 78f82d60dcce..948f389b1be4 100644 --- a/core/hif/inc/hif.h +++ b/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; diff --git a/core/hif/src/ce/ce_internal.h b/core/hif/src/ce/ce_internal.h index 7e5a039d704d..8d1e9d503413 100644 --- a/core/hif/src/ce/ce_internal.h +++ b/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; diff --git a/core/hif/src/ce/ce_main.c b/core/hif/src/ce/ce_main.c index 683f86d4d183..7d4452adbc54 100644 --- a/core/hif/src/ce/ce_main.c +++ b/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; } diff --git a/core/hif/src/ce/ce_service.c b/core/hif/src/ce/ce_service.c index 6bf9e616fe66..3ed402bc572f 100644 --- a/core/hif/src/ce/ce_service.c +++ b/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; } /*