Merge from vendor branch BINUTILS:
[dragonfly.git] / sys / bus / cam / scsi / scsi_low_pisa.c
1 /*      $FreeBSD: src/sys/cam/scsi/scsi_low_pisa.c,v 1.2.2.4 2001/12/17 13:30:20 non Exp $      */
2 /*      $DragonFly: src/sys/bus/cam/scsi/scsi_low_pisa.c,v 1.5 2004/09/17 01:50:06 joerg Exp $  */
3 /*      $NecBSD: scsi_low_pisa.c,v 1.13 1998/11/26 14:26:11 honda Exp $ */
4 /*      $NetBSD$        */
5
6 /*
7  * [NetBSD for NEC PC-98 series]
8  *  Copyright (c) 1995, 1996, 1997, 1998
9  *      NetBSD/pc98 porting staff. All rights reserved.
10  *  Copyright (c) 1995, 1996, 1997, 1998
11  *      Naofumi HONDA. All rights reserved.
12  * 
13  *  Redistribution and use in source and binary forms, with or without
14  *  modification, are permitted provided that the following conditions
15  *  are met:
16  *  1. Redistributions of source code must retain the above copyright
17  *     notice, this list of conditions and the following disclaimer.
18  *  2. Redistributions in binary form must reproduce the above copyright
19  *     notice, this list of conditions and the following disclaimer in the
20  *     documentation and/or other materials provided with the distribution.
21  *  3. The name of the author may not be used to endorse or promote products
22  *     derived from this software without specific prior written permission.
23  * 
24  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
28  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  */
36
37 #include <sys/param.h>
38 #include <sys/systm.h>
39 #include <sys/kernel.h>
40 #include <sys/buf.h>
41 #include <sys/queue.h>
42 #include <sys/device_port.h>
43 #include <sys/module.h>
44
45 #include <bus/cam/scsi/scsi_low.h>
46 #include <bus/cam/scsi/scsi_low_pisa.h>
47
48 int
49 scsi_low_deactivate_pisa(sc)
50         struct scsi_low_softc *sc;
51 {
52
53         if (scsi_low_deactivate(sc) != 0)
54                 return EBUSY;
55         return 0;
56 }
57
58 int
59 scsi_low_activate_pisa(sc, flags)
60         struct scsi_low_softc *sc;
61         int flags;
62 {
63
64         sc->sl_cfgflags = ((sc->sl_cfgflags & 0xffff0000) |
65                            (flags & 0x00ff));
66
67         if (scsi_low_activate(sc) != 0)
68                 return EBUSY;
69         return 0;
70 }
71
72 static moduledata_t scsi_low_moduledata = {
73         "scsi_low",
74         NULL,
75         NULL
76 };
77
78 DECLARE_MODULE(scsi_low, scsi_low_moduledata, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
79 MODULE_VERSION(scsi_low, 1);
80 MODULE_DEPEND(scsi_low, cam, 1, 1, 1);