From e61d4e1382bc9e63d88f1f669609fccbb62c956a Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Mon, 14 Mar 2016 21:11:48 -0700 Subject: [PATCH] qcacmn: Controll target sleep in hif Reduce the api footprint of hif and make hif responsible for controlling its own timer as part of suspend resume. Change-Id: I256161a8d147e99811f018c995081684f2bd0167 CRs-Fixed: 986480 --- hif/inc/hif.h | 1 - hif/src/hif_main.c | 18 ------------------ hif/src/pcie/if_pci.c | 5 +++-- htc/htc.c | 12 ------------ htc/htc_api.h | 1 - 5 files changed, 3 insertions(+), 34 deletions(-) diff --git a/hif/inc/hif.h b/hif/inc/hif.h index 6fd7e40c72..f2d25427e7 100644 --- a/hif/inc/hif.h +++ b/hif/inc/hif.h @@ -385,7 +385,6 @@ QDF_STATUS hif_send_head(struct hif_opaque_softc *scn, uint8_t PipeID, qdf_nbuf_t wbuf, uint32_t data_attr); void hif_send_complete_check(struct hif_opaque_softc *scn, uint8_t PipeID, int force); -void hif_cancel_deferred_target_sleep(struct hif_opaque_softc *scn); void hif_get_default_pipe(struct hif_opaque_softc *scn, uint8_t *ULPipe, uint8_t *DLPipe); int hif_map_service_to_pipe(struct hif_opaque_softc *scn, uint16_t svc_id, diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c index 6884558245..d81fa89dba 100644 --- a/hif/src/hif_main.c +++ b/hif/src/hif_main.c @@ -110,24 +110,6 @@ void hif_shut_down_device(struct hif_opaque_softc *scn) hif_stop(scn); } - - -/** - * hif_cancel_deferred_target_sleep() - cancel deferred target sleep - * - * This function cancels the defered target sleep - * - * @scn: hif_opaque_softc - * - * Return: void - */ -void hif_cancel_deferred_target_sleep(struct hif_opaque_softc *hif_ctx) -{ - struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); - - hif_pci_cancel_deferred_target_sleep(scn); -} - /** * hif_get_target_id(): hif_get_target_id * diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index ebb00efa32..c226b91178 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -2251,6 +2251,8 @@ static int hif_bus_suspend_link_up(struct hif_softc *scn) return -EINVAL; } + hif_pci_cancel_deferred_target_sleep(scn); + return 0; } @@ -2297,7 +2299,6 @@ static int hif_bus_resume_link_up(struct hif_softc *scn) static int hif_bus_suspend_link_down(struct hif_softc *scn) { struct pci_dev *pdev; - struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); int status = 0; @@ -2312,7 +2313,7 @@ static int hif_bus_suspend_link_down(struct hif_softc *scn) } /* Stop the HIF Sleep Timer */ - hif_cancel_deferred_target_sleep(hif_hdl); + hif_pci_cancel_deferred_target_sleep(scn); qdf_atomic_set(&scn->link_suspended, 1); diff --git a/htc/htc.c b/htc/htc.c index 365f3aa88e..20e42e2268 100644 --- a/htc/htc.c +++ b/htc/htc.c @@ -828,18 +828,6 @@ void *htc_get_targetdef(HTC_HANDLE htc_handle) return hif_get_targetdef(target->hif_dev); } -/** - * htc_cancel_deferred_target_sleep() - cancel deferred target sleep - * @context: hif_opaque_softc context - * - * Return: none - */ -void htc_cancel_deferred_target_sleep(void *context) -{ - struct hif_opaque_softc *scn = (struct hif_opaque_softc *)context; - hif_cancel_deferred_target_sleep(scn); -} - #ifdef IPA_OFFLOAD /** * htc_ipa_get_ce_resource() - get uc resource on lower layer diff --git a/htc/htc_api.h b/htc/htc_api.h index f44cd5b6eb..78a866796b 100644 --- a/htc/htc_api.h +++ b/htc/htc_api.h @@ -703,7 +703,6 @@ do { \ void htc_get_control_endpoint_tx_host_credits(HTC_HANDLE HTCHandle, int *credit); void htc_dump_counter_info(HTC_HANDLE HTCHandle); void *htc_get_targetdef(HTC_HANDLE htc_handle); -void htc_cancel_deferred_target_sleep(void *context); int htc_runtime_suspend(void); int htc_runtime_resume(void);