xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8852be/phl/phl_connect.h (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 #ifndef _PHL_CONNECT_H_
16 #define _PHL_CONNECT_H_
17 
18 /**
19  * rtw_phl_connect_prepare() - Prepare hardware setting for connecting
20  * @phl:	struct phl_info_t *
21  * @wrole:	struct rtw_wifi_role_t *
22  * @addr:	target mac address
23  *
24  * Do all necessary hardware setting for connecting.
25  *
26  * Return RTW_PHL_STATUS_SUCCESS for success, otherwise fail.
27  */
28 enum rtw_phl_status rtw_phl_connect_prepare(void *phl,
29 					    struct rtw_wifi_role_t *wrole,
30 					    u8 *addr);
31 
32 /**
33  * rtw_phl_connect_linked() - update media status
34  * @phl:	struct phl_info_t *
35  * @wrole:	struct rtw_wifi_role_t *
36  * @sta:	struct rtw_phl_stainfo_t *
37  * @sta_addr:	target mac address
38  *
39  * Do all necessary hardware setting for linked.
40  *
41  * Return RTW_PHL_STATUS_SUCCESS for success, otherwise fail.
42  */
43 enum rtw_phl_status
44 rtw_phl_connect_linked(void *phl,
45                        struct rtw_wifi_role_t *wrole,
46                        struct rtw_phl_stainfo_t *sta,
47                        u8 *sta_addr);
48 
49 /**
50  * rtw_phl_connected() - Config hardware setting for connected
51  * @phl:	struct phl_info_t *
52  * @wrole:	struct rtw_wifi_role_t *
53  * @sta:	target station info
54  *
55  * Do all necessary hardware setting for connected.
56  *
57  * Return RTW_PHL_STATUS_SUCCESS for success, otherwise fail.
58  */
59 enum rtw_phl_status rtw_phl_connected(void *phl,
60 				      struct rtw_wifi_role_t *wrole,
61 				      struct rtw_phl_stainfo_t *sta);
62 
63 #ifdef CONFIG_STA_CMD_DISPR
64 enum rtw_phl_status rtw_phl_disconnect(void *phl,
65 				       struct rtw_wifi_role_t *wrole,
66 				       bool is_disconnect);
67 #else
68 enum rtw_phl_status rtw_phl_disconnect_prepare(void *phl,
69 					struct rtw_wifi_role_t *wrole);
70 enum rtw_phl_status rtw_phl_disconnect(void *phl,
71 				       struct rtw_wifi_role_t *wrole);
72 #endif
73 
74 enum rtw_phl_status rtw_phl_ap_start_prepare(void *phl,
75 				      struct rtw_wifi_role_t *wrole);
76 enum rtw_phl_status rtw_phl_ap_started(void *phl,
77 				      struct rtw_wifi_role_t *wrole);
78 enum rtw_phl_status rtw_phl_ap_stop_prepare(void *phl,
79 					struct rtw_wifi_role_t *wrole);
80 enum rtw_phl_status rtw_phl_ap_stop(void *phl,
81 				      struct rtw_wifi_role_t *wrole);
82 
83 enum rtw_phl_status rtw_phl_ibss_started(void *phl,
84 				      struct rtw_wifi_role_t *wrole);
85 
86 enum rtw_phl_status
87 rtw_phl_disconnected_resume_hdlr(void *phl,
88 				struct rtw_wifi_role_t *wrole);
89 
90 enum rtw_phl_status
91 rtw_phl_ap_stop_resume_hdlr(void *phl,
92 				struct rtw_wifi_role_t *wrole);
93 
94 #ifdef RTW_WKARD_P2P_LISTEN
95 enum rtw_phl_status rtw_phl_p2p_listen_start(void *phl, struct rtw_wifi_role_t *wrole);
96 
97 enum rtw_phl_status rtw_phl_p2p_listen_end(void *phl, struct rtw_wifi_role_t *wrole);
98 #endif /* RTW_WKARD_P2P_LISTEN */
99 
100 #endif /* _PHL_CONNECT_H_ */
101