1.\" $OpenBSD: bio.4,v 1.33 2015/04/18 12:04:59 jmc Exp $ 2.\" 3.\" Copyright (c) 2002 Niklas Hallqvist 4.\" Copyright (c) 2006 Marco Peereboom 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. The name of the author may not be used to endorse or promote products 16.\" derived from this software without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 22.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 27.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd $Mdocdate: April 18 2015 $ 31.Dt BIO 4 32.Os 33.Sh NAME 34.Nm bio 35.Nd block I/O ioctl tunnel pseudo-device 36.Sh SYNOPSIS 37.Cd "pseudo-device bio" Op Ar count 38.Sh DESCRIPTION 39The 40.Nm 41driver provides userland applications 42.Xr ioctl 2 43access to devices otherwise not found as 44.Pa /dev 45nodes. 46The 47.Pa /dev/bio 48device node operates by delegating ioctl 49calls to a requested device driver. 50Only drivers which have registered with the 51.Nm 52device can be accessed via this interface. 53.Pp 54If 55.Ar count 56is given in the specification, and is greater than 0, a maximum of one 57.Nm bio 58device is created. 59.Pp 60The following device drivers register with 61.Nm 62for volume management: 63.Pp 64.Bl -tag -width softraid(4)XX -offset indent -compact 65.It Xr ami 4 66American Megatrends Inc. MegaRAID PATA/SATA/SCSI RAID controller 67.It Xr arc 4 68Areca Technology Corporation SAS/SATA RAID controller 69.It Xr cac 4 70Compaq Smart Array 2/3/4 SCSI RAID controller 71.It Xr ciss 4 72Compaq Smart Array SAS/SATA/SCSI RAID controller 73.It Xr ips 4 74IBM SATA/SCSI ServeRAID controller 75.It Xr mfi 4 76LSI Logic & Dell MegaRAID SAS RAID controller 77.It Xr mpi 4 78LSI Logic Fusion-MPT Message Passing Interface 79.It Xr mpii 4 80LSI Logic Fusion-MPT Message Passing Interface II 81.It Xr softraid 4 82Software RAID 83.El 84.Pp 85The following device drivers register with 86.Nm 87to provide enclosure management: 88.Pp 89.Bl -tag -width safte($)XX -offset indent -compact 90.It Xr safte 4 91SCSI Accessed Fault-Tolerant Enclosure 92.It Xr ses 4 93SCSI Enclosure Services 94.El 95.Pp 96The following ioctl calls apply to the 97.Nm 98device: 99.Bl -tag -width Ds 100.It Dv BIOCLOCATE Fa "struct bio_locate *" 101Locate a named device and give back a cookie to the application 102for subsequent ioctl calls. 103The cookie is used to tunnel further ioctls to the right device. 104.It Dv BIOCINQ Fa "struct bioc_inq *" 105Retrieve number of volumes and physical disks for a specific device. 106.It Dv BIOCDISK Fa "struct bioc_disk *" 107Retrieve detailed information for the specified physical disk. 108Information returned can include status, size, channel, target, lun, 109vendor name, serial number and processor device (ses or safte). 110.It Dv BIOCVOL Fa "struct bioc_vol *" 111Retrieve detailed information for the specified volume. 112Information returned can include status, size, RAID level, number of disks, 113device name association (sd?) and vendor name. 114.It Dv BIOCALARM Fa "struct bioc_alarm *" 115Control the alarm beeper on the device. 116Supported states are: disable alarm, enable alarm, silence alarm, status and 117test alarm. 118.Pp 119Note: These options might not be supported on all hardware. 120.It Dv BIOCBLINK Fa "struct bioc_blink *" 121Blink an LED of the specified physical disk. 122Supported blink states are: blink LED, unblink LED and blink alarm LED. 123.Pp 124Note: This option is only supported if the disk is governed by 125.Xr ses 4 126or 127.Xr safte 4 128and the hardware supports hardware blinking. 129.It Dv BIOCSETSTATE Fa "struct bioc_setstate *" 130Alter the state of specified physical disk. 131Supported states are: create hot-spare, online disk and offline disk. 132.El 133.Pp 134The following ioctl calls apply to the 135.Nm 136device only when talking to a 137.Xr softraid 4 138device: 139.Bl -tag -width Ds 140.It Dv BIOCCREATERAID Fa "struct bioc_createraid *" 141Create a new volume or assemble an existing volume. 142The volume will be attached as a system disk, if this capability is supported 143by the volume discipline. 144.It Dv BIOCDELETERAID Fa "struct bioc_deleteraid *" 145Remove system disk (if present) and disassemble the 146.Xr softraid 4 147volume. 148.It Dv BIOCDISCIPLINE Fa "struct bioc_discipline *" 149Dispatch a discipline specific ioctl. 150.It Dv BIOCINSTALLBOOT Fa "struct bioc_installboot *" 151Install a boot loader. 152.El 153.Sh FILES 154.Bl -tag -width /dev/bio -compact 155.It Pa /dev/bio 156ioctl tunnel device 157.El 158.Sh SEE ALSO 159.Xr ioctl 2 , 160.Xr softraid 4 , 161.Xr bioctl 8 162.Sh HISTORY 163The 164.Nm 165driver first appeared in 166.Ox 3.2 . 167.Sh AUTHORS 168.An -nosplit 169The 170.Nm 171driver was written by 172.An Niklas Hallqvist Aq Mt niklas@openbsd.org . 173The API was written by 174.An Marco Peereboom Aq Mt marco@openbsd.org . 175