public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH next v2] batman-adv: Disable __ethtool_get_link_ksettings compat on < 3.2
@ 2016-03-01  7:33 Sven Eckelmann
  2016-03-01  8:07 ` Antonio Quartulli
  2016-03-20 14:02 ` Sven Eckelmann
  0 siblings, 2 replies; 4+ messages in thread
From: Sven Eckelmann @ 2016-03-01  7:33 UTC (permalink / raw)
  To: b.a.t.m.a.n

The __ethtool_get_link_ksettings is currently used only for kernels >=
3.15. But the compat code is read by the compiler for each kernel. But
kernels up to 3.1 never had the function __ethtool_get_settings which is
used to emulate this function for kernels < 4.6. Therefore, kernels < 3.2
will fail to compile when this compatibility layer is enabled.

Fixes: 3515604d82d5 ("batman-adv: ELP - use new ethtool_link_get_ksettings API")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
v2:
 - correct version number of the supported kernel

 compat-include/linux/ethtool.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/compat-include/linux/ethtool.h b/compat-include/linux/ethtool.h
index 87f7577..2e6270e 100644
--- a/compat-include/linux/ethtool.h
+++ b/compat-include/linux/ethtool.h
@@ -24,7 +24,9 @@
 #include <linux/version.h>
 #include_next <linux/ethtool.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
+/* WARNING only enabled on kernels with __ethtool_get_settings support */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
 
 #define ethtool_link_ksettings batadv_ethtool_link_ksettings
 
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH next v2] batman-adv: Disable __ethtool_get_link_ksettings compat on < 3.2
  2016-03-01  7:33 [B.A.T.M.A.N.] [PATCH next v2] batman-adv: Disable __ethtool_get_link_ksettings compat on < 3.2 Sven Eckelmann
@ 2016-03-01  8:07 ` Antonio Quartulli
  2016-03-01  8:30   ` Sven Eckelmann
  2016-03-20 14:02 ` Sven Eckelmann
  1 sibling, 1 reply; 4+ messages in thread
From: Antonio Quartulli @ 2016-03-01  8:07 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

[-- Attachment #1: Type: text/plain, Size: 1382 bytes --]

On Tue, Mar 01, 2016 at 08:33:37AM +0100, Sven Eckelmann wrote:
> The __ethtool_get_link_ksettings is currently used only for kernels >=
> 3.15. But the compat code is read by the compiler for each kernel. But
> kernels up to 3.1 never had the function __ethtool_get_settings which is
> used to emulate this function for kernels < 4.6. Therefore, kernels < 3.2
> will fail to compile when this compatibility layer is enabled.
> 
> Fixes: 3515604d82d5 ("batman-adv: ELP - use new ethtool_link_get_ksettings API")
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> v2:
>  - correct version number of the supported kernel
> 
>  compat-include/linux/ethtool.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/compat-include/linux/ethtool.h b/compat-include/linux/ethtool.h
> index 87f7577..2e6270e 100644
> --- a/compat-include/linux/ethtool.h
> +++ b/compat-include/linux/ethtool.h
> @@ -24,7 +24,9 @@
>  #include <linux/version.h>
>  #include_next <linux/ethtool.h>
>  
> -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
> +/* WARNING only enabled on kernels with __ethtool_get_settings support */
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) && \
> +    LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)

Sven,

does it mean that on <3.2 batman v won't compile at all ?


Cheers,

-- 
Antonio Quartulli

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH next v2] batman-adv: Disable __ethtool_get_link_ksettings compat on < 3.2
  2016-03-01  8:07 ` Antonio Quartulli
@ 2016-03-01  8:30   ` Sven Eckelmann
  0 siblings, 0 replies; 4+ messages in thread
From: Sven Eckelmann @ 2016-03-01  8:30 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

On Tuesday 01 March 2016 16:07:08 Antonio Quartulli wrote:
[...]
> does it mean that on <3.2 batman v won't compile at all ?

Ehrm, it doesn't even work on < 3.15. And afaik it never compiled on < 3.2

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH next v2] batman-adv: Disable __ethtool_get_link_ksettings compat on < 3.2
  2016-03-01  7:33 [B.A.T.M.A.N.] [PATCH next v2] batman-adv: Disable __ethtool_get_link_ksettings compat on < 3.2 Sven Eckelmann
  2016-03-01  8:07 ` Antonio Quartulli
@ 2016-03-20 14:02 ` Sven Eckelmann
  1 sibling, 0 replies; 4+ messages in thread
From: Sven Eckelmann @ 2016-03-20 14:02 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 759 bytes --]

On Tuesday 01 March 2016 08:33:37 Sven Eckelmann wrote:
> The __ethtool_get_link_ksettings is currently used only for kernels >=
> 3.15. But the compat code is read by the compiler for each kernel. But
> kernels up to 3.1 never had the function __ethtool_get_settings which is
> used to emulate this function for kernels < 4.6. Therefore, kernels < 3.2
> will fail to compile when this compatibility layer is enabled.
> 
> Fixes: 3515604d82d5 ("batman-adv: ELP - use new ethtool_link_get_ksettings
> API") Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> v2:
>  - correct version number of the supported kernel

This patch rejected in favor of the compat(-include) cleanup [1].

Kind regards,
	Sven

[1] https://patchwork.open-mesh.org/patch/15942/

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-20 14:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01  7:33 [B.A.T.M.A.N.] [PATCH next v2] batman-adv: Disable __ethtool_get_link_ksettings compat on < 3.2 Sven Eckelmann
2016-03-01  8:07 ` Antonio Quartulli
2016-03-01  8:30   ` Sven Eckelmann
2016-03-20 14:02 ` Sven Eckelmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox