CVS commit: [netbsd-9] src/share/man/man4

2021-03-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Mar 22 17:15:17 UTC 2021

Modified Files:
src/share/man/man4 [netbsd-9]: pci.4

Log Message:
Pull up following revision(s) (requested by nia in ticket #1232),
all via patch and adpated to netbsd-9:

share/man/man4/pci.4: revision 1.111
share/man/man4/pci.4: revision 1.112
share/man/man4/pci.4: revision 1.113
share/man/man4/pci.4: revision 1.114
share/man/man4/pci.4: revision 1.115
share/man/man4/pci.4: revision 1.116

add ena(4)
Put cross-references in a useful place, copying usb(4)
Caught a few drivers in the list that no longer exist this way.
Be less redundant in the DESCRIPTION
cross-reference pci(9)
add rtsx(4)
s/Disk and tape/Storage/g, more relevant cross-references


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.100.2.1 src/share/man/man4/pci.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/pci.4
diff -u src/share/man/man4/pci.4:1.100 src/share/man/man4/pci.4:1.100.2.1
--- src/share/man/man4/pci.4:1.100	Wed Dec 12 08:12:18 2018
+++ src/share/man/man4/pci.4	Mon Mar 22 17:15:16 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pci.4,v 1.100 2018/12/12 08:12:18 wiz Exp $
+.\"	$NetBSD: pci.4,v 1.100.2.1 2021/03/22 17:15:16 martin Exp $
 .\"
 .\" Copyright (c) 1997 Jason R. Thorpe.  All rights reserved.
 .\" Copyright (c) 1997 Jonathan Stone
@@ -29,7 +29,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 12, 2018
+.Dd March 12, 2021
 .Dt PCI 4
 .Os
 .Sh NAME
@@ -46,29 +46,12 @@
 .Cd options PCI_BUS_FIXUP
 .Cd options PCI_INTR_FIXUP
 .Sh DESCRIPTION
-Other
-.Nm
-attachments are machine-dependent and depend on the bus topology and
-.Tn PCI
-bus interface of your system.
-See
-.Xr intro 4
-for your system for details.
-.Pp
 .Nx
-includes a machine-independent
-.Tn PCI
-bus subsystem and
-several machine-independent
-.Tn PCI
-device drivers.
-.Pp
-Your system may support additional
-.Tn PCI
-devices.
-Drivers for
-.Tn PCI
-devices not listed here are machine-dependent.
+includes a machine-independent PCI bus subsystem and several
+machine-independent PCI device drivers.
+.Pp
+Your system may support additional PCI devices and attachments.
+Drivers for PCI devices not listed here are machine-dependent.
 Consult your system's
 .Xr intro 4
 for additional information.
@@ -133,284 +116,231 @@ option leaves the interrupt as is.
 .El
 .Sh HARDWARE
 .Nx
-includes machine-independent
-.Tn PCI
-drivers, sorted by device type and driver name:
+includes machine-independent PCI drivers, sorted by device type and driver name:
 .Ss SCSI interfaces
-.Bl -tag -width pcdisplay -offset indent
-.It ahc
-Adaptec 29xx, 39xx, and other AIC-7xxx-based
-.Tn SCSI
-interfaces.
-.It adv
-Advansys
-.Tn SCSI
-interfaces.
-.It adw
-Advansys Ultra Wide
-.Tn SCSI
-interfaces.
-.It bha
-Buslogic BT-9xx
-.Tn SCSI
-interfaces.
-.It dpt
-DPT SmartCache/SmartRAID III and IV
-.Tn SCSI
-interfaces.
-.It iha
-Initio INIC-940/950
-.Tn SCSI
-interfaces.
-.It isp
-QLogic ISP-1020, ISP-1040, and ISP-2100
-.Tn SCSI
-and
-.Tn FibreChannel
-interfaces.
-.It mfi
+.Bl -tag -width pcdisplay(4) -offset indent
+.It Xr ahc 4
+Adaptec 29xx, 39xx, and other AIC-7xxx-based SCSI
+interfaces.
+.It Xr adv 4
+Advansys SCSI interfaces.
+.It Xr adw 4
+Advansys Ultra Wide SCSI interfaces.
+.It Xr bha 4
+Buslogic BT-9xx SCSI interfaces.
+.It Xr dpt 4
+DPT SmartCache/SmartRAID III and IV SCSI interfaces.
+.It Xr iha 4
+Initio INIC-940/950 SCSI interfaces.
+.It Xr isp 4
+QLogic ISP-1020, ISP-1040, and ISP-2100 SCSI and FibreChannel interfaces.
+.It Xr mfi 4
 LSI Logic & Dell MegaRAID SAS RAID controllers.
-.It mly
+.It Xr mly 4
 Mylex AcceleRAID and eXtremeRAID controllers with v6 firmware.
-.It nca
-Domex 536
-.Tn SCSI
-interfaces.
-.It pcscp
-Advanced Micro Devices Am53c974 PCscsi-PCI
-.Tn SCSI
-interfaces.
-.It siop
-Symbios Logic/NCR 53c8xx-family
-.Tn SCSI
-interfaces.
-.It trm
-Tekram TRM-S1040 ASIC based
-.Tn SCSI
-interfaces.
+.It Xr nca 4
+Domex 536 SCSI interfaces.
+.It Xr pcscp 4
+Advanced Micro Devices Am53c974 PCscsi-PCI SCSI interfaces.
+.It Xr siop 4
+Symbios Logic/NCR 53c8xx-family SCSI interfaces.
+.It Xr trm 4
+Tekram TRM-S1040 ASIC based SCSI interfaces.
 .El
-.Ss Disk and tape controllers
-.Bl -tag -width pcdisplay -offset indent
-.It aac
+.Ss Storage controllers
+.Bl -tag -width pcdisplay(4) -offset indent
+.It Xr aac 4
 The Adaptec AAC family of RAID controllers.
-.It ahcisata
+.It Xr ahcisata 4
 AHCI 1.0 and 1.1 compliant SATA controllers.
-.It amr
+.It Xr amr 4
 The AMI and LSI Logic MegaRAID family of RAID controllers.
-.It cac
+.It Xr cac 4
 Compaq array controllers.
-.It icp
+.It Xr icp 4
 ICP Vortex GDT and Intel Storage RAID controllers.
-.It mlx
+.It Xr mlx 4
 Mylex DAC960 and DEC SWXCR RAID 

CVS commit: [netbsd-9] src/share/man/man4

2021-03-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar  5 13:55:27 UTC 2021

Modified Files:
src/share/man/man4 [netbsd-9]: iic.4

Log Message:
Pull up following revision(s) (requested by nia in ticket #1224):

share/man/man4/iic.4: revision 1.23
share/man/man4/iic.4: revision 1.24
share/man/man4/iic.4: revision 1.25

iic.4: add ssdfb

Describe the i2c ioctl interface

iic.4: Add FILES section. Fix copypasto.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.6.1 src/share/man/man4/iic.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/iic.4
diff -u src/share/man/man4/iic.4:1.22 src/share/man/man4/iic.4:1.22.6.1
--- src/share/man/man4/iic.4:1.22	Mon Feb 26 08:23:44 2018
+++ src/share/man/man4/iic.4	Fri Mar  5 13:55:27 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: iic.4,v 1.22 2018/02/26 08:23:44 wiz Exp $
+.\"	$NetBSD: iic.4,v 1.22.6.1 2021/03/05 13:55:27 martin Exp $
 .\"	$OpenBSD: iic.4,v 1.74 2008/09/10 16:13:43 reyk Exp $
 .\"
 .\" Copyright (c) 2004, 2006 Alexander Yurchenko 
@@ -16,7 +16,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd February 26, 2018
+.Dd February 27, 2021
 .Dt IIC 4
 .Os
 .Sh NAME
@@ -100,6 +100,37 @@ The master accesses a particular slave d
 .Pp
 System Management Bus (SMBus) protocol is also supported by emulating
 it with the I2C commands.
+.Sh IOCTLS
+The following
+.Xr ioctl 2
+calls apply to
+.Em IIC
+devices.
+They are defined in the header file
+.In dev/i2c/i2c_io.h :
+.Bl -tag -width indent
+.It Dv I2C_IOCTL_EXEC (i2c_ioctl_exec_t)
+User ioctl to execute an i2c operation.
+.Bd -literal
+typedef enum {
+I2C_OP_READ,
+I2C_OP_READ_WITH_STOP,
+I2C_OP_WRITE,
+I2C_OP_WRITE_WITH_STOP,
+I2C_OP_READ_BLOCK,
+I2C_OP_WRITE_BLOCK
+} i2c_op_t;
+
+typedef struct i2c_ioctl_exec {
+	i2c_op_t iie_op;	/* operation to perform */
+	i2c_addr_t iie_addr;	/* address of device */
+	const void *iie_cmd;	/* pointer to command */
+	size_t iie_cmdlen;	/* length of command */
+	void *iie_buf;		/* pointer to data buffer */
+	size_t iie_buflen;	/* length of data buffer */
+} i2c_ioctl_exec_t;
+.Ed
+.El
 .Sh SUPPORTED MASTERS
 A wide list of I2C masters are supported, among them are:
 .Pp
@@ -196,6 +227,15 @@ JEDEC JC-42.4 compatible memory module t
 driver for SGS 7433 Basic Audio Processor found in some Apple machines
 .It Xr spdmem 4
 Generic Memory Module Serial Presence Detect
+.It Xr ssdfb 4
+OLED/PLED framebuffer modules
+.El
+.Sh FILES
+.Bl -tag -width "/dev/iicu" -compact
+.It /dev/iic Ns Ar u
+I2C device unit
+.Ar u
+file.
 .El
 .Sh SEE ALSO
 .Xr dtviic 4 ,



CVS commit: [netbsd-9] src/share/man/man4

2021-03-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar  5 13:52:58 UTC 2021

Modified Files:
src/share/man/man4 [netbsd-9]: spi.4

Log Message:
Pull up following revision(s) (requested by nia in ticket #1223):

share/man/man4/spi.4: revision 1.10
share/man/man4/spi.4: revision 1.8
share/man/man4/spi.4: revision 1.9

Document the userspace /dev/spi interface to the best of my ability.

Add ssdfb(4).

Based mostly on a mailing list post by mlelstv;
https://mail-index.netbsd.org/port-arm/2019/02/07/msg005454.html

spi.4: Add a FILES section

spi.4: mention history of ioctl interface


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.2.1 src/share/man/man4/spi.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/spi.4
diff -u src/share/man/man4/spi.4:1.7 src/share/man/man4/spi.4:1.7.2.1
--- src/share/man/man4/spi.4:1.7	Sat Feb 23 17:34:04 2019
+++ src/share/man/man4/spi.4	Fri Mar  5 13:52:58 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: spi.4,v 1.7 2019/02/23 17:34:04 wiz Exp $
+.\"	$NetBSD: spi.4,v 1.7.2.1 2021/03/05 13:52:58 martin Exp $
 .\"
 .\" Copyright (c) 2006 Urbana-Champaign Independent Media Center.
 .\" Copyright (c) 2006 Garrett D'Amore.
@@ -39,7 +39,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 9, 2006
+.Dd February 27, 2021
 .Dt SPI 4
 .Os
 .Sh NAME
@@ -89,11 +89,47 @@ file, the
 must be provided, as
 .Tn SPI
 lacks any way to automatically probe devices.
+.Sh IOCTLS
+The following
+.Xr ioctl 2
+calls apply to
+.Em SPI
+devices.
+They are defined in the header file
+.In dev/spi/spi_io.h :
+.Bl -tag -width indent
+.It Dv SPI_IOCTL_CONFIGURE (spi_ioctl_configure_t)
+Used to choose the operational mode and clock.
+The
+.Li sic_mode
+defines polarity and phase of the clock.
+.Li sic_speed
+is the clock speed in Hz, a value of 0 means to keep the default speed
+of the device.
+.Bd -literal
+typedef struct spi_ioctl_configure {
+	int sic_addr;
+	int sic_mode;
+	int sic_speed;
+} spi_ioctl_configure_t;
+.Ed
+.It Dv SPI_IOCTL_TRANSFER (spi_ioctl_transfer_t)
+Used to handle an I/O transaction.
+.Bd -literal
+typedef struct spi_ioctl_transfer {
+	int sit_addr;
+	const void *sit_send;
+	size_t sit_sendlen;
+	void *sit_recv;
+	size_t sit_recvlen;
+} spi_ioctl_transfer_t;
+.Ed
+.El
 .Sh HARDWARE
 .Nx
 includes the following machine-independent
 .Tn SPI
-drivers
+drivers:
 .Bl -tag -width pcdisplay -offset indent
 .It m25p
 STMicroelectronics M25P family of NOR flash devices.
@@ -105,12 +141,22 @@ Microchip MCP3x0x SAR analog to digital 
 Microchip MCP4801/MCP4811/MCP4821 digital to analog converter.
 .It tm121temp
 Texas Instruments TMP121 temperature sensor.
+.It ssdfb
+OLED/PLED framebuffer modules.
+.El
+.Sh FILES
+.Bl -tag -width "/dev/spiu" -compact
+.It /dev/spi Ns Ar u
+SPI device unit
+.Ar u
+file.
 .El
 .Sh SEE ALSO
 .Xr m25p 4 ,
 .Xr mcp23s17gpio 4 ,
 .Xr mcp3kadc 4 ,
 .Xr mcp48x1dac 4 ,
+.Xr ssdfb 4 ,
 .Xr tm121temp 4 ,
 .Xr spi 9
 .Sh HISTORY
@@ -122,3 +168,7 @@ for the
 Champaign-Urbana Community Wireless Network Project (CUWiN), and
 appeared in
 .Nx 4.0 .
+The
+.Xr ioctl 2
+interface allowing configuration from userspace appeared in
+.Nx 9.0 .



CVS commit: [netbsd-9] src/share/man/man4

2021-03-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar  2 15:57:06 UTC 2021

Modified Files:
src/share/man/man4 [netbsd-9]: pad.4

Log Message:
Pull up following revision(s) (requested by nia in ticket #1220):

share/man/man4/pad.4: revision 1.7
share/man/man4/pad.4: revision 1.8
share/man/man4/pad.4: revision 1.9
share/man/man4/pad.4: revision 1.10

Use /dev/audioX rather than /dev/soundX in examples.

Avoids accidentally running into confusing behavior.
Add another example of recording the output of an application.

Explain something that confused me.

Slightly adjust wording.

It does seem to work with multiple applications concurrently writing to
the device in a quick test I did.

Explain the format of the raw PCM data users can read from a pad(4).

Since it's headerless this is important so the data can be interpreted
properly. Also, ordinary audio ioctls cannot be used on a pad and the
format can't be changed, so applications that attempt to automatically
determine the format of a device like audiorecord don't work.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.8.1 src/share/man/man4/pad.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/pad.4
diff -u src/share/man/man4/pad.4:1.6 src/share/man/man4/pad.4:1.6.8.1
--- src/share/man/man4/pad.4:1.6	Mon Jul  3 21:30:58 2017
+++ src/share/man/man4/pad.4	Tue Mar  2 15:57:06 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: pad.4,v 1.6 2017/07/03 21:30:58 wiz Exp $
+.\" $NetBSD: pad.4,v 1.6.8.1 2021/03/02 15:57:06 martin Exp $
 .\"
 .\" Copyright (c) 2007 Jared D. McNeill 
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 11, 2007
+.Dd February 6, 2021
 .Dt PAD 4
 .Os
 .Sh NAME
@@ -36,19 +36,27 @@
 .Sh DESCRIPTION
 .Nm
 is a pseudo-device driver which provides support for feeding back PCM data
-from a consumer of the
+from consumers of an
 .Xr audio 4
-API to userland.
+device to userland.
+.Pp
+The raw PCM data readable from
+.Pa /dev/padN
+is encoded in stereo little-endian 16-bit linear PCM at 44100 Hz.
 .Sh FILES
 The
 .Nm
 pseudo-device driver receives data from
-.Pa /dev/soundN
+.Pa /dev/audioN
 and feeds the raw PCM output to
 .Pa /dev/padN .
+.Pa /dev/audioN
+is created once
+.Pa /dev/padN
+is opened.
 .Bl -item
 .It
-.Pa /dev/soundN
+.Pa /dev/audioN
 .It
 .Pa /dev/padN
 .El
@@ -56,7 +64,13 @@ and feeds the raw PCM output to
 The following example streams an MP3 to an Apple AirTunes compatible device:
 .Bd -literal -offset indent
 $ rtunes - < /dev/pad0 &
-$ mpg123 -a /dev/sound1 mozart.mp3
+$ mpg123 -a /dev/audio1 mozart.mp3
+.Ed
+.Pp
+Record the output of an application (in this case, audioplay):
+.Bd -literal -offset indent
+$ ffmpeg -f s16le -ar 44100 -ac 2 -i /dev/pad0 output.wav
+$ audioplay -d /dev/audio1 input.wav
 .Ed
 .Sh SEE ALSO
 .Xr audio 4



CVS commit: [netbsd-9] src/share/man/man4

2020-12-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec 19 13:52:36 UTC 2020

Modified Files:
src/share/man/man4 [netbsd-9]: audio.4

Log Message:
Pull up following revision(s) (requested by isaki in ticket #1157):

share/man/man4/audio.4: revision 1.104

Remove an old description.
This behavior was modified in sys/dev/audio/audio.c rev 1.65 (Mar. 2020).


To generate a diff of this commit:
cvs rdiff -u -r1.90.2.1 -r1.90.2.2 src/share/man/man4/audio.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/audio.4
diff -u src/share/man/man4/audio.4:1.90.2.1 src/share/man/man4/audio.4:1.90.2.2
--- src/share/man/man4/audio.4:1.90.2.1	Thu Apr 30 15:40:50 2020
+++ src/share/man/man4/audio.4	Sat Dec 19 13:52:36 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: audio.4,v 1.90.2.1 2020/04/30 15:40:50 martin Exp $
+.\"	$NetBSD: audio.4,v 1.90.2.2 2020/12/19 13:52:36 martin Exp $
 .\"
 .\" Copyright (c) 1996 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -85,8 +85,6 @@ are identical.
 .Pp
 On a full-duplex device, reads and writes may operate concurrently
 without interference.
-If a full-duplex capable audio device is opened for both reading and writing
-it will start in play mode but not start in record mode.
 .Pp
 On a half-duplex device, if there are any recording descriptors already,
 opening with write mode will fail.



CVS commit: [netbsd-9] src/share/man/man4

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 15:48:26 UTC 2020

Modified Files:
src/share/man/man4 [netbsd-9]: wskbd.4

Log Message:
Pull up following revision(s) (requested by nia in ticket #1012):

share/man/man4/wskbd.4: revision 1.20
share/man/man4/wskbd.4: revision 1.21

Whitespace/macro usage fixes.
obviously wrong country code


To generate a diff of this commit:
cvs rdiff -u -r1.16.34.1 -r1.16.34.2 src/share/man/man4/wskbd.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/wskbd.4
diff -u src/share/man/man4/wskbd.4:1.16.34.1 src/share/man/man4/wskbd.4:1.16.34.2
--- src/share/man/man4/wskbd.4:1.16.34.1	Mon Jul 13 14:22:47 2020
+++ src/share/man/man4/wskbd.4	Wed Jul 15 15:48:25 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: wskbd.4,v 1.16.34.1 2020/07/13 14:22:47 martin Exp $
+.\" $NetBSD: wskbd.4,v 1.16.34.2 2020/07/15 15:48:25 martin Exp $
 .\"
 .\" Copyright (c) 1999
 .\" 	Matthias Drochner.  All rights reserved.
@@ -118,8 +118,9 @@ wskbd device instance.
 The following encodings are supported.
 Device drivers for legacy keyboard interfaces may only support a subset
 of these.
-However, generally, all encodings are supported by 
-.Xr pckbd 4 and
+However, generally, all encodings are supported by
+.Xr pckbd 4
+and
 .Xr ukbd 4 .
 .Bl -column " us.colemak" " KB_US|KB_COLEMAK" "language"
 .It Sy "wsconsctl" Ta Sy "define" Ta Sy "language"
@@ -134,7 +135,7 @@ However, generally, all encodings are su
 .It Li dk Ta KB_DK Ta Danish with
 .Dq dead accents
 .It Li nl Ta KB_NL Ta Dutch
-.It Li ee Ta KB_DK Ta Estonian with
+.It Li ee Ta KB_EE Ta Estonian with
 .Dq dead accents
 .It Li fi Ta KB_FI Ta Finnish
 .It Li fr Ta KB_FR Ta French



CVS commit: [netbsd-9] src/share/man/man4

2019-12-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Dec  8 13:16:53 UTC 2019

Modified Files:
src/share/man/man4 [netbsd-9]: rnd.4

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #504):

share/man/man4/rnd.4: revision 1.26
share/man/man4/rnd.4: revision 1.27
share/man/man4/rnd.4: revision 1.28
share/man/man4/rnd.4: revision 1.25

Update man page to reflect switch from CTR_DRBG to Hash_DRBG.

Replace slightly wrong rant by shorter and slightly less long rant.
(If X and Y in Z/2Z are independent, then so are X and X+Y.  What was
I thinking.)

Update NIST SP800-90A reference.

New sentence, new line. Use \(em.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.14.1 src/share/man/man4/rnd.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/rnd.4
diff -u src/share/man/man4/rnd.4:1.24 src/share/man/man4/rnd.4:1.24.14.1
--- src/share/man/man4/rnd.4:1.24	Wed Jan 18 22:38:00 2017
+++ src/share/man/man4/rnd.4	Sun Dec  8 13:16:53 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rnd.4,v 1.24 2017/01/18 22:38:00 abhinav Exp $
+.\"	$NetBSD: rnd.4,v 1.24.14.1 2019/12/08 13:16:53 martin Exp $
 .\"
 .\" Copyright (c) 2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 16, 2014
+.Dd September 3, 2019
 .Dt RND 4
 .Os
 .Sh NAME
@@ -187,8 +187,8 @@ quantum computers.
 Systems with nonvolatile storage should store a secret from
 .Pa /dev/urandom
 on disk during installation or shutdown, and feed it back during boot,
-so that the work the operating system has done to gather entropy --
-including the work its operator may have done to flip a coin! -- can be
+so that the work the operating system has done to gather entropy \(em
+including the work its operator may have done to flip a coin! \(em can be
 saved from one boot to the next, and so that newly installed systems
 are not vulnerable to generating cryptographic keys predictably.
 .Pp
@@ -205,7 +205,7 @@ in
 which is enabled by default; see
 .Xr rc.conf 5 .
 .Sh LIMITATIONS
-Some people worry about recovery from state compromise -- that is,
+Some people worry about recovery from state compromise \(em that is,
 ensuring that even if an attacker sees the entire state of the
 operating system, then the attacker will be unable to predict any new
 future outputs as long as the operating system gathers fresh entropy
@@ -404,9 +404,9 @@ When a user process opens
 or
 .Pa /dev/urandom
 and first reads from it, the kernel draws from the entropy pool to seed
-a cryptographic pseudorandom number generator, the NIST CTR_DRBG
-(counter-mode deterministic random bit generator) with AES-128 as the
-block cipher, and uses that to generate data.
+a cryptographic pseudorandom number generator, the NIST Hash_DRBG
+(hash-based deterministic random bit generator) with SHA-256 as the
+hash function, and uses that to generate data.
 .Pp
 To draw a seed from the entropy pool, the kernel
 .Bl -bullet -offset abcd -compact
@@ -489,10 +489,10 @@ Never blocks.
 .%A Elaine Barker
 .%A John Kelsey
 .%T Recommendation for Random Number Generation Using Deterministic Random Bit Generators
-.%D January 2012
+.%D June 2015
 .%I National Institute of Standards and Technology
-.%O NIST Special Publication 800-90A
-.%U http://csrc.nist.gov/publications/nistpubs/800-90A/SP800-90A.pdf
+.%O NIST Special Publication 800-90A, Revision 1
+.%U https://csrc.nist.gov/publications/detail/sp/800-90a/rev-1/final
 .Re
 .Rs
 .%A Daniel J. Bernstein
@@ -551,59 +551,33 @@ Unfortunately, no amount of software eng
 .Sh ENTROPY ACCOUNTING
 The entropy accounting described here is not grounded in any
 cryptography theory.
-It is done because it was always done, and because it gives people a
-warm fuzzy feeling about information theory.
+.Sq Entropy estimation
+doesn't mean much: the kernel hypothesizes an extremely simple-minded
+parametric model for all entropy sources which bears little relation to
+any physical processes, implicitly fits parameters from data, and
+accounts for the entropy of the fitted model.
 .Pp
-The folklore is that every
-.Fa n Ns -bit
-output of
-.Fa /dev/random
-is not merely indistinguishable from uniform random to a
-computationally bounded attacker, but information-theoretically is
-independent and has
-.Fa n
-bits of entropy even to a computationally
-.Em unbounded
-attacker -- that is, an attacker who can recover AES keys, compute
-SHA-1 preimages, etc.
-This property is not provided, nor was it ever provided in any
-implementation of
-.Fa /dev/random
-known to the author.
-.Pp
-This property would require that, after each read, the system discard
-all measurements from hardware in the entropy pool and begin anew.
-All work done to make the system unpredictable