xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8852be/phl/phl_api_drv.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /******************************************************************************
2*4882a593Smuzhiyun  *
3*4882a593Smuzhiyun  * Copyright(c) 2019 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_API_DRV_H_
16*4882a593Smuzhiyun #define _PHL_API_DRV_H_
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun void *rtw_phl_get_txbd_buf(struct rtw_phl_com_t *phl_com);
19*4882a593Smuzhiyun void *rtw_phl_get_rxbd_buf(struct rtw_phl_com_t *phl_com);
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun /**
22*4882a593Smuzhiyun  * rtw_phl_query_h2c_pkt - provide h2c buffer for halmac
23*4882a593Smuzhiyun  * @phl_com: see struct rtw_phl_com_t
24*4882a593Smuzhiyun  * @type: the type of h2c buf
25*4882a593Smuzhiyun  *
26*4882a593Smuzhiyun  * returns struct rtw_h2c_pkt*
27*4882a593Smuzhiyun  */
28*4882a593Smuzhiyun struct rtw_h2c_pkt *rtw_phl_query_h2c_pkt(struct rtw_phl_com_t *phl_com,
29*4882a593Smuzhiyun 										  enum rtw_h2c_pkt_type type);
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun /**
32*4882a593Smuzhiyun  * rtw_phl_pltfm_tx - h2c platform transmit
33*4882a593Smuzhiyun  * @phl_com: see struct rtw_phl_com_t
34*4882a593Smuzhiyun  * @pkt: the h2c pkt
35*4882a593Smuzhiyun  *
36*4882a593Smuzhiyun  * returns enum RTW_PHL_STATUS
37*4882a593Smuzhiyun  */
38*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_pltfm_tx(struct rtw_phl_com_t *phl_com,
39*4882a593Smuzhiyun 									 struct rtw_h2c_pkt *pkt);
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_msg_hub_hal_send(struct rtw_phl_com_t *phl_com,
42*4882a593Smuzhiyun 						struct phl_msg_attribute* attr, struct phl_msg* msg);
43*4882a593Smuzhiyun 
44*4882a593Smuzhiyun struct rtw_phl_stainfo_t *
45*4882a593Smuzhiyun rtw_phl_get_stainfo_self(void *phl, struct rtw_wifi_role_t *wrole);
46*4882a593Smuzhiyun struct rtw_phl_stainfo_t *
47*4882a593Smuzhiyun rtw_phl_get_stainfo_by_macid(void *phl, u16 macid);
48*4882a593Smuzhiyun 
49*4882a593Smuzhiyun 
50*4882a593Smuzhiyun /* For hal wow use */
51*4882a593Smuzhiyun void rtw_phl_pkt_ofld_reset_all_entry(struct rtw_phl_com_t *phl_com);
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun 
54*4882a593Smuzhiyun bool rtw_phl_query_regulation_info(void *phl, struct rtw_regulation_info *info);
55*4882a593Smuzhiyun 
56*4882a593Smuzhiyun enum band_type rtw_phl_get_band_type(u8 chan);
57*4882a593Smuzhiyun u8 rtw_phl_get_center_ch(u8 ch,
58*4882a593Smuzhiyun 	enum channel_width bw, enum chan_offset offset);
59*4882a593Smuzhiyun 
60*4882a593Smuzhiyun bool rtw_phl_btc_send_cmd(struct rtw_phl_com_t *phl_com,
61*4882a593Smuzhiyun 				u8 *buf, u32 len, u16 ev_id);
62*4882a593Smuzhiyun 
63*4882a593Smuzhiyun #ifdef CONFIG_PHL_CHANNEL_INFO
64*4882a593Smuzhiyun /* Channel info queue operation*/
65*4882a593Smuzhiyun u32 rtw_phl_get_chaninfo_idle_number(void *drvpriv, struct rtw_phl_com_t *phl_com);
66*4882a593Smuzhiyun u32 rtw_phl_get_chaninfo_busy_number(void *drvpriv, struct rtw_phl_com_t *phl_com);
67*4882a593Smuzhiyun struct chan_info_t *rtw_phl_query_idle_chaninfo(void *drvpriv, struct rtw_phl_com_t *phl_com);
68*4882a593Smuzhiyun 
69*4882a593Smuzhiyun struct chan_info_t *rtw_phl_query_busy_chaninfo(void *drvpriv, struct rtw_phl_com_t *phl_com);
70*4882a593Smuzhiyun 
71*4882a593Smuzhiyun struct chan_info_t *rtw_phl_query_busy_chaninfo_latest(void *drvpriv, struct rtw_phl_com_t *phl_com);
72*4882a593Smuzhiyun 
73*4882a593Smuzhiyun void rtw_phl_enqueue_idle_chaninfo(void *drvpriv, struct rtw_phl_com_t *phl_com,
74*4882a593Smuzhiyun 				struct chan_info_t *chan_info_pkt);
75*4882a593Smuzhiyun 
76*4882a593Smuzhiyun struct chan_info_t * rtw_phl_recycle_busy_chaninfo(void *drvpriv, struct rtw_phl_com_t *phl_com,
77*4882a593Smuzhiyun 				struct chan_info_t *chan_info_pkt);
78*4882a593Smuzhiyun #endif /* CONFIG_PHL_CHANNEL_INFO */
79*4882a593Smuzhiyun 
80*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_ser_l2_notify(struct rtw_phl_com_t *phl_com);
81*4882a593Smuzhiyun 
82*4882a593Smuzhiyun struct rtw_wifi_role_t *
83*4882a593Smuzhiyun rtw_phl_get_wrole_by_ridx(struct rtw_phl_com_t *phl_com, u8 rold_idx);
84*4882a593Smuzhiyun 
85*4882a593Smuzhiyun #ifdef CONFIG_CMD_DISP
86*4882a593Smuzhiyun enum rtw_phl_status
87*4882a593Smuzhiyun rtw_phl_cmd_notify(struct rtw_phl_com_t *phl_com,
88*4882a593Smuzhiyun                    enum phl_msg_evt_id event,
89*4882a593Smuzhiyun                    void *hal_cmd,
90*4882a593Smuzhiyun                    u8 hw_idx);
91*4882a593Smuzhiyun #endif /* CONFIG_CMD_DISP */
92*4882a593Smuzhiyun 
93*4882a593Smuzhiyun enum rtw_phl_status phl_ps_hal_pwr_req(struct rtw_phl_com_t *phl_com, u8 src, bool pwr_req);
94*4882a593Smuzhiyun 
95*4882a593Smuzhiyun #endif /* _PHL_API_DRV_H_ */
96*4882a593Smuzhiyun 
97