Browse Source

qcacld-3.0: os_if: Add TWT componentization public structs and files

Add TWT componentization public structs, files and skeleton code.

Change-Id: I36dfb198dea0cfa06615ecb93014e5187643731d
CRs-Fixed: 3085419
Srinivas Girigowda 3 years ago
parent
commit
20af0a2e4c

+ 9 - 1
core/hdd/src/wlan_hdd_main.c

@@ -17333,9 +17333,17 @@ static QDF_STATUS hdd_component_cb_init(void)
 
 	status = hdd_vdev_mgr_register_cb();
 	if (QDF_IS_STATUS_ERROR(status))
-		return status;
+		goto cm_unregister_cb;
+
+	status = osif_twt_register_cb();
+	if (QDF_IS_STATUS_ERROR(status))
+		goto cm_unregister_cb;
 
 	return QDF_STATUS_SUCCESS;
+
+cm_unregister_cb:
+	hdd_cm_unregister_cb();
+	return status;
 }
 
 /**

+ 119 - 0
os_if/twt/inc/osif_twt_ext_req.h

@@ -0,0 +1,119 @@
+/*
+ * 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 copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC : osif_twt_ext_req.h
+ *
+ * WLAN Host Device Driver file for TWT (Target Wake Time) support.
+ *
+ */
+#ifndef _OSIF_TWT_EXT_REQ_H_
+#define _OSIF_TWT_EXT_REQ_H_
+
+#include <wlan_objmgr_psoc_obj.h>
+#include <wlan_twt_public_structs.h>
+#include <qca_vendor.h>
+#include <wlan_objmgr_peer_obj.h>
+
+#define TWT_WAKE_INTVL_MULTIPLICATION_FACTOR    1024
+#define TWT_WAKE_DURATION_MULTIPLICATION_FACTOR 256
+
+#if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
+/**
+ * osif_twt_setup_req() - Process TWT setup operation
+ * in the received vendor command and send it to firmware
+ * @vdev: vdev
+ * @twt_param_attr: nl attributes
+ *
+ * sets up TWT setup request from HDD. request is passed
+ * to TWT core
+ *
+ * Handles QCA_WLAN_TWT_SETUP
+ *
+ * Return: success on 0, failure on non-zero
+ */
+int osif_twt_setup_req(struct wlan_objmgr_vdev *vdev,
+		       struct nlattr *twt_param_attr);
+
+/**
+ * osif_twt_sta_teardown_req() - Process TWT sta teardown operation
+ * in the received vendor command and send it to firmware
+ * @vdev: vdev
+ * @twt_param_attr: nl attributes
+ *
+ * sets up TWT teardown request from HDD. request is passed
+ * to TWT core
+ *
+ * Handles QCA_WLAN_TWT_TEARDOWN
+ *
+ * Return: success on 0, failure on non-zero
+ */
+int osif_twt_sta_teardown_req(struct wlan_objmgr_vdev *vdev,
+			      struct nlattr *twt_param_attr);
+
+/**
+ * osif_twt_sap_teardown_req() - Process TWT sap teardown operation
+ * in the received vendor command and send it to firmware
+ * @vdev: vdev
+ * @twt_param_attr: nl attributes
+ *
+ * sets up TWT teardown request from HDD. request is passed
+ * to TWT core
+ *
+ * Handles QCA_WLAN_TWT_TEARDOWN
+ *
+ * Return: success on 0, failure on non-zero
+ */
+int osif_twt_sap_teardown_req(struct wlan_objmgr_vdev *vdev,
+			      struct nlattr *twt_param_attr);
+
+/**
+ * osif_twt_handle_renego_failure() - Handle twt renegotiation failure
+ * @psoc: pointer to psoc
+ * @add_dialog_event: event data
+ *
+ * Return: none
+ */
+void
+osif_twt_handle_renego_failure(struct wlan_objmgr_psoc *psoc,
+		       struct twt_add_dialog_complete_event *add_dialog_event);
+#else
+static inline
+int osif_twt_setup_req(struct wlan_objmgr_vdev *vdev,
+		       struct nlattr *twt_param_attr)
+{
+	return 0;
+}
+
+static inline
+int osif_twt_sta_teardown_req(struct wlan_objmgr_vdev *vdev,
+			      struct nlattr *twt_param_attr)
+{
+	return 0;
+}
+
+static inline
+int osif_twt_sap_teardown_req(struct wlan_objmgr_vdev *vdev,
+			      struct nlattr *twt_param_attr)
+{
+	return 0;
+}
+
+#endif
+#endif /* _OSIF_TWT_EXT_REQ_H_ */
+

