Re: [PATCH] brcmfmac: Add USB ID for Cisco Linksys AE1200

2016-06-20 Thread Rafał Miłecki
On 21 June 2016 at 02:18, Ismael Luceno  wrote:
> @@ -56,6 +57,8 @@
>
>  /* USB Device IDs */
>  #define BRCM_USB_43143_DEVICE_ID   0xbd1e
> +#define BRCM_USB_43235_LINKSYS_DEVICE_ID \
> +   0x0039

I guess you wanted to have number aligned to the column of other ones?
I'm not sure if that improves readability at all.

-- 
Rafał
--
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] ath10k: Enable support for QCA9888

2016-06-20 Thread akolli
From: Anilkumar Kolli 

QCA9888 shares the same configuration with QCA99X0
with NSS=2.

Signed-off-by: Anilkumar Kolli 
---
 drivers/net/wireless/ath/ath10k/core.c |   26 ++
 drivers/net/wireless/ath/ath10k/hw.c   |9 +
 drivers/net/wireless/ath/ath10k/hw.h   |   12 
 drivers/net/wireless/ath/ath10k/pci.c  |   13 +
 4 files changed, 60 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index a003980d8972..8a080ab5b07e 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -185,6 +185,28 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
},
},
{
+   .id = QCA9888_HW_2_0_DEV_VERSION,
+   .dev_id = QCA9888_2_0_DEVICE_ID,
+   .name = "qca9888 hw2.0",
+   .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
+   .uart_pin = 7,
+   .otp_exe_param = 0x0700,
+   .continuous_frag_desc = true,
+   .channel_counters_freq_hz = 15,
+   .max_probe_resp_desc_thres = 24,
+   .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_BEFORE,
+   .tx_chain_mask = 3,
+   .rx_chain_mask = 3,
+   .max_spatial_stream = 2,
+   .cal_data_len = 12064,
+   .fw = {
+   .dir = QCA9888_HW_2_0_FW_DIR,
+   .board = QCA9888_HW_2_0_BOARD_DATA_FILE,
+   .board_size = QCA99X0_BOARD_DATA_SZ,
+   .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
+   },
+   },
+   {
.id = QCA9377_HW_1_0_DEV_VERSION,
.dev_id = QCA9377_1_0_DEVICE_ID,
.name = "qca9377 hw1.0",
@@ -2097,6 +2119,10 @@ struct ath10k *ath10k_core_create(size_t priv_size, 
struct device *dev,
ar->regs = _regs;
ar->hw_values = _values;
break;
+   case ATH10K_HW_QCA9888:
+   ar->regs = _regs;
+   ar->hw_values = _values;
+   break;
case ATH10K_HW_QCA4019:
ar->regs = _regs;
ar->hw_values = _values;
diff --git a/drivers/net/wireless/ath/ath10k/hw.c 
b/drivers/net/wireless/ath/ath10k/hw.c
index 433e064c7718..c2c0122a140b 100644
--- a/drivers/net/wireless/ath/ath10k/hw.c
+++ b/drivers/net/wireless/ath/ath10k/hw.c
@@ -165,6 +165,15 @@ const struct ath10k_hw_values qca99x0_values = {
.ce_desc_meta_data_lsb  = 4,
 };
 
+const struct ath10k_hw_values qca9888_values = {
+   .rtc_state_val_on   = 3,
+   .ce_count   = 12,
+   .msi_assign_ce_max  = 12,
+   .num_target_ce_config_wlan  = 10,
+   .ce_desc_meta_data_mask = 0xFFF0,
+   .ce_desc_meta_data_lsb  = 4,
+};
+
 const struct ath10k_hw_values qca4019_values = {
.ce_count   = 12,
.num_target_ce_config_wlan  = 10,
diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index 549f99bdfb86..d537555b28e7 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -26,6 +26,7 @@
 #define QCA6164_2_1_DEVICE_ID   (0x0041)
 #define QCA6174_2_1_DEVICE_ID   (0x003e)
 #define QCA99X0_2_0_DEVICE_ID   (0x0040)
+#define QCA9888_2_0_DEVICE_ID  (0x0056)
 #define QCA9984_1_0_DEVICE_ID  (0x0046)
 #define QCA9377_1_0_DEVICE_ID   (0x0042)
 
@@ -100,6 +101,14 @@ enum qca9377_chip_id_rev {
 #define QCA9984_HW_1_0_BOARD_DATA_FILE "board.bin"
 #define QCA9984_HW_1_0_PATCH_LOAD_ADDR 0x1234
 
+/* QCA9888 2.0 defines */
+#define QCA9888_HW_2_0_DEV_VERSION 0x100
+#define QCA9888_HW_DEV_TYPE0xc
+#define QCA9888_HW_2_0_CHIP_ID_REV 0x0
+#define QCA9888_HW_2_0_FW_DIR  ATH10K_FW_DIR "/QCA9888/hw2.0"
+#define QCA9888_HW_2_0_BOARD_DATA_FILE "board.bin"
+#define QCA9888_HW_2_0_PATCH_LOAD_ADDR 0x1234
+
 /* QCA9377 1.0 definitions */
 #define QCA9377_HW_1_0_FW_DIR  ATH10K_FW_DIR "/QCA9377/hw1.0"
 #define QCA9377_HW_1_0_BOARD_DATA_FILE "board.bin"
@@ -202,6 +211,7 @@ enum ath10k_hw_rev {
ATH10K_HW_QCA988X,
ATH10K_HW_QCA6174,
ATH10K_HW_QCA99X0,
+   ATH10K_HW_QCA9888,
ATH10K_HW_QCA9984,
ATH10K_HW_QCA9377,
ATH10K_HW_QCA4019,
@@ -250,6 +260,7 @@ struct ath10k_hw_values {
 extern const struct ath10k_hw_values qca988x_values;
 extern const struct ath10k_hw_values qca6174_values;
 extern const struct ath10k_hw_values qca99x0_values;
+extern const struct ath10k_hw_values qca9888_values;
 extern const struct ath10k_hw_values qca4019_values;
 
 void ath10k_hw_fill_survey_time(struct ath10k *ar, struct survey_info *survey,
@@ -258,6 +269,7 @@ void ath10k_hw_fill_survey_time(struct ath10k *ar, struct 
survey_info 

[PATCH 1/2] ath10k: remove unused member in ath10k_hw_regs

2016-06-20 Thread akolli
From: Anilkumar Kolli 

rtc_state_cold_reset_mask is unused in ath10k_hw_regs.
instead fixed delays are used.

Signed-off-by: Anilkumar Kolli 
---
 drivers/net/wireless/ath/ath10k/hw.c |3 ---
 drivers/net/wireless/ath/ath10k/hw.h |2 --
 2 files changed, 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/hw.c 
b/drivers/net/wireless/ath/ath10k/hw.c
index f544d48518c3..433e064c7718 100644
--- a/drivers/net/wireless/ath/ath10k/hw.c
+++ b/drivers/net/wireless/ath/ath10k/hw.c
@@ -19,7 +19,6 @@
 #include "hw.h"
 
 const struct ath10k_hw_regs qca988x_regs = {
-   .rtc_state_cold_reset_mask  = 0x0400,
.rtc_soc_base_address   = 0x4000,
.rtc_wmac_base_address  = 0x5000,
.soc_core_base_address  = 0x9000,
@@ -46,7 +45,6 @@ const struct ath10k_hw_regs qca988x_regs = {
 };
 
 const struct ath10k_hw_regs qca6174_regs = {
-   .rtc_state_cold_reset_mask  = 0x2000,
.rtc_soc_base_address   = 0x0800,
.rtc_wmac_base_address  = 0x1000,
.soc_core_base_address  = 0x0003a000,
@@ -73,7 +71,6 @@ const struct ath10k_hw_regs qca6174_regs = {
 };
 
 const struct ath10k_hw_regs qca99x0_regs = {
-   .rtc_state_cold_reset_mask  = 0x0400,
.rtc_soc_base_address   = 0x0008,
.rtc_wmac_base_address  = 0x,
.soc_core_base_address  = 0x00082000,
diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index f41c91ccb56a..549f99bdfb86 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -208,7 +208,6 @@ enum ath10k_hw_rev {
 };
 
 struct ath10k_hw_regs {
-   u32 rtc_state_cold_reset_mask;
u32 rtc_soc_base_address;
u32 rtc_wmac_base_address;
u32 soc_core_base_address;
@@ -495,7 +494,6 @@ enum ath10k_hw_4addr_pad {
 /* as of IP3.7.1 */
 #define RTC_STATE_V_ON ar->hw_values->rtc_state_val_on
 
-#define RTC_STATE_COLD_RESET_MASK  
ar->regs->rtc_state_cold_reset_mask
 #define RTC_STATE_V_LSB0
 #define RTC_STATE_V_MASK   0x0007
 #define RTC_STATE_ADDRESS  0x
-- 
1.7.9.5

--
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: Bug with: ath10k: enable parsing per station rx duration for 10.4?

2016-06-20 Thread Mohammed Shafi Shajakhan
Hi Ben,

thanks for reporting ...

On Mon, Jun 20, 2016 at 04:06:52PM -0700, Ben Greear wrote:
> I'm working on bringing up my hacked up version of 4.7 ath10k and 10.4 
> firmware, and I think
> I may have found a regression.

[shafi] let me know what is the issue.. some steps to recreate the issue.
> 
> My 10.4.3-ish firmware source has a bunch of:
> 
> if (stats_id == WMI_REQUEST_PEER_STAT)
> logic in it.  In other words, it is not using that id as a bitfield.

[shafi] will check this.

> 
> Now, I can fix the firmware, but I am guessing that at least some stock
> 10.4 firmware has this same issue, and of course any older firmware
> that does not have this change will still be broken.
> 
> So, do you want to back out this patch below, at least the part where it sends
> in 0x9 as the stats_id?

[shafi] request if you can check this please, there was some misunderstanding
in the design when this feature got enabled in 10.4, we fixed it in
https://patchwork.kernel.org/patch/9149357/

> 
> Or, is all available upstream 10.4 firmware OK with this and I should just 
> fix mine?
> 
> Or possibly, this is all my fault and I somehow screwed up when rebasing

[shafi] i will check this and get back to you by end of day.

regards,
shafi
> 
> 
> Author: Mohammed Shafi Shajakhan   2016-03-16 
> 05:43:34
> Committer: Kalle Valo   2016-04-04 07:02:47
> Parent: 47771902a9beb23859805721f1d98d03dee5da7c (ath10k: introduce Extended 
> Resource Config support for 10.4)
> Child:  59465fe46ef1c2caf2c1beca828c4f29d28b98ca (ath10k: speedup htt rx 
> descriptor processing for tx completion)
> Branches: master, master.stgit, remotes/origin/master, 
> remotes/origin/master.stgit
> Follows: v4.5-rc5
> Precedes: v4.7-rc1
> 
> ath10k: enable parsing per station rx duration for 10.4
> 
> Rx duration support for per station is part of extended peer
> stats, enable provision to parse the same and provide backward
> compatibility based on the 'stats_id' event
> 
> Signed-off-by: Mohammed Shafi Shajakhan 
> Signed-off-by: Kalle Valo 
> 
> 
> 
> @@ -1615,7 +1615,8 @@ static int ath10k_core_init_firmware_features(struct 
> ath10k *ar)
>   ar->num_active_peers = TARGET_10_4_ACTIVE_PEERS;
>   ar->max_num_vdevs = TARGET_10_4_NUM_VDEVS;
>   ar->num_tids = TARGET_10_4_TGT_NUM_TIDS;
> - ar->fw_stats_req_mask = WMI_STAT_PEER;
> + ar->fw_stats_req_mask = WMI_10_4_STAT_PEER |
> + WMI_10_4_STAT_PEER_EXTD;
>   ar->max_spatial_stream = ar->hw_params.max_spatial_stream;
> 
>   if (test_bit(ATH10K_FW_FEATURE_PEER_FLOW_CONTROL,
> 
> 
> -- 
> Ben Greear 
> Candela Technologies Inc  http://www.candelatech.com
> 
> 
> ___
> ath10k mailing list
> ath...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k
--
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 10/12] lguest: Only descend into lguest directory when CONFIG_LGUEST is set

2016-06-20 Thread Rusty Russell
"Andrew F. Davis"  writes:
> When CONFIG_LGUEST is not set make will still descend into the lguest
> directory but nothing will be built. This produces unneeded build
> artifacts and messages in addition to slowing the build. Fix this here.
>
> Signed-off-by: Andrew F. Davis 
> ---
>  drivers/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied,

Thanks!
Rusty.

>
> diff --git a/drivers/Makefile b/drivers/Makefile
> index 19305e0..b178e2f 100644
> --- a/drivers/Makefile
> +++ b/drivers/Makefile
> @@ -122,7 +122,7 @@ obj-$(CONFIG_ACCESSIBILITY)   += accessibility/
>  obj-$(CONFIG_ISDN)   += isdn/
>  obj-$(CONFIG_EDAC)   += edac/
>  obj-$(CONFIG_EISA)   += eisa/
> -obj-y+= lguest/
> +obj-$(CONFIG_LGUEST) += lguest/
>  obj-$(CONFIG_CPU_FREQ)   += cpufreq/
>  obj-$(CONFIG_CPU_IDLE)   += cpuidle/
>  obj-y+= mmc/
> -- 
> 2.8.3
--
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 RESEND] qtnfmac: announcement of new FullMAC driver for Quantenna chipsets

2016-06-20 Thread kbuild test robot
Hi,

[auto build test ERROR on wireless-drivers-next/master]
[also build test ERROR on v4.7-rc4 next-20160620]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/igor-mitsyanko-os-quantenna-com/qtnfmac-announcement-of-new-FullMAC-driver-for-Quantenna-chipsets/20160621-061419
base:   
https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git 
master
config: m32r-allyesconfig (attached as .config)
compiler: m32r-linux-gcc (GCC) 4.9.0
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=m32r 

All errors (new ones prefixed by >>):

   In file included from drivers/net/wireless/quantenna/qtnfmac/core.c:23:0:
   drivers/net/wireless/quantenna/qtnfmac/pcie.h: In function 'align_buf_dma':
>> drivers/net/wireless/quantenna/qtnfmac/pcie.h:114:9: error: implicit 
>> declaration of function 'dma_get_cache_alignment' 
>> [-Werror=implicit-function-declaration]
dma_get_cache_alignment());
^
   cc1: some warnings being treated as errors

vim +/dma_get_cache_alignment +114 drivers/net/wireless/quantenna/qtnfmac/pcie.h

   108  }
   109  
   110  static __always_inline void *
   111  align_buf_dma(void *addr)
   112  {
   113  return (void *)align_val_up((unsigned long)addr,
 > 114  dma_get_cache_alignment());
   115  }
   116  
   117  static __always_inline unsigned long

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


[PATCH] ath9k: Support 4.9Ghz channels on AR9580 adapter.

2016-06-20 Thread Julian Calaby
From: Ben Greear 

NOTE:  These channels must not be used in most regulatory
domains unless you have a license from the FCC or similar!

A proper regulatory database is also required to actually use
these channels.

Signed-off-by: Ben Greear 
[Hide this support behind a Kconfig option]
Signed-off-by: Julian Calaby 
---
 drivers/net/wireless/ath/ath9k/Kconfig   | 19 +++
 drivers/net/wireless/ath/ath9k/ath9k.h   |  2 +-
 drivers/net/wireless/ath/ath9k/common-init.c | 49 +++-
 drivers/net/wireless/ath/ath9k/hw.h  |  4 +--
 4 files changed, 63 insertions(+), 11 deletions(-)

Hi Kalle,

I've only done this work as I hate to see people's efforts go to
waste and I feel that there's enough roadblocks in the way of
actually using this functionality that casual idiots won't be able
to.

I've tried to keep the code hidden by the Kconfig option as minimal
as possible, however the #ifdef in ath9k_49ghz_capable() is arguably
not required as returning true from that function still results in no
action if the option is not enabled.

This is compile tested only as I cannot test this for real as I lack
both the hardware and license required.

Thanks,

Julian Calaby


diff --git a/drivers/net/wireless/ath/ath9k/Kconfig 
b/drivers/net/wireless/ath/ath9k/Kconfig
index f68cb00..57b0a41 100644
--- a/drivers/net/wireless/ath/ath9k/Kconfig
+++ b/drivers/net/wireless/ath/ath9k/Kconfig
@@ -114,6 +114,25 @@ config ATH9K_DFS_CERTIFIED
  developed. At this point enabling this option won't do anything
  except increase code size.
 
+config ATH9K_49_GHZ_CHAN
+   bool "Support 4.9Ghz public safety channels on some devices"
+   depends on ATH9K && CFG80211_CERTIFICATION_ONUS
+   default n
+   ---help---
+ This option enables support for 4.9 GHz channels on AR9580.
+
+ These are PUBLIC SAFETY CHANNELS and MUST NOT BE USED in most
+ regulatory domains UNLESS YOU HAVE A FULL LICENSE for their use from
+ your local radio regulator, e.g. the FCC or equivalent. Using these
+ channels without proper authorisation may result in serious legal
+ consequences.
+
+ You will also have to build a regulatory database with these channels
+ enabled to actually use them.
+
+ If you are a distro kernel builder or have any doubt whatsoever about
+ your legal ability to use these channels, say N.
+
 config ATH9K_DYNACK
bool "Atheros ath9k ACK timeout estimation algorithm (EXPERIMENTAL)"
depends on ATH9K
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h 
b/drivers/net/wireless/ath/ath9k/ath9k.h
index 93b3793..d8744b5 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -954,7 +954,7 @@ struct ath_softc {
struct device *dev;
 
struct survey_info *cur_survey;
-   struct survey_info survey[ATH9K_NUM_CHANNELS];
+   struct survey_info survey[ATH9K_MAX_NUM_CHANNELS];
 
struct tasklet_struct intr_tq;
struct tasklet_struct bcon_tasklet;
diff --git a/drivers/net/wireless/ath/ath9k/common-init.c 
b/drivers/net/wireless/ath/ath9k/common-init.c
index 8b4f7fd..f6a495b 100644
--- a/drivers/net/wireless/ath/ath9k/common-init.c
+++ b/drivers/net/wireless/ath/ath9k/common-init.c
@@ -86,6 +86,24 @@ static const struct ieee80211_channel ath9k_5ghz_chantable[] 
= {
CHAN5G(5785, 35), /* Channel 157 */
CHAN5G(5805, 36), /* Channel 161 */
CHAN5G(5825, 37), /* Channel 165 */
+
+#ifdef ATH9K_49_GHZ_CHAN
+   /* 4.9Ghz channels, public safety channels, license is required in US
+* and most other regulatory domains!
+*/
+   CHAN5G(4915, 38), /* Channel 183 */
+   CHAN5G(4920, 39), /* Channel 184 */
+   CHAN5G(4925, 40), /* Channel 185 */
+   CHAN5G(4935, 41), /* Channel 187 */
+   CHAN5G(4940, 42), /* Channel 188 */
+   CHAN5G(4945, 43), /* Channel 189 */
+   CHAN5G(4960, 44), /* Channel 192 */
+   CHAN5G(4970, 45), /* Channel 194 */
+   CHAN5G(4980, 46), /* Channel 196 */
+#define ATH9K_NUM_49GHZ_CHANNELS 9
+#else
+#define ATH9K_NUM_49GHZ_CHANNELS 0
+#endif
 };
 
 /* Atheros hardware rate code addition for short premble */
@@ -122,14 +140,31 @@ static struct ieee80211_rate ath9k_legacy_rates[] = {
 IEEE80211_RATE_SUPPORTS_10MHZ)),
 };
 
+static bool ath9k_49ghz_capable(struct ath_hw *ah)
+{
+#ifdef ATH9K_49_GHZ_CHAN
+   /* Seems AR9580 supports 4.9ghz, at least. */
+   switch (ah->hw_version.devid) {
+   case AR9300_DEVID_AR9580:
+   return true;
+   }
+#endif
+
+   return false;
+}
+
 int ath9k_cmn_init_channels_rates(struct ath_common *common)
 {
struct ath_hw *ah = (struct ath_hw *)common->ah;
void *channels;
+   int num_5ghz_chan = ARRAY_SIZE(ath9k_5ghz_chantable);
+
+   if 

[PATCH] brcmfmac: Add USB ID for Cisco Linksys AE1200

2016-06-20 Thread Ismael Luceno
Signed-off-by: Ismael Luceno 
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c| 4 
 drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c 
b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
index 98b15a9..455fc69 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
@@ -1462,11 +1462,15 @@ static int brcmf_usb_reset_resume(struct usb_interface 
*intf)
 #define BRCMF_USB_DEVICE(dev_id)   \
{ USB_DEVICE(BRCM_USB_VENDOR_ID_BROADCOM, dev_id) }
 
+#define LINKSYS_USB_DEVICE(dev_id) \
+   { USB_DEVICE(BRCM_USB_VENDOR_ID_LINKSYS, dev_id) }
+
 static struct usb_device_id brcmf_usb_devid_table[] = {
BRCMF_USB_DEVICE(BRCM_USB_43143_DEVICE_ID),
BRCMF_USB_DEVICE(BRCM_USB_43236_DEVICE_ID),
BRCMF_USB_DEVICE(BRCM_USB_43242_DEVICE_ID),
BRCMF_USB_DEVICE(BRCM_USB_43569_DEVICE_ID),
+   LINKSYS_USB_DEVICE(BRCM_USB_43235_LINKSYS_DEVICE_ID),
{ USB_DEVICE(BRCM_USB_VENDOR_ID_LG, BRCM_USB_43242_LG_DEVICE_ID) },
/* special entry for device with firmware loaded and running */
BRCMF_USB_DEVICE(BRCM_USB_BCMFW_DEVICE_ID),
diff --git a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h 
b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
index 699f2c2..513 100644
--- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
+++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
@@ -22,6 +22,7 @@
 
 #define BRCM_USB_VENDOR_ID_BROADCOM0x0a5c
 #define BRCM_USB_VENDOR_ID_LG  0x043e
+#define BRCM_USB_VENDOR_ID_LINKSYS 0x13b1
 #define BRCM_PCIE_VENDOR_ID_BROADCOM   PCI_VENDOR_ID_BROADCOM
 
 /* Chipcommon Core Chip IDs */
@@ -56,6 +57,8 @@
 
 /* USB Device IDs */
 #define BRCM_USB_43143_DEVICE_ID   0xbd1e
+#define BRCM_USB_43235_LINKSYS_DEVICE_ID \
+   0x0039
 #define BRCM_USB_43236_DEVICE_ID   0xbd17
 #define BRCM_USB_43242_DEVICE_ID   0xbd1f
 #define BRCM_USB_43242_LG_DEVICE_ID0x3101
-- 
2.9.0

--
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: Troubleshooting mwl8k driver issue

2016-06-20 Thread David Gilman
On Sat, Jun 18, 2016 at 11:48:28AM +0300, Lennert Buytenhek wrote:
> Nothing in here seems particularly bad.  So whatever the problem is,
> I don't think it can be diagnosed from these messages alone.
> 
> I went back to the email thread, and it seems that the problem is that
> you're trying to run the card in AP mode but no traffic is making it
> through?  Is AP association working at all, or is that failing too?

The mwl8k is in AP mode and it gets associated just fine.  It'll work
for five or so minutes and then you'll get the disconnect and the log
messages in the earlier emails.  And it only happens with one of my
wireless devices - the other one will browse all day with a stable
connection to the mwl8k router.

Back in the OpenWRT issue a few more people have stuck their heads in
to say they're also seeing the same issue.

https://dev.openwrt.org/ticket/21284

-- 
David Gilman  :DG<
http://gilslotd.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


Re: [PATCH 0/3] *** Mesh Path Selection Metric Calculation ***

2016-06-20 Thread Peter Oh
where is 2/3 ?
On 06/20/2016 06:00 AM, Maxim Altshul wrote:
> Hi All,
> This patch series focuses on metric calculation that
> occurs during the path selection phase of a mesh network.
>
> During the path selection phase, the mesh hwmp module
> performs metric calculations, that take as parameters
> the last TX rate that was used for a specific link,
> and the packet error rate.
>
> These parameters should be reported by the FW to the driver
> constantly for the mechanism to work properly.
>
> In case that a vendor offloads the rate control mechanism
> to the FW, these parameters will be rarely updated,
> or updated incorrectly.
>
> This situation causes the mesh hwmp module to calculate incorrect
> metrics and as a consequence, not to choose the best paths possible.
>
>
> This patch series is divided to three patches and does the following:
>
> 1. Modifies mesh hwmp module and allows vendors that offload the
> rate control mechanism to their FW, to report last TX rates and PER
> to the mesh hwmp module by using an existing op called
> get_expected_throughput.
> In case that a vendor does not implement the op, all previous
> functionality still applies.
>
> 2. Implements the opcode and the mechanism that reports the rates
> in TI driver.
>
> Maxim Altshul (3):
>   wlcore/wl18xx: Add functionality to accept TX rate per link
>   wlcore: Add support for get_expected_throughput opcode
>   mac80211: mesh: Add support for HW RC implementation
>
>  drivers/net/wireless/ti/wl18xx/main.c |  4 
>  drivers/net/wireless/ti/wl18xx/tx.c   | 22 ++
>  drivers/net/wireless/ti/wl18xx/wl18xx.h   |  6 +-
>  drivers/net/wireless/ti/wlcore/main.c | 16 
>  drivers/net/wireless/ti/wlcore/rx.c   |  7 +++
>  drivers/net/wireless/ti/wlcore/wlcore_i.h | 13 +
>  net/mac80211/mesh_hwmp.c  | 23 +++
>  7 files changed, 78 insertions(+), 13 deletions(-)
>

--
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: Support 4.9Ghz channels on AR9580 adapter.

2016-06-20 Thread Ben Greear

On 06/20/2016 04:53 PM, Julian Calaby wrote:

Hi Ben,

On Tue, Jun 21, 2016 at 6:41 AM, Ben Greear  wrote:

On 06/20/2016 01:34 PM, Kalle Valo wrote:


Ben Greear  wrote:


From: Ben Greear 

NOTE:  These channels must not be used in most regulatory
domains unless you have a license from the FCC or similar!

A proper regulatory database is also required to actually use
these channels.

Signed-off-by: Ben Greear 



I feel that the license is a problem and this doesn't belong to the
kernel.
The patch has been dropped.



It's not a lot different from having to be in normal FCC regulations
w/regard to
DFS channels, tx power, and such, but maybe having driver support is
considered to make it
too easy for users to hack around restrictions?


Maybe hide this behind CFG80211_CERTIFICATION_ONUS or equivalent?
(Maybe a new symbol CFG80211_LICENSE_REQUIRED with big scary
feds-will-come-knocking warnings in the help text?)


That would be fine with me.  As I said though, there are more patches
than this one needed for full features and interoperability.
The person that sent me the mac80211/wireless patches,
and hostapd for that matter, may be able to put something together for upstream,
but I am not sure if they will have time.

I don't currently feel motivated enough to try to clean it all up and
try to push it upstream myself.

Thanks,
Ben

--
Ben Greear 
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


Re: ath9k: Support 4.9Ghz channels on AR9580 adapter.

2016-06-20 Thread Julian Calaby
Hi Ben,

On Tue, Jun 21, 2016 at 6:41 AM, Ben Greear  wrote:
> On 06/20/2016 01:34 PM, Kalle Valo wrote:
>>
>> Ben Greear  wrote:
>>>
>>> From: Ben Greear 
>>>
>>> NOTE:  These channels must not be used in most regulatory
>>> domains unless you have a license from the FCC or similar!
>>>
>>> A proper regulatory database is also required to actually use
>>> these channels.
>>>
>>> Signed-off-by: Ben Greear 
>>
>>
>> I feel that the license is a problem and this doesn't belong to the
>> kernel.
>> The patch has been dropped.
>
>
> It's not a lot different from having to be in normal FCC regulations
> w/regard to
> DFS channels, tx power, and such, but maybe having driver support is
> considered to make it
> too easy for users to hack around restrictions?

Maybe hide this behind CFG80211_CERTIFICATION_ONUS or equivalent?
(Maybe a new symbol CFG80211_LICENSE_REQUIRED with big scary
feds-will-come-knocking warnings in the help text?)

Thanks,

-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
--
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


Bug with: ath10k: enable parsing per station rx duration for 10.4?

2016-06-20 Thread Ben Greear

I'm working on bringing up my hacked up version of 4.7 ath10k and 10.4 
firmware, and I think
I may have found a regression.

My 10.4.3-ish firmware source has a bunch of:

if (stats_id == WMI_REQUEST_PEER_STAT)
logic in it.  In other words, it is not using that id as a bitfield.

Now, I can fix the firmware, but I am guessing that at least some stock
10.4 firmware has this same issue, and of course any older firmware
that does not have this change will still be broken.

So, do you want to back out this patch below, at least the part where it sends
in 0x9 as the stats_id?

Or, is all available upstream 10.4 firmware OK with this and I should just fix 
mine?

Or possibly, this is all my fault and I somehow screwed up when rebasing

Thanks,
Ben


Author: Mohammed Shafi Shajakhan   2016-03-16 
05:43:34
Committer: Kalle Valo   2016-04-04 07:02:47
Parent: 47771902a9beb23859805721f1d98d03dee5da7c (ath10k: introduce Extended 
Resource Config support for 10.4)
Child:  59465fe46ef1c2caf2c1beca828c4f29d28b98ca (ath10k: speedup htt rx 
descriptor processing for tx completion)
Branches: master, master.stgit, remotes/origin/master, 
remotes/origin/master.stgit
Follows: v4.5-rc5
Precedes: v4.7-rc1

ath10k: enable parsing per station rx duration for 10.4

Rx duration support for per station is part of extended peer
stats, enable provision to parse the same and provide backward
compatibility based on the 'stats_id' event

Signed-off-by: Mohammed Shafi Shajakhan 
Signed-off-by: Kalle Valo 



@@ -1615,7 +1615,8 @@ static int ath10k_core_init_firmware_features(struct 
ath10k *ar)
ar->num_active_peers = TARGET_10_4_ACTIVE_PEERS;
ar->max_num_vdevs = TARGET_10_4_NUM_VDEVS;
ar->num_tids = TARGET_10_4_TGT_NUM_TIDS;
-   ar->fw_stats_req_mask = WMI_STAT_PEER;
+   ar->fw_stats_req_mask = WMI_10_4_STAT_PEER |
+   WMI_10_4_STAT_PEER_EXTD;
ar->max_spatial_stream = ar->hw_params.max_spatial_stream;

if (test_bit(ATH10K_FW_FEATURE_PEER_FLOW_CONTROL,


--
Ben Greear 
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] leds: Add no-op gpio_led_register_device when LED subsystem is disabled

2016-06-20 Thread Andrew F. Davis
Some systems use 'gpio_led_register_device' to make an in-memory copy of
their LED device table so the original can be removed as .init.rodata.
When the LED subsystem is not enabled source in the led directory is not
built and so this function may be undefined. Fix this here.

Signed-off-by: Andrew F. Davis 
---
 include/linux/leds.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/include/linux/leds.h b/include/linux/leds.h
index d2b1306..a4a3da6 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -386,8 +386,16 @@ struct gpio_led_platform_data {
unsigned long *delay_off);
 };

+#ifdef CONFIG_NEW_LEDS
 struct platform_device *gpio_led_register_device(
int id, const struct gpio_led_platform_data *pdata);
+#else
+static inline struct platform_device *gpio_led_register_device(
+   int id, const struct gpio_led_platform_data *pdata)
+{
+   return 0;
+}
+#endif

 enum cpu_led_event {
CPU_LED_IDLE_START, /* CPU enters idle */
-- 
2.9.0
--
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] qtnfmac: announcement of new FullMAC driver for Quantenna chipsets

2016-06-20 Thread Igor Mitsyanko

Sent to incorrect recipient email, please ignore, will resend.

On 06/21/2016 12:18 AM, igor.mitsyanko...@quantenna.com wrote:

From: Avinash Patil 

This patch adds support for new FullMAC WiFi driver for Quantenna
QSR10G chipsets.

QSR10G is Quantenna's 8x8, 160M, 11ac offering.
QSR10G supports 2 simultaneous WMACs- one 5G and one 2G. 5G WMAC
supports 160M, 8x8 configuration.
FW supports 8 concurrent virtual interfaces on each WMAC.

Patch introduces 2 new drivers- qtnfmac.ko for interfacing with
kernel/cfg80211 and qtnfmac_pcie.ko for PCIe bus interface.

Signed-off-by: Dmitrii Lebed 
Signed-off-by: Sergei Maksimenko 
Signed-off-by: Sergey Matyukevich 
Signed-off-by: Bindu Therthala 
Signed-off-by: Huizhao Wang 
Signed-off-by: Kamlesh Rath 
Signed-off-by: Avinash Patil 
Signed-off-by: Igor Mitsyanko 
---
Changelist V1->V2:
1. Get rid of confidentiality footer.
2. Rewrite qlink.h header to make it easier to use, add
documentation to most of qlink.h definitions.



--
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] qtnfmac: announcement of new FullMAC driver for Quantenna chipsets

2016-06-20 Thread Igor Mitsyanko

On 06/08/2016 04:25 PM, Kalle Valo wrote:

Igor Mitsyanko  writes:


On 05/29/2016 02:35 PM, Jonas Gorski wrote:

Hi,

On 26 May 2016 at 20:52, Avinash Patil  wrote:

This patch adds support for new FullMAC WiFi driver for Quantenna
QSR10G chipsets.

QSR10G is Quantenna's 8x8, 160M, 11ac offering.
QSR10G supports 2 simultaneous WMACs- one 5G and one 2G. 5G WMAC
supports 160M, 8x8 configuration.
FW supports 8 concurrent virtual interfaces on each WMAC.

Patch introduces 2 new drivers- qtnfmac.ko for interfacing with
kernel/cfg80211 and qtnfmac_pcie.ko for PCIe bus interface.

Nice to see this one, will you also provide a pearl-linux.lzma.img as
required for the firmware? What about cards in embedded devices, might
they require a uboot as well? Since requesting uboot seems to be
specifically supported by the card/firmware interface.

Hi Jonas,
we will provide firmware, but we're not sure at which point it should
be done: addressing any review comments for driver may affect firmware
itself, probably the best time to provide firmware would be after new
driver is accepted and merged?

I would prefer to see the firmware images publically available before
the driver gets applied. What if you send the firmware patches as RFC
only to linux-wireless? That way linux-firmware.git maintainers won't
apply them, hopefully. And mention in the commit log that this is just
for testing purposes, not to be applied.



Kalle, sure, we will send firmware binary as an RFC to linux-wireless 
while patch itself is in review.



--
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 01/21] ath10k: Fix crash related to printing features.

2016-06-20 Thread Valo, Kalle
Ben Greear  writes:

> On 05/11/2016 10:02 AM, gree...@candelatech.com wrote:
>> From: Ben Greear 
>>
>> This looks like a regression from
>> c4cdf753 (move fw_features to struct ath10k_fw_file)
>
> Just FYI, this patch does not appear to be in 4.7-rc4 as of today, and
> so kernel crashes on startup when loading ath10k, at least when
> DBG_BOOT logging is enabled

The fix is wireless-drivers.git now, I'm planning to send a pull request
to Dave tomorrow.

-- 
Kalle Valo--
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


WARNING at include/net/fq_impl.h:22 fq_flow_dequeue+0xed/0x140 [mac80211]

2016-06-20 Thread Valo, Kalle
Hi,

I updated to latest wireless-testing (wt-2016-06-20) and noticed that my
syslog has thousands of warnings like this:

[  237.335805] [ cut here ]
[  237.335852] WARNING: CPU: 3 PID: 1921 at include/net/fq_impl.h:22 
fq_flow_dequeue+0xed/0x140 [mac80211]
[  237.335855] Modules linked in: ath10k_pci(E-) ath10k_core(E) ath(E) 
mac80211(E) cfg80211(E) arc4 snd_hda_codec_hdmi snd_hda_codec_idt 
snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core coretemp 
snd_hwdep snd_pcm joydev input_leds serio_raw snd_seq_midi btusb btintel snd_r
[  237.335913] CPU: 3 PID: 1921 Comm: rmmod Tainted: GW   E   
4.7.0-rc4-wt-ath+ #1377
[  237.335916] Hardware name: Hewlett-Packard HP ProBook 6540b/1722, BIOS 68CDD 
Ver. F.04 01/27/2010
[  237.335918]  00200286 00200286 eff85dac c14151e2 f901574e  eff85de0 
c1081075
[  237.335928]  c1ab91f0 0003 0781 f901574e 0016 f8fbabad f8fbabad 
0016
[  237.335938]  eb24ff60  ef3886c0 eff85df4 c10810ba 0009  

[  237.335948] Call Trace:
[  237.335953]  [] dump_stack+0x76/0xb4
[  237.335957]  [] __warn+0xe5/0x100
[  237.336002]  [] ? fq_flow_dequeue+0xed/0x140 [mac80211]
[  237.336046]  [] ? fq_flow_dequeue+0xed/0x140 [mac80211]
[  237.336053]  [] warn_slowpath_null+0x2a/0x30
[  237.336095]  [] fq_flow_dequeue+0xed/0x140 [mac80211]
[  237.336137]  [] fq_flow_reset.constprop.56+0x2a/0x90 [mac80211]
[  237.336180]  [] fq_reset.constprop.59+0x2a/0x50 [mac80211]
[  237.336222]  [] ieee80211_txq_teardown_flows+0x38/0x40 [mac80211]
[  237.336258]  [] ieee80211_unregister_hw+0xe4/0x120 [mac80211]
[  237.336275]  [] ath10k_mac_unregister+0x16/0x50 [ath10k_core]
[  237.336292]  [] ath10k_core_unregister+0x3d/0x90 [ath10k_core]
[  237.336301]  [] ath10k_pci_remove+0x36/0xa0 [ath10k_pci]
[  237.336307]  [] pci_device_remove+0x38/0xb0
[  237.336314]  [] __device_release_driver+0x7b/0x110
[  237.336321]  [] driver_detach+0x97/0xa0
[  237.336327]  [] bus_remove_driver+0x4f/0xc0
[  237.336333]  [] driver_unregister+0x2a/0x60
[  237.336339]  [] pci_unregister_driver+0x18/0x70
[  237.336347]  [] ath10k_pci_exit+0xd/0x37f [ath10k_pci]
[  237.336354]  [] SyS_delete_module+0xf8/0x170
[  237.336361]  [] ? __might_fault+0x49/0xa0
[  237.336367]  [] ? __might_fault+0x93/0xa0
[  237.336373]  [] do_fast_syscall_32+0xa6/0x1d0
[  237.336379]  [] sysenter_past_esp+0x45/0x74
[  237.336384] ---[ end trace 6fc65ff0beec502c ]---
[  237.336388] [ cut here ]
[  237.336431] WARNING: CPU: 3 PID: 1921 at include/net/fq_impl.h:22 
fq_flow_dequeue+0xed/0x140 [mac80211]
[  237.336435] Modules linked in: ath10k_pci(E-) ath10k_core(E) ath(E) 
mac80211(E) cfg80211(E) arc4 snd_hda_codec_hdmi snd_hda_codec_idt 
snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core coretemp 
snd_hwdep snd_pcm joydev input_leds serio_raw snd_seq_midi btusb btintel snd_r
[  237.336537] CPU: 3 PID: 1921 Comm: rmmod Tainted: GW   E   
4.7.0-rc4-wt-ath+ #1377
[  237.336542] Hardware name: Hewlett-Packard HP ProBook 6540b/1722, BIOS 68CDD 
Ver. F.04 01/27/2010
[  237.336546]  00200286 00200286 eff85dac c14151e2 f901574e  eff85de0 
c1081075
[  237.336563]  c1ab91f0 0003 0781 f901574e 0016 f8fbabad f8fbabad 
0016
[  237.336573]  eb24ffb0  ef3886c0 eff85df4 c10810ba 0009  

[  237.336581] Call Trace:
[  237.336586]  [] dump_stack+0x76/0xb4
[  237.336590]  [] __warn+0xe5/0x100
[  237.336634]  [] ? fq_flow_dequeue+0xed/0x140 [mac80211]
[  237.336678]  [] ? fq_flow_dequeue+0xed/0x140 [mac80211]
[  237.336682]  [] warn_slowpath_null+0x2a/0x30
[  237.336726]  [] fq_flow_dequeue+0xed/0x140 [mac80211]
[  237.336770]  [] fq_flow_reset.constprop.56+0x2a/0x90 [mac80211]
[  237.336814]  [] fq_reset.constprop.59+0x2a/0x50 [mac80211]
[  237.336857]  [] ieee80211_txq_teardown_flows+0x38/0x40 [mac80211]
[  237.336895]  [] ieee80211_unregister_hw+0xe4/0x120 [mac80211]
[  237.336912]  [] ath10k_mac_unregister+0x16/0x50 [ath10k_core]
[  237.336928]  [] ath10k_core_unregister+0x3d/0x90 [ath10k_core]
[  237.336934]  [] ath10k_pci_remove+0x36/0xa0 [ath10k_pci]
[  237.336939]  [] pci_device_remove+0x38/0xb0
[  237.336944]  [] __device_release_driver+0x7b/0x110
[  237.336948]  [] driver_detach+0x97/0xa0
[  237.336952]  [] bus_remove_driver+0x4f/0xc0
[  237.336957]  [] driver_unregister+0x2a/0x60
[  237.336960]  [] pci_unregister_driver+0x18/0x70
[  237.336966]  [] ath10k_pci_exit+0xd/0x37f [ath10k_pci]
[  237.336970]  [] SyS_delete_module+0xf8/0x170
[  237.336974]  [] ? __might_fault+0x49/0xa0
[  237.336980]  [] ? __might_fault+0x93/0xa0
[  237.336986]  [] do_fast_syscall_32+0xa6/0x1d0
[  237.336992]  [] sysenter_past_esp+0x45/0x74
[  237.336997] ---[ end trace 6fc65ff0beec502d ]---

-- 
Kalle Valo--
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


Stand-alone ath10k-ct driver.

2016-06-20 Thread Ben Greear

Hello!

I have made an attempt to provide a stand-alone ath10k driver that should 
compile
and work against stock 4.7 kernels.  This should provide better support for CT 
ath10k
firmware without having to apply large numbers of patches.  My 4.7 kernel has 
only been very lightly tested
to date, and the stand-alone driver is only compile tested.  I will update the
ath-ct repo often as testing progresses on 4.7.

If there are brave souls that want to try it out, I'd appreciate any feedback.

https://github.com/greearb/ath-ct

See the README.txt for some details.  This will require at least some 
familiarity
with building kernels since I do not have any nice automation to compile against
the current running kernel yet, for instance.

Thanks,
Ben

--
Ben Greear 
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


Re: [PATCH] mac80211: Encrypt "Group addressed privacy" action frames

2016-06-20 Thread Jouni Malinen
On Mon, Jun 20, 2016 at 09:51:28AM +0900, Masashi Honma wrote:
> On 2016年06月18日 18:11, Jouni Malinen wrote:
> Yes. This patch breaks backward compatibility.
> I do not have smart idea to avoid also.
> I will create new define like this.
> CONFIG_MAC80211_MESH_GROUP_ADDRESSED_PRIVACY

Do we really want that? Group addressed privacy is what the standard
requires to be used with mesh and if we make it build time configurable,
we'll just end up with two different implementation that will never
interoperate with each other.. I don't really see any better option for
this apart from fixing this and requiring all STAs in a secure mesh to
be updated in synchronized manner. This way it will be a one time issue,
but that won't be there forever.

If something is needed to for temporary backwards compatibility support,
that should be something that can be enabled at runtime (and be disabled
by default). That said, I'm not sure I'd go with that extra complexity
taken into account how badly (i.e., completely incorrectly) the PMF case
was implemented in wpa_supplicant. I'm not planning on adding any
backwards compatibility mode there for due to the previous behavior not
really being good from security view point either (using the same key
with two different algorithms).
 
-- 
Jouni MalinenPGP id EFC895FA
--
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 01/21] ath10k: Fix crash related to printing features.

2016-06-20 Thread Ben Greear

On 05/11/2016 10:02 AM, gree...@candelatech.com wrote:

From: Ben Greear 

This looks like a regression from
c4cdf753 (move fw_features to struct ath10k_fw_file)


Just FYI, this patch does not appear to be in 4.7-rc4 as of today, and so 
kernel crashes on
startup when loading ath10k, at least when DBG_BOOT logging is enabled

Thanks,
Ben



Signed-off-by:  Ben Greear 
---
  drivers/net/wireless/ath/ath10k/core.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index e94cb87..b7318b8 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1078,7 +1078,7 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, 
const char *name,
}

ath10k_dbg_dump(ar, ATH10K_DBG_BOOT, "features", "",
-   ar->running_fw->fw_file.fw_features,
+   fw_file->fw_features,
sizeof(fw_file->fw_features));
break;
case ATH10K_FW_IE_FW_IMAGE:




--
Ben Greear 
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


Re: ath9k: Support 4.9Ghz channels on AR9580 adapter.

2016-06-20 Thread Ben Greear

On 06/20/2016 01:34 PM, Kalle Valo wrote:

Ben Greear  wrote:

From: Ben Greear 

NOTE:  These channels must not be used in most regulatory
domains unless you have a license from the FCC or similar!

A proper regulatory database is also required to actually use
these channels.

Signed-off-by: Ben Greear 


I feel that the license is a problem and this doesn't belong to the kernel.
The patch has been dropped.


It's not a lot different from having to be in normal FCC regulations w/regard to
DFS channels, tx power, and such, but maybe having driver support is considered 
to make it
too easy for users to hack around restrictions?

Another part of this is that Cisco APs, at least, use fractional center
frequencies (4942.5, for instance) when using 5Mhz bandwidths on 4.9Ghz
channels, and that requires more patches that I don't think I even bothered
to post.

I'll keep this in my trees, someone needing it can just clone it and/or borrow
patches as needed.

Thanks,
Ben

--
Ben Greear 
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


Re: ath9k: Support 4.9Ghz channels on AR9580 adapter.

2016-06-20 Thread Kalle Valo
Ben Greear  wrote:
> From: Ben Greear 
> 
> NOTE:  These channels must not be used in most regulatory
> domains unless you have a license from the FCC or similar!
> 
> A proper regulatory database is also required to actually use
> these channels.
> 
> Signed-off-by: Ben Greear 

I feel that the license is a problem and this doesn't belong to the kernel.
The patch has been dropped.

-- 
Sent by pwcli
https://patchwork.kernel.org/patch/9086491/

--
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: [1/1] ath6kl: Fix SDIO broken scatter hif-scatter

2016-06-20 Thread Kalle Valo
Robert Deliën wrote:

> This patch fixes broken hif-scatter in ath6kl SDIO. It is not my work; I have
> found it as a difference between two Digi distributed Kernel source trees. No
> commit comment was recorded. I am sure there are better/nicer/cleaner way,
> but copying it as I found it is yet another difference less in the future.
> Feel free to use it in any way you see fit.

Robert told me privately that this is fixed in latest versions. The patch has
been dropped.

-- 
Sent by pwcli
https://patchwork.kernel.org/patch/7567481/

--
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


STBC and LDPC for VHT

2016-06-20 Thread Krishna Chaitanya
Hi,

What is the background for disabling STBC and LDPC for
VHT rates? The below comment is cryptic :-).

/* TODO tx_flags for vht - ATM the RC API is not fine-grained enough */

Can we just enable these now?
--
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: Linux-firmware: pull-request TI wireless firmware update

2016-06-20 Thread Kyle McMartin
On Thu, Jun 16, 2016 at 12:14:34PM +, Machani, Yaniv wrote:
> Hi,
> 
> Please see below pull request,
> 
> It contains an update to the WiLink8 chip.
> 

Pulled, thanks Yaniv.

--Kyle

> Thanks,
> Yaniv
> 
> 
> The following changes since commit a4bbc8112cc04fcc0e0861e8b72197b6cb83ab83:
> 
>   linux-firmware: Update firmware file for Intel Bluetooth 8260 (2016-06-09 
> 08:11:22 -0400)
> 
> are available in the git repository at:
> 
>   git://git.ti.com/wilink8-wlan/linux-firmware.git master
> 
> for you to fetch changes up to dbb85a5154a5da7fa94bf9caa3658d4b6999cee6:
> 
>   wl18xx: update firmware file (2016-06-16 14:59:20 +0300)
> 
> 
> Yaniv Machani (1):
>   wl18xx: update firmware file
> 
> WHENCE  |   2 +-
> ti-connectivity/wl18xx-fw-4.bin | Bin 738540 -> 745228 bytes
> 2 files changed, 1 insertion(+), 1 deletion(-)
--
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/3] wlcore: Add support for get_expected_throughput opcode

2016-06-20 Thread Maxim Altshul
Adding this opcode, allows the TI wireless driver,
to report throughput directly from FW to mac80211.

This is used mainly for mesh metric calculation.

Signed-off-by: Maxim Altshul 
---
 drivers/net/wireless/ti/wlcore/main.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/wireless/ti/wlcore/main.c 
b/drivers/net/wireless/ti/wlcore/main.c
index 39dec7d..cf4c6af 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -5851,6 +5851,20 @@ out:
mutex_unlock(>mutex);
 }
 
+static u32 wlcore_op_get_expected_throughput(struct ieee80211_sta *sta)
+{
+   struct wl1271_station *wl_sta = (struct wl1271_station *)sta->drv_priv;
+   struct wl1271 *wl = wl_sta->wl;
+   u8 hlid = wl_sta->hlid;
+   u32 ret = 0;
+
+   /* return in units of 100kbps */
+   if (wl)
+   ret = (wl->links[hlid].fw_rate_mbps * 10);
+
+   return ret;
+}
+
 static bool wl1271_tx_frames_pending(struct ieee80211_hw *hw)
 {
struct wl1271 *wl = hw->priv;
@@ -6051,6 +6065,7 @@ static const struct ieee80211_ops wl1271_ops = {
.switch_vif_chanctx = wlcore_op_switch_vif_chanctx,
.sta_rc_update = wlcore_op_sta_rc_update,
.sta_statistics = wlcore_op_sta_statistics,
+   .get_expected_throughput = wlcore_op_get_expected_throughput,
CFG80211_TESTMODE_CMD(wl1271_tm_cmd)
 };
 
-- 
2.7.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 3/3] mac80211: mesh: Add support for HW RC implementation

2016-06-20 Thread Maxim Altshul
Mesh HWMP module will be able to rely on the HW
RC algorithm if it exists, for path metric calculations.

This allows the metric calculation mechanism to calculate
a correct metric, based on PER and last TX rate both via
HW RC algorithm if it exists or via parameters collected
by the SW.

Signed-off-by: Maxim Altshul 
---
 net/mac80211/mesh_hwmp.c | 23 +++
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index c6be0b4..e3ce40d 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -12,6 +12,7 @@
 #include 
 #include "wme.h"
 #include "mesh.h"
+#include "driver-ops.h"
 
 #define TEST_FRAME_LEN 8192
 #define MAX_METRIC 0x
@@ -322,19 +323,25 @@ static u32 airtime_link_metric_get(struct ieee80211_local 
*local,
int device_constant = 1 << ARITH_SHIFT;
int test_frame_len = TEST_FRAME_LEN << ARITH_SHIFT;
int s_unit = 1 << ARITH_SHIFT;
-   int rate, err;
+   int rate, err = 0;
u32 tx_time, estimated_retx;
u64 result;
 
-   if (sta->mesh->fail_avg >= 100)
-   return MAX_METRIC;
+   /* try to get rate based on HW RC algorithm */
+   rate = drv_get_expected_throughput(local, >sta);
 
-   sta_set_rate_info_tx(sta, >tx_stats.last_rate, );
-   rate = cfg80211_calculate_bitrate();
-   if (WARN_ON(!rate))
-   return MAX_METRIC;
+   /* if HW does not provide us with a rate */
+   if (!rate) {
+   if (sta->mesh->fail_avg >= 100)
+   return MAX_METRIC;
 
-   err = (sta->mesh->fail_avg << ARITH_SHIFT) / 100;
+   sta_set_rate_info_tx(sta, >tx_stats.last_rate, );
+   rate = cfg80211_calculate_bitrate();
+   if (WARN_ON(!rate))
+   return MAX_METRIC;
+
+   err = (sta->mesh->fail_avg << ARITH_SHIFT) / 100;
+   }
 
/* bitrate is in units of 100 Kbps, while we need rate in units of
 * 1Mbps. This will be corrected on tx_time computation.
-- 
2.7.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/3] wlcore/wl18xx: Add functionality to accept TX rate per link

2016-06-20 Thread Maxim Altshul
FW will provide a TX rate per link for each FW status,
and wlcore will be able to store the information for
the use of the mesh hwmp module.

This is used mainly in mesh.
Rates are reported when a mesh interface is up.

Signed-off-by: Maxim Altshul 
---
 drivers/net/wireless/ti/wl18xx/main.c |  4 
 drivers/net/wireless/ti/wl18xx/tx.c   | 22 ++
 drivers/net/wireless/ti/wl18xx/wl18xx.h   |  6 +-
 drivers/net/wireless/ti/wlcore/main.c |  1 +
 drivers/net/wireless/ti/wlcore/rx.c   |  7 +++
 drivers/net/wireless/ti/wlcore/wlcore_i.h | 13 +
 6 files changed, 48 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ti/wl18xx/main.c 
b/drivers/net/wireless/ti/wl18xx/main.c
index 6e89e13..a7913ec 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -1214,6 +1214,10 @@ static void wl18xx_convert_fw_status(struct wl1271 *wl, 
void *raw_fw_status,
int_fw_status->counters.tx_voice_released_blks;
fw_status->counters.tx_last_rate =
int_fw_status->counters.tx_last_rate;
+   fw_status->counters.tx_last_rate_mbps =
+   int_fw_status->counters.tx_last_rate_mbps;
+   fw_status->counters.hlid =
+   int_fw_status->counters.hlid;
 
fw_status->log_start_addr = le32_to_cpu(int_fw_status->log_start_addr);
 
diff --git a/drivers/net/wireless/ti/wl18xx/tx.c 
b/drivers/net/wireless/ti/wl18xx/tx.c
index 3406ffb..d198827 100644
--- a/drivers/net/wireless/ti/wl18xx/tx.c
+++ b/drivers/net/wireless/ti/wl18xx/tx.c
@@ -30,9 +30,9 @@
 
 static
 void wl18xx_get_last_tx_rate(struct wl1271 *wl, struct ieee80211_vif *vif,
-u8 band, struct ieee80211_tx_rate *rate)
+u8 band, struct ieee80211_tx_rate *rate, u8 hlid)
 {
-   u8 fw_rate = wl->fw_status->counters.tx_last_rate;
+   u8 fw_rate = wl->links[hlid].fw_rate_idx;
 
if (fw_rate > CONF_HW_RATE_INDEX_MAX) {
wl1271_error("last Tx rate invalid: %d", fw_rate);
@@ -79,6 +79,7 @@ static void wl18xx_tx_complete_packet(struct wl1271 *wl, u8 
tx_stat_byte)
struct sk_buff *skb;
int id = tx_stat_byte & WL18XX_TX_STATUS_DESC_ID_MASK;
bool tx_success;
+   struct wl1271_tx_hw_descr *tx_desc;
 
/* check for id legality */
if (unlikely(id >= wl->num_tx_desc || wl->tx_frames[id] == NULL)) {
@@ -91,6 +92,7 @@ static void wl18xx_tx_complete_packet(struct wl1271 *wl, u8 
tx_stat_byte)
 
skb = wl->tx_frames[id];
info = IEEE80211_SKB_CB(skb);
+   tx_desc = (struct wl1271_tx_hw_descr *)skb->data;
 
if (wl12xx_is_dummy_packet(wl, skb)) {
wl1271_free_tx_id(wl, id);
@@ -105,7 +107,9 @@ static void wl18xx_tx_complete_packet(struct wl1271 *wl, u8 
tx_stat_byte)
 * the info->status structures
 */
wl18xx_get_last_tx_rate(wl, info->control.vif,
-   info->band, >status.rates[0]);
+   info->band,
+   >status.rates[0],
+   tx_desc->hlid);
 
info->status.rates[0].count = 1; /* no data about retries */
info->status.ack_signal = -1;
@@ -144,12 +148,22 @@ void wl18xx_tx_immediate_complete(struct wl1271 *wl)
struct wl18xx_fw_status_priv *status_priv =
(struct wl18xx_fw_status_priv *)wl->fw_status->priv;
struct wl18xx_priv *priv = wl->priv;
-   u8 i;
+   u8 i, hlid;
 
/* nothing to do here */
if (priv->last_fw_rls_idx == status_priv->fw_release_idx)
return;
 
+   /* update rates per link */
+   hlid = wl->fw_status->counters.hlid;
+
+   if (hlid < WLCORE_MAX_LINKS) {
+   wl->links[hlid].fw_rate_idx =
+   wl->fw_status->counters.tx_last_rate;
+   wl->links[hlid].fw_rate_mbps =
+   wl->fw_status->counters.tx_last_rate_mbps;
+   }
+
/* freed Tx descriptors */
wl1271_debug(DEBUG_TX, "last released desc = %d, current idx = %d",
 priv->last_fw_rls_idx, status_priv->fw_release_idx);
diff --git a/drivers/net/wireless/ti/wl18xx/wl18xx.h 
b/drivers/net/wireless/ti/wl18xx/wl18xx.h
index d65cc6d..5371cbd 100644
--- a/drivers/net/wireless/ti/wl18xx/wl18xx.h
+++ b/drivers/net/wireless/ti/wl18xx/wl18xx.h
@@ -125,7 +125,11 @@ struct wl18xx_fw_packet_counters {
/* Tx rate of the last transmitted packet */
u8 tx_last_rate;
 
-   u8 padding[2];
+   /* Tx rate or Tx rate estimate pre-calculated by fw in mbps units */
+   u8 tx_last_rate_mbps;
+
+   /* hlid for which the rates were reported */
+   u8 hlid;
 } __packed;
 
 /* FW status registers */
diff --git a/drivers/net/wireless/ti/wlcore/main.c 
b/drivers/net/wireless/ti/wlcore/main.c
index 

[PATCH 0/3] *** Mesh Path Selection Metric Calculation ***

2016-06-20 Thread Maxim Altshul
Hi All,
This patch series focuses on metric calculation that
occurs during the path selection phase of a mesh network.

During the path selection phase, the mesh hwmp module
performs metric calculations, that take as parameters
the last TX rate that was used for a specific link,
and the packet error rate.

These parameters should be reported by the FW to the driver
constantly for the mechanism to work properly.

In case that a vendor offloads the rate control mechanism
to the FW, these parameters will be rarely updated,
or updated incorrectly.

This situation causes the mesh hwmp module to calculate incorrect
metrics and as a consequence, not to choose the best paths possible.


This patch series is divided to three patches and does the following:

1. Modifies mesh hwmp module and allows vendors that offload the
rate control mechanism to their FW, to report last TX rates and PER
to the mesh hwmp module by using an existing op called
get_expected_throughput.
In case that a vendor does not implement the op, all previous
functionality still applies.

2. Implements the opcode and the mechanism that reports the rates
in TI driver.

Maxim Altshul (3):
  wlcore/wl18xx: Add functionality to accept TX rate per link
  wlcore: Add support for get_expected_throughput opcode
  mac80211: mesh: Add support for HW RC implementation

 drivers/net/wireless/ti/wl18xx/main.c |  4 
 drivers/net/wireless/ti/wl18xx/tx.c   | 22 ++
 drivers/net/wireless/ti/wl18xx/wl18xx.h   |  6 +-
 drivers/net/wireless/ti/wlcore/main.c | 16 
 drivers/net/wireless/ti/wlcore/rx.c   |  7 +++
 drivers/net/wireless/ti/wlcore/wlcore_i.h | 13 +
 net/mac80211/mesh_hwmp.c  | 23 +++
 7 files changed, 78 insertions(+), 13 deletions(-)

-- 
2.7.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 v2 1/2] staging: wilc1000: message_queue: Move code to host interface

2016-06-20 Thread Binoy Jayan
Move the contents of wilc_msgqueue.c and wilc_msgqueue.h into
host_interface.c, remove 'wilc_msgqueue.c' and 'wilc_msgqueue.h'.
This is done so as to restructure the implementation of the kthread
'hostIFthread' using a work queue.

Signed-off-by: Binoy Jayan 
Reviewed-by: Arnd Bergmann 
---
 drivers/staging/wilc1000/Makefile |   1 -
 drivers/staging/wilc1000/host_interface.c | 163 +-
 drivers/staging/wilc1000/wilc_msgqueue.c  | 144 --
 drivers/staging/wilc1000/wilc_msgqueue.h  |  28 -
 4 files changed, 162 insertions(+), 174 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_msgqueue.c
 delete mode 100644 drivers/staging/wilc1000/wilc_msgqueue.h

diff --git a/drivers/staging/wilc1000/Makefile 
b/drivers/staging/wilc1000/Makefile
index acc3f3e..d226283 100644
--- a/drivers/staging/wilc1000/Makefile
+++ b/drivers/staging/wilc1000/Makefile
@@ -6,7 +6,6 @@ ccflags-y += -DFIRMWARE_1002=\"atmel/wilc1002_firmware.bin\" \
 ccflags-y += -I$(src)/ -DWILC_ASIC_A0 -DWILC_DEBUGFS
 
 wilc1000-objs := wilc_wfi_cfgoperations.o linux_wlan.o linux_mon.o \
-   wilc_msgqueue.o \
coreconfigurator.o host_interface.o \
wilc_wlan_cfg.o wilc_debugfs.o \
wilc_wlan.o
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 9535842..494345b 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3,11 +3,13 @@
 #include 
 #include 
 #include 
+#include 
 #include "host_interface.h"
+#include 
+#include 
 #include "coreconfigurator.h"
 #include "wilc_wlan.h"
 #include "wilc_wlan_if.h"
-#include "wilc_msgqueue.h"
 #include 
 #include "wilc_wfi_netdevice.h"
 
@@ -57,6 +59,20 @@
 #define TCP_ACK_FILTER_LINK_SPEED_THRESH   54
 #define DEFAULT_LINK_SPEED 72
 
+struct message {
+   void *buf;
+   u32 len;
+   struct list_head list;
+};
+
+struct message_queue {
+   struct semaphore sem;
+   spinlock_t lock;
+   bool exiting;
+   u32 recv_count;
+   struct list_head msg_list;
+};
+
 struct host_if_wpa_attr {
u8 *key;
const u8 *mac_addr;
@@ -264,6 +280,151 @@ static struct wilc_vif *join_req_vif;
 static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo);
 static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
 static s32 Handle_ScanDone(struct wilc_vif *vif, enum scan_event enuEvent);
+static int wilc_mq_create(struct message_queue *mq);
+static int wilc_mq_send(struct message_queue *mq,
+const void *send_buf, u32 send_buf_size);
+static int wilc_mq_recv(struct message_queue *mq,
+void *recv_buf, u32 recv_buf_size, u32 *recv_len);
+static int wilc_mq_destroy(struct message_queue *mq);
+
+/*!
+ *  @authorsyounan
+ *  @date  1 Sep 2010
+ *  @note  copied from FLO glue implementatuion
+ *  @version   1.0
+ */
+static int wilc_mq_create(struct message_queue *mq)
+{
+   spin_lock_init(>lock);
+   sema_init(>sem, 0);
+   INIT_LIST_HEAD(>msg_list);
+   mq->recv_count = 0;
+   mq->exiting = false;
+   return 0;
+}
+
+/*!
+ *  @authorsyounan
+ *  @date  1 Sep 2010
+ *  @note  copied from FLO glue implementatuion
+ *  @version   1.0
+ */
+static int wilc_mq_destroy(struct message_queue *mq)
+{
+   struct message *msg;
+
+   mq->exiting = true;
+
+   /* Release any waiting receiver thread. */
+   while (mq->recv_count > 0) {
+   up(>sem);
+   mq->recv_count--;
+   }
+
+   while (!list_empty(>msg_list)) {
+   msg = list_first_entry(>msg_list, struct message, list);
+   list_del(>list);
+   kfree(msg->buf);
+   }
+
+   return 0;
+}
+
+/*!
+ *  @authorsyounan
+ *  @date  1 Sep 2010
+ *  @note  copied from FLO glue implementatuion
+ *  @version   1.0
+ */
+static int wilc_mq_send(struct message_queue *mq,
+const void *send_buf, u32 send_buf_size)
+{
+   unsigned long flags;
+   struct message *new_msg = NULL;
+
+   if (!mq || (send_buf_size == 0) || !send_buf)
+   return -EINVAL;
+
+   if (mq->exiting)
+   return -EFAULT;
+
+   /* construct a new message */
+   new_msg = kmalloc(sizeof(*new_msg), GFP_ATOMIC);
+   if (!new_msg)
+   return -ENOMEM;
+
+   new_msg->len = send_buf_size;
+   INIT_LIST_HEAD(_msg->list);
+   new_msg->buf = kmemdup(send_buf, send_buf_size, GFP_ATOMIC);
+   if (!new_msg->buf) {
+   kfree(new_msg);
+   return -ENOMEM;
+   }
+
+   spin_lock_irqsave(>lock, flags);
+
+   /* add it to the message queue */
+   

[PATCH v2 2/2] staging: wilc1000: Replace kthread with workqueue for host interface

2016-06-20 Thread Binoy Jayan
Deconstruct the kthread / message_queue logic, replacing it with
create_singlethread_workqueue() / queue_work() setup, by adding a
'struct work_struct' to 'struct host_if_msg'. The current kthread
hostIFthread() is converted to a work queue helper with the name
'host_if_work'.

Signed-off-by: Binoy Jayan 
Reviewed-by: Arnd Bergmann 
---
 drivers/staging/wilc1000/TODO |   5 +
 drivers/staging/wilc1000/host_interface.c | 542 +++---
 2 files changed, 198 insertions(+), 349 deletions(-)

diff --git a/drivers/staging/wilc1000/TODO b/drivers/staging/wilc1000/TODO
index 95199d8..ec93b2e 100644
--- a/drivers/staging/wilc1000/TODO
+++ b/drivers/staging/wilc1000/TODO
@@ -4,6 +4,11 @@ TODO:
 - remove custom debug and tracing functions
 - rework comments and function headers(also coding style)
 - replace all semaphores with mutexes or completions
+- Move handling for each individual members of 'union message_body' out
+  into a separate 'struct work_struct' and completely remove the multiplexer
+  that is currently part of host_if_work(), allowing movement of the
+  implementation of each message handler into the callsite of the function
+  that currently queues the 'host_if_msg'.
 - make spi and sdio components coexist in one build
 - turn compile-time platform configuration (BEAGLE_BOARD,
   PANDA_BOARD, PLAT_WMS8304, PLAT_RK, CUSTOMER_PLATFORM, ...)
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 494345b..92d4561 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4,6 +4,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "host_interface.h"
 #include 
 #include 
@@ -59,20 +60,6 @@
 #define TCP_ACK_FILTER_LINK_SPEED_THRESH   54
 #define DEFAULT_LINK_SPEED 72
 
-struct message {
-   void *buf;
-   u32 len;
-   struct list_head list;
-};
-
-struct message_queue {
-   struct semaphore sem;
-   spinlock_t lock;
-   bool exiting;
-   u32 recv_count;
-   struct list_head msg_list;
-};
-
 struct host_if_wpa_attr {
u8 *key;
const u8 *mac_addr;
@@ -211,6 +198,7 @@ struct host_if_msg {
u16 id;
union message_body body;
struct wilc_vif *vif;
+   struct work_struct work;
 };
 
 struct join_bss_param {
@@ -245,8 +233,7 @@ struct join_bss_param {
 static struct host_if_drv *terminated_handle;
 bool wilc_optaining_ip;
 static u8 P2P_LISTEN_STATE;
-static struct task_struct *hif_thread_handler;
-static struct message_queue hif_msg_q;
+static struct workqueue_struct *hif_workqueue;
 static struct completion hif_thread_comp;
 static struct completion hif_driver_comp;
 static struct completion hif_wait_response;
@@ -280,55 +267,8 @@ static struct wilc_vif *join_req_vif;
 static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo);
 static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
 static s32 Handle_ScanDone(struct wilc_vif *vif, enum scan_event enuEvent);
-static int wilc_mq_create(struct message_queue *mq);
-static int wilc_mq_send(struct message_queue *mq,
-const void *send_buf, u32 send_buf_size);
-static int wilc_mq_recv(struct message_queue *mq,
-void *recv_buf, u32 recv_buf_size, u32 *recv_len);
-static int wilc_mq_destroy(struct message_queue *mq);
-
-/*!
- *  @authorsyounan
- *  @date  1 Sep 2010
- *  @note  copied from FLO glue implementatuion
- *  @version   1.0
- */
-static int wilc_mq_create(struct message_queue *mq)
-{
-   spin_lock_init(>lock);
-   sema_init(>sem, 0);
-   INIT_LIST_HEAD(>msg_list);
-   mq->recv_count = 0;
-   mq->exiting = false;
-   return 0;
-}
-
-/*!
- *  @authorsyounan
- *  @date  1 Sep 2010
- *  @note  copied from FLO glue implementatuion
- *  @version   1.0
- */
-static int wilc_mq_destroy(struct message_queue *mq)
-{
-   struct message *msg;
-
-   mq->exiting = true;
-
-   /* Release any waiting receiver thread. */
-   while (mq->recv_count > 0) {
-   up(>sem);
-   mq->recv_count--;
-   }
-
-   while (!list_empty(>msg_list)) {
-   msg = list_first_entry(>msg_list, struct message, list);
-   list_del(>list);
-   kfree(msg->buf);
-   }
-
-   return 0;
-}
+static int wilc_enqueue_cmd(struct host_if_msg *msg);
+static void host_if_work(struct work_struct *work);
 
 /*!
  *  @authorsyounan
@@ -336,95 +276,19 @@ static int wilc_mq_destroy(struct message_queue *mq)
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-static int wilc_mq_send(struct message_queue *mq,
-const void *send_buf, u32 send_buf_size)
+static int wilc_enqueue_cmd(struct host_if_msg *msg)
 {

[PATCH v2 0/2] *** staging: wilc1000: Replace semaphores ***

2016-06-20 Thread Binoy Jayan
This is the second patch series for 'wilc1000'. The original patch series
consisted 7 patches of which only the first 5 are good. The patch 6 and 7
are being worked on in this series in a different way.

This patch series removes the semaphore 'sem' in 'wilc1000' and also
restructures the implementation of kthread / message_queue logic with
a create_singlethread_workqueue() / queue_work() setup.

These are part of a bigger effort to eliminate all semaphores
from the linux kernel.

They build correctly (individually and as a whole).

NB: The changes are untested

Rework on the review comments by Arnd w.r.t. v1 for patch 2:

struct message_queue can be removed since
 - after the workqueue conversion, mq->sem is no longer needed
 - recv_count is not needed, it just counts the number of entries in the list
 - struct wilc' pointer can be retrieved from the host_if_msg, (vif->wilc)
 - the message list is not needed because we always look only at the
   first entry, except in wilc_mq_destroy(), but it would be better
   to just call destroy_workqueue(), which also drains the remaining work.
 - the exiting flag is also handled by destroy_workqueue()   
 - with everything else gone, the spinlock is also not needed any more.

Do 'kfree' only at the end of 'host_if_work' 

wilc_initialized is always '1' so the conditional 'wilc_mq_send'
in 'hostIFthread' can be removed.

A connect command (HOST_IF_MSG_CONNECT) does not complete while scan is 
ongoing. 
So, the special handling of this command needs to be preserved.

Use create_singlethread_workqueue() instead of alloc_workqueue(), so that
we stay closer to the current behavior by having the thread run only
on one CPU at a time and not having a 'dedicated' thread for each.

Split the patch to seperate interface changes to 'wilc_mq_send'
No easy way found to split the patch to change the interface
'wilc_mq_send' and to 'wilc_enqueue_cmd' as the parameters 
'mq' 'send_buf' and 'send_buf_size' itself are part of the message
queue implementation.


Binoy Jayan (2):
  staging: wilc1000: message_queue: Move code to host interface
  staging: wilc1000: Replace kthread with workqueue for host interface

 drivers/staging/wilc1000/Makefile |   1 -
 drivers/staging/wilc1000/TODO |   5 +
 drivers/staging/wilc1000/host_interface.c | 417 +++---
 drivers/staging/wilc1000/wilc_msgqueue.c  | 144 ---
 drivers/staging/wilc1000/wilc_msgqueue.h  |  28 --
 5 files changed, 216 insertions(+), 379 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_msgqueue.c
 delete mode 100644 drivers/staging/wilc1000/wilc_msgqueue.h

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

--
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 12/12] leds: Only descend into leds directory when CONFIG_NEW_LEDS is set

2016-06-20 Thread Jacek Anaszewski

On 06/18/2016 12:46 AM, Andrew F. Davis wrote:

On 06/15/2016 01:48 AM, Jacek Anaszewski wrote:

Hi Andrew,

Thanks for the patch.

Please address the issue [1] raised by test bot and resubmit.

Thanks,
Jacek Anaszewski

[1] https://lkml.org/lkml/2016/6/13/1091



It looks like some systems use 'gpio_led_register_device' to make an
in-memory copy of their LED device table so the original can be removed
as .init.rodata. This doesn't necessarily depend on the LED subsystem
but it kind of seems useless when the rest of the subsystem is disabled.

One solution could be to use a dummy 'gpio_led_register_device' when the
subsystem is not enabled.


It sounds good. Please add a no-op version of gpio_led_register_device()
to include/leds.h, in a separate patch.

Thanks,
Jacek Anaszewski


Another is just to remove the five or so uses
of 'gpio_led_register_device' and have those systems register LED device
tables like other systems do.

If nether of these are acceptable then this patch can be dropped from
this series for now.

Thanks,
Andrew


On 06/13/2016 10:02 PM, Andrew F. Davis wrote:

When CONFIG_NEW_LEDS is not set make will still descend into the leds
directory but nothing will be built. This produces unneeded build
artifacts and messages in addition to slowing the build. Fix this here.

Signed-off-by: Andrew F. Davis 
---
   drivers/Makefile | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/Makefile b/drivers/Makefile
index 567e32c..fa514d5 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -127,7 +127,7 @@ obj-$(CONFIG_CPU_FREQ)+= cpufreq/
   obj-$(CONFIG_CPU_IDLE)+= cpuidle/
   obj-$(CONFIG_MMC)+= mmc/
   obj-$(CONFIG_MEMSTICK)+= memstick/
-obj-y+= leds/
+obj-$(CONFIG_NEW_LEDS)+= leds/
   obj-$(CONFIG_INFINIBAND)+= infiniband/
   obj-$(CONFIG_SGI_SN)+= sn/
   obj-y+= firmware/









--
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/6] wcn36xx: Fold indication payload into message header

2016-06-20 Thread Bjorn Andersson
From: Bjorn Andersson 

Merge the two allocation instead of separately allocating room for the
indication payload.

Signed-off-by: Bjorn Andersson 
Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 15 ++-
 drivers/net/wireless/ath/wcn36xx/smd.h |  2 +-
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index e8b630c4f11e..1a9580d72077 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -2229,14 +2229,8 @@ static void wcn36xx_smd_rsp_process(struct wcn36xx *wcn, 
void *buf, size_t len)
case WCN36XX_HAL_OTA_TX_COMPL_IND:
case WCN36XX_HAL_MISSED_BEACON_IND:
case WCN36XX_HAL_DELETE_STA_CONTEXT_IND:
-   msg_ind = kmalloc(sizeof(*msg_ind), GFP_KERNEL);
-   if (!msg_ind)
-   goto nomem;
-   msg_ind->msg_len = len;
-   msg_ind->msg = kmemdup(buf, len, GFP_KERNEL);
-   if (!msg_ind->msg) {
-   kfree(msg_ind);
-nomem:
+   msg_ind = kmalloc(sizeof(*msg_ind) + len, GFP_KERNEL);
+   if (!msg_ind) {
/*
 * FIXME: Do something smarter then just
 * printing an error.
@@ -2245,6 +2239,10 @@ nomem:
msg_header->msg_type);
break;
}
+
+   msg_ind->msg_len = len;
+   memcpy(msg_ind->msg, buf, len);
+
mutex_lock(>hal_ind_mutex);
list_add_tail(_ind->list, >hal_ind_queue);
queue_work(wcn->hal_ind_wq, >hal_ind_work);
@@ -2295,7 +2293,6 @@ static void wcn36xx_ind_smd_work(struct work_struct *work)
  msg_header->msg_type);
}
list_del(wcn->hal_ind_queue.next);
-   kfree(hal_ind_msg->msg);
kfree(hal_ind_msg);
mutex_unlock(>hal_ind_mutex);
 }
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h 
b/drivers/net/wireless/ath/wcn36xx/smd.h
index d93e3fd73831..c4375ce1019a 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.h
+++ b/drivers/net/wireless/ath/wcn36xx/smd.h
@@ -46,8 +46,8 @@ struct wcn36xx_fw_msg_status_rsp {
 
 struct wcn36xx_hal_ind_msg {
struct list_head list;
-   u8 *msg;
size_t msg_len;
+   u8 msg[];
 };
 
 struct wcn36xx;
-- 
2.5.0

--
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 5/6] wcn36xx: Transition driver to SMD client

2016-06-20 Thread Bjorn Andersson
The wcn36xx wifi driver follows the life cycle of the WLAN_CTRL SMD
channel, as such it should be a SMD client. This patch makes this
transition, now that we have the necessary frameworks available.

Signed-off-by: Bjorn Andersson 
---

This patch depends on the devicetree binding approved by Rob Herring [1] and
the addition of support in the wcnss_ctrl driver for probing sub-drivers in a
timely manner [2] - i.e. when the WCNSS core OS signals that it's booted.

These are both scheduled to be merged in v4.8

[1] https://patchwork.kernel.org/patch/9159621/
[2] 
https://git.kernel.org/cgit/linux/kernel/git/agross/linux.git/log/?h=for-next

 drivers/net/wireless/ath/wcn36xx/Kconfig   |  2 +-
 drivers/net/wireless/ath/wcn36xx/dxe.c | 16 +++---
 drivers/net/wireless/ath/wcn36xx/main.c| 79 --
 drivers/net/wireless/ath/wcn36xx/smd.c | 29 +--
 drivers/net/wireless/ath/wcn36xx/smd.h |  5 ++
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 21 +++-
 6 files changed, 86 insertions(+), 66 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/Kconfig 
b/drivers/net/wireless/ath/wcn36xx/Kconfig
index 591ebaea8265..394fe5b77c90 100644
--- a/drivers/net/wireless/ath/wcn36xx/Kconfig
+++ b/drivers/net/wireless/ath/wcn36xx/Kconfig
@@ -1,6 +1,6 @@
 config WCN36XX
tristate "Qualcomm Atheros WCN3660/3680 support"
-   depends on MAC80211 && HAS_DMA
+   depends on MAC80211 && HAS_DMA && QCOM_SMD
---help---
  This module adds support for wireless adapters based on
  Qualcomm Atheros WCN3660 and WCN3680 mobile chipsets.
diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c 
b/drivers/net/wireless/ath/wcn36xx/dxe.c
index 231fd022f0f5..87dfdaf9044c 100644
--- a/drivers/net/wireless/ath/wcn36xx/dxe.c
+++ b/drivers/net/wireless/ath/wcn36xx/dxe.c
@@ -23,6 +23,7 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include 
+#include 
 #include "wcn36xx.h"
 #include "txrx.h"
 
@@ -151,9 +152,12 @@ int wcn36xx_dxe_alloc_ctl_blks(struct wcn36xx *wcn)
goto out_err;
 
/* Initialize SMSM state  Clear TX Enable RING EMPTY STATE */
-   ret = wcn->ctrl_ops->smsm_change_state(
-   WCN36XX_SMSM_WLAN_TX_ENABLE,
-   WCN36XX_SMSM_WLAN_TX_RINGS_EMPTY);
+   ret = qcom_smem_state_update_bits(wcn->tx_enable_state,
+ WCN36XX_SMSM_WLAN_TX_ENABLE |
+ WCN36XX_SMSM_WLAN_TX_RINGS_EMPTY,
+ WCN36XX_SMSM_WLAN_TX_RINGS_EMPTY);
+   if (ret)
+   goto out_err;
 
return 0;
 
@@ -678,9 +682,9 @@ int wcn36xx_dxe_tx_frame(struct wcn36xx *wcn,
 * notify chip about new frame through SMSM bus.
 */
if (is_low &&  vif_priv->pw_state == WCN36XX_BMPS) {
-   wcn->ctrl_ops->smsm_change_state(
- 0,
- WCN36XX_SMSM_WLAN_TX_ENABLE);
+   qcom_smem_state_update_bits(wcn->tx_rings_empty_state,
+   WCN36XX_SMSM_WLAN_TX_ENABLE,
+   WCN36XX_SMSM_WLAN_TX_ENABLE);
} else {
/* indicate End Of Packet and generate interrupt on descriptor
 * done.
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c 
b/drivers/net/wireless/ath/wcn36xx/main.c
index e1d59da2ad20..3c2522b07c90 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -21,6 +21,10 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include "wcn36xx.h"
 
 unsigned int wcn36xx_dbg_mask;
@@ -1058,8 +1062,7 @@ static int wcn36xx_platform_get_resources(struct wcn36xx 
*wcn,
int ret;
 
/* Set TX IRQ */
-   res = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
-  "wcnss_wlantx_irq");
+   res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "tx");
if (!res) {
wcn36xx_err("failed to get tx_irq\n");
return -ENOENT;
@@ -1067,14 +1070,29 @@ static int wcn36xx_platform_get_resources(struct 
wcn36xx *wcn,
wcn->tx_irq = res->start;
 
/* Set RX IRQ */
-   res = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
-  "wcnss_wlanrx_irq");
+   res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "rx");
if (!res) {
wcn36xx_err("failed to get rx_irq\n");
return -ENOENT;
}
wcn->rx_irq = res->start;
 
+   /* Acquire SMSM tx enable handle */
+   wcn->tx_enable_state = qcom_smem_state_get(>dev,
+   "tx-enable", >tx_enable_state_bit);
+   if (IS_ERR(wcn->tx_enable_state)) {
+   wcn36xx_err("failed to get tx-enable state\n");
+   return 

[PATCH 4/6] wcn36xx: Correct DXE chip version differentiation

2016-06-20 Thread Bjorn Andersson
The CCU block in WCNSS is configured for appropriate routing of
interrupts from the DXE to the application cpu, this is not dependant on
the iris version (wcn3660 vs wcn3680), but rather if the SoC has a riva
or pronto built in.

Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/dxe.c | 11 ++-
 drivers/net/wireless/ath/wcn36xx/dxe.h |  5 ++---
 drivers/net/wireless/ath/wcn36xx/main.c| 16 ++--
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h |  5 +
 4 files changed, 11 insertions(+), 26 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c 
b/drivers/net/wireless/ath/wcn36xx/dxe.c
index a8ff45400982..231fd022f0f5 100644
--- a/drivers/net/wireless/ath/wcn36xx/dxe.c
+++ b/drivers/net/wireless/ath/wcn36xx/dxe.c
@@ -702,12 +702,13 @@ int wcn36xx_dxe_init(struct wcn36xx *wcn)
reg_data = WCN36XX_DXE_REG_RESET;
wcn36xx_dxe_write_register(wcn, WCN36XX_DXE_REG_CSR_RESET, reg_data);
 
-   /* Setting interrupt path */
-   reg_data = WCN36XX_DXE_CCU_INT;
-   if (wcn->chip_version == WCN36XX_CHIP_3680)
-   wcn36xx_ccu_write_register(wcn, WCN36XX_DXE_REG_CCU_INT_3680, 
reg_data);
+   /* Select channels for rx avail and xfer done interrupts... */
+   reg_data = (WCN36XX_DXE_INT_CH3_MASK | WCN36XX_DXE_INT_CH1_MASK) << 16 |
+   WCN36XX_DXE_INT_CH0_MASK | WCN36XX_DXE_INT_CH4_MASK;
+   if (wcn->is_pronto)
+   wcn36xx_ccu_write_register(wcn, 
WCN36XX_CCU_DXE_INT_SELECT_PRONTO, reg_data);
else
-   wcn36xx_ccu_write_register(wcn, WCN36XX_DXE_REG_CCU_INT_3660, 
reg_data);
+   wcn36xx_ccu_write_register(wcn, 
WCN36XX_CCU_DXE_INT_SELECT_RIVA, reg_data);
 
/***/
/* Init descriptors for TX LOW channel */
diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.h 
b/drivers/net/wireless/ath/wcn36xx/dxe.h
index 012b59f4f91b..c012e807753b 100644
--- a/drivers/net/wireless/ath/wcn36xx/dxe.h
+++ b/drivers/net/wireless/ath/wcn36xx/dxe.h
@@ -30,9 +30,8 @@ H2H_TEST_RX_TX = DMA2
 /* DXE registers */
 #define WCN36XX_DXE_MEM_REG0
 
-#define WCN36XX_DXE_CCU_INT0xA0011
-#define WCN36XX_DXE_REG_CCU_INT_3660   0x310
-#define WCN36XX_DXE_REG_CCU_INT_3680   0x10dc
+#define WCN36XX_CCU_DXE_INT_SELECT_RIVA0x310
+#define WCN36XX_CCU_DXE_INT_SELECT_PRONTO  0x10dc
 
 /* TODO This must calculated properly but not hardcoded */
 #define WCN36XX_DXE_CTRL_TX_L  0x328a44
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c 
b/drivers/net/wireless/ath/wcn36xx/main.c
index 8146eeba4458..e1d59da2ad20 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -261,17 +261,6 @@ static void wcn36xx_feat_caps_info(struct wcn36xx *wcn)
}
 }
 
-static void wcn36xx_detect_chip_version(struct wcn36xx *wcn)
-{
-   if (get_feat_caps(wcn->fw_feat_caps, DOT11AC)) {
-   wcn36xx_info("Chip is 3680\n");
-   wcn->chip_version = WCN36XX_CHIP_3680;
-   } else {
-   wcn36xx_info("Chip is 3660\n");
-   wcn->chip_version = WCN36XX_CHIP_3660;
-   }
-}
-
 static int wcn36xx_start(struct ieee80211_hw *hw)
 {
struct wcn36xx *wcn = hw->priv;
@@ -326,9 +315,6 @@ static int wcn36xx_start(struct ieee80211_hw *hw)
wcn36xx_feat_caps_info(wcn);
}
 
-   wcn36xx_detect_chip_version(wcn);
-   wcn36xx_smd_update_cfg(wcn, WCN36XX_HAL_CFG_ENABLE_MC_ADDR_LIST, 1);
-
/* DMA channel initialization */
ret = wcn36xx_dxe_init(wcn);
if (ret) {
@@ -1095,6 +1081,8 @@ static int wcn36xx_platform_get_resources(struct wcn36xx 
*wcn,
return -EINVAL;
}
 
+   wcn->is_pronto = !!of_device_is_compatible(mmio_node, "qcom,pronto");
+
/* Map the CCU memory */
index = of_property_match_string(mmio_node, "reg-names", "ccu");
wcn->ccu_base = of_iomap(mmio_node, index);
diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h 
b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
index 845f2446a1b5..22242d18e1fe 100644
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
@@ -193,7 +193,7 @@ struct wcn36xx {
u8  fw_minor;
u8  fw_major;
u32 fw_feat_caps[WCN36XX_HAL_CAPS_SIZE];
-   u32 chip_version;
+   boolis_pronto;
 
/* extra byte for the NULL termination */
u8  crm_version[WCN36XX_HAL_VERSION_LENGTH + 1];
@@ -242,9 +242,6 @@ struct wcn36xx {
 
 };
 
-#define WCN36XX_CHIP_3660  0
-#define WCN36XX_CHIP_3680  1
-
 static inline bool wcn36xx_is_fw_version(struct wcn36xx *wcn,
 u8 major,
  

[PATCH 3/6] wcn36xx: Split mmio space into explicit regions

2016-06-20 Thread Bjorn Andersson
Split the wcnss mmio space into explicit regions for ccu and dxe and
acquire these from the node referenced by the qcom,mmio phandle.

Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/dxe.c | 26 ---
 drivers/net/wireless/ath/wcn36xx/dxe.h |  6 ++--
 drivers/net/wireless/ath/wcn36xx/main.c| 51 +++---
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h |  3 +-
 4 files changed, 59 insertions(+), 27 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c 
b/drivers/net/wireless/ath/wcn36xx/dxe.c
index 8643801f31b6..a8ff45400982 100644
--- a/drivers/net/wireless/ath/wcn36xx/dxe.c
+++ b/drivers/net/wireless/ath/wcn36xx/dxe.c
@@ -35,26 +35,27 @@ void *wcn36xx_dxe_get_next_bd(struct wcn36xx *wcn, bool 
is_low)
return ch->head_blk_ctl->bd_cpu_addr;
 }
 
+static void wcn36xx_ccu_write_register(struct wcn36xx *wcn, int addr, int data)
+{
+   wcn36xx_dbg(WCN36XX_DBG_DXE,
+   "wcn36xx_ccu_write_register: addr=%x, data=%x\n",
+   addr, data);
+
+   writel(data, wcn->ccu_base + addr);
+}
+
 static void wcn36xx_dxe_write_register(struct wcn36xx *wcn, int addr, int data)
 {
wcn36xx_dbg(WCN36XX_DBG_DXE,
"wcn36xx_dxe_write_register: addr=%x, data=%x\n",
addr, data);
 
-   writel(data, wcn->mmio + addr);
+   writel(data, wcn->dxe_base + addr);
 }
 
-#define wcn36xx_dxe_write_register_x(wcn, reg, reg_data)\
-do {\
-   if (wcn->chip_version == WCN36XX_CHIP_3680)  \
-   wcn36xx_dxe_write_register(wcn, reg ## _3680, reg_data); \
-   else \
-   wcn36xx_dxe_write_register(wcn, reg ## _3660, reg_data); \
-} while (0) \
-
 static void wcn36xx_dxe_read_register(struct wcn36xx *wcn, int addr, int *data)
 {
-   *data = readl(wcn->mmio + addr);
+   *data = readl(wcn->dxe_base + addr);
 
wcn36xx_dbg(WCN36XX_DBG_DXE,
"wcn36xx_dxe_read_register: addr=%x, data=%x\n",
@@ -703,7 +704,10 @@ int wcn36xx_dxe_init(struct wcn36xx *wcn)
 
/* Setting interrupt path */
reg_data = WCN36XX_DXE_CCU_INT;
-   wcn36xx_dxe_write_register_x(wcn, WCN36XX_DXE_REG_CCU_INT, reg_data);
+   if (wcn->chip_version == WCN36XX_CHIP_3680)
+   wcn36xx_ccu_write_register(wcn, WCN36XX_DXE_REG_CCU_INT_3680, 
reg_data);
+   else
+   wcn36xx_ccu_write_register(wcn, WCN36XX_DXE_REG_CCU_INT_3660, 
reg_data);
 
/***/
/* Init descriptors for TX LOW channel */
diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.h 
b/drivers/net/wireless/ath/wcn36xx/dxe.h
index 3eca4f9594f2..012b59f4f91b 100644
--- a/drivers/net/wireless/ath/wcn36xx/dxe.h
+++ b/drivers/net/wireless/ath/wcn36xx/dxe.h
@@ -28,11 +28,11 @@ H2H_TEST_RX_TX = DMA2
 */
 
 /* DXE registers */
-#define WCN36XX_DXE_MEM_REG0x202000
+#define WCN36XX_DXE_MEM_REG0
 
 #define WCN36XX_DXE_CCU_INT0xA0011
-#define WCN36XX_DXE_REG_CCU_INT_3660   0x200b10
-#define WCN36XX_DXE_REG_CCU_INT_3680   0x2050dc
+#define WCN36XX_DXE_REG_CCU_INT_3660   0x310
+#define WCN36XX_DXE_REG_CCU_INT_3680   0x10dc
 
 /* TODO This must calculated properly but not hardcoded */
 #define WCN36XX_DXE_CTRL_TX_L  0x328a44
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c 
b/drivers/net/wireless/ath/wcn36xx/main.c
index a920d7020148..8146eeba4458 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -19,6 +19,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include "wcn36xx.h"
 
 unsigned int wcn36xx_dbg_mask;
@@ -1064,7 +1066,11 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
 static int wcn36xx_platform_get_resources(struct wcn36xx *wcn,
  struct platform_device *pdev)
 {
+   struct device_node *mmio_node;
struct resource *res;
+   int index;
+   int ret;
+
/* Set TX IRQ */
res = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
   "wcnss_wlantx_irq");
@@ -1083,19 +1089,38 @@ static int wcn36xx_platform_get_resources(struct 
wcn36xx *wcn,
}
wcn->rx_irq = res->start;
 
-   /* Map the memory */
-   res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
-"wcnss_mmio");
-   if (!res) {
-   wcn36xx_err("failed to get mmio\n");
-   return -ENOENT;
+   mmio_node = of_parse_phandle(pdev->dev.parent->of_node, "qcom,mmio", 0);
+   if (!mmio_node) {
+   

[PATCH 6/6] wcn36xx: Fix up wcn36xx_smd_update_scan_params()

2016-06-20 Thread Bjorn Andersson
Fix up the wcn36xx_smd_update_scan_params() to work with non-ancient
versions of the firmware and support actually specifying the list of
channels.

Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/hal.h |  4 ++--
 drivers/net/wireless/ath/wcn36xx/smd.c | 15 +--
 drivers/net/wireless/ath/wcn36xx/smd.h |  2 +-
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h 
b/drivers/net/wireless/ath/wcn36xx/hal.h
index 658bfb8baabe..4f87ef1e1eb8 100644
--- a/drivers/net/wireless/ath/wcn36xx/hal.h
+++ b/drivers/net/wireless/ath/wcn36xx/hal.h
@@ -4123,7 +4123,7 @@ struct wcn36xx_hal_update_scan_params_req {
 
 /* Update scan params - sent from host to PNO to be used during PNO
  * scanningx */
-struct update_scan_params_req_ex {
+struct wcn36xx_hal_update_scan_params_req_ex {
 
struct wcn36xx_hal_msg_header header;
 
@@ -4151,7 +4151,7 @@ struct update_scan_params_req_ex {
 
/* Cb State */
enum phy_chan_bond_state state;
-};
+} __packed;
 
 /* Update scan params - sent from host to PNO to be used during PNO
  * scanningx */
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index f9b2785cc277..994eba6cbaa8 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -675,22 +675,25 @@ static int wcn36xx_smd_update_scan_params_rsp(void *buf, 
size_t len)
return 0;
 }
 
-int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn)
+int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn,
+  u8 *channels, size_t channel_count)
 {
-   struct wcn36xx_hal_update_scan_params_req msg_body;
+   struct wcn36xx_hal_update_scan_params_req_ex msg_body;
int ret = 0;
 
mutex_lock(>hal_mutex);
INIT_HAL_MSG(msg_body, WCN36XX_HAL_UPDATE_SCAN_PARAM_REQ);
 
-   msg_body.dot11d_enabled = 0;
-   msg_body.dot11d_resolved = 0;
-   msg_body.channel_count = 26;
+   msg_body.dot11d_enabled = false;
+   msg_body.dot11d_resolved = true;
+
+   msg_body.channel_count = channel_count;
+   memcpy(msg_body.channels, channels, channel_count);
msg_body.active_min_ch_time = 60;
msg_body.active_max_ch_time = 120;
msg_body.passive_min_ch_time = 60;
msg_body.passive_max_ch_time = 110;
-   msg_body.state = 0;
+   msg_body.state = PHY_SINGLE_CHANNEL_CENTERED;
 
PREPARE_HAL_BUF(wcn->hal_buf, msg_body);
 
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h 
b/drivers/net/wireless/ath/wcn36xx/smd.h
index 493f6191a173..40d829563c2b 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.h
+++ b/drivers/net/wireless/ath/wcn36xx/smd.h
@@ -64,7 +64,7 @@ int wcn36xx_smd_start_scan(struct wcn36xx *wcn);
 int wcn36xx_smd_end_scan(struct wcn36xx *wcn);
 int wcn36xx_smd_finish_scan(struct wcn36xx *wcn,
enum wcn36xx_hal_sys_mode mode);
-int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn);
+int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn, u8 *channels, size_t 
channel_count);
 int wcn36xx_smd_add_sta_self(struct wcn36xx *wcn, struct ieee80211_vif *vif);
 int wcn36xx_smd_delete_sta_self(struct wcn36xx *wcn, u8 *addr);
 int wcn36xx_smd_delete_sta(struct wcn36xx *wcn, u8 sta_index);
-- 
2.5.0

--
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/6] wcn36xx: Change indication list lock to spinlock

2016-06-20 Thread Bjorn Andersson
From: Bjorn Andersson 

In preparation for handling incoming messages from IRQ context, change
the indication list lock to a spinlock

Signed-off-by: Bjorn Andersson 
Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 12 ++--
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index 1a9580d72077..b2108076f5c0 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -2243,10 +2243,10 @@ static void wcn36xx_smd_rsp_process(struct wcn36xx 
*wcn, void *buf, size_t len)
msg_ind->msg_len = len;
memcpy(msg_ind->msg, buf, len);
 
-   mutex_lock(>hal_ind_mutex);
+   spin_lock(>hal_ind_lock);
list_add_tail(_ind->list, >hal_ind_queue);
queue_work(wcn->hal_ind_wq, >hal_ind_work);
-   mutex_unlock(>hal_ind_mutex);
+   spin_unlock(>hal_ind_lock);
wcn36xx_dbg(WCN36XX_DBG_HAL, "indication arrived\n");
break;
default:
@@ -2260,8 +2260,9 @@ static void wcn36xx_ind_smd_work(struct work_struct *work)
container_of(work, struct wcn36xx, hal_ind_work);
struct wcn36xx_hal_msg_header *msg_header;
struct wcn36xx_hal_ind_msg *hal_ind_msg;
+   unsigned long flags;
 
-   mutex_lock(>hal_ind_mutex);
+   spin_lock_irqsave(>hal_ind_lock, flags);
 
hal_ind_msg = list_first_entry(>hal_ind_queue,
   struct wcn36xx_hal_ind_msg,
@@ -2293,8 +2294,8 @@ static void wcn36xx_ind_smd_work(struct work_struct *work)
  msg_header->msg_type);
}
list_del(wcn->hal_ind_queue.next);
+   spin_unlock_irqrestore(>hal_ind_lock, flags);
kfree(hal_ind_msg);
-   mutex_unlock(>hal_ind_mutex);
 }
 int wcn36xx_smd_open(struct wcn36xx *wcn)
 {
@@ -2307,7 +2308,7 @@ int wcn36xx_smd_open(struct wcn36xx *wcn)
}
INIT_WORK(>hal_ind_work, wcn36xx_ind_smd_work);
INIT_LIST_HEAD(>hal_ind_queue);
-   mutex_init(>hal_ind_mutex);
+   spin_lock_init(>hal_ind_lock);
 
ret = wcn->ctrl_ops->open(wcn, wcn36xx_smd_rsp_process);
if (ret) {
@@ -2327,5 +2328,4 @@ void wcn36xx_smd_close(struct wcn36xx *wcn)
 {
wcn->ctrl_ops->close();
destroy_workqueue(wcn->hal_ind_wq);
-   mutex_destroy(>hal_ind_mutex);
 }
diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h 
b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
index 7433d67a5929..f6d8d14f13d1 100644
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
@@ -215,7 +215,7 @@ struct wcn36xx {
struct completion   hal_rsp_compl;
struct workqueue_struct *hal_ind_wq;
struct work_struct  hal_ind_work;
-   struct mutexhal_ind_mutex;
+   spinlock_t  hal_ind_lock;
struct list_headhal_ind_queue;
 
/* DXE channels */
-- 
2.5.0

--
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