Lines Matching refs:fw_priv

15 void __fw_load_abort(struct fw_priv *fw_priv)  in __fw_load_abort()  argument
21 if (fw_state_is_aborted(fw_priv) || fw_state_is_done(fw_priv)) in __fw_load_abort()
24 fw_state_aborted(fw_priv); in __fw_load_abort()
69 if (add_uevent_var(env, "FIRMWARE=%s", fw_sysfs->fw_priv->fw_name)) in do_firmware_uevent()
85 if (fw_sysfs->fw_priv) in firmware_uevent()
133 if (fw_sysfs->fw_priv) in firmware_loading_show()
134 loading = fw_state_is_loading(fw_sysfs->fw_priv); in firmware_loading_show()
158 struct fw_priv *fw_priv; in firmware_loading_store() local
163 fw_priv = fw_sysfs->fw_priv; in firmware_loading_store()
164 if (fw_state_is_aborted(fw_priv) || fw_state_is_done(fw_priv)) in firmware_loading_store()
170 fw_free_paged_buf(fw_priv); in firmware_loading_store()
171 fw_state_start(fw_priv); in firmware_loading_store()
174 if (fw_state_is_loading(fw_priv)) { in firmware_loading_store()
183 rc = fw_map_paged_buf(fw_priv); in firmware_loading_store()
188 rc = security_kernel_post_load_data(fw_priv->data, in firmware_loading_store()
189 fw_priv->size, in firmware_loading_store()
198 fw_state_aborted(fw_priv); in firmware_loading_store()
201 fw_state_done(fw_priv); in firmware_loading_store()
220 fw_state_init(fw_sysfs->fw_priv); in firmware_loading_store()
231 static void firmware_rw_data(struct fw_priv *fw_priv, char *buffer, in firmware_rw_data() argument
235 memcpy(buffer, fw_priv->data + offset, count); in firmware_rw_data()
237 memcpy(fw_priv->data + offset, buffer, count); in firmware_rw_data()
240 static void firmware_rw(struct fw_priv *fw_priv, char *buffer, in firmware_rw() argument
249 memcpy_from_page(buffer, fw_priv->pages[page_nr], in firmware_rw()
252 memcpy_to_page(fw_priv->pages[page_nr], page_ofs, in firmware_rw()
267 struct fw_priv *fw_priv; in firmware_data_read() local
271 fw_priv = fw_sysfs->fw_priv; in firmware_data_read()
272 if (!fw_priv || fw_state_is_done(fw_priv)) { in firmware_data_read()
276 if (offset > fw_priv->size) { in firmware_data_read()
280 if (count > fw_priv->size - offset) in firmware_data_read()
281 count = fw_priv->size - offset; in firmware_data_read()
285 if (fw_priv->data) in firmware_data_read()
286 firmware_rw_data(fw_priv, buffer, offset, count, true); in firmware_data_read()
288 firmware_rw(fw_priv, buffer, offset, count, true); in firmware_data_read()
299 err = fw_grow_paged_buf(fw_sysfs->fw_priv, in fw_realloc_pages()
324 struct fw_priv *fw_priv; in firmware_data_write() local
331 fw_priv = fw_sysfs->fw_priv; in firmware_data_write()
332 if (!fw_priv || fw_state_is_done(fw_priv)) { in firmware_data_write()
337 if (fw_priv->data) { in firmware_data_write()
338 if (offset + count > fw_priv->allocated_size) { in firmware_data_write()
342 firmware_rw_data(fw_priv, buffer, offset, count, false); in firmware_data_write()
350 firmware_rw(fw_priv, buffer, offset, count, false); in firmware_data_write()
353 fw_priv->size = max_t(size_t, offset + count, fw_priv->size); in firmware_data_write()