drivers/edac/edac_device.h
Source file repositories/reference/linux-study-clean/drivers/edac/edac_device.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/edac/edac_device.h- Extension
.h- Size
- 10260 bytes
- Lines
- 350
- Domain
- Driver Families
- Bucket
- drivers/edac
- 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/edac.hlinux/kobject.hlinux/list.hlinux/types.hlinux/sysfs.hlinux/workqueue.h
Detected Declarations
struct edac_device_counterstruct edac_device_ctl_infostruct edac_device_blockstruct edac_dev_sysfs_attributestruct edac_dev_sysfs_block_attributestruct edac_device_blockstruct edac_device_instancestruct edac_device_ctl_infofunction edac_device_handle_cefunction edac_device_handle_uefunction __edac_device_free_ctl_info
Annotated Snippet
const struct bus_type *edac_subsys;
/* the internal state of this controller instance */
int op_state;
/* work struct for this instance */
struct delayed_work work;
/* pointer to edac polling checking routine:
* If NOT NULL: points to polling check routine
* If NULL: Then assumes INTERRUPT operation, where
* MC driver will receive events
*/
void (*edac_check) (struct edac_device_ctl_info * edac_dev);
struct device *dev; /* pointer to device structure */
const char *mod_name; /* module name */
const char *ctl_name; /* edac controller name */
const char *dev_name; /* pci/platform/etc... name */
void *pvt_info; /* pointer to 'private driver' info */
unsigned long start_time; /* edac_device load start time (jiffies) */
/* sysfs top name under 'edac' directory
* and instance name:
* cpu/cpu0/...
* cpu/cpu1/...
* cpu/cpu2/...
* ...
*/
char name[EDAC_DEVICE_NAME_LEN + 1];
/* Number of instances supported on this control structure
* and the array of those instances
*/
u32 nr_instances;
struct edac_device_instance *instances;
struct edac_device_block *blocks;
/* Event counters for the this whole EDAC Device */
struct edac_device_counter counters;
/* edac sysfs device control for the 'name'
* device this structure controls
*/
struct kobject kobj;
};
/* To get from the instance's wq to the beginning of the ctl structure */
#define to_edac_mem_ctl_work(w) \
container_of(w, struct mem_ctl_info, work)
#define to_edac_device_ctl_work(w) \
container_of(w,struct edac_device_ctl_info,work)
/*
* The alloc() and free() functions for the 'edac_device' control info
* structure. A MC driver will allocate one of these for each edac_device
* it is going to control/register with the EDAC CORE.
*/
extern struct edac_device_ctl_info *edac_device_alloc_ctl_info(
unsigned sizeof_private,
char *edac_device_name, unsigned nr_instances,
char *edac_block_name, unsigned nr_blocks,
unsigned offset_value,
int device_index);
/* The offset value can be:
* -1 indicating no offset value
* 0 for zero-based block numbers
* 1 for 1-based block number
* other for other-based block number
*/
#define BLOCK_OFFSET_VALUE_OFF ((unsigned) -1)
extern void edac_device_free_ctl_info(struct edac_device_ctl_info *ctl_info);
/**
* edac_device_add_device - Insert the 'edac_dev' structure into the
* edac_device global list and create sysfs entries associated with
* edac_device structure.
*
* @edac_dev: pointer to edac_device structure to be added to the list
* 'edac_device' structure.
*
* Returns:
* 0 on Success, or an error code on failure
*/
extern int edac_device_add_device(struct edac_device_ctl_info *edac_dev);
Annotation
- Immediate include surface: `linux/device.h`, `linux/edac.h`, `linux/kobject.h`, `linux/list.h`, `linux/types.h`, `linux/sysfs.h`, `linux/workqueue.h`.
- Detected declarations: `struct edac_device_counter`, `struct edac_device_ctl_info`, `struct edac_device_block`, `struct edac_dev_sysfs_attribute`, `struct edac_dev_sysfs_block_attribute`, `struct edac_device_block`, `struct edac_device_instance`, `struct edac_device_ctl_info`, `function edac_device_handle_ce`, `function edac_device_handle_ue`.
- Atlas domain: Driver Families / drivers/edac.
- 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.