Przeglądaj źródła

qcacmn: Handle vendor control command and event

WMI_ROAM_GET_VENDOR_CONTROL_PARAM_CMDID: Add support
for a new roam command to get vendor control parameters
from FW. Host needs to send proper param ID in command
(from enum WMI_ROAM_GET_VENDOR_CONTROL_PARAM_ID)
to get corresponding INI value from FW.

WMI_ROAM_GET_VENDOR_CONTROL_PARAM_EVENTID:
Add support for a new roam event to get param value
from FW. FW sends this event upon receiving
WMI_ROAM_GET_VENDOR_CONTROL_PARAM_CMDID command.

Change-Id: Ic7b3badb14daff183dd36927b4dae6bbc036e6cd
CRs-Fixed: 3225166
abhinav kumar 3 lat temu
rodzic
commit
edd1669c23

+ 33 - 0
os_if/linux/mlme/inc/osif_cm_util.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012-2015, 2020-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -152,6 +153,20 @@ typedef QDF_STATUS
 				   struct wlan_cm_connect_resp *rsp,
 				   enum osif_cb_type type);
 
+#ifdef WLAN_VENDOR_HANDOFF_CONTROL
+/**
+ * typedef osif_cm_get_vendor_handoff_params_cb  - process vendor handoff cb
+ * @psoc: psoc pointer
+ * @rsp: vendor handoff response
+ * @vendor_handoff_context: vendor handoff context
+ *
+ * return: none
+ */
+typedef QDF_STATUS
+(*osif_cm_get_vendor_handoff_params_cb)(struct wlan_objmgr_psoc *psoc,
+					void *vendor_handoff_context);
+#endif
+
 #ifdef WLAN_FEATURE_FILS_SK
 /**
  * typedef osif_cm_save_gtk_cb  - save gtk callback
@@ -306,6 +321,8 @@ typedef QDF_STATUS
  * transition event
  * @cckm_preauth_complete_cb: callback to legacy module to send cckm
  * preauth indication to the supplicant via wireless custom event.
+ * @vendor_handoff_params_cb: callback to legacy module to send vendor handoff
+ * parameters to upper layer
  */
 struct osif_cm_ops {
 	osif_cm_connect_comp_cb connect_complete_cb;
@@ -324,6 +341,9 @@ struct osif_cm_ops {
 	osif_cm_cckm_preauth_complete_cb cckm_preauth_complete_cb;
 #endif
 #endif
+#ifdef WLAN_VENDOR_HANDOFF_CONTROL
+	osif_cm_get_vendor_handoff_params_cb vendor_handoff_params_cb;
+#endif
 };
 
 /**
@@ -342,6 +362,19 @@ QDF_STATUS osif_cm_connect_comp_ind(struct wlan_objmgr_vdev *vdev,
 				    struct wlan_cm_connect_resp *rsp,
 				    enum osif_cb_type type);
 
+#ifdef WLAN_VENDOR_HANDOFF_CONTROL
+/**
+ * osif_cm_vendor_handoff_params_cb() - Function to process vendor handoff
+ * event callback
+ * @psoc: psoc object pointer
+ * @vendor_handoff_context: vendor handoff context
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS osif_cm_vendor_handoff_params_cb(struct wlan_objmgr_psoc *psoc,
+					    void *vendor_handoff_context);
+#endif
+
 /**
  * osif_cm_disconnect_comp_ind() - Function to indicate disconnect
  * complete to legacy module

+ 20 - 0
os_if/linux/mlme/src/osif_cm_util.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012-2015, 2020-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -479,6 +480,10 @@ static struct mlme_cm_ops cm_ops = {
 	.mlme_cm_cckm_preauth_cmpl_cb = osif_cm_cckm_preauth_cmpl_cb,
 #endif
 #endif
+#ifdef WLAN_VENDOR_HANDOFF_CONTROL
+	.mlme_cm_get_vendor_handoff_params_cb =
+					osif_cm_vendor_handoff_params_cb,
+#endif
 };
 
 /**
@@ -548,6 +553,21 @@ QDF_STATUS osif_cm_connect_comp_ind(struct wlan_objmgr_vdev *vdev,
 	return ret;
 }
 
+#ifdef WLAN_VENDOR_HANDOFF_CONTROL
+QDF_STATUS osif_cm_vendor_handoff_params_cb(struct wlan_objmgr_psoc *psoc,
+					    void *vendor_handoff_context)
+{
+	osif_cm_get_vendor_handoff_params_cb cb = NULL;
+
+	if (osif_cm_legacy_ops)
+		cb = osif_cm_legacy_ops->vendor_handoff_params_cb;
+	if (cb)
+		return cb(psoc, vendor_handoff_context);
+
+	return QDF_STATUS_E_FAILURE;
+}
+#endif
+
 QDF_STATUS osif_cm_disconnect_comp_ind(struct wlan_objmgr_vdev *vdev,
 				       struct wlan_cm_discon_rsp *rsp,
 				       enum osif_cb_type type)

+ 28 - 0
umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_public_struct.h

@@ -521,6 +521,34 @@ struct wlan_cm_connect_resp {
 #endif
 };
 
+#ifdef WLAN_VENDOR_HANDOFF_CONTROL
+/* As per enum WMI_ROAM_GET_VENDOR_CONTROL_PARAM_ID */
+#define MAX_VENDOR_CONTROL_PARAMS 8
+/*
+ * struct roam_param_info: vendor handoff related parameters
+ * @param_id : vendor control Param ID from enum
+ * WMI_ROAM_GET_VENDOR_CONTROL_PARAM_ID
+ * @param_value : vendor control param value
+ */
+struct roam_param_info {
+	uint32_t param_id;
+	uint32_t param_value;
+};
+
+/*
+ * struct roam_vendor_handoff_params: vendor handoff parameters
+ * @vdev_id : vdev id
+ * @num_entries: num of tlv present in vendor handoff event
+ * @param_info: vendor handoff related parameters
+ */
+struct roam_vendor_handoff_params {
+	uint32_t vdev_id;
+	uint32_t num_entries;
+	struct roam_param_info param_info[MAX_VENDOR_CONTROL_PARAMS];
+};
+
+#endif
+
 #ifdef WLAN_FEATURE_PREAUTH_ENABLE
 /**
  * struct wlan_preauth_req - preauth request

+ 23 - 0
umac/mlme/include/wlan_mlme_cmn.h

@@ -75,6 +75,11 @@
  * @mlme_cm_cckm_preauth_cmpl_cb: Roam cckm preauth complete cb
  * @vdev: vdev pointer
  * @rsp: preauth response pointer
+ *
+ * @mlme_cm_get_vendor_handoff_params_cb: get vendor handoff params cb
+ * @psoc: psoc pointer
+ * @rsp: vendor handoff response pointer
+ * @vendor_handoff_context: vendor handoff context
  */
 struct mlme_cm_ops {
 	QDF_STATUS (*mlme_cm_connect_complete_cb)(
@@ -114,6 +119,11 @@ struct mlme_cm_ops {
 					struct wlan_preauth_rsp *rsp);
 #endif
 #endif
+#ifdef WLAN_VENDOR_HANDOFF_CONTROL
+	QDF_STATUS (*mlme_cm_get_vendor_handoff_params_cb)(
+				struct wlan_objmgr_psoc *psoc,
+				void *vendor_handoff_context);
+#endif
 };
 
 /**
@@ -790,6 +800,19 @@ mlme_cm_osif_disconnect_complete(struct wlan_objmgr_vdev *vdev,
  */
 QDF_STATUS mlme_cm_osif_disconnect_start_ind(struct wlan_objmgr_vdev *vdev);
 
+#ifdef WLAN_VENDOR_HANDOFF_CONTROL
+/**
+ * mlme_cm_osif_get_vendor_handoff_params() - osif get vendor handoff params
+ * indication
+ * @psoc: psoc pointer
+ * @vendor_handoff_context: vendor handoff context
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS mlme_cm_osif_get_vendor_handoff_params(struct wlan_objmgr_psoc *psoc,
+						  void *vendor_handoff_context);
+#endif
+
 #ifdef CONN_MGR_ADV_FEATURE
 /**
  * mlme_cm_osif_roam_sync_ind() - osif Roam sync indication

+ 12 - 0
umac/mlme/mlme_objmgr/dispatcher/src/wlan_cmn_mlme_main.c

@@ -502,6 +502,18 @@ QDF_STATUS mlme_cm_osif_disconnect_start_ind(struct wlan_objmgr_vdev *vdev)
 	return ret;
 }
 
+#ifdef WLAN_VENDOR_HANDOFF_CONTROL
+QDF_STATUS mlme_cm_osif_get_vendor_handoff_params(struct wlan_objmgr_psoc *psoc,
+						  void *vendor_handoff_context)
+{
+	if (glbl_cm_ops && glbl_cm_ops->mlme_cm_get_vendor_handoff_params_cb)
+		return glbl_cm_ops->mlme_cm_get_vendor_handoff_params_cb(psoc,
+							vendor_handoff_context);
+
+	return QDF_STATUS_E_FAILURE;
+}
+#endif
+
 #ifdef CONN_MGR_ADV_FEATURE
 QDF_STATUS mlme_cm_osif_roam_sync_ind(struct wlan_objmgr_vdev *vdev)
 {

+ 3 - 0
wmi/inc/wmi_unified_param.h

@@ -5068,6 +5068,9 @@ typedef enum {
 #if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
 	wmi_rtt_pasn_peer_create_req_eventid,
 	wmi_rtt_pasn_peer_delete_eventid,
+#endif
+#ifdef WLAN_VENDOR_HANDOFF_CONTROL
+	wmi_get_roam_vendor_control_param_event_id,
 #endif
 	wmi_events_max,
 } wmi_conv_event_id;

+ 21 - 0
wmi/inc/wmi_unified_priv.h

@@ -460,6 +460,22 @@ QDF_STATUS
 (*extract_roam_candidate_frame)(wmi_unified_t wmi_handle,
 				uint8_t *event, uint32_t data_len,
 				struct roam_scan_candidate_frame *data);
+#ifdef WLAN_VENDOR_HANDOFF_CONTROL
+/**
+ * extract_roam_vendor_control_param_event  - Extract vendor handoff param event
+ * function pointer
+ * @wmi_handle: WMI handle
+ * @event: Event buffer
+ * @data_len: evt buffer data len
+ * @vendor_handoff_params: vendor handoff param buffer pointer
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+(*extract_roam_vendor_control_param_event)(wmi_unified_t wmi_handle,
+		uint8_t *event, uint32_t data_len,
+		struct roam_vendor_handoff_params **vendor_handoff_params);
+#endif
 #endif
 #ifdef FEATURE_MEC_OFFLOAD
 QDF_STATUS
@@ -837,6 +853,11 @@ QDF_STATUS (*send_set_ric_req_cmd)(wmi_unified_t wmi_handle, void *msg,
 QDF_STATUS (*send_process_roam_synch_complete_cmd)(wmi_unified_t wmi_handle,
 		 uint8_t vdev_id);
 
+#ifdef WLAN_VENDOR_HANDOFF_CONTROL
+QDF_STATUS (*send_process_roam_vendor_handoff_req_cmd)(wmi_unified_t wmi_handle,
+					uint8_t vdev_id, uint32_t param_id);
+#endif
+
 QDF_STATUS (*send_roam_invoke_cmd)(wmi_unified_t wmi_handle,
 		struct roam_invoke_req *roaminvoke);
 

+ 4 - 0
wmi/src/wmi_unified_tlv.c

@@ -18940,6 +18940,10 @@ static void populate_tlv_events_id(uint32_t *event_ids)
 	event_ids[wmi_rtt_pasn_peer_delete_eventid] =
 			WMI_RTT_PASN_PEER_DELETE_EVENTID;
 #endif
+#ifdef WLAN_VENDOR_HANDOFF_CONTROL
+	event_ids[wmi_get_roam_vendor_control_param_event_id] =
+				WMI_ROAM_GET_VENDOR_CONTROL_PARAM_EVENTID;
+#endif
 }
 
 #ifdef WLAN_FEATURE_LINK_LAYER_STATS