Now that I have wired ethernet working, I'm tackling the wifi chip.
This router has an ar9223, with the calibration data stored in flash. I
copied the data in ath9k_platform_data (btw, I noticed that ar71xx
redefines it adding fields, should I copy the .h to my platform or is
there a better way to avoid incongruencies?).
The first problem is that the device is (incorrectly?) identified as
168c:ff1d instead of 168c:0029. I saw a similar problem here
https://forum.openwrt.org/viewtopic.php?pid=97839#p97839
with a bug report here
https://dev.openwrt.org/ticket/6171
unfortunately I don't think it applies to my platform (ifxmips), so for
the time being I patched compat-wireless to accept ff1d as a valid id.
The second problem is that I have to comment the condition in function
ath9k_hw_def_check_eeprom in ath9k/eeprom_def.c in order for it to
correct the endiannes of the simulated eeprom:
/* if (!ath9k_hw_use_flash(ah)) */ {
printk(KERN_ERR "Read Magic = 0x%04X\n", magic);
ath_print(common, ATH_DBG_EEPROM,
"Read Magic = 0x%04X\n", magic);
if (magic != AR5416_EEPROM_MAGIC) {
magic2 = swab16(magic);
if (magic2 == AR5416_EEPROM_MAGIC) {
size = sizeof(struct ar5416_eeprom_def);
need_swap = true;
eepdata = (u16 *) (&ah->eeprom);
for (addr = 0; addr < size /
sizeof(u16); addr++) {
temp = swab16(*eepdata);
*eepdata = temp;
eepdata++;
}
} else {
ath_print(common, ATH_DBG_FATAL,
"Invalid EEPROM Magic. "
"Endianness mismatch.\n");
return -EINVAL;
}
}
}
In fact the magic is 0xa55a and it has to be swapped. In order not to
modify ath9k, I swapped those myself but it doesn't work (e.g. the
length is correct without swapping, so maybe only some of the data has
to be swapped, another thing that doesn't work if I swap myself is the
initialization, that stops because it doesn't find any band enabled).
Maybe I read the code wrong and I'm swapping the wrong section, any hint?
Bye
--
Luca
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel