aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r--drivers/ieee1394/eth1394.c54
-rw-r--r--drivers/ieee1394/eth1394.h1
2 files changed, 25 insertions, 30 deletions
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
index a074bfd5f825..1a919df809f8 100644
--- a/drivers/ieee1394/eth1394.c
+++ b/drivers/ieee1394/eth1394.c
@@ -245,12 +245,6 @@ static int ether1394_stop(struct net_device *dev)
245 return 0; 245 return 0;
246} 246}
247 247
248/* Return statistics to the caller */
249static struct net_device_stats *ether1394_stats(struct net_device *dev)
250{
251 return &(((struct eth1394_priv *)netdev_priv(dev))->stats);
252}
253
254/* FIXME: What to do if we timeout? I think a host reset is probably in order, 248/* FIXME: What to do if we timeout? I think a host reset is probably in order,
255 * so that's what we do. Should we increment the stat counters too? */ 249 * so that's what we do. Should we increment the stat counters too? */
256static void ether1394_tx_timeout(struct net_device *dev) 250static void ether1394_tx_timeout(struct net_device *dev)
@@ -516,16 +510,19 @@ static const struct header_ops ether1394_header_ops = {
516 .parse = ether1394_header_parse, 510 .parse = ether1394_header_parse,
517}; 511};
518 512
513static const struct net_device_ops ether1394_netdev_ops = {
514 .ndo_open = ether1394_open,
515 .ndo_stop = ether1394_stop,
516 .ndo_start_xmit = ether1394_tx,
517 .ndo_tx_timeout = ether1394_tx_timeout,
518 .ndo_change_mtu = ether1394_change_mtu,
519};
520
519static void ether1394_init_dev(struct net_device *dev) 521static void ether1394_init_dev(struct net_device *dev)
520{ 522{
521 dev->open = ether1394_open;
522 dev->stop = ether1394_stop;
523 dev->hard_start_xmit = ether1394_tx;
524 dev->get_stats = ether1394_stats;
525 dev->tx_timeout = ether1394_tx_timeout;
526 dev->change_mtu = ether1394_change_mtu;
527 523
528 dev->header_ops = &ether1394_header_ops; 524 dev->header_ops = &ether1394_header_ops;
525 dev->netdev_ops = &ether1394_netdev_ops;
529 526
530 SET_ETHTOOL_OPS(dev, &ethtool_ops); 527 SET_ETHTOOL_OPS(dev, &ethtool_ops);
531 528
@@ -1075,7 +1072,7 @@ static int ether1394_data_handler(struct net_device *dev, int srcid, int destid,
1075 HPSB_PRINT(KERN_ERR, "ether1394 rx: sender nodeid " 1072 HPSB_PRINT(KERN_ERR, "ether1394 rx: sender nodeid "
1076 "lookup failure: " NODE_BUS_FMT, 1073 "lookup failure: " NODE_BUS_FMT,
1077 NODE_BUS_ARGS(priv->host, srcid)); 1074 NODE_BUS_ARGS(priv->host, srcid));
1078 priv->stats.rx_dropped++; 1075 dev->stats.rx_dropped++;
1079 return -1; 1076 return -1;
1080 } 1077 }
1081 ud = node->ud; 1078 ud = node->ud;
@@ -1098,7 +1095,7 @@ static int ether1394_data_handler(struct net_device *dev, int srcid, int destid,
1098 skb = dev_alloc_skb(len + dev->hard_header_len + 15); 1095 skb = dev_alloc_skb(len + dev->hard_header_len + 15);
1099 if (unlikely(!skb)) { 1096 if (unlikely(!skb)) {
1100 ETH1394_PRINT_G(KERN_ERR, "Out of memory\n"); 1097 ETH1394_PRINT_G(KERN_ERR, "Out of memory\n");
1101 priv->stats.rx_dropped++; 1098 dev->stats.rx_dropped++;
1102 return -1; 1099 return -1;
1103 } 1100 }
1104 skb_reserve(skb, (dev->hard_header_len + 15) & ~15); 1101 skb_reserve(skb, (dev->hard_header_len + 15) & ~15);
@@ -1217,15 +1214,15 @@ static int ether1394_data_handler(struct net_device *dev, int srcid, int destid,
1217 spin_lock_irqsave(&priv->lock, flags); 1214 spin_lock_irqsave(&priv->lock, flags);
1218 1215
1219 if (!skb->protocol) { 1216 if (!skb->protocol) {
1220 priv->stats.rx_errors++; 1217 dev->stats.rx_errors++;
1221 priv->stats.rx_dropped++; 1218 dev->stats.rx_dropped++;
1222 dev_kfree_skb_any(skb); 1219 dev_kfree_skb_any(skb);
1223 } else if (netif_rx(skb) == NET_RX_DROP) { 1220 } else if (netif_rx(skb) == NET_RX_DROP) {
1224 priv->stats.rx_errors++; 1221 dev->stats.rx_errors++;
1225 priv->stats.rx_dropped++; 1222 dev->stats.rx_dropped++;
1226 } else { 1223 } else {
1227 priv->stats.rx_packets++; 1224 dev->stats.rx_packets++;
1228 priv->stats.rx_bytes += skb->len; 1225 dev->stats.rx_bytes += skb->len;
1229 } 1226 }
1230 1227
1231 spin_unlock_irqrestore(&priv->lock, flags); 1228 spin_unlock_irqrestore(&priv->lock, flags);
@@ -1234,8 +1231,6 @@ bad_proto:
1234 if (netif_queue_stopped(dev)) 1231 if (netif_queue_stopped(dev))
1235 netif_wake_queue(dev); 1232 netif_wake_queue(dev);
1236 1233
1237 dev->last_rx = jiffies;
1238
1239 return 0; 1234 return 0;
1240} 1235}
1241 1236
@@ -1509,17 +1504,18 @@ static int ether1394_send_packet(struct packet_task *ptask, unsigned int tx_len)
1509static void ether1394_dg_complete(struct packet_task *ptask, int fail) 1504static void ether1394_dg_complete(struct packet_task *ptask, int fail)
1510{ 1505{
1511 struct sk_buff *skb = ptask->skb; 1506 struct sk_buff *skb = ptask->skb;
1512 struct eth1394_priv *priv = netdev_priv(skb->dev); 1507 struct net_device *dev = skb->dev;
1508 struct eth1394_priv *priv = netdev_priv(dev);
1513 unsigned long flags; 1509 unsigned long flags;
1514 1510
1515 /* Statistics */ 1511 /* Statistics */
1516 spin_lock_irqsave(&priv->lock, flags); 1512 spin_lock_irqsave(&priv->lock, flags);
1517 if (fail) { 1513 if (fail) {
1518 priv->stats.tx_dropped++; 1514 dev->stats.tx_dropped++;
1519 priv->stats.tx_errors++; 1515 dev->stats.tx_errors++;
1520 } else { 1516 } else {
1521 priv->stats.tx_bytes += skb->len; 1517 dev->stats.tx_bytes += skb->len;
1522 priv->stats.tx_packets++; 1518 dev->stats.tx_packets++;
1523 } 1519 }
1524 spin_unlock_irqrestore(&priv->lock, flags); 1520 spin_unlock_irqrestore(&priv->lock, flags);
1525 1521
@@ -1696,8 +1692,8 @@ fail:
1696 dev_kfree_skb(skb); 1692 dev_kfree_skb(skb);
1697 1693
1698 spin_lock_irqsave(&priv->lock, flags); 1694 spin_lock_irqsave(&priv->lock, flags);
1699 priv->stats.tx_dropped++; 1695 dev->stats.tx_dropped++;
1700 priv->stats.tx_errors++; 1696 dev->stats.tx_errors++;
1701 spin_unlock_irqrestore(&priv->lock, flags); 1697 spin_unlock_irqrestore(&priv->lock, flags);
1702 1698
1703 /* 1699 /*
diff --git a/drivers/ieee1394/eth1394.h b/drivers/ieee1394/eth1394.h
index e1b5ea80f623..d53bac47b86f 100644
--- a/drivers/ieee1394/eth1394.h
+++ b/drivers/ieee1394/eth1394.h
@@ -54,7 +54,6 @@ enum eth1394_bc_states { ETHER1394_BC_ERROR,
54 54
55/* Private structure for our ethernet driver */ 55/* Private structure for our ethernet driver */
56struct eth1394_priv { 56struct eth1394_priv {
57 struct net_device_stats stats; /* Device stats */
58 struct hpsb_host *host; /* The card for this dev */ 57 struct hpsb_host *host; /* The card for this dev */
59 u16 bc_maxpayload; /* Max broadcast payload */ 58 u16 bc_maxpayload; /* Max broadcast payload */
60 u8 bc_sspd; /* Max broadcast speed */ 59 u8 bc_sspd; /* Max broadcast speed */