Re: [PATCH v2] ath10k: fix vdev-start timeout on error

2018-09-03 Thread Kalle Valo
gree...@candelatech.com wrote:

> The vdev-start-response message should cause the
> completion to fire, even in the error case.  Otherwise,
> the user still gets no useful information and everything
> is blocked until the timeout period.
> 
> Add some warning text to print out the invalid status
> code to aid debugging, and propagate failure code.
> 
> Signed-off-by: Ben Greear 
> Signed-off-by: Kalle Valo 

This had few checkpatch warnings:

drivers/net/wireless/ath/ath10k/wmi.h:6647: code indent should use tabs where 
possible
drivers/net/wireless/ath/ath10k/wmi.h:6647: please, no spaces at the start of a 
line
drivers/net/wireless/ath/ath10k/wmi.h:6648: code indent should use tabs where 
possible
drivers/net/wireless/ath/ath10k/wmi.h:6648: please, no spaces at the start of a 
line

I fixed those in the pending branch.

-- 
https://patchwork.kernel.org/patch/10524087/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



Re: pull-request: mac80211 2018-09-03

2018-09-03 Thread David Miller
From: Johannes Berg 
Date: Mon,  3 Sep 2018 14:15:45 +0200

> This time around for mac80211 I have a larger than usual number of
> fixes, in part because Luca dumped our (Intel's) patches out after
> quite a while - we'll try to make sure this doesn't happen again.
> 
> Shortlog below, as usual, each fix is pretty self-contained but it
> adds up to quite a bit overall.
> 
> Please pull and let me know if there's any problem.

Ok pulled, I'll try to get this merged into net-next in the next day
or two.

Thanks.


Re: [PATCH 2/2] ath10k: Enable pktlog for WCN3990 target

2018-09-03 Thread Kalle Valo
Govind Singh  wrote:

> WCN3990 target uses separate htc service for pktlog.
> Add pktlog service request and support for pktlog
> rx path handling.
> 
> Testing:
> Tested on WCN3990 and QCA6174 HW.
> Tested FW: WLAN.HL.2.0-01192-QCAHLSWMTPLZ-1,
>WLAN.RM.4.4.1-00109-QCARMSWPZ-1
> 
> Signed-off-by: Govind Singh 
> Signed-off-by: Kalle Valo 

This introduced a new sparse warning:

drivers/net/wireless/ath/ath10k/htc.c:875:6: warning: symbol 
'ath10k_htc_pktlog_svc_supported' was not declared. Should it be static?

I fixed this in the pending branch.

-- 
https://patchwork.kernel.org/patch/10577869/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



Re: [PATCH 2/2] ath10k: Support extended board data download for dual-band QCA9984

2018-09-03 Thread Kalle Valo
Sathishkumar Muruganandam  wrote:

> To support dual-band variant of QCA9984, new extended board data (eBDF)
> is introduced since existing board data ran out of space.
> 
> Below is the brief implementation & design detail,
> 
> 
> 1. New OTP changes to inform eBDF support in existing OTP download to
> fetch board ID and chip ID. This is backward compatible and older
> card sends 0 by default for eBDF support bit (bit 18 of OTP response) we
> check in ath10k driver.
> 
> 2. If eBDF is supported, then we need to fetch eBDF ID which is bundled
> in downloaded board data. So again OTP is executed for knowing the eBDF ID.
> This is done once we set 'board_data_initialized' bit. If eBDF ID
> returned is zero, we continue booting with previous board data downloaded.
> 
> 3. Based on the eBDF ID fetched, ath10k driver tries to download the
> extended board data to a new offset ahead of already downloaded board
> data address.
> 
> 4. A new BD IE type, ATH10K_BD_IE_BOARD_EXT is added to differentiate in
> bundling eBDF separately in board-2.bin and also to parse through
> board bundle for eBDF download in ath10k boot.
> 
> 5. If eBDF is not present in the board-2.bin bundle or when board ID is
> zero, we do a fallback boot to "eboard.bin" in the same QCA9984/hw1.0 dir.
> This is same as done to existing "board.bin" if board ID is not present
> in board-2.bin bundle.
> 
> Current design is that eBDF size will be 2KB and eBDF ID will be
> byte value.
> 
> Tested the above changes with dual-band variant of QCA9984 card. OTP
> update needed for the test will be part of next FW release 10.4-3.6-.
> 
> Below are the logs with ath10k BOOT debugs enabled.
> 
> First OTP response :
> -
> ..
> boot upload otp to 0x1234 len 9478 for board id
> boot get otp board id result 0x00040400 board_id 1 chip_id 0 ext_bid_support 1
> ..
> 
> Second OTP response :
> -
> ..
> boot upload otp to 0x1234 len 9478 for ext board id
> boot get otp ext board id result 0x0005 ext_board_id 5
> boot using eboard name 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5'
> ..
> 
> Extended board data download:
> --
> ..
> board name
> : 62 75 73 3d 70 63 69 2c 62 6d 69 2d 63 68 69 70  bus=pci,bmi-chip
> 0010: 2d 69 64 3d 30 2c 62 6d 69 2d 65 62 6f 61 72 64  -id=0,bmi-eboard
> 0020: 2d 69 64 3d 35   -id=5
> boot found match for name 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5'
> boot found eboard data for 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5'
> using board api 2
> boot writing ext board data to addr 0xc3000
> ..
> 
> Fallback Extended board data download from "eboard.bin":
> -
> ..
> board name
> : 62 75 73 3d 70 63 69 2c 62 6d 69 2d 63 68 69 70  bus=pci,bmi-chip
> 0010: 2d 69 64 3d 30 2c 62 6d 69 2d 62 6f 61 72 64 2d  -id=0,bmi-board-
> 0020: 69 64 3d 31 30   id=10
> failed to fetch board data for bus=pci,bmi-chip-id=0,bmi-eboard-id=5 from 
> ath10k/QCA9984/hw1.0/board-2.bin
> boot fw request 'ath10k/QCA9984/hw1.0/eboard.bin': 0
> using board api 1
> boot writing ext board data to addr 0xc3000
> ..
> 
> Signed-off-by: Sathishkumar Muruganandam 
> Signed-off-by: Kalle Valo 

This introduced a new checkpatch warning:

drivers/net/wireless/ath/ath10k/core.c:1059: line over 90 characters

I fixed this in the pending branch.

-- 
https://patchwork.kernel.org/patch/10575361/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



Re: [PATCH 1/3] debug: use common debug for ack timeout output

2018-09-03 Thread Kalle Valo
Kalle Valo  writes:

> Tomislav Požega  writes:
>
>> Move ack debug code to common-debug and adjust
>> ath9k/ath9k_htc debug for common ack output.
>
> Why? I guess to be able to get ack timeout with ath9k_htc, but please
> write the reason clearly in the commit log.
>
> Also the title prefix should be "ath9k:".

Also please don't CC ath9k_htc_fw list. They spam with "Your message to
ath9k_htc_fw awaits moderator approval" which is REALLY annoying. From
now on I'll drop them automatically.

-- 
Kalle Valo


Re: [PATCH 3/3] ath9k_htc: increase number of configurable virtual interfaces

2018-09-03 Thread Kalle Valo
Tomislav Požega  writes:

> Increase driver limit for various interface combinations.
> I was able to start 8 virtual APs and connect 5 clients to
> these. Frimware support is required too, see:
> https://github.com/qca/open-ath9k-htc-firmware/pull/149

So what is the exact firmware version which has this support? Is it
available from linux-firmware.git?

And what about people using older firmware? Now it's easy to use a
unsupported configuration with those firmware images. The best would be
that ath9k could somehow detect what features the firmware supports.

-- 
Kalle Valo


Re: [PATCH 1/3] debug: use common debug for ack timeout output

2018-09-03 Thread Kalle Valo
Tomislav Požega  writes:

> Move ack debug code to common-debug and adjust
> ath9k/ath9k_htc debug for common ack output.

Why? I guess to be able to get ack timeout with ath9k_htc, but please
write the reason clearly in the commit log.

Also the title prefix should be "ath9k:".

-- 
Kalle Valo


Re: [PATCH 1/3] debug: use common debug for ack timeout output

2018-09-03 Thread Kalle Valo
Tomislav Požega wrote:

> Move ack debug code to common-debug and adjust
> ath9k/ath9k_htc debug for common ack output.
> 
> Signed-off-by: Tomislav Požega 

Failed to build:

drivers/net/wireless/ath/ath9k/debug.c: In function 'ath9k_init_debug':
drivers/net/wireless/ath/ath9k/debug.c:1431:2: error: implicit declaration of 
function 'ath9k_cmn_dbg_ack_to'; did you mean 'ath9k_cmn_debug_ack_to'? 
[-Werror=implicit-function-declaration]
  ath9k_cmn_dbg_ack_to(sc->debug.debugfs_phy, sc->sc_ah);
  ^~~~
  ath9k_cmn_debug_ack_to
cc1: some warnings being treated as errors
make[5]: *** [drivers/net/wireless/ath/ath9k/debug.o] Error 1
make[5]: *** Waiting for unfinished jobs
make[5]: *** wait: No child processes.  Stop.
make[4]: *** [drivers/net/wireless/ath/ath9k] Error 2
make[3]: *** [drivers/net/wireless/ath] Error 2
make[2]: *** [drivers/net/wireless] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2

3 patches set to Changes Requested.

10586273 [1/3] debug: use common debug for ack timeout output
10586277 [2/3] ath9k_htc: enable ANI debug output
10586275 [3/3] ath9k_htc: increase number of configurable virtual interfaces

-- 
https://patchwork.kernel.org/patch/10586273/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



Re: [PATCH v2] rtlwifi: remove set but unused variables

2018-09-03 Thread Pkshih
On Mon, 2018-09-03 at 22:57 +0800, Kevin Lo wrote:
> Remove set but unused variables from _rtl88ee_hw_configure() and
> _rtl8723e_hw_configure().
> 
> Signed-off-by: Kevin Lo 

Acked-by: Ping-Ke Shih 



[PATCH v2 2/2] ath10k: Set sk_pacing_shift to 6 for 11AC WiFi chips

2018-09-03 Thread Kan Yan
Hi Wen Gong,

Do you also have throughput and latency data for different
sk_pacing_shift setting when the ath10k client is at some distance
away from AP? Just curious about its impact on latency with less than
ideal PHY rate.

Thanks,
Kan


[PATCH 3/3] ath9k_htc: increase number of configurable virtual interfaces

2018-09-03 Thread Tomislav Požega
Increase driver limit for various interface combinations.
I was able to start 8 virtual APs and connect 5 clients to
these. Frimware support is required too, see:
https://github.com/qca/open-ath9k-htc-firmware/pull/149

Signed-off-by: Tomislav Požega 
---
 drivers/net/wireless/ath/ath9k/htc.h  |8 
 drivers/net/wireless/ath/ath9k/htc_drv_init.c |6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc.h 
b/drivers/net/wireless/ath/ath9k/htc.h
index 5490c5f..b6c577b 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -197,8 +197,8 @@ struct ath9k_htc_target_rx_stats {
__be32 host_done;
 } __packed;
 
-#define ATH9K_HTC_MAX_VIF 2
-#define ATH9K_HTC_MAX_BCN_VIF 2
+#define ATH9K_HTC_MAX_VIF 8
+#define ATH9K_HTC_MAX_BCN_VIF 8
 
 #define INC_VIF(_priv, _type) do { \
switch (_type) {\
@@ -251,8 +251,8 @@ struct ath9k_vif_iter_data {
u8 mask[ETH_ALEN];
 };
 
-#define ATH9K_HTC_MAX_STA 8
-#define ATH9K_HTC_MAX_TID 8
+#define ATH9K_HTC_MAX_STA 128
+#define ATH9K_HTC_MAX_TID 16
 
 enum tid_aggr_state {
AGGR_STOP = 0,
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c 
b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 214c682..fa13ba9 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -697,9 +697,9 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv,
 }
 
 static const struct ieee80211_iface_limit if_limits[] = {
-   { .max = 2, .types = BIT(NL80211_IFTYPE_STATION) |
+   { .max = 8, .types = BIT(NL80211_IFTYPE_STATION) |
 BIT(NL80211_IFTYPE_P2P_CLIENT) },
-   { .max = 2, .types = BIT(NL80211_IFTYPE_AP) |
+   { .max = 8, .types = BIT(NL80211_IFTYPE_AP) |
 #ifdef CONFIG_MAC80211_MESH
 BIT(NL80211_IFTYPE_MESH_POINT) |
 #endif
@@ -709,7 +709,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv,
 static const struct ieee80211_iface_combination if_comb = {
.limits = if_limits,
.n_limits = ARRAY_SIZE(if_limits),
-   .max_interfaces = 2,
+   .max_interfaces = 8,
.num_different_channels = 1,
 };
 
-- 
1.7.0.4



[PATCH 1/3] debug: use common debug for ack timeout output

2018-09-03 Thread Tomislav Požega
Move ack debug code to common-debug and adjust
ath9k/ath9k_htc debug for common ack output.

Signed-off-by: Tomislav Požega 
---
 drivers/net/wireless/ath/ath9k/common-debug.c  |   29 
 drivers/net/wireless/ath/ath9k/common-debug.h  |7 +
 drivers/net/wireless/ath/ath9k/debug.c |   26 +
 drivers/net/wireless/ath/ath9k/htc_drv_debug.c |4 +++
 4 files changed, 41 insertions(+), 25 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/common-debug.c 
b/drivers/net/wireless/ath/ath9k/common-debug.c
index 239429f..230fe55 100644
--- a/drivers/net/wireless/ath/ath9k/common-debug.c
+++ b/drivers/net/wireless/ath/ath9k/common-debug.c
@@ -258,3 +258,32 @@ void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy,
_phy_err);
 }
 EXPORT_SYMBOL(ath9k_cmn_debug_phy_err);
+
+#ifdef CONFIG_ATH9K_DYNACK
+static ssize_t read_file_ackto(struct file *file, char __user *user_buf,
+   size_t count, loff_t *ppos)
+{
+struct ath_hw *ah = file->private_data;
+char buf[32];
+unsigned int len;
+
+len = sprintf(buf, "%u %c\n", ah->dynack.ackto,
+  (ah->dynack.enabled) ? 'A' : 'S');
+
+return simple_read_from_buffer(user_buf, count, ppos, buf, len);
+}
+
+static const struct file_operations fops_ackto = {
+.read = read_file_ackto,
+.open = simple_open,
+.owner = THIS_MODULE,
+.llseek = default_llseek,
+};
+
+void ath9k_cmn_debug_ack_to(struct dentry *debugfs_phy,
+   struct ath_hw *ah)
+{
+   debugfs_create_file("ack_to", 0400, debugfs_phy, ah, _ackto);
+}
+EXPORT_SYMBOL(ath9k_cmn_debug_ack_to);
+#endif
diff --git a/drivers/net/wireless/ath/ath9k/common-debug.h 
b/drivers/net/wireless/ath/ath9k/common-debug.h
index 3376990..a4bc75f 100644
--- a/drivers/net/wireless/ath/ath9k/common-debug.h
+++ b/drivers/net/wireless/ath/ath9k/common-debug.h
@@ -71,6 +71,8 @@ void ath9k_cmn_debug_recv(struct dentry *debugfs_phy,
  struct ath_rx_stats *rxstats);
 void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy,
 struct ath_rx_stats *rxstats);
+void ath9k_cmn_debug_ack_to(struct dentry *debugfs_phy,
+   struct ath_hw *ah);
 #else
 static inline void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy,
struct ath_hw *ah)
@@ -96,4 +98,9 @@ static inline void ath9k_cmn_debug_phy_err(struct dentry 
*debugfs_phy,
   struct ath_rx_stats *rxstats)
 {
 }
+
+static inline void ath9k_cmn_debug_ack_to(struct dentry *debugfs_phy,
+ struct ath_hw *ah)
+{
+}
 #endif /* CONFIG_ATH9K_COMMON_DEBUG */
diff --git a/drivers/net/wireless/ath/ath9k/debug.c 
b/drivers/net/wireless/ath/ath9k/debug.c
index 0a6eb8a..d2ea0b1 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -1038,29 +1038,6 @@ static ssize_t read_file_btcoex(struct file *file, char 
__user *user_buf,
 };
 #endif
 
-#ifdef CONFIG_ATH9K_DYNACK
-static ssize_t read_file_ackto(struct file *file, char __user *user_buf,
-  size_t count, loff_t *ppos)
-{
-   struct ath_softc *sc = file->private_data;
-   struct ath_hw *ah = sc->sc_ah;
-   char buf[32];
-   unsigned int len;
-
-   len = sprintf(buf, "%u %c\n", ah->dynack.ackto,
- (ah->dynack.enabled) ? 'A' : 'S');
-
-   return simple_read_from_buffer(user_buf, count, ppos, buf, len);
-}
-
-static const struct file_operations fops_ackto = {
-   .read = read_file_ackto,
-   .open = simple_open,
-   .owner = THIS_MODULE,
-   .llseek = default_llseek,
-};
-#endif
-
 #ifdef CONFIG_ATH9K_WOW
 
 static ssize_t read_file_wow(struct file *file, char __user *user_buf,
@@ -1451,8 +1428,7 @@ int ath9k_init_debug(struct ath_hw *ah)
 #endif
 
 #ifdef CONFIG_ATH9K_DYNACK
-   debugfs_create_file("ack_to", 0400, sc->debug.debugfs_phy,
-   sc, _ackto);
+   ath9k_cmn_dbg_ack_to(sc->debug.debugfs_phy, sc->sc_ah);
 #endif
debugfs_create_file("tpc", 0600, sc->debug.debugfs_phy, sc, _tpc);
 
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c 
b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
index b3ed65e..a345da8 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
@@ -520,5 +520,9 @@ int ath9k_htc_init_debug(struct ath_hw *ah)
ath9k_cmn_debug_base_eeprom(priv->debug.debugfs_phy, priv->ah);
ath9k_cmn_debug_modal_eeprom(priv->debug.debugfs_phy, priv->ah);
 
+#ifdef CONFIG_ATH9K_DYNACK
+   ath9k_cmn_debug_ack_to(priv->debug.debugfs_phy, priv->ah);
+#endif
+
return 0;
 }
-- 
1.7.0.4



[PATCH 2/3] ath9k_htc: enable ANI debug output

2018-09-03 Thread Tomislav Požega
Enable ANI output in debug file similar to how it's done on ath9k.
Disabling the entire feature is also working. Tested with ALFA
AWUS036NHA device.

Signed-off-by: Tomislav Požega 
---
 drivers/net/wireless/ath/ath9k/htc.h   |1 +
 drivers/net/wireless/ath/ath9k/htc_drv_debug.c |   98 
 drivers/net/wireless/ath/ath9k/htc_drv_main.c  |   49 
 3 files changed, 148 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc.h 
b/drivers/net/wireless/ath/ath9k/htc.h
index 9f64e32..5490c5f 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -564,6 +564,7 @@ void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,
 int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv,
u8 enable_coex);
 void ath9k_htc_ani_work(struct work_struct *work);
+void ath9k_htc_check_ani(struct ath9k_htc_priv *priv);
 void ath9k_htc_start_ani(struct ath9k_htc_priv *priv);
 void ath9k_htc_stop_ani(struct ath9k_htc_priv *priv);
 
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c 
b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
index a345da8..cfbb309 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
@@ -398,6 +398,102 @@ static ssize_t write_file_debug(struct file *file, const 
char __user *user_buf,
.llseek = default_llseek,
 };
 
+static ssize_t read_file_ani(struct file *file, char __user *user_buf,
+size_t count, loff_t *ppos)
+{
+   struct ath9k_htc_priv *priv = file->private_data;
+   struct ath_common *common = ath9k_hw_common(priv->ah);
+   struct ath_hw *ah = priv->ah;
+   unsigned int len = 0;
+   const unsigned int size = 1024;
+   ssize_t retval = 0;
+   char *buf;
+   int i;
+   struct {
+   const char *name;
+   unsigned int val;
+   } ani_info[] = {
+   { "ANI RESET", ah->stats.ast_ani_reset },
+   { "OFDM LEVEL", ah->ani.ofdmNoiseImmunityLevel },
+   { "CCK LEVEL", ah->ani.cckNoiseImmunityLevel },
+   { "SPUR UP", ah->stats.ast_ani_spurup },
+   { "SPUR DOWN", ah->stats.ast_ani_spurup },
+   { "OFDM WS-DET ON", ah->stats.ast_ani_ofdmon },
+   { "OFDM WS-DET OFF", ah->stats.ast_ani_ofdmoff },
+   { "MRC-CCK ON", ah->stats.ast_ani_ccklow },
+   { "MRC-CCK OFF", ah->stats.ast_ani_cckhigh },
+   { "FIR-STEP UP", ah->stats.ast_ani_stepup },
+   { "FIR-STEP DOWN", ah->stats.ast_ani_stepdown },
+   { "INV LISTENTIME", ah->stats.ast_ani_lneg_or_lzero },
+   { "OFDM ERRORS", ah->stats.ast_ani_ofdmerrs },
+   { "CCK ERRORS", ah->stats.ast_ani_cckerrs },
+   };
+
+   buf = kzalloc(size, GFP_KERNEL);
+   if (buf == NULL)
+   return -ENOMEM;
+
+   len += scnprintf(buf + len, size - len, "%15s: %s\n", "ANI",
+common->disable_ani ? "DISABLED" : "ENABLED");
+
+   if (common->disable_ani)
+   goto exit;
+
+   for (i = 0; i < ARRAY_SIZE(ani_info); i++)
+   len += scnprintf(buf + len, size - len, "%15s: %u\n",
+ani_info[i].name, ani_info[i].val);
+
+exit:
+   if (len > size)
+   len = size;
+
+   retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
+   kfree(buf);
+
+   return retval;
+}
+
+static ssize_t write_file_ani(struct file *file,
+ const char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+   struct ath9k_htc_priv *priv = file->private_data;
+   struct ath_common *common = ath9k_hw_common(priv->ah);
+   unsigned long ani;
+   char buf[32];
+   ssize_t len;
+
+   len = min(count, sizeof(buf) - 1);
+   if (copy_from_user(buf, user_buf, len))
+   return -EFAULT;
+
+   buf[len] = '\0';
+   if (kstrtoul(buf, 0, ))
+   return -EINVAL;
+
+   if (ani > 1)
+   return -EINVAL;
+
+   common->disable_ani = !ani;
+
+   if (common->disable_ani) {
+   clear_bit(ATH_OP_ANI_RUN, >op_flags);
+   ath9k_htc_stop_ani(priv);
+   } else {
+   ath9k_htc_check_ani(priv);
+   }
+
+   return count;
+}
+
+static const struct file_operations fops_ani = {
+   .read = read_file_ani,
+   .write = write_file_ani,
+   .open = simple_open,
+   .owner = THIS_MODULE,
+   .llseek = default_llseek,
+};
+
 /* Ethtool support for get-stats */
 #define AMKSTR(nm) #nm "_BE", #nm "_BK", #nm "_VI", #nm "_VO"
 static const char ath9k_htc_gstrings_stats[][ETH_GSTRING_LEN] = {
@@ -524,5 +620,7 @@ int ath9k_htc_init_debug(struct ath_hw *ah)
ath9k_cmn_debug_ack_to(priv->debug.debugfs_phy, priv->ah);
 #endif
 
+   

Re: [PATCH 4.19] mt76x0: fix remove_interface

2018-09-03 Thread Sid Hayn
Best I can say is that it seemed to happen after a failed connection.
It would connect and disconnect a few times and work fine, but if it
failed to connect for any reason (mostly mismatched settings between
AP and wpa_supplicant.conf) then the bug would occur. So,
wpa_supplicant would up the interface, try to connect, fail, down the
interface and exit, then the next loop of my script (with a different
conf file) would start and wpa_supplicant would be unable to up the
interface.

Hope that made any sense, because it didn't to me :-)

-Zero
On Mon, Sep 3, 2018 at 12:48 PM Kalle Valo  wrote:
>
> Stanislaw Gruszka  writes:
>
> > We wrongly use wcid_mask instead of vif_mask
> >
> > Fixes: 95e444098a7b ("mt76x0: main file")
> > Reported-and-tested-by: Sid Hayn 
> > Signed-off-by: Stanislaw Gruszka 
>
> For bug fixes please always try to describe the bug and symptoms. I can
> add it this time. From the other thread I saw that 'ifconfig up' failed
> like this:
>
> SIOCSIFFLAGS: No space left on device
>
> But in what cases did that happen? (I assume not always)
>
> --
> Kalle Valo


[PATCH v2] rtlwifi: remove set but unused variables

2018-09-03 Thread Kevin Lo
Remove set but unused variables from _rtl88ee_hw_configure() and
_rtl8723e_hw_configure().

Signed-off-by: Kevin Lo 
---
v2: Correct my email address.

---
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
index 988d5ac57d02..cfc8762c55f4 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
@@ -951,12 +951,8 @@ static bool _rtl88ee_init_mac(struct ieee80211_hw *hw)
 static void _rtl88ee_hw_configure(struct ieee80211_hw *hw)
 {
struct rtl_priv *rtlpriv = rtl_priv(hw);
-   u8 reg_bw_opmode;
-   u32 reg_ratr, reg_prsr;
+   u32 reg_prsr;
 
-   reg_bw_opmode = BW_OPMODE_20MHZ;
-   reg_ratr = RATE_ALL_CCK | RATE_ALL_OFDM_AG |
-   RATE_ALL_OFDM_1SS | RATE_ALL_OFDM_2SS;
reg_prsr = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
 
rtl_write_dword(rtlpriv, REG_RRSR, reg_prsr);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
index 545115db507e..f783e4a8083d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
@@ -799,11 +799,9 @@ static void _rtl8723e_hw_configure(struct ieee80211_hw *hw)
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
struct rtl_priv *rtlpriv = rtl_priv(hw);
u8 reg_bw_opmode;
-   u32 reg_ratr, reg_prsr;
+   u32 reg_prsr;
 
reg_bw_opmode = BW_OPMODE_20MHZ;
-   reg_ratr = RATE_ALL_CCK | RATE_ALL_OFDM_AG |
-   RATE_ALL_OFDM_1SS | RATE_ALL_OFDM_2SS;
reg_prsr = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
 
rtl_write_byte(rtlpriv, REG_INIRTS_RATE_SEL, 0x8);


RE: Build iw for 32bit ARM

2018-09-03 Thread Jakov Simunic
Hi Steve,
We are building with ptxdist, we have a compiler for arm 
(arm-linux-gnueabihf-gcc), I am not a total novice in this, and have already 
written some ptxdist rules, but haven't done it with non-autoconfizzed 
packages, basically the problem is that if I use the default iw.make from the 
ptxdist master branch, iw's Makefile tries to compile with the native compiler 
and native libnl, no matter what option i supply it with, I always get a x86-32 
executable. When I modify the iw.make rule with the correct CC (by making a 
custom compile step), it then fails to find the correct libnl through 
pkg-config. The iw package is not modified at all. Could you suggest how to 
hard code the CC (or that it gets it normally from a CC variable supplied to 
the Makefile) or how to avoid pkg-config and supply the options needed 
manually. I know this is a step back from multi-platform build practices, but I 
just need it that way.

--
Lijep pozdrav / Best regards
Jakov Šimunić

-Original Message-
From: Steve deRosier  
Sent: Friday, August 31, 2018 5:31 PM
To: Jakov Simunic 
Cc: Johannes Berg ; linux-wireless 

Subject: Re: Build iw for 32bit ARM

Hi Jakov,

On Fri, Aug 31, 2018 at 5:59 AM Jakov Simunic  
wrote:
>
> Hello,
> I am working on an embedded project which uses an armv7l architecture, which 
> is a 32bit platform, and I am trying to compile iw-4.9 for it, and I don't 
> know how to compile it for 32bit arches.

Unless you're building your Linux system 100% from scratch, you should leverage 
the build system for your platform. It will automatically do the right thing. 
You're likely using Buildroot, OpenWRT, OpenEmbedded, Yocto or some other 
platform that has compilers, build systems, packages and so on. First off, most 
likely iw is already included. And even if you want to build from your own 
modified version, theres ways to build using the systems above to just build it 
in-tree. And finally, even if not, you should use the target libraries and the 
cross-compilers that are used by your platform.

Step one, if you haven't already, is to get the build system for your platform 
and configure and build it. Then try building your modified version of iw if 
the stock one isn't helpful for you. I'd integrate it into the platform build 
system, but you could build out-of-tree by setting up the right flags and 
CROSS_COMPILER to point to the toolchain used for your platform. If I were 
doing that, I'd build the platform in verbose output mode and examine the 
compiler commandlines for hints.

> Tried adding -m32 to the CFLAGS, everything passes the build except the iw 
> binary, which says:
>
> iw.o: could not read symbols: File in wrong format
> collect2: ld returned 1 exit status
> make: *** [iw] Error 1
>

Most likely your architecture flags to the linker don't match what you gave in 
the compiler stage. You could always also confirm the format of iw.o with the 
`file` command.

- Steve


[PATCH] rtlwifi: remove set but unused variables

2018-09-03 Thread Kevin Lo
Remove unused variables from _rtl88ee_hw_configure() and
_rtl8723e_hw_configure().

Signed-off-by: Kevin Lo 
---
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
index 988d5ac57d02..cfc8762c55f4 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
@@ -951,12 +951,8 @@ static bool _rtl88ee_init_mac(struct ieee80211_hw *hw)
 static void _rtl88ee_hw_configure(struct ieee80211_hw *hw)
 {
struct rtl_priv *rtlpriv = rtl_priv(hw);
-   u8 reg_bw_opmode;
-   u32 reg_ratr, reg_prsr;
+   u32 reg_prsr;
 
-   reg_bw_opmode = BW_OPMODE_20MHZ;
-   reg_ratr = RATE_ALL_CCK | RATE_ALL_OFDM_AG |
-   RATE_ALL_OFDM_1SS | RATE_ALL_OFDM_2SS;
reg_prsr = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
 
rtl_write_dword(rtlpriv, REG_RRSR, reg_prsr);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
index 545115db507e..f783e4a8083d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
@@ -799,11 +799,9 @@ static void _rtl8723e_hw_configure(struct ieee80211_hw *hw)
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
struct rtl_priv *rtlpriv = rtl_priv(hw);
u8 reg_bw_opmode;
-   u32 reg_ratr, reg_prsr;
+   u32 reg_prsr;
 
reg_bw_opmode = BW_OPMODE_20MHZ;
-   reg_ratr = RATE_ALL_CCK | RATE_ALL_OFDM_AG |
-   RATE_ALL_OFDM_1SS | RATE_ALL_OFDM_2SS;
reg_prsr = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
 
rtl_write_byte(rtlpriv, REG_INIRTS_RATE_SEL, 0x8);


Re: [PATCH 4.19] mt76x0: fix remove_interface

2018-09-03 Thread Kalle Valo
Stanislaw Gruszka  writes:

> We wrongly use wcid_mask instead of vif_mask
>
> Fixes: 95e444098a7b ("mt76x0: main file")
> Reported-and-tested-by: Sid Hayn 
> Signed-off-by: Stanislaw Gruszka 

For bug fixes please always try to describe the bug and symptoms. I can
add it this time. From the other thread I saw that 'ifconfig up' failed
like this:

SIOCSIFFLAGS: No space left on device

But in what cases did that happen? (I assume not always)

-- 
Kalle Valo


[PATCH 4.19] mt76x0: fix remove_interface

2018-09-03 Thread Stanislaw Gruszka
We wrongly use wcid_mask instead of vif_mask

Fixes: 95e444098a7b ("mt76x0: main file")
Reported-and-tested-by: Sid Hayn 
Signed-off-by: Stanislaw Gruszka 
---
 drivers/net/wireless/mediatek/mt76/mt76x0/main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/main.c 
b/drivers/net/wireless/mediatek/mt76/mt76x0/main.c
index cf6ffb1ba4a2..22bc9d368728 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/main.c
@@ -77,9 +77,8 @@ static void mt76x0_remove_interface(struct ieee80211_hw *hw,
 {
struct mt76x0_dev *dev = hw->priv;
struct mt76_vif *mvif = (struct mt76_vif *) vif->drv_priv;
-   unsigned int wcid = mvif->group_wcid.idx;
 
-   dev->wcid_mask[wcid / BITS_PER_LONG] &= ~BIT(wcid % BITS_PER_LONG);
+   dev->vif_mask &= ~BIT(mvif->idx);
 }
 
 static int mt76x0_config(struct ieee80211_hw *hw, u32 changed)
-- 
2.7.5



Re: [PATCH v8 0/2] Fix PTK rekey freezes and clear text leak

2018-09-03 Thread Johannes Berg
On Fri, 2018-08-31 at 15:00 +0200, Alexander Wetzel wrote:
> 
> Version history:
> V8
> - Minor code cleanup 
> - some minor clarifications in commit messages
> 

Ok, enough :-)

Applied this now.

johannes


Re: Build iw for 32bit ARM

2018-09-03 Thread Johannes Berg
Hi,

In addition or as an alternative to what Steve said, make sure your
LDFLAGS also contains -m32.

johannes



RE: [PATCH 09/28] mac80211: pass the TWT support bits in extended caps to the driver

2018-09-03 Thread Grumbach, Emmanuel
> 
> On Mon, 2018-09-03 at 09:28 +, Grumbach, Emmanuel wrote:
> > >
> > For managed mode, the driver will need to check the HE cap along with
> > the extended capabilities to determine whether AP supports TWT or not.
> 
> Do you have any idea why it's there twice? Sounds like we should resolve
> that in mac80211, rather than requiring the driver to check two places...
>

I am now looking at table 9-135 in D3.0 and at Table-9-262z. The first describes
the extended caps IE, the second, the HE CAP IE. I can't really find any 
difference.
Since the driver already has the full HE CAP IE, I thought we'd just reflect 
what we
had in the extended caps IE so that it has the "raw" data, but I agree that 
mac80211
could / should aggregate the data.


Re: [PATCH 09/28] mac80211: pass the TWT support bits in extended caps to the driver

2018-09-03 Thread Johannes Berg
On Mon, 2018-09-03 at 09:28 +, Grumbach, Emmanuel wrote:
> > 
> For managed mode, the driver will need to check the HE cap along with the
> extended capabilities to determine whether AP supports TWT or not.

Do you have any idea why it's there twice? Sounds like we should resolve
that in mac80211, rather than requiring the driver to check two
places...

johannes


RE: [PATCH 09/28] mac80211: pass the TWT support bits in extended caps to the driver

2018-09-03 Thread Grumbach, Emmanuel
> 
> > Since those bits are present in the HE Cap as well, we can set the
> > capability bits in the Extended Capabilities IE based on what is
> > advertised in the HE Cap IE.
> 
> It's not clear to me what this is trying to say, you don't seem to do anything
> with the HE capabilities in the patch.
>

You are right. You can drop this part of the commit log. I guess I wrote that
for the AP mode but in the AP mode this is not relevant since the beacon is
built by hostapd.
For managed mode, the driver will need to check the HE cap along with the
extended capabilities to determine whether AP supports TWT or not.


Re: [PATCH 00/28] cfg80211/mac80211 patches from our internal tree 2018-08-31

2018-09-03 Thread Johannes Berg
Applied 2, 4, 8, 10, 11 as fixes.
Applied 1, 3, 5, 6, 7, 

As Kalle pointed out, 20-28 are corrupted, so you need to resend; 22 was
already in the tree, no need to resend that one.

Please respin patch 20 ("mac80211: fix saving a few HE values") to use
FIELD_GET() to avoid such problems in the future. Or perhaps just use
le32_get_bits(), avoiding the explicit conversion first, I think the
compiler will probably do something sane either way.

While you're resending, please fix the kernel-doc in patch 19.

Please resend patches 9 and 12 as well, addressing my comments on it.

Still haven't looked at patch 12 because I remember some ordering issues
and need to double-check that.

johannes


Re: [PATCH 12/28] cfg80211: add he_capabilities (ext) IE to AP settings

2018-09-03 Thread Johannes Berg
On Fri, 2018-08-31 at 11:31 +0300, Luca Coelho wrote:
> 
> + cap = cfg80211_find_ext_ie(WLAN_EID_EXT_HE_CAPABILITY, ies, ies_len);
> + if (cap && cap[1] >= sizeof(*params->he_cap) + 1)
> + params->he_cap = (void *)(cap + 3);

I think this should validate that the element is actually well-formed
before passing it to the driver. To do this, need to refactor the size
checks from ieee80211_he_cap_ie_to_sta_he_cap().

johannes


Re: [PATCH 09/28] mac80211: pass the TWT support bits in extended caps to the driver

2018-09-03 Thread Johannes Berg
On Fri, 2018-08-31 at 11:31 +0300, Luca Coelho wrote:

> Since those bits are present in the HE Cap as well,
> we can set the capability bits in the Extended
> Capabilities IE based on what is advertised in the HE Cap IE.

It's not clear to me what this is trying to say, you don't seem to do
anything with the HE capabilities in the patch.

johannes


Re: [PATCH 12/16] iwlwifi: mvm: enable sending HE_AIR_SNIFFER command via debugfs

2018-09-03 Thread Arend van Spriel

On 8/31/2018 11:56 AM, Luca Coelho wrote:

From: Shaul Triebitz 

In order to receive TB (Trigger Based) PPDU in monitor mode,
the Driver must send the HE_AIR_SNIFFER_CONFIG_CMD host command.
Enable that via debugfs.

Signed-off-by: Liad Kaufman 
Signed-off-by: Ido Yariv 
Signed-off-by: Shaul Triebitz 
Signed-off-by: Luca Coelho 
---
  .../wireless/intel/iwlwifi/fw/api/datapath.h  |  5 ++
  .../net/wireless/intel/iwlwifi/fw/api/mac.h   | 14 +
  .../net/wireless/intel/iwlwifi/mvm/debugfs.c  | 53 +++
  3 files changed, 72 insertions(+)


[snip]


diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c 
b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 202158d03d36..725b97ecb447 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -1727,6 +1727,57 @@ iwl_dbgfs_send_echo_cmd_write(struct iwl_mvm *mvm, char 
*buf,
return ret ?: count;
  }

+static ssize_t
+iwl_dbgfs_set_aid_read(struct file *file, char __user *user_buf,
+  size_t count, loff_t *ppos)
+{
+   return 0;
+}
+
+static ssize_t
+iwl_dbgfs_set_aid_write(struct file *file, const char __user *user_buf,
+   size_t count, loff_t *ppos)
+{
+   struct iwl_mvm *mvm = file->private_data;
+   struct iwl_he_monitor_cmd he_mon_cmd = {};
+   u8 tmp_buf[32];
+   u32 aid;
+   int ret;
+
+   if (!iwl_mvm_firmware_running(mvm))
+   return -EIO;
+
+   if (count > sizeof(tmp_buf))
+   return -EINVAL;
+
+   if (copy_from_user(tmp_buf, user_buf, count))
+   return -EIO;
+
+   ret = sscanf(tmp_buf, "%x %2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx", ,
+_mon_cmd.bssid[0], _mon_cmd.bssid[1],
+_mon_cmd.bssid[2], _mon_cmd.bssid[3],
+_mon_cmd.bssid[4], _mon_cmd.bssid[5]);
+   if (ret != 7)
+   return -EINVAL;
+
+   he_mon_cmd.aid = cpu_to_le16(aid);
+
+   mutex_lock(>mutex);
+   ret = iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(HE_AIR_SNIFFER_CONFIG_CMD,
+  DATA_PATH_GROUP, 0), 0,
+  sizeof(he_mon_cmd), _mon_cmd);
+   mutex_unlock(>mutex);
+
+   return ret ?: count;
+}
+
+static const struct file_operations iwl_dbgfs_set_aid_ops = {
+   .read = iwl_dbgfs_set_aid_read,
+   .write = iwl_dbgfs_set_aid_write,
+   .open = simple_open,
+   .llseek = default_llseek,
+};


What's with the name 'set_aid'?

Regards,
Arend