• Home
  • Raw
  • Download

Lines Matching full:firmware

3  * main.c - Multi purpose firmware loading support
7 * Please see Documentation/driver-api/firmware/ for more information.
25 #include <linux/firmware.h>
42 #include "firmware.h"
46 MODULE_DESCRIPTION("Multi purpose firmware loading support");
57 * Names of firmware images which have been cached successfully
59 * helper can trace which firmware images have been cached
95 /* Builtin firmware support */
102 static bool fw_copy_to_prealloc_buf(struct firmware *fw, in fw_copy_to_prealloc_buf()
113 static bool fw_get_builtin_firmware(struct firmware *fw, const char *name, in fw_get_builtin_firmware()
129 static bool fw_is_builtin_firmware(const struct firmware *fw) in fw_is_builtin_firmware()
140 #else /* Module case - no builtin firmware support */
142 static inline bool fw_get_builtin_firmware(struct firmware *fw, in fw_get_builtin_firmware()
149 static inline bool fw_is_builtin_firmware(const struct firmware *fw) in fw_is_builtin_firmware()
224 /* Returns 1 for batching firmware requests with the same name */
367 * XZ-compressed firmware support
465 /* direct firmware loading support */
469 "/lib/firmware/updates/" UTS_RELEASE,
470 "/lib/firmware/updates",
471 "/lib/firmware/" UTS_RELEASE,
472 "/lib/firmware"
481 MODULE_PARM_DESC(path, "customized firmware image search path with a higher priority than default p…
528 * firmware was not completely loaded. in fw_get_filesystem_firmware()
533 /* load firmware files from the mount namespace of init */ in fw_get_filesystem_firmware()
550 dev_dbg(device, "Loading firmware from %s\n", path); in fw_get_filesystem_firmware()
577 /* firmware holds the ownership of pages */
578 static void firmware_free_data(const struct firmware *fw) in firmware_free_data()
588 /* store the pages buffer info firmware from buf */
589 static void fw_set_page_data(struct fw_priv *fw_priv, struct firmware *fw) in fw_set_page_data()
641 /* add firmware name into devres list */
676 int assign_fw(struct firmware *fw, struct device *device) in assign_fw()
688 * add firmware name into devres list so that we can auto cache in assign_fw()
689 * and uncache firmware for device. in assign_fw()
694 /* don't cache firmware handled without uevent */ in assign_fw()
705 * After caching firmware image is started, let it piggyback in assign_fw()
706 * on request firmware. in assign_fw()
718 /* prepare firmware and firmware_buf structs;
719 * return 0 if a firmware is already assigned, 1 if need to load one,
723 _request_firmware_prepare(struct firmware **firmware_p, const char *name, in _request_firmware_prepare()
727 struct firmware *firmware; in _request_firmware_prepare() local
731 *firmware_p = firmware = kzalloc(sizeof(*firmware), GFP_KERNEL); in _request_firmware_prepare()
732 if (!firmware) { in _request_firmware_prepare()
733 dev_err(device, "%s: kmalloc(struct firmware) failed\n", in _request_firmware_prepare()
738 if (fw_get_builtin_firmware(firmware, name, dbuf, size)) { in _request_firmware_prepare()
748 * of requesting firmware. in _request_firmware_prepare()
750 firmware->priv = fw_priv; in _request_firmware_prepare()
755 fw_set_page_data(fw_priv, firmware); in _request_firmware_prepare()
774 static void fw_abort_batch_reqs(struct firmware *fw) in fw_abort_batch_reqs()
790 * Reject firmware file names with ".." path components.
791 * There are drivers that construct firmware file names from device-supplied
793 * be sent my firmware from ../../../etc/shadow, please".
797 * This intentionally only looks at the firmware name, not at the firmware base
811 _request_firmware(const struct firmware **firmware_p, const char *name, in _request_firmware()
815 struct firmware *fw = NULL; in _request_firmware()
831 "Firmware load for '%s' refused, path contains '..' component\n", in _request_firmware()
843 * We are about to try to access the firmware file. Because we may have been in _request_firmware()
871 "Direct firmware load for %s failed with error %d\n", in _request_firmware()
894 * request_firmware() - send firmware request and wait for it
895 * @firmware_p: pointer to firmware image
896 * @name: name of firmware file
897 * @device: device for which firmware is being loaded
899 * @firmware_p will be used to return a firmware image by the name
904 * @name will be used as $FIRMWARE in the uevent environment and
906 * firmware image for this or any other device.
916 request_firmware(const struct firmware **firmware_p, const char *name, in request_firmware()
932 * @firmware: pointer to firmware image
933 * @name: name of firmware file
934 * @device: device for which firmware is being loaded
939 * failures to find the firmware file with it are still suppressed. It is
943 int firmware_request_nowarn(const struct firmware **firmware, const char *name, in firmware_request_nowarn() argument
950 ret = _request_firmware(firmware, name, device, NULL, 0, 0, in firmware_request_nowarn()
958 * request_firmware_direct() - load firmware directly without usermode helper
959 * @firmware_p: pointer to firmware image
960 * @name: name of firmware file
961 * @device: device for which firmware is being loaded
964 * fall back to usermode helper even if the firmware couldn't be loaded
968 int request_firmware_direct(const struct firmware **firmware_p, in request_firmware_direct()
983 * firmware_request_platform() - request firmware with platform-fw fallback
984 * @firmware: pointer to firmware image
985 * @name: name of firmware file
986 * @device: device for which firmware is being loaded
990 * requested firmware embedded in the platform's main (e.g. UEFI) firmware.
992 int firmware_request_platform(const struct firmware **firmware, in firmware_request_platform() argument
999 ret = _request_firmware(firmware, name, device, NULL, 0, 0, in firmware_request_platform()
1007 * firmware_request_cache() - cache firmware for suspend so resume can use it
1008 * @name: name of firmware file
1009 * @device: device for which firmware should be cached for
1012 * require loading firmware on system reboot. This optimization may still
1013 * require the firmware present on resume from suspend. This routine can be
1014 * used to ensure the firmware is present on resume from suspend in these
1031 * request_firmware_into_buf() - load firmware into a previously allocated buffer
1032 * @firmware_p: pointer to firmware image
1033 * @name: name of firmware file
1034 * @device: device for which firmware is being loaded and DMA region allocated
1035 * @buf: address of buffer to load firmware into
1039 * allocate a buffer to hold the firmware data. Instead, the firmware
1043 * This function doesn't cache firmware either.
1046 request_firmware_into_buf(const struct firmware **firmware_p, const char *name, in request_firmware_into_buf()
1063 * request_partial_firmware_into_buf() - load partial firmware into a previously allocated buffer
1064 * @firmware_p: pointer to firmware image
1065 * @name: name of firmware file
1066 * @device: device for which firmware is being loaded and DMA region allocated
1067 * @buf: address of buffer to load firmware into
1075 request_partial_firmware_into_buf(const struct firmware **firmware_p, in request_partial_firmware_into_buf()
1094 * release_firmware() - release the resource associated with a firmware image
1095 * @fw: firmware resource to release
1097 void release_firmware(const struct firmware *fw) in release_firmware()
1114 void (*cont)(const struct firmware *fw, void *context);
1121 const struct firmware *fw; in request_firmware_work_func()
1137 * @module: module requesting the firmware
1138 * @uevent: sends uevent to copy the firmware image if this flag
1139 * is non-zero else the firmware copy must be done manually.
1140 * @name: name of firmware file
1141 * @device: device for which firmware is being loaded
1144 * @fw may be %NULL if firmware request fails.
1145 * @cont: function will be called asynchronously when the firmware
1153 * requesting firmware in their ->probe() methods, if
1162 void (*cont)(const struct firmware *fw, void *context)) in request_firmware_nowait()
1205 * cache_firmware() - cache one firmware image in kernel memory space
1206 * @fw_name: the firmware image name
1208 * Cache firmware in kernel memory so that drivers can use it when
1209 * system isn't ready for them to request firmware image from userspace.
1211 * nowait version to get the cached firmware without any interacting
1214 * Return 0 if the firmware image has been cached successfully
1221 const struct firmware *fw; in cache_firmware()
1247 * uncache_firmware() - remove one cached firmware image
1248 * @fw_name: the firmware image name
1250 * Uncache one firmware image which has been cached successfully
1253 * Return 0 if the firmware cache has been removed successfully
1260 struct firmware fw; in uncache_firmware()
1385 /* only one cache entry for one firmware */ in dev_cache_fw_image()
1422 * device_cache_fw_images() - cache devices' firmware
1425 * successfully before, the firmware names are recored into the
1429 * time when system is not ready to complete loading firmware.
1448 /* wait for completion of caching firmware for all devices */ in device_cache_fw_images()
1455 * device_uncache_fw_images() - uncache devices' firmware
1517 /* stop caching firmware once syscore_suspend is reached */