From owner-p4-projects@FreeBSD.ORG Sun May 4 19:34:44 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 080EE1065681; Sun, 4 May 2008 19:34:44 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE102106567C for ; Sun, 4 May 2008 19:34:43 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BB5668FC17 for ; Sun, 4 May 2008 19:34:43 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m44JYhkM069206 for ; Sun, 4 May 2008 19:34:43 GMT (envelope-from thompsa@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m44JYhjm069202 for perforce@freebsd.org; Sun, 4 May 2008 19:34:43 GMT (envelope-from thompsa@freebsd.org) Date: Sun, 4 May 2008 19:34:43 GMT Message-Id: <200805041934.m44JYhjm069202@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to thompsa@freebsd.org using -f From: Andrew Thompson To: Perforce Change Reviews Cc: Subject: PERFORCE change 141158 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2008 19:34:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=141158 Change 141158 by thompsa@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