1 /******************************************************************************
2 *
3 * Copyright(c) 2020 Realtek Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 *****************************************************************************/
15 #include "phl_headers.h"
16
17 #ifdef CONFIG_STA_CMD_DISPR
rtw_phl_connect_prepare(void * phl,struct rtw_wifi_role_t * wrole,u8 * addr)18 enum rtw_phl_status rtw_phl_connect_prepare(void *phl,
19 struct rtw_wifi_role_t *wrole,
20 u8 *addr)
21 {
22 enum rtw_phl_status phl_status = RTW_PHL_STATUS_FAILURE;
23 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
24 struct phl_msg msg = {0};
25 struct phl_msg_attribute attr = {0};
26
27 SET_MSG_MDL_ID_FIELD(msg.msg_id, PHL_FG_MDL_CONNECT);
28 SET_MSG_EVT_ID_FIELD(msg.msg_id, MSG_EVT_CONNECT_START);
29 msg.band_idx = wrole->hw_band;
30
31 phl_status = phl_disp_eng_send_msg(phl_info, &msg, &attr, NULL);
32 if(phl_status != RTW_PHL_STATUS_SUCCESS){
33 PHL_TRACE(COMP_PHL_DBG, _PHL_ERR_, "%s: Dispr send msg fail!\n",
34 __FUNCTION__);
35 goto exit;
36 }
37
38 exit:
39 return phl_status;
40 }
41
42 enum rtw_phl_status
rtw_phl_connect_linked(void * phl,struct rtw_wifi_role_t * wrole,struct rtw_phl_stainfo_t * sta,u8 * sta_addr)43 rtw_phl_connect_linked(void *phl,
44 struct rtw_wifi_role_t *wrole,
45 struct rtw_phl_stainfo_t *sta,
46 u8 *sta_addr)
47 {
48 enum rtw_phl_status phl_status = RTW_PHL_STATUS_FAILURE;
49 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
50 struct phl_msg msg = {0};
51 struct phl_msg_attribute attr = {0};
52
53 SET_MSG_MDL_ID_FIELD(msg.msg_id, PHL_FG_MDL_CONNECT);
54 SET_MSG_EVT_ID_FIELD(msg.msg_id, MSG_EVT_CONNECT_LINKED);
55 msg.band_idx = wrole->hw_band;
56 msg.rsvd[0] = sta;
57 msg.rsvd[1] = sta_addr;
58
59 phl_status = phl_disp_eng_send_msg(phl_info, &msg, &attr, NULL);
60 if(phl_status != RTW_PHL_STATUS_SUCCESS){
61 PHL_TRACE(COMP_PHL_DBG, _PHL_ERR_, "%s: Dispr send msg fail!\n",
62 __FUNCTION__);
63 goto exit;
64 }
65
66 exit:
67 return phl_status;
68 }
69
rtw_phl_connected(void * phl,struct rtw_wifi_role_t * wrole,struct rtw_phl_stainfo_t * sta)70 enum rtw_phl_status rtw_phl_connected(void *phl,
71 struct rtw_wifi_role_t *wrole,
72 struct rtw_phl_stainfo_t *sta)
73 {
74 enum rtw_phl_status phl_status = RTW_PHL_STATUS_FAILURE;
75 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
76 struct phl_msg msg = {0};
77 struct phl_msg_attribute attr = {0};
78
79 SET_MSG_MDL_ID_FIELD(msg.msg_id, PHL_FG_MDL_CONNECT);
80 SET_MSG_EVT_ID_FIELD(msg.msg_id, MSG_EVT_CONNECT_END);
81 msg.band_idx = wrole->hw_band;
82
83 phl_status = phl_disp_eng_send_msg(phl_info, &msg, &attr, NULL);
84 if(phl_status != RTW_PHL_STATUS_SUCCESS){
85 PHL_TRACE(COMP_PHL_DBG, _PHL_ERR_, "%s: Dispr send msg fail!\n",
86 __FUNCTION__);
87 goto exit;
88 }
89
90 exit:
91 return phl_status;
92 }
93
rtw_phl_disconnect(void * phl,struct rtw_wifi_role_t * wrole,bool is_disconnect)94 enum rtw_phl_status rtw_phl_disconnect(void *phl,
95 struct rtw_wifi_role_t *wrole,
96 bool is_disconnect)
97 {
98 enum rtw_phl_status phl_status = RTW_PHL_STATUS_FAILURE;
99 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
100 struct phl_msg msg = {0};
101 struct phl_msg_attribute attr = {0};
102
103 if(is_disconnect) {
104 SET_MSG_MDL_ID_FIELD(msg.msg_id, PHL_FG_MDL_DISCONNECT);
105 SET_MSG_EVT_ID_FIELD(msg.msg_id, MSG_EVT_DISCONNECT_PREPARE);
106 } else {
107 SET_MSG_MDL_ID_FIELD(msg.msg_id, PHL_FG_MDL_CONNECT);
108 SET_MSG_EVT_ID_FIELD(msg.msg_id, MSG_EVT_DISCONNECT);
109 }
110
111 msg.band_idx = wrole->hw_band;
112 msg.rsvd[0] = (u8*)wrole;
113
114 phl_status = phl_disp_eng_send_msg(phl_info, &msg, &attr, NULL);
115 if(phl_status != RTW_PHL_STATUS_SUCCESS){
116 PHL_TRACE(COMP_PHL_DBG, _PHL_ERR_, "%s: Dispr send msg fail!\n",
117 __FUNCTION__);
118 goto exit;
119 }
120
121 exit:
122 return phl_status;
123 }
124 #else /* CONFIG_STA_CMD_DISPR */
rtw_phl_connect_prepare(void * phl,struct rtw_wifi_role_t * wrole,u8 * addr)125 enum rtw_phl_status rtw_phl_connect_prepare(void *phl,
126 struct rtw_wifi_role_t *wrole,
127 u8 *addr)
128 {
129 enum rtw_phl_status psts = RTW_PHL_STATUS_FAILURE;
130 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
131
132 FUNCIN();
133 wrole->mstate = MLME_LINKING;
134 psts = phl_role_notify(phl_info, wrole);
135 if (psts != RTW_PHL_STATUS_SUCCESS) {
136 PHL_ERR("%s role notify failed\n", __func__);
137 goto _exit;
138 }
139 psts = phl_mr_info_upt(phl_info, wrole);
140 if (psts != RTW_PHL_STATUS_SUCCESS) {
141 PHL_ERR("%s mr info upt failed\n", __func__);
142 goto _exit;
143 }
144
145 psts = rtw_phl_mr_rx_filter(phl, wrole);
146 if (psts != RTW_PHL_STATUS_SUCCESS) {
147 PHL_ERR("%s set mr_rx_filter failed\n", __func__);
148 goto _exit;
149 }
150
151 #ifdef CONFIG_PHL_P2PPS
152 /* pasue all NoA */
153 phl_p2pps_noa_all_role_pause(phl, wrole->hw_band);
154 #endif
155
156 PHL_DUMP_MR_EX(phl_info);
157 _exit:
158 FUNCOUT();
159 return psts;
160 }
161
rtw_phl_connected(void * phl,struct rtw_wifi_role_t * wrole,struct rtw_phl_stainfo_t * sta)162 enum rtw_phl_status rtw_phl_connected(void *phl,
163 struct rtw_wifi_role_t *wrole,
164 struct rtw_phl_stainfo_t *sta)
165 {
166 enum rtw_phl_status psts = RTW_PHL_STATUS_FAILURE;
167 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
168
169 FUNCIN();
170 if (wrole->type == PHL_RTYPE_STATION || wrole->type == PHL_RTYPE_P2P_GC) {
171 psts = phl_role_notify(phl_info, wrole);
172 if (psts != RTW_PHL_STATUS_SUCCESS) {
173 PHL_ERR("%s role notify failed\n", __func__);
174 goto _exit;
175 }
176 }
177
178 psts = phl_mr_info_upt(phl_info, wrole);
179 if (psts != RTW_PHL_STATUS_SUCCESS) {
180 PHL_ERR("%s mr info upt failed\n", __func__);
181 goto _exit;
182 }
183
184 psts = rtw_phl_mr_rx_filter(phl, wrole);
185 if (psts != RTW_PHL_STATUS_SUCCESS) {
186 PHL_ERR("%s set mr_rx_filter failed\n", __func__);
187 goto _exit;
188 }
189
190 psts = phl_mr_tsf_sync(phl, wrole, PHL_ROLE_MSTS_STA_CONN_END);
191 if (psts != RTW_PHL_STATUS_SUCCESS) {
192 PHL_ERR("%s set mr_tsf_sync failed\n", __func__);
193 goto _exit;
194 }
195 #if 0
196 psts = phl_mr_state_upt(phl_info, wrole);
197 if (psts != RTW_PHL_STATUS_SUCCESS) {
198 PHL_ERR("%s phl_mr_state_upt failed\n", __func__);
199 goto _exit;
200 }
201 #endif
202
203 PHL_DUMP_MR_EX(phl_info);
204 _exit:
205 FUNCOUT();
206 return psts;
207 }
rtw_phl_disconnect_prepare(void * phl,struct rtw_wifi_role_t * wrole)208 enum rtw_phl_status rtw_phl_disconnect_prepare(void *phl,
209 struct rtw_wifi_role_t *wrole)
210 {
211 enum rtw_phl_status psts = RTW_PHL_STATUS_SUCCESS;
212 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
213
214 FUNCIN();
215 #ifdef CONFIG_PHL_P2PPS
216 /* disable NoA for this role */
217 phl_p2pps_noa_disable_all(phl_info, wrole);
218 /* pasue buddy NoA */
219 phl_p2pps_noa_all_role_pause(phl_info, wrole->hw_band);
220 #endif
221 FUNCOUT();
222 return psts;
223 }
224
rtw_phl_disconnect(void * phl,struct rtw_wifi_role_t * wrole)225 enum rtw_phl_status rtw_phl_disconnect(void *phl,
226 struct rtw_wifi_role_t *wrole)
227 {
228 enum rtw_phl_status psts = RTW_PHL_STATUS_SUCCESS;
229 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
230
231 FUNCIN();
232 if (wrole->type == PHL_RTYPE_STATION || wrole->type == PHL_RTYPE_P2P_GC) {
233 psts = phl_role_notify(phl_info, wrole);
234 if (psts != RTW_PHL_STATUS_SUCCESS) {
235 PHL_ERR("%s role notify failed\n", __func__);
236 goto _exit;
237 }
238 }
239
240 psts = phl_mr_info_upt(phl_info, wrole);
241 if (psts != RTW_PHL_STATUS_SUCCESS) {
242 PHL_ERR("%s mr info upt failed\n", __func__);
243 goto _exit;
244 }
245
246 psts = rtw_phl_mr_rx_filter(phl, wrole);
247 if (psts != RTW_PHL_STATUS_SUCCESS) {
248 PHL_ERR("%s set mr_rx_filter failed\n", __func__);
249 goto _exit;
250 }
251
252 psts = phl_mr_tsf_sync(phl, wrole, PHL_ROLE_MSTS_STA_DIS_CONN);
253 if (psts != RTW_PHL_STATUS_SUCCESS) {
254 PHL_ERR("%s set mr_tsf_sync failed\n", __func__);
255 goto _exit;
256 }
257 psts = phl_mr_state_upt(phl_info, wrole);
258 if (psts != RTW_PHL_STATUS_SUCCESS) {
259 PHL_ERR("%s phl_mr_state_upt failed\n", __func__);
260 goto _exit;
261 }
262 rtw_hal_disconnect_notify(phl_info->hal, &wrole->chandef);
263
264 #ifdef CONFIG_PHL_P2PPS
265 /* resume buddy NoA */
266 phl_p2pps_noa_all_role_resume(phl, wrole->hw_band);
267 #endif
268 PHL_DUMP_MR_EX(phl_info);
269 _exit:
270 FUNCOUT();
271 return psts;
272 }
273 #endif
274
275 #ifdef CONFIG_AP_CMD_DISPR
rtw_phl_ap_started(void * phl,struct rtw_wifi_role_t * wrole)276 enum rtw_phl_status rtw_phl_ap_started(void *phl, struct rtw_wifi_role_t *wrole)
277 {
278 enum rtw_phl_status phl_status = RTW_PHL_STATUS_FAILURE;
279 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
280 struct phl_msg msg = {0};
281 struct phl_msg_attribute attr = {0};
282
283 SET_MSG_MDL_ID_FIELD(msg.msg_id, PHL_FG_MDL_AP_START);
284 SET_MSG_EVT_ID_FIELD(msg.msg_id, MSG_EVT_AP_START);
285 msg.band_idx = wrole->hw_band;
286
287 phl_status = phl_disp_eng_send_msg(phl_info, &msg, &attr, NULL);
288 if(phl_status != RTW_PHL_STATUS_SUCCESS){
289 PHL_TRACE(COMP_PHL_DBG, _PHL_ERR_, "%s: Dispr send msg fail!\n",
290 __FUNCTION__);
291 goto exit;
292 }
293
294 exit:
295 return phl_status;
296 }
297
rtw_phl_ap_stop(void * phl,struct rtw_wifi_role_t * wrole)298 enum rtw_phl_status rtw_phl_ap_stop(void *phl, struct rtw_wifi_role_t *wrole)
299 {
300 enum rtw_phl_status phl_status = RTW_PHL_STATUS_FAILURE;
301 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
302 struct phl_msg msg = {0};
303 struct phl_msg_attribute attr = {0};
304
305 SET_MSG_MDL_ID_FIELD(msg.msg_id, PHL_FG_MDL_AP_STOP);
306 SET_MSG_EVT_ID_FIELD(msg.msg_id, MSG_EVT_AP_STOP_PREPARE);
307 msg.band_idx = wrole->hw_band;
308 msg.rsvd[0] = (u8*)wrole;
309
310 phl_status = phl_disp_eng_send_msg(phl_info, &msg, &attr, NULL);
311 if(phl_status != RTW_PHL_STATUS_SUCCESS){
312 PHL_TRACE(COMP_PHL_DBG, _PHL_ERR_, "%s: Dispr send msg fail!\n",
313 __FUNCTION__);
314 goto exit;
315 }
316
317 exit:
318 return phl_status;
319 }
320 #else /* CONFIG_AP_CMD_DISPR */
rtw_phl_ap_start_prepare(void * phl,struct rtw_wifi_role_t * wrole)321 enum rtw_phl_status rtw_phl_ap_start_prepare(void *phl, struct rtw_wifi_role_t *wrole)
322 {
323 enum rtw_phl_status psts = RTW_PHL_STATUS_SUCCESS;
324
325 FUNCIN();
326 #ifdef CONFIG_PHL_P2PPS
327 /* pasue all NoA */
328 phl_p2pps_noa_all_role_pause(phl, wrole->hw_band);
329 #endif
330 FUNCOUT();
331 return psts;
332 }
rtw_phl_ap_started(void * phl,struct rtw_wifi_role_t * wrole)333 enum rtw_phl_status rtw_phl_ap_started(void *phl, struct rtw_wifi_role_t *wrole)
334 {
335 enum rtw_phl_status psts = RTW_PHL_STATUS_FAILURE;
336 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
337
338 FUNCIN();
339 psts = phl_role_notify(phl_info, wrole);
340 if (psts != RTW_PHL_STATUS_SUCCESS) {
341 PHL_ERR("%s role notify failed\n", __func__);
342 goto _exit;
343 }
344 psts = phl_mr_info_upt(phl_info, wrole);
345 if (psts != RTW_PHL_STATUS_SUCCESS) {
346 PHL_ERR("%s mr info upt failed\n", __func__);
347 goto _exit;
348 }
349 psts = rtw_phl_mr_rx_filter(phl, wrole);
350 if (psts != RTW_PHL_STATUS_SUCCESS) {
351 PHL_ERR("%s set mr_rx_filter failed\n", __func__);
352 goto _exit;
353 }
354
355 psts = phl_mr_tsf_sync(phl, wrole, PHL_ROLE_MSTS_AP_START);
356 if (psts != RTW_PHL_STATUS_SUCCESS) {
357 PHL_ERR("%s set mr_tsf_sync failed\n", __func__);
358 goto _exit;
359 }
360 psts = phl_mr_state_upt(phl_info, wrole);
361 if (psts != RTW_PHL_STATUS_SUCCESS) {
362 PHL_ERR("%s phl_mr_state_upt failed\n", __func__);
363 goto _exit;
364 }
365
366 PHL_DUMP_MR_EX(phl_info);
367
368 _exit:
369 FUNCOUT();
370 return psts;
371 }
372
rtw_phl_ap_stop_prepare(void * phl,struct rtw_wifi_role_t * wrole)373 enum rtw_phl_status rtw_phl_ap_stop_prepare(void *phl, struct rtw_wifi_role_t *wrole)
374 {
375 enum rtw_phl_status psts = RTW_PHL_STATUS_SUCCESS;
376 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
377
378 FUNCIN();
379 #ifdef CONFIG_PHL_P2PPS
380 /* disable NoA for this role */
381 phl_p2pps_noa_disable_all(phl_info, wrole);
382 /* pasue buddy NoA */
383 phl_p2pps_noa_all_role_pause(phl_info, wrole->hw_band);
384 #endif
385 FUNCOUT();
386 return psts;
387 }
388
rtw_phl_ap_stop(void * phl,struct rtw_wifi_role_t * wrole)389 enum rtw_phl_status rtw_phl_ap_stop(void *phl, struct rtw_wifi_role_t *wrole)
390 {
391 enum rtw_phl_status psts = RTW_PHL_STATUS_FAILURE;
392 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
393
394 FUNCIN();
395 wrole->mstate = MLME_NO_LINK;
396 psts = phl_role_notify(phl_info, wrole);
397 if (psts != RTW_PHL_STATUS_SUCCESS) {
398 PHL_ERR("%s role notify failed\n", __func__);
399 goto _exit;
400 }
401
402 psts = phl_mr_info_upt(phl_info, wrole);
403 if (psts != RTW_PHL_STATUS_SUCCESS) {
404 PHL_ERR("%s mr info upt failed\n", __func__);
405 goto _exit;
406 }
407 psts = rtw_phl_mr_rx_filter(phl, wrole);
408 if (psts != RTW_PHL_STATUS_SUCCESS) {
409 PHL_ERR("%s set mr_rx_filter failed\n", __func__);
410 goto _exit;
411 }
412
413 psts = phl_mr_tsf_sync(phl, wrole, PHL_ROLE_MSTS_AP_STOP);
414 if (psts != RTW_PHL_STATUS_SUCCESS) {
415 PHL_ERR("%s set mr_tsf_sync failed\n", __func__);
416 goto _exit;
417 }
418 psts = phl_mr_state_upt(phl_info, wrole);
419 if (psts != RTW_PHL_STATUS_SUCCESS) {
420 PHL_ERR("%s phl_mr_state_upt failed\n", __func__);
421 goto _exit;
422 }
423
424 #ifdef RTW_PHL_BCN
425 psts = rtw_phl_free_bcn_entry(phl_info, wrole);
426 if (psts != RTW_PHL_STATUS_SUCCESS) {
427 PHL_ERR("%s phl_free_bcn_entry failed\n", __func__);
428 goto _exit;
429 }
430 #endif
431 rtw_hal_disconnect_notify(phl_info->hal, &wrole->chandef);
432 #ifdef CONFIG_PHL_P2PPS
433 /* resume buddy NoA */
434 phl_p2pps_noa_all_role_resume(phl, wrole->hw_band);
435 #endif
436 PHL_DUMP_MR_EX(phl_info);
437 _exit:
438 FUNCOUT();
439 return psts;
440 }
441 #endif
442
443 #ifdef CONFIG_IBSS_CMD_DISPR
rtw_phl_ibss_started(void * phl,struct rtw_wifi_role_t * wrole)444 enum rtw_phl_status rtw_phl_ibss_started(void *phl, struct rtw_wifi_role_t *wrole)
445 {
446 PHL_ERR("%s failed, cmd dispatcher not support\n", __func__);
447 return RTW_PHL_STATUS_FAILURE;
448 }
449 #else /* CONFIG_IBSS_CMD_DISPR */
rtw_phl_ibss_started(void * phl,struct rtw_wifi_role_t * wrole)450 enum rtw_phl_status rtw_phl_ibss_started(void *phl, struct rtw_wifi_role_t *wrole)
451 {
452 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
453
454 #ifdef RTW_WKARD_IBSS_SNIFFER_MODE
455 rtw_hal_set_rxfltr_by_mode(phl_info->hal, wrole->hw_band,
456 RX_FLTR_MODE_SNIFFER);
457 #endif
458
459 return RTW_PHL_STATUS_SUCCESS;
460 }
461
462 #endif
463
464 enum rtw_phl_status
rtw_phl_disconnected_resume_hdlr(void * phl,struct rtw_wifi_role_t * wrole)465 rtw_phl_disconnected_resume_hdlr(void *phl,
466 struct rtw_wifi_role_t *wrole)
467 {
468 enum rtw_phl_status psts = RTW_PHL_STATUS_SUCCESS;
469 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
470
471 PHL_TRACE(COMP_PHL_MCC, _PHL_INFO_, "%s wrole->id(%d)\n",
472 __func__, wrole->id);
473 #ifdef CONFIG_PHL_P2PPS
474 /* resume buddy NoA */
475 phl_p2pps_noa_all_role_resume(phl_info, wrole->hw_band);
476 #endif
477 #ifdef CONFIG_MCC_SUPPORT
478 /* Enable MR coex mechanism(if needed) */
479 psts = phl_mr_coex_handle(phl_info, wrole, 0, wrole->hw_band,
480 MR_COEX_TRIG_BY_DIS_LINKING);
481 #endif
482 PHL_DUMP_MR_EX(phl_info);
483 PHL_TRACE(COMP_PHL_MCC, _PHL_INFO_, "%s psts(%d)\n",
484 __func__, psts);
485 return psts;
486 }
487
488 enum rtw_phl_status
rtw_phl_ap_stop_resume_hdlr(void * phl,struct rtw_wifi_role_t * wrole)489 rtw_phl_ap_stop_resume_hdlr(void *phl,
490 struct rtw_wifi_role_t *wrole)
491
492 {
493 enum rtw_phl_status psts = RTW_PHL_STATUS_SUCCESS;
494 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
495
496 PHL_TRACE(COMP_PHL_MCC, _PHL_INFO_, "%s wrole->id(%d)\n",
497 __func__, wrole->id);
498 #ifdef CONFIG_PHL_P2PPS
499 /* resume buddy NoA */
500 phl_p2pps_noa_all_role_resume(phl_info, wrole->hw_band);
501 #endif
502 #ifdef CONFIG_MCC_SUPPORT
503 /* Enable MR coex mechanism(if needed) */
504 psts = phl_mr_coex_handle(phl_info, wrole, 0, wrole->hw_band,
505 MR_COEX_TRIG_BY_DIS_LINKING);
506 #endif
507 PHL_DUMP_MR_EX(phl_info);
508 PHL_TRACE(COMP_PHL_MCC, _PHL_INFO_, "%s psts(%d)\n",
509 __func__, psts);
510 return psts;
511 }
512
513 #ifdef RTW_WKARD_P2P_LISTEN
rtw_phl_p2p_listen_start(void * phl,struct rtw_wifi_role_t * wrole)514 enum rtw_phl_status rtw_phl_p2p_listen_start(void *phl, struct rtw_wifi_role_t *wrole)
515 {
516 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
517
518 rtw_hal_set_rxfltr_by_mode(phl_info->hal, wrole->hw_band,
519 RX_FLTR_MODE_SNIFFER);
520
521 return RTW_PHL_STATUS_SUCCESS;
522 }
523
rtw_phl_p2p_listen_end(void * phl,struct rtw_wifi_role_t * wrole)524 enum rtw_phl_status rtw_phl_p2p_listen_end(void *phl, struct rtw_wifi_role_t *wrole)
525 {
526 struct phl_info_t *phl_info = (struct phl_info_t *)phl;
527
528 /* restore rx filter mode */
529 rtw_phl_mr_rx_filter(phl_info, wrole);
530
531 return RTW_PHL_STATUS_SUCCESS;
532 }
533 #endif /* RTW_WKARD_P2P_LISTEN */
534