summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjcs <jcs@openbsd.org>2021-01-17 14:24:00 +0000
committerjcs <jcs@openbsd.org>2021-01-17 14:24:00 +0000
commit8edfa316af4155e6583562fc817d827a3f2fbd09 (patch)
tree0b15828d03de41f26bce4c9a53d74372e3de4e27
parentregen (diff)
downloadwireguard-openbsd-8edfa316af4155e6583562fc817d827a3f2fbd09.tar.xz
wireguard-openbsd-8edfa316af4155e6583562fc817d827a3f2fbd09.zip
add another iwx device
ok stsp jsg
-rw-r--r--sys/dev/pci/if_iwx.c29
-rw-r--r--sys/dev/pci/if_iwxreg.h3
2 files changed, 21 insertions, 11 deletions
diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c
index 2a668d0bd2f..c1f839f2977 100644
--- a/sys/dev/pci/if_iwx.c
+++ b/sys/dev/pci/if_iwx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwx.c,v 1.48 2020/12/12 11:48:53 jan Exp $ */
+/* $OpenBSD: if_iwx.c,v 1.49 2021/01/17 14:24:00 jcs Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -7709,6 +7709,7 @@ typedef void *iwx_match_t;
static const struct pci_matchid iwx_devices[] = {
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_22500_1 },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_22500_2 },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_22500_3 },
};
static const struct pci_matchid iwx_subsystem_id_ax201[] = {
@@ -7747,6 +7748,7 @@ iwx_match(struct device *parent, iwx_match_t match __unused, void *aux)
case PCI_PRODUCT_INTEL_WL_22500_1: /* AX200 */
return 1; /* match any device */
case PCI_PRODUCT_INTEL_WL_22500_2: /* AX201 */
+ case PCI_PRODUCT_INTEL_WL_22500_3: /* AX201 */
for (i = 0; i < nitems(iwx_subsystem_id_ax201); i++) {
if (svid == iwx_subsystem_id_ax201[i].pm_vid &&
spid == iwx_subsystem_id_ax201[i].pm_pid)
@@ -7910,6 +7912,16 @@ iwx_attach(struct device *parent, struct device *self, void *aux)
IWX_WRITE(sc, IWX_CSR_FH_INT_STATUS, ~0);
sc->sc_hw_rev = IWX_READ(sc, IWX_CSR_HW_REV);
+
+ /*
+ * In the 8000 HW family the format of the 4 bytes of CSR_HW_REV have
+ * changed, and now the revision step also includes bit 0-1 (no more
+ * "dash" value). To keep hw_rev backwards compatible - we'll store it
+ * in the old format.
+ */
+ sc->sc_hw_rev = (sc->sc_hw_rev & 0xfff0) |
+ (IWX_CSR_HW_REV_STEP(sc->sc_hw_rev << 2) << 2);
+
switch (PCI_PRODUCT(pa->pa_id)) {
case PCI_PRODUCT_INTEL_WL_22500_1:
sc->sc_fwname = "iwx-cc-a0-48";
@@ -7923,6 +7935,12 @@ iwx_attach(struct device *parent, struct device *self, void *aux)
sc->sc_uhb_supported = 0;
break;
case PCI_PRODUCT_INTEL_WL_22500_2:
+ case PCI_PRODUCT_INTEL_WL_22500_3:
+ if (sc->sc_hw_rev != IWX_CSR_HW_REV_TYPE_QUZ) {
+ printf("%s: unsupported AX201 adapter\n", DEVNAME(sc));
+ return;
+ }
+
sc->sc_fwname = "iwx-QuZ-a0-hr-b0-48";
sc->sc_device_family = IWX_DEVICE_FAMILY_22000;
sc->sc_fwdmasegsz = IWX_FWDMASEGSZ_8000;
@@ -7938,15 +7956,6 @@ iwx_attach(struct device *parent, struct device *self, void *aux)
return;
}
- /*
- * In the 8000 HW family the format of the 4 bytes of CSR_HW_REV have
- * changed, and now the revision step also includes bit 0-1 (no more
- * "dash" value). To keep hw_rev backwards compatible - we'll store it
- * in the old format.
- */
- sc->sc_hw_rev = (sc->sc_hw_rev & 0xfff0) |
- (IWX_CSR_HW_REV_STEP(sc->sc_hw_rev << 2) << 2);
-
if (iwx_prepare_card_hw(sc) != 0) {
printf("%s: could not initialize hardware\n",
DEVNAME(sc));
diff --git a/sys/dev/pci/if_iwxreg.h b/sys/dev/pci/if_iwxreg.h
index 789075c0e54..ddc43a933a0 100644
--- a/sys/dev/pci/if_iwxreg.h
+++ b/sys/dev/pci/if_iwxreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwxreg.h,v 1.17 2020/08/01 16:14:05 stsp Exp $ */
+/* $OpenBSD: if_iwxreg.h,v 1.18 2021/01/17 14:24:00 jcs Exp $ */
/*-
* Based on BSD-licensed source modules in the Linux iwlwifi driver,
@@ -425,6 +425,7 @@ struct iwx_context_info {
#define IWX_CSR_HW_REV_STEP(_val) (((_val) & 0x000000C) >> 2)
#define IWX_CSR_HW_REV_TYPE_MSK (0x000FFF0)
+#define IWX_CSR_HW_REV_TYPE_QUZ (0x0000354)
/* CSR GIO */
#define IWX_CSR_GIO_REG_VAL_L0S_DISABLED (0x00000002)