drivers/net/wireless/ath/ath9k/htc_hst.h

Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/htc_hst.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/ath/ath9k/htc_hst.h
Extension
.h
Size
5947 bytes
Lines
231
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 ath9k_htc_hif {
	struct list_head list;
	const enum ath9k_hif_transports transport;
	const char *name;

	u8 control_dl_pipe;
	u8 control_ul_pipe;

	void (*start) (void *hif_handle);
	void (*stop) (void *hif_handle);
	void (*sta_drain) (void *hif_handle, u8 idx);
	int (*send) (void *hif_handle, u8 pipe, struct sk_buff *buf);
};

enum htc_endpoint_id {
	ENDPOINT_UNUSED = -1,
	ENDPOINT0 = 0,
	ENDPOINT1 = 1,
	ENDPOINT2 = 2,
	ENDPOINT3 = 3,
	ENDPOINT4 = 4,
	ENDPOINT5 = 5,
	ENDPOINT6 = 6,
	ENDPOINT7 = 7,
	ENDPOINT8 = 8,
	ENDPOINT_MAX = 22
};

/* Htc frame hdr flags */
#define HTC_FLAGS_RECV_TRAILER (1 << 1)

struct htc_frame_hdr {
	u8 endpoint_id;
	u8 flags;
	__be16 payload_len;
	u8 control[4];
} __packed;

struct htc_ready_msg {
	__be16 message_id;
	__be16 credits;
	__be16 credit_size;
	u8 max_endpoints;
	u8 pad;
} __packed;

struct htc_config_pipe_msg {
	__be16 message_id;
	u8 pipe_id;
	u8 credits;
} __packed;

struct htc_panic_bad_vaddr {
	__be32 pattern;
	__be32 exccause;
	__be32 pc;
	__be32 badvaddr;
} __packed;

struct htc_panic_bad_epid {
	__be32 pattern;
	__be32 epid;
} __packed;

struct htc_ep_callbacks {
	void *priv;
	void (*tx) (void *, struct sk_buff *, enum htc_endpoint_id, bool txok);
	void (*rx) (void *, struct sk_buff *, enum htc_endpoint_id);
};

struct htc_endpoint {
	u16 service_id;

	struct htc_ep_callbacks ep_callbacks;
	u32 max_txqdepth;
	int max_msglen;

	u8 ul_pipeid;
	u8 dl_pipeid;
};

#define HTC_MAX_CONTROL_MESSAGE_LENGTH 255
#define HTC_CONTROL_BUFFER_SIZE	\
	(HTC_MAX_CONTROL_MESSAGE_LENGTH + sizeof(struct htc_frame_hdr))

#define HTC_OP_START_WAIT           BIT(0)
#define HTC_OP_CONFIG_PIPE_CREDITS  BIT(1)

struct htc_target {
	void *hif_dev;

Annotation

Implementation Notes