bnxt_en: add infrastructure to lookup ethtool link mode
authorEdwin Peer <edwin.peer@broadcom.com>
Fri, 20 Oct 2023 21:27:52 +0000 (14:27 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 22 Oct 2023 10:41:46 +0000 (11:41 +0100)
commitecdad2a6921417c539e2f414b8b311501dc2dff0
tree190a48c3b9588679eac24c3bda0ff84333c1ae3f
parentfd78ec3fbc470d33c42a312fd22506e3f3704374
bnxt_en: add infrastructure to lookup ethtool link mode

Add infrastructure to look up the enum ethtool_link_mode_bit_indices
from link information provided by the firmware.  The link speed,
signal mode, and media type returned by firmware will be used to
look up the ethtool link mode.

The immediate benefit is that once the link mode is determined, we can
now use ethtool_params_from_link_mode() to fill the basic ethtool
parameters including the number of lanes.  Lanes will be fully
supported in the next patch.

Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.h
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c