hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
/******************************************************************************
 *
 * Copyright(c) 2019 Realtek Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 *****************************************************************************/
#define _HAL_WOW_C_
#include "hal_headers.h"
 
#ifdef CONFIG_WOWLAN
 
#define MAX_POLLING_WOW_FW_STS_CNT 1000 /* 50ms */
 
static enum rtw_hal_status _hal_check_wow_fw_ready(void *hal, u8 func_en)
{
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
   enum rtw_hal_status hstats = RTW_HAL_STATUS_FAILURE;
   void* drv_priv = hal_to_drvpriv(hal_info);
   u8 fw_status = 0;
   u32 poll_cnt = 0;
 
   PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] %s : start polling... (func_en %d)\n", __func__, func_en);
 
   /* polling fw status */
   while (1) {
 
       if (poll_cnt >= MAX_POLLING_WOW_FW_STS_CNT) {
           PHL_ERR("%s polling fw status timeout !!!\n", __func__);
           hstats = RTW_HAL_STATUS_FAILURE;
           break;
       }
 
       hstats = rtw_hal_mac_get_wow_fw_status(hal_info, &fw_status,
                           func_en);
 
       if (RTW_HAL_STATUS_SUCCESS != hstats) {
 
           PHL_ERR("%s : status %u\n", __func__, fw_status);
           break;
       }
 
       if (fw_status) {
           hstats = RTW_HAL_STATUS_SUCCESS;
 
           PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_,
               "%s : polling count %u\n", __func__, poll_cnt);
           break;
       } else {
 
           _os_delay_us(drv_priv, 50);
 
       }
       poll_cnt++;
 
   }
 
   PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] %s : finish polling... (func_en %d)\n", __func__, func_en);
 
   return hstats;
}
 
enum rtw_hal_status rtw_hal_get_wake_rsn(void *hal, enum rtw_mac_wow_wake_reason *wake_rsn, u8 *reset)
{
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
   enum rtw_hal_status hstats = RTW_HAL_STATUS_FAILURE;
   u8 mac_rsn = 0;
 
   hstats = rtw_hal_mac_get_wake_rsn(hal_info, &mac_rsn, reset);
   PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "%s : wake rsn from mac in hex 0x%x (reset %d).\n",
               __func__, mac_rsn, *reset);
 
   if (RTW_HAL_STATUS_SUCCESS != hstats)
       PHL_ERR("%s : rtw_hal_mac_get_wake_rsn failed.\n", __func__);
   else
       *wake_rsn = mac_rsn;
 
   return hstats;
}
 
enum rtw_hal_status rtw_hal_cfg_wow_sleep(void *hal, u8 sleep)
{
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
   enum rtw_hal_status hstats = RTW_HAL_STATUS_FAILURE;
 
   hstats = rtw_hal_mac_cfg_wow_sleep(hal_info, sleep);
 
   if (RTW_HAL_STATUS_SUCCESS != hstats)
       PHL_ERR("%s : sleep %u\n", __func__, sleep);
 
   return hstats;
}
 
enum rtw_hal_status rtw_hal_get_wow_aoac_rpt(void *hal, struct rtw_aoac_report *aoac_info, u8 rx_ready)
{
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
   enum rtw_hal_status hstatus = RTW_HAL_STATUS_FAILURE;
 
   FUNCIN();
 
   /* get aoac report */
   hstatus = rtw_hal_mac_get_aoac_rpt(hal_info, aoac_info, rx_ready);
 
   if (RTW_HAL_STATUS_SUCCESS != hstatus)
       PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] %s(): failed with status(%u)\n", __func__, hstatus);
 
   FUNCOUT();
 
   return hstatus;
}
 
enum rtw_hal_status rtw_hal_wow_cfg_txdma(void *hal, u8 state)
{
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
 
   PHL_TRACE(COMP_PHL_DBG, _PHL_DEBUG_, "%s : state %d.\n", __func__, state);
 
   rtw_hal_mac_cfg_txdma(hal_info, state);
 
   return RTW_HAL_STATUS_SUCCESS;
}
 
