* [PATCH] ni5010: convert to net_device_ops @ 2009-03-29 2:26 Alexander Beregalov 2009-03-29 2:36 ` David Miller 0 siblings, 1 reply; 4+ messages in thread From: Alexander Beregalov @ 2009-03-29 2:26 UTC (permalink / raw) To: David Miller, netdev, Stephen Hemminger Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> --- drivers/net/ni5010.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/net/ni5010.c b/drivers/net/ni5010.c index 539e18a..b121e0f 100644 --- a/drivers/net/ni5010.c +++ b/drivers/net/ni5010.c @@ -189,6 +189,14 @@ static void __init trigger_irq(int ioaddr) outb(MM_EN_XMT|MM_MUX, IE_MMODE); /* Start transmission */ } +static const struct net_device_ops ni5010_netdev_ops = { + .ndo_open = ni5010_open, + .ndo_stop = ni5010_close, + .ndo_start_xmit = ni5010_send_packet, + .ndo_set_multicast_list = ni5010_set_multicast_list, + .ndo_tx_timeout = ni5010_timeout, +}; + /* * 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 @@ -328,13 +336,8 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr) outb(0, IE_RBUF); /* set buffer byte 0 to 0 again */ } printk("-> bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE); - memset(netdev_priv(dev), 0, sizeof(struct ni5010_local)); - dev->open = ni5010_open; - dev->stop = ni5010_close; - dev->hard_start_xmit = ni5010_send_packet; - dev->set_multicast_list = ni5010_set_multicast_list; - dev->tx_timeout = ni5010_timeout; + dev->netdev_ops = &ni5010_netdev_ops; dev->watchdog_timeo = HZ/20; dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */ ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ni5010: convert to net_device_ops 2009-03-29 2:26 [PATCH] ni5010: convert to net_device_ops Alexander Beregalov @ 2009-03-29 2:36 ` David Miller 2009-03-29 2:51 ` Alexander Beregalov 0 siblings, 1 reply; 4+ messages in thread From: David Miller @ 2009-03-29 2:36 UTC (permalink / raw) To: a.beregalov; +Cc: netdev, shemminger From: Alexander Beregalov <a.beregalov@gmail.com> Date: Sun, 29 Mar 2009 06:26:13 +0400 > @@ -189,6 +189,14 @@ static void __init trigger_irq(int ioaddr) > outb(MM_EN_XMT|MM_MUX, IE_MMODE); /* Start transmission */ > } > > +static const struct net_device_ops ni5010_netdev_ops = { > + .ndo_open = ni5010_open, > + .ndo_stop = ni5010_close, > + .ndo_start_xmit = ni5010_send_packet, > + .ndo_set_multicast_list = ni5010_set_multicast_list, > + .ndo_tx_timeout = ni5010_timeout, > +}; Missing: .ndo_change_mtu = eth_change_mtu, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, as would have been initialized to dev->foo by alloc_etherdev(). ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ni5010: convert to net_device_ops 2009-03-29 2:36 ` David Miller @ 2009-03-29 2:51 ` Alexander Beregalov 2009-03-29 6:37 ` David Miller 0 siblings, 1 reply; 4+ messages in thread From: Alexander Beregalov @ 2009-03-29 2:51 UTC (permalink / raw) To: David Miller; +Cc: netdev, shemminger On Sat, Mar 28, 2009 at 07:36:04PM -0700, David Miller wrote: > From: Alexander Beregalov <a.beregalov@gmail.com> > Date: Sun, 29 Mar 2009 06:26:13 +0400 > > > @@ -189,6 +189,14 @@ static void __init trigger_irq(int ioaddr) > > outb(MM_EN_XMT|MM_MUX, IE_MMODE); /* Start transmission */ > > } > > > > +static const struct net_device_ops ni5010_netdev_ops = { > > + .ndo_open = ni5010_open, > > + .ndo_stop = ni5010_close, > > + .ndo_start_xmit = ni5010_send_packet, > > + .ndo_set_multicast_list = ni5010_set_multicast_list, > > + .ndo_tx_timeout = ni5010_timeout, > > +}; > > Missing: > > .ndo_change_mtu = eth_change_mtu, > .ndo_set_mac_address = eth_mac_addr, > .ndo_validate_addr = eth_validate_addr, > > as would have been initialized to dev->foo by alloc_etherdev(). Ok, thanks. Subject: [PATCH] ni5010: convert to net_device_ops From: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> --- drivers/net/ni5010.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/net/ni5010.c b/drivers/net/ni5010.c index 539e18a..2a8da47 100644 --- a/drivers/net/ni5010.c +++ b/drivers/net/ni5010.c @@ -189,6 +189,17 @@ static void __init trigger_irq(int ioaddr) outb(MM_EN_XMT|MM_MUX, IE_MMODE); /* Start transmission */ } +static const struct net_device_ops ni5010_netdev_ops = { + .ndo_open = ni5010_open, + .ndo_stop = ni5010_close, + .ndo_start_xmit = ni5010_send_packet, + .ndo_set_multicast_list = ni5010_set_multicast_list, + .ndo_tx_timeout = ni5010_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 @@ -328,13 +339,8 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr) outb(0, IE_RBUF); /* set buffer byte 0 to 0 again */ } printk("-> bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE); - memset(netdev_priv(dev), 0, sizeof(struct ni5010_local)); - dev->open = ni5010_open; - dev->stop = ni5010_close; - dev->hard_start_xmit = ni5010_send_packet; - dev->set_multicast_list = ni5010_set_multicast_list; - dev->tx_timeout = ni5010_timeout; + dev->netdev_ops = &ni5010_netdev_ops; dev->watchdog_timeo = HZ/20; dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */ ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ni5010: convert to net_device_ops 2009-03-29 2:51 ` Alexander Beregalov @ 2009-03-29 6:37 ` David Miller 0 siblings, 0 replies; 4+ messages in thread From: David Miller @ 2009-03-29 6:37 UTC (permalink / raw) To: a.beregalov; +Cc: netdev, shemminger From: Alexander Beregalov <a.beregalov@gmail.com> Date: Sun, 29 Mar 2009 06:51:23 +0400 > ni5010: convert to net_device_ops > > Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Applied, thanks. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-03-29 6:37 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-03-29 2:26 [PATCH] ni5010: convert to net_device_ops Alexander Beregalov 2009-03-29 2:36 ` David Miller 2009-03-29 2:51 ` Alexander Beregalov 2009-03-29 6:37 ` David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).