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 | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 15 | } __attribute__((packed)); |
| 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 | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 21 | } __attribute__((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; |
| 28 | } __attribute__((packed)); |
| 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 | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 34 | } __attribute__((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 | struct _packet_info; |
| 103 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 104 | typedef struct _S_HDR_SUPRESSION_CONTEXTINFO { |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 105 | UCHAR ucaHdrSupressionInBuf[MAX_PHS_LENGTHS]; /* Intermediate buffer to accumulate pkt Header for PHS */ |
| 106 | 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] | 107 | } S_HDR_SUPRESSION_CONTEXTINFO; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 108 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 109 | typedef struct _S_CLASSIFIER_RULE { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 110 | ULONG ulSFID; |
| 111 | UCHAR ucReserved[2]; |
| 112 | B_UINT16 uiClassifierRuleIndex; |
| 113 | BOOLEAN bUsed; |
| 114 | USHORT usVCID_Value; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 115 | B_UINT8 u8ClassifierRulePriority; /* This field detemines the Classifier Priority */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 116 | U_IP_ADDRESS stSrcIpAddress; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 117 | UCHAR ucIPSourceAddressLength; /* Ip Source Address Length */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 118 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 119 | U_IP_ADDRESS stDestIpAddress; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 120 | UCHAR ucIPDestinationAddressLength; /* Ip Destination Address Length */ |
| 121 | UCHAR ucIPTypeOfServiceLength; /* Type of service Length */ |
| 122 | UCHAR ucTosLow; /* Tos Low */ |
| 123 | UCHAR ucTosHigh; /* Tos High */ |
| 124 | UCHAR ucTosMask; /* Tos Mask */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 125 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 126 | UCHAR ucProtocolLength; /* protocol Length */ |
| 127 | UCHAR ucProtocol[MAX_PROTOCOL_LENGTH]; /* protocol Length */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 128 | USHORT usSrcPortRangeLo[MAX_PORT_RANGE]; |
| 129 | USHORT usSrcPortRangeHi[MAX_PORT_RANGE]; |
| 130 | UCHAR ucSrcPortRangeLength; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 131 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 132 | USHORT usDestPortRangeLo[MAX_PORT_RANGE]; |
| 133 | USHORT usDestPortRangeHi[MAX_PORT_RANGE]; |
| 134 | UCHAR ucDestPortRangeLength; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 135 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 136 | BOOLEAN bProtocolValid; |
| 137 | BOOLEAN bTOSValid; |
| 138 | BOOLEAN bDestIpValid; |
| 139 | BOOLEAN bSrcIpValid; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 140 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 141 | /* For IPv6 Addressing */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 142 | UCHAR ucDirection; |
| 143 | BOOLEAN bIpv6Protocol; |
| 144 | UINT32 u32PHSRuleID; |
| 145 | S_PHS_RULE sPhsRule; |
| 146 | UCHAR u8AssociatedPHSI; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 147 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 148 | /* Classification fields for ETH CS */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 149 | UCHAR ucEthCSSrcMACLen; |
| 150 | UCHAR au8EThCSSrcMAC[MAC_ADDRESS_SIZE]; |
| 151 | UCHAR au8EThCSSrcMACMask[MAC_ADDRESS_SIZE]; |
| 152 | UCHAR ucEthCSDestMACLen; |
| 153 | UCHAR au8EThCSDestMAC[MAC_ADDRESS_SIZE]; |
| 154 | UCHAR au8EThCSDestMACMask[MAC_ADDRESS_SIZE]; |
| 155 | UCHAR ucEtherTypeLen; |
| 156 | UCHAR au8EthCSEtherType[NUM_ETHERTYPE_BYTES]; |
| 157 | UCHAR usUserPriority[2]; |
| 158 | USHORT usVLANID; |
| 159 | USHORT usValidityBitMap; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 160 | } S_CLASSIFIER_RULE; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 161 | /* typedef struct _S_CLASSIFIER_RULE S_CLASSIFIER_RULE; */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 162 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 163 | typedef struct _S_FRAGMENTED_PACKET_INFO { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 164 | BOOLEAN bUsed; |
| 165 | ULONG ulSrcIpAddress; |
| 166 | USHORT usIpIdentification; |
| 167 | S_CLASSIFIER_RULE *pstMatchedClassifierEntry; |
| 168 | BOOLEAN bOutOfOrderFragment; |
| 169 | } S_FRAGMENTED_PACKET_INFO, *PS_FRAGMENTED_PACKET_INFO; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 170 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 171 | struct _packet_info { |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 172 | /* classification extension Rule */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 173 | ULONG ulSFID; |
| 174 | USHORT usVCID_Value; |
| 175 | UINT uiThreshold; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 176 | /* This field determines the priority of the SF Queues */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 177 | B_UINT8 u8TrafficPriority; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 178 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 179 | BOOLEAN bValid; |
| 180 | BOOLEAN bActive; |
| 181 | BOOLEAN bActivateRequestSent; |
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 | B_UINT8 u8QueueType; /* BE or rtPS */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 184 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 185 | UINT uiMaxBucketSize; /* maximum size of the bucket for the queue */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 186 | UINT uiCurrentQueueDepthOnTarget; |
| 187 | UINT uiCurrentBytesOnHost; |
| 188 | UINT uiCurrentPacketsOnHost; |
| 189 | UINT uiDroppedCountBytes; |
| 190 | UINT uiDroppedCountPackets; |
| 191 | UINT uiSentBytes; |
| 192 | UINT uiSentPackets; |
| 193 | UINT uiCurrentDrainRate; |
| 194 | UINT uiThisPeriodSentBytes; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 195 | LARGE_INTEGER liDrainCalculated; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 196 | UINT uiCurrentTokenCount; |
| 197 | LARGE_INTEGER liLastUpdateTokenAt; |
| 198 | UINT uiMaxAllowedRate; |
| 199 | UINT NumOfPacketsSent; |
| 200 | UCHAR ucDirection; |
| 201 | USHORT usCID; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 202 | S_MIBS_EXTSERVICEFLOW_PARAMETERS stMibsExtServiceFlowTable; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 203 | UINT uiCurrentRxRate; |
| 204 | UINT uiThisPeriodRxBytes; |
| 205 | UINT uiTotalRxBytes; |
| 206 | UINT uiTotalTxBytes; |
| 207 | UINT uiPendedLast; |
| 208 | UCHAR ucIpVersion; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 209 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 210 | union { |
| 211 | struct { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 212 | struct sk_buff *FirstTxQueue; |
| 213 | struct sk_buff *LastTxQueue; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 214 | }; |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 215 | struct { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 216 | struct sk_buff *ControlHead; |
| 217 | struct sk_buff *ControlTail; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 218 | }; |
| 219 | }; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 220 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 221 | BOOLEAN bProtocolValid; |
| 222 | BOOLEAN bTOSValid; |
| 223 | BOOLEAN bDestIpValid; |
| 224 | BOOLEAN bSrcIpValid; |
| 225 | |
| 226 | BOOLEAN bActiveSet; |
| 227 | BOOLEAN bAdmittedSet; |
| 228 | BOOLEAN bAuthorizedSet; |
| 229 | BOOLEAN bClassifierPriority; |
| 230 | UCHAR ucServiceClassName[MAX_CLASS_NAME_LENGTH]; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 231 | BOOLEAN bHeaderSuppressionEnabled; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 232 | spinlock_t SFQueueLock; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 233 | void *pstSFIndication; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 234 | struct timeval stLastUpdateTokenAt; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 235 | atomic_t uiPerSFTxResourceCount; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 236 | UINT uiMaxLatency; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 237 | UCHAR bIPCSSupport; |
| 238 | UCHAR bEthCSSupport; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 239 | }; |
| 240 | typedef struct _packet_info PacketInfo; |
| 241 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 242 | typedef struct _PER_TARANG_DATA { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 243 | struct _PER_TARANG_DATA *next; |
| 244 | struct _MINI_ADAPTER *Adapter; |
| 245 | struct sk_buff *RxAppControlHead; |
| 246 | struct sk_buff *RxAppControlTail; |
| 247 | volatile INT AppCtrlQueueLen; |
| 248 | BOOLEAN MacTracingEnabled; |
| 249 | BOOLEAN bApplicationToExit; |
| 250 | S_MIBS_DROPPED_APP_CNTRL_MESSAGES stDroppedAppCntrlMsgs; |
| 251 | ULONG RxCntrlMsgBitMask; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 252 | } PER_TARANG_DATA, *PPER_TARANG_DATA; |
| 253 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 254 | #ifdef REL_4_1 |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 255 | typedef struct _TARGET_PARAMS { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 256 | B_UINT32 m_u32CfgVersion; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 257 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 258 | /* Scanning Related Params */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 259 | B_UINT32 m_u32CenterFrequency; |
| 260 | B_UINT32 m_u32BandAScan; |
| 261 | B_UINT32 m_u32BandBScan; |
| 262 | B_UINT32 m_u32BandCScan; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 263 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 264 | /* QoS Params */ |
| 265 | B_UINT32 m_u32minGrantsize; /* size of minimum grant is 0 or 6 */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 266 | B_UINT32 m_u32PHSEnable; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 267 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 268 | /* HO Params */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 269 | B_UINT32 m_u32HoEnable; |
| 270 | B_UINT32 m_u32HoReserved1; |
| 271 | B_UINT32 m_u32HoReserved2; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 272 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 273 | /* Power Control Params */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 274 | B_UINT32 m_u32MimoEnable; |
| 275 | B_UINT32 m_u32SecurityEnable; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 276 | /* |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 277 | * bit 1: 1 Idlemode enable; |
| 278 | * bit 2: 1 Sleepmode Enable |
| 279 | */ |
| 280 | B_UINT32 m_u32PowerSavingModesEnable; |
| 281 | /* PowerSaving Mode Options: |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 282 | * bit 0 = 1: CPE mode - to keep pcmcia if alive; |
| 283 | * bit 1 = 1: CINR reporing in Idlemode Msg |
| 284 | * bit 2 = 1: Default PSC Enable in sleepmode |
| 285 | */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 286 | B_UINT32 m_u32PowerSavingModeOptions; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 287 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 288 | B_UINT32 m_u32ArqEnable; |
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 | /* From Version #3, the HARQ section renamed as general */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 291 | B_UINT32 m_u32HarqEnable; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 292 | /* EEPROM Param Location */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 293 | B_UINT32 m_u32EEPROMFlag; |
| 294 | /* BINARY TYPE - 4th MSByte: |
| 295 | * Interface Type - 3rd MSByte: |
| 296 | * Vendor Type - 2nd MSByte |
| 297 | */ |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 298 | /* Unused - LSByte */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 299 | B_UINT32 m_u32Customize; |
| 300 | B_UINT32 m_u32ConfigBW; /* In Hz */ |
| 301 | B_UINT32 m_u32ShutDownTimer; |
| 302 | B_UINT32 m_u32RadioParameter; |
| 303 | B_UINT32 m_u32PhyParameter1; |
| 304 | B_UINT32 m_u32PhyParameter2; |
| 305 | B_UINT32 m_u32PhyParameter3; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 306 | |
| 307 | /* in eval mode only; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 308 | * lower 16bits = basic cid for testing; |
| 309 | * then bit 16 is test cqich, |
| 310 | * bit 17 test init rang; |
| 311 | * bit 18 test periodic rang |
| 312 | * bit 19 is test harq ack/nack |
| 313 | */ |
| 314 | B_UINT32 m_u32TestOptions; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 315 | B_UINT32 m_u32MaxMACDataperDLFrame; |
| 316 | B_UINT32 m_u32MaxMACDataperULFrame; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 317 | B_UINT32 m_u32Corr2MacFlags; |
| 318 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 319 | /* adding driver params. */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 320 | B_UINT32 HostDrvrConfig1; |
| 321 | B_UINT32 HostDrvrConfig2; |
| 322 | B_UINT32 HostDrvrConfig3; |
| 323 | B_UINT32 HostDrvrConfig4; |
| 324 | B_UINT32 HostDrvrConfig5; |
| 325 | B_UINT32 HostDrvrConfig6; |
| 326 | B_UINT32 m_u32SegmentedPUSCenable; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 327 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 328 | /* BAMC enable - but 4.x does not support this feature |
| 329 | * This is added just to sync 4.x and 5.x CFGs |
| 330 | */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 331 | B_UINT32 m_u32BandAMCEnable; |
| 332 | } STARGETPARAMS, *PSTARGETPARAMS; |
| 333 | #endif |
| 334 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 335 | typedef struct _STTARGETDSXBUFFER { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 336 | ULONG ulTargetDsxBuffer; |
| 337 | B_UINT16 tid; |
| 338 | BOOLEAN valid; |
| 339 | } STTARGETDSXBUFFER, *PSTTARGETDSXBUFFER; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 340 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 341 | typedef INT (*FP_FLASH_WRITE)(struct _MINI_ADAPTER *, UINT, PVOID); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 342 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 343 | typedef INT (*FP_FLASH_WRITE_STATUS)(struct _MINI_ADAPTER *, UINT, PVOID); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 344 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 345 | /* |
| 346 | * Driver adapter data structure |
| 347 | */ |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 348 | struct _MINI_ADAPTER { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 349 | struct _MINI_ADAPTER *next; |
Stephen Hemminger | 4fd64dd | 2010-11-01 12:12:31 -0400 | [diff] [blame] | 350 | struct net_device *dev; |
| 351 | u32 msg_enable; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 352 | CHAR *caDsxReqResp; |
Stephen Hemminger | 3349d95 | 2010-11-01 11:12:56 -0400 | [diff] [blame] | 353 | atomic_t ApplicationRunning; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 354 | volatile INT CtrlQueueLen; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 355 | atomic_t AppCtrlQueueLen; |
| 356 | BOOLEAN AppCtrlQueueOverFlow; |
Stephen Hemminger | 3349d95 | 2010-11-01 11:12:56 -0400 | [diff] [blame] | 357 | atomic_t CurrentApplicationCount; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 358 | atomic_t RegisteredApplicationCount; |
| 359 | BOOLEAN LinkUpStatus; |
| 360 | BOOLEAN TimerActive; |
Stephen Hemminger | 3349d95 | 2010-11-01 11:12:56 -0400 | [diff] [blame] | 361 | u32 StatisticsPointer; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 362 | struct sk_buff *RxControlHead; |
| 363 | struct sk_buff *RxControlTail; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 364 | struct semaphore RxAppControlQueuelock; |
| 365 | struct semaphore fw_download_sema; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 366 | PPER_TARANG_DATA pTarangs; |
| 367 | spinlock_t control_queue_lock; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 368 | wait_queue_head_t process_read_wait_queue; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 369 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 370 | /* the pointer to the first packet we have queued in send |
| 371 | * deserialized miniport support variables |
| 372 | */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 373 | atomic_t TotalPacketCount; |
| 374 | atomic_t TxPktAvail; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 375 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 376 | /* this to keep track of the Tx and Rx MailBox Registers. */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 377 | atomic_t CurrNumFreeTxDesc; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 378 | /* to keep track the no of byte received */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 379 | USHORT PrevNumRecvDescs; |
| 380 | USHORT CurrNumRecvDescs; |
| 381 | UINT u32TotalDSD; |
| 382 | PacketInfo PackInfo[NO_OF_QUEUES]; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 383 | S_CLASSIFIER_RULE astClassifierTable[MAX_CLASSIFIERS]; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 384 | BOOLEAN TransferMode; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 385 | |
| 386 | /*************** qos ******************/ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 387 | BOOLEAN bETHCSEnabled; |
| 388 | ULONG BEBucketSize; |
| 389 | ULONG rtPSBucketSize; |
| 390 | UCHAR LinkStatus; |
| 391 | BOOLEAN AutoLinkUp; |
| 392 | BOOLEAN AutoSyncup; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 393 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 394 | int major; |
| 395 | int minor; |
| 396 | wait_queue_head_t tx_packet_wait_queue; |
| 397 | wait_queue_head_t process_rx_cntrlpkt; |
| 398 | atomic_t process_waiting; |
| 399 | BOOLEAN fw_download_done; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 400 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 401 | char *txctlpacket[MAX_CNTRL_PKTS]; |
| 402 | atomic_t cntrlpktCnt ; |
| 403 | atomic_t index_app_read_cntrlpkt; |
| 404 | atomic_t index_wr_txcntrlpkt; |
| 405 | atomic_t index_rd_txcntrlpkt; |
| 406 | UINT index_datpkt; |
| 407 | struct semaphore rdmwrmsync; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 408 | |
| 409 | STTARGETDSXBUFFER astTargetDsxBuffer[MAX_TARGET_DSX_BUFFERS]; |
Stephen Hemminger | 3349d95 | 2010-11-01 11:12:56 -0400 | [diff] [blame] | 410 | ULONG ulFreeTargetBufferCnt; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 411 | ULONG ulCurrentTargetBuffer; |
| 412 | ULONG ulTotalTargetBuffersAvailable; |
| 413 | unsigned long chip_id; |
| 414 | wait_queue_head_t lowpower_mode_wait_queue; |
Stephen Hemminger | 3349d95 | 2010-11-01 11:12:56 -0400 | [diff] [blame] | 415 | BOOLEAN bFlashBoot; |
| 416 | BOOLEAN bBinDownloaded; |
| 417 | BOOLEAN bCfgDownloaded; |
| 418 | BOOLEAN bSyncUpRequestSent; |
| 419 | USHORT usBestEffortQueueIndex; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 420 | wait_queue_head_t ioctl_fw_dnld_wait_queue; |
| 421 | BOOLEAN waiting_to_fw_download_done; |
| 422 | pid_t fw_download_process_pid; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 423 | PSTARGETPARAMS pstargetparams; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 424 | BOOLEAN device_removed; |
| 425 | BOOLEAN DeviceAccess; |
| 426 | BOOLEAN bIsAutoCorrectEnabled; |
| 427 | BOOLEAN bDDRInitDone; |
| 428 | INT DDRSetting; |
| 429 | ULONG ulPowerSaveMode; |
| 430 | spinlock_t txtransmitlock; |
| 431 | B_UINT8 txtransmit_running; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 432 | /* Thread for control packet handling */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 433 | struct task_struct *control_packet_handler; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 434 | /* thread for transmitting packets. */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 435 | struct task_struct *transmit_packet_thread; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 436 | |
| 437 | /* LED Related Structures */ |
| 438 | LED_INFO_STRUCT LEDInfo; |
| 439 | |
| 440 | /* Driver State for LED Blinking */ |
| 441 | LedEventInfo_t DriverState; |
| 442 | /* Interface Specific */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 443 | PVOID pvInterfaceAdapter; |
| 444 | int (*bcm_file_download)(PVOID, |
| 445 | struct file *, |
| 446 | unsigned int); |
| 447 | int (*bcm_file_readback_from_chip)(PVOID, |
| 448 | struct file *, |
| 449 | unsigned int); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 450 | INT (*interface_rdm)(PVOID, |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 451 | UINT, |
| 452 | PVOID, |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 453 | INT); |
| 454 | INT (*interface_wrm)(PVOID, |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 455 | UINT, |
| 456 | PVOID, |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 457 | INT); |
| 458 | int (*interface_transmit)(PVOID, PVOID , UINT); |
| 459 | BOOLEAN IdleMode; |
| 460 | BOOLEAN bDregRequestSentInIdleMode; |
| 461 | BOOLEAN bTriedToWakeUpFromlowPowerMode; |
| 462 | BOOLEAN bShutStatus; |
| 463 | BOOLEAN bWakeUpDevice; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 464 | unsigned int usIdleModePattern; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 465 | /* BOOLEAN bTriedToWakeUpFromShutdown; */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 466 | BOOLEAN bLinkDownRequested; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 467 | int downloadDDR; |
| 468 | PHS_DEVICE_EXTENSION stBCMPhsContext; |
| 469 | S_HDR_SUPRESSION_CONTEXTINFO stPhsTxContextInfo; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 470 | uint8_t ucaPHSPktRestoreBuf[2048]; |
| 471 | uint8_t bPHSEnabled; |
Stephen Hemminger | 3349d95 | 2010-11-01 11:12:56 -0400 | [diff] [blame] | 472 | BOOLEAN AutoFirmDld; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 473 | BOOLEAN bMipsConfig; |
| 474 | BOOLEAN bDPLLConfig; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 475 | UINT32 aTxPktSizeHist[MIBS_MAX_HIST_ENTRIES]; |
| 476 | UINT32 aRxPktSizeHist[MIBS_MAX_HIST_ENTRIES]; |
| 477 | S_FRAGMENTED_PACKET_INFO astFragmentedPktClassifierTable[MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES]; |
| 478 | atomic_t uiMBupdate; |
| 479 | UINT32 PmuMode; |
| 480 | NVM_TYPE eNVMType; |
| 481 | UINT uiSectorSize; |
| 482 | UINT uiSectorSizeInCFG; |
| 483 | BOOLEAN bSectorSizeOverride; |
| 484 | BOOLEAN bStatusWrite; |
| 485 | UINT uiNVMDSDSize; |
| 486 | UINT uiVendorExtnFlag; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 487 | /* it will always represent chosen DSD at any point of time. |
| 488 | * Generally it is Active DSD but in case of NVM RD/WR it might be different. |
| 489 | */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 490 | UINT ulFlashCalStart; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 491 | ULONG ulFlashControlSectionStart; |
| 492 | ULONG ulFlashWriteSize; |
| 493 | ULONG ulFlashID; |
| 494 | FP_FLASH_WRITE fpFlashWrite; |
| 495 | FP_FLASH_WRITE_STATUS fpFlashWriteWithStatusCheck; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 496 | |
| 497 | struct semaphore NVMRdmWrmLock; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 498 | struct device *pstCreatedClassDevice; |
Stephen Hemminger | 3705a84 | 2010-10-29 08:14:16 -0700 | [diff] [blame] | 499 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 500 | /* BOOLEAN InterfaceUpStatus; */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 501 | PFLASH2X_CS_INFO psFlash2xCSInfo; |
| 502 | PFLASH_CS_INFO psFlashCSInfo; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 503 | PFLASH2X_VENDORSPECIFIC_INFO psFlash2xVendorInfo; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 504 | UINT uiFlashBaseAdd; /* Flash start address */ |
| 505 | UINT uiActiveISOOffset; /* Active ISO offset chosen before f/w download */ |
| 506 | FLASH2X_SECTION_VAL eActiveISO; /* Active ISO section val */ |
| 507 | FLASH2X_SECTION_VAL eActiveDSD; /* Active DSD val chosen before f/w download */ |
| 508 | UINT uiActiveDSDOffsetAtFwDld; /* For accessing Active DSD chosen before f/w download */ |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 509 | UINT uiFlashLayoutMajorVersion; |
| 510 | UINT uiFlashLayoutMinorVersion; |
| 511 | BOOLEAN bAllDSDWriteAllow; |
| 512 | BOOLEAN bSigCorrupted; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 513 | /* 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] | 514 | BOOLEAN bHeaderChangeAllowed; |
| 515 | INT SelectedChip; |
| 516 | BOOLEAN bEndPointHalted; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 517 | /* 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] | 518 | BOOLEAN bFlashRawRead; |
| 519 | BOOLEAN bPreparingForLowPowerMode; |
| 520 | BOOLEAN bDoSuspend; |
| 521 | UINT syscfgBefFwDld; |
| 522 | BOOLEAN StopAllXaction; |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 523 | UINT32 liTimeSinceLastNetEntry; /* Used to Support extended CAPI requirements from */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 524 | struct semaphore LowPowerModeSync; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 525 | ULONG liDrainCalculated; |
| 526 | UINT gpioBitMap; |
| 527 | S_BCM_DEBUG_STATE stDebugState; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 528 | }; |
| 529 | typedef struct _MINI_ADAPTER MINI_ADAPTER, *PMINI_ADAPTER; |
| 530 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 531 | #define GET_BCM_ADAPTER(net_dev) netdev_priv(net_dev) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 532 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 533 | struct _ETH_HEADER_STRUC { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 534 | UCHAR au8DestinationAddress[6]; |
| 535 | UCHAR au8SourceAddress[6]; |
| 536 | USHORT u16Etype; |
| 537 | } __attribute__((packed)); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 538 | typedef struct _ETH_HEADER_STRUC ETH_HEADER_STRUC, *PETH_HEADER_STRUC; |
| 539 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 540 | typedef struct FirmwareInfo { |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 541 | void __user *pvMappedFirmwareAddress; |
| 542 | ULONG u32FirmwareLength; |
| 543 | ULONG u32StartingAddress; |
| 544 | } __attribute__((packed)) FIRMWARE_INFO, *PFIRMWARE_INFO; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 545 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 546 | /* holds the value of net_device structure.. */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 547 | extern struct net_device *gblpnetdev; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 548 | typedef struct _cntl_pkt { |
| 549 | PMINI_ADAPTER Adapter; |
| 550 | PLEADER PLeader; |
| 551 | } cntl_pkt; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 552 | typedef LINK_REQUEST CONTROL_MESSAGE; |
| 553 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 554 | typedef struct _DDR_SETTING { |
Alejandro R. SedeƱo | b706113 | 2010-11-10 01:42:01 -0500 | [diff] [blame] | 555 | UINT ulRegAddress; |
| 556 | UINT ulRegValue; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 557 | } DDR_SETTING, *PDDR_SETTING; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 558 | typedef DDR_SETTING DDR_SET_NODE, *PDDR_SET_NODE; |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 559 | INT InitAdapter(PMINI_ADAPTER psAdapter); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 560 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 561 | /* ===================================================================== |
| 562 | * Beceem vendor request codes for EP0 |
| 563 | * ===================================================================== |
| 564 | */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 565 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 566 | #define BCM_REQUEST_READ 0x2 |
| 567 | #define BCM_REQUEST_WRITE 0x1 |
| 568 | #define EP2_MPS_REG 0x0F0110A0 |
| 569 | #define EP2_MPS 0x40 |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 570 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 571 | #define EP2_CFG_REG 0x0F0110A8 |
| 572 | #define EP2_CFG_INT 0x27 |
| 573 | #define EP2_CFG_BULK 0x25 |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 574 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 575 | #define EP4_MPS_REG 0x0F0110F0 |
| 576 | #define EP4_MPS 0x8C |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 577 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 578 | #define EP4_CFG_REG 0x0F0110F8 |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 579 | |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 580 | #define ISO_MPS_REG 0x0F0110C8 |
| 581 | #define ISO_MPS 0x00000000 |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 582 | |
| 583 | #define EP1 0 |
| 584 | #define EP2 1 |
| 585 | #define EP3 2 |
| 586 | #define EP4 3 |
| 587 | #define EP5 4 |
| 588 | #define EP6 5 |
| 589 | |
Kevin McKinney | c71e0a6 | 2012-05-18 08:50:54 -0400 | [diff] [blame] | 590 | typedef enum eInterface_setting { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 591 | DEFAULT_SETTING_0 = 0, |
| 592 | ALTERNATE_SETTING_1 = 1, |
Kevin McKinney | 9094214 | 2012-05-18 08:50:55 -0400 | [diff] [blame] | 593 | } INTERFACE_SETTING; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 594 | |
Kevin McKinney | 5db647a | 2012-05-18 08:50:56 -0400 | [diff] [blame^] | 595 | #endif /* __ADAPTER_H__ */ |