enum rtw_hal_status
rtw_hal_wow_cfg_nlo(void *hal, enum SCAN_OFLD_OP op, u16 mac_id,
                    u8 hw_band, u8 hw_port, struct rtw_nlo_info *cfg)
{
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
   enum rtw_hal_status hstatus = RTW_HAL_STATUS_FAILURE;
   struct scan_ofld_info info = {0};
   u64 tsf;
   u32 tsf_h = 0, tsf_l = 0;
 
   info.operation = op;
 
   if (op == SCAN_OFLD_OP_RPT || op == SCAN_OFLD_OP_STOP)
       goto end;
 
   if (cfg->delay != 0) {
       hstatus = rtw_hal_mac_get_tsf(hal, hw_band, hw_port, &tsf_h, &tsf_l);
       if (hstatus == RTW_HAL_STATUS_SUCCESS) {
           tsf = ((u64)tsf_h << 32) | tsf_l;
           tsf += cfg->delay * 1000;
           tsf_h = tsf >> 32;
           tsf_l = (u32)tsf;
           info.tsf_high = tsf_h;
           info.tsf_low = tsf_l;
       } else {
           PHL_WARN("%s Getting TSF failed \n", __func__);
       }
 
   }
   /* configure scan offload */
   info.period = cfg->period;
   info.slow_period = cfg->slow_period;
   info.cycle = cfg->cycle;
 
   if (info.period == 0 && info.slow_period == 0) {
       info.mode = SCAN_OFLD_MD_ONCE;
   } else if (info.period == 0) {
       info.mode = SCAN_OFLD_MD_SEEMLESS;
   } else if (info.slow_period == 0) {
       info.mode = SCAN_OFLD_MD_PD;
   } else {
       info.mode = SCAN_OFLD_MD_PD_SLOW;
   }
 
end:
 
   hstatus = rtw_hal_mac_scan_ofld(hal_info, (u8)mac_id,
               hw_band, hw_port, &info);
 
   if (hstatus != RTW_HAL_STATUS_SUCCESS)
       return hstatus;
 
   return hstatus;
}
 
enum rtw_hal_status
rtw_hal_wow_cfg_nlo_chnl_list(void *hal, struct rtw_nlo_info *cfg)
{
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
   enum rtw_hal_status hstatus = RTW_HAL_STATUS_FAILURE;
   u8 i = 0;
 
   if (cfg->channel_num == 0)
       return RTW_HAL_STATUS_FAILURE;
 
   for (i = 0; i < cfg->channel_num; i++) {
       /* set channel to mac */
       cfg->channel_list[i].probe_req_id = cfg->probe_req_id;
       hstatus = rtw_hal_mac_scan_ofld_add_ch(hal_info, HW_BAND_0,
                       &cfg->channel_list[i],
                       i == (cfg->channel_num-1) ? true : false);
       if (hstatus != RTW_HAL_STATUS_SUCCESS)
           return hstatus;
   }
 
   return hstatus;
}
 
enum rtw_hal_status rtw_hal_wow_init(struct rtw_phl_com_t *phl_com, void *hal,
                                     struct rtw_phl_stainfo_t *sta)
{
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
   enum rtw_hal_status hal_status = RTW_HAL_STATUS_FAILURE;
   struct hal_ops_t *hal_ops = hal_get_ops(hal_info);
 
   FUNCIN_WSTS(hal_status);
 
   /* download wowlan fw and do related tasks needed after redownload fw */
   hal_status = hal_ops->hal_wow_init(phl_com, hal_info, sta);
   if (hal_status != RTW_HAL_STATUS_SUCCESS)
       return hal_status;
 
   PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "%s successfully done.\n", __func__);
 
   FUNCOUT_WSTS(hal_status);
 
   return hal_status;
}
 
enum rtw_hal_status rtw_hal_wow_deinit(struct rtw_phl_com_t *phl_com, void *hal,
                                       struct rtw_phl_stainfo_t *sta)
{
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
   enum rtw_hal_status hal_status = RTW_HAL_STATUS_FAILURE;
   struct hal_ops_t *hal_ops = hal_get_ops(hal_info);
 
   FUNCIN_WSTS(hal_status);
 
