qcacmn: Set the initial wake flag on MSI resume

When the wlan driver is suspending, the last thing it does is check to
see if the firmware has indicated a wakeup during the suspend process.
This is done by checking the initial wakeup flag, which is set when a
specific copy engine payload is received from firmware. For the new
dedicated wake MSI, only the wake signal is received, no payload. When
the wake MSI is toggled, set the initial wakeup flag to prevent race
conditions during the suspend process.

Change-Id: Id53cc7884431a437136d8dca068449bc5a25b87c
CRs-Fixed: 2133469
diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c
index 9a217ba..84ffb70 100644
--- a/hif/src/hif_main.c
+++ b/hif/src/hif_main.c
@@ -1217,6 +1217,9 @@
 
 	HIF_INFO("wake interrupt received on irq %d", irq);
 
+	if (scn->initial_wakeup_cb)
+		scn->initial_wakeup_cb(scn->initial_wakeup_priv);
+
 	if (hif_is_ut_suspended(scn))
 		hif_ut_fw_resume(scn);
 
@@ -1225,8 +1228,24 @@
 #else /* WLAN_SUSPEND_RESUME_TEST */
 irqreturn_t hif_wake_interrupt_handler(int irq, void *context)
 {
+	struct hif_softc *scn = context;
+
 	HIF_INFO("wake interrupt received on irq %d", irq);
 
+	if (scn->initial_wakeup_cb)
+		scn->initial_wakeup_cb(scn->initial_wakeup_priv);
+
 	return IRQ_HANDLED;
 }
 #endif /* WLAN_SUSPEND_RESUME_TEST */
+
+void hif_set_initial_wakeup_cb(struct hif_opaque_softc *hif_ctx,
+			       void (*callback)(void *),
+			       void *priv)
+{
+	struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
+
+	scn->initial_wakeup_cb = callback;
+	scn->initial_wakeup_priv = priv;
+}
+