* [RFC PATCH 1/2] nl80211: implement NL80211_CMD_GET_BEACON command
From: Sergey Matyukevich @ 2017-11-09 9:40 UTC (permalink / raw)
To: linux-wireless, Johannes Berg
Cc: Igor Mitsyanko, Avinash Patil, Vasily Ulyanov, Sergey Matyukevich
From: Vasily Ulyanov <vulyanov@quantenna.com>
Implement nl80211_get_beacon callback which returns current beacon
configuration. The actual data is saved on .start_ap and .set_beacon calls.
Signed-off-by: Vasily Ulyanov <vulyanov@quantenna.com>
---
include/net/cfg80211.h | 3 +
include/uapi/linux/nl80211.h | 5 +-
net/wireless/nl80211.c | 220 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 227 insertions(+), 1 deletion(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 8b8118a7fadb..31d39e066274 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4002,6 +4002,8 @@ struct cfg80211_cqm_config;
* the user-set channel definition.
* @preset_chandef: (private) Used by the internal configuration code to
* track the channel to be used for AP later
+ * @beacon: (private) Used by the internal configuration code to track
+ * the user-set effective beacon data.
* @bssid: (private) Used by the internal configuration code
* @ssid: (private) Used by the internal configuration code
* @ssid_len: (private) Used by the internal configuration code
@@ -4078,6 +4080,7 @@ struct wireless_dev {
struct cfg80211_internal_bss *current_bss; /* associated / joined */
struct cfg80211_chan_def preset_chandef;
struct cfg80211_chan_def chandef;
+ struct cfg80211_beacon_data beacon;
bool ibss_fixed;
bool ibss_dfs_possible;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index f882fe1f9709..e9e163bbe11a 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -279,7 +279,10 @@
* @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
* or %NL80211_ATTR_MAC.
*
- * @NL80211_CMD_GET_BEACON: (not used)
+ * @NL80211_CMD_GET_BEACON: Get beacon attributes on an access point interface.
+ * %NL80211_ATTR_BEACON_HEAD, %NL80211_ATTR_BEACON_TAIL, %NL80211_ATTR_IE,
+ * %NL80211_ATTR_IE_PROBE_RESP, NL80211_ATTR_IE_ASSOC_RESP,
+ * %NL80211_ATTR_PROBE_RESP will be returned if present.
* @NL80211_CMD_SET_BEACON: change the beacon on an access point interface
* using the %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL
* attributes. For drivers that generate the beacon and probe responses
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index fce2cbe6a193..f03f9989efbc 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3784,6 +3784,172 @@ static int nl80211_parse_beacon(struct nlattr *attrs[],
return 0;
}
+static size_t nl80211_beacon_size(struct cfg80211_beacon_data *bcn)
+{
+ size_t size = bcn->head_len + bcn->tail_len +
+ bcn->beacon_ies_len +
+ bcn->proberesp_ies_len +
+ bcn->assocresp_ies_len +
+ bcn->probe_resp_len;
+
+ return size;
+}
+
+static void nl80211_free_beacon(struct cfg80211_beacon_data *bcn)
+{
+#define free_and_null(member) \
+ do { \
+ kfree(bcn->member); \
+ bcn->member = NULL; \
+ bcn->member ## _len = 0; \
+ } while (0)
+
+ free_and_null(head);
+ free_and_null(tail);
+ free_and_null(beacon_ies);
+ free_and_null(proberesp_ies);
+ free_and_null(assocresp_ies);
+ free_and_null(probe_resp);
+
+#undef free_and_null
+}
+
+static int nl80211_dup_beacon(struct cfg80211_beacon_data *dst,
+ struct cfg80211_beacon_data *src)
+{
+ memset(dst, 0, sizeof(*dst));
+
+#define check_and_dup(member) \
+ do { \
+ if (src->member && (src->member ## _len > 0)) { \
+ dst->member = kmemdup(src->member, \
+ src->member ## _len, \
+ GFP_KERNEL); \
+ if (!dst->member) \
+ goto dup_failure; \
+ dst->member ## _len = src->member ## _len; \
+ } \
+ } while (0)
+
+ check_and_dup(head);
+ check_and_dup(tail);
+ check_and_dup(beacon_ies);
+ check_and_dup(proberesp_ies);
+ check_and_dup(assocresp_ies);
+ check_and_dup(probe_resp);
+
+#undef dup_and_check
+
+ return 0;
+
+dup_failure:
+ nl80211_free_beacon(dst);
+ return -ENOMEM;
+}
+
+static int nl80211_merge_beacons(struct cfg80211_beacon_data *dst,
+ struct cfg80211_beacon_data *old,
+ struct cfg80211_beacon_data *new)
+{
+ memset(dst, 0, sizeof(*dst));
+
+#define check_and_merge(member) \
+ do { \
+ if (new->member && (new->member ## _len > 0)) { \
+ dst->member = kmemdup(new->member, \
+ new->member ## _len, \
+ GFP_KERNEL); \
+ if (!dst->member) \
+ goto dup_failure; \
+ dst->member ## _len = new->member ## _len; \
+ } else if (old->member && (old->member ## _len > 0)) { \
+ dst->member = kmemdup(old->member, \
+ old->member ## _len, \
+ GFP_KERNEL); \
+ if (!dst->member) \
+ goto dup_failure; \
+ dst->member ## _len = old->member ## _len; \
+ } \
+ } while (0)
+
+ check_and_merge(head);
+ check_and_merge(tail);
+ check_and_merge(beacon_ies);
+ check_and_merge(proberesp_ies);
+ check_and_merge(assocresp_ies);
+ check_and_merge(probe_resp);
+
+#undef check_and_merge
+
+ return 0;
+
+dup_failure:
+ nl80211_free_beacon(dst);
+ return -ENOMEM;
+}
+
+static void nl80211_assign_beacon(struct cfg80211_beacon_data *dst,
+ struct cfg80211_beacon_data *src)
+{
+ nl80211_free_beacon(dst);
+ *dst = *src;
+}
+
+static int nl80211_send_beacon(struct sk_buff *msg, u32 portid,
+ enum nl80211_commands cmd,
+ u32 seq, int flags,
+ struct cfg80211_beacon_data *bcn)
+{
+ void *hdr;
+
+ hdr = nl80211hdr_put(msg, portid, seq, flags, cmd);
+ if (!hdr)
+ return -EMSGSIZE;
+
+ if (bcn->head && (bcn->head_len > 0)) {
+ if (nla_put(msg, NL80211_ATTR_BEACON_HEAD,
+ bcn->head_len, bcn->head))
+ goto nla_put_failure;
+ }
+
+ if (bcn->tail && (bcn->tail_len > 0)) {
+ if (nla_put(msg, NL80211_ATTR_BEACON_TAIL,
+ bcn->tail_len, bcn->tail))
+ goto nla_put_failure;
+ }
+
+ if (bcn->beacon_ies && (bcn->beacon_ies_len > 0)) {
+ if (nla_put(msg, NL80211_ATTR_IE,
+ bcn->beacon_ies_len, bcn->beacon_ies))
+ goto nla_put_failure;
+ }
+
+ if (bcn->proberesp_ies && (bcn->proberesp_ies_len > 0)) {
+ if (nla_put(msg, NL80211_ATTR_IE_PROBE_RESP,
+ bcn->proberesp_ies_len, bcn->proberesp_ies))
+ goto nla_put_failure;
+ }
+
+ if (bcn->assocresp_ies && (bcn->assocresp_ies_len > 0)) {
+ if (nla_put(msg, NL80211_ATTR_IE_ASSOC_RESP,
+ bcn->assocresp_ies_len, bcn->assocresp_ies))
+ goto nla_put_failure;
+ }
+
+ if (bcn->probe_resp && (bcn->probe_resp_len > 0)) {
+ if (nla_put(msg, NL80211_ATTR_PROBE_RESP,
+ bcn->probe_resp_len, bcn->probe_resp))
+ goto nla_put_failure;
+ }
+
+ genlmsg_end(msg, hdr);
+ return 0;
+
+nla_put_failure:
+ genlmsg_cancel(msg, hdr);
+ return -EMSGSIZE;
+}
+
static void nl80211_check_ap_rate_selectors(struct cfg80211_ap_settings *params,
const u8 *rates)
{
@@ -3903,6 +4069,7 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
struct net_device *dev = info->user_ptr[1];
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_ap_settings params;
+ struct cfg80211_beacon_data new_bcn;
int err;
if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
@@ -4070,6 +4237,10 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
nl80211_calculate_ap_params(¶ms);
+ err = nl80211_dup_beacon(&new_bcn, ¶ms.beacon);
+ if (err)
+ goto dup_failure;
+
wdev_lock(wdev);
err = rdev_start_ap(rdev, dev, ¶ms);
if (!err) {
@@ -4078,20 +4249,52 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
wdev->chandef = params.chandef;
wdev->ssid_len = params.ssid_len;
memcpy(wdev->ssid, params.ssid, wdev->ssid_len);
+ nl80211_assign_beacon(&wdev->beacon, &new_bcn);
}
wdev_unlock(wdev);
+ if (err)
+ nl80211_free_beacon(&new_bcn);
+
+dup_failure:
kfree(params.acl);
return err;
}
+static int nl80211_get_beacon(struct sk_buff *skb, struct genl_info *info)
+{
+ struct net_device *dev = info->user_ptr[1];
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct sk_buff *msg;
+
+ if (wdev->iftype != NL80211_IFTYPE_AP &&
+ wdev->iftype != NL80211_IFTYPE_P2P_GO)
+ return -EOPNOTSUPP;
+
+ if (!wdev->beacon_interval)
+ return -EINVAL;
+
+ msg = nlmsg_new(nl80211_beacon_size(&wdev->beacon), GFP_KERNEL);
+ if (!msg)
+ return -ENOMEM;
+
+ if (nl80211_send_beacon(msg, NL80211_CMD_GET_BEACON, info->snd_portid,
+ info->snd_seq, 0, &wdev->beacon) < 0) {
+ nlmsg_free(msg);
+ return -ENOBUFS;
+ }
+
+ return genlmsg_reply(msg, info);
+}
+
static int nl80211_set_beacon(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 wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_beacon_data params;
+ struct cfg80211_beacon_data merged_bcn;
int err;
if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
@@ -4108,10 +4311,19 @@ static int nl80211_set_beacon(struct sk_buff *skb, struct genl_info *info)
if (err)
return err;
+ err = nl80211_merge_beacons(&merged_bcn, &wdev->beacon, ¶ms);
+ if (err)
+ return err;
+
wdev_lock(wdev);
err = rdev_change_beacon(rdev, dev, ¶ms);
+ if (!err)
+ nl80211_assign_beacon(&wdev->beacon, &merged_bcn);
wdev_unlock(wdev);
+ if (err)
+ nl80211_free_beacon(&merged_bcn);
+
return err;
}
@@ -12595,6 +12807,14 @@ static const struct genl_ops nl80211_ops[] = {
NL80211_FLAG_NEED_RTNL,
},
{
+ .cmd = NL80211_CMD_GET_BEACON,
+ .policy = nl80211_policy,
+ .flags = GENL_UNS_ADMIN_PERM,
+ .doit = nl80211_get_beacon,
+ .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
+ NL80211_FLAG_NEED_RTNL,
+ },
+ {
.cmd = NL80211_CMD_SET_BEACON,
.policy = nl80211_policy,
.flags = GENL_UNS_ADMIN_PERM,
--
2.11.0
^ permalink raw reply related
* [PATCH] ath10k: Re-enable TXQs for all devices
From: Toke Høiland-Jørgensen @ 2017-11-09 7:19 UTC (permalink / raw)
To: make-wifi-fast, linux-wireless; +Cc: Toke Høiland-Jørgensen
Commit 4ca1807815aa6801aaced7fdefa9edacc2521767 disables the use of the
mac80211 TXQs for some devices because of a theoretical throughput
regression. We have not seen this regression for a while now, so it
should be safe to re-enable TXQs.
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
---
This has been in LEDE trunk for a couple of months now with good results.
drivers/net/wireless/ath/ath10k/mac.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 0a947eef348d..ca596ecd2d64 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -8329,15 +8329,6 @@ int ath10k_mac_register(struct ath10k *ar)
ath10k_warn(ar, "failed to initialise DFS pattern detector\n");
}
- /* Current wake_tx_queue implementation imposes a significant
- * performance penalty in some setups. The tx scheduling code needs
- * more work anyway so disable the wake_tx_queue unless firmware
- * supports the pull-push mechanism.
- */
- if (!test_bit(ATH10K_FW_FEATURE_PEER_FLOW_CONTROL,
- ar->running_fw->fw_file.fw_features))
- ar->ops->wake_tx_queue = NULL;
-
ret = ath10k_mac_init_rd(ar);
if (ret) {
ath10k_err(ar, "failed to derive regdom: %d\n", ret);
--
2.15.0
^ permalink raw reply related
* Re: Need support for Intel new wifi module 9462NGW
From: Luca Coelho @ 2017-11-09 6:29 UTC (permalink / raw)
To: Chris Chiu
Cc: johannes.berg, linuxwifi, linux-wireless, Linux Upstreaming Team
In-Reply-To: <CAB4CAwcwVEyFX=7KJcAT9eXQoof_M+U+tB+FRQCnoP5WgK-MrQ@mail.gmail.com>
Hi Chris,
On Thu, 2017-11-09 at 11:11 +0800, Chris Chiu wrote:
> Hi Luca,
> Any suggestion for the "Failed to start INIT ucode: -110" issue
> for the firmware?
We are investigating this now. This seems to be related to the secure
boot key not being valid...
I'll let you know when we progress on this.
--
Cheers,
Luca.
^ permalink raw reply
* Re: Need support for Intel new wifi module 9462NGW
From: Chris Chiu @ 2017-11-09 3:11 UTC (permalink / raw)
To: Luca Coelho
Cc: johannes.berg, linuxwifi, linux-wireless, Linux Upstreaming Team
In-Reply-To: <CAB4CAwc0G0j1zb+Z4z6iCJ2hzMznUsSVxyF8G3dbZn9pxzffng@mail.gmail.com>
Hi Luca,
Any suggestion for the "Failed to start INIT ucode: -110" issue
for the firmware?
Chris
On Tue, Nov 7, 2017 at 12:26 PM, Chris Chiu <chiu@endlessm.com> wrote:
> Hi Luca,
> I just tried the firmware but seems still something wrong. dmesg
> shows me the following
>
> [ 17.786041] Intel(R) Wireless WiFi driver for Linux
> [ 17.786042] Copyright(c) 2003- 2015 Intel Corporation
> [ 18.120052] iwlwifi 0000:00:0c.0: loaded firmware version
> 33.610294.0 op_mode iwlmvm
> [ 20.995731] iwlwifi 0000:00:0c.0: Detected Intel(R) Dual Band
> Wireless AC 9460, REV=0x318
> [ 22.012109] iwlwifi 0000:00:0c.0: SecBoot CPU1 Status: 0x3, CPU2
> Status: 0x2339
> [ 22.012115] iwlwifi 0000:00:0c.0: Failed to start INIT ucode: -110
> [ 22.024100] iwlwifi 0000:00:0c.0: Failed to run INIT ucode: -110
>
> Any more information you need from me?
>
> Chris
>
> On Mon, Nov 6, 2017 at 3:22 PM, Luca Coelho <luca@coelho.fi> wrote:
>> On Mon, 2017-11-06 at 11:22 +0800, Chris Chiu wrote:
>>> Hi Luca,
>>
>> Hi Chris,
>>
>>
>>> Any update for the firmware approval?
>>
>> Yes, I published it last Thursday. Sorry, I was in such a hurry that I
>> forgot to tell you about it.
>>
>> You can find it here:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware.git/plain/iwlwifi-9260-th-b0-jf-b0-33.ucode?id=f132386b542b52ade0416ecb6cb7aef426f5d175
>>
>> Let me know how it goes.
>>
>> --
>> Cheers,
>> Luca.
^ permalink raw reply
* [PATCH V2 1/7] brcmfmac: handle FWHALT mailbox indication
From: Arend van Spriel @ 2017-11-08 13:36 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Arend Van Spriel
In-Reply-To: <1510148197-17851-1-git-send-email-arend.vanspriel@broadcom.com>
From: Arend Van Spriel <arend.vanspriel@broadcom.com>
The firmware uses a mailbox to communicate to the host what is going
on. In the driver we validate the bit received. Various people seen
the following message:
brcmfmac: brcmf_sdio_hostmail: Unknown mailbox data content: 0x40012
Bit 4 is cause of this message, but this actually indicates the firmware
has halted. Handle this bit by giving a more meaningful error message.
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index 5adce0e..00de73d 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -260,10 +260,11 @@ struct rte_console {
#define I_HMB_HOST_INT I_HMB_SW3 /* Miscellaneous Interrupt */
/* tohostmailboxdata */
-#define HMB_DATA_NAKHANDLED 1 /* retransmit NAK'd frame */
-#define HMB_DATA_DEVREADY 2 /* talk to host after enable */
-#define HMB_DATA_FC 4 /* per prio flowcontrol update flag */
-#define HMB_DATA_FWREADY 8 /* fw ready for protocol activity */
+#define HMB_DATA_NAKHANDLED 0x0001 /* retransmit NAK'd frame */
+#define HMB_DATA_DEVREADY 0x0002 /* talk to host after enable */
+#define HMB_DATA_FC 0x0004 /* per prio flowcontrol update flag */
+#define HMB_DATA_FWREADY 0x0008 /* fw ready for protocol activity */
+#define HMB_DATA_FWHALT 0x0010 /* firmware halted */
#define HMB_DATA_FCDATA_MASK 0xff000000
#define HMB_DATA_FCDATA_SHIFT 24
@@ -1094,6 +1095,10 @@ static u32 brcmf_sdio_hostmail(struct brcmf_sdio *bus)
offsetof(struct sdpcmd_regs, tosbmailbox));
bus->sdcnt.f1regdata += 2;
+ /* dongle indicates the firmware has halted/crashed */
+ if (hmb_data & HMB_DATA_FWHALT)
+ brcmf_err("mailbox indicates firmware halted\n");
+
/* Dongle recomposed rx frames, accept them again */
if (hmb_data & HMB_DATA_NAKHANDLED) {
brcmf_dbg(SDIO, "Dongle reports NAK handled, expect rtx of %d\n",
@@ -1151,6 +1156,7 @@ static u32 brcmf_sdio_hostmail(struct brcmf_sdio *bus)
HMB_DATA_NAKHANDLED |
HMB_DATA_FC |
HMB_DATA_FWREADY |
+ HMB_DATA_FWHALT |
HMB_DATA_FCDATA_MASK | HMB_DATA_VERSION_MASK))
brcmf_err("Unknown mailbox data content: 0x%02x\n",
hmb_data);
--
1.9.1
^ permalink raw reply related
* [PATCH V2 2/7] brcmfmac: disable packet filtering in promiscuous mode
From: Arend van Spriel @ 2017-11-08 13:36 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Franky Lin, Arend van Spriel
In-Reply-To: <1510148197-17851-1-git-send-email-arend.vanspriel@broadcom.com>
From: Franky Lin <franky.lin@broadcom.com>
Disable arp and nd offload to allow all packets sending to host.
Reported-by: Phil Elwell <phil@raspberrypi.org>
Tested-by: Phil Elwell <phil@raspberrypi.org>
Reviewed-by: Arend Van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 41 ----------------------
.../wireless/broadcom/brcm80211/brcmfmac/core.c | 38 ++++++++++++++++++++
.../wireless/broadcom/brcm80211/brcmfmac/core.h | 1 +
3 files changed, 39 insertions(+), 41 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 4bfd43a..051d51d 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -472,47 +472,6 @@ static void convert_key_from_CPU(struct brcmf_wsec_key *key,
return err;
}
-static s32
-brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable)
-{
- s32 err;
- u32 mode;
-
- if (enable)
- mode = BRCMF_ARP_OL_AGENT | BRCMF_ARP_OL_PEER_AUTO_REPLY;
- else
- mode = 0;
-
- /* Try to set and enable ARP offload feature, this may fail, then it */
- /* is simply not supported and err 0 will be returned */
- err = brcmf_fil_iovar_int_set(ifp, "arp_ol", mode);
- if (err) {
- brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n",
- mode, err);
- err = 0;
- } else {
- err = brcmf_fil_iovar_int_set(ifp, "arpoe", enable);
- if (err) {
- brcmf_dbg(TRACE, "failed to configure (%d) ARP offload err = %d\n",
- enable, err);
- err = 0;
- } else
- brcmf_dbg(TRACE, "successfully configured (%d) ARP offload to 0x%x\n",
- enable, mode);
- }
-
- err = brcmf_fil_iovar_int_set(ifp, "ndoe", enable);
- if (err) {
- brcmf_dbg(TRACE, "failed to configure (%d) ND offload err = %d\n",
- enable, err);
- err = 0;
- } else
- brcmf_dbg(TRACE, "successfully configured (%d) ND offload to 0x%x\n",
- enable, mode);
-
- return err;
-}
-
static void
brcmf_cfg80211_update_proto_addr_mode(struct wireless_dev *wdev)
{
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
index 5cc3a07..9c7536d 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
@@ -71,6 +71,43 @@ struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx)
return ifp;
}
+void brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable)
+{
+ s32 err;
+ u32 mode;
+
+ if (enable)
+ mode = BRCMF_ARP_OL_AGENT | BRCMF_ARP_OL_PEER_AUTO_REPLY;
+ else
+ mode = 0;
+
+ /* Try to set and enable ARP offload feature, this may fail, then it */
+ /* is simply not supported and err 0 will be returned */
+ err = brcmf_fil_iovar_int_set(ifp, "arp_ol", mode);
+ if (err) {
+ brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n",
+ mode, err);
+ } else {
+ err = brcmf_fil_iovar_int_set(ifp, "arpoe", enable);
+ if (err) {
+ brcmf_dbg(TRACE, "failed to configure (%d) ARP offload err = %d\n",
+ enable, err);
+ } else {
+ brcmf_dbg(TRACE, "successfully configured (%d) ARP offload to 0x%x\n",
+ enable, mode);
+ }
+ }
+
+ err = brcmf_fil_iovar_int_set(ifp, "ndoe", enable);
+ if (err) {
+ brcmf_dbg(TRACE, "failed to configure (%d) ND offload err = %d\n",
+ enable, err);
+ } else {
+ brcmf_dbg(TRACE, "successfully configured (%d) ND offload to 0x%x\n",
+ enable, mode);
+ }
+}
+
static void _brcmf_set_multicast_list(struct work_struct *work)
{
struct brcmf_if *ifp;
@@ -134,6 +171,7 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
if (err < 0)
brcmf_err("Setting BRCMF_C_SET_PROMISC failed, %d\n",
err);
+ brcmf_configure_arp_nd_offload(ifp, !cmd_value);
}
#if IS_ENABLED(CONFIG_IPV6)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
index a4dd313..1708571 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
@@ -203,6 +203,7 @@ struct brcmf_if {
/* Return pointer to interface name */
char *brcmf_ifname(struct brcmf_if *ifp);
struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx);
+void brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable);
int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked);
struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx,
bool is_p2pdev, const char *name, u8 *mac_addr);
--
1.9.1
^ permalink raw reply related
* [PATCH V2 4/7] brcmfmac: use msecs_to_jiffies() instead of calculation using HZ
From: Arend van Spriel @ 2017-11-08 13:36 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Arend Van Spriel
In-Reply-To: <1510148197-17851-1-git-send-email-arend.vanspriel@broadcom.com>
From: Arend Van Spriel <arend.vanspriel@broadcom.com>
Minor cleanup using provided macro to convert milliseconds interval
to jiffies in brcmf_cfg80211_escan().
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 1283798..afdf6bb 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -1115,8 +1115,8 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
goto scan_out;
/* Arm scan timeout timer */
- mod_timer(&cfg->escan_timeout, jiffies +
- BRCMF_ESCAN_TIMER_INTERVAL_MS * HZ / 1000);
+ mod_timer(&cfg->escan_timeout,
+ jiffies + msecs_to_jiffies(BRCMF_ESCAN_TIMER_INTERVAL_MS));
return 0;
--
1.9.1
^ permalink raw reply related
* [PATCH V2 6/7] brcmfmac: get rid of struct brcmf_cfg80211_info::active_scan field
From: Arend van Spriel @ 2017-11-08 13:36 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Arend Van Spriel
In-Reply-To: <1510148197-17851-1-git-send-email-arend.vanspriel@broadcom.com>
From: Arend Van Spriel <arend.vanspriel@broadcom.com>
The field struct brcmf_cfg80211_info::active_scan is set to true upon
initializing the driver instance, but it is never changed so simply
get rid of it.
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 10 +---------
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h | 2 --
drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 5 +----
3 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 31a80a6..9b334e2 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -1043,7 +1043,6 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
{
struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
s32 err;
- u32 passive_scan;
struct brcmf_scan_results *results;
struct escan_info *escan = &cfg->escan_info;
@@ -1051,13 +1050,7 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
escan->ifp = ifp;
escan->wiphy = cfg->wiphy;
escan->escan_state = WL_ESCAN_STATE_SCANNING;
- passive_scan = cfg->active_scan ? 0 : 1;
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PASSIVE_SCAN,
- passive_scan);
- if (err) {
- brcmf_err("error (%d)\n", err);
- return err;
- }
+
brcmf_scan_config_mpc(ifp, 0);
results = (struct brcmf_scan_results *)cfg->escan_info.escan_buf;
results->version = 0;
@@ -5767,7 +5760,6 @@ static s32 wl_init_priv(struct brcmf_cfg80211_info *cfg)
cfg->scan_request = NULL;
cfg->pwr_save = true;
- cfg->active_scan = true; /* we do active scan per default */
cfg->dongle_up = false; /* dongle is not up yet */
err = brcmf_init_priv_mem(cfg);
if (err)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
index 7b2835e..b5b5f0f 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
@@ -283,7 +283,6 @@ struct brcmf_cfg80211_wowl {
* @scan_status: scan activity on the dongle.
* @pub: common driver information.
* @channel: current channel.
- * @active_scan: current scan mode.
* @int_escan_map: bucket map for which internal e-scan is done.
* @ibss_starter: indicates this sta is ibss starter.
* @pwr_save: indicate whether dongle to support power save mode.
@@ -316,7 +315,6 @@ struct brcmf_cfg80211_info {
unsigned long scan_status;
struct brcmf_pub *pub;
u32 channel;
- bool active_scan;
u32 int_escan_map;
bool ibss_starter;
bool pwr_save;
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
index 1c450c0..c6cccb8 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
@@ -692,10 +692,7 @@ static s32 brcmf_p2p_escan(struct brcmf_p2p_info *p2p, u32 num_chans,
/* determine the scan engine parameters */
sparams->bss_type = DOT11_BSSTYPE_ANY;
- if (p2p->cfg->active_scan)
- sparams->scan_type = 0;
- else
- sparams->scan_type = 1;
+ sparams->scan_type = BRCMF_SCANTYPE_ACTIVE;
eth_broadcast_addr(sparams->bssid);
sparams->home_time = cpu_to_le32(P2PAPI_SCAN_HOME_TIME_MS);
--
1.9.1
^ permalink raw reply related
* [PATCH V2 5/7] brcmfmac: get rid of brcmf_cfg80211_escan() function
From: Arend van Spriel @ 2017-11-08 13:36 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Arend Van Spriel
In-Reply-To: <1510148197-17851-1-git-send-email-arend.vanspriel@broadcom.com>
From: Arend Van Spriel <arend.vanspriel@broadcom.com>
The function brcmf_cfg80211_escan() is only called by brcmf_cfg80211_scan()
so there is no reason to split in two function especially since the latter
does not do an awful lot.
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 34 +++++++---------------
1 file changed, 10 insertions(+), 24 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index afdf6bb..31a80a6 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -1071,13 +1071,16 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
}
static s32
-brcmf_cfg80211_escan(struct wiphy *wiphy, struct brcmf_cfg80211_vif *vif,
- struct cfg80211_scan_request *request)
+brcmf_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
{
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- s32 err;
+ struct brcmf_cfg80211_vif *vif;
+ s32 err = 0;
- brcmf_dbg(SCAN, "START ESCAN\n");
+ brcmf_dbg(TRACE, "Enter\n");
+ vif = container_of(request->wdev, struct brcmf_cfg80211_vif, wdev);
+ if (!check_vif_up(vif))
+ return -EIO;
if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
brcmf_err("Scanning already: status (%lu)\n", cfg->scan_status);
@@ -1102,6 +1105,8 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
if (vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif)
vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
+ brcmf_dbg(SCAN, "START ESCAN\n");
+
cfg->scan_request = request;
set_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
@@ -1121,31 +1126,12 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
return 0;
scan_out:
+ brcmf_err("scan error (%d)\n", err);
clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
cfg->scan_request = NULL;
return err;
}
-static s32
-brcmf_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
-{
- struct brcmf_cfg80211_vif *vif;
- s32 err = 0;
-
- brcmf_dbg(TRACE, "Enter\n");
- vif = container_of(request->wdev, struct brcmf_cfg80211_vif, wdev);
- if (!check_vif_up(vif))
- return -EIO;
-
- err = brcmf_cfg80211_escan(wiphy, vif, request);
-
- if (err)
- brcmf_err("scan error (%d)\n", err);
-
- brcmf_dbg(TRACE, "Exit\n");
- return err;
-}
-
static s32 brcmf_set_rts(struct net_device *ndev, u32 rts_threshold)
{
s32 err = 0;
--
1.9.1
^ permalink raw reply related
* [PATCH V2 0/7] brcmfmac: firmware halt and scan cleanup
From: Arend van Spriel @ 2017-11-08 13:36 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Arend van Spriel
This series is a resubmission. No changes were being made compared
to the previous series.
* handling firmware halt indication.
* cleanup scan related code.
The series applies to the master branch of the wireless-drivers-next
repository and is intended for v4.15 kernel.
Arend Van Spriel (6):
brcmfmac: handle FWHALT mailbox indication
brcmfmac: cleanup brcmf_cfg80211_escan() function
brcmfmac: use msecs_to_jiffies() instead of calculation using HZ
brcmfmac: get rid of brcmf_cfg80211_escan() function
brcmfmac: get rid of struct brcmf_cfg80211_info::active_scan field
brcmfmac: move configuration of probe request IEs
Franky Lin (1):
brcmfmac: disable packet filtering in promiscuous mode
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 162 ++++-----------------
.../broadcom/brcm80211/brcmfmac/cfg80211.h | 2 -
.../wireless/broadcom/brcm80211/brcmfmac/core.c | 38 +++++
.../wireless/broadcom/brcm80211/brcmfmac/core.h | 1 +
.../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 11 +-
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 14 +-
6 files changed, 77 insertions(+), 151 deletions(-)
--
1.9.1
^ permalink raw reply
* [PATCH V2 7/7] brcmfmac: move configuration of probe request IEs
From: Arend van Spriel @ 2017-11-08 13:36 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Arend Van Spriel
In-Reply-To: <1510148197-17851-1-git-send-email-arend.vanspriel@broadcom.com>
From: Arend Van Spriel <arend.vanspriel@broadcom.com>
The configuration of the IEs for probe requests was done in a P2P
related function, which is not very obvious. Moving it to
.scan callback function, ie. brcmf_cfg80211_scan().
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 5 +++++
drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 6 ++----
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 9b334e2..6e70df9 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -1108,6 +1108,11 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
if (err)
goto scan_out;
+ err = brcmf_vif_set_mgmt_ie(vif, BRCMF_VNDR_IE_PRBREQ_FLAG,
+ request->ie, request->ie_len);
+ if (err)
+ goto scan_out;
+
err = brcmf_do_escan(vif->ifp, request);
if (err)
goto scan_out;
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
index c6cccb8..2ee5413 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
@@ -881,7 +881,7 @@ int brcmf_p2p_scan_prep(struct wiphy *wiphy,
{
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
struct brcmf_p2p_info *p2p = &cfg->p2p;
- int err = 0;
+ int err;
if (brcmf_p2p_scan_is_p2p_request(request)) {
/* find my listen channel */
@@ -904,9 +904,7 @@ int brcmf_p2p_scan_prep(struct wiphy *wiphy,
/* override .run_escan() callback. */
cfg->escan_info.run = brcmf_p2p_run_escan;
}
- err = brcmf_vif_set_mgmt_ie(vif, BRCMF_VNDR_IE_PRBREQ_FLAG,
- request->ie, request->ie_len);
- return err;
+ return 0;
}
--
1.9.1
^ permalink raw reply related
* [PATCH V2 3/7] brcmfmac: cleanup brcmf_cfg80211_escan() function
From: Arend van Spriel @ 2017-11-08 13:36 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Arend Van Spriel
In-Reply-To: <1510148197-17851-1-git-send-email-arend.vanspriel@broadcom.com>
From: Arend Van Spriel <arend.vanspriel@broadcom.com>
The function brcmf_cfg80211_escan() was always called with a non-null
request parameter and null pointer for this_ssid parameter. Clean up
the function removing the dead code path.
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 76 ++++------------------
1 file changed, 11 insertions(+), 65 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 051d51d..1283798 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -1072,18 +1072,10 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
static s32
brcmf_cfg80211_escan(struct wiphy *wiphy, struct brcmf_cfg80211_vif *vif,
- struct cfg80211_scan_request *request,
- struct cfg80211_ssid *this_ssid)
+ struct cfg80211_scan_request *request)
{
- struct brcmf_if *ifp = vif->ifp;
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- struct cfg80211_ssid *ssids;
- u32 passive_scan;
- bool escan_req;
- bool spec_scan;
s32 err;
- struct brcmf_ssid_le ssid_le;
- u32 SSID_len;
brcmf_dbg(SCAN, "START ESCAN\n");
@@ -1101,8 +1093,8 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
cfg->scan_status);
return -EAGAIN;
}
- if (test_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state)) {
- brcmf_err("Connecting: status (%lu)\n", ifp->vif->sme_state);
+ if (test_bit(BRCMF_VIF_STATUS_CONNECTING, &vif->sme_state)) {
+ brcmf_err("Connecting: status (%lu)\n", vif->sme_state);
return -EAGAIN;
}
@@ -1110,63 +1102,17 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
if (vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif)
vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
- escan_req = false;
- if (request) {
- /* scan bss */
- ssids = request->ssids;
- escan_req = true;
- } else {
- /* scan in ibss */
- /* we don't do escan in ibss */
- ssids = this_ssid;
- }
-
cfg->scan_request = request;
set_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
- if (escan_req) {
- cfg->escan_info.run = brcmf_run_escan;
- err = brcmf_p2p_scan_prep(wiphy, request, vif);
- if (err)
- goto scan_out;
-
- err = brcmf_do_escan(vif->ifp, request);
- if (err)
- goto scan_out;
- } else {
- brcmf_dbg(SCAN, "ssid \"%s\", ssid_len (%d)\n",
- ssids->ssid, ssids->ssid_len);
- memset(&ssid_le, 0, sizeof(ssid_le));
- SSID_len = min_t(u8, sizeof(ssid_le.SSID), ssids->ssid_len);
- ssid_le.SSID_len = cpu_to_le32(0);
- spec_scan = false;
- if (SSID_len) {
- memcpy(ssid_le.SSID, ssids->ssid, SSID_len);
- ssid_le.SSID_len = cpu_to_le32(SSID_len);
- spec_scan = true;
- } else
- brcmf_dbg(SCAN, "Broadcast scan\n");
- passive_scan = cfg->active_scan ? 0 : 1;
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PASSIVE_SCAN,
- passive_scan);
- if (err) {
- brcmf_err("WLC_SET_PASSIVE_SCAN error (%d)\n", err);
- goto scan_out;
- }
- brcmf_scan_config_mpc(ifp, 0);
- err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCAN, &ssid_le,
- sizeof(ssid_le));
- if (err) {
- if (err == -EBUSY)
- brcmf_dbg(INFO, "BUSY: scan for \"%s\" canceled\n",
- ssid_le.SSID);
- else
- brcmf_err("WLC_SCAN error (%d)\n", err);
+ cfg->escan_info.run = brcmf_run_escan;
+ err = brcmf_p2p_scan_prep(wiphy, request, vif);
+ if (err)
+ goto scan_out;
- brcmf_scan_config_mpc(ifp, 1);
- goto scan_out;
- }
- }
+ err = brcmf_do_escan(vif->ifp, request);
+ if (err)
+ goto scan_out;
/* Arm scan timeout timer */
mod_timer(&cfg->escan_timeout, jiffies +
@@ -1191,7 +1137,7 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
if (!check_vif_up(vif))
return -EIO;
- err = brcmf_cfg80211_escan(wiphy, vif, request, NULL);
+ err = brcmf_cfg80211_escan(wiphy, vif, request);
if (err)
brcmf_err("scan error (%d)\n", err);
--
1.9.1
^ permalink raw reply related
* Re: [PATCH] brcmfmac: add support for external 32khz clock
From: Simon Shields @ 2017-11-08 13:31 UTC (permalink / raw)
To: Arend van Spriel
Cc: linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list,
devicetree, Franky Lin, Hante Meuleman, Chi-Hsien Lin,
Wright Feng, Stefan Wahren
In-Reply-To: <20171108114302.GA1291@lineageos.org>
On Wed, Nov 08, 2017 at 10:43:05PM +1100, Simon Shields wrote:
> Hi Arend,
>
> On Wed, Nov 08, 2017 at 11:38:11AM +0100, Arend van Spriel wrote:
> > + Stefan
> >
> > On 11/7/2017 2:31 PM, Simon Shields wrote:
> > > Hi Arend,
> > >
> > > On Tue, Nov 07, 2017 at 12:09:23PM +0100, Arend van Spriel wrote:
> > > > On 11/6/2017 12:27 PM, Simon Shields wrote:
> > > > > On Mon, Nov 06, 2017 at 11:59:37AM +0100, Arend van Spriel wrote:
> > > > > > On 11/4/2017 2:24 PM, Simon Shields wrote:
> > > > > > > Some boards use an external 32khz clock for low-power
> > > > > > > mode timing. Make sure the clock is powered on while the chipset
> > > > > > > is active.
> > > > > >
> > > > > > Do you have such a board? With the little documentation I can get my hands
> > > > > > on here I wonder whether the clock needs to be enabled before the device is
> > > > > > powered. If you have the hardware I would like to check some registers in
> > > > > > the device.
> > > > > >
> > > > >
> > > > > Yes. Trats2 (exynos4412-based) has such a setup. The BCM4334 works fine
> > > > > with this patch and one more that enables the WL_REG_EN pin when
> > > > > brcmfmac is probed.
> > > >
> > > > Ok. So this is exactly the thing I was wondering about. So it makes me
> > > > curious how the WL_REG_EN patch looks like. Can you provide that?
> > > >
> > >
> > > Here[0] is a link to the patch in its current state. Obviously, it's not
> > > ready at all for mainlining :-)
> > >
> > > [0]: https://github.com/fourkbomb/linux/commit/436e59e58b44d856c186fc4767560cecbcbc0c59.patch
> >
> > Thanks. Indeed doing it in module_init of brcmfmac is not going to fly.
> > Actually the MMC stack has a mechanism to power the SDIO device. This can be
> > configured through the device tree [1]. I just checked and it actually
> > includes specifying the external clock as well.
> >
>
> It looks like mmc-pwrseq-simple would handle the clock case, but it
> doesn't handle the regulator properly: it sets the GPIO to high before
> powering on, then lowers it immediately after powering it on.
>
> I guess a simpler approach here would be to extend pwrseq-simple to behave
> as we need it to.
I missed something really obvious... All that's needed is to invert the
GPIO, like this[0]. Thanks for the pointer :)
Cheers,
Simon
[0]: https://patchwork.kernel.org/patch/10048501/
^ permalink raw reply
* Re: Update regulatory rules for Denmark (DK) on 2.4 and 5GHz
From: Seth Forshee @ 2017-11-08 13:13 UTC (permalink / raw)
To: Per Mejdal Rasmussen; +Cc: wireless-regdb, linux-wireless
In-Reply-To: <0b1762cd-761d-ebe3-a88e-4a2b1823c51f@its.aau.dk>
On Tue, Nov 07, 2017 at 03:48:12PM +0100, Per Mejdal Rasmussen wrote:
> Hi
>
> I have taken the time research which frequencies and power levels are
> allowed for WiFi in Denmark. So db.txt for wireless-regdb can be updated.
Thanks for this information. I know I've been slow to respond, but
there's no need to keep resending them. I've been looking through the
documents trying to validate the changes you suggested, but my time for
doing so has been limited so I haven't finished yet. I hope to be able
to send a detailed response soon.
Thanks,
Seth
^ permalink raw reply
* Re: zd1201: remove unused variable framelen
From: Kalle Valo @ 2017-11-08 12:54 UTC (permalink / raw)
To: Colin Ian King; +Cc: linux-wireless, netdev, kernel-janitors, linux-kernel
In-Reply-To: <20171107185630.7791-1-colin.king@canonical.com>
Colin Ian King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Variable framelen is assigned but never read, hence it is redundant
> and can be removed. Cleans up clang warning:
>
> drivers/net/wireless/zydas/zd1201.c:234:3: warning: Value stored
> to 'framelen' is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Patch applied to wireless-drivers-next.git, thanks.
03e40f1e7680 zd1201: remove unused variable framelen
--
https://patchwork.kernel.org/patch/10047145/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: orinoco_usb: remove redundant pointer dev
From: Kalle Valo @ 2017-11-08 12:52 UTC (permalink / raw)
To: Colin Ian King; +Cc: linux-wireless, netdev, kernel-janitors, linux-kernel
In-Reply-To: <20171103134528.8415-1-colin.king@canonical.com>
Colin Ian King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The pointer dev is assigned but never read, hence it is redundant
> and can be removed. Cleans up clang warning:
>
> drivers/net/wireless/intersil/orinoco/orinoco_usb.c:1468:2: warning:
> Value stored to 'dev' is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Patch applied to wireless-drivers-next.git, thanks.
9b741b2a3148 orinoco_usb: remove redundant pointer dev
--
https://patchwork.kernel.org/patch/10040113/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: iwlegacy: remove redundant pointer sta_priv
From: Kalle Valo @ 2017-11-08 12:50 UTC (permalink / raw)
To: Colin Ian King
Cc: Stanislaw Gruszka, linux-wireless, netdev, kernel-janitors,
linux-kernel
In-Reply-To: <20171101092622.16625-1-colin.king@canonical.com>
Colin Ian King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Pointer sta_priv is assigned but never read, hence it is redundant
> and can be removed. Cleans up clang warning:
>
> drivers/net/wireless/intel/iwlegacy/4965-rs.c:2163:2: warning: Value
> stored to 'sta_priv' is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Patch applied to wireless-drivers-next.git, thanks.
6c6e25311312 iwlegacy: remove redundant pointer sta_priv
--
https://patchwork.kernel.org/patch/10036047/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [08/11] rtlwifi: rtl_pci: Refactor TX/RX flow
From: Kalle Valo @ 2017-11-08 12:48 UTC (permalink / raw)
To: Larry Finger
Cc: linux-wireless, Steven Ting, Ping-Ke Shih, Larry Finger,
Yan-Hsuan Chuang, Birming Chiu, Shaofu
In-Reply-To: <20171101152926.24971-9-Larry.Finger@lwfinger.net>
Larry Finger <Larry.Finger@lwfinger.net> wrote:
> From: Steven Ting <steventing@realtek.com>
>
> After this refactoring, the variables wp and rp in TX ring can only be
> updated in OP_TX and TX_OK respectively without protection. The other
> changes are listed below:
>
> 1. remove avl_desc from TX ring, because it can be calculated by wp and rp.
> Moreover, we update this variable in op_tx (thread context) and TX_OK
> (BH context) without protection.
> 2. extend calc_fifo_space(rp, wp) to calc_fifo_space(rp, wp, size), and fix
> the caller's parameter 'size'.
> 3. Get RX remaining counter only if it count down to zero.
> 4. remove available_desc check from Tx ISR
>
> Signed-off-by: Steven Ting <steventing@realtek.com>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
> Cc: Birming Chiu <birming@realtek.com>
> Cc: Shaofu <shaofu@realtek.com>
Dropping the rest of the series based on my comments.
4 patches set to Changes Requested.
10036501 [08/11] rtlwifi: rtl_pci: Refactor TX/RX flow
10036503 [09/11] rtlwifi: rtl_pci: 8822BE puts broadcast and multicast packet to HIQ
10036507 [10/11] rtlwifi: Add beacon check mechanism to check if AP settings changed.
10036505 [11/11] rtlwifi: rtl_pci: Fix the bug when inactiveps is enabled.
--
https://patchwork.kernel.org/patch/10036501/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: rtlwifi: remove redundant initialization to cfg_cmd
From: Kalle Valo @ 2017-11-08 12:45 UTC (permalink / raw)
To: Colin Ian King
Cc: Larry Finger, Chaoming Li, linux-wireless, netdev,
kernel-janitors, linux-kernel
In-Reply-To: <20171104193759.919-1-colin.king@canonical.com>
Colin Ian King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> cfg_cmd is initialized to zero and this value is never read, instead
> it is over-written in the start of a do-while loop. Remove the
> redundant initialization. Cleans up clang warning:
>
> drivers/net/wireless/realtek/rtlwifi/core.c:1750:22: warning: Value
> stored to 'cfg_cmd' during its initialization is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Patch applied to wireless-drivers-next.git, thanks.
f80ead1cd5fa rtlwifi: remove redundant initialization to cfg_cmd
--
https://patchwork.kernel.org/patch/10041685/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: rtlwifi: remove redundant pointer tid_data
From: Kalle Valo @ 2017-11-08 12:44 UTC (permalink / raw)
To: Colin Ian King
Cc: Larry Finger, Chaoming Li, linux-wireless, netdev,
kernel-janitors, linux-kernel
In-Reply-To: <20171103140922.8926-1-colin.king@canonical.com>
Colin Ian King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> tid_data is assigned but never read, hence it is redundant
> and can be removed. Cleans up clang warning:
>
> drivers/net/wireless/realtek/rtlwifi/base.c:1581:2: warning: Value
> stored to 'tid_data' is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Patch applied to wireless-drivers-next.git, thanks.
82e730e521ce rtlwifi: remove redundant pointer tid_data
--
https://patchwork.kernel.org/patch/10040293/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [1/3] rtlwifi: fix uninitialized rtlhal->last_suspend_sec time
From: Kalle Valo @ 2017-11-08 12:38 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Larry Finger, Chaoming Li, Arnd Bergmann, stable, linux-wireless,
netdev, linux-kernel
In-Reply-To: <20171106135619.1248453-1-arnd@arndb.de>
Arnd Bergmann <arnd@arndb.de> wrote:
> We set rtlhal->last_suspend_sec to an uninitialized stack variable,
> but unfortunately gcc never warned about this, I only found it
> while working on another patch. I opened a gcc bug for this.
>
> Presumably the value of rtlhal->last_suspend_sec is not all that
> important, but it does get used, so we probably want the
> patch backported to stable kernels.
>
> Cc: stable@vger.kernel.org
> Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82839
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
3 patches applied to wireless-drivers-next.git, thanks.
3f2a162fab15 rtlwifi: fix uninitialized rtlhal->last_suspend_sec time
3c92d5517af8 rtlwifi: use ktime_get_real_seconds() for suspend time
ac978dc79a91 rtlwifi: drop unused ppsc->last_wakeup_time
--
https://patchwork.kernel.org/patch/10043505/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [01/11] rtlwifi: rtl_pci: Fix formatting errors in pci.h
From: Kalle Valo @ 2017-11-08 12:32 UTC (permalink / raw)
To: Larry Finger
Cc: linux-wireless, Larry Finger, Ping-Ke Shih, Yan-Hsuan Chuang,
Birming Chiu, Shaofu, Steven Ting
In-Reply-To: <20171101152926.24971-2-Larry.Finger@lwfinger.net>
Larry Finger <Larry.Finger@lwfinger.net> wrote:
> Checkpatch.pl reports a number of formatting problems in this header
> file. None of the changes cause any functional changes in the driver.
>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Ping-Ke Shih <pkshih@realtek.com>
> Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
> Cc: Birming Chiu <birming@realtek.com>
> Cc: Shaofu <shaofu@realtek.com>
> Cc: Steven Ting <steventing@realtek.com>
7 patches applied to wireless-drivers-next.git, thanks.
6bc05d5d8e9d rtlwifi: rtl_pci: Fix formatting errors in pci.h
ae0122b6793d rtlwifi: rtl_pci: Fix formatting problems in pci.c
5f647f4dfe41 rtlwifi: rtl_pci: Simplify some code be eliminating extraneous variables
57869e4ba77a rtlwifi: rtl_pci: Add support for 8822be TX/RX BD
89d3e8abcf24 rtlwifi: rtl_pci: Add fill_tx_special_desc to issue H2C data, and process TXOK in interrupt.
68929a838000 rtlwifi: rtl_pci: Add ID for 8822BE
c1b586402c15 rtlwifi: rtl_pci: Extend recognized interrupt parameters from two to four ISR
--
https://patchwork.kernel.org/patch/10036495/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH 08/11] rtlwifi: rtl_pci: Refactor TX/RX flow
From: Kalle Valo @ 2017-11-08 12:25 UTC (permalink / raw)
To: Larry Finger
Cc: linux-wireless, Steven Ting, Ping-Ke Shih, Yan-Hsuan Chuang,
Birming Chiu, Shaofu
In-Reply-To: <20171101152926.24971-9-Larry.Finger@lwfinger.net>
Larry Finger <Larry.Finger@lwfinger.net> writes:
> From: Steven Ting <steventing@realtek.com>
>
> After this refactoring, the variables wp and rp in TX ring can only be
> updated in OP_TX and TX_OK respectively without protection.
Why? Try to always answer that, that's the most important part of the
commit log. Are you fixing a bug (if yes, describe it briefly), is this
just code cleanup or what's your motivation to change the code?
> The other changes are listed below:
>
> 1. remove avl_desc from TX ring, because it can be calculated by wp and rp.
> Moreover, we update this variable in op_tx (thread context) and TX_OK
> (BH context) without protection.
> 2. extend calc_fifo_space(rp, wp) to calc_fifo_space(rp, wp, size), and fix
> the caller's parameter 'size'.
> 3. Get RX remaining counter only if it count down to zero.
> 4. remove available_desc check from Tx ISR
One logical change per patch, please. One good rule of thumb is that if
you have to list the changes made in patch you need to split the patch.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 07/11] rtlwifi: rtl_pci: Extend recognized interrupt parameters from two to four ISR
From: Kalle Valo @ 2017-11-08 12:19 UTC (permalink / raw)
To: Larry Finger
Cc: linux-wireless, Ping-Ke Shih, Yan-Hsuan Chuang, Birming Chiu,
Shaofu, Steven Ting
In-Reply-To: <20171101152926.24971-8-Larry.Finger@lwfinger.net>
Larry Finger <Larry.Finger@lwfinger.net> writes:
> From: Ping-Ke Shih <pkshih@realtek.com>
>
> 8822be checks H2CQ by int_d, so we extend to four ISR.
> Also, irq_mask is extended to four.
>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
> Cc: Birming Chiu <birming@realtek.com>
> Cc: Shaofu <shaofu@realtek.com>
> Cc: Steven Ting <steventing@realtek.com>
[...]
> @@ -936,7 +937,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
> rtlpriv->cfg->ops->disable_interrupt(hw);
>
> /*read ISR: 4/8bytes */
> - rtlpriv->cfg->ops->interrupt_recognized(hw, &inta, &intb);
> + rtlpriv->cfg->ops->interrupt_recognized(hw, &inta, &intb, &intc, &intd);
>
> /*Shared IRQ or HW disappeared */
> if (!inta || inta == 0xffff)
> diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.h b/drivers/net/wireless/realtek/rtlwifi/pci.h
> index ce33fe7bc7c4..e7d070e8da2d 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/pci.h
> +++ b/drivers/net/wireless/realtek/rtlwifi/pci.h
> @@ -211,7 +211,7 @@ struct rtl_pci {
>
> /*irq */
> u8 irq_alloc;
> - u32 irq_mask[2];
> + u32 irq_mask[4]; /* 0-1: normal, 2: unused, 3: h2c */
> u32 sys_irq_mask;
>
> /*Bcn control register setting */
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
> index 2c671364c521..e30a18e64ff5 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
> @@ -1472,7 +1472,8 @@ void rtl88ee_card_disable(struct ieee80211_hw *hw)
> }
>
> void rtl88ee_interrupt_recognized(struct ieee80211_hw *hw,
> - u32 *p_inta, u32 *p_intb)
> + u32 *p_inta, u32 *p_intb,
> + u32 *p_intc, u32 *p_intd)
> {
In the future you might want to convert this to a struct which is a lot
easier to handle. But no need to resend because of this.
--
Kalle Valo
^ permalink raw reply
* Re: [1/7] brcmfmac: handle FWHALT mailbox indication
From: Kalle Valo @ 2017-11-08 12:05 UTC (permalink / raw)
To: Arend van Spriel; +Cc: linux-wireless
In-Reply-To: <5A02DCC0.8000406@broadcom.com>
Arend van Spriel <arend.vanspriel@broadcom.com> writes:
> Hi Kalle,
>
> I was preparing a new patch series and got a bit confused. Turns out
> there was a series still pending in patchwork.
>
> https://patchwork.kernel.org/patch/9948825/
That's not pending, it's in "Changes Requested" meaning that I have
dropped them:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#checking_state_of_patches_from_patchwork
"Deferred" is the state when patch is pending an action from me. Yes,
patchwork state names suck :)
> So I applied the pending series on wireless-drivers-next and it
> compiles fine. So what I think happened is that the series depended on
> a patch that was submitted to wireless-drivers at that time. Can these
> patches be taken now or do I need to resubmit.
To keep things simple I would prefer you resubmit them. I'm at Netdev
2.2 right now so on a quite tight schedule to get everything ready
before the weekend when the merge window opens.
--
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