Varun Reddy Yeturu | 96285a2 | 2018-05-08 13:37:43 -0700 | [diff] [blame] | 1 | /* |
| 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 Yeturu | 3c9f89c | 2018-04-18 19:10:34 -0700 | [diff] [blame] | 29 | #include "qdf_types.h" |
| 30 | #include "qdf_status.h" |
| 31 | |
Varun Reddy Yeturu | 96285a2 | 2018-05-08 13:37:43 -0700 | [diff] [blame] | 32 | struct hdd_context; |
Varun Reddy Yeturu | e93d246 | 2018-05-22 13:54:52 -0700 | [diff] [blame] | 33 | struct wma_tgt_cfg; |
Varun Reddy Yeturu | 3c9f89c | 2018-04-18 19:10:34 -0700 | [diff] [blame] | 34 | struct wmi_twt_enable_complete_event_param; |
Varun Reddy Yeturu | 96285a2 | 2018-05-08 13:37:43 -0700 | [diff] [blame] | 35 | |
Varun Reddy Yeturu | d33033f | 2018-06-11 10:58:30 -0700 | [diff] [blame] | 36 | #ifdef WLAN_SUPPORT_TWT |
Varun Reddy Yeturu | 96285a2 | 2018-05-08 13:37:43 -0700 | [diff] [blame] | 37 | /** |
Varun Reddy Yeturu | 3c9f89c | 2018-04-18 19:10:34 -0700 | [diff] [blame] | 38 | * 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 | */ |
| 52 | enum 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 Yeturu | 96285a2 | 2018-05-08 13:37:43 -0700 | [diff] [blame] | 68 | * hdd_twt_print_ini_config() - Print TWT INI config items |
| 69 | * @hdd_ctx: HDD Context |
| 70 | * |
| 71 | * Return: None |
| 72 | */ |
| 73 | void hdd_twt_print_ini_config(struct hdd_context *hdd_ctx); |
| 74 | |
Varun Reddy Yeturu | e93d246 | 2018-05-22 13:54:52 -0700 | [diff] [blame] | 75 | /** |
| 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 | */ |
| 82 | void hdd_update_tgt_twt_cap(struct hdd_context *hdd_ctx, |
| 83 | struct wma_tgt_cfg *cfg); |
| 84 | |
Varun Reddy Yeturu | 1b4cbb5 | 2018-02-12 14:17:49 -0800 | [diff] [blame] | 85 | /** |
| 86 | * hdd_send_twt_enable_cmd() - Send TWT enable command to target |
| 87 | * @hdd_ctx: HDD Context |
| 88 | * |
| 89 | * Return: None |
| 90 | */ |
| 91 | void hdd_send_twt_enable_cmd(struct hdd_context *hdd_ctx); |
| 92 | |
Varun Reddy Yeturu | 3c9f89c | 2018-04-18 19:10:34 -0700 | [diff] [blame] | 93 | /** |
Varun Reddy Yeturu | 3c9f89c | 2018-04-18 19:10:34 -0700 | [diff] [blame] | 94 | * 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 | */ |
| 102 | void 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 | */ |
| 113 | void wlan_hdd_twt_deinit(struct hdd_context *hdd_ctx); |
| 114 | |
Varun Reddy Yeturu | 96285a2 | 2018-05-08 13:37:43 -0700 | [diff] [blame] | 115 | #else |
| 116 | static inline void hdd_twt_print_ini_config(struct hdd_context *hdd_ctx) |
| 117 | { |
| 118 | } |
| 119 | |
Varun Reddy Yeturu | e93d246 | 2018-05-22 13:54:52 -0700 | [diff] [blame] | 120 | static inline void hdd_update_tgt_twt_cap(struct hdd_context *hdd_ctx, |
| 121 | struct wma_tgt_cfg *cfg) |
| 122 | { |
| 123 | } |
| 124 | |
Varun Reddy Yeturu | 1b4cbb5 | 2018-02-12 14:17:49 -0800 | [diff] [blame] | 125 | static inline void hdd_send_twt_enable_cmd(struct hdd_context *hdd_ctx) |
| 126 | { |
| 127 | } |
| 128 | |
Varun Reddy Yeturu | 3c9f89c | 2018-04-18 19:10:34 -0700 | [diff] [blame] | 129 | static inline void wlan_hdd_twt_init(struct hdd_context *hdd_ctx) |
| 130 | { |
| 131 | } |
| 132 | |
| 133 | static inline void wlan_hdd_twt_deinit(struct hdd_context *hdd_ctx) |
| 134 | { |
| 135 | } |
| 136 | |
Varun Reddy Yeturu | 96285a2 | 2018-05-08 13:37:43 -0700 | [diff] [blame] | 137 | #endif |
| 138 | #endif /* if !defined(WLAN_HDD_TWT_H)*/ |