diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-28 09:44:56 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-28 09:44:56 -0700 |
commit | e4c5bf8e3dca827a1b3a6fac494eae8c74b7e1e7 (patch) | |
tree | ea51b391f7d74ca695dcb9f5e46eb02688a92ed9 /drivers/staging/bcm/sort.c | |
parent | 81280572ca6f54009edfa4deee563e8678784218 (diff) | |
parent | a4ac0d847af9dd34d5953a5e264400326144b6b2 (diff) | |
download | op-kernel-dev-e4c5bf8e3dca827a1b3a6fac494eae8c74b7e1e7.zip op-kernel-dev-e4c5bf8e3dca827a1b3a6fac494eae8c74b7e1e7.tar.gz |
Merge 'staging-next' to Linus's tree
This merges the staging-next tree to Linus's tree and resolves
some conflicts that were present due to changes in other trees that were
affected by files here.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/bcm/sort.c')
-rw-r--r-- | drivers/staging/bcm/sort.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/drivers/staging/bcm/sort.c b/drivers/staging/bcm/sort.c new file mode 100644 index 0000000..fc5d07a --- /dev/null +++ b/drivers/staging/bcm/sort.c @@ -0,0 +1,63 @@ +#include "headers.h" + +/* + * File Name: sort.c + * + * Author: Beceem Communications Pvt. Ltd + * + * Abstract: This file contains the routines sorting the classification rules. + * + * Copyright (c) 2007 Beceem Communications Pvt. Ltd + */ + +VOID SortPackInfo(PMINI_ADAPTER Adapter) +{ + UINT nIndex1; + UINT nIndex2; + + BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "<======="); + + for(nIndex1 = 0; nIndex1 < NO_OF_QUEUES -2 ; nIndex1++) + { + for(nIndex2 = nIndex1 + 1 ; nIndex2 < NO_OF_QUEUES -1 ; nIndex2++) + { + if(Adapter->PackInfo[nIndex1].bValid && Adapter->PackInfo[nIndex2].bValid) + { + if(Adapter->PackInfo[nIndex2].u8TrafficPriority < + Adapter->PackInfo[nIndex1].u8TrafficPriority) + { + PacketInfo stTemppackInfo = Adapter->PackInfo[nIndex2]; + Adapter->PackInfo[nIndex2] = Adapter->PackInfo[nIndex1]; + Adapter->PackInfo[nIndex1] = stTemppackInfo; + + } + } + } + } +} + +VOID SortClassifiers(PMINI_ADAPTER Adapter) +{ + UINT nIndex1; + UINT nIndex2; + + BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "<======="); + + for(nIndex1 = 0; nIndex1 < MAX_CLASSIFIERS -1 ; nIndex1++) + { + for(nIndex2 = nIndex1 + 1 ; nIndex2 < MAX_CLASSIFIERS ; nIndex2++) + { + if(Adapter->astClassifierTable[nIndex1].bUsed && Adapter->astClassifierTable[nIndex2].bUsed) + { + if(Adapter->astClassifierTable[nIndex2].u8ClassifierRulePriority < + Adapter->astClassifierTable[nIndex1].u8ClassifierRulePriority) + { + S_CLASSIFIER_RULE stTempClassifierRule = Adapter->astClassifierTable[nIndex2]; + Adapter->astClassifierTable[nIndex2] = Adapter->astClassifierTable[nIndex1]; + Adapter->astClassifierTable[nIndex1] = stTempClassifierRule; + + } + } + } + } +} |