PERFORCE change 141158 for review

Andrew Thompson thompsa at FreeBSD.org
Sun May 4 19:34:44 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=141158

Change 141158 by thompsa at thompsa_burger on 2008/05/04 19:34:00

	Keep ic_curchan in sync with the scan results.

Affected files ...

.. //depot/projects/vap/sys/dev/if_ndis/if_ndis.c#21 edit

Differences ...

==== //depot/projects/vap/sys/dev/if_ndis/if_ndis.c#21 (text+ko) ====

@@ -3237,6 +3237,7 @@
 	ndis_wlan_bssid_ex	*wb;
 	struct ieee80211_scanparams sp;
 	struct ieee80211_frame wh;
+	struct ieee80211_channel *saved_chan;
 	int i, j;
 	int error, len, rssi, noise, freq, chanflag;
 	static long rstamp;
@@ -3246,6 +3247,7 @@
 
 	ic = sc->ifp->if_l2com;
 	vap = TAILQ_FIRST(&ic->ic_vaps);
+	saved_chan = ic->ic_curchan;
 	noise = -96;
 
 	len = sizeof(uint32_t) + (sizeof(ndis_wlan_bssid_ex) * 16);
@@ -3306,6 +3308,11 @@
 		chanflag = ndis_nettype_chan(wb->nwbx_nettype);
 		freq = wb->nwbx_config.nc_dsconfig / 1000;
 		sp.chan = sp.bchan = ieee80211_mhz2ieee(freq, chanflag);
+		/* Hack ic->ic_curchan to be in sync with the scan result */
+		ic->ic_curchan = ieee80211_find_channel(ic, freq, chanflag);
+		if (ic->ic_curchan == NULL)
+			ic->ic_curchan = &ic->ic_channels[0];
+
 
 		/* Process extended info from AP */
 		if (wb->nwbx_len > sizeof(ndis_wlan_bssid)) {
@@ -3340,6 +3347,8 @@
 		wb = (ndis_wlan_bssid_ex *)((char *)wb + wb->nwbx_len);
 	}
 	free(bl, M_DEVBUF);
+	/* Restore the channel after messing with it */
+	ic->ic_curchan = saved_chan;
 }
 
 static void


More information about the p4-projects mailing list