Ticket #1049: madwifi-0.9.3-reg.diff
| File madwifi-0.9.3-reg.diff, 2.6 kB (added by mtaylor, 5 years ago) |
|---|
-
madwifi/ath_hal/ah_os.c
old new 250 250 void __ahdecl 251 251 ath_hal_reg_write(struct ath_hal *ah, u_int32_t reg, u_int32_t val) 252 252 { 253 if (ath_hal_alq) {254 253 unsigned long flags; 254 local_irq_save(flags); 255 if (ath_hal_alq) { 255 256 struct ale *ale; 256 257 257 local_irq_save(flags);258 258 ale = ath_hal_alq_get(ah); 259 259 if (ale) { 260 260 struct athregrec *r = (struct athregrec *) ale->ae_data; … … 263 263 r->val = val; 264 264 alq_post(ath_hal_alq, ale); 265 265 } 266 local_irq_restore(flags);267 266 } 268 267 _OS_REG_WRITE(ah, reg, val); 268 local_irq_restore(flags); 269 269 } 270 270 EXPORT_SYMBOL(ath_hal_reg_write); 271 271 272 272 u_int32_t __ahdecl 273 273 ath_hal_reg_read(struct ath_hal *ah, u_int32_t reg) 274 274 { 275 unsigned long flags; 276 local_irq_save(flags); 275 277 u_int32_t val; 276 278 277 279 val = _OS_REG_READ(ah, reg); 278 280 if (ath_hal_alq) { 279 unsigned long flags;280 281 struct ale *ale; 281 282 282 local_irq_save(flags);283 283 ale = ath_hal_alq_get(ah); 284 284 if (ale) { 285 285 struct athregrec *r = (struct athregrec *) ale->ae_data; … … 288 288 r->val = val; 289 289 alq_post(ath_hal_alq, ale); 290 290 } 291 local_irq_restore(flags);292 291 } 292 local_irq_restore(flags); 293 293 return val; 294 294 } 295 295 EXPORT_SYMBOL(ath_hal_reg_read); … … 314 314 } 315 315 } 316 316 EXPORT_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) 318 318 /* 319 319 * Memory-mapped device register read/write. These are here 320 320 * as routines when debugging support is enabled and/or when … … 328 328 void __ahdecl 329 329 ath_hal_reg_write(struct ath_hal *ah, u_int reg, u_int32_t val) 330 330 { 331 unsigned long flags; 332 local_irq_save(flags); 331 333 #ifdef AH_DEBUG 332 334 if (ath_hal_debug > 1) 333 335 ath_hal_printf(ah, "WRITE 0x%x <= 0x%x\n", reg, val); 334 336 #endif 337 335 338 _OS_REG_WRITE(ah, reg, val); 339 local_irq_restore(flags); 336 340 } 337 341 EXPORT_SYMBOL(ath_hal_reg_write); 338 342 339 343 u_int32_t __ahdecl 340 344 ath_hal_reg_read(struct ath_hal *ah, u_int reg) 341 345 { 346 unsigned long flags; 342 347 u_int32_t val; 348 local_irq_save(flags); 343 349 344 350 val = _OS_REG_READ(ah, reg); 351 local_irq_restore(flags); 345 352 #ifdef AH_DEBUG 346 353 if (ath_hal_debug > 1) 347 354 ath_hal_printf(ah, "READ 0x%x => 0x%x\n", reg, val);
