include/uapi/linux/papr_pdsm.h

Source file repositories/reference/linux-study-clean/include/uapi/linux/papr_pdsm.h

File Facts

System
Linux kernel
Corpus path
include/uapi/linux/papr_pdsm.h
Extension
.h
Size
5726 bytes
Lines
166
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct nd_papr_pdsm_health {
	union {
		struct {
			__u32 extension_flags;
			__u8 dimm_unarmed;
			__u8 dimm_bad_shutdown;
			__u8 dimm_bad_restore;
			__u8 dimm_scrubbed;
			__u8 dimm_locked;
			__u8 dimm_encrypted;
			__u16 dimm_health;

			/* Extension flag PDSM_DIMM_HEALTH_RUN_GAUGE_VALID */
			__u16 dimm_fuel_gauge;

			/* Extension flag PDSM_DIMM_DSC_VALID */
			__u64 dimm_dsc;
		};
		__u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
	};
};

/* Flags for injecting specific smart errors */
#define PDSM_SMART_INJECT_HEALTH_FATAL		(1 << 0)
#define PDSM_SMART_INJECT_BAD_SHUTDOWN		(1 << 1)

struct nd_papr_pdsm_smart_inject {
	union {
		struct {
			/* One or more of PDSM_SMART_INJECT_ */
			__u32 flags;
			__u8 fatal_enable;
			__u8 unsafe_shutdown_enable;
		};
		__u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
	};
};

/*
 * Methods to be embedded in ND_CMD_CALL request. These are sent to the kernel
 * via 'nd_cmd_pkg.nd_command' member of the ioctl struct
 */
enum papr_pdsm {
	PAPR_PDSM_MIN = 0x0,
	PAPR_PDSM_HEALTH,
	PAPR_PDSM_SMART_INJECT,
	PAPR_PDSM_MAX,
};

/* Maximal union that can hold all possible payload types */
union nd_pdsm_payload {
	struct nd_papr_pdsm_health health;
	struct nd_papr_pdsm_smart_inject smart_inject;
	__u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
} __packed;

/*
 * PDSM-header + payload expected with ND_CMD_CALL ioctl from libnvdimm
 * Valid member of union 'payload' is identified via 'nd_cmd_pkg.nd_command'
 * that should always precede this struct when sent to papr_scm via CMD_CALL
 * interface.
 */
struct nd_pkg_pdsm {
	__s32 cmd_status;	/* Out: Sub-cmd status returned back */
	__u16 reserved[2];	/* Ignored and to be set as '0' */
	union nd_pdsm_payload payload;
} __packed;

#endif /* _UAPI_ASM_POWERPC_PAPR_PDSM_H_ */

Annotation

Implementation Notes