drivers/net/wireless/ath/ath10k/sdio.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath10k/sdio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath10k/sdio.c- Extension
.c- Size
- 68143 bytes
- Lines
- 2685
- 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.
- 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/module.hlinux/mmc/card.hlinux/mmc/mmc.hlinux/mmc/host.hlinux/mmc/sdio_func.hlinux/mmc/sdio_ids.hlinux/mmc/sdio.hlinux/mmc/sd.hlinux/bitfield.hcore.hbmi.hdebug.hhif.hhtc.hmac.htargaddrs.htrace.hsdio.hcoredump.h
Detected Declarations
function ath10k_sdio_calc_txrx_padded_lenfunction pipe_id_to_eidfunction ath10k_sdio_mbox_free_rx_pktfunction ath10k_sdio_mbox_alloc_rx_pktfunction is_trailer_only_msgfunction ath10k_sdio_set_cmd52_argfunction ath10k_sdio_func0_cmd52_wr_bytefunction ath10k_sdio_func0_cmd52_rd_bytefunction ath10k_sdio_configfunction ath10k_sdio_write32function ath10k_sdio_writesb32function ath10k_sdio_read32function ath10k_sdio_readfunction ath10k_sdio_writefunction ath10k_sdio_readsbfunction ath10k_sdio_mbox_rx_process_packetfunction ath10k_sdio_mbox_rx_process_packetsfunction ath10k_sdio_mbox_alloc_bundlefunction ath10k_sdio_mbox_rx_allocfunction ath10k_sdio_mbox_rx_fetchfunction ath10k_sdio_mbox_rx_fetch_bundlefunction ath10k_sdio_mbox_rxmsg_pending_handlerfunction ath10k_sdio_mbox_proc_dbg_intrfunction ath10k_sdio_mbox_proc_counter_intrfunction ath10k_sdio_mbox_proc_err_intrfunction ath10k_sdio_mbox_proc_cpu_intrfunction ath10k_sdio_mbox_read_int_statusfunction ath10k_sdio_mbox_proc_pending_irqsfunction ath10k_sdio_set_mbox_infofunction ath10k_sdio_bmi_creditsfunction ath10k_sdio_bmi_get_rx_lookaheadfunction ath10k_sdio_bmi_exchange_msgfunction ath10k_sdio_free_bus_reqfunction __ath10k_sdio_write_asyncfunction ath10k_rx_indication_async_workfunction ath10k_sdio_read_rtc_statefunction ath10k_sdio_set_mbox_sleepfunction ath10k_sdio_sleep_timer_handlerfunction ath10k_sdio_write_async_workfunction list_for_each_entry_safefunction ath10k_sdio_prep_async_reqfunction ath10k_sdio_irq_handlerfunction ath10k_sdio_disable_intrsfunction ath10k_sdio_hif_power_upfunction ath10k_sdio_hif_power_downfunction ath10k_sdio_hif_tx_sgfunction ath10k_sdio_enable_intrsfunction ath10k_sdio_hif_diag_read
Annotated Snippet
if (id >= ATH10K_HTC_EP_COUNT) {
ath10k_warn(ar, "invalid endpoint in look-ahead: %d\n",
id);
ret = -ENOMEM;
goto out;
}
ep = &htc->endpoint[id];
if (ep->service_id == 0) {
ath10k_warn(ar, "ep %d is not connected\n", id);
ret = -ENOMEM;
goto out;
}
pkt = &ar_sdio->rx_pkts[i];
if (pkt->part_of_bundle && !pkt->last_in_bundle) {
/* Only read lookahead's from RX trailers
* for the last packet in a bundle.
*/
lookahead_idx--;
lookaheads_local = NULL;
n_lookahead_local = NULL;
}
ret = ath10k_sdio_mbox_rx_process_packet(ar,
pkt,
lookaheads_local,
n_lookahead_local);
if (ret)
goto out;
if (!pkt->trailer_only) {
cb = ATH10K_SKB_RXCB(pkt->skb);
cb->eid = id;
skb_queue_tail(&ar_sdio->rx_head, pkt->skb);
queue_work(ar->workqueue_aux,
&ar_sdio->async_work_rx);
} else {
kfree_skb(pkt->skb);
}
/* The RX complete handler now owns the skb...*/
pkt->skb = NULL;
pkt->alloc_len = 0;
}
ret = 0;
out:
/* Free all packets that was not passed on to the RX completion
* handler...
*/
for (; i < ar_sdio->n_rx_pkts; i++)
ath10k_sdio_mbox_free_rx_pkt(&ar_sdio->rx_pkts[i]);
return ret;
}
static int ath10k_sdio_mbox_alloc_bundle(struct ath10k *ar,
struct ath10k_sdio_rx_data *rx_pkts,
struct ath10k_htc_hdr *htc_hdr,
size_t full_len, size_t act_len,
size_t *bndl_cnt)
{
int ret, i;
u8 max_msgs = ar->htc.max_msgs_per_htc_bundle;
*bndl_cnt = ath10k_htc_get_bundle_count(max_msgs, htc_hdr->flags);
if (*bndl_cnt > max_msgs) {
ath10k_warn(ar,
"HTC bundle length %u exceeds maximum %u\n",
le16_to_cpu(htc_hdr->len),
max_msgs);
return -ENOMEM;
}
/* Allocate bndl_cnt extra skb's for the bundle.
* The package containing the
* ATH10K_HTC_FLAG_BUNDLE_MASK flag is not included
* in bndl_cnt. The skb for that packet will be
* allocated separately.
*/
for (i = 0; i < *bndl_cnt; i++) {
ret = ath10k_sdio_mbox_alloc_rx_pkt(&rx_pkts[i],
act_len,
full_len,
Annotation
- Immediate include surface: `linux/module.h`, `linux/mmc/card.h`, `linux/mmc/mmc.h`, `linux/mmc/host.h`, `linux/mmc/sdio_func.h`, `linux/mmc/sdio_ids.h`, `linux/mmc/sdio.h`, `linux/mmc/sd.h`.
- Detected declarations: `function ath10k_sdio_calc_txrx_padded_len`, `function pipe_id_to_eid`, `function ath10k_sdio_mbox_free_rx_pkt`, `function ath10k_sdio_mbox_alloc_rx_pkt`, `function is_trailer_only_msg`, `function ath10k_sdio_set_cmd52_arg`, `function ath10k_sdio_func0_cmd52_wr_byte`, `function ath10k_sdio_func0_cmd52_rd_byte`, `function ath10k_sdio_config`, `function ath10k_sdio_write32`.
- 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.