Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 27/32] rt2800: initialize BBP_R134 & BBP_R135 on 53xx subroutine
From: stf_xl @ 2013-05-18 12:03 UTC (permalink / raw)
  To: linux-wireless; +Cc: users, Stanislaw Gruszka
In-Reply-To: <1368878635-4455-1-git-send-email-stf_xl@wp.pl>

From: Stanislaw Gruszka <stf_xl@wp.pl>

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
 drivers/net/wireless/rt2x00/rt2800lib.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 49a4759..96c1aea 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -4293,6 +4293,11 @@ static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev)
 		WARN_ON(1);
 
 	rt2800_bbp_write(rt2x00dev, 128, 0x12);
+
+	if (rt2x00_rt(rt2x00dev, RT5392)) {
+		rt2800_bbp_write(rt2x00dev, 134, 0xd0);
+		rt2800_bbp_write(rt2x00dev, 135, 0xf6);
+	}
 }
 
 static void rt2800_init_bbp_5592(struct rt2x00_dev *rt2x00dev)
@@ -4411,11 +4416,6 @@ static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
 		return;
 	}
 
-	if (rt2x00_rt(rt2x00dev, RT5392)) {
-		rt2800_bbp_write(rt2x00dev, 134, 0xd0);
-		rt2800_bbp_write(rt2x00dev, 135, 0xf6);
-	}
-
 	if (rt2x00_rt(rt2x00dev, RT3352))
 		rt2800_bbp_write(rt2x00dev, 137, 0x0f);
 
-- 
1.7.4.4


^ permalink raw reply related

* [PATCH 28/32] rt2800: initialize BBP_R104 on 3352 subroutine
From: stf_xl @ 2013-05-18 12:03 UTC (permalink / raw)
  To: linux-wireless; +Cc: users, Stanislaw Gruszka
In-Reply-To: <1368878635-4455-1-git-send-email-stf_xl@wp.pl>

From: Stanislaw Gruszka <stf_xl@wp.pl>

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
 drivers/net/wireless/rt2x00/rt2800lib.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 96c1aea..408c0d4 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -4162,6 +4162,8 @@ static void rt2800_init_bbp_3352(struct rt2x00_dev *rt2x00dev)
 	rt2800_bbp_write(rt2x00dev, 106, 0x05);
 
 	rt2800_bbp_write(rt2x00dev, 120, 0x50);
+
+	rt2800_bbp_write(rt2x00dev, 137, 0x0f);
 }
 
 static void rt2800_init_bbp_3390(struct rt2x00_dev *rt2x00dev)
@@ -4416,9 +4418,6 @@ static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
 		return;
 	}
 
-	if (rt2x00_rt(rt2x00dev, RT3352))
-		rt2800_bbp_write(rt2x00dev, 137, 0x0f);
-
 	if (rt2x00_rt(rt2x00dev, RT3071) ||
 	    rt2x00_rt(rt2x00dev, RT3090) ||
 	    rt2x00_rt(rt2x00dev, RT3390) ||
-- 
1.7.4.4


^ permalink raw reply related

* [PATCH 29/32] rt2800: initialize BBP_R108 on proper subroutines
From: stf_xl @ 2013-05-18 12:03 UTC (permalink / raw)
  To: linux-wireless; +Cc: users, Stanislaw Gruszka
In-Reply-To: <1368878635-4455-1-git-send-email-stf_xl@wp.pl>

From: Stanislaw Gruszka <stf_xl@wp.pl>

Create helper function and move initialization to subroutines.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
 drivers/net/wireless/rt2x00/rt2800lib.c |   41 ++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 408c0d4..bb0ed3d 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -3953,6 +3953,20 @@ static void rt2800_init_bbp_early(struct rt2x00_dev *rt2x00dev)
 	rt2800_bbp_write(rt2x00dev, 106, 0x35);
 }
 
+static void rt2800_disable_unused_dac_adc(struct rt2x00_dev *rt2x00dev)
+{
+	u16 eeprom;
+	u8 value;
+
+	rt2800_bbp_read(rt2x00dev, 138, &value);
+	rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF0, &eeprom);
+	if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_TXPATH) == 1)
+		value |= 0x20;
+	if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RXPATH) == 1)
+		value &= ~0x02;
+	rt2800_bbp_write(rt2x00dev, 138, value);
+}
+
 static void rt2800_init_bbp_305x_soc(struct rt2x00_dev *rt2x00dev)
 {
 	rt2800_bbp_write(rt2x00dev, 31, 0x08);
@@ -4062,6 +4076,10 @@ static void rt2800_init_bbp_30xx(struct rt2x00_dev *rt2x00dev)
 	rt2800_bbp_write(rt2x00dev, 105, 0x05);
 
 	rt2800_bbp_write(rt2x00dev, 106, 0x35);
+
+	if (rt2x00_rt(rt2x00dev, RT3071) ||
+	    rt2x00_rt(rt2x00dev, RT3090))
+		rt2800_disable_unused_dac_adc(rt2x00dev);
 }
 
 static void rt2800_init_bbp_3290(struct rt2x00_dev *rt2x00dev)
@@ -4200,6 +4218,8 @@ static void rt2800_init_bbp_3390(struct rt2x00_dev *rt2x00dev)
 	rt2800_bbp_write(rt2x00dev, 105, 0x05);
 
 	rt2800_bbp_write(rt2x00dev, 106, 0x35);
+
+	rt2800_disable_unused_dac_adc(rt2x00dev);
 }
 
 static void rt2800_init_bbp_3572(struct rt2x00_dev *rt2x00dev)
@@ -4235,6 +4255,8 @@ static void rt2800_init_bbp_3572(struct rt2x00_dev *rt2x00dev)
 	rt2800_bbp_write(rt2x00dev, 105, 0x05);
 
 	rt2800_bbp_write(rt2x00dev, 106, 0x35);
+
+	rt2800_disable_unused_dac_adc(rt2x00dev);
 }
 
 static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev)
@@ -4300,6 +4322,8 @@ static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev)
 		rt2800_bbp_write(rt2x00dev, 134, 0xd0);
 		rt2800_bbp_write(rt2x00dev, 135, 0xf6);
 	}
+
+	rt2800_disable_unused_dac_adc(rt2x00dev);
 }
 
 static void rt2800_init_bbp_5592(struct rt2x00_dev *rt2x00dev)
@@ -4418,23 +4442,6 @@ static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
 		return;
 	}
 
-	if (rt2x00_rt(rt2x00dev, RT3071) ||
-	    rt2x00_rt(rt2x00dev, RT3090) ||
-	    rt2x00_rt(rt2x00dev, RT3390) ||
-	    rt2x00_rt(rt2x00dev, RT3572) ||
-	    rt2x00_rt(rt2x00dev, RT5390) ||
-	    rt2x00_rt(rt2x00dev, RT5392)) {
-		rt2800_bbp_read(rt2x00dev, 138, &value);
-
-		rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF0, &eeprom);
-		if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_TXPATH) == 1)
-			value |= 0x20;
-		if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RXPATH) == 1)
-			value &= ~0x02;
-
-		rt2800_bbp_write(rt2x00dev, 138, value);
-	}
-
 	if (rt2x00_rt(rt2x00dev, RT3290)) {
 		rt2800_bbp_write(rt2x00dev, 67, 0x24);
 		rt2800_bbp_write(rt2x00dev, 143, 0x04);
-- 
1.7.4.4


^ permalink raw reply related

* [PATCH 30/32] rt2800: move 3352 specific bbp initialization
From: stf_xl @ 2013-05-18 12:03 UTC (permalink / raw)
  To: linux-wireless; +Cc: users, Stanislaw Gruszka
In-Reply-To: <1368878635-4455-1-git-send-email-stf_xl@wp.pl>

From: Stanislaw Gruszka <stf_xl@wp.pl>

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
 drivers/net/wireless/rt2x00/rt2800lib.c |   42 ++++++++++++++----------------
 1 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index bb0ed3d..ad191d5 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -4182,6 +4182,26 @@ static void rt2800_init_bbp_3352(struct rt2x00_dev *rt2x00dev)
 	rt2800_bbp_write(rt2x00dev, 120, 0x50);
 
 	rt2800_bbp_write(rt2x00dev, 137, 0x0f);
+
+	rt2800_bbp_write(rt2x00dev, 163, 0xbd);
+	/* Set ITxBF timeout to 0x9c40=1000msec */
+	rt2800_bbp_write(rt2x00dev, 179, 0x02);
+	rt2800_bbp_write(rt2x00dev, 180, 0x00);
+	rt2800_bbp_write(rt2x00dev, 182, 0x40);
+	rt2800_bbp_write(rt2x00dev, 180, 0x01);
+	rt2800_bbp_write(rt2x00dev, 182, 0x9c);
+	rt2800_bbp_write(rt2x00dev, 179, 0x00);
+	/* Reprogram the inband interface to put right values in RXWI */
+	rt2800_bbp_write(rt2x00dev, 142, 0x04);
+	rt2800_bbp_write(rt2x00dev, 143, 0x3b);
+	rt2800_bbp_write(rt2x00dev, 142, 0x06);
+	rt2800_bbp_write(rt2x00dev, 143, 0xa0);
+	rt2800_bbp_write(rt2x00dev, 142, 0x07);
+	rt2800_bbp_write(rt2x00dev, 143, 0xa1);
+	rt2800_bbp_write(rt2x00dev, 142, 0x08);
+	rt2800_bbp_write(rt2x00dev, 143, 0xa2);
+
+	rt2800_bbp_write(rt2x00dev, 148, 0xc8);
 }
 
 static void rt2800_init_bbp_3390(struct rt2x00_dev *rt2x00dev)
@@ -4465,28 +4485,6 @@ static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
 		rt2800_bbp_write(rt2x00dev, 3, value);
 	}
 
-	if (rt2x00_rt(rt2x00dev, RT3352)) {
-		rt2800_bbp_write(rt2x00dev, 163, 0xbd);
-		/* Set ITxBF timeout to 0x9c40=1000msec */
-		rt2800_bbp_write(rt2x00dev, 179, 0x02);
-		rt2800_bbp_write(rt2x00dev, 180, 0x00);
-		rt2800_bbp_write(rt2x00dev, 182, 0x40);
-		rt2800_bbp_write(rt2x00dev, 180, 0x01);
-		rt2800_bbp_write(rt2x00dev, 182, 0x9c);
-		rt2800_bbp_write(rt2x00dev, 179, 0x00);
-		/* Reprogram the inband interface to put right values in RXWI */
-		rt2800_bbp_write(rt2x00dev, 142, 0x04);
-		rt2800_bbp_write(rt2x00dev, 143, 0x3b);
-		rt2800_bbp_write(rt2x00dev, 142, 0x06);
-		rt2800_bbp_write(rt2x00dev, 143, 0xa0);
-		rt2800_bbp_write(rt2x00dev, 142, 0x07);
-		rt2800_bbp_write(rt2x00dev, 143, 0xa1);
-		rt2800_bbp_write(rt2x00dev, 142, 0x08);
-		rt2800_bbp_write(rt2x00dev, 143, 0xa2);
-
-		rt2800_bbp_write(rt2x00dev, 148, 0xc8);
-	}
-
 	if (rt2x00_rt(rt2x00dev, RT5390) ||
 	    rt2x00_rt(rt2x00dev, RT5392)) {
 		int ant, div_mode;
-- 
1.7.4.4


^ permalink raw reply related

* [PATCH 31/32] rt2800: move 3290 specific bbp initialization
From: stf_xl @ 2013-05-18 12:03 UTC (permalink / raw)
  To: linux-wireless; +Cc: users, Stanislaw Gruszka
In-Reply-To: <1368878635-4455-1-git-send-email-stf_xl@wp.pl>

From: Stanislaw Gruszka <stf_xl@wp.pl>

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
 drivers/net/wireless/rt2x00/rt2800lib.c |   46 +++++++++++++++---------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index ad191d5..1e58180 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -4084,6 +4084,8 @@ static void rt2800_init_bbp_30xx(struct rt2x00_dev *rt2x00dev)
 
 static void rt2800_init_bbp_3290(struct rt2x00_dev *rt2x00dev)
 {
+	u8 value;
+
 	rt2800_bbp4_mac_if_ctrl(rt2x00dev);
 
 	rt2800_bbp_write(rt2x00dev, 31, 0x08);
@@ -4128,6 +4130,27 @@ static void rt2800_init_bbp_3290(struct rt2x00_dev *rt2x00dev)
 	rt2800_bbp_write(rt2x00dev, 106, 0x03);
 
 	rt2800_bbp_write(rt2x00dev, 128, 0x12);
+
+	rt2800_bbp_write(rt2x00dev, 67, 0x24);
+	rt2800_bbp_write(rt2x00dev, 143, 0x04);
+	rt2800_bbp_write(rt2x00dev, 142, 0x99);
+	rt2800_bbp_write(rt2x00dev, 150, 0x30);
+	rt2800_bbp_write(rt2x00dev, 151, 0x2e);
+	rt2800_bbp_write(rt2x00dev, 152, 0x20);
+	rt2800_bbp_write(rt2x00dev, 153, 0x34);
+	rt2800_bbp_write(rt2x00dev, 154, 0x40);
+	rt2800_bbp_write(rt2x00dev, 155, 0x3b);
+	rt2800_bbp_write(rt2x00dev, 253, 0x04);
+
+	rt2800_bbp_read(rt2x00dev, 47, &value);
+	rt2x00_set_field8(&value, BBP47_TSSI_ADC6, 1);
+	rt2800_bbp_write(rt2x00dev, 47, value);
+
+	/* Use 5-bit ADC for Acquisition and 8-bit ADC for data */
+	rt2800_bbp_read(rt2x00dev, 3, &value);
+	rt2x00_set_field8(&value, BBP3_ADC_MODE_SWITCH, 1);
+	rt2x00_set_field8(&value, BBP3_ADC_INIT_MODE, 1);
+	rt2800_bbp_write(rt2x00dev, 3, value);
 }
 
 static void rt2800_init_bbp_3352(struct rt2x00_dev *rt2x00dev)
@@ -4462,29 +4485,6 @@ static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
 		return;
 	}
 
-	if (rt2x00_rt(rt2x00dev, RT3290)) {
-		rt2800_bbp_write(rt2x00dev, 67, 0x24);
-		rt2800_bbp_write(rt2x00dev, 143, 0x04);
-		rt2800_bbp_write(rt2x00dev, 142, 0x99);
-		rt2800_bbp_write(rt2x00dev, 150, 0x30);
-		rt2800_bbp_write(rt2x00dev, 151, 0x2e);
-		rt2800_bbp_write(rt2x00dev, 152, 0x20);
-		rt2800_bbp_write(rt2x00dev, 153, 0x34);
-		rt2800_bbp_write(rt2x00dev, 154, 0x40);
-		rt2800_bbp_write(rt2x00dev, 155, 0x3b);
-		rt2800_bbp_write(rt2x00dev, 253, 0x04);
-
-		rt2800_bbp_read(rt2x00dev, 47, &value);
-		rt2x00_set_field8(&value, BBP47_TSSI_ADC6, 1);
-		rt2800_bbp_write(rt2x00dev, 47, value);
-
-		/* Use 5-bit ADC for Acquisition and 8-bit ADC for data */
-		rt2800_bbp_read(rt2x00dev, 3, &value);
-		rt2x00_set_field8(&value, BBP3_ADC_MODE_SWITCH, 1);
-		rt2x00_set_field8(&value, BBP3_ADC_INIT_MODE, 1);
-		rt2800_bbp_write(rt2x00dev, 3, value);
-	}
-
 	if (rt2x00_rt(rt2x00dev, RT5390) ||
 	    rt2x00_rt(rt2x00dev, RT5392)) {
 		int ant, div_mode;
-- 
1.7.4.4


^ permalink raw reply related

* [PATCH 32/32] rt2800: move 53xx specific bbp initialization
From: stf_xl @ 2013-05-18 12:03 UTC (permalink / raw)
  To: linux-wireless; +Cc: users, Stanislaw Gruszka
In-Reply-To: <1368878635-4455-1-git-send-email-stf_xl@wp.pl>

From: Stanislaw Gruszka <stf_xl@wp.pl>

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
 drivers/net/wireless/rt2x00/rt2800lib.c |   83 +++++++++++++++----------------
 1 files changed, 41 insertions(+), 42 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 1e58180..fc43c7d 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -4304,6 +4304,10 @@ static void rt2800_init_bbp_3572(struct rt2x00_dev *rt2x00dev)
 
 static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev)
 {
+	int ant, div_mode;
+	u16 eeprom;
+	u8 value;
+
 	rt2800_bbp4_mac_if_ctrl(rt2x00dev);
 
 	rt2800_bbp_write(rt2x00dev, 31, 0x08);
@@ -4367,6 +4371,43 @@ static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev)
 	}
 
 	rt2800_disable_unused_dac_adc(rt2x00dev);
+
+	rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom);
+	div_mode = rt2x00_get_field16(eeprom,
+				      EEPROM_NIC_CONF1_ANT_DIVERSITY);
+	ant = (div_mode == 3) ? 1 : 0;
+
+	/* check if this is a Bluetooth combo card */
+	if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags)) {
+		u32 reg;
+
+		rt2800_register_read(rt2x00dev, GPIO_CTRL, &reg);
+		rt2x00_set_field32(&reg, GPIO_CTRL_DIR3, 0);
+		rt2x00_set_field32(&reg, GPIO_CTRL_DIR6, 0);
+		rt2x00_set_field32(&reg, GPIO_CTRL_VAL3, 0);
+		rt2x00_set_field32(&reg, GPIO_CTRL_VAL6, 0);
+		if (ant == 0)
+			rt2x00_set_field32(&reg, GPIO_CTRL_VAL3, 1);
+		else if (ant == 1)
+			rt2x00_set_field32(&reg, GPIO_CTRL_VAL6, 1);
+		rt2800_register_write(rt2x00dev, GPIO_CTRL, reg);
+	}
+
+	/* This chip has hardware antenna diversity*/
+	if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R)) {
+		rt2800_bbp_write(rt2x00dev, 150, 0); /* Disable Antenna Software OFDM */
+		rt2800_bbp_write(rt2x00dev, 151, 0); /* Disable Antenna Software CCK */
+		rt2800_bbp_write(rt2x00dev, 154, 0); /* Clear previously selected antenna */
+	}
+
+	rt2800_bbp_read(rt2x00dev, 152, &value);
+	if (ant == 0)
+		rt2x00_set_field8(&value, BBP152_RX_DEFAULT_ANT, 1);
+	else
+		rt2x00_set_field8(&value, BBP152_RX_DEFAULT_ANT, 0);
+	rt2800_bbp_write(rt2x00dev, 152, value);
+
+	rt2800_init_freq_calibration(rt2x00dev);
 }
 
 static void rt2800_init_bbp_5592(struct rt2x00_dev *rt2x00dev)
@@ -4485,48 +4526,6 @@ static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
 		return;
 	}
 
-	if (rt2x00_rt(rt2x00dev, RT5390) ||
-	    rt2x00_rt(rt2x00dev, RT5392)) {
-		int ant, div_mode;
-
-		rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom);
-		div_mode = rt2x00_get_field16(eeprom,
-					      EEPROM_NIC_CONF1_ANT_DIVERSITY);
-		ant = (div_mode == 3) ? 1 : 0;
-
-		/* check if this is a Bluetooth combo card */
-		if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags)) {
-			u32 reg;
-
-			rt2800_register_read(rt2x00dev, GPIO_CTRL, &reg);
-			rt2x00_set_field32(&reg, GPIO_CTRL_DIR3, 0);
-			rt2x00_set_field32(&reg, GPIO_CTRL_DIR6, 0);
-			rt2x00_set_field32(&reg, GPIO_CTRL_VAL3, 0);
-			rt2x00_set_field32(&reg, GPIO_CTRL_VAL6, 0);
-			if (ant == 0)
-				rt2x00_set_field32(&reg, GPIO_CTRL_VAL3, 1);
-			else if (ant == 1)
-				rt2x00_set_field32(&reg, GPIO_CTRL_VAL6, 1);
-			rt2800_register_write(rt2x00dev, GPIO_CTRL, reg);
-		}
-
-		/* This chip has hardware antenna diversity*/
-		if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R)) {
-			rt2800_bbp_write(rt2x00dev, 150, 0); /* Disable Antenna Software OFDM */
-			rt2800_bbp_write(rt2x00dev, 151, 0); /* Disable Antenna Software CCK */
-			rt2800_bbp_write(rt2x00dev, 154, 0); /* Clear previously selected antenna */
-		}
-
-		rt2800_bbp_read(rt2x00dev, 152, &value);
-		if (ant == 0)
-			rt2x00_set_field8(&value, BBP152_RX_DEFAULT_ANT, 1);
-		else
-			rt2x00_set_field8(&value, BBP152_RX_DEFAULT_ANT, 0);
-		rt2800_bbp_write(rt2x00dev, 152, value);
-
-		rt2800_init_freq_calibration(rt2x00dev);
-	}
-
 	for (i = 0; i < EEPROM_BBP_SIZE; i++) {
 		rt2x00_eeprom_read(rt2x00dev, EEPROM_BBP_START + i, &eeprom);
 
-- 
1.7.4.4


^ permalink raw reply related

* rt3070-based usb device won't accept mac address changes
From: Alessandro Lannocca @ 2013-05-18 15:10 UTC (permalink / raw)
  To: linux-wireless

Hi, after switching to kernel 3.8.8 (ubuntu quantal to raring), I'm
unable to change my alfa AWUS036NH mac address; a simple:

ifconfig <device> down
ifconfig <device> hw ether <random hw>

results in:

SIOCSIFHWADDR: Invalid argument

I tried the drivers shipped with the distribution,
compat-drivers-3.9-rc4-2-su and compat-drivers-2013-03-28-4-u aswell;
all to no avail.

Any help appreciated, I'm able to recompile/test if needed.

Thank you for your time.

Alessandro Lannocca

Attached 'lsusb -v' , kernel 3.8.8 x86_64

<snip>

Bus 003 Device 005: ID 148f:3070 Ralink Technology, Corp.
RT2870/RT3070 Wireless Adapter
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x148f Ralink Technology, Corp.
  idProduct          0x3070 RT2870/RT3070 Wireless Adapter
  bcdDevice            1.01
  iManufacturer           1
  iProduct                2
  iSerial                 3
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           67
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              450mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           7
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              5
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0

</snip>

^ permalink raw reply

* Re: rt3070-based usb device won't accept mac address changes
From: Bruno Randolf @ 2013-05-18 16:42 UTC (permalink / raw)
  To: Alessandro Lannocca; +Cc: linux-wireless
In-Reply-To: <CAMfPB_xTUy72YokSoYJezOX_gb54CJEd7V6+4pAfOHnAzUMJcQ@mail.gmail.com>

On 05/18/2013 04:10 PM, Alessandro Lannocca wrote:
> Hi, after switching to kernel 3.8.8 (ubuntu quantal to raring), I'm
> unable to change my alfa AWUS036NH mac address; a simple:
>
> ifconfig <device> down
> ifconfig <device> hw ether <random hw>
>
> results in:
>
> SIOCSIFHWADDR: Invalid argument
>
> I tried the drivers shipped with the distribution,
> compat-drivers-3.9-rc4-2-su and compat-drivers-2013-03-28-4-u aswell;
> all to no avail.

Hi!

I have the same problem with RT5370 (rt2800usb driver).
compat-drivers-v3.7.9-1 still works, so this must be a regression in 
kernels after 3.8...

bruno

^ permalink raw reply

* [PATCH 3.10] ath9k: prevent aggregation session deadlocks
From: Felix Fietkau @ 2013-05-18 19:28 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, mcgrof

Waiting for all subframes of an existing aggregation session to drain
before allowing mac80211 to start a new one is fragile and deadlocks
caused by this behavior have been observed.

Since mac80211 has proper synchronization for aggregation session
start/stop handling, a better approach to session handling is to simply
allow mac80211 to start a new session at any time. This requires
changing the code to discard any packets outside of the BlockAck window
in the A-MPDU software retry code.

This patch implements the above and also simplifies the code.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/ath9k.h |  14 +---
 drivers/net/wireless/ath/ath9k/main.c  |   3 +-
 drivers/net/wireless/ath/ath9k/rc.c    |   5 +-
 drivers/net/wireless/ath/ath9k/xmit.c  | 138 ++++++++++-----------------------
 4 files changed, 46 insertions(+), 114 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 366002f..42b03dc 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -251,10 +251,9 @@ struct ath_atx_tid {
 	int tidno;
 	int baw_head;   /* first un-acked tx buffer */
 	int baw_tail;   /* next unused tx buffer slot */
-	int sched;
-	int paused;
-	u8 state;
-	bool stop_cb;
+	bool sched;
+	bool paused;
+	bool active;
 };
 
 struct ath_node {
@@ -275,10 +274,6 @@ struct ath_node {
 #endif
 };
 
-#define AGGR_CLEANUP         BIT(1)
-#define AGGR_ADDBA_COMPLETE  BIT(2)
-#define AGGR_ADDBA_PROGRESS  BIT(3)
-
 struct ath_tx_control {
 	struct ath_txq *txq;
 	struct ath_node *an;
@@ -352,8 +347,7 @@ void ath_tx_tasklet(struct ath_softc *sc);
 void ath_tx_edma_tasklet(struct ath_softc *sc);
 int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
 		      u16 tid, u16 *ssn);
-bool ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid,
-		      bool flush);
+void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
 void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
 
 void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an);
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 2382d12..5092eca 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1709,7 +1709,8 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
 		flush = true;
 	case IEEE80211_AMPDU_TX_STOP_CONT:
 		ath9k_ps_wakeup(sc);
-		if (ath_tx_aggr_stop(sc, sta, tid, flush))
+		ath_tx_aggr_stop(sc, sta, tid);
+		if (!flush)
 			ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
 		ath9k_ps_restore(sc);
 		break;
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index aa4d368..7eb1f4b 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1227,10 +1227,7 @@ static bool ath_tx_aggr_check(struct ath_softc *sc, struct ieee80211_sta *sta,
 		return false;
 
 	txtid = ATH_AN_2_TID(an, tidno);
-
-	if (!(txtid->state & (AGGR_ADDBA_COMPLETE | AGGR_ADDBA_PROGRESS)))
-			return true;
-	return false;
+	return !txtid->active;
 }
 
 
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 14bb335..1c9b1ba 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -125,24 +125,6 @@ static void ath_tx_queue_tid(struct ath_txq *txq, struct ath_atx_tid *tid)
 	list_add_tail(&ac->list, &txq->axq_acq);
 }
 
-static void ath_tx_resume_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
-{
-	struct ath_txq *txq = tid->ac->txq;
-
-	WARN_ON(!tid->paused);
-
-	ath_txq_lock(sc, txq);
-	tid->paused = false;
-
-	if (skb_queue_empty(&tid->buf_q))
-		goto unlock;
-
-	ath_tx_queue_tid(txq, tid);
-	ath_txq_schedule(sc, txq);
-unlock:
-	ath_txq_unlock_complete(sc, txq);
-}
-
 static struct ath_frame_info *get_frame_info(struct sk_buff *skb)
 {
 	struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
@@ -164,20 +146,7 @@ static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta,
 			       ARRAY_SIZE(bf->rates));
 }
 
-static void ath_tx_clear_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
-{
-	tid->state &= ~AGGR_ADDBA_COMPLETE;
-	tid->state &= ~AGGR_CLEANUP;
-	if (!tid->stop_cb)
-		return;
-
-	ieee80211_start_tx_ba_cb_irqsafe(tid->an->vif, tid->an->sta->addr,
-					 tid->tidno);
-	tid->stop_cb = false;
-}
-
-static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid,
-			     bool flush_packets)
+static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
 {
 	struct ath_txq *txq = tid->ac->txq;
 	struct sk_buff *skb;
@@ -194,15 +163,16 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid,
 	while ((skb = __skb_dequeue(&tid->buf_q))) {
 		fi = get_frame_info(skb);
 		bf = fi->bf;
-		if (!bf && !flush_packets)
-			bf = ath_tx_setup_buffer(sc, txq, tid, skb);
 
 		if (!bf) {
-			ieee80211_free_txskb(sc->hw, skb);
-			continue;
+			bf = ath_tx_setup_buffer(sc, txq, tid, skb);
+			if (!bf) {
+				ieee80211_free_txskb(sc->hw, skb);
+				continue;
+			}
 		}
 
-		if (fi->retries || flush_packets) {
+		if (fi->retries) {
 			list_add_tail(&bf->list, &bf_head);
 			ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
 			ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
@@ -213,10 +183,7 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid,
 		}
 	}
 
-	if (tid->baw_head == tid->baw_tail)
-		ath_tx_clear_tid(sc, tid);
-
-	if (sendbar && !flush_packets) {
+	if (sendbar) {
 		ath_txq_unlock(sc, txq);
 		ath_send_bar(tid, tid->seq_start);
 		ath_txq_lock(sc, txq);
@@ -499,19 +466,19 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
 		tx_info = IEEE80211_SKB_CB(skb);
 		fi = get_frame_info(skb);
 
-		if (ATH_BA_ISSET(ba, ATH_BA_INDEX(seq_st, seqno))) {
+		if (!BAW_WITHIN(tid->seq_start, tid->baw_size, seqno)) {
+			/*
+			 * Outside of the current BlockAck window,
+			 * maybe part of a previous session
+			 */
+			txfail = 1;
+		} else if (ATH_BA_ISSET(ba, ATH_BA_INDEX(seq_st, seqno))) {
 			/* transmit completion, subframe is
 			 * acked by block ack */
 			acked_cnt++;
 		} else if (!isaggr && txok) {
 			/* transmit completion */
 			acked_cnt++;
-		} else if (tid->state & AGGR_CLEANUP) {
-			/*
-			 * cleanup in progress, just fail
-			 * the un-acked sub-frames
-			 */
-			txfail = 1;
 		} else if (flush) {
 			txpending = 1;
 		} else if (fi->retries < ATH_MAX_SW_RETRIES) {
@@ -535,7 +502,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
 		if (bf_next != NULL || !bf_last->bf_stale)
 			list_move_tail(&bf->list, &bf_head);
 
-		if (!txpending || (tid->state & AGGR_CLEANUP)) {
+		if (!txpending) {
 			/*
 			 * complete the acked-ones/xretried ones; update
 			 * block-ack window
@@ -609,9 +576,6 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
 		ath_txq_lock(sc, txq);
 	}
 
-	if (tid->state & AGGR_CLEANUP)
-		ath_tx_flush_tid(sc, tid, false);
-
 	rcu_read_unlock();
 
 	if (needreset)
@@ -1244,9 +1208,6 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
 	an = (struct ath_node *)sta->drv_priv;
 	txtid = ATH_AN_2_TID(an, tid);
 
-	if (txtid->state & (AGGR_CLEANUP | AGGR_ADDBA_COMPLETE))
-		return -EAGAIN;
-
 	/* update ampdu factor/density, they may have changed. This may happen
 	 * in HT IBSS when a beacon with HT-info is received after the station
 	 * has already been added.
@@ -1258,7 +1219,7 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
 		an->mpdudensity = density;
 	}
 
-	txtid->state |= AGGR_ADDBA_PROGRESS;
+	txtid->active = true;
 	txtid->paused = true;
 	*ssn = txtid->seq_start = txtid->seq_next;
 	txtid->bar_index = -1;
@@ -1269,45 +1230,17 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
 	return 0;
 }
 
-bool ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid,
-		      bool flush)
+void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid)
 {
 	struct ath_node *an = (struct ath_node *)sta->drv_priv;
 	struct ath_atx_tid *txtid = ATH_AN_2_TID(an, tid);
 	struct ath_txq *txq = txtid->ac->txq;
-	bool ret = !flush;
-
-	if (flush)
-		txtid->stop_cb = false;
-
-	if (txtid->state & AGGR_CLEANUP)
-		return false;
-
-	if (!(txtid->state & AGGR_ADDBA_COMPLETE)) {
-		txtid->state &= ~AGGR_ADDBA_PROGRESS;
-		return ret;
-	}
 
 	ath_txq_lock(sc, txq);
+	txtid->active = false;
 	txtid->paused = true;
-
-	/*
-	 * If frames are still being transmitted for this TID, they will be
-	 * cleaned up during tx completion. To prevent race conditions, this
-	 * TID can only be reused after all in-progress subframes have been
-	 * completed.
-	 */
-	if (txtid->baw_head != txtid->baw_tail) {
-		txtid->state |= AGGR_CLEANUP;
-		ret = false;
-		txtid->stop_cb = !flush;
-	} else {
-		txtid->state &= ~AGGR_ADDBA_COMPLETE;
-	}
-
-	ath_tx_flush_tid(sc, txtid, flush);
+	ath_tx_flush_tid(sc, txtid);
 	ath_txq_unlock_complete(sc, txq);
-	return ret;
 }
 
 void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc,
@@ -1371,18 +1304,28 @@ void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an)
 	}
 }
 
-void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid)
+void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta,
+			u16 tidno)
 {
-	struct ath_atx_tid *txtid;
+	struct ath_atx_tid *tid;
 	struct ath_node *an;
+	struct ath_txq *txq;
 
 	an = (struct ath_node *)sta->drv_priv;
+	tid = ATH_AN_2_TID(an, tidno);
+	txq = tid->ac->txq;
 
-	txtid = ATH_AN_2_TID(an, tid);
-	txtid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor;
-	txtid->state |= AGGR_ADDBA_COMPLETE;
-	txtid->state &= ~AGGR_ADDBA_PROGRESS;
-	ath_tx_resume_tid(sc, txtid);
+	ath_txq_lock(sc, txq);
+
+	tid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor;
+	tid->paused = false;
+
+	if (!skb_queue_empty(&tid->buf_q)) {
+		ath_tx_queue_tid(txq, tid);
+		ath_txq_schedule(sc, txq);
+	}
+
+	ath_txq_unlock_complete(sc, txq);
 }
 
 /********************/
@@ -2431,13 +2374,10 @@ void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an)
 		tid->baw_head  = tid->baw_tail = 0;
 		tid->sched     = false;
 		tid->paused    = false;
-		tid->state &= ~AGGR_CLEANUP;
+		tid->active	   = false;
 		__skb_queue_head_init(&tid->buf_q);
 		acno = TID_TO_WME_AC(tidno);
 		tid->ac = &an->ac[acno];
-		tid->state &= ~AGGR_ADDBA_COMPLETE;
-		tid->state &= ~AGGR_ADDBA_PROGRESS;
-		tid->stop_cb = false;
 	}
 
 	for (acno = 0, ac = &an->ac[acno];
@@ -2474,7 +2414,7 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an)
 		}
 
 		ath_tid_drain(sc, txq, tid);
-		ath_tx_clear_tid(sc, tid);
+		tid->active = false;
 
 		ath_txq_unlock(sc, txq);
 	}
-- 
1.8.0.2


^ permalink raw reply related

* REGRESSION: v3.10-rc1: [PATCH 04/15] brcmsmac: remove brcms_bss_cfg->associated
From: Arend van Spriel @ 2013-05-18 19:53 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linville, linux-wireless, brcm80211-dev-list
In-Reply-To: <1364085963-25940-5-git-send-email-hauke@hauke-m.de>

On 03/24/2013 01:45 AM, Hauke Mehrtens wrote:
> Replaced the usage with pub->associated.
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
>   drivers/net/wireless/brcm80211/brcmsmac/main.c |   12 +++---------
>   drivers/net/wireless/brcm80211/brcmsmac/main.h |    2 --
>   2 files changed, 3 insertions(+), 11 deletions(-)

Hi Hauke,

I had a problem with bcm43224 in STA mode and bisecting it shows this 
change as culprit. On laptop I installed kernel with brcmsmac compiled 
as module. It comes up and associates during boot, but after logging in 
there is no connectivity. Triggering reassoc gives connectivity for some 
time, but after a while (1-2 min) it stops.

I am looking into it. Given the function name below (brcms_c_ps_allowed) 
it may be power-save related. I will keep you informed.

Gr. AvS

> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
> index 90e6c0d..810b7e2 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
> @@ -3049,8 +3049,6 @@ static void brcms_b_antsel_set(struct brcms_hardware *wlc_hw, u32 antsel_avail)
>    */
>   static bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
>   {
> -	struct brcms_bss_cfg *cfg = wlc->bsscfg;
> -
>   	/* disallow PS when one of the following global conditions meets */
>   	if (!wlc->pub->associated)
>   		return false;
> @@ -3059,9 +3057,6 @@ static bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
>   	if (wlc->filter_flags & FIF_PROMISC_IN_BSS)
>   		return false;
>
> -	if (cfg->associated)
> -		return false;
> -
>   	return true;
>   }
>
> @@ -3819,7 +3814,7 @@ static void brcms_c_set_home_chanspec(struct brcms_c_info *wlc, u16 chanspec)
>   	if (wlc->home_chanspec != chanspec) {
>   		wlc->home_chanspec = chanspec;
>
> -		if (wlc->bsscfg->associated)
> +		if (wlc->pub->associated)
>   			wlc->bsscfg->current_bss->chanspec = chanspec;
>   	}
>   }
> @@ -5433,7 +5428,7 @@ static void brcms_c_ofdm_rateset_war(struct brcms_c_info *wlc)
>   	u8 r;
>   	bool war = false;
>
> -	if (wlc->bsscfg->associated)
> +	if (wlc->pub->associated)
>   		r = wlc->bsscfg->current_bss->rateset.rates[0];
>   	else
>   		r = wlc->default_bss->rateset.rates[0];
> @@ -5527,7 +5522,7 @@ int brcms_c_set_rateset(struct brcms_c_info *wlc, struct brcm_rateset *rs)
>   	/* merge rateset coming in with the current mcsset */
>   	if (wlc->pub->_n_enab & SUPPORT_11N) {
>   		struct brcms_bss_info *mcsset_bss;
> -		if (wlc->bsscfg->associated)
> +		if (wlc->pub->associated)
>   			mcsset_bss = wlc->bsscfg->current_bss;
>   		else
>   			mcsset_bss = wlc->default_bss;
> @@ -7496,7 +7491,6 @@ void brcms_c_scan_stop(struct brcms_c_info *wlc)
>   void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state)
>   {
>   	wlc->pub->associated = state;
> -	wlc->bsscfg->associated = state;
>   }
>
>   /*
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.h b/drivers/net/wireless/brcm80211/brcmsmac/main.h
> index 0cfe782..96dc2f4 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/main.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.h
> @@ -589,7 +589,6 @@ enum brcms_bss_type {
>    * type: interface type
>    * up: is this configuration up operational
>    * enable: is this configuration enabled
> - * associated: is BSS in ASSOCIATED state
>    * SSID_len: the length of SSID
>    * SSID: SSID string
>    *
> @@ -608,7 +607,6 @@ struct brcms_bss_cfg {
>   	enum brcms_bss_type type;
>   	bool up;
>   	bool enable;
> -	bool associated;
>   	u8 SSID_len;
>   	u8 SSID[IEEE80211_MAX_SSID_LEN];
>   	u8 BSSID[ETH_ALEN];
>



^ permalink raw reply

* Re: rt3070-based usb device won't accept mac address changes
From: Alessandro Lannocca @ 2013-05-18 21:07 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linux-wireless
In-Reply-To: <5197AF6B.5040800@thinktube.com>

After digging a bit into linux-stable.git I found the culprit: this
regression comes from commit #
6c50f9459e62eb133563fd23606f68bfc9d120e8 (rt2x00: Use addr_mask to
disallow invalid MAC addresses in mutli-bssid mode) ; reverting it
fixes the problem, tested by me in compat-drivers-2013-03-28-5-u .


I can't tell if reverting that commit adds any trouble as I'm not a
developer; however I'm sure you guys will know how to handle the
situation.


Alessandro Lannocca

^ permalink raw reply

* Re: REGRESSION: v3.10-rc1: [PATCH 04/15] brcmsmac: remove brcms_bss_cfg->associated
From: Jonas Gorski @ 2013-05-18 23:34 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: Hauke Mehrtens, linville, linux-wireless, brcm80211-dev-list
In-Reply-To: <5197DC4F.7030503@broadcom.com>

On Sat, May 18, 2013 at 9:53 PM, Arend van Spriel <arend@broadcom.com> wrote:
> On 03/24/2013 01:45 AM, Hauke Mehrtens wrote:
>>
>> Replaced the usage with pub->associated.
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>>   drivers/net/wireless/brcm80211/brcmsmac/main.c |   12 +++---------
>>   drivers/net/wireless/brcm80211/brcmsmac/main.h |    2 --
>>   2 files changed, 3 insertions(+), 11 deletions(-)
>
>
> Hi Hauke,
>
> I had a problem with bcm43224 in STA mode and bisecting it shows this change
> as culprit. On laptop I installed kernel with brcmsmac compiled as module.
> It comes up and associates during boot, but after logging in there is no
> connectivity. Triggering reassoc gives connectivity for some time, but after
> a while (1-2 min) it stops.
>
> I am looking into it. Given the function name below (brcms_c_ps_allowed) it
> may be power-save related. I will keep you informed.

Looking at the (old) code;
static bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
{
        return false;
}

should restore the old behavior.

As for this actual old code:
static bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
{
       struct brcms_bss_cfg *cfg = wlc->bsscfg;

        /* disallow PS when one of the following global conditions meets */
        if (!wlc->pub->associated)
                return false;

        /* disallow PS when one of these meets when not scanning */
        if (wlc->filter_flags & FIF_PROMISC_IN_BSS)
                return false;

        if (cfg->associated)
                return false;

        return true;
}

The only way to return true here is if wlc->pub->associated == true
and cfg->associated == false, but the only place setting these is/was
brcms_c_associate_upd() which sets both to the same value. Therefore
the code will always return false.

Hauke's change made it possible for the code to return true, which
looks at a first glance what might have been originally intended here,
and the bug is somewhere else. But what do I know, I'm no Broadcom
engineer ;-)


Jonas

^ permalink raw reply

* [PATCH 0/3] Work on STBC Rx monitoring
From: Oleksij Rempel @ 2013-05-19  7:38 UTC (permalink / raw)
  To: ath9k-devel, linux-wireless; +Cc: Oleksij Rempel

This patch set will pass RxSTBC flags from ath9k to ieee80211
and to radiotap.
This field is now a part of radiotap specification:
http://www.radiotap.org/defined-fields/MCS

Oleksij Rempel (3):
  mac80211: add STBC flag for radiotap
  ath9k: remove useless flag conversation.
  ath9k: check for Rx-STBC flag and pass it to ieee80211

 drivers/net/wireless/ath/ath9k/ar9003_mac.c |  5 +++--
 drivers/net/wireless/ath/ath9k/mac.c        | 16 ++++++++++++----
 drivers/net/wireless/ath/ath9k/mac.h        |  4 +++-
 drivers/net/wireless/ath/ath9k/recv.c       |  5 +----
 include/net/ieee80211_radiotap.h            |  7 +++++++
 include/net/mac80211.h                      |  4 ++++
 net/mac80211/main.c                         |  3 ++-
 net/mac80211/rx.c                           |  4 ++++
 net/mac80211/status.c                       |  3 ++-
 9 files changed, 38 insertions(+), 13 deletions(-)

-- 
1.8.1.2


^ permalink raw reply

* [PATCH 2/3] ath9k: remove useless flag conversation.
From: Oleksij Rempel @ 2013-05-19  7:38 UTC (permalink / raw)
  To: ath9k-devel, linux-wireless; +Cc: Oleksij Rempel
In-Reply-To: <1368949136-6079-1-git-send-email-linux@rempel-privat.de>

some flags used only outside of ath9k - In this case we can use
"enum mac80211_rx_flags" and pass it upstream without extra
conversation.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/net/wireless/ath/ath9k/ar9003_mac.c |  5 +++--
 drivers/net/wireless/ath/ath9k/mac.c        | 11 +++++++----
 drivers/net/wireless/ath/ath9k/mac.h        |  1 +
 drivers/net/wireless/ath/ath9k/recv.c       |  5 +----
 4 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
index 301bf72..5163abd 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
@@ -469,6 +469,7 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
 
 	rxs->rs_status = 0;
 	rxs->rs_flags =  0;
+	rxs->flag =  0;
 
 	rxs->rs_datalen = rxsp->status2 & AR_DataLen;
 	rxs->rs_tstamp =  rxsp->status3;
@@ -493,8 +494,8 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
 	rxs->rs_isaggr = (rxsp->status11 & AR_RxAggr) ? 1 : 0;
 	rxs->rs_moreaggr = (rxsp->status11 & AR_RxMoreAggr) ? 1 : 0;
 	rxs->rs_antenna = (MS(rxsp->status4, AR_RxAntenna) & 0x7);
-	rxs->rs_flags  = (rxsp->status4 & AR_GI) ? ATH9K_RX_GI : 0;
-	rxs->rs_flags  |= (rxsp->status4 & AR_2040) ? ATH9K_RX_2040 : 0;
+	rxs->flag  |= (rxsp->status4 & AR_GI) ? RX_FLAG_SHORT_GI : 0;
+	rxs->flag  |= (rxsp->status4 & AR_2040) ? RX_FLAG_40MHZ : 0;
 
 	rxs->evm0 = rxsp->status6;
 	rxs->evm1 = rxsp->status7;
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 498fee0..a52081d 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -547,6 +547,7 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 
 	rs->rs_status = 0;
 	rs->rs_flags = 0;
+	rs->flag = 0;
 
 	rs->rs_datalen = ads.ds_rxstatus1 & AR_DataLen;
 	rs->rs_tstamp = ads.AR_RcvTimestamp;
@@ -586,10 +587,12 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 	rs->rs_moreaggr =
 		(ads.ds_rxstatus8 & AR_RxMoreAggr) ? 1 : 0;
 	rs->rs_antenna = MS(ads.ds_rxstatus3, AR_RxAntenna);
-	rs->rs_flags =
-		(ads.ds_rxstatus3 & AR_GI) ? ATH9K_RX_GI : 0;
-	rs->rs_flags |=
-		(ads.ds_rxstatus3 & AR_2040) ? ATH9K_RX_2040 : 0;
+
+	/* directly mapped flags for ieee80211_rx_status */
+	rs->flag |=
+		(ads.ds_rxstatus3 & AR_GI) ? RX_FLAG_SHORT_GI : 0;
+	rs->flag |=
+		(ads.ds_rxstatus3 & AR_2040) ? RX_FLAG_40MHZ : 0;
 
 	if (ads.ds_rxstatus8 & AR_PreDelimCRCErr)
 		rs->rs_flags |= ATH9K_RX_DELIM_CRC_PRE;
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index 5865f92..3f1e775 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -149,6 +149,7 @@ struct ath_rx_status {
 	u32 evm2;
 	u32 evm3;
 	u32 evm4;
+	u32 flag; /* see enum mac80211_rx_flags */
 };
 
 struct ath_htc_rx_status {
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 8be2b5d..b4b758d 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -868,10 +868,7 @@ static int ath9k_process_rate(struct ath_common *common,
 	if (rx_stats->rs_rate & 0x80) {
 		/* HT rate */
 		rxs->flag |= RX_FLAG_HT;
-		if (rx_stats->rs_flags & ATH9K_RX_2040)
-			rxs->flag |= RX_FLAG_40MHZ;
-		if (rx_stats->rs_flags & ATH9K_RX_GI)
-			rxs->flag |= RX_FLAG_SHORT_GI;
+		rxs->flag |= rx_stats->flag;
 		rxs->rate_idx = rx_stats->rs_rate & 0x7f;
 		return 0;
 	}
-- 
1.8.1.2


^ permalink raw reply related

* [PATCH 1/3] mac80211: add STBC flag for radiotap
From: Oleksij Rempel @ 2013-05-19  7:38 UTC (permalink / raw)
  To: ath9k-devel, linux-wireless; +Cc: Oleksij Rempel
In-Reply-To: <1368949136-6079-1-git-send-email-linux@rempel-privat.de>

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 include/net/ieee80211_radiotap.h | 7 +++++++
 include/net/mac80211.h           | 4 ++++
 net/mac80211/main.c              | 3 ++-
 net/mac80211/rx.c                | 4 ++++
 net/mac80211/status.c            | 3 ++-
 5 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index c399963..c6d07cb 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -269,6 +269,7 @@ enum ieee80211_radiotap_type {
 #define IEEE80211_RADIOTAP_MCS_HAVE_GI		0x04
 #define IEEE80211_RADIOTAP_MCS_HAVE_FMT		0x08
 #define IEEE80211_RADIOTAP_MCS_HAVE_FEC		0x10
+#define IEEE80211_RADIOTAP_MCS_HAVE_STBC	0x20
 
 #define IEEE80211_RADIOTAP_MCS_BW_MASK		0x03
 #define		IEEE80211_RADIOTAP_MCS_BW_20	0
@@ -278,6 +279,12 @@ enum ieee80211_radiotap_type {
 #define IEEE80211_RADIOTAP_MCS_SGI		0x04
 #define IEEE80211_RADIOTAP_MCS_FMT_GF		0x08
 #define IEEE80211_RADIOTAP_MCS_FEC_LDPC		0x10
+#define IEEE80211_RADIOTAP_MCS_STBC_MASK	0x60
+#define		IEEE80211_RADIOTAP_MCS_STBC_1	1
+#define		IEEE80211_RADIOTAP_MCS_STBC_2	2
+#define		IEEE80211_RADIOTAP_MCS_STBC_3	3
+
+#define IEEE80211_RADIOTAP_MCS_STBC_SHIFT	5
 
 /* For IEEE80211_RADIOTAP_AMPDU_STATUS */
 #define IEEE80211_RADIOTAP_AMPDU_REPORT_ZEROLEN		0x0001
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 885898a..16705a9 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -805,6 +805,7 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
  *	on this subframe
  * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC
  *	is stored in the @ampdu_delimiter_crc field)
+ * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3
  */
 enum mac80211_rx_flags {
 	RX_FLAG_MMIC_ERROR		= BIT(0),
@@ -832,8 +833,11 @@ enum mac80211_rx_flags {
 	RX_FLAG_80MHZ			= BIT(23),
 	RX_FLAG_80P80MHZ		= BIT(24),
 	RX_FLAG_160MHZ			= BIT(25),
+	RX_FLAG_STBC_MASK		= BIT(26) | BIT(27),
 };
 
+#define RX_FLAG_STBC_SHIFT		26
+
 /**
  * struct ieee80211_rx_status - receive status
  *
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 8a7bfc4..44191a3 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -589,7 +589,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
 	local->hw.conf.short_frame_max_tx_count = wiphy->retry_short;
 	local->hw.radiotap_mcs_details = IEEE80211_RADIOTAP_MCS_HAVE_MCS |
 					 IEEE80211_RADIOTAP_MCS_HAVE_GI |
-					 IEEE80211_RADIOTAP_MCS_HAVE_BW;
+					 IEEE80211_RADIOTAP_MCS_HAVE_BW |
+					 IEEE80211_RADIOTAP_MCS_HAVE_STBC;
 	local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI |
 					 IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH;
 	local->hw.uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES;
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 8e29526..22bb2af 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -258,6 +258,7 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 	pos += 2;
 
 	if (status->flag & RX_FLAG_HT) {
+		unsigned int stbc = status->flag & RX_FLAG_STBC_MASK;
 		rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_MCS);
 		*pos++ = local->hw.radiotap_mcs_details;
 		*pos = 0;
@@ -267,6 +268,9 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 			*pos |= IEEE80211_RADIOTAP_MCS_BW_40;
 		if (status->flag & RX_FLAG_HT_GF)
 			*pos |= IEEE80211_RADIOTAP_MCS_FMT_GF;
+		if (stbc)
+			*pos |= (stbc >> RX_FLAG_STBC_SHIFT)
+					<< IEEE80211_RADIOTAP_MCS_STBC_SHIFT;
 		pos++;
 		*pos++ = status->rate_idx;
 	}
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 4343920..41143f8 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -312,7 +312,8 @@ static void ieee80211_add_tx_radiotap_header(struct ieee80211_supported_band
 		rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_MCS);
 		pos[0] = IEEE80211_RADIOTAP_MCS_HAVE_MCS |
 			 IEEE80211_RADIOTAP_MCS_HAVE_GI |
-			 IEEE80211_RADIOTAP_MCS_HAVE_BW;
+			 IEEE80211_RADIOTAP_MCS_HAVE_BW |
+			 IEEE80211_RADIOTAP_MCS_HAVE_STBC;
 		if (info->status.rates[0].flags & IEEE80211_TX_RC_SHORT_GI)
 			pos[1] |= IEEE80211_RADIOTAP_MCS_SGI;
 		if (info->status.rates[0].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
-- 
1.8.1.2


^ permalink raw reply related

* [PATCH 3/3] ath9k: check for Rx-STBC flag and pass it to ieee80211
From: Oleksij Rempel @ 2013-05-19  7:38 UTC (permalink / raw)
  To: ath9k-devel, linux-wireless; +Cc: Oleksij Rempel
In-Reply-To: <1368949136-6079-1-git-send-email-linux@rempel-privat.de>

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/net/wireless/ath/ath9k/mac.c | 5 +++++
 drivers/net/wireless/ath/ath9k/mac.h | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index a52081d..d055e38 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -593,6 +593,11 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 		(ads.ds_rxstatus3 & AR_GI) ? RX_FLAG_SHORT_GI : 0;
 	rs->flag |=
 		(ads.ds_rxstatus3 & AR_2040) ? RX_FLAG_40MHZ : 0;
+	if (AR_SREV_9280_20_OR_LATER(ah))
+		rs->flag |=
+			(ads.ds_rxstatus3 & AR_STBC) ?
+				/* we can only Nss=1 STBC */
+				(1 << RX_FLAG_STBC_SHIFT) : 0;
 
 	if (ads.ds_rxstatus8 & AR_PreDelimCRCErr)
 		rs->rs_flags |= ATH9K_RX_DELIM_CRC_PRE;
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index 3f1e775..b02dfce 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -534,7 +534,8 @@ struct ar5416_desc {
 #define AR_2040             0x00000002
 #define AR_Parallel40       0x00000004
 #define AR_Parallel40_S     2
-#define AR_RxStatusRsvd30   0x000000f8
+#define AR_STBC             0x00000008 /* on ar9280 and later */
+#define AR_RxStatusRsvd30   0x000000f0
 #define AR_RxAntenna	    0xffffff00
 #define AR_RxAntenna_S	    8
 
-- 
1.8.1.2


^ permalink raw reply related

* Re: REGRESSION: v3.10-rc1: [PATCH 04/15] brcmsmac: remove brcms_bss_cfg->associated
From: Arend van Spriel @ 2013-05-19  8:21 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linville, linux-wireless, brcm80211-dev-list
In-Reply-To: <5197DC4F.7030503@broadcom.com>

On 05/18/2013 09:53 PM, Arend van Spriel wrote:
> On 03/24/2013 01:45 AM, Hauke Mehrtens wrote:
>> Replaced the usage with pub->associated.
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>>   drivers/net/wireless/brcm80211/brcmsmac/main.c |   12 +++---------
>>   drivers/net/wireless/brcm80211/brcmsmac/main.h |    2 --
>>   2 files changed, 3 insertions(+), 11 deletions(-)
>
> Hi Hauke,
>
> I had a problem with bcm43224 in STA mode and bisecting it shows this
> change as culprit. On laptop I installed kernel with brcmsmac compiled
> as module. It comes up and associates during boot, but after logging in
> there is no connectivity. Triggering reassoc gives connectivity for some
> time, but after a while (1-2 min) it stops.
>
> I am looking into it. Given the function name below (brcms_c_ps_allowed)
> it may be power-save related. I will keep you informed.
>
> Gr. AvS
>
>> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c
>> b/drivers/net/wireless/brcm80211/brcmsmac/main.c
>> index 90e6c0d..810b7e2 100644
>> --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
>> +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
>> @@ -3049,8 +3049,6 @@ static void brcms_b_antsel_set(struct
>> brcms_hardware *wlc_hw, u32 antsel_avail)
>>    */
>>   static bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
>>   {
>> -    struct brcms_bss_cfg *cfg = wlc->bsscfg;
>> -
>>       /* disallow PS when one of the following global conditions meets */
>>       if (!wlc->pub->associated)
>>           return false;
>> @@ -3059,9 +3057,6 @@ static bool brcms_c_ps_allowed(struct
>> brcms_c_info *wlc)
>>       if (wlc->filter_flags & FIF_PROMISC_IN_BSS)
>>           return false;
>>
>> -    if (cfg->associated)
>> -        return false;
>> -

wlc->pub->associated and wlc->bsscfg->associated have the same value, 
which I guess was your motivation to remove it from struct 
brcms_bss_cfg. So before this patch the function brcms_c_ps_allowed() 
always returned false. As power-save is a unsupported feature for 
brcmsmac that was fine, but the removal below changed that behaviour.

As power-save is not supported this function can be changed to simply 
return false for now. I will send out a patch for that.

Regards,
Arend

>>       return true;
>>   }
>>
>> @@ -3819,7 +3814,7 @@ static void brcms_c_set_home_chanspec(struct
>> brcms_c_info *wlc, u16 chanspec)
>>       if (wlc->home_chanspec != chanspec) {
>>           wlc->home_chanspec = chanspec;
>>
>> -        if (wlc->bsscfg->associated)
>> +        if (wlc->pub->associated)
>>               wlc->bsscfg->current_bss->chanspec = chanspec;
>>       }
>>   }
>> @@ -5433,7 +5428,7 @@ static void brcms_c_ofdm_rateset_war(struct
>> brcms_c_info *wlc)
>>       u8 r;
>>       bool war = false;
>>
>> -    if (wlc->bsscfg->associated)
>> +    if (wlc->pub->associated)
>>           r = wlc->bsscfg->current_bss->rateset.rates[0];
>>       else
>>           r = wlc->default_bss->rateset.rates[0];
>> @@ -5527,7 +5522,7 @@ int brcms_c_set_rateset(struct brcms_c_info
>> *wlc, struct brcm_rateset *rs)
>>       /* merge rateset coming in with the current mcsset */
>>       if (wlc->pub->_n_enab & SUPPORT_11N) {
>>           struct brcms_bss_info *mcsset_bss;
>> -        if (wlc->bsscfg->associated)
>> +        if (wlc->pub->associated)
>>               mcsset_bss = wlc->bsscfg->current_bss;
>>           else
>>               mcsset_bss = wlc->default_bss;
>> @@ -7496,7 +7491,6 @@ void brcms_c_scan_stop(struct brcms_c_info *wlc)
>>   void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state)
>>   {
>>       wlc->pub->associated = state;
>> -    wlc->bsscfg->associated = state;
>>   }
>>
>>   /*
>> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.h
>> b/drivers/net/wireless/brcm80211/brcmsmac/main.h
>> index 0cfe782..96dc2f4 100644
>> --- a/drivers/net/wireless/brcm80211/brcmsmac/main.h
>> +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.h
>> @@ -589,7 +589,6 @@ enum brcms_bss_type {
>>    * type: interface type
>>    * up: is this configuration up operational
>>    * enable: is this configuration enabled
>> - * associated: is BSS in ASSOCIATED state
>>    * SSID_len: the length of SSID
>>    * SSID: SSID string
>>    *
>> @@ -608,7 +607,6 @@ struct brcms_bss_cfg {
>>       enum brcms_bss_type type;
>>       bool up;
>>       bool enable;
>> -    bool associated;
>>       u8 SSID_len;
>>       u8 SSID[IEEE80211_MAX_SSID_LEN];
>>       u8 BSSID[ETH_ALEN];
>>
>



^ permalink raw reply

* Re: REGRESSION: v3.10-rc1: [PATCH 04/15] brcmsmac: remove brcms_bss_cfg->associated
From: Arend van Spriel @ 2013-05-19  8:31 UTC (permalink / raw)
  To: Jonas Gorski; +Cc: Hauke Mehrtens, linville, linux-wireless, brcm80211-dev-list
In-Reply-To: <CAOiHx=nJ=2zeN1wb=GTzk+hr=vYXAUvxpVAK7rt7M40PrvvBDg@mail.gmail.com>

On 05/19/2013 01:34 AM, Jonas Gorski wrote:
> Hauke's change made it possible for the code to return true, which
> looks at a first glance what might have been originally intended here,
> and the bug is somewhere else. But what do I know, I'm no Broadcom
> engineer;-)

Point taken :-) The function seems rather useless in brcmsmac, but I 
would like to keep it so we can use internal driver source as reference 
when adding power-save support.

Regards,
Arend


^ permalink raw reply

* Re: REGRESSION: v3.10-rc1: [PATCH 04/15] brcmsmac: remove brcms_bss_cfg->associated
From: Hauke Mehrtens @ 2013-05-19 10:24 UTC (permalink / raw)
  To: Arend van Spriel; +Cc: linville, linux-wireless, brcm80211-dev-list
In-Reply-To: <51988B8F.7010205@broadcom.com>

On 05/19/2013 10:21 AM, Arend van Spriel wrote:
> On 05/18/2013 09:53 PM, Arend van Spriel wrote:
>> On 03/24/2013 01:45 AM, Hauke Mehrtens wrote:
>>> Replaced the usage with pub->associated.
>>>
>>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>>> ---
>>>   drivers/net/wireless/brcm80211/brcmsmac/main.c |   12 +++---------
>>>   drivers/net/wireless/brcm80211/brcmsmac/main.h |    2 --
>>>   2 files changed, 3 insertions(+), 11 deletions(-)
>>
>> Hi Hauke,
>>
>> I had a problem with bcm43224 in STA mode and bisecting it shows this
>> change as culprit. On laptop I installed kernel with brcmsmac compiled
>> as module. It comes up and associates during boot, but after logging in
>> there is no connectivity. Triggering reassoc gives connectivity for some
>> time, but after a while (1-2 min) it stops.
>>
>> I am looking into it. Given the function name below (brcms_c_ps_allowed)
>> it may be power-save related. I will keep you informed.
>>
>> Gr. AvS
>>
>>> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c
>>> b/drivers/net/wireless/brcm80211/brcmsmac/main.c
>>> index 90e6c0d..810b7e2 100644
>>> --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
>>> +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
>>> @@ -3049,8 +3049,6 @@ static void brcms_b_antsel_set(struct
>>> brcms_hardware *wlc_hw, u32 antsel_avail)
>>>    */
>>>   static bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
>>>   {
>>> -    struct brcms_bss_cfg *cfg = wlc->bsscfg;
>>> -
>>>       /* disallow PS when one of the following global conditions
>>> meets */
>>>       if (!wlc->pub->associated)
>>>           return false;
>>> @@ -3059,9 +3057,6 @@ static bool brcms_c_ps_allowed(struct
>>> brcms_c_info *wlc)
>>>       if (wlc->filter_flags & FIF_PROMISC_IN_BSS)
>>>           return false;
>>>
>>> -    if (cfg->associated)
>>> -        return false;
>>> -
> 
> wlc->pub->associated and wlc->bsscfg->associated have the same value,
> which I guess was your motivation to remove it from struct
> brcms_bss_cfg. So before this patch the function brcms_c_ps_allowed()
> always returned false. As power-save is a unsupported feature for
> brcmsmac that was fine, but the removal below changed that behaviour.

The change in the behavior was not intended. I removed
wlc->bsscfg->associated because it always had the same value as
wlc->pub->associated. I must have missed that one the if conditions was
negated. When multi bssid support will be added to brcmsmac this
complete handling has to be reworked.

> As power-save is not supported this function can be changed to simply
> return false for now. I will send out a patch for that.

Thanks for making such a patch.

> Regards,
> Arend
> 
>>>       return true;
>>>   }
>>>
>>> @@ -3819,7 +3814,7 @@ static void brcms_c_set_home_chanspec(struct
>>> brcms_c_info *wlc, u16 chanspec)
>>>       if (wlc->home_chanspec != chanspec) {
>>>           wlc->home_chanspec = chanspec;
>>>
>>> -        if (wlc->bsscfg->associated)
>>> +        if (wlc->pub->associated)
>>>               wlc->bsscfg->current_bss->chanspec = chanspec;
>>>       }
>>>   }
>>> @@ -5433,7 +5428,7 @@ static void brcms_c_ofdm_rateset_war(struct
>>> brcms_c_info *wlc)
>>>       u8 r;
>>>       bool war = false;
>>>
>>> -    if (wlc->bsscfg->associated)
>>> +    if (wlc->pub->associated)
>>>           r = wlc->bsscfg->current_bss->rateset.rates[0];
>>>       else
>>>           r = wlc->default_bss->rateset.rates[0];
>>> @@ -5527,7 +5522,7 @@ int brcms_c_set_rateset(struct brcms_c_info
>>> *wlc, struct brcm_rateset *rs)
>>>       /* merge rateset coming in with the current mcsset */
>>>       if (wlc->pub->_n_enab & SUPPORT_11N) {
>>>           struct brcms_bss_info *mcsset_bss;
>>> -        if (wlc->bsscfg->associated)
>>> +        if (wlc->pub->associated)
>>>               mcsset_bss = wlc->bsscfg->current_bss;
>>>           else
>>>               mcsset_bss = wlc->default_bss;
>>> @@ -7496,7 +7491,6 @@ void brcms_c_scan_stop(struct brcms_c_info *wlc)
>>>   void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state)
>>>   {
>>>       wlc->pub->associated = state;
>>> -    wlc->bsscfg->associated = state;
>>>   }
>>>
>>>   /*
>>> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.h
>>> b/drivers/net/wireless/brcm80211/brcmsmac/main.h
>>> index 0cfe782..96dc2f4 100644
>>> --- a/drivers/net/wireless/brcm80211/brcmsmac/main.h
>>> +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.h
>>> @@ -589,7 +589,6 @@ enum brcms_bss_type {
>>>    * type: interface type
>>>    * up: is this configuration up operational
>>>    * enable: is this configuration enabled
>>> - * associated: is BSS in ASSOCIATED state
>>>    * SSID_len: the length of SSID
>>>    * SSID: SSID string
>>>    *
>>> @@ -608,7 +607,6 @@ struct brcms_bss_cfg {
>>>       enum brcms_bss_type type;
>>>       bool up;
>>>       bool enable;
>>> -    bool associated;
>>>       u8 SSID_len;
>>>       u8 SSID[IEEE80211_MAX_SSID_LEN];
>>>       u8 BSSID[ETH_ALEN];
>>>
>>
> 
> 


^ permalink raw reply

* [PATCH] backports: defconfig for rtlwifi family
From: Larry Finger @ 2013-05-19 16:15 UTC (permalink / raw)
  To: mcgrof; +Cc: linux-wireless


Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>

Index: backports-3.10-rc1-1/defconfigs/rtlwifi
===================================================================
--- /dev/null
+++ backports-3.10-rc1-1/defconfigs/rtlwifi
@@ -0,0 +1,20 @@
+CPTCFG_CFG80211=m
+CPTCFG_CFG80211_DEFAULT_PS=y
+CPTCFG_CFG80211_DEBUGFS=y
+CPTCFG_MAC80211=m
+# CPTCFG_MAC80211_RC_PID is not set
+# CPTCFG_MAC80211_RC_MINSTREL is not set
+# CPTCFG_MAC80211_RC_DEFAULT_MINSTREL is not set
+CPTCFG_MAC80211_DEBUGFS=y
+CPTCFG_MAC80211_MESSAGE_TRACING=y
+CPTCFG_WLAN=y
+CPTCFG_RTLWIFI=m
+CPTCFG_RTLWIFI_DEBUG=y
+CPTCFG_RTL8192CE=m
+CPTCFG_RTL8192SE=m
+CPTCFG_RTL8192DE=m
+CPTCFG_RTL8723AE=m
+CPTCFG_RTL8188EE=m
+CPTCFG_RTL8192CU=m
+CPTCFG_RTL8192C_COMMON=m
+

^ permalink raw reply

* [PATCH] backports: Fix menuconfig build
From: Larry Finger @ 2013-05-19 16:27 UTC (permalink / raw)
  To: mcgrof; +Cc: linux-wireless

Using openSUSE 12.3 with x86_64 architecture, the 'make menuconfig'
command results in the following:

finger@larrylap:~/backports-3.10-rc1-1> make menuconfig
cc -Wl,--no-as-needed -lncurses  mconf.o zconf.tab.o lxdialog/checklist.o lxdialog/inputbox.o lxdialog/menubox.o lxdialog/textbox.o lxdialog/util.o lxdialog/yesno.o   -o mconf
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: /lib64/libncurses.so.5: undefined reference to symbol 'acs_map'
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: note: 'acs_map' is defined in DSO /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../lib64/libtinfo.so so try adding it to the linker command line
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../lib64/libtinfo.so: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [mconf] Error 1
make[1]: *** [menuconfig] Error 2
make: *** [menuconfig] Error 2
finger@larrylap:~/backports-3.10-rc1-1>

When "-ltinfo" is added to the LDFLAGS symbol as suggested by the linker,
it builds and runs correctly.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>

Index: backports-3.10-rc1-1/kconfig/Makefile
===================================================================
--- backports-3.10-rc1-1.orig/kconfig/Makefile
+++ backports-3.10-rc1-1/kconfig/Makefile
@@ -3,7 +3,7 @@ CFLAGS=-Wall -Wmissing-prototypes -Wstri
 LXDIALOG := lxdialog/checklist.o lxdialog/inputbox.o lxdialog/menubox.o lxdialog/textbox.o lxdialog/util.o lxdialog/yesno.o
 
 conf: conf.o zconf.tab.o
-mconf: LDFLAGS = -Wl,--no-as-needed -lncurses
+mconf: LDFLAGS = -Wl,--no-as-needed -lncurses -ltinfo
 mconf: CFLAGS += -DCURSES_LOC="<ncurses.h>" -DLOCALE
 mconf: mconf.o zconf.tab.o $(LXDIALOG)
 

^ permalink raw reply

* [PATCH 1/2 V2] backports: Fix menuconfig build
From: Larry Finger @ 2013-05-19 16:43 UTC (permalink / raw)
  To: mcgrof; +Cc: linux-wireless, Larry Finger

Using openSUSE 12.3 with x86_64 architecture, the 'make menuconfig'
command results in the following:

finger@larrylap:~/backports-3.10-rc1-1> make menuconfig
cc -Wl,--no-as-needed -lncurses  mconf.o zconf.tab.o lxdialog/checklist.o lxdialog/inputbox.o lxdialog/menubox.o lxdialog/textbox.o lxdialog/util.o lxdialog/yesno.o   -o mconf
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: /lib64/libncurses.so.5: undefined reference to symbol 'acs_map'
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: note: 'acs_map' is defined in DSO /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../lib64/libtinfo.so so try adding it to the linker command line
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../lib64/libtinfo.so: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [mconf] Error 1
make[1]: *** [menuconfig] Error 2
make: *** [menuconfig] Error 2
finger@larrylap:~/backports-3.10-rc1-1>

When "-ltinfo" is added to the LDFLAGS symbol as suggested by the linker,
it builds and runs correctly.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

V2 in the proper format for git repository

Larry
---

 backport/kconfig/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backport/kconfig/Makefile b/backport/kconfig/Makefile
index 5974e48..ff5c270 100644
--- a/backport/kconfig/Makefile
+++ b/backport/kconfig/Makefile
@@ -3,7 +3,7 @@ CFLAGS=-Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
 LXDIALOG := lxdialog/checklist.o lxdialog/inputbox.o lxdialog/menubox.o lxdialog/textbox.o lxdialog/util.o lxdialog/yesno.o
 
 conf: conf.o zconf.tab.o
-mconf: LDFLAGS = -Wl,--no-as-needed -lncurses
+mconf: LDFLAGS = -Wl,--no-as-needed -lncurses -ltinfo
 mconf: CFLAGS += -DCURSES_LOC="<ncurses.h>" -DLOCALE
 mconf: mconf.o zconf.tab.o $(LXDIALOG)
 
-- 
1.8.1.4


^ permalink raw reply related

* [PATCH 2/2] backports: defconfig for rtlwifi family
From: Larry Finger @ 2013-05-19 16:43 UTC (permalink / raw)
  To: mcgrof; +Cc: linux-wireless, Larry Finger
In-Reply-To: <1368981836-6247-1-git-send-email-Larry.Finger@lwfinger.net>

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

V2 in proper format for git repo

Larry

 backport/defconfigs/rtlwifi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 backport/defconfigs/rtlwifi

diff --git a/backport/defconfigs/rtlwifi b/backport/defconfigs/rtlwifi
new file mode 100644
index 0000000..c86d000
--- /dev/null
+++ b/backport/defconfigs/rtlwifi
@@ -0,0 +1,19 @@
+CPTCFG_CFG80211=m
+CPTCFG_CFG80211_DEFAULT_PS=y
+CPTCFG_CFG80211_DEBUGFS=y
+CPTCFG_MAC80211=m
+# CPTCFG_MAC80211_RC_PID is not set
+# CPTCFG_MAC80211_RC_MINSTREL is not set
+# CPTCFG_MAC80211_RC_DEFAULT_MINSTREL is not set
+CPTCFG_MAC80211_DEBUGFS=y
+CPTCFG_MAC80211_MESSAGE_TRACING=y
+CPTCFG_WLAN=y
+CPTCFG_RTLWIFI=m
+CPTCFG_RTLWIFI_DEBUG=y
+CPTCFG_RTL8192CE=m
+CPTCFG_RTL8192SE=m
+CPTCFG_RTL8192DE=m
+CPTCFG_RTL8723AE=m
+CPTCFG_RTL8188EE=m
+CPTCFG_RTL8192CU=m
+CPTCFG_RTL8192C_COMMON=m
-- 
1.8.1.4


^ permalink raw reply related

* Re: [PATCH 1/2 V2] backports: Fix menuconfig build
From: Luis R. Rodriguez @ 2013-05-19 21:22 UTC (permalink / raw)
  To: Larry Finger; +Cc: Luis R. Rodriguez, linux-wireless, backports@vger.kernel.org
In-Reply-To: <1368981836-6247-1-git-send-email-Larry.Finger@lwfinger.net>

On Sun, May 19, 2013 at 9:43 AM, Larry Finger <Larry.Finger@lwfinger.net> wrote:
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>

Thanks Larry, applied and pushed! Also kicked out a new release with these:

https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.10-rc1/backports-3.10-rc1-2.tar.bz2

  Luis

^ permalink raw reply

* Re: [PATCH 1/2 V2] backports: Fix menuconfig build
From: Luis R. Rodriguez @ 2013-05-19 21:22 UTC (permalink / raw)
  To: Larry Finger; +Cc: Luis R. Rodriguez, linux-wireless, backports@vger.kernel.org
In-Reply-To: <CAB=NE6VxqKBeQReqaNS4CJKt5qk65d5UBPaha_kODSF=W0Qcvw@mail.gmail.com>

On Sun, May 19, 2013 at 2:22 PM, Luis R. Rodriguez
<mcgrof@do-not-panic.com> wrote:
> On Sun, May 19, 2013 at 9:43 AM, Larry Finger <Larry.Finger@lwfinger.net> wrote:
>> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>
> Thanks Larry, applied and pushed! Also kicked out a new release with these:
>
> https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.10-rc1/backports-3.10-rc1-2.tar.bz2

I forgot to mention, please Cc backports list for patches, whether or
not other lists get Cc'd is up to you.

  Luis

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox