* Re: [PATCH] Added configurable debug messages to libertastf
From: Andrew Morton @ 2010-04-27 20:16 UTC (permalink / raw)
To: Steve deRosier; +Cc: linux-wireless, javier, joe
In-Reply-To: <1272231646-67723-1-git-send-email-steve@cozybit.com>
On Sun, 25 Apr 2010 14:40:46 -0700
Steve deRosier <steve@cozybit.com> wrote:
> Add the same type of configurable debug messages to libertas_tf as
> already exist in the libertas driver. This has facilitated creation of a interface
> specification and will facilitate future development of this driver.
>
> ...
>
> --- /dev/null
> +++ b/drivers/net/wireless/libertas_tf/deb_defs.h
> @@ -0,0 +1,106 @@
> +/**
> + * This header file contains global constant/enum definitions,
> + * global variable declaration.
> + */
> +#ifndef _LBS_DEB_DEFS_H_
> +#define _LBS_DEB_EFS_H_
> +
> +#ifndef DRV_NAME
> +#define DRV_NAME "libertas_tf"
> +#endif
> +
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
I dunno what this pr_fmt() definition is doing here, but it has
unpleasant effects with a x86_64 allmodconfig build:
In file included from drivers/net/wireless/libertas_tf/main.c:12:
drivers/net/wireless/libertas_tf/deb_defs.h:12:1: warning: "pr_fmt" redefined
In file included from /usr/src/devel/arch/x86/include/asm/percpu.h:44,
from /usr/src/devel/arch/x86/include/asm/current.h:5,
from /usr/src/devel/arch/x86/include/asm/processor.h:15,
from /usr/src/devel/arch/x86/include/asm/thread_info.h:22,
from include/linux/thread_info.h:56,
from include/linux/preempt.h:9,
from include/linux/spinlock.h:50,
from include/linux/mmzone.h:7,
from include/linux/gfp.h:4,
from include/linux/slab.h:12,
from drivers/net/wireless/libertas_tf/main.c:10:
include/linux/kernel.h:376:1: warning: this is the location of the previous definition
so I cheerily deleted it.
^ permalink raw reply
* Re: [Fwd: 2.6.34-rc4/5: iwlagn unusable until reload]
From: reinette chatre @ 2010-04-27 20:23 UTC (permalink / raw)
To: linux-wireless@vger.kernel.org; +Cc: Zhao, Shanyu, LKML
In-Reply-To: <1272399067.4381.10749.camel@rchatre-DESK>
I see now that a new kernel.org bug
(https://bugzilla.kernel.org/show_bug.cgi?id=15862 ) has been created
for this issue. We'll track it there.
Reinette
On Tue, 2010-04-27 at 13:11 -0700, reinette chatre wrote:
> Nico,
>
> The wireless folks don't really hang out on lkml. I'm forwarding your
> message to the linux-wireless mailing list.
>
> Reinette
>
>
> -------- Forwarded Message --------
> > From: Nico Schottelius <nico-linux-20100427@schottelius.org>
> > To: LKML <linux-kernel@vger.kernel.org>
> > Subject: 2.6.34-rc4/5: iwlagn unusable until reload
> > Date: Tue, 27 Apr 2010 00:49:34 -0700
> >
> > Hello again!
> >
> > If I try to use iwlagn on the X201 with
> >
> > 02:00.0 Network controller: Intel Corporation WiFi Link 6000 Series (rev 35)
> >
> > and 2.6.34-rc5-00211-gb91ce4d, I get a lot of error and no connection,
> > until I
> >
> > [root@kr ~]# rmmod iwlagn
> > [root@kr ~]# modprobe iwlagn
> >
> > Attached dmesg before & after.
> >
> > Cheers,
> >
> > Nico
> >
>
^ permalink raw reply
* ath9k: noise floor calibration process
From: Benoit PAPILLAULT @ 2010-04-27 20:39 UTC (permalink / raw)
To: ath9k-devel; +Cc: linux-wireless@vger.kernel.org
Hello,
In order to move forward with noise & signal reporting, I'd like to
share my current understanding of the way ath9k HW is working before
sending patches (unfortunately, I did the work before the introduction
of ar9003... so I need to redo the work).
The ultimate purpose of this work is to be able to measure signal levels
(and noise if possible) as accurately as a spectrum analyzer or power meter.
First, signal level reporting. It is reported in a per packet basis in
RX descriptors. There are 7 fields:
AR_RxRSSIAnt00 0x000000ff rs_rssi_ctl0
AR_RxRSSIAnt01 0x0000ff00 rs_rssi_ctl1
AR_RxRSSIAnt02 0x00ff0000 rs_rssi_ctl2
AR_RxRSSIAnt10 0x000000ff rs_rssi_ext0
AR_RxRSSIAnt11 0x0000ff00 rs_rssi_ext1
AR_RxRSSIAnt12 0x00ff0000 rs_rssi_ext2
AR_RxRSSICombined 0xff000000 rs_rssi
Each value is for a 20 MHz wide channel, on the 3 RX chains. "ctl" is
for the primary channel and "ext" is for the secondary channel (using
the 802.11n words). The latter rs_rssi is the sum of the 6 previous
value. However, since each value is dB, the sum is not an arithmetic
sum. Each field is a signed value and the value -128 means that no
measurement has been done (no RX chain, RX chain disabled, no secondary
channel, ...). It seems that in some cases, the combined value is just
plain wrong. Here are few examples:
RSSI: ctl=(10,7,-128) ext=(-128,-128,-128) => 12 (11.76) correct
RSSI: ctl=(38,29,-128) ext=(69,-84,-101) => -22 incorrect!!!
Next, noise floor calibration. From what I understand, signal levels is
measured using the AGC + RX amplifiers gain (RF, IF and BB). However,
the various gains are not really accurate, only the relative gain are
accurate. This means that reading a signal value of -100dBm might not
exactly means -100dBm. There is a delta between real signal and measured
value. In order to know this value, we need a calibration process with a
known signal.
One know signal is thermal noise. Thermal noise is generated in any
resistor and can be computed using the well know value N = kTB. For a 20
MHz bandwidth, this gives -101dBm. If the HW tries to measure signal
strength when the network is supposed to be idle (during SIFS) and with
RX/TX switch disabled (?), then it will in fact measure the thermal
noise at the RX input.
So, we have :
Real noise (-101dBm) = Measured noise + delta
There are type of registers to control noise floor calibration :
- control register at 0x9860 (AR_PHY_AGC_CONTROL)
This register allows 3 differents operations :
1. start noise floor measurement
write AR_PHY_MAXCCA_PWR (AR_PHY_CCA & 0x000001ff) : this is apparently
a max value
for noise floor
REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_ENABLE_NF);
REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
When channel has been changed however, the noise floor needs to be
updated immediately, so AR_PHY_AGC_CONTROL_NO_UPDATE_NF should be
cleared in this particular case. Otherwise, the chip is no longer
receiving (problem since CCA is defined with noise floor as reference).
2. read noise floor measurement result
check REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF
if 0 (noise floor calibration is finished), read AR_PHY_MINCCA_PWR :
nf = MS(REG_READ(ah, AR_PHY_CCA), AR_PHY_MINCCA_PWR = 0x0ff80000)
3. write noise floor reference
write AR_PHY_MAXCCA_PWR (the value has not the same meaning as
operation 1!)
REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_ENABLE_NF);
REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
- data register at 0x9864 (AR_PHY_CCA, + more location for other RX chains)
The fields are different for AR9280+ chipsets, but the mechanism is
the same.
AR_PHY_MAXCCA_PWR 0x000001ff (half dBm unit!)
AR_PHY_CCA_THRESH62 0x0007f000
AR_PHY_MINCCA_PWR 0x0ff80000
Now, we have :
Real signal = Measured signal + delta
= RSSI + Noise floor + delta
= RSSI + (-101 dBm)
Real noise is not thermal noise. There are a lot of definition for noise
since noise is NOT signal. Of course, noise includes thermal noise.
Since the noise measured by the chip is variable, I think we could do :
- Noise floor = minimum (Noise floor measures)
- Noise = moving average (Noise floor measures) + delta
with delta = (-101 dBm) - Noise floor
I'd like to get comments before sending patches. Since ath5k and ath9k
are quite close, I'm pretty sure a similar (if not same) process is used
on ath5k.
Regards,
Benoit
^ permalink raw reply
* [PATCH] rtl8180: use cached queue mapping for skb in rtl8180_tx
From: John W. Linville @ 2010-04-27 20:57 UTC (permalink / raw)
To: linux-wireless; +Cc: John W. Linville
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
drivers/net/wireless/rtl818x/rtl8180_dev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/rtl818x/rtl8180_dev.c b/drivers/net/wireless/rtl818x/rtl8180_dev.c
index f4d3618..d84ad05 100644
--- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
@@ -305,7 +305,7 @@ static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
entry->flags = cpu_to_le32(tx_flags);
__skb_queue_tail(&ring->queue, skb);
if (ring->entries - skb_queue_len(&ring->queue) < 2)
- ieee80211_stop_queue(dev, skb_get_queue_mapping(skb));
+ ieee80211_stop_queue(dev, prio);
spin_unlock_irqrestore(&priv->lock, flags);
rtl818x_iowrite8(priv, &priv->map->TX_DMA_POLLING, (1 << (prio + 4)));
--
1.6.6.1
^ permalink raw reply related
* Re: [PATCH] wireless: ath9k: Fix most coding style issues in ath9k This patch fixed up almost all coding style issues in the ath9k driver found by the ceckpatch.pl tool. Signed-off-by: Michael Sprecher <sprecher.m@gmail.com>
From: Luis R. Rodriguez @ 2010-04-27 21:05 UTC (permalink / raw)
To: Michael Sprecher
Cc: Luis Rodriguez, Jouni Malinen, ath9k-devel@lists.ath9k.org,
linux-wireless@vger.kernel.org, John W. Linville
In-Reply-To: <s2yf42143521004271321qe6522fdaia42f335575d4026@mail.gmail.com>
On Tue, Apr 27, 2010 at 01:21:21PM -0700, Michael Sprecher wrote:
> Yes, i'm still intrested in fixing your coding style issues ;)
> If it's now safe to check it again, i will find some time to look at it this week.
> Michael
Go for it, after John merges our latest batch you should be good to go
Luis
^ permalink raw reply
* [RFT] ar9170: implement get_survey
From: Christian Lamparter @ 2010-04-27 21:23 UTC (permalink / raw)
To: Benoit PAPILLAULT; +Cc: linux-wireless
This patch adds a basic get_survey for ar9170.
Survey data from wlan1
frequency: 2412 MHz
noise: -85 dBm
TODO:
Currently, the noise level is updated only by a channel change.
Now, we could simply add another ar9170_set_channel to always get
a fresh result, but then we risk a RF lockup.
---
diff --git a/drivers/net/wireless/ath/ar9170/ar9170.h b/drivers/net/wireless/ath/ar9170/ar9170.h
index dc662b7..26fa31e 100644
--- a/drivers/net/wireless/ath/ar9170/ar9170.h
+++ b/drivers/net/wireless/ath/ar9170/ar9170.h
@@ -198,7 +198,7 @@ struct ar9170 {
/* PHY */
struct ieee80211_channel *channel;
- int noise[4];
+ int noise[6];
/* power calibration data */
u8 power_5G_leg[4];
@@ -302,5 +302,5 @@ int ar9170_init_phy(struct ar9170 *ar, enum ieee80211_band band);
int ar9170_init_rf(struct ar9170 *ar);
int ar9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel,
enum ar9170_rf_init_mode rfi, enum ar9170_bw bw);
-
+int ar9170_get_noisefloor(struct ar9170 *ar);
#endif /* __AR9170_H */
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index 3247db8..1e422ed 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -2485,6 +2485,25 @@ static int ar9170_ampdu_action(struct ieee80211_hw *hw,
return 0;
}
+static int ar9170_op_get_survey(struct ieee80211_hw *hw, int idx,
+ struct survey_info *survey)
+{
+ struct ar9170 *ar = hw->priv;
+ int err;
+
+ if (idx != 0)
+ return -ENOENT;
+
+ err = ar9170_get_noisefloor(ar);
+ if (err)
+ return err;
+
+ survey->channel = ar->channel;
+ survey->filled = SURVEY_INFO_NOISE_DBM;
+ survey->noise = ar->noise[0];
+ return 0;
+}
+
static const struct ieee80211_ops ar9170_ops = {
.start = ar9170_op_start,
.stop = ar9170_op_stop,
@@ -2501,6 +2520,7 @@ static const struct ieee80211_ops ar9170_ops = {
.sta_add = ar9170_sta_add,
.sta_remove = ar9170_sta_remove,
.get_stats = ar9170_get_stats,
+ .get_survey = ar9170_op_get_survey,
.ampdu_action = ar9170_ampdu_action,
};
diff --git a/drivers/net/wireless/ath/ar9170/phy.c b/drivers/net/wireless/ath/ar9170/phy.c
index 45a415e..31ff163 100644
--- a/drivers/net/wireless/ath/ar9170/phy.c
+++ b/drivers/net/wireless/ath/ar9170/phy.c
@@ -1584,6 +1584,31 @@ static int ar9170_calc_noise_dbm(u32 raw_noise)
return (raw_noise & 0xff) >> 1;
}
+int ar9170_get_noisefloor(struct ar9170 *ar)
+{
+ static const u32 phy_regs[] = {
+ 0x1c5864, 0x1c6864, 0x1c7864,
+ 0x1c59bc, 0x1c69bc, 0x1c79bc };
+ u32 phy_res[ARRAY_SIZE(phy_regs)];
+ int err, i;
+
+ BUILD_BUG_ON(ARRAY_SIZE(phy_regs) != ARRAY_SIZE(ar->noise));
+
+ err = ar9170_read_mreg(ar, ARRAY_SIZE(phy_regs), phy_regs, phy_res);
+ if (err)
+ return err;
+
+ for (i = 0; i < ARRAY_SIZE(phy_regs); i++) {
+ ar->noise[i] = ar9170_calc_noise_dbm(
+ (phy_res[i] >> 19) & 0x1ff);
+
+ ar->noise[i + 3] = ar9170_calc_noise_dbm(
+ (phy_res[i + 3] >> 23) & 0x1ff);
+ }
+
+ return 0;
+}
+
int ar9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel,
enum ar9170_rf_init_mode rfi, enum ar9170_bw bw)
{
@@ -1708,12 +1733,12 @@ int ar9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel,
}
}
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < 3; i++) {
ar->noise[i] = ar9170_calc_noise_dbm(
- (le32_to_cpu(vals[2 + i]) >> 19) & 0x1ff);
+ (le32_to_cpu(vals[i + 1]) >> 19) & 0x1ff);
- ar->noise[i + 2] = ar9170_calc_noise_dbm(
- (le32_to_cpu(vals[5 + i]) >> 23) & 0x1ff);
+ ar->noise[i + 3] = ar9170_calc_noise_dbm(
+ (le32_to_cpu(vals[i + 4]) >> 23) & 0x1ff);
}
ar->channel = channel;
^ permalink raw reply related
* [PATCH] ath9k: Added get_survey callback in order to get channel noise
From: Benoit Papillault @ 2010-04-27 22:08 UTC (permalink / raw)
To: lrodriguez, jmalinen; +Cc: ath9k-devel, linux-wireless, Benoit Papillault
Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
---
drivers/net/wireless/ath/ath9k/main.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index c03821e..f0b2aa2 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2047,6 +2047,25 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
return ret;
}
+static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,
+ struct survey_info *survey)
+{
+ struct ath_wiphy *aphy = hw->priv;
+ struct ath_softc *sc = aphy->sc;
+ struct ath_hw *ah = sc->sc_ah;
+ struct ath_common *common = ath9k_hw_common(ah);
+ struct ieee80211_conf *conf = &hw->conf;
+
+ if (idx != 0)
+ return -ENOENT;
+
+ survey->channel = conf->channel;
+ survey->filled = SURVEY_INFO_NOISE_DBM;
+ survey->noise = common->ani.noise_floor;
+
+ return 0;
+}
+
static void ath9k_sw_scan_start(struct ieee80211_hw *hw)
{
struct ath_wiphy *aphy = hw->priv;
@@ -2122,6 +2141,7 @@ struct ieee80211_ops ath9k_ops = {
.set_tsf = ath9k_set_tsf,
.reset_tsf = ath9k_reset_tsf,
.ampdu_action = ath9k_ampdu_action,
+ .get_survey = ath9k_get_survey,
.sw_scan_start = ath9k_sw_scan_start,
.sw_scan_complete = ath9k_sw_scan_complete,
.rfkill_poll = ath9k_rfkill_poll_state,
--
1.5.6.5
^ permalink raw reply related
* Re: [PATCH] ath9k: Added get_survey callback in order to get channel noise
From: Luis R. Rodriguez @ 2010-04-27 22:17 UTC (permalink / raw)
To: Benoit Papillault, John W. Linville
Cc: Luis Rodriguez, Jouni Malinen, ath9k-devel@lists.ath5k.org,
linux-wireless@vger.kernel.org
In-Reply-To: <1272406104-6870-1-git-send-email-benoit.papillault@free.fr>
On Tue, Apr 27, 2010 at 03:08:24PM -0700, Benoit Papillault wrote:
>
> Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
Looks good, thanks for this work.
Luis
^ permalink raw reply
* Re: [RFT] ar9170: implement get_survey
From: Benoit PAPILLAULT @ 2010-04-27 22:21 UTC (permalink / raw)
To: Christian Lamparter; +Cc: linux-wireless
In-Reply-To: <201004272323.22107.chunkeey@googlemail.com>
Christian Lamparter a écrit :
> This patch adds a basic get_survey for ar9170.
>
> Survey data from wlan1
> frequency: 2412 MHz
> noise: -85 dBm
>
> TODO:
> Currently, the noise level is updated only by a channel change.
> Now, we could simply add another ar9170_set_channel to always get
> a fresh result, but then we risk a RF lockup.
>
It seems to be a good start. The code is very similar to what is used in
ath9k. Just few questions below.
> ---
> diff --git a/drivers/net/wireless/ath/ar9170/ar9170.h b/drivers/net/wireless/ath/ar9170/ar9170.h
> index dc662b7..26fa31e 100644
> --- a/drivers/net/wireless/ath/ar9170/ar9170.h
> +++ b/drivers/net/wireless/ath/ar9170/ar9170.h
> @@ -198,7 +198,7 @@ struct ar9170 {
>
> /* PHY */
> struct ieee80211_channel *channel;
> - int noise[4];
> + int noise[6];
>
> /* power calibration data */
> u8 power_5G_leg[4];
> @@ -302,5 +302,5 @@ int ar9170_init_phy(struct ar9170 *ar, enum ieee80211_band band);
> int ar9170_init_rf(struct ar9170 *ar);
> int ar9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel,
> enum ar9170_rf_init_mode rfi, enum ar9170_bw bw);
> -
> +int ar9170_get_noisefloor(struct ar9170 *ar);
> #endif /* __AR9170_H */
> diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
> index 3247db8..1e422ed 100644
> --- a/drivers/net/wireless/ath/ar9170/main.c
> +++ b/drivers/net/wireless/ath/ar9170/main.c
> @@ -2485,6 +2485,25 @@ static int ar9170_ampdu_action(struct ieee80211_hw *hw,
> return 0;
> }
>
> +static int ar9170_op_get_survey(struct ieee80211_hw *hw, int idx,
> + struct survey_info *survey)
> +{
> + struct ar9170 *ar = hw->priv;
> + int err;
> +
> + if (idx != 0)
> + return -ENOENT;
> +
> + err = ar9170_get_noisefloor(ar);
> + if (err)
> + return err;
> +
> + survey->channel = ar->channel;
> + survey->filled = SURVEY_INFO_NOISE_DBM;
> + survey->noise = ar->noise[0];
> + return 0;
> +}
> +
> static const struct ieee80211_ops ar9170_ops = {
> .start = ar9170_op_start,
> .stop = ar9170_op_stop,
> @@ -2501,6 +2520,7 @@ static const struct ieee80211_ops ar9170_ops = {
> .sta_add = ar9170_sta_add,
> .sta_remove = ar9170_sta_remove,
> .get_stats = ar9170_get_stats,
> + .get_survey = ar9170_op_get_survey,
> .ampdu_action = ar9170_ampdu_action,
> };
>
> diff --git a/drivers/net/wireless/ath/ar9170/phy.c b/drivers/net/wireless/ath/ar9170/phy.c
> index 45a415e..31ff163 100644
> --- a/drivers/net/wireless/ath/ar9170/phy.c
> +++ b/drivers/net/wireless/ath/ar9170/phy.c
> @@ -1584,6 +1584,31 @@ static int ar9170_calc_noise_dbm(u32 raw_noise)
> return (raw_noise & 0xff) >> 1;
> }
>
> +int ar9170_get_noisefloor(struct ar9170 *ar)
> +{
> + static const u32 phy_regs[] = {
> + 0x1c5864, 0x1c6864, 0x1c7864,
> + 0x1c59bc, 0x1c69bc, 0x1c79bc };
>
Maybe #define would be more appropriate. Moreover, it's clear in my
notes that some ar9170 registers are just ath9k registers + 0x1bc000.
> + u32 phy_res[ARRAY_SIZE(phy_regs)];
> + int err, i;
> +
> + BUILD_BUG_ON(ARRAY_SIZE(phy_regs) != ARRAY_SIZE(ar->noise));
> +
> + err = ar9170_read_mreg(ar, ARRAY_SIZE(phy_regs), phy_regs, phy_res);
> + if (err)
> + return err;
> +
> + for (i = 0; i < ARRAY_SIZE(phy_regs); i++) {
> + ar->noise[i] = ar9170_calc_noise_dbm(
> + (phy_res[i] >> 19) & 0x1ff);
> +
> + ar->noise[i + 3] = ar9170_calc_noise_dbm(
> + (phy_res[i + 3] >> 23) & 0x1ff);
> + }
> +
> + return 0;
> +}
> +
> int ar9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel,
> enum ar9170_rf_init_mode rfi, enum ar9170_bw bw)
> {
> @@ -1708,12 +1733,12 @@ int ar9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel,
> }
> }
>
> - for (i = 0; i < 2; i++) {
> + for (i = 0; i < 3; i++) {
>
Why using 3 RX channels ? ar9170 is always 2x2, isn't it ? And why read
3 values since only one will be used in ar9170_op_get_survey?
Maybe we should combine the 3 values before reporting a single value ?
> ar->noise[i] = ar9170_calc_noise_dbm(
> - (le32_to_cpu(vals[2 + i]) >> 19) & 0x1ff);
> + (le32_to_cpu(vals[i + 1]) >> 19) & 0x1ff);
>
> - ar->noise[i + 2] = ar9170_calc_noise_dbm(
> - (le32_to_cpu(vals[5 + i]) >> 23) & 0x1ff);
> + ar->noise[i + 3] = ar9170_calc_noise_dbm(
> + (le32_to_cpu(vals[i + 4]) >> 23) & 0x1ff);
> }
>
> ar->channel = channel;
>
Moreover (but my patch for ath9k has the very same error), I think we
are reported the noise floor calibration result which is not the noise
at all... that might be another story anyway.
Regards,
Benoit
^ permalink raw reply
* Re: libertas sdio broken on XO-1.5s
From: Dan Williams @ 2010-04-28 0:14 UTC (permalink / raw)
To: Steve deRosier; +Cc: linux-wireless
In-Reply-To: <i2y446ae9281004271235sf6f04323j2faa28108481d81b@mail.gmail.com>
On Tue, 2010-04-27 at 12:35 -0700, Steve deRosier wrote:
> Dan,
>
> A change made by you on April 15th breaks firmware downloading to an
> sdio connected 8686 on the OLPC's XO-1.5s. I reverted it and was able
> to get firmware to load just fine, with it in, the firmware fails to
> load.
Ok, so we get to find out what fails with XO 1.5, and what works with
both the Wi2Wi and the Marvell 8686 dev board that I have that I tested
it with... I'll retest again I suppose.
> commit 96021f096e5178582af296a2fbb6df7dbd6b695c
> Author: Dan Williams <dcbw@redhat.com>
> Date: Thu Apr 15 13:27:44 2010 -0700
>
> libertas: consolidate SDIO firmware wait code
>
> Consolidate a bunch of C&P code that waits for the firmware to be ready.
>
> Signed-off-by: Dan Williams <dcbw@redhat.com>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
>
> dmesg:
> [ 15.391242] libertas_sdio: Libertas SDIO driver
> [ 15.391255] libertas_sdio: Copyright Pierre Ossman
> [ 15.539475] libertas_sdio mmc0:0001:1: firmware: requesting sd8686_helper.bin
> [ 17.540214] libertas: failed to load helper firmware
> [ 17.541054] libertas_sdio: probe of mmc0:0001:1 failed with error -110
>
> dmesg with it reverted:
> [ 15.141728] libertas_sdio: Libertas SDIO driver
> [ 15.141741] libertas_sdio: Copyright Pierre Ossman
> [ 15.275322] libertas_sdio mmc0:0001:1: firmware: requesting sd8686_helper.bin
> [ 16.430223] libertas_sdio mmc0:0001:1: firmware: requesting sd8686.bin
> [ 17.172443] libertas: 00:50:43:28:26:40, fw 9.70.7p0, cap 0x00000303
> [ 17.179552] libertas: wlan0: Marvell WLAN 802.11 adapter
>
> I don't know if there's something unique with this device where
> libertas_sdio works everywhere else and not with the XO-1.5, but I
> suspect we'll encounter this issue with other libertas devices.
The XO is all kinds of unique, but the 1.5 less so than the 1.0.
Dan
> I apologize for not sending a patch, but I don't have time right now
> to get to it. Perhaps you can get to it quicker, if so, I'll be happy
> to test anything you come up with.
>
> - Steve
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [ath9k-devel] ath9k: noise floor calibration process
From: RHS Linux User @ 2010-04-28 0:01 UTC (permalink / raw)
To: Benoit PAPILLAULT; +Cc: ath9k-devel, linux-wireless@vger.kernel.org
In-Reply-To: <4BD74B66.3030500@free.fr>
Hi All,
<preaching>
The chip *FOR SURE* *CANNOT* measure the thermal noise level!! It isn't
that sensitive. That said under some conditions it CAN measure the
local interference level which IS useful.
I am *VERY MUCH* in favor of making real time level measurements of
various parts of real packets easy to use! Troubleshooting becomes so
much easier :).
</preaching>
Great ideas !!
FWIW - I have on occasion used a low noise preamp to feed the chip.
Many more signals are detectable which "proves" the chip by itself *IS
NOT* that sensitive. Try it yourself !
Have fun,
Wiz
On Tue, 27 Apr 2010, Benoit PAPILLAULT wrote:
> Hello,
>
> In order to move forward with noise & signal reporting, I'd like to
> share my current understanding of the way ath9k HW is working before
> sending patches (unfortunately, I did the work before the introduction
> of ar9003... so I need to redo the work).
>
> The ultimate purpose of this work is to be able to measure signal levels
> (and noise if possible) as accurately as a spectrum analyzer or power meter.
>
> First, signal level reporting. It is reported in a per packet basis in
> RX descriptors. There are 7 fields:
> AR_RxRSSIAnt00 0x000000ff rs_rssi_ctl0
> AR_RxRSSIAnt01 0x0000ff00 rs_rssi_ctl1
> AR_RxRSSIAnt02 0x00ff0000 rs_rssi_ctl2
> AR_RxRSSIAnt10 0x000000ff rs_rssi_ext0
> AR_RxRSSIAnt11 0x0000ff00 rs_rssi_ext1
> AR_RxRSSIAnt12 0x00ff0000 rs_rssi_ext2
> AR_RxRSSICombined 0xff000000 rs_rssi
>
> Each value is for a 20 MHz wide channel, on the 3 RX chains. "ctl" is
> for the primary channel and "ext" is for the secondary channel (using
> the 802.11n words). The latter rs_rssi is the sum of the 6 previous
> value. However, since each value is dB, the sum is not an arithmetic
> sum. Each field is a signed value and the value -128 means that no
> measurement has been done (no RX chain, RX chain disabled, no secondary
> channel, ...). It seems that in some cases, the combined value is just
> plain wrong. Here are few examples:
>
> RSSI: ctl=(10,7,-128) ext=(-128,-128,-128) => 12 (11.76) correct
>
> RSSI: ctl=(38,29,-128) ext=(69,-84,-101) => -22 incorrect!!!
>
>
> Next, noise floor calibration. From what I understand, signal levels is
> measured using the AGC + RX amplifiers gain (RF, IF and BB). However,
> the various gains are not really accurate, only the relative gain are
> accurate. This means that reading a signal value of -100dBm might not
> exactly means -100dBm. There is a delta between real signal and measured
> value. In order to know this value, we need a calibration process with a
> known signal.
>
> One know signal is thermal noise. Thermal noise is generated in any
> resistor and can be computed using the well know value N = kTB. For a 20
> MHz bandwidth, this gives -101dBm. If the HW tries to measure signal
> strength when the network is supposed to be idle (during SIFS) and with
> RX/TX switch disabled (?), then it will in fact measure the thermal
> noise at the RX input.
>
> So, we have :
>
> Real noise (-101dBm) = Measured noise + delta
>
> There are type of registers to control noise floor calibration :
>
> - control register at 0x9860 (AR_PHY_AGC_CONTROL)
>
> This register allows 3 differents operations :
>
> 1. start noise floor measurement
>
> write AR_PHY_MAXCCA_PWR (AR_PHY_CCA & 0x000001ff) : this is apparently
> a max value
> for noise floor
> REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_ENABLE_NF);
> REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
> REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
>
> When channel has been changed however, the noise floor needs to be
> updated immediately, so AR_PHY_AGC_CONTROL_NO_UPDATE_NF should be
> cleared in this particular case. Otherwise, the chip is no longer
> receiving (problem since CCA is defined with noise floor as reference).
>
> 2. read noise floor measurement result
>
> check REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF
> if 0 (noise floor calibration is finished), read AR_PHY_MINCCA_PWR :
> nf = MS(REG_READ(ah, AR_PHY_CCA), AR_PHY_MINCCA_PWR = 0x0ff80000)
>
> 3. write noise floor reference
>
> write AR_PHY_MAXCCA_PWR (the value has not the same meaning as
> operation 1!)
> REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_ENABLE_NF);
> REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
> REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
>
> - data register at 0x9864 (AR_PHY_CCA, + more location for other RX chains)
>
> The fields are different for AR9280+ chipsets, but the mechanism is
> the same.
>
> AR_PHY_MAXCCA_PWR 0x000001ff (half dBm unit!)
> AR_PHY_CCA_THRESH62 0x0007f000
> AR_PHY_MINCCA_PWR 0x0ff80000
>
> Now, we have :
>
> Real signal = Measured signal + delta
> = RSSI + Noise floor + delta
> = RSSI + (-101 dBm)
>
> Real noise is not thermal noise. There are a lot of definition for noise
> since noise is NOT signal. Of course, noise includes thermal noise.
> Since the noise measured by the chip is variable, I think we could do :
>
> - Noise floor = minimum (Noise floor measures)
> - Noise = moving average (Noise floor measures) + delta
> with delta = (-101 dBm) - Noise floor
>
> I'd like to get comments before sending patches. Since ath5k and ath9k
> are quite close, I'm pretty sure a similar (if not same) process is used
> on ath5k.
>
> Regards,
> Benoit
>
> _______________________________________________
> ath9k-devel mailing list
> ath9k-devel@lists.ath9k.org
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>
^ permalink raw reply
* Re: [ath9k-devel] ath9k: noise floor calibration process
From: Benoit PAPILLAULT @ 2010-04-28 6:04 UTC (permalink / raw)
To: RHS Linux User; +Cc: ath9k-devel, linux-wireless@vger.kernel.org
In-Reply-To: <Pine.LNX.3.95.1100427193637.9331F-100000@nei>
RHS Linux User a écrit :
> Hi All,
>
> <preaching>
>
> The chip *FOR SURE* *CANNOT* measure the thermal noise level!! It isn't
> that sensitive. That said under some conditions it CAN measure the
> local interference level which IS useful.
>
In fact, that's what I thought first, but according to Atheros patent,
it can. It seems pretty logic in fact : if you have no real signal at
the input, you are measuring ambient noise. A spectrum analyzer is able
to do it as well.
Sensitivity is the ability to decode 802.11 modulation out of the signal
received (which includes any kind of noise). Using the formulas below,
I measure the minimum signal levels of 802.11 packets by moving away
from an AP and I indeed found -95dBm which is the typical sensitivity
levels of an Atheros chip.
> I am *VERY MUCH* in favor of making real time level measurements of
> various parts of real packets easy to use! Troubleshooting becomes so
> much easier :).
>
> </preaching>
>
> Great ideas !!
>
> FWIW - I have on occasion used a low noise preamp to feed the chip.
> Many more signals are detectable which "proves" the chip by itself *IS
> NOT* that sensitive. Try it yourself !
>
Sure, in fact, I /think/ the thermal noise I'm talking is generated
inside the first RX amplifier (it's probably generated in every RX
amplifier, but the first is the biggest since it's amplified more than
the others). So, if you put a low noise preamp, you are feeding the chip
with more signal at the input but the chip has still the same amount of
noise. Am I correct?
> Have fun,
>
> Wiz
>
Regards,
Benoit
>
> On Tue, 27 Apr 2010, Benoit PAPILLAULT wrote:
>
>
>> Hello,
>>
>> In order to move forward with noise & signal reporting, I'd like to
>> share my current understanding of the way ath9k HW is working before
>> sending patches (unfortunately, I did the work before the introduction
>> of ar9003... so I need to redo the work).
>>
>> The ultimate purpose of this work is to be able to measure signal levels
>> (and noise if possible) as accurately as a spectrum analyzer or power meter.
>>
>> First, signal level reporting. It is reported in a per packet basis in
>> RX descriptors. There are 7 fields:
>> AR_RxRSSIAnt00 0x000000ff rs_rssi_ctl0
>> AR_RxRSSIAnt01 0x0000ff00 rs_rssi_ctl1
>> AR_RxRSSIAnt02 0x00ff0000 rs_rssi_ctl2
>> AR_RxRSSIAnt10 0x000000ff rs_rssi_ext0
>> AR_RxRSSIAnt11 0x0000ff00 rs_rssi_ext1
>> AR_RxRSSIAnt12 0x00ff0000 rs_rssi_ext2
>> AR_RxRSSICombined 0xff000000 rs_rssi
>>
>> Each value is for a 20 MHz wide channel, on the 3 RX chains. "ctl" is
>> for the primary channel and "ext" is for the secondary channel (using
>> the 802.11n words). The latter rs_rssi is the sum of the 6 previous
>> value. However, since each value is dB, the sum is not an arithmetic
>> sum. Each field is a signed value and the value -128 means that no
>> measurement has been done (no RX chain, RX chain disabled, no secondary
>> channel, ...). It seems that in some cases, the combined value is just
>> plain wrong. Here are few examples:
>>
>> RSSI: ctl=(10,7,-128) ext=(-128,-128,-128) => 12 (11.76) correct
>>
>> RSSI: ctl=(38,29,-128) ext=(69,-84,-101) => -22 incorrect!!!
>>
>>
>> Next, noise floor calibration. From what I understand, signal levels is
>> measured using the AGC + RX amplifiers gain (RF, IF and BB). However,
>> the various gains are not really accurate, only the relative gain are
>> accurate. This means that reading a signal value of -100dBm might not
>> exactly means -100dBm. There is a delta between real signal and measured
>> value. In order to know this value, we need a calibration process with a
>> known signal.
>>
>> One know signal is thermal noise. Thermal noise is generated in any
>> resistor and can be computed using the well know value N = kTB. For a 20
>> MHz bandwidth, this gives -101dBm. If the HW tries to measure signal
>> strength when the network is supposed to be idle (during SIFS) and with
>> RX/TX switch disabled (?), then it will in fact measure the thermal
>> noise at the RX input.
>>
>> So, we have :
>>
>> Real noise (-101dBm) = Measured noise + delta
>>
>> There are type of registers to control noise floor calibration :
>>
>> - control register at 0x9860 (AR_PHY_AGC_CONTROL)
>>
>> This register allows 3 differents operations :
>>
>> 1. start noise floor measurement
>>
>> write AR_PHY_MAXCCA_PWR (AR_PHY_CCA & 0x000001ff) : this is apparently
>> a max value
>> for noise floor
>> REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_ENABLE_NF);
>> REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
>> REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
>>
>> When channel has been changed however, the noise floor needs to be
>> updated immediately, so AR_PHY_AGC_CONTROL_NO_UPDATE_NF should be
>> cleared in this particular case. Otherwise, the chip is no longer
>> receiving (problem since CCA is defined with noise floor as reference).
>>
>> 2. read noise floor measurement result
>>
>> check REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF
>> if 0 (noise floor calibration is finished), read AR_PHY_MINCCA_PWR :
>> nf = MS(REG_READ(ah, AR_PHY_CCA), AR_PHY_MINCCA_PWR = 0x0ff80000)
>>
>> 3. write noise floor reference
>>
>> write AR_PHY_MAXCCA_PWR (the value has not the same meaning as
>> operation 1!)
>> REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_ENABLE_NF);
>> REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
>> REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
>>
>> - data register at 0x9864 (AR_PHY_CCA, + more location for other RX chains)
>>
>> The fields are different for AR9280+ chipsets, but the mechanism is
>> the same.
>>
>> AR_PHY_MAXCCA_PWR 0x000001ff (half dBm unit!)
>> AR_PHY_CCA_THRESH62 0x0007f000
>> AR_PHY_MINCCA_PWR 0x0ff80000
>>
>> Now, we have :
>>
>> Real signal = Measured signal + delta
>> = RSSI + Noise floor + delta
>> = RSSI + (-101 dBm)
>>
>> Real noise is not thermal noise. There are a lot of definition for noise
>> since noise is NOT signal. Of course, noise includes thermal noise.
>> Since the noise measured by the chip is variable, I think we could do :
>>
>> - Noise floor = minimum (Noise floor measures)
>> - Noise = moving average (Noise floor measures) + delta
>> with delta = (-101 dBm) - Noise floor
>>
>> I'd like to get comments before sending patches. Since ath5k and ath9k
>> are quite close, I'm pretty sure a similar (if not same) process is used
>> on ath5k.
>>
>> Regards,
>> Benoit
>>
>> _______________________________________________
>> ath9k-devel mailing list
>> ath9k-devel@lists.ath9k.org
>> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>>
>>
>
> _______________________________________________
> ath9k-devel mailing list
> ath9k-devel@lists.ath9k.org
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>
>
^ permalink raw reply
* [PATCH 4/4] wl1271: fix a bunch of sparse warnings
From: Luciano Coelho @ 2010-04-28 6:50 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
In-Reply-To: <1272437402-28801-1-git-send-email-luciano.coelho@nokia.com>
A couple of sparse warnings in some rate settings (missing cpu_to_le32) were
fixed. Changed the conf_sg_settings struct from le to native endianess. The
values are converted to le when copying them to the acx command instead.
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
---
drivers/net/wireless/wl12xx/wl1271_acx.c | 2 +-
drivers/net/wireless/wl12xx/wl1271_boot.c | 8 ++++----
drivers/net/wireless/wl12xx/wl1271_cmd.c | 4 ++--
drivers/net/wireless/wl12xx/wl1271_conf.h | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c
index 2ad086e..e19e2f8 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.c
@@ -590,7 +590,7 @@ int wl1271_acx_sg_cfg(struct wl1271 *wl)
/* BT-WLAN coext parameters */
for (i = 0; i < CONF_SG_PARAMS_MAX; i++)
- param->params[i] = c->params[i];
+ param->params[i] = cpu_to_le32(c->params[i]);
param->param_idx = CONF_SG_PARAMS_ALL;
ret = wl1271_cmd_configure(wl, ACX_SG_CFG, param, sizeof(*param));
diff --git a/drivers/net/wireless/wl12xx/wl1271_boot.c b/drivers/net/wireless/wl12xx/wl1271_boot.c
index 8087dc1..acb1d9e 100644
--- a/drivers/net/wireless/wl12xx/wl1271_boot.c
+++ b/drivers/net/wireless/wl12xx/wl1271_boot.c
@@ -351,7 +351,7 @@ static int wl1271_boot_soft_reset(struct wl1271 *wl)
static int wl1271_boot_run_firmware(struct wl1271 *wl)
{
int loop, ret;
- u32 chip_id, interrupt;
+ u32 chip_id, intr;
wl1271_boot_set_ecpu_ctrl(wl, ECPU_CONTROL_HALT);
@@ -368,15 +368,15 @@ static int wl1271_boot_run_firmware(struct wl1271 *wl)
loop = 0;
while (loop++ < INIT_LOOP) {
udelay(INIT_LOOP_DELAY);
- interrupt = wl1271_read32(wl, ACX_REG_INTERRUPT_NO_CLEAR);
+ intr = wl1271_read32(wl, ACX_REG_INTERRUPT_NO_CLEAR);
- if (interrupt == 0xffffffff) {
+ if (intr == 0xffffffff) {
wl1271_error("error reading hardware complete "
"init indication");
return -EIO;
}
/* check that ACX_INTR_INIT_COMPLETE is enabled */
- else if (interrupt & WL1271_ACX_INTR_INIT_COMPLETE) {
+ else if (intr & WL1271_ACX_INTR_INIT_COMPLETE) {
wl1271_write32(wl, ACX_REG_INTERRUPT_ACK,
WL1271_ACX_INTR_INIT_COMPLETE);
break;
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index 61fb774..62c11af 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -318,7 +318,7 @@ int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type)
join->rx_config_options = cpu_to_le32(wl->rx_config);
join->rx_filter_options = cpu_to_le32(wl->rx_filter);
join->bss_type = bss_type;
- join->basic_rate_set = wl->basic_rate_set;
+ join->basic_rate_set = cpu_to_le32(wl->basic_rate_set);
if (wl->band == IEEE80211_BAND_5GHZ)
join->bss_type |= WL1271_JOIN_CMD_BSS_TYPE_5GHZ;
@@ -615,7 +615,7 @@ int wl1271_cmd_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
params->params.scan_options = cpu_to_le16(scan_options);
params->params.num_probe_requests = probe_requests;
- params->params.tx_rate = rate;
+ params->params.tx_rate = cpu_to_le32(rate);
params->params.tid_trigger = 0;
params->params.scan_tag = WL1271_SCAN_DEFAULT_TAG;
diff --git a/drivers/net/wireless/wl12xx/wl1271_conf.h b/drivers/net/wireless/wl12xx/wl1271_conf.h
index c44307c..d046d04 100644
--- a/drivers/net/wireless/wl12xx/wl1271_conf.h
+++ b/drivers/net/wireless/wl12xx/wl1271_conf.h
@@ -401,7 +401,7 @@ enum {
};
struct conf_sg_settings {
- __le32 params[CONF_SG_PARAMS_MAX];
+ u32 params[CONF_SG_PARAMS_MAX];
u8 state;
};
--
1.6.3.3
^ permalink raw reply related
* [PATCH 0/4] wl1271: patches of the week
From: Luciano Coelho @ 2010-04-28 6:49 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
Hi John,
It has been a while since I last sent patches for wl1271, but there hasn't been too much going on with the wl1271 driver itself. Most of our work is going to mac80211 at the moment.
Anyway, it's time to send them so that we catch up.
Cheers,
Luca.
Juuso Oikarinen (2):
wl1271: Improve command polling
wl1271: Rewrite hardware keep-alive handling
Luciano Coelho (1):
wl1271: fix a bunch of sparse warnings
Saravanan Dhanabal (1):
wl1271: Configure QOS nullfunc template for U-APSD
drivers/net/wireless/wl12xx/wl1271_acx.c | 2 +-
drivers/net/wireless/wl12xx/wl1271_boot.c | 8 +-
drivers/net/wireless/wl12xx/wl1271_cmd.c | 14 ++--
drivers/net/wireless/wl12xx/wl1271_conf.h | 2 +-
drivers/net/wireless/wl12xx/wl1271_main.c | 95 +++++++++++++++--------------
5 files changed, 63 insertions(+), 58 deletions(-)
^ permalink raw reply
* [PATCH 1/4] wl1271: Improve command polling
From: Luciano Coelho @ 2010-04-28 6:49 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Juuso Oikarinen
In-Reply-To: <1272437402-28801-1-git-send-email-luciano.coelho@nokia.com>
From: Juuso Oikarinen <juuso.oikarinen@nokia.com>
In testing I noticed that the wl1271 commands fall into two categories. In the
first category are "fast" commands, these mostly take only 0 or 1 polls to
complete, but occasionally upto 50 (giving a 0.5ms execution time.) In the
second category, the command completion takes well more than 0.5ms (from
1.5ms upwards.)
This patch fixes command polling such that it is optimal for the fast commands,
but also allows sleep for the longer ones.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
---
drivers/net/wireless/wl12xx/wl1271_cmd.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index 6b5ba8e..61fb774 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -37,7 +37,7 @@
#include "wl1271_cmd.h"
#include "wl1271_event.h"
-#define WL1271_CMD_POLL_COUNT 5
+#define WL1271_CMD_FAST_POLL_COUNT 50
/*
* send command to firmware
@@ -77,11 +77,11 @@ int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len,
goto out;
}
- udelay(10);
poll_count++;
- if (poll_count == WL1271_CMD_POLL_COUNT)
- wl1271_info("cmd polling took over %d cycles",
- poll_count);
+ if (poll_count < WL1271_CMD_FAST_POLL_COUNT)
+ udelay(10);
+ else
+ msleep(1);
intr = wl1271_read32(wl, ACX_REG_INTERRUPT_NO_CLEAR);
}
--
1.6.3.3
^ permalink raw reply related
* [PATCH 3/4] wl1271: Rewrite hardware keep-alive handling
From: Luciano Coelho @ 2010-04-28 6:50 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Juuso Oikarinen
In-Reply-To: <1272437402-28801-1-git-send-email-luciano.coelho@nokia.com>
From: Juuso Oikarinen <juuso.oikarinen@nokia.com>
The driver had a join command without keep-alive restart procedures in the
channel changing code. After associated scans, the mac80211 does re-set the
current channel, causing the join to occur. This would stop the hardware
keep alive.
To make the joins safer in this respect, this patch adds a join function that
does the hardware-keep-alive magic along the join. This is now invoked in the
above mentioned scenario, and also other scenarios.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
---
drivers/net/wireless/wl12xx/wl1271_main.c | 91 +++++++++++++++--------------
1 files changed, 46 insertions(+), 45 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 26e8fb1..466106e 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -1118,14 +1118,13 @@ static void wl1271_configure_filters(struct wl1271 *wl, unsigned int filters)
}
}
-static int wl1271_join_channel(struct wl1271 *wl, int channel)
+static int wl1271_dummy_join(struct wl1271 *wl)
{
int ret = 0;
/* we need to use a dummy BSSID for now */
static const u8 dummy_bssid[ETH_ALEN] = { 0x0b, 0xad, 0xde,
0xad, 0xbe, 0xef };
- wl->channel = channel;
memcpy(wl->bssid, dummy_bssid, ETH_ALEN);
/* pass through frames from all BSS */
@@ -1141,7 +1140,47 @@ out:
return ret;
}
-static int wl1271_unjoin_channel(struct wl1271 *wl)
+static int wl1271_join(struct wl1271 *wl)
+{
+ int ret;
+
+ ret = wl1271_cmd_join(wl, wl->set_bss_type);
+ if (ret < 0)
+ goto out;
+
+ set_bit(WL1271_FLAG_JOINED, &wl->flags);
+
+ if (!test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags))
+ goto out;
+
+ /*
+ * The join command disable the keep-alive mode, shut down its process,
+ * and also clear the template config, so we need to reset it all after
+ * the join. The acx_aid starts the keep-alive process, and the order
+ * of the commands below is relevant.
+ */
+ ret = wl1271_acx_keep_alive_mode(wl, true);
+ if (ret < 0)
+ goto out;
+
+ ret = wl1271_acx_aid(wl, wl->aid);
+ if (ret < 0)
+ goto out;
+
+ ret = wl1271_cmd_build_klv_null_data(wl);
+ if (ret < 0)
+ goto out;
+
+ ret = wl1271_acx_keep_alive_config(wl, CMD_TEMPL_KLV_IDX_NULL_DATA,
+ ACX_KEEP_ALIVE_TPL_VALID);
+ if (ret < 0)
+ goto out;
+
+out:
+ return ret;
+}
+
+static int wl1271_unjoin(struct wl1271 *wl)
{
int ret;
@@ -1231,7 +1270,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
"failed %d", ret);
if (test_bit(WL1271_FLAG_JOINED, &wl->flags)) {
- ret = wl1271_cmd_join(wl, wl->set_bss_type);
+ ret = wl1271_join(wl);
if (ret < 0)
wl1271_warning("cmd join to update channel "
"failed %d", ret);
@@ -1241,9 +1280,9 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
if (changed & IEEE80211_CONF_CHANGE_IDLE) {
if (conf->flags & IEEE80211_CONF_IDLE &&
test_bit(WL1271_FLAG_JOINED, &wl->flags))
- wl1271_unjoin_channel(wl);
+ wl1271_unjoin(wl);
else if (!(conf->flags & IEEE80211_CONF_IDLE))
- wl1271_join_channel(wl, channel);
+ wl1271_dummy_join(wl);
if (conf->flags & IEEE80211_CONF_IDLE) {
wl->rate_set = wl1271_min_rate_get(wl);
@@ -1613,7 +1652,6 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
enum wl1271_cmd_ps_mode mode;
struct wl1271 *wl = hw->priv;
bool do_join = false;
- bool do_keepalive = false;
int ret;
wl1271_debug(DEBUG_MAC80211, "mac80211 bss info changed");
@@ -1756,19 +1794,6 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
ret = wl1271_cmd_build_probe_req(wl, NULL, 0,
NULL, 0, wl->band);
- /* Enable the keep-alive feature */
- ret = wl1271_acx_keep_alive_mode(wl, true);
- if (ret < 0)
- goto out_sleep;
-
- /*
- * This is awkward. The keep-alive configs must be done
- * *after* the join command, because otherwise it will
- * not work, but it must only be done *once* because
- * otherwise the firmware will start complaining.
- */
- do_keepalive = true;
-
/* enable the connection monitoring feature */
ret = wl1271_acx_conn_monit_params(wl, true);
if (ret < 0)
@@ -1836,35 +1861,11 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
}
if (do_join) {
- ret = wl1271_cmd_join(wl, wl->set_bss_type);
+ ret = wl1271_join(wl);
if (ret < 0) {
wl1271_warning("cmd join failed %d", ret);
goto out_sleep;
}
- set_bit(WL1271_FLAG_JOINED, &wl->flags);
- }
-
- /*
- * The JOIN operation shuts down the firmware keep-alive as a side
- * effect, and the ACX_AID will start the keep-alive as a side effect.
- * Hence, for non-IBSS, the ACX_AID must always happen *after* the
- * JOIN operation, and the template config after the ACX_AID.
- */
- if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) {
- ret = wl1271_acx_aid(wl, wl->aid);
- if (ret < 0)
- goto out_sleep;
- }
-
- if (do_keepalive) {
- ret = wl1271_cmd_build_klv_null_data(wl);
- if (ret < 0)
- goto out_sleep;
- ret = wl1271_acx_keep_alive_config(
- wl, CMD_TEMPL_KLV_IDX_NULL_DATA,
- ACX_KEEP_ALIVE_TPL_VALID);
- if (ret < 0)
- goto out_sleep;
}
out_sleep:
--
1.6.3.3
^ permalink raw reply related
* [PATCH 2/4] wl1271: Configure QOS nullfunc template for U-APSD
From: Luciano Coelho @ 2010-04-28 6:50 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Saravanan Dhanabal
In-Reply-To: <1272437402-28801-1-git-send-email-luciano.coelho@nokia.com>
From: Saravanan Dhanabal <ext-saravanan.dhanabal@nokia.com>
When U-APSD is enabled, device is not sending power save
state notifications to AP using QOS nullfunc frames.
This patch configures nullfunc templates needed for U-APSD.
Signed-off-by: Saravanan Dhanabal <ext-saravanan.dhanabal@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
---
drivers/net/wireless/wl12xx/wl1271_main.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index e53dfc9..26e8fb1 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -1708,6 +1708,10 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
if (ret < 0)
goto out_sleep;
+ ret = wl1271_build_qos_null_data(wl);
+ if (ret < 0)
+ goto out_sleep;
+
/* filter out all packets not from this BSSID */
wl1271_configure_filters(wl, 0);
--
1.6.3.3
^ permalink raw reply related
* Re: [PATCH] ath9k: Added get_survey callback in order to get channel noise
From: Jouni Malinen @ 2010-04-28 7:00 UTC (permalink / raw)
To: Benoit Papillault
Cc: Luis Rodriguez, ath9k-devel@lists.ath5k.org,
linux-wireless@vger.kernel.org
In-Reply-To: <1272406104-6870-1-git-send-email-benoit.papillault@free.fr>
On Tue, 2010-04-27 at 15:08 -0700, Benoit Papillault wrote:
> +static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,
> + struct survey_info *survey)
> + struct ieee80211_conf *conf = &hw->conf;
> +
> + if (idx != 0)
> + return -ENOENT;
> +
> + survey->channel = conf->channel;
Are there any plans on providing this information from all channels? I
have assumed that the survey command was supposed to be used for
surveying all channels (e.g., to get information for auto-channel
selection) and returning something for the current channel is quite
limited subset of that. In other words, I would like to be able to run a
scan of all channels and then use NL80211_CMD_GET_SURVEY to fetch
additional per-channel information like noise (and also channel usage
statistics in case of ath9k) from the scanned channels.
- Jouni
^ permalink raw reply
* [PATCH] rt2x00: rt2800lib: update rfcsr & bbp init code for SoC devices
From: Helmut Schaa @ 2010-04-28 7:58 UTC (permalink / raw)
To: John Linville; +Cc: Gertjan van Wingerde, Ivo van Doorn, linux-wireless
Update the rfcsr and bbp init code for SoC devices to match with the
latest Ralink driver.
To have better control over which values are used for the register
initialization create a new function rt2800_is_305x_soc which checks
for SoC interface type, the correct RT chipset and the correct RF
chipset. This is based on the assumption that all rt305x SoC devices
use a rt2872 and rf3020/rf3021/rf3022.
In case an unknown RF chipset is found on a SoC device with a rt2872
don't treat it as rt305x and just print a message.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
Gertjan, this approach should be pretty safe and if there really exists
a rt305x board with a different rf chipset we'll get a log message.
At the moment rt2800_is_305x_soc is only used in rt2800lib.c but maybe
it's worth to move it to one of the headers?
drivers/net/wireless/rt2x00/rt2800lib.c | 43 ++++++++++++++++++++++++------
1 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 50f4451..e7a61a3 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -76,6 +76,23 @@ MODULE_LICENSE("GPL");
rt2800_regbusy_read((__dev), H2M_MAILBOX_CSR, \
H2M_MAILBOX_CSR_OWNER, (__reg))
+static inline bool rt2800_is_305x_soc(struct rt2x00_dev *rt2x00dev)
+{
+ /* check for rt2872 on SoC */
+ if (!rt2x00_is_soc(rt2x00dev) ||
+ !rt2x00_rt(rt2x00dev, RT2872))
+ return false;
+
+ /* we know for sure that these rf chipsets are used on rt305x boards */
+ if (rt2x00_rf(rt2x00dev, RF3020) ||
+ rt2x00_rf(rt2x00dev, RF3021) ||
+ rt2x00_rf(rt2x00dev, RF3022))
+ return true;
+
+ NOTICE(rt2x00dev, "Unknown RF chipset on rt305x\n");
+ return false;
+}
+
static void rt2800_bbp_write(struct rt2x00_dev *rt2x00dev,
const unsigned int word, const u8 value)
{
@@ -1556,6 +1573,9 @@ int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
rt2800_wait_bbp_ready(rt2x00dev)))
return -EACCES;
+ if (rt2800_is_305x_soc(rt2x00dev))
+ rt2800_bbp_write(rt2x00dev, 31, 0x08);
+
rt2800_bbp_write(rt2x00dev, 65, 0x2c);
rt2800_bbp_write(rt2x00dev, 66, 0x38);
@@ -1576,6 +1596,9 @@ int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
rt2800_bbp_write(rt2x00dev, 79, 0x13);
rt2800_bbp_write(rt2x00dev, 80, 0x05);
rt2800_bbp_write(rt2x00dev, 81, 0x33);
+ } else if (rt2800_is_305x_soc(rt2x00dev)) {
+ rt2800_bbp_write(rt2x00dev, 78, 0x0e);
+ rt2800_bbp_write(rt2x00dev, 80, 0x08);
} else {
rt2800_bbp_write(rt2x00dev, 81, 0x37);
}
@@ -1596,12 +1619,16 @@ int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
if (rt2x00_rt_rev_gte(rt2x00dev, RT3070, REV_RT3070F) ||
rt2x00_rt_rev_gte(rt2x00dev, RT3071, REV_RT3071E) ||
rt2x00_rt_rev_gte(rt2x00dev, RT3090, REV_RT3090E) ||
- rt2x00_rt_rev_gte(rt2x00dev, RT3390, REV_RT3390E))
+ rt2x00_rt_rev_gte(rt2x00dev, RT3390, REV_RT3390E) ||
+ rt2800_is_305x_soc(rt2x00dev))
rt2800_bbp_write(rt2x00dev, 103, 0xc0);
else
rt2800_bbp_write(rt2x00dev, 103, 0x00);
- rt2800_bbp_write(rt2x00dev, 105, 0x05);
+ if (rt2800_is_305x_soc(rt2x00dev))
+ rt2800_bbp_write(rt2x00dev, 105, 0x01);
+ else
+ rt2800_bbp_write(rt2x00dev, 105, 0x05);
rt2800_bbp_write(rt2x00dev, 106, 0x35);
if (rt2x00_rt(rt2x00dev, RT3071) ||
@@ -1618,11 +1645,6 @@ int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
rt2800_bbp_write(rt2x00dev, 138, value);
}
- if (rt2x00_rt(rt2x00dev, RT2872)) {
- rt2800_bbp_write(rt2x00dev, 31, 0x08);
- rt2800_bbp_write(rt2x00dev, 78, 0x0e);
- rt2800_bbp_write(rt2x00dev, 80, 0x08);
- }
for (i = 0; i < EEPROM_BBP_SIZE; i++) {
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBP_START + i, &eeprom);
@@ -1709,7 +1731,7 @@ int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
!rt2x00_rt(rt2x00dev, RT3071) &&
!rt2x00_rt(rt2x00dev, RT3090) &&
!rt2x00_rt(rt2x00dev, RT3390) &&
- !(rt2x00_is_soc(rt2x00dev) && rt2x00_rt(rt2x00dev, RT2872)))
+ !rt2800_is_305x_soc(rt2x00dev))
return 0;
/*
@@ -1777,7 +1799,7 @@ int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
rt2800_rfcsr_write(rt2x00dev, 29, 0x8f);
rt2800_rfcsr_write(rt2x00dev, 30, 0x20);
rt2800_rfcsr_write(rt2x00dev, 31, 0x0f);
- } else if (rt2x00_rt(rt2x00dev, RT2872)) {
+ } else if (rt2800_is_305x_soc(rt2x00dev)) {
rt2800_rfcsr_write(rt2x00dev, 0, 0x50);
rt2800_rfcsr_write(rt2x00dev, 1, 0x01);
rt2800_rfcsr_write(rt2x00dev, 2, 0xf7);
@@ -1808,6 +1830,9 @@ int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
rt2800_rfcsr_write(rt2x00dev, 27, 0x23);
rt2800_rfcsr_write(rt2x00dev, 28, 0x13);
rt2800_rfcsr_write(rt2x00dev, 29, 0x83);
+ rt2800_rfcsr_write(rt2x00dev, 30, 0x00);
+ rt2800_rfcsr_write(rt2x00dev, 31, 0x00);
+ return 0;
}
if (rt2x00_rt_rev_lt(rt2x00dev, RT3070, REV_RT3070F)) {
--
1.6.4.2
^ permalink raw reply related
* kernel warning on 2.6.33 ath9k
From: Xu, Martin @ 2010-04-28 8:01 UTC (permalink / raw)
To: ath9k-devel@lists.ath5k.org, linux-wireless@vger.kernel.org
In-Reply-To: <1272438045.2772.6.camel@jm-desktop>
SGkNCkkgZm91bmQgdGhhdCBrZXJuZWwgcmVwb3J0cyBiZWxvdyB3YXJuaW5nIHdoZW4gdXNpbmcg
YXRoOWsgaW4ga2VybmVsIDIuNi4zMy4NClNvbWVvbmUgY2FuIGtpbmRseSB0ZWxsIG1lIHdoZXRo
ZXIgaXQgaXMgdGhlIG5ldyBmb3VuZCBpc3N1ZSBvciB0aGUgaXNzdWUgaXMga25vd24gYW5kIGhh
cyBiZWVuIGZpeGVkIGluIGxhdGVyIGNvbW1pdCBpbiBnaXQgdHJlZT8NClRoYW5rcyENCg0KLS0t
LS0tLS0tLS0tWyBjdXQgaGVyZSBdLS0tLS0tLS0tLS0tDQpXQVJOSU5HOiBhdCBrZXJuZWwvc29m
dGlycS5jOjE0MyBsb2NhbF9iaF9lbmFibGVfaXArMHgzMi8weDc2KCkNCkhhcmR3YXJlIG5hbWU6
IEFPNTMyaCAgICAgICAgICANCk1vZHVsZXMgbGlua2VkIGluOiBjYmMgZWNyeXB0ZnMgYXRoOWsg
YXRoOWtfY29tbW9uIGJhdHRlcnkgYXRsMWMgam95ZGV2IGF0aDlrX2h3IHV2Y3ZpZGVvDQpQaWQ6
IDg1MCwgY29tbTogd3BhX3N1cHBsaWNhbnQgTm90IHRhaW50ZWQgMi42LjMzLjItOC4xLW5ldGJv
b2sgIzENCkNhbGwgVHJhY2U6DQogWzxjMTAzMDk3OD5dIHdhcm5fc2xvd3BhdGhfY29tbW9uKzB4
NjYvMHg3ZA0KIFs8YzEwMzVhNzQ+XSA/IGxvY2FsX2JoX2VuYWJsZV9pcCsweDMyLzB4NzYNCiBb
PGMxMDMwOTljPl0gd2Fybl9zbG93cGF0aF9udWxsKzB4ZC8weDEwDQogWzxjMTAzNWE3ND5dIGxv
Y2FsX2JoX2VuYWJsZV9pcCsweDMyLzB4NzYNCiBbPGMxNDc4OWMwPl0gX3Jhd19zcGluX3VubG9j
a19iaCsweDE3LzB4MTkNCiBbPGY4NzFkYmQzPl0gYXRoX3R4X25vZGVfY2xlYW51cCsweGUwLzB4
ZjkgW2F0aDlrXQ0KIFs8YzEwM2FlNDY+XSA/IGxvY2tfdGltZXJfYmFzZSsweDIyLzB4NDENCiBb
PGY4NzFhMDA1Pl0gYXRoOWtfc3RhX25vdGlmeSsweDc0LzB4NzggW2F0aDlrXQ0KIFs8YzE0NDM5
ODc+XSBfX3N0YV9pbmZvX3VubGluaysweDEzOS8weDE4OQ0KIFs8Zjg3MTlmOTE+XSA/IGF0aDlr
X3N0YV9ub3RpZnkrMHgwLzB4NzggW2F0aDlrXQ0KIFs8YzE0NDM5ZmE+XSBzdGFfaW5mb191bmxp
bmsrMHgyMy8weDMxDQogWzxjMTQ0ODgzND5dIGllZWU4MDIxMV9zZXRfZGlzYXNzb2MrMHgxYmQv
MHgxZTMNCiBbPGMxNDQ4Y2Y4Pl0gaWVlZTgwMjExX21nZF9kZWF1dGgrMHgzYy8weGZlDQogWzxj
MTQ0ZGYyMT5dIGllZWU4MDIxMV9kZWF1dGgrMHgxNC8weDE2DQogWzxjMTQzYzNmYz5dIF9fY2Zn
ODAyMTFfbWxtZV9kZWF1dGgrMHhlOS8weGYyDQogWzxjMTQzZWVhMT5dIF9fY2ZnODAyMTFfZGlz
Y29ubmVjdCsweGNiLzB4MTJlDQogWzxjMTQ0MGI3ND5dIGNmZzgwMjExX3dleHRfc2l3bWxtZSsw
eDY0LzB4ODANCiBbPGMxNDQxY2Y2Pl0gaW9jdGxfc3RhbmRhcmRfY2FsbCsweDFkNy8weDI2Zg0K
IFs8YzEzOTI4MWI+XSA/IGRldl9nZXRfYnlfbmFtZV9yY3UrMHg3My8weDgwDQogWzxjMTM5Mjhk
OT5dID8gX19kZXZfZ2V0X2J5X25hbWUrMHg3MS8weDdlDQogWzxjMTQ0MWU4MT5dIHdleHRfaGFu
ZGxlX2lvY3RsKzB4ZjMvMHgxN2UNCiBbPGMxNDQwYjEwPl0gPyBjZmc4MDIxMV93ZXh0X3Npd21s
bWUrMHgwLzB4ODANCiBbPGMxMzk2NDEwPl0gZGV2X2lvY3RsKzB4NTc4LzB4NTk4DQogWzxjMTAw
OTFiOT5dID8gcmVzdG9yZV9pMzg3X2Z4c2F2ZSsweDU0LzB4NjYNCiBbPGMxMzg3YjQ0Pl0gc29j
a19pb2N0bCsweDFjZi8weDFkYg0KIFs8YzEwYjA5Nzk+XSB2ZnNfaW9jdGwrMHgyOC8weDkyDQog
WzxjMTM4Nzk3NT5dID8gc29ja19pb2N0bCsweDAvMHgxZGINCiBbPGMxMGIwZWQ2Pl0gZG9fdmZz
X2lvY3RsKzB4NDUzLzB4NDkxDQogWzxjMTM4ODIzMz5dID8gc3lzX3JlY3Ztc2crMHgyYy8weDQ3
DQogWzxjMTM4OTU0Mj5dID8gc3lzX3NvY2tldGNhbGwrMHgxNDcvMHgxOGMNCiBbPGMxMGIwZjQz
Pl0gc3lzX2lvY3RsKzB4MmYvMHg0OQ0KIFs8YzEwMDI3ZDA+XSBzeXNlbnRlcl9kb19jYWxsKzB4
MTIvMHgyNg0KDQo=
^ permalink raw reply
* Re: [PATCH] rt2x00: rt2800lib: update rfcsr & bbp init code for SoC devices
From: Gertjan van Wingerde @ 2010-04-28 8:12 UTC (permalink / raw)
To: Helmut Schaa; +Cc: John Linville, Ivo van Doorn, linux-wireless
In-Reply-To: <201004280958.59704.helmut.schaa@googlemail.com>
2010/4/28 Helmut Schaa <helmut.schaa@googlemail.com>:
> Update the rfcsr and bbp init code for SoC devices to match with the
> latest Ralink driver.
>
> To have better control over which values are used for the register
> initialization create a new function rt2800_is_305x_soc which checks
> for SoC interface type, the correct RT chipset and the correct RF
> chipset. This is based on the assumption that all rt305x SoC devices
> use a rt2872 and rf3020/rf3021/rf3022.
>
> In case an unknown RF chipset is found on a SoC device with a rt2872
> don't treat it as rt305x and just print a message.
>
> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Looks good to me.
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
> ---
>
> Gertjan, this approach should be pretty safe and if there really exists
> a rt305x board with a different rf chipset we'll get a log message.
>
> At the moment rt2800_is_305x_soc is only used in rt2800lib.c but maybe
> it's worth to move it to one of the headers?
Well, at the moment I don't see a use case beyond rt2800lib.c.
So, let's leave it where it is now, and we'll move it when the need to
move it to
a header file when the need arises.
>
> drivers/net/wireless/rt2x00/rt2800lib.c | 43 ++++++++++++++++++++++++------
> 1 files changed, 34 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index 50f4451..e7a61a3 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -76,6 +76,23 @@ MODULE_LICENSE("GPL");
> rt2800_regbusy_read((__dev), H2M_MAILBOX_CSR, \
> H2M_MAILBOX_CSR_OWNER, (__reg))
>
> +static inline bool rt2800_is_305x_soc(struct rt2x00_dev *rt2x00dev)
> +{
> + /* check for rt2872 on SoC */
> + if (!rt2x00_is_soc(rt2x00dev) ||
> + !rt2x00_rt(rt2x00dev, RT2872))
> + return false;
> +
> + /* we know for sure that these rf chipsets are used on rt305x boards */
> + if (rt2x00_rf(rt2x00dev, RF3020) ||
> + rt2x00_rf(rt2x00dev, RF3021) ||
> + rt2x00_rf(rt2x00dev, RF3022))
> + return true;
> +
> + NOTICE(rt2x00dev, "Unknown RF chipset on rt305x\n");
> + return false;
> +}
> +
> static void rt2800_bbp_write(struct rt2x00_dev *rt2x00dev,
> const unsigned int word, const u8 value)
> {
> @@ -1556,6 +1573,9 @@ int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
> rt2800_wait_bbp_ready(rt2x00dev)))
> return -EACCES;
>
> + if (rt2800_is_305x_soc(rt2x00dev))
> + rt2800_bbp_write(rt2x00dev, 31, 0x08);
> +
> rt2800_bbp_write(rt2x00dev, 65, 0x2c);
> rt2800_bbp_write(rt2x00dev, 66, 0x38);
>
> @@ -1576,6 +1596,9 @@ int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
> rt2800_bbp_write(rt2x00dev, 79, 0x13);
> rt2800_bbp_write(rt2x00dev, 80, 0x05);
> rt2800_bbp_write(rt2x00dev, 81, 0x33);
> + } else if (rt2800_is_305x_soc(rt2x00dev)) {
> + rt2800_bbp_write(rt2x00dev, 78, 0x0e);
> + rt2800_bbp_write(rt2x00dev, 80, 0x08);
> } else {
> rt2800_bbp_write(rt2x00dev, 81, 0x37);
> }
> @@ -1596,12 +1619,16 @@ int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
> if (rt2x00_rt_rev_gte(rt2x00dev, RT3070, REV_RT3070F) ||
> rt2x00_rt_rev_gte(rt2x00dev, RT3071, REV_RT3071E) ||
> rt2x00_rt_rev_gte(rt2x00dev, RT3090, REV_RT3090E) ||
> - rt2x00_rt_rev_gte(rt2x00dev, RT3390, REV_RT3390E))
> + rt2x00_rt_rev_gte(rt2x00dev, RT3390, REV_RT3390E) ||
> + rt2800_is_305x_soc(rt2x00dev))
> rt2800_bbp_write(rt2x00dev, 103, 0xc0);
> else
> rt2800_bbp_write(rt2x00dev, 103, 0x00);
>
> - rt2800_bbp_write(rt2x00dev, 105, 0x05);
> + if (rt2800_is_305x_soc(rt2x00dev))
> + rt2800_bbp_write(rt2x00dev, 105, 0x01);
> + else
> + rt2800_bbp_write(rt2x00dev, 105, 0x05);
> rt2800_bbp_write(rt2x00dev, 106, 0x35);
>
> if (rt2x00_rt(rt2x00dev, RT3071) ||
> @@ -1618,11 +1645,6 @@ int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
> rt2800_bbp_write(rt2x00dev, 138, value);
> }
>
> - if (rt2x00_rt(rt2x00dev, RT2872)) {
> - rt2800_bbp_write(rt2x00dev, 31, 0x08);
> - rt2800_bbp_write(rt2x00dev, 78, 0x0e);
> - rt2800_bbp_write(rt2x00dev, 80, 0x08);
> - }
>
> for (i = 0; i < EEPROM_BBP_SIZE; i++) {
> rt2x00_eeprom_read(rt2x00dev, EEPROM_BBP_START + i, &eeprom);
> @@ -1709,7 +1731,7 @@ int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
> !rt2x00_rt(rt2x00dev, RT3071) &&
> !rt2x00_rt(rt2x00dev, RT3090) &&
> !rt2x00_rt(rt2x00dev, RT3390) &&
> - !(rt2x00_is_soc(rt2x00dev) && rt2x00_rt(rt2x00dev, RT2872)))
> + !rt2800_is_305x_soc(rt2x00dev))
> return 0;
>
> /*
> @@ -1777,7 +1799,7 @@ int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
> rt2800_rfcsr_write(rt2x00dev, 29, 0x8f);
> rt2800_rfcsr_write(rt2x00dev, 30, 0x20);
> rt2800_rfcsr_write(rt2x00dev, 31, 0x0f);
> - } else if (rt2x00_rt(rt2x00dev, RT2872)) {
> + } else if (rt2800_is_305x_soc(rt2x00dev)) {
> rt2800_rfcsr_write(rt2x00dev, 0, 0x50);
> rt2800_rfcsr_write(rt2x00dev, 1, 0x01);
> rt2800_rfcsr_write(rt2x00dev, 2, 0xf7);
> @@ -1808,6 +1830,9 @@ int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
> rt2800_rfcsr_write(rt2x00dev, 27, 0x23);
> rt2800_rfcsr_write(rt2x00dev, 28, 0x13);
> rt2800_rfcsr_write(rt2x00dev, 29, 0x83);
> + rt2800_rfcsr_write(rt2x00dev, 30, 0x00);
> + rt2800_rfcsr_write(rt2x00dev, 31, 0x00);
> + return 0;
> }
>
> if (rt2x00_rt_rev_lt(rt2x00dev, RT3070, REV_RT3070F)) {
> --
> 1.6.4.2
>
>
^ permalink raw reply
* [patch] iwl: cleanup: remove unneeded error handling
From: Dan Carpenter @ 2010-04-28 9:01 UTC (permalink / raw)
To: Samuel Ortiz
Cc: Zhu Yi, Intel Linux Wireless, John W. Linville, Andrew Morton,
Alexey Dobriyan, linux-wireless, netdev, linux-kernel,
kernel-janitors
This is just a cleanup and doesn't change how the code works.
debugfs_create_dir() and debugfs_create_file() return an error pointer
(-ENODEV) if CONFIG_DEBUG_FS is not enabled, otherwise if an error occurs
they return NULL. This is how they are implemented and what it says in
the DebugFS documentation. DebugFS can not be compiled as a module.
As a result, we only need to check for error pointers and particularly
-ENODEV one time to know that DebugFS is enabled. This patch keeps the
first check for error pointers and removes the rest.
The other reason for this patch, is that it silences some Smatch warnings.
Smatch sees the condition "(result != -ENODEV)" and assumes that it's
possible for "result" to equal -ENODEV. If it were possible it would lead
to an error pointer dereference. But since it's not, we can just remove
the check.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/net/wireless/iwmc3200wifi/debugfs.c b/drivers/net/wireless/iwmc3200wifi/debugfs.c
index cbb81be..10eeeeb 100644
--- a/drivers/net/wireless/iwmc3200wifi/debugfs.c
+++ b/drivers/net/wireless/iwmc3200wifi/debugfs.c
@@ -438,40 +438,10 @@ int iwm_debugfs_init(struct iwm_priv *iwm)
snprintf(devdir, sizeof(devdir), "%s", wiphy_name(iwm_to_wiphy(iwm)));
iwm->dbg.devdir = debugfs_create_dir(devdir, iwm->dbg.rootdir);
- result = PTR_ERR(iwm->dbg.devdir);
- if (IS_ERR(iwm->dbg.devdir) && (result != -ENODEV)) {
- IWM_ERR(iwm, "Couldn't create devdir: %d\n", result);
- goto error;
- }
-
iwm->dbg.dbgdir = debugfs_create_dir("debug", iwm->dbg.devdir);
- result = PTR_ERR(iwm->dbg.dbgdir);
- if (IS_ERR(iwm->dbg.dbgdir) && (result != -ENODEV)) {
- IWM_ERR(iwm, "Couldn't create dbgdir: %d\n", result);
- goto error;
- }
-
iwm->dbg.rxdir = debugfs_create_dir("rx", iwm->dbg.devdir);
- result = PTR_ERR(iwm->dbg.rxdir);
- if (IS_ERR(iwm->dbg.rxdir) && (result != -ENODEV)) {
- IWM_ERR(iwm, "Couldn't create rx dir: %d\n", result);
- goto error;
- }
-
iwm->dbg.txdir = debugfs_create_dir("tx", iwm->dbg.devdir);
- result = PTR_ERR(iwm->dbg.txdir);
- if (IS_ERR(iwm->dbg.txdir) && (result != -ENODEV)) {
- IWM_ERR(iwm, "Couldn't create tx dir: %d\n", result);
- goto error;
- }
-
iwm->dbg.busdir = debugfs_create_dir("bus", iwm->dbg.devdir);
- result = PTR_ERR(iwm->dbg.busdir);
- if (IS_ERR(iwm->dbg.busdir) && (result != -ENODEV)) {
- IWM_ERR(iwm, "Couldn't create bus dir: %d\n", result);
- goto error;
- }
-
if (iwm->bus_ops->debugfs_init) {
result = iwm->bus_ops->debugfs_init(iwm, iwm->dbg.busdir);
if (result < 0) {
@@ -480,27 +450,15 @@ int iwm_debugfs_init(struct iwm_priv *iwm)
}
}
-
iwm->dbg.dbg_level = IWM_DL_NONE;
iwm->dbg.dbg_level_dentry =
debugfs_create_file("level", 0200, iwm->dbg.dbgdir, iwm,
&fops_iwm_dbg_level);
- result = PTR_ERR(iwm->dbg.dbg_level_dentry);
- if (IS_ERR(iwm->dbg.dbg_level_dentry) && (result != -ENODEV)) {
- IWM_ERR(iwm, "Couldn't create dbg_level: %d\n", result);
- goto error;
- }
-
iwm->dbg.dbg_modules = IWM_DM_DEFAULT;
iwm->dbg.dbg_modules_dentry =
debugfs_create_file("modules", 0200, iwm->dbg.dbgdir, iwm,
&fops_iwm_dbg_modules);
- result = PTR_ERR(iwm->dbg.dbg_modules_dentry);
- if (IS_ERR(iwm->dbg.dbg_modules_dentry) && (result != -ENODEV)) {
- IWM_ERR(iwm, "Couldn't create dbg_modules: %d\n", result);
- goto error;
- }
for (i = 0; i < __IWM_DM_NR; i++)
add_dbg_module(iwm->dbg, iwm_debug_module[i].name,
@@ -509,39 +467,18 @@ int iwm_debugfs_init(struct iwm_priv *iwm)
iwm->dbg.txq_dentry = debugfs_create_file("queues", 0200,
iwm->dbg.txdir, iwm,
&iwm_debugfs_txq_fops);
- result = PTR_ERR(iwm->dbg.txq_dentry);
- if (IS_ERR(iwm->dbg.txq_dentry) && (result != -ENODEV)) {
- IWM_ERR(iwm, "Couldn't create tx queue: %d\n", result);
- goto error;
- }
iwm->dbg.tx_credit_dentry = debugfs_create_file("credits", 0200,
iwm->dbg.txdir, iwm,
&iwm_debugfs_tx_credit_fops);
- result = PTR_ERR(iwm->dbg.tx_credit_dentry);
- if (IS_ERR(iwm->dbg.tx_credit_dentry) && (result != -ENODEV)) {
- IWM_ERR(iwm, "Couldn't create tx credit: %d\n", result);
- goto error;
- }
iwm->dbg.rx_ticket_dentry = debugfs_create_file("tickets", 0200,
iwm->dbg.rxdir, iwm,
&iwm_debugfs_rx_ticket_fops);
- result = PTR_ERR(iwm->dbg.rx_ticket_dentry);
- if (IS_ERR(iwm->dbg.rx_ticket_dentry) && (result != -ENODEV)) {
- IWM_ERR(iwm, "Couldn't create rx ticket: %d\n", result);
- goto error;
- }
iwm->dbg.fw_err_dentry = debugfs_create_file("last_fw_err", 0200,
iwm->dbg.dbgdir, iwm,
&iwm_debugfs_fw_err_fops);
- result = PTR_ERR(iwm->dbg.fw_err_dentry);
- if (IS_ERR(iwm->dbg.fw_err_dentry) && (result != -ENODEV)) {
- IWM_ERR(iwm, "Couldn't create last FW err: %d\n", result);
- goto error;
- }
-
return 0;
^ permalink raw reply related
* Re: [ath9k-devel] ath9k: noise floor calibration process
From: RHS Linux User @ 2010-04-28 9:24 UTC (permalink / raw)
To: Benoit PAPILLAULT; +Cc: ath9k-devel, linux-wireless@vger.kernel.org
In-Reply-To: <4BD7D005.5080301@free.fr>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=US-ASCII, Size: 8107 bytes --]
Hi Benoit,
Yes. Having a patent is nice and probably significant too.
However, if using a preamp with a low noise figure results in
more signals or stronger (more error free) signals, then it IS
better than the chip itself !!
It is VERY surprising that no chips I am aware of provide directly for
support of an external low noise preamp AND on a seperate coax a REAL
amplifier.
In the USA Amateur radio operators can use 1000 Watts (under certain
conditions) !!
Now two high powered, low noise Acess Points with a clear line of sight
would give some real range!
warm regards,
Wiz
On Wed, 28 Apr 2010, Benoit PAPILLAULT wrote:
> RHS Linux User a écrit :
> > Hi All,
> >
> > <preaching>
> >
> > The chip *FOR SURE* *CANNOT* measure the thermal noise level!! It isn't
> > that sensitive. That said under some conditions it CAN measure the
> > local interference level which IS useful.
> >
> In fact, that's what I thought first, but according to Atheros patent,
> it can. It seems pretty logic in fact : if you have no real signal at
> the input, you are measuring ambient noise. A spectrum analyzer is able
> to do it as well.
>
> Sensitivity is the ability to decode 802.11 modulation out of the signal
> received (which includes any kind of noise). Using the formulas below,
> I measure the minimum signal levels of 802.11 packets by moving away
> from an AP and I indeed found -95dBm which is the typical sensitivity
> levels of an Atheros chip.
> > I am *VERY MUCH* in favor of making real time level measurements of
> > various parts of real packets easy to use! Troubleshooting becomes so
> > much easier :).
> >
> > </preaching>
> >
> > Great ideas !!
> >
> > FWIW - I have on occasion used a low noise preamp to feed the chip.
> > Many more signals are detectable which "proves" the chip by itself *IS
> > NOT* that sensitive. Try it yourself !
> >
> Sure, in fact, I /think/ the thermal noise I'm talking is generated
> inside the first RX amplifier (it's probably generated in every RX
> amplifier, but the first is the biggest since it's amplified more than
> the others). So, if you put a low noise preamp, you are feeding the chip
> with more signal at the input but the chip has still the same amount of
> noise. Am I correct?
> > Have fun,
> >
> > Wiz
> >
> Regards,
> Benoit
> >
> > On Tue, 27 Apr 2010, Benoit PAPILLAULT wrote:
> >
> >
> >> Hello,
> >>
> >> In order to move forward with noise & signal reporting, I'd like to
> >> share my current understanding of the way ath9k HW is working before
> >> sending patches (unfortunately, I did the work before the introduction
> >> of ar9003... so I need to redo the work).
> >>
> >> The ultimate purpose of this work is to be able to measure signal levels
> >> (and noise if possible) as accurately as a spectrum analyzer or power meter.
> >>
> >> First, signal level reporting. It is reported in a per packet basis in
> >> RX descriptors. There are 7 fields:
> >> AR_RxRSSIAnt00 0x000000ff rs_rssi_ctl0
> >> AR_RxRSSIAnt01 0x0000ff00 rs_rssi_ctl1
> >> AR_RxRSSIAnt02 0x00ff0000 rs_rssi_ctl2
> >> AR_RxRSSIAnt10 0x000000ff rs_rssi_ext0
> >> AR_RxRSSIAnt11 0x0000ff00 rs_rssi_ext1
> >> AR_RxRSSIAnt12 0x00ff0000 rs_rssi_ext2
> >> AR_RxRSSICombined 0xff000000 rs_rssi
> >>
> >> Each value is for a 20 MHz wide channel, on the 3 RX chains. "ctl" is
> >> for the primary channel and "ext" is for the secondary channel (using
> >> the 802.11n words). The latter rs_rssi is the sum of the 6 previous
> >> value. However, since each value is dB, the sum is not an arithmetic
> >> sum. Each field is a signed value and the value -128 means that no
> >> measurement has been done (no RX chain, RX chain disabled, no secondary
> >> channel, ...). It seems that in some cases, the combined value is just
> >> plain wrong. Here are few examples:
> >>
> >> RSSI: ctl=(10,7,-128) ext=(-128,-128,-128) => 12 (11.76) correct
> >>
> >> RSSI: ctl=(38,29,-128) ext=(69,-84,-101) => -22 incorrect!!!
> >>
> >>
> >> Next, noise floor calibration. From what I understand, signal levels is
> >> measured using the AGC + RX amplifiers gain (RF, IF and BB). However,
> >> the various gains are not really accurate, only the relative gain are
> >> accurate. This means that reading a signal value of -100dBm might not
> >> exactly means -100dBm. There is a delta between real signal and measured
> >> value. In order to know this value, we need a calibration process with a
> >> known signal.
> >>
> >> One know signal is thermal noise. Thermal noise is generated in any
> >> resistor and can be computed using the well know value N = kTB. For a 20
> >> MHz bandwidth, this gives -101dBm. If the HW tries to measure signal
> >> strength when the network is supposed to be idle (during SIFS) and with
> >> RX/TX switch disabled (?), then it will in fact measure the thermal
> >> noise at the RX input.
> >>
> >> So, we have :
> >>
> >> Real noise (-101dBm) = Measured noise + delta
> >>
> >> There are type of registers to control noise floor calibration :
> >>
> >> - control register at 0x9860 (AR_PHY_AGC_CONTROL)
> >>
> >> This register allows 3 differents operations :
> >>
> >> 1. start noise floor measurement
> >>
> >> write AR_PHY_MAXCCA_PWR (AR_PHY_CCA & 0x000001ff) : this is apparently
> >> a max value
> >> for noise floor
> >> REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_ENABLE_NF);
> >> REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
> >> REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
> >>
> >> When channel has been changed however, the noise floor needs to be
> >> updated immediately, so AR_PHY_AGC_CONTROL_NO_UPDATE_NF should be
> >> cleared in this particular case. Otherwise, the chip is no longer
> >> receiving (problem since CCA is defined with noise floor as reference).
> >>
> >> 2. read noise floor measurement result
> >>
> >> check REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF
> >> if 0 (noise floor calibration is finished), read AR_PHY_MINCCA_PWR :
> >> nf = MS(REG_READ(ah, AR_PHY_CCA), AR_PHY_MINCCA_PWR = 0x0ff80000)
> >>
> >> 3. write noise floor reference
> >>
> >> write AR_PHY_MAXCCA_PWR (the value has not the same meaning as
> >> operation 1!)
> >> REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_ENABLE_NF);
> >> REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
> >> REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
> >>
> >> - data register at 0x9864 (AR_PHY_CCA, + more location for other RX chains)
> >>
> >> The fields are different for AR9280+ chipsets, but the mechanism is
> >> the same.
> >>
> >> AR_PHY_MAXCCA_PWR 0x000001ff (half dBm unit!)
> >> AR_PHY_CCA_THRESH62 0x0007f000
> >> AR_PHY_MINCCA_PWR 0x0ff80000
> >>
> >> Now, we have :
> >>
> >> Real signal = Measured signal + delta
> >> = RSSI + Noise floor + delta
> >> = RSSI + (-101 dBm)
> >>
> >> Real noise is not thermal noise. There are a lot of definition for noise
> >> since noise is NOT signal. Of course, noise includes thermal noise.
> >> Since the noise measured by the chip is variable, I think we could do :
> >>
> >> - Noise floor = minimum (Noise floor measures)
> >> - Noise = moving average (Noise floor measures) + delta
> >> with delta = (-101 dBm) - Noise floor
> >>
> >> I'd like to get comments before sending patches. Since ath5k and ath9k
> >> are quite close, I'm pretty sure a similar (if not same) process is used
> >> on ath5k.
> >>
> >> Regards,
> >> Benoit
> >>
> >> _______________________________________________
> >> ath9k-devel mailing list
> >> ath9k-devel@lists.ath9k.org
> >> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
> >>
> >>
> >
> > _______________________________________________
> > ath9k-devel mailing list
> > ath9k-devel@lists.ath9k.org
> > https://lists.ath9k.org/mailman/listinfo/ath9k-devel
> >
> >
>
^ permalink raw reply
* Re: [ath9k-devel] ath9k: noise floor calibration process
From: Holger Schurig @ 2010-04-28 12:53 UTC (permalink / raw)
To: RHS Linux User
Cc: Benoit PAPILLAULT, ath9k-devel, linux-wireless@vger.kernel.org
In-Reply-To: <Pine.LNX.3.95.1100428051914.9331G-100000@nei>
> In the USA Amateur radio operators can use 1000 Watts (under certain
> conditions) !!
Don't count on the 1000 W. Most countries have tight restrictions, only
allowing certain frequencies, bandwiths, max PEP, max ERP, max EIRP, max
electric field, max magnetic fields.
In Germany, with my license class, I can use up to 75W PEP in the frequency
range 2320-2450 MHz. So, way less than 1000W. But I don't care, I wouldn't
want to use 1000 W anyway. That's quite dangerous, e.g. if someone moves too
near to the transmitting antenna.
> It is VERY surprising that no chips I am aware of provide directly for
> support of an external low noise preamp AND on a seperate coax a REAL
> amplifier.
However, as licensed ham radio op, I'm allowed to build and use self-build
equipment. That means, I'm not restricted to use only certified devices, e.g.
I don't need some FCC or ZZF or whatever number on my equipment. So I'm
perfectly eligible to add some pre-amp. And guess what, for frequencies above
100 MHz it's quite common to use low-noise pre-amps. Many HAMs do this, and
also every satellite dish LNB does this.
I don't no chip "allowing" me this, I simply attach the pre-amp as near to the
antenna as possible. How would a chip be able to prevent that anyway ?!?
Any WLAN chip provides for a separate coax. Again, how would a chip prevent
against that? Only some hybrid chip with built-in antenne could possible
prevent me doing that. But maybe you don't mean chips, but devices? Most USB
dongles that I've seen won't provide a coax connector. But I have a bunch of
PC-Card wlan cards with some SMA (or similar) coax connectors. And for Mini-
PCI cards it's the common case to provide some coax socket.
> Now two high powered, low noise Acess Points with a clear line of sight
> would give some real range!
Clear line of sight is nice, clear fresnel zone would be better.
Actually, what you're talking already happens already. It's called HAMNET.
Some english language link that I found:
http://db0fhn.efi.fh-nuernberg.de/doku.php?id=projects:wlan:hamnet
Oh, and they use atheros hardware :-)
^ permalink raw reply
* Re: [rt2x00-users] [PATCH 6/9] rt2x00: Finish rt3070 support in rt2800 register initialization.
From: Helmut Schaa @ 2010-04-28 12:56 UTC (permalink / raw)
To: Antonio Quartulli; +Cc: Luis Correia, linux-wireless, users
In-Reply-To: <20100428124736.GA8637@ritirata.org>
Am Mittwoch 28 April 2010 schrieb Antonio Quartulli:
> On mar, apr 27, 2010 at 01:15:21 +0200, Antonio Quartulli wrote:
> > On lun, apr 26, 2010 at 01:11:20 +0200, Helmut Schaa wrote:
> > > Am Montag 26 April 2010 schrieb Helmut Schaa:
> > > > Am Sonntag 11 April 2010 schrieb Gertjan van Wingerde:
> > > > > rt2x00 had preliminary support for RT3070 based devices, but the support was
> > > > > incomplete.
> > > > > Update the RT3070 register initialization to be similar to the latest Ralink
> > > > > vendor driver.
> > > > >
> > > > > With this patch my rt3070 based devices start showing a sign of life.
> > > >
> > > > Gertjan, this patch breaks rx on my 305x SoC device. See inline comments for
> > > > more details.
> > >
> > > Antonio, did that patch also break rx on your PCI device with rt2872?
> > > If not this is only needed for SoC.
> > Hi, I cloned the wireless-testing git a few minutes ago.
> > My card (rt2x00_set_chip: Info - Chipset detected - rt: 2872, rf: 0003,
> > rev: 0200) on miniPCI works correctly without any kind of problem.
> > No hangs at all.
>
> Hi all, I found out that after this commit:
>
> commit 23812383c6b03afef44c4aa642500f8235c3d079
> Author: Helmut Schaa <helmut.schaa@googlemail.com>
> Date: Mon Apr 26 13:48:45 2010 +0200
>
> rt2x00: rt2800lib: Fix rx path on SoC devices
>
> my card becomes unstable, I mean that the connection lose packets and
> sometimes it disassociates from the AP.
> I also found that the singnal level reported by iwconfig is wrong (it
> reports -191dBm)
Uhhh, are you 100% sure? The patch doesn't touch any PCI code at all.
Maybe the card was unstable before already? Could you please verify again?
Thanks you very much for your testing, it's really appreciated.
Helmut
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox