WiFi: add rtl8189es/etv support, Optimization wifi configuration.
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8189es / 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 #define RECV_BLK_SZ 512
24 #define RECV_BLK_CNT 16
25 #define RECV_BLK_TH RECV_BLK_CNT
26
27 #if defined(CONFIG_USB_HCI)
28
29 #ifdef PLATFORM_OS_CE
30 #define MAX_RECVBUF_SZ (8192+1024) // 8K+1k
31 #else
32         #ifndef CONFIG_MINIMAL_MEMORY_USAGE
33                 //#define MAX_RECVBUF_SZ (32768) // 32k
34                 //#define MAX_RECVBUF_SZ (16384) //16K
35                 //#define MAX_RECVBUF_SZ (10240) //10K
36                 #ifdef CONFIG_PLATFORM_MSTAR
37                         #define MAX_RECVBUF_SZ (8192) // 8K
38                 #else
39                         #define MAX_RECVBUF_SZ (15360) // 15k < 16k
40                 #endif
41                 //#define MAX_RECVBUF_SZ (8192+1024) // 8K+1k
42         #else
43                 #define MAX_RECVBUF_SZ (4000) // about 4K
44         #endif
45 #endif
46
47 #elif defined(CONFIG_PCI_HCI)
48 //#ifndef CONFIG_MINIMAL_MEMORY_USAGE
49 //      #define MAX_RECVBUF_SZ (9100)
50 //#else
51         #define MAX_RECVBUF_SZ (4000) // about 4K
52 //#endif
53
54
55 #elif defined(CONFIG_SDIO_HCI)
56
57 #define MAX_RECVBUF_SZ (10240)
58
59 #endif
60
61
62
63 struct phy_stat
64 {
65         unsigned int phydw0;
66
67         unsigned int phydw1;
68
69         unsigned int phydw2;
70
71         unsigned int phydw3;
72
73         unsigned int phydw4;
74
75         unsigned int phydw5;
76
77         unsigned int phydw6;
78
79         unsigned int phydw7;
80 };
81
82 // Rx smooth factor
83 #define Rx_Smooth_Factor (20)
84
85
86 #ifdef CONFIG_USB_HCI
87 typedef struct _INTERRUPT_MSG_FORMAT_EX{
88         unsigned int C2H_MSG0;
89         unsigned int C2H_MSG1;
90         unsigned int C2H_MSG2;
91         unsigned int C2H_MSG3;
92         unsigned int HISR; // from HISR Reg0x124, read to clear
93         unsigned int HISRE;// from HISRE Reg0x12c, read to clear
94         unsigned int  MSG_EX;
95 }INTERRUPT_MSG_FORMAT_EX,*PINTERRUPT_MSG_FORMAT_EX;
96
97 void rtl8192cu_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf);
98 int     rtl8192cu_init_recv_priv(_adapter * padapter);
99 void rtl8192cu_free_recv_priv(_adapter * padapter);
100 #endif
101
102 #ifdef CONFIG_PCI_HCI
103 int     rtl8192ce_init_recv_priv(_adapter * padapter);
104 void rtl8192ce_free_recv_priv(_adapter * padapter);
105 #endif
106
107 void rtl8192c_translate_rx_signal_stuff(union recv_frame *precvframe, struct phy_stat *pphy_status);
108 void rtl8192c_query_rx_desc_status(union recv_frame *precvframe, struct recv_stat *pdesc);
109
110 #endif
111