-/* $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>
#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>
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
-/* $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.
struct device sc_dev;
struct ieee80211com sc_ic;
uint32_t sc_flags;
+ int sc_node;
int (*sc_newstate)(struct ieee80211com *, enum ieee80211_state, int);
-/* $OpenBSD: if_qwx_pci.c,v 1.4 2024/01/25 17:00:21 stsp Exp $ */
+/* $OpenBSD: if_qwx_pci.c,v 1.5 2024/02/03 20:07:19 kettenis Exp $ */
/*
* Copyright 2023 Stefan Sperling <stsp@openbsd.org>
psc->sc_pc = pa->pa_pc;
psc->sc_tag = pa->pa_tag;
+#ifdef __HAVE_FDT
+ sc->sc_node = PCITAG_NODE(pa->pa_tag);
+#endif
+
rw_init(&sc->ioctl_rwl, "qwxioctl");
sreg = pci_conf_read(psc->sc_pc, psc->sc_tag, PCI_SUBSYS_ID_REG);