]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: refactor bnxt_get_fw_speed()
authorEdwin Peer <edwin.peer@broadcom.com>
Sun, 27 Sep 2020 17:42:12 +0000 (13:42 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 27 Sep 2020 20:35:45 +0000 (13:35 -0700)
commit90f858b35ac7211cc3c7a722d2b4043cbbe99fb8
treeceb47b45bfc3db19922060151ae46371fdba674a
parent82f80ad7f775e6a6eb7637f3ed3e695c7582c3bc
bnxt_en: refactor bnxt_get_fw_speed()

It will be necessary to update more than one field in the link_info
structure when PAM4 speeds are added in a later patch. Instead of
merely translating ethtool speed values to firmware speed values,
change the responsiblity of this function to update all the necessary
link_info fields required to force the speed change to the desired
ethtool value. This also reduces code duplication somewhat at the two
call sites, which otherwise both have to independently update link_info
fields to turn off auto negotiation advertisements.

Also use the appropriate REQ_FORCE_LINK_SPEED definitions. These happen
to have the same values, but req_link_speed is utilimately passed as
force_link_speed in HWRM_PORT_PHY_CFG which is not defined in terms of
REQ_AUTO_LINK_SPEED.

Reviewed-by: Scott Branden <scott.branden@broadcom.com>
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_ethtool.c