netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH 29/33] ixgb: convert to net_device_ops
Date: Mon, 17 Nov 2008 15:42:36 -0800	[thread overview]
Message-ID: <20081117234357.262431493@vyatta.com> (raw)
In-Reply-To: 20081117234207.854110282@vyatta.com

[-- Attachment #1: ixgb-netdev_ops.patch --]
[-- Type: text/plain, Size: 3647 bytes --]

Convert this driver to network device ops. Compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--- a/drivers/net/ixgb/ixgb_main.c	2008-11-17 14:03:54.000000000 -0800
+++ b/drivers/net/ixgb/ixgb_main.c	2008-11-17 14:03:57.000000000 -0800
@@ -321,6 +321,23 @@ ixgb_reset(struct ixgb_adapter *adapter)
 	}
 }
 
+static const struct net_device_ops ixgb_netdev_ops = {
+	.open 			= ixgb_open,
+	.stop			= ixgb_close,
+	.get_stats		= ixgb_get_stats,
+	.set_multicast_list	= ixgb_set_multi,
+	.validate_addr		= eth_validate_addr,
+	.set_mac_address	= ixgb_set_mac,
+	.change_mtu		= ixgb_change_mtu,
+	.tx_timeout		= ixgb_tx_timeout,
+	.vlan_rx_register	= ixgb_vlan_rx_register,
+	.vlan_rx_add_vid	= ixgb_vlan_rx_add_vid,
+	.vlan_rx_kill_vid	= ixgb_vlan_rx_kill_vid,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	.poll_controller	= ixgb_netpoll,
+#endif
+};
+
 /**
  * ixgb_probe - Device Initialization Routine
  * @pdev: PCI device information struct
@@ -396,23 +413,11 @@ ixgb_probe(struct pci_dev *pdev, const s
 		}
 	}
 
-	netdev->open = &ixgb_open;
-	netdev->stop = &ixgb_close;
+	netdev->netdev_ops = &ixgb_netdev_ops;
 	netdev->hard_start_xmit = &ixgb_xmit_frame;
-	netdev->get_stats = &ixgb_get_stats;
-	netdev->set_multicast_list = &ixgb_set_multi;
-	netdev->set_mac_address = &ixgb_set_mac;
-	netdev->change_mtu = &ixgb_change_mtu;
 	ixgb_set_ethtool_ops(netdev);
-	netdev->tx_timeout = &ixgb_tx_timeout;
 	netdev->watchdog_timeo = 5 * HZ;
 	netif_napi_add(netdev, &adapter->napi, ixgb_clean, 64);
-	netdev->vlan_rx_register = ixgb_vlan_rx_register;
-	netdev->vlan_rx_add_vid = ixgb_vlan_rx_add_vid;
-	netdev->vlan_rx_kill_vid = ixgb_vlan_rx_kill_vid;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-	netdev->poll_controller = ixgb_netpoll;
-#endif
 
 	strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
 
--- a/drivers/net/ixgbe/ixgbe_main.c	2008-11-17 14:03:54.000000000 -0800
+++ b/drivers/net/ixgbe/ixgbe_main.c	2008-11-17 14:05:29.000000000 -0800
@@ -3727,6 +3727,23 @@ static int ixgbe_link_config(struct ixgb
 	return hw->mac.ops.setup_link_speed(hw, autoneg, true, true);
 }
 
+static const struct net_device_ops ixgbe_netdev_ops = {
+	.open 			= ixgbe_open,
+	.stop			= ixgbe_close,
+	.get_stats		= ixgbe_get_stats,
+	.set_multicast_list	= ixgbe_set_rx_mode,
+	.validate_addr		= eth_validate_addr,
+	.set_mac_address	= ixgbe_set_mac,
+	.change_mtu		= ixgbe_change_mtu,
+	.tx_timeout		= ixgbe_tx_timeout,
+	.vlan_rx_register	= ixgbe_vlan_rx_register,
+	.vlan_rx_add_vid	= ixgbe_vlan_rx_add_vid,
+	.vlan_rx_kill_vid	= ixgbe_vlan_rx_kill_vid,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	.poll_controller	= ixgbe_netpoll,
+#endif
+};
+
 /**
  * ixgbe_probe - Device Initialization Routine
  * @pdev: PCI device information struct
@@ -3808,23 +3825,10 @@ static int __devinit ixgbe_probe(struct 
 			continue;
 	}
 
-	netdev->open = &ixgbe_open;
-	netdev->stop = &ixgbe_close;
+	netdev->netdev_ops = &ixgbe_netdev_ops;
 	netdev->hard_start_xmit = &ixgbe_xmit_frame;
-	netdev->get_stats = &ixgbe_get_stats;
-	netdev->set_rx_mode = &ixgbe_set_rx_mode;
-	netdev->set_multicast_list = &ixgbe_set_rx_mode;
-	netdev->set_mac_address = &ixgbe_set_mac;
-	netdev->change_mtu = &ixgbe_change_mtu;
 	ixgbe_set_ethtool_ops(netdev);
-	netdev->tx_timeout = &ixgbe_tx_timeout;
 	netdev->watchdog_timeo = 5 * HZ;
-	netdev->vlan_rx_register = ixgbe_vlan_rx_register;
-	netdev->vlan_rx_add_vid = ixgbe_vlan_rx_add_vid;
-	netdev->vlan_rx_kill_vid = ixgbe_vlan_rx_kill_vid;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-	netdev->poll_controller = ixgbe_netpoll;
-#endif
 	strcpy(netdev->name, pci_name(pdev));
 
 	adapter->bd_number = cards_found;

-- 


  parent reply	other threads:[~2008-11-18  0:00 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-17 23:42 [PATCH 00/33] Network Devices Ops (v0.3) Stephen Hemminger
2008-11-17 23:42 ` [PATCH 01/33] netdev: network device operations infrastructure Stephen Hemminger
2008-11-20  5:26   ` David Miller
2008-11-20  5:27     ` David Miller
2008-11-17 23:42 ` [PATCH 02/33] netdev: introduce dev_get_stats() Stephen Hemminger
2008-11-20  5:40   ` David Miller
2008-11-20  9:17     ` Eric Dumazet
2008-11-20 12:27       ` David Miller
2008-11-17 23:42 ` [PATCH 03/33] netdev: expose ethernet address primitives Stephen Hemminger
2008-11-20  5:45   ` David Miller
2008-11-20  6:40     ` David Miller
2008-11-17 23:42 ` [PATCH 04/33] netdev: convert loopback to net_device_ops Stephen Hemminger
2008-11-20  5:46   ` David Miller
2008-11-17 23:42 ` [PATCH 05/33] ifb: convert " Stephen Hemminger
2008-11-20  5:47   ` David Miller
2008-11-17 23:42 ` [PATCH 06/33] dummy: " Stephen Hemminger
2008-11-20  5:48   ` David Miller
2008-11-17 23:42 ` [PATCH 07/33] bridge: " Stephen Hemminger
2008-11-20  5:49   ` David Miller
2008-11-17 23:42 ` [PATCH 08/33] veth: " Stephen Hemminger
2008-11-20  5:50   ` David Miller
2008-11-17 23:42 ` [PATCH 09/33] macvlan: " Stephen Hemminger
2008-11-20  5:51   ` David Miller
2008-11-17 23:42 ` [PATCH 10/33] ip: convert to net_device_ops for ioctl Stephen Hemminger
2008-11-20  5:52   ` David Miller
2008-11-17 23:42 ` [PATCH 11/33] vlan: convert to net_device_ops Stephen Hemminger
2008-11-20  5:54   ` David Miller
2008-11-17 23:42 ` [PATCH 12/33] bonding: " Stephen Hemminger
2008-11-20  5:56   ` David Miller
2008-11-17 23:42 ` [PATCH 13/33] e1000e: " Stephen Hemminger
2008-11-20  5:58   ` David Miller
2008-11-17 23:42 ` [PATCH 14/33] sky2: " Stephen Hemminger
2008-11-18  1:37   ` Stephen Hemminger
2008-11-20  6:00     ` David Miller
2008-11-17 23:42 ` [PATCH 15/33] skge: " Stephen Hemminger
2008-11-20  6:01   ` David Miller
2008-11-17 23:42 ` [PATCH 16/33] r8169: " Stephen Hemminger
2008-11-18  1:38   ` Stephen Hemminger
2008-11-18 21:18     ` Francois Romieu
2008-11-20  6:07       ` David Miller
2008-11-20 19:55         ` Francois Romieu
2008-11-17 23:42 ` [PATCH 17/33] 8139: " Stephen Hemminger
2008-11-18  1:39   ` Stephen Hemminger
2008-11-20  6:09     ` David Miller
2008-11-17 23:42 ` [PATCH 18/33] tun: " Stephen Hemminger
2008-11-20  6:10   ` David Miller
2008-11-17 23:42 ` [PATCH 19/33] atl1e: " Stephen Hemminger
2008-11-20  6:12   ` David Miller
2008-11-17 23:42 ` [PATCH 20/33] atlx: " Stephen Hemminger
2008-11-20  6:14   ` David Miller
2008-11-17 23:42 ` [PATCH 21/33] cxgb3: " Stephen Hemminger
2008-11-20  6:15   ` David Miller
2008-11-17 23:42 ` [PATCH 22/33] cxgb2: " Stephen Hemminger
2008-11-18  1:40   ` Stephen Hemminger
2008-11-20  6:17     ` David Miller
2008-11-17 23:42 ` [PATCH 23/33] e1000: " Stephen Hemminger
2008-11-20  6:18   ` David Miller
2008-11-17 23:42 ` [PATCH 24/33] via-velocity: " Stephen Hemminger
2008-11-20  6:19   ` David Miller
2008-11-17 23:42 ` [PATCH 25/33] igb: " Stephen Hemminger
2008-11-20  6:21   ` David Miller
2008-11-17 23:42 ` [PATCH 26/33] e100: " Stephen Hemminger
2008-11-20  6:22   ` David Miller
2008-11-17 23:42 ` [PATCH 27/33] ppp: " Stephen Hemminger
2008-11-20  6:22   ` David Miller
2008-11-17 23:42 ` [PATCH 28/33] enic: " Stephen Hemminger
2008-11-20  6:23   ` David Miller
2008-11-17 23:42 ` Stephen Hemminger [this message]
2008-11-20  6:24   ` [PATCH 29/33] ixgb: " David Miller
2008-11-17 23:42 ` [PATCH 30/33] tg3: " Stephen Hemminger
2008-11-18  0:42   ` Matt Carlson
2008-11-18  1:37   ` Stephen Hemminger
2008-11-19 21:04     ` Matt Carlson
2008-11-19 21:07       ` Stephen Hemminger
2008-11-20  1:21         ` David Miller
2008-11-20  6:25     ` David Miller
2008-11-17 23:42 ` [PATCH 31/33] forcedeth: " Stephen Hemminger
2008-11-20  6:27   ` David Miller
2008-11-17 23:42 ` [PATCH 32/33] niu: " Stephen Hemminger
2008-11-20  6:28   ` David Miller
2008-11-17 23:42 ` [PATCH 33/33] acenic: " Stephen Hemminger
2008-11-20  6:29   ` David Miller
2008-11-18  1:27 ` [PATCH 00/33] Network Devices Ops (v0.3) Jeff Kirsher
2008-11-18  1:35   ` Stephen Hemminger
2008-11-18  1:43     ` Jeff Kirsher
2008-11-19 21:55     ` Jeff Kirsher
2008-11-19 22:04       ` David Miller
2008-11-20  1:33 ` David Miller
2008-11-20  3:02   ` Stephen Hemminger
2008-11-20  5:21     ` Eric Dumazet
2008-11-20  5:25       ` David Miller
2008-11-20  6:15         ` Alexey Dobriyan
2008-11-20  6:37           ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081117234357.262431493@vyatta.com \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).