[ath9k-devel] ath9k: EEPROM format / byte swapping

Martin Blumenstingl <[email protected]>
Newsgroups org.ath9k.lists.ath9k-devel,org.kernel.vger.linux-wireless
Message-ID <CAFBinCByYy6axOZ_HerQt5GLVVcz6GU70kR2mm=AW6AnxAr1hw@mail.gmail.com>
Hello,

I have a question regarding the ath9k EEPROM format.
Most EEPROM versions have two magic bytes at the beginning, indicating
the endianness of the data in this EEPROM.

Let's take the AR9287 EEPROM as an example:
during ath9k initialization
ath9k/eeprom_9287.c:ath9k_hw_ar9287_check_eeprom is called, which
calls ath9k/eeprom.c:ath9k_hw_nvram_swap_data to:
a) check if a swap is required
b) perform swab16 on the EEPROM data

If a swap was required then ath9k_hw_ar9287_check_eeprom will apply
more swapping (this time selectively, based on the property it will us
swab16 or swab16).
However, it's not doing this with all data but only some!
One example (where the data is not swapped in _check_eeprom) is the
macAddr array in modal_eep_ar9287_header. It is not swapped in
ath9k_hw_ar9287_check_eeprom but read (with the values as they are) in
ath9k/eeprom_9287.c:ath9k_hw_ar9287_get_eeprom
(the same also applies for other values, such as openLoopPwrCntl, etc.)

Is there any documentation how this EEPROM data should look like,
where swapping is required, etc.?
I am trying to figure out if the current implementation of all
eeprom_ops.check_eeprom implementations is correct (or not).


Regards,
Martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.