From owner-svn-src-all@freebsd.org Sun Jun 7 05:08:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56C60349882; Sun, 7 Jun 2020 05:08:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49fktj1gQgz3ZHC; Sun, 7 Jun 2020 05:08:45 +0000 (UTC) (envelope-from adrian@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E3FED87C; Sun, 7 Jun 2020 05:08:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05758jlO082066; Sun, 7 Jun 2020 05:08:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05758jlJ082065; Sun, 7 Jun 2020 05:08:45 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202006070508.05758jlJ082065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 7 Jun 2020 05:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361886 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 361886 X-SVN-Commit-Repository: base 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.33 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, 07 Jun 2020 05:08:45 -0000 Author: adrian Date: Sun Jun 7 05:08:44 2020 New Revision: 361886 URL: https://svnweb.freebsd.org/changeset/base/361886 Log: [if_ath] Don't update the beacon bits from beacon frames in hostapd mode. This logic is running the beacon receive bits in STA+AP mode on both the STA and AP side. The STA side sees its beacons from the BSS fine; the AP side is seeing other beacons on the same channel but with the BSS node for some odd reason. (I think it's a valid reason, but I currently forget what that valid reason is.) So, just to be cleaner about things, don't run the nexttbtt/etc bits at all if we're in hostap mode. If I ever get mesh working then maybe I'll make sure it works right on mesh+ap and mesh+sta modes. Whilst here, log the VAP i'm being called on to make it clearer what is going on. I may end up adding a VAP dprintf version of this at some point. Tested: * AR9380, STA (DWDS client) + hostap on the same NIC Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun Jun 7 04:57:48 2020 (r361885) +++ head/sys/dev/ath/if_ath_rx.c Sun Jun 7 05:08:44 2020 (r361886) @@ -379,12 +379,12 @@ ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf * * trying to sync / merge to BSSes that aren't * actually us. */ - if (IEEE80211_ADDR_EQ(ni->ni_bssid, vap->iv_bss->ni_bssid)) { + if ((vap->iv_opmode != IEEE80211_M_HOSTAP) && + IEEE80211_ADDR_EQ(ni->ni_bssid, vap->iv_bss->ni_bssid)) { /* update rssi statistics for use by the hal */ /* XXX unlocked check against vap->iv_bss? */ ATH_RSSI_LPF(sc->sc_halstats.ns_avgbrssi, rssi); - tsf_beacon = ((uint64_t) le32dec(ni->ni_tstamp.data + 4)) << 32; tsf_beacon |= le32dec(ni->ni_tstamp.data); @@ -427,8 +427,9 @@ ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf * tsf_remainder = (tsf_beacon - tsf_beacon_old) % tsf_intval; } - DPRINTF(sc, ATH_DEBUG_BEACON, "%s: old_tsf=%llu (%u), new_tsf=%llu (%u), target_tsf=%llu (%u), delta=%lld, bmiss=%d, remainder=%d\n", + DPRINTF(sc, ATH_DEBUG_BEACON, "%s: %s: old_tsf=%llu (%u), new_tsf=%llu (%u), target_tsf=%llu (%u), delta=%lld, bmiss=%d, remainder=%d\n", __func__, + ieee80211_get_vap_ifname(vap), (unsigned long long) tsf_beacon_old, (unsigned int) (tsf_beacon_old >> 10), (unsigned long long) tsf_beacon, @@ -439,8 +440,11 @@ ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf * tsf_delta_bmiss, tsf_remainder); - DPRINTF(sc, ATH_DEBUG_BEACON, "%s: tsf=%llu (%u), nexttbtt=%llu (%u), delta=%d\n", + DPRINTF(sc, ATH_DEBUG_BEACON, "%s: %s: ni=%6D bssid=%6D tsf=%llu (%u), nexttbtt=%llu (%u), delta=%d\n", __func__, + ieee80211_get_vap_ifname(vap), + ni->ni_bssid, ":", + vap->iv_bss->ni_bssid, ":", (unsigned long long) tsf_beacon, (unsigned int) (tsf_beacon >> 10), (unsigned long long) nexttbtt,