blob: 0d0f8659f9d0da598808916a92c955841f355dfc [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Jeff Johnson82797b62017-08-11 15:31:27 -07002 * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28#ifndef __WLAN_HDD_GREEN_AP_H
29#define __WLAN_HDD_GREEN_AP_H
30
31/**
32 * DOC: wlan_hdd_green_ap.h
33 *
34 * WLAN Host Device Driver Green AP API specification
35 */
36
Jeff Johnson82797b62017-08-11 15:31:27 -070037struct hdd_context;
Jeff Johnsona7e5eed2016-09-28 15:19:13 -070038struct wma_tgt_cfg;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080039
40#ifdef FEATURE_GREEN_AP
Jeff Johnsona7e5eed2016-09-28 15:19:13 -070041/**
42 * hdd_green_ap_init() - Initialize Green AP feature
43 * @hdd_ctx: HDD global context
44 *
45 * Return: none
46 */
Jeff Johnson82797b62017-08-11 15:31:27 -070047void hdd_green_ap_init(struct hdd_context *hdd_ctx);
Ryan Hsu3c8f79f2015-12-02 16:45:09 -080048
Jeff Johnsona7e5eed2016-09-28 15:19:13 -070049/**
50 * hdd_green_ap_deinit() - De-initialize Green AP feature
51 * @hdd_ctx: HDD global context
52 *
53 * Return: none
54 */
Jeff Johnson82797b62017-08-11 15:31:27 -070055void hdd_green_ap_deinit(struct hdd_context *hdd_ctx);
Jeff Johnsona7e5eed2016-09-28 15:19:13 -070056
57/**
58 * hdd_green_ap_start_bss() - Notify Green AP of Start BSS event
59 * @hdd_ctx: HDD global context
60 *
61 * Return: none
62 */
Jeff Johnson82797b62017-08-11 15:31:27 -070063void hdd_green_ap_start_bss(struct hdd_context *hdd_ctx);
Jeff Johnsona7e5eed2016-09-28 15:19:13 -070064
65/**
66 * hdd_green_ap_stop_bss() - Notify Green AP of Stop BSS event
67 * @hdd_ctx: HDD global context
68 *
69 * Return: none
70 */
Jeff Johnson82797b62017-08-11 15:31:27 -070071void hdd_green_ap_stop_bss(struct hdd_context *hdd_ctx);
Jeff Johnsona7e5eed2016-09-28 15:19:13 -070072
73/**
74 * hdd_green_ap_add_sta() - Notify Green AP of Add Station event
75 * @hdd_ctx: HDD global context
76 *
77 * Return: none
78 */
Jeff Johnson82797b62017-08-11 15:31:27 -070079void hdd_green_ap_add_sta(struct hdd_context *hdd_ctx);
Jeff Johnsona7e5eed2016-09-28 15:19:13 -070080
81/**
82 * hdd_green_ap_del_sta() - Notify Green AP of Delete Station event
83 * @hdd_ctx: HDD global context
84 *
85 * Return: none
86 */
Jeff Johnson82797b62017-08-11 15:31:27 -070087void hdd_green_ap_del_sta(struct hdd_context *hdd_ctx);
Jeff Johnsona7e5eed2016-09-28 15:19:13 -070088
89/**
bings612b9c42016-11-07 10:52:03 +080090 * hdd_enable_egap() - Enable Enhance Green AP
91 * @hdd_ctx: HDD global context
92 *
93 * Return: 0 on success, negative errno on failure
94 */
Jeff Johnson82797b62017-08-11 15:31:27 -070095int hdd_enable_egap(struct hdd_context *hdd_ctx);
bings612b9c42016-11-07 10:52:03 +080096
97/**
Jeff Johnsona7e5eed2016-09-28 15:19:13 -070098 * hdd_green_ap_target_config() - Handle Green AP target configuration
99 * @hdd_ctx: HDD global context where Green AP information is stored
100 * @target_config: Target configuration containing Green AP info
101 *
102 * This function updates the HDD context with Green AP-specific
103 * information provided by the target.
104 *
105 * Return: none
106 */
Jeff Johnson82797b62017-08-11 15:31:27 -0700107void hdd_green_ap_target_config(struct hdd_context *hdd_ctx,
Jeff Johnsona7e5eed2016-09-28 15:19:13 -0700108 struct wma_tgt_cfg *target_config);
109#else
Jeff Johnson82797b62017-08-11 15:31:27 -0700110static inline void hdd_green_ap_init(struct hdd_context *hdd_ctx) {}
111static inline void hdd_green_ap_deinit(struct hdd_context *hdd_ctx) {}
112static inline void hdd_green_ap_start_bss(struct hdd_context *hdd_ctx) {}
113static inline void hdd_green_ap_stop_bss(struct hdd_context *hdd_ctx) {}
114static inline void hdd_green_ap_add_sta(struct hdd_context *hdd_ctx) {}
115static inline void hdd_green_ap_del_sta(struct hdd_context *hdd_ctx) {}
116static inline int hdd_enable_egap(struct hdd_context *hdd_ctx)
bings612b9c42016-11-07 10:52:03 +0800117{
118 return -EINVAL;
119}
Jeff Johnson82797b62017-08-11 15:31:27 -0700120static inline void hdd_green_ap_target_config(struct hdd_context *hdd_ctx,
Jeff Johnsona7e5eed2016-09-28 15:19:13 -0700121 struct wma_tgt_cfg *target_config)
122{
123}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800124#endif /* FEATURE_GREEN_AP */
125#endif /* __WLAN_HDD_GREEN_AP_H */