summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Jacob <mjacob@FreeBSD.org>2001-02-27 22:57:32 +0000
committerMatt Jacob <mjacob@FreeBSD.org>2001-02-27 22:57:32 +0000
commit2a05a4eb2c67ea327e54b2e5d5ef8ac1370a3f1f (patch)
treedf113cee423e3dda45cc7c6050efded2d15c21c9
parent52608c9fbfa4a97911f409e9bb9f25fe914ea916 (diff)
Notes
-rw-r--r--sys/dev/fxp/if_fxp.c13
-rw-r--r--sys/pci/if_fxp.c13
2 files changed, 12 insertions, 14 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c
index 8cc34ffdb9060..068bd8c1f3a68 100644
--- a/sys/dev/fxp/if_fxp.c
+++ b/sys/dev/fxp/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) {
diff --git a/sys/pci/if_fxp.c b/sys/pci/if_fxp.c
index 8cc34ffdb9060..068bd8c1f3a68 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) {