drivers/net/ethernet/renesas/sh_eth.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/renesas/sh_eth.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/renesas/sh_eth.h
Extension
.h
Size
12557 bytes
Lines
568
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 sh_eth_txdesc {
	u32 status;		/* TD0 */
	u32 len;		/* TD1 */
	u32 addr;		/* TD2 */
	u32 pad0;		/* padding data */
} __aligned(2) __packed;

/* Transmit descriptor 0 bits */
enum TD_STS_BIT {
	TD_TACT	= 0x80000000,
	TD_TDLE	= 0x40000000,
	TD_TFP1	= 0x20000000,
	TD_TFP0	= 0x10000000,
	TD_TFE	= 0x08000000,
	TD_TWBI	= 0x04000000,
};
#define TDF1ST	TD_TFP1
#define TDFEND	TD_TFP0
#define TD_TFP	(TD_TFP1 | TD_TFP0)

/* Transmit descriptor 1 bits */
enum TD_LEN_BIT {
	TD_TBL	= 0xffff0000,	/* transmit buffer length */
};

/* The sh ether Rx buffer descriptors.
 * This structure should be 20 bytes.
 */
struct sh_eth_rxdesc {
	u32 status;		/* RD0 */
	u32 len;		/* RD1 */
	u32 addr;		/* RD2 */
	u32 pad0;		/* padding data */
} __aligned(2) __packed;

/* Receive descriptor 0 bits */
enum RD_STS_BIT {
	RD_RACT	= 0x80000000,
	RD_RDLE	= 0x40000000,
	RD_RFP1	= 0x20000000,
	RD_RFP0	= 0x10000000,
	RD_RFE	= 0x08000000,
	RD_RFS10 = 0x00000200,
	RD_RFS9	= 0x00000100,
	RD_RFS8	= 0x00000080,
	RD_RFS7	= 0x00000040,
	RD_RFS6	= 0x00000020,
	RD_RFS5	= 0x00000010,
	RD_RFS4	= 0x00000008,
	RD_RFS3	= 0x00000004,
	RD_RFS2	= 0x00000002,
	RD_RFS1	= 0x00000001,
};
#define RDF1ST	RD_RFP1
#define RDFEND	RD_RFP0
#define RD_RFP	(RD_RFP1 | RD_RFP0)

/* Receive descriptor 1 bits */
enum RD_LEN_BIT {
	RD_RFL	= 0x0000ffff,	/* receive frame  length */
	RD_RBL	= 0xffff0000,	/* receive buffer length */
};

/* This structure is used by each CPU dependency handling. */
struct sh_eth_cpu_data {
	/* mandatory functions */
	int (*soft_reset)(struct net_device *ndev);

	/* optional functions */
	void (*chip_reset)(struct net_device *ndev);
	void (*set_duplex)(struct net_device *ndev);
	void (*set_rate)(struct net_device *ndev);

	/* mandatory initialize value */
	int register_type;
	u32 edtrr_trns;
	u32 eesipr_value;

	/* optional initialize value */
	u32 ecsr_value;
	u32 ecsipr_value;
	u32 fdr_value;
	u32 fcftr_value;

	/* interrupt checking mask */
	u32 tx_check;
	u32 eesr_err_check;

	/* Error mask */
	u32 trscer_err_mask;

Annotation

Implementation Notes