2017-02-25 13:51:51

by Tamizh Chelvam Raja

[permalink] [raw]
Subject: [PATCHv2 0/4] cfg80211: mac80211: BTCOEX feature support

From: Tamizh chelvam <[email protected]>

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


2017-02-25 13:52:02

by Tamizh Chelvam Raja

[permalink] [raw]
Subject: [PATCHv2 1/4] cfg80211: Add support to enable or disable btcoex

From: Tamizh chelvam <[email protected]>

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

Signed-off-by: Tamizh chelvam <[email protected]>
---
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

2017-02-25 15:09:49

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCHv2 1/4] cfg80211: Add support to enable or disable btcoex

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 <[email protected]>
:::::: CC: Johannes Berg <[email protected]>

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


Attachments:
(No filename) (3.91 kB)
.config.gz (25.37 kB)
Download all attachments

2017-02-27 10:33:57

by Tamizh Chelvam Raja

[permalink] [raw]
Subject: RE: [PATCHv2 0/4] cfg80211: mac80211: BTCOEX feature support

Hi Arend,

> >
> > 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
>=20
> This cover letter does not seem to reflect the other patches that were se=
nt to
> the wireless list as those are about cfg80211/mac80211; not ath10k?

[Tamizh] ath10k patches are under progress, will send it soon.

>=20
> Regards,
> Arend
>=20
> > 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(-)
> >

2017-02-25 13:46:08

by Tamizh Chelvam Raja

[permalink] [raw]
Subject: [PATCHv2 4/4] mac80211: Add support to set/update btcoex priority value

From: Tamizh chelvam <[email protected]>

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 <[email protected]>
---
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

2017-02-25 15:16:54

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCHv2 3/4] cfg80211: Add Support set btcoex priority value

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 <[email protected]>
:::::: CC: 0day robot <[email protected]>

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


Attachments:
(No filename) (3.77 kB)
.config.gz (47.53 kB)
Download all attachments

2017-02-25 13:45:48

by Tamizh Chelvam Raja

[permalink] [raw]
Subject: [PATCHv2 3/4] cfg80211: Add Support set btcoex priority value

From: Tamizh chelvam <[email protected]>

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 <[email protected]>
---
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

2017-02-25 14:41:44

by Arend van Spriel

[permalink] [raw]
Subject: Re: [PATCHv2 0/4] cfg80211: mac80211: BTCOEX feature support

On 25-2-2017 14:37, [email protected] wrote:
> From: Tamizh chelvam <[email protected]>
>
> 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(-)
>

2017-02-25 13:52:09

by Tamizh Chelvam Raja

[permalink] [raw]
Subject: [PATCHv2 2/4] mac80211: Add support to enable or disable btcoex

From: Tamizh chelvam <[email protected]>

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 <[email protected]>
---
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

2017-02-25 15:09:49

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCHv2 1/4] cfg80211: Add support to enable or disable btcoex

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) <[email protected]>
:::::: CC: Steven Rostedt <[email protected]>

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


Attachments:
(No filename) (4.69 kB)
.config.gz (47.07 kB)
Download all attachments

2017-03-02 11:49:04

by Tamizh Chelvam Raja

[permalink] [raw]
Subject: RE: [PATCHv2 3/4] cfg80211: Add Support set btcoex priority value

PiBJcyB0aGVyZSBtdWNoIHBvaW50IGluIGhhdmluZyA0IHJhdGhlciB0aGFuIGp1c3QgMiBwYXRj
aGVzPw0KPg0KW1RhbWl6aF0gWWVzLCBJIGFncmVlIHRvIGl0LiANCj4gDQo+ID4gKwlpbnTCoMKg
wqDCoMKgKCpzZXRfYnRjb2V4KShzdHJ1Y3Qgd2lwaHkgKndpcGh5LCBib29sIGVuYWJsZWQsDQo+
ID4gKwkJCcKgwqDCoMKgwqDCoGludCBidGNvZXhfcHJpb3JpdHkpOw0KPiANCj4gU2hvdWxkbid0
IHRoYXQgYmUgdTMyIGFzIGEgYml0bWFwPw0KPiANCltUYW1pemhdIFllcy4NCg0KPiA+ICsJYm9v
bCBidGNvZXhfcHJpb3JpdHlfc3VwcG9ydDsNCj4gDQo+IFdoeSBub3QgdXNlIGFuIGV4dGVuZGVk
IG5sODAyMTEgZmVhdHVyZSBmbGFnIGRpcmVjdGx5Pw0KPiANCltUYW1pemhdIE9rIHN1cmUuIEkn
bGwgdXNlIGV4dGVuZGVkIG5sODAyMTEgZmVhdHVyZSBmbGFnLg0KDQo+ID4gKyAqIEBOTDgwMjEx
X0FUVFJfQlRDT0VYX1BSSU9SSVRZOiBUaGlzIGlzIGZvciB0aGUgZHJpdmVyIHdoaWNoDQo+ID4g
KyAqwqDCoMKgwqDCoHN1cHBvcnQgYnRjb2V4IHByaW9yaXR5IGZlYXR1cmUuIEl0IHVzZWQgd2l0
aA0KPiA+ICVOTDgwMjExX0NNRF9TRVRfQlRDT0VYLg0KPiA+ICsgKsKgwqDCoMKgwqBUaGlzIHdp
bGwgaGF2ZSB1MzIgQklUTUFQIHZhbHVlIHdoaWNoIHJlcHJlc2VudHMNCj4gPiArICrCoMKgwqDC
oMKgZnJhbWUoYmssIGJlLCB2aSwgdm8sIG1nbXQsIGJlYWNvbikgdHlwZSBhbmQgdGhhdCB3aWxs
IGhhdmUNCj4gPiBtb3JlDQo+ID4gKyAqwqDCoMKgwqDCoHByaW9yaXR5IHRoYW4gYSBCVCB0cmFm
ZmljLg0KPiANCj4gSSB0aGluayB5b3UgbmVlZCB0byBkZWZpbmUgdGhlIGJpdHMgc29tZXdoZXJl
IGluIGFuIGVudW0gLSBpLmUuIHdoaWNoIG9uZSBpcyBWTywNCj4gVkksIC4uLg0KPg0KW1RhbWl6
aF0gb2sgc3VyZS4gSXMgdGhpcyBmb3IgZG9jdW1lbnRhdGlvbiBwdXJwb3NlIG9yIGRvIHlvdSB3
YW50IG1lIHRvIHVzZSB0aGF0IA0KZW51bSBmb3Igc29tZXRoaW5nIGVsc2U/DQogDQo+ID4gKwlp
bnQgYnRjb2V4X3ByaW9yaXR5ID0gLTE7DQo+IA0KPiBUaGF0IC0xIGlzIHByZXR0eSB1c2VsZXNz
LCBpZiB0aGUgZHJpdmVyIGRvZXNuJ3Qgc3VwcG9ydCBpdCwgaG9wZWZ1bGx5IGl0IHdvbid0IGxv
b2sNCj4gYXQgdGhlIHZhbHVlIGF0IGFsbD8NCj4gDQpbVGFtaXpoXSBPayBzdXJlDQo=

2017-03-02 14:06:14

by Tamizh Chelvam Raja

[permalink] [raw]
Subject: RE: [PATCHv2 3/4] cfg80211: Add Support set btcoex priority value

DQo+IA0KPiA+ID4gSSB0aGluayB5b3UgbmVlZCB0byBkZWZpbmUgdGhlIGJpdHMgc29tZXdoZXJl
IGluIGFuIGVudW0gLSBpLmUuDQo+ID4gPiB3aGljaCBvbmUgaXMgVk8sDQo+ID4gPiBWSSwgLi4u
DQo+ID4gPg0KPiA+DQo+ID4gW1RhbWl6aF0gb2sgc3VyZS4gSXMgdGhpcyBmb3IgZG9jdW1lbnRh
dGlvbiBwdXJwb3NlIG9yIGRvIHlvdSB3YW50IG1lDQo+ID4gdG8gdXNlIHRoYXTCoCBlbnVtIGZv
ciBzb21ldGhpbmcgZWxzZT8NCj4gDQo+IFdlbGwgSSB0aGluayB5b3Ugc2hvdWxkIGNoZWNrIGlu
IGNmZzgwMjExIHRoYXQgbm8gYml0cyBub3QgZGVmaW5lZCBpbiB0aGUgZW51bQ0KPiBhcmUgdXNl
ZCwgDQpbVGFtaXpoXSBJJ20gcGxhbm5pbmcgdG8gZG8gdGhpcyBjaGVjayBpbiBpdyBpdHNlbGYg
YW5kIGNvbnZlcnRpbmcgaW50byBhIHZhbHVlLCANCg0KaXcgY29tbWFuZCB3aWxsIGxvb2tzIGxp
a2UgYmVsb3cNCg0KaXcgYnRjb2V4IGVuYWJsZSBbPGJlPiA8Yms+IDx2bz4gPHZpPiA8bWdtdD48
YmVhY29uPl0NCg0KSWYgYW55dGhpbmcgb3RoZXIgdGhhbiB0aGlzIGdpdmVuIGJ5IHVzZXIgd2ls
bCBiZSByZWplY3RlZCBhbmQgd2lsbCBub3QgZm9yd2FyZCB0byBjZmc4MDIxMS4NCkRvIHlvdSBo
YXZlIGFueSBjb25jZXJuIG9uIHRoaXM/DQoNCj5hbmQgdGhlbiBpbiB0aGUgZHJpdmVyIHlvdSBu
ZWVkIHRvIHVzZSB0aGF0IGVudW0gdG8gdHJhbnNsYXRlIHRvIHRoZQ0KPiBmaXJtd2FyZSBBUEks
IHJpZ2h0Pw0KPiANCltUYW1pemhdIFllcywgd2UgY2FuIGhhdmUgdGhpcyBmb3IgY2hlY2tpbmcg
aW52YWxpZCBvciB0aGUgdmFsdWUgaXMgZ3JlYXRlciB0aGUgZHJpdmVyIHN1cHBvcnQgdmFsdWUN
Cg==

2017-03-02 15:02:08

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCHv2 3/4] cfg80211: Add Support set btcoex priority value


>
> [Tamizh] I'm planning to do this check in iw itself and converting
> into a value, 
>
> iw command will looks like below
>
> iw btcoex enable [<be> <bk> <vo> <vi> <mgmt><beacon>]
>
> If anything other than this given by user will be rejected and will
> not forward to cfg80211.
> Do you have any concern on this?

Yes, you really need to check it in cfg80211 and define the bits that
are valid in nl80211.

johannes

2017-03-02 08:45:04

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCHv2 1/4] cfg80211: Add support to enable or disable btcoex

You need to fix the build-bot warning, it's legitimate (though hard to
spot):

> + TP_printk(WIPHY_PR_FMT, ", enabled=%d",
> +   WIPHY_PR_ARG, __entry->enabled)
> +);

You have a stray comma there after WIPHY_PR_FMT.

johannes

2017-03-02 13:31:03

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCHv2 3/4] cfg80211: Add Support set btcoex priority value


> > I think you need to define the bits somewhere in an enum - i.e.
> > which one is VO,
> > VI, ...
> >
>
> [Tamizh] ok sure. Is this for documentation purpose or do you want me
> to use that  enum for something else?

Well I think you should check in cfg80211 that no bits not defined in
the enum are used, and then in the driver you need to use that enum to
translate to the firmware API, right?

johannes

2017-03-02 08:51:40

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCHv2 3/4] cfg80211: Add Support set btcoex priority value

This patch will also (and correctly so) cause compilation warnings in
mac80211, so you really should have just two patches.

johannes

2017-03-02 08:51:40

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCHv2 3/4] cfg80211: Add Support set btcoex priority value

Is there much point in having 4 rather than just 2 patches?


> + int     (*set_btcoex)(struct wiphy *wiphy, bool enabled,
> +       int btcoex_priority);

Shouldn't that be u32 as a bitmap?

> + bool btcoex_priority_support;

Why not use an extended nl80211 feature flag directly?

> + * @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.

I think you need to define the bits somewhere in an enum - i.e. which
one is VO, VI, ...

> + int btcoex_priority = -1;

That -1 is pretty useless, if the driver doesn't support it, hopefully
it won't look at the value at all?

johannes

2017-03-02 11:50:40

by Tamizh Chelvam Raja

[permalink] [raw]
Subject: RE: [PATCHv2 1/4] cfg80211: Add support to enable or disable btcoex

SGkgSm9oYW5uZXMsDQoNClRoYW5rcyBmb3IgdGhlIGNvbW1lbnRzLg0KDQo+IFlvdSBuZWVkIHRv
IGZpeCB0aGUgYnVpbGQtYm90IHdhcm5pbmcsIGl0J3MgbGVnaXRpbWF0ZSAodGhvdWdoIGhhcmQg
dG8NCj4gc3BvdCk6DQo+IA0KPiA+ICsJVFBfcHJpbnRrKFdJUEhZX1BSX0ZNVCwgIiwgZW5hYmxl
ZD0lZCIsDQo+ID4gKwkJwqDCoFdJUEhZX1BSX0FSRywgX19lbnRyeS0+ZW5hYmxlZCkNCj4gPiAr
KTsNCj4gDQo+IFlvdSBoYXZlIGEgc3RyYXkgY29tbWEgdGhlcmUgYWZ0ZXIgV0lQSFlfUFJfRk1U
Lg0KPiANCltUYW1pemhdIFllczooIFdpbGwgZml4IGl0IGluIHRoZSBuZXh0IHZlcnNpb24uDQo=