include/linux/slimbus.h
Source file repositories/reference/linux-study-clean/include/linux/slimbus.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/slimbus.h- Extension
.h- Size
- 7108 bytes
- Lines
- 213
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/module.hlinux/completion.hlinux/mod_devicetable.h
Detected Declarations
struct slim_eaddrstruct slim_controllerstruct slim_devicestruct slim_driverstruct slim_val_infstruct slim_stream_configstruct slim_stream_runtimeenum slim_device_statusfunction module_slim_driverfunction slim_set_devicedata
Annotated Snippet
extern const struct bus_type slimbus_bus;
/**
* struct slim_eaddr - Enumeration address for a SLIMbus device
* @instance: Instance value
* @dev_index: Device index
* @prod_code: Product code
* @manf_id: Manufacturer Id for the device
*/
struct slim_eaddr {
u8 instance;
u8 dev_index;
u16 prod_code;
u16 manf_id;
} __packed;
/**
* enum slim_device_status - slim device status
* @SLIM_DEVICE_STATUS_DOWN: Slim device is absent or not reported yet.
* @SLIM_DEVICE_STATUS_UP: Slim device is announced on the bus.
* @SLIM_DEVICE_STATUS_RESERVED: Reserved for future use.
*/
enum slim_device_status {
SLIM_DEVICE_STATUS_DOWN = 0,
SLIM_DEVICE_STATUS_UP,
SLIM_DEVICE_STATUS_RESERVED,
};
struct slim_controller;
/**
* struct slim_device - Slim device handle.
* @dev: Driver model representation of the device.
* @e_addr: Enumeration address of this device.
* @status: slim device status
* @ctrl: slim controller instance.
* @laddr: 1-byte Logical address of this device.
* @is_laddr_valid: indicates if the laddr is valid or not
* @stream_list: List of streams on this device
* @stream_list_lock: lock to protect the stream list
*
* This is the client/device handle returned when a SLIMbus
* device is registered with a controller.
* Pointer to this structure is used by client-driver as a handle.
*/
struct slim_device {
struct device dev;
struct slim_eaddr e_addr;
struct slim_controller *ctrl;
enum slim_device_status status;
u8 laddr;
bool is_laddr_valid;
struct list_head stream_list;
spinlock_t stream_list_lock;
};
#define to_slim_device(d) container_of(d, struct slim_device, dev)
/**
* struct slim_driver - SLIMbus 'generic device' (slave) device driver
* (similar to 'spi_device' on SPI)
* @probe: Binds this driver to a SLIMbus device.
* @remove: Unbinds this driver from the SLIMbus device.
* @shutdown: Standard shutdown callback used during powerdown/halt.
* @device_status: This callback is called when
* - The device reports present and gets a laddr assigned
* - The device reports absent, or the bus goes down.
* @driver: SLIMbus device drivers should initialize name and owner field of
* this structure
* @id_table: List of SLIMbus devices supported by this driver
*/
struct slim_driver {
int (*probe)(struct slim_device *sl);
void (*remove)(struct slim_device *sl);
void (*shutdown)(struct slim_device *sl);
int (*device_status)(struct slim_device *sl,
enum slim_device_status s);
struct device_driver driver;
const struct slim_device_id *id_table;
};
#define to_slim_driver(d) container_of_const(d, struct slim_driver, driver)
/**
* struct slim_val_inf - Slimbus value or information element
* @start_offset: Specifies starting offset in information/value element map
* @rbuf: buffer to read the values
* @wbuf: buffer to write
* @num_bytes: upto 16. This ensures that the message will fit the slicesize
* per SLIMbus spec
Annotation
- Immediate include surface: `linux/device.h`, `linux/module.h`, `linux/completion.h`, `linux/mod_devicetable.h`.
- Detected declarations: `struct slim_eaddr`, `struct slim_controller`, `struct slim_device`, `struct slim_driver`, `struct slim_val_inf`, `struct slim_stream_config`, `struct slim_stream_runtime`, `enum slim_device_status`, `function module_slim_driver`, `function slim_set_devicedata`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: pattern implementation candidate.
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.