drivers/net/can/mscan/mscan.h

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

File Facts

System
Linux kernel
Corpus path
drivers/net/can/mscan/mscan.h
Extension
.h
Size
9169 bytes
Lines
293
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 mscan_regs {
	/* (see doc S12MSCANV3/D)		  MPC5200    MSCAN */
	u8 canctl0;				/* + 0x00     0x00 */
	u8 canctl1;				/* + 0x01     0x01 */
	_MSCAN_RESERVED_(1, 2);			/* + 0x02          */
	u8 canbtr0;				/* + 0x04     0x02 */
	u8 canbtr1;				/* + 0x05     0x03 */
	_MSCAN_RESERVED_(2, 2);			/* + 0x06          */
	u8 canrflg;				/* + 0x08     0x04 */
	u8 canrier;				/* + 0x09     0x05 */
	_MSCAN_RESERVED_(3, 2);			/* + 0x0a          */
	u8 cantflg;				/* + 0x0c     0x06 */
	u8 cantier;				/* + 0x0d     0x07 */
	_MSCAN_RESERVED_(4, 2);			/* + 0x0e          */
	u8 cantarq;				/* + 0x10     0x08 */
	u8 cantaak;				/* + 0x11     0x09 */
	_MSCAN_RESERVED_(5, 2);			/* + 0x12          */
	u8 cantbsel;				/* + 0x14     0x0a */
	u8 canidac;				/* + 0x15     0x0b */
	u8 reserved;				/* + 0x16     0x0c */
	_MSCAN_RESERVED_(6, 2);			/* + 0x17          */
	u8 canmisc;				/* + 0x19     0x0d */
	_MSCAN_RESERVED_(7, 2);			/* + 0x1a          */
	u8 canrxerr;				/* + 0x1c     0x0e */
	u8 cantxerr;				/* + 0x1d     0x0f */
	_MSCAN_RESERVED_(8, 2);			/* + 0x1e          */
	u16 canidar1_0;				/* + 0x20     0x10 */
	_MSCAN_RESERVED_(9, 2);			/* + 0x22          */
	u16 canidar3_2;				/* + 0x24     0x12 */
	_MSCAN_RESERVED_(10, 2);		/* + 0x26          */
	u16 canidmr1_0;				/* + 0x28     0x14 */
	_MSCAN_RESERVED_(11, 2);		/* + 0x2a          */
	u16 canidmr3_2;				/* + 0x2c     0x16 */
	_MSCAN_RESERVED_(12, 2);		/* + 0x2e          */
	u16 canidar5_4;				/* + 0x30     0x18 */
	_MSCAN_RESERVED_(13, 2);		/* + 0x32          */
	u16 canidar7_6;				/* + 0x34     0x1a */
	_MSCAN_RESERVED_(14, 2);		/* + 0x36          */
	u16 canidmr5_4;				/* + 0x38     0x1c */
	_MSCAN_RESERVED_(15, 2);		/* + 0x3a          */
	u16 canidmr7_6;				/* + 0x3c     0x1e */
	_MSCAN_RESERVED_(16, 2);		/* + 0x3e          */
	struct {
		u16 idr1_0;			/* + 0x40     0x20 */
		_MSCAN_RESERVED_(17, 2);	/* + 0x42          */
		u16 idr3_2;			/* + 0x44     0x22 */
		_MSCAN_RESERVED_(18, 2);	/* + 0x46          */
		u16 dsr1_0;			/* + 0x48     0x24 */
		_MSCAN_RESERVED_(19, 2);	/* + 0x4a          */
		u16 dsr3_2;			/* + 0x4c     0x26 */
		_MSCAN_RESERVED_(20, 2);	/* + 0x4e          */
		u16 dsr5_4;			/* + 0x50     0x28 */
		_MSCAN_RESERVED_(21, 2);	/* + 0x52          */
		u16 dsr7_6;			/* + 0x54     0x2a */
		_MSCAN_RESERVED_(22, 2);	/* + 0x56          */
		u8 dlr;				/* + 0x58     0x2c */
		u8 reserved;			/* + 0x59     0x2d */
		_MSCAN_RESERVED_(23, 2);	/* + 0x5a          */
		u16 time;			/* + 0x5c     0x2e */
	} rx;
	_MSCAN_RESERVED_(24, 2);		/* + 0x5e          */
	struct {
		u16 idr1_0;			/* + 0x60     0x30 */
		_MSCAN_RESERVED_(25, 2);	/* + 0x62          */
		u16 idr3_2;			/* + 0x64     0x32 */
		_MSCAN_RESERVED_(26, 2);	/* + 0x66          */
		u16 dsr1_0;			/* + 0x68     0x34 */
		_MSCAN_RESERVED_(27, 2);	/* + 0x6a          */
		u16 dsr3_2;			/* + 0x6c     0x36 */
		_MSCAN_RESERVED_(28, 2);	/* + 0x6e          */
		u16 dsr5_4;			/* + 0x70     0x38 */
		_MSCAN_RESERVED_(29, 2);	/* + 0x72          */
		u16 dsr7_6;			/* + 0x74     0x3a */
		_MSCAN_RESERVED_(30, 2);	/* + 0x76          */
		u8 dlr;				/* + 0x78     0x3c */
		u8 tbpr;			/* + 0x79     0x3d */
		_MSCAN_RESERVED_(31, 2);	/* + 0x7a          */
		u16 time;			/* + 0x7c     0x3e */
	} tx;
	_MSCAN_RESERVED_(32, 2);		/* + 0x7e          */
} __packed;

#undef _MSCAN_RESERVED_
#define MSCAN_REGION 	sizeof(struct mscan)

#define MSCAN_NORMAL_MODE	0
#define MSCAN_SLEEP_MODE	MSCAN_SLPRQ
#define MSCAN_INIT_MODE		(MSCAN_INITRQ | MSCAN_SLPRQ)
#define MSCAN_POWEROFF_MODE	(MSCAN_CSWAI | MSCAN_SLPRQ)
#define MSCAN_SET_MODE_RETRIES	255

Annotation

Implementation Notes