include/linux/scmi_protocol.h
Source file repositories/reference/linux-study-clean/include/linux/scmi_protocol.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/scmi_protocol.h- Extension
.h- Size
- 40135 bytes
- Lines
- 1119
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/device.hlinux/notifier.hlinux/types.h
Detected Declarations
struct scmi_base_infostruct scmi_clock_ratesstruct scmi_clock_infostruct scmi_handlestruct scmi_devicestruct scmi_protocol_handlestruct scmi_clk_proto_opsstruct scmi_perf_domain_infostruct scmi_perf_proto_opsstruct scmi_power_proto_opsstruct scmi_sensor_readingstruct scmi_range_attrsstruct scmi_sensor_axis_infostruct scmi_sensor_intervals_infostruct scmi_sensor_infostruct scmi_sensor_proto_opsstruct scmi_reset_proto_opsstruct scmi_voltage_infostruct scmi_voltage_proto_opsstruct scmi_powercap_infostruct scmi_powercap_proto_opsstruct scmi_pinctrl_proto_opsstruct scmi_notify_opsstruct scmi_handlestruct scmi_devicestruct scmi_device_idstruct scmi_driverstruct scmi_protocolstruct scmi_power_state_changed_reportstruct scmi_clock_rate_notif_reportstruct scmi_system_power_state_notifier_reportstruct scmi_perf_limits_reportstruct scmi_perf_level_reportstruct scmi_sensor_trip_point_reportstruct scmi_sensor_update_reportstruct scmi_reset_issued_reportstruct scmi_base_error_reportstruct scmi_powercap_cap_changed_reportstruct scmi_powercap_meas_changed_reportenum scmi_power_scaleenum scmi_clock_oem_configenum scmi_sensor_classenum scmi_voltage_level_modeenum scmi_pinctrl_selector_typeenum scmi_pinctrl_conf_typeenum scmi_std_protocolenum scmi_system_eventsenum scmi_notification_events
Annotated Snippet
struct device_driver driver;
};
#define to_scmi_driver(d) container_of(d, struct scmi_driver, driver)
#if IS_REACHABLE(CONFIG_ARM_SCMI_PROTOCOL)
int scmi_driver_register(struct scmi_driver *driver,
struct module *owner, const char *mod_name);
void scmi_driver_unregister(struct scmi_driver *driver);
#else
static inline int
scmi_driver_register(struct scmi_driver *driver, struct module *owner,
const char *mod_name)
{
return -EINVAL;
}
static inline void scmi_driver_unregister(struct scmi_driver *driver) {}
#endif /* CONFIG_ARM_SCMI_PROTOCOL */
#define scmi_register(driver) \
scmi_driver_register(driver, THIS_MODULE, KBUILD_MODNAME)
#define scmi_unregister(driver) \
scmi_driver_unregister(driver)
/**
* module_scmi_driver() - Helper macro for registering a scmi driver
* @__scmi_driver: scmi_driver structure
*
* Helper macro for scmi drivers to set up proper module init / exit
* functions. Replaces module_init() and module_exit() and keeps people from
* printing pointless things to the kernel log when their driver is loaded.
*/
#define module_scmi_driver(__scmi_driver) \
module_driver(__scmi_driver, scmi_register, scmi_unregister)
/**
* module_scmi_protocol() - Helper macro for registering a scmi protocol
* @__scmi_protocol: scmi_protocol structure
*
* Helper macro for scmi drivers to set up proper module init / exit
* functions. Replaces module_init() and module_exit() and keeps people from
* printing pointless things to the kernel log when their driver is loaded.
*/
#define module_scmi_protocol(__scmi_protocol) \
module_driver(__scmi_protocol, \
scmi_protocol_register, scmi_protocol_unregister)
struct scmi_protocol;
int scmi_protocol_register(const struct scmi_protocol *proto);
void scmi_protocol_unregister(const struct scmi_protocol *proto);
/* SCMI Notification API - Custom Event Reports */
enum scmi_notification_events {
SCMI_EVENT_POWER_STATE_CHANGED = 0x0,
SCMI_EVENT_CLOCK_RATE_CHANGED = 0x0,
SCMI_EVENT_CLOCK_RATE_CHANGE_REQUESTED = 0x1,
SCMI_EVENT_PERFORMANCE_LIMITS_CHANGED = 0x0,
SCMI_EVENT_PERFORMANCE_LEVEL_CHANGED = 0x1,
SCMI_EVENT_SENSOR_TRIP_POINT_EVENT = 0x0,
SCMI_EVENT_SENSOR_UPDATE = 0x1,
SCMI_EVENT_RESET_ISSUED = 0x0,
SCMI_EVENT_BASE_ERROR_EVENT = 0x0,
SCMI_EVENT_SYSTEM_POWER_STATE_NOTIFIER = 0x0,
SCMI_EVENT_POWERCAP_CAP_CHANGED = 0x0,
SCMI_EVENT_POWERCAP_MEASUREMENTS_CHANGED = 0x1,
};
struct scmi_power_state_changed_report {
ktime_t timestamp;
unsigned int agent_id;
unsigned int domain_id;
unsigned int power_state;
};
struct scmi_clock_rate_notif_report {
ktime_t timestamp;
unsigned int agent_id;
unsigned int clock_id;
unsigned long long rate;
};
struct scmi_system_power_state_notifier_report {
ktime_t timestamp;
unsigned int agent_id;
#define SCMI_SYSPOWER_IS_REQUEST_GRACEFUL(flags) ((flags) & BIT(0))
unsigned int flags;
unsigned int system_state;
unsigned int timeout;
};
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/device.h`, `linux/notifier.h`, `linux/types.h`.
- Detected declarations: `struct scmi_base_info`, `struct scmi_clock_rates`, `struct scmi_clock_info`, `struct scmi_handle`, `struct scmi_device`, `struct scmi_protocol_handle`, `struct scmi_clk_proto_ops`, `struct scmi_perf_domain_info`, `struct scmi_perf_proto_ops`, `struct scmi_power_proto_ops`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.