   /* download wowlan fw and do related tasks needed after redownload fw */
   hal_status = hal_ops->hal_wow_deinit(phl_com, hal_info, sta);
   if (hal_status != RTW_HAL_STATUS_SUCCESS)
       return hal_status;
 
   PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "%s successfully done.\n", __func__);
 
   FUNCOUT_WSTS(hal_status);
 
   return hal_status;
}
 
enum rtw_hal_status
rtw_hal_wow_func_en(struct rtw_phl_com_t *phl_com, void *hal, u16 macid,
                    struct rtw_hal_wow_cfg *cfg)
{
 
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
   enum rtw_hal_status hstatus = RTW_HAL_STATUS_FAILURE;
 
   FUNCIN();
 
   do {
       /* config wow cam : pattern match */
#ifndef RTW_WKARD_WOW_SKIP_WOW_CAM_CONFIG
       hstatus = rtw_hal_mac_cfg_wow_cam(hal_info, macid, true,
                                         cfg->pattern_match_info);
       if (RTW_HAL_STATUS_SUCCESS != hstatus)
           break;
#endif
       /* gtk offload */
       if (cfg->gtk_ofld_cfg->gtk_en) {
           hstatus = rtw_hal_mac_cfg_gtk_ofld(hal_info, macid, true,
                                              cfg->gtk_ofld_cfg);
           if (RTW_HAL_STATUS_SUCCESS != hstatus)
               break;
       }
       /* arp offload */
       if (cfg->arp_ofld_cfg->arp_en) {
           hstatus = rtw_hal_mac_cfg_arp_ofld(hal_info, macid, true,
                                              cfg->arp_ofld_cfg);
           if (RTW_HAL_STATUS_SUCCESS != hstatus)
               break;
       }
       /* ndp offload */
       if (cfg->ndp_ofld_cfg->ndp_en) {
           hstatus = rtw_hal_mac_cfg_ndp_ofld(hal_info, macid, true,
                                              cfg->ndp_ofld_cfg);
           if (RTW_HAL_STATUS_SUCCESS != hstatus)
               break;
       }
       /* config keep alive */
       if (cfg->keep_alive_cfg->keep_alive_en) {
           hstatus = rtw_hal_mac_cfg_keep_alive(hal_info, macid, true,
                                                cfg->keep_alive_cfg);
           if (RTW_HAL_STATUS_SUCCESS != hstatus)
               break;
       }
       /* config disconnect detection */
       if (cfg->disc_det_cfg->disc_det_en) {
           hstatus = rtw_hal_mac_cfg_disc_dec(hal_info, macid, true,
                                              cfg->disc_det_cfg);
           if (RTW_HAL_STATUS_SUCCESS != hstatus)
               break;
       }
       /* realwow offload */
       if (cfg->realwow_cfg->realwow_en) {
           hstatus = rtw_hal_mac_cfg_realwow(hal_info, macid, true,
                                             cfg->realwow_cfg);
           if (RTW_HAL_STATUS_SUCCESS != hstatus)
               break;
       }
       /* config gpio */
       if (cfg->wow_gpio->d2h_gpio_info.dev2hst_gpio_en) {
           hstatus = rtw_hal_mac_cfg_dev2hst_gpio(hal_info, true, cfg->wow_gpio);
           if (RTW_HAL_STATUS_SUCCESS != hstatus)
               break;
       }
       /* network list offload */
       if (cfg->nlo_cfg->nlo_en) {
           hstatus = rtw_hal_mac_cfg_nlo(hal_info, macid, true, cfg->nlo_cfg);
           if (RTW_HAL_STATUS_SUCCESS != hstatus)
               break;
       }
 
       /* config period wake */
       if (cfg->periodic_wake_cfg->periodic_wake_en) {
           hstatus = rtw_hal_mac_cfg_periodic_wake(hal_info, macid, true,
                               cfg->periodic_wake_cfg);
           if (RTW_HAL_STATUS_SUCCESS != hstatus)
               break;
       }
   } while(0);
 
   PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] %s status(%u).\n", __func__, hstatus);
 
   FUNCOUT();
 
   return hstatus;
}
 
