drivers/peci/internal.h
Source file repositories/reference/linux-study-clean/drivers/peci/internal.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/peci/internal.h- Extension
.h- Size
- 5119 bytes
- Lines
- 132
- Domain
- Driver Families
- Bucket
- drivers/peci
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- 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/types.h
Detected Declarations
struct peci_controllerstruct attribute_groupstruct peci_devicestruct peci_requeststruct peci_device_idstruct peci_driver
Annotated Snippet
extern const struct bus_type peci_bus_type;
extern const struct attribute_group *peci_bus_groups[];
/**
* struct peci_driver - PECI driver
* @driver: inherit device driver
* @probe: probe callback
* @remove: remove callback
* @id_table: PECI device match table to decide which device to bind
*/
struct peci_driver {
struct device_driver driver;
int (*probe)(struct peci_device *device, const struct peci_device_id *id);
void (*remove)(struct peci_device *device);
const struct peci_device_id *id_table;
};
#define to_peci_driver(__drv) container_of_const(__drv, struct peci_driver, driver)
int __peci_driver_register(struct peci_driver *driver, struct module *owner,
const char *mod_name);
/**
* peci_driver_register() - register PECI driver
* @driver: the driver to be registered
*
* PECI drivers that don't need to do anything special in module init should
* use the convenience "module_peci_driver" macro instead
*
* Return: zero on success, else a negative error code.
*/
#define peci_driver_register(driver) \
__peci_driver_register(driver, THIS_MODULE, KBUILD_MODNAME)
void peci_driver_unregister(struct peci_driver *driver);
/**
* module_peci_driver() - helper macro for registering a modular PECI driver
* @__peci_driver: peci_driver struct
*
* Helper macro for PECI drivers which do not do anything special in module
* init/exit. This eliminates a lot of boilerplate. Each module may only
* use this macro once, and calling it replaces module_init() and module_exit()
*/
#define module_peci_driver(__peci_driver) \
module_driver(__peci_driver, peci_driver_register, peci_driver_unregister)
extern const struct device_type peci_controller_type;
int peci_controller_scan_devices(struct peci_controller *controller);
#endif /* __PECI_INTERNAL_H */
Annotation
- Immediate include surface: `linux/device.h`, `linux/types.h`.
- Detected declarations: `struct peci_controller`, `struct attribute_group`, `struct peci_device`, `struct peci_request`, `struct peci_device_id`, `struct peci_driver`.
- Atlas domain: Driver Families / drivers/peci.
- 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.