1 .\" Copyright (c) 2006 Max Laier <mlaier@FreeBSD.org>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
14 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
17 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 .Nm firmware_register ,
31 .Nm firmware_unregister ,
34 .Nd firmware image loading and management
42 const char *name; /* system-wide name */
43 const void *data; /* location of image */
44 size_t datasize; /* size of image in bytes */
45 unsigned int version; /* version of the image */
46 int refcnt; /* held references */
47 struct firmware *parent; /* not null if a subimage */
48 linker_file_t file; /* loadable module */
53 .Fa "const char *imagename"
54 .Fa "const void *data"
56 .Fa "unsigned int version"
57 .Fa "struct firmware *parent"
60 .Fn firmware_unregister "const char *imagename"
62 .Fn firmware_get "const char *imagename"
64 .Fn firmware_put "struct firmware *fp" "int flags"
66 The firmware abstraction provides a convenient interface for loading firmware
67 images into the kernel.
68 Specially crafted kernel modules are used to hold the firmware images.
72 is used on load of such modules to register contained firmware images.
75 include a name that identifies the image for later requests to the firmware
76 system, a pointer to the actual image, the size of the image and an optional
78 The parent image is used to keep track of references to a given module so that
79 it can be unloaded on last reference.
82 .Fn firmware_unregister
83 removes the firmware image identified by the name from the system if there
84 are no pending references or returns an error otherwise.
88 returns the requested firmware image.
89 If the image is not yet registered with the system
91 tries to load a module with the corresponding name.
92 This involves the linker subsystem and disk access which is why
94 must not be called with any locks (except for Giant).
97 returns a pointer to the image description and increases the reference count
102 is used to drop the reference to a firmware image.
103 The flags argument may be set to
105 to indicate that the caller wishes to unload the corresponding module if the
106 image becomes unreferenced.
110 .Pa /usr/share/examples/kld
112 The firmware system was introduced in
115 This manual page was written by
116 .An Max Laier Aq mlaier@FreeBSD.org .