Commit 9fd3238e authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

ibmtr: convert to internal network_device_stats

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 48b47a5e
...@@ -200,7 +200,6 @@ static void tr_rx(struct net_device *dev); ...@@ -200,7 +200,6 @@ static void tr_rx(struct net_device *dev);
static void ibmtr_reset_timer(struct timer_list*tmr,struct net_device *dev); static void ibmtr_reset_timer(struct timer_list*tmr,struct net_device *dev);
static void tok_rerun(unsigned long dev_addr); static void tok_rerun(unsigned long dev_addr);
static void ibmtr_readlog(struct net_device *dev); static void ibmtr_readlog(struct net_device *dev);
static struct net_device_stats *tok_get_stats(struct net_device *dev);
static int ibmtr_change_mtu(struct net_device *dev, int mtu); static int ibmtr_change_mtu(struct net_device *dev, int mtu);
static void find_turbo_adapters(int *iolist); static void find_turbo_adapters(int *iolist);
...@@ -825,7 +824,6 @@ static int __devinit trdev_init(struct net_device *dev) ...@@ -825,7 +824,6 @@ static int __devinit trdev_init(struct net_device *dev)
dev->open = tok_open; dev->open = tok_open;
dev->stop = tok_close; dev->stop = tok_close;
dev->hard_start_xmit = tok_send_packet; dev->hard_start_xmit = tok_send_packet;
dev->get_stats = tok_get_stats;
dev->set_multicast_list = tok_set_multicast_list; dev->set_multicast_list = tok_set_multicast_list;
dev->change_mtu = ibmtr_change_mtu; dev->change_mtu = ibmtr_change_mtu;
...@@ -1460,7 +1458,7 @@ static irqreturn_t tok_interrupt(int irq, void *dev_id) ...@@ -1460,7 +1458,7 @@ static irqreturn_t tok_interrupt(int irq, void *dev_id)
"%02X\n", "%02X\n",
(int)retcode, (int)readb(ti->ssb + 6)); (int)retcode, (int)readb(ti->ssb + 6));
else else
ti->tr_stats.tx_packets++; dev->stats.tx_packets++;
break; break;
case XMIT_XID_CMD: case XMIT_XID_CMD:
DPRINTK("xmit xid ret_code: %02X\n", DPRINTK("xmit xid ret_code: %02X\n",
...@@ -1646,7 +1644,7 @@ static void tr_tx(struct net_device *dev) ...@@ -1646,7 +1644,7 @@ static void tr_tx(struct net_device *dev)
break; break;
} }
writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD); writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD);
ti->tr_stats.tx_bytes += ti->current_skb->len; dev->stats.tx_bytes += ti->current_skb->len;
dev_kfree_skb_irq(ti->current_skb); dev_kfree_skb_irq(ti->current_skb);
ti->current_skb = NULL; ti->current_skb = NULL;
netif_wake_queue(dev); netif_wake_queue(dev);
...@@ -1722,7 +1720,7 @@ static void tr_rx(struct net_device *dev) ...@@ -1722,7 +1720,7 @@ static void tr_rx(struct net_device *dev)
if (readb(llc + offsetof(struct trllc, llc)) != UI_CMD) { if (readb(llc + offsetof(struct trllc, llc)) != UI_CMD) {
SET_PAGE(ti->asb_page); SET_PAGE(ti->asb_page);
writeb(DATA_LOST, ti->asb + RETCODE_OFST); writeb(DATA_LOST, ti->asb + RETCODE_OFST);
ti->tr_stats.rx_dropped++; dev->stats.rx_dropped++;
writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD); writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD);
return; return;
} }
...@@ -1757,7 +1755,7 @@ static void tr_rx(struct net_device *dev) ...@@ -1757,7 +1755,7 @@ static void tr_rx(struct net_device *dev)
if (!(skb = dev_alloc_skb(skb_size))) { if (!(skb = dev_alloc_skb(skb_size))) {
DPRINTK("out of memory. frame dropped.\n"); DPRINTK("out of memory. frame dropped.\n");
ti->tr_stats.rx_dropped++; dev->stats.rx_dropped++;
SET_PAGE(ti->asb_page); SET_PAGE(ti->asb_page);
writeb(DATA_LOST, ti->asb + offsetof(struct asb_rec, ret_code)); writeb(DATA_LOST, ti->asb + offsetof(struct asb_rec, ret_code));
writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD); 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,8 +1811,8 @@ static void tr_rx(struct net_device *dev)
writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD); writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD);
ti->tr_stats.rx_bytes += skb->len; dev->stats.rx_bytes += skb->len;
ti->tr_stats.rx_packets++; dev->stats.rx_packets++;
skb->protocol = tr_type_trans(skb, dev); skb->protocol = tr_type_trans(skb, dev);
if (IPv4_p) { if (IPv4_p) {
...@@ -1876,21 +1874,6 @@ static void ibmtr_readlog(struct net_device *dev) ...@@ -1876,21 +1874,6 @@ static void ibmtr_readlog(struct net_device *dev)
/*****************************************************************************/ /*****************************************************************************/
/* tok_get_stats(): Basically a scaffold routine which will return
the address of the tr_statistics structure associated with
this device -- the tr.... structure is an ethnet look-alike
so at least for this iteration may suffice. */
static struct net_device_stats *tok_get_stats(struct net_device *dev)
{
struct tok_info *toki;
toki = netdev_priv(dev);
return (struct net_device_stats *) &toki->tr_stats;
}
/*****************************************************************************/
static int ibmtr_change_mtu(struct net_device *dev, int mtu) static int ibmtr_change_mtu(struct net_device *dev, int mtu)
{ {
struct tok_info *ti = netdev_priv(dev); struct tok_info *ti = netdev_priv(dev);
......
...@@ -207,7 +207,7 @@ struct tok_info { ...@@ -207,7 +207,7 @@ struct tok_info {
unsigned short exsap_station_id; unsigned short exsap_station_id;
unsigned short global_int_enable; unsigned short global_int_enable;
struct sk_buff *current_skb; struct sk_buff *current_skb;
struct net_device_stats tr_stats;
unsigned char auto_speedsave; unsigned char auto_speedsave;
open_state open_status, sap_status; open_state open_status, sap_status;
enum {MANUAL, AUTOMATIC} open_mode; enum {MANUAL, AUTOMATIC} open_mode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment