summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2001-02-27 22:57:32 +0000
committermjacob <mjacob@FreeBSD.org>2001-02-27 22:57:32 +0000
commitdc46fafd19c0326974998021953e0853ab28b61d (patch)
tree75677f48af500023ad7492d5181d0ccb3d50d7a5 /sys/pci
parent30bb5dedcae628416907fb42c9133a4368ce649d (diff)
downloadFreeBSD-src-dc46fafd19c0326974998021953e0853ab28b61d.zip
FreeBSD-src-dc46fafd19c0326974998021953e0853ab28b61d.tar.gz
A better mousetrap: use device hints, as in:
hint.fxp.0.prefer_iomap="1" to set IO vs. Memory space mapping.
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_fxp.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/pci/if_fxp.c b/sys/pci/if_fxp.c
index 8cc34ff..068bd8c 100644
--- a/sys/pci/if_fxp.c
+++ b/sys/pci/if_fxp.c
@@ -314,7 +314,7 @@ fxp_attach(device_t dev)
struct fxp_softc *sc = device_get_softc(dev);
struct ifnet *ifp;
u_int32_t val;
- int rid, m1, m2, ebitmap;
+ int rid, m1, m2, prefer_iomap;
mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_DEF | MTX_RECURSE);
callout_handle_init(&sc->stat_ch);
@@ -357,12 +357,11 @@ fxp_attach(device_t dev)
*/
m1 = PCIM_CMD_MEMEN;
m2 = PCIM_CMD_PORTEN;
- ebitmap = 0;
- if (getenv_int("fxp_iomap", &ebitmap)) {
- if (ebitmap & (1 << device_get_unit(dev))) {
- m1 = PCIM_CMD_PORTEN;
- m2 = PCIM_CMD_MEMEN;
- }
+ prefer_iomap = 0;
+ if (resource_int_value(device_get_name(dev), device_get_unit(dev),
+ "prefer_iomap", &prefer_iomap) == 0 && prefer_iomap != 0) {
+ m1 = PCIM_CMD_PORTEN;
+ m2 = PCIM_CMD_MEMEN;
}
if (val & m1) {
OpenPOWER on IntegriCloud