ath9k-devel.lists.ath9k.org archive mirror
 help / color / mirror / Atom feed
* [ath9k-devel] ath9k: EEPROM format / byte swapping
@ 2016-06-30 15:07 Martin Blumenstingl
  0 siblings, 0 replies; only message in thread
From: Martin Blumenstingl @ 2016-06-30 15:07 UTC (permalink / raw)
  To: ath9k-devel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-30 15:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-30 15:07 [ath9k-devel] ath9k: EEPROM format / byte swapping Martin Blumenstingl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).