summaryrefslogtreecommitdiffstats
path: root/sys/dev/buslogic
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1999-03-08 21:32:59 +0000
committergibbs <gibbs@FreeBSD.org>1999-03-08 21:32:59 +0000
commit2acdad816e85b71ba4964508785490c59b972384 (patch)
tree7fbc57aadb3d285e1e97ec0a7fd6a492996ef68c /sys/dev/buslogic
parentf08849c7008c941476553006fc3248cae0b3daaa (diff)
downloadFreeBSD-src-2acdad816e85b71ba4964508785490c59b972384.zip
FreeBSD-src-2acdad816e85b71ba4964508785490c59b972384.tar.gz
Pull 'ISA style' probe where interrupt information is determined through
commands sent to card, into the base driver module. It is now used for EISA board probes too.
Diffstat (limited to 'sys/dev/buslogic')
-rw-r--r--sys/dev/buslogic/bt_isa.c50
1 files changed, 7 insertions, 43 deletions
diff --git a/sys/dev/buslogic/bt_isa.c b/sys/dev/buslogic/bt_isa.c
index f646f85..0601e4b 100644
--- a/sys/dev/buslogic/bt_isa.c
+++ b/sys/dev/buslogic/bt_isa.c
@@ -2,7 +2,7 @@
* Product specific probe and attach routines for:
* Buslogic BT-54X and BT-445 cards
*
- * Copyright (c) 1998 Justin T. Gibbs
+ * Copyright (c) 1998, 1999 Justin T. Gibbs
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bt_isa.c,v 1.4 1998/10/12 18:53:33 imp Exp $
+ * $Id: bt_isa.c,v 1.5 1998/11/10 06:44:54 gibbs Exp $
*/
#include <sys/param.h>
@@ -93,9 +93,8 @@ bt_isa_probe(dev)
/* Attempt to find an adapter */
for (;port_index <= max_port_index; port_index++) {
- config_data_t config_data;
+ struct bt_probe_info info;
u_int ioport;
- int error;
ioport = bt_iop_from_bio(port_index);
@@ -118,50 +117,15 @@ bt_isa_probe(dev)
/* We're going to attempt to probe it now, so mark it probed */
bt_mark_probed_bio(port_index);
- /* See if there is really a card present */
- if (bt_probe(bt) || bt_fetch_adapter_info(bt)) {
- bt_free(bt);
- continue;
- }
-
- /*
- * Determine our IRQ, and DMA settings and
- * export them to the configuration system.
- */
- error = bt_cmd(bt, BOP_INQUIRE_CONFIG, NULL, /*parmlen*/0,
- (u_int8_t*)&config_data, sizeof(config_data),
- DEFAULT_CMD_TIMEOUT);
- if (error != 0) {
- printf("bt_isa_probe: Could not determine IRQ or DMA "
- "settings for adapter at 0x%x. Failing probe\n",
+ if (bt_port_probe(bt, &info) != 0) {
+ printf("bt_isa_probe: Probe failled for card at 0x%x\n",
ioport);
bt_free(bt);
continue;
}
- if (bt->model[0] == '5') {
- /* DMA settings only make sense for ISA cards */
- switch (config_data.dma_chan) {
- case DMA_CHAN_5:
- dev->id_drq = 5;
- break;
- case DMA_CHAN_6:
- dev->id_drq = 6;
- break;
- case DMA_CHAN_7:
- dev->id_drq = 7;
- break;
- default:
- printf("bt_isa_probe: Invalid DMA setting "
- "detected for adapter at 0x%x. "
- "Failing probe\n", ioport);
- return (0);
- }
- } else {
- /* VL DMA */
- dev->id_drq = -1;
- }
- dev->id_irq = (config_data.irq << 9);
+ dev->id_drq = info.drq;
+ dev->id_irq = 0x1 << info.irq;
dev->id_intr = bt_isa_intr;
bt_unit++;
OpenPOWER on IntegriCloud