From owner-svn-src-all@freebsd.org Wed Jun 1 14:57:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAB26B60715; Wed, 1 Jun 2016 14:57:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 821CE14C0; Wed, 1 Jun 2016 14:57:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51Evren096174; Wed, 1 Jun 2016 14:57:53 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51EvrOI096173; Wed, 1 Jun 2016 14:57:53 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606011457.u51EvrOI096173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 1 Jun 2016 14:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301128 - head/sys/dev/urtwn 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.22 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: Wed, 01 Jun 2016 14:57:55 -0000 Author: avos Date: Wed Jun 1 14:57:53 2016 New Revision: 301128 URL: https://svnweb.freebsd.org/changeset/base/301128 Log: urtwn: fix non-ERP BSS detection in HOSTAP mode. Receive all beacons in HOSTAP mode; they will give more information about present non-ERP / legacy BSSs (used to choose protection mode). Tested with RTL8188CUS (HOSTAP, urtwn) + RTL8821AU (HOSTAP, 11b mode). Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Wed Jun 1 14:16:16 2016 (r301127) +++ head/sys/dev/urtwn/if_urtwn.c Wed Jun 1 14:57:53 2016 (r301128) @@ -2627,10 +2627,11 @@ urtwn_newstate(struct ieee80211vap *vap, if (ic->ic_promisc == 0) { reg = urtwn_read_4(sc, R92C_RCR); - if (vap->iv_opmode != IEEE80211_M_HOSTAP) + if (vap->iv_opmode != IEEE80211_M_HOSTAP) { reg |= R92C_RCR_CBSSID_DATA; - if (vap->iv_opmode != IEEE80211_M_IBSS) - reg |= R92C_RCR_CBSSID_BCN; + if (vap->iv_opmode != IEEE80211_M_IBSS) + reg |= R92C_RCR_CBSSID_BCN; + } urtwn_write_4(sc, R92C_RCR, reg); } @@ -4723,7 +4724,8 @@ urtwn_scan_start(struct ieee80211com *ic URTWN_LOCK(sc); /* Receive beacons / probe responses from any BSSID. */ - if (ic->ic_opmode != IEEE80211_M_IBSS) + if (ic->ic_opmode != IEEE80211_M_IBSS && + ic->ic_opmode != IEEE80211_M_HOSTAP) urtwn_set_rx_bssid_all(sc, 1); /* Set gain for scanning. */ @@ -4738,7 +4740,9 @@ urtwn_scan_end(struct ieee80211com *ic) URTWN_LOCK(sc); /* Restore limitations. */ - if (ic->ic_promisc == 0 && ic->ic_opmode != IEEE80211_M_IBSS) + if (ic->ic_promisc == 0 && + ic->ic_opmode != IEEE80211_M_IBSS && + ic->ic_opmode != IEEE80211_M_HOSTAP) urtwn_set_rx_bssid_all(sc, 0); /* Set gain under link. */ @@ -4931,14 +4935,13 @@ urtwn_set_promisc(struct urtwn_softc *sc if (vap->iv_state == IEEE80211_S_RUN) { switch (vap->iv_opmode) { case IEEE80211_M_STA: - mask2 |= R92C_RCR_CBSSID_DATA; - /* FALLTHROUGH */ - case IEEE80211_M_HOSTAP: mask2 |= R92C_RCR_CBSSID_BCN; - break; + /* FALLTHROUGH */ case IEEE80211_M_IBSS: mask2 |= R92C_RCR_CBSSID_DATA; break; + case IEEE80211_M_HOSTAP: + break; default: device_printf(sc->sc_dev, "%s: undefined opmode %d\n", __func__, vap->iv_opmode);