ice: Ignore EMODE return for opcode 0x0605
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Thu, 25 Mar 2021 22:35:07 +0000 (15:35 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 8 Apr 2021 00:09:15 +0000 (17:09 -0700)
commitd348d51771b9db562b9b8c88c3ac76953741b906
treeaabe9379bea613903a489fb2fb6f30809f326bcb
parentd6730a871e68f10c786cdee59aebd6f92d49d249
ice: Ignore EMODE return for opcode 0x0605

When link is owned by manageability, the driver is not allowed to fiddle
with link. FW returns ICE_AQ_RC_EMODE if the driver attempts to do so.
This patch adds a new function ice_set_link which abstracts the call to
ice_aq_set_link_restart_an and provides a clean way to turn on/off link.

While making this change, I also spotted that an int variable was being
used to hold both an ice_status return code and the Linux errno return
code. This pattern more often than not results in the driver inadvertently
returning ice_status back to kernel which is a major boo-boo. Clean it up.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_ethtool.c
drivers/net/ethernet/intel/ice/ice_lib.c
drivers/net/ethernet/intel/ice/ice_lib.h
drivers/net/ethernet/intel/ice/ice_main.c