diff options
author | wpaul <wpaul@FreeBSD.org> | 2004-01-13 01:12:28 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2004-01-13 01:12:28 +0000 |
commit | d94f2b477c9c63c3dde78afcabdf7a8a327acc40 (patch) | |
tree | f171a48b107d23302eee9e68251b8190e5656cc5 | |
parent | 7dfc5abc07f75a03cf9367722d6004dfa7cebbc1 (diff) | |
download | FreeBSD-src-d94f2b477c9c63c3dde78afcabdf7a8a327acc40.zip FreeBSD-src-d94f2b477c9c63c3dde78afcabdf7a8a327acc40.tar.gz |
Loosen up the range test in ndis_register_ioport(). Allow drivers to
map ranges that are smaller than what our resource manager code knows
is available, rather than requiring that they match exactly. This
fixes a problem with the Intel PRO/1000 gigE driver: it wants to map
a range of 32 I/O ports, even though some chips appear set up to
decode a range of 64. With this fix, it loads and runs correctly.
-rw-r--r-- | sys/compat/ndis/subr_ndis.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c index 429be6f..8d5393c 100644 --- a/sys/compat/ndis/subr_ndis.c +++ b/sys/compat/ndis/subr_ndis.c @@ -1069,7 +1069,8 @@ ndis_register_ioport(offset, adapter, port, numports) if (sc->ndis_res_io == NULL) return(NDIS_STATUS_FAILURE); - if (rman_get_size(sc->ndis_res_io) != numports) + /* Don't let the device map more ports than we have. */ + if (rman_get_size(sc->ndis_res_io) < numports) return(NDIS_STATUS_INVALID_LENGTH); *offset = (void *)rman_get_start(sc->ndis_res_io); |