Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH] rtlwifi: rtl8192de: ix spelling mistake: "althougth" -> "although"
From: Larry Finger @ 2017-02-26 16:57 UTC (permalink / raw)
  To: Colin King, Chaoming Li, Kalle Valo, Arnd Bergmann, Oleg Drokin,
	Joe Perches, linux-wireless, netdev
  Cc: linux-kernel
In-Reply-To: <20170226151923.24669-1-colin.king@canonical.com>

On 02/26/2017 09:19 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> trivial fix to spelling mistake in RT_TRACE message
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Bad fix. It should be althougth => through. Please read the context.

NACK.

Larry

> ---
>  drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
> index de98d88..dcb5d83 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
> @@ -812,7 +812,7 @@ bool rtl92d_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
>  	 * pathA or mac1 has to set phy0&phy1 pathA */
>  	if ((content == radiob_txt) && (rfpath == RF90_PATH_A)) {
>  		RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
> -			 " ===> althougth Path A, we load radiob.txt\n");
> +			 " ===> although Path A, we load radiob.txt\n");
>  		radioa_arraylen = radiob_arraylen;
>  		radioa_array_table = radiob_array_table;
>  	}
>

^ permalink raw reply

* [PATCH] rtlwifi: rtl8192de: ix spelling mistake: "althougth" -> "although"
From: Colin King @ 2017-02-26 15:19 UTC (permalink / raw)
  To: Larry Finger, Chaoming Li, Kalle Valo, Arnd Bergmann, Oleg Drokin,
	Joe Perches, linux-wireless, netdev
  Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

trivial fix to spelling mistake in RT_TRACE message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
index de98d88..dcb5d83 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
@@ -812,7 +812,7 @@ bool rtl92d_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
 	 * pathA or mac1 has to set phy0&phy1 pathA */
 	if ((content == radiob_txt) && (rfpath == RF90_PATH_A)) {
 		RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
-			 " ===> althougth Path A, we load radiob.txt\n");
+			 " ===> although Path A, we load radiob.txt\n");
 		radioa_arraylen = radiob_arraylen;
 		radioa_array_table = radiob_array_table;
 	}
-- 
2.10.2

^ permalink raw reply related

* RE: Regression with Intel 3160 AP: client not reconnecting
From: Grumbach, Emmanuel @ 2017-02-26  6:57 UTC (permalink / raw)
  To: Johannes Berg, Jarek Kami?ski, linuxwifi; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <1487938414.2540.15.camel@sipsolutions.net>

PiANCj4gSGkgSmFyZWssDQo+IA0KPiBbc25pcF0NCj4gDQo+ID4gV2hhdCBtaWdodCBiZSB0aGUg
Y2F1c2U/IElzIHRoZXJlIGFueXRoaW5nIEkgY2FuIGRvIHRvIGhlbHAgZGVidWcgb3INCj4gPiBm
aXggdGhpcz8NCj4gDQo+IFRoYW5rcyBmb3IgdGhlIGRldGFpbGVkIGJ1ZyByZXBvcnQgYW5kIGFu
YWx5c2lzISBJIGNhbid0IGFuYWx5c2UgdGhpcyBpbiBkZXB0aA0KPiByaWdodCBub3csIGNhbiB5
b3UgcGxlYXNlIGZpbGUgYSBidWcgb24gYnVnemlsbGEua2VybmVsLm9yZz8NCg0KV2hlbiB5b3Ug
ZG8gc28sIHBsZWFzZSBDQyBsaW51eHdpZmlAaW50ZWwuY29tIHRvIHRoZSBidWcuDQoNClRoYW5r
IHlvdS4NCg==

^ permalink raw reply

* Re: [PATCH resend 1/4] nfc: Add support RC-S380P to port100
From: OGAWA Hirofumi @ 2017-02-25 22:43 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: Aloisio Almeida Jr, Lauro Ramos Venancio, linux-wireless,
	Andrew Morton, Linus Torvalds, linux-kernel, linux-nfc
In-Reply-To: <871sveu579.fsf@mail.parknet.co.jp>

OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> writes:

Ping?

> Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
> ---
>
>  drivers/nfc/port100.c |    8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff -puN drivers/nfc/port100.c~nfc-add-rcs380p drivers/nfc/port100.c
> --- linux/drivers/nfc/port100.c~nfc-add-rcs380p	2016-12-18 22:16:53.503673411 +0900
> +++ linux-hirofumi/drivers/nfc/port100.c	2016-12-18 22:16:53.504673416 +0900
> @@ -21,8 +21,9 @@
>  
>  #define VERSION "0.1"
>  
> -#define SONY_VENDOR_ID    0x054c
> -#define RCS380_PRODUCT_ID 0x06c1
> +#define SONY_VENDOR_ID		0x054c
> +#define RCS380S_PRODUCT_ID	0x06c1
> +#define RCS380P_PRODUCT_ID	0x06c3
>  
>  #define PORT100_PROTOCOLS (NFC_PROTO_JEWEL_MASK    | \
>  			   NFC_PROTO_MIFARE_MASK   | \
> @@ -1477,7 +1478,8 @@ static struct nfc_digital_ops port100_di
>  };
>  
>  static const struct usb_device_id port100_table[] = {
> -	{ USB_DEVICE(SONY_VENDOR_ID, RCS380_PRODUCT_ID), },
> +	{ USB_DEVICE(SONY_VENDOR_ID, RCS380S_PRODUCT_ID), },
> +	{ USB_DEVICE(SONY_VENDOR_ID, RCS380P_PRODUCT_ID), },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(usb, port100_table);
> _

-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply

* Re: [PATCHv2 3/4] cfg80211: Add Support set btcoex priority value
From: kbuild test robot @ 2017-02-25 15:12 UTC (permalink / raw)
  To: c_traja; +Cc: kbuild-all, linux-wireless, johannes, ath10k, Tamizh chelvam
In-Reply-To: <1488029873-14600-4-git-send-email-c_traja@qti.qualcomm.com>

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

Hi Tamizh,

[auto build test ERROR on mac80211-next/master]
[also build test ERROR on next-20170224]
[cannot apply to v4.10]
[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/c_traja-qti-qualcomm-com/cfg80211-mac80211-BTCOEX-feature-support/20170225-215733
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
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=sparc64 

Note: the linux-review/c_traja-qti-qualcomm-com/cfg80211-mac80211-BTCOEX-feature-support/20170225-215733 HEAD 375b0104c717b355c9c35350bd9a7d34cb05f4bb builds fine.
      It only hurts bisectibility.

All errors (new ones prefixed by >>):

>> net/mac80211/cfg.c:3703:16: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     .set_btcoex = ieee80211_set_btcoex,
                   ^~~~~~~~~~~~~~~~~~~~
   net/mac80211/cfg.c:3703:16: note: (near initialization for 'mac80211_config_ops.set_btcoex')
   cc1: some warnings being treated as errors

vim +3703 net/mac80211/cfg.c

6d52563f2b net/mac80211/cfg.c           Johannes Berg    2012-04-04  3687  #ifdef CONFIG_PM
6d52563f2b net/mac80211/cfg.c           Johannes Berg    2012-04-04  3688  	.set_wakeup = ieee80211_set_wakeup,
6d52563f2b net/mac80211/cfg.c           Johannes Berg    2012-04-04  3689  #endif
5b7ccaf3fc net/mac80211/cfg.c           Johannes Berg    2012-07-12  3690  	.get_channel = ieee80211_cfg_get_channel,
164eb02d07 net/mac80211/cfg.c           Simon Wunderlich 2013-02-08  3691  	.start_radar_detection = ieee80211_start_radar_detection,
73da7d5bab net/mac80211/cfg.c           Simon Wunderlich 2013-07-11  3692  	.channel_switch = ieee80211_channel_switch,
32db6b54df net/mac80211/cfg.c           Kyeyoon Park     2013-12-16  3693  	.set_qos_map = ieee80211_set_qos_map,
3b1700bde4 net/mac80211/cfg.c           Jouni Malinen    2014-04-28  3694  	.set_ap_chanwidth = ieee80211_set_ap_chanwidth,
02219b3abc net/mac80211/cfg.c           Johannes Berg    2014-10-07  3695  	.add_tx_ts = ieee80211_add_tx_ts,
02219b3abc net/mac80211/cfg.c           Johannes Berg    2014-10-07  3696  	.del_tx_ts = ieee80211_del_tx_ts,
708d50edb1 net/mac80211/cfg.c           Ayala Beker      2016-09-20  3697  	.start_nan = ieee80211_start_nan,
708d50edb1 net/mac80211/cfg.c           Ayala Beker      2016-09-20  3698  	.stop_nan = ieee80211_stop_nan,
5953ff6d6a net/mac80211/cfg.c           Ayala Beker      2016-09-20  3699  	.nan_change_conf = ieee80211_nan_change_conf,
167e33f4f6 net/mac80211/cfg.c           Ayala Beker      2016-09-20  3700  	.add_nan_func = ieee80211_add_nan_func,
167e33f4f6 net/mac80211/cfg.c           Ayala Beker      2016-09-20  3701  	.del_nan_func = ieee80211_del_nan_func,
ebceec860f net/mac80211/cfg.c           Michael Braun    2016-11-22  3702  	.set_multicast_to_unicast = ieee80211_set_multicast_to_unicast,
8eb981c618 net/mac80211/cfg.c           Tamizh chelvam   2017-02-25 @3703  	.set_btcoex = ieee80211_set_btcoex,
f0706e828e net/mac80211/ieee80211_cfg.c Jiri Benc        2007-05-05  3704  };

:::::: The code at line 3703 was first introduced by commit
:::::: 8eb981c618fea1c068e64a61adc32c2149f5cfd8 mac80211: Add support to enable or disable btcoex

:::::: TO: Tamizh chelvam <c_traja@qti.qualcomm.com>
:::::: CC: 0day robot <fengguang.wu@intel.com>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 48666 bytes --]

^ permalink raw reply

* Re: [PATCHv2 1/4] cfg80211: Add support to enable or disable btcoex
From: kbuild test robot @ 2017-02-25 14:48 UTC (permalink / raw)
  To: c_traja; +Cc: kbuild-all, linux-wireless, johannes, ath10k, Tamizh chelvam
In-Reply-To: <1488029873-14600-2-git-send-email-c_traja@qti.qualcomm.com>

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

Hi Tamizh,

