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