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