greearb | 22 Oct 21:22 2014

[PATCH v3 1/9] mac80211-hwsim: add ethtool stats support

From: Ben Greear <greearb@...>

This gives a view into packet activity at the virtual radio

Signed-off-by: Ben Greear <greearb@...>
 drivers/net/wireless/mac80211_hwsim.c | 75 ++++++++++++++++++++++++++++++++++-
 1 file changed, 74 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 6ffe073..0224cc3 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
 <at>  <at>  -450,6 +450,14  <at>  <at>  struct mac80211_hwsim_data {
 	s64 bcn_delta;
 	/* absolute beacon transmission time. Used to cover up "tx" delay. */
 	u64 abs_bcn_ts;
+	/* Stats */
+	u64 tx_pkts;
+	u64 rx_pkts;
+	u64 tx_bytes;
+	u64 rx_bytes;
+	u64 tx_dropped;
+	u64 tx_failed;

 <at>  <at>  -865,8 +873,10  <at>  <at>  static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,
(Continue reading)

Felix Fietkau | 22 Oct 18:46 2014

[PATCH] ath10k: add SURVEY_INFO_IN_USE for current channel on survey

Signed-off-by: Felix Fietkau <nbd@...>
 drivers/net/wireless/ath/ath10k/mac.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 4670930..bc440dc 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
 <at>  <at>  -3975,6 +3975,9  <at>  <at>  static int ath10k_get_survey(struct ieee80211_hw *hw, int idx,

 	survey->channel = &sband->channels[idx];

+	if (ar->rx_channel == survey->channel)
+		survey->filled |= SURVEY_INFO_IN_USE;
 	return ret;


To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@...
More majordomo info at

Karl Beldan | 22 Oct 18:20 2014

[PATCH] mac80211: minstrel_ht: use group flags instead of index to display rates

From: Karl Beldan <karl.beldan@...>

When displaying a rate through debugfs minstrel_ht guesses its flags
comparing group indexes.  Since 3ec373c421b6 ("mac80211: minstrel_ht:
include type (cck/ht) in rates flag"), the rate flags of interest are
present in the mcs_group-s, so use it.
While improving the code, this also fixes a smatch false positive
"error: testing array offset 'i' after use" in minstrel_ht_stats_dump.
This warning only triggers after 9208247d74bc ("mac80211: minstrel_ht:
add basic support for VHT rates <= 3SS <at> 80MHz") with
is above MINSTREL_GROUPS_NB and smatch only barks when the "testing
array offset" seems to prevent possible out of bonds accesses (which
does not happen here since i < ARRAY_SIZE(mi->groups)).

Signed-off-by: Karl Beldan <karl.beldan@...>
Cc: Felix Fietkau <nbd@...>
 net/mac80211/rc80211_minstrel_ht_debugfs.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/net/mac80211/rc80211_minstrel_ht_debugfs.c b/net/mac80211/rc80211_minstrel_ht_debugfs.c
index 52bb6ef..20c676b 100644
--- a/net/mac80211/rc80211_minstrel_ht_debugfs.c
+++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c
 <at>  <at>  -22,16 +22,19  <at>  <at>  minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p)
 	unsigned int j, tp, prob, eprob;
 	char htmode = '2';
 	char gimode = 'L';
+	u32 gflags;
(Continue reading)

Felix Fietkau | 22 Oct 18:17 2014

[PATCH] ath9k_common: always update value in ath9k_cmn_update_txpow

In some cases the limit may be the same as reg->power_limit, but the
actual value that the hardware uses is not up to date. In that case, a
wrong value for current tx power is tracked internally.
Fix this by unconditionally updating it.

Signed-off-by: Felix Fietkau <nbd@...>
 drivers/net/wireless/ath/ath9k/common.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/common.c b/drivers/net/wireless/ath/ath9k/common.c
index c6dd7f1..33b0c7a 100644
--- a/drivers/net/wireless/ath/ath9k/common.c
+++ b/drivers/net/wireless/ath/ath9k/common.c
 <at>  <at>  -368,11 +368,11  <at>  <at>  void ath9k_cmn_update_txpow(struct ath_hw *ah, u16 cur_txpow,
 	struct ath_regulatory *reg = ath9k_hw_regulatory(ah);

-	if (reg->power_limit != new_txpow) {
+	if (reg->power_limit != new_txpow)
 		ath9k_hw_set_txpowerlimit(ah, new_txpow, false);
-		/* read back in case value is clamped */
-		*txpower = reg->max_power_level;
-	}
+	/* read back in case value is clamped */
+	*txpower = reg->max_power_level;

(Continue reading)

Felix Fietkau | 22 Oct 17:57 2014

[PATCH] mac80211: add support for driver tx power reporting

The configured tx power is often limited by hardware capabilities,
channel settings, antenna configuration, etc.

Signed-off-by: Felix Fietkau <nbd@...>
 include/net/mac80211.h | 5 +++++
 net/mac80211/cfg.c     | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 0ad1f47..41b0e60 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
 <at>  <at>  -2838,6 +2838,9  <at>  <at>  enum ieee80211_roc_type {
  *  <at> get_expected_throughput: extract the expected throughput towards the
  *	specified station. The returned value is expressed in Kbps. It returns 0
  *	if the RC algorithm does not have proper data to provide.
+ *
+ *  <at> get_txpower: get current maximum tx power (in dBm) based on configuration
+ *	and hardware limits.
 struct ieee80211_ops {
 	void (*tx)(struct ieee80211_hw *hw,
 <at>  <at>  -3039,6 +3042,8  <at>  <at>  struct ieee80211_ops {
 	int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
 	void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
 	u32 (*get_expected_throughput)(struct ieee80211_sta *sta);
+	int (*get_txpower)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+			   int *dbm);
(Continue reading)

Karsten Wiese | 22 Oct 15:47 2014

[PATCH 0/3] Fix rtl8192cu in 3.18-rc1

In 3.18-rc1 the rtl8192cu driver does not register a wlan%d device.
Attached patches fix that and the oopses I encountered.
Here the driver works again driving a device as station to a 802.11g 
access point.


To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@...
More majordomo info at

Felix Fietkau | 22 Oct 15:27 2014

[PATCH] ath: use CTL region from cfg80211 if unset in EEPROM

Many AP devices do not have the proper regulatory domain programmed in
EEPROM. Instead they expect the software to set the appropriate region.
For these devices, the country code defaults to US, and the driver uses
the US CTL tables as well.
On devices bought in Europe this can lead to tx power being set too high
on the band edges, even if the cfg80211 regdomain is set correctly.
Fix this issue by taking into account the DFS region, but only when the
EEPROM regdomain is set to default.

Signed-off-by: Felix Fietkau <nbd@...>
 drivers/net/wireless/ath/ath.h  |  1 +
 drivers/net/wireless/ath/regd.c | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h
index 9c56ecb..999d24f 100644
--- a/drivers/net/wireless/ath/ath.h
+++ b/drivers/net/wireless/ath/ath.h
 <at>  <at>  -80,6 +80,7  <at>  <at>  struct reg_dmn_pair_mapping {

 struct ath_regulatory {
 	char alpha2[2];
+	enum nl80211_dfs_regions region;
 	u16 country_code;
 	u16 max_power_level;
 	u16 current_rd;
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 415393d..06ea6cc 100644
--- a/drivers/net/wireless/ath/regd.c
(Continue reading)

Michal Kazior | 22 Oct 14:27 2014

[PATCH] ath10k: call correct function for frag threshold

Rts threshold was being configured instead of
fragmentation threshold.

Keep in mind available firmware binaries don't
seem to support fragmentation anyway so this
doesn't fix fragmentation threshold per se.

Signed-off-by: Michal Kazior <michal.kazior@...>
 drivers/net/wireless/ath/ath10k/mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index f6d2fd0..1d119116 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
 <at>  <at>  -3872,7 +3872,7  <at>  <at>  static int ath10k_set_frag_threshold(struct ieee80211_hw *hw, u32 value)
 		ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d fragmentation threshold %d\n",
 			   arvif->vdev_id, value);

-		ret = ath10k_mac_set_rts(arvif, value);
+		ret = ath10k_mac_set_frag(arvif, value);
 		if (ret) {
 			ath10k_warn(ar, "failed to set fragmentation threshold for vdev %d: %d\n",
 				    arvif->vdev_id, ret);


To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
(Continue reading)

Emmanuel Grumbach | 22 Oct 14:22 2014

[PATCH] mac80211: Export IE split function

From: Andrei Otcheretianski <andrei.otcheretianski@...>

Export ieee80211_ie_split function, so it can be reused by drivers
which require to insert additional elements.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@...>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@...>
 include/net/mac80211.h     | 28 ++++++++++++++++++++++++++++
 net/mac80211/ieee80211_i.h |  2 --
 net/mac80211/util.c        | 26 +-------------------------
 3 files changed, 29 insertions(+), 27 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 0ad1f47..52c94fa 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
 <at>  <at>  -4888,4 +4888,32  <at>  <at>  void ieee80211_update_p2p_noa(struct ieee80211_noa_data *data, u32 tsf);
 void ieee80211_tdls_oper_request(struct ieee80211_vif *vif, const u8 *peer,
 				 enum nl80211_tdls_operation oper,
 				 u16 reason_code, gfp_t gfp);
+ * ieee80211_ie_split - split an IE buffer according to ordering
+ *
+ *  <at> ies: the IE buffer
+ *  <at> ielen: the length of the IE buffer
+ *  <at> ids: an array with element IDs that are allowed before
+ *	the split
+ *  <at> n_ids: the size of the element ID array
(Continue reading)

Okhwan Lee | 22 Oct 12:14 2014

Change channel bandwidth without iw command


We are trying to implement a protocol to evaluate the performance our
algorithm using QCA9880.

To implement our protocol, a receiver have to change the bandwidth
when a Action frame (what we define) is successfully received.
We know that the QCA9880 can change bandwidth by using iw command in
monitor mode.
So, we use similar function path used by "iw dev set freq ..."
When the receiver detects the reception of the Action frame we call
"ieee80211_set_monitor_channel" at the end of ieee80211_rx as follows:

/*************** net/mac80211/rx.c ******************/

// receive action frame, change bandwidth 80 -> 20

                rtnl_lock(); //lock rtnetlink used in pre_doit of nl80211
                chandef = local->monitor_chandef; // copy current chandef
                chandef.width = NL80211_CHAN_WIDTH_20; // set bandwidth
                chandef.center_freq1 = 5180; // set center freq...
                ieee80211_set_monitor_channel(wiphy, &chandef);


However, the receiver invokes kernel panic when receives the Action frame.
As fas as we know, the panic is occurred in ath10k_config_chan of
ath10k device driver.
To the best our knowledge, our implementation exploits same function
(Continue reading)

Emmanuel Grumbach | 22 Oct 11:33 2014

[PATCH] mac80211: fix network header breakage during encryption

From: Arik Nemtsov <arik@...>

When an IV is generated, only the MAC header is moved back. The network
header location remains the same relative to the skb head, as the new IV
is using headroom space that was reserved in advance.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@...>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@...>
 net/mac80211/wep.c | 2 --
 net/mac80211/wpa.c | 5 -----
 2 files changed, 7 deletions(-)

diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c
index 9181fb6..a4220e9 100644
--- a/net/mac80211/wep.c
+++ b/net/mac80211/wep.c
 <at>  <at>  -111,8 +111,6  <at>  <at>  static u8 *ieee80211_wep_add_iv(struct ieee80211_local *local,
 	    (info->control.hw_key->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE))
 		return newhdr + hdrlen;

-	skb_set_network_header(skb, skb_network_offset(skb) +
-				    IEEE80211_WEP_IV_LEN);
 	ieee80211_wep_get_iv(local, keylen, keyidx, newhdr + hdrlen);
 	return newhdr + hdrlen;
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
index 983527a..12398fde 100644
--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
(Continue reading)