jme: Do not enable NIC WoL functions on S0
[linux/fpc-iii.git] / drivers / staging / bcm / CmHost.c
blobfb1d932c5d790a6e2a6b93b4a2f848c482bee223
1 /************************************************************
2 * CMHOST.C
3 * This file contains the routines for handling Connection
4 * Management.
5 ************************************************************/
7 #include "headers.h"
9 enum E_CLASSIFIER_ACTION {
10 eInvalidClassifierAction,
11 eAddClassifier,
12 eReplaceClassifier,
13 eDeleteClassifier
16 static ULONG GetNextTargetBufferLocation(struct bcm_mini_adapter *Adapter,
17 B_UINT16 tid);
18 static void restore_endianess_of_pstClassifierEntry(
19 struct bcm_classifier_rule *pstClassifierEntry,
20 enum bcm_ipaddr_context eIpAddrContext);
22 static void apply_phs_rule_to_all_classifiers(
23 register struct bcm_mini_adapter *Adapter,
24 register UINT uiSearchRuleIndex,
25 USHORT uVCID,
26 struct bcm_phs_rule *sPhsRule,
27 struct bcm_phs_rules *cPhsRule,
28 struct bcm_add_indication_alt *pstAddIndication);
30 /************************************************************
31 * Function - SearchSfid
33 * Description - This routinue would search QOS queues having
34 * specified SFID as input parameter.
36 * Parameters - Adapter: Pointer to the Adapter structure
37 * uiSfid : Given SFID for matching
39 * Returns - Queue index for this SFID(If matched)
40 * Else Invalid Queue Index(If Not matched)
41 ************************************************************/
42 int SearchSfid(struct bcm_mini_adapter *Adapter, UINT uiSfid)
44 int i;
46 for (i = (NO_OF_QUEUES-1); i >= 0; i--)
47 if (Adapter->PackInfo[i].ulSFID == uiSfid)
48 return i;
50 return NO_OF_QUEUES+1;
53 /***************************************************************
54 * Function -SearchFreeSfid
56 * Description - This routinue would search Free available SFID.
58 * Parameter - Adapter: Pointer to the Adapter structure
60 * Returns - Queue index for the free SFID
61 * Else returns Invalid Index.
62 ****************************************************************/
63 static int SearchFreeSfid(struct bcm_mini_adapter *Adapter)
65 int i;
67 for (i = 0; i < (NO_OF_QUEUES-1); i++)
68 if (Adapter->PackInfo[i].ulSFID == 0)
69 return i;
71 return NO_OF_QUEUES+1;
75 * Function: SearchClsid
76 * Description: This routinue would search Classifier having specified ClassifierID as input parameter
77 * Input parameters: struct bcm_mini_adapter *Adapter - Adapter Context
78 * unsigned int uiSfid - The SF in which the classifier is to searched
79 * B_UINT16 uiClassifierID - The classifier ID to be searched
80 * Return: int :Classifier table index of matching entry
82 static int SearchClsid(struct bcm_mini_adapter *Adapter,
83 ULONG ulSFID,
84 B_UINT16 uiClassifierID)
86 int i;
88 for (i = 0; i < MAX_CLASSIFIERS; i++) {
89 if ((Adapter->astClassifierTable[i].bUsed) &&
90 (Adapter->astClassifierTable[i].uiClassifierRuleIndex
91 == uiClassifierID) &&
92 (Adapter->astClassifierTable[i].ulSFID == ulSFID))
93 return i;
96 return MAX_CLASSIFIERS+1;
100 * @ingroup ctrl_pkt_functions
101 * This routinue would search Free available Classifier entry in classifier table.
102 * @return free Classifier Entry index in classifier table for specified SF
104 static int SearchFreeClsid(struct bcm_mini_adapter *Adapter /**Adapter Context*/)
106 int i;
108 for (i = 0; i < MAX_CLASSIFIERS; i++) {
109 if (!Adapter->astClassifierTable[i].bUsed)
110 return i;
113 return MAX_CLASSIFIERS+1;
116 static VOID deleteSFBySfid(struct bcm_mini_adapter *Adapter,
117 UINT uiSearchRuleIndex)
119 /* deleting all the packet held in the SF */
120 flush_queue(Adapter, uiSearchRuleIndex);
122 /* Deleting the all classifiers for this SF */
123 DeleteAllClassifiersForSF(Adapter, uiSearchRuleIndex);
125 /* Resetting only MIBS related entries in the SF */
126 memset((PVOID)&Adapter->PackInfo[uiSearchRuleIndex], 0,
127 sizeof(struct bcm_mibs_table));
130 static inline VOID
131 CopyIpAddrToClassifier(struct bcm_classifier_rule *pstClassifierEntry,
132 B_UINT8 u8IpAddressLen, B_UINT8 *pu8IpAddressMaskSrc,
133 bool bIpVersion6, enum bcm_ipaddr_context eIpAddrContext)
135 int i = 0;
136 UINT nSizeOfIPAddressInBytes = IP_LENGTH_OF_ADDRESS;
137 UCHAR *ptrClassifierIpAddress = NULL;
138 UCHAR *ptrClassifierIpMask = NULL;
139 struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev);
141 if (bIpVersion6)
142 nSizeOfIPAddressInBytes = IPV6_ADDRESS_SIZEINBYTES;
144 /* Destination Ip Address */
145 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
146 "Ip Address Range Length:0x%X ", u8IpAddressLen);
147 if ((bIpVersion6 ? (IPV6_ADDRESS_SIZEINBYTES * MAX_IP_RANGE_LENGTH * 2) :
148 (TOTAL_MASKED_ADDRESS_IN_BYTES)) >= u8IpAddressLen) {
150 union u_ip_address *st_dest_ip =
151 &pstClassifierEntry->stDestIpAddress;
153 union u_ip_address *st_src_ip =
154 &pstClassifierEntry->stSrcIpAddress;
157 * checking both the mask and address togethor in Classification.
158 * So length will be : TotalLengthInBytes/nSizeOfIPAddressInBytes * 2
159 * (nSizeOfIPAddressInBytes for address and nSizeOfIPAddressInBytes for mask)
161 if (eIpAddrContext == eDestIpAddress) {
162 pstClassifierEntry->ucIPDestinationAddressLength =
163 u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
164 if (bIpVersion6) {
165 ptrClassifierIpAddress =
166 st_dest_ip->ucIpv6Address;
167 ptrClassifierIpMask =
168 st_dest_ip->ucIpv6Mask;
169 } else {
170 ptrClassifierIpAddress =
171 st_dest_ip->ucIpv4Address;
172 ptrClassifierIpMask =
173 st_dest_ip->ucIpv4Mask;
175 } else if (eIpAddrContext == eSrcIpAddress) {
176 pstClassifierEntry->ucIPSourceAddressLength =
177 u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
178 if (bIpVersion6) {
179 ptrClassifierIpAddress =
180 st_src_ip->ucIpv6Address;
181 ptrClassifierIpMask = st_src_ip->ucIpv6Mask;
182 } else {
183 ptrClassifierIpAddress =
184 st_src_ip->ucIpv4Address;
185 ptrClassifierIpMask = st_src_ip->ucIpv4Mask;
188 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
189 "Address Length:0x%X\n",
190 pstClassifierEntry->ucIPDestinationAddressLength);
191 while ((u8IpAddressLen >= nSizeOfIPAddressInBytes)
192 && (i < MAX_IP_RANGE_LENGTH)) {
193 memcpy(ptrClassifierIpAddress +
194 (i * nSizeOfIPAddressInBytes),
195 (pu8IpAddressMaskSrc
196 + (i * nSizeOfIPAddressInBytes * 2)),
197 nSizeOfIPAddressInBytes);
199 if (!bIpVersion6) {
200 if (eIpAddrContext == eSrcIpAddress) {
201 st_src_ip->ulIpv4Addr[i] =
202 ntohl(st_src_ip->ulIpv4Addr[i]);
203 BCM_DEBUG_PRINT(Adapter,
204 DBG_TYPE_OTHERS,
205 CONN_MSG,
206 DBG_LVL_ALL,
207 "Src Ip Address:0x%luX ",
208 st_src_ip->ulIpv4Addr[i]);
209 } else if (eIpAddrContext == eDestIpAddress) {
210 st_dest_ip->ulIpv4Addr[i] =
211 ntohl(st_dest_ip->ulIpv4Addr[i]);
212 BCM_DEBUG_PRINT(Adapter,
213 DBG_TYPE_OTHERS,
214 CONN_MSG,
215 DBG_LVL_ALL,
216 "Dest Ip Address:0x%luX ",
217 st_dest_ip->ulIpv4Addr[i]);
220 u8IpAddressLen -= nSizeOfIPAddressInBytes;
221 if (u8IpAddressLen >= nSizeOfIPAddressInBytes) {
222 memcpy(ptrClassifierIpMask +
223 (i * nSizeOfIPAddressInBytes),
224 (pu8IpAddressMaskSrc
225 + nSizeOfIPAddressInBytes
226 + (i * nSizeOfIPAddressInBytes * 2)),
227 nSizeOfIPAddressInBytes);
229 if (!bIpVersion6) {
230 if (eIpAddrContext == eSrcIpAddress) {
231 st_src_ip->ulIpv4Mask[i] =
232 ntohl(st_src_ip->ulIpv4Mask[i]);
233 BCM_DEBUG_PRINT(Adapter,
234 DBG_TYPE_OTHERS,
235 CONN_MSG,
236 DBG_LVL_ALL,
237 "Src Ip Mask Address:0x%luX ",
238 st_src_ip->ulIpv4Mask[i]);
239 } else if (eIpAddrContext == eDestIpAddress) {
240 st_dest_ip->ulIpv4Mask[i] =
241 ntohl(st_dest_ip->ulIpv4Mask[i]);
242 BCM_DEBUG_PRINT(Adapter,
243 DBG_TYPE_OTHERS,
244 CONN_MSG,
245 DBG_LVL_ALL,
246 "Dest Ip Mask Address:0x%luX ",
247 st_dest_ip->ulIpv4Mask[i]);
250 u8IpAddressLen -= nSizeOfIPAddressInBytes;
252 if (u8IpAddressLen == 0)
253 pstClassifierEntry->bDestIpValid = TRUE;
255 i++;
257 if (bIpVersion6) {
258 /* Restore EndianNess of Struct */
259 restore_endianess_of_pstClassifierEntry(
260 pstClassifierEntry,
261 eIpAddrContext
267 void ClearTargetDSXBuffer(struct bcm_mini_adapter *Adapter, B_UINT16 TID, bool bFreeAll)
269 int i;
270 struct bcm_targetdsx_buffer *curr_buf;
272 for (i = 0; i < Adapter->ulTotalTargetBuffersAvailable; i++) {
273 curr_buf = &Adapter->astTargetDsxBuffer[i];
275 if (curr_buf->valid)
276 continue;
278 if ((bFreeAll) || (curr_buf->tid == TID)) {
279 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
280 "ClearTargetDSXBuffer: found tid %d buffer cleared %lx\n",
281 TID, curr_buf->ulTargetDsxBuffer);
282 curr_buf->valid = 1;
283 curr_buf->tid = 0;
284 Adapter->ulFreeTargetBufferCnt++;
290 * @ingroup ctrl_pkt_functions
291 * copy classifier rule into the specified SF index
293 static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter,
294 struct bcm_convergence_types *psfCSType,
295 UINT uiSearchRuleIndex,
296 UINT nClassifierIndex)
298 struct bcm_classifier_rule *pstClassifierEntry = NULL;
299 /* VOID *pvPhsContext = NULL; */
300 int i;
301 /* UCHAR ucProtocolLength=0; */
302 /* ULONG ulPhsStatus; */
304 struct bcm_packet_class_rules *pack_class_rule =
305 &psfCSType->cCPacketClassificationRule;
307 if (Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value == 0 ||
308 nClassifierIndex > (MAX_CLASSIFIERS-1))
309 return;
311 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
312 "Storing Classifier Rule Index : %X",
313 ntohs(pack_class_rule->u16PacketClassificationRuleIndex));
315 if (nClassifierIndex > MAX_CLASSIFIERS-1)
316 return;
318 pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
319 if (pstClassifierEntry) {
320 /* Store if Ipv6 */
321 pstClassifierEntry->bIpv6Protocol =
322 (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6) ? TRUE : false;
324 /* Destinaiton Port */
325 pstClassifierEntry->ucDestPortRangeLength =
326 pack_class_rule->u8ProtocolDestPortRangeLength / 4;
327 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
328 "Destination Port Range Length:0x%X ",
329 pstClassifierEntry->ucDestPortRangeLength);
331 if (pack_class_rule->u8ProtocolDestPortRangeLength <= MAX_PORT_RANGE) {
332 for (i = 0; i < (pstClassifierEntry->ucDestPortRangeLength); i++) {
333 pstClassifierEntry->usDestPortRangeLo[i] =
334 *((PUSHORT)(pack_class_rule->u8ProtocolDestPortRange+i));
335 pstClassifierEntry->usDestPortRangeHi[i] =
336 *((PUSHORT)(pack_class_rule->u8ProtocolDestPortRange+2+i));
337 pstClassifierEntry->usDestPortRangeLo[i] =
338 ntohs(pstClassifierEntry->usDestPortRangeLo[i]);
339 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
340 CONN_MSG, DBG_LVL_ALL,
341 "Destination Port Range Lo:0x%X ",
342 pstClassifierEntry->usDestPortRangeLo[i]);
343 pstClassifierEntry->usDestPortRangeHi[i] =
344 ntohs(pstClassifierEntry->usDestPortRangeHi[i]);
346 } else {
347 pstClassifierEntry->ucDestPortRangeLength = 0;
350 /* Source Port */
351 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
352 "Source Port Range Length:0x%X ",
353 pack_class_rule->u8ProtocolSourcePortRangeLength);
354 if (pack_class_rule->u8ProtocolSourcePortRangeLength <= MAX_PORT_RANGE) {
355 pstClassifierEntry->ucSrcPortRangeLength =
356 pack_class_rule->u8ProtocolSourcePortRangeLength/4;
357 for (i = 0; i < (pstClassifierEntry->ucSrcPortRangeLength); i++) {
358 pstClassifierEntry->usSrcPortRangeLo[i] =
359 *((PUSHORT)(pack_class_rule->
360 u8ProtocolSourcePortRange+i));
361 pstClassifierEntry->usSrcPortRangeHi[i] =
362 *((PUSHORT)(pack_class_rule->
363 u8ProtocolSourcePortRange+2+i));
364 pstClassifierEntry->usSrcPortRangeLo[i] =
365 ntohs(pstClassifierEntry->usSrcPortRangeLo[i]);
366 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
367 CONN_MSG, DBG_LVL_ALL,
368 "Source Port Range Lo:0x%X ",
369 pstClassifierEntry->usSrcPortRangeLo[i]);
370 pstClassifierEntry->usSrcPortRangeHi[i] =
371 ntohs(pstClassifierEntry->usSrcPortRangeHi[i]);
374 /* Destination Ip Address and Mask */
375 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
376 "Ip Destination Parameters : ");
377 CopyIpAddrToClassifier(pstClassifierEntry,
378 pack_class_rule->u8IPDestinationAddressLength,
379 pack_class_rule->u8IPDestinationAddress,
380 (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6) ?
381 TRUE : false, eDestIpAddress);
383 /* Source Ip Address and Mask */
384 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
385 "Ip Source Parameters : ");
387 CopyIpAddrToClassifier(pstClassifierEntry,
388 pack_class_rule->u8IPMaskedSourceAddressLength,
389 pack_class_rule->u8IPMaskedSourceAddress,
390 (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6) ? TRUE : false,
391 eSrcIpAddress);
393 /* TOS */
394 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
395 "TOS Length:0x%X ",
396 pack_class_rule->u8IPTypeOfServiceLength);
397 if (pack_class_rule->u8IPTypeOfServiceLength == 3) {
398 pstClassifierEntry->ucIPTypeOfServiceLength =
399 pack_class_rule->u8IPTypeOfServiceLength;
400 pstClassifierEntry->ucTosLow =
401 pack_class_rule->u8IPTypeOfService[0];
402 pstClassifierEntry->ucTosHigh =
403 pack_class_rule->u8IPTypeOfService[1];
404 pstClassifierEntry->ucTosMask =
405 pack_class_rule->u8IPTypeOfService[2];
406 pstClassifierEntry->bTOSValid = TRUE;
408 if (pack_class_rule->u8Protocol == 0) {
409 /* we didn't get protocol field filled in by the BS */
410 pstClassifierEntry->ucProtocolLength = 0;
411 } else {
412 pstClassifierEntry->ucProtocolLength = 1; /* 1 valid protocol */
415 pstClassifierEntry->ucProtocol[0] = pack_class_rule->u8Protocol;
416 pstClassifierEntry->u8ClassifierRulePriority =
417 pack_class_rule->u8ClassifierRulePriority;
419 /* store the classifier rule ID and set this classifier entry as valid */
420 pstClassifierEntry->ucDirection =
421 Adapter->PackInfo[uiSearchRuleIndex].ucDirection;
422 pstClassifierEntry->uiClassifierRuleIndex =
423 ntohs(pack_class_rule->u16PacketClassificationRuleIndex);
424 pstClassifierEntry->usVCID_Value =
425 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
426 pstClassifierEntry->ulSFID =
427 Adapter->PackInfo[uiSearchRuleIndex].ulSFID;
428 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
429 "Search Index %d Dir: %d, Index: %d, Vcid: %d\n",
430 uiSearchRuleIndex,
431 pstClassifierEntry->ucDirection,
432 pstClassifierEntry->uiClassifierRuleIndex,
433 pstClassifierEntry->usVCID_Value);
435 if (pack_class_rule->u8AssociatedPHSI)
436 pstClassifierEntry->u8AssociatedPHSI =
437 pack_class_rule->u8AssociatedPHSI;
439 /* Copy ETH CS Parameters */
440 pstClassifierEntry->ucEthCSSrcMACLen =
441 (pack_class_rule->u8EthernetSourceMACAddressLength);
442 memcpy(pstClassifierEntry->au8EThCSSrcMAC,
443 pack_class_rule->u8EthernetSourceMACAddress,
444 MAC_ADDRESS_SIZE);
445 memcpy(pstClassifierEntry->au8EThCSSrcMACMask,
446 pack_class_rule->u8EthernetSourceMACAddress
447 + MAC_ADDRESS_SIZE, MAC_ADDRESS_SIZE);
448 pstClassifierEntry->ucEthCSDestMACLen =
449 (pack_class_rule->u8EthernetDestMacAddressLength);
450 memcpy(pstClassifierEntry->au8EThCSDestMAC,
451 pack_class_rule->u8EthernetDestMacAddress,
452 MAC_ADDRESS_SIZE);
453 memcpy(pstClassifierEntry->au8EThCSDestMACMask,
454 pack_class_rule->u8EthernetDestMacAddress
455 + MAC_ADDRESS_SIZE, MAC_ADDRESS_SIZE);
456 pstClassifierEntry->ucEtherTypeLen =
457 (pack_class_rule->u8EthertypeLength);
458 memcpy(pstClassifierEntry->au8EthCSEtherType,
459 pack_class_rule->u8Ethertype,
460 NUM_ETHERTYPE_BYTES);
461 memcpy(pstClassifierEntry->usUserPriority,
462 &pack_class_rule->u16UserPriority, 2);
463 pstClassifierEntry->usVLANID =
464 ntohs(pack_class_rule->u16VLANID);
465 pstClassifierEntry->usValidityBitMap =
466 ntohs(pack_class_rule->u16ValidityBitMap);
468 pstClassifierEntry->bUsed = TRUE;
473 * @ingroup ctrl_pkt_functions
475 static inline VOID DeleteClassifierRuleFromSF(struct bcm_mini_adapter *Adapter,
476 UINT uiSearchRuleIndex, UINT nClassifierIndex)
478 struct bcm_classifier_rule *pstClassifierEntry = NULL;
479 B_UINT16 u16PacketClassificationRuleIndex;
480 USHORT usVCID;
481 /* VOID *pvPhsContext = NULL; */
482 /*ULONG ulPhsStatus; */
484 usVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
486 if (nClassifierIndex > MAX_CLASSIFIERS-1)
487 return;
489 if (usVCID == 0)
490 return;
492 u16PacketClassificationRuleIndex =
493 Adapter->astClassifierTable[nClassifierIndex].uiClassifierRuleIndex;
494 pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
495 if (pstClassifierEntry) {
496 pstClassifierEntry->bUsed = false;
497 pstClassifierEntry->uiClassifierRuleIndex = 0;
498 memset(pstClassifierEntry, 0,
499 sizeof(struct bcm_classifier_rule));
501 /* Delete the PHS Rule for this classifier */
502 PhsDeleteClassifierRule(&Adapter->stBCMPhsContext, usVCID,
503 u16PacketClassificationRuleIndex);
508 * @ingroup ctrl_pkt_functions
510 VOID DeleteAllClassifiersForSF(struct bcm_mini_adapter *Adapter,
511 UINT uiSearchRuleIndex)
513 struct bcm_classifier_rule *pstClassifierEntry = NULL;
514 int i;
515 /* B_UINT16 u16PacketClassificationRuleIndex; */
516 USHORT ulVCID;
517 /* VOID *pvPhsContext = NULL; */
518 /* ULONG ulPhsStatus; */
520 ulVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
522 if (ulVCID == 0)
523 return;
525 for (i = 0; i < MAX_CLASSIFIERS; i++) {
526 if (Adapter->astClassifierTable[i].usVCID_Value == ulVCID) {
527 pstClassifierEntry = &Adapter->astClassifierTable[i];
529 if (pstClassifierEntry->bUsed)
530 DeleteClassifierRuleFromSF(Adapter,
531 uiSearchRuleIndex, i);
535 /* Delete All Phs Rules Associated with this SF */
536 PhsDeleteSFRules(&Adapter->stBCMPhsContext, ulVCID);
540 * This routinue copies the Connection Management
541 * related data into the Adapter structure.
542 * @ingroup ctrl_pkt_functions
544 static VOID CopyToAdapter(register struct bcm_mini_adapter *Adapter, /* <Pointer to the Adapter structure */
545 register struct bcm_connect_mgr_params *psfLocalSet, /* Pointer to the connection manager parameters structure */
546 register UINT uiSearchRuleIndex, /* <Index of Queue, to which this data belongs */
547 register UCHAR ucDsxType,
548 struct bcm_add_indication_alt *pstAddIndication) {
550 /* UCHAR ucProtocolLength = 0; */
551 ULONG ulSFID;
552 UINT nClassifierIndex = 0;
553 enum E_CLASSIFIER_ACTION eClassifierAction = eInvalidClassifierAction;
554 B_UINT16 u16PacketClassificationRuleIndex = 0;
555 int i;
556 struct bcm_convergence_types *psfCSType = NULL;
557 struct bcm_phs_rule sPhsRule;
558 struct bcm_packet_info *curr_packinfo =
559 &Adapter->PackInfo[uiSearchRuleIndex];
560 USHORT uVCID = curr_packinfo->usVCID_Value;
561 UINT UGIValue = 0;
563 curr_packinfo->bValid = TRUE;
564 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
565 "Search Rule Index = %d\n", uiSearchRuleIndex);
566 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
567 "%s: SFID= %x ", __func__, ntohl(psfLocalSet->u32SFID));
568 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
569 "Updating Queue %d", uiSearchRuleIndex);
571 ulSFID = ntohl(psfLocalSet->u32SFID);
572 /* Store IP Version used */
573 /* Get The Version Of IP used (IPv6 or IPv4) from CSSpecification field of SF */
575 curr_packinfo->bIPCSSupport = 0;
576 curr_packinfo->bEthCSSupport = 0;
578 /* Enable IP/ETh CS Support As Required */
579 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
580 "CopyToAdapter : u8CSSpecification : %X\n",
581 psfLocalSet->u8CSSpecification);
582 switch (psfLocalSet->u8CSSpecification) {
583 case eCSPacketIPV4:
584 curr_packinfo->bIPCSSupport = IPV4_CS;
585 break;
586 case eCSPacketIPV6:
587 curr_packinfo->bIPCSSupport = IPV6_CS;
588 break;
589 case eCS802_3PacketEthernet:
590 case eCS802_1QPacketVLAN:
591 curr_packinfo->bEthCSSupport = ETH_CS_802_3;
592 break;
593 case eCSPacketIPV4Over802_1QVLAN:
594 case eCSPacketIPV4Over802_3Ethernet:
595 curr_packinfo->bIPCSSupport = IPV4_CS;
596 curr_packinfo->bEthCSSupport = ETH_CS_802_3;
597 break;
598 case eCSPacketIPV6Over802_1QVLAN:
599 case eCSPacketIPV6Over802_3Ethernet:
600 curr_packinfo->bIPCSSupport = IPV6_CS;
601 curr_packinfo->bEthCSSupport = ETH_CS_802_3;
602 break;
603 default:
604 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
605 "Error in value of CS Classification.. setting default to IP CS\n");
606 curr_packinfo->bIPCSSupport = IPV4_CS;
607 break;
610 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
611 "CopyToAdapter : Queue No : %X ETH CS Support : %X , IP CS Support : %X\n",
612 uiSearchRuleIndex,
613 curr_packinfo->bEthCSSupport,
614 curr_packinfo->bIPCSSupport);
616 /* Store IP Version used */
617 /* Get The Version Of IP used (IPv6 or IPv4) from CSSpecification field of SF */
618 if (curr_packinfo->bIPCSSupport == IPV6_CS)
619 curr_packinfo->ucIpVersion = IPV6;
620 else
621 curr_packinfo->ucIpVersion = IPV4;
623 /* To ensure that the ETH CS code doesn't gets executed if the BS doesn't supports ETH CS */
624 if (!Adapter->bETHCSEnabled)
625 curr_packinfo->bEthCSSupport = 0;
627 if (psfLocalSet->u8ServiceClassNameLength > 0 && psfLocalSet->u8ServiceClassNameLength < 32)
628 memcpy(curr_packinfo->ucServiceClassName,
629 psfLocalSet->u8ServiceClassName,
630 psfLocalSet->u8ServiceClassNameLength);
632 curr_packinfo->u8QueueType = psfLocalSet->u8ServiceFlowSchedulingType;
634 if (curr_packinfo->u8QueueType == BE && curr_packinfo->ucDirection)
635 Adapter->usBestEffortQueueIndex = uiSearchRuleIndex;
637 curr_packinfo->ulSFID = ntohl(psfLocalSet->u32SFID);
639 curr_packinfo->u8TrafficPriority = psfLocalSet->u8TrafficPriority;
641 /* copy all the classifier in the Service Flow param structure */
642 for (i = 0; i < psfLocalSet->u8TotalClassifiers; i++) {
643 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
644 "Classifier index =%d", i);
645 psfCSType = &psfLocalSet->cConvergenceSLTypes[i];
646 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
647 "Classifier index =%d", i);
649 if (psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority)
650 curr_packinfo->bClassifierPriority = TRUE;
652 if (psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority)
653 curr_packinfo->bClassifierPriority = TRUE;
655 if (ucDsxType == DSA_ACK) {
656 eClassifierAction = eAddClassifier;
657 } else if (ucDsxType == DSC_ACK) {
658 switch (psfCSType->u8ClassfierDSCAction) {
659 case 0: /* DSC Add Classifier */
660 eClassifierAction = eAddClassifier;
661 break;
662 case 1: /* DSC Replace Classifier */
663 eClassifierAction = eReplaceClassifier;
664 break;
665 case 2: /* DSC Delete Classifier */
666 eClassifierAction = eDeleteClassifier;
667 break;
668 default:
669 eClassifierAction = eInvalidClassifierAction;
673 u16PacketClassificationRuleIndex = ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
675 switch (eClassifierAction) {
676 case eAddClassifier:
677 /* Get a Free Classifier Index From Classifier table for this SF to add the Classifier */
678 /* Contained in this message */
679 nClassifierIndex = SearchClsid(Adapter,
680 ulSFID,
681 u16PacketClassificationRuleIndex);
683 if (nClassifierIndex > MAX_CLASSIFIERS) {
684 nClassifierIndex = SearchFreeClsid(Adapter);
685 if (nClassifierIndex > MAX_CLASSIFIERS) {
686 /* Failed To get a free Entry */
687 BCM_DEBUG_PRINT(Adapter,
688 DBG_TYPE_OTHERS,
689 CONN_MSG,
690 DBG_LVL_ALL,
691 "Error Failed To get a free Classifier Entry");
692 break;
694 /* Copy the Classifier Rule for this service flow into our Classifier table maintained per SF. */
695 CopyClassifierRuleToSF(Adapter, psfCSType,
696 uiSearchRuleIndex,
697 nClassifierIndex);
698 } else {
699 /* This Classifier Already Exists and it is invalid to Add Classifier with existing PCRI */
700 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
701 CONN_MSG,
702 DBG_LVL_ALL,
703 "CopyToAdapter: Error The Specified Classifier Already Exists and attempted To Add Classifier with Same PCRI : 0x%x\n",
704 u16PacketClassificationRuleIndex);
706 break;
707 case eReplaceClassifier:
708 /* Get the Classifier Index From Classifier table for this SF and replace existing Classifier */
709 /* with the new classifier Contained in this message */
710 nClassifierIndex = SearchClsid(Adapter, ulSFID,
711 u16PacketClassificationRuleIndex);
712 if (nClassifierIndex > MAX_CLASSIFIERS) {
713 /* Failed To search the classifier */
714 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
715 CONN_MSG, DBG_LVL_ALL,
716 "Error Search for Classifier To be replaced failed");
717 break;
719 /* Copy the Classifier Rule for this service flow into our Classifier table maintained per SF. */
720 CopyClassifierRuleToSF(Adapter, psfCSType,
721 uiSearchRuleIndex, nClassifierIndex);
722 break;
723 case eDeleteClassifier:
724 /* Get the Classifier Index From Classifier table for this SF and replace existing Classifier */
725 /* with the new classifier Contained in this message */
726 nClassifierIndex = SearchClsid(Adapter, ulSFID,
727 u16PacketClassificationRuleIndex);
728 if (nClassifierIndex > MAX_CLASSIFIERS) {
729 /* Failed To search the classifier */
730 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
731 CONN_MSG, DBG_LVL_ALL,
732 "Error Search for Classifier To be deleted failed");
733 break;
736 /* Delete This classifier */
737 DeleteClassifierRuleFromSF(Adapter, uiSearchRuleIndex,
738 nClassifierIndex);
739 break;
740 default:
741 /* Invalid Action for classifier */
742 break;
746 /* Repeat parsing Classification Entries to process PHS Rules */
747 for (i = 0; i < psfLocalSet->u8TotalClassifiers; i++) {
748 psfCSType = &psfLocalSet->cConvergenceSLTypes[i];
749 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
750 "psfCSType->u8PhsDSCAction : 0x%x\n",
751 psfCSType->u8PhsDSCAction);
753 switch (psfCSType->u8PhsDSCAction) {
754 case eDeleteAllPHSRules:
755 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG,
756 DBG_LVL_ALL,
757 "Deleting All PHS Rules For VCID: 0x%X\n",
758 uVCID);
760 /* Delete All the PHS rules for this Service flow */
761 PhsDeleteSFRules(&Adapter->stBCMPhsContext, uVCID);
762 break;
763 case eDeletePHSRule:
764 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG,
765 DBG_LVL_ALL,
766 "PHS DSC Action = Delete PHS Rule\n");
768 if (psfCSType->cPhsRule.u8PHSI)
769 PhsDeletePHSRule(&Adapter->stBCMPhsContext,
770 uVCID,
771 psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
773 break;
774 default:
775 if (ucDsxType == DSC_ACK) {
776 /* BCM_DEBUG_PRINT(CONN_MSG,("Invalid PHS DSC Action For DSC\n",psfCSType->cPhsRule.u8PHSI)); */
777 break; /* FOr DSC ACK Case PHS DSC Action must be in valid set */
779 /* Proceed To Add PHS rule for DSA_ACK case even if PHS DSC action is unspecified */
780 /* No Break Here . Intentionally! */
782 case eAddPHSRule:
783 case eSetPHSRule:
784 if (psfCSType->cPhsRule.u8PHSI) {
785 /* Apply This PHS Rule to all classifiers whose Associated PHSI Match */
786 apply_phs_rule_to_all_classifiers(Adapter,
787 uiSearchRuleIndex,
788 uVCID,
789 &sPhsRule,
790 &psfCSType->cPhsRule,
791 pstAddIndication);
793 break;
797 if (psfLocalSet->u32MaxSustainedTrafficRate == 0) {
798 /* No Rate Limit . Set Max Sustained Traffic Rate to Maximum */
799 curr_packinfo->uiMaxAllowedRate = WIMAX_MAX_ALLOWED_RATE;
800 } else if (ntohl(psfLocalSet->u32MaxSustainedTrafficRate) > WIMAX_MAX_ALLOWED_RATE) {
801 /* Too large Allowed Rate specified. Limiting to Wi Max Allowed rate */
802 curr_packinfo->uiMaxAllowedRate = WIMAX_MAX_ALLOWED_RATE;
803 } else {
804 curr_packinfo->uiMaxAllowedRate =
805 ntohl(psfLocalSet->u32MaxSustainedTrafficRate);
808 curr_packinfo->uiMaxLatency = ntohl(psfLocalSet->u32MaximumLatency);
809 if (curr_packinfo->uiMaxLatency == 0) /* 0 should be treated as infinite */
810 curr_packinfo->uiMaxLatency = MAX_LATENCY_ALLOWED;
812 if ((curr_packinfo->u8QueueType == ERTPS ||
813 curr_packinfo->u8QueueType == UGS))
814 UGIValue = ntohs(psfLocalSet->u16UnsolicitedGrantInterval);
816 if (UGIValue == 0)
817 UGIValue = DEFAULT_UG_INTERVAL;
820 * For UGI based connections...
821 * DEFAULT_UGI_FACTOR*UGIInterval worth of data is the max token count at host...
822 * The extra amount of token is to ensure that a large amount of jitter won't have loss in throughput...
823 * In case of non-UGI based connection, 200 frames worth of data is the max token count at host...
825 curr_packinfo->uiMaxBucketSize =
826 (DEFAULT_UGI_FACTOR*curr_packinfo->uiMaxAllowedRate*UGIValue)/1000;
828 if (curr_packinfo->uiMaxBucketSize < WIMAX_MAX_MTU*8) {
829 UINT UGIFactor = 0;
830 /* Special Handling to ensure the biggest size of packet can go out from host to FW as follows:
831 * 1. Any packet from Host to FW can go out in different packet size.
832 * 2. So in case the Bucket count is smaller than MTU, the packets of size (Size > TokenCount), will get dropped.
833 * 3. We can allow packets of MaxSize from Host->FW that can go out from FW in multiple SDUs by fragmentation at Wimax Layer
835 UGIFactor = (curr_packinfo->uiMaxLatency/UGIValue + 1);
837 if (UGIFactor > DEFAULT_UGI_FACTOR)
838 curr_packinfo->uiMaxBucketSize =
839 (UGIFactor*curr_packinfo->uiMaxAllowedRate*UGIValue)/1000;
841 if (curr_packinfo->uiMaxBucketSize > WIMAX_MAX_MTU*8)
842 curr_packinfo->uiMaxBucketSize = WIMAX_MAX_MTU*8;
845 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
846 "LAT: %d, UGI: %d\n", curr_packinfo->uiMaxLatency,
847 UGIValue);
848 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
849 "uiMaxAllowedRate: 0x%x, u32MaxSustainedTrafficRate: 0x%x ,uiMaxBucketSize: 0x%x",
850 curr_packinfo->uiMaxAllowedRate,
851 ntohl(psfLocalSet->u32MaxSustainedTrafficRate),
852 curr_packinfo->uiMaxBucketSize);
854 /* copy the extended SF Parameters to Support MIBS */
855 CopyMIBSExtendedSFParameters(Adapter, psfLocalSet, uiSearchRuleIndex);
857 /* store header suppression enabled flag per SF */
858 curr_packinfo->bHeaderSuppressionEnabled =
859 !(psfLocalSet->u8RequesttransmissionPolicy &
860 MASK_DISABLE_HEADER_SUPPRESSION);
862 kfree(curr_packinfo->pstSFIndication);
863 curr_packinfo->pstSFIndication = pstAddIndication;
865 /* Re Sort the SF list in PackInfo according to Traffic Priority */
866 SortPackInfo(Adapter);
868 /* Re Sort the Classifier Rules table and re - arrange
869 * according to Classifier Rule Priority
871 SortClassifiers(Adapter);
872 DumpPhsRules(&Adapter->stBCMPhsContext);
873 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
874 "%s <=====", __func__);
877 /***********************************************************************
878 * Function - DumpCmControlPacket
880 * Description - This routinue Dumps the Contents of the AddIndication
881 * Structure in the Connection Management Control Packet
883 * Parameter - pvBuffer: Pointer to the buffer containing the
884 * AddIndication data.
886 * Returns - None
887 *************************************************************************/
888 static VOID DumpCmControlPacket(PVOID pvBuffer)
890 int uiLoopIndex;
891 int nIndex;
892 struct bcm_add_indication_alt *pstAddIndication;
893 UINT nCurClassifierCnt;
894 struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev);
896 pstAddIndication = pvBuffer;
897 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "======>");
898 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Type: 0x%X", pstAddIndication->u8Type);
899 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Direction: 0x%X", pstAddIndication->u8Direction);
900 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TID: 0x%X", ntohs(pstAddIndication->u16TID));
901 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID: 0x%X", ntohs(pstAddIndication->u16CID));
902 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VCID: 0x%X", ntohs(pstAddIndication->u16VCID));
903 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " AuthorizedSet--->");
904 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID: 0x%X", htonl(pstAddIndication->sfAuthorizedSet.u32SFID));
905 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID: 0x%X", htons(pstAddIndication->sfAuthorizedSet.u16CID));
906 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength: 0x%X",
907 pstAddIndication->sfAuthorizedSet.u8ServiceClassNameLength);
909 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",
910 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[0],
911 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[1],
912 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[2],
913 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[3],
914 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[4],
915 pstAddIndication->sfAuthorizedSet.u8ServiceClassName[5]);
917 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService: 0x%X", pstAddIndication->sfAuthorizedSet.u8MBSService);
918 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet: 0x%X", pstAddIndication->sfAuthorizedSet.u8QosParamSet);
919 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority: 0x%X, %p",
920 pstAddIndication->sfAuthorizedSet.u8TrafficPriority, &pstAddIndication->sfAuthorizedSet.u8TrafficPriority);
921 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxSustainedTrafficRate: 0x%X 0x%p",
922 pstAddIndication->sfAuthorizedSet.u32MaxSustainedTrafficRate,
923 &pstAddIndication->sfAuthorizedSet.u32MaxSustainedTrafficRate);
924 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst: 0x%X", pstAddIndication->sfAuthorizedSet.u32MaxTrafficBurst);
925 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate : 0x%X",
926 pstAddIndication->sfAuthorizedSet.u32MinReservedTrafficRate);
927 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength: 0x%X",
928 pstAddIndication->sfAuthorizedSet.u8VendorSpecificQoSParamLength);
929 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam: 0x%X",
930 pstAddIndication->sfAuthorizedSet.u8VendorSpecificQoSParam[0]);
931 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType: 0x%X",
932 pstAddIndication->sfAuthorizedSet.u8ServiceFlowSchedulingType);
933 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter: 0x%X", pstAddIndication->sfAuthorizedSet.u32ToleratedJitter);
934 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency: 0x%X", pstAddIndication->sfAuthorizedSet.u32MaximumLatency);
935 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%X",
936 pstAddIndication->sfAuthorizedSet.u8FixedLengthVSVariableLengthSDUIndicator);
937 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize: 0x%X", pstAddIndication->sfAuthorizedSet.u8SDUSize);
938 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TargetSAID: 0x%X", pstAddIndication->sfAuthorizedSet.u16TargetSAID);
939 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQEnable: 0x%X", pstAddIndication->sfAuthorizedSet.u8ARQEnable);
940 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQWindowSize: 0x%X", pstAddIndication->sfAuthorizedSet.u16ARQWindowSize);
941 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryTxTimeOut: 0x%X", pstAddIndication->sfAuthorizedSet.u16ARQRetryTxTimeOut);
942 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryRxTimeOut: 0x%X", pstAddIndication->sfAuthorizedSet.u16ARQRetryRxTimeOut);
943 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockLifeTime: 0x%X", pstAddIndication->sfAuthorizedSet.u16ARQBlockLifeTime);
944 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQSyncLossTimeOut: 0x%X", pstAddIndication->sfAuthorizedSet.u16ARQSyncLossTimeOut);
945 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQDeliverInOrder: 0x%X", pstAddIndication->sfAuthorizedSet.u8ARQDeliverInOrder);
946 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRxPurgeTimeOut: 0x%X", pstAddIndication->sfAuthorizedSet.u16ARQRxPurgeTimeOut);
947 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockSize: 0x%X", pstAddIndication->sfAuthorizedSet.u16ARQBlockSize);
948 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8CSSpecification: 0x%X", pstAddIndication->sfAuthorizedSet.u8CSSpecification);
949 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TypeOfDataDeliveryService: 0x%X",
950 pstAddIndication->sfAuthorizedSet.u8TypeOfDataDeliveryService);
951 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16SDUInterArrivalTime: 0x%X", pstAddIndication->sfAuthorizedSet.u16SDUInterArrivalTime);
952 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TimeBase: 0x%X", pstAddIndication->sfAuthorizedSet.u16TimeBase);
953 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8PagingPreference: 0x%X", pstAddIndication->sfAuthorizedSet.u8PagingPreference);
954 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UnsolicitedPollingInterval: 0x%X",
955 pstAddIndication->sfAuthorizedSet.u16UnsolicitedPollingInterval);
957 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "sfAuthorizedSet.u8HARQChannelMapping %x %x %x ",
958 *(unsigned int *)pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping,
959 *(unsigned int *)&pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping[4],
960 *(USHORT *)&pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping[8]);
961 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficIndicationPreference: 0x%X",
962 pstAddIndication->sfAuthorizedSet.u8TrafficIndicationPreference);
963 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Received: 0x%X", pstAddIndication->sfAuthorizedSet.u8TotalClassifiers);
965 nCurClassifierCnt = pstAddIndication->sfAuthorizedSet.u8TotalClassifiers;
966 if (nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
967 nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
969 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "pstAddIndication->sfAuthorizedSet.bValid %d", pstAddIndication->sfAuthorizedSet.bValid);
970 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "pstAddIndication->sfAuthorizedSet.u16MacOverhead %x", pstAddIndication->sfAuthorizedSet.u16MacOverhead);
971 if (!pstAddIndication->sfAuthorizedSet.bValid)
972 pstAddIndication->sfAuthorizedSet.bValid = 1;
973 for (nIndex = 0; nIndex < nCurClassifierCnt; nIndex++) {
974 struct bcm_convergence_types *psfCSType = NULL;
975 psfCSType = &pstAddIndication->sfAuthorizedSet.cConvergenceSLTypes[nIndex];
977 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "psfCSType = %p", psfCSType);
978 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "CCPacketClassificationRuleSI====>");
979 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ClassifierRulePriority: 0x%X ",
980 psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
981 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfServiceLength: 0x%X ",
982 psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
983 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfService[3]: 0x%X ,0x%X ,0x%X ",
984 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0],
985 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1],
986 psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]);
988 for (uiLoopIndex = 0; uiLoopIndex < 1; uiLoopIndex++)
989 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Protocol: 0x%02X ",
990 psfCSType->cCPacketClassificationRule.u8Protocol);
992 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength: 0x%X ",
993 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
995 for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++)
996 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32]: 0x%02X ",
997 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
999 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength: 0x%X ",
1000 psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
1002 for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++)
1003 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddress[32]: 0x%02X ",
1004 psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
1006 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRangeLength:0x%X ",
1007 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
1008 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRange[4]: 0x%02X ,0x%02X ,0x%02X ,0x%02X ",
1009 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0],
1010 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1],
1011 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2],
1012 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]);
1014 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRangeLength: 0x%02X ",
1015 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength);
1016 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRange[4]: 0x%02X ,0x%02X ,0x%02X ,0x%02X ",
1017 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0],
1018 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1],
1019 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2],
1020 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]);
1022 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddressLength: 0x%02X ",
1023 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1025 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1026 DBG_LVL_ALL, "u8EthernetDestMacAddress[6]: %pM",
1027 psfCSType->cCPacketClassificationRule.
1028 u8EthernetDestMacAddress);
1030 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddressLength: 0x%02X ",
1031 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1033 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1034 DBG_LVL_ALL, "u8EthernetSourceMACAddress[6]: %pM",
1035 psfCSType->cCPacketClassificationRule.
1036 u8EthernetSourceMACAddress);
1038 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthertypeLength: 0x%02X ",
1039 psfCSType->cCPacketClassificationRule.u8EthertypeLength);
1040 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Ethertype[3]: 0x%02X ,0x%02X ,0x%02X ",
1041 psfCSType->cCPacketClassificationRule.u8Ethertype[0],
1042 psfCSType->cCPacketClassificationRule.u8Ethertype[1],
1043 psfCSType->cCPacketClassificationRule.u8Ethertype[2]);
1045 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UserPriority: 0x%X ", psfCSType->cCPacketClassificationRule.u16UserPriority);
1046 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VLANID: 0x%X ", psfCSType->cCPacketClassificationRule.u16VLANID);
1047 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8AssociatedPHSI: 0x%02X ", psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
1048 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16PacketClassificationRuleIndex: 0x%X ",
1049 psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
1051 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParamLength: 0x%X ",
1052 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength);
1053 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParam[1]: 0x%X ",
1054 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]);
1055 #ifdef VERSION_D5
1056 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLableLength: 0x%X ",
1057 psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength);
1058 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1059 DBG_LVL_ALL, "u8IPv6FlowLable[6]: 0x%*ph ",
1060 6, psfCSType->cCPacketClassificationRule.
1061 u8IPv6FlowLable);
1062 #endif
1065 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "bValid: 0x%02X", pstAddIndication->sfAuthorizedSet.bValid);
1066 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "AdmittedSet--->");
1067 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID: 0x%X", pstAddIndication->sfAdmittedSet.u32SFID);
1068 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID: 0x%X", pstAddIndication->sfAdmittedSet.u16CID);
1069 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength: 0x%X",
1070 pstAddIndication->sfAdmittedSet.u8ServiceClassNameLength);
1071 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL,
1072 "u8ServiceClassName: 0x%*ph",
1073 6, pstAddIndication->sfAdmittedSet.u8ServiceClassName);
1075 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService: 0x%02X", pstAddIndication->sfAdmittedSet.u8MBSService);
1076 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet: 0x%02X", pstAddIndication->sfAdmittedSet.u8QosParamSet);
1077 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority: 0x%02X", pstAddIndication->sfAdmittedSet.u8TrafficPriority);
1078 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst: 0x%X", pstAddIndication->sfAdmittedSet.u32MaxTrafficBurst);
1079 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate: 0x%X",
1080 pstAddIndication->sfAdmittedSet.u32MinReservedTrafficRate);
1082 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength: 0x%02X",
1083 pstAddIndication->sfAdmittedSet.u8VendorSpecificQoSParamLength);
1084 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam: 0x%02X",
1085 pstAddIndication->sfAdmittedSet.u8VendorSpecificQoSParam[0]);
1086 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType: 0x%02X",
1087 pstAddIndication->sfAdmittedSet.u8ServiceFlowSchedulingType);
1088 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter: 0x%X", pstAddIndication->sfAdmittedSet.u32ToleratedJitter);
1089 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency: 0x%X", pstAddIndication->sfAdmittedSet.u32MaximumLatency);
1090 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%02X",
1091 pstAddIndication->sfAdmittedSet.u8FixedLengthVSVariableLengthSDUIndicator);
1092 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize: 0x%02X", pstAddIndication->sfAdmittedSet.u8SDUSize);
1093 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TargetSAID: 0x%02X", pstAddIndication->sfAdmittedSet.u16TargetSAID);
1094 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQEnable: 0x%02X", pstAddIndication->sfAdmittedSet.u8ARQEnable);
1095 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQWindowSize: 0x%X", pstAddIndication->sfAdmittedSet.u16ARQWindowSize);
1096 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryTxTimeOut: 0x%X", pstAddIndication->sfAdmittedSet.u16ARQRetryTxTimeOut);
1097 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryRxTimeOut: 0x%X", pstAddIndication->sfAdmittedSet.u16ARQRetryRxTimeOut);
1098 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockLifeTime: 0x%X", pstAddIndication->sfAdmittedSet.u16ARQBlockLifeTime);
1099 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQSyncLossTimeOut: 0x%X", pstAddIndication->sfAdmittedSet.u16ARQSyncLossTimeOut);
1100 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQDeliverInOrder: 0x%02X", pstAddIndication->sfAdmittedSet.u8ARQDeliverInOrder);
1101 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRxPurgeTimeOut: 0x%X", pstAddIndication->sfAdmittedSet.u16ARQRxPurgeTimeOut);
1102 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockSize: 0x%X", pstAddIndication->sfAdmittedSet.u16ARQBlockSize);
1103 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8CSSpecification: 0x%02X", pstAddIndication->sfAdmittedSet.u8CSSpecification);
1104 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TypeOfDataDeliveryService: 0x%02X",
1105 pstAddIndication->sfAdmittedSet.u8TypeOfDataDeliveryService);
1106 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16SDUInterArrivalTime: 0x%X", pstAddIndication->sfAdmittedSet.u16SDUInterArrivalTime);
1107 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TimeBase: 0x%X", pstAddIndication->sfAdmittedSet.u16TimeBase);
1108 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8PagingPreference: 0x%X", pstAddIndication->sfAdmittedSet.u8PagingPreference);
1109 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficIndicationPreference: 0x%02X",
1110 pstAddIndication->sfAdmittedSet.u8TrafficIndicationPreference);
1111 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Received: 0x%X", pstAddIndication->sfAdmittedSet.u8TotalClassifiers);
1113 nCurClassifierCnt = pstAddIndication->sfAdmittedSet.u8TotalClassifiers;
1114 if (nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
1115 nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
1117 for (nIndex = 0; nIndex < nCurClassifierCnt; nIndex++) {
1118 struct bcm_convergence_types *psfCSType = NULL;
1120 psfCSType = &pstAddIndication->sfAdmittedSet.cConvergenceSLTypes[nIndex];
1121 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " CCPacketClassificationRuleSI====>");
1122 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ClassifierRulePriority: 0x%02X ",
1123 psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
1124 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfServiceLength: 0x%02X",
1125 psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
1126 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1127 DBG_LVL_ALL, "u8IPTypeOfService[3]: 0x%*ph",
1128 3, psfCSType->cCPacketClassificationRule.
1129 u8IPTypeOfService);
1130 for (uiLoopIndex = 0; uiLoopIndex < 1; uiLoopIndex++)
1131 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Protocol: 0x%02X ", psfCSType->cCPacketClassificationRule.u8Protocol);
1133 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength: 0x%02X ",
1134 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
1136 for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++)
1137 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32]: 0x%02X ",
1138 psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
1140 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength: 0x%02X ",
1141 psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
1143 for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++)
1144 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddress[32]: 0x%02X ",
1145 psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
1147 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRangeLength: 0x%02X ",
1148 psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
1150 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1151 DBG_LVL_ALL, "u8ProtocolSourcePortRange[4]: 0x%*ph ",
1152 4, psfCSType->cCPacketClassificationRule.
1153 u8ProtocolSourcePortRange);
1155 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRangeLength: 0x%02X ",
1156 psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength);
1158 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1159 DBG_LVL_ALL, "u8ProtocolDestPortRange[4]: 0x%*ph ",
1160 4, psfCSType->cCPacketClassificationRule.
1161 u8ProtocolDestPortRange);
1163 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddressLength: 0x%02X ",
1164 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1166 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1167 DBG_LVL_ALL, "u8EthernetDestMacAddress[6]: %pM",
1168 psfCSType->cCPacketClassificationRule.
1169 u8EthernetDestMacAddress);
1171 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddressLength: 0x%02X ",
1172 psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
1174 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1175 DBG_LVL_ALL, "u8EthernetSourceMACAddress[6]: %pM",
1176 psfCSType->cCPacketClassificationRule.
1177 u8EthernetSourceMACAddress);
1179 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthertypeLength: 0x%02X ", psfCSType->cCPacketClassificationRule.u8EthertypeLength);
1180 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1181 DBG_LVL_ALL, "u8Ethertype[3]: 0x%*ph",
1182 3, psfCSType->cCPacketClassificationRule.
1183 u8Ethertype);
1185 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UserPriority: 0x%X ", psfCSType->cCPacketClassificationRule.u16UserPriority);
1186 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VLANID: 0x%X ", psfCSType->cCPacketClassificationRule.u16VLANID);
1187 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8AssociatedPHSI: 0x%02X ", psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
1188 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16PacketClassificationRuleIndex: 0x%X ",
1189 psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
1190 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParamLength: 0x%02X",
1191 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength);
1192 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParam[1]: 0x%02X ",
1193 psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]);
1194 #ifdef VERSION_D5
1195 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLableLength: 0x%X ",
1196 psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength);
1197 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1198 DBG_LVL_ALL, "u8IPv6FlowLable[6]: 0x%*ph ",
1199 6, psfCSType->cCPacketClassificationRule.
1200 u8IPv6FlowLable);
1201 #endif
1204 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "bValid: 0x%X", pstAddIndication->sfAdmittedSet.bValid);
1205 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " ActiveSet--->");
1206 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID: 0x%X", pstAddIndication->sfActiveSet.u32SFID);
1207 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID: 0x%X", pstAddIndication->sfActiveSet.u16CID);
1208 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength: 0x%X", pstAddIndication->sfActiveSet.u8ServiceClassNameLength);
1209 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL,
1210 "u8ServiceClassName: 0x%*ph",
1211 6, pstAddIndication->sfActiveSet.u8ServiceClassName);
1213 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService: 0x%02X", pstAddIndication->sfActiveSet.u8MBSService);
1214 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet: 0x%02X", pstAddIndication->sfActiveSet.u8QosParamSet);
1215 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority: 0x%02X", pstAddIndication->sfActiveSet.u8TrafficPriority);
1216 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst: 0x%X", pstAddIndication->sfActiveSet.u32MaxTrafficBurst);
1217 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate: 0x%X",
1218 pstAddIndication->sfActiveSet.u32MinReservedTrafficRate);
1219 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength: 0x%02X",
1220 pstAddIndication->sfActiveSet.u8VendorSpecificQoSParamLength);
1221 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam: 0x%02X",
1222 pstAddIndication->sfActiveSet.u8VendorSpecificQoSParam[0]);
1223 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType: 0x%02X",
1224 pstAddIndication->sfActiveSet.u8ServiceFlowSchedulingType);
1225 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter: 0x%X", pstAddIndication->sfActiveSet.u32ToleratedJitter);
1226 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency: 0x%X", pstAddIndication->sfActiveSet.u32MaximumLatency);
1227 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%02X",
1228 pstAddIndication->sfActiveSet.u8FixedLengthVSVariableLengthSDUIndicator);
1229 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize: 0x%X", pstAddIndication->sfActiveSet.u8SDUSize);
1230 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16TargetSAID: 0x%X", pstAddIndication->sfActiveSet.u16TargetSAID);
1231 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ARQEnable: 0x%X", pstAddIndication->sfActiveSet.u8ARQEnable);
1232 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQWindowSize: 0x%X", pstAddIndication->sfActiveSet.u16ARQWindowSize);
1233 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRetryTxTimeOut: 0x%X", pstAddIndication->sfActiveSet.u16ARQRetryTxTimeOut);
1234 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRetryRxTimeOut: 0x%X", pstAddIndication->sfActiveSet.u16ARQRetryRxTimeOut);
1235 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQBlockLifeTime: 0x%X", pstAddIndication->sfActiveSet.u16ARQBlockLifeTime);
1236 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQSyncLossTimeOut: 0x%X", pstAddIndication->sfActiveSet.u16ARQSyncLossTimeOut);
1237 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ARQDeliverInOrder: 0x%X", pstAddIndication->sfActiveSet.u8ARQDeliverInOrder);
1238 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRxPurgeTimeOut: 0x%X", pstAddIndication->sfActiveSet.u16ARQRxPurgeTimeOut);
1239 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQBlockSize: 0x%X", pstAddIndication->sfActiveSet.u16ARQBlockSize);
1240 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8CSSpecification: 0x%X", pstAddIndication->sfActiveSet.u8CSSpecification);
1241 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8TypeOfDataDeliveryService: 0x%X",
1242 pstAddIndication->sfActiveSet.u8TypeOfDataDeliveryService);
1243 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16SDUInterArrivalTime: 0x%X", pstAddIndication->sfActiveSet.u16SDUInterArrivalTime);
1244 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16TimeBase: 0x%X", pstAddIndication->sfActiveSet.u16TimeBase);
1245 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8PagingPreference: 0x%X", pstAddIndication->sfActiveSet.u8PagingPreference);
1246 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8TrafficIndicationPreference: 0x%X",
1247 pstAddIndication->sfActiveSet.u8TrafficIndicationPreference);
1248 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Received: 0x%X", pstAddIndication->sfActiveSet.u8TotalClassifiers);
1250 nCurClassifierCnt = pstAddIndication->sfActiveSet.u8TotalClassifiers;
1251 if (nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
1252 nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
1254 for (nIndex = 0; nIndex < nCurClassifierCnt; nIndex++) {
1255 struct bcm_convergence_types *psfCSType = NULL;
1256 struct bcm_packet_class_rules *clsRule = NULL;
1258 psfCSType = &pstAddIndication->sfActiveSet.cConvergenceSLTypes[nIndex];
1259 clsRule = &psfCSType->cCPacketClassificationRule;
1261 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1262 DBG_LVL_ALL, " CCPacketClassificationRuleSI====>");
1263 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1264 DBG_LVL_ALL, " u8ClassifierRulePriority: 0x%X ",
1265 clsRule->u8ClassifierRulePriority);
1266 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1267 DBG_LVL_ALL, " u8IPTypeOfServiceLength: 0x%X ",
1268 clsRule->u8IPTypeOfServiceLength);
1269 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1270 DBG_LVL_ALL,
1271 " u8IPTypeOfService[3]: 0x%X ,0x%X ,0x%X ",
1272 clsRule->u8IPTypeOfService[0],
1273 clsRule->u8IPTypeOfService[1],
1274 clsRule->u8IPTypeOfService[2]);
1276 for (uiLoopIndex = 0; uiLoopIndex < 1; uiLoopIndex++)
1277 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1278 DBG_LVL_ALL,
1279 " u8Protocol: 0x%X ",
1280 clsRule->u8Protocol);
1282 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1283 DBG_LVL_ALL,
1284 "u8IPMaskedSourceAddressLength: 0x%X ",
1285 clsRule->u8IPMaskedSourceAddressLength);
1287 for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++)
1288 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1289 DBG_LVL_ALL,
1290 "u8IPMaskedSourceAddress[32]: 0x%X ",
1291 clsRule->u8IPMaskedSourceAddress[uiLoopIndex]);
1293 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1294 DBG_LVL_ALL,
1295 "u8IPDestinationAddressLength: 0x%02X ",
1296 clsRule->u8IPDestinationAddressLength);
1298 for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++)
1299 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1300 DBG_LVL_ALL,
1301 " u8IPDestinationAddress[32]:0x%X ",
1302 clsRule->u8IPDestinationAddress[uiLoopIndex]);
1304 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1305 DBG_LVL_ALL,
1306 " u8ProtocolSourcePortRangeLength: 0x%X ",
1307 clsRule->u8ProtocolSourcePortRangeLength);
1309 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1310 DBG_LVL_ALL,
1311 " u8ProtocolSourcePortRange[4]: 0x%X ,0x%X ,0x%X ,0x%X ",
1312 clsRule->u8ProtocolSourcePortRange[0],
1313 clsRule->u8ProtocolSourcePortRange[1],
1314 clsRule->u8ProtocolSourcePortRange[2],
1315 clsRule->u8ProtocolSourcePortRange[3]);
1317 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1318 DBG_LVL_ALL,
1319 " u8ProtocolDestPortRangeLength: 0x%X ",
1320 clsRule->u8ProtocolDestPortRangeLength);
1321 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1322 DBG_LVL_ALL,
1323 " u8ProtocolDestPortRange[4]: 0x%X ,0x%X ,0x%X ,0x%X ",
1324 clsRule->u8ProtocolDestPortRange[0],
1325 clsRule->u8ProtocolDestPortRange[1],
1326 clsRule->u8ProtocolDestPortRange[2],
1327 clsRule->u8ProtocolDestPortRange[3]);
1329 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1330 DBG_LVL_ALL,
1331 " u8EthernetDestMacAddressLength: 0x%X ",
1332 clsRule->u8EthernetDestMacAddressLength);
1333 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1334 DBG_LVL_ALL,
1335 " u8EthernetDestMacAddress[6]: 0x%X ,0x%X ,0x%X ,0x%X ,0x%X ,0x%X",
1336 clsRule->u8EthernetDestMacAddress[0],
1337 clsRule->u8EthernetDestMacAddress[1],
1338 clsRule->u8EthernetDestMacAddress[2],
1339 clsRule->u8EthernetDestMacAddress[3],
1340 clsRule->u8EthernetDestMacAddress[4],
1341 clsRule->u8EthernetDestMacAddress[5]);
1343 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1344 DBG_LVL_ALL,
1345 " u8EthernetSourceMACAddressLength: 0x%X ",
1346 clsRule->u8EthernetDestMacAddressLength);
1347 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1348 DBG_LVL_ALL,
1349 "u8EthernetSourceMACAddress[6]: 0x%X ,0x%X ,0x%X ,0x%X ,0x%X ,0x%X",
1350 clsRule->u8EthernetSourceMACAddress[0],
1351 clsRule->u8EthernetSourceMACAddress[1],
1352 clsRule->u8EthernetSourceMACAddress[2],
1353 clsRule->u8EthernetSourceMACAddress[3],
1354 clsRule->u8EthernetSourceMACAddress[4],
1355 clsRule->u8EthernetSourceMACAddress[5]);
1357 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1358 DBG_LVL_ALL, " u8EthertypeLength: 0x%X ",
1359 clsRule->u8EthertypeLength);
1360 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1361 DBG_LVL_ALL,
1362 " u8Ethertype[3]: 0x%X ,0x%X ,0x%X ",
1363 clsRule->u8Ethertype[0],
1364 clsRule->u8Ethertype[1],
1365 clsRule->u8Ethertype[2]);
1366 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1367 DBG_LVL_ALL, " u16UserPriority: 0x%X ",
1368 clsRule->u16UserPriority);
1369 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1370 DBG_LVL_ALL, " u16VLANID: 0x%X ",
1371 clsRule->u16VLANID);
1372 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1373 DBG_LVL_ALL, " u8AssociatedPHSI: 0x%X ",
1374 clsRule->u8AssociatedPHSI);
1375 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1376 DBG_LVL_ALL,
1377 " u16PacketClassificationRuleIndex:0x%X ",
1378 clsRule->u16PacketClassificationRuleIndex);
1380 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1381 DBG_LVL_ALL,
1382 " u8VendorSpecificClassifierParamLength:0x%X ",
1383 clsRule->u8VendorSpecificClassifierParamLength);
1384 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1385 DBG_LVL_ALL,
1386 " u8VendorSpecificClassifierParam[1]:0x%X ",
1387 clsRule->u8VendorSpecificClassifierParam[0]);
1388 #ifdef VERSION_D5
1389 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1390 DBG_LVL_ALL, " u8IPv6FlowLableLength: 0x%X ",
1391 clsRule->u8IPv6FlowLableLength);
1392 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
1393 DBG_LVL_ALL,
1394 " u8IPv6FlowLable[6]: 0x%X ,0x%X ,0x%X ,0x%X ,0x%X ,0x%X ",
1395 clsRule->u8IPv6FlowLable[0],
1396 clsRule->u8IPv6FlowLable[1],
1397 clsRule->u8IPv6FlowLable[2],
1398 clsRule->u8IPv6FlowLable[3],
1399 clsRule->u8IPv6FlowLable[4],
1400 clsRule->u8IPv6FlowLable[5]);
1401 #endif
1404 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL,
1405 " bValid: 0x%X", pstAddIndication->sfActiveSet.bValid);
1408 static inline ULONG RestoreSFParam(struct bcm_mini_adapter *Adapter,
1409 ULONG ulAddrSFParamSet, PUCHAR pucDestBuffer)
1411 UINT nBytesToRead = sizeof(struct bcm_connect_mgr_params);
1413 if (ulAddrSFParamSet == 0 || NULL == pucDestBuffer) {
1414 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1415 "Got Param address as 0!!");
1416 return 0;
1418 ulAddrSFParamSet = ntohl(ulAddrSFParamSet);
1420 /* Read out the SF Param Set At the indicated Location */
1421 if (rdm(Adapter, ulAddrSFParamSet,(PUCHAR)pucDestBuffer, nBytesToRead) < 0)
1422 return STATUS_FAILURE;
1424 return 1;
1427 static ULONG StoreSFParam(struct bcm_mini_adapter *Adapter, PUCHAR pucSrcBuffer,
1428 ULONG ulAddrSFParamSet)
1430 UINT nBytesToWrite = sizeof(struct bcm_connect_mgr_params);
1431 int ret = 0;
1433 if (ulAddrSFParamSet == 0 || NULL == pucSrcBuffer)
1434 return 0;
1436 ret = wrm(Adapter, ulAddrSFParamSet, (u8 *)pucSrcBuffer, nBytesToWrite);
1437 if (ret < 0) {
1438 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1439 "%s:%d WRM failed", __func__, __LINE__);
1440 return ret;
1442 return 1;
1445 ULONG StoreCmControlResponseMessage(struct bcm_mini_adapter *Adapter,
1446 PVOID pvBuffer, UINT *puBufferLength)
1448 struct bcm_add_indication_alt *pstAddIndicationAlt = NULL;
1449 struct bcm_add_indication *pstAddIndication = NULL;
1450 struct bcm_del_request *pstDeletionRequest;
1451 UINT uiSearchRuleIndex;
1452 ULONG ulSFID;
1454 pstAddIndicationAlt = pvBuffer;
1457 * In case of DSD Req By MS, we should immediately delete this SF so that
1458 * we can stop the further classifying the pkt for this SF.
1460 if (pstAddIndicationAlt->u8Type == DSD_REQ) {
1461 pstDeletionRequest = pvBuffer;
1463 ulSFID = ntohl(pstDeletionRequest->u32SFID);
1464 uiSearchRuleIndex = SearchSfid(Adapter, ulSFID);
1466 if (uiSearchRuleIndex < NO_OF_QUEUES) {
1467 deleteSFBySfid(Adapter, uiSearchRuleIndex);
1468 Adapter->u32TotalDSD++;
1470 return 1;
1473 if ((pstAddIndicationAlt->u8Type == DSD_RSP) ||
1474 (pstAddIndicationAlt->u8Type == DSD_ACK)) {
1475 /* No Special handling send the message as it is */
1476 return 1;
1478 /* For DSA_REQ, only up to "psfAuthorizedSet" parameter should be accessed by driver! */
1480 pstAddIndication = kmalloc(sizeof(struct bcm_add_indication),
1481 GFP_KERNEL);
1482 if (pstAddIndication == NULL)
1483 return 0;
1485 /* AUTHORIZED SET */
1486 pstAddIndication->psfAuthorizedSet = (struct bcm_connect_mgr_params *)
1487 GetNextTargetBufferLocation(Adapter,
1488 pstAddIndicationAlt->u16TID);
1489 if (!pstAddIndication->psfAuthorizedSet) {
1490 kfree(pstAddIndication);
1491 return 0;
1494 if (StoreSFParam(Adapter, (PUCHAR)&pstAddIndicationAlt->sfAuthorizedSet,
1495 (ULONG)pstAddIndication->psfAuthorizedSet) != 1) {
1496 kfree(pstAddIndication);
1497 return 0;
1500 /* this can't possibly be right */
1501 pstAddIndication->psfAuthorizedSet =
1502 (struct bcm_connect_mgr_params *) ntohl(
1503 (ULONG)pstAddIndication->psfAuthorizedSet);
1505 if (pstAddIndicationAlt->u8Type == DSA_REQ) {
1506 struct bcm_add_request AddRequest;
1508 AddRequest.u8Type = pstAddIndicationAlt->u8Type;
1509 AddRequest.eConnectionDir = pstAddIndicationAlt->u8Direction;
1510 AddRequest.u16TID = pstAddIndicationAlt->u16TID;
1511 AddRequest.u16CID = pstAddIndicationAlt->u16CID;
1512 AddRequest.u16VCID = pstAddIndicationAlt->u16VCID;
1513 AddRequest.psfParameterSet = pstAddIndication->psfAuthorizedSet;
1514 (*puBufferLength) = sizeof(struct bcm_add_request);
1515 memcpy(pvBuffer, &AddRequest, sizeof(struct bcm_add_request));
1516 kfree(pstAddIndication);
1517 return 1;
1520 /* Since it's not DSA_REQ, we can access all field in pstAddIndicationAlt */
1521 /* We need to extract the structure from the buffer and pack it differently */
1523 pstAddIndication->u8Type = pstAddIndicationAlt->u8Type;
1524 pstAddIndication->eConnectionDir = pstAddIndicationAlt->u8Direction;
1525 pstAddIndication->u16TID = pstAddIndicationAlt->u16TID;
1526 pstAddIndication->u16CID = pstAddIndicationAlt->u16CID;
1527 pstAddIndication->u16VCID = pstAddIndicationAlt->u16VCID;
1528 pstAddIndication->u8CC = pstAddIndicationAlt->u8CC;
1530 /* ADMITTED SET */
1531 pstAddIndication->psfAdmittedSet = (struct bcm_connect_mgr_params *)
1532 GetNextTargetBufferLocation(Adapter,
1533 pstAddIndicationAlt->u16TID);
1534 if (!pstAddIndication->psfAdmittedSet) {
1535 kfree(pstAddIndication);
1536 return 0;
1538 if (StoreSFParam(Adapter, (PUCHAR)&pstAddIndicationAlt->sfAdmittedSet,
1539 (ULONG)pstAddIndication->psfAdmittedSet) != 1) {
1540 kfree(pstAddIndication);
1541 return 0;
1544 pstAddIndication->psfAdmittedSet =
1545 (struct bcm_connect_mgr_params *) ntohl(
1546 (ULONG) pstAddIndication->psfAdmittedSet);
1548 /* ACTIVE SET */
1549 pstAddIndication->psfActiveSet = (struct bcm_connect_mgr_params *)
1550 GetNextTargetBufferLocation(Adapter,
1551 pstAddIndicationAlt->u16TID);
1552 if (!pstAddIndication->psfActiveSet) {
1553 kfree(pstAddIndication);
1554 return 0;
1556 if (StoreSFParam(Adapter, (PUCHAR)&pstAddIndicationAlt->sfActiveSet,
1557 (ULONG)pstAddIndication->psfActiveSet) != 1) {
1558 kfree(pstAddIndication);
1559 return 0;
1562 pstAddIndication->psfActiveSet =
1563 (struct bcm_connect_mgr_params *) ntohl(
1564 (ULONG)pstAddIndication->psfActiveSet);
1566 (*puBufferLength) = sizeof(struct bcm_add_indication);
1567 *(struct bcm_add_indication *)pvBuffer = *pstAddIndication;
1568 kfree(pstAddIndication);
1569 return 1;
1572 static inline struct bcm_add_indication_alt
1573 *RestoreCmControlResponseMessage(register struct bcm_mini_adapter *Adapter,
1574 register PVOID pvBuffer)
1576 ULONG ulStatus = 0;
1577 struct bcm_add_indication *pstAddIndication = NULL;
1578 struct bcm_add_indication_alt *pstAddIndicationDest = NULL;
1580 pstAddIndication = pvBuffer;
1581 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1582 "=====>");
1583 if ((pstAddIndication->u8Type == DSD_REQ) ||
1584 (pstAddIndication->u8Type == DSD_RSP) ||
1585 (pstAddIndication->u8Type == DSD_ACK))
1586 return pvBuffer;
1588 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1589 "Inside RestoreCmControlResponseMessage ");
1591 * Need to Allocate memory to contain the SUPER Large structures
1592 * Our driver can't create these structures on Stack :(
1594 pstAddIndicationDest = kmalloc(sizeof(struct bcm_add_indication_alt),
1595 GFP_KERNEL);
1597 if (pstAddIndicationDest) {
1598 memset(pstAddIndicationDest, 0,
1599 sizeof(struct bcm_add_indication_alt));
1600 } else {
1601 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG,
1602 DBG_LVL_ALL,
1603 "Failed to allocate memory for SF Add Indication Structure ");
1604 return NULL;
1606 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1607 "AddIndication-u8Type : 0x%X",
1608 pstAddIndication->u8Type);
1609 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1610 "AddIndication-u8Direction : 0x%X",
1611 pstAddIndication->eConnectionDir);
1612 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1613 "AddIndication-u8TID : 0x%X",
1614 ntohs(pstAddIndication->u16TID));
1615 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1616 "AddIndication-u8CID : 0x%X",
1617 ntohs(pstAddIndication->u16CID));
1618 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1619 "AddIndication-u16VCID : 0x%X",
1620 ntohs(pstAddIndication->u16VCID));
1621 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1622 "AddIndication-autorized set loc : %p",
1623 pstAddIndication->psfAuthorizedSet);
1624 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1625 "AddIndication-admitted set loc : %p",
1626 pstAddIndication->psfAdmittedSet);
1627 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1628 "AddIndication-Active set loc : %p",
1629 pstAddIndication->psfActiveSet);
1631 pstAddIndicationDest->u8Type = pstAddIndication->u8Type;
1632 pstAddIndicationDest->u8Direction = pstAddIndication->eConnectionDir;
1633 pstAddIndicationDest->u16TID = pstAddIndication->u16TID;
1634 pstAddIndicationDest->u16CID = pstAddIndication->u16CID;
1635 pstAddIndicationDest->u16VCID = pstAddIndication->u16VCID;
1636 pstAddIndicationDest->u8CC = pstAddIndication->u8CC;
1638 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1639 "Restoring Active Set ");
1640 ulStatus = RestoreSFParam(Adapter,
1641 (ULONG)pstAddIndication->psfActiveSet,
1642 (PUCHAR)&pstAddIndicationDest->sfActiveSet);
1643 if (ulStatus != 1)
1644 goto failed_restore_sf_param;
1646 if (pstAddIndicationDest->sfActiveSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
1647 pstAddIndicationDest->sfActiveSet.u8TotalClassifiers =
1648 MAX_CLASSIFIERS_IN_SF;
1650 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1651 "Restoring Admitted Set ");
1652 ulStatus = RestoreSFParam(Adapter,
1653 (ULONG)pstAddIndication->psfAdmittedSet,
1654 (PUCHAR)&pstAddIndicationDest->sfAdmittedSet);
1655 if (ulStatus != 1)
1656 goto failed_restore_sf_param;
1658 if (pstAddIndicationDest->sfAdmittedSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
1659 pstAddIndicationDest->sfAdmittedSet.u8TotalClassifiers =
1660 MAX_CLASSIFIERS_IN_SF;
1662 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1663 "Restoring Authorized Set ");
1664 ulStatus = RestoreSFParam(Adapter,
1665 (ULONG)pstAddIndication->psfAuthorizedSet,
1666 (PUCHAR)&pstAddIndicationDest->sfAuthorizedSet);
1667 if (ulStatus != 1)
1668 goto failed_restore_sf_param;
1670 if (pstAddIndicationDest->sfAuthorizedSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
1671 pstAddIndicationDest->sfAuthorizedSet.u8TotalClassifiers =
1672 MAX_CLASSIFIERS_IN_SF;
1674 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1675 "Dumping the whole raw packet");
1676 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1677 "============================================================");
1678 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1679 " pstAddIndicationDest->sfActiveSet size %zx %p",
1680 sizeof(*pstAddIndicationDest), pstAddIndicationDest);
1681 /* BCM_DEBUG_PRINT_BUFFER(Adapter,DBG_TYPE_OTHERS, CONN_MSG,
1682 * DBG_LVL_ALL, (unsigned char *)pstAddIndicationDest,
1683 * sizeof(*pstAddIndicationDest));
1685 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1686 "============================================================");
1687 return pstAddIndicationDest;
1688 failed_restore_sf_param:
1689 kfree(pstAddIndicationDest);
1690 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1691 "<=====");
1692 return NULL;
1695 ULONG SetUpTargetDsxBuffers(struct bcm_mini_adapter *Adapter)
1697 ULONG ulTargetDsxBuffersBase = 0;
1698 ULONG ulCntTargetBuffers;
1699 ULONG i;
1700 int Status;
1702 if (!Adapter) {
1703 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1704 "Adapter was NULL!!!");
1705 return 0;
1708 if (Adapter->astTargetDsxBuffer[0].ulTargetDsxBuffer)
1709 return 1;
1711 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1712 "Size of Each DSX Buffer(Also size of connection manager parameters): %zx ",
1713 sizeof(struct bcm_connect_mgr_params));
1714 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1715 "Reading DSX buffer From Target location %x ",
1716 DSX_MESSAGE_EXCHANGE_BUFFER);
1718 Status = rdmalt(Adapter, DSX_MESSAGE_EXCHANGE_BUFFER,
1719 (PUINT)&ulTargetDsxBuffersBase, sizeof(UINT));
1720 if (Status < 0) {
1721 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1722 "RDM failed!!");
1723 return 0;
1726 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1727 "Base Address Of DSX Target Buffer : 0x%lx",
1728 ulTargetDsxBuffersBase);
1729 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1730 "Tgt Buffer is Now %lx :", ulTargetDsxBuffersBase);
1731 ulCntTargetBuffers = DSX_MESSAGE_EXCHANGE_BUFFER_SIZE /
1732 sizeof(struct bcm_connect_mgr_params);
1734 Adapter->ulTotalTargetBuffersAvailable =
1735 ulCntTargetBuffers > MAX_TARGET_DSX_BUFFERS ?
1736 MAX_TARGET_DSX_BUFFERS : ulCntTargetBuffers;
1738 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
1739 " Total Target DSX Buffer setup %lx ",
1740 Adapter->ulTotalTargetBuffersAvailable);
1742 for (i = 0; i < Adapter->ulTotalTargetBuffersAvailable; i++) {
1743 Adapter->astTargetDsxBuffer[i].ulTargetDsxBuffer = ulTargetDsxBuffersBase;
1744 Adapter->astTargetDsxBuffer[i].valid = 1;
1745 Adapter->astTargetDsxBuffer[i].tid = 0;
1746 ulTargetDsxBuffersBase += sizeof(struct bcm_connect_mgr_params);
1747 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Target DSX Buffer %lx setup at 0x%lx",
1748 i, Adapter->astTargetDsxBuffer[i].ulTargetDsxBuffer);
1750 Adapter->ulCurrentTargetBuffer = 0;
1751 Adapter->ulFreeTargetBufferCnt = Adapter->ulTotalTargetBuffersAvailable;
1752 return 1;
1755 static ULONG GetNextTargetBufferLocation(struct bcm_mini_adapter *Adapter,
1756 B_UINT16 tid)
1758 ULONG dsx_buf;
1759 ULONG idx, max_try;
1761 if ((Adapter->ulTotalTargetBuffersAvailable == 0)
1762 || (Adapter->ulFreeTargetBufferCnt == 0)) {
1763 ClearTargetDSXBuffer(Adapter, tid, false);
1764 return 0;
1767 idx = Adapter->ulCurrentTargetBuffer;
1768 max_try = Adapter->ulTotalTargetBuffersAvailable;
1769 while ((max_try) && (Adapter->astTargetDsxBuffer[idx].valid != 1)) {
1770 idx = (idx+1) % Adapter->ulTotalTargetBuffersAvailable;
1771 max_try--;
1774 if (max_try == 0) {
1775 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
1776 "\n GetNextTargetBufferLocation : Error No Free Target DSX Buffers FreeCnt : %lx ",
1777 Adapter->ulFreeTargetBufferCnt);
1778 ClearTargetDSXBuffer(Adapter, tid, false);
1779 return 0;
1782 dsx_buf = Adapter->astTargetDsxBuffer[idx].ulTargetDsxBuffer;
1783 Adapter->astTargetDsxBuffer[idx].valid = 0;
1784 Adapter->astTargetDsxBuffer[idx].tid = tid;
1785 Adapter->ulFreeTargetBufferCnt--;
1786 idx = (idx+1)%Adapter->ulTotalTargetBuffersAvailable;
1787 Adapter->ulCurrentTargetBuffer = idx;
1788 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
1789 "GetNextTargetBufferLocation :Returning address %lx tid %d\n",
1790 dsx_buf, tid);
1792 return dsx_buf;
1795 int AllocAdapterDsxBuffer(struct bcm_mini_adapter *Adapter)
1798 * Need to Allocate memory to contain the SUPER Large structures
1799 * Our driver can't create these structures on Stack
1801 Adapter->caDsxReqResp = kmalloc(sizeof(struct bcm_add_indication_alt)
1802 + LEADER_SIZE, GFP_KERNEL);
1803 if (!Adapter->caDsxReqResp)
1804 return -ENOMEM;
1806 return 0;
1809 int FreeAdapterDsxBuffer(struct bcm_mini_adapter *Adapter)
1811 kfree(Adapter->caDsxReqResp);
1812 return 0;
1816 * @ingroup ctrl_pkt_functions
1817 * This routinue would process the Control responses
1818 * for the Connection Management.
1819 * @return - Queue index for the free SFID else returns Invalid Index.
1821 bool CmControlResponseMessage(struct bcm_mini_adapter *Adapter, /* <Pointer to the Adapter structure */
1822 PVOID pvBuffer /* Starting Address of the Buffer, that contains the AddIndication Data */)
1824 struct bcm_connect_mgr_params *psfLocalSet = NULL;
1825 struct bcm_add_indication_alt *pstAddIndication = NULL;
1826 struct bcm_change_indication *pstChangeIndication = NULL;
1827 struct bcm_leader *pLeader = NULL;
1828 INT uiSearchRuleIndex = 0;
1829 ULONG ulSFID;
1832 * Otherwise the message contains a target address from where we need to
1833 * read out the rest of the service flow param structure
1835 pstAddIndication = RestoreCmControlResponseMessage(Adapter, pvBuffer);
1836 if (pstAddIndication == NULL) {
1837 ClearTargetDSXBuffer(Adapter, ((struct bcm_add_indication *)pvBuffer)->u16TID, false);
1838 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Error in restoring Service Flow param structure from DSx message");
1839 return false;
1842 DumpCmControlPacket(pstAddIndication);
1843 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "====>");
1844 pLeader = (struct bcm_leader *)Adapter->caDsxReqResp;
1846 pLeader->Status = CM_CONTROL_NEWDSX_MULTICLASSIFIER_REQ;
1847 pLeader->Vcid = 0;
1849 ClearTargetDSXBuffer(Adapter, pstAddIndication->u16TID, false);
1850 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "### TID RECEIVED %d\n", pstAddIndication->u16TID);
1851 switch (pstAddIndication->u8Type) {
1852 case DSA_REQ:
1853 pLeader->PLength = sizeof(struct bcm_add_indication_alt);
1854 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Sending DSA Response....\n");
1855 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSA RESPONSE TO MAC %d", pLeader->PLength);
1856 *((struct bcm_add_indication_alt *)&(Adapter->caDsxReqResp[LEADER_SIZE]))
1857 = *pstAddIndication;
1858 ((struct bcm_add_indication_alt *)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSA_RSP;
1860 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " VCID = %x", ntohs(pstAddIndication->u16VCID));
1861 CopyBufferToControlPacket(Adapter, (PVOID)Adapter->caDsxReqResp);
1862 kfree(pstAddIndication);
1863 break;
1864 case DSA_RSP:
1865 pLeader->PLength = sizeof(struct bcm_add_indication_alt);
1866 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSA ACK TO MAC %d",
1867 pLeader->PLength);
1868 *((struct bcm_add_indication_alt *)&(Adapter->caDsxReqResp[LEADER_SIZE]))
1869 = *pstAddIndication;
1870 ((struct bcm_add_indication_alt *)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSA_ACK;
1871 /* FALLTHROUGH */
1872 case DSA_ACK:
1873 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "VCID:0x%X",
1874 ntohs(pstAddIndication->u16VCID));
1875 uiSearchRuleIndex = SearchFreeSfid(Adapter);
1876 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "uiSearchRuleIndex:0x%X ",
1877 uiSearchRuleIndex);
1878 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Direction:0x%X ",
1879 pstAddIndication->u8Direction);
1880 if (uiSearchRuleIndex < NO_OF_QUEUES) {
1881 Adapter->PackInfo[uiSearchRuleIndex].ucDirection =
1882 pstAddIndication->u8Direction;
1883 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "bValid:0x%X ",
1884 pstAddIndication->sfActiveSet.bValid);
1885 if (pstAddIndication->sfActiveSet.bValid == TRUE)
1886 Adapter->PackInfo[uiSearchRuleIndex].bActiveSet = TRUE;
1888 if (pstAddIndication->sfAuthorizedSet.bValid == TRUE)
1889 Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet = TRUE;
1891 if (pstAddIndication->sfAdmittedSet.bValid == TRUE)
1892 Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet = TRUE;
1894 if (pstAddIndication->sfActiveSet.bValid == false) {
1895 Adapter->PackInfo[uiSearchRuleIndex].bActive = false;
1896 Adapter->PackInfo[uiSearchRuleIndex].bActivateRequestSent = false;
1897 if (pstAddIndication->sfAdmittedSet.bValid)
1898 psfLocalSet = &pstAddIndication->sfAdmittedSet;
1899 else if (pstAddIndication->sfAuthorizedSet.bValid)
1900 psfLocalSet = &pstAddIndication->sfAuthorizedSet;
1901 } else {
1902 psfLocalSet = &pstAddIndication->sfActiveSet;
1903 Adapter->PackInfo[uiSearchRuleIndex].bActive = TRUE;
1906 if (!psfLocalSet) {
1907 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "No set is valid\n");
1908 Adapter->PackInfo[uiSearchRuleIndex].bActive = false;
1909 Adapter->PackInfo[uiSearchRuleIndex].bValid = false;
1910 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = 0;
1911 kfree(pstAddIndication);
1912 } else if (psfLocalSet->bValid && (pstAddIndication->u8CC == 0)) {
1913 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSA ACK");
1914 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = ntohs(pstAddIndication->u16VCID);
1915 Adapter->PackInfo[uiSearchRuleIndex].usCID = ntohs(pstAddIndication->u16CID);
1917 if (UPLINK_DIR == pstAddIndication->u8Direction)
1918 atomic_set(&Adapter->PackInfo[uiSearchRuleIndex].uiPerSFTxResourceCount, DEFAULT_PERSFCOUNT);
1920 CopyToAdapter(Adapter, psfLocalSet, uiSearchRuleIndex, DSA_ACK, pstAddIndication);
1921 /* don't free pstAddIndication */
1923 /* Inside CopyToAdapter, Sorting of all the SFs take place.
1924 * Hence any access to the newly added SF through uiSearchRuleIndex is invalid.
1925 * SHOULD BE STRICTLY AVOIDED.
1927 /* *(PULONG)(((PUCHAR)pvBuffer)+1)=psfLocalSet->u32SFID; */
1928 memcpy((((PUCHAR)pvBuffer)+1), &psfLocalSet->u32SFID, 4);
1930 if (pstAddIndication->sfActiveSet.bValid == TRUE) {
1931 if (UPLINK_DIR == pstAddIndication->u8Direction) {
1932 if (!Adapter->LinkUpStatus) {
1933 netif_carrier_on(Adapter->dev);
1934 netif_start_queue(Adapter->dev);
1935 Adapter->LinkUpStatus = 1;
1936 if (netif_msg_link(Adapter))
1937 pr_info(PFX "%s: link up\n", Adapter->dev->name);
1938 atomic_set(&Adapter->TxPktAvail, 1);
1939 wake_up(&Adapter->tx_packet_wait_queue);
1940 Adapter->liTimeSinceLastNetEntry = get_seconds();
1944 } else {
1945 Adapter->PackInfo[uiSearchRuleIndex].bActive = false;
1946 Adapter->PackInfo[uiSearchRuleIndex].bValid = false;
1947 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = 0;
1948 kfree(pstAddIndication);
1950 } else {
1951 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "DSA ACK did not get valid SFID");
1952 kfree(pstAddIndication);
1953 return false;
1955 break;
1956 case DSC_REQ:
1957 pLeader->PLength = sizeof(struct bcm_change_indication);
1958 pstChangeIndication = (struct bcm_change_indication *)pstAddIndication;
1959 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSC RESPONSE TO MAC %d", pLeader->PLength);
1961 *((struct bcm_change_indication *)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *pstChangeIndication;
1962 ((struct bcm_change_indication *)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSC_RSP;
1964 CopyBufferToControlPacket(Adapter, (PVOID)Adapter->caDsxReqResp);
1965 kfree(pstAddIndication);
1966 break;
1967 case DSC_RSP:
1968 pLeader->PLength = sizeof(struct bcm_change_indication);
1969 pstChangeIndication = (struct bcm_change_indication *)pstAddIndication;
1970 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSC ACK TO MAC %d", pLeader->PLength);
1971 *((struct bcm_change_indication *)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *pstChangeIndication;
1972 ((struct bcm_change_indication *)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSC_ACK;
1973 /* FALLTHROUGH */
1974 case DSC_ACK:
1975 pstChangeIndication = (struct bcm_change_indication *)pstAddIndication;
1976 uiSearchRuleIndex = SearchSfid(Adapter, ntohl(pstChangeIndication->sfActiveSet.u32SFID));
1977 if (uiSearchRuleIndex > NO_OF_QUEUES-1)
1978 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "SF doesn't exist for which DSC_ACK is received");
1980 if (uiSearchRuleIndex < NO_OF_QUEUES) {
1981 Adapter->PackInfo[uiSearchRuleIndex].ucDirection = pstChangeIndication->u8Direction;
1982 if (pstChangeIndication->sfActiveSet.bValid == TRUE)
1983 Adapter->PackInfo[uiSearchRuleIndex].bActiveSet = TRUE;
1985 if (pstChangeIndication->sfAuthorizedSet.bValid == TRUE)
1986 Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet = TRUE;
1988 if (pstChangeIndication->sfAdmittedSet.bValid == TRUE)
1989 Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet = TRUE;
1991 if (pstChangeIndication->sfActiveSet.bValid == false) {
1992 Adapter->PackInfo[uiSearchRuleIndex].bActive = false;
1993 Adapter->PackInfo[uiSearchRuleIndex].bActivateRequestSent = false;
1995 if (pstChangeIndication->sfAdmittedSet.bValid)
1996 psfLocalSet = &pstChangeIndication->sfAdmittedSet;
1997 else if (pstChangeIndication->sfAuthorizedSet.bValid)
1998 psfLocalSet = &pstChangeIndication->sfAuthorizedSet;
1999 } else {
2000 psfLocalSet = &pstChangeIndication->sfActiveSet;
2001 Adapter->PackInfo[uiSearchRuleIndex].bActive = TRUE;
2004 if (!psfLocalSet) {
2005 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "No set is valid\n");
2006 Adapter->PackInfo[uiSearchRuleIndex].bActive = false;
2007 Adapter->PackInfo[uiSearchRuleIndex].bValid = false;
2008 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = 0;
2009 kfree(pstAddIndication);
2010 } else if (psfLocalSet->bValid && (pstChangeIndication->u8CC == 0)) {
2011 Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = ntohs(pstChangeIndication->u16VCID);
2012 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "CC field is %d bvalid = %d\n",
2013 pstChangeIndication->u8CC, psfLocalSet->bValid);
2014 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "VCID= %d\n", ntohs(pstChangeIndication->u16VCID));
2015 Adapter->PackInfo[uiSearchRuleIndex].usCID = ntohs(pstChangeIndication->u16CID);
2016 CopyToAdapter(Adapter, psfLocalSet, uiSearchRuleIndex, DSC_ACK, pstAddIndication);
2018 *(PULONG)(((PUCHAR)pvBuffer)+1) = psfLocalSet->u32SFID;
2019 } else if (pstChangeIndication->u8CC == 6) {
2020 deleteSFBySfid(Adapter, uiSearchRuleIndex);
2021 kfree(pstAddIndication);
2023 } else {
2024 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "DSC ACK did not get valid SFID");
2025 kfree(pstAddIndication);
2026 return false;
2028 break;
2029 case DSD_REQ:
2030 pLeader->PLength = sizeof(struct bcm_del_indication);
2031 *((struct bcm_del_indication *)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *((struct bcm_del_indication *)pstAddIndication);
2033 ulSFID = ntohl(((struct bcm_del_indication *)pstAddIndication)->u32SFID);
2034 uiSearchRuleIndex = SearchSfid(Adapter, ulSFID);
2035 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSD - Removing connection %x", uiSearchRuleIndex);
2037 if (uiSearchRuleIndex < NO_OF_QUEUES) {
2038 /* Delete All Classifiers Associated with this SFID */
2039 deleteSFBySfid(Adapter, uiSearchRuleIndex);
2040 Adapter->u32TotalDSD++;
2043 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSD RESPONSE TO MAC");
2044 ((struct bcm_del_indication *)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSD_RSP;
2045 CopyBufferToControlPacket(Adapter, (PVOID)Adapter->caDsxReqResp);
2046 /* FALLTHROUGH */
2047 case DSD_RSP:
2048 /* Do nothing as SF has already got Deleted */
2049 break;
2050 case DSD_ACK:
2051 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSD ACK Rcd, let App handle it\n");
2052 break;
2053 default:
2054 kfree(pstAddIndication);
2055 return false;
2057 return TRUE;
2060 int get_dsx_sf_data_to_application(struct bcm_mini_adapter *Adapter,
2061 UINT uiSFId, void __user *user_buffer)
2063 int status = 0;
2064 struct bcm_packet_info *psSfInfo = NULL;
2066 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
2067 "status =%d", status);
2068 status = SearchSfid(Adapter, uiSFId);
2069 if (status >= NO_OF_QUEUES) {
2070 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
2071 "SFID %d not present in queue !!!", uiSFId);
2072 return -EINVAL;
2074 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
2075 "status =%d", status);
2076 psSfInfo = &Adapter->PackInfo[status];
2077 if (psSfInfo->pstSFIndication
2078 && copy_to_user(user_buffer, psSfInfo->pstSFIndication,
2079 sizeof(struct bcm_add_indication_alt))) {
2080 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
2081 "copy to user failed SFID %d, present in queue !!!",
2082 uiSFId);
2083 status = -EFAULT;
2084 return status;
2086 return STATUS_SUCCESS;
2089 VOID OverrideServiceFlowParams(struct bcm_mini_adapter *Adapter,
2090 PUINT puiBuffer)
2092 B_UINT32 u32NumofSFsinMsg = ntohl(*(puiBuffer + 1));
2093 struct bcm_stim_sfhostnotify *pHostInfo = NULL;
2094 UINT uiSearchRuleIndex = 0;
2095 ULONG ulSFID = 0;
2097 puiBuffer += 2;
2098 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
2099 "u32NumofSFsinMsg: 0x%x\n", u32NumofSFsinMsg);
2101 while (u32NumofSFsinMsg != 0 && u32NumofSFsinMsg < NO_OF_QUEUES) {
2102 u32NumofSFsinMsg--;
2103 pHostInfo = (struct bcm_stim_sfhostnotify *)puiBuffer;
2104 puiBuffer = (PUINT)(pHostInfo + 1);
2106 ulSFID = ntohl(pHostInfo->SFID);
2107 uiSearchRuleIndex = SearchSfid(Adapter, ulSFID);
2108 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
2109 "SFID: 0x%lx\n", ulSFID);
2111 if (uiSearchRuleIndex >= NO_OF_QUEUES
2112 || uiSearchRuleIndex == HiPriority) {
2113 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG,
2114 DBG_LVL_ALL,
2115 "The SFID <%lx> doesn't exist in host entry or is Invalid\n",
2116 ulSFID);
2117 continue;
2120 if (pHostInfo->RetainSF == false) {
2121 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG,
2122 DBG_LVL_ALL, "Going to Delete SF");
2123 deleteSFBySfid(Adapter, uiSearchRuleIndex);
2124 } else {
2125 struct bcm_packet_info *packinfo =
2126 &Adapter->PackInfo[uiSearchRuleIndex];
2128 packinfo->usVCID_Value = ntohs(pHostInfo->VCID);
2129 packinfo->usCID = ntohs(pHostInfo->newCID);
2130 packinfo->bActive = false;
2132 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG,
2133 DBG_LVL_ALL,
2134 "pHostInfo->QoSParamSet: 0x%x\n",
2135 pHostInfo->QoSParamSet);
2137 if (pHostInfo->QoSParamSet & 0x1)
2138 packinfo->bAuthorizedSet = TRUE;
2139 if (pHostInfo->QoSParamSet & 0x2)
2140 packinfo->bAdmittedSet = TRUE;
2141 if (pHostInfo->QoSParamSet & 0x4) {
2142 packinfo->bActiveSet = TRUE;
2143 packinfo->bActive = TRUE;
2149 static void restore_endianess_of_pstClassifierEntry(
2150 struct bcm_classifier_rule *pstClassifierEntry,
2151 enum bcm_ipaddr_context eIpAddrContext)
2153 int i;
2154 union u_ip_address *stSrc = &pstClassifierEntry->stSrcIpAddress;
2155 union u_ip_address *stDest = &pstClassifierEntry->stDestIpAddress;
2157 for (i = 0; i < MAX_IP_RANGE_LENGTH * 4; i++) {
2158 if (eIpAddrContext == eSrcIpAddress) {
2159 stSrc->ulIpv6Addr[i] = ntohl(stSrc->ulIpv6Addr[i]);
2160 stSrc->ulIpv6Mask[i] = ntohl(stSrc->ulIpv6Mask[i]);
2161 } else if (eIpAddrContext == eDestIpAddress) {
2162 stDest->ulIpv6Addr[i] = ntohl(stDest->ulIpv6Addr[i]);
2163 stDest->ulIpv6Mask[i] = ntohl(stDest->ulIpv6Mask[i]);
2168 static void apply_phs_rule_to_all_classifiers(
2169 register struct bcm_mini_adapter *Adapter, /* <Pointer to the Adapter structure */
2170 register UINT uiSearchRuleIndex, /* <Index of Queue, to which this data belongs */
2171 USHORT uVCID,
2172 struct bcm_phs_rule *sPhsRule,
2173 struct bcm_phs_rules *cPhsRule,
2174 struct bcm_add_indication_alt *pstAddIndication)
2176 unsigned int uiClassifierIndex = 0;
2177 struct bcm_classifier_rule *curr_classifier = NULL;
2179 if (pstAddIndication->u8Direction == UPLINK_DIR) {
2180 for (uiClassifierIndex = 0; uiClassifierIndex < MAX_CLASSIFIERS; uiClassifierIndex++) {
2181 curr_classifier =
2182 &Adapter->astClassifierTable[uiClassifierIndex];
2183 if ((curr_classifier->bUsed) &&
2184 (curr_classifier->ulSFID == Adapter->PackInfo[uiSearchRuleIndex].ulSFID) &&
2185 (curr_classifier->u8AssociatedPHSI == cPhsRule->u8PHSI)) {
2186 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
2187 "Adding PHS Rule For Classifier: 0x%x cPhsRule.u8PHSI: 0x%x\n",
2188 curr_classifier->uiClassifierRuleIndex,
2189 cPhsRule->u8PHSI);
2190 /* Update The PHS Rule for this classifier as Associated PHSI id defined */
2192 /* Copy the PHS Rule */
2193 sPhsRule->u8PHSI = cPhsRule->u8PHSI;
2194 sPhsRule->u8PHSFLength = cPhsRule->u8PHSFLength;
2195 sPhsRule->u8PHSMLength = cPhsRule->u8PHSMLength;
2196 sPhsRule->u8PHSS = cPhsRule->u8PHSS;
2197 sPhsRule->u8PHSV = cPhsRule->u8PHSV;
2198 memcpy(sPhsRule->u8PHSF, cPhsRule->u8PHSF, MAX_PHS_LENGTHS);
2199 memcpy(sPhsRule->u8PHSM, cPhsRule->u8PHSM, MAX_PHS_LENGTHS);
2200 sPhsRule->u8RefCnt = 0;
2201 sPhsRule->bUnclassifiedPHSRule = false;
2202 sPhsRule->PHSModifiedBytes = 0;
2203 sPhsRule->PHSModifiedNumPackets = 0;
2204 sPhsRule->PHSErrorNumPackets = 0;
2206 /* bPHSRuleAssociated = TRUE; */
2207 /* Store The PHS Rule for this classifier */
2209 PhsUpdateClassifierRule(
2210 &Adapter->stBCMPhsContext,
2211 uVCID,
2212 curr_classifier->uiClassifierRuleIndex,
2213 sPhsRule,
2214 curr_classifier->u8AssociatedPHSI);
2216 /* Update PHS Rule For the Classifier */
2217 if (sPhsRule->u8PHSI) {
2218 curr_classifier->u32PHSRuleID = sPhsRule->u8PHSI;
2219 memcpy(&curr_classifier->sPhsRule, sPhsRule, sizeof(struct bcm_phs_rule));
2223 } else {
2224 /* Error PHS Rule specified in signaling could not be applied to any classifier */
2226 /* Copy the PHS Rule */
2227 sPhsRule->u8PHSI = cPhsRule->u8PHSI;
2228 sPhsRule->u8PHSFLength = cPhsRule->u8PHSFLength;
2229 sPhsRule->u8PHSMLength = cPhsRule->u8PHSMLength;
2230 sPhsRule->u8PHSS = cPhsRule->u8PHSS;
2231 sPhsRule->u8PHSV = cPhsRule->u8PHSV;
2232 memcpy(sPhsRule->u8PHSF, cPhsRule->u8PHSF, MAX_PHS_LENGTHS);
2233 memcpy(sPhsRule->u8PHSM, cPhsRule->u8PHSM, MAX_PHS_LENGTHS);
2234 sPhsRule->u8RefCnt = 0;
2235 sPhsRule->bUnclassifiedPHSRule = TRUE;
2236 sPhsRule->PHSModifiedBytes = 0;
2237 sPhsRule->PHSModifiedNumPackets = 0;
2238 sPhsRule->PHSErrorNumPackets = 0;
2239 /* Store The PHS Rule for this classifier */
2242 * Passing the argument u8PHSI instead of clsid. Because for DL with no classifier rule,
2243 * clsid will be zero hence we can't have multiple PHS rules for the same SF.
2244 * To support multiple PHS rule, passing u8PHSI.
2246 PhsUpdateClassifierRule(
2247 &Adapter->stBCMPhsContext,
2248 uVCID,
2249 sPhsRule->u8PHSI,
2250 sPhsRule,
2251 sPhsRule->u8PHSI);