enum rtw_hal_status
rtw_hal_wow_func_dis(struct rtw_phl_com_t *phl_com, void *hal, u16 macid,
                     struct rtw_hal_wow_cfg *cfg)
{
 
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
   enum rtw_hal_status hstatus = RTW_HAL_STATUS_FAILURE;
 
   FUNCIN();
 
   /* cancel pattern match */
#ifndef RTW_WKARD_WOW_SKIP_WOW_CAM_CONFIG
   hstatus = rtw_hal_mac_cfg_wow_cam(hal_info, macid, false, NULL);
   if (RTW_HAL_STATUS_SUCCESS != hstatus)
       PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] rtw_hal_mac_cfg_wow_cam failed \n");
#endif
   /* cancel gtk offload */
   if (cfg->gtk_ofld_cfg->gtk_en) {
       hstatus = rtw_hal_mac_cfg_gtk_ofld(hal_info, macid, false, NULL);
       if (RTW_HAL_STATUS_SUCCESS != hstatus)
           PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] rtw_hal_mac_cfg_gtk_ofld failed \n");
   }
   /* cancel arp offload */
   if (cfg->arp_ofld_cfg->arp_en) {
       hstatus = rtw_hal_mac_cfg_arp_ofld(hal_info, macid, false, NULL);
       if (RTW_HAL_STATUS_SUCCESS != hstatus)
           PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] rtw_hal_mac_cfg_arp_ofld failed \n");
   }
   /* cancel ndp offload */
   if (cfg->ndp_ofld_cfg->ndp_en) {
       hstatus = rtw_hal_mac_cfg_ndp_ofld(hal_info, macid, false, NULL);
       if (RTW_HAL_STATUS_SUCCESS != hstatus)
           PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] rtw_hal_mac_cfg_ndp_ofld failed \n");
   }
   /* disable keep alive */
   if (cfg->keep_alive_cfg->keep_alive_en) {
       hstatus = rtw_hal_mac_cfg_keep_alive(hal_info, macid, false, NULL);
       if (RTW_HAL_STATUS_SUCCESS != hstatus)
           PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] rtw_hal_mac_cfg_keep_alive failed \n");
   }
   /* disable disconect detection */
   if (cfg->disc_det_cfg->disc_det_en) {
       hstatus = rtw_hal_mac_cfg_disc_dec(hal_info, macid, false, NULL);
       if (RTW_HAL_STATUS_SUCCESS != hstatus)
           PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] rtw_hal_mac_cfg_disc_dec failed \n");
   }
   /* realwow offload */
   if (cfg->realwow_cfg->realwow_en) {
       hstatus = rtw_hal_mac_cfg_realwow(hal_info, macid, false, NULL);
       if (RTW_HAL_STATUS_SUCCESS != hstatus)
           PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] rtw_hal_mac_cfg_realwow_ofld failed \n");
   }
   /* config gpio */
   if (cfg->wow_gpio->d2h_gpio_info.dev2hst_gpio_en) {
       hstatus = rtw_hal_mac_cfg_dev2hst_gpio(hal_info, false, NULL);
       if (RTW_HAL_STATUS_SUCCESS != hstatus)
           PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] rtw_hal_mac_cfg_dev2hst_gpio failed \n");
   }
   /* nlo */
   if (cfg->nlo_cfg->nlo_en) {
       hstatus = rtw_hal_mac_cfg_nlo(hal_info, macid, false, NULL);
       if (RTW_HAL_STATUS_SUCCESS != hstatus)
           PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] rtw_hal_mac_cfg_nlo failed \n");
   }
   /* config period wake */
   if (cfg->periodic_wake_cfg->periodic_wake_en) {
       hstatus = rtw_hal_mac_cfg_periodic_wake(hal_info, macid, false, NULL);
       if (RTW_HAL_STATUS_SUCCESS != hstatus)
           PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] rtw_hal_mac_cfg_periodic_wake failed \n");
   }
   PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] %s status(%u).\n", __func__, hstatus);
 
   FUNCOUT();
 
   return RTW_HAL_STATUS_SUCCESS;
}
 
