Staging: bcm: Replace B_UINT8 with u8 in HostMIBSInterface.h
[cascardo/linux.git] / drivers / staging / bcm / HostMIBSInterface.h
1 #ifndef _HOST_MIBSINTERFACE_H
2 #define _HOST_MIBSINTERFACE_H
3
4 /*
5  * Copyright (c) 2007 Beceem Communications Pvt. Ltd
6  * File Name: HostMIBSInterface.h
7  * Abstract: This file contains DS used by the Host to update the Host
8  * statistics used for the MIBS.
9  */
10
11 #define MIBS_MAX_CLASSIFIERS            100
12 #define MIBS_MAX_PHSRULES               100
13 #define MIBS_MAX_SERVICEFLOWS           17
14 #define MIBS_MAX_IP_RANGE_LENGTH        4
15 #define MIBS_MAX_PORT_RANGE             4
16 #define MIBS_MAX_PROTOCOL_LENGTH        32
17 #define MIBS_MAX_PHS_LENGTHS            255
18 #define MIBS_IPV6_ADDRESS_SIZEINBYTES   0x10
19 #define MIBS_IP_LENGTH_OF_ADDRESS       4
20 #define MIBS_MAX_HIST_ENTRIES           12
21 #define MIBS_PKTSIZEHIST_RANGE          128
22
23 typedef union _U_MIBS_IP_ADDRESS {
24         struct {
25                 /* Source Ip Address Range */
26                 unsigned long ulIpv4Addr[MIBS_MAX_IP_RANGE_LENGTH];
27                 /* Source Ip Mask Address Range */
28                 unsigned long ulIpv4Mask[MIBS_MAX_IP_RANGE_LENGTH];
29         };
30         struct {
31                 /* Source Ip Address Range */
32                 unsigned long ulIpv6Addr[MIBS_MAX_IP_RANGE_LENGTH * 4];
33                 /* Source Ip Mask Address Range */
34                 unsigned long ulIpv6Mask[MIBS_MAX_IP_RANGE_LENGTH * 4];
35         };
36         struct {
37                 unsigned char ucIpv4Address[MIBS_MAX_IP_RANGE_LENGTH * MIBS_IP_LENGTH_OF_ADDRESS];
38                 unsigned char ucIpv4Mask[MIBS_MAX_IP_RANGE_LENGTH * MIBS_IP_LENGTH_OF_ADDRESS];
39         };
40         struct {
41                 unsigned char ucIpv6Address[MIBS_MAX_IP_RANGE_LENGTH * MIBS_IPV6_ADDRESS_SIZEINBYTES];
42                 unsigned char ucIpv6Mask[MIBS_MAX_IP_RANGE_LENGTH * MIBS_IPV6_ADDRESS_SIZEINBYTES];
43         };
44 } U_MIBS_IP_ADDRESS;
45
46 typedef struct _S_MIBS_HOST_INFO {
47         u64     GoodTransmits;
48         u64     GoodReceives;
49         /* this to keep track of the Tx and Rx MailBox Registers. */
50         unsigned long   NumDesUsed;
51         unsigned long   CurrNumFreeDesc;
52         unsigned long   PrevNumFreeDesc;
53         /* to keep track the no of byte received */
54         unsigned long   PrevNumRcevBytes;
55         unsigned long   CurrNumRcevBytes;
56         /* QOS Related */
57         unsigned long   BEBucketSize;
58         unsigned long   rtPSBucketSize;
59         unsigned long   LastTxQueueIndex;
60         BOOLEAN TxOutofDescriptors;
61         BOOLEAN TimerActive;
62         u32     u32TotalDSD;
63         u32     aTxPktSizeHist[MIBS_MAX_HIST_ENTRIES];
64         u32     aRxPktSizeHist[MIBS_MAX_HIST_ENTRIES];
65 } S_MIBS_HOST_INFO;
66
67 typedef struct _S_MIBS_CLASSIFIER_RULE {
68         unsigned long   ulSFID;
69         unsigned char   ucReserved[2];
70         u16     uiClassifierRuleIndex;
71         BOOLEAN bUsed;
72         USHORT  usVCID_Value;
73         u8      u8ClassifierRulePriority;
74         U_MIBS_IP_ADDRESS stSrcIpAddress;
75         /* IP Source Address Length */
76         unsigned char   ucIPSourceAddressLength;
77         U_MIBS_IP_ADDRESS stDestIpAddress;
78         /* IP Destination Address Length */
79         unsigned char   ucIPDestinationAddressLength;
80         unsigned char   ucIPTypeOfServiceLength;
81         unsigned char   ucTosLow;
82         unsigned char   ucTosHigh;
83         unsigned char   ucTosMask;
84         unsigned char   ucProtocolLength;
85         unsigned char   ucProtocol[MIBS_MAX_PROTOCOL_LENGTH];
86         USHORT  usSrcPortRangeLo[MIBS_MAX_PORT_RANGE];
87         USHORT  usSrcPortRangeHi[MIBS_MAX_PORT_RANGE];
88         unsigned char   ucSrcPortRangeLength;
89         USHORT  usDestPortRangeLo[MIBS_MAX_PORT_RANGE];
90         USHORT  usDestPortRangeHi[MIBS_MAX_PORT_RANGE];
91         unsigned char   ucDestPortRangeLength;
92         BOOLEAN bProtocolValid;
93         BOOLEAN bTOSValid;
94         BOOLEAN bDestIpValid;
95         BOOLEAN bSrcIpValid;
96         unsigned char   ucDirection;
97         BOOLEAN bIpv6Protocol;
98         u32     u32PHSRuleID;
99 } S_MIBS_CLASSIFIER_RULE;
100
101 typedef struct _S_MIBS_PHS_RULE {
102         unsigned long   ulSFID;
103         u8      u8PHSI;
104         u8      u8PHSFLength;
105         u8      u8PHSF[MIBS_MAX_PHS_LENGTHS];
106         u8      u8PHSMLength;
107         u8      u8PHSM[MIBS_MAX_PHS_LENGTHS];
108         u8      u8PHSS;
109         u8      u8PHSV;
110         u8      reserved[5];
111         long    PHSModifiedBytes;
112         unsigned long   PHSModifiedNumPackets;
113         unsigned long   PHSErrorNumPackets;
114 } S_MIBS_PHS_RULE;
115
116 typedef struct _S_MIBS_EXTSERVICEFLOW_PARAMETERS {
117         u32 wmanIfSfid;
118         u32 wmanIfCmnCpsSfState;
119         u32 wmanIfCmnCpsMaxSustainedRate;
120         u32 wmanIfCmnCpsMaxTrafficBurst;
121         u32 wmanIfCmnCpsMinReservedRate;
122         u32 wmanIfCmnCpsToleratedJitter;
123         u32 wmanIfCmnCpsMaxLatency;
124         u32 wmanIfCmnCpsFixedVsVariableSduInd;
125         u32 wmanIfCmnCpsSduSize;
126         u32 wmanIfCmnCpsSfSchedulingType;
127         u32 wmanIfCmnCpsArqEnable;
128         u32 wmanIfCmnCpsArqWindowSize;
129         u32 wmanIfCmnCpsArqBlockLifetime;
130         u32 wmanIfCmnCpsArqSyncLossTimeout;
131         u32 wmanIfCmnCpsArqDeliverInOrder;
132         u32 wmanIfCmnCpsArqRxPurgeTimeout;
133         u32 wmanIfCmnCpsArqBlockSize;
134         u32 wmanIfCmnCpsMinRsvdTolerableRate;
135         u32 wmanIfCmnCpsReqTxPolicy;
136         u32 wmanIfCmnSfCsSpecification;
137         u32 wmanIfCmnCpsTargetSaid;
138 } S_MIBS_EXTSERVICEFLOW_PARAMETERS;
139
140 typedef struct _S_MIBS_SERVICEFLOW_TABLE {
141         unsigned long   ulSFID;
142         USHORT  usVCID_Value;
143         UINT    uiThreshold;
144         u8      u8TrafficPriority;
145         BOOLEAN bValid;
146         BOOLEAN bActive;
147         BOOLEAN bActivateRequestSent;
148         u8      u8QueueType;
149         UINT    uiMaxBucketSize;
150         UINT    uiCurrentQueueDepthOnTarget;
151         UINT    uiCurrentBytesOnHost;
152         UINT    uiCurrentPacketsOnHost;
153         UINT    uiDroppedCountBytes;
154         UINT    uiDroppedCountPackets;
155         UINT    uiSentBytes;
156         UINT    uiSentPackets;
157         UINT    uiCurrentDrainRate;
158         UINT    uiThisPeriodSentBytes;
159         LARGE_INTEGER   liDrainCalculated;
160         UINT    uiCurrentTokenCount;
161         LARGE_INTEGER   liLastUpdateTokenAt;
162         UINT    uiMaxAllowedRate;
163         UINT    NumOfPacketsSent;
164         unsigned char ucDirection;
165         USHORT  usCID;
166         S_MIBS_EXTSERVICEFLOW_PARAMETERS stMibsExtServiceFlowTable;
167         UINT    uiCurrentRxRate;
168         UINT    uiThisPeriodRxBytes;
169         UINT    uiTotalRxBytes;
170         UINT    uiTotalTxBytes;
171 } S_MIBS_SERVICEFLOW_TABLE;
172
173 typedef struct _S_MIBS_DROPPED_APP_CNTRL_MESSAGES {
174         unsigned long cm_responses;
175         unsigned long cm_control_newdsx_multiclassifier_resp;
176         unsigned long link_control_resp;
177         unsigned long status_rsp;
178         unsigned long stats_pointer_resp;
179         unsigned long idle_mode_status;
180         unsigned long auth_ss_host_msg;
181         unsigned long low_priority_message;
182 } S_MIBS_DROPPED_APP_CNTRL_MESSAGES;
183
184 typedef struct _S_MIBS_HOST_STATS_MIBS {
185         S_MIBS_HOST_INFO        stHostInfo;
186         S_MIBS_CLASSIFIER_RULE  astClassifierTable[MIBS_MAX_CLASSIFIERS];
187         S_MIBS_SERVICEFLOW_TABLE astSFtable[MIBS_MAX_SERVICEFLOWS];
188         S_MIBS_PHS_RULE         astPhsRulesTable[MIBS_MAX_PHSRULES];
189         S_MIBS_DROPPED_APP_CNTRL_MESSAGES stDroppedAppCntrlMsgs;
190 } S_MIBS_HOST_STATS_MIBS;
191
192 #endif