drivers/net/wireless/quantenna/qtnfmac/core.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/quantenna/qtnfmac/core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/quantenna/qtnfmac/core.c- Extension
.c- Size
- 21277 bytes
- Lines
- 934
- 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/module.hlinux/if_ether.hlinux/nospec.hcore.hbus.htrans.hcommands.hcfg80211.hevent.hutil.hswitchdev.h
Detected Declarations
function qtnf_slave_radar_getfunction qtnf_dfs_offload_getfunction qtnf_netdev_openfunction qtnf_netdev_closefunction qtnf_packet_send_hi_prifunction qtnf_netdev_hard_start_xmitfunction qtnf_netdev_tx_timeoutfunction qtnf_netdev_set_mac_addressfunction qtnf_netdev_port_parent_idfunction qtnf_mac_init_single_bandfunction qtnf_mac_init_bandsfunction qtnf_mac_iface_comb_freefunction qtnf_mac_ext_caps_freefunction qtnf_vif_reset_handlerfunction qtnf_mac_init_primary_intffunction qtnf_mac_scan_finishfunction qtnf_scan_donefunction qtnf_mac_scan_timeoutfunction qtnf_vif_send_data_high_prifunction qtnf_core_net_attachfunction qtnf_core_mac_detachfunction qtnf_core_mac_attachfunction qtnf_netdev_is_qtnfunction qtnf_check_br_portsfunction qtnf_core_netdevice_eventfunction qtnf_core_attachfunction qtnf_core_detachfunction qtnf_is_frame_meta_magic_validfunction qtnf_wake_all_queuesfunction qtnf_core_registerfunction qtnf_core_exitmodule init qtnf_core_registerexport qtnf_core_attachexport qtnf_core_detachexport qtnf_classify_skbexport qtnf_wake_all_queuesexport qtnf_get_debugfs_dir
Annotated Snippet
const struct net_device_ops qtnf_netdev_ops = {
.ndo_open = qtnf_netdev_open,
.ndo_stop = qtnf_netdev_close,
.ndo_start_xmit = qtnf_netdev_hard_start_xmit,
.ndo_tx_timeout = qtnf_netdev_tx_timeout,
.ndo_set_mac_address = qtnf_netdev_set_mac_address,
.ndo_get_port_parent_id = qtnf_netdev_port_parent_id,
};
static int qtnf_mac_init_single_band(struct wiphy *wiphy,
struct qtnf_wmac *mac,
enum nl80211_band band)
{
int ret;
wiphy->bands[band] = kzalloc_obj(*wiphy->bands[band]);
if (!wiphy->bands[band])
return -ENOMEM;
wiphy->bands[band]->band = band;
ret = qtnf_cmd_band_info_get(mac, wiphy->bands[band]);
if (ret) {
pr_err("MAC%u: band %u: failed to get chans info: %d\n",
mac->macid, band, ret);
return ret;
}
qtnf_band_init_rates(wiphy->bands[band]);
return 0;
}
static int qtnf_mac_init_bands(struct qtnf_wmac *mac)
{
struct wiphy *wiphy = priv_to_wiphy(mac);
int ret = 0;
if (mac->macinfo.bands_cap & QLINK_BAND_2GHZ) {
ret = qtnf_mac_init_single_band(wiphy, mac, NL80211_BAND_2GHZ);
if (ret)
goto out;
}
if (mac->macinfo.bands_cap & QLINK_BAND_5GHZ) {
ret = qtnf_mac_init_single_band(wiphy, mac, NL80211_BAND_5GHZ);
if (ret)
goto out;
}
if (mac->macinfo.bands_cap & QLINK_BAND_60GHZ)
ret = qtnf_mac_init_single_band(wiphy, mac, NL80211_BAND_60GHZ);
out:
return ret;
}
struct qtnf_vif *qtnf_mac_get_free_vif(struct qtnf_wmac *mac)
{
struct qtnf_vif *vif;
int i;
for (i = 0; i < QTNF_MAX_INTF; i++) {
vif = &mac->iflist[i];
if (vif->wdev.iftype == NL80211_IFTYPE_UNSPECIFIED)
return vif;
}
return NULL;
}
struct qtnf_vif *qtnf_mac_get_base_vif(struct qtnf_wmac *mac)
{
struct qtnf_vif *vif;
vif = &mac->iflist[QTNF_PRIMARY_VIF_IDX];
if (vif->wdev.iftype == NL80211_IFTYPE_UNSPECIFIED)
return NULL;
return vif;
}
void qtnf_mac_iface_comb_free(struct qtnf_wmac *mac)
{
struct ieee80211_iface_combination *comb;
int i;
if (mac->macinfo.if_comb) {
for (i = 0; i < mac->macinfo.n_if_comb; i++) {
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/if_ether.h`, `linux/nospec.h`, `core.h`, `bus.h`, `trans.h`, `commands.h`.
- Detected declarations: `function qtnf_slave_radar_get`, `function qtnf_dfs_offload_get`, `function qtnf_netdev_open`, `function qtnf_netdev_close`, `function qtnf_packet_send_hi_pri`, `function qtnf_netdev_hard_start_xmit`, `function qtnf_netdev_tx_timeout`, `function qtnf_netdev_set_mac_address`, `function qtnf_netdev_port_parent_id`, `function qtnf_mac_init_single_band`.
- 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.