Ticket #5089: iprowifi4965-r34504.diff

File iprowifi4965-r34504.diff, 2.7 KB (added by colin, 10 years ago)

Patch for driver belonging to syslog attachment above

  • iprowifi4965/glue.c

     
    2121
    2222HAIKU_FBSD_WLAN_DRIVER_GLUE(iprowifi4965, iwn, pci)
    2323NO_HAIKU_FBSD_MII_DRIVER();
    24 HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES|FBSD_WLAN);
     24NO_HAIKU_REENABLE_INTERRUPTS();
     25HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_WLAN);
    2526HAIKU_FIRMWARE_VERSION(44417);
    2627
    2728
     
    2930HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
    3031{
    3132    struct iwn_softc* sc = (struct iwn_softc*)device_get_softc(dev);
    32     uint32 r1, r2;
     33    uint32_t r1, r2;
    3334    HAIKU_INTR_REGISTER_STATE;
    3435
    35     HAIKU_INTR_REGISTER_ENTER();
     36    // Locking of sc with IWN_LOCK is infeasible due to disabled interrupts.
     37
     38    /* disable interrupts */
     39    IWN_WRITE(sc, IWN_MASK, 0);
     40
    3641    r1 = IWN_READ(sc, IWN_INTR);
    3742    r2 = IWN_READ(sc, IWN_INTR_STATUS);
    3843
    3944    if (r1 == 0 && r2 == 0) {
    4045        /* not for us */
    4146        IWN_WRITE(sc, IWN_MASK, IWN_INTR_MASK);
    42         HAIKU_INTR_REGISTER_LEAVE();
    4347        return 0;
    4448    }
    4549
    46     if (r1 == 0xffffffff) {
    47         /* hardware gone */
    48         HAIKU_INTR_REGISTER_LEAVE();
     50    if (r1 == 0xffffffff) /* hardware gone */
    4951        return 0;
    50     }
    5152
    52     /* disable interrupts */
    53     IWN_WRITE(sc, IWN_MASK, 0);
    54 
     53    HAIKU_INTR_REGISTER_ENTER();
     54    sc->sc_lastisr = r1;
     55    sc->sc_lastisr_status = r2;
    5556    HAIKU_INTR_REGISTER_LEAVE();
    5657
    5758    return 1;
    5859}
    59 
    60 
    61 void
    62 HAIKU_REENABLE_INTERRUPTS(device_t dev)
    63 {
    64     struct iwn_softc* sc = (struct iwn_softc*)device_get_softc(dev);
    65 
    66     /* enable interrupts */
    67     IWN_WRITE(sc, IWN_MASK, IWN_INTR_MASK);
    68 }
  • iprowifi4965/dev/iwn/if_iwnvar.h

     
    200200    int16_t         eeprom_voltage;
    201201    int8_t          maxpwr2GHz;
    202202    int8_t          maxpwr5GHz;
     203
     204    uint32_t sc_lastisr;
     205    uint32_t sc_lastisr_status;
    203206};
    204207
    205208#define IWN_LOCK_INIT(_sc) \
  • iprowifi4965/dev/iwn/if_iwn.c

     
    18051805{
    18061806    struct iwn_softc *sc = arg;
    18071807    uint32_t r1, r2;
     1808    HAIKU_INTR_REGISTER_STATE;
    18081809
    18091810    IWN_LOCK(sc);
    18101811
    1811     /* disable interrupts */
    1812     IWN_WRITE(sc, IWN_MASK, 0);
     1812    HAIKU_INTR_REGISTER_ENTER();
     1813    r1 = sc->sc_lastisr;
     1814    r2 = sc->sc_lastisr_status;
     1815    HAIKU_INTR_REGISTER_LEAVE();
    18131816
    1814     r1 = IWN_READ(sc, IWN_INTR);
    1815     r2 = IWN_READ(sc, IWN_INTR_STATUS);
    1816 
    1817     if (r1 == 0 && r2 == 0) {
    1818         IWN_WRITE(sc, IWN_MASK, IWN_INTR_MASK);
    1819         goto done;  /* not for us */
    1820     }
    1821 
    1822     if (r1 == 0xffffffff)
    1823         goto done;  /* hardware gone */
    1824 
    18251817    /* ack interrupts */
    18261818    IWN_WRITE(sc, IWN_INTR, r1);
    18271819    IWN_WRITE(sc, IWN_INTR_STATUS, r2);