drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c- Extension
.c- Size
- 10981 bytes
- Lines
- 373
- 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.
- 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.
- 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/errno.hlinux/types.hcore.hbus.hfwvid.hfwil.hfweh.hvops.hfwil_types.h
Detected Declarations
function Copyrightfunction brcmf_cyw_alloc_fweh_infofunction brcmf_cyw_activate_eventsfunction brcmf_cyw_mgmt_txfunction brcmf_cyw_external_authfunction brcmf_cyw_get_cfg80211_opsfunction brcmf_cyw_notify_ext_auth_reqfunction brcmf_notify_auth_frame_rxfunction brcmf_notify_mgmt_tx_statusfunction brcmf_cyw_register_event_handlers
Annotated Snippet
if (err) {
bphy_err(drvr, "unable to get current hw channel\n");
goto free;
}
}
mf_params->channel = hw_ch;
memcpy(&mf_params->da[0], &mgmt->da[0], ETH_ALEN);
memcpy(&mf_params->bssid[0], &mgmt->bssid[0], ETH_ALEN);
mf_params->packet_id = cpu_to_le32(*cookie);
memcpy(mf_params->data, &buf[DOT11_MGMT_HDR_LEN],
le16_to_cpu(mf_params->len));
brcmf_dbg(TRACE, "Auth frame, cookie=%d, fc=%04x, len=%d, channel=%d\n",
le32_to_cpu(mf_params->packet_id),
le16_to_cpu(mf_params->frame_control),
le16_to_cpu(mf_params->len),
le16_to_cpu(mf_params->channel));
vif->mgmt_tx_id = le32_to_cpu(mf_params->packet_id);
set_bit(BRCMF_MGMT_TX_SEND_FRAME, &vif->mgmt_tx_status);
err = brcmf_fil_bsscfg_data_set(vif->ifp, "mgmt_frame",
mf_params, mf_params_len);
if (err) {
bphy_err(drvr, "Failed to send Auth frame: err=%d\n",
err);
goto tx_status;
}
ready = wait_for_completion_timeout(&vif->mgmt_tx,
MGMT_AUTH_FRAME_WAIT_TIME);
if (test_bit(BRCMF_MGMT_TX_ACK, &vif->mgmt_tx_status)) {
brcmf_dbg(TRACE, "TX Auth frame operation is success\n");
ack = true;
} else {
bphy_err(drvr, "TX Auth frame operation is %s: status=%ld)\n",
ready ? "failed" : "timedout", vif->mgmt_tx_status);
}
tx_status:
cfg80211_mgmt_tx_status(wdev, *cookie, buf, len, ack,
GFP_KERNEL);
free:
kfree(mf_params);
return err;
}
static int
brcmf_cyw_external_auth(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_external_auth_params *params)
{
struct brcmf_if *ifp;
struct brcmf_pub *drvr;
struct brcmf_auth_req_status_le auth_status;
int ret = 0;
brcmf_dbg(TRACE, "Enter\n");
ifp = netdev_priv(dev);
drvr = ifp->drvr;
if (params->status == WLAN_STATUS_SUCCESS) {
auth_status.flags = cpu_to_le16(BRCMF_EXTAUTH_SUCCESS);
} else {
bphy_err(drvr, "External authentication failed: status=%d\n",
params->status);
auth_status.flags = cpu_to_le16(BRCMF_EXTAUTH_FAIL);
}
memcpy(auth_status.peer_mac, params->bssid, ETH_ALEN);
params->ssid.ssid_len = min_t(u8, params->ssid.ssid_len,
IEEE80211_MAX_SSID_LEN);
auth_status.ssid_len = cpu_to_le32(params->ssid.ssid_len);
memcpy(auth_status.ssid, params->ssid.ssid, params->ssid.ssid_len);
ret = brcmf_fil_iovar_data_set(ifp, "auth_status", &auth_status,
sizeof(auth_status));
if (ret < 0)
bphy_err(drvr, "auth_status iovar failed: ret=%d\n", ret);
return ret;
}
static void brcmf_cyw_get_cfg80211_ops(struct brcmf_pub *drvr)
{
drvr->ops->mgmt_tx = brcmf_cyw_mgmt_tx;
drvr->ops->external_auth = brcmf_cyw_external_auth;
}
static s32
Annotation
- Immediate include surface: `linux/errno.h`, `linux/types.h`, `core.h`, `bus.h`, `fwvid.h`, `fwil.h`, `fweh.h`, `vops.h`.
- Detected declarations: `function Copyright`, `function brcmf_cyw_alloc_fweh_info`, `function brcmf_cyw_activate_events`, `function brcmf_cyw_mgmt_tx`, `function brcmf_cyw_external_auth`, `function brcmf_cyw_get_cfg80211_ops`, `function brcmf_cyw_notify_ext_auth_req`, `function brcmf_notify_auth_frame_rx`, `function brcmf_notify_mgmt_tx_status`, `function brcmf_cyw_register_event_handlers`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.