From nobody Sun Mar 27 20:14:10 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 805B01A53DDA; Sun, 27 Mar 2022 20:14:11 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KRRqk3tNhz4nqd; Sun, 27 Mar 2022 20:14:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648412051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CkvLL4d23oIHFAtt8qRdXtkfdwAAauVLea3+Co2wa0A=; b=leFV0csmCa7K85C4kA/K52hQbTN1iHh6ARyrhDWHCM1uziqi5vUJW0/GpSUqrsu+2eg+pW 0vesjPSlYd1nfXwZxGswunfKNSMizAtfnABiN4lX70Pdg8rsJFN2gJ7fYvsr1eE1RLNYhO YKwJfAzE5X1YNOQZijEM0u6yCzdnv8cnIPuJ6DkmKG5rwqvLit8Y21wIheUTQM6yyUHftW mk2m1gkKYnlXEZZjMpfrjSqP4yvc0HJpSJXG5batFA1ouqdXDYO0Iq3EhkgQp/WohiZ4OT 4PS0EbUCVHc4zS7GR80yJuHa5cBV24IM9VUucvHIhlGVGE2ufI9i52Hah3smxA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52DBA1B768; Sun, 27 Mar 2022 20:14:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22RKEAm6037347; Sun, 27 Mar 2022 20:14:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22RKEAHo037346; Sun, 27 Mar 2022 20:14:10 GMT (envelope-from git) Date: Sun, 27 Mar 2022 20:14:10 GMT Message-Id: <202203272014.22RKEAHo037346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: eb5802659740 - stable/13 - LinuxKPI: 802.11: improve lkpi_80211_mo_sta_state() for non (*sta_state) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eb580265974013be43fa17d37e22124174a7ef86 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648412051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CkvLL4d23oIHFAtt8qRdXtkfdwAAauVLea3+Co2wa0A=; b=pZCMSnOVmEd7Qf6iyKNGTCAn3mPZfWtw+GgKB18e5D8Weoy9QhQmCin0WhMG/5eh25R75q RTBdtkNe55393UzhUJISexTqvItkKbGvExCOWhojCMHaJfEgn1Fo4WcdvuNIy8f/pi7ozg qwp3cJgvDV7FSsKRI2chuJW7UX0xwuKKt0Lch0kaRMLfgcgoNqOeD6v7JDYBlQWPYr3DAo ZbsXupMtK0EFCwp63Ivyx5U1dhLtDSgyY2mLBhbKLnl3Z8RGs6vNGgMaV/UGJhlBf2HM3B +JD2KK5wsJto+TAmoSJYAP++DbZI80oscVJWcL5j+s2fELRZTg0AptVtdwS+Lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648412051; a=rsa-sha256; cv=none; b=ZCdczDGQYsG90p2DkietvTSitV77n/sVSPnZJO6WPKibdhP/JoKgJ6WduGrvm0Qr3cpBqC 8NI94RPxtt6JJ3zcBENETSRxgdSdBIJAKF7qh5n5OxUqj/RhFs3lii4BZqqQth54EShyIo XLZgVcWLCbAhOWafC4u3GYfv6vrjFj6c28e0ASLzbM0ZNwijr1dtDB6BYgRHeu04VNs3r9 dFQoPx1Aw6zHhWRED8VOwp7N+0rI2GdkBzdXCgXQaP/j6lo4HUcZYESWM2JB73ojvBk3XD +a/AnXUTlShtiCMifJpAkWE+aMK9dlDSucVlXGQjwsuQIjs71bW0reD5Mow0cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=eb580265974013be43fa17d37e22124174a7ef86 commit eb580265974013be43fa17d37e22124174a7ef86 Author: Bjoern A. Zeeb AuthorDate: 2022-03-24 15:34:57 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-03-27 18:12:08 +0000 LinuxKPI: 802.11: improve lkpi_80211_mo_sta_state() for non (*sta_state) If a driver does not support (*sta_state)() we internally in lkpi_80211_mo_sta_state() fall back to using (*sta_add/*sta_remove)(). In that case add tracking of both added_to_drv and state fields for the lsta so that our state machine keeps working and assertions do not fire. Sponsored by: The FreeBSD Foundation (cherry picked from commit 878fb1e5754cc5bfbec57bc24859b07936f82a41) --- sys/compat/linuxkpi/common/src/linux_80211_macops.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c index 68e9ca47634b..e77aeb9afb67 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c +++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c @@ -355,14 +355,20 @@ lkpi_80211_mo_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif, } /* XXX-BZ is the change state AUTH or ASSOC here? */ - if (lsta->state < IEEE80211_STA_ASSOC && nstate == IEEE80211_STA_ASSOC) + if (lsta->state < IEEE80211_STA_ASSOC && nstate == IEEE80211_STA_ASSOC) { error = lkpi_80211_mo_sta_add(hw, vif, sta); - else if (lsta->state >= IEEE80211_STA_ASSOC && - nstate < IEEE80211_STA_ASSOC) + if (error == 0) + lsta->added_to_drv = true; + } else if (lsta->state >= IEEE80211_STA_ASSOC && + nstate < IEEE80211_STA_ASSOC) { error = lkpi_80211_mo_sta_remove(hw, vif, sta); - else + if (error == 0) + lsta->added_to_drv = false; + } else /* Nothing to do. */ error = 0; + if (error == 0) + lsta->state = nstate; out: /* XXX-BZ should we manage state in here? */