1 Index: madwifi-trunk-r3776/ath_hal/ah_os.c
2 ===================================================================
3 --- madwifi-trunk-r3776.orig/ath_hal/ah_os.c 2008-07-17 00:21:30.000000000 +0200
4 +++ madwifi-trunk-r3776/ath_hal/ah_os.c 2008-07-17 04:00:18.000000000 +0200
6 * NB: see the comments in ah_osdep.h about byte-swapping register
7 * reads and writes to understand what's going on below.
10 +#ifdef CONFIG_IFXMIPS
11 +extern int ifxmips_has_brn_block(void);
12 +static int ifxmips_emulate = 0;
13 +#define EEPROM_EMULATION 1
16 +#ifdef EEPROM_EMULATION
17 +static int ath_hal_eeprom(struct ath_hal *ah, unsigned long addr, int val, int write)
19 + static int addrsel = 0;
23 + if(addr == 0x6000) {
37 + val = cpu_to_le16(__raw_readw((u16 *) KSEG1ADDR(0xb07f0400 + addrsel)));
38 + /* this forces the regdomain to 0x00 (worldwide), as the original setting
39 + * causes issues with the HAL */
40 + if (addrsel == 0x17e)
50 ath_hal_reg_write(struct ath_hal *ah, u_int address, u_int32_t value)
52 +#ifdef EEPROM_EMULATION
53 + if((address >= 0x6000) && (address <= 0x6010) && ifxmips_emulate) {
54 + ath_hal_eeprom(ah, address, value, 1);
59 _trace_regop(ah, REGOP_WRITE, address, value);
60 _OS_REG_WRITE(ah, address, value);
64 ath_hal_reg_read(struct ath_hal *ah, u_int address)
66 - u_int32_t val = _OS_REG_READ(ah, address);
69 +#ifdef EEPROM_EMULATION
70 + if((address >= 0x6000) && (address <= 0x6010) && ifxmips_emulate)
71 + val = ath_hal_eeprom(ah, address, 0, 0);
74 + val = _OS_REG_READ(ah, address);
75 _trace_regop(ah, REGOP_READ, address, val);
80 kmmio_logmsg = _kmmio_logmsg;
82 +#ifdef CONFIG_IFXMIPS
83 + ifxmips_emulate = ifxmips_has_brn_block();
87 for (i = 0; ath_hal_buildopts[i] != NULL; i++) {