f4d9a84b257f203a8a50ec58b0826743472aafd0
[openwrt/staging/neocturne.git] /
1 From da472385a29f1fddcac7cfa0499482704310bd16 Mon Sep 17 00:00:00 2001
2 From: Arend Van Spriel <arend.vanspriel@broadcom.com>
3 Date: Tue, 20 Feb 2018 00:14:18 +0100
4 Subject: [PATCH] brcmfmac: move brcmf_bus_preinit() call just after changing
5 bus state
6
7 Moving the brcmf_bus_preinit() call allows the bus code to do some
8 required initialization before handling firmware control messages.
9
10 Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
11 Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
12 Reviewed-by: Franky Lin <franky.lin@broadcom.com>
13 Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
14 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
15 ---
16 drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 3 ---
17 drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 5 +++++
18 2 files changed, 5 insertions(+), 3 deletions(-)
19
20 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
21 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
22 @@ -369,9 +369,6 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
23
24 /* Enable tx beamforming, errors can be ignored (not supported) */
25 (void)brcmf_fil_iovar_int_set(ifp, "txbf", 1);
26 -
27 - /* do bus specific preinit here */
28 - err = brcmf_bus_preinit(ifp->drvr->bus_if);
29 done:
30 return err;
31 }
32 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
33 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
34 @@ -1091,6 +1091,11 @@ int brcmf_bus_started(struct device *dev
35 /* signal bus ready */
36 brcmf_bus_change_state(bus_if, BRCMF_BUS_UP);
37
38 + /* do bus specific preinit here */
39 + ret = brcmf_bus_preinit(ifp->drvr->bus_if);
40 + if (ret < 0)
41 + goto fail;
42 +
43 /* Bus is ready, do any initialization */
44 ret = brcmf_c_preinit_dcmds(ifp);
45 if (ret < 0)