mlxfw_dev
struct mlxfw_dev mlxfw_dev;
static int mlx5_component_query(struct mlxfw_dev *mlxfw_dev,
container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev);
static int mlx5_fsm_lock(struct mlxfw_dev *mlxfw_dev, u32 *fwhandle)
container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev);
static int mlx5_fsm_component_update(struct mlxfw_dev *mlxfw_dev, u32 fwhandle,
container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev);
static int mlx5_fsm_block_download(struct mlxfw_dev *mlxfw_dev, u32 fwhandle,
container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev);
static int mlx5_fsm_component_verify(struct mlxfw_dev *mlxfw_dev, u32 fwhandle,
container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev);
static int mlx5_fsm_activate(struct mlxfw_dev *mlxfw_dev, u32 fwhandle)
container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev);
static int mlx5_fsm_query_state(struct mlxfw_dev *mlxfw_dev, u32 fwhandle,
container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev);
static void mlx5_fsm_cancel(struct mlxfw_dev *mlxfw_dev, u32 fwhandle)
container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev);
static void mlx5_fsm_release(struct mlxfw_dev *mlxfw_dev, u32 fwhandle)
container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev);
.mlxfw_dev = {
return mlxfw_firmware_flash(&mlx5_mlxfw_dev.mlxfw_dev, firmware);
int mlxfw_firmware_flash(struct mlxfw_dev *mlxfw_dev,
struct mlxfw_dev;
int (*component_query)(struct mlxfw_dev *mlxfw_dev, u16 component_index,
int (*fsm_lock)(struct mlxfw_dev *mlxfw_dev, u32 *fwhandle);
int (*fsm_component_update)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle,
int (*fsm_block_download)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle,
int (*fsm_component_verify)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle,
int (*fsm_activate)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle);
int (*fsm_query_state)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle,
void (*fsm_cancel)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle);
void (*fsm_release)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle);
static int mlxfw_flash_component(struct mlxfw_dev *mlxfw_dev,
err = mlxfw_dev->ops->component_query(mlxfw_dev, comp->index,
err = mlxfw_dev->ops->fsm_component_update(mlxfw_dev, fwhandle,
err = mlxfw_fsm_state_wait(mlxfw_dev, fwhandle,
err = mlxfw_dev->ops->fsm_block_download(mlxfw_dev, fwhandle,
err = mlxfw_dev->ops->fsm_component_verify(mlxfw_dev, fwhandle,
err = mlxfw_fsm_state_wait(mlxfw_dev, fwhandle, MLXFW_FSM_STATE_LOCKED);
mlxfw_dev->ops->fsm_cancel(mlxfw_dev, fwhandle);
static int mlxfw_flash_components(struct mlxfw_dev *mlxfw_dev, u32 fwhandle,
err = mlxfw_mfa2_file_component_count(mfa2_file, mlxfw_dev->psid,
mlxfw_dev->psid_size,
comp = mlxfw_mfa2_file_component_get(mfa2_file, mlxfw_dev->psid,
mlxfw_dev->psid_size, i);
err = mlxfw_flash_component(mlxfw_dev, fwhandle, comp);
int mlxfw_firmware_flash(struct mlxfw_dev *mlxfw_dev,
err = mlxfw_dev->ops->fsm_lock(mlxfw_dev, &fwhandle);
err = mlxfw_fsm_state_wait(mlxfw_dev, fwhandle,
err = mlxfw_flash_components(mlxfw_dev, fwhandle, mfa2_file);
err = mlxfw_dev->ops->fsm_activate(mlxfw_dev, fwhandle);
err = mlxfw_fsm_state_wait(mlxfw_dev, fwhandle, MLXFW_FSM_STATE_LOCKED);
mlxfw_dev->ops->fsm_release(mlxfw_dev, fwhandle);
mlxfw_dev->ops->fsm_release(mlxfw_dev, fwhandle);
static int mlxfw_fsm_state_wait(struct mlxfw_dev *mlxfw_dev, u32 fwhandle,
err = mlxfw_dev->ops->fsm_query_state(mlxfw_dev, fwhandle,