include/misc/ocxl.h
Source file repositories/reference/linux-study-clean/include/misc/ocxl.h
File Facts
- System
- Linux kernel
- Corpus path
include/misc/ocxl.h- Extension
.h- Size
- 14503 bytes
- Lines
- 472
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pci.h
Detected Declarations
struct ocxl_afu_configstruct ocxl_fn_configstruct ocxl_afustruct ocxl_fnstruct ocxl_contextenum ocxl_endian
Annotated Snippet
struct ocxl_afu_config {
u8 idx;
int dvsec_afu_control_pos; /* offset of AFU control DVSEC */
char name[OCXL_AFU_NAME_SZ];
u8 version_major;
u8 version_minor;
u8 afuc_type;
u8 afum_type;
u8 profile;
u8 global_mmio_bar; /* global MMIO area */
u64 global_mmio_offset;
u32 global_mmio_size;
u8 pp_mmio_bar; /* per-process MMIO area */
u64 pp_mmio_offset;
u32 pp_mmio_stride;
u64 lpc_mem_offset;
u64 lpc_mem_size;
u64 special_purpose_mem_offset;
u64 special_purpose_mem_size;
u8 pasid_supported_log;
u16 actag_supported;
};
struct ocxl_fn_config {
int dvsec_tl_pos; /* offset of the Transaction Layer DVSEC */
int dvsec_function_pos; /* offset of the Function DVSEC */
int dvsec_afu_info_pos; /* offset of the AFU information DVSEC */
s8 max_pasid_log;
s8 max_afu_index;
};
enum ocxl_endian {
OCXL_BIG_ENDIAN = 0, /**< AFU data is big-endian */
OCXL_LITTLE_ENDIAN = 1, /**< AFU data is little-endian */
OCXL_HOST_ENDIAN = 2, /**< AFU data is the same endianness as the host */
};
// These are opaque outside the ocxl driver
struct ocxl_afu;
struct ocxl_fn;
struct ocxl_context;
// Device detection & initialisation
/**
* ocxl_function_open() - Open an OpenCAPI function on an OpenCAPI device
* @dev: The PCI device that contains the function
*
* Returns an opaque pointer to the function, or an error pointer (check with IS_ERR)
*/
struct ocxl_fn *ocxl_function_open(struct pci_dev *dev);
/**
* ocxl_function_afu_list() - Get the list of AFUs associated with a PCI function device
* Returns a list of struct ocxl_afu *
*
* @fn: The OpenCAPI function containing the AFUs
*/
struct list_head *ocxl_function_afu_list(struct ocxl_fn *fn);
/**
* ocxl_function_fetch_afu() - Fetch an AFU instance from an OpenCAPI function
* @fn: The OpenCAPI function to get the AFU from
* @afu_idx: The index of the AFU to get
*
* If successful, the AFU should be released with ocxl_afu_put()
*
* Returns a pointer to the AFU, or NULL on error
*/
struct ocxl_afu *ocxl_function_fetch_afu(struct ocxl_fn *fn, u8 afu_idx);
/**
* ocxl_afu_get() - Take a reference to an AFU
* @afu: The AFU to increment the reference count on
*/
void ocxl_afu_get(struct ocxl_afu *afu);
/**
* ocxl_afu_put() - Release a reference to an AFU
* @afu: The AFU to decrement the reference count on
*/
void ocxl_afu_put(struct ocxl_afu *afu);
/**
* ocxl_function_config() - Get the configuration information for an OpenCAPI function
* @fn: The OpenCAPI function to get the config for
*
* Returns the function config, or NULL on error
*/
Annotation
- Immediate include surface: `linux/pci.h`.
- Detected declarations: `struct ocxl_afu_config`, `struct ocxl_fn_config`, `struct ocxl_afu`, `struct ocxl_fn`, `struct ocxl_context`, `enum ocxl_endian`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.