1.\"	$OpenBSD: bio_register.9,v 1.6 2015/09/14 12:05:33 schwarze Exp $
2.\"
3.\" Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: September 14 2015 $
18.Dt BIO_REGISTER 9
19.Os
20.Sh NAME
21.Nm bio_register ,
22.Nm bio_unregister
23.Nd block I/O ioctl tunnelling interface
24.Sh SYNOPSIS
25.In dev/biovar.h
26.Ft int
27.Fn bio_register "struct device *dev" "int (*bioctl)(struct device *, u_long, caddr_t)"
28.Ft void
29.Fn bio_unregister "struct device *dev"
30.Sh DESCRIPTION
31The block I/O ioctl tunnelling interface is used by drivers to register and
32unregister ioctl handlers to be accessed via the
33.Xr bio 4
34device.
35.Pp
36.Fn bio_register
37is called by the driver represented by
38.Fa dev
39to register the
40.Fa bioctl
41argument as the ioctl handler for itself.
42.Pp
43.Fn bio_unregister
44is called to remove the ioctl handler previously registered with
45.Fn bio_register
46for the device represented by
47.Fa dev .
48.Pp
49.Fn bio_register
50and
51.Fn bio_unregister
52can be called during
53.Xr autoconf 9
54or from process context.
55The
56.Fa bioctl
57callback is called from process context.
58.Sh SEE ALSO
59.Xr bio 4 ,
60.Xr autoconf 9
61.Sh HISTORY
62The block I/O ioctl tunnelling interface first appeared in
63.Ox 3.2 .
64.Sh AUTHORS
65The block I/O ioctl tunnelling interface was written by
66.An Niklas Hallqvist Aq Mt niklas@openbsd.org .
67