net/wireless/mlme.c
Source file repositories/reference/linux-study-clean/net/wireless/mlme.c
File Facts
- System
- Linux kernel
- Corpus path
net/wireless/mlme.c- Extension
.c- Size
- 39115 bytes
- Lines
- 1435
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/etherdevice.hlinux/netdevice.hlinux/nl80211.hlinux/slab.hlinux/wireless.hnet/cfg80211.hnet/iw_handler.hcore.hnl80211.hrdev-ops.h
Detected Declarations
struct cfg80211_mgmt_registrationfunction Copyrightfunction afunction cfg80211_process_authfunction cfg80211_process_deauthfunction cfg80211_process_disassocfunction cfg80211_rx_mlme_mgmtfunction cfg80211_auth_timeoutfunction cfg80211_assoc_failurefunction cfg80211_tx_mlme_mgmtfunction cfg80211_michael_mic_failurefunction cfg80211_mlme_authfunction cfg80211_oper_and_ht_capafunction cfg80211_oper_and_vht_capafunction cfg80211_mlme_check_mlo_compatfunction APfunction cfg80211_mlme_check_mlofunction cfg80211_mlme_assocfunction cfg80211_mlme_deauthfunction cfg80211_mlme_disassocfunction cfg80211_mlme_downfunction cfg80211_mgmt_registrations_updatefunction list_for_each_entryfunction cfg80211_mgmt_registrations_update_wkfunction cfg80211_mlme_register_mgmtfunction Negotiationfunction list_for_each_entryfunction cfg80211_mlme_unregister_socketfunction list_for_each_entry_safefunction cfg80211_mlme_purge_registrationsfunction cfg80211_allowed_addressfunction for_each_valid_linkfunction cfg80211_allowed_random_addressfunction cfg80211_mlme_mgmt_txfunction cfg80211_rx_mgmt_extfunction list_for_each_entryfunction cfg80211_sched_dfs_chan_updatefunction cfg80211_dfs_channels_update_workfunction __cfg80211_radar_eventfunction cfg80211_cac_eventfunction __cfg80211_background_cac_eventfunction cfg80211_background_cac_done_wkfunction cfg80211_background_cac_abort_wkfunction cfg80211_background_cac_abortfunction cfg80211_start_background_radar_detectionfunction cfg80211_stop_radar_detectionfunction for_each_valid_linkfunction cfg80211_stop_background_radar_detection
Annotated Snippet
struct cfg80211_mgmt_registration {
struct list_head list;
struct wireless_dev *wdev;
u32 nlportid;
int match_len;
__le16 frame_type;
bool multicast_rx;
u8 match[];
};
static void cfg80211_mgmt_registrations_update(struct wireless_dev *wdev)
{
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
struct wireless_dev *tmp;
struct cfg80211_mgmt_registration *reg;
struct mgmt_frame_regs upd = {};
lockdep_assert_held(&rdev->wiphy.mtx);
spin_lock_bh(&rdev->mgmt_registrations_lock);
if (!wdev->mgmt_registrations_need_update) {
spin_unlock_bh(&rdev->mgmt_registrations_lock);
return;
}
rcu_read_lock();
list_for_each_entry_rcu(tmp, &rdev->wiphy.wdev_list, list) {
list_for_each_entry(reg, &tmp->mgmt_registrations, list) {
u32 mask = BIT(le16_to_cpu(reg->frame_type) >> 4);
u32 mcast_mask = 0;
if (reg->multicast_rx)
mcast_mask = mask;
upd.global_stypes |= mask;
upd.global_mcast_stypes |= mcast_mask;
if (tmp == wdev) {
upd.interface_stypes |= mask;
upd.interface_mcast_stypes |= mcast_mask;
}
}
}
rcu_read_unlock();
wdev->mgmt_registrations_need_update = 0;
spin_unlock_bh(&rdev->mgmt_registrations_lock);
rdev_update_mgmt_frame_registrations(rdev, wdev, &upd);
}
void cfg80211_mgmt_registrations_update_wk(struct work_struct *wk)
{
struct cfg80211_registered_device *rdev;
struct wireless_dev *wdev;
rdev = container_of(wk, struct cfg80211_registered_device,
mgmt_registrations_update_wk);
guard(wiphy)(&rdev->wiphy);
list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list)
cfg80211_mgmt_registrations_update(wdev);
}
int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid,
u16 frame_type, const u8 *match_data,
int match_len, bool multicast_rx,
struct netlink_ext_ack *extack)
{
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
struct cfg80211_mgmt_registration *reg, *nreg;
int err = 0;
u16 mgmt_type;
bool update_multicast = false;
if (!wdev->wiphy->mgmt_stypes)
return -EOPNOTSUPP;
if ((frame_type & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT) {
NL_SET_ERR_MSG(extack, "frame type not management");
return -EINVAL;
}
if (frame_type & ~(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) {
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/etherdevice.h`, `linux/netdevice.h`, `linux/nl80211.h`, `linux/slab.h`, `linux/wireless.h`, `net/cfg80211.h`.
- Detected declarations: `struct cfg80211_mgmt_registration`, `function Copyright`, `function a`, `function cfg80211_process_auth`, `function cfg80211_process_deauth`, `function cfg80211_process_disassoc`, `function cfg80211_rx_mlme_mgmt`, `function cfg80211_auth_timeout`, `function cfg80211_assoc_failure`, `function cfg80211_tx_mlme_mgmt`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: integration 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.