drivers/net/wireless/intel/iwlwifi/mld/tx.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mld/tx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mld/tx.c- Extension
.c- Size
- 39237 bytes
- Lines
- 1431
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- 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
net/ip.htx.hsta.hhcmd.hiwl-utils.hiface.hfw/dbg.hfw/api/tx.hfw/api/rs.hfw/api/txq.hfw/api/datapath.hfw/api/time-event.h
Detected Declarations
function Copyrightfunction iwl_mld_toggle_tx_antfunction iwl_mld_get_queue_sizefunction for_each_sta_active_linkfunction iwl_mld_allocate_txqfunction iwl_mld_add_txqfunction iwl_mld_add_txq_listfunction iwl_mld_add_txqs_wkfunction iwl_mld_free_txqfunction iwl_mld_remove_txqfunction iwl_mld_get_offload_assistfunction iwl_mld_get_basic_rates_and_bandfunction iwl_mld_get_lowest_ratefunction iwl_mld_mac80211_rate_idx_to_fwfunction iwl_mld_get_tx_antfunction iwl_mld_get_inject_tx_ratefunction iwl_mld_get_tx_rate_n_flagsfunction iwl_mld_fill_tx_cmd_hdrfunction iwl_mld_fill_tx_cmdfunction iwl_mld_get_link_from_tx_infofunction iwl_mld_get_tx_queue_idfunction iwl_mld_probe_resp_set_noafunction iwl_mld_tx_mpdufunction iwl_mld_tx_tso_segmentfunction iwl_mld_tx_tsofunction iwl_mld_tx_tsofunction iwl_mld_tx_skbfunction iwl_mld_tx_from_txqfunction iwl_mld_hwrate_to_tx_ratefunction iwl_mld_handle_tx_resp_notiffunction iwl_mld_tx_reclaim_txqfunction iwl_mld_flush_link_sta_txqsfunction iwl_mld_ensure_queuefunction iwl_mld_update_sta_txqsfunction iwl_mld_handle_compressed_ba_notif
Annotated Snippet
if (link_sta->eht_cap.has_eht) {
max_size = IWL_DEFAULT_QUEUE_SIZE_EHT;
break;
}
if (link_sta->he_cap.has_he)
max_size = IWL_DEFAULT_QUEUE_SIZE_HE;
}
return max_size;
}
static int iwl_mld_allocate_txq(struct iwl_mld *mld, struct ieee80211_txq *txq)
{
u8 tid = txq->tid == IEEE80211_NUM_TIDS ? IWL_MGMT_TID : txq->tid;
u32 fw_sta_mask = iwl_mld_fw_sta_id_mask(mld, txq->sta);
unsigned int watchdog_timeout;
int queue, size;
switch (txq->vif->type) {
case NL80211_IFTYPE_AP: /* STA might go to PS */
case NL80211_IFTYPE_NAN_DATA: /* peer might ULW/break schedule */
watchdog_timeout = IWL_WATCHDOG_DISABLED;
break;
default:
watchdog_timeout = mld->trans->mac_cfg->base->wd_timeout;
break;
}
lockdep_assert_wiphy(mld->wiphy);
if (tid == IWL_MGMT_TID)
size = max_t(u32, IWL_MGMT_QUEUE_SIZE,
mld->trans->mac_cfg->base->min_txq_size);
else
size = iwl_mld_get_queue_size(mld, txq);
queue = iwl_trans_txq_alloc(mld->trans, 0, fw_sta_mask, tid, size,
watchdog_timeout);
if (queue >= 0)
IWL_DEBUG_TX_QUEUES(mld,
"Enabling TXQ #%d for sta mask 0x%x tid %d\n",
queue, fw_sta_mask, tid);
return queue;
}
static int iwl_mld_add_txq(struct iwl_mld *mld, struct ieee80211_txq *txq)
{
struct iwl_mld_txq *mld_txq = iwl_mld_txq_from_mac80211(txq);
int id;
lockdep_assert_wiphy(mld->wiphy);
/* This will alse send the SCD_QUEUE_CONFIG_CMD */
id = iwl_mld_allocate_txq(mld, txq);
if (id < 0)
return id;
mld_txq->fw_id = id;
mld_txq->status.allocated = true;
rcu_assign_pointer(mld->fw_id_to_txq[id], txq);
return 0;
}
void iwl_mld_add_txq_list(struct iwl_mld *mld)
{
lockdep_assert_wiphy(mld->wiphy);
while (!list_empty(&mld->txqs_to_add)) {
struct ieee80211_txq *txq;
struct iwl_mld_txq *mld_txq =
list_first_entry(&mld->txqs_to_add, struct iwl_mld_txq,
list);
int failed;
txq = container_of((void *)mld_txq, struct ieee80211_txq,
drv_priv);
failed = iwl_mld_add_txq(mld, txq);
local_bh_disable();
spin_lock(&mld->add_txqs_lock);
list_del_init(&mld_txq->list);
spin_unlock(&mld->add_txqs_lock);
/* If the queue allocation failed, we can't transmit. Leave the
* frames on the txq, maybe the attempt to allocate the queue
* will succeed.
Annotation
- Immediate include surface: `net/ip.h`, `tx.h`, `sta.h`, `hcmd.h`, `iwl-utils.h`, `iface.h`, `fw/dbg.h`, `fw/api/tx.h`.
- Detected declarations: `function Copyright`, `function iwl_mld_toggle_tx_ant`, `function iwl_mld_get_queue_size`, `function for_each_sta_active_link`, `function iwl_mld_allocate_txq`, `function iwl_mld_add_txq`, `function iwl_mld_add_txq_list`, `function iwl_mld_add_txqs_wk`, `function iwl_mld_free_txq`, `function iwl_mld_remove_txq`.
- Atlas domain: Driver Families / drivers/net.
- 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.