[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081110172107.4285b5b8@extreme>
Date: Mon, 10 Nov 2008 17:21:07 -0800
From: Stephen Hemminger <shemminger@...tta.com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: Re: [RFC] network device ops phase 1
On Mon, 10 Nov 2008 17:02:11 -0800 (PST)
David Miller <davem@...emloft.net> wrote:
> From: Stephen Hemminger <shemminger@...tta.com>
> Date: Fri, 7 Nov 2008 15:50:23 -0800
>
> > This early work on a series of patches to separate the management portions
> > of the network device (immutable function pointers) from the data
> > structure part of the network device.
> ...
>
> I think this is a good way to attack this kind of transition.
>
> Fix the build errors, do some testing, and please resubmit:
>
> net/core/dev.c: In function ‘register_netdevice’:
> net/core/dev.c:4075: error: ‘struct net_device_ops’ has no member named ‘poll_controller’
> net/core/dev.c:4075: error: ‘struct net_device’ has no member named ‘poll_controller’
> make[2]: *** [net/core/dev.o] Error 1
> make[1]: *** [net/core] Error 2
> make: *** [net] Error 2
> make: *** Waiting for unfinished jobs....
>
> Thanks.
This is one case where I wish GCC had more C++ style anonymous structures
so the following would work, and avoid the copying and allocation.
struct net_device_ops {
int (*init)(struct net_device *);
...
};
struct net_device {
...
#ifdef CONFIG_COMPAT_XXX
struct net_device_ops;
#endif
struct net_device_ops *ops;
};
void register_netdevice(struct net_device *dev)
{
...
#ifdef CONFIG_COMPAT_XXX
if (ops == NULL) {
printk("loser device %s", dev->name);
dev->ops = (struct net_device_ops *) dev->init;
}
#endif
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists