• Edwin Peer's avatar
    bnxt_en: refactor bnxt_get_fw_speed() · f00530bf
    Edwin Peer authored
    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: default avatarScott Branden <scott.branden@broadcom.com>
    Signed-off-by: default avatarEdwin Peer <edwin.peer@broadcom.com>
    Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f00530bf
bnxt_ethtool.c 101 KB