xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8852be/phl/phl_connect.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /******************************************************************************
2*4882a593Smuzhiyun  *
3*4882a593Smuzhiyun  * Copyright(c) 2020 Realtek Corporation.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * This program is free software; you can redistribute it and/or modify it
6*4882a593Smuzhiyun  * under the terms of version 2 of the GNU General Public License as
7*4882a593Smuzhiyun  * published by the Free Software Foundation.
8*4882a593Smuzhiyun  *
9*4882a593Smuzhiyun  * This program is distributed in the hope that it will be useful, but WITHOUT
10*4882a593Smuzhiyun  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11*4882a593Smuzhiyun  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12*4882a593Smuzhiyun  * more details.
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  *****************************************************************************/
15*4882a593Smuzhiyun #ifndef _PHL_CONNECT_H_
16*4882a593Smuzhiyun #define _PHL_CONNECT_H_
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun /**
19*4882a593Smuzhiyun  * rtw_phl_connect_prepare() - Prepare hardware setting for connecting
20*4882a593Smuzhiyun  * @phl:	struct phl_info_t *
21*4882a593Smuzhiyun  * @wrole:	struct rtw_wifi_role_t *
22*4882a593Smuzhiyun  * @addr:	target mac address
23*4882a593Smuzhiyun  *
24*4882a593Smuzhiyun  * Do all necessary hardware setting for connecting.
25*4882a593Smuzhiyun  *
26*4882a593Smuzhiyun  * Return RTW_PHL_STATUS_SUCCESS for success, otherwise fail.
27*4882a593Smuzhiyun  */
28*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_connect_prepare(void *phl,
29*4882a593Smuzhiyun 					    struct rtw_wifi_role_t *wrole,
30*4882a593Smuzhiyun 					    u8 *addr);
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun /**
33*4882a593Smuzhiyun  * rtw_phl_connect_linked() - update media status
34*4882a593Smuzhiyun  * @phl:	struct phl_info_t *
35*4882a593Smuzhiyun  * @wrole:	struct rtw_wifi_role_t *
36*4882a593Smuzhiyun  * @sta:	struct rtw_phl_stainfo_t *
37*4882a593Smuzhiyun  * @sta_addr:	target mac address
38*4882a593Smuzhiyun  *
39*4882a593Smuzhiyun  * Do all necessary hardware setting for linked.
40*4882a593Smuzhiyun  *
41*4882a593Smuzhiyun  * Return RTW_PHL_STATUS_SUCCESS for success, otherwise fail.
42*4882a593Smuzhiyun  */
43*4882a593Smuzhiyun enum rtw_phl_status
44*4882a593Smuzhiyun rtw_phl_connect_linked(void *phl,
45*4882a593Smuzhiyun                        struct rtw_wifi_role_t *wrole,
46*4882a593Smuzhiyun                        struct rtw_phl_stainfo_t *sta,
47*4882a593Smuzhiyun                        u8 *sta_addr);
48*4882a593Smuzhiyun 
49*4882a593Smuzhiyun /**
50*4882a593Smuzhiyun  * rtw_phl_connected() - Config hardware setting for connected
51*4882a593Smuzhiyun  * @phl:	struct phl_info_t *
52*4882a593Smuzhiyun  * @wrole:	struct rtw_wifi_role_t *
53*4882a593Smuzhiyun  * @sta:	target station info
54*4882a593Smuzhiyun  *
55*4882a593Smuzhiyun  * Do all necessary hardware setting for connected.
56*4882a593Smuzhiyun  *
57*4882a593Smuzhiyun  * Return RTW_PHL_STATUS_SUCCESS for success, otherwise fail.
58*4882a593Smuzhiyun  */
59*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_connected(void *phl,
60*4882a593Smuzhiyun 				      struct rtw_wifi_role_t *wrole,
61*4882a593Smuzhiyun 				      struct rtw_phl_stainfo_t *sta);
62*4882a593Smuzhiyun 
63*4882a593Smuzhiyun #ifdef CONFIG_STA_CMD_DISPR
64*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_disconnect(void *phl,
65*4882a593Smuzhiyun 				       struct rtw_wifi_role_t *wrole,
66*4882a593Smuzhiyun 				       bool is_disconnect);
67*4882a593Smuzhiyun #else
68*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_disconnect_prepare(void *phl,
69*4882a593Smuzhiyun 					struct rtw_wifi_role_t *wrole);
70*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_disconnect(void *phl,
71*4882a593Smuzhiyun 				       struct rtw_wifi_role_t *wrole);
72*4882a593Smuzhiyun #endif
73*4882a593Smuzhiyun 
74*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_ap_start_prepare(void *phl,
75*4882a593Smuzhiyun 				      struct rtw_wifi_role_t *wrole);
76*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_ap_started(void *phl,
77*4882a593Smuzhiyun 				      struct rtw_wifi_role_t *wrole);
78*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_ap_stop_prepare(void *phl,
79*4882a593Smuzhiyun 					struct rtw_wifi_role_t *wrole);
80*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_ap_stop(void *phl,
81*4882a593Smuzhiyun 				      struct rtw_wifi_role_t *wrole);
82*4882a593Smuzhiyun 
83*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_ibss_started(void *phl,
84*4882a593Smuzhiyun 				      struct rtw_wifi_role_t *wrole);
85*4882a593Smuzhiyun 
86*4882a593Smuzhiyun enum rtw_phl_status
87*4882a593Smuzhiyun rtw_phl_disconnected_resume_hdlr(void *phl,
88*4882a593Smuzhiyun 				struct rtw_wifi_role_t *wrole);
89*4882a593Smuzhiyun 
90*4882a593Smuzhiyun enum rtw_phl_status
91*4882a593Smuzhiyun rtw_phl_ap_stop_resume_hdlr(void *phl,
92*4882a593Smuzhiyun 				struct rtw_wifi_role_t *wrole);
93*4882a593Smuzhiyun 
94*4882a593Smuzhiyun #ifdef RTW_WKARD_P2P_LISTEN
95*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_p2p_listen_start(void *phl, struct rtw_wifi_role_t *wrole);
96*4882a593Smuzhiyun 
97*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_p2p_listen_end(void *phl, struct rtw_wifi_role_t *wrole);
98*4882a593Smuzhiyun #endif /* RTW_WKARD_P2P_LISTEN */
99*4882a593Smuzhiyun 
100*4882a593Smuzhiyun #endif /* _PHL_CONNECT_H_ */
101