summaryrefslogtreecommitdiffstats
path: root/share/man/man9
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2012-04-26 07:52:28 +0000
committergrehan <grehan@FreeBSD.org>2012-04-26 07:52:28 +0000
commit94d2b7f64912987093f1a98573737a32e4e5d8d1 (patch)
tree66e8b09d104ddfb3e858eb44c5eb480e59c57a35 /share/man/man9
parentbd54a55c5a9baae09ba63f311e15c0d30f9ca683 (diff)
parent142e6644f17b2708b0c7ec8b0fcf34854b02f408 (diff)
downloadFreeBSD-src-94d2b7f64912987093f1a98573737a32e4e5d8d1.zip
FreeBSD-src-94d2b7f64912987093f1a98573737a32e4e5d8d1.tar.gz
IFC @ r234692
sys/amd64/include/cpufunc.h sys/amd64/include/fpu.h sys/amd64/amd64/fpu.c sys/amd64/vmm/vmm.c - Add API to allow vmm FPU state init/save/restore. FP stuff discussed with: kib
Diffstat (limited to 'share/man/man9')
-rw-r--r--share/man/man9/BUS_DESCRIBE_INTR.92
-rw-r--r--share/man/man9/BUS_SETUP_INTR.94
-rw-r--r--share/man/man9/DB_COMMAND.915
-rw-r--r--share/man/man9/DEVICE_PROBE.98
-rw-r--r--share/man/man9/DEV_MODULE.94
-rw-r--r--share/man/man9/LOCK_PROFILING.936
-rw-r--r--share/man/man9/MD5.92
-rw-r--r--share/man/man9/Makefile43
-rw-r--r--share/man/man9/SYSINIT.92
-rw-r--r--share/man/man9/bios.94
-rw-r--r--share/man/man9/buf_ring.9144
-rw-r--r--share/man/man9/bus_dma.92
-rw-r--r--share/man/man9/bus_space.9128
-rw-r--r--share/man/man9/byteorder.92
-rw-r--r--share/man/man9/condvar.94
-rw-r--r--share/man/man9/contigmalloc.92
-rw-r--r--share/man/man9/crypto.928
-rw-r--r--share/man/man9/devclass_get_maxunit.92
-rw-r--r--share/man/man9/device_get_children.94
-rw-r--r--share/man/man9/device_set_flags.94
-rw-r--r--share/man/man9/devstat.94
-rw-r--r--share/man/man9/devtoname.915
-rw-r--r--share/man/man9/domain.912
-rw-r--r--share/man/man9/drbr.9147
-rw-r--r--share/man/man9/eventtimers.94
-rw-r--r--share/man/man9/fail.91
-rw-r--r--share/man/man9/firmware.92
-rw-r--r--share/man/man9/get_cyclecount.92
-rw-r--r--share/man/man9/ieee80211.920
-rw-r--r--share/man/man9/ieee80211_amrr.96
-rw-r--r--share/man/man9/ieee80211_bmiss.94
-rw-r--r--share/man/man9/ieee80211_crypto.96
-rw-r--r--share/man/man9/ieee80211_input.92
-rw-r--r--share/man/man9/ieee80211_node.912
-rw-r--r--share/man/man9/ieee80211_output.98
-rw-r--r--share/man/man9/ieee80211_proto.912
-rw-r--r--share/man/man9/ieee80211_radiotap.94
-rw-r--r--share/man/man9/ieee80211_regdomain.94
-rw-r--r--share/man/man9/ieee80211_scan.92
-rw-r--r--share/man/man9/ieee80211_vap.94
-rw-r--r--share/man/man9/ifnet.9443
-rw-r--r--share/man/man9/kproc.96
-rw-r--r--share/man/man9/kqueue.925
-rw-r--r--share/man/man9/kthread.98
-rw-r--r--share/man/man9/lock.93
-rw-r--r--share/man/man9/locking.923
-rw-r--r--share/man/man9/make_dev.91
-rw-r--r--share/man/man9/malloc.95
-rw-r--r--share/man/man9/mbchain.910
-rw-r--r--share/man/man9/mbuf_tags.910
-rw-r--r--share/man/man9/mdchain.918
-rw-r--r--share/man/man9/mi_switch.92
-rw-r--r--share/man/man9/namei.913
-rw-r--r--share/man/man9/netisr.92
-rw-r--r--share/man/man9/osd.92
-rw-r--r--share/man/man9/pci.9579
-rw-r--r--share/man/man9/physio.94
-rw-r--r--share/man/man9/random.92
-rw-r--r--share/man/man9/rijndael.920
-rw-r--r--share/man/man9/rmlock.910
-rw-r--r--share/man/man9/shm_map.92
-rw-r--r--share/man/man9/sleep.94
-rw-r--r--share/man/man9/spl.94
-rw-r--r--share/man/man9/swi.984
-rw-r--r--share/man/man9/sysctl.94
-rw-r--r--share/man/man9/sysctl_ctx_init.92
-rw-r--r--share/man/man9/taskqueue.98
-rw-r--r--share/man/man9/timeout.94
-rw-r--r--share/man/man9/uio.94
-rw-r--r--share/man/man9/usbdi.918
-rw-r--r--share/man/man9/vcount.96
-rw-r--r--share/man/man9/vm_map_find.92
-rw-r--r--share/man/man9/vm_page_alloc.929
-rw-r--r--share/man/man9/vnode.94
-rw-r--r--share/man/man9/watchdog.92
-rw-r--r--share/man/man9/zone.96
76 files changed, 1493 insertions, 587 deletions
diff --git a/share/man/man9/BUS_DESCRIBE_INTR.9 b/share/man/man9/BUS_DESCRIBE_INTR.9
index 0163e70..b7f137b 100644
--- a/share/man/man9/BUS_DESCRIBE_INTR.9
+++ b/share/man/man9/BUS_DESCRIBE_INTR.9
@@ -45,7 +45,7 @@
.Ft int
.Fo bus_describe_intr
.Fa "device_t dev" "struct resource *irq" "void *cookie" "const char *fmt"
-.Fa ...
+.Fa ...
.Fc
.Sh DESCRIPTION
The
diff --git a/share/man/man9/BUS_SETUP_INTR.9 b/share/man/man9/BUS_SETUP_INTR.9
index 3910570..8264a99 100644
--- a/share/man/man9/BUS_SETUP_INTR.9
+++ b/share/man/man9/BUS_SETUP_INTR.9
@@ -130,8 +130,8 @@ Mutexes are not allowed to be held across calls to these functions.
A filter runs in primary interrupt context.
In this context, normal mutexes cannot be used.
Only the spin lock version of these can be used (specified by passing
-.Dv MTX_SPIN
-to
+.Dv MTX_SPIN
+to
.Fn mtx_init
when initializing the mutex).
.Xr wakeup 9
diff --git a/share/man/man9/DB_COMMAND.9 b/share/man/man9/DB_COMMAND.9
index 44fe32b..d452057 100644
--- a/share/man/man9/DB_COMMAND.9
+++ b/share/man/man9/DB_COMMAND.9
@@ -38,19 +38,18 @@
.Fo DB_COMMAND
.Fa command_name
.Fa command_function
-.Fc
-.Fn DB_SHOW_COMMAND "command_name" "command_function"
-.Fn DB_SHOW_ALL_COMMAND "command_name" "command_function"
+.Fc
+.Fn DB_SHOW_COMMAND "command_name" "command_function"
+.Fn DB_SHOW_ALL_COMMAND "command_name" "command_function"
.Sh DESCRIPTION
-.Pp
The
.Fn DB_COMMAND
macro adds
.Fa command_name
to the list of top-level commands.
-Invoking
+Invoking
.Fa command_name
-from ddb will call
+from ddb will call
.Fa command_function .
.Pp
The
@@ -61,14 +60,14 @@ are roughly equivalent to
.Fn DB_COMMAND
but in these cases,
.Fa command_name
-is a sub-command of the ddb
+is a sub-command of the ddb
.Sy show
command and
.Sy show all
command, respectively.
.Pp
The general command syntax:
-.Cm command Ns Op Li \&/ Ns Ar modifier
+.Cm command Ns Op Li \&/ Ns Ar modifier
.Ar address Ns Op Li , Ns Ar count ,
translates into the following parameters for
.Fa command_function :
diff --git a/share/man/man9/DEVICE_PROBE.9 b/share/man/man9/DEVICE_PROBE.9
index bf592c5..86b8339 100644
--- a/share/man/man9/DEVICE_PROBE.9
+++ b/share/man/man9/DEVICE_PROBE.9
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 3, 2008
+.Dd February 8, 2012
.Dt DEVICE_PROBE 9
.Os
.Sh NAME
@@ -96,7 +96,7 @@ all the rules, or special needs drivers).
.It BUS_PROBE_VENDOR
The device is supported by a vendor driver.
This is for source or binary drivers that are not yet integrated into the
-.Fx
+.Fx
tree.
Its use in the base OS is prohibited.
.It BUS_PROBE_DEFAULT
@@ -119,8 +119,8 @@ drivers matching particular types of serial ports that need special
treatment for some reason.
.It BUS_PROBE_HOOVER
The driver matches all unclaimed devices on a bus.
-The
-.Xr ugen 5
+The
+.Xr ugen 4
device is one example.
.It BUS_PROBE_NOWILDCARD
The driver expects its parent to tell it which children to manage
diff --git a/share/man/man9/DEV_MODULE.9 b/share/man/man9/DEV_MODULE.9
index 13a81c1..28465b3 100644
--- a/share/man/man9/DEV_MODULE.9
+++ b/share/man/man9/DEV_MODULE.9
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 11, 2001
+.Dd January 19, 2012
.Dt DEV_MODULE 9
.Os
.Sh NAME
@@ -68,7 +68,7 @@ on load and to destroy it when it is unloaded using
static struct cdevsw foo_devsw = { ... };
-static dev_t sdev;
+static struct cdev *sdev;
static int
foo_load(module_t mod, int cmd, void *arg)
diff --git a/share/man/man9/LOCK_PROFILING.9 b/share/man/man9/LOCK_PROFILING.9
index 94b2246..d64b328 100644
--- a/share/man/man9/LOCK_PROFILING.9
+++ b/share/man/man9/LOCK_PROFILING.9
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 11, 2006
+.Dd March 7, 2012
.Dt LOCK_PROFILING 9
.Os
.Sh NAME
@@ -82,32 +82,6 @@ Enable or disable the lock profiling code.
This defaults to 0 (off).
.It Va debug.lock.prof.reset
Reset the current lock profiling buffers.
-.It Va debug.lock.prof.acquisitions
-The total number of lock acquisitions recorded.
-.It Va debug.lock.prof.records
-The total number of acquisition points recorded.
-Note that only active acquisition points (i.e., points that have been
-reached at least once) are counted.
-.It Va debug.lock.prof.maxrecords
-The maximum number of acquisition points the profiling code is capable
-of monitoring.
-Since it would not be possible to call
-.Xr malloc 9
-from within the lock profiling code, this is a static limit.
-The number of records can be changed with the
-.Dv LPROF_BUFFERS
-kernel option.
-.It Va debug.lock.prof.rejected
-The number of acquisition points that were ignored after the table
-filled up.
-.It Va debug.lock.prof.hashsize
-The size of the hash table used to map acquisition points to
-statistics records.
-The hash size can be changed with the
-.Dv LPROF_HASH_SIZE
-kernel option.
-.It Va debug.lock.prof.collisions
-The number of hash collisions in the acquisition point hash table.
.It Va debug.lock.prof.stats
The actual profiling statistics in plain text.
The columns are as follows, from left to right:
@@ -138,6 +112,14 @@ reached.
The name of the acquisition point, derived from the source file name
and line number, followed by the name of the lock in parentheses.
.El
+.It Va debug.lock.prof.rejected
+The number of acquisition points that were ignored after the table
+filled up.
+.It Va debug.lock.prof.skipspin
+Disable or enable the lock profiling code for the spin locks.
+This defaults to 0 (do profiling for the spin locks).
+.It Va debug.lock.prof.skipcount
+Do sampling approximately every N lock acquisitions.
.El
.Sh SEE ALSO
.Xr sysctl 8 ,
diff --git a/share/man/man9/MD5.9 b/share/man/man9/MD5.9
index b2d257f..1b9fcd2 100644
--- a/share/man/man9/MD5.9
+++ b/share/man/man9/MD5.9
@@ -44,7 +44,7 @@
.Ft void
.Fn MD5Init "MD5_CTX *buf"
.Ft void
-.Fn MD5Transform "u_int32_t buf[4]" "const unsigned char block[64]"
+.Fn MD5Transform "uint32_t buf[4]" "const unsigned char block[64]"
.Sh DESCRIPTION
The
.Nm
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 7d2af8a..06b0e33 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -12,6 +12,7 @@ MAN= accept_filter.9 \
boot.9 \
bpf.9 \
buf.9 \
+ buf_ring.9 \
BUF_ISLOCKED.9 \
BUF_LOCK.9 \
BUF_LOCKFREE.9 \
@@ -99,6 +100,7 @@ MAN= accept_filter.9 \
devtoname.9 \
disk.9 \
domain.9 \
+ drbr.9 \
driver.9 \
DRIVER_MODULE.9 \
EVENTHANDLER.9 \
@@ -410,6 +412,16 @@ MLINKS+=bpf.9 bpfattach.9 \
bpf.9 bpf_tap.9 \
bpf.9 bpf_validate.9
MLINKS+=buf.9 bp.9
+MLINKS+=buf_ring.9 buf_ring_alloc.9 \
+ buf_ring.9 buf_ring_free.9 \
+ buf_ring.9 buf_ring_enqueue.9 \
+ buf_ring.9 buf_ring_enqueue_bytes.9 \
+ buf_ring.9 buf_ring_dequeue_mc.9 \
+ buf_ring.9 buf_ring_dequeue_sc.9 \
+ buf_ring.9 buf_ring_count.9 \
+ buf_ring.9 buf_ring_empty.9 \
+ buf_ring.9 buf_ring_full.9 \
+ buf_ring.9 buf_ring_peek.9
MLINKS+=bus_activate_resource.9 bus_deactivate_resource.9
MLINKS+=bus_alloc_resource.9 bus_alloc_resource_any.9
MLINKS+=BUS_BIND_INTR.9 bus_bind_intr.9
@@ -603,11 +615,19 @@ MLINKS+=disk.9 disk_alloc.9 \
disk.9 disk_destroy.9 \
disk.9 disk_gone.9
MLINKS+=domain.9 DOMAIN_SET.9 \
- domain.9 net_add_domain.9 \
+ domain.9 domain_add.9 \
domain.9 pfctlinput.9 \
domain.9 pfctlinput2.9 \
domain.9 pffindproto.9 \
domain.9 pffindtype.9
+MLINKS+=drbr.9 drbr_free.9 \
+ drbr.9 drbr_enqueue.9 \
+ drbr.9 drbr_dequeue.9 \
+ drbr.9 drbr_dequeue_cond.9 \
+ drbr.9 drbr_flush.9 \
+ drbr.9 drbr_empty.9 \
+ drbr.9 drbr_inuse.9 \
+ drbr.9 drbr_stats_update.9
MLINKS+=EVENTHANDLER.9 EVENTHANDLER_DECLARE.9 \
EVENTHANDLER.9 EVENTHANDLER_DEREGISTER.9 \
EVENTHANDLER.9 eventhandler_deregister.9 \
@@ -753,6 +773,8 @@ MLINKS+=kqueue.9 knlist_add.9 \
kqueue.9 knlist_destroy.9 \
kqueue.9 knlist_empty.9 \
kqueue.9 knlist_init.9 \
+ kqueue.9 knlist_init_mtx.9 \
+ kqueue.9 knlist_init_rw_reader.9 \
kqueue.9 knlist_remove.9 \
kqueue.9 knlist_remove_inevent.9 \
kqueue.9 knote_fdclose.9 \
@@ -951,16 +973,32 @@ MLINKS+=namei.9 NDFREE.9 \
MLINKS+=pbuf.9 getpbuf.9 \
pbuf.9 relpbuf.9 \
pbuf.9 trypbuf.9
-MLINKS+=pci.9 pci_disable_busmaster.9 \
+MLINKS+=pci.9 pci_alloc_msi.9 \
+ pci.9 pci_alloc_msix.9 \
+ pci.9 pci_disable_busmaster.9 \
pci.9 pci_disable_io.9 \
pci.9 pci_enable_busmaster.9 \
pci.9 pci_enable_io.9 \
pci.9 pci_find_bsf.9 \
+ pci.9 pci_find_cap.9 \
pci.9 pci_find_dbsf.9 \
pci.9 pci_find_device.9 \
+ pci.9 pci_find_extcap.9 \
+ pci.9 pci_find_htcap.9 \
+ pci.9 pci_get_max_read_req.9 \
pci.9 pci_get_powerstate.9 \
+ pci.9 pci_get_vpd_ident.9 \
+ pci.9 pci_get_vpd_readonly.9 \
+ pci.9 pci_msi_count.9 \
+ pci.9 pci_msix_count.9 \
+ pci.9 pci_pending_msix.9 \
pci.9 pci_read_config.9 \
+ pci.9 pci_release_msi.9 \
+ pci.9 pci_remap_msix.9 \
+ pci.9 pci_restore_state.9 \
+ pci.9 pci_save_state.9 \
pci.9 pci_set_powerstate.9 \
+ pci.9 pci_set_max_read_req.9 \
pci.9 pci_write_config.9
MLINKS+=pfil.9 pfil_add_hook.9 \
pfil.9 pfil_hook_get.9 \
@@ -1212,6 +1250,7 @@ MLINKS+=store.9 subyte.9 \
store.9 suword32.9 \
store.9 suword64.9
MLINKS+=swi.9 swi_add.9 \
+ swi.9 swi_remove.9 \
swi.9 swi_sched.9
MLINKS+=sx.9 sx_assert.9 \
sx.9 sx_destroy.9 \
diff --git a/share/man/man9/SYSINIT.9 b/share/man/man9/SYSINIT.9
index 9140dd8..1837d25 100644
--- a/share/man/man9/SYSINIT.9
+++ b/share/man/man9/SYSINIT.9
@@ -29,7 +29,7 @@
.Os
.Sh NAME
.Nm SYSINIT ,
-.Nm SYSUNINIT
+.Nm SYSUNINIT
.Nd a framework for dynamic kernel initialization
.Sh SYNOPSIS
.In sys/param.h
diff --git a/share/man/man9/bios.9 b/share/man/man9/bios.9
index 0621b72..48bbe16 100644
--- a/share/man/man9/bios.9
+++ b/share/man/man9/bios.9
@@ -40,8 +40,8 @@
.In machine/param.h
.In machine/pmap.h
.In machine/pc/bios.h
-.Ft u_int32_t
-.Fn bios_sigsearch "u_int32_t start" "u_char *sig" "int siglen" "int paralen" "int sigofs"
+.Ft uint32_t
+.Fn bios_sigsearch "uint32_t start" "u_char *sig" "int siglen" "int paralen" "int sigofs"
.Ft int
.Fn bios32_SDlookup "struct bios32_SDentry *ent"
.Ft int
diff --git a/share/man/man9/buf_ring.9 b/share/man/man9/buf_ring.9
new file mode 100644
index 0000000..ffade94
--- /dev/null
+++ b/share/man/man9/buf_ring.9
@@ -0,0 +1,144 @@
+.\" Copyright (c) 2009 Bitgravity Inc
+.\" Written by: Kip Macy <kmacy@FreeBSD.org>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd January 30, 2012
+.Dt BUF_RING 9
+.Os
+.Sh NAME
+.Nm buf_ring ,
+.Nm buf_ring_alloc ,
+.Nm buf_ring_free ,
+.Nm buf_ring_enqueue ,
+.Nm buf_ring_enqueue_bytes ,
+.Nm buf_ring_dequeue_mc ,
+.Nm buf_ring_dequeue_sc ,
+.Nm buf_ring_count ,
+.Nm buf_ring_empty ,
+.Nm buf_ring_full ,
+.Nm buf_ring_peek ,
+.Nd multi-producer, {single, multi}-consumer lock-less ring buffer
+.Sh SYNOPSIS
+.In sys/param.h
+.In sys/buf_ring.h
+.Ft struct buf_ring *
+.Fn buf_ring_alloc "int count" "struct malloc_type *type" "int flags" "struct mtx *sc_lock"
+.Ft void
+.Fn buf_ring_free "struct buf_ring *br" "struct malloc_type *type"
+.Ft int
+.Fn buf_ring_enqueue "struct buf_ring *br" "void *buf"
+.Ft int
+.Fn buf_ring_enqueue_bytes "struct buf_ring *br" "void *buf" "int bytes"
+.Ft void *
+.Fn buf_ring_dequeue_mc "struct buf_ring *br"
+.Ft void *
+.Fn buf_ring_dequeue_sc "struct buf_ring *br"
+.Ft int
+.Fn buf_ring_count "struct buf_ring *br"
+.Ft int
+.Fn buf_ring_empty "struct buf_ring *br"
+.Ft int
+.Fn buf_ring_full "struct buf_ring *br"
+.Ft void *
+.Fn buf_ring_peek "struct buf_ring *br"
+.Sh DESCRIPTION
+The
+.Nm
+functions provide a lock-less multi-producer and lock-less multi-consumer as
+well as single-consumer ring buffer.
+.Pp
+The
+.Fn buf_ring_alloc
+function is used to allocate a buf_ring ring buffer with
+.Fa count
+slots using malloc_type
+.Fa type
+and memory flags
+.Fa flags .
+The single consumer interface is protected by
+.Fa sc_lock .
+.Pp
+The
+.Fn buf_ring_free
+function is used to free a buf_ring.
+The user is responsible for freeing any enqueued items.
+.Pp
+The
+.Fn buf_ring_enqueue
+function is used to enqueue a buffer to a buf_ring.
+.Pp
+The
+.Fn buf_ring_enqueue_bytes
+function is used to enqueue a buffer to a buf_ring and increment the
+number of bytes enqueued by
+.Fa bytes .
+.Pp
+The
+.Fn buf_ring_dequeue_mc
+function is a multi-consumer safe way of dequeueing elements from a buf_ring.
+.Pp
+The
+.Fn buf_ring_dequeue_sc
+function is a single-consumer interface to dequeue elements - requiring
+the user to serialize accesses with a lock.
+.Pp
+The
+.Fn buf_ring_count
+function returns the number of elements in a buf_ring.
+.Pp
+The
+.Fn buf_ring_empty
+function returns
+.Dv TRUE
+if the buf_ring is empty,
+.Dv FALSE
+otherwise.
+.Pp
+The
+.Fn buf_ring_full
+function returns
+.Dv TRUE
+if no more items can be enqueued,
+.Dv FALSE
+otherwise.
+.Pp
+The
+.Fn buf_ring_peek
+function returns a pointer to the last element in the buf_ring if the
+buf_ring is not empty,
+.Dv NULL
+otherwise.
+.Sh RETURN VALUES
+The
+.Fn buf_ring_enqueue
+and
+.Fn buf_ring_enqueue_bytes
+functions return
+.Er ENOBUFS
+if there are no available slots in the buf_ring.
+.Sh HISTORY
+These functions were introduced in
+.Fx 8.0 .
diff --git a/share/man/man9/bus_dma.9 b/share/man/man9/bus_dma.9
index 7886b14..3b5ca78 100644
--- a/share/man/man9/bus_dma.9
+++ b/share/man/man9/bus_dma.9
@@ -82,7 +82,7 @@
.In machine/bus.h
.Ft int
.Fn bus_dma_tag_create "bus_dma_tag_t parent" "bus_size_t alignment" \
-"bus_size_t boundary" "bus_addr_t lowaddr" "bus_addr_t highaddr" \
+"bus_addr_t boundary" "bus_addr_t lowaddr" "bus_addr_t highaddr" \
"bus_dma_filter_t *filtfunc" "void *filtfuncarg" "bus_size_t maxsize" \
"int nsegments" "bus_size_t maxsegsz" "int flags" "bus_dma_lock_t *lockfunc" \
"void *lockfuncarg" "bus_dma_tag_t *dmat"
diff --git a/share/man/man9/bus_space.9 b/share/man/man9/bus_space.9
index b3234c4..59c3607 100644
--- a/share/man/man9/bus_space.9
+++ b/share/man/man9/bus_space.9
@@ -167,77 +167,77 @@
.Fo bus_space_free
.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t size"
.Fc
-.Ft u_int8_t
+.Ft uint8_t
.Fo bus_space_read_1
.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
.Fc
-.Ft u_int16_t
+.Ft uint16_t
.Fo bus_space_read_2
.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
.Fc
-.Ft u_int32_t
+.Ft uint32_t
.Fo bus_space_read_4
.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
.Fc
-.Ft u_int64_t
+.Ft uint64_t
.Fo bus_space_read_8
.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
.Fc
-.Ft u_int8_t
+.Ft uint8_t
.Fo bus_space_read_stream_1
.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
.Fc
-.Ft u_int16_t
+.Ft uint16_t
.Fo bus_space_read_stream_2
.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
.Fc
-.Ft u_int32_t
+.Ft uint32_t
.Fo bus_space_read_stream_4
.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
.Fc
-.Ft u_int64_t
+.Ft uint64_t
.Fo bus_space_read_stream_8
.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
.Fc
.Ft void
.Fo bus_space_write_1
.Fa "bus_space_tag_t space" "bus_space_handle_t handle"
-.Fa "bus_size_t offset" "u_int8_t value"
+.Fa "bus_size_t offset" "uint8_t value"
.Fc
.Ft void
.Fo bus_space_write_2
.Fa "bus_space_tag_t space" "bus_space_handle_t handle"
-.Fa "bus_size_t offset" "u_int16_t value"
+.Fa "bus_size_t offset" "uint16_t value"
.Fc
.Ft void
.Fo bus_space_write_4
.Fa "bus_space_tag_t space" "bus_space_handle_t handle"
-.Fa "bus_size_t offset" "u_int32_t value"
+.Fa "bus_size_t offset" "uint32_t value"
.Fc
.Ft void
.Fo bus_space_write_8
.Fa "bus_space_tag_t space" "bus_space_handle_t handle"
-.Fa "bus_size_t offset" "u_int64_t value"
+.Fa "bus_size_t offset" "uint64_t value"
.Fc
.Ft void
.Fo bus_space_write_stream_1
.Fa "bus_space_tag_t space" "bus_space_handle_t handle"
-.Fa "bus_size_t offset" "u_int8_t value"
+.Fa "bus_size_t offset" "uint8_t value"
.Fc
.Ft void
.Fo bus_space_write_stream_2
.Fa "bus_space_tag_t space" "bus_space_handle_t handle"
-.Fa "bus_size_t offset" "u_int16_t value"
+.Fa "bus_size_t offset" "uint16_t value"
.Fc
.Ft void
.Fo bus_space_write_stream_4
.Fa "bus_space_tag_t space" "bus_space_handle_t handle"
-.Fa "bus_size_t offset" "u_int32_t value"
+.Fa "bus_size_t offset" "uint32_t value"
.Fc
.Ft void
.Fo bus_space_write_stream_8
.Fa "bus_space_tag_t space" "bus_space_handle_t handle"
-.Fa "bus_size_t offset" "u_int64_t value"
+.Fa "bus_size_t offset" "uint64_t value"
.Fc
.Ft void
.Fo bus_space_barrier
@@ -247,97 +247,97 @@
.Ft void
.Fo bus_space_read_region_1
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int8_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_region_2
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int16_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_region_4
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int32_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_region_8
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int64_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_region_stream_1
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int8_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_region_stream_2
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int16_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_region_stream_4
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int32_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_region_stream_8
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int64_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_region_1
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int8_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_region_2
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int16_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_region_4
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int32_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_region_8
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int64_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_region_stream_1
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int8_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_region_stream_2
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int16_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_region_stream_4
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int32_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_region_stream_8
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int64_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
@@ -391,193 +391,193 @@
.Ft void
.Fo bus_space_set_region_1
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int8_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_region_2
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int16_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_region_4
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int32_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_region_8
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int64_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_region_stream_1
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int8_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_region_stream_2
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int16_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_region_stream_4
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int32_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_region_stream_8
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int64_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_multi_1
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int8_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_multi_2
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int16_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_multi_4
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int32_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_multi_8
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int64_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_multi_stream_1
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int8_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_multi_stream_2
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int16_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_multi_stream_4
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int32_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_read_multi_stream_8
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int64_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_multi_1
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int8_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_multi_2
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int16_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_multi_4
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int32_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_multi_8
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int64_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_multi_stream_1
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int8_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_multi_stream_2
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int16_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_multi_stream_4
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int32_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_write_multi_stream_8
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int64_t *datap"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_multi_1
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int8_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_multi_2
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int16_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_multi_4
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int32_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_multi_8
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int64_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_multi_stream_1
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int8_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_multi_stream_2
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int16_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_multi_stream_4
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int32_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t value"
.Fa "bus_size_t count"
.Fc
.Ft void
.Fo bus_space_set_multi_stream_8
.Fa "bus_space_tag_t space"
-.Fa "bus_space_handle_t handle" "bus_size_t offset" "u_int64_t value"
+.Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t value"
.Fa "bus_size_t count"
.Fc
.Sh DESCRIPTION
diff --git a/share/man/man9/byteorder.9 b/share/man/man9/byteorder.9
index f47f609..20e3136 100644
--- a/share/man/man9/byteorder.9
+++ b/share/man/man9/byteorder.9
@@ -123,7 +123,7 @@ The
.Fn htobe32 ,
and
.Fn htobe64
-functions return a integer in the system's native
+functions return an integer in the system's native
byte order converted to big endian byte order.
The return value will be the same as the argument on big endian systems.
.Pp
diff --git a/share/man/man9/condvar.9 b/share/man/man9/condvar.9
index db3eab1..7b89d46 100644
--- a/share/man/man9/condvar.9
+++ b/share/man/man9/condvar.9
@@ -117,10 +117,10 @@ argument is a pointer to either a
or
.Xr sx 9
lock.
-A
+A
.Xr mutex 9
argument must be initialized with
-.Dv MTX_DEF
+.Dv MTX_DEF
and not
.Dv MTX_SPIN .
A thread must hold
diff --git a/share/man/man9/contigmalloc.9 b/share/man/man9/contigmalloc.9
index f0797be..ba1f428 100644
--- a/share/man/man9/contigmalloc.9
+++ b/share/man/man9/contigmalloc.9
@@ -42,7 +42,7 @@
.Fa "vm_paddr_t low"
.Fa "vm_paddr_t high"
.Fa "unsigned long alignment"
-.Fa "unsigned long boundary"
+.Fa "vm_paddr_t boundary"
.Fc
.Ft void
.Fo contigfree
diff --git a/share/man/man9/crypto.9 b/share/man/man9/crypto.9
index ba13254..c2682af 100644
--- a/share/man/man9/crypto.9
+++ b/share/man/man9/crypto.9
@@ -26,29 +26,29 @@
.Sh SYNOPSIS
.In opencrypto/cryptodev.h
.Ft int32_t
-.Fn crypto_get_driverid u_int8_t
+.Fn crypto_get_driverid uint8_t
.Ft int
-.Fn crypto_register u_int32_t int u_int16_t u_int32_t "int \*[lp]*\*[rp]\*[lp]void *, u_int32_t *, struct cryptoini *\*[rp]" "int \*[lp]*\*[rp]\*[lp]void *, u_int64_t\*[rp]" "int \*[lp]*\*[rp]\*[lp]void *, struct cryptop *\*[rp]" "void *"
+.Fn crypto_register uint32_t int uint16_t uint32_t "int \*[lp]*\*[rp]\*[lp]void *, uint32_t *, struct cryptoini *\*[rp]" "int \*[lp]*\*[rp]\*[lp]void *, uint64_t\*[rp]" "int \*[lp]*\*[rp]\*[lp]void *, struct cryptop *\*[rp]" "void *"
.Ft int
-.Fn crypto_kregister u_int32_t int u_int32_t "int \*[lp]*\*[rp]\*[lp]void *, struct cryptkop *\*[rp]" "void *"
+.Fn crypto_kregister uint32_t int uint32_t "int \*[lp]*\*[rp]\*[lp]void *, struct cryptkop *\*[rp]" "void *"
.Ft int
-.Fn crypto_unregister u_int32_t int
+.Fn crypto_unregister uint32_t int
.Ft int
-.Fn crypto_unregister_all u_int32_t
+.Fn crypto_unregister_all uint32_t
.Ft void
.Fn crypto_done "struct cryptop *"
.Ft void
.Fn crypto_kdone "struct cryptkop *"
.Ft int
-.Fn crypto_newsession "u_int64_t *" "struct cryptoini *" int
+.Fn crypto_newsession "uint64_t *" "struct cryptoini *" int
.Ft int
-.Fn crypto_freesession u_int64_t
+.Fn crypto_freesession uint64_t
.Ft int
.Fn crypto_dispatch "struct cryptop *"
.Ft int
.Fn crypto_kdispatch "struct cryptkop *"
.Ft int
-.Fn crypto_unblock u_int32_t int
+.Fn crypto_unblock uint32_t int
.Ft "struct cryptop *"
.Fn crypto_getreq int
.Ft void
@@ -64,7 +64,7 @@ struct cryptoini {
int cri_klen;
int cri_mlen;
caddr_t cri_key;
- u_int8_t cri_iv[EALG_MAX_BLOCK_LEN];
+ uint8_t cri_iv[EALG_MAX_BLOCK_LEN];
struct cryptoini *cri_next;
};
@@ -83,7 +83,7 @@ struct cryptodesc {
struct cryptop {
TAILQ_ENTRY(cryptop) crp_next;
- u_int64_t crp_sid;
+ uint64_t crp_sid;
int crp_ilen;
int crp_olen;
int crp_etype;
@@ -108,7 +108,7 @@ struct cryptkop {
u_int krp_status; /* return status */
u_short krp_iparams; /* # of input parameters */
u_short krp_oparams; /* # of output parameters */
- u_int32_t krp_hid;
+ uint32_t krp_hid;
struct crparam krp_param[CRK_MAXPARAM];
int (*krp_callback)(struct cryptkop *);
};
@@ -450,7 +450,7 @@ is called to perform a keying operation.
The various fields in the
.Vt cryptkop
structure are:
-.Bl -tag -width ".Va krp_callback'
+.Bl -tag -width ".Va krp_callback"
.It Va krp_op
Operation code, such as
.Dv CRK_MOD_EXP .
@@ -524,10 +524,10 @@ The calling convention for the three driver-supplied routines is:
.Bl -item -compact
.It
.Ft int
-.Fn \*[lp]*newsession\*[rp] "void *" "u_int32_t *" "struct cryptoini *" ;
+.Fn \*[lp]*newsession\*[rp] "void *" "uint32_t *" "struct cryptoini *" ;
.It
.Ft int
-.Fn \*[lp]*freesession\*[rp] "void *" "u_int64_t" ;
+.Fn \*[lp]*freesession\*[rp] "void *" "uint64_t" ;
.It
.Ft int
.Fn \*[lp]*process\*[rp] "void *" "struct cryptop *" ;
diff --git a/share/man/man9/devclass_get_maxunit.9 b/share/man/man9/devclass_get_maxunit.9
index fc2bc25..c3be627 100644
--- a/share/man/man9/devclass_get_maxunit.9
+++ b/share/man/man9/devclass_get_maxunit.9
@@ -48,7 +48,7 @@ The
.Fn devclass_get_maxunit
function returns -1 if
.Fa dc
-is
+is
.Dv NULL;
otherwise it returns the next unit
number in
diff --git a/share/man/man9/device_get_children.9 b/share/man/man9/device_get_children.9
index 677d8eb..cbc1124 100644
--- a/share/man/man9/device_get_children.9
+++ b/share/man/man9/device_get_children.9
@@ -48,9 +48,9 @@ and the count in
.Fa *devcountp .
The memory allocated for the list should be freed using
.Fn free "*devlistp" "M_TEMP" .
-.Fa devlistp
+.Fa devlistp
and
-.Fa devcountp
+.Fa devcountp
are not changed when an error is returned.
.Sh RETURN VALUES
Zero is returned on success, otherwise an appropriate error is returned.
diff --git a/share/man/man9/device_set_flags.9 b/share/man/man9/device_set_flags.9
index aed3069..3a836ff 100644
--- a/share/man/man9/device_set_flags.9
+++ b/share/man/man9/device_set_flags.9
@@ -39,8 +39,8 @@
.In sys/param.h
.In sys/bus.h
.Ft void
-.Fn device_set_flags "device_t dev" "u_int32_t flags"
-.Ft u_int32_t
+.Fn device_set_flags "device_t dev" "uint32_t flags"
+.Ft uint32_t
.Fn device_get_flags "device_t dev"
.Sh DESCRIPTION
Each device supports a set of driver-dependent flags which are often
diff --git a/share/man/man9/devstat.9 b/share/man/man9/devstat.9
index fa37856..7ed7ec1 100644
--- a/share/man/man9/devstat.9
+++ b/share/man/man9/devstat.9
@@ -45,7 +45,7 @@
.Fa "struct devstat *ds"
.Fa "const char *dev_name"
.Fa "int unit_number"
-.Fa "u_int32_t block_size"
+.Fa "uint32_t block_size"
.Fa "devstat_support_flags flags"
.Fa "devstat_type_flags device_type"
.Fa "devstat_priority priority"
@@ -57,7 +57,7 @@
.Ft void
.Fo devstat_end_transaction
.Fa "struct devstat *ds"
-.Fa "u_int32_t bytes"
+.Fa "uint32_t bytes"
.Fa "devstat_tag_type tag_type"
.Fa "devstat_trans_flags flags"
.Fc
diff --git a/share/man/man9/devtoname.9 b/share/man/man9/devtoname.9
index f93e77b..07ec04f 100644
--- a/share/man/man9/devtoname.9
+++ b/share/man/man9/devtoname.9
@@ -24,32 +24,23 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 25, 1999
+.Dd February 10, 2012
.Dt DEVTONAME 9
.Os
.Sh NAME
.Nm devtoname
-.Nd "converts dev_t data into a string indicating the device name"
+.Nd "converts character device into a string indicating the device name"
.Sh SYNOPSIS
.In sys/param.h
.In sys/conf.h
.Ft const char *
-.Fn devtoname "dev_t dev"
+.Fn devtoname "struct cdev *dev"
.Sh DESCRIPTION
The
.Fn devtoname
function returns a pointer to the name of the device passed to it.
The name is whatever was set to it in
.Fn make_dev .
-If no name is associated with
-.Va dev ,
-a pointer to a string consisting of a
-.Dq #
-followed by
-.Dq Va major Ns / Ns Va minor
-as it applies to
-.Va dev
-is returned.
.Sh HISTORY
The
.Fn devtoname
diff --git a/share/man/man9/domain.9 b/share/man/man9/domain.9
index e868c97..7d665b3 100644
--- a/share/man/man9/domain.9
+++ b/share/man/man9/domain.9
@@ -26,11 +26,11 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 23, 2008
+.Dd February 23, 2012
.Dt DOMAIN 9
.Os
.Sh NAME
-.Nm net_add_domain ,
+.Nm domain_add ,
.Nm pfctlinput ,
.Nm pfctlinput2 ,
.Nm pffindproto ,
@@ -43,7 +43,7 @@
.In sys/protosw.h
.In sys/domain.h
.Ft void
-.Fn net_add_domain "void *data"
+.Fn domain_add "void *data"
.Ft void
.Fn pfctlinput "int cmd" "struct sockaddr *sa"
.Ft void
@@ -142,7 +142,7 @@ have their
.Fn pr_ctlinput
function called.
.Pp
-.Fn net_add_domain
+.Fn domain_add
adds a new protocol domain to the system.
The argument
.Fa data
@@ -153,13 +153,13 @@ within the function, but is declared
in order to prevent compiler warnings when new domains are registered with
.Fn SYSINIT .
In most cases
-.Fn net_add_domain
+.Fn domain_add
is not called directly, instead
.Fn DOMAIN_SET
is used.
.Pp
If the new domain has defined an initialization routine, it is called by
-.Fn net_add_domain ;
+.Fn domain_add ;
as well, each of the protocols within the domain that have defined an
initialization routine will have theirs called.
.Pp
diff --git a/share/man/man9/drbr.9 b/share/man/man9/drbr.9
new file mode 100644
index 0000000..168ce10
--- /dev/null
+++ b/share/man/man9/drbr.9
@@ -0,0 +1,147 @@
+.\" Copyright (c) 2009 Bitgravity Inc
+.\" Written by: Kip Macy <kmacy@@FreeBSD.org>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd January 30, 2012
+.Dt DRBR 9
+.Os
+.Sh NAME
+.Nm drbr ,
+.Nm drbr_free ,
+.Nm drbr_enqueue ,
+.Nm drbr_dequeue ,
+.Nm drbr_dequeue_cond ,
+.Nm drbr_flush ,
+.Nm drbr_empty ,
+.Nm drbr_inuse ,
+.Nm drbr_stats_update ,
+.Nd network driver interface to buf_ring
+.Sh SYNOPSIS
+.In sys/param.h
+.In net/if.h
+.In net/if_var.h
+.Ft void
+.Fn drbr_free "struct buf_ring *br" "struct malloc_type *type"
+.Ft int
+.Fn drbr_enqueue "struct ifnet *ifp" "struct buf_ring *br" "struct mbuf *m"
+.Ft struct mbuf *
+.Fn drbr_dequeue "struct ifnet *ifp" "struct buf_ring *br"
+.Ft struct mbuf *
+.Fn drbr_dequeue_cond "struct ifnet *ifp" "struct buf_ring *br" "int (*func) (struct mbuf *, void *)" "void *arg"
+.Ft void
+.Fn drbr_flush "struct ifnet *ifp" "struct buf_ring *br"
+.Ft int
+.Fn drbr_empty "struct ifnet *ifp" "struct buf_ring *br"
+.Ft int
+.Fn drbr_inuse "struct ifnet *ifp" "struct buf_ring *br"
+.Ft void
+.Fn drbr_stats_update "struct ifnet *ifp" "int len" "int mflags"
+.Sh DESCRIPTION
+The
+.Nm
+functions provide an API to network drivers for using
+.Xr buf_ring 9
+for enqueueing and dequeueing packets.
+This is meant as a replacement for the IFQ interface for packet queuing.
+It allows a packet to be enqueued with a single atomic and packet
+dequeue to be done without any per-packet atomics as it is protected
+by the driver's tx queue lock.
+If
+.Dv INVARIANTS
+is enabled,
+.Fn drbr_dequeue
+will assert that the tx queue lock is held when it is called.
+.Pp
+The
+.Fn drbr_free
+function frees all the enqueued mbufs and then frees the buf_ring.
+.Pp
+The
+.Fn drbr_enqueue
+function is used to enqueue an mbuf to a buf_ring, falling back to the
+ifnet's IFQ if
+.Xr ALTQ 4
+is enabled.
+.Pp
+The
+.Fn drbr_dequeue
+function is used to dequeue an mbuf from a buf_ring or, if
+.Xr ALTQ 4
+is enabled, from the ifnet's IFQ.
+.Pp
+The
+.Fn drbr_dequeue_cond
+function is used to conditionally dequeue an mbuf from a buf_ring based
+on whether
+.Fa func
+returns
+.Dv TRUE
+or
+.Dv FALSE .
+.Pp
+The
+.Fn drbr_flush
+function frees all mbufs enqueued in the buf_ring and the ifnet's IFQ.
+.Pp
+The
+.Fn drbr_empty
+function returns
+.Dv TRUE
+if there are no mbufs enqueued,
+.Dv FALSE
+otherwise.
+.Pp
+The
+.Fn drbr_inuse
+function returns the number of mbufs enqueued.
+Note to users that this is intrinsically racy as there is no guarantee that
+there will not be more mbufs when
+.Fn drbr_dequeue
+is actually called.
+Provided the tx queue lock is held there will not be less.
+.Pp
+The
+.Fn drbr_stats_update
+function updates the number of bytes and the number of multicast packets sent.
+.Sh RETURN VALUES
+The
+.Fn drbr_enqueue
+function returns
+.Er ENOBUFS
+if there are no slots available in the buf_ring and
+.Dv 0
+on success.
+.Pp
+The
+.Fn drbr_dequeue
+and
+.Fn drbr_dequeue_cond
+functions return an mbuf on success and
+.Dv NULL
+if the buf_ring is empty.
+.Sh HISTORY
+These functions were introduced in
+.Fx 8.0 .
diff --git a/share/man/man9/eventtimers.9 b/share/man/man9/eventtimers.9
index db530a9..2ed15d0 100644
--- a/share/man/man9/eventtimers.9
+++ b/share/man/man9/eventtimers.9
@@ -52,7 +52,7 @@ struct eventtimer {
#define ET_FLAGS_POW2DIV 16
int et_quality;
int et_active;
- u_int64_t et_frequency;
+ uint64_t et_frequency;
struct bintime et_min_period;
struct bintime et_max_period;
et_start_t *et_start;
@@ -213,7 +213,7 @@ is the opposite to
It releases the event timer for other consumers use.
.Pp
.Fn ET_LOCK
-and
+and
.Fn ET_UNLOCK
macros should be used to manage
.Xr mutex 9
diff --git a/share/man/man9/fail.9 b/share/man/man9/fail.9
index 0973cea..5505d13 100644
--- a/share/man/man9/fail.9
+++ b/share/man/man9/fail.9
@@ -165,7 +165,6 @@ term only cascades when passed a non-zero argument.
A pid can optionally be specified.
The fail point term is only executed when invoked by a process with a
matching p_pid.
-.Pp
.Sh EXAMPLES
.Bl -tag
.It Sy sysctl debug.fail_point.foobar="2.1%return(5)"
diff --git a/share/man/man9/firmware.9 b/share/man/man9/firmware.9
index 5254f24..9987e09 100644
--- a/share/man/man9/firmware.9
+++ b/share/man/man9/firmware.9
@@ -157,7 +157,7 @@ argument may be set to
to indicate that
firmware_put is free to reclaim resources associated with
the firmware image if this is the last reference.
-By default a firmware image will be deferred to a
+By default a firmware image will be deferred to a
.Xr taskqueue 9
thread so the call may be done while holding a lock.
In certain cases, such as on driver detach, this cannot be allowed.
diff --git a/share/man/man9/get_cyclecount.9 b/share/man/man9/get_cyclecount.9
index 30db0d8..eabaeb1 100644
--- a/share/man/man9/get_cyclecount.9
+++ b/share/man/man9/get_cyclecount.9
@@ -34,7 +34,7 @@
.In sys/param.h
.In sys/systm.h
.In machine/cpu.h
-.Ft u_int64_t
+.Ft uint64_t
.Fn get_cyclecount "void"
.Sh DESCRIPTION
The
diff --git a/share/man/man9/ieee80211.9 b/share/man/man9/ieee80211.9
index 30affc9..1e53cf6 100644
--- a/share/man/man9/ieee80211.9
+++ b/share/man/man9/ieee80211.9
@@ -29,7 +29,7 @@
.Dt IEEE80211 9
.Os
.Sh NAME
-.Nm IEEE80211
+.Nm IEEE80211
.Nd 802.11 network layer
.Sh SYNOPSIS
.In net80211/ieee80211_var.h
@@ -164,7 +164,7 @@ Table of channels the device is capable of operating on.
This is initially provided by the driver but may be changed
through calls that change the regulatory state.
.It Dv ic_nchan
-Number of entries in
+Number of entries in
.Dv ic_channels .
.El
.Pp
@@ -221,7 +221,7 @@ There is no default method; the pointer may be NULL in which case
it will not be used.
.It Dv ic_node_alloc
Allocate and initialize a
-.Vt ieee80211_node
+.Vt ieee80211_node
structure.
This method cannot sleep.
The default method allocates zero'd memory using
@@ -232,7 +232,7 @@ Memory allocated by the driver must be tagged with
.Dv M_80211_NODE
to balance the memory allocation statistics.
.It Dv ic_node_free
-Reclaim storage of a node allocated by
+Reclaim storage of a node allocated by
.Dv ic_node_alloc .
Drivers are expected to
.Em interpose
@@ -302,7 +302,7 @@ and must initiate the work to scan a channel and schedule a timer
to advance to the next channel in the scan list.
This callback is done in a sleepable context.
The default method handles active scan work (e.g. sending ProbeRequest
-frames), and schedules a call to
+frames), and schedules a call to
.Xr ieee80211_scan_next 9
according to the maximum dwell time for the channel.
Drivers that off-load scan work to firmware typically use this method
@@ -354,7 +354,7 @@ Terminate receipt of A-MPDU data from the specified station for the TID.
.El
.Pp
Once the
-.Nm
+.Nm
layer is attached to a driver there are two more steps typically done
to complete the work:
.Bl -enum
@@ -405,7 +405,7 @@ The following general capabilities are defined:
Device is capable of operating in station (aka Infrastructure) mode.
.It Dv IEEE80211_C_8023ENCAP
Device requires 802.3-encapsulated frames be passed for transmit.
-By default
+By default
.Nm
will encapsulate all outbound frames as 802.11 frames (without a PLCP header).
.It Dv IEEE80211_C_FF
@@ -529,16 +529,16 @@ Device supports L-SIG TXOP protection.
.It Dv IEEE80211_HTC_AMPDU
Device supports A-MPDU aggregation.
Note that any 802.11n compliant device must support A-MPDU receive
-so this implicitly means support for
+so this implicitly means support for
.Em transmit
of A-MPDU frames.
.It Dv IEEE80211_HTC_AMSDU
Device supports A-MSDU aggregation.
Note that any 802.11n compliant device must support A-MSDU receive
-so this implicitly means support for
+so this implicitly means support for
.Em transmit
of A-MSDU frames.
-.It Dv IEEE80211_HTC_HT
+.It Dv IEEE80211_HTC_HT
Device supports High Throughput (HT) operation.
This capability must be set to enable 802.11n functionality
in
diff --git a/share/man/man9/ieee80211_amrr.9 b/share/man/man9/ieee80211_amrr.9
index 8206b2d..a90de3d 100644
--- a/share/man/man9/ieee80211_amrr.9
+++ b/share/man/man9/ieee80211_amrr.9
@@ -86,7 +86,7 @@ rate for each frame.
To maximize throughput algorithms try to use the highest rate that
is appropriate for the operating conditions.
The rate will vary as conditions change; the distance between two stations
-may change, transient noise may be present that affects signal quality,
+may change, transient noise may be present that affects signal quality,
etc.
.Nm
uses very simple information from a driver to do it's job:
@@ -119,8 +119,8 @@ The
.Vt amrr
structure member holds the per-vap state for
.Nm
-and
-.Xr ral 4
+and
+.Xr ral 4
initializes it in the vap create method with:
.Bd -literal -offset indent
ieee80211_amrr_init(&rvp->amrr, vap,
diff --git a/share/man/man9/ieee80211_bmiss.9 b/share/man/man9/ieee80211_bmiss.9
index bd82c3c..63b8e9f 100644
--- a/share/man/man9/ieee80211_bmiss.9
+++ b/share/man/man9/ieee80211_bmiss.9
@@ -56,9 +56,9 @@ This causes some number of ProbeRequest frames to be sent to the
access point to check if the association is still alive.
If no response is received and roaming mode is set to
.Dv IEEE80211_ROAMING_AUTO
-then
+then
.Nm net80211
-will try to re-associate and if that fails
+will try to re-associate and if that fails
trigger a scan to look for the access point or another suitable AP.
When the
.Nm net80211
diff --git a/share/man/man9/ieee80211_crypto.9 b/share/man/man9/ieee80211_crypto.9
index e21bc26..9f48f21 100644
--- a/share/man/man9/ieee80211_crypto.9
+++ b/share/man/man9/ieee80211_crypto.9
@@ -127,7 +127,7 @@ driver is unable to provide necessary hardware services.
cipher modules register their services using
.Fn ieee80211_crypto_register
and supply a template that describes their operation.
-This
+This
.Vt ieee80211_cipher
structure defines protocol-related state such as the number of bytes
of space in the 802.11 header to reserve/remove during encap/decap
@@ -153,7 +153,7 @@ hardware.
.Sh CRYPTO KEY MANAGEMENT
The
.Nm net80211
-layer implements a per-vap 4-element
+layer implements a per-vap 4-element
.Dq global key table
and a per-station
.Dq unicast key
@@ -235,7 +235,7 @@ to the driver that are already prepared for transmission.
For receive, drivers mark frames with the
.Dv M_WEP
mbuf flag to indicate the hardware has decrypted the payload.
-If frames have the
+If frames have the
.Dv IEEE80211_FC1_WEP
bit marked in their 802.11 header and are not tagged with
.Dv M_WEP
diff --git a/share/man/man9/ieee80211_input.9 b/share/man/man9/ieee80211_input.9
index 61b11a5..9422f0b 100644
--- a/share/man/man9/ieee80211_input.9
+++ b/share/man/man9/ieee80211_input.9
@@ -110,7 +110,7 @@ RSSI and noise are used by the
layer to make scanning and roaming decisions in station mode
and to do auto channel selection for hostap and similar modes.
Otherwise the values are made available to user applications
-(with the rssi presented as a filtered average over the last ten values
+(with the rssi presented as a filtered average over the last ten values
and the noise floor the last reported value).
.Sh SEE ALSO
.Xr ieee80211 9
diff --git a/share/man/man9/ieee80211_node.9 b/share/man/man9/ieee80211_node.9
index 180d8c4..452bbcc 100644
--- a/share/man/man9/ieee80211_node.9
+++ b/share/man/man9/ieee80211_node.9
@@ -67,18 +67,18 @@
.Ft void
.Fo ieee80211_dump_nodes
.Fa "struct ieee80211_node_table *"
-.Fc
+.Fc
.\"
.Ft void
.Fo ieee80211_dump_node
.Fa "struct ieee80211_node *"
-.Fc
+.Fc
.Sh DESCRIPTION
The
.Nm net80211
layer that supports 802.11 device drivers maintains a database of
peer stations called the
-.Dq node table
+.Dq node table
in the
.Vt ic_sta
entry of the
@@ -125,7 +125,7 @@ field.
This reference must be reclaimed by the driver when transmit processing
is done.
For each frame received the driver must lookup the table entry to
-use in dispatching the frame
+use in dispatching the frame
.Dq up the stack .
This lookup implicitly obtains a reference to the table entry and
the driver must reclaim the reference when frame processing is completed.
@@ -139,7 +139,7 @@ Entries may be looked up using one of the pre-defined API's or the
.Fn ieee80211_iterate_nodes
call may be used to iterate through all entries to do per-node
processing or implement some non-standard search mechanism.
-Note that
+Note that
.Fn ieee80211_iterate_nodes
is single-threaded per-device
and the effort processing involved is fairly
@@ -206,7 +206,7 @@ iwi_node_free(struct ieee80211_node *ni)
struct ieee80211com *ic = ni->ni_ic;
struct iwi_softc *sc = ic->ic_ifp->if_softc;
struct iwi_node *in = (struct iwi_node *)ni;
-
+
if (in->in_station != -1)
free_unr(sc->sc_unr, in->in_station);
sc->sc_node_free(ni); /* invoke net80211 free handler */
diff --git a/share/man/man9/ieee80211_output.9 b/share/man/man9/ieee80211_output.9
index 82393bd..6a8d3a7 100644
--- a/share/man/man9/ieee80211_output.9
+++ b/share/man/man9/ieee80211_output.9
@@ -110,13 +110,13 @@ node table entry in the
field.
The node is associated with the frame destination.
Typically it is the receiver's entry but in some situations it may be
-a placeholder entry or the
+a placeholder entry or the
.Dq next hop station
(such as in a mesh network).
In all cases the reference must be reclaimed with
.Fn ieee80211_free_node
when the transmit work is completed.
-The rule to remember is:
+The rule to remember is:
.Nm net80211
passes responsibility for the
.Vt mbuf
@@ -131,7 +131,7 @@ assigned to the receiving station and/or any Diffserv setting
in an IP or IPv6 header.
If both vlan and Diffserv priority are present the higher of the
two is used.
-If WME/WMM is being used then any ACM policy (in station mode) is
+If WME/WMM is being used then any ACM policy (in station mode) is
also enforced.
The resulting AC is attached to the mbuf and may be read back using the
.Fn M_WME_GETAC
@@ -182,7 +182,7 @@ The callback is done using
.Fn ieee80211_process_callback
with the last parameter set to a non-zero value if an error occurred
and zero otherwise.
-Note
+Note
.Nm net80211
understands that drivers may be incapable of determining status;
a device may not report if an ACK frame is received and/or a device may queue
diff --git a/share/man/man9/ieee80211_proto.9 b/share/man/man9/ieee80211_proto.9
index 1938d6e..88412eb 100644
--- a/share/man/man9/ieee80211_proto.9
+++ b/share/man/man9/ieee80211_proto.9
@@ -108,7 +108,7 @@ Beware that data traffic is also gated by whether the associated
.Dq port
is authorized.
When WPA/802.11i/802.1x is operational authorization may happen separately;
-e.g. in station mode
+e.g. in station mode
.Xr wpa_supplicant 8
must complete the handshakes and plumb the necessary keys before a port
is authorized.
@@ -143,14 +143,14 @@ Certain
.Nm net80211
data are valid only in certain states; e.g. the
.Vt iv_bsschan
-that specifies the channel for the operating BSS should never be used
+that specifies the channel for the operating BSS should never be used
except in
.Dv IEEE80211_S_RUN
or greater.
.Sh STATE CHANGES
State machine changes are typically handled internal to the
.Nm net80211
-layer in response to
+layer in response to
.Xr ioctl 2
requests, received frames, or external events such as a beacon miss.
The
@@ -161,7 +161,7 @@ The request is initially processed to handle coordination of multiple vaps.
For example, only one vap at a time can be scanning, if multiple vaps
request a change to
.Dv IEEE80211_S_SCAN
-the first will be permitted to run and the others will be
+the first will be permitted to run and the others will be
.Em deferred
until the scan operation completes at which time the selected channel
will be adopted.
@@ -197,12 +197,12 @@ call the
handles two state changes specially.
On transition to
.Dv IEEE80211_S_RUN
-the
+the
.Dv IFF_DRV_OACTIVE
bit on the vap's transmit queue is cleared so traffic can flow.
On transition to
.Dv IEEE80211_S_INIT
-any state in the scan cache associated with the vap is flushed
+any state in the scan cache associated with the vap is flushed
and any frames pending on the transmit queue are flushed.
.Sh DRIVER INTEGRATION
Drivers are expected to override the
diff --git a/share/man/man9/ieee80211_radiotap.9 b/share/man/man9/ieee80211_radiotap.9
index 8d44a47..cea2eb4 100644
--- a/share/man/man9/ieee80211_radiotap.9
+++ b/share/man/man9/ieee80211_radiotap.9
@@ -61,7 +61,7 @@ The
.Nm net80211
layer used by 802.11 drivers includes support for a device-independent
packet capture format called
-.Nm radiotap
+.Nm radiotap
that is understood by tools such as
.Xr tcpdump 1 .
This facility is designed for capturing 802.11 traffic,
@@ -257,7 +257,7 @@ struct wi_rx_radiotap_header {
uint16_t wr_chan_flags;
uint8_t wr_antsignal;
uint8_t wr_antnoise;
-} __packed;
+} __packed;
.Ed
.Pp
and transmit definitions for the Atheros driver:
diff --git a/share/man/man9/ieee80211_regdomain.9 b/share/man/man9/ieee80211_regdomain.9
index 527deb5..da310dd 100644
--- a/share/man/man9/ieee80211_regdomain.9
+++ b/share/man/man9/ieee80211_regdomain.9
@@ -56,7 +56,7 @@ The
software layer provides a support framework for drivers that includes
comprehensive regulatory support.
.Nm net80211
-provides mechanisms that enforce
+provides mechanisms that enforce
.Em "regulatory policy"
by privileged user applications.
.Pp
@@ -102,7 +102,7 @@ and leave proper setup to user applications.
If default settings are known they can be installed and/or an event
can be dispatched to user space using
.Fn ieee80211_notify_country
-so that
+so that
.Xr devd 8
will do the appropriate setup work at system boot (or device insertion).
.Pp
diff --git a/share/man/man9/ieee80211_scan.9 b/share/man/man9/ieee80211_scan.9
index b2b77cf..54cefa7 100644
--- a/share/man/man9/ieee80211_scan.9
+++ b/share/man/man9/ieee80211_scan.9
@@ -322,7 +322,7 @@ Existing entries are typically updated based on the latest information
though some information such as RSSI and noise floor readings may be
combined to present an average.
.Pp
-The cache contents is aged through
+The cache contents is aged through
.Fn ieee80211_scan_timeout
calls.
Typically these happen together with other station table activity; every
diff --git a/share/man/man9/ieee80211_vap.9 b/share/man/man9/ieee80211_vap.9
index f5ef20b..0c68f6d 100644
--- a/share/man/man9/ieee80211_vap.9
+++ b/share/man/man9/ieee80211_vap.9
@@ -93,7 +93,7 @@ This data structure must have an
structure at the front but is usually extended with driver-private state.
Next the vap is setup with a call to
.Fn ieee80211_vap_setup .
-This request initializes
+This request initializes
.Nm net80211
state but does not activate the interface.
The driver can then override methods setup by
@@ -108,7 +108,7 @@ A vap is deleted when an
.Dv SIOCIFDESTROY
ioctl request is made or when the device detaches (causing all
associated vaps to automatically be deleted).
-Delete requests cause the
+Delete requests cause the
.Vt ic_vap_delete
method to be called.
Drivers must quiesce the device before calling
diff --git a/share/man/man9/ifnet.9 b/share/man/man9/ifnet.9
index e015fb7..dd4fdf5 100644
--- a/share/man/man9/ifnet.9
+++ b/share/man/man9/ifnet.9
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 3, 2011
+.Dd March 23, 2012
.Dt IFNET 9
.Os
.Sh NAME
@@ -66,21 +66,26 @@
.Fn if_allmulti "struct ifnet *ifp" "int amswitch"
.Ft "struct ifnet *"
.Fn ifunit "const char *name"
+.Ft "struct ifnet *"
+.Fn ifunit_ref "const char *name"
.Ft void
.Fn if_up "struct ifnet *ifp"
.\"
.Ss "Interface Address Functions"
.Ft "struct ifaddr *"
+.Fn ifaddr_byindex "u_short idx"
+.Ft "struct ifaddr *"
.Fn ifa_ifwithaddr "struct sockaddr *addr"
.Ft "struct ifaddr *"
.Fn ifa_ifwithdstaddr "struct sockaddr *addr"
.Ft "struct ifaddr *"
-.Fn ifa_ifwithnet "struct sockaddr *addr"
+.Fn ifa_ifwithnet "struct sockaddr *addr" "int ignore_ptp"
.Ft "struct ifaddr *"
.Fn ifaof_ifpforaddr "struct sockaddr *addr" "struct ifnet *ifp"
.Ft void
-.Fn ifafree "struct ifaddr *ifa"
-.Fn IFAFREE "struct ifaddr *ifa"
+.Fn ifa_ref "struct ifaddr *ifa"
+.Ft void
+.Fn ifa_free "struct ifaddr *ifa"
.\"
.Ss "Interface Multicast Address Functions"
.Ft int
@@ -88,7 +93,7 @@
.Ft int
.Fn if_delmulti "struct ifnet *ifp" "struct sockaddr *sa"
.Ft "struct ifmultiaddr *"
-.Fn ifmaof_ifpforaddr "struct sockaddr *addr" "struct ifnet *ifp"
+.Fn if_findmulti "struct ifnet *ifp" "struct sockaddr *sa"
.Ss "Output queue macros"
.Fn IF_DEQUEUE "struct ifqueue *ifq" "struct mbuf *m"
.\"
@@ -98,7 +103,7 @@
.Ft int
.Fo \*(lp*if_output\*(rp
.Fa "struct ifnet *ifp" "struct mbuf *m"
-.Fa "struct sockaddr *dst" "struct rtentry *rt"
+.Fa "struct sockaddr *dst" "struct route *ro"
.Fc
.Ft void
.Fn \*(lp*if_start\*(rp "struct ifnet *ifp"
@@ -107,9 +112,7 @@
.Ft void
.Fn \*(lp*if_qflush\*(rp "struct ifnet *ifp"
.Ft int
-.Fn \*(lp*if_ioctl\*(rp "struct ifnet *ifp" "int cmd" "caddr_t data"
-.Ft void
-.Fn \*(lp*if_watchdog\*(rp "struct ifnet *ifp"
+.Fn \*(lp*if_ioctl\*(rp "struct ifnet *ifp" "u_long cmd" "caddr_t data"
.Ft void
.Fn \*(lp*if_init\*(rp "void *if_softc"
.Ft int
@@ -119,12 +122,12 @@
.Ss "struct ifaddr member function"
.Ft void
.Fo \*(lp*ifa_rtrequest\*(rp
-.Fa "int cmd" "struct rtentry *rt" "struct sockaddr *dst"
+.Fa "int cmd" "struct rtentry *rt" "struct rt_addrinfo *info"
.Fc
.\"
.Ss "Global Variables"
.Vt extern struct ifnethead ifnet ;
-.Vt extern struct ifaddr **ifnet_addrs ;
+.\" extern struct ifindex_entry *ifindex_table ;
.Vt extern int if_index ;
.Vt extern int ifqmaxlen ;
.Sh DATA STRUCTURES
@@ -178,23 +181,23 @@ return pointers to these structures.
Each interface structure
contains an
.Vt if_data
-structure, which contains statistics and identifying information used
-by management programs, and which is exported to user programs by way
-of the
-.Xr ifmib 4
-branch of the
-.Xr sysctl 3
-MIB.
+structure used for statistics and information.
Each interface also has a
.Li TAILQ
of interface addresses, described by
.Vt ifaddr
-structures; the head of the queue is always an
+structures.
+An
.Dv AF_LINK
address
(see
.Xr link_addr 3 )
-describing the link layer implemented by the interface (if any).
+describing the link layer implemented by the interface (if any)
+is accessed by the
+.Fn ifaddr_byindex
+function or
+.Va if_addr
+structure.
(Some trivial interfaces do not provide any link layer addresses;
this structure, while still present, serves only to identify the
interface name and index.)
@@ -226,6 +229,18 @@ A pointer to the driver's private state block.
A pointer to the common data for the interface's layer 2 protocol.
(Initialized by
.Fn if_alloc . )
+.It Va if_vnet
+.Pq Vt "struct vnet *"
+A pointer to the virtual network stack instance.
+(Initialized by
+.Fn if_attach . )
+.It Va if_home_vnet
+.Pq Vt "struct vnet *"
+A pointer to the parent virtual network stack, where this
+.Vt "struct ifnet"
+originates from.
+(Initialized by
+.Fn if_attach . )
.It Va if_link
.Pq Fn TAILQ_ENTRY ifnet
.Xr queue 3
@@ -256,6 +271,11 @@ if a unit number is not associated with the device.
(Initialized by driver
(usually via
.Fn if_initname ) . )
+.It Va if_refcount
+.Pq Vt u_int
+The reference count.
+(Initialized by
+.Fn if_alloc . )
.It Va if_addrhead
.Pq Vt "struct ifaddrhead"
The head of the
@@ -268,6 +288,13 @@ A count of promiscuous listeners on this interface, used to
reference-count the
.Dv IFF_PROMISC
flag.
+.It Va if_carp
+.Pq Vt "struct carp_if *"
+A pointer to the CARP interface structure,
+.Xr carp 4 .
+(Initialized by the driver-specific
+.Fn if_ioctl
+routine.)
.It Va if_bpf
.Pq Vt "struct bpf_if *"
Opaque per-interface data for the packet filter,
@@ -285,6 +312,13 @@ to refer to a particular interface by index
.Xr link_addr 3 ) .
(Initialized by
.Fn if_alloc . )
+.It Va if_vlantrunk
+.Pq Vt struct ifvlantrunk *
+A pointer to 802.1Q trunk structure,
+.Xr vlan 4 .
+(Initialized by the driver-specific
+.Fn if_ioctl
+routine.)
.It Va if_flags
.Pq Vt int
Flags describing operational parameters of this interface (see below).
@@ -299,17 +333,6 @@ Flags describing the capabilities the interface supports (see below).
.It Va if_capenable
.Pq Vt int
Flags describing the enabled capabilities of the interface (see below).
-.\" .It Va if_ipending
-.\" Interrupt-pending bits for polled operation:
-.\" .Dv IFI_XMIT
-.\" (transmit complete interrupt)
-.\" and
-.\" .Dv IFI_RECV
-.\" (received packet ready interrupt).
-.\" See the
-.\" .Sx Polling
-.\" section, below.
-.\" (Manipulated by driver.)
.It Va if_linkmib
.Pq Vt "void *"
A pointer to an interface-specific MIB structure exported by
@@ -326,20 +349,113 @@ More statistics and information; see
below.
(Initialized by driver, manipulated by both driver and generic
code.)
+.It Va if_multiaddrs
+.Pq Vt struct ifmultihead
+The head of the
+.Xr queue 3
+.Li TAILQ
+containing the list of multicast addresses assigned to this interface.
+.It Va if_amcount
+.Pq Vt int
+A number of multicast requests on this interface, used to
+reference-count the
+.Dv IFF_ALLMULTI
+flag.
+.It Va if_addr
+.Pq Vt "struct ifaddr *"
+A pointer to the link-level interface address.
+(Initialized by
+.Fn if_alloc . )
+.\" .It Va if_llsoftc
+.\" .Pq Vt "void *"
+.\" The purpose of the field is unclear.
.It Va if_snd
-.Pq Vt "struct ifqueue"
+.Pq Vt "struct ifaltq"
The output queue.
(Manipulated by driver.)
-.\".It Va if_poll_slowq
-.\".Pq Vt "struct ifqueue *"
-.\"A pointer to the input queue for devices which do not support polling
-.\"well.
-.\"See the
-.\".Sx Polling
-.\"section, below.
-.\"(Initialized by driver.)
+.It Va if_broadcastaddr
+.Pq Vt "const u_int8_t *"
+A link-level broadcast bytestring for protocols with variable address
+length.
+.It Va if_bridge
+.Pq Vt "void *"
+A pointer to the bridge interface structure,
+.Xr if_bridge 4 .
+(Initialized by the driver-specific
+.Fn if_ioctl
+routine.)
+.It Va if_label
+.Pq Vt "struct label *"
+A pointer to the MAC Framework label structure,
+.Xr mac 4 .
+(Initialized by
+.Fn if_alloc . )
+.It Va if_afdata
+.Pq Vt "void *"
+An address family dependent data region.
+.It Va if_afdata_initialized
+.Pq Vt int
+Used to track the current state of address family initialization.
+.It Va if_afdata_lock
+.Pq Vt "struct rwlock"
+An
+.Xr rwlock 9
+lock used to protect
+.Va if_afdata
+internals.
+.It Va if_linktask
+.Pq Vt "struct task"
+A
+.Xr taskqueue 9
+task scheduled for link state change events of the interface.
+.It Va if_addr_lock
+.Pq Vt "struct rwlock"
+An
+.Xr rwlock 9
+lock used to protect interface-related address lists.
+.It Va if_clones
+.Pq Fn LIST_ENTRY ifnet
+.Xr queue 3
+macro glue for the list of clonable network interfaces.
+.It Va if_groups
+.Pq Fn TAILQ_HEAD ", ifg_list"
+The head of the
+.Xr queue 3
+.Li TAILQ
+containing the list of groups per interface.
+.It Va if_pf_kif
+.Pq Vt "void *"
+A pointer to the structure used for interface abstraction by
+.Xr pf 4 .
+.It Va if_lagg
+.Pq Vt "void *"
+A pointer to the
+.Xr lagg 4
+interface structure.
+.It Va if_alloctype
+.Pq Vt u_char
+The type of the interface as it was at the time of its allocation.
+It is used to cache the type passed to
+.Fn if_alloc ,
+but unlike
+.Va if_type ,
+it would not be changed by drivers.
.El
.Pp
+References to
+.Vt ifnet
+structures are gained by calling the
+.Fn if_ref
+function and released by calling the
+.Fn if_rele
+function.
+They are used to allow kernel code walking global interface lists
+to release the
+.Vt ifnet
+lock yet keep the
+.Vt ifnet
+structure stable.
+.Pp
There are in addition a number of function pointers which the driver
must initialize to complete its interface with the generic interface
layer:
@@ -364,7 +480,7 @@ This function will return
.Dv ENOBUFS
if the devices software and hardware queues are both full.
This function must be installed after
-.Fn if_attach
+.Fn if_attach
to override the default implementation.
This function is exposed in order to allow drivers to manage their own queues
and to reduce the latency caused by a frequently gratuitous enqueue / dequeue
@@ -372,8 +488,8 @@ pair to ifq.
The suggested internal software queueing mechanism is buf_ring.
.It Fn if_qflush
Free mbufs in internally managed queues when the interface is marked down.
-This function must be installed after
-.Fn if_attach
+This function must be installed after
+.Fn if_attach
to override the default implementation.
This function is exposed in order to allow drivers to manage their own queues
and to reduce the latency caused by a frequently gratuitous enqueue / dequeue
@@ -394,10 +510,6 @@ flag is not set.
does not literally mean that output is active, but rather that the
device's internal output queue is full.) Please note that this function
will soon be deprecated.
-.It Fn if_done
-Not used.
-We are not even sure what it was ever for.
-The prototype is faked.
.It Fn if_ioctl
Process interface-related
.Xr ioctl 2
@@ -412,13 +524,6 @@ flags and flushing queues.
See the description of
.Fn ifioctl
below for more information.
-.\" .It Fn if_poll_recv
-.\" .It Fn if_poll_xmit
-.\" .It Fn if_poll_slowinput
-.\" .It Fn if_poll_intren
-.\" See the
-.\" .Sx Polling
-.\" section, below.
.It Fn if_init
Initialize and bring up the hardware,
e.g., reset the chip and enable the receiver unit.
@@ -478,6 +583,14 @@ The interface is a loopback device.
The interface is point-to-point;
.Dq broadcast
address is actually the address of the other end.
+.It Dv IFF_SMART
+.Aq S*
+The interface manages its own routes, rather than using the generic
+code in
+.Fn if_up
+and
+.Fn if_down .
+This is probably useful for serial lines.
.It Dv IFF_DRV_RUNNING
.Aq D*
The interface has been configured and dynamic resources were
@@ -514,14 +627,31 @@ multiple physical layers on some devices.)
.It Dv IFF_MULTICAST
.Aq S*
This interface supports multicast.
-.It Dv IFF_POLLING
+.It Dv IFF_CANTCONFIG
+.Aq S*
+The interface is not configurable in a meaningful way.
+Primarily useful for
+.Dv IFT_USB
+interfaces registered at the interface list.
+.It Dv IFF_MONITOR
+.Aq D
+This interface blocks transmission of packets and discards incoming
+packets after BPF processing.
+Used to monitor network trafic but not interact
+with the network in question.
+.It Dv IFF_STATICARP
+.Aq D
+Used to enable/disable ARP requests on this interface.
+.It Dv IFF_DYING
.Aq D*
-The interface is in
-.Xr polling 4
-mode.
-See
-.Sx Interface Capabilities Flags
-for details.
+Set when the
+.Vt ifnet
+structure of this interface is being released and still has
+.Va if_refcount
+references.
+.It Dv IFF_RENAMING
+.Aq D*
+Set when this interface is being renamed.
.El
.Ss "Interface Capabilities Flags"
Interface capabilities are specialized features an interface may
@@ -555,13 +685,7 @@ Userland code shall use
.Xr ioctl 2 .
.Pp
The following capabilities are currently supported by the system:
-.Bl -tag -width ".Dv IFCAP_VLAN_HWTAGGING" -offset indent
-.It Dv IFCAP_NETCONS
-This interface can be a network console.
-.It Dv IFCAP_POLLING
-This interface supports
-.Xr polling 4 .
-See below for details.
+.Bl -tag -width ".Dv IFCAP_POLLING_NOCOUNT" -offset indent
.It Dv IFCAP_RXCSUM
This interface can do checksum validation on receiving data.
Some interfaces do not have sufficient buffer storage to store frames
@@ -573,9 +697,8 @@ This interface can do checksum calculation on transmitting data.
.It Dv IFCAP_HWCSUM
A shorthand for
.Pq Dv IFCAP_RXCSUM | IFCAP_TXCSUM .
-.It Dv IFCAP_VLAN_HWTAGGING
-This interface can do VLAN tagging on output and
-demultiplex frames by their VLAN tag on input.
+.It Dv IFCAP_NETCONS
+This interface can be a network console.
.It Dv IFCAP_VLAN_MTU
The
.Xr vlan 4
@@ -585,22 +708,35 @@ without having to decrease MTU on
interfaces below 1500 bytes.
This implies the ability of this interface to cope with frames somewhat
longer than permitted by the Ethernet specification.
+.It Dv IFCAP_VLAN_HWTAGGING
+This interface can do VLAN tagging on output and
+demultiplex frames by their VLAN tag on input.
.It Dv IFCAP_JUMBO_MTU
This Ethernet interface can transmit and receive frames up to
9000 bytes long.
+.It Dv IFCAP_POLLING
+This interface supports
+.Xr polling 4 .
+See below for details.
+.It Dv IFCAP_VLAN_HWCSUM
+This interface can do checksum calculation on both transmitting
+and receiving data on
+.Xr vlan 4
+interfaces (implies
+.Dv IFCAP_HWCSUM ) .
.It Dv IFCAP_TSO4
-This Ethernet interface supports TCP Segmentation offloading.
+This Ethernet interface supports TCP4 Segmentation offloading.
.It Dv IFCAP_TSO6
This Ethernet interface supports TCP6 Segmentation offloading.
.It Dv IFCAP_TSO
-A shorthand for
+A shorthand for
.Pq Dv IFCAP_TSO4 | IFCAP_TSO6 .
.It Dv IFCAP_TOE4
This Ethernet interface supports TCP offloading.
.It Dv IFCAP_TOE6
This Ethernet interface supports TCP6 offloading.
-.It Dv ICAP_TOE
-A Shorthand for
+.It Dv IFCAP_TOE
+A shorthand for
.Pq Dv IFCAP_TOE4 | IFCAP_TOE6 .
.It Dv IFCAP_WOL_UCAST
This Ethernet interface supports waking up on any Unicast packet.
@@ -613,6 +749,27 @@ as those sent by
.It Dv IFCAP_WOL
A shorthand for
.Pq Dv IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC .
+.It Dv IFCAP_TOE4
+This Ethernet interface supports TCP4 Offload Engine.
+.It Dv IFCAP_TOE6
+This Ethernet interface supports TCP6 Offload Engine.
+.It Dv IFCAP_TOE
+A shorthand for
+.Pq Dv IFCAP_TOE4 | IFCAP_TOE6 .
+.It Dv IFCAP_VLAN_HWFILTER
+This interface supports frame filtering in hardware on
+.Xr vlan 4
+interfaces.
+.It Dv IFCAP_POLLING_NOCOUNT
+The return value for the number of processed packets should be
+skipped for this interface.
+.It Dv IFCAP_VLAN_HWTSO
+This interface supports TCP Segmentation offloading on
+.Xr vlan 4
+interfaces (implies
+.Dv IFCAP_TSO ) .
+.It Dv IFCAP_LINKSTATE
+This Ethernet interface supports dynamic link state changes.
.El
.Pp
The ability of advanced network interfaces to offload certain
@@ -668,20 +825,7 @@ The capability of a network interface to operate in
.Xr polling 4
mode involves several flags in different
global variables and per-interface fields.
-First, there is a system-wide
-.Xr sysctl 8
-master switch named
-.Va kern.polling.enable ,
-which can toggle
-.Xr polling 4
-globally.
-If that variable is set to non-zero,
-.Xr polling 4
-will be used on those devices where it is enabled individually.
-Otherwise,
-.Xr polling 4
-will not be used in the system.
-Second, the capability flag
+The capability flag
.Dv IFCAP_POLLING
set in interface's
.Va if_capabilities
@@ -691,29 +835,29 @@ on the particular interface.
If set in
.Va if_capabilities ,
the same flag can be marked or cleared in the interface's
-.Va if_capenable ,
+.Va if_capenable
+within
+.Fn ifioctl ,
thus initiating switch of the interface to
.Xr polling 4
mode or interrupt
mode, respectively.
-The actual mode change will occur at an implementation-specific moment
-in the future, e.g., during the next interrupt or
-.Xr polling 4
-cycle.
-And finally, if the mode transition has been successful, the flag
-.Dv IFF_POLLING
-is marked or cleared in the interface's
-.Va if_flags
-to indicate the current mode of the interface.
+The actual mode change is managed by the driver-specific
+.Fn if_ioctl
+routine.
+The
+.Xr polling
+handler returns the number of packets processed.
.Ss The Vt if_data Ss Structure
-In
-.Bx 4.4 ,
-a subset of the interface information believed to be of interest to
-management stations was segregated from the
-.Vt ifnet
-structure and moved into its own
+The
.Vt if_data
-structure to facilitate its use by user programs.
+structure contains statistics and identifying information used
+by management programs, and which is exported to user programs by way
+of the
+.Xr ifmib 4
+branch of the
+.Xr sysctl 3
+MIB.
The following elements of the
.Vt if_data
structure are initialized by the interface and are not expected to change
@@ -749,18 +893,6 @@ to attempt to ensure that there is always
sufficient space to prepend a link-layer header without allocating an
additional
.Vt mbuf .
-.\" (See
-.\" .Xr mbuf 9 . )
-.\" .It Va ifi_recvquota
-.\" .Pq Vt u_char
-.\" Number of packets the interface is permitted to receive at one time
-.\" when in polled mode.
-.\" .It Va ifi_xmitquota
-.\" .Pq Vt u_char
-.\" Number of packets the interface is permitted to queue for transmission
-.\" at one time when in polled mode.
-.\" There is some controversy over
-.\" whether such a restriction makes any sense at all.
.It Va ifi_datalen
.Pq Vt u_char
Length of the
@@ -841,18 +973,6 @@ Number of packets dropped on input.
Rarely implemented.
.It Va ifi_noproto
Number of packets received for unknown network-layer protocol.
-.\" .It Va ifi_recvtiming
-.\" Amount of time, in microseconds, spent to receive an average packet on
-.\" this interface.
-.\" See the
-.\" .Sx Polling
-.\" section, below.
-.\" .It Va ifi_xmittiming
-.\" Amount of time, in microseconds, spent to service a transmit-complete
-.\" interrupt on this interface.
-.\" See the
-.\" .Sx Polling
-.\" section, below.
.It Va ifi_lastchange
.Pq Vt "struct timeval"
The time of the last administrative change to the interface (as required
@@ -895,6 +1015,8 @@ Parallel-port IP
.Pq Dq Tn PLIP
.It Dv IFT_ATM
Asynchronous Transfer Mode
+.It Dv IFT_USB
+USB Interface
.El
.Ss Interface Link States
The following link states are currently defined:
@@ -978,35 +1100,29 @@ external routing protocol.
.Pp
References to
.Vt ifaddr
-structures are gained manually, by incrementing the
-.Va ifa_refcnt
-member.
-References are released by calling either the
-.Fn ifafree
-function or the
-.Fn IFAFREE
-macro.
+structures are gained by calling the
+.Fn ifa_ref
+function and released by calling the
+.Fn ifa_free
+function.
.Pp
.Fn ifa_rtrequest
is a pointer to a function which receives callouts from the routing
code
.Pq Fn rtrequest
-to perform link-layer-specific actions upon requests to add, resolve,
+to perform link-layer-specific actions upon requests to add,
or delete routes.
The
.Fa cmd
argument indicates the request in question:
-.Dv RTM_ADD , RTM_RESOLVE ,
+.Dv RTM_ADD ,
or
.Dv RTM_DELETE .
The
.Fa rt
argument is the route in question; the
-.Fa dst
-argument is the specific destination being manipulated
-for
-.Dv RTM_RESOLVE ,
-or a null pointer otherwise.
+.Fa info
+argument contains the specific destination being manipulated.
.Sh FUNCTIONS
The functions provided by the generic interface code can be divided
into two groups: those which manipulate interfaces, and those which
@@ -1066,8 +1182,11 @@ addresses on that interface, and create a link-layer
.Vt ifaddr
structure to be the first element in that list.
(A pointer to
-this address structure is saved in the global array
-.Va ifnet_addrs . )
+this address structure is saved in the
+.Vt ifnet
+structure and shall be accessed by the
+.Fn ifaddr_byindex
+function.)
The
.Fa ifp
must have been allocated by
@@ -1132,6 +1251,17 @@ Return an
.Vt ifnet
pointer for the interface named
.Fa name .
+.It Fn ifunit_ref
+Return a reference-counted (via
+.Fn ifa_ref )
+.Vt ifnet
+pointer for the interface named
+.Fa name .
+This is the preferred function over
+.Fn ifunit .
+The caller is responsible for releasing the reference with
+.Fn if_rele
+when it is finished with the ifnet.
.It Fn ifioctl
Process the ioctl request
.Fa cmd ,
@@ -1245,10 +1375,8 @@ or
.Fn if_delmulti
function is called to perform the operation; qq.v.
.Pp
-.It Dv SIOCSIFDSTADDR
-.It Dv SIOCSIFADDR
-.It Dv SIOCSIFBRDADDR
-.It Dv SIOCSIFNETMASK
+.It Dv SIOCAIFADDR
+.It Dv SIOCDIFADDR
The socket's protocol control routine is called to implement the
requested action.
.Pp
@@ -1296,6 +1424,9 @@ subject to its configured netmask, or a point-to-point interface
address whose remote address is
.Fa addr
if one is found.
+If
+.Fa ignore_ptp
+is true, skip point-to-point interface addresses.
.Pp
.Fn ifaof_ifpforaddr
returns the most specific address configured on interface
@@ -1309,6 +1440,10 @@ precisely
.Fa addr
will be returned.
.Pp
+.Fn ifaddr_byindex
+returns the link-level address of the interface with the given index
+.Fa idx .
+.Pp
All of these functions return a null pointer if no such address can be
found.
.Ss "Interface Multicast Address Functions"
@@ -1316,7 +1451,7 @@ The
.Fn if_addmulti ,
.Fn if_delmulti ,
and
-.Fn ifmaof_ifpforaddr
+.Fn if_findmulti
functions provide support for requesting and relinquishing multicast
group memberships, and for querying an interface's membership list,
respectively.
@@ -1373,11 +1508,11 @@ Both functions return zero on success, or a
standard error number on failure.
.Pp
The
-.Fn ifmaof_ifpforaddr
+.Fn if_findmulti
function examines the membership list of interface
.Fa ifp
for an address matching
-.Fa addr ,
+.Fa sa ,
and returns a pointer to that
.Vt "struct ifmultiaddr"
if one is found, else it returns a null pointer.
diff --git a/share/man/man9/kproc.9 b/share/man/man9/kproc.9
index a20ab70..613ac31 100644
--- a/share/man/man9/kproc.9
+++ b/share/man/man9/kproc.9
@@ -77,8 +77,8 @@ A new family of
.Fn kthread_* 9
functions was added to produce
.Em real
-kernel
-.Em threads .
+kernel
+.Em threads .
See the
.Xr kthread 9
man page for more information on those calls.
@@ -227,7 +227,7 @@ The actual suspension of the kernel process is done with
.Pp
The
.Fn kproc_kthread_add
-function is much like the
+function is much like the
.Fn kproc_create
function above except that if the kproc already exists,
then only a new thread (see
diff --git a/share/man/man9/kqueue.9 b/share/man/man9/kqueue.9
index 8f0d109..555fe54 100644
--- a/share/man/man9/kqueue.9
+++ b/share/man/man9/kqueue.9
@@ -24,14 +24,14 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 5, 2011
+.Dd March 26, 2012
.Dt KQUEUE 9
.Os
.Sh NAME
.Nm kqueue_add_filteropts , kqueue_del_filteropts ,
.Nm kqfd_register ,
.Nm knote_fdclose ,
-.Nm knlist_init , knlist_init_mtx ,
+.Nm knlist_init , knlist_init_mtx , knlist_init_rw_reader ,
.Nm knlist_add , knlist_remove , knlist_remove_inevent , knlist_empty ,
.Nm knlist_clear , knlist_delete , knlist_destroy ,
.Nm KNOTE_LOCKED , KNOTE_UNLOCKED
@@ -57,6 +57,8 @@
.Ft void
.Fn knlist_init_mtx "struct knlist *knl" "struct mtx *lock"
.Ft void
+.Fn knlist_init_rw_reader "struct knlist *knl" "struct rwlock *lock"
+.Ft void
.Fn knlist_add "struct knlist *knl" "struct knote *kn" "int islocked"
.Ft void
.Fn knlist_remove "struct knlist *knl" "struct knote *kn" "int islocked"
@@ -259,8 +261,10 @@ If used, the
.Vt knlist
must be initialized with either
.Fn knlist_init
+,
+.Fn knlist_init_mtx
or
-.Fn knlist_init_mtx .
+.Fn knlist_init_rw_reader .
The
.Vt knlist
structure may be embedded into the object structure.
@@ -294,7 +298,7 @@ locks will be used instead.
.Pp
The function
.Fn knlist_init_mtx
-may be used to initalize a
+may be used to initialize a
.Vt knlist
when
.Fa lock
@@ -305,6 +309,19 @@ style
lock.
.Pp
The function
+.Fn knlist_init_rw_reader
+may be used to initialize a
+.Vt knlist
+when
+.Fa lock
+is a
+.Xr rwlock 9
+read lock.
+Lock is acquired via
+.Fn rw_rlock
+function.
+.Pp
+The function
.Fn knlist_empty
returns true when there are no
.Vt knotes
diff --git a/share/man/man9/kthread.9 b/share/man/man9/kthread.9
index d2c770b..25a20ce 100644
--- a/share/man/man9/kthread.9
+++ b/share/man/man9/kthread.9
@@ -82,7 +82,7 @@ kernel threads.
See the
.Xr kproc 9
man page for more information on the renamed calls.
-Also note that the
+Also note that the
.Fn kproc_kthread_add 9
function appears in both pages as its functionality is split.
.Pp
@@ -184,11 +184,11 @@ member of the new thread's
.Pp
The
.Fn kproc_kthread_add
-function is much like the
+function is much like the
.Fn kthread_add
function above except that if the kproc does not already
-exist, it is created.
-This function is better documented in the
+exist, it is created.
+This function is better documented in the
.Xr kproc 9
manual page.
.Pp
diff --git a/share/man/man9/lock.9 b/share/man/man9/lock.9
index 049de42..0e5cfb1 100644
--- a/share/man/man9/lock.9
+++ b/share/man/man9/lock.9
@@ -299,7 +299,6 @@ Assert that the current thread has a recursed lock on
Assert that the current thread does not have a recursed lock on
.Fa lkp .
.El
-.Pp
.Sh RETURN VALUES
The
.Fn lockmgr
@@ -364,7 +363,7 @@ or
the
.Fa ilk
must be held prior to calling
-.Fn lockmgr
+.Fn lockmgr
or
.Fn lockmgr_rw ,
and will be returned unlocked.
diff --git a/share/man/man9/locking.9 b/share/man/man9/locking.9
index 4a54800..00478bf 100644
--- a/share/man/man9/locking.9
+++ b/share/man/man9/locking.9
@@ -82,7 +82,7 @@ since it may modify protected data.
Reader/writer locks can be treated as mutexes (see above and
.Xr mutex 9 )
with shared/exclusive semantics.
-More specifically, regular mutexes can be
+More specifically, regular mutexes can be
considered to be equivalent to a write-lock on an
.Em rw_lock.
The
@@ -94,7 +94,7 @@ are anonymous.
Another important property is that shared holders of
.Em rw_lock
can recurse, but exclusive locks are not allowed to recurse.
-This ability should not be used lightly and
+This ability should not be used lightly and
.Em may go away.
.Pp
See
@@ -122,7 +122,7 @@ and read-mostly locks.
They don't support priority propagation.
They should be considered to be closely related to
.Xr sleep 9 .
-In fact it could in some cases be
+In fact it could in some cases be
considered a conditional sleep.
.Pp
See
@@ -235,7 +235,6 @@ mutex before the function returns.
See
.Xr sleep 9
for details.
-.Pp
.Ss Lockmanager locks
Shared/exclusive locks, used mostly in
.Xr VFS 9 ,
@@ -294,9 +293,7 @@ running inside an interrupt thread.
The following table shows what you can and can not do while holding
one of the synchronization primitives discussed:
.Bl -column ".Ic xxxxxxxxxxxxxxxxxxx" ".Xr XXXXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXX" -offset indent
-.It Xo
-.Em "You have: You want:" Ta spin mtx Ta mutex Ta sx Ta rwlock Ta rmlock Ta sleep
-.Xc
+.It Em "You have: You want:" Ta spin mtx Ta mutex Ta sx Ta rwlock Ta rmlock Ta sleep
.It spin mtx Ta \&ok-1 Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no-3
.It mutex Ta \&ok Ta \&ok-1 Ta \&no Ta \&ok Ta \&ok Ta \&no-3
.It sx Ta \&ok Ta \&ok Ta \&ok-2 Ta \&ok Ta \&ok Ta \&ok-4
@@ -337,13 +334,11 @@ for details.
The next table shows what can be used in different contexts.
At this time this is a rather easy to remember table.
.Bl -column ".Ic Xxxxxxxxxxxxxxxxxxx" ".Xr XXXXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXX" -offset indent
-.It Xo
-.Em "Context:" Ta spin mtx Ta mutex Ta sx Ta rwlock Ta rmlock Ta sleep
-.Xc
-.It interrupt filter: Ta \&ok Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no
-.It interrupt thread: Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&ok Ta \&no
-.It callout: Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&no Ta \&no
-.It syscall: Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok
+.It Em "Context:" Ta spin mtx Ta mutex Ta sx Ta rwlock Ta rmlock Ta sleep
+.It interrupt filter: Ta \&ok Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no
+.It interrupt thread: Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&ok Ta \&no
+.It callout: Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&no Ta \&no
+.It syscall: Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok
.El
.Sh SEE ALSO
.Xr witness 4 ,
diff --git a/share/man/man9/make_dev.9 b/share/man/man9/make_dev.9
index dad08ed..2827235 100644
--- a/share/man/man9/make_dev.9
+++ b/share/man/man9/make_dev.9
@@ -369,7 +369,6 @@ The
.Dv MAKEDEV_CHECKNAME
flag was specified and the provided device name already exists.
.El
-.Pp
.Sh SEE ALSO
.Xr devctl 4 ,
.Xr devfs 5 ,
diff --git a/share/man/man9/malloc.9 b/share/man/man9/malloc.9
index ff6b4d2..7490939 100644
--- a/share/man/man9/malloc.9
+++ b/share/man/man9/malloc.9
@@ -29,7 +29,7 @@
.\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $
.\" $FreeBSD$
.\"
-.Dd October 23, 2008
+.Dd January 28, 2012
.Dt MALLOC 9
.Os
.Sh NAME
@@ -123,6 +123,9 @@ operational characteristics as follows:
.Bl -tag -width indent
.It Dv M_ZERO
Causes the allocated memory to be set to all zeros.
+.It Dv M_NODUMP
+For allocations greater than page size, causes the allocated
+memory to be excluded from kernel core dumps.
.It Dv M_NOWAIT
Causes
.Fn malloc ,
diff --git a/share/man/man9/mbchain.9 b/share/man/man9/mbchain.9
index f9a4521..4e05e7a 100644
--- a/share/man/man9/mbchain.9
+++ b/share/man/man9/mbchain.9
@@ -66,15 +66,15 @@
.Ft caddr_t
.Fn mb_reserve "struct mbchain *mbp" "int size"
.Ft int
-.Fn mb_put_uint8 "struct mbchain *mbp" "u_int8_t x"
+.Fn mb_put_uint8 "struct mbchain *mbp" "uint8_t x"
.Ft int
-.Fn mb_put_uint16be "struct mbchain *mbp" "u_int16_t x"
+.Fn mb_put_uint16be "struct mbchain *mbp" "uint16_t x"
.Ft int
-.Fn mb_put_uint16le "struct mbchain *mbp" "u_int16_t x"
+.Fn mb_put_uint16le "struct mbchain *mbp" "uint16_t x"
.Ft int
-.Fn mb_put_uint32be "struct mbchain *mbp" "u_int32_t x"
+.Fn mb_put_uint32be "struct mbchain *mbp" "uint32_t x"
.Ft int
-.Fn mb_put_uint32le "struct mbchain *mbp" "u_int32_t x"
+.Fn mb_put_uint32le "struct mbchain *mbp" "uint32_t x"
.Ft int
.Fn mb_put_int64be "struct mbchain *mbp" "int64_t x"
.Ft int
diff --git a/share/man/man9/mbuf_tags.9 b/share/man/man9/mbuf_tags.9
index d84c56b..d9627e8 100644
--- a/share/man/man9/mbuf_tags.9
+++ b/share/man/man9/mbuf_tags.9
@@ -29,7 +29,7 @@
.Sh SYNOPSIS
.In sys/mbuf.h
.Ft "struct m_tag *"
-.Fn m_tag_alloc "u_int32_t cookie" "int type" "int len" "int wait"
+.Fn m_tag_alloc "uint32_t cookie" "int type" "int len" "int wait"
.Ft "struct m_tag *"
.Fn m_tag_copy "struct m_tag *t" "int how"
.Ft int
@@ -51,7 +51,7 @@
.Ft void
.Fn m_tag_init "struct mbuf *m"
.Ft struct m_tag *
-.Fn m_tag_locate "struct mbuf *m" "u_int32_t cookie" "int type" "struct m_tag *t"
+.Fn m_tag_locate "struct mbuf *m" "uint32_t cookie" "int type" "struct m_tag *t"
.Ft "struct m_tag *"
.Fn m_tag_next "struct mbuf *m" "struct m_tag *t"
.Ft void
@@ -100,9 +100,9 @@ bytes of a tag contain a
.Bd -literal
struct m_tag {
SLIST_ENTRY(m_tag) m_tag_link; /* List of packet tags */
- u_int16_t m_tag_id; /* Tag ID */
- u_int16_t m_tag_len; /* Length of data */
- u_int32_t m_tag_cookie; /* ABI/Module ID */
+ uint16_t m_tag_id; /* Tag ID */
+ uint16_t m_tag_len; /* Length of data */
+ uint32_t m_tag_cookie; /* ABI/Module ID */
void (*m_tag_free)(struct m_tag *);
};
.Ed
diff --git a/share/man/man9/mdchain.9 b/share/man/man9/mdchain.9
index 57291c7..5b0bf4a 100644
--- a/share/man/man9/mdchain.9
+++ b/share/man/man9/mdchain.9
@@ -63,19 +63,19 @@
.Ft int
.Fn md_next_record "struct mdchain *mdp"
.Ft int
-.Fn md_get_uint8 "struct mdchain *mdp" "u_int8_t *x"
+.Fn md_get_uint8 "struct mdchain *mdp" "uint8_t *x"
.Ft int
-.Fn md_get_uint16 "struct mdchain *mdp" "u_int16_t *x"
+.Fn md_get_uint16 "struct mdchain *mdp" "uint16_t *x"
.Ft int
-.Fn md_get_uint16be "struct mdchain *mdp" "u_int16_t *x"
+.Fn md_get_uint16be "struct mdchain *mdp" "uint16_t *x"
.Ft int
-.Fn md_get_uint16le "struct mdchain *mdp" "u_int16_t *x"
+.Fn md_get_uint16le "struct mdchain *mdp" "uint16_t *x"
.Ft int
-.Fn md_get_uint32 "struct mdchain *mdp" "u_int32_t *x"
+.Fn md_get_uint32 "struct mdchain *mdp" "uint32_t *x"
.Ft int
-.Fn md_get_uint32be "struct mdchain *mdp" "u_int32_t *x"
+.Fn md_get_uint32be "struct mdchain *mdp" "uint32_t *x"
.Ft int
-.Fn md_get_uint32le "struct mdchain *mdp" "u_int32_t *x"
+.Fn md_get_uint32le "struct mdchain *mdp" "uint32_t *x"
.Ft int
.Fn md_get_int64 "struct mdchain *mdp" "int64_t *x"
.Ft int
@@ -193,8 +193,8 @@ function can safely be called to destroy it.
.Bd -literal
struct mdchain *mdp;
struct mbuf *m;
-u_int16_t length;
-u_int8_t byte;
+uint16_t length;
+uint8_t byte;
receive(so, &m);
md_initm(mdp, m);
diff --git a/share/man/man9/mi_switch.9 b/share/man/man9/mi_switch.9
index 2f82b5a..46e7a8e 100644
--- a/share/man/man9/mi_switch.9
+++ b/share/man/man9/mi_switch.9
@@ -62,7 +62,7 @@ From within a function such as
.Xr cv_wait 9 ,
.Xr mtx_lock ,
or
-.Xr tsleep 9
+.Xr tsleep 9
when the current thread
voluntarily relinquishes the CPU to wait for some resource or lock to become
available.
diff --git a/share/man/man9/namei.9 b/share/man/man9/namei.9
index c941004..1ba475a 100644
--- a/share/man/man9/namei.9
+++ b/share/man/man9/namei.9
@@ -33,7 +33,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 21, 2005
+.Dd March 1, 2012
.Dt NAMEI 9
.Os
.Sh NAME
@@ -196,10 +196,6 @@ With this flag,
will follow the symbolic link if the last part
of the path supplied is a symbolic link (i.e., it will return a vnode
for whatever the link points at, instead for the link itself).
-.It Dv NOOBJ
-Do not call
-.Fn vfs_object_create
-for the returned vnode, even though it meets required criteria for VM support.
.It Dv NOFOLLOW
Do not follow symbolic links (pseudo).
This flag is not looked for by the actual code, which looks for
@@ -344,6 +340,13 @@ permissions.
Too many symbolic links were encountered in translating the pathname.
.It Bq Er EISDIR
An attempt is made to open a directory with write mode specified.
+.It Bq Er EINVAL
+The last component of the pathname specified for a
+.Dv DELETE
+or
+.Dv RENAME
+operation is
+.Ql \&. .
.It Bq Er EROFS
An attempt is made to modify a file or directory on a read-only file system.
.El
diff --git a/share/man/man9/netisr.9 b/share/man/man9/netisr.9
index ee6fbed..bb64b0e 100644
--- a/share/man/man9/netisr.9
+++ b/share/man/man9/netisr.9
@@ -50,7 +50,7 @@
.Ft void
.Fn netisr_clearqdrops "const struct netisr_handler *nhp"
.Ft void
-.Fn netisr_getqdrops "const struct netisr_handler *nhp" "u_int64_t *qdropsp"
+.Fn netisr_getqdrops "const struct netisr_handler *nhp" "uint64_t *qdropsp"
.Ft void
.Fn netisr_getqlimit "const struct netisr_handler *nhp" "u_int *qlimitp"
.Ft int
diff --git a/share/man/man9/osd.9 b/share/man/man9/osd.9
index 871575c..ba9c632 100644
--- a/share/man/man9/osd.9
+++ b/share/man/man9/osd.9
@@ -125,7 +125,7 @@ and remains valid until a corresponding call to
.Ss Functions
The
.Fn osd_register
-function registers a type/slot identifier pair with the
+function registers a type/slot identifier pair with the
.Nm
framework for use with a new data type.
The function may sleep and therefore cannot be called from a non-sleepable
diff --git a/share/man/man9/pci.9 b/share/man/man9/pci.9
index d8ed624..4089ee8 100644
--- a/share/man/man9/pci.9
+++ b/share/man/man9/pci.9
@@ -25,55 +25,109 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 30, 2007
+.Dd March 5, 2012
.Dt PCI 9
.Os
.Sh NAME
.Nm pci ,
-.Nm pci_read_config ,
-.Nm pci_write_config ,
-.Nm pci_enable_busmaster ,
+.Nm pci_alloc_msi ,
+.Nm pci_alloc_msix ,
.Nm pci_disable_busmaster ,
-.Nm pci_enable_io ,
.Nm pci_disable_io ,
-.Nm pci_set_powerstate ,
-.Nm pci_get_powerstate ,
+.Nm pci_enable_busmaster ,
+.Nm pci_enable_io ,
.Nm pci_find_bsf ,
+.Nm pci_find_cap ,
.Nm pci_find_dbsf ,
-.Nm pci_find_device
+.Nm pci_find_device ,
+.Nm pci_find_extcap ,
+.Nm pci_find_htcap ,
+.Nm pci_get_max_read_req ,
+.Nm pci_get_powerstate ,
+.Nm pci_get_vpd_ident ,
+.Nm pci_get_vpd_readonly ,
+.Nm pci_msi_count ,
+.Nm pci_msix_count ,
+.Nm pci_pending_msix ,
+.Nm pci_read_config ,
+.Nm pci_release_msi ,
+.Nm pci_remap_msix ,
+.Nm pci_restore_state ,
+.Nm pci_save_state ,
+.Nm pci_set_max_read_req ,
+.Nm pci_set_powerstate ,
+.Nm pci_write_config
.Nd PCI bus interface
.Sh SYNOPSIS
.In sys/bus.h
-.In dev/pci/pcivar.h
.In dev/pci/pcireg.h
-.In machine/pci_cfgreg.h
-.Ft void
-.Fn pci_write_config "device_t dev" "int reg" "uint32_t val" "int width"
+.In dev/pci/pcivar.h
.Ft int
-.Fn pci_enable_busmaster "device_t dev"
+.Fn pci_alloc_msi "device_t dev" "int *count"
.Ft int
-.Fn pci_disable_busmaster "device_t dev"
+.Fn pci_alloc_msix "device_t dev" "int *count"
.Ft int
-.Fn pci_enable_io "device_t dev" "int space"
+.Fn pci_disable_busmaster "device_t dev"
.Ft int
.Fn pci_disable_io "device_t dev" "int space"
.Ft int
-.Fn pci_set_powerstate "device_t dev" "int state"
+.Fn pci_enable_busmaster "device_t dev"
.Ft int
-.Fn pci_get_powerstate "device_t dev"
-.Ft uint32_t
-.Fn pci_read_config "device_t dev" "int reg" "int width"
+.Fn pci_enable_io "device_t dev" "int space"
.Ft device_t
.Fn pci_find_bsf "uint8_t bus" "uint8_t slot" "uint8_t func"
+.Ft int
+.Fn pci_find_cap "device_t dev" "int capability" "int *capreg"
.Ft device_t
.Fn pci_find_dbsf "uint32_t domain" "uint8_t bus" "uint8_t slot" "uint8_t func"
.Ft device_t
.Fn pci_find_device "uint16_t vendor" "uint16_t device"
+.Ft int
+.Fn pci_find_extcap "device_t dev" "int capability" "int *capreg"
+.Ft int
+.Fn pci_find_htcap "device_t dev" "int capability" "int *capreg"
+.Ft int
+.Fn pci_get_max_read_req "device_t dev"
+.Ft int
+.Fn pci_get_powerstate "device_t dev"
+.Ft int
+.Fn pci_get_vpd_ident "device_t dev" "const char **identptr"
+.Ft int
+.Fn pci_get_vpd_readonly "device_t dev" "const char *kw" "const char **vptr"
+.Ft int
+.Fn pci_msi_count "device_t dev"
+.Ft int
+.Fn pci_msix_count "device_t dev"
+.Ft int
+.Fn pci_pending_msix "device_t dev" "u_int index"
+.Ft uint32_t
+.Fn pci_read_config "device_t dev" "int reg" "int width"
+.Ft int
+.Fn pci_release_msi "device_t dev"
+.Ft int
+.Fn pci_remap_msix "device_t dev" "int count" "const u_int *vectors"
+.Ft void
+.Fn pci_restore_state "device_t dev"
+.Ft void
+.Fn pci_save_state "device_t dev"
+.Ft int
+.Fn pci_set_max_read_req "device_t dev" "int size"
+.Ft int
+.Fn pci_set_powerstate "device_t dev" "int state"
+.Ft void
+.Fn pci_write_config "device_t dev" "int reg" "uint32_t val" "int width"
.Sh DESCRIPTION
The
.Nm
set of functions are used for managing PCI devices.
-.Pp
+The functions are split into several groups:
+raw configuration access,
+locating devices,
+device information,
+device configuration,
+and
+message signaled interrupts.
+.Ss Raw Configuration Access
The
.Fn pci_read_config
function is used to read data from the PCI configuration
@@ -98,6 +152,169 @@ with
.Fa width
specifying the size of the access.
.Pp
+.Em NOTE :
+Device drivers should only use these functions for functionality that
+is not available via another
+.Fn pci
+function.
+.Ss Locating Devices
+The
+.Fn pci_find_bsf
+function looks up the
+.Vt device_t
+of a PCI device, given its
+.Fa bus ,
+.Fa slot ,
+and
+.Fa func .
+The
+.Fa slot
+number actually refers to the number of the device on the bus,
+which does not necessarily indicate its geographic location
+in terms of a physical slot.
+Note that in case the system has multiple PCI domains,
+the
+.Fn pci_find_bsf
+function only searches the first one.
+Actually, it is equivalent to:
+.Bd -literal -offset indent
+pci_find_dbsf(0, bus, slot, func);
+.Ed
+.Pp
+The
+.Fn pci_find_dbsf
+function looks up the
+.Vt device_t
+of a PCI device, given its
+.Fa domain ,
+.Fa bus ,
+.Fa slot ,
+and
+.Fa func .
+The
+.Fa slot
+number actually refers to the number of the device on the bus,
+which does not necessarily indicate its geographic location
+in terms of a physical slot.
+.Pp
+The
+.Fn pci_find_device
+function looks up the
+.Vt device_t
+of a PCI device, given its
+.Fa vendor
+and
+.Fa device
+IDs.
+Note that there can be multiple matches for this search; this function
+only returns the first matching device.
+.Ss Device Information
+The
+.Fn pci_find_cap
+function is used to locate the first instance of a PCI capability
+register set for the device
+.Fa dev .
+The capability to locate is specified by ID via
+.Fa capability .
+Constant macros of the form
+.Dv PCIY_xxx
+for standard capability IDs are defined in
+.In dev/pci/pcireg.h .
+If the capability is found, then
+.Fa *capreg
+is set to the offset in configuration space of the capability register set,
+and
+.Fn pci_find_cap
+returns zero.
+If the capability is not found or the device does not support capabilities,
+.Fn pci_find_cap
+returns an error.
+.Pp
+The
+.Fn pci_find_extcap
+function is used to locate the first instance of a PCI-express
+extended capability register set for the device
+.Fa dev .
+The extended capability to locate is specified by ID via
+.Fa capability .
+Constant macros of the form
+.Dv PCIZ_xxx
+for standard extended capability IDs are defined in
+.In dev/pci/pcireg.h .
+If the extended capability is found, then
+.Fa *capreg
+is set to the offset in configuration space of the extended capability
+register set, and
+.Fn pci_find_extcap
+returns zero.
+If the extended capability is not found or the device is not a
+PCI-express device,
+.Fn pci_find_extcap
+returns an error.
+.Pp
+The
+.Fn pci_find_htcap
+function is used to locate the first instance of a HyperTransport capability
+register set for the device
+.Fa dev .
+The capability to locate is specified by type via
+.Fa capability .
+Constant macros of the form
+.Dv PCIM_HTCAP_xxx
+for standard HyperTransport capability types are defined in
+.In dev/pci/pcireg.h .
+If the capability is found, then
+.Fa *capreg
+is set to the offset in configuration space of the capability register set,
+and
+.Fn pci_find_htcap
+returns zero.
+If the capability is not found or the device is not a HyperTransport device,
+.Fn pci_find_htcap
+returns an error.
+.Pp
+The
+.Fn pci_get_vpd_ident
+function is used to fetch a device's Vital Product Data
+.Pq VPD
+identifier string.
+If the device
+.Fa dev
+supports VPD and provides an identifier string,
+then
+.Fa *identptr
+is set to point at a read-only, null-terminated copy of the identifier
+string,
+and
+.Fn pci_get_vpd_ident
+returns zero.
+If the device does not support VPD or does not provide an identifier
+string,
+then
+.Fn pci_get_vpd_ident
+returns an error.
+.Pp
+The
+.Fn pci_get_vpd_readonly
+function is used to fetch the value of a single VPD read-only keyword
+for the device
+.Fa dev .
+The keyword to fetch is identified by the two character string
+.Fa kw .
+If the device supports VPD and provides a read-only value for the
+requested keyword,
+then
+.Fa *vptr
+is set to point at a read-only, null-terminated copy of the value,
+and
+.Fn pci_get_vpd_readonly
+returns zero.
+If the device does not support VPD or does not provide the requested
+keyword,
+then
+.Fn pci_get_vpd_readonly
+returns an error.
+.Ss Device Configuration
The
.Fn pci_enable_busmaster
function enables PCI bus mastering for the device
@@ -132,20 +349,51 @@ argument specifies which resource is affected; this can be either
or
.Dv SYS_RES_IOPORT
as appropriate.
+Device drivers should generally not use these routines directly.
+The PCI bus will enable decoding automatically when a
+.Dv SYS_RES_MEMORY
+or
+.Dv SYS_RES_IOPORT
+resource is activated via
+.Xr bus_alloc_resource 9
+or
+.Xr bus_activate_resource 9 .
.Pp
-.Em NOTE :
-These functions should be used in preference to manually manipulating
-the configuration space.
+The
+.Fn pci_get_max_read_req
+function returns the current maximum read request size in bytes for a
+PCI-express device.
+If the
+.Fa dev
+device is not a PCI-express device,
+.Fn pci_get_max_read_req
+returns zero.
+.Pp
+The
+.Fn pci_set_max_read_req
+sets the PCI-express maximum read request size for
+.Fa dev .
+The requested
+.Fa size
+may be adjusted,
+and
+.Fn pci_set_max_read_req
+returns the actual size set in bytes.
+If the
+.Fa dev
+device is not a PCI-express device,
+.Fn pci_set_max_read_req
+returns zero.
.Pp
The
.Fn pci_get_powerstate
-function returns the current ACPI power state of the device
+function returns the current power state of the device
.Fa dev .
If the device does not support power management capabilities, then the default
state of
.Dv PCI_POWERSTATE_D0
is returned.
-The following power states are defined by ACPI:
+The following power states are defined by PCI:
.Bl -hang -width ".Dv PCI_POWERSTATE_UNKNOWN"
.It Dv PCI_POWERSTATE_D0
State in which device is on and running.
@@ -177,66 +425,243 @@ The
.Fn pci_set_powerstate
function is used to transition the device
.Fa dev
-to the ACPI power state
+to the PCI power state
.Fa state .
-It checks to see if the device is PCI 2.2 compliant.
-If so, it checks the
-capabilities pointer to determine which power states the device supports.
-If the device does not have power management capabilities, the default state
-of
-.Dv PCI_POWERSTATE_D0
-is set.
+If the device does not support power management capabilities or
+it does not support the specific power state
+.Fa state ,
+then the function will fail with
+.Er EOPNOTSUPP .
.Pp
The
-.Fn pci_find_bsf
-function looks up the
-.Vt device_t
-of a PCI device, given its
-.Fa bus ,
-.Fa slot ,
+.Fn pci_save_state
and
-.Fa func .
+.Fn pci_restore_state
+functions can be used by a device driver to save and restore standard PCI
+config registers.
The
-.Fa slot
-number actually refers to the number of the device on the bus,
-which does not necessarily indicate its geographic location
-in terms of a physical slot.
-Note that in case the system has multiple PCI domains,
-the
-.Fn pci_find_bsf
-function only searches the first one.
-Actually, it is equivalent to:
-.Bd -literal -offset indent
-pci_find_dbsf(0, bus, slot, func);
-.Ed
+.Fn pci_save_state
+function must be invoked while the device has valid state before
+.Fn pci_restore_state
+can be used.
+If the device is not in the fully-powered state
+.Pq Dv PCI_POWERSTATE_D0
+when
+.Fn pci_restore_state
+is invoked,
+then the device will be transitioned to
+.Dv PCI_POWERSTATE_D0
+before any config registers are restored.
+.Ss Message Signaled Interrupts
+Message Signaled Interrupts
+.Pq MSI
+and
+Enhanced Message Signaled Interrupts
+.Pq MSI-X
+are PCI capabilities that provide an alternate method for PCI
+devices to signal interrupts.
+The legacy INTx interrupt is available to PCI devices as a
+.Dv SYS_RES_IRQ
+resource with a resource ID of zero.
+MSI and MSI-X interrupts are available to PCI devices as one or more
+.Dv SYS_RES_IRQ
+resources with resource IDs greater than zero.
+A driver must ask the PCI bus to allocate MSI or MSI-X interrupts
+using
+.Fn pci_alloc_msi
+or
+.Fn pci_alloc_msix
+before it can use MSI or MSI-X
+.Dv SYS_RES_IRQ
+resources.
+A driver is not allowed to use the legacy INTx
+.Dv SYS_RES_IRQ
+resource if MSI or MSI-X interrupts have been allocated,
+and attempts to allocate MSI or MSI-X interrupts will fail if the
+driver is currently using the legacy INTx
+.Dv SYS_RES_IRQ
+resource.
+A driver is only allowed to use either MSI or MSI-X,
+but not both.
.Pp
The
-.Fn pci_find_dbsf
-function looks up the
-.Vt device_t
-of a PCI device, given its
-.Fa domain ,
-.Fa bus ,
-.Fa slot ,
-and
-.Fa func .
+.Fn pci_count_msi
+function returns the maximum number of MSI messages supported by the
+device
+.Fa dev.
+If the device does not support MSI,
+then
+.Fn pci_count_msi
+returns zero.
+.Pp
The
-.Fa slot
-number actually refers to the number of the device on the bus,
-which does not necessarily indicate its geographic location
-in terms of a physical slot.
+.Fn pci_alloc_msi
+function attempts to allocate
+.Fa *count
+MSI messages for the device
+.Fa dev .
+The
+.Fn pci_alloc_msi
+function may allocate fewer messages than requested for various
+reasons including requests for more messages than the device
+.Fa dev
+supports,
+or if the system has a shortage of available MSI messages.
+On success,
+.Fa *count
+is set to the number of messages allocated and
+.Fn pci_alloc_msi
+returns zero.
+The
+.Dv SYS_RES_IRQ
+resources for the allocated messages will be available at consecutive
+resource IDs beginning with one.
+If
+.Fn pci_alloc_msi
+is not able to allocate any messages,
+it returns an error.
+Note that MSI only supports message counts that are powers of two;
+requests to allocate a non-power of two count of messages will fail.
.Pp
The
-.Fn pci_find_device
-function looks up the
-.Vt device_t
-of a PCI device, given its
-.Fa vendor
-and
-.Fa device
-IDs.
-Note that there can be multiple matches for this search; this function
-only returns the first matching device.
+.Fn pci_release_msi
+function is used to release any allocated MSI or MSI-X messages back
+to the system.
+If any MSI or MSI-X
+.Dv SYS_RES_IRQ
+resources are allocated by the driver or have a configured interrupt
+handler,
+this function will fail with
+.Er EBUSY .
+The
+.Fn pci_release_msi
+function returns zero on success and an error on failure.
+.Pp
+The
+.Fn pci_count_msix
+function returns the maximum number of MSI-X messages supported by the
+device
+.Fa dev .
+If the device does not support MSI-X,
+then
+.Fn pci_count_msix
+returns zero.
+.Pp
+The
+.Fn pci_alloc_msix
+function attempts to allocate
+.Fa *count
+MSI-X messages for the device
+.Fa dev .
+The
+.Fn pci_alloc_msix
+function may allocate fewer messages than requested for various
+reasons including requests for more messages than the device
+.Fa dev
+supports,
+or if the system has a shortage of available MSI-X messages.
+On success,
+.Fa *count
+is set to the number of messages allocated and
+.Fn pci_alloc_msix
+returns zero.
+For MSI-X messages,
+the resource ID for each
+.Dv SYS_RES_IRQ resource identifies the index in the MSI-X table of the
+corresponding message.
+A resource ID of one maps to the first index of the MSI-X table;
+a resource ID two identifies the second index in the table, etc.
+The
+.Fn pci_alloc_msix
+function assigns the
+.Fa *count
+messages allocated to the first
+.Fa *count
+table indicies.
+If
+.Fn pci_alloc_msix
+is not able to allocate any messages,
+it returns an error.
+Unlike MSI,
+MSI-X does not require message counts that are powers of two.
+.Pp
+The
+.Fn pci_pending_msix
+function examines the
+.Fa dev
+device's Pending Bit Array
+.Pq PBA
+to determine the pending status of the MSI-X message at table index
+.Fa index .
+If the indicated message is pending,
+this function returns a non-zero value;
+otherwise,
+it returns zero.
+Passing an invalid
+.Fa index
+to this function will result in undefined behavior.
+.Pp
+As mentioned in the description of
+.Fn pci_alloc_msix ,
+MSI-X messages are initially assigned to the first N table entries.
+A driver may use a different distribution of available messages to
+table entries via the
+.Fn pci_remap_msix
+function.
+Note that this function must be called after a succesful call to
+.Fn pci_alloc_msix
+but before any of the
+.Dv SYS_RES_IRQ
+resources are allocated.
+The
+.Fn pci_remap_msix
+function returns zero on success,
+or an error on failure.
+.Pp
+The
+.Fa vectors
+array should contain
+.Fa count
+message vectors.
+The array maps directly to the MSI-X table in that the first entry in
+the array specifies the message used for the first entry in the MSI-X
+table,
+the second entry in the array corresponds to the second entry in the
+MSI-X table,
+etc.
+The vector value in each array index can either be zero to indicate
+that no message should be assigned to the corresponding MSI-X table entry,
+or it can be a number from one to N
+.Po
+where N is the count returned from the previous call to
+.Fn pci_alloc_msix
+.Pc
+to indicate which of the allocated messages should be assigned to the
+corresponding MSI-X table entry.
+.Pp
+If
+.Fn pci_remap_msix
+succeeds,
+each MSI-X table entry with a non-zero vector will have an associated
+.Dv SYS_RES_IRQ
+resource whose resource ID corresponds to the table index as described
+above for
+.Fn pci_alloc_msix .
+MSI-X table entries that with a vector of zero will not have an
+associated
+.Dv SYS_RES_IRQ resource.
+Additionally,
+if any of the original messages allocated by
+.Fn pci_alloc_msix
+are not used in the new distribution of messages in the MSI-X table,
+they will be released automatically.
+Note that if a driver wishes to use fewer messages than were allocated by
+.Fn pci_alloc_msix ,
+the driver must use a single, contiguous range of messages beginning
+with one in the new distribution.
+The
+.Fn pci_remap_msix
+function will fail if this condition is not met.
.Sh IMPLEMENTATION NOTES
The
.Vt pci_addr_t
@@ -269,7 +694,9 @@ space on the target architecture.
.Re
.Sh AUTHORS
This manual page was written by
-.An Bruce M Simpson Aq bms@FreeBSD.org .
+.An Bruce M Simpson Aq bms@FreeBSD.org
+and
+.An John Baldwin Aq jhb@FreeBSD.org .
.Sh BUGS
The kernel PCI code has a number of references to
.Dq "slot numbers" .
diff --git a/share/man/man9/physio.9 b/share/man/man9/physio.9
index 7d7174e..977c467 100644
--- a/share/man/man9/physio.9
+++ b/share/man/man9/physio.9
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 8, 2004
+.Dd January 19, 2012
.Dt PHYSIO 9
.Os
.Sh NAME
@@ -41,7 +41,7 @@
.In sys/bio.h
.In sys/buf.h
.Ft int
-.Fn physio "dev_t dev" "struct uio *uio" "int ioflag"
+.Fn physio "struct cdev *dev" "struct uio *uio" "int ioflag"
.Sh DESCRIPTION
The
.Fn physio
diff --git a/share/man/man9/random.9 b/share/man/man9/random.9
index 1d7c7da..a6bccda 100644
--- a/share/man/man9/random.9
+++ b/share/man/man9/random.9
@@ -44,7 +44,7 @@
.Fn random "void"
.Ft void
.Fn arc4rand "void *ptr" "u_int length" "int reseed"
-.Ft u_int32_t
+.Ft uint32_t
.Fn arc4random "void"
.Pp
.In sys/random.h
diff --git a/share/man/man9/rijndael.9 b/share/man/man9/rijndael.9
index 48b402b..1d8d904 100644
--- a/share/man/man9/rijndael.9
+++ b/share/man/man9/rijndael.9
@@ -43,47 +43,47 @@
.Ft int
.Fo rijndael_makeKey
.Fa "keyInstance *key"
-.Fa "u_int8_t direction"
+.Fa "uint8_t direction"
.Fa "int keyLen"
.Fa "char *keyMaterial"
.Fc
.Ft int
.Fo rijndael_cipherInit
.Fa "cipherInstance *cipher"
-.Fa "u_int8_t mode"
+.Fa "uint8_t mode"
.Fa "char *IV"
.Fc
.Ft int
.Fo rijndael_blockEncrypt
.Fa "cipherInstance *cipher"
.Fa "keyInstance *key"
-.Fa "u_int8_t *input"
+.Fa "uint8_t *input"
.Fa "int inputLen"
-.Fa "u_int8_t *outBuffer"
+.Fa "uint8_t *outBuffer"
.Fc
.Ft int
.Fo rijndael_padEncrypt
.Fa "cipherInstance *cipher"
.Fa "keyInstance *key"
-.Fa "u_int8_t *input"
+.Fa "uint8_t *input"
.Fa "int inputOctets"
-.Fa "u_int8_t *outBuffer"
+.Fa "uint8_t *outBuffer"
.Fc
.Ft int
.Fo rijndael_blockDecrypt
.Fa "cipherInstance *cipher"
.Fa "keyInstance *key"
-.Fa "u_int8_t *input"
+.Fa "uint8_t *input"
.Fa "int inputLen"
-.Fa "u_int8_t *outBuffer"
+.Fa "uint8_t *outBuffer"
.Fc
.Ft int
.Fo rijndael_padDecrypt
.Fa "cipherInstance *cipher"
.Fa "keyInstance *key"
-.Fa "u_int8_t *input"
+.Fa "uint8_t *input"
.Fa "int inputOctets"
-.Fa "u_int8_t *outBuffer"
+.Fa "uint8_t *outBuffer"
.Fc
.Sh DESCRIPTION
The
diff --git a/share/man/man9/rmlock.9 b/share/man/man9/rmlock.9
index bc20d70..893eb25 100644
--- a/share/man/man9/rmlock.9
+++ b/share/man/man9/rmlock.9
@@ -80,7 +80,7 @@ Read mostly locks are designed to be efficient for locks almost exclusively
used as reader locks and as such should be used for protecting data that
rarely changes.
Acquiring an exclusive lock after the lock had been locked for shared access
-is an expensive operation.
+is an expensive operation.
.Pp
Although reader/writer locks look very similar to
.Xr sx 9
@@ -196,9 +196,9 @@ This function releases a shared lock previously acquired by
.Fn rm_rlock .
The
.Fa tracker
-argument must match the
-.Fa tracker
-argument used for acquiring the shared lock
+argument must match the
+.Fa tracker
+argument used for acquiring the shared lock
.It Fn rm_wunlock "struct rmlock *rm"
This function releases an exclusive lock previously acquired by
.Fn rm_wlock .
@@ -248,7 +248,7 @@ The
implementation uses a single per CPU list shared by all
rmlocks in the system.
If rmlocks become popular, hashing to multiple per CPU queues may
-be needed to speed up the writer lock process.
+be needed to speed up the writer lock process.
.Pp
The
.Nm
diff --git a/share/man/man9/shm_map.9 b/share/man/man9/shm_map.9
index a711fb6..4ba8222 100644
--- a/share/man/man9/shm_map.9
+++ b/share/man/man9/shm_map.9
@@ -125,7 +125,7 @@ shm_example(int fd)
fdrop(fp, curthread);
return (error);
}
-
+
/* Do something with 'mem'. */
error = shm_unmap(fp, mem, 16384);
diff --git a/share/man/man9/sleep.9 b/share/man/man9/sleep.9
index 469df9c..9141762 100644
--- a/share/man/man9/sleep.9
+++ b/share/man/man9/sleep.9
@@ -93,7 +93,7 @@ then the thread will be made
runnable with the specified
.Fa priority
when it resumes.
-.Dv PZERO
+.Dv PZERO
should never be used, as it is for compatibility only.
A new priority of 0 means to use the thread's current priority when
it is made runnable again.
@@ -243,7 +243,7 @@ It is the programmer's responsibility to choose a unique
value.
The older
.Fn wakeup
-function did not require this, though it was never good practice
+function did not require this, though it was never good practice
for threads to share a
.Fa chan
value.
diff --git a/share/man/man9/spl.9 b/share/man/man9/spl.9
index 95a5fc2..08fd4d4 100644
--- a/share/man/man9/spl.9
+++ b/share/man/man9/spl.9
@@ -80,8 +80,8 @@ code locking that the spl did when converting code from versions of the
kernel prior to
.Fx 5.0 .
The examples in this man page are also obsolete and should not be viewed
-as documenting
-.Fx 5.0
+as documenting
+.Fx 5.0
and newer.
.Ef
.Pp
diff --git a/share/man/man9/swi.9 b/share/man/man9/swi.9
index ec2c3d6..831a67e 100644
--- a/share/man/man9/swi.9
+++ b/share/man/man9/swi.9
@@ -24,25 +24,24 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 30, 2000
+.Dd April 19, 2012
.Dt SWI 9
.Os
.Sh NAME
.Nm swi_add ,
+.Nm swi_remove ,
.Nm swi_sched
.Nd register and schedule software interrupt handlers
.Sh SYNOPSIS
.In sys/param.h
.In sys/bus.h
.In sys/interrupt.h
-.Vt "extern struct ithd *tty_ithd" ;
-.Vt "extern struct ithd *clk_ithd" ;
-.Vt "extern void *net_ih" ;
-.Vt "extern void *softclock_ih" ;
+.Vt "extern struct intr_event *tty_intr_event" ;
+.Vt "extern struct intr_event *clk_intr_event" ;
.Vt "extern void *vm_ih" ;
.Ft int
.Fo swi_add
-.Fa "struct ithd **ithdp"
+.Fa "struct intr_event **eventp"
.Fa "const char *name"
.Fa "driver_intr_t handler"
.Fa "void *arg"
@@ -50,6 +49,8 @@
.Fa "enum intr_type flags"
.Fa "void **cookiep"
.Fc
+.Ft int
+.Fn swi_remove "void *cookie"
.Ft void
.Fn swi_sched "void *cookie" "int flags"
.Sh DESCRIPTION
@@ -67,20 +68,21 @@ time, and that they can be run via a lightweight context switch.
.Pp
The
.Fn swi_add
-function is used to register a new software interrupt handler.
+function is used to add a new software interrupt handler to a specified
+interrupt event.
The
-.Fa ithdp
+.Fa eventp
argument is an optional pointer to a
-.Vt struct ithd
+.Vt struct intr_event
pointer.
-If this argument points to an existing software interrupt thread, then this
-handler will be attached to that thread.
-Otherwise a new thread will be created, and if
-.Fa ithdp
+If this argument points to an existing event that holds a list of
+interrupt handlers, then this handler will be attached to that event.
+Otherwise a new event will be created, and if
+.Fa eventp
is not
.Dv NULL ,
then the pointer at that address to will be modified to point to the
-newly created thread.
+newly created event.
The
.Fa name
argument is used to associate a name with a specific handler.
@@ -99,7 +101,7 @@ The
.Fa pri
value specifies the priority of this interrupt handler relative to other
software interrupt handlers.
-If an interrupt thread is created, then this value is used as the vector,
+If an interrupt event is created, then this value is used as the vector,
and the
.Fa flags
argument is used to specify the attributes of a handler such as
@@ -113,6 +115,14 @@ This cookie will be set to a value that uniquely identifies this handler,
and is used to schedule the handler for execution later on.
.Pp
The
+.Fn swi_remove
+function is used to teardown an interrupt handler pointed to by the
+.Fa cookie
+argument.
+It detaches the interrupt handler from the associated interrupt event
+and frees its memory.
+.Pp
+The
.Fn swi_sched
function is used to schedule an interrupt handler and its associated thread to
run.
@@ -140,30 +150,29 @@ in earlier versions of
.El
.Pp
The
-.Va tty_ithd
+.Va tty_intr_event
and
-.Va clk_ithd
-variables contain pointers to the software interrupt threads for the tty and
+.Va clk_intr_event
+variables contain pointers to the software interrupt handlers for the tty and
clock software interrupts, respectively.
-.Va tty_ithd
+.Va tty_intr_event
is used to hang tty software interrupt handlers off of the same thread.
-.Va clk_ithd
+.Va clk_intr_event
is used to hang delayed handlers off of the clock software interrupt thread so
that the functionality of
.Fn setdelayed
can be obtained in conjunction with
.Dv SWI_DELAY .
The
-.Va net_ih ,
-.Va softclock_ih ,
-and
.Va vm_ih
-handler cookies are used to schedule software interrupt threads to run for the
-networking stack, clock interrupt, and VM subsystem respectively.
+handler cookie is used to schedule software interrupt threads to run for the
+VM subsystem.
.Sh RETURN VALUES
The
.Fn swi_add
-function returns zero on success and non-zero on failure.
+and
+.Fn swi_remove
+functions return zero on success and non-zero on failure.
.Sh ERRORS
The
.Fn swi_add
@@ -183,7 +192,7 @@ argument specifies
.Dv INTR_ENTROPY .
.It Bq Er EINVAL
The
-.Fa ithdp
+.Fa eventp
argument points to a hardware interrupt thread.
.It Bq Er EINVAL
Either of the
@@ -195,11 +204,22 @@ arguments are
.It Bq Er EINVAL
The
.Dv INTR_EXCL
-flag is specified and the interrupt thread pointed to by
-.Fa ithdp
-already has at least one handler, or the interrupt thread already has an
+flag is specified and the interrupt event pointed to by
+.Fa eventp
+already has at least one handler, or the interrupt event already has an
exclusive handler.
.El
+.Pp
+The
+.Fn swi_remove
+function will fail if:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+A software interrupt handler pointed to by
+.Fa cookie
+is
+.Dv NULL .
+.El
.Sh SEE ALSO
.Xr ithread 9 ,
.Xr taskqueue 9
@@ -220,6 +240,10 @@ and
.Fn schedsoft*
functions which date back to at least
.Bx 4.4 .
+The
+.Fn swi_remove
+function first appeared in
+.Fx 6.1 .
.Sh BUGS
Most of the global variables described in this manual page should not be
global, or at the very least should not be declared in
diff --git a/share/man/man9/sysctl.9 b/share/man/man9/sysctl.9
index f6ba537..d58573b 100644
--- a/share/man/man9/sysctl.9
+++ b/share/man/man9/sysctl.9
@@ -138,9 +138,9 @@ This sysctl can be written to by processes in
.It Dv CTLFLAG_SKIP
When iterating the sysctl name space, do not list this sysctl.
.It Dv CTLFLAG_TUN
-Also declare a system tunable with the same name to initialize this variable.
+Advisory flag that a system tunable also exists for this variable.
.It Dv CTLFLAG_RDTUN
-Also declare a system tunable with the same name to initialize this variable;
+Advisory flag that a system tunable also exists for this variable;
however, the run-time variable is read-only.
.El
.Pp
diff --git a/share/man/man9/sysctl_ctx_init.9 b/share/man/man9/sysctl_ctx_init.9
index f17ca3a..cbca5c6 100644
--- a/share/man/man9/sysctl_ctx_init.9
+++ b/share/man/man9/sysctl_ctx_init.9
@@ -135,7 +135,7 @@ in most cases, the programmer specifies
as the oid number when creating an oid.
However, during registration of the oid in the tree,
this number is changed to the first available number
-greater than or equal to
+greater than or equal to
.Dv CTL_AUTO_START .
If the first step of context deletion fails,
re-registration of the oid does not change the already assigned oid number
diff --git a/share/man/man9/taskqueue.9 b/share/man/man9/taskqueue.9
index 056ee66..319aa2f 100644
--- a/share/man/man9/taskqueue.9
+++ b/share/man/man9/taskqueue.9
@@ -116,8 +116,8 @@ thread).
The memory location where the thread identity is recorded is used
to signal the service thread(s) to terminate--when this value is set to
zero and the thread is signaled it will terminate.
-If the queue is intended for use in fast interrupt handlers
-.Fn taskqueue_create_fast
+If the queue is intended for use in fast interrupt handlers
+.Fn taskqueue_create_fast
should be used in place of
.Fn taskqueue_create .
.Pp
@@ -296,9 +296,9 @@ The variable
is used to enqueue tasks onto the queue.
.Pp
.Fn TASKQUEUE_FAST_DEFINE
-and
+and
.Fn TASKQUEUE_FAST_DEFINE_THREAD
-act just like
+act just like
.Fn TASKQUEUE_DEFINE
and
.Fn TASKQUEUE_DEFINE_THREAD
diff --git a/share/man/man9/timeout.9 b/share/man/man9/timeout.9
index 36731c8..ddc66b5 100644
--- a/share/man/man9/timeout.9
+++ b/share/man/man9/timeout.9
@@ -197,9 +197,9 @@ The function
initializes a callout so it can be passed to
.Fn callout_stop ,
.Fn callout_drain ,
-.Fn callout_reset
+.Fn callout_reset
or
-.Fn callout_schedule
+.Fn callout_schedule
without any side effects.
If the
.Fa mpsafe
diff --git a/share/man/man9/uio.9 b/share/man/man9/uio.9
index 9d569b7..fd66e3d 100644
--- a/share/man/man9/uio.9
+++ b/share/man/man9/uio.9
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 9, 2011
+.Dd January 19, 2012
.Dt UIO 9
.Os
.Sh NAME
@@ -154,7 +154,7 @@ static char buffer[BUFSIZE];
static int data_available; /* amount of data that can be read */
static int
-fooread(dev_t dev, struct uio *uio, int flag)
+fooread(struct cdev *dev, struct uio *uio, int flag)
{
int rv, amnt;
diff --git a/share/man/man9/usbdi.9 b/share/man/man9/usbdi.9
index 0e9f9f2..c04c946 100644
--- a/share/man/man9/usbdi.9
+++ b/share/man/man9/usbdi.9
@@ -179,7 +179,7 @@ zero upon success. A non-zero return value indicates failure.
.
.Fn usbd_transfer_unsetup
This function will release the given USB transfers and all allocated
-resources associated with these USB transfers.
+resources associated with these USB transfers.
.Fa pxfer
is a pointer to an array of USB transfer pointers, that may be NULL,
that should be freed by the USB system.
@@ -283,15 +283,15 @@ usb_default_callback(struct usb_xfer *xfer, usb_error_t error)
usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
switch (USB_GET_STATE(xfer)) {
- case USB_ST_SETUP:
+ case USB_ST_SETUP:
/*
* Setup xfer frame lengths/count and data
*/
usbd_transfer_submit(xfer);
break;
- case USB_ST_TRANSFERRED:
- /*
+ case USB_ST_TRANSFERRED:
+ /*
* Read usb frame data, if any.
* "actlen" has the total length for all frames
* transferred.
@@ -300,13 +300,13 @@ usb_default_callback(struct usb_xfer *xfer, usb_error_t error)
default: /* Error */
/*
- * Print error message and clear stall
+ * Print error message and clear stall
* for example.
*/
break;
}
- /*
- * Here it is safe to do something without the private
+ /*
+ * Here it is safe to do something without the private
* USB mutex locked.
*/
return;
@@ -320,7 +320,7 @@ First the SETUP packet, then DATA packet(s) and then a STATUS
packet.
.
The SETUP packet is always pointed to by frame 0 and the
-length is set by
+length is set by
.Fn usbd_xfer_frame_len
also if there should not be
sent any SETUP packet! If an USB control transfer has no DATA stage,
@@ -375,7 +375,7 @@ module defines a USB config structure where it is possible to specify
the characteristics of the wanted endpoint.
.Bd -literal -offset indent
-struct usb_config {
+struct usb_config {
bufsize,
callback
direction,
diff --git a/share/man/man9/vcount.9 b/share/man/man9/vcount.9
index 41263b9..186a350 100644
--- a/share/man/man9/vcount.9
+++ b/share/man/man9/vcount.9
@@ -32,7 +32,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 6, 2001
+.Dd January 19, 2012
.Dt VCOUNT 9
.Os
.Sh NAME
@@ -47,7 +47,7 @@
.Ft int
.Fn vcount "struct vnode *vp"
.Ft int
-.Fn count_dev "dev_t dev"
+.Fn count_dev "struct cdev *dev"
.Sh DESCRIPTION
.Fn vcount
is used to get the number of references to a particular device.
@@ -56,7 +56,7 @@ It allows for the fact that multiple vnodes may reference the same device.
does the same thing as
.Fn vcount ,
but takes a
-.Vt dev_t
+.Vt "struct cdev"
rather than a
.Vt "struct vnode"
pointer as an argument.
diff --git a/share/man/man9/vm_map_find.9 b/share/man/man9/vm_map_find.9
index 4aa5fb8..1d21bae 100644
--- a/share/man/man9/vm_map_find.9
+++ b/share/man/man9/vm_map_find.9
@@ -71,7 +71,7 @@ by the caller before calling this function to account for the new entry.
If
.Fa find_space
is either
-.Dv VMFS_ALIGNED_SPACE
+.Dv VMFS_ALIGNED_SPACE
or
.Dv VMFS_ANY_SPACE ,
the function will call
diff --git a/share/man/man9/vm_page_alloc.9 b/share/man/man9/vm_page_alloc.9
index 4497e48..9397d21 100644
--- a/share/man/man9/vm_page_alloc.9
+++ b/share/man/man9/vm_page_alloc.9
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 3, 2010
+.Dd January 28, 2012
.Dt VM_PAGE_ALLOC 9
.Os
.Sh NAME
@@ -90,23 +90,18 @@ than zero.
.Pp
The optional flags are:
.Bl -tag -width ".Dv VM_ALLOC_IFNOTCACHED"
-.It Dv VM_ALLOC_ZERO
-Indicate a preference for a pre-zeroed page.
-There is no guarantee that the returned page will be zeroed, but it
-will have the
-.Dv PG_ZERO
-flag set if it is zeroed.
+.It Dv VM_ALLOC_NOBUSY
+The returned page will not have the
+.Dv VPO_BUSY
+flag set.
+.It Dv VM_ALLOC_NODUMP
+The returned page will not be included in any kernel core dumps
+regardless of whether or not it is mapped in to KVA.
.It Dv VM_ALLOC_NOOBJ
Do not associate the allocated page with a vm object.
The
.Fa object
argument is ignored.
-.It Dv VM_ALLOC_NOBUSY
-The returned page will not have the
-.Dv VPO_BUSY
-flag set.
-.It Dv VM_ALLOC_WIRED
-The returned page will be wired.
.It Dv VM_ALLOC_IFCACHED
Allocate the page only if it is cached.
Otherwise, return
@@ -117,6 +112,14 @@ Only allocate the page if it is not cached in the
If the page at the specified
.Fa pindex
is cached, NULL is returned instead.
+.It Dv VM_ALLOC_WIRED
+The returned page will be wired.
+.It Dv VM_ALLOC_ZERO
+Indicate a preference for a pre-zeroed page.
+There is no guarantee that the returned page will be zeroed, but it
+will have the
+.Dv PG_ZERO
+flag set if it is zeroed.
.El
.El
.Sh RETURN VALUES
diff --git a/share/man/man9/vnode.9 b/share/man/man9/vnode.9
index cfc6f7d..eba208f 100644
--- a/share/man/man9/vnode.9
+++ b/share/man/man9/vnode.9
@@ -119,13 +119,13 @@ No type.
.It Dv VREG
A regular file; may be with or without VM object backing.
If you want to make sure this get a backing object, call
-.Xr vfs_object_create 9 .
+.Fn vnode_create_vobject .
.It Dv VDIR
A directory.
.It Dv VBLK
A block device; may be with or without VM object backing.
If you want to make sure this get a backing object, call
-.Xr vfs_object_create 9 .
+.Fn vnode_create_vobject .
.It Dv VCHR
A character device.
.It Dv VLNK
diff --git a/share/man/man9/watchdog.9 b/share/man/man9/watchdog.9
index 170812b..2df9fd6 100644
--- a/share/man/man9/watchdog.9
+++ b/share/man/man9/watchdog.9
@@ -53,7 +53,7 @@ is zero, the watchdog must be disabled and the
argument left untouched.
If the watchdog cannot be disabled, the
.Fa error
-argument must be set to
+argument must be set to
.Dv EOPNOTSUPP .
.Pp
Else the watchdog should be reset and configured to a timeout of
diff --git a/share/man/man9/zone.9 b/share/man/man9/zone.9
index 32531bb..a77fd5b 100644
--- a/share/man/man9/zone.9
+++ b/share/man/man9/zone.9
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 9, 2010
+.Dd February 25, 2012
.Dt ZONE 9
.Os
.Sh NAME
@@ -47,7 +47,7 @@
.Fo uma_zcreate
.Fa "char *name" "int size"
.Fa "uma_ctor ctor" "uma_dtor dtor" "uma_init uminit" "uma_fini fini"
-.Fa "int align" "u_int16_t flags"
+.Fa "int align" "uint16_t flags"
.Fc
.Ft "void *"
.Fn uma_zalloc "uma_zone_t zone" "int flags"
@@ -210,7 +210,7 @@ The
.Fn uma_zone_get_cur
function returns the approximate current occupancy of the zone.
The returned value is approximate because appropriate synchronisation to
-determine an exact value is not performend by the implementation.
+determine an exact value is not performed by the implementation.
This ensures low overhead at the expense of potentially stale data being used
in the calculation.
.Sh RETURN VALUES
OpenPOWER on IntegriCloud