diff options
author | Krzysztof Halasa <khc@pm.waw.pl> | 2008-06-30 17:26:53 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-07-04 08:47:41 -0400 |
commit | 198191c4a7ce4daba379608fb38b9bc5a4eedc61 (patch) | |
tree | 3229362a45a15af42628553926bc040e44c39ce0 /drivers/char/synclinkmp.c | |
parent | 844290e56067aed0a54142d756565abb9614136c (diff) |
WAN: convert drivers to use built-in netdev_stats
There is no point in using separate net_device_stats structs when
the one in struct net_device is present. Compiles.
Signed-off-by: Krzysztof HaĆasa <khc@pm.waw.pl>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/char/synclinkmp.c')
-rw-r--r-- | drivers/char/synclinkmp.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index bec54866e0bb..10241ed86100 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c | |||
@@ -1678,7 +1678,6 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding, | |||
1678 | static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | 1678 | static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) |
1679 | { | 1679 | { |
1680 | SLMP_INFO *info = dev_to_port(dev); | 1680 | SLMP_INFO *info = dev_to_port(dev); |
1681 | struct net_device_stats *stats = hdlc_stats(dev); | ||
1682 | unsigned long flags; | 1681 | unsigned long flags; |
1683 | 1682 | ||
1684 | if (debug_level >= DEBUG_LEVEL_INFO) | 1683 | if (debug_level >= DEBUG_LEVEL_INFO) |
@@ -1692,8 +1691,8 @@ static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1692 | tx_load_dma_buffer(info, skb->data, skb->len); | 1691 | tx_load_dma_buffer(info, skb->data, skb->len); |
1693 | 1692 | ||
1694 | /* update network statistics */ | 1693 | /* update network statistics */ |
1695 | stats->tx_packets++; | 1694 | dev->stats.tx_packets++; |
1696 | stats->tx_bytes += skb->len; | 1695 | dev->stats.tx_bytes += skb->len; |
1697 | 1696 | ||
1698 | /* done with socket buffer, so free it */ | 1697 | /* done with socket buffer, so free it */ |
1699 | dev_kfree_skb(skb); | 1698 | dev_kfree_skb(skb); |
@@ -1909,14 +1908,13 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1909 | static void hdlcdev_tx_timeout(struct net_device *dev) | 1908 | static void hdlcdev_tx_timeout(struct net_device *dev) |
1910 | { | 1909 | { |
1911 | SLMP_INFO *info = dev_to_port(dev); | 1910 | SLMP_INFO *info = dev_to_port(dev); |
1912 | struct net_device_stats *stats = hdlc_stats(dev); | ||
1913 | unsigned long flags; | 1911 | unsigned long flags; |
1914 | 1912 | ||
1915 | if (debug_level >= DEBUG_LEVEL_INFO) | 1913 | if (debug_level >= DEBUG_LEVEL_INFO) |
1916 | printk("hdlcdev_tx_timeout(%s)\n",dev->name); | 1914 | printk("hdlcdev_tx_timeout(%s)\n",dev->name); |
1917 | 1915 | ||
1918 | stats->tx_errors++; | 1916 | dev->stats.tx_errors++; |
1919 | stats->tx_aborted_errors++; | 1917 | dev->stats.tx_aborted_errors++; |
1920 | 1918 | ||
1921 | spin_lock_irqsave(&info->lock,flags); | 1919 | spin_lock_irqsave(&info->lock,flags); |
1922 | tx_stop(info); | 1920 | tx_stop(info); |
@@ -1949,27 +1947,27 @@ static void hdlcdev_rx(SLMP_INFO *info, char *buf, int size) | |||
1949 | { | 1947 | { |
1950 | struct sk_buff *skb = dev_alloc_skb(size); | 1948 | struct sk_buff *skb = dev_alloc_skb(size); |
1951 | struct net_device *dev = info->netdev; | 1949 | struct net_device *dev = info->netdev; |
1952 | struct net_device_stats *stats = hdlc_stats(dev); | ||
1953 | 1950 | ||
1954 | if (debug_level >= DEBUG_LEVEL_INFO) | 1951 | if (debug_level >= DEBUG_LEVEL_INFO) |
1955 | printk("hdlcdev_rx(%s)\n",dev->name); | 1952 | printk("hdlcdev_rx(%s)\n",dev->name); |
1956 | 1953 | ||
1957 | if (skb == NULL) { | 1954 | if (skb == NULL) { |
1958 | printk(KERN_NOTICE "%s: can't alloc skb, dropping packet\n", dev->name); | 1955 | printk(KERN_NOTICE "%s: can't alloc skb, dropping packet\n", |
1959 | stats->rx_dropped++; | 1956 | dev->name); |
1957 | dev->stats.rx_dropped++; | ||
1960 | return; | 1958 | return; |
1961 | } | 1959 | } |
1962 | 1960 | ||
1963 | memcpy(skb_put(skb, size),buf,size); | 1961 | memcpy(skb_put(skb, size), buf, size); |
1964 | 1962 | ||
1965 | skb->protocol = hdlc_type_trans(skb, info->netdev); | 1963 | skb->protocol = hdlc_type_trans(skb, dev); |
1966 | 1964 | ||
1967 | stats->rx_packets++; | 1965 | dev->stats.rx_packets++; |
1968 | stats->rx_bytes += size; | 1966 | dev->stats.rx_bytes += size; |
1969 | 1967 | ||
1970 | netif_rx(skb); | 1968 | netif_rx(skb); |
1971 | 1969 | ||
1972 | info->netdev->last_rx = jiffies; | 1970 | dev->last_rx = jiffies; |
1973 | } | 1971 | } |
1974 | 1972 | ||
1975 | /** | 1973 | /** |
@@ -4983,9 +4981,8 @@ CheckAgain: | |||
4983 | framesize = 0; | 4981 | framesize = 0; |
4984 | #if SYNCLINK_GENERIC_HDLC | 4982 | #if SYNCLINK_GENERIC_HDLC |
4985 | { | 4983 | { |
4986 | struct net_device_stats *stats = hdlc_stats(info->netdev); | 4984 | info->netdev->stats.rx_errors++; |
4987 | stats->rx_errors++; | 4985 | info->netdev->stats.rx_frame_errors++; |
4988 | stats->rx_frame_errors++; | ||
4989 | } | 4986 | } |
4990 | #endif | 4987 | #endif |
4991 | } | 4988 | } |