Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213900
b: refs/heads/master
c: 81ce790
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Aug 22, 2010
1 parent 6dd56ab commit 6a1d734
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 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: d3c6e7ad09cebbad1a3dea077668062136626fd2
refs/heads/master: 81ce790bd75d49a0d119f5d7b27405e1d9b1bd57
1 change: 0 additions & 1 deletion trunk/include/net/irda/irlan_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ struct irlan_cb {
int magic;
struct list_head dev_list;
struct net_device *dev; /* Ethernet device structure*/
struct net_device_stats stats;

__u32 saddr; /* Source device address */
__u32 daddr; /* Destination device address */
Expand Down
32 changes: 9 additions & 23 deletions trunk/net/irda/irlan/irlan_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,11 @@ static int irlan_eth_close(struct net_device *dev);
static netdev_tx_t irlan_eth_xmit(struct sk_buff *skb,
struct net_device *dev);
static void irlan_eth_set_multicast_list( struct net_device *dev);
static struct net_device_stats *irlan_eth_get_stats(struct net_device *dev);

static const struct net_device_ops irlan_eth_netdev_ops = {
.ndo_open = irlan_eth_open,
.ndo_stop = irlan_eth_close,
.ndo_start_xmit = irlan_eth_xmit,
.ndo_get_stats = irlan_eth_get_stats,
.ndo_set_multicast_list = irlan_eth_set_multicast_list,
.ndo_change_mtu = eth_change_mtu,
.ndo_validate_addr = eth_validate_addr,
Expand Down Expand Up @@ -208,10 +206,10 @@ static netdev_tx_t irlan_eth_xmit(struct sk_buff *skb,
* tried :-) DB
*/
/* irttp_data_request already free the packet */
self->stats.tx_dropped++;
dev->stats.tx_dropped++;
} else {
self->stats.tx_packets++;
self->stats.tx_bytes += len;
dev->stats.tx_packets++;
dev->stats.tx_bytes += len;
}

return NETDEV_TX_OK;
Expand All @@ -226,15 +224,16 @@ static netdev_tx_t irlan_eth_xmit(struct sk_buff *skb,
int irlan_eth_receive(void *instance, void *sap, struct sk_buff *skb)
{
struct irlan_cb *self = instance;
struct net_device *dev = self->dev;

if (skb == NULL) {
++self->stats.rx_dropped;
dev->stats.rx_dropped++;
return 0;
}
if (skb->len < ETH_HLEN) {
IRDA_DEBUG(0, "%s() : IrLAN frame too short (%d)\n",
__func__, skb->len);
++self->stats.rx_dropped;
dev->stats.rx_dropped++;
dev_kfree_skb(skb);
return 0;
}
Expand All @@ -244,10 +243,10 @@ int irlan_eth_receive(void *instance, void *sap, struct sk_buff *skb)
* might have been previously set by the low level IrDA network
* device driver
*/
skb->protocol = eth_type_trans(skb, self->dev); /* Remove eth header */
skb->protocol = eth_type_trans(skb, dev); /* Remove eth header */

self->stats.rx_packets++;
self->stats.rx_bytes += skb->len;
dev->stats.rx_packets++;
dev->stats.rx_bytes += skb->len;

netif_rx(skb); /* Eat it! */

Expand Down Expand Up @@ -348,16 +347,3 @@ static void irlan_eth_set_multicast_list(struct net_device *dev)
else
irlan_set_broadcast_filter(self, FALSE);
}

/*
* Function irlan_get_stats (dev)
*
* Get the current statistics for this device
*
*/
static struct net_device_stats *irlan_eth_get_stats(struct net_device *dev)
{
struct irlan_cb *self = netdev_priv(dev);

return &self->stats;
}

0 comments on commit 6a1d734

Please sign in to comment.