The global host_interrupt_operation_mode variable can be represented
as a flag. This is just a cosmetic change.

Index: if_iwm.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v
retrieving revision 1.146
diff -u -p -r1.146 if_iwm.c
--- if_iwm.c    1 Nov 2016 13:49:50 -0000       1.146
+++ if_iwm.c    1 Nov 2016 14:58:05 -0000
@@ -1409,11 +1409,11 @@ iwm_apm_init(struct iwm_softc *sc)
                goto out;
        }
 
-       if (sc->host_interrupt_operation_mode) {
+       if (sc->sc_flags & IWM_FLAG_HOST_INT_OPER_MODE) {
                /*
-                * This is a bit of an abuse - This is needed for 7260 / 3160
-                * only check host_interrupt_operation_mode even if this is
-                * not related to host_interrupt_operation_mode.
+                * This is needed for 7260 / 3160.
+                * XXX We check the otherwise unrelated HOST_INT_OPER_MODE flag
+                * to detect these devices.
                 *
                 * Enable the oscillator to count wake up time for L1 exit. This
                 * consumes slightly more power (100uA) - but allows to be sure
@@ -1627,7 +1627,7 @@ iwm_nic_rx_init(struct iwm_softc *sc)
        IWM_WRITE_1(sc, IWM_CSR_INT_COALESCING, IWM_HOST_INT_TIMEOUT_DEF);
 
        /* W/A for interrupt coalescing bug in 7260 and 3160 */
-       if (sc->host_interrupt_operation_mode)
+       if (sc->sc_flags & IWM_FLAG_HOST_INT_OPER_MODE)
                IWM_SETBITS(sc, IWM_CSR_INT_COALESCING, IWM_HOST_INT_OPER_MODE);
 
        /*
@@ -6969,35 +6969,32 @@ iwm_attach(struct device *parent, struct
        case PCI_PRODUCT_INTEL_WL_3160_1:
        case PCI_PRODUCT_INTEL_WL_3160_2:
                sc->sc_fwname = "iwm-3160-16";
-               sc->host_interrupt_operation_mode = 1;
+               sc->sc_flags |= IWM_FLAG_HOST_INT_OPER_MODE;
                sc->sc_device_family = IWM_DEVICE_FAMILY_7000;
                sc->sc_fwdmasegsz = IWM_FWDMASEGSZ;
                break;
        case PCI_PRODUCT_INTEL_WL_3165_1:
        case PCI_PRODUCT_INTEL_WL_3165_2:
                sc->sc_fwname = "iwm-7265-16";
-               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";
-               sc->host_interrupt_operation_mode = 1;
+               sc->sc_flags |= IWM_FLAG_HOST_INT_OPER_MODE;
                sc->sc_device_family = IWM_DEVICE_FAMILY_7000;
                sc->sc_fwdmasegsz = IWM_FWDMASEGSZ;
                break;
        case PCI_PRODUCT_INTEL_WL_7265_1:
        case PCI_PRODUCT_INTEL_WL_7265_2:
                sc->sc_fwname = "iwm-7265-16";
-               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_8260_1:
        case PCI_PRODUCT_INTEL_WL_8260_2:
                sc->sc_fwname = "iwm-8000C-16";
-               sc->host_interrupt_operation_mode = 0;
                sc->sc_device_family = IWM_DEVICE_FAMILY_8000;
                sc->sc_fwdmasegsz = IWM_FWDMASEGSZ_8000;
                break;
Index: if_iwmvar.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_iwmvar.h,v
retrieving revision 1.24
diff -u -p -r1.24 if_iwmvar.h
--- if_iwmvar.h 21 Sep 2016 13:53:18 -0000      1.24
+++ if_iwmvar.h 1 Nov 2016 14:57:38 -0000
@@ -279,11 +279,12 @@ struct iwm_rx_ring {
        int                     cur;
 };
 
-#define IWM_FLAG_USE_ICT       0x01
-#define IWM_FLAG_HW_INITED     0x02
-#define IWM_FLAG_STOPPED       0x04
-#define IWM_FLAG_RFKILL                0x08
-#define IWM_FLAG_SCANNING      0x10
+#define IWM_FLAG_USE_ICT               0x01
+#define IWM_FLAG_HW_INITED             0x02
+#define IWM_FLAG_STOPPED               0x04
+#define IWM_FLAG_RFKILL                        0x08
+#define IWM_FLAG_SCANNING              0x10
+#define IWM_FLAG_HOST_INT_OPER_MODE    0x20
 
 struct iwm_ucode_status {
        uint32_t uc_error_event_table;
@@ -473,8 +474,6 @@ struct iwm_softc {
 
        struct iwm_notif_statistics sc_stats;
        int sc_noise;
-
-       int host_interrupt_operation_mode;
 
 #if NBPFILTER > 0
        caddr_t                 sc_drvbpf;

Reply via email to