提交 a8652d23 编写于 作者: S Stephen Hemminger 提交者: David S. Miller

hamachi: convert to net_device_ops

Convert driver to new net_device_ops. Compile tested only.
Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c64213cd
...@@ -568,6 +568,19 @@ static void set_rx_mode(struct net_device *dev); ...@@ -568,6 +568,19 @@ static void set_rx_mode(struct net_device *dev);
static const struct ethtool_ops ethtool_ops; static const struct ethtool_ops ethtool_ops;
static const struct ethtool_ops ethtool_ops_no_mii; static const struct ethtool_ops ethtool_ops_no_mii;
static const struct net_device_ops hamachi_netdev_ops = {
.ndo_open = hamachi_open,
.ndo_stop = hamachi_close,
.ndo_start_xmit = hamachi_start_xmit,
.ndo_get_stats = hamachi_get_stats,
.ndo_set_multicast_list = set_rx_mode,
.ndo_change_mtu = eth_change_mtu,
.ndo_validate_addr = eth_validate_addr,
.ndo_tx_timeout = hamachi_tx_timeout,
.ndo_do_ioctl = netdev_ioctl,
};
static int __devinit hamachi_init_one (struct pci_dev *pdev, static int __devinit hamachi_init_one (struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
...@@ -722,17 +735,11 @@ static int __devinit hamachi_init_one (struct pci_dev *pdev, ...@@ -722,17 +735,11 @@ static int __devinit hamachi_init_one (struct pci_dev *pdev,
/* The Hamachi-specific entries in the device structure. */ /* The Hamachi-specific entries in the device structure. */
dev->open = &hamachi_open; dev->netdev_ops = &hamachi_netdev_ops;
dev->hard_start_xmit = &hamachi_start_xmit;
dev->stop = &hamachi_close;
dev->get_stats = &hamachi_get_stats;
dev->set_multicast_list = &set_rx_mode;
dev->do_ioctl = &netdev_ioctl;
if (chip_tbl[hmp->chip_id].flags & CanHaveMII) if (chip_tbl[hmp->chip_id].flags & CanHaveMII)
SET_ETHTOOL_OPS(dev, &ethtool_ops); SET_ETHTOOL_OPS(dev, &ethtool_ops);
else else
SET_ETHTOOL_OPS(dev, &ethtool_ops_no_mii); SET_ETHTOOL_OPS(dev, &ethtool_ops_no_mii);
dev->tx_timeout = &hamachi_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT; dev->watchdog_timeo = TX_TIMEOUT;
if (mtu) if (mtu)
dev->mtu = mtu; dev->mtu = mtu;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册