qcacmn: Support for SWFDA Event & FD Frame tx

Add new WMI EVENT, SW FILS Discovery Alert Event, to get
firmware trigger to transmit FILS Discovery Frames.
Add WMI command to send FD frame buffer to firwmare.
Add WMI command to set FD period interval in mili seconds.

Change-Id: I8cb6279ec4431b9236bd32c548228a0dc6598664
CRs-Fixed: 2118098
diff --git a/umac/cmn_services/inc/wlan_cmn.h b/umac/cmn_services/inc/wlan_cmn.h
index b28b3d0..4ab2a1d 100644
--- a/umac/cmn_services/inc/wlan_cmn.h
+++ b/umac/cmn_services/inc/wlan_cmn.h
@@ -123,6 +123,7 @@
  * @WLAN_UMAC_COMP_DISA:          DISA encryption test
  * @WLAN_UMAC_COMP_GREEN_AP:      Green AP
  * @WLAN_UMAC_COMP_FTM:           FTM component
+ * @WLAN_UMAC_COMP_FD:            FILS Discovery
  *
  * @WLAN_UMAC_COMP_ID_MAX:        Maximum components in UMAC
  *
@@ -154,6 +155,7 @@
 	WLAN_UMAC_COMP_DISA,
 	WLAN_UMAC_COMP_GREEN_AP,
 	WLAN_UMAC_COMP_FTM,
+	WLAN_UMAC_COMP_FD,
 	WLAN_UMAC_COMP_ID_MAX,
 };
 
diff --git a/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h b/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h
index dcedf47..a806de4 100644
--- a/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h
+++ b/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h
@@ -753,6 +753,23 @@
 					  qdf_nbuf_t buf,
 					  enum wlan_umac_comp_id comp_id);
 
+#ifdef WLAN_SUPPORT_FILS
+/**
+ * wlan_mgmt_txrx_fd_action_frame_tx() - transmits mgmt. FD Action frame
+ * @vdev: vdev object
+ * @buf: buffer to be transmitted
+ * @comp_id: umac component id
+ *
+ * This function transmits the FILS Dicovery Action frame to
+ * southbound interface.
+ *
+ * Return: QDF_STATUS_SUCCESS - in case of success
+ */
+QDF_STATUS wlan_mgmt_txrx_fd_action_frame_tx(struct wlan_objmgr_vdev *vdev,
+					     qdf_nbuf_t buf,
+					     enum wlan_umac_comp_id comp_id);
+#endif /* WLAN_SUPPORT_FILS */
+
 /**
  * wlan_mgmt_txrx_register_rx_cb() - registers the rx cb for mgmt. frames
  * @psoc: psoc context
diff --git a/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_utils_api.c b/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_utils_api.c
index b9473a6..bda9619 100644
--- a/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_utils_api.c
+++ b/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_utils_api.c
@@ -479,6 +479,41 @@
 	return QDF_STATUS_SUCCESS;
 }
 
+#ifdef WLAN_SUPPORT_FILS
+QDF_STATUS
+wlan_mgmt_txrx_fd_action_frame_tx(struct wlan_objmgr_vdev *vdev,
+				  qdf_nbuf_t buf,
+				  enum wlan_umac_comp_id comp_id)
+{
+	struct wlan_objmgr_psoc *psoc;
+	uint32_t vdev_id;
+
+	if (!vdev) {
+		mgmt_txrx_err("Invalid vdev");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+	vdev_id = wlan_vdev_get_id(vdev);
+	psoc = wlan_vdev_get_psoc(vdev);
+	if (!psoc) {
+		mgmt_txrx_err("psoc unavailable for vdev %d", vdev_id);
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	if (!psoc->soc_cb.tx_ops.mgmt_txrx_tx_ops.fd_action_frame_send) {
+		mgmt_txrx_err("mgmt txrx txop to send fd action frame is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (psoc->soc_cb.tx_ops.mgmt_txrx_tx_ops.fd_action_frame_send(
+			vdev, buf)) {
+		mgmt_txrx_err("FD send fail for vdev %d", vdev_id);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+#endif /* WLAN_SUPPORT_FILS */
+
 /**
  * wlan_mgmt_txrx_create_rx_handler() - creates rx handler node for umac comp.
  * @mgmt_txrx_psoc_ctx: mgmt txrx context
diff --git a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_cmn.h b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_cmn.h
index 3c3da3a..01dbfdd 100644
--- a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_cmn.h
+++ b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_cmn.h
@@ -204,6 +204,7 @@
  * @WLAN_DIRECT_BUF_RX_ID:      Direct Buffer Receive operations
  * @WLAN_DISA_ID:               DISA (encryption test) operations
  * @WLAN_FTM_ID:                FTM module
+ * @WLAN_FD_ID:                 FILS Discovery
  * @WLAN_REF_ID_MAX:            Max id used to generate ref count tracking array
  */
  /* New value added to the enum must also be reflected in function
@@ -243,6 +244,7 @@
 	WLAN_DIRECT_BUF_RX_ID = 30,
 	WLAN_DISA_ID          = 31,
 	WLAN_FTM_ID           = 31,
+	WLAN_FD_ID            = 33,
 	WLAN_REF_ID_MAX,
 } wlan_objmgr_ref_dbgid;
 
@@ -289,6 +291,7 @@
 					"WLAN_DIRECT_BUF_RX_ID",
 					"WLAN_DISA_ID",
 					"WLAN_FTM_ID",
+					"WLAN_FD_ID",
 					"WLAN_REF_ID_MAX" };
 
 	return (char *)strings[id];