drivers/net/wireless/ath/ath12k/hif.h
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath12k/hif.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath12k/hif.h- Extension
.h- Size
- 4281 bytes
- Lines
- 166
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
core.h
Detected Declarations
struct ath12k_hif_opsfunction ath12k_hif_map_service_to_pipefunction ath12k_hif_get_user_msi_vectorfunction ath12k_hif_get_msi_addressfunction ath12k_hif_get_ce_msi_idxfunction ath12k_hif_ce_irq_enablefunction ath12k_hif_ce_irq_disablefunction ath12k_hif_irq_enablefunction ath12k_hif_irq_disablefunction ath12k_hif_suspendfunction ath12k_hif_resumefunction ath12k_hif_startfunction ath12k_hif_stopfunction ath12k_hif_read32function ath12k_hif_write32function ath12k_hif_power_upfunction ath12k_hif_power_downfunction ath12k_hif_panic_handlerfunction ath12k_hif_coredump_download
Annotated Snippet
struct ath12k_hif_ops {
u32 (*read32)(struct ath12k_base *ab, u32 address);
void (*write32)(struct ath12k_base *ab, u32 address, u32 data);
void (*irq_enable)(struct ath12k_base *ab);
void (*irq_disable)(struct ath12k_base *ab);
int (*start)(struct ath12k_base *ab);
void (*stop)(struct ath12k_base *ab);
int (*power_up)(struct ath12k_base *ab);
void (*power_down)(struct ath12k_base *ab, bool is_suspend);
int (*suspend)(struct ath12k_base *ab);
int (*resume)(struct ath12k_base *ab);
int (*map_service_to_pipe)(struct ath12k_base *ab, u16 service_id,
u8 *ul_pipe, u8 *dl_pipe);
int (*get_user_msi_vector)(struct ath12k_base *ab, char *user_name,
int *num_vectors, u32 *user_base_data,
u32 *base_vector);
void (*get_msi_address)(struct ath12k_base *ab, u32 *msi_addr_lo,
u32 *msi_addr_hi);
void (*ce_irq_enable)(struct ath12k_base *ab);
void (*ce_irq_disable)(struct ath12k_base *ab);
void (*get_ce_msi_idx)(struct ath12k_base *ab, u32 ce_id, u32 *msi_idx);
int (*panic_handler)(struct ath12k_base *ab);
void (*coredump_download)(struct ath12k_base *ab);
};
static inline int ath12k_hif_map_service_to_pipe(struct ath12k_base *ab, u16 service_id,
u8 *ul_pipe, u8 *dl_pipe)
{
return ab->hif.ops->map_service_to_pipe(ab, service_id,
ul_pipe, dl_pipe);
}
static inline int ath12k_hif_get_user_msi_vector(struct ath12k_base *ab,
char *user_name,
int *num_vectors,
u32 *user_base_data,
u32 *base_vector)
{
if (!ab->hif.ops->get_user_msi_vector)
return -EOPNOTSUPP;
return ab->hif.ops->get_user_msi_vector(ab, user_name, num_vectors,
user_base_data,
base_vector);
}
static inline void ath12k_hif_get_msi_address(struct ath12k_base *ab,
u32 *msi_addr_lo,
u32 *msi_addr_hi)
{
if (!ab->hif.ops->get_msi_address)
return;
ab->hif.ops->get_msi_address(ab, msi_addr_lo, msi_addr_hi);
}
static inline void ath12k_hif_get_ce_msi_idx(struct ath12k_base *ab, u32 ce_id,
u32 *msi_data_idx)
{
if (ab->hif.ops->get_ce_msi_idx)
ab->hif.ops->get_ce_msi_idx(ab, ce_id, msi_data_idx);
else
*msi_data_idx = ce_id;
}
static inline void ath12k_hif_ce_irq_enable(struct ath12k_base *ab)
{
if (ab->hif.ops->ce_irq_enable)
ab->hif.ops->ce_irq_enable(ab);
}
static inline void ath12k_hif_ce_irq_disable(struct ath12k_base *ab)
{
if (ab->hif.ops->ce_irq_disable)
ab->hif.ops->ce_irq_disable(ab);
}
static inline void ath12k_hif_irq_enable(struct ath12k_base *ab)
{
ab->hif.ops->irq_enable(ab);
}
static inline void ath12k_hif_irq_disable(struct ath12k_base *ab)
{
ab->hif.ops->irq_disable(ab);
}
static inline int ath12k_hif_suspend(struct ath12k_base *ab)
{
if (ab->hif.ops->suspend)
Annotation
- Immediate include surface: `core.h`.
- Detected declarations: `struct ath12k_hif_ops`, `function ath12k_hif_map_service_to_pipe`, `function ath12k_hif_get_user_msi_vector`, `function ath12k_hif_get_msi_address`, `function ath12k_hif_get_ce_msi_idx`, `function ath12k_hif_ce_irq_enable`, `function ath12k_hif_ce_irq_disable`, `function ath12k_hif_irq_enable`, `function ath12k_hif_irq_disable`, `function ath12k_hif_suspend`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
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.