Skip to content

Commit

Permalink
niu: convert to net_device_ops
Browse files Browse the repository at this point in the history
Convert this driver to network device ops. Compile tested only (give me hw!)

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Nov 20, 2008
1 parent b94426b commit 2c9171d
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions drivers/net/niu.c
Original file line number Diff line number Diff line change
Expand Up @@ -8889,19 +8889,24 @@ static struct net_device * __devinit niu_alloc_and_init(
return dev;
}

static const struct net_device_ops niu_netdev_ops = {
.ndo_open = niu_open,
.ndo_stop = niu_close,
.ndo_get_stats = niu_get_stats,
.ndo_set_multicast_list = niu_set_rx_mode,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = niu_set_mac_addr,
.ndo_do_ioctl = niu_ioctl,
.ndo_tx_timeout = niu_tx_timeout,
.ndo_change_mtu = niu_change_mtu,
};

static void __devinit niu_assign_netdev_ops(struct net_device *dev)
{
dev->open = niu_open;
dev->stop = niu_close;
dev->get_stats = niu_get_stats;
dev->set_multicast_list = niu_set_rx_mode;
dev->set_mac_address = niu_set_mac_addr;
dev->do_ioctl = niu_ioctl;
dev->tx_timeout = niu_tx_timeout;
dev->netdev_ops = &niu_netdev_ops;
dev->hard_start_xmit = niu_start_xmit;
dev->ethtool_ops = &niu_ethtool_ops;
dev->watchdog_timeo = NIU_TX_TIMEOUT;
dev->change_mtu = niu_change_mtu;
}

static void __devinit niu_device_announce(struct niu *np)
Expand Down

0 comments on commit 2c9171d

Please sign in to comment.