From nobody Tue Nov 01 00:02:43 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 4N1VZq3Pg0z4gt0R; Tue, 1 Nov 2022 00:02:43 +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 4N1VZq2q1Tz3LY1; Tue, 1 Nov 2022 00:02:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667260963; 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=7yNTUYIwwLcM3UM8xoOrLnnlmVrB1qegTmZXr+N2j+k=; b=YWWUcgDnuj7QQ3DnsPIYfYKImvwL9DNXu5T2c69Gjg25hPAvAitvWhzEON4dVt3ce2lbxA 0A7OLzkxUWHS7BB/tH1G3RSTHO2K+6rDuh6KlzOk/Fy/gqA+46sDV0TpnyUtKHq/gfEKe8 4lu+26J+C066JZkD2zoObKsNAv5gU7Zskazup8UCuPxIcaUVcPjrNXOfx++ksW5HBz/PcW 3SlIKvNlD+xTUUyeTYM2Hdxc51F0Wenv6KwE97S38XsmIg8oss76vuo0o2lLq1eqyDY0KL WU1KiJss5yo43OWed9un9Etu/IneZrdzDbFkWBGtZfFLa3Bk2zSLpuw5fTYpQQ== 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 4N1VZq1vFCzvld; Tue, 1 Nov 2022 00:02:43 +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 2A102hWc085045; Tue, 1 Nov 2022 00:02:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A102h18085044; Tue, 1 Nov 2022 00:02:43 GMT (envelope-from git) Date: Tue, 1 Nov 2022 00:02:43 GMT Message-Id: <202211010002.2A102h18085044@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: e7fe037310ed - main - 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/main X-Git-Reftype: branch X-Git-Commit: e7fe037310eda2018da6dde78e3be525d71bed03 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667260963; 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=7yNTUYIwwLcM3UM8xoOrLnnlmVrB1qegTmZXr+N2j+k=; b=pB1Gqi5ubnQPW1nn5z1sCUceKX5rGM19D4ELQXSCxL8h4zj0NqcJn3FEJFe125vBXYcPVj wtyNpn9Y6/NStPzd8oN0qRFd0hR1G5NxhMBVQP/1dMmkeJEl4yU5YRDFtojUTU+wcDNoj3 hRD9VF8rDaFxhdo3jCc3uV/mKDVkMuaI10O+52KNK0aCRrGrZIrjrfPinf9ZCjMlZri9Xb XY0nYL6tXB7ktVDVtqRxRM3DXZwlMdz2OwsDi+g18VbGlxkEwa8jATyYLWsMTE55N9Ak4W HiZLpSBpfvQgaP1JQtSWJd7lOTAOjU3IR7T4ADOEOo8ZB8bJZvp1IsJM2DXIkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667260963; a=rsa-sha256; cv=none; b=pJ0/K8DdvZVA0dQOt6US+DxrKGEjtrqTURuUK3VVOVWEsisGbut6lXTA6WCIFvHs3z+arE WpehEEw14mgC8Ztt1xHGC4gGXJMGN4bKzdAP7Fr8Aigu8kYfLQa3IXOuXlEJkQUGUlyZrx AT8p/uNQfbgajol4gcD93FuFQwPLh+kLzzPO1JFPZXUl68DLAD9f0j5dVJlvYopAVBigts PtUrfJKSIgwAMLFzHXpfKi03Clc21v39cxyO+Ec3qFerXr4UqLAFt9p3MTWJx3t+OLaiYe LhyGQe18Nf3TXOKkb+yvHMx0DTRi8jPo/Nl1kf4q01C4cHLp9nv/5II26dsRlQ== 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=e7fe037310eda2018da6dde78e3be525d71bed03 commit e7fe037310eda2018da6dde78e3be525d71bed03 Author: Bjoern A. Zeeb AuthorDate: 2022-10-31 23:53:26 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-11-01 00:00:18 +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 MFC after: 3 days --- 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 b4438c0b1518..c1606be3e1f9 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);