path: root/sys/sys/firmware.h
diff options
authorIan Dowse <iedowse@FreeBSD.org>2006-06-10 17:04:07 +0000
committerIan Dowse <iedowse@FreeBSD.org>2006-06-10 17:04:07 +0000
commiteb1030c4fd5dbda71009b4345e83c7324a6b8875 (patch)
treeb25106c52f7980c62f687d776341cc8b42829cd4 /sys/sys/firmware.h
parent11cff99d3ee6c24730e843bf7f1de430cfba7042 (diff)
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)
Notes: svn path=/head/; revision=159486
Diffstat (limited to 'sys/sys/firmware.h')
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sys/firmware.h b/sys/sys/firmware.h
index 4d84942b024f..30790b742f3e 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 *);