drivers/misc/mei/debugfs.c
Source file repositories/reference/linux-study-clean/drivers/misc/mei/debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/mei/debugfs.c- Extension
.c- Size
- 5177 bytes
- Lines
- 196
- Domain
- Driver Families
- Bucket
- drivers/misc
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/slab.hlinux/kernel.hlinux/device.hlinux/debugfs.hlinux/seq_file.hlinux/mei.hmei_dev.hclient.hhw.h
Detected Declarations
function Copyrightfunction list_for_each_entryfunction mei_dbgfs_active_showfunction list_for_each_entryfunction mei_dbgfs_devstate_showfunction mei_dbgfs_write_allow_fafunction mei_dbgfs_deregisterfunction mei_dbgfs_register
Annotated Snippet
static const struct file_operations mei_dbgfs_allow_fa_fops = {
.open = simple_open,
.read = debugfs_read_file_bool,
.write = mei_dbgfs_write_allow_fa,
.llseek = generic_file_llseek,
};
/**
* mei_dbgfs_deregister - Remove the debugfs files and directories
*
* @dev: the mei device structure
*/
void mei_dbgfs_deregister(struct mei_device *dev)
{
if (!dev->dbgfs_dir)
return;
debugfs_remove_recursive(dev->dbgfs_dir);
dev->dbgfs_dir = NULL;
}
/**
* mei_dbgfs_register - Add the debugfs files
*
* @dev: the mei device structure
* @name: the mei device name
*/
void mei_dbgfs_register(struct mei_device *dev, const char *name)
{
struct dentry *dir;
dir = debugfs_create_dir(name, NULL);
dev->dbgfs_dir = dir;
debugfs_create_file("meclients", S_IRUSR, dir, dev,
&mei_dbgfs_meclients_fops);
debugfs_create_file("active", S_IRUSR, dir, dev,
&mei_dbgfs_active_fops);
debugfs_create_file("devstate", S_IRUSR, dir, dev,
&mei_dbgfs_devstate_fops);
debugfs_create_file("allow_fixed_address", S_IRUSR | S_IWUSR, dir,
&dev->allow_fixed_address,
&mei_dbgfs_allow_fa_fops);
}
Annotation
- Immediate include surface: `linux/slab.h`, `linux/kernel.h`, `linux/device.h`, `linux/debugfs.h`, `linux/seq_file.h`, `linux/mei.h`, `mei_dev.h`, `client.h`.
- Detected declarations: `function Copyright`, `function list_for_each_entry`, `function mei_dbgfs_active_show`, `function list_for_each_entry`, `function mei_dbgfs_devstate_show`, `function mei_dbgfs_write_allow_fa`, `function mei_dbgfs_deregister`, `function mei_dbgfs_register`.
- Atlas domain: Driver Families / drivers/misc.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.