Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Oct 2023 23:16:19 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: c77b9b40fda8 - releng/14.0 - LinuxKPI: 802.11: pass non-0/NULL arguments to MO functions
Message-ID:  <202310092316.399NGJk7071468@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch releng/14.0 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=c77b9b40fda8f93efc6dee84440e1ff65e381cc5

commit c77b9b40fda8f93efc6dee84440e1ff65e381cc5
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-09-16 13:10:57 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-10-09 23:14:53 +0000

    LinuxKPI: 802.11: pass non-0/NULL arguments to MO functions
    
    In [1] we updated the KPI for various mac80211 ops functions to deal
    with MLD code.  Newer iwlwifi driver and firmware supports these
    functions so we need to pass non-dummy (0, NULL) arguments to them.
    Start extending the internel MO functions by these arguments and
    pass down values from LinuxKPI 802.11 code.
    It is assumed that further work will be needed to have all the
    right fields available to at least work in the lgeacy way of a
    single link.
    
    Sponsored by:   The FreeBSD Foundation
    Improves:       549198b1ab95 (update mac80211 KPI) [1]
    Approved by:    re (gjb)
    
    (cherry picked from commit 6854154638a2c04ab59da43aedbe2c0ee8ef71a5)
    (cherry picked from commit be5f1d2e7138eb680db400813af54d9f33d9b252)
---
 sys/compat/linuxkpi/common/src/linux_80211.c        | 11 ++++++-----
 sys/compat/linuxkpi/common/src/linux_80211.h        |  6 +++---
 sys/compat/linuxkpi/common/src/linux_80211_macops.c | 21 ++++++++++++---------
 3 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index ab79fd36ca14..ac43b1248536 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -991,7 +991,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
 		}
 		/* Assign vif chanctx. */
 		if (error == 0)
-			error = lkpi_80211_mo_assign_vif_chanctx(hw, vif, conf);
+			error = lkpi_80211_mo_assign_vif_chanctx(hw, vif,
+			    &vif->bss_conf, conf);
 		if (error == EOPNOTSUPP)
 			error = 0;
 		if (error != 0) {
@@ -1172,7 +1173,7 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int
 
 		conf = vif->chanctx_conf;
 		/* Remove vif context. */
-		lkpi_80211_mo_unassign_vif_chanctx(hw, vif, &vif->chanctx_conf);
+		lkpi_80211_mo_unassign_vif_chanctx(hw, vif, &vif->bss_conf, &vif->chanctx_conf);
 		/* NB: vif->chanctx_conf is NULL now. */
 
 		/* Remove chan ctx. */
@@ -1447,7 +1448,7 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i
 
 		conf = vif->chanctx_conf;
 		/* Remove vif context. */
-		lkpi_80211_mo_unassign_vif_chanctx(hw, vif, &vif->chanctx_conf);
+		lkpi_80211_mo_unassign_vif_chanctx(hw, vif, &vif->bss_conf, &vif->chanctx_conf);
 		/* NB: vif->chanctx_conf is NULL now. */
 
 		/* Remove chan ctx. */
@@ -1909,7 +1910,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int
 
 		conf = vif->chanctx_conf;
 		/* Remove vif context. */
-		lkpi_80211_mo_unassign_vif_chanctx(hw, vif, &vif->chanctx_conf);
+		lkpi_80211_mo_unassign_vif_chanctx(hw, vif, &vif->bss_conf, &vif->chanctx_conf);
 		/* NB: vif->chanctx_conf is NULL now. */
 
 		/* Remove chan ctx. */
@@ -2200,7 +2201,7 @@ lkpi_wme_update(struct lkpi_hw *lhw, struct ieee80211vap *vap, bool planned)
 		txqp.cw_max = wmep->wmep_logcwmax;
 		txqp.txop = wmep->wmep_txopLimit;
 		txqp.aifs = wmep->wmep_aifsn;
-		error = lkpi_80211_mo_conf_tx(hw, vif, ac, &txqp);
+		error = lkpi_80211_mo_conf_tx(hw, vif, /* link_id */0, ac, &txqp);
 		if (error != 0)
 			ic_printf(ic, "%s: conf_tx ac %u failed %d\n",
 			    __func__, ac, error);
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h
index 42b4192bac63..22a5f5a6377c 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.h
+++ b/sys/compat/linuxkpi/common/src/linux_80211.h
@@ -276,9 +276,9 @@ int lkpi_80211_mo_sta_state(struct ieee80211_hw *, struct ieee80211_vif *,
     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 *);
+    struct ieee80211_bss_conf *, struct ieee80211_chanctx_conf *);
 void lkpi_80211_mo_unassign_vif_chanctx(struct ieee80211_hw *, struct ieee80211_vif *,
-    struct ieee80211_chanctx_conf **);
+    struct ieee80211_bss_conf *, struct ieee80211_chanctx_conf **);
 int lkpi_80211_mo_add_chanctx(struct ieee80211_hw *, struct ieee80211_chanctx_conf *);
 void lkpi_80211_mo_change_chanctx(struct ieee80211_hw *,
     struct ieee80211_chanctx_conf *, uint32_t);
