xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8852be/phl/phl_role.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2019 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 #ifndef _PHL_ROLE_H_
16 #define _PHL_ROLE_H_
17 
18 #define phl_role_is_ap_category(_wrole) (_wrole->type == PHL_RTYPE_AP || _wrole->type == PHL_RTYPE_P2P_GO)
19 #define phl_role_is_client_category(_wrole) (_wrole->type == PHL_RTYPE_STATION || _wrole->type == PHL_RTYPE_P2P_GC)
20 
21 #ifdef CONFIG_CMD_DISP
22 enum rtw_phl_status
23 phl_register_mrc_module(struct phl_info_t *phl_info);
24 #endif
25 
26 struct rtw_wifi_role_t *
27 rtw_phl_get_wrole_by_ridx(struct rtw_phl_com_t *phl_com, u8 rold_idx);
28 
29 struct rtw_wifi_role_t *
30 phl_get_wrole_by_addr(struct phl_info_t *phl_info, u8 *mac_addr);
31 
32 enum rtw_phl_status
33 phl_role_noa_notify(struct phl_info_t *phl_info, struct rtw_wifi_role_t *wrole);
34 enum rtw_phl_status
35 phl_role_ap_client_notify(struct phl_info_t *phl_info,
36 			struct rtw_wifi_role_t *wrole, u8 link_sts);
37 
38 enum rtw_phl_status
39 phl_role_notify(struct phl_info_t *phl_info, struct rtw_wifi_role_t *wrole);
40 
41 enum rtw_phl_status
42 phl_role_recover(struct phl_info_t *phl_info);
43 enum rtw_phl_status
44 phl_cmd_role_recover(struct phl_info_t *phl_info);
45 enum rtw_phl_status
46 phl_role_suspend(struct phl_info_t *phl_info);
47 enum rtw_phl_status
48 phl_cmd_role_suspend(struct phl_info_t *phl_info);
49 
50 #ifdef RTW_PHL_BCN
51 enum rtw_phl_status
52 rtw_phl_free_bcn_entry(void *phl, struct rtw_wifi_role_t *wrole);
53 #ifdef CONFIG_CMD_DISP
54 enum rtw_phl_status
55 phl_cmd_issue_bcn_hdl(struct phl_info_t *phl_info, u8 *param);
56 enum rtw_phl_status
57 phl_cmd_stop_bcn_hdl(struct phl_info_t *phl_info, u8 *param);
58 #endif
59 #endif
60 
61 u16 phl_role_get_bcn_intvl(struct phl_info_t *phl, struct rtw_wifi_role_t *wrole);
62 
63 #ifdef CONFIG_CMD_DISP
64 enum rtw_phl_status
65 phl_wifi_role_start_hdl(struct phl_info_t *phl_info, u8 *param);
66 enum rtw_phl_status
67 phl_wifi_role_chg_hdl(struct phl_info_t *phl_info, u8 *param);
68 enum rtw_phl_status
69 phl_wifi_role_stop_hdl(struct phl_info_t *phl_info, u8 *param);
70 #endif
71 
72 enum rtw_phl_status
73 phl_wifi_role_change(struct phl_info_t *phl_info, struct rtw_wifi_role_t *wrole,
74 	enum wr_chg_id chg_id, void *chg_info);
75 enum rtw_phl_status
76 phl_wifi_role_macid_all_pause(struct phl_info_t *phl_info, struct rtw_wifi_role_t *wrole, bool pause);
77 #endif  /*_PHL_ROLE_H_*/
78