Merge tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
[linux-2.6-block.git] / drivers / staging / bcm / HostMIBSInterface.h
CommitLineData
f8942e07
SH
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.
2b9866f2 9 */
9d8b659a
KM
10
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
f8942e07 19#define MIBS_IP_LENGTH_OF_ADDRESS 4
9d8b659a
KM
20#define MIBS_MAX_HIST_ENTRIES 12
21#define MIBS_PKTSIZEHIST_RANGE 128
f8942e07 22
0aaad65a 23union bcm_mibs_ip_addr {
af2bdcee 24 struct {
2b9866f2 25 /* Source Ip Address Range */
73a8ff09 26 unsigned long ulIpv4Addr[MIBS_MAX_IP_RANGE_LENGTH];
2b9866f2 27 /* Source Ip Mask Address Range */
73a8ff09 28 unsigned long ulIpv4Mask[MIBS_MAX_IP_RANGE_LENGTH];
f8942e07 29 };
af2bdcee 30 struct {
2b9866f2 31 /* Source Ip Address Range */
73a8ff09 32 unsigned long ulIpv6Addr[MIBS_MAX_IP_RANGE_LENGTH * 4];
2b9866f2 33 /* Source Ip Mask Address Range */
73a8ff09 34 unsigned long ulIpv6Mask[MIBS_MAX_IP_RANGE_LENGTH * 4];
f8942e07 35 };
af2bdcee 36 struct {
57353c0a
KM
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];
f8942e07 39 };
af2bdcee 40 struct {
57353c0a
KM
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];
f8942e07 43 };
0aaad65a 44};
f8942e07 45
86758b75 46struct bcm_mibs_host_info {
27aaa420
KM
47 u64 GoodTransmits;
48 u64 GoodReceives;
2b9866f2 49 /* this to keep track of the Tx and Rx MailBox Registers. */
73a8ff09
KM
50 unsigned long NumDesUsed;
51 unsigned long CurrNumFreeDesc;
52 unsigned long PrevNumFreeDesc;
2b9866f2 53 /* to keep track the no of byte received */
73a8ff09
KM
54 unsigned long PrevNumRcevBytes;
55 unsigned long CurrNumRcevBytes;
f8942e07 56 /* QOS Related */
73a8ff09
KM
57 unsigned long BEBucketSize;
58 unsigned long rtPSBucketSize;
59 unsigned long LastTxQueueIndex;
86d82c90
KM
60 bool TxOutofDescriptors;
61 bool TimerActive;
b770f422
KM
62 u32 u32TotalDSD;
63 u32 aTxPktSizeHist[MIBS_MAX_HIST_ENTRIES];
64 u32 aRxPktSizeHist[MIBS_MAX_HIST_ENTRIES];
86758b75 65};
f8942e07 66
4aca284f 67struct bcm_mibs_classifier_rule {
73a8ff09 68 unsigned long ulSFID;
57353c0a 69 unsigned char ucReserved[2];
2fb99f8b 70 u16 uiClassifierRuleIndex;
86d82c90 71 bool bUsed;
7d5691e5 72 unsigned short usVCID_Value;
8830fd0a 73 u8 u8ClassifierRulePriority;
0aaad65a 74 union bcm_mibs_ip_addr stSrcIpAddress;
2b9866f2 75 /* IP Source Address Length */
57353c0a 76 unsigned char ucIPSourceAddressLength;
0aaad65a 77 union bcm_mibs_ip_addr stDestIpAddress;
f8942e07 78 /* IP Destination Address Length */
57353c0a
KM
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];
7d5691e5
KM
86 unsigned short usSrcPortRangeLo[MIBS_MAX_PORT_RANGE];
87 unsigned short usSrcPortRangeHi[MIBS_MAX_PORT_RANGE];
57353c0a 88 unsigned char ucSrcPortRangeLength;
7d5691e5
KM
89 unsigned short usDestPortRangeLo[MIBS_MAX_PORT_RANGE];
90 unsigned short usDestPortRangeHi[MIBS_MAX_PORT_RANGE];
57353c0a 91 unsigned char ucDestPortRangeLength;
86d82c90
KM
92 bool bProtocolValid;
93 bool bTOSValid;
94 bool bDestIpValid;
95 bool bSrcIpValid;
57353c0a 96 unsigned char ucDirection;
86d82c90 97 bool bIpv6Protocol;
b770f422 98 u32 u32PHSRuleID;
4aca284f 99};
f8942e07 100
8a885ae8 101struct bcm_mibs_phs_rule {
73a8ff09 102 unsigned long ulSFID;
8830fd0a
KM
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];
381874ce 111 long PHSModifiedBytes;
73a8ff09
KM
112 unsigned long PHSModifiedNumPackets;
113 unsigned long PHSErrorNumPackets;
8a885ae8 114};
f8942e07 115
8c7d51a3 116struct bcm_mibs_parameters {
b770f422
KM
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;
8c7d51a3 138};
f8942e07 139
ba738b43 140struct bcm_mibs_table {
73a8ff09 141 unsigned long ulSFID;
7d5691e5 142 unsigned short usVCID_Value;
36e0ae29 143 unsigned int uiThreshold;
8830fd0a 144 u8 u8TrafficPriority;
86d82c90
KM
145 bool bValid;
146 bool bActive;
147 bool bActivateRequestSent;
8830fd0a 148 u8 u8QueueType;
36e0ae29
KM
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;
2a4d3a20 159 u64 liDrainCalculated;
36e0ae29 160 unsigned int uiCurrentTokenCount;
2a4d3a20 161 u64 liLastUpdateTokenAt;
36e0ae29
KM
162 unsigned int uiMaxAllowedRate;
163 unsigned int NumOfPacketsSent;
57353c0a 164 unsigned char ucDirection;
7d5691e5 165 unsigned short usCID;
8c7d51a3 166 struct bcm_mibs_parameters stMibsExtServiceFlowTable;
36e0ae29
KM
167 unsigned int uiCurrentRxRate;
168 unsigned int uiThisPeriodRxBytes;
169 unsigned int uiTotalRxBytes;
170 unsigned int uiTotalTxBytes;
ba738b43 171};
f8942e07 172
2790a3cc 173struct bcm_mibs_dropped_cntrl_msg {
73a8ff09
KM
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;
2790a3cc 182};
f8942e07 183
954f91d1 184struct bcm_host_stats_mibs {
86758b75 185 struct bcm_mibs_host_info stHostInfo;
4aca284f 186 struct bcm_mibs_classifier_rule astClassifierTable[MIBS_MAX_CLASSIFIERS];
ba738b43 187 struct bcm_mibs_table astSFtable[MIBS_MAX_SERVICEFLOWS];
8a885ae8 188 struct bcm_mibs_phs_rule astPhsRulesTable[MIBS_MAX_PHSRULES];
2790a3cc 189 struct bcm_mibs_dropped_cntrl_msg stDroppedAppCntrlMsgs;
954f91d1 190};
f8942e07 191
9d8b659a 192#endif