summaryrefslogtreecommitdiffstats
path: root/sys/sys/firmware.h
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2006-06-10 17:04:07 +0000
committeriedowse <iedowse@FreeBSD.org>2006-06-10 17:04:07 +0000
commitd9a00b27e516acb75c1b35e20afe84fd7de33b06 (patch)
treeb25106c52f7980c62f687d776341cc8b42829cd4 /sys/sys/firmware.h
parentaebc3016ce2414de64f246c41ca19a3b05451229 (diff)
downloadFreeBSD-src-d9a00b27e516acb75c1b35e20afe84fd7de33b06.zip
FreeBSD-src-d9a00b27e516acb75c1b35e20afe84fd7de33b06.tar.gz
Keep firmware images on the list until they have been unregistered
with firmware_unregister(). Previously when the last driver reference had been dropped we would clear the list entry under the assumption that the firmware module was about to be unloaded, but this was not true if the firmware image had been loaded manually with kldload. This makes it possible to manually kldload firmware images as a workaround for drivers such as ipw that attempt to load firmware while resuming after a suspend. Reviewed by: mlaier (an earlier version of the patch)
Diffstat (limited to 'sys/sys/firmware.h')
-rw-r--r--sys/sys/firmware.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sys/firmware.h b/sys/sys/firmware.h
index 4d84942..30790b7 100644
--- a/sys/sys/firmware.h
+++ b/sys/sys/firmware.h
@@ -48,10 +48,14 @@ struct firmware {
size_t datasize; /* size of image in bytes */
unsigned int version; /* version of the image */
int refcnt; /* held references */
+ int flags; /* FIRMWAREFLAG_ flags */
struct firmware *parent; /* not null if a subimage */
linker_file_t file; /* loadable module */
};
+/* "flags" field definitions */
+#define FIRMWAREFLAG_KEEPKLDREF 0x0001 /* don't release KLD reference */
+
struct firmware *firmware_register(const char *, const void *, size_t,
unsigned int, struct firmware *);
int firmware_unregister(const char *);
OpenPOWER on IntegriCloud