Commit 15efc02b authored by Alexander Beregalov's avatar Alexander Beregalov Committed by David S. Miller

ibm_newemac: convert to netdev_ops

Reported-by: default avatarSubrata Modak <subrata@linux.vnet.ibm.com>
Signed-off-by: default avatarAlexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8c02acd7
...@@ -2686,6 +2686,32 @@ static int __devinit emac_init_config(struct emac_instance *dev) ...@@ -2686,6 +2686,32 @@ static int __devinit emac_init_config(struct emac_instance *dev)
return 0; return 0;
} }
static const struct net_device_ops emac_netdev_ops = {
.ndo_open = emac_open,
.ndo_stop = emac_close,
.ndo_get_stats = emac_stats,
.ndo_set_multicast_list = emac_set_multicast_list,
.ndo_do_ioctl = emac_ioctl,
.ndo_tx_timeout = emac_tx_timeout,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
.ndo_start_xmit = emac_start_xmit,
.ndo_change_mtu = eth_change_mtu,
};
static const struct net_device_ops emac_gige_netdev_ops = {
.ndo_open = emac_open,
.ndo_stop = emac_close,
.ndo_get_stats = emac_stats,
.ndo_set_multicast_list = emac_set_multicast_list,
.ndo_do_ioctl = emac_ioctl,
.ndo_tx_timeout = emac_tx_timeout,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
.ndo_start_xmit = emac_start_xmit_sg,
.ndo_change_mtu = emac_change_mtu,
};
static int __devinit emac_probe(struct of_device *ofdev, static int __devinit emac_probe(struct of_device *ofdev,
const struct of_device_id *match) const struct of_device_id *match)
{ {
...@@ -2827,23 +2853,14 @@ static int __devinit emac_probe(struct of_device *ofdev, ...@@ -2827,23 +2853,14 @@ static int __devinit emac_probe(struct of_device *ofdev,
if (err != 0) if (err != 0)
goto err_detach_tah; goto err_detach_tah;
/* Fill in the driver function table */
ndev->open = &emac_open;
if (dev->tah_dev) if (dev->tah_dev)
ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
ndev->tx_timeout = &emac_tx_timeout;
ndev->watchdog_timeo = 5 * HZ; ndev->watchdog_timeo = 5 * HZ;
ndev->stop = &emac_close;
ndev->get_stats = &emac_stats;
ndev->set_multicast_list = &emac_set_multicast_list;
ndev->do_ioctl = &emac_ioctl;
if (emac_phy_supports_gige(dev->phy_mode)) { if (emac_phy_supports_gige(dev->phy_mode)) {
ndev->hard_start_xmit = &emac_start_xmit_sg; ndev->netdev_ops = &emac_gige_netdev_ops;
ndev->change_mtu = &emac_change_mtu;
dev->commac.ops = &emac_commac_sg_ops; dev->commac.ops = &emac_commac_sg_ops;
} else { } else
ndev->hard_start_xmit = &emac_start_xmit; ndev->netdev_ops = &emac_netdev_ops;
}
SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops); SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops);
netif_carrier_off(ndev); netif_carrier_off(ndev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment