Add 8265 and 3168 support. Both cards need new firmware files which currently
authorclaudio <claudio@openbsd.org>
Tue, 4 Apr 2017 00:40:52 +0000 (00:40 +0000)
committerclaudio <claudio@openbsd.org>
Tue, 4 Apr 2017 00:40:52 +0000 (00:40 +0000)
need to be installed by hand until the iwm-firmware package has been updated.
This includes handling (by ignoring) of IWM_UCODE_TLV_FW_MEM_SEG and
IWM_DEBUG_LOG_MSG firmware commands. Mostly stolen from dragonflybsd.
With this in the X270 has working ethernet and wifi.
Commit! deraadt@

sys/dev/pci/if_iwm.c
sys/dev/pci/if_iwmreg.h

index 947bd97..d90ddf0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_iwm.c,v 1.166 2017/03/08 12:02:41 mpi Exp $        */
+/*     $OpenBSD: if_iwm.c,v 1.167 2017/04/04 00:40:52 claudio Exp $    */
 
 /*
  * Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -789,6 +789,9 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode_type ucode_type)
                            le32toh(((uint32_t *)tlv_data)[2]));
                        break;
 
+               case IWM_UCODE_TLV_FW_MEM_SEG:
+                       break;
+
                default:
                        err = EINVAL;
                        goto parse_out;
@@ -6673,6 +6676,13 @@ iwm_notif_intr(struct iwm_softc *sc)
                        break;
                }
 
+               /*
+                * Firmware versions 21 and 22 generate some DEBUG_LOG_MSG
+                * messages. Just ignore them for now.
+                */
+               case IWM_DEBUG_LOG_MSG:
+                       break;
+
                case IWM_MCAST_FILTER_CMD:
                        break;
 
@@ -6858,12 +6868,14 @@ static const struct pci_matchid iwm_devices[] = {
        { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_3160_2 },
        { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_3165_1 },
        { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_3165_2 },
+       { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_3168_1 },
        { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_7260_1 },
        { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_7260_2 },
        { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_7265_1 },
        { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_7265_2 },
        { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_8260_1 },
        { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_8260_2 },
+       { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_8265_1 },
 };
 
 int
@@ -7029,6 +7041,12 @@ iwm_attach(struct device *parent, struct device *self, void *aux)
                sc->sc_device_family = IWM_DEVICE_FAMILY_7000;
                sc->sc_fwdmasegsz = IWM_FWDMASEGSZ;
                break;
+       case PCI_PRODUCT_INTEL_WL_3168_1:
+               sc->sc_fwname = "iwm-3168-22";
+               sc->host_interrupt_operation_mode = 0;
+               sc->sc_device_family = IWM_DEVICE_FAMILY_7000;
+               sc->sc_fwdmasegsz = IWM_FWDMASEGSZ;
+               break;
        case PCI_PRODUCT_INTEL_WL_7260_1:
        case PCI_PRODUCT_INTEL_WL_7260_2:
                sc->sc_fwname = "iwm-7260-16";
@@ -7050,6 +7068,12 @@ iwm_attach(struct device *parent, struct device *self, void *aux)
                sc->sc_device_family = IWM_DEVICE_FAMILY_8000;
                sc->sc_fwdmasegsz = IWM_FWDMASEGSZ_8000;
                break;
+       case PCI_PRODUCT_INTEL_WL_8265_1:
+               sc->sc_fwname = "iwm-8265-22";
+               sc->host_interrupt_operation_mode = 0;
+               sc->sc_device_family = IWM_DEVICE_FAMILY_8000;
+               sc->sc_fwdmasegsz = IWM_FWDMASEGSZ_8000;
+               break;
        default:
                printf("%s: unknown adapter type\n", DEVNAME(sc));
                return;
index ab34cc1..b2576e5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_iwmreg.h,v 1.24 2017/01/31 10:17:50 stsp Exp $     */
+/*     $OpenBSD: if_iwmreg.h,v 1.25 2017/04/04 00:40:52 claudio Exp $  */
 
 /******************************************************************************
  *
@@ -906,6 +906,7 @@ struct iwm_ucode_header {
 #define IWM_UCODE_TLV_FW_DBG_CONF      39
 #define IWM_UCODE_TLV_FW_DBG_TRIGGER   40
 #define IWM_UCODE_TLV_FW_GSCAN_CAPA    50
+#define IWM_UCODE_TLV_FW_MEM_SEG       51
 
 struct iwm_ucode_tlv {
        uint32_t type;          /* see above */