drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c- Extension
.c- Size
- 38056 bytes
- Lines
- 1577
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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.
- 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/etherdevice.hlinux/module.hlinux/inetdevice.hlinux/property.hnet/cfg80211.hnet/rtnetlink.hnet/addrconf.hnet/ieee80211_radiotap.hnet/ipv6.hbrcmu_utils.hbrcmu_wifi.hcore.hbus.hfwvid.hdebug.hfwil_types.hp2p.hpno.hcfg80211.hfwil.hfeature.hproto.hpcie.hcommon.h
Detected Declarations
struct d11rxhdr_lestruct wlc_d11rxhdrfunction brcmf_configure_arp_nd_offloadfunction _brcmf_set_multicast_listfunction netdev_for_each_mc_addrfunction _brcmf_update_ndtablefunction _brcmf_update_ndtablefunction brcmf_netdev_set_multicast_listfunction brcmf_skb_is_iappfunction brcmf_netdev_start_xmitfunction brcmf_txflowblock_iffunction brcmf_netif_rxfunction brcmf_netif_mon_rxfunction brcmf_rx_hdrpullfunction brcmf_rx_framefunction brcmf_rx_eventfunction brcmf_txfinalizefunction brcmf_ethtool_get_drvinfofunction brcmf_netdev_stopfunction brcmf_netdev_openfunction brcmf_net_attachfunction brcmf_net_detachfunction brcmf_net_mon_openfunction brcmf_net_mon_stopfunction brcmf_net_mon_start_xmitfunction brcmf_net_mon_attachfunction brcmf_net_setcarrierfunction brcmf_net_p2p_openfunction brcmf_net_p2p_stopfunction brcmf_net_p2p_start_xmitfunction brcmf_net_p2p_attachfunction brcmf_del_iffunction brcmf_remove_interfacefunction brcmf_psm_watchdog_notifyfunction brcmf_inetaddr_changedfunction brcmf_inet6addr_changedfunction brcmf_revinfo_readfunction brcmf_core_bus_resetfunction bus_reset_writefunction brcmf_bus_startedfunction brcmf_allocfunction brcmf_attachfunction brcmf_bus_add_txhdrlenfunction brcmf_dev_resetfunction brcmf_dev_coredumpfunction brcmf_fw_crashedfunction brcmf_detachfunction brcmf_free
Annotated Snippet
static const struct net_device_ops brcmf_netdev_ops_pri = {
.ndo_open = brcmf_netdev_open,
.ndo_stop = brcmf_netdev_stop,
.ndo_start_xmit = brcmf_netdev_start_xmit,
.ndo_set_mac_address = brcmf_netdev_set_mac_address,
.ndo_set_rx_mode = brcmf_netdev_set_multicast_list
};
int brcmf_net_attach(struct brcmf_if *ifp, bool locked)
{
struct brcmf_pub *drvr = ifp->drvr;
struct net_device *ndev;
s32 err;
brcmf_dbg(TRACE, "Enter, bsscfgidx=%d mac=%pM\n", ifp->bsscfgidx,
ifp->mac_addr);
ndev = ifp->ndev;
/* set appropriate operations */
ndev->netdev_ops = &brcmf_netdev_ops_pri;
ndev->needed_headroom += drvr->hdrlen;
ndev->ethtool_ops = &brcmf_ethtool_ops;
/* set the mac address & netns */
eth_hw_addr_set(ndev, ifp->mac_addr);
dev_net_set(ndev, wiphy_net(cfg_to_wiphy(drvr->config)));
INIT_WORK(&ifp->multicast_work, _brcmf_set_multicast_list);
INIT_WORK(&ifp->ndoffload_work, _brcmf_update_ndtable);
if (locked)
err = cfg80211_register_netdevice(ndev);
else
err = register_netdev(ndev);
if (err != 0) {
bphy_err(drvr, "couldn't register the net device\n");
goto fail;
}
netif_carrier_off(ndev);
ndev->priv_destructor = brcmf_cfg80211_free_vif;
brcmf_dbg(INFO, "%s: Broadcom Dongle Host Driver\n", ndev->name);
return 0;
fail:
drvr->iflist[ifp->bsscfgidx] = NULL;
ndev->netdev_ops = NULL;
return -EBADE;
}
void brcmf_net_detach(struct net_device *ndev, bool locked)
{
if (ndev->reg_state == NETREG_REGISTERED) {
if (locked)
cfg80211_unregister_netdevice(ndev);
else
unregister_netdev(ndev);
} else {
brcmf_cfg80211_free_vif(ndev);
free_netdev(ndev);
}
}
static int brcmf_net_mon_open(struct net_device *ndev)
{
struct brcmf_if *ifp = netdev_priv(ndev);
struct brcmf_pub *drvr = ifp->drvr;
u32 monitor;
int err;
brcmf_dbg(TRACE, "Enter\n");
err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_MONITOR, &monitor);
if (err) {
bphy_err(drvr, "BRCMF_C_GET_MONITOR error (%d)\n", err);
return err;
} else if (monitor) {
bphy_err(drvr, "Monitor mode is already enabled\n");
return -EEXIST;
}
monitor = 3;
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_MONITOR, monitor);
if (err)
bphy_err(drvr, "BRCMF_C_SET_MONITOR error (%d)\n", err);
return err;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/etherdevice.h`, `linux/module.h`, `linux/inetdevice.h`, `linux/property.h`, `net/cfg80211.h`, `net/rtnetlink.h`, `net/addrconf.h`.
- Detected declarations: `struct d11rxhdr_le`, `struct wlc_d11rxhdr`, `function brcmf_configure_arp_nd_offload`, `function _brcmf_set_multicast_list`, `function netdev_for_each_mc_addr`, `function _brcmf_update_ndtable`, `function _brcmf_update_ndtable`, `function brcmf_netdev_set_multicast_list`, `function brcmf_skb_is_iapp`, `function brcmf_netdev_start_xmit`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.