HostMIBSInterface.h 5.6 KB

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