aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tokenring/ibmtr.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2009-01-09 08:01:19 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-21 17:02:26 -0500
commit9fd3238e95046b61d518ddacaa767fa09f31b0d0 (patch)
tree3d74be286e6ca1f221e424db0897e2a08140e3d0 /drivers/net/tokenring/ibmtr.c
parent48b47a5e306c1c119ee81ccd24d487c2df656410 (diff)
ibmtr: convert to internal network_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tokenring/ibmtr.c')
-rw-r--r--drivers/net/tokenring/ibmtr.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
index fa7bce6e0c6d..f195d54ae421 100644
--- a/drivers/net/tokenring/ibmtr.c
+++ b/drivers/net/tokenring/ibmtr.c
@@ -200,7 +200,6 @@ static void tr_rx(struct net_device *dev);
200static void ibmtr_reset_timer(struct timer_list*tmr,struct net_device *dev); 200static void ibmtr_reset_timer(struct timer_list*tmr,struct net_device *dev);
201static void tok_rerun(unsigned long dev_addr); 201static void tok_rerun(unsigned long dev_addr);
202static void ibmtr_readlog(struct net_device *dev); 202static void ibmtr_readlog(struct net_device *dev);
203static struct net_device_stats *tok_get_stats(struct net_device *dev);
204static int ibmtr_change_mtu(struct net_device *dev, int mtu); 203static int ibmtr_change_mtu(struct net_device *dev, int mtu);
205static void find_turbo_adapters(int *iolist); 204static void find_turbo_adapters(int *iolist);
206 205
@@ -825,7 +824,6 @@ static int __devinit trdev_init(struct net_device *dev)
825 dev->open = tok_open; 824 dev->open = tok_open;
826 dev->stop = tok_close; 825 dev->stop = tok_close;
827 dev->hard_start_xmit = tok_send_packet; 826 dev->hard_start_xmit = tok_send_packet;
828 dev->get_stats = tok_get_stats;
829 dev->set_multicast_list = tok_set_multicast_list; 827 dev->set_multicast_list = tok_set_multicast_list;
830 dev->change_mtu = ibmtr_change_mtu; 828 dev->change_mtu = ibmtr_change_mtu;
831 829
@@ -1460,7 +1458,7 @@ static irqreturn_t tok_interrupt(int irq, void *dev_id)
1460 "%02X\n", 1458 "%02X\n",
1461 (int)retcode, (int)readb(ti->ssb + 6)); 1459 (int)retcode, (int)readb(ti->ssb + 6));
1462 else 1460 else
1463 ti->tr_stats.tx_packets++; 1461 dev->stats.tx_packets++;
1464 break; 1462 break;
1465 case XMIT_XID_CMD: 1463 case XMIT_XID_CMD:
1466 DPRINTK("xmit xid ret_code: %02X\n", 1464 DPRINTK("xmit xid ret_code: %02X\n",
@@ -1646,7 +1644,7 @@ static void tr_tx(struct net_device *dev)
1646 break; 1644 break;
1647 } 1645 }
1648 writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD); 1646 writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD);
1649 ti->tr_stats.tx_bytes += ti->current_skb->len; 1647 dev->stats.tx_bytes += ti->current_skb->len;
1650 dev_kfree_skb_irq(ti->current_skb); 1648 dev_kfree_skb_irq(ti->current_skb);
1651 ti->current_skb = NULL; 1649 ti->current_skb = NULL;
1652 netif_wake_queue(dev); 1650 netif_wake_queue(dev);
@@ -1722,7 +1720,7 @@ static void tr_rx(struct net_device *dev)
1722 if (readb(llc + offsetof(struct trllc, llc)) != UI_CMD) { 1720 if (readb(llc + offsetof(struct trllc, llc)) != UI_CMD) {
1723 SET_PAGE(ti->asb_page); 1721 SET_PAGE(ti->asb_page);
1724 writeb(DATA_LOST, ti->asb + RETCODE_OFST); 1722 writeb(DATA_LOST, ti->asb + RETCODE_OFST);
1725 ti->tr_stats.rx_dropped++; 1723 dev->stats.rx_dropped++;
1726 writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD); 1724 writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD);
1727 return; 1725 return;
1728 } 1726 }
@@ -1757,7 +1755,7 @@ static void tr_rx(struct net_device *dev)
1757 1755
1758 if (!(skb = dev_alloc_skb(skb_size))) { 1756 if (!(skb = dev_alloc_skb(skb_size))) {
1759 DPRINTK("out of memory. frame dropped.\n"); 1757 DPRINTK("out of memory. frame dropped.\n");
1760 ti->tr_stats.rx_dropped++; 1758 dev->stats.rx_dropped++;
1761 SET_PAGE(ti->asb_page); 1759 SET_PAGE(ti->asb_page);
1762 writeb(DATA_LOST, ti->asb + offsetof(struct asb_rec, ret_code)); 1760 writeb(DATA_LOST, ti->asb + offsetof(struct asb_rec, ret_code));
1763 writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD); 1761 writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD);
@@ -1813,8 +1811,8 @@ static void tr_rx(struct net_device *dev)
1813 1811
1814 writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD); 1812 writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD);
1815 1813
1816 ti->tr_stats.rx_bytes += skb->len; 1814 dev->stats.rx_bytes += skb->len;
1817 ti->tr_stats.rx_packets++; 1815 dev->stats.rx_packets++;
1818 1816
1819 skb->protocol = tr_type_trans(skb, dev); 1817 skb->protocol = tr_type_trans(skb, dev);
1820 if (IPv4_p) { 1818 if (IPv4_p) {
@@ -1876,21 +1874,6 @@ static void ibmtr_readlog(struct net_device *dev)
1876 1874
1877/*****************************************************************************/ 1875/*****************************************************************************/
1878 1876
1879/* tok_get_stats(): Basically a scaffold routine which will return
1880 the address of the tr_statistics structure associated with
1881 this device -- the tr.... structure is an ethnet look-alike
1882 so at least for this iteration may suffice. */
1883
1884static struct net_device_stats *tok_get_stats(struct net_device *dev)
1885{
1886
1887 struct tok_info *toki;
1888 toki = netdev_priv(dev);
1889 return (struct net_device_stats *) &toki->tr_stats;
1890}
1891
1892/*****************************************************************************/
1893
1894static int ibmtr_change_mtu(struct net_device *dev, int mtu) 1877static int ibmtr_change_mtu(struct net_device *dev, int mtu)
1895{ 1878{
1896 struct tok_info *ti = netdev_priv(dev); 1879 struct tok_info *ti = netdev_priv(dev);