GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / drivers / usb / Beceem_driver / src / Common / CmHost.c
blob45e856a2a334eb737e2ea6089e986738bbf2eaf9
1 /*
2 * CmHost.c
4 *Copyright (C) 2010 Beceem Communications, Inc.
6 *This program is free software: you can redistribute it and/or modify
7 *it under the terms of the GNU General Public License version 2 as
8 *published by the Free Software Foundation.
10 *This program is distributed in the hope that it will be useful,but
11 *WITHOUT ANY WARRANTY; without even the implied warranty of
12 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 *See the GNU General Public License for more details.
15 *You should have received a copy of the GNU General Public License
16 *along with this program. If not, write to the Free Software Foundation, Inc.,
17 *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 /************************************************************
24 * This file contains the routines for handling Connnection
25 * Management.
26 ************************************************************/
28 //#define CONN_MSG
29 #include<headers.h>
31 typedef enum _E_CLASSIFIER_ACTION
33 eInvalidClassifierAction,
34 eAddClassifier,
35 eReplaceClassifier,
36 eDeleteClassifier
37 }E_CLASSIFIER_ACTION;
40 /************************************************************
41 * Function - SearchSfid
43 * Description - This routinue would search QOS queues having
44 * specified SFID as input parameter.
46 * Parameters - Adapter: Pointer to the Adapter structure
47 * uiSfid : Given SFID for matching
49 * Returns - Queue index for this SFID(If matched)
50 Else Invalid Queue Index(If Not matched)
51 ************************************************************/
52 __inline INT SearchSfid(PMINI_ADAPTER Adapter,UINT uiSfid)
54 INT iIndex=0;
55 for(iIndex=(NO_OF_QUEUES-1); iIndex>=0; iIndex--)
56 if(Adapter->PackInfo[iIndex].ulSFID==uiSfid)
57 return iIndex;
58 return NO_OF_QUEUES+1;
61 /***************************************************************
62 * Function - SearchFreeSfid
64 * Description - This routinue would search Free available SFID.
66 * Parameter - Adapter: Pointer to the Adapter structure
68 * Returns - Queue index for the free SFID
69 * Else returns Invalid Index.
70 ****************************************************************/
71 __inline INT SearchFreeSfid(PMINI_ADAPTER Adapter)
73 UINT uiIndex=0;
74 for(uiIndex=0; uiIndex < (NO_OF_QUEUES-1); uiIndex++)
75 if(Adapter->PackInfo[uiIndex].ulSFID==0)
76 return uiIndex;
77 return NO_OF_QUEUES+1;
80 __inline int SearchVcid(PMINI_ADAPTER Adapter,unsigned short usVcid)
82 int iIndex=0;
83 for(iIndex=(NO_OF_QUEUES-1);iIndex>=0;iIndex--)
84 if(Adapter->PackInfo[iIndex].usVCID_Value == usVcid)
85 return iIndex;
86 return NO_OF_QUEUES+1;
92 Function: SearchClsid
93 Description: This routinue would search Classifier having specified ClassifierID as input parameter
94 Input parameters: PMINI_ADAPTER Adapter - Adapter Context
95 unsigned int uiSfid - The SF in which the classifier is to searched
96 B_UINT16 uiClassifierID - The classifier ID to be searched
97 Return: int :Classifier table index of matching entry
100 __inline int SearchClsid(PMINI_ADAPTER Adapter,ULONG ulSFID,B_UINT16 uiClassifierID)
102 unsigned int uiClassifierIndex = 0;
103 for(uiClassifierIndex=0;uiClassifierIndex<MAX_CLASSIFIERS;uiClassifierIndex++)
105 if((Adapter->astClassifierTable[uiClassifierIndex].bUsed) &&
106 (Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex == uiClassifierID)&&
107 (Adapter->astClassifierTable[uiClassifierIndex].ulSFID == ulSFID))
108 return uiClassifierIndex;
110 return MAX_CLASSIFIERS+1;
114 @ingroup ctrl_pkt_functions
115 This routinue would search Free available Classifier entry in classifier table.
116 @return free Classifier Entry index in classifier table for specified SF
118 static __inline int SearchFreeClsid(PMINI_ADAPTER Adapter /**Adapter Context*/
121 unsigned int uiClassifierIndex = 0;
122 for(uiClassifierIndex=0;uiClassifierIndex<MAX_CLASSIFIERS;uiClassifierIndex++)
124 if(!Adapter->astClassifierTable[uiClassifierIndex].bUsed)
125 return uiClassifierIndex;
127 return MAX_CLASSIFIERS+1;
130 VOID deleteSFBySfid(PMINI_ADAPTER Adapter, UINT uiSearchRuleIndex)
132 //deleting all the packet held in the SF
133 flush_queue(Adapter,uiSearchRuleIndex);
135 //Deleting the all classifiers for this SF
136 DeleteAllClassifiersForSF(Adapter,uiSearchRuleIndex);
138 //Resetting only MIBS related entries in the SF
139 memset((PVOID)&Adapter->PackInfo[uiSearchRuleIndex], 0, sizeof(S_MIBS_SERVICEFLOW_TABLE));
142 static inline VOID
143 CopyIpAddrToClassifier(S_CLASSIFIER_RULE *pstClassifierEntry ,
144 B_UINT8 u8IpAddressLen , B_UINT8 *pu8IpAddressMaskSrc ,
145 BOOLEAN bIpVersion6 , E_IPADDR_CONTEXT eIpAddrContext)
147 UINT ucLoopIndex=0;
148 UINT nSizeOfIPAddressInBytes = IP_LENGTH_OF_ADDRESS;
149 UCHAR *ptrClassifierIpAddress = NULL;
150 UCHAR *ptrClassifierIpMask = NULL;
151 PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
153 if(bIpVersion6)
155 nSizeOfIPAddressInBytes = IPV6_ADDRESS_SIZEINBYTES;
157 //Destination Ip Address
158 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Ip Address Range Length:0x%X ",
159 u8IpAddressLen);
160 if((bIpVersion6?(IPV6_ADDRESS_SIZEINBYTES * MAX_IP_RANGE_LENGTH * 2):
161 (TOTAL_MASKED_ADDRESS_IN_BYTES)) >= u8IpAddressLen)
164 //checking both the mask and address togethor in Classification.
165 //So length will be : TotalLengthInBytes/nSizeOfIPAddressInBytes * 2
166 //(nSizeOfIPAddressInBytes for address and nSizeOfIPAddressInBytes for mask)
168 if(eIpAddrContext == eDestIpAddress)
170 pstClassifierEntry->ucIPDestinationAddressLength =
171 u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
172 if(bIpVersion6)
174 ptrClassifierIpAddress =
175 pstClassifierEntry->stDestIpAddress.ucIpv6Address;
176 ptrClassifierIpMask =
177 pstClassifierEntry->stDestIpAddress.ucIpv6Mask;
179 else
181 ptrClassifierIpAddress =
182 pstClassifierEntry->stDestIpAddress.ucIpv4Address;
183 ptrClassifierIpMask =
184 pstClassifierEntry->stDestIpAddress.ucIpv4Mask;
187 else if(eIpAddrContext == eSrcIpAddress)
189 pstClassifierEntry->ucIPSourceAddressLength =
190 u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
191 if(bIpVersion6)
193 ptrClassifierIpAddress =
194 pstClassifierEntry->stSrcIpAddress.ucIpv6Address;
195 ptrClassifierIpMask =
196 pstClassifierEntry->stSrcIpAddress.ucIpv6Mask;
198 else
200 ptrClassifierIpAddress =
201 pstClassifierEntry->stSrcIpAddress.ucIpv4Address;
202 ptrClassifierIpMask =
203 pstClassifierEntry->stSrcIpAddress.ucIpv4Mask;
206 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Address Length:0x%X \n",
207 pstClassifierEntry->ucIPDestinationAddressLength);
208 while((u8IpAddressLen>= nSizeOfIPAddressInBytes) &&
209 (ucLoopIndex < MAX_IP_RANGE_LENGTH))
211 memcpy(ptrClassifierIpAddress +
212 (ucLoopIndex * nSizeOfIPAddressInBytes),
213 (pu8IpAddressMaskSrc+(ucLoopIndex*nSizeOfIPAddressInBytes*2)),
214 nSizeOfIPAddressInBytes);
215 if(!bIpVersion6)
217 if(eIpAddrContext == eSrcIpAddress)
219 pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[ucLoopIndex]=
220 ntohl(pstClassifierEntry->stSrcIpAddress.
221 ulIpv4Addr[ucLoopIndex]);
222 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Src Ip Address:0x%luX ",pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[ucLoopIndex]);
224 else if(eIpAddrContext == eDestIpAddress)
226 pstClassifierEntry->stDestIpAddress.ulIpv4Addr[ucLoopIndex]= ntohl(pstClassifierEntry->stDestIpAddress.
227 ulIpv4Addr[ucLoopIndex]);
228 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Dest Ip Address:0x%luX ",pstClassifierEntry->stDestIpAddress.ulIpv4Addr[ucLoopIndex]);
231 u8IpAddressLen-=nSizeOfIPAddressInBytes;
232 if(u8IpAddressLen >= nSizeOfIPAddressInBytes)
234 memcpy(ptrClassifierIpMask +
235 (ucLoopIndex * nSizeOfIPAddressInBytes),
236 (pu8IpAddressMaskSrc+nSizeOfIPAddressInBytes +
237 (ucLoopIndex*nSizeOfIPAddressInBytes*2)),
238 nSizeOfIPAddressInBytes);
239 if(!bIpVersion6)
241 if(eIpAddrContext == eSrcIpAddress)
243 pstClassifierEntry->stSrcIpAddress.
244 ulIpv4Mask[ucLoopIndex]=
245 ntohl(pstClassifierEntry->stSrcIpAddress.
246 ulIpv4Mask[ucLoopIndex]);
247 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Src Ip Mask Address:0x%luX ",pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[ucLoopIndex]);
249 else if(eIpAddrContext == eDestIpAddress)
251 pstClassifierEntry->stDestIpAddress.
252 ulIpv4Mask[ucLoopIndex] =
253 ntohl(pstClassifierEntry->stDestIpAddress.
254 ulIpv4Mask[ucLoopIndex]);
255 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Dest Ip Mask Address:0x%luX ",pstClassifierEntry->stDestIpAddress.ulIpv4Mask[ucLoopIndex]);
258 u8IpAddressLen-=nSizeOfIPAddressInBytes;
260 if(0==u8IpAddressLen)
262 pstClassifierEntry->bDestIpValid=TRUE;
264 ucLoopIndex++;
266 if(bIpVersion6)
268 //Restore EndianNess of Struct
269 for(ucLoopIndex =0 ; ucLoopIndex < MAX_IP_RANGE_LENGTH * 4 ;
270 ucLoopIndex++)
272 if(eIpAddrContext == eSrcIpAddress)
274 pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[ucLoopIndex]=
275 ntohl(pstClassifierEntry->stSrcIpAddress.
276 ulIpv6Addr[ucLoopIndex]);
277 pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[ucLoopIndex]= ntohl(pstClassifierEntry->stSrcIpAddress.
278 ulIpv6Mask[ucLoopIndex]);
280 else if(eIpAddrContext == eDestIpAddress)
282 pstClassifierEntry->stDestIpAddress.ulIpv6Addr[ucLoopIndex]= ntohl(pstClassifierEntry->stDestIpAddress.
283 ulIpv6Addr[ucLoopIndex]);
284 pstClassifierEntry->stDestIpAddress.ulIpv6Mask[ucLoopIndex]= ntohl(pstClassifierEntry->stDestIpAddress.
285 ulIpv6Mask[ucLoopIndex]);
293 void ClearTargetDSXBuffer(PMINI_ADAPTER Adapter,B_UINT16 TID,BOOLEAN bFreeAll)
295 ULONG ulIndex;
296 for(ulIndex=0; ulIndex < Adapter->ulTotalTargetBuffersAvailable; ulIndex++)
298 if(Adapter->astTargetDsxBuffer[ulIndex].valid)
299 continue;
300 if ((bFreeAll) || (Adapter->astTargetDsxBuffer[ulIndex].tid == TID)){
301 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "ClearTargetDSXBuffer: found tid %d buffer cleared %lx\n",
302 TID, Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer);
303 Adapter->astTargetDsxBuffer[ulIndex].valid=1;
304 Adapter->astTargetDsxBuffer[ulIndex].tid=0;
305 Adapter->ulFreeTargetBufferCnt++;
311 @ingroup ctrl_pkt_functions
312 copy classifier rule into the specified SF index
314 static inline VOID CopyClassifierRuleToSF(PMINI_ADAPTER Adapter,stConvergenceSLTypes *psfCSType,UINT uiSearchRuleIndex,UINT nClassifierIndex)
316 S_CLASSIFIER_RULE *pstClassifierEntry = NULL;
317 //VOID *pvPhsContext = NULL;
318 UINT ucLoopIndex=0;
319 //UCHAR ucProtocolLength=0;
320 //ULONG ulPhsStatus;
323 if(Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value == 0 ||
324 nClassifierIndex > (MAX_CLASSIFIERS-1))
325 return;
328 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Storing Classifier Rule Index : %X",ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex));
330 if(nClassifierIndex > MAX_CLASSIFIERS-1)
331 return;
333 pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
334 if(pstClassifierEntry)
336 //Store if Ipv6
337 pstClassifierEntry->bIpv6Protocol =
338 (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6)?TRUE:FALSE;
340 //Destinaiton Port
341 pstClassifierEntry->ucDestPortRangeLength=psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength/4;
342 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Destination Port Range Length:0x%X ",pstClassifierEntry->ucDestPortRangeLength);
343 if( MAX_PORT_RANGE >= psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength)
345 for(ucLoopIndex=0;ucLoopIndex<(pstClassifierEntry->ucDestPortRangeLength);ucLoopIndex++)
347 pstClassifierEntry->usDestPortRangeLo[ucLoopIndex] =
348 *((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+ucLoopIndex));
349 pstClassifierEntry->usDestPortRangeHi[ucLoopIndex] =
350 *((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+2+ucLoopIndex));
351 pstClassifierEntry->usDestPortRangeLo[ucLoopIndex]=ntohs(pstClassifierEntry->usDestPortRangeLo[ucLoopIndex]);
352 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Destination Port Range Lo:0x%X ",pstClassifierEntry->usDestPortRangeLo[ucLoopIndex]);
353 pstClassifierEntry->usDestPortRangeHi[ucLoopIndex]=ntohs(pstClassifierEntry->usDestPortRangeHi[ucLoopIndex]);
356 else
358 pstClassifierEntry->ucDestPortRangeLength=0;
360 //Source Port
361 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Source Port Range Length:0x%X ",psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
362 if(MAX_PORT_RANGE >=
363 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength)
365 pstClassifierEntry->ucSrcPortRangeLength =
366 psfCSType->cCPacketClassificationRule.
367 u8ProtocolSourcePortRangeLength/4;
368 for(ucLoopIndex = 0; ucLoopIndex <
369 (pstClassifierEntry->ucSrcPortRangeLength); ucLoopIndex++)
371 pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex] =
372 *((PUSHORT)(psfCSType->cCPacketClassificationRule.
373 u8ProtocolSourcePortRange+ucLoopIndex));
374 pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex] =
375 *((PUSHORT)(psfCSType->cCPacketClassificationRule.
376 u8ProtocolSourcePortRange+2+ucLoopIndex));
377 pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex] =
378 ntohs(pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex]);
379 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Source Port Range Lo:0x%X ",pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex]);
380 pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex]=ntohs(pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex]);
383 //Destination Ip Address and Mask
384 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Ip Destination Parameters : ");
386 CopyIpAddrToClassifier(pstClassifierEntry,
387 psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength,
388 psfCSType->cCPacketClassificationRule.u8IPDestinationAddress,
389 (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6)?
390 TRUE:FALSE, eDestIpAddress);
392 //Source Ip Address and Mask
393 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Ip Source Parameters : ");
395 CopyIpAddrToClassifier(pstClassifierEntry,
396 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength,
397 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress,
398 (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6)?TRUE:FALSE,
399 eSrcIpAddress);
401 //TOS
402 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"TOS Length:0x%X ",psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
403 if(3 == psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength)
405 pstClassifierEntry->ucIPTypeOfServiceLength =
406 psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength;
407 pstClassifierEntry->ucTosLow =
408 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0];
409 pstClassifierEntry->ucTosHigh =
410 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1];
411 pstClassifierEntry->ucTosMask =
412 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2];
413 pstClassifierEntry->bTOSValid = TRUE;
415 if(psfCSType->cCPacketClassificationRule.u8Protocol == 0)
417 //we didnt get protocol field filled in by the BS
418 pstClassifierEntry->ucProtocolLength=0;
420 else
422 pstClassifierEntry->ucProtocolLength=1;// 1 valid protocol
425 pstClassifierEntry->ucProtocol[0] =
426 psfCSType->cCPacketClassificationRule.u8Protocol;
428 pstClassifierEntry->u8ClassifierRulePriority =
429 psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority;
431 //store the classifier rule ID and set this classifier entry as valid
432 pstClassifierEntry->ucDirection =
433 Adapter->PackInfo[uiSearchRuleIndex].ucDirection;
434 pstClassifierEntry->uiClassifierRuleIndex = ntohs(psfCSType->
435 cCPacketClassificationRule.u16PacketClassificationRuleIndex);
436 pstClassifierEntry->usVCID_Value =
437 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
438 pstClassifierEntry->ulSFID =
439 Adapter->PackInfo[uiSearchRuleIndex].ulSFID;
440 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Search Index %d Dir: %d, Index: %d, Vcid: %d\n",
441 uiSearchRuleIndex, pstClassifierEntry->ucDirection,
442 pstClassifierEntry->uiClassifierRuleIndex,
443 pstClassifierEntry->usVCID_Value);
445 if(psfCSType->cCPacketClassificationRule.u8AssociatedPHSI)
447 pstClassifierEntry->u8AssociatedPHSI = psfCSType->cCPacketClassificationRule.u8AssociatedPHSI;
450 //Copy ETH CS Parameters
451 pstClassifierEntry->ucEthCSSrcMACLen = (psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddressLength);
452 memcpy(pstClassifierEntry->au8EThCSSrcMAC,psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress,MAC_ADDRESS_SIZE);
453 memcpy(pstClassifierEntry->au8EThCSSrcMACMask,psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress+MAC_ADDRESS_SIZE,MAC_ADDRESS_SIZE);
454 pstClassifierEntry->ucEthCSDestMACLen = (psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
455 memcpy(pstClassifierEntry->au8EThCSDestMAC,psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress,MAC_ADDRESS_SIZE);
456 memcpy(pstClassifierEntry->au8EThCSDestMACMask,psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress+MAC_ADDRESS_SIZE,MAC_ADDRESS_SIZE);
457 pstClassifierEntry->ucEtherTypeLen = (psfCSType->cCPacketClassificationRule.u8EthertypeLength);
458 memcpy(pstClassifierEntry->au8EthCSEtherType,psfCSType->cCPacketClassificationRule.u8Ethertype,NUM_ETHERTYPE_BYTES);
459 memcpy(pstClassifierEntry->usUserPriority, &psfCSType->cCPacketClassificationRule.u16UserPriority, 2);
460 pstClassifierEntry->usVLANID = ntohs(psfCSType->cCPacketClassificationRule.u16VLANID);
461 pstClassifierEntry->usValidityBitMap = ntohs(psfCSType->cCPacketClassificationRule.u16ValidityBitMap);
463 pstClassifierEntry->bUsed = TRUE;
469 @ingroup ctrl_pkt_functions
471 static inline VOID DeleteClassifierRuleFromSF(PMINI_ADAPTER Adapter,UINT uiSearchRuleIndex,UINT nClassifierIndex)
473 S_CLASSIFIER_RULE *pstClassifierEntry = NULL;
474 B_UINT16 u16PacketClassificationRuleIndex;
475 USHORT usVCID;
476 //VOID *pvPhsContext = NULL;
477 //ULONG ulPhsStatus;
479 usVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
481 if(nClassifierIndex > MAX_CLASSIFIERS-1)
482 return;
484 if(usVCID == 0)
485 return;
487 u16PacketClassificationRuleIndex = Adapter->astClassifierTable[nClassifierIndex].uiClassifierRuleIndex;
490 pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
491 if(pstClassifierEntry)
493 pstClassifierEntry->bUsed = FALSE;
494 pstClassifierEntry->uiClassifierRuleIndex = 0;
495 memset(pstClassifierEntry,0,sizeof(S_CLASSIFIER_RULE));
497 //Delete the PHS Rule for this classifier
498 PhsDeleteClassifierRule(
499 &Adapter->stBCMPhsContext,
500 usVCID,
501 u16PacketClassificationRuleIndex);
506 @ingroup ctrl_pkt_functions
508 VOID DeleteAllClassifiersForSF(PMINI_ADAPTER Adapter,UINT uiSearchRuleIndex)
510 S_CLASSIFIER_RULE *pstClassifierEntry = NULL;
511 UINT nClassifierIndex;
512 //B_UINT16 u16PacketClassificationRuleIndex;
513 USHORT ulVCID;
514 //VOID *pvPhsContext = NULL;
515 //ULONG ulPhsStatus;
517 ulVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
519 if(ulVCID == 0)
520 return;
523 for(nClassifierIndex =0 ; nClassifierIndex < MAX_CLASSIFIERS ; nClassifierIndex++)
525 if(Adapter->astClassifierTable[nClassifierIndex].usVCID_Value == ulVCID)
527 pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
528 if(pstClassifierEntry->bUsed)
530 DeleteClassifierRuleFromSF(Adapter,uiSearchRuleIndex,nClassifierIndex);
535 //Delete All Phs Rules Associated with this SF
536 PhsDeleteSFRules(
537 &Adapter->stBCMPhsContext,
538 ulVCID);
544 This routinue copies the Connection Management
545 related data into the Adapter structure.
546 @ingroup ctrl_pkt_functions
549 static VOID CopyToAdapter( register PMINI_ADAPTER Adapter, /**<Pointer to the Adapter structure*/
550 register pstServiceFlowParamSI psfLocalSet, /**<Pointer to the ServiceFlowParamSI structure*/
551 register UINT uiSearchRuleIndex, /**<Index of Queue, to which this data belongs*/
552 register UCHAR ucDsxType,
553 stLocalSFAddIndicationAlt *pstAddIndication)
555 //UCHAR ucProtocolLength=0;
556 ULONG ulSFID;
557 UINT nClassifierIndex = 0;
558 E_CLASSIFIER_ACTION eClassifierAction = eInvalidClassifierAction;
559 B_UINT16 u16PacketClassificationRuleIndex=0;
560 UINT nIndex=0;
561 stConvergenceSLTypes *psfCSType = NULL;
562 S_PHS_RULE sPhsRule;
563 USHORT uVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
564 UINT UGIValue = 0;
567 Adapter->PackInfo[uiSearchRuleIndex].bValid=TRUE;
568 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Search Rule Index = %d\n", uiSearchRuleIndex);
569 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"%s: SFID= %x ",__FUNCTION__, ntohl(psfLocalSet->u32SFID));
570 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Updating Queue %d",uiSearchRuleIndex);
572 ulSFID = ntohl(psfLocalSet->u32SFID);
573 //Store IP Version used
574 //Get The Version Of IP used (IPv6 or IPv4) from CSSpecification field of SF
576 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = 0;
577 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 0;
579 /*Enable IP/ETh CS Support As Required*/
580 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"CopyToAdapter : u8CSSpecification : %X\n",psfLocalSet->u8CSSpecification);
581 switch(psfLocalSet->u8CSSpecification)
583 case eCSPacketIPV4:
585 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
586 break;
588 case eCSPacketIPV6:
590 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV6_CS;
591 break;
594 case eCS802_3PacketEthernet:
595 case eCS802_1QPacketVLAN:
597 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3;
598 break;
601 case eCSPacketIPV4Over802_1QVLAN:
602 case eCSPacketIPV4Over802_3Ethernet:
604 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
605 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3;
606 break;
609 case eCSPacketIPV6Over802_1QVLAN:
610 case eCSPacketIPV6Over802_3Ethernet:
612 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV6_CS;
613 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3;
614 break;
617 default:
619 BCM_DEBUG_PRINT (Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error in value of CS Classification.. setting default to IP CS\n");
620 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
621 break;
625 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",
626 uiSearchRuleIndex,
627 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport,
628 Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport);
630 //Store IP Version used
631 //Get The Version Of IP used (IPv6 or IPv4) from CSSpecification field of SF
632 if(Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport == IPV6_CS)
634 Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion = IPV6;
636 else
638 Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion = IPV4;
641 /* To ensure that the ETH CS code doesn't gets executed if the BS doesn't supports ETH CS */
642 if(!Adapter->bETHCSEnabled)
643 Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 0;
645 if(psfLocalSet->u8ServiceClassNameLength > 0 &&
646 psfLocalSet->u8ServiceClassNameLength < 32)
648 memcpy(Adapter->PackInfo[uiSearchRuleIndex].ucServiceClassName,
649 psfLocalSet->u8ServiceClassName,
650 psfLocalSet->u8ServiceClassNameLength);
652 Adapter->PackInfo[uiSearchRuleIndex].u8QueueType =
653 psfLocalSet->u8ServiceFlowSchedulingType;
655 if(Adapter->PackInfo[uiSearchRuleIndex].u8QueueType==BE &&
656 Adapter->PackInfo[uiSearchRuleIndex].ucDirection)
658 Adapter->usBestEffortQueueIndex=uiSearchRuleIndex;
661 Adapter->PackInfo[uiSearchRuleIndex].ulSFID = ntohl(psfLocalSet->u32SFID);
663 Adapter->PackInfo[uiSearchRuleIndex].u8TrafficPriority = psfLocalSet->u8TrafficPriority;
665 //copy all the classifier in the Service Flow param structure
666 for(nIndex=0; nIndex<psfLocalSet->u8TotalClassifiers; nIndex++)
668 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Classifier index =%d",nIndex);
669 psfCSType = &psfLocalSet->cConvergenceSLTypes[nIndex];
670 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Classifier index =%d",nIndex);
672 if(psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority)
674 Adapter->PackInfo[uiSearchRuleIndex].bClassifierPriority=TRUE;
677 if(psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority)
679 Adapter->PackInfo[uiSearchRuleIndex].bClassifierPriority=TRUE;
683 if(ucDsxType== DSA_ACK)
685 eClassifierAction = eAddClassifier;
687 else if(ucDsxType == DSC_ACK)
689 switch(psfCSType->u8ClassfierDSCAction)
691 case 0://DSC Add Classifier
693 eClassifierAction = eAddClassifier;
695 break;
696 case 1://DSC Replace Classifier
698 eClassifierAction = eReplaceClassifier;
700 break;
701 case 2://DSC Delete Classifier
703 eClassifierAction = eDeleteClassifier;
706 break;
707 default:
709 eClassifierAction = eInvalidClassifierAction;
714 u16PacketClassificationRuleIndex = ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
716 switch(eClassifierAction)
718 case eAddClassifier:
720 //Get a Free Classifier Index From Classifier table for this SF to add the Classifier
721 //Contained in this message
722 nClassifierIndex = SearchClsid(Adapter,ulSFID,u16PacketClassificationRuleIndex);
724 if(nClassifierIndex > MAX_CLASSIFIERS)
726 nClassifierIndex = SearchFreeClsid(Adapter);
727 if(nClassifierIndex > MAX_CLASSIFIERS)
729 //Failed To get a free Entry
730 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error Failed To get a free Classifier Entry");
731 break;
733 //Copy the Classifier Rule for this service flow into our Classifier table maintained per SF.
734 CopyClassifierRuleToSF(Adapter,psfCSType,uiSearchRuleIndex,nClassifierIndex);
737 else
739 //This Classifier Already Exists and it is invalid to Add Classifier with existing PCRI
740 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"CopyToAdapter : Error The Specified Classifier Already Exists \
741 and attempted To Add Classifier with Same PCRI : 0x%x\n", u16PacketClassificationRuleIndex);
744 break;
746 case eReplaceClassifier:
748 //Get the Classifier Index From Classifier table for this SF and replace existing Classifier
749 //with the new classifier Contained in this message
750 nClassifierIndex = SearchClsid(Adapter,ulSFID,u16PacketClassificationRuleIndex);
751 if(nClassifierIndex > MAX_CLASSIFIERS)
753 //Failed To search the classifier
754 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error Search for Classifier To be replaced failed");
755 break;
757 //Copy the Classifier Rule for this service flow into our Classifier table maintained per SF.
758 CopyClassifierRuleToSF(Adapter,psfCSType,uiSearchRuleIndex,nClassifierIndex);
760 break;
762 case eDeleteClassifier:
764 //Get the Classifier Index From Classifier table for this SF and replace existing Classifier
765 //with the new classifier Contained in this message
766 nClassifierIndex = SearchClsid(Adapter,ulSFID,u16PacketClassificationRuleIndex);
767 if(nClassifierIndex > MAX_CLASSIFIERS)
769 //Failed To search the classifier
770 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error Search for Classifier To be deleted failed");
771 break;
774 //Delete This classifier
775 DeleteClassifierRuleFromSF(Adapter,uiSearchRuleIndex,nClassifierIndex);
777 break;
779 default:
781 //Invalid Action for classifier
782 break;
787 //Repeat parsing Classification Entries to process PHS Rules
788 for(nIndex=0; nIndex < psfLocalSet->u8TotalClassifiers; nIndex++)
790 psfCSType = &psfLocalSet->cConvergenceSLTypes[nIndex];
792 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "psfCSType->u8PhsDSCAction : 0x%x\n",
793 psfCSType->u8PhsDSCAction );
795 switch (psfCSType->u8PhsDSCAction)
797 case eDeleteAllPHSRules:
799 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Deleting All PHS Rules For VCID: 0x%X\n",uVCID);
801 //Delete All the PHS rules for this Service flow
803 PhsDeleteSFRules(
804 &Adapter->stBCMPhsContext,
805 uVCID);
807 break;
809 case eDeletePHSRule:
811 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"PHS DSC Action = Delete PHS Rule \n");
813 if(psfCSType->cPhsRule.u8PHSI)
815 PhsDeletePHSRule(
816 &Adapter->stBCMPhsContext,
817 uVCID,
818 psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
820 else
822 //BCM_DEBUG_PRINT(CONN_MSG,("Error CPHSRule.PHSI is ZERO \n"));
824 break;
826 default :
828 if(ucDsxType == DSC_ACK)
830 //BCM_DEBUG_PRINT(CONN_MSG,("Invalid PHS DSC Action For DSC \n",psfCSType->cPhsRule.u8PHSI));
831 break; //FOr DSC ACK Case PHS DSC Action must be in valid set
834 //Proceed To Add PHS rule for DSA_ACK case even if PHS DSC action is unspecified
835 //No Break Here . Intentionally!
837 case eAddPHSRule:
838 case eSetPHSRule:
840 if(psfCSType->cPhsRule.u8PHSI)
842 //Apply This PHS Rule to all classifiers whose Associated PHSI Match
843 unsigned int uiClassifierIndex = 0;
844 if(pstAddIndication->u8Direction == UPLINK_DIR )
846 for(uiClassifierIndex=0;uiClassifierIndex<MAX_CLASSIFIERS;uiClassifierIndex++)
848 if((Adapter->astClassifierTable[uiClassifierIndex].bUsed) &&
849 (Adapter->astClassifierTable[uiClassifierIndex].ulSFID == Adapter->PackInfo[uiSearchRuleIndex].ulSFID) &&
850 (Adapter->astClassifierTable[uiClassifierIndex].u8AssociatedPHSI == psfCSType->cPhsRule.u8PHSI))
852 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Adding PHS Rule For Classifier : 0x%x cPhsRule.u8PHSI : 0x%x\n",
853 Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex,
854 psfCSType->cPhsRule.u8PHSI);
855 //Update The PHS Rule for this classifier as Associated PHSI id defined
857 //Copy the PHS Rule
858 sPhsRule.u8PHSI = psfCSType->cPhsRule.u8PHSI;
859 sPhsRule.u8PHSFLength = psfCSType->cPhsRule.u8PHSFLength;
860 sPhsRule.u8PHSMLength = psfCSType->cPhsRule.u8PHSMLength;
861 sPhsRule.u8PHSS = psfCSType->cPhsRule.u8PHSS;
862 sPhsRule.u8PHSV = psfCSType->cPhsRule.u8PHSV;
863 memcpy(sPhsRule.u8PHSF,psfCSType->cPhsRule.u8PHSF,MAX_PHS_LENGTHS);
864 memcpy(sPhsRule.u8PHSM,psfCSType->cPhsRule.u8PHSM,MAX_PHS_LENGTHS);
865 sPhsRule.u8RefCnt = 0;
866 sPhsRule.bUnclassifiedPHSRule = FALSE;
867 sPhsRule.PHSModifiedBytes = 0;
868 sPhsRule.PHSModifiedNumPackets = 0;
869 sPhsRule.PHSErrorNumPackets = 0;
871 //bPHSRuleAssociated = TRUE;
872 //Store The PHS Rule for this classifier
874 PhsUpdateClassifierRule(
875 &Adapter->stBCMPhsContext,
876 uVCID,
877 Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex,
878 &sPhsRule,
879 Adapter->astClassifierTable[uiClassifierIndex].u8AssociatedPHSI);
881 //Update PHS Rule For the Classifier
882 if(sPhsRule.u8PHSI)
884 Adapter->astClassifierTable[uiClassifierIndex].u32PHSRuleID = sPhsRule.u8PHSI;
885 memcpy(&Adapter->astClassifierTable[uiClassifierIndex].sPhsRule,&sPhsRule,sizeof(S_PHS_RULE));
891 else
893 //Error PHS Rule specified in signaling could not be applied to any classifier
895 //Copy the PHS Rule
896 sPhsRule.u8PHSI = psfCSType->cPhsRule.u8PHSI;
897 sPhsRule.u8PHSFLength = psfCSType->cPhsRule.u8PHSFLength;
898 sPhsRule.u8PHSMLength = psfCSType->cPhsRule.u8PHSMLength;
899 sPhsRule.u8PHSS = psfCSType->cPhsRule.u8PHSS;
900 sPhsRule.u8PHSV = psfCSType->cPhsRule.u8PHSV;
901 memcpy(sPhsRule.u8PHSF,psfCSType->cPhsRule.u8PHSF,MAX_PHS_LENGTHS);
902 memcpy(sPhsRule.u8PHSM,psfCSType->cPhsRule.u8PHSM,MAX_PHS_LENGTHS);
903 sPhsRule.u8RefCnt = 0;
904 sPhsRule.bUnclassifiedPHSRule = TRUE;
905 sPhsRule.PHSModifiedBytes = 0;
906 sPhsRule.PHSModifiedNumPackets = 0;
907 sPhsRule.PHSErrorNumPackets = 0;
908 //Store The PHS Rule for this classifier
911 Passing the argument u8PHSI instead of clsid. Because for DL with no classifier rule,
912 clsid will be zero hence we cant have multiple PHS rules for the same SF.
913 To support multiple PHS rule, passing u8PHSI.
916 PhsUpdateClassifierRule(
917 &Adapter->stBCMPhsContext,
918 uVCID,
919 sPhsRule.u8PHSI,
920 &sPhsRule,
921 sPhsRule.u8PHSI);
927 break;
931 if(psfLocalSet->u32MaxSustainedTrafficRate == 0 )
933 //No Rate Limit . Set Max Sustained Traffic Rate to Maximum
934 Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate =
935 WIMAX_MAX_ALLOWED_RATE;
938 else if (ntohl(psfLocalSet->u32MaxSustainedTrafficRate) >
939 WIMAX_MAX_ALLOWED_RATE)
941 //Too large Allowed Rate specified. Limiting to Wi Max Allowed rate
942 Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate =
943 WIMAX_MAX_ALLOWED_RATE;
945 else
947 Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate =
948 ntohl(psfLocalSet->u32MaxSustainedTrafficRate);
951 Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency = ntohl(psfLocalSet->u32MaximumLatency);
953 if(Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency == 0) /* 0 should be treated as infinite */
954 Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency = MAX_LATENCY_ALLOWED;
957 if(( Adapter->PackInfo[uiSearchRuleIndex].u8QueueType == ERTPS ||
958 Adapter->PackInfo[uiSearchRuleIndex].u8QueueType == UGS ) )
959 UGIValue = ntohs(psfLocalSet->u16UnsolicitedGrantInterval);
961 if(UGIValue == 0)
962 UGIValue = DEFAULT_UG_INTERVAL;
965 For UGI based connections...
966 DEFAULT_UGI_FACTOR*UGIInterval worth of data is the max token count at host...
967 The extra amount of token is to ensure that a large amount of jitter won't have loss in throughput...
968 In case of non-UGI based connection, 200 frames worth of data is the max token count at host...
971 Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize =
972 (DEFAULT_UGI_FACTOR*Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate*UGIValue)/1000;
974 if(Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize < WIMAX_MAX_MTU*8)
976 UINT UGIFactor = 0;
977 /* Special Handling to ensure the biggest size of packet can go out from host to FW as follows:
978 1. Any packet from Host to FW can go out in different packet size.
979 2. So in case the Bucket count is smaller than MTU, the packets of size (Size > TokenCount), will get dropped.
980 3. We can allow packets of MaxSize from Host->FW that can go out from FW in multiple SDUs by fragmentation at Wimax Layer
982 UGIFactor = (Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency/UGIValue + 1);
984 if(UGIFactor > DEFAULT_UGI_FACTOR)
985 Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize =
986 (UGIFactor*Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate*UGIValue)/1000;
988 if(Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize > WIMAX_MAX_MTU*8)
989 Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize = WIMAX_MAX_MTU*8;
993 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"LAT: %d, UGI: %d \n", Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency, UGIValue);
994 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"uiMaxAllowedRate: 0x%x, u32MaxSustainedTrafficRate: 0x%x ,uiMaxBucketSize: 0x%x",
995 Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate,
996 ntohl(psfLocalSet->u32MaxSustainedTrafficRate),
997 Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize);
999 //copy the extended SF Parameters to Support MIBS
1000 CopyMIBSExtendedSFParameters(Adapter,psfLocalSet,uiSearchRuleIndex);
1002 //store header suppression enabled flag per SF
1003 Adapter->PackInfo[uiSearchRuleIndex].bHeaderSuppressionEnabled =
1004 !(psfLocalSet->u8RequesttransmissionPolicy &
1005 MASK_DISABLE_HEADER_SUPPRESSION);
1007 if(Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication)
1009 bcm_kfree(Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication);
1010 Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication = NULL;
1012 Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication = pstAddIndication;
1014 if(UPLINK_DIR == pstAddIndication->u8Direction &&
1015 Adapter->PackInfo[uiSearchRuleIndex].bActive)
1017 BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "Up link direction added...\n");
1018 atomic_set(&Adapter->PackInfo[uiSearchRuleIndex].uiPerSFTxResourceCount, DEFAULT_PERSFCOUNT);
1019 Adapter->ucDsxConnBitMap |= CONNECT_ON_ULSF;
1021 else if(DOWNLINK_DIR == pstAddIndication->u8Direction &&
1022 Adapter->PackInfo[uiSearchRuleIndex].bActive)
1024 BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "Down link direction added...\n");
1025 Adapter->ucDsxConnBitMap |= CONNECT_ON_DLSF;
1029 //Re Sort the SF list in PackInfo according to Traffic Priority
1030 SortPackInfo(Adapter);
1032 /* Re Sort the Classifier Rules table and re - arrange
1033 according to Classifier Rule Priority */
1034 SortClassifiers(Adapter);
1036 DumpPhsRules(&Adapter->stBCMPhsContext);
1039 // Check and See if we can say Linkup to the Operating System.
1041 CheckAndIndicateConnect(Adapter,pstAddIndication);
1043 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"%s <=====", __FUNCTION__);
1047 /***********************************************************************
1048 * Function - DumpCmControlPacket
1050 * Description - This routinue Dumps the Contents of the AddIndication
1051 * Structure in the Connection Management Control Packet
1053 * Parameter - pvBuffer: Pointer to the buffer containing the
1054 * AddIndication data.
1056 * Returns - None
1057 *************************************************************************/
1058 VOID DumpCmControlPacket(PVOID pvBuffer)
1060 UINT uiLoopIndex;
1061 UINT nIndex;
1062 stLocalSFAddIndicationAlt *pstAddIndication;
1063 UINT nCurClassifierCnt;
1064 PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
1066 pstAddIndication = (stLocalSFAddIndicationAlt *)pvBuffer;
1067 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "======>");
1069 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Type : 0x%X",pstAddIndication->u8Type);
1070 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Direction : 0x%X",pstAddIndication->u8Direction);
1071 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TID: 0x%X", ntohs(pstAddIndication->u16TID));
1072 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",ntohs(pstAddIndication->u16CID));
1073 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VCID : 0x%X",ntohs(pstAddIndication->u16VCID));
1075 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " AuthorizedSet--->");
1077 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID : 0x%X",htonl(pstAddIndication->sfAuthorizedSet.u32SFID));
1078 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",htons(pstAddIndication->sfAuthorizedSet.u16CID));
1079 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength : 0x%X",
1080 pstAddIndication->sfAuthorizedSet.u8ServiceClassNameLength);
1082 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",
1083 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[0],
1084 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[1],
1085 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[2],
1086 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[3],
1087 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[4],
1088 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[5]);
1090 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService : 0x%X",
1091 pstAddIndication->sfAuthorizedSet.u8MBSService);
1092 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet : 0x%X",
1093 pstAddIndication->sfAuthorizedSet.u8QosParamSet);
1094 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority : 0x%X, %p",
1095 pstAddIndication->sfAuthorizedSet.u8TrafficPriority, &pstAddIndication->sfAuthorizedSet.u8TrafficPriority);
1097 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxSustainedTrafficRate : 0x%X 0x%p",
1098 pstAddIndication->sfAuthorizedSet.u32MaxSustainedTrafficRate,
1099 &pstAddIndication->sfAuthorizedSet.u32MaxSustainedTrafficRate);
1101 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst : 0x%X",
1102 pstAddIndication->sfAuthorizedSet.u32MaxTrafficBurst);
1103 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate : 0x%X",
1104 pstAddIndication->sfAuthorizedSet.u32MinReservedTrafficRate);
1105 #if 0
1106 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinimumTolerableTrafficRate : 0x%X",
1107 pstAddIndication->sfAuthorizedSet.u32MinimumTolerableTrafficRate);
1108 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32RequesttransmissionPolicy : 0x%X",
1109 pstAddIndication->sfAuthorizedSet.u32RequesttransmissionPolicy);
1110 #endif
1111 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength : 0x%X",
1112 pstAddIndication->sfAuthorizedSet.u8VendorSpecificQoSParamLength);
1113 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam : 0x%X",
1114 pstAddIndication->sfAuthorizedSet.u8VendorSpecificQoSParam[0]);
1115 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType : 0x%X",
1116 pstAddIndication->sfAuthorizedSet.u8ServiceFlowSchedulingType);
1117 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter : 0x%X",
1118 pstAddIndication->sfAuthorizedSet.u32ToleratedJitter);
1119 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency : 0x%X",
1120 pstAddIndication->sfAuthorizedSet.u32MaximumLatency);
1121 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%X",
1122 pstAddIndication->sfAuthorizedSet.u8FixedLengthVSVariableLengthSDUIndicator);
1124 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize : 0x%X",
1125 pstAddIndication->sfAuthorizedSet.u8SDUSize);
1126 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TargetSAID : 0x%X",
1127 pstAddIndication->sfAuthorizedSet.u16TargetSAID);
1128 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQEnable : 0x%X",
1129 pstAddIndication->sfAuthorizedSet.u8ARQEnable);
1130 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQWindowSize : 0x%X",
1131 pstAddIndication->sfAuthorizedSet.u16ARQWindowSize);
1132 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryTxTimeOut : 0x%X",
1133 pstAddIndication->sfAuthorizedSet.u16ARQRetryTxTimeOut);
1134 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryRxTimeOut : 0x%X",
1135 pstAddIndication->sfAuthorizedSet.u16ARQRetryRxTimeOut);
1136 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockLifeTime : 0x%X",
1137 pstAddIndication->sfAuthorizedSet.u16ARQBlockLifeTime);
1138 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQSyncLossTimeOut : 0x%X",
1139 pstAddIndication->sfAuthorizedSet.u16ARQSyncLossTimeOut);
1140 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQDeliverInOrder : 0x%X",
1141 pstAddIndication->sfAuthorizedSet.u8ARQDeliverInOrder);
1142 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRxPurgeTimeOut : 0x%X",
1143 pstAddIndication->sfAuthorizedSet.u16ARQRxPurgeTimeOut);
1144 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockSize : 0x%X",
1145 pstAddIndication->sfAuthorizedSet.u16ARQBlockSize);
1146 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8CSSpecification : 0x%X",
1147 pstAddIndication->sfAuthorizedSet.u8CSSpecification);
1148 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TypeOfDataDeliveryService : 0x%X",
1149 pstAddIndication->sfAuthorizedSet.u8TypeOfDataDeliveryService);
1150 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16SDUInterArrivalTime : 0x%X",
1151 pstAddIndication->sfAuthorizedSet.u16SDUInterArrivalTime);
1152 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TimeBase : 0x%X",
1153 pstAddIndication->sfAuthorizedSet.u16TimeBase);
1154 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8PagingPreference : 0x%X",
1155 pstAddIndication->sfAuthorizedSet.u8PagingPreference);
1156 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UnsolicitedPollingInterval : 0x%X",
1157 pstAddIndication->sfAuthorizedSet.u16UnsolicitedPollingInterval);
1158 #if 0
1159 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "MBSZoneIdentifierassignmentLength : 0x%X",
1160 pstAddIndication->sfAuthorizedSet.MBSZoneIdentifierassignmentLength);
1161 for(uiLoopIndex=0; uiLoopIndex < MAX_STRING_LEN; uiLoopIndex++)
1162 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "MBSZoneIdentifierassignment : 0x%X",
1163 pstAddIndication->sfAuthorizedSet.MBSZoneIdentifierassignment[uiLoopIndex]);
1164 #endif
1166 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "sfAuthorizedSet.u8HARQChannelMapping %x %x %x ",
1167 *(unsigned int*)pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping,
1168 *(unsigned int*)&pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping[4],
1169 *(USHORT*) &pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping[8]);
1170 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficIndicationPreference : 0x%X",
1171 pstAddIndication->sfAuthorizedSet.u8TrafficIndicationPreference);
1173 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Recieved : 0x%X",pstAddIndication->sfAuthorizedSet.u8TotalClassifiers);
1175 nCurClassifierCnt = pstAddIndication->sfAuthorizedSet.u8TotalClassifiers;
1177 if(nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
1179 nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
1181 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "pstAddIndication->sfAuthorizedSet.bValid %d", pstAddIndication->sfAuthorizedSet.bValid);
1182 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "pstAddIndication->sfAuthorizedSet.u16MacOverhead %x", pstAddIndication->sfAuthorizedSet.u16MacOverhead);
1183 if(!pstAddIndication->sfAuthorizedSet.bValid)
1184 pstAddIndication->sfAuthorizedSet.bValid=1;
1185 for(nIndex = 0 ; nIndex < nCurClassifierCnt ; nIndex++)
1187 stConvergenceSLTypes *psfCSType = NULL;
1188 psfCSType = &pstAddIndication->sfAuthorizedSet.cConvergenceSLTypes[nIndex];
1190 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "psfCSType = %p", psfCSType);
1191 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "CCPacketClassificationRuleSI====>");
1193 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ClassifierRulePriority :0x%X ",
1194 psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
1195 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfServiceLength :0x%X ",
1196 psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
1198 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfService[3] :0x%X ,0x%X ,0x%X ",
1199 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0],
1200 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1],
1201 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]);
1202 #if 0
1204 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "u8ProtocolLength :0x%X ",
1205 psfCSType->cCPacketClassificationRule.u8ProtocolLength);
1206 #endif
1208 for(uiLoopIndex=0; uiLoopIndex < 1; uiLoopIndex++)
1209 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Protocol : 0x%02X ",
1210 psfCSType->cCPacketClassificationRule.u8Protocol);
1212 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength :0x%X ",
1213 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
1215 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1216 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32] : 0x%02X ",
1217 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
1219 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength : 0x%X ",
1220 psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
1222 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1223 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddress[32] : 0x%02X ",
1224 psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
1226 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRangeLength:0x%X ",
1227 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
1228 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRange[4]: 0x%02X ,0x%02X ,0x%02X ,0x%02X ",
1229 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0],
1230 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1],
1231 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2],
1232 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]);
1234 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRangeLength : 0x%02X ",
1235 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength);
1236 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRange[4]: 0x%02X ,0x%02X ,0x%02X ,0x%02X ",
1237 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0],
1238 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1],
1239 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2],
1240 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]);
1242 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddressLength : 0x%02X ",
1243 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1245 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
1246 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0],
1247 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1],
1248 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2],
1249 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3],
1250 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4],
1251 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]);
1253 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddressLength : 0x%02X ",
1254 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1256 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
1257 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0],
1258 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1],
1259 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2],
1260 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3],
1261 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4],
1262 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]);
1264 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthertypeLength : 0x%02X ",
1265 psfCSType->cCPacketClassificationRule.u8EthertypeLength);
1266 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Ethertype[3] : 0x%02X ,0x%02X ,0x%02X ",
1267 psfCSType->cCPacketClassificationRule.u8Ethertype[0],
1268 psfCSType->cCPacketClassificationRule.u8Ethertype[1],
1269 psfCSType->cCPacketClassificationRule.u8Ethertype[2]);
1271 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UserPriority : 0x%X ",
1272 psfCSType->cCPacketClassificationRule.u16UserPriority);
1274 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VLANID : 0x%X ",
1275 psfCSType->cCPacketClassificationRule.u16VLANID);
1277 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8AssociatedPHSI : 0x%02X ",
1278 psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
1280 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16PacketClassificationRuleIndex : 0x%X ",
1281 psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
1283 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParamLength : 0x%X ",
1284 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength);
1286 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParam[1] : 0x%X ",
1287 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]);
1288 #ifdef VERSION_D5
1289 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLableLength :0x%X ",
1290 psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength);
1291 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLable[6] : 0x %02X %02X %02X %02X %02X %02X ",
1292 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0],
1293 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1],
1294 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2],
1295 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3],
1296 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4],
1297 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]);
1298 #endif
1301 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "bValid : 0x%02X",pstAddIndication->sfAuthorizedSet.bValid);
1303 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "AdmittedSet--->");
1304 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID : 0x%X",pstAddIndication->sfAdmittedSet.u32SFID);
1305 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",pstAddIndication->sfAdmittedSet.u16CID);
1306 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength : 0x%X",
1307 pstAddIndication->sfAdmittedSet.u8ServiceClassNameLength);
1308 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassName : 0x %02X %02X %02X %02X %02X %02X",
1309 pstAddIndication->sfAdmittedSet.u8ServiceClassName[0],
1310 pstAddIndication->sfAdmittedSet.u8ServiceClassName[1],
1311 pstAddIndication->sfAdmittedSet.u8ServiceClassName[2],
1312 pstAddIndication->sfAdmittedSet.u8ServiceClassName[3],
1313 pstAddIndication->sfAdmittedSet.u8ServiceClassName[4],
1314 pstAddIndication->sfAdmittedSet.u8ServiceClassName[5]);
1316 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService : 0x%02X",
1317 pstAddIndication->sfAdmittedSet.u8MBSService);
1318 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet : 0x%02X",
1319 pstAddIndication->sfAdmittedSet.u8QosParamSet);
1320 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority : 0x%02X",
1321 pstAddIndication->sfAdmittedSet.u8TrafficPriority);
1322 #if 0
1323 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "u32MaxSustainedTrafficRate : 0x%02X",
1324 ntohl(pstAddIndication->sfAdmittedSet.u32MaxSustainedTrafficRate));
1325 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "u32MinimumTolerableTrafficRate : 0x%X",
1326 pstAddIndication->sfAdmittedSet.u32MinimumTolerableTrafficRate);
1327 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "u32RequesttransmissionPolicy : 0x%X",
1328 pstAddIndication->sfAdmittedSet.u32RequesttransmissionPolicy);
1329 #endif
1330 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst : 0x%X",
1331 pstAddIndication->sfAdmittedSet.u32MaxTrafficBurst);
1332 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate : 0x%X",
1333 pstAddIndication->sfAdmittedSet.u32MinReservedTrafficRate);
1335 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength : 0x%02X",
1336 pstAddIndication->sfAdmittedSet.u8VendorSpecificQoSParamLength);
1337 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam : 0x%02X",
1338 pstAddIndication->sfAdmittedSet.u8VendorSpecificQoSParam[0]);
1339 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType : 0x%02X",
1340 pstAddIndication->sfAdmittedSet.u8ServiceFlowSchedulingType);
1342 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter : 0x%X",
1343 pstAddIndication->sfAdmittedSet.u32ToleratedJitter);
1344 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency : 0x%X",
1345 pstAddIndication->sfAdmittedSet.u32MaximumLatency);
1347 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%02X",
1348 pstAddIndication->sfAdmittedSet.u8FixedLengthVSVariableLengthSDUIndicator);
1349 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize : 0x%02X",
1350 pstAddIndication->sfAdmittedSet.u8SDUSize);
1351 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TargetSAID : 0x%02X",
1352 pstAddIndication->sfAdmittedSet.u16TargetSAID);
1353 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQEnable : 0x%02X",
1354 pstAddIndication->sfAdmittedSet.u8ARQEnable);
1356 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQWindowSize : 0x%X",
1357 pstAddIndication->sfAdmittedSet.u16ARQWindowSize);
1358 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryTxTimeOut : 0x%X",
1359 pstAddIndication->sfAdmittedSet.u16ARQRetryTxTimeOut);
1360 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryRxTimeOut : 0x%X",
1361 pstAddIndication->sfAdmittedSet.u16ARQRetryRxTimeOut);
1362 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockLifeTime : 0x%X",
1363 pstAddIndication->sfAdmittedSet.u16ARQBlockLifeTime);
1364 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQSyncLossTimeOut : 0x%X",
1365 pstAddIndication->sfAdmittedSet.u16ARQSyncLossTimeOut);
1367 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQDeliverInOrder : 0x%02X",
1368 pstAddIndication->sfAdmittedSet.u8ARQDeliverInOrder);
1369 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRxPurgeTimeOut : 0x%X",
1370 pstAddIndication->sfAdmittedSet.u16ARQRxPurgeTimeOut);
1371 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockSize : 0x%X",
1372 pstAddIndication->sfAdmittedSet.u16ARQBlockSize);
1373 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8CSSpecification : 0x%02X",
1374 pstAddIndication->sfAdmittedSet.u8CSSpecification);
1375 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TypeOfDataDeliveryService : 0x%02X",
1376 pstAddIndication->sfAdmittedSet.u8TypeOfDataDeliveryService);
1377 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16SDUInterArrivalTime : 0x%X",
1378 pstAddIndication->sfAdmittedSet.u16SDUInterArrivalTime);
1379 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TimeBase : 0x%X",
1380 pstAddIndication->sfAdmittedSet.u16TimeBase);
1381 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8PagingPreference : 0x%X",
1382 pstAddIndication->sfAdmittedSet.u8PagingPreference);
1383 #if 0
1384 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "MBSZoneIdentifierassignmentLength : 0x%X",
1385 pstAddIndication->sfAdmittedSet.MBSZoneIdentifierassignmentLength);
1386 for(uiLoopIndex=0; uiLoopIndex < MAX_STRING_LEN; uiLoopIndex++)
1387 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "MBSZoneIdentifierassignment : 0x%X",
1388 pstAddIndication->sfAdmittedSet.MBSZoneIdentifierassignment[uiLoopIndex]);
1389 #endif
1392 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficIndicationPreference : 0x%02X",
1393 pstAddIndication->sfAdmittedSet.u8TrafficIndicationPreference);
1395 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Recieved : 0x%X",pstAddIndication->sfAdmittedSet.u8TotalClassifiers);
1397 nCurClassifierCnt = pstAddIndication->sfAdmittedSet.u8TotalClassifiers;
1399 if(nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
1401 nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
1405 for(nIndex = 0 ; nIndex < nCurClassifierCnt ; nIndex++)
1408 stConvergenceSLTypes *psfCSType = NULL;
1409 psfCSType = &pstAddIndication->sfAdmittedSet.cConvergenceSLTypes[nIndex];
1411 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " CCPacketClassificationRuleSI====>");
1413 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ClassifierRulePriority :0x%02X ",
1414 psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
1415 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfServiceLength :0x%02X",
1416 psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
1418 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfService[3] :0x%02X %02X %02X",
1419 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0],
1420 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1],
1421 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]);
1422 #if 0
1424 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolLength :0x%02X ",
1425 psfCSType->cCPacketClassificationRule.u8ProtocolLength);
1426 #endif
1427 for(uiLoopIndex=0; uiLoopIndex < 1; uiLoopIndex++)
1428 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Protocol: 0x%02X ",
1429 psfCSType->cCPacketClassificationRule.u8Protocol);
1431 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength :0x%02X ",
1432 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
1434 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1435 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32] : 0x%02X ",
1436 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
1438 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength : 0x%02X ",
1439 psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
1441 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1442 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddress[32] : 0x%02X ",
1443 psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
1445 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRangeLength : 0x%02X ",
1446 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
1448 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRange[4] : 0x %02X %02X %02X %02X ",
1449 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0],
1450 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1],
1451 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2],
1452 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]);
1454 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRangeLength : 0x%02X ",
1455 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength);
1457 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRange[4] : 0x %02X %02X %02X %02X ",
1458 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0],
1459 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1],
1460 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2],
1461 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]);
1463 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddressLength : 0x%02X ",
1464 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1466 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
1467 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0],
1468 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1],
1469 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2],
1470 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3],
1471 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4],
1472 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]);
1474 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddressLength : 0x%02X ",
1475 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1477 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
1478 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0],
1479 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1],
1480 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2],
1481 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3],
1482 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4],
1483 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]);
1485 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthertypeLength : 0x%02X ",
1486 psfCSType->cCPacketClassificationRule.u8EthertypeLength);
1487 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Ethertype[3] : 0x%02X %02X %02X",
1488 psfCSType->cCPacketClassificationRule.u8Ethertype[0],
1489 psfCSType->cCPacketClassificationRule.u8Ethertype[1],
1490 psfCSType->cCPacketClassificationRule.u8Ethertype[2]);
1492 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UserPriority : 0x%X ",
1493 psfCSType->cCPacketClassificationRule.u16UserPriority);
1494 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VLANID : 0x%X ",
1495 psfCSType->cCPacketClassificationRule.u16VLANID);
1496 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8AssociatedPHSI : 0x%02X ",
1497 psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
1498 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16PacketClassificationRuleIndex : 0x%X ",
1499 psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
1501 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParamLength : 0x%02X",
1502 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength);
1503 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParam[1] : 0x%02X ",
1504 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]);
1505 #ifdef VERSION_D5
1506 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLableLength : 0x%X ",
1507 psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength);
1508 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLable[6] : 0x %02X %02X %02X %02X %02X %02X ",
1509 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0],
1510 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1],
1511 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2],
1512 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3],
1513 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4],
1514 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]);
1515 #endif
1518 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "bValid : 0x%X",pstAddIndication->sfAdmittedSet.bValid);
1520 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " ActiveSet--->");
1521 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID : 0x%X",pstAddIndication->sfActiveSet.u32SFID);
1522 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",pstAddIndication->sfActiveSet.u16CID);
1524 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength : 0x%X",
1525 pstAddIndication->sfActiveSet.u8ServiceClassNameLength);
1527 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassName : 0x %02X %02X %02X %02X %02X %02X",
1528 pstAddIndication->sfActiveSet.u8ServiceClassName[0],
1529 pstAddIndication->sfActiveSet.u8ServiceClassName[1],
1530 pstAddIndication->sfActiveSet.u8ServiceClassName[2],
1531 pstAddIndication->sfActiveSet.u8ServiceClassName[3],
1532 pstAddIndication->sfActiveSet.u8ServiceClassName[4],
1533 pstAddIndication->sfActiveSet.u8ServiceClassName[5]);
1535 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService : 0x%02X",
1536 pstAddIndication->sfActiveSet.u8MBSService);
1537 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet : 0x%02X",
1538 pstAddIndication->sfActiveSet.u8QosParamSet);
1539 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority : 0x%02X",
1540 pstAddIndication->sfActiveSet.u8TrafficPriority);
1541 #if 0
1542 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "u32MaxSustainedTrafficRate : 0x%02X",
1543 ntohl(pstAddIndication->sfActiveSet.u32MaxSustainedTrafficRate));
1544 #endif
1545 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst : 0x%X",
1546 pstAddIndication->sfActiveSet.u32MaxTrafficBurst);
1547 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate : 0x%X",
1548 pstAddIndication->sfActiveSet.u32MinReservedTrafficRate);
1549 #if 0
1550 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "u32MinimumTolerableTrafficRate : 0x%X",
1551 pstAddIndication->sfActiveSet.u32MinimumTolerableTrafficRate);
1552 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "u32RequesttransmissionPolicy : 0x%X",
1553 pstAddIndication->sfActiveSet.u32RequesttransmissionPolicy);
1554 #endif
1555 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength : 0x%02X",
1556 pstAddIndication->sfActiveSet.u8VendorSpecificQoSParamLength);
1557 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam : 0x%02X",
1558 pstAddIndication->sfActiveSet.u8VendorSpecificQoSParam[0]);
1559 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType : 0x%02X",
1560 pstAddIndication->sfActiveSet.u8ServiceFlowSchedulingType);
1562 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter : 0x%X",
1563 pstAddIndication->sfActiveSet.u32ToleratedJitter);
1564 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency : 0x%X",
1565 pstAddIndication->sfActiveSet.u32MaximumLatency);
1567 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%02X",
1568 pstAddIndication->sfActiveSet.u8FixedLengthVSVariableLengthSDUIndicator);
1570 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize : 0x%X",
1571 pstAddIndication->sfActiveSet.u8SDUSize);
1572 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16TargetSAID : 0x%X",
1573 pstAddIndication->sfActiveSet.u16TargetSAID);
1574 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ARQEnable : 0x%X",
1575 pstAddIndication->sfActiveSet.u8ARQEnable);
1576 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQWindowSize : 0x%X",
1577 pstAddIndication->sfActiveSet.u16ARQWindowSize);
1578 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRetryTxTimeOut : 0x%X",
1579 pstAddIndication->sfActiveSet.u16ARQRetryTxTimeOut);
1580 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRetryRxTimeOut : 0x%X",
1581 pstAddIndication->sfActiveSet.u16ARQRetryRxTimeOut);
1582 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQBlockLifeTime : 0x%X",
1583 pstAddIndication->sfActiveSet.u16ARQBlockLifeTime);
1584 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQSyncLossTimeOut : 0x%X",
1585 pstAddIndication->sfActiveSet.u16ARQSyncLossTimeOut);
1586 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ARQDeliverInOrder : 0x%X",
1587 pstAddIndication->sfActiveSet.u8ARQDeliverInOrder);
1588 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRxPurgeTimeOut : 0x%X",
1589 pstAddIndication->sfActiveSet.u16ARQRxPurgeTimeOut);
1590 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQBlockSize : 0x%X",
1591 pstAddIndication->sfActiveSet.u16ARQBlockSize);
1592 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8CSSpecification : 0x%X",
1593 pstAddIndication->sfActiveSet.u8CSSpecification);
1594 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8TypeOfDataDeliveryService : 0x%X",
1595 pstAddIndication->sfActiveSet.u8TypeOfDataDeliveryService);
1596 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16SDUInterArrivalTime : 0x%X",
1597 pstAddIndication->sfActiveSet.u16SDUInterArrivalTime);
1598 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16TimeBase : 0x%X",
1599 pstAddIndication->sfActiveSet.u16TimeBase);
1600 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8PagingPreference : 0x%X",
1601 pstAddIndication->sfActiveSet.u8PagingPreference);
1602 #if 0
1603 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " MBSZoneIdentifierassignmentLength : 0x%X",
1604 pstAddIndication->sfActiveSet.MBSZoneIdentifierassignmentLength);
1605 for(uiLoopIndex=0; uiLoopIndex < MAX_STRING_LEN; uiLoopIndex++)
1606 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " MBSZoneIdentifierassignment : 0x%X",
1607 pstAddIndication->sfActiveSet.MBSZoneIdentifierassignment[uiLoopIndex]);
1608 #endif
1611 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8TrafficIndicationPreference : 0x%X",
1612 pstAddIndication->sfActiveSet.u8TrafficIndicationPreference);
1614 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Recieved : 0x%X",pstAddIndication->sfActiveSet.u8TotalClassifiers);
1616 nCurClassifierCnt = pstAddIndication->sfActiveSet.u8TotalClassifiers;
1618 if(nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
1620 nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
1623 for(nIndex = 0 ; nIndex < nCurClassifierCnt ; nIndex++)
1626 stConvergenceSLTypes *psfCSType = NULL;
1627 psfCSType = &pstAddIndication->sfActiveSet.cConvergenceSLTypes[nIndex];
1630 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " CCPacketClassificationRuleSI====>");
1632 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ClassifierRulePriority :0x%X ",
1633 psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
1634 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPTypeOfServiceLength :0x%X ",
1635 psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
1637 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPTypeOfService[3] :0x%X ,0x%X ,0x%X ",
1638 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0],
1639 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1],
1640 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]);
1641 #if 0
1643 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " u8ProtocolLength :0x%X ",
1644 psfCSType->cCPacketClassificationRule.u8ProtocolLength);
1645 #endif
1646 for(uiLoopIndex=0; uiLoopIndex < 1; uiLoopIndex++)
1647 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8Protocol : 0x%X ",
1648 psfCSType->cCPacketClassificationRule.u8Protocol);
1650 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength :0x%X ",
1651 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
1653 for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
1654 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32]:0x%X ",
1655 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
1657 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength : 0x%02X ",
1658 psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
1660 for(uiLoopIndex=0;uiLoopIndex<32;uiLoopIndex++)
1661 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPDestinationAddress[32]:0x%X ",
1662 psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
1664 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolSourcePortRangeLength:0x%X ",
1665 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
1667 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolSourcePortRange[4]:0x%X ,0x%X ,0x%X ,0x%X ",
1668 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0],
1669 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1],
1670 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2],
1671 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]);
1673 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolDestPortRangeLength:0x%X ",
1674 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength);
1676 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolDestPortRange[4]:0x%X ,0x%X ,0x%X ,0x%X ",
1677 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0],
1678 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1],
1679 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2],
1680 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]);
1682 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthernetDestMacAddressLength:0x%X ",
1683 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1685 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",
1686 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0],
1687 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1],
1688 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2],
1689 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3],
1690 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4],
1691 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]);
1693 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthernetSourceMACAddressLength:0x%X ",
1694 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1696 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",
1697 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0],
1698 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1],
1699 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2],
1700 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3],
1701 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4],
1702 psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]);
1704 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthertypeLength :0x%X ",
1705 psfCSType->cCPacketClassificationRule.u8EthertypeLength);
1706 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8Ethertype[3] :0x%X ,0x%X ,0x%X ",
1707 psfCSType->cCPacketClassificationRule.u8Ethertype[0],
1708 psfCSType->cCPacketClassificationRule.u8Ethertype[1],
1709 psfCSType->cCPacketClassificationRule.u8Ethertype[2]);
1710 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16UserPriority :0x%X ",
1711 psfCSType->cCPacketClassificationRule.u16UserPriority);
1712 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16VLANID :0x%X ",
1713 psfCSType->cCPacketClassificationRule.u16VLANID);
1714 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8AssociatedPHSI :0x%X ",
1715 psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
1716 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16PacketClassificationRuleIndex:0x%X ",
1717 psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
1719 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8VendorSpecificClassifierParamLength:0x%X ",
1720 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength);
1721 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8VendorSpecificClassifierParam[1]:0x%X ",
1722 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]);
1723 #ifdef VERSION_D5
1724 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPv6FlowLableLength :0x%X ",
1725 psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength);
1726 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 ",
1727 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0],
1728 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1],
1729 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2],
1730 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3],
1731 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4],
1732 psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]);
1733 #endif
1736 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " bValid : 0x%X",pstAddIndication->sfActiveSet.bValid);
1740 static inline ULONG RestoreSFParam(PMINI_ADAPTER Adapter, ULONG ulAddrSFParamSet,PUCHAR pucDestBuffer)
1742 UINT nBytesToRead = sizeof(stServiceFlowParamSI);
1744 if(ulAddrSFParamSet == 0 || NULL == pucDestBuffer)
1746 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Got Param address as 0!!");
1747 return 0;
1749 ulAddrSFParamSet = ntohl(ulAddrSFParamSet);
1750 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " RestoreSFParam: Total Words of DSX Message To Read: 0x%x From Target At : 0x%lx ",
1751 nBytesToRead/sizeof(ULONG),ulAddrSFParamSet);
1752 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "sizeof(stServiceFlowParamSI) = %x", sizeof(stServiceFlowParamSI));
1754 //Read out the SF Param Set At the indicated Location
1755 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "nBytesToRead = %x", nBytesToRead);
1756 if(rdm(Adapter, ulAddrSFParamSet, (PUCHAR)pucDestBuffer, nBytesToRead) < 0)
1757 return STATUS_FAILURE;
1759 return 1;
1763 static __inline ULONG StoreSFParam(PMINI_ADAPTER Adapter,PUCHAR pucSrcBuffer,ULONG ulAddrSFParamSet)
1765 UINT nBytesToWrite = sizeof(stServiceFlowParamSI);
1766 UINT uiRetVal =0;
1768 if(ulAddrSFParamSet == 0 || NULL == pucSrcBuffer)
1770 return 0;
1772 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " StoreSFParam: Total Words of DSX Message To Write: 0x%X To Target At : 0x%lX ",(nBytesToWrite/sizeof(ULONG)),ulAddrSFParamSet);
1774 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "WRM with %x bytes",nBytesToWrite);
1776 uiRetVal = wrm(Adapter,ulAddrSFParamSet,(PUCHAR)pucSrcBuffer, nBytesToWrite);
1777 if(uiRetVal < 0) {
1778 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "%s:%d WRM failed",__FUNCTION__, __LINE__);
1779 return uiRetVal;
1781 return 1;
1784 ULONG StoreCmControlResponseMessage(PMINI_ADAPTER Adapter,PVOID pvBuffer,UINT *puBufferLength)
1786 stLocalSFAddIndicationAlt *pstAddIndicationAlt = NULL;
1787 stLocalSFAddIndication * pstAddIndication = NULL;
1788 stLocalSFDeleteRequest *pstDeletionRequest;
1789 UINT uiSearchRuleIndex;
1790 ULONG ulSFID;
1792 pstAddIndicationAlt = (stLocalSFAddIndicationAlt *)(pvBuffer);
1795 * In case of DSD Req By MS, we should immediately delete this SF so that
1796 * we can stop the further classifying the pkt for this SF.
1798 if(pstAddIndicationAlt->u8Type == DSD_REQ)
1800 pstDeletionRequest = (stLocalSFDeleteRequest *)pvBuffer;
1802 ulSFID = ntohl(pstDeletionRequest->u32SFID);
1803 uiSearchRuleIndex=SearchSfid(Adapter,ulSFID);
1805 if(uiSearchRuleIndex < NO_OF_QUEUES)
1807 deleteSFBySfid(Adapter,uiSearchRuleIndex);
1808 Adapter->u32TotalDSD++;
1810 return 1;
1814 if( (pstAddIndicationAlt->u8Type == DSD_RSP) ||
1815 (pstAddIndicationAlt->u8Type == DSD_ACK))
1817 //No Special handling send the message as it is
1818 return 1;
1820 // For DSA_REQ, only upto "psfAuthorizedSet" parameter should be accessed by driver!
1822 pstAddIndication=(stLocalSFAddIndication *)kmalloc(sizeof(*pstAddIndication), GFP_KERNEL);
1823 if(NULL==pstAddIndication)
1824 return 0;
1826 /* AUTHORIZED SET */
1827 pstAddIndication->psfAuthorizedSet = (stServiceFlowParamSI *)
1828 GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID);
1829 if(!pstAddIndication->psfAuthorizedSet)
1830 return 0;
1832 if(StoreSFParam(Adapter,(PUCHAR)&pstAddIndicationAlt->sfAuthorizedSet,
1833 (ULONG)pstAddIndication->psfAuthorizedSet)!= 1)
1834 return 0;
1836 pstAddIndication->psfAuthorizedSet = (stServiceFlowParamSI *)
1837 ntohl((ULONG)pstAddIndication->psfAuthorizedSet);
1839 if(pstAddIndicationAlt->u8Type == DSA_REQ)
1841 stLocalSFAddRequest AddRequest;
1843 AddRequest.u8Type = pstAddIndicationAlt->u8Type;
1844 AddRequest.eConnectionDir = pstAddIndicationAlt->u8Direction;
1845 AddRequest.u16TID = pstAddIndicationAlt->u16TID;
1846 AddRequest.u16CID = pstAddIndicationAlt->u16CID;
1847 AddRequest.u16VCID = pstAddIndicationAlt->u16VCID;
1848 AddRequest.psfParameterSet =pstAddIndication->psfAuthorizedSet ;
1849 (*puBufferLength) = sizeof(stLocalSFAddRequest);
1850 memcpy(pvBuffer,&AddRequest,sizeof(stLocalSFAddRequest));
1851 return 1;
1854 // Since it's not DSA_REQ, we can access all field in pstAddIndicationAlt
1856 //We need to extract the structure from the buffer and pack it differently
1858 pstAddIndication->u8Type = pstAddIndicationAlt->u8Type;
1859 pstAddIndication->eConnectionDir= pstAddIndicationAlt->u8Direction ;
1860 pstAddIndication->u16TID = pstAddIndicationAlt->u16TID;
1861 pstAddIndication->u16CID = pstAddIndicationAlt->u16CID;
1862 pstAddIndication->u16VCID = pstAddIndicationAlt->u16VCID;
1863 pstAddIndication->u8CC = pstAddIndicationAlt->u8CC;
1865 /* ADMITTED SET */
1866 pstAddIndication->psfAdmittedSet = (stServiceFlowParamSI *)
1867 GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID);
1868 if(!pstAddIndication->psfAdmittedSet)
1869 return 0;
1870 if(StoreSFParam(Adapter,(PUCHAR)&pstAddIndicationAlt->sfAdmittedSet,(ULONG)pstAddIndication->psfAdmittedSet) != 1)
1871 return 0;
1873 pstAddIndication->psfAdmittedSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfAdmittedSet);
1876 /* ACTIVE SET */
1877 pstAddIndication->psfActiveSet = (stServiceFlowParamSI *)
1878 GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID);
1879 if(!pstAddIndication->psfActiveSet)
1880 return 0;
1881 if(StoreSFParam(Adapter,(PUCHAR)&pstAddIndicationAlt->sfActiveSet,(ULONG)pstAddIndication->psfActiveSet) != 1)
1882 return 0;
1884 pstAddIndication->psfActiveSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfActiveSet);
1886 (*puBufferLength) = sizeof(stLocalSFAddIndication);
1887 *(stLocalSFAddIndication *)pvBuffer = *pstAddIndication;
1888 bcm_kfree(pstAddIndication);
1889 return 1;
1893 static inline stLocalSFAddIndicationAlt
1894 *RestoreCmControlResponseMessage(register PMINI_ADAPTER Adapter,register PVOID pvBuffer)
1896 ULONG ulStatus=0;
1897 stLocalSFAddIndication *pstAddIndication = NULL;
1898 stLocalSFAddIndicationAlt *pstAddIndicationDest = NULL;
1899 pstAddIndication = (stLocalSFAddIndication *)(pvBuffer);
1901 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "=====>" );
1902 if ((pstAddIndication->u8Type == DSD_REQ) ||
1903 (pstAddIndication->u8Type == DSD_RSP) ||
1904 (pstAddIndication->u8Type == DSD_ACK))
1906 return (stLocalSFAddIndicationAlt *)pvBuffer;
1909 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Inside RestoreCmControlResponseMessage ");
1911 //Need to Allocate memory to contain the SUPER Large structures
1912 //Our driver cant create these structures on Stack :(
1914 pstAddIndicationDest=kmalloc(sizeof(stLocalSFAddIndicationAlt), GFP_KERNEL);
1916 if(pstAddIndicationDest)
1918 memset(pstAddIndicationDest,0,sizeof(stLocalSFAddIndicationAlt));
1920 else
1922 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Failed to allocate memory for SF Add Indication Structure ");
1923 return NULL;
1925 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8Type : 0x%X",pstAddIndication->u8Type);
1926 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8Direction : 0x%X",pstAddIndication->eConnectionDir);
1927 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8TID : 0x%X",ntohs(pstAddIndication->u16TID));
1928 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8CID : 0x%X",ntohs(pstAddIndication->u16CID));
1929 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u16VCID : 0x%X",ntohs(pstAddIndication->u16VCID));
1930 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-autorized set loc : 0x%x",ntohl(pstAddIndication->psfAuthorizedSet));
1931 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-admitted set loc : 0x%x",ntohl(pstAddIndication->psfAdmittedSet));
1932 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-Active set loc : 0x%x",ntohl(pstAddIndication->psfActiveSet));
1934 pstAddIndicationDest->u8Type = pstAddIndication->u8Type;
1935 pstAddIndicationDest->u8Direction = pstAddIndication->eConnectionDir;
1936 pstAddIndicationDest->u16TID = pstAddIndication->u16TID;
1937 pstAddIndicationDest->u16CID = pstAddIndication->u16CID;
1938 pstAddIndicationDest->u16VCID = pstAddIndication->u16VCID;
1939 pstAddIndicationDest->u8CC = pstAddIndication->u8CC;
1941 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Active Set ");
1942 ulStatus=RestoreSFParam(Adapter,(ULONG)pstAddIndication->psfActiveSet, (PUCHAR)&pstAddIndicationDest->sfActiveSet);
1943 if(ulStatus != 1)
1945 goto failed_restore_sf_param;
1947 if(pstAddIndicationDest->sfActiveSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
1948 pstAddIndicationDest->sfActiveSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF;
1950 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Admitted Set ");
1951 ulStatus=RestoreSFParam(Adapter,(ULONG)pstAddIndication->psfAdmittedSet,(PUCHAR)&pstAddIndicationDest->sfAdmittedSet);
1952 if(ulStatus != 1)
1954 goto failed_restore_sf_param;
1956 if(pstAddIndicationDest->sfAdmittedSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
1957 pstAddIndicationDest->sfAdmittedSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF;
1959 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Authorized Set ");
1960 ulStatus=RestoreSFParam(Adapter,(ULONG)pstAddIndication->psfAuthorizedSet,(PUCHAR)&pstAddIndicationDest->sfAuthorizedSet);
1961 if(ulStatus != 1)
1963 goto failed_restore_sf_param;
1965 if(pstAddIndicationDest->sfAuthorizedSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
1966 pstAddIndicationDest->sfAuthorizedSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF;
1968 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Dumping the whole raw packet");
1969 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "============================================================");
1970 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " pstAddIndicationDest->sfActiveSet size %x %p", sizeof(*pstAddIndicationDest), pstAddIndicationDest);
1971 //BCM_DEBUG_PRINT_BUFFER(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, (unsigned char *)pstAddIndicationDest, sizeof(*pstAddIndicationDest));
1972 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "============================================================");
1973 return pstAddIndicationDest;
1974 failed_restore_sf_param:
1975 bcm_kfree(pstAddIndicationDest);
1976 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "<=====" );
1977 return NULL;
1980 ULONG SetUpTargetDsxBuffers(PMINI_ADAPTER Adapter)
1982 ULONG ulTargetDsxBuffersBase = 0;
1983 ULONG ulCntTargetBuffers;
1984 ULONG ulIndex=0;
1985 int Status;
1987 if(Adapter->astTargetDsxBuffer[0].ulTargetDsxBuffer)
1988 return 1;
1990 if(NULL == Adapter)
1992 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Adapter was NULL!!!");
1993 return 0;
1996 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Size of Each DSX Buffer(Also size of ServiceFlowParamSI): %x ",sizeof(stServiceFlowParamSI));
1997 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Reading DSX buffer From Target location %x ",DSX_MESSAGE_EXCHANGE_BUFFER);
1999 Status = rdmalt(Adapter, DSX_MESSAGE_EXCHANGE_BUFFER,
2000 (PUINT)&ulTargetDsxBuffersBase, sizeof(UINT));
2001 if(Status < 0)
2003 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "RDM failed!!");
2004 return 0;
2007 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Base Address Of DSX Target Buffer : 0x%lx",ulTargetDsxBuffersBase);
2009 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Tgt Buffer is Now %lx :",ulTargetDsxBuffersBase);
2011 ulCntTargetBuffers = DSX_MESSAGE_EXCHANGE_BUFFER_SIZE/sizeof(stServiceFlowParamSI);
2013 Adapter->ulTotalTargetBuffersAvailable =
2014 ulCntTargetBuffers > MAX_TARGET_DSX_BUFFERS ?
2015 MAX_TARGET_DSX_BUFFERS : ulCntTargetBuffers;
2017 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Total Target DSX Buffer setup %lx ",Adapter->ulTotalTargetBuffersAvailable);
2019 for(ulIndex=0; ulIndex < Adapter->ulTotalTargetBuffersAvailable ; ulIndex++)
2021 Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer = ulTargetDsxBuffersBase;
2022 Adapter->astTargetDsxBuffer[ulIndex].valid=1;
2023 Adapter->astTargetDsxBuffer[ulIndex].tid=0;
2024 ulTargetDsxBuffersBase+=sizeof(stServiceFlowParamSI);
2025 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Target DSX Buffer %lx setup at 0x%lx",
2026 ulIndex, Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer);
2028 Adapter->ulCurrentTargetBuffer = 0;
2029 Adapter->ulFreeTargetBufferCnt = Adapter->ulTotalTargetBuffersAvailable;
2030 return 1;
2033 ULONG GetNextTargetBufferLocation(PMINI_ADAPTER Adapter,B_UINT16 tid)
2035 ULONG ulTargetDSXBufferAddress;
2036 ULONG ulTargetDsxBufferIndexToUse,ulMaxTry;
2038 if((Adapter->ulTotalTargetBuffersAvailable == 0)||
2039 (Adapter->ulFreeTargetBufferCnt == 0))
2041 ClearTargetDSXBuffer(Adapter,tid,FALSE);
2042 return 0;
2045 ulTargetDsxBufferIndexToUse = Adapter->ulCurrentTargetBuffer;
2046 ulMaxTry = Adapter->ulTotalTargetBuffersAvailable;
2047 while((ulMaxTry)&&(Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].valid != 1))
2049 ulTargetDsxBufferIndexToUse = (ulTargetDsxBufferIndexToUse+1)%
2050 Adapter->ulTotalTargetBuffersAvailable;
2051 ulMaxTry--;
2054 if(ulMaxTry==0)
2056 BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "\n GetNextTargetBufferLocation : Error No Free Target DSX Buffers FreeCnt : %lx ",Adapter->ulFreeTargetBufferCnt);
2057 ClearTargetDSXBuffer(Adapter,tid,FALSE);
2058 return 0;
2062 ulTargetDSXBufferAddress =
2063 Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].ulTargetDsxBuffer;
2064 Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].valid=0;
2065 Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].tid=tid;
2066 Adapter->ulFreeTargetBufferCnt--;
2069 ulTargetDsxBufferIndexToUse =
2070 (ulTargetDsxBufferIndexToUse+1)%Adapter->ulTotalTargetBuffersAvailable;
2071 Adapter->ulCurrentTargetBuffer = ulTargetDsxBufferIndexToUse;
2072 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "GetNextTargetBufferLocation :Returning address %lx tid %d\n",
2073 ulTargetDSXBufferAddress,tid);
2074 return ulTargetDSXBufferAddress;
2078 INT AllocAdapterDsxBuffer(PMINI_ADAPTER Adapter)
2081 //Need to Allocate memory to contain the SUPER Large structures
2082 //Our driver cant create these structures on Stack
2084 Adapter->caDsxReqResp=kmalloc(sizeof(stLocalSFAddIndicationAlt)+LEADER_SIZE, GFP_KERNEL);
2085 if(!Adapter->caDsxReqResp)
2086 return -ENOMEM;
2087 return 0;
2090 INT FreeAdapterDsxBuffer(PMINI_ADAPTER Adapter)
2092 if(Adapter->caDsxReqResp)
2094 bcm_kfree(Adapter->caDsxReqResp);
2096 return 0;
2103 VOID CheckAndIndicateConnect(PMINI_ADAPTER Adapter, stLocalSFAddIndicationAlt *pstAddIndication)
2105 struct timeval tv = {0} ;
2106 if((Adapter->ucDsxConnBitMap & Adapter->ucDsxLinkUpCfg) == Adapter->ucDsxLinkUpCfg)
2108 if(0==Adapter->LinkUpStatus)
2110 BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "Starting the queue...\n");
2111 Adapter->LinkUpStatus = TRUE;
2112 Adapter->TimerActive = TRUE;
2114 do_gettimeofday(&tv);
2115 Adapter->liTimeSinceLastNetEntry = tv.tv_sec;
2117 atomic_set(&Adapter->TxPktAvail, 1);
2119 netif_carrier_on (Adapter->dev);
2120 netif_start_queue (Adapter->dev);
2121 wake_up(&Adapter->tx_packet_wait_queue);
2132 @ingroup ctrl_pkt_functions
2133 This routinue would process the Control responses
2134 for the Connection Management.
2135 @return - Queue index for the free SFID else returns Invalid Index.
2137 BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter, /**<Pointer to the Adapter structure*/
2138 PVOID pvBuffer /**Starting Address of the Buffer, that contains the AddIndication Data*/
2141 stServiceFlowParamSI *psfLocalSet=NULL;
2142 stLocalSFAddIndicationAlt *pstAddIndication = NULL;
2143 stLocalSFChangeIndicationAlt *pstChangeIndication = NULL;
2144 PLEADER pLeader=NULL;
2146 //Otherwise the message contains a target address from where we need to
2147 //read out the rest of the service flow param structure
2149 if((pstAddIndication = RestoreCmControlResponseMessage(Adapter,pvBuffer))
2150 == NULL)
2152 ClearTargetDSXBuffer(Adapter,((stLocalSFAddIndication *)pvBuffer)->u16TID, FALSE);
2153 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "Error in restoring Service Flow param structure from DSx message");
2154 return FALSE;
2157 DumpCmControlPacket(pstAddIndication);
2158 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "====>");
2159 pLeader = (PLEADER)Adapter->caDsxReqResp;
2161 pLeader->Status =CM_CONTROL_NEWDSX_MULTICLASSIFIER_REQ;
2162 pLeader->Vcid = 0;
2164 ClearTargetDSXBuffer(Adapter,pstAddIndication->u16TID,FALSE);
2165 BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "### TID RECEIVED %d\n",pstAddIndication->u16TID);
2166 switch(pstAddIndication->u8Type)
2168 case DSA_REQ:
2170 pLeader->PLength = sizeof(stLocalSFAddIndicationAlt);
2171 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Sending DSA Response....\n");
2172 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSA RESPONSE TO MAC %d", pLeader->PLength );
2173 *((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))
2174 = *pstAddIndication;
2175 ((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSA_RSP;
2177 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " VCID = %x", ntohs(pstAddIndication->u16VCID));
2178 CopyBufferToControlPacket(Adapter,(PVOID)Adapter->caDsxReqResp);
2179 bcm_kfree(pstAddIndication);
2181 break;
2182 case DSA_RSP:
2184 pLeader->PLength = sizeof(stLocalSFAddIndicationAlt);
2185 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSA ACK TO MAC %d",
2186 pLeader->PLength);
2187 *((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))
2188 = *pstAddIndication;
2189 ((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSA_ACK;
2191 }//no break here..we should go down.
2192 case DSA_ACK:
2194 UINT uiSearchRuleIndex=0;
2195 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "VCID:0x%X",
2196 ntohs(pstAddIndication->u16VCID));
2197 uiSearchRuleIndex=SearchFreeSfid(Adapter);
2198 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"uiSearchRuleIndex:0x%X ",
2199 uiSearchRuleIndex);
2200 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Direction:0x%X ",
2201 pstAddIndication->u8Direction);
2202 if((uiSearchRuleIndex< NO_OF_QUEUES) )
2204 Adapter->PackInfo[uiSearchRuleIndex].ucDirection =
2205 pstAddIndication->u8Direction;
2206 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "bValid:0x%X ",
2207 pstAddIndication->sfActiveSet.bValid);
2208 if(pstAddIndication->sfActiveSet.bValid==TRUE)
2210 Adapter->PackInfo[uiSearchRuleIndex].bActiveSet=TRUE;
2212 if(pstAddIndication->sfAuthorizedSet.bValid==TRUE)
2214 Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet=TRUE;
2216 if(pstAddIndication->sfAdmittedSet.bValid==TRUE)
2218 Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet=TRUE;
2220 if(FALSE == pstAddIndication->sfActiveSet.bValid)
2222 Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE;
2223 Adapter->PackInfo[uiSearchRuleIndex].bActivateRequestSent = FALSE;
2224 if(pstAddIndication->sfAdmittedSet.bValid)
2226 psfLocalSet = &pstAddIndication->sfAdmittedSet;
2228 else if(pstAddIndication->sfAuthorizedSet.bValid)
2230 psfLocalSet = &pstAddIndication->sfAuthorizedSet;
2233 else
2235 psfLocalSet = &pstAddIndication->sfActiveSet;
2236 Adapter->PackInfo[uiSearchRuleIndex].bActive=TRUE;
2239 if(!psfLocalSet)
2241 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "No set is valid\n");
2242 Adapter->PackInfo[uiSearchRuleIndex].bActive=FALSE;
2243 Adapter->PackInfo[uiSearchRuleIndex].bValid=FALSE;
2244 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value=0;
2245 bcm_kfree(pstAddIndication);
2248 else if(psfLocalSet->bValid && (pstAddIndication->u8CC == 0))
2250 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSA ACK");
2251 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value =
2252 ntohs(pstAddIndication->u16VCID);
2253 Adapter->PackInfo[uiSearchRuleIndex].usCID =
2254 ntohs(pstAddIndication->u16CID);
2257 CopyToAdapter(Adapter,psfLocalSet,uiSearchRuleIndex,
2258 DSA_ACK, pstAddIndication);
2259 // don't free pstAddIndication
2261 /* Inside CopyToAdapter, Sorting of all the SFs take place.
2262 Hence any access to the newly added SF through uiSearchRuleIndex is invalid.
2263 SHOULD BE STRICTLY AVOIDED.
2265 // *(PULONG)(((PUCHAR)pvBuffer)+1)=psfLocalSet->u32SFID;
2266 memcpy((((PUCHAR)pvBuffer)+1), &psfLocalSet->u32SFID, 4);
2271 else
2273 Adapter->PackInfo[uiSearchRuleIndex].bActive=FALSE;
2274 Adapter->PackInfo[uiSearchRuleIndex].bValid=FALSE;
2275 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value=0;
2276 bcm_kfree(pstAddIndication);
2279 else
2281 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "DSA ACK did not get valid SFID");
2282 bcm_kfree(pstAddIndication);
2283 return FALSE;
2286 break;
2287 case DSC_REQ:
2289 pLeader->PLength = sizeof(stLocalSFChangeIndicationAlt);
2290 pstChangeIndication = (stLocalSFChangeIndicationAlt*)pstAddIndication;
2291 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSC RESPONSE TO MAC %d", pLeader->PLength);
2293 *((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *pstChangeIndication;
2294 ((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSC_RSP;
2296 CopyBufferToControlPacket(Adapter,(PVOID)Adapter->caDsxReqResp);
2297 bcm_kfree(pstAddIndication);
2299 break;
2300 case DSC_RSP:
2302 pLeader->PLength = sizeof(stLocalSFChangeIndicationAlt);
2303 pstChangeIndication = (stLocalSFChangeIndicationAlt*)pstAddIndication;
2304 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSC ACK TO MAC %d", pLeader->PLength);
2305 *((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *pstChangeIndication;
2306 ((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSC_ACK;
2308 case DSC_ACK:
2310 UINT uiSearchRuleIndex=0;
2312 pstChangeIndication = (stLocalSFChangeIndicationAlt *)pstAddIndication;
2313 uiSearchRuleIndex=SearchSfid(Adapter,ntohl(pstChangeIndication->sfActiveSet.u32SFID));
2314 if(uiSearchRuleIndex > NO_OF_QUEUES-1)
2316 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "SF doesn't exist for which DSC_ACK is received");
2318 if((uiSearchRuleIndex < NO_OF_QUEUES))
2320 Adapter->PackInfo[uiSearchRuleIndex].ucDirection = pstChangeIndication->u8Direction;
2321 if(pstChangeIndication->sfActiveSet.bValid==TRUE)
2323 Adapter->PackInfo[uiSearchRuleIndex].bActiveSet=TRUE;
2325 if(pstChangeIndication->sfAuthorizedSet.bValid==TRUE)
2327 Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet=TRUE;
2329 if(pstChangeIndication->sfAdmittedSet.bValid==TRUE)
2331 Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet=TRUE;
2334 if(FALSE==pstChangeIndication->sfActiveSet.bValid)
2336 Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE;
2337 Adapter->PackInfo[uiSearchRuleIndex].bActivateRequestSent = FALSE;
2338 if(pstChangeIndication->sfAdmittedSet.bValid)
2340 psfLocalSet = &pstChangeIndication->sfAdmittedSet;
2342 else if(pstChangeIndication->sfAuthorizedSet.bValid)
2344 psfLocalSet = &pstChangeIndication->sfAuthorizedSet;
2348 else
2350 psfLocalSet = &pstChangeIndication->sfActiveSet;
2351 Adapter->PackInfo[uiSearchRuleIndex].bActive=TRUE;
2353 if(psfLocalSet->bValid && (pstChangeIndication->u8CC == 0))
2355 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value =
2356 ntohs(pstChangeIndication->u16VCID);
2357 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "CC field is %d bvalid = %d\n",
2358 pstChangeIndication->u8CC, psfLocalSet->bValid);
2359 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "VCID= %d\n", ntohs(pstChangeIndication->u16VCID));
2360 Adapter->PackInfo[uiSearchRuleIndex].usCID =
2361 ntohs(pstChangeIndication->u16CID);
2362 CopyToAdapter(Adapter,psfLocalSet,uiSearchRuleIndex,
2363 DSC_ACK, pstAddIndication);
2365 *(PULONG)(((PUCHAR)pvBuffer)+1)=psfLocalSet->u32SFID;
2367 else if(pstChangeIndication->u8CC == 6)
2369 deleteSFBySfid(Adapter,uiSearchRuleIndex);
2370 bcm_kfree(pstAddIndication);
2373 else
2375 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "DSC ACK did not get valid SFID");
2376 bcm_kfree(pstAddIndication);
2377 return FALSE;
2380 break;
2381 case DSD_REQ:
2383 UINT uiSearchRuleIndex;
2384 ULONG ulSFID;
2386 pLeader->PLength = sizeof(stLocalSFDeleteIndication);
2387 *((stLocalSFDeleteIndication*)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *((stLocalSFDeleteIndication*)pstAddIndication);
2389 ulSFID = ntohl(((stLocalSFDeleteIndication*)pstAddIndication)->u32SFID);
2390 uiSearchRuleIndex=SearchSfid(Adapter,ulSFID);
2391 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSD - Removing connection %x",uiSearchRuleIndex);
2393 if(uiSearchRuleIndex < NO_OF_QUEUES)
2395 //Delete All Classifiers Associated with this SFID
2396 deleteSFBySfid(Adapter,uiSearchRuleIndex);
2397 Adapter->u32TotalDSD++;
2400 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSD RESPONSE TO MAC");
2401 ((stLocalSFDeleteIndication*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSD_RSP;
2402 CopyBufferToControlPacket(Adapter,(PVOID)Adapter->caDsxReqResp);
2404 case DSD_RSP:
2406 //Do nothing as SF has already got Deleted
2408 break;
2409 case DSD_ACK:
2410 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSD ACK Rcd, let App handle it\n");
2411 break;
2412 default:
2413 bcm_kfree(pstAddIndication);
2414 return FALSE ;
2416 return TRUE;
2419 int get_dsx_sf_data_to_application(PMINI_ADAPTER Adapter, UINT uiSFId, PUCHAR user_buffer)
2421 int status = 0;
2422 struct _packet_info *psSfInfo=NULL;
2423 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "status =%d",status);
2424 status = SearchSfid(Adapter, uiSFId);
2425 if(status>NO_OF_QUEUES)
2427 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SFID %d not present in queue !!!", uiSFId );
2428 return -EINVAL;
2430 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "status =%d",status);
2431 psSfInfo=&Adapter->PackInfo[status];
2432 if(psSfInfo->pstSFIndication && copy_to_user((PCHAR)user_buffer,
2433 (PCHAR)psSfInfo->pstSFIndication, sizeof(stLocalSFAddIndicationAlt)))
2435 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "copy to user failed SFID %d, present in queue !!!", uiSFId );
2436 status = -EFAULT;
2437 return status;
2439 return STATUS_SUCCESS;
2442 VOID OverrideServiceFlowParams(PMINI_ADAPTER Adapter,PUINT puiBuffer)
2444 B_UINT32 u32NumofSFsinMsg = ntohl(*(puiBuffer + 1));
2445 stIM_SFHostNotify *pHostInfo = NULL;
2446 UINT uiSearchRuleIndex = 0;
2447 ULONG ulSFID = 0;
2449 puiBuffer+=2;
2451 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "u32NumofSFsinMsg: 0x%x\n",u32NumofSFsinMsg);
2453 while(u32NumofSFsinMsg != 0 && u32NumofSFsinMsg < NO_OF_QUEUES)
2455 u32NumofSFsinMsg--;
2456 pHostInfo = (stIM_SFHostNotify *)puiBuffer;
2457 puiBuffer = (PUINT)(pHostInfo + 1);
2459 ulSFID = ntohl(pHostInfo->SFID);
2460 uiSearchRuleIndex=SearchSfid(Adapter,ulSFID);
2461 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"SFID: 0x%lx\n",ulSFID);
2463 if(uiSearchRuleIndex >= NO_OF_QUEUES || uiSearchRuleIndex == HiPriority)
2465 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);
2466 continue;
2469 if(pHostInfo->RetainSF == FALSE)
2471 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Going to Delete SF");
2472 deleteSFBySfid(Adapter,uiSearchRuleIndex);
2474 else
2477 // Propagte the VCID update to the PHS table.
2479 UpdateServiceFlowParams(Adapter->stBCMPhsContext.pstServiceFlowPhsRulesTable,
2480 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value,
2481 ntohs(pHostInfo->VCID));
2483 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = ntohs(pHostInfo->VCID);
2484 Adapter->PackInfo[uiSearchRuleIndex].usCID = ntohs(pHostInfo->newCID);
2485 Adapter->PackInfo[uiSearchRuleIndex].bActive=FALSE;
2487 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"pHostInfo->QoSParamSet: 0x%x\n",pHostInfo->QoSParamSet);
2489 if(pHostInfo->QoSParamSet & 0x1)
2490 Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet =TRUE;
2491 if(pHostInfo->QoSParamSet & 0x2)
2492 Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet =TRUE;
2493 if(pHostInfo->QoSParamSet & 0x4)
2495 Adapter->PackInfo[uiSearchRuleIndex].bActiveSet =TRUE;
2496 Adapter->PackInfo[uiSearchRuleIndex].bActive=TRUE;