xref: /freebsd/share/man/man4/man4.i386/pnp.4 (revision 4e86fcacf69e8dac21f67db61babdcae80903dc2)
127495372SJohn-Mark Gurney.\" pnp(4) - manual page for the scanner device driver `asc'
227495372SJohn-Mark Gurney.\"
327495372SJohn-Mark Gurney.\"
427495372SJohn-Mark Gurney.\" Copyright (c) 1997 Luigi Rizzo
527495372SJohn-Mark Gurney.\"
627495372SJohn-Mark Gurney.\" Redistribution and use in source and binary forms, with or without
727495372SJohn-Mark Gurney.\" modification, are permitted provided that the following conditions
827495372SJohn-Mark Gurney.\" are met:
927495372SJohn-Mark Gurney.\" 1. Redistributions of source code must retain the above copyright
1027495372SJohn-Mark Gurney.\"    notice, this list of conditions and the following disclaimer.
1127495372SJohn-Mark Gurney.\" 2. Redistributions in binary form must reproduce the above copyright
1227495372SJohn-Mark Gurney.\"    notice, this list of conditions and the following disclaimer in the
1327495372SJohn-Mark Gurney.\"    documentation and/or other materials provided with the distribution.
1427495372SJohn-Mark Gurney.\" 3. All advertising materials mentioning features or use of this software
1527495372SJohn-Mark Gurney.\"    must display the following acknowledgements:
1627495372SJohn-Mark Gurney.\"	This product includes software developed by Luigi Rizzo.
1727495372SJohn-Mark Gurney.\" 4. The name of the author may not be used to endorse or promote products
1827495372SJohn-Mark Gurney.\"    derived from this software without specific prior written permission.
1927495372SJohn-Mark Gurney.\"
2027495372SJohn-Mark Gurney.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2127495372SJohn-Mark Gurney.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2227495372SJohn-Mark Gurney.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2327495372SJohn-Mark Gurney.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2427495372SJohn-Mark Gurney.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2527495372SJohn-Mark Gurney.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2627495372SJohn-Mark Gurney.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2727495372SJohn-Mark Gurney.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2827495372SJohn-Mark Gurney.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2927495372SJohn-Mark Gurney.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3027495372SJohn-Mark Gurney.\"
317f3dea24SPeter Wemm.\" $FreeBSD$
3227495372SJohn-Mark Gurney.\"
3327495372SJohn-Mark Gurney.Dd September 7, 1997
3427495372SJohn-Mark Gurney.Dt PNP 4 i386
3527495372SJohn-Mark Gurney.Os FreeBSD
3627495372SJohn-Mark Gurney.Sh NAME
3727495372SJohn-Mark Gurney.Nm pnp
3827495372SJohn-Mark Gurney.Nd support for PnP devices
3927495372SJohn-Mark Gurney.Sh SYNOPSIS
4027495372SJohn-Mark Gurney.Cd controller pnp0
4127495372SJohn-Mark Gurney.Sh DESCRIPTION
4227495372SJohn-Mark GurneySupport for PnP devices in FreeBSD allows the user to override the
4327495372SJohn-Mark Gurneyconfiguration of PnP cards, and device drivers to fetch/modify
4427495372SJohn-Mark Gurneyparameters in the card's configuration space.
4527495372SJohn-Mark Gurney.Pp
4627495372SJohn-Mark GurneyThe manual override mechanism requires the kernel to be compiled with
4727495372SJohn-Mark Gurney.Cd options USERCONFIG.
4827495372SJohn-Mark GurneyIn this case, the kernel keeps a table of fixed size (20 entries as a
494e86fcacSSheldon Hearndefault) where configuration data are held for PnP devices.
504e86fcacSSheldon HearnEach
5127495372SJohn-Mark GurneyPnP card can contain several independent devices (5 or 6 is not
5227495372SJohn-Mark Gurneyunusual).
5327495372SJohn-Mark Gurney.Pp
5427495372SJohn-Mark GurneyBy booting the kernel with the
5527495372SJohn-Mark Gurney.Dq Fl c
5627495372SJohn-Mark Gurneyflag, commands are available to
574e86fcacSSheldon Hearnmodify the configuration of PnP cards.
584e86fcacSSheldon HearnCommands start with the
5927495372SJohn-Mark Gurneysequence:
6027495372SJohn-Mark Gurney.Dl pnp CSN LDN
6127495372SJohn-Mark Gurneywhere CSN and LDN are the Card Select Number and Logical Device Number
624e86fcacSSheldon Hearnassociated to the device.
634e86fcacSSheldon HearnFollowing this sequence any combination of
6427495372SJohn-Mark Gurneythe following commands can be used:
6527495372SJohn-Mark Gurney
6627495372SJohn-Mark Gurney.Bl -tag -width "mmmmmmmmmm""
6727495372SJohn-Mark Gurney.It Dv irqN line
684e86fcacSSheldon HearnSets the irq line for interrupt 0 or 1 on the card.
694e86fcacSSheldon HearnLine=0 means the line
7027495372SJohn-Mark Gurneyis unused.
7127495372SJohn-Mark Gurney.It Dv drqN n
724e86fcacSSheldon HearnSets the drq channel used for DMA 0 or 1 on the card.
734e86fcacSSheldon HearnChannel=4 means
7427495372SJohn-Mark Gurneythe channel is unused.
7527495372SJohn-Mark Gurney.It Dv portN address
7627495372SJohn-Mark GurneySets the base address for the N-th port's range (N=0..7). address=0
7727495372SJohn-Mark Gurneymeans that the port is not used.
7827495372SJohn-Mark Gurney.It Dv memN address
7927495372SJohn-Mark GurneySets the base address for the N-th memory's range (N=0..3). address=0
8027495372SJohn-Mark Gurneymeans that the memory range is not used.
8127495372SJohn-Mark Gurney.It Dv bios
824e86fcacSSheldon HearnMakes the PnP device use the configuration set by the BIOS.
834e86fcacSSheldon HearnThis
8427495372SJohn-Mark Gurneyis the default, and is generally ok if your BIOS has PnP support.
8527495372SJohn-Mark GurneyIf BIOS is used, then other parameters are ignored except "flags".
8627495372SJohn-Mark Gurney.It Dv os
8727495372SJohn-Mark GurneyMakes the PnP device to use the configuration specified in this entry.
8827495372SJohn-Mark Gurney.It Dv enable
8927495372SJohn-Mark GurneyEnables the PnP device.
9027495372SJohn-Mark Gurney.It Dv disable
9127495372SJohn-Mark GurneyDisables the PnP device.
9227495372SJohn-Mark Gurney.It Dv delete
9327495372SJohn-Mark GurneyFrees the entry used for the device, so that it can be used for
9427495372SJohn-Mark Gurneyanother device with a different CSN/LDN pair.
9527495372SJohn-Mark Gurney.It Dv flags
9627495372SJohn-Mark GurneySets the value of a 32-bit flags entry which is passed to the device
974e86fcacSSheldon Hearndriver.
984e86fcacSSheldon HearnThis can be used to set special operation modes (e.g. SB vs. WSS
9927495372SJohn-Mark Gurneyemulation on some sound cards, etc.).
10027495372SJohn-Mark Gurney.El
10127495372SJohn-Mark Gurney.Pp
10227495372SJohn-Mark GurneyThe current content of the table can be printed using the
10327495372SJohn-Mark Gurney.Ic ls
1044e86fcacSSheldon Hearncommand in userconfig.
1054e86fcacSSheldon HearnIn addition to modifications done by the user,
10627495372SJohn-Mark Gurneythe table contains an entry for
10727495372SJohn-Mark Gurneyall logical devices accessed by a PnP device driver.
10827495372SJohn-Mark Gurney.Pp
10927495372SJohn-Mark GurneyModifications to
11027495372SJohn-Mark Gurneythe table will be saved to the boot image on the filesystem by the
11150711a4dSJoseph Koshy.Xr kget 8
11227495372SJohn-Mark Gurneycommand.
11327495372SJohn-Mark Gurney.Pp
11427495372SJohn-Mark Gurney.Sh DEVICE DRIVER SUPPORT FOR PnP
11527495372SJohn-Mark GurneyPnP devices are automatically recognized and configured by the kernel.
11627495372SJohn-Mark GurneyA PnP device is identified by the following data structure:
11727495372SJohn-Mark Gurney.Bd -literal
11827495372SJohn-Mark Gurneystruct pnp_device {
11927495372SJohn-Mark Gurney	char	*pd_name;
12027495372SJohn-Mark Gurney	char	*(*pd_probe ) (u_long csn, u_long vendor_id);
12127495372SJohn-Mark Gurney	void	(*pd_attach ) (u_long csn, u_long vend_id, char * name,
12227495372SJohn-Mark Gurney		    struct isa_device *dev);
12327495372SJohn-Mark Gurney	u_long	*pd_count;
12427495372SJohn-Mark Gurney	u_int	*imask;
12527495372SJohn-Mark Gurney	struct	isa_device dev;
12627495372SJohn-Mark Gurney};
12727495372SJohn-Mark Gurney.Ed
12827495372SJohn-Mark Gurney.Pp
12927495372SJohn-Mark GurneyThe probe routine must check that the vendor_id passed is a
13027495372SJohn-Mark Gurneyrecognized one, that any necessary devices on the card are enabled,
13127495372SJohn-Mark Gurneyand returns a NULL value in case of failure or a non-NULL value
13227495372SJohn-Mark Gurney(generally a pointer to the device name) unpon success.  In the probe
13327495372SJohn-Mark Gurneyroutine, the function
13427495372SJohn-Mark Gurney.Fn read_pnp_parms
13527495372SJohn-Mark Gurneycan be used to check that the logical devices are enabled.
13627495372SJohn-Mark Gurney.Pp
13727495372SJohn-Mark GurneyThe attach routine should do all the necessary initialization, enable
13827495372SJohn-Mark Gurneythe PnP card to ISA accesses, fetch the configuration, and call the ISA
13927495372SJohn-Mark Gurneydriver for the device.
14027495372SJohn-Mark Gurney.Pp
14127495372SJohn-Mark GurneyThe following routines and data structures can be used:
14227495372SJohn-Mark Gurney.Bl -tag -width "xxxxxxxxxx"
14327495372SJohn-Mark Gurney.It Dv struct pnp_cinfo
14427495372SJohn-Mark GurneyThis data structure (defined in /sys/i386/isa/pnp.h) contains all
14527495372SJohn-Mark Gurneyinformations related to a PnP logical device.
14627495372SJohn-Mark Gurney.It Fn read_pnp_parms "struct pnp_cinfo *d" "int ldn"
14727495372SJohn-Mark GurneyThis function returns the configuration of the requested
1484e86fcacSSheldon Hearnlogical device.
1494e86fcacSSheldon HearnIt is not possible to specify a CSN since this function
15027495372SJohn-Mark Gurneyis only meant to be used during probe and attach routines
15127495372SJohn-Mark Gurney.It Fn write_pnp_parms "struct pnp_cinfo *d" "int ldn"
1524e86fcacSSheldon HearnThis function sets the parameters of the requested logical device.
1534e86fcacSSheldon HearnAt
15427495372SJohn-Mark Gurneythe same time, it updates the entry in the kernel override table.
15527495372SJohn-Mark GurneyDevice drivers in general should
15627495372SJohn-Mark Gurney.Em not
15727495372SJohn-Mark Gurneymodify the configuration of a device, since either the BIOS or the user
1584e86fcacSSheldon Hearn(through userconfig) should know better what to do.
1594e86fcacSSheldon HearnIn particular,
16027495372SJohn-Mark Gurneydevice driver
16127495372SJohn-Mark Gurney.Em should not enable
16227495372SJohn-Mark Gurneya logical device which has
16327495372SJohn-Mark Gurneybeen found disabled,
16427495372SJohn-Mark Gurneysince this would defeat the override mechanism in userconfig.
16527495372SJohn-Mark GurneyDevice
16627495372SJohn-Mark Gurneydrivers may disable a logical device, or a port range, etc, but should
16727495372SJohn-Mark Gurneydo so only that particular device or parameter is known to cause
16827495372SJohn-Mark Gurneytroubles.
16927495372SJohn-Mark Gurney.It Fn enable_pnp_card void
17027495372SJohn-Mark GurneyThis function
17127495372SJohn-Mark Gurney.Em must
17227495372SJohn-Mark Gurneybe used in the attach routine
17327495372SJohn-Mark Gurney.Em only ,
17427495372SJohn-Mark Gurneybefore accessing the card's ISA ports/memory address ranges.
17527495372SJohn-Mark Gurney.El
17627495372SJohn-Mark Gurney.Pp
17727495372SJohn-Mark Gurney.Sh SEE ALSO
17850711a4dSJoseph Koshy.Xr kget 8
17927495372SJohn-Mark Gurney.Sh BUGS
18027495372SJohn-Mark GurneyThere is no support for visual configuration of PnP devices.
18127495372SJohn-Mark GurneyIt would be nice to have commands in userconfig to fetch the
18227495372SJohn-Mark Gurneyconfiguration of PnP devices.
183aaf1f16eSPhilippe Charnier.Sh AUTHORS
184aaf1f16eSPhilippe CharnierPnP support was written by
185aaf1f16eSPhilippe Charnier.An Luigi Rizzo ,
186aaf1f16eSPhilippe Charnierbased on initial work done by
187aaf1f16eSPhilippe Charnier.An Sujal Patel .
18827495372SJohn-Mark Gurney.Sh HISTORY
18927495372SJohn-Mark GurneyThe
19027495372SJohn-Mark Gurney.Nm
19127495372SJohn-Mark Gurneydriver first appeared in
19227495372SJohn-Mark Gurney.Fx 2.2.5 .
193