drivers/platform/x86/intel/pmt/telemetry.h
Source file repositories/reference/linux-study-clean/drivers/platform/x86/intel/pmt/telemetry.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/intel/pmt/telemetry.h- Extension
.h- Size
- 4102 bytes
- Lines
- 127
- Domain
- Driver Families
- Bucket
- drivers/platform
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct devicestruct telem_endpointstruct telem_headerstruct telem_endpoint_info
Annotated Snippet
struct telem_header {
u8 access_type;
u16 size;
u32 guid;
u32 base_offset;
};
struct telem_endpoint_info {
struct device *dev;
struct telem_header header;
};
/**
* pmt_telem_get_next_endpoint() - Get next device id for a telemetry endpoint
* @start: starting devid to look from
*
* This functions can be used in a while loop predicate to retrieve the devid
* of all available telemetry endpoints. Functions pmt_telem_get_next_endpoint()
* and pmt_telem_register_endpoint() can be used inside of the loop to examine
* endpoint info and register to receive a pointer to the endpoint. The pointer
* is then usable in the telemetry read calls to access the telemetry data.
*
* Return:
* * devid - devid of the next present endpoint from start
* * 0 - when no more endpoints are present after start
*/
unsigned long pmt_telem_get_next_endpoint(unsigned long start);
/**
* pmt_telem_register_endpoint() - Register a telemetry endpoint
* @devid: device id/handle of the telemetry endpoint
*
* Increments the kref usage counter for the endpoint.
*
* Return:
* * endpoint - On success returns pointer to the telemetry endpoint
* * -ENXIO - telemetry endpoint not found
*/
struct telem_endpoint *pmt_telem_register_endpoint(int devid);
/**
* pmt_telem_unregister_endpoint() - Unregister a telemetry endpoint
* @ep: ep structure to populate.
*
* Decrements the kref usage counter for the endpoint.
*/
void pmt_telem_unregister_endpoint(struct telem_endpoint *ep);
/**
* pmt_telem_get_endpoint_info() - Get info for an endpoint from its devid
* @devid: device id/handle of the telemetry endpoint
* @info: Endpoint info structure to be populated
*
* Return:
* * 0 - Success
* * -ENXIO - telemetry endpoint not found for the devid
* * -EINVAL - @info is NULL
*/
int pmt_telem_get_endpoint_info(int devid, struct telem_endpoint_info *info);
/**
* pmt_telem_find_and_register_endpoint() - Get a telemetry endpoint from
* device, guid and pos
* @dev: device inside the Intel vsec
* @guid: GUID of the telemetry space
* @pos: Instance of the guid
*
* Return:
* * endpoint - On success returns pointer to the telemetry endpoint
* * -ENXIO - telemetry endpoint not found
*/
struct telem_endpoint *
pmt_telem_find_and_register_endpoint(struct device *dev, u32 guid, u16 pos);
/**
* pmt_telem_read() - Read qwords from counter sram using sample id
* @ep: Telemetry endpoint to be read
* @id: The beginning sample id of the metric(s) to be read
* @data: Allocated qword buffer
* @count: Number of qwords requested
*
* Callers must ensure reads are aligned. When the call returns -ENODEV,
* the device has been removed and callers should unregister the telemetry
* endpoint.
*
* Return:
* * 0 - Success
* * -ENODEV - The device is not present.
* * -EINVAL - The offset is out bounds
* * -EPIPE - The device was removed during the read. Data written
Annotation
- Detected declarations: `struct device`, `struct telem_endpoint`, `struct telem_header`, `struct telem_endpoint_info`.
- Atlas domain: Driver Families / drivers/platform.
- Implementation status: source 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.