1 /* $NecBSD: scsi_low_pisa.c,v 1.13.18.1 2001/06/08 06:27:48 honda Exp $ */
4 * [NetBSD for NEC PC-98 series]
5 * Copyright (c) 1995, 1996, 1997, 1998
6 * NetBSD/pc98 porting staff. All rights reserved.
7 * Copyright (c) 1995, 1996, 1997, 1998
8 * Naofumi HONDA. All rights reserved.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
34 #include <sys/cdefs.h>
35 __FBSDID("$FreeBSD$");
38 #include <sys/param.h>
39 #include <sys/systm.h>
40 #include <sys/kernel.h>
41 #include <sys/device.h>
42 #include <sys/errno.h>
44 #include <machine/bus.h>
45 #include <machine/intr.h>
47 #include <dev/isa/isareg.h>
48 #include <dev/isa/isavar.h>
50 #include <dev/isa/pisaif.h>
52 #include <machine/dvcfg.h>
54 #include <dev/scsipi/scsi_all.h>
55 #include <dev/scsipi/scsipi_all.h>
56 #include <dev/scsipi/scsiconf.h>
57 #include <dev/scsipi/scsi_disk.h>
59 #include <i386/Cbus/dev/scsi_low.h>
60 #include <i386/Cbus/dev/scsi_low_pisa.h>
62 #define SCSIBUS_RESCAN
65 scsi_low_deactivate_pisa(dh)
66 pisa_device_handle_t dh;
68 struct scsi_low_softc *sc = PISA_DEV_SOFTC(dh);
70 if (scsi_low_deactivate(sc) != 0)
76 scsi_low_activate_pisa(dh)
77 pisa_device_handle_t dh;
79 struct scsi_low_softc *sc = PISA_DEV_SOFTC(dh);
80 slot_device_res_t dr = PISA_RES_DR(dh);
82 sc->sl_cfgflags = DVCFG_MKCFG(DVCFG_MAJOR(sc->sl_cfgflags), \
83 DVCFG_MINOR(PISA_DR_DVCFG(dr)));
84 sc->sl_irq = PISA_DR_IRQ(dr);
86 if (scsi_low_activate(sc) != 0)
89 /* rescan the scsi bus */
91 if (scsi_low_is_busy(sc) == 0 &&
92 PISA_RES_EVENT(dh) == PISA_EVENT_INSERT)
93 scsi_probe_busses((int) sc->sl_si.si_splp->scsipi_scsi.scsibus,
100 scsi_low_notify_pisa(dh, ev)
101 pisa_device_handle_t dh;
104 struct scsi_low_softc *sc = PISA_DEV_SOFTC(dh);
108 case PISA_EVENT_QUERY_SUSPEND:
109 if (scsi_low_is_busy(sc) != 0)
110 return SD_EVENT_STATUS_BUSY;
118 #endif /* __NetBSD__ */
121 #include <sys/param.h>
122 #include <sys/systm.h>
123 #include <sys/kernel.h>
124 #if __FreeBSD_version >= 500001
128 #include <sys/queue.h>
129 #include <sys/device_port.h>
130 #include <sys/module.h>
132 #include <cam/scsi/scsi_low.h>
133 #include <cam/scsi/scsi_low_pisa.h>
136 scsi_low_deactivate_pisa(sc)
137 struct scsi_low_softc *sc;
140 if (scsi_low_deactivate(sc) != 0)
146 scsi_low_activate_pisa(sc, flags)
147 struct scsi_low_softc *sc;
151 sc->sl_cfgflags = ((sc->sl_cfgflags & 0xffff0000) |
154 if (scsi_low_activate(sc) != 0)
159 static moduledata_t scsi_low_moduledata = {
165 DECLARE_MODULE(scsi_low, scsi_low_moduledata, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
166 MODULE_VERSION(scsi_low, 1);
167 MODULE_DEPEND(scsi_low, cam, 1, 1, 1);
168 #endif /* __FreeBSD__ */