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