beceem: use get_seconds for elapsed time
[linux-2.6/x86.git] / drivers / staging / bcm / CmHost.c
blob949aaa3b31910c85aa01b0c0c5456bc286fa09ac
1 /************************************************************
2 * CMHOST.C
3 * This file contains the routines for handling Connnection
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;
19 /************************************************************
20 * Function - SearchSfid
22 * Description - This routinue would search QOS queues having
23 * specified SFID as input parameter.
25 * Parameters - Adapter: Pointer to the Adapter structure
26 * uiSfid : Given SFID for matching
28 * Returns - Queue index for this SFID(If matched)
29 Else Invalid Queue Index(If Not matched)
30 ************************************************************/
31 INT SearchSfid(PMINI_ADAPTER Adapter,UINT uiSfid)
33 INT iIndex=0;
34 for(iIndex=(NO_OF_QUEUES-1); iIndex>=0; iIndex--)
35 if(Adapter->PackInfo[iIndex].ulSFID==uiSfid)
36 return iIndex;
37 return NO_OF_QUEUES+1;
40 /***************************************************************
41 * Function - SearchFreeSfid
43 * Description - This routinue would search Free available SFID.
45 * Parameter - Adapter: Pointer to the Adapter structure
47 * Returns - Queue index for the free SFID
48 * Else returns Invalid Index.
49 ****************************************************************/
50 static INT SearchFreeSfid(PMINI_ADAPTER Adapter)
52 UINT uiIndex=0;
54 for(uiIndex=0; uiIndex < (NO_OF_QUEUES-1); uiIndex++)
55 if(Adapter->PackInfo[uiIndex].ulSFID==0)
56 return uiIndex;
57 return NO_OF_QUEUES+1;
60 int SearchVcid(PMINI_ADAPTER Adapter,unsigned short usVcid)
62 int iIndex=0;
64 for(iIndex=(NO_OF_QUEUES-1);iIndex>=0;iIndex--)
65 if(Adapter->PackInfo[iIndex].usVCID_Value == usVcid)
66 return iIndex;
67 return NO_OF_QUEUES+1;
73 Function: SearchClsid
74 Description: This routinue would search Classifier having specified ClassifierID as input parameter
75 Input parameters: PMINI_ADAPTER Adapter - Adapter Context
76 unsigned int uiSfid - The SF in which the classifier is to searched
77 B_UINT16 uiClassifierID - The classifier ID to be searched
78 Return: int :Classifier table index of matching entry
81 static int SearchClsid(PMINI_ADAPTER Adapter,ULONG ulSFID,B_UINT16 uiClassifierID)
83 unsigned int uiClassifierIndex = 0;
84 for(uiClassifierIndex=0;uiClassifierIndex<MAX_CLASSIFIERS;uiClassifierIndex++)
86 if((Adapter->astClassifierTable[uiClassifierIndex].bUsed) &&
87 (Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex == uiClassifierID)&&
88 (Adapter->astClassifierTable[uiClassifierIndex].ulSFID == ulSFID))
89 return uiClassifierIndex;
91 return MAX_CLASSIFIERS+1;
94 /**
95 @ingroup ctrl_pkt_functions
96 This routinue would search Free available Classifier entry in classifier table.
97 @return free Classifier Entry index in classifier table for specified SF
99 static int SearchFreeClsid(PMINI_ADAPTER Adapter /**Adapter Context*/
102 unsigned int uiClassifierIndex = 0;
103 for(uiClassifierIndex=0;uiClassifierIndex<MAX_CLASSIFIERS;uiClassifierIndex++)
105 if(!Adapter->astClassifierTable[uiClassifierIndex].bUsed)
106 return uiClassifierIndex;
108 return MAX_CLASSIFIERS+1;
111 VOID deleteSFBySfid(PMINI_ADAPTER Adapter, UINT uiSearchRuleIndex)
113 //deleting all the packet held in the SF
114 flush_queue(Adapter,uiSearchRuleIndex);
116 //Deleting the all classifiers for this SF
117 DeleteAllClassifiersForSF(Adapter,uiSearchRuleIndex);
119 //Resetting only MIBS related entries in the SF
120 memset((PVOID)&Adapter->PackInfo[uiSearchRuleIndex], 0, sizeof(S_MIBS_SERVICEFLOW_TABLE));
123 static inline VOID
124 CopyIpAddrToClassifier(S_CLASSIFIER_RULE *pstClassifierEntry ,
125 B_UINT8 u8IpAddressLen , B_UINT8 *pu8IpAddressMaskSrc ,
126 BOOLEAN bIpVersion6 , E_IPADDR_CONTEXT eIpAddrContext)
128 UINT ucLoopIndex=0;
129 UINT nSizeOfIPAddressInBytes = IP_LENGTH_OF_ADDRESS;
130 UCHAR *ptrClassifierIpAddress = NULL;
131 UCHAR *ptrClassifierIpMask = NULL;
132 PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
134 if(bIpVersion6)
136 nSizeOfIPAddressInBytes = IPV6_ADDRESS_SIZEINBYTES;
138 //Destination Ip Address
139 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Ip Address Range Length:0x%X ",
140 u8IpAddressLen);
141 if((bIpVersion6?(IPV6_ADDRESS_SIZEINBYTES * MAX_IP_RANGE_LENGTH * 2):
142 (TOTAL_MASKED_ADDRESS_IN_BYTES)) >= u8IpAddressLen)
145 //checking both the mask and address togethor in Classification.
146 //So length will be : TotalLengthInBytes/nSizeOfIPAddressInBytes * 2
147 //(nSizeOfIPAddressInBytes for address and nSizeOfIPAddressInBytes for mask)
149 if(eIpAddrContext == eDestIpAddress)
151 pstClassifierEntry->ucIPDestinationAddressLength =
152 u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
153 if(bIpVersion6)
155 ptrClassifierIpAddress =
156 pstClassifierEntry->stDestIpAddress.ucIpv6Address;
157 ptrClassifierIpMask =
158 pstClassifierEntry->stDestIpAddress.ucIpv6Mask;
160 else
162 ptrClassifierIpAddress =
163 pstClassifierEntry->stDestIpAddress.ucIpv4Address;
164 ptrClassifierIpMask =
165 pstClassifierEntry->stDestIpAddress.ucIpv4Mask;
168 else if(eIpAddrContext == eSrcIpAddress)
170 pstClassifierEntry->ucIPSourceAddressLength =
171 u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
172 if(bIpVersion6)
174 ptrClassifierIpAddress =
175 pstClassifierEntry->stSrcIpAddress.ucIpv6Address;
176 ptrClassifierIpMask =
177 pstClassifierEntry->stSrcIpAddress.ucIpv6Mask;
179 else
181 ptrClassifierIpAddress =
182 pstClassifierEntry->stSrcIpAddress.ucIpv4Address;
183 ptrClassifierIpMask =
184 pstClassifierEntry->stSrcIpAddress.ucIpv4Mask;
187 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Address Length:0x%X \n",
188 pstClassifierEntry->ucIPDestinationAddressLength);
189 while((u8IpAddressLen>= nSizeOfIPAddressInBytes) &&
190 (ucLoopIndex < MAX_IP_RANGE_LENGTH))
192 memcpy(ptrClassifierIpAddress +
193 (ucLoopIndex * nSizeOfIPAddressInBytes),
194 (pu8IpAddressMaskSrc+(ucLoopIndex*nSizeOfIPAddressInBytes*2)),
195 nSizeOfIPAddressInBytes);
196 if(!bIpVersion6)
198 if(eIpAddrContext == eSrcIpAddress)
200 pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[ucLoopIndex]=
201 ntohl(pstClassifierEntry->stSrcIpAddress.
202 ulIpv4Addr[ucLoopIndex]);
203 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Src Ip Address:0x%luX ",pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[ucLoopIndex]);
205 else if(eIpAddrContext == eDestIpAddress)
207 pstClassifierEntry->stDestIpAddress.ulIpv4Addr[ucLoopIndex]= ntohl(pstClassifierEntry->stDestIpAddress.
208 ulIpv4Addr[ucLoopIndex]);
209 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Dest Ip Address:0x%luX ",pstClassifierEntry->stDestIpAddress.ulIpv4Addr[ucLoopIndex]);
212 u8IpAddressLen-=nSizeOfIPAddressInBytes;
213 if(u8IpAddressLen >= nSizeOfIPAddressInBytes)
215 memcpy(ptrClassifierIpMask +
216 (ucLoopIndex * nSizeOfIPAddressInBytes),
217 (pu8IpAddressMaskSrc+nSizeOfIPAddressInBytes +
218 (ucLoopIndex*nSizeOfIPAddressInBytes*2)),
219 nSizeOfIPAddressInBytes);
220 if(!bIpVersion6)
222 if(eIpAddrContext == eSrcIpAddress)
224 pstClassifierEntry->stSrcIpAddress.
225 ulIpv4Mask[ucLoopIndex]=
226 ntohl(pstClassifierEntry->stSrcIpAddress.
227 ulIpv4Mask[ucLoopIndex]);
228 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Src Ip Mask Address:0x%luX ",pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[ucLoopIndex]);
230 else if(eIpAddrContext == eDestIpAddress)
232 pstClassifierEntry->stDestIpAddress.
233 ulIpv4Mask[ucLoopIndex] =
234 ntohl(pstClassifierEntry->stDestIpAddress.
235 ulIpv4Mask[ucLoopIndex]);
236 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Dest Ip Mask Address:0x%luX ",pstClassifierEntry->stDestIpAddress.ulIpv4Mask[ucLoopIndex]);
239 u8IpAddressLen-=nSizeOfIPAddressInBytes;
241 if(0==u8IpAddressLen)
243 pstClassifierEntry->bDestIpValid=TRUE;
245 ucLoopIndex++;
247 if(bIpVersion6)
249 //Restore EndianNess of Struct
250 for(ucLoopIndex =0 ; ucLoopIndex < MAX_IP_RANGE_LENGTH * 4 ;
251 ucLoopIndex++)
253 if(eIpAddrContext == eSrcIpAddress)
255 pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[ucLoopIndex]=
256 ntohl(pstClassifierEntry->stSrcIpAddress.
257 ulIpv6Addr[ucLoopIndex]);
258 pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[ucLoopIndex]= ntohl(pstClassifierEntry->stSrcIpAddress.
259 ulIpv6Mask[ucLoopIndex]);
261 else if(eIpAddrContext == eDestIpAddress)
263 pstClassifierEntry->stDestIpAddress.ulIpv6Addr[ucLoopIndex]= ntohl(pstClassifierEntry->stDestIpAddress.
264 ulIpv6Addr[ucLoopIndex]);
265 pstClassifierEntry->stDestIpAddress.ulIpv6Mask[ucLoopIndex]= ntohl(pstClassifierEntry->stDestIpAddress.
266 ulIpv6Mask[ucLoopIndex]);
274 void ClearTargetDSXBuffer(PMINI_ADAPTER Adapter,B_UINT16 TID,BOOLEAN bFreeAll)
276 ULONG ulIndex;
277 for(ulIndex=0; ulIndex < Adapter->ulTotalTargetBuffersAvailable; ulIndex++)
279 if(Adapter->astTargetDsxBuffer[ulIndex].valid)
280 continue;
281 if ((bFreeAll) || (Adapter->astTargetDsxBuffer[ulIndex].tid == TID)){
282 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "ClearTargetDSXBuffer: found tid %d buffer cleared %lx\n",
283 TID, Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer);
284 Adapter->astTargetDsxBuffer[ulIndex].valid=1;
285 Adapter->astTargetDsxBuffer[ulIndex].tid=0;
286 Adapter->ulFreeTargetBufferCnt++;
292 @ingroup ctrl_pkt_functions
293 copy classifier rule into the specified SF index
295 static inline VOID CopyClassifierRuleToSF(PMINI_ADAPTER Adapter,stConvergenceSLTypes *psfCSType,UINT uiSearchRuleIndex,UINT nClassifierIndex)
297 S_CLASSIFIER_RULE *pstClassifierEntry = NULL;
298 //VOID *pvPhsContext = NULL;
299 UINT ucLoopIndex=0;
300 //UCHAR ucProtocolLength=0;
301 //ULONG ulPhsStatus;
304 if(Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value == 0 ||
305 nClassifierIndex > (MAX_CLASSIFIERS-1))
306 return;
309 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Storing Classifier Rule Index : %X",ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex));
311 if(nClassifierIndex > MAX_CLASSIFIERS-1)
312 return;
314 pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
315 if(pstClassifierEntry)
317 //Store if Ipv6
318 pstClassifierEntry->bIpv6Protocol =
319 (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6)?TRUE:FALSE;
321 //Destinaiton Port
322 pstClassifierEntry->ucDestPortRangeLength=psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength/4;
323 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Destination Port Range Length:0x%X ",pstClassifierEntry->ucDestPortRangeLength);
324 if( MAX_PORT_RANGE >= psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength)
326 for(ucLoopIndex=0;ucLoopIndex<(pstClassifierEntry->ucDestPortRangeLength);ucLoopIndex++)
328 pstClassifierEntry->usDestPortRangeLo[ucLoopIndex] =
329 *((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+ucLoopIndex));
330 pstClassifierEntry->usDestPortRangeHi[ucLoopIndex] =
331 *((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+2+ucLoopIndex));
332 pstClassifierEntry->usDestPortRangeLo[ucLoopIndex]=ntohs(pstClassifierEntry->usDestPortRangeLo[ucLoopIndex]);
333 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Destination Port Range Lo:0x%X ",pstClassifierEntry->usDestPortRangeLo[ucLoopIndex]);
334 pstClassifierEntry->usDestPortRangeHi[ucLoopIndex]=ntohs(pstClassifierEntry->usDestPortRangeHi[ucLoopIndex]);
337 else
339 pstClassifierEntry->ucDestPortRangeLength=0;
341 //Source Port
342 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Source Port Range Length:0x%X ",psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
343 if(MAX_PORT_RANGE >=
344 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength)
346 pstClassifierEntry->ucSrcPortRangeLength =
347 psfCSType->cCPacketClassificationRule.
348 u8ProtocolSourcePortRangeLength/4;
349 for(ucLoopIndex = 0; ucLoopIndex <
350 (pstClassifierEntry->ucSrcPortRangeLength); ucLoopIndex++)
352 pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex] =
353 *((PUSHORT)(psfCSType->cCPacketClassificationRule.
354 u8ProtocolSourcePortRange+ucLoopIndex));
355 pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex] =
356 *((PUSHORT)(psfCSType->cCPacketClassificationRule.
357 u8ProtocolSourcePortRange+2+ucLoopIndex));
358 pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex] =
359 ntohs(pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex]);
360 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Source Port Range Lo:0x%X ",pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex]);
361 pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex]=ntohs(pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex]);
364 //Destination Ip Address and Mask
365 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Ip Destination Parameters : ");
367 CopyIpAddrToClassifier(pstClassifierEntry,
368 psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength,
369 psfCSType->cCPacketClassificationRule.u8IPDestinationAddress,
370 (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6)?
371 TRUE:FALSE, eDestIpAddress);
373 //Source Ip Address and Mask
374 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Ip Source Parameters : ");
376 CopyIpAddrToClassifier(pstClassifierEntry,
377 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength,
378 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress,
379 (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6)?TRUE:FALSE,
380 eSrcIpAddress);
382 //TOS
383 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"TOS Length:0x%X ",psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
384 if(3 == psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength)
386 pstClassifierEntry->ucIPTypeOfServiceLength =
387 psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength;
388 pstClassifierEntry->ucTosLow =
389 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0];
390 pstClassifierEntry->ucTosHigh =
391 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1];
392 pstClassifierEntry->ucTosMask =
393 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2];
394 pstClassifierEntry->bTOSValid = TRUE;
396 if(psfCSType->cCPacketClassificationRule.u8Protocol == 0)
398 //we didnt get protocol field filled in by the BS
399 pstClassifierEntry->ucProtocolLength=0;
401 else
403 pstClassifierEntry->ucProtocolLength=1;// 1 valid protocol
406 pstClassifierEntry->ucProtocol[0] =
407 psfCSType->cCPacketClassificationRule.u8Protocol;
409 pstClassifierEntry->u8ClassifierRulePriority =
410 psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority;
412 //store the classifier rule ID and set this classifier entry as valid
413 pstClassifierEntry->ucDirection =
414 Adapter->PackInfo[uiSearchRuleIndex].ucDirection;
415 pstClassifierEntry->uiClassifierRuleIndex = ntohs(psfCSType->
416 cCPacketClassificationRule.u16PacketClassificationRuleIndex);
417 pstClassifierEntry->usVCID_Value =
418 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
419 pstClassifierEntry->ulSFID =
420 Adapter->PackInfo[uiSearchRuleIndex].ulSFID;
421 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Search Index %d Dir: %d, Index: %d, Vcid: %d\n",
422 uiSearchRuleIndex, pstClassifierEntry->ucDirection,
423 pstClassifierEntry->uiClassifierRuleIndex,
424 pstClassifierEntry->usVCID_Value);
426 if(psfCSType->cCPacketClassificationRule.u8AssociatedPHSI)
428 pstClassifierEntry->u8AssociatedPHSI = psfCSType->cCPacketClassificationRule.u8AssociatedPHSI;
431 //Copy ETH CS Parameters
432 pstClassifierEntry->ucEthCSSrcMACLen = (psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddressLength);
433 memcpy(pstClassifierEntry->au8EThCSSrcMAC,psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress,MAC_ADDRESS_SIZE);
434 memcpy(pstClassifierEntry->au8EThCSSrcMACMask,psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress+MAC_ADDRESS_SIZE,MAC_ADDRESS_SIZE);
435 pstClassifierEntry->ucEthCSDestMACLen = (psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
436 memcpy(pstClassifierEntry->au8EThCSDestMAC,psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress,MAC_ADDRESS_SIZE);
437 memcpy(pstClassifierEntry->au8EThCSDestMACMask,psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress+MAC_ADDRESS_SIZE,MAC_ADDRESS_SIZE);
438 pstClassifierEntry->ucEtherTypeLen = (psfCSType->cCPacketClassificationRule.u8EthertypeLength);
439 memcpy(pstClassifierEntry->au8EthCSEtherType,psfCSType->cCPacketClassificationRule.u8Ethertype,NUM_ETHERTYPE_BYTES);
440 memcpy(pstClassifierEntry->usUserPriority, &psfCSType->cCPacketClassificationRule.u16UserPriority, 2);
441 pstClassifierEntry->usVLANID = ntohs(psfCSType->cCPacketClassificationRule.u16VLANID);
442 pstClassifierEntry->usValidityBitMap = ntohs(psfCSType->cCPacketClassificationRule.u16ValidityBitMap);
444 pstClassifierEntry->bUsed = TRUE;
450 @ingroup ctrl_pkt_functions
452 static inline VOID DeleteClassifierRuleFromSF(PMINI_ADAPTER Adapter,UINT uiSearchRuleIndex,UINT nClassifierIndex)
454 S_CLASSIFIER_RULE *pstClassifierEntry = NULL;
455 B_UINT16 u16PacketClassificationRuleIndex;
456 USHORT usVCID;
457 //VOID *pvPhsContext = NULL;
458 //ULONG ulPhsStatus;
460 usVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
462 if(nClassifierIndex > MAX_CLASSIFIERS-1)
463 return;
465 if(usVCID == 0)
466 return;
468 u16PacketClassificationRuleIndex = Adapter->astClassifierTable[nClassifierIndex].uiClassifierRuleIndex;
471 pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
472 if(pstClassifierEntry)
474 pstClassifierEntry->bUsed = FALSE;
475 pstClassifierEntry->uiClassifierRuleIndex = 0;
476 memset(pstClassifierEntry,0,sizeof(S_CLASSIFIER_RULE));
478 //Delete the PHS Rule for this classifier
479 PhsDeleteClassifierRule(
480 &Adapter->stBCMPhsContext,
481 usVCID,
482 u16PacketClassificationRuleIndex);
487 @ingroup ctrl_pkt_functions
489 VOID DeleteAllClassifiersForSF(PMINI_ADAPTER Adapter,UINT uiSearchRuleIndex)
491 S_CLASSIFIER_RULE *pstClassifierEntry = NULL;
492 UINT nClassifierIndex;
493 //B_UINT16 u16PacketClassificationRuleIndex;
494 USHORT ulVCID;
495 //VOID *pvPhsContext = NULL;
496 //ULONG ulPhsStatus;
498 ulVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
500 if(ulVCID == 0)
501 return;
504 for(nClassifierIndex =0 ; nClassifierIndex < MAX_CLASSIFIERS ; nClassifierIndex++)
506 if(Adapter->astClassifierTable[nClassifierIndex].usVCID_Value == ulVCID)
508 pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
509 if(pstClassifierEntry->bUsed)
511 DeleteClassifierRuleFromSF(Adapter,uiSearchRuleIndex,nClassifierIndex);
516 //Delete All Phs Rules Associated with this SF
517 PhsDeleteSFRules(
518 &Adapter->stBCMPhsContext,
519 ulVCID);
525 This routinue copies the Connection Management
526 related data into the Adapter structure.
527 @ingroup ctrl_pkt_functions
530 static VOID CopyToAdapter( register PMINI_ADAPTER Adapter, /**<Pointer to the Adapter structure*/
531 register pstServiceFlowParamSI psfLocalSet, /**<Pointer to the ServiceFlowParamSI structure*/
532 register UINT uiSearchRuleIndex, /**<Index of Queue, to which this data belongs*/
533 register UCHAR ucDsxType,
534 stLocalSFAddIndicationAlt *pstAddIndication)
536 //UCHAR ucProtocolLength=0;
537 ULONG ulSFID;
538 UINT nClassifierIndex = 0;
539 E_CLASSIFIER_ACTION eClassifierAction = eInvalidClassifierAction;
540 B_UINT16 u16PacketClassificationRuleIndex=0;
541 UINT nIndex=0;
542 stConvergenceSLTypes *psfCSType = NULL;
543 S_PHS_RULE sPhsRule;
544 USHORT uVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
545 UINT UGIValue = 0;
548 Adapter->PackInfo[uiSearchRuleIndex].bValid=TRUE;
549 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Search Rule Index = %d\n", uiSearchRuleIndex);
550 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"%s: SFID= %x ",__FUNCTION__, ntohl(psfLocalSet->u32SFID));
551 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Updating Queue %d",uiSearchRuleIndex);
553 ulSFID = ntohl(psfLocalSet->u32SFID);
554 //Store IP Version used
555 //Get The Version Of IP used (IPv6 or IPv4) from CSSpecification field of SF
557 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = 0;
558 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 0;
560 /*Enable IP/ETh CS Support As Required*/
561 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"CopyToAdapter : u8CSSpecification : %X\n",psfLocalSet->u8CSSpecification);
562 switch(psfLocalSet->u8CSSpecification)
564 case eCSPacketIPV4:
566 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
567 break;
569 case eCSPacketIPV6:
571 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV6_CS;
572 break;
575 case eCS802_3PacketEthernet:
576 case eCS802_1QPacketVLAN:
578 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3;
579 break;
582 case eCSPacketIPV4Over802_1QVLAN:
583 case eCSPacketIPV4Over802_3Ethernet:
585 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
586 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3;
587 break;
590 case eCSPacketIPV6Over802_1QVLAN:
591 case eCSPacketIPV6Over802_3Ethernet:
593 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV6_CS;
594 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3;
595 break;
598 default:
600 BCM_DEBUG_PRINT (Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error in value of CS Classification.. setting default to IP CS\n");
601 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
602 break;
606 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",
607 uiSearchRuleIndex,
608 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport,
609 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport);
611 //Store IP Version used
612 //Get The Version Of IP used (IPv6 or IPv4) from CSSpecification field of SF
613 if(Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport == IPV6_CS)
615 Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion = IPV6;
617 else
619 Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion = IPV4;
622 /* To ensure that the ETH CS code doesn't gets executed if the BS doesn't supports ETH CS */
623 if(!Adapter->bETHCSEnabled)
624 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 0;
626 if(psfLocalSet->u8ServiceClassNameLength > 0 &&
627 psfLocalSet->u8ServiceClassNameLength < 32)
629 memcpy(Adapter->PackInfo[uiSearchRuleIndex].ucServiceClassName,
630 psfLocalSet->u8ServiceClassName,
631 psfLocalSet->u8ServiceClassNameLength);
633 Adapter->PackInfo[uiSearchRuleIndex].u8QueueType =
634 psfLocalSet->u8ServiceFlowSchedulingType;
636 if(Adapter->PackInfo[uiSearchRuleIndex].u8QueueType==BE &&
637 Adapter->PackInfo[uiSearchRuleIndex].ucDirection)
639 Adapter->usBestEffortQueueIndex=uiSearchRuleIndex;
642 Adapter->PackInfo[uiSearchRuleIndex].ulSFID = ntohl(psfLocalSet->u32SFID);
644 Adapter->PackInfo[uiSearchRuleIndex].u8TrafficPriority = psfLocalSet->u8TrafficPriority;
646 //copy all the classifier in the Service Flow param structure
647 for(nIndex=0; nIndex<psfLocalSet->u8TotalClassifiers; nIndex++)
649 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Classifier index =%d",nIndex);
650 psfCSType = &psfLocalSet->cConvergenceSLTypes[nIndex];
651 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Classifier index =%d",nIndex);
653 if(psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority)
655 Adapter->PackInfo[uiSearchRuleIndex].bClassifierPriority=TRUE;
658 if(psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority)
660 Adapter->PackInfo[uiSearchRuleIndex].bClassifierPriority=TRUE;
664 if(ucDsxType== DSA_ACK)
666 eClassifierAction = eAddClassifier;
668 else if(ucDsxType == DSC_ACK)
670 switch(psfCSType->u8ClassfierDSCAction)
672 case 0://DSC Add Classifier
674 eClassifierAction = eAddClassifier;
676 break;
677 case 1://DSC Replace Classifier
679 eClassifierAction = eReplaceClassifier;
681 break;
682 case 2://DSC Delete Classifier
684 eClassifierAction = eDeleteClassifier;
687 break;
688 default:
690 eClassifierAction = eInvalidClassifierAction;
695 u16PacketClassificationRuleIndex = ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
697 switch(eClassifierAction)
699 case eAddClassifier:
701 //Get a Free Classifier Index From Classifier table for this SF to add the Classifier
702 //Contained in this message
703 nClassifierIndex = SearchClsid(Adapter,ulSFID,u16PacketClassificationRuleIndex);
705 if(nClassifierIndex > MAX_CLASSIFIERS)
707 nClassifierIndex = SearchFreeClsid(Adapter);
708 if(nClassifierIndex > MAX_CLASSIFIERS)
710 //Failed To get a free Entry
711 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error Failed To get a free Classifier Entry");
712 break;
714 //Copy the Classifier Rule for this service flow into our Classifier table maintained per SF.
715 CopyClassifierRuleToSF(Adapter,psfCSType,uiSearchRuleIndex,nClassifierIndex);
718 else
720 //This Classifier Already Exists and it is invalid to Add Classifier with existing PCRI
721 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"CopyToAdapter : Error The Specified Classifier Already Exists \
722 and attempted To Add Classifier with Same PCRI : 0x%x\n", u16PacketClassificationRuleIndex);
725 break;
727 case eReplaceClassifier:
729 //Get the Classifier Index From Classifier table for this SF and replace existing Classifier
730 //with the new classifier Contained in this message
731 nClassifierIndex = SearchClsid(Adapter,ulSFID,u16PacketClassificationRuleIndex);
732 if(nClassifierIndex > MAX_CLASSIFIERS)
734 //Failed To search the classifier
735 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error Search for Classifier To be replaced failed");
736 break;
738 //Copy the Classifier Rule for this service flow into our Classifier table maintained per SF.
739 CopyClassifierRuleToSF(Adapter,psfCSType,uiSearchRuleIndex,nClassifierIndex);
741 break;
743 case eDeleteClassifier:
745 //Get the Classifier Index From Classifier table for this SF and replace existing Classifier
746 //with the new classifier Contained in this message
747 nClassifierIndex = SearchClsid(Adapter,ulSFID,u16PacketClassificationRuleIndex);
748 if(nClassifierIndex > MAX_CLASSIFIERS)
750 //Failed To search the classifier
751 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error Search for Classifier To be deleted failed");
752 break;
755 //Delete This classifier
756 DeleteClassifierRuleFromSF(Adapter,uiSearchRuleIndex,nClassifierIndex);
758 break;
760 default:
762 //Invalid Action for classifier
763 break;
768 //Repeat parsing Classification Entries to process PHS Rules
769 for(nIndex=0; nIndex < psfLocalSet->u8TotalClassifiers; nIndex++)
771 psfCSType = &psfLocalSet->cConvergenceSLTypes[nIndex];
773 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "psfCSType->u8PhsDSCAction : 0x%x\n",
774 psfCSType->u8PhsDSCAction );
776 switch (psfCSType->u8PhsDSCAction)
778 case eDeleteAllPHSRules:
780 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Deleting All PHS Rules For VCID: 0x%X\n",uVCID);
782 //Delete All the PHS rules for this Service flow
784 PhsDeleteSFRules(
785 &Adapter->stBCMPhsContext,
786 uVCID);
788 break;
790 case eDeletePHSRule:
792 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"PHS DSC Action = Delete PHS Rule \n");
794 if(psfCSType->cPhsRule.u8PHSI)
796 PhsDeletePHSRule(
797 &Adapter->stBCMPhsContext,
798 uVCID,
799 psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
801 else
803 //BCM_DEBUG_PRINT(CONN_MSG,("Error CPHSRule.PHSI is ZERO \n"));
805 break;
807 default :
809 if(ucDsxType == DSC_ACK)
811 //BCM_DEBUG_PRINT(CONN_MSG,("Invalid PHS DSC Action For DSC \n",psfCSType->cPhsRule.u8PHSI));
812 break; //FOr DSC ACK Case PHS DSC Action must be in valid set
815 //Proceed To Add PHS rule for DSA_ACK case even if PHS DSC action is unspecified
816 //No Break Here . Intentionally!
818 case eAddPHSRule:
819 case eSetPHSRule:
821 if(psfCSType->cPhsRule.u8PHSI)
823 //Apply This PHS Rule to all classifiers whose Associated PHSI Match
824 unsigned int uiClassifierIndex = 0;
825 if(pstAddIndication->u8Direction == UPLINK_DIR )
827 for(uiClassifierIndex=0;uiClassifierIndex<MAX_CLASSIFIERS;uiClassifierIndex++)
829 if((Adapter->astClassifierTable[uiClassifierIndex].bUsed) &&
830 (Adapter->astClassifierTable[uiClassifierIndex].ulSFID == Adapter->PackInfo[uiSearchRuleIndex].ulSFID) &&
831 (Adapter->astClassifierTable[uiClassifierIndex].u8AssociatedPHSI == psfCSType->cPhsRule.u8PHSI))
833 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Adding PHS Rule For Classifier : 0x%x cPhsRule.u8PHSI : 0x%x\n",
834 Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex,
835 psfCSType->cPhsRule.u8PHSI);
836 //Update The PHS Rule for this classifier as Associated PHSI id defined
838 //Copy the PHS Rule
839 sPhsRule.u8PHSI = psfCSType->cPhsRule.u8PHSI;
840 sPhsRule.u8PHSFLength = psfCSType->cPhsRule.u8PHSFLength;
841 sPhsRule.u8PHSMLength = psfCSType->cPhsRule.u8PHSMLength;
842 sPhsRule.u8PHSS = psfCSType->cPhsRule.u8PHSS;
843 sPhsRule.u8PHSV = psfCSType->cPhsRule.u8PHSV;
844 memcpy(sPhsRule.u8PHSF,psfCSType->cPhsRule.u8PHSF,MAX_PHS_LENGTHS);
845 memcpy(sPhsRule.u8PHSM,psfCSType->cPhsRule.u8PHSM,MAX_PHS_LENGTHS);
846 sPhsRule.u8RefCnt = 0;
847 sPhsRule.bUnclassifiedPHSRule = FALSE;
848 sPhsRule.PHSModifiedBytes = 0;
849 sPhsRule.PHSModifiedNumPackets = 0;
850 sPhsRule.PHSErrorNumPackets = 0;
852 //bPHSRuleAssociated = TRUE;
853 //Store The PHS Rule for this classifier
855 PhsUpdateClassifierRule(
856 &Adapter->stBCMPhsContext,
857 uVCID,
858 Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex,
859 &sPhsRule,
860 Adapter->astClassifierTable[uiClassifierIndex].u8AssociatedPHSI);
862 //Update PHS Rule For the Classifier
863 if(sPhsRule.u8PHSI)
865 Adapter->astClassifierTable[uiClassifierIndex].u32PHSRuleID = sPhsRule.u8PHSI;
866 memcpy(&Adapter->astClassifierTable[uiClassifierIndex].sPhsRule,&sPhsRule,sizeof(S_PHS_RULE));
872 else
874 //Error PHS Rule specified in signaling could not be applied to any classifier
876 //Copy the PHS Rule
877 sPhsRule.u8PHSI = psfCSType->cPhsRule.u8PHSI;
878 sPhsRule.u8PHSFLength = psfCSType->cPhsRule.u8PHSFLength;
879 sPhsRule.u8PHSMLength = psfCSType->cPhsRule.u8PHSMLength;
880 sPhsRule.u8PHSS = psfCSType->cPhsRule.u8PHSS;
881 sPhsRule.u8PHSV = psfCSType->cPhsRule.u8PHSV;
882 memcpy(sPhsRule.u8PHSF,psfCSType->cPhsRule.u8PHSF,MAX_PHS_LENGTHS);
883 memcpy(sPhsRule.u8PHSM,psfCSType->cPhsRule.u8PHSM,MAX_PHS_LENGTHS);
884 sPhsRule.u8RefCnt = 0;
885 sPhsRule.bUnclassifiedPHSRule = TRUE;
886 sPhsRule.PHSModifiedBytes = 0;
887 sPhsRule.PHSModifiedNumPackets = 0;
888 sPhsRule.PHSErrorNumPackets = 0;
889 //Store The PHS Rule for this classifier
892 Passing the argument u8PHSI instead of clsid. Because for DL with no classifier rule,
893 clsid will be zero hence we cant have multiple PHS rules for the same SF.
894 To support multiple PHS rule, passing u8PHSI.
897 PhsUpdateClassifierRule(
898 &Adapter->stBCMPhsContext,
899 uVCID,
900 sPhsRule.u8PHSI,
901 &sPhsRule,
902 sPhsRule.u8PHSI);
908 break;
912 if(psfLocalSet->u32MaxSustainedTrafficRate == 0 )
914 //No Rate Limit . Set Max Sustained Traffic Rate to Maximum
915 Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate =
916 WIMAX_MAX_ALLOWED_RATE;
919 else if (ntohl(psfLocalSet->u32MaxSustainedTrafficRate) >
920 WIMAX_MAX_ALLOWED_RATE)
922 //Too large Allowed Rate specified. Limiting to Wi Max Allowed rate
923 Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate =
924 WIMAX_MAX_ALLOWED_RATE;
926 else
928 Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate =
929 ntohl(psfLocalSet->u32MaxSustainedTrafficRate);
932 Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency = ntohl(psfLocalSet->u32MaximumLatency);
934 if(Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency == 0) /* 0 should be treated as infinite */
935 Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency = MAX_LATENCY_ALLOWED;
938 if(( Adapter->PackInfo[uiSearchRuleIndex].u8QueueType == ERTPS ||
939 Adapter->PackInfo[uiSearchRuleIndex].u8QueueType == UGS ) )
940 UGIValue = ntohs(psfLocalSet->u16UnsolicitedGrantInterval);
942 if(UGIValue == 0)
943 UGIValue = DEFAULT_UG_INTERVAL;
946 For UGI based connections...
947 DEFAULT_UGI_FACTOR*UGIInterval worth of data is the max token count at host...
948 The extra amount of token is to ensure that a large amount of jitter won't have loss in throughput...
949 In case of non-UGI based connection, 200 frames worth of data is the max token count at host...
952 Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize =
953 (DEFAULT_UGI_FACTOR*Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate*UGIValue)/1000;
955 if(Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize < WIMAX_MAX_MTU*8)
957 UINT UGIFactor = 0;
958 /* Special Handling to ensure the biggest size of packet can go out from host to FW as follows:
959 1. Any packet from Host to FW can go out in different packet size.
960 2. So in case the Bucket count is smaller than MTU, the packets of size (Size > TokenCount), will get dropped.
961 3. We can allow packets of MaxSize from Host->FW that can go out from FW in multiple SDUs by fragmentation at Wimax Layer
963 UGIFactor = (Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency/UGIValue + 1);
965 if(UGIFactor > DEFAULT_UGI_FACTOR)
966 Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize =
967 (UGIFactor*Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate*UGIValue)/1000;
969 if(Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize > WIMAX_MAX_MTU*8)
970 Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize = WIMAX_MAX_MTU*8;
974 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"LAT: %d, UGI: %d \n", Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency, UGIValue);
975 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"uiMaxAllowedRate: 0x%x, u32MaxSustainedTrafficRate: 0x%x ,uiMaxBucketSize: 0x%x",
976 Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate,
977 ntohl(psfLocalSet->u32MaxSustainedTrafficRate),
978 Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize);
980 //copy the extended SF Parameters to Support MIBS
981 CopyMIBSExtendedSFParameters(Adapter,psfLocalSet,uiSearchRuleIndex);
983 //store header suppression enabled flag per SF
984 Adapter->PackInfo[uiSearchRuleIndex].bHeaderSuppressionEnabled =
985 !(psfLocalSet->u8RequesttransmissionPolicy &
986 MASK_DISABLE_HEADER_SUPPRESSION);
988 if(Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication)
990 kfree(Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication);
991 Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication = NULL;
993 Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication = pstAddIndication;
995 //Re Sort the SF list in PackInfo according to Traffic Priority
996 SortPackInfo(Adapter);
998 /* Re Sort the Classifier Rules table and re - arrange
999 according to Classifier Rule Priority */
1000 SortClassifiers(Adapter);
1002 DumpPhsRules(&Adapter->stBCMPhsContext);
1004 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"%s <=====", __FUNCTION__);
1008 /***********************************************************************
1009 * Function - DumpCmControlPacket
1011 * Description - This routinue Dumps the Contents of the AddIndication
1012 * Structure in the Connection Management Control Packet
1014 * Parameter - pvBuffer: Pointer to the buffer containing the
1015 * AddIndication data.
1017 * Returns - None
1018 *************************************************************************/
1019 static VOID DumpCmControlPacket(PVOID pvBuffer)
1021 UINT uiLoopIndex;
1022 UINT nIndex;
1023 stLocalSFAddIndicationAlt *pstAddIndication;
1024 UINT nCurClassifierCnt;
1025 PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
1027 pstAddIndication = (stLocalSFAddIndicationAlt *)pvBuffer;
1028 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "======>");
1030 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Type : 0x%X",pstAddIndication->u8Type);
1031 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Direction : 0x%X",pstAddIndication->u8Direction);
1032 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TID: 0x%X", ntohs(pstAddIndication->u16TID));
1033 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",ntohs(pstAddIndication->u16CID));
1034 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VCID : 0x%X",ntohs(pstAddIndication->u16VCID));
1036 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " AuthorizedSet--->");
1038 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID : 0x%X",htonl(pstAddIndication->sfAuthorizedSet.u32SFID));
1039 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",htons(pstAddIndication->sfAuthorizedSet.u16CID));
1040 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength : 0x%X",
1041 pstAddIndication->sfAuthorizedSet.u8ServiceClassNameLength);
1043 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",
1044 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[0],
1045 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[1],
1046 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[2],
1047 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[3],
1048 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[4],
1049 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[5]);
1051 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService : 0x%X",
1052 pstAddIndication->sfAuthorizedSet.u8MBSService);
1053 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet : 0x%X",
1054 pstAddIndication->sfAuthorizedSet.u8QosParamSet);
1055 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority : 0x%X, %p",
1056 pstAddIndication->sfAuthorizedSet.u8TrafficPriority, &pstAddIndication->sfAuthorizedSet.u8TrafficPriority);
1058 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxSustainedTrafficRate : 0x%X 0x%p",
1059 pstAddIndication->sfAuthorizedSet.u32MaxSustainedTrafficRate,
1060 &pstAddIndication->sfAuthorizedSet.u32MaxSustainedTrafficRate);
1062 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst : 0x%X",
1063 pstAddIndication->sfAuthorizedSet.u32MaxTrafficBurst);
1064 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate : 0x%X",
1065 pstAddIndication->sfAuthorizedSet.u32MinReservedTrafficRate);
1066 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength : 0x%X",
1067 pstAddIndication->sfAuthorizedSet.u8VendorSpecificQoSParamLength);
1068 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam : 0x%X",
1069 pstAddIndication->sfAuthorizedSet.u8VendorSpecificQoSParam[0]);
1070 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType : 0x%X",
1071 pstAddIndication->sfAuthorizedSet.u8ServiceFlowSchedulingType);
1072 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter : 0x%X",
1073 pstAddIndication->sfAuthorizedSet.u32ToleratedJitter);
1074 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency : 0x%X",
1075 pstAddIndication->sfAuthorizedSet.u32MaximumLatency);
1076 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%X",
1077 pstAddIndication->sfAuthorizedSet.u8FixedLengthVSVariableLengthSDUIndicator);
1079 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize : 0x%X",
1080 pstAddIndication->sfAuthorizedSet.u8SDUSize);
1081 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TargetSAID : 0x%X",
1082 pstAddIndication->sfAuthorizedSet.u16TargetSAID);
1083 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQEnable : 0x%X",
1084 pstAddIndication->sfAuthorizedSet.u8ARQEnable);
1085 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQWindowSize : 0x%X",
1086 pstAddIndication->sfAuthorizedSet.u16ARQWindowSize);
1087 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryTxTimeOut : 0x%X",
1088 pstAddIndication->sfAuthorizedSet.u16ARQRetryTxTimeOut);
1089 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryRxTimeOut : 0x%X",
1090 pstAddIndication->sfAuthorizedSet.u16ARQRetryRxTimeOut);
1091 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockLifeTime : 0x%X",
1092 pstAddIndication->sfAuthorizedSet.u16ARQBlockLifeTime);
1093 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQSyncLossTimeOut : 0x%X",
1094 pstAddIndication->sfAuthorizedSet.u16ARQSyncLossTimeOut);
1095 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQDeliverInOrder : 0x%X",
1096 pstAddIndication->sfAuthorizedSet.u8ARQDeliverInOrder);
1097 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRxPurgeTimeOut : 0x%X",
1098 pstAddIndication->sfAuthorizedSet.u16ARQRxPurgeTimeOut);
1099 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockSize : 0x%X",
1100 pstAddIndication->sfAuthorizedSet.u16ARQBlockSize);
1101 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8CSSpecification : 0x%X",
1102 pstAddIndication->sfAuthorizedSet.u8CSSpecification);
1103 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TypeOfDataDeliveryService : 0x%X",
1104 pstAddIndication->sfAuthorizedSet.u8TypeOfDataDeliveryService);
1105 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16SDUInterArrivalTime : 0x%X",
1106 pstAddIndication->sfAuthorizedSet.u16SDUInterArrivalTime);
1107 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TimeBase : 0x%X",
1108 pstAddIndication->sfAuthorizedSet.u16TimeBase);
1109 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8PagingPreference : 0x%X",
1110 pstAddIndication->sfAuthorizedSet.u8PagingPreference);
1111 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UnsolicitedPollingInterval : 0x%X",
1112 pstAddIndication->sfAuthorizedSet.u16UnsolicitedPollingInterval);
1114 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "sfAuthorizedSet.u8HARQChannelMapping %x %x %x ",
1115 *(unsigned int*)pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping,
1116 *(unsigned int*)&pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping[4],
1117 *(USHORT*) &pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping[8]);
1118 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficIndicationPreference : 0x%X",
1119 pstAddIndication->sfAuthorizedSet.u8TrafficIndicationPreference);
1121 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Recieved : 0x%X",pstAddIndication->sfAuthorizedSet.u8TotalClassifiers);
1123 nCurClassifierCnt = pstAddIndication->sfAuthorizedSet.u8TotalClassifiers;
1125 if(nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
1127 nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
1129 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "pstAddIndication->sfAuthorizedSet.bValid %d", pstAddIndication->sfAuthorizedSet.bValid);
1130 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "pstAddIndication->sfAuthorizedSet.u16MacOverhead %x", pstAddIndication->sfAuthorizedSet.u16MacOverhead);
1131 if(!pstAddIndication->sfAuthorizedSet.bValid)
1132 pstAddIndication->sfAuthorizedSet.bValid=1;
1133 for(nIndex = 0 ; nIndex < nCurClassifierCnt ; nIndex++)
1135 stConvergenceSLTypes *psfCSType = NULL;
1136 psfCSType = &pstAddIndication->sfAuthorizedSet.cConvergenceSLTypes[nIndex];
1138 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "psfCSType = %p", psfCSType);
1139 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "CCPacketClassificationRuleSI====>");
1141 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ClassifierRulePriority :0x%X ",
1142 psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
1143 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfServiceLength :0x%X ",
1144 psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
1146 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfService[3] :0x%X ,0x%X ,0x%X ",
1147 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0],
1148 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1],
1149 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]);
1151 for(uiLoopIndex=0; uiLoopIndex < 1; uiLoopIndex++)
1152 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Protocol : 0x%02X ",
1153 psfCSType->cCPacketClassificationRule.u8Protocol);
1155 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength :0x%X ",
1156 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
1158 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1159 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32] : 0x%02X ",
1160 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
1162 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength : 0x%X ",
1163 psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
1165 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1166 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddress[32] : 0x%02X ",
1167 psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
1169 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRangeLength:0x%X ",
1170 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
1171 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRange[4]: 0x%02X ,0x%02X ,0x%02X ,0x%02X ",
1172 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0],
1173 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1],
1174 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2],
1175 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]);
1177 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRangeLength : 0x%02X ",
1178 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength);
1179 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRange[4]: 0x%02X ,0x%02X ,0x%02X ,0x%02X ",
1180 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0],
1181 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1],
1182 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2],
1183 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]);
1185 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddressLength : 0x%02X ",
1186 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1188 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
1189 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0],
1190 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1],
1191 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2],
1192 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3],
1193 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4],
1194 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]);
1196 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddressLength : 0x%02X ",
1197 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1199 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
1200 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0],
1201 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1],
1202 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2],
1203 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3],
1204 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4],
1205 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]);
1207 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthertypeLength : 0x%02X ",
1208 psfCSType->cCPacketClassificationRule.u8EthertypeLength);
1209 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Ethertype[3] : 0x%02X ,0x%02X ,0x%02X ",
1210 psfCSType->cCPacketClassificationRule.u8Ethertype[0],
1211 psfCSType->cCPacketClassificationRule.u8Ethertype[1],
1212 psfCSType->cCPacketClassificationRule.u8Ethertype[2]);
1214 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UserPriority : 0x%X ",
1215 psfCSType->cCPacketClassificationRule.u16UserPriority);
1217 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VLANID : 0x%X ",
1218 psfCSType->cCPacketClassificationRule.u16VLANID);
1220 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8AssociatedPHSI : 0x%02X ",
1221 psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
1223 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16PacketClassificationRuleIndex : 0x%X ",
1224 psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
1226 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParamLength : 0x%X ",
1227 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength);
1229 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParam[1] : 0x%X ",
1230 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]);
1231 #ifdef VERSION_D5
1232 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLableLength :0x%X ",
1233 psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength);
1234 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLable[6] : 0x %02X %02X %02X %02X %02X %02X ",
1235 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0],
1236 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1],
1237 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2],
1238 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3],
1239 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4],
1240 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]);
1241 #endif
1244 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "bValid : 0x%02X",pstAddIndication->sfAuthorizedSet.bValid);
1246 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "AdmittedSet--->");
1247 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID : 0x%X",pstAddIndication->sfAdmittedSet.u32SFID);
1248 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",pstAddIndication->sfAdmittedSet.u16CID);
1249 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength : 0x%X",
1250 pstAddIndication->sfAdmittedSet.u8ServiceClassNameLength);
1251 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassName : 0x %02X %02X %02X %02X %02X %02X",
1252 pstAddIndication->sfAdmittedSet.u8ServiceClassName[0],
1253 pstAddIndication->sfAdmittedSet.u8ServiceClassName[1],
1254 pstAddIndication->sfAdmittedSet.u8ServiceClassName[2],
1255 pstAddIndication->sfAdmittedSet.u8ServiceClassName[3],
1256 pstAddIndication->sfAdmittedSet.u8ServiceClassName[4],
1257 pstAddIndication->sfAdmittedSet.u8ServiceClassName[5]);
1259 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService : 0x%02X",
1260 pstAddIndication->sfAdmittedSet.u8MBSService);
1261 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet : 0x%02X",
1262 pstAddIndication->sfAdmittedSet.u8QosParamSet);
1263 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority : 0x%02X",
1264 pstAddIndication->sfAdmittedSet.u8TrafficPriority);
1265 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst : 0x%X",
1266 pstAddIndication->sfAdmittedSet.u32MaxTrafficBurst);
1267 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate : 0x%X",
1268 pstAddIndication->sfAdmittedSet.u32MinReservedTrafficRate);
1270 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength : 0x%02X",
1271 pstAddIndication->sfAdmittedSet.u8VendorSpecificQoSParamLength);
1272 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam : 0x%02X",
1273 pstAddIndication->sfAdmittedSet.u8VendorSpecificQoSParam[0]);
1274 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType : 0x%02X",
1275 pstAddIndication->sfAdmittedSet.u8ServiceFlowSchedulingType);
1277 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter : 0x%X",
1278 pstAddIndication->sfAdmittedSet.u32ToleratedJitter);
1279 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency : 0x%X",
1280 pstAddIndication->sfAdmittedSet.u32MaximumLatency);
1282 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%02X",
1283 pstAddIndication->sfAdmittedSet.u8FixedLengthVSVariableLengthSDUIndicator);
1284 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize : 0x%02X",
1285 pstAddIndication->sfAdmittedSet.u8SDUSize);
1286 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TargetSAID : 0x%02X",
1287 pstAddIndication->sfAdmittedSet.u16TargetSAID);
1288 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQEnable : 0x%02X",
1289 pstAddIndication->sfAdmittedSet.u8ARQEnable);
1291 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQWindowSize : 0x%X",
1292 pstAddIndication->sfAdmittedSet.u16ARQWindowSize);
1293 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryTxTimeOut : 0x%X",
1294 pstAddIndication->sfAdmittedSet.u16ARQRetryTxTimeOut);
1295 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryRxTimeOut : 0x%X",
1296 pstAddIndication->sfAdmittedSet.u16ARQRetryRxTimeOut);
1297 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockLifeTime : 0x%X",
1298 pstAddIndication->sfAdmittedSet.u16ARQBlockLifeTime);
1299 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQSyncLossTimeOut : 0x%X",
1300 pstAddIndication->sfAdmittedSet.u16ARQSyncLossTimeOut);
1302 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQDeliverInOrder : 0x%02X",
1303 pstAddIndication->sfAdmittedSet.u8ARQDeliverInOrder);
1304 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRxPurgeTimeOut : 0x%X",
1305 pstAddIndication->sfAdmittedSet.u16ARQRxPurgeTimeOut);
1306 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockSize : 0x%X",
1307 pstAddIndication->sfAdmittedSet.u16ARQBlockSize);
1308 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8CSSpecification : 0x%02X",
1309 pstAddIndication->sfAdmittedSet.u8CSSpecification);
1310 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TypeOfDataDeliveryService : 0x%02X",
1311 pstAddIndication->sfAdmittedSet.u8TypeOfDataDeliveryService);
1312 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16SDUInterArrivalTime : 0x%X",
1313 pstAddIndication->sfAdmittedSet.u16SDUInterArrivalTime);
1314 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TimeBase : 0x%X",
1315 pstAddIndication->sfAdmittedSet.u16TimeBase);
1316 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8PagingPreference : 0x%X",
1317 pstAddIndication->sfAdmittedSet.u8PagingPreference);
1320 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficIndicationPreference : 0x%02X",
1321 pstAddIndication->sfAdmittedSet.u8TrafficIndicationPreference);
1323 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Recieved : 0x%X",pstAddIndication->sfAdmittedSet.u8TotalClassifiers);
1325 nCurClassifierCnt = pstAddIndication->sfAdmittedSet.u8TotalClassifiers;
1327 if(nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
1329 nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
1333 for(nIndex = 0 ; nIndex < nCurClassifierCnt ; nIndex++)
1336 stConvergenceSLTypes *psfCSType = NULL;
1337 psfCSType = &pstAddIndication->sfAdmittedSet.cConvergenceSLTypes[nIndex];
1339 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " CCPacketClassificationRuleSI====>");
1341 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ClassifierRulePriority :0x%02X ",
1342 psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
1343 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfServiceLength :0x%02X",
1344 psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
1346 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfService[3] :0x%02X %02X %02X",
1347 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0],
1348 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1],
1349 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]);
1350 for(uiLoopIndex=0; uiLoopIndex < 1; uiLoopIndex++)
1351 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Protocol: 0x%02X ",
1352 psfCSType->cCPacketClassificationRule.u8Protocol);
1354 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength :0x%02X ",
1355 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
1357 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1358 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32] : 0x%02X ",
1359 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
1361 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength : 0x%02X ",
1362 psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
1364 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1365 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddress[32] : 0x%02X ",
1366 psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
1368 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRangeLength : 0x%02X ",
1369 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
1371 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRange[4] : 0x %02X %02X %02X %02X ",
1372 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0],
1373 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1],
1374 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2],
1375 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]);
1377 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRangeLength : 0x%02X ",
1378 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength);
1380 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRange[4] : 0x %02X %02X %02X %02X ",
1381 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0],
1382 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1],
1383 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2],
1384 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]);
1386 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddressLength : 0x%02X ",
1387 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1389 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
1390 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0],
1391 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1],
1392 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2],
1393 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3],
1394 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4],
1395 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]);
1397 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddressLength : 0x%02X ",
1398 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1400 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
1401 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0],
1402 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1],
1403 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2],
1404 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3],
1405 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4],
1406 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]);
1408 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthertypeLength : 0x%02X ",
1409 psfCSType->cCPacketClassificationRule.u8EthertypeLength);
1410 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Ethertype[3] : 0x%02X %02X %02X",
1411 psfCSType->cCPacketClassificationRule.u8Ethertype[0],
1412 psfCSType->cCPacketClassificationRule.u8Ethertype[1],
1413 psfCSType->cCPacketClassificationRule.u8Ethertype[2]);
1415 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UserPriority : 0x%X ",
1416 psfCSType->cCPacketClassificationRule.u16UserPriority);
1417 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VLANID : 0x%X ",
1418 psfCSType->cCPacketClassificationRule.u16VLANID);
1419 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8AssociatedPHSI : 0x%02X ",
1420 psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
1421 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16PacketClassificationRuleIndex : 0x%X ",
1422 psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
1424 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParamLength : 0x%02X",
1425 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength);
1426 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParam[1] : 0x%02X ",
1427 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]);
1428 #ifdef VERSION_D5
1429 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLableLength : 0x%X ",
1430 psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength);
1431 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLable[6] : 0x %02X %02X %02X %02X %02X %02X ",
1432 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0],
1433 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1],
1434 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2],
1435 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3],
1436 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4],
1437 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]);
1438 #endif
1441 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "bValid : 0x%X",pstAddIndication->sfAdmittedSet.bValid);
1443 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " ActiveSet--->");
1444 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID : 0x%X",pstAddIndication->sfActiveSet.u32SFID);
1445 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",pstAddIndication->sfActiveSet.u16CID);
1447 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength : 0x%X",
1448 pstAddIndication->sfActiveSet.u8ServiceClassNameLength);
1450 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassName : 0x %02X %02X %02X %02X %02X %02X",
1451 pstAddIndication->sfActiveSet.u8ServiceClassName[0],
1452 pstAddIndication->sfActiveSet.u8ServiceClassName[1],
1453 pstAddIndication->sfActiveSet.u8ServiceClassName[2],
1454 pstAddIndication->sfActiveSet.u8ServiceClassName[3],
1455 pstAddIndication->sfActiveSet.u8ServiceClassName[4],
1456 pstAddIndication->sfActiveSet.u8ServiceClassName[5]);
1458 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService : 0x%02X",
1459 pstAddIndication->sfActiveSet.u8MBSService);
1460 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet : 0x%02X",
1461 pstAddIndication->sfActiveSet.u8QosParamSet);
1462 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority : 0x%02X",
1463 pstAddIndication->sfActiveSet.u8TrafficPriority);
1464 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst : 0x%X",
1465 pstAddIndication->sfActiveSet.u32MaxTrafficBurst);
1466 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate : 0x%X",
1467 pstAddIndication->sfActiveSet.u32MinReservedTrafficRate);
1468 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength : 0x%02X",
1469 pstAddIndication->sfActiveSet.u8VendorSpecificQoSParamLength);
1470 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam : 0x%02X",
1471 pstAddIndication->sfActiveSet.u8VendorSpecificQoSParam[0]);
1472 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType : 0x%02X",
1473 pstAddIndication->sfActiveSet.u8ServiceFlowSchedulingType);
1475 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter : 0x%X",
1476 pstAddIndication->sfActiveSet.u32ToleratedJitter);
1477 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency : 0x%X",
1478 pstAddIndication->sfActiveSet.u32MaximumLatency);
1480 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%02X",
1481 pstAddIndication->sfActiveSet.u8FixedLengthVSVariableLengthSDUIndicator);
1483 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize : 0x%X",
1484 pstAddIndication->sfActiveSet.u8SDUSize);
1485 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16TargetSAID : 0x%X",
1486 pstAddIndication->sfActiveSet.u16TargetSAID);
1487 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ARQEnable : 0x%X",
1488 pstAddIndication->sfActiveSet.u8ARQEnable);
1489 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQWindowSize : 0x%X",
1490 pstAddIndication->sfActiveSet.u16ARQWindowSize);
1491 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRetryTxTimeOut : 0x%X",
1492 pstAddIndication->sfActiveSet.u16ARQRetryTxTimeOut);
1493 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRetryRxTimeOut : 0x%X",
1494 pstAddIndication->sfActiveSet.u16ARQRetryRxTimeOut);
1495 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQBlockLifeTime : 0x%X",
1496 pstAddIndication->sfActiveSet.u16ARQBlockLifeTime);
1497 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQSyncLossTimeOut : 0x%X",
1498 pstAddIndication->sfActiveSet.u16ARQSyncLossTimeOut);
1499 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ARQDeliverInOrder : 0x%X",
1500 pstAddIndication->sfActiveSet.u8ARQDeliverInOrder);
1501 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRxPurgeTimeOut : 0x%X",
1502 pstAddIndication->sfActiveSet.u16ARQRxPurgeTimeOut);
1503 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQBlockSize : 0x%X",
1504 pstAddIndication->sfActiveSet.u16ARQBlockSize);
1505 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8CSSpecification : 0x%X",
1506 pstAddIndication->sfActiveSet.u8CSSpecification);
1507 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8TypeOfDataDeliveryService : 0x%X",
1508 pstAddIndication->sfActiveSet.u8TypeOfDataDeliveryService);
1509 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16SDUInterArrivalTime : 0x%X",
1510 pstAddIndication->sfActiveSet.u16SDUInterArrivalTime);
1511 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16TimeBase : 0x%X",
1512 pstAddIndication->sfActiveSet.u16TimeBase);
1513 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8PagingPreference : 0x%X",
1514 pstAddIndication->sfActiveSet.u8PagingPreference);
1517 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8TrafficIndicationPreference : 0x%X",
1518 pstAddIndication->sfActiveSet.u8TrafficIndicationPreference);
1520 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Recieved : 0x%X",pstAddIndication->sfActiveSet.u8TotalClassifiers);
1522 nCurClassifierCnt = pstAddIndication->sfActiveSet.u8TotalClassifiers;
1524 if(nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
1526 nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
1529 for(nIndex = 0 ; nIndex < nCurClassifierCnt ; nIndex++)
1532 stConvergenceSLTypes *psfCSType = NULL;
1533 psfCSType = &pstAddIndication->sfActiveSet.cConvergenceSLTypes[nIndex];
1536 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " CCPacketClassificationRuleSI====>");
1538 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ClassifierRulePriority :0x%X ",
1539 psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
1540 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPTypeOfServiceLength :0x%X ",
1541 psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
1543 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPTypeOfService[3] :0x%X ,0x%X ,0x%X ",
1544 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0],
1545 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1],
1546 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]);
1547 for(uiLoopIndex=0; uiLoopIndex < 1; uiLoopIndex++)
1548 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8Protocol : 0x%X ",
1549 psfCSType->cCPacketClassificationRule.u8Protocol);
1551 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength :0x%X ",
1552 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
1554 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1555 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32]:0x%X ",
1556 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
1558 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength : 0x%02X ",
1559 psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
1561 for(uiLoopIndex=0;uiLoopIndex<32;uiLoopIndex++)
1562 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPDestinationAddress[32]:0x%X ",
1563 psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
1565 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolSourcePortRangeLength:0x%X ",
1566 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
1568 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolSourcePortRange[4]:0x%X ,0x%X ,0x%X ,0x%X ",
1569 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0],
1570 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1],
1571 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2],
1572 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]);
1574 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolDestPortRangeLength:0x%X ",
1575 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength);
1577 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolDestPortRange[4]:0x%X ,0x%X ,0x%X ,0x%X ",
1578 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0],
1579 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1],
1580 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2],
1581 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]);
1583 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthernetDestMacAddressLength:0x%X ",
1584 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1586 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",
1587 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0],
1588 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1],
1589 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2],
1590 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3],
1591 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4],
1592 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]);
1594 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthernetSourceMACAddressLength:0x%X ",
1595 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1597 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",
1598 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0],
1599 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1],
1600 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2],
1601 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3],
1602 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4],
1603 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]);
1605 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthertypeLength :0x%X ",
1606 psfCSType->cCPacketClassificationRule.u8EthertypeLength);
1607 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8Ethertype[3] :0x%X ,0x%X ,0x%X ",
1608 psfCSType->cCPacketClassificationRule.u8Ethertype[0],
1609 psfCSType->cCPacketClassificationRule.u8Ethertype[1],
1610 psfCSType->cCPacketClassificationRule.u8Ethertype[2]);
1611 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16UserPriority :0x%X ",
1612 psfCSType->cCPacketClassificationRule.u16UserPriority);
1613 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16VLANID :0x%X ",
1614 psfCSType->cCPacketClassificationRule.u16VLANID);
1615 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8AssociatedPHSI :0x%X ",
1616 psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
1617 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16PacketClassificationRuleIndex:0x%X ",
1618 psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
1620 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8VendorSpecificClassifierParamLength:0x%X ",
1621 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength);
1622 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8VendorSpecificClassifierParam[1]:0x%X ",
1623 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]);
1624 #ifdef VERSION_D5
1625 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPv6FlowLableLength :0x%X ",
1626 psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength);
1627 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 ",
1628 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0],
1629 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1],
1630 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2],
1631 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3],
1632 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4],
1633 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]);
1634 #endif
1637 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " bValid : 0x%X",pstAddIndication->sfActiveSet.bValid);
1641 static inline ULONG RestoreSFParam(PMINI_ADAPTER Adapter, ULONG ulAddrSFParamSet,PUCHAR pucDestBuffer)
1643 UINT nBytesToRead = sizeof(stServiceFlowParamSI);
1645 if(ulAddrSFParamSet == 0 || NULL == pucDestBuffer)
1647 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Got Param address as 0!!");
1648 return 0;
1650 ulAddrSFParamSet = ntohl(ulAddrSFParamSet);
1652 //Read out the SF Param Set At the indicated Location
1653 if(rdm(Adapter, ulAddrSFParamSet, (PUCHAR)pucDestBuffer, nBytesToRead) < 0)
1654 return STATUS_FAILURE;
1656 return 1;
1660 static ULONG StoreSFParam(PMINI_ADAPTER Adapter,PUCHAR pucSrcBuffer,ULONG ulAddrSFParamSet)
1662 UINT nBytesToWrite = sizeof(stServiceFlowParamSI);
1663 UINT uiRetVal =0;
1665 if(ulAddrSFParamSet == 0 || NULL == pucSrcBuffer)
1667 return 0;
1670 uiRetVal = wrm(Adapter,ulAddrSFParamSet,(PUCHAR)pucSrcBuffer, nBytesToWrite);
1671 if(uiRetVal < 0) {
1672 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "%s:%d WRM failed",__FUNCTION__, __LINE__);
1673 return uiRetVal;
1675 return 1;
1678 ULONG StoreCmControlResponseMessage(PMINI_ADAPTER Adapter,PVOID pvBuffer,UINT *puBufferLength)
1680 stLocalSFAddIndicationAlt *pstAddIndicationAlt = NULL;
1681 stLocalSFAddIndication * pstAddIndication = NULL;
1682 stLocalSFDeleteRequest *pstDeletionRequest;
1683 UINT uiSearchRuleIndex;
1684 ULONG ulSFID;
1686 pstAddIndicationAlt = (stLocalSFAddIndicationAlt *)(pvBuffer);
1689 * In case of DSD Req By MS, we should immediately delete this SF so that
1690 * we can stop the further classifying the pkt for this SF.
1692 if(pstAddIndicationAlt->u8Type == DSD_REQ)
1694 pstDeletionRequest = (stLocalSFDeleteRequest *)pvBuffer;
1696 ulSFID = ntohl(pstDeletionRequest->u32SFID);
1697 uiSearchRuleIndex=SearchSfid(Adapter,ulSFID);
1699 if(uiSearchRuleIndex < NO_OF_QUEUES)
1701 deleteSFBySfid(Adapter,uiSearchRuleIndex);
1702 Adapter->u32TotalDSD++;
1704 return 1;
1708 if( (pstAddIndicationAlt->u8Type == DSD_RSP) ||
1709 (pstAddIndicationAlt->u8Type == DSD_ACK))
1711 //No Special handling send the message as it is
1712 return 1;
1714 // For DSA_REQ, only upto "psfAuthorizedSet" parameter should be accessed by driver!
1716 pstAddIndication=(stLocalSFAddIndication *)kmalloc(sizeof(*pstAddIndication), GFP_KERNEL);
1717 if(NULL==pstAddIndication)
1718 return 0;
1720 /* AUTHORIZED SET */
1721 pstAddIndication->psfAuthorizedSet = (stServiceFlowParamSI *)
1722 GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID);
1723 if(!pstAddIndication->psfAuthorizedSet)
1724 return 0;
1726 if(StoreSFParam(Adapter,(PUCHAR)&pstAddIndicationAlt->sfAuthorizedSet,
1727 (ULONG)pstAddIndication->psfAuthorizedSet)!= 1)
1728 return 0;
1730 /* this can't possibly be right */
1731 pstAddIndication->psfAuthorizedSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfAuthorizedSet);
1733 if(pstAddIndicationAlt->u8Type == DSA_REQ)
1735 stLocalSFAddRequest AddRequest;
1737 AddRequest.u8Type = pstAddIndicationAlt->u8Type;
1738 AddRequest.eConnectionDir = pstAddIndicationAlt->u8Direction;
1739 AddRequest.u16TID = pstAddIndicationAlt->u16TID;
1740 AddRequest.u16CID = pstAddIndicationAlt->u16CID;
1741 AddRequest.u16VCID = pstAddIndicationAlt->u16VCID;
1742 AddRequest.psfParameterSet =pstAddIndication->psfAuthorizedSet ;
1743 (*puBufferLength) = sizeof(stLocalSFAddRequest);
1744 memcpy(pvBuffer,&AddRequest,sizeof(stLocalSFAddRequest));
1745 return 1;
1748 // Since it's not DSA_REQ, we can access all field in pstAddIndicationAlt
1750 //We need to extract the structure from the buffer and pack it differently
1752 pstAddIndication->u8Type = pstAddIndicationAlt->u8Type;
1753 pstAddIndication->eConnectionDir= pstAddIndicationAlt->u8Direction ;
1754 pstAddIndication->u16TID = pstAddIndicationAlt->u16TID;
1755 pstAddIndication->u16CID = pstAddIndicationAlt->u16CID;
1756 pstAddIndication->u16VCID = pstAddIndicationAlt->u16VCID;
1757 pstAddIndication->u8CC = pstAddIndicationAlt->u8CC;
1759 /* ADMITTED SET */
1760 pstAddIndication->psfAdmittedSet = (stServiceFlowParamSI *)
1761 GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID);
1762 if(!pstAddIndication->psfAdmittedSet)
1763 return 0;
1764 if(StoreSFParam(Adapter,(PUCHAR)&pstAddIndicationAlt->sfAdmittedSet,(ULONG)pstAddIndication->psfAdmittedSet) != 1)
1765 return 0;
1767 pstAddIndication->psfAdmittedSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfAdmittedSet);
1770 /* ACTIVE SET */
1771 pstAddIndication->psfActiveSet = (stServiceFlowParamSI *)
1772 GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID);
1773 if(!pstAddIndication->psfActiveSet)
1774 return 0;
1775 if(StoreSFParam(Adapter,(PUCHAR)&pstAddIndicationAlt->sfActiveSet,(ULONG)pstAddIndication->psfActiveSet) != 1)
1776 return 0;
1778 pstAddIndication->psfActiveSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfActiveSet);
1780 (*puBufferLength) = sizeof(stLocalSFAddIndication);
1781 *(stLocalSFAddIndication *)pvBuffer = *pstAddIndication;
1782 kfree(pstAddIndication);
1783 return 1;
1787 static inline stLocalSFAddIndicationAlt
1788 *RestoreCmControlResponseMessage(register PMINI_ADAPTER Adapter,register PVOID pvBuffer)
1790 ULONG ulStatus=0;
1791 stLocalSFAddIndication *pstAddIndication = NULL;
1792 stLocalSFAddIndicationAlt *pstAddIndicationDest = NULL;
1793 pstAddIndication = (stLocalSFAddIndication *)(pvBuffer);
1795 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "=====>" );
1796 if ((pstAddIndication->u8Type == DSD_REQ) ||
1797 (pstAddIndication->u8Type == DSD_RSP) ||
1798 (pstAddIndication->u8Type == DSD_ACK))
1800 return (stLocalSFAddIndicationAlt *)pvBuffer;
1803 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Inside RestoreCmControlResponseMessage ");
1805 //Need to Allocate memory to contain the SUPER Large structures
1806 //Our driver cant create these structures on Stack :(
1808 pstAddIndicationDest=kmalloc(sizeof(stLocalSFAddIndicationAlt), GFP_KERNEL);
1810 if(pstAddIndicationDest)
1812 memset(pstAddIndicationDest,0,sizeof(stLocalSFAddIndicationAlt));
1814 else
1816 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Failed to allocate memory for SF Add Indication Structure ");
1817 return NULL;
1819 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8Type : 0x%X",pstAddIndication->u8Type);
1820 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8Direction : 0x%X",pstAddIndication->eConnectionDir);
1821 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8TID : 0x%X",ntohs(pstAddIndication->u16TID));
1822 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8CID : 0x%X",ntohs(pstAddIndication->u16CID));
1823 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u16VCID : 0x%X",ntohs(pstAddIndication->u16VCID));
1824 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-autorized set loc : %p",pstAddIndication->psfAuthorizedSet);
1825 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-admitted set loc : %p",pstAddIndication->psfAdmittedSet);
1826 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-Active set loc : %p",pstAddIndication->psfActiveSet);
1828 pstAddIndicationDest->u8Type = pstAddIndication->u8Type;
1829 pstAddIndicationDest->u8Direction = pstAddIndication->eConnectionDir;
1830 pstAddIndicationDest->u16TID = pstAddIndication->u16TID;
1831 pstAddIndicationDest->u16CID = pstAddIndication->u16CID;
1832 pstAddIndicationDest->u16VCID = pstAddIndication->u16VCID;
1833 pstAddIndicationDest->u8CC = pstAddIndication->u8CC;
1835 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Active Set ");
1836 ulStatus=RestoreSFParam(Adapter,(ULONG)pstAddIndication->psfActiveSet, (PUCHAR)&pstAddIndicationDest->sfActiveSet);
1837 if(ulStatus != 1)
1839 goto failed_restore_sf_param;
1841 if(pstAddIndicationDest->sfActiveSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
1842 pstAddIndicationDest->sfActiveSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF;
1844 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Admitted Set ");
1845 ulStatus=RestoreSFParam(Adapter,(ULONG)pstAddIndication->psfAdmittedSet,(PUCHAR)&pstAddIndicationDest->sfAdmittedSet);
1846 if(ulStatus != 1)
1848 goto failed_restore_sf_param;
1850 if(pstAddIndicationDest->sfAdmittedSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
1851 pstAddIndicationDest->sfAdmittedSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF;
1853 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Authorized Set ");
1854 ulStatus=RestoreSFParam(Adapter,(ULONG)pstAddIndication->psfAuthorizedSet,(PUCHAR)&pstAddIndicationDest->sfAuthorizedSet);
1855 if(ulStatus != 1)
1857 goto failed_restore_sf_param;
1859 if(pstAddIndicationDest->sfAuthorizedSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
1860 pstAddIndicationDest->sfAuthorizedSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF;
1862 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Dumping the whole raw packet");
1863 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "============================================================");
1864 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " pstAddIndicationDest->sfActiveSet size %zx %p", sizeof(*pstAddIndicationDest), pstAddIndicationDest);
1865 //BCM_DEBUG_PRINT_BUFFER(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, (unsigned char *)pstAddIndicationDest, sizeof(*pstAddIndicationDest));
1866 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "============================================================");
1867 return pstAddIndicationDest;
1868 failed_restore_sf_param:
1869 kfree(pstAddIndicationDest);
1870 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "<=====" );
1871 return NULL;
1874 ULONG SetUpTargetDsxBuffers(PMINI_ADAPTER Adapter)
1876 ULONG ulTargetDsxBuffersBase = 0;
1877 ULONG ulCntTargetBuffers;
1878 ULONG ulIndex=0;
1879 int Status;
1881 if (!Adapter) {
1882 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Adapter was NULL!!!");
1883 return 0;
1886 if(Adapter->astTargetDsxBuffer[0].ulTargetDsxBuffer)
1887 return 1;
1889 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Size of Each DSX Buffer(Also size of ServiceFlowParamSI): %zx ",sizeof(stServiceFlowParamSI));
1890 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Reading DSX buffer From Target location %x ",DSX_MESSAGE_EXCHANGE_BUFFER);
1892 Status = rdmalt(Adapter, DSX_MESSAGE_EXCHANGE_BUFFER,
1893 (PUINT)&ulTargetDsxBuffersBase, sizeof(UINT));
1894 if(Status < 0)
1896 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "RDM failed!!");
1897 return 0;
1900 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Base Address Of DSX Target Buffer : 0x%lx",ulTargetDsxBuffersBase);
1902 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Tgt Buffer is Now %lx :",ulTargetDsxBuffersBase);
1904 ulCntTargetBuffers = DSX_MESSAGE_EXCHANGE_BUFFER_SIZE/sizeof(stServiceFlowParamSI);
1906 Adapter->ulTotalTargetBuffersAvailable =
1907 ulCntTargetBuffers > MAX_TARGET_DSX_BUFFERS ?
1908 MAX_TARGET_DSX_BUFFERS : ulCntTargetBuffers;
1910 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Total Target DSX Buffer setup %lx ",Adapter->ulTotalTargetBuffersAvailable);
1912 for(ulIndex=0; ulIndex < Adapter->ulTotalTargetBuffersAvailable ; ulIndex++)
1914 Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer = ulTargetDsxBuffersBase;
1915 Adapter->astTargetDsxBuffer[ulIndex].valid=1;
1916 Adapter->astTargetDsxBuffer[ulIndex].tid=0;
1917 ulTargetDsxBuffersBase+=sizeof(stServiceFlowParamSI);
1918 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Target DSX Buffer %lx setup at 0x%lx",
1919 ulIndex, Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer);
1921 Adapter->ulCurrentTargetBuffer = 0;
1922 Adapter->ulFreeTargetBufferCnt = Adapter->ulTotalTargetBuffersAvailable;
1923 return 1;
1926 ULONG GetNextTargetBufferLocation(PMINI_ADAPTER Adapter,B_UINT16 tid)
1928 ULONG ulTargetDSXBufferAddress;
1929 ULONG ulTargetDsxBufferIndexToUse,ulMaxTry;
1931 if((Adapter->ulTotalTargetBuffersAvailable == 0)||
1932 (Adapter->ulFreeTargetBufferCnt == 0))
1934 ClearTargetDSXBuffer(Adapter,tid,FALSE);
1935 return 0;
1938 ulTargetDsxBufferIndexToUse = Adapter->ulCurrentTargetBuffer;
1939 ulMaxTry = Adapter->ulTotalTargetBuffersAvailable;
1940 while((ulMaxTry)&&(Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].valid != 1))
1942 ulTargetDsxBufferIndexToUse = (ulTargetDsxBufferIndexToUse+1)%
1943 Adapter->ulTotalTargetBuffersAvailable;
1944 ulMaxTry--;
1947 if(ulMaxTry==0)
1949 BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "\n GetNextTargetBufferLocation : Error No Free Target DSX Buffers FreeCnt : %lx ",Adapter->ulFreeTargetBufferCnt);
1950 ClearTargetDSXBuffer(Adapter,tid,FALSE);
1951 return 0;
1955 ulTargetDSXBufferAddress =
1956 Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].ulTargetDsxBuffer;
1957 Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].valid=0;
1958 Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].tid=tid;
1959 Adapter->ulFreeTargetBufferCnt--;
1962 ulTargetDsxBufferIndexToUse =
1963 (ulTargetDsxBufferIndexToUse+1)%Adapter->ulTotalTargetBuffersAvailable;
1964 Adapter->ulCurrentTargetBuffer = ulTargetDsxBufferIndexToUse;
1965 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "GetNextTargetBufferLocation :Returning address %lx tid %d\n",
1966 ulTargetDSXBufferAddress,tid);
1967 return ulTargetDSXBufferAddress;
1971 INT AllocAdapterDsxBuffer(PMINI_ADAPTER Adapter)
1974 //Need to Allocate memory to contain the SUPER Large structures
1975 //Our driver cant create these structures on Stack
1977 Adapter->caDsxReqResp=kmalloc(sizeof(stLocalSFAddIndicationAlt)+LEADER_SIZE, GFP_KERNEL);
1978 if(!Adapter->caDsxReqResp)
1979 return -ENOMEM;
1980 return 0;
1983 INT FreeAdapterDsxBuffer(PMINI_ADAPTER Adapter)
1985 if(Adapter->caDsxReqResp)
1987 kfree(Adapter->caDsxReqResp);
1989 return 0;
1993 @ingroup ctrl_pkt_functions
1994 This routinue would process the Control responses
1995 for the Connection Management.
1996 @return - Queue index for the free SFID else returns Invalid Index.
1998 BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter, /**<Pointer to the Adapter structure*/
1999 PVOID pvBuffer /**Starting Address of the Buffer, that contains the AddIndication Data*/
2002 stServiceFlowParamSI *psfLocalSet=NULL;
2003 stLocalSFAddIndicationAlt *pstAddIndication = NULL;
2004 stLocalSFChangeIndicationAlt *pstChangeIndication = NULL;
2005 PLEADER pLeader=NULL;
2007 //Otherwise the message contains a target address from where we need to
2008 //read out the rest of the service flow param structure
2010 if((pstAddIndication = RestoreCmControlResponseMessage(Adapter,pvBuffer))
2011 == NULL)
2013 ClearTargetDSXBuffer(Adapter,((stLocalSFAddIndication *)pvBuffer)->u16TID, FALSE);
2014 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "Error in restoring Service Flow param structure from DSx message");
2015 return FALSE;
2018 DumpCmControlPacket(pstAddIndication);
2019 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "====>");
2020 pLeader = (PLEADER)Adapter->caDsxReqResp;
2022 pLeader->Status =CM_CONTROL_NEWDSX_MULTICLASSIFIER_REQ;
2023 pLeader->Vcid = 0;
2025 ClearTargetDSXBuffer(Adapter,pstAddIndication->u16TID,FALSE);
2026 BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "### TID RECEIVED %d\n",pstAddIndication->u16TID);
2027 switch(pstAddIndication->u8Type)
2029 case DSA_REQ:
2031 pLeader->PLength = sizeof(stLocalSFAddIndicationAlt);
2032 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Sending DSA Response....\n");
2033 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSA RESPONSE TO MAC %d", pLeader->PLength );
2034 *((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))
2035 = *pstAddIndication;
2036 ((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSA_RSP;
2038 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " VCID = %x", ntohs(pstAddIndication->u16VCID));
2039 CopyBufferToControlPacket(Adapter,(PVOID)Adapter->caDsxReqResp);
2040 kfree(pstAddIndication);
2042 break;
2043 case DSA_RSP:
2045 pLeader->PLength = sizeof(stLocalSFAddIndicationAlt);
2046 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSA ACK TO MAC %d",
2047 pLeader->PLength);
2048 *((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))
2049 = *pstAddIndication;
2050 ((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSA_ACK;
2052 }//no break here..we should go down.
2053 case DSA_ACK:
2055 UINT uiSearchRuleIndex=0;
2057 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "VCID:0x%X",
2058 ntohs(pstAddIndication->u16VCID));
2059 uiSearchRuleIndex=SearchFreeSfid(Adapter);
2060 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"uiSearchRuleIndex:0x%X ",
2061 uiSearchRuleIndex);
2062 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Direction:0x%X ",
2063 pstAddIndication->u8Direction);
2064 if((uiSearchRuleIndex< NO_OF_QUEUES) )
2066 Adapter->PackInfo[uiSearchRuleIndex].ucDirection =
2067 pstAddIndication->u8Direction;
2068 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "bValid:0x%X ",
2069 pstAddIndication->sfActiveSet.bValid);
2070 if(pstAddIndication->sfActiveSet.bValid==TRUE)
2072 Adapter->PackInfo[uiSearchRuleIndex].bActiveSet=TRUE;
2074 if(pstAddIndication->sfAuthorizedSet.bValid==TRUE)
2076 Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet=TRUE;
2078 if(pstAddIndication->sfAdmittedSet.bValid==TRUE)
2080 Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet=TRUE;
2082 if(FALSE == pstAddIndication->sfActiveSet.bValid)
2084 Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE;
2085 Adapter->PackInfo[uiSearchRuleIndex].bActivateRequestSent = FALSE;
2086 if(pstAddIndication->sfAdmittedSet.bValid)
2088 psfLocalSet = &pstAddIndication->sfAdmittedSet;
2090 else if(pstAddIndication->sfAuthorizedSet.bValid)
2092 psfLocalSet = &pstAddIndication->sfAuthorizedSet;
2095 else
2097 psfLocalSet = &pstAddIndication->sfActiveSet;
2098 Adapter->PackInfo[uiSearchRuleIndex].bActive=TRUE;
2101 if(!psfLocalSet)
2103 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "No set is valid\n");
2104 Adapter->PackInfo[uiSearchRuleIndex].bActive=FALSE;
2105 Adapter->PackInfo[uiSearchRuleIndex].bValid=FALSE;
2106 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value=0;
2107 kfree(pstAddIndication);
2110 else if(psfLocalSet->bValid && (pstAddIndication->u8CC == 0))
2112 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSA ACK");
2113 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value =
2114 ntohs(pstAddIndication->u16VCID);
2115 Adapter->PackInfo[uiSearchRuleIndex].usCID =
2116 ntohs(pstAddIndication->u16CID);
2118 if(UPLINK_DIR == pstAddIndication->u8Direction)
2119 atomic_set(&Adapter->PackInfo[uiSearchRuleIndex].uiPerSFTxResourceCount, DEFAULT_PERSFCOUNT);
2120 CopyToAdapter(Adapter,psfLocalSet,uiSearchRuleIndex,
2121 DSA_ACK, pstAddIndication);
2122 // don't free pstAddIndication
2124 /* Inside CopyToAdapter, Sorting of all the SFs take place.
2125 Hence any access to the newly added SF through uiSearchRuleIndex is invalid.
2126 SHOULD BE STRICTLY AVOIDED.
2128 // *(PULONG)(((PUCHAR)pvBuffer)+1)=psfLocalSet->u32SFID;
2129 memcpy((((PUCHAR)pvBuffer)+1), &psfLocalSet->u32SFID, 4);
2131 if(pstAddIndication->sfActiveSet.bValid == TRUE)
2133 if(UPLINK_DIR == pstAddIndication->u8Direction)
2135 if(!Adapter->LinkUpStatus)
2137 netif_carrier_on(Adapter->dev);
2138 netif_start_queue(Adapter->dev);
2139 Adapter->LinkUpStatus = 1;
2140 if (netif_msg_link(Adapter))
2141 pr_info(DRV_NAME "%s: link up\n", Adapter->dev->name);
2142 atomic_set(&Adapter->TxPktAvail, 1);
2143 wake_up(&Adapter->tx_packet_wait_queue);
2144 Adapter->liTimeSinceLastNetEntry = get_seconds();
2150 else
2152 Adapter->PackInfo[uiSearchRuleIndex].bActive=FALSE;
2153 Adapter->PackInfo[uiSearchRuleIndex].bValid=FALSE;
2154 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value=0;
2155 kfree(pstAddIndication);
2158 else
2160 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "DSA ACK did not get valid SFID");
2161 kfree(pstAddIndication);
2162 return FALSE;
2165 break;
2166 case DSC_REQ:
2168 pLeader->PLength = sizeof(stLocalSFChangeIndicationAlt);
2169 pstChangeIndication = (stLocalSFChangeIndicationAlt*)pstAddIndication;
2170 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSC RESPONSE TO MAC %d", pLeader->PLength);
2172 *((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *pstChangeIndication;
2173 ((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSC_RSP;
2175 CopyBufferToControlPacket(Adapter,(PVOID)Adapter->caDsxReqResp);
2176 kfree(pstAddIndication);
2178 break;
2179 case DSC_RSP:
2181 pLeader->PLength = sizeof(stLocalSFChangeIndicationAlt);
2182 pstChangeIndication = (stLocalSFChangeIndicationAlt*)pstAddIndication;
2183 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSC ACK TO MAC %d", pLeader->PLength);
2184 *((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *pstChangeIndication;
2185 ((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSC_ACK;
2187 case DSC_ACK:
2189 UINT uiSearchRuleIndex=0;
2191 pstChangeIndication = (stLocalSFChangeIndicationAlt *)pstAddIndication;
2192 uiSearchRuleIndex=SearchSfid(Adapter,ntohl(pstChangeIndication->sfActiveSet.u32SFID));
2193 if(uiSearchRuleIndex > NO_OF_QUEUES-1)
2195 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "SF doesn't exist for which DSC_ACK is received");
2197 if((uiSearchRuleIndex < NO_OF_QUEUES))
2199 Adapter->PackInfo[uiSearchRuleIndex].ucDirection = pstChangeIndication->u8Direction;
2200 if(pstChangeIndication->sfActiveSet.bValid==TRUE)
2202 Adapter->PackInfo[uiSearchRuleIndex].bActiveSet=TRUE;
2204 if(pstChangeIndication->sfAuthorizedSet.bValid==TRUE)
2206 Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet=TRUE;
2208 if(pstChangeIndication->sfAdmittedSet.bValid==TRUE)
2210 Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet=TRUE;
2213 if(FALSE==pstChangeIndication->sfActiveSet.bValid)
2215 Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE;
2216 Adapter->PackInfo[uiSearchRuleIndex].bActivateRequestSent = FALSE;
2217 if(pstChangeIndication->sfAdmittedSet.bValid)
2219 psfLocalSet = &pstChangeIndication->sfAdmittedSet;
2221 else if(pstChangeIndication->sfAuthorizedSet.bValid)
2223 psfLocalSet = &pstChangeIndication->sfAuthorizedSet;
2227 else
2229 psfLocalSet = &pstChangeIndication->sfActiveSet;
2230 Adapter->PackInfo[uiSearchRuleIndex].bActive=TRUE;
2232 if(psfLocalSet->bValid && (pstChangeIndication->u8CC == 0))
2234 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value =
2235 ntohs(pstChangeIndication->u16VCID);
2236 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "CC field is %d bvalid = %d\n",
2237 pstChangeIndication->u8CC, psfLocalSet->bValid);
2238 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "VCID= %d\n", ntohs(pstChangeIndication->u16VCID));
2239 Adapter->PackInfo[uiSearchRuleIndex].usCID =
2240 ntohs(pstChangeIndication->u16CID);
2241 CopyToAdapter(Adapter,psfLocalSet,uiSearchRuleIndex,
2242 DSC_ACK, pstAddIndication);
2244 *(PULONG)(((PUCHAR)pvBuffer)+1)=psfLocalSet->u32SFID;
2246 else if(pstChangeIndication->u8CC == 6)
2248 deleteSFBySfid(Adapter,uiSearchRuleIndex);
2249 kfree(pstAddIndication);
2252 else
2254 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "DSC ACK did not get valid SFID");
2255 kfree(pstAddIndication);
2256 return FALSE;
2259 break;
2260 case DSD_REQ:
2262 UINT uiSearchRuleIndex;
2263 ULONG ulSFID;
2265 pLeader->PLength = sizeof(stLocalSFDeleteIndication);
2266 *((stLocalSFDeleteIndication*)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *((stLocalSFDeleteIndication*)pstAddIndication);
2268 ulSFID = ntohl(((stLocalSFDeleteIndication*)pstAddIndication)->u32SFID);
2269 uiSearchRuleIndex=SearchSfid(Adapter,ulSFID);
2270 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSD - Removing connection %x",uiSearchRuleIndex);
2272 if(uiSearchRuleIndex < NO_OF_QUEUES)
2274 //Delete All Classifiers Associated with this SFID
2275 deleteSFBySfid(Adapter,uiSearchRuleIndex);
2276 Adapter->u32TotalDSD++;
2279 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSD RESPONSE TO MAC");
2280 ((stLocalSFDeleteIndication*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSD_RSP;
2281 CopyBufferToControlPacket(Adapter,(PVOID)Adapter->caDsxReqResp);
2283 case DSD_RSP:
2285 //Do nothing as SF has already got Deleted
2287 break;
2288 case DSD_ACK:
2289 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSD ACK Rcd, let App handle it\n");
2290 break;
2291 default:
2292 kfree(pstAddIndication);
2293 return FALSE ;
2295 return TRUE;
2298 int get_dsx_sf_data_to_application(PMINI_ADAPTER Adapter, UINT uiSFId, void __user *user_buffer)
2300 int status = 0;
2301 struct _packet_info *psSfInfo=NULL;
2302 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "status =%d",status);
2303 status = SearchSfid(Adapter, uiSFId);
2304 if (status >= NO_OF_QUEUES) {
2305 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SFID %d not present in queue !!!", uiSFId );
2306 return -EINVAL;
2308 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "status =%d",status);
2309 psSfInfo=&Adapter->PackInfo[status];
2310 if(psSfInfo->pstSFIndication && copy_to_user(user_buffer,
2311 psSfInfo->pstSFIndication, sizeof(stLocalSFAddIndicationAlt)))
2313 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "copy to user failed SFID %d, present in queue !!!", uiSFId );
2314 status = -EFAULT;
2315 return status;
2317 return STATUS_SUCCESS;
2320 VOID OverrideServiceFlowParams(PMINI_ADAPTER Adapter,PUINT puiBuffer)
2322 B_UINT32 u32NumofSFsinMsg = ntohl(*(puiBuffer + 1));
2323 stIM_SFHostNotify *pHostInfo = NULL;
2324 UINT uiSearchRuleIndex = 0;
2325 ULONG ulSFID = 0;
2327 puiBuffer+=2;
2329 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "u32NumofSFsinMsg: 0x%x\n",u32NumofSFsinMsg);
2331 while(u32NumofSFsinMsg != 0 && u32NumofSFsinMsg < NO_OF_QUEUES)
2333 u32NumofSFsinMsg--;
2334 pHostInfo = (stIM_SFHostNotify *)puiBuffer;
2335 puiBuffer = (PUINT)(pHostInfo + 1);
2337 ulSFID = ntohl(pHostInfo->SFID);
2338 uiSearchRuleIndex=SearchSfid(Adapter,ulSFID);
2339 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"SFID: 0x%lx\n",ulSFID);
2341 if(uiSearchRuleIndex >= NO_OF_QUEUES || uiSearchRuleIndex == HiPriority)
2343 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);
2344 continue;
2347 if(pHostInfo->RetainSF == FALSE)
2349 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Going to Delete SF");
2350 deleteSFBySfid(Adapter,uiSearchRuleIndex);
2352 else
2355 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = ntohs(pHostInfo->VCID);
2356 Adapter->PackInfo[uiSearchRuleIndex].usCID = ntohs(pHostInfo->newCID);
2357 Adapter->PackInfo[uiSearchRuleIndex].bActive=FALSE;
2359 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"pHostInfo->QoSParamSet: 0x%x\n",pHostInfo->QoSParamSet);
2361 if(pHostInfo->QoSParamSet & 0x1)
2362 Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet =TRUE;
2363 if(pHostInfo->QoSParamSet & 0x2)
2364 Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet =TRUE;
2365 if(pHostInfo->QoSParamSet & 0x4)
2367 Adapter->PackInfo[uiSearchRuleIndex].bActiveSet =TRUE;
2368 Adapter->PackInfo[uiSearchRuleIndex].bActive=TRUE;