blob: f922ac49b70eb503fbb19e53d1d6bc9066f62a46 [file] [log] [blame]
Stephen Hemmingerf8942e02010-09-08 14:46:36 -07001#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.
Kevin McKinney2b9866f2012-11-25 19:28:43 -05009 */
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070010
Kevin McKinney9d8b6592012-11-25 19:28:42 -050011#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
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070019#define MIBS_IP_LENGTH_OF_ADDRESS 4
Kevin McKinney9d8b6592012-11-25 19:28:42 -050020#define MIBS_MAX_HIST_ENTRIES 12
21#define MIBS_PKTSIZEHIST_RANGE 128
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070022
Kevin McKinney0aaad652012-11-25 19:29:03 -050023union bcm_mibs_ip_addr {
Kevin McKinneyaf2bdce2012-11-25 19:28:44 -050024 struct {
Kevin McKinney2b9866f2012-11-25 19:28:43 -050025 /* Source Ip Address Range */
Kevin McKinney73a8ff02012-11-25 19:28:47 -050026 unsigned long ulIpv4Addr[MIBS_MAX_IP_RANGE_LENGTH];
Kevin McKinney2b9866f2012-11-25 19:28:43 -050027 /* Source Ip Mask Address Range */
Kevin McKinney73a8ff02012-11-25 19:28:47 -050028 unsigned long ulIpv4Mask[MIBS_MAX_IP_RANGE_LENGTH];
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070029 };
Kevin McKinneyaf2bdce2012-11-25 19:28:44 -050030 struct {
Kevin McKinney2b9866f2012-11-25 19:28:43 -050031 /* Source Ip Address Range */
Kevin McKinney73a8ff02012-11-25 19:28:47 -050032 unsigned long ulIpv6Addr[MIBS_MAX_IP_RANGE_LENGTH * 4];
Kevin McKinney2b9866f2012-11-25 19:28:43 -050033 /* Source Ip Mask Address Range */
Kevin McKinney73a8ff02012-11-25 19:28:47 -050034 unsigned long ulIpv6Mask[MIBS_MAX_IP_RANGE_LENGTH * 4];
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070035 };
Kevin McKinneyaf2bdce2012-11-25 19:28:44 -050036 struct {
Kevin McKinney57353c02012-11-25 19:28:45 -050037 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];
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070039 };
Kevin McKinneyaf2bdce2012-11-25 19:28:44 -050040 struct {
Kevin McKinney57353c02012-11-25 19:28:45 -050041 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];
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070043 };
Kevin McKinney0aaad652012-11-25 19:29:03 -050044};
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070045
Kevin McKinney86758b72012-11-25 19:29:02 -050046struct bcm_mibs_host_info {
Kevin McKinney27aaa422012-11-25 19:28:46 -050047 u64 GoodTransmits;
48 u64 GoodReceives;
Kevin McKinney2b9866f2012-11-25 19:28:43 -050049 /* this to keep track of the Tx and Rx MailBox Registers. */
Kevin McKinney73a8ff02012-11-25 19:28:47 -050050 unsigned long NumDesUsed;
51 unsigned long CurrNumFreeDesc;
52 unsigned long PrevNumFreeDesc;
Kevin McKinney2b9866f2012-11-25 19:28:43 -050053 /* to keep track the no of byte received */
Kevin McKinney73a8ff02012-11-25 19:28:47 -050054 unsigned long PrevNumRcevBytes;
55 unsigned long CurrNumRcevBytes;
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070056 /* QOS Related */
Kevin McKinney73a8ff02012-11-25 19:28:47 -050057 unsigned long BEBucketSize;
58 unsigned long rtPSBucketSize;
59 unsigned long LastTxQueueIndex;
Kevin McKinney86d82c92012-11-25 19:28:54 -050060 bool TxOutofDescriptors;
61 bool TimerActive;
Kevin McKinneyb770f422012-11-25 19:28:49 -050062 u32 u32TotalDSD;
63 u32 aTxPktSizeHist[MIBS_MAX_HIST_ENTRIES];
64 u32 aRxPktSizeHist[MIBS_MAX_HIST_ENTRIES];
Kevin McKinney86758b72012-11-25 19:29:02 -050065};
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070066
Kevin McKinney4aca2842012-11-25 19:29:01 -050067struct bcm_mibs_classifier_rule {
Kevin McKinney73a8ff02012-11-25 19:28:47 -050068 unsigned long ulSFID;
Kevin McKinney57353c02012-11-25 19:28:45 -050069 unsigned char ucReserved[2];
Kevin McKinney2fb99f8b2012-11-25 19:28:50 -050070 u16 uiClassifierRuleIndex;
Kevin McKinney86d82c92012-11-25 19:28:54 -050071 bool bUsed;
Kevin McKinney7d5691e2012-11-25 19:28:53 -050072 unsigned short usVCID_Value;
Kevin McKinney8830fd02012-11-25 19:28:51 -050073 u8 u8ClassifierRulePriority;
Kevin McKinney0aaad652012-11-25 19:29:03 -050074 union bcm_mibs_ip_addr stSrcIpAddress;
Kevin McKinney2b9866f2012-11-25 19:28:43 -050075 /* IP Source Address Length */
Kevin McKinney57353c02012-11-25 19:28:45 -050076 unsigned char ucIPSourceAddressLength;
Kevin McKinney0aaad652012-11-25 19:29:03 -050077 union bcm_mibs_ip_addr stDestIpAddress;
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070078 /* IP Destination Address Length */
Kevin McKinney57353c02012-11-25 19:28:45 -050079 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];
Kevin McKinney7d5691e2012-11-25 19:28:53 -050086 unsigned short usSrcPortRangeLo[MIBS_MAX_PORT_RANGE];
87 unsigned short usSrcPortRangeHi[MIBS_MAX_PORT_RANGE];
Kevin McKinney57353c02012-11-25 19:28:45 -050088 unsigned char ucSrcPortRangeLength;
Kevin McKinney7d5691e2012-11-25 19:28:53 -050089 unsigned short usDestPortRangeLo[MIBS_MAX_PORT_RANGE];
90 unsigned short usDestPortRangeHi[MIBS_MAX_PORT_RANGE];
Kevin McKinney57353c02012-11-25 19:28:45 -050091 unsigned char ucDestPortRangeLength;
Kevin McKinney86d82c92012-11-25 19:28:54 -050092 bool bProtocolValid;
93 bool bTOSValid;
94 bool bDestIpValid;
95 bool bSrcIpValid;
Kevin McKinney57353c02012-11-25 19:28:45 -050096 unsigned char ucDirection;
Kevin McKinney86d82c92012-11-25 19:28:54 -050097 bool bIpv6Protocol;
Kevin McKinneyb770f422012-11-25 19:28:49 -050098 u32 u32PHSRuleID;
Kevin McKinney4aca2842012-11-25 19:29:01 -050099};
Stephen Hemmingerf8942e02010-09-08 14:46:36 -0700100
Kevin McKinney8a885ae2012-11-25 19:29:00 -0500101struct bcm_mibs_phs_rule {
Kevin McKinney73a8ff02012-11-25 19:28:47 -0500102 unsigned long ulSFID;
Kevin McKinney8830fd02012-11-25 19:28:51 -0500103 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];
Kevin McKinney381874c2012-11-25 19:28:48 -0500111 long PHSModifiedBytes;
Kevin McKinney73a8ff02012-11-25 19:28:47 -0500112 unsigned long PHSModifiedNumPackets;
113 unsigned long PHSErrorNumPackets;
Kevin McKinney8a885ae2012-11-25 19:29:00 -0500114};
Stephen Hemmingerf8942e02010-09-08 14:46:36 -0700115
Kevin McKinney8c7d51a2012-11-25 19:28:59 -0500116struct bcm_mibs_parameters {
Kevin McKinneyb770f422012-11-25 19:28:49 -0500117 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;
Kevin McKinney8c7d51a2012-11-25 19:28:59 -0500138};
Stephen Hemmingerf8942e02010-09-08 14:46:36 -0700139
Kevin McKinneyba738b42012-11-25 19:28:58 -0500140struct bcm_mibs_table {
Kevin McKinney73a8ff02012-11-25 19:28:47 -0500141 unsigned long ulSFID;
Kevin McKinney7d5691e2012-11-25 19:28:53 -0500142 unsigned short usVCID_Value;
Kevin McKinney36e0ae22012-11-25 19:28:52 -0500143 unsigned int uiThreshold;
Kevin McKinney8830fd02012-11-25 19:28:51 -0500144 u8 u8TrafficPriority;
Kevin McKinney86d82c92012-11-25 19:28:54 -0500145 bool bValid;
146 bool bActive;
147 bool bActivateRequestSent;
Kevin McKinney8830fd02012-11-25 19:28:51 -0500148 u8 u8QueueType;
Kevin McKinney36e0ae22012-11-25 19:28:52 -0500149 unsigned int uiMaxBucketSize;
150 unsigned int uiCurrentQueueDepthOnTarget;
151 unsigned int uiCurrentBytesOnHost;
152 unsigned int uiCurrentPacketsOnHost;
153 unsigned int uiDroppedCountBytes;
154 unsigned int uiDroppedCountPackets;
155 unsigned int uiSentBytes;
156 unsigned int uiSentPackets;
157 unsigned int uiCurrentDrainRate;
158 unsigned int uiThisPeriodSentBytes;
Kevin McKinney2a4d3a22012-11-25 19:28:55 -0500159 u64 liDrainCalculated;
Kevin McKinney36e0ae22012-11-25 19:28:52 -0500160 unsigned int uiCurrentTokenCount;
Kevin McKinney2a4d3a22012-11-25 19:28:55 -0500161 u64 liLastUpdateTokenAt;
Kevin McKinney36e0ae22012-11-25 19:28:52 -0500162 unsigned int uiMaxAllowedRate;
163 unsigned int NumOfPacketsSent;
Kevin McKinney57353c02012-11-25 19:28:45 -0500164 unsigned char ucDirection;
Kevin McKinney7d5691e2012-11-25 19:28:53 -0500165 unsigned short usCID;
Kevin McKinney8c7d51a2012-11-25 19:28:59 -0500166 struct bcm_mibs_parameters stMibsExtServiceFlowTable;
Kevin McKinney36e0ae22012-11-25 19:28:52 -0500167 unsigned int uiCurrentRxRate;
168 unsigned int uiThisPeriodRxBytes;
169 unsigned int uiTotalRxBytes;
170 unsigned int uiTotalTxBytes;
Kevin McKinneyba738b42012-11-25 19:28:58 -0500171};
Stephen Hemmingerf8942e02010-09-08 14:46:36 -0700172
Kevin McKinney2790a3c2012-11-25 19:28:57 -0500173struct bcm_mibs_dropped_cntrl_msg {
Kevin McKinney73a8ff02012-11-25 19:28:47 -0500174 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;
Kevin McKinney2790a3c2012-11-25 19:28:57 -0500182};
Stephen Hemmingerf8942e02010-09-08 14:46:36 -0700183
Kevin McKinney954f91d2012-11-25 19:28:56 -0500184struct bcm_host_stats_mibs {
Kevin McKinney86758b72012-11-25 19:29:02 -0500185 struct bcm_mibs_host_info stHostInfo;
Kevin McKinney4aca2842012-11-25 19:29:01 -0500186 struct bcm_mibs_classifier_rule astClassifierTable[MIBS_MAX_CLASSIFIERS];
Kevin McKinneyba738b42012-11-25 19:28:58 -0500187 struct bcm_mibs_table astSFtable[MIBS_MAX_SERVICEFLOWS];
Kevin McKinney8a885ae2012-11-25 19:29:00 -0500188 struct bcm_mibs_phs_rule astPhsRulesTable[MIBS_MAX_PHSRULES];
Kevin McKinney2790a3c2012-11-25 19:28:57 -0500189 struct bcm_mibs_dropped_cntrl_msg stDroppedAppCntrlMsgs;
Kevin McKinney954f91d2012-11-25 19:28:56 -0500190};
Kevin McKinney9d8b6592012-11-25 19:28:42 -0500191
Stephen Hemmingerf8942e02010-09-08 14:46:36 -0700192#endif