net/wireless/core.c
Source file repositories/reference/linux-study-clean/net/wireless/core.c
File Facts
- System
- Linux kernel
- Corpus path
net/wireless/core.c- Extension
.c- Size
- 54568 bytes
- Lines
- 2093
- 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/if.hlinux/module.hlinux/err.hlinux/list.hlinux/slab.hlinux/nl80211.hlinux/debugfs.hlinux/notifier.hlinux/device.hlinux/etherdevice.hlinux/rtnetlink.hlinux/sched.hnet/genetlink.hnet/cfg80211.hnl80211.hcore.hsysfs.hdebugfs.hwext-compat.hrdev-ops.h
Detected Declarations
function for_each_rdevfunction get_wiphy_idxfunction cfg80211_dev_check_namefunction cfg80211_dev_renamefunction cfg80211_switch_netnsfunction list_for_each_entryfunction list_for_each_entry_continue_reversefunction list_for_each_entryfunction list_for_each_entryfunction cfg80211_rfkill_pollfunction cfg80211_stop_p2p_devicefunction cfg80211_stop_nanfunction cfg80211_nan_set_local_schedulefunction cfg80211_stop_pdfunction cfg80211_shutdown_all_interfacesfunction list_for_each_entryfunction cfg80211_rfkill_set_blockfunction cfg80211_rfkill_block_workfunction cfg80211_event_workfunction cfg80211_destroy_ifacesfunction list_for_each_entry_safefunction cfg80211_close_dependentsfunction cfg80211_destroy_iface_wkfunction cfg80211_sched_scan_stop_wkfunction list_for_each_entry_safefunction cfg80211_propagate_radar_detect_wkfunction cfg80211_propagate_cac_done_wkfunction cfg80211_wiphy_workfunction wiphy_verify_iface_combinationsfunction wiphy_verify_combinationsfunction wiphy_cipher_suites_validfunction wiphy_registerfunction for_each_sband_iftype_datafunction wiphy_rfkill_start_pollingfunction cfg80211_process_wiphy_worksfunction wiphy_unregisterfunction cfg80211_dev_freefunction wiphy_freefunction wiphy_rfkill_set_hw_state_reasonfunction _cfg80211_unregister_wdevfunction cfg80211_unregister_wdevfunction cfg80211_update_iface_numfunction cfg80211_leave_lockedfunction list_for_each_entry_safefunction cfg80211_leavefunction cfg80211_stop_linkfunction cfg80211_init_wdevfunction cfg80211_register_wdev
Annotated Snippet
res = device_add(&rdev->wiphy.dev);
if (res) {
wiphy_unlock(&rdev->wiphy);
rtnl_unlock();
return res;
}
list_add_rcu(&rdev->list, &cfg80211_rdev_list);
cfg80211_rdev_list_generation++;
/* add to debugfs */
rdev->wiphy.debugfsdir = debugfs_create_dir(wiphy_name(&rdev->wiphy),
ieee80211_debugfs_dir);
if (wiphy->n_radio > 0) {
int idx;
char radio_name[RADIO_DEBUGFSDIR_MAX_LEN];
for (idx = 0; idx < wiphy->n_radio; idx++) {
scnprintf(radio_name, sizeof(radio_name), "radio%d",
idx);
wiphy->radio_cfg[idx].radio_debugfsdir =
debugfs_create_dir(radio_name,
rdev->wiphy.debugfsdir);
}
}
cfg80211_debugfs_rdev_add(rdev);
nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY);
wiphy_unlock(&rdev->wiphy);
/* set up regulatory info */
wiphy_regulatory_register(wiphy);
if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) {
struct regulatory_request request = {
.wiphy_idx = get_wiphy_idx(wiphy),
.initiator = NL80211_REGDOM_SET_BY_DRIVER,
.alpha2[0] = '9',
.alpha2[1] = '9',
};
nl80211_send_reg_change_event(&request);
}
/* Check that nobody globally advertises any capabilities they do not
* advertise on all possible interface types.
*/
if (wiphy->extended_capabilities_len &&
wiphy->num_iftype_ext_capab &&
wiphy->iftype_ext_capab) {
u8 supported_on_all, j;
const struct wiphy_iftype_ext_capab *capab;
capab = wiphy->iftype_ext_capab;
for (j = 0; j < wiphy->extended_capabilities_len; j++) {
if (capab[0].extended_capabilities_len > j)
supported_on_all =
capab[0].extended_capabilities[j];
else
supported_on_all = 0x00;
for (i = 1; i < wiphy->num_iftype_ext_capab; i++) {
if (j >= capab[i].extended_capabilities_len) {
supported_on_all = 0x00;
break;
}
supported_on_all &=
capab[i].extended_capabilities[j];
}
if (WARN_ON(wiphy->extended_capabilities[j] &
~supported_on_all))
break;
}
}
rdev->wiphy.registered = true;
rtnl_unlock();
res = rfkill_register(rdev->wiphy.rfkill);
if (res) {
rfkill_destroy(rdev->wiphy.rfkill);
rdev->wiphy.rfkill = NULL;
wiphy_unregister(&rdev->wiphy);
return res;
}
return 0;
}
EXPORT_SYMBOL(wiphy_register);
void wiphy_rfkill_start_polling(struct wiphy *wiphy)
Annotation
- Immediate include surface: `linux/if.h`, `linux/module.h`, `linux/err.h`, `linux/list.h`, `linux/slab.h`, `linux/nl80211.h`, `linux/debugfs.h`, `linux/notifier.h`.
- Detected declarations: `function for_each_rdev`, `function get_wiphy_idx`, `function cfg80211_dev_check_name`, `function cfg80211_dev_rename`, `function cfg80211_switch_netns`, `function list_for_each_entry`, `function list_for_each_entry_continue_reverse`, `function list_for_each_entry`, `function list_for_each_entry`, `function cfg80211_rfkill_poll`.
- 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.