net/mac80211/driver-ops.c
Source file repositories/reference/linux-study-clean/net/mac80211/driver-ops.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/driver-ops.c- Extension
.c- Size
- 16301 bytes
- Lines
- 636
- 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
net/mac80211.hieee80211_i.htrace.hdriver-ops.hdebugfs_sta.hdebugfs_netdev.h
Detected Declarations
function Copyrightfunction drv_stopfunction drv_add_interfacefunction drv_change_interfacefunction drv_remove_interfacefunction drv_sta_statefunction drv_sta_set_txpwrfunction drv_link_sta_rc_updatefunction drv_conf_txfunction drv_get_tsffunction drv_set_tsffunction drv_offset_tsffunction drv_reset_tsffunction drv_assign_vif_chanctxfunction drv_unassign_vif_chanctxfunction drv_switch_vif_chanctxfunction drv_ampdu_actionfunction drv_link_info_changedfunction drv_set_keyfunction drv_change_vif_linksfunction for_each_set_bitfunction drv_change_sta_linksfunction for_each_set_bitfunction for_each_set_bit
Annotated Snippet
if (ret == 0) {
sta->uploaded = true;
if (rcu_access_pointer(sta->sta.rates))
drv_sta_rate_tbl_update(local, sdata, &sta->sta);
}
} else if (old_state == IEEE80211_STA_ASSOC &&
new_state == IEEE80211_STA_AUTH) {
drv_sta_remove(local, sdata, &sta->sta);
}
trace_drv_return_int(local, ret);
return ret;
}
__must_check
int drv_sta_set_txpwr(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct sta_info *sta)
{
int ret = -EOPNOTSUPP;
might_sleep();
lockdep_assert_wiphy(local->hw.wiphy);
sdata = get_bss_sdata(sdata);
if (!check_sdata_in_driver(sdata))
return -EIO;
trace_drv_sta_set_txpwr(local, sdata, &sta->sta);
if (local->ops->sta_set_txpwr)
ret = local->ops->sta_set_txpwr(&local->hw, &sdata->vif,
&sta->sta);
trace_drv_return_int(local, ret);
return ret;
}
void drv_link_sta_rc_update(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_link_sta *link_sta,
u32 changed)
{
sdata = get_bss_sdata(sdata);
if (!check_sdata_in_driver(sdata))
return;
WARN_ON(changed & IEEE80211_RC_SUPP_RATES_CHANGED &&
(sdata->vif.type != NL80211_IFTYPE_ADHOC &&
sdata->vif.type != NL80211_IFTYPE_MESH_POINT));
trace_drv_link_sta_rc_update(local, sdata, link_sta, changed);
if (local->ops->link_sta_rc_update)
local->ops->link_sta_rc_update(&local->hw, &sdata->vif,
link_sta, changed);
trace_drv_return_void(local);
}
int drv_conf_tx(struct ieee80211_local *local,
struct ieee80211_link_data *link, u16 ac,
const struct ieee80211_tx_queue_params *params)
{
struct ieee80211_sub_if_data *sdata = link->sdata;
int ret = -EOPNOTSUPP;
might_sleep();
lockdep_assert_wiphy(local->hw.wiphy);
if (!check_sdata_in_driver(sdata))
return -EIO;
if (!ieee80211_vif_link_active(&sdata->vif, link->link_id))
return 0;
if (params->cw_min == 0 || params->cw_min > params->cw_max) {
/*
* If we can't configure hardware anyway, don't warn. We may
* never have initialized the CW parameters.
*/
WARN_ONCE(local->ops->conf_tx,
"%s: invalid CW_min/CW_max: %d/%d\n",
sdata->name, params->cw_min, params->cw_max);
return -EINVAL;
}
trace_drv_conf_tx(local, sdata, link->link_id, ac, params);
if (local->ops->conf_tx)
ret = local->ops->conf_tx(&local->hw, &sdata->vif,
link->link_id, ac, params);
trace_drv_return_int(local, ret);
return ret;
}
Annotation
- Immediate include surface: `net/mac80211.h`, `ieee80211_i.h`, `trace.h`, `driver-ops.h`, `debugfs_sta.h`, `debugfs_netdev.h`.
- Detected declarations: `function Copyright`, `function drv_stop`, `function drv_add_interface`, `function drv_change_interface`, `function drv_remove_interface`, `function drv_sta_state`, `function drv_sta_set_txpwr`, `function drv_link_sta_rc_update`, `function drv_conf_tx`, `function drv_get_tsf`.
- 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.