Ticket #1049: madwifi-0.9.3-reg.diff

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

Signed-off-by: Mike Taylor (mike.taylor@apprion.com)

  • madwifi/ath_hal/ah_os.c

    old new  
    250250void __ahdecl 
    251251ath_hal_reg_write(struct ath_hal *ah, u_int32_t reg, u_int32_t val) 
    252252{ 
    253         if (ath_hal_alq) { 
    254253                unsigned long flags; 
     254        local_irq_save(flags); 
     255        if (ath_hal_alq) { 
    255256                struct ale *ale; 
    256257 
    257                 local_irq_save(flags); 
    258258                ale = ath_hal_alq_get(ah); 
    259259                if (ale) { 
    260260                        struct athregrec *r = (struct athregrec *) ale->ae_data; 
     
    263263                        r->val = val; 
    264264                        alq_post(ath_hal_alq, ale); 
    265265                } 
    266                 local_irq_restore(flags); 
    267266        } 
    268267        _OS_REG_WRITE(ah, reg, val); 
     268        local_irq_restore(flags); 
    269269} 
    270270EXPORT_SYMBOL(ath_hal_reg_write); 
    271271 
    272272u_int32_t __ahdecl 
    273273ath_hal_reg_read(struct ath_hal *ah, u_int32_t reg) 
    274274{ 
     275        unsigned long flags; 
     276        local_irq_save(flags); 
    275277        u_int32_t val; 
    276278 
    277279        val = _OS_REG_READ(ah, reg); 
    278280        if (ath_hal_alq) { 
    279                 unsigned long flags; 
    280281                struct ale *ale; 
    281282 
    282                 local_irq_save(flags); 
    283283                ale = ath_hal_alq_get(ah); 
    284284                if (ale) { 
    285285                        struct athregrec *r = (struct athregrec *) ale->ae_data; 
     
    288288                        r->val = val; 
    289289                        alq_post(ath_hal_alq, ale); 
    290290                } 
    291                 local_irq_restore(flags); 
    292291        } 
     292        local_irq_restore(flags); 
    293293        return val; 
    294294} 
    295295EXPORT_SYMBOL(ath_hal_reg_read); 
     
    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        local_irq_save(flags); 
    331333#ifdef AH_DEBUG 
    332334        if (ath_hal_debug > 1) 
    333335                ath_hal_printf(ah, "WRITE 0x%x <= 0x%x\n", reg, val); 
    334336#endif 
     337         
    335338        _OS_REG_WRITE(ah, reg, val); 
     339        local_irq_restore(flags); 
    336340} 
    337341EXPORT_SYMBOL(ath_hal_reg_write); 
    338342 
    339343u_int32_t __ahdecl 
    340344ath_hal_reg_read(struct ath_hal *ah, u_int reg) 
    341345{ 
     346        unsigned long flags; 
    342347        u_int32_t val; 
     348        local_irq_save(flags); 
    343349 
    344350        val = _OS_REG_READ(ah, reg); 
     351        local_irq_restore(flags); 
    345352#ifdef AH_DEBUG 
    346353        if (ath_hal_debug > 1) 
    347354                ath_hal_printf(ah, "READ 0x%x => 0x%x\n", reg, val);