From 786cd128a85c7b67398ec1251288b3beb9e6d2e5 Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Fri, 4 Aug 2000 06:52:00 +0000 Subject: Add support for 2.x/3.x firmware adapters which are too old to have a memory-mapped register window. This closes the last known issue with 2.x vintage adapters. --- sys/dev/mlx/mlx.c | 2 ++ sys/dev/mlx/mlx_pci.c | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c index 9bb87caa1cb5..3c69dc5d5823 100644 --- a/sys/dev/mlx/mlx.c +++ b/sys/dev/mlx/mlx.c @@ -43,6 +43,8 @@ #include #include +#include +#include #include #include #include diff --git a/sys/dev/mlx/mlx_pci.c b/sys/dev/mlx/mlx_pci.c index 118e4958d53e..497e0a67c040 100644 --- a/sys/dev/mlx/mlx_pci.c +++ b/sys/dev/mlx/mlx_pci.c @@ -157,18 +157,23 @@ mlx_pci_attach(device_t dev) * Allocate the PCI register window. */ - /* type 2/3 adapters have an I/O region we don't use at base 0 */ + /* type 2/3 adapters have an I/O region we don't prefer at base 0 */ switch(sc->mlx_iftype) { case MLX_IFTYPE_2: case MLX_IFTYPE_3: rid = MLX_CFG_BASE1; + sc->mlx_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, RF_ACTIVE); + if (sc->mlx_mem == NULL) { + rid = MLX_CFG_BASE0; + sc->mlx_mem = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); + } break; case MLX_IFTYPE_4: case MLX_IFTYPE_5: rid = MLX_CFG_BASE0; + sc->mlx_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, RF_ACTIVE); break; } - sc->mlx_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, RF_ACTIVE); if (sc->mlx_mem == NULL) { device_printf(sc->mlx_dev, "couldn't allocate mailbox window\n"); mlx_free(sc); -- cgit v1.3