drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c- Extension
.c- Size
- 32965 bytes
- Lines
- 1292
- 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/kernel.hlinux/etherdevice.hlinux/vmalloc.hlinux/ieee80211.hnet/cfg80211.hnet/netlink.hcfg80211.hcommands.hcore.hutil.hbus.h
Detected Declarations
function qtnf_validate_iface_combinationsfunction qtnf_change_virtual_intffunction qtnf_del_virtual_intffunction qtnf_mgmt_set_appiefunction qtnf_change_beaconfunction qtnf_start_apfunction qtnf_stop_apfunction qtnf_set_wiphy_paramsfunction qtnf_update_mgmt_frame_registrationsfunction qtnf_mgmt_txfunction qtnf_get_stationfunction qtnf_dump_stationfunction qtnf_add_keyfunction qtnf_del_keyfunction qtnf_set_default_keyfunction qtnf_set_default_mgmt_keyfunction qtnf_change_stationfunction qtnf_del_stationfunction qtnf_scanfunction qtnf_connectfunction qtnf_external_authfunction qtnf_disconnectfunction qtnf_dump_surveyfunction qtnf_get_channelfunction qtnf_channel_switchfunction qtnf_start_radar_detectionfunction qtnf_set_mac_aclfunction qtnf_set_power_mgmtfunction qtnf_get_tx_powerfunction qtnf_set_tx_powerfunction qtnf_update_owe_infofunction qtnf_suspendfunction qtnf_resumefunction qtnf_set_wakeupfunction qtnf_cfg80211_reg_notifierfunction qtnf_wiphy_setup_if_combfunction qtnf_wiphy_registerfunction qtnf_netdev_updownfunction qtnf_virtual_intf_cleanupfunction qtnf_cfg80211_vif_resetfunction qtnf_band_init_rates
Annotated Snippet
if (!vif) {
pr_err("MAC%u: no free VIF available\n", mac->macid);
return ERR_PTR(-EFAULT);
}
eth_zero_addr(vif->mac_addr);
eth_zero_addr(vif->bssid);
vif->bss_priority = QTNF_DEF_BSS_PRIORITY;
memset(&vif->wdev, 0, sizeof(vif->wdev));
vif->wdev.wiphy = wiphy;
vif->wdev.iftype = type;
break;
default:
pr_err("MAC%u: unsupported IF type %d\n", mac->macid, type);
return ERR_PTR(-ENOTSUPP);
}
if (params) {
mac_addr = params->macaddr;
use4addr = params->use_4addr;
}
ret = qtnf_cmd_send_add_intf(vif, type, use4addr, mac_addr);
if (ret) {
pr_err("VIF%u.%u: failed to add VIF %pM\n",
mac->macid, vif->vifid, mac_addr);
goto err_cmd;
}
if (!is_valid_ether_addr(vif->mac_addr)) {
pr_err("VIF%u.%u: FW reported bad MAC: %pM\n",
mac->macid, vif->vifid, vif->mac_addr);
ret = -EINVAL;
goto error_del_vif;
}
ret = qtnf_core_net_attach(mac, vif, name, name_assign_t);
if (ret) {
pr_err("VIF%u.%u: failed to attach netdev\n", mac->macid,
vif->vifid);
goto error_del_vif;
}
if (qtnf_hwcap_is_set(&mac->bus->hw_info, QLINK_HW_CAPAB_HW_BRIDGE)) {
ret = qtnf_cmd_netdev_changeupper(vif, vif->netdev->ifindex);
if (ret) {
cfg80211_unregister_netdevice(vif->netdev);
vif->netdev = NULL;
goto error_del_vif;
}
}
vif->wdev.netdev = vif->netdev;
return &vif->wdev;
error_del_vif:
qtnf_cmd_send_del_intf(vif);
err_cmd:
vif->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED;
return ERR_PTR(ret);
}
static int qtnf_mgmt_set_appie(struct qtnf_vif *vif,
const struct cfg80211_beacon_data *info)
{
int ret = 0;
if (!info->beacon_ies || !info->beacon_ies_len) {
ret = qtnf_cmd_send_mgmt_set_appie(vif, QLINK_IE_SET_BEACON_IES,
NULL, 0);
} else {
ret = qtnf_cmd_send_mgmt_set_appie(vif, QLINK_IE_SET_BEACON_IES,
info->beacon_ies,
info->beacon_ies_len);
}
if (ret)
goto out;
if (!info->proberesp_ies || !info->proberesp_ies_len) {
ret = qtnf_cmd_send_mgmt_set_appie(vif,
QLINK_IE_SET_PROBE_RESP_IES,
NULL, 0);
} else {
ret = qtnf_cmd_send_mgmt_set_appie(vif,
QLINK_IE_SET_PROBE_RESP_IES,
info->proberesp_ies,
info->proberesp_ies_len);
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/etherdevice.h`, `linux/vmalloc.h`, `linux/ieee80211.h`, `net/cfg80211.h`, `net/netlink.h`, `cfg80211.h`, `commands.h`.
- Detected declarations: `function qtnf_validate_iface_combinations`, `function qtnf_change_virtual_intf`, `function qtnf_del_virtual_intf`, `function qtnf_mgmt_set_appie`, `function qtnf_change_beacon`, `function qtnf_start_ap`, `function qtnf_stop_ap`, `function qtnf_set_wiphy_params`, `function qtnf_update_mgmt_frame_registrations`, `function qtnf_mgmt_tx`.
- 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.