Lines Matching refs:fw

100 static bool fw_copy_to_prealloc_buf(struct firmware *fw,  in fw_copy_to_prealloc_buf()  argument
105 if (size < fw->size) in fw_copy_to_prealloc_buf()
107 memcpy(buf, fw->data, fw->size); in fw_copy_to_prealloc_buf()
111 static bool fw_get_builtin_firmware(struct firmware *fw, const char *name, in fw_get_builtin_firmware() argument
118 fw->size = b_fw->size; in fw_get_builtin_firmware()
119 fw->data = b_fw->data; in fw_get_builtin_firmware()
120 return fw_copy_to_prealloc_buf(fw, buf, size); in fw_get_builtin_firmware()
127 static bool fw_is_builtin_firmware(const struct firmware *fw) in fw_is_builtin_firmware() argument
132 if (fw->data == b_fw->data) in fw_is_builtin_firmware()
140 static inline bool fw_get_builtin_firmware(struct firmware *fw, in fw_get_builtin_firmware() argument
147 static inline bool fw_is_builtin_firmware(const struct firmware *fw) in fw_is_builtin_firmware() argument
351 static void firmware_free_data(const struct firmware *fw) in firmware_free_data() argument
354 if (!fw->priv) { in firmware_free_data()
355 vfree(fw->data); in firmware_free_data()
358 free_fw_priv(fw->priv); in firmware_free_data()
362 static void fw_set_page_data(struct fw_priv *fw_priv, struct firmware *fw) in fw_set_page_data() argument
364 fw->priv = fw_priv; in fw_set_page_data()
366 fw->pages = fw_priv->pages; in fw_set_page_data()
368 fw->size = fw_priv->size; in fw_set_page_data()
369 fw->data = fw_priv->data; in fw_set_page_data()
452 int assign_fw(struct firmware *fw, struct device *device, in assign_fw() argument
455 struct fw_priv *fw_priv = fw->priv; in assign_fw()
492 fw_set_page_data(fw_priv, fw); in assign_fw()
553 static void fw_abort_batch_reqs(struct firmware *fw) in fw_abort_batch_reqs() argument
558 if (!fw || !fw->priv) in fw_abort_batch_reqs()
561 fw_priv = fw->priv; in fw_abort_batch_reqs()
574 struct firmware *fw = NULL; in _request_firmware() local
585 ret = _request_firmware_prepare(&fw, name, device, buf, size, in _request_firmware()
590 ret = fw_get_filesystem_firmware(device, fw->priv); in _request_firmware()
596 ret = firmware_fallback_sysfs(fw, name, device, opt_flags, ret); in _request_firmware()
598 ret = assign_fw(fw, device, opt_flags); in _request_firmware()
602 fw_abort_batch_reqs(fw); in _request_firmware()
603 release_firmware(fw); in _request_firmware()
604 fw = NULL; in _request_firmware()
607 *firmware_p = fw; in _request_firmware()
758 void release_firmware(const struct firmware *fw) in release_firmware() argument
760 if (fw) { in release_firmware()
761 if (!fw_is_builtin_firmware(fw)) in release_firmware()
762 firmware_free_data(fw); in release_firmware()
763 kfree(fw); in release_firmware()
775 void (*cont)(const struct firmware *fw, void *context);
782 const struct firmware *fw; in request_firmware_work_func() local
786 _request_firmware(&fw, fw_work->name, fw_work->device, NULL, 0, in request_firmware_work_func()
788 fw_work->cont(fw, fw_work->context); in request_firmware_work_func()
823 void (*cont)(const struct firmware *fw, void *context)) in request_firmware_nowait() argument
882 const struct firmware *fw; in cache_firmware() local
886 ret = request_firmware(&fw, fw_name, NULL); in cache_firmware()
888 kfree(fw); in cache_firmware()
921 struct firmware fw; in uncache_firmware() local
925 if (fw_get_builtin_firmware(&fw, fw_name, NULL, 0)) in uncache_firmware()