+ 167 - 0
os_if/twt/inc/osif_twt_ext_rsp.h

@@ -0,0 +1,167 @@
+/*
+ * 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 copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC : osif_twt_ext_rsp.h
+ *
+ * WLAN Host Device Driver file for TWT (Target Wake Time) support.
+ *
+ */
+
+#ifndef _OSIF_TWT_EXT_RSP_H_
+#define _OSIF_TWT_EXT_RSP_H_
+
+#include <wlan_osif_request_manager.h>
+
+#if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
+/**
+ * osif_twt_setup_complete_cb() - setup complete osif callback
+ * @psoc: psoc pointer
+ * @event: setup complete response
+ * @renego_fail: flag to indicate if renegotiation failure case
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+osif_twt_setup_complete_cb(struct wlan_objmgr_psoc *psoc,
+			   struct twt_add_dialog_complete_event *event,
+			   bool renego_fail);
+
+/**
+ * osif_twt_teardown_complete_cb() - teardown complete osif callback
+ * @psoc: psoc pointer
+ * @event: teardown complete response
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+osif_twt_teardown_complete_cb(struct wlan_objmgr_psoc *psoc,
+			     struct twt_del_dialog_complete_event_param *event);
+
+/**
+ * osif_twt_pause_complete_cb() - pause complete osif callback
+ * @psoc: psoc pointer
+ * @event: pause complete response
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+osif_twt_pause_complete_cb(struct wlan_objmgr_psoc *psoc,
+			   struct twt_pause_dialog_complete_event_param *event);
+
+/**
+ * osif_twt_resume_complete_cb() - resume complete osif callback
+ * @psoc: psoc pointer
+ * @event: resume complete response
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+osif_twt_resume_complete_cb(struct wlan_objmgr_psoc *psoc,
+			  struct twt_resume_dialog_complete_event_param *event);
+
+/**
+ * osif_twt_nudge_complete_cb() - nudge complete osif callback
+ * @psoc: psoc pointer
+ * @event: nudge complete response
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+osif_twt_nudge_complete_cb(struct wlan_objmgr_psoc *psoc,
+			   struct twt_nudge_dialog_complete_event_param *event);
+
+/**
+ * osif_twt_notify_complete_cb() - notify complete osif callback
+ * @psoc: psoc pointer
+ * @event: notify complete response
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+osif_twt_notify_complete_cb(struct wlan_objmgr_psoc *psoc,
+			    struct twt_notify_event_param *event);
+
+/**
+ * osif_twt_ack_complete_cb() - ack complete osif callback
+ * @psoc: psoc pointer
+ * @event: ack complete response
+ * @context: context
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+osif_twt_ack_complete_cb(struct wlan_objmgr_psoc *psoc,
+			 struct twt_ack_complete_event_param *params,
+			 void *context);
+
+#else
+static inline QDF_STATUS
+osif_twt_setup_complete_cb(struct wlan_objmgr_psoc *psoc,
+			   struct twt_add_dialog_complete_event *event,
+			   bool renego_fail)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS
+osif_twt_teardown_complete_cb(struct wlan_objmgr_psoc *psoc,
+			      struct twt_del_dialog_complete_event_param *event)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS
+osif_twt_pause_complete_cb(struct wlan_objmgr_psoc *psoc,
+			   struct twt_pause_dialog_complete_event_param *event)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS
+osif_twt_resume_complete_cb(struct wlan_objmgr_psoc *psoc,
+			   struct twt_resume_dialog_complete_event_param *event)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS
+osif_twt_nudge_complete_cb(struct wlan_objmgr_psoc *psoc,
+			   struct twt_nudge_dialog_complete_event_param *event)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS
+osif_twt_notify_complete_cb(struct wlan_objmgr_psoc *psoc,
+			    struct twt_notify_event_param *event)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS
+osif_twt_ack_complete_cb(struct wlan_objmgr_psoc *psoc,
+			 struct twt_ack_complete_event_param *params,
+			 void *context)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+#endif
+#endif /* _OSIF_TWT_RSP_H_ */
+

+ 120 - 0
os_if/twt/inc/osif_twt_internal.h

@@ -0,0 +1,120 @@
+/*
+ * 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 copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC : osif_twt_internal.h
+ *
+ * WLAN Host Device Driver file for TWT (Target Wake Time) support.
+ *
+ */
+
+#ifndef _OSIF_TWT_INTERNAL_H_
+#define _OSIF_TWT_INTERNAL_H_
+
+#if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
+/**
+ * struct twt_conc_context: TWT concurrency args
+ * @psoc: pointer to psoc
+ */
+struct twt_conc_context {
+	struct wlan_objmgr_psoc *psoc;
+};
+
+/**
+ * osif_twt_send_requestor_enable_cmd() - Send TWT requestor enable command to
+ * target
+ * @psoc: pointer to global psoc structure
+ * @pdev_id: pdev id
+ *
+ * Return: errno
+ */
+int osif_twt_send_requestor_enable_cmd(struct wlan_objmgr_psoc *psoc,
+				       uint8_t pdev_id);
+
+/**
+ * osif_twt_send_responder_enable_cmd() - Send TWT responder enable command to
+ * target
+ * @psoc: pointer to global psoc structure
+ * @pdev_id: pdev id
+ *
+ * Return: errno
+ */
+int osif_twt_send_responder_enable_cmd(struct wlan_objmgr_psoc *psoc,
+				       uint8_t pdev_id);
+
+/**
+ * osif_twt_send_requestor_disable_cmd() - Send TWT requestor disable command
+ * to target
+ * @psoc: pointer to global psoc structure
+ * @pdev_id: pdev id
+ *
+ * Return: errno
+ */
+int osif_twt_send_requestor_disable_cmd(struct wlan_objmgr_psoc *psoc,
+					uint8_t pdev_id);
+
+/**
+ * osif_twt_send_responder_disable_cmd() - Send TWT responder disable command
+ * to target
+ * @psoc: pointer to global psoc structure
+ * @pdev_id: pdev id
+ *
+ * Return: errno
+ */
+int osif_twt_send_responder_disable_cmd(struct wlan_objmgr_psoc *psoc,
+					uint8_t pdev_id);
+
+/**
+ * osif_twt_concurrency_update_handler() - Handle TWT concurrency scenario
+ * @psoc: pointer to global psoc structure
+ * @pdev: pointer to pdev
+ *
+ * Return: none
+ */
+void osif_twt_concurrency_update_handler(struct wlan_objmgr_psoc *psoc,
+					 struct wlan_objmgr_pdev *pdev);
+#else
+static inline
+int osif_twt_send_requestor_disable_cmd(struct wlan_objmgr_psoc *psoc,
+					uint8_t pdev_id)
+{
+	return 0;
+}
+
+static inline
+int osif_twt_send_requestor_enable_cmd(struct wlan_objmgr_psoc *psoc,
+				       uint8_t pdev_id)
+{
+	return 0;
+}
+
+static inline
+int osif_twt_send_responder_enable_cmd(struct wlan_objmgr_psoc *psoc,
+				       uint8_t pdev_id)
+{
+	return 0;
+}
+
+static inline
+void osif_twt_concurrency_update_handler(struct wlan_objmgr_psoc *psoc,
+					 struct wlan_objmgr_pdev *pdev)
+{
+}
+#endif
+#endif /* _OSIF_TWT_INTERNAL_H_ */
+

+ 60 - 0
os_if/twt/src/osif_twt_ext_req.c

