diff options
author | wpaul <wpaul@FreeBSD.org> | 2004-05-29 06:41:17 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2004-05-29 06:41:17 +0000 |
commit | 86ad4bc57206e1e6d93096c4a7c71098de9917ff (patch) | |
tree | d249a6d168e11421eecdd8440ae5e3363334218f /sys/compat | |
parent | 8b3638ddb28484b21ce4c706ef2d96745d7315cf (diff) | |
download | FreeBSD-src-86ad4bc57206e1e6d93096c4a7c71098de9917ff.zip FreeBSD-src-86ad4bc57206e1e6d93096c4a7c71098de9917ff.tar.gz |
In subr_ndis.c, when searching for keys in our make-pretend registry,
make the key name matching case-insensitive. There are some drivers
and .inf files that have mismatched cases, e.g. the driver will look
for "AdhocBand" whereas the .inf file specifies a registry key to be
created called "AdHocBand." The mismatch is probably a typo that went
undetected (so much for QA), but since Windows seems to be case-insensitive,
we should be too.
In if_ndis.c, initialize rates and channels correctly so that specify
frequences correctly when trying to set channels in the 5Ghz band, and
so that 802.11b rates show up for some a/b/g cards (which otherwise
appear to have no 802.11b modes).
Also, when setting OID_802_11_CONFIGURATION in ndis_80211_setstate(),
provide default values for the beacon interval, ATIM window and dwelltime.
The Atheros "Aries" driver will crash if you try to select ad-hoc mode
and leave the beacon interval set to 0: it blindly uses this value and
does a division by 0 in the interrupt handler, causing an integer
divide trap.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/ndis/subr_ndis.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c index 7b22f4c..3a7fea7 100644 --- a/sys/compat/ndis/subr_ndis.c +++ b/sys/compat/ndis/subr_ndis.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); */ +#include <sys/ctype.h> #include <sys/param.h> #include <sys/types.h> #include <sys/errno.h> @@ -554,6 +555,22 @@ ndis_encode_parm(block, oid, type, parm) return(NDIS_STATUS_SUCCESS); } +static int +my_strcasecmp(s1, s2, len) + const char *s1; + const char *s2; + int len; +{ + int i; + + for (i = 0; i < len; i++) { + if (toupper(s1[i]) != toupper(s2[i])) + return(1); + } + + return(0); +} + __stdcall static void ndis_read_cfg(status, parm, cfg, key, type) ndis_status *status; @@ -589,7 +606,8 @@ ndis_read_cfg(status, parm, cfg, key, type) */ TAILQ_FOREACH(e, &sc->ndis_ctx, link) { oidp = e->entry; - if (strcmp(oidp->oid_name, keystr) == 0) { + if (my_strcasecmp(oidp->oid_name, + keystr, strlen(keystr)) == 0) { if (strcmp((char *)oidp->oid_arg1, "UNSET") == 0) { free(keystr, M_DEVBUF); *status = NDIS_STATUS_FAILURE; @@ -685,7 +703,8 @@ ndis_write_cfg(status, cfg, key, parm) TAILQ_FOREACH(e, &sc->ndis_ctx, link) { oidp = e->entry; - if (strcmp(oidp->oid_name, keystr) == 0) { + if (my_strcasecmp(oidp->oid_name, + keystr, strlen(keystr)) == 0) { /* Found it, set the value. */ strcpy((char *)oidp->oid_arg1, val); free(keystr, M_DEVBUF); |