Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 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. |
Kevin McKinney | 2b9866f | 2012-11-25 19:28:43 -0500 | [diff] [blame] | 9 | */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 10 | |
Kevin McKinney | 9d8b659 | 2012-11-25 19:28:42 -0500 | [diff] [blame] | 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 |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 19 | #define MIBS_IP_LENGTH_OF_ADDRESS 4 |
Kevin McKinney | 9d8b659 | 2012-11-25 19:28:42 -0500 | [diff] [blame] | 20 | #define MIBS_MAX_HIST_ENTRIES 12 |
| 21 | #define MIBS_PKTSIZEHIST_RANGE 128 |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 22 | |
Kevin McKinney | 0aaad65 | 2012-11-25 19:29:03 -0500 | [diff] [blame] | 23 | union bcm_mibs_ip_addr { |
Kevin McKinney | af2bdce | 2012-11-25 19:28:44 -0500 | [diff] [blame] | 24 | struct { |
Kevin McKinney | 2b9866f | 2012-11-25 19:28:43 -0500 | [diff] [blame] | 25 | /* Source Ip Address Range */ |
Kevin McKinney | 73a8ff0 | 2012-11-25 19:28:47 -0500 | [diff] [blame] | 26 | unsigned long ulIpv4Addr[MIBS_MAX_IP_RANGE_LENGTH]; |
Kevin McKinney | 2b9866f | 2012-11-25 19:28:43 -0500 | [diff] [blame] | 27 | /* Source Ip Mask Address Range */ |
Kevin McKinney | 73a8ff0 | 2012-11-25 19:28:47 -0500 | [diff] [blame] | 28 | unsigned long ulIpv4Mask[MIBS_MAX_IP_RANGE_LENGTH]; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 29 | }; |
Kevin McKinney | af2bdce | 2012-11-25 19:28:44 -0500 | [diff] [blame] | 30 | struct { |
Kevin McKinney | 2b9866f | 2012-11-25 19:28:43 -0500 | [diff] [blame] | 31 | /* Source Ip Address Range */ |
Kevin McKinney | 73a8ff0 | 2012-11-25 19:28:47 -0500 | [diff] [blame] | 32 | unsigned long ulIpv6Addr[MIBS_MAX_IP_RANGE_LENGTH * 4]; |
Kevin McKinney | 2b9866f | 2012-11-25 19:28:43 -0500 | [diff] [blame] | 33 | /* Source Ip Mask Address Range */ |
Kevin McKinney | 73a8ff0 | 2012-11-25 19:28:47 -0500 | [diff] [blame] | 34 | unsigned long ulIpv6Mask[MIBS_MAX_IP_RANGE_LENGTH * 4]; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 35 | }; |
Kevin McKinney | af2bdce | 2012-11-25 19:28:44 -0500 | [diff] [blame] | 36 | struct { |
Kevin McKinney | 57353c0 | 2012-11-25 19:28:45 -0500 | [diff] [blame] | 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]; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 39 | }; |
Kevin McKinney | af2bdce | 2012-11-25 19:28:44 -0500 | [diff] [blame] | 40 | struct { |
Kevin McKinney | 57353c0 | 2012-11-25 19:28:45 -0500 | [diff] [blame] | 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]; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 43 | }; |
Kevin McKinney | 0aaad65 | 2012-11-25 19:29:03 -0500 | [diff] [blame] | 44 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 45 | |
Kevin McKinney | 86758b7 | 2012-11-25 19:29:02 -0500 | [diff] [blame] | 46 | struct bcm_mibs_host_info { |
Kevin McKinney | 27aaa42 | 2012-11-25 19:28:46 -0500 | [diff] [blame] | 47 | u64 GoodTransmits; |
| 48 | u64 GoodReceives; |
Kevin McKinney | 2b9866f | 2012-11-25 19:28:43 -0500 | [diff] [blame] | 49 | /* this to keep track of the Tx and Rx MailBox Registers. */ |
Kevin McKinney | 73a8ff0 | 2012-11-25 19:28:47 -0500 | [diff] [blame] | 50 | unsigned long NumDesUsed; |
| 51 | unsigned long CurrNumFreeDesc; |
| 52 | unsigned long PrevNumFreeDesc; |
Kevin McKinney | 2b9866f | 2012-11-25 19:28:43 -0500 | [diff] [blame] | 53 | /* to keep track the no of byte received */ |
Kevin McKinney | 73a8ff0 | 2012-11-25 19:28:47 -0500 | [diff] [blame] | 54 | unsigned long PrevNumRcevBytes; |
| 55 | unsigned long CurrNumRcevBytes; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 56 | /* QOS Related */ |
Kevin McKinney | 73a8ff0 | 2012-11-25 19:28:47 -0500 | [diff] [blame] | 57 | unsigned long BEBucketSize; |
| 58 | unsigned long rtPSBucketSize; |
| 59 | unsigned long LastTxQueueIndex; |
Kevin McKinney | 86d82c9 | 2012-11-25 19:28:54 -0500 | [diff] [blame] | 60 | bool TxOutofDescriptors; |
| 61 | bool TimerActive; |
Kevin McKinney | b770f42 | 2012-11-25 19:28:49 -0500 | [diff] [blame] | 62 | u32 u32TotalDSD; |
| 63 | u32 aTxPktSizeHist[MIBS_MAX_HIST_ENTRIES]; |
| 64 | u32 aRxPktSizeHist[MIBS_MAX_HIST_ENTRIES]; |
Kevin McKinney | 86758b7 | 2012-11-25 19:29:02 -0500 | [diff] [blame] | 65 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 66 | |
Kevin McKinney | 4aca284 | 2012-11-25 19:29:01 -0500 | [diff] [blame] | 67 | struct bcm_mibs_classifier_rule { |
Kevin McKinney | 73a8ff0 | 2012-11-25 19:28:47 -0500 | [diff] [blame] | 68 | unsigned long ulSFID; |
Kevin McKinney | 57353c0 | 2012-11-25 19:28:45 -0500 | [diff] [blame] | 69 | unsigned char ucReserved[2]; |
Kevin McKinney | 2fb99f8b | 2012-11-25 19:28:50 -0500 | [diff] [blame] | 70 | u16 uiClassifierRuleIndex; |
Kevin McKinney | 86d82c9 | 2012-11-25 19:28:54 -0500 | [diff] [blame] | 71 | bool bUsed; |
Kevin McKinney | 7d5691e | 2012-11-25 19:28:53 -0500 | [diff] [blame] | 72 | unsigned short usVCID_Value; |
Kevin McKinney | 8830fd0 | 2012-11-25 19:28:51 -0500 | [diff] [blame] | 73 | u8 u8ClassifierRulePriority; |
Kevin McKinney | 0aaad65 | 2012-11-25 19:29:03 -0500 | [diff] [blame] | 74 | union bcm_mibs_ip_addr stSrcIpAddress; |
Kevin McKinney | 2b9866f | 2012-11-25 19:28:43 -0500 | [diff] [blame] | 75 | /* IP Source Address Length */ |
Kevin McKinney | 57353c0 | 2012-11-25 19:28:45 -0500 | [diff] [blame] | 76 | unsigned char ucIPSourceAddressLength; |
Kevin McKinney | 0aaad65 | 2012-11-25 19:29:03 -0500 | [diff] [blame] | 77 | union bcm_mibs_ip_addr stDestIpAddress; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 78 | /* IP Destination Address Length */ |
Kevin McKinney | 57353c0 | 2012-11-25 19:28:45 -0500 | [diff] [blame] | 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]; |
Kevin McKinney | 7d5691e | 2012-11-25 19:28:53 -0500 | [diff] [blame] | 86 | unsigned short usSrcPortRangeLo[MIBS_MAX_PORT_RANGE]; |
| 87 | unsigned short usSrcPortRangeHi[MIBS_MAX_PORT_RANGE]; |
Kevin McKinney | 57353c0 | 2012-11-25 19:28:45 -0500 | [diff] [blame] | 88 | unsigned char ucSrcPortRangeLength; |
Kevin McKinney | 7d5691e | 2012-11-25 19:28:53 -0500 | [diff] [blame] | 89 | unsigned short usDestPortRangeLo[MIBS_MAX_PORT_RANGE]; |
| 90 | unsigned short usDestPortRangeHi[MIBS_MAX_PORT_RANGE]; |
Kevin McKinney | 57353c0 | 2012-11-25 19:28:45 -0500 | [diff] [blame] | 91 | unsigned char ucDestPortRangeLength; |
Kevin McKinney | 86d82c9 | 2012-11-25 19:28:54 -0500 | [diff] [blame] | 92 | bool bProtocolValid; |
| 93 | bool bTOSValid; |
| 94 | bool bDestIpValid; |
| 95 | bool bSrcIpValid; |
Kevin McKinney | 57353c0 | 2012-11-25 19:28:45 -0500 | [diff] [blame] | 96 | unsigned char ucDirection; |
Kevin McKinney | 86d82c9 | 2012-11-25 19:28:54 -0500 | [diff] [blame] | 97 | bool bIpv6Protocol; |
Kevin McKinney | b770f42 | 2012-11-25 19:28:49 -0500 | [diff] [blame] | 98 | u32 u32PHSRuleID; |
Kevin McKinney | 4aca284 | 2012-11-25 19:29:01 -0500 | [diff] [blame] | 99 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 100 | |
Kevin McKinney | 8a885ae | 2012-11-25 19:29:00 -0500 | [diff] [blame] | 101 | struct bcm_mibs_phs_rule { |
Kevin McKinney | 73a8ff0 | 2012-11-25 19:28:47 -0500 | [diff] [blame] | 102 | unsigned long ulSFID; |
Kevin McKinney | 8830fd0 | 2012-11-25 19:28:51 -0500 | [diff] [blame] | 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]; |
Kevin McKinney | 381874c | 2012-11-25 19:28:48 -0500 | [diff] [blame] | 111 | long PHSModifiedBytes; |
Kevin McKinney | 73a8ff0 | 2012-11-25 19:28:47 -0500 | [diff] [blame] | 112 | unsigned long PHSModifiedNumPackets; |
| 113 | unsigned long PHSErrorNumPackets; |
Kevin McKinney | 8a885ae | 2012-11-25 19:29:00 -0500 | [diff] [blame] | 114 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 115 | |
Kevin McKinney | 8c7d51a | 2012-11-25 19:28:59 -0500 | [diff] [blame] | 116 | struct bcm_mibs_parameters { |
Kevin McKinney | b770f42 | 2012-11-25 19:28:49 -0500 | [diff] [blame] | 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; |
Kevin McKinney | 8c7d51a | 2012-11-25 19:28:59 -0500 | [diff] [blame] | 138 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 139 | |
Kevin McKinney | ba738b4 | 2012-11-25 19:28:58 -0500 | [diff] [blame] | 140 | struct bcm_mibs_table { |
Kevin McKinney | 73a8ff0 | 2012-11-25 19:28:47 -0500 | [diff] [blame] | 141 | unsigned long ulSFID; |
Kevin McKinney | 7d5691e | 2012-11-25 19:28:53 -0500 | [diff] [blame] | 142 | unsigned short usVCID_Value; |
Kevin McKinney | 36e0ae2 | 2012-11-25 19:28:52 -0500 | [diff] [blame] | 143 | unsigned int uiThreshold; |
Kevin McKinney | 8830fd0 | 2012-11-25 19:28:51 -0500 | [diff] [blame] | 144 | u8 u8TrafficPriority; |
Kevin McKinney | 86d82c9 | 2012-11-25 19:28:54 -0500 | [diff] [blame] | 145 | bool bValid; |
| 146 | bool bActive; |
| 147 | bool bActivateRequestSent; |
Kevin McKinney | 8830fd0 | 2012-11-25 19:28:51 -0500 | [diff] [blame] | 148 | u8 u8QueueType; |
Kevin McKinney | 36e0ae2 | 2012-11-25 19:28:52 -0500 | [diff] [blame] | 149 | 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 McKinney | 2a4d3a2 | 2012-11-25 19:28:55 -0500 | [diff] [blame] | 159 | u64 liDrainCalculated; |
Kevin McKinney | 36e0ae2 | 2012-11-25 19:28:52 -0500 | [diff] [blame] | 160 | unsigned int uiCurrentTokenCount; |
Kevin McKinney | 2a4d3a2 | 2012-11-25 19:28:55 -0500 | [diff] [blame] | 161 | u64 liLastUpdateTokenAt; |
Kevin McKinney | 36e0ae2 | 2012-11-25 19:28:52 -0500 | [diff] [blame] | 162 | unsigned int uiMaxAllowedRate; |
| 163 | unsigned int NumOfPacketsSent; |
Kevin McKinney | 57353c0 | 2012-11-25 19:28:45 -0500 | [diff] [blame] | 164 | unsigned char ucDirection; |
Kevin McKinney | 7d5691e | 2012-11-25 19:28:53 -0500 | [diff] [blame] | 165 | unsigned short usCID; |
Kevin McKinney | 8c7d51a | 2012-11-25 19:28:59 -0500 | [diff] [blame] | 166 | struct bcm_mibs_parameters stMibsExtServiceFlowTable; |
Kevin McKinney | 36e0ae2 | 2012-11-25 19:28:52 -0500 | [diff] [blame] | 167 | unsigned int uiCurrentRxRate; |
| 168 | unsigned int uiThisPeriodRxBytes; |
| 169 | unsigned int uiTotalRxBytes; |
| 170 | unsigned int uiTotalTxBytes; |
Kevin McKinney | ba738b4 | 2012-11-25 19:28:58 -0500 | [diff] [blame] | 171 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 172 | |
Kevin McKinney | 2790a3c | 2012-11-25 19:28:57 -0500 | [diff] [blame] | 173 | struct bcm_mibs_dropped_cntrl_msg { |
Kevin McKinney | 73a8ff0 | 2012-11-25 19:28:47 -0500 | [diff] [blame] | 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; |
Kevin McKinney | 2790a3c | 2012-11-25 19:28:57 -0500 | [diff] [blame] | 182 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 183 | |
Kevin McKinney | 954f91d | 2012-11-25 19:28:56 -0500 | [diff] [blame] | 184 | struct bcm_host_stats_mibs { |
Kevin McKinney | 86758b7 | 2012-11-25 19:29:02 -0500 | [diff] [blame] | 185 | struct bcm_mibs_host_info stHostInfo; |
Kevin McKinney | 4aca284 | 2012-11-25 19:29:01 -0500 | [diff] [blame] | 186 | struct bcm_mibs_classifier_rule astClassifierTable[MIBS_MAX_CLASSIFIERS]; |
Kevin McKinney | ba738b4 | 2012-11-25 19:28:58 -0500 | [diff] [blame] | 187 | struct bcm_mibs_table astSFtable[MIBS_MAX_SERVICEFLOWS]; |
Kevin McKinney | 8a885ae | 2012-11-25 19:29:00 -0500 | [diff] [blame] | 188 | struct bcm_mibs_phs_rule astPhsRulesTable[MIBS_MAX_PHSRULES]; |
Kevin McKinney | 2790a3c | 2012-11-25 19:28:57 -0500 | [diff] [blame] | 189 | struct bcm_mibs_dropped_cntrl_msg stDroppedAppCntrlMsgs; |
Kevin McKinney | 954f91d | 2012-11-25 19:28:56 -0500 | [diff] [blame] | 190 | }; |
Kevin McKinney | 9d8b659 | 2012-11-25 19:28:42 -0500 | [diff] [blame] | 191 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 192 | #endif |