- Update pnp(4) to match the reality in -CURRENT.

- Add pnpbios(4).
This commit is contained in:
yokota 2001-09-23 08:41:12 +00:00
parent a78e6d3db4
commit fb7e435d4d
2 changed files with 129 additions and 142 deletions

View File

@ -30,158 +30,57 @@
.\"
.\" $FreeBSD$
.\"
.Dd September 7, 1997
.Dd September 20, 2001
.Dt PNP 4 i386
.Os
.Sh NAME
.Nm pnp
.Nd support for PnP devices
.Sh SYNOPSIS
.Cd controller pnp0
.Nd support for ``Plug and Play'' (PnP) ISA devices
.\" .Sh SYNOPSIS
.Sh DESCRIPTION
Support for PnP devices in
.Fx
allows the user to override the
configuration of PnP cards, and device drivers to fetch/modify
parameters in the card's configuration space.
The
.Nm
driver enumerates ISA devices which support
``Plug and Play ISA Specification'' in the system.
It assigns ISA bus resources (interrupt line, DMA channel, I/O ports,
and memory region) to each device and activates it.
.Pp
The manual override mechanism requires the kernel to be compiled with
.Cd options USERCONFIG .
In this case, the kernel keeps a table of fixed size (20 entries as a
default) where configuration data are held for PnP devices.
Each
PnP card can contain several independent devices (5 or 6 is not
unusual).
If it cannot assign necessary resources to a PnP ISA device without
causing conflict with other devices in the system,
the device will not be activated and will be unavailable
to programs.
.Pp
By booting the kernel with the
.Dq Fl c
flag, commands are available to
modify the configuration of PnP cards.
Commands start with the
sequence:
.Dl pnp CSN LDN
where CSN and LDN are the Card Select Number and Logical Device Number
associated to the device.
Following this sequence any combination of
the following commands can be used:
.Bl -tag -width "mmmmmmmmmm""
.It Dv irqN line
Sets the irq line for interrupt 0 or 1 on the card.
Line=0 means the line
is unused.
.It Dv drqN n
Sets the drq channel used for DMA 0 or 1 on the card.
Channel=4 means
the channel is unused.
.It Dv portN address
Sets the base address for the N-th port's range (N=0..7). address=0
means that the port is not used.
.It Dv memN address
Sets the base address for the N-th memory's range (N=0..3). address=0
means that the memory range is not used.
.It Dv bios
Makes the PnP device use the configuration set by the BIOS.
This
is the default, and is generally ok if your BIOS has PnP support.
If BIOS is used, then other parameters are ignored except "flags".
.It Dv os
Makes the PnP device to use the configuration specified in this entry.
.It Dv enable
Enables the PnP device.
.It Dv disable
Disables the PnP device.
.It Dv delete
Frees the entry used for the device, so that it can be used for
another device with a different CSN/LDN pair.
.It Dv flags
Sets the value of a 32-bit flags entry which is passed to the device
driver.
This can be used to set special operation modes (e.g. SB vs. WSS
emulation on some sound cards, etc.).
.El
.Sh CAVEAT
It is not possible to disable individual PnP ISA devices.
The
.Nm
driver will find all devices conforming the PnP ISA specification
and try to activate them all.
.Pp
The current content of the table can be printed using the
.Ic ls
command in userconfig.
In addition to modifications done by the user,
the table contains an entry for
all logical devices accessed by a PnP device driver.
.Pp
Modifications to
the table will be saved to the boot image on the filesystem by the
.Xr kget 8
command.
.Sh DEVICE DRIVER SUPPORT FOR PnP
PnP devices are automatically recognized and configured by the kernel.
A PnP device is identified by the following data structure:
.Bd -literal
struct pnp_device {
char *pd_name;
char *(*pd_probe ) (u_long csn, u_long vendor_id);
void (*pd_attach ) (u_long csn, u_long vend_id, char * name,
struct isa_device *dev);
u_long *pd_count;
u_int *imask;
struct isa_device dev;
};
.Ed
.Pp
The probe routine must check that the vendor_id passed is a
recognized one, that any necessary devices on the card are enabled,
and returns a NULL value in case of failure or a non-NULL value
(generally a pointer to the device name) unpon success. In the probe
routine, the function
.Fn read_pnp_parms
can be used to check that the logical devices are enabled.
.Pp
The attach routine should do all the necessary initialization, enable
the PnP card to ISA accesses, fetch the configuration, and call the ISA
driver for the device.
.Pp
The following routines and data structures can be used:
.Bl -tag -width "xxxxxxxxxx"
.It Dv struct pnp_cinfo
This data structure (defined in /sys/i386/isa/pnp.h) contains all
informations related to a PnP logical device.
.It Fn read_pnp_parms "struct pnp_cinfo *d" "int ldn"
This function returns the configuration of the requested
logical device.
It is not possible to specify a CSN since this function
is only meant to be used during probe and attach routines
.It Fn write_pnp_parms "struct pnp_cinfo *d" "int ldn"
This function sets the parameters of the requested logical device.
At
the same time, it updates the entry in the kernel override table.
Device drivers in general should
.Em not
modify the configuration of a device, since either the BIOS or the user
(through userconfig) should know better what to do.
In particular,
device driver
.Em should not enable
a logical device which has
been found disabled,
since this would defeat the override mechanism in userconfig.
Device
drivers may disable a logical device, or a port range, etc, but should
do so only that particular device or parameter is known to cause
troubles.
.It Fn enable_pnp_card void
This function
.Em must
be used in the attach routine
.Em only ,
before accessing the card's ISA ports/memory address ranges.
.El
There is no way to explicitly assign particular resource to
the PnP ISA device.
The resource assignment is fully automatic and there is
no provision for manual override.
.Sh SEE ALSO
.Xr kget 8
.Sh BUGS
There is no support for visual configuration of PnP devices.
It would be nice to have commands in userconfig to fetch the
configuration of PnP devices.
.Xr pnpbios 4
.Pp
.Sh STANDARDS
.Rs
.%A Intel
.%A Microsoft
.%T ``Plug and Play ISA Specification, Version 1.0a''
.%D May 5, 1994
.Re
.Pp
.Rs
.%T ``Clarifications to the Plug and Play ISA Specification, Version 1.0a''
.%D December 10, 1994
.Re
.Sh AUTHORS
.An -nosplit
PnP support was written by
PnP support was originally written
for
.Fx 2.2.5
by
.An Luigi Rizzo ,
based on initial work done by
.An Sujal Patel .
@ -190,3 +89,4 @@ The
.Nm
driver first appeared in
.Fx 2.2.5 .
It has been substantially updated in subsequent versions.

