drivers/misc/ocxl/core.c
Source file repositories/reference/linux-study-clean/drivers/misc/ocxl/core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/ocxl/core.c- Extension
.c- Size
- 12518 bytes
- Lines
- 570
- Domain
- Driver Families
- Bucket
- drivers/misc
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/idr.hocxl_internal.h
Detected Declarations
function ocxl_fn_putfunction free_afufunction ocxl_afu_getfunction ocxl_afu_putfunction assign_afu_actagfunction reclaim_afu_actagfunction assign_afu_pasidfunction reclaim_afu_pasidfunction reserve_fn_barfunction release_fn_barfunction map_mmio_areasfunction unmap_mmio_areasfunction configure_afufunction deconfigure_afufunction activate_afufunction deactivate_afufunction init_afufunction remove_afufunction free_functionfunction free_function_devfunction set_function_devicefunction assign_function_actagfunction set_function_pasidfunction configure_functionfunction deconfigure_functionfunction list_for_each_entryfunction ocxl_function_closefunction list_for_each_entry_safefunction ocxl_afu_set_privateexport ocxl_afu_getexport ocxl_afu_putexport ocxl_function_openexport ocxl_function_afu_listexport ocxl_function_fetch_afuexport ocxl_function_configexport ocxl_function_closeexport ocxl_afu_configexport ocxl_afu_set_privateexport ocxl_afu_get_private
Annotated Snippet
if (rc > 0) {
rc = init_afu(dev, fn, afu);
if (rc) {
dev_err(&dev->dev,
"Can't initialize AFU index %d\n", afu);
continue;
}
afu_count++;
}
}
dev_info(&dev->dev, "%d AFU(s) configured\n", afu_count);
return fn;
}
EXPORT_SYMBOL_GPL(ocxl_function_open);
struct list_head *ocxl_function_afu_list(struct ocxl_fn *fn)
{
return &fn->afu_list;
}
EXPORT_SYMBOL_GPL(ocxl_function_afu_list);
struct ocxl_afu *ocxl_function_fetch_afu(struct ocxl_fn *fn, u8 afu_idx)
{
struct ocxl_afu *afu;
list_for_each_entry(afu, &fn->afu_list, list) {
if (afu->config.idx == afu_idx)
return afu;
}
return NULL;
}
EXPORT_SYMBOL_GPL(ocxl_function_fetch_afu);
const struct ocxl_fn_config *ocxl_function_config(struct ocxl_fn *fn)
{
return &fn->config;
}
EXPORT_SYMBOL_GPL(ocxl_function_config);
void ocxl_function_close(struct ocxl_fn *fn)
{
struct ocxl_afu *afu, *tmp;
list_for_each_entry_safe(afu, tmp, &fn->afu_list, list) {
remove_afu(afu);
}
deconfigure_function(fn);
device_unregister(&fn->dev);
}
EXPORT_SYMBOL_GPL(ocxl_function_close);
// AFU Metadata
struct ocxl_afu_config *ocxl_afu_config(struct ocxl_afu *afu)
{
return &afu->config;
}
EXPORT_SYMBOL_GPL(ocxl_afu_config);
void ocxl_afu_set_private(struct ocxl_afu *afu, void *private)
{
afu->private = private;
}
EXPORT_SYMBOL_GPL(ocxl_afu_set_private);
void *ocxl_afu_get_private(struct ocxl_afu *afu)
{
if (afu)
return afu->private;
return NULL;
}
EXPORT_SYMBOL_GPL(ocxl_afu_get_private);
Annotation
- Immediate include surface: `linux/idr.h`, `ocxl_internal.h`.
- Detected declarations: `function ocxl_fn_put`, `function free_afu`, `function ocxl_afu_get`, `function ocxl_afu_put`, `function assign_afu_actag`, `function reclaim_afu_actag`, `function assign_afu_pasid`, `function reclaim_afu_pasid`, `function reserve_fn_bar`, `function release_fn_bar`.
- Atlas domain: Driver Families / drivers/misc.
- Implementation status: integration 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.