Lines Matching refs:fw_sysfs
67 static int do_firmware_uevent(const struct fw_sysfs *fw_sysfs, struct kobj_uevent_env *env) in do_firmware_uevent() argument
69 if (add_uevent_var(env, "FIRMWARE=%s", fw_sysfs->fw_priv->fw_name)) in do_firmware_uevent()
73 if (add_uevent_var(env, "ASYNC=%d", fw_sysfs->nowait)) in do_firmware_uevent()
81 const struct fw_sysfs *fw_sysfs = to_fw_sysfs(dev); in firmware_uevent() local
85 if (fw_sysfs->fw_priv) in firmware_uevent()
86 err = do_firmware_uevent(fw_sysfs, env); in firmware_uevent()
94 struct fw_sysfs *fw_sysfs = to_fw_sysfs(dev); in fw_dev_release() local
96 if (fw_sysfs->fw_upload_priv) in fw_dev_release()
97 fw_upload_free(fw_sysfs); in fw_dev_release()
99 kfree(fw_sysfs); in fw_dev_release()
129 struct fw_sysfs *fw_sysfs = to_fw_sysfs(dev); in firmware_loading_show() local
133 if (fw_sysfs->fw_priv) in firmware_loading_show()
134 loading = fw_state_is_loading(fw_sysfs->fw_priv); in firmware_loading_show()
157 struct fw_sysfs *fw_sysfs = to_fw_sysfs(dev); in firmware_loading_store() local
163 fw_priv = fw_sysfs->fw_priv; in firmware_loading_store()
207 rc = fw_upload_start(fw_sysfs); in firmware_loading_store()
218 fw_load_abort(fw_sysfs); in firmware_loading_store()
219 if (fw_sysfs->fw_upload_priv) in firmware_loading_store()
220 fw_state_init(fw_sysfs->fw_priv); in firmware_loading_store()
266 struct fw_sysfs *fw_sysfs = to_fw_sysfs(dev); in firmware_data_read() local
271 fw_priv = fw_sysfs->fw_priv; in firmware_data_read()
295 static int fw_realloc_pages(struct fw_sysfs *fw_sysfs, int min_size) in fw_realloc_pages() argument
299 err = fw_grow_paged_buf(fw_sysfs->fw_priv, in fw_realloc_pages()
302 fw_load_abort(fw_sysfs); in fw_realloc_pages()
323 struct fw_sysfs *fw_sysfs = to_fw_sysfs(dev); in firmware_data_write() local
331 fw_priv = fw_sysfs->fw_priv; in firmware_data_write()
345 retval = fw_realloc_pages(fw_sysfs, offset + count); in firmware_data_write()
395 struct fw_sysfs *
399 struct fw_sysfs *fw_sysfs; in fw_create_instance() local
402 fw_sysfs = kzalloc(sizeof(*fw_sysfs), GFP_KERNEL); in fw_create_instance()
403 if (!fw_sysfs) { in fw_create_instance()
404 fw_sysfs = ERR_PTR(-ENOMEM); in fw_create_instance()
408 fw_sysfs->nowait = !!(opt_flags & FW_OPT_NOWAIT); in fw_create_instance()
409 fw_sysfs->fw = firmware; in fw_create_instance()
410 f_dev = &fw_sysfs->dev; in fw_create_instance()
418 return fw_sysfs; in fw_create_instance()