diff options
author | Jiri Pirko | 2019-06-04 15:40:37 +0200 |
---|---|---|
committer | David S. Miller | 2019-06-04 23:21:40 +0200 |
commit | a9d204a644cd9f57a71e6188b7806af0c58b24fc (patch) | |
tree | cf66ff4ba91865cbe95d9a033da27f9f4a8d0563 /drivers/net/ethernet/mellanox/mlxsw/core.c | |
parent | net: stmmac: socfpga: add RMII phy mode (diff) | |
download | kernel-qcow2-linux-a9d204a644cd9f57a71e6188b7806af0c58b24fc.tar.gz kernel-qcow2-linux-a9d204a644cd9f57a71e6188b7806af0c58b24fc.tar.xz kernel-qcow2-linux-a9d204a644cd9f57a71e6188b7806af0c58b24fc.zip |
mlxsw: Move firmware flash implementation to devlink
Benefit from the devlink flash update implementation and ethtool
fallback to it and move firmware flash implementation there.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/core.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/core.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index 182762898361..1c4ef8ed1706 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -1003,6 +1003,20 @@ static int mlxsw_devlink_core_bus_device_reload(struct devlink *devlink, return err; } +static int mlxsw_devlink_flash_update(struct devlink *devlink, + const char *file_name, + const char *component, + struct netlink_ext_ack *extack) +{ + struct mlxsw_core *mlxsw_core = devlink_priv(devlink); + struct mlxsw_driver *mlxsw_driver = mlxsw_core->driver; + + if (!mlxsw_driver->flash_update) + return -EOPNOTSUPP; + return mlxsw_driver->flash_update(mlxsw_core, file_name, + component, extack); +} + static const struct devlink_ops mlxsw_devlink_ops = { .reload = mlxsw_devlink_core_bus_device_reload, .port_type_set = mlxsw_devlink_port_type_set, @@ -1019,6 +1033,7 @@ static const struct devlink_ops mlxsw_devlink_ops = { .sb_occ_port_pool_get = mlxsw_devlink_sb_occ_port_pool_get, .sb_occ_tc_port_bind_get = mlxsw_devlink_sb_occ_tc_port_bind_get, .info_get = mlxsw_devlink_info_get, + .flash_update = mlxsw_devlink_flash_update, }; static int |