linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: Joerg Albert <jal2@gmx.de>
Cc: Luis Rodriguez <Luis.Rodriguez@Atheros.com>,
	Stephen Chen <Stephen.Chen@Atheros.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Christian Lamparter <chunkeey@web.de>, <David.Quan@atheros.com>,
	Tony Yang <Tony.Yang@Atheros.com>
Subject: Re: ath/regd.c: regdomain 0x8000 fails to retrieve a regulatory domain pair
Date: Thu, 21 May 2009 16:57:42 -0700	[thread overview]
Message-ID: <20090521235742.GA7684@tesla> (raw)
In-Reply-To: <4A15E219.7040908@gmx.de>

On Thu, May 21, 2009 at 04:22:01PM -0700, Joerg Albert wrote:
> On 05/21/2009 07:16 PM, Luis R. Rodriguez wrote:
> 
> > Joerg, can you please try this patch, its just informative and I would
> > like to see the output. A regulatory domain in the EEPROM set to 0x8000
> > should be cought, as you indicated, in this code:
> >
> >         if (reg->country_code == CTRY_DEFAULT &&
> >             regdmn == CTRY_DEFAULT)
> >                 reg->country_code = CTRY_UNITED_STATES;
> >
> > The debug prints should help.
>  > ...
> With the patch I get:
> 
> usb 1-5: firmware: requesting ar9170-2.fw
> ath: EEPROM indicates we should expect a country code
> ath: No regulatory domain pair found, cannot continue
> ar9170usb: probe of 1-5:1.0 failed with error -22
> 
> IMHO the in the above if-statement regdmn == 0x8000 (as read from
> the EEPROM by ath_regd_get_eepromRD), but CTRY_DEFAULT is defined as
> zero, so reg->country_code isn't set.
> Shouldn't we say "regdmn == (CTRY_DEFAULT|COUNTRY_ERD_FLAG)",because
> without the ERD flag set we cannot compare a regdomain with a
> country code?

I agree, regdmn is set from calling ath_regd_get_eepromRD() which
returns:

	reg->current_rd & ~WORLDWIDE_ROAMING_FLAG

This is:

	reg->current_rd & ~0x4000

And _not_ 

	reg->current_rd & ~COUNTRY_ERD_FLAG

which would be:

	reg->current_rd & ~0x8000

This _does_ explain why you end up where you do, and we don't
let the driver continue. However, it does seem that 0x8000 is in fact
not a valid regulatory domain code which should be used. Problem
with using CTRY_UNITED_STATES or 0x64 (or another custom atheros
world regulatory domain) for this case is non properly calibrated
data may be used, specifically for the CTL indexes. We'll check on
this internally, regardless we need a solution for you.

  Luis

  reply	other threads:[~2009-05-21 23:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-11 10:49 ath/regd.c: regdomain 0x8000 fails to retrieve a regulatory domain pair Joerg Albert
2009-05-11 19:06 ` Luis R. Rodriguez
     [not found]   ` <618D4DE9D5223A45A46C48063FD640451098774889@TAEXMB-01.global.atheros.com>
2009-05-21 17:16     ` Luis R. Rodriguez
2009-05-21 18:19       ` Gábor Stefanik
2009-05-21 19:03         ` Luis R. Rodriguez
2009-05-21 23:22       ` Joerg Albert
2009-05-21 23:57         ` Luis R. Rodriguez [this message]
2009-05-22  0:11           ` Luis R. Rodriguez
2009-05-22 13:12             ` Joerg Albert

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=20090521235742.GA7684@tesla \
    --to=lrodriguez@atheros.com \
    --cc=David.Quan@atheros.com \
    --cc=Luis.Rodriguez@Atheros.com \
    --cc=Stephen.Chen@Atheros.com \
    --cc=Tony.Yang@Atheros.com \
    --cc=chunkeey@web.de \
    --cc=jal2@gmx.de \
    --cc=linux-wireless@vger.kernel.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 NNTP newsgroup(s).