include/linux/cdx/cdx_bus.h
Source file repositories/reference/linux-study-clean/include/linux/cdx/cdx_bus.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/cdx/cdx_bus.h- Extension
.h- Size
- 8168 bytes
- Lines
- 288
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/list.hlinux/mod_devicetable.hlinux/msi.h
Detected Declarations
struct cdx_controllerstruct cdx_msi_configstruct cdx_device_configstruct cdx_opsstruct cdx_controllerstruct cdx_devicestruct cdx_driverfunction cdx_enable_msifunction cdx_disable_msi
Annotated Snippet
struct device_driver driver;
const struct cdx_device_id *match_id_table;
int (*probe)(struct cdx_device *dev);
int (*remove)(struct cdx_device *dev);
void (*shutdown)(struct cdx_device *dev);
void (*reset_prepare)(struct cdx_device *dev);
void (*reset_done)(struct cdx_device *dev);
bool driver_managed_dma;
};
#define to_cdx_driver(_drv) \
container_of_const(_drv, struct cdx_driver, driver)
/* Macro to avoid include chaining to get THIS_MODULE */
#define cdx_driver_register(drv) \
__cdx_driver_register(drv, THIS_MODULE)
/**
* __cdx_driver_register - registers a CDX device driver
* @cdx_driver: CDX driver to register
* @owner: module owner
*
* Return: -errno on failure, 0 on success.
*/
int __must_check __cdx_driver_register(struct cdx_driver *cdx_driver,
struct module *owner);
/**
* cdx_driver_unregister - unregisters a device driver from the
* CDX bus.
* @cdx_driver: CDX driver to register
*/
void cdx_driver_unregister(struct cdx_driver *cdx_driver);
extern const struct bus_type cdx_bus_type;
/**
* cdx_dev_reset - Reset CDX device
* @dev: device pointer
*
* Return: 0 for success, -errno on failure
*/
int cdx_dev_reset(struct device *dev);
/**
* cdx_set_master - enables bus-mastering for CDX device
* @cdx_dev: the CDX device to enable
*
* Return: 0 for success, -errno on failure
*/
int cdx_set_master(struct cdx_device *cdx_dev);
/**
* cdx_clear_master - disables bus-mastering for CDX device
* @cdx_dev: the CDX device to disable
*
* Return: 0 for success, -errno on failure
*/
int cdx_clear_master(struct cdx_device *cdx_dev);
#ifdef CONFIG_GENERIC_MSI_IRQ
/**
* cdx_enable_msi - Enable MSI for the CDX device.
* @cdx_dev: device pointer
*
* Return: 0 for success, -errno on failure
*/
int cdx_enable_msi(struct cdx_device *cdx_dev);
/**
* cdx_disable_msi - Disable MSI for the CDX device.
* @cdx_dev: device pointer
*/
void cdx_disable_msi(struct cdx_device *cdx_dev);
#else /* CONFIG_GENERIC_MSI_IRQ */
static inline int cdx_enable_msi(struct cdx_device *cdx_dev)
{
return -ENODEV;
}
static inline void cdx_disable_msi(struct cdx_device *cdx_dev)
{
}
#endif /* CONFIG_GENERIC_MSI_IRQ */
#endif /* _CDX_BUS_H_ */
Annotation
- Immediate include surface: `linux/device.h`, `linux/list.h`, `linux/mod_devicetable.h`, `linux/msi.h`.
- Detected declarations: `struct cdx_controller`, `struct cdx_msi_config`, `struct cdx_device_config`, `struct cdx_ops`, `struct cdx_controller`, `struct cdx_device`, `struct cdx_driver`, `function cdx_enable_msi`, `function cdx_disable_msi`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: pattern implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.