Re: [PATCH 1/1 net-next] mac80211: remove unnecessary null test before debugfs_remove

2014-10-22 Thread Johannes Berg
On Tue, 2014-10-21 at 22:05 +0200, Fabian Frederick wrote:

 I can also resubmit patch if necessary.

No worries, I've already applied the patch (with a modified commit
message).

johannes

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3] ath10k: Add the target register read/write and memory dump debugfs interface

2014-10-22 Thread Michal Kazior
On 21 October 2014 17:10, Li, Yanbo yan...@qti.qualcomm.com wrote:
 -Original Message-
 From: Michal Kazior [mailto:michal.kaz...@tieto.com]
 On 20 October 2014 18:38, Yanbo Li yan...@qti.qualcomm.com wrote:
[...]
  2. Read the value from mem value, the output is binary format
 IE:  hexdump mem_value
  Write operation:
  1. Write the start mem address to mem_addr
 IE:  echo 0x40  mem_addr
  2. Dump the binary value to the mem_value
 IE:  echo  0x2400  mem_value or echo 0x2400 0x3400 ...  mem_addr
 (the value number should be separated with spacebar)

 I don't really like the idea of input being different than the output, but 
 maybe that's
 just me.


 Hmm, I will implement  another version to keep the read and write use the 
 same interface,
 the extra effort is the user need edit the binary file to construct the input 
 number.

There's plenty of tools that can do that for you, e.g. xxd. If
mem_value would expect binary input you could do:

  echo 0x01 0x02 0x03 0x04 | xxd -r  mem_value

This would effectively put 4 bytes into the mem_value. Or you can use
perl and pack() to create endianess aware byte streams.


[...]
  +   i = 0;
  +   while (sptr) {
  +   if (!sptr)
  +   break;
  +
  +   token = strsep(sptr,  );
  +
  +   ret = kstrtou32(token, 0, mem_val);
  +   if (ret)
  +   goto err_free_value;
  +
  +   value[i] = mem_val;
  +   i++;
  +   }
  +
  +   ret = ath10k_hif_diag_write(ar, mem_addr, (const void *)value,
  +   i * sizeof(mem_val));
  +   if (ret) {
  +   ath10k_warn(ar, failed to write address 0x%08x via 
  diagnose window
 from debugfs: %d\n,
  +   mem_addr, ret);
  +   goto err_free_value;
  +   }

 I believe userspace may call write() multiple number of times with different 
 offsets
 and fragment the data breaking it in the middle of your string hex words. 
 This
 code will most likely fail with larger chunks of data or you can try to 
 simulate the
 fragmentation with:

   echo 0x0001 0x0002 | dd bs=1 of=mem_value

 (Please correct me if I'm wrong :-)

 Not full understand what’s you mean, do you mean this segment need be protect 
 with lock
 to avoid multi write operation access the mem_value at the same time?

This is not a problem with locking. The problem is you assume
ath10k_mem_value_write() is going to be called once.

I'm pretty sure that the above example (dd bs=1) will yield many
ath10k_mem_value_write() each with a single-byte buffer. This means
two things:
 a) kstrotu32() parsing will break
 b) you always call ath10k_hif_diag_write() with mem_addr without any
offset so even if (a) is ignored you'll just keep overwriting first
word in target memory over and over again

Having binary input (instead of hex string words) is going to help
with (a). To fix (b) you'll need to add *ppos to mem_addr when you
call ath10k_hif_diag_write().


Michał
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] ath9k patches

2014-10-22 Thread Sujith Manoharan
From: Sujith Manoharan c_man...@qca.qualcomm.com

Initval updates for AR9580 and AR955x.

$ ./verify_checksums.sh 
ar955x-1p0 b98d3c01075feed8b7154f5bfa8f122268cbe3c7 pass
ar9580-1p0 c7c799f2a30aff70b2125ea06cef23d1529c38fa fail
+03f9364192c676aa398e7da84e31f9db33ae2da4ar9580_1p0_baseband_postamble

An update in the baseband postamble is part of a larger
Noise Calibration fix.

Sujith

Sujith Manoharan (2):
  ath9k: Update AR9580 initvals
  ath9k: Update AR955x initvals

 .../net/wireless/ath/ath9k/ar955x_1p0_initvals.h   |   8 +-
 .../net/wireless/ath/ath9k/ar9580_1p0_initvals.h   | 144 -
 2 files changed, 147 insertions(+), 5 deletions(-)

-- 
2.1.2

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] ath9k: Update AR955x initvals

2014-10-22 Thread Sujith Manoharan
From: Sujith Manoharan c_man...@qca.qualcomm.com

* Fix a 11b/EVM issue by adjusting
  FIR filter coefficients.

* Fix a problem with receiving probe request
  frames sent at 11b rate.

Signed-off-by: Sujith Manoharan c_man...@qca.qualcomm.com
---
 drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h
