33 ulSrcIP=
ntohl(ulSrcIP);
66 ulDestIP=
ntohl(ulDestIP);
126 for(ucLoopIndex=0;ucLoopIndex<pstClassifierRule->
ucProtocolLength;ucLoopIndex++)
129 if(pstClassifierRule->
ucProtocol[ucLoopIndex]==ucProtocol)
160 if(ushSrcPort <= pstClassifierRule->usSrcPortRangeHi[ucLoopIndex] &&
193 if(ushDestPort <= pstClassifierRule->usDestPortRangeHi[ucLoopIndex] &&
226 bClassificationSucceed =
FALSE;
236 if(
FALSE == (bClassificationSucceed =
241 if(
FALSE == (bClassificationSucceed =
246 if(
FALSE == (bClassificationSucceed =
254 if(
FALSE == (bClassificationSucceed =
266 if(
FALSE == (bClassificationSucceed =
269 xprt_hdr->
uhdr.source:xprt_hdr->
thdr.source))))
275 xprt_hdr->
thdr.dest);
276 if(
FALSE == (bClassificationSucceed =
279 xprt_hdr->
uhdr.dest:xprt_hdr->
thdr.dest))))
283 if(
TRUE==bClassificationSucceed)
285 INT iMatchedSFQueueIndex = 0;
289 bClassificationSucceed =
FALSE;
295 bClassificationSucceed =
FALSE;
302 return bClassificationSucceed;
309 for(iIndex = 0; iIndex <
HiPriority; iIndex++)
311 if(!Adapter->
PackInfo[iIndex].bValid)
314 PruneQueue(Adapter, iIndex);
336 if(!Adapter || (iIndex < 0) || (iIndex >
HiPriority))
340 netstats = &Adapter->
dev->stats;
342 spin_lock_bh(&Adapter->
PackInfo[iIndex].SFQueueLock);
349 Adapter->
PackInfo[iIndex].uiCurrentBytesOnHost,
350 Adapter->
PackInfo[iIndex].uiMaxBucketSize);
352 PacketToDrop = Adapter->
PackInfo[iIndex].FirstTxQueue;
354 if(PacketToDrop ==
NULL)
364 Adapter->
dev->name, iIndex);
369 Adapter->
PackInfo[iIndex].LastTxQueue);
371 Adapter->
PackInfo[iIndex].uiCurrentBytesOnHost -=
373 Adapter->
PackInfo[iIndex].uiCurrentPacketsOnHost--;
375 Adapter->
PackInfo[iIndex].uiDroppedCountBytes += PacketToDrop->
len;
376 Adapter->
PackInfo[iIndex].uiDroppedCountPackets++;
377 dev_kfree_skb(PacketToDrop);
382 Adapter->
PackInfo[iIndex].uiDroppedCountBytes,
383 Adapter->
PackInfo[iIndex].uiDroppedCountPackets);
388 spin_unlock_bh(&Adapter->
PackInfo[iIndex].SFQueueLock);
398 UINT uiTotalPacketLength;
408 spin_lock_bh(&Adapter->
PackInfo[iQIndex].SFQueueLock);
409 while(Adapter->
PackInfo[iQIndex].FirstTxQueue)
411 PacketToDrop = Adapter->
PackInfo[iQIndex].FirstTxQueue;
414 uiTotalPacketLength = PacketToDrop->
len;
418 uiTotalPacketLength = 0;
421 Adapter->
PackInfo[iQIndex].LastTxQueue);
424 dev_kfree_skb(PacketToDrop);
427 Adapter->
PackInfo[iQIndex].uiCurrentBytesOnHost -= uiTotalPacketLength;
428 Adapter->
PackInfo[iQIndex].uiCurrentPacketsOnHost--;
431 Adapter->
PackInfo[iQIndex].uiDroppedCountBytes += uiTotalPacketLength;
432 Adapter->
PackInfo[iQIndex].uiDroppedCountPackets++;
435 Adapter->
PackInfo[iQIndex].uiDroppedCountBytes,
436 Adapter->
PackInfo[iQIndex].uiDroppedCountPackets);
439 spin_unlock_bh(&Adapter->
PackInfo[iQIndex].SFQueueLock);
458 UCHAR IpHeaderLength;
459 UCHAR TcpHeaderLength;
461 pvEThPayload = skb->
data;
463 EThCSGetPktInfo(Adapter,pvEThPayload,&stEthCsPktInfo);
470 pIpHeader = pvEThPayload +
sizeof(ETH_CS_802_LLC_FRAME);
477 pIpHeader = pvEThPayload +
sizeof(ETH_CS_802_LLC_SNAP_FRAME);
483 pIpHeader = pvEThPayload +
sizeof(ETH_CS_802_Q_FRAME);
489 pIpHeader = pvEThPayload +
sizeof(ETH_CS_ETH2_FRAME);
495 pIpHeader = pvEThPayload +
sizeof(ETH_CS_ETH2_FRAME);
504 bFragmentedPkt =
TRUE;
510 if(pstClassifierRule)
513 bClassificationSucceed=
TRUE;
524 for(uiLoopIndex =
MAX_CLASSIFIERS - 1; uiLoopIndex >= 0; uiLoopIndex--)
526 if(bClassificationSucceed)
534 bClassificationSucceed=
FALSE;
541 bClassificationSucceed=
FALSE;
553 if(Adapter->
PackInfo[uiSfIndex].bEthCSSupport)
559 bClassificationSucceed =
FALSE;
566 bClassificationSucceed = EThCSClassifyPkt(Adapter,skb,&stEthCsPktInfo,pstClassifierRule, Adapter->
PackInfo[uiSfIndex].bEthCSSupport);
568 if(!bClassificationSucceed)
580 bClassificationSucceed =
FALSE;
587 if(Adapter->
PackInfo[uiSfIndex].bIPCSSupport)
593 bClassificationSucceed =
FALSE;
600 bClassificationSucceed = IpVersion4(Adapter,pIpHeader,pstClassifierRule);
602 bClassificationSucceed =
IpVersion6(Adapter,pIpHeader,pstClassifierRule);
608 if(bClassificationSucceed ==
TRUE)
616 IpHeaderLength = pIpHeader->ihl;
621 (
ntohs(pIpHeader->
tot_len) == (IpHeaderLength*4)+(TcpHeaderLength*4)))
631 if(bFragmentedPkt && (usCurrFragment == 0))
646 if(bClassificationSucceed)
739 bClassificationSucceed =
TRUE;
741 if(!bClassificationSucceed)
747 bClassificationSucceed =
FALSE;
758 if(usVLANID == ((pstClassifierRule->
usVLANID & 0xFFF0) >> 4))
759 bClassificationSucceed =
TRUE;
761 if(!bClassificationSucceed)
777 bClassificationSucceed = EthCSMatchSrcMACAddress(pstClassifierRule,((
struct bcm_eth_header *)(skb->
data))->au8SourceAddress);
778 if(!bClassificationSucceed)
782 bClassificationSucceed = EthCSMatchDestMACAddress(pstClassifierRule,((
struct bcm_eth_header *)(skb->
data))->au8DestinationAddress);
783 if(!bClassificationSucceed)
788 bClassificationSucceed = EthCSMatchEThTypeSAP(pstClassifierRule,skb,pstEthCsPktInfo);
789 if(!bClassificationSucceed)
796 bClassificationSucceed = EthCSMatchVLANRules(pstClassifierRule,skb,pstEthCsPktInfo);
797 if(!bClassificationSucceed)
801 return bClassificationSucceed;
818 u16Etype = ((ETH_CS_802_Q_FRAME*)pvEthPayload)->EthType;
824 u16Etype =
ntohs(u16Etype);
833 pstEthCsPktInfo->
ucDSAP = ((ETH_CS_802_LLC_FRAME*)pvEthPayload)->DSAP;
834 if(pstEthCsPktInfo->
ucDSAP == 0xAA && ((ETH_CS_802_LLC_FRAME*)pvEthPayload)->
SSAP == 0xAA)
838 u16Etype = ((ETH_CS_802_LLC_SNAP_FRAME*)pvEthPayload)->usEtherType;