From f8942e07a3db9d82e8fb11d3d494876b8bae9ff9 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 8 Sep 2010 14:46:36 -0700 Subject: staging: Beeceem USB Wimax driver The Sprint 4G network uses a Wimax dongle with Beecem chipset. The driver is typical of out of tree drivers, but maybe useful for people, and the hardware is readily available. Here is a staging ready version (i.e warts and all) 0. Started with Rel_5.2.7.3P1_USB from Sprint4GDeveloperPack-1.1 1. Consolidated files in staging 2. Remove Dos cr/lf 3. Remove unnecessary ioctl from usbbcm_fops Applied patches that were in the developer pack, surprising there were ones for 2.6.35 already. This is compile tested only, see TODO for what still needs to be done. Signed-off-by: Stephen Hemminger Signed-off-by: Greg Kroah-Hartman --- drivers/staging/bcm/sort.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 drivers/staging/bcm/sort.c (limited to 'drivers/staging/bcm/sort.c') 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; + + } + } + } + } +} -- cgit v1.1