Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1 | /************************************************************ |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 2 | * CMHOST.C |
| 3 | * This file contains the routines for handling Connection |
| 4 | * Management. |
| 5 | ************************************************************/ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 6 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 7 | /* #define CONN_MSG */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 8 | #include "headers.h" |
| 9 | |
Kevin McKinney | 5db125f | 2012-01-04 20:29:02 -0500 | [diff] [blame] | 10 | enum E_CLASSIFIER_ACTION { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 11 | eInvalidClassifierAction, |
| 12 | eAddClassifier, |
| 13 | eReplaceClassifier, |
| 14 | eDeleteClassifier |
Kevin McKinney | 5db125f | 2012-01-04 20:29:02 -0500 | [diff] [blame] | 15 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 16 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 17 | static ULONG GetNextTargetBufferLocation(PMINI_ADAPTER Adapter, B_UINT16 tid); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 18 | |
| 19 | /************************************************************ |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 20 | * Function - SearchSfid |
| 21 | * |
| 22 | * Description - This routinue would search QOS queues having |
| 23 | * specified SFID as input parameter. |
| 24 | * |
| 25 | * Parameters - Adapter: Pointer to the Adapter structure |
| 26 | * uiSfid : Given SFID for matching |
| 27 | * |
| 28 | * Returns - Queue index for this SFID(If matched) |
| 29 | * Else Invalid Queue Index(If Not matched) |
| 30 | ************************************************************/ |
Kevin McKinney | ce4bbc2 | 2012-01-04 20:29:04 -0500 | [diff] [blame] | 31 | int SearchSfid(PMINI_ADAPTER Adapter, UINT uiSfid) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 32 | { |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 33 | int i; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 34 | |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 35 | for (i = (NO_OF_QUEUES-1); i >= 0; i--) |
| 36 | if (Adapter->PackInfo[i].ulSFID == uiSfid) |
| 37 | return i; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 38 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 39 | return NO_OF_QUEUES+1; |
| 40 | } |
| 41 | |
| 42 | /*************************************************************** |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 43 | * Function -SearchFreeSfid |
| 44 | * |
| 45 | * Description - This routinue would search Free available SFID. |
| 46 | * |
| 47 | * Parameter - Adapter: Pointer to the Adapter structure |
| 48 | * |
| 49 | * Returns - Queue index for the free SFID |
| 50 | * Else returns Invalid Index. |
| 51 | ****************************************************************/ |
Kevin McKinney | ce4bbc2 | 2012-01-04 20:29:04 -0500 | [diff] [blame] | 52 | static int SearchFreeSfid(PMINI_ADAPTER Adapter) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 53 | { |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 54 | int i; |
Stephen Hemminger | 20f4865 | 2010-10-31 23:52:36 -0400 | [diff] [blame] | 55 | |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 56 | for (i = 0; i < (NO_OF_QUEUES-1); i++) |
| 57 | if (Adapter->PackInfo[i].ulSFID == 0) |
| 58 | return i; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 59 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 60 | return NO_OF_QUEUES+1; |
| 61 | } |
| 62 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 63 | /* |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 64 | * Function: SearchClsid |
| 65 | * Description: This routinue would search Classifier having specified ClassifierID as input parameter |
| 66 | * Input parameters: PMINI_ADAPTER Adapter - Adapter Context |
| 67 | * unsigned int uiSfid - The SF in which the classifier is to searched |
| 68 | * B_UINT16 uiClassifierID - The classifier ID to be searched |
| 69 | * Return: int :Classifier table index of matching entry |
| 70 | */ |
| 71 | static int SearchClsid(PMINI_ADAPTER Adapter, ULONG ulSFID, B_UINT16 uiClassifierID) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 72 | { |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 73 | int i; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 74 | |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 75 | for (i = 0; i < MAX_CLASSIFIERS; i++) { |
| 76 | if ((Adapter->astClassifierTable[i].bUsed) && |
| 77 | (Adapter->astClassifierTable[i].uiClassifierRuleIndex == uiClassifierID) && |
| 78 | (Adapter->astClassifierTable[i].ulSFID == ulSFID)) |
| 79 | return i; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 80 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 81 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 82 | return MAX_CLASSIFIERS+1; |
| 83 | } |
| 84 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 85 | /* |
| 86 | * @ingroup ctrl_pkt_functions |
| 87 | * This routinue would search Free available Classifier entry in classifier table. |
| 88 | * @return free Classifier Entry index in classifier table for specified SF |
| 89 | */ |
| 90 | static int SearchFreeClsid(PMINI_ADAPTER Adapter /**Adapter Context*/) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 91 | { |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 92 | int i; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 93 | |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 94 | for (i = 0; i < MAX_CLASSIFIERS; i++) { |
| 95 | if (!Adapter->astClassifierTable[i].bUsed) |
| 96 | return i; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 97 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 98 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 99 | return MAX_CLASSIFIERS+1; |
| 100 | } |
| 101 | |
Stephen Hemminger | 9dd47ee | 2010-11-01 12:24:00 -0400 | [diff] [blame] | 102 | static VOID deleteSFBySfid(PMINI_ADAPTER Adapter, UINT uiSearchRuleIndex) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 103 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 104 | /* deleting all the packet held in the SF */ |
| 105 | flush_queue(Adapter, uiSearchRuleIndex); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 106 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 107 | /* Deleting the all classifiers for this SF */ |
| 108 | DeleteAllClassifiersForSF(Adapter, uiSearchRuleIndex); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 109 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 110 | /* Resetting only MIBS related entries in the SF */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 111 | memset((PVOID)&Adapter->PackInfo[uiSearchRuleIndex], 0, sizeof(S_MIBS_SERVICEFLOW_TABLE)); |
| 112 | } |
| 113 | |
| 114 | static inline VOID |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 115 | CopyIpAddrToClassifier(S_CLASSIFIER_RULE *pstClassifierEntry, |
| 116 | B_UINT8 u8IpAddressLen, B_UINT8 *pu8IpAddressMaskSrc, |
| 117 | BOOLEAN bIpVersion6, E_IPADDR_CONTEXT eIpAddrContext) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 118 | { |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 119 | int i = 0; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 120 | UINT nSizeOfIPAddressInBytes = IP_LENGTH_OF_ADDRESS; |
| 121 | UCHAR *ptrClassifierIpAddress = NULL; |
| 122 | UCHAR *ptrClassifierIpMask = NULL; |
| 123 | PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 124 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 125 | if (bIpVersion6) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 126 | nSizeOfIPAddressInBytes = IPV6_ADDRESS_SIZEINBYTES; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 127 | |
| 128 | /* Destination Ip Address */ |
| 129 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Ip Address Range Length:0x%X ", u8IpAddressLen); |
| 130 | if ((bIpVersion6 ? (IPV6_ADDRESS_SIZEINBYTES * MAX_IP_RANGE_LENGTH * 2) : |
| 131 | (TOTAL_MASKED_ADDRESS_IN_BYTES)) >= u8IpAddressLen) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 132 | /* |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 133 | * checking both the mask and address togethor in Classification. |
| 134 | * So length will be : TotalLengthInBytes/nSizeOfIPAddressInBytes * 2 |
| 135 | * (nSizeOfIPAddressInBytes for address and nSizeOfIPAddressInBytes for mask) |
| 136 | */ |
| 137 | if (eIpAddrContext == eDestIpAddress) { |
| 138 | pstClassifierEntry->ucIPDestinationAddressLength = u8IpAddressLen/(nSizeOfIPAddressInBytes * 2); |
| 139 | if (bIpVersion6) { |
| 140 | ptrClassifierIpAddress = pstClassifierEntry->stDestIpAddress.ucIpv6Address; |
| 141 | ptrClassifierIpMask = pstClassifierEntry->stDestIpAddress.ucIpv6Mask; |
| 142 | } else { |
| 143 | ptrClassifierIpAddress = pstClassifierEntry->stDestIpAddress.ucIpv4Address; |
| 144 | ptrClassifierIpMask = pstClassifierEntry->stDestIpAddress.ucIpv4Mask; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 145 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 146 | } else if (eIpAddrContext == eSrcIpAddress) { |
| 147 | pstClassifierEntry->ucIPSourceAddressLength = u8IpAddressLen/(nSizeOfIPAddressInBytes * 2); |
| 148 | if (bIpVersion6) { |
| 149 | ptrClassifierIpAddress = pstClassifierEntry->stSrcIpAddress.ucIpv6Address; |
| 150 | ptrClassifierIpMask = pstClassifierEntry->stSrcIpAddress.ucIpv6Mask; |
| 151 | } else { |
| 152 | ptrClassifierIpAddress = pstClassifierEntry->stSrcIpAddress.ucIpv4Address; |
| 153 | ptrClassifierIpMask = pstClassifierEntry->stSrcIpAddress.ucIpv4Mask; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 154 | } |
| 155 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 156 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Address Length:0x%X\n", pstClassifierEntry->ucIPDestinationAddressLength); |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 157 | while ((u8IpAddressLen >= nSizeOfIPAddressInBytes) && (i < MAX_IP_RANGE_LENGTH)) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 158 | memcpy(ptrClassifierIpAddress + |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 159 | (i * nSizeOfIPAddressInBytes), |
| 160 | (pu8IpAddressMaskSrc+(i*nSizeOfIPAddressInBytes*2)), |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 161 | nSizeOfIPAddressInBytes); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 162 | |
| 163 | if (!bIpVersion6) { |
| 164 | if (eIpAddrContext == eSrcIpAddress) { |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 165 | pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[i] = ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[i]); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 166 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Src Ip Address:0x%luX ", |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 167 | pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[i]); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 168 | } else if (eIpAddrContext == eDestIpAddress) { |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 169 | pstClassifierEntry->stDestIpAddress.ulIpv4Addr[i] = ntohl(pstClassifierEntry->stDestIpAddress.ulIpv4Addr[i]); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 170 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Dest Ip Address:0x%luX ", |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 171 | pstClassifierEntry->stDestIpAddress.ulIpv4Addr[i]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 172 | } |
| 173 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 174 | u8IpAddressLen -= nSizeOfIPAddressInBytes; |
| 175 | if (u8IpAddressLen >= nSizeOfIPAddressInBytes) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 176 | memcpy(ptrClassifierIpMask + |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 177 | (i * nSizeOfIPAddressInBytes), |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 178 | (pu8IpAddressMaskSrc+nSizeOfIPAddressInBytes + |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 179 | (i*nSizeOfIPAddressInBytes*2)), |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 180 | nSizeOfIPAddressInBytes); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 181 | |
| 182 | if (!bIpVersion6) { |
| 183 | if (eIpAddrContext == eSrcIpAddress) { |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 184 | pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[i] = |
| 185 | ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[i]); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 186 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Src Ip Mask Address:0x%luX ", |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 187 | pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[i]); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 188 | } else if (eIpAddrContext == eDestIpAddress) { |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 189 | pstClassifierEntry->stDestIpAddress.ulIpv4Mask[i] = |
| 190 | ntohl(pstClassifierEntry->stDestIpAddress.ulIpv4Mask[i]); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 191 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Dest Ip Mask Address:0x%luX ", |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 192 | pstClassifierEntry->stDestIpAddress.ulIpv4Mask[i]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 193 | } |
| 194 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 195 | u8IpAddressLen -= nSizeOfIPAddressInBytes; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 196 | } |
Kevin McKinney | cffae18 | 2012-01-04 20:29:03 -0500 | [diff] [blame] | 197 | if (u8IpAddressLen == 0) |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 198 | pstClassifierEntry->bDestIpValid = TRUE; |
| 199 | |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 200 | i++; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 201 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 202 | if (bIpVersion6) { |
| 203 | /* Restore EndianNess of Struct */ |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 204 | for (i = 0; i < MAX_IP_RANGE_LENGTH * 4; i++) { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 205 | if (eIpAddrContext == eSrcIpAddress) { |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 206 | pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[i] = ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[i]); |
| 207 | pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[i] = ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[i]); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 208 | } else if (eIpAddrContext == eDestIpAddress) { |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 209 | pstClassifierEntry->stDestIpAddress.ulIpv6Addr[i] = ntohl(pstClassifierEntry->stDestIpAddress.ulIpv6Addr[i]); |
| 210 | pstClassifierEntry->stDestIpAddress.ulIpv6Mask[i] = ntohl(pstClassifierEntry->stDestIpAddress.ulIpv6Mask[i]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 211 | } |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | } |
| 216 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 217 | void ClearTargetDSXBuffer(PMINI_ADAPTER Adapter, B_UINT16 TID, BOOLEAN bFreeAll) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 218 | { |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 219 | int i; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 220 | |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 221 | for (i = 0; i < Adapter->ulTotalTargetBuffersAvailable; i++) { |
| 222 | if (Adapter->astTargetDsxBuffer[i].valid) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 223 | continue; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 224 | |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 225 | if ((bFreeAll) || (Adapter->astTargetDsxBuffer[i].tid == TID)) { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 226 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "ClearTargetDSXBuffer: found tid %d buffer cleared %lx\n", |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 227 | TID, Adapter->astTargetDsxBuffer[i].ulTargetDsxBuffer); |
| 228 | Adapter->astTargetDsxBuffer[i].valid = 1; |
| 229 | Adapter->astTargetDsxBuffer[i].tid = 0; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 230 | Adapter->ulFreeTargetBufferCnt++; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 231 | } |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 232 | } |
| 233 | } |
| 234 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 235 | /* |
| 236 | * @ingroup ctrl_pkt_functions |
| 237 | * copy classifier rule into the specified SF index |
| 238 | */ |
| 239 | static inline VOID CopyClassifierRuleToSF(PMINI_ADAPTER Adapter, stConvergenceSLTypes *psfCSType, UINT uiSearchRuleIndex, UINT nClassifierIndex) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 240 | { |
| 241 | S_CLASSIFIER_RULE *pstClassifierEntry = NULL; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 242 | /* VOID *pvPhsContext = NULL; */ |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 243 | int i; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 244 | /* UCHAR ucProtocolLength=0; */ |
| 245 | /* ULONG ulPhsStatus; */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 246 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 247 | if (Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value == 0 || |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 248 | nClassifierIndex > (MAX_CLASSIFIERS-1)) |
| 249 | return; |
| 250 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 251 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Storing Classifier Rule Index : %X", |
| 252 | ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex)); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 253 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 254 | if (nClassifierIndex > MAX_CLASSIFIERS-1) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 255 | return; |
| 256 | |
| 257 | pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex]; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 258 | if (pstClassifierEntry) { |
| 259 | /* Store if Ipv6 */ |
| 260 | pstClassifierEntry->bIpv6Protocol = (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6) ? TRUE : FALSE; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 261 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 262 | /* Destinaiton Port */ |
| 263 | pstClassifierEntry->ucDestPortRangeLength = psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength / 4; |
| 264 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Destination Port Range Length:0x%X ", pstClassifierEntry->ucDestPortRangeLength); |
| 265 | |
Kevin McKinney | cffae18 | 2012-01-04 20:29:03 -0500 | [diff] [blame] | 266 | if (psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength <= MAX_PORT_RANGE) { |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 267 | for (i = 0; i < (pstClassifierEntry->ucDestPortRangeLength); i++) { |
| 268 | pstClassifierEntry->usDestPortRangeLo[i] = *((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+i)); |
| 269 | pstClassifierEntry->usDestPortRangeHi[i] = |
| 270 | *((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+2+i)); |
| 271 | pstClassifierEntry->usDestPortRangeLo[i] = ntohs(pstClassifierEntry->usDestPortRangeLo[i]); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 272 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Destination Port Range Lo:0x%X ", |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 273 | pstClassifierEntry->usDestPortRangeLo[i]); |
| 274 | pstClassifierEntry->usDestPortRangeHi[i] = ntohs(pstClassifierEntry->usDestPortRangeHi[i]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 275 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 276 | } else { |
| 277 | pstClassifierEntry->ucDestPortRangeLength = 0; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 278 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 279 | |
| 280 | /* Source Port */ |
| 281 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Source Port Range Length:0x%X ", |
| 282 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength); |
Kevin McKinney | cffae18 | 2012-01-04 20:29:03 -0500 | [diff] [blame] | 283 | if (psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength <= MAX_PORT_RANGE) { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 284 | pstClassifierEntry->ucSrcPortRangeLength = psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength/4; |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 285 | for (i = 0; i < (pstClassifierEntry->ucSrcPortRangeLength); i++) { |
| 286 | pstClassifierEntry->usSrcPortRangeLo[i] = |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 287 | *((PUSHORT)(psfCSType->cCPacketClassificationRule. |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 288 | u8ProtocolSourcePortRange+i)); |
| 289 | pstClassifierEntry->usSrcPortRangeHi[i] = |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 290 | *((PUSHORT)(psfCSType->cCPacketClassificationRule. |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 291 | u8ProtocolSourcePortRange+2+i)); |
| 292 | pstClassifierEntry->usSrcPortRangeLo[i] = |
| 293 | ntohs(pstClassifierEntry->usSrcPortRangeLo[i]); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 294 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Source Port Range Lo:0x%X ", |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 295 | pstClassifierEntry->usSrcPortRangeLo[i]); |
| 296 | pstClassifierEntry->usSrcPortRangeHi[i] = ntohs(pstClassifierEntry->usSrcPortRangeHi[i]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 297 | } |
| 298 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 299 | /* Destination Ip Address and Mask */ |
| 300 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Ip Destination Parameters : "); |
| 301 | CopyIpAddrToClassifier(pstClassifierEntry, |
| 302 | psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength, |
| 303 | psfCSType->cCPacketClassificationRule.u8IPDestinationAddress, |
| 304 | (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6) ? |
| 305 | TRUE : FALSE, eDestIpAddress); |
| 306 | |
| 307 | /* Source Ip Address and Mask */ |
| 308 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Ip Source Parameters : "); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 309 | |
| 310 | CopyIpAddrToClassifier(pstClassifierEntry, |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 311 | psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength, |
| 312 | psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress, |
| 313 | (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6) ? TRUE : FALSE, |
| 314 | eSrcIpAddress); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 315 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 316 | /* TOS */ |
| 317 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "TOS Length:0x%X ", psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength); |
Kevin McKinney | cffae18 | 2012-01-04 20:29:03 -0500 | [diff] [blame] | 318 | if (psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength == 3) { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 319 | pstClassifierEntry->ucIPTypeOfServiceLength = psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength; |
| 320 | pstClassifierEntry->ucTosLow = psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0]; |
| 321 | pstClassifierEntry->ucTosHigh = psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1]; |
| 322 | pstClassifierEntry->ucTosMask = psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 323 | pstClassifierEntry->bTOSValid = TRUE; |
| 324 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 325 | if (psfCSType->cCPacketClassificationRule.u8Protocol == 0) { |
| 326 | /* we didn't get protocol field filled in by the BS */ |
| 327 | pstClassifierEntry->ucProtocolLength = 0; |
| 328 | } else { |
| 329 | pstClassifierEntry->ucProtocolLength = 1; /* 1 valid protocol */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 330 | } |
| 331 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 332 | pstClassifierEntry->ucProtocol[0] = psfCSType->cCPacketClassificationRule.u8Protocol; |
| 333 | pstClassifierEntry->u8ClassifierRulePriority = psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 334 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 335 | /* store the classifier rule ID and set this classifier entry as valid */ |
| 336 | pstClassifierEntry->ucDirection = Adapter->PackInfo[uiSearchRuleIndex].ucDirection; |
| 337 | pstClassifierEntry->uiClassifierRuleIndex = ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex); |
| 338 | pstClassifierEntry->usVCID_Value = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value; |
| 339 | pstClassifierEntry->ulSFID = Adapter->PackInfo[uiSearchRuleIndex].ulSFID; |
| 340 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Search Index %d Dir: %d, Index: %d, Vcid: %d\n", |
| 341 | uiSearchRuleIndex, pstClassifierEntry->ucDirection, |
| 342 | pstClassifierEntry->uiClassifierRuleIndex, |
| 343 | pstClassifierEntry->usVCID_Value); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 344 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 345 | if (psfCSType->cCPacketClassificationRule.u8AssociatedPHSI) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 346 | pstClassifierEntry->u8AssociatedPHSI = psfCSType->cCPacketClassificationRule.u8AssociatedPHSI; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 347 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 348 | /* Copy ETH CS Parameters */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 349 | pstClassifierEntry->ucEthCSSrcMACLen = (psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddressLength); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 350 | memcpy(pstClassifierEntry->au8EThCSSrcMAC, psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress, MAC_ADDRESS_SIZE); |
| 351 | memcpy(pstClassifierEntry->au8EThCSSrcMACMask, psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress + MAC_ADDRESS_SIZE, MAC_ADDRESS_SIZE); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 352 | pstClassifierEntry->ucEthCSDestMACLen = (psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 353 | memcpy(pstClassifierEntry->au8EThCSDestMAC, psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress, MAC_ADDRESS_SIZE); |
| 354 | memcpy(pstClassifierEntry->au8EThCSDestMACMask, psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress + MAC_ADDRESS_SIZE, MAC_ADDRESS_SIZE); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 355 | pstClassifierEntry->ucEtherTypeLen = (psfCSType->cCPacketClassificationRule.u8EthertypeLength); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 356 | memcpy(pstClassifierEntry->au8EthCSEtherType, psfCSType->cCPacketClassificationRule.u8Ethertype, NUM_ETHERTYPE_BYTES); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 357 | memcpy(pstClassifierEntry->usUserPriority, &psfCSType->cCPacketClassificationRule.u16UserPriority, 2); |
| 358 | pstClassifierEntry->usVLANID = ntohs(psfCSType->cCPacketClassificationRule.u16VLANID); |
| 359 | pstClassifierEntry->usValidityBitMap = ntohs(psfCSType->cCPacketClassificationRule.u16ValidityBitMap); |
| 360 | |
| 361 | pstClassifierEntry->bUsed = TRUE; |
| 362 | } |
| 363 | } |
| 364 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 365 | /* |
| 366 | * @ingroup ctrl_pkt_functions |
| 367 | */ |
| 368 | static inline VOID DeleteClassifierRuleFromSF(PMINI_ADAPTER Adapter, UINT uiSearchRuleIndex, UINT nClassifierIndex) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 369 | { |
| 370 | S_CLASSIFIER_RULE *pstClassifierEntry = NULL; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 371 | B_UINT16 u16PacketClassificationRuleIndex; |
| 372 | USHORT usVCID; |
| 373 | /* VOID *pvPhsContext = NULL; */ |
| 374 | /*ULONG ulPhsStatus; */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 375 | |
| 376 | usVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value; |
| 377 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 378 | if (nClassifierIndex > MAX_CLASSIFIERS-1) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 379 | return; |
| 380 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 381 | if (usVCID == 0) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 382 | return; |
| 383 | |
| 384 | u16PacketClassificationRuleIndex = Adapter->astClassifierTable[nClassifierIndex].uiClassifierRuleIndex; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 385 | pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex]; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 386 | if (pstClassifierEntry) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 387 | pstClassifierEntry->bUsed = FALSE; |
| 388 | pstClassifierEntry->uiClassifierRuleIndex = 0; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 389 | memset(pstClassifierEntry, 0, sizeof(S_CLASSIFIER_RULE)); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 390 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 391 | /* Delete the PHS Rule for this classifier */ |
| 392 | PhsDeleteClassifierRule(&Adapter->stBCMPhsContext, usVCID, u16PacketClassificationRuleIndex); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 393 | } |
| 394 | } |
| 395 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 396 | /* |
| 397 | * @ingroup ctrl_pkt_functions |
| 398 | */ |
| 399 | VOID DeleteAllClassifiersForSF(PMINI_ADAPTER Adapter, UINT uiSearchRuleIndex) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 400 | { |
| 401 | S_CLASSIFIER_RULE *pstClassifierEntry = NULL; |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 402 | int i; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 403 | /* B_UINT16 u16PacketClassificationRuleIndex; */ |
| 404 | USHORT ulVCID; |
| 405 | /* VOID *pvPhsContext = NULL; */ |
| 406 | /* ULONG ulPhsStatus; */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 407 | |
| 408 | ulVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value; |
| 409 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 410 | if (ulVCID == 0) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 411 | return; |
| 412 | |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 413 | for (i = 0; i < MAX_CLASSIFIERS; i++) { |
| 414 | if (Adapter->astClassifierTable[i].usVCID_Value == ulVCID) { |
| 415 | pstClassifierEntry = &Adapter->astClassifierTable[i]; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 416 | |
| 417 | if (pstClassifierEntry->bUsed) |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 418 | DeleteClassifierRuleFromSF(Adapter, uiSearchRuleIndex, i); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 419 | } |
| 420 | } |
| 421 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 422 | /* Delete All Phs Rules Associated with this SF */ |
| 423 | PhsDeleteSFRules(&Adapter->stBCMPhsContext, ulVCID); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 424 | } |
| 425 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 426 | /* |
| 427 | * This routinue copies the Connection Management |
| 428 | * related data into the Adapter structure. |
| 429 | * @ingroup ctrl_pkt_functions |
| 430 | */ |
| 431 | static VOID CopyToAdapter(register PMINI_ADAPTER Adapter, /* <Pointer to the Adapter structure */ |
| 432 | register pstServiceFlowParamSI psfLocalSet, /* <Pointer to the ServiceFlowParamSI structure */ |
| 433 | register UINT uiSearchRuleIndex, /* <Index of Queue, to which this data belongs */ |
| 434 | register UCHAR ucDsxType, |
| 435 | stLocalSFAddIndicationAlt *pstAddIndication) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 436 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 437 | /* UCHAR ucProtocolLength = 0; */ |
| 438 | ULONG ulSFID; |
| 439 | UINT nClassifierIndex = 0; |
Kevin McKinney | 5db125f | 2012-01-04 20:29:02 -0500 | [diff] [blame] | 440 | enum E_CLASSIFIER_ACTION eClassifierAction = eInvalidClassifierAction; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 441 | B_UINT16 u16PacketClassificationRuleIndex = 0; |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 442 | int i; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 443 | stConvergenceSLTypes *psfCSType = NULL; |
| 444 | S_PHS_RULE sPhsRule; |
| 445 | USHORT uVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value; |
| 446 | UINT UGIValue = 0; |
| 447 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 448 | Adapter->PackInfo[uiSearchRuleIndex].bValid = TRUE; |
| 449 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Search Rule Index = %d\n", uiSearchRuleIndex); |
Kevin McKinney | e486862 | 2012-01-04 20:29:01 -0500 | [diff] [blame] | 450 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "%s: SFID= %x ", __func__, ntohl(psfLocalSet->u32SFID)); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 451 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Updating Queue %d", uiSearchRuleIndex); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 452 | |
| 453 | ulSFID = ntohl(psfLocalSet->u32SFID); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 454 | /* Store IP Version used */ |
| 455 | /* Get The Version Of IP used (IPv6 or IPv4) from CSSpecification field of SF */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 456 | |
| 457 | Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = 0; |
| 458 | Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 0; |
| 459 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 460 | /* Enable IP/ETh CS Support As Required */ |
| 461 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "CopyToAdapter : u8CSSpecification : %X\n", psfLocalSet->u8CSSpecification); |
| 462 | switch (psfLocalSet->u8CSSpecification) { |
| 463 | case eCSPacketIPV4: |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 464 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 465 | Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS; |
| 466 | break; |
| 467 | } |
| 468 | case eCSPacketIPV6: |
| 469 | { |
| 470 | Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV6_CS; |
| 471 | break; |
| 472 | } |
| 473 | case eCS802_3PacketEthernet: |
| 474 | case eCS802_1QPacketVLAN: |
| 475 | { |
| 476 | Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3; |
| 477 | break; |
| 478 | } |
| 479 | case eCSPacketIPV4Over802_1QVLAN: |
| 480 | case eCSPacketIPV4Over802_3Ethernet: |
| 481 | { |
| 482 | Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS; |
| 483 | Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3; |
| 484 | break; |
| 485 | } |
| 486 | case eCSPacketIPV6Over802_1QVLAN: |
| 487 | case eCSPacketIPV6Over802_3Ethernet: |
| 488 | { |
| 489 | Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV6_CS; |
| 490 | Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3; |
| 491 | break; |
| 492 | } |
| 493 | default: |
| 494 | { |
| 495 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Error in value of CS Classification.. setting default to IP CS\n"); |
| 496 | Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS; |
| 497 | break; |
| 498 | } |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 499 | } |
| 500 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 501 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "CopyToAdapter : Queue No : %X ETH CS Support : %X , IP CS Support : %X\n", |
| 502 | uiSearchRuleIndex, |
| 503 | Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport, |
| 504 | Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 505 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 506 | /* Store IP Version used */ |
| 507 | /* Get The Version Of IP used (IPv6 or IPv4) from CSSpecification field of SF */ |
| 508 | if (Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport == IPV6_CS) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 509 | Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion = IPV6; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 510 | else |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 511 | Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion = IPV4; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 512 | |
| 513 | /* To ensure that the ETH CS code doesn't gets executed if the BS doesn't supports ETH CS */ |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 514 | if (!Adapter->bETHCSEnabled) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 515 | Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 0; |
| 516 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 517 | if (psfLocalSet->u8ServiceClassNameLength > 0 && psfLocalSet->u8ServiceClassNameLength < 32) |
| 518 | memcpy(Adapter->PackInfo[uiSearchRuleIndex].ucServiceClassName, psfLocalSet->u8ServiceClassName, psfLocalSet->u8ServiceClassNameLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 519 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 520 | Adapter->PackInfo[uiSearchRuleIndex].u8QueueType = psfLocalSet->u8ServiceFlowSchedulingType; |
| 521 | |
| 522 | if (Adapter->PackInfo[uiSearchRuleIndex].u8QueueType == BE && Adapter->PackInfo[uiSearchRuleIndex].ucDirection) |
| 523 | Adapter->usBestEffortQueueIndex = uiSearchRuleIndex; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 524 | |
| 525 | Adapter->PackInfo[uiSearchRuleIndex].ulSFID = ntohl(psfLocalSet->u32SFID); |
| 526 | |
| 527 | Adapter->PackInfo[uiSearchRuleIndex].u8TrafficPriority = psfLocalSet->u8TrafficPriority; |
| 528 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 529 | /* copy all the classifier in the Service Flow param structure */ |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 530 | for (i = 0; i < psfLocalSet->u8TotalClassifiers; i++) { |
| 531 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Classifier index =%d", i); |
| 532 | psfCSType = &psfLocalSet->cConvergenceSLTypes[i]; |
| 533 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Classifier index =%d", i); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 534 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 535 | if (psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority) |
| 536 | Adapter->PackInfo[uiSearchRuleIndex].bClassifierPriority = TRUE; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 537 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 538 | if (psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority) |
| 539 | Adapter->PackInfo[uiSearchRuleIndex].bClassifierPriority = TRUE; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 540 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 541 | if (ucDsxType == DSA_ACK) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 542 | eClassifierAction = eAddClassifier; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 543 | } else if (ucDsxType == DSC_ACK) { |
| 544 | switch (psfCSType->u8ClassfierDSCAction) { |
| 545 | case 0: /* DSC Add Classifier */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 546 | { |
| 547 | eClassifierAction = eAddClassifier; |
| 548 | } |
| 549 | break; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 550 | case 1: /* DSC Replace Classifier */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 551 | { |
| 552 | eClassifierAction = eReplaceClassifier; |
| 553 | } |
| 554 | break; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 555 | case 2: /* DSC Delete Classifier */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 556 | { |
| 557 | eClassifierAction = eDeleteClassifier; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 558 | } |
| 559 | break; |
| 560 | default: |
| 561 | { |
| 562 | eClassifierAction = eInvalidClassifierAction; |
| 563 | } |
| 564 | } |
| 565 | } |
| 566 | |
| 567 | u16PacketClassificationRuleIndex = ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex); |
| 568 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 569 | switch (eClassifierAction) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 570 | case eAddClassifier: |
| 571 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 572 | /* Get a Free Classifier Index From Classifier table for this SF to add the Classifier */ |
| 573 | /* Contained in this message */ |
| 574 | nClassifierIndex = SearchClsid(Adapter, ulSFID, u16PacketClassificationRuleIndex); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 575 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 576 | if (nClassifierIndex > MAX_CLASSIFIERS) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 577 | nClassifierIndex = SearchFreeClsid(Adapter); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 578 | if (nClassifierIndex > MAX_CLASSIFIERS) { |
| 579 | /* Failed To get a free Entry */ |
| 580 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Error Failed To get a free Classifier Entry"); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 581 | break; |
| 582 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 583 | /* Copy the Classifier Rule for this service flow into our Classifier table maintained per SF. */ |
| 584 | CopyClassifierRuleToSF(Adapter, psfCSType, uiSearchRuleIndex, nClassifierIndex); |
| 585 | } else { |
| 586 | /* This Classifier Already Exists and it is invalid to Add Classifier with existing PCRI */ |
| 587 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, |
| 588 | "CopyToAdapter: Error The Specified Classifier Already Exists and attempted To Add Classifier with Same PCRI : 0x%x\n", |
| 589 | u16PacketClassificationRuleIndex); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 590 | } |
| 591 | } |
| 592 | break; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 593 | case eReplaceClassifier: |
| 594 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 595 | /* Get the Classifier Index From Classifier table for this SF and replace existing Classifier */ |
| 596 | /* with the new classifier Contained in this message */ |
| 597 | nClassifierIndex = SearchClsid(Adapter, ulSFID, u16PacketClassificationRuleIndex); |
| 598 | if (nClassifierIndex > MAX_CLASSIFIERS) { |
| 599 | /* Failed To search the classifier */ |
| 600 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Error Search for Classifier To be replaced failed"); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 601 | break; |
| 602 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 603 | /* Copy the Classifier Rule for this service flow into our Classifier table maintained per SF. */ |
| 604 | CopyClassifierRuleToSF(Adapter, psfCSType, uiSearchRuleIndex, nClassifierIndex); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 605 | } |
| 606 | break; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 607 | case eDeleteClassifier: |
| 608 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 609 | /* Get the Classifier Index From Classifier table for this SF and replace existing Classifier */ |
| 610 | /* with the new classifier Contained in this message */ |
| 611 | nClassifierIndex = SearchClsid(Adapter, ulSFID, u16PacketClassificationRuleIndex); |
| 612 | if (nClassifierIndex > MAX_CLASSIFIERS) { |
| 613 | /* Failed To search the classifier */ |
| 614 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Error Search for Classifier To be deleted failed"); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 615 | break; |
| 616 | } |
| 617 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 618 | /* Delete This classifier */ |
| 619 | DeleteClassifierRuleFromSF(Adapter, uiSearchRuleIndex, nClassifierIndex); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 620 | } |
| 621 | break; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 622 | default: |
| 623 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 624 | /* Invalid Action for classifier */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 625 | break; |
| 626 | } |
| 627 | } |
| 628 | } |
| 629 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 630 | /* Repeat parsing Classification Entries to process PHS Rules */ |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 631 | for (i = 0; i < psfLocalSet->u8TotalClassifiers; i++) { |
| 632 | psfCSType = &psfLocalSet->cConvergenceSLTypes[i]; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 633 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "psfCSType->u8PhsDSCAction : 0x%x\n", psfCSType->u8PhsDSCAction); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 634 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 635 | switch (psfCSType->u8PhsDSCAction) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 636 | case eDeleteAllPHSRules: |
| 637 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 638 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Deleting All PHS Rules For VCID: 0x%X\n", uVCID); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 639 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 640 | /* Delete All the PHS rules for this Service flow */ |
| 641 | PhsDeleteSFRules(&Adapter->stBCMPhsContext, uVCID); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 642 | break; |
| 643 | } |
| 644 | case eDeletePHSRule: |
| 645 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 646 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "PHS DSC Action = Delete PHS Rule\n"); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 647 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 648 | if (psfCSType->cPhsRule.u8PHSI) |
| 649 | PhsDeletePHSRule(&Adapter->stBCMPhsContext, uVCID, psfCSType->cCPacketClassificationRule.u8AssociatedPHSI); |
| 650 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 651 | break; |
| 652 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 653 | default: |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 654 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 655 | if (ucDsxType == DSC_ACK) { |
| 656 | /* BCM_DEBUG_PRINT(CONN_MSG,("Invalid PHS DSC Action For DSC\n",psfCSType->cPhsRule.u8PHSI)); */ |
| 657 | break; /* FOr DSC ACK Case PHS DSC Action must be in valid set */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 658 | } |
| 659 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 660 | /* Proceed To Add PHS rule for DSA_ACK case even if PHS DSC action is unspecified */ |
| 661 | /* No Break Here . Intentionally! */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 662 | |
| 663 | case eAddPHSRule: |
| 664 | case eSetPHSRule: |
| 665 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 666 | if (psfCSType->cPhsRule.u8PHSI) { |
| 667 | /* Apply This PHS Rule to all classifiers whose Associated PHSI Match */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 668 | unsigned int uiClassifierIndex = 0; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 669 | if (pstAddIndication->u8Direction == UPLINK_DIR) { |
| 670 | for (uiClassifierIndex = 0; uiClassifierIndex < MAX_CLASSIFIERS; uiClassifierIndex++) { |
| 671 | if ((Adapter->astClassifierTable[uiClassifierIndex].bUsed) && |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 672 | (Adapter->astClassifierTable[uiClassifierIndex].ulSFID == Adapter->PackInfo[uiSearchRuleIndex].ulSFID) && |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 673 | (Adapter->astClassifierTable[uiClassifierIndex].u8AssociatedPHSI == psfCSType->cPhsRule.u8PHSI)) { |
| 674 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, |
| 675 | "Adding PHS Rule For Classifier: 0x%x cPhsRule.u8PHSI: 0x%x\n", |
| 676 | Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex, |
| 677 | psfCSType->cPhsRule.u8PHSI); |
| 678 | /* Update The PHS Rule for this classifier as Associated PHSI id defined */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 679 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 680 | /* Copy the PHS Rule */ |
| 681 | sPhsRule.u8PHSI = psfCSType->cPhsRule.u8PHSI; |
| 682 | sPhsRule.u8PHSFLength = psfCSType->cPhsRule.u8PHSFLength; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 683 | sPhsRule.u8PHSMLength = psfCSType->cPhsRule.u8PHSMLength; |
| 684 | sPhsRule.u8PHSS = psfCSType->cPhsRule.u8PHSS; |
| 685 | sPhsRule.u8PHSV = psfCSType->cPhsRule.u8PHSV; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 686 | memcpy(sPhsRule.u8PHSF, psfCSType->cPhsRule.u8PHSF, MAX_PHS_LENGTHS); |
| 687 | memcpy(sPhsRule.u8PHSM, psfCSType->cPhsRule.u8PHSM, MAX_PHS_LENGTHS); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 688 | sPhsRule.u8RefCnt = 0; |
| 689 | sPhsRule.bUnclassifiedPHSRule = FALSE; |
| 690 | sPhsRule.PHSModifiedBytes = 0; |
| 691 | sPhsRule.PHSModifiedNumPackets = 0; |
| 692 | sPhsRule.PHSErrorNumPackets = 0; |
| 693 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 694 | /* bPHSRuleAssociated = TRUE; */ |
| 695 | /* Store The PHS Rule for this classifier */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 696 | |
| 697 | PhsUpdateClassifierRule( |
| 698 | &Adapter->stBCMPhsContext, |
| 699 | uVCID, |
| 700 | Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex, |
| 701 | &sPhsRule, |
| 702 | Adapter->astClassifierTable[uiClassifierIndex].u8AssociatedPHSI); |
| 703 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 704 | /* Update PHS Rule For the Classifier */ |
| 705 | if (sPhsRule.u8PHSI) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 706 | Adapter->astClassifierTable[uiClassifierIndex].u32PHSRuleID = sPhsRule.u8PHSI; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 707 | memcpy(&Adapter->astClassifierTable[uiClassifierIndex].sPhsRule, &sPhsRule, sizeof(S_PHS_RULE)); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 708 | } |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 709 | } |
| 710 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 711 | } else { |
| 712 | /* Error PHS Rule specified in signaling could not be applied to any classifier */ |
| 713 | |
| 714 | /* Copy the PHS Rule */ |
| 715 | sPhsRule.u8PHSI = psfCSType->cPhsRule.u8PHSI; |
| 716 | sPhsRule.u8PHSFLength = psfCSType->cPhsRule.u8PHSFLength; |
| 717 | sPhsRule.u8PHSMLength = psfCSType->cPhsRule.u8PHSMLength; |
| 718 | sPhsRule.u8PHSS = psfCSType->cPhsRule.u8PHSS; |
| 719 | sPhsRule.u8PHSV = psfCSType->cPhsRule.u8PHSV; |
| 720 | memcpy(sPhsRule.u8PHSF, psfCSType->cPhsRule.u8PHSF, MAX_PHS_LENGTHS); |
| 721 | memcpy(sPhsRule.u8PHSM, psfCSType->cPhsRule.u8PHSM, MAX_PHS_LENGTHS); |
| 722 | sPhsRule.u8RefCnt = 0; |
| 723 | sPhsRule.bUnclassifiedPHSRule = TRUE; |
| 724 | sPhsRule.PHSModifiedBytes = 0; |
| 725 | sPhsRule.PHSModifiedNumPackets = 0; |
| 726 | sPhsRule.PHSErrorNumPackets = 0; |
| 727 | /* Store The PHS Rule for this classifier */ |
| 728 | |
| 729 | /* |
| 730 | * Passing the argument u8PHSI instead of clsid. Because for DL with no classifier rule, |
| 731 | * clsid will be zero hence we can't have multiple PHS rules for the same SF. |
| 732 | * To support multiple PHS rule, passing u8PHSI. |
| 733 | */ |
| 734 | PhsUpdateClassifierRule( |
| 735 | &Adapter->stBCMPhsContext, |
| 736 | uVCID, |
| 737 | sPhsRule.u8PHSI, |
| 738 | &sPhsRule, |
| 739 | sPhsRule.u8PHSI); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 740 | } |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 741 | } |
| 742 | } |
| 743 | break; |
| 744 | } |
| 745 | } |
| 746 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 747 | if (psfLocalSet->u32MaxSustainedTrafficRate == 0) { |
| 748 | /* No Rate Limit . Set Max Sustained Traffic Rate to Maximum */ |
| 749 | Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate = WIMAX_MAX_ALLOWED_RATE; |
| 750 | } else if (ntohl(psfLocalSet->u32MaxSustainedTrafficRate) > WIMAX_MAX_ALLOWED_RATE) { |
| 751 | /* Too large Allowed Rate specified. Limiting to Wi Max Allowed rate */ |
| 752 | Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate = WIMAX_MAX_ALLOWED_RATE; |
| 753 | } else { |
| 754 | Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate = ntohl(psfLocalSet->u32MaxSustainedTrafficRate); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 755 | } |
| 756 | |
| 757 | Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency = ntohl(psfLocalSet->u32MaximumLatency); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 758 | if (Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency == 0) /* 0 should be treated as infinite */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 759 | Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency = MAX_LATENCY_ALLOWED; |
| 760 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 761 | if ((Adapter->PackInfo[uiSearchRuleIndex].u8QueueType == ERTPS || |
| 762 | Adapter->PackInfo[uiSearchRuleIndex].u8QueueType == UGS)) |
| 763 | UGIValue = ntohs(psfLocalSet->u16UnsolicitedGrantInterval); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 764 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 765 | if (UGIValue == 0) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 766 | UGIValue = DEFAULT_UG_INTERVAL; |
| 767 | |
| 768 | /* |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 769 | * For UGI based connections... |
| 770 | * DEFAULT_UGI_FACTOR*UGIInterval worth of data is the max token count at host... |
| 771 | * The extra amount of token is to ensure that a large amount of jitter won't have loss in throughput... |
| 772 | * In case of non-UGI based connection, 200 frames worth of data is the max token count at host... |
| 773 | */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 774 | Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize = |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 775 | (DEFAULT_UGI_FACTOR*Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate*UGIValue)/1000; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 776 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 777 | if (Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize < WIMAX_MAX_MTU*8) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 778 | UINT UGIFactor = 0; |
| 779 | /* Special Handling to ensure the biggest size of packet can go out from host to FW as follows: |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 780 | * 1. Any packet from Host to FW can go out in different packet size. |
| 781 | * 2. So in case the Bucket count is smaller than MTU, the packets of size (Size > TokenCount), will get dropped. |
| 782 | * 3. We can allow packets of MaxSize from Host->FW that can go out from FW in multiple SDUs by fragmentation at Wimax Layer |
| 783 | */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 784 | UGIFactor = (Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency/UGIValue + 1); |
| 785 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 786 | if (UGIFactor > DEFAULT_UGI_FACTOR) |
| 787 | Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize = |
| 788 | (UGIFactor*Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate*UGIValue)/1000; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 789 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 790 | if (Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize > WIMAX_MAX_MTU*8) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 791 | Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize = WIMAX_MAX_MTU*8; |
| 792 | } |
| 793 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 794 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "LAT: %d, UGI: %d\n", Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency, UGIValue); |
| 795 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "uiMaxAllowedRate: 0x%x, u32MaxSustainedTrafficRate: 0x%x ,uiMaxBucketSize: 0x%x", |
| 796 | Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate, |
| 797 | ntohl(psfLocalSet->u32MaxSustainedTrafficRate), |
| 798 | Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 799 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 800 | /* copy the extended SF Parameters to Support MIBS */ |
| 801 | CopyMIBSExtendedSFParameters(Adapter, psfLocalSet, uiSearchRuleIndex); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 802 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 803 | /* store header suppression enabled flag per SF */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 804 | Adapter->PackInfo[uiSearchRuleIndex].bHeaderSuppressionEnabled = |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 805 | !(psfLocalSet->u8RequesttransmissionPolicy & |
| 806 | MASK_DISABLE_HEADER_SUPPRESSION); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 807 | |
Ilia Mirkin | 23c3298 | 2011-03-13 00:28:55 -0500 | [diff] [blame] | 808 | kfree(Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 809 | Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication = pstAddIndication; |
| 810 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 811 | /* Re Sort the SF list in PackInfo according to Traffic Priority */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 812 | SortPackInfo(Adapter); |
| 813 | |
| 814 | /* Re Sort the Classifier Rules table and re - arrange |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 815 | * according to Classifier Rule Priority |
| 816 | */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 817 | SortClassifiers(Adapter); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 818 | DumpPhsRules(&Adapter->stBCMPhsContext); |
Kevin McKinney | e486862 | 2012-01-04 20:29:01 -0500 | [diff] [blame] | 819 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "%s <=====", __func__); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 820 | } |
| 821 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 822 | /*********************************************************************** |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 823 | * Function - DumpCmControlPacket |
| 824 | * |
| 825 | * Description - This routinue Dumps the Contents of the AddIndication |
| 826 | * Structure in the Connection Management Control Packet |
| 827 | * |
| 828 | * Parameter - pvBuffer: Pointer to the buffer containing the |
| 829 | * AddIndication data. |
| 830 | * |
| 831 | * Returns - None |
| 832 | *************************************************************************/ |
Arnd Bergmann | 44a17eff | 2010-09-30 10:24:12 +0200 | [diff] [blame] | 833 | static VOID DumpCmControlPacket(PVOID pvBuffer) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 834 | { |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 835 | int uiLoopIndex; |
| 836 | int nIndex; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 837 | stLocalSFAddIndicationAlt *pstAddIndication; |
| 838 | UINT nCurClassifierCnt; |
| 839 | PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 840 | |
| 841 | pstAddIndication = (stLocalSFAddIndicationAlt *)pvBuffer; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 842 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "======>"); |
| 843 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Type: 0x%X", pstAddIndication->u8Type); |
| 844 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Direction: 0x%X", pstAddIndication->u8Direction); |
| 845 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TID: 0x%X", ntohs(pstAddIndication->u16TID)); |
| 846 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID: 0x%X", ntohs(pstAddIndication->u16CID)); |
| 847 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VCID: 0x%X", ntohs(pstAddIndication->u16VCID)); |
| 848 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " AuthorizedSet--->"); |
| 849 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID: 0x%X", htonl(pstAddIndication->sfAuthorizedSet.u32SFID)); |
| 850 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID: 0x%X", htons(pstAddIndication->sfAuthorizedSet.u16CID)); |
| 851 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength: 0x%X", |
| 852 | pstAddIndication->sfAuthorizedSet.u8ServiceClassNameLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 853 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 854 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassName: 0x%X ,0x%X , 0x%X, 0x%X, 0x%X, 0x%X", |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 855 | pstAddIndication->sfAuthorizedSet.u8ServiceClassName[0], |
| 856 | pstAddIndication->sfAuthorizedSet.u8ServiceClassName[1], |
| 857 | pstAddIndication->sfAuthorizedSet.u8ServiceClassName[2], |
| 858 | pstAddIndication->sfAuthorizedSet.u8ServiceClassName[3], |
| 859 | pstAddIndication->sfAuthorizedSet.u8ServiceClassName[4], |
| 860 | pstAddIndication->sfAuthorizedSet.u8ServiceClassName[5]); |
| 861 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 862 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService: 0x%X", pstAddIndication->sfAuthorizedSet.u8MBSService); |
| 863 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet: 0x%X", pstAddIndication->sfAuthorizedSet.u8QosParamSet); |
| 864 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority: 0x%X, %p", |
| 865 | pstAddIndication->sfAuthorizedSet.u8TrafficPriority, &pstAddIndication->sfAuthorizedSet.u8TrafficPriority); |
| 866 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxSustainedTrafficRate: 0x%X 0x%p", |
| 867 | pstAddIndication->sfAuthorizedSet.u32MaxSustainedTrafficRate, |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 868 | &pstAddIndication->sfAuthorizedSet.u32MaxSustainedTrafficRate); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 869 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst: 0x%X", pstAddIndication->sfAuthorizedSet.u32MaxTrafficBurst); |
| 870 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate : 0x%X", |
| 871 | pstAddIndication->sfAuthorizedSet.u32MinReservedTrafficRate); |
| 872 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength: 0x%X", |
| 873 | pstAddIndication->sfAuthorizedSet.u8VendorSpecificQoSParamLength); |
| 874 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam: 0x%X", |
| 875 | pstAddIndication->sfAuthorizedSet.u8VendorSpecificQoSParam[0]); |
| 876 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType: 0x%X", |
| 877 | pstAddIndication->sfAuthorizedSet.u8ServiceFlowSchedulingType); |
| 878 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter: 0x%X", pstAddIndication->sfAuthorizedSet.u32ToleratedJitter); |
| 879 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency: 0x%X", pstAddIndication->sfAuthorizedSet.u32MaximumLatency); |
| 880 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%X", |
| 881 | pstAddIndication->sfAuthorizedSet.u8FixedLengthVSVariableLengthSDUIndicator); |
| 882 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize: 0x%X", pstAddIndication->sfAuthorizedSet.u8SDUSize); |
| 883 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TargetSAID: 0x%X", pstAddIndication->sfAuthorizedSet.u16TargetSAID); |
| 884 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQEnable: 0x%X", pstAddIndication->sfAuthorizedSet.u8ARQEnable); |
| 885 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQWindowSize: 0x%X", pstAddIndication->sfAuthorizedSet.u16ARQWindowSize); |
| 886 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryTxTimeOut: 0x%X", pstAddIndication->sfAuthorizedSet.u16ARQRetryTxTimeOut); |
| 887 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryRxTimeOut: 0x%X", pstAddIndication->sfAuthorizedSet.u16ARQRetryRxTimeOut); |
| 888 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockLifeTime: 0x%X", pstAddIndication->sfAuthorizedSet.u16ARQBlockLifeTime); |
| 889 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQSyncLossTimeOut: 0x%X", pstAddIndication->sfAuthorizedSet.u16ARQSyncLossTimeOut); |
| 890 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQDeliverInOrder: 0x%X", pstAddIndication->sfAuthorizedSet.u8ARQDeliverInOrder); |
| 891 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRxPurgeTimeOut: 0x%X", pstAddIndication->sfAuthorizedSet.u16ARQRxPurgeTimeOut); |
| 892 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockSize: 0x%X", pstAddIndication->sfAuthorizedSet.u16ARQBlockSize); |
| 893 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8CSSpecification: 0x%X", pstAddIndication->sfAuthorizedSet.u8CSSpecification); |
| 894 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TypeOfDataDeliveryService: 0x%X", |
| 895 | pstAddIndication->sfAuthorizedSet.u8TypeOfDataDeliveryService); |
| 896 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16SDUInterArrivalTime: 0x%X", pstAddIndication->sfAuthorizedSet.u16SDUInterArrivalTime); |
| 897 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TimeBase: 0x%X", pstAddIndication->sfAuthorizedSet.u16TimeBase); |
| 898 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8PagingPreference: 0x%X", pstAddIndication->sfAuthorizedSet.u8PagingPreference); |
| 899 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UnsolicitedPollingInterval: 0x%X", |
| 900 | pstAddIndication->sfAuthorizedSet.u16UnsolicitedPollingInterval); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 901 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 902 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "sfAuthorizedSet.u8HARQChannelMapping %x %x %x ", |
| 903 | *(unsigned int *)pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping, |
| 904 | *(unsigned int *)&pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping[4], |
| 905 | *(USHORT *)&pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping[8]); |
| 906 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficIndicationPreference: 0x%X", |
| 907 | pstAddIndication->sfAuthorizedSet.u8TrafficIndicationPreference); |
| 908 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Received: 0x%X", pstAddIndication->sfAuthorizedSet.u8TotalClassifiers); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 909 | |
| 910 | nCurClassifierCnt = pstAddIndication->sfAuthorizedSet.u8TotalClassifiers; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 911 | if (nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 912 | nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 913 | |
| 914 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "pstAddIndication->sfAuthorizedSet.bValid %d", pstAddIndication->sfAuthorizedSet.bValid); |
| 915 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "pstAddIndication->sfAuthorizedSet.u16MacOverhead %x", pstAddIndication->sfAuthorizedSet.u16MacOverhead); |
| 916 | if (!pstAddIndication->sfAuthorizedSet.bValid) |
| 917 | pstAddIndication->sfAuthorizedSet.bValid = 1; |
| 918 | for (nIndex = 0; nIndex < nCurClassifierCnt; nIndex++) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 919 | stConvergenceSLTypes *psfCSType = NULL; |
| 920 | psfCSType = &pstAddIndication->sfAuthorizedSet.cConvergenceSLTypes[nIndex]; |
| 921 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 922 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "psfCSType = %p", psfCSType); |
| 923 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "CCPacketClassificationRuleSI====>"); |
| 924 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ClassifierRulePriority: 0x%X ", |
| 925 | psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority); |
| 926 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfServiceLength: 0x%X ", |
| 927 | psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength); |
| 928 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfService[3]: 0x%X ,0x%X ,0x%X ", |
| 929 | psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0], |
| 930 | psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1], |
| 931 | psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 932 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 933 | for (uiLoopIndex = 0; uiLoopIndex < 1; uiLoopIndex++) |
| 934 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Protocol: 0x%02X ", |
| 935 | psfCSType->cCPacketClassificationRule.u8Protocol); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 936 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 937 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength: 0x%X ", |
| 938 | psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 939 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 940 | for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++) |
| 941 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32]: 0x%02X ", |
| 942 | psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 943 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 944 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength: 0x%X ", |
| 945 | psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 946 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 947 | for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++) |
| 948 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddress[32]: 0x%02X ", |
| 949 | psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 950 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 951 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRangeLength:0x%X ", |
| 952 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength); |
| 953 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRange[4]: 0x%02X ,0x%02X ,0x%02X ,0x%02X ", |
| 954 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0], |
| 955 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1], |
| 956 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2], |
| 957 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 958 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 959 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRangeLength: 0x%02X ", |
| 960 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength); |
| 961 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRange[4]: 0x%02X ,0x%02X ,0x%02X ,0x%02X ", |
| 962 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0], |
| 963 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1], |
| 964 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2], |
| 965 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 966 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 967 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddressLength: 0x%02X ", |
| 968 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 969 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 970 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddress[6]: 0x %02X %02X %02X %02X %02X %02X", |
| 971 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0], |
| 972 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1], |
| 973 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2], |
| 974 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3], |
| 975 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4], |
| 976 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 977 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 978 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddressLength: 0x%02X ", |
| 979 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 980 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 981 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddress[6]: 0x %02X %02X %02X %02X %02X %02X", |
| 982 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0], |
| 983 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1], |
| 984 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2], |
| 985 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3], |
| 986 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4], |
| 987 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 988 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 989 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthertypeLength: 0x%02X ", |
| 990 | psfCSType->cCPacketClassificationRule.u8EthertypeLength); |
| 991 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Ethertype[3]: 0x%02X ,0x%02X ,0x%02X ", |
| 992 | psfCSType->cCPacketClassificationRule.u8Ethertype[0], |
| 993 | psfCSType->cCPacketClassificationRule.u8Ethertype[1], |
| 994 | psfCSType->cCPacketClassificationRule.u8Ethertype[2]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 995 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 996 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UserPriority: 0x%X ", psfCSType->cCPacketClassificationRule.u16UserPriority); |
| 997 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VLANID: 0x%X ", psfCSType->cCPacketClassificationRule.u16VLANID); |
| 998 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8AssociatedPHSI: 0x%02X ", psfCSType->cCPacketClassificationRule.u8AssociatedPHSI); |
| 999 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16PacketClassificationRuleIndex: 0x%X ", |
| 1000 | psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1001 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1002 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParamLength: 0x%X ", |
| 1003 | psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength); |
| 1004 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParam[1]: 0x%X ", |
| 1005 | psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1006 | #ifdef VERSION_D5 |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1007 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLableLength: 0x%X ", |
| 1008 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength); |
| 1009 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLable[6]: 0x %02X %02X %02X %02X %02X %02X ", |
| 1010 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0], |
| 1011 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1], |
| 1012 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2], |
| 1013 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3], |
| 1014 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4], |
| 1015 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1016 | #endif |
| 1017 | } |
| 1018 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1019 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "bValid: 0x%02X", pstAddIndication->sfAuthorizedSet.bValid); |
| 1020 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "AdmittedSet--->"); |
| 1021 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID: 0x%X", pstAddIndication->sfAdmittedSet.u32SFID); |
| 1022 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID: 0x%X", pstAddIndication->sfAdmittedSet.u16CID); |
| 1023 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength: 0x%X", |
| 1024 | pstAddIndication->sfAdmittedSet.u8ServiceClassNameLength); |
| 1025 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassName: 0x %02X %02X %02X %02X %02X %02X", |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1026 | pstAddIndication->sfAdmittedSet.u8ServiceClassName[0], |
| 1027 | pstAddIndication->sfAdmittedSet.u8ServiceClassName[1], |
| 1028 | pstAddIndication->sfAdmittedSet.u8ServiceClassName[2], |
| 1029 | pstAddIndication->sfAdmittedSet.u8ServiceClassName[3], |
| 1030 | pstAddIndication->sfAdmittedSet.u8ServiceClassName[4], |
| 1031 | pstAddIndication->sfAdmittedSet.u8ServiceClassName[5]); |
| 1032 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1033 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService: 0x%02X", pstAddIndication->sfAdmittedSet.u8MBSService); |
| 1034 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet: 0x%02X", pstAddIndication->sfAdmittedSet.u8QosParamSet); |
| 1035 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority: 0x%02X", pstAddIndication->sfAdmittedSet.u8TrafficPriority); |
| 1036 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst: 0x%X", pstAddIndication->sfAdmittedSet.u32MaxTrafficBurst); |
| 1037 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate: 0x%X", |
| 1038 | pstAddIndication->sfAdmittedSet.u32MinReservedTrafficRate); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1039 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1040 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength: 0x%02X", |
| 1041 | pstAddIndication->sfAdmittedSet.u8VendorSpecificQoSParamLength); |
| 1042 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam: 0x%02X", |
| 1043 | pstAddIndication->sfAdmittedSet.u8VendorSpecificQoSParam[0]); |
| 1044 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType: 0x%02X", |
| 1045 | pstAddIndication->sfAdmittedSet.u8ServiceFlowSchedulingType); |
| 1046 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter: 0x%X", pstAddIndication->sfAdmittedSet.u32ToleratedJitter); |
| 1047 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency: 0x%X", pstAddIndication->sfAdmittedSet.u32MaximumLatency); |
| 1048 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%02X", |
| 1049 | pstAddIndication->sfAdmittedSet.u8FixedLengthVSVariableLengthSDUIndicator); |
| 1050 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize: 0x%02X", pstAddIndication->sfAdmittedSet.u8SDUSize); |
| 1051 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TargetSAID: 0x%02X", pstAddIndication->sfAdmittedSet.u16TargetSAID); |
| 1052 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQEnable: 0x%02X", pstAddIndication->sfAdmittedSet.u8ARQEnable); |
| 1053 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQWindowSize: 0x%X", pstAddIndication->sfAdmittedSet.u16ARQWindowSize); |
| 1054 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryTxTimeOut: 0x%X", pstAddIndication->sfAdmittedSet.u16ARQRetryTxTimeOut); |
| 1055 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryRxTimeOut: 0x%X", pstAddIndication->sfAdmittedSet.u16ARQRetryRxTimeOut); |
| 1056 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockLifeTime: 0x%X", pstAddIndication->sfAdmittedSet.u16ARQBlockLifeTime); |
| 1057 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQSyncLossTimeOut: 0x%X", pstAddIndication->sfAdmittedSet.u16ARQSyncLossTimeOut); |
| 1058 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQDeliverInOrder: 0x%02X", pstAddIndication->sfAdmittedSet.u8ARQDeliverInOrder); |
| 1059 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRxPurgeTimeOut: 0x%X", pstAddIndication->sfAdmittedSet.u16ARQRxPurgeTimeOut); |
| 1060 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockSize: 0x%X", pstAddIndication->sfAdmittedSet.u16ARQBlockSize); |
| 1061 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8CSSpecification: 0x%02X", pstAddIndication->sfAdmittedSet.u8CSSpecification); |
| 1062 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TypeOfDataDeliveryService: 0x%02X", |
| 1063 | pstAddIndication->sfAdmittedSet.u8TypeOfDataDeliveryService); |
| 1064 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16SDUInterArrivalTime: 0x%X", pstAddIndication->sfAdmittedSet.u16SDUInterArrivalTime); |
| 1065 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TimeBase: 0x%X", pstAddIndication->sfAdmittedSet.u16TimeBase); |
| 1066 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8PagingPreference: 0x%X", pstAddIndication->sfAdmittedSet.u8PagingPreference); |
| 1067 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficIndicationPreference: 0x%02X", |
| 1068 | pstAddIndication->sfAdmittedSet.u8TrafficIndicationPreference); |
| 1069 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Received: 0x%X", pstAddIndication->sfAdmittedSet.u8TotalClassifiers); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1070 | |
| 1071 | nCurClassifierCnt = pstAddIndication->sfAdmittedSet.u8TotalClassifiers; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1072 | if (nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1073 | nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1074 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1075 | for (nIndex = 0; nIndex < nCurClassifierCnt; nIndex++) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1076 | stConvergenceSLTypes *psfCSType = NULL; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1077 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1078 | psfCSType = &pstAddIndication->sfAdmittedSet.cConvergenceSLTypes[nIndex]; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1079 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " CCPacketClassificationRuleSI====>"); |
| 1080 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ClassifierRulePriority: 0x%02X ", |
| 1081 | psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority); |
| 1082 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfServiceLength: 0x%02X", |
| 1083 | psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength); |
| 1084 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfService[3]: 0x%02X %02X %02X", |
| 1085 | psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0], |
| 1086 | psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1], |
| 1087 | psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]); |
| 1088 | for (uiLoopIndex = 0; uiLoopIndex < 1; uiLoopIndex++) |
| 1089 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Protocol: 0x%02X ", psfCSType->cCPacketClassificationRule.u8Protocol); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1090 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1091 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength: 0x%02X ", |
| 1092 | psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1093 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1094 | for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++) |
| 1095 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32]: 0x%02X ", |
| 1096 | psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1097 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1098 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength: 0x%02X ", |
| 1099 | psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1100 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1101 | for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++) |
| 1102 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddress[32]: 0x%02X ", |
| 1103 | psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1104 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1105 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRangeLength: 0x%02X ", |
| 1106 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1107 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1108 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRange[4]: 0x %02X %02X %02X %02X ", |
| 1109 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0], |
| 1110 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1], |
| 1111 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2], |
| 1112 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1113 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1114 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRangeLength: 0x%02X ", |
| 1115 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1116 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1117 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRange[4]: 0x %02X %02X %02X %02X ", |
| 1118 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0], |
| 1119 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1], |
| 1120 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2], |
| 1121 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1122 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1123 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddressLength: 0x%02X ", |
| 1124 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1125 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1126 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddress[6]: 0x %02X %02X %02X %02X %02X %02X", |
| 1127 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0], |
| 1128 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1], |
| 1129 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2], |
| 1130 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3], |
| 1131 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4], |
| 1132 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1133 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1134 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddressLength: 0x%02X ", |
| 1135 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1136 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1137 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddress[6]: 0x %02X %02X %02X %02X %02X %02X", |
| 1138 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0], |
| 1139 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1], |
| 1140 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2], |
| 1141 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3], |
| 1142 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4], |
| 1143 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1144 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1145 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthertypeLength: 0x%02X ", psfCSType->cCPacketClassificationRule.u8EthertypeLength); |
| 1146 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Ethertype[3]: 0x%02X %02X %02X", |
| 1147 | psfCSType->cCPacketClassificationRule.u8Ethertype[0], |
| 1148 | psfCSType->cCPacketClassificationRule.u8Ethertype[1], |
| 1149 | psfCSType->cCPacketClassificationRule.u8Ethertype[2]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1150 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1151 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UserPriority: 0x%X ", psfCSType->cCPacketClassificationRule.u16UserPriority); |
| 1152 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VLANID: 0x%X ", psfCSType->cCPacketClassificationRule.u16VLANID); |
| 1153 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8AssociatedPHSI: 0x%02X ", psfCSType->cCPacketClassificationRule.u8AssociatedPHSI); |
| 1154 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16PacketClassificationRuleIndex: 0x%X ", |
| 1155 | psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex); |
| 1156 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParamLength: 0x%02X", |
| 1157 | psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength); |
| 1158 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParam[1]: 0x%02X ", |
| 1159 | psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1160 | #ifdef VERSION_D5 |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1161 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLableLength: 0x%X ", |
| 1162 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength); |
| 1163 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLable[6]: 0x %02X %02X %02X %02X %02X %02X ", |
| 1164 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0], |
| 1165 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1], |
| 1166 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2], |
| 1167 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3], |
| 1168 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4], |
| 1169 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1170 | #endif |
| 1171 | } |
| 1172 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1173 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "bValid: 0x%X", pstAddIndication->sfAdmittedSet.bValid); |
| 1174 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " ActiveSet--->"); |
| 1175 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID: 0x%X", pstAddIndication->sfActiveSet.u32SFID); |
| 1176 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID: 0x%X", pstAddIndication->sfActiveSet.u16CID); |
| 1177 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength: 0x%X", pstAddIndication->sfActiveSet.u8ServiceClassNameLength); |
| 1178 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassName: 0x %02X %02X %02X %02X %02X %02X", |
| 1179 | pstAddIndication->sfActiveSet.u8ServiceClassName[0], |
| 1180 | pstAddIndication->sfActiveSet.u8ServiceClassName[1], |
| 1181 | pstAddIndication->sfActiveSet.u8ServiceClassName[2], |
| 1182 | pstAddIndication->sfActiveSet.u8ServiceClassName[3], |
| 1183 | pstAddIndication->sfActiveSet.u8ServiceClassName[4], |
| 1184 | pstAddIndication->sfActiveSet.u8ServiceClassName[5]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1185 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1186 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService: 0x%02X", pstAddIndication->sfActiveSet.u8MBSService); |
| 1187 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet: 0x%02X", pstAddIndication->sfActiveSet.u8QosParamSet); |
| 1188 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority: 0x%02X", pstAddIndication->sfActiveSet.u8TrafficPriority); |
| 1189 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst: 0x%X", pstAddIndication->sfActiveSet.u32MaxTrafficBurst); |
| 1190 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate: 0x%X", |
| 1191 | pstAddIndication->sfActiveSet.u32MinReservedTrafficRate); |
| 1192 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength: 0x%02X", |
| 1193 | pstAddIndication->sfActiveSet.u8VendorSpecificQoSParamLength); |
| 1194 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam: 0x%02X", |
| 1195 | pstAddIndication->sfActiveSet.u8VendorSpecificQoSParam[0]); |
| 1196 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType: 0x%02X", |
| 1197 | pstAddIndication->sfActiveSet.u8ServiceFlowSchedulingType); |
| 1198 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter: 0x%X", pstAddIndication->sfActiveSet.u32ToleratedJitter); |
| 1199 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency: 0x%X", pstAddIndication->sfActiveSet.u32MaximumLatency); |
| 1200 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%02X", |
| 1201 | pstAddIndication->sfActiveSet.u8FixedLengthVSVariableLengthSDUIndicator); |
| 1202 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize: 0x%X", pstAddIndication->sfActiveSet.u8SDUSize); |
| 1203 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16TargetSAID: 0x%X", pstAddIndication->sfActiveSet.u16TargetSAID); |
| 1204 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ARQEnable: 0x%X", pstAddIndication->sfActiveSet.u8ARQEnable); |
| 1205 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQWindowSize: 0x%X", pstAddIndication->sfActiveSet.u16ARQWindowSize); |
| 1206 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRetryTxTimeOut: 0x%X", pstAddIndication->sfActiveSet.u16ARQRetryTxTimeOut); |
| 1207 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRetryRxTimeOut: 0x%X", pstAddIndication->sfActiveSet.u16ARQRetryRxTimeOut); |
| 1208 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQBlockLifeTime: 0x%X", pstAddIndication->sfActiveSet.u16ARQBlockLifeTime); |
| 1209 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQSyncLossTimeOut: 0x%X", pstAddIndication->sfActiveSet.u16ARQSyncLossTimeOut); |
| 1210 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ARQDeliverInOrder: 0x%X", pstAddIndication->sfActiveSet.u8ARQDeliverInOrder); |
| 1211 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRxPurgeTimeOut: 0x%X", pstAddIndication->sfActiveSet.u16ARQRxPurgeTimeOut); |
| 1212 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQBlockSize: 0x%X", pstAddIndication->sfActiveSet.u16ARQBlockSize); |
| 1213 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8CSSpecification: 0x%X", pstAddIndication->sfActiveSet.u8CSSpecification); |
| 1214 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8TypeOfDataDeliveryService: 0x%X", |
| 1215 | pstAddIndication->sfActiveSet.u8TypeOfDataDeliveryService); |
| 1216 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16SDUInterArrivalTime: 0x%X", pstAddIndication->sfActiveSet.u16SDUInterArrivalTime); |
| 1217 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16TimeBase: 0x%X", pstAddIndication->sfActiveSet.u16TimeBase); |
| 1218 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8PagingPreference: 0x%X", pstAddIndication->sfActiveSet.u8PagingPreference); |
| 1219 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8TrafficIndicationPreference: 0x%X", |
| 1220 | pstAddIndication->sfActiveSet.u8TrafficIndicationPreference); |
| 1221 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Received: 0x%X", pstAddIndication->sfActiveSet.u8TotalClassifiers); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1222 | |
| 1223 | nCurClassifierCnt = pstAddIndication->sfActiveSet.u8TotalClassifiers; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1224 | if (nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1225 | nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1226 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1227 | for (nIndex = 0; nIndex < nCurClassifierCnt; nIndex++) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1228 | stConvergenceSLTypes *psfCSType = NULL; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1229 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1230 | psfCSType = &pstAddIndication->sfActiveSet.cConvergenceSLTypes[nIndex]; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1231 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " CCPacketClassificationRuleSI====>"); |
| 1232 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ClassifierRulePriority: 0x%X ", |
| 1233 | psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority); |
| 1234 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPTypeOfServiceLength: 0x%X ", |
| 1235 | psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength); |
| 1236 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPTypeOfService[3]: 0x%X ,0x%X ,0x%X ", |
| 1237 | psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0], |
| 1238 | psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1], |
| 1239 | psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1240 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1241 | for (uiLoopIndex = 0; uiLoopIndex < 1; uiLoopIndex++) |
| 1242 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8Protocol: 0x%X ", psfCSType->cCPacketClassificationRule.u8Protocol); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1243 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1244 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength: 0x%X ", |
| 1245 | psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1246 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1247 | for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++) |
| 1248 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32]: 0x%X ", |
| 1249 | psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1250 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1251 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength: 0x%02X ", |
| 1252 | psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1253 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1254 | for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++) |
| 1255 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPDestinationAddress[32]:0x%X ", |
| 1256 | psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1257 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1258 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolSourcePortRangeLength: 0x%X ", |
| 1259 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1260 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1261 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolSourcePortRange[4]: 0x%X ,0x%X ,0x%X ,0x%X ", |
| 1262 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0], |
| 1263 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1], |
| 1264 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2], |
| 1265 | psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1266 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1267 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolDestPortRangeLength: 0x%X ", |
| 1268 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength); |
| 1269 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolDestPortRange[4]: 0x%X ,0x%X ,0x%X ,0x%X ", |
| 1270 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0], |
| 1271 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1], |
| 1272 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2], |
| 1273 | psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1274 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1275 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthernetDestMacAddressLength: 0x%X ", |
| 1276 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength); |
| 1277 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthernetDestMacAddress[6]: 0x%X ,0x%X ,0x%X ,0x%X ,0x%X ,0x%X", |
| 1278 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0], |
| 1279 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1], |
| 1280 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2], |
| 1281 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3], |
| 1282 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4], |
| 1283 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1284 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1285 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthernetSourceMACAddressLength: 0x%X ", |
| 1286 | psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength); |
| 1287 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddress[6]: 0x%X ,0x%X ,0x%X ,0x%X ,0x%X ,0x%X", |
| 1288 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0], |
| 1289 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1], |
| 1290 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2], |
| 1291 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3], |
| 1292 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4], |
| 1293 | psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1294 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1295 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthertypeLength: 0x%X ", |
| 1296 | psfCSType->cCPacketClassificationRule.u8EthertypeLength); |
| 1297 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8Ethertype[3]: 0x%X ,0x%X ,0x%X ", |
| 1298 | psfCSType->cCPacketClassificationRule.u8Ethertype[0], |
| 1299 | psfCSType->cCPacketClassificationRule.u8Ethertype[1], |
| 1300 | psfCSType->cCPacketClassificationRule.u8Ethertype[2]); |
| 1301 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16UserPriority: 0x%X ", |
| 1302 | psfCSType->cCPacketClassificationRule.u16UserPriority); |
| 1303 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16VLANID: 0x%X ", psfCSType->cCPacketClassificationRule.u16VLANID); |
| 1304 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8AssociatedPHSI: 0x%X ", psfCSType->cCPacketClassificationRule.u8AssociatedPHSI); |
| 1305 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16PacketClassificationRuleIndex:0x%X ", |
| 1306 | psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1307 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1308 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8VendorSpecificClassifierParamLength:0x%X ", |
| 1309 | psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength); |
| 1310 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8VendorSpecificClassifierParam[1]:0x%X ", |
| 1311 | psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1312 | #ifdef VERSION_D5 |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1313 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPv6FlowLableLength: 0x%X ", |
| 1314 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength); |
| 1315 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPv6FlowLable[6]: 0x%X ,0x%X ,0x%X ,0x%X ,0x%X ,0x%X ", |
| 1316 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0], |
| 1317 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1], |
| 1318 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2], |
| 1319 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3], |
| 1320 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4], |
| 1321 | psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1322 | #endif |
| 1323 | } |
| 1324 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1325 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " bValid: 0x%X", pstAddIndication->sfActiveSet.bValid); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1326 | } |
| 1327 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1328 | static inline ULONG RestoreSFParam(PMINI_ADAPTER Adapter, ULONG ulAddrSFParamSet, PUCHAR pucDestBuffer) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1329 | { |
| 1330 | UINT nBytesToRead = sizeof(stServiceFlowParamSI); |
| 1331 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1332 | if (ulAddrSFParamSet == 0 || NULL == pucDestBuffer) { |
| 1333 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Got Param address as 0!!"); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1334 | return 0; |
| 1335 | } |
| 1336 | ulAddrSFParamSet = ntohl(ulAddrSFParamSet); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1337 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1338 | /* Read out the SF Param Set At the indicated Location */ |
| 1339 | if (rdm(Adapter, ulAddrSFParamSet, (PUCHAR)pucDestBuffer, nBytesToRead) < 0) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1340 | return STATUS_FAILURE; |
| 1341 | |
| 1342 | return 1; |
| 1343 | } |
| 1344 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1345 | static ULONG StoreSFParam(PMINI_ADAPTER Adapter, PUCHAR pucSrcBuffer, ULONG ulAddrSFParamSet) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1346 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1347 | UINT nBytesToWrite = sizeof(stServiceFlowParamSI); |
Dan Carpenter | f05321c | 2010-11-13 07:37:49 +0300 | [diff] [blame] | 1348 | int ret = 0; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1349 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1350 | if (ulAddrSFParamSet == 0 || NULL == pucSrcBuffer) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1351 | return 0; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1352 | |
Dan Carpenter | f05321c | 2010-11-13 07:37:49 +0300 | [diff] [blame] | 1353 | ret = wrm(Adapter, ulAddrSFParamSet, (u8 *)pucSrcBuffer, nBytesToWrite); |
| 1354 | if (ret < 0) { |
Kevin McKinney | e486862 | 2012-01-04 20:29:01 -0500 | [diff] [blame] | 1355 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "%s:%d WRM failed", __func__, __LINE__); |
Dan Carpenter | f05321c | 2010-11-13 07:37:49 +0300 | [diff] [blame] | 1356 | return ret; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1357 | } |
| 1358 | return 1; |
| 1359 | } |
| 1360 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1361 | ULONG StoreCmControlResponseMessage(PMINI_ADAPTER Adapter, PVOID pvBuffer, UINT *puBufferLength) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1362 | { |
| 1363 | stLocalSFAddIndicationAlt *pstAddIndicationAlt = NULL; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1364 | stLocalSFAddIndication *pstAddIndication = NULL; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1365 | stLocalSFDeleteRequest *pstDeletionRequest; |
| 1366 | UINT uiSearchRuleIndex; |
| 1367 | ULONG ulSFID; |
| 1368 | |
| 1369 | pstAddIndicationAlt = (stLocalSFAddIndicationAlt *)(pvBuffer); |
| 1370 | |
| 1371 | /* |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1372 | * In case of DSD Req By MS, we should immediately delete this SF so that |
| 1373 | * we can stop the further classifying the pkt for this SF. |
| 1374 | */ |
| 1375 | if (pstAddIndicationAlt->u8Type == DSD_REQ) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1376 | pstDeletionRequest = (stLocalSFDeleteRequest *)pvBuffer; |
| 1377 | |
| 1378 | ulSFID = ntohl(pstDeletionRequest->u32SFID); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1379 | uiSearchRuleIndex = SearchSfid(Adapter, ulSFID); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1380 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1381 | if (uiSearchRuleIndex < NO_OF_QUEUES) { |
| 1382 | deleteSFBySfid(Adapter, uiSearchRuleIndex); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1383 | Adapter->u32TotalDSD++; |
| 1384 | } |
| 1385 | return 1; |
| 1386 | } |
| 1387 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1388 | if ((pstAddIndicationAlt->u8Type == DSD_RSP) || |
| 1389 | (pstAddIndicationAlt->u8Type == DSD_ACK)) { |
| 1390 | /* No Special handling send the message as it is */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1391 | return 1; |
| 1392 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1393 | /* For DSA_REQ, only up to "psfAuthorizedSet" parameter should be accessed by driver! */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1394 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1395 | pstAddIndication = kmalloc(sizeof(*pstAddIndication), GFP_KERNEL); |
Kevin McKinney | cffae18 | 2012-01-04 20:29:03 -0500 | [diff] [blame] | 1396 | if (pstAddIndication == NULL) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1397 | return 0; |
| 1398 | |
| 1399 | /* AUTHORIZED SET */ |
| 1400 | pstAddIndication->psfAuthorizedSet = (stServiceFlowParamSI *) |
| 1401 | GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID); |
Kevin McKinney | cc55bb0 | 2012-03-02 00:17:04 -0500 | [diff] [blame] | 1402 | if (!pstAddIndication->psfAuthorizedSet) { |
| 1403 | kfree(pstAddIndication); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1404 | return 0; |
Kevin McKinney | cc55bb0 | 2012-03-02 00:17:04 -0500 | [diff] [blame] | 1405 | } |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1406 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1407 | if (StoreSFParam(Adapter, (PUCHAR)&pstAddIndicationAlt->sfAuthorizedSet, |
Kevin McKinney | cc55bb0 | 2012-03-02 00:17:04 -0500 | [diff] [blame] | 1408 | (ULONG)pstAddIndication->psfAuthorizedSet) != 1) { |
| 1409 | kfree(pstAddIndication); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1410 | return 0; |
Kevin McKinney | cc55bb0 | 2012-03-02 00:17:04 -0500 | [diff] [blame] | 1411 | } |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1412 | |
Arnd Bergmann | 9f1c75a | 2010-09-30 10:24:11 +0200 | [diff] [blame] | 1413 | /* this can't possibly be right */ |
| 1414 | pstAddIndication->psfAuthorizedSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfAuthorizedSet); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1415 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1416 | if (pstAddIndicationAlt->u8Type == DSA_REQ) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1417 | stLocalSFAddRequest AddRequest; |
| 1418 | |
| 1419 | AddRequest.u8Type = pstAddIndicationAlt->u8Type; |
| 1420 | AddRequest.eConnectionDir = pstAddIndicationAlt->u8Direction; |
| 1421 | AddRequest.u16TID = pstAddIndicationAlt->u16TID; |
| 1422 | AddRequest.u16CID = pstAddIndicationAlt->u16CID; |
| 1423 | AddRequest.u16VCID = pstAddIndicationAlt->u16VCID; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1424 | AddRequest.psfParameterSet = pstAddIndication->psfAuthorizedSet; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1425 | (*puBufferLength) = sizeof(stLocalSFAddRequest); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1426 | memcpy(pvBuffer, &AddRequest, sizeof(stLocalSFAddRequest)); |
Kevin McKinney | cc55bb0 | 2012-03-02 00:17:04 -0500 | [diff] [blame] | 1427 | kfree(pstAddIndication); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1428 | return 1; |
| 1429 | } |
| 1430 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1431 | /* Since it's not DSA_REQ, we can access all field in pstAddIndicationAlt */ |
| 1432 | /* We need to extract the structure from the buffer and pack it differently */ |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1433 | |
| 1434 | pstAddIndication->u8Type = pstAddIndicationAlt->u8Type; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1435 | pstAddIndication->eConnectionDir = pstAddIndicationAlt->u8Direction; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1436 | pstAddIndication->u16TID = pstAddIndicationAlt->u16TID; |
| 1437 | pstAddIndication->u16CID = pstAddIndicationAlt->u16CID; |
| 1438 | pstAddIndication->u16VCID = pstAddIndicationAlt->u16VCID; |
| 1439 | pstAddIndication->u8CC = pstAddIndicationAlt->u8CC; |
| 1440 | |
| 1441 | /* ADMITTED SET */ |
| 1442 | pstAddIndication->psfAdmittedSet = (stServiceFlowParamSI *) |
| 1443 | GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID); |
Kevin McKinney | cc55bb0 | 2012-03-02 00:17:04 -0500 | [diff] [blame] | 1444 | if (!pstAddIndication->psfAdmittedSet) { |
| 1445 | kfree(pstAddIndication); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1446 | return 0; |
Kevin McKinney | cc55bb0 | 2012-03-02 00:17:04 -0500 | [diff] [blame] | 1447 | } |
| 1448 | if (StoreSFParam(Adapter, (PUCHAR)&pstAddIndicationAlt->sfAdmittedSet, (ULONG)pstAddIndication->psfAdmittedSet) != 1) { |
| 1449 | kfree(pstAddIndication); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1450 | return 0; |
Kevin McKinney | cc55bb0 | 2012-03-02 00:17:04 -0500 | [diff] [blame] | 1451 | } |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1452 | |
| 1453 | pstAddIndication->psfAdmittedSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfAdmittedSet); |
| 1454 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1455 | /* ACTIVE SET */ |
| 1456 | pstAddIndication->psfActiveSet = (stServiceFlowParamSI *) |
| 1457 | GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID); |
Kevin McKinney | cc55bb0 | 2012-03-02 00:17:04 -0500 | [diff] [blame] | 1458 | if (!pstAddIndication->psfActiveSet) { |
| 1459 | kfree(pstAddIndication); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1460 | return 0; |
Kevin McKinney | cc55bb0 | 2012-03-02 00:17:04 -0500 | [diff] [blame] | 1461 | } |
| 1462 | if (StoreSFParam(Adapter, (PUCHAR)&pstAddIndicationAlt->sfActiveSet, (ULONG)pstAddIndication->psfActiveSet) != 1) { |
| 1463 | kfree(pstAddIndication); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1464 | return 0; |
Kevin McKinney | cc55bb0 | 2012-03-02 00:17:04 -0500 | [diff] [blame] | 1465 | } |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1466 | |
| 1467 | pstAddIndication->psfActiveSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfActiveSet); |
| 1468 | |
| 1469 | (*puBufferLength) = sizeof(stLocalSFAddIndication); |
| 1470 | *(stLocalSFAddIndication *)pvBuffer = *pstAddIndication; |
Stephen Hemminger | 082e889 | 2010-11-01 09:35:21 -0400 | [diff] [blame] | 1471 | kfree(pstAddIndication); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1472 | return 1; |
| 1473 | } |
| 1474 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1475 | static inline stLocalSFAddIndicationAlt |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1476 | *RestoreCmControlResponseMessage(register PMINI_ADAPTER Adapter, register PVOID pvBuffer) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1477 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1478 | ULONG ulStatus = 0; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1479 | stLocalSFAddIndication *pstAddIndication = NULL; |
| 1480 | stLocalSFAddIndicationAlt *pstAddIndicationDest = NULL; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1481 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1482 | pstAddIndication = (stLocalSFAddIndication *)(pvBuffer); |
| 1483 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "=====>"); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1484 | if ((pstAddIndication->u8Type == DSD_REQ) || |
| 1485 | (pstAddIndication->u8Type == DSD_RSP) || |
| 1486 | (pstAddIndication->u8Type == DSD_ACK)) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1487 | return (stLocalSFAddIndicationAlt *)pvBuffer; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1488 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1489 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Inside RestoreCmControlResponseMessage "); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1490 | /* |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1491 | * Need to Allocate memory to contain the SUPER Large structures |
| 1492 | * Our driver can't create these structures on Stack :( |
| 1493 | */ |
| 1494 | pstAddIndicationDest = kmalloc(sizeof(stLocalSFAddIndicationAlt), GFP_KERNEL); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1495 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1496 | if (pstAddIndicationDest) { |
| 1497 | memset(pstAddIndicationDest, 0, sizeof(stLocalSFAddIndicationAlt)); |
| 1498 | } else { |
| 1499 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Failed to allocate memory for SF Add Indication Structure "); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1500 | return NULL; |
| 1501 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1502 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8Type : 0x%X", pstAddIndication->u8Type); |
| 1503 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8Direction : 0x%X", pstAddIndication->eConnectionDir); |
| 1504 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8TID : 0x%X", ntohs(pstAddIndication->u16TID)); |
| 1505 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8CID : 0x%X", ntohs(pstAddIndication->u16CID)); |
| 1506 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u16VCID : 0x%X", ntohs(pstAddIndication->u16VCID)); |
| 1507 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-autorized set loc : %p", pstAddIndication->psfAuthorizedSet); |
| 1508 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-admitted set loc : %p", pstAddIndication->psfAdmittedSet); |
| 1509 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-Active set loc : %p", pstAddIndication->psfActiveSet); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1510 | |
| 1511 | pstAddIndicationDest->u8Type = pstAddIndication->u8Type; |
| 1512 | pstAddIndicationDest->u8Direction = pstAddIndication->eConnectionDir; |
| 1513 | pstAddIndicationDest->u16TID = pstAddIndication->u16TID; |
| 1514 | pstAddIndicationDest->u16CID = pstAddIndication->u16CID; |
| 1515 | pstAddIndicationDest->u16VCID = pstAddIndication->u16VCID; |
| 1516 | pstAddIndicationDest->u8CC = pstAddIndication->u8CC; |
| 1517 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1518 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Active Set "); |
| 1519 | ulStatus = RestoreSFParam(Adapter, (ULONG)pstAddIndication->psfActiveSet, (PUCHAR)&pstAddIndicationDest->sfActiveSet); |
| 1520 | if (ulStatus != 1) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1521 | goto failed_restore_sf_param; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1522 | |
| 1523 | if (pstAddIndicationDest->sfActiveSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1524 | pstAddIndicationDest->sfActiveSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF; |
| 1525 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1526 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Admitted Set "); |
| 1527 | ulStatus = RestoreSFParam(Adapter, (ULONG)pstAddIndication->psfAdmittedSet, (PUCHAR)&pstAddIndicationDest->sfAdmittedSet); |
| 1528 | if (ulStatus != 1) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1529 | goto failed_restore_sf_param; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1530 | |
| 1531 | if (pstAddIndicationDest->sfAdmittedSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1532 | pstAddIndicationDest->sfAdmittedSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF; |
| 1533 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1534 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Authorized Set "); |
| 1535 | ulStatus = RestoreSFParam(Adapter, (ULONG)pstAddIndication->psfAuthorizedSet, (PUCHAR)&pstAddIndicationDest->sfAuthorizedSet); |
| 1536 | if (ulStatus != 1) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1537 | goto failed_restore_sf_param; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1538 | |
| 1539 | if (pstAddIndicationDest->sfAuthorizedSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1540 | pstAddIndicationDest->sfAuthorizedSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF; |
| 1541 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1542 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Dumping the whole raw packet"); |
| 1543 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "============================================================"); |
| 1544 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " pstAddIndicationDest->sfActiveSet size %zx %p", sizeof(*pstAddIndicationDest), pstAddIndicationDest); |
| 1545 | /* BCM_DEBUG_PRINT_BUFFER(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, (unsigned char *)pstAddIndicationDest, sizeof(*pstAddIndicationDest)); */ |
| 1546 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "============================================================"); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1547 | return pstAddIndicationDest; |
| 1548 | failed_restore_sf_param: |
Stephen Hemminger | 082e889 | 2010-11-01 09:35:21 -0400 | [diff] [blame] | 1549 | kfree(pstAddIndicationDest); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1550 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "<====="); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1551 | return NULL; |
| 1552 | } |
| 1553 | |
| 1554 | ULONG SetUpTargetDsxBuffers(PMINI_ADAPTER Adapter) |
| 1555 | { |
| 1556 | ULONG ulTargetDsxBuffersBase = 0; |
| 1557 | ULONG ulCntTargetBuffers; |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 1558 | ULONG i; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1559 | int Status; |
| 1560 | |
Dan Carpenter | acedadf | 2010-10-08 14:56:35 +0200 | [diff] [blame] | 1561 | if (!Adapter) { |
| 1562 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Adapter was NULL!!!"); |
| 1563 | return 0; |
| 1564 | } |
| 1565 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1566 | if (Adapter->astTargetDsxBuffer[0].ulTargetDsxBuffer) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1567 | return 1; |
| 1568 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1569 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Size of Each DSX Buffer(Also size of ServiceFlowParamSI): %zx ", sizeof(stServiceFlowParamSI)); |
| 1570 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Reading DSX buffer From Target location %x ", DSX_MESSAGE_EXCHANGE_BUFFER); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1571 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1572 | Status = rdmalt(Adapter, DSX_MESSAGE_EXCHANGE_BUFFER, (PUINT)&ulTargetDsxBuffersBase, sizeof(UINT)); |
| 1573 | if (Status < 0) { |
| 1574 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "RDM failed!!"); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1575 | return 0; |
| 1576 | } |
| 1577 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1578 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Base Address Of DSX Target Buffer : 0x%lx", ulTargetDsxBuffersBase); |
| 1579 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Tgt Buffer is Now %lx :", ulTargetDsxBuffersBase); |
| 1580 | ulCntTargetBuffers = DSX_MESSAGE_EXCHANGE_BUFFER_SIZE / sizeof(stServiceFlowParamSI); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1581 | |
| 1582 | Adapter->ulTotalTargetBuffersAvailable = |
| 1583 | ulCntTargetBuffers > MAX_TARGET_DSX_BUFFERS ? |
| 1584 | MAX_TARGET_DSX_BUFFERS : ulCntTargetBuffers; |
| 1585 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1586 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Total Target DSX Buffer setup %lx ", Adapter->ulTotalTargetBuffersAvailable); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1587 | |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 1588 | for (i = 0; i < Adapter->ulTotalTargetBuffersAvailable; i++) { |
| 1589 | Adapter->astTargetDsxBuffer[i].ulTargetDsxBuffer = ulTargetDsxBuffersBase; |
| 1590 | Adapter->astTargetDsxBuffer[i].valid = 1; |
| 1591 | Adapter->astTargetDsxBuffer[i].tid = 0; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1592 | ulTargetDsxBuffersBase += sizeof(stServiceFlowParamSI); |
| 1593 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Target DSX Buffer %lx setup at 0x%lx", |
Kevin McKinney | 5cf4d6b | 2012-01-04 20:29:05 -0500 | [diff] [blame] | 1594 | i, Adapter->astTargetDsxBuffer[i].ulTargetDsxBuffer); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1595 | } |
| 1596 | Adapter->ulCurrentTargetBuffer = 0; |
| 1597 | Adapter->ulFreeTargetBufferCnt = Adapter->ulTotalTargetBuffersAvailable; |
| 1598 | return 1; |
| 1599 | } |
| 1600 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1601 | static ULONG GetNextTargetBufferLocation(PMINI_ADAPTER Adapter, B_UINT16 tid) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1602 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1603 | ULONG ulTargetDSXBufferAddress; |
| 1604 | ULONG ulTargetDsxBufferIndexToUse, ulMaxTry; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1605 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1606 | if ((Adapter->ulTotalTargetBuffersAvailable == 0) || (Adapter->ulFreeTargetBufferCnt == 0)) { |
| 1607 | ClearTargetDSXBuffer(Adapter, tid, FALSE); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1608 | return 0; |
| 1609 | } |
| 1610 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1611 | ulTargetDsxBufferIndexToUse = Adapter->ulCurrentTargetBuffer; |
| 1612 | ulMaxTry = Adapter->ulTotalTargetBuffersAvailable; |
| 1613 | while ((ulMaxTry) && (Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].valid != 1)) { |
| 1614 | ulTargetDsxBufferIndexToUse = (ulTargetDsxBufferIndexToUse+1) % Adapter->ulTotalTargetBuffersAvailable; |
| 1615 | ulMaxTry--; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1616 | } |
| 1617 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1618 | if (ulMaxTry == 0) { |
| 1619 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "\n GetNextTargetBufferLocation : Error No Free Target DSX Buffers FreeCnt : %lx ", Adapter->ulFreeTargetBufferCnt); |
| 1620 | ClearTargetDSXBuffer(Adapter, tid, FALSE); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1621 | return 0; |
| 1622 | } |
| 1623 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1624 | ulTargetDSXBufferAddress = Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].ulTargetDsxBuffer; |
| 1625 | Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].valid = 0; |
| 1626 | Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].tid = tid; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1627 | Adapter->ulFreeTargetBufferCnt--; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1628 | ulTargetDsxBufferIndexToUse = (ulTargetDsxBufferIndexToUse+1)%Adapter->ulTotalTargetBuffersAvailable; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1629 | Adapter->ulCurrentTargetBuffer = ulTargetDsxBufferIndexToUse; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1630 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "GetNextTargetBufferLocation :Returning address %lx tid %d\n", ulTargetDSXBufferAddress, tid); |
| 1631 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1632 | return ulTargetDSXBufferAddress; |
| 1633 | } |
| 1634 | |
Kevin McKinney | ce4bbc2 | 2012-01-04 20:29:04 -0500 | [diff] [blame] | 1635 | int AllocAdapterDsxBuffer(PMINI_ADAPTER Adapter) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1636 | { |
| 1637 | /* |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1638 | * Need to Allocate memory to contain the SUPER Large structures |
| 1639 | * Our driver can't create these structures on Stack |
| 1640 | */ |
| 1641 | Adapter->caDsxReqResp = kmalloc(sizeof(stLocalSFAddIndicationAlt)+LEADER_SIZE, GFP_KERNEL); |
| 1642 | if (!Adapter->caDsxReqResp) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1643 | return -ENOMEM; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1644 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1645 | return 0; |
| 1646 | } |
| 1647 | |
Kevin McKinney | ce4bbc2 | 2012-01-04 20:29:04 -0500 | [diff] [blame] | 1648 | int FreeAdapterDsxBuffer(PMINI_ADAPTER Adapter) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1649 | { |
Ilia Mirkin | 23c3298 | 2011-03-13 00:28:55 -0500 | [diff] [blame] | 1650 | kfree(Adapter->caDsxReqResp); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1651 | return 0; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1652 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1653 | |
| 1654 | /* |
| 1655 | * @ingroup ctrl_pkt_functions |
| 1656 | * This routinue would process the Control responses |
| 1657 | * for the Connection Management. |
| 1658 | * @return - Queue index for the free SFID else returns Invalid Index. |
| 1659 | */ |
| 1660 | BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter, /* <Pointer to the Adapter structure */ |
| 1661 | PVOID pvBuffer /* Starting Address of the Buffer, that contains the AddIndication Data */) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1662 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1663 | stServiceFlowParamSI *psfLocalSet = NULL; |
| 1664 | stLocalSFAddIndicationAlt *pstAddIndication = NULL; |
| 1665 | stLocalSFChangeIndicationAlt *pstChangeIndication = NULL; |
| 1666 | PLEADER pLeader = NULL; |
| 1667 | |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1668 | /* |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1669 | * Otherwise the message contains a target address from where we need to |
| 1670 | * read out the rest of the service flow param structure |
| 1671 | */ |
Kevin McKinney | cffae18 | 2012-01-04 20:29:03 -0500 | [diff] [blame] | 1672 | pstAddIndication = RestoreCmControlResponseMessage(Adapter, pvBuffer); |
| 1673 | if (pstAddIndication == NULL) { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1674 | ClearTargetDSXBuffer(Adapter, ((stLocalSFAddIndication *)pvBuffer)->u16TID, FALSE); |
| 1675 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Error in restoring Service Flow param structure from DSx message"); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1676 | return FALSE; |
| 1677 | } |
| 1678 | |
| 1679 | DumpCmControlPacket(pstAddIndication); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1680 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "====>"); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1681 | pLeader = (PLEADER)Adapter->caDsxReqResp; |
| 1682 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1683 | pLeader->Status = CM_CONTROL_NEWDSX_MULTICLASSIFIER_REQ; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1684 | pLeader->Vcid = 0; |
| 1685 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1686 | ClearTargetDSXBuffer(Adapter, pstAddIndication->u16TID, FALSE); |
| 1687 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "### TID RECEIVED %d\n", pstAddIndication->u16TID); |
| 1688 | switch (pstAddIndication->u8Type) { |
| 1689 | case DSA_REQ: |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1690 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1691 | pLeader->PLength = sizeof(stLocalSFAddIndicationAlt); |
| 1692 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Sending DSA Response....\n"); |
| 1693 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSA RESPONSE TO MAC %d", pLeader->PLength); |
| 1694 | *((stLocalSFAddIndicationAlt *)&(Adapter->caDsxReqResp[LEADER_SIZE])) |
| 1695 | = *pstAddIndication; |
| 1696 | ((stLocalSFAddIndicationAlt *)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSA_RSP; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1697 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1698 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " VCID = %x", ntohs(pstAddIndication->u16VCID)); |
| 1699 | CopyBufferToControlPacket(Adapter, (PVOID)Adapter->caDsxReqResp); |
| 1700 | kfree(pstAddIndication); |
| 1701 | } |
| 1702 | break; |
| 1703 | case DSA_RSP: |
| 1704 | { |
| 1705 | pLeader->PLength = sizeof(stLocalSFAddIndicationAlt); |
| 1706 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSA ACK TO MAC %d", |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1707 | pLeader->PLength); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1708 | *((stLocalSFAddIndicationAlt *)&(Adapter->caDsxReqResp[LEADER_SIZE])) |
| 1709 | = *pstAddIndication; |
| 1710 | ((stLocalSFAddIndicationAlt *)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSA_ACK; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1711 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1712 | } /* no break here..we should go down. */ |
| 1713 | case DSA_ACK: |
| 1714 | { |
| 1715 | UINT uiSearchRuleIndex = 0; |
Stephen Hemminger | e4d4625 | 2010-11-01 11:39:05 -0400 | [diff] [blame] | 1716 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1717 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "VCID:0x%X", |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1718 | ntohs(pstAddIndication->u16VCID)); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1719 | uiSearchRuleIndex = SearchFreeSfid(Adapter); |
| 1720 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "uiSearchRuleIndex:0x%X ", |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1721 | uiSearchRuleIndex); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1722 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Direction:0x%X ", |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1723 | pstAddIndication->u8Direction); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1724 | if ((uiSearchRuleIndex < NO_OF_QUEUES)) { |
| 1725 | Adapter->PackInfo[uiSearchRuleIndex].ucDirection = |
| 1726 | pstAddIndication->u8Direction; |
| 1727 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "bValid:0x%X ", |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1728 | pstAddIndication->sfActiveSet.bValid); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1729 | if (pstAddIndication->sfActiveSet.bValid == TRUE) |
| 1730 | Adapter->PackInfo[uiSearchRuleIndex].bActiveSet = TRUE; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1731 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1732 | if (pstAddIndication->sfAuthorizedSet.bValid == TRUE) |
| 1733 | Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet = TRUE; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1734 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1735 | if (pstAddIndication->sfAdmittedSet.bValid == TRUE) |
| 1736 | Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet = TRUE; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1737 | |
Kevin McKinney | cffae18 | 2012-01-04 20:29:03 -0500 | [diff] [blame] | 1738 | if (pstAddIndication->sfActiveSet.bValid == FALSE) { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1739 | Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE; |
| 1740 | Adapter->PackInfo[uiSearchRuleIndex].bActivateRequestSent = FALSE; |
| 1741 | if (pstAddIndication->sfAdmittedSet.bValid) |
| 1742 | psfLocalSet = &pstAddIndication->sfAdmittedSet; |
| 1743 | else if (pstAddIndication->sfAuthorizedSet.bValid) |
| 1744 | psfLocalSet = &pstAddIndication->sfAuthorizedSet; |
| 1745 | } else { |
| 1746 | psfLocalSet = &pstAddIndication->sfActiveSet; |
| 1747 | Adapter->PackInfo[uiSearchRuleIndex].bActive = TRUE; |
| 1748 | } |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1749 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1750 | if (!psfLocalSet) { |
| 1751 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "No set is valid\n"); |
| 1752 | Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE; |
| 1753 | Adapter->PackInfo[uiSearchRuleIndex].bValid = FALSE; |
| 1754 | Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = 0; |
| 1755 | kfree(pstAddIndication); |
| 1756 | } else if (psfLocalSet->bValid && (pstAddIndication->u8CC == 0)) { |
| 1757 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSA ACK"); |
| 1758 | Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = ntohs(pstAddIndication->u16VCID); |
| 1759 | Adapter->PackInfo[uiSearchRuleIndex].usCID = ntohs(pstAddIndication->u16CID); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1760 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1761 | if (UPLINK_DIR == pstAddIndication->u8Direction) |
| 1762 | atomic_set(&Adapter->PackInfo[uiSearchRuleIndex].uiPerSFTxResourceCount, DEFAULT_PERSFCOUNT); |
| 1763 | |
| 1764 | CopyToAdapter(Adapter, psfLocalSet, uiSearchRuleIndex, DSA_ACK, pstAddIndication); |
| 1765 | /* don't free pstAddIndication */ |
| 1766 | |
| 1767 | /* Inside CopyToAdapter, Sorting of all the SFs take place. |
| 1768 | * Hence any access to the newly added SF through uiSearchRuleIndex is invalid. |
| 1769 | * SHOULD BE STRICTLY AVOIDED. |
| 1770 | */ |
| 1771 | /* *(PULONG)(((PUCHAR)pvBuffer)+1)=psfLocalSet->u32SFID; */ |
| 1772 | memcpy((((PUCHAR)pvBuffer)+1), &psfLocalSet->u32SFID, 4); |
| 1773 | |
| 1774 | if (pstAddIndication->sfActiveSet.bValid == TRUE) { |
| 1775 | if (UPLINK_DIR == pstAddIndication->u8Direction) { |
| 1776 | if (!Adapter->LinkUpStatus) { |
| 1777 | netif_carrier_on(Adapter->dev); |
| 1778 | netif_start_queue(Adapter->dev); |
| 1779 | Adapter->LinkUpStatus = 1; |
| 1780 | if (netif_msg_link(Adapter)) |
| 1781 | pr_info(PFX "%s: link up\n", Adapter->dev->name); |
| 1782 | atomic_set(&Adapter->TxPktAvail, 1); |
| 1783 | wake_up(&Adapter->tx_packet_wait_queue); |
| 1784 | Adapter->liTimeSinceLastNetEntry = get_seconds(); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1785 | } |
| 1786 | } |
| 1787 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1788 | } else { |
| 1789 | Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE; |
| 1790 | Adapter->PackInfo[uiSearchRuleIndex].bValid = FALSE; |
| 1791 | Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = 0; |
Stephen Hemminger | 082e889 | 2010-11-01 09:35:21 -0400 | [diff] [blame] | 1792 | kfree(pstAddIndication); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1793 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1794 | } else { |
| 1795 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "DSA ACK did not get valid SFID"); |
Stephen Hemminger | 082e889 | 2010-11-01 09:35:21 -0400 | [diff] [blame] | 1796 | kfree(pstAddIndication); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1797 | return FALSE; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1798 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1799 | } |
| 1800 | break; |
| 1801 | case DSC_REQ: |
| 1802 | { |
| 1803 | pLeader->PLength = sizeof(stLocalSFChangeIndicationAlt); |
| 1804 | pstChangeIndication = (stLocalSFChangeIndicationAlt *)pstAddIndication; |
| 1805 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSC RESPONSE TO MAC %d", pLeader->PLength); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1806 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1807 | *((stLocalSFChangeIndicationAlt *)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *pstChangeIndication; |
| 1808 | ((stLocalSFChangeIndicationAlt *)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSC_RSP; |
| 1809 | |
| 1810 | CopyBufferToControlPacket(Adapter, (PVOID)Adapter->caDsxReqResp); |
| 1811 | kfree(pstAddIndication); |
| 1812 | } |
| 1813 | break; |
| 1814 | case DSC_RSP: |
| 1815 | { |
| 1816 | pLeader->PLength = sizeof(stLocalSFChangeIndicationAlt); |
| 1817 | pstChangeIndication = (stLocalSFChangeIndicationAlt *)pstAddIndication; |
| 1818 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSC ACK TO MAC %d", pLeader->PLength); |
| 1819 | *((stLocalSFChangeIndicationAlt *)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *pstChangeIndication; |
| 1820 | ((stLocalSFChangeIndicationAlt *)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSC_ACK; |
| 1821 | } |
| 1822 | case DSC_ACK: |
| 1823 | { |
| 1824 | UINT uiSearchRuleIndex = 0; |
| 1825 | |
| 1826 | pstChangeIndication = (stLocalSFChangeIndicationAlt *)pstAddIndication; |
| 1827 | uiSearchRuleIndex = SearchSfid(Adapter, ntohl(pstChangeIndication->sfActiveSet.u32SFID)); |
| 1828 | if (uiSearchRuleIndex > NO_OF_QUEUES-1) |
| 1829 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "SF doesn't exist for which DSC_ACK is received"); |
| 1830 | |
| 1831 | if ((uiSearchRuleIndex < NO_OF_QUEUES)) { |
| 1832 | Adapter->PackInfo[uiSearchRuleIndex].ucDirection = pstChangeIndication->u8Direction; |
| 1833 | if (pstChangeIndication->sfActiveSet.bValid == TRUE) |
| 1834 | Adapter->PackInfo[uiSearchRuleIndex].bActiveSet = TRUE; |
| 1835 | |
| 1836 | if (pstChangeIndication->sfAuthorizedSet.bValid == TRUE) |
| 1837 | Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet = TRUE; |
| 1838 | |
| 1839 | if (pstChangeIndication->sfAdmittedSet.bValid == TRUE) |
| 1840 | Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet = TRUE; |
| 1841 | |
Kevin McKinney | cffae18 | 2012-01-04 20:29:03 -0500 | [diff] [blame] | 1842 | if (pstChangeIndication->sfActiveSet.bValid == FALSE) { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1843 | Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE; |
| 1844 | Adapter->PackInfo[uiSearchRuleIndex].bActivateRequestSent = FALSE; |
| 1845 | |
| 1846 | if (pstChangeIndication->sfAdmittedSet.bValid) |
| 1847 | psfLocalSet = &pstChangeIndication->sfAdmittedSet; |
| 1848 | else if (pstChangeIndication->sfAuthorizedSet.bValid) |
| 1849 | psfLocalSet = &pstChangeIndication->sfAuthorizedSet; |
| 1850 | } else { |
| 1851 | psfLocalSet = &pstChangeIndication->sfActiveSet; |
| 1852 | Adapter->PackInfo[uiSearchRuleIndex].bActive = TRUE; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1853 | } |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1854 | |
Kevin McKinney | adc4a3a | 2012-02-23 23:41:05 -0500 | [diff] [blame] | 1855 | if (!psfLocalSet) { |
| 1856 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "No set is valid\n"); |
| 1857 | Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE; |
| 1858 | Adapter->PackInfo[uiSearchRuleIndex].bValid = FALSE; |
| 1859 | Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = 0; |
Kevin McKinney | cc55bb0 | 2012-03-02 00:17:04 -0500 | [diff] [blame] | 1860 | kfree(pstAddIndication); |
Kevin McKinney | adc4a3a | 2012-02-23 23:41:05 -0500 | [diff] [blame] | 1861 | } else if (psfLocalSet->bValid && (pstChangeIndication->u8CC == 0)) { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1862 | Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = ntohs(pstChangeIndication->u16VCID); |
| 1863 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "CC field is %d bvalid = %d\n", |
| 1864 | pstChangeIndication->u8CC, psfLocalSet->bValid); |
| 1865 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "VCID= %d\n", ntohs(pstChangeIndication->u16VCID)); |
| 1866 | Adapter->PackInfo[uiSearchRuleIndex].usCID = ntohs(pstChangeIndication->u16CID); |
| 1867 | CopyToAdapter(Adapter, psfLocalSet, uiSearchRuleIndex, DSC_ACK, pstAddIndication); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1868 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1869 | *(PULONG)(((PUCHAR)pvBuffer)+1) = psfLocalSet->u32SFID; |
| 1870 | } else if (pstChangeIndication->u8CC == 6) { |
| 1871 | deleteSFBySfid(Adapter, uiSearchRuleIndex); |
Stephen Hemminger | 082e889 | 2010-11-01 09:35:21 -0400 | [diff] [blame] | 1872 | kfree(pstAddIndication); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1873 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1874 | } else { |
| 1875 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "DSC ACK did not get valid SFID"); |
| 1876 | kfree(pstAddIndication); |
| 1877 | return FALSE; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1878 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1879 | } |
| 1880 | break; |
| 1881 | case DSD_REQ: |
| 1882 | { |
| 1883 | UINT uiSearchRuleIndex; |
| 1884 | ULONG ulSFID; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1885 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1886 | pLeader->PLength = sizeof(stLocalSFDeleteIndication); |
| 1887 | *((stLocalSFDeleteIndication *)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *((stLocalSFDeleteIndication *)pstAddIndication); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1888 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1889 | ulSFID = ntohl(((stLocalSFDeleteIndication *)pstAddIndication)->u32SFID); |
| 1890 | uiSearchRuleIndex = SearchSfid(Adapter, ulSFID); |
| 1891 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSD - Removing connection %x", uiSearchRuleIndex); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1892 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1893 | if (uiSearchRuleIndex < NO_OF_QUEUES) { |
| 1894 | /* Delete All Classifiers Associated with this SFID */ |
| 1895 | deleteSFBySfid(Adapter, uiSearchRuleIndex); |
| 1896 | Adapter->u32TotalDSD++; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1897 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1898 | |
| 1899 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSD RESPONSE TO MAC"); |
| 1900 | ((stLocalSFDeleteIndication *)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSD_RSP; |
| 1901 | CopyBufferToControlPacket(Adapter, (PVOID)Adapter->caDsxReqResp); |
| 1902 | } |
| 1903 | case DSD_RSP: |
| 1904 | { |
| 1905 | /* Do nothing as SF has already got Deleted */ |
| 1906 | } |
| 1907 | break; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1908 | case DSD_ACK: |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1909 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSD ACK Rcd, let App handle it\n"); |
| 1910 | break; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1911 | default: |
Stephen Hemminger | 082e889 | 2010-11-01 09:35:21 -0400 | [diff] [blame] | 1912 | kfree(pstAddIndication); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1913 | return FALSE; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1914 | } |
| 1915 | return TRUE; |
| 1916 | } |
| 1917 | |
Arnd Bergmann | 44a17eff | 2010-09-30 10:24:12 +0200 | [diff] [blame] | 1918 | int get_dsx_sf_data_to_application(PMINI_ADAPTER Adapter, UINT uiSFId, void __user *user_buffer) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1919 | { |
| 1920 | int status = 0; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1921 | struct _packet_info *psSfInfo = NULL; |
| 1922 | |
| 1923 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "status =%d", status); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1924 | status = SearchSfid(Adapter, uiSFId); |
Dan Carpenter | 370adc7 | 2010-10-08 15:49:04 +0200 | [diff] [blame] | 1925 | if (status >= NO_OF_QUEUES) { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1926 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SFID %d not present in queue !!!", uiSFId); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1927 | return -EINVAL; |
| 1928 | } |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1929 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "status =%d", status); |
| 1930 | psSfInfo = &Adapter->PackInfo[status]; |
| 1931 | if (psSfInfo->pstSFIndication && copy_to_user(user_buffer, |
| 1932 | psSfInfo->pstSFIndication, sizeof(stLocalSFAddIndicationAlt))) { |
| 1933 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "copy to user failed SFID %d, present in queue !!!", uiSFId); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1934 | status = -EFAULT; |
| 1935 | return status; |
| 1936 | } |
| 1937 | return STATUS_SUCCESS; |
| 1938 | } |
| 1939 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1940 | VOID OverrideServiceFlowParams(PMINI_ADAPTER Adapter, PUINT puiBuffer) |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1941 | { |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1942 | B_UINT32 u32NumofSFsinMsg = ntohl(*(puiBuffer + 1)); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1943 | stIM_SFHostNotify *pHostInfo = NULL; |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1944 | UINT uiSearchRuleIndex = 0; |
| 1945 | ULONG ulSFID = 0; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1946 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1947 | puiBuffer += 2; |
| 1948 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "u32NumofSFsinMsg: 0x%x\n", u32NumofSFsinMsg); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1949 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1950 | while (u32NumofSFsinMsg != 0 && u32NumofSFsinMsg < NO_OF_QUEUES) { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1951 | u32NumofSFsinMsg--; |
| 1952 | pHostInfo = (stIM_SFHostNotify *)puiBuffer; |
| 1953 | puiBuffer = (PUINT)(pHostInfo + 1); |
| 1954 | |
| 1955 | ulSFID = ntohl(pHostInfo->SFID); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1956 | uiSearchRuleIndex = SearchSfid(Adapter, ulSFID); |
| 1957 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SFID: 0x%lx\n", ulSFID); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1958 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1959 | if (uiSearchRuleIndex >= NO_OF_QUEUES || uiSearchRuleIndex == HiPriority) { |
| 1960 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "The SFID <%lx> doesn't exist in host entry or is Invalid\n", ulSFID); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1961 | continue; |
| 1962 | } |
| 1963 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1964 | if (pHostInfo->RetainSF == FALSE) { |
| 1965 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Going to Delete SF"); |
| 1966 | deleteSFBySfid(Adapter, uiSearchRuleIndex); |
| 1967 | } else { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1968 | Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = ntohs(pHostInfo->VCID); |
| 1969 | Adapter->PackInfo[uiSearchRuleIndex].usCID = ntohs(pHostInfo->newCID); |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1970 | Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1971 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1972 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "pHostInfo->QoSParamSet: 0x%x\n", pHostInfo->QoSParamSet); |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1973 | |
Kevin McKinney | 9937fdb | 2012-01-04 20:29:00 -0500 | [diff] [blame] | 1974 | if (pHostInfo->QoSParamSet & 0x1) |
| 1975 | Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet = TRUE; |
| 1976 | if (pHostInfo->QoSParamSet & 0x2) |
| 1977 | Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet = TRUE; |
| 1978 | if (pHostInfo->QoSParamSet & 0x4) { |
| 1979 | Adapter->PackInfo[uiSearchRuleIndex].bActiveSet = TRUE; |
| 1980 | Adapter->PackInfo[uiSearchRuleIndex].bActive = TRUE; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1981 | } |
| 1982 | } |
| 1983 | } |
| 1984 | } |