From nobody Mon Nov 28 17:27:01 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 4NLXTL0V5vz4jQwN; Mon, 28 Nov 2022 17:27:02 +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 4NLXTK6lmmz43Rw; Mon, 28 Nov 2022 17:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669656422; 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=k1zJGiw3jqlpsiPis5Cn6mA6cyo/joL1BHAcAb6xPIo=; b=IZDdPUs8FstDwS+HvJQlSVgAWbjP7p8j5cj1/CSslufeFhTyFNI904P5kzDOdhx2FEWdc0 ooWTjLf8WU36dNMkLl4965w6IUugxvKOVHANVWrm0qsq5FE4YJpDyfysZHAbMDm/A0OYi3 yKJnhH8iY/1Z7pzfl+sV/T4ILIx16S0l9BYIvT3wyOrgemsZZG3XiNBs+9xt/Qh3pPycZm KMvBIswfdypIcwQZTQxuqKDsyDPGri2o5AAkFZdbOmHyM9jD2Z0UmRZAJFJt7oy5prd6LA EocO3D3Uv3W1yej91CSra68cqea0wap2bAlx1sUJJTLOL0ldD2l18pfPAhvljQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669656422; 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=k1zJGiw3jqlpsiPis5Cn6mA6cyo/joL1BHAcAb6xPIo=; b=wAd7wZeTo5MN4yskq0R7zCHXh1FxMvDLjc4xIYJmcKj7knq6s6hvQrNgMr5daQApUhGQHu UFKu8rseDRbCSZGOmQGbUgWuM5UDeMKI86nlezCd7L6xo4TTkV/2Wo1WeEOQgMzZZ+nW+Q RxgS6O+snKRlqpiy4mMV/JKIP6C4kAynk5QNei6E/WmVUQ4kUkgs75HoefDAV2pV8vxmNe eDQlnW41X+3l+zrTLZKVbOSXGcdbJxsprr5CwIqlFFKZMURSOC/f0IZUlGx7klHQr2egyD LFzPyDilldt3k5dRyIW2JN7JlbFxp10o5jwAfb/gbc+OFjt12VY34cUsKFrP0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669656422; a=rsa-sha256; cv=none; b=TVDNOQXqRYMzagszFK1cAQJzPkKk6JcDQfxqBZhsJoVzNKfygI2C9vhMdb423AToE+hquv vkNCBlQlLMOPjfZoMHd1U3V0cwhHe/vD1OuihC2LBt32DSQloXKS7pq1/atkDHZimIh7kN YRp7GGo0Jm97792CWJkdaaA2GAf7PHXyi6gkuqnRpZEQJu5dJvZu+4hr8AFrJw+xDvuJdk pSmUmJlXDOsIm/ARDelwFU3SlG9IOBvepDL6naRoEBfRtTKtbE0ivQ1fquQMN1VAg70zwP mIhSG7c8NMvUZNfnlStSUUYrle3UPIDxCEzBH9oNztf0ysGJvRsHp25qveO1kg== 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 4NLXTK5kVSzlxN; Mon, 28 Nov 2022 17:27:01 +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 2ASHR14M081177; Mon, 28 Nov 2022 17:27:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2ASHR1tw081176; Mon, 28 Nov 2022 17:27:01 GMT (envelope-from git) Date: Mon, 28 Nov 2022 17:27:01 GMT Message-Id: <202211281727.2ASHR1tw081176@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: 590aca2bd9d3 - stable/13 - LinuxKPI: 802.11: pass internal variable to lkpi_80211_mo_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: 590aca2bd9d3ddc2dcab2750524cb2c6d3cc9d77 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=590aca2bd9d3ddc2dcab2750524cb2c6d3cc9d77 commit 590aca2bd9d3ddc2dcab2750524cb2c6d3cc9d77 Author: Bjoern A. Zeeb AuthorDate: 2022-10-31 23:53:26 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-11-28 16:30:42 +0000 LinuxKPI: 802.11: pass internal variable to lkpi_80211_mo_sta_state() With mac80211 operations (MO) tracing on we have seen some ill-ordered executions of MO functions. In order to limit visibility of the mac80211 sta, pass the internal version into lkpi_80211_mo_sta_state() and only there convert to the argument needed. This mostly eases tracing and debugging. Sposnored by: The FreeBSD Foundation (cherry picked from commit e7fe037310eda2018da6dde78e3be525d71bed03) --- sys/compat/linuxkpi/common/src/linux_80211.c | 34 ++++++++++------------ sys/compat/linuxkpi/common/src/linux_80211.h | 2 +- .../linuxkpi/common/src/linux_80211_macops.c | 6 ++-- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 110aaabbc58c..4423109cc4b8 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -906,7 +906,6 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int struct ieee80211_vif *vif; struct ieee80211_node *ni; struct lkpi_sta *lsta; - struct ieee80211_sta *sta; enum ieee80211_bss_changed bss_changed; struct ieee80211_prep_tx_info prep_tx_info; uint32_t changed; @@ -1032,8 +1031,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_NOTEXIST, ("%s: lsta %p state not " "NOTEXIST: %#x\n", __func__, lsta, lsta->state)); - sta = LSTA_TO_STA(lsta); - error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_NONE); + error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_NONE); if (error != 0) { IMPROVE("do we need to undo the chan ctx?"); goto out; @@ -1052,7 +1050,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int * XXX-BZ and by now we know that this does not work on all drivers * for all queues. */ - lkpi_wake_tx_queues(hw, sta, false, false); + lkpi_wake_tx_queues(hw, LSTA_TO_STA(lsta), false, false); /* Start mgd_prepare_tx. */ memset(&prep_tx_info, 0, sizeof(prep_tx_info)); @@ -1132,7 +1130,7 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_NONE, ("%s: lsta %p state not " "NONE: %#x, nstate %d arg %d\n", __func__, lsta, lsta->state, nstate, arg)); - error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_NOTEXIST); + error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_NOTEXIST); if (error != 0) { IMPROVE("do we need to undo the chan ctx?"); goto out; @@ -1188,7 +1186,6 @@ lkpi_sta_auth_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, in struct ieee80211_vif *vif; struct ieee80211_node *ni; struct lkpi_sta *lsta; - struct ieee80211_sta *sta; struct ieee80211_prep_tx_info prep_tx_info; int error; @@ -1209,8 +1206,7 @@ lkpi_sta_auth_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, in KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_NONE, ("%s: lsta %p state not " "NONE: %#x\n", __func__, lsta, lsta->state)); - sta = LSTA_TO_STA(lsta); - error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_AUTH); + error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_AUTH); if (error != 0) goto out; @@ -1233,7 +1229,7 @@ lkpi_sta_auth_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, in } /* Wake tx queue to get packet out. */ - lkpi_wake_tx_queues(hw, sta, true, true); + lkpi_wake_tx_queues(hw, LSTA_TO_STA(lsta), true, true); /* * .. we end up in "assoc_to_run" @@ -1378,7 +1374,7 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_AUTH, ("%s: lsta %p state not " "AUTH: %#x\n", __func__, lsta, lsta->state)); - error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_NONE); + error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_NONE); if (error != 0) goto out; @@ -1388,7 +1384,7 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_NONE, ("%s: lsta %p state not " "NONE: %#x, nstate %d arg %d\n", __func__, lsta, lsta->state, nstate, arg)); - error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_NOTEXIST); + error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_NOTEXIST); if (error != 0) { IMPROVE("do we need to undo the chan ctx?"); goto out; @@ -1506,7 +1502,7 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int "AUTH: %#x\n", __func__, lsta, lsta->state)); sta = LSTA_TO_STA(lsta); sta->aid = IEEE80211_NODE_AID(ni); - error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_ASSOC); + error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_ASSOC); if (error != 0) goto out; @@ -1576,7 +1572,7 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_ASSOC, ("%s: lsta %p state not " "ASSOC: %#x\n", __func__, lsta, lsta->state)); - error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_AUTHORIZED); + error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_AUTHORIZED); if (error != 0) { IMPROVE("undo some changes?"); goto out; @@ -1693,7 +1689,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_AUTHORIZED, ("%s: lsta %p state not " "AUTHORIZED: %#x\n", __func__, lsta, lsta->state)); - error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_ASSOC); + error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_ASSOC); if (error != 0) goto out; @@ -1703,7 +1699,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_ASSOC, ("%s: lsta %p state not " "ASSOC: %#x\n", __func__, lsta, lsta->state)); - error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_AUTH); + error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_AUTH); if (error != 0) goto out; @@ -1800,7 +1796,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_AUTHORIZED, ("%s: lsta %p state not " "AUTHORIZED: %#x\n", __func__, lsta, lsta->state)); - error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_ASSOC); + error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_ASSOC); if (error != 0) goto out; @@ -1810,7 +1806,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_ASSOC, ("%s: lsta %p state not " "ASSOC: %#x\n", __func__, lsta, lsta->state)); - error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_AUTH); + error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_AUTH); if (error != 0) goto out; @@ -1820,7 +1816,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_AUTH, ("%s: lsta %p state not " "AUTH: %#x\n", __func__, lsta, lsta->state)); - error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_NONE); + error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_NONE); if (error != 0) goto out; @@ -1830,7 +1826,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_NONE, ("%s: lsta %p state not " "NONE: %#x, nstate %d arg %d\n", __func__, lsta, lsta->state, nstate, arg)); - error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_NOTEXIST); + error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_NOTEXIST); if (error != 0) { IMPROVE("do we need to undo the chan ctx?"); goto out; diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 587549ee786a..fc50521e57bf 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -239,7 +239,7 @@ u64 lkpi_80211_mo_prepare_multicast(struct ieee80211_hw *, void lkpi_80211_mo_configure_filter(struct ieee80211_hw *, unsigned int, unsigned int *, u64); int lkpi_80211_mo_sta_state(struct ieee80211_hw *, struct ieee80211_vif *, - struct ieee80211_sta *, enum ieee80211_sta_state); + struct lkpi_sta *, enum ieee80211_sta_state); int lkpi_80211_mo_config(struct ieee80211_hw *, uint32_t); int lkpi_80211_mo_assign_vif_chanctx(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_chanctx_conf *); diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c index 5e08ad570668..762a54e4a823 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c +++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c @@ -377,14 +377,14 @@ out: int lkpi_80211_mo_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - struct ieee80211_sta *sta, enum ieee80211_sta_state nstate) + struct lkpi_sta *lsta, enum ieee80211_sta_state nstate) { struct lkpi_hw *lhw; - struct lkpi_sta *lsta; + struct ieee80211_sta *sta; int error; lhw = HW_TO_LHW(hw); - lsta = STA_TO_LSTA(sta); + sta = LSTA_TO_STA(lsta); if (lhw->ops->sta_state != NULL) { LKPI_80211_TRACE_MO("hw %p vif %p sta %p nstate %d", hw, vif, sta, nstate); error = lhw->ops->sta_state(hw, vif, sta, lsta->state, nstate);