Subject: Re: NET: Questions about supporting older kernel's with kmods

From: Gregory Haskins <[email-masked]>
Date: Thu, 19 Nov 2009 09:59:18 -0500

Ben Hutchings wrote:
> On Thu, 2009-11-19 at 09:21 -0500, Gregory Haskins wrote:
[...]
> 
>> or should I simply look at the kernel version?
> 
> That works up to a point, but the 'enterprise' distros backport a lot to
> earlier kernel versions which can make version tests invalid.

Good point

> 
> Some out-of-tree/backported drivers use autoconf-style tests, but there
> is no standard way of doing this.
> 

Yeah, this might be the only sane way.  It turns out that my ETHTOOL
issue was trivial.  I was missing "#include <linux/ethtool.h>" which
worked in upstream, but not in older kernels.  So that issue is resolved.

Now I just need to figure out netdev_ops.  Perhaps I will just patch the
netdev_ops out when building a kmod, since its just
a different way to describe the same thing, and the resulting driver
will perform the same.

> [...]
>> Q2) Is it considered "bad form" to include such compile-time directives
>> in the version of the code going upstream?
> [...]
> 
> Yes.  Don't do that.

Ok.

Thanks Ben,
-Greg