summaryrefslogtreecommitdiff
path: root/include/linux/firmware.h
diff options
context:
space:
mode:
authorScott Branden <scott.branden@broadcom.com>2020-10-02 20:38:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-05 14:37:04 +0300
commit59cdb23ca2dfef3b93411d1105409dfe9cd1f62f (patch)
treef35af8f3da44a0edaa8b7517707e1b8098933b05 /include/linux/firmware.h
parent89287c169f8ff79d466b274da1d5c862e8b29152 (diff)
downloadlinux-59cdb23ca2dfef3b93411d1105409dfe9cd1f62f.tar.xz
firmware: Add request_partial_firmware_into_buf()
Add request_partial_firmware_into_buf() to allow for portions of a firmware file to be read into a buffer. This is needed when large firmware must be loaded in portions from a file on memory constrained systems. Signed-off-by: Scott Branden <scott.branden@broadcom.com> Co-developed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20201002173828.2099543-16-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/firmware.h')
-rw-r--r--include/linux/firmware.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index cb3e2c06ed8a..c15acadc6cf4 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -53,6 +53,9 @@ int request_firmware_direct(const struct firmware **fw, const char *name,
struct device *device);
int request_firmware_into_buf(const struct firmware **firmware_p,
const char *name, struct device *device, void *buf, size_t size);
+int request_partial_firmware_into_buf(const struct firmware **firmware_p,
+ const char *name, struct device *device,
+ void *buf, size_t size, size_t offset);
void release_firmware(const struct firmware *fw);
#else
@@ -102,6 +105,15 @@ static inline int request_firmware_into_buf(const struct firmware **firmware_p,
return -EINVAL;
}
+static inline int request_partial_firmware_into_buf
+ (const struct firmware **firmware_p,
+ const char *name,
+ struct device *device,
+ void *buf, size_t size, size_t offset)
+{
+ return -EINVAL;
+}
+
#endif
int firmware_request_cache(struct device *device, const char *name);