Send users mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://rt2x00.serialmonkey.com/mailman/listinfo/users_rt2x00.serialmonkey.com
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of users digest..."
Today's Topics:
1. [PATCH 5/7] rt2800: pass channel pointer to
rt2800_config_txpower (Stanislaw Gruszka)
2. [PATCH 6/7] rt2800: allow to reduce tx power on devices not
exporting power limit (Stanislaw Gruszka)
3. [PATCH 7/7] rt2800: comment tx power settings (Stanislaw Gruszka)
4. Re: [PATCH] rt2x00pci: Use PCI MSIs whenever possible
(Stanislaw Gruszka)
5. Re: [PATCH 1/7] rt2800: use BBP_R1 for setting tx power
(Andreas Hartmann)
----------------------------------------------------------------------
Message: 1
Date: Fri, 5 Oct 2012 13:44:13 +0200
From: Stanislaw Gruszka <[email protected]>
To: "John W. Linville" <[email protected]>
Cc: [email protected], [email protected]
Subject: [rt2x00-users] [PATCH 5/7] rt2800: pass channel pointer to
rt2800_config_txpower
Message-ID: <[email protected]>
Preparation for use regulatory max channel power in TX power delta
calculations.
Signed-off-by: Stanislaw Gruszka <[email protected]>
Acked-by: Gertjan van Wingerde <[email protected]>
Acked-by: Ivo van Doorn <[email protected]>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c
b/drivers/net/wireless/rt2x00/rt2800lib.c
index e0e641d..9c2c647 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2566,13 +2566,14 @@ static u8 rt2800_compensate_txpower(struct rt2x00_dev
*rt2x00dev, int is_rate_b,
}
static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev,
- enum ieee80211_band band,
+ struct ieee80211_channel *chan,
int power_level)
{
u8 txpower, r1;
u16 eeprom;
u32 reg, offset;
int i, is_rate_b, delta, power_ctrl;
+ enum ieee80211_band band = chan->band;
/*
* Calculate HT40 compensation delta
@@ -2720,7 +2721,7 @@ static void rt2800_config_txpower(struct rt2x00_dev
*rt2x00dev,
void rt2800_gain_calibration(struct rt2x00_dev *rt2x00dev)
{
- rt2800_config_txpower(rt2x00dev, rt2x00dev->curr_band,
+ rt2800_config_txpower(rt2x00dev, rt2x00dev->hw->conf.channel,
rt2x00dev->tx_power);
}
EXPORT_SYMBOL_GPL(rt2800_gain_calibration);
@@ -2855,11 +2856,11 @@ void rt2800_config(struct rt2x00_dev *rt2x00dev,
if (flags & IEEE80211_CONF_CHANGE_CHANNEL) {
rt2800_config_channel(rt2x00dev, libconf->conf,
&libconf->rf, &libconf->channel);
- rt2800_config_txpower(rt2x00dev, libconf->conf->channel->band,
+ rt2800_config_txpower(rt2x00dev, libconf->conf->channel,
libconf->conf->power_level);
}
if (flags & IEEE80211_CONF_CHANGE_POWER)
- rt2800_config_txpower(rt2x00dev, libconf->conf->channel->band,
+ rt2800_config_txpower(rt2x00dev, libconf->conf->channel,
libconf->conf->power_level);
if (flags & IEEE80211_CONF_CHANGE_RETRY_LIMITS)
rt2800_config_retry_limit(rt2x00dev, libconf);
--
1.7.1
------------------------------
Message: 2
Date: Fri, 5 Oct 2012 13:44:14 +0200
From: Stanislaw Gruszka <[email protected]>
To: "John W. Linville" <[email protected]>
Cc: [email protected], [email protected]
Subject: [rt2x00-users] [PATCH 6/7] rt2800: allow to reduce tx power
on devices not exporting power limit
Message-ID: <[email protected]>
Some rt2800 devices don't have their calibrated max eirp tx power in
their calibration data. For those devices reduce tx power according to
difference between regulatory max channel power and requested tx power.
This patch is based on Helmut Schaa work.
Signed-off-by: Stanislaw Gruszka <[email protected]>
Acked-by: Gertjan van Wingerde <[email protected]>
Acked-by: Ivo van Doorn <[email protected]>
Acked-by: Helmut Schaa <[email protected]>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c
b/drivers/net/wireless/rt2x00/rt2800lib.c
index 9c2c647..3f62204 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2520,6 +2520,27 @@ static int rt2800_get_txpower_bw_comp(struct rt2x00_dev
*rt2x00dev,
return comp_value;
}
+static int rt2800_get_txpower_reg_delta(struct rt2x00_dev *rt2x00dev,
+ int power_level, int max_power)
+{
+ int delta;
+
+ if (test_bit(CAPABILITY_POWER_LIMIT, &rt2x00dev->cap_flags))
+ return 0;
+
+ /*
+ * XXX: We don't know the maximum transmit power of our hardware since
+ * the EEPROM doesn't expose it. We only know that we are calibrated
+ * to 100% tx power.
+ *
+ * Hence, we assume the regulatory limit that cfg80211 calulated for
+ * the current channel is our maximum and if we are requested to lower
+ * the value we just reduce our tx power accordingly.
+ */
+ delta = power_level - max_power;
+ return min(delta, 0);
+}
+
static u8 rt2800_compensate_txpower(struct rt2x00_dev *rt2x00dev, int
is_rate_b,
enum ieee80211_band band, int power_level,
u8 txpower, int delta)
@@ -2586,6 +2607,12 @@ static void rt2800_config_txpower(struct rt2x00_dev
*rt2x00dev,
delta += rt2800_get_gain_calibration_delta(rt2x00dev);
/*
+ * Apply regulatory delta.
+ */
+ delta += rt2800_get_txpower_reg_delta(rt2x00dev, power_level,
+ chan->max_power);
+
+ /*
* BBP_R1 controls TX power for all rates, it allow to set the following
* gains -12, -6, 0, +6 dBm by setting values 2, 1, 0, 3 respectively.
*
--
1.7.1
------------------------------
Message: 3
Date: Fri, 5 Oct 2012 13:44:15 +0200
From: Stanislaw Gruszka <[email protected]>
To: "John W. Linville" <[email protected]>
Cc: [email protected], [email protected]
Subject: [rt2x00-users] [PATCH 7/7] rt2800: comment tx power settings
Message-ID: <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Acked-by: Gertjan van Wingerde <[email protected]>
Acked-by: Ivo van Doorn <[email protected]>
Acked-by: Helmut Schaa <[email protected]>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c
b/drivers/net/wireless/rt2x00/rt2800lib.c
index 3f62204..1cf7b94 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2586,6 +2586,15 @@ static u8 rt2800_compensate_txpower(struct rt2x00_dev
*rt2x00dev, int is_rate_b,
return min_t(u8, txpower, 0xc);
}
+/*
+ * We configure transmit power using MAC TX_PWR_CFG_{0,...,N} registers and
+ * BBP R1 register. TX_PWR_CFG_X allow to configure per rate TX power values,
+ * 4 bits for each rate (tune from 0 to 15 dBm). BBP_R1 controls transmit power
+ * for all rates, but allow to set only 4 discrete values: -12, -6, 0 and 6
dBm.
+ * Reference per rate transmit power values are located in the EEPROM at
+ * EEPROM_TXPOWER_BYRATE offset. We adjust them and BBP R1 settings according
to
+ * current conditions (i.e. band, bandwidth, temperature, user settings).
+ */
static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev,
struct ieee80211_channel *chan,
int power_level)
@@ -2597,17 +2606,24 @@ static void rt2800_config_txpower(struct rt2x00_dev
*rt2x00dev,
enum ieee80211_band band = chan->band;
/*
- * Calculate HT40 compensation delta
+ * Calculate HT40 compensation. For 40MHz we need to add or subtract
+ * value read from EEPROM (different for 2GHz and for 5GHz).
*/
delta = rt2800_get_txpower_bw_comp(rt2x00dev, band);
/*
- * calculate temperature compensation delta
+ * Calculate temperature compensation. Depends on measurement of current
+ * TSSI (Transmitter Signal Strength Indication) we know TX power (due
+ * to temperature or maybe other factors) is smaller or bigger than
+ * expected. We adjust it, based on TSSI reference and boundaries values
+ * provided in EEPROM.
*/
delta += rt2800_get_gain_calibration_delta(rt2x00dev);
/*
- * Apply regulatory delta.
+ * Decrease power according to user settings, on devices with unknown
+ * maximum tx power. For other devices we take user power_level into
+ * consideration on rt2800_compensate_txpower().
*/
delta += rt2800_get_txpower_reg_delta(rt2x00dev, power_level,
chan->max_power);
--
1.7.1
------------------------------
Message: 4
Date: Fri, 5 Oct 2012 16:46:32 +0200
From: Stanislaw Gruszka <[email protected]>
To: Jakub Kicinski <[email protected]>
Cc: [email protected]
Subject: Re: [rt2x00-users] [PATCH] rt2x00pci: Use PCI MSIs whenever
possible
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
On Wed, Oct 03, 2012 at 09:32:38PM +0200, Jakub Kicinski wrote:
> All PCIe devices must support MSIs, make use of them.
Looks ok. The bigest problem here are malfunctioning pcie
host devices, but users of such machines probably enable
"nomsi" option already to make other devices work.
ACK
Thanks
Stanislaw
------------------------------
Message: 5
Date: Fri, 05 Oct 2012 18:27:02 +0200
From: Andreas Hartmann <[email protected]>
To: Stanislaw Gruszka <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: [rt2x00-users] [PATCH 1/7] rt2800: use BBP_R1 for setting
tx power
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Hello Stanislaw!
I would like to test this patchset. Whereon should I pay (most)
attention? What do you expect to be changed (or not) behaviour with 2.4
GHz / 40 MHz?
Thanks,
kind regards,
Andreas
Stanislaw Gruszka wrote:
> TX power delta can be negative. TX_PWR_CFG_ registers allow to set delta
> only in range between 0 dBm and 15 dBm (4 bits for each rate). Se we
> need to use BBP_R1 to configure negative deltas.
[...]
------------------------------
_______________________________________________
users mailing list
[email protected]
http://rt2x00.serialmonkey.com/mailman/listinfo/users_rt2x00.serialmonkey.com
End of users Digest, Vol 44, Issue 5
************************************