opnsense-src/sys/dev
Luigi Rizzo 33d5497079 Cleanup and document the implementation of firmware(9) based on
a version that i posted earlier on the -current mailing list,
and subsequent feedback received.

The core of the change is just in sys/firmware.h and kern/subr_firmware.c,
while other files are just adaptation of the clients to the ABI change
(const-ification of some parameters and hiding of internal info,
so this is fully compatible at the binary level).

In detail:
- reduce the amount of information exported to clients in struct firmware,
  and constify the pointer;

- internally, document and simplify the implementation of the various
  functions, and make sure error conditions are dealt with properly.

The diffs are large, but the code is really straightforward now (i hope).

Note also that there is a subtle issue with the implementation of
firmware_register(): currently, as in the previous version, we just
store a reference to the 'imagename' argument, but we should rather
copy it because there is no guarantee that this is a static string.
I realised this while testing this code, but i prefer to fix it in
a later commit -- there is no regression with respect to the past.

Note, too, that the version in RELENG_6 has various bugs including
missing locks around the module release calls, mishandling of modules
loaded by /boot/loader, and so on, so an MFC is absolutely necessary
there.  I was just postponing it until this cleanup to avoid doing
things twice.

MFC after: 1 week
2007-02-15 17:21:31 +00:00
..
aac The return value of aac_alloc_command() was misinterpreted in aac_ioctl_event(). 2007-02-14 09:10:37 +00:00
acpi_support Prevent freeing wild pointer when bailing out. 2006-11-06 12:14:27 +00:00
acpica Add missing function trace for debug prints. 2007-01-23 07:20:44 +00:00
adlink Use the new bus_space/resource convenience functions. 2005-09-24 20:46:02 +00:00
advansys Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed. 2006-12-11 18:28:31 +00:00
agp Restore agp aperture size after resume, in case it is modified after boot. 2007-01-06 08:31:31 +00:00
aha Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed. 2006-12-11 18:28:31 +00:00
ahb Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed. 2006-12-11 18:28:31 +00:00
aic 2nd and final commit that moves us to CAM_NEW_TRAN_CODE 2006-11-02 00:54:38 +00:00
aic7xxx - Change the PCI-X registers constants to be relative to the PCI-X PCI 2007-01-19 22:37:52 +00:00
amd Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed. 2006-12-11 18:28:31 +00:00
amr Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed. 2006-12-11 18:28:31 +00:00
an Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
ar - Use bus_setup_intr() and bus_teardown_intr() to register device driver 2006-02-22 18:16:26 +00:00
arcmsr Fix spurious I/O errors when under high load. 2007-02-15 15:36:15 +00:00
arl Various bpf(4) related fixes to catch places up to the new bpf(4) 2006-12-29 13:59:50 +00:00
asr Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed. 2006-12-11 18:28:31 +00:00
ata Rearrange the SATA connect logic so that we so that we pickup ATAPI devices. 2007-02-12 17:17:31 +00:00
ath Change the remainder of the drivers for DMA'ing devices enabled in the 2007-01-21 19:32:51 +00:00
atkbdc Synaptics TouchPad seems to go back to Relative Mode after the call 2007-02-04 12:47:52 +00:00
auxio - Only touch the LED bit of the (LED) AUXIO register when turning the 2006-01-26 19:04:18 +00:00
awi In FreeBSD, we don't need sc_power callback 2006-12-12 03:05:04 +00:00
bce Add support for SERDES PHY configurations. These are commonly found in 2007-01-26 17:03:51 +00:00
bfe Add suspend/resume support. Unlike many other NIC drivers, 2006-11-20 23:30:07 +00:00
bge Use bge_writereg_ind() to do global reset as we did before 1.159 for certain 2007-02-14 19:44:15 +00:00
bktr remove delays that have been unnecessary since 2002... The iicbb driver 2006-12-31 19:42:47 +00:00
buslogic Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed. 2006-12-11 18:28:31 +00:00
cardbus Cope gracefully with device_get_children returning an error. 2007-01-19 08:49:28 +00:00
ce Various bpf(4) related fixes to catch places up to the new bpf(4) 2006-12-29 13:59:50 +00:00
ciss o ciss.ko depends on cam and pci. 2006-11-30 15:14:17 +00:00
cm Make cm(4) driver MPSAFE. 2006-06-11 22:25:01 +00:00
cnw Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
cp Various bpf(4) related fixes to catch places up to the new bpf(4) 2006-12-29 13:59:50 +00:00
cpufreq Since DELAY() was moved, most <machine/clock.h> #includes have been 2006-05-16 14:37:58 +00:00
cs - Consistently use if_printf() only in interface methods: if_start(), 2006-09-15 15:16:12 +00:00
ct Since DELAY() was moved, most <machine/clock.h> #includes have been 2006-05-16 14:37:58 +00:00
ctau Various bpf(4) related fixes to catch places up to the new bpf(4) 2006-12-29 13:59:50 +00:00
cx Various bpf(4) related fixes to catch places up to the new bpf(4) 2006-12-29 13:59:50 +00:00
cy Fixed a panic in the probe. The memory resource was accessed after 2007-01-13 11:00:56 +00:00
dc Fix a bug originally introduced in rev. 1.74; don't reloaded the 2006-12-20 01:49:56 +00:00
dcons Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
de - Consistently use if_printf() only in interface methods: if_start(), 2006-09-15 15:16:12 +00:00
digi Fix our ioctl(2) implementation when the argument is "int". New 2006-09-27 19:57:02 +00:00
dpt Wrap the EISA-specific parts of the dpt(4) and si(4) back-ends in 2007-01-18 13:33:36 +00:00
drm Update __FreeBSD_version check for pci_find_extcap() now that it is 2006-12-28 21:55:47 +00:00
ed MFp4: 2006-06-12 04:30:42 +00:00
eisa Make the eisa probe messages just like all the others in the system. 2005-08-01 07:09:15 +00:00
em remove no longer correct comment above em_read_pcie_cap_reg 2006-11-23 05:48:13 +00:00
en Fix fat-fingering in previous commit. 2006-12-29 16:38:22 +00:00
ep ALTQify ep(4). 2006-12-01 20:29:55 +00:00
esp Change the remainder of the drivers for DMA'ing devices enabled in the 2007-01-21 19:32:51 +00:00
ex Remove ifdef notyet SIOCGHWADDR vestige. 2006-02-04 08:16:41 +00:00
exca It turns out that it is easier to not NULL out pccard and cardbus 2007-02-15 07:22:27 +00:00
fatm This driver has been MPSAFE from the beginning so declare the interrupt 2006-03-21 14:56:42 +00:00
fb On sparc64 also use the fillw() this header provides for ia64 so 2007-01-18 13:08:08 +00:00
fdc Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
fe Commit the results of the typo hunt by Darren Pilgrim. 2006-08-04 07:56:35 +00:00
firewire Change the remainder of the drivers for DMA'ing devices enabled in the 2007-01-21 19:32:51 +00:00
flash MFp4: 2006-11-29 08:05:55 +00:00
fxp Change the remainder of the drivers for DMA'ing devices enabled in the 2007-01-21 19:32:51 +00:00
gem - Use the gem_tick() callout instead of if_slowtimo() for driving 2006-12-06 02:04:25 +00:00
harp Stop embedding struct ifnet at the top of driver softcs. Instead the 2005-06-10 16:49:24 +00:00
hatm Replace m_extadd() with macro version MEXTADD(). 2005-09-19 22:04:41 +00:00
hfa Stop embedding struct ifnet at the top of driver softcs. Instead the 2005-06-10 16:49:24 +00:00
hifn Use newly added functions to simplify the code. 2006-06-04 22:17:25 +00:00
hme - Use the hme_tick() callout instead of if_slowtimo() for driving 2006-12-06 02:07:20 +00:00
hptmv - Use a regular mutex rather than a spin mutex. This driver doesn't need 2007-01-04 20:28:17 +00:00
hwpmc Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
ic Fix style nits. No md5 changes in .o's. ;-) 2006-09-08 21:46:01 +00:00
ichsmb Add a device ID for the 631xESB/6321ESB SMBus controller. 2007-01-11 21:13:27 +00:00
ichwd Align the interfaces for the various watchdogs and make the interface 2006-12-15 21:44:49 +00:00
ida Remove bus_{mem,p}io.h and related code for a micro-optimization on i386 2005-05-29 04:42:30 +00:00
idt Capitalize this 2007-01-09 04:26:51 +00:00
ie Since DELAY() was moved, most <machine/clock.h> #includes have been 2006-05-16 14:37:58 +00:00
ieee488 Don't be noisy in case of shared interrupts. 2006-03-11 15:39:22 +00:00
if_ndis Fix shared authentication mode. 2006-12-28 00:05:40 +00:00
iicbus const poison 2006-12-05 06:19:36 +00:00
iir Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed. 2006-12-11 18:28:31 +00:00
io
ipmi Align the interfaces for the various watchdogs and make the interface 2006-12-15 21:44:49 +00:00
ips o Add Adaptec ServeRAID 7x IDs. IDs taken from Linux. 2006-10-05 07:28:43 +00:00
ipw Cleanup and document the implementation of firmware(9) based on 2007-02-15 17:21:31 +00:00
isp Cleanup and document the implementation of firmware(9) based on 2007-02-15 17:21:31 +00:00
ispfw The MODULE_NAME should "ispfw" unless overriden, not "isp". 2006-12-10 03:42:57 +00:00
iwi Cleanup and document the implementation of firmware(9) based on 2007-02-15 17:21:31 +00:00
ixgb Move ethernet VLAN tags from mtags to its own mbuf packet header field 2006-09-17 13:33:30 +00:00
joy Unbreak second joystick (joy1) support. 2005-11-09 20:26:00 +00:00
kbd Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
kbdmux Fix our ioctl(2) implementation when the argument is "int". New 2006-09-27 19:57:02 +00:00
le Remove BUS_DMA_WAITOK from bus_dma_tag_create() invocations as it's 2007-01-20 14:19:29 +00:00
led Add placeholder mutex argument to new_unrhdr(). 2005-03-07 11:05:47 +00:00
lge - Consistently use if_printf() only in interface methods: if_start(), 2006-09-15 15:16:12 +00:00
lmc Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
mc146818 Add macros for the individual divisor bits as some MC146818A-compatible 2007-01-20 14:57:51 +00:00
mca
mcd Remove bus_{mem,p}io.h and related code for a micro-optimization on i386 2005-05-29 04:42:30 +00:00
md Resolve two deadlocks that could be caused by busy md device backed 2006-12-14 11:34:07 +00:00
mem
mfi Remove a PCI ID entry that conflicts with the AMR driver. 2007-01-23 02:47:33 +00:00
mii Fix a typo from the previous commit. 2007-02-14 18:21:32 +00:00
mk48txx Align the interfaces for the various watchdogs and make the interface 2006-12-15 21:44:49 +00:00
mlx Add missing parenthesis around error handling code upon attaching 2005-07-30 15:53:40 +00:00
mly Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed. 2006-12-11 18:28:31 +00:00
mmc Preliminary MMC stack. This stack supports SD 1.0 cards only, but 2006-10-20 06:39:59 +00:00
mpt Catch up to MSI-X API changes. Tested with both MSI and MSI-X. 2007-02-14 22:31:21 +00:00
mse Since DELAY() was moved, most <machine/clock.h> #includes have been 2006-05-16 14:37:58 +00:00
msk Unbreak non-H/W VLAN extraction case. 2007-02-15 06:21:34 +00:00
mxge Cleanup and document the implementation of firmware(9) based on 2007-02-15 17:21:31 +00:00
my Fix fat-fingering in previous commit. 2006-12-29 16:38:22 +00:00
ncv no need to print unload anymore 2006-07-14 04:36:57 +00:00
nfe Fix TX/RX checksum offload. 2006-11-27 04:47:27 +00:00
nge Move ethernet VLAN tags from mtags to its own mbuf packet header field 2006-09-17 13:33:30 +00:00
nmdm Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
nsp Since DELAY() was moved, most <machine/clock.h> #includes have been 2006-05-16 14:37:58 +00:00
null Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
nve Fix an off by one error in struct nve_tx_desc's frags[] array as a result 2006-12-05 15:31:05 +00:00
ofw Add missing includes of priv.h. 2006-11-06 17:43:10 +00:00
patm Commit the results of the typo hunt by Darren Pilgrim. 2006-08-04 07:56:35 +00:00
pbio Since DELAY() was moved, most <machine/clock.h> #includes have been 2006-05-16 14:37:58 +00:00
pccard We need to free the ivars for the child that we just deleted. 2007-02-03 07:09:36 +00:00
pccbb It turns out that it is easier to not NULL out pccard and cardbus 2007-02-15 07:22:27 +00:00
pcf - Use bus_setup_intr() and bus_teardown_intr() to register device driver 2006-02-22 18:16:26 +00:00
pci Adjust the global MSI blacklisting strategy so we don't have to explicitly 2007-02-14 22:36:27 +00:00
pdq Since DELAY() was moved, most <machine/clock.h> #includes have been 2006-05-16 14:37:58 +00:00
powermac_nvram Add device to access and modify Open Firmware NVRAM settings in 2006-08-01 22:19:01 +00:00
ppbus Fix fat-fingering in previous commit. 2006-12-29 16:38:22 +00:00
ppc Remove various bits of conditional Alpha code and fixup a few comments. 2006-05-12 05:04:46 +00:00
pst Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:10:49 +00:00
puc Add SIIG 4 port serial card based on the Oxford OX16PCI954. 2006-09-04 18:27:14 +00:00
ral Remove dependency on deprecated if_watchdog ABI. 2006-12-19 17:37:41 +00:00
random Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
ray tweak comments about OLDCARD workarounds 2006-10-19 05:25:53 +00:00
rc - Use swi_remove() to teardown swi handlers rather than 2005-10-26 15:52:16 +00:00
re The TCP checksum offload handling in the 8111B/8168B and 8101E PCIe can 2007-01-25 17:30:30 +00:00
rndtest
rp - Make rp(4) 64-bit- and endian-clean as well as work on strict alignment 2006-11-20 12:59:27 +00:00
rr232x Make this compile with -Wundef. 2006-05-16 15:23:27 +00:00
safe Use newly added functions to simplify the code. 2006-06-04 22:17:25 +00:00
sbni Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
sbsh Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
scc Fix braino: The cl_range field should not hold the shifted I/O 2006-07-26 03:10:01 +00:00
scd Remove bus_{mem,p}io.h and related code for a micro-optimization on i386 2005-05-29 04:42:30 +00:00
sf Whitespace nits. 2006-09-15 11:01:23 +00:00
si Wrap the EISA-specific parts of the dpt(4) and si(4) back-ends in 2007-01-18 13:33:36 +00:00
sio Only treat positive values as errors... 2006-09-14 03:47:59 +00:00
sk Change the remainder of the drivers for DMA'ing devices enabled in the 2007-01-21 19:32:51 +00:00
smbus Only support the SMB_OLD_BREAD ioctl if one of COMPAT_FREEBSD[456] is 2006-09-26 14:38:56 +00:00
sn Fix mismerge after last cvs update for the IFQ_DRV_DEQUEUE changes. 2006-02-04 08:19:00 +00:00
snc Fix -Wundef warnings from compiling GENERIC and LINT kernels of 2005-12-06 11:19:37 +00:00
snp Restore the ability to detach from a tty via SIOCSTTY and document 2005-09-19 13:48:45 +00:00
sound Fix compilation for statically linked snd_envy24{ht}/spicds. Use explicit 2007-02-14 15:23:44 +00:00
speaker Add /dev/speaker support to amd64. 2005-11-11 09:57:32 +00:00
spibus MFp4: when passing the transfer up the foodchain, make sure we go up 2006-10-20 07:11:52 +00:00
sr - Use bus_setup_intr() and bus_teardown_intr() to register device driver 2006-02-22 18:16:26 +00:00
stg no need to print unload anymore. 2006-07-14 04:35:59 +00:00
stge Change the remainder of the drivers for DMA'ing devices enabled in the 2007-01-21 19:32:51 +00:00
streams Clean up the svr4 socket cache and streams code some to make it more easily 2006-07-21 20:40:13 +00:00
sym Change the remainder of the drivers for DMA'ing devices enabled in the 2007-01-21 19:32:51 +00:00
syscons Correct the VGA_NO_MODE_CHANGE end marker comment. 2007-01-10 19:04:00 +00:00
tdfx Take the functionality contained in the former "options TDFX_LINUX" 2006-03-03 21:37:38 +00:00
ti Change the remainder of the drivers for DMA'ing devices enabled in the 2007-01-21 19:32:51 +00:00
trm Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed. 2006-12-11 18:28:31 +00:00
twa Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed. 2006-12-11 23:59:42 +00:00
twe Normalize a significant number of kernel malloc type names: 2005-10-31 15:41:29 +00:00
tx Since DELAY() was moved, most <machine/clock.h> #includes have been 2006-05-16 14:37:58 +00:00
txp Move ethernet VLAN tags from mtags to its own mbuf packet header field 2006-09-17 13:33:30 +00:00
uart - Add a uart_rxready() and corresponding device-specific implementations 2007-01-18 22:01:19 +00:00
ubsec Switch to using STAILQ_REMOVE_HEAD() instead of STAILQ_REMOVE_HEAD_UNTIL(). 2006-10-24 11:17:46 +00:00
usb Add support for Huawei Technologies Mobile card (3G). 2007-02-09 15:59:28 +00:00
utopia Struct ifatm isn't at the beginning of the softc anymore. Use the 2005-06-22 06:51:52 +00:00
vge Fix the hardware VLAN tagging. TX was broken on little-endian 2006-11-30 21:01:59 +00:00
vkbd Fix our ioctl(2) implementation when the argument is "int". New 2006-09-27 19:57:02 +00:00
vr Whitespace nits. 2006-09-15 11:01:23 +00:00
vx - Store pointer to the link-level address right in "struct ifnet" 2005-11-11 16:04:59 +00:00
watchdog Align the interfaces for the various watchdogs and make the interface 2006-12-15 21:44:49 +00:00
wds Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed. 2006-12-11 18:28:31 +00:00
wi replace if_watchdog w/ a private callout 2006-12-11 00:41:22 +00:00
wl Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
xe o Fix printf(9) formatting: do not use hardcode "0x" and "#" flags 2006-04-15 11:41:40 +00:00
zs Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00