blob: 7a181c75853fe7679d18230fee3e4a96e9423e2f [file] [log] [blame]
Varun Reddy Yeturu96285a22018-05-08 13:37:43 -07001/*
2 * Copyright (c) 2018 The Linux Foundation. All rights reserved.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
19/**
20 * DOC : wlan_hdd_twt.h
21 *
22 * WLAN Host Device Driver file for TWT (Target Wake Time) support.
23 *
24 */
25
26#if !defined(WLAN_HDD_TWT_H)
27#define WLAN_HDD_TWT_H
28
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -070029#include "qdf_types.h"
30#include "qdf_status.h"
31
Varun Reddy Yeturu96285a22018-05-08 13:37:43 -070032struct hdd_context;
Varun Reddy Yeturue93d2462018-05-22 13:54:52 -070033struct wma_tgt_cfg;
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -070034struct wmi_twt_enable_complete_event_param;
Varun Reddy Yeturu96285a22018-05-08 13:37:43 -070035
Varun Reddy Yeturud33033f2018-06-11 10:58:30 -070036#ifdef WLAN_SUPPORT_TWT
Varun Reddy Yeturu96285a22018-05-08 13:37:43 -070037/**
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -070038 * enum twt_status - TWT target state
39 * @TWT_INIT: Init State
40 * @TWT_DISABLED: TWT is disabled
41 * @TWT_FW_TRIGGER_ENABLE_REQUESTED: FW triggered enable requested
42 * @TWT_FW_TRIGGER_ENABLED: FW triggered twt enabled
43 * @TWT_HOST_TRIGGER_ENABLE_REQUESTED: Host triggered TWT requested
44 * @TWT_HOST_TRIGGER_ENABLED: Host triggered TWT enabled
45 * @TWT_DISABLE_REQUESTED: TWT disable requested
46 * @TWT_SUSPEND_REQUESTED: TWT suspend requested
47 * @TWT_SUSPENDED: Successfully suspended TWT
48 * @TWT_RESUME_REQUESTED: TWT Resume requested
49 * @TWT_RESUMED: Successfully resumed TWT
50 * @TWT_CLOSED: Deinitialized TWT feature and closed
51 */
52enum twt_status {
53 TWT_INIT,
54 TWT_DISABLED,
55 TWT_FW_TRIGGER_ENABLE_REQUESTED,
56 TWT_FW_TRIGGER_ENABLED,
57 TWT_HOST_TRIGGER_ENABLE_REQUESTED,
58 TWT_HOST_TRIGGER_ENABLED,
59 TWT_DISABLE_REQUESTED,
60 TWT_SUSPEND_REQUESTED,
61 TWT_SUSPENDED,
62 TWT_RESUME_REQUESTED,
63 TWT_RESUMED,
64 TWT_CLOSED,
65};
66
67/**
Varun Reddy Yeturu96285a22018-05-08 13:37:43 -070068 * hdd_twt_print_ini_config() - Print TWT INI config items
69 * @hdd_ctx: HDD Context
70 *
71 * Return: None
72 */
73void hdd_twt_print_ini_config(struct hdd_context *hdd_ctx);
74
Varun Reddy Yeturue93d2462018-05-22 13:54:52 -070075/**
76 * hdd_update_tgt_twt_cap() - Update TWT target capabilities
77 * @hdd_ctx: HDD Context
78 * @cfg: Pointer to target configuration
79 *
80 * Return: None
81 */
82void hdd_update_tgt_twt_cap(struct hdd_context *hdd_ctx,
83 struct wma_tgt_cfg *cfg);
84
Varun Reddy Yeturu1b4cbb52018-02-12 14:17:49 -080085/**
86 * hdd_send_twt_enable_cmd() - Send TWT enable command to target
87 * @hdd_ctx: HDD Context
88 *
89 * Return: None
90 */
91void hdd_send_twt_enable_cmd(struct hdd_context *hdd_ctx);
92
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -070093/**
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -070094 * wlan_hdd_twt_init() - Initialize TWT
95 * @hdd_ctx: pointer to global HDD Context
96 *
97 * Initialize the TWT feature by registering the callbacks
98 * with the lower layers.
99 *
100 * Return: None
101 */
102void wlan_hdd_twt_init(struct hdd_context *hdd_ctx);
103
104/**
105 * wlan_hdd_twt_deinit() - Deinitialize TWT
106 * @hdd_ctx: pointer to global HDD Context
107 *
108 * Deinitialize the TWT feature by deregistering the
109 * callbacks with the lower layers.
110 *
111 * Return: None
112 */
113void wlan_hdd_twt_deinit(struct hdd_context *hdd_ctx);
114
Varun Reddy Yeturu96285a22018-05-08 13:37:43 -0700115#else
116static inline void hdd_twt_print_ini_config(struct hdd_context *hdd_ctx)
117{
118}
119
Varun Reddy Yeturue93d2462018-05-22 13:54:52 -0700120static inline void hdd_update_tgt_twt_cap(struct hdd_context *hdd_ctx,
121 struct wma_tgt_cfg *cfg)
122{
123}
124
Varun Reddy Yeturu1b4cbb52018-02-12 14:17:49 -0800125static inline void hdd_send_twt_enable_cmd(struct hdd_context *hdd_ctx)
126{
127}
128
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -0700129static inline void wlan_hdd_twt_init(struct hdd_context *hdd_ctx)
130{
131}
132
133static inline void wlan_hdd_twt_deinit(struct hdd_context *hdd_ctx)
134{
135}
136
Varun Reddy Yeturu96285a22018-05-08 13:37:43 -0700137#endif
138#endif /* if !defined(WLAN_HDD_TWT_H)*/