drivers/net/can/peak_canfd/peak_canfd_user.h

Source file repositories/reference/linux-study-clean/drivers/net/can/peak_canfd/peak_canfd_user.h

File Facts

System
Linux kernel
Corpus path
drivers/net/can/peak_canfd/peak_canfd_user.h
Extension
.h
Size
1419 bytes
Lines
47
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 peak_canfd_priv {
	struct can_priv can;		/* socket-can private data */
	struct net_device *ndev;	/* network device */
	int index;			/* channel index */

	struct can_berr_counter bec;	/* rx/tx err counters */

	int echo_idx;			/* echo skb free slot index */
	spinlock_t echo_lock;

	int cmd_len;
	void *cmd_buffer;
	int cmd_maxlen;

	int (*pre_cmd)(struct peak_canfd_priv *priv);
	int (*write_cmd)(struct peak_canfd_priv *priv);
	int (*post_cmd)(struct peak_canfd_priv *priv);

	int (*enable_tx_path)(struct peak_canfd_priv *priv);
	void *(*alloc_tx_msg)(struct peak_canfd_priv *priv, u16 msg_size,
			      int *room_left);
	int (*write_tx_msg)(struct peak_canfd_priv *priv,
			    struct pucan_tx_msg *msg);
};

struct net_device *alloc_peak_canfd_dev(int sizeof_priv, int index,
					int echo_skb_max);
int peak_canfd_handle_msg(struct peak_canfd_priv *priv,
			  struct pucan_rx_msg *msg);
int peak_canfd_handle_msgs_list(struct peak_canfd_priv *priv,
				struct pucan_rx_msg *rx_msg, int rx_count);
#endif

Annotation

Implementation Notes