Browse Source

qcacld-3.0: Make legacy WMA TWT functions no-op

Make legacy WMA TWT functions no-op if TWT componentization is enabled.

Change-Id: I19ab205dac72d869bbe90bad359f89fe83275e4d
CRs-Fixed: 3085424
Srinivas Girigowda 3 years ago
parent
commit
3d62f09171

+ 5 - 5
core/hdd/src/wlan_hdd_twt.c

@@ -1043,7 +1043,7 @@ static int hdd_twt_get_session_params(struct hdd_adapter *adapter,
  * Return: Length of twt setup nl response
  */
 static uint32_t
-hdd_get_twt_setup_event_len(struct twt_add_dialog_complete_event *ev_params)
+hdd_get_twt_setup_event_len(struct wma_twt_add_dialog_complete_event *ev_params)
 {
 	uint32_t len = 0;
 
@@ -1338,7 +1338,7 @@ wmi_twt_add_status_to_vendor_twt_status(enum WMI_HOST_ADD_TWT_STATUS status)
  */
 static QDF_STATUS
 hdd_twt_setup_pack_resp_nlmsg(struct sk_buff *reply_skb,
-			      struct twt_add_dialog_complete_event *event)
+			      struct wma_twt_add_dialog_complete_event *event)
 {
 	struct nlattr *config_attr;
 	uint64_t sp_offset_tsf;
@@ -1516,7 +1516,7 @@ hdd_twt_setup_pack_resp_nlmsg(struct sk_buff *reply_skb,
  */
 static QDF_STATUS hdd_send_twt_setup_response(
 		struct hdd_adapter *adapter,
-		struct twt_add_dialog_complete_event *add_dialog_comp_ev_params)
+		struct wma_twt_add_dialog_complete_event *add_dialog_comp_ev_params)
 {
 	struct hdd_context *hdd_ctx;
 	struct sk_buff *twt_vendor_event;
@@ -1565,7 +1565,7 @@ static QDF_STATUS hdd_send_twt_setup_response(
  */
 static void
 hdd_twt_handle_renego_failure(struct hdd_adapter *adapter,
-			      struct twt_add_dialog_complete_event *add_dialog_event)
+			      struct wma_twt_add_dialog_complete_event *add_dialog_event)
 {
 	struct wmi_twt_del_dialog_param params = {0};
 
@@ -1683,7 +1683,7 @@ hdd_twt_ack_wait_response(struct hdd_context *hdd_ctx,
  */
 static void
 hdd_twt_add_dialog_comp_cb(struct wlan_objmgr_psoc *psoc,
-			   struct twt_add_dialog_complete_event *add_dialog_event,
+			   struct wma_twt_add_dialog_complete_event *add_dialog_event,
 			   bool renego_fail)
 {
 	struct hdd_adapter *adapter;

+ 4 - 4
core/sme/inc/sme_internal.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-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
@@ -40,7 +40,7 @@
 #include "wmi_unified.h"
 #include "wmi_unified_param.h"
 
-struct twt_add_dialog_complete_event;
+struct wma_twt_add_dialog_complete_event;
 struct wmi_twt_add_dialog_complete_event_param;
 struct wmi_twt_enable_complete_event_param;
 /*--------------------------------------------------------------------------
@@ -168,7 +168,7 @@ typedef void (*twt_disable_cb)(hdd_handle_t hdd_handle);
  */
 typedef
 void (*twt_add_dialog_cb)(struct wlan_objmgr_psoc *psoc,
-			  struct twt_add_dialog_complete_event *add_dialog_evt,
+			  struct wma_twt_add_dialog_complete_event *add_dialog_evt,
 			  bool renego_fail);
 
 /**
@@ -242,7 +242,7 @@ struct twt_callbacks {
 			      struct wmi_twt_enable_complete_event_param *params);
 	void (*twt_disable_cb)(hdd_handle_t hdd_handle);
 	void (*twt_add_dialog_cb)(struct wlan_objmgr_psoc *psoc,
-				  struct twt_add_dialog_complete_event *add_dialog_event,
+				  struct wma_twt_add_dialog_complete_event *add_dialog_event,
 				  bool renego);
 	void (*twt_del_dialog_cb)(struct wlan_objmgr_psoc *psoc,
 				  struct wmi_twt_del_dialog_complete_event_param *params);

+ 4 - 4
core/sme/src/common/sme_api.c

@@ -2070,7 +2070,7 @@ sme_sap_init_twt_context(struct wlan_objmgr_psoc *psoc,
  */
 static void
 sme_process_twt_add_renego_failure(struct mac_context *mac,
-				 struct twt_add_dialog_complete_event *add_dialog_event)
+				 struct wma_twt_add_dialog_complete_event *add_dialog_event)
 {
 	twt_add_dialog_cb callback;
 
@@ -2095,7 +2095,7 @@ sme_process_twt_add_renego_failure(struct mac_context *mac,
  */
 static void
 sme_process_twt_add_initial_nego(struct mac_context *mac,
-				 struct twt_add_dialog_complete_event *add_dialog_event)
+				 struct wma_twt_add_dialog_complete_event *add_dialog_event)
 {
 	twt_add_dialog_cb callback;
 
@@ -2138,7 +2138,7 @@ sme_process_twt_add_initial_nego(struct mac_context *mac,
  */
 static void
 sme_process_twt_add_dialog_event(struct mac_context *mac,
-				 struct twt_add_dialog_complete_event
+				 struct wma_twt_add_dialog_complete_event
 				 *add_dialog_event)
 {
 	bool is_evt_allowed;
@@ -2539,7 +2539,7 @@ void sme_twt_update_beacon_template(mac_handle_t mac_handle)
 #else
 static void
 sme_process_twt_add_dialog_event(struct mac_context *mac,
-				 struct twt_add_dialog_complete_event *add_dialog_event)
+				 struct wma_twt_add_dialog_complete_event *add_dialog_event)
 {
 }
 

+ 3 - 2
core/wma/inc/wma_twt.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021-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
@@ -39,14 +40,14 @@ struct twt_enable_disable_conf {
 };
 
 /**
- * struct twt_add_dialog_complete_event - TWT add dialog complete event
+ * struct wma_twt_add_dialog_complete_event - TWT add dialog complete event
  * @params: Fixed parameters for TWT add dialog complete event
  * @additional_params: additional parameters for TWT add dialog complete event
  *
  * Holds the fixed and additional parameters from add dialog
  * complete event
  */
-struct twt_add_dialog_complete_event {
+struct wma_twt_add_dialog_complete_event {
 	struct wmi_twt_add_dialog_complete_event_param params;
 	struct wmi_twt_add_dialog_additional_params additional_params;
 };

+ 86 - 2
core/wma/src/wma_twt.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021-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
@@ -26,6 +27,70 @@
 #include "wma_internal.h"
 #include "wmi_unified_priv.h"
 
+#if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
+
+void wma_update_bcast_twt_support(tp_wma_handle wh,
+				  struct wma_tgt_cfg *tgt_cfg)
+{
+}
+
+void wma_register_twt_events(tp_wma_handle wma_handle)
+{
+}
+
+void wma_set_twt_peer_caps(tpAddStaParams params, struct peer_assoc_params *cmd)
+{
+}
+
+void wma_update_twt_tgt_cap(tp_wma_handle wh, struct wma_tgt_cfg *tgt_cfg)
+{
+}
+
+void wma_send_twt_enable_cmd(uint32_t pdev_id,
+			     struct twt_enable_disable_conf *conf)
+{
+}
+
+void wma_send_twt_disable_cmd(uint32_t pdev_id,
+			      struct twt_enable_disable_conf *conf)
+{
+}
+
+QDF_STATUS wma_twt_process_add_dialog(t_wma_handle *wma_handle,
+				      struct wmi_twt_add_dialog_param *params)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+wma_twt_process_del_dialog(t_wma_handle *wma_handle,
+			   struct wmi_twt_del_dialog_param *params)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+wma_twt_process_pause_dialog(t_wma_handle *wma_handle,
+			     struct wmi_twt_pause_dialog_cmd_param *params)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+wma_twt_process_nudge_dialog(t_wma_handle *wma_handle,
+			     struct wmi_twt_nudge_dialog_cmd_param *params)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+wma_twt_process_resume_dialog(t_wma_handle *wma_handle,
+			      struct wmi_twt_resume_dialog_cmd_param *params)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+#elif WLAN_SUPPORT_TWT
 void wma_send_twt_enable_cmd(uint32_t pdev_id,
 			     struct twt_enable_disable_conf *conf)
 {
@@ -119,16 +184,34 @@ void wma_send_twt_disable_cmd(uint32_t pdev_id,
  * Return: 0 on success, negative value on failure
  */
 static
-int wma_twt_disable_comp_event_handler(void *handle, uint8_t *event,
+int wma_twt_disable_comp_event_handler(void *handle, uint8_t *data,
 				       uint32_t len)
 {
 	struct mac_context *mac;
+	struct wmi_twt_disable_complete_event event;
+	tp_wma_handle wma_handle = handle;
+	wmi_unified_t wmi_handle;
+	QDF_STATUS status;
 
 	mac = (struct mac_context *)cds_get_context(QDF_MODULE_ID_PE);
 	if (!mac)
 		return -EINVAL;
 
+	if (wma_validate_handle(wma_handle))
+		return -EINVAL;
+
+	wmi_handle = wma_handle->wmi_handle;
+	if (wmi_validate_handle(wmi_handle))
+		return -EINVAL;
+
 	wma_debug("TWT: Rcvd TWT disable comp event");
+	status = wmi_extract_twt_disable_comp_event(wmi_handle, data, &event);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wma_err("TWT disable extract event failed(status=%d)", status);
+		return -EINVAL;
+	}
+
+	wma_debug("pdev_id: %d", event.pdev_id);
 
 	if (mac->sme.twt_disable_cb)
 		mac->sme.twt_disable_cb(mac->hdd_handle);
@@ -172,7 +255,7 @@ static
 int wma_twt_add_dialog_complete_event_handler(void *handle,
 					      uint8_t *event, uint32_t len)
 {
-	struct twt_add_dialog_complete_event *add_dialog_event;
+	struct wma_twt_add_dialog_complete_event *add_dialog_event;
 	struct scheduler_msg sme_msg = {0};
 	tp_wma_handle wma_handle = handle;
 	wmi_unified_t wmi_handle;
@@ -681,3 +764,4 @@ void wma_register_twt_events(tp_wma_handle wma_handle)
 				 wma_twt_ack_complete_event_handler,
 				 WMA_RX_WORK_CTX);
 }
+#endif