* [PATCH 1/3] ieee1394: convert to net_device_ops
@ 2009-01-06 22:54 Stephen Hemminger
2009-01-06 22:55 ` [PATCH 2/3] ieee1394: remove unneeded last_rx Stephen Hemminger
2009-01-06 23:20 ` [PATCH 1/3] ieee1394: convert to net_device_ops Stefan Richter
0 siblings, 2 replies; 6+ messages in thread
From: Stephen Hemminger @ 2009-01-06 22:54 UTC (permalink / raw)
To: krh, stefanr, David Miller; +Cc: linux1394-devel, netdev
Convert to net_device_ops.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
My goal is to have all drivers found using make allmodconfig using net_device_ops
by 2.6.28-rc2
--- a/drivers/ieee1394/eth1394.c 2009-01-03 20:19:30.123514679 -0800
+++ b/drivers/ieee1394/eth1394.c 2009-01-03 20:21:51.018766544 -0800
@@ -516,16 +516,20 @@ static const struct header_ops ether1394
.parse = ether1394_header_parse,
};
+static const struct net_device_ops ether1394_netdev_ops = {
+ .ndo_open = ether1394_open,
+ .ndo_stop = ether1394_stop,
+ .ndo_start_xmit = ether1394_tx,
+ .ndo_get_stats = ether1394_stats,
+ .ndo_tx_timeout = ether1394_tx_timeout,
+ .ndo_change_mtu = ether1394_change_mtu,
+};
+
static void ether1394_init_dev(struct net_device *dev)
{
- dev->open = ether1394_open;
- dev->stop = ether1394_stop;
- dev->hard_start_xmit = ether1394_tx;
- dev->get_stats = ether1394_stats;
- dev->tx_timeout = ether1394_tx_timeout;
- dev->change_mtu = ether1394_change_mtu;
dev->header_ops = ðer1394_header_ops;
+ dev->netdev_ops = ðer1394_netdev_ops;
SET_ETHTOOL_OPS(dev, ðtool_ops);
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 2/3] ieee1394: remove unneeded last_rx 2009-01-06 22:54 [PATCH 1/3] ieee1394: convert to net_device_ops Stephen Hemminger @ 2009-01-06 22:55 ` Stephen Hemminger 2009-01-06 22:56 ` [PATCH 3/3] ieee1394: use internal network device stats Stephen Hemminger 2009-01-06 23:22 ` [PATCH 2/3] ieee1394: remove unneeded last_rx Stefan Richter 2009-01-06 23:20 ` [PATCH 1/3] ieee1394: convert to net_device_ops Stefan Richter 1 sibling, 2 replies; 6+ messages in thread From: Stephen Hemminger @ 2009-01-06 22:55 UTC (permalink / raw) To: krh, stefanr, David Miller; +Cc: linux1394-devel, netdev Last_rx is now done if needed inside bonding. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> --- a/drivers/ieee1394/eth1394.c 2009-01-03 20:19:30.123514679 -0800 +++ b/drivers/ieee1394/eth1394.c 2009-01-03 20:21:51.018766544 -0800 @@ -1234,8 +1238,6 @@ bad_proto: if (netif_queue_stopped(dev)) netif_wake_queue(dev); - dev->last_rx = jiffies; - return 0; } ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/3] ieee1394: use internal network device stats 2009-01-06 22:55 ` [PATCH 2/3] ieee1394: remove unneeded last_rx Stephen Hemminger @ 2009-01-06 22:56 ` Stephen Hemminger 2009-01-06 23:23 ` Stefan Richter 2009-01-06 23:22 ` [PATCH 2/3] ieee1394: remove unneeded last_rx Stefan Richter 1 sibling, 1 reply; 6+ messages in thread From: Stephen Hemminger @ 2009-01-06 22:56 UTC (permalink / raw) To: krh, David Miller; +Cc: linux1394-devel, netdev Use the network_device_stats field in network_device. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> --- a/drivers/ieee1394/eth1394.c 2009-01-06 14:35:32.364610939 -0800 +++ b/drivers/ieee1394/eth1394.c 2009-01-06 14:41:03.060783206 -0800 @@ -245,12 +245,6 @@ static int ether1394_stop(struct net_dev return 0; } -/* Return statistics to the caller */ -static struct net_device_stats *ether1394_stats(struct net_device *dev) -{ - return &(((struct eth1394_priv *)netdev_priv(dev))->stats); -} - /* FIXME: What to do if we timeout? I think a host reset is probably in order, * so that's what we do. Should we increment the stat counters too? */ static void ether1394_tx_timeout(struct net_device *dev) @@ -520,7 +514,6 @@ static const struct net_device_ops ether .ndo_open = ether1394_open, .ndo_stop = ether1394_stop, .ndo_start_xmit = ether1394_tx, - .ndo_get_stats = ether1394_stats, .ndo_tx_timeout = ether1394_tx_timeout, .ndo_change_mtu = ether1394_change_mtu, }; @@ -1079,7 +1072,7 @@ static int ether1394_data_handler(struct HPSB_PRINT(KERN_ERR, "ether1394 rx: sender nodeid " "lookup failure: " NODE_BUS_FMT, NODE_BUS_ARGS(priv->host, srcid)); - priv->stats.rx_dropped++; + dev->stats.rx_dropped++; return -1; } ud = node->ud; @@ -1102,7 +1095,7 @@ static int ether1394_data_handler(struct skb = dev_alloc_skb(len + dev->hard_header_len + 15); if (unlikely(!skb)) { ETH1394_PRINT_G(KERN_ERR, "Out of memory\n"); - priv->stats.rx_dropped++; + dev->stats.rx_dropped++; return -1; } skb_reserve(skb, (dev->hard_header_len + 15) & ~15); @@ -1221,15 +1214,15 @@ static int ether1394_data_handler(struct spin_lock_irqsave(&priv->lock, flags); if (!skb->protocol) { - priv->stats.rx_errors++; - priv->stats.rx_dropped++; + dev->stats.rx_errors++; + dev->stats.rx_dropped++; dev_kfree_skb_any(skb); } else if (netif_rx(skb) == NET_RX_DROP) { - priv->stats.rx_errors++; - priv->stats.rx_dropped++; + dev->stats.rx_errors++; + dev->stats.rx_dropped++; } else { - priv->stats.rx_packets++; - priv->stats.rx_bytes += skb->len; + dev->stats.rx_packets++; + dev->stats.rx_bytes += skb->len; } spin_unlock_irqrestore(&priv->lock, flags); @@ -1513,17 +1506,18 @@ static int ether1394_send_packet(struct static void ether1394_dg_complete(struct packet_task *ptask, int fail) { struct sk_buff *skb = ptask->skb; - struct eth1394_priv *priv = netdev_priv(skb->dev); + struct net_device *dev = skb->dev; + struct eth1394_priv *priv = netdev_priv(dev); unsigned long flags; /* Statistics */ spin_lock_irqsave(&priv->lock, flags); if (fail) { - priv->stats.tx_dropped++; - priv->stats.tx_errors++; + dev->stats.tx_dropped++; + dev->stats.tx_errors++; } else { - priv->stats.tx_bytes += skb->len; - priv->stats.tx_packets++; + dev->stats.tx_bytes += skb->len; + dev->stats.tx_packets++; } spin_unlock_irqrestore(&priv->lock, flags); @@ -1700,8 +1694,8 @@ fail: dev_kfree_skb(skb); spin_lock_irqsave(&priv->lock, flags); - priv->stats.tx_dropped++; - priv->stats.tx_errors++; + dev->stats.tx_dropped++; + dev->stats.tx_errors++; spin_unlock_irqrestore(&priv->lock, flags); /* --- a/drivers/ieee1394/eth1394.h 2009-01-06 14:36:53.776610624 -0800 +++ b/drivers/ieee1394/eth1394.h 2009-01-06 14:37:20.090568738 -0800 @@ -54,7 +54,6 @@ enum eth1394_bc_states { ETHER1394_BC_ER /* Private structure for our ethernet driver */ struct eth1394_priv { - struct net_device_stats stats; /* Device stats */ struct hpsb_host *host; /* The card for this dev */ u16 bc_maxpayload; /* Max broadcast payload */ u8 bc_sspd; /* Max broadcast speed */ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] ieee1394: use internal network device stats 2009-01-06 22:56 ` [PATCH 3/3] ieee1394: use internal network device stats Stephen Hemminger @ 2009-01-06 23:23 ` Stefan Richter 0 siblings, 0 replies; 6+ messages in thread From: Stefan Richter @ 2009-01-06 23:23 UTC (permalink / raw) To: Stephen Hemminger; +Cc: krh, netdev, linux1394-devel, David Miller Stephen Hemminger wrote: > Use the network_device_stats field in network_device. Just in case: Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> -- Stefan Richter -=====-==--= ---= --=== http://arcgraph.de/sr/ ------------------------------------------------------------------------------ Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] ieee1394: remove unneeded last_rx 2009-01-06 22:55 ` [PATCH 2/3] ieee1394: remove unneeded last_rx Stephen Hemminger 2009-01-06 22:56 ` [PATCH 3/3] ieee1394: use internal network device stats Stephen Hemminger @ 2009-01-06 23:22 ` Stefan Richter 1 sibling, 0 replies; 6+ messages in thread From: Stefan Richter @ 2009-01-06 23:22 UTC (permalink / raw) To: Stephen Hemminger; +Cc: krh, netdev, linux1394-devel, David Miller Stephen Hemminger wrote: > Last_rx is now done if needed inside bonding. Just in case that this is meant to go through net(dev?)-2.6.git rather than linux1394-2.6.git: Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> -- Stefan Richter -=====-==--= ---= --=== http://arcgraph.de/sr/ ------------------------------------------------------------------------------ Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] ieee1394: convert to net_device_ops 2009-01-06 22:54 [PATCH 1/3] ieee1394: convert to net_device_ops Stephen Hemminger 2009-01-06 22:55 ` [PATCH 2/3] ieee1394: remove unneeded last_rx Stephen Hemminger @ 2009-01-06 23:20 ` Stefan Richter 1 sibling, 0 replies; 6+ messages in thread From: Stefan Richter @ 2009-01-06 23:20 UTC (permalink / raw) To: Stephen Hemminger; +Cc: krh, netdev, linux1394-devel, David Miller Stephen Hemminger wrote: > Convert to net_device_ops. > > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> > > --- > My goal is to have all drivers found using make allmodconfig using net_device_ops > by 2.6.28-rc2 You mean 2.6.29-rc2? Is David going to take patches 1/3...3/3? If so, here is: Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Or shall I take them through linux1394-2.6.git? -- Stefan Richter -=====-==--= ---= --=== http://arcgraph.de/sr/ ------------------------------------------------------------------------------ Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-01-06 23:23 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-01-06 22:54 [PATCH 1/3] ieee1394: convert to net_device_ops Stephen Hemminger 2009-01-06 22:55 ` [PATCH 2/3] ieee1394: remove unneeded last_rx Stephen Hemminger 2009-01-06 22:56 ` [PATCH 3/3] ieee1394: use internal network device stats Stephen Hemminger 2009-01-06 23:23 ` Stefan Richter 2009-01-06 23:22 ` [PATCH 2/3] ieee1394: remove unneeded last_rx Stefan Richter 2009-01-06 23:20 ` [PATCH 1/3] ieee1394: convert to net_device_ops Stefan Richter
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).