From 0adcaff459d146a407ff60aad41d491cdeb3a10c Mon Sep 17 00:00:00 2001 From: wpaul Date: Fri, 4 Jun 2004 04:43:36 +0000 Subject: Unbreak the Intel 2100 Centrino wireless driver (and probably others): - In subr_ndis.c, my_strcasecmp() actually behaved like my_strncasecmp(): we really need it to behave like the former, not the latter. (It was falsely matching "RadioEnable", which defaults to 1 with "RadioEnableHW" which the driver creates itself and to 0, because we were using strlen("RadioEnable") as the length to test. This caused the radio to always be turned off. :( ) - In if_ndis.c, only set IEEE80211_CHAN_A for channels if we actually set any IEEE80211_MODE_11A rates. (ieee80211_attach() will "helpfully" add IEEE80211_MODE_11A to ic_modecaps for you if you initialize any 802.11a channels. This caused "ndis0: 11a rates:" to erroneously be displayed during driver load.) - Also in if_ndis.c, when using TESTSETRATE() to add in any missing 802.11b rates, remember to OR the rates with IEEE80211_RATE_BASIC, otherwise comparing against existing basic rates won't match. (1, 2, 5.5 and 11Mbps are basic rates, according to the 802.11b spec.) This erroneously cause 11Mbps to be added to the 11b rate list twice. --- sys/dev/if_ndis/if_ndis.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'sys/dev/if_ndis') diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c index 827e097..caf25ef 100644 --- a/sys/dev/if_ndis/if_ndis.c +++ b/sys/dev/if_ndis/if_ndis.c @@ -484,7 +484,7 @@ ndis_attach(dev) /* Do media setup */ if (sc->ndis_80211) { struct ieee80211com *ic = (void *)ifp; - ndis_80211_rates/*_ex*/ rates; + ndis_80211_rates_ex rates; struct ndis_80211_nettype_list *ntl; uint32_t arg; int r; @@ -601,10 +601,14 @@ nonettypes: * we detect turbo modes, though? */ if (ic->ic_modecaps & (1<ic_modecaps & (1< 14) + if (ic->ic_sup_rates[IEEE80211_MODE_11A].rs_nrates && + i > 14) chanflag = IEEE80211_CHAN_A; if (chanflag == 0) break; @@ -1533,7 +1538,6 @@ ndis_setstate_80211(sc) device_printf(sc->ndis_dev, "unknown mode: %d\n", ic->ic_curmode); } -#endif if (arg) { len = sizeof(arg); @@ -1543,6 +1547,7 @@ ndis_setstate_80211(sc) device_printf (sc->ndis_dev, "set nettype failed: %d\n", rval); } +#endif len = sizeof(config); bzero((char *)&config, len); -- cgit v1.1