* [PATCH 7/8] Add flag for DFS handling in IBSS
From: Benjamin Berg @ 2016-11-07 14:59 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, sw, Benjamin Berg
In-Reply-To: <20161107145943.16761-1-benjamin@sipsolutions.net>
From: Simon Wunderlich <sw@simonwunderlich.de>
When Userspace is capable of handling DFS, it can inform the kernel
about that by sending the NL80211_ATTR_HANDLE_DFS attribute when joining
an IBSS. DFS channels will then be unlocked.
Note that this flag is only added for debugging purposes and therefore
hidden from the user by prefixing with __ and not documenting it.
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com>
---
ibss.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/ibss.c b/ibss.c
index 84f1e95..7087cc9 100644
--- a/ibss.c
+++ b/ibss.c
@@ -47,6 +47,12 @@ static int join_ibss(struct nl80211_state *state,
argc--;
}
+ if (argc && strcmp(argv[0], "__dfs-enable") == 0) {
+ NLA_PUT_FLAG(msg, NL80211_ATTR_HANDLE_DFS);
+ argv++;
+ argc--;
+ }
+
if (argc) {
if (mac_addr_a2n(abssid, argv[0]) == 0) {
NLA_PUT(msg, NL80211_ATTR_MAC, 6, abssid);
--
2.10.2
^ permalink raw reply related
* [PATCH 6/8] Add commands to send CSA
From: Benjamin Berg @ 2016-11-07 14:59 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, sw, Benjamin Berg
In-Reply-To: <20161107145943.16761-1-benjamin@sipsolutions.net>
From: Benjamin Berg <benjamin.berg@open-mesh.com>
Add a new set of commands to send a CSA. Both the number of beacons and the
flag to block TX can be given optionally.
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com>
---
interface.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
iw.h | 1 +
2 files changed, 73 insertions(+)
diff --git a/interface.c b/interface.c
index 57dd3c3..1c9ebfb 100644
--- a/interface.c
+++ b/interface.c
@@ -644,3 +644,75 @@ nla_put_failure:
COMMAND(set, mcast_rate, "<rate in Mbps>",
NL80211_CMD_SET_MCAST_RATE, 0, CIB_NETDEV, set_mcast_rate,
"Set the multicast bitrate.");
+
+
+static int handle_chanfreq(struct nl80211_state *state, struct nl_msg *msg,
+ bool chan, int argc, char **argv,
+ enum id_input id)
+{
+ struct chandef chandef;
+ int res;
+ int parsed;
+ char *end;
+
+ res = parse_freqchan(&chandef, chan, argc, argv, &parsed);
+ if (res)
+ return res;
+
+ argc -= parsed;
+ argv += parsed;
+
+ while (argc) {
+ unsigned int beacons = 10;
+
+ if (strcmp(argv[0], "beacons") == 0) {
+ if (argc < 2)
+ return 1;
+
+ beacons = strtol(argv[1], &end, 10);
+ if (*end)
+ return 1;
+
+ argc -= 2;
+ argv += 2;
+
+ NLA_PUT_U32(msg, NL80211_ATTR_CH_SWITCH_COUNT, beacons);
+ } else if (strcmp(argv[0], "block-tx") == 0) {
+ argc -= 1;
+ argv += 1;
+
+ NLA_PUT_FLAG(msg, NL80211_ATTR_CH_SWITCH_BLOCK_TX);
+ } else {
+ return 1;
+ }
+ }
+
+ return put_chandef(msg, &chandef);
+
+ nla_put_failure:
+ return -ENOBUFS;
+}
+
+static int handle_freq(struct nl80211_state *state, struct nl_msg *msg,
+ int argc, char **argv,
+ enum id_input id)
+{
+ return handle_chanfreq(state, msg, false, argc, argv, id);
+}
+
+static int handle_chan(struct nl80211_state *state, struct nl_msg *msg,
+ int argc, char **argv,
+ enum id_input id)
+{
+ return handle_chanfreq(state, msg, true, argc, argv, id);
+}
+
+SECTION(switch);
+COMMAND(switch, freq,
+ "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons <count>] [block-tx]\n"
+ "<control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]] [beacons <count>] [block-tx]",
+ NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_freq,
+ "Switch the operating channel by sending a channel switch announcement (CSA).");
+COMMAND(switch, channel, "<channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons <count>] [block-tx]",
+ NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_chan, NULL);
+
diff --git a/iw.h b/iw.h
index 7d56391..0857baf 100644
--- a/iw.h
+++ b/iw.h
@@ -202,6 +202,7 @@ int get_cf1(const struct chanmode *chanmode, unsigned long freq);
"[randomise[=<addr>/<mask>]]"
int parse_sched_scan(struct nl_msg *msg, int *argc, char ***argv);
+DECLARE_SECTION(switch);
DECLARE_SECTION(set);
DECLARE_SECTION(get);
--
2.10.2
^ permalink raw reply related
* [PATCH 4/8] mesh: Use common freqchan helper for joining a mesh
From: Benjamin Berg @ 2016-11-07 14:59 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, sw, Benjamin Berg, Benjamin Berg
In-Reply-To: <20161107145943.16761-1-benjamin@sipsolutions.net>
Simplify code by using the helper which has been introduced earlier.
Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com>
---
mesh.c | 67 +++++++++++-------------------------------------------------------
1 file changed, 11 insertions(+), 56 deletions(-)
diff --git a/mesh.c b/mesh.c
index a0047fe..97f236b 100644
--- a/mesh.c
+++ b/mesh.c
@@ -446,31 +446,6 @@ static int join_mesh(struct nl80211_state *state,
unsigned char rates[NL80211_MAX_SUPP_RATES];
int bintval, dtim_period, n_rates = 0;
char *end, *value = NULL, *sptr = NULL;
- unsigned int i;
- unsigned long freq = 0;
- const struct chanmode *chanmode_selected = NULL;
- static const struct chanmode chanmode[] = {
- { .name = "HT20",
- .width = NL80211_CHAN_WIDTH_20,
- .freq1_diff = 0,
- .chantype = NL80211_CHAN_HT20 },
- { .name = "HT40+",
- .width = NL80211_CHAN_WIDTH_40,
- .freq1_diff = 10,
- .chantype = NL80211_CHAN_HT40PLUS },
- { .name = "HT40-",
- .width = NL80211_CHAN_WIDTH_40,
- .freq1_diff = -10,
- .chantype = NL80211_CHAN_HT40MINUS },
- { .name = "NOHT",
- .width = NL80211_CHAN_WIDTH_20_NOHT,
- .freq1_diff = 0,
- .chantype = NL80211_CHAN_NO_HT },
- { .name = "80MHz",
- .width = NL80211_CHAN_WIDTH_80,
- .freq1_diff = 0,
- .chantype = -1 },
- };
if (argc < 1)
return 1;
@@ -481,40 +456,20 @@ static int join_mesh(struct nl80211_state *state,
/* freq */
if (argc > 1 && strcmp(argv[0], "freq") == 0) {
- argv++;
- argc--;
-
- freq = strtoul(argv[0], &end, 10);
- if (*end != '\0')
- return 1;
- NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq);
-
- argv++;
- argc--;
- }
+ struct chandef chandef;
+ int err, parsed;
- /* channel type */
- if (argc) {
- for (i = 0; i < ARRAY_SIZE(chanmode); i++) {
- if (strcasecmp(chanmode[i].name, argv[0]) == 0) {
- chanmode_selected = &chanmode[i];
- break;
- }
- }
+ err = parse_freqchan(&chandef, false, argc - 1, argv + 1,
+ &parsed);
+ if (err)
+ return err;
- if (chanmode_selected) {
- NLA_PUT_U32(msg, NL80211_ATTR_CHANNEL_WIDTH,
- chanmode_selected->width);
- NLA_PUT_U32(msg, NL80211_ATTR_CENTER_FREQ1,
- get_cf1(chanmode_selected, freq));
- if (chanmode_selected->chantype != -1)
- NLA_PUT_U32(msg,
- NL80211_ATTR_WIPHY_CHANNEL_TYPE,
- chanmode_selected->chantype);
+ argv += parsed + 1;
+ argc -= parsed + 1;
- argv++;
- argc--;
- }
+ put_chandef(msg, &chandef);
+ if (err)
+ return err;
}
/* basic rates */
--
2.10.2
^ permalink raw reply related
* [PATCH 8/8] Print frequency of radar events.
From: Benjamin Berg @ 2016-11-07 14:59 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, sw, Benjamin Berg
In-Reply-To: <20161107145943.16761-1-benjamin@sipsolutions.net>
From: Benjamin Berg <benjamin.berg@open-mesh.com>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com>
---
event.c | 48 +++++++++++++++++++++++++-----------------------
1 file changed, 25 insertions(+), 23 deletions(-)
diff --git a/event.c b/event.c
index 446debb..8014d73 100644
--- a/event.c
+++ b/event.c
@@ -584,30 +584,32 @@ static int print_event(struct nl_msg *msg, void *arg)
nla_data(tb[NL80211_ATTR_VENDOR_DATA]),
nla_len(tb[NL80211_ATTR_VENDOR_DATA]));
break;
- case NL80211_CMD_RADAR_DETECT:
- printf("radar event ");
- if (tb[NL80211_ATTR_RADAR_EVENT]) {
- switch (nla_get_u32(tb[NL80211_ATTR_RADAR_EVENT])) {
- case NL80211_RADAR_DETECTED:
- printf("(radar detected)");
- break;
- case NL80211_RADAR_CAC_FINISHED:
- printf("(cac finished)");
- break;
- case NL80211_RADAR_CAC_ABORTED:
- printf("(cac aborted)");
- break;
- case NL80211_RADAR_NOP_FINISHED:
- printf("(nop finished)");
- break;
- default:
- printf("(unknown)");
- break;
- };
- } else {
- printf("(unknown)");
+ case NL80211_CMD_RADAR_DETECT: {
+ enum nl80211_radar_event event_type;
+ uint32_t freq;
+
+ if (!tb[NL80211_ATTR_RADAR_EVENT] || !tb[NL80211_ATTR_WIPHY_FREQ])
+ printf("BAD radar event");
+ freq = nla_get_u32(tb[NL80211_ATTR_WIPHY_FREQ]);
+ event_type = nla_get_u32(tb[NL80211_ATTR_RADAR_EVENT]);
+
+ switch (event_type) {
+ case NL80211_RADAR_DETECTED:
+ printf("%d MHz: radar detected\n", freq);
+ break;
+ case NL80211_RADAR_CAC_FINISHED:
+ printf("%d MHz: CAC finished\n", freq);
+ break;
+ case NL80211_RADAR_CAC_ABORTED:
+ printf("%d MHz: CAC was aborted\n", freq);
+ break;
+ case NL80211_RADAR_NOP_FINISHED:
+ printf("%d MHz: NOP finished\n", freq);
+ break;
+ default:
+ printf("%d MHz: unknown radar event\n", freq);
+ }
}
- printf("\n");
break;
case NL80211_CMD_DEL_WIPHY:
printf("delete wiphy\n");
--
2.10.2
^ permalink raw reply related
* Re: ATH10K VLAN firmware issue
From: Valo, Kalle @ 2016-11-07 18:06 UTC (permalink / raw)
Cc: voncken, OpenWrt Development List, linux-wireless,
ath10k@lists.infradead.org
In-Reply-To: <CABUTiXW5QSh2KkD+sQ-6QOD5zTce0dun+nyfAMnvL580U=OVNw@mail.gmail.com>
Bruno Antunes <baantunes@gmail.com> writes:
> On 4 November 2016 at 21:17, Valo, Kalle <kvalo@qca.qualcomm.com> wrote:
>> Bruno Antunes <baantunes@gmail.com> writes:
>>
>>> Old thread but I think the issue is still present.
>>>
>>> I'm running a setup with VLANs with WDS and ath10k cards.
>>>
>>> To make it work both cards must be loaded in rawmode, AP
>>> and Sta, and with no security.
>>>
>>> I'm using a OpenWrt trunk r49941 and the most recent firmware,
>>> 10.2.4.70.58, from Kalle ath10k firmware tree.
>>>
>>> Although it works the throughput is very bad.
>>> Are there any alternatives to improve the throughput.
>>
>> Can someone file a bug to bugzilla about this so that all the info is
>> properly stored? The more comprehensive the report is the better.
>>
>> https://bugzilla.kernel.org/
>
> I will file a bug report.
Thanks, it's good to store all in one place so that it's easier to find
the relevant info.
> But since it appears to be a firmware related issue
> under what category can fill in the bug?
You can file it under Drivers/network-wireless, AFAIK we don't have any
separate components for firmware bugs. Here's one example to follow:
https://bugzilla.kernel.org/show_bug.cgi?id=3D186161
--=20
Kalle Valo=
^ permalink raw reply
* Re: [OpenWrt-Devel] ATH10K VLAN firmware issue
From: Bruno Antunes @ 2016-11-07 18:40 UTC (permalink / raw)
To: Valo, Kalle
Cc: OpenWrt Development List, linux-wireless,
ath10k@lists.infradead.org, voncken
In-Reply-To: <871syn5fnb.fsf@qca.qualcomm.com>
On 7 November 2016 at 18:06, Valo, Kalle <kvalo@qca.qualcomm.com> wrote:
> Bruno Antunes <baantunes@gmail.com> writes:
>
>> On 4 November 2016 at 21:17, Valo, Kalle <kvalo@qca.qualcomm.com> wrote:
>>> Bruno Antunes <baantunes@gmail.com> writes:
>>>
>>>> Old thread but I think the issue is still present.
>>>>
>>>> I'm running a setup with VLANs with WDS and ath10k cards.
>>>>
>>>> To make it work both cards must be loaded in rawmode, AP
>>>> and Sta, and with no security.
>>>>
>>>> I'm using a OpenWrt trunk r49941 and the most recent firmware,
>>>> 10.2.4.70.58, from Kalle ath10k firmware tree.
>>>>
>>>> Although it works the throughput is very bad.
>>>> Are there any alternatives to improve the throughput.
>>>
>>> Can someone file a bug to bugzilla about this so that all the info is
>>> properly stored? The more comprehensive the report is the better.
>>>
>>> https://bugzilla.kernel.org/
>>
>> I will file a bug report.
>
> Thanks, it's good to store all in one place so that it's easier to find
> the relevant info.
Just file the bug with the ID 187241 - VLAN support in ATH10k
Feel free to ask for adicional info.
I did not mention any names in the bug report fell free to take credit
if wanted.
Regards,
Bruno
>
>> But since it appears to be a firmware related issue
>> under what category can fill in the bug?
>
> You can file it under Drivers/network-wireless, AFAIK we don't have any
> separate components for firmware bugs. Here's one example to follow:
>
> https://bugzilla.kernel.org/show_bug.cgi?id=186161
>
> --
> Kalle Valo
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
^ permalink raw reply
* Re: [PATCH v2 1/5] mwifiex: remove redundant condition in main process
From: Kalle Valo @ 2016-11-07 18:46 UTC (permalink / raw)
To: Xinming Hu
Cc: Brian Norris, Amitkumar Karwar, linux-wireless@vger.kernel.org,
Cathy Luo, Nishant Sarmukadam, rajatja@google.com,
briannorris@google.com, dmitry.torokhov@gmail.com
In-Reply-To: <eda7a256a6574baeb8e1a12c15c2e6b0@SC-EXCH02.marvell.com>
Xinming Hu <huxm@marvell.com> writes:
> We have include below change in latest submit https://patchwork.kernel.org/patch/9407283/
> Please drop this patch.
When making changes please resend the whole patchset. I do not want to
individually pick patches from different places, that will eventually go
wrong anyway. So I just apply full patchsets.
--
Kalle Valo
^ permalink raw reply
* RE: [PATCH v2 01/12] mwifiex: check tx_hw_pending before downloading sleep confirm
From: Xinming Hu @ 2016-11-08 11:06 UTC (permalink / raw)
To: Brian Norris, Xinming Hu
Cc: Linux Wireless, Kalle Valo, Dmitry Torokhov, Amitkumar Karwar,
Cathy Luo, Shengzhen Li, Wei-Ning Huang
In-Reply-To: <20161103161153.GA37095@google.com>
SGkNCg0KPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBCcmlhbiBOb3JyaXMg
W21haWx0bzpicmlhbm5vcnJpc0BjaHJvbWl1bS5vcmddDQo+IFNlbnQ6IDIwMTbE6jEx1MI0yNUg
MDoxMg0KPiBUbzogWGlubWluZyBIdQ0KPiBDYzogTGludXggV2lyZWxlc3M7IEthbGxlIFZhbG87
IERtaXRyeSBUb3Jva2hvdjsgQW1pdGt1bWFyIEthcndhcjsgQ2F0aHkgTHVvOw0KPiBTaGVuZ3po
ZW4gTGk7IFhpbm1pbmcgSHU7IFdlaS1OaW5nIEh1YW5nDQo+IFN1YmplY3Q6IFJlOiBbUEFUQ0gg
djIgMDEvMTJdIG13aWZpZXg6IGNoZWNrIHR4X2h3X3BlbmRpbmcgYmVmb3JlDQo+IGRvd25sb2Fk
aW5nIHNsZWVwIGNvbmZpcm0NCj4gDQo+ICsgV2VpLU5pbmcNCj4gDQo+IE9uIFR1ZSwgTm92IDAx
LCAyMDE2IGF0IDA4OjA4OjE3UE0gKzA4MDAsIFhpbm1pbmcgSHUgd3JvdGU6DQo+ID4gRnJvbTog
U2hlbmd6aGVuIExpIDxzemxpQG1hcnZlbGwuY29tPg0KPiA+DQo+ID4gV2UgbWF5IGdldCBTTEVF
UCBldmVudCBmcm9tIGZpcm13YXJlIGV2ZW4gaWYgVFhEb25lIGludGVycnVwdCBmb3IgbGFzdA0K
PiA+IFR4IHBhY2tldCBpcyBzdGlsbCBwZW5kaW5nLiBJbiB0aGlzIGNhc2UsIHdlIG1heSBlbmQg
dXAgYWNjZXNzaW5nIFBDSWUNCj4gPiBtZW1vcnkgZm9yIGhhbmRsaW5nIFRYRG9u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lVM
TDsNCj4gPiArCWF0b21pY19kZWMoJmFkYXB0ZXItPnR4X2h3X3BlbmRpbmcpOw0KPiA+ICAJaWYg
KHJlZy0+cGZ1X2VuYWJsZWQpDQo+ID4gIAkJbWVtc2V0KGRlc2MyLCAwLCBzaXplb2YoKmRlc2My
KSk7DQo+ID4gIAllbHNlDQo+ID4gLS0NCj4gPiAxLjguMS40DQo+ID4NCg==
^ permalink raw reply
* [PATCH 0/4] cfg80211: mac80211: BTCOEX feature support
From: c_traja @ 2016-11-08 13:15 UTC (permalink / raw)
To: linux-wireless; +Cc: ath10k, johannes, tamizhchelvam, Tamizh chelvam
From: Tamizh chelvam <c_traja@qti.qualcomm.com>
This patchset add support for BTCOEX feature to enable/disable btcoex
and modifying btcoex priority value via nl80211.
Tamizh chelvam (4):
cfg80211: Add support to enable or disable btcoex
cfg80211: Add new NL80211_CMD_SET_BTCOEX_PRIORITY to support BTCOEX
mac80211: Add support to enable or disable btcoex
mac80211: Add support to update btcoex priority value
include/net/cfg80211.h | 68 ++++++++++++++++++++++++
include/net/mac80211.h | 11 ++++
include/uapi/linux/nl80211.h | 43 +++++++++++++++
net/mac80211/cfg.c | 17 ++++++
net/mac80211/driver-ops.h | 26 +++++++++
net/mac80211/trace.h | 14 +++++
net/wireless/nl80211.c | 119 ++++++++++++++++++++++++++++++++++++++++++
net/wireless/rdev-ops.h | 24 +++++++++
net/wireless/trace.h | 48 +++++++++++++++++
9 files changed, 370 insertions(+)
--
1.7.9.5
^ permalink raw reply
* [PATCH 1/4] cfg80211: Add support to enable or disable btcoex
From: c_traja @ 2016-11-08 13:15 UTC (permalink / raw)
To: linux-wireless; +Cc: ath10k, johannes, tamizhchelvam, Tamizh chelvam
In-Reply-To: <1478610932-21954-1-git-send-email-c_traja@qti.qualcomm.com>
From: Tamizh chelvam <c_traja@qti.qualcomm.com>
This patch adds support to enable or disable btcoex by
adding NL80211_ATTR_WIPHY_BTCOEX_ENABLE attribute in
NL80211_CMD_SET_WIPHY command. By default BTCOEX disabled in driver.
Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
---
include/net/cfg80211.h | 3 +++
include/uapi/linux/nl80211.h | 6 ++++++
net/wireless/nl80211.c | 18 ++++++++++++++++++
net/wireless/rdev-ops.h | 11 +++++++++++
net/wireless/trace.h | 5 +++++
5 files changed, 43 insertions(+)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 9390365..919ed1d 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2735,6 +2735,8 @@ struct cfg80211_nan_func {
* @nan_change_conf: changes NAN configuration. The changed parameters must
* be specified in @changes (using &enum cfg80211_nan_conf_changes);
* All other parameters must be ignored.
+ * @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);
@@ -3011,6 +3013,7 @@ struct cfg80211_ops {
struct wireless_dev *wdev,
struct cfg80211_nan_conf *conf,
u32 changes);
+ int (*set_btcoex)(struct wiphy *wiphy, bool enabled);
};
/*
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 1362d24..c47fe6c8 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1937,6 +1937,10 @@ enum nl80211_commands {
* @NL80211_ATTR_NAN_MATCH: used to report a match. This is a nested attribute.
* See &enum nl80211_nan_match_attributes.
*
+ * @NL80211_ATTR_WIPHY_BTCOEX_ENABLE: u8 attribute for driver supporting
+ * the btcoex feature. When used with %NL80211_CMD_SET_WIPHY 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
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2336,6 +2340,8 @@ enum nl80211_attrs {
NL80211_ATTR_NAN_FUNC,
NL80211_ATTR_NAN_MATCH,
+ NL80211_ATTR_WIPHY_BTCOEX_ENABLE,
+
/* 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 46cd489..5b77a41 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -414,6 +414,7 @@ enum nl80211_multicast_groups {
[NL80211_ATTR_NAN_MASTER_PREF] = { .type = NLA_U8 },
[NL80211_ATTR_NAN_DUAL] = { .type = NLA_U8 },
[NL80211_ATTR_NAN_FUNC] = { .type = NLA_NESTED },
+ [NL80211_ATTR_WIPHY_BTCOEX_ENABLE] = { .type = NLA_U8 },
};
/* policy for the key attributes */
@@ -2356,6 +2357,23 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
return result;
}
+ if (info->attrs[NL80211_ATTR_WIPHY_BTCOEX_ENABLE]) {
+ u8 val;
+
+ if (!rdev->ops->set_btcoex)
+ return -ENOTSUPP;
+
+ val = nla_get_u8(info->attrs[NL80211_ATTR_WIPHY_BTCOEX_ENABLE]);
+
+ if (val > 1)
+ return -EINVAL;
+
+ result = rdev_set_btcoex(rdev, val);
+
+ if (result)
+ return result;
+ }
+
if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_TX] &&
info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]) {
u32 tx_ant, rx_ant;
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 11cf83c..2e547c3 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -1129,4 +1129,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;
+
+ 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 a3d0a91b..c9c6579 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -3026,6 +3026,11 @@
WIPHY_PR_ARG, __entry->n_rules)
);
+DEFINE_EVENT(wiphy_enabled_evt, rdev_set_btcoex,
+ TP_PROTO(struct wiphy *wiphy, bool enabled),
+ TP_ARGS(wiphy, 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
* [PATCH 2/4] cfg80211: Add new NL80211_CMD_SET_BTCOEX_PRIORITY to support BTCOEX
From: c_traja @ 2016-11-08 13:15 UTC (permalink / raw)
To: linux-wireless; +Cc: ath10k, johannes, tamizhchelvam, Tamizh chelvam
In-Reply-To: <1478610932-21954-1-git-send-email-c_traja@qti.qualcomm.com>
From: Tamizh chelvam <c_traja@qti.qualcomm.com>
This change enables user to set high priority for driver supported wlan
frames when BTCOEX enabled. The drivers that expose such capability make
use of this priority table to decide to whom the radio should be shared
(either bluetooth or WLAN). When the high priority frames are queued
driver or firmware will signal to block BT activity.
Capable drivers should advertise the frame type for which it supports
BTCOEX priority configuration through btcoex_support_flags.
This will be useful when wlan needs to transfer packet 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 | 65 +++++++++++++++++++++++++++
include/uapi/linux/nl80211.h | 37 ++++++++++++++++
net/wireless/nl80211.c | 101 ++++++++++++++++++++++++++++++++++++++++++
net/wireless/rdev-ops.h | 13 ++++++
net/wireless/trace.h | 43 ++++++++++++++++++
5 files changed, 259 insertions(+)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 919ed1d..d52d76b 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2434,6 +2434,27 @@ struct cfg80211_nan_func {
};
/**
+ * struct cfg80211_btcoex_priority - BTCOEX support frame type
+ *
+ * This structure defines the driver supporting frame types for BTCOEX
+ *
+ * @wlan_be_preferred: best effort frames preferred over bt traffic
+ * @wlan_bk_preferred: background frames preferred over bt traffic
+ * @wlan_vi_preferred: video frames preferred over bt traffic
+ * @wlan_vo_preferred: voice frames preferred over bt traffic
+ * @wlan_beacon_preferred: beacon preferred over bt traffic
+ * @wlan_mgmt_preferred: management frames preferred ovet bt traffic
+ */
+struct cfg80211_btcoex_priority {
+ bool wlan_be_preferred;
+ bool wlan_bk_preferred;
+ bool wlan_vi_preferred;
+ bool wlan_vo_preferred;
+ bool wlan_beacon_preferred;
+ bool wlan_mgmt_preferred;
+};
+
+/**
* struct cfg80211_ops - backend description for wireless configuration
*
* This struct is registered by fullmac card drivers and/or wireless stacks
@@ -2737,6 +2758,11 @@ struct cfg80211_nan_func {
* All other parameters must be ignored.
* @set_btcoex: Use this callback to call driver API when user wants to
* enable/disable btcoex.
+ * @set_btcoex_priority: Use this callback to set wlan high
+ * priority frames over bluetooth. Driver supported wlan frames
+ * for the BTCOEX is exposed by btcoex_support_flags.
+ * 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);
@@ -3014,6 +3040,8 @@ struct cfg80211_ops {
struct cfg80211_nan_conf *conf,
u32 changes);
int (*set_btcoex)(struct wiphy *wiphy, bool enabled);
+ int (*set_btcoex_priority)(struct wiphy *wiphy,
+ struct cfg80211_btcoex_priority *btcoex_priority);
};
/*
@@ -3253,6 +3281,38 @@ struct wiphy_wowlan_support {
};
/**
+ * wiphy_btcoex_support_flags
+ * This enum has the driver supported frame types for BTCOEX.
+ * @WIPHY_WLAN_BE_PREFERRED - Supports Best Effort frame for BTCOEX
+ * @WIPHY_WLAN_BK_PREFERRED - supports Background frame for BTCOEX
+ * @WIPHY_WLAN_VI_PREFERRED - supports Video frame for BTCOEX
+ * @WIPHY_WLAN_VO_PREFERRED - supports Voice frame for BTCOEX
+ * @WIPHY_WLAN_BEACON_PREFERRED - supports Beacon frame for BTCOEX
+ * @WIPHY_WLAN_MGMT_PREFERRED - supports Management frames for BTCOEX.
+ */
+
+enum wiphy_btcoex_support_flags {
+ WIPHY_WLAN_BE_PREFERRED = BIT(0),
+ WIPHY_WLAN_BK_PREFERRED = BIT(1),
+ WIPHY_WLAN_VI_PREFERRED = BIT(2),
+ WIPHY_WLAN_VO_PREFERRED = BIT(3),
+ WIPHY_WLAN_BEACON_PREFERRED = BIT(4),
+ WIPHY_WLAN_MGMT_PREFERRED = BIT(5),
+};
+
+/**
+ * enum wiphy_btcoex_priority - BTCOEX priority level
+ * This enum defines priority level for BTCOEX
+ * WIPHY_WLAN_PREFERRED_LOW - low priority frames over BT traffic
+ * WIPHY_WLAN_PREFERRED_HIGH - high priority frames over BT traffic
+ */
+
+enum wiphy_btcoex_priority {
+ WIPHY_WLAN_PREFERRED_LOW = false,
+ WIPHY_WLAN_PREFERRED_HIGH = true,
+};
+
+/**
* struct wiphy_coalesce_support - coalesce support data
* @n_rules: maximum number of coalesce rules
* @max_delay: maximum supported coalescing delay in msecs
@@ -3430,6 +3490,10 @@ struct wiphy_iftype_ext_capab {
* used since access to it is necessarily racy, use the parameter passed
* to the suspend() operation instead.
*
+ * @btcoex_support_flags: This will have the driver supported
+ * frame types for BTCOEX. This value filled by using
+ * %enum wiphy_btcoex_support_flags while driver
+ * initialization.
* @ap_sme_capa: AP SME capabilities, flags from &enum nl80211_ap_sme_features.
* @ht_capa_mod_mask: Specify what ht_cap values can be over-ridden.
* If null, then none can be over-ridden.
@@ -3538,6 +3602,7 @@ struct wiphy {
struct cfg80211_wowlan *wowlan_config;
#endif
+ u32 btcoex_support_flags;
u16 max_remain_on_channel_duration;
u8 max_num_pmkids;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index c47fe6c8..8d15321 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -874,6 +874,10 @@
* This will contain a %NL80211_ATTR_NAN_MATCH nested attribute and
* %NL80211_ATTR_COOKIE.
*
+ * @NL80211_CMD_SET_BTCOEX_PRIORITY: Set high priority for driver supported
+ * wlan frames for BTCOEX over bluetooth. High priority frame type
+ * identified by %NL80211_ATTR_SET_BTCOEX_PRIORITY parameters.
+ *
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -1069,6 +1073,8 @@ enum nl80211_commands {
NL80211_CMD_CHANGE_NAN_CONFIG,
NL80211_CMD_NAN_MATCH,
+ NL80211_CMD_SET_BTCOEX_PRIORITY,
+
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
@@ -1941,6 +1947,11 @@ enum nl80211_commands {
* the btcoex feature. When used with %NL80211_CMD_SET_WIPHY it contains
* either 0 for disable or 1 for enable btcoex.
*
+ * @NL80211_ATTR_SET_BTCOEX_PRIORITY: nested attribute for driver supporting
+ * the BTCOEX. When used with %NL80211_CMD_SET_BTCOEX_PRIORITY it contains
+ * attributes according &enum nl80211_btcoex_priority to indicate
+ * which frame has high priority over BT.
+ *
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2341,6 +2352,7 @@ enum nl80211_attrs {
NL80211_ATTR_NAN_MATCH,
NL80211_ATTR_WIPHY_BTCOEX_ENABLE,
+ NL80211_ATTR_SET_BTCOEX_PRIORITY,
/* add attributes here, update the policy in nl80211.c */
@@ -3551,6 +3563,31 @@ enum nl80211_chan_width {
};
/**
+ * enum nl80211_btcoex_priority - BTCOEX parameter attributes
+ * This strcuture has enum values for driver supported wlan
+ * frame type for BTCOEX.
+ * @NL80211_WLAN_BE_PREFERRED - Best Effort frame
+ * @NL80211_WLAN_BK_PREFERRED - Background frame
+ * @NL80211_WLAN_VI_PREFERRED - Video frame
+ * @NL80211_WLAN_VO_PREFERRED - Voice frame
+ * @NL80211_WLAN_BEACON_PREFERRED - BEACON frame
+ * @NL80211_WLAN_MGMT_PREFERRED - MGMT frame
+ */
+
+enum nl80211_btcoex_priority {
+ __NL80211_WLAN_PREFERRED_INVALID,
+ NL80211_WLAN_BE_PREFERRED,
+ NL80211_WLAN_BK_PREFERRED,
+ NL80211_WLAN_VI_PREFERRED,
+ NL80211_WLAN_VO_PREFERRED,
+ NL80211_WLAN_BEACON_PREFERRED,
+ NL80211_WLAN_MGMT_PREFERRED,
+ __NL80211_WLAN_PREFERRED_LAST,
+ NL80211_WLAN_PREFERRED_MAX =
+ __NL80211_WLAN_PREFERRED_LAST - 1,
+};
+
+/**
* enum nl80211_bss_scan_width - control channel width for a BSS
*
* These values are used with the %NL80211_BSS_CHAN_WIDTH attribute.
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 5b77a41..2d89919 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -415,6 +415,7 @@ enum nl80211_multicast_groups {
[NL80211_ATTR_NAN_DUAL] = { .type = NLA_U8 },
[NL80211_ATTR_NAN_FUNC] = { .type = NLA_NESTED },
[NL80211_ATTR_WIPHY_BTCOEX_ENABLE] = { .type = NLA_U8 },
+ [NL80211_ATTR_SET_BTCOEX_PRIORITY] = { .type = NLA_NESTED },
};
/* policy for the key attributes */
@@ -2017,6 +2018,16 @@ static int nl80211_get_wiphy(struct sk_buff *skb, struct genl_info *info)
return genlmsg_reply(msg, info);
}
+static const struct nla_policy
+wlan_preferred_policy[NL80211_WLAN_PREFERRED_MAX + 1] = {
+ [NL80211_WLAN_BE_PREFERRED] = { .type = NLA_FLAG },
+ [NL80211_WLAN_BK_PREFERRED] = { .type = NLA_FLAG },
+ [NL80211_WLAN_VI_PREFERRED] = { .type = NLA_FLAG },
+ [NL80211_WLAN_VO_PREFERRED] = { .type = NLA_FLAG },
+ [NL80211_WLAN_BEACON_PREFERRED] = { .type = NLA_FLAG },
+ [NL80211_WLAN_MGMT_PREFERRED] = { .type = NLA_FLAG },
+};
+
static const struct nla_policy txq_params_policy[NL80211_TXQ_ATTR_MAX + 1] = {
[NL80211_TXQ_ATTR_QUEUE] = { .type = NLA_U8 },
[NL80211_TXQ_ATTR_TXOP] = { .type = NLA_U16 },
@@ -11749,6 +11760,88 @@ static int nl80211_tdls_cancel_channel_switch(struct sk_buff *skb,
return 0;
}
+static int
+parse_btcoex_priority(struct nlattr *tb[], struct wiphy *wiphy,
+ struct cfg80211_btcoex_priority *btcoex_priority)
+{
+ memset(btcoex_priority, false, sizeof(*btcoex_priority));
+
+ if (tb[NL80211_WLAN_BE_PREFERRED]) {
+ if (!(wiphy->btcoex_support_flags &
+ WIPHY_WLAN_BE_PREFERRED))
+ return -EINVAL;
+ btcoex_priority->wlan_be_preferred =
+ WIPHY_WLAN_PREFERRED_HIGH;
+ }
+ if (tb[NL80211_WLAN_BK_PREFERRED]) {
+ if (!(wiphy->btcoex_support_flags &
+ WIPHY_WLAN_BK_PREFERRED))
+ return -EINVAL;
+ btcoex_priority->wlan_bk_preferred =
+ WIPHY_WLAN_PREFERRED_HIGH;
+ }
+ if (tb[NL80211_WLAN_VI_PREFERRED]) {
+ if (!(wiphy->btcoex_support_flags &
+ WIPHY_WLAN_VI_PREFERRED))
+ return -EINVAL;
+ btcoex_priority->wlan_vi_preferred =
+ WIPHY_WLAN_PREFERRED_HIGH;
+ }
+ if (tb[NL80211_WLAN_VO_PREFERRED]) {
+ if (!(wiphy->btcoex_support_flags &
+ WIPHY_WLAN_VO_PREFERRED))
+ return -EINVAL;
+ btcoex_priority->wlan_vo_preferred =
+ WIPHY_WLAN_PREFERRED_HIGH;
+ }
+ if (tb[NL80211_WLAN_BEACON_PREFERRED]) {
+ if (!(wiphy->btcoex_support_flags &
+ WIPHY_WLAN_BEACON_PREFERRED))
+ return -EINVAL;
+ btcoex_priority->wlan_beacon_preferred =
+ WIPHY_WLAN_PREFERRED_HIGH;
+ }
+ if (tb[NL80211_WLAN_MGMT_PREFERRED]) {
+ if (!(wiphy->btcoex_support_flags &
+ WIPHY_WLAN_MGMT_PREFERRED))
+ return -EINVAL;
+ btcoex_priority->wlan_mgmt_preferred =
+ WIPHY_WLAN_PREFERRED_HIGH;
+ }
+ return 0;
+}
+
+static int nl80211_btcoex_priority(struct sk_buff *skb, struct genl_info *info)
+{
+ struct cfg80211_registered_device *rdev = info->user_ptr[0];
+ struct net_device *dev = info->user_ptr[1];
+ struct cfg80211_btcoex_priority btcoex_priority = {};
+ struct wiphy wiphy = rdev->wiphy;
+ struct nlattr *tb[NL80211_WLAN_PREFERRED_MAX + 1];
+ int err;
+
+ if (!rdev->ops->set_btcoex_priority)
+ return -EOPNOTSUPP;
+
+ if (!(info->attrs[NL80211_ATTR_SET_BTCOEX_PRIORITY]))
+ return -EINVAL;
+
+ err = nla_parse(tb, NL80211_WLAN_PREFERRED_MAX,
+ nla_data(info->attrs[NL80211_ATTR_SET_BTCOEX_PRIORITY]),
+ nla_len(info->attrs[NL80211_ATTR_SET_BTCOEX_PRIORITY]),
+ wlan_preferred_policy);
+
+ if (err)
+ return err;
+
+ err = parse_btcoex_priority(tb, &wiphy, &btcoex_priority);
+
+ if (err)
+ return -EINVAL;
+
+ return rdev_set_btcoex_priority(rdev, dev, &btcoex_priority);
+}
+
#define NL80211_FLAG_NEED_WIPHY 0x01
#define NL80211_FLAG_NEED_NETDEV 0x02
#define NL80211_FLAG_NEED_RTNL 0x04
@@ -12608,6 +12701,14 @@ static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb,
.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
NL80211_FLAG_NEED_RTNL,
},
+ {
+ .cmd = NL80211_CMD_SET_BTCOEX_PRIORITY,
+ .doit = nl80211_btcoex_priority,
+ .policy = nl80211_policy,
+ .flags = GENL_ADMIN_PERM,
+ .internal_flags = NL80211_FLAG_NEED_WIPHY |
+ NL80211_FLAG_NEED_RTNL,
+ },
};
/* notification functions */
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 2e547c3..f41168e 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -1140,4 +1140,17 @@ 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_priority(struct cfg80211_registered_device *rdev,
+ struct net_device *dev,
+ struct cfg80211_btcoex_priority *btcoex_priority)
+{
+ int ret;
+
+ trace_rdev_set_btcoex_priority(&rdev->wiphy, btcoex_priority);
+ ret = rdev->ops->set_btcoex_priority(&rdev->wiphy, 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 c9c6579..5bde0cf 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -3031,6 +3031,49 @@
TP_ARGS(wiphy, enabled)
);
+TRACE_EVENT(rdev_set_btcoex_priority,
+ TP_PROTO(struct wiphy *wiphy,
+ struct cfg80211_btcoex_priority *btcoex_priority),
+ TP_ARGS(wiphy, btcoex_priority),
+ TP_STRUCT__entry(
+ WIPHY_ENTRY
+ __field(bool, wlan_be_preferred)
+ __field(bool, wlan_bk_preferred)
+ __field(bool, wlan_vi_preferred)
+ __field(bool, wlan_vo_preferred)
+ __field(bool, wlan_beacon_preferred)
+ __field(bool, wlan_mgmt_preferred)
+ ),
+ TP_fast_assign(
+ WIPHY_ASSIGN;
+ if (btcoex_priority) {
+ __entry->wlan_be_preferred =
+ btcoex_priority->wlan_be_preferred;
+ __entry->wlan_bk_preferred =
+ btcoex_priority->wlan_bk_preferred;
+ __entry->wlan_vi_preferred =
+ btcoex_priority->wlan_vi_preferred;
+ __entry->wlan_vo_preferred =
+ btcoex_priority->wlan_vo_preferred;
+ __entry->wlan_beacon_preferred =
+ btcoex_priority->wlan_beacon_preferred;
+ __entry->wlan_mgmt_preferred =
+ btcoex_priority->wlan_mgmt_preferred;
+ }
+ ),
+ TP_printk(WIPHY_PR_FMT ", wlan_be_preferred: %d, "
+ "wlan_bk_preferred: %d, "
+ "wlan_vi_preferred: %d,"
+ "wlan_vo_preferred: %d, "
+ "wlan_beacon_preferred: %d "
+ "wlan_mgmt_preferred: %d.",
+ WIPHY_PR_ARG, __entry->wlan_be_preferred,
+ __entry->wlan_bk_preferred,
+ __entry->wlan_vi_preferred,
+ __entry->wlan_vo_preferred,
+ __entry->wlan_beacon_preferred,
+ __entry->wlan_mgmt_preferred)
+);
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
* [PATCH 3/4] mac80211: Add support to enable or disable btcoex
From: c_traja @ 2016-11-08 13:15 UTC (permalink / raw)
To: linux-wireless; +Cc: ath10k, johannes, tamizhchelvam, Tamizh chelvam
In-Reply-To: <1478610932-21954-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 | 4 ++++
net/mac80211/cfg.c | 8 ++++++++
net/mac80211/driver-ops.h | 14 ++++++++++++++
net/mac80211/trace.h | 14 ++++++++++++++
4 files changed, 40 insertions(+)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index b9b24ab..e7db763 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3453,6 +3453,9 @@ 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_: 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,
@@ -3705,6 +3708,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 eb68add..a687056 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3562,6 +3562,13 @@ void ieee80211_nan_func_match(struct ieee80211_vif *vif,
}
EXPORT_SYMBOL(ieee80211_nan_func_match);
+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,
@@ -3652,4 +3659,5 @@ void ieee80211_nan_func_match(struct ieee80211_vif *vif,
.nan_change_conf = ieee80211_nan_change_conf,
.add_nan_func = ieee80211_add_nan_func,
.del_nan_func = ieee80211_del_nan_func,
+ .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 92a47af..760dfb6 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
* [PATCH 4/4] mac80211: Add support to update btcoex priority value
From: c_traja @ 2016-11-08 13:15 UTC (permalink / raw)
To: linux-wireless; +Cc: ath10k, johannes, tamizhchelvam, Tamizh chelvam
In-Reply-To: <1478610932-21954-1-git-send-email-c_traja@qti.qualcomm.com>
From: Tamizh chelvam <c_traja@qti.qualcomm.com>
This patch introduces a new driver callback drv_set_btcoex_priority
to pass the priority value to driver.
Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
---
include/net/mac80211.h | 7 +++++++
net/mac80211/cfg.c | 9 +++++++++
net/mac80211/driver-ops.h | 12 ++++++++++++
3 files changed, 28 insertions(+)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index e7db763..3c61015 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3456,6 +3456,11 @@ enum ieee80211_reconfig_type {
*
* @set_btcoex_: set_btcoex: Called when BTCOEX is enabled/disabled, use
* this callback to enable or disable btcoex.
+ * @set_btcoex_priority: Use this callback to set wlan high
+ * priority frames over bluetooth. Driver supported wlan frames
+ * for the BTCOEX is exposed by btcoex_support_flags.
+ * When BTCOEX enabled, the high priority wlan frames will have
+ * more priority than BT.
*/
struct ieee80211_ops {
void (*tx)(struct ieee80211_hw *hw,
@@ -3709,6 +3714,8 @@ struct ieee80211_ops {
struct ieee80211_vif *vif,
u8 instance_id);
int (*set_btcoex)(struct ieee80211_hw *hw, bool enabled);
+ int (*set_btcoex_priority)(struct ieee80211_hw *hw,
+ struct cfg80211_btcoex_priority *btcoex_priority);
};
/**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index a687056..d75cf97 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3569,6 +3569,14 @@ static int ieee80211_set_btcoex(struct wiphy *wiphy, bool enabled)
return drv_set_btcoex(local, enabled);
}
+static int ieee80211_set_btcoex_priority(struct wiphy *wiphy,
+ struct cfg80211_btcoex_priority *btcoex_priority)
+{
+ struct ieee80211_local *local = wiphy_priv(wiphy);
+
+ return drv_set_btcoex_priority(local, btcoex_priority);
+}
+
const struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -3660,4 +3668,5 @@ static int ieee80211_set_btcoex(struct wiphy *wiphy, bool enabled)
.add_nan_func = ieee80211_add_nan_func,
.del_nan_func = ieee80211_del_nan_func,
.set_btcoex = ieee80211_set_btcoex,
+ .set_btcoex_priority = ieee80211_set_btcoex_priority,
};
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 16d9c98..75ac3ed 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1262,4 +1262,16 @@ static inline int drv_set_btcoex(struct ieee80211_local *local,
return ret;
}
+static inline int drv_set_btcoex_priority(struct ieee80211_local *local,
+ struct cfg80211_btcoex_priority *btcoex_priority)
+{
+ int ret = -EOPNOTSUPP;
+
+ if (local->ops->set_btcoex_priority)
+ ret = local->ops->set_btcoex_priority(&local->hw,
+ btcoex_priority);
+
+ return ret;
+}
+
#endif /* __MAC80211_DRIVER_OPS */
--
1.7.9.5
^ permalink raw reply related
* [PATCH 0/4] ath10k: Add support for BTCOEX feature.
From: c_traja @ 2016-11-08 15:02 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, tamizhchelvam, Tamizh chelvam
From: Tamizh chelvam <c_traja@qti.qualcomm.com>
This patch set add support to enable/disable BTCOEX via nl80211,
also support to update BTCOEX priority value for 10.4 based firmware.
Document the dt entry in qcom,ath10k.txt and reads btcoex support
flag and btcoex gpio pin detail from dt.
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
.../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 | 138 +++++++++++++++++++-
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, 259 insertions(+), 36 deletions(-)
--
1.7.9.5
^ permalink raw reply
* [PATCH 2/4] ath10k: Add support to update btcoex priority value via nl80211
From: c_traja @ 2016-11-08 15:02 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, tamizhchelvam, Tamizh chelvam
In-Reply-To: <1478617354-28146-1-git-send-email-c_traja@qti.qualcomm.com>
From: Tamizh chelvam <c_traja@qti.qualcomm.com>
This patch adds support to update btcoex priority value via nl80211.
Here driver will be exposing the supported frame format for this
feature via btcoex_support_flags which is a member of
wiphy structure. 10.4 based firmware support this feature.
WMI service WMI_SERVICE_BTCOEX is used to identify the firmware support
of this feature. BTCOEX needs to enable to modify this value.
This patch has dependency of
"cfg80211: Add new NL80211_CMD_SET_BTCOEX_PRIORITY to support BTCOEX"
patch.
Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/mac.c | 76 +++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath10k/wmi-ops.h | 19 ++++++++
drivers/net/wireless/ath/ath10k/wmi.c | 19 ++++++++
drivers/net/wireless/ath/ath10k/wmi.h | 18 +++++++
4 files changed, 132 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index f276391..6b0f1ea 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -7504,6 +7504,69 @@ static int ath10k_mac_op_set_btcoex(struct ieee80211_hw *hw, bool enabled)
return ret;
}
+u32
+ath10k_mac_get_btcoex_prio(struct cfg80211_btcoex_priority *btcoex_priority)
+{
+ u32 btcoex_prio = 0;
+
+ if (btcoex_priority->wlan_be_preferred)
+ btcoex_prio |= WIPHY_WLAN_BE_PREFERRED;
+
+ if (btcoex_priority->wlan_bk_preferred)
+ btcoex_prio |= WIPHY_WLAN_BK_PREFERRED;
+
+ if (btcoex_priority->wlan_vi_preferred)
+ btcoex_prio |= WIPHY_WLAN_VI_PREFERRED;
+
+ if (btcoex_priority->wlan_vo_preferred)
+ btcoex_prio |= WIPHY_WLAN_VO_PREFERRED;
+
+ if (btcoex_priority->wlan_beacon_preferred)
+ btcoex_prio |= WIPHY_WLAN_BEACON_PREFERRED;
+
+ if (btcoex_priority->wlan_mgmt_preferred)
+ btcoex_prio |= WIPHY_WLAN_MGMT_PREFERRED;
+
+ return btcoex_prio;
+}
+
+static int ath10k_mac_op_set_btcoex_priority(struct ieee80211_hw *hw,
+ struct cfg80211_btcoex_priority *btcoex_priority)
+{
+ u32 btcoex_prio;
+ struct ath10k *ar = hw->priv;
+ int ret;
+
+ if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags))) {
+ ret = -EINVAL;
+ goto exit;
+ }
+
+ mutex_lock(&ar->conf_mutex);
+
+ if (ar->state != ATH10K_STATE_ON &&
+ ar->state != ATH10K_STATE_RESTARTED) {
+ ret = -ENETDOWN;
+ goto exit;
+ }
+
+ btcoex_prio = ath10k_mac_get_btcoex_prio(btcoex_priority);
+
+ if (btcoex_prio > 0x3f)
+ return -E2BIG;
+
+ ret = ath10k_wmi_set_coex_param(ar, btcoex_prio);
+
+ if (ret) {
+ ath10k_warn(ar, "failed to set btcoex priority: %d\n", ret);
+ goto exit;
+ }
+
+exit:
+ mutex_unlock(&ar->conf_mutex);
+ return ret;
+}
+
static const struct ieee80211_ops ath10k_ops = {
.tx = ath10k_mac_op_tx,
.wake_tx_queue = ath10k_mac_op_wake_tx_queue,
@@ -7546,6 +7609,7 @@ static int ath10k_mac_op_set_btcoex(struct ieee80211_hw *hw, bool enabled)
.unassign_vif_chanctx = ath10k_mac_op_unassign_vif_chanctx,
.switch_vif_chanctx = ath10k_mac_op_switch_vif_chanctx,
.set_btcoex = ath10k_mac_op_set_btcoex,
+ .set_btcoex_priority = ath10k_mac_op_set_btcoex_priority,
CFG80211_TESTMODE_CMD(ath10k_tm_cmd)
@@ -8136,6 +8200,18 @@ int ath10k_mac_register(struct ath10k *ar)
*/
ar->hw->offchannel_tx_hw_queue = IEEE80211_MAX_QUEUES - 1;
+ if (test_bit(WMI_SERVICE_BTCOEX, ar->wmi.svc_map)) {
+ ar->hw->wiphy->btcoex_support_flags =
+ WIPHY_WLAN_BE_PREFERRED |
+ WIPHY_WLAN_BK_PREFERRED |
+ WIPHY_WLAN_VI_PREFERRED |
+ WIPHY_WLAN_VO_PREFERRED |
+ WIPHY_WLAN_BEACON_PREFERRED |
+ WIPHY_WLAN_MGMT_PREFERRED;
+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "btcoex supported mask :%u\n",
+ ar->hw->wiphy->btcoex_support_flags);
+ }
+
switch (ar->running_fw->fw_file.wmi_op_version) {
case ATH10K_FW_WMI_OP_VERSION_MAIN:
ar->hw->wiphy->iface_combinations = ath10k_if_comb;
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h
index c9a8bb1..90c8390 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -197,6 +197,8 @@ struct wmi_ops {
(struct ath10k *ar,
enum wmi_bss_survey_req_type type);
struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value);
+ struct sk_buff *(*gen_set_coex_param)(struct ath10k *ar,
+ u32 btcoex_prio);
};
int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -1411,4 +1413,21 @@ struct wmi_ops {
return ath10k_wmi_cmd_send(ar, skb, wmi->cmd->echo_cmdid);
}
+static inline int
+ath10k_wmi_set_coex_param(struct ath10k *ar, u32 btcoex_prio)
+{
+ struct sk_buff *skb;
+
+ if (!ar->wmi.ops->gen_set_coex_param)
+ return -EOPNOTSUPP;
+
+ skb = ar->wmi.ops->gen_set_coex_param(ar, btcoex_prio);
+
+ if (IS_ERR(skb))
+ return PTR_ERR(skb);
+
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->set_coex_param_cmdid);
+}
+
#endif
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 387c4ee..de35c17 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -710,6 +710,7 @@
.pdev_bss_chan_info_request_cmdid =
WMI_10_4_PDEV_BSS_CHAN_INFO_REQUEST_CMDID,
.ext_resource_cfg_cmdid = WMI_10_4_EXT_RESOURCE_CFG_CMDID,
+ .set_coex_param_cmdid = WMI_10_4_BTCOEX_CFG_CMDID,
};
/* MAIN WMI VDEV param map */
@@ -7859,6 +7860,23 @@ static int ath10k_wmi_10_4_op_get_vdev_subtype(struct ath10k *ar,
return 0;
}
+static struct sk_buff *
+ath10k_wmi_10_4_op_gen_set_coex_param(struct ath10k *ar,
+ u32 btcoex_prio)
+{
+ struct wmi_set_coex_param_10_4_cmd *cmd;
+ struct sk_buff *skb;
+
+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
+ if (!skb)
+ return ERR_PTR(-ENOMEM);
+
+ cmd = (struct wmi_set_coex_param_10_4_cmd *)skb->data;
+ cmd->btcoex_prio = __cpu_to_le32(btcoex_prio);
+
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "BTCOEX priority :%u\n", btcoex_prio);
+ return skb;
+}
static const struct wmi_ops wmi_ops = {
.rx = ath10k_wmi_op_rx,
.map_svc = wmi_main_svc_map,
@@ -8205,6 +8223,7 @@ static int ath10k_wmi_10_4_op_get_vdev_subtype(struct ath10k *ar,
.gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
.gen_echo = ath10k_wmi_op_gen_echo,
.gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
+ .gen_set_coex_param = ath10k_wmi_10_4_op_gen_set_coex_param,
};
int ath10k_wmi_attach(struct ath10k *ar)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 1b243c8..3a739e3 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -184,6 +184,8 @@ enum wmi_service {
WMI_SERVICE_TX_MODE_PUSH_ONLY,
WMI_SERVICE_TX_MODE_PUSH_PULL,
WMI_SERVICE_TX_MODE_DYNAMIC,
+ WMI_SERVICE_VDEV_RX_FILTER,
+ WMI_SERVICE_BTCOEX,
/* keep last */
WMI_SERVICE_MAX,
@@ -310,6 +312,8 @@ enum wmi_10_4_service {
WMI_10_4_SERVICE_TX_MODE_PUSH_ONLY,
WMI_10_4_SERVICE_TX_MODE_PUSH_PULL,
WMI_10_4_SERVICE_TX_MODE_DYNAMIC,
+ WMI_10_4_SERVICE_VDEV_RX_FILTER,
+ WMI_10_4_SERVICE_BTCOEX,
};
static inline char *wmi_service_name(int service_id)
@@ -408,6 +412,7 @@ static inline char *wmi_service_name(int service_id)
SVCSTR(WMI_SERVICE_TX_MODE_PUSH_ONLY);
SVCSTR(WMI_SERVICE_TX_MODE_PUSH_PULL);
SVCSTR(WMI_SERVICE_TX_MODE_DYNAMIC);
+ SVCSTR(WMI_SERVICE_BTCOEX);
default:
return NULL;
}
@@ -663,6 +668,8 @@ static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out,
WMI_SERVICE_TX_MODE_PUSH_PULL, len);
SVCMAP(WMI_10_4_SERVICE_TX_MODE_DYNAMIC,
WMI_SERVICE_TX_MODE_DYNAMIC, len);
+ SVCMAP(WMI_10_4_SERVICE_BTCOEX,
+ WMI_SERVICE_BTCOEX, len);
}
#undef SVCMAP
@@ -837,6 +844,7 @@ struct wmi_cmd_map {
u32 pdev_bss_chan_info_request_cmdid;
u32 pdev_enable_adaptive_cca_cmdid;
u32 ext_resource_cfg_cmdid;
+ u32 set_coex_param_cmdid;
};
/*
@@ -1646,6 +1654,11 @@ enum wmi_10_4_cmd_id {
WMI_10_4_EXT_RESOURCE_CFG_CMDID,
WMI_10_4_VDEV_SET_IE_CMDID,
WMI_10_4_SET_LTEU_CONFIG_CMDID,
+ WMI_10_4_ATF_SSID_GROUPING_REQUEST_CMDID,
+ WMI_10_4_PEER_ATF_EXT_REQUEST_CMDID,
+ WMI_10_4_SET_PERIODIC_CHANNEL_STATS_CONFIG,
+ WMI_10_4_PEER_BWF_REQUEST_CMDID,
+ WMI_10_4_BTCOEX_CFG_CMDID,
WMI_10_4_PDEV_UTF_CMDID = WMI_10_4_END_CMDID - 1,
};
@@ -2723,6 +2736,11 @@ struct wmi_ext_resource_config_10_4_cmd {
__le32 fw_feature_bitmap;
};
+struct wmi_set_coex_param_10_4_cmd {
+ /* contains wlan priority frame type value preferred over bt */
+ __le32 btcoex_prio;
+};
+
/* strucutre describing host memory chunk. */
struct host_memory_chunk {
/* id of the request that is passed up in service ready */
--
1.7.9.5
^ permalink raw reply related
* [PATCH 1/4] ath10k: Add support to enable or disable btcoex via nl80211
From: c_traja @ 2016-11-08 15:02 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, tamizhchelvam, Tamizh chelvam
In-Reply-To: <1478617354-28146-1-git-send-email-c_traja@qti.qualcomm.com>
From: Tamizh chelvam <c_traja@qti.qualcomm.com>
This patch add support to enable or disable btcoex via nl80211.
The firmware support this feature since 10.2.4.54 on 2G-only board,
dual band or 5G boards don't support this. WMI service
WMI_SERVICE_COEX_GPIO is used to identify the firmware support of this
feature.
Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/debug.c | 37 ++------------------
drivers/net/wireless/ath/ath10k/mac.c | 58 +++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath10k/mac.h | 1 +
3 files changed, 62 insertions(+), 34 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 82a4c67..ea30fbe 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -26,6 +26,7 @@
#include "debug.h"
#include "hif.h"
#include "wmi-ops.h"
+#include "mac.h"
/* ms */
#define ATH10K_DEBUG_HTT_STATS_INTERVAL 1000
@@ -2138,7 +2139,6 @@ static ssize_t ath10k_write_btcoex(struct file *file,
size_t buf_size;
int ret;
bool val;
- u32 pdev_param;
buf_size = min(count, (sizeof(buf) - 1));
if (copy_from_user(buf, ubuf, buf_size))
@@ -2150,40 +2150,9 @@ static ssize_t ath10k_write_btcoex(struct file *file,
return -EINVAL;
mutex_lock(&ar->conf_mutex);
-
- if (ar->state != ATH10K_STATE_ON &&
- ar->state != ATH10K_STATE_RESTARTED) {
- ret = -ENETDOWN;
- goto exit;
- }
-
- if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags) ^ val)) {
+ ret = ath10k_mac_set_btcoex(ar, val);
+ if (!ret)
ret = count;
- goto exit;
- }
-
- pdev_param = ar->wmi.pdev_param->enable_btcoex;
- if (test_bit(ATH10K_FW_FEATURE_BTCOEX_PARAM,
- ar->running_fw->fw_file.fw_features)) {
- ret = ath10k_wmi_pdev_set_param(ar, pdev_param, val);
- if (ret) {
- ath10k_warn(ar, "failed to enable btcoex: %d\n", ret);
- ret = count;
- goto exit;
- }
- } else {
- ath10k_info(ar, "restarting firmware due to btcoex change");
- queue_work(ar->workqueue, &ar->restart_work);
- }
-
- if (val)
- set_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags);
- else
- clear_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags);
-
- ret = count;
-
-exit:
mutex_unlock(&ar->conf_mutex);
return ret;
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index a1a9ba1..f276391 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -7447,6 +7447,63 @@ struct ath10k_mac_change_chanctx_arg {
return 0;
}
+static inline void ath10k_mac_update_btcoex_flag(struct ath10k *ar, bool val)
+{
+ if (val)
+ set_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags);
+ else
+ clear_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags);
+}
+
+int ath10k_mac_set_btcoex(struct ath10k *ar, bool val)
+{
+ u32 pdev_param;
+ int ret;
+
+ lockdep_assert_held(&ar->conf_mutex);
+
+ if (ar->state != ATH10K_STATE_ON &&
+ ar->state != ATH10K_STATE_RESTARTED)
+ return -ENETDOWN;
+
+ if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags) ^ val))
+ return 0;
+
+ pdev_param = ar->wmi.pdev_param->enable_btcoex;
+ if (test_bit(ATH10K_FW_FEATURE_BTCOEX_PARAM,
+ ar->running_fw->fw_file.fw_features)) {
+ ret = ath10k_wmi_pdev_set_param(ar, pdev_param, val);
+
+ if (ret) {
+ ath10k_warn(ar,
+ "failed to modify btcoex state: %d\n", ret);
+ return ret;
+ }
+ ath10k_mac_update_btcoex_flag(ar, val);
+ } else {
+ ath10k_info(ar, "restarting firmware due to btcoex change");
+ ath10k_mac_update_btcoex_flag(ar, val);
+ queue_work(ar->workqueue, &ar->restart_work);
+ }
+
+ return 0;
+}
+
+static int ath10k_mac_op_set_btcoex(struct ieee80211_hw *hw, bool enabled)
+{
+ int ret;
+ struct ath10k *ar = hw->priv;
+
+ if (!test_bit(WMI_SERVICE_COEX_GPIO, ar->wmi.svc_map))
+ return -EOPNOTSUPP;
+
+ mutex_lock(&ar->conf_mutex);
+ ret = ath10k_mac_set_btcoex(ar, enabled);
+ mutex_unlock(&ar->conf_mutex);
+
+ return ret;
+}
+
static const struct ieee80211_ops ath10k_ops = {
.tx = ath10k_mac_op_tx,
.wake_tx_queue = ath10k_mac_op_wake_tx_queue,
@@ -7488,6 +7545,7 @@ struct ath10k_mac_change_chanctx_arg {
.assign_vif_chanctx = ath10k_mac_op_assign_vif_chanctx,
.unassign_vif_chanctx = ath10k_mac_op_unassign_vif_chanctx,
.switch_vif_chanctx = ath10k_mac_op_switch_vif_chanctx,
+ .set_btcoex = ath10k_mac_op_set_btcoex,
CFG80211_TESTMODE_CMD(ath10k_tm_cmd)
diff --git a/drivers/net/wireless/ath/ath10k/mac.h b/drivers/net/wireless/ath/ath10k/mac.h
index 1bd29ec..de1fa72 100644
--- a/drivers/net/wireless/ath/ath10k/mac.h
+++ b/drivers/net/wireless/ath/ath10k/mac.h
@@ -82,6 +82,7 @@ struct ieee80211_txq *ath10k_mac_txq_lookup(struct ath10k *ar,
u16 peer_id,
u8 tid);
int ath10k_mac_ext_resource_config(struct ath10k *ar, u32 val);
+int ath10k_mac_set_btcoex(struct ath10k *ar, bool val);
static inline struct ath10k_vif *ath10k_vif_to_arvif(struct ieee80211_vif *vif)
{
--
1.7.9.5
^ permalink raw reply related
* [PATCH 3/4] dt: bindings: add new dt entry for BTCOEX feature in qcom,ath10k.txt
From: c_traja @ 2016-11-08 15:04 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, tamizhchelvam
From: Tamizh chelvam <tamizhchelvam@codeaurora.org>
There two things done in this patch.
1) 'btcoex_support' flag for BTCOEX feature support by the hardware.
2) 'wlan_btcoex_gpio' is used to fill wlan priority pin number for
BTCOEX priority feature support.
Signed-off-by: Tamizh chelvam <tamizhchelvam@codeaurora.org>
---
.../bindings/net/wireless/qcom,ath10k.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
index 74d7f0a..08150e2d 100644
--- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
@@ -46,6 +46,10 @@ Optional properties:
hw versions.
- qcom,ath10k-pre-calibration-data : pre calibration data as an array,
the length can vary between hw versions.
+- btcoex_support : should contain eithr "0" or "1" to indicate btcoex
+ support by the hardware.
+- btcoex_gpio_pin : btcoex gpio pin number for the device which
+ supports BTCOEX.
Example (to supply the calibration data alone):
--
1.7.9.5
^ permalink raw reply related
* [PATCH 4/4] ath10k: Add support to read btcoex related data from DT
From: c_traja @ 2016-11-08 15:04 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, tamizhchelvam, Tamizh chelvam
From: Tamizh chelvam <c_traja@qti.qualcomm.com>
BTCOEX feature is not supported by all qca40xx chipsets.
Since btcoex enabled by default in firmware, host needs to
enable COEX support depends on the hardware. This patch is
used to read btcoex_support flag and btcoex gpio pin
number from DT. Depends on the btcoex_support flag value
host will expose BTCOEX support and btcoex gpio pin
number to target.
Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 44 ++++++++++++++++++++++++++++++-
drivers/net/wireless/ath/ath10k/core.h | 9 +++++++
drivers/net/wireless/ath/ath10k/debug.c | 3 +++
drivers/net/wireless/ath/ath10k/mac.c | 4 ++-
drivers/net/wireless/ath/ath10k/wmi.c | 1 +
drivers/net/wireless/ath/ath10k/wmi.h | 2 ++
6 files changed, 61 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 7005e2a..eec2436 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1439,6 +1439,39 @@ static int ath10k_download_cal_data(struct ath10k *ar)
return 0;
}
+static void ath10k_core_fetch_btcoex_dt(struct ath10k *ar)
+{
+ struct device_node *node;
+ u32 btcoex_support = 0;
+ int ret;
+
+ node = ar->dev->of_node;
+ if (!node)
+ goto out;
+
+ ret = of_property_read_u32(node, "btcoex_support", &btcoex_support);
+ if (ret) {
+ ar->btcoex_support = ATH10K_DT_BTCOEX_NOT_FOUND;
+ goto out;
+ }
+
+ if (btcoex_support)
+ ar->btcoex_support = ATH10K_DT_BTCOEX_SUPPORTED;
+ else
+ ar->btcoex_support = ATH10K_DT_BTCOEX_NOT_SUPPORTED;
+
+ ret = of_property_read_u32(node, "btcoex_gpio_pin",
+ &ar->btcoex_gpio_pin);
+ if (ret) {
+ ar->btcoex_gpio_pin = -1;
+ goto out;
+ }
+
+out:
+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "btcoex support flag :%d gpio %d\n",
+ ar->btcoex_support, ar->btcoex_gpio_pin);
+}
+
static int ath10k_init_uart(struct ath10k *ar)
{
int ret;
@@ -1920,14 +1953,23 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
if (test_bit(WMI_SERVICE_BSS_CHANNEL_INFO_64, ar->wmi.svc_map))
val |= WMI_10_4_BSS_CHANNEL_INFO_64;
+ ath10k_core_fetch_btcoex_dt(ar);
+
/* 10.4 firmware supports BT-Coex without reloading firmware
* via pdev param. To support Bluetooth coexistence pdev param,
* WMI_COEX_GPIO_SUPPORT of extended resource config should be
* enabled always.
*/
+
+ /* we can still enable BTCOEX if firmware has the support
+ * eventhough btceox_support value is
+ * ATH10K_DT_BTCOEX_NOT_FOUND
+ */
+
if (test_bit(WMI_SERVICE_COEX_GPIO, ar->wmi.svc_map) &&
test_bit(ATH10K_FW_FEATURE_BTCOEX_PARAM,
- ar->running_fw->fw_file.fw_features))
+ ar->running_fw->fw_file.fw_features) &&
+ ar->btcoex_support != ATH10K_DT_BTCOEX_NOT_SUPPORTED)
val |= WMI_10_4_COEX_GPIO_SUPPORT;
status = ath10k_mac_ext_resource_config(ar, val);
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index b7067cc..66824c73 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -658,6 +658,12 @@ enum ath10k_tx_pause_reason {
ATH10K_TX_PAUSE_MAX,
};
+enum ath10k_dt_btcoex_support_flag {
+ ATH10K_DT_BTCOEX_NOT_FOUND,
+ ATH10K_DT_BTCOEX_SUPPORTED,
+ ATH10K_DT_BTCOEX_NOT_SUPPORTED,
+};
+
struct ath10k_fw_file {
const struct firmware *firmware;
@@ -926,6 +932,9 @@ struct ath10k {
u32 reg_ack_cts_timeout_orig;
} fw_coverage;
+ enum ath10k_dt_btcoex_support_flag btcoex_support;
+ int btcoex_gpio_pin;
+
/* must be last */
u8 drv_priv[0] __aligned(sizeof(void *));
};
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index ea30fbe..e0e316c 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -2149,6 +2149,9 @@ static ssize_t ath10k_write_btcoex(struct file *file,
if (strtobool(buf, &val) != 0)
return -EINVAL;
+ if (ar->btcoex_support == ATH10K_DT_BTCOEX_NOT_SUPPORTED)
+ return -EOPNOTSUPP;
+
mutex_lock(&ar->conf_mutex);
ret = ath10k_mac_set_btcoex(ar, val);
if (!ret)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 6b0f1ea..e021951 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4564,9 +4564,11 @@ static int ath10k_start(struct ieee80211_hw *hw)
}
param = ar->wmi.pdev_param->enable_btcoex;
+
if (test_bit(WMI_SERVICE_COEX_GPIO, ar->wmi.svc_map) &&
test_bit(ATH10K_FW_FEATURE_BTCOEX_PARAM,
- ar->running_fw->fw_file.fw_features)) {
+ ar->running_fw->fw_file.fw_features) &&
+ ar->btcoex_support != ATH10K_DT_BTCOEX_NOT_SUPPORTED) {
ret = ath10k_wmi_pdev_set_param(ar, param, 0);
if (ret) {
ath10k_warn(ar,
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index de35c17..1eb5678 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -7811,6 +7811,7 @@ static int ath10k_wmi_10_4_op_get_vdev_subtype(struct ath10k *ar,
cmd = (struct wmi_ext_resource_config_10_4_cmd *)skb->data;
cmd->host_platform_config = __cpu_to_le32(type);
cmd->fw_feature_bitmap = __cpu_to_le32(fw_feature_bitmap);
+ cmd->btcoex_gpio_pin = __cpu_to_le32(ar->btcoex_gpio_pin);
ath10k_dbg(ar, ATH10K_DBG_WMI,
"wmi ext resource config host type %d firmware feature bitmap %08x\n",
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 3a739e3..f83a21e 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -2734,6 +2734,8 @@ struct wmi_ext_resource_config_10_4_cmd {
__le32 host_platform_config;
/* see enum wmi_10_4_feature_mask */
__le32 fw_feature_bitmap;
+ /* Contains btcoex gpio pin number */
+ __le32 btcoex_gpio_pin;
};
struct wmi_set_coex_param_10_4_cmd {
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH 1/4] ath10k: Add support to enable or disable btcoex via nl80211
From: kbuild test robot @ 2016-11-08 22:34 UTC (permalink / raw)
To: c_traja; +Cc: kbuild-all, ath10k, linux-wireless, tamizhchelvam, Tamizh chelvam
In-Reply-To: <1478617354-28146-2-git-send-email-c_traja@qti.qualcomm.com>
[-- Attachment #1: Type: text/plain, Size: 1971 bytes --]
Hi Tamizh,
[auto build test ERROR on ath6kl/ath-next]
[also build test ERROR on v4.9-rc4 next-20161108]
[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/ath10k-Add-support-for-BTCOEX-feature/20161109-043718
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
config: x86_64-allmodconfig (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=x86_64
All errors (new ones prefixed by >>):
>> drivers/net/wireless/ath/ath10k/mac.c:7548:2: error: unknown field 'set_btcoex' specified in initializer
.set_btcoex = ath10k_mac_op_set_btcoex,
^
>> drivers/net/wireless/ath/ath10k/mac.c:7548:36: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.set_btcoex = ath10k_mac_op_set_btcoex,
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c:7548:36: note: (near initialization for 'ath10k_ops.reconfig_complete')
cc1: some warnings being treated as errors
vim +/set_btcoex +7548 drivers/net/wireless/ath/ath10k/mac.c
7542 .add_chanctx = ath10k_mac_op_add_chanctx,
7543 .remove_chanctx = ath10k_mac_op_remove_chanctx,
7544 .change_chanctx = ath10k_mac_op_change_chanctx,
7545 .assign_vif_chanctx = ath10k_mac_op_assign_vif_chanctx,
7546 .unassign_vif_chanctx = ath10k_mac_op_unassign_vif_chanctx,
7547 .switch_vif_chanctx = ath10k_mac_op_switch_vif_chanctx,
> 7548 .set_btcoex = ath10k_mac_op_set_btcoex,
7549
7550 CFG80211_TESTMODE_CMD(ath10k_tm_cmd)
7551
---
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: 55638 bytes --]
^ permalink raw reply
* Re: [PATCH 2/4] ath10k: Add support to update btcoex priority value via nl80211
From: kbuild test robot @ 2016-11-08 22:54 UTC (permalink / raw)
To: c_traja; +Cc: kbuild-all, ath10k, linux-wireless, tamizhchelvam, Tamizh chelvam
In-Reply-To: <1478617354-28146-3-git-send-email-c_traja@qti.qualcomm.com>
[-- Attachment #1: Type: text/plain, Size: 10908 bytes --]
Hi Tamizh,
[auto build test ERROR on ath6kl/ath-next]
[cannot apply to v4.9-rc4 next-20161108]
[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/ath10k-Add-support-for-BTCOEX-feature/20161109-043718
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
config: x86_64-allmodconfig (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=x86_64
All error/warnings (new ones prefixed by >>):
>> drivers/net/wireless/ath/ath10k/mac.c:7508:35: warning: 'struct cfg80211_btcoex_priority' declared inside parameter list will not be visible outside of this definition or declaration
ath10k_mac_get_btcoex_prio(struct cfg80211_btcoex_priority *btcoex_priority)
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_mac_get_btcoex_prio':
>> drivers/net/wireless/ath/ath10k/mac.c:7512:21: error: dereferencing pointer to incomplete type 'struct cfg80211_btcoex_priority'
if (btcoex_priority->wlan_be_preferred)
^~
>> drivers/net/wireless/ath/ath10k/mac.c:7513:18: error: 'WIPHY_WLAN_BE_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_BE_PREFERRED;
^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c:7513:18: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/net/wireless/ath/ath10k/mac.c:7516:18: error: 'WIPHY_WLAN_BK_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_BK_PREFERRED;
^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/ath/ath10k/mac.c:7519:18: error: 'WIPHY_WLAN_VI_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_VI_PREFERRED;
^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/ath/ath10k/mac.c:7522:18: error: 'WIPHY_WLAN_VO_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_VO_PREFERRED;
^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/ath/ath10k/mac.c:7525:18: error: 'WIPHY_WLAN_BEACON_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_BEACON_PREFERRED;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/ath/ath10k/mac.c:7528:18: error: 'WIPHY_WLAN_MGMT_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_MGMT_PREFERRED;
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c: At top level:
drivers/net/wireless/ath/ath10k/mac.c:7534:11: warning: 'struct cfg80211_btcoex_priority' declared inside parameter list will not be visible outside of this definition or declaration
struct cfg80211_btcoex_priority *btcoex_priority)
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_mac_op_set_btcoex_priority':
>> drivers/net/wireless/ath/ath10k/mac.c:7553:43: error: passing argument 1 of 'ath10k_mac_get_btcoex_prio' from incompatible pointer type [-Werror=incompatible-pointer-types]
btcoex_prio = ath10k_mac_get_btcoex_prio(btcoex_priority);
^~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c:7508:1: note: expected 'struct cfg80211_btcoex_priority *' but argument is of type 'struct cfg80211_btcoex_priority *'
ath10k_mac_get_btcoex_prio(struct cfg80211_btcoex_priority *btcoex_priority)
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c: At top level:
drivers/net/wireless/ath/ath10k/mac.c:7611:2: error: unknown field 'set_btcoex' specified in initializer
.set_btcoex = ath10k_mac_op_set_btcoex,
^
drivers/net/wireless/ath/ath10k/mac.c:7611:36: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.set_btcoex = ath10k_mac_op_set_btcoex,
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c:7611:36: note: (near initialization for 'ath10k_ops.reconfig_complete')
>> drivers/net/wireless/ath/ath10k/mac.c:7612:2: error: unknown field 'set_btcoex_priority' specified in initializer
.set_btcoex_priority = ath10k_mac_op_set_btcoex_priority,
^
drivers/net/wireless/ath/ath10k/mac.c:7612:26: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.set_btcoex_priority = ath10k_mac_op_set_btcoex_priority,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c:7612:26: note: (near initialization for 'ath10k_ops.ipv6_addr_change')
drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_mac_register':
>> drivers/net/wireless/ath/ath10k/mac.c:8203:16: error: 'struct wiphy' has no member named 'btcoex_support_flags'
ar->hw->wiphy->btcoex_support_flags =
^~
drivers/net/wireless/ath/ath10k/mac.c:8204:4: error: 'WIPHY_WLAN_BE_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_BE_PREFERRED |
^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c:8205:4: error: 'WIPHY_WLAN_BK_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_BK_PREFERRED |
^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c:8206:4: error: 'WIPHY_WLAN_VI_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_VI_PREFERRED |
^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c:8207:4: error: 'WIPHY_WLAN_VO_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_VO_PREFERRED |
^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c:8208:4: error: 'WIPHY_WLAN_BEACON_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_BEACON_PREFERRED |
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c:8209:4: error: 'WIPHY_WLAN_MGMT_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_MGMT_PREFERRED;
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c:8211:20: error: 'struct wiphy' has no member named 'btcoex_support_flags'
ar->hw->wiphy->btcoex_support_flags);
^~
cc1: some warnings being treated as errors
vim +7512 drivers/net/wireless/ath/ath10k/mac.c
7502 mutex_unlock(&ar->conf_mutex);
7503
7504 return ret;
7505 }
7506
7507 u32
> 7508 ath10k_mac_get_btcoex_prio(struct cfg80211_btcoex_priority *btcoex_priority)
7509 {
7510 u32 btcoex_prio = 0;
7511
> 7512 if (btcoex_priority->wlan_be_preferred)
> 7513 btcoex_prio |= WIPHY_WLAN_BE_PREFERRED;
7514
7515 if (btcoex_priority->wlan_bk_preferred)
> 7516 btcoex_prio |= WIPHY_WLAN_BK_PREFERRED;
7517
7518 if (btcoex_priority->wlan_vi_preferred)
> 7519 btcoex_prio |= WIPHY_WLAN_VI_PREFERRED;
7520
7521 if (btcoex_priority->wlan_vo_preferred)
> 7522 btcoex_prio |= WIPHY_WLAN_VO_PREFERRED;
7523
7524 if (btcoex_priority->wlan_beacon_preferred)
> 7525 btcoex_prio |= WIPHY_WLAN_BEACON_PREFERRED;
7526
7527 if (btcoex_priority->wlan_mgmt_preferred)
> 7528 btcoex_prio |= WIPHY_WLAN_MGMT_PREFERRED;
7529
7530 return btcoex_prio;
7531 }
7532
7533 static int ath10k_mac_op_set_btcoex_priority(struct ieee80211_hw *hw,
7534 struct cfg80211_btcoex_priority *btcoex_priority)
7535 {
7536 u32 btcoex_prio;
7537 struct ath10k *ar = hw->priv;
7538 int ret;
7539
7540 if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags))) {
7541 ret = -EINVAL;
7542 goto exit;
7543 }
7544
7545 mutex_lock(&ar->conf_mutex);
7546
7547 if (ar->state != ATH10K_STATE_ON &&
7548 ar->state != ATH10K_STATE_RESTARTED) {
7549 ret = -ENETDOWN;
7550 goto exit;
7551 }
7552
> 7553 btcoex_prio = ath10k_mac_get_btcoex_prio(btcoex_priority);
7554
7555 if (btcoex_prio > 0x3f)
7556 return -E2BIG;
7557
7558 ret = ath10k_wmi_set_coex_param(ar, btcoex_prio);
7559
7560 if (ret) {
7561 ath10k_warn(ar, "failed to set btcoex priority: %d\n", ret);
7562 goto exit;
7563 }
7564
7565 exit:
7566 mutex_unlock(&ar->conf_mutex);
7567 return ret;
7568 }
7569
7570 static const struct ieee80211_ops ath10k_ops = {
7571 .tx = ath10k_mac_op_tx,
7572 .wake_tx_queue = ath10k_mac_op_wake_tx_queue,
7573 .start = ath10k_start,
7574 .stop = ath10k_stop,
7575 .config = ath10k_config,
7576 .add_interface = ath10k_add_interface,
7577 .remove_interface = ath10k_remove_interface,
7578 .configure_filter = ath10k_configure_filter,
7579 .bss_info_changed = ath10k_bss_info_changed,
7580 .set_coverage_class = ath10k_mac_op_set_coverage_class,
7581 .hw_scan = ath10k_hw_scan,
7582 .cancel_hw_scan = ath10k_cancel_hw_scan,
7583 .set_key = ath10k_set_key,
7584 .set_default_unicast_key = ath10k_set_default_unicast_key,
7585 .sta_state = ath10k_sta_state,
7586 .conf_tx = ath10k_conf_tx,
7587 .remain_on_channel = ath10k_remain_on_channel,
7588 .cancel_remain_on_channel = ath10k_cancel_remain_on_channel,
7589 .set_rts_threshold = ath10k_set_rts_threshold,
7590 .set_frag_threshold = ath10k_mac_op_set_frag_threshold,
7591 .flush = ath10k_flush,
7592 .tx_last_beacon = ath10k_tx_last_beacon,
7593 .set_antenna = ath10k_set_antenna,
7594 .get_antenna = ath10k_get_antenna,
7595 .reconfig_complete = ath10k_reconfig_complete,
7596 .get_survey = ath10k_get_survey,
7597 .set_bitrate_mask = ath10k_mac_op_set_bitrate_mask,
7598 .sta_rc_update = ath10k_sta_rc_update,
7599 .get_tsf = ath10k_get_tsf,
7600 .set_tsf = ath10k_set_tsf,
7601 .ampdu_action = ath10k_ampdu_action,
7602 .get_et_sset_count = ath10k_debug_get_et_sset_count,
7603 .get_et_stats = ath10k_debug_get_et_stats,
7604 .get_et_strings = ath10k_debug_get_et_strings,
7605 .add_chanctx = ath10k_mac_op_add_chanctx,
7606 .remove_chanctx = ath10k_mac_op_remove_chanctx,
7607 .change_chanctx = ath10k_mac_op_change_chanctx,
7608 .assign_vif_chanctx = ath10k_mac_op_assign_vif_chanctx,
7609 .unassign_vif_chanctx = ath10k_mac_op_unassign_vif_chanctx,
7610 .switch_vif_chanctx = ath10k_mac_op_switch_vif_chanctx,
> 7611 .set_btcoex = ath10k_mac_op_set_btcoex,
> 7612 .set_btcoex_priority = ath10k_mac_op_set_btcoex_priority,
7613
7614 CFG80211_TESTMODE_CMD(ath10k_tm_cmd)
7615
---
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: 55638 bytes --]
^ permalink raw reply
* Re: [PATCH 1/4] ath10k: Add support to enable or disable btcoex via nl80211
From: kbuild test robot @ 2016-11-08 23:20 UTC (permalink / raw)
To: c_traja; +Cc: kbuild-all, ath10k, linux-wireless, tamizhchelvam, Tamizh chelvam
In-Reply-To: <1478617354-28146-2-git-send-email-c_traja@qti.qualcomm.com>
[-- Attachment #1: Type: text/plain, Size: 2569 bytes --]
Hi Tamizh,
[auto build test WARNING on ath6kl/ath-next]
[also build test WARNING on v4.9-rc4 next-20161108]
[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/ath10k-Add-support-for-BTCOEX-feature/20161109-043718
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
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 >>):
drivers/net/wireless/ath/ath10k/mac.c:7548:2: error: unknown field 'set_btcoex' specified in initializer
.set_btcoex = ath10k_mac_op_set_btcoex,
^
>> drivers/net/wireless/ath/ath10k/mac.c:7548:2: warning: initialization from incompatible pointer type
drivers/net/wireless/ath/ath10k/mac.c:7548:2: warning: (near initialization for 'ath10k_ops.reconfig_complete')
vim +7548 drivers/net/wireless/ath/ath10k/mac.c
7532 .reconfig_complete = ath10k_reconfig_complete,
7533 .get_survey = ath10k_get_survey,
7534 .set_bitrate_mask = ath10k_mac_op_set_bitrate_mask,
7535 .sta_rc_update = ath10k_sta_rc_update,
7536 .get_tsf = ath10k_get_tsf,
7537 .set_tsf = ath10k_set_tsf,
7538 .ampdu_action = ath10k_ampdu_action,
7539 .get_et_sset_count = ath10k_debug_get_et_sset_count,
7540 .get_et_stats = ath10k_debug_get_et_stats,
7541 .get_et_strings = ath10k_debug_get_et_strings,
7542 .add_chanctx = ath10k_mac_op_add_chanctx,
7543 .remove_chanctx = ath10k_mac_op_remove_chanctx,
7544 .change_chanctx = ath10k_mac_op_change_chanctx,
7545 .assign_vif_chanctx = ath10k_mac_op_assign_vif_chanctx,
7546 .unassign_vif_chanctx = ath10k_mac_op_unassign_vif_chanctx,
7547 .switch_vif_chanctx = ath10k_mac_op_switch_vif_chanctx,
> 7548 .set_btcoex = ath10k_mac_op_set_btcoex,
7549
7550 CFG80211_TESTMODE_CMD(ath10k_tm_cmd)
7551
7552 #ifdef CONFIG_PM
7553 .suspend = ath10k_wow_op_suspend,
7554 .resume = ath10k_wow_op_resume,
7555 #endif
7556 #ifdef CONFIG_MAC80211_DEBUGFS
---
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: 46112 bytes --]
^ permalink raw reply
* Re: [PATCH 2/4] ath10k: Add support to update btcoex priority value via nl80211
From: kbuild test robot @ 2016-11-08 23:49 UTC (permalink / raw)
To: c_traja; +Cc: kbuild-all, ath10k, linux-wireless, tamizhchelvam, Tamizh chelvam
In-Reply-To: <1478617354-28146-3-git-send-email-c_traja@qti.qualcomm.com>
[-- Attachment #1: Type: text/plain, Size: 8521 bytes --]
Hi Tamizh,
[auto build test ERROR on ath6kl/ath-next]
[cannot apply to v4.9-rc4 next-20161108]
[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/ath10k-Add-support-for-BTCOEX-feature/20161109-043718
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
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 error/warnings (new ones prefixed by >>):
>> drivers/net/wireless/ath/ath10k/mac.c:7508:35: warning: 'struct cfg80211_btcoex_priority' declared inside parameter list
ath10k_mac_get_btcoex_prio(struct cfg80211_btcoex_priority *btcoex_priority)
^
>> drivers/net/wireless/ath/ath10k/mac.c:7508:35: warning: its scope is only this definition or declaration, which is probably not what you want
drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_mac_get_btcoex_prio':
>> drivers/net/wireless/ath/ath10k/mac.c:7512:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_be_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7513:18: error: 'WIPHY_WLAN_BE_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_BE_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7513:18: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/wireless/ath/ath10k/mac.c:7515:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_bk_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7516:18: error: 'WIPHY_WLAN_BK_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_BK_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7518:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_vi_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7519:18: error: 'WIPHY_WLAN_VI_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_VI_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7521:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_vo_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7522:18: error: 'WIPHY_WLAN_VO_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_VO_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7524:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_beacon_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7525:18: error: 'WIPHY_WLAN_BEACON_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_BEACON_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7527:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_mgmt_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7528:18: error: 'WIPHY_WLAN_MGMT_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_MGMT_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c: At top level:
drivers/net/wireless/ath/ath10k/mac.c:7534:11: warning: 'struct cfg80211_btcoex_priority' declared inside parameter list
struct cfg80211_btcoex_priority *btcoex_priority)
^
drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_mac_op_set_btcoex_priority':
>> drivers/net/wireless/ath/ath10k/mac.c:7553:16: warning: passing argument 1 of 'ath10k_mac_get_btcoex_prio' from incompatible pointer type
btcoex_prio = ath10k_mac_get_btcoex_prio(btcoex_priority);
^
drivers/net/wireless/ath/ath10k/mac.c:7508:1: note: expected 'struct cfg80211_btcoex_priority *' but argument is of type 'struct cfg80211_btcoex_priority *'
ath10k_mac_get_btcoex_prio(struct cfg80211_btcoex_priority *btcoex_priority)
^
drivers/net/wireless/ath/ath10k/mac.c: At top level:
drivers/net/wireless/ath/ath10k/mac.c:7611:2: error: unknown field 'set_btcoex' specified in initializer
.set_btcoex = ath10k_mac_op_set_btcoex,
^
drivers/net/wireless/ath/ath10k/mac.c:7611:2: warning: initialization from incompatible pointer type
drivers/net/wireless/ath/ath10k/mac.c:7611:2: warning: (near initialization for 'ath10k_ops.reconfig_complete')
drivers/net/wireless/ath/ath10k/mac.c:7612:2: error: unknown field 'set_btcoex_priority' specified in initializer
.set_btcoex_priority = ath10k_mac_op_set_btcoex_priority,
^
drivers/net/wireless/ath/ath10k/mac.c:7612:2: warning: initialization from incompatible pointer type
drivers/net/wireless/ath/ath10k/mac.c:7612:2: warning: (near initialization for 'ath10k_ops.ipv6_addr_change')
drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_mac_register':
drivers/net/wireless/ath/ath10k/mac.c:8203:16: error: 'struct wiphy' has no member named 'btcoex_support_flags'
ar->hw->wiphy->btcoex_support_flags =
^
drivers/net/wireless/ath/ath10k/mac.c:8204:4: error: 'WIPHY_WLAN_BE_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_BE_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8205:4: error: 'WIPHY_WLAN_BK_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_BK_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8206:4: error: 'WIPHY_WLAN_VI_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_VI_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8207:4: error: 'WIPHY_WLAN_VO_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_VO_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8208:4: error: 'WIPHY_WLAN_BEACON_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_BEACON_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8209:4: error: 'WIPHY_WLAN_MGMT_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_MGMT_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:8211:20: error: 'struct wiphy' has no member named 'btcoex_support_flags'
ar->hw->wiphy->btcoex_support_flags);
^
vim +7512 drivers/net/wireless/ath/ath10k/mac.c
7502 mutex_unlock(&ar->conf_mutex);
7503
7504 return ret;
7505 }
7506
7507 u32
> 7508 ath10k_mac_get_btcoex_prio(struct cfg80211_btcoex_priority *btcoex_priority)
7509 {
7510 u32 btcoex_prio = 0;
7511
> 7512 if (btcoex_priority->wlan_be_preferred)
7513 btcoex_prio |= WIPHY_WLAN_BE_PREFERRED;
7514
7515 if (btcoex_priority->wlan_bk_preferred)
7516 btcoex_prio |= WIPHY_WLAN_BK_PREFERRED;
7517
7518 if (btcoex_priority->wlan_vi_preferred)
7519 btcoex_prio |= WIPHY_WLAN_VI_PREFERRED;
7520
7521 if (btcoex_priority->wlan_vo_preferred)
7522 btcoex_prio |= WIPHY_WLAN_VO_PREFERRED;
7523
7524 if (btcoex_priority->wlan_beacon_preferred)
7525 btcoex_prio |= WIPHY_WLAN_BEACON_PREFERRED;
7526
7527 if (btcoex_priority->wlan_mgmt_preferred)
> 7528 btcoex_prio |= WIPHY_WLAN_MGMT_PREFERRED;
7529
7530 return btcoex_prio;
7531 }
7532
7533 static int ath10k_mac_op_set_btcoex_priority(struct ieee80211_hw *hw,
7534 struct cfg80211_btcoex_priority *btcoex_priority)
7535 {
7536 u32 btcoex_prio;
7537 struct ath10k *ar = hw->priv;
7538 int ret;
7539
7540 if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags))) {
7541 ret = -EINVAL;
7542 goto exit;
7543 }
7544
7545 mutex_lock(&ar->conf_mutex);
7546
7547 if (ar->state != ATH10K_STATE_ON &&
7548 ar->state != ATH10K_STATE_RESTARTED) {
7549 ret = -ENETDOWN;
7550 goto exit;
7551 }
7552
> 7553 btcoex_prio = ath10k_mac_get_btcoex_prio(btcoex_priority);
7554
7555 if (btcoex_prio > 0x3f)
7556 return -E2BIG;
---
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: 46112 bytes --]
^ permalink raw reply
* Re: [3/3] rsi: Updated boot parameters
From: Kalle Valo @ 2016-11-09 1:08 UTC (permalink / raw)
To: Prameela Rani Garnepudi
Cc: linux-wireless, johannes.berg, hofrat, xypron.glpk,
prameela.garnepudi, Prameela Rani Garnepudi
In-Reply-To: <1476358025-15576-1-git-send-email-prameela.j04cs@gmail.com>
Prameela Rani Garnepudi <prameela.j04cs@gmail.com> wrote:
> * Switch clock info is divided in to different clock information fields for
> readability and synchronization with firmware code.
> * Other parameters are added for future use and to make the frame size in sync
> with latest firmware. Otherwise firmware will discard the frame considering
> corrupted frame.
>
> Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
This looks broken and no reply to my comment.
Patch set to Changes Requested.
--
https://patchwork.kernel.org/patch/9374883/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [1/2] rsi: New firware loading method for RSI 91X devices
From: Kalle Valo @ 2016-11-09 1:15 UTC (permalink / raw)
To: Prameela Rani Garnepudi
Cc: linux-wireless, johannes.berg, hofrat, xypron.glpk,
prameela.garnepudi, Prameela Rani Garnepudi
In-Reply-To: <1477044595-10348-1-git-send-email-prameela.j04cs@gmail.com>
Prameela Rani Garnepudi <prameela.j04cs@gmail.com> wrote:
> RSI deprecated the old firmware loading method and introduced
> new method using soft boot loader for 9113 chipsets.
> Current driver only supports 9113 device model hence firmware
> loading method has been changed.
>
> In the new method, complete RAM image and flash image are present
> in the flash. Two firmwares present in the device, Boot loader firmware
> and functional firmware. Boot loader firmware is fixed but functional
> firmware can be changed. Before loading the functional firmware, host
> issues commands to check whether existing firmware in the chip and the
> firmware file content to load are same or not. If not, host issues
> commands to load the RAM image and then boot loaded switches to the
> functioanl firmware.
>
> Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
These two patches are quite big, difficult to review. Smaller changes
would help with that. Will review later.
2 patches set to Deferred.
9388629 [1/2] rsi: New firware loading method for RSI 91X devices
9388627 [2/2] rsi: Device initialization sequence is changed
--
https://patchwork.kernel.org/patch/9388629/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH] wireless: fix bogus maybe-uninitialized warning
From: Kalle Valo @ 2016-11-09 1:21 UTC (permalink / raw)
To: Arnd Bergmann, Johannes Berg
Cc: Stanislav Yakovlev, Jouni Malinen, David S. Miller,
linux-wireless, netdev, linux-kernel
In-Reply-To: <20161024153918.2810634-2-arnd@arndb.de>
Arnd Bergmann <arnd@arndb.de> writes:
> The hostap_80211_rx() function is supposed to set up the mac addresses
> for four possible cases, based on two bits of input data. For
> some reason, gcc decides that it's possible that none of the these
> four cases apply and the addresses remain uninitialized:
>
> drivers/net/wireless/intersil/hostap/hostap_80211_rx.c: In function =E2=
=80=98hostap_80211_rx=E2=80=99:
> arch/x86/include/asm/string_32.h:77:14: warning: =E2=80=98src=E2=80=99 ma=
y be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/net/wireless/intel/ipw2x00/libipw_rx.c: In function =E2=80=98libi=
pw_rx=E2=80=99:
> arch/x86/include/asm/string_32.h:77:14: error: =E2=80=98dst=E2=80=99 may =
be used uninitialized in this function [-Werror=3Dmaybe-uninitialized]
> arch/x86/include/asm/string_32.h:78:22: error: =E2=80=98*((void *)&dst+4)=
=E2=80=99 may be used uninitialized in this function [-Werror=3Dmaybe-unini=
tialized]
>
> This warning is clearly nonsense, but changing the last case into
> 'default' makes it obvious to the compiler too, which avoids the
> warning and probably leads to better object code too.
>
> The same code is duplicated several times in the kernel, so this
> patch uses the same workaround for all copies. The exact configuration
> was hit only very rarely in randconfig builds and I only saw it
> in three drivers, but I assume that all of them are potentially
> affected, and it's better to keep the code consistent.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/net/wireless/ath/ath6kl/wmi.c | 8 ++++----
> drivers/net/wireless/intel/ipw2x00/libipw_rx.c | 2 +-
> drivers/net/wireless/intersil/hostap/hostap_80211_rx.c | 2 +-
> net/wireless/lib80211_crypt_tkip.c | 2 +-
> 4 files changed, 7 insertions(+), 7 deletions(-)
[...]
> --- a/net/wireless/lib80211_crypt_tkip.c
> +++ b/net/wireless/lib80211_crypt_tkip.c
> @@ -556,7 +556,7 @@ static void michael_mic_hdr(struct sk_buff *skb, u8 *=
hdr)
> memcpy(hdr, hdr11->addr3, ETH_ALEN); /* DA */
> memcpy(hdr + ETH_ALEN, hdr11->addr4, ETH_ALEN); /* SA */
> break;
> - case 0:
> + default:
> memcpy(hdr, hdr11->addr1, ETH_ALEN); /* DA */
> memcpy(hdr + ETH_ALEN, hdr11->addr2, ETH_ALEN); /* SA */
> break;
Ideally we prefer that drivers/net/wireless and net/wireless changes are
split into different patches as they get applied to different trees.
Johannes, is it ok if I take this change through my tree this time?
--=20
Kalle Valo
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox