drivers/misc/smpro-errmon.c

Source file repositories/reference/linux-study-clean/drivers/misc/smpro-errmon.c

File Facts

System
Linux kernel
Corpus path
drivers/misc/smpro-errmon.c
Extension
.c
Size
16597 bytes
Lines
611
Domain
Driver Families
Bucket
drivers/misc
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 smpro_error_hdr {
	u8 count;	/* Number of the RAS errors */
	u8 len;		/* Number of data bytes */
	u8 data;	/* Start of 48-byte data */
	u8 max_cnt;	/* Max num of errors */
};

/*
 * Included Address of registers to get Count, Length of data and Data
 * of the 48 bytes error data
 */
static struct smpro_error_hdr smpro_error_table[] = {
	[CORE_CE_ERR] = {
		.count = CORE_CE_ERR_CNT,
		.len = CORE_CE_ERR_LEN,
		.data = CORE_CE_ERR_DATA,
		.max_cnt = 32
	},
	[CORE_UE_ERR] = {
		.count = CORE_UE_ERR_CNT,
		.len = CORE_UE_ERR_LEN,
		.data = CORE_UE_ERR_DATA,
		.max_cnt = 32
	},
	[MEM_CE_ERR] = {
		.count = MEM_CE_ERR_CNT,
		.len = MEM_CE_ERR_LEN,
		.data = MEM_CE_ERR_DATA,
		.max_cnt = 16
	},
	[MEM_UE_ERR] = {
		.count = MEM_UE_ERR_CNT,
		.len = MEM_UE_ERR_LEN,
		.data = MEM_UE_ERR_DATA,
		.max_cnt = 16
	},
	[PCIE_CE_ERR] = {
		.count = PCIE_CE_ERR_CNT,
		.len = PCIE_CE_ERR_LEN,
		.data = PCIE_CE_ERR_DATA,
		.max_cnt = 96
	},
	[PCIE_UE_ERR] = {
		.count = PCIE_UE_ERR_CNT,
		.len = PCIE_UE_ERR_LEN,
		.data = PCIE_UE_ERR_DATA,
		.max_cnt = 96
	},
	[OTHER_CE_ERR] = {
		.count = OTHER_CE_ERR_CNT,
		.len = OTHER_CE_ERR_LEN,
		.data = OTHER_CE_ERR_DATA,
		.max_cnt = 8
	},
	[OTHER_UE_ERR] = {
		.count = OTHER_UE_ERR_CNT,
		.len = OTHER_UE_ERR_LEN,
		.data = OTHER_UE_ERR_DATA,
		.max_cnt = 8
	},
};

/*
 * List of SCP registers which are used to get
 * one type of RAS Internal errors.
 */
struct smpro_int_error_hdr {
	u8 type;
	u8 info_l;
	u8 info_h;
	u8 data_l;
	u8 data_h;
	u8 warn_l;
	u8 warn_h;
};

static struct smpro_int_error_hdr list_smpro_int_error_hdr[] = {
	[RAS_SMPRO_ERR] = {
		.type = ERR_SMPRO_TYPE,
		.info_l = ERR_SMPRO_INFO_LO,
		.info_h = ERR_SMPRO_INFO_HI,
		.data_l = ERR_SMPRO_DATA_LO,
		.data_h = ERR_SMPRO_DATA_HI,
		.warn_l = WARN_SMPRO_INFO_LO,
		.warn_h = WARN_SMPRO_INFO_HI,
	},
	[RAS_PMPRO_ERR] = {
		.type = ERR_PMPRO_TYPE,
		.info_l = ERR_PMPRO_INFO_LO,
		.info_h = ERR_PMPRO_INFO_HI,

Annotation

Implementation Notes