Advanced LAN Bypass User Manual 32These header files (cf. Section 3.4) provide the following macros, which are used atdifferent FW upgrade stages:3.7.6.3 lbp_err lbp_upgrade_fw(int segment, char *image_file)Upgrades the LAN Bypass MCU FW.A character pointer (parameter image_file) is used to specify the image file name(with the file path). For example, a user application may perform a FW upgrade onSegment 1 by using the following function call:lbp_upgrade_fw(1, "./lbp_fw_RU_00_22.bin")The file operation will be performed internally in the function.Returns 0 on success or the following error codes in the event of an error:3.7.7 LBP Reset MonitoringOn standard x86 platforms, a reset signal may be triggered by system componentsduring system booting. This action may be taken by BIOS or by the chipset to recon-figure the PCIe bus. As such, LAN Bypass MCU will treat this reset as a new eventand will perform the defined action for a POWER RESET event.However, it may cause unexpected and undesirable behavior. For example, when thesystem is powered on, the last event should be POWER ON when the system boots/* Macros for Upgrade MODE */#define lbp_is_in_ap(x) ((x & 0x10) == 0x10) //FW is running in application model, not in upgrade mode#define lbp_is_in_bootloader(x) ((x & 0x20) == 0x20) //FW is running in upgrade mode#define lbp_is_bl_idle(x) ((x & 0x2f) == 0x20) //FW upgrade process is started#define lbp_is_bl_write_complete(x) ((x & 0x2f) == 0x21) //FW upgrade is on going#define lbp_is_bl_flash_error(x) ((x & 0x2f) == 0x22) //FW upgrade fails#define lbp_is_bl_wrong_data_format(x) ((x & 0x2f) == 0x23) //Fail to receive upgrade image fileTable 3.26: API Function "lbp_upgrade_fw" Error CodesName Error CodeLBP_ERR_OPEN_FILE 0x80LBP_ERR_INTERFACE_OPEN 0x89LBP_ERR_FW_NRDY 0x8ALBP_ERR_FW_CS 0x8BLBP_ERR_DATA_FORMAT 0x8CLBP_ERR_GET_FW_MODE 0x8DLBP_ERR_UNLOCK_FLASH 0x8ELBP_ERR_SWITCH_TO_BOOTLOADER 0x8FLBP_ERR_START_TRANSFER 0x90LBP_ERR_SWITCH_TO_APP 0x91LBP_ERR_COMMUNICATION 0x92LBP_ERR_PARAM_OUT_OF_BOUND 0x93LBP_ERR_PARAM_NULL_POINTER 0x94LBP_ERR_LBP_INIT 0x95