xtsonic: convert to net_device_ops
Subsystems (2)
PATCH 1/11 xtsonic: convert to net_device_ops
---
drivers/net/xtsonic.c | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-)
drivers/net/xtsonic.c +13 -6
@@ -108,6 +108,18 @@ static int xtsonic_close(struct net_device *dev)return err; } +static const struct net_device_ops xtsonic_netdev_ops = { + .ndo_open = xtsonic_open, + .ndo_stop = xtsonic_close, + .ndo_start_xmit = sonic_send_packet, + .ndo_get_stats = sonic_get_stats, + .ndo_set_multicast_list = sonic_multicast_list, + .ndo_tx_timeout = sonic_tx_timeout, + .ndo_validate_addr = eth_validate_addr, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, +}; +static int __init sonic_probe1 (struct net_device *dev) {static unsigned version_printed =0 ;
@@ -205,12 +217,7 @@ static int __init sonic_probe1(struct net_device *dev) lp->rra_laddr = lp->rda_laddr + (SIZEOF_SONIC_RD *SONIC_NUM_RDS *SONIC_BUS_SCALE (lp->dma_bitmode)); - dev->open = xtsonic_open; - dev->stop = xtsonic_close; - dev->hard_start_xmit = sonic_send_packet; - dev->get_stats = sonic_get_stats; - dev->set_multicast_list = &sonic_multicast_list; - dev->tx_timeout = sonic_tx_timeout; + dev->netdev_ops = &xtsonic_netdev_ops; dev->watchdog_timeo =TX_TIMEOUT ;/*
Re: [PATCH 02/11] tsi108_eth: convert to net_device_ops
---
drivers/net/tsi108_eth.c | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-)
drivers/net/tsi108_eth.c +13 -7
@@ -1561,6 +1561,18 @@ static const struct ethtool_ops tsi108_ethtool_ops = { .set_settings = tsi108_set_settings, }; +static const struct net_device_ops tsi108_netdev_ops = { + .ndo_open = tsi108_open, + .ndo_stop = tsi108_close, + .ndo_start_xmit = tsi108_send_packet, + .ndo_set_multicast_list = tsi108_set_rx_mode, + .ndo_get_stats = tsi108_get_stats, + .ndo_do_ioctl = tsi108_do_ioctl, + .ndo_set_mac_address = tsi108_set_mac, + .ndo_validate_addr = eth_validate_addr, + .ndo_change_mtu = eth_change_mtu, +}; +static int tsi108_init_one (struct platform_device *pdev) {
@@ -1616,14 +1628,8 @@ tsi108_init_one(struct platform_device *pdev) data->phy_type = einfo->phy_type; data->irq_num = einfo->irq_num; data->id = pdev->id; - dev->open = tsi108_open; - dev->stop = tsi108_close; - dev->hard_start_xmit = tsi108_send_packet; - dev->set_mac_address = tsi108_set_mac; - dev->set_multicast_list = tsi108_set_rx_mode; - dev->get_stats = tsi108_get_stats;netif_napi_add (dev, &data->napi, tsi108_poll,64 ); - dev->do_ioctl = tsi108_do_ioctl; + dev->netdev_ops = &tsi108_netdev_ops; dev->ethtool_ops = &tsi108_ethtool_ops;/* Apparently, the Linux networking code won't use scatter-gather
Re: [PATCH 02/11] tsi108_eth: convert to net_device_ops
From: Alexander Beregalov <[email protected]>
Date: Sat, 11 Apr 2009 21:37:59 +0400
Quoted 1 line
Signed-off-by Alexander Beregalov <[email protected]>
Applied.
PATCH 3/11 tc35815: convert to net_device_ops
In reply to Alexander Beregalov---
drivers/net/tc35815.c | 27 +++++++++++++++++---------- 1 files changed, 17 insertions(+), 10 deletions(-)
drivers/net/tc35815.c +17 -10
@@ -862,6 +862,22 @@ static int __devinit tc35815_init_dev_addr(struct net_device *dev)return 0 ; } +static const struct net_device_ops tc35815_netdev_ops = { + .ndo_open = tc35815_open, + .ndo_stop = tc35815_close, + .ndo_start_xmit = tc35815_send_packet, + .ndo_get_stats = tc35815_get_stats, + .ndo_set_multicast_list = tc35815_set_multicast_list, + .ndo_tx_timeout = tc35815_tx_timeout, + .ndo_do_ioctl = tc35815_ioctl, + .ndo_validate_addr = eth_validate_addr, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = tc35815_poll_controller, +#endif +}; +static int __devinit tc35815_init_one (struct pci_dev *pdev,const struct pci_device_id *ent) {
@@ -904,21 +920,12 @@ static int __devinit tc35815_init_one(struct pci_dev *pdev, ioaddr =pcim_iomap_table (pdev)[1 ];/* Initialize the device structure. */ - dev->open = tc35815_open; - dev->hard_start_xmit = tc35815_send_packet; - dev->stop = tc35815_close; - dev->get_stats = tc35815_get_stats; - dev->set_multicast_list = tc35815_set_multicast_list; - dev->do_ioctl = tc35815_ioctl; + dev->netdev_ops = &tc35815_netdev_ops; dev->ethtool_ops = &tc35815_ethtool_ops; - dev->tx_timeout = tc35815_tx_timeout; dev->watchdog_timeo =TC35815_TX_TIMEOUT ;#ifdef TC35815_NAPI netif_napi_add (dev, &lp->napi, tc35815_poll,NAPI_WEIGHT );#endif -#ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = tc35815_poll_controller; -#endif dev->irq = pdev->irq; dev->base_addr = (unsigned long )ioaddr;
Re: [PATCH 03/11] tc35815: convert to net_device_ops
From: Alexander Beregalov <[email protected]>
Date: Sat, 11 Apr 2009 21:38:54 +0400
Quoted 1 line
Signed-off-by Alexander Beregalov <[email protected]>
Applied.
PATCH 4/11 sun3_82586: convert to net_device_ops
In reply to Alexander Beregalov---
drivers/net/sun3_82586.c | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-)
drivers/net/sun3_82586.c +13 -6
@@ -331,6 +331,18 @@ out:return ERR_PTR (err); } +static const struct net_device_ops sun3_82586_netdev_ops = { + .ndo_open = sun3_82586_open, + .ndo_stop = sun3_82586_close, + .ndo_start_xmit = sun3_82586_send_packet, + .ndo_set_multicast_list = set_multicast_list, + .ndo_tx_timeout = sun3_82586_timeout, + .ndo_get_stats = sun3_82586_get_stats, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_mac_address = eth_mac_addr, + .ndo_change_mtu = eth_change_mtu, +}; +static int __init sun3_82586_probe1 (struct net_device *dev,int ioaddr) {int i, size, retval;
@@ -381,13 +393,8 @@ static int __init sun3_82586_probe1(struct net_device *dev,int ioaddr)printk ("Memaddr: 0x%lx, Memsize: %d, IRQ %d\n" ,dev->mem_start,size, dev->irq); - dev->open = sun3_82586_open; - dev->stop = sun3_82586_close; - dev->get_stats = sun3_82586_get_stats; - dev->tx_timeout = sun3_82586_timeout; + dev->netdev_ops = &sun3_82586_netdev_ops; dev->watchdog_timeo =HZ /20 ; - dev->hard_start_xmit = sun3_82586_send_packet; - dev->set_multicast_list = set_multicast_list; dev->if_port =0 ;return 0 ;
Re: [PATCH 04/11] sun3_82586: convert to net_device_ops
From: Alexander Beregalov <[email protected]>
Date: Sat, 11 Apr 2009 21:39:58 +0400
Quoted 1 line
Signed-off-by Alexander Beregalov <[email protected]>
Applied.
PATCH 5/11 sh_eth: convert to net_device_ops
In reply to Alexander Beregalov---
drivers/net/sh_eth.c | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-)
drivers/net/sh_eth.c +14 -7
@@ -1188,6 +1188,19 @@ out:return ret; } +static const struct net_device_ops sh_eth_netdev_ops = { + .ndo_open = sh_eth_open, + .ndo_stop = sh_eth_close, + .ndo_start_xmit = sh_eth_start_xmit, + .ndo_get_stats = sh_eth_get_stats, + .ndo_set_multicast_list = sh_eth_set_multicast_list, + .ndo_tx_timeout = sh_eth_tx_timeout, + .ndo_do_ioctl = sh_eth_do_ioctl, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_mac_address = eth_mac_addr, + .ndo_change_mtu = eth_change_mtu, +}; +static int sh_eth_drv_probe (struct platform_device *pdev) {int ret, i, devno =0 ;
@@ -1240,13 +1253,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev) mdp->edmac_endian = pd->edmac_endian;/* set function */ - ndev->open = sh_eth_open; - ndev->hard_start_xmit = sh_eth_start_xmit; - ndev->stop = sh_eth_close; - ndev->get_stats = sh_eth_get_stats; - ndev->set_multicast_list = sh_eth_set_multicast_list; - ndev->do_ioctl = sh_eth_do_ioctl; - ndev->tx_timeout = sh_eth_tx_timeout; + ndev->netdev_ops = &sh_eth_netdev_ops; ndev->watchdog_timeo =TX_TIMEOUT ; mdp->post_rx =POST_RX >> (devno <<1 );
Re: [PATCH 05/11] sh_eth: convert to net_device_ops
From: Alexander Beregalov <[email protected]>
Date: Sat, 11 Apr 2009 21:40:49 +0400
Quoted 1 line
Signed-off-by Alexander Beregalov <[email protected]>
Applied.
PATCH 6/11 macsonic: convert to net_device_ops
In reply to Alexander Beregalov---
drivers/net/macsonic.c | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-)
drivers/net/macsonic.c +13 -6
@@ -167,6 +167,18 @@ static int macsonic_close(struct net_device* dev)return err; } +static const struct net_device_ops macsonic_netdev_ops = { + .ndo_open = macsonic_open, + .ndo_stop = macsonic_close, + .ndo_start_xmit = sonic_send_packet, + .ndo_set_multicast_list = sonic_multicast_list, + .ndo_tx_timeout = sonic_tx_timeout, + .ndo_get_stats = sonic_get_stats, + .ndo_validate_addr = eth_validate_addr, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, +}; +static int __init macsonic_init (struct net_device *dev) {struct sonic_local * lp =netdev_priv (dev);
@@ -198,12 +210,7 @@ static int __init macsonic_init(struct net_device *dev) lp->rra_laddr = lp->rda_laddr + (SIZEOF_SONIC_RD *SONIC_NUM_RDS *SONIC_BUS_SCALE (lp->dma_bitmode)); - dev->open = macsonic_open; - dev->stop = macsonic_close; - dev->hard_start_xmit = sonic_send_packet; - dev->get_stats = sonic_get_stats; - dev->set_multicast_list = &sonic_multicast_list; - dev->tx_timeout = sonic_tx_timeout; + dev->netdev_ops = &macsonic_netdev_ops; dev->watchdog_timeo =TX_TIMEOUT ;/*
Re: [PATCH 06/11] macsonic: convert to net_device_ops
From: Alexander Beregalov <[email protected]>
Date: Sat, 11 Apr 2009 21:41:28 +0400
Quoted 1 line
Signed-off-by Alexander Beregalov <[email protected]>
Applied.
PATCH 7/11 macb: convert to net_device_ops
In reply to Alexander Beregalov---
drivers/net/macb.c | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-)
drivers/net/macb.c +13 -6
@@ -1100,6 +1100,18 @@ static int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)return phy_mii_ioctl (phydev,if_mii (rq), cmd); } +static const struct net_device_ops macb_netdev_ops = { + .ndo_open = macb_open, + .ndo_stop = macb_close, + .ndo_start_xmit = macb_start_xmit, + .ndo_set_multicast_list = macb_set_rx_mode, + .ndo_get_stats = macb_get_stats, + .ndo_do_ioctl = macb_ioctl, + .ndo_validate_addr = eth_validate_addr, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, +}; +static int __init macb_probe (struct platform_device *pdev) {struct eth_platform_data *pdata;
@@ -1175,12 +1187,7 @@ static int __init macb_probe(struct platform_device *pdev) goto err_out_iounmap; } - dev->open = macb_open; - dev->stop = macb_close; - dev->hard_start_xmit = macb_start_xmit; - dev->get_stats = macb_get_stats; - dev->set_multicast_list = macb_set_rx_mode; - dev->do_ioctl = macb_ioctl; + dev->netdev_ops = &macb_netdev_ops;netif_napi_add (dev, &bp->napi, macb_poll,64 ); dev->ethtool_ops = &macb_ethtool_ops;
Re: [PATCH 07/11] macb: convert to net_device_ops
From: Alexander Beregalov <[email protected]>
Date: Sat, 11 Apr 2009 21:42:26 +0400
Quoted 1 line
Signed-off-by Alexander Beregalov <[email protected]>
Applied.
PATCH 8/11 mac89x0: convert to net_device_ops
In reply to Alexander Beregalov---
drivers/net/mac89x0.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-)
drivers/net/mac89x0.c +12 -6
@@ -168,6 +168,17 @@ writereg(struct net_device *dev, int portno, int value)nubus_writew (swab16 (value), dev->mem_start + portno); } +static const struct net_device_ops mac89x0_netdev_ops = { + .ndo_open = net_open, + .ndo_stop = net_close, + .ndo_start_xmit = net_send_packet, + .ndo_get_stats = net_get_stats, + .ndo_set_multicast_list = set_multicast_list, + .ndo_set_mac_address = set_mac_address, + .ndo_validate_addr = eth_validate_addr, + .ndo_change_mtu = eth_change_mtu, +}; +/* Probe for the CS8900 card in slot E. We won't bother looking anywhere else until we have a really good reason to do so. */ struct net_device *__init mac89x0_probe (int unit)
@@ -280,12 +291,7 @@ struct net_device * __init mac89x0_probe(int unit)printk (" IRQ %d ADDR %pM\n" , dev->irq, dev->dev_addr); - dev->open = net_open; - dev->stop = net_close; - dev->hard_start_xmit = net_send_packet; - dev->get_stats = net_get_stats; - dev->set_multicast_list = &set_multicast_list; - dev->set_mac_address = &set_mac_address; + dev->netdev_ops = &mac89x0_netdev_ops; err =register_netdev (dev);if (err)
Re: [PATCH 08/11] mac89x0: convert to net_device_ops
From: Alexander Beregalov <[email protected]>
Date: Sat, 11 Apr 2009 21:43:11 +0400
Quoted 1 line
Signed-off-by Alexander Beregalov <[email protected]>
Applied.
PATCH 9/11 isa-skeleton: convert to net_device_ops
In reply to Alexander Beregalov---
drivers/net/isa-skeleton.c | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-)
drivers/net/isa-skeleton.c +13 -7
@@ -181,6 +181,18 @@ out: }#endif +static const struct net_device_ops netcard_netdev_ops = { + .ndo_open = net_open, + .ndo_stop = net_close, + .ndo_start_xmit = net_send_packet, + .ndo_get_stats = net_get_stats, + .ndo_set_multicast_list = set_multicast_list, + .ndo_tx_timeout = net_tx_timeout, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_mac_address = eth_mac_addr, + .ndo_change_mtu = eth_change_mtu, +}; +/* * This is the real probe routine. Linux has a history of friendly device * probes on the ISA bus. A good device probes avoids doing writes, and
@@ -303,13 +315,7 @@ static int __init netcard_probe1(struct net_device *dev, int ioaddr) np =netdev_priv (dev);spin_lock_init (&np->lock); - dev->open = net_open; - dev->stop = net_close; - dev->hard_start_xmit = net_send_packet; - dev->get_stats = net_get_stats; - dev->set_multicast_list = &set_multicast_list; - - dev->tx_timeout = &net_tx_timeout; + dev->netdev_ops = &netcard_netdev_ops; dev->watchdog_timeo =MY_TX_TIMEOUT ; err =register_netdev (dev);
Re: [PATCH 09/11] isa-skeleton: convert to net_device_ops
From: Alexander Beregalov <[email protected]>
Date: Sat, 11 Apr 2009 21:44:06 +0400
Quoted 1 line
Signed-off-by Alexander Beregalov <[email protected]>
Applied.
PATCH 10/11 ioc3-eth: convert to net_device_ops
In reply to Alexander Beregalov---
drivers/net/ioc3-eth.c | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-)
drivers/net/ioc3-eth.c +14 -8
@@ -1214,6 +1214,19 @@ static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3) }#endif +static const struct net_device_ops ioc3_netdev_ops = { + .ndo_open = ioc3_open, + .ndo_stop = ioc3_close, + .ndo_start_xmit = ioc3_start_xmit, + .ndo_tx_timeout = ioc3_timeout, + .ndo_get_stats = ioc3_get_stats, + .ndo_set_multicast_list = ioc3_set_multicast_list, + .ndo_do_ioctl = ioc3_ioctl, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_mac_address = ioc3_set_mac_address, + .ndo_change_mtu = eth_change_mtu, +}; +static int __devinit ioc3_probe (struct pci_dev *pdev,const struct pci_device_id *ent) {
@@ -1310,15 +1323,8 @@ static int __devinit ioc3_probe(struct pci_dev *pdev,ioc3_get_eaddr (ip);/* The IOC3-specific entries in the device structure. */ - dev->open = ioc3_open; - dev->hard_start_xmit = ioc3_start_xmit; - dev->tx_timeout = ioc3_timeout; dev->watchdog_timeo =5 *HZ ; - dev->stop = ioc3_close; - dev->get_stats = ioc3_get_stats; - dev->do_ioctl = ioc3_ioctl; - dev->set_multicast_list = ioc3_set_multicast_list; - dev->set_mac_address = ioc3_set_mac_address; + dev->netdev_ops = &ioc3_netdev_ops; dev->ethtool_ops = &ioc3_ethtool_ops; dev->features =NETIF_F_IP_CSUM ;
Re: [PATCH 10/11] ioc3-eth: convert to net_device_ops
From: Alexander Beregalov <[email protected]>
Date: Sat, 11 Apr 2009 21:44:55 +0400
Quoted 1 line
Signed-off-by Alexander Beregalov <[email protected]>
Applied.
PATCH 11/11 eth_v10: convert to net_device_ops
In reply to Alexander Beregalov---
drivers/net/cris/eth_v10.c | 30 ++++++++++++++++++------------ 1 files changed, 18 insertions(+), 12 deletions(-)
drivers/net/cris/eth_v10.c +18 -12
@@ -257,6 +257,23 @@ struct transceiver_ops transceivers[] =struct transceiver_ops * transceiver = &transceivers[0 ]; +static const struct net_device_ops e100_netdev_ops = { + .ndo_open = e100_open, + .ndo_stop = e100_close, + .ndo_start_xmit = e100_send_packet, + .ndo_tx_timeout = e100_tx_timeout, + .ndo_get_stats = e100_get_stats, + .ndo_set_multicast_list = set_multicast_list, + .ndo_do_ioctl = e100_ioctl, + .ndo_set_mac_address = e100_set_mac_address, + .ndo_validate_addr = eth_validate_addr, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_config = e100_set_config, +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = e100_netpoll, +#endif +}; +#define tx_done (dev) (*R_DMA_CH0_CMD == 0)/*
@@ -300,19 +317,8 @@ etrax_ethernet_init(void)/* fill in our handlers so the network layer can talk to us in the future */ - dev->open = e100_open; - dev->hard_start_xmit = e100_send_packet; - dev->stop = e100_close; - dev->get_stats = e100_get_stats; - dev->set_multicast_list = set_multicast_list; - dev->set_mac_address = e100_set_mac_address; dev->ethtool_ops = &e100_ethtool_ops; - dev->do_ioctl = e100_ioctl; - dev->set_config = e100_set_config; - dev->tx_timeout = e100_tx_timeout; -#ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = e100_netpoll; -#endif + dev->netdev_ops = &e100_netdev_ops;spin_lock_init (&np->lock);spin_lock_init (&np->led_lock);
Re: [PATCH 11/11] eth_v10: convert to net_device_ops
From: Alexander Beregalov <[email protected]>
Date: Sat, 11 Apr 2009 21:45:55 +0400
Quoted 1 line
Signed-off-by Alexander Beregalov <[email protected]>
Applied.
From: Alexander Beregalov <[email protected]>
Date: Sat, 11 Apr 2009 21:30:19 +0400
Quoted 1 line
Signed-off-by Alexander Beregalov <[email protected]>
Applied.
2009/4/14 David Miller <[email protected]>:
Quoted 6 lines
From: Alexander Beregalov <[email protected]>
Date: Sat, 11 Apr 2009 21:30:19 +0400Quoted 1 line
Signed-off-by Alexander Beregalov <[email protected]>Applied.
Thanks David.
It seems build should not fail with !CONFIG_COMPAT_NET_DEV_OPS anymore. Perhaps it can be changed to "default n" in next release (-next and 2.6.31) ?
David Miller
maintainerFrom: Alexander Beregalov <[email protected]>
Date: Tue, 14 Apr 2009 03:12:27 +0400
Quoted 4 lines
2009/4/14 David Miller <[email protected]>:
Quoted 3 lines
From: Alexander Beregalov <[email protected]>
Date: Sat, 11 Apr 2009 21:30:19 +0400
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Alexander Beregalov <[email protected]>Applied.
Thanks David.
It seems build should not fail with !CONFIG_COMPAT_NET_DEV_OPS anymore. Perhaps it can be changed to "default n" in next release (-next and 2.6.31) ?
I think we probably do that, sure. I'll try to remember to do this next time I merge net-2.6 into net-next-2.6
And after a few weeks of -next exposure I think we can remove the option and protected code entirely.