Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 4/4] ath9k/ath: move dfs pattern detector to ath
From: Janusz Dziedzic @ 2013-10-14  9:06 UTC (permalink / raw)
  To: linux-wireless; +Cc: Janusz Dziedzic
In-Reply-To: <1381741566-2330-1-git-send-email-janusz.dziedzic@tieto.com>

Move the DFS pattern detector code to the ath module so
the other Atheros drivers can make us of it. This makes
no functional changes.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Reviewed-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 drivers/net/wireless/ath/Makefile                  |    4 +++-
 drivers/net/wireless/ath/ath9k/Makefile            |    4 +---
 drivers/net/wireless/ath/ath9k/dfs.h               |    2 +-
 drivers/net/wireless/ath/ath9k/dfs_debug.c         |    2 +-
 .../ath/{ath9k => }/dfs_pattern_detector.c         |    2 +-
 .../ath/{ath9k => }/dfs_pattern_detector.h         |    0
 .../wireless/ath/{ath9k => }/dfs_pri_detector.c    |    2 +-
 .../wireless/ath/{ath9k => }/dfs_pri_detector.h    |    0
 8 files changed, 8 insertions(+), 8 deletions(-)
 rename drivers/net/wireless/ath/{ath9k => }/dfs_pattern_detector.c (99%)
 rename drivers/net/wireless/ath/{ath9k => }/dfs_pattern_detector.h (100%)
 rename drivers/net/wireless/ath/{ath9k => }/dfs_pri_detector.c (99%)
 rename drivers/net/wireless/ath/{ath9k => }/dfs_pri_detector.h (100%)

diff --git a/drivers/net/wireless/ath/Makefile b/drivers/net/wireless/ath/Makefile
index fb05cfd..90b9d75 100644
--- a/drivers/net/wireless/ath/Makefile
+++ b/drivers/net/wireless/ath/Makefile
@@ -11,7 +11,9 @@ obj-$(CONFIG_ATH_COMMON)	+= ath.o
 ath-objs :=	main.o \
 		regd.o \
 		hw.o \
-		key.o
+		key.o \
+		dfs_pattern_detector.o \
+		dfs_pri_detector.o
 
 ath-$(CONFIG_ATH_DEBUG) += debug.o
 ccflags-y += -D__CHECK_ENDIAN__
diff --git a/drivers/net/wireless/ath/ath9k/Makefile b/drivers/net/wireless/ath/ath9k/Makefile
index 75ee9e7..6205ef5 100644
--- a/drivers/net/wireless/ath/ath9k/Makefile
+++ b/drivers/net/wireless/ath/ath9k/Makefile
@@ -14,9 +14,7 @@ ath9k-$(CONFIG_ATH9K_AHB) += ahb.o
 ath9k-$(CONFIG_ATH9K_DEBUGFS) += debug.o
 ath9k-$(CONFIG_ATH9K_DFS_DEBUGFS) += dfs_debug.o
 ath9k-$(CONFIG_ATH9K_DFS_CERTIFIED) += \
-		dfs.o \
-		dfs_pattern_detector.o \
-		dfs_pri_detector.o
+		dfs.o
 ath9k-$(CONFIG_PM_SLEEP) += wow.o
 
 obj-$(CONFIG_ATH9K) += ath9k.o
diff --git a/drivers/net/wireless/ath/ath9k/dfs.h b/drivers/net/wireless/ath/ath9k/dfs.h
index 3c839f0..c6fa3d5 100644
--- a/drivers/net/wireless/ath/ath9k/dfs.h
+++ b/drivers/net/wireless/ath/ath9k/dfs.h
@@ -17,7 +17,7 @@
 
 #ifndef ATH9K_DFS_H
 #define ATH9K_DFS_H
-#include "dfs_pattern_detector.h"
+#include "../dfs_pattern_detector.h"
 
 #if defined(CONFIG_ATH9K_DFS_CERTIFIED)
 /**
diff --git a/drivers/net/wireless/ath/ath9k/dfs_debug.c b/drivers/net/wireless/ath/ath9k/dfs_debug.c
index 990c376..90b8342 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_debug.c
+++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c
@@ -20,7 +20,7 @@
 
 #include "ath9k.h"
 #include "dfs_debug.h"
-#include "dfs_pattern_detector.h"
+#include "../dfs_pattern_detector.h"
 
 static struct ath_dfs_pool_stats dfs_pool_stats = { 0 };
 
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c b/drivers/net/wireless/ath/dfs_pattern_detector.c
similarity index 99%
rename from drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
rename to drivers/net/wireless/ath/dfs_pattern_detector.c
index c230ffc..a1a69c5 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
+++ b/drivers/net/wireless/ath/dfs_pattern_detector.c
@@ -19,7 +19,7 @@
 
 #include "dfs_pattern_detector.h"
 #include "dfs_pri_detector.h"
-#include "../ath.h"
+#include "ath.h"
 
 /*
  * tolerated deviation of radar time stamp in usecs on both sides
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h b/drivers/net/wireless/ath/dfs_pattern_detector.h
similarity index 100%
rename from drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h
rename to drivers/net/wireless/ath/dfs_pattern_detector.h
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c b/drivers/net/wireless/ath/dfs_pri_detector.c
similarity index 99%
rename from drivers/net/wireless/ath/ath9k/dfs_pri_detector.c
rename to drivers/net/wireless/ath/dfs_pri_detector.c
index 17b5bf9..43b6081 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c
+++ b/drivers/net/wireless/ath/dfs_pri_detector.c
@@ -17,7 +17,7 @@
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 
-#include "../ath.h"
+#include "ath.h"
 #include "dfs_pattern_detector.h"
 #include "dfs_pri_detector.h"
 
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pri_detector.h b/drivers/net/wireless/ath/dfs_pri_detector.h
similarity index 100%
rename from drivers/net/wireless/ath/ath9k/dfs_pri_detector.h
rename to drivers/net/wireless/ath/dfs_pri_detector.h
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 3/4] ath9k: dfs use CFG80211_CERTIFICATION_ONUS flag
From: Janusz Dziedzic @ 2013-10-14  9:06 UTC (permalink / raw)
  To: linux-wireless; +Cc: Janusz Dziedzic
In-Reply-To: <1381741566-2330-1-git-send-email-janusz.dziedzic@tieto.com>

Use CFG80211_CERTIFICATION_ONUS flag in the DFS
detector code. This is required as a preparation
for moving DFS detector code from ath9k to ath
module.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Reviewed-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 .../net/wireless/ath/ath9k/dfs_pattern_detector.c  |    3 +++
 .../net/wireless/ath/ath9k/dfs_pattern_detector.h  |   10 ----------
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
index b0dcd1b..c230ffc 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
+++ b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
@@ -299,6 +299,9 @@ dfs_pattern_detector_init(struct ath_common *common,
 {
 	struct dfs_pattern_detector *dpd;
 
+	if (!config_enabled(CONFIG_CFG80211_CERTIFICATION_ONUS))
+		return NULL;
+
 	dpd = kmalloc(sizeof(*dpd), GFP_KERNEL);
 	if (dpd == NULL)
 		return NULL;
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h
index 9c75297..dde2652 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h
+++ b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h
@@ -106,17 +106,7 @@ struct dfs_pattern_detector {
  * @param region: DFS domain to be used, can be NL80211_DFS_UNSET at creation
  * @return instance pointer on success, NULL otherwise
  */
-#if defined(CONFIG_ATH9K_DFS_CERTIFIED)
 extern struct dfs_pattern_detector *
 dfs_pattern_detector_init(struct ath_common *common,
 			  enum nl80211_dfs_regions region);
-#else
-static inline struct dfs_pattern_detector *
-dfs_pattern_detector_init(struct ath_common *common,
-			  enum nl80211_dfs_regions region)
-{
-	return NULL;
-}
-#endif /* CONFIG_ATH9K_DFS_CERTIFIED */
-
 #endif /* DFS_PATTERN_DETECTOR_H */
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 2/4] ath9k: dfs move ath_dfs_pool_stats
From: Janusz Dziedzic @ 2013-10-14  9:06 UTC (permalink / raw)
  To: linux-wireless; +Cc: Janusz Dziedzic
In-Reply-To: <1381741566-2330-1-git-send-email-janusz.dziedzic@tieto.com>

Move ath_dfs_pool_stats to dfs_pattern_detector
code to be not specyfic only for ath9k.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Reviewed-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 drivers/net/wireless/ath/ath9k/dfs_debug.c         |    9 ++++++---
 drivers/net/wireless/ath/ath9k/dfs_debug.h         |   16 ----------------
 .../net/wireless/ath/ath9k/dfs_pattern_detector.c  |    7 +++++++
 .../net/wireless/ath/ath9k/dfs_pattern_detector.h  |   14 ++++++++++++++
 drivers/net/wireless/ath/ath9k/dfs_pri_detector.c  |    8 ++++++--
 drivers/net/wireless/ath/ath9k/dfs_pri_detector.h  |    2 ++
 6 files changed, 35 insertions(+), 21 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/dfs_debug.c b/drivers/net/wireless/ath/ath9k/dfs_debug.c
index 8215991..990c376 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_debug.c
+++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c
@@ -20,16 +20,16 @@
 
 #include "ath9k.h"
 #include "dfs_debug.h"
+#include "dfs_pattern_detector.h"
 
-
-struct ath_dfs_pool_stats global_dfs_pool_stats = { 0 };
+static struct ath_dfs_pool_stats dfs_pool_stats = { 0 };
 
 #define ATH9K_DFS_STAT(s, p) \
 	len += scnprintf(buf + len, size - len, "%28s : %10u\n", s, \
 			 sc->debug.stats.dfs_stats.p);
 #define ATH9K_DFS_POOL_STAT(s, p) \
 	len += scnprintf(buf + len, size - len, "%28s : %10u\n", s, \
-			 global_dfs_pool_stats.p);
+			 dfs_pool_stats.p);
 
 static ssize_t read_file_dfs(struct file *file, char __user *user_buf,
 			     size_t count, loff_t *ppos)
@@ -44,6 +44,9 @@ static ssize_t read_file_dfs(struct file *file, char __user *user_buf,
 	if (buf == NULL)
 		return -ENOMEM;
 
+	if (sc->dfs_detector)
+		dfs_pool_stats = sc->dfs_detector->get_stats(sc->dfs_detector);
+
 	len += scnprintf(buf + len, size - len, "DFS support for "
 			 "macVersion = 0x%x, macRev = 0x%x: %s\n",
 			 hw_ver->macVersion, hw_ver->macRev,
diff --git a/drivers/net/wireless/ath/ath9k/dfs_debug.h b/drivers/net/wireless/ath/ath9k/dfs_debug.h
index e36810a..0a7ddf4 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_debug.h
+++ b/drivers/net/wireless/ath/ath9k/dfs_debug.h
@@ -51,25 +51,11 @@ struct ath_dfs_stats {
 	u32 radar_detected;
 };
 
-/**
- * struct ath_dfs_pool_stats - DFS Statistics for global pools
- */
-struct ath_dfs_pool_stats {
-	u32 pool_reference;
-	u32 pulse_allocated;
-	u32 pulse_alloc_error;
-	u32 pulse_used;
-	u32 pseq_allocated;
-	u32 pseq_alloc_error;
-	u32 pseq_used;
-};
 #if defined(CONFIG_ATH9K_DFS_DEBUGFS)
 
 #define DFS_STAT_INC(sc, c) (sc->debug.stats.dfs_stats.c++)
 void ath9k_dfs_init_debug(struct ath_softc *sc);
 
-#define DFS_POOL_STAT_INC(c) (global_dfs_pool_stats.c++)
-#define DFS_POOL_STAT_DEC(c) (global_dfs_pool_stats.c--)
 extern struct ath_dfs_pool_stats global_dfs_pool_stats;
 
 #else
@@ -77,8 +63,6 @@ extern struct ath_dfs_pool_stats global_dfs_pool_stats;
 #define DFS_STAT_INC(sc, c) do { } while (0)
 static inline void ath9k_dfs_init_debug(struct ath_softc *sc) { }
 
-#define DFS_POOL_STAT_INC(c) do { } while (0)
-#define DFS_POOL_STAT_DEC(c) do { } while (0)
 #endif /* CONFIG_ATH9K_DFS_DEBUGFS */
 
 #endif /* ATH9K_DFS_DEBUG_H */
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
index c839a78..b0dcd1b 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
+++ b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
@@ -253,6 +253,12 @@ dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event)
 	return false;
 }
 
+static struct ath_dfs_pool_stats
+dpd_get_stats(struct dfs_pattern_detector *dpd)
+{
+	return global_dfs_pool_stats;
+}
+
 static bool dpd_set_domain(struct dfs_pattern_detector *dpd,
 			   enum nl80211_dfs_regions region)
 {
@@ -283,6 +289,7 @@ static struct dfs_pattern_detector default_dpd = {
 	.exit		= dpd_exit,
 	.set_dfs_domain	= dpd_set_domain,
 	.add_pulse	= dpd_add_pulse,
+	.get_stats	= dpd_get_stats,
 	.region		= NL80211_DFS_UNSET,
 };
 
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h
index b09946f..9c75297 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h
+++ b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h
@@ -22,6 +22,19 @@
 #include <linux/nl80211.h>
 
 /**
+ * struct ath_dfs_pool_stats - DFS Statistics for global pools
+ */
+struct ath_dfs_pool_stats {
+	u32 pool_reference;
+	u32 pulse_allocated;
+	u32 pulse_alloc_error;
+	u32 pulse_used;
+	u32 pseq_allocated;
+	u32 pseq_alloc_error;
+	u32 pseq_used;
+};
+
+/**
  * struct pulse_event - describing pulses reported by PHY
  * @ts: pulse time stamp in us
  * @freq: channel frequency in MHz
@@ -77,6 +90,7 @@ struct dfs_pattern_detector {
 	bool (*add_pulse)(struct dfs_pattern_detector *dpd,
 			  struct pulse_event *pe);
 
+	struct ath_dfs_pool_stats (*get_stats)(struct dfs_pattern_detector *dpd);
 	enum nl80211_dfs_regions region;
 	u8 num_radar_types;
 	u64 last_pulse_ts;
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c b/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c
index c718fc3..17b5bf9 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c
+++ b/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c
@@ -17,10 +17,14 @@
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 
-#include "ath9k.h"
+#include "../ath.h"
 #include "dfs_pattern_detector.h"
 #include "dfs_pri_detector.h"
-#include "dfs_debug.h"
+
+struct ath_dfs_pool_stats global_dfs_pool_stats = {};
+
+#define DFS_POOL_STAT_INC(c) (global_dfs_pool_stats.c++)
+#define DFS_POOL_STAT_DEC(c) (global_dfs_pool_stats.c--)
 
 /**
  * struct pulse_elem - elements in pulse queue
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pri_detector.h b/drivers/net/wireless/ath/ath9k/dfs_pri_detector.h
index 723962d..79f0fff 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_pri_detector.h
+++ b/drivers/net/wireless/ath/ath9k/dfs_pri_detector.h
@@ -19,6 +19,8 @@
 
 #include <linux/list.h>
 
+extern struct ath_dfs_pool_stats global_dfs_pool_stats;
+
 /**
  * struct pri_sequence - sequence of pulses matching one PRI
  * @head: list_head
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 1/4] ath9k: dfs kill ath9k specyfic code
From: Janusz Dziedzic @ 2013-10-14  9:06 UTC (permalink / raw)
  To: linux-wireless; +Cc: Janusz Dziedzic

Kill of using ath9k_hw_common() function
in dfs detector code.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Reviewed-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 .../net/wireless/ath/ath9k/dfs_pattern_detector.c  |   13 ++++++-------
 .../net/wireless/ath/ath9k/dfs_pattern_detector.h  |    8 +++++---
 drivers/net/wireless/ath/ath9k/init.c              |    4 ++--
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
index 491305c..c839a78 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
+++ b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
@@ -19,7 +19,7 @@
 
 #include "dfs_pattern_detector.h"
 #include "dfs_pri_detector.h"
-#include "ath9k.h"
+#include "../ath.h"
 
 /*
  * tolerated deviation of radar time stamp in usecs on both sides
@@ -143,7 +143,6 @@ channel_detector_create(struct dfs_pattern_detector *dpd, u16 freq)
 {
 	u32 sz, i;
 	struct channel_detector *cd;
-	struct ath_common *common = ath9k_hw_common(dpd->ah);
 
 	cd = kmalloc(sizeof(*cd), GFP_ATOMIC);
 	if (cd == NULL)
@@ -167,7 +166,7 @@ channel_detector_create(struct dfs_pattern_detector *dpd, u16 freq)
 	return cd;
 
 fail:
-	ath_dbg(common, DFS,
+	ath_dbg(dpd->common, DFS,
 		"failed to allocate channel_detector for freq=%d\n", freq);
 	channel_detector_exit(dpd, cd);
 	return NULL;
@@ -242,7 +241,7 @@ dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event)
 		struct pri_detector *pd = cd->detectors[i];
 		struct pri_sequence *ps = pd->add_pulse(pd, event);
 		if (ps != NULL) {
-			ath_dbg(ath9k_hw_common(dpd->ah), DFS,
+			ath_dbg(dpd->common, DFS,
 				"DFS: radar found on freq=%d: id=%d, pri=%d, "
 				"count=%d, count_false=%d\n",
 				event->freq, pd->rs->type_id,
@@ -288,10 +287,10 @@ static struct dfs_pattern_detector default_dpd = {
 };
 
 struct dfs_pattern_detector *
-dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region)
+dfs_pattern_detector_init(struct ath_common *common,
+			  enum nl80211_dfs_regions region)
 {
 	struct dfs_pattern_detector *dpd;
-	struct ath_common *common = ath9k_hw_common(ah);
 
 	dpd = kmalloc(sizeof(*dpd), GFP_KERNEL);
 	if (dpd == NULL)
@@ -300,7 +299,7 @@ dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region)
 	*dpd = default_dpd;
 	INIT_LIST_HEAD(&dpd->channel_detectors);
 
-	dpd->ah = ah;
+	dpd->common = common;
 	if (dpd->set_dfs_domain(dpd, region))
 		return dpd;
 
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h
index 90a5abc..b09946f 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h
+++ b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h
@@ -81,7 +81,7 @@ struct dfs_pattern_detector {
 	u8 num_radar_types;
 	u64 last_pulse_ts;
 	/* needed for ath_dbg() */
-	struct ath_hw *ah;
+	struct ath_common *common;
 
 	const struct radar_detector_specs *radar_spec;
 	struct list_head channel_detectors;
@@ -94,10 +94,12 @@ struct dfs_pattern_detector {
  */
 #if defined(CONFIG_ATH9K_DFS_CERTIFIED)
 extern struct dfs_pattern_detector *
-dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region);
+dfs_pattern_detector_init(struct ath_common *common,
+			  enum nl80211_dfs_regions region);
 #else
 static inline struct dfs_pattern_detector *
-dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region)
+dfs_pattern_detector_init(struct ath_common *common,
+			  enum nl80211_dfs_regions region)
 {
 	return NULL;
 }
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index e3d11c4..42758ce 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -647,7 +647,8 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
 	sc->sc_ah = ah;
 	pCap = &ah->caps;
 
-	sc->dfs_detector = dfs_pattern_detector_init(ah, NL80211_DFS_UNSET);
+	common = ath9k_hw_common(ah);
+	sc->dfs_detector = dfs_pattern_detector_init(common, NL80211_DFS_UNSET);
 
 	if (!pdata) {
 		ah->ah_flags |= AH_USE_EEPROM;
@@ -661,7 +662,6 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
 		ah->external_reset = pdata->external_reset;
 	}
 
-	common = ath9k_hw_common(ah);
 	common->ops = &ah->reg_ops;
 	common->bus_ops = bus_ops;
 	common->ah = ah;
-- 
1.7.9.5


^ permalink raw reply related

* Re: [PATCH v2 1/2] cfg80211: add flags to define country IE processing rules
From: Johannes Berg @ 2013-10-14  8:53 UTC (permalink / raw)
  To: Mihir Shete
  Cc: linux-wireless, Henri Bahini, Tushnim Bhattacharyya,
	Luis R. Rodriguez
In-Reply-To: <1381638697-2641-2-git-send-email-smihir@qti.qualcomm.com>

On Sun, 2013-10-13 at 10:01 +0530, Mihir Shete wrote:
> 802.11 cards may have different country IE parsing behavioural
> preferences and vendors may want to support these. These preferences
> were managed by the WIPHY_FLAG_CUSTOM_REGULATORY and the
> WIPHY_FLAG_STRICT_REGULATORY flags and their combination.
> Instead of using this existing notation, split out the country
> IE behavioural preferences to a new flag. This will allow
> us to add more customizations easily and make the code more
> maintainable