index 74d8bc0..fd6a84c 100644
--- a/drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h
@@ -507,7 +507,7 @@ static const u32 ar955x_1p0_baseband_core[][2] = {
{0x9d04, 0x40206c10},
{0x9d08, 0x009c4060},
{0x9d0c, 0x9883800a},
-   {0x9d10, 0x01834061},
+   {0x9d10, 0x01884061},
{0x9d14, 0x00c0040b},
{0x9d18, 0x},
{0x9e08, 0x0038230c},
@@ -545,9 +545,9 @@ static const u32 ar955x_1p0_baseband_core[][2] = {
{0xa370, 0x},
{0xa390, 0x0001},
{0xa394, 0x0444},
-   {0xa398, 0x1f020503},
-   {0xa39c, 0x29180c03},
-   {0xa3a0, 0x9a8b6844},
+   {0xa398, 0x001f0e0f},
+   {0xa39c, 0x0075393f},
+   {0xa3a0, 0xb79f6427},
{0xa3a4, 0x},
{0xa3a8, 0x},
{0xa3ac, 0x3c466478},
-- 
2.1.2

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] ath9k: Update AR9580 initvals

2014-10-22 Thread Sujith Manoharan
From: Sujith Manoharan c_man...@qca.qualcomm.com

This fixes RX sensitivity issues with AR9580.

Signed-off-by: Sujith Manoharan c_man...@qca.qualcomm.com
---
 .../net/wireless/ath/ath9k/ar9580_1p0_initvals.h   | 144 -
 1 file changed, 143 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
index a5ca652..5d4629f 100644
--- a/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
@@ -24,7 +24,149 @@
 
 #define ar9580_1p0_soc_postamble ar9300_2p2_soc_postamble
 
-#define ar9580_1p0_radio_core ar9300_2p2_radio_core
+static const u32 ar9580_1p0_radio_core[][2] = {
+   /* Addr  allmodes  */
+   {0x00016000, 0x36db2db6},
+   {0x00016004, 0x6db6db40},
+   {0x00016008, 0x73f0},
+   {0x0001600c, 0x},
+   {0x00016040, 0x7f80fff8},
+   {0x0001604c, 0x76d005b5},
+   {0x00016050, 0x556cf031},
+   {0x00016054, 0x13449440},
+   {0x00016058, 0x0c51c92c},
+   {0x0001605c, 0x3db7fffc},
+   {0x00016060, 0xfffc},
+   {0x00016064, 0x000f0278},
+   {0x0001606c, 0x6db6},
+   {0x00016080, 0x},
+   {0x00016084, 0x0e48048c},
+   {0x00016088, 0x54214514},
+   {0x0001608c, 0x119f481e},
+   {0x00016090, 0x24926490},
+   {0x00016098, 0xd288},
+   {0x000160a0, 0x0a108ffe},
+   {0x000160a4, 0x812fc370},
+   {0x000160a8, 0x423c8000},
+   {0x000160b4, 0x92480080},
+   {0x000160c0, 0x00adb6d0},
+   {0x000160c4, 0x6db6db60},
+   {0x000160c8, 0x6db6db6c},
+   {0x000160cc, 0x01e6c000},
+   {0x00016100, 0x3fffbe01},
+   {0x00016104, 0xfff8},
+   {0x00016108, 0x00080010},
+   {0x00016144, 0x02084080},
+   {0x00016148, 0x},
+   {0x00016280, 0x058a0001},
+   {0x00016284, 0x3d840208},
+   {0x00016288, 0x05a20408},
+   {0x0001628c, 0x00038c07},
+   {0x00016290, 0x0004},
+   {0x00016294, 0x458a214f},
+   {0x00016380, 0x},
+   {0x00016384, 0x},
+   {0x00016388, 0x00800700},
+   {0x0001638c, 0x00800700},
+   {0x00016390, 0x00800700},
+   {0x00016394, 0x},
+   {0x00016398, 0x},
+   {0x0001639c, 0x},
+   {0x000163a0, 0x0001},
+   {0x000163a4, 0x0001},
+   {0x000163a8, 0x},
+   {0x000163ac, 0x},
+   {0x000163b0, 0x},
+   {0x000163b4, 0x},
+   {0x000163b8, 0x},
+   {0x000163bc, 0x},
+   {0x000163c0, 0x00a0},
+   {0x000163c4, 0x000c},
+   {0x000163c8, 0x14021402},
+   {0x000163cc, 0x1402},
+   {0x000163d0, 0x},
+   {0x000163d4, 0x},
+   {0x00016400, 0x36db2db6},
+   {0x00016404, 0x6db6db40},
+   {0x00016408, 0x73f0},
+   {0x0001640c, 0x},
+   {0x00016440, 0x7f80fff8},
+   {0x0001644c, 0x76d005b5},
+   {0x00016450, 0x556cf031},
+   {0x00016454, 0x13449440},
+   {0x00016458, 0x0c51c92c},
+   {0x0001645c, 0x3db7fffc},
+   {0x00016460, 0xfffc},
+   {0x00016464, 0x000f0278},
+   {0x0001646c, 0x6db6},
+   {0x00016500, 0x3fffbe01},
+   {0x00016504, 0xfff8},
+   {0x00016508, 0x00080010},
+   {0x00016544, 0x02084080},
+   {0x00016548, 0x},
+   {0x00016780, 0x},
+   {0x00016784, 0x},
+   {0x00016788, 0x00800700},
+   {0x0001678c, 0x00800700},
+   {0x00016790, 0x00800700},
+   {0x00016794, 0x},
+   {0x00016798, 0x},
+   {0x0001679c, 0x},
+   {0x000167a0, 0x0001},
+   {0x000167a4, 0x0001},
+   {0x000167a8, 0x},
+   {0x000167ac, 0x},
+   {0x000167b0, 0x},
+   {0x000167b4, 0x},
+   {0x000167b8, 0x},
+   {0x000167bc, 0x},
+   {0x000167c0, 0x00a0},
+   {0x000167c4, 0x000c},
+   {0x000167c8, 0x14021402},
+   {0x000167cc, 0x1402},
+   {0x000167d0, 0x},
+   {0x000167d4, 0x},
+   {0x00016800, 0x36db2db6},
+   {0x00016804, 0x6db6db40},
+   {0x00016808, 0x73f0},
+   {0x0001680c, 0x},
+   {0x00016840, 0x7f80fff8},
+   {0x0001684c, 0x76d005b5},
+   {0x00016850, 0x556cf031},
+   {0x00016854, 0x13449440},
+   {0x00016858, 0x0c51c92c},
+   {0x0001685c, 0x3db7fffc},
+   {0x00016860, 0xfffc},
+   {0x00016864, 0x000f0278},
+   {0x0001686c, 0x6db6},
+   {0x00016900, 0x3fffbe01},
+   {0x00016904, 0xfff8},
+   {0x00016908, 0x00080010},
+   {0x00016944, 0x02084080},
+   {0x00016948, 0x},
+   {0x00016b80, 0x},
+   {0x00016b84, 0x},
+   {0x00016b88, 0x00800700},
+   {0x00016b8c, 0x00800700},
+   {0x00016b90, 0x00800700},
+   {0x00016b94, 0x},
+   

Re: [PATCH 1/2] ath10k: remove tsf argument from rx_desc tracing

2014-10-22 Thread Michal Kazior
On 21 October 2014 15:54, Michal Kazior michal.kaz...@tieto.com wrote:
 Fundamtenally this was wrong. Tsf is only valid
 in first MPDU of a PPDU. This means tsf value was

s/first MPDU/last MPDU/

I must've had a brain fart when writing the commit log yesterday.

@Kalle: Should I re-spin or will you fix it before applying?


Michał
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: iwlwifi: Reason 7 periodic disconnect

2014-10-22 Thread Emmanuel Grumbach
On Tue, Oct 21, 2014 at 10:56 PM, Laurențiu Nicola lnic...@dend.ro wrote:
 Yep! `scb_timeout` is 60 on my router.

 On Tue, Oct 21, 2014, at 14:00, poma wrote:
 On 21.10.2014 10:35, Felix Fietkau wrote:
  On 2014-10-21 10:23, Laurențiu Nicola wrote:
  It's an ASUS RT-N66U running NEWD-2/K3X from r24160.
  This is a Broadcom based device, so it should behave in the same way as
  other APs/Routers running the Broadcom drivers.
  The driver should only send Reason 7 when receiving a PS-Poll, BlockAck,
  BlockAckReq or Action frame from a station that's not associated, so
  probably it has already kicked out your iwlwifi client earlier. Not sure
  why that doesn't show up in the log though.
 

 Whether this might refer to the Station Control Block Timeout value

 http://www.dd-wrt.com/wiki/index.php/Wl#scb_timeout
 ...
 scb_timeout

 AP only: inactivity timeout value for authenticated stas


Actually, mac80211 should be probing the AP every 30 seconds but a
beacon might abort the probe...
Can you try something like this:

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 75df184..c9db7cf 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3295,7 +3295,8 @@ static void ieee80211_rx_mgmt_beacon(struct
ieee80211_sub_if_data *sdata,
if (ifmgd-flags  IEEE80211_STA_CONNECTION_POLL) {
mlme_dbg_ratelimited(sdata,
 cancelling AP probe due to a
received beacon\n);
-   ieee80211_reset_ap_probe(sdata);
+   pr_err(Not cancelling the probe to make sure the AP
hears us from time to time\n);
+   //ieee80211_reset_ap_probe(sdata);
}

/*




 poma


 --
 To unsubscribe from this list: send the line unsubscribe linux-wireless
 in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] mac80211: add stations in order to the station list

2014-10-22 Thread Emmanuel Grumbach
From: Arik Nemtsov a...@wizery.com

During reconfig the station list is traversed in order and station are
added back to the driver. Make sure the stations are added to the driver
in the same order they were added to mac80211.

This has a real side effect - some drivers (iwlwifi) require TDLS
stations to be added only after the AP station for the same network.

Signed-off-by: Arik Nemtsov arikx.nemt...@intel.com
Signed-off-by: Emmanuel Grumbach emmanuel.grumb...@intel.com
---
 net/mac80211/sta_info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index de494df..2cd48ce 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -501,7 +501,7 @@ static int sta_info_insert_finish(struct sta_info *sta) 
__acquires(RCU)
/* make the station visible */
sta_info_hash_add(local, sta);
 
-   list_add_rcu(sta-list, local-sta_list);
+   list_add_tail_rcu(sta-list, local-sta_list);
 
/* notify driver */
err = sta_info_insert_drv_state(local, sdata, sta);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] mac80211: expose TDLS-initiator value to low level driver

2014-10-22 Thread Emmanuel Grumbach
From: Arik Nemtsov a...@wizery.com

Some drivers need to know which station is the TDLS link initiator.
Expose this value via the mac80211 ieee80211_sta structure.

Signed-off-by: Arik Nemtsov arikx.nemt...@intel.com
Signed-off-by: Emmanuel Grumbach emmanuel.grumb...@intel.com
---
 include/net/mac80211.h | 3 +++
 net/mac80211/tdls.c| 8 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index e544bbf..3a8cb99 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1427,6 +1427,8 @@ struct ieee80211_sta_rates {
  * @smps_mode: current SMPS mode (off, static or dynamic)
  * @rates: rate control selection table
  * @tdls: indicates whether the STA is a TDLS peer
+ * @tdls_initiator: indicates the STA is an initiator of the TDLS link. Only
+ * valid if the STA is a TDLS peer in the first place.
  */
 struct ieee80211_sta {
u32 supp_rates[IEEE80211_NUM_BANDS];
@@ -1442,6 +1444,7 @@ struct ieee80211_sta {
enum ieee80211_smps_mode smps_mode;
struct ieee80211_sta_rates __rcu *rates;
bool tdls;
+   bool tdls_initiator;
 
/* must be last */
u8 drv_priv[0] __aligned(sizeof(void *));
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index 4ea25de..b4f368e 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -562,8 +562,10 @@ ieee80211_tdls_prep_mgmt_packet(struct wiphy *wiphy, 
struct net_device *dev,
/* infer the initiator if we can, to support old userspace */
switch (action_code) {
case WLAN_TDLS_SETUP_REQUEST:
-   if (sta)
+   if (sta) {
set_sta_flag(sta, WLAN_STA_TDLS_INITIATOR);
+   sta-sta.tdls_initiator = false;
+   }
/* fall-through */
case WLAN_TDLS_SETUP_CONFIRM:
case WLAN_TDLS_DISCOVERY_REQUEST:
@@ -575,8 +577,10 @@ ieee80211_tdls_prep_mgmt_packet(struct wiphy *wiphy, 
struct net_device *dev,
 * Make the last packet sent take effect for the initiator
 * value.
 */
-   if (sta)
+   if (sta) {
clear_sta_flag(sta, WLAN_STA_TDLS_INITIATOR);
+   sta-sta.tdls_initiator = true;
+   }
/* fall-through */
case WLAN_PUB_ACTION_TDLS_DISCOVER_RES:
initiator = false;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Change channel bandwidth without iw command

2014-10-22 Thread Michal Kazior
On 22 October 2014 12:14, Okhwan Lee oh...@mwnl.snu.ac.kr wrote:
 Hi,

 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);
 rtnl_unlock();

 //

If my understanding is correct you're doing it wrong.

You probably want to modify chanctx of a vif the frame is associated
with and notify the driver via appropriate mac80211 helpers instead of
the hack above. Remember to get your locking right.


 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.

The panic printout would be most helpful. My best guess is this
crashes in ath10k_dbg() at the very beginning of ath10k_config_chan
because ar-chandef.chan is NULL. This is probably the case since you
use monitor_chandef which is probably empty at the point you invoke
your code.


 To the best our knowledge, our implementation exploits same function
 path of iw command in nl80211, cfg80211, mac80211 and ath10k.
 Moreover, we confirm that the input parameters (wiphy, chandef) in our
 implementation are identical to the parameters used by iw command.

 Is there any reason why we cannot change bandwidth?
 Of course, iw command work correctly.

The iw set channel is for monitor interfaces only so trying to make it
work with, e.g. a station interface will bring you pain.


Michał
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 11/13] ath5k: revert AHB bus support removing

2014-10-22 Thread Bob Copeland
On Wed, Oct 22, 2014 at 03:03:49AM +0400, Sergey Ryazanov wrote:
 This reverts commit 093ec3c5337434f40d77c1af06c139da3e5ba6dc.
 
 AHB bus code has been removed, since we did not have support Atheros
 AR231x SoC, required for building the AHB version of ath5k. Now that
 support WiSoC chips added we can restore functionality back.
 
 Singed-off-by: Sergey Ryazanov ryazanov@gmail.com
  ^^

Please keep the patches away from the stove! (SCNR)

-- 
Bob Copeland %% www.bobcopeland.com
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] mac80211: Export IE split function

2014-10-22 Thread Emmanuel Grumbach
From: Andrei Otcheretianski andrei.otcheretian...@intel.com

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

Signed-off-by: Andrei Otcheretianski andrei.otcheretian...@intel.com
Signed-off-by: Emmanuel Grumbach emmanuel.grumb...@intel.com
---
 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
@@ -4888,4 +4888,32 @@ 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
+ *
+ * @ies: the IE buffer
+ * @ielen: the length of the IE buffer
+ * @ids: an array with element IDs that are allowed before
+ * the split
+ * @n_ids: the size of the element ID array
+ * @offset: offset where to start splitting in the buffer
+ *
+ * This function splits an IE buffer by updating the @offset
+ * variable to point to the location where the buffer should be
+ * split.
+ *
+ * It assumes that the given IE buffer is well-formed, this
+ * has to be guaranteed by the caller!
+ *
+ * It also assumes that the IEs in the buffer are ordered
+ * correctly, if not the result of using this function will not
+ * be ordered correctly either, i.e. it does no reordering.
+ *
+ * The function returns the offset where the next part of the
+ * buffer starts, which may be @ielen if the entire (remainder)
+ * of the buffer should be used.
+ */
+size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
+ const u8 *ids, int n_ids, size_t offset);
 #endif /* MAC80211_H */
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index c2aaec4..587b61d 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1833,8 +1833,6 @@ int __ieee80211_request_smps_ap(struct 
ieee80211_sub_if_data *sdata,
 void ieee80211_recalc_smps(struct ieee80211_sub_if_data *sdata);
 void ieee80211_recalc_min_chandef(struct ieee80211_sub_if_data *sdata);
 
-size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
- const u8 *ids, int n_ids, size_t offset);
 size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset);
 u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
  u16 cap);
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 3c61060..b2ec3c38 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2052,31 +2052,6 @@ static bool ieee80211_id_in_list(const u8 *ids, int 
n_ids, u8 id)
return false;
 }
 
-/**
- * ieee80211_ie_split - split an IE buffer according to ordering
- *
- * @ies: the IE buffer
- * @ielen: the length of the IE buffer
- * @ids: an array with element IDs that are allowed before
- * the split
- * @n_ids: the size of the element ID array
- * @offset: offset where to start splitting in the buffer
- *
- * This function splits an IE buffer by updating the @offset
- * variable to point to the location where the buffer should be
- * split.
- *
- * It assumes that the given IE buffer is well-formed, this
- * has to be guaranteed by the caller!
- *
- * It also assumes that the IEs in the buffer are ordered
- * correctly, if not the result of using this function will not
- * be ordered correctly either, i.e. it does no reordering.
- *
- * The function returns the offset where the next part of the
- * buffer starts, which may be @ielen if the entire (remainder)
- * of the buffer should be used.
- */
 size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
  const u8 *ids, int n_ids, size_t offset)
 {
@@ -2087,6 +2062,7 @@ size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
 
return pos;
 }
