Add manpages for the new device framework.
This commit is contained in:
parent
243726c1b8
commit
cd489c519a
57
share/man/man9/BUS_CONNECT_INTR.9
Normal file
57
share/man/man9/BUS_CONNECT_INTR.9
Normal file
@ -0,0 +1,57 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Os
|
||||
.Dt BUS_CONNECT_INTR 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm BUS_CONNECT_INTR
|
||||
.Nd activate an interrupt handler
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn BUS_CONNECT_INTR "device_t dev" "void *ih"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
This method activates an interrupt handler previously created by
|
||||
.Xr BUS_CREATE_INTR 9 .
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an appropriate error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9 ,
|
||||
.Xr driver 9 ,
|
||||
.Xr BUS_CREATE_INTR 9
|
||||
.Sh BUGS
|
||||
This interface is probably inadequate and is subject to change.
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
66
share/man/man9/BUS_CREATE_INTR.9
Normal file
66
share/man/man9/BUS_CREATE_INTR.9
Normal file
@ -0,0 +1,66 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Os
|
||||
.Dt BUS_CREATE_INTR 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm BUS_CREATE_INTR
|
||||
.Nd create an interrupt handler
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft void *
|
||||
.Fn BUS_CREATE_INTR "device_t dev" "device_t child" "int irq" "driver_intr_t *intr" "void *arg"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
The method
|
||||
.Xr BUS_CREATE_INTR 9
|
||||
creates an interrupt handler for the child device. The handler
|
||||
.Fa intr
|
||||
will be called with the value
|
||||
.Fa arg
|
||||
as its only argument.
|
||||
The handle returned can be used in a call to
|
||||
.Xr BUS_CONNECT_INTR 9
|
||||
to activate the handler.
|
||||
.Sh RETURN VALUES
|
||||
An opaque handle which can be used to activate the interrupt is
|
||||
returned if the call is successful, otherwise NULL is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9 ,
|
||||
.Xr driver 9 ,
|
||||
.Xr BUS_CONNECT_INTR 9
|
||||
.Sh BUGS
|
||||
This interface is probably inadequate and is subject to change.
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
54
share/man/man9/BUS_PRINT_CHILD.9
Normal file
54
share/man/man9/BUS_PRINT_CHILD.9
Normal file
@ -0,0 +1,54 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Os
|
||||
.Dt BUS_PRINT_CHILD 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm BUS_PRINT_CHILD
|
||||
.Nd print information about a device
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn BUS_PRINT_CHILD "device_t dev" "device_t child"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
This is called from system code which prints out a description of a
|
||||
device. It should describe the attachment that the child has with
|
||||
the parent. For instance the TurboLaser bus prints which node the
|
||||
device is attached to.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9 ,
|
||||
.Xr driver 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
64
share/man/man9/BUS_READ_IVAR.9
Normal file
64
share/man/man9/BUS_READ_IVAR.9
Normal file
@ -0,0 +1,64 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Os
|
||||
.Dt BUS_READ_IVAR 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm BUS_READ_IVAR ,
|
||||
.Nm BUS_WRITE_IVAR
|
||||
.Nd manipulate bus-specific device instance variables
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn BUS_READ_IVAR "device_t dev" "device_t child" "int index" "u_long *result"
|
||||
.Ft int
|
||||
.Fn BUS_WRITE_IVAR "device_t dev" "device_t child" "int index" "u_long value"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
These two methods manage a bus specific set of instance variables of
|
||||
a child device. The intention is that each different type of bus
|
||||
defines a set of appropriate instance variables (such as ports and
|
||||
irqs for ISA bus etc.)
|
||||
.Pp
|
||||
This information could be given to the child device as a struct but
|
||||
that makes it hard for a bus to add or remove variables without
|
||||
forcing an edit and recompile for all drivers which may not be
|
||||
possible for vendor supplied binary drivers.
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an appropriate error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9 ,
|
||||
.Xr driver 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
57
share/man/man9/DEVICE_ATTACH.9
Normal file
57
share/man/man9/DEVICE_ATTACH.9
Normal file
@ -0,0 +1,57 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Os
|
||||
.Dt DEVICE_ATTACH 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm DEVICE_ATTACH
|
||||
.Nd attach a device
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn DEVICE_ATTACH "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
Attach a device to the system. The probe method will have been called
|
||||
and will have indicated that the device exists. This routine should
|
||||
initialise the hardware and allocate other system resources (such as
|
||||
devfs entries).
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an appropriate error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9
|
||||
.Xr DEVICE_PROBE 9 ,
|
||||
.Xr DEVICE_DETACH 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
60
share/man/man9/DEVICE_DETACH.9
Normal file
60
share/man/man9/DEVICE_DETACH.9
Normal file
@ -0,0 +1,60 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Os
|
||||
.Dt DEVICE_DETACH 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm DEVICE_DETACH
|
||||
.Nd detach a device
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn DEVICE_DETACH "device_t dev" "int arg1" "int arg2"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
Detach a device. This can be called if the user is replacing the
|
||||
driver software or if a device is about to be physically removed from
|
||||
the system (e.g. for pccard devices).
|
||||
.Pp
|
||||
The method should deallocate any system resources allocated during the
|
||||
.Xr DEVICE_ATTACH 9
|
||||
method and reset the hardware to a sane state (i.e. disable interrupts
|
||||
etc.)
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an appropriate error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9 ,
|
||||
.Xr DEVICE_ATTACH 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
62
share/man/man9/DEVICE_PROBE.9
Normal file
62
share/man/man9/DEVICE_PROBE.9
Normal file
@ -0,0 +1,62 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Os
|
||||
.Dt DEVICE_PROBE 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm DEVICE_PROBE
|
||||
.Nd probe for device existence
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn DEVICE_PROBE "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
This device method should probe to see if the device is present. If
|
||||
the device exists, the probe should return 0, otherwise ENXIO should
|
||||
be returned. If some other error happens during the probe (such as a
|
||||
memory allocation failure), an appropriate error code should be returned.
|
||||
.Pp
|
||||
Devices which implement busses should use this method to probe for the
|
||||
existence of devices attached to the bus and add them as children. If
|
||||
this is combined with the use of
|
||||
.Xr bus_generic_attach 9
|
||||
the child devices will be automatically probed and attached.
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9 ,
|
||||
.Xr DEVICE_ATTACH 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
54
share/man/man9/DEVICE_SHUTDOWN.9
Normal file
54
share/man/man9/DEVICE_SHUTDOWN.9
Normal file
@ -0,0 +1,54 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Os
|
||||
.Dt DEVICE_SHUTDOWN 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm DEVICE_SHUTDOWN
|
||||
.Nd called during system shutdown
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn DEVICE_SHUTDOWN "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
This is called during system shutdown to allow the driver to put the
|
||||
hardware into a consistent state for rebooting the computer.
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9 ,
|
||||
.Xr DEVICE_ATTACH 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile,v 1.35 1998/03/04 10:23:48 dufault Exp $
|
||||
# $Id: Makefile,v 1.36 1998/03/28 11:49:06 dufault Exp $
|
||||
|
||||
MAN9= MD5.9 \
|
||||
VFS.9 VFS_FHTOVP.9 VFS_INIT.9 VFS_MOUNT.9 VFS_QUOTACTL.9 \
|
||||
@ -19,6 +19,21 @@ MAN9= MD5.9 \
|
||||
store.9 style.9 suser.9 time.9 timeout.9 uio.9 \
|
||||
vget.9 vnode.9 vput.9 vref.9 vrele.9 vslock.9
|
||||
|
||||
MAN9+= device.9 device_add_child.9 device_delete_child.9 device_enable.9 \
|
||||
device_find_child.9 device_get_devclass.9 device_get_driver.9 \
|
||||
device_get_ivars.9 device_get_softc.9 device_get_state.9 \
|
||||
device_get_unit.9 device_probe_and_attach.9 device_set_desc.9 \
|
||||
driver.9 \
|
||||
devclass.9 devclass_add_driver.9 devclass_find.9 \
|
||||
devclass_get_device.9 devclass_get_devices.9 devclass_get_maxunit.9 \
|
||||
devclass_get_name.9 devclass_get_softc.9 \
|
||||
DEVICE_ATTACH.9 DEVICE_DETACH.9 DEVICE_PROBE.9 DEVICE_SHUTDOWN.9 \
|
||||
BUS_CREATE_INTR.9 BUS_CONNECT_INTR.9 BUS_PRINT_CHILD.9 \
|
||||
BUS_READ_IVAR.9 \
|
||||
bus_generic_attach.9 bus_generic_detach.9 bus_generic_map_intr.9 \
|
||||
bus_generic_print_child.9 bus_generic_read_ivar.9 \
|
||||
bus_generic_shutdown.9
|
||||
|
||||
MLINKS+=MD5.9 MD5Init.9 MD5.9 MD5Transform.9
|
||||
MLINKS+=VOP_ATTRIB.9 VOP_GETATTR.9
|
||||
MLINKS+=VOP_ATTRIB.9 VOP_SETATTR.9
|
||||
@ -57,4 +72,16 @@ MLINKS+=timeout.9 untimeout.9
|
||||
MLINKS+=vref.9 VREF.9
|
||||
MLINKS+=vslock.9 vsunlock.9
|
||||
|
||||
MLINKS+=device_add_child.9 device_add_child_after.9
|
||||
MLINKS+=device_enable.9 device_disable.9
|
||||
MLINKS+=device_enable.9 device_is_enabled.9
|
||||
MLINKS+=device_get_state.9 device_busy.9
|
||||
MLINKS+=device_get_state.9 device_unbusy.9
|
||||
MLINKS+=device_get_state.9 device_is_alive.9
|
||||
MLINKS+=device_set_desc.9 device_get_desc.9
|
||||
MLINKS+=devclass_add_driver.9 devclass_delete_driver.9
|
||||
MLINKS+=devclass_add_driver.9 devclass_find_driver.9
|
||||
MLINKS+=BUS_READ_IVAR.9 BUS_WRITE_IVAR.9
|
||||
MLINKS+=bus_generic_read_ivar.9 bus_generic_write_ivar.9
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
59
share/man/man9/bus_generic_attach.9
Normal file
59
share/man/man9/bus_generic_attach.9
Normal file
@ -0,0 +1,59 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Os
|
||||
.Dt bus_generic_attach 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm bus_generic_attach
|
||||
.Nd generic implementation of
|
||||
.Dv DEVICE_ATTACH
|
||||
for busses
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn bus_generic_attach "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
This function provides an implementation of the
|
||||
.Xr DEVICE_ATTACH 9
|
||||
method which can be used by most bus code. It simply calls
|
||||
.Xr device_probe_and_attach 9
|
||||
for each child device attached to the bus.
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an appropriate error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9 ,
|
||||
.Xr driver 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
60
share/man/man9/bus_generic_detach.9
Normal file
60
share/man/man9/bus_generic_detach.9
Normal file
@ -0,0 +1,60 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Os
|
||||
.Dt bus_generic_detach 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm bus_generic_detach
|
||||
.Nd generic implementation of
|
||||
.Dv DEVICE_DETACH
|
||||
for busses
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn bus_generic_detach "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
This function provides an implementation of the
|
||||
.Xr DEVICE_DETACH 9
|
||||
method
|
||||
which can be used by most bus code. It simply calls the
|
||||
.Xr DEVICE_DETACH 9
|
||||
method of each child device attached to the bus.
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an appropriate error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9 ,
|
||||
.Xr driver 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
58
share/man/man9/bus_generic_map_intr.9
Normal file
58
share/man/man9/bus_generic_map_intr.9
Normal file
@ -0,0 +1,58 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Os
|
||||
.Dt bus_generic_map_intr 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm bus_generic_map_intr
|
||||
.Nd generic implementation of
|
||||
.Dv BUS_MAP_INTR
|
||||
for busses
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn bus_generic_map_intr "device_t dev" "device_t child" "driver_intr_t *intr" "void *arg"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
This simple implementation of
|
||||
.Xr BUS_MAP_INTR 9
|
||||
just calls the method of
|
||||
.Fa dev 's
|
||||
parent.
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an appropriate error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
56
share/man/man9/bus_generic_print_child.9
Normal file
56
share/man/man9/bus_generic_print_child.9
Normal file
@ -0,0 +1,56 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Os
|
||||
.Dt bus_generic_print_child 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm bus_generic_print_child
|
||||
.Nd generic implementation of
|
||||
.Dv DEVICE_PRINT_CHILD
|
||||
for busses
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn bus_generic_print_child "device_t dev" "device_t child"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
This implementation prints nothing at all.
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an appropriate error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9
|
||||
.Sh BUGS
|
||||
Not terribly useful.
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
59
share/man/man9/bus_generic_read_ivar.9
Normal file
59
share/man/man9/bus_generic_read_ivar.9
Normal file
@ -0,0 +1,59 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Os
|
||||
.Dt bus_generic_read_ivar 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm bus_generic_read_ivar ,
|
||||
.Nm bus_generic_write_ivar
|
||||
.Nd generic implementation of
|
||||
.Dv BUS_READ_IVAR
|
||||
and
|
||||
.Dv BUS_WRITE_IVAR
|
||||
for busses
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn bus_generic_read_ivar "device_t dev" "device_t child" "int index" "u_long *result"
|
||||
.Ft int
|
||||
.Fn bus_generic_write_ivar "device_t dev" "device_t child" "int index" "u_long value"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
These functions simply return
|
||||
.Dv ENOENT .
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9 ,
|
||||
.Xr driver 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
60
share/man/man9/bus_generic_shutdown.9
Normal file
60
share/man/man9/bus_generic_shutdown.9
Normal file
@ -0,0 +1,60 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Os
|
||||
.Dt bus_generic_shutdown 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm bus_generic_shutdown
|
||||
.Nd generic implementation of
|
||||
.Dv DEVICE_SHUTDOWN
|
||||
for busses
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn bus_generic_shutdown "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
This function provides an implementation of the
|
||||
.Xr DEVICE_SHUTDOWN 9
|
||||
method
|
||||
which can be used by most bus code. It simply calls the
|
||||
.Xr DEVICE_SHUTDOWN 9
|
||||
method of each child device attached to the bus.
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an appropriate error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9 ,
|
||||
.Xr driver 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
65
share/man/man9/devclass.9
Normal file
65
share/man/man9/devclass.9
Normal file
@ -0,0 +1,65 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt devclass 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm devclass
|
||||
.Nd object representing a class of devices
|
||||
.Sh SYNOPSYS
|
||||
.Dv typedef struct devclass *devclass_t;
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
The
|
||||
.Dv devclass
|
||||
object has two main functions in the system. The first is to manage
|
||||
the allocation of unit numbers for device instances and the second is
|
||||
to hold the list of device drivers for a particular bus type.
|
||||
Each
|
||||
.Dv devclass
|
||||
has a name and there cannot be two devclasses with the same name.
|
||||
This ensures that unique unit numbers are allocated to device
|
||||
instances.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9 ,
|
||||
.Xr driver 9 ,
|
||||
.Xr devclass_find 9 ,
|
||||
.Xr devclass_add_driver 9 ,
|
||||
.Xr devclass_delete_driver 9 ,
|
||||
.Xr devclass_find_driver 9 ,
|
||||
.Xr devclass_get_name 9 ,
|
||||
.Xr devclass_get_device 9 ,
|
||||
.Xr devclass_get_softc 9 ,
|
||||
.Xr devclass_get_devices 9 ,
|
||||
.Xr devclass_get_maxunit 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
58
share/man/man9/devclass_add_driver.9
Normal file
58
share/man/man9/devclass_add_driver.9
Normal file
@ -0,0 +1,58 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt devclass_add_driver 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm devclass_add_driver ,
|
||||
.Nm devclass_delete_driver ,
|
||||
.Nm devclass_find_driver
|
||||
.Nd manipulate the drivers in a devclass
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn devclass_add_driver "devclass_t dc" "driver_t *driver"
|
||||
.Ft int
|
||||
.Fn devclass_delete_driver "devclass_t dc" "driver_t *driver"
|
||||
.Ft driver_t *
|
||||
.Fn devclass_find_driver "devclass_t dc" "const char *name"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
These functions can be used to add new drivers into the system, remove
|
||||
old ones and search for existing ones. Normally drivers are added
|
||||
automatically during system initialisation.
|
||||
.Sh SEE ALSO
|
||||
.Xr devclass 9 ,
|
||||
.Xr driver 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
57
share/man/man9/devclass_find.9
Normal file
57
share/man/man9/devclass_find.9
Normal file
@ -0,0 +1,57 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt devclass_find 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm devclass_find
|
||||
.Nd search for a devclass
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft devclass_t
|
||||
.Fn devclass_find "const char *classname"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
Search for the
|
||||
.Dv devclass
|
||||
with the specified name.
|
||||
.Sh RETURN VALUES
|
||||
If the
|
||||
.Dv devclass
|
||||
exists, it is returned, otherwise
|
||||
.Dv NULL
|
||||
is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr devclass 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
53
share/man/man9/devclass_get_device.9
Normal file
53
share/man/man9/devclass_get_device.9
Normal file
@ -0,0 +1,53 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt devclass_get_device 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm devclass_get_device
|
||||
.Nd translate unit number to device
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn devclass_get_device "devclass_t dc" "int unit"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
This function retrieves the device instance with the given unit number
|
||||
and returns it.
|
||||
.Sh RETURN VALUES
|
||||
If the device exists, it is returned, otherwise NULL is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr devclass 9 ,
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
58
share/man/man9/devclass_get_devices.9
Normal file
58
share/man/man9/devclass_get_devices.9
Normal file
@ -0,0 +1,58 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt devclass_get_devices 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm devclass_get_devices
|
||||
.Nd get a list of devices in a devclass
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn devclass_get_devices "devclass_t dc" "int device_t **devlistp" "int *devcountp"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
Retrieve a list of all device instances currently in the devclass and
|
||||
return the list in
|
||||
.Fa *devlistp
|
||||
and the count in
|
||||
.Fa *devcountp .
|
||||
The memory allocated for the list should be freed using
|
||||
.Fn free "*devlistp" "M_TEMP" .
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an appropriate error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr devclass 9 ,
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
52
share/man/man9/devclass_get_maxunit.9
Normal file
52
share/man/man9/devclass_get_maxunit.9
Normal file
@ -0,0 +1,52 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt devclass_get_maxunit 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm devclass_get_maxunit
|
||||
.Nd find the maximum unit number in the class
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn devclass_get_maxunit "devclass_t dc"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
Returns the maximum unit number allocated to device instances in the
|
||||
specified
|
||||
.Dv devclass .
|
||||
.Sh SEE ALSO
|
||||
.Xr devclass 9 ,
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
50
share/man/man9/devclass_get_name.9
Normal file
50
share/man/man9/devclass_get_name.9
Normal file
@ -0,0 +1,50 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt devclass_get_name 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm devclass_get_name
|
||||
.Nd access the name of a devclass
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft const char *
|
||||
.Fn devclass_get_name "devclass_t dc"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
Return the name of a devclass.
|
||||
.Sh SEE ALSO
|
||||
.Xr devclass 9 ,
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
53
share/man/man9/devclass_get_softc.9
Normal file
53
share/man/man9/devclass_get_softc.9
Normal file
@ -0,0 +1,53 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt devclass_get_softc 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm devclass_get_softc
|
||||
.Nd translate unit number to driver private structure
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn devclass_get_softc "devclass_t dc" "int unit"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
This function retrieves the driver private instance variables for the
|
||||
device with the given unit number and returns it.
|
||||
.Sh RETURN VALUES
|
||||
If the device exists, its driver-private variables are returned,
|
||||
otherwise NULL is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
102
share/man/man9/device.9
Normal file
102
share/man/man9/device.9
Normal file
@ -0,0 +1,102 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt device 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm device
|
||||
.Nd an abstract representation of a device
|
||||
.Sh SYNOPSYS
|
||||
.Dv typedef struct device *device_t;
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
The device object represents a piece of hardware attached to the
|
||||
system such as an expansion card, the bus which that card is plugged
|
||||
into, disk drives attached to the expansion card etc.
|
||||
The system defines one device,
|
||||
.Dv root_bus
|
||||
and all other devices are created dynamically during
|
||||
autoconfiguration. Normally devices representing toplevel busses in
|
||||
the system (ISA, PCI etc.) will be attached directly to
|
||||
.Dv root_bus
|
||||
and other devices will be added as children of their relavent bus.
|
||||
.Pp
|
||||
The devices in a system form a tree. All devices except
|
||||
.Dv root_bus
|
||||
have a parent (see
|
||||
.Xr device_get_parent 9 ).
|
||||
In addition, any device can have children attached to it (see
|
||||
.Xr device_add_child 9 ,
|
||||
.Xr device_add_child_after 9 ,
|
||||
.Xr device_find_child 9 ,
|
||||
and
|
||||
.Xr device_delete_child 9 ).
|
||||
.Pp
|
||||
A device which has been successfully been probed and attached to the
|
||||
system will also have a driver (see
|
||||
.Xr device_get_driver 9
|
||||
and
|
||||
.Xr driver 9 )
|
||||
and a devclass (see
|
||||
.Xr device_get_devclass 9
|
||||
and
|
||||
.Xr devclass 9 ).
|
||||
Various other attributes of the device include a unit number (see
|
||||
.Xr device_get_unit 9 ),
|
||||
verbose description (normally supplied by the driver, see
|
||||
.Xr device_set_desc 9
|
||||
and
|
||||
.Xr device_get_desc 9 ),
|
||||
a set of bus-specific variables (see
|
||||
.Xr device_get_ivars 9 )
|
||||
and a set of driver-specific variables (see
|
||||
.Xr device_get_softc 9 ).
|
||||
.Pp
|
||||
Devices can be in one of several states:
|
||||
.Bl -tag -width DS_NOTPRESENT
|
||||
.It Ar DS_NOTPRESENT
|
||||
the device has not been probed for existence or the probe failed
|
||||
.It Ar DS_ALIVE
|
||||
the device probe succeeded but not yet attached
|
||||
.It Ar DS_ATTACHED
|
||||
the device has been successfully attached
|
||||
.It Ar DS_BUSY
|
||||
the device is currently open
|
||||
.El
|
||||
.Pp
|
||||
The current state of the device can be determined by calling
|
||||
.Xr device_get_state 9 .
|
||||
.Sh SEE ALSO
|
||||
.Xr driver 9 ,
|
||||
.Xr devclass 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
108
share/man/man9/device_add_child.9
Normal file
108
share/man/man9/device_add_child.9
Normal file
@ -0,0 +1,108 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt device_add_child 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm device_add_child ,
|
||||
.Nm device_add_child_after
|
||||
.Nd add a new device as a child of an existing device
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn bus_add_child "device_t dev" "const char *name" "int unit" "void *ivars"
|
||||
.Ft int
|
||||
.Fn bus_add_child_after "device_t dev" "device_t place" "const char *name" "int unit" "void *ivars"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
Create a new child device of
|
||||
.Fa dev .
|
||||
The
|
||||
.Fa name
|
||||
and
|
||||
.Fa unit
|
||||
arguments specify the name and unit number of the device.
|
||||
If the name is unknown then the caller should pass
|
||||
.Dv NULL .
|
||||
If the unit is unknown then the caller should pass
|
||||
.Dv -1
|
||||
and the system will choose the next available unit number.
|
||||
If there is any bus-specific data associated with the new child device
|
||||
(i.e. port numbers, irq settings etc.) then this should be supplied as
|
||||
the
|
||||
.Fa ivars
|
||||
argument.
|
||||
.Pp
|
||||
The name of the device is used to determine which drivers might be
|
||||
appropriate for the device. If a name is specified then only drivers
|
||||
of that name are probed. If no name is given then all drivers for the
|
||||
owning bus are probed.
|
||||
.Pp
|
||||
This allows busses which can uniquely identify device instances (such
|
||||
as PCI) to allow each driver to check each device instance for a
|
||||
match. For busses which rely on supplied probe hints where only one
|
||||
driver can have a change of probing the device, the driver name should
|
||||
specified as the device name.
|
||||
.Pp
|
||||
Normally unit numbers will be chosen automatically by the system and a
|
||||
unit number of
|
||||
.Dv -1
|
||||
should be given.
|
||||
When a specific unit number is desired (e.g. for wiring a particular
|
||||
piece of hardware to a pre-configured unit number), that unit should
|
||||
be passed. If the specified unit number is already allocated, a new
|
||||
unit will be allocated and a diagnostic message printed.
|
||||
.Pp
|
||||
If the devices attached to a bus must be probed in a specific order
|
||||
(e.g. for ISA bus devices which are sensitive to failed probe attempts
|
||||
of unrelated drivers), the
|
||||
.Fa place
|
||||
argument of
|
||||
.Xr device_add_child_after 9
|
||||
should be used. If
|
||||
.Dv NULL
|
||||
is passed, the new device will be added as the first child of
|
||||
.Fa dev ,
|
||||
otherwise it will be added immediately after
|
||||
.Fa place
|
||||
(which must be an existing child of
|
||||
.Fa dev )
|
||||
in the list of children. If
|
||||
.Xr device_add_child 9
|
||||
is used, then the new child will be added at the end of the list.
|
||||
.Sh RETURN VALUES
|
||||
The new device if successful, NULL otherwise.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
57
share/man/man9/device_delete_child.9
Normal file
57
share/man/man9/device_delete_child.9
Normal file
@ -0,0 +1,57 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt device_delete_child 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm device_delete_child
|
||||
.Nd delete a child from a device
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn device_delete_child "device_t dev" "device_t child"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
The specified device is removed from
|
||||
.Fa dev
|
||||
and deleted.
|
||||
If the device is currently attached, it is first detached (see
|
||||
.Xr DEVICE_ATTACH 9
|
||||
and
|
||||
.Xr DEVICE_DETACH 9 ).
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device_add_child 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
63
share/man/man9/device_enable.9
Normal file
63
share/man/man9/device_enable.9
Normal file
@ -0,0 +1,63 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt device_enable 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm device_enable ,
|
||||
.Nm device_disable ,
|
||||
.Nm device_is_enabled
|
||||
.Nd manipulate device enabled flag
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft void
|
||||
.Fn device_enable "device_t dev"
|
||||
.Ft void
|
||||
.Fn device_disable "device_t dev"
|
||||
.Ft int
|
||||
.Fn device_is_enabled "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
Each device has an enabled flag associated with it. A device is
|
||||
enabled by default when it is created but may be disabled (for
|
||||
instance to prevent a destructive or time consuming probe attempt).
|
||||
To disable a device, call
|
||||
.Xr device_disable 9 ,
|
||||
to reenable it, call
|
||||
.Xr device_enable 9
|
||||
and to test to see if a device is enabled, call
|
||||
.Xr device_is_enabled 9 .
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
56
share/man/man9/device_find_child.9
Normal file
56
share/man/man9/device_find_child.9
Normal file
@ -0,0 +1,56 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt device_find_child 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm device_find_child
|
||||
.Nd search for a child of a device
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn device_find_child "device_t dev" "const char* name" "int unit"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
This function looks for a specific child of
|
||||
.Dv dev .
|
||||
with the given
|
||||
.Fa name
|
||||
and
|
||||
.Fa unit .
|
||||
.Sh RETURN VALUES
|
||||
If it exists, the child device is returned, otherwise NULL.
|
||||
.Sh SEE ALSO
|
||||
.Xr device_add_child 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
53
share/man/man9/device_get_devclass.9
Normal file
53
share/man/man9/device_get_devclass.9
Normal file
@ -0,0 +1,53 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt device_get_devclass 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm device_get_devclass
|
||||
.Nd access the devclass of a device
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft devclass_t
|
||||
.Fn device_get_devclass "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
The current devclass associated with the device is returned. If the
|
||||
device has no devclass,
|
||||
.Dv NULL
|
||||
is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr devclass 9
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
53
share/man/man9/device_get_driver.9
Normal file
53
share/man/man9/device_get_driver.9
Normal file
@ -0,0 +1,53 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt device_get_driver 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm device_get_driver
|
||||
.Nd access the current driver of a device
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft driver_t *
|
||||
.Fn device_get_driver "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
The current driver associated with the device is returned. If the
|
||||
device has no driver,
|
||||
.Dv NULL
|
||||
is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr driver 9
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
49
share/man/man9/device_get_ivars.9
Normal file
49
share/man/man9/device_get_ivars.9
Normal file
@ -0,0 +1,49 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt device_get_ivars 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm device_get_ivars
|
||||
.Nd access bus private variables
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft void *
|
||||
.Fn device_get_ivars "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
Return the bus-specific instance variables of a device.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
51
share/man/man9/device_get_softc.9
Normal file
51
share/man/man9/device_get_softc.9
Normal file
@ -0,0 +1,51 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt device_get_softc 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm device_get_softc
|
||||
.Nd access driver private instance variables
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft void *
|
||||
.Fn device_get_softc "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
Return the driver-specific instance variables of a device.
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
93
share/man/man9/device_get_state.9
Normal file
93
share/man/man9/device_get_state.9
Normal file
@ -0,0 +1,93 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt device_get_state 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm device_get_state ,
|
||||
.Nm device_busy ,
|
||||
.Nm device_unbusy ,
|
||||
.Nm device_is_alive
|
||||
.Nd manipulate device state
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft device_state_t
|
||||
.Fn device_get_state "device_t dev"
|
||||
.Ft void
|
||||
.Fn device_busy "device_t dev"
|
||||
.Ft void
|
||||
.Fn device_unbusy "device_t dev"
|
||||
.Ft int
|
||||
.Fn device_is_alive "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
The current state of a device is accessed by calling
|
||||
.Xr device_get_state 9
|
||||
which returns
|
||||
.Dv DS_NOTPRESENT ,
|
||||
.Dv DS_ALIVE ,
|
||||
.Dv DS_ATTACHED
|
||||
or
|
||||
.Dv DS_BUSY
|
||||
(described in
|
||||
.Xr device 9 ).
|
||||
To test see if a device was successfully probed, call
|
||||
.Xr device_is_alive 9
|
||||
which simply returns if the state is greater or equal to
|
||||
.Dv DS_ALIVE .
|
||||
.Pp
|
||||
Each device has a busy count which is incremented when
|
||||
.Xr device_busy 9
|
||||
is called and decremented when
|
||||
.Xr device_unbusy 9
|
||||
is called. Both routines return an error if the device state is less
|
||||
than
|
||||
.Dv DS_ATTACHED .
|
||||
.Pp
|
||||
When
|
||||
.Xr device_busy 9
|
||||
is called on a device in the
|
||||
.Dv DS_ATTACHED
|
||||
state, the device changes to the
|
||||
.Dv DS_BUSY
|
||||
state.
|
||||
When
|
||||
.Xr device_unbusy 9
|
||||
is called and after decrementing, the busy count for the device is
|
||||
zero, the device changes to the
|
||||
.Dv DS_ATTACHED
|
||||
state.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
49
share/man/man9/device_get_unit.9
Normal file
49
share/man/man9/device_get_unit.9
Normal file
@ -0,0 +1,49 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt device_get_unit 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm device_get_unit
|
||||
.Nd access the unit number of a device
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn device_get_unit "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
Return the unit number of the device.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
61
share/man/man9/device_probe_and_attach.9
Normal file
61
share/man/man9/device_probe_and_attach.9
Normal file
@ -0,0 +1,61 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt device_probe_and_attach 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm device_probe_and_attach
|
||||
.Nd initialise a device
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft int
|
||||
.Fn device_probe_and_attach "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
This function is called during autoconfiguration to initialise the
|
||||
devices in the system. For each device, the
|
||||
.Xr DEVICE_PROBE 9
|
||||
method of each suitable driver is called and if a probe succeeds, a
|
||||
description of the device is printed and the
|
||||
.Xr DEVICE_ATTACH 9
|
||||
method is called.
|
||||
If the device is disabled using
|
||||
.Xr device_disable 9
|
||||
then it will not be probed.
|
||||
.Sh RETURN VALUES
|
||||
Zero is returned on success, otherwise an appropriate error is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9 ,
|
||||
.Xr driver 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
54
share/man/man9/device_set_desc.9
Normal file
54
share/man/man9/device_set_desc.9
Normal file
@ -0,0 +1,54 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt device_set_desc 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm device_set_desc ,
|
||||
.Nm device_get_desc
|
||||
.Nd access the description of a device
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/bus.h>
|
||||
.Ft void
|
||||
.Fn device_set_desc "device_t dev" "const char *desc"
|
||||
.Ft const char *
|
||||
.Fn device_get_desc "device_t dev"
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
Manipulate the verbose description of a device. This description (if
|
||||
present) is printed as part of the message when it is attached during
|
||||
autoconfiguration.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
103
share/man/man9/driver.9
Normal file
103
share/man/man9/driver.9
Normal file
@ -0,0 +1,103 @@
|
||||
.\" -*- nroff -*-
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Doug Rabson
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This program is free software.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd June 16, 1998
|
||||
.Dt driver 9
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm driver
|
||||
.Nd structure describing a device driver
|
||||
.Sh SYNOPSIS
|
||||
.Bd -literal
|
||||
#include <sys/param.h>
|
||||
#include <sys/bus.h>
|
||||
|
||||
static int foo_probe(device_t);
|
||||
static int foo_attach(device_t);
|
||||
static int foo_detach(device_t);
|
||||
static int foo_frob(device_t, int, int);
|
||||
static int foo_twiddle(device_t, char *);
|
||||
|
||||
static struct device_method foo_methods[] = {
|
||||
/* Methods from the device interface */
|
||||
DEVMETHOD(device_probe, foo_probe),
|
||||
DEVMETHOD(device_attach, foo_attach),
|
||||
DEVMETHOD(device_detach, foo_detach),
|
||||
|
||||
/* Methods from the bogo interface */
|
||||
DEVMETHOD(bogo_frob, foo_frob),
|
||||
DEVMETHOD(bogo_twiddle, foo_twiddle),
|
||||
|
||||
/* Terminate method list */
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static driver_t foo_driver {
|
||||
"foo",
|
||||
foo_methods,
|
||||
DRIVER_TYPE_MISC,
|
||||
sizeof(struct foo_softc),
|
||||
};
|
||||
|
||||
static devclass_t foo_devclass;
|
||||
|
||||
DRIVER_MODULE(foo, bogo, foo_driver, foo_devclass, 0, 0);
|
||||
.Ed
|
||||
.Sh DESCRIPTION
|
||||
Each driver in the kernel is described by a
|
||||
.Dv driver_t
|
||||
structure. The structure contains the name of the device, a pointer
|
||||
to a list of methods, an indication of the kind of device which the
|
||||
driver implements and the size of the private data which the driver
|
||||
needs to associate with a device instance. Each driver will implement
|
||||
one or more sets of methods (called interfaces). The example driver
|
||||
implements the standard "driver" interface and the fictitious "bogo"
|
||||
interface.
|
||||
.Pp
|
||||
When a driver is registered with the system (by the
|
||||
.Dv DRIVER_MODULE
|
||||
macro), it is added to the list of drivers contained in the devclass
|
||||
of its parent bus type. For instance all PCI drivers would be
|
||||
contained in the devclass named "pci" and all ISA drivers would be
|
||||
in the devclass named "isa".
|
||||
The reason the drivers are not held in the device object of the parent
|
||||
bus is to handle multiple instances of a given type of bus.
|
||||
The
|
||||
.Dv DRIVER_MODULE
|
||||
macro will also create the devclass with the name of the driver and
|
||||
can optionally call extra initialisation code in the driver by
|
||||
specifying an extra module event handler and argument as the last two
|
||||
arguments.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9 ,
|
||||
.Xr devclass 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by
|
||||
.An Doug Rabson .
|
Loading…
Reference in New Issue
Block a user