summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2024-12-22 23:30:28 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2024-12-22 23:30:28 +0000
commitfaaeb3f19cc06dfdbba9afaac45224a91c6d1ce4 (patch)
treec5957d3fa18403a6b9ed20cad5ea13e0b1b801c3
parentc1985bc9a33f090e4192a4fae69420141cab6fb7 (diff)
Update num vdevs and peers definition to bring qwz(4) up to trying to scan.
-rw-r--r--sys/dev/ic/qwz.c20
-rw-r--r--sys/dev/ic/qwzreg.h33
-rw-r--r--sys/dev/ic/qwzvar.h4
3 files changed, 38 insertions, 19 deletions
diff --git a/sys/dev/ic/qwz.c b/sys/dev/ic/qwz.c
index 8889a891038..dc19627c8bc 100644
--- a/sys/dev/ic/qwz.c
+++ b/sys/dev/ic/qwz.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qwz.c,v 1.16 2024/12/11 04:53:17 patrick Exp $ */
+/* $OpenBSD: qwz.c,v 1.17 2024/12/22 23:30:27 patrick Exp $ */
/*
* Copyright 2023 Stefan Sperling <stsp@openbsd.org>
@@ -17580,6 +17580,16 @@ qwz_wmi_vdev_start(struct qwz_softc *sc, struct wmi_vdev_start_req_arg *arg,
return ret;
}
+uint32_t
+qwz_core_get_max_peers_per_radio(struct qwz_softc *sc)
+{
+ if (sc->num_radios == 2)
+ return TARGET_NUM_PEERS_PDEV_DBS;
+ else if (sc->num_radios == 3)
+ return TARGET_NUM_PEERS_PDEV_DBS_SBS;
+ return TARGET_NUM_PEERS_PDEV_SINGLE;
+}
+
int
qwz_core_start(struct qwz_softc *sc)
{
@@ -20312,7 +20322,7 @@ qwz_mac_register(struct qwz_softc *sc)
/* Initialize channel counters frequency value in hertz */
sc->cc_freq_hz = IPQ8074_CC_FREQ_HERTZ;
- sc->free_vdev_map = (1U << (sc->num_radios * TARGET_NUM_VDEVS(sc))) - 1;
+ sc->free_vdev_map = (1U << (sc->num_radios * TARGET_NUM_VDEVS)) - 1;
if (IEEE80211_ADDR_EQ(etheranyaddr, sc->sc_ic.ic_myaddr))
IEEE80211_ADDR_COPY(sc->sc_ic.ic_myaddr, sc->mac_addr);
@@ -20896,10 +20906,10 @@ qwz_mac_op_add_interface(struct qwz_pdev *pdev)
goto err;
}
#endif
- if (sc->num_created_vdevs > (TARGET_NUM_VDEVS(sc) - 1)) {
+ if (sc->num_created_vdevs > (TARGET_NUM_VDEVS - 1)) {
printf("%s: failed to create vdev %u, reached vdev limit %d\n",
sc->sc_dev.dv_xname, sc->num_created_vdevs,
- TARGET_NUM_VDEVS(sc));
+ TARGET_NUM_VDEVS);
ret = EBUSY;
goto err;
}
@@ -21391,7 +21401,7 @@ qwz_peer_create(struct qwz_softc *sc, struct qwz_vif *arvif, uint8_t pdev_id,
#ifdef notyet
lockdep_assert_held(&ar->conf_mutex);
#endif
- if (sc->num_peers > (TARGET_NUM_PEERS_PDEV(sc) - 1)) {
+ if (sc->num_peers > (qwz_core_get_max_peers_per_radio(sc) - 1)) {
DPRINTF("%s: failed to create peer due to insufficient "
"peer entry resource in firmware\n", __func__);
return ENOBUFS;
diff --git a/sys/dev/ic/qwzreg.h b/sys/dev/ic/qwzreg.h
index 6e7ecd50f5f..586b89e7de5 100644
--- a/sys/dev/ic/qwzreg.h
+++ b/sys/dev/ic/qwzreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: qwzreg.h,v 1.9 2024/12/11 04:53:17 patrick Exp $ */
+/* $OpenBSD: qwzreg.h,v 1.10 2024/12/22 23:30:27 patrick Exp $ */
/*
* Copyright (c) 2021-2022, Qualcomm Innovation Center, Inc.
@@ -10768,26 +10768,37 @@ enum ath12k_htc_ep_id {
/* Target configuration defines */
/* Num VDEVS per radio */
-#define TARGET_NUM_VDEVS(sc) (sc->hw_params.num_vdevs)
+#define TARGET_NUM_VDEVS (16 + 1)
-#define TARGET_NUM_PEERS_PDEV(sc) (sc->hw_params.num_peers + TARGET_NUM_VDEVS(sc))
+#define TARGET_NUM_PEERS_PDEV_SINGLE (TARGET_NUM_STATIONS_SINGLE + \
+ TARGET_NUM_VDEVS)
+#define TARGET_NUM_PEERS_PDEV_DBS (TARGET_NUM_STATIONS_DBS + \
+ TARGET_NUM_VDEVS)
+#define TARGET_NUM_PEERS_PDEV_DBS_SBS (TARGET_NUM_STATIONS_DBS_SBS + \
+ TARGET_NUM_VDEVS)
/* Num of peers for Single Radio mode */
-#define TARGET_NUM_PEERS_SINGLE(sc) (TARGET_NUM_PEERS_PDEV(sc))
+#define TARGET_NUM_PEERS_SINGLE (TARGET_NUM_PEERS_PDEV_SINGLE)
/* Num of peers for DBS */
-#define TARGET_NUM_PEERS_DBS(sc) (2 * TARGET_NUM_PEERS_PDEV(sc))
+#define TARGET_NUM_PEERS_DBS (2 * TARGET_NUM_PEERS_PDEV_DBS)
/* Num of peers for DBS_SBS */
-#define TARGET_NUM_PEERS_DBS_SBS(sc) (3 * TARGET_NUM_PEERS_PDEV(sc))
+#define TARGET_NUM_PEERS_DBS_SBS (3 * TARGET_NUM_PEERS_PDEV_DBS_SBS)
-/* Max num of stations (per radio) */
-#define TARGET_NUM_STATIONS(sc) (sc->hw_params.num_peers)
+/* Max num of stations for Single Radio mode */
+#define TARGET_NUM_STATIONS_SINGLE 512
-#define TARGET_NUM_PEERS(sc, x) TARGET_NUM_PEERS_##x(sc)
+/* Max num of stations for DBS */
+#define TARGET_NUM_STATIONS_DBS 128
+
+/* Max num of stations for DBS_SBS */
+#define TARGET_NUM_STATIONS_DBS_SBS 128
+
+#define TARGET_NUM_PEERS(x) TARGET_NUM_PEERS_##x
#define TARGET_NUM_PEER_KEYS 2
-#define TARGET_NUM_TIDS(sc, x) (2 * TARGET_NUM_PEERS(sc, x) + \
- 4 * TARGET_NUM_VDEVS(sc) + 8)
+#define TARGET_NUM_TIDS(x) (2 * TARGET_NUM_PEERS(x) + \
+ 4 * TARGET_NUM_VDEVS + 8)
#define TARGET_AST_SKID_LIMIT 16
#define TARGET_NUM_OFFLD_PEERS 4
diff --git a/sys/dev/ic/qwzvar.h b/sys/dev/ic/qwzvar.h
index cdd98684a7c..61530a4fde2 100644
--- a/sys/dev/ic/qwzvar.h
+++ b/sys/dev/ic/qwzvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: qwzvar.h,v 1.10 2024/12/11 04:53:17 patrick Exp $ */
+/* $OpenBSD: qwzvar.h,v 1.11 2024/12/22 23:30:27 patrick Exp $ */
/*
* Copyright (c) 2018-2019 The Linux Foundation.
@@ -227,8 +227,6 @@ struct ath12k_hw_params {
bool supports_shadow_regs;
bool idle_ps;
bool supports_sta_ps;
- uint32_t num_vdevs;
- uint32_t num_peers;
bool supports_suspend;
uint32_t hal_desc_sz;
bool fix_l1ss;