From: Rafał Miłecki Date: Thu, 1 Mar 2018 13:55:08 +0000 (+0100) Subject: mac80211: brcmfmac: firmware halt and scan cleanup X-Git-Tag: v18.06.0-rc1~748 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c29a2a4283d71ae0c7b7d8fcbc27dbb1f94b3521;p=oweals%2Fopenwrt.git mac80211: brcmfmac: firmware halt and scan cleanup Signed-off-by: Rafał Miłecki --- diff --git a/package/kernel/mac80211/patches/303-v4.15-0001-brcmfmac-handle-FWHALT-mailbox-indication.patch b/package/kernel/mac80211/patches/303-v4.15-0001-brcmfmac-handle-FWHALT-mailbox-indication.patch new file mode 100644 index 0000000000..b8f3be1c8b --- /dev/null +++ b/package/kernel/mac80211/patches/303-v4.15-0001-brcmfmac-handle-FWHALT-mailbox-indication.patch @@ -0,0 +1,60 @@ +From 2fd3877b5bb7d39782c3205a1dcda02023b8514a Mon Sep 17 00:00:00 2001 +From: Arend Van Spriel +Date: Wed, 8 Nov 2017 14:36:31 +0100 +Subject: [PATCH] brcmfmac: handle FWHALT mailbox indication + +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 +Reviewed-by: Pieter-Paul Giesberts +Reviewed-by: Franky Lin +Signed-off-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +--- 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 br + 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 br + 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); diff --git a/package/kernel/mac80211/patches/303-v4.15-0002-brcmfmac-disable-packet-filtering-in-promiscuous-mod.patch b/package/kernel/mac80211/patches/303-v4.15-0002-brcmfmac-disable-packet-filtering-in-promiscuous-mod.patch new file mode 100644 index 0000000000..901663193a --- /dev/null +++ b/package/kernel/mac80211/patches/303-v4.15-0002-brcmfmac-disable-packet-filtering-in-promiscuous-mod.patch @@ -0,0 +1,133 @@ +From 6c219b0088158da839a5be63c5b3d96c145501d2 Mon Sep 17 00:00:00 2001 +From: Franky Lin +Date: Wed, 8 Nov 2017 14:36:32 +0100 +Subject: [PATCH] brcmfmac: disable packet filtering in promiscuous mode + +Disable arp and nd offload to allow all packets sending to host. + +Reported-by: Phil Elwell +Tested-by: Phil Elwell +Reviewed-by: Arend Van Spriel +Signed-off-by: Franky Lin +Signed-off-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + .../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(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -472,47 +472,6 @@ send_key_to_dongle(struct brcmf_if *ifp, + 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) + { +--- 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 br + 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(st + 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) +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +@@ -203,6 +203,7 @@ int brcmf_netdev_wait_pend8021x(struct b + /* 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); diff --git a/package/kernel/mac80211/patches/303-v4.15-0003-brcmfmac-cleanup-brcmf_cfg80211_escan-function.patch b/package/kernel/mac80211/patches/303-v4.15-0003-brcmfmac-cleanup-brcmf_cfg80211_escan-function.patch new file mode 100644 index 0000000000..ffd2db7620 --- /dev/null +++ b/package/kernel/mac80211/patches/303-v4.15-0003-brcmfmac-cleanup-brcmf_cfg80211_escan-function.patch @@ -0,0 +1,131 @@ +From 8c6efda22f5f9f73fc948f517424466be01ae84d Mon Sep 17 00:00:00 2001 +From: Arend Van Spriel +Date: Wed, 8 Nov 2017 14:36:33 +0100 +Subject: [PATCH] brcmfmac: cleanup brcmf_cfg80211_escan() function + +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 +Reviewed-by: Pieter-Paul Giesberts +Reviewed-by: Franky Lin +Signed-off-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + .../broadcom/brcm80211/brcmfmac/cfg80211.c | 76 ++++------------------ + 1 file changed, 11 insertions(+), 65 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -1072,18 +1072,10 @@ brcmf_do_escan(struct brcmf_if *ifp, str + + 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 @@ brcmf_cfg80211_escan(struct wiphy *wiphy + 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 @@ brcmf_cfg80211_escan(struct wiphy *wiphy + 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 @@ brcmf_cfg80211_scan(struct wiphy *wiphy, + 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); diff --git a/package/kernel/mac80211/patches/303-v4.15-0004-brcmfmac-use-msecs_to_jiffies-instead-of-calculation.patch b/package/kernel/mac80211/patches/303-v4.15-0004-brcmfmac-use-msecs_to_jiffies-instead-of-calculation.patch new file mode 100644 index 0000000000..c2e3cba52d --- /dev/null +++ b/package/kernel/mac80211/patches/303-v4.15-0004-brcmfmac-use-msecs_to_jiffies-instead-of-calculation.patch @@ -0,0 +1,31 @@ +From df2d8388bc96c0f29d27d121f2a4cd054f8b3900 Mon Sep 17 00:00:00 2001 +From: Arend Van Spriel +Date: Wed, 8 Nov 2017 14:36:34 +0100 +Subject: [PATCH] brcmfmac: use msecs_to_jiffies() instead of calculation using + HZ + +Minor cleanup using provided macro to convert milliseconds interval +to jiffies in brcmf_cfg80211_escan(). + +Reviewed-by: Hante Meuleman +Reviewed-by: Pieter-Paul Giesberts +Reviewed-by: Franky Lin +Signed-off-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -1115,8 +1115,8 @@ brcmf_cfg80211_escan(struct wiphy *wiphy + 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; + diff --git a/package/kernel/mac80211/patches/303-v4.15-0005-brcmfmac-get-rid-of-brcmf_cfg80211_escan-function.patch b/package/kernel/mac80211/patches/303-v4.15-0005-brcmfmac-get-rid-of-brcmf_cfg80211_escan-function.patch new file mode 100644 index 0000000000..575ffb0183 --- /dev/null +++ b/package/kernel/mac80211/patches/303-v4.15-0005-brcmfmac-get-rid-of-brcmf_cfg80211_escan-function.patch @@ -0,0 +1,83 @@ +From 588378f15cff285ac81c929239ccba01d7f71d50 Mon Sep 17 00:00:00 2001 +From: Arend Van Spriel +Date: Wed, 8 Nov 2017 14:36:35 +0100 +Subject: [PATCH] brcmfmac: get rid of brcmf_cfg80211_escan() function + +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 +Reviewed-by: Pieter-Paul Giesberts +Reviewed-by: Franky Lin +Signed-off-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + .../broadcom/brcm80211/brcmfmac/cfg80211.c | 34 +++++++--------------- + 1 file changed, 10 insertions(+), 24 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -1071,13 +1071,16 @@ brcmf_do_escan(struct brcmf_if *ifp, str + } + + 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 @@ brcmf_cfg80211_escan(struct wiphy *wiphy + 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 @@ brcmf_cfg80211_escan(struct wiphy *wiphy + 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; diff --git a/package/kernel/mac80211/patches/303-v4.15-0006-brcmfmac-get-rid-of-struct-brcmf_cfg80211_info-activ.patch b/package/kernel/mac80211/patches/303-v4.15-0006-brcmfmac-get-rid-of-struct-brcmf_cfg80211_info-activ.patch new file mode 100644 index 0000000000..4d4235f4b0 --- /dev/null +++ b/package/kernel/mac80211/patches/303-v4.15-0006-brcmfmac-get-rid-of-struct-brcmf_cfg80211_info-activ.patch @@ -0,0 +1,86 @@ +From bbf35414cd23a9d7230bfd7046e1e2c26020e7eb Mon Sep 17 00:00:00 2001 +From: Arend Van Spriel +Date: Wed, 8 Nov 2017 14:36:36 +0100 +Subject: [PATCH] brcmfmac: get rid of struct brcmf_cfg80211_info::active_scan + field + +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 +Reviewed-by: Pieter-Paul Giesberts +Reviewed-by: Franky Lin +Signed-off-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + 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(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -1043,7 +1043,6 @@ brcmf_do_escan(struct brcmf_if *ifp, str + { + 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 @@ brcmf_do_escan(struct brcmf_if *ifp, str + 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_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) +--- 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; +--- 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_ + + /* 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); diff --git a/package/kernel/mac80211/patches/303-v4.15-0007-brcmfmac-move-configuration-of-probe-request-IEs.patch b/package/kernel/mac80211/patches/303-v4.15-0007-brcmfmac-move-configuration-of-probe-request-IEs.patch new file mode 100644 index 0000000000..3ad6e79db7 --- /dev/null +++ b/package/kernel/mac80211/patches/303-v4.15-0007-brcmfmac-move-configuration-of-probe-request-IEs.patch @@ -0,0 +1,55 @@ +From bd99a3013bdc00f8fc7534c657b39616792b4467 Mon Sep 17 00:00:00 2001 +From: Arend Van Spriel +Date: Wed, 8 Nov 2017 14:36:37 +0100 +Subject: [PATCH] brcmfmac: move configuration of probe request IEs + +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 +Reviewed-by: Pieter-Paul Giesberts +Reviewed-by: Franky Lin +Signed-off-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + 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(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -1108,6 +1108,11 @@ brcmf_cfg80211_scan(struct wiphy *wiphy, + 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; +--- 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 *wi + { + 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 *wi + /* 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; + } + + diff --git a/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch b/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch index cc29402c0b..599269d9e4 100644 --- a/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch +++ b/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch @@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -@@ -1198,6 +1198,7 @@ int __init brcmf_core_init(void) +@@ -1236,6 +1236,7 @@ int __init brcmf_core_init(void) { if (!schedule_work(&brcmf_driver_work)) return -EBUSY; diff --git a/package/kernel/mac80211/patches/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch b/package/kernel/mac80211/patches/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch index 7fc1e449d0..1345e85f6d 100644 --- a/package/kernel/mac80211/patches/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch +++ b/package/kernel/mac80211/patches/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch @@ -10,7 +10,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -655,9 +655,37 @@ static struct wireless_dev *brcmf_cfg802 +@@ -614,9 +614,37 @@ static struct wireless_dev *brcmf_cfg802 enum nl80211_iftype type, struct vif_params *params) { diff --git a/package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch b/package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch index 43f8fbf674..c02d00966e 100644 --- a/package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch +++ b/package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch @@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -2838,6 +2838,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip +@@ -2727,6 +2727,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip * preference in cfg struct to apply this to * FW later while initializing the dongle */