Date: Mon, 1 Jan 2007 04:40:42 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 112390 for review Message-ID: <200701010440.l014eglU066425@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=112390 Change 112390 by kmacy@kmacy_serendipity:sam_wifi on 2007/01/01 04:39:42 general compile fixes update to packed channel format so that the 80211 stack doesn't blow up in an assert - I am only adding the first 12 channels, but ndis does not honor fixed channels and more or less ignores the rest of the 802.11 stack as ndis wifi drivers all currently have to more or less implement their own stacks, so this should not matter. The problem of ndis passing extra garbage to ifconfig pre-dates sam_wifi - so I can worry about that later. Affected files ... .. //depot/projects/wifi/sys/dev/if_ndis/if_ndis.c#26 edit Differences ... ==== //depot/projects/wifi/sys/dev/if_ndis/if_ndis.c#26 (text+ko) ==== @@ -478,7 +478,7 @@ device_object *pdo; struct ifnet *ifp = NULL; int error = 0, len; - int i; + int i, j; sc = device_get_softc(dev); #if __FreeBSD_version < 600031 @@ -818,10 +818,11 @@ } #undef SETRATE #undef INCRATE + ic->ic_nchans = 12; /* * Taking yet more guesses here. */ - for (i = 1; i < IEEE80211_CHAN_MAX; i++) { + for (j = 0, i = 1; i <= 12; i++, j++) { int chanflag = 0; if (ic->ic_sup_rates[IEEE80211_MODE_11G].rs_nrates) @@ -830,12 +831,11 @@ chanflag |= IEEE80211_CHAN_B; if (ic->ic_sup_rates[IEEE80211_MODE_11A].rs_nrates && i > 14) - chanflag = IEEE80211_CHAN_A; + chanflag = IEEE80211_CHAN_A; if (chanflag == 0) break; - ic->ic_channels[i].ic_freq = - ieee80211_ieee2mhz(i, chanflag); - ic->ic_channels[i].ic_flags = chanflag; + ic->ic_channels[j].ic_freq = ieee80211_ieee2mhz(i, chanflag); + ic->ic_channels[j].ic_flags = chanflag; } /* @@ -898,8 +898,8 @@ ieee80211_media_init(ic, ieee80211_media_change, ndis_media_status); #endif - ic->ic_ibss_chan = IEEE80211_CHAN_ANYC; - ic->ic_bss->ni_chan = ic->ic_ibss_chan; + ic->ic_bsschan = IEEE80211_CHAN_ANYC; + ic->ic_bss->ni_chan = ic->ic_bsschan; #ifdef IEEE80211_F_WPA /* install key handing routines */ ic->ic_crypto.cs_key_set = ndis_add_key; @@ -2393,16 +2393,16 @@ config.nc_atimwin = 100; if (config.nc_fhconfig.ncf_dwelltime == 0) config.nc_fhconfig.ncf_dwelltime = 200; - if (rval == 0 && ic->ic_ibss_chan != IEEE80211_CHAN_ANYC) { + if (rval == 0 && ic->ic_bsschan != IEEE80211_CHAN_ANYC) { int chan, chanflag; - chan = ieee80211_chan2ieee(ic, ic->ic_ibss_chan); + chan = ieee80211_chan2ieee(ic, ic->ic_bsschan); chanflag = config.nc_dsconfig > 2500000 ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ; if (chan != ieee80211_mhz2ieee(config.nc_dsconfig / 1000, 0)) { config.nc_dsconfig = - ic->ic_ibss_chan->ic_freq * 1000; - ic->ic_bss->ni_chan = ic->ic_ibss_chan; + ic->ic_bsschan->ic_freq * 1000; + ic->ic_bss->ni_chan = ic->ic_bsschan; len = sizeof(config); config.nc_length = len; config.nc_fhconfig.ncf_length = @@ -2448,11 +2448,11 @@ len = sizeof(ssid); bzero((char *)&ssid, len); - ssid.ns_ssidlen = ic->ic_des_esslen; + ssid.ns_ssidlen = ic->ic_des_ssid[0].len; if (ssid.ns_ssidlen == 0) { ssid.ns_ssidlen = 1; } else - bcopy(ic->ic_des_essid, ssid.ns_ssid, ssid.ns_ssidlen); + bcopy(ic->ic_des_ssid[0].ssid, ssid.ns_ssid, ssid.ns_ssidlen); rval = ndis_set_info(sc, OID_802_11_SSID, &ssid, &len); @@ -2498,6 +2498,9 @@ case IEEE80211_M_MONITOR: imr->ifm_active |= IFM_IEEE80211_MONITOR; break; + case IEEE80211_M_WDS: + printf("WARNING: WDS operation mode not supported by NDIS\n"); + break; } switch (ic->ic_curmode) { case IEEE80211_MODE_11A: @@ -2683,7 +2686,7 @@ ic->ic_bss->ni_chan = &ic->ic_channels[chan]; ic->ic_des_chan = &ic->ic_channels[chan]; - ic->ic_ibss_chan = &ic->ic_channels[chan]; + ic->ic_bsschan = &ic->ic_channels[chan]; #if __FreeBSD_version >= 600007 ic->ic_curchan = &ic->ic_channels[chan]; #endif @@ -3191,6 +3194,8 @@ bcopy((char *)wb->nwbx_ies + sizeof(struct ndis_80211_fixed_ies), cp, sr->isr_ie_len); + } else { + sr->isr_ie_len = 0; } sr->isr_len = roundup(sizeof(*sr) + sr->isr_ssid_len + sr->isr_ie_len, sizeof(uint32_t));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701010440.l014eglU066425>