From owner-freebsd-wireless@FreeBSD.ORG Mon Jun 27 07:10:15 2011 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31765106566C for ; Mon, 27 Jun 2011 07:10:15 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id E5E848FC12 for ; Mon, 27 Jun 2011 07:10:14 +0000 (UTC) Received: by gxk28 with SMTP id 28so2346644gxk.13 for ; Mon, 27 Jun 2011 00:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:date:x-google-sender-auth :message-id:subject:from:to:content-type; bh=NqrkyEEETdqH7KJkGHV9qjnH0AxMAndoVglNfMdv3GQ=; b=Vebe/wn55dbYPDTiWDLV/h3HTaz0vEBXno3DgO8YFjwxwHt0gRAMiLSz19V4J5prUs mhvhFeFFdHXzaPKZQFuFnJuhAoh7qBffBOVzOaGk8cAYb6p9v5lO09fh5zUknuLThHkD iDyxnvocvR6DpAGcd0pRz5okTSV/8jC6wRkHE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=gD8HiHXGe7TUx1q1gtbcQqmsCwzjeJL69mRTNiFt+/Kn/+xCMDMSa3VVH4UPKfRVPg nyaa1D8NY0pm5pCD13R7UjC1gttl3G721vTqqG32JT7h20NP/hpyk5X3FOsXCeotB4uJ JxcZ0LlFjbX/MgYFQh/p43UfhwhKJ5hK6cmc0= MIME-Version: 1.0 Received: by 10.150.164.6 with SMTP id m6mr6582264ybe.351.1309158613513; Mon, 27 Jun 2011 00:10:13 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.146.13 with HTTP; Mon, 27 Jun 2011 00:10:13 -0700 (PDT) Date: Mon, 27 Jun 2011 15:10:13 +0800 X-Google-Sender-Auth: mMmL06qdOWrraitu809mkCDalIk Message-ID: From: Adrian Chadd To: freebsd-wireless@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: [PATCH] net80211: Fix bss channel on CSA reception X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 07:10:15 -0000 This patch fixes a strange bug where although the CSA correctly changes ic_curchan, it doesn't update the VAP BSS channel. Hence querying the VAP doesn't report the correct channel. Thanks, Adrian Index: ieee80211_proto.c =================================================================== --- ieee80211_proto.c (revision 223525) +++ ieee80211_proto.c (working copy) @@ -1522,11 +1522,19 @@ void ieee80211_csa_completeswitch(struct ieee80211com *ic) { + struct ieee80211vap *vap; + IEEE80211_LOCK_ASSERT(ic); KASSERT(ic->ic_flags & IEEE80211_F_CSAPENDING, ("csa not pending")); ieee80211_setcurchan(ic, ic->ic_csa_newchan); + /* + * ic_curchan now matches ic_csa_newchan; + * inform all VAPs of the new channel + */ + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) + vap->iv_bss->ni_chan = ic->ic_curchan; csa_completeswitch(ic); }