summaryrefslogtreecommitdiff
path: root/drivers/staging/bcm/InterfaceRx.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-11-01 13:34:35 -0400
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-11-01 13:53:30 -0400
commitcacd92222dd4e04424fa532cf1a222e67c30709b (patch)
treea43d689fc5988d5714c93b87f500445df34323b7 /drivers/staging/bcm/InterfaceRx.c
parentb5ebd85b2bcc0c0a2171e4cc74c61debdc903ddf (diff)
beceem: statistics and transmit queue changes
Use standard network statistics variables and routines. Transmit counters are per queue, and skb mapping is already in skb and does not need to be recomputed. Move SearchVcId to only place it is used. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Diffstat (limited to 'drivers/staging/bcm/InterfaceRx.c')
-rw-r--r--drivers/staging/bcm/InterfaceRx.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/staging/bcm/InterfaceRx.c b/drivers/staging/bcm/InterfaceRx.c
index 07326a97c4a2..533f8ebe0f84 100644
--- a/drivers/staging/bcm/InterfaceRx.c
+++ b/drivers/staging/bcm/InterfaceRx.c
@@ -1,5 +1,15 @@
#include "headers.h"
-extern int SearchVcid(PMINI_ADAPTER , unsigned short);
+
+static int SearchVcid(PMINI_ADAPTER Adapter,unsigned short usVcid)
+{
+ int iIndex=0;
+
+ for(iIndex=(NO_OF_QUEUES-1);iIndex>=0;iIndex--)
+ if(Adapter->PackInfo[iIndex].usVCID_Value == usVcid)
+ return iIndex;
+ return NO_OF_QUEUES+1;
+
+}
static PUSB_RCB
@@ -88,8 +98,7 @@ static void read_bulk_callback(struct urb *urb)
if (netif_msg_rx_err(Adapter))
pr_info(PFX "%s: corrupted leader length...%d\n",
Adapter->dev->name, pLeader->PLength);
- atomic_inc(&Adapter->RxPacketDroppedCount);
- atomic_add(pLeader->PLength, &Adapter->BadRxByteCount);
+ ++Adapter->dev->stats.rx_dropped;
atomic_dec(&psIntfAdapter->uNumRcbUsed);
return;
}
@@ -142,7 +151,6 @@ static void read_bulk_callback(struct urb *urb)
skb_put (skb, pLeader->PLength + ETH_HLEN);
Adapter->PackInfo[QueueIndex].uiTotalRxBytes+=pLeader->PLength;
Adapter->PackInfo[QueueIndex].uiThisPeriodRxBytes+= pLeader->PLength;
- atomic_add(pLeader->PLength, &Adapter->GoodRxByteCount);
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Recived Data pkt of len :0x%X", pLeader->PLength);
if(netif_running(Adapter->dev))
@@ -172,7 +180,10 @@ static void read_bulk_callback(struct urb *urb)
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "i/f not up hance freeing SKB...");
dev_kfree_skb(skb);
}
- atomic_inc(&Adapter->GoodRxPktCount);
+
+ ++Adapter->dev->stats.rx_packets;
+ Adapter->dev->stats.rx_bytes += pLeader->PLength;
+
for(uiIndex = 0 ; uiIndex < MIBS_MAX_HIST_ENTRIES ; uiIndex++)
{
if((pLeader->PLength <= MIBS_PKTSIZEHIST_RANGE*(uiIndex+1))