add rk3288 pinctrl dts code
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rtl8723au / include / rtl8192c_recv.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17  *
18  *
19  ******************************************************************************/
20 #ifndef _RTL8192C_RECV_H_
21 #define _RTL8192C_RECV_H_
22
23 #include <drv_conf.h>
24 #include <osdep_service.h>
25 #include <drv_types.h>
26
27
28 #ifdef PLATFORM_OS_XP
29         #define NR_RECVBUFF (16)
30 #elif defined(PLATFORM_OS_CE)
31         #define NR_RECVBUFF (4)
32 #else
33
34         #if defined(CONFIG_GSPI_HCI)
35                 #define NR_RECVBUFF (32)
36         #elif defined(CONFIG_SDIO_HCI)
37                 #define NR_RECVBUFF (8) 
38         #else
39         #ifdef CONFIG_SINGLE_RECV_BUF
40                 #define NR_RECVBUFF (1)
41         #else
42                 #define NR_RECVBUFF (4)
43         #endif //CONFIG_SINGLE_RECV_BUF
44         #endif
45
46         #define NR_PREALLOC_RECV_SKB (8)
47 #endif
48
49
50 #define RECV_BLK_SZ 512
51 #define RECV_BLK_CNT 16
52 #define RECV_BLK_TH RECV_BLK_CNT
53
54 #if defined(CONFIG_USB_HCI)
55
56 #ifdef PLATFORM_OS_CE
57 #define MAX_RECVBUF_SZ (8192+1024) // 8K+1k
58 #else
59         #ifndef CONFIG_MINIMAL_MEMORY_USAGE
60                 //#define MAX_RECVBUF_SZ (32768) // 32k
61                 //#define MAX_RECVBUF_SZ (16384) //16K
62                 //#define MAX_RECVBUF_SZ (10240) //10K
63                 #ifdef CONFIG_PLATFORM_MSTAR
64                         #define MAX_RECVBUF_SZ (8192) // 8K
65                 #else
66                 #define MAX_RECVBUF_SZ (15360) // 15k < 16k
67                 #endif
68                 //#define MAX_RECVBUF_SZ (8192+1024) // 8K+1k
69         #else
70                 #define MAX_RECVBUF_SZ (4000) // about 4K
71         #endif
72 #endif
73
74 #elif defined(CONFIG_PCI_HCI)
75 //#ifndef CONFIG_MINIMAL_MEMORY_USAGE
76 //      #define MAX_RECVBUF_SZ (9100)
77 //#else
78         #define MAX_RECVBUF_SZ (4000) // about 4K
79 //#endif
80
81 #define RX_MPDU_QUEUE                           0
82 #define RX_CMD_QUEUE                            1
83 #define RX_MAX_QUEUE                            2
84
85 #elif defined(CONFIG_SDIO_HCI)
86
87 #define MAX_RECVBUF_SZ (10240)
88
89 #endif
90
91
92 #define RECV_BULK_IN_ADDR               0x80
93 #define RECV_INT_IN_ADDR                0x81
94
95 #define PHY_RSSI_SLID_WIN_MAX                           100
96 #define PHY_LINKQUALITY_SLID_WIN_MAX            20
97
98
99 struct phy_stat
100 {
101         unsigned int phydw0;
102
103         unsigned int phydw1;
104
105         unsigned int phydw2;
106
107         unsigned int phydw3;
108
109         unsigned int phydw4;
110
111         unsigned int phydw5;
112
113         unsigned int phydw6;
114
115         unsigned int phydw7;
116 };
117
118 // Rx smooth factor
119 #define Rx_Smooth_Factor (20)
120
121
122 #ifdef CONFIG_USB_HCI
123 typedef struct _INTERRUPT_MSG_FORMAT_EX{
124         unsigned int C2H_MSG0;
125         unsigned int C2H_MSG1;
126         unsigned int C2H_MSG2;
127         unsigned int C2H_MSG3;
128         unsigned int HISR; // from HISR Reg0x124, read to clear
129         unsigned int HISRE;// from HISRE Reg0x12c, read to clear
130         unsigned int  MSG_EX;
131 }INTERRUPT_MSG_FORMAT_EX,*PINTERRUPT_MSG_FORMAT_EX;
132
133 void rtl8192cu_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf);
134 int     rtl8192cu_init_recv_priv(_adapter * padapter);
135 void rtl8192cu_free_recv_priv(_adapter * padapter);
136 #endif
137
138 #ifdef CONFIG_PCI_HCI
139 int     rtl8192ce_init_recv_priv(_adapter * padapter);
140 void rtl8192ce_free_recv_priv(_adapter * padapter);
141 #endif
142
143 void rtl8192c_translate_rx_signal_stuff(union recv_frame *precvframe, struct phy_stat *pphy_status);
144 void rtl8192c_query_rx_desc_status(union recv_frame *precvframe, struct recv_stat *pdesc);
145
146 #endif
147