net/wireless/wext-sme.c
Source file repositories/reference/linux-study-clean/net/wireless/wext-sme.c
File Facts
- System
- Linux kernel
- Corpus path
net/wireless/wext-sme.c- Extension
.c- Size
- 8801 bytes
- Lines
- 370
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hlinux/etherdevice.hlinux/if_arp.hlinux/slab.hnet/cfg80211.hnet/cfg80211-wext.hwext-compat.hnl80211.h
Detected Declarations
function Copyrightfunction cfg80211_mgd_wext_siwfreqfunction cfg80211_mgd_wext_giwfreqfunction cfg80211_mgd_wext_siwessidfunction cfg80211_mgd_wext_giwessidfunction cfg80211_mgd_wext_siwapfunction cfg80211_mgd_wext_giwapfunction cfg80211_wext_siwgeniefunction cfg80211_wext_siwmlme
Annotated Snippet
if (ssid_elem) {
data->flags = 1;
data->length = ssid_elem->datalen;
if (data->length > IW_ESSID_MAX_SIZE)
ret = -EINVAL;
else
memcpy(ssid, ssid_elem->data, data->length);
}
rcu_read_unlock();
} else if (wdev->wext.connect.ssid && wdev->wext.connect.ssid_len) {
data->flags = 1;
data->length = wdev->wext.connect.ssid_len;
memcpy(ssid, wdev->wext.connect.ssid, data->length);
}
return ret;
}
int cfg80211_mgd_wext_siwap(struct net_device *dev,
struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
u8 *bssid = ap_addr->sa_data;
int err;
/* call only for station! */
if (WARN_ON(wdev->iftype != NL80211_IFTYPE_STATION))
return -EINVAL;
if (ap_addr->sa_family != ARPHRD_ETHER)
return -EINVAL;
/* automatic mode */
if (is_zero_ether_addr(bssid) || is_broadcast_ether_addr(bssid))
bssid = NULL;
if (wdev->conn) {
/* both automatic */
if (!bssid && !wdev->wext.connect.bssid)
return 0;
/* fixed already - and no change */
if (wdev->wext.connect.bssid && bssid &&
ether_addr_equal(bssid, wdev->wext.connect.bssid))
return 0;
err = cfg80211_disconnect(rdev, dev,
WLAN_REASON_DEAUTH_LEAVING, false);
if (err)
return err;
}
if (bssid) {
memcpy(wdev->wext.bssid, bssid, ETH_ALEN);
wdev->wext.connect.bssid = wdev->wext.bssid;
} else
wdev->wext.connect.bssid = NULL;
return cfg80211_mgd_wext_connect(rdev, wdev);
}
int cfg80211_mgd_wext_giwap(struct net_device *dev,
struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
/* call only for station! */
if (WARN_ON(wdev->iftype != NL80211_IFTYPE_STATION))
return -EINVAL;
ap_addr->sa_family = ARPHRD_ETHER;
if (wdev->valid_links)
return -EOPNOTSUPP;
if (wdev->links[0].client.current_bss)
memcpy(ap_addr->sa_data,
wdev->links[0].client.current_bss->pub.bssid,
ETH_ALEN);
else
eth_zero_addr(ap_addr->sa_data);
return 0;
}
int cfg80211_wext_siwgenie(struct net_device *dev,
struct iw_request_info *info,
Annotation
- Immediate include surface: `linux/export.h`, `linux/etherdevice.h`, `linux/if_arp.h`, `linux/slab.h`, `net/cfg80211.h`, `net/cfg80211-wext.h`, `wext-compat.h`, `nl80211.h`.
- Detected declarations: `function Copyright`, `function cfg80211_mgd_wext_siwfreq`, `function cfg80211_mgd_wext_giwfreq`, `function cfg80211_mgd_wext_siwessid`, `function cfg80211_mgd_wext_giwessid`, `function cfg80211_mgd_wext_siwap`, `function cfg80211_mgd_wext_giwap`, `function cfg80211_wext_siwgenie`, `function cfg80211_wext_siwmlme`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source 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.