hc
2024-03-25 edb30157bad0c0001c32b854271ace01d3b9a16a
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
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
/******************************************************************************
 *
 * Copyright(c) 2019 - 2020 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.
 *
 *****************************************************************************/
#include "phl_headers.h"
 
#ifdef CONFIG_CMD_DISP
 
/* START of sounding / beamform cmd_disp module */
void
_phl_snd_cmd_set_eng_busy(struct phl_info_t *phl_info, enum snd_cmd_disp_ctrl ctrl)
{
   struct phl_sound_obj *snd = (struct phl_sound_obj *)phl_info->snd_obj;
 
   if (snd != NULL) {
       snd->msg_busy |= BIT(ctrl);
   }
}
 
void
_phl_snd_cmd_set_eng_idle(struct phl_info_t *phl_info, enum snd_cmd_disp_ctrl ctrl)
{
   struct phl_sound_obj *snd = (struct phl_sound_obj *)phl_info->snd_obj;
 
   if (snd != NULL) {
       snd->msg_busy &= ~(BIT(ctrl));
   }
}
 
enum rtw_phl_status
_phl_snd_cmd_get_eng_status(struct phl_info_t *phl_info, enum snd_cmd_disp_ctrl ctrl)
{
   struct phl_sound_obj *snd = (struct phl_sound_obj *)phl_info->snd_obj;
   enum rtw_phl_status pstatus = RTW_PHL_STATUS_FAILURE;
 
   if (snd != NULL) {
       if (0 != (snd->msg_busy & BIT(ctrl))) {
           pstatus = RTW_PHL_STATUS_PENDING;
       } else {
           pstatus = RTW_PHL_STATUS_SUCCESS;
       }
   } else {
       pstatus = RTW_PHL_STATUS_RESOURCE;
   }
   return pstatus;
}
enum rtw_phl_status
_phl_snd_aquire_eng(struct phl_info_t *phl_info, enum snd_cmd_disp_ctrl ctrl)
{
   struct phl_sound_obj *snd = (struct phl_sound_obj *)phl_info->snd_obj;
   void *d = phl_to_drvpriv(phl_info);
   enum rtw_phl_status pstatus = RTW_PHL_STATUS_SUCCESS;
 
   if (snd == NULL)
       return RTW_PHL_STATUS_FAILURE;
 
   /* acuired cmd_disp_eng control */
   _os_spinlock(d, &snd->cmd_lock, _bh, NULL);
   pstatus = _phl_snd_cmd_get_eng_status(phl_info, ctrl);
   if (pstatus != RTW_PHL_STATUS_SUCCESS) {
       _os_spinunlock(d, &snd->cmd_lock, _bh, NULL);
       return pstatus;
   }
   _phl_snd_cmd_set_eng_busy(phl_info, SND_CMD_DISP_CTRL_BFEE);
   _os_spinunlock(d, &snd->cmd_lock, _bh, NULL);
 
   return pstatus;
}
 
void
_phl_snd_free_eng(struct phl_info_t *phl_info, enum snd_cmd_disp_ctrl ctrl)
{
   struct phl_sound_obj *snd = (struct phl_sound_obj *)phl_info->snd_obj;
   void *d = phl_to_drvpriv(phl_info);
 
   if (snd != NULL) {
       _os_spinlock(d, &snd->cmd_lock, _bh, NULL);
       _phl_snd_cmd_set_eng_idle(phl_info, ctrl);
       _os_spinunlock(d, &snd->cmd_lock, _bh, NULL);
   }
}
 
