diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-03-20 15:36:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-21 22:55:36 -0400 |
commit | d63cd426ba55a9e02ab745612357ee00158824a5 (patch) | |
tree | 85e56a481b0f13cf1a6529961414197d1c58df15 /drivers/net/pcmcia | |
parent | fb72e2ff356e55b6a60c5883d4506175652c3e9d (diff) |
pcmcia: convert fmvj18x driver to internal net_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pcmcia')
-rw-r--r-- | drivers/net/pcmcia/fmvj18x_cs.c | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 69dcfbbabe82..6715188319d9 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -100,7 +100,6 @@ static int fjn_start_xmit(struct sk_buff *skb, struct net_device *dev); | |||
100 | static irqreturn_t fjn_interrupt(int irq, void *dev_id); | 100 | static irqreturn_t fjn_interrupt(int irq, void *dev_id); |
101 | static void fjn_rx(struct net_device *dev); | 101 | static void fjn_rx(struct net_device *dev); |
102 | static void fjn_reset(struct net_device *dev); | 102 | static void fjn_reset(struct net_device *dev); |
103 | static struct net_device_stats *fjn_get_stats(struct net_device *dev); | ||
104 | static void set_rx_mode(struct net_device *dev); | 103 | static void set_rx_mode(struct net_device *dev); |
105 | static void fjn_tx_timeout(struct net_device *dev); | 104 | static void fjn_tx_timeout(struct net_device *dev); |
106 | static const struct ethtool_ops netdev_ethtool_ops; | 105 | static const struct ethtool_ops netdev_ethtool_ops; |
@@ -118,7 +117,6 @@ typedef enum { MBH10302, MBH10304, TDK, CONTEC, LA501, UNGERMANN, | |||
118 | typedef struct local_info_t { | 117 | typedef struct local_info_t { |
119 | struct pcmcia_device *p_dev; | 118 | struct pcmcia_device *p_dev; |
120 | dev_node_t node; | 119 | dev_node_t node; |
121 | struct net_device_stats stats; | ||
122 | long open_time; | 120 | long open_time; |
123 | uint tx_started:1; | 121 | uint tx_started:1; |
124 | uint tx_queue; | 122 | uint tx_queue; |
@@ -263,7 +261,6 @@ static int fmvj18x_probe(struct pcmcia_device *link) | |||
263 | /* The FMVJ18x specific entries in the device structure. */ | 261 | /* The FMVJ18x specific entries in the device structure. */ |
264 | dev->hard_start_xmit = &fjn_start_xmit; | 262 | dev->hard_start_xmit = &fjn_start_xmit; |
265 | dev->set_config = &fjn_config; | 263 | dev->set_config = &fjn_config; |
266 | dev->get_stats = &fjn_get_stats; | ||
267 | dev->set_multicast_list = &set_rx_mode; | 264 | dev->set_multicast_list = &set_rx_mode; |
268 | dev->open = &fjn_open; | 265 | dev->open = &fjn_open; |
269 | dev->stop = &fjn_close; | 266 | dev->stop = &fjn_close; |
@@ -793,7 +790,7 @@ static irqreturn_t fjn_interrupt(int dummy, void *dev_id) | |||
793 | fjn_rx(dev); | 790 | fjn_rx(dev); |
794 | } | 791 | } |
795 | if (tx_stat & F_TMT_RDY) { | 792 | if (tx_stat & F_TMT_RDY) { |
796 | lp->stats.tx_packets += lp->sent ; | 793 | dev->stats.tx_packets += lp->sent ; |
797 | lp->sent = 0 ; | 794 | lp->sent = 0 ; |
798 | if (lp->tx_queue) { | 795 | if (lp->tx_queue) { |
799 | outb(DO_TX | lp->tx_queue, ioaddr + TX_START); | 796 | outb(DO_TX | lp->tx_queue, ioaddr + TX_START); |
@@ -840,7 +837,7 @@ static void fjn_tx_timeout(struct net_device *dev) | |||
840 | htons(inw(ioaddr + 6)), htons(inw(ioaddr + 8)), | 837 | htons(inw(ioaddr + 6)), htons(inw(ioaddr + 8)), |
841 | htons(inw(ioaddr +10)), htons(inw(ioaddr +12)), | 838 | htons(inw(ioaddr +10)), htons(inw(ioaddr +12)), |
842 | htons(inw(ioaddr +14))); | 839 | htons(inw(ioaddr +14))); |
843 | lp->stats.tx_errors++; | 840 | dev->stats.tx_errors++; |
844 | /* ToDo: We should try to restart the adaptor... */ | 841 | /* ToDo: We should try to restart the adaptor... */ |
845 | local_irq_disable(); | 842 | local_irq_disable(); |
846 | fjn_reset(dev); | 843 | fjn_reset(dev); |
@@ -880,7 +877,7 @@ static int fjn_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
880 | 877 | ||
881 | DEBUG(4, "%s: Transmitting a packet of length %lu.\n", | 878 | DEBUG(4, "%s: Transmitting a packet of length %lu.\n", |
882 | dev->name, (unsigned long)skb->len); | 879 | dev->name, (unsigned long)skb->len); |
883 | lp->stats.tx_bytes += skb->len; | 880 | dev->stats.tx_bytes += skb->len; |
884 | 881 | ||
885 | /* Disable both interrupts. */ | 882 | /* Disable both interrupts. */ |
886 | outw(0x0000, ioaddr + TX_INTR); | 883 | outw(0x0000, ioaddr + TX_INTR); |
@@ -1008,7 +1005,6 @@ static void fjn_reset(struct net_device *dev) | |||
1008 | 1005 | ||
1009 | static void fjn_rx(struct net_device *dev) | 1006 | static void fjn_rx(struct net_device *dev) |
1010 | { | 1007 | { |
1011 | struct local_info_t *lp = netdev_priv(dev); | ||
1012 | unsigned int ioaddr = dev->base_addr; | 1008 | unsigned int ioaddr = dev->base_addr; |
1013 | int boguscount = 10; /* 5 -> 10: by agy 19940922 */ | 1009 | int boguscount = 10; /* 5 -> 10: by agy 19940922 */ |
1014 | 1010 | ||
@@ -1027,11 +1023,11 @@ static void fjn_rx(struct net_device *dev) | |||
1027 | } | 1023 | } |
1028 | #endif | 1024 | #endif |
1029 | if ((status & 0xF0) != 0x20) { /* There was an error. */ | 1025 | if ((status & 0xF0) != 0x20) { /* There was an error. */ |
1030 | lp->stats.rx_errors++; | 1026 | dev->stats.rx_errors++; |
1031 | if (status & F_LEN_ERR) lp->stats.rx_length_errors++; | 1027 | if (status & F_LEN_ERR) dev->stats.rx_length_errors++; |
1032 | if (status & F_ALG_ERR) lp->stats.rx_frame_errors++; | 1028 | if (status & F_ALG_ERR) dev->stats.rx_frame_errors++; |
1033 | if (status & F_CRC_ERR) lp->stats.rx_crc_errors++; | 1029 | if (status & F_CRC_ERR) dev->stats.rx_crc_errors++; |
1034 | if (status & F_OVR_FLO) lp->stats.rx_over_errors++; | 1030 | if (status & F_OVR_FLO) dev->stats.rx_over_errors++; |
1035 | } else { | 1031 | } else { |
1036 | u_short pkt_len = inw(ioaddr + DATAPORT); | 1032 | u_short pkt_len = inw(ioaddr + DATAPORT); |
1037 | /* Malloc up new buffer. */ | 1033 | /* Malloc up new buffer. */ |
@@ -1041,7 +1037,7 @@ static void fjn_rx(struct net_device *dev) | |||
1041 | printk(KERN_NOTICE "%s: The FMV-18x claimed a very " | 1037 | printk(KERN_NOTICE "%s: The FMV-18x claimed a very " |
1042 | "large packet, size %d.\n", dev->name, pkt_len); | 1038 | "large packet, size %d.\n", dev->name, pkt_len); |
1043 | outb(F_SKP_PKT, ioaddr + RX_SKIP); | 1039 | outb(F_SKP_PKT, ioaddr + RX_SKIP); |
1044 | lp->stats.rx_errors++; | 1040 | dev->stats.rx_errors++; |
1045 | break; | 1041 | break; |
1046 | } | 1042 | } |
1047 | skb = dev_alloc_skb(pkt_len+2); | 1043 | skb = dev_alloc_skb(pkt_len+2); |
@@ -1049,7 +1045,7 @@ static void fjn_rx(struct net_device *dev) | |||
1049 | printk(KERN_NOTICE "%s: Memory squeeze, dropping " | 1045 | printk(KERN_NOTICE "%s: Memory squeeze, dropping " |
1050 | "packet (len %d).\n", dev->name, pkt_len); | 1046 | "packet (len %d).\n", dev->name, pkt_len); |
1051 | outb(F_SKP_PKT, ioaddr + RX_SKIP); | 1047 | outb(F_SKP_PKT, ioaddr + RX_SKIP); |
1052 | lp->stats.rx_dropped++; | 1048 | dev->stats.rx_dropped++; |
1053 | break; | 1049 | break; |
1054 | } | 1050 | } |
1055 | 1051 | ||
@@ -1070,8 +1066,8 @@ static void fjn_rx(struct net_device *dev) | |||
1070 | #endif | 1066 | #endif |
1071 | 1067 | ||
1072 | netif_rx(skb); | 1068 | netif_rx(skb); |
1073 | lp->stats.rx_packets++; | 1069 | dev->stats.rx_packets++; |
1074 | lp->stats.rx_bytes += pkt_len; | 1070 | dev->stats.rx_bytes += pkt_len; |
1075 | } | 1071 | } |
1076 | if (--boguscount <= 0) | 1072 | if (--boguscount <= 0) |
1077 | break; | 1073 | break; |
@@ -1191,14 +1187,6 @@ static int fjn_close(struct net_device *dev) | |||
1191 | 1187 | ||
1192 | /*====================================================================*/ | 1188 | /*====================================================================*/ |
1193 | 1189 | ||
1194 | static struct net_device_stats *fjn_get_stats(struct net_device *dev) | ||
1195 | { | ||
1196 | local_info_t *lp = netdev_priv(dev); | ||
1197 | return &lp->stats; | ||
1198 | } /* fjn_get_stats */ | ||
1199 | |||
1200 | /*====================================================================*/ | ||
1201 | |||
1202 | /* | 1190 | /* |
1203 | Set the multicast/promiscuous mode for this adaptor. | 1191 | Set the multicast/promiscuous mode for this adaptor. |
1204 | */ | 1192 | */ |