drivers/misc/ocxl/ocxl_internal.h
Source file repositories/reference/linux-study-clean/drivers/misc/ocxl/ocxl_internal.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/ocxl/ocxl_internal.h- Extension
.h- Size
- 3935 bytes
- Lines
- 153
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pci.hlinux/cdev.hlinux/list.hmisc/ocxl.h
Detected Declarations
struct ocxl_fnstruct ocxl_file_infostruct ocxl_afustruct ocxl_xsl_errorstruct ocxl_contextstruct ocxl_process_elementenum ocxl_context_status
Annotated Snippet
extern struct pci_driver ocxl_pci_driver;
struct ocxl_fn {
struct device dev;
int bar_used[3];
struct ocxl_fn_config config;
struct list_head afu_list;
int pasid_base;
int actag_base;
int actag_enabled;
int actag_supported;
struct list_head pasid_list;
struct list_head actag_list;
void *link;
};
struct ocxl_file_info {
struct ocxl_afu *afu;
struct device dev;
struct cdev cdev;
struct bin_attribute attr_global_mmio;
};
struct ocxl_afu {
struct kref kref;
struct ocxl_fn *fn;
struct list_head list;
struct ocxl_afu_config config;
int pasid_base;
int pasid_count; /* opened contexts */
int pasid_max; /* maximum number of contexts */
int actag_base;
int actag_enabled;
struct mutex contexts_lock;
struct idr contexts_idr;
struct mutex afu_control_lock;
u64 global_mmio_start;
u64 irq_base_offset;
void __iomem *global_mmio_ptr;
u64 pp_mmio_start;
void *private;
};
enum ocxl_context_status {
CLOSED,
OPENED,
ATTACHED,
};
// Contains metadata about a translation fault
struct ocxl_xsl_error {
u64 addr; // The address that triggered the fault
u64 dsisr; // the value of the dsisr register
u64 count; // The number of times this fault has been triggered
};
struct ocxl_context {
struct ocxl_afu *afu;
int pasid;
struct mutex status_mutex;
enum ocxl_context_status status;
struct address_space *mapping;
struct mutex mapping_lock;
wait_queue_head_t events_wq;
struct mutex xsl_error_lock;
struct ocxl_xsl_error xsl_error;
struct mutex irq_lock;
struct idr irq_idr;
u16 tidr; // Thread ID used for P9 wait implementation
};
struct ocxl_process_element {
__be64 config_state;
__be32 pasid;
__be16 bdf;
__be16 reserved1;
__be32 reserved2[9];
__be32 lpid;
__be32 tid;
__be32 pid;
__be32 reserved3[10];
__be64 amr;
__be32 reserved4[3];
__be32 software_state;
};
int ocxl_file_register_afu(struct ocxl_afu *afu);
void ocxl_file_unregister_afu(struct ocxl_afu *afu);
int ocxl_file_init(void);
Annotation
- Immediate include surface: `linux/pci.h`, `linux/cdev.h`, `linux/list.h`, `misc/ocxl.h`.
- Detected declarations: `struct ocxl_fn`, `struct ocxl_file_info`, `struct ocxl_afu`, `struct ocxl_xsl_error`, `struct ocxl_context`, `struct ocxl_process_element`, `enum ocxl_context_status`.
- Atlas domain: Driver Families / drivers/misc.
- 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.