xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8852bs/phl/phl_rx.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_RX_H_
16 #define _PHL_RX_H_
17 
18 struct phl_rx_pkt_pool {
19 	struct rtw_phl_rx_pkt phl_rx[MAX_PHL_RING_RX_PKT_NUM];
20 	_os_list idle;
21 	_os_list busy;
22 	_os_lock idle_lock;	/* spinlock */
23 	_os_lock busy_lock;	/* spinlock */
24 	u32 idle_cnt;
25 };
26 
27 enum rtw_phl_status phl_rx_init(struct phl_info_t *phl_info);
28 void phl_rx_deinit(struct phl_info_t *phl_info);
29 
30 u8 phl_check_recv_ring_resource(struct phl_info_t *phl_info);
31 struct rtw_phl_rx_pkt *rtw_phl_query_phl_rx(void *phl);
32 u8 rtw_phl_is_phl_rx_idle(struct phl_info_t *phl_info);
33 void phl_release_phl_rx(struct phl_info_t *phl_info,
34 			struct rtw_phl_rx_pkt *phl_rx);
35 enum rtw_phl_status phl_rx_reorder(struct phl_info_t *phl_info,
36                                    struct rtw_phl_rx_pkt *phl_rx,
37                                    _os_list *frames);
38 void phl_rx_deinit(struct phl_info_t *phl_info);
39 void phl_recycle_rx_buf(struct phl_info_t *phl_info,
40 				struct rtw_phl_rx_pkt *phl_rx);
41 void phl_event_indicator(void *context);
42 
43 enum rtw_phl_status rtw_phl_start_rx_process(void *phl);
44 
45 
46 void _phl_indic_new_rxpkt(struct phl_info_t *phl_info);
47 
48 void
49 phl_handle_rx_frame_list(struct phl_info_t *phl_info,
50                          _os_list *frames);
51 void phl_sta_rx_reorder_timer_expired(void *t);
52 void phl_rx_traffic_upd(struct rtw_stats *sts);
53 void phl_rx_watchdog(struct phl_info_t *phl_info);
54 
55 #ifdef CONFIG_PHL_RX_PSTS_PER_PKT
56 enum rtw_phl_status
57 phl_rx_proc_phy_sts(struct phl_info_t *phl_info, struct rtw_phl_rx_pkt *ppdu_sts);
58 bool
59 phl_rx_proc_wait_phy_sts(struct phl_info_t *phl_info,
60 			 struct rtw_phl_rx_pkt *phl_rx);
61 #endif
62 
63 void phl_rx_proc_ppdu_sts(struct phl_info_t *phl_info,
64 			  struct rtw_phl_rx_pkt *phl_rx);
65 void phl_reset_rx_stats(struct rtw_stats *stats);
66 void phl_dump_all_sta_rx_info(struct phl_info_t *phl_info);
67 u16 rtw_phl_query_new_rx_num(void *phl);
68 void phl_rx_dbg_dump(struct phl_info_t *phl_info, u8 band_idx);
69 
70 #endif /*_PHL_RX_H_*/
71