[auto build test WARNING on mac80211-next/master]
[also build test WARNING on next-20170224]
[cannot apply to v4.10]
[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/c_traja-qti-qualcomm-com/cfg80211-mac80211-BTCOEX-feature-support/20170225-215733
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-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=xtensa 

All warnings (new ones prefixed by >>):

   In file included from include/trace/define_trace.h:95:0,
                    from net/wireless/trace.h:3116,
                    from net/wireless/trace.c:5:
   net/wireless/./trace.h: In function 'trace_raw_output_rdev_set_btcoex':
>> include/trace/trace_events.h:323:9: warning: too many arguments for format [-Wformat-extra-args]
     struct trace_event_raw_##call *field;    \
            ^
   include/trace/trace_events.h:60:2: note: in expansion of macro 'DECLARE_EVENT_CLASS'
     DECLARE_EVENT_CLASS(name,          \
     ^
   net/wireless/./trace.h:3072:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(rdev_set_btcoex,
    ^

vim +323 include/trace/trace_events.h

6ea22486 include/trace/ftrace.h       Dave Martin              2015-01-28  307  #undef __print_array
6ea22486 include/trace/ftrace.h       Dave Martin              2015-01-28  308  #define __print_array(array, count, el_size)				\
6ea22486 include/trace/ftrace.h       Dave Martin              2015-01-28  309  	({								\
6ea22486 include/trace/ftrace.h       Dave Martin              2015-01-28  310  		BUILD_BUG_ON(el_size != 1 && el_size != 2 &&		\
6ea22486 include/trace/ftrace.h       Dave Martin              2015-01-28  311  			     el_size != 4 && el_size != 8);		\
645df987 include/trace/trace_events.h Steven Rostedt (Red Hat  2015-05-04  312) 		trace_print_array_seq(p, array, count, el_size);	\
6ea22486 include/trace/ftrace.h       Dave Martin              2015-01-28  313  	})
6ea22486 include/trace/ftrace.h       Dave Martin              2015-01-28  314  
091ad365 include/trace/ftrace.h       Ingo Molnar              2009-11-26  315  #undef DECLARE_EVENT_CLASS
091ad365 include/trace/ftrace.h       Ingo Molnar              2009-11-26  316  #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)	\
83f0d539 include/trace/ftrace.h       Steven Rostedt           2010-02-16  317  static notrace enum print_line_t					\
892c505a include/trace/trace_events.h Steven Rostedt (Red Hat  2015-05-05  318) trace_raw_output_##call(struct trace_iterator *iter, int flags,		\
80decc70 include/trace/ftrace.h       Steven Rostedt           2010-04-23  319  			struct trace_event *trace_event)		\
f42c85e7 include/trace/ftrace.h       Steven Rostedt           2009-04-13  320  {									\
f42c85e7 include/trace/ftrace.h       Steven Rostedt           2009-04-13  321  	struct trace_seq *s = &iter->seq;				\
f71130de include/trace/ftrace.h       Li Zefan                 2013-02-21  322  	struct trace_seq __maybe_unused *p = &iter->tmp_seq;		\
a7237765 include/trace/trace_events.h Steven Rostedt (Red Hat  2015-05-13 @323) 	struct trace_event_raw_##call *field;				\
f42c85e7 include/trace/ftrace.h       Steven Rostedt           2009-04-13  324  	int ret;							\
f42c85e7 include/trace/ftrace.h       Steven Rostedt           2009-04-13  325  									\
f71130de include/trace/ftrace.h       Li Zefan                 2013-02-21  326  	field = (typeof(field))iter->ent;				\
80decc70 include/trace/ftrace.h       Steven Rostedt           2010-04-23  327  									\
892c505a include/trace/trace_events.h Steven Rostedt (Red Hat  2015-05-05  328) 	ret = trace_raw_output_prep(iter, trace_event);			\
8e2e095c include/trace/ftrace.h       Steven Rostedt (Red Hat  2014-11-14  329) 	if (ret != TRACE_TYPE_HANDLED)					\
f71130de include/trace/ftrace.h       Li Zefan                 2013-02-21  330  		return ret;						\
f71130de include/trace/ftrace.h       Li Zefan                 2013-02-21  331  									\

:::::: The code at line 323 was first introduced by commit
:::::: a7237765730a10d429736f47ac4b89779ec6c534 tracing: Rename ftrace_raw_##call event structures to trace_event_raw_##call

:::::: TO: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
:::::: CC: Steven Rostedt <rostedt@goodmis.org>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 48197 bytes --]

^ permalink raw reply

* Re: [PATCHv2 1/4] cfg80211: Add support to enable or disable btcoex
From: kbuild test robot @ 2017-02-25 14:48 UTC (permalink / raw)
  To: c_traja; +Cc: kbuild-all, linux-wireless, johannes, ath10k, Tamizh chelvam
In-Reply-To: <1488029873-14600-2-git-send-email-c_traja@qti.qualcomm.com>

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

Hi Tamizh,

[auto build test WARNING on mac80211-next/master]
[also build test WARNING on next-20170224]
[cannot apply to v4.10]
[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/c_traja-qti-qualcomm-com/cfg80211-mac80211-BTCOEX-feature-support/20170225-215733
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: i386-randconfig-x003-201708 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/trace/define_trace.h:95:0,
                    from net/wireless/trace.h:3116,
                    from net/wireless/trace.c:5:
   net/wireless/./trace.h: In function 'trace_raw_output_rdev_set_btcoex':
>> net/wireless/./trace.h:27:22: warning: too many arguments for format [-Wformat-extra-args]
    #define WIPHY_PR_FMT "%s"
                         ^
   include/trace/trace_events.h:332:22: note: in definition of macro 'DECLARE_EVENT_CLASS'
     trace_seq_printf(s, print);     \
                         ^~~~~
   include/trace/trace_events.h:65:9: note: in expansion of macro 'PARAMS'
            PARAMS(print));         \
            ^~~~~~
>> net/wireless/./trace.h:3072:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(rdev_set_btcoex,
    ^~~~~~~~~~~
>> net/wireless/./trace.h:3083:2: note: in expansion of macro 'TP_printk'
     TP_printk(WIPHY_PR_FMT, ", enabled=%d",
     ^~~~~~~~~
>> net/wireless/./trace.h:3083:12: note: in expansion of macro 'WIPHY_PR_FMT'
     TP_printk(WIPHY_PR_FMT, ", enabled=%d",
               ^~~~~~~~~~~~

vim +27 net/wireless/./trace.h

14e8a3c4 Beni Lev      2012-07-31  11  #include <net/cfg80211.h>
14e8a3c4 Beni Lev      2012-07-31  12  #include "core.h"
14e8a3c4 Beni Lev      2012-07-31  13  
14e8a3c4 Beni Lev      2012-07-31  14  #define MAC_ENTRY(entry_mac) __array(u8, entry_mac, ETH_ALEN)
14e8a3c4 Beni Lev      2012-07-31  15  #define MAC_ASSIGN(entry_mac, given_mac) do {			     \
14e8a3c4 Beni Lev      2012-07-31  16  	if (given_mac)						     \
14e8a3c4 Beni Lev      2012-07-31  17  		memcpy(__entry->entry_mac, given_mac, ETH_ALEN);     \
14e8a3c4 Beni Lev      2012-07-31  18  	else							     \
d2beae10 Joe Perches   2015-03-02  19  		eth_zero_addr(__entry->entry_mac);		     \
14e8a3c4 Beni Lev      2012-07-31  20  	} while (0)
14e8a3c4 Beni Lev      2012-07-31  21  #define MAC_PR_FMT "%pM"
14e8a3c4 Beni Lev      2012-07-31  22  #define MAC_PR_ARG(entry_mac) (__entry->entry_mac)
14e8a3c4 Beni Lev      2012-07-31  23  
ec816087 Johannes Berg 2012-11-16  24  #define MAXNAME		32
ec816087 Johannes Berg 2012-11-16  25  #define WIPHY_ENTRY	__array(char, wiphy_name, 32)
ec816087 Johannes Berg 2012-11-16  26  #define WIPHY_ASSIGN	strlcpy(__entry->wiphy_name, wiphy_name(wiphy), MAXNAME)
ec816087 Johannes Berg 2012-11-16 @27  #define WIPHY_PR_FMT	"%s"
ec816087 Johannes Berg 2012-11-16  28  #define WIPHY_PR_ARG	__entry->wiphy_name
14e8a3c4 Beni Lev      2012-07-31  29  
14e8a3c4 Beni Lev      2012-07-31  30  #define WDEV_ENTRY	__field(u32, id)
ce1eadda Johannes Berg 2013-03-19  31  #define WDEV_ASSIGN	(__entry->id) = (!IS_ERR_OR_NULL(wdev)	\
ce1eadda Johannes Berg 2013-03-19  32  					 ? wdev->identifier : 0)
ec816087 Johannes Berg 2012-11-16  33  #define WDEV_PR_FMT	"wdev(%u)"
14e8a3c4 Beni Lev      2012-07-31  34  #define WDEV_PR_ARG	(__entry->id)
14e8a3c4 Beni Lev      2012-07-31  35  

:::::: The code at line 27 was first introduced by commit
:::::: ec816087e8978b74c1bd5fae0e335dd97d964e9f cfg80211: fix some tracing output issues

:::::: TO: Johannes Berg <johannes.berg@intel.com>
:::::: CC: Johannes Berg <johannes.berg@intel.com>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25975 bytes --]

^ permalink raw reply

* Re: [PATCHv2 0/4] cfg80211: mac80211: BTCOEX feature support
From: Arend Van Spriel @ 2017-02-25 14:41 UTC (permalink / raw)
  To: c_traja, linux-wireless; +Cc: johannes, ath10k
In-Reply-To: <1488029873-14600-1-git-send-email-c_traja@qti.qualcomm.com>

On 25-2-2017 14:37, c_traja@qti.qualcomm.com wrote:
> From: Tamizh chelvam <c_traja@qti.qualcomm.com>
> 
> This patchset add support for BTCOEX feature to enable/disable and
> modifying btcoex priority value via nl80211
> 
> Tamizh chelvam (4):
>   ath10k: Add support to enable or disable btcoex via nl80211
>   ath10k: Add support to update btcoex priority value via nl80211
>   dt: bindings: add new dt entry for BTCOEX feature in qcom,ath10k.txt
>   ath10k: Add support to read btcoex related data from DT

This cover letter does not seem to reflect the other patches that were
sent to the wireless list as those are about cfg80211/mac80211; not ath10k?

Regards,
Arend

> v2 :
>   * Introduced NL80211_CMD_SET_BTCOEX to enable/disable btcoex and
>     to set/modify btcoex_priority.
>   * Added bool variable in wiphy structure to advertise btcoex_priority
>     feature and removed BITMAP calculation for btcoex_priority value.
>  
>  .../bindings/net/wireless/qcom,ath10k.txt          |    4 +
>  drivers/net/wireless/ath/ath10k/core.c             |   44 ++++++++-
>  drivers/net/wireless/ath/ath10k/core.h             |    9 ++
>  drivers/net/wireless/ath/ath10k/debug.c            |   40 ++-------
>  drivers/net/wireless/ath/ath10k/mac.c              |   94 +++++++++++++++++++-
>  drivers/net/wireless/ath/ath10k/mac.h              |    1 +
>  drivers/net/wireless/ath/ath10k/wmi-ops.h          |   19 ++++
>  drivers/net/wireless/ath/ath10k/wmi.c              |   20 +++++
>  drivers/net/wireless/ath/ath10k/wmi.h              |   20 +++++
>  9 files changed, 215 insertions(+), 36 deletions(-)
> 

^ permalink raw reply

* [PATCHv2 2/4] mac80211: Add support to enable or disable btcoex
From: c_traja @ 2017-02-25 13:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, ath10k, Tamizh chelvam
In-Reply-To: <1488029873-14600-1-git-send-email-c_traja@qti.qualcomm.com>

From: Tamizh chelvam <c_traja@qti.qualcomm.com>

This patch introduces a new driver call back drv_set_btcoex
This API will pass user space value to driver to
enable or disabe btcoex.

Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
---
 include/net/mac80211.h    |    3 +++
 net/mac80211/cfg.c        |    8 ++++++++
 net/mac80211/driver-ops.h |   14 ++++++++++++++
 net/mac80211/trace.h      |   14 ++++++++++++++
 4 files changed, 39 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index b9a08cd..57717f1 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3447,6 +3447,8 @@ enum ieee80211_reconfig_type {
  * @del_nan_func: Remove a NAN function. The driver must call
  *	ieee80211_nan_func_terminated() with
  *	NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST reason code upon removal.
+ * @set_btcoex_: Called when BTCOEX is enabled/disabled, use
+ *     this callback to enable or disable btcoex.
  */
 struct ieee80211_ops {
 	void (*tx)(struct ieee80211_hw *hw,
@@ -3728,6 +3730,7 @@ struct ieee80211_ops {
 	void (*del_nan_func)(struct ieee80211_hw *hw,
 			    struct ieee80211_vif *vif,
 			    u8 instance_id);
+	int (*set_btcoex)(struct ieee80211_hw *hw, bool enabled);
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index ac879bb..7e17eff 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3574,6 +3574,13 @@ static int ieee80211_set_multicast_to_unicast(struct wiphy *wiphy,
 	return 0;
 }
 
+static int ieee80211_set_btcoex(struct wiphy *wiphy, bool enabled)
+{
+	struct ieee80211_local *local = wiphy_priv(wiphy);
+
+	return drv_set_btcoex(local, enabled);
+}
+
 const struct cfg80211_ops mac80211_config_ops = {
 	.add_virtual_intf = ieee80211_add_iface,
 	.del_virtual_intf = ieee80211_del_iface,
@@ -3665,4 +3672,5 @@ static int ieee80211_set_multicast_to_unicast(struct wiphy *wiphy,
 	.add_nan_func = ieee80211_add_nan_func,
 	.del_nan_func = ieee80211_del_nan_func,
 	.set_multicast_to_unicast = ieee80211_set_multicast_to_unicast,
+	.set_btcoex = ieee80211_set_btcoex,
 };
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 09f77e4..16d9c98 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1248,4 +1248,18 @@ static inline void drv_del_nan_func(struct ieee80211_local *local,
 	trace_drv_return_void(local);
 }
 
+static inline int drv_set_btcoex(struct ieee80211_local *local,
+				 bool enabled)
+{
+	int ret = -EOPNOTSUPP;
+
+	trace_drv_set_btcoex(local, enabled);
+	if (local->ops->set_btcoex)
+		ret = local->ops->set_btcoex(&local->hw, enabled);
+
+	trace_drv_return_int(local, ret);
+
+	return ret;
+}
+
 #endif /* __MAC80211_DRIVER_OPS */
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 0d645bc..0d9b5a0 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -742,6 +742,20 @@
 	TP_ARGS(local, value)
 );
 
+TRACE_EVENT(drv_set_btcoex,
+	TP_PROTO(struct ieee80211_local *local, bool enabled),
+	TP_ARGS(local, enabled),
+	TP_STRUCT__entry(
+		LOCAL_ENTRY
+		__field(bool, enabled)
+	),
+	TP_fast_assign(
+		LOCAL_ASSIGN;
+		__entry->enabled = enabled;
+	),
+	TP_printk(LOCAL_PR_FMT " enabled:%d", LOCAL_PR_ARG, __entry->enabled)
+);
+
 TRACE_EVENT(drv_set_coverage_class,
 	TP_PROTO(struct ieee80211_local *local, s16 value),
 
-- 
1.7.9.5

^ permalink raw reply related

* [PATCHv2 1/4] cfg80211: Add support to enable or disable btcoex
From: c_traja @ 2017-02-25 13:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, ath10k, Tamizh chelvam
In-Reply-To: <1488029873-14600-1-git-send-email-c_traja@qti.qualcomm.com>

From: Tamizh chelvam <c_traja@qti.qualcomm.com>

This patch introduces NL80211_CMD_SET_BTCOEX command and
NL80211_ATTR_BTCOEX_OP attribute to enable or disable btcoex.

Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
---
 include/net/cfg80211.h       |    3 +++
 include/uapi/linux/nl80211.h |    9 +++++++++
 net/wireless/nl80211.c       |   31 +++++++++++++++++++++++++++++++
 net/wireless/rdev-ops.h      |   11 +++++++++++
 net/wireless/trace.h         |   15 +++++++++++++++
 5 files changed, 69 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index c92dc03..a9aae03 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2816,6 +2816,8 @@ struct cfg80211_nan_func {
  *	All other parameters must be ignored.
  *
  * @set_multicast_to_unicast: configure multicast to unicast conversion for BSS
+ * @set_btcoex: Use this callback to call driver API when user wants to
+ *	enable/disable btcoex.
  */
 struct cfg80211_ops {
 	int	(*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -3100,6 +3102,7 @@ struct cfg80211_ops {
 	int	(*set_multicast_to_unicast)(struct wiphy *wiphy,
 					    struct net_device *dev,
 					    const bool enabled);
+	int     (*set_btcoex)(struct wiphy *wiphy, bool enabled);
 };
 
 /*
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 5ed257c..30d691f 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -900,6 +900,8 @@
  *	BSS selection. This command can be issued only while connected and it
  *	does not result in a change for the current association. Currently,
  *	only the %NL80211_ATTR_IE data is used and updated with this command.
+ * @NL80211_CMD_SET_BTCOEX: Enable/Disable btcoex using
+ *	%NL80211_ATTR_SET_BTCOEX
  *
  * @NL80211_CMD_MAX: highest used command number
  * @__NL80211_CMD_AFTER_LAST: internal use
@@ -1100,6 +1102,8 @@ enum nl80211_commands {
 
 	NL80211_CMD_UPDATE_CONNECT_PARAMS,
 
+	NL80211_CMD_SET_BTCOEX,
+
 	/* add new commands above here */
 
 	/* used to define NL80211_CMD_MAX below */
@@ -2011,6 +2015,9 @@ enum nl80211_commands {
  * @NL80211_ATTR_TIMEOUT_REASON: The reason for which an operation timed out.
  *	u32 attribute with an &enum nl80211_timeout_reason value. This is used,
  *	e.g., with %NL80211_CMD_CONNECT event.
+ * @NL80211_ATTR_BTCOEX_OP: u8 attribute for driver supporting
+ *     the btcoex feature. When used with %NL80211_CMD_SET_BTCOEX it contains
+ *     either 0 for disable or 1 for enable btcoex.
  *
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
@@ -2423,6 +2430,8 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_TIMEOUT_REASON,
 
+	NL80211_ATTR_BTCOEX_OP,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d7f8be4..bd203c2 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -410,6 +410,7 @@ enum nl80211_multicast_groups {
 		.len = sizeof(struct nl80211_bss_select_rssi_adjust)
 	},
 	[NL80211_ATTR_TIMEOUT_REASON] = { .type = NLA_U32 },
+	[NL80211_ATTR_BTCOEX_OP] = { .type = NLA_U8 },
 };
 
 /* policy for the key attributes */
@@ -11966,6 +11967,28 @@ static int nl80211_set_multicast_to_unicast(struct sk_buff *skb,
 	return rdev_set_multicast_to_unicast(rdev, dev, enabled);
 }
 
+static int nl80211_set_btcoex(struct sk_buff *skb, struct genl_info *info)
+{
+	struct cfg80211_registered_device *rdev = info->user_ptr[0];
+	u8 val = 0;
+
+	if (!rdev->ops->set_btcoex)
+		return -ENOTSUPP;
+
+	if(!(info->attrs[NL80211_ATTR_BTCOEX_OP]))
+		goto set_btcoex;
+
+	if (info->attrs[NL80211_ATTR_BTCOEX_OP])
+		val = nla_get_u8(info->attrs[NL80211_ATTR_BTCOEX_OP]);
+
+	if (val > 1)
+		return -EINVAL;
+
+
+set_btcoex:
+	return rdev_set_btcoex(rdev, val);
+}
+
 #define NL80211_FLAG_NEED_WIPHY		0x01
 #define NL80211_FLAG_NEED_NETDEV	0x02
 #define NL80211_FLAG_NEED_RTNL		0x04
@@ -12841,6 +12864,14 @@ static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb,
 		.internal_flags = NL80211_FLAG_NEED_NETDEV |
 				  NL80211_FLAG_NEED_RTNL,
 	},
+	{
+		.cmd = NL80211_CMD_SET_BTCOEX,
+		.doit = nl80211_set_btcoex,
+		.policy = nl80211_policy,
+		.flags = GENL_UNS_ADMIN_PERM,
+		.internal_flags = NL80211_FLAG_NEED_WIPHY |
+				  NL80211_FLAG_NEED_RTNL,
+	},
 };
 
 static struct genl_family nl80211_fam __ro_after_init = {
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 2f42507..6592f14 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -1153,4 +1153,15 @@ static inline int rdev_set_qos_map(struct cfg80211_registered_device *rdev,
 	trace_rdev_return_int(&rdev->wiphy, ret);
 	return ret;
 }
+
+static inline int
+rdev_set_btcoex(struct cfg80211_registered_device *rdev, bool enabled)
+{
+	int ret = -ENOTSUPP;
+
+	trace_rdev_set_btcoex(&rdev->wiphy, enabled);
+	ret = rdev->ops->set_btcoex(&rdev->wiphy, enabled);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
+}
 #endif /* __CFG80211_RDEV_OPS */
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 776e80c..c3970b1 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -3047,6 +3047,21 @@
 		  WIPHY_PR_ARG, __entry->n_rules)
 );
 
+TRACE_EVENT(rdev_set_btcoex,
+	TP_PROTO(struct wiphy *wiphy, bool enabled),
+	TP_ARGS(wiphy, enabled),
+	TP_STRUCT__entry(
+		WIPHY_ENTRY
+		__field(bool, enabled)
+	),
+	TP_fast_assign(
+		WIPHY_ASSIGN;
+		__entry->enabled = enabled;
+	),
+	TP_printk(WIPHY_PR_FMT, ", enabled=%d",
+		  WIPHY_PR_ARG, __entry->enabled)
+);
+
 DEFINE_EVENT(wiphy_wdev_evt, rdev_abort_scan,
 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
 	TP_ARGS(wiphy, wdev)
-- 
1.7.9.5

^ permalink raw reply related

* [PATCHv2 0/4] cfg80211: mac80211: BTCOEX feature support
From: c_traja @ 2017-02-25 13:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, ath10k, Tamizh chelvam

From: Tamizh chelvam <c_traja@qti.qualcomm.com>

This patchset add support for BTCOEX feature to enable/disable and
modifying btcoex priority value via nl80211

Tamizh chelvam (4):
  ath10k: Add support to enable or disable btcoex via nl80211
  ath10k: Add support to update btcoex priority value via nl80211
  dt: bindings: add new dt entry for BTCOEX feature in qcom,ath10k.txt
  ath10k: Add support to read btcoex related data from DT

v2 :
  * Introduced NL80211_CMD_SET_BTCOEX to enable/disable btcoex and
    to set/modify btcoex_priority.
  * Added bool variable in wiphy structure to advertise btcoex_priority
    feature and removed BITMAP calculation for btcoex_priority value.
 
 .../bindings/net/wireless/qcom,ath10k.txt          |    4 +
 drivers/net/wireless/ath/ath10k/core.c             |   44 ++++++++-
 drivers/net/wireless/ath/ath10k/core.h             |    9 ++
 drivers/net/wireless/ath/ath10k/debug.c            |   40 ++-------
 drivers/net/wireless/ath/ath10k/mac.c              |   94 +++++++++++++++++++-
 drivers/net/wireless/ath/ath10k/mac.h              |    1 +
 drivers/net/wireless/ath/ath10k/wmi-ops.h          |   19 ++++
 drivers/net/wireless/ath/ath10k/wmi.c              |   20 +++++
 drivers/net/wireless/ath/ath10k/wmi.h              |   20 +++++
 9 files changed, 215 insertions(+), 36 deletions(-)

-- 
1.7.9.5

^ permalink raw reply

* [PATCHv2 4/4] mac80211: Add support to set/update btcoex priority value
From: c_traja @ 2017-02-25 13:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, ath10k, Tamizh chelvam
In-Reply-To: <1488029873-14600-1-git-send-email-c_traja@qti.qualcomm.com>

From: Tamizh chelvam <c_traja@qti.qualcomm.com>

This patch add support to set or modify the btcoex priority value
for the driver which has btcoex priority feature support.

Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
---
 include/net/mac80211.h    |    6 ++++--
 net/mac80211/cfg.c        |    5 +++--
 net/mac80211/driver-ops.h |    7 ++++---
 net/mac80211/trace.h      |   12 +++++++++---
 4 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 57717f1..33890b4 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3448,7 +3448,8 @@ enum ieee80211_reconfig_type {
  *	ieee80211_nan_func_terminated() with
  *	NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST reason code upon removal.
  * @set_btcoex_: Called when BTCOEX is enabled/disabled, use
- *     this callback to enable or disable btcoex.
+ *     this callback to enable or disable btcoex and use this callback to
+ *     set btcoex_priority. BTCOEX should be enabled to set this priority.
  */
 struct ieee80211_ops {
 	void (*tx)(struct ieee80211_hw *hw,
@@ -3730,7 +3731,8 @@ struct ieee80211_ops {
 	void (*del_nan_func)(struct ieee80211_hw *hw,
 			    struct ieee80211_vif *vif,
 			    u8 instance_id);
-	int (*set_btcoex)(struct ieee80211_hw *hw, bool enabled);
+	int (*set_btcoex)(struct ieee80211_hw *hw, bool enabled,
+			  int btcoex_priority);
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 7e17eff..c640e7d 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3574,11 +3574,12 @@ static int ieee80211_set_multicast_to_unicast(struct wiphy *wiphy,
 	return 0;
 }
 
-static int ieee80211_set_btcoex(struct wiphy *wiphy, bool enabled)
+static int ieee80211_set_btcoex(struct wiphy *wiphy, bool enabled,
+				int btcoex_priority)
 {
 	struct ieee80211_local *local = wiphy_priv(wiphy);
 
-	return drv_set_btcoex(local, enabled);
+	return drv_set_btcoex(local, enabled, btcoex_priority);
 }
 
 const struct cfg80211_ops mac80211_config_ops = {
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 16d9c98..3826202 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1249,13 +1249,14 @@ static inline void drv_del_nan_func(struct ieee80211_local *local,
 }
 
 static inline int drv_set_btcoex(struct ieee80211_local *local,
-				 bool enabled)
+				 bool enabled, int btcoex_priority)
 {
 	int ret = -EOPNOTSUPP;
 
-	trace_drv_set_btcoex(local, enabled);
+	trace_drv_set_btcoex(local, enabled, btcoex_priority);
 	if (local->ops->set_btcoex)
-		ret = local->ops->set_btcoex(&local->hw, enabled);
+		ret = local->ops->set_btcoex(&local->hw, enabled,
+					     btcoex_priority);
 
 	trace_drv_return_int(local, ret);
 
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 0d9b5a0..c3efca9 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -743,17 +743,23 @@
 );
 
 TRACE_EVENT(drv_set_btcoex,
-	TP_PROTO(struct ieee80211_local *local, bool enabled),
-	TP_ARGS(local, enabled),
+	TP_PROTO(struct ieee80211_local *local, bool enabled,
+		 int btcoex_priority),
+	TP_ARGS(local, enabled, btcoex_priority),
 	TP_STRUCT__entry(
 		LOCAL_ENTRY
 		__field(bool, enabled)
+		__field(int, btcoex_priority)
 	),
 	TP_fast_assign(
 		LOCAL_ASSIGN;
 		__entry->enabled = enabled;
+		__entry->btcoex_priority = btcoex_priority;
 	),
-	TP_printk(LOCAL_PR_FMT " enabled:%d", LOCAL_PR_ARG, __entry->enabled)
+	TP_printk(
+		LOCAL_PR_FMT " enabled:%d btcoex_priority :%d",
+		LOCAL_PR_ARG, __entry->enabled, __entry->btcoex_priority
+	)
 );
 
 TRACE_EVENT(drv_set_coverage_class,
-- 
1.7.9.5

^ permalink raw reply related

* [PATCHv2 3/4] cfg80211: Add Support set btcoex priority value
From: c_traja @ 2017-02-25 13:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, ath10k, Tamizh chelvam
In-Reply-To: <1488029873-14600-1-git-send-email-c_traja@qti.qualcomm.com>

From: Tamizh chelvam <c_traja@qti.qualcomm.com>

This change enables user to set btcoex priority by using
NL80211_ATTR_BTCOEX_PRIORITY attribute for the driver which
has the btcoex priority capability. Driver should expose such
capability and make use of this priority to decide whom to share the radio
(either bluetooth or WLAN). When the high priority wlan frames are queued
driver or firmware will signal to block BT activity.
Capable drivers should advertise this support through
btcoex_priority_support.

This will be useful to avoid connection lost or packet drop
issue when BT is active on long time.

Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
---
 include/net/cfg80211.h       |   10 ++++++++--
 include/uapi/linux/nl80211.h |    7 +++++++
 net/wireless/nl80211.c       |   16 +++++++++++++++-
 net/wireless/rdev-ops.h      |    8 +++++---
 net/wireless/trace.h         |   10 ++++++----
 5 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index a9aae03..3f44aac 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2817,7 +2817,10 @@ struct cfg80211_nan_func {
  *
  * @set_multicast_to_unicast: configure multicast to unicast conversion for BSS
  * @set_btcoex: Use this callback to call driver API when user wants to
- *	enable/disable btcoex.
+ *	enable/disable btcoex and use this callback to set wlan high priority over
+ *	Bluetooth. This capability will be exposed by the driver using
+ *	btcoex_priority_support boolean flag. When BTCOEX enabled,
+ *	the high priority wlan frames will have more priority than BT.
  */
 struct cfg80211_ops {
 	int	(*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -3102,7 +3105,8 @@ struct cfg80211_ops {
 	int	(*set_multicast_to_unicast)(struct wiphy *wiphy,
 					    struct net_device *dev,
 					    const bool enabled);
-	int     (*set_btcoex)(struct wiphy *wiphy, bool enabled);
+	int     (*set_btcoex)(struct wiphy *wiphy, bool enabled,
+			      int btcoex_priority);
 };
 
 /*
@@ -3738,6 +3742,8 @@ struct wiphy {
 
 	u8 nan_supported_bands;
 
+	bool btcoex_priority_support;
+
 	char priv[0] __aligned(NETDEV_ALIGN);
 };
 
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 30d691f..94b6eff 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2019,6 +2019,12 @@ enum nl80211_commands {
  *     the btcoex feature. When used with %NL80211_CMD_SET_BTCOEX it contains
  *     either 0 for disable or 1 for enable btcoex.
  *
+ * @NL80211_ATTR_BTCOEX_PRIORITY: This is for the driver which
+ *     support btcoex priority feature. It used with %NL80211_CMD_SET_BTCOEX.
+ *     This will have u32 BITMAP value which represents
+ *     frame(bk, be, vi, vo, mgmt, beacon) type and that will have more
+ *     priority than a BT traffic.
+ *
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2431,6 +2437,7 @@ enum nl80211_attrs {
 	NL80211_ATTR_TIMEOUT_REASON,
 
 	NL80211_ATTR_BTCOEX_OP,
+	NL80211_ATTR_BTCOEX_PRIORITY,
 
 	/* add attributes here, update the policy in nl80211.c */
 
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index bd203c2..56518c4 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -411,6 +411,7 @@ enum nl80211_multicast_groups {
 	},
 	[NL80211_ATTR_TIMEOUT_REASON] = { .type = NLA_U32 },
 	[NL80211_ATTR_BTCOEX_OP] = { .type = NLA_U8 },
+	[NL80211_ATTR_BTCOEX_PRIORITY] = { .type = NLA_U32 },
 };
 
 /* policy for the key attributes */
@@ -11970,7 +11971,9 @@ static int nl80211_set_multicast_to_unicast(struct sk_buff *skb,
 static int nl80211_set_btcoex(struct sk_buff *skb, struct genl_info *info)
 {
 	struct cfg80211_registered_device *rdev = info->user_ptr[0];
+	struct wiphy *wiphy = &rdev->wiphy;
 	u8 val = 0;
+	int btcoex_priority = -1;
 
 	if (!rdev->ops->set_btcoex)
 		return -ENOTSUPP;
@@ -11984,9 +11987,20 @@ static int nl80211_set_btcoex(struct sk_buff *skb, struct genl_info *info)
 	if (val > 1)
 		return -EINVAL;
 
+	if (wiphy->btcoex_priority_support)
+		btcoex_priority = 0;
+
+	if (info->attrs[NL80211_ATTR_BTCOEX_PRIORITY]) {
+		if (!wiphy->btcoex_priority_support)
+			return -EOPNOTSUPP;
+
+		btcoex_priority =
+		nla_get_u32(info->attrs[NL80211_ATTR_BTCOEX_PRIORITY]);
+
+	}
 
 set_btcoex:
-	return rdev_set_btcoex(rdev, val);
+	return rdev_set_btcoex(rdev, val, btcoex_priority);
 }
 
 #define NL80211_FLAG_NEED_WIPHY		0x01
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 6592f14..7c0c139 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -1155,13 +1155,15 @@ static inline int rdev_set_qos_map(struct cfg80211_registered_device *rdev,
 }
 
 static inline int
-rdev_set_btcoex(struct cfg80211_registered_device *rdev, bool enabled)
+rdev_set_btcoex(struct cfg80211_registered_device *rdev, bool enabled,
+		int btcoex_priority)
 {
 	int ret = -ENOTSUPP;
 
-	trace_rdev_set_btcoex(&rdev->wiphy, enabled);
-	ret = rdev->ops->set_btcoex(&rdev->wiphy, enabled);
+	trace_rdev_set_btcoex(&rdev->wiphy, enabled, btcoex_priority);
+	ret = rdev->ops->set_btcoex(&rdev->wiphy, enabled, btcoex_priority);
 	trace_rdev_return_int(&rdev->wiphy, ret);
 	return ret;
 }
+
 #endif /* __CFG80211_RDEV_OPS */
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index c3970b1..4f88f50 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -3048,18 +3048,20 @@
 );
 
 TRACE_EVENT(rdev_set_btcoex,
-	TP_PROTO(struct wiphy *wiphy, bool enabled),
-	TP_ARGS(wiphy, enabled),
+	TP_PROTO(struct wiphy *wiphy, bool enabled, int btcoex_priority),
+	TP_ARGS(wiphy, enabled, btcoex_priority),
 	TP_STRUCT__entry(
 		WIPHY_ENTRY
 		__field(bool, enabled)
+		__field(int, btcoex_priority)
 	),
 	TP_fast_assign(
 		WIPHY_ASSIGN;
 		__entry->enabled = enabled;
+		__entry->btcoex_priority = btcoex_priority;
 	),
-	TP_printk(WIPHY_PR_FMT, ", enabled=%d",
-		  WIPHY_PR_ARG, __entry->enabled)
+	TP_printk(WIPHY_PR_FMT, ", enabled=%d btcoex_priority :%d",
+		  WIPHY_PR_ARG, __entry->enabled, __entry->btcoex_priority)
 );
 
 DEFINE_EVENT(wiphy_wdev_evt, rdev_abort_scan,
-- 
1.7.9.5

^ permalink raw reply related

* Re: [Outreachy kernel] [PATCH v4 1/3] staging: wilc1000: Rename struct tstrRSSI to rssi_history_buffer
From: Julia Lawall @ 2017-02-25  6:37 UTC (permalink / raw)
  To: Tahia Khan
  Cc: outreachy-kernel, aditya.shankar, ganesh.krishna, gregkh,
	linux-wireless, devel, linux-kernel
In-Reply-To: <da73d1aef379243ba94a5c1a4e1d6663160451fd.1487947616.git.tahia.khan@gmail.com>



On Fri, 24 Feb 2017, Tahia Khan wrote:

> Rename struct tstrRSSI to rssi_history_buffer for clarity
> and to remove camel casing.
>
> Signed-off-by: Tahia Khan <tahia.khan@gmail.com>

Acked-by: Julia Lawall <julia.lawall@lip6.fr>


> ---
>  drivers/staging/wilc1000/coreconfigurator.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
> index cff1698..1c77529 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.h
> +++ b/drivers/staging/wilc1000/coreconfigurator.h
> @@ -70,7 +70,7 @@ enum connect_status {
>  	CONNECT_STS_FORCE_16_BIT = 0xFFFF
>  };
>
> -struct tstrRSSI {
> +struct rssi_history_buffer {
>  	u8 u8Full;
>  	u8 u8Index;
>  	s8 as8RSSI[NUM_RSSI];
> @@ -93,7 +93,7 @@ struct network_info {
>  	u8 *ies;
>  	u16 ies_len;
>  	void *join_params;
> -	struct tstrRSSI str_rssi;
> +	struct rssi_history_buffer str_rssi;
>  	u64 tsf_hi;
>  };
>
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/da73d1aef379243ba94a5c1a4e1d6663160451fd.1487947616.git.tahia.khan%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

^ permalink raw reply

* [PATCH v3] wireless-regdb: Update rules for Australia (AU) and add 60GHz rules
From: Ryan Mounce @ 2017-02-25  3:10 UTC (permalink / raw)
  To: seth.forshee; +Cc: wireless-regdb, linux-wireless
In-Reply-To: <20170224145519.GD3479@ubuntu-hedt>

Sourced from the current legislation at
https://www.legislation.gov.au/Details/F2016C00432

The current rules exceed legal limits between 5250-5330MHz, and permit
illegal operation in 5600-5650MHz (disallowed regardless of DFS).

Frequency ranges and EIRP limits for all ranges have been updated to
match items 59-63, 65 in the linked document. As the rules for AU have
never previously mirrored local regulations, changes include a
significant increase in the allowable 2.4GHz EIRP and smaller increases
in most other bands.

In order to allow 80MHz operation between 5650-5730MHz (bordering two
bands) the lower, more restrictive band has been rounded up by 5MHz.

Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
---
 db.txt | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/db.txt b/db.txt
index 05108e0..0f1e151 100644
--- a/db.txt
+++ b/db.txt
@@ -85,12 +85,20 @@ country AT: DFS-ETSI
 	# 60 GHz band channels 1-4, ref: Etsi En 302 567
 	(57000 - 66000 @ 2160), (40)
 
+# Source:
+# https://www.legislation.gov.au/Details/F2016C00432
+# Both DFS-ETSI and DFS-FCC are acceptable per AS/NZS 4268 Appendix B.
+# The EIRP for DFS bands can be increased by 3dB if TPC is implemented.
+# In order to allow 80MHz operation between 5650-5730MHz the upper boundary
+# of this more restrictive band has been shifted up by 5MHz from 5725MHz.
 country AU: DFS-ETSI
-	(2402 - 2482 @ 40), (20)
-	(5170 - 5250 @ 80), (17), AUTO-BW
-	(5250 - 5330 @ 80), (24), DFS, AUTO-BW
-	(5490 - 5710 @ 160), (24), DFS
-	(5735 - 5835 @ 80), (30)
+	(2400 - 2483.5 @ 40), (36)
+	(5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW
+	(5250 - 5350 @ 80), (20), NO-OUTDOOR, AUTO-BW, DFS
+	(5470 - 5600 @ 80), (27), DFS
+	(5650 - 5730 @ 80), (27), DFS
+	(5730 - 5850 @ 80), (36)
+	(57000 - 66000 @ 2160), (43), NO-OUTDOOR
 
 country AW: DFS-ETSI
 	(2402 - 2482 @ 40), (20)
-- 
2.11.0

^ permalink raw reply related

* [PATCH v4] ath10k: search SMBIOS for OEM board file extension
From: Waldemar Rymarkiewicz @ 2017-02-24 22:30 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, jouni, Waldemar Rymarkiewicz

Board Data File (BDF) is loaded upon driver boot-up procedure. The right
board data file is identified, among others, by device and sybsystem ids.

The problem, however, can occur when the (default) board data file cannot
fulfill with the vendor requirements and it is necessary to use a different
board data file.

To solve the issue QCA uses SMBIOS type 0xF8 to store Board Data File Name
Extension to specify the extension/variant name. The driver will take the
extension suffix into consideration and will load the right (non-default)
board data file if necessary.

If it is unnecessary to use extension board data file, please leave the
SMBIOS field blank and default configuration will be used.

Example:
If a default board data file for a specific board is identified by a string
      "bus=pci,vendor=168c,device=003e,subsystem-vendor=1028,
       subsystem-device=0310"
then the OEM specific data file, if used, could be identified by variant
suffix:
      "bus=pci,vendor=168c,device=003e,subsystem-vendor=1028,
       subsystem-device=0310,variant=DE_1AB"

If board data file name extension is set but board-2.bin does not contain
board data file for the variant, the driver will fallback to the default
board data file not to break backward compatibility.

Signed-off-by: Waldemar Rymarkiewicz <ext.waldemar.rymarkiewicz@tieto.com>
---
 drivers/net/wireless/ath/ath10k/core.c | 101 ++++++++++++++++++++++++++++++++-
 drivers/net/wireless/ath/ath10k/core.h |  19 +++++++
 2 files changed, 117 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index dd902b43f8f7..0a8e29e9a0eb 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -18,6 +18,8 @@
 #include <linux/module.h>
 #include <linux/firmware.h>
 #include <linux/of.h>
+#include <linux/dmi.h>
+#include <linux/ctype.h>
 #include <asm/byteorder.h>
 
 #include "core.h"
@@ -711,6 +713,72 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar)
 	return 0;
 }
 
+static void ath10k_core_check_bdfext(const struct dmi_header *hdr, void *data)
+{
+	struct ath10k *ar = data;
+	const char *bdf_ext;
+	const char *magic = ATH10K_SMBIOS_BDF_EXT_MAGIC;
+	u8 bdf_enabled;
+	int i;
+
+	if (hdr->type != ATH10K_SMBIOS_BDF_EXT_TYPE)
+		return;
+
+	if (hdr->length != ATH10K_SMBIOS_BDF_EXT_LENGTH) {
+		ath10k_dbg(ar, ATH10K_DBG_BOOT,
+			   "wrong smbios bdf ext type length (%d).\n",
+			   hdr->length);
+		return;
+	}
+
+	bdf_enabled = *((u8 *)hdr + ATH10K_SMBIOS_BDF_EXT_OFFSET);
+	if (!bdf_enabled) {
+		ath10k_dbg(ar, ATH10K_DBG_BOOT, "bdf variant name not found.\n");
+		return;
+	}
+
+	/* Only one string exists (per spec) */
+	bdf_ext = (char *)hdr + hdr->length;
+
+	if (memcmp(bdf_ext, magic, strlen(magic)) != 0) {
+		ath10k_dbg(ar, ATH10K_DBG_BOOT,
+			   "bdf variant magic does not match.\n");
+		return;
+	}
+
+	for (i = 0; i < strlen(bdf_ext); i++) {
+		if (!isascii(bdf_ext[i]) || !isprint(bdf_ext[i])) {
+			ath10k_dbg(ar, ATH10K_DBG_BOOT,
+				   "bdf variant name contains non ascii chars.\n");
+			return;
+		}
+	}
+
+	/* Copy extension name without magic suffix */
+	if (strscpy(ar->id.bdf_ext, bdf_ext + strlen(magic),
+		    sizeof(ar->id.bdf_ext)) < 0) {
+		ath10k_dbg(ar, ATH10K_DBG_BOOT,
+			   "bdf variant string is longer than the buffer can accommodate (variant: %s)\n",
+			    bdf_ext);
+		return;
+	}
+
+	ath10k_dbg(ar, ATH10K_DBG_BOOT,
+		   "found and validated bdf variant smbios_type 0x%x bdf %s\n",
+		   ATH10K_SMBIOS_BDF_EXT_TYPE, bdf_ext);
+}
+
+static int ath10k_core_check_smbios(struct ath10k *ar)
+{
+	ar->id.bdf_ext[0] = '\0';
+	dmi_walk(ath10k_core_check_bdfext, ar);
+
+	if (ar->id.bdf_ext[0] == '\0')
+		return -ENODATA;
+
+	return 0;
+}
+
 static int ath10k_download_and_run_otp(struct ath10k *ar)
 {
 	u32 result, address = ar->hw_params.patch_load_addr;
@@ -1020,6 +1088,23 @@ static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
 		case ATH10K_BD_IE_BOARD:
 			ret = ath10k_core_parse_bd_ie_board(ar, data, ie_len,
 							    boardname);
+			if (ret == -ENOENT && ar->id.bdf_ext[0] != '\0') {
+				/* try default bdf if variant was not found */
+				char *s, *v = ",variant=";
+				char boardname2[100];
+
+				strlcpy(boardname2, boardname,
+					sizeof(boardname2));
+
+				s = strstr(boardname2, v);
+				if (s)
+					*s = '\0';  /* strip ",variant=%s" */
+
+				ret = ath10k_core_parse_bd_ie_board(ar, data,
+								    ie_len,
+								    boardname2);
+			}
+
 			if (ret == -ENOENT)
 				/* no match found, continue */
 				break;
@@ -1057,6 +1142,9 @@ static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
 static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
 					 size_t name_len)
 {
+	/* strlen(',variant=') + strlen(ar->id.bdf_ext) */
+	char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 };
+
 	if (ar->id.bmi_ids_valid) {
 		scnprintf(name, name_len,
 			  "bus=%s,bmi-chip-id=%d,bmi-board-id=%d",
@@ -1066,12 +1154,15 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
 		goto out;
 	}
 
+	if (ar->id.bdf_ext[0] != '\0')
+		scnprintf(variant, sizeof(variant), ",variant=%s",
+			  ar->id.bdf_ext);
+
 	scnprintf(name, name_len,
-		  "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x",
+		  "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x%s",
 		  ath10k_bus_str(ar->hif.bus),
 		  ar->id.vendor, ar->id.device,
-		  ar->id.subsystem_vendor, ar->id.subsystem_device);
-
+		  ar->id.subsystem_vendor, ar->id.subsystem_device, variant);
 out:
 	ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot using board name '%s'\n", name);
 
@@ -2128,6 +2219,10 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
 		goto err_free_firmware_files;
 	}
 
+	ret = ath10k_core_check_smbios(ar);
+	if (ret)
+		ath10k_dbg(ar, ATH10K_DBG_BOOT, "bdf variant name not set.\n");
+
 	ret = ath10k_core_fetch_board_file(ar);
 	if (ret) {
 		ath10k_err(ar, "failed to fetch board file: %d\n", ret);
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 757242ef52ac..88d14be7fcce 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -69,6 +69,23 @@
 #define ATH10K_NAPI_BUDGET      64
 #define ATH10K_NAPI_QUOTA_LIMIT 60
 
+/* SMBIOS type containing Board Data File Name Extension */
+#define ATH10K_SMBIOS_BDF_EXT_TYPE 0xF8
+
+/* SMBIOS type structure length (excluding strings-set) */
+#define ATH10K_SMBIOS_BDF_EXT_LENGTH 0x9
+
+/* Offset pointing to Board Data File Name Extension */
+#define ATH10K_SMBIOS_BDF_EXT_OFFSET 0x8
+
+/* Board Data File Name Extension string length.
+ * String format: BDF_<Customer ID>_<Extension>\0
+ */
+#define ATH10K_SMBIOS_BDF_EXT_STR_LENGTH 0x20
+
+/* The magic used by QCA spec */
+#define ATH10K_SMBIOS_BDF_EXT_MAGIC "BDF_"
+
 struct ath10k;
 
 enum ath10k_bus {
@@ -798,6 +815,8 @@ struct ath10k {
 		bool bmi_ids_valid;
 		u8 bmi_board_id;
 		u8 bmi_chip_id;
+
+		char bdf_ext[ATH10K_SMBIOS_BDF_EXT_STR_LENGTH];
 	} id;
 
 	int fw_api;
-- 
2.11.0

^ permalink raw reply related

* [PATCH v4 1/3] staging: wilc1000: Rename struct tstrRSSI to rssi_history_buffer
From: Tahia Khan @ 2017-02-24 22:05 UTC (permalink / raw)
  To: outreachy-kernel, aditya.shankar, ganesh.krishna, gregkh,
	linux-wireless, devel, linux-kernel
In-Reply-To: <cover.1487947616.git.tahia.khan@gmail.com>

Rename struct tstrRSSI to rssi_history_buffer for clarity 
and to remove camel casing.

Signed-off-by: Tahia Khan <tahia.khan@gmail.com>
---
 drivers/staging/wilc1000/coreconfigurator.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index cff1698..1c77529 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -70,7 +70,7 @@ enum connect_status {
 	CONNECT_STS_FORCE_16_BIT = 0xFFFF
 };
 
-struct tstrRSSI {
+struct rssi_history_buffer {
 	u8 u8Full;
 	u8 u8Index;
 	s8 as8RSSI[NUM_RSSI];
@@ -93,7 +93,7 @@ struct network_info {
 	u8 *ies;
 	u16 ies_len;
 	void *join_params;
-	struct tstrRSSI str_rssi;
+	struct rssi_history_buffer str_rssi;
 	u64 tsf_hi;
 };
 
-- 
2.7.4

^ permalink raw reply related

* [PATCH v4 3/3] staging: wilc1000: Rename network_info member str_rssi to rssi_history
From: Tahia Khan @ 2017-02-24 22:05 UTC (permalink / raw)
  To: outreachy-kernel, aditya.shankar, ganesh.krishna, gregkh,
	linux-wireless, devel, linux-kernel
In-Reply-To: <cover.1487947616.git.tahia.khan@gmail.com>

Change name of str_rssi to rssi_history within the network_info 
struct for clarity.

Signed-off-by: Tahia Khan <tahia.khan@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
---
 drivers/staging/wilc1000/coreconfigurator.h       |  2 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 9712d89..10101f8 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -93,7 +93,7 @@ struct network_info {
 	u8 *ies;
 	u16 ies_len;
 	void *join_params;
-	struct rssi_history_buffer str_rssi;
+	struct rssi_history_buffer rssi_history;
 	u64 tsf_hi;
 };
 
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 9601ab8..4a6fe90 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -205,11 +205,11 @@ static u32 get_rssi_avg(struct network_info *network_info)
 {
 	u8 i;
 	int rssi_v = 0;
-	u8 num_rssi = (network_info->str_rssi.full) ?
-		       NUM_RSSI : (network_info->str_rssi.index);
+	u8 num_rssi = (network_info->rssi_history.full) ?
+		       NUM_RSSI : (network_info->rssi_history.index);
 
 	for (i = 0; i < num_rssi; i++)
-		rssi_v += network_info->str_rssi.samples[i];
+		rssi_v += network_info->rssi_history.samples[i];
 
 	rssi_v /= num_rssi;
 	return rssi_v;
@@ -346,13 +346,13 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
 	} else {
 		ap_index = ap_found;
 	}
-	rssi_index = last_scanned_shadow[ap_index].str_rssi.index;
-	last_scanned_shadow[ap_index].str_rssi.samples[rssi_index++] = pstrNetworkInfo->rssi;
+	rssi_index = last_scanned_shadow[ap_index].rssi_history.index;
+	last_scanned_shadow[ap_index].rssi_history.samples[rssi_index++] = pstrNetworkInfo->rssi;
 	if (rssi_index == NUM_RSSI) {
 		rssi_index = 0;
-		last_scanned_shadow[ap_index].str_rssi.full = true;
+		last_scanned_shadow[ap_index].rssi_history.full = true;
 	}
-	last_scanned_shadow[ap_index].str_rssi.index = rssi_index;
+	last_scanned_shadow[ap_index].rssi_history.index = rssi_index;
 	last_scanned_shadow[ap_index].rssi = pstrNetworkInfo->rssi;
 	last_scanned_shadow[ap_index].cap_info = pstrNetworkInfo->cap_info;
 	last_scanned_shadow[ap_index].ssid_len = pstrNetworkInfo->ssid_len;
-- 
2.7.4

^ permalink raw reply related

* [PATCH v4 2/3] staging: wilc1000: Rename tstrRSSI members and change type of u8Full to bool
From: Tahia Khan @ 2017-02-24 22:05 UTC (permalink / raw)
  To: outreachy-kernel, aditya.shankar, ganesh.krishna, gregkh,
	linux-wireless, devel, linux-kernel
In-Reply-To: <cover.1487947616.git.tahia.khan@gmail.com>

Remove Hungarian notation and camel casing from all tstrRSSI members' 
names. Additionally, change type of u8Full to bool since it only takes 
values 1 or 0.

Signed-off-by: Tahia Khan <tahia.khan@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
---
 drivers/staging/wilc1000/coreconfigurator.h       |  6 +++---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +++++++-------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 1c77529..9712d89 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -71,9 +71,9 @@ enum connect_status {
 };
 
 struct rssi_history_buffer {
-	u8 u8Full;
-	u8 u8Index;
-	s8 as8RSSI[NUM_RSSI];
+	bool full;
+	u8 index;
+	s8 samples[NUM_RSSI];
 };
 
 struct network_info {
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index f7ce47c..9601ab8 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -205,11 +205,11 @@ static u32 get_rssi_avg(struct network_info *network_info)
 {
 	u8 i;
 	int rssi_v = 0;
-	u8 num_rssi = (network_info->str_rssi.u8Full) ?
-		       NUM_RSSI : (network_info->str_rssi.u8Index);
+	u8 num_rssi = (network_info->str_rssi.full) ?
+		       NUM_RSSI : (network_info->str_rssi.index);
 
 	for (i = 0; i < num_rssi; i++)
-		rssi_v += network_info->str_rssi.as8RSSI[i];
+		rssi_v += network_info->str_rssi.samples[i];
 
 	rssi_v /= num_rssi;
 	return rssi_v;
@@ -346,13 +346,13 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
 	} else {
 		ap_index = ap_found;
 	}
-	rssi_index = last_scanned_shadow[ap_index].str_rssi.u8Index;
-	last_scanned_shadow[ap_index].str_rssi.as8RSSI[rssi_index++] = pstrNetworkInfo->rssi;
+	rssi_index = last_scanned_shadow[ap_index].str_rssi.index;
+	last_scanned_shadow[ap_index].str_rssi.samples[rssi_index++] = pstrNetworkInfo->rssi;
 	if (rssi_index == NUM_RSSI) {
 		rssi_index = 0;
-		last_scanned_shadow[ap_index].str_rssi.u8Full = 1;
+		last_scanned_shadow[ap_index].str_rssi.full = true;
 	}
-	last_scanned_shadow[ap_index].str_rssi.u8Index = rssi_index;
+	last_scanned_shadow[ap_index].str_rssi.index = rssi_index;
 	last_scanned_shadow[ap_index].rssi = pstrNetworkInfo->rssi;
 	last_scanned_shadow[ap_index].cap_info = pstrNetworkInfo->cap_info;
 	last_scanned_shadow[ap_index].ssid_len = pstrNetworkInfo->ssid_len;
-- 
2.7.4

^ permalink raw reply related

* [PATCH v4 0/3] staging: wilc1000: multiple coding style changes to struct tstrRSSI
From: Tahia Khan @ 2017-02-24 22:05 UTC (permalink / raw)
  To: outreachy-kernel, aditya.shankar, ganesh.krishna, gregkh,
	linux-wireless, devel, linux-kernel

Multiple coding style changes to struct tstrRSSI. Initially reported by checkpath.pl: 

Avoid CamelCase: <tstrRSSI> 
Avoid CamelCase: <u8Full> 
Avoid CamelCase: <u8Index> 

Changes since v3: Reformatting commit messages, as requested by
    Julia Lawall <julia.lawall@lip6.fr>

Tahia Khan (3):
  staging: wilc1000: Rename struct tstrRSSI to rssi_history_buffer for
    clarity and to remove camel casing.
  staging: wilc1000: Remove Hungarian notation and camel casing from all
    tstrRSSI members’ names. Additionally, change type of u8Full to bool
    since it only takes values 1 or 0.
  staging: wilc1000: Change name of str_rssi to rssi_history within the
    network_info struct for clarity.

 drivers/staging/wilc1000/coreconfigurator.h       | 10 +++++-----
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +++++++-------
 2 files changed, 12 insertions(+), 12 deletions(-)

-- 
2.7.4

^ permalink raw reply

* Re: [PATCH] NFC: remove TI nfcwilink driver
From: Rob Herring @ 2017-02-24 21:52 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Samuel Ortiz, Lauro Ramos Venancio, Aloisio Almeida Jr,
	linux-kernel@vger.kernel.org, linux-wireless, Ilan Elias
In-Reply-To: <9E986B17-64EA-46E5-BEE3-76217E31B0D1@holtmann.org>

On Fri, Feb 24, 2017 at 3:43 PM, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Rob,
>
>>>> It appears that TI WiLink devices including NFC (WL185x/WL189x) never
>>>> shipped. The only information I found were announcements in Feb
>>>> 2012 about the parts. There's been no activity on this driver besided
>>>> common changes since initially added in Jan 2012. There's also no in
>>>> users that instantiate the platform device (nor DT bindings).
>>>>
>>>> This is a first step in removing TI ST (shared transport) driver in
>>>> favor of extending the BT hci_ll driver to support WL183x chips.
>>>
>>> since the firmware files TINfcInit_* also never made it into the linux-firmware tree, I have no idea who is using this driver. I am actually fine with removing it since it would be easy enough to bring back based on hci_ll driver once there is hardware to test this on.
>>
>> Ping. Someone going to pick up this patch?
>
> if Samuel does not have anything pending for his tree, I can take it through bluetooth-next tree.

>From the looks of -next, it doesn't appear so.

Rob

^ permalink raw reply

* Re: [PATCH] NFC: remove TI nfcwilink driver
From: Marcel Holtmann @ 2017-02-24 21:43 UTC (permalink / raw)
  To: Rob Herring
  Cc: Samuel Ortiz, Lauro Ramos Venancio, Aloisio Almeida Jr,
	linux-kernel@vger.kernel.org, linux-wireless, Ilan Elias
In-Reply-To: <CAL_JsqL1c9vU0R0m73UXi6wvPscqNT9ZAxX8FxhMmLFGMRAeVQ@mail.gmail.com>

Hi Rob,

>>> It appears that TI WiLink devices including NFC (WL185x/WL189x) never
>>> shipped. The only information I found were announcements in Feb
>>> 2012 about the parts. There's been no activity on this driver besided
>>> common changes since initially added in Jan 2012. There's also no in
>>> users that instantiate the platform device (nor DT bindings).
>>> 
>>> This is a first step in removing TI ST (shared transport) driver in
>>> favor of extending the BT hci_ll driver to support WL183x chips.
>> 
>> since the firmware files TINfcInit_* also never made it into the linux-firmware tree, I have no idea who is using this driver. I am actually fine with removing it since it would be easy enough to bring back based on hci_ll driver once there is hardware to test this on.
> 
> Ping. Someone going to pick up this patch?

if Samuel does not have anything pending for his tree, I can take it through bluetooth-next tree.

Regards

Marcel

^ permalink raw reply

* Re: Usage of WoWLAN with iwlwifi driver (Device phy0 failed to suspend async: error -16)
From: Oliver Freyermuth @ 2017-02-24 21:16 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless
In-Reply-To: <1487965047.30601.2.camel@sipsolutions.net>

Am 24.02.2017 um 20:37 schrieb Johannes Berg:
> So let's see. The error *isn't* generated by mac80211 or iwlwifi, but
> it's still returned through wiphy_suspend(). That function just calls
> mac80211 though, and never generates any error conditions by itself. As
> a consequence, this must be generated in some callee of wiphy_suspend()
> that *isn't* in mac80211/iwlwifi...
> 
> __ieee80211_suspend() also doesn't generate any error codes by itself,
> let's take a look at iwlmvm's suspend (called through drv_suspend()),
> that's iwl_mvm_suspend().
> 
> Oh. Can you see if you have CONFIG_IWLWIFI_PCIE_RTPM enabled in your
> configuration? If you do, please turn it off and see if that fixes it.
Indeed, you got it! 
I had it on, and turning that off lets me suspend just fine after activating WoWLAN!

See here, the syslog is now clean (I removed the EBUSY-WARNONs for now):
[12383.757181] PM: Syncing filesystems ... done.
[12383.924701] PM: Preparing system for sleep (mem)
[12384.249363] ACPI Warning: \_SB.PCI0.PEG0.DGPU._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20160930/nsarguments-95)
[12385.323377] Freezing user space processes ... (elapsed 0.001 seconds) done.
[12385.325193] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[12385.326602] PM: Suspending system (mem)
[12385.326619] Suspending console(s) (use no_console_suspend to debug)
[12385.326989] sd 5:0:0:0: [sdb] Synchronizing SCSI cache
[12385.327076] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[12385.327199] sd 0:0:0:0: [sda] Stopping disk
[12385.329952] sd 5:0:0:0: [sdb] Stopping disk
[12385.335474] iwlwifi 0000:0a:00.0: L1 Enabled - LTR Enabled
[12385.335737] iwlwifi 0000:0a:00.0: L1 Enabled - LTR Enabled
[12385.426964] ACPI : EC: event blocked
[12385.637708] ACPI Warning: \_SB.PCI0.PEG0.DGPU._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20160930/nsarguments-95)
[12385.678281] nvidia-modeset: WARNING: GPU:0: Failed to determine which devices were hotplugged: 0x11

[12385.892099] PM: suspend of devices complete after 565.370 msecs
[12385.892586] PM: late suspend of devices complete after 0.484 msecs
[12385.892942] ACPI : EC: interrupt blocked
[12385.893495] ehci-pci 0000:00:1d.0: System wakeup enabled by ACPI
[12385.893568] iwlwifi 0000:0a:00.0: System wakeup enabled by ACPI
[12385.893685] ehci-pci 0000:00:1a.0: System wakeup enabled by ACPI
[12385.893754] xhci_hcd 0000:00:14.0: System wakeup enabled by ACPI
[12385.905567] PM: noirq suspend of devices complete after 12.970 msecs
[12385.905967] ACPI: Preparing to enter system sleep state S3
[12385.906505] ACPI : EC: EC stopped
[12385.906505] PM: Saving platform NVS memory
[12385.906511] Disabling non-boot CPUs ...
[12385.908459] smpboot: CPU 1 is now offline
[12385.919596] smpboot: CPU 2 is now offline
[12385.928100] smpboot: CPU 3 is now offline
[12385.939661] smpboot: CPU 4 is now offline
[12385.952240] smpboot: CPU 5 is now offline
[12385.965252] smpboot: CPU 6 is now offline
[12385.975465] smpboot: CPU 7 is now offline


The problem is that it seems I cannot actually wake the machine anymore afterwards... 
While in the suspend procedure, I see:
[12385.893568] iwlwifi 0000:0a:00.0: System wakeup enabled by ACPI
as expected, I could neither get it to make a tcp connection in tcp-connection mode,
nor could I wake the machine via magic packet in magic-packet mode. 

Could that be some hardware / system firmware limitation, e.g. if my UEFI does not support actually powering
the WiFi hardware if I am in S3? I have yet to (re)check the UEFI config, but since the options are
extremely limited on this Alienware laptop, I guess I will not find anything related to that. 

At least, the suspend problem seems to be clearly related to some path only used if CONFIG_IWLWIFI_PCIE_RTPM is on. 

> 
> This still looks fishy in the code though, but let's see if that's the
> problem first.
> 
> johannes
> 

^ permalink raw reply

* Re: [PATCH] NFC: remove TI nfcwilink driver
From: Rob Herring @ 2017-02-24 20:56 UTC (permalink / raw)
  To: Samuel Ortiz, Lauro Ramos Venancio, Aloisio Almeida Jr
  Cc: linux-kernel@vger.kernel.org, linux-wireless, Ilan Elias,
	Marcel Holtmann
In-Reply-To: <3B67FD13-A482-4BEF-B619-DD9AF9CC129F@holtmann.org>

On Wed, Jan 25, 2017 at 11:54 PM, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Rob,
>
>> It appears that TI WiLink devices including NFC (WL185x/WL189x) never
>> shipped. The only information I found were announcements in Feb
>> 2012 about the parts. There's been no activity on this driver besided
>> common changes since initially added in Jan 2012. There's also no in
>> users that instantiate the platform device (nor DT bindings).
>>
>> This is a first step in removing TI ST (shared transport) driver in
>> favor of extending the BT hci_ll driver to support WL183x chips.
>
> since the firmware files TINfcInit_* also never made it into the linux-firmware tree, I have no idea who is using this driver. I am actually fine with removing it since it would be easy enough to bring back based on hci_ll driver once there is hardware to test this on.

Ping. Someone going to pick up this patch?

Rob

^ permalink raw reply

* [PATCH v2] mac80211: Jitter HWMP MPATH reply frames to reduce collision on dense networks.
From: Alexis Green @ 2017-02-24 19:58 UTC (permalink / raw)
  To: linux-wireless; +Cc: Jesse Jones

From: Jesse Jones <jjones@uniumwifi.com>

Changes since v1: Only flush tx queue if interface is mesh mode.
  This prevents kernel panics due to uninitialized spin_lock.

When more than one station hears a broadcast request, it is possible that
multiple devices will reply at the same time, potentially causing
collision. This patch helps reduce this issue.

Signed-off-by: Alexis Green <agreen@uniumwifi.com>
Signed-off-by: Benjamin Morgan <bmorgan@uniumwifi.com>
---
 net/mac80211/ieee80211_i.h |  11 ++++
 net/mac80211/iface.c       |  61 ++++++++++++++++++++++
 net/mac80211/mesh.c        |   2 +
 net/mac80211/mesh_hwmp.c   | 124 +++++++++++++++++++++++++++++++++++----------
 4 files changed, 171 insertions(+), 27 deletions(-)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 159a1a7..f422897 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -330,6 +330,11 @@ struct mesh_preq_queue {
 	u8 flags;
 };
 
+struct mesh_tx_queue {
+	struct list_head list;
+	struct sk_buff *skb;
+};
+
 struct ieee80211_roc_work {
 	struct list_head list;
 
@@ -670,6 +675,11 @@ struct ieee80211_if_mesh {
 	spinlock_t mesh_preq_queue_lock;
 	struct mesh_preq_queue preq_queue;
 	int preq_queue_len;
+	/* Spinlock for trasmitted MPATH frames */
+	spinlock_t mesh_tx_queue_lock;
+	struct mesh_tx_queue tx_queue;
+	int tx_queue_len;
+
 	struct mesh_stats mshstats;
 	struct mesh_config mshcfg;
 	atomic_t estab_plinks;
@@ -919,6 +929,7 @@ struct ieee80211_sub_if_data {
 
 	struct work_struct work;
 	struct sk_buff_head skb_queue;
+	struct delayed_work tx_work;
 
 	u8 needed_rx_chains;
 	enum ieee80211_smps_mode smps_mode;
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 40813dd..d5b4bf4 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -778,6 +778,59 @@ static int ieee80211_open(struct net_device *dev)
 	return ieee80211_do_open(&sdata->wdev, true);
 }
 
+static void flush_tx_skbs(struct ieee80211_sub_if_data *sdata)
+{
+	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+	struct mesh_tx_queue *tx_node;
+
+	spin_lock_bh(&ifmsh->mesh_tx_queue_lock);
+
+	/* Note that this check is important because of the two-stage
+	 * way that ieee80211_if_mesh is initialized.
+	 */
+	if (ifmsh->tx_queue_len > 0) {
+		mhwmp_dbg(sdata, "flushing %d skbs", ifmsh->tx_queue_len);
+
+		while (!list_empty(&ifmsh->tx_queue.list)) {
+			tx_node = list_last_entry(&ifmsh->tx_queue.list,
+						  struct mesh_tx_queue, list);
+			kfree_skb(tx_node->skb);
+			list_del(&tx_node->list);
+			kfree(tx_node);
+		}
+		ifmsh->tx_queue_len = 0;
+	}
+
+	spin_unlock_bh(&ifmsh->mesh_tx_queue_lock);
+}
+
+static void mesh_jittered_tx(struct work_struct *wk)
+{
+	struct ieee80211_sub_if_data *sdata =
+		container_of(
+			     wk, struct ieee80211_sub_if_data,
+			     tx_work.work);
+
+	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+	struct mesh_tx_queue *tx_node;
+
+	spin_lock_bh(&ifmsh->mesh_tx_queue_lock);
+
+	list_for_each_entry(tx_node, &ifmsh->tx_queue.list, list) {
+		ieee80211_tx_skb(sdata, tx_node->skb);
+	}
+
+	while (!list_empty(&ifmsh->tx_queue.list)) {
+		tx_node = list_last_entry(&ifmsh->tx_queue.list,
+					  struct mesh_tx_queue, list);
+		list_del(&tx_node->list);
+		kfree(tx_node);
+	}
+	ifmsh->tx_queue_len = 0;
+
+	spin_unlock_bh(&ifmsh->mesh_tx_queue_lock);
+}
+
 static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 			      bool going_down)
 {
@@ -881,6 +934,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 
 	cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
 
+	/* Nothing to flush if the interface is not in mesh mode */
+	if (sdata->vif.type == NL80211_IFTYPE_MESH_POINT)
+		flush_tx_skbs(sdata);
+
+	cancel_delayed_work_sync(&sdata->tx_work);
+
 	if (sdata->wdev.cac_started) {
 		chandef = sdata->vif.bss_conf.chandef;
 		WARN_ON(local->suspended);
@@ -1846,6 +1905,8 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
 			  ieee80211_dfs_cac_timer_work);
 	INIT_DELAYED_WORK(&sdata->dec_tailroom_needed_wk,
 			  ieee80211_delayed_tailroom_dec);
+	INIT_DELAYED_WORK(&sdata->tx_work,
+			  mesh_jittered_tx);
 
 	for (i = 0; i < NUM_NL80211_BANDS; i++) {
 		struct ieee80211_supported_band *sband;
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index c28b0af..f0d3cd9 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -1381,6 +1381,8 @@ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
 		    ieee80211_mesh_path_root_timer,
 		    (unsigned long) sdata);
 	INIT_LIST_HEAD(&ifmsh->preq_queue.list);
+	INIT_LIST_HEAD(&ifmsh->tx_queue.list);
+	spin_lock_init(&ifmsh->mesh_tx_queue_lock);
 	skb_queue_head_init(&ifmsh->ps.bc_buf);
 	spin_lock_init(&ifmsh->mesh_preq_queue_lock);
 	spin_lock_init(&ifmsh->sync_offset_lock);
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index d07ee3c..5c22daf 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -18,6 +18,7 @@
 #define ARITH_SHIFT	8
 
 #define MAX_PREQ_QUEUE_LEN	64
+#define MAX_TX_QUEUE_LEN	8
 
 static void mesh_queue_preq(struct mesh_path *, u8);
 
@@ -98,13 +99,15 @@ enum mpath_frame_type {
 
 static const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
-static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
-				  const u8 *orig_addr, u32 orig_sn,
-				  u8 target_flags, const u8 *target,
-				  u32 target_sn, const u8 *da,
-				  u8 hop_count, u8 ttl,
-				  u32 lifetime, u32 metric, u32 preq_id,
-				  struct ieee80211_sub_if_data *sdata)
+static struct sk_buff *alloc_mesh_path_sel_frame(enum mpath_frame_type action,
+						 u8 flags, const u8 *orig_addr,
+						 u32 orig_sn, u8 target_flags,
+						 const u8 *target,
+						 u32 target_sn, const u8 *da,
+						 u8 hop_count, u8 ttl,
+						 u32 lifetime, u32 metric,
+						 u32 preq_id,
+						 struct ieee80211_sub_if_data *sdata)
 {
 	struct ieee80211_local *local = sdata->local;
 	struct sk_buff *skb;
@@ -117,7 +120,7 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
 			    hdr_len +
 			    2 + 37); /* max HWMP IE */
 	if (!skb)
-		return -1;
+		return NULL;
 	skb_reserve(skb, local->tx_headroom);
 	mgmt = (struct ieee80211_mgmt *) skb_put(skb, hdr_len);
 	memset(mgmt, 0, hdr_len);
@@ -153,7 +156,7 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
 		break;
 	default:
 		kfree_skb(skb);
-		return -ENOTSUPP;
+		return NULL;
 	}
 	*pos++ = ie_len;
 	*pos++ = flags;
@@ -192,10 +195,72 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
 		pos += 4;
 	}
 
-	ieee80211_tx_skb(sdata, skb);
-	return 0;
+	return skb;
+}
+
+static void mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
+				   const u8 *orig_addr, u32 orig_sn,
+				   u8 target_flags, const u8 *target,
+				   u32 target_sn, const u8 *da,
+				   u8 hop_count, u8 ttl,
+				   u32 lifetime, u32 metric, u32 preq_id,
+				   struct ieee80211_sub_if_data *sdata)
+{
+	struct sk_buff *skb = alloc_mesh_path_sel_frame(action, flags,
+			orig_addr, orig_sn, target_flags, target, target_sn,
+			da, hop_count, ttl, lifetime, metric, preq_id, sdata);
+	if (skb)
+		ieee80211_tx_skb(sdata, skb);
 }
 
+static void mesh_path_sel_frame_tx_jittered(enum mpath_frame_type action,
+					    u8 flags, const u8 *orig_addr,
+					    u32 orig_sn, u8 target_flags,
+					    const u8 *target, u32 target_sn,
+					    const u8 *da, u8 hop_count, u8 ttl,
+					    u32 lifetime, u32 metric,
+					    u32 preq_id,
+					    struct ieee80211_sub_if_data *sdata)
+{
+	u32 jitter;
+	struct sk_buff *skb = alloc_mesh_path_sel_frame(action, flags,
+							orig_addr, orig_sn,
+							target_flags, target,
+							target_sn, da,
+							hop_count, ttl,
+							lifetime, metric,
+							preq_id, sdata);
+	if (skb) {
+		struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+		struct mesh_tx_queue *tx_node = kmalloc(
+				sizeof(struct mesh_tx_queue), GFP_ATOMIC);
+		if (!tx_node) {
+			mhwmp_dbg(sdata, "could not allocate mesh_hwmp tx node");
+			return;
+		}
+
+		spin_lock_bh(&ifmsh->mesh_tx_queue_lock);
+		if (ifmsh->tx_queue_len == MAX_TX_QUEUE_LEN) {
+			spin_unlock_bh(&ifmsh->mesh_tx_queue_lock);
+			kfree(tx_node);
+			kfree_skb(skb);
+			if (printk_ratelimit())
+				mhwmp_dbg(sdata, "mesh_hwmp tx node queue full");
+			return;
+		}
+
+		tx_node->skb = skb;
+		list_add_tail(&tx_node->list, &ifmsh->tx_queue.list);
+		++ifmsh->tx_queue_len;
+		spin_unlock_bh(&ifmsh->mesh_tx_queue_lock);
+
+		jitter = prandom_u32() % 25;
+
+		ieee80211_queue_delayed_work(
+				&sdata->local->hw,
+			    &sdata->tx_work, msecs_to_jiffies(jitter));
+	}
+}
 
 /*  Headroom is not adjusted.  Caller should ensure that skb has sufficient
  *  headroom in case the frame is encrypted. */
@@ -620,11 +685,13 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
 		ttl = ifmsh->mshcfg.element_ttl;
 		if (ttl != 0) {
 			mhwmp_dbg(sdata, "replying to the PREQ\n");
-			mesh_path_sel_frame_tx(MPATH_PREP, 0, orig_addr,
-					       orig_sn, 0, target_addr,
-					       target_sn, mgmt->sa, 0, ttl,
-					       lifetime, target_metric, 0,
-					       sdata);
+			mesh_path_sel_frame_tx_jittered(MPATH_PREP, 0,
+							orig_addr, orig_sn,
+							0, target_addr,
+							target_sn, mgmt->sa,
+							0, ttl, lifetime,
+							target_metric, 0,
+							sdata);
 		} else {
 			ifmsh->mshstats.dropped_frames_ttl++;
 		}
@@ -652,10 +719,11 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
 			target_sn = PREQ_IE_TARGET_SN(preq_elem);
 		}
 
-		mesh_path_sel_frame_tx(MPATH_PREQ, flags, orig_addr,
-				       orig_sn, target_flags, target_addr,
-				       target_sn, da, hopcount, ttl, lifetime,
-				       orig_metric, preq_id, sdata);
+		mesh_path_sel_frame_tx_jittered(MPATH_PREQ, flags, orig_addr,
+						orig_sn, target_flags,
+						target_addr, target_sn, da,
+						hopcount, ttl, lifetime,
+						orig_metric, preq_id, sdata);
 		if (!is_multicast_ether_addr(da))
 			ifmsh->mshstats.fwded_unicast++;
 		else
@@ -721,9 +789,10 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata,
 	target_sn = PREP_IE_TARGET_SN(prep_elem);
 	orig_sn = PREP_IE_ORIG_SN(prep_elem);
 
-	mesh_path_sel_frame_tx(MPATH_PREP, flags, orig_addr, orig_sn, 0,
-			       target_addr, target_sn, next_hop, hopcount,
-			       ttl, lifetime, metric, 0, sdata);
+	mesh_path_sel_frame_tx_jittered(MPATH_PREP, flags, orig_addr, orig_sn,
+					0, target_addr, target_sn, next_hop,
+					hopcount, ttl, lifetime, metric, 0,
+					sdata);
 	rcu_read_unlock();
 
 	sdata->u.mesh.mshstats.fwded_unicast++;
@@ -873,10 +942,11 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata,
 	ttl--;
 
 	if (ifmsh->mshcfg.dot11MeshForwarding) {
-		mesh_path_sel_frame_tx(MPATH_RANN, flags, orig_addr,
-				       orig_sn, 0, NULL, 0, broadcast_addr,
-				       hopcount, ttl, interval,
-				       metric + metric_txsta, 0, sdata);
+		mesh_path_sel_frame_tx_jittered(MPATH_RANN, flags, orig_addr,
+						orig_sn, 0, NULL, 0,
+						broadcast_addr, hopcount, ttl,
+						interval, metric + metric_txsta,
+						0, sdata);
 	}
 
 	rcu_read_unlock();

^ permalink raw reply related


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