mac80211: brcmfmac: backport NVRAM loading improvements
[openwrt/staging/wigyori.git] / package / kernel / mac80211 / patches / brcm / 860-brcmfmac-register-wiphy-s-during-module_init.patch
index e707383..574fcb4 100644 (file)
@@ -23,7 +23,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
  }
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -441,6 +441,7 @@ struct brcmf_fw {
+@@ -442,6 +442,7 @@ struct brcmf_fw {
        struct brcmf_fw_request *req;
        u32 curpos;
        void (*done)(struct device *dev, int err, struct brcmf_fw_request *req);
@@ -31,33 +31,37 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
  };
  
  static void brcmf_fw_request_done(const struct firmware *fw, void *ctx);
-@@ -589,6 +590,8 @@ fail:
-       fwctx->req = NULL;
- done:
+@@ -649,6 +650,8 @@ static void brcmf_fw_request_done(const
+               fwctx->req = NULL;
+       }
        fwctx->done(fwctx->dev, ret, fwctx->req);
 +      if (fwctx->completion)
 +              complete(fwctx->completion);
        kfree(fwctx);
  }
  
-@@ -612,6 +615,8 @@ int brcmf_fw_get_firmwares(struct device
-                                        struct brcmf_fw_request *req))
+@@ -673,6 +676,7 @@ int brcmf_fw_get_firmwares(struct device
  {
+       struct brcmf_fw_item *first = &req->items[0];
        struct brcmf_fw *fwctx;
 +      struct completion completion;
-+      int err;
+       int ret;
  
        brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(dev));
-       if (!fw_cb)
-@@ -628,7 +633,14 @@ int brcmf_fw_get_firmwares(struct device
+@@ -689,6 +693,9 @@ int brcmf_fw_get_firmwares(struct device
+       fwctx->dev = dev;
        fwctx->req = req;
        fwctx->done = fw_cb;
++ 
 +      init_completion(&completion);
 +      fwctx->completion = &completion;
-+
-       brcmf_fw_request_next_item(fwctx, true);
-+
+       ret = request_firmware_nowait(THIS_MODULE, true, first->path,
+                                     fwctx->dev, GFP_KERNEL, fwctx,
+@@ -696,6 +703,9 @@ int brcmf_fw_get_firmwares(struct device
+       if (ret < 0)
+               brcmf_fw_request_done(NULL, fwctx);
 +      wait_for_completion_timeout(fwctx->completion, msecs_to_jiffies(5000));
 +      fwctx->completion = NULL;
 +