diff --git a/os_if/linux/twt/inc/osif_twt_req.h b/os_if/linux/twt/inc/osif_twt_req.h new file mode 100644 index 0000000000..c7c429cc5e --- /dev/null +++ b/os_if/linux/twt/inc/osif_twt_req.h @@ -0,0 +1,100 @@ +/* + * 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_req.h + * + */ + +#ifndef _OSIF_TWT_REQ_H_ +#define _OSIF_TWT_REQ_H_ + +#if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED) +#include +#include + +/** + * osif_twt_requestor_enable() - TWT requestor enable api + * @psoc: psoc handle + * @req: TWT enable request + * + * Return: 0 on success, errno on failure + */ +int osif_twt_requestor_enable(struct wlan_objmgr_psoc *psoc, + struct twt_enable_param *req); + +/** + * osif_twt_responder_enable() - TWT responder enable api + * @psoc: psoc handle + * @req: TWT enable request + * + * Return: 0 on success, errno on failure + */ +int osif_twt_responder_enable(struct wlan_objmgr_psoc *psoc, + struct twt_enable_param *req); + +/** + * osif_twt_requestor_disable() - TWT requestor disable api + * @psoc: psoc handle + * @req: TWT disable request + * + * Return: 0 on success, errno on failure + */ +int osif_twt_requestor_disable(struct wlan_objmgr_psoc *psoc, + struct twt_disable_param *req); + +/** + * osif_twt_responder_disable() - TWT responder disable api + * @psoc: psoc handle + * @req: TWT disable request + * + * Return: 0 on success, errno on failure + */ +int osif_twt_responder_disable(struct wlan_objmgr_psoc *psoc, + struct twt_disable_param *req); +#else +static inline +int osif_twt_requestor_enable(struct wlan_objmgr_psoc *psoc, + struct twt_enable_param *req) +{ + return 0; +} + +static inline +int osif_twt_responder_enable(struct wlan_objmgr_psoc *psoc, + struct twt_enable_param *req) +{ + return 0; +} + +static inline +int osif_twt_requestor_disable(struct wlan_objmgr_psoc *psoc, + struct twt_disable_param *req) +{ + return 0; +} + +static inline +int osif_twt_responder_disable(struct wlan_objmgr_psoc *psoc, + struct twt_disable_param *req) +{ + return 0; +} +#endif +#endif /* _OSIF_TWT_REQ_H_ */ + diff --git a/os_if/linux/twt/inc/osif_twt_rsp.h b/os_if/linux/twt/inc/osif_twt_rsp.h new file mode 100644 index 0000000000..2571b28fc3 --- /dev/null +++ b/os_if/linux/twt/inc/osif_twt_rsp.h @@ -0,0 +1,73 @@ +/* + * 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_rsp.h + * + */ + +#ifndef _OSIF_TWT_RSP_H_ +#define _OSIF_TWT_RSP_H_ + +#include +#include + +#if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED) +/** + * osif_twt_enable_complete_cb() - callback for twt enable complete event + * @psoc: Pointer to global psoc + * @event: Pointer to TWT enable dialog complete event structure + * @context: TWT enable context set during TWT enable request + * + * Return: QDF_STATUS + */ +QDF_STATUS +osif_twt_enable_complete_cb(struct wlan_objmgr_psoc *psoc, + struct twt_enable_complete_event_param *event, + void *context); +/** + * osif_twt_disable_complete_cb() - callback for twt disable complete event + * @psoc: Pointer to global psoc + * @event: Pointer to TWT disable dialog complete event structure + * @context: TWT disable context set during TWT disable request + * + * Return: QDF_STATUS + */ +QDF_STATUS +osif_twt_disable_complete_cb(struct wlan_objmgr_psoc *psoc, + struct twt_disable_complete_event_param *event, + void *context); +#else +static inline QDF_STATUS +osif_twt_enable_complete_cb(struct wlan_objmgr_psoc *psoc, + struct twt_enable_complete_event_param *event, + void *context) +{ + return QDF_STATUS_SUCCESS; +} + +static inline QDF_STATUS +osif_twt_disable_complete_cb(struct wlan_objmgr_psoc *psoc, + struct twt_disable_complete_event_param *event, + void *context) +{ + return QDF_STATUS_SUCCESS; +} +#endif +#endif /* _OSIF_TWT_RSP_H_ */ + diff --git a/os_if/linux/twt/inc/osif_twt_util.h b/os_if/linux/twt/inc/osif_twt_util.h new file mode 100644 index 0000000000..0831e35888 --- /dev/null +++ b/os_if/linux/twt/inc/osif_twt_util.h @@ -0,0 +1,54 @@ +/* + * 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_util.h + * + */ + +#ifndef _OSIF_TWT_UTIL_H_ +#define _OSIF_TWT_UTIL_H_ + +#if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED) +/** + * struct twt_en_dis_priv - twt enable/disable private context + * @vdev_id: vdev id + */ +struct twt_en_dis_priv { + uint32_t pdev_id; + uint32_t status; +}; + +/** + * osif_twt_register_cb() - Set TWT osif callbacks + * + * API to set twt callbacks to osif + * + * Return: QDF_STATUS + */ +QDF_STATUS osif_twt_register_cb(void); + +#else +static inline QDF_STATUS osif_twt_register_cb(void) +{ + return QDF_STATUS_SUCCESS; +} + +#endif +#endif /* _OSIF_TWT_UTIL_H_ */ + diff --git a/os_if/linux/twt/src/osif_twt_req.c b/os_if/linux/twt/src/osif_twt_req.c new file mode 100644 index 0000000000..a50d8ed72a --- /dev/null +++ b/os_if/linux/twt/src/osif_twt_req.c @@ -0,0 +1,53 @@ +/* + * 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_req.c + * This file contains twt request related osif APIs + */ +#include +#include +#include +#include +#include + +#define TWT_DISABLE_COMPLETE_TIMEOUT 1000 +#define TWT_ENABLE_COMPLETE_TIMEOUT 1000 + +int osif_twt_requestor_enable(struct wlan_objmgr_psoc *psoc, + struct twt_enable_param *req) +{ + return 0; +} + +int osif_twt_responder_enable(struct wlan_objmgr_psoc *psoc, + struct twt_enable_param *req) +{ + return 0; +} + +int osif_twt_requestor_disable(struct wlan_objmgr_psoc *psoc, + struct twt_disable_param *req) +{ + return 0; +} + +int osif_twt_responder_disable(struct wlan_objmgr_psoc *psoc, + struct twt_disable_param *req) +{ + return 0; +} + diff --git a/os_if/linux/twt/src/osif_twt_rsp.c b/os_if/linux/twt/src/osif_twt_rsp.c new file mode 100644 index 0000000000..3d46bb2886 --- /dev/null +++ b/os_if/linux/twt/src/osif_twt_rsp.c @@ -0,0 +1,57 @@ +/* + * 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_rsp.c + * + */ +#include +#include +#include +#include + +/** + * osif_twt_enable_complete_cb() - callback for twt enable complete event + * @psoc: Pointer to global psoc + * @event: Pointer to TWT enable dialog complete event structure + * @context: TWT enable context set during TWT enable request + * + * Return: QDF_STATUS + */ +QDF_STATUS +osif_twt_enable_complete_cb(struct wlan_objmgr_psoc *psoc, + struct twt_enable_complete_event_param *event, + void *context) +{ + return QDF_STATUS_SUCCESS; +} + +/** + * osif_twt_disable_complete_cb() - callback for twt disable complete event + * @psoc: Pointer to global psoc + * @event: Pointer to TWT disable dialog complete event structure + * @context: TWT disable context set during TWT disable request + * + * Return: QDF_STATUS + */ +QDF_STATUS +osif_twt_disable_complete_cb(struct wlan_objmgr_psoc *psoc, + struct twt_disable_complete_event_param *event, + void *context) +{ + return QDF_STATUS_SUCCESS; +} +