uml: convert network device to netdevice ops
authorStephen Hemminger <shemminger@linux-foundation.org>
Thu, 26 Mar 2009 15:11:17 +0000 (15:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Mar 2009 07:46:40 +0000 (00:46 -0700)
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/um/drivers/net_kern.c

index 6d2b1004d1e132f9d11ac48433e514df98dde46e..434224e2229ff6afde1556b5541b83200466c99e 100644 (file)
@@ -371,6 +371,18 @@ static void net_device_release(struct device *dev)
        free_netdev(netdev);
 }
 
+static const struct net_device_ops uml_netdev_ops = {
+       .ndo_open               = uml_net_open,
+       .ndo_stop               = uml_net_close,
+       .ndo_start_xmit         = uml_net_start_xmit,
+       .ndo_set_multicast_list = uml_net_set_multicast_list,
+       .ndo_tx_timeout         = uml_net_tx_timeout,
+       .ndo_set_mac_address    = uml_net_set_mac,
+       .ndo_change_mtu         = uml_net_change_mtu,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_validate_addr      = eth_validate_addr,
+};
+
 /*
  * Ensures that platform_driver_register is called only once by
  * eth_configure.  Will be set in an initcall.
@@ -467,13 +479,7 @@ static void eth_configure(int n, void *init, char *mac,
 
        set_ether_mac(dev, device->mac);
        dev->mtu = transport->user->mtu;
-       dev->open = uml_net_open;
-       dev->hard_start_xmit = uml_net_start_xmit;
-       dev->stop = uml_net_close;
-       dev->set_multicast_list = uml_net_set_multicast_list;
-       dev->tx_timeout = uml_net_tx_timeout;
-       dev->set_mac_address = uml_net_set_mac;
-       dev->change_mtu = uml_net_change_mtu;
+       dev->netdev_ops = &uml_netdev_ops;
        dev->ethtool_ops = &uml_net_ethtool_ops;
        dev->watchdog_timeo = (HZ >> 1);
        dev->irq = UM_ETH_IRQ;