blob: 2bae7fba0b72e6fca17ca8cd10c963ee23ce4b9d [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Ryan Hsue839f8f2016-01-08 09:57:17 -08002 * Copyright (c) 2014-2016 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 * DOC: wlan_hdd_green_ap.c
24 *
25 * WLAN Host Device Driver Green AP implementation
26 *
27 */
28
Jeff Johnson417af552015-11-09 15:15:01 -080029/* denote that this file does not allow legacy hddLog */
30#define HDD_DISALLOW_LEGACY_HDDLOG 1
31
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080032/* Include Files */
33#include <wlan_hdd_main.h>
34#include <wlan_hdd_misc.h>
35#include "wlan_hdd_green_ap.h"
36#include "wma_api.h"
37#include "cds_concurrency.h"
38
39#define GREEN_AP_PS_ON_TIME (0)
40#define GREEN_AP_PS_DELAY_TIME (20)
41
42/**
43 * enum hdd_green_ap_ps_state - Green-AP power save states
44 * @GREEN_AP_PS_IDLE_STATE: the Green_AP is not enabled
45 * @GREEN_AP_PS_OFF_STATE: in Power Saving OFF state
46 * @GREEN_AP_PS_WAIT_STATE: in transition to Power Saving ON state
47 * @GREEN_AP_PS_ON_STATE: in Power Saving ON state
48 */
49enum hdd_green_ap_ps_state {
50 GREEN_AP_PS_IDLE_STATE = 1,
51 GREEN_AP_PS_OFF_STATE,
52 GREEN_AP_PS_WAIT_STATE,
53 GREEN_AP_PS_ON_STATE,
54};
55
56/**
57 * enum hdd_green_ap_event - Green-AP power save events
58 * @GREEN_AP_PS_START_EVENT: event to indicate to enable Green_AP
59 * @GREEN_AP_PS_START_EVENT: event to indicate to disable Green_AP
60 * @GREEN_AP_ADD_STA_EVENT: event to indicate a new STA connected
61 * @GREEN_AP_DEL_STA_EVENT: event to indicate a STA disconnected
62 * @GREEN_AP_PS_ON_EVENT: event to indicate to enter Power Saving state
63 * @GREEN_AP_PS_WAIT_EVENT: event to indicate in the transition to Power Saving
64 */
65enum hdd_green_ap_event {
66 GREEN_AP_PS_START_EVENT = 1,
67 GREEN_AP_PS_STOP_EVENT,
68 GREEN_AP_ADD_STA_EVENT,
69 GREEN_AP_DEL_STA_EVENT,
70 GREEN_AP_PS_ON_EVENT,
71 GREEN_AP_PS_WAIT_EVENT,
72};
73
74/**
75 * struct hdd_green_ap_ctx - Green-AP context
76 * @ps_enable: Whether or not Green AP is enabled
77 * @ps_on_time: Amount of time to stay in Green AP power saving state
78 * @ps_delay_time: Amount of time to delay when changing states
79 * @num_nodes: Number of connected clients
80 * @ps_state: Current state
81 * @ps_event: Event to trigger when timer expires
82 * @ps_timer: Event timer
Ryan Hsu3c8f79f2015-12-02 16:45:09 -080083 * @egap_support: Enhanced Green AP support flag
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080084 */
85struct hdd_green_ap_ctx {
86 uint8_t ps_enable;
87 uint32_t ps_on_time;
88 uint32_t ps_delay_time;
89 uint32_t num_nodes;
90
91 enum hdd_green_ap_ps_state ps_state;
92 enum hdd_green_ap_event ps_event;
93
Anurag Chouhan210db072016-02-22 18:42:15 +053094 qdf_mc_timer_t ps_timer;
Ryan Hsu3c8f79f2015-12-02 16:45:09 -080095
96 bool egap_support;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080097};
98
99/**
100 * hdd_wlan_green_ap_update() - update the current State and Event
101 * @hdd_ctx: Global HDD context
102 * @state: New state
103 * @event: New event
104 *
105 * Return: none
106 */
107static void hdd_wlan_green_ap_update(struct hdd_context_s *hdd_ctx,
108 enum hdd_green_ap_ps_state state,
109 enum hdd_green_ap_event event)
110{
111 struct hdd_green_ap_ctx *green_ap = hdd_ctx->green_ap_ctx;
112
113 green_ap->ps_state = state;
114 green_ap->ps_event = event;
115}
116
117/**
118 * hdd_wlan_green_ap_enable() - Send Green AP configuration to firmware
119 * @adapter: Adapter upon which Green AP is being configured
120 * @enable: Flag which indicates if Green AP is being enabled or disabled
121 *
122 * Return: 0 upon success, non-zero upon failure
123 */
124static int hdd_wlan_green_ap_enable(hdd_adapter_t *adapter,
125 uint8_t enable)
126{
127 int ret;
128
Jeff Johnson417af552015-11-09 15:15:01 -0800129 hdd_notice("Set Green-AP val: %d", enable);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800130
131 ret = wma_cli_set_command(adapter->sessionId,
132 WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
133 enable, DBG_CMD);
134
135 return ret;
136}
137
138/**
139 * hdd_wlan_green_ap_mc() - Green AP state machine
140 * @hdd_ctx: HDD global context
141 * @event: New event being processed
142 *
143 * Return: none
144 */
145static void hdd_wlan_green_ap_mc(struct hdd_context_s *hdd_ctx,
146 enum hdd_green_ap_event event)
147{
148 struct hdd_green_ap_ctx *green_ap;
149 hdd_adapter_t *adapter;
150
151 green_ap = hdd_ctx->green_ap_ctx;
152 if (green_ap == NULL)
153 return;
154
Jeff Johnson417af552015-11-09 15:15:01 -0800155 hdd_notice("Green-AP event: %d, state: %d, num_nodes: %d",
156 event, green_ap->ps_state, green_ap->num_nodes);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800157
158 /* handle the green ap ps event */
159 switch (event) {
160 case GREEN_AP_PS_START_EVENT:
161 green_ap->ps_enable = 1;
162 break;
163
164 case GREEN_AP_PS_STOP_EVENT:
Anurag Chouhan6d760662016-02-20 16:05:43 +0530165 if (!(cds_get_concurrency_mode() & QDF_SAP_MASK))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800166 green_ap->ps_enable = 0;
167 break;
168
169 case GREEN_AP_ADD_STA_EVENT:
170 green_ap->num_nodes++;
171 break;
172
173 case GREEN_AP_DEL_STA_EVENT:
174 if (green_ap->num_nodes)
175 green_ap->num_nodes--;
176 break;
177
178 case GREEN_AP_PS_ON_EVENT:
179 case GREEN_AP_PS_WAIT_EVENT:
180 break;
181
182 default:
Jeff Johnson417af552015-11-09 15:15:01 -0800183 hdd_err("invalid event %d", event);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800184 break;
185 }
186
187 /* Confirm that power save is enabled before doing state transitions */
188 if (!green_ap->ps_enable) {
Jeff Johnson417af552015-11-09 15:15:01 -0800189 hdd_notice("Green-AP is disabled");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800190 hdd_wlan_green_ap_update(hdd_ctx,
191 GREEN_AP_PS_IDLE_STATE,
192 GREEN_AP_PS_WAIT_EVENT);
193 goto done;
194 }
195
Krunal Sonibe766b02016-03-10 13:00:44 -0800196 adapter = hdd_get_adapter(hdd_ctx, QDF_SAP_MODE);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800197 if (adapter == NULL) {
Jeff Johnson417af552015-11-09 15:15:01 -0800198 hdd_err("Green-AP no SAP adapter");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800199 goto done;
200 }
201
202 /* handle the green ap ps state */
203 switch (green_ap->ps_state) {
204 case GREEN_AP_PS_IDLE_STATE:
205 hdd_wlan_green_ap_update(hdd_ctx,
206 GREEN_AP_PS_OFF_STATE,
207 GREEN_AP_PS_WAIT_EVENT);
208 break;
209
210 case GREEN_AP_PS_OFF_STATE:
211 if (!green_ap->num_nodes) {
212 hdd_wlan_green_ap_update(hdd_ctx,
213 GREEN_AP_PS_WAIT_STATE,
214 GREEN_AP_PS_WAIT_EVENT);
Anurag Chouhan210db072016-02-22 18:42:15 +0530215 qdf_mc_timer_start(&green_ap->ps_timer,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800216 green_ap->ps_delay_time);
217 }
218 break;
219
220 case GREEN_AP_PS_WAIT_STATE:
221 if (!green_ap->num_nodes) {
222 hdd_wlan_green_ap_update(hdd_ctx,
223 GREEN_AP_PS_ON_STATE,
224 GREEN_AP_PS_WAIT_EVENT);
225
226 hdd_wlan_green_ap_enable(adapter, 1);
227
228 if (green_ap->ps_on_time) {
229 hdd_wlan_green_ap_update(hdd_ctx,
230 0,
231 GREEN_AP_PS_WAIT_EVENT);
Anurag Chouhan210db072016-02-22 18:42:15 +0530232 qdf_mc_timer_start(&green_ap->ps_timer,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800233 green_ap->ps_on_time);
234 }
235 } else {
236 hdd_wlan_green_ap_update(hdd_ctx,
237 GREEN_AP_PS_OFF_STATE,
238 GREEN_AP_PS_WAIT_EVENT);
239 }
240 break;
241
242 case GREEN_AP_PS_ON_STATE:
243 if (green_ap->num_nodes) {
244 if (hdd_wlan_green_ap_enable(adapter, 0)) {
Jeff Johnson417af552015-11-09 15:15:01 -0800245 hdd_err("FAILED TO SET GREEN-AP mode");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800246 goto done;
247 }
248 hdd_wlan_green_ap_update(hdd_ctx,
249 GREEN_AP_PS_OFF_STATE,
250 GREEN_AP_PS_WAIT_EVENT);
251 } else if ((green_ap->ps_event == GREEN_AP_PS_WAIT_EVENT)
252 && (green_ap->ps_on_time)) {
253
254 /* ps_on_time timeout, switch to ps off */
255 hdd_wlan_green_ap_update(hdd_ctx,
256 GREEN_AP_PS_WAIT_STATE,
257 GREEN_AP_PS_ON_EVENT);
258
259 if (hdd_wlan_green_ap_enable(adapter, 0)) {
Jeff Johnson417af552015-11-09 15:15:01 -0800260 hdd_err("FAILED TO SET GREEN-AP mode");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800261 goto done;
262 }
263
Anurag Chouhan210db072016-02-22 18:42:15 +0530264 qdf_mc_timer_start(&green_ap->ps_timer,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800265 green_ap->ps_delay_time);
266 }
267 break;
268
269 default:
Jeff Johnson417af552015-11-09 15:15:01 -0800270 hdd_err("invalid state %d", green_ap->ps_state);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800271 hdd_wlan_green_ap_update(hdd_ctx, GREEN_AP_PS_OFF_STATE,
272 GREEN_AP_PS_WAIT_EVENT);
273 break;
274 }
275
276done:
277 return;
278}
279
280/**
281 * hdd_wlan_green_ap_timer_fn() - Green AP Timer handler
282 * @ctx: Global HDD context
283 *
284 * Return: none
285 */
286static void hdd_wlan_green_ap_timer_fn(void *ctx)
287{
288 struct hdd_context_s *hdd_ctx = ctx;
289 struct hdd_green_ap_ctx *green_ap;
290
Abhishek Singh23edd1c2016-05-05 11:56:06 +0530291 if (wlan_hdd_validate_context(hdd_ctx))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800292 return;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800293
294 green_ap = hdd_ctx->green_ap_ctx;
295 if (green_ap)
296 hdd_wlan_green_ap_mc(hdd_ctx, green_ap->ps_event);
297}
298
299/**
300 * hdd_wlan_green_ap_attach() - Attach Green AP context to HDD context
301 * @hdd_ctx: Global HDD contect
302 *
Anurag Chouhanf04e84f2016-03-03 10:12:12 +0530303 * Return: QDF_STATUS_SUCCESS on success, otherwise QDF_STATUS_E_** error
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800304 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530305static QDF_STATUS hdd_wlan_green_ap_attach(struct hdd_context_s *hdd_ctx)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800306{
307 struct hdd_green_ap_ctx *green_ap;
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530308 QDF_STATUS status = QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800309
310 ENTER();
311
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530312 green_ap = qdf_mem_malloc(sizeof(*green_ap));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800313 if (!green_ap) {
Jeff Johnson417af552015-11-09 15:15:01 -0800314 hdd_alert("Memory allocation for Green-AP failed!");
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530315 status = QDF_STATUS_E_NOMEM;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800316 goto error;
317 }
318
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530319 qdf_mem_zero(green_ap, sizeof(*green_ap));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800320 green_ap->ps_state = GREEN_AP_PS_OFF_STATE;
321 green_ap->ps_event = 0;
322 green_ap->num_nodes = 0;
323 green_ap->ps_on_time = GREEN_AP_PS_ON_TIME;
324 green_ap->ps_delay_time = GREEN_AP_PS_DELAY_TIME;
325
Anurag Chouhan210db072016-02-22 18:42:15 +0530326 qdf_mc_timer_init(&green_ap->ps_timer,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530327 QDF_TIMER_TYPE_SW,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800328 hdd_wlan_green_ap_timer_fn, hdd_ctx);
329
330error:
331 hdd_ctx->green_ap_ctx = green_ap;
332
333 EXIT();
334 return status;
335}
336
337/**
338 * hdd_wlan_green_ap_deattach() - Detach Green AP context from HDD context
339 * @hdd_ctx: Global HDD contect
340 *
Anurag Chouhanf04e84f2016-03-03 10:12:12 +0530341 * Return: QDF_STATUS_SUCCESS on success, otherwise QDF_STATUS_E_** error
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800342 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530343static QDF_STATUS hdd_wlan_green_ap_deattach(struct hdd_context_s *hdd_ctx)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800344{
345 struct hdd_green_ap_ctx *green_ap = hdd_ctx->green_ap_ctx;
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530346 QDF_STATUS status = QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800347
348 ENTER();
349
350 if (green_ap == NULL) {
Jeff Johnson417af552015-11-09 15:15:01 -0800351 hdd_notice("Green-AP is not enabled");
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530352 status = QDF_STATUS_E_NOSUPPORT;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800353 goto done;
354 }
355
356 /* check if the timer status is destroyed */
Anurag Chouhan210db072016-02-22 18:42:15 +0530357 if (QDF_TIMER_STATE_RUNNING ==
358 qdf_mc_timer_get_current_state(&green_ap->ps_timer))
359 qdf_mc_timer_stop(&green_ap->ps_timer);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800360
361 /* Destroy the Green AP timer */
Anurag Chouhan210db072016-02-22 18:42:15 +0530362 if (!QDF_IS_STATUS_SUCCESS(qdf_mc_timer_destroy(&green_ap->ps_timer)))
Jeff Johnson417af552015-11-09 15:15:01 -0800363 hdd_notice("Cannot deallocate Green-AP's timer");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800364
365 /* release memory */
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530366 qdf_mem_zero(green_ap, sizeof(*green_ap));
367 qdf_mem_free(green_ap);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800368 hdd_ctx->green_ap_ctx = NULL;
369
370done:
371
372 EXIT();
373 return status;
374}
375
376/**
377 * hdd_wlan_green_ap_init() - Initialize Green AP feature
378 * @hdd_ctx: HDD global context
379 *
380 * Return: none
381 */
382void hdd_wlan_green_ap_init(struct hdd_context_s *hdd_ctx)
383{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530384 if (!QDF_IS_STATUS_SUCCESS(hdd_wlan_green_ap_attach(hdd_ctx)))
Jeff Johnson417af552015-11-09 15:15:01 -0800385 hdd_err("Failed to allocate Green-AP resource");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800386}
387
388/**
389 * hdd_wlan_green_ap_deinit() - De-initialize Green AP feature
390 * @hdd_ctx: HDD global context
391 *
392 * Return: none
393 */
394void hdd_wlan_green_ap_deinit(struct hdd_context_s *hdd_ctx)
395{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530396 if (!QDF_IS_STATUS_SUCCESS(hdd_wlan_green_ap_deattach(hdd_ctx)))
Jeff Johnson417af552015-11-09 15:15:01 -0800397 hdd_err("Cannot deallocate Green-AP resource");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800398}
399
400/**
401 * hdd_wlan_green_ap_start_bss() - Notify Green AP of Start BSS event
402 * @hdd_ctx: HDD global context
403 *
404 * Return: none
405 */
406void hdd_wlan_green_ap_start_bss(struct hdd_context_s *hdd_ctx)
407{
408 struct hdd_config *cfg = hdd_ctx->config;
409
Ryan Hsucb118cf2015-11-09 16:03:53 -0800410 /* check if the firmware and ini are both enabled the egap,
411 * and also the feature_flag enable, then we enable the egap
412 */
413 if (hdd_ctx->green_ap_ctx->egap_support && cfg->enable_egap &&
414 cfg->egap_feature_flag) {
Ryan Hsue839f8f2016-01-08 09:57:17 -0800415 hdd_notice("Set EGAP - enabled: %d, flag: %x, inact_time: %d, wait_time: %d",
416 cfg->enable_egap, cfg->egap_feature_flag,
417 cfg->egap_inact_time, cfg->egap_wait_time);
Ryan Hsucb118cf2015-11-09 16:03:53 -0800418 if (!sme_send_egap_conf_params(cfg->enable_egap,
419 cfg->egap_inact_time,
420 cfg->egap_wait_time,
421 cfg->egap_feature_flag)) {
422 /* EGAP is enabled, disable host GAP */
423 hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_PS_STOP_EVENT);
424 goto exit;
425 }
426 /* fall through, if send_egap_conf_params() failed,
427 * then check host GAP and enable it accordingly
428 */
429 }
430
Anurag Chouhan6d760662016-02-20 16:05:43 +0530431 if (!(QDF_STA_MASK & hdd_ctx->concurrency_mode) &&
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800432 cfg->enable2x2 && cfg->enableGreenAP) {
433 hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_PS_START_EVENT);
434 } else {
435 hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_PS_STOP_EVENT);
Jeff Johnson417af552015-11-09 15:15:01 -0800436 hdd_notice("Green-AP: is disabled, due to sta_concurrency: %d, enable2x2: %d, enableGreenAP: %d",
Anurag Chouhan6d760662016-02-20 16:05:43 +0530437 QDF_STA_MASK & hdd_ctx->concurrency_mode,
Jeff Johnson417af552015-11-09 15:15:01 -0800438 cfg->enable2x2, cfg->enableGreenAP);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800439 }
Ryan Hsucb118cf2015-11-09 16:03:53 -0800440exit:
441 return;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800442}
443
444/**
445 * hdd_wlan_green_ap_stop_bss() - Notify Green AP of Stop BSS event
446 * @hdd_ctx: HDD global context
447 *
448 * Return: none
449 */
450void hdd_wlan_green_ap_stop_bss(struct hdd_context_s *hdd_ctx)
451{
452 hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_PS_STOP_EVENT);
453}
454
455/**
456 * hdd_wlan_green_ap_add_sta() - Notify Green AP of Add Station event
457 * @hdd_ctx: HDD global context
458 *
459 * Return: none
460 */
461void hdd_wlan_green_ap_add_sta(struct hdd_context_s *hdd_ctx)
462{
463 hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_ADD_STA_EVENT);
464}
465
466/**
467 * hdd_wlan_green_ap_del_sta() - Notify Green AP of Delete Station event
468 * @hdd_ctx: HDD global context
469 *
470 * Return: none
471 */
472void hdd_wlan_green_ap_del_sta(struct hdd_context_s *hdd_ctx)
473{
474 hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_DEL_STA_EVENT);
475}
Ryan Hsu3c8f79f2015-12-02 16:45:09 -0800476
477/**
478 * hdd_wlan_set_egap_support() - helper function to set egap support flag
479 * @hdd_ctx: pointer to hdd context
480 * @param: pointer to target configuration
481 *
482 * Return: None
483 */
484void hdd_wlan_set_egap_support(hdd_context_t *hdd_ctx, void *param)
485{
486 struct wma_tgt_cfg *cfg = (struct wma_tgt_cfg *) param;
487
488 if (hdd_ctx && cfg)
489 hdd_ctx->green_ap_ctx->egap_support = cfg->egap_support;
490}