summaryrefslogtreecommitdiffstats
path: root/sys/dev/if_ndis
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2004-06-04 04:43:36 +0000
committerwpaul <wpaul@FreeBSD.org>2004-06-04 04:43:36 +0000
commit0adcaff459d146a407ff60aad41d491cdeb3a10c (patch)
tree7000c95b936704107f861b58997df828ef690981 /sys/dev/if_ndis
parent87449e4f90b8aa5016bd4a60334bb762a0e456d9 (diff)
downloadFreeBSD-src-0adcaff459d146a407ff60aad41d491cdeb3a10c.zip
FreeBSD-src-0adcaff459d146a407ff60aad41d491cdeb3a10c.tar.gz
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.
Diffstat (limited to 'sys/dev/if_ndis')
-rw-r--r--sys/dev/if_ndis/if_ndis.c19
1 files changed, 12 insertions, 7 deletions
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<<IEEE80211_MODE_11B)) {
- TESTSETRATE(IEEE80211_MODE_11B, 2);
- TESTSETRATE(IEEE80211_MODE_11B, 4);
- TESTSETRATE(IEEE80211_MODE_11B, 11);
- TESTSETRATE(IEEE80211_MODE_11B, 22);
+ TESTSETRATE(IEEE80211_MODE_11B,
+ IEEE80211_RATE_BASIC|2);
+ TESTSETRATE(IEEE80211_MODE_11B,
+ IEEE80211_RATE_BASIC|4);
+ TESTSETRATE(IEEE80211_MODE_11B,
+ IEEE80211_RATE_BASIC|11);
+ TESTSETRATE(IEEE80211_MODE_11B,
+ IEEE80211_RATE_BASIC|22);
}
if (ic->ic_modecaps & (1<<IEEE80211_MODE_11G)) {
TESTSETRATE(IEEE80211_MODE_11G, 47);
@@ -630,7 +634,8 @@ nonettypes:
chanflag |= IEEE80211_CHAN_G;
if (i <= 14)
chanflag |= IEEE80211_CHAN_B;
- if (i > 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);
OpenPOWER on IntegriCloud