diff mbox

[6/8] xen-netfront: convert to net_device_ops

Message ID 20090105201514.756248396@vyatta.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

stephen hemminger Jan. 5, 2009, 8:14 p.m. UTC
Convert Xen device to new API.

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

Comments

Jeremy Fitzhardinge Jan. 6, 2009, 12:17 a.m. UTC | #1
Stephen Hemminger wrote:
> Convert Xen device to new API.
>   

Looks fine to me.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>

    J
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Jan. 6, 2009, 6:45 p.m. UTC | #2
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 05 Jan 2009 12:14:48 -0800

> Convert Xen device to new API.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/drivers/net/xen-netfront.c	2009-01-05 12:10:31.373819168 -0800
+++ b/drivers/net/xen-netfront.c	2009-01-05 12:11:22.754068943 -0800
@@ -1105,6 +1105,16 @@  static void xennet_uninit(struct net_dev
 	gnttab_free_grant_references(np->gref_rx_head);
 }
 
+static const struct net_device_ops xennet_netdev_ops = {
+	.ndo_open            = xennet_open,
+	.ndo_uninit          = xennet_uninit,
+	.ndo_stop            = xennet_close,
+	.ndo_start_xmit      = xennet_start_xmit,
+	.ndo_change_mtu	     = xennet_change_mtu,
+	.ndo_set_mac_address = eth_mac_addr,
+	.ndo_validate_addr   = eth_validate_addr,
+};
+
 static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev)
 {
 	int i, err;
@@ -1161,12 +1171,9 @@  static struct net_device * __devinit xen
 		goto exit_free_tx;
 	}
 
-	netdev->open            = xennet_open;
-	netdev->hard_start_xmit = xennet_start_xmit;
-	netdev->stop            = xennet_close;
+	netdev->netdev_ops	= &xennet_netdev_ops;
+
 	netif_napi_add(netdev, &np->napi, xennet_poll, 64);
-	netdev->uninit          = xennet_uninit;
-	netdev->change_mtu	= xennet_change_mtu;
 	netdev->features        = NETIF_F_IP_CSUM;
 
 	SET_ETHTOOL_OPS(netdev, &xennet_ethtool_ops);