Ticket #1049: madwifi-0.9.3-reg.3.diff

File madwifi-0.9.3-reg.3.diff, 1.5 kB (added by mtaylor, 5 years ago)

Correct version. Ignore madwifi-0.9.3-reg.2.diff.

  • madwifi/ath_hal/ah_os.c

    old new  
    314314        } 
    315315} 
    316316EXPORT_SYMBOL(OS_MARK); 
    317 #elif defined(AH_DEBUG) || defined(AH_REGOPS_FUNC) 
     317#elif defined(AH_DEBUG) || defined(AH_REGOPS_FUNC) || (AH_BYTE_ORDER == AH_BIG_ENDIAN) 
    318318/* 
    319319 * Memory-mapped device register read/write.  These are here 
    320320 * as routines when debugging support is enabled and/or when 
     
    328328void __ahdecl 
    329329ath_hal_reg_write(struct ath_hal *ah, u_int reg, u_int32_t val) 
    330330{ 
     331    unsigned long flags; 
     332    preempt_disable(); 
     333    local_irq_save(flags); 
    331334#ifdef AH_DEBUG 
    332335        if (ath_hal_debug > 1) 
    333336                ath_hal_printf(ah, "WRITE 0x%x <= 0x%x\n", reg, val); 
    334337#endif 
    335338        _OS_REG_WRITE(ah, reg, val); 
     339    local_irq_restore(flags); 
     340    preempt_enable_no_resched(); 
    336341} 
    337342EXPORT_SYMBOL(ath_hal_reg_write); 
    338343 
     
    340345ath_hal_reg_read(struct ath_hal *ah, u_int reg) 
    341346{ 
    342347        u_int32_t val; 
    343  
     348    unsigned long flags; 
     349    preempt_disable(); 
     350    local_irq_save(flags); 
    344351        val = _OS_REG_READ(ah, reg); 
     352    local_irq_restore(flags); 
     353    preempt_enable_no_resched(); 
    345354#ifdef AH_DEBUG 
    346355        if (ath_hal_debug > 1) 
    347356                ath_hal_printf(ah, "READ 0x%x => 0x%x\n", reg, val);