staging: rtl8192e: Remove dead code
[firefly-linux-kernel-4.4.55.git] / drivers / staging / rtl8192e / rtl819x_Qos.h
1 /******************************************************************************
2  * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
3  *
4  * This program is distributed in the hope that it will be useful, but WITHOUT
5  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
7  * more details.
8  *
9  * You should have received a copy of the GNU General Public License along with
10  * this program; if not, write to the Free Software Foundation, Inc.,
11  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
12  *
13  * The full GNU General Public License is included in this distribution in the
14  * file called LICENSE.
15  *
16  * Contact Information:
17  * wlanfae <wlanfae@realtek.com>
18 ******************************************************************************/
19 #ifndef __INC_QOS_TYPE_H
20 #define __INC_QOS_TYPE_H
21
22 #define BIT0                0x00000001
23 #define BIT1                0x00000002
24 #define BIT2                0x00000004
25 #define BIT3                0x00000008
26 #define BIT4                0x00000010
27 #define BIT5                0x00000020
28 #define BIT6                0x00000040
29 #define BIT7                0x00000080
30 #define BIT8                0x00000100
31 #define BIT9                0x00000200
32 #define BIT10              0x00000400
33 #define BIT11              0x00000800
34 #define BIT12              0x00001000
35 #define BIT13              0x00002000
36 #define BIT14              0x00004000
37 #define BIT15              0x00008000
38 #define BIT16              0x00010000
39 #define BIT17              0x00020000
40 #define BIT18              0x00040000
41 #define BIT19              0x00080000
42 #define BIT20              0x00100000
43 #define BIT21              0x00200000
44 #define BIT22              0x00400000
45 #define BIT23              0x00800000
46 #define BIT24              0x01000000
47 #define BIT25              0x02000000
48 #define BIT26              0x04000000
49 #define BIT27              0x08000000
50 #define BIT28              0x10000000
51 #define BIT29              0x20000000
52 #define BIT30              0x40000000
53 #define BIT31              0x80000000
54
55 union qos_tsinfo {
56         u8              charData[3];
57         struct {
58                 u8              ucTrafficType:1;
59                 u8              ucTSID:4;
60                 u8              ucDirection:2;
61                 u8              ucAccessPolicy:2;
62                 u8              ucAggregation:1;
63                 u8              ucPSB:1;
64                 u8              ucUP:3;
65                 u8              ucTSInfoAckPolicy:2;
66                 u8              ucSchedule:1;
67                 u8              ucReserved:7;
68         } field;
69 };
70
71 union tspec_body {
72         u8              charData[55];
73
74         struct {
75                 union qos_tsinfo TSInfo;
76                 u16     NominalMSDUsize;
77                 u16     MaxMSDUsize;
78                 u32     MinServiceItv;
79                 u32     MaxServiceItv;
80                 u32     InactivityItv;
81                 u32     SuspenItv;
82                 u32     ServiceStartTime;
83                 u32     MinDataRate;
84                 u32     MeanDataRate;
85                 u32     PeakDataRate;
86                 u32     MaxBurstSize;
87                 u32     DelayBound;
88                 u32     MinPhyRate;
89                 u16     SurplusBandwidthAllowance;
90                 u16     MediumTime;
91         } f;
92 };
93
94 struct octet_string {
95         u8 *Octet;
96         u16 Length;
97 };
98
99 enum ack_policy {
100         eAckPlc0_ACK            = 0x00,
101         eAckPlc1_NoACK          = 0x01,
102 };
103
104 #define AC0_BE  0
105 #define AC1_BK  1
106 #define AC2_VI  2
107 #define AC3_VO  3
108 #define AC_MAX  4
109
110 enum direction_value {
111         DIR_UP                  = 0,
112         DIR_DOWN                = 1,
113         DIR_DIRECT              = 2,
114         DIR_BI_DIR              = 3,
115 };
116
117 enum acm_method {
118         eAcmWay0_SwAndHw                = 0,
119         eAcmWay1_HW                     = 1,
120         eAcmWay2_SW                     = 2,
121 };
122
123
124 struct acm {
125         u64             UsedTime;
126         u64             MediumTime;
127         u8              HwAcmCtl;
128 };
129
130 union qos_tclas {
131
132         struct _TYPE_GENERAL {
133                 u8              Priority;
134                 u8              ClassifierType;
135                 u8              Mask;
136         } TYPE_GENERAL;
137
138         struct _TYPE0_ETH {
139                 u8              Priority;
140                 u8              ClassifierType;
141                 u8              Mask;
142                 u8              SrcAddr[ETH_ALEN];
143                 u8              DstAddr[ETH_ALEN];
144                 u16             Type;
145         } TYPE0_ETH;
146
147         struct _TYPE1_IPV4 {
148                 u8              Priority;
149                 u8              ClassifierType;
150                 u8              Mask;
151                 u8              Version;
152                 u8              SrcIP[4];
153                 u8              DstIP[4];
154                 u16             SrcPort;
155                 u16             DstPort;
156                 u8              DSCP;
157                 u8              Protocol;
158                 u8              Reserved;
159         } TYPE1_IPV4;
160
161         struct _TYPE1_IPV6 {
162                 u8              Priority;
163                 u8              ClassifierType;
164                 u8              Mask;
165                 u8              Version;
166                 u8              SrcIP[16];
167                 u8              DstIP[16];
168                 u16             SrcPort;
169                 u16             DstPort;
170                 u8              FlowLabel[3];
171         } TYPE1_IPV6;
172
173         struct _TYPE2_8021Q {
174                 u8              Priority;
175                 u8              ClassifierType;
176                 u8              Mask;
177                 u16             TagType;
178         } TYPE2_8021Q;
179 };
180
181 #define IsACValid(ac)           ((ac >= 0 && ac <= 7) ? true : false)
182
183
184 union aci_aifsn {
185         u8      charData;
186
187         struct {
188                 u8      AIFSN:4;
189                 u8      acm:1;
190                 u8      ACI:2;
191                 u8      Reserved:1;
192         } f;
193 };
194
195 #endif