From nobody Thu Mar 24 16:14:20 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 AA80A1A203F7; Thu, 24 Mar 2022 16:14:20 +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 4KPVfN4MNyz4k9c; Thu, 24 Mar 2022 16:14:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648138460; 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=FBr77UnnhuTSQiiMnFC2caahN3nQndAhy290mLRV12E=; b=xNbea3IOtwp7lCpqOAd1IujFvjV0unyz5vRdFDvgaEfkJQJKSC4KVcFZIkXFcgoXli+rcY 4YDdpGl/WXP7kxWdWSZR0xL43SD96ueaITc+72O6tq4dnEiiXYxkw6l1r7ArpXtsBSiAHv SWwpiTomkE3X+AWMJ0jz03/JMy9NSW5IwHh2oeQfMYA3qp796K0JhkHZqZYjMy+81jQy7/ rVuwB6KgPxNN6Xv8sl2FxRLaZwdY5W1h48TaFNtjCi5dUBkIlUU+GpfAklNzyfKzX5mzpE SJU9NyayPsxLYd14NFrImL1p9g1iOijUCXzoLMr4b2KATJMY8qgaRqgmvVFeJw== 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 757551B404; Thu, 24 Mar 2022 16:14:20 +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 22OGEKMA077620; Thu, 24 Mar 2022 16:14:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22OGEK0G077619; Thu, 24 Mar 2022 16:14:20 GMT (envelope-from git) Date: Thu, 24 Mar 2022 16:14:20 GMT Message-Id: <202203241614.22OGEK0G077619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 878fb1e5754c - main - 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/main X-Git-Reftype: branch X-Git-Commit: 878fb1e5754cc5bfbec57bc24859b07936f82a41 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648138460; 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=FBr77UnnhuTSQiiMnFC2caahN3nQndAhy290mLRV12E=; b=aQnng7bDnwaHxBFJi8jVp3f6Rj289c+pogtVdgWw3UUU2MkQzabcidhcu/9+SL3tNJgTX6 mQ+9LlhqOk2Qiz8y2ac+Em/KL68/nzhCFIwH3rLWL1VFtWMY3/AtNuMIGqL+p1DC3FmR72 S1LpZYAkm3BjD/h6jYApUdPLjEXmkM9wm4rz2NfCHnPJYk1QAEaSzKpMDpoZ5mt8L0/LLw zIPTVswRRFNF5juVvu90FYB68gVPC6kkjRcIP6dm64/AfMaI4oRFNbr3FrE+tfZiMgizoS UhA6rm1P4UJNZkXgxDOpqkwcCPq8xxho9zzokC/3FzdIo8rmm6cKQTd4mpvxLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648138460; a=rsa-sha256; cv=none; b=gFUJJbXW7Ae9udfw7UyvuataClOQDWwo4KTYvfvas5KvChSVYSpn3DBbcvTyVTaA08C5Q2 AfCwwtFg6PtNjP3ocZElBq3m3X6KqRVMCbKXqqo9deM89JuB8jFju0ZVpHcvQ3LQPYGgcs Y+0CPWpCMgLblixskZReriQjg3AcdMAzI/702S/djh2a03Mqga2Ju9kwShAyrKEK/5aDW6 5rIQHImD4inQdgqTaEUFRpZq1q0LHH0ZqiAxFULNLPeqvK1uY/0YEK27Dp+R62aTL3fCu4 HHVWG1bSejF4VRYh+8fK0segV+/8kVH130qzsqQxcm4F0UBW98dKB2OiCG9dSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=878fb1e5754cc5bfbec57bc24859b07936f82a41 commit 878fb1e5754cc5bfbec57bc24859b07936f82a41 Author: Bjoern A. Zeeb AuthorDate: 2022-03-24 15:34:57 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-03-24 15:34:57 +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 MFC after: 3 days --- 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? */