drivers/net/wireless/quantenna/qtnfmac/event.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/quantenna/qtnfmac/event.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/quantenna/qtnfmac/event.c- Extension
.c- Size
- 20459 bytes
- Lines
- 798
- 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/module.hlinux/slab.hlinux/nospec.hcfg80211.hcore.hqlink.hbus.htrans.hutil.hevent.hqlink_util.h
Detected Declarations
function qtnf_event_handle_sta_assocfunction qlink_for_each_tlvfunction qtnf_event_handle_sta_deauthfunction qtnf_event_handle_bss_joinfunction qlink_for_each_tlvfunction qtnf_event_handle_bss_leavefunction qtnf_event_handle_mgmt_receivedfunction qtnf_event_handle_scan_resultsfunction qlink_for_each_tlvfunction qtnf_event_handle_scan_completefunction qtnf_event_handle_freq_changefunction qtnf_event_handle_radarfunction qtnf_event_handle_external_authfunction qtnf_event_handle_mic_failurefunction qtnf_event_handle_update_owefunction qtnf_event_parsefunction qtnf_event_process_skbfunction qtnf_event_work_handler
Annotated Snippet
if (tlv_type == QTN_TLV_ID_IE_SET) {
const struct qlink_tlv_ie_set *ie_set;
unsigned int ie_len;
if (tlv_value_len <
(sizeof(*ie_set) - sizeof(ie_set->hdr))) {
ret = -EINVAL;
goto out;
}
ie_set = (const struct qlink_tlv_ie_set *)tlv;
ie_len = tlv_value_len -
(sizeof(*ie_set) - sizeof(ie_set->hdr));
if (ie_set->type == QLINK_IE_SET_ASSOC_REQ && ie_len) {
sinfo->assoc_req_ies = ie_set->ie_data;
sinfo->assoc_req_ies_len = ie_len;
}
}
}
if (!qlink_tlv_parsing_ok(tlv, sta_assoc->ies, payload_len)) {
pr_err("Malformed TLV buffer\n");
ret = -EINVAL;
goto out;
}
cfg80211_new_sta(vif->netdev->ieee80211_ptr, sta_assoc->sta_addr,
sinfo, GFP_KERNEL);
out:
kfree(sinfo);
return ret;
}
static int
qtnf_event_handle_sta_deauth(struct qtnf_wmac *mac, struct qtnf_vif *vif,
const struct qlink_event_sta_deauth *sta_deauth,
u16 len)
{
const u8 *sta_addr;
u16 reason;
if (unlikely(len < sizeof(*sta_deauth))) {
pr_err("VIF%u.%u: payload is too short (%u < %zu)\n",
mac->macid, vif->vifid, len,
sizeof(struct qlink_event_sta_deauth));
return -EINVAL;
}
if (vif->wdev.iftype != NL80211_IFTYPE_AP) {
pr_err("VIF%u.%u: STA_DEAUTH event when not in AP mode\n",
mac->macid, vif->vifid);
return -EPROTO;
}
sta_addr = sta_deauth->sta_addr;
reason = le16_to_cpu(sta_deauth->reason);
pr_debug("VIF%u.%u: MAC:%pM reason:%x\n", mac->macid, vif->vifid,
sta_addr, reason);
if (qtnf_sta_list_del(vif, sta_addr))
cfg80211_del_sta(&vif->wdev, sta_deauth->sta_addr,
GFP_KERNEL);
return 0;
}
static int
qtnf_event_handle_bss_join(struct qtnf_vif *vif,
const struct qlink_event_bss_join *join_info,
u16 len)
{
struct wiphy *wiphy = priv_to_wiphy(vif->mac);
enum ieee80211_statuscode status = le16_to_cpu(join_info->status);
struct cfg80211_chan_def chandef;
struct cfg80211_bss *bss = NULL;
u8 *ie = NULL;
size_t payload_len;
u16 tlv_type;
u16 tlv_value_len;
const struct qlink_tlv_hdr *tlv;
const u8 *rsp_ies = NULL;
size_t rsp_ies_len = 0;
if (unlikely(len < sizeof(*join_info))) {
pr_err("VIF%u.%u: payload is too short (%u < %zu)\n",
vif->mac->macid, vif->vifid, len,
sizeof(struct qlink_event_bss_join));
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/slab.h`, `linux/nospec.h`, `cfg80211.h`, `core.h`, `qlink.h`, `bus.h`.
- Detected declarations: `function qtnf_event_handle_sta_assoc`, `function qlink_for_each_tlv`, `function qtnf_event_handle_sta_deauth`, `function qtnf_event_handle_bss_join`, `function qlink_for_each_tlv`, `function qtnf_event_handle_bss_leave`, `function qtnf_event_handle_mgmt_received`, `function qtnf_event_handle_scan_results`, `function qlink_for_each_tlv`, `function qtnf_event_handle_scan_complete`.
- 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.