147398Sdfr/*-
247398Sdfr * Copyright (c) 1999 Doug Rabson
347398Sdfr * All rights reserved.
447398Sdfr *
547398Sdfr * Redistribution and use in source and binary forms, with or without
647398Sdfr * modification, are permitted provided that the following conditions
747398Sdfr * are met:
847398Sdfr * 1. Redistributions of source code must retain the above copyright
947398Sdfr *    notice, this list of conditions and the following disclaimer.
1047398Sdfr * 2. Redistributions in binary form must reproduce the above copyright
1147398Sdfr *    notice, this list of conditions and the following disclaimer in the
1247398Sdfr *    documentation and/or other materials provided with the distribution.
1347398Sdfr *
1447398Sdfr * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1547398Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1647398Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1747398Sdfr * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1847398Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1947398Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2047398Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2147398Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2247398Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2347398Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2447398Sdfr * SUCH DAMAGE.
2547398Sdfr *
2650477Speter * $FreeBSD$
2747398Sdfr */
2847398Sdfr
2947398Sdfr/*
3047398Sdfr * Parts of the ISA bus implementation common to all architectures.
3147398Sdfr *
3247398Sdfr * Drivers must not depend on information in this file as it can change
3347398Sdfr * without notice.
3447398Sdfr */
3547398Sdfr
3647398Sdfr/*
3750769Sdfr * PNP configurations are kept in a tailq.
3850769Sdfr */
3960938SjakeTAILQ_HEAD(isa_config_list, isa_config_entry);
4050769Sdfrstruct isa_config_entry {
4160938Sjake	TAILQ_ENTRY(isa_config_entry) ice_link;
4250769Sdfr	int			ice_priority;
4350769Sdfr	struct isa_config	ice_config;
4450769Sdfr};
4550769Sdfr
4650769Sdfr/*
4747398Sdfr * The structure used to attach devices to the isa bus.
4847398Sdfr */
4947398Sdfrstruct isa_device {
5047398Sdfr	struct resource_list	id_resources;
51139273Simp	uint32_t		id_vendorid; /* pnp vendor id */
52139273Simp	uint32_t		id_serial; /* pnp serial */
53139273Simp	uint32_t		id_logicalid; /* pnp logical device id */
54139273Simp	uint32_t		id_compatid; /* pnp compat device id */
5550769Sdfr	struct isa_config_list	id_configs; /* pnp config alternatives */
5650769Sdfr	isa_config_cb		*id_config_cb; /* callback function */
5750769Sdfr	void			*id_config_arg;	/* callback argument */
5882863Syokota	int			id_config_attr;	/* pnp config attributes */
59184564Simp	int			id_pnpbios_handle; /* pnp handle, if any */
60184564Simp	int			id_pnp_csn; /* pnp Card Number */
61184564Simp	int			id_pnp_ldn; /* pnp Logical device on card */
62185059Sjhb	int			id_order;
6347398Sdfr};
6447398Sdfr
6547398Sdfr#define DEVTOISA(dev)	((struct isa_device *) device_get_ivars(dev))
6647398Sdfr
6747398Sdfr/*
6847398Sdfr * These functions are architecture dependant.
6947398Sdfr */
7088376Stmmextern void isa_init(device_t dev);
7147398Sdfrextern struct resource *isa_alloc_resource(device_t bus, device_t child,
72139273Simp    int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
7347398Sdfrextern int isa_release_resource(device_t bus, device_t child,
74139273Simp    int type, int rid, struct resource *r);
7547398Sdfr
76139279Simpextern driver_t isa_driver;
77139279Simpextern devclass_t isa_devclass;
78