drivers/net/wireless/intel/iwlwifi/mvm/tx.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/tx.c- Extension
.c- Size
- 66354 bytes
- Lines
- 2276
- 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/ieee80211.hlinux/etherdevice.hlinux/tcp.hnet/gso.hnet/ip.hnet/ipv6.hiwl-trans.hiwl-nvm-utils.hiwl-utils.hmvm.hsta.htime-sync.h
Detected Declarations
function Copyrightfunction iwl_mvm_tx_csumfunction iwl_mvm_set_tx_cmdfunction iwl_mvm_get_tx_antfunction iwl_mvm_convert_rate_idxfunction iwl_mvm_get_inject_tx_ratefunction iwl_mvm_get_tx_ratefunction iwl_mvm_get_tx_rate_n_flagsfunction iwl_mvm_set_tx_cmd_ratefunction iwl_mvm_set_tx_cmd_pnfunction iwl_mvm_set_tx_cmd_cryptofunction iwl_mvm_use_host_ratefunction iwl_mvm_copy_hdrfunction iwl_mvm_set_tx_paramsfunction fwfunction iwl_mvm_skb_prepare_statusfunction iwl_mvm_get_ctrl_vif_queuefunction iwl_mvm_probe_resp_set_noafunction iwl_mvm_tx_skb_non_stafunction iwl_mvm_max_amsdu_sizefunction iwl_mvm_tx_tsofunction iwl_mvm_tx_tsofunction iwl_mvm_txq_should_updatefunction for_each_set_bitfunction iwl_mvm_tx_airtimefunction iwl_mvm_tx_pkt_queuedfunction iwl_mvm_tx_mpdufunction iwl_mvm_tx_skb_stafunction iwl_mvm_tx_mpdufunction iwl_mvm_check_ratid_emptyfunction iwl_mvm_get_hwrate_chan_widthfunction iwl_mvm_hwrate_to_tx_ratefunction iwl_mvm_hwrate_to_tx_statusfunction iwl_mvm_tx_status_check_triggerfunction iwl_mvm_get_scd_ssnfunction iwl_mvm_rx_tx_cmd_singlefunction iwl_mvm_rx_tx_cmd_agg_dbgfunction iwl_mvm_rx_tx_cmd_agg_dbgfunction iwl_mvm_rx_tx_cmdfunction iwl_mvm_tx_reclaimfunction skb_queue_walkfunction skb_queue_walkfunction possiblefunction iwl_mvm_rx_ba_notiffunction iwl_mvm_flush_tx_pathfunction iwl_mvm_flush_sta_tidsfunction iwl_mvm_flush_sta
Annotated Snippet
while (protocol != NEXTHDR_NONE && ipv6_ext_hdr(protocol)) {
struct ipv6_opt_hdr *hp;
/* only supported extension headers */
if (protocol != NEXTHDR_ROUTING &&
protocol != NEXTHDR_HOP &&
protocol != NEXTHDR_DEST) {
skb_checksum_help(skb);
goto out;
}
hp = OPT_HDR(struct ipv6_opt_hdr, skb, off);
protocol = hp->nexthdr;
off += ipv6_optlen(hp);
}
/* if we get here - protocol now should be TCP/UDP */
#endif
}
if (protocol != IPPROTO_TCP && protocol != IPPROTO_UDP) {
WARN_ON_ONCE(1);
skb_checksum_help(skb);
goto out;
}
/* enable L4 csum */
offload_assist |= BIT(TX_CMD_OFFLD_L4_EN);
/*
* Set offset to IP header (snap).
* We don't support tunneling so no need to take care of inner header.
* Size is in words.
*/
offload_assist |= (4 << TX_CMD_OFFLD_IP_HDR);
/* Do IPv4 csum for AMSDU only (no IP csum for Ipv6) */
if (skb->protocol == htons(ETH_P_IP) && amsdu) {
ip_hdr(skb)->check = 0;
offload_assist |= BIT(TX_CMD_OFFLD_L3_EN);
}
/* reset UDP/TCP header csum */
if (protocol == IPPROTO_TCP)
tcp_hdr(skb)->check = 0;
else
udp_hdr(skb)->check = 0;
out:
#endif
/*
* mac header len should include IV, size is in words unless
* the IV is added by the firmware like in WEP.
* In new Tx API, the IV is always added by the firmware.
*/
if (!iwl_mvm_has_new_tx_api(mvm) && info->control.hw_key &&
info->control.hw_key->cipher != WLAN_CIPHER_SUITE_WEP40 &&
info->control.hw_key->cipher != WLAN_CIPHER_SUITE_WEP104)
mh_len += info->control.hw_key->iv_len;
mh_len /= 2;
offload_assist |= mh_len << TX_CMD_OFFLD_MH_SIZE;
if (amsdu)
offload_assist |= BIT(TX_CMD_OFFLD_AMSDU);
else if (ieee80211_hdrlen(hdr->frame_control) % 4)
/* padding is inserted later in transport */
offload_assist |= BIT(TX_CMD_OFFLD_PAD);
return offload_assist;
}
/*
* Sets most of the Tx cmd's fields
*/
void iwl_mvm_set_tx_cmd(struct iwl_mvm *mvm, struct sk_buff *skb,
struct iwl_tx_cmd_v6_params *tx_cmd_params,
struct ieee80211_tx_info *info, u8 sta_id)
{
struct ieee80211_hdr *hdr = (void *)skb->data;
__le16 fc = hdr->frame_control;
u32 tx_flags = le32_to_cpu(tx_cmd_params->tx_flags);
u32 len = skb->len + FCS_LEN;
bool amsdu = false;
u8 ac;
if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) ||
(ieee80211_is_probe_resp(fc) &&
!is_multicast_ether_addr(hdr->addr1)))
tx_flags |= TX_CMD_FLG_ACK;
else
tx_flags &= ~TX_CMD_FLG_ACK;
Annotation
- Immediate include surface: `linux/ieee80211.h`, `linux/etherdevice.h`, `linux/tcp.h`, `net/gso.h`, `net/ip.h`, `net/ipv6.h`, `iwl-trans.h`, `iwl-nvm-utils.h`.
- Detected declarations: `function Copyright`, `function iwl_mvm_tx_csum`, `function iwl_mvm_set_tx_cmd`, `function iwl_mvm_get_tx_ant`, `function iwl_mvm_convert_rate_idx`, `function iwl_mvm_get_inject_tx_rate`, `function iwl_mvm_get_tx_rate`, `function iwl_mvm_get_tx_rate_n_flags`, `function iwl_mvm_set_tx_cmd_rate`, `function iwl_mvm_set_tx_cmd_pn`.
- 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.