diff options
author | Arend van Spriel <arend@broadcom.com> | 2015-01-25 20:31:39 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-01-29 09:59:11 +0200 |
commit | 9b1933a3bd7c4568edc4d906bf1cc0e901ce1ec4 (patch) | |
tree | dbb54e8da12740cc8ff357a172b8522811e8eb69 /drivers/net/wireless/brcm80211/brcmfmac/core.c | |
parent | 31fc436f184dc4219d837d4ffc97ad7c2ca0954d (diff) | |
download | lwn-9b1933a3bd7c4568edc4d906bf1cc0e901ce1ec4.tar.gz lwn-9b1933a3bd7c4568edc4d906bf1cc0e901ce1ec4.zip |
brcmfmac: determine chip info when not provided by bus layer
In some scenarios the chip number and revision may not be provided
by the bus layer. If the chip number is not filled, the common
layer will ask the firmware for this information.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/core.c')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/core.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/core.c b/drivers/net/wireless/brcm80211/brcmfmac/core.c index b8520c30af7c..5f16a7e75d93 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c @@ -948,6 +948,7 @@ int brcmf_bus_start(struct device *dev) struct brcmf_pub *drvr = bus_if->drvr; struct brcmf_if *ifp; struct brcmf_if *p2p_ifp; + struct brcmf_rev_info_le revinfo; brcmf_dbg(TRACE, "\n"); @@ -971,6 +972,20 @@ int brcmf_bus_start(struct device *dev) if (ret < 0) goto fail; + /* assure we have chipid before feature attach */ + if (!bus_if->chip) { + ret = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_REVINFO, &revinfo, + sizeof(revinfo)); + if (ret < 0) { + brcmf_err("no chipid determined - device may malfunction\n"); + } else { + bus_if->chip = le32_to_cpu(revinfo.chipnum); + bus_if->chiprev = le32_to_cpu(revinfo.chiprev); + brcmf_dbg(INFO, "firmware revinfo: chip %x (%d) rev %d\n", + bus_if->chip, bus_if->chip, + bus_if->chiprev); + } + } brcmf_feat_attach(drvr); ret = brcmf_fws_init(drvr); |