~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/firmware.h

Version: ~ [ linux-5.10-rc6 ] ~ [ linux-5.9.12 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.81 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.161 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.210 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.247 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.247 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _LINUX_FIRMWARE_H
  3 #define _LINUX_FIRMWARE_H
  4 
  5 #include <linux/types.h>
  6 #include <linux/compiler.h>
  7 #include <linux/gfp.h>
  8 
  9 #define FW_ACTION_NOHOTPLUG 0
 10 #define FW_ACTION_HOTPLUG 1
 11 
 12 struct firmware {
 13         size_t size;
 14         const u8 *data;
 15         struct page **pages;
 16 
 17         /* firmware loader private fields */
 18         void *priv;
 19 };
 20 
 21 struct module;
 22 struct device;
 23 
 24 struct builtin_fw {
 25         char *name;
 26         void *data;
 27         unsigned long size;
 28 };
 29 
 30 /* We have to play tricks here much like stringify() to get the
 31    __COUNTER__ macro to be expanded as we want it */
 32 #define __fw_concat1(x, y) x##y
 33 #define __fw_concat(x, y) __fw_concat1(x, y)
 34 
 35 #define DECLARE_BUILTIN_FIRMWARE(name, blob)                                 \
 36         DECLARE_BUILTIN_FIRMWARE_SIZE(name, &(blob), sizeof(blob))
 37 
 38 #define DECLARE_BUILTIN_FIRMWARE_SIZE(name, blob, size)                      \
 39         static const struct builtin_fw __fw_concat(__builtin_fw,__COUNTER__) \
 40         __used __section(.builtin_fw) = { name, blob, size }
 41 
 42 #if defined(CONFIG_FW_LOADER) || (defined(CONFIG_FW_LOADER_MODULE) && defined(MODULE))
 43 int request_firmware(const struct firmware **fw, const char *name,
 44                      struct device *device);
 45 int firmware_request_nowarn(const struct firmware **fw, const char *name,
 46                             struct device *device);
 47 int request_firmware_nowait(
 48         struct module *module, bool uevent,
 49         const char *name, struct device *device, gfp_t gfp, void *context,
 50         void (*cont)(const struct firmware *fw, void *context));
 51 int request_firmware_direct(const struct firmware **fw, const char *name,
 52                             struct device *device);
 53 int request_firmware_into_buf(const struct firmware **firmware_p,
 54         const char *name, struct device *device, void *buf, size_t size);
 55 
 56 void release_firmware(const struct firmware *fw);
 57 #else
 58 static inline int request_firmware(const struct firmware **fw,
 59                                    const char *name,
 60                                    struct device *device)
 61 {
 62         return -EINVAL;
 63 }
 64 
 65 static inline int firmware_request_nowarn(const struct firmware **fw,
 66                                           const char *name,
 67                                           struct device *device)
 68 {
 69         return -EINVAL;
 70 }
 71 
 72 static inline int request_firmware_nowait(
 73         struct module *module, bool uevent,
 74         const char *name, struct device *device, gfp_t gfp, void *context,
 75         void (*cont)(const struct firmware *fw, void *context))
 76 {
 77         return -EINVAL;
 78 }
 79 
 80 static inline void release_firmware(const struct firmware *fw)
 81 {
 82 }
 83 
 84 static inline int request_firmware_direct(const struct firmware **fw,
 85                                           const char *name,
 86                                           struct device *device)
 87 {
 88         return -EINVAL;
 89 }
 90 
 91 static inline int request_firmware_into_buf(const struct firmware **firmware_p,
 92         const char *name, struct device *device, void *buf, size_t size)
 93 {
 94         return -EINVAL;
 95 }
 96 
 97 #endif
 98 
 99 int firmware_request_cache(struct device *device, const char *name);
100 
101 #endif
102 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp