[vbox-dev] New breakage from Linus

Larry Finger Larry.Finger at lwfinger.net
Sun Jun 21 17:33:30 GMT 2009


walt wrote:
> Larry Finger wrote:
>> With 2.6.30, there was a message something to the effect "vboxnetflt
>> not using net_device_ops". With 2.6.31, the old method disappears and
>> one must use the new one.
>>
>> The required patch is as follows:
>>
>> Index: src/vboxnetflt/linux/VBoxNetFlt-linux.c
> 
> I think you must be ahead of me, as usual :o)  My problem is not with
> VBoxNetFlt (which still compiles as of this morning's updates) but with
> VBoxNetAdp:
> 
> kBuild: Compiling VBoxNetAdp -
> /home/wa1ter/src/vbox/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
> 
> /home/wa1ter/src/vbox/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c:
> In function ‘vboxNetAdpNetDevInit’:
> /home/wa1ter/src/vbox/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c:169:
> error: ‘struct net_device’ has no member named ‘
> open’
> /home/wa1ter/src/vbox/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c:170:
> error: ‘struct net_device’ has no member named ‘
> stop’
> /home/wa1ter/src/vbox/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c:171:
> error: ‘struct net_device’ has no member named ‘
> hard_start_xmit’
> /home/wa1ter/src/vbox/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c:172:
> error: ‘struct net_device’ has no member named ‘
> get_stats’

I'm not running the OSE version and only have to contend with the
kernel modules for the pre-compiled RPM for openSUSE 11.1.

You need to make the same kind of change that I did for VBoxNetFlt:

1. Create the new net_device_ops structure that looks like:

static const struct net_device_ops vbox_netdev_ops = {
       .ndo_open = vboxNetAdpOpen,
       .ndo_stop = vboxNetAdpStop,
       .ndo_start_xmit = vboxNetAdpXmit,
       .ndo_get_stats = vboxNetAdpGetStats,
};

Of course, the routine names are likely different, but use the same
routine for ndo_open that is used by open, etc.

2. Remove the lines of the form pNetDev->open, etc.

3. Add the line pNetDev->netdev_ops = &vbox_netdev_ops;

Note: I'm guessing about the pNetDev part.

If you really want to make it fancy, use the kernel version as in

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
...... new stuff here
#else
...... deleted stuff here
#endif

I posted this form under a new heading and also fixed one that will be
coming soon with pm_ops. That was a little more complicated because
the parameters for the suspend and resume routines changed.

Larry





More information about the vbox-dev mailing list