1.\" $OpenBSD: bio.4,v 1.34 2016/11/26 16:29:33 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: November 26 2016 $ 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 mfii 4 78LSI Logic MegaRAID SAS Fusion RAID controller 79.It Xr mpi 4 80LSI Logic Fusion-MPT Message Passing Interface 81.It Xr mpii 4 82LSI Logic Fusion-MPT Message Passing Interface II 83.It Xr softraid 4 84Software RAID 85.El 86.Pp 87The following device drivers register with 88.Nm 89to provide enclosure management: 90.Pp 91.Bl -tag -width safte($)XX -offset indent -compact 92.It Xr safte 4 93SCSI Accessed Fault-Tolerant Enclosure 94.It Xr ses 4 95SCSI Enclosure Services 96.El 97.Pp 98The following ioctl calls apply to the 99.Nm 100device: 101.Bl -tag -width Ds 102.It Dv BIOCLOCATE Fa "struct bio_locate *" 103Locate a named device and give back a cookie to the application 104for subsequent ioctl calls. 105The cookie is used to tunnel further ioctls to the right device. 106.It Dv BIOCINQ Fa "struct bioc_inq *" 107Retrieve number of volumes and physical disks for a specific device. 108.It Dv BIOCDISK Fa "struct bioc_disk *" 109Retrieve detailed information for the specified physical disk. 110Information returned can include status, size, channel, target, lun, 111vendor name, serial number and processor device (ses or safte). 112.It Dv BIOCVOL Fa "struct bioc_vol *" 113Retrieve detailed information for the specified volume. 114Information returned can include status, size, RAID level, number of disks, 115device name association (sd?) and vendor name. 116.It Dv BIOCALARM Fa "struct bioc_alarm *" 117Control the alarm beeper on the device. 118Supported states are: disable alarm, enable alarm, silence alarm, status and 119test alarm. 120.Pp 121Note: These options might not be supported on all hardware. 122.It Dv BIOCBLINK Fa "struct bioc_blink *" 123Blink an LED of the specified physical disk. 124Supported blink states are: blink LED, unblink LED and blink alarm LED. 125.Pp 126Note: This option is only supported if the disk is governed by 127.Xr ses 4 128or 129.Xr safte 4 130and the hardware supports hardware blinking. 131.It Dv BIOCSETSTATE Fa "struct bioc_setstate *" 132Alter the state of specified physical disk. 133Supported states are: create hot-spare, online disk and offline disk. 134.El 135.Pp 136The following ioctl calls apply to the 137.Nm 138device only when talking to a 139.Xr softraid 4 140device: 141.Bl -tag -width Ds 142.It Dv BIOCCREATERAID Fa "struct bioc_createraid *" 143Create a new volume or assemble an existing volume. 144The volume will be attached as a system disk, if this capability is supported 145by the volume discipline. 146.It Dv BIOCDELETERAID Fa "struct bioc_deleteraid *" 147Remove system disk (if present) and disassemble the 148.Xr softraid 4 149volume. 150.It Dv BIOCDISCIPLINE Fa "struct bioc_discipline *" 151Dispatch a discipline specific ioctl. 152.It Dv BIOCINSTALLBOOT Fa "struct bioc_installboot *" 153Install a boot loader. 154.El 155.Sh FILES 156.Bl -tag -width /dev/bio -compact 157.It Pa /dev/bio 158ioctl tunnel device 159.El 160.Sh SEE ALSO 161.Xr ioctl 2 , 162.Xr softraid 4 , 163.Xr bioctl 8 164.Sh HISTORY 165The 166.Nm 167driver first appeared in 168.Ox 3.2 . 169.Sh AUTHORS 170.An -nosplit 171The 172.Nm 173driver was written by 174.An Niklas Hallqvist Aq Mt niklas@openbsd.org . 175The API was written by 176.An Marco Peereboom Aq Mt marco@openbsd.org . 177