summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/brcm80211/brcmfmac/firmware.h
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2014-05-27 12:56:21 +0200
committerJohn W. Linville <linville@tuxdriver.com>2014-05-29 13:10:22 -0400
commitc1416e77a6166766c847f03f21cca18d8ac54dd3 (patch)
treea8c60e265b6f50d1c1b93db2d522bacdc73301ab /drivers/net/wireless/brcm80211/brcmfmac/firmware.h
parentde389a533b88de18b98d5f007996aff6f2885180 (diff)
brcmfmac: introduce asynchronous firmware loading
The driver needs firmware to be loaded to the device, which is done through the firmware class API. The synchronous call request_firmware() need root filesystem to be mounted and/or user-mode helper. These may not be avaliable on the moment it is called. Instead use request_firmware_nowait(). Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/firmware.h')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/firmware.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/firmware.h b/drivers/net/wireless/brcm80211/brcmfmac/firmware.h
index 127633bc242d..25b64bd97609 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.h
@@ -16,9 +16,22 @@
#ifndef BRCMFMAC_FIRMWARE_H
#define BRCMFMAC_FIRMWARE_H
+#define BRCMF_FW_REQUEST 0x000F
+#define BRCMF_FW_REQUEST_NVRAM 0x0001
+#define BRCMF_FW_REQ_FLAGS 0x00F0
+#define BRCMF_FW_REQ_NV_OPTIONAL 0x0010
void *brcmf_fw_nvram_strip(const struct firmware *nv, u32 *new_length);
void brcmf_fw_nvram_free(void *nvram);
-
+/*
+ * Request firmware(s) asynchronously. When the asynchronous request
+ * fails it will not use the callback, but call device_release_driver()
+ * instead which will call the driver .remove() callback.
+ */
+int brcmf_fw_get_firmwares(struct device *dev, u16 flags,
+ const char *code, const char *nvram,
+ void (*fw_cb)(struct device *dev,
+ const struct firmware *fw,
+ void *nvram_image, u32 nvram_len));
#endif /* BRCMFMAC_FIRMWARE_H */