View File

@ -0,0 +1,87 @@
.\"
.\" Copyright (c) 2001
.\" Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
.\" All rights reserved.
.\"
.\" 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 as
.\" the first lines of this file unmodified.
.\" 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 AUTHOR ``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 AUTHOR 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.
.\"
.\" $FreeBSD$
.Dd September 20, 2001
.Dt PNPBIOS 4 i386
.Os
.Sh NAME
.Nm pnpbios
.Nd support for embedded devices on the motherboard
.Sh DESCRIPTION
The
.Nm
driver enumerates embedded ISA devices on the motherboard whose BIOS
supports ``Plug and Play BIOS Specification''.
It assigns ISA bus resources (interrupt line, DMA channel, I/O ports,
and memory region) to each device and activates it.
.Pp
If it cannot assign necessary resources to a device without
causing conflict with other devices in the system,
the device will not be activated and will be unavailable
to programs.
.Sh CAVEAT
There is no explicit way to disable individual embedded devices.
The
.Nm
driver will find all devices reported by the ``Plug and Play (PnP)''
BIOS and try to activate them all.
.Pp
There is no way to explicitly assign particular resource to a device.
The resource assignment is fully automatic and there is
no provision for manual override.
.Sh SEE ALSO
.Xr pnp 4
.Pp
.Sh STANDARDS
.Rs
.%A Compaq
.%A Phenix
.%A Intel
.%T ``Plug and Play BIOS Specification Version 1.0A''
.%D May 5, 1994
.Re
.Pp
.Rs
.%A Compaq
.%A Phenix
.%A Intel
.%T ``Plug and Play BIOS CLARIFICATION Paper \
for Plug and Play BIOS Specification Version 1.0A''
.%D October 6, 1994
.Re
.Pp
.Sh HISTORY
The
.Nm
driver first appeared in
.Fx 4.0 .
.Pp
.Sh AUTHORS
The
.Nm
driver was written by
.An Mike Smith .