Commit 9b1933a3 authored by Arend van Spriel's avatar Arend van Spriel Committed by Kalle Valo

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: default avatarHante Meuleman <meuleman@broadcom.com>
Reviewed-by: default avatarDaniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: default avatarFranky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 31fc436f
...@@ -948,6 +948,7 @@ int brcmf_bus_start(struct device *dev) ...@@ -948,6 +948,7 @@ int brcmf_bus_start(struct device *dev)
struct brcmf_pub *drvr = bus_if->drvr; struct brcmf_pub *drvr = bus_if->drvr;
struct brcmf_if *ifp; struct brcmf_if *ifp;
struct brcmf_if *p2p_ifp; struct brcmf_if *p2p_ifp;
struct brcmf_rev_info_le revinfo;
brcmf_dbg(TRACE, "\n"); brcmf_dbg(TRACE, "\n");
...@@ -971,6 +972,20 @@ int brcmf_bus_start(struct device *dev) ...@@ -971,6 +972,20 @@ int brcmf_bus_start(struct device *dev)
if (ret < 0) if (ret < 0)
goto fail; 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); brcmf_feat_attach(drvr);
ret = brcmf_fws_init(drvr); ret = brcmf_fws_init(drvr);
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
#define BRCMF_C_SET_COUNTRY 84 #define BRCMF_C_SET_COUNTRY 84
#define BRCMF_C_GET_PM 85 #define BRCMF_C_GET_PM 85
#define BRCMF_C_SET_PM 86 #define BRCMF_C_SET_PM 86
#define BRCMF_C_GET_REVINFO 98
#define BRCMF_C_GET_CURR_RATESET 114 #define BRCMF_C_GET_CURR_RATESET 114
#define BRCMF_C_GET_AP 117 #define BRCMF_C_GET_AP 117
#define BRCMF_C_SET_AP 118 #define BRCMF_C_SET_AP 118
......
...@@ -539,4 +539,45 @@ struct brcmf_fil_country_le { ...@@ -539,4 +539,45 @@ struct brcmf_fil_country_le {
char ccode[BRCMF_COUNTRY_BUF_SZ]; char ccode[BRCMF_COUNTRY_BUF_SZ];
}; };
/**
* struct brcmf_rev_info_le - device revision info.
*
* @vendorid: PCI vendor id.
* @deviceid: device id of chip.
* @radiorev: radio revision.
* @chiprev: chip revision.
* @corerev: core revision.
* @boardid: board identifier (usu. PCI sub-device id).
* @boardvendor: board vendor (usu. PCI sub-vendor id).
* @boardrev: board revision.
* @driverrev: driver version.
* @ucoderev: microcode version.
* @bus: bus type.
* @chipnum: chip number.
* @phytype: phy type.
* @phyrev: phy revision.
* @anarev: anacore rev.
* @chippkg: chip package info.
* @nvramrev: nvram revision number.
*/
struct brcmf_rev_info_le {
__le32 vendorid;
__le32 deviceid;
__le32 radiorev;
__le32 chiprev;
__le32 corerev;
__le32 boardid;
__le32 boardvendor;
__le32 boardrev;
__le32 driverrev;
__le32 ucoderev;
__le32 bus;
__le32 chipnum;
__le32 phytype;
__le32 phyrev;
__le32 anarev;
__le32 chippkg;
__le32 nvramrev;
};
#endif /* FWIL_TYPES_H_ */ #endif /* FWIL_TYPES_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment