net/wireless/sysfs.c
Source file repositories/reference/linux-study-clean/net/wireless/sysfs.c
File Facts
- System
- Linux kernel
- Corpus path
net/wireless/sysfs.c- Extension
.c- Size
- 4442 bytes
- Lines
- 188
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/module.hlinux/netdevice.hlinux/nl80211.hlinux/rtnetlink.hnet/cfg80211.hsysfs.hcore.hrdev-ops.h
Detected Declarations
function Copyrightfunction name_showfunction addresses_showfunction wiphy_dev_releasefunction cfg80211_leave_allfunction wiphy_suspendfunction wiphy_resumefunction wiphy_sysfs_initfunction wiphy_sysfs_exit
Annotated Snippet
scoped_guard(wiphy, &rdev->wiphy) {
cfg80211_process_wiphy_works(rdev, NULL);
if (rdev->ops->suspend)
ret = rdev_suspend(rdev,
rdev->wiphy.wowlan_config);
if (ret <= 0)
goto out_unlock_rtnl;
}
}
/* Driver refused to configure wowlan (ret = 1) or no wowlan */
cfg80211_leave_all(rdev);
scoped_guard(wiphy, &rdev->wiphy) {
cfg80211_process_rdev_events(rdev);
cfg80211_process_wiphy_works(rdev, NULL);
if (rdev->ops->suspend)
ret = rdev_suspend(rdev, NULL);
}
out_unlock_rtnl:
if (ret == 0)
rdev->suspended = true;
rtnl_unlock();
return ret;
}
static int wiphy_resume(struct device *dev)
{
struct cfg80211_registered_device *rdev = dev_to_rdev(dev);
int ret = 0;
/* Age scan results with time spent in suspend */
cfg80211_bss_age(rdev, ktime_get_boottime_seconds() - rdev->suspend_at);
rtnl_lock();
wiphy_lock(&rdev->wiphy);
if (rdev->wiphy.registered && rdev->ops->resume)
ret = rdev_resume(rdev);
rdev->suspended = false;
queue_work(system_dfl_wq, &rdev->wiphy_work);
wiphy_unlock(&rdev->wiphy);
if (ret)
cfg80211_shutdown_all_interfaces(&rdev->wiphy);
rtnl_unlock();
return ret;
}
static SIMPLE_DEV_PM_OPS(wiphy_pm_ops, wiphy_suspend, wiphy_resume);
#define WIPHY_PM_OPS (&wiphy_pm_ops)
#else
#define WIPHY_PM_OPS NULL
#endif
static const struct ns_common *wiphy_namespace(const struct device *d)
{
struct wiphy *wiphy = container_of(d, struct wiphy, dev);
return to_ns_common(wiphy_net(wiphy));
}
struct class ieee80211_class = {
.name = "ieee80211",
.dev_release = wiphy_dev_release,
.dev_groups = ieee80211_groups,
.pm = WIPHY_PM_OPS,
.ns_type = &net_ns_type_operations,
.namespace = wiphy_namespace,
};
int wiphy_sysfs_init(void)
{
return class_register(&ieee80211_class);
}
void wiphy_sysfs_exit(void)
{
class_unregister(&ieee80211_class);
}
Annotation
- Immediate include surface: `linux/device.h`, `linux/module.h`, `linux/netdevice.h`, `linux/nl80211.h`, `linux/rtnetlink.h`, `net/cfg80211.h`, `sysfs.h`, `core.h`.
- Detected declarations: `function Copyright`, `function name_show`, `function addresses_show`, `function wiphy_dev_release`, `function cfg80211_leave_all`, `function wiphy_suspend`, `function wiphy_resume`, `function wiphy_sysfs_init`, `function wiphy_sysfs_exit`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.