diff mbox

simnet: convert to net_device_ops

Message ID 20081209150827.GA8134@x200.localdomain
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Alexey Dobriyan Dec. 9, 2008, 3:08 p.m. UTC
On Tue, Dec 09, 2008 at 05:11:17PM +0300, Alexander Beregalov wrote:
>   CC      arch/ia64/hp/sim/simeth.o
> arch/ia64/hp/sim/simeth.c: In function 'simeth_probe1':
> arch/ia64/hp/sim/simeth.c:212: error: 'struct net_device' has no member named 'open'

[PATCH] simeth: convert to net_device_ops

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 arch/ia64/hp/sim/simeth.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Dec. 10, 2008, 6:57 a.m. UTC | #1
From: Alexey Dobriyan <adobriyan@gmail.com>
Date: Tue, 9 Dec 2008 18:08:27 +0300

> On Tue, Dec 09, 2008 at 05:11:17PM +0300, Alexander Beregalov wrote:
> >   CC      arch/ia64/hp/sim/simeth.o
> > arch/ia64/hp/sim/simeth.c: In function 'simeth_probe1':
> > arch/ia64/hp/sim/simeth.c:212: error: 'struct net_device' has no member named 'open'
> 
> [PATCH] simeth: convert to net_device_ops
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

This doesn't explain the build failure.

Using ->open() and friends should work perfectly fine for drivers not
yet converted to netdev_ops.  The code protected by COMPAT_NET_DEV_OPS
provides this, and we force that Kconfig option to always be on.

I don't want to add this patch and just shrug off this build failure.
If this build failures, we should be seeing 200 other drivers not
build too.

I suspect something is messed up with this person's kernel config
or similar.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexey Dobriyan Dec. 10, 2008, 11:54 a.m. UTC | #2
On Tue, Dec 09, 2008 at 10:57:28PM -0800, David Miller wrote:
> From: Alexey Dobriyan <adobriyan@gmail.com>
> Date: Tue, 9 Dec 2008 18:08:27 +0300
> 
> > On Tue, Dec 09, 2008 at 05:11:17PM +0300, Alexander Beregalov wrote:
> > >   CC      arch/ia64/hp/sim/simeth.o
> > > arch/ia64/hp/sim/simeth.c: In function 'simeth_probe1':
> > > arch/ia64/hp/sim/simeth.c:212: error: 'struct net_device' has no member named 'open'
> > 
> > [PATCH] simeth: convert to net_device_ops
> > 
> > Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> 
> This doesn't explain the build failure.

I triggered it manually.

And most certainly forgot .ndo_validate_addr, so patch needs resend anyway.

> Using ->open() and friends should work perfectly fine for drivers not
> yet converted to netdev_ops.  The code protected by COMPAT_NET_DEV_OPS
> provides this, and we force that Kconfig option to always be on.
> 
> I don't want to add this patch and just shrug off this build failure.
> If this build failures, we should be seeing 200 other drivers not
> build too.
> 
> I suspect something is messed up with this person's kernel config
> or similar.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Dec. 16, 2008, 9:56 a.m. UTC | #3
From: Alexey Dobriyan <adobriyan@gmail.com>
Date: Tue, 9 Dec 2008 18:08:27 +0300

> On Tue, Dec 09, 2008 at 05:11:17PM +0300, Alexander Beregalov wrote:
> >   CC      arch/ia64/hp/sim/simeth.o
> > arch/ia64/hp/sim/simeth.c: In function 'simeth_probe1':
> > arch/ia64/hp/sim/simeth.c:212: error: 'struct net_device' has no member named 'open'
> 
> [PATCH] simeth: convert to net_device_ops
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

Now that the kconfig badness has been fixed, I've applied
this.

Thanks Alexey.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/arch/ia64/hp/sim/simeth.c
+++ b/arch/ia64/hp/sim/simeth.c
@@ -167,6 +167,15 @@  netdev_read(int fd, unsigned char *buf, unsigned int len)
 	return ia64_ssc(fd, __pa(buf), len, 0, SSC_NETDEV_RECV);
 }
 
+static const struct net_device_ops simeth_netdev_ops = {
+	.ndo_open		= simeth_open,
+	.ndo_stop		= simeth_close,
+	.ndo_start_xmit		= simeth_tx,
+	.ndo_get_stats		= simeth_get_stats,
+	.ndo_set_multicast_list	= set_multicast_list, /* not yet used */
+
+};
+
 /*
  * Function shared with module code, so cannot be in init section
  *
@@ -209,11 +218,7 @@  simeth_probe1(void)
 	local = netdev_priv(dev);
 	local->simfd = fd; /* keep track of underlying file descriptor */
 
-	dev->open		= simeth_open;
-	dev->stop		= simeth_close;
-	dev->hard_start_xmit	= simeth_tx;
-	dev->get_stats		= simeth_get_stats;
-	dev->set_multicast_list = set_multicast_list; /* no yet used */
+	dev->netdev_ops = &simeth_netdev_ops;
 
 	err = register_netdev(dev);
 	if (err) {