drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c

Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
Extension
.c
Size
3948 bytes
Lines
158
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (!board_type) {
			of_node_put(root);
			return 0;
		}
		strreplace(board_type, '/', '-');
		settings->board_type = board_type;
	}
	of_node_put(root);

	clk = devm_clk_get_optional_enabled_with_rate(dev, "lpo", 32768);
	if (IS_ERR(clk))
		return PTR_ERR(clk);

	brcmf_dbg(INFO, "%s LPO clock\n", clk ? "enable" : "no");

	if (!np || !of_device_is_compatible(np, "brcm,bcm4329-fmac"))
		return 0;

	err = brcmf_of_get_country_codes(dev, settings);
	if (err)
		brcmf_err("failed to get OF country code map (err=%d)\n", err);

	err = of_get_mac_address(np, settings->mac);
	if (err == -EPROBE_DEFER)
		return err;

	if (bus_type != BRCMF_BUSTYPE_SDIO)
		return 0;

	if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0)
		sdio->drive_strength = val;

	/* make sure there are interrupts defined in the node */
	if (of_irq_parse_one(np, 0, &oirq))
		return 0;

	irq = irq_create_of_mapping(&oirq);
	if (!irq) {
		brcmf_err("interrupt could not be mapped\n");
		return 0;
	}
	irqf = irq_get_trigger_type(irq);

	sdio->oob_irq_supported = true;
	sdio->oob_irq_nr = irq;
	sdio->oob_irq_flags = irqf;

	return 0;
}

Annotation

Implementation Notes