qcacld-3.0: Implement P2P listen offload feature

To lower the power consumption caused by the P2P listen operation,
it is offloaded from supplicant and host driver to firmware,
so that supplicant and host driver can be in power save mode during the
listen operation.

Change-Id: Iedd990427afe22842faecc7b29e4f38220c75684
CRs-fixed: 1032877
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index 44d99f1..6c7766e 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -15739,3 +15739,26 @@
 		vdev_nss->p2p_go, vdev_nss->p2p_dev, vdev_nss->ibss,
 		vdev_nss->tdls, vdev_nss->ocb);
 }
+
+/**
+ * sme_register_p2p_lo_event() - Register for the p2p lo event
+ * @hHal: reference to the HAL
+ * @context: the context of the call
+ * @callback: the callback to hdd
+ *
+ * This function registers the callback function for P2P listen
+ * offload stop event.
+ *
+ * Return: none
+ */
+void sme_register_p2p_lo_event(tHalHandle hHal, void *context,
+					p2p_lo_callback callback)
+{
+	tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+	QDF_STATUS status = QDF_STATUS_E_FAILURE;
+
+	status = sme_acquire_global_lock(&pMac->sme);
+	pMac->sme.p2p_lo_event_callback = callback;
+	pMac->sme.p2p_lo_event_context = context;
+	sme_release_global_lock(&pMac->sme);
+}