static enum phl_mdl_ret_code
_phl_snd_cmd_module_init(void *phl, void *dispr, void **priv)
{
   enum phl_mdl_ret_code ret = MDL_RET_SUCCESS;
#ifdef CONFIG_SND_CMD
   struct phl_info_t *phl_info = (struct phl_info_t *)phl;
   void *d = phl_to_drvpriv(phl_info);
   struct phl_sound_obj *snd_obj = NULL;
 
   PHL_INFO("--> %s\n", __func__);
   if (NULL == phl_info->snd_obj) {
       phl_info->snd_obj = _os_kmem_alloc(d, sizeof(struct phl_sound_obj));
   }
   snd_obj = phl_info->snd_obj;
   if (snd_obj == NULL) {
       ret = MDL_RET_FAIL;
   } else {
       /* Init the snd static resources here */
       snd_obj->phl_info = (struct phl_info_t *)phl;
       _os_spinlock_init(d, &snd_obj->snd_lock);
       _os_spinlock_init(d, &snd_obj->cmd_lock);
   }
#endif
   *priv = (void *)phl;
   return ret;
}
 
static void _phl_snd_cmd_module_deinit(void *dispr, void *priv)
{
#ifdef CONFIG_SND_CMD
   struct phl_info_t *phl_info = (struct phl_info_t *)priv;
   struct phl_sound_obj *snd_obj = (struct phl_sound_obj *)phl_info->snd_obj;
   void *d = phl_to_drvpriv(phl_info);
 
   PHL_INFO("--> %s\n", __func__);
   if (NULL != snd_obj) {
       _os_spinlock_free(d, &snd_obj->snd_lock);
       _os_spinlock_free(d, &snd_obj->cmd_lock);
       _os_kmem_free(d, snd_obj, sizeof(struct phl_sound_obj));
   }
   phl_info->snd_obj = NULL;
#endif
   return;
}
 
static enum phl_mdl_ret_code _phl_snd_cmd_module_start(void *dispr, void *priv)
{
   return MDL_RET_SUCCESS;
}
 
static enum phl_mdl_ret_code _phl_snd_cmd_module_stop(void *dispr, void *priv)
{
   return MDL_RET_SUCCESS;
}
 
static enum phl_mdl_ret_code
_phl_snd_cmd_module_set_info(void *dispr, void *priv,
                struct phl_module_op_info *info)
{
   enum phl_mdl_ret_code mstatus = MDL_RET_IGNORE;
   struct phl_info_t *phl = (struct phl_info_t *)priv;
 
   PHL_INFO("[SND_CMD], %s(): opcode %d.\n", __func__, info->op_code);
 
   switch (info->op_code) {
       case SND_CMD_OP_SET_AID:
       {
           struct snd_cmd_set_aid *cmdbuf = (struct snd_cmd_set_aid *)info->inbuf;
 
           if (NULL == cmdbuf) {
               mstatus = MDL_RET_FAIL;
               break;
           }
           if (NULL == cmdbuf->sta_info) {
               mstatus = MDL_RET_FAIL;
               cmdbuf->cmd_sts = MDL_RET_FAIL;
               break;
           }
           if (RTW_HAL_STATUS_SUCCESS != rtw_hal_beamform_set_aid(
                       phl->hal, cmdbuf->sta_info, cmdbuf->aid)) {
               mstatus = MDL_RET_FAIL;
               cmdbuf->cmd_sts = MDL_RET_FAIL;
               break;
           }
#ifdef RTW_WKARD_BFEE_SET_AID
           cmdbuf->sta_info->wrole->last_set_aid = cmdbuf->aid;
#endif
           cmdbuf->cmd_sts = MDL_RET_SUCCESS;
           mstatus = MDL_RET_SUCCESS;
       }
       break;
       case SND_CMD_OP_NONE:
       case SND_CMD_OP_MAX:
       default:
       break;
   }
 
   return mstatus;
}
 
static enum phl_mdl_ret_code
_phl_snd_cmd_module_query_info(void *dispr, void *priv,
                  struct phl_module_op_info *info)
{
   return MDL_RET_IGNORE;
}
 
