1.\" $NetBSD: bio.4,v 1.18 2019/05/09 07:12:38 cnst Exp $ 2.\" $OpenBSD: bio.4,v 1.19 2006/09/20 22:22:37 jmc Exp $ 3.\" 4.\" Copyright (c) 2002 Niklas Hallqvist 5.\" Copyright (c) 2006 Marco Peereboom 6.\" All rights reserved. 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following conditions 10.\" are met: 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" notice, this list of conditions and the following disclaimer in the 15.\" documentation and/or other materials provided with the distribution. 16.\" 3. The name of the author may not be used to endorse or promote products 17.\" derived from this software without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 23.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 27.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 28.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29.\" POSSIBILITY OF SUCH DAMAGE. 30.\" 31.Dd May 9, 2019 32.Dt BIO 4 33.Os 34.Sh NAME 35.Nm bio 36.Nd Block IO ioctl tunnel pseudo-device 37.Sh SYNOPSIS 38.Cd "pseudo-device bio" 39.Pp 40.In dev/biovar.h 41.Sh DESCRIPTION 42The 43.Nm 44driver provides userland applications 45.Xr ioctl 2 46access to devices otherwise not found as 47.Pa /dev 48nodes. 49The 50.Pa /dev/bio 51device node operates by delegating ioctl 52calls to a requested device driver. 53Only drivers which have registered with the 54.Nm 55device can be accessed via this interface. 56.Pp 57The following device drivers register with 58.Nm 59for volume management: 60.Pp 61.Bl -tag -width ataraid(4)XX -offset indent -compact 62.\" .It Xr ami 4 63.\" American Megatrends Inc. MegaRAID PATA/SATA/SCSI RAID controller 64.It Xr arcmsr 4 65Areca Technology Corporation SATA RAID controller 66.It Xr ataraid 4 67Software BIOS RAID 68.It Xr cac 4 69Compaq RAID array controller 70.It Xr ciss 4 71Compaq Smart ARRAY 5/6 SAS/SATA/SCSI RAID controller 72.It Xr mfi 4 73LSI Logic & Dell MegaRAID SAS RAID controller 74.It Xr mfii 4 75LSI Logic MegaRAID SAS Fusion RAID controller 76.It Xr mpii 4 77LSI Logic Fusion-MPT Message Passing Interface II 78.It Xr mpt 4 79LSI Fusion-MPT RAID controller 80.El 81.Pp 82The following ioctl calls apply to the 83.Nm bio 84device: 85.Bl -tag -width BIOCCAPABILITIES 86.It Dv BIOCLOCATE 87Locate a named device and give back a cookie to the application 88for subsequent ioctl calls. 89The cookie is used to tunnel further ioctls to the right device. 90.It Dv BIOCINQ 91Retrieve number of volumes and physical disks for a specific device. 92.It Dv BIOCDISK 93Retrieve detailed information for the specified physical disk. 94Information returned can include status, size, channel, target, lun, 95vendor name, serial number, and processor device (ses). 96.\" or safte 97.It Dv BIOCDISK_NOVOL 98Is just the same as 99.Dv BIOCDISK 100but doesn't require the disks to be in volume sets, so this 101applies to any physical disk connected to the controller. 102.Pp 103Note: this ioctl might not be supported on all hardware. 104It is a 105.Nx 106extension of 107.Nm . 108It is supported by 109.Xr arcmsr 4 , 110.Xr ciss 4 , 111and 112.Xr mpt 4 . 113It is also supported by 114.Xr cac 4 , 115but handled exactly the same as 116.Dv BIOCDISK . 117.It Dv BIOCVOL 118Retrieve detailed information for the specified volume. 119Information returned can include status, size, RAID level, number of disks, 120device name association (sd?) and vendor name. 121.It Dv BIOCALARM 122Control the alarm beeper on the device. 123Supported states are: disable alarm, enable alarm, silence alarm, status and 124test alarm. 125.Pp 126Note: These options might not be supported on all hardware. 127It is supported by 128.Xr arcmsr 4 , 129.Xr mfi 4 , 130and 131.Xr mfii 4 . 132.It Dv BIOCBLINK 133Blink an LED of the specified physical disk. 134Supported blink states are: blink LED, unblink LED and blink alarm LED. 135.Pp 136Note: This option is only supported if the disk is governed by 137.Xr ses 4 138.\" or 139.\" .Xr safte 4 140and the hardware supports hardware blinking. 141It is supported by 142.Xr ciss 4 , 143.Xr mfi 4 , 144and 145.Xr mfii 4 . 146.It Dv BIOCSETSTATE 147Alter the state of specified physical disk. 148Supported states are: create/remove hot-spare, create/remove pass through 149disk, start/stop consistency check in a volume, online disk and offline disk, 150and a manual rebuild kick-off designation. 151.Pp 152Note: These options might not be supported on all hardware. 153Some of these options are supported by 154.Xr arcmsr 4 , 155.Xr mfi 4 , 156and 157.Xr mfii 4 . 158.Pp 159Online, offline and hotspare designations are supported by 160.Xr mfi 4 161and 162.Xr mfii 4 , 163plus a rebuild designation is supported by 164.Xr mfii 4 ; 165all four of these state options are the original states from 166.Ox , 167the other options, including hotspare unmarking, being 168.Nx 169extensions of 170.Nm . 171.Pp 172Hotspare, pass through and consistency check options are supported by 173.Xr arcmsr 4 . 174.It Dv BIOCVOLOPS 175For operations in volume sets. 176It's able to create and remove a volume 177set in a supported RAID controller. 178.Pp 179Note: this ioctl might not be supported on all hardware. 180It is a 181.Nx 182extension of 183.Nm , 184and is supported by 185.Xr arcmsr 4 . 186.El 187.Pp 188The 189.Xr bioctl 8 190utility can be used to perform the above controls from the userland. 191Additionally, since 192.Dv BIOCVOL 193volume status is normally duplicated into 194.Xr sysmon_envsys 9 195sensors of 196.Dv ENVSYS_DRIVE 197type, it is also available through 198.Xr envsys 4 , 199and can be monitored with 200.Xr envstat 8 201and 202.Xr powerd 8 . 203.Sh FILES 204.Bl -tag -width Ds -compact 205.It Pa /dev/bio 206ioctl tunnel device 207.It Pa /etc/powerd/scripts/sensor_drive 208powerd script for drive sensors 209.El 210.Sh SEE ALSO 211.Xr ioctl 2 , 212.Xr envsys 4 , 213.Xr bioctl 8 , 214.Xr envstat 8 , 215.Xr powerd 8 , 216.Xr sysmon_envsys 9 217.Sh HISTORY 218The 219.Nm 220driver first appeared in 221.Ox 3.2 222and 223.Nx 4.0 . 224.Sh AUTHORS 225.An -nosplit 226The 227.Nm 228driver was written by 229.An Niklas Hallqvist Aq Mt niklas@openbsd.org . 230The API was written by 231.An Marco Peereboom Aq Mt marco@openbsd.org 232and was extended even more for 233.Nx 234by 235.An Juan Romero Pardines Aq Mt xtraeme@netbsd.org . 236