* [PATCH v3 0/3] rt2x00: rt2800: prepare for three-chain device support
From: Gabor Juhos @ 2013-06-24 21:03 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, users, Gabor Juhos
Gabor Juhos (3):
rt2x00: rt2800: increase EEPROM_SIZE to 512 bytes
rt2x00: rt2800lib: turn on secondary PAs/LNAs for 3T/3R devices
rt2x00: rt2800lib: turn on tertiary PAs/LNAs for 3T/3R devices
drivers/net/wireless/rt2x00/rt2800.h | 2 +-
drivers/net/wireless/rt2x00/rt2800lib.c | 47 +++++++++++++++++++++++--------
2 files changed, 36 insertions(+), 13 deletions(-)
--
1.7.10
^ permalink raw reply
* [PATCH v3 1/3] rt2x00: rt2800: increase EEPROM_SIZE to 512 bytes
From: Gabor Juhos @ 2013-06-24 21:03 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1372107804-19679-1-git-send-email-juhosg@openwrt.org>
Ralink 3T chipsets are using a different EEPROM
layout than the others. The EEPROM on these devices
contain more data than the others which does not fit
into 272 byte which the rt2800 driver actually uses.
The Ralink reference driver defines EEPROM_SIZE to
512/1024 bytes for PCI/USB devices respectively.
Increase the EEPROM_SIZE constant to 512 bytes, in
order to make room for EEPROM data of 3T devices.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
Changes in v3: ---
Changes in v2: add Acked-by tags
---
drivers/net/wireless/rt2x00/rt2800.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index fe43d01..d78c495 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -100,7 +100,7 @@
#define CSR_REG_BASE 0x1000
#define CSR_REG_SIZE 0x0800
#define EEPROM_BASE 0x0000
-#define EEPROM_SIZE 0x0110
+#define EEPROM_SIZE 0x0200
#define BBP_BASE 0x0000
#define BBP_SIZE 0x00ff
#define RF_BASE 0x0004
--
1.7.10
^ permalink raw reply related
* [PATCH v3 2/3] rt2x00: rt2800lib: turn on secondary PAs/LNAs for 3T/3R devices
From: Gabor Juhos @ 2013-06-24 21:03 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1372107804-19679-1-git-send-email-juhosg@openwrt.org>
The secondary PAs/LNAs are turned on only for 2T/2R
devices, however these are used for 3T/3R devices as
well. Always turn those on if the device uses more
than one tx/rx chains.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
Changes in v3: ---
Changes in v2:
- fix a typo
- add Acked-by tags
---
drivers/net/wireless/rt2x00/rt2800lib.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 4072242..b7119e3 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2678,16 +2678,16 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
tx_pin = 0;
- /* Turn on unused PA or LNA when not using 1T or 1R */
- if (rt2x00dev->default_ant.tx_chain_num == 2) {
+ if (rt2x00dev->default_ant.tx_chain_num > 1) {
+ /* Turn on secondary PAs for 2T and for 3T devices*/
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN,
rf->channel > 14);
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN,
rf->channel <= 14);
}
- /* Turn on unused PA or LNA when not using 1T or 1R */
- if (rt2x00dev->default_ant.rx_chain_num == 2) {
+ if (rt2x00dev->default_ant.rx_chain_num > 1) {
+ /* Turn on secondary LNAs for 2R and for 3R devices */
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1);
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1);
}
--
1.7.10
^ permalink raw reply related
* Re: [PATCH v2 3/3] rt2x00: rt2800lib: turn on tertiary PAs/LNAs for 3T/3R devices
From: Gabor Juhos @ 2013-06-24 20:46 UTC (permalink / raw)
To: Gertjan van Wingerde
Cc: John Linville, linux-wireless@vger.kernel.org,
users@rt2x00.serialmonkey.com
In-Reply-To: <EF51C8D4-466A-49C3-9D8B-05548F7EB806@gmail.com>
2013.06.24. 22:40 keltezéssel, Gertjan van Wingerde írta:
> Hi Gabor,
>
> Sent from my iPad
>
> On 24 jun. 2013, at 22:32, Gabor Juhos <juhosg@openwrt.org> wrote:
>
>> The 3T/3R devices are using the tertiary PAs/LNAs
>> however those are never turned on. Fix the code to
>> turn on those on for such devices.
>>
>> Also modify the code to use switch statements to
>> improve readability.
>>
>> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
>
> Just one more thing. See below.
>
>> ---
>> Changes in v2:
>> - use a switch statement to improve readability as suggested
>> by Gertjan
>> - add detailed commit description
>> ---
>> drivers/net/wireless/rt2x00/rt2800lib.c | 44 +++++++++++++++++++++++--------
>> 1 file changed, 33 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
>> index b7119e3..25f4727 100644
>> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
>> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
>> @@ -2678,29 +2678,51 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
>>
>> tx_pin = 0;
>>
>> - if (rt2x00dev->default_ant.tx_chain_num > 1) {
>> - /* Turn on secondary PAs for 2T and for 3T devices*/
>> + switch (rt2x00dev->default_ant.tx_chain_num) {
>> + case 3:
>> + /* Turn on tertiary PAs */
>> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A2_EN,
>> + rf->channel > 14);
>> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G2_EN,
>> + rf->channel <= 14);
>> + /* fall-through */
>> + case 2:
>> + /* Turn on secondary PAs */
>> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN,
>> rf->channel > 14);
>> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN,
>> rf->channel <= 14);
>> + /* fall-through */
>> + case 1:
>> + /* Turn on primary PAs */
>> + if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags))
>> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, 1);
>> + else
>> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN,
>> + rf->channel <= 14);
>> + break;
>> }
>>
>> - if (rt2x00dev->default_ant.rx_chain_num > 1) {
>> - /* Turn on secondary LNAs for 2R and for 3R devices */
>> + switch (rt2x00dev->default_ant.rx_chain_num) {
>> + case 3:
>> + /* Turn on tertiary LNAs */
>> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A2_EN, 1);
>> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G2_EN, 1);
>> + /* fall-through */
>> + case 2:
>> + /* Turn on secondary LNAs */
>> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1);
>> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1);
>> + /* fall-through */
>> + case 1:
>> + /* Turn on primary LNAs */
>> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1);
>> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN, 1);
>> + break;
>> }
>>
>> - rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1);
>> - rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN, 1);
>> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1);
>> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1);
>> - if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags))
>> - rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, 1);
>> - else
>> - rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN,
>> - rf->channel <= 14);
>> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A0_EN, rf->channel > 14);
>
> I guess you forgot to move this setting of the primary PA of the 5GHz band inside the switch?
Hm, you are right. Even though it does not change the behaviour, but it should
be moved as well. Will send yet another version.
-Gabor
^ permalink raw reply
* Re: [PATCH v2 3/3] rt2x00: rt2800lib: turn on tertiary PAs/LNAs for 3T/3R devices
From: Gertjan van Wingerde @ 2013-06-24 20:40 UTC (permalink / raw)
To: Gabor Juhos
Cc: John Linville, linux-wireless@vger.kernel.org,
users@rt2x00.serialmonkey.com, Gabor Juhos
In-Reply-To: <1372105972-3022-4-git-send-email-juhosg@openwrt.org>
Hi Gabor,
Sent from my iPad
On 24 jun. 2013, at 22:32, Gabor Juhos <juhosg@openwrt.org> wrote:
> The 3T/3R devices are using the tertiary PAs/LNAs
> however those are never turned on. Fix the code to
> turn on those on for such devices.
>
> Also modify the code to use switch statements to
> improve readability.
>
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Just one more thing. See below.
> ---
> Changes in v2:
> - use a switch statement to improve readability as suggested
> by Gertjan
> - add detailed commit description
> ---
> drivers/net/wireless/rt2x00/rt2800lib.c | 44 +++++++++++++++++++++++--------
> 1 file changed, 33 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index b7119e3..25f4727 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -2678,29 +2678,51 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
>
> tx_pin = 0;
>
> - if (rt2x00dev->default_ant.tx_chain_num > 1) {
> - /* Turn on secondary PAs for 2T and for 3T devices*/
> + switch (rt2x00dev->default_ant.tx_chain_num) {
> + case 3:
> + /* Turn on tertiary PAs */
> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A2_EN,
> + rf->channel > 14);
> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G2_EN,
> + rf->channel <= 14);
> + /* fall-through */
> + case 2:
> + /* Turn on secondary PAs */
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN,
> rf->channel > 14);
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN,
> rf->channel <= 14);
> + /* fall-through */
> + case 1:
> + /* Turn on primary PAs */
> + if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags))
> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, 1);
> + else
> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN,
> + rf->channel <= 14);
> + break;
> }
>
> - if (rt2x00dev->default_ant.rx_chain_num > 1) {
> - /* Turn on secondary LNAs for 2R and for 3R devices */
> + switch (rt2x00dev->default_ant.rx_chain_num) {
> + case 3:
> + /* Turn on tertiary LNAs */
> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A2_EN, 1);
> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G2_EN, 1);
> + /* fall-through */
> + case 2:
> + /* Turn on secondary LNAs */
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1);
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1);
> + /* fall-through */
> + case 1:
> + /* Turn on primary LNAs */
> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1);
> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN, 1);
> + break;
> }
>
> - rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1);
> - rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN, 1);
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1);
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1);
> - if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags))
> - rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, 1);
> - else
> - rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN,
> - rf->channel <= 14);
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A0_EN, rf->channel > 14);
I guess you forgot to move this setting of the primary PA of the 5GHz band inside the switch?
>
> rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin);
> --
> 1.7.10
>
> --
> 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
* [PATCH v2 3/3] rt2x00: rt2800lib: turn on tertiary PAs/LNAs for 3T/3R devices
From: Gabor Juhos @ 2013-06-24 20:32 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1372105972-3022-1-git-send-email-juhosg@openwrt.org>
The 3T/3R devices are using the tertiary PAs/LNAs
however those are never turned on. Fix the code to
turn on those on for such devices.
Also modify the code to use switch statements to
improve readability.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
Changes in v2:
- use a switch statement to improve readability as suggested
by Gertjan
- add detailed commit description
---
drivers/net/wireless/rt2x00/rt2800lib.c | 44 +++++++++++++++++++++++--------
1 file changed, 33 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index b7119e3..25f4727 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2678,29 +2678,51 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
tx_pin = 0;
- if (rt2x00dev->default_ant.tx_chain_num > 1) {
- /* Turn on secondary PAs for 2T and for 3T devices*/
+ switch (rt2x00dev->default_ant.tx_chain_num) {
+ case 3:
+ /* Turn on tertiary PAs */
+ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A2_EN,
+ rf->channel > 14);
+ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G2_EN,
+ rf->channel <= 14);
+ /* fall-through */
+ case 2:
+ /* Turn on secondary PAs */
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN,
rf->channel > 14);
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN,
rf->channel <= 14);
+ /* fall-through */
+ case 1:
+ /* Turn on primary PAs */
+ if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags))
+ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, 1);
+ else
+ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN,
+ rf->channel <= 14);
+ break;
}
- if (rt2x00dev->default_ant.rx_chain_num > 1) {
- /* Turn on secondary LNAs for 2R and for 3R devices */
+ switch (rt2x00dev->default_ant.rx_chain_num) {
+ case 3:
+ /* Turn on tertiary LNAs */
+ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A2_EN, 1);
+ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G2_EN, 1);
+ /* fall-through */
+ case 2:
+ /* Turn on secondary LNAs */
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1);
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1);
+ /* fall-through */
+ case 1:
+ /* Turn on primary LNAs */
+ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1);
+ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN, 1);
+ break;
}
- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1);
- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN, 1);
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1);
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1);
- if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags))
- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, 1);
- else
- rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN,
- rf->channel <= 14);
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A0_EN, rf->channel > 14);
rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin);
--
1.7.10
^ permalink raw reply related
* [PATCH v2 2/3] rt2x00: rt2800lib: turn on secondary PAs/LNAs for 3T/3R devices
From: Gabor Juhos @ 2013-06-24 20:32 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1372105972-3022-1-git-send-email-juhosg@openwrt.org>
The secondary PAs/LNAs are turned on only for 2T/2R
devices, however these are used for 3T/3R devices as
well. Always turn those on if the device uses more
than one tx/rx chains.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
Changes in v2:
- fix a typo
- add Acked-by tags
---
drivers/net/wireless/rt2x00/rt2800lib.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 4072242..b7119e3 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2678,16 +2678,16 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
tx_pin = 0;
- /* Turn on unused PA or LNA when not using 1T or 1R */
- if (rt2x00dev->default_ant.tx_chain_num == 2) {
+ if (rt2x00dev->default_ant.tx_chain_num > 1) {
+ /* Turn on secondary PAs for 2T and for 3T devices*/
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN,
rf->channel > 14);
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN,
rf->channel <= 14);
}
- /* Turn on unused PA or LNA when not using 1T or 1R */
- if (rt2x00dev->default_ant.rx_chain_num == 2) {
+ if (rt2x00dev->default_ant.rx_chain_num > 1) {
+ /* Turn on secondary LNAs for 2R and for 3R devices */
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1);
rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1);
}
--
1.7.10
^ permalink raw reply related
* [PATCH v2 0/3] rt2x00: rt2800: prepare for three-chain device support
From: Gabor Juhos @ 2013-06-24 20:32 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, users, Gabor Juhos
Gabor Juhos (3):
rt2x00: rt2800: increase EEPROM_SIZE to 512 bytes
rt2x00: rt2800lib: turn on secondary PAs/LNAs for 3T/3R devices
rt2x00: rt2800lib: turn on tertiary PAs/LNAs for 3T/3R devices
drivers/net/wireless/rt2x00/rt2800.h | 2 +-
drivers/net/wireless/rt2x00/rt2800lib.c | 44 +++++++++++++++++++++++--------
2 files changed, 34 insertions(+), 12 deletions(-)
--
1.7.10
^ permalink raw reply
* [PATCH v2 1/3] rt2x00: rt2800: increase EEPROM_SIZE to 512 bytes
From: Gabor Juhos @ 2013-06-24 20:32 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1372105972-3022-1-git-send-email-juhosg@openwrt.org>
Ralink 3T chipsets are using a different EEPROM
layout than the others. The EEPROM on these devices
contain more data than the others which does not fit
into 272 byte which the rt2800 driver actually uses.
The Ralink reference driver defines EEPROM_SIZE to
512/1024 bytes for PCI/USB devices respectively.
Increase the EEPROM_SIZE constant to 512 bytes, in
order to make room for EEPROM data of 3T devices.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
Changes in v2: add Acked-by tags
---
drivers/net/wireless/rt2x00/rt2800.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index fe43d01..d78c495 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -100,7 +100,7 @@
#define CSR_REG_BASE 0x1000
#define CSR_REG_SIZE 0x0800
#define EEPROM_BASE 0x0000
-#define EEPROM_SIZE 0x0110
+#define EEPROM_SIZE 0x0200
#define BBP_BASE 0x0000
#define BBP_SIZE 0x00ff
#define RF_BASE 0x0004
--
1.7.10
^ permalink raw reply related
* Re: [Ilw] 3.10git: iwlwifi 0000:03:00.0: Request scan called when driver not ready.
From: Arkadiusz Miskiewicz @ 2013-06-24 20:13 UTC (permalink / raw)
To: Grumbach, Emmanuel
Cc: Berg, Johannes, Intel Linux Wireless,
linux-wireless@vger.kernel.org
In-Reply-To: <0BA3FCBA62E2DC44AF3030971E174FB3019F3492@HASMSX103.ger.corp.intel.com>
On Monday 24 of June 2013, Grumbach, Emmanuel wrote:
> > Hi.
> >
> > [46804.179700] dmar: DRHD: handling fault status reg 3
> > [46804.179707] dmar: DMAR:[DMA Read] Request device [03:00.0] fault addr
> > ffed4000
>
> Fun. So you have an old device with a machine that has IOMMU. Ok...
>
> > DMAR:[fault reason 06] PTE Read access is not set
> > [46804.220818] iwlwifi 0000:03:00.0: Hardware error detected.
> > Restarting. [46804.220877] iwlwifi 0000:03:00.0: RF is used by WiMAX
>
> Did you really use WiMAX here?
No, that kernel doesn't even have wimax support compiled in.
# CONFIG_WIMAX is not set
( disabled wimax sometime ago in my kernel builds... maybe this is
coincidence)
>
> > [46807.828033] iwlwifi 0000:03:00.0: fail to flush all tx fifo queues Q 0
> > [46807.828039] iwlwifi 0000:03:00.0: Current SW read_ptr 138 write_ptr
> > 139
>
> Here, the HW is dead.
>
> > [46807.828230] iwl data: 00000000: a2 a5 a5 a5 a2 a5 a5 a5 a2 a5 a5 a5 a2
> > a5 a5 a5 ................
--
Arkadiusz Miśkiewicz, arekm / maven.pl
^ permalink raw reply
* RE: [Ilw] 3.10git: iwlwifi 0000:03:00.0: Request scan called when driver not ready.
From: Grumbach, Emmanuel @ 2013-06-24 19:56 UTC (permalink / raw)
To: Arkadiusz Miskiewicz, Berg, Johannes, Intel Linux Wireless,
linux-wireless@vger.kernel.org
In-Reply-To: <201306232021.06721.a.miskiewicz@gmail.com>
PiANCj4gSGkuDQo+IA0KPiBbNDY4MDQuMTc5NzAwXSBkbWFyOiBEUkhEOiBoYW5kbGluZyBmYXVs
dCBzdGF0dXMgcmVnIDMNCj4gWzQ2ODA0LjE3OTcwN10gZG1hcjogRE1BUjpbRE1BIFJlYWRdIFJl
cXVlc3QgZGV2aWNlIFswMzowMC4wXSBmYXVsdCBhZGRyDQo+IGZmZWQ0MDAwDQoNCkZ1bi4gU28g
eW91IGhhdmUgYW4gb2xkIGRldmljZSB3aXRoIGEgbWFjaGluZSB0aGF0IGhhcyBJT01NVS4gT2su
Li4NCg0KPiBETUFSOltmYXVsdCByZWFzb24gMDZdIFBURSBSZWFkIGFjY2VzcyBpcyBub3Qgc2V0
DQo+IFs0NjgwNC4yMjA4MThdIGl3bHdpZmkgMDAwMDowMzowMC4wOiBIYXJkd2FyZSBlcnJvciBk
ZXRlY3RlZC4gIFJlc3RhcnRpbmcuDQo+IFs0NjgwNC4yMjA4NzddIGl3bHdpZmkgMDAwMDowMzow
MC4wOiBSRiBpcyB1c2VkIGJ5IFdpTUFYDQoNCkRpZCB5b3UgcmVhbGx5IHVzZSBXaU1BWCBoZXJl
Pw0KDQo+IFs0NjgwNy44MjgwMzNdIGl3bHdpZmkgMDAwMDowMzowMC4wOiBmYWlsIHRvIGZsdXNo
IGFsbCB0eCBmaWZvIHF1ZXVlcyBRIDANCj4gWzQ2ODA3LjgyODAzOV0gaXdsd2lmaSAwMDAwOjAz
OjAwLjA6IEN1cnJlbnQgU1cgcmVhZF9wdHIgMTM4IHdyaXRlX3B0ciAxMzkNCg0KSGVyZSwgdGhl
IEhXIGlzIGRlYWQuDQoNCj4gWzQ2ODA3LjgyODIzMF0gaXdsIGRhdGE6IDAwMDAwMDAwOiBhMiBh
NSBhNSBhNSBhMiBhNSBhNSBhNSBhMiBhNSBhNSBhNSBhMiBhNQ0KPiBhNSBhNSAgLi4uLi4uLi4u
Li4uLi4uLg0KDQo=
^ permalink raw reply
* Re: [PATCH 3/3] rt2x00: rt2800lib: turn on tertiary PAs/LNAs for 3T/3R devices
From: Gabor Juhos @ 2013-06-24 19:17 UTC (permalink / raw)
To: Gertjan van Wingerde
Cc: John Linville, linux-wireless@vger.kernel.org,
users@rt2x00.serialmonkey.com
In-Reply-To: <3B42FB1E-C6CE-4580-9C71-47BB609B4CB8@gmail.com>
Hi Gertjan,
> Sent from my iPad
>
> On 22 jun. 2013, at 17:42, Gabor Juhos <juhosg@openwrt.org> wrote:
>
>> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
>> ---
>> drivers/net/wireless/rt2x00/rt2800lib.c | 14 ++++++++++++++
>> 1 file changed, 14 insertions(+)
>>
>> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
>> index f4cd3d8..664e9e1 100644
>> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
>> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
>> @@ -2684,12 +2684,26 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
>> rf->channel > 14);
>> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN,
>> rf->channel <= 14);
>> +
>> + if (rt2x00dev->default_ant.tx_chain_num > 2) {
>> + /* Turn on tertiary PAs for 3T devices */
>> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A2_EN,
>> + rf->channel > 14);
>> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G2_EN,
>> + rf->channel <= 14);
>> + }
>> }
>>
>> if (rt2x00dev->default_ant.rx_chain_num > 1) {
>> /* Turn on secondary LNAs for 2R and for 3R devices */
>> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1);
>> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1);
>> +
>> + if (rt2x00dev->default_ant.rx_chain_num > 2) {
>> + /* Turn on tertiary LNAs for 3R devices */
>> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A2_EN, 1);
>> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G2_EN, 1);
>> + }
>> }
>
> Stylistic I would prefer the if outside of if block you included it in.
> Something like:
>
> if (tx_chain_num > 2) {
> /* Turn on tertiary PAs for 3T devices */
> }
> if (tx_chain_num > 1) {
> /* Turn on secondary PAs for 2T and for 3T devices */
> }
> /* Turn on primary PAs for 1T, 2T and for 3T devices */
> At least to me this is easier to read.
Yes it would be more readable. The only disadvantage of separated if statements
is that both conditions will be evaluated on 1T devices.
> Alternatively it could be changed to a switch statement wit fall-through
> cases for the number of RX/TX streams.
This sounds more reasonable, I will change the code to use switch statements.
Thanks,
Gabor
^ permalink raw reply
* Re: [rt2x00-users] [PATCH 0/3] rt2x00: rt2800: prepare for three-chain device support
From: Gabor Juhos @ 2013-06-24 19:09 UTC (permalink / raw)
To: Stanislaw Gruszka; +Cc: John Linville, linux-wireless, users
In-Reply-To: <20130624160031.GD2460@localhost.localdomain>
> On Sat, Jun 22, 2013 at 05:42:11PM +0200, Gabor Juhos wrote:
>> Gabor Juhos (3):
>> rt2x00: rt2800: increase EEPROM_SIZE to 512 bytes
>> rt2x00: rt2800lib: turn on secondary PAs/LNAs for 3T/3R devices
>> rt2x00: rt2800lib: turn on tertiary PAs/LNAs for 3T/3R devices
>>
>> drivers/net/wireless/rt2x00/rt2800.h | 2 +-
>> drivers/net/wireless/rt2x00/rt2800lib.c | 22 ++++++++++++++++++----
>> 2 files changed, 19 insertions(+), 5 deletions(-)
>
> This series also looks good to me.
>
> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Thanks!
> BTW: Do you plan to create more 3T/3R patches soon ?
Yes, I have more patches in the queue.
> I plan to work on adding support for RT3573 usb device (but stuck on other
> work so far unfortunetly). Anyway I don't want to duplicate efforts, so would
> like to know about your plans.
I'm testing these patches on a Linksys AE3000 device which also uses the RT3573
chip. I have an almost complete patch-set which allows me to use the device in
STA and in AP mode, however I still have to resolve a few problems.
-Gabor
^ permalink raw reply
* Re: [PATCH 2/3] rt2x00: rt2800lib: turn on secondary PAs/LNAs for 3T/3R devices
From: Gabor Juhos @ 2013-06-24 19:00 UTC (permalink / raw)
To: Helmut Schaa; +Cc: John Linville, linux-wireless, rt2x00 Users List
In-Reply-To: <CAGXE3d9_zOt0h6WaWUedXnJu9yucJ=Jtaa8PPacz1-6G2Wf63w@mail.gmail.com>
2013.06.24. 15:00 keltezéssel, Helmut Schaa írta:
> On Sat, Jun 22, 2013 at 5:42 PM, Gabor Juhos <juhosg@openwrt.org> wrote:
>> The secondary PAs/LNAs are turned on only for 2T/2R
>> devices, however these are used for 3T/3R devices as
>> well. Always turn those on if the device uses more
>> than one tx/rx chains.
>>
>> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
>> ---
>> drivers/net/wireless/rt2x00/rt2800lib.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
>> index 4072242..f4cd3d8 100644
>> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
>> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
>> @@ -2678,16 +2678,16 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
>>
>> tx_pin = 0;
>>
>> - /* Turn on unused PA or LNA when not using 1T or 1R */
>> - if (rt2x00dev->default_ant.tx_chain_num == 2) {
>> + if (rt2x00dev->default_ant.tx_chain_num > 1) {
>> + /* Turn on secondary PAs for 2T adn for 3T devices*/
>
> Typo adn -> and.
>
> Otherwise looks good to me.
Thanks, I will send a fixed version.
-Gabor
^ permalink raw reply
* Re: pull request: bluetooth-next 2013-06-23
From: John W. Linville @ 2013-06-24 18:46 UTC (permalink / raw)
To: Gustavo Padovan, linux-wireless, linux-bluetooth, linux-kernel
In-Reply-To: <20130623022356.GB2327@joana>
On Sun, Jun 23, 2013 at 03:23:56AM +0100, Gustavo Padovan wrote:
> Hi John,
>
> Here goes a set of patches to 3.11. The biggest work here is from Andre Guedes
> on the move of the Discovery to use the new request framework. Other than that
> Johan provided a bunch of fixes to the L2CAP code. The rest are just small
> fixes and clean ups.
>
> Please pull or let me know of any problem! Thanks.
>
> Gustavo
>
> ---
> The following changes since commit b887664d882ee4f6a67e0bf05e5f141d32fcc067:
>
> mwifiex: channel switch handling for station (2013-06-19 15:28:43 -0400)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next for-upstream
>
> for you to fetch changes up to b8f4e068004859eefac7b1ced59ddb67ca6d2d80:
>
> Bluetooth: Improve comments on the HCI_Delete_Store_Link_Key issue (2013-06-23 03:05:47 +0100)
Pulling now...
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* Re: pull-request: mac80211-next 2013-06-24
From: John W. Linville @ 2013-06-24 18:45 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1372094678.8439.24.camel@jlt4.sipsolutions.net>
On Mon, Jun 24, 2013 at 07:24:38PM +0200, Johannes Berg wrote:
> John,
>
> As can be expected, I've accumulated a bunch more patches. Much of it is
> already trending towards fixes rather than new features, but some of
> those are there as well. I've removed the diffstat because git got
> confused about it, presumably because I merged mac80211 to resolve a
> conflict with the nl80211 fix. Anyway ...
>
> Here we have a few memory leak fixes related to BSS struct handling
> mostly from Ben, including a fix for a more theoretical problem
> (associating while a BSS struct times out) from myself, a compilation
> warning fix from Arend, mesh fixes from Thomas, tracking the beacon
> bitrate (Alex), a bandwidth change event fix (Ilan) and some initial
> work for 5/10 MHz channels from Simon.
>
> Let me know if there are any issues.
>
> johannes
>
>
> The following changes since commit 795d855d56c6d172f50a974f603ba923ac93ee76:
>
> mac80211: Fix rate control mask matching call (2013-06-12 09:12:43 +0200)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git for-john
>
> for you to fetch changes up to 6c7c4cbfd5f59c04a40af67ad72d14e19215ef36:
>
> mac80211: initialize power mode for mesh STAs (2013-06-24 15:59:20 +0200)
Pulling now...
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* Re: pull request: bluetooth 2013-06-23
From: John W. Linville @ 2013-06-24 17:58 UTC (permalink / raw)
To: Gustavo Padovan, linux-wireless, linux-bluetooth, linux-kernel
In-Reply-To: <20130623021351.GA2327@joana>
On Sun, Jun 23, 2013 at 03:13:51AM +0100, Gustavo Padovan wrote:
> Hi John,
>
> A important fix to 3.10, this patch fixes an issues that was preventing the
> l2cap info response command to be handled properly. Please pull. Thanks!
>
> Gustavo
>
> ---
> The following changes since commit fcb3701849957917a234a61b58ad70ed35c83eda:
>
> brcmfmac: free primary net_device when brcmf_bus_start() fails (2013-06-13 13:24:12 -0400)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth master
>
> for you to fetch changes up to 3f6fa3d489e127ca5a5b298eabac3ff5dbe0e112:
>
> Bluetooth: Fix invalid length check in l2cap_information_rsp() (2013-06-23 00:24:58 +0100)
>
> ----------------------------------------------------------------
> Jaganath Kanakkassery (1):
> Bluetooth: Fix invalid length check in l2cap_information_rsp()
>
> net/bluetooth/l2cap_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Pulling now...
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* Re: [PATCH 3/3] rt2x00: rt2800lib: turn on tertiary PAs/LNAs for 3T/3R devices
From: Gertjan van Wingerde @ 2013-06-24 17:42 UTC (permalink / raw)
To: Gabor Juhos
Cc: John Linville, linux-wireless@vger.kernel.org,
users@rt2x00.serialmonkey.com, Gabor Juhos
In-Reply-To: <1371915734-13966-4-git-send-email-juhosg@openwrt.org>
Hi Gabor,
Sent from my iPad
On 22 jun. 2013, at 17:42, Gabor Juhos <juhosg@openwrt.org> wrote:
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
> ---
> drivers/net/wireless/rt2x00/rt2800lib.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index f4cd3d8..664e9e1 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -2684,12 +2684,26 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
> rf->channel > 14);
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN,
> rf->channel <= 14);
> +
> + if (rt2x00dev->default_ant.tx_chain_num > 2) {
> + /* Turn on tertiary PAs for 3T devices */
> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A2_EN,
> + rf->channel > 14);
> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G2_EN,
> + rf->channel <= 14);
> + }
> }
>
> if (rt2x00dev->default_ant.rx_chain_num > 1) {
> /* Turn on secondary LNAs for 2R and for 3R devices */
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1);
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1);
> +
> + if (rt2x00dev->default_ant.rx_chain_num > 2) {
> + /* Turn on tertiary LNAs for 3R devices */
> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A2_EN, 1);
> + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G2_EN, 1);
> + }
> }
Stylistic I would prefer the if outside of if block you included it in.
Something like:
if (tx_chain_num > 2) {
/* Turn on tertiary PAs for 3T devices */
}
if (tx_chain_num > 1) {
/* Turn on secondary PAs for 2T and for 3T devices */
}
/* Turn on primary PAs for 1T, 2T and for 3T devices */
At least to me this is easier to read.
Alternatively it could be changed to a switch statement wit fall-through cases for the number of RX/TX streams.
>
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1);
> --
> 1.7.10
>
> --
> 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: [PATCH 2/3] rt2x00: rt2800lib: turn on secondary PAs/LNAs for 3T/3R devices
From: Gertjan van Wingerde @ 2013-06-24 17:33 UTC (permalink / raw)
To: Gabor Juhos
Cc: John Linville, linux-wireless@vger.kernel.org,
users@rt2x00.serialmonkey.com, Gabor Juhos
In-Reply-To: <1371915734-13966-3-git-send-email-juhosg@openwrt.org>
Hi Gabor,
Sent from my iPad
On 22 jun. 2013, at 17:42, Gabor Juhos <juhosg@openwrt.org> wrote:
> The secondary PAs/LNAs are turned on only for 2T/2R
> devices, however these are used for 3T/3R devices as
> well. Always turn those on if the device uses more
> than one tx/rx chains.
>
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Looks good to me. However, please resubmit with the typo noticed by Helmut fixed.
You can add my Acked-by in that resubmission.
> ---
> drivers/net/wireless/rt2x00/rt2800lib.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index 4072242..f4cd3d8 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -2678,16 +2678,16 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
>
> tx_pin = 0;
>
> - /* Turn on unused PA or LNA when not using 1T or 1R */
> - if (rt2x00dev->default_ant.tx_chain_num == 2) {
> + if (rt2x00dev->default_ant.tx_chain_num > 1) {
> + /* Turn on secondary PAs for 2T adn for 3T devices*/
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN,
> rf->channel > 14);
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN,
> rf->channel <= 14);
> }
>
> - /* Turn on unused PA or LNA when not using 1T or 1R */
> - if (rt2x00dev->default_ant.rx_chain_num == 2) {
> + if (rt2x00dev->default_ant.rx_chain_num > 1) {
> + /* Turn on secondary LNAs for 2R and for 3R devices */
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1);
> rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1);
> }
> --
> 1.7.10
>
> --
> 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: [PATCH 1/3] rt2x00: rt2800: increase EEPROM_SIZE to 512 bytes
From: Gertjan van Wingerde @ 2013-06-24 17:32 UTC (permalink / raw)
To: Gabor Juhos
Cc: John Linville, linux-wireless@vger.kernel.org,
users@rt2x00.serialmonkey.com, Gabor Juhos
In-Reply-To: <1371915734-13966-2-git-send-email-juhosg@openwrt.org>
Sent from my iPad
On 22 jun. 2013, at 17:42, Gabor Juhos <juhosg@openwrt.org> wrote:
> Ralink 3T chipsets are using a different EEPROM
> layout than the others. The EEPROM on these devices
> contain more data than the others which does not fit
> into 272 byte which the rt2800 driver actually uses.
>
> The Ralink reference driver defines EEPROM_SIZE to
> 512/1024 bytes for PCI/USB devices respectively.
>
> Increase the EEPROM_SIZE constant to 512 bytes, in
> order to make room for EEPROM data of 3T devices.
>
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt2800.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
> index fe43d01..d78c495 100644
> --- a/drivers/net/wireless/rt2x00/rt2800.h
> +++ b/drivers/net/wireless/rt2x00/rt2800.h
> @@ -100,7 +100,7 @@
> #define CSR_REG_BASE 0x1000
> #define CSR_REG_SIZE 0x0800
> #define EEPROM_BASE 0x0000
> -#define EEPROM_SIZE 0x0110
> +#define EEPROM_SIZE 0x0200
> #define BBP_BASE 0x0000
> #define BBP_SIZE 0x00ff
> #define RF_BASE 0x0004
> --
> 1.7.10
>
> --
> 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: [PATCH] rt2x00: read 5GHz TX power values from the correct offset
From: Gertjan van Wingerde @ 2013-06-24 17:31 UTC (permalink / raw)
To: Gabor Juhos
Cc: John Linville, linux-wireless@vger.kernel.org,
users@rt2x00.serialmonkey.com, Gabor Juhos,
stable@vger.kernel.org
In-Reply-To: <1371899605-30513-1-git-send-email-juhosg@openwrt.org>
Sent from my iPad
On 22 jun. 2013, at 13:13, Gabor Juhos <juhosg@openwrt.org> wrote:
> The current code uses the same index value both
> for the channel information array and for the TX
> power table. The index starts from 14, however the
> index of the TX power table must start from zero.
>
> Fix it, in order to get the correct TX power value
> for a given channel.
>
> The changes in rt61pci.c and rt73usb.c are compile
> tested only.
>
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
> Cc: stable@vger.kernel.org
Acked-by: Gertjan van Wingerde
Good catch. This can certainly explain why people were seeing bad results on the 5 GHz band.
> ---
> John,
>
> If there is any chance for that, this should go
> into 3.10. However the code is wrong since a few
> years and nobody noticed that so far, so it is
> not a big problem if it will be applied only in
> 3.11.
>
> -Gabor
> ---
> drivers/net/wireless/rt2x00/rt2800lib.c | 4 ++--
> drivers/net/wireless/rt2x00/rt61pci.c | 3 ++-
> drivers/net/wireless/rt2x00/rt73usb.c | 3 ++-
> 3 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index 3aa30dd..4072242 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -6254,8 +6254,8 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> default_power2 = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A2);
>
> for (i = 14; i < spec->num_channels; i++) {
> - info[i].default_power1 = default_power1[i];
> - info[i].default_power2 = default_power2[i];
> + info[i].default_power1 = default_power1[i - 14];
> + info[i].default_power2 = default_power2[i - 14];
> }
> }
>
> diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
> index 53754bc6..54d3ddf 100644
> --- a/drivers/net/wireless/rt2x00/rt61pci.c
> +++ b/drivers/net/wireless/rt2x00/rt61pci.c
> @@ -2825,7 +2825,8 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START);
> for (i = 14; i < spec->num_channels; i++) {
> info[i].max_power = MAX_TXPOWER;
> - info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]);
> + info[i].default_power1 =
> + TXPOWER_FROM_DEV(tx_power[i - 14]);
> }
> }
>
> diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
> index 1616ed4..1d3880e 100644
> --- a/drivers/net/wireless/rt2x00/rt73usb.c
> +++ b/drivers/net/wireless/rt2x00/rt73usb.c
> @@ -2167,7 +2167,8 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START);
> for (i = 14; i < spec->num_channels; i++) {
> info[i].max_power = MAX_TXPOWER;
> - info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]);
> + info[i].default_power1 =
> + TXPOWER_FROM_DEV(tx_power[i - 14]);
> }
> }
>
> --
> 1.7.10
>
> --
> 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: [PATCH 2/2] rt2x00: rt2800: unify [RT]XWI_SIZE defines
From: Gertjan van Wingerde @ 2013-06-24 17:29 UTC (permalink / raw)
To: Gabor Juhos
Cc: John Linville, linux-wireless@vger.kernel.org,
users@rt2x00.serialmonkey.com, Gabor Juhos
In-Reply-To: <1371911519-13135-2-git-send-email-juhosg@openwrt.org>
Sent from my iPad
On 22 jun. 2013, at 16:31, Gabor Juhos <juhosg@openwrt.org> wrote:
> Use common names instead of chip specific ones.
> The patch contains no functional changes, but
> it makes it easier to add support for further
> descriptor sizes.
>
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt2800.h | 10 ++++++----
> drivers/net/wireless/rt2x00/rt2800pci.c | 6 +++---
> drivers/net/wireless/rt2x00/rt2800usb.c | 8 ++++----
> 3 files changed, 13 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
> index a7630d5..fe43d01 100644
> --- a/drivers/net/wireless/rt2x00/rt2800.h
> +++ b/drivers/net/wireless/rt2x00/rt2800.h
> @@ -2625,11 +2625,13 @@ struct mac_iveiv_entry {
> /*
> * DMA descriptor defines.
> */
> -#define TXWI_DESC_SIZE (4 * sizeof(__le32))
> -#define RXWI_DESC_SIZE (4 * sizeof(__le32))
>
> -#define TXWI_DESC_SIZE_5592 (5 * sizeof(__le32))
> -#define RXWI_DESC_SIZE_5592 (6 * sizeof(__le32))
> +#define TXWI_DESC_SIZE_4WORDS (4 * sizeof(__le32))
> +#define TXWI_DESC_SIZE_5WORDS (5 * sizeof(__le32))
> +
> +#define RXWI_DESC_SIZE_4WORDS (4 * sizeof(__le32))
> +#define RXWI_DESC_SIZE_6WORDS (6 * sizeof(__le32))
> +
> /*
> * TX WI structure
> */
> diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
> index e664918..0005562 100644
> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> @@ -1194,7 +1194,7 @@ static void rt2800pci_queue_init(struct data_queue *queue)
> queue->limit = 128;
> queue->data_size = AGGREGATION_SIZE;
> queue->desc_size = RXD_DESC_SIZE;
> - queue->winfo_size = RXWI_DESC_SIZE;
> + queue->winfo_size = RXWI_DESC_SIZE_4WORDS;
> queue->priv_size = sizeof(struct queue_entry_priv_mmio);
> break;
>
> @@ -1205,7 +1205,7 @@ static void rt2800pci_queue_init(struct data_queue *queue)
> queue->limit = 64;
> queue->data_size = AGGREGATION_SIZE;
> queue->desc_size = TXD_DESC_SIZE;
> - queue->winfo_size = TXWI_DESC_SIZE;
> + queue->winfo_size = TXWI_DESC_SIZE_4WORDS;
> queue->priv_size = sizeof(struct queue_entry_priv_mmio);
> break;
>
> @@ -1213,7 +1213,7 @@ static void rt2800pci_queue_init(struct data_queue *queue)
> queue->limit = 8;
> queue->data_size = 0; /* No DMA required for beacons */
> queue->desc_size = TXD_DESC_SIZE;
> - queue->winfo_size = TXWI_DESC_SIZE;
> + queue->winfo_size = TXWI_DESC_SIZE_4WORDS;
> queue->priv_size = sizeof(struct queue_entry_priv_mmio);
> break;
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
> index 7edd903..840833b 100644
> --- a/drivers/net/wireless/rt2x00/rt2800usb.c
> +++ b/drivers/net/wireless/rt2x00/rt2800usb.c
> @@ -855,11 +855,11 @@ static void rt2800usb_queue_init(struct data_queue *queue)
> unsigned short txwi_size, rxwi_size;
>
> if (rt2x00_rt(rt2x00dev, RT5592)) {
> - txwi_size = TXWI_DESC_SIZE_5592;
> - rxwi_size = RXWI_DESC_SIZE_5592;
> + txwi_size = TXWI_DESC_SIZE_5WORDS;
> + rxwi_size = RXWI_DESC_SIZE_6WORDS;
> } else {
> - txwi_size = TXWI_DESC_SIZE;
> - rxwi_size = RXWI_DESC_SIZE;
> + txwi_size = TXWI_DESC_SIZE_4WORDS;
> + rxwi_size = RXWI_DESC_SIZE_4WORDS;
> }
>
> switch (queue->qid) {
> --
> 1.7.10
>
> --
> 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: [PATCH 1/2] rt2x00: rt2800pci: don't use TXWI_DESC_SIZE directly
From: Gertjan van Wingerde @ 2013-06-24 17:29 UTC (permalink / raw)
To: Gabor Juhos
Cc: John Linville, linux-wireless@vger.kernel.org,
users@rt2x00.serialmonkey.com, Gabor Juhos
In-Reply-To: <1371911519-13135-1-git-send-email-juhosg@openwrt.org>
Sent from my iPad
On 22 jun. 2013, at 16:31, Gabor Juhos <juhosg@openwrt.org> wrote:
> Different chipsets may use different TXWI descriptor
> size. Instead of using a hardcoded value, use the
> 'queue->winfo_size' which holds the correct value for
> a given device.
>
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt2800pci.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
> index 7c74782..e664918 100644
> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> @@ -637,6 +637,7 @@ static void rt2800pci_write_tx_desc(struct queue_entry *entry,
> struct queue_entry_priv_mmio *entry_priv = entry->priv_data;
> __le32 *txd = entry_priv->desc;
> u32 word;
> + const unsigned int txwi_size = entry->queue->winfo_size;
>
> /*
> * The buffers pointed by SD_PTR0/SD_LEN0 and SD_PTR1/SD_LEN1
> @@ -659,14 +660,14 @@ static void rt2800pci_write_tx_desc(struct queue_entry *entry,
> !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
> rt2x00_set_field32(&word, TXD_W1_BURST,
> test_bit(ENTRY_TXD_BURST, &txdesc->flags));
> - rt2x00_set_field32(&word, TXD_W1_SD_LEN0, TXWI_DESC_SIZE);
> + rt2x00_set_field32(&word, TXD_W1_SD_LEN0, txwi_size);
> rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0);
> rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0);
> rt2x00_desc_write(txd, 1, word);
>
> word = 0;
> rt2x00_set_field32(&word, TXD_W2_SD_PTR1,
> - skbdesc->skb_dma + TXWI_DESC_SIZE);
> + skbdesc->skb_dma + txwi_size);
> rt2x00_desc_write(txd, 2, word);
>
> word = 0;
> --
> 1.7.10
>
> --
> 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
* pull-request: mac80211-next 2013-06-24
From: Johannes Berg @ 2013-06-24 17:24 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
[-- Attachment #1: Type: text/plain, Size: 2791 bytes --]
John,
As can be expected, I've accumulated a bunch more patches. Much of it is
already trending towards fixes rather than new features, but some of
those are there as well. I've removed the diffstat because git got
confused about it, presumably because I merged mac80211 to resolve a
conflict with the nl80211 fix. Anyway ...
Here we have a few memory leak fixes related to BSS struct handling
mostly from Ben, including a fix for a more theoretical problem
(associating while a BSS struct times out) from myself, a compilation
warning fix from Arend, mesh fixes from Thomas, tracking the beacon
bitrate (Alex), a bandwidth change event fix (Ilan) and some initial
work for 5/10 MHz channels from Simon.
Let me know if there are any issues.
johannes
The following changes since commit 795d855d56c6d172f50a974f603ba923ac93ee76:
mac80211: Fix rate control mask matching call (2013-06-12 09:12:43 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git for-john
for you to fetch changes up to 6c7c4cbfd5f59c04a40af67ad72d14e19215ef36:
mac80211: initialize power mode for mesh STAs (2013-06-24 15:59:20 +0200)
----------------------------------------------------------------
Alexander Bondar (1):
mac80211: track AP's beacon rate and give it to the driver
Antonio Quartulli (1):
Revert "mac80211: in IBSS use the Auth frame to trigger STA reinsertion"
Arend van Spriel (1):
cfg80211: fix compilation warning for cfg80211_leave_all()
Ben Greear (4):
mac80211: Ensure tid_start_tx is protected by sta->lock
wireless: Make sure __cfg80211_connect_result always puts bss
wireless: add comments about bss refcounting
wireless: check for dangling wdev->current_bss pointer
Ilan Peer (1):
mac80211: Fix VHT bandwidth change event
Johannes Berg (6):
mac80211: fix TX aggregation TID struct leak
nl80211: fix attrbuf access race by allocating a separate one
Merge remote-tracking branch 'mac80211/master' into HEAD
nl80211: use small state buffer for wiphy_dump
cfg80211: require passing BSS struct back to cfg80211_assoc_timeout
cfg80211: hold BSS over association process
Simon Wunderlich (5):
nl80211: use attributes to parse beacons
nl80211/cfg80211: add 5 and 10 MHz defines and wiphy flag
nl80211: add rate flags for 5/10 Mhz channels
mac80211: fix various components for the new 5 and 10 MHz widths
mac80211: change IBSS channel state to chandef
Thomas Pedersen (3):
mac80211: update mesh beacon on workqueue
mac80211: allow self-protected frame tx without sta
mac80211: initialize power mode for mesh STAs
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [rt2x00-users] [PATCH 0/3] rt2x00: rt2800: prepare for three-chain device support
From: Stanislaw Gruszka @ 2013-06-24 16:00 UTC (permalink / raw)
To: Gabor Juhos; +Cc: John Linville, linux-wireless, users
In-Reply-To: <1371915734-13966-1-git-send-email-juhosg@openwrt.org>
On Sat, Jun 22, 2013 at 05:42:11PM +0200, Gabor Juhos wrote:
> Gabor Juhos (3):
> rt2x00: rt2800: increase EEPROM_SIZE to 512 bytes
> rt2x00: rt2800lib: turn on secondary PAs/LNAs for 3T/3R devices
> rt2x00: rt2800lib: turn on tertiary PAs/LNAs for 3T/3R devices
>
> drivers/net/wireless/rt2x00/rt2800.h | 2 +-
> drivers/net/wireless/rt2x00/rt2800lib.c | 22 ++++++++++++++++++----
> 2 files changed, 19 insertions(+), 5 deletions(-)
This series also looks good to me.
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
BTW: Do you plan to create more 3T/3R patches soon ? I plan to work on
adding support for RT3573 usb device (but stuck on other work so far
unfortunetly). Anyway I don't want to duplicate efforts, so would like
to know about your plans.
Thanks
Stanislaw
^ 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