drivers/net/wireless/ath/ath11k/hif.h

Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath11k/hif.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/ath/ath11k/hif.h
Extension
.h
Size
4261 bytes
Lines
163
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ath11k_hif_ops {
	u32 (*read32)(struct ath11k_base *ab, u32 address);
	void (*write32)(struct ath11k_base *ab, u32 address, u32 data);
	int (*read)(struct ath11k_base *ab, void *buf, u32 start, u32 end);
	void (*irq_enable)(struct ath11k_base *ab);
	void (*irq_disable)(struct ath11k_base *ab);
	int (*start)(struct ath11k_base *ab);
	void (*stop)(struct ath11k_base *ab);
	int (*power_up)(struct ath11k_base *ab);
	void (*power_down)(struct ath11k_base *ab, bool is_suspend);
	int (*suspend)(struct ath11k_base *ab);
	int (*resume)(struct ath11k_base *ab);
	int (*map_service_to_pipe)(struct ath11k_base *ab, u16 service_id,
				   u8 *ul_pipe, u8 *dl_pipe);
	int (*get_user_msi_vector)(struct ath11k_base *ab, char *user_name,
				   int *num_vectors, u32 *user_base_data,
				   u32 *base_vector);
	void (*get_msi_address)(struct ath11k_base *ab, u32 *msi_addr_lo,
				u32 *msi_addr_hi);
	void (*ce_irq_enable)(struct ath11k_base *ab);
	void (*ce_irq_disable)(struct ath11k_base *ab);
	void (*get_ce_msi_idx)(struct ath11k_base *ab, u32 ce_id, u32 *msi_idx);
	void (*coredump_download)(struct ath11k_base *ab);
};

static inline void ath11k_hif_ce_irq_enable(struct ath11k_base *ab)
{
	if (ab->hif.ops->ce_irq_enable)
		ab->hif.ops->ce_irq_enable(ab);
}

static inline void ath11k_hif_ce_irq_disable(struct ath11k_base *ab)
{
	if (ab->hif.ops->ce_irq_disable)
		ab->hif.ops->ce_irq_disable(ab);
}

static inline int ath11k_hif_start(struct ath11k_base *ab)
{
	return ab->hif.ops->start(ab);
}

static inline void ath11k_hif_stop(struct ath11k_base *ab)
{
	ab->hif.ops->stop(ab);
}

static inline void ath11k_hif_irq_enable(struct ath11k_base *ab)
{
	ab->hif.ops->irq_enable(ab);
}

static inline void ath11k_hif_irq_disable(struct ath11k_base *ab)
{
	ab->hif.ops->irq_disable(ab);
}

static inline int ath11k_hif_power_up(struct ath11k_base *ab)
{
	if (!ab->hif.ops->power_up)
		return -EOPNOTSUPP;

	return ab->hif.ops->power_up(ab);
}

static inline void ath11k_hif_power_down(struct ath11k_base *ab, bool is_suspend)
{
	if (!ab->hif.ops->power_down)
		return;

	ab->hif.ops->power_down(ab, is_suspend);
}

static inline int ath11k_hif_suspend(struct ath11k_base *ab)
{
	if (ab->hif.ops->suspend)
		return ab->hif.ops->suspend(ab);

	return 0;
}

static inline int ath11k_hif_resume(struct ath11k_base *ab)
{
	if (ab->hif.ops->resume)
		return ab->hif.ops->resume(ab);

	return 0;
}

static inline u32 ath11k_hif_read32(struct ath11k_base *ab, u32 address)

Annotation

Implementation Notes