summaryrefslogtreecommitdiffstats
path: root/sys/dev/buslogic
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-04-18 19:08:28 +0000
committerpeter <peter@FreeBSD.org>1999-04-18 19:08:28 +0000
commitb10162efe5f853c7e4ede70e544bc06f1c16bee4 (patch)
tree2e7e29cc11d0e9f5c5d4c55f699b95fe6f2e8e06 /sys/dev/buslogic
parent886743eeea2e1af6623be80765a03ac7c375f515 (diff)
downloadFreeBSD-src-b10162efe5f853c7e4ede70e544bc06f1c16bee4.zip
FreeBSD-src-b10162efe5f853c7e4ede70e544bc06f1c16bee4.tar.gz
Make the bt isa driver work..
- fix cut/paste problem. :-) - don't forget to call isa_dmacascade() - reset the port after we release resources. That last one is a trap to watch out for.. The isa bus driver uses the same port/irq/mem/etc variables for the initial probe hints as it does for allocation/deallocation tracking. Releasing a resource clears the variable and then you loose the hint during attach.. (ouch!)
Diffstat (limited to 'sys/dev/buslogic')
-rw-r--r--sys/dev/buslogic/bt_isa.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/dev/buslogic/bt_isa.c b/sys/dev/buslogic/bt_isa.c
index 03c5c82..f9105ea 100644
--- a/sys/dev/buslogic/bt_isa.c
+++ b/sys/dev/buslogic/bt_isa.c
@@ -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.7 1999/04/06 21:15:18 phk Exp $
+ * $Id: bt_isa.c,v 1.8 1999/04/18 15:50:35 peter Exp $
*/
#include <sys/param.h>
@@ -105,9 +105,9 @@ bt_isa_release_resources(device_t dev)
if (bt->port)
bus_release_resource(dev, SYS_RES_IOPORT, 0, bt->port);
if (bt->irq)
- bus_release_resource(dev, SYS_RES_IOPORT, 0, bt->irq);
+ bus_release_resource(dev, SYS_RES_IRQ, 0, bt->irq);
if (bt->drq)
- bus_release_resource(dev, SYS_RES_IOPORT, 0, bt->drq);
+ bus_release_resource(dev, SYS_RES_DRQ, 0, bt->drq);
bt_free_softc(dev);
}
@@ -169,6 +169,7 @@ bt_isa_probe(device_t dev)
bt_isa_release_resources(dev);
+ isa_set_port(dev, ioport);
isa_set_drq(dev, info.drq);
isa_set_irq(dev, info.irq);
@@ -188,7 +189,7 @@ bt_isa_attach(device_t dev)
bus_dma_filter_t *filter;
void *filter_arg;
bus_addr_t lowaddr;
- int error;
+ int error, drq;
/* Initialise softc */
error = bt_isa_alloc_resources(dev);
@@ -197,6 +198,10 @@ bt_isa_attach(device_t dev)
return error;
}
+ /* Program the DMA channel for external control */
+ if ((drq = isa_get_drq(dev)) != -1)
+ isa_dmacascade(drq);
+
/* Allocate our parent dmatag */
filter = NULL;
filter_arg = NULL;
@@ -236,7 +241,8 @@ bt_isa_attach(device_t dev)
return (ENOMEM);
}
- if (bt_init(dev)) {
+ error = bt_init(dev);
+ if (error) {
bt_isa_release_resources(dev);
return (ENOMEM);
}
OpenPOWER on IntegriCloud