ice: Remove and replace ice speed defines with ethtool.h versions
authorBrett Creeley <brett.creeley@intel.com>
Mon, 31 Oct 2022 17:09:12 +0000 (10:09 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 23 Nov 2022 16:59:42 +0000 (08:59 -0800)
commit1d0e28a9be1fa02309b16dd68db31b4c8e716912
tree8169a3b7f1e494e0bc1cdc64d3443e4d20d640b6
parenta711a3288cc69af93148db343d3bfaf5a177a6b0
ice: Remove and replace ice speed defines with ethtool.h versions

The driver is currently using ICE_LINK_SPEED_* defines that mirror what
ethtool.h defines, with one exception ICE_LINK_SPEED_UNKNOWN.

This issue is fixed by the following changes:

1. replace ICE_LINK_SPEED_UNKNOWN with 0 because SPEED_UNKNOWN in
   ethtool.h is "-1" and that doesn't match the driver's expected behavior
2. transform ICE_LINK_SPEED_*MBPS to SPEED_* using static tables and
   fls()-1 to convert from BIT() to an index in a table.

Suggested-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Co-developed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_common.c
drivers/net/ethernet/intel/ice/ice_common.h
drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
drivers/net/ethernet/intel/ice/ice_lib.c
drivers/net/ethernet/intel/ice/ice_vf_mbx.c