+EXPORT_SYMBOL(ieee80211_ie_split);
 
 size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset)
 {
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2014-10-22 Thread Felix Fietkau
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 n...@openwrt.org
---
 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
@@ -80,6 +80,7 @@ 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
+++ b/drivers/net/wireless/ath/regd.c
@@ -515,6 +515,7 @@ void ath_reg_notifier_apply(struct wiphy *wiphy,
if (!request)
return;
 
+   reg-region = request-dfs_region;
switch (request-initiator) {
case NL80211_REGDOM_SET_BY_CORE:
/*
@@ -779,6 +780,19 @@ u32 ath_regd_get_band_ctl(struct ath_regulatory *reg,
return SD_NO_CTL;
}
 
+   if (ath_regd_get_eepromRD(reg) == CTRY_DEFAULT) {
+   switch (reg-region) {
+   case NL80211_DFS_FCC:
+   return CTL_FCC;
+   case NL80211_DFS_ETSI:
+   return CTL_ETSI;
+   case NL80211_DFS_JP:
+   return CTL_MKK;
+   default:
+   break;
+   }
+   }
+
switch (band) {
case IEEE80211_BAND_2GHZ:
return reg-regpair-reg_2ghz_ctl;
-- 
2.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2014-10-22 Thread Karsten Wiese
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.

Regards,
Karsten
 

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] rtl8192cu: Prevent Ooops under rtl92c_set_fw_rsvdpagepkt

2014-10-22 Thread Karsten Wiese
rtl92c_set_fw_rsvdpagepkt is used by rtl8192cu and its pci sibling rtl8192ce.
rtl_cmd_send_packet crashes when called inside rtl8192cu because it works on
memory allocated only by rtl8192ce.
Fix the crash by calling a dummy function when used in rtl8192cu.
Comparision with the realtek vendor driver makes me think, something is missing 
in
the dummy function.
Short test as WPA2 station show good results connected to an 802.11g 
basestation.
Traffic stops after few MBytes as WPA2 station connected to an 802.11n 
basestation.

Signed-off-by: Karsten Wiese fzu...@googlemail.com
---
 drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c |  8 ++--
 drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h |  4 +++-
 drivers/net/wireless/rtlwifi/rtl8192ce/hw.c   |  2 +-
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c   | 17 -
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.h   |  1 -
 5 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c 
b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
index a00861b..29983bc 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
@@ -656,7 +656,8 @@ static u8 reserved_page_packet[TOTAL_RESERVED_PKT_LEN] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
-void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
+void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw,
+bool (*cmd_send_packet)(struct ieee80211_hw *, struct sk_buff *))
 {
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
@@ -722,7 +723,10 @@ void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, 
bool b_dl_finished)
memcpy((u8 *)skb_put(skb, totalpacketlen),
   reserved_page_packet, totalpacketlen);
 
-   rtstatus = rtl_cmd_send_packet(hw, skb);
+   if (cmd_send_packet)
+   rtstatus = cmd_send_packet(hw, skb);
+   else
+   rtstatus = rtl_cmd_send_packet(hw, skb);
 
if (rtstatus)
b_dlok = true;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h 
b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h
index a815bd6..b64ae45 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h
@@ -109,7 +109,9 @@ void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw, u8 
element_id,
 u32 cmd_len, u8 *p_cmdbuffer);
 void rtl92c_firmware_selfreset(struct ieee80211_hw *hw);
 void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode);
-void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished);
+void rtl92c_set_fw_rsvdpagepkt
+   (struct ieee80211_hw *hw,
+bool (*cmd_send_packet)(struct ieee80211_hw *, struct sk_buff *));
 void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus);
 void usb_writeN_async(struct rtl_priv *rtlpriv, u32 addr, void *data, u16 len);
 void rtl92c_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c 
b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
index 8ec0f03..55357d6 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
@@ -459,7 +459,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2,
   tmp_reg422  (~BIT(6)));
 
-   rtl92c_set_fw_rsvdpagepkt(hw, 0);
+   rtl92c_set_fw_rsvdpagepkt(hw, NULL);
 
_rtl92ce_set_bcn_ctrl_reg(hw, BIT(3), 0);
_rtl92ce_set_bcn_ctrl_reg(hw, 0, BIT(4));
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c 
b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
index 04aa0b5..873363a 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
@@ -1592,6 +1592,20 @@ void rtl92cu_get_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
}
 }
 
+bool usb_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb)
+{
+  /* Currently nothing happens here.
+   * Traffic stops after some seconds in WPA2 802.11n mode.
+   * Maybe because rtl8192cu chip should be set from here?
+   * If I understand correctly, the realtek vendor driver sends some urbs
+   * if its here.
+   *
+   * This is maybe necessary:
+   * rtlpriv-cfg-ops-fill_tx_cmddesc(hw, buffer, 1, 1, skb);
+   */
+   return true;
+}
+
 void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
 {
struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -1939,7 +1953,8 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
recover = true;

[PATCH 2/3] rtl8192cu: Call ieee80211_register_hw from rtl_usb_probe

2014-10-22 Thread Karsten Wiese
In a previous patch the call to ieee80211_register_hw was moved from the
load firmware callback to the rtl_pci_probe only.
rt8192cu also uses this callback. Currently it doesnt create a wlan%d device.
Fill in the call to ieee80211_register_hw in rtl_usb_probe.

Signed-off-by: Karsten Wiese fzu...@googlemail.com
---
 drivers/net/wireless/rtlwifi/usb.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/wireless/rtlwifi/usb.c 
b/drivers/net/wireless/rtlwifi/usb.c
index 10cf69c..46ee956 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -1117,7 +1117,18 @@ int rtl_usb_probe(struct usb_interface *intf,
}
rtlpriv-cfg-ops-init_sw_leds(hw);
 
+   err = ieee80211_register_hw(hw);
+   if (err) {
+   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
+Can't register mac80211 hw.\n);
+   err = -ENODEV;
+   goto error_out;
+   }
+   rtlpriv-mac80211.mac80211_registered = 1;
+
+   set_bit(RTL_STATUS_INTERFACE_START, rtlpriv-status);
return 0;
+
 error_out:
rtl_deinit_core(hw);
_rtl_usb_io_handler_release(hw);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] rtl8192cu: Fix for rtlwifi's bluetooth coexist functionality

2014-10-22 Thread Karsten Wiese
Initialize function pointer with a function indicating bt coexist is not there.
Prevents Ooops.

Signed-off-by: Karsten Wiese fzu...@googlemail.com
---
 drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c 
b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 7c5fbaf..e06bafe 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -101,6 +101,12 @@ static void rtl92cu_deinit_sw_vars(struct ieee80211_hw *hw)
}
 }
 
+/* get bt coexist status */
+static bool rtl92cu_get_btc_status(void)
+{
+   return false;
+}
+
 static struct rtl_hal_ops rtl8192cu_hal_ops = {
.init_sw_vars = rtl92cu_init_sw_vars,
.deinit_sw_vars = rtl92cu_deinit_sw_vars,
@@ -148,6 +154,7 @@ static struct rtl_hal_ops rtl8192cu_hal_ops = {
.phy_set_bw_mode_callback = rtl92cu_phy_set_bw_mode_callback,
.dm_dynamic_txpower = rtl92cu_dm_dynamic_txpower,
.fill_h2c_cmd = rtl92c_fill_h2c_cmd,
+   .get_btc_status = rtl92cu_get_btc_status,
 };
 
 static struct rtl_mod_params rtl92cu_mod_params = {
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 0/4] add VHT support to minstrel_ht

2014-10-22 Thread Karl Beldan
On Tue, Oct 21, 2014 at 08:47:26PM +0200, Johannes Berg wrote:
 On Tue, 2014-10-21 at 17:26 +0200, Karl Beldan wrote:
 
  I still don't know why I don't see the smatch array warnings here, I
  guess I'll live with that for now.
 
 I'm hoping Dan will eventually pick up on it ;-)
 
smatch is good, I get your warnings now when unsetting
MAC80211_RC_MINSTREL_VHT. I did not click until after checking
checking smatch's check_overflow.c, when there's a use after check, it
only barks when the indexes checked are out of bounds.

As for the false positive, now we can check the flags instead of doing
comparisons on the indexes, it'd be cleaner and spare this warning,
maybe I should send something.
 
Karl
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 0/4] add VHT support to minstrel_ht

2014-10-22 Thread Johannes Berg
On Wed, 2014-10-22 at 15:54 +0200, Karl Beldan wrote:
 On Tue, Oct 21, 2014 at 08:47:26PM +0200, Johannes Berg wrote:
  On Tue, 2014-10-21 at 17:26 +0200, Karl Beldan wrote:
  
   I still don't know why I don't see the smatch array warnings here, I
   guess I'll live with that for now.
  
  I'm hoping Dan will eventually pick up on it ;-)
  
 smatch is good, I get your warnings now when unsetting
 MAC80211_RC_MINSTREL_VHT. I did not click until after checking
 checking smatch's check_overflow.c, when there's a use after check, it
 only barks when the indexes checked are out of bounds.

Wait, are you saying it *is* out of bounds when VHT isn't turned on?

johannes

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 0/4] add VHT support to minstrel_ht

2014-10-22 Thread Karl Beldan
On Wed, Oct 22, 2014 at 04:07:31PM +0200, Johannes Berg wrote:
 On Wed, 2014-10-22 at 15:54 +0200, Karl Beldan wrote:
  On Tue, Oct 21, 2014 at 08:47:26PM +0200, Johannes Berg wrote:
   On Tue, 2014-10-21 at 17:26 +0200, Karl Beldan wrote:
   
I still don't know why I don't see the smatch array warnings here, I
guess I'll live with that for now.
   
   I'm hoping Dan will eventually pick up on it ;-)
   
  smatch is good, I get your warnings now when unsetting
  MAC80211_RC_MINSTREL_VHT. I did not click until after checking
  checking smatch's check_overflow.c, when there's a use after check, it
  only barks when the indexes checked are out of bounds.
 
 Wait, are you saying it *is* out of bounds when VHT isn't turned on?
 

The smatch warning pops on
{
if (!(mi-groups[i].supported  BIT(j)))
continue;
...
else if (i = MINSTREL_VHT_GROUP_0)
}

MINSTREL_VHT_GROUP_0 is out of bonds (not i which remains 
ARRAY_SIZE(mi-groups)).

 
Karl
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2014-10-22 Thread Felix Fietkau
The configured tx power is often limited by hardware capabilities,
channel settings, antenna configuration, etc.

Signed-off-by: Felix Fietkau n...@openwrt.org
---
 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
@@ -2838,6 +2838,9 @@ enum ieee80211_roc_type {
  * @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.
+ *
+ * @get_txpower: get current maximum tx power (in dBm) based on configuration
+ * and hardware limits.
  */
 struct ieee80211_ops {
void (*tx)(struct ieee80211_hw *hw,
@@ -3039,6 +3042,8 @@ 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);
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index fb6a150..7cb31a8 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2081,6 +2081,9 @@ static int ieee80211_get_tx_power(struct wiphy *wiphy,
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
 
+   if (local-ops-get_txpower)
+   return local-ops-get_txpower(local-hw, sdata-vif, dbm);
+
if (!local-use_chanctx)
*dbm = local-hw.conf.power_level;
else
-- 
2.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Block ACK without frame aggregation

2014-10-22 Thread Ali Abedi

Hello,

I am interested to know if we can send multiple packets (non-aggregated, 
single packets) and then ask
for a block ACK? I like to know if this functionality has been 
implemented in ath9k or if

it is possible to achieve this with slight code modifications.

What I need:
Frame-SIFS-Frame-SIFS-Frame-SIFS-REQ Block ACK-SIFS-Block ACK

Best,
Ali
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/6] cfg80211: support creating wiphy with suggested name.

2014-10-22 Thread Ben Greear
On 10/21/2014 01:10 PM, Ben Greear wrote:
 On 10/21/2014 12:31 PM, Johannes Berg wrote:
 
 /* give it a proper name */
 -   dev_set_name(rdev-wiphy.dev, PHY_NAME %d, rdev-wiphy_idx);
 +   if (requested_name  requested_name[0]) {
 +   struct cfg80211_registered_device *rdev2;
 +   int wiphy_idx, taken = -1, result, digits;
 +
 +   /* Code below is from cfg80211_dev_rename */

 can you refactor this then please?
 
 I'll see what I can do on this, as well as take care of
 the rest of the comments.

I was thinking, this could be made simpler if we reduced restrictions on
the naming.  Basically, let user (re)name the wiphy however they want, as
long as it name is not currently in use.

Might require a bit of extra locking and checking instead of just assuming the
atomic-inc and phy%d is unique, but maybe that is worth the tradeoff?

I'll get started on trying to refactor with existing constraints, but
let me know how you feel about relaxing the restrictions...

Thanks,
Ben

 
 Thanks,
 Ben
 


-- 
Ben Greear gree...@candelatech.com
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ath9k_common: always update value in ath9k_cmn_update_txpow

2014-10-22 Thread Felix Fietkau
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 n...@openwrt.org
---
 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
@@ -368,11 +368,11 @@ 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;
 }
 EXPORT_SYMBOL(ath9k_cmn_update_txpow);
 
-- 
2.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2014-10-22 Thread Karl Beldan
From: Karl Beldan karl.bel...@rivierawaves.com

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@80MHz) with
CONFIG_MAC80211_RC_MINSTREL_VHT unset because then MINSTREL_VHT_GROUP_0
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.bel...@rivierawaves.com
Cc: Felix Fietkau n...@openwrt.org
---
 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
@@ -22,16 +22,19 @@ 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;
 
if (!mi-groups[i].supported)
return p;
 
mg = minstrel_mcs_groups[i];
-   if (mg-flags  IEEE80211_TX_RC_40_MHZ_WIDTH)
+   gflags = mg-flags;
+
+   if (gflags  IEEE80211_TX_RC_40_MHZ_WIDTH)
htmode = '4';
-   else if (mg-flags  IEEE80211_TX_RC_80_MHZ_WIDTH)
+   else if (gflags  IEEE80211_TX_RC_80_MHZ_WIDTH)
htmode = '8';
-   if (mg-flags  IEEE80211_TX_RC_SHORT_GI)
+   if (gflags  IEEE80211_TX_RC_SHORT_GI)
gimode = 'S';
 
for (j = 0; j  MCS_GROUP_RATES; j++) {
@@ -42,12 +45,12 @@ minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, 
char *p)
if (!(mi-groups[i].supported  BIT(j)))
continue;
 
-   if (i == MINSTREL_CCK_GROUP)
-   p += sprintf(p,  CCK/%cP   , j  4 ? 'L' : 'S');
-   else if (i = MINSTREL_VHT_GROUP_0)
+   if (gflags  IEEE80211_TX_RC_MCS)
+   p += sprintf(p,  HT%c0/%cGI , htmode, gimode);
+   else if (gflags  IEEE80211_TX_RC_VHT_MCS)
p += sprintf(p, VHT%c0/%cGI , htmode, gimode);
else
-   p += sprintf(p,  HT%c0/%cGI , htmode, gimode);
+   p += sprintf(p,  CCK/%cP   , j  4 ? 'L' : 'S');
 
*(p++) = (idx == mi-max_tp_rate[0]) ? 'A' : ' ';
*(p++) = (idx == mi-max_tp_rate[1]) ? 'B' : ' ';
@@ -55,13 +58,14 @@ minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, 
char *p)
*(p++) = (idx == mi-max_tp_rate[3]) ? 'D' : ' ';
*(p++) = (idx == mi-max_prob_rate) ? 'P' : ' ';
 
-   if (i == MINSTREL_CCK_GROUP) {
-   int r = bitrates[j % 4];
-   p += sprintf(p,  %2u.%1uM , r / 10, r % 10);
-   } else if (i = MINSTREL_VHT_GROUP_0) {
+   if (gflags  IEEE80211_TX_RC_MCS) {
+   p += sprintf(p,  MCS%-2u , (mg-streams - 1) * 8 + j);
+   } else if (gflags  IEEE80211_TX_RC_VHT_MCS) {
p += sprintf(p,  MCS%-1u/%1u, j, mg-streams);
} else {
-   p += sprintf(p,  MCS%-2u , (mg-streams - 1) * 8 + j);
+   int r = bitrates[j % 4];
+
+   p += sprintf(p,  %2u.%1uM , r / 10, r % 10);
}
 
tp = mr-cur_tp / 10;
-- 
2.0.1

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] rtl8192cu: Fix for rtlwifi's bluetooth coexist functionality

2014-10-22 Thread Larry Finger

On 10/22/2014 08:47 AM, Karsten Wiese wrote:

Initialize function pointer with a function indicating bt coexist is not there.
Prevents Ooops.

Signed-off-by: Karsten Wiese fzu...@googlemail.com
---


I have been working on a better fix; however, I am traveling and unable to 
finish testing it. As a result, this one should be applied.


Acked-by: Larry Finger larry.fin...@lwfinger.net

Larry


  drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 7 +++
  1 file changed, 7 insertions(+)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c 
b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 7c5fbaf..e06bafe 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -101,6 +101,12 @@ static void rtl92cu_deinit_sw_vars(struct ieee80211_hw *hw)
}
  }

+/* get bt coexist status */
+static bool rtl92cu_get_btc_status(void)
+{
+   return false;
+}
+
  static struct rtl_hal_ops rtl8192cu_hal_ops = {
.init_sw_vars = rtl92cu_init_sw_vars,
.deinit_sw_vars = rtl92cu_deinit_sw_vars,
@@ -148,6 +154,7 @@ static struct rtl_hal_ops rtl8192cu_hal_ops = {
.phy_set_bw_mode_callback = rtl92cu_phy_set_bw_mode_callback,
.dm_dynamic_txpower = rtl92cu_dm_dynamic_txpower,
.fill_h2c_cmd = rtl92c_fill_h2c_cmd,
+   .get_btc_status = rtl92cu_get_btc_status,
  };

  static struct rtl_mod_params rtl92cu_mod_params = {



--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] rtl8192cu: Prevent Ooops under rtl92c_set_fw_rsvdpagepkt

2014-10-22 Thread Larry Finger

On 10/22/2014 08:47 AM, Karsten Wiese wrote:

rtl92c_set_fw_rsvdpagepkt is used by rtl8192cu and its pci sibling rtl8192ce.
rtl_cmd_send_packet crashes when called inside rtl8192cu because it works on
memory allocated only by rtl8192ce.
Fix the crash by calling a dummy function when used in rtl8192cu.
Comparision with the realtek vendor driver makes me think, something is missing 
in
the dummy function.
Short test as WPA2 station show good results connected to an 802.11g 
basestation.
Traffic stops after few MBytes as WPA2 station connected to an 802.11n 
basestation.

Signed-off-by: Karsten Wiese fzu...@googlemail.com


This one needs to be applied; however, I will be taking another look at it after 
I finish my traveling.


Acked-by: Larry Finger larry.fin...@lwfinger.net

Larry



---
  drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c |  8 ++--
  drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h |  4 +++-
  drivers/net/wireless/rtlwifi/rtl8192ce/hw.c   |  2 +-
  drivers/net/wireless/rtlwifi/rtl8192cu/hw.c   | 17 -
  drivers/net/wireless/rtlwifi/rtl8192cu/hw.h   |  1 -
  5 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c 
b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
index a00861b..29983bc 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
@@ -656,7 +656,8 @@ static u8 reserved_page_packet[TOTAL_RESERVED_PKT_LEN] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  };

-void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
+void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw,
+bool (*cmd_send_packet)(struct ieee80211_hw *, struct sk_buff *))
  {
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
@@ -722,7 +723,10 @@ void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, 
bool b_dl_finished)
memcpy((u8 *)skb_put(skb, totalpacketlen),
   reserved_page_packet, totalpacketlen);

-   rtstatus = rtl_cmd_send_packet(hw, skb);
+   if (cmd_send_packet)
+   rtstatus = cmd_send_packet(hw, skb);
+   else
+   rtstatus = rtl_cmd_send_packet(hw, skb);

if (rtstatus)
b_dlok = true;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h 
b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h
index a815bd6..b64ae45 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h
@@ -109,7 +109,9 @@ void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw, u8 
element_id,
 u32 cmd_len, u8 *p_cmdbuffer);
  void rtl92c_firmware_selfreset(struct ieee80211_hw *hw);
  void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode);
-void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished);
+void rtl92c_set_fw_rsvdpagepkt
+   (struct ieee80211_hw *hw,
+bool (*cmd_send_packet)(struct ieee80211_hw *, struct sk_buff *));
  void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus);
  void usb_writeN_async(struct rtl_priv *rtlpriv, u32 addr, void *data, u16 
len);
  void rtl92c_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c 
b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
index 8ec0f03..55357d6 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
@@ -459,7 +459,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2,
   tmp_reg422  (~BIT(6)));

-   rtl92c_set_fw_rsvdpagepkt(hw, 0);
+   rtl92c_set_fw_rsvdpagepkt(hw, NULL);

_rtl92ce_set_bcn_ctrl_reg(hw, BIT(3), 0);
_rtl92ce_set_bcn_ctrl_reg(hw, 0, BIT(4));
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c 
b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
index 04aa0b5..873363a 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
@@ -1592,6 +1592,20 @@ void rtl92cu_get_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
}
  }

+bool usb_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb)
+{
+  /* Currently nothing happens here.
+   * Traffic stops after some seconds in WPA2 802.11n mode.
+   * Maybe because rtl8192cu chip should be set from here?
+   * If I understand correctly, the realtek vendor driver sends some urbs
+   * if its here.
+   *
+   * This is maybe necessary:
+   * rtlpriv-cfg-ops-fill_tx_cmddesc(hw, buffer, 1, 1, skb);
+   */
+   return true;
+}
+
  void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
  {
struct 

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

2014-10-22 Thread Felix Fietkau
Signed-off-by: Felix Fietkau n...@openwrt.org
---
 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
@@ -3975,6 +3975,9 @@ 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;
+
 exit:
mutex_unlock(ar-conf_mutex);
return ret;
-- 
2.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 3/9] cfg80211: support creating wiphy with suggested name

2014-10-22 Thread greearb
From: Ben Greear gree...@candelatech.com

Kernel will attempt to use the name if it is supplied,
but if name cannot be used for some reason, the default
phyX name will be used instead.

Signed-off-by: Ben Greear gree...@candelatech.com
---
 include/net/cfg80211.h | 23 +++-
 net/wireless/core.c| 58 +-
 2 files changed, 70 insertions(+), 11 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 77aa805..39d7996 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3185,6 +3185,23 @@ static inline const char *wiphy_name(const struct wiphy 
*wiphy)
 }
 
 /**
+ * wiphy_new_nm - create a new wiphy for use with cfg80211
+ *
+ * @ops: The configuration operations for this device
+ * @sizeof_priv: The size of the private area to allocate
+ * @requested_name: Request a particular name.
+ * NULL is valid value, and means use the default phy%d naming.
+ *
+ * Create a new wiphy and associate the given operations with it.
+ * @sizeof_priv bytes are allocated for private use.
+ *
+ * Return: A pointer to the new wiphy. This pointer must be
+ * assigned to each netdev's ieee80211_ptr for proper operation.
+ */
+struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv,
+  const char *requested_name);
+
+/**
  * wiphy_new - create a new wiphy for use with cfg80211
  *
  * @ops: The configuration operations for this device
@@ -3196,7 +3213,11 @@ static inline const char *wiphy_name(const struct wiphy 
*wiphy)
  * Return: A pointer to the new wiphy. This pointer must be
  * assigned to each netdev's ieee80211_ptr for proper operation.
  */
-struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv);
+static inline struct wiphy *wiphy_new(const struct cfg80211_ops *ops,
+ int sizeof_priv)
+{
+   return wiphy_new_nm(ops, sizeof_priv, NULL);
+}
 
 /**
  * wiphy_register - register a wiphy with cfg80211
diff --git a/net/wireless/core.c b/net/wireless/core.c
index f52a4cd..710d47e 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -86,11 +86,11 @@ struct wiphy *wiphy_idx_to_wiphy(int wiphy_idx)
return rdev-wiphy;
 }
 
-int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
-   char *newname)
+static int cfg80211_dev_check_name(struct cfg80211_registered_device *rdev,
+  const char *newname)
 {
struct cfg80211_registered_device *rdev2;
-   int wiphy_idx, taken = -1, result, digits;
+   int wiphy_idx, taken = -1, digits;
 
ASSERT_RTNL();
 
@@ -109,15 +109,28 @@ int cfg80211_dev_rename(struct cfg80211_registered_device 
*rdev,
return -EINVAL;
}
 
+   /* Ensure another device does not already have this name. */
+   list_for_each_entry(rdev2, cfg80211_rdev_list, list)
+   if (strcmp(newname, dev_name(rdev2-wiphy.dev)) == 0)
+   return -EINVAL;
+
+   return 0;
+}
+
+int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
+   char *newname)
+{
+   int result;
+
+   ASSERT_RTNL();
 
/* Ignore nop renames */
if (strcmp(newname, dev_name(rdev-wiphy.dev)) == 0)
return 0;
 
-   /* Ensure another device does not already have this name. */
-   list_for_each_entry(rdev2, cfg80211_rdev_list, list)
-   if (strcmp(newname, dev_name(rdev2-wiphy.dev)) == 0)
-   return -EINVAL;
+   result = cfg80211_dev_check_name(rdev, newname);
+   if (result  0)
+   return result;
 
result = device_rename(rdev-wiphy.dev, newname);
if (result)
@@ -309,7 +322,8 @@ static void cfg80211_destroy_iface_wk(struct work_struct 
*work)
 
 /* exported functions */
 
-struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)
+struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv,
+  const char *requested_name)
 {
static atomic_t wiphy_counter = ATOMIC_INIT(0);
 
@@ -346,7 +360,31 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, 
int sizeof_priv)
rdev-wiphy_idx--;
 
