drivers/net/wireless/ath/ath6kl/hif.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath6kl/hif.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath6kl/hif.c- Extension
.c- Size
- 18954 bytes
- Lines
- 700
- 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
hif.hlinux/export.hcore.htarget.hhif-ops.hdebug.htrace.h
Detected Declarations
function Copyrightfunction ath6kl_hif_rw_comp_handlerfunction ath6kl_hif_dump_fw_crashfunction ath6kl_hif_proc_dbg_intrfunction ath6kl_hif_poll_mboxmsg_rxfunction receptionfunction ath6kl_hif_submit_scat_reqfunction ath6kl_hif_proc_counter_intrfunction ath6kl_hif_proc_err_intrfunction ath6kl_hif_proc_cpu_intrfunction proc_pending_irqsfunction ath6kl_hif_intr_bh_handlerfunction ath6kl_hif_enable_intrsfunction ath6kl_hif_disable_intrsfunction ath6kl_hif_unmask_intrsfunction ath6kl_hif_mask_intrsfunction ath6kl_hif_setupexport ath6kl_hif_rw_comp_handlerexport ath6kl_hif_intr_bh_handler
Annotated Snippet
if (status) {
ath6kl_err("failed to read reg table\n");
return status;
}
/* check for MBOX data and valid lookahead */
if (dev->irq_proc_reg.host_int_status & htc_mbox) {
if (dev->irq_proc_reg.rx_lkahd_valid &
htc_mbox) {
/*
* Mailbox has a message and the look ahead
* is valid.
*/
rg = &dev->irq_proc_reg;
*lk_ahd =
le32_to_cpu(rg->rx_lkahd[HTC_MAILBOX]);
break;
}
}
/* delay a little */
mdelay(ATH6KL_TIME_QUANTUM);
ath6kl_dbg(ATH6KL_DBG_HIF, "hif retry mbox poll try %d\n", i);
}
if (i == 0) {
ath6kl_err("timeout waiting for recv message\n");
status = -ETIME;
/* check if the target asserted */
if (dev->irq_proc_reg.counter_int_status &
ATH6KL_TARGET_DEBUG_INTR_MASK)
/*
* Target failure handler will be called in case of
* an assert.
*/
ath6kl_hif_proc_dbg_intr(dev);
}
return status;
}
/*
* Disable packet reception (used in case the host runs out of buffers)
* using the interrupt enable registers through the host I/F
*/
int ath6kl_hif_rx_control(struct ath6kl_device *dev, bool enable_rx)
{
struct ath6kl_irq_enable_reg regs;
int status = 0;
ath6kl_dbg(ATH6KL_DBG_HIF, "hif rx %s\n",
enable_rx ? "enable" : "disable");
/* take the lock to protect interrupt enable shadows */
spin_lock_bh(&dev->lock);
if (enable_rx)
dev->irq_en_reg.int_status_en |=
SM(INT_STATUS_ENABLE_MBOX_DATA, 0x01);
else
dev->irq_en_reg.int_status_en &=
~SM(INT_STATUS_ENABLE_MBOX_DATA, 0x01);
memcpy(®s, &dev->irq_en_reg, sizeof(regs));
spin_unlock_bh(&dev->lock);
status = hif_read_write_sync(dev->ar, INT_STATUS_ENABLE_ADDRESS,
®s.int_status_en,
sizeof(struct ath6kl_irq_enable_reg),
HIF_WR_SYNC_BYTE_INC);
return status;
}
int ath6kl_hif_submit_scat_req(struct ath6kl_device *dev,
struct hif_scatter_req *scat_req, bool read)
{
int status = 0;
if (read) {
scat_req->req = HIF_RD_SYNC_BLOCK_FIX;
scat_req->addr = dev->ar->mbox_info.htc_addr;
} else {
scat_req->req = HIF_WR_ASYNC_BLOCK_INC;
scat_req->addr =
(scat_req->len > HIF_MBOX_WIDTH) ?
dev->ar->mbox_info.htc_ext_addr :
dev->ar->mbox_info.htc_addr;
Annotation
- Immediate include surface: `hif.h`, `linux/export.h`, `core.h`, `target.h`, `hif-ops.h`, `debug.h`, `trace.h`.
- Detected declarations: `function Copyright`, `function ath6kl_hif_rw_comp_handler`, `function ath6kl_hif_dump_fw_crash`, `function ath6kl_hif_proc_dbg_intr`, `function ath6kl_hif_poll_mboxmsg_rx`, `function reception`, `function ath6kl_hif_submit_scat_req`, `function ath6kl_hif_proc_counter_intr`, `function ath6kl_hif_proc_err_intr`, `function ath6kl_hif_proc_cpu_intr`.
- 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.