drivers/net/wireless/marvell/mwifiex/txrx.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/marvell/mwifiex/txrx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/marvell/mwifiex/txrx.c- Extension
.c- Size
- 10170 bytes
- Lines
- 375
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
decl.hioctl.hutil.hfw.hmain.hwmm.h
Detected Declarations
function mwifiex_handle_rx_packetfunction mwifiex_process_txfunction mwifiex_host_to_cardfunction mwifiex_dequeue_tx_queuefunction mwifiex_process_tx_queuefunction mwifiex_write_data_completefunction mwifiex_parse_tx_status_eventexport mwifiex_handle_rx_packetexport mwifiex_write_data_complete
Annotated Snippet
skb_headroom(skb) < MWIFIEX_MIN_DATA_HEADER_LEN)) {
ret = -EINVAL;
goto out;
}
hroom = adapter->intf_hdr_len;
if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP) {
dest_node = mwifiex_get_sta_entry(priv, hdr->h_dest);
if (dest_node) {
dest_node->stats.tx_bytes += skb->len;
dest_node->stats.tx_packets++;
}
mwifiex_process_uap_txpd(priv, skb);
} else {
mwifiex_process_sta_txpd(priv, skb);
}
if (adapter->data_sent || adapter->tx_lock_flag) {
skb_queue_tail(&adapter->tx_data_q, skb);
atomic_inc(&adapter->tx_queued);
return 0;
}
if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA)
local_tx_pd = (struct txpd *)(skb->data + hroom);
if (adapter->iface_type == MWIFIEX_USB) {
ret = adapter->if_ops.host_to_card(adapter,
priv->usb_port,
skb, tx_param);
} else {
ret = adapter->if_ops.host_to_card(adapter,
MWIFIEX_TYPE_DATA,
skb, tx_param);
}
mwifiex_dbg_dump(adapter, DAT_D, "tx pkt:", skb->data,
min_t(size_t, skb->len, DEBUG_DUMP_DATA_MAX_LEN));
out:
switch (ret) {
case -ENOSR:
mwifiex_dbg(adapter, DATA, "data: -ENOSR is returned\n");
break;
case -EBUSY:
if ((GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) &&
(adapter->pps_uapsd_mode) && (adapter->tx_lock_flag)) {
priv->adapter->tx_lock_flag = false;
if (local_tx_pd)
local_tx_pd->flags = 0;
}
mwifiex_dbg(adapter, ERROR, "data: -EBUSY is returned\n");
break;
case -1:
mwifiex_dbg(adapter, ERROR,
"mwifiex_write_data_async failed: 0x%X\n",
ret);
adapter->dbg.num_tx_host_to_card_failure++;
mwifiex_write_data_complete(adapter, skb, 0, ret);
break;
case -EINPROGRESS:
break;
case -EINVAL:
mwifiex_dbg(adapter, ERROR,
"malformed skb (length: %u, headroom: %u)\n",
skb->len, skb_headroom(skb));
fallthrough;
case 0:
mwifiex_write_data_complete(adapter, skb, 0, ret);
break;
default:
break;
}
return ret;
}
static int mwifiex_host_to_card(struct mwifiex_adapter *adapter,
struct sk_buff *skb,
struct mwifiex_tx_param *tx_param)
{
struct txpd *local_tx_pd = NULL;
u8 *head_ptr = skb->data;
int ret = 0;
struct mwifiex_private *priv;
struct mwifiex_txinfo *tx_info;
tx_info = MWIFIEX_SKB_TXCB(skb);
priv = mwifiex_get_priv_by_id(adapter, tx_info->bss_num,
tx_info->bss_type);
if (!priv) {
Annotation
- Immediate include surface: `decl.h`, `ioctl.h`, `util.h`, `fw.h`, `main.h`, `wmm.h`.
- Detected declarations: `function mwifiex_handle_rx_packet`, `function mwifiex_process_tx`, `function mwifiex_host_to_card`, `function mwifiex_dequeue_tx_queue`, `function mwifiex_process_tx_queue`, `function mwifiex_write_data_complete`, `function mwifiex_parse_tx_status_event`, `export mwifiex_handle_rx_packet`, `export mwifiex_write_data_complete`.
- Atlas domain: Driver Families / drivers/net.
- 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.