All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Gottschall <s.gottschall@dd-wrt.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: "ath10k@lists.infradead.org" <ath10k@lists.infradead.org>
Subject: Re: changing hw address of ath10k card
Date: Wed, 06 May 2015 13:16:55 +0200	[thread overview]
Message-ID: <5549F827.1010809@dd-wrt.com> (raw)
In-Reply-To: <CA+BoTQk7LdGqj96=0__UkHHBKNXt+4KUoNjq2ep0BmEvNeXaZQ@mail.gmail.com>

Am 06.05.2015 um 13:06 schrieb Michal Kazior:
> On 6 May 2015 at 12:39, Sebastian Gottschall <s.gottschall@dd-wrt.com> wrote:
>> Hello
> Hi,
>
>
>> I recently stumbled across a problem in ath10k. while developing on embedded
>> wireless routers
>> i found a device which uses a ar988x card using a card embedded board
>> eeprom. the problem is there is no way to override
>> the cards hardware/mac address, which is required on that device since it
>> uses just a fake mac on that board data.
> If device contains valid EEPROM data then both calibration and mac
> address is read using OTP. In that case a mere fake board template
> binary is used by the driver (the default board.bin).
the problem is that the board.bin is never used. i modified the 
board.bin to change the mac address, but it shows no effect
>
> If device contains no valid EEPROM, which is the case for many routers
> out in the wild e.g. TP-Link Archer C5/C7, you must provide a complete
> board data. On routers this data is often stored on NAND/Flash
> partitions. OpenWRT does handle this and extracts calibration data
> file. If you fail to provide that and attempt to use the default
> board.bin you'll get hardcoded mac and Tx/Rx performance will be very
> poor most likely.
i'm aware of that. i handle that correct for such devices.
but the dlink DIR862 and DIR866 using full equiped ar988x cards with 
valid eeprom
>
> If ath10k assigns 00:03:07:12:34:56 mac address to the interface then
> you've most likely provided a fake board template and the device
> doesn't have a valid EEPROM data. Are you using skip_otp module
> parameter by any chance or other hacks/custom patches on ath10k?
i just use the openwrt patch which allows to override invalid otp data 
using the board.bin.
this works for device likes the archer c7. but board.bin is not used for 
valid otp data.

this is this one here
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -387,9 +387,14 @@ static int ath10k_download_and_run_otp(s

         ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot otp execute result %d\n", 
result);

-       if (!skip_otp && result != 0) {
-               ath10k_err(ar, "otp calibration failed: %d", result);
-               return -EINVAL;
+       if (!skip_otp) {
+               if (result == 2) {
+                       ath10k_warn(ar, "otp stream is empty, using 
board.bin contents");
+                       return 0;
+               } else if (result != 0) {
+                       ath10k_err(ar, "otp calibration failed: %d", 
result);
+                       return -EINVAL;
+               }

>
>
>> is there any way/trick available to deal with that problem?
> You can always change the mac address via `ip` or `ifconfig` commands
> after interface is created but that's probably not what you really
> want.
if i can trust that bssid (which i dont believe) etc. internal handling 
will change as well, this might work as workaround. but its a nasty way 
to handle it

Sebastian
>
>
> Michał
>


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

  reply	other threads:[~2015-05-06 11:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05 22:35 htt_rx questions in 4.0 kernel Ben Greear
2015-05-06  5:38 ` Michal Kazior
2015-05-06 14:54   ` Ben Greear
2015-05-07 22:59     ` Ben Greear
2015-05-06 10:39 ` changing hw address of ath10k card Sebastian Gottschall
2015-05-06 11:06   ` Michal Kazior
2015-05-06 11:16     ` Sebastian Gottschall [this message]
2015-05-06 11:32       ` Michal Kazior
2015-05-06 13:21         ` Sebastian Gottschall

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=5549F827.1010809@dd-wrt.com \
    --to=s.gottschall@dd-wrt.com \
    --cc=ath10k@lists.infradead.org \
    --cc=michal.kazior@tieto.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.