From 9ac50fc42f232490c4d5b490c406be67257d9066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 31 Oct 2023 15:11:22 +0800 Subject: [PATCH] GPU: add more vendors --- src/detection/gpu/gpu.c | 7 +++++++ src/detection/gpu/gpu.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/detection/gpu/gpu.c b/src/detection/gpu/gpu.c index 32fb5a3e9..70980f5f9 100644 --- a/src/detection/gpu/gpu.c +++ b/src/detection/gpu/gpu.c @@ -9,6 +9,8 @@ const char* FF_GPU_VENDOR_NAME_NVIDIA = "NVIDIA"; const char* FF_GPU_VENDOR_NAME_VMWARE = "VMware"; const char* FF_GPU_VENDOR_NAME_PARALLEL = "Parallel"; const char* FF_GPU_VENDOR_NAME_MICROSOFT = "Microsoft"; +const char* FF_GPU_VENDOR_NAME_REDHAT = "RedHat"; +const char* FF_GPU_VENDOR_NAME_ORACLE = "Oracle"; static inline bool arrayContains(const unsigned arr[], unsigned vendorId, unsigned length) { @@ -22,6 +24,7 @@ static inline bool arrayContains(const unsigned arr[], unsigned vendorId, unsign const char* ffGetGPUVendorString(unsigned vendorId) { + // https://devicehunt.com/all-pci-vendors if(vendorId == 0x106b) return FF_GPU_VENDOR_NAME_APPLE; if(arrayContains((const unsigned[]) {0x1002, 0x1022}, vendorId, 2)) @@ -32,10 +35,14 @@ const char* ffGetGPUVendorString(unsigned vendorId) return FF_GPU_VENDOR_NAME_NVIDIA; else if(arrayContains((const unsigned[]) {0x15ad}, vendorId, 1)) return FF_GPU_VENDOR_NAME_VMWARE; + else if(arrayContains((const unsigned[]) {0x1af4}, vendorId, 1)) + return FF_GPU_VENDOR_NAME_REDHAT; else if(arrayContains((const unsigned[]) {0x1ab8}, vendorId, 1)) return FF_GPU_VENDOR_NAME_PARALLEL; else if(arrayContains((const unsigned[]) {0x1414}, vendorId, 1)) return FF_GPU_VENDOR_NAME_MICROSOFT; + else if(arrayContains((const unsigned[]) {0x108e}, vendorId, 1)) + return FF_GPU_VENDOR_NAME_ORACLE; return NULL; } diff --git a/src/detection/gpu/gpu.h b/src/detection/gpu/gpu.h index 8398a826f..70ccd96b2 100644 --- a/src/detection/gpu/gpu.h +++ b/src/detection/gpu/gpu.h @@ -16,6 +16,8 @@ extern const char* FF_GPU_VENDOR_NAME_NVIDIA; extern const char* FF_GPU_VENDOR_NAME_VMWARE; extern const char* FF_GPU_VENDOR_NAME_PARALLEL; extern const char* FF_GPU_VENDOR_NAME_MICROSOFT; +extern const char* FF_GPU_VENDOR_NAME_REDHAT; +extern const char* FF_GPU_VENDOR_NAME_ORACLE; typedef struct FFGPUMemory {