Lines Matching refs:mlxfw_dev
42 static void mlxfw_status_notify(struct mlxfw_dev *mlxfw_dev, in mlxfw_status_notify() argument
46 if (!mlxfw_dev->ops->status_notify) in mlxfw_status_notify()
48 mlxfw_dev->ops->status_notify(mlxfw_dev, msg, comp_name, in mlxfw_status_notify()
52 static int mlxfw_fsm_state_wait(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, in mlxfw_fsm_state_wait() argument
63 err = mlxfw_dev->ops->fsm_query_state(mlxfw_dev, fwhandle, in mlxfw_fsm_state_wait()
92 static int mlxfw_flash_component(struct mlxfw_dev *mlxfw_dev, in mlxfw_flash_component() argument
108 err = mlxfw_dev->ops->component_query(mlxfw_dev, comp->index, in mlxfw_flash_component()
126 mlxfw_status_notify(mlxfw_dev, "Updating component", comp_name, 0, 0); in mlxfw_flash_component()
127 err = mlxfw_dev->ops->fsm_component_update(mlxfw_dev, fwhandle, in mlxfw_flash_component()
133 err = mlxfw_fsm_state_wait(mlxfw_dev, fwhandle, in mlxfw_flash_component()
139 mlxfw_status_notify(mlxfw_dev, "Downloading component", in mlxfw_flash_component()
147 err = mlxfw_dev->ops->fsm_block_download(mlxfw_dev, fwhandle, in mlxfw_flash_component()
152 mlxfw_status_notify(mlxfw_dev, "Downloading component", in mlxfw_flash_component()
158 mlxfw_status_notify(mlxfw_dev, "Verifying component", comp_name, 0, 0); in mlxfw_flash_component()
159 err = mlxfw_dev->ops->fsm_component_verify(mlxfw_dev, fwhandle, in mlxfw_flash_component()
164 err = mlxfw_fsm_state_wait(mlxfw_dev, fwhandle, in mlxfw_flash_component()
171 mlxfw_dev->ops->fsm_cancel(mlxfw_dev, fwhandle); in mlxfw_flash_component()
175 static int mlxfw_flash_components(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, in mlxfw_flash_components() argument
183 err = mlxfw_mfa2_file_component_count(mfa2_file, mlxfw_dev->psid, in mlxfw_flash_components()
184 mlxfw_dev->psid_size, in mlxfw_flash_components()
195 comp = mlxfw_mfa2_file_component_get(mfa2_file, mlxfw_dev->psid, in mlxfw_flash_components()
196 mlxfw_dev->psid_size, i); in mlxfw_flash_components()
201 err = mlxfw_flash_component(mlxfw_dev, fwhandle, comp, extack); in mlxfw_flash_components()
209 int mlxfw_firmware_flash(struct mlxfw_dev *mlxfw_dev, in mlxfw_firmware_flash() argument
228 mlxfw_status_notify(mlxfw_dev, "Initializing firmware flash process", in mlxfw_firmware_flash()
230 err = mlxfw_dev->ops->fsm_lock(mlxfw_dev, &fwhandle); in mlxfw_firmware_flash()
237 err = mlxfw_fsm_state_wait(mlxfw_dev, fwhandle, in mlxfw_firmware_flash()
242 err = mlxfw_flash_components(mlxfw_dev, fwhandle, mfa2_file, extack); in mlxfw_firmware_flash()
247 mlxfw_status_notify(mlxfw_dev, "Activating image", NULL, 0, 0); in mlxfw_firmware_flash()
248 err = mlxfw_dev->ops->fsm_activate(mlxfw_dev, fwhandle); in mlxfw_firmware_flash()
255 err = mlxfw_fsm_state_wait(mlxfw_dev, fwhandle, in mlxfw_firmware_flash()
261 mlxfw_dev->ops->fsm_release(mlxfw_dev, fwhandle); in mlxfw_firmware_flash()
264 mlxfw_status_notify(mlxfw_dev, "Firmware flash done", NULL, 0, 0); in mlxfw_firmware_flash()
272 mlxfw_dev->ops->fsm_release(mlxfw_dev, fwhandle); in mlxfw_firmware_flash()