aboutsummaryrefslogtreecommitdiff
path: root/drivers/base/firmware_loader/firmware.h
diff options
context:
space:
mode:
authorScott Branden <[email protected]>2020-10-02 10:38:27 -0700
committerGreg Kroah-Hartman <[email protected]>2020-10-05 13:37:04 +0200
commit59cdb23ca2dfef3b93411d1105409dfe9cd1f62f (patch)
treef35af8f3da44a0edaa8b7517707e1b8098933b05 /drivers/base/firmware_loader/firmware.h
parent89287c169f8ff79d466b274da1d5c862e8b29152 (diff)
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 <[email protected]> Co-developed-by: Kees Cook <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/base/firmware_loader/firmware.h')
-rw-r--r--drivers/base/firmware_loader/firmware.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/base/firmware_loader/firmware.h b/drivers/base/firmware_loader/firmware.h
index f86de5d7e0d7..63bd29fdcb9c 100644
--- a/drivers/base/firmware_loader/firmware.h
+++ b/drivers/base/firmware_loader/firmware.h
@@ -32,6 +32,8 @@
* @FW_OPT_FALLBACK_PLATFORM: Enable fallback to device fw copy embedded in
* the platform's main firmware. If both this fallback and the sysfs
* fallback are enabled, then this fallback will be tried first.
+ * @FW_OPT_PARTIAL: Allow partial read of firmware instead of needing to read
+ * entire file.
*/
enum fw_opt {
FW_OPT_UEVENT = BIT(0),
@@ -41,6 +43,7 @@ enum fw_opt {
FW_OPT_NOCACHE = BIT(4),
FW_OPT_NOFALLBACK_SYSFS = BIT(5),
FW_OPT_FALLBACK_PLATFORM = BIT(6),
+ FW_OPT_PARTIAL = BIT(7),
};
enum fw_status {
@@ -68,6 +71,7 @@ struct fw_priv {
void *data;
size_t size;
size_t allocated_size;
+ size_t offset;
u32 opt_flags;
#ifdef CONFIG_FW_LOADER_PAGED_BUF
bool is_paged_buf;