static enum phl_mdl_ret_code
_phl_snd_cmd_module_msg_msg_hdlr_pre(struct phl_info_t *phl,
                    struct phl_msg *msg)
{
   enum phl_mdl_ret_code mstatus = MDL_RET_IGNORE;
   switch (MSG_EVT_ID_FIELD(msg->msg_id)) {
   case MSG_EVT_SET_VHT_GID:
       /* do nothing in pre phase */
   break;
   case MSG_EVT_SET_BFEE_AID:
       /* do nothing in pre phase */
   break;
   default:
       break;
   }
 
   return mstatus;
}
 
static enum phl_mdl_ret_code
_phl_snd_cmd_module_msg_msg_hdlr_post(struct phl_info_t *phl,
                     struct phl_msg *msg)
{
   enum phl_mdl_ret_code mstatus = MDL_RET_IGNORE;
   switch (MSG_EVT_ID_FIELD(msg->msg_id)) {
   case MSG_EVT_SET_VHT_GID:
   {
       struct rtw_phl_gid_pos_tbl *gid_tbl = (struct rtw_phl_gid_pos_tbl *)msg->inbuf;
       if (msg->inlen != sizeof(struct rtw_phl_gid_pos_tbl)) {
           PHL_TRACE(COMP_PHL_DBG, _PHL_INFO_,
                 "%s() VHT-BFEE : Error, size mis-match \n", __func__);
           mstatus = MDL_RET_FAIL;
           break;
       }
       rtw_hal_beamform_set_vht_gid(phl->hal, msg->band_idx, gid_tbl);
       mstatus = MDL_RET_SUCCESS;
   }
   break;
   case MSG_EVT_SET_BFEE_AID:
   {
       struct snd_cmd_set_aid *cmdbuf = (struct snd_cmd_set_aid *)msg->inbuf;
 
       if (NULL == cmdbuf) {
           mstatus = MDL_RET_FAIL;
           break;
       }
       if (NULL == cmdbuf->sta_info) {
           mstatus = MDL_RET_FAIL;
           cmdbuf->cmd_sts = MDL_RET_FAIL;
           break;
       }
       if (RTW_HAL_STATUS_SUCCESS != rtw_hal_beamform_set_aid(
                   phl->hal, cmdbuf->sta_info, cmdbuf->aid)) {
           mstatus = MDL_RET_FAIL;
           cmdbuf->cmd_sts = MDL_RET_FAIL;
           break;
       }
       cmdbuf->cmd_sts = MDL_RET_SUCCESS;
       mstatus = MDL_RET_SUCCESS;
   }
   break;
   default:
       break;
   }
 
   return mstatus;
}
 
static enum phl_mdl_ret_code
_phl_snd_cmd_module_msg_hdlr(void *dispr, void *priv,
                struct phl_msg *msg)
{
   struct phl_info_t *phl_info = (struct phl_info_t *)priv;
   enum phl_mdl_ret_code mstatus = MDL_RET_IGNORE;
 
   PHL_TRACE(COMP_PHL_SOUND, _PHL_INFO_,
         "===> %s() event id : 0x%x \n", __func__, MSG_EVT_ID_FIELD(msg->msg_id));
 
   if (IS_MSG_FAIL(msg->msg_id)) {
       PHL_TRACE(COMP_PHL_DBG, _PHL_WARNING_,
             "%s: cmd dispatcher notify cmd failure: 0x%x.\n",
             __FUNCTION__, msg->msg_id);
       mstatus = MDL_RET_FAIL;
       return mstatus;
   }
 
   if (IS_MSG_IN_PRE_PHASE(msg->msg_id)) {
       mstatus = _phl_snd_cmd_module_msg_msg_hdlr_pre(phl_info, msg);
   } else {
       mstatus = _phl_snd_cmd_module_msg_msg_hdlr_post(phl_info, msg);
   }
 
   return mstatus;
}
 
enum rtw_phl_status phl_snd_cmd_register_module(struct phl_info_t *phl_info)
{
   enum rtw_phl_status phl_status = RTW_PHL_STATUS_FAILURE;
   struct phl_bk_module_ops bk_ops;
   struct phl_cmd_dispatch_engine *disp_eng = &(phl_info->disp_eng);
   u8 i = 0;
 
   bk_ops.init = _phl_snd_cmd_module_init;
   bk_ops.deinit = _phl_snd_cmd_module_deinit;
   bk_ops.start = _phl_snd_cmd_module_start;
   bk_ops.stop = _phl_snd_cmd_module_stop;
   bk_ops.msg_hdlr = _phl_snd_cmd_module_msg_hdlr;
   bk_ops.set_info = _phl_snd_cmd_module_set_info;
   bk_ops.query_info = _phl_snd_cmd_module_query_info;
 
 
   for (i = 0; i < disp_eng->phy_num; i++) {
       phl_status = phl_disp_eng_register_module(phl_info, i,
                       PHL_MDL_SOUND, &bk_ops);
       if (phl_status != RTW_PHL_STATUS_SUCCESS) {
           PHL_ERR("%s register SOUND module in cmd disp band[%d] failed\n",
               __func__, i);
           phl_status = RTW_PHL_STATUS_FAILURE;
           break;
       }
   }
 
   return phl_status;
}
 
 
/* Start of APIs for Core/OtherModule */
 
/* sub-functions */
/**
 * _phl_snd_cmd_post_set_vht_gid(...)
 *     used by rtw_phl_snd_cmd_set_vht_gid(..)
 **/
void _phl_snd_cmd_post_set_vht_gid(void* priv, struct phl_msg* msg)
{
   struct phl_info_t *phl_info = (struct phl_info_t *)priv;
 
   PHL_TRACE(COMP_PHL_DBG, _PHL_INFO_, "--> %s : release memeory \n", __func__);
   if (msg->inbuf && msg->inlen){
       _os_kmem_free(phl_to_drvpriv(phl_info), msg->inbuf, msg->inlen);
   }
   /* release cmd_disp_eng control */
   _phl_snd_free_eng(phl_info, SND_CMD_DISP_CTRL_BFEE);
}
/* main-functions */
/**
 * rtw_phl_snd_cmd_set_vht_gid (...)
 * input : struct rtw_phl_gid_pos_tbl *tbl
 *         the received VHT GID management frame's GID / Position informaion.
 **/
enum rtw_phl_status
rtw_phl_snd_cmd_set_vht_gid(void *phl,
               struct rtw_wifi_role_t *wrole,
               struct rtw_phl_gid_pos_tbl *tbl)
{
   enum rtw_phl_status phl_status = RTW_PHL_STATUS_FAILURE;
   struct phl_info_t *phl_info = (struct phl_info_t *)phl;
   struct phl_msg msg = {0};
   struct phl_msg_attribute attr = {0};
   void *d = phl_to_drvpriv(phl_info);
   struct rtw_phl_gid_pos_tbl *gid_tbl;
 
   /* acuired cmd_disp_eng control */
   if (RTW_PHL_STATUS_SUCCESS !=
       _phl_snd_aquire_eng(phl_info, SND_CMD_DISP_CTRL_BFEE)) {
           return RTW_PHL_STATUS_FAILURE;
   }
 
   SET_MSG_MDL_ID_FIELD(msg.msg_id, PHL_MDL_SOUND);
   SET_MSG_EVT_ID_FIELD(msg.msg_id, MSG_EVT_SET_VHT_GID);
 
   msg.band_idx = wrole->hw_band;
 
   attr.completion.completion = _phl_snd_cmd_post_set_vht_gid;
   attr.completion.priv = phl_info;
   gid_tbl = (struct rtw_phl_gid_pos_tbl *)_os_kmem_alloc(d, sizeof(struct rtw_phl_gid_pos_tbl));
   _os_mem_cpy(d, gid_tbl, tbl, sizeof(struct rtw_phl_gid_pos_tbl));
 
   msg.inbuf = (u8 *)gid_tbl;
   msg.inlen = sizeof(struct rtw_phl_gid_pos_tbl);
 
