linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/10] wlcore: fix sparse warnings related to static functions
@ 2012-05-15 14:08 Arik Nemtsov
  2012-05-15 14:08 ` [PATCH 02/10] wlcore: use the original elp time in forced_ps mode Arik Nemtsov
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Arik Nemtsov @ 2012-05-15 14:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho, Arik Nemtsov

The "static" modifier was mistakenly forgotten for some functions.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
These patches apply on top of the wl18xx support series.

 drivers/net/wireless/ti/wl18xx/main.c |    2 +-
 drivers/net/wireless/ti/wlcore/main.c |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index f1fef39..d7e48db 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -1097,7 +1097,7 @@ static struct ieee80211_sta_ht_cap wl18xx_mimo_ht_cap = {
 		},
 };
 
-int __devinit wl18xx_probe(struct platform_device *pdev)
+static int __devinit wl18xx_probe(struct platform_device *pdev)
 {
 	struct wl1271 *wl;
 	struct ieee80211_hw *hw;
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index f4b036e..659634b 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -1212,7 +1212,8 @@ static struct sk_buff *wl12xx_alloc_dummy_packet(struct wl1271 *wl)
 
 
 #ifdef CONFIG_PM
-int wl1271_validate_wowlan_pattern(struct cfg80211_wowlan_trig_pkt_pattern *p)
+static int wl1271_validate_wowlan_pattern(
+	struct cfg80211_wowlan_trig_pkt_pattern *p)
 {
 	int num_fields = 0, in_field = 0, fields_size = 0;
 	int i, pattern_len = 0;
@@ -1355,7 +1356,7 @@ void wl1271_rx_filter_flatten_fields(struct wl12xx_rx_filter *filter,
  * Allocates an RX filter returned through f
  * which needs to be freed using rx_filter_free()
  */
-int wl1271_convert_wowlan_pattern_to_rx_filter(
+static int wl1271_convert_wowlan_pattern_to_rx_filter(
 	struct cfg80211_wowlan_trig_pkt_pattern *p,
 	struct wl12xx_rx_filter **f)
 {
@@ -4820,7 +4821,7 @@ static struct bin_attribute fwlog_attr = {
 	.read = wl1271_sysfs_read_fwlog,
 };
 
-void wl1271_connection_loss_work(struct work_struct *work)
+static void wl1271_connection_loss_work(struct work_struct *work)
 {
 	struct delayed_work *dwork;
 	struct wl1271 *wl;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 02/10] wlcore: use the original elp time in forced_ps mode
  2012-05-15 14:08 [PATCH 01/10] wlcore: fix sparse warnings related to static functions Arik Nemtsov
@ 2012-05-15 14:08 ` Arik Nemtsov
  2012-05-15 14:08 ` [PATCH 03/10] wlcore: fix dynamic_ps_timeout time regression Arik Nemtsov
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Arik Nemtsov @ 2012-05-15 14:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho, Eliad Peller, Arik Nemtsov

From: Eliad Peller <eliad@wizery.com>

The dynamic PS timeout is meaningless in forced PS mode.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 drivers/net/wireless/ti/wlcore/ps.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ti/wlcore/ps.c b/drivers/net/wireless/ti/wlcore/ps.c
index 87c84d1..47e81b3 100644
--- a/drivers/net/wireless/ti/wlcore/ps.c
+++ b/drivers/net/wireless/ti/wlcore/ps.c
@@ -28,6 +28,8 @@
 
 #define WL1271_WAKEUP_TIMEOUT 500
 
+#define ELP_ENTRY_DELAY  5
+
 void wl1271_elp_work(struct work_struct *work)
 {
 	struct delayed_work *dwork;
@@ -72,6 +74,7 @@ out:
 void wl1271_ps_elp_sleep(struct wl1271 *wl)
 {
 	struct wl12xx_vif *wlvif;
+	u32 timeout;
 
 	if (wl->quirks & WLCORE_QUIRK_NO_ELP)
 		return;
@@ -89,8 +92,13 @@ void wl1271_ps_elp_sleep(struct wl1271 *wl)
 			return;
 	}
 
+	if (wl->conf.conn.forced_ps)
+		timeout = ELP_ENTRY_DELAY;
+	else
+		timeout = wl->conf.conn.dynamic_ps_timeout;
+
 	ieee80211_queue_delayed_work(wl->hw, &wl->elp_work,
-		msecs_to_jiffies(wl->conf.conn.dynamic_ps_timeout));
+				     msecs_to_jiffies(timeout));
 }
 
 int wl1271_ps_elp_wakeup(struct wl1271 *wl)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 03/10] wlcore: fix dynamic_ps_timeout time regression
  2012-05-15 14:08 [PATCH 01/10] wlcore: fix sparse warnings related to static functions Arik Nemtsov
  2012-05-15 14:08 ` [PATCH 02/10] wlcore: use the original elp time in forced_ps mode Arik Nemtsov
