Enable conditional use of ETHTOOL features in the NIC driver
The retrieval of the NIC speed, duplex, and autonegotiation
capabilities using the ETHTOOL driver extensions is not supported in
every NIC.
Depending on the driver, the use of the ETHTOOL_GSET command may
result in undesirable messages being printed by the kernel. In order
to avoid these kernel messages a compile time switch is added. By
default the switch disables the use of the ETHTOOL features. Enable
the ETHTOOL feature by adding:
EXTRA_OECONF_append = " --enable-nic-ethtool=yes"
to the phosphor-network bbappend file.
Tested:
Compiled the source without changing the bbappend file. The code
compiled as is, and after code was added that would cause a compile
time failure.
Loaded the code, and performed a Redfish read of the NIC. The
SpeedMbps field was confirmed to be set to 0.
Enabled compiling the code by adding the EXTRA_OECONF entry to the
bbappend file. The code compiled as is, and failed to compile after
adding invalid code to the protected blocks.
Loaded the code, and performed a Redfish read of the NIC. The
SpeedMbps reported the correct link speed.
Change-Id: If03e7d473d439ebb4a01b5d3f45e37ede2a5a84f
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
diff --git a/configure.ac b/configure.ac
index 8870fcd..12d6caa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,6 +113,16 @@
AC_ARG_VAR(SYSTEMD_TARGET, "Target for starting this service")
AS_IF([test "x$SYSTEMD_TARGET" == "x"], [SYSTEMD_TARGET="multi-user.target"])
+AC_ARG_ENABLE([nic_ethtool],
+ [ --enable-nic-ethtool Enable/disable the use of ETHTOOL features in the NIC driver],
+ [case "${enableval}" in
+ yes) nic_ethtool=true ;;
+ no) nic_ethtool=false ;;
+ *) AC_MSG_ERROR([bad value ${nic_ethtool} for --enable-nic-ethtool]) ;;
+ esac],[nic_ethtool=false]
+ )
+AM_CONDITIONAL([FEATURE_NIC_ETHTOOL], [test x$nic_ethtool = xtrue])
+
# Create configured output.
AC_CONFIG_FILES([Makefile test/Makefile])
AC_CONFIG_FILES([xyz.openbmc_project.Network.service])