1 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
2 Date: Mon, 8 Jun 2015 16:11:40 +0200
3 Subject: [PATCH] brcmfmac: register wiphy(s) during module_init
5 Content-Type: text/plain; charset=UTF-8
6 Content-Transfer-Encoding: 8bit
8 This is needed by OpenWrt which expects all PHYs to be created after
9 module loads successfully.
11 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
14 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
15 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
16 @@ -459,6 +459,7 @@ struct brcmf_fw {
18 unsigned int board_index;
19 void (*done)(struct device *dev, int err, struct brcmf_fw_request *req);
20 + struct completion *completion;
24 @@ -686,6 +687,8 @@ static void brcmf_fw_request_done(const
27 fwctx->done(fwctx->dev, ret, fwctx->req);
28 + if (fwctx->completion)
29 + complete(fwctx->completion);
33 @@ -751,6 +754,8 @@ int brcmf_fw_get_firmwares(struct device
35 struct brcmf_fw_item *first = &req->items[0];
36 struct brcmf_fw *fwctx;
37 + struct completion completion;
38 + unsigned long time_left;
39 char *alt_path = NULL;
42 @@ -768,6 +773,9 @@ int brcmf_fw_get_firmwares(struct device
47 + init_completion(&completion);
48 + fwctx->completion = &completion;
50 /* First try alternative board-specific path if any */
51 if (fwctx->req->board_types[0])
52 @@ -787,6 +795,12 @@ int brcmf_fw_get_firmwares(struct device
54 brcmf_fw_request_done(NULL, fwctx);
57 + time_left = wait_for_completion_timeout(&completion,
58 + msecs_to_jiffies(5000));
59 + if (!time_left && fwctx)
60 + fwctx->completion = NULL;