   phl_status = phl_disp_eng_send_msg(phl_info, &msg, &attr, NULL);
   if (phl_status != RTW_PHL_STATUS_SUCCESS) {
       PHL_TRACE(COMP_PHL_DBG, _PHL_ERR_, "%s: Dispr send msg fail!\n",
             __func__);
       goto exit;
   }
 
   return phl_status;
 
exit:
   _os_kmem_free(d, gid_tbl,
             sizeof(struct rtw_phl_gid_pos_tbl));
   /* release cmd_disp_eng control */
   _phl_snd_free_eng(phl_info, SND_CMD_DISP_CTRL_BFEE);
   return phl_status;
 
}
 
void _phl_snd_cmd_post_set_aid(void* priv, struct phl_msg* msg)
{
   struct phl_info_t *phl_info = (struct phl_info_t *)priv;
#ifdef RTW_WKARD_BFEE_SET_AID
   struct snd_cmd_set_aid *cmdbuf = NULL;
#endif
 
   if (msg->inbuf && msg->inlen){
#ifdef RTW_WKARD_BFEE_SET_AID
       cmdbuf = (struct snd_cmd_set_aid *)msg->inbuf;
       /* backup aid */
       if (MDL_RET_SUCCESS == cmdbuf->cmd_sts) {
           cmdbuf->sta_info->wrole->last_set_aid = cmdbuf->aid;
           PHL_TRACE(COMP_PHL_DBG, _PHL_INFO_,
               "%s : set aid (%d)\n",
               __func__, cmdbuf->sta_info->wrole->last_set_aid);
       }
#endif
       _os_kmem_free(phl_to_drvpriv(phl_info), msg->inbuf, msg->inlen);
   }
   /* release cmd_disp_eng control */
   _phl_snd_free_eng(phl_info, SND_CMD_DISP_CTRL_BFEE);
   PHL_TRACE(COMP_PHL_DBG, _PHL_INFO_, "%s : set aid complete\n", __func__);
}
 
enum rtw_phl_status
rtw_phl_snd_cmd_set_aid(void *phl,
           struct rtw_wifi_role_t *wrole,
           struct rtw_phl_stainfo_t *sta,
           u16 aid)
{
   enum rtw_phl_status phl_status = RTW_PHL_STATUS_FAILURE;
   struct phl_info_t *phl_info = (struct phl_info_t *)phl;
   struct phl_msg msg = {0};
   struct phl_msg_attribute attr = {0};
   void *d = phl_to_drvpriv(phl_info);
   struct snd_cmd_set_aid *cmdbuf = NULL;
 
   /* acuired cmd_disp_eng control */
   if (RTW_PHL_STATUS_SUCCESS !=
       _phl_snd_aquire_eng(phl_info, SND_CMD_DISP_CTRL_BFEE)) {
           return RTW_PHL_STATUS_FAILURE;
   }
 
   SET_MSG_MDL_ID_FIELD(msg.msg_id, PHL_MDL_SOUND);
   SET_MSG_EVT_ID_FIELD(msg.msg_id, MSG_EVT_SET_BFEE_AID);
 
   msg.band_idx = wrole->hw_band;
 
   attr.completion.completion = _phl_snd_cmd_post_set_aid;
   attr.completion.priv = phl_info;
 
   cmdbuf = (struct snd_cmd_set_aid *)_os_kmem_alloc(d, sizeof(struct snd_cmd_set_aid));
   cmdbuf->aid = aid;
   cmdbuf->sta_info = sta;
 
   msg.inbuf = (u8 *)cmdbuf;
   msg.inlen = sizeof(struct snd_cmd_set_aid);
 
   phl_status = phl_disp_eng_send_msg(phl_info, &msg, &attr, NULL);
 
   if (phl_status != RTW_PHL_STATUS_SUCCESS) {
       PHL_TRACE(COMP_PHL_DBG, _PHL_ERR_, "%s: Dispr send msg fail!\n",
             __func__);
       goto exit;
   }
 
   return phl_status;
 
exit:
   _os_kmem_free(d, cmdbuf, sizeof(struct snd_cmd_set_aid));
   /* release cmd_disp_eng control */
   _phl_snd_free_eng(phl_info, SND_CMD_DISP_CTRL_BFEE);
   return phl_status;
 
}
 
