• Ivan Vecera's avatar
    i40e: Split and refactor i40e_nvm_version_str() · 7aabde39
    Ivan Vecera authored
    The function formats NVM version string according adapter's
    EETrackID value. If this value OEM specific (0xffffffff) then
    the reported version is with format:
    "<gen>.<snap>.<release>"
    and in other case
    "<nvm_maj>.<nvm_min> <eetrackid> <cvid_maj>.<cvid_bld>.<cvid_min>"
    
    These versions are reported in the subsequent patch in this series
    that implements devlink .info_get but separately.
    
    So split the function into separate ones, refactor it to use them
    and remove ugly static string buffer.
    Additionally convert NVM/OEM version mask macros to use GENMASK and
    use FIELD_GET/FIELD_PREP for them in i40e_nvm_version_str() and
    i40e_get_oem_version(). This makes code more readable and allows
    us to remove related shift macros.
    Signed-off-by: default avatarIvan Vecera <ivecera@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7aabde39
i40e_main.c 463 KB