Index: head/share/man/man4/ahci.4 =================================================================== --- head/share/man/man4/ahci.4 (revision 301588) +++ head/share/man/man4/ahci.4 (revision 301589) @@ -1,178 +1,179 @@ .\" Copyright (c) 2009-2013 Alexander Motin .\" 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 October 22, 2013 .Dt AHCI 4 .Os .Sh NAME .Nm ahci .Nd Serial ATA Advanced Host Controller Interface driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device pci" .Cd "device scbus" .Cd "device ahci" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent ahci_load="YES" .Ed .Pp The following tunables are settable from the .Xr loader 8 : .Bl -ohang .It Va hint.ahci. Ns Ar X Ns Va .msi controls Message Signaled Interrupts (MSI) usage by the specified controller. .Pp .Bl -tag -width 4n -offset indent -compact .It 0 MSI disabled; .It 1 single MSI vector used, if supported; .It 2 multiple MSI vectors used, if supported (default); .El .It Va hint.ahci. Ns Ar X Ns Va .ccc controls Command Completion Coalescing (CCC) usage by the specified controller. Non-zero value enables CCC and defines maximum time (in ms), request can wait for interrupt, if there are some more requests present on controller queue. CCC reduces number of context switches on systems with many parallel requests, but it can decrease disk performance on some workloads due to additional command latency. .It Va hint.ahci. Ns Ar X Ns Va .direct controls whether the driver should use direct command completion from interrupt thread(s), or queue them to CAM completion threads. Default value depends on number of MSI interrupts supported and number of implemented SATA ports. .It Va hint.ahcich. Ns Ar X Ns Va .pm_level controls SATA interface Power Management for the specified channel, allowing some power to be saved at the cost of additional command latency. Possible values: .Pp .Bl -tag -width 4n -offset indent -compact .It 0 interface Power Management is disabled (default); .It 1 device is allowed to initiate PM state change, host is passive; .It 2 host initiates PARTIAL PM state transition every time port becomes idle; .It 3 host initiates SLUMBER PM state transition every time port becomes idle. .It 4 driver initiates PARTIAL PM state transition 1ms after port becomes idle; .It 5 driver initiates SLUMBER PM state transition 125ms after port becomes idle. .El .Pp Some controllers, such as ICH8, do not implement modes 2 and 3 with NCQ used. Because of artificial entering latency, performance degradation in modes 4 and 5 is much smaller then in modes 2 and 3. .Pp Note that interface Power Management complicates device presence detection. A manual bus reset/rescan may be needed after device hot-plug, unless hardware implements Cold Presence Detection. .It Va hint.ahcich. Ns Ar X Ns Va .sata_rev setting to nonzero value limits maximum SATA revision (speed). Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. .It Va hw.ahci.force setting to nonzero value forces driver attach to some known AHCI-capable chips even if they are configured for legacy IDE emulation. Default is 1. .El .Sh DESCRIPTION This driver provides the .Xr CAM 4 subsystem with native access to the .Tn SATA ports of AHCI-compatible controllers. Each SATA port found is represented to CAM as a separate bus with one target, or, if HBA supports Port Multipliers, 16 targets. Most of the bus-management details are handled by the SATA-specific transport of CAM. Connected ATA disks are handled by the ATA protocol disk peripheral driver .Xr ada 4 . ATAPI devices are handled by the SCSI protocol peripheral drivers .Xr cd 4 , .Xr da 4 , .Xr sa 4 , etc. .Pp Driver features include support for Serial ATA and ATAPI devices, Port Multipliers (including FIS-based switching, when supported), hardware command queues (up to 32 commands per port), Native Command Queuing, SATA interface Power Management, device hot-plug and Message Signaled Interrupts. .Pp Driver supports "LED" enclosure management messages, defined by the AHCI. When supported by hardware, it allows to control per-port activity, locate and fault LEDs via the .Xr led 4 API or emulated .Xr ses 4 device for localization and status reporting purposes. Supporting AHCI controllers may transmit that information to the backplane -controllers via SGPIO interface. Backplane controllers interpret received +controllers via SGPIO interface. +Backplane controllers interpret received statuses in some way (IBPI standard) to report them using present indicators. .Sh HARDWARE The .Nm driver supports AHCI compatible controllers having PCI class 1 (mass storage), subclass 6 (SATA) and programming interface 1 (AHCI). .Pp Also, in cooperation with atamarvell and atajmicron drivers of ata(4), it supports AHCI part of legacy-PATA + AHCI-SATA combined controllers, such as JMicron JMB36x and Marvell 88SE61xx. .Sh FILES .Bl -tag -width /dev/led/ahcich*.locate .It Pa /dev/led/ahci*.*.act activity LED device nodes .It Pa /dev/led/ahci*.*.fault fault LED device nodes .It Pa /dev/led/ahci*.*.locate locate LED device nodes .El .Sh SEE ALSO .Xr ada 4 , .Xr ata 4 , .Xr cam 4 , .Xr cd 4 , .Xr da 4 , .Xr sa 4 , .Xr ses 4 .Sh HISTORY The .Nm driver first appeared in .Fx 8.0 . .Sh AUTHORS .An Alexander Motin Aq Mt mav@FreeBSD.org Index: head/share/man/man4/apic.4 =================================================================== --- head/share/man/man4/apic.4 (revision 301588) +++ head/share/man/man4/apic.4 (revision 301589) @@ -1,77 +1,78 @@ .\" Copyright (c) 2011 Alexander Motin .\" 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 December 20, 2011 .Dt APIC 4 .Os .Sh NAME .Nm apic .Nd Advanced Programmable Interrupt Controller (APIC) driver .Sh SYNOPSIS This driver is a mandatory part of amd64 kernel. To compile this driver into i386 or pc98 kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "device apic" .Ed .Pp The following tunable is settable from the .Xr loader 8 : .Bl -ohang .It Va hint.apic. Ns Ar X Ns Va .clock -controls event timers functionality support. Setting to 0, disables it. +controls event timers functionality support. +Setting to 0, disables it. Default value is 1. .It Va hint.apic. Ns Ar X Ns Va .disabled Set this to 1 to disable APIC support, falling back to the legacy PIC. .El .Sh DESCRIPTION There are two components in the Intel APIC system, the local APIC (LAPIC) and the I/O APIC. There is one local APIC in each CPU in the system. There is typically one I/O APIC for each peripheral bus in the system. .Pp Local APICs manage all external interrupts for a specific processor. In addition, they are able to accept and generate inter-processor interrupts (IPIs). .Pp I/O APICs contain a redirection table, which is used to route the interrupts they receive from peripheral buses to one or more local APICs. .Pp Each local APIC includes one 32-bit programmable timer. This driver uses them to supply kernel with one event timer named "LAPIC". Event timer provided by the driver supports both one-shot an periodic modes. Because of local APIC nature it is per-CPU. The timer frequency is not reported by the platform and so automatically measured by the driver on the first use. Depending on CPU model this timer may stop in C3 and deeper CPU sleep states. Driver automatically adjusts event timer priority and reports it to prevent entering dangerous sleep states when it is used. .Sh SEE ALSO .Xr atrtc 4 , .Xr attimer 4 , .Xr eventtimers 4 , .Xr hpet 4 Index: head/share/man/man4/atp.4 =================================================================== --- head/share/man/man4/atp.4 (revision 301588) +++ head/share/man/man4/atp.4 (revision 301589) @@ -1,157 +1,158 @@ .\" Copyright (c) 2014 Rohit Grover . .\" 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. .\" 3. Neither the name of the author nor the names of any co-contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" 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 February 24, 2014 .Dt ATP 4 .Os .Sh NAME .Nm atp .Nd Apple touchpad driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines into your kernel configuration file: .Bd -ragged -offset indent .Cd "device atp" .Cd "device usb" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent atp_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for the Apple Internal Trackpad device found in many -Apple laptops. Older (Fountain/Geyser) and the newer (Wellspring) trackpad +Apple laptops. +Older (Fountain/Geyser) and the newer (Wellspring) trackpad families are all supported through a unified driver. .Pp The driver simulates a three\-button mouse using multi\-finger tap detection. Single finger tap generates a left\-button click; two\-finger tap maps to the middle button; whereas a three\-finger tap gets treated as a right button click. .Pp There is support for 2\-finger horizontal scrolling, which translates to page\-back/forward events; vertical multi\-finger scrolling emulates the mouse wheel. .Pp A double\-tap followed by a drag is treated as a selection gesture; a virtual left\-button click is assumed for the lifespan of the drag. .Pp .Nm supports dynamic reconfiguration using .Xr sysctl 8 ; through nodes under .Nm hw.usb.atp . Pointer sensitivity can be controlled using the sysctl tunable .Nm hw.usb.atp.scale_factor . Smaller values of .Fa scale_factor result in faster movement. . A simple high-pass filter is used to reduce contributions from small movements; the threshold for this filter may be controlled by .Nm hw.usb.atp.small_movement . . The maximum tolerable duration of a touch gesture is controlled by .Nm hw.usb.atp.touch_timeout (in microseconds); beyond this period, touches are considered to be slides. (This conversion also happens when a finger stroke accumulates at least .Nm hw.usb.atp.slide_min_movement movement (in mickeys). . The maximum time (in microseconds) to allow an association between a double- tap and drag gesture may be controlled by .Nm hw.usb.atp.double_tap_threshold . . Should one want to disable tap detection and rely only upon physical button presses, set the following sysctl to a value of 2 .Nm hw.usb.atp.tap_minimum . . .Sh HARDWARE The .Nm driver provides support for the following Product IDs: .Pp .Bl -bullet -compact .It PowerBooks, iBooks (IDs: 0x020e, 0x020f, 0x0210, 0x0214, 0x0215, 0x0216) .It Core Duo MacBook & MacBook Pro (IDs: 0x0217, 0x0218, 0x0219) .It Core2 Duo MacBook & MacBook Pro (IDs: 0x021a, 0x021b, 0x021c) .It Core2 Duo MacBook3,1 (IDs: 0x0229, 0x022a, 0x022b) .It 12 inch PowerBook and iBook (IDs: 0x030a, 0x030b) .It 15 inch PowerBook (IDs: 0x020e, 0x020f, 0x0215) .It 17 inch PowerBook (ID: 0x020d) .It Almost all recent Macbook-Pros and Airs (IDs: 0x0223, 0x0223, 0x0224, 0x0224, 0x0225, 0x0225, 0x0230, 0x0230, 0x0231, 0x0231, 0x0232, 0x0232, 0x0236, 0x0236, 0x0237, 0x0237, 0x0238, 0x0238, 0x023f, 0x023f, 0x0240, 0x0241, 0x0242, 0x0243, 0x0244, 0x0245, 0x0246, 0x0247, 0x0249, 0x024a, 0x024b, 0x024c, 0x024d, 0x024e, 0x0252, 0x0252, 0x0253, 0x0253, 0x0254, 0x0254, 0x0259, 0x025a, 0x025b, 0x0262, 0x0262, 0x0263, 0x0264, 0x0290, 0x0291, 0x0292) .El .Pp To discover the product\-id of a touchpad, search for 'Trackpad' in the output of .Xr lshal 1 and look up the property .Nm usb_device.product_id . .Sh FILES .Nm creates a blocking pseudo\-device file, .Pa /dev/atp0 , which presents the mouse as a .Ar sysmouse or .Ar mousesystems type device\-\-see .Xr moused 8 for an explanation of these mouse types. .Sh SEE ALSO .Xr sysmouse 4 , .Xr usb 4 , .Xr loader.conf 5 , .Xr xorg.conf 5 Pq Pa ports/x11/xorg , .Xr moused 8 , .Xr sysctl 8 .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Rohit Grover Aq Mt rgrover1@gmail.com . Index: head/share/man/man4/atrtc.4 =================================================================== --- head/share/man/man4/atrtc.4 (revision 301588) +++ head/share/man/man4/atrtc.4 (revision 301589) @@ -1,57 +1,58 @@ .\" Copyright (c) 2010 Alexander Motin .\" 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 September 17, 2010 .Dt ATRTC 4 .Os .Sh NAME .Nm atrtc .Nd AT Real-Time Clock (RTC) driver .Sh SYNOPSIS This driver is a mandatory part of i386/amd64 kernels. .Pp The following tunable is settable from the .Xr loader 8 : .Bl -ohang .It Va hint.atrtc. Ns Ar X Ns Va .clock -controls event timers functionality support. Setting to 0, disables it. +controls event timers functionality support. +Setting to 0, disables it. Default value is 1. .El .Sh DESCRIPTION This driver uses RTC hardware to supply kernel with time-of-day clock with 1 second resolution and one event timer. This hardware uses base frequency of 32768Hz for advancing time-of-day clock and generating periodic interrupts. Interrupts could be generated with fixed number of frequencies, from 2Hz to 8192Hz, obtained by dividing base frequency by one of supported power-of-2 divisors. .Pp Event timer provided by the driver is irrelevant to CPU power states. .Sh SEE ALSO .Xr apic 4 , .Xr attimer 4 , .Xr eventtimers 4 , .Xr hpet 4 Index: head/share/man/man4/bcma.4 =================================================================== --- head/share/man/man4/bcma.4 (revision 301588) +++ head/share/man/man4/bcma.4 (revision 301589) @@ -1,78 +1,79 @@ .\" Copyright (c) 2015 Landon Fuller .\" Copyright (c) 2010 Weongyo Jeong .\" 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 June 3, 2016 .Dt BCMA 4 .Os .Sh NAME .Nm bcma .Nd Broadcom AMBA Backplane driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device bhnd" .Cd "device bcma" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent bcma_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides .Xr bhnd 4 support for devices using the ARM AMBA-based backplane architecture found in later Broadcom Home Networking Division's (HND) wireless chipsets and embedded systems. .Pp A common interconnect connects all of the backplane's functional -blocks. These functional blocks, known as cores, use the ARM AMBA AXI or +blocks. +These functional blocks, known as cores, use the ARM AMBA AXI or APB interface to communicate with devices attached to the interconnect. .Pp The IP cores used in .Xr siba 4 devices were adapted by Broadcom for compatibility with the new interconnect. .Sh SEE ALSO .Xr bcma 4 , .Xr bhnd 4 .Sh HISTORY The .Nm device driver first appeared in .Fx 11.0 . .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Landon Fuller Aq Mt landonf@FreeBSD.org . Index: head/share/man/man4/bhnd.4 =================================================================== --- head/share/man/man4/bhnd.4 (revision 301588) +++ head/share/man/man4/bhnd.4 (revision 301589) @@ -1,83 +1,83 @@ .\" Copyright (c) 2015 Landon Fuller .\" 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 June 3, 2016 .Dt BHND 4 .Os .Sh NAME .Nm bhnd .Nd Broadcom Home Networking Division interconnect bus .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device bhnd" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent bhnd_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides a unified kernel bus interface to the on-chip interconnects used in Broadcom Home Networking Division (HND) devices. .Pp The Broadcom HND device family consists of SoCs (System On a Chip) and host-connected chipsets based on a common library of Broadcom IP -cores connected via an internal hardware bus architecture. Drivers -for these cores are implemented against the unified +cores connected via an internal hardware bus architecture. +Drivers for these cores are implemented against the unified .Nm interface. .Pp The Sonic Inc. Silicon Backplane used in earlier HND devices is supported by the .Xr siba 4 BHND driver. .Pp The ARM AMBA-based interconnect used in later HND devices is supported by the .Xr bcma 4 BHND driver. .Sh SEE ALSO .Xr bhndb 4 , .Xr bcma 4 , .Xr siba 4 .Sh HISTORY The .Nm device driver first appeared in .Fx 11.0 . .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Landon Fuller Aq Mt landonf@FreeBSD.org . Index: head/share/man/man4/bhyve.4 =================================================================== --- head/share/man/man4/bhyve.4 (revision 301588) +++ head/share/man/man4/bhyve.4 (revision 301589) @@ -1,68 +1,68 @@ .\" .\" Copyright (c) 2012 NetApp Inc .\" 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 5, 2013 .Dt BHYVE 4 .Os .Sh NAME .Nm bhyve .Nd virtual machine monitor .Sh SYNOPSIS .Cd "/usr/sbin/bhyve" .Cd "/usr/sbin/bhyveload" .Cd "/usr/sbin/bhyvectl" .Cd "/boot/kernel/vmm.ko" .Sh DESCRIPTION .Nm -is a virtual machine monitor that is hosted by FreeBSD. It is used to host -unmodified guest operating systems on top of FreeBSD. +is a virtual machine monitor that is hosted by FreeBSD. +It is used to host unmodified guest operating systems on top of FreeBSD. .Pp .Nm relies heavily on hardware assist provided by the CPU and chipset to virtualize processor and memory resources. .Sh SEE ALSO .Xr vmm 4 , .Xr bhyve 8 , .Xr bhyvectl 8 , .Xr bhyveload 8 .Sh HISTORY .Nm first appeared in .Fx 10.0 , and was developed at NetApp Inc. .Sh AUTHORS .Nm was developed by .An -nosplit .An Peter Grehan Aq Mt grehan@FreeBSD.org and .An Neel Natu Aq Mt neel@FreeBSD.org at NetApp Inc. .Sh BUGS .Nm is considered experimental in .Fx . Index: head/share/man/man4/bpf.4 =================================================================== --- head/share/man/man4/bpf.4 (revision 301588) +++ head/share/man/man4/bpf.4 (revision 301589) @@ -1,1110 +1,1111 @@ .\" Copyright (c) 2007 Seccuris Inc. .\" All rights reserved. .\" .\" This software was developed by Robert N. M. Watson under contract to .\" Seccuris Inc. .\" .\" 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. .\" .\" Copyright (c) 1990 The Regents of the University of California. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that: (1) source code distributions .\" retain the above copyright notice and this paragraph in its entirety, (2) .\" distributions including binary code include the above copyright notice and .\" this paragraph in its entirety in the documentation or other materials .\" provided with the distribution, and (3) all advertising materials mentioning .\" features or use of this software display the following acknowledgement: .\" ``This product includes software developed by the University of California, .\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of .\" the University nor the names of its contributors may be used to endorse .\" or promote products derived from this software without specific prior .\" written permission. .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. .\" .\" This document is derived in part from the enet man page (enet.4) .\" distributed with 4.3BSD Unix. .\" .\" $FreeBSD$ .\" .Dd June 15, 2010 .Dt BPF 4 .Os .Sh NAME .Nm bpf .Nd Berkeley Packet Filter .Sh SYNOPSIS .Cd device bpf .Sh DESCRIPTION The Berkeley Packet Filter provides a raw interface to data link layers in a protocol independent fashion. All packets on the network, even those destined for other hosts, are accessible through this mechanism. .Pp The packet filter appears as a character special device, .Pa /dev/bpf . After opening the device, the file descriptor must be bound to a specific network interface with the .Dv BIOCSETIF ioctl. A given interface can be shared by multiple listeners, and the filter underlying each descriptor will see an identical packet stream. .Pp A separate device file is required for each minor device. If a file is in use, the open will fail and .Va errno will be set to .Er EBUSY . .Pp Associated with each open instance of a .Nm file is a user-settable packet filter. Whenever a packet is received by an interface, all file descriptors listening on that interface apply their filter. Each descriptor that accepts the packet receives its own copy. .Pp The packet filter will support any link level protocol that has fixed length headers. Currently, only Ethernet, .Tn SLIP , and .Tn PPP drivers have been modified to interact with .Nm . .Pp Since packet data is in network byte order, applications should use the .Xr byteorder 3 macros to extract multi-byte values. .Pp A packet can be sent out on the network by writing to a .Nm file descriptor. The writes are unbuffered, meaning only one packet can be processed per write. Currently, only writes to Ethernets and .Tn SLIP links are supported. .Sh BUFFER MODES .Nm devices deliver packet data to the application via memory buffers provided by the application. The buffer mode is set using the .Dv BIOCSETBUFMODE ioctl, and read using the .Dv BIOCGETBUFMODE ioctl. .Ss Buffered read mode By default, .Nm devices operate in the .Dv BPF_BUFMODE_BUFFER mode, in which packet data is copied explicitly from kernel to user memory using the .Xr read 2 system call. The user process will declare a fixed buffer size that will be used both for sizing internal buffers and for all .Xr read 2 operations on the file. This size is queried using the .Dv BIOCGBLEN ioctl, and is set using the .Dv BIOCSBLEN ioctl. Note that an individual packet larger than the buffer size is necessarily truncated. .Ss Zero-copy buffer mode .Nm devices may also operate in the .Dv BPF_BUFMODE_ZEROCOPY mode, in which packet data is written directly into two user memory buffers by the kernel, avoiding both system call and copying overhead. Buffers are of fixed (and equal) size, page-aligned, and an even multiple of the page size. The maximum zero-copy buffer size is returned by the .Dv BIOCGETZMAX ioctl. Note that an individual packet larger than the buffer size is necessarily truncated. .Pp The user process registers two memory buffers using the .Dv BIOCSETZBUF ioctl, which accepts a .Vt struct bpf_zbuf pointer as an argument: .Bd -literal struct bpf_zbuf { void *bz_bufa; void *bz_bufb; size_t bz_buflen; }; .Ed .Pp .Vt bz_bufa is a pointer to the userspace address of the first buffer that will be filled, and .Vt bz_bufb is a pointer to the second buffer. .Nm will then cycle between the two buffers as they fill and are acknowledged. .Pp Each buffer begins with a fixed-length header to hold synchronization and data length information for the buffer: .Bd -literal struct bpf_zbuf_header { volatile u_int bzh_kernel_gen; /* Kernel generation number. */ volatile u_int bzh_kernel_len; /* Length of data in the buffer. */ volatile u_int bzh_user_gen; /* User generation number. */ /* ...padding for future use... */ }; .Ed .Pp The header structure of each buffer, including all padding, should be zeroed before it is configured using .Dv BIOCSETZBUF . Remaining space in the buffer will be used by the kernel to store packet data, laid out in the same format as with buffered read mode. .Pp The kernel and the user process follow a simple acknowledgement protocol via the buffer header to synchronize access to the buffer: when the header generation numbers, .Vt bzh_kernel_gen and .Vt bzh_user_gen , hold the same value, the kernel owns the buffer, and when they differ, userspace owns the buffer. .Pp While the kernel owns the buffer, the contents are unstable and may change asynchronously; while the user process owns the buffer, its contents are stable and will not be changed until the buffer has been acknowledged. .Pp Initializing the buffer headers to all 0's before registering the buffer has the effect of assigning initial ownership of both buffers to the kernel. The kernel signals that a buffer has been assigned to userspace by modifying .Vt bzh_kernel_gen , and userspace acknowledges the buffer and returns it to the kernel by setting the value of .Vt bzh_user_gen to the value of .Vt bzh_kernel_gen . .Pp In order to avoid caching and memory re-ordering effects, the user process must use atomic operations and memory barriers when checking for and acknowledging buffers: .Bd -literal #include /* * Return ownership of a buffer to the kernel for reuse. */ static void buffer_acknowledge(struct bpf_zbuf_header *bzh) { atomic_store_rel_int(&bzh->bzh_user_gen, bzh->bzh_kernel_gen); } /* * Check whether a buffer has been assigned to userspace by the kernel. * Return true if userspace owns the buffer, and false otherwise. */ static int buffer_check(struct bpf_zbuf_header *bzh) { return (bzh->bzh_user_gen != atomic_load_acq_int(&bzh->bzh_kernel_gen)); } .Ed .Pp The user process may force the assignment of the next buffer, if any data is pending, to userspace using the .Dv BIOCROTZBUF ioctl. This allows the user process to retrieve data in a partially filled buffer before the buffer is full, such as following a timeout; the process must recheck for buffer ownership using the header generation numbers, as the buffer will not be assigned to userspace if no data was present. .Pp As in the buffered read mode, .Xr kqueue 2 , .Xr poll 2 , and .Xr select 2 may be used to sleep awaiting the availability of a completed buffer. They will return a readable file descriptor when ownership of the next buffer is assigned to user space. .Pp In the current implementation, the kernel may assign zero, one, or both buffers to the user process; however, an earlier implementation maintained the invariant that at most one buffer could be assigned to the user process at a time. In order to both ensure progress and high performance, user processes should acknowledge a completely processed buffer as quickly as possible, returning it for reuse, and not block waiting on a second buffer while holding another buffer. .Sh IOCTLS The .Xr ioctl 2 command codes below are defined in .In net/bpf.h . All commands require these includes: .Bd -literal #include #include #include #include .Ed .Pp Additionally, .Dv BIOCGETIF and .Dv BIOCSETIF require .In sys/socket.h and .In net/if.h . .Pp In addition to .Dv FIONREAD the following commands may be applied to any open .Nm file. The (third) argument to .Xr ioctl 2 should be a pointer to the type indicated. .Bl -tag -width BIOCGETBUFMODE .It Dv BIOCGBLEN .Pq Li u_int Returns the required buffer length for reads on .Nm files. .It Dv BIOCSBLEN .Pq Li u_int Sets the buffer length for reads on .Nm files. The buffer must be set before the file is attached to an interface with .Dv BIOCSETIF . If the requested buffer size cannot be accommodated, the closest allowable size will be set and returned in the argument. A read call will result in .Er EIO if it is passed a buffer that is not this size. .It Dv BIOCGDLT .Pq Li u_int Returns the type of the data link layer underlying the attached interface. .Er EINVAL is returned if no interface has been specified. The device types, prefixed with .Dq Li DLT_ , are defined in .In net/bpf.h . .It Dv BIOCPROMISC Forces the interface into promiscuous mode. All packets, not just those destined for the local host, are processed. Since more than one file can be listening on a given interface, a listener that opened its interface non-promiscuously may receive packets promiscuously. This problem can be remedied with an appropriate filter. .It Dv BIOCFLUSH Flushes the buffer of incoming packets, and resets the statistics that are returned by BIOCGSTATS. .It Dv BIOCGETIF .Pq Li "struct ifreq" Returns the name of the hardware interface that the file is listening on. The name is returned in the ifr_name field of the .Li ifreq structure. All other fields are undefined. .It Dv BIOCSETIF .Pq Li "struct ifreq" Sets the hardware interface associate with the file. This command must be performed before any packets can be read. The device is indicated by name using the .Li ifr_name field of the .Li ifreq structure. Additionally, performs the actions of .Dv BIOCFLUSH . .It Dv BIOCSRTIMEOUT .It Dv BIOCGRTIMEOUT .Pq Li "struct timeval" Set or get the read timeout parameter. The argument specifies the length of time to wait before timing out on a read request. This parameter is initialized to zero by .Xr open 2 , indicating no timeout. .It Dv BIOCGSTATS .Pq Li "struct bpf_stat" Returns the following structure of packet statistics: .Bd -literal struct bpf_stat { u_int bs_recv; /* number of packets received */ u_int bs_drop; /* number of packets dropped */ }; .Ed .Pp The fields are: .Bl -hang -offset indent .It Li bs_recv the number of packets received by the descriptor since opened or reset (including any buffered since the last read call); and .It Li bs_drop the number of packets which were accepted by the filter but dropped by the kernel because of buffer overflows (i.e., the application's reads are not keeping up with the packet traffic). .El .It Dv BIOCIMMEDIATE .Pq Li u_int Enable or disable .Dq immediate mode , based on the truth value of the argument. When immediate mode is enabled, reads return immediately upon packet reception. Otherwise, a read will block until either the kernel buffer becomes full or a timeout occurs. This is useful for programs like .Xr rarpd 8 which must respond to messages in real time. The default for a new file is off. .It Dv BIOCSETF .It Dv BIOCSETFNR .Pq Li "struct bpf_program" Sets the read filter program used by the kernel to discard uninteresting packets. An array of instructions and its length is passed in using the following structure: .Bd -literal struct bpf_program { int bf_len; struct bpf_insn *bf_insns; }; .Ed .Pp The filter program is pointed to by the .Li bf_insns field while its length in units of .Sq Li struct bpf_insn is given by the .Li bf_len field. See section .Sx "FILTER MACHINE" for an explanation of the filter language. The only difference between .Dv BIOCSETF and .Dv BIOCSETFNR is .Dv BIOCSETF performs the actions of .Dv BIOCFLUSH while .Dv BIOCSETFNR does not. .It Dv BIOCSETWF .Pq Li "struct bpf_program" Sets the write filter program used by the kernel to control what type of packets can be written to the interface. See the .Dv BIOCSETF command for more information on the .Nm filter program. .It Dv BIOCVERSION .Pq Li "struct bpf_version" Returns the major and minor version numbers of the filter language currently recognized by the kernel. Before installing a filter, applications must check that the current version is compatible with the running kernel. Version numbers are compatible if the major numbers match and the application minor is less than or equal to the kernel minor. The kernel version number is returned in the following structure: .Bd -literal struct bpf_version { u_short bv_major; u_short bv_minor; }; .Ed .Pp The current version numbers are given by .Dv BPF_MAJOR_VERSION and .Dv BPF_MINOR_VERSION from .In net/bpf.h . An incompatible filter may result in undefined behavior (most likely, an error returned by .Fn ioctl or haphazard packet matching). .It Dv BIOCSHDRCMPLT .It Dv BIOCGHDRCMPLT .Pq Li u_int Set or get the status of the .Dq header complete flag. Set to zero if the link level source address should be filled in automatically by the interface output routine. Set to one if the link level source address will be written, as provided, to the wire. This flag is initialized to zero by default. .It Dv BIOCSSEESENT .It Dv BIOCGSEESENT .Pq Li u_int These commands are obsolete but left for compatibility. Use .Dv BIOCSDIRECTION and .Dv BIOCGDIRECTION instead. Set or get the flag determining whether locally generated packets on the interface should be returned by BPF. Set to zero to see only incoming packets on the interface. Set to one to see packets originating locally and remotely on the interface. This flag is initialized to one by default. .It Dv BIOCSDIRECTION .It Dv BIOCGDIRECTION .Pq Li u_int Set or get the setting determining whether incoming, outgoing, or all packets on the interface should be returned by BPF. Set to .Dv BPF_D_IN to see only incoming packets on the interface. Set to .Dv BPF_D_INOUT to see packets originating locally and remotely on the interface. Set to .Dv BPF_D_OUT to see only outgoing packets on the interface. This setting is initialized to .Dv BPF_D_INOUT by default. .It Dv BIOCSTSTAMP .It Dv BIOCGTSTAMP .Pq Li u_int Set or get format and resolution of the time stamps returned by BPF. Set to .Dv BPF_T_MICROTIME , .Dv BPF_T_MICROTIME_FAST , .Dv BPF_T_MICROTIME_MONOTONIC , or .Dv BPF_T_MICROTIME_MONOTONIC_FAST to get time stamps in 64-bit .Vt struct timeval format. Set to .Dv BPF_T_NANOTIME , .Dv BPF_T_NANOTIME_FAST , .Dv BPF_T_NANOTIME_MONOTONIC , or .Dv BPF_T_NANOTIME_MONOTONIC_FAST to get time stamps in 64-bit .Vt struct timespec format. Set to .Dv BPF_T_BINTIME , .Dv BPF_T_BINTIME_FAST , .Dv BPF_T_NANOTIME_MONOTONIC , or .Dv BPF_T_BINTIME_MONOTONIC_FAST to get time stamps in 64-bit .Vt struct bintime format. Set to .Dv BPF_T_NONE to ignore time stamp. All 64-bit time stamp formats are wrapped in .Vt struct bpf_ts . The .Dv BPF_T_MICROTIME_FAST , .Dv BPF_T_NANOTIME_FAST , .Dv BPF_T_BINTIME_FAST , .Dv BPF_T_MICROTIME_MONOTONIC_FAST , .Dv BPF_T_NANOTIME_MONOTONIC_FAST , and .Dv BPF_T_BINTIME_MONOTONIC_FAST are analogs of corresponding formats without _FAST suffix but do not perform a full time counter query, so their accuracy is one timer tick. The .Dv BPF_T_MICROTIME_MONOTONIC , .Dv BPF_T_NANOTIME_MONOTONIC , .Dv BPF_T_BINTIME_MONOTONIC , .Dv BPF_T_MICROTIME_MONOTONIC_FAST , .Dv BPF_T_NANOTIME_MONOTONIC_FAST , and .Dv BPF_T_BINTIME_MONOTONIC_FAST store the time elapsed since kernel boot. This setting is initialized to .Dv BPF_T_MICROTIME by default. .It Dv BIOCFEEDBACK .Pq Li u_int Set packet feedback mode. This allows injected packets to be fed back as input to the interface when output via the interface is successful. When .Dv BPF_D_INOUT direction is set, injected outgoing packet is not returned by BPF to avoid -duplication. This flag is initialized to zero by default. +duplication. +This flag is initialized to zero by default. .It Dv BIOCLOCK Set the locked flag on the .Nm descriptor. This prevents the execution of ioctl commands which could change the underlying operating parameters of the device. .It Dv BIOCGETBUFMODE .It Dv BIOCSETBUFMODE .Pq Li u_int Get or set the current .Nm buffering mode; possible values are .Dv BPF_BUFMODE_BUFFER , buffered read mode, and .Dv BPF_BUFMODE_ZBUF , zero-copy buffer mode. .It Dv BIOCSETZBUF .Pq Li struct bpf_zbuf Set the current zero-copy buffer locations; buffer locations may be set only once zero-copy buffer mode has been selected, and prior to attaching to an interface. Buffers must be of identical size, page-aligned, and an integer multiple of pages in size. The three fields .Vt bz_bufa , .Vt bz_bufb , and .Vt bz_buflen must be filled out. If buffers have already been set for this device, the ioctl will fail. .It Dv BIOCGETZMAX .Pq Li size_t Get the largest individual zero-copy buffer size allowed. As two buffers are used in zero-copy buffer mode, the limit (in practice) is twice the returned size. As zero-copy buffers consume kernel address space, conservative selection of buffer size is suggested, especially when there are multiple .Nm descriptors in use on 32-bit systems. .It Dv BIOCROTZBUF Force ownership of the next buffer to be assigned to userspace, if any data present in the buffer. If no data is present, the buffer will remain owned by the kernel. This allows consumers of zero-copy buffering to implement timeouts and retrieve partially filled buffers. In order to handle the case where no data is present in the buffer and therefore ownership is not assigned, the user process must check .Vt bzh_kernel_gen against .Vt bzh_user_gen . .El .Sh BPF HEADER One of the following structures is prepended to each packet returned by .Xr read 2 or via a zero-copy buffer: .Bd -literal struct bpf_xhdr { struct bpf_ts bh_tstamp; /* time stamp */ uint32_t bh_caplen; /* length of captured portion */ uint32_t bh_datalen; /* original length of packet */ u_short bh_hdrlen; /* length of bpf header (this struct plus alignment padding) */ }; struct bpf_hdr { struct timeval bh_tstamp; /* time stamp */ uint32_t bh_caplen; /* length of captured portion */ uint32_t bh_datalen; /* original length of packet */ u_short bh_hdrlen; /* length of bpf header (this struct plus alignment padding) */ }; .Ed .Pp The fields, whose values are stored in host order, and are: .Pp .Bl -tag -compact -width bh_datalen .It Li bh_tstamp The time at which the packet was processed by the packet filter. .It Li bh_caplen The length of the captured portion of the packet. This is the minimum of the truncation amount specified by the filter and the length of the packet. .It Li bh_datalen The length of the packet off the wire. This value is independent of the truncation amount specified by the filter. .It Li bh_hdrlen The length of the .Nm header, which may not be equal to .\" XXX - not really a function call .Fn sizeof "struct bpf_xhdr" or .Fn sizeof "struct bpf_hdr" . .El .Pp The .Li bh_hdrlen field exists to account for padding between the header and the link level protocol. The purpose here is to guarantee proper alignment of the packet data structures, which is required on alignment sensitive architectures and improves performance on many other architectures. The packet filter ensures that the .Vt bpf_xhdr , .Vt bpf_hdr and the network layer header will be word aligned. Currently, .Vt bpf_hdr is used when the time stamp is set to .Dv BPF_T_MICROTIME , .Dv BPF_T_MICROTIME_FAST , .Dv BPF_T_MICROTIME_MONOTONIC , .Dv BPF_T_MICROTIME_MONOTONIC_FAST , or .Dv BPF_T_NONE for backward compatibility reasons. Otherwise, .Vt bpf_xhdr is used. However, .Vt bpf_hdr may be deprecated in the near future. Suitable precautions must be taken when accessing the link layer protocol fields on alignment restricted machines. (This is not a problem on an Ethernet, since the type field is a short falling on an even offset, and the addresses are probably accessed in a bytewise fashion). .Pp Additionally, individual packets are padded so that each starts on a word boundary. This requires that an application has some knowledge of how to get from packet to packet. The macro .Dv BPF_WORDALIGN is defined in .In net/bpf.h to facilitate this process. It rounds up its argument to the nearest word aligned value (where a word is .Dv BPF_ALIGNMENT bytes wide). .Pp For example, if .Sq Li p points to the start of a packet, this expression will advance it to the next packet: .Dl p = (char *)p + BPF_WORDALIGN(p->bh_hdrlen + p->bh_caplen) .Pp For the alignment mechanisms to work properly, the buffer passed to .Xr read 2 must itself be word aligned. The .Xr malloc 3 function will always return an aligned buffer. .Sh FILTER MACHINE A filter program is an array of instructions, with all branches forwardly directed, terminated by a .Em return instruction. Each instruction performs some action on the pseudo-machine state, which consists of an accumulator, index register, scratch memory store, and implicit program counter. .Pp The following structure defines the instruction format: .Bd -literal struct bpf_insn { u_short code; u_char jt; u_char jf; u_long k; }; .Ed .Pp The .Li k field is used in different ways by different instructions, and the .Li jt and .Li jf fields are used as offsets by the branch instructions. The opcodes are encoded in a semi-hierarchical fashion. There are eight classes of instructions: .Dv BPF_LD , .Dv BPF_LDX , .Dv BPF_ST , .Dv BPF_STX , .Dv BPF_ALU , .Dv BPF_JMP , .Dv BPF_RET , and .Dv BPF_MISC . Various other mode and operator bits are or'd into the class to give the actual instructions. The classes and modes are defined in .In net/bpf.h . .Pp Below are the semantics for each defined .Nm instruction. We use the convention that A is the accumulator, X is the index register, P[] packet data, and M[] scratch memory store. P[i:n] gives the data at byte offset .Dq i in the packet, interpreted as a word (n=4), unsigned halfword (n=2), or unsigned byte (n=1). M[i] gives the i'th word in the scratch memory store, which is only addressed in word units. The memory store is indexed from 0 to .Dv BPF_MEMWORDS - 1. .Li k , .Li jt , and .Li jf are the corresponding fields in the instruction definition. .Dq len refers to the length of the packet. .Bl -tag -width BPF_STXx .It Dv BPF_LD These instructions copy a value into the accumulator. The type of the source operand is specified by an .Dq addressing mode and can be a constant .Pq Dv BPF_IMM , packet data at a fixed offset .Pq Dv BPF_ABS , packet data at a variable offset .Pq Dv BPF_IND , the packet length .Pq Dv BPF_LEN , or a word in the scratch memory store .Pq Dv BPF_MEM . For .Dv BPF_IND and .Dv BPF_ABS , the data size must be specified as a word .Pq Dv BPF_W , halfword .Pq Dv BPF_H , or byte .Pq Dv BPF_B . The semantics of all the recognized .Dv BPF_LD instructions follow. .Bd -literal BPF_LD+BPF_W+BPF_ABS A <- P[k:4] BPF_LD+BPF_H+BPF_ABS A <- P[k:2] BPF_LD+BPF_B+BPF_ABS A <- P[k:1] BPF_LD+BPF_W+BPF_IND A <- P[X+k:4] BPF_LD+BPF_H+BPF_IND A <- P[X+k:2] BPF_LD+BPF_B+BPF_IND A <- P[X+k:1] BPF_LD+BPF_W+BPF_LEN A <- len BPF_LD+BPF_IMM A <- k BPF_LD+BPF_MEM A <- M[k] .Ed .It Dv BPF_LDX These instructions load a value into the index register. Note that the addressing modes are more restrictive than those of the accumulator loads, but they include .Dv BPF_MSH , a hack for efficiently loading the IP header length. .Bd -literal BPF_LDX+BPF_W+BPF_IMM X <- k BPF_LDX+BPF_W+BPF_MEM X <- M[k] BPF_LDX+BPF_W+BPF_LEN X <- len BPF_LDX+BPF_B+BPF_MSH X <- 4*(P[k:1]&0xf) .Ed .It Dv BPF_ST This instruction stores the accumulator into the scratch memory. We do not need an addressing mode since there is only one possibility for the destination. .Bd -literal BPF_ST M[k] <- A .Ed .It Dv BPF_STX This instruction stores the index register in the scratch memory store. .Bd -literal BPF_STX M[k] <- X .Ed .It Dv BPF_ALU The alu instructions perform operations between the accumulator and index register or constant, and store the result back in the accumulator. For binary operations, a source mode is required .Dv ( BPF_K or .Dv BPF_X ) . .Bd -literal BPF_ALU+BPF_ADD+BPF_K A <- A + k BPF_ALU+BPF_SUB+BPF_K A <- A - k BPF_ALU+BPF_MUL+BPF_K A <- A * k BPF_ALU+BPF_DIV+BPF_K A <- A / k BPF_ALU+BPF_AND+BPF_K A <- A & k BPF_ALU+BPF_OR+BPF_K A <- A | k BPF_ALU+BPF_LSH+BPF_K A <- A << k BPF_ALU+BPF_RSH+BPF_K A <- A >> k BPF_ALU+BPF_ADD+BPF_X A <- A + X BPF_ALU+BPF_SUB+BPF_X A <- A - X BPF_ALU+BPF_MUL+BPF_X A <- A * X BPF_ALU+BPF_DIV+BPF_X A <- A / X BPF_ALU+BPF_AND+BPF_X A <- A & X BPF_ALU+BPF_OR+BPF_X A <- A | X BPF_ALU+BPF_LSH+BPF_X A <- A << X BPF_ALU+BPF_RSH+BPF_X A <- A >> X BPF_ALU+BPF_NEG A <- -A .Ed .It Dv BPF_JMP The jump instructions alter flow of control. Conditional jumps compare the accumulator against a constant .Pq Dv BPF_K or the index register .Pq Dv BPF_X . If the result is true (or non-zero), the true branch is taken, otherwise the false branch is taken. Jump offsets are encoded in 8 bits so the longest jump is 256 instructions. However, the jump always .Pq Dv BPF_JA opcode uses the 32 bit .Li k field as the offset, allowing arbitrarily distant destinations. All conditionals use unsigned comparison conventions. .Bd -literal BPF_JMP+BPF_JA pc += k BPF_JMP+BPF_JGT+BPF_K pc += (A > k) ? jt : jf BPF_JMP+BPF_JGE+BPF_K pc += (A >= k) ? jt : jf BPF_JMP+BPF_JEQ+BPF_K pc += (A == k) ? jt : jf BPF_JMP+BPF_JSET+BPF_K pc += (A & k) ? jt : jf BPF_JMP+BPF_JGT+BPF_X pc += (A > X) ? jt : jf BPF_JMP+BPF_JGE+BPF_X pc += (A >= X) ? jt : jf BPF_JMP+BPF_JEQ+BPF_X pc += (A == X) ? jt : jf BPF_JMP+BPF_JSET+BPF_X pc += (A & X) ? jt : jf .Ed .It Dv BPF_RET The return instructions terminate the filter program and specify the amount of packet to accept (i.e., they return the truncation amount). A return value of zero indicates that the packet should be ignored. The return value is either a constant .Pq Dv BPF_K or the accumulator .Pq Dv BPF_A . .Bd -literal BPF_RET+BPF_A accept A bytes BPF_RET+BPF_K accept k bytes .Ed .It Dv BPF_MISC The miscellaneous category was created for anything that does not fit into the above classes, and for any new instructions that might need to be added. Currently, these are the register transfer instructions that copy the index register to the accumulator or vice versa. .Bd -literal BPF_MISC+BPF_TAX X <- A BPF_MISC+BPF_TXA A <- X .Ed .El .Pp The .Nm interface provides the following macros to facilitate array initializers: .Fn BPF_STMT opcode operand and .Fn BPF_JUMP opcode operand true_offset false_offset . .Sh SYSCTL VARIABLES A set of .Xr sysctl 8 variables controls the behaviour of the .Nm subsystem .Bl -tag -width indent .It Va net.bpf.optimize_writers: No 0 Various programs use BPF to send (but not receive) raw packets (cdpd, lldpd, dhcpd, dhcp relays, etc. are good examples of such programs). They do not need incoming packets to be send to them. Turning this option on makes new BPF users to be attached to write-only interface list until program explicitly specifies read filter via .Fn pcap_set_filter . This removes any performance degradation for high-speed interfaces. .It Va net.bpf.stats: Binary interface for retrieving general statistics. .It Va net.bpf.zerocopy_enable: No 0 Permits zero-copy to be used with net BPF readers. Use with caution. .It Va net.bpf.maxinsns: No 512 Maximum number of instructions that BPF program can contain. Use .Xr tcpdump 1 .Fl d option to determine approximate number of instruction for any filter. .It Va net.bpf.maxbufsize: No 524288 Maximum buffer size to allocate for packets buffer. .It Va net.bpf.bufsize: No 4096 Default buffer size to allocate for packets buffer. .El .Sh EXAMPLES The following filter is taken from the Reverse ARP Daemon. It accepts only Reverse ARP requests. .Bd -literal struct bpf_insn insns[] = { BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ETHERTYPE_REVARP, 0, 3), BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 20), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, REVARP_REQUEST, 0, 1), BPF_STMT(BPF_RET+BPF_K, sizeof(struct ether_arp) + sizeof(struct ether_header)), BPF_STMT(BPF_RET+BPF_K, 0), }; .Ed .Pp This filter accepts only IP packets between host 128.3.112.15 and 128.3.112.35. .Bd -literal struct bpf_insn insns[] = { BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ETHERTYPE_IP, 0, 8), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 26), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 2), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 3, 4), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 3), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 1), BPF_STMT(BPF_RET+BPF_K, (u_int)-1), BPF_STMT(BPF_RET+BPF_K, 0), }; .Ed .Pp Finally, this filter returns only TCP finger packets. We must parse the IP header to reach the TCP header. The .Dv BPF_JSET instruction checks that the IP fragment offset is 0 so we are sure that we have a TCP header. .Bd -literal struct bpf_insn insns[] = { BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ETHERTYPE_IP, 0, 10), BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 23), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, IPPROTO_TCP, 0, 8), BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 20), BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 0x1fff, 6, 0), BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 14), BPF_STMT(BPF_LD+BPF_H+BPF_IND, 14), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 79, 2, 0), BPF_STMT(BPF_LD+BPF_H+BPF_IND, 16), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 79, 0, 1), BPF_STMT(BPF_RET+BPF_K, (u_int)-1), BPF_STMT(BPF_RET+BPF_K, 0), }; .Ed .Sh SEE ALSO .Xr tcpdump 1 , .Xr ioctl 2 , .Xr kqueue 2 , .Xr poll 2 , .Xr select 2 , .Xr byteorder 3 , .Xr ng_bpf 4 , .Xr bpf 9 .Rs .%A McCanne, S. .%A Jacobson V. .%T "An efficient, extensible, and portable network monitor" .Re .Sh HISTORY The Enet packet filter was created in 1980 by Mike Accetta and Rick Rashid at Carnegie-Mellon University. Jeffrey Mogul, at Stanford, ported the code to .Bx and continued its development from 1983 on. Since then, it has evolved into the Ultrix Packet Filter at .Tn DEC , a .Tn STREAMS .Tn NIT module under .Tn SunOS 4.1 , and .Tn BPF . .Sh AUTHORS .An -nosplit .An Steven McCanne , of Lawrence Berkeley Laboratory, implemented BPF in Summer 1990. Much of the design is due to .An Van Jacobson . .Pp Support for zero-copy buffers was added by .An Robert N. M. Watson under contract to Seccuris Inc. .Sh BUGS The read buffer must be of a fixed size (returned by the .Dv BIOCGBLEN ioctl). .Pp A file that does not request promiscuous mode may receive promiscuously received packets as a side effect of another file requesting this mode on the same hardware interface. This could be fixed in the kernel with additional processing overhead. However, we favor the model where all files must assume that the interface is promiscuous, and if so desired, must utilize a filter to reject foreign packets. .Pp Data link protocols with variable length headers are not currently supported. .Pp The .Dv SEESENT , .Dv DIRECTION , and .Dv FEEDBACK settings have been observed to work incorrectly on some interface types, including those with hardware loopback rather than software loopback, and point-to-point interfaces. They appear to function correctly on a broad range of Ethernet-style interfaces. Index: head/share/man/man4/cmx.4 =================================================================== --- head/share/man/man4/cmx.4 (revision 301588) +++ head/share/man/man4/cmx.4 (revision 301589) @@ -1,120 +1,123 @@ .\" .\" Copyright (c) 2006-2007 Daniel Roethlisberger .\" 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 unmodified, 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 July 7, 2007 .Dt CMX 4 .Os .Sh NAME .Nm cmx .Nd Omnikey CardMan 4040 smartcard reader device driver .Sh SYNOPSIS .Cd device cmx .Sh DESCRIPTION The .Nm driver provides support for the PCCARD based .Em Omnikey CardMan 4040 smartcard reader. The driver provides a character device special file based .Em Chip/Smart Card Interface Devices (CCID) -interface. The driver implements what the vendor calls the +interface. +The driver implements what the vendor calls the .Em Synchronous API onto the smartcard reader device. .Pp Reading and writing is synchronous, meaning that a call to .Xr write 2 directly corresponds to a complete CCID command sent to the device, while the following .Xr read 2 -will return the complete answer from the reader. There is no -support for partial reads or writes. There is no upper limit on +will return the complete answer from the reader. +There is no support for partial reads or writes. +There is no upper limit on CCID request or response sizes, but the complete CCID request must be sent to the driver in .Xr write 2 and the complete CCID response must fit into the buffer supplied to .Xr read 2 . .Pp Non-blocking I/O, .Xr select 2 and .Xr poll 2 -are supported and work as expected. An open file descriptor +are supported and work as expected. +An open file descriptor will always be ready for writing, but only ready for reading if the device indicates that it has data available. .Sh FILES .Bl -tag -width /usr/ports/security/openct -compact .It Pa /dev/cmx\fBn\fP Character device special file. .It Pa /usr/ports/security/openct OpenCT, a userspace smartcard daemon containing a .Em CCID driver which directly supports .Nm devices. .\".It Pa /usr/ports/devel/pcsc-lite .\"PC/SC-Lite, a userspace smartcard daemon. .\".It Pa /usr/ports/devel/libccid .\"libccid, a generic .\".Em CCID .\"driver for use by PC/SC-Lite to interface to .\".Nm .\"devices. .El .Sh COMPATIBILITY Userland smartcard code written for the vendor's Linux drivers should work with the .Nm driver without modification. .Sh SEE ALSO .Xr pccard 4 .Sh HISTORY The .Nm cmx driver first appeared in .Fx 7.1 . .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Daniel Roethlisberger Aq Mt daniel@roe.ch , originally based on the Linux driver v1.1.0 by .An Omnikey GmbH Lk www.omnikey.com . Early testing and bug fixes by .An Marcin Cieslak Aq Mt saper@system.pl . .Sh BUGS .An -nosplit The way the .Nm -driver talks to the CardMan 4040 is a bit rough. Due to the -complete lack of hardware documentation other than vendor drivers +driver talks to the CardMan 4040 is a bit rough. +Due to the complete lack of hardware documentation other than vendor drivers for other operating systems, the gory details of the device's -I/O registers are not understood very well. There may be error -conditions which can only be solved by physically reinserting the -reader. +I/O registers are not understood very well. +There may be error conditions which can only be solved by physically +reinserting the reader. Index: head/share/man/man4/cxgbe.4 =================================================================== --- head/share/man/man4/cxgbe.4 (revision 301588) +++ head/share/man/man4/cxgbe.4 (revision 301589) @@ -1,338 +1,340 @@ .\" Copyright (c) 2011-2014, Chelsio Inc .\" 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. .\" .\" 3. Neither the name of the Chelsio Inc nor the names of its .\" contributors may be used to endorse or promote products derived from .\" this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. .\" .\" * Other names and brands may be claimed as the property of others. .\" .\" $FreeBSD$ .\" .Dd December 2, 2015 .Dt CXGBE 4 .Os .Sh NAME .Nm cxgbe .Nd "Chelsio T4 and T5 based 40Gb, 10Gb, and 1Gb Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device cxgbe" .Ed .Pp To load the driver as a module at boot time, place the following lines in .Xr loader.conf 5 : .Bd -literal -offset indent t4fw_cfg_load="YES" t5fw_cfg_load="YES" if_cxgbe_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for PCI Express Ethernet adapters based on the Chelsio Terminator 4 and Terminator 5 ASICs (T4 and T5). The driver supports Jumbo Frames, Transmit/Receive checksum offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN tag insertion/extraction, VLAN checksum offload, VLAN TSO, and Receive Side Steering (RSS). For further hardware information and questions related to hardware requirements, see .Pa http://www.chelsio.com/ . .Pp Note that ports of T5 cards are named cxl and attach to a t5nex parent device (in contrast to ports named cxgbe that attach to a t4nex parent for a T4 card). Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 cards. The sysctl MIBs are at dev.t5nex and dev.cxl for T5 cards and at dev.t4nex and dev.cxgbe for T4 cards. .Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm driver supports 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC (ports will be named cxl): .Pp .Bl -bullet -compact .It Chelsio T580-CR .It Chelsio T580-LP-CR .It Chelsio T580-LP-SO-CR .It Chelsio T560-CR .It Chelsio T540-CR .It Chelsio T540-LP-CR .It Chelsio T522-CR .It Chelsio T520-LL-CR .It Chelsio T520-CR .It Chelsio T520-SO .It Chelsio T520-BT .It Chelsio T504-BT .El .Pp The .Nm driver supports 10Gb and 1Gb Ethernet adapters based on the T4 ASIC: .Pp .Bl -bullet -compact .It Chelsio T420-CR .It Chelsio T422-CR .It Chelsio T440-CR .It Chelsio T420-BCH .It Chelsio T440-BCH .It Chelsio T440-CH .It Chelsio T420-SO .It Chelsio T420-CX .It Chelsio T420-BT .It Chelsio T404-BT .El .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent .It Va hw.cxgbe.ntxq10g The number of tx queues to use for a 10Gb or 40Gb port. The default is 16 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nrxq10g The number of rx queues to use for a 10Gb or 40Gb port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.ntxq1g The number of tx queues to use for a 1Gb port. The default is 4 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nrxq1g The number of rx queues to use for a 1Gb port. The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldtxq10g The number of TOE tx queues to use for a 10Gb or 40Gb port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldrxq10g The number of TOE rx queues to use for a 10Gb or 40Gb port. The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldtxq1g The number of TOE tx queues to use for a 1Gb port. The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldrxq1g The number of TOE rx queues to use for a 1Gb port. The default is 1. .It Va hw.cxgbe.num_vis The number of virtual interfaces (VIs) created for each port. Each virtual interface creates a separate network interface. The first virtual interface on each port is required and represents the primary network interface on the port. Additional virtual interfaces on a port are named vcxgbe (T4) or vcxl (T5) and only use a single rx and tx queue. Additional virtual interfaces use a single pair of queues for rx and tx as well an additional pair of queues for TOE rx and tx. The default is 1. .It Va hw.cxgbe.holdoff_timer_idx_10G .It Va hw.cxgbe.holdoff_timer_idx_1G The timer index value to use to delay interrupts. The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 by default (all values are in microseconds) and the index selects a value from this list. The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the dev.cxgbe.X.holdoff_tmr_idx or dev.cxl.X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G The packet-count index value to use to delay interrupts. The packet-count list has the values 1, 8, 16, and 32 by default and the index selects a value from this list. The default value is -1 which means packet counting is disabled and interrupts are generated based solely on the holdoff timer value. Different interfaces can be assigned different values via the dev.cxgbe.X.holdoff_pktc_idx or dev.cxl.X.holdoff_pktc_idx sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_txq The size, in number of entries, of the descriptor ring used for a tx queue. A buf_ring of the same size is also allocated for additional software queuing. See .Xr ifnet 9 . The default value is 1024. Different interfaces can be assigned different values via the dev.cxgbe.X.qsize_txq sysctl or dev.cxl.X.qsize_txq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_rxq The size, in number of entries, of the descriptor ring used for an rx queue. The default value is 1024. Different interfaces can be assigned different values via the dev.cxgbe.X.qsize_rxq or dev.cxl.X.qsize_rxq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.interrupt_types The interrupt types that the driver is allowed to use. Bit 0 represents INTx (line interrupts), bit 1 MSI, bit 2 MSI-X. The default is 7 (all allowed). The driver will select the best possible type out of the allowed types by itself. .It Va hw.cxgbe.fw_install 0 prohibits the driver from installing a firmware on the card. 1 allows the driver to install a new firmware if internal driver heuristics indicate that the new firmware is preferable to the one already on the card. 2 instructs the driver to always install the new firmware on the card as long as it is compatible with the driver and is a different version than the one already on the card. The default is 1. .It Va hw.cxgbe.fl_pktshift The number of bytes of padding inserted before the beginning of an Ethernet frame in the receive buffer. The default value of 2 ensures that the Ethernet payload (usually the IP header) is at a 4 byte aligned address. 0-7 are all valid values. .It Va hw.cxgbe.fl_pad A non-zero value ensures that writes from the hardware to a receive buffer are padded up to the specified boundary. The default is -1 which lets the driver pick a pad boundary. 0 disables trailer padding completely. .It Va hw.cxgbe.cong_drop Controls the hardware response to congestion. -1 disables congestion feedback and is not recommended. 0 instructs the hardware to backpressure its pipeline on congestion. This usually results in the port emitting PAUSE frames. 1 instructs the hardware to drop frames destined for congested queues. .It Va hw.cxgbe.pause_settings PAUSE frame settings. Bit 0 is rx_pause, bit 1 is tx_pause. rx_pause = 1 instructs the hardware to heed incoming PAUSE frames, 0 instructs it to ignore them. tx_pause = 1 allows the hardware to emit PAUSE frames when its receive FIFO reaches a high threshold, 0 prohibits the hardware from emitting PAUSE frames. The default is 3 (both rx_pause and tx_pause = 1). This tunable establishes the default PAUSE settings for all ports. Settings can be displayed and controlled on a per-port basis via the dev.cxgbe.X.pause_settings (dev.cxl.X.pause_settings for T5 cards) sysctl. .It Va hw.cxgbe.buffer_packing Allow the hardware to deliver multiple frames in the same receive buffer opportunistically. The default is -1 which lets the driver decide. 0 or 1 explicitly disable or enable this feature. .It Va hw.cxgbe.allow_mbufs_in_cluster 1 allows the driver to lay down one or more mbufs within the receive buffer -opportunistically. This is the default. +opportunistically. +This is the default. 0 prohibits the driver from doing so. .It Va hw.cxgbe.largest_rx_cluster .It Va hw.cxgbe.safest_rx_cluster -Sizes of rx clusters. Each of these must be set to one of the sizes available +Sizes of rx clusters. +Each of these must be set to one of the sizes available (usually 2048, 4096, 9216, and 16384) and largest_rx_cluster must be greater than or equal to safest_rx_cluster. The defaults are 16384 and 4096 respectively. The driver will never attempt to allocate a receive buffer larger than largest_rx_cluster and will fall back to allocating buffers of safest_rx_cluster size if an allocation larger than safest_rx_cluster fails. Note that largest_rx_cluster merely establishes a ceiling -- the driver is allowed to allocate buffers of smaller sizes. .It Va hw.cxgbe.config_file Select a pre-packaged device configuration file. A configuration file contains a recipe for partitioning and configuring the hardware resources on the card. This tunable is for specialized applications only and should not be used in normal operation. The configuration profile currently in use is available in the dev.t4nex.X.cf and dev.t4nex.X.cfcsum (dev.t5nex for T5 cards) sysctls. .It Va hw.cxgbe.linkcaps_allowed .It Va hw.cxgbe.niccaps_allowed .It Va hw.cxgbe.toecaps_allowed .It Va hw.cxgbe.rdmacaps_allowed .It Va hw.cxgbe.iscsicaps_allowed .It Va hw.cxgbe.fcoecaps_allowed Disallowing capabilities provides a hint to the driver and firmware to not reserve hardware resources for that feature. Each of these is a bit field with a bit for each sub-capability within the capability. This tunable is for specialized applications only and should not be used in normal operation. The capabilities for which hardware resources have been reserved are listed in dev.t4nex.X.*caps or dev.t5nex.X.*caps sysctls. .El .Sh SUPPORT For general information and support, go to the Chelsio support website at: .Pa http://www.chelsio.com/ . .Pp If an issue is identified with this driver with a supported adapter, email all the specific information related to the issue to .Aq Mt support@chelsio.com . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , .Xr cxgb 4 , .Xr netintro 4 , .Xr ng_ether 4 , .Xr ifconfig 8 .Sh HISTORY The .Nm device driver first appeared in .Fx 9.0 . Support for T5 cards first appeared in .Fx 9.2 and .Fx 10.0 . .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Navdeep Parhar Aq Mt np@FreeBSD.org . Index: head/share/man/man4/devctl.4 =================================================================== --- head/share/man/man4/devctl.4 (revision 301588) +++ head/share/man/man4/devctl.4 (revision 301589) @@ -1,128 +1,129 @@ .\" .\" Copyright (c) 2002 M. Warner Losh .\" 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. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission. .\" .\" 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 March 26, 2014 .Dt DEVCTL 4 .Os .Sh NAME .Nm devctl .Nd "device event reporting and device control interface" .Sh DESCRIPTION The .Nm device is used to report device events from the kernel. Future versions will allow for some device control as well. .Sh IMPLEMENTATION NOTES This design allows only one reader for .Pa /dev/devctl . This is not desirable in the long run, but will get a lot of hair out of this implementation. Maybe we should make this device a clonable device. .Pp Also note: we specifically do not attach a device to the .Vt device_t tree to avoid potential chicken and egg problems. One could argue that all of this belongs to the root node. One could also further argue that the .Xr sysctl 3 interface that we have now might more properly be an .Xr ioctl 2 interface. .Pp .Dv SIGIO support is included in the driver. However, the author is not sure that the .Dv SIGIO support is done correctly. It was copied from a driver that had .Dv SIGIO support that likely has not been tested since .Fx 3.4 or .Fx 2.2.8 ! .Pp The read channel for this device is used to report changes to userland in realtime. We return one record at a time. If you try to read this device a character at a time, you will lose the rest of the data. Listening programs are expected to cope. .Pp The sysctl .Va hw.bus.devctl_queue -can be used to control queue length. It is set to 0 to disable +can be used to control queue length. +It is set to 0 to disable .Nm when no .Xr devd 8 is running. .Sh PROTOCOL The .Nm device uses an .Tn ASCII protocol. The driver returns one record at a time to its readers. Each record is terminated with a newline. The first character of the record is the event type. .Pp .Bl -column -compact "Type" "Description" .Em "Type Description" ! A notify event, such as a link state change. + Device node in tree attached. - Device node in tree detached. ? Unknown device detected. .El .Ss Message Formats Except for the first character in the record, attach and detach messages have the same format. .Pp .D1 Ar T Ns Ar dev Li at Ar parent Li on Ar location .Pp .Bl -column -compact "location" "Description" .Em "Part Description" .It Ar T Ta "+ or -" .It Ar dev Ta "The device name that was attached/detached." .It Ar parent Ta "The device name of the parent bus that attached the device." .It Ar location Ta "Bus specific location information." .El .Pp The nomatch messages can be used to load devices driver. If you load a device driver, then one of two things can happen. If the device driver attaches to something, you will get a device attached message. If it does not, then nothing will happen. .Pp The attach and detach messages arrive after the event. This means one cannot use the attach message to load an alternate driver. The attach message driver has already claimed this device. One cannot use the detach messages to flush data to the device. The device is already gone. .Sh SEE ALSO .Xr devd 8 Index: head/share/man/man4/fdt.4 =================================================================== --- head/share/man/man4/fdt.4 (revision 301588) +++ head/share/man/man4/fdt.4 (revision 301589) @@ -1,186 +1,192 @@ .\" .\" Copyright (c) 2010 The FreeBSD Foundation .\" All rights reserved. .\" .\" This software was developed by Semihalf under sponsorship from .\" the FreeBSD Foundation. .\" .\" 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 July 12, 2010 .Dt FDT 4 .Os .Sh NAME .Nm fdt .Nd Flattened Device Tree support .Sh SYNOPSIS .Cd "options FDT" .Cd "makeoptions FDT_DTS_FILE=.dts" .Cd "options FDT_DTB_STATIC" .Sh DESCRIPTION .Em Flattened Device Tree is a mechanism for describing computer hardware resources, which cannot be -probed or self enumerated, in a uniform and portable way. The primary -consumers of this technology are +probed or self enumerated, in a uniform and portable way. +The primary consumers of this technology are .Em embedded systems, where a lot of designs are based on similar chips, but have different assignment of pins, memory layout, addresses bindings, interrupts routing and other resources. .Pp Configuration data, which cannot be self discovered in run-time, has to be -supplied from external source. The concept of a flattened device tree is a +supplied from external source. +The concept of a flattened device tree is a platform and architecture independent approach for resolving such problems. The idea is inherited from Open Firmware IEEE 1275 device-tree notion, and has -been successfully adopted by the embedded industry. The scheme works in the -following way: +been successfully adopted by the embedded industry. +The scheme works in the following way: .Bl -bullet .It Hardware platform resources are .Em manually described in a human readable text source format, where all non self-enumerating information is gathered. .It This source description is converted .Em (compiled) into a binary object i.e. a flattened device tree .Em blob which is passed to the kernel at boot time. .It The kernel (driver) learns about hardware resources details and dependencies from this [externally supplied] blob, which eliminates the need for embedding any information about the underlying platform hardware resources in the kernel. .It The flattened device tree mechanism in principle does not depend on any -particular first-stage bootloader or firmware features. The only overall +particular first-stage bootloader or firmware features. +The only overall requirement for the environment is to provide a complete device tree description to the kernel. .El .Pp The .Nm layer allows any platform code in the kernel to retrieve information about hardware resources from a unified origin, which brings advantages to the embedded applications (eliminates hard-coded configuration approach, enforces code to be data driven and extensible) leading to easier porting and maintenance. .Sh DEFINITIONS .Bl -tag -width Ar .It Va Device tree source (DTS) The device tree source is a text file which describes hardware resources of a computer system in a human-readable form, with certain hierarchical structure -(a tree). The default location for DTS files -in the +(a tree). +The default location for DTS files in the .Fx source repository is .Pa sys/boot/fdt/dts directory. .It Va Device tree blob (DTB) The textual device tree description (DTS file) is first converted (compiled) into a binary object (the device tree blob) i.e. the DTB, which is handed over to the final consumer (typically kernel) for parsing and processing of its contents. .It Va Device tree compiler (DTC) A utility program executed on the host, which transforms (compiles) a textual description of a device tree (DTS) into a binary object (DTB). .It Va Device tree bindings While the device tree textual description and the binary object are media to convey the hardware configuration information, an actual meaning and interpretation of the contents are defined by the device tree .Pa bindings . They are certain conventions describing definitions (encoding) of particular nodes in a device tree and their properties, allowed values, ranges and so on. Such reference conventions were provided by the legacy Open Firmware bindings, further supplemented by the ePAPR specification. .El .Sh "BUILDING THE WORLD" In order for the system to support .Nm it is required that .Fx world be built with the .Pa WITH_FDT build knob supplied either via .Xr src.conf 5 or command line defined with -D. .Pp This creates the user space .Pa dtc compiler and enables .Nm support in .Xr loader 8 . .Sh "BUILDING KERNEL" There is a couple of options for managing .Nm support at the .Fx kernel level. .Bl -tag -width Ar .It Va options FDT The primary option for enabling .Nm -support in the kernel. It covers all low-level and infrastructure parts of +support in the kernel. +It covers all low-level and infrastructure parts of .Nm kernel support, which primarily are the .Xr fdtbus 4 and .Xr simplebus 4 drivers, as well as helper routines and libraries. .It Va makeoptions FDT_DTS_FILE=.dts Specifies a preferred (default) device tree source (DTS) file for a given -kernel. The indicated DTS file will be converted (compiled) into a binary form -along with building the kernel itself. The DTS file name is relative -to the default location of DTS sources i.e. +kernel. +The indicated DTS file will be converted (compiled) into a binary form +along with building the kernel itself. +The DTS file name is relative to the default location of DTS sources i.e. .Pa sys/boot/fdt/dts . This makeoption is not mandatory unless FDT_DTB_STATIC is also defined (see below). .It Va options FDT_DTB_STATIC Typically, the device tree blob (DTB) is a stand-alone file, physically separate from the kernel, but this option lets statically embed a -DTB file into a kernel image. Note that when this is specified the +DTB file into a kernel image. +Note that when this is specified the FDT_DTS_FILE makeoption becomes mandatory (as there needs to be a DTS file specified in order to embed it into the kernel image). .El .Sh SEE ALSO .Xr fdtbus 4 , .Xr openfirm 4 , .Xr simplebus 4 .Sh STANDARDS IEEE Std 1275: IEEE Standard for Boot (Initialization Configuration) Firmware: Core Requirements and Practices .Pq Vt Open Firmware . .Pp Power.org Standard for Embedded Power Architecture Platform Requirements .Pq Vt ePAPR . .Sh HISTORY The .Nm support first appeared in .Fx 9.0 . .Sh AUTHORS The .Nm support was developed by Semihalf under sponsorship from the FreeBSD -Foundation. This manual page was written by +Foundation. +This manual page was written by .An Rafal Jaworowski . Index: head/share/man/man4/fdtbus.4 =================================================================== --- head/share/man/man4/fdtbus.4 (revision 301588) +++ head/share/man/man4/fdtbus.4 (revision 301589) @@ -1,88 +1,90 @@ .\" .\" Copyright (c) 2010 The FreeBSD Foundation .\" All rights reserved. .\" .\" This software was developed by Semihalf under sponsorship from .\" the FreeBSD Foundation. .\" .\" 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 July 12, 2010 .Dt FDTBUS 4 .Os .Sh NAME .Nm fdtbus .Nd Flattened Device Tree bus driver .Sh SYNOPSIS .Cd "options FDT" .Sh DESCRIPTION The .Nm abstract bus driver is the primary connection and translation layer between .Xr fdt 4 hardware resources description and .Fx -native newbus device drivers framework. For an embedded system +native newbus device drivers framework. +For an embedded system .Nm represents peripherals typically found on a highly integrated chip (system-on-chip). .Pp The .Nm driver provides generic, common infrastructure for all .Xr fdt 4 oriented device drivers, and its main responsibilities are the following: .Bl -bullet .It Creating newbus children that reflect .Xr fdt 4 nodes in the flattened device tree. .It Managing SYS_RES_IRQ resources. .It Managing SYS_RES_MEMORY, SYS_RES_IOPORT resources. .El .Sh SEE ALSO .Xr fdt 4 , .Xr openfirm 4 , .Xr simplebus 4 .Sh STANDARDS IEEE Std 1275: IEEE Standard for Boot (Initialization Configuration) Firmware: Core Requirements and Practices .Pq Vt Open Firmware . .Pp Power.org Standard for Embedded Power Architecture Platform Requirements .Pq Vt ePAPR . .Sh HISTORY The .Nm support first appeared in .Fx 9.0 . .Sh AUTHORS The .Nm support was developed by Semihalf under sponsorship from the FreeBSD -Foundation. This manual page was written by +Foundation. +This manual page was written by .An Rafal Jaworowski . Index: head/share/man/man4/hpet.4 =================================================================== --- head/share/man/man4/hpet.4 (revision 301588) +++ head/share/man/man4/hpet.4 (revision 301589) @@ -1,108 +1,112 @@ .\" Copyright (c) 2010 Alexander Motin .\" 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 September 14, 2010 .Dt HPET 4 .Os .Sh NAME .Nm hpet .Nd High Precision Event Timer driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device acpi" .Ed .Pp The following tunables are settable from the .Xr loader 8 : .Bl -ohang .It Va hint.hpet. Ns Ar X Ns Va .allowed_irqs -is a 32bit mask. Each set bit allows driver to use respective IRQ, +is a 32bit mask. +Each set bit allows driver to use respective IRQ, if BIOS also set respective capability bit in comparator's configuration register. Default value is 0xffff0000, except some known broken hardware. .It Va hint.hpet. Ns Ar X Ns Va .clock -controls event timers functionality support. Setting to 0, disables it. +controls event timers functionality support. +Setting to 0, disables it. Default value is 1. .It Va hint.hpet. Ns Ar X Ns Va .legacy_route -controls "LegacyReplacement Route" mode. If enabled, HPET will steal IRQ0 of -i8254 timer and IRQ8 of RTC. Before using it, make sure that respective +controls "LegacyReplacement Route" mode. +If enabled, HPET will steal IRQ0 of i8254 timer and IRQ8 of RTC. +Before using it, make sure that respective drivers are not using interrupts, by setting also: .Bd -literal hint.attimer.0.clock=0 hint.atrtc.0.clock=0 .Ed Default value is 0. .It Va hint.hpet. Ns Ar X Ns Va .per_cpu controls how much per-CPU event timers should driver attempt to register. This functionality requires every comparator in a group to have own unshared IRQ, so it depends on hardware capabilities and interrupts configuration. Default value is 1. .El .Sh DESCRIPTION This driver uses High Precision Event Timer hardware (part of the chipset, usually enumerated via ACPI) to supply kernel with one time counter and several (usually from 3 to 8) event timers. This hardware includes single main counter with known increment frequency (10MHz or more), and several programmable comparators (optionally with automatic reload feature). When value of the main counter matches current value of any comparator, interrupt can be generated. Depending on hardware capabilities and configuration, interrupt can be delivered as regular I/O APIC interrupt (ISA or PCI) in range from 0 to 31, or as Front Side Bus interrupt, alike to PCI MSI interrupts, or in so called "LegacyReplacement Route" HPET can steal IRQ0 of i8254 and IRQ8 of the RTC. -Interrupt can be either edge- or level-triggered. In last case they could be -safely shared with PCI IRQs. +Interrupt can be either edge- or level-triggered. +In last case they could be safely shared with PCI IRQs. Driver prefers to use FSB interrupts, if supported, to avoid sharing. If it is not possible, it uses single sharable IRQ from PCI range. Other modes (LegacyReplacement and ISA IRQs) require special care to setup, but could be configured manually via device hints. .Pp Event timers provided by the driver support both one-shot an periodic modes and irrelevant to CPU power states. .Pp Depending on hardware capabilities and configuration, driver can expose each comparator as separate event timer or group them into one or several per-CPU -event timers. In last case interrupt of every of those comparators within -group is bound to specific CPU core. This is possible only when each -of these comparators has own unsharable IRQ. +event timers. +In last case interrupt of every of those comparators within +group is bound to specific CPU core. +This is possible only when each of these comparators has own unsharable IRQ. .Sh SEE ALSO .Xr acpi 4 , .Xr apic 4 , .Xr atrtc 4 , .Xr attimer 4 , .Xr eventtimers 4 , .Xr timecounters 4 .Sh HISTORY The .Nm driver first appeared in .Fx 6.3 . Support for event timers was added in .Fx 9.0 . Index: head/share/man/man4/hptrr.4 =================================================================== --- head/share/man/man4/hptrr.4 (revision 301588) +++ head/share/man/man4/hptrr.4 (revision 301589) @@ -1,141 +1,142 @@ .\" .\" Copyright (c) 2007 Me .\" 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 DEVELOPERS ``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 DEVELOPERS 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 June 6, 2012 .Dt HPTRR 4 .Os .Sh NAME .Nm hptrr .Nd "HighPoint RocketRAID device driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "device hptrr" .Cd "device scbus" .Cd "device da" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent hptrr_load="YES" .Ed .Pp The following tunables are settable from the loader: .Bl -ohang .It Va hw.hptrr.attach_generic set to 1 to permit driver attach to chips with generic Marvell (non-HighPoint) -PCI identification. These chips are also supported by +PCI identification. +These chips are also supported by .Xr ata 4 and .Xr mvs 4 . Some vendors are using same chips, but without providing RAID BIOS. .El .Sh DESCRIPTION The .Nm driver provides support for HighPoint's RocketRAID based RAID controllers. .Pp These devices support SATA/ATA disk drives and provide RAID0 (striping), RAID1 (mirroring), and RAID5 functionality. .Sh HARDWARE The .Nm driver supports the following RAID controllers: .Pp .Bl -bullet -compact .It RocketRAID 172x series .It RocketRAID 174x series .It RocketRAID 2210 .It RocketRAID 222x series .It RocketRAID 2240 .It RocketRAID 230x series .It RocketRAID 231x series .It RocketRAID 232x series .It RocketRAID 2340 .It RocketRAID 2522 .El .Sh NOTES The .Nm driver only works on the i386 and amd64 platforms as it requires a binary blob object from the manufacturer which they only supply for these platforms. The .Nm driver does .Em not work on i386 with .Xr pae 4 enabled. .Pp This driver does not support the RR182x series controller. See the .Xr hptmv 4 manual page for details on support. .Pp This driver supersedes the older rr232x driver. .Sh SEE ALSO .Xr ata 4 , .Xr cam 4 , .Xr hptmv 4 , .Xr mvs 4 , .Xr loader 8 .Sh HISTORY The .Nm device driver first appeared in .Fx 6.3 . .Sh AUTHORS .An -nosplit The .Nm device driver was written by .An HighPoint Technologies, Inc. , and ported to .Fx by .An Scott Long . This manual page was written by .An David E. O'Brien . .Sh BUGS The .Nm driver does not support manipulating the RAID from the OS, RAIDs need to be set up from the on-board BIOS. Index: head/share/man/man4/inet.4 =================================================================== --- head/share/man/man4/inet.4 (revision 301588) +++ head/share/man/man4/inet.4 (revision 301589) @@ -1,279 +1,279 @@ .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" From: @(#)inet.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" .Dd Feb 4, 2016 .Dt INET 4 .Os .Sh NAME .Nm inet .Nd Internet protocol family .Sh SYNOPSIS .In sys/types.h .In netinet/in.h .Sh DESCRIPTION The Internet protocol family is a collection of protocols layered atop the .Em Internet Protocol .Pq Tn IP transport layer, and utilizing the Internet address format. The Internet family provides protocol support for the .Dv SOCK_STREAM , SOCK_DGRAM , and .Dv SOCK_RAW socket types; the .Dv SOCK_RAW interface provides access to the .Tn IP protocol. .Sh ADDRESSING Internet addresses are four byte quantities, stored in network standard format (on little endian machines, such as the .Tn alpha , .Tn amd64 and .Tn i386 these are word and byte reversed). The include file .In netinet/in.h defines this address as a discriminated union. .Pp Sockets bound to the Internet protocol family utilize the following addressing structure, .Bd -literal -offset indent struct sockaddr_in { uint8_t sin_len; sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; char sin_zero[8]; }; .Ed .Pp Sockets may be created with the local address .Dv INADDR_ANY to affect .Dq wildcard matching on incoming messages. The address in a .Xr connect 2 or .Xr sendto 2 call may be given as .Dv INADDR_ANY to mean .Dq this host . The distinguished address .Dv INADDR_BROADCAST is allowed as a shorthand for the broadcast address on the primary network if the first network configured supports broadcast. .Sh PROTOCOLS The Internet protocol family is comprised of the .Tn IP network protocol, Internet Control Message Protocol .Pq Tn ICMP , Internet Group Management Protocol .Pq Tn IGMP , Transmission Control Protocol .Pq Tn TCP , and User Datagram Protocol .Pq Tn UDP . .Tn TCP is used to support the .Dv SOCK_STREAM abstraction while .Tn UDP is used to support the .Dv SOCK_DGRAM abstraction. A raw interface to .Tn IP is available by creating an Internet socket of type .Dv SOCK_RAW . The .Tn ICMP message protocol is accessible from a raw socket. .Pp The .Nm address on an interface consist of the address itself, the netmask, either broadcast address in case of a broadcast interface or peers address in case of point-to-point interface. The following .Xr ioctl 2 commands are provided for a datagram socket in the Internet domain: .Pp .Bl -tag -width ".Dv SIOCGIFBRDADDR" -offset indent -compact .It Dv SIOCAIFADDR Add address to an interface. The command requires .Ft struct in_aliasreq as argument. .It Dv SIOCDIFADDR Delete address from an interface. The command requires .Ft struct ifreq as argument. .It Dv SIOCGIFADDR .It Dv SIOCGIFBRDADDR .It Dv SIOCGIFDSTADDR .It Dv SIOCGIFNETMASK -Return address information from interface. The returned value -is in +Return address information from interface. +The returned value is in .Ft struct ifreq . This way of address information retrieval is obsoleted, a preferred way is to use .Xr getifaddrs 3 API. .El .Ss MIB Variables A number of variables are implemented in the net.inet branch of the .Xr sysctl 3 MIB. In addition to the variables supported by the transport protocols (for which the respective manual pages may be consulted), the following general variables are defined: .Bl -tag -width IPCTL_ACCEPTSOURCEROUTE .It Dv IPCTL_FORWARDING .Pq ip.forwarding Boolean: enable/disable forwarding of IP packets. Defaults to off. .It Dv IPCTL_SENDREDIRECTS .Pq ip.redirect Boolean: enable/disable sending of ICMP redirects in response to .Tn IP packets for which a better, and for the sender directly reachable, route and next hop is known. Defaults to on. .It Dv IPCTL_DEFTTL .Pq ip.ttl Integer: default time-to-live .Pq Dq TTL to use for outgoing .Tn IP packets. .It Dv IPCTL_ACCEPTSOURCEROUTE .Pq ip.accept_sourceroute Boolean: enable/disable accepting of source-routed IP packets (default false). .It Dv IPCTL_SOURCEROUTE .Pq ip.sourceroute Boolean: enable/disable forwarding of source-routed IP packets (default false). .It Va ip.process_options Integer: control IP options processing. By setting this variable to 0, all IP options in the incoming packets will be ignored, and the packets will be passed unmodified. By setting to 1, IP options in the incoming packets will be processed accordingly. By setting to 2, an .Tn ICMP .Dq "prohibited by filter" message will be sent back in response to incoming packets with IP options. Default is 1. This .Xr sysctl 8 variable affects packets destined for a local host as well as packets forwarded to some other host. .It Va ip.rfc6864 Boolean: control IP IDs generation behaviour. True value enables RFC6864 support, which specifies that IP ID field of .Em atomic datagrams can be set to any value. The .Fx implementation sets it to zero. Enabled by default. .It Va ip.random_id Boolean: control IP IDs generation behaviour. Setting this .Xr sysctl 8 to 1 causes the ID field in .Em non-atomic IP datagrams (or all IP datagrams, if .Va ip.rfc6864 is disabled) to be randomized instead of incremented by 1 with each packet generated. This closes a minor information leak which allows remote observers to determine the rate of packet generation on the machine by watching the counter. At the same time, on high-speed links, it can decrease the ID reuse cycle greatly. Default is 0 (sequential IP IDs). IPv6 flow IDs and fragment IDs are always random. .It Va ip.maxfragpackets Integer: maximum number of fragmented packets the host will accept and hold in the reassembling queue simultaneously. 0 means that the host will not accept any fragmented packets. \-1 means that the host will accept as many fragmented packets as it receives. .It Va ip.maxfragsperpacket Integer: maximum number of fragments the host will accept and hold in the reassembling queue for a packet. 0 means that the host will not accept any fragmented packets. .El .Sh SEE ALSO .Xr ioctl 2 , .Xr socket 2 , .Xr getifaddrs 3 , .Xr sysctl 3 , .Xr icmp 4 , .Xr intro 4 , .Xr ip 4 , .Xr ipfirewall 4 , .Xr route 4 , .Xr tcp 4 , .Xr udp 4 , .Xr pfil 9 .Rs .%T "An Introductory 4.3 BSD Interprocess Communication Tutorial" .%B PS1 .%N 7 .Re .Rs .%T "An Advanced 4.3 BSD Interprocess Communication Tutorial" .%B PS1 .%N 8 .Re .Sh HISTORY The .Nm protocol interface appeared in .Bx 4.2 . The .Dq protocol cloning code appeared in .Fx 2.1 . .Sh CAVEATS The Internet protocol support is subject to change as the Internet protocols develop. Users should not depend on details of the current implementation, but rather the services exported. Index: head/share/man/man4/ipmi.4 =================================================================== --- head/share/man/man4/ipmi.4 (revision 301588) +++ head/share/man/man4/ipmi.4 (revision 301589) @@ -1,201 +1,201 @@ .\" .\" Copyright (c) 2006 Tom Rhodes .\" 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 July 10, 2007 .Dt IPMI 4 .Os .Sh NAME .Nm ipmi .Nd "OpenIPMI compatible IPMI interface driver" .Sh SYNOPSIS .Cd "device ipmi" .Pp To manually specify I/O attachment in .Pa /boot/device.hints : .Cd hint.ipmi.0.at="isa" .Cd hint.ipmi.0.port="0xCA2" .Cd hint.ipmi.0.spacing="8" .Cd hint.ipmi.0.mode="KCS" .Pp To manually specify memory attachment in .Pa /boot/device.hints : .Cd hint.ipmi.0.at="isa" .Cd hint.ipmi.0.maddr="0xf0000000" .Cd hint.ipmi.0.spacing="8" .Cd hint.ipmi.0.mode="SMIC" .Pp Meaning of .Ar spacing : .Bl -tag -offset indent -compact -width 0x0 .It 8 8 bit alignment .It 16 16 bit alignment .It 32 32 bit alignment .El .Pp If the .Ar port and .Ar spacing -are not specified the interface type default will be used. Only specify -either the +are not specified the interface type default will be used. +Only specify either the .Ar port for I/O access or .Ar maddr for memory access. .Sh DESCRIPTION The .Tn IPMI (Intelligent Platform Management Interface) is a standard for monitoring system hardware by permitting generic code to detect and monitor the sensors in a system. The .Tn IPMI standard offers watchdog support, an FRU database, and other support extensions. It is currently being adopted by the makers of many single board and embedded system manufacturers. .Pp The .Nm driver in .Fx is heavily adopted from the standard and .Tn Linux driver; however, not all features described in the standard are supported. .Sh IOCTLS Sending and receiving messages through the .Nm driver requires the use of .Xr ioctl 2 . The ioctls are used due to the complexity of data sent to and from the device. The .Xr ioctl 2 command codes below are defined in .In sys/ipmi.h . The third argument to .Xr ioctl 2 should be a pointer to the type indicated. .Pp Currently the following ioctls are supported: .Bl -tag -width indent .It Dv IPMICTL_RECEIVE_MSG Pq Vt "struct ipmi_recv" Receive a message. Possible error values: .Bl -tag -width Er .It Bq Er EAGAIN No messages are in the process queue. .It Bq Er EFAULT An address supplied was invalid. .It Bq Er EMSGSIZE The address could not fit in the message buffer and will remain in the buffer. .El .It Dv IPMICTL_RECEIVE_MSG_TRUNC Pq Vt "struct ipmi_recv" Like .Dv IPMICTL_RECEIVE_MSG but if the message cannot fit into the buffer, it will truncate the contents instead of leaving the data in the buffer. .It Dv IPMICTL_SEND_COMMAND Pq Vt "struct ipmi_req" Send a message to the interface. Possible error values: .Bl -tag -width Er .It Bq Er EFAULT An address supplied was invalid. .It Bq Er ENOMEM Buffers could not be allowed for the command, out of memory. .El .It Dv IPMICTL_SET_MY_ADDRESS_CMD Pq Vt "unsigned int" Set the slave address for source messages. .It Dv IPMICTL_GET_MY_ADDRESS_CMD Pq Vt "unsigned int" Get the slave address for source messages. .It Dv IPMICTL_SET_MY_LUN_CMD Pq Vt "unsigned int" Set the slave LUN for source messages. .It Dv IPMICTL_GET_MY_LUN_CMD Pq Vt "unsigned int" Get the slave LUN for source messages. .El .Ss Unimplemented Ioctls .Bl -tag -width indent .It Dv IPMICTL_REGISTER_FOR_CMD Pq Vt "struct ipmi_cmdspec" Register to receive a specific command. Possible error values: .Bl -tag -width Er .It Bq Er EFAULT An supplied address was invalid. .It Bq Er EBUSY The network function/command is already in use. .It Bq Er ENOMEM Could not allocate memory. .El .It Dv IPMICTL_UNREGISTER_FOR_CMD Pq Vt "struct ipmi_cmdspec" Unregister to receive a specific command. Possible error values: .Bl -tag -width Er .It Bq Er EFAULT An address supplied was invalid. .It Bq Er ENOENT The network function/command was not found. .El .El .Ss Stub Only Ioctl .Bl -tag -width indent .It Dv IPMICTL_SET_GETS_EVENTS_CMD Pq Vt int Set whether this interface receives events. Possible error values: .Bl -tag -width Er .It Bq Er EFAULT An address supplied was invalid. .El .El .Sh SEE ALSO .Xr ioctl 2 , .Xr watchdog 4 , .Xr watchdog 8 , .Xr watchdogd 8 , .Xr watchdog 9 .Sh HISTORY The .Nm driver first appeared in .Fx 6.2 . .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Doug Ambrisko Aq Mt ambrisko@FreeBSD.org . This manual page was written by .An Tom Rhodes Aq Mt trhodes@FreeBSD.org . .Sh BUGS Not all features of the MontaVista driver are supported. .Pp Currently, IPMB and BT modes are not implemented. Index: head/share/man/man4/ksyms.4 =================================================================== --- head/share/man/man4/ksyms.4 (revision 301588) +++ head/share/man/man4/ksyms.4 (revision 301589) @@ -1,153 +1,163 @@ .\" Copyright (c) 2008-2009 Stacey Son .\" The Regents of the University of California. 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 April 5, 2009 .Dt KSYMS 4 .Os .Sh NAME .Nm ksyms .Nd kernel symbol table interface .Sh SYNOPSIS .Cd "device ksyms" .Sh DESCRIPTION The .Pa /dev/ksyms character device provides a read-only interface to a snapshot of the kernel -symbol table. The in-kernel symbol manager is designed to be able to handle +symbol table. +The in-kernel symbol manager is designed to be able to handle many types of symbols tables, however, only .Xr elf 5 -symbol tables are supported by this device. The ELF format image contains two +symbol tables are supported by this device. +The ELF format image contains two sections: a symbol table and a corresponding string table. .Bl -tag -width indent -offset indent .It Dv Symbol Table The SYMTAB section contains the symbol table entries present in the current -running kernel, including the symbol table entries of any loaded modules. The -symbols are ordered by the kernel module load time starting with kernel file +running kernel, including the symbol table entries of any loaded modules. +The symbols are ordered by the kernel module load time starting with kernel file symbols first, followed by the first loaded module's symbols and so on. .It Dv String Table The STRTAB section contains the symbol name strings from the kernel and any loaded modules that the symbol table entries reference. .El .Pp Elf formatted symbol table data read from the .Pa /dev/ksyms file represents the state of the kernel at the time when the device is opened. Since .Pa /dev/ksyms has no text or data, most of the fields are initialized to NULL. The .Nm driver does not block the loading or unloading of modules into the kernel while the .Pa /dev/ksyms file is open but may contain stale data. .Sh IOCTLS The .Xr ioctl 2 command codes below are defined in .Aq Pa sys/ksyms.h . .Pp The (third) argument to the .Xr ioctl 2 should be a pointer to the type indicated. .Bl -tag -width indent -offset indent .It Dv KIOCGSIZE (size_t) Returns the total size of the current symbol table. This can be used when allocating a buffer to make a copy of the kernel symbol table. .It Dv KIOCGADDR (void *) Returns the address of the kernel symbol table mapped in the process memory. .El .Sh FILES .Bl -tag -width /dev/ksymsX .It Pa /dev/ksyms .El .Sh ERRORS An .Xr open 2 of .Pa /dev/ksyms will fail if: .Bl -tag -width Er .It Bq Er EBUSY -The device is already open. A process must close +The device is already open. +A process must close .Pa /dev/ksyms before it can be opened again. .It Bq Er ENOMEM There is a resource shortage in the kernel. .It Bq Er ENXIO The driver was unsuccessful in creating a snapshot of the kernel symbol -table. This may occur if the kernel was in the process of loading or +table. +This may occur if the kernel was in the process of loading or unloading a module. .El .Sh SEE ALSO .Xr ioctl 2 , .Xr nlist 3 , .Xr elf 5 , .Xr kldload 8 .Sh HISTORY A .Nm device exists in many different operating systems. This implementation is similar in function to the Solaris and NetBSD .Nm driver. .Pp The .Nm driver first appeared in .Fx 8.0 to support .Xr lockstat 1 . .Sh AUTHORS The .Nm driver was written by .An Stacey Son Aq Mt sson@FreeBSD.org . .Sh BUGS Because files can be dynamically linked into the kernel at any time the symbol -information can vary. When you open the +information can vary. +When you open the .Pa /dev/ksyms -file, you have access to an ELF image which represents a snapshot of the state of the kernel symbol information at that instant in time. Keeping the device open does not block the loading or unloading of kernel modules. To get a new snapshot you must close and re-open the device. +file, you have access to an ELF image which represents a snapshot of the state +of the kernel symbol information at that instant in time. +Keeping the device open does not block the loading or unloading of kernel +modules. +To get a new snapshot you must close and re-open the device. .Pp A process is only allowed to open the .Pa /dev/ksyms -file once at a time. The process must close the +file once at a time. +The process must close the .Pa /dev/ksyms before it is allowed to open it again. .Pp The .Nm driver uses the calling process' memory address space to store the snapshot. .Xr ioctl 2 can be used to get the memory address where the symbol table is stored to save kernel memory. .Xr mmap 2 may also be used but it will map it to another address. Index: head/share/man/man4/mdio.4 =================================================================== --- head/share/man/man4/mdio.4 (revision 301588) +++ head/share/man/man4/mdio.4 (revision 301589) @@ -1,53 +1,54 @@ .\" Written by Landon Fuller for the FreeBSD Project. .\" Based on the miibus(4) manual page written by Tom Rhodes. .\" Please see the /usr/src/COPYRIGHT file for copyright information. .\" .\" $FreeBSD$ .\" .Dd December 17, 2015 .Dt MDIO 4 .Os .Sh NAME .Nm mdio .Nd IEEE 802.3 Management Data Input/Output interface .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "device mdio" .Ed .Sh DESCRIPTION The .Nm driver provides an interconnection between the Media Access Control (MAC) sublayer and Physical Layer (PHY) entities' control and status registers, as defined by the IEEE 802.3 Standard. .Pp The .Nm layer allows device drivers to share common support code for various external PHY devices. .Pp .Tn MDIO is one of two signal interfaces that comprise the Media Independent Interface (MII) defined by the IEEE 802.3 -Standard. The +Standard. +The .Xr miibus 4 driver provides support for devices that require full .Tn MII support. .Sh SEE ALSO .Xr miibus 4 .Sh STANDARDS More information on .Tn MDIO can be found in the IEEE 802.3 Standard. .Sh HISTORY The .Nm driver first appeared in .Fx 10.0 . .Sh AUTHORS The driver was written by .An Stefan Bethke Aq Mt stb@lassitu.de . Index: head/share/man/man4/mfi.4 =================================================================== --- head/share/man/man4/mfi.4 (revision 301588) +++ head/share/man/man4/mfi.4 (revision 301589) @@ -1,148 +1,149 @@ .\" Copyright (c) 2006 Scott Long .\" 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 July 15, 2013 .Dt MFI 4 .Os .Sh NAME .Nm mfi .Nd "LSI MegaRAID SAS driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device pci" .Cd "device mfi" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent mfi_load="YES" .Ed .Sh DESCRIPTION This driver is for LSI's next generation PCI Express SAS RAID controllers. Access to RAID arrays (logical disks) from this driver is provided via .Pa /dev/mfid? device nodes. A simple management interface is also provided on a per-controller basis via the .Pa /dev/mfi? device node. .Pp The .Nm name is derived from the phrase "MegaRAID Firmware Interface", which is substantially different than the old "MegaRAID" interface and thus requires a new driver. Older SCSI and SATA MegaRAID cards are supported by .Xr amr 4 and will not work with this driver. .Pp Two sysctls are provided to tune the .Nm driver's behavior when a request is made to remove a mounted volume. By default the driver will disallow any requests to remove a mounted volume. If the sysctl .Va dev.mfi.%d.delete_busy_volumes is set to 1, then the driver will allow mounted volumes to be removed. .Pp A tunable is provided to adjust the .Nm -driver's behaviour when attaching to a card. By default the driver will -attach to all known cards with high probe priority. If the tunable +driver's behaviour when attaching to a card. +By default the driver will attach to all known cards with high probe priority. +If the tunable .Va hw.mfi.mrsas_enable is set to 1, then the driver will reduce its probe priority to allow .Cd mrsas to attach to the card instead of .Nm . .Sh HARDWARE The .Nm driver supports the following hardware: .Pp .Bl -bullet -compact .It LSI MegaRAID SAS 1078 .It LSI MegaRAID SAS 8408E .It LSI MegaRAID SAS 8480E .It LSI MegaRAID SAS 9240 .It LSI MegaRAID SAS 9260 .It Dell PERC5 .It Dell PERC6 .It IBM ServeRAID M1015 SAS/SATA .It IBM ServeRAID M1115 SAS/SATA .It IBM ServeRAID M5015 SAS/SATA .It IBM ServeRAID M5110 SAS/SATA .It IBM ServeRAID-MR10i .It Intel RAID Controller SRCSAS18E .It Intel RAID Controller SROMBSAS18E .El .Sh FILES .Bl -tag -width ".Pa /dev/mfid?" -compact .It Pa /dev/mfid? array/logical disk interface .It Pa /dev/mfi? management interface .El .Sh DIAGNOSTICS .Bl -diag .It "mfid%d: Unable to delete busy device" An attempt was made to remove a mounted volume. .El .Sh SEE ALSO .Xr amr 4 , .Xr pci 4 , .Xr mfiutil 8 .Sh HISTORY The .Nm driver first appeared in .Fx 6.1 . .Sh AUTHORS The .Nm driver and this manual page were written by .An Scott Long Aq Mt scottl@FreeBSD.org . .Sh BUGS The driver does not support big-endian architectures at this time. Index: head/share/man/man4/mpt.4 =================================================================== --- head/share/man/man4/mpt.4 (revision 301588) +++ head/share/man/man4/mpt.4 (revision 301589) @@ -1,186 +1,187 @@ .\" $NetBSD: mpt.4,v 1.1 2003/04/16 22:32:15 thorpej Exp $ .\" .\" Copyright (c) 2003 Wasabi Systems, Inc. .\" All rights reserved. .\" .\" Written by Jason R. Thorpe for Wasabi Systems, Inc. .\" .\" 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. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed for the NetBSD Project by .\" Wasabi Systems, Inc. .\" 4. The name of Wasabi Systems, Inc. may not be used to endorse .\" or promote products derived from this software without specific prior .\" written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC .\" 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 July 23, 2011 .Dt MPT 4 .Os .Sh NAME .Nm mpt .Nd LSI Fusion-MPT SCSI/Fibre Channel driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device scbus" .Cd "device mpt" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent mpt_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for the LSI Logic Fusion-MPT family of .Tn SCSI , .Tn Fibre Channel and .Tn SAS controllers. .Sh HARDWARE The following controllers are supported by the .Nm driver: .Pp .Bl -bullet -compact .It LSI Logic 53c1030, LSI Logic LSI2x320-X (Single and Dual Ultra320 .Tn SCSI ) .It LSI Logic AS1064, LSI Logic AS1068 .Pq Tn SAS/SATA .It LSI Logic FC909 (1Gb/s .Tn Fibre Channel ) .It LSI Logic FC909A (Dual 1Gb/s .Tn Fibre Channel ) .It LSI Logic FC919, LSI Logic 7102XP-LC (Single 2Gb/s .Tn Fibre Channel ) .It LSI Logic FC929, LSI Logic FC929X, LSI Logic 7202XP-LC (Dual 2Gb/s .Tn Fibre Channel ) .It LSI Logic FC949X (Dual 4Gb/s .Tn Fibre Channel ) .It LSI Logic FC949E, LSI Logic FC949ES (Dual 4Gb/s .Tn Fibre Channel PCI-Express) .El .Pp The .Tn Ultra 320 SCSI controller chips supported by the .Nm driver can be found onboard on many systems including: .Pp .Bl -bullet -compact .It Dell PowerEdge 1750 thru 2850 .It IBM eServer xSeries 335 .El .Pp These systems also contain Integrated RAID Mirroring and Integrated RAID Mirroring Enhanced which this driver also supports. .Pp The .Tn SAS controller chips are also present on many new AMD/Opteron based systems, like the Sun 4100. Note that this controller can drive both SAS and SATA -drives or a mix of them at the same time. The Integrated RAID Mirroring +drives or a mix of them at the same time. +The Integrated RAID Mirroring available for these controllers is poorly supported at best. .Pp The .Tn Fibre Channel controller chipset are supported by a broad variety of speeds and systems. The .Tn Apple Fibre Channel HBA is in fact the .Tn FC949ES card. .Pp This driver also supports target mode for Fibre Channel cards. This support may be enabled by setting the desired role of the core via the LSI Logic firmware utility that establishes what roles the card can take on - no separate compilation is required. .Sh SEE ALSO .Xr cd 4 , .Xr ch 4 , .Xr da 4 , .Xr mps 4 , .Xr pci 4 , .Xr sa 4 , .Xr scsi 4 , .Xr targ 4 , .Xr gmultipath 8 , .Xr mptutil 8 .Rs .%T "LSI Logic Website" .%U http://www.lsi.com/ .Re .Sh HISTORY The .Nm driver first appeared in .Fx 4.6 . .Sh AUTHORS .An -nosplit The .Nm driver was originally written for .Fx by .An Greg Ansley and marginally improved upon by .An Matt Jacob Aq Mt mjacob@FreeBSD.org . .Pp .An Justin Gibbs Aq Mt gibbs@FreeBSD.org and .An Scott Long Aq Mt scottl@FreeBSD.org have made more substantial improvements. Index: head/share/man/man4/nand.4 =================================================================== --- head/share/man/man4/nand.4 (revision 301588) +++ head/share/man/man4/nand.4 (revision 301589) @@ -1,141 +1,145 @@ .\" .\" Copyright (c) 2012 The FreeBSD Foundation .\" All rights reserved. .\" .\" This documentation was written by Semihalf under sponsorship from .\" the FreeBSD Foundation. .\" .\" 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 March 8, 2012 .Dt NAND 4 .Os .Sh NAME .Nm nand .Nd NAND Flash framework .Sh SYNOPSIS .Cd "device nand" .Sh DESCRIPTION The .Fx .Nm framework consists of a set of interfaces that aim to provide an extensible, object oriented environement for NAND controllers and NAND Flash memory chips from various hardware vendors, and to allow for uniform and flexible -management of the NAND devices. It comprises of the following major -components: +management of the NAND devices. +It comprises of the following major components: .Bl -bullet .It NAND Flash controller (NFC) interface. .Pp Defines methods which allow to send commands as well as send/receive data -between the controller and a NAND chip. Back-end drivers for specific NAND +between the controller and a NAND chip. +Back-end drivers for specific NAND controllers plug into this interface and implement low-level routines for a given NAND controller. .Pp -This layer implements basic functionality of a NAND Flash controller. It -allows to send command and address to chip, drive CS (chip select line), as -well as read/write to the selected NAND chip. This layer is independent of +This layer implements basic functionality of a NAND Flash controller. +It allows to send command and address to chip, drive CS (chip select line), +as well as read/write to the selected NAND chip. +This layer is independent of NAND chip devices actually connected to the controller. .It NAND chip interface. .Pp -Provides basic operations like read page, program page, erase block. Currently -three generic classes of drivers are available, which provide support for the -following chips: +Provides basic operations like read page, program page, erase block. +Currently three generic classes of drivers are available, which provide +support for the following chips: .Bl -bullet .It large page .It small page .It ONFI-compliant .El .Pp This layer implements basic operations to be performed on a NAND chip, like -read, program, erase, get status etc. Since these operations use specific +read, program, erase, get status etc. +Since these operations use specific commands (depending on the vendor), each chip has potentially its own implementation of the commands set. .Pp The framework is extensible so it is also possible to create a custom command set for a non standard chip support. .It NANDbus. .Pp This layer is responsible for enumerating NAND chips in the system and establishing the hierarchy between chips and their supervising controllers. .Pp Its main purpose is detecting type of NAND chips connected to a given chip -select (CS line). It also allows manages locking access to the NAND -controller. NANDbus passes requests from an active chip to the chip +select (CS line). +It also allows manages locking access to the NAND controller. +NANDbus passes requests from an active chip to the chip controller. .It NAND character / GEOM device. .Pp For each NAND chip found in a system a character and GEOM devices are created which allows to read / write directly to a device, as well as perform other specific operations (like via ioctl). .Pp There are two GEOM devices created for each NAND chip: .Bl -bullet .It raw device .It normal device .El .Pp Raw device allows to bypass ECC checking when reading/writing to it, while normal device always uses ECC algorithm to validate the read data. .Pp NAND character devices will be created for each NAND chip detected while probing the NAND controller. .El .Sh SEE ALSO .Xr libnandfs 3 , .Xr gnand 4 , .Xr nandsim 4 , .Xr nandfs 5 , .Xr makefs 8 , .Xr mount_nandfs 8 , .Xr nandfs 8 , .Xr nandsim 8 , .Xr nandtool 8 , .Xr newfs_nandfs 8 , .Xr umount_nandfs 8 .Sh STANDARDS Open NAND Flash Interface Working Group .Pq Vt ONFI . .Sh HISTORY The .Nm framework support first appeared in .Fx 10.0 . .Sh AUTHORS .An -nosplit The .Nm framework was designed and developed by .An Grzegorz Bernacki . This manual page was written by .An Rafal Jaworowski . Index: head/share/man/man4/ng_atm.4 =================================================================== --- head/share/man/man4/ng_atm.4 (revision 301588) +++ head/share/man/man4/ng_atm.4 (revision 301589) @@ -1,406 +1,406 @@ .\" .\" Copyright (c) 2001-2003 .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" 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. .\" .\" Author: Hartmut Brandt .\" .\" $FreeBSD$ .\" .\" ng_atm(4) man page .\" .Dd November 2, 2012 .Dt NG_ATM 4 .Os .Sh NAME .Nm ng_atm .Nd netgraph ATM node type .Sh SYNOPSIS .In sys/types.h .In net/if_atm.h .In netgraph.h .In netgraph/atm/ng_atm.h .Sh DESCRIPTION The .Nm atm netgraph node type allows .Xr natm 4 ATM drivers to be connected to the .Xr netgraph 4 networking subsystem. When the .Nm module is loaded a node is automatically created for each .Xr natm 4 ATM interface. The nodes are named with the same name as the interface. Nodes are also created if a driver for an ATM card is loaded after .Nm was loaded. .Pp The .Nm atm nodes are persistent. They are removed when the interface is removed. .Dv NGM_SHUTDOWN messages are ignored by the node. .Sh HOOKS Four special hooks with fixed names and an unlimited number of hooks with user defined names are supported. Three of the fixed hooks are attached to strategic points in the information flow in the .Xr natm 4 system and support only reading. The fourth fixed hook behaves like the other user hooks, but a number of management messages are sent along the hook. The other hooks can be attached to VCIs dynamically by means of control messages to the .Nm atm node and can be written and read. .Pp The four fixed hooks are: .Bl -tag -width ".Va orphans" .It Va input This is a connection to the raw input stream from the network. If this hook is connected, all incoming packets are delivered out to this hook. Note that this redirects ALL input. Neither .Xr natm 4 nor the user hooks will see any input if .Va input is connected. An .Vt atm_pseudohdr (see .Xr natm 4 ) is prepended to the actual data. .It Va output This is a connection to the raw output stream to the network device. If this hook is connected, all outgoing packets are handed over to the netgraph system and delivered to the hook instead of being delivered to the ATM driver. An .Vt atm_pseudohdr (see .Xr natm 4 ) is prepended to the actual data. .It Va orphans This hook receives all packets that are unrecognized, i.e., do not belong to either a .Xr natm 4 socket, a .Nm VCI or .Xr natm 4 IP. Because ATM is connection oriented and packets are received on a given VCI only when someone initiates this VCI, packets should never be orphaned. There is however one exception: if you use .Xr natm 4 IP with LLC/SNAP encapsulation packets with do not have the IP protocol indicated in the packet header are delivered out of this hook. An .Vt atm_pseudohdr (see .Xr natm 4 ) is prepended to the actual data send out to the hook. .It Va manage This hook behaves exactly like a normal user hook (see below) except that the node at the other hand will receive management messages. .El .Pp Hooks for dynamically initiated VCIs can have whatever name is allowed by .Xr netgraph 4 as long as the name does not collide with one of the three predefined names. .Pp To initiate packet sending and receiving on a dynamic hook, one has to issue a .Dv NGM_ATM_CPCS_INIT control message. To terminate sending and receiving one must send a .Dv NGM_ATM_CPCS_TERM message (see .Sx CONTROL MESSAGES ) . The data sent and received on these hooks has no additional headers. .Sh CONTROL MESSAGES This node type supports the generic messages plus the following: .Bl -tag -width 4n .It Dv NGM_ATM_GET_IFNAME Pq Ic getifname Return the name of the interface as a .Dv NUL Ns -terminated string. This is normally the same name as that of the node. .It Dv NGM_ATM_GET_CONFIG Pq Ic getconfig Returns a structure defining the configuration of the interface: .Bd -literal struct ngm_atm_config { uint32_t pcr; /* peak cell rate */ uint32_t vpi_bits; /* number of active VPI bits */ uint32_t vci_bits; /* number of active VCI bits */ uint32_t max_vpcs; /* maximum number of VPCs */ uint32_t max_vccs; /* maximum number of VCCs */ }; .Ed .It Dv NGM_ATM_GET_VCCS Pq Ic getvccs Returns the table of open VCCs from the driver. This table consists of a header and a variable sized array of entries, one for each open VCC: .Bd -literal struct atmio_vcctable { uint32_t count; /* number of vccs */ struct atmio_vcc vccs[0]; /* array of VCCs */ }; struct atmio_vcc { uint16_t flags; /* flags */ uint16_t vpi; /* VPI */ uint16_t vci; /* VCI */ uint16_t rmtu; /* Receive maximum CPCS size */ uint16_t tmtu; /* Transmit maximum CPCS size */ uint8_t aal; /* aal type */ uint8_t traffic; /* traffic type */ struct atmio_tparam tparam; /* traffic parameters */ }; struct atmio_tparam { uint32_t pcr; /* 24bit: Peak Cell Rate */ uint32_t scr; /* 24bit: VBR Sustainable Cell Rate */ uint32_t mbs; /* 24bit: VBR Maximum burst size */ uint32_t mcr; /* 24bit: ABR/VBR/UBR+MCR MCR */ uint32_t icr; /* 24bit: ABR ICR */ uint32_t tbe; /* 24bit: ABR TBE (1...2^24-1) */ uint8_t nrm; /* 3bit: ABR Nrm */ uint8_t trm; /* 3bit: ABR Trm */ uint16_t adtf; /* 10bit: ABR ADTF */ uint8_t rif; /* 4bit: ABR RIF */ uint8_t rdf; /* 4bit: ABR RDF */ uint8_t cdf; /* 3bit: ABR CDF */ }; .Ed .Pp Note that this is the driver's table, so all VCCs opened via .Xr natm 4 sockets and IP are also shown. They can, however, be distinguished by their flags. The .Va flags field contains the following flags: .Pp .Bl -tag -width ".Dv ATM_PH_LLCSNAP" -offset indent -compact .It Dv ATM_PH_AAL5 use AAL5 instead of AAL0 .It Dv ATM_PH_LLCSNAP if AAL5 use LLC SNAP encapsulation .It Dv ATM_FLAG_NG this is a netgraph VCC .It Dv ATM_FLAG_HARP this is a HARP VCC .It Dv ATM_FLAG_NORX transmit only VCC .It Dv ATM_FLAG_NOTX receive only VCC .It Dv ATMIO_FLAG_PVC treat channel as a PVC .El .Pp If the .Dv ATM_FLAG_NG flag is set, then .Va traffic and .Va tparam contain meaningful information. .Pp The .Va aal field contains one of the following values: .Pp .Bl -tag -width ".Dv ATM_PH_LLCSNAP" -offset indent -compact .It Dv ATMIO_AAL_0 AAL 0 (raw cells) .It Dv ATMIO_AAL_34 AAL 3 or AAL 4 .It Dv ATMIO_AAL_5 AAL 5 .It Dv ATMIO_AAL_RAW device specific raw cells .El .Pp The .Va traffic field can have one of the following values (not all drivers support all traffic types however): .Pp .Bl -tag -width ".Dv ATM_PH_LLCSNAP" -offset indent -compact .It Dv ATMIO_TRAFFIC_UBR .It Dv ATMIO_TRAFFIC_CBR .It Dv ATMIO_TRAFFIC_ABR .It Dv ATMIO_TRAFFIC_VBR .El .It Dv NGM_ATM_CPCS_INIT Pq Ic cpcsinit Initialize a VCC for sending and receiving. The argument is a structure: .Bd -literal struct ngm_atm_cpcs_init { char name[NG_HOOKSIZ]; uint32_t flags; /* flags. (if_atm.h) */ uint16_t vci; /* VCI to open */ uint16_t vpi; /* VPI to open */ uint16_t rmtu; /* receive maximum PDU */ uint16_t tmtu; /* transmit maximum PDU */ uint8_t aal; /* AAL type (if_atm.h) */ uint8_t traffic; /* traffic type (if_atm.h) */ uint32_t pcr; /* Peak cell rate */ uint32_t scr; /* VBR: Sustainable cell rate */ uint32_t mbs; /* VBR: Maximum burst rate */ uint32_t mcr; /* UBR+: Minimum cell rate */ uint32_t icr; /* ABR: Initial cell rate */ uint32_t tbe; /* ABR: Transmit buffer exposure */ uint8_t nrm; /* ABR: Nrm */ uint8_t trm; /* ABR: Trm */ uint16_t adtf; /* ABR: ADTF */ uint8_t rif; /* ABR: RIF */ uint8_t rdf; /* ABR: RDF */ uint8_t cdf; /* ABR: CDF */ }; .Ed .Pp The .Va name field is the name of the hook for which sending and receiving should be enabled. This hook must already be connected. The .Va vpi and .Va vci fields are the respective VPI and VCI values to use for the ATM cells. They must be within the range, given by the .Va maxvpi and .Va maxvci fields of the .Vt ng_atm_config structure. The .Va flags field contains the flags (see above) and the other fields describe the type of traffic. .It Dv NGM_ATM_CPCS_TERM Pq Ic cpcsterm Stop sending and receiving on the indicated hook. The argument is a .Bd -literal struct ngm_atm_cpcs_term { char name[NG_HOOKSIZ]; }; .Ed .It Dv NGM_ATM_GET_STATS Pq Ic getstats -This command returns a message, containing node statistics. The -structure of the message is: +This command returns a message, containing node statistics. +The structure of the message is: .Bd -literal struct ngm_atm_stats { uint64_t in_packets; uint64_t in_errors; uint64_t out_packets; uint64_t out_errors; }; .Ed .El .Sh MANAGEMENT MESSAGES If the .Va manage hook is connected, certain messages are sent along the hook. They are received by the peer node with a cookie of .Dv NG_ATM_COOKIE . .Bl -tag -width 4n .It Dv NGM_ATM_VCC_CHANGE Pq Ic vcc_change A permanent VCC has been added, deleted or changed. This is used by .Xr ilmid 8 to generate the appropriate ILMI traps. The structure of the message is: .Bd -literal struct ngm_atm_vcc_change { uint32_t node; uint16_t vci; uint8_t vpi; uint8_t state; }; .Ed Where .Va state is 0 if the PVC was deleted, and 1 if it was added or modified. .El .Sh FLOW CONTROL If the hardware driver supports it, the node can emit flow control messages along a user hook. The format of these messages is described in .In netgraph/ng_message.h . The .Nm atm node may generate .Dv NGM_HIGH_WATER_PASSED and .Dv NGM_LOW_WATER_PASSED messages. The first one indicates that the hardware driver has stopped output on the channel and drops new packets, the second one reports that output was reenabled. Currently, the structures are not filled with information. .Sh SHUTDOWN The nodes are persistent as long as the corresponding interface exists. Upon receipt of a .Dv NGM_SHUTDOWN messages, all hooks are disconnected and the node is reinitialized. All VCCs opened via .Xr netgraph 4 are closed. When the ATM interface is unloaded, the node disappears. If the node is compiled with .Dv NGATM_DEBUG there is a sysctl .Va net.graph.atm.allow_shutdown which, when set to a non-zero value, allows the nodes to shut down. Note that this is intended for development only and may lead to kernel panics if set. .Sh SEE ALSO .Xr natm 4 , .Xr netgraph 4 , .Xr ng_ether 4 , .Xr ngctl 8 .Sh AUTHORS .An Harti Brandt Aq Mt harti@FreeBSD.org Index: head/share/man/man4/ng_bridge.4 =================================================================== --- head/share/man/man4/ng_bridge.4 (revision 301588) +++ head/share/man/man4/ng_bridge.4 (revision 301589) @@ -1,212 +1,212 @@ .\" Copyright (c) 2000 Whistle Communications, Inc. .\" All rights reserved. .\" .\" Subject to the following obligations and disclaimer of warranty, use and .\" redistribution of this software, in source or object code forms, with or .\" without modifications are expressly permitted by Whistle Communications; .\" provided, however, that: .\" 1. Any and all reproductions of the source or object code must include the .\" copyright notice above and the following disclaimer of warranties; and .\" 2. No rights are granted, in any manner or form, to use Whistle .\" Communications, Inc. trademarks, including the mark "WHISTLE .\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as .\" such appears in the above copyright notice or in the software. .\" .\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND .\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO .\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, .\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. .\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY .\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS .\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. .\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES .\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING .\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, .\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR .\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER 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 WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY .\" OF SUCH DAMAGE. .\" .\" Author: Archie Cobbs .\" .\" $FreeBSD$ .\" .Dd May 5, 2010 .Dt NG_BRIDGE 4 .Os .Sh NAME .Nm ng_bridge .Nd Ethernet bridging netgraph node type .Sh SYNOPSIS .In sys/types.h .In netgraph/ng_bridge.h .Sh DESCRIPTION The .Nm bridge node type performs Ethernet bridging over one or more links. Each link (represented by a connected hook) is used to transmit and receive raw Ethernet frames. As packets are received, the node learns which link each host resides on. Packets unicast to a known host are directed out the appropriate link only, and other links are spared the traffic. This behavior is in contrast to a hub, which always forwards every received packet to every other link. .Sh LOOP DETECTION The .Nm bridge node incorporates a simple loop detection algorithm. A loop is when two ports are connected to the same physical medium. Loops are important to avoid because of packet storms, which severely degrade performance. A packet storm results when the same packet is sent and received over and over again. If a host is detected on link A, and is then detected on link B within a certain time period after first being detected on link A, then link B is considered to be a looped back link. The time period is called the minimum stable time. .Pp A looped back link will be temporarily muted, i.e., all traffic received on that link is ignored. .Sh IPFW PROCESSING Processing of IP packets via the .Xr ipfirewall 4 mechanism on a per-link basis is not yet implemented. .Sh HOOKS This node type supports up to .Dv NG_BRIDGE_MAX_LINKS hooks. Each connected hook represents a bridged link. The hooks are named .Dv link0 , .Dv link1 , etc. Typically these hooks are connected to the .Dv lower hooks of one or more .Xr ng_ether 4 nodes. To connect the host machine to a bridged network, simply connect the .Dv upper hook of an .Xr ng_ether 4 node to the bridge node. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width foo .It Dv NGM_BRIDGE_SET_CONFIG Pq Ic setconfig Set the node configuration. This command takes a .Dv "struct ng_bridge_config" as an argument: .Bd -literal -offset 0n /* Node configuration structure */ struct ng_bridge_config { u_char ipfw[NG_BRIDGE_MAX_LINKS]; /* enable ipfw */ u_char debugLevel; /* debug level */ uint32_t loopTimeout; /* link loopback mute time */ uint32_t maxStaleness; /* max host age before nuking */ uint32_t minStableAge; /* min time for a stable host */ }; .Ed .Pp The .Dv ipfw array enables .Xr ipfirewall 4 processing of IP packets received on the corresponding links. The .Dv debugLevel field sets the debug level on the node. At level of 2 or greater, detected loops are logged. The default level is 1. .Pp The .Dv loopTimeout determines how long (in seconds) a looped link is muted. The default is 60 seconds. The .Dv maxStaleness parameter determines how long a period of inactivity before a host's entry is forgotten. The default is 15 minutes. The .Dv minStableAge determines how quickly a host must jump from one link to another before we declare a loopback condition. The default is one second. .It Dv NGM_BRIDGE_GET_CONFIG Pq Ic getconfig Returns the current configuration as a .Dv "struct ng_bridge_config" . .It Dv NGM_BRIDGE_RESET Pq Ic reset Causes the node to forget all hosts and unmute all links. The node configuration is not changed. .It Dv NGM_BRIDGE_GET_STATS Pq Ic getstats This command takes a four byte link number as an argument and returns a .Dv "struct ng_bridge_link_stats" containing statistics for the corresponding link, which must be currently connected: .Bd -literal -offset 0n /* Statistics structure (one for each link) */ struct ng_bridge_link_stats { uint64_t recvOctets; /* total octets rec'd on link */ uint64_t recvPackets; /* total pkts rec'd on link */ uint64_t recvMulticasts; /* multicast pkts rec'd on link */ uint64_t recvBroadcasts; /* broadcast pkts rec'd on link */ uint64_t recvUnknown; /* pkts rec'd with unknown dest addr */ uint64_t recvRunts; /* pkts rec'd less than 14 bytes */ uint64_t recvInvalid; /* pkts rec'd with bogus source addr */ uint64_t xmitOctets; /* total octets xmit'd on link */ uint64_t xmitPackets; /* total pkts xmit'd on link */ uint64_t xmitMulticasts; /* multicast pkts xmit'd on link */ uint64_t xmitBroadcasts; /* broadcast pkts xmit'd on link */ uint64_t loopDrops; /* pkts dropped due to loopback */ uint64_t loopDetects; /* number of loop detections */ uint64_t memoryFailures; /* times couldn't get mem or mbuf */ }; .Ed .It Dv NGM_BRIDGE_CLR_STATS Pq Ic clrstats This command takes a four byte link number as an argument and clears the statistics for that link. .It Dv NGM_BRIDGE_GETCLR_STATS Pq Ic getclrstats Same as .Dv NGM_BRIDGE_GET_STATS , but also atomically clears the statistics as well. .It Dv NGM_BRIDGE_GET_TABLE Pq Ic gettable Returns the current host mapping table used to direct packets, in a .Dv "struct ng_bridge_host_ary" . .It Dv NGM_BRIDGE_SET_PERSISTENT Pq Ic setpersistent This command sets the persistent flag on the node, and takes no arguments. .El .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN -control message, or when all hooks have been disconnected. Setting the -persistent flag via a +control message, or when all hooks have been disconnected. +Setting the persistent flag via a .Dv NGM_BRIDGE_SET_PERSISTENT control message disables automatic node shutdown when the last hook gets disconnected. .Sh FILES .Bl -tag -width XXXXXXXX -compact .It Pa /usr/share/examples/netgraph/ether.bridge Example script showing how to set up a bridging network .El .Sh SEE ALSO .Xr if_bridge 4 , .Xr netgraph 4 , .Xr ng_ether 4 , .Xr ng_hub 4 , .Xr ng_one2many 4 , .Xr ngctl 8 .Sh HISTORY The .Nm node type was implemented in .Fx 4.2 . .Sh AUTHORS .An Archie Cobbs Aq Mt archie@FreeBSD.org Index: head/share/man/man4/ng_car.4 =================================================================== --- head/share/man/man4/ng_car.4 (revision 301588) +++ head/share/man/man4/ng_car.4 (revision 301589) @@ -1,214 +1,215 @@ .\" Copyright (c) 2005 Nuno Antunes .\" Copyright (c) 2007 Alexander Motin .\" 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 November 13, 2012 .Dt NG_CAR 4 .Os .Sh NAME .Nm ng_car .Nd Committed Access Rate netgraph node type .Sh SYNOPSIS .In netgraph/ng_car.h .Sh DESCRIPTION The .Nm car node type limits traffic flowing through it using: .Pp .Bl -bullet -compact .It Single rate three color marker as described in RFC 2697, .It Two rate three color marker as described in RFC 2698, .It RED-like rate limit algorithm used by Cisco, .It Traffic shaping with RED. .El .Sh HOOKS This node type supports the following hooks: .Bl -tag -width ".Va upper" .It Va upper Hook leading to upper layer protocols. .It Va lower Hook leading to lower layer protocols. .El .Pp Traffic flowing from .Va upper to .Va lower is considered .Sy downstream traffic. Traffic flowing from .Va lower to .Va upper is considered .Sy upstream traffic. .Sh MODES OF OPERATION Each hook can operate in one of the following modes: .Bl -tag -width foo .It Dv NG_CAR_SINGLE_RATE Single rate three color marker as described in RFC 2697. Committed burst packets are counted as green, extended burst packets are counted as yellow and exceeding packets are counted as red. Committed burst getting refilled with CIR (Committed Information Rate) speed. When it is full, exceeded burst getting refilled. .It Dv NG_CAR_DOUBLE_RATE Two rate three color marker as described in RFC 2698. Committed burst packets are counted as green, peak burst packets are counted as yellow and exceeding packets are counted as red. Committed burst getting refilled with CIR speed. Peak burst getting refilled with PIR (Peak Information Rate) speed at the same time. .It Dv NG_CAR_RED Similar to .Dv NG_CAR_SINGLE_RATE , but with different understanding of extended burst. When normal burst exceeded and extended burst is used, packets are counted red with probability equal to part of extended burst consumed. Extended burst getting refilled first. When it is full, committed burst getting refilled. This behavior is similar to RED active queue management algorithm. .Pp This algorithm is more polite to the TCP traffic than NG_CAR_SINGLE_RATE. .It Dv NG_CAR_SHAPE Committed burst packets are counted as green, exceeding packets are delayed by queue with RED management and counted as yellow. Packets dropped by queue counted as red. Queue parameters are hardcoded: length 99 packets, min_th 8 packets, max_p 100%. .Pp Traffic shaping is much more polite to the TCP traffic than rate limit on links with bandwidth * delay product less than 6-8 TCP segments, but it consumes additional system resources for queue processing. .El By default, all information rates are measured in bits per second and bursts -are measured in bytes. But when NG_CAR_COUNT_PACKETS option is enabled, +are measured in bytes. +But when NG_CAR_COUNT_PACKETS option is enabled, rates are measured in packets per second and bursts are in packets. .Sh CONTROL MESSAGES This node type supports the generic control messages and the following specific messages. .Bl -tag -width foo .It Dv NGM_CAR_SET_CONF Pq Ic setconf Set node configuration to the specified at .Vt "struct ng_car_bulkconf" .It Dv NGM_CAR_GET_CONF Pq Ic getconf Return current node configuration as .Vt "struct ng_car_bulkconf" .Bd -literal struct ng_car_hookconf { uint64_t cbs; /* Committed burst size (bytes) */ uint64_t ebs; /* Exceeded/Peak burst size (bytes) */ uint64_t cir; /* Committed information rate (bits/s) */ uint64_t pir; /* Peak information rate (bits/s) */ uint8_t green_action; /* Action for green packets */ uint8_t yellow_action; /* Action for yellow packets */ uint8_t red_action; /* Action for red packets */ uint8_t mode; /* single/double rate, ... */ uint8_t opt; /* color-aware or color-blind */ }; /* possible actions (..._action) */ enum { NG_CAR_ACTION_FORWARD = 1, NG_CAR_ACTION_DROP }; /* operation modes (mode) */ enum { NG_CAR_SINGLE_RATE = 0, NG_CAR_DOUBLE_RATE, NG_CAR_RED, NG_CAR_SHAPE }; /* mode options (opt) */ #define NG_CAR_COUNT_PACKETS 2 struct ng_car_bulkconf { struct ng_car_hookconf upstream; struct ng_car_hookconf downstream; }; .Ed .It Dv NGM_CAR_GET_STATS Pq Ic getstats Return node statistics as .Vt "struct ng_car_bulkstats" .Bd -literal struct ng_car_hookstats { uint64_t passed_pkts; /* Counter for passed packets */ uint64_t droped_pkts; /* Counter for dropped packets */ uint64_t green_pkts; /* Counter for green packets */ uint64_t yellow_pkts; /* Counter for yellow packets */ uint64_t red_pkts; /* Counter for red packets */ uint64_t errors; /* Counter for operation errors */ }; struct ng_car_bulkstats { struct ng_car_hookstats upstream; struct ng_car_hookstats downstream; }; .Ed .It Dv NGM_CAR_CLR_STATS Pq Ic clrstats Clear node statistics. .It Dv NGM_CAR_GETCLR_STATS Pq Ic getclrstats Atomically return and clear node statistics. .El .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN control message, or when all hooks have been disconnected. .Sh EXAMPLES Limit outgoing data rate over fxp0 Ethernet interface to 20Mbit/s and incoming packet rate to 5000pps. .Bd -literal -offset indent /usr/sbin/ngctl -f- <<-SEQ mkpeer fxp0: car lower lower name fxp0:lower fxp0_car connect fxp0: fxp0_car: upper upper msg fxp0_car: setconf { downstream={ cir=20000000 cbs=2500000 ebs=2500000 greenAction=1 yellowAction=1 redAction=2 mode=2 } upstream={ cir=5000 cbs=100 ebs=100 greenAction=1 yellowAction=1 redAction=2 mode=2 opt=2 } } SEQ .Ed .Sh SEE ALSO .Xr netgraph 4 , .Xr ngctl 8 .Rs .%A J. Heinanen .%T "A Single Rate Three Color Marker" .%O RFC 2697 .Re .Rs .%A J. Heinanen .%T "A Two Rate Three Color Marker" .%O RFC 2698 .Re .Sh AUTHORS .An Nuno Antunes Aq Mt nuno.antunes@gmail.com .An Alexander Motin Aq Mt mav@FreeBSD.org .Sh BUGS At this moment only DROP and FORWARD actions are implemented. Index: head/share/man/man4/ng_deflate.4 =================================================================== --- head/share/man/man4/ng_deflate.4 (revision 301588) +++ head/share/man/man4/ng_deflate.4 (revision 301589) @@ -1,158 +1,159 @@ .\" .\" Author: Alexander Motin .\" .\" Copyright (c) 2006, Alexander Motin .\" 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 unmodified, 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 December 23, 2006 .Dt NG_DEFLATE 4 .Os .Sh NAME .Nm ng_deflate .Nd Deflate PPP compression (RFC 1979) netgraph node type .Sh SYNOPSIS .In sys/types.h .In netgraph/ng_deflate.h .Sh DESCRIPTION The .Nm deflate node type implements the Deflate sub-protocols of the Compression Control Protocol (CCP). .Pp The node has two hooks, .Va comp for compression and .Va decomp for decompression. Only one of them can be connected at the same time, specifying node's operation mode. Typically that hooks would be connected to the .Xr ng_ppp 4 node type hook of the same name. Corresponding .Xr ng_ppp 4 node hook must be switched to .Dv NG_PPP_DECOMPRESS_FULL mode to permit sending uncompressed frames. .Sh HOOKS This node type supports the following hooks: .Pp .Bl -tag -compact -width ".Va decomp" .It Va comp Connection to .Xr ng_ppp 4 .Va comp hook. Incoming frames are compressed (if possible) and sent back out the same hook. .It Va decomp Connection to .Xr ng_ppp 4 .Va decomp hook. Incoming frames are decompressed (if they are compressed), and sent back out the same hook. .El .Pp Only one hook can be connected at the same time, specifying node's operation mode. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width foo .It Dv NGM_DEFLATE_CONFIG Pq Ic config This command resets and configures the node for a session (i.e., for compression or decompression). This command takes a .Vt "struct ng_deflate_config" as an argument: .Bd -literal -offset 0n struct ng_deflate_config { u_char enable; /* node enabled */ u_char windowBits; /* log2(Window size) */ }; .Ed The .Fa enabled field enables traffic flow through the node. The .Fa windowBits specify compression windows size as negotiated by the Compression Control Protocol (CCP) in PPP. .It Dv NGM_DEFLATE_RESETREQ Pq Ic resetreq This message contains no arguments, and is bi-directional. If an error is detected during decompression, this message is sent by the node to the originator of the .Dv NGM_DEFLATE_CONFIG message that initiated the session. The receiver should respond by sending a PPP CCP Reset-Request to the peer. .Pp This message may also be received by this node type when a CCP Reset-Request or Reset-Ack is received by the local PPP entity. The node will respond by flushing its compression state so the sides can resynchronize. .It Dv NGM_DEFLATE_GET_STATS Pq Ic getstats This control message obtains statistics for a given hook. The statistics are returned in .Vt "struct ng_deflate_stats" : .Bd -literal struct ng_deflate_stats { uint64_t FramesPlain; uint64_t FramesComp; uint64_t FramesUncomp; uint64_t InOctets; uint64_t OutOctets; uint64_t Errors; }; .Ed .It Dv NGM_DEFLATE_CLR_STATS Pq Ic clrstats This control message clears statistics for a given hook. .It Dv NGM_DEFLATE_GETCLR_STATS Pq Ic getclrstats This control message obtains and clears statistics for a given hook. .El .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN control message, or when hook have been disconnected. .Sh SEE ALSO .Xr netgraph 4 , .Xr ng_ppp 4 , .Xr ngctl 8 .Rs .%A J. Woods .%T "PPP Deflate Protocol" .%O RFC 1979 .Re .Rs .%A W. Simpson .%T "The Point-to-Point Protocol (PPP)" .%O RFC 1661 .Re .Sh AUTHORS .An Alexander Motin Aq Mt mav@alkar.net .Sh BUGS Due to nature of netgraph PPP implementation there are possible race conditions -between data packet and ResetAck CCP packet in case of packet loss. As result, +between data packet and ResetAck CCP packet in case of packet loss. +As result, packet loss can produce bigger performance degradation than supposed by protocol. Index: head/share/man/man4/ng_hub.4 =================================================================== --- head/share/man/man4/ng_hub.4 (revision 301588) +++ head/share/man/man4/ng_hub.4 (revision 301589) @@ -1,75 +1,75 @@ .\" Copyright (c) 2004 Ruslan Ermilov .\" 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 May 5, 2010 .Dt NG_HUB 4 .Os .Sh NAME .Nm ng_hub .Nd packet distribution netgraph node type .Sh SYNOPSIS .In netgraph/ng_hub.h .Sh DESCRIPTION The .Nm hub node type provides a simple mechanism for distributing packets over several links. Packets received on any of the hooks are forwarded out the other hooks. Packets are not altered in any way. .Sh HOOKS A .Nm hub node accepts any request to connect, regardless of the hook name, as long as the name is unique. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width foo .It Dv NGM_HUB_SET_PERSISTENT Pq Ic setpersistent This command sets the persistent flag on the node, and takes no arguments. .El .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN -control message, or when all hooks have been disconnected. Setting the -persistent flag via a +control message, or when all hooks have been disconnected. +Setting the persistent flag via a .Dv NGM_HUB_SET_PERSISTENT control message disables automatic node shutdown when the last hook gets disconnected. .Sh SEE ALSO .Xr netgraph 4 , .Xr ng_bridge 4 , .Xr ng_ether 4 , .Xr ng_one2many 4 , .Xr ngctl 8 , .Xr nghook 8 .Sh HISTORY The .Nm node type appeared in .Fx 5.3 . .Sh AUTHORS .An Ruslan Ermilov Aq Mt ru@FreeBSD.org Index: head/share/man/man4/ng_netflow.4 =================================================================== --- head/share/man/man4/ng_netflow.4 (revision 301588) +++ head/share/man/man4/ng_netflow.4 (revision 301589) @@ -1,356 +1,358 @@ .\" Copyright (c) 2004-2005 Gleb Smirnoff .\" 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 December 10, 2012 .Dt NG_NETFLOW 4 .Os .Sh NAME .Nm ng_netflow .Nd Cisco's NetFlow implementation .Sh SYNOPSIS .In sys/types.h .In netinet/in.h .In netgraph/netflow/ng_netflow.h .Sh DESCRIPTION The .Nm node implements Cisco's NetFlow export protocol on a router running .Fx . The .Nm node listens for incoming traffic and identifies unique flows in it. Flows are distinguished by endpoint IP addresses, TCP/UDP port numbers, ToS and input interface. Expired flows are exported out of the node in NetFlow version 5/9 UDP datagrams. Expiration reason can be one of the following: .Bl -dash .It RST or FIN TCP segment. .It Active timeout. Flows cannot live more than the specified period of time. The default is 1800 seconds (30 minutes). .It Inactive timeout. A flow was inactive for the specified period of time. The default is 15 seconds. .El .Pp Node supports IPv6 accounting (NetFlow v9 only) and is aware of multiple fibs. Different fibs are mapped to different domain_id in NetFlow V9 and different engine_id in NetFlow V5. .Sh HOOKS This node type supports up to .Dv NG_NETFLOW_MAXIFACES (default 65536) hooks named .Va iface0 , iface1 , etc., and the same number of hooks named .Va out0 , out1 , etc., plus two export hooks: .Va export (for NetFlow version 5) and .Va export9 -(for NetFlow version 9). Export can be done simultaneously for all supported -export hooks. By default (ingress NetFlow enabled) node does NetFlow accounting of data +(for NetFlow version 9). +Export can be done simultaneously for all supported export hooks. +By default (ingress NetFlow enabled) node does NetFlow accounting of data received on .Va iface* hooks. If corresponding .Va out hook is connected, unmodified data is bypassed to it, otherwise data is freed. If data is received on .Va out hook, it is bypassed to corresponding .Va iface hook without any processing (egress NetFlow disabled by default). When full export datagram for an export protocol is built it is sent to the .Va export or .Va export9 hook. In normal operation, one (or more) export hook is connected to the .Va inet/dgram/udp hook of the .Xr ng_ksocket 4 node. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width foo .It Dv NGM_NETFLOW_INFO Pq Ic info Returns some node statistics and the current timeout values in a .Vt "struct ng_netflow_info" . .It Dv NGM_NETFLOW_IFINFO Pq Ic ifinfo Returns information about the .Va iface Ns Ar N hook. The hook number is passed as an argument. .It Dv NGM_NETFLOW_SETDLT Pq Ic setdlt Sets data link type on the .Va iface Ns Ar N hook. Currently, supported types are .Cm DLT_RAW (raw IP datagrams) and .Cm DLT_EN10MB (Ethernet). DLT_ definitions can be found in .In net/bpf.h header. Currently used values are 1 for .Cm DLT_EN10MB and 12 for .Cm DLT_RAW . This message type uses .Vt "struct ng_netflow_setdlt" as an argument: .Bd -literal -offset 4n struct ng_netflow_setdlt { uint16_t iface; /* which iface dlt change */ uint8_t dlt; /* DLT_XXX from bpf.h */ }; .Ed .Pp The requested .Va iface Ns Ar N hook must already be connected, otherwise message send operation will return an error. .It Dv NGM_NETFLOW_SETIFINDEX Pq Ic setifindex In some cases, .Nm may be unable to determine the input interface index of a packet. This can happen if traffic enters the .Nm node before it comes to the system interface's input queue. An example of such a setup is capturing a traffic .Em between synchronous data line and .Xr ng_iface 4 . In this case, the input index should be associated with a given hook. The interface's index can be determined via .Xr if_nametoindex 3 from userland. This message requires .Vt "struct ng_netflow_setifindex" as an argument: .Bd -literal -offset 4n struct ng_netflow_setifindex { uint16_t iface; /* which iface index change */ uint16_t index; /* new index */ }; .Ed .Pp The requested .Va iface Ns Ar N hook must already be connected, otherwise the message send operation will return an error. .It Dv NGM_NETFLOW_SETTIMEOUTS Pq Ic settimeouts Sets values in seconds for NetFlow active/inactive timeouts. This message requires .Vt "struct ng_netflow_settimeouts" as an argument: .Bd -literal -offset 4n struct ng_netflow_settimeouts { uint32_t inactive_timeout; /* flow inactive timeout */ uint32_t active_timeout; /* flow active timeout */ }; .Ed .It Dv NGM_NETFLOW_SETCONFIG Pq Ic setconfig Sets configuration for the specified interface. This message requires .Vt "struct ng_netflow_setconfig" as an argument: .Bd -literal -offset 4n struct ng_netflow_setconfig { uint16_t iface; /* which iface config change */ uint32_t conf; /* new config */ #define NG_NETFLOW_CONF_INGRESS 1 #define NG_NETFLOW_CONF_EGRESS 2 #define NG_NETFLOW_CONF_ONCE 4 #define NG_NETFLOW_CONF_THISONCE 8 #define NG_NETFLOW_CONF_NOSRCLOOKUP 16 #define NG_NETFLOW_CONF_NODSTLOOKUP 32 }; .Ed .Pp -Configuration is a bitmask of several options. Option NG_NETFLOW_CONF_INGRESS +Configuration is a bitmask of several options. +Option NG_NETFLOW_CONF_INGRESS enabled by default enables ingress NetFlow generation (for data coming from ifaceX hook). Option .Va NG_NETFLOW_CONF_EGRESS enables egress NetFlow (for data coming from outX hook). Option .Va NG_NETFLOW_CONF_ONCE defines that packet should be accounted only once if it several times passes via netflow node. Option .Va NG_NETFLOW_CONF_THISONCE defines that packet should be accounted only once if it several times passes via exactly this netflow node. These two options are important to avoid duplicate accounting when both ingress and egress NetFlow are enabled. Option .Va NG_NETFLOW_CONF_NOSRCLOOKUP skips radix lookup on flow source address used to fill in network mask. Option .Va NG_NETFLOW_CONF_NODSTLOOKUP skips radix lookup on destination (which fills egress interface id, destination mask and gateway). If one doesn't need data provided by lookups, he/she can disable them, to reduce load on routers. .It Dv NGM_NETFLOW_SETTEMPLATE Pq Ic settemplate Sets various timeouts to announce data flow templates (NetFlow v9-specific). This message requires .Vt "struct ng_netflow_settemplate" as an argument: .Bd -literal -offset 4n struct ng_netflow_settemplate { uint16_t time; /* max time between announce */ uint16_t packets; /* max packets between announce */ }; .Ed .Pp Value of time field represents time in seconds to re-announce data templates. Value of packets field represents maximum packets count between re-announcing data templates. .It Dv NGM_NETFLOW_SETMTU Pq Ic setmtu Sets export interface MTU to build packets of specified size (NetFlow v9-specific). This message requires .Vt "struct ng_netflow_setmtu" as an argument: .Bd -literal -offset 4n struct ng_netflow_setemtu { uint16_t mtu; /* MTU for packet */ }; .Ed .Pp Default is 1500 bytes. .It Dv NGM_NETFLOW_SHOW This control message asks a node to dump the entire contents of the flow cache. It is called from .Xr flowctl 8 , not directly from .Xr ngctl 8 . .It Dv NGM_NETFLOW_V9INFO Pq Ic v9info Returns some NetFlow v9 related values in a .Bd -literal -offset 4n struct ng_netflow_v9info { uint16_t templ_packets; /* v9 template packets */ uint16_t templ_time; /* v9 template time */ uint16_t mtu; /* v9 MTU */ }; .Ed .El .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN control message, or when all hooks have been disconnected. .Sh EXAMPLES The simplest possible configuration is one Ethernet interface, where flow collecting is enabled. .Bd -literal -offset indent /usr/sbin/ngctl -f- <<-SEQ mkpeer fxp0: netflow lower iface0 name fxp0:lower netflow connect fxp0: netflow: upper out0 mkpeer netflow: ksocket export inet/dgram/udp msg netflow:export connect inet/10.0.0.1:4444 SEQ .Ed .Pp This is a more complicated example of a router with 2 NetFlow-enabled interfaces .Li fxp0 and .Li ng0 . Note that the .Va ng0: node in this example is connected to .Xr ng_tee 4 . The latter sends us a copy of IP packets, which we analyze and free. On .Va fxp0: we do not use tee, but send packets back to either node. .Bd -literal -offset indent /usr/sbin/ngctl -f- <<-SEQ # connect ng0's tee to iface0 hook mkpeer ng0:inet netflow right2left iface0 name ng0:inet.right2left netflow # set DLT to raw mode msg netflow: setdlt { iface=0 dlt=12 } # set interface index (5 in this example) msg netflow: setifindex { iface=0 index=5 } # Connect fxp0: to iface1 and out1 hook connect fxp0: netflow: lower iface1 connect fxp0: netflow: upper out1 # Create ksocket node on export hook, and configure it # to send exports to proper destination mkpeer netflow: ksocket export inet/dgram/udp msg netflow:export connect inet/10.0.0.1:4444 SEQ .Ed .Sh SEE ALSO .Xr setfib 2 , .Xr netgraph 4 , .Xr ng_ether 4 , .Xr ng_iface 4 , .Xr ng_ksocket 4 , .Xr ng_tee 4 , .Xr flowctl 8 , .Xr ngctl 8 .Rs .%A B. Claise, Ed .%T "Cisco Systems NetFlow Services Export Version 9" .%O RFC 3954 .Re .Pp .Pa http://www.cisco.com/en/US/docs/ios/solutions_docs/netflow/nfwhite.html .Sh AUTHORS .An -nosplit The .Nm node type was written by .An Gleb Smirnoff Aq Mt glebius@FreeBSD.org , .An Alexander Motin Aq Mt mav@FreeBSD.org , .An Alexander Chernikov Aq Mt melifaro@ipfw.ru . The initial code was based on .Nm ng_ipacct written by .An Roman V. Palagin Aq Mt romanp@unshadow.net . .Sh BUGS Cache snapshot obtained via .Dv NGM_NETFLOW_SHOW command may lack some percentage of entries under severe load. .Pp The .Nm node type does not fill in AS numbers. This is due to the lack of necessary information in the kernel routing table. However, this information can be injected into the kernel from a routing daemon such as GNU Zebra. This functionality may become available in future releases. Index: head/share/man/man4/ng_pptpgre.4 =================================================================== --- head/share/man/man4/ng_pptpgre.4 (revision 301588) +++ head/share/man/man4/ng_pptpgre.4 (revision 301589) @@ -1,177 +1,178 @@ .\" Copyright (c) 1996-1999 Whistle Communications, Inc. .\" All rights reserved. .\" .\" Subject to the following obligations and disclaimer of warranty, use and .\" redistribution of this software, in source or object code forms, with or .\" without modifications are expressly permitted by Whistle Communications; .\" provided, however, that: .\" 1. Any and all reproductions of the source or object code must include the .\" copyright notice above and the following disclaimer of warranties; and .\" 2. No rights are granted, in any manner or form, to use Whistle .\" Communications, Inc. trademarks, including the mark "WHISTLE .\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as .\" such appears in the above copyright notice or in the software. .\" .\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND .\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO .\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, .\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. .\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY .\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS .\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. .\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES .\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING .\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, .\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR .\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER 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 WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY .\" OF SUCH DAMAGE. .\" .\" Author: Archie Cobbs .\" .\" $FreeBSD$ .\" $Whistle: ng_pptpgre.8,v 1.2 1999/12/08 00:20:53 archie Exp $ .\" .Dd November 13, 2012 .Dt NG_PPTPGRE 4 .Os .Sh NAME .Nm ng_pptpgre .Nd PPTP GRE protocol netgraph node type .Sh SYNOPSIS .In sys/types.h .In netgraph/ng_pptpgre.h .Sh DESCRIPTION The .Nm pptpgre node type performs Generic Routing Encapsulation (GRE) over IP for the PPTP protocol as specified by RFC 2637. This involves packet encapsulation, sequencing, acknowledgement, and an adaptive timeout sliding window mechanism. This node type does not handle any of the TCP control protocol or call negotiation defined by PPTP. .Pp This node type expects to receive complete IP packets, including the IP header, on the .Dq Li lower hook, but it transmits outgoing frames without any IP header. The typical use for this node type would be to connect the .Dq Li upper hook to one of the link hooks of a .Xr ng_ppp 4 node, and the .Dq Li lower hook to the .Dq Li "inet/raw/gre" hook of a .Xr ng_ksocket 4 node. .Sh HOOKS This node type supports the following hooks: .Bl -tag -width ".Va session_hhhh" .It Va session_hhhh Session 0xhhhh data packets to the upper protocol layers .It Va upper Same as session_hhhh, but for single session with configurable cid (legacy) .It Va lower Connection to the lower protocol layers .El .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width foo .It Dv NGM_PPTPGRE_SET_CONFIG Pq Ic setconfig -This command resets and configures hook for a session. If corresponding +This command resets and configures hook for a session. +If corresponding session_hhhh hook is not connected, upper hook will be configured. This command takes a .Vt "struct ng_pptpgre_conf" as an argument: .Bd -literal /* Configuration for a session */ struct ng_pptpgre_conf { u_char enabled; /* enables traffic flow */ u_char enableDelayedAck; /* enables delayed acks */ u_char enableAlwaysAck; /* always include ack with data */ u_char enableWindowing; /* enable windowing algorithm */ uint16_t cid; /* my call id */ uint16_t peerCid; /* peer call id */ uint16_t recvWin; /* peer recv window size */ uint16_t peerPpd; /* peer packet processing delay (in 1/10 of a second) */ }; .Ed .Pp The .Va enabled field enables traffic flow through the node. The .Va enableDelayedAck field enables delayed acknowledgement (maximum 250 milliseconds), which is a useful optimization and should generally be turned on. .Va enableAlwaysAck field enables sending acknowledgements with every data packet, which is probably helpful as well. .Pp .Va enableWindowing enables the PPTP packet windowing mechanism specified by the protocol. Disabling this will cause the node to violate the protocol, possibly confusing other PPTP peers, but often results in better performance. The windowing mechanism is a design error in the PPTP protocol; L2TP, the successor to PPTP, removes it. .Pp The remaining fields are as supplied by the PPTP virtual call setup process. .It Dv NGM_PPTPGRE_GET_CONFIG Pq Ic getconfig Takes two byte argument as cid and returns the current configuration as a .Vt "struct ng_pptpgre_conf" . .It Dv NGM_PPTPGRE_GET_STATS Pq Ic getstats This command returns a .Vt "struct ng_pptpgre_stats" containing various node statistics. .It Dv NGM_PPTPGRE_CLR_STATS Pq Ic clrstats This command resets the node statistics. .It Dv NGM_PPTPGRE_GETCLR_STATS Pq Ic getclrstats This command atomically gets and resets the node statistics, returning a .Vt "struct ng_pptpgre_stats" . .El .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN control message, or when both hooks have been disconnected. .Sh SEE ALSO .Xr netgraph 4 , .Xr ng_ksocket 4 , .Xr ng_ppp 4 , .Xr ngctl 8 .Rs .%A K. Hamzeh .%A G. Pall .%A W. Verthein .%A J. Taarud .%A W. Little .%A G. Zorn .%T "Point-to-Point Tunneling Protocol (PPTP)" .%O RFC 2637 .Re .Rs .%A S. Hanks .%A T. \&Li .%A D. Farinacci .%A P. Traina .%T "Generic Routing Encapsulation over IPv4 networks" .%O RFC 1702 .Re .Sh HISTORY The .Nm node type was implemented in .Fx 4.0 . .Sh AUTHORS .An Archie Cobbs Aq Mt archie@FreeBSD.org .Sh BUGS The node should not expect incoming GRE packets to have an IP header. This behavior is inherited from the (converse) behavior of raw IP sockets. An intermediate node that strips IP headers in one direction should be used instead. Index: head/share/man/man4/ng_pred1.4 =================================================================== --- head/share/man/man4/ng_pred1.4 (revision 301588) +++ head/share/man/man4/ng_pred1.4 (revision 301589) @@ -1,145 +1,146 @@ .\" .\" Copyright (c) 2006, Alexander Motin .\" 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 unmodified, 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 December 24, 2006 .Dt NG_PRED1 4 .Os .Sh NAME .Nm ng_pred1 .Nd Predictor-1 PPP compression (RFC 1978) netgraph node type .Sh SYNOPSIS .In sys/types.h .In netgraph/ng_pred1.h .Sh DESCRIPTION The .Nm pred1 node type implements the Predictor-1 sub-protocols of the Compression Control Protocol (CCP). .Pp The node has two hooks, .Va comp for compression and .Va decomp for decompression. Only one of them can be connected at the same time, specifying node's operation mode. Typically that hooks would be connected to the .Xr ng_ppp 4 node type hook of the same name. .Sh HOOKS This node type supports the following hooks: .Pp .Bl -tag -compact -width ".Va decomp" .It Va comp Connection to .Xr ng_ppp 4 .Va compress hook. Incoming frames are compressed and sent back out the same hook. .It Va decomp Connection to .Xr ng_ppp 4 .Va decompress hook. Incoming frames are decompressed and sent back out the same hook. .El .Pp Only one hook can be connected at the same time, specifying node's operation mode. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width foo .It Dv NGM_PRED1_CONFIG Pq Ic config This command resets and configures the node for a session (i.e., for compression or decompression). This command takes a .Vt "struct ng_pred1_config" as an argument: .Bd -literal -offset 0n struct ng_pred1_config { u_char enable; /* node enabled */ }; .Ed The .Ft enable field enables traffic flow through the node. .It Dv NGM_PRED1_RESETREQ Pq Ic resetreq This message contains no arguments, and is bi-directional. If an error is detected during decompression, this message is sent by the node to the originator of the .Dv NGM_PRED1_CONFIG message that initiated the session. The receiver should respond by sending a PPP CCP Reset-Request to the peer. .Pp This message may also be received by this node type when a CCP Reset-Request or Reset-Ack is received by the local PPP entity. The node will respond by flushing its compression state so the sides can resynchronize. .It Dv NGM_PRED1_GET_STATS Pq Ic getstats This control message obtains statistics for a given hook. The statistics are returned in .Vt "struct ng_pred1_stats" : .Bd -literal struct ng_pred1_stats { uint64_t FramesPlain; uint64_t FramesComp; uint64_t FramesUncomp; uint64_t InOctets; uint64_t OutOctets; uint64_t Errors; }; .Ed .It Dv NGM_PRED1_CLR_STATS Pq Ic clrstats This control message clears statistics for a given hook. .It Dv NGM_PRED1_GETCLR_STATS Pq Ic getclrstats This control message obtains and clears statistics for a given hook. .El .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN control message, or when hook have been disconnected. .Sh SEE ALSO .Xr netgraph 4 , .Xr ng_ppp 4 , .Xr ngctl 8 .Rs .%A D. Rand .%T "PPP Predictor Compression Protocol" .%O RFC 1978 .Re .Rs .%A W. Simpson .%T "The Point-to-Point Protocol (PPP)" .%O RFC 1661 .Re .Sh AUTHORS .An Alexander Motin Aq Mt mav@alkar.net .Sh BUGS Due to nature of netgraph PPP implementation there are possible race conditions -between data packet and ResetAck CCP packet in case of packet loss. As result, +between data packet and ResetAck CCP packet in case of packet loss. +As result, packet loss can produce bigger performance degradation than supposed by protocol. Index: head/share/man/man4/nvd.4 =================================================================== --- head/share/man/man4/nvd.4 (revision 301588) +++ head/share/man/man4/nvd.4 (revision 301589) @@ -1,106 +1,107 @@ .\" .\" Copyright (c) 2012-2016 Intel Corporation .\" 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, .\" without modification. .\" 2. Redistributions in binary form must reproduce at minimum a disclaimer .\" substantially similar to the "NO WARRANTY" disclaimer below .\" ("Disclaimer") and any redistribution must be conditioned upon .\" including a substantially similar Disclaimer requirement for further .\" binary redistribution. .\" .\" NO WARRANTY .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR .\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT .\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. .\" .\" nvd driver man page. .\" .\" Author: Jim Harris .\" .\" $FreeBSD$ .\" .Dd January 28, 2016 .Dt NVD 4 .Os .Sh NAME .Nm nvd .Nd NVM Express disk driver .Sh SYNOPSIS To compile this driver into your kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device nvme" .Cd "device nvd" .Ed .Pp Or, to load the driver as a module at boot, place the following lines in .Xr loader.conf 5 : .Bd -literal -offset indent nvme_load="YES" nvd_load="YES" .Ed .Sh DESCRIPTION The .Nm driver exposes NVM Express (NVMe) namespaces as disks to the kernel disk storage API. It depends on the .Xr nvme 4 driver for notification of existing NVMe namespaces and submission of NVM I/O commands. .Pp Device nodes from the .Nm driver will have the format /dev/nvdX and are .Xr GEOM 4 disks which can be partitioned by .Xr geom 8 . Note that device nodes from the .Xr nvme 4 driver are not .Xr GEOM 4 disks and cannot be partitioned. .Sh CONFIGURATION The .Nm -driver defines a system-wide maximum delete size for NVMe devices. The -default is 1GB. To select a different value, set the following tunable in +driver defines a system-wide maximum delete size for NVMe devices. +The default is 1GB. +To select a different value, set the following tunable in .Xr loader.conf 5 : .Bd -literal -offset indent hw.nvd.delete_max= .Ed .Sh SEE ALSO .Xr GEOM 4 , .Xr nvme 4 , .Xr geom 8 , .Xr nvmecontrol 8 , .Xr disk 9 .Sh HISTORY The .Nm driver first appeared in .Fx 9.2 . .Sh AUTHORS .An -nosplit The .Nm driver was developed by Intel and originally written by .An Jim Harris Aq Mt jimharris@FreeBSD.org , with contributions from Joe Golio at EMC. .Pp This man page was written by .An Jim Harris Aq Mt jimharris@FreeBSD.org . Index: head/share/man/man4/nvme.4 =================================================================== --- head/share/man/man4/nvme.4 (revision 301588) +++ head/share/man/man4/nvme.4 (revision 301589) @@ -1,185 +1,186 @@ .\" .\" Copyright (c) 2012-2016 Intel Corporation .\" 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, .\" without modification. .\" 2. Redistributions in binary form must reproduce at minimum a disclaimer .\" substantially similar to the "NO WARRANTY" disclaimer below .\" ("Disclaimer") and any redistribution must be conditioned upon .\" including a substantially similar Disclaimer requirement for further .\" binary redistribution. .\" .\" NO WARRANTY .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR .\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT .\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. .\" .\" nvme driver man page. .\" .\" Author: Jim Harris .\" .\" $FreeBSD$ .\" .Dd January 7, 2016 .Dt NVME 4 .Os .Sh NAME .Nm nvme .Nd NVM Express core driver .Sh SYNOPSIS To compile this driver into your kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "device nvme" .Ed .Pp Or, to load the driver as a module at boot, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent nvme_load="YES" .Ed .Pp Most users will also want to enable .Xr nvd 4 to surface NVM Express namespaces as disk devices which can be partitioned. Note that in NVM Express terms, a namespace is roughly equivalent to a SCSI LUN. .Sh DESCRIPTION The .Nm driver provides support for NVM Express (NVMe) controllers, such as: .Bl -bullet .It Hardware initialization .It Per-CPU IO queue pairs .It API for registering NVMe namespace consumers such as .Xr nvd 4 .It API for submitting NVM commands to namespaces .It Ioctls for controller and namespace configuration and management .El .Pp The .Nm driver creates controller device nodes in the format .Pa /dev/nvmeX and namespace device nodes in the format .Pa /dev/nvmeXnsY . Note that the NVM Express specification starts numbering namespaces at 1, not 0, and this driver follows that convention. .Sh CONFIGURATION By default, .Nm will create an I/O queue pair for each CPU, provided enough MSI-X vectors -and NVMe queue pairs can be allocated. If not enough vectors or queue +and NVMe queue pairs can be allocated. +If not enough vectors or queue pairs are available, nvme(4) will use a smaller number of queue pairs and assign multiple CPUs per queue pair. .Pp To force a single I/O queue pair shared by all CPUs, set the following tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent hw.nvme.per_cpu_io_queues=0 .Ed .Pp To assign more than one CPU per I/O queue pair, thereby reducing the number of MSI-X vectors consumed by the device, set the following tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent hw.nvme.min_cpus_per_ioq=X .Ed .Pp To force legacy interrupts for all .Nm driver instances, set the following tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent hw.nvme.force_intx=1 .Ed .Pp Note that use of INTx implies disabling of per-CPU I/O queue pairs. .Sh SYSCTL VARIABLES The following controller-level sysctls are currently implemented: .Bl -tag -width indent .It Va dev.nvme.0.num_cpus_per_ioq (R) Number of CPUs associated with each I/O queue pair. .It Va dev.nvme.0.int_coal_time (R/W) Interrupt coalescing timer period in microseconds. Set to 0 to disable. .It Va dev.nvme.0.int_coal_threshold (R/W) Interrupt coalescing threshold in number of command completions. Set to 0 to disable. .El .Pp The following queue pair-level sysctls are currently implemented. Admin queue sysctls take the format of dev.nvme.0.adminq and I/O queue sysctls take the format of dev.nvme.0.ioq0. .Bl -tag -width indent .It Va dev.nvme.0.ioq0.num_entries (R) Number of entries in this queue pair's command and completion queue. .It Va dev.nvme.0.ioq0.num_tr (R) Number of nvme_tracker structures currently allocated for this queue pair. .It Va dev.nvme.0.ioq0.num_prp_list (R) Number of nvme_prp_list structures currently allocated for this queue pair. .It Va dev.nvme.0.ioq0.sq_head (R) Current location of the submission queue head pointer as observed by the driver. The head pointer is incremented by the controller as it takes commands off of the submission queue. .It Va dev.nvme.0.ioq0.sq_tail (R) Current location of the submission queue tail pointer as observed by the driver. The driver increments the tail pointer after writing a command into the submission queue to signal that a new command is ready to be processed. .It Va dev.nvme.0.ioq0.cq_head (R) Current location of the completion queue head pointer as observed by the driver. The driver increments the head pointer after finishing with a completion entry that was posted by the controller. .It Va dev.nvme.0.ioq0.num_cmds (R) Number of commands that have been submitted on this queue pair. .It Va dev.nvme.0.ioq0.dump_debug (W) Writing 1 to this sysctl will dump the full contents of the submission and completion queues to the console. .El .Sh SEE ALSO .Xr nvd 4 , .Xr pci 4 , .Xr nvmecontrol 8 , .Xr disk 9 .Sh HISTORY The .Nm driver first appeared in .Fx 9.2 . .Sh AUTHORS .An -nosplit The .Nm driver was developed by Intel and originally written by .An Jim Harris Aq Mt jimharris@FreeBSD.org , with contributions from .An Joe Golio at EMC. .Pp This man page was written by .An Jim Harris Aq Mt jimharris@FreeBSD.org . Index: head/share/man/man4/nvram2env.4 =================================================================== --- head/share/man/man4/nvram2env.4 (revision 301588) +++ head/share/man/man4/nvram2env.4 (revision 301589) @@ -1,116 +1,117 @@ .\" Copyright (c) 2011 Aleksandr Rybalko .\" 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 April 3, 2011 .Dt NVRAM2ENV 4 .Os .Sh NAME .Nm nvram2env .Nd "copy nvram-like data into kernel environment" .Sh SYNOPSIS .Cd "device nvram2env" .Sh DESCRIPTION .Nm implements a simple method of reading the NVRAM-like data and information -stored in flash and storing it in the kernel environment. It can then be -used by various device drivers at boot-time. +stored in flash and storing it in the kernel environment. +It can then be used by various device drivers at boot-time. .Pp -The NVRAM-like data is an array of zero terminated strings. Each string contains -the string name, "=" delimiter and the string value. +The NVRAM-like data is an array of zero terminated strings. +Each string contains the string name, "=" delimiter and the string value. .Pp .Nm copies the environment values into kernel environment using the kernel setenv call. .Pp Configuration of .Nm is done in .Xr device.hints 5 defining the NVRAM base address, fallback base address, maxsize and flags. .Pp .Nm is currently MIPS-specific. .Ss base base - physical address where data block is stored. .Ss fallbackbase fallbackbase - physical address where data block is stored, but only if not found at base. .Ss maxsize maxsize - maximum size of data block. .Ss flags flags - control flags, used to select nvram type and enable/disable CRC check. .Bl -tag -width indent .It Fa 0x0001 -Avoid CRC checking. Currently CRC checking is not implemented, so to be future +Avoid CRC checking. +Currently CRC checking is not implemented, so to be future compatible, please set it to "1". .It Fa 0x0002 Use format "Generic", skip uint32_t field, then zero terminating array of strings. .It Fa 0x0004 -Use Broadcom CFE format. uint32_t signature "FLSH", uint32_t size, +Use Broadcom CFE format, uint32_t signature "FLSH", uint32_t size, three unused fields uint32_t, then data. .It Fa 0x0008 Use U-Boot format, uint32_t crc, then zero terminating array of strings. .El .Sh EXAMPLES Usage in U-Boot case: .Bd -literal -offset indent hint.nvram.0.base=0x1f030000 hint.nvram.0.maxsize=0x2000 hint.nvram.0.flags=3 # 1 = No check, 2 = Format Generic hint.nvram.1.base=0x1f032000 hint.nvram.1.maxsize=0x4000 hint.nvram.1.flags=3 # 1 = No check, 2 = Format Generic .Ed .Pp CFE nvram with fallback: .Bd -literal -offset indent hint.nvram.0.base=0x1fff8000 hint.nvram.0.fallbackbase=0x1fc00400 hint.nvram.0.flags=4 # 4 = Format Broadcom .Ed .Pp but seems for CFE nvram preferred to read both blocks: .Pp NVRAM partition: Static, CFE internal .Bd -literal -offset indent hint.nvram.0.flags=0x05 # Broadcom + nocheck hint.nvram.0.base=0x1fc00400 .Ed .Pp Dynamic, editable form CFE, override values from first .Bd -literal -offset indent hint.nvram.1.flags=0x05 # Broadcom + nocheck hint.nvram.1.base=0x1cff8000 .Ed .Sh SEE ALSO .Xr kenv 1 , .Xr kenv 2 .Sh HISTORY .Nm first appeared in .Fx 9.0 . .Sh AUTHORS .An Aleksandr Rybalko Aq Mt ray@ddteam.net Index: head/share/man/man4/proto.4 =================================================================== --- head/share/man/man4/proto.4 (revision 301588) +++ head/share/man/man4/proto.4 (revision 301589) @@ -1,473 +1,475 @@ .\" .\" Copyright (c) 2014, 2015 Marcel Moolenaar .\" 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 ``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 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 August 7, 2015 .Dt PROTO 4 .Os .\" .Sh NAME .Nm proto .Nd Generic prototyping and diagnostics driver .\" .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "device proto" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent proto_load="YES" .Ed .Pp To have the driver attach to a device instead of its regular driver, mention it in the list of devices assigned to the following loader variable: .Bd -ragged -offset indent hw.proto.attach="desc[,desc]" .Ed .\" .Sh DESCRIPTION The .Nm device driver attaches to PCI or ISA devices when no other device drivers are present for those devices and it creates device special files for all resources associated with the device. The driver itself has no knowledge of the device it attaches to. Programs can open these device special files and perform register-level reads and writes. As such, the .Nm device driver is nothing but a conduit or gateway between user space programs and the hardware device. .Pp Examples for why this is useful include hardware diagnostics and prototyping. In both these use cases, it is far more convenient to develop and run the logic in user space. Especially hardware diagnostics requires a somewhat user-friendly interface and adequate reporting. Neither is done easily as kernel code. .Ss I/O port resources Device special files created for I/O port resources allow .Xr lseek 2 , .Xr read 2 , .Xr write 2 and .Xr ioctl 2 operations to be performed on them. The .Xr read 2 and .Xr write 2 system calls are used to perform input and output (resp.) on the port. The amount of data that can be read or written at any single time is either 1, 2 or 4 bytes. While the .Nm driver does not prevent reading or writing 8 bytes at a time for some architectures, it should not be assumed that such actually produces correct results. The .Xr lseek 2 system call is used to select the port number, relative to the I/O port region being represented by the device special file. If, for example, the device special file corresponds to an I/O port region from 0x3f8 to 0x3ff inclusive, then an offset of 4 given to lseek with a whence value of SEEK_SET will target port 0x3fc on the next read or write operation. The .Xr ioctl 2 system call can be used for the .Dv PROTO_IOC_REGION request. This ioctl request returns the extend of the resource covered by this -device special file. The extend is returned in the following structure: +device special file. +The extend is returned in the following structure: .Bd -literal struct proto_ioc_region { unsigned long address; unsigned long size; }; .Ed .Ss Memory mapped I/O resources The device special files created for memory mapped I/O resources behave in the same way as those created for I/O port resources. Additionally, device special files for memory mapped I/O resources allow the memory to be mapped into the process' address space using .Xr mmap 2 . Reads and writes to the memory address returned by .Xr mmap 2 go directly to the hardware. As such the use of .Xr read 2 and .Xr write 2 can be avoided, reducing the access overhead significantly. Alignment and access width constraints put forth by the underlying device apply. Also, make sure the compiler does not optimize memory accesses away or has them coalesced into bigger accesses. .Ss DMA pseudo resource A device special file named .Pa busdma is created for the purpose of doing DMA. It only supports .Xr ioctl 2 and only for the .Dv PROTO_IOC_BUSDMA request. This device special file does not support .Xr read 2 nor .Xr write 2 . The .Dv PROTO_IOC_BUSDMA request has an argument that is both in and out and is defined as follows: .Bd -literal struct proto_ioc_busdma { unsigned int request; unsigned long key; union { struct { unsigned long align; unsigned long bndry; unsigned long maxaddr; unsigned long maxsz; unsigned long maxsegsz; unsigned int nsegs; unsigned int datarate; unsigned int flags; } tag; struct { unsigned long tag; unsigned int flags; unsigned long virt_addr; unsigned long virt_size; unsigned int phys_nsegs; unsigned long phys_addr; unsigned long bus_addr; unsigned int bus_nsegs; } md; struct { unsigned int op; unsigned long base; unsigned long size; } sync; } u; unsigned long result; }; .Ed The .Va request field is used to specify which DMA operation is to be performed. The .Va key field is used to specify which object the operation applies to. An object is either a tag or a memory descriptor (md). The following DMA operations are defined: .Bl -tag -width XXXX .It PROTO_IOC_BUSDMA_TAG_CREATE Create a root tag. The .Va result field is set on output with the key of the DMA tag. The tag is created with the constraints given by the .Va tag -sub-structure. These constraints correspond roughly to those that can be -given to the +sub-structure. +These constraints correspond roughly to those that can be given to the .Xr bus_dma_tag_create 9 function. .It PROTO_IOC_BUSDMA_TAG_DERIVE Create a derived tag. The .Va key field is used to identify the parent tag from which to derive the new tag. The key of the derived tag is returned in the .Va result field. The derived tag combines the constraints of the parent tag with those given by the .Va tag sub-structure. The combined constraints are written back to the .Va tag sub-structure on return. .It PROTO_IOC_BUSDMA_TAG_DESTROY Destroy a root or derived tag previously created. The .Va key field specifies the tag to destroy. A tag can only be destroyed when not referenced anymore. This means that derived tags that have this tag as a parent and memory descriptors created from this tag must be destroyed first. .It PROTO_IOC_BUSDMA_MEM_ALLOC Allocate memory that satisfies the constraints put forth by the tag given in the .Va tag field of the .Va md sub-structure. The key of the memory descriptor for this memory is returned in the .Va result field. The .Va md sub-structure is filled on return with details of the allocation. The kernel virtual address and the size of the allocated memory are returned in the .Va virt_addr and .Va virt_size fields. The number of contigous physical memory segments and the address of the first segment are returned in the .Va phys_nsegs and .Va phys_addr fields. Allocated memory is automatically loaded and thus mapped into bus space. The number of bus segments and the address of the first segment are returned in the .Va bus_nsegs and .Va bus_addr fields. The behaviour of this operation banks heavily on how .Xr bus_dmamem_alloc 9 is implemented, which means that memory is currently always allocated as a single contigous region of physical memory. In practice this also tends to give a single contigous region in bus space. This may change over time. .It PROTO_IOC_BUSDMA_MEM_FREE Free previously allocated memory and destroy the memory desciptor. The .Nm driver is not in a position to track whether the memory has been mapped in the process' address space, so the application is responsible for unmapping the memory before it is freed. The .Nm driver also cannot protect against the hardware writing to or reading from the memory, even after it has been freed. When the memory is reused for other purposes it can be corrupted or cause the hardware to behave in unpredictable ways when DMA has not stopped completely before freeing. .It PROTO_IOC_BUSDMA_MD_CREATE Create an empty memory descriptor with the tag specified in the .Va tag field of the .Va md sub-structure. The key of the memory descriptor is returned in the .Va result field. .It PROTO_IOC_BUSDMA_MD_DESTROY Destroy the previously created memory descriptor specified by the .Va key field. When the memory descriptor is still loaded, it is unloaded first. .It PROTO_IOC_BUSDMA_MD_LOAD Load a contigous region of memory in the memory descriptor specified by the .Va key field. The size and address in the process' virtual address space are specified by the .Va virt_size and .Va virt_addr fields. On return, the .Va md sub-structure contains the result of the operation. The number of physical segments and the address of the first segment is returned in the .Va phys_nsegs and .Va phys_addr fields. The number of bus space segments and the address of the first segment in bus space is returned in the .Va bus_nsegs and .Va bus_addr fields. .It PROTO_IOC_BUSDMA_MD_UNLOAD Unload the memory descriptor specified by the .Va key field. .It PROTO_IOC_BUSDMA_SYNC Guarantee that all hardware components have a coherent view of the memory tracked by the memory descriptor, specified by the .Va key field. A sub-section of the memory can be targeted by specifying the relative offset and size of the memory to make coherent. The offset and size are given by the .Va base and .Va size fields of the .Va sync sub-structure. The .Va op field holds the sync operation to be performed. This is similar to the .Xr bus_dmamap_sync 9 function. .El .Ss PCI configuration space Access to PCI configuration space is possible through the .Pa pcicfg device special file. The device special file supports .Xr lseek 2 , .Xr read 2 and .Xr write 2 . Usage is the asme as for I/O port resources. .Sh FILES All device special files corresponding to a PCI device are located under .Pa /dev/proto/pci::: with .Pa pci::: representing the location of the PCI device in the PCI hierarchy. A PCI location includes: .Pp .Bl -tag -width XXXXXX -compact -offset indent .It The PCI domain number .It The PCI bus number .It The PCI slot or device number .It The PCI function number .El .Pp Every PCI device has a device special file called .Pa pcicfg . This device special file gives access to the PCI configuration space. A device special file called .Pa busdma is also created. This device special file provides the interfaces needed for doing DMA. For each valid base address register (BAR), a device special file is created that contains the BAR offset and the resource type. A resource type can be either .Pa io or .Pa mem representing I/O port or memory mapped I/O space (resp.) .Pp -ISA devices do not have a location. Instead, they are identified by the +ISA devices do not have a location. +Instead, they are identified by the first I/O port address or first memory mapped I/O address. Consequently, all device special files corresponding to an ISA device are located under .Pa /dev/proto/isa: with .Pa addr the address in hexadecimal notation. For each I/O port or memory mapped I/O address, a device special file is created that contains the resource identification used by the kernel and the resource type. The resource type can be either .Pa io or .Pa mem representing I/O port or memory mapped I/O space (resp.) When the device has a DMA channel assigned to it, a device special file with the name .Pa busdma is created as well. This device special file provides the interfaces needed for doing DMA. .Pp If the ISA device is not a Plug-and-Play device nor present in the ACPI device tree, it must have the appropriate hints so that the kernel can reserve the resources for it. .\" .Sh EXAMPLES A single function PCI device in domain 0, on bus 1, in slot 2 and having a single memory mapped I/O region will have the following device special files: .Pp .Bl -tag -width XXXXXX -compact -offset indent .It Pa /dev/proto/pci0:1:2:0/10.mem .It Pa /dev/proto/pci0:1:2:0/pcicfg .El .Pp A legacy floppy controller will have the following device files: .Pp .Bl -tag -width XXXXXX -compact -offset indent .It Pa /dev/proto/isa:0x3f0/00.io .It Pa /dev/proto/isa:0x3f0/01.io .It Pa /dev/proto/isa:0x3f0/busdma .El .\" .Sh SEE ALSO .Xr ioctl 2 , .Xr lseek 2 , .Xr mmap 2 , .Xr read 2 , .Xr write 2 , .Xr bus_dma_tag_create 9 , .Xr bus_dmamap_sync 9 , .Xr bus_dmamem_alloc 9 .\" .Sh AUTHORS The .Nm device driver and this manual page were written by .An Marcel Moolenaar Aq Mt marcel@xcllnt.net . .Sh SECURITY CONSIDERATIONS Because programs have direct access to the hardware, the .Nm driver is inherently insecure. It is not advisable to use this driver on a production machine. .\" .Sh MISSING FUNCTIONALITY The .Nm driver does not fully support memory descriptors that need multiple physical memory segments or multiple bus space segments. At the very least, an operation is needed on the DMA pseudo resource for the application to obtain all segments. .Pp The .Nm driver does not yet support interrupts. Since interrupts cannot be handled by the driver itself, they must be converted into signals and delivered to the program that has registered for interrupts. A satisfactory mechanism for keeping the interrupt masked during the signal handling is still being worked out. .Pp DMA support for devices other than busmaster devices is not present yet. The details of how a program is to interact with the DMA controller still need to be fleshed out. Index: head/share/man/man4/psm.4 =================================================================== --- head/share/man/man4/psm.4 (revision 301588) +++ head/share/man/man4/psm.4 (revision 301589) @@ -1,874 +1,876 @@ .\" .\" Copyright (c) 1997 .\" Kazutaka YOKOTA .\" 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 as .\" the first lines of this file unmodified. .\" 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 ``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 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 March 18, 2013 .Dt PSM 4 .Os .Sh NAME .Nm psm .Nd PS/2 mouse style pointing device driver .Sh SYNOPSIS .Cd "options KBD_RESETDELAY=N" .Cd "options KBD_MAXWAIT=N" .Cd "options PSM_DEBUG=N" .Cd "options KBDIO_DEBUG=N" .Cd "device psm" .Pp In .Pa /boot/device.hints : .Cd hint.psm.0.at="atkbdc" .Cd hint.psm.0.irq="12" .Sh DESCRIPTION The .Nm driver provides support for the PS/2 mouse style pointing device. Currently there can be only one .Nm device node in the system. As the PS/2 mouse port is located at the auxiliary port of the keyboard controller, the keyboard controller driver, .Nm atkbdc , must also be configured in the kernel. Note that there is currently no provision of changing the .Em irq number. .Pp Basic PS/2 style pointing device has two or three buttons. Some devices may have a roller or a wheel and/or additional buttons. .Ss Device Resolution The PS/2 style pointing device usually has several grades of resolution, that is, sensitivity of movement. They are typically 25, 50, 100 and 200 pulse per inch. Some devices may have finer resolution. The current resolution can be changed at runtime. The .Nm driver allows the user to initially set the resolution via the driver flag (see .Sx "DRIVER CONFIGURATION" ) or change it later via the .Xr ioctl 2 command .Dv MOUSE_SETMODE (see .Sx IOCTLS ) . .Ss Report Rate Frequency, or report rate, at which the device sends movement and button state reports to the host system is also configurable. The PS/2 style pointing device typically supports 10, 20, 40, 60, 80, 100 and 200 reports per second. 60 or 100 appears to be the default value for many devices. Note that when there is no movement and no button has changed its state, the device will not send anything to the host system. The report rate can be changed via an ioctl call. .Ss Operation Levels The .Nm driver has three levels of operation. The current operation level can be set via an ioctl call. .Pp At the level zero the basic support is provided; the device driver will report horizontal and vertical movement of the attached device and state of up to three buttons. The movement and status are encoded in a series of fixed-length data packets (see .Sx "Data Packet Format" ) . This is the default level of operation and the driver is initially at this level when opened by the user program. .Pp The operation level one, the `extended' level, supports a roller (or wheel), if any, and up to 11 buttons. The movement of the roller is reported as movement along the Z axis. 8 byte data packets are sent to the user program at this level. .Pp At the operation level two, data from the pointing device is passed to the -user program as is. Conversely, command from the user program is passed +user program as is. +Conversely, command from the user program is passed to the pointing device as is and the user program is responsible for status validation and error recovery. Modern PS/2 type pointing devices often use proprietary data format. Therefore, the user program is expected to have intimate knowledge about the format from a particular device when operating the driver at this level. This level is called `native' level. .Ss Data Packet Format Data packets read from the .Nm driver are formatted differently at each operation level. .Pp A data packet from the PS/2 mouse style pointing device is three bytes long at the operation level zero: .Pp .Bl -tag -width Byte_1 -compact .It Byte 1 .Bl -tag -width bit_7 -compact .It bit 7 One indicates overflow in the vertical movement count. .It bit 6 One indicates overflow in the horizontal movement count. .It bit 5 Set if the vertical movement count is negative. .It bit 4 Set if the horizontal movement count is negative. .It bit 3 Always one. .\" The ALPS GlidePoint clears this bit when the user `taps' the surface of .\" the pad, otherwise the bit is set. .\" Most, if not all, other devices always set this bit. .It bit 2 Middle button status; set if pressed. For devices without the middle button, this bit is always zero. .It bit 1 Right button status; set if pressed. .It bit 0 Left button status; set if pressed. .El .It Byte 2 Horizontal movement count in two's complement; -256 through 255. Note that the sign bit is in the first byte. .It Byte 3 Vertical movement count in two's complement; -256 through 255. Note that the sign bit is in the first byte. .El .Pp At the level one, a data packet is encoded in the standard format .Dv MOUSE_PROTO_SYSMOUSE as defined in .Xr mouse 4 . .Pp At the level two, native level, there is no standard on the size and format of the data packet. .Ss Acceleration The .Nm driver can somewhat `accelerate' the movement of the pointing device. The faster you move the device, the further the pointer travels on the screen. The driver has an internal variable which governs the effect of the acceleration. Its value can be modified via the driver flag or via an ioctl call. .Sh DRIVER CONFIGURATION .Ss Kernel Configuration Options There are following kernel configuration options to control the .Nm driver. They may be set in the kernel configuration file (see .Xr config 8 ) . .Bl -tag -width MOUSE .It Em KBD_RESETDELAY=X , KBD_MAXWAIT=Y The .Nm driver will attempt to reset the pointing device during the boot process. It sometimes takes a long while before the device will respond after reset. These options control how long the driver should wait before it eventually gives up waiting. The driver will wait .Fa X * .Fa Y msecs at most. If the driver seems unable to detect your pointing device, you may want to increase these values. The default values are 200 msec for .Fa X and 5 for .Fa Y . .It Em PSM_DEBUG=N , KBDIO_DEBUG=N Sets the debug level to .Fa N . The default debug level is zero. See .Sx DIAGNOSTICS for debug logging. .El .Ss Driver Flags The .Nm driver accepts the following driver flags. Set them in .Pa /boot/device.hints (see .Sx EXAMPLES below). .Bl -tag -width MOUSE .It bit 0..3 RESOLUTION This flag specifies the resolution of the pointing device. It must be zero through four. The greater the value is, the finer resolution the device will select. Actual resolution selected by this field varies according to the model of the device. Typical resolutions are: .Pp .Bl -tag -width 0_(medium_high)__ -compact .It Em 1 (low) 25 pulse per inch (ppi) .It Em 2 (medium low) 50 ppi .It Em 3 (medium high) 100 ppi .It Em 4 (high) 200 ppi .El .Pp Leaving this flag zero will selects the default resolution for the device (whatever it is). .It bit 4..7 ACCELERATION This flag controls the amount of acceleration effect. The smaller the value of this flag is, more sensitive the movement becomes. The minimum value allowed, thus the value for the most sensitive setting, is one. Setting this flag to zero will completely disables the acceleration effect. .It bit 8 NOCHECKSYNC The .Nm driver tries to detect the first byte of the data packet by checking the bit pattern of that byte. Although this method should work with most PS/2 pointing devices, it may interfere with some devices which are not so compatible with known devices. If you think your pointing device is not functioning as expected, and the kernel frequently prints the following message to the console, .Bd -literal -offset indent psmintr: out of sync (xxxx != yyyy). .Ed .Pp set this flag to disable synchronization check and see if it helps. .It bit 9 NOIDPROBE The .Nm driver will not try to identify the model of the pointing device and will not carry out model-specific initialization. The device should always act like a standard PS/2 mouse without such initialization. Extra features, such as wheels and additional buttons, will not be recognized by the .Nm driver. .It bit 10 NORESET When this flag is set, the .Nm driver will not reset the pointing device when initializing the device. If the .Fx kernel is started after another OS has run, the pointing device will inherit settings from the previous OS. However, because there is no way for the .Nm driver to know the settings, the device and the driver may not work correctly. The flag should never be necessary under normal circumstances. .It bit 11 FORCETAP Some pad devices report as if the fourth button is pressed when the user `taps' the surface of the device (see .Sx CAVEATS ) . This flag will make the .Nm driver assume that the device behaves this way. Without the flag, the driver will assume this behavior for ALPS GlidePoint models only. .It bit 12 IGNOREPORTERROR This flag makes .Nm driver ignore certain error conditions when probing the PS/2 mouse port. It should never be necessary under normal circumstances. .It bit 13 HOOKRESUME The built-in PS/2 pointing device of some laptop computers is somehow not operable immediately after the system `resumes' from the power saving mode, though it will eventually become available. There are reports that stimulating the device by performing I/O will help waking up the device quickly. This flag will enable a piece of code in the .Nm driver to hook the `resume' event and exercise some harmless I/O operations on the device. .It bit 14 INITAFTERSUSPEND This flag adds more drastic action for the above problem. It will cause the .Nm driver to reset and re-initialize the pointing device after the `resume' event. .El .Sh LOADER TUNABLES Extended support for Synaptics touchpads can be enabled by setting .Va hw.psm.synaptics_support to .Em 1 at boot-time. This will enable .Nm to handle packets from guest devices (sticks) and extra buttons. Similarly, extended support for IBM/Lenovo TrackPoint can be enabled by setting .Va hw.psm.trackpoint_support to .Em 1 at boot-time. .Pp Tap and drag gestures can be disabled by setting .Va hw.psm.tap_enabled to .Em 0 at boot-time. Currently, this is only supported on Synaptics touchpads with Extended -support disabled. The behaviour may be changed after boot by setting +support disabled. +The behaviour may be changed after boot by setting the sysctl with the same name and by restarting .Xr moused 8 using .Pa /etc/rc.d/moused . .Sh IOCTLS There are a few .Xr ioctl 2 commands for mouse drivers. These commands and related structures and constants are defined in .In sys/mouse.h . General description of the commands is given in .Xr mouse 4 . This section explains the features specific to the .Nm driver. .Pp .Bl -tag -width MOUSE -compact .It Dv MOUSE_GETLEVEL Ar int *level .It Dv MOUSE_SETLEVEL Ar int *level These commands manipulate the operation level of the .Nm driver. .Pp .It Dv MOUSE_GETHWINFO Ar mousehw_t *hw Returns the hardware information of the attached device in the following structure. .Bd -literal typedef struct mousehw { int buttons; /* number of buttons */ int iftype; /* I/F type */ int type; /* mouse/track ball/pad... */ int model; /* I/F dependent model ID */ int hwid; /* I/F dependent hardware ID */ } mousehw_t; .Ed .Pp The .Dv buttons field holds the number of buttons on the device. The .Nm driver currently can detect the 3 button mouse from Logitech and report accordingly. The 3 button mouse from the other manufacturer may or may not be reported correctly. However, it will not affect the operation of the driver. .Pp The .Dv iftype is always .Dv MOUSE_IF_PS2 . .Pp The .Dv type tells the device type: .Dv MOUSE_MOUSE , .Dv MOUSE_TRACKBALL , .Dv MOUSE_STICK , .Dv MOUSE_PAD , or .Dv MOUSE_UNKNOWN . The user should not heavily rely on this field, as the driver may not always, in fact it is very rarely able to, identify the device type. .Pp The .Dv model is always .Dv MOUSE_MODEL_GENERIC at the operation level 0. It may be .Dv MOUSE_MODEL_GENERIC or one of .Dv MOUSE_MODEL_XXX constants at higher operation levels. Again the .Nm driver may or may not set an appropriate value in this field. .Pp The .Dv hwid is the ID value returned by the device. Known IDs include: .Pp .Bl -tag -width 0__ -compact .It Em 0 Mouse (Microsoft, Logitech and many other manufacturers) .It Em 2 Microsoft Ballpoint mouse .It Em 3 Microsoft IntelliMouse .El .Pp .It Dv MOUSE_SYN_GETHWINFO Ar synapticshw_t *synhw Retrieves extra information associated with Synaptics Touchpad. Only available when a supported device has been detected. .Bd -literal typedef struct synapticshw { int infoMajor; /* major hardware revision */ int infoMinor; /* minor hardware revision */ int infoRot180; /* touchpad is rotated */ int infoPortrait; /* touchpad is a portrait */ int infoSensor; /* sensor model */ int infoHardware; /* hardware model */ int infoNewAbs; /* supports the newabs format */ int capPen; /* can detect a pen */ int infoSimplC; /* supports simple commands */ int infoGeometry; /* touchpad dimensions */ int capExtended; /* supports extended packets */ int capSleep; /* can be suspended/resumed */ int capFourButtons; /* has four buttons */ int capMultiFinger; /* can detect multiple fingers */ int capPalmDetect; /* can detect a palm */ int capPassthrough; /* can passthrough guest packets */ int capMiddle; /* has a physical middle button */ int nExtendedButtons; /* has N additionnal buttons */ int nExtendedQueries; /* supports N extended queries */ } synapticshw_t; .Ed .Pp See the .Em Synaptics TouchPad Interfacing Guide for more information about the fields in this structure. .Pp .It Dv MOUSE_GETMODE Ar mousemode_t *mode The command gets the current operation parameters of the mouse driver. .Bd -literal typedef struct mousemode { int protocol; /* MOUSE_PROTO_XXX */ int rate; /* report rate (per sec), -1 if unknown */ int resolution; /* MOUSE_RES_XXX, -1 if unknown */ int accelfactor; /* acceleration factor */ int level; /* driver operation level */ int packetsize; /* the length of the data packet */ unsigned char syncmask[2]; /* sync. bits */ } mousemode_t; .Ed .Pp The .Dv protocol is .Dv MOUSE_PROTO_PS2 at the operation level zero and two. .Dv MOUSE_PROTO_SYSMOUSE at the operation level one. .Pp The .Dv rate is the status report rate (reports/sec) at which the device will send movement report to the host computer. Typical supported values are 10, 20, 40, 60, 80, 100 and 200. Some mice may accept other arbitrary values too. .Pp The .Dv resolution of the pointing device must be one of .Dv MOUSE_RES_XXX constants or a positive value. The greater the value is, the finer resolution the mouse will select. Actual resolution selected by the .Dv MOUSE_RES_XXX constant varies according to the model of mouse. Typical resolutions are: .Pp .Bl -tag -width MOUSE_RES_MEDIUMHIGH__ -compact .It Dv MOUSE_RES_LOW 25 ppi .It Dv MOUSE_RES_MEDIUMLOW 50 ppi .It Dv MOUSE_RES_MEDIUMHIGH 100 ppi .It Dv MOUSE_RES_HIGH 200 ppi .El .Pp The .Dv accelfactor field holds a value to control acceleration feature (see .Sx Acceleration ) . It must be zero or greater. If it is zero, acceleration is disabled. .Pp The .Dv packetsize field specifies the length of the data packet. It depends on the operation level and the model of the pointing device. .Pp .Bl -tag -width level_0__ -compact .It Em level 0 3 bytes .It Em level 1 8 bytes .It Em level 2 Depends on the model of the device .El .Pp The array .Dv syncmask holds a bit mask and pattern to detect the first byte of the data packet. .Dv syncmask[0] is the bit mask to be ANDed with a byte. If the result is equal to .Dv syncmask[1] , the byte is likely to be the first byte of the data packet. Note that this detection method is not 100% reliable, thus, should be taken only as an advisory measure. .Pp .It Dv MOUSE_SETMODE Ar mousemode_t *mode The command changes the current operation parameters of the mouse driver as specified in .Ar mode . Only .Dv rate , .Dv resolution , .Dv level and .Dv accelfactor may be modifiable. Setting values in the other field does not generate error and has no effect. .Pp If you do not want to change the current setting of a field, put -1 there. You may also put zero in .Dv resolution and .Dv rate , and the default value for the fields will be selected. .\" .Pp .\" .It Dv MOUSE_GETVARS Ar mousevar_t *vars .\" .It Dv MOUSE_SETVARS Ar mousevar_t *vars .\" These commands are not supported by the .\" .Nm .\" driver. .Pp .It Dv MOUSE_READDATA Ar mousedata_t *data .\" The command reads the raw data from the device. .\" .Bd -literal .\" typedef struct mousedata { .\" int len; /* # of data in the buffer */ .\" int buf[16]; /* data buffer */ .\" } mousedata_t; .\" .Ed .\" .Pp .\" Upon returning to the user program, the driver will place the number .\" of valid data bytes in the buffer in the .\" .Dv len .\" field. .\" .Pp .It Dv MOUSE_READSTATE Ar mousedata_t *state .\" The command reads the hardware settings from the device. .\" Upon returning to the user program, the driver will place the number .\" of valid data bytes in the buffer in the .\" .Dv len .\" field. It is usually 3 bytes. .\" The buffer is formatted as follows: .\" .Pp .\" .Bl -tag -width Byte_1 -compact .\" .It Byte 1 .\" .Bl -tag -width bit_6 -compact .\" .It bit 7 .\" Reserved. .\" .It bit 6 .\" 0 - stream mode, 1 - remote mode. .\" In the stream mode, the pointing device sends the device status .\" whenever its state changes. In the remote mode, the host computer .\" must request the status to be sent. .\" The .\" .Nm .\" driver puts the device in the stream mode. .\" .It bit 5 .\" Set if the pointing device is currently enabled. Otherwise zero. .\" .It bit 4 .\" 0 - 1:1 scaling, 1 - 2:1 scaling. .\" 1:1 scaling is the default. .\" .It bit 3 .\" Reserved. .\" .It bit 2 .\" Left button status; set if pressed. .\" .It bit 1 .\" Middle button status; set if pressed. .\" .It bit 0 .\" Right button status; set if pressed. .\" .El .\" .It Byte 2 .\" .Bl -tag -width bit_6_0 -compact .\" .It bit 7 .\" Reserved. .\" .It bit 6..0 .\" Resolution code: zero through three. Actual resolution for .\" the resolution code varies from one device to another. .\" .El .\" .It Byte 3 .\" The status report rate (reports/sec) at which the device will send .\" movement report to the host computer. .\" .El These commands are not currently supported by the .Nm driver. .Pp .It Dv MOUSE_GETSTATUS Ar mousestatus_t *status The command returns the current state of buttons and movement counts as described in .Xr mouse 4 . .El .Sh FILES .Bl -tag -width /dev/npsm0 -compact .It Pa /dev/psm0 `non-blocking' device node .It Pa /dev/bpsm0 `blocking' device node .El .Sh EXAMPLES In order to install the .Nm driver, you need to add .Pp .Dl "device atkbdc" .Dl "device psm" .Pp to your kernel configuration file, and put the following lines to .Pa /boot/device.hints . .Pp .Dl hint.atkbdc.0.at="isa" .Dl hint.atkbdc.0.port="0x060" .Dl hint.psm.0.at="atkbdc" .Dl hint.psm.0.irq="12" .Pp If you add the following statement to .Pa /boot/device.hints , .Pp .Dl hint.psm.0.flags="0x2000" .Pp you will add the optional code to stimulate the pointing device after the `resume' event. .Pp .Dl hint.psm.0.flags="0x24" .Pp The above line will set the device resolution high (4) and the acceleration factor to 2. .Sh DIAGNOSTICS At debug level 0, little information is logged except for the following line during boot process: .Bd -literal -offset indent psm0: device ID X .Ed .Pp where .Fa X the device ID code returned by the found pointing device. See .Dv MOUSE_GETINFO for known IDs. .Pp At debug level 1 more information will be logged while the driver probes the auxiliary port (mouse port). Messages are logged with the LOG_KERN facility at the LOG_DEBUG level (see .Xr syslogd 8 ) . .Bd -literal -offset indent psm0: current command byte:xxxx kbdio: TEST_AUX_PORT status:0000 kbdio: RESET_AUX return code:00fa kbdio: RESET_AUX status:00aa kbdio: RESET_AUX ID:0000 [...] psm: status 00 02 64 psm0 irq 12 on isa psm0: model AAAA, device ID X, N buttons psm0: config:00000www, flags:0000uuuu, packet size:M psm0: syncmask:xx, syncbits:yy .Ed .Pp The first line shows the command byte value of the keyboard controller just before the auxiliary port is probed. It usually is 40, 45, 47 or 65, depending on how the motherboard BIOS initialized the keyboard controller upon power-up. .Pp The second line shows the result of the keyboard controller's test on the auxiliary port interface, with zero indicating no error; note that some controllers report no error even if the port does not exist in the system, however. .Pp The third through fifth lines show the reset status of the pointing device. The functioning device should return the sequence of FA AA . The ID code is described above. .Pp The seventh line shows the current hardware settings. .\" See .\" .Dv MOUSE_READSTATE .\" for definitions. These bytes are formatted as follows: .Pp .Bl -tag -width Byte_1 -compact .It Byte 1 .Bl -tag -width bit_6 -compact .It bit 7 Reserved. .It bit 6 0 - stream mode, 1 - remote mode. In the stream mode, the pointing device sends the device status whenever its state changes. In the remote mode, the host computer must request the status to be sent. The .Nm driver puts the device in the stream mode. .It bit 5 Set if the pointing device is currently enabled. Otherwise zero. .It bit 4 0 - 1:1 scaling, 1 - 2:1 scaling. 1:1 scaling is the default. .It bit 3 Reserved. .It bit 2 Left button status; set if pressed. .It bit 1 Middle button status; set if pressed. .It bit 0 Right button status; set if pressed. .El .It Byte 2 .Bl -tag -width bit_6_0 -compact .It bit 7 Reserved. .It bit 6..0 Resolution code: zero through three. Actual resolution for the resolution code varies from one device to another. .El .It Byte 3 The status report rate (reports/sec) at which the device will send movement report to the host computer. .El .Pp Note that the pointing device will not be enabled until the .Nm driver is opened by the user program. .Pp The rest of the lines show the device ID code, the number of detected buttons and internal variables. .Pp At debug level 2, much more detailed information is logged. .Sh SEE ALSO .Xr ioctl 2 , .Xr syslog 3 , .Xr atkbdc 4 , .Xr mouse 4 , .Xr mse 4 , .Xr sysmouse 4 , .Xr moused 8 , .Xr syslogd 8 .Rs .%T Synaptics TouchPad Interfacing Guide .%U http://www.synaptics.com/ .Re .\".Sh HISTORY .Sh AUTHORS .An -nosplit The .Nm driver is based on the work done by quite a number of people, including .An Eric Forsberg , .An Sandi Donno , .An Rick Macklem , .An Andrew Herbert , .An Charles Hannum , .An Shoji Yuen and .An Kazutaka Yokota to name the few. .Pp This manual page was written by .An Kazutaka Yokota Aq Mt yokota@FreeBSD.org . .Sh CAVEATS Many pad devices behave as if the first (left) button were pressed if the user `taps' the surface of the pad. In contrast, some pad products, e.g.\& some versions of ALPS GlidePoint and Interlink VersaPad, treat the tapping action as fourth button events. .Pp It is reported that ALPS GlidePoint, Synaptics Touchpad, IBM/Lenovo TrackPoint, and Interlink VersaPad require .Em INITAFTERSUSPEND flag in order to recover from suspended state. This flag is automatically set when one of these devices is detected by the .Nm driver. .Pp Some PS/2 mouse models from MouseSystems require to be put in the high resolution mode to work properly. Use the driver flag to set resolution. .Pp There is not a guaranteed way to re-synchronize with the first byte of the packet once we are out of synchronization with the data stream. However, if you are using the \fIXFree86\fP server and experiencing the problem, you may be able to make the X server synchronize with the mouse by switching away to a virtual terminal and getting back to the X server, unless the X server is accessing the mouse via .Xr moused 8 . Clicking any button without moving the mouse may also work. .Sh BUGS The ioctl command .Dv MOUSEIOCREAD has been removed. It was never functional anyway. .Pp Enabling the extended support for Synaptics touchpads has been reported to cause problems with responsivity on some (newer) models of Synaptics hardware, particularly those with guest devices. Index: head/share/man/man4/pts.4 =================================================================== --- head/share/man/man4/pts.4 (revision 301588) +++ head/share/man/man4/pts.4 (revision 301589) @@ -1,158 +1,161 @@ .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)pty.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" .Dd August 20, 2008 .Dt PTS 4 .Os .Sh NAME .Nm pts .Nd pseudo-terminal driver .Sh DESCRIPTION The .Nm driver provides support for a device-pair termed a .Em pseudo-terminal . A pseudo-terminal is a pair of character devices, a .Em master device and a .Em slave device. The slave device provides to a process an interface identical to that described in .Xr tty 4 . However, whereas all other devices which provide the interface described in .Xr tty 4 have a hardware device of some sort behind them, the slave device has, instead, another process manipulating it through the master half of the pseudo-terminal. That is, anything written on the master device is given to the slave device as input and anything written on the slave device is presented as input on the master device. .Pp The following .Xr ioctl 2 calls apply only to pseudo-terminals: .Bl -tag -width TIOCPTMASTER .It Dv TIOCPKT Enable/disable .Em packet mode. Packet mode is enabled by specifying (by reference) a nonzero parameter and disabled by specifying (by reference) a zero parameter. When applied to the master side of a pseudo-terminal, each subsequent .Xr read 2 from the terminal will return data written on the slave part of the pseudo-terminal preceded by a zero byte (symbolically defined as .Dv TIOCPKT_DATA ) , or a single byte reflecting control status information. In the latter case, the byte is an inclusive-or of zero or more of the bits: .Bl -tag -width TIOCPKT_FLUSHWRITE .It Dv TIOCPKT_FLUSHREAD whenever the read queue for the terminal is flushed. .It Dv TIOCPKT_FLUSHWRITE whenever the write queue for the terminal is flushed. .It Dv TIOCPKT_STOP whenever output to the terminal is stopped a la .Ql ^S . .It Dv TIOCPKT_START whenever output to the terminal is restarted. .It Dv TIOCPKT_DOSTOP whenever .Dv VSTOP is .Ql ^S and .Dv VSTART is .Ql ^Q . .It Dv TIOCPKT_NOSTOP whenever the start and stop characters are not .Ql ^S/^Q . .El .Pp While this mode is in use, the presence of control status information to be read from the master side may be detected by a .Xr select 2 for exceptional conditions. .Pp This mode is used by .Xr rlogin 1 and .Xr rlogind 8 to implement a remote-echoed, locally .Ql ^S/^Q flow-controlled remote login with proper back-flushing of output; it can be used by other similar programs. .It Dv TIOCGPTN Obtain device unit number, which can be used to generate the filename of -the pseudo-terminal slave device. This +the pseudo-terminal slave device. +This .Xr ioctl 2 -should not be used directly. Instead, the +should not be used directly. +Instead, the .Xr ptsname 3 function should be used. .It Dv TIOCPTMASTER Determine whether the file descriptor is pointing to a pseudo-terminal master device. This .Xr ioctl 2 -should not be used directly. It is used to implement routines like +should not be used directly. +It is used to implement routines like .Xr grantpt 3 . .El .Sh FILES The files used by this pseudo-terminals implementation are: .Bl -tag -width ".Pa /dev/pts/[num]" .It Pa /dev/pts/[num] Pseudo-terminal slave devices. .El .Sh DIAGNOSTICS None. .Sh SEE ALSO .Xr posix_openpt 2 , .Xr grantpt 3 , .Xr ptsname 3 , .Xr pty 4 , .Xr tty 4 .Sh HISTORY A pseudo-terminal driver appeared in .Bx 4.2 . In .Fx 8.0 , it was replaced with the .Nm driver. Index: head/share/man/man4/sdhci.4 =================================================================== --- head/share/man/man4/sdhci.4 (revision 301588) +++ head/share/man/man4/sdhci.4 (revision 301589) @@ -1,88 +1,88 @@ .\" .\" Copyright (c) 2008 Alexander Motin .\" 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. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission. .\" .\" 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 February 9, 2012 .Dt SDHCI 4 .Os .Sh NAME .Nm sdhci .Nd PCI SD Host Controller bridge driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device mmc" .Cd "device mmcsd" .Cd "device sdhci" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following lines in .Xr loader.conf 5 : .Bd -literal -offset indent mmc_load="YES" mmcsd_load="YES" sdhci_load="YES" .Ed .Sh DESCRIPTION The .Nm driver supports PCI devices with class 8 and subclass 5 according to SD Host Controller Specification. Driver supports up to six high speed 4bit MMC/SD slots per controller. Driver attaches mmc bus to the respective slot on card insertion and detaches it on card removing. .Sh HARDWARE The .Nm -driver supports different specification compatible chips. The following -chips have been verified to work: +driver supports different specification compatible chips. +The following chips have been verified to work: .Pp .Bl -bullet -compact .It ENE CB712 .It ENE CB714 .It RICOH R5C822 .It RICOH R5CE823 .It TI PCIXX21/XX11 .El .Sh SEE ALSO .Xr mmc 4 , .Xr mmcsd 4 .Rs .%T "SD Specifications, Part 2, SD Host Controller, Simplified Specification" .Re .Sh AUTHORS .An Alexander Motin Aq Mt mav@FreeBSD.org .Sh BUGS Many of existing SD controller chips have some nonstandard requirements, proprietary registers and hardware bugs, requiring additional handling. ENE chips are handled to work fine, while some revisions of RICOH and TI controllers still do not see cards without some additional initialization. Index: head/share/man/man4/sfxge.4 =================================================================== --- head/share/man/man4/sfxge.4 (revision 301588) +++ head/share/man/man4/sfxge.4 (revision 301589) @@ -1,179 +1,179 @@ .\" Copyright (c) 2011-2016 Solarflare Communications Inc. .\" 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. .\" .\" The views and conclusions contained in the software and documentation are .\" those of the authors and should not be interpreted as representing official .\" policies, either expressed or implied, of the FreeBSD Project. .\" .\" $FreeBSD$ .\" .Dd February 22, 2015 .Dt SFXGE 4 .Os .Sh NAME .Nm sfxge .Nd "Solarflare 10Gb Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device sfxge" .Ed .Pp To load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent sfxge_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for 10Gb Ethernet adapters based on Solarflare SFC9000 family controllers. The driver supports jumbo frames, transmit/receive checksum offload, TCP Segmentation Offload (TSO), Large Receive Offload (LRO), VLAN checksum offload, VLAN TSO, and Receive Side Scaling (RSS) using MSI-X interrupts. .Pp The driver allocates 1 receive queue, transmit queue, event queue and IRQ per CPU up to a maximum of 64. IRQ affinities should be spread out using .Xr cpuset 1 . Interrupt moderation may be controlled through the sysctl .Va dev.sfxge.%d.int_mod (units are microseconds). .Pp For more information on configuring this device, see .Xr ifconfig 8 . .Pp A large number of MAC, PHY and data path statistics are available under the sysctl .Va dev.sfxge.%d.stats . The adapter's VPD fields including its serial number are available under the sysctl .Va dev.sfxge.%d.vpd . .Sh HARDWARE The .Nm driver supports all 10Gb Ethernet adapters based on Solarflare SFC9000 family controllers. .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 prompt before booting the kernel or stored in .Xr loader.conf 5 . Actual values can be obtained using .Xr sysctl 8 . .Bl -tag -width indent .It Va hw.sfxge.rx_ring The maximum number of descriptors in a receive queue ring. Supported values are: 512, 1024, 2048 and 4096. .It Va hw.sfxge.tx_ring The maximum number of descriptors in a transmit queue ring. Supported values are: 512, 1024, 2048 and 4096. .It Va hw.sfxge.tx_dpl_get_max The maximum length of the deferred packet .Dq get-list for queued transmit packets (TCP and non-TCP), used only if the transmit queue lock can be acquired. If a packet is dropped, the .Va tx_get_overflow counter is incremented and the local sender receives ENOBUFS. The value must be greater than 0. .It Va hw.sfxge.tx_dpl_get_non_tcp_max The maximum number of non-TCP packets in the deferred packet .Dq get-list , used only if the transmit queue lock can be acquired. If a packet is dropped, the .Va tx_get_non_tcp_overflow counter is incremented and the local sender receives ENOBUFS. The value must be greater than 0. .It Va hw.sfxge.tx_dpl_put_max The maximum length of the deferred packet .Dq put-list for queued transmit packets, used if the transmit queue lock cannot be acquired. If a packet is dropped, the .Va tx_put_overflow counter is incremented and the local sender receives ENOBUFS. The value must be greater than or equal to 0. .It Va hw.sfxge.tso_fw_assisted Bitmask to enable/disable usage of FW-assisted TSO version if supported by NIC firmware. FATSOv1 (bit 0) and FATSOv2 (bit 1) are supported. All enabled by default. .It Va hw.sfxge.N.max_rss_channels The maximum number of allocated RSS channels for the Nth adapter. If set to 0 or unset, the number of channels is determined by the number of CPU cores. .It Va hw.sfxge.lro.table_size Size of the LRO hash table. Must be a power of 2. A larger table means we can accelerate a larger number of streams. .It Va hw.sfxge.lro.chain_max The maximum length of a hash chain. If chains get too long then the lookup time increases and may exceed the benefit of LRO. .It Va hw.sfxge.lro.idle_ticks The maximum time (in ticks) that a connection can be idle before it's LRO state is discarded. .It Va hw.sfxge.lro.slow_start_packets Number of packets with payload that must arrive in-order before a connection is eligible for LRO. The idea is we should avoid coalescing segments when the sender is in slow-start because reducing the ACK rate can damage performance. .It Va hw.sfxge.lro.loss_packets Number of packets with payload that must arrive in-order following loss before a connection is eligible for LRO. The idea is we should avoid coalescing segments when the sender is recovering from loss, because reducing the ACK rate can damage performance. .It Va hw.sfxge.mcdi_logging Enable logging of MCDI protocol messages (only available if enabled at compile-time). .It Va hw.sfxge.N.mcdi_logging -Enable or disable logging of MCDI protocol messages on a per-port basis. The default for each -port will be the value of +Enable or disable logging of MCDI protocol messages on a per-port basis. +The default for each port will be the value of .Va hw.sfxge.mcdi_logging. The logging may also be enabled or disabled after the driver is loaded using the sysctl .Va dev.sfxge.%d.mcdi_logging. .El .Sh SUPPORT For general information and support, go to the Solarflare support website at: .Pa https://support.solarflare.com . .Sh SEE ALSO .Xr cpuset 1 , .Xr arp 4 , .Xr netintro 4 , .Xr ng_ether 4 , .Xr vlan 4 , .Xr ifconfig 8 .Sh AUTHORS The .Nm driver was written by .An Philip Paeps and .An Solarflare Communications, Inc. Index: head/share/man/man4/siba.4 =================================================================== --- head/share/man/man4/siba.4 (revision 301588) +++ head/share/man/man4/siba.4 (revision 301589) @@ -1,93 +1,93 @@ .\" Copyright (c) 2010 Weongyo Jeong .\" 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 June 3, 2016 .Dt SIBA 4 .Os .Sh NAME .Nm siba .Nd Sonic Inc. Silicon Backplane driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device bhnd" .Cd "device siba" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent siba_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides .Xr bhnd 4 support for devices based on the Sonic Inc. Silicon Backplane, an interblock communications architecture found in earlier Broadcom Home Networking Division wireless chipsets and embedded systems. .Pp A common interconnect connects all of the Silicon Backplane's functional -blocks. These functional blocks, known as cores, use the Open Core Protocol +blocks. +These functional blocks, known as cores, use the Open Core Protocol (OCP) interface to communicate with agents attached to the Silicon Backplane. .Pp Each core can have an initiator agent that passes read and write requests onto the system backplane and a target agent that returns responses to those requests. Not all cores contain both an initiator and a target agent. Initiator agents are present in cores that contain host interfaces (PCI, PCMCIA), embedded processors (MIPS), or DMA processors associated with communications cores. .Sh SEE ALSO .Xr bcma 4 , .Xr bhnd 4 .Sh HISTORY The .Nm device driver first appeared in .Fx 8.0 . The driver was rewritten for .Fx 11.0 . to support the common Broadcom .Xr bhnd 4 bus interface. .Sh AUTHORS .An -nosplit The .Nm driver was originally written by .An Bruce M. Simpson Aq Mt bms@FreeBSD.org and .An Weongyo Jeong Aq Mt weongyo@FreeBSD.org . - The driver was rewritten for .Fx 11.0 by .An Landon Fuller Aq Mt landonf@FreeBSD.org . Index: head/share/man/man4/siftr.4 =================================================================== --- head/share/man/man4/siftr.4 (revision 301588) +++ head/share/man/man4/siftr.4 (revision 301589) @@ -1,777 +1,780 @@ .\" .\" Copyright (c) 2010 The FreeBSD Foundation .\" All rights reserved. .\" .\" Portions of this software were developed at the Centre for Advanced .\" Internet Architectures, Swinburne University of Technology, Melbourne, .\" Australia by Lawrence Stewart under sponsorship from the FreeBSD .\" Foundation. .\" .\" 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, .\" without modification, immediately at the beginning of the file. .\" 2. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission. .\" .\" 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 March 18, 2015 .Dt SIFTR 4 .Os .Sh NAME .Nm SIFTR .Nd Statistical Information For TCP Research .Sh SYNOPSIS To load the driver as a module at run-time, run the following command as root: .Bd -literal -offset indent kldload siftr .Ed .Pp Alternatively, to load the driver as a module at boot time, add the following line into the .Xr loader.conf 5 file: .Bd -literal -offset indent siftr_load="YES" .Ed .Sh DESCRIPTION The .Nm .Po .Em S Ns tatistical .Em I Ns nformation .Em F Ns or .Em T Ns CP .Em R Ns esearch .Pc kernel module logs a range of statistics on active TCP connections to a log file. It provides the ability to make highly granular measurements of TCP connection state, aimed at system administrators, developers and researchers. .Ss Compile-time Configuration The default operation of .Nm is to capture IPv4 TCP/IP packets. .Nm can be configured to support IPv4 and IPv6 by uncommenting: .Bd -literal -offset indent CFLAGS+=-DSIFTR_IPV6 .Ed .Pp in .Aq sys/modules/siftr/Makefile and recompiling. .Pp In the IPv4-only (default) mode, standard dotted decimal notation (e.g. "136.186.229.95") is used to format IPv4 addresses for logging. In IPv6 mode, standard dotted decimal notation is used to format IPv4 addresses, and standard colon-separated hex notation (see RFC 4291) is used to format IPv6 -addresses for logging. Note that SIFTR uses uncompressed notation to format IPv6 -addresses. +addresses for logging. +Note that SIFTR uses uncompressed notation to format IPv6 addresses. For example, the address "fe80::20f:feff:fea2:531b" would be logged as "fe80:0:0:0:20f:feff:fea2:531b". .Ss Run-time Configuration .Nm utilises the .Xr sysctl 8 interface to export its configuration variables to user-space. The following variables are available: .Bl -tag -offset indent -width Va .It Va net.inet.siftr.enabled controls whether the module performs its measurements or not. By default, the value is set to 0, which means the module will not be taking any measurements. Having the module loaded with .Va net.inet.siftr.enabled set to 0 will have no impact on the performance of the network stack, as the packet filtering hooks are only inserted when .Va net.inet.siftr.enabled is set to 1. .El .Bl -tag -offset indent -width Va .It Va net.inet.siftr.ppl controls how many inbound/outbound packets for a given TCP connection will cause a log message to be generated for the connection. By default, the value is set to 1, which means the module will log a message for every packet of every TCP connection. The value can be set to any integer in the range [1,2^32], and can be changed at any time, even while the module is enabled. .El .Bl -tag -offset indent -width Va .It Va net.inet.siftr.logfile controls the path to the file that the module writes its log messages to. By default, the file /var/log/siftr.log is used. The path can be changed at any time, even while the module is enabled. .El .Bl -tag -offset indent -width Va .It Va net.inet.siftr.genhashes controls whether a hash is generated for each TCP packet seen by .Nm . By default, the value is set to 0, which means no hashes are generated. The hashes are useful to correlate which TCP packet triggered the generation of a particular log message, but calculating them adds additional computational overhead into the fast path. .El .Ss Log Format A typical .Nm log file will contain 3 different types of log message. All messages are written in plain ASCII text. .Pp Note: The .Qq \e present in the example log messages in this section indicates a line continuation and is not part of the actual log message. .Pp The first type of log message is written to the file when the module is -enabled and starts collecting data from the running kernel. The text below -shows an example module enable log. The fields are tab delimited key-value +enabled and starts collecting data from the running kernel. +The text below shows an example module enable log. +The fields are tab delimited key-value pairs which describe some basic information about the system. .Bd -literal -offset indent enable_time_secs=1238556193 enable_time_usecs=462104 \\ siftrver=1.2.2 hz=1000 tcp_rtt_scale=32 \\ sysname=FreeBSD sysver=604000 ipmode=4 .Ed .Pp Field descriptions are as follows: .Bl -tag -offset indent -width Va .It Va enable_time_secs time at which the module was enabled, in seconds since the UNIX epoch. .El .Bl -tag -offset indent -width Va .It Va enable_time_usecs time at which the module was enabled, in microseconds since enable_time_secs. .El .Bl -tag -offset indent -width Va .It Va siftrver version of .Nm . .El .Bl -tag -offset indent -width Va .It Va hz tick rate of the kernel in ticks per second. .El .Bl -tag -offset indent -width Va .It Va tcp_rtt_scale smoothed RTT estimate scaling factor. .El .Bl -tag -offset indent -width Va .It Va sysname operating system name. .El .Bl -tag -offset indent -width Va .It Va sysver operating system version. .El .Bl -tag -offset indent -width Va .It Va ipmode IP mode as defined at compile time. An ipmode of "4" means IPv6 is not supported and IP addresses are logged in regular dotted quad format. An ipmode of "6" means IPv6 is supported, and IP addresses are logged in dotted quad or hex format, as described in the .Qq Compile-time Configuration subsection. .El .Pp The second type of log message is written to the file when a data log message is generated. The text below shows an example data log triggered by an IPv4 TCP/IP packet. The data is CSV formatted. .Bd -literal -offset indent o,0xbec491a5,1238556193.463551,172.16.7.28,22,172.16.2.5,55931, \\ 1073725440,172312,6144,66560,66608,8,1,4,1448,936,1,996,255, \\ 33304,208,66608,0,208,0 .Ed .Pp Field descriptions are as follows: .Bl -tag -offset indent -width Va .It Va 1 Direction of packet that triggered the log message. Either .Qq i for in, or .Qq o for out. .El .Bl -tag -offset indent -width Va .It Va 2 Hash of the packet that triggered the log message. .El .Bl -tag -offset indent -width Va .It Va 3 Time at which the packet that triggered the log message was processed by the .Xr pfil 9 hook function, in seconds and microseconds since the UNIX epoch. .El .Bl -tag -offset indent -width Va .It Va 4 The IPv4 or IPv6 address of the local host, in dotted quad (IPv4 packet) or colon-separated hex (IPv6 packet) notation. .El .Bl -tag -offset indent -width Va .It Va 5 The TCP port that the local host is communicating via. .El .Bl -tag -offset indent -width Va .It Va 6 The IPv4 or IPv6 address of the foreign host, in dotted quad (IPv4 packet) or colon-separated hex (IPv6 packet) notation. .El .Bl -tag -offset indent -width Va .It Va 7 The TCP port that the foreign host is communicating via. .El .Bl -tag -offset indent -width Va .It Va 8 The slow start threshold for the flow, in bytes. .El .Bl -tag -offset indent -width Va .It Va 9 The current congestion window for the flow, in bytes. .El .Bl -tag -offset indent -width Va .It Va 10 The current bandwidth-controlled window for the flow, in bytes. .El .Bl -tag -offset indent -width Va .It Va 11 The current sending window for the flow, in bytes. The post scaled value is reported, except during the initial handshake (first few packets), during which time the unscaled value is reported. .El .Bl -tag -offset indent -width Va .It Va 12 The current receive window for the flow, in bytes. The post scaled value is always reported. .El .Bl -tag -offset indent -width Va .It Va 13 The current window scaling factor for the sending window. .El .Bl -tag -offset indent -width Va .It Va 14 The current window scaling factor for the receiving window. .El .Bl -tag -offset indent -width Va .It Va 15 The current state of the TCP finite state machine, as defined in .Aq Pa netinet/tcp_fsm.h . .El .Bl -tag -offset indent -width Va .It Va 16 The maximum segment size for the flow, in bytes. .El .Bl -tag -offset indent -width Va .It Va 17 The current smoothed RTT estimate for the flow, in units of TCP_RTT_SCALE * HZ, where TCP_RTT_SCALE is a define found in tcp_var.h, and HZ is the kernel's tick timer. -Divide by TCP_RTT_SCALE * HZ to get the RTT in secs. TCP_RTT_SCALE and HZ are -reported in the enable log message. +Divide by TCP_RTT_SCALE * HZ to get the RTT in secs. +TCP_RTT_SCALE and HZ are reported in the enable log message. .El .Bl -tag -offset indent -width Va .It Va 18 SACK enabled indicator. 1 if SACK enabled, 0 otherwise. .El .Bl -tag -offset indent -width Va .It Va 19 The current state of the TCP flags for the flow. See .Aq Pa netinet/tcp_var.h for information about the various flags. .El .Bl -tag -offset indent -width Va .It Va 20 The current retransmission timeout length for the flow, in units of HZ, where HZ is the kernel's tick timer. -Divide by HZ to get the timeout length in seconds. HZ is reported in the -enable log message. +Divide by HZ to get the timeout length in seconds. +HZ is reported in the enable log message. .El .Bl -tag -offset indent -width Va .It Va 21 The current size of the socket send buffer in bytes. .El .Bl -tag -offset indent -width Va .It Va 22 The current number of bytes in the socket send buffer. .El .Bl -tag -offset indent -width Va .It Va 23 The current size of the socket receive buffer in bytes. .El .Bl -tag -offset indent -width Va .It Va 24 The current number of bytes in the socket receive buffer. .El .Bl -tag -offset indent -width Va .It Va 25 The current number of unacknowledged bytes in-flight. Bytes acknowledged via SACK are not excluded from this count. .El .Bl -tag -offset indent -width Va .It Va 26 The current number of segments in the reassembly queue. .El .Bl -tag -offset indent -width Va .It Va 27 Flowid for the connection. A caveat: Zero '0' either represents a valid flowid or a default value when it's -not being set. There is no easy way to differentiate without looking at actual +not being set. +There is no easy way to differentiate without looking at actual network interface card and drivers being used. .El .Bl -tag -offset indent -width Va .It Va 28 Flow type for the connection. Flowtype defines which protocol fields are hashed to produce the flowid. A complete listing is available in .Pa sys/mbuf.h under .Dv M_HASHTYPE_* . .El .Pp The third type of log message is written to the file when the module is disabled and ceases collecting data from the running kernel. The text below shows an example module disable log. The fields are tab delimited key-value pairs which provide statistics about operations since the module was most recently enabled. .Bd -literal -offset indent disable_time_secs=1238556197 disable_time_usecs=933607 \\ num_inbound_tcp_pkts=356 num_outbound_tcp_pkts=627 \\ total_tcp_pkts=983 num_inbound_skipped_pkts_malloc=0 \\ num_outbound_skipped_pkts_malloc=0 num_inbound_skipped_pkts_mtx=0 \\ num_outbound_skipped_pkts_mtx=0 num_inbound_skipped_pkts_tcb=0 \\ num_outbound_skipped_pkts_tcb=0 num_inbound_skipped_pkts_icb=0 \\ num_outbound_skipped_pkts_icb=0 total_skipped_tcp_pkts=0 \\ flow_list=172.16.7.28;22-172.16.2.5;55931, .Ed .Pp Field descriptions are as follows: .Bl -tag -offset indent -width Va .It Va disable_time_secs Time at which the module was disabled, in seconds since the UNIX epoch. .El .Bl -tag -offset indent -width Va .It Va disable_time_usecs Time at which the module was disabled, in microseconds since disable_time_secs. .El .Bl -tag -offset indent -width Va .It Va num_inbound_tcp_pkts Number of TCP packets that traversed up the network stack. This only includes inbound TCP packets during the periods when .Nm was enabled. .El .Bl -tag -offset indent -width Va .It Va num_outbound_tcp_pkts Number of TCP packets that traversed down the network stack. This only includes outbound TCP packets during the periods when .Nm was enabled. .El .Bl -tag -offset indent -width Va .It Va total_tcp_pkts The summation of num_inbound_tcp_pkts and num_outbound_tcp_pkts. .El .Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_malloc Number of inbound packets that were not processed because of failed malloc() calls. .El .Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_malloc Number of outbound packets that were not processed because of failed malloc() calls. .El .Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_mtx Number of inbound packets that were not processed because of failure to add the packet to the packet processing queue. .El .Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_mtx Number of outbound packets that were not processed because of failure to add the packet to the packet processing queue. .El .Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_tcb Number of inbound packets that were not processed because of failure to find the TCP control block associated with the packet. .El .Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_tcb Number of outbound packets that were not processed because of failure to find the TCP control block associated with the packet. .El .Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_icb Number of inbound packets that were not processed because of failure to find the IP control block associated with the packet. .El .Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_icb Number of outbound packets that were not processed because of failure to find the IP control block associated with the packet. .El .Bl -tag -offset indent -width Va .It Va total_skipped_tcp_pkts The summation of all skipped packet counters. .El .Bl -tag -offset indent -width Va .It Va flow_list A CSV list of TCP flows that triggered data log messages to be generated since the module was loaded. Each flow entry in the CSV list is formatted as .Qq local_ip;local_port-foreign_ip;foreign_port . If there are no entries in the list (i.e., no data log messages were generated), the value will be blank. If there is at least one entry in the list, a trailing comma will always be present. .El .Pp The total number of data log messages found in the log file for a module enable/disable cycle should equate to total_tcp_pkts - total_skipped_tcp_pkts. .Sh IMPLEMENTATION NOTES .Nm hooks into the network stack using the .Xr pfil 9 interface. In its current incarnation, it hooks into the AF_INET/AF_INET6 (IPv4/IPv6) .Xr pfil 9 filtering points, which means it sees packets at the IP layer of the network stack. This means that TCP packets inbound to the stack are intercepted before they have been processed by the TCP layer. Packets outbound from the stack are intercepted after they have been processed by the TCP layer. .Pp The diagram below illustrates how .Nm inserts itself into the stack. .Bd -literal -offset indent ---------------------------------- Upper Layers ---------------------------------- ^ | | | | | | v TCP in TCP out ---------------------------------- ^ | |________ _________| | | | v --------- | SIFTR | --------- ^ | ________| |__________ | | | v IPv{4/6} in IPv{4/6} out ---------------------------------- ^ | | | | v Layer 2 in Layer 2 out ---------------------------------- Physical Layer ---------------------------------- .Ed .Pp .Nm uses the .Xr alq 9 interface to manage writing data to disk. .Pp At first glance, you might mistakenly think that .Nm extracts information from individual TCP packets. This is not the case. .Nm uses TCP packet events (inbound and outbound) for each TCP flow originating from the system to trigger a dump of the state of the TCP control block for that flow. With the PPL set to 1, we are in effect sampling each TCP flow's control block state as frequently as flow packets enter/leave the system. For example, setting PPL to 2 halves the sampling rate i.e., every second flow packet (inbound OR outbound) causes a dump of the control block state. .Pp The distinction between interrogating individual packets versus interrogating the control block is important, because .Nm does not remove the need for packet capturing tools like .Xr tcpdump 1 . .Nm allows you to correlate and observe the cause-and-affect relationship between what you see on the wire (captured using a tool like .Xr tcpdump 1 Ns ) and changes in the TCP control block corresponding to the flow of interest. It is therefore useful to use .Nm and a tool like .Xr tcpdump 1 to gather the necessary data to piece together the complete picture. Use of either tool on its own will not be able to provide all of the necessary data. .Pp As a result of needing to interrogate the TCP control block, certain packets during the lifecycle of a connection are unable to trigger a .Nm log message. The initial handshake takes place without the existence of a control block and the final ACK is exchanged when the connection is in the TIMEWAIT state. .Pp .Nm was designed to minimise the delay introduced to packets traversing the network stack. This design called for a highly optimised and minimal hook function that extracted the minimal details necessary whilst holding the packet up, and passing these details to another thread for actual processing and logging. .Pp This multithreaded design does introduce some contention issues when accessing the data structure shared between the threads of operation. When the hook function tries to place details in the structure, it must first acquire an exclusive lock. Likewise, when the processing thread tries to read details from the structure, it must also acquire an exclusive lock to do so. If one thread holds the lock, the other must wait before it can obtain it. This does introduce some additional bounded delay into the kernel's packet processing code path. .Pp In some cases (e.g., low memory, connection termination), TCP packets that enter the .Nm .Xr pfil 9 hook function will not trigger a log message to be generated. .Nm refers to this outcome as a .Qq skipped packet . Note that .Nm always ensures that packets are allowed to continue through the stack, even if they could not successfully trigger a data log message. .Nm will therefore not introduce any packet loss for TCP/IP packets traversing the network stack. .Ss Important Behaviours The behaviour of a log file path change whilst the module is enabled is as follows: .Bl -enum .It Attempt to open the new file path for writing. If this fails, the path change will fail and the existing path will continue to be used. .It Assuming the new path is valid and opened successfully: .Bl -dash .It Flush all pending log messages to the old file path. .It Close the old file path. .It Switch the active log file pointer to point at the new file path. .It Commence logging to the new file. .El .El .Pp During the time between the flush of pending log messages to the old file and commencing logging to the new file, new log messages will still be generated and buffered. As soon as the new file path is ready for writing, the accumulated log messages will be written out to the file. .Sh EXAMPLES To enable the module's operations, run the following command as root: sysctl net.inet.siftr.enabled=1 .Pp To change the granularity of log messages such that 1 log message is generated for every 10 TCP packets per connection, run the following command as root: sysctl net.inet.siftr.ppl=10 .Pp To change the log file location to /tmp/siftr.log, run the following command as root: sysctl net.inet.siftr.logfile=/tmp/siftr.log .Sh SEE ALSO .Xr tcpdump 1 , .Xr tcp 4 , .Xr sysctl 8 , .Xr alq 9 , .Xr pfil 9 .Sh ACKNOWLEDGEMENTS Development of this software was made possible in part by grants from the Cisco University Research Program Fund at Community Foundation Silicon Valley, and the FreeBSD Foundation. .Sh HISTORY .Nm first appeared in .Fx 7.4 and .Fx 8.2 . .Pp .Nm was first released in 2007 by Lawrence Stewart and James Healy whilst working on the NewTCP research project at Swinburne University of Technology's Centre for Advanced Internet Architectures, Melbourne, Australia, which was made possible in part by a grant from the Cisco University Research Program Fund at Community Foundation Silicon Valley. More details are available at: .Pp http://caia.swin.edu.au/urp/newtcp/ .Pp Work on .Nm v1.2.x was sponsored by the FreeBSD Foundation as part of the .Qq Enhancing the FreeBSD TCP Implementation project 2008-2009. More details are available at: .Pp http://www.freebsdfoundation.org/ .Pp http://caia.swin.edu.au/freebsd/etcp09/ .Sh AUTHORS .An -nosplit .Nm was written by .An Lawrence Stewart Aq Mt lstewart@FreeBSD.org and .An James Healy Aq Mt jimmy@deefa.com . .Pp This manual page was written by .An Lawrence Stewart Aq Mt lstewart@FreeBSD.org . .Sh BUGS Current known limitations and any relevant workarounds are outlined below: .Bl -dash .It The internal queue used to pass information between the threads of operation is currently unbounded. This allows .Nm to cope with bursty network traffic, but sustained high packet-per-second traffic can cause exhaustion of kernel memory if the processing thread cannot keep up with the packet rate. .It If using .Nm on a machine that is also running other modules utilising the .Xr pfil 9 framework e.g. .Xr dummynet 4 , .Xr ipfw 8 , .Xr pf 4 Ns , the order in which you load the modules is important. You should kldload the other modules first, as this will ensure TCP packets undergo any necessary manipulations before .Nm .Qq sees and processes them. .It There is a known, harmless lock order reversal warning between the .Xr pfil 9 mutex and tcbinfo TCP lock reported by .Xr witness 4 when .Nm is enabled in a kernel compiled with .Xr witness 4 support. .It There is no way to filter which TCP flows you wish to capture data for. Post processing is required to separate out data belonging to particular flows of interest. .It The module does not detect deletion of the log file path. New log messages will simply be lost if the log file being used by .Nm is deleted whilst the module is set to use the file. Switching to a new log file using the .Em net.inet.siftr.logfile variable will create the new file and allow log messages to begin being written to disk again. The new log file path must differ from the path to the deleted file. .It -The hash table used within the code is sized to hold 65536 flows. This is not a +The hash table used within the code is sized to hold 65536 flows. +This is not a hard limit, because chaining is used to handle collisions within the hash table structure. However, we suspect (based on analogies with other hash table performance data) that the hash table look up performance (and therefore the module's packet processing performance) will degrade in an exponential manner as the number of unique flows handled in a module enable/disable cycle approaches and surpasses 65536. .It There is no garbage collection performed on the flow hash table. The only way currently to flush it is to disable .Nm . .It The PPL variable applies to packets that make it into the processing thread, not total packets received in the hook function. Packets are skipped before the PPL variable is applied, which means there may be a slight discrepancy in the triggering of log messages. For example, if PPL was set to 10, and the 8th packet since the last log message is skipped, the 11th packet will actually trigger the log message to be generated. This is discussed in greater depth in CAIA technical report 070824A. .It At the time of writing, there was no simple way to hook into the TCP layer to intercept packets. .Nm Ap s use of IP layer hook points means all IP traffic will be processed by the .Nm .Xr pfil 9 hook function, which introduces minor, but nonetheless unnecessary packet delay and processing overhead on the system for non-TCP packets as well. Hooking in at the IP layer is also not ideal from the data gathering point of view. Packets traversing up the stack will be intercepted and cause a log message generation BEFORE they have been processed by the TCP layer, which means we cannot observe the cause-and-affect relationship between inbound events and the corresponding TCP control block as precisely as could be. Ideally, .Nm should intercept packets after they have been processed by the TCP layer i.e. intercept packets coming up the stack after they have been processed by tcp_input(), and intercept packets coming down the stack after they have been processed by tcp_output(). The current code still gives satisfactory granularity though, as inbound events tend to trigger outbound events, allowing the cause-and-effect to be observed indirectly by capturing the state on outbound events as well. .It The .Qq inflight bytes value logged by .Nm does not take into account bytes that have been .No SACK Ap ed by the receiving host. .It Packet hash generation does not currently work for IPv6 based TCP packets. .It Compressed notation is not used for IPv6 address representation. This consumes more bytes than is necessary in log output. .El Index: head/share/man/man4/simplebus.4 =================================================================== --- head/share/man/man4/simplebus.4 (revision 301588) +++ head/share/man/man4/simplebus.4 (revision 301589) @@ -1,82 +1,84 @@ .\" .\" Copyright (c) 2010 The FreeBSD Foundation .\" All rights reserved. .\" .\" This software was developed by Semihalf under sponsorship from .\" the FreeBSD Foundation. .\" .\" 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 July 12, 2010 .Dt SIMPLEBUS 4 .Os .Sh NAME .Nm simplebus .Nd ePAPR simple-bus driver .Sh SYNOPSIS .Cd "options FDT" .Sh DESCRIPTION This bus driver is dedicated for the .Pa simple-bus node of a flattened device tree compliant with the .Pa ePAPR specification. .Pp The .Nm entity does not represent any physical element by itself, it is rather an umbrella node grouping integrated on-chip peripherals like interrupt controller, connectivity controllers, accelerating engines and so on. .Pp The driver is generic and common for all flattened device tree nodes claiming .Pa simple-bus -compatibility. It iterates over direct descendants of the +compatibility. +It iterates over direct descendants of the .Pa simple-bus node, instantiates newbus children and assigns resources to them, based on the configuration data retrieved from the nodes properties in .Xr fdt 4 . .Pp Note the .Nm does not manage device resources and passes through any requests to the .Xr fdtbus 4 layer. .Sh SEE ALSO .Xr fdt 4 , .Xr fdtbus 4 , .Xr openfirm 4 .Sh STANDARDS Power.org Standard for Embedded Power Architecture Platform Requirements .Pq Vt ePAPR . .Sh HISTORY The .Nm support first appeared in .Fx 9.0 . .Sh AUTHORS The .Nm support was developed by Semihalf under sponsorship from the FreeBSD -Foundation. This manual page was written by +Foundation. +This manual page was written by .An Rafal Jaworowski . Index: head/share/man/man4/snd_hda.4 =================================================================== --- head/share/man/man4/snd_hda.4 (revision 301588) +++ head/share/man/man4/snd_hda.4 (revision 301589) @@ -1,635 +1,636 @@ .\" Copyright (c) 2006-2008 Joel Dahl .\" Copyright (c) 2008 Alexander Motin .\" 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 25, 2012 .Dt SND_HDA 4 .Os .Sh NAME .Nm snd_hda .Nd "Intel High Definition Audio bridge device driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device sound" .Cd "device snd_hda" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent snd_hda_load="YES" .Ed .Sh DESCRIPTION The High Definition (HD) Audio specification was developed by Intel as the logical successor of the old AC'97 specification and has several advantages, such as higher bandwidth which allows more channels and more detailed formats, support for several logical audio devices, and general purpose DMA channels. .Pp The .Nm driver includes HDA bus controller driver (hdac), HDA codec driver (hdacc) and HDA codecs audio functions bridge driver (hdaa) that allows the generic audio driver, .Xr sound 4 , to be used with this hardware. Only audio functions are supported by .Nm . Modem and other possible functions are not implemented. .Pp The .Nm driver supports hardware that conforms with revision 1.0 of the Intel High Definition Audio specification and tries to behave much like the Microsoft Universal Audio Architecture (UAA) draft (revision 0.7b) for handling audio devices. .Pp According to HDA and UAA specifications, depending on the number of HDA buses and codecs present in system, their audio capabilities and BIOS provided configuration, the .Nm driver often provides several PCM audio devices. For example, one device for main rear 7.1 output and inputs, one device for independent headset connectors at front and one device for SPDIF or HDMI audio input/output. The assignment of audio inputs and outputs may be tuned with .Xr device.hints 5 or .Xr sysctl 8 . The driver's verbose boot messages provide a lot of information about the operation of the driver and present audio setup. .Pp The default audio device may be tuned by setting the .Ar hw.snd.default_unit sysctl, as described in .Xr sound 4 , or explicitly specified in application settings. .Ss Boot-time Configuration The following variables are available at boot-time through the .Xr device.hints 5 file: .Bl -tag -width ".Va hint.hdac.%d.config"-offset indent .It Va hint.hdac.%d.config Configures a range of possible controller options. Possible values are: .Dq Li 64bit , .Dq Li dmapos , .Dq Li msi . An option prefixed with .Dq Li no , such as .Dq Li nomsi , will do the opposite and takes precedence. Options can be separated by whitespace and commas. .It Va hint.hdac.%d.msi Controls MSI (Message Signaled Interrupts) support. .It Va hint.hdac.%d.cad%d.nid%d.config Same as .Va hint.hdaa.%d.nid%d.config .It Va hint.hdaa.%d.config Configures a range of possible audio function options. Possible values are: .Dq Li eapdinv , .Dq Li ivref , .Dq Li ivref50 , .Dq Li ivref80 , .Dq Li ivref100 , .Dq Li fixedrate , .Dq Li forcestereo , .Dq Li ovref , .Dq Li ovref50 , .Dq Li ovref80 , .Dq Li ovref100 , .Dq Li senseinv , .Dq Li softpcmvol , and .Dq Li vref . An option prefixed with .Dq Li no , such as .Dq Li nofixedrate , will do the opposite and takes precedence. Options can be separated by whitespace and commas. .Pp The .Dq Li eapdinv option inverts External Amplifier Power Down signal. The .Dq Li fixedrate denies all sampling rates except 48KHz. The .Dq Li forcestereo denies mono playback/recording. The .Dq Li senseinv option inverts jack sensing logic. The .Dq Li ivref Ns Ar X and .Dq Li ovref Ns Ar X options control the voltage used to power external microphones. .It Va hint.hdaa.%d.gpio_config Overrides audio function GPIO pins configuration set by BIOS. May be specified as a set of space-separated .Dq Ar num Ns = Ns Ar value pairs, where .Ar num is GPIO line number, and .Ar value is one of: .Dq Li keep , .Dq Li set , .Dq Li clear , .Dq Li disable and .Dq Li input . .Pp .Dq Li GPIO Ns s are a codec's General Purpose I/O pins which system integrators sometimes use to control external muters, amplifiers and so on. If you have no sound, or sound volume is not adequate, you may have to experiment a bit with the GPIO setup to find the optimal setup for your system. .It Va hint.hdaa.%d.nid%d.config Overrides audio function pin configuration set by BIOS. May be specified as a 32-bit hexadecimal value with a leading .Dq 0x , or as a set of space-separated .Dq Ar option Ns = Ns Ar value pairs. .It Va hint.pcm.%d.rec.autosrc Controls automatic recording source feature: .Bl -tag -width 2n -compact .It 0 disabled, .It 1 once on attach, .It 2 enabled. .El When enabled, driver will automatically set recording source of the mixer to connected input using jack presence detection statuses. .El .Pp Pin configuration is the UAA driver's main source of information about codec usage. This information is usually provided by the codec manufacturer and tuned by system integrators for specific system requirements. The .Nm driver allows users to override it to fix integrator mistakes or to use the available codec in alternative ways (for example to get stereo output and 2 inputs instead of a single 5.1 output). .Pp The following options are supported: .Bl -tag -width ".Va device=" -offset indent .It Va as Association number. Associations are used to group individual pins to form a complex multi-pin device. For example, to group 4 connectors for 7.1 input/output, or to treat several input connectors as sources for the same input device. Association numbers can be specified as numeric values from 0 to 15. A value of 0 means disabled pin. A value of 15 is a set of independent unassociated pins. Each association includes only pins of the same direction (in/out) and is detected atomically (all pins or none). A separate PCM audio device is created for every pair of input and output associations. .It Va seq Sequence number. A unique, per-association number used to order pins inside the particular association. Sequence numbers can be specified as numeric values from 0 to 15. .Pp The sequence number 15 has a special meaning for output associations. Output pins with this number and device type .Dq Ar Headphones will duplicate (with automatic mute if jack detection is supported) the first pin in that association. .Pp The sequence numbers 14 and 15 has a special meaning for input associations. Their presence in association defines it as multiplexed or mixed respectively. If none of them are present and there are more than one pin in association, the association will provide multichannel input. .Pp For multichannel input/output associations sequence numbers encode channel pairs positions: 0 - Front, 1 - Center/LFE, 2 - Back, 3 - Front Wide Center, 4 - Side. Standard combinations are: (0) - Stereo; (0, 2), (0, 4) - Quadro; (0, 1, 2), (0, 1, 4) - 5.1; (0, 1, 2, 4) - 7.1. .It Va device Device type. Can be specified as a number from 0 to 15 or as a name: .Dq Li Line-out , .Dq Li Speaker , .Dq Li Headphones, .Dq Li CD , .Dq Li SPDIF-out , .Dq Li Digital-out , .Dq Li Modem-line , .Dq Li Modem-handset , .Dq Li Line-in , .Dq Li AUX , .Dq Li Mic , .Dq Li Telephony , .Dq Li SPDIF-in , .Dq Li Digital-in , .Dq Li Res.E , or .Dq Li Other . The device type also describes the pin direction (in/out). For example, .Dq Li CD always means an input pin, while .Dq Li Headphones always means an output. .It Va conn Connection type. Can be specified as a number from 0 to 3. The connection type can also be specified as one of the special names .Dq Li Jack , .Dq Li None , .Dq Li Fixed , or .Dq Li Both . Pins with a connection type of .Dq Li None are disabled. .It Va ctype Connector physical type. Can be specified as a number from 0 to 15. This is a reference only value. It is ignored by the .Nm driver. .It Va color Connector color. Can be specified as a number from 0 to 15 or as one of the names .Dq Li Unknown , .Dq Li Black , .Dq Li Grey , .Dq Li Blue , .Dq Li Green , .Dq Li Red , .Dq Li Orange , .Dq Li Yellow , .Dq Li Purple , .Dq Li Pink , .Dq Li Res.A , .Dq Li Res.B , .Dq Li Res.C , .Dq Li Res.D , .Dq Li White , or .Dq Li Other . This is a reference only value. It is ignored by the .Nm driver. .It Va loc Connector physical location. Can be specified as a number from 0 to 63. This is a reference only value. It is ignored by the .Nm driver. .It Va misc Misc bits. Can be specified as a number from 0 to 15. -Bit 0 has a special meaning. When set it means that jack detection is -not implemented in hardware. +Bit 0 has a special meaning. +When set it means that jack detection is not implemented in hardware. .El .Ss Runtime Configuration The following .Xr sysctl 8 variables are available in addition to those available to all .Xr sound 4 devices: .Bl -tag -width ".Va dev.hdaa.%d.nid%d_original" -offset indent .It Va dev.hdac.%d.pindump Setting this to a non-zero value dumps the current pin configuration, main capabilities and jack sense status of all audio functions on the controller to console and syslog. .It Va dev.hdac.%d.polling Enables polling mode. In this mode the driver operates by querying the device state on timer ticks using .Xr callout 9 instead of interrupts. Polling is disabled by default. Do not enable it unless you are facing weird interrupt problems or if the device cannot generate interrupts at all. .It Va dev.hdaa.%d.config Run-time equivalent of the .Va hint.hdaa.%d.config tunable. .It Va dev.hdaa.%d.gpi_state Current state of GPI lines. .It Va dev.hdaa.%d.gpio_state Current state of GPIO lines. .It Va dev.hdaa.%d.gpio_config Run-time equivalent of the .Va hint.hdaa.%d.gpio.config tunable. .It Va dev.hdaa.%d.gpo_state Current state of GPO lines. .It Va dev.hdaa.%d.nid%d_config Run-time equivalent of the .Va hint.hdaa.%d.nid%d.config tunable. .It Va dev.hdaa.%d.nid%d_original Original pin configuration written by BIOS. .It Va dev.hdaa.%d.reconfig Setting this to a non-zero value makes driver to destroy existing pcm devices and process new pins configuration set via .Va dev.hdaa.%d.nid%d_config . .It Va dev.pcm.%d.play.32bit , dev.pcm.%d.rec.32bit HDA controller uses 32bit representation for all samples of more then 16 bits. These variables allow to specify how many bits of these 32 should be used by CODEC. Depending on codec capabilities, possible values are 20, 24 and 32 bit. The default value is 24. .It Va dev.pcm.%d.rec.autosrc Run-time equivalent of the .Va hint.pcm.%d.rec.autosrc tunable. .El .Sh EXAMPLES Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example. This system has two audio connectors on a front side, three audio connectors on a rear side and one internal speaker. According to verbose driver output and the codec datasheet, this codec has five stereo DACs and two stereo ADCs, all of them are routable to any codec pin (external connector). All codec pins are reversible (could be configured either as input or output). .Pp So high codec uniformity and flexibility allow driver to configure it in many different ways, depending on requested pins usage described by pins configuration. The driver reports such default pin configuration when verbose messages enabled: .Bd -literal hdaa0: nid 0x as seq device conn jack loc color misc hdaa0: 20 01014020 2 0 Line-out Jack 1/8 Rear Green 0 hdaa0: 21 99130110 1 0 Speaker Fixed ATAPI Onboard Unknown 1 hdaa0: 22 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA hdaa0: 23 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA hdaa0: 24 01a19830 3 0 Mic Jack 1/8 Rear Pink 8 hdaa0: 25 02a1983f 3 15 Mic Jack 1/8 Front Pink 8 hdaa0: 26 01813031 3 1 Line-in Jack 1/8 Rear Blue 0 hdaa0: 27 0221401f 1 15 Headphones Jack 1/8 Front Green 0 hdaa0: 28 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA hdaa0: 30 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA hdaa0: 31 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA .Ed .Pp Here we can see, that the nodes with ID (nid) 25 and 27 are front panel connectors (Jack, Front), nids 20, 24 and 26 are rear panel connectors (Jack, Rear) and nid 21 is a built-in speaker (Fixed, Onboard). Pins with nids 22, 23, 28, 30 and 31 will be disabled by driver due to "None" -connectivity. So the pin count and description matches to connectors that -we have. +connectivity. +So the pin count and description matches to connectors that we have. .Pp Using association (as) and sequence (seq) fields values pins are grouped into 3 associations: .Bd -literal hdaa0: Association 0 (1) out: hdaa0: Pin nid=21 seq=0 hdaa0: Pin nid=27 seq=15 hdaa0: Association 1 (2) out: hdaa0: Pin nid=20 seq=0 hdaa0: Association 2 (3) in: hdaa0: Pin nid=24 seq=0 hdaa0: Pin nid=26 seq=1 hdaa0: Pin nid=25 seq=15 .Ed .Pp Each .Xr pcm 4 device uses two associations: one for playback and one for recording. Associations processed and assigned to .Xr pcm 4 devices in increasing numerical order. In this case association #0 (1) will become .Li pcm0 device playback, using the internal speakers and .Ar Headphones jack with speaker automute on the headphones jack connection. Association #1 (2) will become .Li pcm1 playback, using the .Ar Line-out jack. Association #2 (3) will become .Li pcm0 recording, using the external microphones and the .Ar Line-in jack. .Pp The .Nm driver provides extensive verbose messages to diagnose its operation logic and describe its current codec configuration. .Pp Using .Xr device.hints 5 it is possible to modify the configuration of the existing pins, allowing a broad range of different audio setups. Here are a few examples of some setups possible for this particular hardware: .Ss Example 1 Setting the .Xr device.hints 5 options .Bd -literal hint.hdac.0.cad0.nid20.config="as=1" hint.hdac.0.cad0.nid21.config="as=2" .Ed .Pp will swap line-out and speaker functions. So the .Li pcm0 -device will play to the line-out and headphones jacks. Line-out will -be muted on the headphones jack connection. +device will play to the line-out and headphones jacks. +Line-out will be muted on the headphones jack connection. Recording on .Li pcm0 will go from two external microphones and line-in jacks. .Li pcm1 playback will go to the internal speaker. .Ss Example 2 Setting the .Xr device.hints 5 options .Bd -literal hint.hdac.0.cad0.nid20.config="as=1 seq=15 device=Headphones" hint.hdac.0.cad0.nid27.config="as=2 seq=0" hint.hdac.0.cad0.nid25.config="as=4 seq=0" .Ed .Pp will split the headphones and one of the microphones to a separate device. The .Li pcm0 device will play to the internal speaker and to the line-out jack, with speaker automute on the line-out jack connection. Recording on .Li pcm0 will use input from one external microphone and the line-in jacks. The .Li pcm1 device will be completely dedicated to a headset (headphones and mic) connected to the front connectors. .Ss Example 3 Setting the .Xr device.hints 5 options .Bd -literal hint.hdac.0.cad0.nid20.config="as=1 seq=0" hint.hdac.0.cad0.nid26.config="as=2 seq=0" hint.hdac.0.cad0.nid27.config="as=3 seq=0" hint.hdac.0.cad0.nid25.config="as=4 seq=0" hint.hdac.0.cad0.nid24.config="as=5 seq=0 device=Line-out" hint.hdac.0.cad0.nid21.config="as=6 seq=0" .Ed .Pp will give 4 independent devices: .Li pcm0 .Pq line-out and line-in , .Li pcm1 .Pq headphones and mic , .Li pcm2 .Pq additional line-out via retasked rear mic jack , and .Li pcm3 .Pq internal speaker . .Ss Example 4 Setting the .Xr device.hints 5 options .Bd -literal hint.hdac.0.cad0.nid20.config="as=1 seq=0" hint.hdac.0.cad0.nid24.config="as=1 seq=1 device=Line-out" hint.hdac.0.cad0.nid26.config="as=1 seq=2 device=Line-out" hint.hdac.0.cad0.nid21.config="as=2 seq=0" .Ed .Pp will give 2 devices: .Li pcm0 for 5.1 playback via 3 rear connectors (line-out and retasked mic and line-in) and headset (headphones and mic) at front connectors. .Li pcm1 for internal speaker playback. On headphones connection rear connectors will be muted. .Sh MIXER CONTROLS Depending on codec configuration, these controls and signal sources could be reported to .Xr sound 4 : .Bl -tag -width ".Va speaker" -offset indent .It Va vol overall output level (volume) .It Va rec overall recording level .It Va igain input-to-output monitoring loopback level .It Va ogain external amplifier control .It Va pcm PCM playback .It Va mix input mix .It Va mic first external or second internal microphone input .It Va monitor first internal or second external microphone input .It Va line , Va line1 , Va line2, Va line3 analog (line) inputs .It Va dig1 , Va dig2 , Va dig3 digital (S/PDIF, HDMI or DisplayPort) inputs .It Va cd CD input .It Va speaker PC speaker input .It Va phin , Va phout , Va radio . Va video other random inputs .El .Pp -Controls have different precision. Some could be just an on/off triggers. +Controls have different precision. +Some could be just an on/off triggers. Most of controls use logarithmic scale. .Sh HARDWARE The .Nm driver supports controllers having PCI class 4 (multimedia) and subclass 3 (HDA), compatible with Intel HDA specification. .Pp The .Nm driver supports more than two hundred different controllers and CODECs. There is no sense to list all of them here, as in most cases specific CODEC configuration and wiring are more important then type of the CODEC itself. .Sh SEE ALSO .Xr snd_ich 4 , .Xr sound 4 , .Xr device.hints 5 , .Xr loader.conf 5 , .Xr sysctl 8 .Sh HISTORY The .Nm device driver first appeared in .Fx 6.3 . .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Stephane E. Potvin Aq Mt sepotvin@videotron.ca , .An Ariff Abdullah Aq Mt ariff@FreeBSD.org and .An Alexander Motin Aq Mt mav@FreeBSD.org . This manual page was written by .An Joel Dahl Aq Mt joel@FreeBSD.org , .An Alexander Motin Aq Mt mav@FreeBSD.org and .An Giorgos Keramidas Aq Mt keramida@FreeBSD.org . .Sh BUGS Some Hardware/OEM vendors tend to screw up BIOS settings or use custom unusual CODEC wiring that create problems to the driver. This may result in missing pcm devices, or a state where the .Nm driver seems to attach and work, but no sound is played. Some cases can be solved by tuning .Pa loader.conf variables. But before trying to fix problem that way, make sure that there really is a problem and that the PCM audio device in use really corresponds to the expected audio connector. .Pp Some vendors use non-standardized General Purpose I/O (GPIO) pins of the codec to control external amplifiers. In some cases setting a combination of GPIO bits may be needed to make sound work on a specific device. .Pp HDMI and DisplayPort audio may also require support from video driver. Index: head/share/man/man4/stf.4 =================================================================== --- head/share/man/man4/stf.4 (revision 301588) +++ head/share/man/man4/stf.4 (revision 301589) @@ -1,283 +1,284 @@ .\" $KAME: stf.4,v 1.35 2001/05/02 06:24:49 itojun Exp $ .\" .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. .\" 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. .\" 3. Neither the name of the project nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT 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 December 28, 2012 .Dt STF 4 .Os .Sh NAME .Nm stf .Nd .Tn 6to4 tunnel interface .Sh SYNOPSIS .Cd "device stf" .Sh DESCRIPTION The .Nm interface supports .Dq 6to4 IPv6 in IPv4 encapsulation. It can tunnel IPv6 traffic over IPv4, as specified in .Li RFC3056 . .Pp For ordinary nodes in 6to4 site, you do not need .Nm interface. The .Nm interface is necessary for site border router (called .Dq 6to4 router in the specification). .Pp Each .Nm interface is created at runtime using interface cloning. This is most easily done with the .Xr ifconfig 8 .Cm create command or using the .Va cloned_interfaces variable in .Xr rc.conf 5 . .Pp Due to the way 6to4 protocol is specified, .Nm interface requires certain configuration to work properly. Single (no more than 1) valid 6to4 address needs to be configured to the interface. .Dq A valid 6to4 address is an address which has the following properties. If any of the following properties are not satisfied, .Nm raises runtime error on packet transmission. Read the specification for more details. .Bl -bullet .It matches .Li 2002:xxyy:zzuu::/48 where .Li xxyy:zzuu is a hexadecimal notation of an IPv4 address for the node. IPv4 address can be taken from any of interfaces your node has. Since the specification forbids the use of IPv4 private address, the address needs to be a global IPv4 address. .It Subnet identifier portion (48th to 63rd bit) and interface identifier portion (lower 64 bits) are properly filled to avoid address collisions. .El .Pp If you would like the node to behave as a relay router, the prefix length for the IPv6 interface address needs to be 16 so that the node would consider any 6to4 destination as .Dq on-link . If you would like to restrict 6to4 peers to be inside certain IPv4 prefix, you may want to configure IPv6 prefix length as .Dq 16 + IPv4 prefix length . .Nm interface will check the IPv4 source address on packets, if the IPv6 prefix length is larger than 16. .Pp .Nm can be configured to be ECN friendly. This can be configured by .Dv IFF_LINK1 . See .Xr gif 4 for details. .Pp Please note that 6to4 specification is written as .Dq accept tunnelled packet from everyone tunnelling device. By enabling .Nm device, you are making it much easier for malicious parties to inject fabricated IPv6 packet to your node. Also, malicious party can inject an IPv6 packet with fabricated source address to make your node generate improper tunnelled packet. Administrators must take caution when enabling the interface. To prevent possible attacks, .Nm interface filters out the following packets. Note that the checks are no way complete: .Bl -bullet .It Packets with IPv4 unspecified address as outer IPv4 source/destination .Pq Li 0.0.0.0/8 .It Packets with loopback address as outer IPv4 source/destination .Pq Li 127.0.0.0/8 .It Packets with IPv4 multicast address as outer IPv4 source/destination .Pq Li 224.0.0.0/4 .It Packets with limited broadcast address as outer IPv4 source/destination .Pq Li 255.0.0.0/8 .It Packets with private address as outer IPv4 source/destination .Pq Li 10.0.0.0/8 , 172.16.0.0/12 , 192.168.0.0/16 .It Packets with subnet broadcast address as outer IPv4 source/destination. The check is made against subnet broadcast addresses for all of the directly connected subnets. .It Packets that does not pass ingress filtering. Outer IPv4 source address must meet the IPv4 topology on the routing table. Ingress filter can be turned off by .Dv IFF_LINK2 bit. .It The same set of rules are applied against the IPv4 address embedded into inner IPv6 address, if the IPv6 address matches 6to4 prefix. .El .Pp It is recommended to filter/audit incoming IPv4 packet with IP protocol number 41, as necessary. It is also recommended to filter/audit encapsulated IPv6 packets as well. You may also want to run normal ingress filter against inner IPv6 address to avoid spoofing. .Pp By setting the .Dv IFF_LINK0 flag on the .Nm interface, it is possible to disable the input path, making the direct attacks from the outside impossible. Note, however, there are other security risks exist. If you wish to use the configuration, you must not advertise your 6to4 address to others. .\" .Sh SYSCTL VARIABLES The following .Xr sysctl 8 variables can be used to control the behavior of the .Nm stf . The default value is shown next to each variable. .Bl -tag -width indent .It Va net.link.stf.permit_rfc1918 : No 0 The RFC3056 requires the use of globally unique 32-bit IPv4 -addresses. This sysctl variable controls the behaviour of this -requirement. When it set to not 0, +addresses. +This sysctl variable controls the behaviour of this requirement. +When it set to not 0, .Nm stf allows the use of private IPv4 addresses described in the RFC1918. This may be useful for an Intranet environment or when some mechanisms of network address translation (NAT) are used. .El .Sh EXAMPLES Note that .Li 8504:0506 is equal to .Li 133.4.5.6 , written in hexadecimals. .Bd -literal # ifconfig ne0 inet 133.4.5.6 netmask 0xffffff00 # ifconfig stf0 inet6 2002:8504:0506:0000:a00:5aff:fe38:6f86 \\ prefixlen 16 alias .Ed .Pp The following configuration accepts packets from IPv4 source .Li 9.1.0.0/16 only. It emits 6to4 packet only for IPv6 destination 2002:0901::/32 (IPv4 destination will match .Li 9.1.0.0/16 ) . .Bd -literal # ifconfig ne0 inet 9.1.2.3 netmask 0xffff0000 # ifconfig stf0 inet6 2002:0901:0203:0000:a00:5aff:fe38:6f86 \\ prefixlen 32 alias .Ed .Pp The following configuration uses the .Nm interface as an output-only device. You need to have alternative IPv6 connectivity (other than 6to4) to use this configuration. For outbound traffic, you can reach other 6to4 networks efficiently via .Nm stf . For inbound traffic, you will not receive any 6to4-tunneled packets (less security drawbacks). Be careful not to advertise your 6to4 prefix to others .Pq Li 2002:8504:0506::/48 , and not to use your 6to4 prefix as a source. .Bd -literal # ifconfig ne0 inet 133.4.5.6 netmask 0xffffff00 # ifconfig stf0 inet6 2002:8504:0506:0000:a00:5aff:fe38:6f86 \\ prefixlen 16 alias deprecated link0 # route add -inet6 2002:: -prefixlen 16 ::1 # route change -inet6 2002:: -prefixlen 16 ::1 -ifp stf0 .Ed .\" .Sh SEE ALSO .Xr gif 4 , .Xr inet 4 , .Xr inet6 4 .Pp .Pa http://www.ipv6day.org/action.php?n=En.IPv6day .Rs .%A Brian Carpenter .%A Keith Moore .%T "Connection of IPv6 Domains via IPv4 Clouds" .%D February 2001 .%R RFC .%N 3056 .Re .Rs .%A Jun-ichiro itojun Hagino .%T "Possible abuse against IPv6 transition technologies" .%D July 2000 .%N draft-itojun-ipv6-transition-abuse-01.txt .%O work in progress .Re .\" .Sh HISTORY The .Nm device first appeared in WIDE/KAME IPv6 stack. .\" .Sh BUGS No more than one .Nm interface is allowed for a node, and no more than one IPv6 interface address is allowed for an .Nm interface. It is to avoid source address selection conflicts between IPv6 layer and IPv4 layer, and to cope with ingress filtering rule on the other side. This is a feature to make .Nm work right for all occasions. Index: head/share/man/man4/u3g.4 =================================================================== --- head/share/man/man4/u3g.4 (revision 301588) +++ head/share/man/man4/u3g.4 (revision 301589) @@ -1,128 +1,129 @@ .\" .\" Copyright (c) 2008 AnyWi Technologies .\" All rights reserved. .\" .\" This code is derived from uark.c .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" $FreeBSD$ .\" .Dd November 26, 2013 .Dt U3G 4 .Os .Sh NAME .Nm u3g .Nd USB support for 3G datacards .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device usb" .Cd "device ucom" .Cd "device u3g" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent u3g_load="YES" .Ed .Pp If neither of the above is done, the driver will automatically be loaded by devd(8) when the device is connected. .Sh DESCRIPTION The .Nm driver provides support for the multiple USB-to-serial interfaces exposed by many 3G USB/PCCard modems. .Pp The device is accessed through the .Xr ucom 4 driver which makes it behave like a .Xr tty 4 . .Sh HARDWARE The .Nm driver supports the following adapters: .Pp .Bl -bullet -compact .It Option GT 3G Fusion, GT Fusion Quad, etc. (only 3G part, not WLAN) .It Option GT 3G, GT 3G Quad, etc. .It Vodafone Mobile Connect Card 3G .It Vodafone Mobile Broadband K3772-Z .It Qualcomm Inc. CDMA MSM .It Huawei B190, E180v, E220 ('') .It Novatel U740, MC950D, X950D, etc. .It Sierra MC875U, MC8775U, etc. .El .Pp (See .Pa /sys/dev/usb/serial/u3g.c for the complete list of supported cards for each vendor mentioned above.) .Pp The supported 3G cards provide the necessary modem port for ppp, or mpd connections as well as extra ports (depending on the specific device) to provide other functions (additional command port, diagnostic port, SIM toolkit port). .Pp In some of these devices a mass storage device supported by the .Xr umass 4 driver is present which contains Windows and Mac OS X drivers. The device starts up in disk mode (TruInstall, ZeroCD, etc.) and requires -additional commands to switch it to modem mode. If your device is not -switching automatically, please try to add quirks. See +additional commands to switch it to modem mode. +If your device is not switching automatically, please try to add quirks. +See .Xr usbconfig 8 and .Xr usb_quirk 4 . .Sh SEE ALSO .Xr tty 4 , .Xr ucom 4 , .Xr usb 4 , .Xr usb_quirk 4 , .Xr devd 8 , .Xr usbconfig 8 .Sh HISTORY The .Nm driver appeared in .Fx 7.2 , is based on the .Xr uark 4 driver, and written by .An Andrea Guzzo Aq Mt aguzzo@anywi.com in September 2008. .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Andrea Guzzo Aq Mt aguzzo@anywi.com and .An Nick Hibma Aq Mt n_hibma@FreeBSD.org . Hardware for testing was provided by AnyWi Technologies, Leiden, NL. .Sh BUGS The automatic mode switch from disk mode to modem mode does not work unless the driver is either built into the kernel or loaded before the device is connected. Index: head/share/man/man4/virtio_scsi.4 =================================================================== --- head/share/man/man4/virtio_scsi.4 (revision 301588) +++ head/share/man/man4/virtio_scsi.4 (revision 301589) @@ -1,92 +1,93 @@ .\" Copyright (c) 2012 Bryan Venteicher .\" 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 June 24, 2012 .Dt VIRTIO_SCSI 4 .Os .Sh NAME .Nm virtio_scsi .Nd VirtIO SCSI driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device virtio_scsi" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent virtio_scsi_load="YES" .Ed .Sh DESCRIPTION The .Nm device driver provides support for VirtIO SCSI devices. .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width "xxxxxx" .It Va hw.vtscsi.bus_reset_disable In the initial QEMU release with VirtIO SCSI support, in-flight operations were not aborted when stopping the device, rendering -bus reset ineffective. This tunable disables attempts to issue -reset bus commands. The default value is 1. +bus reset ineffective. +This tunable disables attempts to issue reset bus commands. +The default value is 1. .El .Sh DEBUGGING To enable debugging prints from the .Nm driver, set the .Bd -literal -offset indent hw.vtscsi.X.debug_level .Ed .Pp variable, where X is the adapter number, either in .Xr loader.conf 5 or via .Xr sysctl 8 . The following bits have the described effects: .Bl -tag -width 6n -offset indent .It 0x01 Enable informational prints. .It 0x02 Enable prints for driver errors. .It 0x04 Enable tracing prints. .El .Sh SEE ALSO .Xr virtio 4 .Sh HISTORY The .Nm driver was written by .An Bryan Venteicher Aq Mt bryanv@FreeBSD.org . It first appeared in .Fx 10.0 . Index: head/share/man/man4/witness.4 =================================================================== --- head/share/man/man4/witness.4 (revision 301588) +++ head/share/man/man4/witness.4 (revision 301589) @@ -1,187 +1,188 @@ .\" Copyright (c) 2001 John H. Baldwin .\" 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 November 18, 2015 .Dt WITNESS 4 .Os .Sh NAME .Nm witness .Nd lock validation facility .Sh SYNOPSIS .Cd options WITNESS .Cd options WITNESS_COUNT .Cd options WITNESS_KDB .Cd options WITNESS_NO_VNODE .Cd options WITNESS_SKIPSPIN .Sh DESCRIPTION The .Nm module keeps track of the locks acquired and released by each thread. It also keeps track of the order in which locks are acquired with respect to each other. Each time a lock is acquired, .Nm uses these two lists to verify that a lock is not being acquired in the wrong order. If a lock order violation is detected, then a message is output to the kernel console or log detailing the locks involved and the locations in question. Witness can also be configured to drop into the kernel debugger when an order violation occurs. .Pp The .Nm code also checks various other conditions such as verifying that one does not recurse on a non-recursive lock, or attempt an upgrade on a shared lock held by another thread. If any of these checks fail, then the kernel will panic. .Pp The .Dv WITNESS_COUNT kernel option controls the maximum number of .Xr witness 4 entries that are tracked in the kernel. The maximum number of entries can be queried via the .Va debug.witness.count sysctl. It can also be set from the .Xr loader 8 via the .Va debug.witness.count environment variable. .Pp The .Dv WITNESS_NO_VNODE kernel option tells .Xr witness 4 to ignore locking issues between .Xr vnode 9 objects. .Pp The flag that controls whether or not the kernel debugger is entered when a lock order violation is detected can be set in a variety of ways. By default, the flag is off, but if the .Dv WITNESS_KDB kernel option is specified, then the flag will default to on. It can also be set from the .Xr loader 8 via the .Va debug.witness.kdb environment variable or after the kernel has booted via the .Va debug.witness.kdb sysctl. If the flag is set to zero, then the debugger will not be entered. If the flag is non-zero, then the debugger will be entered. .Pp The .Nm code can also be configured to skip all checks on spin mutexes. By default, this flag defaults to off, but it can be turned on by specifying the .Dv WITNESS_SKIPSPIN kernel option. The flag can also be set via the .Xr loader 8 environment variable .Va debug.witness.skipspin . If the variable is set to a non-zero value, then spin mutexes are skipped. Once the kernel has booted, the status of this flag can be examined but not set via the read-only sysctl .Va debug.witness.skipspin . .Pp The sysctl .Va debug.witness.watch specifies the level of witness involvement in the system. A value of 1 specifies that witness is enabled. A value of 0 specifies that witness is disabled, but that can be enabled -again. This will maintain a small amount of overhead in the system. +again. +This will maintain a small amount of overhead in the system. A value of -1 specifies that witness is disabled permanently and cannot be enabled again. The sysctl .Va debug.witness.watch can be set via .Xr loader 8 . .Pp The sysctl .Va debug.witness.output_channel specifies the output channel used to display warnings emitted by .Nm . The possible values are .Ql console , indicating that warnings are to be printed to the system console, .Ql log , indicating that warnings are to be logged via .Xr log 9 , and .Ql none . This sysctl can be set via .Xr loader 8 . .Pp The .Nm code also provides three extra .Xr ddb 4 commands if both .Nm and .Xr ddb 4 are compiled into the kernel: .Bl -ohang .It Ic show locks Op thread Outputs the list of locks held by a thread to the kernel console along with the filename and line number at which each lock was last acquired by the thread. The optional .Ar thread argument may be either a TID, PID, or pointer to a thread structure. If .Ar thread is not specified, then the locks held by the current thread are displayed. .It Ic show all locks Outputs the list of locks held by all threads in the system to the kernel console. .It Ic show witness Dump the current order list to the kernel console. The code first displays the lock order tree for all of the sleep locks. Then it displays the lock order tree for all of the spin locks. Finally, it displays a list of locks that have not yet been acquired. .El .Sh SEE ALSO .Xr ddb 4 , .Xr loader 8 , .Xr sysctl 8 , .Xr mutex 9 .Sh HISTORY The .Nm code first appeared in .Bsx 5.0 and was imported from there into .Fx 5.0 .