1
2
3
4
5#ifndef BRCMFMAC_FIRMWARE_H
6#define BRCMFMAC_FIRMWARE_H
7
8#define BRCMF_FW_REQF_OPTIONAL 0x0001
9
10#define BRCMF_FW_NAME_LEN 320
11
12#define BRCMF_FW_DEFAULT_PATH "brcm/"
13
14
15
16
17
18
19
20
21
22
23
24struct brcmf_firmware_mapping {
25 u32 chipid;
26 u32 revmask;
27 const char *fw_base;
28};
29
30#define BRCMF_FW_DEF(fw_name, fw_base) \
31static const char BRCM_ ## fw_name ## _FIRMWARE_BASENAME[] = \
32 BRCMF_FW_DEFAULT_PATH fw_base; \
33MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH fw_base ".bin")
34
35#define BRCMF_FW_ENTRY(chipid, mask, name) \
36 { chipid, mask, BRCM_ ## name ## _FIRMWARE_BASENAME }
37
38void brcmf_fw_nvram_free(void *nvram);
39
40enum brcmf_fw_type {
41 BRCMF_FW_TYPE_BINARY,
42 BRCMF_FW_TYPE_NVRAM
43};
44
45struct brcmf_fw_item {
46 const char *path;
47 enum brcmf_fw_type type;
48 u16 flags;
49 union {
50 const struct firmware *binary;
51 struct {
52 void *data;
53 u32 len;
54 } nv_data;
55 };
56};
57
58struct brcmf_fw_request {
59 u16 domain_nr;
60 u16 bus_nr;
61 u32 n_items;
62 const char *board_type;
63 struct brcmf_fw_item items[0];
64};
65
66struct brcmf_fw_name {
67 const char *extension;
68 char *path;
69};
70
71struct brcmf_fw_request *
72brcmf_fw_alloc_request(u32 chip, u32 chiprev,
73 const struct brcmf_firmware_mapping mapping_table[],
74 u32 table_size, struct brcmf_fw_name *fwnames,
75 u32 n_fwnames);
76
77
78
79
80
81
82int brcmf_fw_get_firmwares(struct device *dev, struct brcmf_fw_request *req,
83 void (*fw_cb)(struct device *dev, int err,
84 struct brcmf_fw_request *req));
85
86#endif
87