@@ -287,7 +287,7 @@ void lkpi_80211_mo_remove_chanctx(struct ieee80211_hw *,
 void lkpi_80211_mo_bss_info_changed(struct ieee80211_hw *, struct ieee80211_vif *,
     struct ieee80211_bss_conf *, uint64_t);
 int lkpi_80211_mo_conf_tx(struct ieee80211_hw *, struct ieee80211_vif *,
-    uint16_t, const struct ieee80211_tx_queue_params *);
+    uint32_t, uint16_t, const struct ieee80211_tx_queue_params *);
 void lkpi_80211_mo_flush(struct ieee80211_hw *, struct ieee80211_vif *,
     uint32_t, bool);
 void lkpi_80211_mo_mgd_prepare_tx(struct ieee80211_hw *, struct ieee80211_vif *,
diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c
index 97a72a95e418..b3b53d23f62e 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c
@@ -444,7 +444,7 @@ out:
 
 int
 lkpi_80211_mo_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
-    struct ieee80211_chanctx_conf *chanctx_conf)
+    struct ieee80211_bss_conf *conf, struct ieee80211_chanctx_conf *chanctx_conf)
 {
 	struct lkpi_hw *lhw;
 	int error;
@@ -455,8 +455,9 @@ lkpi_80211_mo_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *
 		goto out;
 	}
 
-	LKPI_80211_TRACE_MO("hw %p vif %p chanctx_conf %p", hw, vif, chanctx_conf);
-	error = lhw->ops->assign_vif_chanctx(hw, vif, NULL, chanctx_conf);
+	LKPI_80211_TRACE_MO("hw %p vif %p bss_conf %p chanctx_conf %p",
+	    hw, vif, conf, chanctx_conf);
+	error = lhw->ops->assign_vif_chanctx(hw, vif, conf, chanctx_conf);
 	if (error == 0)
 		vif->chanctx_conf = chanctx_conf;
 
@@ -466,7 +467,7 @@ out:
 
 void
 lkpi_80211_mo_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
-    struct ieee80211_chanctx_conf **chanctx_conf)
+    struct ieee80211_bss_conf *conf, struct ieee80211_chanctx_conf **chanctx_conf)
 {
 	struct lkpi_hw *lhw;
 
@@ -477,8 +478,9 @@ lkpi_80211_mo_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif
 	if (*chanctx_conf == NULL)
 		return;
 
-	LKPI_80211_TRACE_MO("hw %p vif %p chanctx_conf %p", hw, vif, *chanctx_conf);
-	lhw->ops->unassign_vif_chanctx(hw, vif, NULL, *chanctx_conf);
+	LKPI_80211_TRACE_MO("hw %p vif %p bss_conf %p chanctx_conf %p",
+	    hw, vif, conf, *chanctx_conf);
+	lhw->ops->unassign_vif_chanctx(hw, vif, conf, *chanctx_conf);
 	*chanctx_conf = NULL;
 }
 
@@ -551,7 +553,7 @@ lkpi_80211_mo_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vi
 
 int
 lkpi_80211_mo_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
-    uint16_t ac, const struct ieee80211_tx_queue_params *txqp)
+    uint32_t link_id, uint16_t ac, const struct ieee80211_tx_queue_params *txqp)
 {
 	struct lkpi_hw *lhw;
 	int error;
@@ -562,8 +564,9 @@ lkpi_80211_mo_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		goto out;
 	}
 
-	LKPI_80211_TRACE_MO("hw %p vif %p ac %u txpq %p", hw, vif, ac, txqp);
-	error = lhw->ops->conf_tx(hw, vif, 0, ac, txqp);
+	LKPI_80211_TRACE_MO("hw %p vif %p link_id %u ac %u txpq %p",
+	    hw, vif, link_id, ac, txqp);
+	error = lhw->ops->conf_tx(hw, vif, link_id, ac, txqp);
 
 out:
 	return (error);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202310092316.399NGJk7071468>