igsc_lib.h(3)
π NAME π
igsc_lib.h β bestie, this is the header for the Intel Graphics System Controller Library API. That's the manual name, and yes it's a C header, and yes it's giving main character energy for talking to your GPU. Periodt.
β¨ SYNOPSIS β¨
Okay so first things first, you gotta pull in these, no cap:
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
π Data Structures
Here's the whole squad of structs this header defines β every single one, bestie, I'm not skipping a single one:
struct igsc_fw_versionstruct igsc_ifr_bin_versionstruct igsc_psc_versionstruct igsc_oem_versionstruct igsc_oem_serial_numberstruct igsc_fwdata_versionstruct igsc_fwdata_version2struct igsc_oprom_versionstruct igsc_oprom_device_infostruct igsc_oprom_device_info_4idsstruct igsc_fwdata_device_infostruct igsc_device_infostruct igsc_hw_configβ structure to store hw configurationstruct igsc_subsystem_idsβ structure to store device subsystem idsstruct igsc_device_handlestruct igsc_fw_update_flagsstruct igsc_gfsp_tile_mem_errstruct igsc_gfsp_mem_errstruct igsc_device_mbist_ppr_statusstruct igsc_ppr_status
π¦ Macros
The constants, the lore, the little numbers that run everything. Look at these:
#define IGSC_LIBRARY_VERSION_MAJOR (1)#define IGSC_LIBRARY_VERSION_MINOR (3)#define IGSC_LIBRARY_VERSION_PATCH (1)#define IGSC_LIBRARY_VERSION_BUILD (0)#define BIT(x)#define UNUSED_VAR(_v)#define IGSC_INVALID_DEVICE_HANDLE ((void *)0)#define IGSC_MAX_OEM_VERSION_LENGTH 256#define IGSC_MAX_OEM_SN_LENGTH 512#define IGSC_FWDATA_FORMAT_VERSION_1 0x1#define IGSC_FWDATA_FORMAT_VERSION_2 0x2#define IGSC_FWDATA_FITB_VALID_MASK 0x1#define IGSC_OPROM_VER_SIZE 8#define IGSC_INFO_NAME_SIZE 256#define IGSC_HW_CONFIG_BLOB_SIZE 48#define IGSC_MAX_IMAGE_SIZE (8*1024*1024) /* 8M */β Maximum firmware image size. That's 8M, don't come at me with a bigger blob π#define IGSC_MAX_FW_STATUS_INDEX 5
π₯ IGSC_ERRORS
These are the Library return codes β the "how did it go" lineup. Lowkey iconic honestly:
#define IGSC_ERROR_BASE 0x0000U
#define IGSC_SUCCESS (IGSC_ERROR_BASE + 0)
#define IGSC_ERROR_INTERNAL (IGSC_ERROR_BASE + 1)
#define IGSC_ERROR_NOMEM (IGSC_ERROR_BASE + 2)
#define IGSC_ERROR_INVALID_PARAMETER (IGSC_ERROR_BASE + 3)
#define IGSC_ERROR_DEVICE_NOT_FOUND (IGSC_ERROR_BASE + 4)
#define IGSC_ERROR_BAD_IMAGE (IGSC_ERROR_BASE + 5)
#define IGSC_ERROR_PROTOCOL (IGSC_ERROR_BASE + 6)
#define IGSC_ERROR_BUFFER_TOO_SMALL (IGSC_ERROR_BASE + 7)
#define IGSC_ERROR_INVALID_STATE (IGSC_ERROR_BASE + 8)
#define IGSC_ERROR_NOT_SUPPORTED (IGSC_ERROR_BASE + 9)
#define IGSC_ERROR_INCOMPATIBLE (IGSC_ERROR_BASE + 10)
#define IGSC_ERROR_TIMEOUT (IGSC_ERROR_BASE + 11)
#define IGSC_ERROR_PERMISSION_DENIED (IGSC_ERROR_BASE + 12)
#define IGSC_ERROR_BUSY (IGSC_ERROR_BASE + 13)
π Typedefs
typedef void * igsc_handle_tβ just a void pointer, dressed up as a handle. We love a glow-up.typedef void(* igsc_log_func_t) (enum igsc_log_level_type log_level, const char *fmt,...)β Callback function template for printing igsc log messages. You hand the library a function like this and it'll spam your logs for you π«Άtypedef void(* igsc_progress_func_t) (uint32_t sent, uint32_t total, void *ctx)β Callback function template for monitor firmware update progress. So you can watch the littlesentout oftotalgo up and feel something.
π Enumerations
Buckle up bestie, there are a LOT of these. Every single value, coming right up. π
enum igsc_log_level_type
How chatty the logs get:
enum igsc_log_level_type {
IGSC_LOG_LEVEL_ERROR = 0,
IGSC_LOG_LEVEL_DEBUG = 1,
IGSC_LOG_LEVEL_TRACE = 2,
IGSC_LOG_LEVEL_MAX = 3
};
enum igsc_image_type
What flavour of image you're holding:
enum igsc_image_type {
IGSC_IMAGE_TYPE_UNKNOWN = 0,
IGSC_IMAGE_TYPE_GFX_FW,
IGSC_IMAGE_TYPE_OPROM,
IGSC_IMAGE_TYPE_OPROM_CODE,
IGSC_IMAGE_TYPE_OPROM_DATA,
IGSC_IMAGE_TYPE_FW_DATA
};
enum igsc_version_compare_result
Outcome of comparing versions. It's giving "are we compatible or not":
enum igsc_version_compare_result {
IGSC_VERSION_ERROR = 0,
IGSC_VERSION_NOT_COMPATIBLE = 1,
IGSC_VERSION_NEWER = 2,
IGSC_VERSION_EQUAL = 3,
IGSC_VERSION_OLDER = 4
};
enum igsc_fwdata_version_compare_result
The fwdata version verdict β accept, or one of many rejections π:
enum igsc_fwdata_version_compare_result {
IGSC_FWDATA_VERSION_REJECT_VCN = 0,
IGSC_FWDATA_VERSION_REJECT_OEM_MANUF_DATA_VERSION = 1,
IGSC_FWDATA_VERSION_REJECT_DIFFERENT_PROJECT = 2,
IGSC_FWDATA_VERSION_ACCEPT = 3,
IGSC_FWDATA_VERSION_OLDER_VCN = 4,
IGSC_FWDATA_VERSION_REJECT_WRONG_FORMAT = 5,
IGSC_FWDATA_VERSION_REJECT_ARB_SVN = 6
};
enum igsc_oprom_type
Which piece of oprom you mean, and they're bit flags so you can stack 'em:
enum igsc_oprom_type {
IGSC_OPROM_NONE = 0,
IGSC_OPROM_DATA = 0x01,
IGSC_OPROM_CODE = 0x02
};
enum igsc_ifr_tiles
enum igsc_ifr_tiles {
IGSC_IFR_TILE_0 = 0x0001,
IGSC_IFR_TILE_1 = 0x0002
};
enum igsc_supported_ifr_tests
Which IFR tests are on the menu:
enum igsc_supported_ifr_tests {
IGSC_IFR_SUPPORTED_TEST_SCAN = 0x00000001,
IGSC_IFR_SUPPORTED_TEST_ARRAY = 0x00000002
};
enum igsc_ifr_repairs
enum igsc_ifr_repairs {
IGSC_IFR_REPAIR_DSS_EN = 0x00000001,
IGSC_IFR_REPAIR_ARRAY = 0x00000002
};
enum igsc_ifr_pending_reset
Is a reset lurking? Shallow or deep, bestie:
enum igsc_ifr_pending_reset {
IGSC_IFR_PENDING_RESET_NONE = 0,
IGSC_IFR_PENDING_RESET_SHALLOW = 1,
IGSC_IFR_PENDING_RESET_DEEP = 2
};
enum igsc_ifr_array_scan_test_status_mask
enum igsc_ifr_array_scan_test_status_mask {
IGSC_ARRAY_SCAN_STATUS_TEST_EXECUTION_MASK = BIT(0),
IGSC_ARRAY_SCAN_STATUS_TEST_RESULT_MASK = BIT(1),
IGSC_ARRAY_SCAN_STATUS_FOUND_HW_ERROR_MASK = BIT(2),
IGSC_ARRAY_SCAN_STATUS_HW_REPAIR_MASK = BIT(3)
};
enum igsc_ifr_array_scan_extended_status
The extended story on your array scan β thirteen whole moods:
enum igsc_ifr_array_scan_extended_status {
IGSC_IFR_EXT_STS_PASSED = 0,
IGSC_IFR_EXT_STS_SHALLOW_RST_PENDING = 1,
IGSC_IFR_EXT_STS_DEEP_RST_PENDING = 2,
IGSC_IFR_EXT_STS_NO_REPAIR_NEEDED = 3,
IGSC_IFR_EXT_STS_REPAIRED_ARRAY = 4,
IGSC_IFR_EXT_STS_REPAIRED_SUBSLICE = 5,
IGSC_IFR_EXT_STS_REPAIRED_ARRAY_SUBSLICE = 6,
IGSC_IFR_EXT_STS_REPAIRED_ARRAY_FAULTY_SUBSLICE = 7,
IGSC_IFR_EXT_STS_REPAIR_NOT_SUPPORTED = 8,
IGSC_IFR_EXT_STS_NO_RESORCES = 9,
IGSC_IFR_EXT_STS_NON_SUBSLICE_IN_ARRAY = 10,
IGSC_IFR_EXT_STS_NON_SUBSLICE_IN_SCAN = 11,
IGSC_IFR_EXT_STS_TEST_ERROR = 12
};
enum igsc_ifr_supported_tests_masks
enum igsc_ifr_supported_tests_masks {
IGSC_IFR_SUPPORTED_TESTS_ARRAY_AND_SCAN = BIT(0),
IGSC_IFR_SUPPORTED_TESTS_MEMORY_PPR = BIT(1)
};
enum igsc_ifr_hw_capabilities_masks
enum igsc_ifr_hw_capabilities_masks {
IGSC_IRF_HW_CAPABILITY_IN_FIELD_REPAIR = BIT(0),
IGSC_IRF_HW_CAPABILITY_FULL_EU_MODE_SWITCH = BIT(1)
};
enum igsc_ifr_previous_errors_masks
Everything that ever went wrong before, as flags. Note the last one is BIT(31), so yeah, it's unexpected π:
enum igsc_ifr_previous_errors_masks {
IGSC_IFR_PREV_ERROR_DSS_ERR_ARR_STS_PKT = BIT(0),
IGSC_IFR_PREV_ERROR_NON_DSS_ERR_ARR_STS_PKT = BIT(1),
IGSC_IFR_PREV_ERROR_DSS_REPAIRABLE_PKT = BIT(2),
IGSC_IFR_PREV_ERROR_DSS_UNREPAIRABLE_PKT = BIT(3),
IGSC_IFR_PREV_ERROR_NON_DSS_REPAIRABLE_PKT = BIT(4),
IGSC_IFR_PREV_ERROR_NON_DSS_UNREPAIRABLE_PKT = BIT(5),
IGSC_IFR_PREV_ERROR_DSS_ERR_SCAN_STS_PKT = BIT(6),
IGSC_IFR_PREV_ERROR_NON_DSS_ERR_SCAN_STS_PKT = BIT(7),
IGSC_IFR_PREV_ERROR_NOT_ENOUGH_SPARE_DSS = BIT(8),
IGSC_IFR_PREV_ERROR_MIS_DSS_STS_PKT_ON_ARR = BIT(9),
IGSC_IFR_PREV_ERROR_MIS_NON_DSS_STS_PKT_ON_ARR = BIT(10),
IGSC_IFR_PREV_ERROR_MIS_DSS_STS_PKT_ON_SCAN = BIT(11),
IGSC_IFR_PREV_ERROR_MIS_NON_DSS_STS_PKT_ON_SCAN = BIT(12),
IGSC_IFR_PREV_ERROR_DSS_ENG_DONE_CLR_IN_ARR = BIT(13),
IGSC_IFR_PREV_ERROR_NON_DSS_ENG_DONE_CLR_IN_ARR = BIT(14),
IGSC_IFR_PREV_ERROR_UNEXPECTED = BIT(31)
};
enum igsc_ifr_repairs_mask
enum igsc_ifr_repairs_mask {
IGSC_IFR_REPAIRS_MASK_DSS_EN_REPAIR = BIT(0),
IGSC_IFR_REPAIRS_MASK_ARRAY_REPAIR = BIT(1),
IGSC_IFR_REPAIRS_MASK_FAILURE = BIT(2)
};
enum igsc_gfsp_health_indicators
Gets memory health indicator. Four possible vibes, from fine to "replace it":
enum igsc_gfsp_health_indicators {
IGSC_HEALTH_INDICATOR_HEALTHY = 0,
IGSC_HEALTH_INDICATOR_DEGRADED = 1,
IGSC_HEALTH_INDICATOR_CRITICAL = 2,
IGSC_HEALTH_INDICATOR_REPLACE = 3
};
enum csc_late_binding_flags
enum csc_late_binding_flags {
CSC_LATE_BINDING_FLAGS_IS_PERSISTENT_MASK = 0x1
};
enum csc_late_binding_type
Sends Late Binding HECI command. Here's the types it can be:
enum csc_late_binding_type {
CSC_LATE_BINDING_TYPE_INVALID = 0,
CSC_LATE_BINDING_TYPE_FAN_TABLE = 1,
CSC_LATE_BINDING_TYPE_VR_CONFIG = 2,
CSC_LATE_BINDING_TYPE_OCODE = 3,
CSC_LATE_BINDING_TYPE_DGDIAG = 4
};
enum csc_late_binding_status
The big one. Every single way a late binding can go, and honestly some of these are rough π. Note that CSC_LATE_BINDING_STATUS_IP_ERROR_START lives way up at 0x80000000:
enum csc_late_binding_status {
CSC_LATE_BINDING_STATUS_SUCCESS = 0,
CSC_LATE_BINDING_STATUS_4ID_MISMATCH = 1,
CSC_LATE_BINDING_STATUS_ARB_FAILURE = 2,
CSC_LATE_BINDING_STATUS_GENERAL_ERROR = 3,
CSC_LATE_BINDING_STATUS_INVALID_PARAMS = 4,
CSC_LATE_BINDING_STATUS_INVALID_SIGNATURE = 5,
CSC_LATE_BINDING_STATUS_INVALID_PAYLOAD = 6,
CSC_LATE_BINDING_STATUS_TIMEOUT = 7,
CSC_LATE_BINDING_STATUS_BUFFER_TOO_SMALL = 8,
CSC_LATE_BINDING_STATUS_INTERNAL_ERROR = 9,
CSC_LATE_BINDING_STATUS_INVALID_FPT_TABLE = 10,
CSC_LATE_BINDING_STATUS_SIGNED_PAYLOAD_VERIFICATION_ERROR = 11,
CSC_LATE_BINDING_STATUS_SIGNED_PAYLOAD_INVALID_CPD = 12,
CSC_LATE_BINDING_STATUS_SIGNED_PAYLOAD_FW_VERSION_MISMATCH = 13,
CSC_LATE_BINDING_STATUS_SIGNED_PAYLOAD_INVALID_MANIFEST = 14,
CSC_LATE_BINDING_STATUS_SIGNED_PAYLOAD_INVALID_HASH = 15,
CSC_LATE_BINDING_STATUS_SIGNED_PAYLOAD_BINDING_TYPE_MISMATCH = 16,
CSC_LATE_BINDING_STATUS_SIGNED_PAYLOAD_HANDLE_SVN_FAILED = 17,
CSC_LATE_BINDING_STATUS_DESTINATION_MBOX_FAILURE = 18,
CSC_LATE_BINDING_STATUS_MISSING_LOADING_PATCH = 19,
CSC_LATE_BINDING_STATUS_INVALID_COMMAND = 20,
CSC_LATE_BINDING_STATUS_INVALID_HECI_HEADER = 21,
CSC_LATE_BINDING_STATUS_IP_ERROR_START = 0x80000000
};
enum csc_late_binding_svn_source
enum csc_late_binding_svn_source {
CSC_LATE_BINDING_SVN_SOURCE_SPI = 0,
CSC_LATE_BINDING_SVN_SOURCE_KEY_MANIFEST = 1
};
enum igsc_ppr_test_status_mask
Last one for this part, and it's all masks so you can combine the tea:
enum igsc_ppr_test_status_mask {
IGSC_PPR_STATUS_TEST_EXECUTED_MASK = 0x1,
IGSC_PPR_STATUS_TEST_SUCCESS_MASK = 0x2,
IGSC_PPR_STATUS_FOUND_HW_ERROR_MASK = 0x4,
IGSC_PPR_STATUS_HW_ERROR_REPAIRED_MASK = 0x8
};
π οΈ Functions π οΈ
okay bestie, here's the whole function list β every single one, no skips, no "etc." π
IGSC_EXPORT void igsc_set_log_level (unsigned int log_level)β sets the log level. yes, you get to choose the verbosity, main character energy ποΈIGSC_EXPORT unsigned int igsc_get_log_level (void)β hands back the log level you're currently vibing at.IGSC_EXPORT uint32_t igsc_get_last_firmware_status (IN struct igsc_device_handle *handle)β returns the last firmware status code. the receipts of what firmware did last π₯IGSC_EXPORT const char * igsc_translate_firmware_status (IN uint32_t firmware_status)β gives you the firmware status message that corresponds to that code. it's giving translator-of-the-group-chat πIGSC_EXPORT int igsc_read_fw_status_reg (IN struct igsc_device_handle *handle, IN uint32_t fwsts_index, OUT uint32_t *fwsts_value)β reads the firmware status register. you hand itfwsts_index, it fills in yourfwsts_valueβ¨IGSC_EXPORT void igsc_set_log_callback_func (IN igsc_log_func_t log_callback_f)β sets the log callback function.
β οΈ bestie, listen to me: this interface is not thread-aware. if a thread in a multi-thread app sets a callback and then dips without setting this call-back function to NULL while another thread from that same app carries on running, you can get crashes. literally not the vibe π
IGSC_EXPORT igsc_log_func_t igsc_get_log_callback_func (void)β retrieves the log callback function pointer. just the pointer, nothing extra π«ΆIGSC_EXPORT int igsc_device_init_by_device (IN OUT struct igsc_device_handle *handle, IN const char *device_path)β initializes a GSC Firmware Update device, usingdevice_path. bestie's entry point πͺint igsc_device_init_by_handle (IN OUT struct igsc_device_handle *handle, IN igsc_handle_t dev_handle)β initializes a GSC Firmware Update device too, but this one's from an existingdev_handleinstead of a path. (yes, notice: noIGSC_EXPORTon this one β that's how it's listed π)IGSC_EXPORT int igsc_device_init_by_device_info (IN OUT struct igsc_device_handle *handle, IN const struct igsc_device_info *dev_info)β initializes a GSC Firmware Update device from adev_infostruct. third flavor of the same slay πIGSC_EXPORT int igsc_device_get_device_info (IN struct igsc_device_handle *handle, OUT struct igsc_device_info *dev_info)β pulls device information from the system and drops it intodev_info.IGSC_EXPORT int igsc_device_update_device_info (IN struct igsc_device_handle *handle, OUT struct igsc_device_info *dev_info)β refreshes device information from the firmware. here's the tea: the subsystem device id and the subsystem vendor id that the PCI system reports may be different from the ones the firmware reports, so you should update the device info with the values coming from the firmware. don't skip this step πIGSC_EXPORT int igsc_device_close (IN OUT struct igsc_device_handle *handle)β closes a GSC Firmware Update device. say bye, be responsible πIGSC_EXPORT int igsc_device_fw_version (IN struct igsc_device_handle *handle, OUT struct igsc_fw_version *version)β retrieves the GSC Firmware Version from the device.IGSC_EXPORT int igsc_image_fw_version (IN const uint8_t *buffer, IN uint32_t buffer_len, OUT struct igsc_fw_version *version)β retrieves the Firmware Version straight out of the firmware update image you provide (that's yourbuffer+buffer_len). no device needed, iconic πΈIGSC_EXPORT int igsc_device_hw_config (IN struct igsc_device_handle *handle, OUT struct igsc_hw_config *hw_config)β retrieves the hardware configuration from the device.IGSC_EXPORT int igsc_device_subsystem_ids (IN struct igsc_device_handle *handle, OUT struct igsc_subsystem_ids *ssids)β retrieves the subsystem ids (vid/did) from the device.IGSC_EXPORT int igsc_image_hw_config (IN const uint8_t *buffer, IN uint32_t buffer_len, OUT struct igsc_hw_config *hw_config)β retrieves the hardware configurations from the firmware update image you pass in.IGSC_EXPORT int igsc_hw_config_compatible (IN const struct igsc_hw_config *image_hw_config, IN const struct igsc_hw_config *device_hw_config)β checks whether the image hardware configuration is compatible with the device hardware configuration. vibe check, but for hardware βIGSC_EXPORT int igsc_hw_config_to_string (IN const struct igsc_hw_config *hw_config, IN char *buf, IN size_t length)β expresses the hardware configuration as a string in yourbufoflength.IGSC_EXPORT int igsc_device_fw_update (IN struct igsc_device_handle *handle, IN const uint8_t *buffer, IN const uint32_t buffer_len, IN igsc_progress_func_t progress_f, IN void *ctx)β performs the firmware update from the firmware update image you provide. you get aprogress_fprogress callback and actxto go with it π₯IGSC_EXPORT int igsc_device_fw_update_ex (IN struct igsc_device_handle *handle, IN const uint8_t *buffer, IN const uint32_t buffer_len, IN igsc_progress_func_t progress_f, IN void *ctx, IN struct igsc_fw_update_flags flags)β same firmware update from the image, but withflags. the deluxe version πIGSC_EXPORT int igsc_iaf_psc_update (IN struct igsc_device_handle *handle, IN const uint8_t *buffer, IN const uint32_t buffer_len, IN igsc_progress_func_t progress_f, IN void *ctx)β performs the Intel Accelerator Fabric Platform Specific Configuration (PSC) update from the update data image you provide.IGSC_EXPORT int igsc_device_fwdata_update (IN struct igsc_device_handle *handle, IN const uint8_t *buffer, IN const uint32_t buffer_len, IN igsc_progress_func_t progress_f, IN void *ctx)β performs the GSC firmware in-field data update from the firmware update image you provide.IGSC_EXPORT int igsc_device_fwdata_image_update (IN struct igsc_device_handle *handle, IN struct igsc_fwdata_image *img, IN igsc_progress_func_t progress_f, IN void *ctx)β performs the GSC firmware in-field data update from the firmware update image β this one takes the already-initializedimghandle instead of a raw buffer π¦IGSC_EXPORT int igsc_image_fwdata_init (IN OUT struct igsc_fwdata_image **img, IN const uint8_t *buffer, IN uint32_t buffer_len)β initializes a firmware data image handle from the firmware data update image you supply.IGSC_EXPORT int igsc_device_fwdata_version (IN struct igsc_device_handle *handle, OUT struct igsc_fwdata_version *version)β retrieves the GSC in-field data Firmware Version from the device.IGSC_EXPORT int igsc_device_fwdata_version2 (IN struct igsc_device_handle *handle, OUT struct igsc_fwdata_version2 *version)β retrieves the GSC in-field data Firmware Version from the device, with the ability to return the FW Data version in the second version format. glow-up edition β¨IGSC_EXPORT int igsc_image_fwdata_version (IN struct igsc_fwdata_image *img, OUT struct igsc_fwdata_version *version)β retrieves the GSC in-field data Firmware version from the GSC in-field data Firmware update image you supplied.IGSC_EXPORT int igsc_image_fwdata_version2 (IN struct igsc_fwdata_image *img, OUT struct igsc_fwdata_version2 *version)β retrieves the GSC in-field data Firmware version from the supplied GSC in-field data Firmware update image, with the ability to return the FW Data version in the second version format. okay format-two icon πIGSC_EXPORT uint8_t igsc_fwdata_version_compare (IN struct igsc_fwdata_version *image_ver, IN struct igsc_fwdata_version *device_ver)β compares the input GSC in-field data firmware update version against the flash one, with the ability to compare the FW Data version in the second version format.IGSC_EXPORT uint8_t igsc_fwdata_version_compare2 (IN struct igsc_fwdata_version2 *image_ver, IN struct igsc_fwdata_version2 *device_ver)β compares the input GSC in-field data firmware update version to the flash one.IGSC_EXPORT int igsc_image_fwdata_count_devices (IN struct igsc_fwdata_image *img, OUT uint32_t *count)β retrieves a count of the different devices supported by the GSC in-field data firmware update image associated with the handle.IGSC_EXPORT int igsc_image_fwdata_supported_devices (IN struct igsc_fwdata_image *img, OUT struct igsc_fwdata_device_info *devices, IN OUT uint32_t *count)β retrieves the list of devices supported by the GSC in-field data firmware update image associated with the handle. you (the caller) bring the allocated bufferdevices, sizedcount, and the function givescountback filled with however many devices it actually returned. bring your own bowl, basically πIGSC_EXPORT int igsc_image_fwdata_match_device (IN struct igsc_fwdata_image *img, IN struct igsc_device_info *device)β checks whether that GSC in-field data firmware image can actually be applied on the device.IGSC_EXPORT int igsc_image_fwdata_iterator_reset (IN struct igsc_fwdata_image *img)β resets the iterator over the supported devices. back to the top, bestie πIGSC_EXPORT int igsc_image_fwdata_iterator_next (IN struct igsc_fwdata_image *img, OUT struct igsc_fwdata_device_info *device)β advances the supported device iterator and returns the GSC in-field data firmware device info indevice.IGSC_EXPORT int igsc_image_fwdata_release (IN struct igsc_fwdata_image *img)β releases the fwdata image handle. clean up after yourself, we love a tidy queen π§Ή
IGSC_EXPORT uint8_t igsc_fw_version_compare (IN struct igsc_fw_version *image_ver, IN struct igsc_fw_version *device_ver)β compares the input firmware version to the flash one.IGSC_EXPORT int igsc_device_oprom_version (IN struct igsc_device_handle *handle, IN uint32_t oprom_type, OUT struct igsc_oprom_version *version)β retrieves the GSC OPROM version from the device. note theoprom_typegoing in πIGSC_EXPORT int igsc_device_oprom_update (IN struct igsc_device_handle *handle, IN uint32_t oprom_type, IN struct igsc_oprom_image *img, IN igsc_progress_func_t progress_f, IN void *ctx)β performs the OPROM update from the image you provide, with yourprogress_fcallback andctx.IGSC_EXPORT int igsc_image_oprom_init (IN OUT struct igsc_oprom_image **img, IN const uint8_t *buffer, IN uint32_t buffer_len)β initializes an OPROM image handle from the OPROM update image you supply.IGSC_EXPORT int igsc_image_oprom_version (IN struct igsc_oprom_image *img, IN enum igsc_oprom_type type, OUT struct igsc_oprom_version *version)β retrieves the OPROM version from the OPROM update image you supplied. yes, this one takesenum igsc_oprom_type typeand the device one takesuint32_t oprom_typeβ they're different, don't @ me πIGSC_EXPORT int igsc_image_oprom_type (IN struct igsc_oprom_image *img, IN uint32_t *oprom_type)β retrieves the OPROM type from the OPROM update image you provided.IGSC_EXPORT int igsc_image_oprom_count_devices (IN struct igsc_oprom_image *img, OUT uint32_t *count)β retrieves a count of the different devices supported by the OPROM update image associated with the handle.IGSC_EXPORT int igsc_image_oprom_supported_devices (IN struct igsc_oprom_image *img, OUT struct igsc_oprom_device_info *devices, IN OUT uint32_t *count)β retrieves the list of devices supported by the OPROM update image associated with the handle. again: you supply the allocateddevicesbuffer ofcountsize, and it returnscountfilled with the devices it actually returned πIGSC_EXPORT int igsc_image_oprom_match_device (IN struct igsc_oprom_image *img, IN enum igsc_oprom_type request_type, IN struct igsc_device_info *device)β checks whether the OPROM image can be applied on the device.IGSC_EXPORT int igsc_image_oprom_iterator_reset (IN struct igsc_oprom_image *img)β resets the iterator over the supported devices.IGSC_EXPORT int igsc_image_oprom_iterator_next (IN struct igsc_oprom_image *img, OUT struct igsc_oprom_device_info *device)βIGSC_EXPORT int igsc_image_oprom_count_devices_typed (IN struct igsc_oprom_image *img, IN uint32_t request_type, OUT uint32_t *count)β gives you the count of the different devices the OPROM update image (the one tied to that handle) supports, filtered by request_type. iykyk πIGSC_EXPORT int igsc_image_oprom_supported_devices_typed (IN struct igsc_oprom_image *img, IN uint32_t request_type, OUT struct igsc_oprom_device_info_4ids *devices, IN OUT uint32_t *count)β same deal but it actually hands you the list, based on image type. π You bring the memory: devices is a buffer you allocate, sized count. When it comes back, count is filled with the number of devices it actually returned. slay.IGSC_EXPORT int igsc_image_oprom_iterator_reset_typed (IN struct igsc_oprom_image *img, IN uint32_t request_type)β rewinds the iterator over supported devices, based on image type. back to the start bestie β¨IGSC_EXPORT int igsc_image_oprom_iterator_next_typed (IN struct igsc_oprom_image *img, IN uint32_t request_type, OUT struct igsc_oprom_device_info_4ids *device)β bumps the iterator forward and drops the next oprom device info into device, based on image type. π₯IGSC_EXPORT int igsc_image_oprom_has_4ids_extension (IN struct igsc_oprom_image *img, IN uint32_t request_type, OUT bool *has_4ids_extension)β tells you whether the oprom image has the 4ids device extension. yes/no, that's it π¦IGSC_EXPORT int igsc_image_oprom_has_2ids_extension (IN struct igsc_oprom_image *img, OUT bool *has_2ids_extension)β same vibe check but for the 2ids device extension. (note: no request_type on this one, she's built different π )IGSC_EXPORT int igsc_image_oprom_code_devid_enforced (IN struct igsc_hw_config *hw_config, OUT bool *devid_enforced)β tells you if the oprom code config has the devId enforcement bit set. βIGSC_EXPORT int igsc_image_oprom_release (IN struct igsc_oprom_image *img)β releases the OPROM image handle. bye bye, free your stuff π«ΆIGSC_EXPORT uint8_t igsc_oprom_version_compare (const struct igsc_oprom_version *image_ver, const struct igsc_oprom_version *device_ver)β compares the input oprom version against the one in flash. returns auint8_tnot anint, look at her πIGSC_EXPORT int igsc_image_get_type (IN const uint8_t *buffer, IN const uint32_t buffer_len, OUT uint8_t *type)β figures out what type the image in buffer (length buffer_len) actually is. detective era πβ¨IGSC_EXPORT int igsc_device_iterator_create (struct igsc_device_iterator **iter)β creates an iterator over the devices that can do FW update. main character energy πIGSC_EXPORT int igsc_device_iterator_next (struct igsc_device_iterator *iter, struct igsc_device_info *info)β grabs the next FW-update-capable device. one at a time, no cap πIGSC_EXPORT void igsc_device_iterator_destroy (struct igsc_device_iterator *iter)β frees the iterator. it'svoid, it doesn't report back, it just does the thing πIGSC_EXPORT int igsc_gfsp_count_tiles (IN struct igsc_device_handle *handle, OUT uint32_t *max_num_of_tiles)β gets the number of tiles.IGSC_EXPORT int igsc_gfsp_memory_errors (IN struct igsc_device_handle *handle, IN OUT struct igsc_gfsp_mem_err *tiles)β gets the GFSP number of memory errors. πIGSC_EXPORT int igsc_ifr_run_array_scan_test (IN struct igsc_device_handle *handle, OUT uint32_t *status, OUT uint32_t *extended_status, OUT uint32_t *pending_reset, OUT uint32_t *error_code)β runs the IFR Array and Scan tests on a GSC IFR device. four outs, she's thorough β¨IGSC_EXPORT int igsc_ifr_run_mem_ppr_test (IN struct igsc_device_handle *handle, OUT uint32_t *status, OUT uint32_t *pending_reset, OUT uint32_t *error_code)β runs the IFR memory Post Package Repair (PPR) test on a GSC IFR device. π§IGSC_EXPORT int igsc_ifr_get_status_ext (IN struct igsc_device_handle *handle, OUT uint32_t *supported_tests, OUT uint32_t *hw_capabilities, OUT uint32_t *ifr_applied, OUT uint32_t *prev_errors, OUT uint32_t *pending_reset)β pulls the status of the GSC IFR device. the extended cut πIGSC_EXPORT int igsc_ifr_count_tiles (IN struct igsc_device_handle *handle, OUT uint16_t *supported_tiles)β counts the IFR supported tiles. note theuint16_t, notuint32_t, okurrr βIGSC_EXPORT int igsc_ifr_get_tile_repair_info (IN struct igsc_device_handle *handle, IN uint16_t tile_idx, OUT uint16_t *used_array_repair_entries, OUT uint16_t *available_array_repair_entries, OUT uint16_t *failed_dss)β grabs the IFR repair info for tile tile_idx. π§IGSC_EXPORT int igsc_ecc_config_set (IN struct igsc_device_handle *handle, IN uint8_t req_ecc_state, OUT uint8_t *cur_ecc_state, OUT uint8_t *pen_ecc_state)β set ECC Configuration. you ask for req_ecc_state, you get back the current and pending states. πIGSC_EXPORT int igsc_ecc_config_get (IN struct igsc_device_handle *handle, OUT uint8_t *cur_ecc_state, OUT uint8_t *pen_ecc_state)β get ECC Configuration. just looking, no touching πIGSC_EXPORT int igsc_device_oem_version (IN struct igsc_device_handle *handle, OUT struct igsc_oem_version *version)β retrieves the OEM Version from the device. πIGSC_EXPORT int igsc_device_oem_serial_number (IN struct igsc_device_handle *handle, OUT struct igsc_oem_serial_number *sn)β retrieves the OEM serial number from the device. π¦IGSC_EXPORT int igsc_device_ifr_bin_version (IN struct igsc_device_handle *handle, OUT struct igsc_ifr_bin_version *version)β retrieves the IFR Binary Version from the device. β¨IGSC_EXPORT int igsc_device_psc_version (IN struct igsc_device_handle *handle, OUT struct igsc_psc_version *version)β retrieves the PSC Version from the device. πΈIGSC_EXPORT int igsc_gfsp_get_health_indicator (IN struct igsc_device_handle *handle, OUT uint8_t *health_indicator)β (no blurb in the original, she just exists. iconic.) πIGSC_EXPORT int igsc_gfsp_heci_cmd (struct igsc_device_handle *handle, uint32_t gfsp_cmd, uint8_t *in_buffer, size_t in_buffer_size, uint8_t *out_buffer, size_t out_buffer_size, size_t *actual_out_buffer_size)β sends a generic GFSP command and receives the response. everything issize_t-sized and accounted for, ngl that's hot π₯IGSC_EXPORT int igsc_device_update_late_binding_config (IN struct igsc_device_handle *handle, IN uint32_t type, IN uint32_t flags, IN uint8_t *payload, IN size_t payload_size, OUT uint32_t *status)β (no description in the original β keep it moving bestie) πIGSC_EXPORT int igsc_device_update_late_binding_config2 (IN struct igsc_device_handle *handle, IN uint32_t type, IN uint32_t flags, IN uint8_t *payload, IN size_t payload_size, OUT uint32_t *status)β the sequel. same params, a2on the name. don't ask, just vibe πIGSC_EXPORT int igsc_device_get_late_binding_info (IN struct igsc_device_handle *handle, IN uint32_t type, OUT uint32_t *svn_source, OUT uint32_t *min_svn, OUT uint32_t *status)β (also no blurb, she's mysterious) π¦IGSC_EXPORT int igsc_device_commit_arb_svn (IN struct igsc_device_handle *handle, uint8_t *fw_error)β sends the ARB SVN Commit HECI command. πIGSC_EXPORT int igsc_device_get_min_allowed_arb_svn (IN struct igsc_device_handle *handle, OUT uint8_t *min_allowed_svn)β retrieves the Minimal allowed ARB SVN. βIGSC_EXPORT int igsc_memory_ppr_devices (IN struct igsc_device_handle *handle, OUT uint32_t *device_count)β retrieves the GFSP number of memory PPR devices. πIGSC_EXPORT int igsc_memory_ppr_status (IN struct igsc_device_handle *handle, OUT struct igsc_ppr_status *ppr_status)β retrieves the GFSP memory PPR status structure data. πIGSC_EXPORT void igsc_library_version (uint32_t *major, uint32_t *minor, uint32_t *patch, uint32_t *build)β returns the library version into major, minor, patch, build. nointreturn, it'svoid, it just delivers π
π IGSC_IFR_RUN_TEST_STATUSES π
The IFR Run Test Command Statuses. the whole mood board of how a test run can go β¨
enum ifr_test_run_status { IFR_TEST_STATUS_SUCCESS = 0,
IFR_TEST_STATUS_PASSED_WITH_REPAIR,
IFR_TEST_STATUS_PASSED_WITH_RECOVERY,
IFR_TEST_STATUS_SUBSLICE_FAILURE,
IFR_TEST_STATUS_NON_SUBSLICE_FAILURE, IFR_TEST_STATUS_ERROR }
IGSC_EXPORT int igsc_ifr_get_status (IN struct igsc_device_handle *handle, OUT uint8_t *result, OUT uint32_t *supported_tests, OUT uint32_t *ifr_applied, OUT uint8_t *tiles_num)β retrieves the status of the GSC IFR device. the classic version, not the_extone πIGSC_EXPORT int igsc_ifr_run_test (IN struct igsc_device_handle *handle, IN uint8_t test_type, IN uint8_t tiles, OUT uint8_t *result, OUT uint8_t *run_status, OUT uint32_t *error_code)β runs an IFR test on a GSC IFR device. you pick test_type and tiles, it gives you result, run_status and error_code. go off π₯
π« Detailed Description π«
Intel Graphics System Controller Library API. that's her. that's the whole thing π«Ά
Definition in file igsc_lib.h.
π¦ Data Structure Documentation π¦
struct igsc_fw_version
Structure to store fw version data. πΎ
Definition at line 125 of file igsc_lib.h.
Data Fields:
uint16_t buildβ FW Build Numberuint16_t hotfixβ FW Hotfix Numberchar project[4]β Project code name
struct igsc_ifr_bin_version
Structure to store ifr binary version data. π§
Definition at line 134 of file igsc_lib.h.
Data Fields:
uint16_t buildβ IFR Binary Build Numberuint16_t hotfixβ IFR Binary Hotfix Numberuint16_t majorβ IFR Binary Major Numberuint16_t minorβ IFR Binary Minor Number
struct igsc_psc_version
Structure to store psc version data. πΈ
Definition at line 144 of file igsc_lib.h.
Data Fields:
uint32_t cfg_versionβ PSC configuration versionuint32_t dateβ PSC date
struct igsc_oem_version
Structure to store oem version data. π
Definition at line 154 of file igsc_lib.h.
Data Fields:
uint16_t lengthβ actual OEM version lengthuint8_t version[IGSC_MAX_OEM_VERSION_LENGTH]β buffer to store oem version
struct igsc_oem_serial_number
Structure to store oem serial number. π¦
Definition at line 164 of file igsc_lib.h.
Data Fields:
uint16_t lengthβ actual OEM serial number lengthuint8_t sn[IGSC_MAX_OEM_SN_LENGTH]β buffer to store the oem serial number
struct igsc_fwdata_version
Structure to store OEM manufacturing data version and data major VCN for GSC in-field data firmware update image. β¨
Definition at line 197 of file igsc_lib.h.
Data Fields:
uint16_t major_vcnβ GSC in-field data firmware major VCNuint16_t major_versionβ GSC in-field data firmware major versionuint32_t oem_manuf_data_versionβ GSC in-field data firmware OEM manufacturing data version
struct igsc_fwdata_version2
Structure to store versions for GSC in-field data firmware update image (version 2). she got an upgrade π
Definition at line 212 of file igsc_lib.h.
Data Fields:
uint32_t data_arb_svnβ GSC in-field data firmware SVNuint32_t data_arb_svn_fitbβ GSC in-field data firmware SVN from FITBuint32_t flagsβ GSC in-field data firmware flagsuint32_t format_versionβ GSC in-field data firmware version formatuint16_t major_vcnβ GSC in-field data firmware major VCNuint16_t major_versionβ GSC in-field data firmware major versionuint32_t oem_manuf_data_versionβ GSC in-field data firmware OEM manufacturing data versionuint32_t oem_manuf_data_version_fitbβ GSC in-field data firmware OEM manufacturing data version from FITB
lowkey this struct list goes so hard, but we're not done yet β there's more coming in the next part, don't touch that dial bestie π«Άβ¨
π struct igsc_oprom_version
A cute little container for OPROM version data. Defined at line 230 of file igsc_lib.h.
Data Fields:
uint8_t version[IGSC_OPROM_VER_SIZE]β the OPROM Version string, bestie.
πΈ struct igsc_oprom_device_info
This one holds the subsystem vendor and device id that the OPROM image supports, as defined by PCI. Defined at line 247 of file igsc_lib.h.
Data Fields:
uint16_t subsys_device_idβ subsystem device id.uint16_t subsys_vendor_idβ subsystem vendor id.
π¦ struct igsc_oprom_device_info_4ids
Vendor and device id, plus subsystem vendor and device id, supported by the GSC in-field data firmware update image, as defined by PCI. Defined at line 256 of file igsc_lib.h.
Data Fields:
uint16_t device_idβ device id.uint16_t subsys_device_idβ subsystem device id.uint16_t subsys_vendor_idβ subsystem vendor id.uint16_t vendor_idβ vendor id.
π struct igsc_fwdata_device_info
Same vibe as the 4ids struct: vendor and device id, subsystem vendor and device id supported by the GSC in-field data firmware update image, as defined by PCI. Defined at line 267 of file igsc_lib.h.
Data Fields:
uint16_t device_idβ device id.uint16_t subsys_device_idβ subsystem device id.uint16_t subsys_vendor_idβ subsystem vendor id.uint16_t vendor_idβ vendor id.
π struct igsc_device_info
The main-character struct for storing GSC device info. Defined at line 300 of file igsc_lib.h.
Data Fields:
uint8_t busβ pci bus number for GFX device.uint8_t devβ device number on pci bus.uint16_t device_idβ gfx device id.uint16_t domainβ pci domain for GFX device.uint8_t funcβ device function number.char name[IGSC_INFO_NAME_SIZE]β the device node path.uint16_t subsys_device_idβ gfx device subsystem device id.uint16_t subsys_vendor_idβ gfx device subsystem vendor id.uint16_t vendor_idβ gfx device vendor id.
π Macro Definition Documentation
Okay bestie, macro time. These are all up in igsc_lib.h, and Iβm keeping the line numbers because receipts are iconic. π
#define BIT( x)β value:
(1U << (x))
Definition at line 59 of file igsc_lib.h.
#define IGSC_FWDATA_FITB_VALID_MASK 0x1β definition at line 206 of fileigsc_lib.h.#define IGSC_FWDATA_FORMAT_VERSION_1 0x1β definition at line 203 of fileigsc_lib.h.#define IGSC_FWDATA_FORMAT_VERSION_2 0x2β definition at line 204 of fileigsc_lib.h.#define IGSC_INFO_NAME_SIZE 256β a device node path (Linux) or device instance path (Windows) Length. Definition at line 295 of fileigsc_lib.h.#define IGSC_INVALID_DEVICE_HANDLE ((void *)0)β definition at line 79 of fileigsc_lib.h.#define IGSC_LIBRARY_VERSION_BUILD (0)β definition at line 56 of fileigsc_lib.h.#define IGSC_LIBRARY_VERSION_MAJOR (1)β definition at line 53 of fileigsc_lib.h.#define IGSC_LIBRARY_VERSION_MINOR (3)β definition at line 54 of fileigsc_lib.h.#define IGSC_LIBRARY_VERSION_PATCH (1)β definition at line 55 of fileigsc_lib.h.#define IGSC_MAX_OEM_SN_LENGTH 512β definition at line 159 of fileigsc_lib.h.#define IGSC_MAX_OEM_VERSION_LENGTH 256β definition at line 149 of fileigsc_lib.h.#define IGSC_OPROM_VER_SIZE 8β OPROM partition version size in bytes. Definition at line 226 of fileigsc_lib.h.#define UNUSED_VAR( _v)β value:
(void)_v
Definition at line 63 of file igsc_lib.h.
π¦ Typedef Documentation
typedef void* igsc_handle_tβ a file descriptor. Under Linux: file descriptorint fd = open(2). Under Windows:HANDLE handle = CreateFile(). Definition at line 78 of fileigsc_lib.h.
π₯ Enumeration Type Documentation
π enum igsc_fwdata_version_compare_result
fwdata versions comparison results. Definition at line 183 of file igsc_lib.h.
Enumerator:
IGSC_FWDATA_VERSION_REJECT_VCNβ VCN version is bigger than device VCN.IGSC_FWDATA_VERSION_REJECT_OEM_MANUF_DATA_VERSIONβ OEM manufacturing data version is not bigger than device OEM version, or equal in ver2 comparison.IGSC_FWDATA_VERSION_REJECT_DIFFERENT_PROJECTβ major version is different from device major version.IGSC_FWDATA_VERSION_ACCEPTβ update image VCN version is equal to the one on the device, and OEM is bigger.IGSC_FWDATA_VERSION_OLDER_VCNβ update image VCN version is smaller than the one on the device.IGSC_FWDATA_VERSION_REJECT_WRONG_FORMATβ the version format is the wrong one or incompatible.IGSC_FWDATA_VERSION_REJECT_ARB_SVNβ update image SVN version is smaller than the one on the device.
π enum igsc_image_type
Types of supported update images. Definition at line 113 of file igsc_lib.h.
Enumerator:
IGSC_IMAGE_TYPE_UNKNOWNβ Unknown image type.IGSC_IMAGE_TYPE_GFX_FWβ GSC Firmware image.IGSC_IMAGE_TYPE_OPROMβ OPROM CODA an DATA combined image.IGSC_IMAGE_TYPE_OPROM_CODEβ OPROM code image.IGSC_IMAGE_TYPE_OPROM_DATAβ OPROM data image.IGSC_IMAGE_TYPE_FW_DATAβ firmware data image.
β¨ enum igsc_log_level_type
Types of supported log levels. Definition at line 85 of file igsc_lib.h.
Enumerator:
IGSC_LOG_LEVEL_ERRORβ Errors only.IGSC_LOG_LEVEL_DEBUGβ Debug messages and errors.IGSC_LOG_LEVEL_TRACEβ Trace, debug messages and errors.IGSC_LOG_LEVEL_MAXβ Upper boundary.
π enum igsc_oprom_type
OPROM partition type. Definition at line 237 of file igsc_lib.h.
Enumerator:
IGSC_OPROM_NONEβ OPROM INVALID PARTITION.IGSC_OPROM_DATAβ OPROM data (VBT).IGSC_OPROM_CODEβ OPROM code (VBIOS and GOP).
π« enum igsc_version_compare_result
Versions comparison results. Definition at line 172 of file igsc_lib.h.
Enumerator:
IGSC_VERSION_ERRORβ An internal error during comparison.IGSC_VERSION_NOT_COMPATIBLEβ cannot compare, the update image is for a different platform.IGSC_VERSION_NEWERβ update image version is newer than the one on the device.IGSC_VERSION_EQUALβ update image version is equal to the one on the device.IGSC_VERSION_OLDERβ update image version is older than the one on the device.
π«Ά Function Documentation
π
IGSC_EXPORT unsigned int igsc_get_log_level (void )
Retrieves current log level.
Returns: current log level.
πΈ IGSC_EXPORT void igsc_set_log_level (unsigned int log_level)
Sets log level.
Parameters:
log_levelβ log level to set.
Returns: void.
π Author
Generated automatically by Doxygen for Intel Graphics System Controller Firmware Update Library from the source code.
Okay bestie, sign-off time π this pageβs source/version + date footer energy is Intel Graphics System Controller Firmware Update Libraigsc_lib.h(3) β iconic, slightly chaotic, and very much the end. Mwah πβ¨
π¦ where this page comes from
- epel 10: intel-gsc-devel 1.3.1-1.el10_3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms