From 2811c97803e50e9964a2c23b9d8271f0265bcdca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 18 Jun 2018 07:09:14 +0200 Subject: mac80211: backport brcmfmac firmware & clm_blob loading rework MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It backports remaining brcmfmac changes from 4.17. Signed-off-by: Rafał Miłecki (cherry picked from commit 7e8eb7f309a802ba10a13ddb807c6a31fecc9183) --- ...mfmac-register-wiphy-s-during-module_init.patch | 60 +++++++--------------- 1 file changed, 19 insertions(+), 41 deletions(-) (limited to 'package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch') 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 63849f48db..3afffc0fc4 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 @@ -23,66 +23,44 @@ Signed-off-by: Rafał Miłecki } --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c -@@ -445,6 +445,7 @@ struct brcmf_fw { - u16 bus_nr; - void (*done)(struct device *dev, int err, const struct firmware *fw, - void *nvram_image, u32 nvram_len); +@@ -441,6 +441,7 @@ struct brcmf_fw { + struct brcmf_fw_request *req; + u32 curpos; + void (*done)(struct device *dev, int err, struct brcmf_fw_request *req); + struct completion *completion; }; - static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx) -@@ -479,6 +480,8 @@ static void brcmf_fw_request_nvram_done( - goto fail; - - fwctx->done(fwctx->dev, 0, fwctx->code, nvram, nvram_length); -+ if (fwctx->completion) -+ complete(fwctx->completion); - kfree(fwctx); - return; - -@@ -486,6 +489,8 @@ fail: - brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev)); - release_firmware(fwctx->code); - fwctx->done(fwctx->dev, -ENOENT, NULL, NULL, 0); -+ if (fwctx->completion) -+ complete(fwctx->completion); - kfree(fwctx); - } - -@@ -517,6 +522,8 @@ fail: - brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev)); + static void brcmf_fw_request_done(const struct firmware *fw, void *ctx); +@@ -589,6 +590,8 @@ fail: + fwctx->req = NULL; done: - fwctx->done(fwctx->dev, ret, fw, NULL, 0); + fwctx->done(fwctx->dev, ret, fwctx->req); + if (fwctx->completion) + complete(fwctx->completion); kfree(fwctx); } -@@ -528,6 +535,8 @@ int brcmf_fw_get_firmwares_pcie(struct d - u16 domain_nr, u16 bus_nr) +@@ -612,6 +615,8 @@ int brcmf_fw_get_firmwares(struct device + struct brcmf_fw_request *req)) { struct brcmf_fw *fwctx; + struct completion completion; + int err; brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(dev)); - if (!fw_cb || !code) -@@ -548,9 +557,17 @@ int brcmf_fw_get_firmwares_pcie(struct d - fwctx->domain_nr = domain_nr; - fwctx->bus_nr = bus_nr; + if (!fw_cb) +@@ -628,7 +633,14 @@ int brcmf_fw_get_firmwares(struct device + fwctx->req = req; + fwctx->done = fw_cb; -- return request_firmware_nowait(THIS_MODULE, true, code, dev, + init_completion(&completion); + fwctx->completion = &completion; + -+ err = request_firmware_nowait(THIS_MODULE, true, code, dev, - GFP_KERNEL, fwctx, - brcmf_fw_request_code_done); -+ if (!err) -+ wait_for_completion_timeout(fwctx->completion, -+ msecs_to_jiffies(5000)); + brcmf_fw_request_next_item(fwctx, true); ++ ++ wait_for_completion_timeout(fwctx->completion, msecs_to_jiffies(5000)); + fwctx->completion = NULL; -+ return err; ++ + return 0; } - int brcmf_fw_get_firmwares(struct device *dev, u16 flags, -- cgit v1.2.3