From d9300b721f47846f9f55957275c4bda512722da9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sun, 28 Jul 2019 16:13:47 +0200 Subject: [PATCH] mac80211: brcm: update brcmfmac 5.4 patches MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Use commits from wireless-drivers-next.git. Signed-off-by: Rafał Miłecki (cherry picked from commit 95745e26b319c630a49d2b8284f8afeaa30506da) --- ...350-v5.4-brcmfmac-use-strlcpy-instead-of-strcpy.patch | 2 +- ...0001-brcmfmac-add-160MHz-in-chandef_to_chanspec.patch | 5 +++-- ...t-brcmfmac-fix-NULL-pointer-derefence-during-US.patch | 5 +++-- ...fmac-change-the-order-of-things-in-brcmf_detach.patch | 5 +++-- ...mac-avoid-firmware-command-in-brcmf_netdev_open.patch | 9 +++++---- ...mac-clear-events-in-brcmf_fweh_detach-will-alwa.patch | 7 ++++--- ...cmfmac-avoid-firmware-commands-when-bus-is-down.patch | 5 +++-- ...-brcmfmac-simply-remove-flowring-if-bus-is-down.patch | 7 ++++--- ...mac-remove-unnecessary-strlcpy-upon-obtaining-v.patch | 9 +++++---- ...mac-workaround-bug-with-some-inconsistent-BSSes.patch | 2 +- .../patches/862-brcmfmac-Disable-power-management.patch | 2 +- 11 files changed, 33 insertions(+), 25 deletions(-) diff --git a/package/kernel/mac80211/patches/350-v5.4-brcmfmac-use-strlcpy-instead-of-strcpy.patch b/package/kernel/mac80211/patches/350-v5.4-brcmfmac-use-strlcpy-instead-of-strcpy.patch index 8731a99fd7..e1420e7e00 100644 --- a/package/kernel/mac80211/patches/350-v5.4-brcmfmac-use-strlcpy-instead-of-strcpy.patch +++ b/package/kernel/mac80211/patches/350-v5.4-brcmfmac-use-strlcpy-instead-of-strcpy.patch @@ -15,7 +15,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c -@@ -269,7 +269,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i +@@ -157,7 +157,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i /* query for 'ver' to get version info from firmware */ memset(buf, 0, sizeof(buf)); diff --git a/package/kernel/mac80211/patches/351-v5.4-0001-brcmfmac-add-160MHz-in-chandef_to_chanspec.patch b/package/kernel/mac80211/patches/351-v5.4-0001-brcmfmac-add-160MHz-in-chandef_to_chanspec.patch index a3a3006c90..d7dce12d93 100644 --- a/package/kernel/mac80211/patches/351-v5.4-0001-brcmfmac-add-160MHz-in-chandef_to_chanspec.patch +++ b/package/kernel/mac80211/patches/351-v5.4-0001-brcmfmac-add-160MHz-in-chandef_to_chanspec.patch @@ -1,7 +1,7 @@ -From 46f24cd5980de4302982d38ebb6620560ead10b3 Mon Sep 17 00:00:00 2001 +From f491645f039420fb7e14283e21b90772571c807c Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Thu, 11 Jul 2019 10:45:30 +0200 -Subject: [PATCH 1/3] brcmfmac: add 160MHz in chandef_to_chanspec() +Subject: [PATCH] brcmfmac: add 160MHz in chandef_to_chanspec() The function chandef_to_chanspec() was not handling 160MHz bandwidth resulting in wrong encoding of the channel. That resulting in firmware @@ -11,6 +11,7 @@ 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 | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/package/kernel/mac80211/patches/352-v5.4-0001-Revert-brcmfmac-fix-NULL-pointer-derefence-during-US.patch b/package/kernel/mac80211/patches/352-v5.4-0001-Revert-brcmfmac-fix-NULL-pointer-derefence-during-US.patch index 8b556836d6..9259cf2b67 100644 --- a/package/kernel/mac80211/patches/352-v5.4-0001-Revert-brcmfmac-fix-NULL-pointer-derefence-during-US.patch +++ b/package/kernel/mac80211/patches/352-v5.4-0001-Revert-brcmfmac-fix-NULL-pointer-derefence-during-US.patch @@ -1,13 +1,14 @@ -From 7acf04a0ae2adf5d3e9de9adeec3129e74bf6ef2 Mon Sep 17 00:00:00 2001 +From a84a60ccdd65278485fb495f468a5ab91a75c649 Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Thu, 11 Jul 2019 11:05:06 +0200 -Subject: [PATCH 1/7] Revert "brcmfmac: fix NULL pointer derefence during USB +Subject: [PATCH] Revert "brcmfmac: fix NULL pointer derefence during USB disconnect" This reverts commit 5cdb0ef6144f47440850553579aa923c20a63f23. Subsequent changes make rework the driver code fixing the issue differently. Signed-off-by: Arend van Spriel +Signed-off-by: Kalle Valo --- .../wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 11 ++--------- .../wireless/broadcom/brcm80211/brcmfmac/bcdc.h | 6 ++---- diff --git a/package/kernel/mac80211/patches/352-v5.4-0002-brcmfmac-change-the-order-of-things-in-brcmf_detach.patch b/package/kernel/mac80211/patches/352-v5.4-0002-brcmfmac-change-the-order-of-things-in-brcmf_detach.patch index be140854a9..877e8c0435 100644 --- a/package/kernel/mac80211/patches/352-v5.4-0002-brcmfmac-change-the-order-of-things-in-brcmf_detach.patch +++ b/package/kernel/mac80211/patches/352-v5.4-0002-brcmfmac-change-the-order-of-things-in-brcmf_detach.patch @@ -1,7 +1,7 @@ -From 701fb69f2c36cba83583990e67a3925f920fd96a Mon Sep 17 00:00:00 2001 +From 14fcfd1cc0c05ea58f47dd693fdd13f25dfe995e Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Thu, 11 Jul 2019 11:05:07 +0200 -Subject: [PATCH 2/7] brcmfmac: change the order of things in brcmf_detach() +Subject: [PATCH] brcmfmac: change the order of things in brcmf_detach() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -18,6 +18,7 @@ Reviewed-by: Pieter-Paul Giesberts Reviewed-by: Franky Lin Signed-off-by: Arend van Spriel Tested-by: Rafał Miłecki +Signed-off-by: Kalle Valo --- .../broadcom/brcm80211/brcmfmac/core.c | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/package/kernel/mac80211/patches/352-v5.4-0003-brcmfmac-avoid-firmware-command-in-brcmf_netdev_open.patch b/package/kernel/mac80211/patches/352-v5.4-0003-brcmfmac-avoid-firmware-command-in-brcmf_netdev_open.patch index 567abe0d21..da25184cdf 100644 --- a/package/kernel/mac80211/patches/352-v5.4-0003-brcmfmac-avoid-firmware-command-in-brcmf_netdev_open.patch +++ b/package/kernel/mac80211/patches/352-v5.4-0003-brcmfmac-avoid-firmware-command-in-brcmf_netdev_open.patch @@ -1,8 +1,8 @@ -From 1be747d977014fea13dbac0de885c0c358eb393c Mon Sep 17 00:00:00 2001 +From c613085b74941024194e41b200601b9aa6ee388f Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Thu, 11 Jul 2019 11:05:08 +0200 -Subject: [PATCH 3/7] brcmfmac: avoid firmware command in brcmf_netdev_open() - when bus is down +Subject: [PATCH] brcmfmac: avoid firmware command in brcmf_netdev_open() when + bus is down No point in sending a firmware command when bus is down so make it conditional checking the state. @@ -11,13 +11,14 @@ 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/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -@@ -589,7 +589,8 @@ static int brcmf_netdev_stop(struct net_ +@@ -558,7 +558,8 @@ static int brcmf_netdev_stop(struct net_ brcmf_cfg80211_down(ndev); diff --git a/package/kernel/mac80211/patches/352-v5.4-0004-brcmfmac-clear-events-in-brcmf_fweh_detach-will-alwa.patch b/package/kernel/mac80211/patches/352-v5.4-0004-brcmfmac-clear-events-in-brcmf_fweh_detach-will-alwa.patch index 8483249db6..4ce1517734 100644 --- a/package/kernel/mac80211/patches/352-v5.4-0004-brcmfmac-clear-events-in-brcmf_fweh_detach-will-alwa.patch +++ b/package/kernel/mac80211/patches/352-v5.4-0004-brcmfmac-clear-events-in-brcmf_fweh_detach-will-alwa.patch @@ -1,7 +1,7 @@ -From 0d91defd7bfc42c0ed053ba03b5ea2eff2e1d2f5 Mon Sep 17 00:00:00 2001 +From c33330ac06fe863289643e7a13ecdb6a2502dad7 Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Thu, 11 Jul 2019 11:05:09 +0200 -Subject: [PATCH 4/7] brcmfmac: clear events in brcmf_fweh_detach() will always +Subject: [PATCH] brcmfmac: clear events in brcmf_fweh_detach() will always fail Clearing firmware events in brcmf_fweh_detach() is always failing @@ -12,13 +12,14 @@ 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/fweh.c | 9 --------- 1 file changed, 9 deletions(-) --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c -@@ -314,16 +314,7 @@ void brcmf_fweh_attach(struct brcmf_pub +@@ -319,16 +319,7 @@ void brcmf_fweh_attach(struct brcmf_pub void brcmf_fweh_detach(struct brcmf_pub *drvr) { struct brcmf_fweh_info *fweh = &drvr->fweh; diff --git a/package/kernel/mac80211/patches/352-v5.4-0005-brcmfmac-avoid-firmware-commands-when-bus-is-down.patch b/package/kernel/mac80211/patches/352-v5.4-0005-brcmfmac-avoid-firmware-commands-when-bus-is-down.patch index 39a19286ca..fa9e29f0c3 100644 --- a/package/kernel/mac80211/patches/352-v5.4-0005-brcmfmac-avoid-firmware-commands-when-bus-is-down.patch +++ b/package/kernel/mac80211/patches/352-v5.4-0005-brcmfmac-avoid-firmware-commands-when-bus-is-down.patch @@ -1,7 +1,7 @@ -From 66ab63fbb33bf367807e3e471231379dce6f8b8c Mon Sep 17 00:00:00 2001 +From 1ac11ae949dd883854f4523ef8e3a32aabfd6256 Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Thu, 11 Jul 2019 11:05:10 +0200 -Subject: [PATCH 5/7] brcmfmac: avoid firmware commands when bus is down +Subject: [PATCH] brcmfmac: avoid firmware commands when bus is down Upon rmmod a few attempts are made to inform firmware, but there is no point as the bus is down and these will fail. Avoid them to keep @@ -12,6 +12,7 @@ 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 | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/package/kernel/mac80211/patches/352-v5.4-0006-brcmfmac-simply-remove-flowring-if-bus-is-down.patch b/package/kernel/mac80211/patches/352-v5.4-0006-brcmfmac-simply-remove-flowring-if-bus-is-down.patch index fd010f2a8f..f4381bd63a 100644 --- a/package/kernel/mac80211/patches/352-v5.4-0006-brcmfmac-simply-remove-flowring-if-bus-is-down.patch +++ b/package/kernel/mac80211/patches/352-v5.4-0006-brcmfmac-simply-remove-flowring-if-bus-is-down.patch @@ -1,7 +1,7 @@ -From dabf1e17d33e087d4e24e6d0224cf9bc04ebfcc1 Mon Sep 17 00:00:00 2001 +From e0bfb9601d4812719167cc4124a0d6db1e2f55e4 Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Thu, 11 Jul 2019 11:05:11 +0200 -Subject: [PATCH 6/7] brcmfmac: simply remove flowring if bus is down +Subject: [PATCH] brcmfmac: simply remove flowring if bus is down When the bus is down, eg. due to rmmod, there is no need to attempt to inform firmware about it. @@ -10,13 +10,14 @@ 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/msgbuf.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c -@@ -1408,6 +1408,13 @@ void brcmf_msgbuf_delete_flowring(struct +@@ -1406,6 +1406,13 @@ void brcmf_msgbuf_delete_flowring(struct u8 ifidx; int err; diff --git a/package/kernel/mac80211/patches/352-v5.4-0007-brcmfmac-remove-unnecessary-strlcpy-upon-obtaining-v.patch b/package/kernel/mac80211/patches/352-v5.4-0007-brcmfmac-remove-unnecessary-strlcpy-upon-obtaining-v.patch index a1fcebd512..e09570cb2f 100644 --- a/package/kernel/mac80211/patches/352-v5.4-0007-brcmfmac-remove-unnecessary-strlcpy-upon-obtaining-v.patch +++ b/package/kernel/mac80211/patches/352-v5.4-0007-brcmfmac-remove-unnecessary-strlcpy-upon-obtaining-v.patch @@ -1,8 +1,8 @@ -From 979c9a17fc78f3b8393fd92ca250fe4239872eee Mon Sep 17 00:00:00 2001 +From 4b11c915f00caeef3292ed0429acc579b9da762a Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Thu, 11 Jul 2019 11:05:12 +0200 -Subject: [PATCH 7/7] brcmfmac: remove unnecessary strlcpy() upon obtaining - "ver" iovar +Subject: [PATCH] brcmfmac: remove unnecessary strlcpy() upon obtaining "ver" + iovar Recently a strcpy() was replaced by strlcpy(). However, the strcpy() was not needed in the first place. So removing that line of code. @@ -11,13 +11,14 @@ 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/common.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c -@@ -269,7 +269,6 @@ int brcmf_c_preinit_dcmds(struct brcmf_i +@@ -157,7 +157,6 @@ int brcmf_c_preinit_dcmds(struct brcmf_i /* query for 'ver' to get version info from firmware */ memset(buf, 0, sizeof(buf)); 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 912fe8ca14..0e447c445f 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 -@@ -639,8 +639,36 @@ static struct wireless_dev *brcmf_cfg802 +@@ -681,8 +681,36 @@ static struct wireless_dev *brcmf_cfg802 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct brcmf_pub *drvr = cfg->pub; struct wireless_dev *wdev; 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 578b3e0399..5714359d81 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 -@@ -2798,6 +2798,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip +@@ -2846,6 +2846,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip * preference in cfg struct to apply this to * FW later while initializing the dongle */ -- 2.25.1