From d4a55e0c77c08be23016d1303d6a1ca72ea8e657 Mon Sep 17 00:00:00 2001 From: Kiran Venkatappa Date: Thu, 24 May 2018 22:34:46 +0530 Subject: [PATCH] qcacmn: Fix compilation error when FEATURE_NAPI disabled Modify hif_update_napi_max_poll_time API to take ce_id instead of pointer that is defined under feature flag to avoid compilation error. Change-Id: Iec4a06e816ed1714ec5c00ecdc5a7c6d6eb217e3 CRs-Fixed: 2249802 --- hif/src/ce/ce_service.c | 3 +-- hif/src/hif_napi.c | 8 ++++++-- hif/src/hif_napi.h | 40 +++++++++++++++++++++++++++------------- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/hif/src/ce/ce_service.c b/hif/src/ce/ce_service.c index 8cb69c933c..dade70c835 100644 --- a/hif/src/ce/ce_service.c +++ b/hif/src/ce/ce_service.c @@ -1980,8 +1980,7 @@ more_data: goto more_data; } - hif_update_napi_max_poll_time(ce_state, scn->napi_data.napis[ce_id], - qdf_get_cpu()); + hif_update_napi_max_poll_time(ce_state, ce_id, qdf_get_cpu()); qdf_atomic_set(&ce_state->rx_pending, 0); if (TARGET_REGISTER_ACCESS_ALLOWED(scn)) { diff --git a/hif/src/hif_napi.c b/hif/src/hif_napi.c index 4d391a6015..72bc1259b0 100644 --- a/hif/src/hif_napi.c +++ b/hif/src/hif_napi.c @@ -952,12 +952,16 @@ out: qdf_export_symbol(hif_napi_poll); void hif_update_napi_max_poll_time(struct CE_state *ce_state, - struct qca_napi_info *napi_info, + int ce_id, int cpu_id) { + struct hif_softc *hif; + struct qca_napi_info *napi_info; unsigned long long napi_poll_time = sched_clock() - ce_state->ce_service_start_time; + hif = ce_state->scn; + napi_info = hif->napi_data.napis[ce_id]; if (napi_poll_time > napi_info->stats[cpu_id].napi_max_poll_time) napi_info->stats[cpu_id].napi_max_poll_time = napi_poll_time; @@ -1014,7 +1018,7 @@ void hif_napi_update_yield_stats(struct CE_state *ce_state, else napi_data->napis[ce_id]->stats[cpu_id].rxpkt_thresh_reached++; - hif_update_napi_max_poll_time(ce_state, napi_data->napis[ce_id], + hif_update_napi_max_poll_time(ce_state, ce_id, cpu_id); } diff --git a/hif/src/hif_napi.h b/hif/src/hif_napi.h index 1b18dc7566..87f865eb2c 100644 --- a/hif/src/hif_napi.h +++ b/hif/src/hif_napi.h @@ -184,6 +184,19 @@ int hif_napi_poll(struct hif_opaque_softc *hif_ctx, #define HNC_ACT_COLLAPSE (1) #define HNC_ACT_DISPERSE (-1) +/** + * hif_update_napi_max_poll_time() - updates NAPI max poll time + * @ce_state: ce state + * @ce_id: Copy engine ID + * @cpu_id: cpu id + * + * This API updates NAPI max poll time per CE per SPU. + * + * Return: void + */ +void hif_update_napi_max_poll_time(struct CE_state *ce_state, + int ce_id, + int cpu_id); /** * Local interface to HIF implemented functions of NAPI CPU affinity management. * Note: @@ -241,6 +254,20 @@ static inline int hif_napi_schedule(struct hif_opaque_softc *hif, int ce_id) static inline int hif_napi_poll(struct napi_struct *napi, int budget) { return -EPERM; } +/** + * hif_update_napi_max_poll_time() - updates NAPI max poll time + * @ce_state: ce state + * @ce_id: Copy engine ID + * @cpu_id: cpu id + * + * This API updates NAPI max poll time per CE per SPU. + * + * Return: void + */ +static inline void hif_update_napi_max_poll_time(struct CE_state *ce_state, + int ce_id, + int cpu_id) +{ return; } #endif /* FEATURE_NAPI */ #if defined(HIF_IRQ_AFFINITY) && defined(FEATURE_NAPI) @@ -286,17 +313,4 @@ static inline int hif_napi_cpu_blacklist(struct qca_napi_data *napid, { return 0; } #endif /* HIF_IRQ_AFFINITY */ -/** - * hif_update_napi_max_poll_time() - updates NAPI max poll time - * @ce_state: ce state - * @napi_info: pointer to napi info structure - * @cpu_id: cpu id - * - * This API updates NAPI max poll time per CE per SPU. - * - * Return: void - */ -void hif_update_napi_max_poll_time(struct CE_state *ce_state, - struct qca_napi_info *napi_info, - int cpu_id); #endif /* __HIF_NAPI_H__ */