1 /* $FreeBSD: src/sys/cam/scsi/scsi_low_pisa.c,v 1.2.2.4 2001/12/17 13:30:20 non Exp $ */
2 /* $NecBSD: scsi_low_pisa.c,v 1.13 1998/11/26 14:26:11 honda Exp $ */
6 * [NetBSD for NEC PC-98 series]
7 * Copyright (c) 1995, 1996, 1997, 1998
8 * NetBSD/pc98 porting staff. All rights reserved.
9 * Copyright (c) 1995, 1996, 1997, 1998
10 * Naofumi HONDA. All rights reserved.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. The name of the author may not be used to endorse or promote products
21 * derived from this software without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
27 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
37 #include <sys/param.h>
38 #include <sys/systm.h>
39 #include <sys/kernel.h>
40 #include <sys/device.h>
41 #include <sys/errno.h>
43 #include <machine/bus.h>
44 #include <machine/intr.h>
46 #include <dev/isa/isareg.h>
47 #include <dev/isa/isavar.h>
49 #include <dev/isa/pisaif.h>
51 #include <machine/dvcfg.h>
53 #include <dev/scsipi/scsi_all.h>
54 #include <dev/scsipi/scsipi_all.h>
55 #include <dev/scsipi/scsiconf.h>
56 #include <dev/scsipi/scsi_disk.h>
58 #include <i386/Cbus/dev/scsi_low.h>
59 #include <i386/Cbus/dev/scsi_low_pisa.h>
61 #define SCSIBUS_RESCAN
64 scsi_low_deactivate_pisa(dh)
65 pisa_device_handle_t dh;
67 struct scsi_low_softc *sc = PISA_DEV_SOFTC(dh);
69 if (scsi_low_deactivate(sc) != 0)
75 scsi_low_activate_pisa(dh)
76 pisa_device_handle_t dh;
78 struct scsi_low_softc *sc = PISA_DEV_SOFTC(dh);
79 slot_device_res_t dr = PISA_RES_DR(dh);
81 sc->sl_cfgflags = DVCFG_MKCFG(DVCFG_MAJOR(sc->sl_cfgflags), \
82 DVCFG_MINOR(PISA_DR_DVCFG(dr)));
83 sc->sl_irq = PISA_DR_IRQ(dr);
85 if (scsi_low_activate(sc) != 0)
88 /* rescan the scsi bus */
90 if (scsi_low_is_busy(sc) == 0 &&
91 PISA_RES_EVENT(dh) == PISA_EVENT_INSERT)
92 scsi_probe_busses((int) sc->sl_si.si_splp->scsipi_scsi.scsibus,
99 scsi_low_notify_pisa(dh, ev)
100 pisa_device_handle_t dh;
103 struct scsi_low_softc *sc = PISA_DEV_SOFTC(dh);
107 case PISA_EVENT_QUERY_SUSPEND:
108 if (scsi_low_is_busy(sc) != 0)
109 return SD_EVENT_STATUS_BUSY;
117 #endif /* __NetBSD__ */
120 #include <sys/param.h>
121 #include <sys/systm.h>
122 #include <sys/kernel.h>
123 #if __FreeBSD_version >= 500001
127 #include <sys/queue.h>
128 #include <sys/device_port.h>
129 #include <sys/module.h>
131 #include <cam/scsi/scsi_low.h>
132 #include <cam/scsi/scsi_low_pisa.h>
135 scsi_low_deactivate_pisa(sc)
136 struct scsi_low_softc *sc;
139 if (scsi_low_deactivate(sc) != 0)
145 scsi_low_activate_pisa(sc, flags)
146 struct scsi_low_softc *sc;
150 sc->sl_cfgflags = ((sc->sl_cfgflags & 0xffff0000) |
153 if (scsi_low_activate(sc) != 0)
158 static moduledata_t scsi_low_moduledata = {
164 DECLARE_MODULE(scsi_low, scsi_low_moduledata, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
165 MODULE_VERSION(scsi_low, 1);
166 MODULE_DEPEND(scsi_low, cam, 1, 1, 1);
167 #endif /* __FreeBSD__ */