@ 2012-05-15 14:08 ` Arik Nemtsov
  2012-05-15 14:08 ` [PATCH 04/10] wlcore: fixes for connection_loss_work Arik Nemtsov
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Arik Nemtsov @ 2012-05-15 14:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho, Arik Nemtsov

In patch d7b63b9fc7ee73e75a4c7fdb899 we have raised the dynamic
PS timeout to 200ms to improve user experience. Re-apply the change,
since it was reverted in the wlcore split.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 drivers/net/wireless/ti/wl12xx/main.c |    2 +-
 drivers/net/wireless/ti/wl18xx/main.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 29902c1..7e65ee3 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -238,7 +238,7 @@ static struct wlcore_conf wl12xx_conf = {
 		.psm_entry_retries           = 8,
 		.psm_exit_retries            = 16,
 		.psm_entry_nullfunc_retries  = 3,
-		.dynamic_ps_timeout          = 40,
+		.dynamic_ps_timeout          = 200,
 		.forced_ps                   = false,
 		.keep_alive_interval         = 55000,
 		.max_listen_interval         = 20,
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index d7e48db..c5ec94b 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -361,7 +361,7 @@ static struct wlcore_conf wl18xx_conf = {
 		.psm_entry_retries           = 8,
 		.psm_exit_retries            = 16,
 		.psm_entry_nullfunc_retries  = 3,
-		.dynamic_ps_timeout          = 40,
+		.dynamic_ps_timeout          = 200,
 		.forced_ps                   = false,
 		.keep_alive_interval         = 55000,
 		.max_listen_interval         = 20,
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 04/10] wlcore: fixes for connection_loss_work
  2012-05-15 14:08 [PATCH 01/10] wlcore: fix sparse warnings related to static functions Arik Nemtsov
  2012-05-15 14:08 ` [PATCH 02/10] wlcore: use the original elp time in forced_ps mode Arik Nemtsov
  2012-05-15 14:08 ` [PATCH 03/10] wlcore: fix dynamic_ps_timeout time regression Arik Nemtsov
@ 2012-05-15 14:08 ` Arik Nemtsov
  2012-05-15 14:08 ` [PATCH 05/10] wlcore: use correct link for bcast/multicast frames Arik Nemtsov
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Arik Nemtsov @ 2012-05-15 14:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho, Arik Nemtsov, bartosz.markowski

We can't use cancel_delayed_work_sync() from functions that take the
wl->mutex, since connection_loss_work also takes the mutex. This might
result in a deadlock. Restructure the code so the work is synchronously
canceled before taking the mutex.
Avoid a bug where we would indefinitely delay the connection loss
indication by re-queuing the connection loss work on consecutive beacon
loss events.

Cc: bartosz.markowski <bartosz.markowski@tieto.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 drivers/net/wireless/ti/wlcore/event.c |   15 ++++++++++++---
 drivers/net/wireless/ti/wlcore/main.c  |   10 +++++++---
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/event.c b/drivers/net/wireless/ti/wlcore/event.c
index 28e2a63..4ed83579 100644
--- a/drivers/net/wireless/ti/wlcore/event.c
+++ b/drivers/net/wireless/ti/wlcore/event.c
@@ -148,15 +148,24 @@ static int wl1271_event_process(struct wl1271 *wl)
 		int delay = wl->conf.conn.synch_fail_thold *
 					wl->conf.conn.bss_lose_timeout;
 		wl1271_info("Beacon loss detected.");
-		cancel_delayed_work_sync(&wl->connection_loss_work);
+
+		/*
+		 * if the work is already queued, it should take place. We
+		 * don't want to delay the connection loss indication
+		 * any more.
+		 */
 		ieee80211_queue_delayed_work(wl->hw, &wl->connection_loss_work,
-		      msecs_to_jiffies(delay));
+					     msecs_to_jiffies(delay));
 	}
 
 	if (vector & REGAINED_BSS_EVENT_ID) {
 		/* TODO: check for multi-role */
 		wl1271_info("Beacon regained.");
-		cancel_delayed_work_sync(&wl->connection_loss_work);
+		cancel_delayed_work(&wl->connection_loss_work);
+
+		/* sanity check - we can't lose and gain the beacon together */
+		WARN(vector & BSS_LOSE_EVENT_ID,
+		     "Concurrent beacon loss and gain from FW");
 	}
 
 	if (vector & RSSI_SNR_TRIGGER_0_EVENT_ID) {
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 659634b..35f6bc1 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -3708,9 +3708,6 @@ sta_not_found:
 			do_join = true;
 			set_assoc = true;
 
-			/* Cancel connection_loss_work */
-			cancel_delayed_work_sync(&wl->connection_loss_work);
-
 			/*
 			 * use basic rates from AP, and determine lowest rate
 			 * to use with control frames.
@@ -3960,6 +3957,13 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
 	wl1271_debug(DEBUG_MAC80211, "mac80211 bss info changed 0x%x",
 		     (int)changed);
 
+	/*
+	 * make sure to cancel pending disconnections if our association
+	 * state changed
+	 */
+	if (!is_ap && (changed & BSS_CHANGED_ASSOC))
+		cancel_delayed_work_sync(&wl->connection_loss_work);
+
 	mutex_lock(&wl->mutex);
 
 	if (unlikely(wl->state == WL1271_STATE_OFF))
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 05/10] wlcore: use correct link for bcast/multicast frames
  2012-05-15 14:08 [PATCH 01/10] wlcore: fix sparse warnings related to static functions Arik Nemtsov
                   ` (2 preceding siblings ...)
  2012-05-15 14:08 ` [PATCH 04/10] wlcore: fixes for connection_loss_work Arik Nemtsov
@ 2012-05-15 14:08 ` Arik Nemtsov
  2012-05-15 14:08 ` [PATCH 06/10] wlcore: flush before stopping AP Arik Nemtsov
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Arik Nemtsov @ 2012-05-15 14:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho, Eliad Peller, Arik Nemtsov

From: Eliad Peller <eliad@wizery.com>

Multicast management frames (e.g. global deauth)
should be sent out on the bcast link, rather than
the global, which should be used only for pre-added
stations (e.g. for auth/assoc resp).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 drivers/net/wireless/ti/wlcore/tx.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c
index 200d091..e8a2998 100644
--- a/drivers/net/wireless/ti/wlcore/tx.c
+++ b/drivers/net/wireless/ti/wlcore/tx.c
@@ -148,10 +148,10 @@ u8 wl12xx_tx_get_hlid_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif,
 			return wl->system_hlid;
 
 		hdr = (struct ieee80211_hdr *)skb->data;
-		if (ieee80211_is_mgmt(hdr->frame_control))
-			return wlvif->ap.global_hlid;
-		else
+		if (is_multicast_ether_addr(ieee80211_get_DA(hdr)))
 			return wlvif->ap.bcast_hlid;
+		else
+			return wlvif->ap.global_hlid;
 	}
 }
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 06/10] wlcore: flush before stopping AP
  2012-05-15 14:08 [PATCH 01/10] wlcore: fix sparse warnings related to static functions Arik Nemtsov
                   ` (3 preceding siblings ...)
  2012-05-15 14:08 ` [PATCH 05/10] wlcore: use correct link for bcast/multicast frames Arik Nemtsov
@ 2012-05-15 14:08 ` Arik Nemtsov
  2012-05-15 14:08 ` [PATCH 07/10] wlcore: modify bss loss parameters Arik Nemtsov
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Arik Nemtsov @ 2012-05-15 14:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho, Eliad Peller, Arik Nemtsov

From: Eliad Peller <eliad@wizery.com>

Make sure the deauth bcast gets sent

[Make sure we are AP as well before the flush - Arik]

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 drivers/net/wireless/ti/wlcore/main.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 35f6bc1..92478cb 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -3964,6 +3964,10 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
 	if (!is_ap && (changed & BSS_CHANGED_ASSOC))
 		cancel_delayed_work_sync(&wl->connection_loss_work);
 
+	if (is_ap && (changed & BSS_CHANGED_BEACON_ENABLED) &&
+	    !bss_conf->enable_beacon)
+		wl1271_tx_flush(wl);
+
 	mutex_lock(&wl->mutex);
 
 	if (unlikely(wl->state == WL1271_STATE_OFF))
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 07/10] wlcore: modify bss loss parameters
  2012-05-15 14:08 [PATCH 01/10] wlcore: fix sparse warnings related to static functions Arik Nemtsov
                   ` (4 preceding siblings ...)
  2012-05-15 14:08 ` [PATCH 06/10] wlcore: flush before stopping AP Arik Nemtsov
@ 2012-05-15 14:08 ` Arik Nemtsov
  2012-05-15 14:08 ` [PATCH 08/10] wlcore: increase number of BA sessions to 3 Arik Nemtsov
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Arik Nemtsov @ 2012-05-15 14:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho, Igal Chernobelsky, Arik Nemtsov

From: Igal Chernobelsky <igalc@ti.com>

Modify default parameters to reduce firmware BSS lose
probability in congested environment.

[Applied to 18xx configuration as well - Arik]

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 drivers/net/wireless/ti/wl12xx/main.c |    4 ++--
 drivers/net/wireless/ti/wl18xx/main.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 7e65ee3..08bec7f 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -227,8 +227,8 @@ static struct wlcore_conf wl12xx_conf = {
 				.rule        = CONF_BCN_RULE_PASS_ON_CHANGE,
 			},
 		},
-		.synch_fail_thold            = 10,
-		.bss_lose_timeout            = 100,
+		.synch_fail_thold            = 12,
+		.bss_lose_timeout            = 400,
 		.beacon_rx_timeout           = 10000,
 		.broadcast_timeout           = 20000,
 		.rx_broadcast_in_ps          = 1,
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index c5ec94b..10a0ba1 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -350,8 +350,8 @@ static struct wlcore_conf wl18xx_conf = {
 				.rule        = CONF_BCN_RULE_PASS_ON_CHANGE,
 			},
 		},
-		.synch_fail_thold            = 10,
-		.bss_lose_timeout            = 100,
+		.synch_fail_thold            = 12,
+		.bss_lose_timeout            = 400,
 		.beacon_rx_timeout           = 10000,
 		.broadcast_timeout           = 20000,
 		.rx_broadcast_in_ps          = 1,
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 08/10] wlcore: increase number of BA sessions to 3
  2012-05-15 14:08 [PATCH 01/10] wlcore: fix sparse warnings related to static functions Arik Nemtsov
                   ` (5 preceding siblings ...)
  2012-05-15 14:08 ` [PATCH 07/10] wlcore: modify bss loss parameters Arik Nemtsov
@ 2012-05-15 14:08 ` Arik Nemtsov
  2012-05-15 14:08 ` [PATCH 09/10] wl18xx: add dependency on mac80211 Arik Nemtsov
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Arik Nemtsov @ 2012-05-15 14:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho, Assaf Azulay, Arik Nemtsov

From: Assaf Azulay <assaf@ti.com>

With the new FW (sigle role X.3.8.0.108, multi role X.5.4.0.21)
we are supporting 3 RX BA sessions, this change is to support this
new ability.

Signed-off-by: Assaf Azulay <assaf@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 drivers/net/wireless/ti/wlcore/acx.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ti/wlcore/acx.h b/drivers/net/wireless/ti/wlcore/acx.h
index 28fb35c..26a5dc3 100644
--- a/drivers/net/wireless/ti/wlcore/acx.h
+++ b/drivers/net/wireless/ti/wlcore/acx.h
@@ -726,7 +726,7 @@ struct wl1271_acx_ht_information {
 	u8 padding[2];
 } __packed;
 
