From owner-freebsd-wireless@FreeBSD.ORG Tue Jul 12 15:24:41 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 9DE701065674 for ; Tue, 12 Jul 2011 15:24:41 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 649698FC1E for ; Tue, 12 Jul 2011 15:24:40 +0000 (UTC) Received: by gyf3 with SMTP id 3so2472724gyf.13 for ; Tue, 12 Jul 2011 08:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=wegKXnL+5jRnTtMWymVCv2l/lQmQtYYBAqj4h5+M948=; b=i1AcsaJp1nv8c6Fd2A5r5TjzEumEyNmi6G5L/Gx3I6g+neDOFgexEzpCUY8w1ta2sl Jw3RTe3G+7iv53MA3YRhmAHsc0uR3a3XQOV85BCZBI0vky/+GlRB5vWXS0vlIYVlSUzf PZQSyjUmXtYhAr741fNjO5XqSxr4EEMZ56/Do= MIME-Version: 1.0 Received: by 10.151.6.3 with SMTP id j3mr269336ybi.44.1310484280541; Tue, 12 Jul 2011 08:24:40 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.189.1 with HTTP; Tue, 12 Jul 2011 08:24:40 -0700 (PDT) Date: Tue, 12 Jul 2011 23:24:40 +0800 X-Google-Sender-Auth: AuTqbpgWwBoVBLDLokEglNgx3HE Message-ID: From: Adrian Chadd To: freebsd-wireless@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: [patch] net80211: update BSS channel after CSA 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: Tue, 12 Jul 2011 15:24:41 -0000 The BSS channel isn't updated after a CSA has completed. The BSS channel (iv_bss->ni_chan) is only set during an explicit channel change (via an ioctl); it isn't at all updated through the CSA code path. This patch kicks the channel update after the CSA is complete, changing the channel of all VAPs in the CSA state. It does resolve the issue (ie, ifconfig wlanX in STA mode shows the wrong BSS channel.) Thanks, adrian Index: ieee80211_proto.c =================================================================== --- ieee80211_proto.c (revision 223943) +++ ieee80211_proto.c (working copy) @@ -1510,8 +1510,10 @@ ic->ic_flags &= ~IEEE80211_F_CSAPENDING; TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) - if (vap->iv_state == IEEE80211_S_CSA) + if (vap->iv_state == IEEE80211_S_CSA) { + vap->iv_bss->ni_chan = ic->ic_curchan; ieee80211_new_state_locked(vap, IEEE80211_S_RUN, 0); + } }