@@ -0,0 +1,60 @@
+/*
+ * 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
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ *  DOC: osif_twt_ext_req.c
+ *  This file contains twt component's osif API implementation
+ */
+#include <wlan_objmgr_vdev_obj.h>
+#include <wlan_twt_ucfg_api.h>
+#include <wlan_twt_ucfg_ext_api.h>
+#include <osif_twt_ext_req.h>
+#include <wlan_policy_mgr_api.h>
+#include <wlan_cm_api.h>
+#include <wlan_cfg80211.h>
+#include <wlan_cm_roam_api.h>
+#include <wlan_serialization_api.h>
+#include <osif_twt_internal.h>
+#include <wlan_osif_request_manager.h>
+
+#define TWT_ACK_COMPLETE_TIMEOUT 1000
+
+#define TWT_FLOW_TYPE_ANNOUNCED 0
+#define TWT_FLOW_TYPE_UNANNOUNCED 1
+
+#define TWT_SETUP_WAKE_INTVL_MANTISSA_MAX       0xFFFF
+#define TWT_SETUP_WAKE_DURATION_MAX             0xFFFF
+#define TWT_SETUP_WAKE_INTVL_EXP_MAX            31
+#define TWT_MAX_NEXT_TWT_SIZE                   3
+
+int osif_twt_setup_req(struct wlan_objmgr_vdev *vdev,
+		       struct nlattr *twt_param_attr)
+{
+	return 0;
+}
+
+int osif_twt_sap_teardown_req(struct wlan_objmgr_vdev *vdev,
+			      struct nlattr *twt_param_attr)
+{
+	return 0;
+}
+
+int osif_twt_sta_teardown_req(struct wlan_objmgr_vdev *vdev,
+			      struct nlattr *twt_param_attr)
+{
+	return 0;
+}
+

+ 77 - 0
os_if/twt/src/osif_twt_ext_rsp.c

@@ -0,0 +1,77 @@
+/*
+ * 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
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: osif_twt_ext_rsp.c
+ *
+ */
+#include <wlan_cfg80211.h>
+#include <osif_twt_ext_req.h>
+#include <osif_twt_ext_rsp.h>
+#include <wlan_objmgr_psoc_obj.h>
+#include <wlan_osif_priv.h>
+
+QDF_STATUS
+osif_twt_setup_complete_cb(struct wlan_objmgr_psoc *psoc,
+			   struct twt_add_dialog_complete_event *event,
+			   bool renego_fail)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+osif_twt_teardown_complete_cb(struct wlan_objmgr_psoc *psoc,
+			      struct twt_del_dialog_complete_event_param *event)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+osif_twt_pause_complete_cb(struct wlan_objmgr_psoc *psoc,
+			   struct twt_pause_dialog_complete_event_param *event)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+osif_twt_resume_complete_cb(struct wlan_objmgr_psoc *psoc,
+			   struct twt_resume_dialog_complete_event_param *event)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+osif_twt_nudge_complete_cb(struct wlan_objmgr_psoc *psoc,
+			   struct twt_nudge_dialog_complete_event_param *event)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+osif_twt_notify_complete_cb(struct wlan_objmgr_psoc *psoc,
+			    struct twt_notify_event_param *event)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+osif_twt_ack_complete_cb(struct wlan_objmgr_psoc *psoc,
+			 struct twt_ack_complete_event_param *params,
+			 void *context)
+{
+	return QDF_STATUS_SUCCESS;
+}
+

+ 52 - 0
os_if/twt/src/osif_twt_ext_util.c

@@ -0,0 +1,52 @@
+/*
+ * 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
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ *  DOC: osif_twt_ext_util.c
+ */
+#include <include/wlan_mlme_cmn.h>
+#include <osif_twt_util.h>
+#include <osif_twt_rsp.h>
+#include <osif_twt_ext_rsp.h>
+#include <wlan_twt_ucfg_ext_api.h>
+
+static struct mlme_twt_ops twt_ops = {
+	.mlme_twt_enable_complete_cb = osif_twt_enable_complete_cb,
+	.mlme_twt_disable_complete_cb = osif_twt_disable_complete_cb,
+	.mlme_twt_setup_complete_cb = osif_twt_setup_complete_cb,
+	.mlme_twt_teardown_complete_cb = osif_twt_teardown_complete_cb,
+	.mlme_twt_pause_complete_cb = osif_twt_pause_complete_cb,
+	.mlme_twt_resume_complete_cb = osif_twt_resume_complete_cb,
+	.mlme_twt_nudge_complete_cb = osif_twt_nudge_complete_cb,
+	.mlme_twt_notify_complete_cb = osif_twt_notify_complete_cb,
+	.mlme_twt_ack_complete_cb = osif_twt_ack_complete_cb,
+};
+
+/**
+ * osif_twt_get_global_ops() - Get twt global ops
+ *
+ * Return: twt global ops
+ */
+static struct mlme_twt_ops *osif_twt_get_global_ops(void)
+{
+	return &twt_ops;
+}
+
+QDF_STATUS osif_twt_register_cb(void)
+{
+	return ucfg_twt_set_osif_cb(osif_twt_get_global_ops);
+}
+