enum rtw_hal_status rtw_hal_wow_func_start(struct rtw_phl_com_t *phl_com, void *hal, u16 macid, struct rtw_hal_wow_cfg *cfg)
{
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
   enum rtw_hal_status hstatus = RTW_HAL_STATUS_FAILURE;
 
   do {
       hstatus = rtw_hal_mac_cfg_wow_wake(hal_info, macid, true, cfg->wow_wake_cfg);
       if (RTW_HAL_STATUS_SUCCESS != hstatus)
           break;
       /* poll fw status */
       hstatus = _hal_check_wow_fw_ready(hal_info, 1);
       if (RTW_HAL_STATUS_SUCCESS != hstatus)
           break;
   } while(0);
 
   PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] %s status(%u).\n", __func__, hstatus);
 
   return hstatus;
}
 
enum rtw_hal_status rtw_hal_wow_func_stop(struct rtw_phl_com_t *phl_com, void *hal, u16 macid)
{
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
   enum rtw_hal_status hstatus = RTW_HAL_STATUS_FAILURE;
 
   /* config wow ctrl */
   hstatus = rtw_hal_mac_cfg_wow_wake(hal_info, macid, false, NULL);
   if (RTW_HAL_STATUS_SUCCESS != hstatus)
       PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] rtw_hal_mac_cfg_wow_wake failed \n");
 
   hstatus = _hal_check_wow_fw_ready(hal_info, 0);
   if (RTW_HAL_STATUS_SUCCESS != hstatus)
       PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] _hal_poll_wow_fw_status failed \n");
 
   PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] %s status(%u).\n", __func__, hstatus);
 
   return hstatus;
}
 
enum rtw_hal_status rtw_hal_set_wowlan(struct rtw_phl_com_t *phl_com, void *hal, u8 enter)
{
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
   enum rtw_hal_status hal_status = RTW_HAL_STATUS_FAILURE;
   hal_status = rtw_hal_mac_set_wowlan(hal_info, enter);
 
   PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "%s : status(%u).\n", __func__, hal_status);
 
   return hal_status;
}
 
static enum rtw_hal_status _wow_chk_txq_empty(struct hal_info_t *hal_info, u8 *empty)
{
   enum rtw_hal_status hal_status = RTW_HAL_STATUS_FAILURE;
 
   hal_status = rtw_hal_mac_wow_chk_txq_empty(hal_info, empty);
 
   PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "%s : status(%u).\n", __func__, hal_status);
 
   return hal_status;
}
 
static enum rtw_hal_status _wow_wde_drop(struct hal_info_t *hal_info, u8 band)
{
   enum rtw_hal_status hal_status = RTW_HAL_STATUS_FAILURE;
 
   hal_status = rtw_hal_mac_wow_wde_drop(hal_info, band);
 
   PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "%s : status(%u).\n", __func__, hal_status);
 
   return hal_status;
}
 
#define MAX_WOW_DROP_HWTX_TRYCNT 3
enum rtw_hal_status rtw_hal_wow_drop_tx(void *hal, u8 band)
{
   enum rtw_hal_status hal_status = RTW_HAL_STATUS_FAILURE;
   struct hal_info_t *hal_info = (struct hal_info_t *)hal;
   u8 empty = 0;
   u8 i = 0;
 
   for (i = 0; i < MAX_WOW_DROP_HWTX_TRYCNT; i++) {
 
       PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] %s : chk/drop for the %d time\n", __func__, i + 1);
 
       if (RTW_HAL_STATUS_SUCCESS != _wow_chk_txq_empty(hal_info, &empty))
           PHL_WARN("[wow] _wow_chk_txq_empty failed.\n");
 
       /* force drop wde if txq is not empty */
       if (!empty)
           _wow_wde_drop(hal_info, band);
       else
           break;
   }
 
   if (!empty) {
       PHL_WARN("[wow] %s : chk/drop fail!\n", __func__);
   } else {
       PHL_TRACE(COMP_PHL_WOW, _PHL_INFO_, "[wow] %s : chk/drop ok.\n", __func__);
       hal_status = RTW_HAL_STATUS_SUCCESS;
   }
 
   return hal_status;
}
 
#endif /* CONFIG_WOWLAN */