1 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
2 Subject: [PATCH] brcmfmac: add in-driver tables with country codes
4 Content-Type: text/plain; charset=UTF-8
5 Content-Transfer-Encoding: 8bit
7 This adds early support for changing region. Ideally this data should
8 be stored in DT as all these mappings are devices specific.
10 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
13 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
14 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
19 +/* TODO: FIXME: Use DT */
20 +static void brcmf_of_probe_cc(struct device *dev,
21 + struct brcmf_mp_device *settings)
23 + static struct brcmfmac_pd_cc_entry netgear_r8000_cc_ent[] = {
27 + struct brcmfmac_pd_cc_entry *cc_ent = NULL;
30 + if (of_machine_is_compatible("netgear,r8000")) {
31 + cc_ent = netgear_r8000_cc_ent;
32 + table_size = ARRAY_SIZE(netgear_r8000_cc_ent);
35 + if (cc_ent && table_size) {
36 + struct brcmfmac_pd_cc *cc;
39 + memsize = table_size * sizeof(struct brcmfmac_pd_cc_entry);
40 + cc = devm_kzalloc(dev, sizeof(*cc) + memsize, GFP_KERNEL);
43 + cc->table_size = table_size;
44 + memcpy(cc->table, cc_ent, memsize);
45 + settings->country_codes = cc;
49 void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
50 struct brcmf_mp_device *settings)
52 @@ -30,6 +60,8 @@ void brcmf_of_probe(struct device *dev,
56 + brcmf_of_probe_cc(dev, settings);
58 if (!np || bus_type != BRCMF_BUSTYPE_SDIO ||
59 !of_device_is_compatible(np, "brcm,bcm4329-fmac"))