>  		regd = ath_world_regdomain(reg);
>  		wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
> +		wiphy->country_ie_pref = NL80211_COUNTRY_IE_FOLLOW_POWER;

That seems pretty weird - maybe you should have a first patch that moves
the existing regulatory flags into some new field, and then adds the
country IE flags there? Adding a new flags field for just the country IE
seems odd and less useful for the future.

> + * @country_ie_pref: country IE processing preferences specified
> + *	by enum nl80211_country_ie_pref

That implies you're exporting it to userspace - why?

>  /**
> + * enum nl80211_country_ie_pref - country IE processing preferences

Why is this userspace API if it's not used anywhere as such?

johannes


^ permalink raw reply

* Getting the Sitecom WLA-2102 running with the rtl8192cu driver? (add its USB ID)
From: Hans de Jonge @ 2013-10-14  7:57 UTC (permalink / raw)
  To: linux-wireless

Hi list,

In the course of this year I acquired a Sitecom N300 (WLA-2102) USB Wifi 
adapter with a USB vendor,device ID:
0x0DF6,0x0070

According to a post on a german site, it is claimed that  the device can 
be set  to run through the Realtek 8192CU driver and that this can be 
achieved by adding the id at the appropriate place in the source code, 
which I recognise as "the
same list as where the device with ID= 0x0DF6,0x0061 is added.

In the latest stable kernel source (3.11.4) I was able to identify this 
to be situated in the file:
linux-3.11.4/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c

Hence I my question whether it is possible to add the id as suggested in 
the german post
(http://forum.ubuntuusers.de/topic/wi-fi-usb-adapter-n300-wla-2102-8192cu/)
in order get the device running in the next kernel version?

Since I myself stopped compiling my own custom kernels a few years ago. 
(In favour of (automagically updated) Debian testing distribution 
kernels), I have not yet tried to implement the modification in a 
home-brewn kernel, but given clear indication on how to rebuild a 
distribution kernel image package with just that one modification, I 
would love to give that a try and test it.

Yours,
Hans de Jonge

^ permalink raw reply

* pull-request: mac80211 2013-10-14
From: Johannes Berg @ 2013-10-14  7:49 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1452 bytes --]

John,

I know it's getting later in the game (rc5 is out) and my last pull
request hasn't even made it into Linus's tree, but we still have some
fixes ...

This time I have two fixes from Emmanuel for RF-kill issues, and fixed
two issues reported by Evan Huus and Thomas Lindroth respectively.

Let me know if there's any problem.

johannes

The following changes since commit 22c4ceed0184318ec5a6182c6d75d398452c2e39:

  mac80211: Run deferred scan if last roc_list item is not started (2013-09-30 12:36:56 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git for-john

for you to fetch changes up to d86aa4f8ca58898ec6a94c0635da20b948171ed7:

  mac80211: fix crash if bitrate calculation goes wrong (2013-10-14 09:47:08 +0200)

----------------------------------------------------------------
Emmanuel Grumbach (2):
      mac80211: correctly close cancelled scans
      cfg80211: don't add p2p device while in RFKILL

Johannes Berg (2):
      wireless: radiotap: fix parsing buffer overrun
      mac80211: fix crash if bitrate calculation goes wrong

 net/mac80211/ieee80211_i.h |  3 +++
 net/mac80211/scan.c        | 19 +++++++++++++++++++
 net/mac80211/util.c        |  4 ++++
 net/wireless/core.c        |  2 --
 net/wireless/core.h        |  3 +++
 net/wireless/radiotap.c    |  7 ++++++-
 6 files changed, 35 insertions(+), 3 deletions(-)


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: [PATCH] wireless: radiotap: fix parsing buffer overrun
From: Johannes Berg @ 2013-10-14  7:45 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <1381495982-28486-1-git-send-email-johannes@sipsolutions.net>

On Fri, 2013-10-11 at 14:53 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> When parsing an invalid radiotap header, the parser can overrun
> the buffer that is passed in because it doesn't correctly check
>  1) the minimum radiotap header size
>  2) the space for extended bitmaps
> 
> The first issue doesn't affect any in-kernel user as they all
> check the minimum size before calling the radiotap function.
> The second issue could potentially affect the kernel if an skb
> is passed in that consists only of the radiotap header with a
> lot of extended bitmaps that extend past the SKB. In that case
> a read-only buffer overrun by at most 4 bytes is possible.
> 
> Fix this by adding the appropriate checks to the parser.

Applied (with another fix pointed out by Evan)

johannes


^ permalink raw reply

* Re: [PATCH] mac80211: fix crash if bitrate calculation goes wrong
From: Johannes Berg @ 2013-10-14  7:45 UTC (permalink / raw)
  To: linux-wireless; +Cc: Thomas Lindroth
In-Reply-To: <1381499323-6502-1-git-send-email-johannes@sipsolutions.net>

On Fri, 2013-10-11 at 15:48 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> If a frame's timestamp is calculated, and the bitrate
> calculation goes wrong and returns zero, the system
> will attempt to divide by zero and crash. Catch this
> case and print the rate information that the driver
> reported when this happens.

Applied.

johannes


^ permalink raw reply

* ath9k oops report on RNWD-N9003PCe device
From: Joel Johnson @ 2013-10-14  2:36 UTC (permalink / raw)
  To: linux-wireless, ath9k-devel
  Cc: Luis R. Rodriguez, Jouni Malinen, Senthil Balasubramanian

I've received the oops captured below on an ath9k card (Rosewill 
RNWD-N9003PCe), whose $(lspci -n -v) output is:

03:00.0 0280: 168c:0030 (rev 01)
         Subsystem: 168c:3112
         Flags: bus master, fast devsel, latency 0, IRQ 18
         Memory at f7c00000 (64-bit, non-prefetchable) [size=128K]
         Expansion ROM at f7c20000 [disabled] [size=64K]
         Capabilities: [40] Power Management version 3
         Capabilities: [50] MSI: Enable- Count=1/4 Maskable+ 64bit+
         Capabilities: [70] Express Endpoint, MSI 00
         Capabilities: [100] Advanced Error Reporting
         Capabilities: [140] Virtual Channel
         Capabilities: [300] Device Serial Number 00-00-00-00-00-00-00-00
         Kernel driver in use: ath9k

I'm assuming from the stacktrace that this is related to framing in the 
ath9k driver, if not then please let me know and I'll forward it along.

Joel

[319628.023086] ------------[ cut here ]------------
[319628.023097] WARNING: at 
/build/linux-BPzSEt/linux-3.10.11/net/ipv4/tcp_input.c:2776 
tcp_fastretrans_alert+0x13b/0x923()
[319628.023099] Modules linked in: cpuid fuse ufs qnx4 hfsplus hfs minix 
ntfs msdos jfs xfs reiserfs ext4 jbd2 ext3 jbd ext2 mbcach
e nfsv4 ip6table_filter ip6_tables iptable_filter ip_tables ebtable_nat 
ebtables x_tables parport_pc ppdev lp parport autofs4 uinpu
t rpcsec_gss_krb5 nfsd auth_rpcgss oid_registry nfs_acl nfs lockd 
dns_resolver fscache sunrpc nls_utf8 nls_cp437 vfat fat loop dm_c
rypt joydev usb_storage btusb bluetooth crc16 snd_hda_codec_realtek 
snd_hda_codec_hdmi iTCO_wdt iTCO_vendor_support arc4 mxm_wmi ev
dev ath9k ath9k_common ath9k_hw ath mac80211 coretemp snd_hda_intel 
snd_hda_codec kvm_intel snd_hwdep snd_seq cfg80211 snd_pcm kvm
snd_page_alloc snd_seq_device snd_timer rfkill efi_pstore psmouse 
serio_raw microcode pcspkr i2c_i801 lpc_ich mfd_core efivars mei_
me mei i915 snd wmi acpi_cpufreq mperf drm_kms_helper video drm 
i2c_algo_bit button i2c_core soundcore processor btrfs xor zlib_deflate 
hid_generic usbhid hid raid6_pq libcrc32c dm_mod sg sr_mod sd_mod cdrom 
crc_t10dif crc32c_intel ghash_clmulni_intel aesni_intel aes_x86_64 
ablk_helper cryptd lrw gf128mul glue_helper ahci libahci libata scsi_mod 
thermal fan thermal_sys xhci_hcd r8169 mii ehci_pci ehci_hcd usbcore 
usb_common
[319628.023168] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.10-3-amd64 
#1 Debian 3.10.11-1
[319628.023169] Hardware name: MSI MS-7823/H87M-G43 (MS-7823), BIOS V1.2 
06/07/2013
[319628.023171]  0000000000000000 ffffffff8103bb70 0000000000000000 
0000000000004320
[319628.023174]  0000000000000001 ffff8801ef365801 0000000000000000 
ffffffff812fe930
[319628.023176]  0000000000000000 0000000000004320 ffff88041ea03a60 
ffff8801ef3658c0
[319628.023178] Call Trace:
[319628.023180]  <IRQ>  [<ffffffff8103bb70>] ? 
warn_slowpath_common+0x5b/0x70
[319628.023187]  [<ffffffff812fe930>] ? 
tcp_fastretrans_alert+0x13b/0x923
[319628.023189]  [<ffffffff812ffac6>] ? tcp_ack+0x94e/0xb26
[319628.023192]  [<ffffffff81041f31>] ? 
_local_bh_enable_ip.isra.17+0x1a/0x84
[319628.023195]  [<ffffffff8130048e>] ? tcp_rcv_established+0x53c/0x5de
[319628.023200]  [<ffffffff812b5f6f>] ? sock_def_readable+0x41/0x44
[319628.023203]  [<ffffffff81308c0e>] ? tcp_v4_do_rcv+0x1d3/0x3d8
[319628.023205]  [<ffffffff812b973a>] ? skb_checksum+0x47/0x1af
[319628.023208]  [<ffffffff813096a8>] ? tcp_v4_rcv+0x2b2/0x559
[319628.023211]  [<ffffffff812e7e99>] ? nf_hook_slow+0x69/0xfd
[319628.023215]  [<ffffffff812ecb9d>] ? 
__xfrm_policy_check2.constprop.9+0x4c/0x4c
[319628.023217]  [<ffffffff812ecc9d>] ? 
ip_local_deliver_finish+0x100/0x176
[319628.023221]  [<ffffffff812c4fef>] ? 
__netif_receive_skb_core+0x42f/0x4a5
[319628.023223]  [<ffffffff812c523e>] ? netif_receive_skb+0x4c/0x7d
[319628.023235]  [<ffffffffa04ccd2a>] ? ieee80211_deliver_skb+0xbd/0xfa 
[mac80211]
[319628.023244]  [<ffffffffa04ce069>] ? 
ieee80211_rx_handlers+0x10a3/0x1b63 [mac80211]
[319628.023248]  [<ffffffff81079900>] ? 
tick_do_update_jiffies64+0x37/0x9e
[319628.023252]  [<ffffffff811c6bc4>] ? timerqueue_add+0x79/0x97
[319628.023260]  [<ffffffffa04cf31d>] ? 
ieee80211_prepare_and_rx_handle+0x7c6/0x827 [mac80211]
[319628.023266]  [<ffffffffa04a2f53>] ? ath_tx_complete+0xad/0x13b 
[ath9k]
[319628.023273]  [<ffffffffa04cf88b>] ? ieee80211_rx+0x50d/0x61d 
[mac80211]
[319628.023278]  [<ffffffffa04a264f>] ? ath_rx_tasklet+0xb9b/0xcbd 
[ath9k]
[319628.023284]  [<ffffffffa04a0936>] ? ath9k_tasklet+0xc1/0x10b [ath9k]
[319628.023286]  [<ffffffff8104256d>] ? tasklet_action+0x73/0xc2
[319628.023288]  [<ffffffff810421cb>] ? __do_softirq+0xea/0x205
[319628.023290]  [<ffffffff810423b0>] ? irq_exit+0x3e/0x81
[319628.023293]  [<ffffffff8100e697>] ? do_IRQ+0x80/0x95
[319628.023296]  [<ffffffff8138646d>] ? common_interrupt+0x6d/0x6d
[319628.023297]  <EOI>  [<ffffffff81073670>] ? ktime_get+0x5f/0x6b
[319628.023304]  [<ffffffff8129ecfd>] ? arch_local_irq_enable+0x7/0x8
[319628.023306]  [<ffffffff8129f0d1>] ? cpuidle_enter_state+0x52/0xc1
[319628.023309]  [<ffffffff8129f214>] ? cpuidle_idle_call+0xd4/0x143
[319628.023312]  [<ffffffff8101394c>] ? arch_cpu_idle+0x5/0x17
[319628.023314]  [<ffffffff810725eb>] ? cpu_startup_entry+0x10d/0x187
[319628.023318]  [<ffffffff816b3d3d>] ? start_kernel+0x3e8/0x3f3
[319628.023320]  [<ffffffff816b3777>] ? repair_env_string+0x54/0x54
[319628.023323]  [<ffffffff816b3598>] ? x86_64_start_kernel+0xf2/0xfd
[319628.023325] ---[ end trace 19a7e47c4b12d290 ]---




^ permalink raw reply

* [PATCH v4] rt2x00: rt2800lib: remove duplicate rf_vals for RF3053
From: Kevin Lo @ 2013-10-14  2:05 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, users

lready have rf_vals_3x with same values.  Hence rf_vals_3053 is removed
in this patch.

Signed-off-by: Kevin Lo <kevlo@kevlo.org>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
---
Changes since v1:
 - update comment of rf_vals_3x to indicate that it also supports RF3053
 - add Paul's Acked-by tag
---
Changes since v2:
 - the previous patch was malformed
 - add Stanislaw's Acked-by tag
---
Changes since v3:
 - fix whitespace error
---

diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index a114cab..c755309 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -7248,7 +7248,7 @@ static const struct rf_channel rf_vals[] = {
 
 /*
  * RF value list for rt3xxx
- * Supports: 2.4 GHz (all) & 5.2 GHz (RF3052)
+ * Supports: 2.4 GHz (all) & 5.2 GHz (RF3052 & RF3053)
  */
 static const struct rf_channel rf_vals_3x[] = {
 	{1,  241, 2, 2 },
@@ -7444,72 +7444,6 @@ static const struct rf_channel rf_vals_5592_xtal40[] = {
 	{196, 83, 0, 12, 1},
 };
 
-static const struct rf_channel rf_vals_3053[] = {
-	/* Channel, N, R, K */
-	{1, 241, 2, 2},
-	{2, 241, 2, 7},
-	{3, 242, 2, 2},
-	{4, 242, 2, 7},
-	{5, 243, 2, 2},
-	{6, 243, 2, 7},
-	{7, 244, 2, 2},
-	{8, 244, 2, 7},
-	{9, 245, 2, 2},
-	{10, 245, 2, 7},
-	{11, 246, 2, 2},
-	{12, 246, 2, 7},
-	{13, 247, 2, 2},
-	{14, 248, 2, 4},
-
-	{36, 0x56, 0, 4},
-	{38, 0x56, 0, 6},
-	{40, 0x56, 0, 8},
-	{44, 0x57, 0, 0},
-	{46, 0x57, 0, 2},
-	{48, 0x57, 0, 4},
-	{52, 0x57, 0, 8},
-	{54, 0x57, 0, 10},
-	{56, 0x58, 0, 0},
-	{60, 0x58, 0, 4},
-	{62, 0x58, 0, 6},
-	{64, 0x58, 0, 8},
-
-	{100, 0x5B, 0, 8},
-	{102, 0x5B, 0, 10},
-	{104, 0x5C, 0, 0},
-	{108, 0x5C, 0, 4},
-	{110, 0x5C, 0, 6},
-	{112, 0x5C, 0, 8},
-
-	/* NOTE: Channel 114 has been removed intentionally.
-	 * The EEPROM contains no TX power values for that,
-	 * and it is disabled in the vendor driver as well.
-	 */
-
-	{116, 0x5D, 0, 0},
-	{118, 0x5D, 0, 2},
-	{120, 0x5D, 0, 4},
-	{124, 0x5D, 0, 8},
-	{126, 0x5D, 0, 10},
-	{128, 0x5E, 0, 0},
-	{132, 0x5E, 0, 4},
-	{134, 0x5E, 0, 6},
-	{136, 0x5E, 0, 8},
-	{140, 0x5F, 0, 0},
-
-	{149, 0x5F, 0, 9},
-	{151, 0x5F, 0, 11},
-	{153, 0x60, 0, 1},
-	{157, 0x60, 0, 5},
-	{159, 0x60, 0, 7},
-	{161, 0x60, 0, 9},
-	{165, 0x61, 0, 1},
-	{167, 0x61, 0, 3},
-	{169, 0x61, 0, 5},
-	{171, 0x61, 0, 7},
-	{173, 0x61, 0, 9},
-};
-
 static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 {
 	struct hw_mode_spec *spec = &rt2x00dev->spec;
@@ -7599,14 +7533,11 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 		   rt2x00_rf(rt2x00dev, RF5392)) {
 		spec->num_channels = 14;
 		spec->channels = rf_vals_3x;
-	} else if (rt2x00_rf(rt2x00dev, RF3052)) {
+	} else if (rt2x00_rf(rt2x00dev, RF3052) ||
+		   rt2x00_rf(rt2x00dev, RF3053)) {
 		spec->supported_bands |= SUPPORT_BAND_5GHZ;
 		spec->num_channels = ARRAY_SIZE(rf_vals_3x);
 		spec->channels = rf_vals_3x;
-	} else if (rt2x00_rf(rt2x00dev, RF3053)) {
-		spec->supported_bands |= SUPPORT_BAND_5GHZ;
-		spec->num_channels = ARRAY_SIZE(rf_vals_3053);
-		spec->channels = rf_vals_3053;
 	} else if (rt2x00_rf(rt2x00dev, RF5592)) {
 		spec->supported_bands |= SUPPORT_BAND_5GHZ;
 

^ permalink raw reply related

* Re: [PATCH] rtlwifi: Add new firmware files for rtl8192cu
From: Larry Finger @ 2013-10-14  0:15 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: dwmw2, linux-wireless
In-Reply-To: <1381691458.1301.63.camel@deadeye.wl.decadent.org.uk>

On 10/13/2013 02:10 PM, Ben Hutchings wrote:
> On Tue, 2013-10-08 at 10:00 -0500, Larry Finger wrote:
>> On 09/26/2013 05:26 PM, Larry Finger wrote:
>>> The vendor driver rtl8188C_8192C_8192D_usb_linux_v3.4.2_3727.20120404
>>> includes new firmware files. These were extracted from data statements
>>> in that driver to form these files.
>>>
>>> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>>> ---
>>>    WHENCE                       |   3 +++
>>>    rtlwifi/rtl8192cufw_A.bin    | Bin 0 -> 16116 bytes
>>>    rtlwifi/rtl8192cufw_B.bin    | Bin 0 -> 16096 bytes
>>>    rtlwifi/rtl8192cufw_TMSC.bin | Bin 0 -> 16116 bytes
>>>    4 files changed, 3 insertions(+)
>>>    create mode 100644 rtlwifi/rtl8192cufw_A.bin
>>>    create mode 100644 rtlwifi/rtl8192cufw_B.bin
>>>    create mode 100644 rtlwifi/rtl8192cufw_TMSC.bin
>>
>> I understand that you probably have too much to do, but I am inquiring about the
>> status of this submission and "[PATCH] rtlwifi: Add new firmware files for
>> rtl8188eu" that I sent on 09/27/2013.
> [...]
>
> I don't seem to have received them, but I assume the patches you sent
> after this are the same again.

Yes. I found the problem that caused you not to receive them.

Thanks,

Larry



^ permalink raw reply

* Re: [GIT PULL] firmware: wl1251 firmware binary
From: Ben Hutchings @ 2013-10-13 20:12 UTC (permalink / raw)
  To: balbi
  Cc: dwmw2, Luca Coelho, Linux Kernel Mailing List, linux-wireless,
	Pavel Machek
In-Reply-To: <20131002125535.GL1476@radagast>

[-- Attachment #1: Type: text/plain, Size: 1395 bytes --]

On Wed, 2013-10-02 at 07:55 -0500, Felipe Balbi wrote:
> Hi,
> 
> here's a pull request for wl4 firmware. I'll send a patch for wl1251
> driver updating firmware load path.
> 
> The following changes since commit b8ac7c7e27dcd13fa3c843aaf62457e9c57ea4db:
> 
>   linux-firmware: Add Brocade FC/FCOE Adapter firmware files (2013-09-30 04:53:32 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/balbi/linux-firmware.git wilink4
> 
> for you to fetch changes up to d726804dbc8dad88587b6be17716714cd91ed86c:
> 
>   ti-connectivity: add wl1251 firmware and license (2013-10-02 06:55:39 -0500)
> 
> ----------------------------------------------------------------
> Felipe Balbi (1):
>       ti-connectivity: add wl1251 firmware and license
> 
>  LICENCE.wl1251                 |  59 +++++++++++++++++++++++++++++++++++++++++
>  WHENCE                         |  18 +++++++++++++
>  ti-connectivity/wl1251-fw.bin  | Bin 0 -> 194180 bytes
>  ti-connectivity/wl1251-nvs.bin | Bin 0 -> 752 bytes
>  4 files changed, 77 insertions(+)
>  create mode 100644 LICENCE.wl1251
>  create mode 100644 ti-connectivity/wl1251-fw.bin
>  create mode 100644 ti-connectivity/wl1251-nvs.bin

Pulled, thanks.

Ben.

-- 
Ben Hutchings
Beware of bugs in the above code;
I have only proved it correct, not tried it. - Donald Knuth

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply

* Re: [PATCH] rtlwifi: Add new firmware files for rtl8188eu
From: Ben Hutchings @ 2013-10-13 20:07 UTC (permalink / raw)
  To: Larry Finger; +Cc: dwmw2, netdev, linux-wireless
In-Reply-To: <52549519.1010207@lwfinger.net>

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]

On Tue, 2013-10-08 at 18:28 -0500, Larry Finger wrote:
> The vendor driver RTL8188EUS_linux_v4.1.4_6773.20130222 contains
> firmware in the form of data statements. This info has been extracted
> into a binary file.
> 
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
>   WHENCE                  |   9 +++++++++
>   rtlwifi/rtl8188eufw.bin | Bin 0 -> 13904 bytes
>   2 files changed, 9 insertions(+)
>   create mode 100644 rtlwifi/rtl8188eufw.bin
[...]

Applied, thanks.

Ben.

-- 
Ben Hutchings
Beware of bugs in the above code;
I have only proved it correct, not tried it. - Donald Knuth

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply

* Re: [PATCH] rtlwifi: Add new firmware files for rtl8192cu
From: Ben Hutchings @ 2013-10-13 20:06 UTC (permalink / raw)
  To: Larry Finger; +Cc: dwmw2, linux-wireless
In-Reply-To: <525494DB.2060301@lwfinger.net>

[-- Attachment #1: Type: text/plain, Size: 871 bytes --]

On Tue, 2013-10-08 at 18:27 -0500, Larry Finger wrote:
> The vendor driver rtl8188C_8192C_8192D_usb_linux_v3.4.2_3727.20120404
> includes new firmware files. These were extracted from data statements
> in that driver to form these files.
> 
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
>   WHENCE                       |   3 +++
>   rtlwifi/rtl8192cufw_A.bin    | Bin 0 -> 16116 bytes
>   rtlwifi/rtl8192cufw_B.bin    | Bin 0 -> 16096 bytes
>   rtlwifi/rtl8192cufw_TMSC.bin | Bin 0 -> 16116 bytes
>   4 files changed, 3 insertions(+)
>   create mode 100644 rtlwifi/rtl8192cufw_A.bin
>   create mode 100644 rtlwifi/rtl8192cufw_B.bin
>   create mode 100644 rtlwifi/rtl8192cufw_TMSC.bin
[...]

Applied, thanks.

Ben.

-- 
Ben Hutchings
Beware of bugs in the above code;
I have only proved it correct, not tried it. - Donald Knuth

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply

* Re: [PATCH 0/4] brcm: rename firmware files and add new files
From: Ben Hutchings @ 2013-10-13 20:06 UTC (permalink / raw)
  To: Arend van Spriel; +Cc: Linux Wireless
In-Reply-To: <1380617590-5120-1-git-send-email-arend@broadcom.com>

[-- Attachment #1: Type: text/plain, Size: 1890 bytes --]

On Tue, 2013-10-01 at 10:53 +0200, Arend van Spriel wrote:
> This series renames the firmware files to match the required filenames in
> the brcmfmac driver. Previously, these files needed to be copied/linked to
> a generic name that was used in the driver. So for older kernels this is still
> needed.
> 
> Also included are new firmware files for BCM43241 and BCM4335. The brcmfmac
> driver lists some more firmware files, but firmware is not yet released for
> those chips.
> 
> Arend van Spriel (4):
>   brcm: rename firmware names expressing host interface type
>   brcm: add firmware file for BCM43241 SDIO chipset
>   brcm: add firmware for newer version of BCM43241 SDIO chipset
>   brcm: add firmware file for the BCM4335 SDIO chipset
> 
>  WHENCE                                           |    9 ++++++---
>  brcm/brcmfmac43241b0-sdio.bin                    |  Bin 0 -> 455745 bytes
>  brcm/brcmfmac43241b4-sdio.bin                    |  Bin 0 -> 403855 bytes
>  brcm/{brcmfmac4329.bin => brcmfmac4329-sdio.bin} |  Bin 253748 -> 253748 bytes
>  brcm/{brcmfmac4330.bin => brcmfmac4330-sdio.bin} |  Bin 222126 -> 222126 bytes
>  brcm/{brcmfmac4334.bin => brcmfmac4334-sdio.bin} |  Bin 451566 -> 451566 bytes
>  brcm/brcmfmac4335-sdio.bin                       |  Bin 0 -> 569291 bytes
>  7 files changed, 6 insertions(+), 3 deletions(-)
>  create mode 100644 brcm/brcmfmac43241b0-sdio.bin
>  create mode 100644 brcm/brcmfmac43241b4-sdio.bin
>  rename brcm/{brcmfmac4329.bin => brcmfmac4329-sdio.bin} (100%)
>  rename brcm/{brcmfmac4330.bin => brcmfmac4330-sdio.bin} (100%)
>  rename brcm/{brcmfmac4334.bin => brcmfmac4334-sdio.bin} (100%)
>  create mode 100644 brcm/brcmfmac4335-sdio.bin

I've applied all of these, thanks.

Ben.

-- 
Ben Hutchings
Beware of bugs in the above code;
I have only proved it correct, not tried it. - Donald Knuth

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply

* Re: [PATCH] rtlwifi: Add new firmware files for rtl8192cu
From: Ben Hutchings @ 2013-10-13 19:10 UTC (permalink / raw)
  To: Larry Finger; +Cc: dwmw2, linux-wireless
In-Reply-To: <52541E22.2040904@lwfinger.net>

[-- Attachment #1: Type: text/plain, Size: 1239 bytes --]

On Tue, 2013-10-08 at 10:00 -0500, Larry Finger wrote:
> On 09/26/2013 05:26 PM, Larry Finger wrote:
> > The vendor driver rtl8188C_8192C_8192D_usb_linux_v3.4.2_3727.20120404
> > includes new firmware files. These were extracted from data statements
> > in that driver to form these files.
> >
> > Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> > ---
> >   WHENCE                       |   3 +++
> >   rtlwifi/rtl8192cufw_A.bin    | Bin 0 -> 16116 bytes
> >   rtlwifi/rtl8192cufw_B.bin    | Bin 0 -> 16096 bytes
> >   rtlwifi/rtl8192cufw_TMSC.bin | Bin 0 -> 16116 bytes
> >   4 files changed, 3 insertions(+)
> >   create mode 100644 rtlwifi/rtl8192cufw_A.bin
> >   create mode 100644 rtlwifi/rtl8192cufw_B.bin
> >   create mode 100644 rtlwifi/rtl8192cufw_TMSC.bin
> 
> I understand that you probably have too much to do, but I am inquiring about the 
> status of this submission and "[PATCH] rtlwifi: Add new firmware files for 
> rtl8188eu" that I sent on 09/27/2013.
[...]

I don't seem to have received them, but I assume the patches you sent
after this are the same again.

Ben.

-- 
Ben Hutchings
Beware of bugs in the above code;
I have only proved it correct, not tried it. - Donald Knuth

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply

* Re: [Patch 1/1]: libertas/sdio: fix releasing memory twice.
From: Dr. H. Nikolaus Schaller @ 2013-10-13  7:09 UTC (permalink / raw)
  To: Dan Williams
  Cc: John W. Linville, Bing Zhao, Harro Haan, libertas-dev,
	linux-wireless, netdev, LKML, Belisko Marek, NeilBrown Brown
In-Reply-To: <1381607911.21655.7.camel@dcbw.foobar.com>

Hi Dan,

Am 12.10.2013 um 21:58 schrieb Dan Williams:

> On Sat, 2013-10-12 at 18:02 +0200, Dr. H. Nikolaus Schaller wrote:
>> While upgrading the GTA04 kernel to 3.12-rc4 we came across
>> an issue with libertas/sdio referencing stale memory on ifconfig up
>> when trying to load the firmware (for a second time).
>> 
>> I am not at all sure if the patch is how it should be done and the right
>> location, but it appears to work for us with resetting priv->helper_fw to NULL
>> before asynchronously loading the firmware again.
> 
> How about we go even simpler?  helper_fw is *only* used inside
> firmware.c anyway, and that's probably where its lifetime should be
> handled.  Same for the main firmware.  I have no idea why the bus code
> is responsible for releasing the firmware anyway, when it originates
> from firmware.c and control returns back there after the firmware loaded
> callback is done.  Does the following patch fix your problem too?

Yes, it works!

I think your approach is much better from software architecture point
of view than our hack.

Thank you,
Nikolaus

> 
> Dan
> 
> ---
> diff --git a/drivers/net/wireless/libertas/firmware.c b/drivers/net/wireless/libertas/firmware.c
> index c0f9e7e..51b92b5 100644
> --- a/drivers/net/wireless/libertas/firmware.c
> +++ b/drivers/net/wireless/libertas/firmware.c
> @@ -49,14 +49,19 @@ static void main_firmware_cb(const struct firmware *firmware, void *context)
> 		/* Failed to find firmware: try next table entry */
> 		load_next_firmware_from_table(priv);
> 		return;
> 	}
> 
> 	/* Firmware found! */
> 	lbs_fw_loaded(priv, 0, priv->helper_fw, firmware);
> +	if (priv->helper_fw) {
> +		release_firmware (priv->helper_fw);
> +		priv->helper_fw = NULL;
> +	}
> +	release_firmware (firmware);
> }
> 
> static void helper_firmware_cb(const struct firmware *firmware, void *context)
> {
> 	struct lbs_private *priv = context;
> 
> 	if (!firmware) {
> diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
> index c94dd68..ef8c98e 100644
> --- a/drivers/net/wireless/libertas/if_cs.c
> +++ b/drivers/net/wireless/libertas/if_cs.c
> @@ -750,22 +750,22 @@ static void if_cs_prog_firmware(struct lbs_private *priv, int ret,
> 	}
> 
> 	/* Load the firmware */
> 	ret = if_cs_prog_helper(card, helper);
> 	if (ret == 0 && (card->model != MODEL_8305))
> 		ret = if_cs_prog_real(card, mainfw);
> 	if (ret)
> -		goto out;
> +		return;
> 
> 	/* Now actually get the IRQ */
> 	ret = request_irq(card->p_dev->irq, if_cs_interrupt,
> 		IRQF_SHARED, DRV_NAME, card);
> 	if (ret) {
> 		pr_err("error in request_irq\n");
> -		goto out;
> +		return;
> 	}
> 
> 	/*
> 	 * Clear any interrupt cause that happened while sending
> 	 * firmware/initializing card
> 	 */
> 	if_cs_write16(card, IF_CS_CARD_INT_CAUSE, IF_CS_BIT_MASK);
> @@ -773,18 +773,14 @@ static void if_cs_prog_firmware(struct lbs_private *priv, int ret,
> 
> 	/* And finally bring the card up */
> 	priv->fw_ready = 1;
> 	if (lbs_start_card(priv) != 0) {
> 		pr_err("could not activate card\n");
> 		free_irq(card->p_dev->irq, card);
> 	}
> -
> -out:
> -	release_firmware(helper);
> -	release_firmware(mainfw);
> }
> 
> 
> /********************************************************************/
> /* Callback functions for libertas.ko                               */
> /********************************************************************/
> 
> diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
> index 4557833..991238a 100644
> --- a/drivers/net/wireless/libertas/if_sdio.c
> +++ b/drivers/net/wireless/libertas/if_sdio.c
> @@ -704,28 +704,24 @@ static void if_sdio_do_prog_firmware(struct lbs_private *priv, int ret,
> 	if (ret) {
> 		pr_err("failed to find firmware (%d)\n", ret);
> 		return;
> 	}
> 
> 	ret = if_sdio_prog_helper(card, helper);
> 	if (ret)
> -		goto out;
> +		return;
> 
> 	lbs_deb_sdio("Helper firmware loaded\n");
> 
> 	ret = if_sdio_prog_real(card, mainfw);
> 	if (ret)
> -		goto out;
> +		return;
> 
> 	lbs_deb_sdio("Firmware loaded\n");
> 	if_sdio_finish_power_on(card);
> -
> -out:
> -	release_firmware(helper);
> -	release_firmware(mainfw);
> }
> 
> static int if_sdio_prog_firmware(struct if_sdio_card *card)
> {
> 	int ret;
> 	u16 scratch;
> 
> diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
> index 4bb6574..87ff0ca 100644
> --- a/drivers/net/wireless/libertas/if_spi.c
> +++ b/drivers/net/wireless/libertas/if_spi.c
> @@ -1090,19 +1090,15 @@ static int if_spi_init_card(struct if_spi_card *card)
> 	}
> 
> 	err = spu_set_interrupt_mode(card, 0, 1);
> 	if (err)
> 		goto out;
> 
> out:
> -	release_firmware(helper);
> -	release_firmware(mainfw);
> -
> 	lbs_deb_leave_args(LBS_DEB_SPI, "err %d\n", err);
> -
> 	return err;
> }
> 
> static void if_spi_resume_worker(struct work_struct *work)
> {
> 	struct if_spi_card *card;
> 
> diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
> index 2798077..dff08a2 100644
> --- a/drivers/net/wireless/libertas/if_usb.c
> +++ b/drivers/net/wireless/libertas/if_usb.c
> @@ -840,15 +840,15 @@ static void if_usb_prog_firmware(struct lbs_private *priv, int ret,
> 		pr_err("failed to find firmware (%d)\n", ret);
> 		goto done;
> 	}
> 
> 	cardp->fw = fw;
> 	if (check_fwfile_format(cardp->fw->data, cardp->fw->size)) {
> 		ret = -EINVAL;
> -		goto release_fw;
> +		goto done;
> 	}
> 
> 	/* Cancel any pending usb business */
> 	usb_kill_urb(cardp->rx_urb);
> 	usb_kill_urb(cardp->tx_urb);
> 
> 	cardp->fwlastblksent = 0;
> @@ -857,15 +857,15 @@ static void if_usb_prog_firmware(struct lbs_private *priv, int ret,
> 	cardp->fwfinalblk = 0;
> 	cardp->bootcmdresp = 0;
> 
> restart:
> 	if (if_usb_submit_rx_urb_fwload(cardp) < 0) {
> 		lbs_deb_usbd(&cardp->udev->dev, "URB submission is failed\n");
> 		ret = -EIO;
> -		goto release_fw;
> +		goto done;
> 	}
> 
> 	cardp->bootcmdresp = 0;
> 	do {
> 		int j = 0;
> 		i++;
> 		if_usb_issue_boot_command(cardp, BOOT_CMD_FW_BY_USB);
> @@ -879,22 +879,22 @@ restart:
> 	if (cardp->bootcmdresp == BOOT_CMD_RESP_NOT_SUPPORTED) {
> 		/* Return to normal operation */
> 		ret = -EOPNOTSUPP;
> 		usb_kill_urb(cardp->rx_urb);
> 		usb_kill_urb(cardp->tx_urb);
> 		if (if_usb_submit_rx_urb(cardp) < 0)
> 			ret = -EIO;
> -		goto release_fw;
> +		goto done;
> 	} else if (cardp->bootcmdresp <= 0) {
> 		if (--reset_count >= 0) {
> 			if_usb_reset_device(cardp);
> 			goto restart;
> 		}
> 		ret = -EIO;
> -		goto release_fw;
> +		goto done;
> 	}
> 
> 	i = 0;
> 
> 	cardp->totalbytes = 0;
> 	cardp->fwlastblksent = 0;
> 	cardp->CRC_OK = 1;
> @@ -917,37 +917,34 @@ restart:
> 		if (--reset_count >= 0) {
> 			if_usb_reset_device(cardp);
> 			goto restart;
> 		}
> 
> 		pr_info("FW download failure, time = %d ms\n", i * 100);
> 		ret = -EIO;
> -		goto release_fw;
> +		goto done;
> 	}
> 
> 	cardp->priv->fw_ready = 1;
> 	if_usb_submit_rx_urb(cardp);
> 
> 	if (lbs_start_card(priv))
> -		goto release_fw;
> +		goto done;
> 
> 	if_usb_setup_firmware(priv);
> 
> 	/*
> 	 * EHS_REMOVE_WAKEUP is not supported on all versions of the firmware.
> 	 */
> 	priv->wol_criteria = EHS_REMOVE_WAKEUP;
> 	if (lbs_host_sleep_cfg(priv, priv->wol_criteria, NULL))
> 		priv->ehs_remove_supported = false;
> 
> - release_fw:
> -	release_firmware(cardp->fw);
> -	cardp->fw = NULL;
> -
>  done:
> +	cardp->fw = NULL;
> 	lbs_deb_leave(LBS_DEB_USB);
> }
> 
> 
> #ifdef CONFIG_PM
> static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
> {
> 
> 


^ permalink raw reply

* Re: pci-half-mini 7206 ac/bluetooth issues
From: Emmanuel Grumbach @ 2013-10-13  5:21 UTC (permalink / raw)
  To: Tim Nelson; +Cc: linux-wireless
In-Reply-To: <CAOAOC6Z4rrH5mDtqsJ=fskFfbsUVCSBCOY0r-irbhg21uxDwew@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3702 bytes --]

Hi,

please keep the wireless mailing list in the thread.


On Sat, Oct 12, 2013 at 9:05 PM, Tim Nelson <tim.l.nelson@gmail.com> wrote:
> I just got this after about an hour of pandora over my bluetooth:
>
> I had added the coex statement to the following config as well.  I
> will try seeing if perhaps compiling my own kernel by hand yields
> different results but I only get testing time on weekends outside of
> work so if you can give me some time, I will keep logs and see what my
> results are.  I may even get a second hardware card to ensure its not
> a hardware failure.
>
> root@nix-S405C:/home/nelsot08# more /etc/modprobe.d/iwlwifi.conf
> # /etc/modprobe.d/iwlwifi.conf
> # iwlwifi will dyamically load either iwldvm or iwlmvm depending on the
> # microcode file installed on the system.  When removing iwlwifi, first
> # remove the iwl?vm module and then iwlwifi.
> remove iwlwifi \
> (/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \
> && /sbin/modprobe -r mac80211
> options iwlwifi bt_coex_active=0
>
> Oct 12 14:00:45 nix-S405C kernel: [50730.682750] WARNING: CPU: 2 PID: 893 at /bu
> ild/buildd/linux-3.11.0/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c:1033 iwl_mvm
> _mac_ctxt_add+0x87/0xa0 [iwlmvm]()
> Oct 12 14:00:45 nix-S405C kernel: [50730.682752] Adding active MAC 0c:8b:fd:32:d
> e:c6/2
> Oct 12 14:00:45 nix-S405C kernel: [50730.682754] Modules linked in: nfnetlink_qu
> eue(F) nfnetlink_log(F) nfnetlink(F) md4(F) nls_utf8 cifs(F) fscache(F) hidp hid
>  pci_stub vboxpci(OF) vboxnetadp(OF) vboxnetflt(OF) vboxdrv(OF) dm_crypt(F) x86_
> pkg_temp_thermal intel_powerclamp coretemp kvm_intel(F) kvm(F) crc32_pclmul(F) a
> esni_intel(F) aes_i586(F) xts(F) lrw(F) gf128mul(F) ablk_helper(F) cryptd(F) snd
> _hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel snd_hda_codec joydev(F) uvcv
> ideo snd_hwdep(F) snd_pcm(F) videobuf2_vmalloc videobuf2_memops snd_page_alloc(F
> ) videobuf2_core snd_seq_midi(F) snd_seq_midi_event(F) arc4(F) snd_rawmidi(F) vi
> deodev snd_seq(F) snd_seq_device(F) snd_timer(F) iwlmvm asus_nb_wmi asus_wmi spa
> rse_keymap mac80211 btusb microcode(F) iwlwifi rtsx_pci_ms snd(F) soundcore(F) m
> ei_me psmouse(F) memstick mei cfg80211 serio_raw(F) lpc_ich mac_hid bnep rfcomm
> bluetooth parport_pc(F) ppdev(F) lp(F) parport(F) binfmt_misc(F) i915 rtsx_pci_s
> dmmc i2c_algo_bit drm_kms_helper drm r8169 ahci(F) libahci(F) mii(F) r
> Oct 12 14:00:45 nix-S405C kernel: tsx_pci wmi video(F)
> Oct 12 14:00:45 nix-S405C kernel: [50730.682803] CPU: 2 PID: 893 Comm: NetworkMa
> nager Tainted: GF       W  O 3.11.0-12-generic #19-Ubuntu
> Oct 12 14:00:45 nix-S405C kernel: [50730.682805] Hardware name: ASUSTeK COMPUTER
>  INC. K46CA/K46CA, BIOS K46CA.315 05/17/2013
> Oct 12 14:00:45 nix-S405C kernel: [50730.682807]  00000000 00000000 f0ff19b8 c16
> 2566b f0ff19f8 f0ff19e8 c105273e f91ed58f
> Oct 12 14:00:45 nix-S405C kernel: [50730.682812]  f0ff1a14 0000037d f91eb000 000
> 00409 f91d6567 f91d6567 f55c7cf4 f55c7c20
> Oct 12 14:00:45 nix-S405C kernel: [50730.682816]  00000000 f0ff1a00 c1052793 000
> 00009 f0ff19f8 f91ed58f f0ff1a14 f0ff1a20
> Oct 12 14:00:45 nix-S405C kernel: [50730.682821] Call Trace:
> Oct 12 14:00:45 nix-S405C kernel: [50730.682827]  [<c162566b>] dump_stack+0x41/0
> x52
> Oct 12 14:00:45 nix-S405C kernel: [50730.682831]  [<c105273e>] warn_slowpath_com
> mon+0x7e/0xa0
> Oct 12 14:00:45 nix-S405C kernel: [50730.682839]  [<f91d6567>] ? iwl_mvm_mac_ctx
> t_add+0x87/0xa0 [iwlmvm]

This looks like a side effect of the first issue (commands that fail
on timeout).
 Could you return to the default configuration (don't disable bt_coex
nor powersave), apply the attached patch and report back?
Thanks.

[-- Attachment #2: 0001-iwlwifi-pcie-poke-device-when-commands-don-t-complet.patch --]
[-- Type: application/octet-stream, Size: 2744 bytes --]

From 2bf517aa8da8d9c49eddc21e2adbb0bbe1363f91 Mon Sep 17 00:00:00 2001
From: Johannes Berg <johannes.berg@intel.com>
Date: Wed, 9 Oct 2013 09:59:25 +0200
Subject: [PATCH] iwlwifi: pcie: poke device when commands don't complete
 quickly

In certain corner cases in the firmware implementation, powersave
transitions can cause the firmware to miss the fact that commands
were added to the queue/FIFO and thus never processes them. Since
the commands really are in the queue, try to poke the firmware in
such cases (by grabbing NIC access, which wakes up the NIC) so it
notices the new command and processes it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 drivers/net/wireless/iwlwifi/pcie/tx.c | 31 ++++++++++++++++++++++++++-----
 1 file changed, 26 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c
index 5ad0871..5199fba 100644
--- a/drivers/net/wireless/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/tx.c
@@ -1471,7 +1471,8 @@ void iwl_pcie_hcmd_complete(struct iwl_trans *trans,
 	spin_unlock_bh(&txq->lock);
 }
 
-#define HOST_COMPLETE_TIMEOUT (2 * HZ)
+#define HOST_COMPLETE_TIMEOUT	(2 * HZ)
+#define COMMAND_POKE_TIMEOUT	(HZ / 10)
 
 static int iwl_pcie_send_hcmd_async(struct iwl_trans *trans,
 				    struct iwl_host_cmd *cmd)
@@ -1499,6 +1500,7 @@ static int iwl_pcie_send_hcmd_sync(struct iwl_trans *trans,
 	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
 	int cmd_idx;
 	int ret;
+	int timeout = HOST_COMPLETE_TIMEOUT;
 
 	IWL_DEBUG_INFO(trans, "Attempting to send sync command %s\n",
 		       get_cmd_string(trans_pcie, cmd->id));
@@ -1523,10 +1525,29 @@ static int iwl_pcie_send_hcmd_sync(struct iwl_trans *trans,
 		return ret;
 	}
 
-	ret = wait_event_timeout(trans_pcie->wait_command_queue,
-				 !test_bit(STATUS_HCMD_ACTIVE,
-					   &trans_pcie->status),
-				 HOST_COMPLETE_TIMEOUT);
+	while (timeout > 0) {
+		unsigned long flags;
+
+		timeout -= COMMAND_POKE_TIMEOUT;
+		ret = wait_event_timeout(trans_pcie->wait_command_queue,
+					 !test_bit(STATUS_HCMD_ACTIVE,
+						   &trans_pcie->status),
+					 COMMAND_POKE_TIMEOUT);
+		if (ret)
+			break;
+		/* poke the device - it may have lost the command */
+		if (iwl_trans_grab_nic_access(trans, true, &flags)) {
+			iwl_trans_release_nic_access(trans, &flags);
+			IWL_DEBUG_INFO(trans,
+				       "Tried to wake NIC for command %s\n",
+				       get_cmd_string(trans_pcie, cmd->id));
+		} else {
+			IWL_ERR(trans, "Failed to poke NIC for command %s\n",
+				get_cmd_string(trans_pcie, cmd->id));
+			break;
+		}
+	}
+
 	if (!ret) {
 		if (test_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status)) {
 			struct iwl_txq *txq =
-- 
1.8.1.msysgit.1


^ permalink raw reply related

* RE: [Ilw] trouble with wireless AC 7260 in ubuntu 13.04
From: Grumbach, Emmanuel @ 2013-10-13  4:49 UTC (permalink / raw)
  To: Ben Meiselman, linux-wireless@vger.kernel.org,
	ilw@linux.intel.com, Seth Forshee (seth.forshee@canonical.com)
  Cc: Yonah Meiselman
In-Reply-To: <CAHpj=KC=eRafrM4+bxO+nGg4UBCkV1toyei4HL_s+Svd_3BrtA@mail.gmail.com>

Hi,

First, please note that mails in any other format than plaintext won't go through the filters to the mailing list. So please, hit the plain text button in gmail.


> Hello supporters,

:) 

> I got your email addresses from here: http://wireless.kernel.org/en/users/Drivers/iwlwifi
> (Also copying my brother on this email.)

> I installed Ubuntu 13.04 on a new machine. It has an Intel Dual Band AC 7260 wireless card. I would like to connect to a wireless network but don't know how.
> I put iwlwifi-7260-7.ucode into /lib/firmware

I am not sure if Ubuntu 13.04 supports this new device already. I'd ask Seth Forshee (CCed).
This device is supported starting from kernel 3.10 which AFAIK is not shipped with Ubuntu 13.04. They may very well have added a backport based driver.

Can you please send the output of modinfo iwlmvm?
I also would like to see the output of dmesg.


>   *-network UNCLAIMED
>       description: Network controller
>    product: Intel Corporation
>      vendor: Intel Corporation
>       physical id: 0
>       bus info: pci@0000:03:00.0
>       version: 73
>       width: 64 bits
>       clock: 33MHz
>       capabilities: pm msi pciexpress bus_master cap_list
>       configuration: latency=0
>       resources: memory:f7c00000-f7c01fff



^ permalink raw reply

* [PATCH v2 2/2] cfg80211: add an option to disable processing country IEs
From: Mihir Shete @ 2013-10-13  4:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: Mihir Shete, Henri Bahini, Tushnim Bhattacharyya,
	Luis R. Rodriguez
In-Reply-To: <1381638697-2641-1-git-send-email-smihir@qti.qualcomm.com>

Certain vendors may want to disable the processing of
country IEs so that they can continue using the regulatory
domain the driver or user has set.  Currently there is no
way to stop the core from processing country IEs, so add
support to the core to ignore country IE hints.

Cc: Henri Bahini <hbahini@qca.qualcomm.com>
Cc: Tushnim Bhattacharyya <tushnimb@qca.qualcomm.com>
Cc: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Mihir Shete <smihir@qti.qualcomm.com>
---
 include/uapi/linux/nl80211.h | 5 +++++
 net/wireless/reg.c           | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 6e574ce..9746f55 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2343,9 +2343,14 @@ enum nl80211_reg_type {
  *	domain. The regulatory domain used will be based on the
  *	ISO3166-alpha2 from country IE provided through
  *	regulatory_hint_country_ie()
+ * @NL80211_COUNTRY_IE_IGNORE_CORE - for devices that have a preference to
+ *	to ignore all country IE information processed by the core. This will
+ *	override %NL80211_COUNTRY_IE_FOLLOW_POWER if the country IE hint is
+ *	issued by the core
  */
 enum nl80211_country_ie_pref {
 	NL80211_COUNTRY_IE_FOLLOW_POWER	= 1<<0,
+	NL80211_COUNTRY_IE_IGNORE_CORE	= 1<<1,
 };
 
 /**
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 87b4ee3..699c4dc 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1322,6 +1322,9 @@ get_reg_request_treatment(struct wiphy *wiphy,
 	case NL80211_REGDOM_SET_BY_CORE:
 		return REG_REQ_OK;
 	case NL80211_REGDOM_SET_BY_COUNTRY_IE:
+		if (wiphy->country_ie_pref & NL80211_COUNTRY_IE_IGNORE_CORE)
+			return REG_REQ_IGNORE;
+
 		if (reg_request_cell_base(lr)) {
 			/* Trust a Cell base station over the AP's country IE */
 			if (regdom_changes(pending_request->alpha2))
-- 
1.8.2.1


^ permalink raw reply related

* [PATCH v2 1/2] cfg80211: add flags to define country IE processing rules
From: Mihir Shete @ 2013-10-13  4:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: Mihir Shete, Henri Bahini, Tushnim Bhattacharyya,
	Luis R. Rodriguez
In-Reply-To: <1381638697-2641-1-git-send-email-smihir@qti.qualcomm.com>

802.11 cards may have different country IE parsing behavioural
preferences and vendors may want to support these. These preferences
were managed by the WIPHY_FLAG_CUSTOM_REGULATORY and the
WIPHY_FLAG_STRICT_REGULATORY flags and their combination.
Instead of using this existing notation, split out the country
IE behavioural preferences to a new flag. This will allow
us to add more customizations easily and make the code more
maintainable

Cc: Henri Bahini <hbahini@qca.qualcomm.com>
Cc: Tushnim Bhattacharyya <tushnimb@qca.qualcomm.com>
Cc: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Mihir Shete <smihir@qti.qualcomm.com>
---
 drivers/net/wireless/ath/regd.c |  1 +
 include/net/cfg80211.h          | 36 +++++++++++++++++++++++-------------
 include/uapi/linux/nl80211.h    | 28 ++++++++++++++++++++++++++++
 net/wireless/reg.c              |  8 +++-----
 4 files changed, 55 insertions(+), 18 deletions(-)

diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 7d077c7..cbf074c 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -513,6 +513,7 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
 		 */
 		regd = ath_world_regdomain(reg);
 		wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
+		wiphy->country_ie_pref = NL80211_COUNTRY_IE_FOLLOW_POWER;
 	} else {
 		/*
 		 * This gets applied in the case of the absence of CRDA,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 45f6bf5..9dd71f2 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2430,19 +2430,25 @@ struct cfg80211_ops {
  * 	has its own custom regulatory domain and cannot identify the
  * 	ISO / IEC 3166 alpha2 it belongs to. When this is enabled
  * 	we will disregard the first regulatory hint (when the
- * 	initiator is %REGDOM_SET_BY_CORE).
- * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will
- *	ignore regulatory domain settings until it gets its own regulatory
- *	domain via its regulatory_hint() unless the regulatory hint is
- *	from a country IE. After its gets its own regulatory domain it will
- *	only allow further regulatory domain settings to further enhance
- *	compliance. For example if channel 13 and 14 are disabled by this
- *	regulatory domain no user regulatory domain can enable these channels
- *	at a later time. This can be used for devices which do not have
- *	calibration information guaranteed for frequencies or settings
- *	outside of its regulatory domain. If used in combination with
- *	WIPHY_FLAG_CUSTOM_REGULATORY the inspected country IE power settings
- *	will be followed.
+ * 	initiator is %REGDOM_SET_BY_CORE). wiphys can set the custom
+ * 	regulatory domain using wiphy_apply_custom_regulatory()
+ * 	prior to wiphy registration.
+ * @WIPHY_FLAG_STRICT_REGULATORY: tells us that the wiphy for this device
+ * 	has regulatory domain that it wishes to be considered as the
+ * 	superset for regulatory rules. After this device gets its regulatory
+ * 	domain programmed further regulatory hints shall only be considered
+ * 	for this device to enhance regulatory compliance, forcing the
+ * 	device to only possibly use subsets of the original regulatory
+ * 	rules. For example if channel 13 and 14 are disabled by this
+ * 	device's regulatory domain no user specified regulatory hint which
+ * 	has these channels enabled would enable them for this wiphy,
+ * 	the device's original regulatory domain will be trusted as the
+ * 	base. You can program the superset of regulatory rules for this
+ * 	wiphy with regulatory_hint() for cards programmed with an
+ * 	ISO3166-alpha2 country code. wiphys that use regulatory_hint()
+ * 	will have their wiphy->regd programmed once the regulatory
+ * 	domain is set, and all other regulatory hints will be ignored
+ * 	until their own regulatory domain gets programmed.
  * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure
  *	that passive scan flags and beaconing flags may not be lifted by
  *	cfg80211 due to regulatory beacon hints. For more information on beacon
@@ -2773,6 +2779,8 @@ struct wiphy_coalesce_support {
  *	802.11-2012 8.4.2.29 for the defined fields.
  * @extended_capabilities_mask: mask of the valid values
  * @extended_capabilities_len: length of the extended capabilities
+ * @country_ie_pref: country IE processing preferences specified
+ *	by enum nl80211_country_ie_pref
  * @coalesce: packet coalescing support information
  */
 struct wiphy {
@@ -2844,6 +2852,8 @@ struct wiphy {
 	const u8 *extended_capabilities, *extended_capabilities_mask;
 	u8 extended_capabilities_len;
 
+	u8 country_ie_pref;
+
 	/* If multiple wiphys are registered and you're handed e.g.
 	 * a regular netdev with assigned ieee80211_ptr, you won't
 	 * know whether it points to a wiphy your driver has registered
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index fde2c02..6e574ce 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2321,6 +2321,34 @@ enum nl80211_reg_type {
 };
 
 /**
+ * enum nl80211_country_ie_pref - country IE processing preferences
+ *
+ * enumerates the different preferences an 802.11 card can advertize
+ * for parsing the country IEs. As per the current implementation
+ * country IEs are only used to derive the ISO3166-apha2, the
+ * information for power settings that comes with the country IE is
+ * ignored and we use the power settings from regdb.
+ *
+ *	The default behaviour for drivers that do not advertize any
+ *	preference to handle the country IE is to allow the core to
+ *	update channel flags according to the ISO3166-alpha2 in
+ *	the country IE. The applied power is -
+ *	MIN(power specified by custom domain, power obtained from regdb)
+ *
+ * @NL80211_COUNTRY_IE_FOLLOW_POWER - for devices that have a
+ *	preference that even though they may have programmed their own
+ *	custom power setting prior to wiphy registration, they want
+ *	to ensure their channel power settings are updated for this
+ *	connection with the power settings derived from the regulatory
+ *	domain. The regulatory domain used will be based on the
+ *	ISO3166-alpha2 from country IE provided through
+ *	regulatory_hint_country_ie()
+ */
+enum nl80211_country_ie_pref {
+	NL80211_COUNTRY_IE_FOLLOW_POWER	= 1<<0,
+};
+
+/**
  * enum nl80211_reg_rule_attr - regulatory rule attributes
  * @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved
  * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index d62cb1e..87b4ee3 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -898,13 +898,11 @@ static void handle_channel(struct wiphy *wiphy,
 	chan->max_reg_power = (int) MBM_TO_DBM(power_rule->max_eirp);
 	if (chan->orig_mpwr) {
 		/*
-		 * Devices that have their own custom regulatory domain
-		 * but also use WIPHY_FLAG_STRICT_REGULATORY will follow the
-		 * passed country IE power settings.
+		 * Devices that use NL80211_COUNTRY_IE_FOLLOW_POWER will always
+		 * follow the passed country IE power settings.
 		 */
 		if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE &&
-		    wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY &&
-		    wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY)
+		    wiphy->country_ie_pref & NL80211_COUNTRY_IE_FOLLOW_POWER)
 			chan->max_power = chan->max_reg_power;
 		else
 			chan->max_power = min(chan->orig_mpwr,
-- 
1.8.2.1


^ permalink raw reply related

* [PATCH v2 0/2] cfg80211: changes to add the country IE preferences
From: Mihir Shete @ 2013-10-13  4:31 UTC (permalink / raw)
  To: linux-wireless; +Cc: Mihir Shete

802.11 cards may have different country IE parsing preferences
and vendors have to support these. We currently provide support
for country IE behavioural preferences by using the flags
WIPHY_FLAG_STRICT_REGULATORY, WIPHY_FLAG_CUSTOM_REGULATORY and
their combination.

Instead of extending the definition by using the existing
regulatory flags, split out the desired behaviours into a new
wiphy flag. This will allow us to add more customizations in a
more easily maintainable fashion.

Mihir Shete (2):
  cfg80211: add flags to define country IE processing rules
  cfg80211: add an option to disable processing country IEs

 drivers/net/wireless/ath/regd.c |  1 +
 include/net/cfg80211.h          | 36 +++++++++++++++++++++++-------------
 include/uapi/linux/nl80211.h    | 33 +++++++++++++++++++++++++++++++++
 net/wireless/reg.c              | 11 ++++++-----
 4 files changed, 63 insertions(+), 18 deletions(-)

-- 
1.8.2.1


^ permalink raw reply

* Re: [PATCH 1/2] cfg80211: add flags to define country IE processing rules
From: Mihir Shete @ 2013-10-13  3:38 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <1381635046-15123-2-git-send-email-smihir@qti.qualcomm.com>

Please ignore, I will upload a new patchset.

Sorry :(



-- 
~Mihir~

^ permalink raw reply

* [PATCH 2/2] cfg80211: add an option to disable processing country IEs
From: Mihir Shete @ 2013-10-13  3:30 UTC (permalink / raw)
  To: linux-wireless
  Cc: Mihir Shete, Henri Bahini, Tushnim Bhattacharyya,
	Luis R. Rodriguez
In-Reply-To: <1381635046-15123-1-git-send-email-smihir@qti.qualcomm.com>

Certain vendors may want to disable the processing of
country IEs so that they can continue using the regulatory
domain the driver or user has set.  Currently there is no
way to stop the core from processing country IEs, so add
support to the core to ignore country IE hints.

Cc: Henri Bahini <hbahini@qca.qualcomm.com>
Cc: Tushnim Bhattacharyya <tushnimb@qca.qualcomm.com>
Cc: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Mihir Shete <smihir@qti.qualcomm.com>
---
 include/uapi/linux/nl80211.h | 5 +++++
 net/wireless/reg.c           | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 977c487..2a6ba5c 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2343,10 +2343,15 @@ enum nl80211_reg_type {
  *	domain. The regulatory domain used will be based on the
  *	ISO3166-alpha2 from country IE provided through
  *	regulatory_hint_country_ie()
+ * @NL80211_COUNTRY_IE_IGNORE_CORE - for devices that have a preference to
+ *	to ignore all country IE information processed by the core. This will
+ *	override %NL80211_COUNTRY_IE_FOLLOW_POWER if the country IE hint is
+ *	issued by the core
  */
 enum nl80211_country_ie_pref {
 	NL80211_COUNTRY_IE_FOLLOW_CORE,
 	NL80211_COUNTRY_IE_FOLLOW_POWER = BIT(0),
+	NL80211_COUNTRY_IE_IGNORE_CORE = BIT(1),
 };
 
 /**
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 87b4ee3..699c4dc 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1322,6 +1322,9 @@ get_reg_request_treatment(struct wiphy *wiphy,
 	case NL80211_REGDOM_SET_BY_CORE:
 		return REG_REQ_OK;
 	case NL80211_REGDOM_SET_BY_COUNTRY_IE:
+		if (wiphy->country_ie_pref & NL80211_COUNTRY_IE_IGNORE_CORE)
+			return REG_REQ_IGNORE;
+
 		if (reg_request_cell_base(lr)) {
 			/* Trust a Cell base station over the AP's country IE */
 			if (regdom_changes(pending_request->alpha2))
-- 
1.8.2.1


^ permalink raw reply related


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