Deleted Added
full compact
bt_isa.c (40265) bt_isa.c (41048)
1/*
2 * Product specific probe and attach routines for:
3 * Buslogic BT-54X and BT-445 cards
4 *
5 * Copyright (c) 1998 Justin T. Gibbs
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*
2 * Product specific probe and attach routines for:
3 * Buslogic BT-54X and BT-445 cards
4 *
5 * Copyright (c) 1998 Justin T. Gibbs
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $Id: bt_isa.c,v 1.3 1998/10/10 00:44:12 imp Exp $
29 * $Id: bt_isa.c,v 1.4 1998/10/12 18:53:33 imp Exp $
30 */
31
32#include <sys/param.h>
33#include <sys/systm.h>
34
35#include <machine/bus_pio.h>
36#include <machine/bus.h>
37

--- 43 unchanged lines hidden (view full) ---

81
82 bt = NULL;
83 port_index = 0;
84 max_port_index = BT_NUM_ISAPORTS - 1;
85 /*
86 * Bound our board search if the user has
87 * specified an exact port.
88 */
30 */
31
32#include <sys/param.h>
33#include <sys/systm.h>
34
35#include <machine/bus_pio.h>
36#include <machine/bus.h>
37

--- 43 unchanged lines hidden (view full) ---

81
82 bt = NULL;
83 port_index = 0;
84 max_port_index = BT_NUM_ISAPORTS - 1;
85 /*
86 * Bound our board search if the user has
87 * specified an exact port.
88 */
89 if (dev->id_iobase > 0) {
90 for (;port_index <= max_port_index; port_index++)
91 if (dev->id_iobase >= bt_isa_ports[port_index].addr)
92 break;
93 if ((port_index > max_port_index)
94 || (dev->id_iobase != bt_isa_ports[port_index].addr)) {
95 printf("
96bt_isa_probe: Invalid baseport of 0x%x specified.
97bt_isa_probe: Nearest valid baseport is 0x%x.
98bt_isa_probe: Failing probe.\n",
99 dev->id_iobase,
100 (port_index <= max_port_index)
101 ? bt_isa_ports[port_index].addr
102 : bt_isa_ports[max_port_index].addr);
103 return 0;
104 }
105 max_port_index = port_index;
106 }
89 bt_find_probe_range(dev->id_iobase, &port_index, &max_port_index);
107
90
91 if (port_index < 0)
92 return 0;
93
108 /* Attempt to find an adapter */
109 for (;port_index <= max_port_index; port_index++) {
110 config_data_t config_data;
111 u_int ioport;
112 int error;
113
94 /* Attempt to find an adapter */
95 for (;port_index <= max_port_index; port_index++) {
96 config_data_t config_data;
97 u_int ioport;
98 int error;
99
114 ioport = bt_isa_ports[port_index].addr;
100 ioport = bt_iop_from_bio(port_index);
115
116 /*
117 * Ensure this port has not already been claimed already
118 * by a PCI, EISA or ISA adapter.
119 */
120 if (bt_check_probed_iop(ioport) != 0)
121 continue;
101
102 /*
103 * Ensure this port has not already been claimed already
104 * by a PCI, EISA or ISA adapter.
105 */
106 if (bt_check_probed_iop(ioport) != 0)
107 continue;
122 dev->id_iobase = bt_isa_ports[port_index].addr;
108 dev->id_iobase = ioport;
123 if (haveseen_isadev(dev, CC_IOADDR | CC_QUIET))
124 continue;
125
126 /* Allocate a softc for use during probing */
127 bt = bt_alloc(dev->id_unit, I386_BUS_SPACE_IO, ioport);
128
129 if (bt == NULL)
130 break;

--- 33 unchanged lines hidden (view full) ---

164 break;
165 case DMA_CHAN_7:
166 dev->id_drq = 7;
167 break;
168 default:
169 printf("bt_isa_probe: Invalid DMA setting "
170 "detected for adapter at 0x%x. "
171 "Failing probe\n", ioport);
109 if (haveseen_isadev(dev, CC_IOADDR | CC_QUIET))
110 continue;
111
112 /* Allocate a softc for use during probing */
113 bt = bt_alloc(dev->id_unit, I386_BUS_SPACE_IO, ioport);
114
115 if (bt == NULL)
116 break;

--- 33 unchanged lines hidden (view full) ---

150 break;
151 case DMA_CHAN_7:
152 dev->id_drq = 7;
153 break;
154 default:
155 printf("bt_isa_probe: Invalid DMA setting "
156 "detected for adapter at 0x%x. "
157 "Failing probe\n", ioport);
158 return (0);
172 }
173 } else {
174 /* VL DMA */
175 dev->id_drq = -1;
176 }
177 dev->id_irq = (config_data.irq << 9);
178 dev->id_intr = bt_isa_intr;
179

--- 145 unchanged lines hidden ---
159 }
160 } else {
161 /* VL DMA */
162 dev->id_drq = -1;
163 }
164 dev->id_irq = (config_data.irq << 9);
165 dev->id_intr = bt_isa_intr;
166

--- 145 unchanged lines hidden ---