summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandy Chiu <wchiu@qca.qualcomm.com>2014-03-21 18:19:03 +0800
committerAkash Patel <c_akashp@qca.qualcomm.com>2014-04-15 12:37:12 -0700
commitbebbd332194492bf14bdff5f070851fe375fba99 (patch)
tree32929464c31f71069fb14def199ed0005adc6ead
parent68ff75452a6d3bef324f00527f114cc812492101 (diff)
qcacld-new: HIF/USB:add suspend/resume callback
add suspend/resume callback for usb interface. Change-Id: I33765475cf75f335882bc2a8747f6c088d5e5a87 CRs-fixed: 607579
-rw-r--r--CORE/SERVICES/HIF/USB/if_usb.c43
1 files changed, 41 insertions, 2 deletions
diff --git a/CORE/SERVICES/HIF/USB/if_usb.c b/CORE/SERVICES/HIF/USB/if_usb.c
index 13b9eb3af25e..8a2bfaa8e015 100644
--- a/CORE/SERVICES/HIF/USB/if_usb.c
+++ b/CORE/SERVICES/HIF/USB/if_usb.c
@@ -227,7 +227,29 @@ void hdd_suspend_wlan(void (*callback) (void *callbackContext),
static int hif_usb_suspend(struct usb_interface *interface, pm_message_t state)
{
- /* TBD */
+ HIF_DEVICE_USB *device = usb_get_intfdata(interface);
+ void *vos = vos_get_global_context(VOS_MODULE_ID_HIF, NULL);
+
+#ifdef WLAN_LINK_UMAC_SUSPEND_WITH_BUS_SUSPEND
+ hdd_suspend_wlan(NULL, NULL);
+#endif
+
+ /* No need to send WMI_PDEV_SUSPEND_CMDID to FW if WOW is enabled */
+ if (wma_is_wow_mode_selected(vos_get_context(VOS_MODULE_ID_WDA, vos))) {
+ if (wma_enable_wow_in_fw
+ (vos_get_context(VOS_MODULE_ID_WDA, vos))) {
+ pr_warn("%s[%d]: fail\n", __func__, __LINE__);
+ return -1;
+ }
+ } else if (state.event == PM_EVENT_FREEZE
+ || (PM_EVENT_SUSPEND & state.event) == PM_EVENT_SUSPEND) {
+ if (wma_suspend_target
+ (vos_get_context(VOS_MODULE_ID_WDA, vos), 0)) {
+ pr_warn("%s[%d]: fail\n", __func__, __LINE__);
+ return -1;
+ }
+ }
+ usb_hif_flush_all(device);
return 0;
}
@@ -237,7 +259,24 @@ void hdd_resume_wlan(void);
static int hif_usb_resume(struct usb_interface *interface)
{
- /* TBD */
+ HIF_DEVICE_USB *device = usb_get_intfdata(interface);
+ void *vos_context = vos_get_global_context(VOS_MODULE_ID_HIF, NULL);
+
+ usb_hif_start_recv_pipes(device);
+
+#ifdef USB_HIF_TEST_INTERRUPT_IN
+ usb_hif_post_recv_transfers(&device->pipes[HIF_RX_INT_PIPE],
+ HIF_USB_RX_BUFFER_SIZE);
+#endif
+ /* No need to send WMI_PDEV_RESUME_CMDID to FW if WOW is enabled */
+ if (!wma_is_wow_mode_selected
+ (vos_get_context(VOS_MODULE_ID_WDA, vos_context))) {
+ wma_resume_target(vos_get_context
+ (VOS_MODULE_ID_WDA, vos_context));
+ }
+#ifdef WLAN_LINK_UMAC_SUSPEND_WITH_BUS_SUSPEND
+ hdd_resume_wlan();
+#endif
return 0;
}