Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1 | /*********************************** |
| 2 | * Adapter.h |
| 3 | ************************************/ |
| 4 | #ifndef __ADAPTER_H__ |
| 5 | #define __ADAPTER_H__ |
| 6 | |
| 7 | #define MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES 256 |
| 8 | #include "Debug.h" |
| 9 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 10 | struct _LEADER { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 11 | USHORT Vcid; |
| 12 | USHORT PLength; |
| 13 | UCHAR Status; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 14 | UCHAR Unused[3]; |
Kevin McKinney | e1325ad | 2012-05-18 08:50:57 -0400 | [diff] [blame] | 15 | } __packed; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 16 | typedef struct _LEADER LEADER, *PLEADER; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 17 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 18 | struct _PACKETTOSEND { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 19 | LEADER Leader; |
| 20 | UCHAR ucPayload; |
Kevin McKinney | e1325ad | 2012-05-18 08:50:57 -0400 | [diff] [blame] | 21 | } __packed; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 22 | typedef struct _PACKETTOSEND PACKETTOSEND, *PPACKETTOSEND; |
| 23 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 24 | struct _CONTROL_PACKET { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 25 | PVOID ControlBuff; |
| 26 | UINT ControlBuffLen; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 27 | struct _CONTROL_PACKET *next; |
Kevin McKinney | e1325ad | 2012-05-18 08:50:57 -0400 | [diff] [blame] | 28 | } __packed; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 29 | typedef struct _CONTROL_PACKET CONTROL_PACKET, *PCONTROL_PACKET; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 30 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 31 | struct link_request { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 32 | LEADER Leader; |
| 33 | UCHAR szData[4]; |
Kevin McKinney | e1325ad | 2012-05-18 08:50:57 -0400 | [diff] [blame] | 34 | } __packed; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 35 | typedef struct link_request LINK_REQUEST, *PLINK_REQUEST; |
| 36 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 37 | /* classification extension is added */ |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 38 | typedef struct _ADD_CONNECTION { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 39 | ULONG SrcIpAddressCount; |
| 40 | ULONG SrcIpAddress[MAX_CONNECTIONS]; |
| 41 | ULONG SrcIpMask[MAX_CONNECTIONS]; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 42 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 43 | ULONG DestIpAddressCount; |
| 44 | ULONG DestIpAddress[MAX_CONNECTIONS]; |
| 45 | ULONG DestIpMask[MAX_CONNECTIONS]; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 46 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 47 | USHORT SrcPortBegin; |
| 48 | USHORT SrcPortEnd; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 49 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 50 | USHORT DestPortBegin; |
| 51 | USHORT DestPortEnd; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 52 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 53 | UCHAR SrcTOS; |
| 54 | UCHAR SrcProtocol; |
| 55 | } ADD_CONNECTION, *PADD_CONNECTION; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 56 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 57 | typedef struct _CLASSIFICATION_RULE { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 58 | UCHAR ucIPSrcAddrLen; |
| 59 | UCHAR ucIPSrcAddr[32]; |
| 60 | UCHAR ucIPDestAddrLen; |
| 61 | UCHAR ucIPDestAddr[32]; |
| 62 | UCHAR ucSrcPortRangeLen; |
| 63 | UCHAR ucSrcPortRange[4]; |
| 64 | UCHAR ucDestPortRangeLen; |
| 65 | UCHAR ucDestPortRange[4]; |
| 66 | USHORT usVcid; |
| 67 | } CLASSIFICATION_RULE, *PCLASSIFICATION_RULE; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 68 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 69 | typedef struct _CLASSIFICATION_ONLY { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 70 | USHORT usVcid; |
| 71 | ULONG DestIpAddress; |
| 72 | ULONG DestIpMask; |
| 73 | USHORT usPortLo; |
| 74 | USHORT usPortHi; |
| 75 | BOOLEAN bIpVersion; |
| 76 | UCHAR ucDestinationAddress[16]; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 77 | } CLASSIFICATION_ONLY, *PCLASSIFICATION_ONLY; |
| 78 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 79 | #define MAX_IP_RANGE_LENGTH 4 |
| 80 | #define MAX_PORT_RANGE 4 |
| 81 | #define MAX_PROTOCOL_LENGTH 32 |
| 82 | #define IPV6_ADDRESS_SIZEINBYTES 0x10 |
| 83 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 84 | typedef union _U_IP_ADDRESS { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 85 | struct { |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 86 | ULONG ulIpv4Addr[MAX_IP_RANGE_LENGTH]; /* Source Ip Address Range */ |
| 87 | ULONG ulIpv4Mask[MAX_IP_RANGE_LENGTH]; /* Source Ip Mask Address Range */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 88 | }; |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 89 | struct { |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 90 | ULONG ulIpv6Addr[MAX_IP_RANGE_LENGTH * 4]; /* Source Ip Address Range */ |
| 91 | ULONG ulIpv6Mask[MAX_IP_RANGE_LENGTH * 4]; /* Source Ip Mask Address Range */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 92 | }; |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 93 | struct { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 94 | UCHAR ucIpv4Address[MAX_IP_RANGE_LENGTH * IP_LENGTH_OF_ADDRESS]; |
| 95 | UCHAR ucIpv4Mask[MAX_IP_RANGE_LENGTH * IP_LENGTH_OF_ADDRESS]; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 96 | }; |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 97 | struct { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 98 | UCHAR ucIpv6Address[MAX_IP_RANGE_LENGTH * IPV6_ADDRESS_SIZEINBYTES]; |
| 99 | UCHAR ucIpv6Mask[MAX_IP_RANGE_LENGTH * IPV6_ADDRESS_SIZEINBYTES]; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 100 | }; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 101 | } U_IP_ADDRESS; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 102 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 103 | typedef struct _S_HDR_SUPRESSION_CONTEXTINFO { |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 104 | UCHAR ucaHdrSupressionInBuf[MAX_PHS_LENGTHS]; /* Intermediate buffer to accumulate pkt Header for PHS */ |
| 105 | UCHAR ucaHdrSupressionOutBuf[MAX_PHS_LENGTHS + PHSI_LEN]; /* Intermediate buffer containing pkt Header after PHS */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 106 | } S_HDR_SUPRESSION_CONTEXTINFO; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 107 | |
Kevin McKinney | 92562ae | 2012-05-26 12:05:03 -0400 | [diff] [blame^] | 108 | struct bcm_classifier_rule { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 109 | ULONG ulSFID; |
| 110 | UCHAR ucReserved[2]; |
| 111 | B_UINT16 uiClassifierRuleIndex; |
| 112 | BOOLEAN bUsed; |
| 113 | USHORT usVCID_Value; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 114 | B_UINT8 u8ClassifierRulePriority; /* This field detemines the Classifier Priority */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 115 | U_IP_ADDRESS stSrcIpAddress; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 116 | UCHAR ucIPSourceAddressLength; /* Ip Source Address Length */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 117 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 118 | U_IP_ADDRESS stDestIpAddress; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 119 | UCHAR ucIPDestinationAddressLength; /* Ip Destination Address Length */ |
| 120 | UCHAR ucIPTypeOfServiceLength; /* Type of service Length */ |
| 121 | UCHAR ucTosLow; /* Tos Low */ |
| 122 | UCHAR ucTosHigh; /* Tos High */ |
| 123 | UCHAR ucTosMask; /* Tos Mask */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 124 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 125 | UCHAR ucProtocolLength; /* protocol Length */ |
| 126 | UCHAR ucProtocol[MAX_PROTOCOL_LENGTH]; /* protocol Length */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 127 | USHORT usSrcPortRangeLo[MAX_PORT_RANGE]; |
| 128 | USHORT usSrcPortRangeHi[MAX_PORT_RANGE]; |
| 129 | UCHAR ucSrcPortRangeLength; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 130 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 131 | USHORT usDestPortRangeLo[MAX_PORT_RANGE]; |
| 132 | USHORT usDestPortRangeHi[MAX_PORT_RANGE]; |
| 133 | UCHAR ucDestPortRangeLength; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 134 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 135 | BOOLEAN bProtocolValid; |
| 136 | BOOLEAN bTOSValid; |
| 137 | BOOLEAN bDestIpValid; |
| 138 | BOOLEAN bSrcIpValid; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 139 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 140 | /* For IPv6 Addressing */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 141 | UCHAR ucDirection; |
| 142 | BOOLEAN bIpv6Protocol; |
| 143 | UINT32 u32PHSRuleID; |
| 144 | S_PHS_RULE sPhsRule; |
| 145 | UCHAR u8AssociatedPHSI; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 146 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 147 | /* Classification fields for ETH CS */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 148 | UCHAR ucEthCSSrcMACLen; |
| 149 | UCHAR au8EThCSSrcMAC[MAC_ADDRESS_SIZE]; |
| 150 | UCHAR au8EThCSSrcMACMask[MAC_ADDRESS_SIZE]; |
| 151 | UCHAR ucEthCSDestMACLen; |
| 152 | UCHAR au8EThCSDestMAC[MAC_ADDRESS_SIZE]; |
| 153 | UCHAR au8EThCSDestMACMask[MAC_ADDRESS_SIZE]; |
| 154 | UCHAR ucEtherTypeLen; |
| 155 | UCHAR au8EthCSEtherType[NUM_ETHERTYPE_BYTES]; |
| 156 | UCHAR usUserPriority[2]; |
| 157 | USHORT usVLANID; |
| 158 | USHORT usValidityBitMap; |
Kevin McKinney | 92562ae | 2012-05-26 12:05:03 -0400 | [diff] [blame^] | 159 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 160 | |
Kevin McKinney | 7f22485 | 2012-05-26 12:05:02 -0400 | [diff] [blame] | 161 | struct bcm_fragmented_packet_info { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 162 | BOOLEAN bUsed; |
| 163 | ULONG ulSrcIpAddress; |
| 164 | USHORT usIpIdentification; |
Kevin McKinney | 92562ae | 2012-05-26 12:05:03 -0400 | [diff] [blame^] | 165 | struct bcm_classifier_rule *pstMatchedClassifierEntry; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 166 | BOOLEAN bOutOfOrderFragment; |
Kevin McKinney | 7f22485 | 2012-05-26 12:05:02 -0400 | [diff] [blame] | 167 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 168 | |
Kevin McKinney | 0b3edf7 | 2012-05-26 12:05:01 -0400 | [diff] [blame] | 169 | struct bcm_packet_info { |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 170 | /* classification extension Rule */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 171 | ULONG ulSFID; |
| 172 | USHORT usVCID_Value; |
| 173 | UINT uiThreshold; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 174 | /* This field determines the priority of the SF Queues */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 175 | B_UINT8 u8TrafficPriority; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 176 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 177 | BOOLEAN bValid; |
| 178 | BOOLEAN bActive; |
| 179 | BOOLEAN bActivateRequestSent; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 180 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 181 | B_UINT8 u8QueueType; /* BE or rtPS */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 182 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 183 | UINT uiMaxBucketSize; /* maximum size of the bucket for the queue */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 184 | UINT uiCurrentQueueDepthOnTarget; |
| 185 | UINT uiCurrentBytesOnHost; |
| 186 | UINT uiCurrentPacketsOnHost; |
| 187 | UINT uiDroppedCountBytes; |
| 188 | UINT uiDroppedCountPackets; |
| 189 | UINT uiSentBytes; |
| 190 | UINT uiSentPackets; |
| 191 | UINT uiCurrentDrainRate; |
| 192 | UINT uiThisPeriodSentBytes; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 193 | LARGE_INTEGER liDrainCalculated; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 194 | UINT uiCurrentTokenCount; |
| 195 | LARGE_INTEGER liLastUpdateTokenAt; |
| 196 | UINT uiMaxAllowedRate; |
| 197 | UINT NumOfPacketsSent; |
| 198 | UCHAR ucDirection; |
| 199 | USHORT usCID; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 200 | S_MIBS_EXTSERVICEFLOW_PARAMETERS stMibsExtServiceFlowTable; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 201 | UINT uiCurrentRxRate; |
| 202 | UINT uiThisPeriodRxBytes; |
| 203 | UINT uiTotalRxBytes; |
| 204 | UINT uiTotalTxBytes; |
| 205 | UINT uiPendedLast; |
| 206 | UCHAR ucIpVersion; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 207 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 208 | union { |
| 209 | struct { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 210 | struct sk_buff *FirstTxQueue; |
| 211 | struct sk_buff *LastTxQueue; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 212 | }; |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 213 | struct { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 214 | struct sk_buff *ControlHead; |
| 215 | struct sk_buff *ControlTail; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 216 | }; |
| 217 | }; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 218 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 219 | BOOLEAN bProtocolValid; |
| 220 | BOOLEAN bTOSValid; |
| 221 | BOOLEAN bDestIpValid; |
| 222 | BOOLEAN bSrcIpValid; |
| 223 | |
| 224 | BOOLEAN bActiveSet; |
| 225 | BOOLEAN bAdmittedSet; |
| 226 | BOOLEAN bAuthorizedSet; |
| 227 | BOOLEAN bClassifierPriority; |
| 228 | UCHAR ucServiceClassName[MAX_CLASS_NAME_LENGTH]; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 229 | BOOLEAN bHeaderSuppressionEnabled; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 230 | spinlock_t SFQueueLock; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 231 | void *pstSFIndication; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 232 | struct timeval stLastUpdateTokenAt; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 233 | atomic_t uiPerSFTxResourceCount; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 234 | UINT uiMaxLatency; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 235 | UCHAR bIPCSSupport; |
| 236 | UCHAR bEthCSSupport; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 237 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 238 | |
Kevin McKinney | 774bea8 | 2012-05-26 12:05:00 -0400 | [diff] [blame] | 239 | struct bcm_tarang_data { |
| 240 | struct bcm_tarang_data *next; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 241 | struct _MINI_ADAPTER *Adapter; |
| 242 | struct sk_buff *RxAppControlHead; |
| 243 | struct sk_buff *RxAppControlTail; |
Kevin McKinney | 26cd230 | 2012-05-18 08:50:59 -0400 | [diff] [blame] | 244 | int AppCtrlQueueLen; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 245 | BOOLEAN MacTracingEnabled; |
| 246 | BOOLEAN bApplicationToExit; |
| 247 | S_MIBS_DROPPED_APP_CNTRL_MESSAGES stDroppedAppCntrlMsgs; |
| 248 | ULONG RxCntrlMsgBitMask; |
Kevin McKinney | 774bea8 | 2012-05-26 12:05:00 -0400 | [diff] [blame] | 249 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 250 | |
Kevin McKinney | 3753164 | 2012-05-26 12:04:58 -0400 | [diff] [blame] | 251 | struct bcm_targetdsx_buffer { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 252 | ULONG ulTargetDsxBuffer; |
| 253 | B_UINT16 tid; |
| 254 | BOOLEAN valid; |
Kevin McKinney | 3753164 | 2012-05-26 12:04:58 -0400 | [diff] [blame] | 255 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 256 | |
Kevin McKinney | d426205 | 2012-05-18 08:50:58 -0400 | [diff] [blame] | 257 | typedef int (*FP_FLASH_WRITE)(struct _MINI_ADAPTER *, UINT, PVOID); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 258 | |
Kevin McKinney | d426205 | 2012-05-18 08:50:58 -0400 | [diff] [blame] | 259 | typedef int (*FP_FLASH_WRITE_STATUS)(struct _MINI_ADAPTER *, UINT, PVOID); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 260 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 261 | /* |
| 262 | * Driver adapter data structure |
| 263 | */ |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 264 | struct _MINI_ADAPTER { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 265 | struct _MINI_ADAPTER *next; |
Stephen Hemminger | 4fd64dd | 2010-11-01 12:12:31 -0400 | [diff] [blame] | 266 | struct net_device *dev; |
| 267 | u32 msg_enable; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 268 | CHAR *caDsxReqResp; |
Stephen Hemminger | 3349d95 | 2010-11-01 11:12:56 -0400 | [diff] [blame] | 269 | atomic_t ApplicationRunning; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 270 | BOOLEAN AppCtrlQueueOverFlow; |
Stephen Hemminger | 3349d95 | 2010-11-01 11:12:56 -0400 | [diff] [blame] | 271 | atomic_t CurrentApplicationCount; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 272 | atomic_t RegisteredApplicationCount; |
| 273 | BOOLEAN LinkUpStatus; |
| 274 | BOOLEAN TimerActive; |
Stephen Hemminger | 3349d95 | 2010-11-01 11:12:56 -0400 | [diff] [blame] | 275 | u32 StatisticsPointer; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 276 | struct sk_buff *RxControlHead; |
| 277 | struct sk_buff *RxControlTail; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 278 | struct semaphore RxAppControlQueuelock; |
| 279 | struct semaphore fw_download_sema; |
Kevin McKinney | 774bea8 | 2012-05-26 12:05:00 -0400 | [diff] [blame] | 280 | struct bcm_tarang_data *pTarangs; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 281 | spinlock_t control_queue_lock; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 282 | wait_queue_head_t process_read_wait_queue; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 283 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 284 | /* the pointer to the first packet we have queued in send |
| 285 | * deserialized miniport support variables |
| 286 | */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 287 | atomic_t TotalPacketCount; |
| 288 | atomic_t TxPktAvail; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 289 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 290 | /* this to keep track of the Tx and Rx MailBox Registers. */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 291 | atomic_t CurrNumFreeTxDesc; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 292 | /* to keep track the no of byte received */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 293 | USHORT PrevNumRecvDescs; |
| 294 | USHORT CurrNumRecvDescs; |
| 295 | UINT u32TotalDSD; |
Kevin McKinney | 0b3edf7 | 2012-05-26 12:05:01 -0400 | [diff] [blame] | 296 | struct bcm_packet_info PackInfo[NO_OF_QUEUES]; |
Kevin McKinney | 92562ae | 2012-05-26 12:05:03 -0400 | [diff] [blame^] | 297 | struct bcm_classifier_rule astClassifierTable[MAX_CLASSIFIERS]; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 298 | BOOLEAN TransferMode; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 299 | |
| 300 | /*************** qos ******************/ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 301 | BOOLEAN bETHCSEnabled; |
| 302 | ULONG BEBucketSize; |
| 303 | ULONG rtPSBucketSize; |
| 304 | UCHAR LinkStatus; |
| 305 | BOOLEAN AutoLinkUp; |
| 306 | BOOLEAN AutoSyncup; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 307 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 308 | int major; |
| 309 | int minor; |
| 310 | wait_queue_head_t tx_packet_wait_queue; |
| 311 | wait_queue_head_t process_rx_cntrlpkt; |
| 312 | atomic_t process_waiting; |
| 313 | BOOLEAN fw_download_done; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 314 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 315 | char *txctlpacket[MAX_CNTRL_PKTS]; |
| 316 | atomic_t cntrlpktCnt ; |
| 317 | atomic_t index_app_read_cntrlpkt; |
| 318 | atomic_t index_wr_txcntrlpkt; |
| 319 | atomic_t index_rd_txcntrlpkt; |
| 320 | UINT index_datpkt; |
| 321 | struct semaphore rdmwrmsync; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 322 | |
Kevin McKinney | 3753164 | 2012-05-26 12:04:58 -0400 | [diff] [blame] | 323 | struct bcm_targetdsx_buffer astTargetDsxBuffer[MAX_TARGET_DSX_BUFFERS]; |
Stephen Hemminger | 3349d95 | 2010-11-01 11:12:56 -0400 | [diff] [blame] | 324 | ULONG ulFreeTargetBufferCnt; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 325 | ULONG ulCurrentTargetBuffer; |
| 326 | ULONG ulTotalTargetBuffersAvailable; |
| 327 | unsigned long chip_id; |
| 328 | wait_queue_head_t lowpower_mode_wait_queue; |
Stephen Hemminger | 3349d95 | 2010-11-01 11:12:56 -0400 | [diff] [blame] | 329 | BOOLEAN bFlashBoot; |
| 330 | BOOLEAN bBinDownloaded; |
| 331 | BOOLEAN bCfgDownloaded; |
| 332 | BOOLEAN bSyncUpRequestSent; |
| 333 | USHORT usBestEffortQueueIndex; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 334 | wait_queue_head_t ioctl_fw_dnld_wait_queue; |
| 335 | BOOLEAN waiting_to_fw_download_done; |
| 336 | pid_t fw_download_process_pid; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 337 | PSTARGETPARAMS pstargetparams; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 338 | BOOLEAN device_removed; |
| 339 | BOOLEAN DeviceAccess; |
| 340 | BOOLEAN bIsAutoCorrectEnabled; |
| 341 | BOOLEAN bDDRInitDone; |
Kevin McKinney | d426205 | 2012-05-18 08:50:58 -0400 | [diff] [blame] | 342 | int DDRSetting; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 343 | ULONG ulPowerSaveMode; |
| 344 | spinlock_t txtransmitlock; |
| 345 | B_UINT8 txtransmit_running; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 346 | /* Thread for control packet handling */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 347 | struct task_struct *control_packet_handler; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 348 | /* thread for transmitting packets. */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 349 | struct task_struct *transmit_packet_thread; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 350 | |
| 351 | /* LED Related Structures */ |
| 352 | LED_INFO_STRUCT LEDInfo; |
| 353 | |
| 354 | /* Driver State for LED Blinking */ |
| 355 | LedEventInfo_t DriverState; |
| 356 | /* Interface Specific */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 357 | PVOID pvInterfaceAdapter; |
| 358 | int (*bcm_file_download)(PVOID, |
| 359 | struct file *, |
| 360 | unsigned int); |
| 361 | int (*bcm_file_readback_from_chip)(PVOID, |
| 362 | struct file *, |
| 363 | unsigned int); |
Kevin McKinney | d426205 | 2012-05-18 08:50:58 -0400 | [diff] [blame] | 364 | int (*interface_rdm)(PVOID, |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 365 | UINT, |
| 366 | PVOID, |
Kevin McKinney | d426205 | 2012-05-18 08:50:58 -0400 | [diff] [blame] | 367 | int); |
| 368 | int (*interface_wrm)(PVOID, |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 369 | UINT, |
| 370 | PVOID, |
Kevin McKinney | d426205 | 2012-05-18 08:50:58 -0400 | [diff] [blame] | 371 | int); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 372 | int (*interface_transmit)(PVOID, PVOID , UINT); |
| 373 | BOOLEAN IdleMode; |
| 374 | BOOLEAN bDregRequestSentInIdleMode; |
| 375 | BOOLEAN bTriedToWakeUpFromlowPowerMode; |
| 376 | BOOLEAN bShutStatus; |
| 377 | BOOLEAN bWakeUpDevice; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 378 | unsigned int usIdleModePattern; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 379 | /* BOOLEAN bTriedToWakeUpFromShutdown; */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 380 | BOOLEAN bLinkDownRequested; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 381 | int downloadDDR; |
| 382 | PHS_DEVICE_EXTENSION stBCMPhsContext; |
| 383 | S_HDR_SUPRESSION_CONTEXTINFO stPhsTxContextInfo; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 384 | uint8_t ucaPHSPktRestoreBuf[2048]; |
| 385 | uint8_t bPHSEnabled; |
Stephen Hemminger | 3349d95 | 2010-11-01 11:12:56 -0400 | [diff] [blame] | 386 | BOOLEAN AutoFirmDld; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 387 | BOOLEAN bMipsConfig; |
| 388 | BOOLEAN bDPLLConfig; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 389 | UINT32 aTxPktSizeHist[MIBS_MAX_HIST_ENTRIES]; |
| 390 | UINT32 aRxPktSizeHist[MIBS_MAX_HIST_ENTRIES]; |
Kevin McKinney | 7f22485 | 2012-05-26 12:05:02 -0400 | [diff] [blame] | 391 | struct bcm_fragmented_packet_info astFragmentedPktClassifierTable[MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES]; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 392 | atomic_t uiMBupdate; |
| 393 | UINT32 PmuMode; |
| 394 | NVM_TYPE eNVMType; |
| 395 | UINT uiSectorSize; |
| 396 | UINT uiSectorSizeInCFG; |
| 397 | BOOLEAN bSectorSizeOverride; |
| 398 | BOOLEAN bStatusWrite; |
| 399 | UINT uiNVMDSDSize; |
| 400 | UINT uiVendorExtnFlag; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 401 | /* it will always represent chosen DSD at any point of time. |
| 402 | * Generally it is Active DSD but in case of NVM RD/WR it might be different. |
| 403 | */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 404 | UINT ulFlashCalStart; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 405 | ULONG ulFlashControlSectionStart; |
| 406 | ULONG ulFlashWriteSize; |
| 407 | ULONG ulFlashID; |
| 408 | FP_FLASH_WRITE fpFlashWrite; |
| 409 | FP_FLASH_WRITE_STATUS fpFlashWriteWithStatusCheck; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 410 | |
| 411 | struct semaphore NVMRdmWrmLock; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 412 | struct device *pstCreatedClassDevice; |
Stephen Hemminger | 3705a84 | 2010-10-29 08:14:16 -0700 | [diff] [blame] | 413 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 414 | /* BOOLEAN InterfaceUpStatus; */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 415 | PFLASH2X_CS_INFO psFlash2xCSInfo; |
| 416 | PFLASH_CS_INFO psFlashCSInfo; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 417 | PFLASH2X_VENDORSPECIFIC_INFO psFlash2xVendorInfo; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 418 | UINT uiFlashBaseAdd; /* Flash start address */ |
| 419 | UINT uiActiveISOOffset; /* Active ISO offset chosen before f/w download */ |
| 420 | FLASH2X_SECTION_VAL eActiveISO; /* Active ISO section val */ |
| 421 | FLASH2X_SECTION_VAL eActiveDSD; /* Active DSD val chosen before f/w download */ |
| 422 | UINT uiActiveDSDOffsetAtFwDld; /* For accessing Active DSD chosen before f/w download */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 423 | UINT uiFlashLayoutMajorVersion; |
| 424 | UINT uiFlashLayoutMinorVersion; |
| 425 | BOOLEAN bAllDSDWriteAllow; |
| 426 | BOOLEAN bSigCorrupted; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 427 | /* this should be set who so ever want to change the Headers. after Wrtie it should be reset immediately. */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 428 | BOOLEAN bHeaderChangeAllowed; |
Kevin McKinney | d426205 | 2012-05-18 08:50:58 -0400 | [diff] [blame] | 429 | int SelectedChip; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 430 | BOOLEAN bEndPointHalted; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 431 | /* while bFlashRawRead will be true, Driver ignore map lay out and consider flash as of without any map. */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 432 | BOOLEAN bFlashRawRead; |
| 433 | BOOLEAN bPreparingForLowPowerMode; |
| 434 | BOOLEAN bDoSuspend; |
| 435 | UINT syscfgBefFwDld; |
| 436 | BOOLEAN StopAllXaction; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 437 | UINT32 liTimeSinceLastNetEntry; /* Used to Support extended CAPI requirements from */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 438 | struct semaphore LowPowerModeSync; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 439 | ULONG liDrainCalculated; |
| 440 | UINT gpioBitMap; |
| 441 | S_BCM_DEBUG_STATE stDebugState; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 442 | }; |
| 443 | typedef struct _MINI_ADAPTER MINI_ADAPTER, *PMINI_ADAPTER; |
| 444 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 445 | #define GET_BCM_ADAPTER(net_dev) netdev_priv(net_dev) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 446 | |
Kevin McKinney | 406a508 | 2012-05-26 12:04:57 -0400 | [diff] [blame] | 447 | struct bcm_eth_header { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 448 | UCHAR au8DestinationAddress[6]; |
| 449 | UCHAR au8SourceAddress[6]; |
| 450 | USHORT u16Etype; |
Kevin McKinney | e1325ad | 2012-05-18 08:50:57 -0400 | [diff] [blame] | 451 | } __packed; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 452 | |
Kevin McKinney | 7a27a2c | 2012-05-26 12:04:56 -0400 | [diff] [blame] | 453 | struct bcm_firmware_info { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 454 | void __user *pvMappedFirmwareAddress; |
| 455 | ULONG u32FirmwareLength; |
| 456 | ULONG u32StartingAddress; |
Kevin McKinney | 7a27a2c | 2012-05-26 12:04:56 -0400 | [diff] [blame] | 457 | } __packed; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 458 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 459 | /* holds the value of net_device structure.. */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 460 | extern struct net_device *gblpnetdev; |
Kevin McKinney | 7905c78 | 2012-05-26 12:04:55 -0400 | [diff] [blame] | 461 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 462 | typedef LINK_REQUEST CONTROL_MESSAGE; |
| 463 | |
Kevin McKinney | be30999 | 2012-05-26 12:04:54 -0400 | [diff] [blame] | 464 | struct bcm_ddr_setting { |
Alejandro R. SedeƱo | b706113 | 2010-11-10 01:42:01 -0500 | [diff] [blame] | 465 | UINT ulRegAddress; |
| 466 | UINT ulRegValue; |
Kevin McKinney | be30999 | 2012-05-26 12:04:54 -0400 | [diff] [blame] | 467 | }; |
Kevin McKinney | d426205 | 2012-05-18 08:50:58 -0400 | [diff] [blame] | 468 | int InitAdapter(PMINI_ADAPTER psAdapter); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 469 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 470 | /* ===================================================================== |
| 471 | * Beceem vendor request codes for EP0 |
| 472 | * ===================================================================== |
| 473 | */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 474 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 475 | #define BCM_REQUEST_READ 0x2 |
| 476 | #define BCM_REQUEST_WRITE 0x1 |
| 477 | #define EP2_MPS_REG 0x0F0110A0 |
| 478 | #define EP2_MPS 0x40 |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 479 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 480 | #define EP2_CFG_REG 0x0F0110A8 |
| 481 | #define EP2_CFG_INT 0x27 |
| 482 | #define EP2_CFG_BULK 0x25 |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 483 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 484 | #define EP4_MPS_REG 0x0F0110F0 |
| 485 | #define EP4_MPS 0x8C |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 486 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 487 | #define EP4_CFG_REG 0x0F0110F8 |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 488 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 489 | #define ISO_MPS_REG 0x0F0110C8 |
| 490 | #define ISO_MPS 0x00000000 |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 491 | |
| 492 | #define EP1 0 |
| 493 | #define EP2 1 |
| 494 | #define EP3 2 |
| 495 | #define EP4 3 |
| 496 | #define EP5 4 |
| 497 | #define EP6 5 |
| 498 | |
Kevin McKinney | 76cc6f9 | 2012-05-26 12:04:53 -0400 | [diff] [blame] | 499 | enum bcm_einterface_setting { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 500 | DEFAULT_SETTING_0 = 0, |
| 501 | ALTERNATE_SETTING_1 = 1, |
Kevin McKinney | 76cc6f9 | 2012-05-26 12:04:53 -0400 | [diff] [blame] | 502 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 503 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame] | 504 | #endif /* __ADAPTER_H__ */ |