drivers/cdx/controller/mcdi_functions.h
Source file repositories/reference/linux-study-clean/drivers/cdx/controller/mcdi_functions.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/cdx/controller/mcdi_functions.h- Extension
.h- Size
- 3807 bytes
- Lines
- 127
- Domain
- Driver Families
- Bucket
- drivers/cdx
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/cdx/mcdi.hmcdid.h../cdx.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#ifndef CDX_MCDI_FUNCTIONS_H
#define CDX_MCDI_FUNCTIONS_H
#include <linux/cdx/mcdi.h>
#include "mcdid.h"
#include "../cdx.h"
/**
* cdx_mcdi_get_num_buses - Get the total number of buses on
* the controller.
* @cdx: pointer to MCDI interface.
*
* Return: total number of buses available on the controller,
* <0 on failure
*/
int cdx_mcdi_get_num_buses(struct cdx_mcdi *cdx);
/**
* cdx_mcdi_get_num_devs - Get the total number of devices on
* a particular bus of the controller.
* @cdx: pointer to MCDI interface.
* @bus_num: Bus number.
*
* Return: total number of devices available on the bus, <0 on failure
*/
int cdx_mcdi_get_num_devs(struct cdx_mcdi *cdx, int bus_num);
/**
* cdx_mcdi_get_dev_config - Get configuration for a particular
* bus_num:dev_num
* @cdx: pointer to MCDI interface.
* @bus_num: Bus number.
* @dev_num: Device number.
* @dev_params: Pointer to cdx_dev_params, this is populated by this
* device with the configuration corresponding to the provided
* bus_num:dev_num.
*
* Return: 0 total number of devices available on the bus, <0 on failure
*/
int cdx_mcdi_get_dev_config(struct cdx_mcdi *cdx,
u8 bus_num, u8 dev_num,
struct cdx_dev_params *dev_params);
/**
* cdx_mcdi_bus_enable - Enable CDX bus represented by bus_num
* @cdx: pointer to MCDI interface.
* @bus_num: Bus number.
*
* Return: 0 on success, <0 on failure
*/
int cdx_mcdi_bus_enable(struct cdx_mcdi *cdx, u8 bus_num);
/**
* cdx_mcdi_bus_disable - Disable CDX bus represented by bus_num
* @cdx: pointer to MCDI interface.
* @bus_num: Bus number.
*
* Return: 0 on success, <0 on failure
*/
int cdx_mcdi_bus_disable(struct cdx_mcdi *cdx, u8 bus_num);
/**
* cdx_mcdi_write_msi - Write MSI configuration for CDX device
* @cdx: pointer to MCDI interface.
* @bus_num: Bus number.
* @dev_num: Device number.
* @msi_vector: Device-relative MSI vector number.
* Must be < MSI_COUNT reported for the device.
* @msi_address: MSI address to be used by the hardware. Typically, on ARM
* systems this address is translated by the IOMMU (if enabled) and
* it is the responsibility of the entity managing the IOMMU (APU kernel)
* to supply the correct IOVA here.
* @msi_data: MSI data to be used by the hardware. On versal-net, only the
* lower 16-bits are used, the remaining bits are ignored and should be
* set to zero.
*
* Return: 0 on success, <0 on failure
*/
int cdx_mcdi_write_msi(struct cdx_mcdi *cdx, u8 bus_num, u8 dev_num,
u32 msi_vector, u64 msi_address, u32 msi_data);
/**
* cdx_mcdi_reset_device - Reset cdx device represented by bus_num:dev_num
* @cdx: pointer to MCDI interface.
* @bus_num: Bus number.
* @dev_num: Device number.
*
* Return: 0 on success, <0 on failure
*/
int cdx_mcdi_reset_device(struct cdx_mcdi *cdx,
Annotation
- Immediate include surface: `linux/cdx/mcdi.h`, `mcdid.h`, `../cdx.h`.
- Atlas domain: Driver Families / drivers/cdx.
- 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.