aic7770.c (71717) | aic7770.c (74094) |
---|---|
1/* 2 * Product specific probe and attach routines for: 3 * 27/284X and aic7770 motherboard SCSI controllers 4 * 5 * Copyright (c) 1994-1998, 2000, 2001 Justin T. Gibbs. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 15 unchanged lines hidden (view full) --- 24 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * | 1/* 2 * Product specific probe and attach routines for: 3 * 27/284X and aic7770 motherboard SCSI controllers 4 * 5 * Copyright (c) 1994-1998, 2000, 2001 Justin T. Gibbs. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 15 unchanged lines hidden (view full) --- 24 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * |
32 * $Id: //depot/src/aic7xxx/aic7770.c#4 $ | 32 * $Id: //depot/src/aic7xxx/aic7770.c#8 $ |
33 * | 33 * |
34 * $FreeBSD: head/sys/dev/aic7xxx/aic7770.c 71717 2001-01-27 20:54:24Z gibbs $ | 34 * $FreeBSD: head/sys/dev/aic7xxx/aic7770.c 74094 2001-03-11 06:34:17Z gibbs $ |
35 */ 36 37#ifdef __linux__ 38#include "aic7xxx_linux.h" 39#include "aic7xxx_inline.h" 40#include "aic7xxx_93cx6.h" 41#endif 42 --- 53 unchanged lines hidden (view full) --- 96} 97 98int 99aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry) 100{ 101 struct ahc_probe_config probe_config; 102 int error; 103 u_int hostconf; | 35 */ 36 37#ifdef __linux__ 38#include "aic7xxx_linux.h" 39#include "aic7xxx_inline.h" 40#include "aic7xxx_93cx6.h" 41#endif 42 --- 53 unchanged lines hidden (view full) --- 96} 97 98int 99aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry) 100{ 101 struct ahc_probe_config probe_config; 102 int error; 103 u_int hostconf; |
104 u_int irq; 105 u_int intdef; |
|
104 105 ahc_init_probe_config(&probe_config); 106 error = entry->setup(ahc->dev_softc, &probe_config); 107 if (error != 0) 108 return (error); 109 110 error = aic7770_map_registers(ahc); 111 if (error != 0) 112 return (error); 113 114 probe_config.description = entry->name; 115 error = ahc_softc_init(ahc, &probe_config); 116 | 106 107 ahc_init_probe_config(&probe_config); 108 error = entry->setup(ahc->dev_softc, &probe_config); 109 if (error != 0) 110 return (error); 111 112 error = aic7770_map_registers(ahc); 113 if (error != 0) 114 return (error); 115 116 probe_config.description = entry->name; 117 error = ahc_softc_init(ahc, &probe_config); 118 |
117 error = aic7770_map_int(ahc); | 119 error = ahc_reset(ahc); |
118 if (error != 0) 119 return (error); 120 | 120 if (error != 0) 121 return (error); 122 |
121 error = ahc_reset(ahc); | 123 /* Make sure we have a valid interrupt vector */ 124 intdef = ahc_inb(ahc, INTDEF); 125 irq = intdef & VECTOR; 126 switch (irq) { 127 case 9: 128 case 10: 129 case 11: 130 case 12: 131 case 14: 132 case 15: 133 break; 134 default: 135 printf("aic7770_config: illegal irq setting %d\n", intdef); 136 return (ENXIO); 137 } 138 139 if ((intdef & EDGE_TRIG) != 0) 140 ahc->flags |= AHC_EDGE_INTERRUPT; 141 142 error = aic7770_map_int(ahc, irq); |
122 if (error != 0) 123 return (error); 124 125 switch (probe_config.chip & (AHC_EISA|AHC_VL)) { 126 case AHC_EISA: 127 { 128 u_int biosctrl; 129 u_int scsiconf; 130 u_int scsiconf1; 131 132 biosctrl = ahc_inb(ahc, HA_274_BIOSCTRL); 133 scsiconf = ahc_inb(ahc, SCSICONF); 134 scsiconf1 = ahc_inb(ahc, SCSICONF + 1); 135 136 /* Get the primary channel information */ 137 if ((biosctrl & CHANNEL_B_PRIMARY) != 0) | 143 if (error != 0) 144 return (error); 145 146 switch (probe_config.chip & (AHC_EISA|AHC_VL)) { 147 case AHC_EISA: 148 { 149 u_int biosctrl; 150 u_int scsiconf; 151 u_int scsiconf1; 152 153 biosctrl = ahc_inb(ahc, HA_274_BIOSCTRL); 154 scsiconf = ahc_inb(ahc, SCSICONF); 155 scsiconf1 = ahc_inb(ahc, SCSICONF + 1); 156 157 /* Get the primary channel information */ 158 if ((biosctrl & CHANNEL_B_PRIMARY) != 0) |
138 ahc->flags |= AHC_CHANNEL_B_PRIMARY; | 159 ahc->flags |= 1; |
139 140 if ((biosctrl & BIOSMODE) == BIOSDISABLED) { 141 ahc->flags |= AHC_USEDEFAULTS; 142 } else { 143 if ((ahc->features & AHC_WIDE) != 0) { 144 ahc->our_id = scsiconf1 & HWSCSIID; 145 if (scsiconf & TERM_ENB) 146 ahc->flags |= AHC_TERM_ENB_A; --- 181 unchanged lines hidden --- | 160 161 if ((biosctrl & BIOSMODE) == BIOSDISABLED) { 162 ahc->flags |= AHC_USEDEFAULTS; 163 } else { 164 if ((ahc->features & AHC_WIDE) != 0) { 165 ahc->our_id = scsiconf1 & HWSCSIID; 166 if (scsiconf & TERM_ENB) 167 ahc->flags |= AHC_TERM_ENB_A; --- 181 unchanged lines hidden --- |