diff --git a/configure.ac b/configure.ac index 158fae0abf..b90674118c 100644 --- a/configure.ac +++ b/configure.ac @@ -653,6 +653,42 @@ AC_CHECK_DECLS([ethtool_cmd_speed, SIOCETHTOOL], #include <linux/sockios.h> #endif]) +AC_CHECK_MEMBERS([struct ethtool_cmd.speed_hi], + [], [], [AC_INCLUDES_DEFAULT +#ifdef HAVE_LINUX_ETHTOOL_H +#include <linux/ethtool.h> +#endif +#ifdef HAVE_LINUX_SOCKIOS_H +#include <linux/sockios.h> +#endif]) + +AC_CHECK_MEMBERS([struct ethtool_cmd.speed_hi], + [], [], [AC_INCLUDES_DEFAULT +#ifdef HAVE_LINUX_ETHTOOL_H +#include <linux/ethtool.h> +#endif +#ifdef HAVE_LINUX_SOCKIOS_H +#include <linux/sockios.h> +#endif]) + +AC_CHECK_MEMBERS([struct ethtool_cmd.speed_hi], + [], [], [AC_INCLUDES_DEFAULT +#ifdef HAVE_LINUX_ETHTOOL_H +#include <linux/ethtool.h> +#endif +#ifdef HAVE_LINUX_SOCKIOS_H +#include <linux/sockios.h> +#endif]) + +AC_CHECK_MEMBERS([struct ethtool_cmd.speed_hi], + [], [], [AC_INCLUDES_DEFAULT +#ifdef HAVE_LINUX_ETHTOOL_H +#include <linux/ethtool.h> +#endif +#ifdef HAVE_LINUX_SOCKIOS_H +#include <linux/sockios.h> +#endif]) + AC_CHECK_DECLS([AF_UNSPEC, PF_UNSPEC, AF_INET6, PF_INET6], [], [], [AC_INCLUDES_DEFAULT #if HAVE_SYS_SOCKET_H diff --git a/opal/util/ethtool.c b/opal/util/ethtool.c index 91a4a7ed64..ad3358227d 100644 --- a/opal/util/ethtool.c +++ b/opal/util/ethtool.c @@ -1,5 +1,7 @@ /* * Copyright (c) 2016 Karol Mroz. All rights reserved. + * Copyright (c) 2016 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,11 +33,15 @@ #include "opal/util/ethtool.h" #include "opal/util/if.h" -#if !defined(HAVE_DECL_ETHTOOL_CMD_SPEED) +#if ! HAVE_DECL_ETHTOOL_CMD_SPEED static inline unsigned int ethtool_cmd_speed(const struct ethtool_cmd *ep) { +#ifdef HAVE_STRUCT_ETHTOOL_CMD_SPEED_HI return (ep->speed_hi << 16) | ep->speed; +#else + return ep->speed; +#endif } #endif