-#define RX_BA_MAX_SESSIONS 2
+#define RX_BA_MAX_SESSIONS 3
 
 struct wl1271_acx_ba_initiator_policy {
 	struct acx_header header;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 09/10] wl18xx: add dependency on mac80211
  2012-05-15 14:08 [PATCH 01/10] wlcore: fix sparse warnings related to static functions Arik Nemtsov
                   ` (6 preceding siblings ...)
  2012-05-15 14:08 ` [PATCH 08/10] wlcore: increase number of BA sessions to 3 Arik Nemtsov
@ 2012-05-15 14:08 ` Arik Nemtsov
  2012-05-15 14:09 ` [PATCH 10/10] wlcore: set wl->ht_cap per-band Arik Nemtsov
  2012-06-05 14:30 ` [PATCH 01/10] wlcore: fix sparse warnings related to static functions Luciano Coelho
  9 siblings, 0 replies; 11+ messages in thread
From: Arik Nemtsov @ 2012-05-15 14:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho, Arik Nemtsov

Add a dependency on mac80211 in Kconfig, and also replace some spaces
with tabs.

Reported-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 drivers/net/wireless/ti/wl18xx/Kconfig |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ti/wl18xx/Kconfig b/drivers/net/wireless/ti/wl18xx/Kconfig
index 1451d1f..1cfdb25 100644
--- a/drivers/net/wireless/ti/wl18xx/Kconfig
+++ b/drivers/net/wireless/ti/wl18xx/Kconfig
@@ -1,6 +1,7 @@
 config WL18XX
-       tristate "TI wl18xx support"
-       select WLCORE
-       ---help---
+	tristate "TI wl18xx support"
+	depends on MAC80211
+	select WLCORE
+	---help---
 	  This module adds support for wireless adapters based on TI
 	  WiLink 8 chipsets.
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 10/10] wlcore: set wl->ht_cap per-band
  2012-05-15 14:08 [PATCH 01/10] wlcore: fix sparse warnings related to static functions Arik Nemtsov
                   ` (7 preceding siblings ...)
  2012-05-15 14:08 ` [PATCH 09/10] wl18xx: add dependency on mac80211 Arik Nemtsov
@ 2012-05-15 14:09 ` Arik Nemtsov
  2012-06-05 14:30 ` [PATCH 01/10] wlcore: fix sparse warnings related to static functions Luciano Coelho
  9 siblings, 0 replies; 11+ messages in thread
From: Arik Nemtsov @ 2012-05-15 14:09 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho, Eliad Peller, Arik Nemtsov

From: Eliad Peller <eliad@wizery.com>

Save the ht_cap IE per-band, so we can configure different
params to BG and A bands (we currently don't support MIMO
on A band)

[Small fix for rx_highest - Arik]

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 drivers/net/wireless/ti/wl12xx/main.c   |    5 ++++-
 drivers/net/wireless/ti/wl18xx/main.c   |   36 +++++++++++++++++++++++++------
 drivers/net/wireless/ti/wlcore/main.c   |   10 +++++----
 drivers/net/wireless/ti/wlcore/wlcore.h |    2 +-
 4 files changed, 41 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 08bec7f..07cc94f 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -1425,7 +1425,10 @@ static int __devinit wl12xx_probe(struct platform_device *pdev)
 	wl->hw_min_ht_rate = WL12XX_CONF_HW_RXTX_RATE_MCS0;
 	wl->fw_status_priv_len = 0;
 	wl->stats.fw_stats_len = sizeof(struct wl12xx_acx_statistics);
-	memcpy(&wl->ht_cap, &wl12xx_ht_cap, sizeof(wl12xx_ht_cap));
+	memcpy(&wl->ht_cap[IEEE80211_BAND_2GHZ], &wl12xx_ht_cap,
+	       sizeof(wl12xx_ht_cap));
+	memcpy(&wl->ht_cap[IEEE80211_BAND_5GHZ], &wl12xx_ht_cap,
+	       sizeof(wl12xx_ht_cap));
 	wl12xx_conf_init(wl);
 
 	if (!fref_param) {
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index 10a0ba1..809bb93 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -595,7 +595,7 @@ static int wl18xx_identify_chip(struct wl1271 *wl)
 			      WLCORE_QUIRK_RX_BLOCKSIZE_ALIGN;
 
 		/* PG 1.0 has some problems with MCS_13, so disable it */
-		wl->ht_cap.mcs.rx_mask[1] &= ~BIT(5);
+		wl->ht_cap[IEEE80211_BAND_2GHZ].mcs.rx_mask[1] &= ~BIT(5);
 
 		/* TODO: need to blocksize alignment for RX/TX separately? */
 		break;
@@ -1085,7 +1085,7 @@ static struct ieee80211_sta_ht_cap wl18xx_siso20_ht_cap = {
 };
 
 /* HT cap appropriate for MIMO rates in 20mhz channel */
-static struct ieee80211_sta_ht_cap wl18xx_mimo_ht_cap = {
+static struct ieee80211_sta_ht_cap wl18xx_mimo_ht_cap_2ghz = {
 	.cap = IEEE80211_HT_CAP_SGI_20,
 	.ht_supported = true,
 	.ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K,
@@ -1097,6 +1097,18 @@ static struct ieee80211_sta_ht_cap wl18xx_mimo_ht_cap = {
 		},
 };
 
+static struct ieee80211_sta_ht_cap wl18xx_mimo_ht_cap_5ghz = {
+	.cap = IEEE80211_HT_CAP_SGI_20,
+	.ht_supported = true,
+	.ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K,
+	.ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
+	.mcs = {
+		.rx_mask = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
+		.rx_highest = cpu_to_le16(72),
+		.tx_params = IEEE80211_HT_MCS_TX_DEFINED,
+		},
+};
+
 static int __devinit wl18xx_probe(struct platform_device *pdev)
 {
 	struct wl1271 *wl;
@@ -1126,13 +1138,25 @@ static int __devinit wl18xx_probe(struct platform_device *pdev)
 	wl->static_data_priv_len = sizeof(struct wl18xx_static_data_priv);
 
 	if (!strcmp(ht_mode_param, "wide")) {
-		memcpy(&wl->ht_cap, &wl18xx_siso40_ht_cap,
+		memcpy(&wl->ht_cap[IEEE80211_BAND_2GHZ],
+		       &wl18xx_siso40_ht_cap,
+		       sizeof(wl18xx_siso40_ht_cap));
+		memcpy(&wl->ht_cap[IEEE80211_BAND_5GHZ],
+		       &wl18xx_siso40_ht_cap,
 		       sizeof(wl18xx_siso40_ht_cap));
 	} else if (!strcmp(ht_mode_param, "mimo")) {
-		memcpy(&wl->ht_cap, &wl18xx_mimo_ht_cap,
-		       sizeof(wl18xx_mimo_ht_cap));
+		memcpy(&wl->ht_cap[IEEE80211_BAND_2GHZ],
+		       &wl18xx_mimo_ht_cap_2ghz,
+		       sizeof(wl18xx_mimo_ht_cap_2ghz));
+		memcpy(&wl->ht_cap[IEEE80211_BAND_5GHZ],
+		       &wl18xx_mimo_ht_cap_5ghz,
+		       sizeof(wl18xx_mimo_ht_cap_5ghz));
 	} else if (!strcmp(ht_mode_param, "siso20")) {
-		memcpy(&wl->ht_cap, &wl18xx_siso20_ht_cap,
+		memcpy(&wl->ht_cap[IEEE80211_BAND_2GHZ],
+		       &wl18xx_siso20_ht_cap,
+		       sizeof(wl18xx_siso20_ht_cap));
+		memcpy(&wl->ht_cap[IEEE80211_BAND_5GHZ],
+		       &wl18xx_siso20_ht_cap,
 		       sizeof(wl18xx_siso20_ht_cap));
 	} else {
 		wl1271_error("invalid ht_mode '%s'", ht_mode_param);
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 92478cb..68bac74 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -5027,12 +5027,14 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
 	 */
 	memcpy(&wl->bands[IEEE80211_BAND_2GHZ], &wl1271_band_2ghz,
 	       sizeof(wl1271_band_2ghz));
-	memcpy(&wl->bands[IEEE80211_BAND_2GHZ].ht_cap, &wl->ht_cap,
-	       sizeof(wl->ht_cap));
+	memcpy(&wl->bands[IEEE80211_BAND_2GHZ].ht_cap,
+	       &wl->ht_cap[IEEE80211_BAND_2GHZ],
+	       sizeof(*wl->ht_cap));
 	memcpy(&wl->bands[IEEE80211_BAND_5GHZ], &wl1271_band_5ghz,
 	       sizeof(wl1271_band_5ghz));
-	memcpy(&wl->bands[IEEE80211_BAND_5GHZ].ht_cap, &wl->ht_cap,
-	       sizeof(wl->ht_cap));
+	memcpy(&wl->bands[IEEE80211_BAND_5GHZ].ht_cap,
+	       &wl->ht_cap[IEEE80211_BAND_5GHZ],
+	       sizeof(*wl->ht_cap));
 
 	wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
 		&wl->bands[IEEE80211_BAND_2GHZ];
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index 1967873..37a80f4 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -368,7 +368,7 @@ struct wl1271 {
 	u8 hw_min_ht_rate;
 
 	/* HW HT (11n) capabilities */
-	struct ieee80211_sta_ht_cap ht_cap;
+	struct ieee80211_sta_ht_cap ht_cap[IEEE80211_NUM_BANDS];
 
 	/* size of the private FW status data */
 	size_t fw_status_priv_len;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 01/10] wlcore: fix sparse warnings related to static functions
  2012-05-15 14:08 [PATCH 01/10] wlcore: fix sparse warnings related to static functions Arik Nemtsov
                   ` (8 preceding siblings ...)
  2012-05-15 14:09 ` [PATCH 10/10] wlcore: set wl->ht_cap per-band Arik Nemtsov
@ 2012-06-05 14:30 ` Luciano Coelho
  9 siblings, 0 replies; 11+ messages in thread
From: Luciano Coelho @ 2012-06-05 14:30 UTC (permalink / raw)
  To: Arik Nemtsov; +Cc: linux-wireless

On Tue, 2012-05-15 at 17:08 +0300, Arik Nemtsov wrote:
> The "static" modifier was mistakenly forgotten for some functions.
> 
> Signed-off-by: Arik Nemtsov <arik@wizery.com>
> ---
> These patches apply on top of the wl18xx support series.

Applied and pushed to wl12xx/master.

-- 
Cheers,
Luca.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-06-05 14:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-15 14:08 [PATCH 01/10] wlcore: fix sparse warnings related to static functions Arik Nemtsov
2012-05-15 14:08 ` [PATCH 02/10] wlcore: use the original elp time in forced_ps mode Arik Nemtsov
2012-05-15 14:08 ` [PATCH 03/10] wlcore: fix dynamic_ps_timeout time regression Arik Nemtsov
2012-05-15 14:08 ` [PATCH 04/10] wlcore: fixes for connection_loss_work Arik Nemtsov
2012-05-15 14:08 ` [PATCH 05/10] wlcore: use correct link for bcast/multicast frames Arik Nemtsov
2012-05-15 14:08 ` [PATCH 06/10] wlcore: flush before stopping AP Arik Nemtsov
2012-05-15 14:08 ` [PATCH 07/10] wlcore: modify bss loss parameters Arik Nemtsov
2012-05-15 14:08 ` [PATCH 08/10] wlcore: increase number of BA sessions to 3 Arik Nemtsov
2012-05-15 14:08 ` [PATCH 09/10] wl18xx: add dependency on mac80211 Arik Nemtsov
2012-05-15 14:09 ` [PATCH 10/10] wlcore: set wl->ht_cap per-band Arik Nemtsov
2012-06-05 14:30 ` [PATCH 01/10] wlcore: fix sparse warnings related to static functions Luciano Coelho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).