net/mac80211/offchannel.c
Source file repositories/reference/linux-study-clean/net/mac80211/offchannel.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/offchannel.c- Extension
.c- Size
- 29439 bytes
- Lines
- 1099
- 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/export.hnet/mac80211.hieee80211_i.hdriver-ops.h
Detected Declarations
function Copyrightfunction ieee80211_offchannel_ps_disablefunction ieee80211_offchannel_stop_vifsfunction list_for_each_entryfunction ieee80211_offchannel_returnfunction list_for_each_entryfunction ieee80211_roc_notify_destroyfunction ieee80211_end_finished_rocsfunction list_for_each_entry_safefunction ieee80211_recalc_sw_workfunction ieee80211_handle_roc_startedfunction ieee80211_hw_roc_startfunction list_for_each_entryfunction ieee80211_ready_on_channelfunction _ieee80211_start_next_rocfunction list_for_each_entryfunction list_for_each_entryfunction list_for_each_entryfunction list_for_each_entryfunction ieee80211_start_next_rocfunction ieee80211_reconfig_rocfunction list_for_each_entry_safefunction __ieee80211_roc_workfunction ieee80211_roc_workfunction ieee80211_hw_roc_donefunction ieee80211_remain_on_channel_expiredfunction ieee80211_coalesce_hw_started_rocfunction ieee80211_start_roc_workfunction cookiefunction list_for_each_entryfunction ieee80211_remain_on_channelfunction ieee80211_cancel_rocfunction list_for_each_entry_safefunction list_for_each_entry_safefunction ieee80211_cancel_remain_on_channelfunction ieee80211_mgmt_txfunction ether_addr_equalfunction ieee80211_mgmt_tx_cancel_waitfunction ieee80211_roc_setupfunction ieee80211_roc_purgefunction list_for_each_entry_safeexport ieee80211_ready_on_channelexport ieee80211_remain_on_channel_expired
Annotated Snippet
else if (local->hw.conf.dynamic_ps_timeout > 0) {
/*
* the dynamic_ps_timer had been running before leaving the
* operating channel, restart the timer now and send a nullfunc
* frame to inform the AP that we are awake so that AP sends
* the buffered packets (if any).
*/
ieee80211_send_nullfunc(local, sdata, false);
mod_timer(&local->dynamic_ps_timer, jiffies +
msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
}
ieee80211_sta_reset_beacon_monitor(sdata);
ieee80211_sta_reset_conn_monitor(sdata);
}
void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local)
{
struct ieee80211_sub_if_data *sdata;
lockdep_assert_wiphy(local->hw.wiphy);
if (WARN_ON(!local->emulate_chanctx))
return;
/*
* notify the AP about us leaving the channel and stop all
* STA interfaces.
*/
/*
* Stop queues and transmit all frames queued by the driver
* before sending nullfunc to enable powersave at the AP.
*/
ieee80211_stop_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL,
false);
ieee80211_flush_queues(local, NULL, false);
list_for_each_entry(sdata, &local->interfaces, list) {
if (!ieee80211_sdata_running(sdata))
continue;
if (sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE ||
sdata->vif.type == NL80211_IFTYPE_NAN)
continue;
if (sdata->vif.type != NL80211_IFTYPE_MONITOR)
set_bit(SDATA_STATE_OFFCHANNEL, &sdata->state);
/* Check to see if we should disable beaconing. */
if (sdata->vif.bss_conf.enable_beacon) {
set_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED,
&sdata->state);
sdata->vif.bss_conf.enable_beacon = false;
ieee80211_link_info_change_notify(
sdata, &sdata->deflink,
BSS_CHANGED_BEACON_ENABLED);
}
if (sdata->vif.type == NL80211_IFTYPE_STATION &&
sdata->u.mgd.associated)
ieee80211_offchannel_ps_enable(sdata);
}
}
void ieee80211_offchannel_return(struct ieee80211_local *local)
{
struct ieee80211_sub_if_data *sdata;
lockdep_assert_wiphy(local->hw.wiphy);
if (WARN_ON(!local->emulate_chanctx))
return;
list_for_each_entry(sdata, &local->interfaces, list) {
if (sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE)
continue;
if (sdata->vif.type != NL80211_IFTYPE_MONITOR)
clear_bit(SDATA_STATE_OFFCHANNEL, &sdata->state);
if (!ieee80211_sdata_running(sdata))
continue;
/* Tell AP we're back */
if (sdata->vif.type == NL80211_IFTYPE_STATION &&
sdata->u.mgd.associated)
ieee80211_offchannel_ps_disable(sdata);
Annotation
- Immediate include surface: `linux/export.h`, `net/mac80211.h`, `ieee80211_i.h`, `driver-ops.h`.
- Detected declarations: `function Copyright`, `function ieee80211_offchannel_ps_disable`, `function ieee80211_offchannel_stop_vifs`, `function list_for_each_entry`, `function ieee80211_offchannel_return`, `function list_for_each_entry`, `function ieee80211_roc_notify_destroy`, `function ieee80211_end_finished_rocs`, `function list_for_each_entry_safe`, `function ieee80211_recalc_sw_work`.
- 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.