drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/quantenna/qtnfmac/qlink_util.c- Extension
.c- Size
- 7575 bytes
- Lines
- 304
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/nl80211.hqlink_util.h
Detected Declarations
function qlink_iface_type_to_nl_maskfunction qlink_chan_width_mask_to_nlfunction qlink_chanwidth_to_nlfunction qlink_chanwidth_nl_to_qlinkfunction qlink_chandef_q2cfgfunction qlink_chandef_cfg2qfunction qlink_hidden_ssid_nl2qfunction qtnf_utils_is_bit_setfunction qlink_acl_data_cfg2qfunction qlink_utils_band_cfg2qfunction qlink_utils_dfs_state_cfg2qfunction qlink_utils_chflags_cfg2qfunction qtnf_reg_rule_flags_parsefunction qlink_utils_regrule_q2nl
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0+
/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
#include <linux/nl80211.h>
#include "qlink_util.h"
u16 qlink_iface_type_to_nl_mask(u16 qlink_type)
{
u16 result = 0;
switch (qlink_type) {
case QLINK_IFTYPE_AP:
result |= BIT(NL80211_IFTYPE_AP);
break;
case QLINK_IFTYPE_STATION:
result |= BIT(NL80211_IFTYPE_STATION);
break;
case QLINK_IFTYPE_ADHOC:
result |= BIT(NL80211_IFTYPE_ADHOC);
break;
case QLINK_IFTYPE_MONITOR:
result |= BIT(NL80211_IFTYPE_MONITOR);
break;
case QLINK_IFTYPE_WDS:
result |= BIT(NL80211_IFTYPE_WDS);
break;
case QLINK_IFTYPE_AP_VLAN:
result |= BIT(NL80211_IFTYPE_AP_VLAN);
break;
}
return result;
}
u8 qlink_chan_width_mask_to_nl(u16 qlink_mask)
{
u8 result = 0;
if (qlink_mask & BIT(QLINK_CHAN_WIDTH_5))
result |= BIT(NL80211_CHAN_WIDTH_5);
if (qlink_mask & BIT(QLINK_CHAN_WIDTH_10))
result |= BIT(NL80211_CHAN_WIDTH_10);
if (qlink_mask & BIT(QLINK_CHAN_WIDTH_20_NOHT))
result |= BIT(NL80211_CHAN_WIDTH_20_NOHT);
if (qlink_mask & BIT(QLINK_CHAN_WIDTH_20))
result |= BIT(NL80211_CHAN_WIDTH_20);
if (qlink_mask & BIT(QLINK_CHAN_WIDTH_40))
result |= BIT(NL80211_CHAN_WIDTH_40);
if (qlink_mask & BIT(QLINK_CHAN_WIDTH_80))
result |= BIT(NL80211_CHAN_WIDTH_80);
if (qlink_mask & BIT(QLINK_CHAN_WIDTH_80P80))
result |= BIT(NL80211_CHAN_WIDTH_80P80);
if (qlink_mask & BIT(QLINK_CHAN_WIDTH_160))
result |= BIT(NL80211_CHAN_WIDTH_160);
return result;
}
static enum nl80211_chan_width qlink_chanwidth_to_nl(u8 qlw)
{
switch (qlw) {
case QLINK_CHAN_WIDTH_20_NOHT:
return NL80211_CHAN_WIDTH_20_NOHT;
case QLINK_CHAN_WIDTH_20:
return NL80211_CHAN_WIDTH_20;
case QLINK_CHAN_WIDTH_40:
return NL80211_CHAN_WIDTH_40;
case QLINK_CHAN_WIDTH_80:
return NL80211_CHAN_WIDTH_80;
case QLINK_CHAN_WIDTH_80P80:
return NL80211_CHAN_WIDTH_80P80;
case QLINK_CHAN_WIDTH_160:
return NL80211_CHAN_WIDTH_160;
case QLINK_CHAN_WIDTH_5:
return NL80211_CHAN_WIDTH_5;
case QLINK_CHAN_WIDTH_10:
return NL80211_CHAN_WIDTH_10;
default:
return -1;
}
}
Annotation
- Immediate include surface: `linux/nl80211.h`, `qlink_util.h`.
- Detected declarations: `function qlink_iface_type_to_nl_mask`, `function qlink_chan_width_mask_to_nl`, `function qlink_chanwidth_to_nl`, `function qlink_chanwidth_nl_to_qlink`, `function qlink_chandef_q2cfg`, `function qlink_chandef_cfg2q`, `function qlink_hidden_ssid_nl2q`, `function qtnf_utils_is_bit_set`, `function qlink_acl_data_cfg2q`, `function qlink_utils_band_cfg2q`.
- 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.