/* give it a proper name */
-   dev_set_name(rdev-wiphy.dev, PHY_NAME %d, rdev-wiphy_idx);
+   if (requested_name  requested_name[0]) {
+   int rv;
+
+   rtnl_lock();
+   rv = cfg80211_dev_check_name(rdev, requested_name);
+
+   if (rv  0) {
+   rtnl_unlock();
+   goto use_default_name;
+   }
+
+   rv = dev_set_name(rdev-wiphy.dev, requested_name);
+   rtnl_unlock();
+   if (rv)
+   goto use_default_name;
+   } else {
+use_default_name:
+   /* NOTE:  This is *probably* safe w/out holding rtnl because of
+

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

2014-10-22 Thread greearb
From: Ben Greear gree...@candelatech.com

This gives a view into packet activity at the virtual radio
level.

Signed-off-by: Ben Greear gree...@candelatech.com
---
 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
@@ -450,6 +450,14 @@ 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;
 };
 
 
@@ -865,8 +873,10 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw 
*hw,
/* If the queue contains MAX_QUEUE skb's drop some */
if (skb_queue_len(data-pending) = MAX_QUEUE) {
/* Droping until WARN_QUEUE level */
-   while (skb_queue_len(data-pending) = WARN_QUEUE)
+   while (skb_queue_len(data-pending) = WARN_QUEUE) {
ieee80211_free_txskb(hw, skb_dequeue(data-pending));
+   data-tx_dropped++;
+   }
}
 
skb = genlmsg_new(GENLMSG_DEFAULT_SIZE, GFP_ATOMIC);
@@ -921,11 +931,14 @@ static void mac80211_hwsim_tx_frame_nl(struct 
ieee80211_hw *hw,
 
/* Enqueue the packet */
skb_queue_tail(data-pending, my_skb);
+   data-tx_pkts++;
+   data-tx_bytes += my_skb-len;
return;
 
 nla_put_failure:
printk(KERN_DEBUG mac80211_hwsim: error occurred in %s\n, __func__);
ieee80211_free_txskb(hw, my_skb);
+   data-tx_failed++;
 }
 
 static bool hwsim_chans_compat(struct ieee80211_channel *c1,
@@ -1071,6 +1084,8 @@ static bool mac80211_hwsim_tx_frame_no_nl(struct 
ieee80211_hw *hw,
rx_status.mactime = now + data2-tsf_offset;
 
memcpy(IEEE80211_SKB_RXCB(nskb), rx_status, sizeof(rx_status));
+   data2-rx_pkts++;
+   data2-rx_bytes += nskb-len;
ieee80211_rx_irqsafe(data2-hw, nskb);
}
spin_unlock(hwsim_radio_lock);
@@ -1138,6 +1153,8 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
return mac80211_hwsim_tx_frame_nl(hw, skb, _portid);
 
/* NO wmediumd detected, perfect medium simulation */
+   data-tx_pkts++;
+   data-tx_bytes += skb-len;
ack = mac80211_hwsim_tx_frame_no_nl(hw, skb, channel);
 
if (ack  skb-len = 16) {
@@ -1921,6 +1938,57 @@ static void mac80211_hwsim_unassign_vif_chanctx(struct 
ieee80211_hw *hw,
hwsim_check_chanctx_magic(ctx);
 }
 
+static const char mac80211_hwsim_gstrings_stats[][ETH_GSTRING_LEN] = {
+   tx_pkts_nic,
+   tx_bytes_nic,
+   rx_pkts_nic,
+   rx_bytes_nic,
+   d_tx_dropped,
+   d_tx_failed,
+   d_ps_mode,
+   d_group,
+   d_tx_power,
+};
+
+#define MAC80211_HWSIM_SSTATS_LEN ARRAY_SIZE(mac80211_hwsim_gstrings_stats)
+
+void mac80211_hwsim_get_et_strings(struct ieee80211_hw *hw,
+  struct ieee80211_vif *vif,
+  u32 sset, u8 *data)
+{
+   if (sset == ETH_SS_STATS)
+   memcpy(data, *mac80211_hwsim_gstrings_stats,
+  sizeof(mac80211_hwsim_gstrings_stats));
+}
+
+int mac80211_hwsim_get_et_sset_count(struct ieee80211_hw *hw,
+struct ieee80211_vif *vif, int sset)
+{
+   if (sset == ETH_SS_STATS)
+   return MAC80211_HWSIM_SSTATS_LEN;
+   return 0;
+}
+
+void mac80211_hwsim_get_et_stats(struct ieee80211_hw *hw,
+struct ieee80211_vif *vif,
+struct ethtool_stats *stats, u64 *data)
+{
+   struct mac80211_hwsim_data *ar = hw-priv;
+   int i = 0;
+
+   data[i++] = ar-tx_pkts;
+   data[i++] = ar-tx_bytes;
+   data[i++] = ar-rx_pkts;
+   data[i++] = ar-rx_bytes;
+   data[i++] = ar-tx_dropped;
+   data[i++] = ar-tx_failed;
+   data[i++] = ar-ps;
+   data[i++] = ar-group;
+   data[i++] = ar-power_level;
+
+   WARN_ON(i != MAC80211_HWSIM_SSTATS_LEN);
+}
+
 static const struct ieee80211_ops mac80211_hwsim_ops = {
.tx = mac80211_hwsim_tx,
.start = mac80211_hwsim_start,
@@ -1944,6 +2012,9 @@ static const struct ieee80211_ops mac80211_hwsim_ops = {
.flush = mac80211_hwsim_flush,
.get_tsf = mac80211_hwsim_get_tsf,
.set_tsf = mac80211_hwsim_set_tsf,
+   .get_et_sset_count = mac80211_hwsim_get_et_sset_count,
+   .get_et_stats = mac80211_hwsim_get_et_stats,
+   .get_et_strings = mac80211_hwsim_get_et_strings,
 };
 
 static struct ieee80211_ops mac80211_hwsim_mchan_ops;
@@ -2394,6 +2465,8 @@ static int 

[PATCH v3 9/9] mac80211: support creating vifs with specified mac address

2014-10-22 Thread greearb
From: Ben Greear gree...@candelatech.com

This is useful when creating virtual interfaces.

Signed-off-by: Ben Greear gree...@candelatech.com
---
 net/mac80211/iface.c | 5 -
 net/mac80211/main.c  | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index e469b33..1ffcc07 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1671,7 +1671,10 @@ int ieee80211_if_add(struct ieee80211_local *local, 
const char *name,
}
 
ieee80211_assign_perm_addr(local, ndev-perm_addr, type);
-   memcpy(ndev-dev_addr, ndev-perm_addr, ETH_ALEN);
+   if (params  is_valid_ether_addr(params-macaddr))
+   memcpy(ndev-dev_addr, params-macaddr, ETH_ALEN);
+   else
+   memcpy(ndev-dev_addr, ndev-perm_addr, ETH_ALEN);
SET_NETDEV_DEV(ndev, wiphy_dev(local-hw.wiphy));
 
/* don't use IEEE80211_DEV_TO_SUB_IF -- it checks too much */
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 7d40e3f..282a4f3 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -542,6 +542,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t 
priv_data_len,
   NL80211_FEATURE_SAE |
   NL80211_FEATURE_HT_IBSS |
   NL80211_FEATURE_VIF_TXPOWER |
+  NL80211_FEATURE_MAC_ON_CREATE |
   NL80211_FEATURE_USERSPACE_MPM;
 
if (!ops-hw_scan)
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 8/9] cfg80211: support configuring vif mac addr on create

2014-10-22 Thread greearb
From: Ben Greear gree...@candelatech.com

This is useful when creating virtual interfaces.
Keeps udev from mucking with things it shouldn't, since
the default MAC is never seen by udev when specified on
the cmd-line during creation.

Signed-off-by: Ben Greear gree...@candelatech.com
---
 include/net/cfg80211.h   | 9 ++---
 include/uapi/linux/nl80211.h | 4 
 net/wireless/nl80211.c   | 2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 39d7996..f67948e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -319,9 +319,12 @@ struct ieee80211_supported_band {
 /**
  * struct vif_params - describes virtual interface parameters
  * @use_4addr: use 4-address frames
- * @macaddr: address to use for this virtual interface. This will only
- * be used for non-netdevice interfaces. If this parameter is set
- * to zero address the driver may determine the address as needed.
+ * @macaddr: address to use for this virtual interface.
+ * If this parameter is set to zero address the driver may
+ * determine the address as needed.
+ * This feature is only fully supported by drivers that enable the
+ * %NL80211_FEATURE_MAC_ON_CREATE flag.  Others may support creating
+ **only p2p devices with specified MAC.
  */
 struct vif_params {
int use_4addr;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index be1d5de..f7daae5 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -4056,6 +4056,9 @@ enum nl80211_ap_sme_features {
  * TSPEC sessions (TID aka TSID 0-7) with the %NL80211_CMD_ADD_TX_TS
  * command. Standard IEEE 802.11 TSPEC setup is not yet supported, it
  * needs to be able to handle Block-Ack agreements and other things.
+ * @NL80211_FEATURE_MAC_ON_CREATE: Device supports configuring
+ * the vif's MAC address upon creation.
+ * See 'macaddr' field in the vif_params (cfg80211.h).
  */
 enum nl80211_feature_flags {
NL80211_FEATURE_SK_TX_STATUS= 1  0,
@@ -4085,6 +4088,7 @@ enum nl80211_feature_flags {
NL80211_FEATURE_STATIC_SMPS = 1  24,
NL80211_FEATURE_DYNAMIC_SMPS= 1  25,
NL80211_FEATURE_SUPPORTS_WMM_ADMISSION  = 1  26,
+   NL80211_FEATURE_MAC_ON_CREATE   = 1  27,
 };
 
 /**
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d98d4ea..5ecb46c 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2605,7 +2605,7 @@ static int nl80211_new_interface(struct sk_buff *skb, 
struct genl_info *info)
!(rdev-wiphy.interface_modes  (1  type)))
return -EOPNOTSUPP;
 
-   if (type == NL80211_IFTYPE_P2P_DEVICE  info-attrs[NL80211_ATTR_MAC]) 
{
+   if (info-attrs[NL80211_ATTR_MAC]) {
nla_memcpy(params.macaddr, info-attrs[NL80211_ATTR_MAC],
   ETH_ALEN);
if (!is_valid_ether_addr(params.macaddr))
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 6/9] mac80211: support creating wiphy w/out creating wlanX

2014-10-22 Thread greearb
From: Ben Greear gree...@candelatech.com

This will be helpful when using the mac80211_hwsim
wiphys and automated testing.  Let user create the
vifs as needed, and named as expected.

Signed-off-by: Ben Greear gree...@candelatech.com
---
 include/net/mac80211.h | 7 ++-
 net/mac80211/main.c| 3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 3cf3ab8..1fd995d 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1580,6 +1580,10 @@ struct ieee80211_tx_control {
  * a virtual monitor interface when monitor interfaces are the only
  * active interfaces.
  *
+ * @IEEE80211_HW_NO_AUTO_VIF: The driver would like for no wlanX to
+ * be created.  It is expected user-space will create vifs as
+ * desired (and thus have them named as desired).
+ *
  * @IEEE80211_HW_QUEUE_CONTROL: The driver wants to control per-interface
  * queue mapping in order to use different queues (not just one per AC)
  * for different virtual interfaces. See the doc section on HW queue
@@ -1626,7 +1630,8 @@ enum ieee80211_hw_flags {
IEEE80211_HW_SUPPORTS_DYNAMIC_PS= 112,
IEEE80211_HW_MFP_CAPABLE= 113,
IEEE80211_HW_WANT_MONITOR_VIF   = 114,
-   /* free slots */
+   IEEE80211_HW_NO_AUTO_VIF= 115,
+   /* free slot */
IEEE80211_HW_SUPPORTS_UAPSD = 117,
IEEE80211_HW_REPORTS_TX_ACK_STATUS  = 118,
IEEE80211_HW_CONNECTION_MONITOR = 119,
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index b189122..7d40e3f 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1023,7 +1023,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
}
 
/* add one default STA interface if supported */
-   if (local-hw.wiphy-interface_modes  BIT(NL80211_IFTYPE_STATION)) {
+   if (local-hw.wiphy-interface_modes  BIT(NL80211_IFTYPE_STATION) 
+   !(hw-flags  IEEE80211_HW_NO_AUTO_VIF)) {
result = ieee80211_if_add(local, wlan%d, NULL,
  NL80211_IFTYPE_STATION, NULL);
if (result)
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 5/9] mac80211-hwsim: support creating radios with specific name

2014-10-22 Thread greearb
From: Ben Greear gree...@candelatech.com

Otherwise, it can be very difficult to know which is which
if you are trying to do detailed testing.

Signed-off-by: Ben Greear gree...@candelatech.com
---
 drivers/net/wireless/mac80211_hwsim.c | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c 
b/drivers/net/wireless/mac80211_hwsim.c
index 00c7b3c..783a9ec 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2023,7 +2023,7 @@ static int mac80211_hwsim_create_radio(int channels, 
const char *reg_alpha2,
   const struct ieee80211_regdomain *regd,
   bool reg_strict, bool p2p_device,
   bool use_chanctx, bool destroy_on_close,
-  u32 portid)
+  u32 portid, const char *hwname)
 {
int err;
u8 addr[ETH_ALEN];
@@ -2042,7 +2042,7 @@ static int mac80211_hwsim_create_radio(int channels, 
const char *reg_alpha2,
 
if (use_chanctx)
ops = mac80211_hwsim_mchan_ops;
-   hw = ieee80211_alloc_hw(sizeof(*data), ops);
+   hw = ieee80211_alloc_hw_nm(sizeof(*data), ops, hwname);
if (!hw) {
printk(KERN_DEBUG mac80211_hwsim: ieee80211_alloc_hw 
failed\n);
err = -ENOMEM;
@@ -2516,10 +2516,14 @@ static int hwsim_create_radio_nl(struct sk_buff *msg, 
struct genl_info *info)
bool p2p_device = info-attrs[HWSIM_ATTR_SUPPORT_P2P_DEVICE];
bool destroy_on_close = info-attrs[HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE];
bool use_chanctx;
+   const char *hwname = NULL;
 
if (info-attrs[HWSIM_ATTR_CHANNELS])
chans = nla_get_u32(info-attrs[HWSIM_ATTR_CHANNELS]);
 
+   if (info-attrs[HWSIM_ATTR_RADIO_NAME])
+   hwname = nla_data(info-attrs[HWSIM_ATTR_RADIO_NAME]);
+
if (info-attrs[HWSIM_ATTR_USE_CHANCTX])
use_chanctx = true;
else
@@ -2538,7 +2542,8 @@ static int hwsim_create_radio_nl(struct sk_buff *msg, 
struct genl_info *info)
 
return mac80211_hwsim_create_radio(chans, alpha2, regd, reg_strict,
   p2p_device, use_chanctx,
-  destroy_on_close, info-snd_portid);
+  destroy_on_close, info-snd_portid,
+  hwname);
 }
 
 static int hwsim_destroy_radio_nl(struct sk_buff *msg, struct genl_info *info)
@@ -2795,7 +2800,7 @@ static int __init init_mac80211_hwsim(void)
err = mac80211_hwsim_create_radio(channels, reg_alpha2,
  regd, reg_strict,
  support_p2p_device,
- channels  1, false, 0);
+ channels  1, false, 0, NULL);
if (err  0)
goto out_free_radios;
}
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: iwlwifi: Reason 7 periodic disconnect

2014-10-22 Thread Laurențiu Nicola
Nope. It seems that code doesn't get executed when my issue occurs (or
in my five or ten minutes of uptime). I've seen
`ieee80211_reset_ap_probe` get called by `ieee80211_rx_mgmt_probe_resp`,
but (if I'm not wrong) not on every disconnect.

And as far as I can tell, force_cam is set to true.

Laurentiu

On Wed, Oct 22, 2014, at 12:10, Emmanuel Grumbach wrote:
 On Tue, Oct 21, 2014 at 10:56 PM, Laurențiu Nicola lnic...@dend.ro
 wrote:
  Yep! `scb_timeout` is 60 on my router.
 
  On Tue, Oct 21, 2014, at 14:00, poma wrote:
  On 21.10.2014 10:35, Felix Fietkau wrote:
   On 2014-10-21 10:23, Laurențiu Nicola wrote:
   It's an ASUS RT-N66U running NEWD-2/K3X from r24160.
   This is a Broadcom based device, so it should behave in the same way as
   other APs/Routers running the Broadcom drivers.
   The driver should only send Reason 7 when receiving a PS-Poll, BlockAck,
   BlockAckReq or Action frame from a station that's not associated, so
   probably it has already kicked out your iwlwifi client earlier. Not sure
   why that doesn't show up in the log though.
  
 
  Whether this might refer to the Station Control Block Timeout value
 
  http://www.dd-wrt.com/wiki/index.php/Wl#scb_timeout
  ...
  scb_timeout
 
  AP only: inactivity timeout value for authenticated stas
 
 
 Actually, mac80211 should be probing the AP every 30 seconds but a
 beacon might abort the probe...
 Can you try something like this:
 
 diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
 index 75df184..c9db7cf 100644
 --- a/net/mac80211/mlme.c
 +++ b/net/mac80211/mlme.c
 @@ -3295,7 +3295,8 @@ static void ieee80211_rx_mgmt_beacon(struct
 ieee80211_sub_if_data *sdata,
 if (ifmgd-flags  IEEE80211_STA_CONNECTION_POLL) {
 mlme_dbg_ratelimited(sdata,
  cancelling AP probe due to a
 received beacon\n);
 -   ieee80211_reset_ap_probe(sdata);
 +   pr_err(Not cancelling the probe to make sure the AP
 hears us from time to time\n);
 +   //ieee80211_reset_ap_probe(sdata);
 }
 
 /*
 
 
 
 
  poma
 
 
  --
  To unsubscribe from this list: send the line unsubscribe linux-wireless
  in
  the body of a message to majord...@vger.kernel.org
  More majordomo info at  http://vger.kernel.org/majordomo-info.html
 --
 To unsubscribe from this list: send the line unsubscribe linux-wireless
 in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Possible wireless issue introduced in next-20140930

2014-10-22 Thread Murilo Opsfelder Araujo

Hello, everyone.

With next-20140930 my laptop does not work, i.e. after I enter my login 
and password in KDM, the entire system becomes unresponsive and I need 
to reset it in order to reboot (it does not even show the KDE splash 
screen).


It was working pretty fine with next-20140926.

I've also tested with next-20141022 and v3.18-rc1 and no luck.

git bisect pointed me to the commit below [1].  My wireless card is a 
RTL8191SEvA [2].


I need your help to troubleshoot this.

Thanks in advance.

[1]
commit 38506ecefab911785d5e1aa5889f6eeb462e0954
Author: Larry Finger larry.fin...@lwfinger.net
Date:   Mon Sep 22 09:39:19 2014 -0500

rtlwifi: rtl_pci: Start modification for new drivers

Future patches will move the drivers for RTL8192EE and RTL8821AE
from staging to the regular wireless tree. Here, the necessary features
are added to the PCI driver. Other files are touched due to changes
in the various data structs.

Signed-off-by: Larry Finger larry.fin...@lwfinger.net
Signed-off-by: John W. Linville linvi...@tuxdriver.com

[2]
$ lspci -vvv
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8191SEvA 
Wireless LAN Controller (rev 10)

Subsystem: Hewlett-Packard Company Device 1467
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- 
ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast TAbort- 
TAbort- MAbort- SERR- PERR- INTx-

Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 16
Region 0: I/O ports at 3000 [size=256]
Region 1: Memory at d340 (32-bit, non-prefetchable) [size=16K]
Capabilities: access denied
Kernel driver in use: rtl8192se

--
Murilo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [ath9k-devel] Block ACK without frame aggregation

2014-10-22 Thread Adrian Chadd
I don't think mac80211 supports delayed-BA. :(


-adrian


On 22 October 2014 08:38, Ali Abedi a2ab...@uwaterloo.ca wrote:
 Hello,

 I am interested to know if we can send multiple packets (non-aggregated,
 single packets) and then ask
 for a block ACK? I like to know if this functionality has been
 implemented in ath9k or if
 it is possible to achieve this with slight code modifications.

 What I need:
 Frame-SIFS-Frame-SIFS-Frame-SIFS-REQ Block ACK-SIFS-Block ACK

 Best,
 Ali
 ___
 ath9k-devel mailing list
 ath9k-de...@lists.ath9k.org
 https://lists.ath9k.org/mailman/listinfo/ath9k-devel
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [ath9k-devel] Block ACK without frame aggregation

2014-10-22 Thread Kamran Nishat
I think you should look in earlier drivers from Atheors. Because this
delayed BA for separate packets was introduced before 802.11n in
802.11e perhaps.

On Thu, Oct 23, 2014 at 8:18 AM, Adrian Chadd adr...@freebsd.org wrote:
 I don't think mac80211 supports delayed-BA. :(


 -adrian


 On 22 October 2014 08:38, Ali Abedi a2ab...@uwaterloo.ca wrote:
 Hello,

 I am interested to know if we can send multiple packets (non-aggregated,
 single packets) and then ask
 for a block ACK? I like to know if this functionality has been
 implemented in ath9k or if
 it is possible to achieve this with slight code modifications.

 What I need:
 Frame-SIFS-Frame-SIFS-Frame-SIFS-REQ Block ACK-SIFS-Block ACK

 Best,
 Ali
 ___
 ath9k-devel mailing list
 ath9k-de...@lists.ath9k.org
 https://lists.ath9k.org/mailman/listinfo/ath9k-devel
 ___
 ath9k-devel mailing list
 ath9k-de...@lists.ath9k.org
 https://lists.ath9k.org/mailman/listinfo/ath9k-devel
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: iwlwifi: Reason 7 periodic disconnect

2014-10-22 Thread Emmanuel Grumbach
On Thu, Oct 23, 2014 at 12:53 AM, Laurențiu Nicola lnic...@dend.ro wrote:
 Nope. It seems that code doesn't get executed when my issue occurs (or
 in my five or ten minutes of uptime). I've seen
 `ieee80211_reset_ap_probe` get called by `ieee80211_rx_mgmt_probe_resp`,
 but (if I'm not wrong) not on every disconnect.

 And as far as I can tell, force_cam is set to true.

Can you please try with the patch attached and send the logs?
I again need MAC80211_MLME_DEBUG.

Thanks.


 Laurentiu

 On Wed, Oct 22, 2014, at 12:10, Emmanuel Grumbach wrote:
 On Tue, Oct 21, 2014 at 10:56 PM, Laurențiu Nicola lnic...@dend.ro
 wrote:
  Yep! `scb_timeout` is 60 on my router.
 
  On Tue, Oct 21, 2014, at 14:00, poma wrote:
  On 21.10.2014 10:35, Felix Fietkau wrote:
   On 2014-10-21 10:23, Laurențiu Nicola wrote:
   It's an ASUS RT-N66U running NEWD-2/K3X from r24160.
   This is a Broadcom based device, so it should behave in the same way as
   other APs/Routers running the Broadcom drivers.
   The driver should only send Reason 7 when receiving a PS-Poll, BlockAck,
   BlockAckReq or Action frame from a station that's not associated, so
   probably it has already kicked out your iwlwifi client earlier. Not sure
   why that doesn't show up in the log though.
  
 
  Whether this might refer to the Station Control Block Timeout value
 
  http://www.dd-wrt.com/wiki/index.php/Wl#scb_timeout
  ...
  scb_timeout
 
  AP only: inactivity timeout value for authenticated stas
 

 Actually, mac80211 should be probing the AP every 30 seconds but a
 beacon might abort the probe...
 Can you try something like this:

 diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
 index 75df184..c9db7cf 100644
 --- a/net/mac80211/mlme.c
 +++ b/net/mac80211/mlme.c
 @@ -3295,7 +3295,8 @@ static void ieee80211_rx_mgmt_beacon(struct
 ieee80211_sub_if_data *sdata,
 if (ifmgd-flags  IEEE80211_STA_CONNECTION_POLL) {
 mlme_dbg_ratelimited(sdata,
  cancelling AP probe due to a
 received beacon\n);
 -   ieee80211_reset_ap_probe(sdata);
 +   pr_err(Not cancelling the probe to make sure the AP
 hears us from time to time\n);
 +   //ieee80211_reset_ap_probe(sdata);
 }

 /*



 
  poma
 
 
  --
  To unsubscribe from this list: send the line unsubscribe linux-wireless
  in
  the body of a message to majord...@vger.kernel.org
  More majordomo info at  http://vger.kernel.org/majordomo-info.html
 --
 To unsubscribe from this list: send the line unsubscribe linux-wireless
 in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Possible wireless issue introduced in next-20140930

2014-10-22 Thread Mike Galbraith
On Thu, 2014-10-23 at 01:17 -0200, Murilo Opsfelder Araujo wrote: 
 Hello, everyone.
 
 With next-20140930 my laptop does not work, i.e. after I enter my login 
 and password in KDM, the entire system becomes unresponsive and I need 
 to reset it in order to reboot (it does not even show the KDE splash 
 screen).
 
 It was working pretty fine with next-20140926.
 
 I've also tested with next-20141022 and v3.18-rc1 and no luck.
 
 git bisect pointed me to the commit below [1].  My wireless card is a 
 RTL8191SEvA [2].

Mine is RTL8191SEvB.

I was going to bisect RTL8191SE regression when I got a chance, but you
beat me to it.

 commit 38506ecefab911785d5e1aa5889f6eeb462e0954
 Author: Larry Finger larry.fin...@lwfinger.net
 Date:   Mon Sep 22 09:39:19 2014 -0500
 
  rtlwifi: rtl_pci: Start modification for new drivers

Did you confirm that bisection result, ie revert it at HEAD of whichever
tree you bisected?

The revert (master) removed some warnings on the way to kaboom here, but
the drivers is still toxic.  My log follows in case it's the same thing.
I can't go hunting atm, maybe during the weekend if the problem hasn't
evaporate by then.

Master:
[   28.028817] cfg80211: Calling CRDA to update world regulatory domain
[   28.102230] cfg80211: World regulatory domain updated:
[   28.103799] cfg80211:  DFS Master region: unset
[   28.103838] cfg80211:   (start_freq - end_freq @ bandwidth), 
(max_antenna_gain, max_eirp), (dfs_cac_time)
[   28.107012] cfg80211:   (2402000 KHz - 2472000 KHz @ 4 KHz), (300 mBi, 
2000 mBm), (N/A)
[   28.108663] cfg80211:   (2457000 KHz - 2482000 KHz @ 4 KHz), (300 mBi, 
2000 mBm), (N/A)
[   28.110251] cfg80211:   (2474000 KHz - 2494000 KHz @ 2 KHz), (300 mBi, 
2000 mBm), (N/A)
[   28.111837] cfg80211:   (517 KHz - 525 KHz @ 4 KHz), (300 mBi, 
2000 mBm), (N/A)
[   28.113422] cfg80211:   (5735000 KHz - 5835000 KHz @ 4 KHz), (300 mBi, 
2000 mBm), (N/A)
[   29.577727] rtl8192se :08:00.0: enabling device ( - 0003)
[   29.618681] rtl8192se: FW Power Save off (module option)
[   29.620355] rtl8192se: Driver for Realtek RTL8192SE/RTL8191SE
[   29.620355] Loading firmware rtlwifi/rtl8192sefw.bin
[   29.648444] [ cut here ]
[   29.650012] WARNING: CPU: 1 PID: 59 at fs/sysfs/dir.c:31 
sysfs_warn_dup+0x68/0x80()
[   29.651602] sysfs: cannot create duplicate filename 
'/devices/pci:00/:00:1c.5/:08:00.0/ieee80211/phy0'
[   29.653278] Modules linked in: rtl8192se(+) rtl_pci rtlwifi mac80211 
cfg80211 btusb bluetooth coretemp iTCO_wdt iTCO_vendor_support serio_raw 
microcode toshiba_acpi sparse_keymap snd_hda_codec_hdmi snd_hda_codec_conexant 
rfkill snd_hda_codec_generic pcspkr uvcvideo videobuf2_core v4l2_common 
videodev videobuf2_vmalloc videobuf2_memops joydev i2c_i801 wmi lpc_ich 
mfd_core acpi_cpufreq toshiba_haps snd_hda_intel snd_hda_controller 
snd_hda_codec snd_hwdep toshiba_bluetooth snd_pcm snd_seq snd_timer 
snd_seq_device snd battery ac soundcore sg autofs4 i915 drm_kms_helper drm 
i2c_algo_bit thermal video processor thermal_sys button scsi_dh_rdac 
scsi_dh_alua scsi_dh_emc scsi_dh_hp_sw scsi_dh netconsole atl1c
[   29.655223] CPU: 1 PID: 59 Comm: kworker/1:4 Not tainted 3.18.0-master #48
[   29.655225] Hardware name: TOSHIBA 
/, BIOS V1.70   
 09/29/2009
[   29.655231] Workqueue: events request_firmware_work_func
[   29.655235]  0009 8800379bba98 8158f1d4 
c5c5
[   29.655238]  8800379bbae8 8800379bbad8 8104c801 
3664
[   29.655241]  880037b0c000 880136392dc0 8800371feeb0 
88013b027098
[   29.655242] Call Trace:
[   29.655248]  [8158f1d4] dump_stack+0x46/0x58
[   29.655253]  [8104c801] warn_slowpath_common+0x81/0xa0
[   29.655256]  [8104c866] warn_slowpath_fmt+0x46/0x50
[   29.655261]  [811d1108] ? kernfs_path+0x48/0x60
[   29.655263]  [811d4588] sysfs_warn_dup+0x68/0x80
[   29.655266]  [811d462e] sysfs_create_dir_ns+0x8e/0xa0
[   29.655270]  [8128e149] kobject_add_internal+0xc9/0x400
[   29.655273]  [8128e8b0] kobject_add+0x60/0xb0
[   29.655276]  [81593b16] ? mutex_lock+0x16/0x37
[   29.655281]  [81388624] device_add+0x104/0x600
[   29.655285]  [8114c3ce] ? lazy_max_pages+0x1e/0x30
[   29.655312]  [a0401d0d] wiphy_register+0x3fd/0x710 [cfg80211]
[   29.655315]  [8114dd92] ? __vunmap+0xc2/0x110
[   29.655346]  [a04a5cfc] ? ieee80211_register_hw+0x1ec/0x9a0 
[mac80211]
[   29.655361]  [a04a5e78] ieee80211_register_hw+0x368/0x9a0 
[mac80211]
[   29.655369]  [a049126b] rtl92se_fw_cb+0xab/0x1d0 [rtl8192se]
[   29.655373]  [8139b650] request_firmware_work_func+0x30/0x60
[   29.655378]  [810627ed] process_one_work+0x14d/0x3d0
[   29.655381]  [81062b91] worker_thread+0x121/0x480
[   29.655384]  [81062a70