drivers/net/wireless/intel/iwlwifi/dvm/tx.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/dvm/tx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/dvm/tx.c- Extension
.c- Size
- 40534 bytes
- Lines
- 1393
- 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
linux/kernel.hlinux/module.hlinux/sched.hlinux/ieee80211.hiwl-io.hiwl-trans.hiwl-agn-hw.hdev.hagn.h
Detected Declarations
function iwlagn_tx_cmd_protectionfunction iwlagn_tx_cmd_build_basicfunction iwlagn_tx_cmd_build_ratefunction iwlagn_tx_cmd_build_hwcryptofunction iwl_sta_id_or_broadcastfunction iwlagn_tx_skbfunction iwlagn_alloc_agg_txqfunction iwlagn_dealloc_agg_txqfunction iwlagn_tx_agg_stopfunction iwlagn_tx_agg_startfunction iwlagn_tx_agg_flushfunction iwlagn_tx_agg_operfunction iwlagn_check_ratid_emptyfunction iwlagn_non_agg_tx_statusfunction iwlagn_hwrate_to_tx_controlfunction iwlagn_count_agg_tx_err_statusfunction iwlagn_get_scd_ssnfunction iwl_rx_reply_tx_aggfunction iwlagn_count_tx_err_statusfunction iwlagn_set_tx_statusfunction iwl_check_abort_statusfunction iwlagn_rx_reply_txfunction skb_queue_walkfunction iwlagn_rx_reply_compressed_bafunction skb_queue_walk
Annotated Snippet
if (ieee80211_is_probe_resp(fc)) {
data_retry_limit = IWLAGN_MGMT_DFAULT_RETRY_LIMIT;
rts_retry_limit =
min(data_retry_limit, rts_retry_limit);
} else if (ieee80211_is_back_req(fc))
data_retry_limit = IWLAGN_BAR_DFAULT_RETRY_LIMIT;
else
data_retry_limit = IWLAGN_DEFAULT_TX_RETRY;
}
tx_cmd->data_retry_limit = data_retry_limit;
tx_cmd->rts_retry_limit = rts_retry_limit;
/* DATA packets will use the uCode station table for rate/antenna
* selection */
if (ieee80211_is_data(fc)) {
tx_cmd->initial_rate_index = 0;
tx_cmd->tx_flags |= TX_CMD_FLG_STA_RATE_MSK;
return;
} else if (ieee80211_is_back_req(fc))
tx_cmd->tx_flags |= TX_CMD_FLG_STA_RATE_MSK;
/**
* If the current TX rate stored in mac80211 has the MCS bit set, it's
* not really a TX rate. Thus, we use the lowest supported rate for
* this band. Also use the lowest supported rate if the stored rate
* index is invalid.
*/
rate_idx = info->control.rates[0].idx;
if (info->control.rates[0].flags & IEEE80211_TX_RC_MCS ||
(rate_idx < 0) || (rate_idx > IWL_RATE_COUNT_LEGACY))
rate_idx = rate_lowest_index(
&priv->nvm_data->bands[info->band], sta);
/* For 5 GHZ band, remap mac80211 rate indices into driver indices */
if (info->band == NL80211_BAND_5GHZ)
rate_idx += IWL_FIRST_OFDM_RATE;
/* Get PLCP rate for tx_cmd->rate_n_flags */
rate_plcp = iwl_rates[rate_idx].plcp;
/* Zero out flags for this packet */
rate_flags = 0;
/* Set CCK flag as needed */
if ((rate_idx >= IWL_FIRST_CCK_RATE) && (rate_idx <= IWL_LAST_CCK_RATE))
rate_flags |= RATE_MCS_CCK_MSK;
/* Set up antennas */
if (priv->lib->bt_params &&
priv->lib->bt_params->advanced_bt_coexist &&
priv->bt_full_concurrent) {
/* operated as 1x1 in full concurrency mode */
priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant,
first_antenna(priv->nvm_data->valid_tx_ant));
} else
priv->mgmt_tx_ant = iwl_toggle_tx_ant(
priv, priv->mgmt_tx_ant,
priv->nvm_data->valid_tx_ant);
rate_flags |= iwl_ant_idx_to_flags(priv->mgmt_tx_ant);
/* Set the rate in the TX cmd */
tx_cmd->rate_n_flags = iwl_hw_set_rate_n_flags(rate_plcp, rate_flags);
}
static void iwlagn_tx_cmd_build_hwcrypto(struct iwl_priv *priv,
struct ieee80211_tx_info *info,
struct iwl_tx_cmd *tx_cmd,
struct sk_buff *skb_frag)
{
struct ieee80211_key_conf *keyconf = info->control.hw_key;
switch (keyconf->cipher) {
case WLAN_CIPHER_SUITE_CCMP:
tx_cmd->sec_ctl = TX_CMD_SEC_CCM;
memcpy(tx_cmd->key, keyconf->key, keyconf->keylen);
if (info->flags & IEEE80211_TX_CTL_AMPDU)
tx_cmd->tx_flags |= TX_CMD_FLG_AGG_CCMP_MSK;
break;
case WLAN_CIPHER_SUITE_TKIP:
tx_cmd->sec_ctl = TX_CMD_SEC_TKIP;
ieee80211_get_tkip_p2k(keyconf, skb_frag, tx_cmd->key);
break;
case WLAN_CIPHER_SUITE_WEP104:
tx_cmd->sec_ctl |= TX_CMD_SEC_KEY128;
fallthrough;
case WLAN_CIPHER_SUITE_WEP40:
tx_cmd->sec_ctl |= (TX_CMD_SEC_WEP |
(keyconf->keyidx & TX_CMD_SEC_MSK) << TX_CMD_SEC_SHIFT);
memcpy(&tx_cmd->key[3], keyconf->key, keyconf->keylen);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/sched.h`, `linux/ieee80211.h`, `iwl-io.h`, `iwl-trans.h`, `iwl-agn-hw.h`, `dev.h`.
- Detected declarations: `function iwlagn_tx_cmd_protection`, `function iwlagn_tx_cmd_build_basic`, `function iwlagn_tx_cmd_build_rate`, `function iwlagn_tx_cmd_build_hwcrypto`, `function iwl_sta_id_or_broadcast`, `function iwlagn_tx_skb`, `function iwlagn_alloc_agg_txq`, `function iwlagn_dealloc_agg_txq`, `function iwlagn_tx_agg_stop`, `function iwlagn_tx_agg_start`.
- 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.