ISAPNP(9) BSD Kernel Developer's Manual ISAPNP(9)
ISAPNP, isapnp_devmatch, isapnp_config, isapnp_unconfig -- Plug 'n' Play ISA bus
isapnp_devmatch(const struct isapnp_attach_args *ipa, const struct isapnp_devinfo *dinfo,
isapnp_config(bus_space_tag_t iot, bus_space_tag_t memt, struct isapnp_attach_args *ipa);
isapnp_unconfig(bus_space_tag_t iot, bus_space_tag_t memt, struct isapnp_attach_args *ipa);
The machine-independent ISAPNP subsystem provides support for ISAPNP devices. ISAPNP
devices were developed to support "plug and play" connection on the ISA bus. In all other
aspects, the ISAPNP bus is same as the ISA bus (see isa(9)).
Devices on the ISAPNP bus are uniquely identified by a 7-character string. Resources, such
as I/O address space and interrupts, should be allocated to the devices by the machine
firmware. On some machine the firmware seems doesn't work correctly and NetBSD will attempt
to allocate resources as necessary.
Drivers attached to the ISAPNP bus will make use of the following data types:
NetBSD kernel contains a database of known ISAPNP devices. Each entry in the data-
base has a struct isapnp_matchinfo. It contains the following members:
const char *name; /* device id string */
int variant; /* variant flag */
Defines the devices supported by a driver. It contains pointer to an array of sup-
ported struct isapnp_matchinfo structures and a pointer to another array of compat-
ibility devices. It contains the following members:
struct isapnp_matchinfo *devlogic;
struct isapnp_matchinfo *devcompat;
Describes ISAPNP bus-space regions. It contains the following members:
Describes the wiring of interrupts and DMA pins from the ISAPNP bus onto the host
processor. It contains the following members:
A structure used to inform the driver of the device properties. It contains the
bus_space_tag_t ipa_iot; /* isa i/o space tag */
bus_space_tag_t ipa_memt; /* isa mem space tag */
bus_dma_tag_t ipa_dmat; /* isa dma tag */
struct isapnp_region ipa_io[ISAPNP_NUM_IO];
struct isapnp_region ipa_mem[ISAPNP_NUM_MEM];
struct isapnp_region ipa_mem32[ISAPNP_NUM_MEM32];
struct isapnp_pin ipa_irq[ISAPNP_NUM_IRQ];
struct isapnp_pin ipa_drq[ISAPNP_NUM_DRQ];
isapnp_devmatch(ipa, dinfo, variant)
Matches the device described by the attachment ipa with the device-match informa-
tion in dinfo. If the device is matched, isapnp_devmatch() returns a non-zero
value and variant is the flag describing the device variant. isapnp_devmatch()
returns zero if the device is not found.
isapnp_config(iot, memt, ipa)
Allocate device resources specified by ipa. The device is mapped into the I/O and
memory bus spaces specified by bus-space tags iot and memt respectively. The
ipa_io, ipa_mem, ipa_mem32, ipa_irq, and ipa_drq members of ipa are updated to
reflect the allocated and mapped resources. isapnp_config() returns zero on suc-
cess and non-zero on error.
isapnp_unconfig(iot, memt, ipa)
Free the resources allocated by isapnp_config().
During autoconfiguration, an ISAPNP driver will receive a pointer to struct
isapnp_attach_args describing the device attached to the ISAPNP bus. Drivers match the
device using ispnp_devmatch().
During the driver attach step, driver should initially allocate and map resources using
isapnp_config(). The I/O (memory) bus-space resources can be accessed using the bus-space
tag ipa_iot (ipa_memt) and the bus-space handle ipa_io.h (ipa_mem.h) members of ipa.
Interrupts should be established using isa_intr_establish() (see isa(9)) with the IRQ speci-
fied by the ipa_irq.num member of ipa. Similarly, the standard isa(9) DMA interface
should be used with the ipa_drq.num member of ipa.
Extensive DMA facilities are provided through the isa(9) DMA facilities.
The ISAPNP subsystem itself is implemented within the file sys/dev/isapnp/isapnp.c. The
database of the known devices exists within the file sys/dev/isapnp/isapnpdevs.c and is gen-
erated automatically from the file sys/dev/isapnp/isapnpdevs. New devices should be added
to this file. The database can be regenerated using the Makefile
isa(4), isapnp(4), pnpbios(4), autoconf(9), bus_dma(9), bus_space(9), driver(9), isa(9)
Plug and Play ISA Specification V1.0a, May 5 1994.
The machine-independent ISAPNP subsystem appear in NetBSD 1.3.
BSD June 19, 2001 BSD