Historical ath9k-devel archives
 help / color / mirror / Atom feed
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] ath9k: EEPROM format / byte swapping
Date: Thu, 30 Jun 2016 17:07:37 +0200	[thread overview]
Message-ID: <CAFBinCByYy6axOZ_HerQt5GLVVcz6GU70kR2mm=AW6AnxAr1hw@mail.gmail.com> (raw)

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

                 reply	other threads:[~2016-06-30 15:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFBinCByYy6axOZ_HerQt5GLVVcz6GU70kR2mm=AW6AnxAr1hw@mail.gmail.com' \
    --to=martin.blumenstingl@googlemail.com \
    --cc=ath9k-devel@lists.ath9k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).