diff options
author | Saeed Mahameed <saeedm@mellanox.com> | 2020-02-21 21:45:58 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-02-21 15:41:10 -0800 |
commit | 4ae575661f98915410a90e11a27b7496e50df8cf (patch) | |
tree | d0023f52ce8af98795c8df28326b609b59d49947 /drivers/net/ethernet/mellanox/mlxfw/mlxfw.h | |
parent | b105e8e281ac2dbea4229982ad57fbefab05963d (diff) |
net/mlxfw: Generic mlx FW flash status notify
FW flash status notify is currently implemented via a callback to the
caller mlx module, and all it is doing is to call
devlink_flash_update_status_notify with the specific module devlink
instance.
Instead of repeating the whole process for all mlx modules and
re-implement the status_notify callback again and again. Just provide the
devlink instance as part of mlxfw_dev when calling mlxfw_firmware_flash
and let mlxfw do the devlink status updates directly.
This will be very useful for adding status notify support to mlx5, as
already done in this patch, with a simple one line of just providing the
devlink instance to mlxfw_firmware_flash.
mlxfw now depends on NET_DEVLINK as all other mlx modules.
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxfw/mlxfw.h')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxfw/mlxfw.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxfw/mlxfw.h b/drivers/net/ethernet/mellanox/mlxfw/mlxfw.h index c50e74ab02c4..cd88fd257501 100644 --- a/drivers/net/ethernet/mellanox/mlxfw/mlxfw.h +++ b/drivers/net/ethernet/mellanox/mlxfw/mlxfw.h @@ -6,6 +6,7 @@ #include <linux/firmware.h> #include <linux/netlink.h> +#include <net/devlink.h> enum mlxfw_fsm_state { MLXFW_FSM_STATE_IDLE, @@ -58,16 +59,13 @@ struct mlxfw_dev_ops { void (*fsm_cancel)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle); void (*fsm_release)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle); - - void (*status_notify)(struct mlxfw_dev *mlxfw_dev, - const char *msg, const char *comp_name, - u32 done_bytes, u32 total_bytes); }; struct mlxfw_dev { const struct mlxfw_dev_ops *ops; const char *psid; u16 psid_size; + struct devlink *devlink; }; #if IS_REACHABLE(CONFIG_MLXFW) |