Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ibmtr: convert to internal network_device_stats

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Stephen Hemminger and committed by
David S. Miller
9fd3238e 48b47a5e

+7 -24
+6 -23
drivers/net/tokenring/ibmtr.c
··· 200 200 static void ibmtr_reset_timer(struct timer_list*tmr,struct net_device *dev); 201 201 static void tok_rerun(unsigned long dev_addr); 202 202 static void ibmtr_readlog(struct net_device *dev); 203 - static struct net_device_stats *tok_get_stats(struct net_device *dev); 204 203 static int ibmtr_change_mtu(struct net_device *dev, int mtu); 205 204 static void find_turbo_adapters(int *iolist); 206 205 ··· 824 825 dev->open = tok_open; 825 826 dev->stop = tok_close; 826 827 dev->hard_start_xmit = tok_send_packet; 827 - dev->get_stats = tok_get_stats; 828 828 dev->set_multicast_list = tok_set_multicast_list; 829 829 dev->change_mtu = ibmtr_change_mtu; 830 830 ··· 1458 1460 "%02X\n", 1459 1461 (int)retcode, (int)readb(ti->ssb + 6)); 1460 1462 else 1461 - ti->tr_stats.tx_packets++; 1463 + dev->stats.tx_packets++; 1462 1464 break; 1463 1465 case XMIT_XID_CMD: 1464 1466 DPRINTK("xmit xid ret_code: %02X\n", ··· 1644 1646 break; 1645 1647 } 1646 1648 writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD); 1647 - ti->tr_stats.tx_bytes += ti->current_skb->len; 1649 + dev->stats.tx_bytes += ti->current_skb->len; 1648 1650 dev_kfree_skb_irq(ti->current_skb); 1649 1651 ti->current_skb = NULL; 1650 1652 netif_wake_queue(dev); ··· 1720 1722 if (readb(llc + offsetof(struct trllc, llc)) != UI_CMD) { 1721 1723 SET_PAGE(ti->asb_page); 1722 1724 writeb(DATA_LOST, ti->asb + RETCODE_OFST); 1723 - ti->tr_stats.rx_dropped++; 1725 + dev->stats.rx_dropped++; 1724 1726 writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD); 1725 1727 return; 1726 1728 } ··· 1755 1757 1756 1758 if (!(skb = dev_alloc_skb(skb_size))) { 1757 1759 DPRINTK("out of memory. frame dropped.\n"); 1758 - ti->tr_stats.rx_dropped++; 1760 + dev->stats.rx_dropped++; 1759 1761 SET_PAGE(ti->asb_page); 1760 1762 writeb(DATA_LOST, ti->asb + offsetof(struct asb_rec, ret_code)); 1761 1763 writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD); ··· 1811 1813 1812 1814 writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD); 1813 1815 1814 - ti->tr_stats.rx_bytes += skb->len; 1815 - ti->tr_stats.rx_packets++; 1816 + dev->stats.rx_bytes += skb->len; 1817 + dev->stats.rx_packets++; 1816 1818 1817 1819 skb->protocol = tr_type_trans(skb, dev); 1818 1820 if (IPv4_p) { ··· 1870 1872 1871 1873 netif_stop_queue(dev); 1872 1874 1873 - } 1874 - 1875 - /*****************************************************************************/ 1876 - 1877 - /* tok_get_stats(): Basically a scaffold routine which will return 1878 - the address of the tr_statistics structure associated with 1879 - this device -- the tr.... structure is an ethnet look-alike 1880 - so at least for this iteration may suffice. */ 1881 - 1882 - static struct net_device_stats *tok_get_stats(struct net_device *dev) 1883 - { 1884 - 1885 - struct tok_info *toki; 1886 - toki = netdev_priv(dev); 1887 - return (struct net_device_stats *) &toki->tr_stats; 1888 1875 } 1889 1876 1890 1877 /*****************************************************************************/
+1 -1
include/linux/ibmtr.h
··· 207 207 unsigned short exsap_station_id; 208 208 unsigned short global_int_enable; 209 209 struct sk_buff *current_skb; 210 - struct net_device_stats tr_stats; 210 + 211 211 unsigned char auto_speedsave; 212 212 open_state open_status, sap_status; 213 213 enum {MANUAL, AUTOMATIC} open_mode;