Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135427
b: refs/heads/master
c: fe6c6fb
h: refs/heads/master
i:
  135425: e857857
  135423: e6f456c
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Mar 22, 2009
1 parent 5c68b2b commit 4e96ec0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 43 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 39549b1e83e640907b0ed58f76d3331c2ae40e3d
refs/heads/master: fe6c6fbbcdd6675244fbbde62a9790ca57bd2785
68 changes: 26 additions & 42 deletions trunk/drivers/net/wan/sbni.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
/* device private data */

struct net_local {
struct net_device_stats stats;
struct timer_list watchdog;

spinlock_t lock;
Expand Down Expand Up @@ -117,7 +116,6 @@ static int sbni_open( struct net_device * );
static int sbni_close( struct net_device * );
static int sbni_start_xmit( struct sk_buff *, struct net_device * );
static int sbni_ioctl( struct net_device *, struct ifreq *, int );
static struct net_device_stats *sbni_get_stats( struct net_device * );
static void set_multicast_list( struct net_device * );

static irqreturn_t sbni_interrupt( int, void * );
Expand Down Expand Up @@ -723,13 +721,11 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno,
nl->wait_frameno = 0,
nl->inppos = 0,
#ifdef CONFIG_SBNI_MULTILINE
((struct net_local *)netdev_priv(nl->master))
->stats.rx_errors++,
((struct net_local *)netdev_priv(nl->master))
->stats.rx_missed_errors++;
nl->master->stats.rx_errors++,
nl->master->stats.rx_missed_errors++;
#else
nl->stats.rx_errors++,
nl->stats.rx_missed_errors++;
dev->stats.rx_errors++,
dev->stats.rx_missed_errors++;
#endif
/* now skip all frames until is_first != 0 */
} else
Expand All @@ -742,29 +738,28 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno,
*/
nl->wait_frameno = 0,
#ifdef CONFIG_SBNI_MULTILINE
((struct net_local *)netdev_priv(nl->master))
->stats.rx_errors++,
((struct net_local *)netdev_priv(nl->master))
->stats.rx_crc_errors++;
nl->master->stats.rx_errors++,
nl->master->stats.rx_crc_errors++;
#else
nl->stats.rx_errors++,
nl->stats.rx_crc_errors++;
dev->stats.rx_errors++,
dev->stats.rx_crc_errors++;
#endif

return frame_ok;
}


static inline void
send_complete( struct net_local *nl )
send_complete( struct net_device *dev )
{
struct net_local *nl = netdev_priv(dev);

#ifdef CONFIG_SBNI_MULTILINE
((struct net_local *)netdev_priv(nl->master))->stats.tx_packets++;
((struct net_local *)netdev_priv(nl->master))->stats.tx_bytes
+= nl->tx_buf_p->len;
nl->master->stats.tx_packets++;
nl->master->stats.tx_bytes += nl->tx_buf_p->len;
#else
nl->stats.tx_packets++;
nl->stats.tx_bytes += nl->tx_buf_p->len;
dev->stats.tx_packets++;
dev->stats.tx_bytes += nl->tx_buf_p->len;
#endif
dev_kfree_skb_irq( nl->tx_buf_p );

Expand Down Expand Up @@ -792,7 +787,7 @@ interpret_ack( struct net_device *dev, unsigned ack )
nl->maxframe,
nl->tx_buf_p->len - nl->outpos);
else
send_complete( nl ),
send_complete( dev ),
#ifdef CONFIG_SBNI_MULTILINE
netif_wake_queue( nl->master );
#else
Expand Down Expand Up @@ -881,13 +876,11 @@ drop_xmit_queue( struct net_device *dev )
dev_kfree_skb_any( nl->tx_buf_p ),
nl->tx_buf_p = NULL,
#ifdef CONFIG_SBNI_MULTILINE
((struct net_local *)netdev_priv(nl->master))
->stats.tx_errors++,
((struct net_local *)netdev_priv(nl->master))
->stats.tx_carrier_errors++;
nl->master->stats.tx_errors++,
nl->master->stats.tx_carrier_errors++;
#else
nl->stats.tx_errors++,
nl->stats.tx_carrier_errors++;
dev->stats.tx_errors++,
dev->stats.tx_carrier_errors++;
#endif

nl->tx_frameno = 0;
Expand Down Expand Up @@ -1017,14 +1010,13 @@ indicate_pkt( struct net_device *dev )
#ifdef CONFIG_SBNI_MULTILINE
skb->protocol = eth_type_trans( skb, nl->master );
netif_rx( skb );
++((struct net_local *)netdev_priv(nl->master))->stats.rx_packets;
((struct net_local *)netdev_priv(nl->master))->stats.rx_bytes +=
nl->inppos;
++nl->master->stats.rx_packets;
nl->master->stats.rx_bytes += nl->inppos;
#else
skb->protocol = eth_type_trans( skb, dev );
netif_rx( skb );
++nl->stats.rx_packets;
nl->stats.rx_bytes += nl->inppos;
++dev->stats.rx_packets;
dev->stats.rx_bytes += nl->inppos;
#endif
nl->rx_buf_p = NULL; /* protocol driver will clear this sk_buff */
}
Expand Down Expand Up @@ -1197,7 +1189,7 @@ sbni_open( struct net_device *dev )
handler_attached:

spin_lock( &nl->lock );
memset( &nl->stats, 0, sizeof(struct net_device_stats) );
memset( &dev->stats, 0, sizeof(struct net_device_stats) );
memset( &nl->in_stats, 0, sizeof(struct sbni_in_stats) );

card_start( dev );
Expand Down Expand Up @@ -1413,7 +1405,7 @@ enslave( struct net_device *dev, struct net_device *slave_dev )

/* Summary statistics of MultiLine operation will be stored
in master's counters */
memset( &snl->stats, 0, sizeof(struct net_device_stats) );
memset( &slave_dev->stats, 0, sizeof(struct net_device_stats) );
netif_stop_queue( slave_dev );
netif_wake_queue( dev ); /* Now we are able to transmit */

Expand Down Expand Up @@ -1464,14 +1456,6 @@ emancipate( struct net_device *dev )

#endif


static struct net_device_stats *
sbni_get_stats( struct net_device *dev )
{
return &((struct net_local *)netdev_priv(dev))->stats;
}


static void
set_multicast_list( struct net_device *dev )
{
Expand Down

0 comments on commit 4e96ec0

Please sign in to comment.