Subject: Re: Can we have GET_NETDEV_DEV?

From: Pavel Roskin <[email-masked]>
Date: Tue, 25 Jul 2006 17:08:11 -0400

Hello, Stephen!

On Tue, 2006-07-25 at 10:20 -0700, Stephen Hemminger wrote:

> So how about these wrappers.

> +static inline void netdev_set_pdev(struct net_device *dev, struct device *pdev)
> +{
> +	dev->class_dev.dev = pdev;
> +}
> +
> +static inline struct device *netdev_get_pdev(struct net_device *dev)
> +{
> +	return dev->class_dev.dev;
> +}

The positive effect of a macro is that if would allow MadWifi to prepare
in advance by testing if GET_NETDEV_DEV is defined.

The functions may or may not be useful for the code in the kernel, but
I'll not be able to prepare MadWifi unless I know the kernel version in
which they will appear.

Considering the drivers that are already in the kernel, you may prefer
to have a more high-level function that would clone the network device
by copying most of the net_device structure.  I think netdev_get_pdev()
would be mostly used for such cloning if implemented.

-- 
Regards,
Pavel Roskin