net/mac80211/ethtool.c
Source file repositories/reference/linux-study-clean/net/mac80211/ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/ethtool.c- Extension
.c- Size
- 6899 bytes
- Lines
- 255
- 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/types.hnet/cfg80211.hieee80211_i.hsta_info.hdriver-ops.h
Detected Declarations
function Corporationfunction ieee80211_get_ringparamfunction ieee80211_get_sset_countfunction ieee80211_get_statsfunction list_for_each_entryfunction ieee80211_get_stringsfunction ieee80211_get_regs_lenfunction ieee80211_get_regs
Annotated Snippet
list_for_each_entry(sta, &local->sta_list, list) {
/* Make sure this station belongs to the proper dev */
if (sta->sdata->dev != dev)
continue;
memset(&sinfo, 0, sizeof(sinfo));
sta_set_sinfo(sta, &sinfo, false);
i = 0;
ADD_STA_STATS(&sta->deflink);
data[i++] = sdata->tx_handlers_drop;
}
}
do_survey:
i = STA_STATS_LEN - STA_STATS_SURVEY_LEN;
/* Get survey stats for current channel */
survey.filled = 0;
rcu_read_lock();
chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf);
if (chanctx_conf)
channel = chanctx_conf->def.chan;
else if (local->open_count > 0 &&
local->open_count == local->virt_monitors &&
sdata->vif.type == NL80211_IFTYPE_MONITOR)
channel = local->monitor_chanreq.oper.chan;
else
channel = NULL;
rcu_read_unlock();
if (channel) {
q = 0;
do {
survey.filled = 0;
if (drv_get_survey(local, q, &survey) != 0) {
survey.filled = 0;
break;
}
q++;
} while (channel != survey.channel);
}
if (survey.filled)
data[i++] = survey.channel->center_freq;
else
data[i++] = 0;
if (survey.filled & SURVEY_INFO_NOISE_DBM)
data[i++] = (u8)survey.noise;
else
data[i++] = -1LL;
if (survey.filled & SURVEY_INFO_TIME)
data[i++] = survey.time;
else
data[i++] = -1LL;
if (survey.filled & SURVEY_INFO_TIME_BUSY)
data[i++] = survey.time_busy;
else
data[i++] = -1LL;
if (survey.filled & SURVEY_INFO_TIME_EXT_BUSY)
data[i++] = survey.time_ext_busy;
else
data[i++] = -1LL;
if (survey.filled & SURVEY_INFO_TIME_RX)
data[i++] = survey.time_rx;
else
data[i++] = -1LL;
if (survey.filled & SURVEY_INFO_TIME_TX)
data[i++] = survey.time_tx;
else
data[i++] = -1LL;
if (WARN_ON(i != STA_STATS_LEN))
return;
drv_get_et_stats(sdata, stats, &(data[STA_STATS_LEN]));
}
static void ieee80211_get_strings(struct net_device *dev, u32 sset, u8 *data)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
int sz_sta_stats = 0;
if (sset == ETH_SS_STATS) {
sz_sta_stats = sizeof(ieee80211_gstrings_sta_stats);
memcpy(data, ieee80211_gstrings_sta_stats, sz_sta_stats);
}
drv_get_et_strings(sdata, sset, &(data[sz_sta_stats]));
}
static int ieee80211_get_regs_len(struct net_device *dev)
Annotation
- Immediate include surface: `linux/types.h`, `net/cfg80211.h`, `ieee80211_i.h`, `sta_info.h`, `driver-ops.h`.
- Detected declarations: `function Corporation`, `function ieee80211_get_ringparam`, `function ieee80211_get_sset_count`, `function ieee80211_get_stats`, `function list_for_each_entry`, `function ieee80211_get_strings`, `function ieee80211_get_regs_len`, `function ieee80211_get_regs`.
- 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.