diff options
| author | Mike Smith <msmith@FreeBSD.org> | 2000-08-04 06:52:50 +0000 |
|---|---|---|
| committer | Mike Smith <msmith@FreeBSD.org> | 2000-08-04 06:52:50 +0000 |
| commit | 5105e958fd7b09ba2737db19270a1f06dc29930e (patch) | |
| tree | 0b8b411b0a135640b48e8401e140cd91aee3d802 /sys/dev/mlx | |
| parent | 8f30c24b53f67c1c0a3badb92ddc57a7d1039c9a (diff) | |
Notes
Diffstat (limited to 'sys/dev/mlx')
| -rw-r--r-- | sys/dev/mlx/mlx.c | 2 | ||||
| -rw-r--r-- | sys/dev/mlx/mlx_pci.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c index c236a76bdb4e..921302e4bcfd 100644 --- a/sys/dev/mlx/mlx.c +++ b/sys/dev/mlx/mlx.c @@ -43,6 +43,8 @@ #include <sys/stat.h> #include <machine/resource.h> +#include <machine/bus_memio.h> +#include <machine/bus_pio.h> #include <machine/bus.h> #include <machine/clock.h> #include <sys/rman.h> diff --git a/sys/dev/mlx/mlx_pci.c b/sys/dev/mlx/mlx_pci.c index 6fe9a562126a..ae56f6a25bbc 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); |
