x86/PCI: use host bridge _CRS info on ASUS M2V-MX SE
[linux-btrfs-devel.git] / drivers / staging / bcm / CmHost.c
blobc0ee95a713432090005d08d925fd7986db6f7dcb
1 /************************************************************
2 * CMHOST.C
3 * This file contains the routines for handling Connection
4 * Management.
5 ************************************************************/
7 //#define CONN_MSG
8 #include "headers.h"
10 typedef enum _E_CLASSIFIER_ACTION
12 eInvalidClassifierAction,
13 eAddClassifier,
14 eReplaceClassifier,
15 eDeleteClassifier
16 }E_CLASSIFIER_ACTION;
18 static ULONG GetNextTargetBufferLocation(PMINI_ADAPTER Adapter,B_UINT16 tid);
20 /************************************************************
21 * Function - SearchSfid
23 * Description - This routinue would search QOS queues having
24 * specified SFID as input parameter.
26 * Parameters - Adapter: Pointer to the Adapter structure
27 * uiSfid : Given SFID for matching
29 * Returns - Queue index for this SFID(If matched)
30 Else Invalid Queue Index(If Not matched)
31 ************************************************************/
32 INT SearchSfid(PMINI_ADAPTER Adapter,UINT uiSfid)
34 INT iIndex=0;
35 for(iIndex=(NO_OF_QUEUES-1); iIndex>=0; iIndex--)
36 if(Adapter->PackInfo[iIndex].ulSFID==uiSfid)
37 return iIndex;
38 return NO_OF_QUEUES+1;
41 /***************************************************************
42 * Function - SearchFreeSfid
44 * Description - This routinue would search Free available SFID.
46 * Parameter - Adapter: Pointer to the Adapter structure
48 * Returns - Queue index for the free SFID
49 * Else returns Invalid Index.
50 ****************************************************************/
51 static INT SearchFreeSfid(PMINI_ADAPTER Adapter)
53 UINT uiIndex=0;
55 for(uiIndex=0; uiIndex < (NO_OF_QUEUES-1); uiIndex++)
56 if(Adapter->PackInfo[uiIndex].ulSFID==0)
57 return uiIndex;
58 return NO_OF_QUEUES+1;
62 Function: SearchClsid
63 Description: This routinue would search Classifier having specified ClassifierID as input parameter
64 Input parameters: PMINI_ADAPTER Adapter - Adapter Context
65 unsigned int uiSfid - The SF in which the classifier is to searched
66 B_UINT16 uiClassifierID - The classifier ID to be searched
67 Return: int :Classifier table index of matching entry
70 static int SearchClsid(PMINI_ADAPTER Adapter,ULONG ulSFID,B_UINT16 uiClassifierID)
72 unsigned int uiClassifierIndex = 0;
73 for(uiClassifierIndex=0;uiClassifierIndex<MAX_CLASSIFIERS;uiClassifierIndex++)
75 if((Adapter->astClassifierTable[uiClassifierIndex].bUsed) &&
76 (Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex == uiClassifierID)&&
77 (Adapter->astClassifierTable[uiClassifierIndex].ulSFID == ulSFID))
78 return uiClassifierIndex;
80 return MAX_CLASSIFIERS+1;
83 /**
84 @ingroup ctrl_pkt_functions
85 This routinue would search Free available Classifier entry in classifier table.
86 @return free Classifier Entry index in classifier table for specified SF
88 static int SearchFreeClsid(PMINI_ADAPTER Adapter /**Adapter Context*/
91 unsigned int uiClassifierIndex = 0;
92 for(uiClassifierIndex=0;uiClassifierIndex<MAX_CLASSIFIERS;uiClassifierIndex++)
94 if(!Adapter->astClassifierTable[uiClassifierIndex].bUsed)
95 return uiClassifierIndex;
97 return MAX_CLASSIFIERS+1;
100 static VOID deleteSFBySfid(PMINI_ADAPTER Adapter, UINT uiSearchRuleIndex)
102 //deleting all the packet held in the SF
103 flush_queue(Adapter,uiSearchRuleIndex);
105 //Deleting the all classifiers for this SF
106 DeleteAllClassifiersForSF(Adapter,uiSearchRuleIndex);
108 //Resetting only MIBS related entries in the SF
109 memset((PVOID)&Adapter->PackInfo[uiSearchRuleIndex], 0, sizeof(S_MIBS_SERVICEFLOW_TABLE));
112 static inline VOID
113 CopyIpAddrToClassifier(S_CLASSIFIER_RULE *pstClassifierEntry ,
114 B_UINT8 u8IpAddressLen , B_UINT8 *pu8IpAddressMaskSrc ,
115 BOOLEAN bIpVersion6 , E_IPADDR_CONTEXT eIpAddrContext)
117 UINT ucLoopIndex=0;
118 UINT nSizeOfIPAddressInBytes = IP_LENGTH_OF_ADDRESS;
119 UCHAR *ptrClassifierIpAddress = NULL;
120 UCHAR *ptrClassifierIpMask = NULL;
121 PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
123 if(bIpVersion6)
125 nSizeOfIPAddressInBytes = IPV6_ADDRESS_SIZEINBYTES;
127 //Destination Ip Address
128 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Ip Address Range Length:0x%X ",
129 u8IpAddressLen);
130 if((bIpVersion6?(IPV6_ADDRESS_SIZEINBYTES * MAX_IP_RANGE_LENGTH * 2):
131 (TOTAL_MASKED_ADDRESS_IN_BYTES)) >= u8IpAddressLen)
134 //checking both the mask and address togethor in Classification.
135 //So length will be : TotalLengthInBytes/nSizeOfIPAddressInBytes * 2
136 //(nSizeOfIPAddressInBytes for address and nSizeOfIPAddressInBytes for mask)
138 if(eIpAddrContext == eDestIpAddress)
140 pstClassifierEntry->ucIPDestinationAddressLength =
141 u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
142 if(bIpVersion6)
144 ptrClassifierIpAddress =
145 pstClassifierEntry->stDestIpAddress.ucIpv6Address;
146 ptrClassifierIpMask =
147 pstClassifierEntry->stDestIpAddress.ucIpv6Mask;
149 else
151 ptrClassifierIpAddress =
152 pstClassifierEntry->stDestIpAddress.ucIpv4Address;
153 ptrClassifierIpMask =
154 pstClassifierEntry->stDestIpAddress.ucIpv4Mask;
157 else if(eIpAddrContext == eSrcIpAddress)
159 pstClassifierEntry->ucIPSourceAddressLength =
160 u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
161 if(bIpVersion6)
163 ptrClassifierIpAddress =
164 pstClassifierEntry->stSrcIpAddress.ucIpv6Address;
165 ptrClassifierIpMask =
166 pstClassifierEntry->stSrcIpAddress.ucIpv6Mask;
168 else
170 ptrClassifierIpAddress =
171 pstClassifierEntry->stSrcIpAddress.ucIpv4Address;
172 ptrClassifierIpMask =
173 pstClassifierEntry->stSrcIpAddress.ucIpv4Mask;
176 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Address Length:0x%X \n",
177 pstClassifierEntry->ucIPDestinationAddressLength);
178 while((u8IpAddressLen>= nSizeOfIPAddressInBytes) &&
179 (ucLoopIndex < MAX_IP_RANGE_LENGTH))
181 memcpy(ptrClassifierIpAddress +
182 (ucLoopIndex * nSizeOfIPAddressInBytes),
183 (pu8IpAddressMaskSrc+(ucLoopIndex*nSizeOfIPAddressInBytes*2)),
184 nSizeOfIPAddressInBytes);
185 if(!bIpVersion6)
187 if(eIpAddrContext == eSrcIpAddress)
189 pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[ucLoopIndex]=
190 ntohl(pstClassifierEntry->stSrcIpAddress.
191 ulIpv4Addr[ucLoopIndex]);
192 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Src Ip Address:0x%luX ",pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[ucLoopIndex]);
194 else if(eIpAddrContext == eDestIpAddress)
196 pstClassifierEntry->stDestIpAddress.ulIpv4Addr[ucLoopIndex]= ntohl(pstClassifierEntry->stDestIpAddress.
197 ulIpv4Addr[ucLoopIndex]);
198 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Dest Ip Address:0x%luX ",pstClassifierEntry->stDestIpAddress.ulIpv4Addr[ucLoopIndex]);
201 u8IpAddressLen-=nSizeOfIPAddressInBytes;
202 if(u8IpAddressLen >= nSizeOfIPAddressInBytes)
204 memcpy(ptrClassifierIpMask +
205 (ucLoopIndex * nSizeOfIPAddressInBytes),
206 (pu8IpAddressMaskSrc+nSizeOfIPAddressInBytes +
207 (ucLoopIndex*nSizeOfIPAddressInBytes*2)),
208 nSizeOfIPAddressInBytes);
209 if(!bIpVersion6)
211 if(eIpAddrContext == eSrcIpAddress)
213 pstClassifierEntry->stSrcIpAddress.
214 ulIpv4Mask[ucLoopIndex]=
215 ntohl(pstClassifierEntry->stSrcIpAddress.
216 ulIpv4Mask[ucLoopIndex]);
217 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Src Ip Mask Address:0x%luX ",pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[ucLoopIndex]);
219 else if(eIpAddrContext == eDestIpAddress)
221 pstClassifierEntry->stDestIpAddress.
222 ulIpv4Mask[ucLoopIndex] =
223 ntohl(pstClassifierEntry->stDestIpAddress.
224 ulIpv4Mask[ucLoopIndex]);
225 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Dest Ip Mask Address:0x%luX ",pstClassifierEntry->stDestIpAddress.ulIpv4Mask[ucLoopIndex]);
228 u8IpAddressLen-=nSizeOfIPAddressInBytes;
230 if(0==u8IpAddressLen)
232 pstClassifierEntry->bDestIpValid=TRUE;
234 ucLoopIndex++;
236 if(bIpVersion6)
238 //Restore EndianNess of Struct
239 for(ucLoopIndex =0 ; ucLoopIndex < MAX_IP_RANGE_LENGTH * 4 ;
240 ucLoopIndex++)
242 if(eIpAddrContext == eSrcIpAddress)
244 pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[ucLoopIndex]=
245 ntohl(pstClassifierEntry->stSrcIpAddress.
246 ulIpv6Addr[ucLoopIndex]);
247 pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[ucLoopIndex]= ntohl(pstClassifierEntry->stSrcIpAddress.
248 ulIpv6Mask[ucLoopIndex]);
250 else if(eIpAddrContext == eDestIpAddress)
252 pstClassifierEntry->stDestIpAddress.ulIpv6Addr[ucLoopIndex]= ntohl(pstClassifierEntry->stDestIpAddress.
253 ulIpv6Addr[ucLoopIndex]);
254 pstClassifierEntry->stDestIpAddress.ulIpv6Mask[ucLoopIndex]= ntohl(pstClassifierEntry->stDestIpAddress.
255 ulIpv6Mask[ucLoopIndex]);
263 void ClearTargetDSXBuffer(PMINI_ADAPTER Adapter,B_UINT16 TID,BOOLEAN bFreeAll)
265 ULONG ulIndex;
266 for(ulIndex=0; ulIndex < Adapter->ulTotalTargetBuffersAvailable; ulIndex++)
268 if(Adapter->astTargetDsxBuffer[ulIndex].valid)
269 continue;
270 if ((bFreeAll) || (Adapter->astTargetDsxBuffer[ulIndex].tid == TID)){
271 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "ClearTargetDSXBuffer: found tid %d buffer cleared %lx\n",
272 TID, Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer);
273 Adapter->astTargetDsxBuffer[ulIndex].valid=1;
274 Adapter->astTargetDsxBuffer[ulIndex].tid=0;
275 Adapter->ulFreeTargetBufferCnt++;
281 @ingroup ctrl_pkt_functions
282 copy classifier rule into the specified SF index
284 static inline VOID CopyClassifierRuleToSF(PMINI_ADAPTER Adapter,stConvergenceSLTypes *psfCSType,UINT uiSearchRuleIndex,UINT nClassifierIndex)
286 S_CLASSIFIER_RULE *pstClassifierEntry = NULL;
287 //VOID *pvPhsContext = NULL;
288 UINT ucLoopIndex=0;
289 //UCHAR ucProtocolLength=0;
290 //ULONG ulPhsStatus;
293 if(Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value == 0 ||
294 nClassifierIndex > (MAX_CLASSIFIERS-1))
295 return;
298 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Storing Classifier Rule Index : %X",ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex));
300 if(nClassifierIndex > MAX_CLASSIFIERS-1)
301 return;
303 pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
304 if(pstClassifierEntry)
306 //Store if Ipv6
307 pstClassifierEntry->bIpv6Protocol =
308 (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6)?TRUE:FALSE;
310 //Destinaiton Port
311 pstClassifierEntry->ucDestPortRangeLength=psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength/4;
312 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Destination Port Range Length:0x%X ",pstClassifierEntry->ucDestPortRangeLength);
313 if( MAX_PORT_RANGE >= psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength)
315 for(ucLoopIndex=0;ucLoopIndex<(pstClassifierEntry->ucDestPortRangeLength);ucLoopIndex++)
317 pstClassifierEntry->usDestPortRangeLo[ucLoopIndex] =
318 *((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+ucLoopIndex));
319 pstClassifierEntry->usDestPortRangeHi[ucLoopIndex] =
320 *((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+2+ucLoopIndex));
321 pstClassifierEntry->usDestPortRangeLo[ucLoopIndex]=ntohs(pstClassifierEntry->usDestPortRangeLo[ucLoopIndex]);
322 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Destination Port Range Lo:0x%X ",pstClassifierEntry->usDestPortRangeLo[ucLoopIndex]);
323 pstClassifierEntry->usDestPortRangeHi[ucLoopIndex]=ntohs(pstClassifierEntry->usDestPortRangeHi[ucLoopIndex]);
326 else
328 pstClassifierEntry->ucDestPortRangeLength=0;
330 //Source Port
331 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Source Port Range Length:0x%X ",psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
332 if(MAX_PORT_RANGE >=
333 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength)
335 pstClassifierEntry->ucSrcPortRangeLength =
336 psfCSType->cCPacketClassificationRule.
337 u8ProtocolSourcePortRangeLength/4;
338 for(ucLoopIndex = 0; ucLoopIndex <
339 (pstClassifierEntry->ucSrcPortRangeLength); ucLoopIndex++)
341 pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex] =
342 *((PUSHORT)(psfCSType->cCPacketClassificationRule.
343 u8ProtocolSourcePortRange+ucLoopIndex));
344 pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex] =
345 *((PUSHORT)(psfCSType->cCPacketClassificationRule.
346 u8ProtocolSourcePortRange+2+ucLoopIndex));
347 pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex] =
348 ntohs(pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex]);
349 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Source Port Range Lo:0x%X ",pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex]);
350 pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex]=ntohs(pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex]);
353 //Destination Ip Address and Mask
354 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Ip Destination Parameters : ");
356 CopyIpAddrToClassifier(pstClassifierEntry,
357 psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength,
358 psfCSType->cCPacketClassificationRule.u8IPDestinationAddress,
359 (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6)?
360 TRUE:FALSE, eDestIpAddress);
362 //Source Ip Address and Mask
363 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Ip Source Parameters : ");
365 CopyIpAddrToClassifier(pstClassifierEntry,
366 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength,
367 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress,
368 (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6)?TRUE:FALSE,
369 eSrcIpAddress);
371 //TOS
372 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"TOS Length:0x%X ",psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
373 if(3 == psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength)
375 pstClassifierEntry->ucIPTypeOfServiceLength =
376 psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength;
377 pstClassifierEntry->ucTosLow =
378 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0];
379 pstClassifierEntry->ucTosHigh =
380 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1];
381 pstClassifierEntry->ucTosMask =
382 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2];
383 pstClassifierEntry->bTOSValid = TRUE;
385 if(psfCSType->cCPacketClassificationRule.u8Protocol == 0)
387 //we didn't get protocol field filled in by the BS
388 pstClassifierEntry->ucProtocolLength=0;
390 else
392 pstClassifierEntry->ucProtocolLength=1;// 1 valid protocol
395 pstClassifierEntry->ucProtocol[0] =
396 psfCSType->cCPacketClassificationRule.u8Protocol;
398 pstClassifierEntry->u8ClassifierRulePriority =
399 psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority;
401 //store the classifier rule ID and set this classifier entry as valid
402 pstClassifierEntry->ucDirection =
403 Adapter->PackInfo[uiSearchRuleIndex].ucDirection;
404 pstClassifierEntry->uiClassifierRuleIndex = ntohs(psfCSType->
405 cCPacketClassificationRule.u16PacketClassificationRuleIndex);
406 pstClassifierEntry->usVCID_Value =
407 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
408 pstClassifierEntry->ulSFID =
409 Adapter->PackInfo[uiSearchRuleIndex].ulSFID;
410 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Search Index %d Dir: %d, Index: %d, Vcid: %d\n",
411 uiSearchRuleIndex, pstClassifierEntry->ucDirection,
412 pstClassifierEntry->uiClassifierRuleIndex,
413 pstClassifierEntry->usVCID_Value);
415 if(psfCSType->cCPacketClassificationRule.u8AssociatedPHSI)
417 pstClassifierEntry->u8AssociatedPHSI = psfCSType->cCPacketClassificationRule.u8AssociatedPHSI;
420 //Copy ETH CS Parameters
421 pstClassifierEntry->ucEthCSSrcMACLen = (psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddressLength);
422 memcpy(pstClassifierEntry->au8EThCSSrcMAC,psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress,MAC_ADDRESS_SIZE);
423 memcpy(pstClassifierEntry->au8EThCSSrcMACMask,psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress+MAC_ADDRESS_SIZE,MAC_ADDRESS_SIZE);
424 pstClassifierEntry->ucEthCSDestMACLen = (psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
425 memcpy(pstClassifierEntry->au8EThCSDestMAC,psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress,MAC_ADDRESS_SIZE);
426 memcpy(pstClassifierEntry->au8EThCSDestMACMask,psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress+MAC_ADDRESS_SIZE,MAC_ADDRESS_SIZE);
427 pstClassifierEntry->ucEtherTypeLen = (psfCSType->cCPacketClassificationRule.u8EthertypeLength);
428 memcpy(pstClassifierEntry->au8EthCSEtherType,psfCSType->cCPacketClassificationRule.u8Ethertype,NUM_ETHERTYPE_BYTES);
429 memcpy(pstClassifierEntry->usUserPriority, &psfCSType->cCPacketClassificationRule.u16UserPriority, 2);
430 pstClassifierEntry->usVLANID = ntohs(psfCSType->cCPacketClassificationRule.u16VLANID);
431 pstClassifierEntry->usValidityBitMap = ntohs(psfCSType->cCPacketClassificationRule.u16ValidityBitMap);
433 pstClassifierEntry->bUsed = TRUE;
439 @ingroup ctrl_pkt_functions
441 static inline VOID DeleteClassifierRuleFromSF(PMINI_ADAPTER Adapter,UINT uiSearchRuleIndex,UINT nClassifierIndex)
443 S_CLASSIFIER_RULE *pstClassifierEntry = NULL;
444 B_UINT16 u16PacketClassificationRuleIndex;
445 USHORT usVCID;
446 //VOID *pvPhsContext = NULL;
447 //ULONG ulPhsStatus;
449 usVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
451 if(nClassifierIndex > MAX_CLASSIFIERS-1)
452 return;
454 if(usVCID == 0)
455 return;
457 u16PacketClassificationRuleIndex = Adapter->astClassifierTable[nClassifierIndex].uiClassifierRuleIndex;
460 pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
461 if(pstClassifierEntry)
463 pstClassifierEntry->bUsed = FALSE;
464 pstClassifierEntry->uiClassifierRuleIndex = 0;
465 memset(pstClassifierEntry,0,sizeof(S_CLASSIFIER_RULE));
467 //Delete the PHS Rule for this classifier
468 PhsDeleteClassifierRule(
469 &Adapter->stBCMPhsContext,
470 usVCID,
471 u16PacketClassificationRuleIndex);
476 @ingroup ctrl_pkt_functions
478 VOID DeleteAllClassifiersForSF(PMINI_ADAPTER Adapter,UINT uiSearchRuleIndex)
480 S_CLASSIFIER_RULE *pstClassifierEntry = NULL;
481 UINT nClassifierIndex;
482 //B_UINT16 u16PacketClassificationRuleIndex;
483 USHORT ulVCID;
484 //VOID *pvPhsContext = NULL;
485 //ULONG ulPhsStatus;
487 ulVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
489 if(ulVCID == 0)
490 return;
493 for(nClassifierIndex =0 ; nClassifierIndex < MAX_CLASSIFIERS ; nClassifierIndex++)
495 if(Adapter->astClassifierTable[nClassifierIndex].usVCID_Value == ulVCID)
497 pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
498 if(pstClassifierEntry->bUsed)
500 DeleteClassifierRuleFromSF(Adapter,uiSearchRuleIndex,nClassifierIndex);
505 //Delete All Phs Rules Associated with this SF
506 PhsDeleteSFRules(
507 &Adapter->stBCMPhsContext,
508 ulVCID);
514 This routinue copies the Connection Management
515 related data into the Adapter structure.
516 @ingroup ctrl_pkt_functions
519 static VOID CopyToAdapter( register PMINI_ADAPTER Adapter, /**<Pointer to the Adapter structure*/
520 register pstServiceFlowParamSI psfLocalSet, /**<Pointer to the ServiceFlowParamSI structure*/
521 register UINT uiSearchRuleIndex, /**<Index of Queue, to which this data belongs*/
522 register UCHAR ucDsxType,
523 stLocalSFAddIndicationAlt *pstAddIndication)
525 //UCHAR ucProtocolLength=0;
526 ULONG ulSFID;
527 UINT nClassifierIndex = 0;
528 E_CLASSIFIER_ACTION eClassifierAction = eInvalidClassifierAction;
529 B_UINT16 u16PacketClassificationRuleIndex=0;
530 UINT nIndex=0;
531 stConvergenceSLTypes *psfCSType = NULL;
532 S_PHS_RULE sPhsRule;
533 USHORT uVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
534 UINT UGIValue = 0;
537 Adapter->PackInfo[uiSearchRuleIndex].bValid=TRUE;
538 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Search Rule Index = %d\n", uiSearchRuleIndex);
539 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"%s: SFID= %x ",__FUNCTION__, ntohl(psfLocalSet->u32SFID));
540 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Updating Queue %d",uiSearchRuleIndex);
542 ulSFID = ntohl(psfLocalSet->u32SFID);
543 //Store IP Version used
544 //Get The Version Of IP used (IPv6 or IPv4) from CSSpecification field of SF
546 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = 0;
547 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 0;
549 /*Enable IP/ETh CS Support As Required*/
550 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"CopyToAdapter : u8CSSpecification : %X\n",psfLocalSet->u8CSSpecification);
551 switch(psfLocalSet->u8CSSpecification)
553 case eCSPacketIPV4:
555 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
556 break;
558 case eCSPacketIPV6:
560 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV6_CS;
561 break;
564 case eCS802_3PacketEthernet:
565 case eCS802_1QPacketVLAN:
567 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3;
568 break;
571 case eCSPacketIPV4Over802_1QVLAN:
572 case eCSPacketIPV4Over802_3Ethernet:
574 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
575 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3;
576 break;
579 case eCSPacketIPV6Over802_1QVLAN:
580 case eCSPacketIPV6Over802_3Ethernet:
582 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV6_CS;
583 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3;
584 break;
587 default:
589 BCM_DEBUG_PRINT (Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error in value of CS Classification.. setting default to IP CS\n");
590 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
591 break;
595 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",
596 uiSearchRuleIndex,
597 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport,
598 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport);
600 //Store IP Version used
601 //Get The Version Of IP used (IPv6 or IPv4) from CSSpecification field of SF
602 if(Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport == IPV6_CS)
604 Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion = IPV6;
606 else
608 Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion = IPV4;
611 /* To ensure that the ETH CS code doesn't gets executed if the BS doesn't supports ETH CS */
612 if(!Adapter->bETHCSEnabled)
613 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 0;
615 if(psfLocalSet->u8ServiceClassNameLength > 0 &&
616 psfLocalSet->u8ServiceClassNameLength < 32)
618 memcpy(Adapter->PackInfo[uiSearchRuleIndex].ucServiceClassName,
619 psfLocalSet->u8ServiceClassName,
620 psfLocalSet->u8ServiceClassNameLength);
622 Adapter->PackInfo[uiSearchRuleIndex].u8QueueType =
623 psfLocalSet->u8ServiceFlowSchedulingType;
625 if(Adapter->PackInfo[uiSearchRuleIndex].u8QueueType==BE &&
626 Adapter->PackInfo[uiSearchRuleIndex].ucDirection)
628 Adapter->usBestEffortQueueIndex=uiSearchRuleIndex;
631 Adapter->PackInfo[uiSearchRuleIndex].ulSFID = ntohl(psfLocalSet->u32SFID);
633 Adapter->PackInfo[uiSearchRuleIndex].u8TrafficPriority = psfLocalSet->u8TrafficPriority;
635 //copy all the classifier in the Service Flow param structure
636 for(nIndex=0; nIndex<psfLocalSet->u8TotalClassifiers; nIndex++)
638 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Classifier index =%d",nIndex);
639 psfCSType = &psfLocalSet->cConvergenceSLTypes[nIndex];
640 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Classifier index =%d",nIndex);
642 if(psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority)
644 Adapter->PackInfo[uiSearchRuleIndex].bClassifierPriority=TRUE;
647 if(psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority)
649 Adapter->PackInfo[uiSearchRuleIndex].bClassifierPriority=TRUE;
653 if(ucDsxType== DSA_ACK)
655 eClassifierAction = eAddClassifier;
657 else if(ucDsxType == DSC_ACK)
659 switch(psfCSType->u8ClassfierDSCAction)
661 case 0://DSC Add Classifier
663 eClassifierAction = eAddClassifier;
665 break;
666 case 1://DSC Replace Classifier
668 eClassifierAction = eReplaceClassifier;
670 break;
671 case 2://DSC Delete Classifier
673 eClassifierAction = eDeleteClassifier;
676 break;
677 default:
679 eClassifierAction = eInvalidClassifierAction;
684 u16PacketClassificationRuleIndex = ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
686 switch(eClassifierAction)
688 case eAddClassifier:
690 //Get a Free Classifier Index From Classifier table for this SF to add the Classifier
691 //Contained in this message
692 nClassifierIndex = SearchClsid(Adapter,ulSFID,u16PacketClassificationRuleIndex);
694 if(nClassifierIndex > MAX_CLASSIFIERS)
696 nClassifierIndex = SearchFreeClsid(Adapter);
697 if(nClassifierIndex > MAX_CLASSIFIERS)
699 //Failed To get a free Entry
700 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error Failed To get a free Classifier Entry");
701 break;
703 //Copy the Classifier Rule for this service flow into our Classifier table maintained per SF.
704 CopyClassifierRuleToSF(Adapter,psfCSType,uiSearchRuleIndex,nClassifierIndex);
707 else
709 //This Classifier Already Exists and it is invalid to Add Classifier with existing PCRI
710 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"CopyToAdapter : Error The Specified Classifier Already Exists \
711 and attempted To Add Classifier with Same PCRI : 0x%x\n", u16PacketClassificationRuleIndex);
714 break;
716 case eReplaceClassifier:
718 //Get the Classifier Index From Classifier table for this SF and replace existing Classifier
719 //with the new classifier Contained in this message
720 nClassifierIndex = SearchClsid(Adapter,ulSFID,u16PacketClassificationRuleIndex);
721 if(nClassifierIndex > MAX_CLASSIFIERS)
723 //Failed To search the classifier
724 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error Search for Classifier To be replaced failed");
725 break;
727 //Copy the Classifier Rule for this service flow into our Classifier table maintained per SF.
728 CopyClassifierRuleToSF(Adapter,psfCSType,uiSearchRuleIndex,nClassifierIndex);
730 break;
732 case eDeleteClassifier:
734 //Get the Classifier Index From Classifier table for this SF and replace existing Classifier
735 //with the new classifier Contained in this message
736 nClassifierIndex = SearchClsid(Adapter,ulSFID,u16PacketClassificationRuleIndex);
737 if(nClassifierIndex > MAX_CLASSIFIERS)
739 //Failed To search the classifier
740 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error Search for Classifier To be deleted failed");
741 break;
744 //Delete This classifier
745 DeleteClassifierRuleFromSF(Adapter,uiSearchRuleIndex,nClassifierIndex);
747 break;
749 default:
751 //Invalid Action for classifier
752 break;
757 //Repeat parsing Classification Entries to process PHS Rules
758 for(nIndex=0; nIndex < psfLocalSet->u8TotalClassifiers; nIndex++)
760 psfCSType = &psfLocalSet->cConvergenceSLTypes[nIndex];
762 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "psfCSType->u8PhsDSCAction : 0x%x\n",
763 psfCSType->u8PhsDSCAction );
765 switch (psfCSType->u8PhsDSCAction)
767 case eDeleteAllPHSRules:
769 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Deleting All PHS Rules For VCID: 0x%X\n",uVCID);
771 //Delete All the PHS rules for this Service flow
773 PhsDeleteSFRules(
774 &Adapter->stBCMPhsContext,
775 uVCID);
777 break;
779 case eDeletePHSRule:
781 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"PHS DSC Action = Delete PHS Rule \n");
783 if(psfCSType->cPhsRule.u8PHSI)
785 PhsDeletePHSRule(
786 &Adapter->stBCMPhsContext,
787 uVCID,
788 psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
790 else
792 //BCM_DEBUG_PRINT(CONN_MSG,("Error CPHSRule.PHSI is ZERO \n"));
794 break;
796 default :
798 if(ucDsxType == DSC_ACK)
800 //BCM_DEBUG_PRINT(CONN_MSG,("Invalid PHS DSC Action For DSC \n",psfCSType->cPhsRule.u8PHSI));
801 break; //FOr DSC ACK Case PHS DSC Action must be in valid set
804 //Proceed To Add PHS rule for DSA_ACK case even if PHS DSC action is unspecified
805 //No Break Here . Intentionally!
807 case eAddPHSRule:
808 case eSetPHSRule:
810 if(psfCSType->cPhsRule.u8PHSI)
812 //Apply This PHS Rule to all classifiers whose Associated PHSI Match
813 unsigned int uiClassifierIndex = 0;
814 if(pstAddIndication->u8Direction == UPLINK_DIR )
816 for(uiClassifierIndex=0;uiClassifierIndex<MAX_CLASSIFIERS;uiClassifierIndex++)
818 if((Adapter->astClassifierTable[uiClassifierIndex].bUsed) &&
819 (Adapter->astClassifierTable[uiClassifierIndex].ulSFID == Adapter->PackInfo[uiSearchRuleIndex].ulSFID) &&
820 (Adapter->astClassifierTable[uiClassifierIndex].u8AssociatedPHSI == psfCSType->cPhsRule.u8PHSI))
822 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Adding PHS Rule For Classifier : 0x%x cPhsRule.u8PHSI : 0x%x\n",
823 Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex,
824 psfCSType->cPhsRule.u8PHSI);
825 //Update The PHS Rule for this classifier as Associated PHSI id defined
827 //Copy the PHS Rule
828 sPhsRule.u8PHSI = psfCSType->cPhsRule.u8PHSI;
829 sPhsRule.u8PHSFLength = psfCSType->cPhsRule.u8PHSFLength;
830 sPhsRule.u8PHSMLength = psfCSType->cPhsRule.u8PHSMLength;
831 sPhsRule.u8PHSS = psfCSType->cPhsRule.u8PHSS;
832 sPhsRule.u8PHSV = psfCSType->cPhsRule.u8PHSV;
833 memcpy(sPhsRule.u8PHSF,psfCSType->cPhsRule.u8PHSF,MAX_PHS_LENGTHS);
834 memcpy(sPhsRule.u8PHSM,psfCSType->cPhsRule.u8PHSM,MAX_PHS_LENGTHS);
835 sPhsRule.u8RefCnt = 0;
836 sPhsRule.bUnclassifiedPHSRule = FALSE;
837 sPhsRule.PHSModifiedBytes = 0;
838 sPhsRule.PHSModifiedNumPackets = 0;
839 sPhsRule.PHSErrorNumPackets = 0;
841 //bPHSRuleAssociated = TRUE;
842 //Store The PHS Rule for this classifier
844 PhsUpdateClassifierRule(
845 &Adapter->stBCMPhsContext,
846 uVCID,
847 Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex,
848 &sPhsRule,
849 Adapter->astClassifierTable[uiClassifierIndex].u8AssociatedPHSI);
851 //Update PHS Rule For the Classifier
852 if(sPhsRule.u8PHSI)
854 Adapter->astClassifierTable[uiClassifierIndex].u32PHSRuleID = sPhsRule.u8PHSI;
855 memcpy(&Adapter->astClassifierTable[uiClassifierIndex].sPhsRule,&sPhsRule,sizeof(S_PHS_RULE));
861 else
863 //Error PHS Rule specified in signaling could not be applied to any classifier
865 //Copy the PHS Rule
866 sPhsRule.u8PHSI = psfCSType->cPhsRule.u8PHSI;
867 sPhsRule.u8PHSFLength = psfCSType->cPhsRule.u8PHSFLength;
868 sPhsRule.u8PHSMLength = psfCSType->cPhsRule.u8PHSMLength;
869 sPhsRule.u8PHSS = psfCSType->cPhsRule.u8PHSS;
870 sPhsRule.u8PHSV = psfCSType->cPhsRule.u8PHSV;
871 memcpy(sPhsRule.u8PHSF,psfCSType->cPhsRule.u8PHSF,MAX_PHS_LENGTHS);
872 memcpy(sPhsRule.u8PHSM,psfCSType->cPhsRule.u8PHSM,MAX_PHS_LENGTHS);
873 sPhsRule.u8RefCnt = 0;
874 sPhsRule.bUnclassifiedPHSRule = TRUE;
875 sPhsRule.PHSModifiedBytes = 0;
876 sPhsRule.PHSModifiedNumPackets = 0;
877 sPhsRule.PHSErrorNumPackets = 0;
878 //Store The PHS Rule for this classifier
881 Passing the argument u8PHSI instead of clsid. Because for DL with no classifier rule,
882 clsid will be zero hence we can't have multiple PHS rules for the same SF.
883 To support multiple PHS rule, passing u8PHSI.
886 PhsUpdateClassifierRule(
887 &Adapter->stBCMPhsContext,
888 uVCID,
889 sPhsRule.u8PHSI,
890 &sPhsRule,
891 sPhsRule.u8PHSI);
897 break;
901 if(psfLocalSet->u32MaxSustainedTrafficRate == 0 )
903 //No Rate Limit . Set Max Sustained Traffic Rate to Maximum
904 Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate =
905 WIMAX_MAX_ALLOWED_RATE;
908 else if (ntohl(psfLocalSet->u32MaxSustainedTrafficRate) >
909 WIMAX_MAX_ALLOWED_RATE)
911 //Too large Allowed Rate specified. Limiting to Wi Max Allowed rate
912 Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate =
913 WIMAX_MAX_ALLOWED_RATE;
915 else
917 Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate =
918 ntohl(psfLocalSet->u32MaxSustainedTrafficRate);
921 Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency = ntohl(psfLocalSet->u32MaximumLatency);
923 if(Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency == 0) /* 0 should be treated as infinite */
924 Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency = MAX_LATENCY_ALLOWED;
927 if(( Adapter->PackInfo[uiSearchRuleIndex].u8QueueType == ERTPS ||
928 Adapter->PackInfo[uiSearchRuleIndex].u8QueueType == UGS ) )
929 UGIValue = ntohs(psfLocalSet->u16UnsolicitedGrantInterval);
931 if(UGIValue == 0)
932 UGIValue = DEFAULT_UG_INTERVAL;
935 For UGI based connections...
936 DEFAULT_UGI_FACTOR*UGIInterval worth of data is the max token count at host...
937 The extra amount of token is to ensure that a large amount of jitter won't have loss in throughput...
938 In case of non-UGI based connection, 200 frames worth of data is the max token count at host...
941 Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize =
942 (DEFAULT_UGI_FACTOR*Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate*UGIValue)/1000;
944 if(Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize < WIMAX_MAX_MTU*8)
946 UINT UGIFactor = 0;
947 /* Special Handling to ensure the biggest size of packet can go out from host to FW as follows:
948 1. Any packet from Host to FW can go out in different packet size.
949 2. So in case the Bucket count is smaller than MTU, the packets of size (Size > TokenCount), will get dropped.
950 3. We can allow packets of MaxSize from Host->FW that can go out from FW in multiple SDUs by fragmentation at Wimax Layer
952 UGIFactor = (Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency/UGIValue + 1);
954 if(UGIFactor > DEFAULT_UGI_FACTOR)
955 Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize =
956 (UGIFactor*Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate*UGIValue)/1000;
958 if(Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize > WIMAX_MAX_MTU*8)
959 Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize = WIMAX_MAX_MTU*8;
963 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"LAT: %d, UGI: %d \n", Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency, UGIValue);
964 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"uiMaxAllowedRate: 0x%x, u32MaxSustainedTrafficRate: 0x%x ,uiMaxBucketSize: 0x%x",
965 Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate,
966 ntohl(psfLocalSet->u32MaxSustainedTrafficRate),
967 Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize);
969 //copy the extended SF Parameters to Support MIBS
970 CopyMIBSExtendedSFParameters(Adapter,psfLocalSet,uiSearchRuleIndex);
972 //store header suppression enabled flag per SF
973 Adapter->PackInfo[uiSearchRuleIndex].bHeaderSuppressionEnabled =
974 !(psfLocalSet->u8RequesttransmissionPolicy &
975 MASK_DISABLE_HEADER_SUPPRESSION);
977 kfree(Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication);
978 Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication = pstAddIndication;
980 //Re Sort the SF list in PackInfo according to Traffic Priority
981 SortPackInfo(Adapter);
983 /* Re Sort the Classifier Rules table and re - arrange
984 according to Classifier Rule Priority */
985 SortClassifiers(Adapter);
987 DumpPhsRules(&Adapter->stBCMPhsContext);
989 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"%s <=====", __FUNCTION__);
993 /***********************************************************************
994 * Function - DumpCmControlPacket
996 * Description - This routinue Dumps the Contents of the AddIndication
997 * Structure in the Connection Management Control Packet
999 * Parameter - pvBuffer: Pointer to the buffer containing the
1000 * AddIndication data.
1002 * Returns - None
1003 *************************************************************************/
1004 static VOID DumpCmControlPacket(PVOID pvBuffer)
1006 UINT uiLoopIndex;
1007 UINT nIndex;
1008 stLocalSFAddIndicationAlt *pstAddIndication;
1009 UINT nCurClassifierCnt;
1010 PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
1012 pstAddIndication = (stLocalSFAddIndicationAlt *)pvBuffer;
1013 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "======>");
1015 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Type : 0x%X",pstAddIndication->u8Type);
1016 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Direction : 0x%X",pstAddIndication->u8Direction);
1017 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TID: 0x%X", ntohs(pstAddIndication->u16TID));
1018 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",ntohs(pstAddIndication->u16CID));
1019 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VCID : 0x%X",ntohs(pstAddIndication->u16VCID));
1021 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " AuthorizedSet--->");
1023 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID : 0x%X",htonl(pstAddIndication->sfAuthorizedSet.u32SFID));
1024 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",htons(pstAddIndication->sfAuthorizedSet.u16CID));
1025 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength : 0x%X",
1026 pstAddIndication->sfAuthorizedSet.u8ServiceClassNameLength);
1028 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",
1029 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[0],
1030 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[1],
1031 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[2],
1032 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[3],
1033 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[4],
1034 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[5]);
1036 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService : 0x%X",
1037 pstAddIndication->sfAuthorizedSet.u8MBSService);
1038 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet : 0x%X",
1039 pstAddIndication->sfAuthorizedSet.u8QosParamSet);
1040 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority : 0x%X, %p",
1041 pstAddIndication->sfAuthorizedSet.u8TrafficPriority, &pstAddIndication->sfAuthorizedSet.u8TrafficPriority);
1043 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxSustainedTrafficRate : 0x%X 0x%p",
1044 pstAddIndication->sfAuthorizedSet.u32MaxSustainedTrafficRate,
1045 &pstAddIndication->sfAuthorizedSet.u32MaxSustainedTrafficRate);
1047 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst : 0x%X",
1048 pstAddIndication->sfAuthorizedSet.u32MaxTrafficBurst);
1049 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate : 0x%X",
1050 pstAddIndication->sfAuthorizedSet.u32MinReservedTrafficRate);
1051 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength : 0x%X",
1052 pstAddIndication->sfAuthorizedSet.u8VendorSpecificQoSParamLength);
1053 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam : 0x%X",
1054 pstAddIndication->sfAuthorizedSet.u8VendorSpecificQoSParam[0]);
1055 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType : 0x%X",
1056 pstAddIndication->sfAuthorizedSet.u8ServiceFlowSchedulingType);
1057 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter : 0x%X",
1058 pstAddIndication->sfAuthorizedSet.u32ToleratedJitter);
1059 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency : 0x%X",
1060 pstAddIndication->sfAuthorizedSet.u32MaximumLatency);
1061 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%X",
1062 pstAddIndication->sfAuthorizedSet.u8FixedLengthVSVariableLengthSDUIndicator);
1064 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize : 0x%X",
1065 pstAddIndication->sfAuthorizedSet.u8SDUSize);
1066 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TargetSAID : 0x%X",
1067 pstAddIndication->sfAuthorizedSet.u16TargetSAID);
1068 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQEnable : 0x%X",
1069 pstAddIndication->sfAuthorizedSet.u8ARQEnable);
1070 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQWindowSize : 0x%X",
1071 pstAddIndication->sfAuthorizedSet.u16ARQWindowSize);
1072 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryTxTimeOut : 0x%X",
1073 pstAddIndication->sfAuthorizedSet.u16ARQRetryTxTimeOut);
1074 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryRxTimeOut : 0x%X",
1075 pstAddIndication->sfAuthorizedSet.u16ARQRetryRxTimeOut);
1076 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockLifeTime : 0x%X",
1077 pstAddIndication->sfAuthorizedSet.u16ARQBlockLifeTime);
1078 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQSyncLossTimeOut : 0x%X",
1079 pstAddIndication->sfAuthorizedSet.u16ARQSyncLossTimeOut);
1080 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQDeliverInOrder : 0x%X",
1081 pstAddIndication->sfAuthorizedSet.u8ARQDeliverInOrder);
1082 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRxPurgeTimeOut : 0x%X",
1083 pstAddIndication->sfAuthorizedSet.u16ARQRxPurgeTimeOut);
1084 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockSize : 0x%X",
1085 pstAddIndication->sfAuthorizedSet.u16ARQBlockSize);
1086 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8CSSpecification : 0x%X",
1087 pstAddIndication->sfAuthorizedSet.u8CSSpecification);
1088 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TypeOfDataDeliveryService : 0x%X",
1089 pstAddIndication->sfAuthorizedSet.u8TypeOfDataDeliveryService);
1090 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16SDUInterArrivalTime : 0x%X",
1091 pstAddIndication->sfAuthorizedSet.u16SDUInterArrivalTime);
1092 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TimeBase : 0x%X",
1093 pstAddIndication->sfAuthorizedSet.u16TimeBase);
1094 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8PagingPreference : 0x%X",
1095 pstAddIndication->sfAuthorizedSet.u8PagingPreference);
1096 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UnsolicitedPollingInterval : 0x%X",
1097 pstAddIndication->sfAuthorizedSet.u16UnsolicitedPollingInterval);
1099 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "sfAuthorizedSet.u8HARQChannelMapping %x %x %x ",
1100 *(unsigned int*)pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping,
1101 *(unsigned int*)&pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping[4],
1102 *(USHORT*) &pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping[8]);
1103 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficIndicationPreference : 0x%X",
1104 pstAddIndication->sfAuthorizedSet.u8TrafficIndicationPreference);
1106 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Received : 0x%X",pstAddIndication->sfAuthorizedSet.u8TotalClassifiers);
1108 nCurClassifierCnt = pstAddIndication->sfAuthorizedSet.u8TotalClassifiers;
1110 if(nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
1112 nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
1114 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "pstAddIndication->sfAuthorizedSet.bValid %d", pstAddIndication->sfAuthorizedSet.bValid);
1115 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "pstAddIndication->sfAuthorizedSet.u16MacOverhead %x", pstAddIndication->sfAuthorizedSet.u16MacOverhead);
1116 if(!pstAddIndication->sfAuthorizedSet.bValid)
1117 pstAddIndication->sfAuthorizedSet.bValid=1;
1118 for(nIndex = 0 ; nIndex < nCurClassifierCnt ; nIndex++)
1120 stConvergenceSLTypes *psfCSType = NULL;
1121 psfCSType = &pstAddIndication->sfAuthorizedSet.cConvergenceSLTypes[nIndex];
1123 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "psfCSType = %p", psfCSType);
1124 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "CCPacketClassificationRuleSI====>");
1126 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ClassifierRulePriority :0x%X ",
1127 psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
1128 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfServiceLength :0x%X ",
1129 psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
1131 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfService[3] :0x%X ,0x%X ,0x%X ",
1132 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0],
1133 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1],
1134 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]);
1136 for(uiLoopIndex=0; uiLoopIndex < 1; uiLoopIndex++)
1137 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Protocol : 0x%02X ",
1138 psfCSType->cCPacketClassificationRule.u8Protocol);
1140 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength :0x%X ",
1141 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
1143 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1144 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32] : 0x%02X ",
1145 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
1147 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength : 0x%X ",
1148 psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
1150 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1151 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddress[32] : 0x%02X ",
1152 psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
1154 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRangeLength:0x%X ",
1155 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
1156 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRange[4]: 0x%02X ,0x%02X ,0x%02X ,0x%02X ",
1157 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0],
1158 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1],
1159 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2],
1160 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]);
1162 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRangeLength : 0x%02X ",
1163 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength);
1164 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRange[4]: 0x%02X ,0x%02X ,0x%02X ,0x%02X ",
1165 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0],
1166 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1],
1167 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2],
1168 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]);
1170 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddressLength : 0x%02X ",
1171 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1173 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
1174 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0],
1175 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1],
1176 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2],
1177 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3],
1178 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4],
1179 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]);
1181 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddressLength : 0x%02X ",
1182 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1184 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
1185 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0],
1186 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1],
1187 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2],
1188 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3],
1189 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4],
1190 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]);
1192 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthertypeLength : 0x%02X ",
1193 psfCSType->cCPacketClassificationRule.u8EthertypeLength);
1194 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Ethertype[3] : 0x%02X ,0x%02X ,0x%02X ",
1195 psfCSType->cCPacketClassificationRule.u8Ethertype[0],
1196 psfCSType->cCPacketClassificationRule.u8Ethertype[1],
1197 psfCSType->cCPacketClassificationRule.u8Ethertype[2]);
1199 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UserPriority : 0x%X ",
1200 psfCSType->cCPacketClassificationRule.u16UserPriority);
1202 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VLANID : 0x%X ",
1203 psfCSType->cCPacketClassificationRule.u16VLANID);
1205 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8AssociatedPHSI : 0x%02X ",
1206 psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
1208 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16PacketClassificationRuleIndex : 0x%X ",
1209 psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
1211 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParamLength : 0x%X ",
1212 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength);
1214 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParam[1] : 0x%X ",
1215 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]);
1216 #ifdef VERSION_D5
1217 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLableLength :0x%X ",
1218 psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength);
1219 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLable[6] : 0x %02X %02X %02X %02X %02X %02X ",
1220 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0],
1221 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1],
1222 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2],
1223 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3],
1224 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4],
1225 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]);
1226 #endif
1229 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "bValid : 0x%02X",pstAddIndication->sfAuthorizedSet.bValid);
1231 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "AdmittedSet--->");
1232 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID : 0x%X",pstAddIndication->sfAdmittedSet.u32SFID);
1233 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",pstAddIndication->sfAdmittedSet.u16CID);
1234 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength : 0x%X",
1235 pstAddIndication->sfAdmittedSet.u8ServiceClassNameLength);
1236 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassName : 0x %02X %02X %02X %02X %02X %02X",
1237 pstAddIndication->sfAdmittedSet.u8ServiceClassName[0],
1238 pstAddIndication->sfAdmittedSet.u8ServiceClassName[1],
1239 pstAddIndication->sfAdmittedSet.u8ServiceClassName[2],
1240 pstAddIndication->sfAdmittedSet.u8ServiceClassName[3],
1241 pstAddIndication->sfAdmittedSet.u8ServiceClassName[4],
1242 pstAddIndication->sfAdmittedSet.u8ServiceClassName[5]);
1244 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService : 0x%02X",
1245 pstAddIndication->sfAdmittedSet.u8MBSService);
1246 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet : 0x%02X",
1247 pstAddIndication->sfAdmittedSet.u8QosParamSet);
1248 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority : 0x%02X",
1249 pstAddIndication->sfAdmittedSet.u8TrafficPriority);
1250 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst : 0x%X",
1251 pstAddIndication->sfAdmittedSet.u32MaxTrafficBurst);
1252 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate : 0x%X",
1253 pstAddIndication->sfAdmittedSet.u32MinReservedTrafficRate);
1255 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength : 0x%02X",
1256 pstAddIndication->sfAdmittedSet.u8VendorSpecificQoSParamLength);
1257 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam : 0x%02X",
1258 pstAddIndication->sfAdmittedSet.u8VendorSpecificQoSParam[0]);
1259 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType : 0x%02X",
1260 pstAddIndication->sfAdmittedSet.u8ServiceFlowSchedulingType);
1262 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter : 0x%X",
1263 pstAddIndication->sfAdmittedSet.u32ToleratedJitter);
1264 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency : 0x%X",
1265 pstAddIndication->sfAdmittedSet.u32MaximumLatency);
1267 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%02X",
1268 pstAddIndication->sfAdmittedSet.u8FixedLengthVSVariableLengthSDUIndicator);
1269 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize : 0x%02X",
1270 pstAddIndication->sfAdmittedSet.u8SDUSize);
1271 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TargetSAID : 0x%02X",
1272 pstAddIndication->sfAdmittedSet.u16TargetSAID);
1273 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQEnable : 0x%02X",
1274 pstAddIndication->sfAdmittedSet.u8ARQEnable);
1276 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQWindowSize : 0x%X",
1277 pstAddIndication->sfAdmittedSet.u16ARQWindowSize);
1278 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryTxTimeOut : 0x%X",
1279 pstAddIndication->sfAdmittedSet.u16ARQRetryTxTimeOut);
1280 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryRxTimeOut : 0x%X",
1281 pstAddIndication->sfAdmittedSet.u16ARQRetryRxTimeOut);
1282 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockLifeTime : 0x%X",
1283 pstAddIndication->sfAdmittedSet.u16ARQBlockLifeTime);
1284 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQSyncLossTimeOut : 0x%X",
1285 pstAddIndication->sfAdmittedSet.u16ARQSyncLossTimeOut);
1287 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQDeliverInOrder : 0x%02X",
1288 pstAddIndication->sfAdmittedSet.u8ARQDeliverInOrder);
1289 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRxPurgeTimeOut : 0x%X",
1290 pstAddIndication->sfAdmittedSet.u16ARQRxPurgeTimeOut);
1291 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockSize : 0x%X",
1292 pstAddIndication->sfAdmittedSet.u16ARQBlockSize);
1293 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8CSSpecification : 0x%02X",
1294 pstAddIndication->sfAdmittedSet.u8CSSpecification);
1295 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TypeOfDataDeliveryService : 0x%02X",
1296 pstAddIndication->sfAdmittedSet.u8TypeOfDataDeliveryService);
1297 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16SDUInterArrivalTime : 0x%X",
1298 pstAddIndication->sfAdmittedSet.u16SDUInterArrivalTime);
1299 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TimeBase : 0x%X",
1300 pstAddIndication->sfAdmittedSet.u16TimeBase);
1301 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8PagingPreference : 0x%X",
1302 pstAddIndication->sfAdmittedSet.u8PagingPreference);
1305 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficIndicationPreference : 0x%02X",
1306 pstAddIndication->sfAdmittedSet.u8TrafficIndicationPreference);
1308 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Received : 0x%X",pstAddIndication->sfAdmittedSet.u8TotalClassifiers);
1310 nCurClassifierCnt = pstAddIndication->sfAdmittedSet.u8TotalClassifiers;
1312 if(nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
1314 nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
1318 for(nIndex = 0 ; nIndex < nCurClassifierCnt ; nIndex++)
1321 stConvergenceSLTypes *psfCSType = NULL;
1322 psfCSType = &pstAddIndication->sfAdmittedSet.cConvergenceSLTypes[nIndex];
1324 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " CCPacketClassificationRuleSI====>");
1326 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ClassifierRulePriority :0x%02X ",
1327 psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
1328 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfServiceLength :0x%02X",
1329 psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
1331 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfService[3] :0x%02X %02X %02X",
1332 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0],
1333 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1],
1334 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]);
1335 for(uiLoopIndex=0; uiLoopIndex < 1; uiLoopIndex++)
1336 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Protocol: 0x%02X ",
1337 psfCSType->cCPacketClassificationRule.u8Protocol);
1339 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength :0x%02X ",
1340 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
1342 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1343 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32] : 0x%02X ",
1344 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
1346 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength : 0x%02X ",
1347 psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
1349 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1350 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddress[32] : 0x%02X ",
1351 psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
1353 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRangeLength : 0x%02X ",
1354 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
1356 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRange[4] : 0x %02X %02X %02X %02X ",
1357 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0],
1358 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1],
1359 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2],
1360 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]);
1362 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRangeLength : 0x%02X ",
1363 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength);
1365 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRange[4] : 0x %02X %02X %02X %02X ",
1366 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0],
1367 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1],
1368 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2],
1369 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]);
1371 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddressLength : 0x%02X ",
1372 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1374 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
1375 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0],
1376 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1],
1377 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2],
1378 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3],
1379 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4],
1380 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]);
1382 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddressLength : 0x%02X ",
1383 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1385 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
1386 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0],
1387 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1],
1388 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2],
1389 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3],
1390 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4],
1391 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]);
1393 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthertypeLength : 0x%02X ",
1394 psfCSType->cCPacketClassificationRule.u8EthertypeLength);
1395 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Ethertype[3] : 0x%02X %02X %02X",
1396 psfCSType->cCPacketClassificationRule.u8Ethertype[0],
1397 psfCSType->cCPacketClassificationRule.u8Ethertype[1],
1398 psfCSType->cCPacketClassificationRule.u8Ethertype[2]);
1400 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UserPriority : 0x%X ",
1401 psfCSType->cCPacketClassificationRule.u16UserPriority);
1402 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VLANID : 0x%X ",
1403 psfCSType->cCPacketClassificationRule.u16VLANID);
1404 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8AssociatedPHSI : 0x%02X ",
1405 psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
1406 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16PacketClassificationRuleIndex : 0x%X ",
1407 psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
1409 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParamLength : 0x%02X",
1410 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength);
1411 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParam[1] : 0x%02X ",
1412 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]);
1413 #ifdef VERSION_D5
1414 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLableLength : 0x%X ",
1415 psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength);
1416 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLable[6] : 0x %02X %02X %02X %02X %02X %02X ",
1417 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0],
1418 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1],
1419 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2],
1420 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3],
1421 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4],
1422 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]);
1423 #endif
1426 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "bValid : 0x%X",pstAddIndication->sfAdmittedSet.bValid);
1428 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " ActiveSet--->");
1429 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID : 0x%X",pstAddIndication->sfActiveSet.u32SFID);
1430 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",pstAddIndication->sfActiveSet.u16CID);
1432 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength : 0x%X",
1433 pstAddIndication->sfActiveSet.u8ServiceClassNameLength);
1435 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassName : 0x %02X %02X %02X %02X %02X %02X",
1436 pstAddIndication->sfActiveSet.u8ServiceClassName[0],
1437 pstAddIndication->sfActiveSet.u8ServiceClassName[1],
1438 pstAddIndication->sfActiveSet.u8ServiceClassName[2],
1439 pstAddIndication->sfActiveSet.u8ServiceClassName[3],
1440 pstAddIndication->sfActiveSet.u8ServiceClassName[4],
1441 pstAddIndication->sfActiveSet.u8ServiceClassName[5]);
1443 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService : 0x%02X",
1444 pstAddIndication->sfActiveSet.u8MBSService);
1445 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet : 0x%02X",
1446 pstAddIndication->sfActiveSet.u8QosParamSet);
1447 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority : 0x%02X",
1448 pstAddIndication->sfActiveSet.u8TrafficPriority);
1449 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst : 0x%X",
1450 pstAddIndication->sfActiveSet.u32MaxTrafficBurst);
1451 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate : 0x%X",
1452 pstAddIndication->sfActiveSet.u32MinReservedTrafficRate);
1453 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength : 0x%02X",
1454 pstAddIndication->sfActiveSet.u8VendorSpecificQoSParamLength);
1455 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam : 0x%02X",
1456 pstAddIndication->sfActiveSet.u8VendorSpecificQoSParam[0]);
1457 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType : 0x%02X",
1458 pstAddIndication->sfActiveSet.u8ServiceFlowSchedulingType);
1460 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter : 0x%X",
1461 pstAddIndication->sfActiveSet.u32ToleratedJitter);
1462 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency : 0x%X",
1463 pstAddIndication->sfActiveSet.u32MaximumLatency);
1465 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%02X",
1466 pstAddIndication->sfActiveSet.u8FixedLengthVSVariableLengthSDUIndicator);
1468 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize : 0x%X",
1469 pstAddIndication->sfActiveSet.u8SDUSize);
1470 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16TargetSAID : 0x%X",
1471 pstAddIndication->sfActiveSet.u16TargetSAID);
1472 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ARQEnable : 0x%X",
1473 pstAddIndication->sfActiveSet.u8ARQEnable);
1474 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQWindowSize : 0x%X",
1475 pstAddIndication->sfActiveSet.u16ARQWindowSize);
1476 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRetryTxTimeOut : 0x%X",
1477 pstAddIndication->sfActiveSet.u16ARQRetryTxTimeOut);
1478 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRetryRxTimeOut : 0x%X",
1479 pstAddIndication->sfActiveSet.u16ARQRetryRxTimeOut);
1480 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQBlockLifeTime : 0x%X",
1481 pstAddIndication->sfActiveSet.u16ARQBlockLifeTime);
1482 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQSyncLossTimeOut : 0x%X",
1483 pstAddIndication->sfActiveSet.u16ARQSyncLossTimeOut);
1484 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ARQDeliverInOrder : 0x%X",
1485 pstAddIndication->sfActiveSet.u8ARQDeliverInOrder);
1486 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRxPurgeTimeOut : 0x%X",
1487 pstAddIndication->sfActiveSet.u16ARQRxPurgeTimeOut);
1488 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQBlockSize : 0x%X",
1489 pstAddIndication->sfActiveSet.u16ARQBlockSize);
1490 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8CSSpecification : 0x%X",
1491 pstAddIndication->sfActiveSet.u8CSSpecification);
1492 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8TypeOfDataDeliveryService : 0x%X",
1493 pstAddIndication->sfActiveSet.u8TypeOfDataDeliveryService);
1494 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16SDUInterArrivalTime : 0x%X",
1495 pstAddIndication->sfActiveSet.u16SDUInterArrivalTime);
1496 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16TimeBase : 0x%X",
1497 pstAddIndication->sfActiveSet.u16TimeBase);
1498 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8PagingPreference : 0x%X",
1499 pstAddIndication->sfActiveSet.u8PagingPreference);
1502 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8TrafficIndicationPreference : 0x%X",
1503 pstAddIndication->sfActiveSet.u8TrafficIndicationPreference);
1505 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Received : 0x%X",pstAddIndication->sfActiveSet.u8TotalClassifiers);
1507 nCurClassifierCnt = pstAddIndication->sfActiveSet.u8TotalClassifiers;
1509 if(nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
1511 nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
1514 for(nIndex = 0 ; nIndex < nCurClassifierCnt ; nIndex++)
1517 stConvergenceSLTypes *psfCSType = NULL;
1518 psfCSType = &pstAddIndication->sfActiveSet.cConvergenceSLTypes[nIndex];
1521 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " CCPacketClassificationRuleSI====>");
1523 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ClassifierRulePriority :0x%X ",
1524 psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
1525 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPTypeOfServiceLength :0x%X ",
1526 psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
1528 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPTypeOfService[3] :0x%X ,0x%X ,0x%X ",
1529 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0],
1530 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1],
1531 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]);
1532 for(uiLoopIndex=0; uiLoopIndex < 1; uiLoopIndex++)
1533 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8Protocol : 0x%X ",
1534 psfCSType->cCPacketClassificationRule.u8Protocol);
1536 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength :0x%X ",
1537 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
1539 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1540 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32]:0x%X ",
1541 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
1543 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength : 0x%02X ",
1544 psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
1546 for(uiLoopIndex=0;uiLoopIndex<32;uiLoopIndex++)
1547 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPDestinationAddress[32]:0x%X ",
1548 psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
1550 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolSourcePortRangeLength:0x%X ",
1551 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
1553 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolSourcePortRange[4]:0x%X ,0x%X ,0x%X ,0x%X ",
1554 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0],
1555 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1],
1556 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2],
1557 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]);
1559 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolDestPortRangeLength:0x%X ",
1560 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength);
1562 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolDestPortRange[4]:0x%X ,0x%X ,0x%X ,0x%X ",
1563 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0],
1564 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1],
1565 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2],
1566 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]);
1568 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthernetDestMacAddressLength:0x%X ",
1569 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1571 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",
1572 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0],
1573 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1],
1574 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2],
1575 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3],
1576 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4],
1577 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]);
1579 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthernetSourceMACAddressLength:0x%X ",
1580 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1582 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",
1583 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0],
1584 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1],
1585 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2],
1586 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3],
1587 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4],
1588 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]);
1590 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthertypeLength :0x%X ",
1591 psfCSType->cCPacketClassificationRule.u8EthertypeLength);
1592 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8Ethertype[3] :0x%X ,0x%X ,0x%X ",
1593 psfCSType->cCPacketClassificationRule.u8Ethertype[0],
1594 psfCSType->cCPacketClassificationRule.u8Ethertype[1],
1595 psfCSType->cCPacketClassificationRule.u8Ethertype[2]);
1596 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16UserPriority :0x%X ",
1597 psfCSType->cCPacketClassificationRule.u16UserPriority);
1598 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16VLANID :0x%X ",
1599 psfCSType->cCPacketClassificationRule.u16VLANID);
1600 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8AssociatedPHSI :0x%X ",
1601 psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
1602 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16PacketClassificationRuleIndex:0x%X ",
1603 psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
1605 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8VendorSpecificClassifierParamLength:0x%X ",
1606 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength);
1607 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8VendorSpecificClassifierParam[1]:0x%X ",
1608 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]);
1609 #ifdef VERSION_D5
1610 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPv6FlowLableLength :0x%X ",
1611 psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength);
1612 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 ",
1613 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0],
1614 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1],
1615 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2],
1616 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3],
1617 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4],
1618 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]);
1619 #endif
1622 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " bValid : 0x%X",pstAddIndication->sfActiveSet.bValid);
1626 static inline ULONG RestoreSFParam(PMINI_ADAPTER Adapter, ULONG ulAddrSFParamSet,PUCHAR pucDestBuffer)
1628 UINT nBytesToRead = sizeof(stServiceFlowParamSI);
1630 if(ulAddrSFParamSet == 0 || NULL == pucDestBuffer)
1632 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Got Param address as 0!!");
1633 return 0;
1635 ulAddrSFParamSet = ntohl(ulAddrSFParamSet);
1637 //Read out the SF Param Set At the indicated Location
1638 if(rdm(Adapter, ulAddrSFParamSet, (PUCHAR)pucDestBuffer, nBytesToRead) < 0)
1639 return STATUS_FAILURE;
1641 return 1;
1645 static ULONG StoreSFParam(PMINI_ADAPTER Adapter,PUCHAR pucSrcBuffer,ULONG ulAddrSFParamSet)
1647 UINT nBytesToWrite = sizeof(stServiceFlowParamSI);
1648 int ret = 0;
1650 if(ulAddrSFParamSet == 0 || NULL == pucSrcBuffer)
1652 return 0;
1655 ret = wrm(Adapter, ulAddrSFParamSet, (u8 *)pucSrcBuffer, nBytesToWrite);
1656 if (ret < 0) {
1657 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "%s:%d WRM failed",__FUNCTION__, __LINE__);
1658 return ret;
1660 return 1;
1663 ULONG StoreCmControlResponseMessage(PMINI_ADAPTER Adapter,PVOID pvBuffer,UINT *puBufferLength)
1665 stLocalSFAddIndicationAlt *pstAddIndicationAlt = NULL;
1666 stLocalSFAddIndication * pstAddIndication = NULL;
1667 stLocalSFDeleteRequest *pstDeletionRequest;
1668 UINT uiSearchRuleIndex;
1669 ULONG ulSFID;
1671 pstAddIndicationAlt = (stLocalSFAddIndicationAlt *)(pvBuffer);
1674 * In case of DSD Req By MS, we should immediately delete this SF so that
1675 * we can stop the further classifying the pkt for this SF.
1677 if(pstAddIndicationAlt->u8Type == DSD_REQ)
1679 pstDeletionRequest = (stLocalSFDeleteRequest *)pvBuffer;
1681 ulSFID = ntohl(pstDeletionRequest->u32SFID);
1682 uiSearchRuleIndex=SearchSfid(Adapter,ulSFID);
1684 if(uiSearchRuleIndex < NO_OF_QUEUES)
1686 deleteSFBySfid(Adapter,uiSearchRuleIndex);
1687 Adapter->u32TotalDSD++;
1689 return 1;
1693 if( (pstAddIndicationAlt->u8Type == DSD_RSP) ||
1694 (pstAddIndicationAlt->u8Type == DSD_ACK))
1696 //No Special handling send the message as it is
1697 return 1;
1699 // For DSA_REQ, only up to "psfAuthorizedSet" parameter should be accessed by driver!
1701 pstAddIndication=kmalloc(sizeof(*pstAddIndication), GFP_KERNEL);
1702 if(NULL==pstAddIndication)
1703 return 0;
1705 /* AUTHORIZED SET */
1706 pstAddIndication->psfAuthorizedSet = (stServiceFlowParamSI *)
1707 GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID);
1708 if(!pstAddIndication->psfAuthorizedSet)
1709 return 0;
1711 if(StoreSFParam(Adapter,(PUCHAR)&pstAddIndicationAlt->sfAuthorizedSet,
1712 (ULONG)pstAddIndication->psfAuthorizedSet)!= 1)
1713 return 0;
1715 /* this can't possibly be right */
1716 pstAddIndication->psfAuthorizedSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfAuthorizedSet);
1718 if(pstAddIndicationAlt->u8Type == DSA_REQ)
1720 stLocalSFAddRequest AddRequest;
1722 AddRequest.u8Type = pstAddIndicationAlt->u8Type;
1723 AddRequest.eConnectionDir = pstAddIndicationAlt->u8Direction;
1724 AddRequest.u16TID = pstAddIndicationAlt->u16TID;
1725 AddRequest.u16CID = pstAddIndicationAlt->u16CID;
1726 AddRequest.u16VCID = pstAddIndicationAlt->u16VCID;
1727 AddRequest.psfParameterSet =pstAddIndication->psfAuthorizedSet ;
1728 (*puBufferLength) = sizeof(stLocalSFAddRequest);
1729 memcpy(pvBuffer,&AddRequest,sizeof(stLocalSFAddRequest));
1730 return 1;
1733 // Since it's not DSA_REQ, we can access all field in pstAddIndicationAlt
1735 //We need to extract the structure from the buffer and pack it differently
1737 pstAddIndication->u8Type = pstAddIndicationAlt->u8Type;
1738 pstAddIndication->eConnectionDir= pstAddIndicationAlt->u8Direction ;
1739 pstAddIndication->u16TID = pstAddIndicationAlt->u16TID;
1740 pstAddIndication->u16CID = pstAddIndicationAlt->u16CID;
1741 pstAddIndication->u16VCID = pstAddIndicationAlt->u16VCID;
1742 pstAddIndication->u8CC = pstAddIndicationAlt->u8CC;
1744 /* ADMITTED SET */
1745 pstAddIndication->psfAdmittedSet = (stServiceFlowParamSI *)
1746 GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID);
1747 if(!pstAddIndication->psfAdmittedSet)
1748 return 0;
1749 if(StoreSFParam(Adapter,(PUCHAR)&pstAddIndicationAlt->sfAdmittedSet,(ULONG)pstAddIndication->psfAdmittedSet) != 1)
1750 return 0;
1752 pstAddIndication->psfAdmittedSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfAdmittedSet);
1755 /* ACTIVE SET */
1756 pstAddIndication->psfActiveSet = (stServiceFlowParamSI *)
1757 GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID);
1758 if(!pstAddIndication->psfActiveSet)
1759 return 0;
1760 if(StoreSFParam(Adapter,(PUCHAR)&pstAddIndicationAlt->sfActiveSet,(ULONG)pstAddIndication->psfActiveSet) != 1)
1761 return 0;
1763 pstAddIndication->psfActiveSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfActiveSet);
1765 (*puBufferLength) = sizeof(stLocalSFAddIndication);
1766 *(stLocalSFAddIndication *)pvBuffer = *pstAddIndication;
1767 kfree(pstAddIndication);
1768 return 1;
1772 static inline stLocalSFAddIndicationAlt
1773 *RestoreCmControlResponseMessage(register PMINI_ADAPTER Adapter,register PVOID pvBuffer)
1775 ULONG ulStatus=0;
1776 stLocalSFAddIndication *pstAddIndication = NULL;
1777 stLocalSFAddIndicationAlt *pstAddIndicationDest = NULL;
1778 pstAddIndication = (stLocalSFAddIndication *)(pvBuffer);
1780 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "=====>" );
1781 if ((pstAddIndication->u8Type == DSD_REQ) ||
1782 (pstAddIndication->u8Type == DSD_RSP) ||
1783 (pstAddIndication->u8Type == DSD_ACK))
1785 return (stLocalSFAddIndicationAlt *)pvBuffer;
1788 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Inside RestoreCmControlResponseMessage ");
1790 //Need to Allocate memory to contain the SUPER Large structures
1791 //Our driver can't create these structures on Stack :(
1793 pstAddIndicationDest=kmalloc(sizeof(stLocalSFAddIndicationAlt), GFP_KERNEL);
1795 if(pstAddIndicationDest)
1797 memset(pstAddIndicationDest,0,sizeof(stLocalSFAddIndicationAlt));
1799 else
1801 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Failed to allocate memory for SF Add Indication Structure ");
1802 return NULL;
1804 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8Type : 0x%X",pstAddIndication->u8Type);
1805 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8Direction : 0x%X",pstAddIndication->eConnectionDir);
1806 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8TID : 0x%X",ntohs(pstAddIndication->u16TID));
1807 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8CID : 0x%X",ntohs(pstAddIndication->u16CID));
1808 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u16VCID : 0x%X",ntohs(pstAddIndication->u16VCID));
1809 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-autorized set loc : %p",pstAddIndication->psfAuthorizedSet);
1810 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-admitted set loc : %p",pstAddIndication->psfAdmittedSet);
1811 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-Active set loc : %p",pstAddIndication->psfActiveSet);
1813 pstAddIndicationDest->u8Type = pstAddIndication->u8Type;
1814 pstAddIndicationDest->u8Direction = pstAddIndication->eConnectionDir;
1815 pstAddIndicationDest->u16TID = pstAddIndication->u16TID;
1816 pstAddIndicationDest->u16CID = pstAddIndication->u16CID;
1817 pstAddIndicationDest->u16VCID = pstAddIndication->u16VCID;
1818 pstAddIndicationDest->u8CC = pstAddIndication->u8CC;
1820 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Active Set ");
1821 ulStatus=RestoreSFParam(Adapter,(ULONG)pstAddIndication->psfActiveSet, (PUCHAR)&pstAddIndicationDest->sfActiveSet);
1822 if(ulStatus != 1)
1824 goto failed_restore_sf_param;
1826 if(pstAddIndicationDest->sfActiveSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
1827 pstAddIndicationDest->sfActiveSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF;
1829 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Admitted Set ");
1830 ulStatus=RestoreSFParam(Adapter,(ULONG)pstAddIndication->psfAdmittedSet,(PUCHAR)&pstAddIndicationDest->sfAdmittedSet);
1831 if(ulStatus != 1)
1833 goto failed_restore_sf_param;
1835 if(pstAddIndicationDest->sfAdmittedSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
1836 pstAddIndicationDest->sfAdmittedSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF;
1838 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Authorized Set ");
1839 ulStatus=RestoreSFParam(Adapter,(ULONG)pstAddIndication->psfAuthorizedSet,(PUCHAR)&pstAddIndicationDest->sfAuthorizedSet);
1840 if(ulStatus != 1)
1842 goto failed_restore_sf_param;
1844 if(pstAddIndicationDest->sfAuthorizedSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
1845 pstAddIndicationDest->sfAuthorizedSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF;
1847 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Dumping the whole raw packet");
1848 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "============================================================");
1849 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " pstAddIndicationDest->sfActiveSet size %zx %p", sizeof(*pstAddIndicationDest), pstAddIndicationDest);
1850 //BCM_DEBUG_PRINT_BUFFER(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, (unsigned char *)pstAddIndicationDest, sizeof(*pstAddIndicationDest));
1851 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "============================================================");
1852 return pstAddIndicationDest;
1853 failed_restore_sf_param:
1854 kfree(pstAddIndicationDest);
1855 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "<=====" );
1856 return NULL;
1859 ULONG SetUpTargetDsxBuffers(PMINI_ADAPTER Adapter)
1861 ULONG ulTargetDsxBuffersBase = 0;
1862 ULONG ulCntTargetBuffers;
1863 ULONG ulIndex=0;
1864 int Status;
1866 if (!Adapter) {
1867 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Adapter was NULL!!!");
1868 return 0;
1871 if(Adapter->astTargetDsxBuffer[0].ulTargetDsxBuffer)
1872 return 1;
1874 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Size of Each DSX Buffer(Also size of ServiceFlowParamSI): %zx ",sizeof(stServiceFlowParamSI));
1875 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Reading DSX buffer From Target location %x ",DSX_MESSAGE_EXCHANGE_BUFFER);
1877 Status = rdmalt(Adapter, DSX_MESSAGE_EXCHANGE_BUFFER,
1878 (PUINT)&ulTargetDsxBuffersBase, sizeof(UINT));
1879 if(Status < 0)
1881 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "RDM failed!!");
1882 return 0;
1885 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Base Address Of DSX Target Buffer : 0x%lx",ulTargetDsxBuffersBase);
1887 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Tgt Buffer is Now %lx :",ulTargetDsxBuffersBase);
1889 ulCntTargetBuffers = DSX_MESSAGE_EXCHANGE_BUFFER_SIZE/sizeof(stServiceFlowParamSI);
1891 Adapter->ulTotalTargetBuffersAvailable =
1892 ulCntTargetBuffers > MAX_TARGET_DSX_BUFFERS ?
1893 MAX_TARGET_DSX_BUFFERS : ulCntTargetBuffers;
1895 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Total Target DSX Buffer setup %lx ",Adapter->ulTotalTargetBuffersAvailable);
1897 for(ulIndex=0; ulIndex < Adapter->ulTotalTargetBuffersAvailable ; ulIndex++)
1899 Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer = ulTargetDsxBuffersBase;
1900 Adapter->astTargetDsxBuffer[ulIndex].valid=1;
1901 Adapter->astTargetDsxBuffer[ulIndex].tid=0;
1902 ulTargetDsxBuffersBase+=sizeof(stServiceFlowParamSI);
1903 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Target DSX Buffer %lx setup at 0x%lx",
1904 ulIndex, Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer);
1906 Adapter->ulCurrentTargetBuffer = 0;
1907 Adapter->ulFreeTargetBufferCnt = Adapter->ulTotalTargetBuffersAvailable;
1908 return 1;
1911 static ULONG GetNextTargetBufferLocation(PMINI_ADAPTER Adapter,B_UINT16 tid)
1913 ULONG ulTargetDSXBufferAddress;
1914 ULONG ulTargetDsxBufferIndexToUse,ulMaxTry;
1916 if((Adapter->ulTotalTargetBuffersAvailable == 0)||
1917 (Adapter->ulFreeTargetBufferCnt == 0))
1919 ClearTargetDSXBuffer(Adapter,tid,FALSE);
1920 return 0;
1923 ulTargetDsxBufferIndexToUse = Adapter->ulCurrentTargetBuffer;
1924 ulMaxTry = Adapter->ulTotalTargetBuffersAvailable;
1925 while((ulMaxTry)&&(Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].valid != 1))
1927 ulTargetDsxBufferIndexToUse = (ulTargetDsxBufferIndexToUse+1)%
1928 Adapter->ulTotalTargetBuffersAvailable;
1929 ulMaxTry--;
1932 if(ulMaxTry==0)
1934 BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "\n GetNextTargetBufferLocation : Error No Free Target DSX Buffers FreeCnt : %lx ",Adapter->ulFreeTargetBufferCnt);
1935 ClearTargetDSXBuffer(Adapter,tid,FALSE);
1936 return 0;
1940 ulTargetDSXBufferAddress =
1941 Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].ulTargetDsxBuffer;
1942 Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].valid=0;
1943 Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].tid=tid;
1944 Adapter->ulFreeTargetBufferCnt--;
1947 ulTargetDsxBufferIndexToUse =
1948 (ulTargetDsxBufferIndexToUse+1)%Adapter->ulTotalTargetBuffersAvailable;
1949 Adapter->ulCurrentTargetBuffer = ulTargetDsxBufferIndexToUse;
1950 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "GetNextTargetBufferLocation :Returning address %lx tid %d\n",
1951 ulTargetDSXBufferAddress,tid);
1952 return ulTargetDSXBufferAddress;
1956 INT AllocAdapterDsxBuffer(PMINI_ADAPTER Adapter)
1959 //Need to Allocate memory to contain the SUPER Large structures
1960 //Our driver can't create these structures on Stack
1962 Adapter->caDsxReqResp=kmalloc(sizeof(stLocalSFAddIndicationAlt)+LEADER_SIZE, GFP_KERNEL);
1963 if(!Adapter->caDsxReqResp)
1964 return -ENOMEM;
1965 return 0;
1968 INT FreeAdapterDsxBuffer(PMINI_ADAPTER Adapter)
1970 kfree(Adapter->caDsxReqResp);
1971 return 0;
1975 @ingroup ctrl_pkt_functions
1976 This routinue would process the Control responses
1977 for the Connection Management.
1978 @return - Queue index for the free SFID else returns Invalid Index.
1980 BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter, /**<Pointer to the Adapter structure*/
1981 PVOID pvBuffer /**Starting Address of the Buffer, that contains the AddIndication Data*/
1984 stServiceFlowParamSI *psfLocalSet=NULL;
1985 stLocalSFAddIndicationAlt *pstAddIndication = NULL;
1986 stLocalSFChangeIndicationAlt *pstChangeIndication = NULL;
1987 PLEADER pLeader=NULL;
1989 //Otherwise the message contains a target address from where we need to
1990 //read out the rest of the service flow param structure
1992 if((pstAddIndication = RestoreCmControlResponseMessage(Adapter,pvBuffer))
1993 == NULL)
1995 ClearTargetDSXBuffer(Adapter,((stLocalSFAddIndication *)pvBuffer)->u16TID, FALSE);
1996 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "Error in restoring Service Flow param structure from DSx message");
1997 return FALSE;
2000 DumpCmControlPacket(pstAddIndication);
2001 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "====>");
2002 pLeader = (PLEADER)Adapter->caDsxReqResp;
2004 pLeader->Status =CM_CONTROL_NEWDSX_MULTICLASSIFIER_REQ;
2005 pLeader->Vcid = 0;
2007 ClearTargetDSXBuffer(Adapter,pstAddIndication->u16TID,FALSE);
2008 BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "### TID RECEIVED %d\n",pstAddIndication->u16TID);
2009 switch(pstAddIndication->u8Type)
2011 case DSA_REQ:
2013 pLeader->PLength = sizeof(stLocalSFAddIndicationAlt);
2014 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Sending DSA Response....\n");
2015 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSA RESPONSE TO MAC %d", pLeader->PLength );
2016 *((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))
2017 = *pstAddIndication;
2018 ((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSA_RSP;
2020 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " VCID = %x", ntohs(pstAddIndication->u16VCID));
2021 CopyBufferToControlPacket(Adapter,(PVOID)Adapter->caDsxReqResp);
2022 kfree(pstAddIndication);
2024 break;
2025 case DSA_RSP:
2027 pLeader->PLength = sizeof(stLocalSFAddIndicationAlt);
2028 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSA ACK TO MAC %d",
2029 pLeader->PLength);
2030 *((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))
2031 = *pstAddIndication;
2032 ((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSA_ACK;
2034 }//no break here..we should go down.
2035 case DSA_ACK:
2037 UINT uiSearchRuleIndex=0;
2039 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "VCID:0x%X",
2040 ntohs(pstAddIndication->u16VCID));
2041 uiSearchRuleIndex=SearchFreeSfid(Adapter);
2042 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"uiSearchRuleIndex:0x%X ",
2043 uiSearchRuleIndex);
2044 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Direction:0x%X ",
2045 pstAddIndication->u8Direction);
2046 if((uiSearchRuleIndex< NO_OF_QUEUES) )
2048 Adapter->PackInfo[uiSearchRuleIndex].ucDirection =
2049 pstAddIndication->u8Direction;
2050 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "bValid:0x%X ",
2051 pstAddIndication->sfActiveSet.bValid);
2052 if(pstAddIndication->sfActiveSet.bValid==TRUE)
2054 Adapter->PackInfo[uiSearchRuleIndex].bActiveSet=TRUE;
2056 if(pstAddIndication->sfAuthorizedSet.bValid==TRUE)
2058 Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet=TRUE;
2060 if(pstAddIndication->sfAdmittedSet.bValid==TRUE)
2062 Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet=TRUE;
2064 if(FALSE == pstAddIndication->sfActiveSet.bValid)
2066 Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE;
2067 Adapter->PackInfo[uiSearchRuleIndex].bActivateRequestSent = FALSE;
2068 if(pstAddIndication->sfAdmittedSet.bValid)
2070 psfLocalSet = &pstAddIndication->sfAdmittedSet;
2072 else if(pstAddIndication->sfAuthorizedSet.bValid)
2074 psfLocalSet = &pstAddIndication->sfAuthorizedSet;
2077 else
2079 psfLocalSet = &pstAddIndication->sfActiveSet;
2080 Adapter->PackInfo[uiSearchRuleIndex].bActive=TRUE;
2083 if(!psfLocalSet)
2085 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "No set is valid\n");
2086 Adapter->PackInfo[uiSearchRuleIndex].bActive=FALSE;
2087 Adapter->PackInfo[uiSearchRuleIndex].bValid=FALSE;
2088 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value=0;
2089 kfree(pstAddIndication);
2092 else if(psfLocalSet->bValid && (pstAddIndication->u8CC == 0))
2094 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSA ACK");
2095 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value =
2096 ntohs(pstAddIndication->u16VCID);
2097 Adapter->PackInfo[uiSearchRuleIndex].usCID =
2098 ntohs(pstAddIndication->u16CID);
2100 if(UPLINK_DIR == pstAddIndication->u8Direction)
2101 atomic_set(&Adapter->PackInfo[uiSearchRuleIndex].uiPerSFTxResourceCount, DEFAULT_PERSFCOUNT);
2102 CopyToAdapter(Adapter,psfLocalSet,uiSearchRuleIndex,
2103 DSA_ACK, pstAddIndication);
2104 // don't free pstAddIndication
2106 /* Inside CopyToAdapter, Sorting of all the SFs take place.
2107 Hence any access to the newly added SF through uiSearchRuleIndex is invalid.
2108 SHOULD BE STRICTLY AVOIDED.
2110 // *(PULONG)(((PUCHAR)pvBuffer)+1)=psfLocalSet->u32SFID;
2111 memcpy((((PUCHAR)pvBuffer)+1), &psfLocalSet->u32SFID, 4);
2113 if(pstAddIndication->sfActiveSet.bValid == TRUE)
2115 if(UPLINK_DIR == pstAddIndication->u8Direction)
2117 if(!Adapter->LinkUpStatus)
2119 netif_carrier_on(Adapter->dev);
2120 netif_start_queue(Adapter->dev);
2121 Adapter->LinkUpStatus = 1;
2122 if (netif_msg_link(Adapter))
2123 pr_info(PFX "%s: link up\n", Adapter->dev->name);
2124 atomic_set(&Adapter->TxPktAvail, 1);
2125 wake_up(&Adapter->tx_packet_wait_queue);
2126 Adapter->liTimeSinceLastNetEntry = get_seconds();
2132 else
2134 Adapter->PackInfo[uiSearchRuleIndex].bActive=FALSE;
2135 Adapter->PackInfo[uiSearchRuleIndex].bValid=FALSE;
2136 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value=0;
2137 kfree(pstAddIndication);
2140 else
2142 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "DSA ACK did not get valid SFID");
2143 kfree(pstAddIndication);
2144 return FALSE;
2147 break;
2148 case DSC_REQ:
2150 pLeader->PLength = sizeof(stLocalSFChangeIndicationAlt);
2151 pstChangeIndication = (stLocalSFChangeIndicationAlt*)pstAddIndication;
2152 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSC RESPONSE TO MAC %d", pLeader->PLength);
2154 *((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *pstChangeIndication;
2155 ((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSC_RSP;
2157 CopyBufferToControlPacket(Adapter,(PVOID)Adapter->caDsxReqResp);
2158 kfree(pstAddIndication);
2160 break;
2161 case DSC_RSP:
2163 pLeader->PLength = sizeof(stLocalSFChangeIndicationAlt);
2164 pstChangeIndication = (stLocalSFChangeIndicationAlt*)pstAddIndication;
2165 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSC ACK TO MAC %d", pLeader->PLength);
2166 *((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *pstChangeIndication;
2167 ((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSC_ACK;
2169 case DSC_ACK:
2171 UINT uiSearchRuleIndex=0;
2173 pstChangeIndication = (stLocalSFChangeIndicationAlt *)pstAddIndication;
2174 uiSearchRuleIndex=SearchSfid(Adapter,ntohl(pstChangeIndication->sfActiveSet.u32SFID));
2175 if(uiSearchRuleIndex > NO_OF_QUEUES-1)
2177 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "SF doesn't exist for which DSC_ACK is received");
2179 if((uiSearchRuleIndex < NO_OF_QUEUES))
2181 Adapter->PackInfo[uiSearchRuleIndex].ucDirection = pstChangeIndication->u8Direction;
2182 if(pstChangeIndication->sfActiveSet.bValid==TRUE)
2184 Adapter->PackInfo[uiSearchRuleIndex].bActiveSet=TRUE;
2186 if(pstChangeIndication->sfAuthorizedSet.bValid==TRUE)
2188 Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet=TRUE;
2190 if(pstChangeIndication->sfAdmittedSet.bValid==TRUE)
2192 Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet=TRUE;
2195 if(FALSE==pstChangeIndication->sfActiveSet.bValid)
2197 Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE;
2198 Adapter->PackInfo[uiSearchRuleIndex].bActivateRequestSent = FALSE;
2199 if(pstChangeIndication->sfAdmittedSet.bValid)
2201 psfLocalSet = &pstChangeIndication->sfAdmittedSet;
2203 else if(pstChangeIndication->sfAuthorizedSet.bValid)
2205 psfLocalSet = &pstChangeIndication->sfAuthorizedSet;
2209 else
2211 psfLocalSet = &pstChangeIndication->sfActiveSet;
2212 Adapter->PackInfo[uiSearchRuleIndex].bActive=TRUE;
2214 if(psfLocalSet->bValid && (pstChangeIndication->u8CC == 0))
2216 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value =
2217 ntohs(pstChangeIndication->u16VCID);
2218 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "CC field is %d bvalid = %d\n",
2219 pstChangeIndication->u8CC, psfLocalSet->bValid);
2220 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "VCID= %d\n", ntohs(pstChangeIndication->u16VCID));
2221 Adapter->PackInfo[uiSearchRuleIndex].usCID =
2222 ntohs(pstChangeIndication->u16CID);
2223 CopyToAdapter(Adapter,psfLocalSet,uiSearchRuleIndex,
2224 DSC_ACK, pstAddIndication);
2226 *(PULONG)(((PUCHAR)pvBuffer)+1)=psfLocalSet->u32SFID;
2228 else if(pstChangeIndication->u8CC == 6)
2230 deleteSFBySfid(Adapter,uiSearchRuleIndex);
2231 kfree(pstAddIndication);
2234 else
2236 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "DSC ACK did not get valid SFID");
2237 kfree(pstAddIndication);
2238 return FALSE;
2241 break;
2242 case DSD_REQ:
2244 UINT uiSearchRuleIndex;
2245 ULONG ulSFID;
2247 pLeader->PLength = sizeof(stLocalSFDeleteIndication);
2248 *((stLocalSFDeleteIndication*)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *((stLocalSFDeleteIndication*)pstAddIndication);
2250 ulSFID = ntohl(((stLocalSFDeleteIndication*)pstAddIndication)->u32SFID);
2251 uiSearchRuleIndex=SearchSfid(Adapter,ulSFID);
2252 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSD - Removing connection %x",uiSearchRuleIndex);
2254 if(uiSearchRuleIndex < NO_OF_QUEUES)
2256 //Delete All Classifiers Associated with this SFID
2257 deleteSFBySfid(Adapter,uiSearchRuleIndex);
2258 Adapter->u32TotalDSD++;
2261 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSD RESPONSE TO MAC");
2262 ((stLocalSFDeleteIndication*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSD_RSP;
2263 CopyBufferToControlPacket(Adapter,(PVOID)Adapter->caDsxReqResp);
2265 case DSD_RSP:
2267 //Do nothing as SF has already got Deleted
2269 break;
2270 case DSD_ACK:
2271 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSD ACK Rcd, let App handle it\n");
2272 break;
2273 default:
2274 kfree(pstAddIndication);
2275 return FALSE ;
2277 return TRUE;
2280 int get_dsx_sf_data_to_application(PMINI_ADAPTER Adapter, UINT uiSFId, void __user *user_buffer)
2282 int status = 0;
2283 struct _packet_info *psSfInfo=NULL;
2284 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "status =%d",status);
2285 status = SearchSfid(Adapter, uiSFId);
2286 if (status >= NO_OF_QUEUES) {
2287 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SFID %d not present in queue !!!", uiSFId );
2288 return -EINVAL;
2290 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "status =%d",status);
2291 psSfInfo=&Adapter->PackInfo[status];
2292 if(psSfInfo->pstSFIndication && copy_to_user(user_buffer,
2293 psSfInfo->pstSFIndication, sizeof(stLocalSFAddIndicationAlt)))
2295 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "copy to user failed SFID %d, present in queue !!!", uiSFId );
2296 status = -EFAULT;
2297 return status;
2299 return STATUS_SUCCESS;
2302 VOID OverrideServiceFlowParams(PMINI_ADAPTER Adapter,PUINT puiBuffer)
2304 B_UINT32 u32NumofSFsinMsg = ntohl(*(puiBuffer + 1));
2305 stIM_SFHostNotify *pHostInfo = NULL;
2306 UINT uiSearchRuleIndex = 0;
2307 ULONG ulSFID = 0;
2309 puiBuffer+=2;
2311 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "u32NumofSFsinMsg: 0x%x\n",u32NumofSFsinMsg);
2313 while(u32NumofSFsinMsg != 0 && u32NumofSFsinMsg < NO_OF_QUEUES)
2315 u32NumofSFsinMsg--;
2316 pHostInfo = (stIM_SFHostNotify *)puiBuffer;
2317 puiBuffer = (PUINT)(pHostInfo + 1);
2319 ulSFID = ntohl(pHostInfo->SFID);
2320 uiSearchRuleIndex=SearchSfid(Adapter,ulSFID);
2321 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"SFID: 0x%lx\n",ulSFID);
2323 if(uiSearchRuleIndex >= NO_OF_QUEUES || uiSearchRuleIndex == HiPriority)
2325 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);
2326 continue;
2329 if(pHostInfo->RetainSF == FALSE)
2331 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Going to Delete SF");
2332 deleteSFBySfid(Adapter,uiSearchRuleIndex);
2334 else
2337 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = ntohs(pHostInfo->VCID);
2338 Adapter->PackInfo[uiSearchRuleIndex].usCID = ntohs(pHostInfo->newCID);
2339 Adapter->PackInfo[uiSearchRuleIndex].bActive=FALSE;
2341 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"pHostInfo->QoSParamSet: 0x%x\n",pHostInfo->QoSParamSet);
2343 if(pHostInfo->QoSParamSet & 0x1)
2344 Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet =TRUE;
2345 if(pHostInfo->QoSParamSet & 0x2)
2346 Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet =TRUE;
2347 if(pHostInfo->QoSParamSet & 0x4)
2349 Adapter->PackInfo[uiSearchRuleIndex].bActiveSet =TRUE;
2350 Adapter->PackInfo[uiSearchRuleIndex].bActive=TRUE;