diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2024-02-03 20:07:20 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2024-02-03 20:07:20 +0000 |
commit | 9c7bc327adefaaa119bf6ea8d0a8809b26800397 (patch) | |
tree | f49997ca394a717e046ca65adbb7547d12d8e109 /sys/dev/ic | |
parent | bd41eff00aebbc2c27daeef56e2f3f9de81e61ab (diff) |
Try to fetch the board variant from the device tree on platforms that have
one (e.g. on arm64). Needed to extract the right information from the
qwx(4) firmware on the x13s.
ok stsp@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/qwx.c | 16 | ||||
-rw-r--r-- | sys/dev/ic/qwxvar.h | 3 |
2 files changed, 16 insertions, 3 deletions
diff --git a/sys/dev/ic/qwx.c b/sys/dev/ic/qwx.c index 85304096065..65b15c8cae9 100644 --- a/sys/dev/ic/qwx.c +++ b/sys/dev/ic/qwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qwx.c,v 1.15 2024/02/03 10:03:18 stsp Exp $ */ +/* $OpenBSD: qwx.c,v 1.16 2024/02/03 20:07:19 kettenis Exp $ */ /* * Copyright 2023 Stefan Sperling <stsp@openbsd.org> @@ -68,6 +68,10 @@ #include <machine/bus.h> #include <machine/intr.h> +#ifdef __HAVE_FDT +#include <dev/ofw/openfirm.h> +#endif + #include <net/if.h> #include <net/if_media.h> @@ -7847,7 +7851,15 @@ qwx_core_check_smbios(struct qwx_softc *sc) int qwx_core_check_dt(struct qwx_softc *sc) { - return 0; /* TODO */ +#ifdef __HAVE_FDT + if (sc->sc_node == 0) + return 0; + + OF_getprop(sc->sc_node, "qcom,ath11k-calibration-variant", + sc->qmi_target.bdf_ext, sizeof(sc->qmi_target.bdf_ext) - 1); +#endif + + return 0; } int diff --git a/sys/dev/ic/qwxvar.h b/sys/dev/ic/qwxvar.h index 67a951f3527..e59d7b77a27 100644 --- a/sys/dev/ic/qwxvar.h +++ b/sys/dev/ic/qwxvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: qwxvar.h,v 1.10 2024/02/03 10:03:18 stsp Exp $ */ +/* $OpenBSD: qwxvar.h,v 1.11 2024/02/03 20:07:19 kettenis Exp $ */ /* * Copyright (c) 2018-2019 The Linux Foundation. @@ -1628,6 +1628,7 @@ struct qwx_softc { struct device sc_dev; struct ieee80211com sc_ic; uint32_t sc_flags; + int sc_node; int (*sc_newstate)(struct ieee80211com *, enum ieee80211_state, int); |