drivers/media/usb/as102/as10x_cmd.h

Source file repositories/reference/linux-study-clean/drivers/media/usb/as102/as10x_cmd.h

File Facts

System
Linux kernel
Corpus path
drivers/media/usb/as102/as10x_cmd.h
Extension
.h
Size
11601 bytes
Lines
515
Domain
Driver Families
Bucket
drivers/media
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 as10x_cmd_header_t {
	__le16 req_id;
	__le16 prog;
	__le16 version;
	__le16 data_len;
} __packed;

#define DUMP_BLOCK_SIZE 16

union as10x_dump_memory {
	/* request */
	struct {
		/* request identifier */
		__le16 proc_id;
		/* dump memory type request */
		uint8_t dump_req;
		/* register description */
		struct as10x_register_addr reg_addr;
		/* nb blocks to read */
		__le16 num_blocks;
	} __packed req;
	/* response */
	struct {
		/* response identifier */
		__le16 proc_id;
		/* error */
		uint8_t error;
		/* dump response */
		uint8_t dump_rsp;
		/* data */
		union {
			uint8_t  data8[DUMP_BLOCK_SIZE];
			__le16 data16[DUMP_BLOCK_SIZE / sizeof(__le16)];
			__le32 data32[DUMP_BLOCK_SIZE / sizeof(__le32)];
		} __packed u;
	} __packed rsp;
} __packed;

union as10x_dumplog_memory {
	struct {
		/* request identifier */
		__le16 proc_id;
		/* dump memory type request */
		uint8_t dump_req;
	} __packed req;
	struct {
		/* request identifier */
		__le16 proc_id;
		/* error */
		uint8_t error;
		/* dump response */
		uint8_t dump_rsp;
		/* dump data */
		uint8_t data[DUMP_BLOCK_SIZE];
	} __packed rsp;
} __packed;

union as10x_raw_data {
	/* request */
	struct {
		__le16 proc_id;
		uint8_t data[64 - sizeof(struct as10x_cmd_header_t)
			     - 2 /* proc_id */];
	} __packed req;
	/* response */
	struct {
		__le16 proc_id;
		uint8_t error;
		uint8_t data[64 - sizeof(struct as10x_cmd_header_t)
			     - 2 /* proc_id */ - 1 /* rc */];
	} __packed rsp;
} __packed;

struct as10x_cmd_t {
	struct as10x_cmd_header_t header;
	union {
		union as10x_turn_on		turn_on;
		union as10x_turn_off		turn_off;
		union as10x_set_tune		set_tune;
		union as10x_get_tune_status	get_tune_status;
		union as10x_get_tps		get_tps;
		union as10x_common		common;
		union as10x_add_pid_filter	add_pid_filter;
		union as10x_del_pid_filter	del_pid_filter;
		union as10x_start_streaming	start_streaming;
		union as10x_stop_streaming	stop_streaming;
		union as10x_get_demod_stats	get_demod_stats;
		union as10x_get_impulse_resp	get_impulse_rsp;
		union as10x_fw_context		context;
		union as10x_set_register	set_register;

Annotation

Implementation Notes