From owner-svn-src-all@FreeBSD.ORG Sun May 3 22:34:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39FE9C51; Sun, 3 May 2015 22:34:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2804513C6; Sun, 3 May 2015 22:34:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t43MYXAh064045; Sun, 3 May 2015 22:34:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MYXS6064044; Sun, 3 May 2015 22:34:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032234.t43MYXS6064044@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282375 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:34:33 -0000 Author: adrian Date: Sun May 3 22:34:32 2015 New Revision: 282375 URL: https://svnweb.freebsd.org/changeset/base/282375 Log: Add wpi_check_bss_filter() PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:32:45 2015 (r282374) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:34:32 2015 (r282375) @@ -1651,6 +1651,12 @@ wpi_node_free(struct ieee80211_node *ni) sc->sc_node_free(ni); } +static __inline int +wpi_check_bss_filter(struct wpi_softc *sc) +{ + return (sc->rxon.filter & htole32(WPI_FILTER_BSS)) != 0; +} + /** * Called by net80211 when ever there is a change to 80211 state machine */ @@ -1681,7 +1687,7 @@ wpi_newstate(struct ieee80211vap *vap, e switch (nstate) { case IEEE80211_S_SCAN: WPI_RXON_LOCK(sc); - if ((sc->rxon.filter & htole32(WPI_FILTER_BSS)) && + if (wpi_check_bss_filter(sc) != 0 && vap->iv_opmode != IEEE80211_M_STA) { sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); if ((error = wpi_send_rxon(sc, 0, 1)) != 0) { @@ -1749,7 +1755,7 @@ wpi_calib_timeout(void *arg) { struct wpi_softc *sc = arg; - if (!(sc->rxon.filter & htole32(WPI_FILTER_BSS))) + if (wpi_check_bss_filter(sc) == 0) return; wpi_power_calibration(sc); @@ -3642,7 +3648,7 @@ wpi_send_rxon(struct wpi_softc *sc, int if (async) WPI_RXON_LOCK_ASSERT(sc); - if (assoc && (sc->rxon.filter & htole32(WPI_FILTER_BSS))) { + if (assoc && wpi_check_bss_filter(sc) != 0) { struct wpi_assoc rxon_assoc; rxon_assoc.flags = sc->rxon.flags;