00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _INCLUDE_FIO_PUBLIC_COMMON_TYPES_H_
00027 #define _INCLUDE_FIO_PUBLIC_COMMON_TYPES_H_
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00033 #if defined(WINNT) || defined(WIN32)
00034 #include <windows.h>
00035 typedef UINT8 uint8_t;
00036 typedef UINT16 uint16_t;
00037 typedef UINT32 uint32_t;
00038 typedef UINT64 uint64_t;
00039 typedef INT8 int8_t;
00040 typedef INT16 int16_t;
00041 typedef INT32 int32_t;
00042 typedef INT64 int64_t;
00043 #else
00044 #include <stdint.h>
00045 #include <stdbool.h>
00046 #endif
00047
00048 #include <time.h>
00049
00050 #if defined(WIN32) || defined(WINNT)
00051 #define DllExport __declspec( dllexport )
00052 #else
00053 #define DllExport
00054 #endif
00055
00062 typedef void(*fio_cb_fn_t)(uint64_t id, int16_t percent, void* context);
00063
00068 typedef struct fio_progress_callback2
00069 {
00070 uint32_t lib_version;
00071 uint64_t id;
00073 fio_cb_fn_t callback;
00074 clock_t callback_period_ms;
00075 void* context;
00077 } fio_progress_callback2_t;
00078
00080 typedef enum
00081 {
00082 COMPATIBILITY_INCOMPATIBLE = 0x000,
00083 COMPATIBILITY_SUBOPTIMAL = 0x010,
00084 COMPATIBILITY_OPTIMAL = 0x800,
00086 COMPATIBILITY_UNKNOWN = 0x8000
00087 } fio_iodimm_compatibility_t;
00088
00090 typedef enum
00091 {
00092 FIO_PCIE_LINKSPEED_UNAVAIL = 0,
00093 FIO_PCIE_LINKSPEED_2_5 = 1,
00094 FIO_PCIE_LINKSPEED_5_0 = 2,
00095 } fio_pcie_linkspeed_t;
00096
00098 typedef struct fio_pciexpress_info
00099 {
00100 uint8_t is_valid;
00101 uint8_t linkwidth;
00102 fio_pcie_linkspeed_t linkspeed;
00106 float bandwidth_mbytes_sec;
00109 float slot_power_watts;
00110 } fio_pciexpress_info_t;
00111
00113 typedef struct fio_pci_info
00114 {
00115 uint32_t lib_version;
00116 uint8_t bus;
00117 uint8_t device;
00118 uint8_t function;
00119 uint32_t vendor_id;
00120 uint32_t device_id;
00121 uint8_t slot_number;
00123 uint8_t is_slot_number_valid;
00125 uint16_t subsystem_vendor_id;
00126 uint16_t subsystem_device_id;
00128
00129 fio_pciexpress_info_t pcie;
00130 fio_iodimm_compatibility_t bandwidth_compatibility;
00131 fio_iodimm_compatibility_t power_compatibility;
00132 } fio_pci_info_t;
00133
00135 typedef struct fio_iodimm_dynamic_pci_info
00136 {
00137 uint32_t lib_version;
00139 uint16_t errors;
00140 uint8_t error_correctable;
00141 uint8_t error_nonfatal;
00142 uint8_t error_fatal;
00143 uint8_t error_unrecognized_req;
00144 } fio_iodimm_dynamic_pci_info_t;
00145
00147 typedef struct fio_firmware_version
00148 {
00149 uint32_t revision;
00150 uint32_t major;
00151 uint32_t minor;
00152 uint32_t micro;
00153 } fio_firmware_version_t;
00154
00156 typedef struct fio_firmware_version_info
00157 {
00158 uint32_t lib_version;
00159 fio_firmware_version_t current_ver;
00160 fio_firmware_version_t minimum_ver;
00161 fio_firmware_version_t maximum_ver;
00162 } fio_firmware_version_info_t;
00163
00165 typedef enum
00166 {
00167 FIO_STATUS_SUCCESS = 0,
00168 FIO_STATUS_DEVICE_NOT_FOUND = 1,
00169 FIO_STATUS_FAILURE = 2,
00170 FIO_STATUS_FAILURE_PERM = 3,
00171 FIO_STATUS_NOT_IMPLEMENTED = 4,
00172 FIO_STATUS_ENOMEM = 5,
00173 FIO_STATUS_PCI_UNSUPPORTED = 6,
00174 FIO_STATUS_DRIVER_LOADED = 7,
00175 FIO_STATUS_INVALID_INPUT = 8,
00176 } fio_status_result_t;
00177
00178 #ifdef __cplusplus
00179 }
00180 #endif
00181
00182 #endif