Files
evga-icx/card.h
T
2026-09-30 00:40:25 -07:00

42 lines
2.1 KiB
C

#ifndef CARD_H
#define CARD_H
#define NVIDIA_VEN 0x10DE
#define NVIDIA_RTX3060_DEV 0x2503
#define NVIDIA_RTX3060_GA104_DEV 0x2487
#define NVIDIA_RTX3060_GA106_DEV 0x2503
#define NVIDIA_RTX3060_LHR_DEV 0x2504
#define NVIDIA_RTX3060TI_DEV 0x2486
#define NVIDIA_RTX3060TI_GDDR6X_DEV 0x24C9
#define NVIDIA_RTX3060TI_LHR_DEV 0x2489
#define NVIDIA_RTX3060TI_V1_LHR_DEV 0x2414
#define NVIDIA_RTX3070_DEV 0x2484
#define NVIDIA_RTX3070_LHR_DEV 0x2488
#define NVIDIA_RTX3070TI_DEV 0x2482
#define NVIDIA_RTX3070TI_GA102_DEV 0x2207
#define NVIDIA_RTX3080_DEV 0x2206
#define NVIDIA_RTX3080_LHR_DEV 0x2216
#define NVIDIA_RTX3080_12G_LHR_DEV 0x220A
#define NVIDIA_RTX3080TI_DEV 0x2208
#define NVIDIA_RTX3090_DEV 0x2204
#define NVIDIA_RTX3090TI_DEV 0x2203
#define NVIDIA_RTXPRO6000_WORKSTATION_DEV 0x2BB1
struct card_info {
char *card_name; /* The 'nice' name of the card */
char *pci_id; /* PCI bus address in domain:bus:device.function format. May be shortened (e.g. c:00.0) */
char *pci_dev_path; /* Path to the PCI device file */
void *bar0_mmap; /* Mmap of the PCI BAR0 */
unsigned short pci_device_id; /* The device ID of the card, i.e. corresponds to the NVIDIA model number */
char *i2c_dev_path; /* Path to the i2c device file */
int i2c_fd; /* File descriptor for the i2c device file, for re-use */
int product_id; /* EVGA internal product ID, as reported by the iCX3 controller */
void *nvml_device; /* Pointer to nvmlDevice_t for use in NVML calls */
};
unsigned short read_pci_id(char *device_path, char *field);
char *read_nvidia_pci_address(char *device_path);
void mmap_bar0(struct card_info *card);
#endif