include/linux/surface_aggregator/device.h
Source file repositories/reference/linux-study-clean/include/linux/surface_aggregator/device.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/surface_aggregator/device.h- Extension
.h- Size
- 24447 bytes
- Lines
- 633
- 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/mod_devicetable.hlinux/property.hlinux/types.hlinux/surface_aggregator/controller.h
Detected Declarations
struct ssam_device_uidstruct ssam_devicestruct ssam_device_driverenum ssam_device_domainenum ssam_virtual_tcenum ssam_device_flagsfunction is_ssam_devicefunction is_ssam_devicefunction ssam_device_mark_hot_removedfunction ssam_device_is_hot_removedfunction ssam_device_getfunction ssam_device_putfunction ssam_device_get_drvdatafunction ssam_device_set_drvdatafunction __ssam_register_clientsfunction ssam_remove_clientsfunction ssam_device_register_clientsfunction ssam_device_notifier_registerfunction ssam_device_notifier_unregister
Annotated Snippet
struct device_driver driver;
const struct ssam_device_id *match_table;
int (*probe)(struct ssam_device *sdev);
void (*remove)(struct ssam_device *sdev);
};
#ifdef CONFIG_SURFACE_AGGREGATOR_BUS
extern const struct device_type ssam_device_type;
/**
* is_ssam_device() - Check if the given device is a SSAM client device.
* @d: The device to test the type of.
*
* Return: Returns %true if the specified device is of type &struct
* ssam_device, i.e. the device type points to %ssam_device_type, and %false
* otherwise.
*/
static inline bool is_ssam_device(struct device *d)
{
return d->type == &ssam_device_type;
}
#else /* CONFIG_SURFACE_AGGREGATOR_BUS */
static inline bool is_ssam_device(struct device *d)
{
return false;
}
#endif /* CONFIG_SURFACE_AGGREGATOR_BUS */
/**
* to_ssam_device() - Casts the given device to a SSAM client device.
* @d: The device to cast.
*
* Casts the given &struct device to a &struct ssam_device. The caller has to
* ensure that the given device is actually enclosed in a &struct ssam_device,
* e.g. by calling is_ssam_device().
*
* Return: Returns a pointer to the &struct ssam_device wrapping the given
* device @d.
*/
#define to_ssam_device(d) container_of_const(d, struct ssam_device, dev)
/**
* to_ssam_device_driver() - Casts the given device driver to a SSAM client
* device driver.
* @d: The driver to cast.
*
* Casts the given &struct device_driver to a &struct ssam_device_driver. The
* caller has to ensure that the given driver is actually enclosed in a
* &struct ssam_device_driver.
*
* Return: Returns the pointer to the &struct ssam_device_driver wrapping the
* given device driver @d.
*/
#define to_ssam_device_driver(d) container_of_const(d, struct ssam_device_driver, driver)
const struct ssam_device_id *ssam_device_id_match(const struct ssam_device_id *table,
const struct ssam_device_uid uid);
const struct ssam_device_id *ssam_device_get_match(const struct ssam_device *dev);
const void *ssam_device_get_match_data(const struct ssam_device *dev);
struct ssam_device *ssam_device_alloc(struct ssam_controller *ctrl,
struct ssam_device_uid uid);
int ssam_device_add(struct ssam_device *sdev);
void ssam_device_remove(struct ssam_device *sdev);
/**
* ssam_device_mark_hot_removed() - Mark the given device as hot-removed.
* @sdev: The device to mark as hot-removed.
*
* Mark the device as having been hot-removed. This signals drivers using the
* device that communication with the device should be avoided and may lead to
* timeouts.
*/
static inline void ssam_device_mark_hot_removed(struct ssam_device *sdev)
{
dev_dbg(&sdev->dev, "marking device as hot-removed\n");
set_bit(SSAM_DEVICE_HOT_REMOVED_BIT, &sdev->flags);
}
/**
* ssam_device_is_hot_removed() - Check if the given device has been
Annotation
- Immediate include surface: `linux/device.h`, `linux/mod_devicetable.h`, `linux/property.h`, `linux/types.h`, `linux/surface_aggregator/controller.h`.
- Detected declarations: `struct ssam_device_uid`, `struct ssam_device`, `struct ssam_device_driver`, `enum ssam_device_domain`, `enum ssam_virtual_tc`, `enum ssam_device_flags`, `function is_ssam_device`, `function is_ssam_device`, `function ssam_device_mark_hot_removed`, `function ssam_device_is_hot_removed`.
- 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.