/**
 * For other module, such as LPS, direct set aid.
 **/
enum rtw_phl_status
phl_snd_cmd_set_aid_info(struct phl_info_t *phl,
            struct rtw_wifi_role_t *wrole,
            struct rtw_phl_stainfo_t *sta,
            u16 aid)
{
   enum rtw_phl_status phl_status = RTW_PHL_STATUS_FAILURE;
   struct phl_module_op_info op_info = {0};
   struct snd_cmd_set_aid cmdbuf = {0};
   PHL_TRACE(COMP_PHL_DBG, _PHL_INFO_, "--> %s\n", __func__);
 
   cmdbuf.aid = aid;
   cmdbuf.sta_info = sta;
 
   op_info.op_code = SND_CMD_OP_SET_AID;
   op_info.inbuf = (u8 *)&cmdbuf;
   op_info.inlen = sizeof(struct snd_cmd_set_aid);
 
   phl_status = phl_disp_eng_set_bk_module_info(phl, wrole->hw_band,
                            PHL_MDL_SOUND, &op_info);
 
   PHL_TRACE(COMP_PHL_DBG, _PHL_INFO_, "<-- %s\n", __func__);
   return phl_status;
}
 
#ifdef RTW_WKARD_BFEE_SET_AID
enum rtw_phl_status
_phl_cmd_snd_restore_aid(struct phl_info_t *phl,
            struct rtw_wifi_role_t *wrole)
{
   enum rtw_phl_status phl_status = RTW_PHL_STATUS_SUCCESS;
   struct rtw_phl_stainfo_t *sta = NULL;
 
   do {
       if (MLME_NO_LINK == wrole->mstate)
           break;
 
       sta = rtw_phl_get_stainfo_self(phl, wrole);
 
       if (NULL == sta)
           break;
 
       if (wrole->last_set_aid == sta->aid)
           break;
 
       phl_status = phl_snd_cmd_set_aid_info(phl, wrole, sta, sta->aid);
 
   } while (0);
 
   return phl_status;
}
#endif
 
 
enum rtw_phl_status
_phl_snd_cmd_ntfy_ps_enter(struct phl_info_t *phl,
              struct rtw_wifi_role_t *wrole)
{
   enum rtw_phl_status phl_status = RTW_PHL_STATUS_SUCCESS;
 
#ifdef RTW_WKARD_BFEE_SET_AID
   phl->phl_com->is_in_lps = 1;
 
   if (PHL_RTYPE_STATION == wrole->type) {
       phl_status= _phl_cmd_snd_restore_aid(phl, wrole);
   }
#endif
 
   /* TODO: stop BFer period sounding if in progress */
   return phl_status;
}
 
enum rtw_phl_status
_phl_snd_cmd_ntfy_ps_leave(struct phl_info_t *phl,
              struct rtw_wifi_role_t *wrole)
{
   enum rtw_phl_status phl_status = RTW_PHL_STATUS_SUCCESS;
 
#ifdef RTW_WKARD_BFEE_SET_AID
   phl->phl_com->is_in_lps = 0;
#endif
 
   /* TODO: restart BFer period sounding if sounding needed */
   return phl_status;
}
 
 
enum rtw_phl_status
phl_snd_cmd_ntfy_ps(struct phl_info_t *phl,
           struct rtw_wifi_role_t *wrole,
           bool enter)
{
   enum rtw_phl_status phl_status = RTW_PHL_STATUS_SUCCESS;
 
   if (true == enter)
       phl_status = _phl_snd_cmd_ntfy_ps_enter(phl, wrole);
   else
       phl_status = _phl_snd_cmd_ntfy_ps_leave(phl, wrole);
 
   return phl_status;
}
 
#endif