aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/wanxl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wan/wanxl.c')
-rw-r--r--drivers/net/wan/wanxl.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
index d4aab8a28b61..a8a5ca0ee6c2 100644
--- a/drivers/net/wan/wanxl.c
+++ b/drivers/net/wan/wanxl.c
@@ -161,7 +161,6 @@ static inline void wanxl_cable_intr(port_t *port)
161static inline void wanxl_tx_intr(port_t *port) 161static inline void wanxl_tx_intr(port_t *port)
162{ 162{
163 struct net_device *dev = port->dev; 163 struct net_device *dev = port->dev;
164 struct net_device_stats *stats = hdlc_stats(dev);
165 while (1) { 164 while (1) {
166 desc_t *desc = &get_status(port)->tx_descs[port->tx_in]; 165 desc_t *desc = &get_status(port)->tx_descs[port->tx_in];
167 struct sk_buff *skb = port->tx_skbs[port->tx_in]; 166 struct sk_buff *skb = port->tx_skbs[port->tx_in];
@@ -173,13 +172,13 @@ static inline void wanxl_tx_intr(port_t *port)
173 return; 172 return;
174 173
175 case PACKET_UNDERRUN: 174 case PACKET_UNDERRUN:
176 stats->tx_errors++; 175 dev->stats.tx_errors++;
177 stats->tx_fifo_errors++; 176 dev->stats.tx_fifo_errors++;
178 break; 177 break;
179 178
180 default: 179 default:
181 stats->tx_packets++; 180 dev->stats.tx_packets++;
182 stats->tx_bytes += skb->len; 181 dev->stats.tx_bytes += skb->len;
183 } 182 }
184 desc->stat = PACKET_EMPTY; /* Free descriptor */ 183 desc->stat = PACKET_EMPTY; /* Free descriptor */
185 pci_unmap_single(port->card->pdev, desc->address, skb->len, 184 pci_unmap_single(port->card->pdev, desc->address, skb->len,
@@ -205,10 +204,9 @@ static inline void wanxl_rx_intr(card_t *card)
205 port_t *port = &card->ports[desc->stat & 204 port_t *port = &card->ports[desc->stat &
206 PACKET_PORT_MASK]; 205 PACKET_PORT_MASK];
207 struct net_device *dev = port->dev; 206 struct net_device *dev = port->dev;
208 struct net_device_stats *stats = hdlc_stats(dev);
209 207
210 if (!skb) 208 if (!skb)
211 stats->rx_dropped++; 209 dev->stats.rx_dropped++;
212 else { 210 else {
213 pci_unmap_single(card->pdev, desc->address, 211 pci_unmap_single(card->pdev, desc->address,
214 BUFFER_LENGTH, 212 BUFFER_LENGTH,
@@ -220,8 +218,8 @@ static inline void wanxl_rx_intr(card_t *card)
220 skb->len); 218 skb->len);
221 debug_frame(skb); 219 debug_frame(skb);
222#endif 220#endif
223 stats->rx_packets++; 221 dev->stats.rx_packets++;
224 stats->rx_bytes += skb->len; 222 dev->stats.rx_bytes += skb->len;
225 dev->last_rx = jiffies; 223 dev->last_rx = jiffies;
226 skb->protocol = hdlc_type_trans(skb, dev); 224 skb->protocol = hdlc_type_trans(skb, dev);
227 netif_rx(skb); 225 netif_rx(skb);
@@ -468,13 +466,13 @@ static int wanxl_close(struct net_device *dev)
468 466
469static struct net_device_stats *wanxl_get_stats(struct net_device *dev) 467static struct net_device_stats *wanxl_get_stats(struct net_device *dev)
470{ 468{
471 struct net_device_stats *stats = hdlc_stats(dev);
472 port_t *port = dev_to_port(dev); 469 port_t *port = dev_to_port(dev);
473 470
474 stats->rx_over_errors = get_status(port)->rx_overruns; 471 dev->stats.rx_over_errors = get_status(port)->rx_overruns;
475 stats->rx_frame_errors = get_status(port)->rx_frame_errors; 472 dev->stats.rx_frame_errors = get_status(port)->rx_frame_errors;
476 stats->rx_errors = stats->rx_over_errors + stats->rx_frame_errors; 473 dev->stats.rx_errors = dev->stats.rx_over_errors +
477 return stats; 474 dev->stats.rx_frame_errors;
475 return &dev->stats;
478} 476}
479 477
480 478