xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rtl8723bs/include/rtl8703b_recv.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2017 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 __RTL8703B_RECV_H__
16 #define __RTL8703B_RECV_H__
17 
18 #define RECV_BLK_SZ 512
19 #define RECV_BLK_CNT 16
20 #define RECV_BLK_TH RECV_BLK_CNT
21 
22 #if defined(CONFIG_USB_HCI)
23 
24 	#ifndef MAX_RECVBUF_SZ
25 		#ifdef PLATFORM_OS_CE
26 			#define MAX_RECVBUF_SZ (8192+1024) /* 8K+1k */
27 		#else
28 			#ifndef CONFIG_MINIMAL_MEMORY_USAGE
29 				/* #define MAX_RECVBUF_SZ (32768) */ /* 32k */
30 				/* #define MAX_RECVBUF_SZ (16384) */ /* 16K */
31 				/* #define MAX_RECVBUF_SZ (10240) */ /* 10K */
32 				#ifdef CONFIG_PLATFORM_MSTAR
33 					#define MAX_RECVBUF_SZ (8192) /* 8K */
34 				#else
35 					#define MAX_RECVBUF_SZ (15360) /* 15k < 16k */
36 				#endif
37 				/* #define MAX_RECVBUF_SZ (8192+1024) */ /* 8K+1k */
38 			#else
39 				#define MAX_RECVBUF_SZ (4000) /* about 4K */
40 			#endif
41 		#endif
42 	#endif /* !MAX_RECVBUF_SZ */
43 
44 #elif defined(CONFIG_PCI_HCI)
45 	/* #ifndef CONFIG_MINIMAL_MEMORY_USAGE */
46 	/*	#define MAX_RECVBUF_SZ (9100) */
47 	/* #else */
48 	#define MAX_RECVBUF_SZ (4000) /* about 4K
49 	* #endif */
50 
51 
52 #elif defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
53 
54 	#define MAX_RECVBUF_SZ (RX_DMA_SIZE_8703B - RX_DMA_RESERVED_SIZE_8703B)
55 
56 #endif
57 
58 /* Rx smooth factor */
59 #define	Rx_Smooth_Factor (20)
60 
61 #ifdef CONFIG_SDIO_HCI
62 	#ifndef CONFIG_SDIO_RX_COPY
63 		#undef MAX_RECVBUF_SZ
64 		#define MAX_RECVBUF_SZ	(RX_DMA_SIZE_8703B - RX_DMA_RESERVED_SIZE_8703B)
65 	#endif /* !CONFIG_SDIO_RX_COPY */
66 #endif /* CONFIG_SDIO_HCI */
67 
68 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
69 	s32 rtl8703bs_init_recv_priv(PADAPTER padapter);
70 	void rtl8703bs_free_recv_priv(PADAPTER padapter);
71 #endif
72 
73 #ifdef CONFIG_USB_HCI
74 	int rtl8703bu_init_recv_priv(_adapter *padapter);
75 	void rtl8703bu_free_recv_priv(_adapter *padapter);
76 	void rtl8703bu_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf);
77 #endif
78 
79 #ifdef CONFIG_PCI_HCI
80 	s32 rtl8703be_init_recv_priv(PADAPTER padapter);
81 	void rtl8703be_free_recv_priv(PADAPTER padapter);
82 #endif
83 
84 void rtl8703b_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc);
85 
86 #endif /* __RTL8703B_RECV_H__ */
87