1 
2 
3 #ifndef _HOST_MIBSINTERFACE_H
4 #define _HOST_MIBSINTERFACE_H
5 
6 /*
7  * Copyright (c) 2007 Beceem Communications Pvt. Ltd
8  * File Name: HostMIBSInterface.h
9  * Abstract: This file contains DS used by the Host to update the Host
10  * statistics used for the MIBS.
11  */
12 
13 #define MIBS_MAX_CLASSIFIERS 100
14 #define MIBS_MAX_PHSRULES 100
15 #define MIBS_MAX_SERVICEFLOWS 17
16 #define MIBS_MAX_IP_RANGE_LENGTH 4
17 #define MIBS_MAX_PORT_RANGE 4
18 #define MIBS_MAX_PROTOCOL_LENGTH   32
19 #define MIBS_MAX_PHS_LENGTHS	 255
20 #define MIBS_IPV6_ADDRESS_SIZEINBYTES 0x10
21 #define MIBS_IP_LENGTH_OF_ADDRESS	4
22 #define MIBS_MAX_HIST_ENTRIES 12
23 #define MIBS_PKTSIZEHIST_RANGE 128
24 
25 typedef union _U_MIBS_IP_ADDRESS
26 {
27     struct
28 	{
29 		//Source Ip Address Range
30 		ULONG		ulIpv4Addr[MIBS_MAX_IP_RANGE_LENGTH];
31 		//Source Ip Mask Address Range
32 		ULONG       ulIpv4Mask[MIBS_MAX_IP_RANGE_LENGTH];
33 	};
34 	struct
35 	{
36 		//Source Ip Address Range
37 		ULONG		ulIpv6Addr[MIBS_MAX_IP_RANGE_LENGTH * 4];
38 		//Source Ip Mask Address Range
39 		ULONG       ulIpv6Mask[MIBS_MAX_IP_RANGE_LENGTH * 4];
40 
41 	};
42 	struct
43 	{
44 		UCHAR		ucIpv4Address[MIBS_MAX_IP_RANGE_LENGTH *
45 									MIBS_IP_LENGTH_OF_ADDRESS];
46 		UCHAR		ucIpv4Mask[MIBS_MAX_IP_RANGE_LENGTH *
47 									MIBS_IP_LENGTH_OF_ADDRESS];
48 	};
49 	struct
50 	{
51 		UCHAR		ucIpv6Address[MIBS_MAX_IP_RANGE_LENGTH * MIBS_IPV6_ADDRESS_SIZEINBYTES];
52 		UCHAR		ucIpv6Mask[MIBS_MAX_IP_RANGE_LENGTH * MIBS_IPV6_ADDRESS_SIZEINBYTES];
53 	};
54 }U_MIBS_IP_ADDRESS;
55 
56 
57 typedef struct _S_MIBS_HOST_INFO
58 {
59 	ULONG64			GoodTransmits;
60 	ULONG64			GoodReceives;
61 	// this to keep track of the Tx and Rx MailBox Registers.
62 	ULONG			NumDesUsed;
63 	ULONG			CurrNumFreeDesc;
64 	ULONG			PrevNumFreeDesc;
65 	// to keep track the no of byte received
66 	ULONG			PrevNumRcevBytes;
67 	ULONG			CurrNumRcevBytes;
68 
69 	/* QOS Related */
70 	ULONG			BEBucketSize;
71 	ULONG			rtPSBucketSize;
72 	ULONG			LastTxQueueIndex;
73 	BOOLEAN			TxOutofDescriptors;
74 	BOOLEAN			TimerActive;
75 	UINT32			u32TotalDSD;
76 	UINT32			aTxPktSizeHist[MIBS_MAX_HIST_ENTRIES];
77 	UINT32			aRxPktSizeHist[MIBS_MAX_HIST_ENTRIES];
78 }S_MIBS_HOST_INFO;
79 
80 typedef struct _S_MIBS_CLASSIFIER_RULE
81 {
82 	ULONG				ulSFID;
83 	UCHAR               ucReserved[2];
84 	B_UINT16            uiClassifierRuleIndex;
85 	BOOLEAN				bUsed;
86 	USHORT				usVCID_Value;
87 	// This field detemines the Classifier Priority
88 	B_UINT8             u8ClassifierRulePriority;
89 	U_MIBS_IP_ADDRESS   stSrcIpAddress;
90 	/*IP Source Address Length*/
91 	UCHAR               ucIPSourceAddressLength;
92 
93 	U_MIBS_IP_ADDRESS   stDestIpAddress;
94 	/* IP Destination Address Length */
95 	UCHAR               ucIPDestinationAddressLength;
96 	UCHAR               ucIPTypeOfServiceLength;//Type of service Length
97 	UCHAR               ucTosLow;//Tos Low
98 	UCHAR               ucTosHigh;//Tos High
99 	UCHAR               ucTosMask;//Tos Mask
100 	UCHAR               ucProtocolLength;//protocol Length
101 	UCHAR               ucProtocol[MIBS_MAX_PROTOCOL_LENGTH];//protocol Length
102 	USHORT				usSrcPortRangeLo[MIBS_MAX_PORT_RANGE];
103 	USHORT				usSrcPortRangeHi[MIBS_MAX_PORT_RANGE];
104 	UCHAR               ucSrcPortRangeLength;
105 	USHORT				usDestPortRangeLo[MIBS_MAX_PORT_RANGE];
106 	USHORT				usDestPortRangeHi[MIBS_MAX_PORT_RANGE];
107 	UCHAR               ucDestPortRangeLength;
108 	BOOLEAN				bProtocolValid;
109 	BOOLEAN				bTOSValid;
110 	BOOLEAN				bDestIpValid;
111 	BOOLEAN				bSrcIpValid;
112 	UCHAR				ucDirection;
113 	BOOLEAN             bIpv6Protocol;
114 	UINT32              u32PHSRuleID;
115 }S_MIBS_CLASSIFIER_RULE;
116 
117 
118 typedef struct _S_MIBS_PHS_RULE
119 {
120 	ULONG		ulSFID;
121 	/// brief 8bit PHSI Of The Service Flow
122 	B_UINT8     u8PHSI;
123 	/// brief PHSF Of The Service Flow
124 	B_UINT8     u8PHSFLength;
125 	B_UINT8     u8PHSF[MIBS_MAX_PHS_LENGTHS];
126 	/// brief PHSM Of The Service Flow
127 	B_UINT8     u8PHSMLength;
128 	B_UINT8     u8PHSM[MIBS_MAX_PHS_LENGTHS];
129 	/// brief 8bit PHSS Of The Service Flow
130 	B_UINT8     u8PHSS;
131 	/// brief 8bit PHSV Of The Service Flow
132 	B_UINT8     u8PHSV;
133 	// Reserved bytes are 5, so that it is similar to S_PHS_RULE structure.
134 	B_UINT8	    reserved[5];
135 
136 	LONG	    PHSModifiedBytes;
137 	ULONG	    PHSModifiedNumPackets;
138 	ULONG		PHSErrorNumPackets;
139 }S_MIBS_PHS_RULE;
140 
141 typedef struct _S_MIBS_EXTSERVICEFLOW_PARAMETERS
142 {
143 	UINT32 		wmanIfSfid;
144 	UINT32 		wmanIfCmnCpsSfState;
145 	UINT32 		wmanIfCmnCpsMaxSustainedRate;
146 	UINT32 		wmanIfCmnCpsMaxTrafficBurst;
147 	UINT32 		wmanIfCmnCpsMinReservedRate;
148 	UINT32 		wmanIfCmnCpsToleratedJitter;
149 	UINT32 		wmanIfCmnCpsMaxLatency;
150 	UINT32 		wmanIfCmnCpsFixedVsVariableSduInd;
151 	UINT32 		wmanIfCmnCpsSduSize;
152 	UINT32 		wmanIfCmnCpsSfSchedulingType;
153 	UINT32 		wmanIfCmnCpsArqEnable;
154 	UINT32 		wmanIfCmnCpsArqWindowSize;
155 	UINT32 		wmanIfCmnCpsArqBlockLifetime;
156 	UINT32 		wmanIfCmnCpsArqSyncLossTimeout;
157 	UINT32 		wmanIfCmnCpsArqDeliverInOrder;
158 	UINT32 		wmanIfCmnCpsArqRxPurgeTimeout;
159 	UINT32 		wmanIfCmnCpsArqBlockSize;
160 	UINT32 		wmanIfCmnCpsMinRsvdTolerableRate;
161 	UINT32 		wmanIfCmnCpsReqTxPolicy;
162 	UINT32 		wmanIfCmnSfCsSpecification;
163 	UINT32 		wmanIfCmnCpsTargetSaid;
164 
165 }S_MIBS_EXTSERVICEFLOW_PARAMETERS;
166 
167 
168 typedef struct _S_MIBS_SERVICEFLOW_TABLE
169 {
170 	 //classification extension Rule
171 	ULONG		ulSFID;
172     USHORT		usVCID_Value;
173 	UINT		uiThreshold;
174 	// This field determines the priority of the SF Queues
175 	B_UINT8     u8TrafficPriority;
176 
177 	BOOLEAN		bValid;
178    	BOOLEAN     bActive;
179 	BOOLEAN		bActivateRequestSent;
180 	//BE or rtPS
181 	B_UINT8		u8QueueType;
182 	//maximum size of the bucket for the queue
183 	UINT		uiMaxBucketSize;
184 	UINT		uiCurrentQueueDepthOnTarget;
185 	UINT		uiCurrentBytesOnHost;
186 	UINT		uiCurrentPacketsOnHost;
187 	UINT		uiDroppedCountBytes;
188 	UINT		uiDroppedCountPackets;
189 	UINT		uiSentBytes;
190 	UINT		uiSentPackets;
191 	UINT		uiCurrentDrainRate;
192 	UINT		uiThisPeriodSentBytes;
193 	LARGE_INTEGER	liDrainCalculated;
194 	UINT		uiCurrentTokenCount;
195 	LARGE_INTEGER	liLastUpdateTokenAt;
196 	UINT		uiMaxAllowedRate;
197 	UINT        NumOfPacketsSent;
198 	UCHAR		ucDirection;
199 	USHORT		usCID;
200 	S_MIBS_EXTSERVICEFLOW_PARAMETERS	stMibsExtServiceFlowTable;
201 	UINT		uiCurrentRxRate;
202 	UINT		uiThisPeriodRxBytes;
203 	UINT		uiTotalRxBytes;
204 	UINT		uiTotalTxBytes;
205 }S_MIBS_SERVICEFLOW_TABLE;
206 
207 typedef struct _S_MIBS_DROPPED_APP_CNTRL_MESSAGES
208 {
209 	ULONG cm_responses;
210 	ULONG cm_control_newdsx_multiclassifier_resp;
211 	ULONG link_control_resp;
212 	ULONG status_rsp;
213 	ULONG stats_pointer_resp;
214 	ULONG idle_mode_status;
215 	ULONG auth_ss_host_msg;
216 	ULONG low_priority_message;
217 
218 }S_MIBS_DROPPED_APP_CNTRL_MESSAGES;
219 
220 typedef struct _S_MIBS_HOST_STATS_MIBS
221 {
222 	S_MIBS_HOST_INFO				stHostInfo;
223 	S_MIBS_CLASSIFIER_RULE			astClassifierTable[MIBS_MAX_CLASSIFIERS];
224 	S_MIBS_SERVICEFLOW_TABLE		astSFtable[MIBS_MAX_SERVICEFLOWS];
225 	S_MIBS_PHS_RULE                 astPhsRulesTable[MIBS_MAX_PHSRULES];
226 	S_MIBS_DROPPED_APP_CNTRL_MESSAGES	stDroppedAppCntrlMsgs;
227 }S_MIBS_HOST_STATS_MIBS;
228 #endif
229 
230 
231