net/mac80211/agg-tx.c
Source file repositories/reference/linux-study-clean/net/mac80211/agg-tx.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/agg-tx.c- Extension
.c- Size
- 31273 bytes
- Lines
- 1067
- 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/ieee80211.hlinux/slab.hlinux/export.hnet/mac80211.hieee80211_i.hdriver-ops.hwme.h
Detected Declarations
function Copyrightfunction ieee80211_send_barfunction ieee80211_assign_tid_txfunction __acquiresfunction __releasesfunction ieee80211_agg_stop_txqfunction ieee80211_agg_start_txqfunction __acquiresfunction __releasesfunction ieee80211_remove_tid_txfunction __ieee80211_stop_tx_ba_sessionfunction sta_addba_resp_timer_expiredfunction ieee80211_send_addba_with_timeoutfunction ieee80211_tx_ba_session_handle_startfunction ieee80211_refresh_tx_agg_session_timerfunction sta_tx_agg_session_timer_expiredfunction ieee80211_start_tx_ba_sessionfunction time_beforefunction ieee80211_agg_tx_operationalfunction ieee80211_start_tx_ba_cbfunction ieee80211_lookup_tid_txfunction ieee80211_start_tx_ba_cb_irqsafefunction ieee80211_stop_tx_ba_sessionfunction ieee80211_stop_tx_ba_cbfunction ieee80211_stop_tx_ba_cb_irqsafefunction ieee80211_process_addba_respfunction test_bitexport ieee80211_send_barexport ieee80211_refresh_tx_agg_session_timerexport ieee80211_start_tx_ba_sessionexport ieee80211_start_tx_ba_cb_irqsafeexport ieee80211_stop_tx_ba_sessionexport ieee80211_stop_tx_ba_cb_irqsafe
Annotated Snippet
ieee80211_hw_check(&local->hw, STRICT)) {
buf_size = local->hw.max_tx_aggregation_subframes;
} else if (sta->sta.deflink.he_cap.has_he) {
buf_size = min_t(u16, local->hw.max_tx_aggregation_subframes,
IEEE80211_MAX_AMPDU_BUF_HE);
} else {
/*
* We really should use what the driver told us it will
* transmit as the maximum, but certain APs (e.g. the
* LinkSys WRT120N with FW v1.0.07 build 002 Jun 18 2012)
* will crash when we use a lower number.
*/
buf_size = IEEE80211_MAX_AMPDU_BUF_HT;
}
/* send AddBA request */
ieee80211_send_addba_request(sta, tid, tid_tx->dialog_token,
tid_tx->ssn, buf_size, tid_tx->timeout,
tid_tx->ndp);
WARN_ON(test_and_set_bit(HT_AGG_STATE_SENT_ADDBA, &tid_tx->state));
}
void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
{
struct tid_ampdu_tx *tid_tx;
struct ieee80211_local *local = sta->local;
struct ieee80211_sub_if_data *sdata = sta->sdata;
struct ieee80211_ampdu_params params = {
.sta = &sta->sta,
.action = IEEE80211_AMPDU_TX_START,
.tid = tid,
.buf_size = 0,
.amsdu = false,
.timeout = 0,
};
int ret;
tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
/*
* Start queuing up packets for this aggregation session.
* We're going to release them once the driver is OK with
* that.
*/
clear_bit(HT_AGG_STATE_WANT_START, &tid_tx->state);
/*
* Make sure no packets are being processed. This ensures that
* we have a valid starting sequence number and that in-flight
* packets have been flushed out and no packets for this TID
* will go into the driver during the ampdu_action call.
*/
synchronize_net();
tid_tx->ndp = ieee80211_s1g_use_ndp_ba(sdata, sta);
params.ssn = sta->tid_seq[tid] >> 4;
ret = drv_ampdu_action(local, sdata, ¶ms);
tid_tx->ssn = params.ssn;
if (ret == IEEE80211_AMPDU_TX_START_DELAY_ADDBA) {
return;
} else if (ret == IEEE80211_AMPDU_TX_START_IMMEDIATE) {
/*
* We didn't send the request yet, so don't need to check
* here if we already got a response, just mark as driver
* ready immediately.
*/
set_bit(HT_AGG_STATE_DRV_READY, &tid_tx->state);
} else if (ret) {
ht_dbg(sdata,
"BA request denied - HW unavailable for %pM tid %d\n",
sta->sta.addr, tid);
spin_lock_bh(&sta->lock);
ieee80211_agg_splice_packets(sdata, tid_tx, tid);
ieee80211_assign_tid_tx(sta, tid, NULL);
ieee80211_agg_splice_finish(sdata, tid);
spin_unlock_bh(&sta->lock);
ieee80211_agg_start_txq(sta, tid, false);
kfree_rcu(tid_tx, rcu_head);
return;
}
ieee80211_send_addba_with_timeout(sta, tid_tx);
}
void ieee80211_refresh_tx_agg_session_timer(struct ieee80211_sta *pubsta,
u16 tid)
{
Annotation
- Immediate include surface: `linux/ieee80211.h`, `linux/slab.h`, `linux/export.h`, `net/mac80211.h`, `ieee80211_i.h`, `driver-ops.h`, `wme.h`.
- Detected declarations: `function Copyright`, `function ieee80211_send_bar`, `function ieee80211_assign_tid_tx`, `function __acquires`, `function __releases`, `function ieee80211_agg_stop_txq`, `function ieee80211_agg_start_txq`, `function __acquires`, `function __releases`, `function ieee80211_remove_tid_tx`.
- 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.