27 lines
720 B
C
27 lines
720 B
C
// Pure driver-library helpers for walking PCI capability lists.
|
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <ntlite/status.h>
|
|
|
|
typedef struct NTL_PCI_CONFIG_READER {
|
|
void* Context;
|
|
uint32_t (*Read32)(void* context, uint16_t offset);
|
|
} NTL_PCI_CONFIG_READER;
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// Finds an ordinary PCI capability using an explicitly supplied config reader.
|
|
// Returns NOT_FOUND for a valid exhausted list and DEVICE_ERROR for malformed lists.
|
|
KSTATUS NtlPciFindCapability(const NTL_PCI_CONFIG_READER* reader,
|
|
uint8_t firstOffset,
|
|
uint8_t capabilityId,
|
|
uint8_t* outOffset);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|