drivers/net/can/usb/etas_es58x/es581_4.h

Source file repositories/reference/linux-study-clean/drivers/net/can/usb/etas_es58x/es581_4.h

File Facts

System
Linux kernel
Corpus path
drivers/net/can/usb/etas_es58x/es581_4.h
Extension
.h
Size
5900 bytes
Lines
208
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 es581_4_tx_conf_msg {
	__le32 bitrate;
	__le32 sample_point;
	__le32 samples_per_bit;
	__le32 bit_time;
	__le32 sjw;
	__le32 sync_edge;
	__le32 physical_layer;
	__le32 echo_mode;
	u8 channel_no;
} __packed;

struct es581_4_tx_can_msg {
	__le32 can_id;
	__le32 packet_idx;
	__le16 flags;
	u8 channel_no;
	u8 dlc;
	u8 data[CAN_MAX_DLEN];
} __packed;

/* The ES581.4 allows bulk transfer.  */
struct es581_4_bulk_tx_can_msg {
	u8 num_can_msg;
	/* Using type "u8[]" instead of "struct es581_4_tx_can_msg[]"
	 * for tx_msg_buf because each member has a flexible size.
	 */
	u8 tx_can_msg_buf[ES581_4_TX_BULK_MAX *
			  sizeof(struct es581_4_tx_can_msg)];
} __packed;

struct es581_4_echo_msg {
	__le64 timestamp;
	__le32 packet_idx;
} __packed;

struct es581_4_bulk_echo_msg {
	u8 channel_no;
	struct es581_4_echo_msg echo_msg[ES581_4_ECHO_BULK_MAX];
} __packed;

/* Normal Rx CAN Message */
struct es581_4_rx_can_msg {
	__le64 timestamp;
	u8 rx_type;		/* type enum es581_4_rx_type */
	u8 flags;		/* type enum es58x_flag */
	u8 channel_no;
	u8 dlc;
	__le32 can_id;
	u8 data[CAN_MAX_DLEN];
} __packed;

struct es581_4_rx_err_msg {
	__le64 timestamp;
	__le16 rx_type;		/* type enum es581_4_rx_type */
	__le16 flags;		/* type enum es58x_flag */
	u8 channel_no;
	u8 __padding[2];
	u8 dlc;
	__le32 tag;		/* Related to the CAN filtering. Unused in this module */
	__le32 can_id;
	__le32 error;		/* type enum es58x_error */
	__le32 destination;	/* Unused in this module */
} __packed;

struct es581_4_rx_event_msg {
	__le64 timestamp;
	__le16 rx_type;		/* type enum es581_4_rx_type */
	u8 channel_no;
	u8 __padding;
	__le32 tag;		/* Related to the CAN filtering. Unused in this module */
	__le32 event;		/* type enum es58x_event */
	__le32 destination;	/* Unused in this module */
} __packed;

struct es581_4_tx_ack_msg {
	__le16 tx_free_entries;	/* Number of remaining free entries in the device TX queue */
	u8 channel_no;
	u8 rx_cmd_ret_u8;	/* type enum es58x_cmd_ret_code_u8 */
} __packed;

struct es581_4_rx_cmd_ret {
	__le32 rx_cmd_ret_le32;
	u8 channel_no;
	u8 __padding[3];
} __packed;

/**
 * struct es581_4_urb_cmd - Commands received from or sent to the
 *	ES581.4 device.

Annotation

Implementation Notes