/****************************************************************** ****************************************************************** *** ** *** (C)Copyright 2011, American Megatrends Inc. ** *** ** *** All Rights Reserved. ** *** ** *** 5555 , Oakbrook Pkwy, Norcross, ** *** ** *** Georgia - 30093, USA. Phone-(770)-246-8600. ** *** ** ****************************************************************** ****************************************************************** ****************************************************************** * * cmdselect.c * OEM can enable or disable IPMI Command accoring to requirements * * Author: Winston ******************************************************************/ #include "Types.h" //#include "Debug.h" #include "IPMI_App.h" #include "IPMI_Chassis.h" #include "IPMI_Bridge.h" #include "IPMI_SensorEvent.h" #include "IPMI_Storage.h" #include "IPMI_DeviceConfig.h" #include "IPMI_AMI.h" #include "IPMIDefs.h" //#include "IPMI_OPMA.h" //#include "Apml.h" //#include "Pnm.h" //#include "IPMI_GroupExtn.h" #include "cmdselect.h" //#include "IPMIConf.h" #include "IPMI_Oem.h" #include "bmc_main.h" const NetFnCmds_T g_App [] = { /* IPM Device Commands */ {CMD_GET_DEV_ID , ENABLED}, {CMD_BROADCAST_GET_DEV_ID ,DISABLED}, {CMD_COLD_RESET ,ENABLED}, {CMD_WARM_RESET ,ENABLED}, {CMD_GET_SELF_TEST_RESULTS ,ENABLED}, {CMD_MFG_TEST_ON ,ENABLED}, {CMD_SET_ACPI_PWR_STATE ,ENABLED}, {CMD_GET_ACPI_PWR_STATE ,ENABLED}, {CMD_GET_DEV_GUID ,ENABLED}, {CMD_GET_NETFN_SUP ,ENABLED}, {CMD_GET_CMD_SUP ,ENABLED}, {CMD_GET_SUBFN_SUP ,DISABLED}, {CMD_GET_CONFIG_CMDS ,ENABLED}, {CMD_GET_CONFIG_SUB_FNS ,DISABLED}, {CMD_SET_CMD_ENABLES ,ENABLED}, {CMD_GET_CMD_ENABLES ,ENABLED}, {CMD_SET_SUBFN_ENABLES ,DISABLED}, {CMD_GET_SUBFN_ENABLES ,DISABLED}, {CMD_GET_OEM_NETFN_IANA_SUPPORT ,ENABLED}, /* WatchDog Timer Commands */ {CMD_RESET_WDT ,ENABLED}, {CMD_SET_WDT ,ENABLED}, {CMD_GET_WDT ,ENABLED}, /* BMC Device and Messaging Commands */ { CMD_SET_BMC_GBL_ENABLES ,ENABLED}, { CMD_GET_BMC_GBL_ENABLES ,ENABLED}, { CMD_CLR_MSG_FLAGS ,ENABLED}, { CMD_GET_MSG_FLAGS ,ENABLED}, { CMD_ENBL_MSG_CH_RCV ,ENABLED}, { CMD_GET_MSG ,ENABLED}, { CMD_SEND_MSG ,ENABLED}, { CMD_READ_EVT_MSG_BUFFER ,ENABLED}, { CMD_GET_BTIFC_CAP ,ENABLED}, { CMD_GET_SYSTEM_GUID ,ENABLED}, { CMD_GET_CH_AUTH_CAP ,ENABLED}, { CMD_GET_SESSION_CHALLENGE ,ENABLED}, { CMD_ACTIVATE_SESSION ,ENABLED}, { CMD_SET_SESSION_PRIV_LEVEL ,ENABLED}, { CMD_CLOSE_SESSION ,ENABLED}, { CMD_GET_SESSION_INFO ,ENABLED}, { CMD_GET_AUTH_CODE ,ENABLED}, { CMD_SET_CH_ACCESS ,ENABLED}, { CMD_GET_CH_ACCESS ,ENABLED}, { CMD_GET_CH_INFO ,ENABLED}, { CMD_SET_USER_ACCESS ,ENABLED}, { CMD_GET_USER_ACCESS ,ENABLED}, { CMD_SET_USER_NAME ,ENABLED}, { CMD_GET_USER_NAME ,ENABLED}, { CMD_SET_USER_PASSWORD ,ENABLED}, { CMD_MASTER_WRITE_READ ,ENABLED}, { CMD_SET_SYSTEM_INFO_PARAM ,ENABLED}, { CMD_GET_SYSTEM_INFO_PARAM ,ENABLED}, /*------------------------ IPMI 2.0 specific Commands ------------------*/ // { CMD_ACTIVATE_PAYLOAD ,ENABLED}, // { CMD_DEACTIVATE_PAYLOAD ,ENABLED}, // { CMD_GET_PAYLD_ACT_STATUS ,ENABLED}, // { CMD_GET_PAYLD_INST_INFO ,ENABLED}, // { CMD_SET_USR_PAYLOAD_ACCESS ,ENABLED}, // { CMD_GET_USR_PAYLOAD_ACCESS ,ENABLED}, // { CMD_GET_CH_PAYLOAD_SUPPORT ,ENABLED}, // { CMD_GET_CH_PAYLOAD_VER ,ENABLED}, // { CMD_GET_CH_OEM_PAYLOAD_INFO ,ENABLED}, // { CMD_GET_CH_CIPHER_SUITES ,ENABLED}, // { CMD_SUS_RES_PAYLOAD_ENCRYPT ,ENABLED}, // { CMD_SET_CH_SECURITY_KEYS ,ENABLED}, // { CMD_GET_SYS_IFC_CAPS ,ENABLED}, {0 ,0 }, }; const NetFnCmds_T g_Chassis [] = { /*--------------------- Chassis Commands ---------------------------------*/ // { CMD_GET_CHASSIS_CAPABILITIES ,ENABLED}, // { CMD_GET_CHASSIS_STATUS ,ENABLED}, // { CMD_CHASSIS_CONTROL ,ENABLED}, // { CMD_CHASSIS_RESET ,DISABLED}, // { CMD_CHASSIS_IDENTIFY ,ENABLED}, // { CMD_SET_CHASSIS_CAPABILITIES ,ENABLED}, // { CMD_SET_POWER_RESTORE_POLICY ,ENABLED}, // { CMD_GET_SYSTEM_RESTART_CAUSE ,ENABLED}, // { CMD_SET_SYSTEM_BOOT_OPTIONS ,ENABLED}, // { CMD_GET_SYSTEM_BOOT_OPTIONS ,ENABLED}, // { CMD_GET_POH_COUNTER ,ENABLED}, // { CMD_SET_FP_BTN_ENABLES ,ENABLED}, // { CMD_SET_POWER_CYCLE_INTERVAL ,ENABLED}, {0, 0 } }; const NetFnCmds_T g_Bridge [] = { /*----------------------- Bridge Management Commands --------------------------------*/ { CMD_GET_BRIDGE_STATE ,ENABLED}, { CMD_SET_BRIDGE_STATE ,ENABLED}, { CMD_GET_ICMB_ADDR ,ENABLED}, { CMD_SET_ICMB_ADDR ,ENABLED}, { CMD_SET_BRIDGE_PROXY_ADDR ,ENABLED}, { CMD_GET_BRIDGE_STATISTICS ,ENABLED}, { CMD_GET_ICMB_CAPABILITIES ,ENABLED}, { CMD_CLEAR_BRIDGE_STATISTICS ,ENABLED}, { CMD_GET_BRIDGE_PROXY_ADDR ,ENABLED}, { CMD_GET_ICMB_CONNECTOR_INFO ,ENABLED}, { CMD_GET_ICMB_CONNECTION_ID ,DISABLED}, { CMD_SEND_ICMB_CONNECTION_ID ,DISABLED}, /*---------------------- Bridge Discovery Commands -----------------------------------*/ { CMD_PREPARE_FOR_DISCOVERY ,ENABLED}, { CMD_GET_ADDRESSES ,ENABLED}, { CMD_SET_DISCOVERED ,ENABLED}, { CMD_GET_CHASSIS_DEVICE_ID ,ENABLED}, { CMD_SET_CHASSIS_DEVICE_ID ,ENABLED}, /*----------------------- Bridging Commands ------------------------------------------*/ { CMD_BRIDGE_REQUEST ,ENABLED}, { CMD_BRIDGE_MESSAGE ,ENABLED}, /*---------------------- Bridge Event Commands ---------------------------------------*/ { CMD_GET_EVENT_COUNT ,ENABLED}, { CMD_SET_EVENT_DESTINATION ,ENABLED}, { CMD_SET_EVENT_RECEPTION_STATE ,ENABLED}, { CMD_SEND_ICMB_EVENT_MESSAGE ,ENABLED}, { CMD_GET_EVENT_DESTINATION ,ENABLED}, { CMD_GET_EVENT_RECEPTION_STATE ,ENABLED}, { 0 ,0 } }; const NetFnCmds_T g_Sensor [] = { { CMD_SET_EVENT_RECEIVER ,ENABLED}, { CMD_GET_EVENT_RECEIVER ,ENABLED}, { CMD_PLATFORM_EVENT ,ENABLED}, { CMD_GET_PEF_CAPABILITIES ,ENABLED}, { CMD_ARM_PEF_POSTPONE_TIMER ,ENABLED}, { CMD_SET_PEF_CONFIG_PARAMS ,ENABLED}, { CMD_GET_PEF_CONFIG_PARAMS ,ENABLED}, { CMD_SET_LAST_PROCESSED_EVENT_ID ,ENABLED}, { CMD_GET_LAST_PROCESSED_EVENT_ID ,ENABLED}, { CMD_ALERT_IMMEDIATE ,ENABLED}, { CMD_PET_ACKNOWLEDGE ,ENABLED}, { CMD_GET_DEV_SDR_INFO ,ENABLED}, { CMD_GET_DEV_SDR ,ENABLED}, { CMD_RESERVE_DEV_SDR_REPOSITORY ,ENABLED}, { CMD_GET_SENSOR_READING_FACTORS ,ENABLED}, { CMD_SET_SENSOR_HYSTERISIS ,ENABLED}, { CMD_GET_SENSOR_HYSTERISIS ,ENABLED}, { CMD_SET_SENSOR_THRESHOLDS ,ENABLED}, { CMD_GET_SENSOR_THRESHOLDS ,ENABLED}, { CMD_SET_SENSOR_EVENT_ENABLE ,ENABLED}, { CMD_GET_SENSOR_EVENT_ENABLE ,ENABLED}, { CMD_REARM_SENSOR_EVENTS ,ENABLED}, { CMD_GET_SENSOR_EVENT_STATUS ,ENABLED}, { CMD_GET_SENSOR_READING ,ENABLED}, { CMD_SET_SENSOR_TYPE ,ENABLED}, { CMD_GET_SENSOR_TYPE ,ENABLED}, { CMD_SET_SENSOR_READING ,ENABLED}, {0, 0 } }; const NetFnCmds_T g_Storage [] = { /*--------------------- FRU Device Commands ---------------------------------*/ { CMD_FRU_INVENTORY_AREA_INFO ,ENABLED}, { CMD_READ_FRU_DATA ,ENABLED}, { CMD_WRITE_FRU_DATA ,ENABLED}, /*--------------------- SDR Device Commands ---------------------------------*/ { CMD_GET_SDR_REPOSITORY_INFO ,ENABLED}, { CMD_GET_SDR_REPOSITORY_ALLOCATION_INFO ,ENABLED}, { CMD_RESERVE_SDR_REPOSITORY ,ENABLED}, { CMD_GET_SDR ,ENABLED}, { CMD_ADD_SDR ,ENABLED}, { CMD_PARTIAL_ADD_SDR ,ENABLED}, { CMD_DELETE_SDR ,DISABLED}, { CMD_CLEAR_SDR_REPOSITORY ,ENABLED}, { CMD_GET_SDR_REPOSITORY_TIME ,ENABLED}, { CMD_SET_SDR_REPOSITORY_TIME ,DISABLED}, { CMD_ENTER_SDR_REPOSITORY_UPDATE_MODE ,DISABLED}, { CMD_EXIT_SDR_REPOSITORY_UPDATE_MODE ,DISABLED}, { CMD_RUN_INITIALIZATION_AGENT ,ENABLED}, /*--------------------- SEL Device Commands ----------------------------------*/ { CMD_GET_SEL_INFO ,ENABLED}, { CMD_GET_SEL_ALLOCATION_INFO ,ENABLED}, { CMD_RESERVE_SEL ,ENABLED}, { CMD_GET_SEL_ENTRY ,ENABLED}, { CMD_ADD_SEL_ENTRY ,ENABLED}, { CMD_PARTIAL_ADD_SEL_ENTRY ,ENABLED}, { CMD_DELETE_SEL_ENTRY ,ENABLED}, { CMD_CLEAR_SEL ,ENABLED}, { CMD_GET_SEL_TIME ,ENABLED}, { CMD_SET_SEL_TIME ,ENABLED}, { CMD_GET_AUXILIARY_LOG_STATUS ,DISABLED}, { CMD_SET_AUXILIARY_LOG_STATUS ,DISABLED}, { CMD_GET_SEL_TIME_UTC_OFFSET ,ENABLED}, { CMD_SET_SEL_TIME_UTC_OFFSET ,ENABLED}, { 0, 0 } }; const NetFnCmds_T g_Transport [] = { /*------------------------- IPM Device Commands --------------------------------------*/ { CMD_SET_LAN_CONFIGURATION_PARAMETERS ,ENABLED}, { CMD_GET_LAN_CONFIGURATION_PARAMETERS ,ENABLED}, { CMD_SUSPEND_BMC_ARPS ,ENABLED}, { CMD_GET_IP_UDP_RMCP_STATISTICS ,DISABLED}, /*--------------------- Serial/Modem Device Commands ---------------------------------*/ { CMD_SET_SERIAL_MODEM_CONFIG ,ENABLED}, { CMD_GET_SERIAL_MODEM_CONFIG ,ENABLED}, { CMD_SET_SERIAL_MODEM_MUX ,ENABLED}, { CMD_SERIAL_MODEM_CONNECTION_ACTIVITY ,DISABLED}, { CMD_CALLBACK ,ENABLED}, { CMD_SET_USER_CALLBACK_OPTION ,ENABLED}, { CMD_GET_USER_CALLBACK_OPTION ,ENABLED}, { CMD_GET_TAP_RES_CODES ,ENABLED}, /*------------------------- Serial Over LAN Commands ---------------------------------*/ { CMD_GET_SOL_CONFIGURATION ,ENABLED}, { CMD_SET_SOL_CONFIGURATION ,ENABLED}, { 0 ,0 } }; const NetFnCmds_T g_AMI [] = { /* ---------------YAFU Commands -----------------------------*/ // { CMD_AMI_YAFU_SWITCH_FLASH_DEVICE ,ENABLED}, // { CMD_AMI_YAFU_RESTORE_FLASH_DEVICE ,ENABLED}, // { CMD_AMI_YAFU_GET_FLASH_INFO ,ENABLED}, // { CMD_AMI_YAFU_GET_FIRMWARE_INFO ,ENABLED}, // { CMD_AMI_YAFU_GET_FMH_INFO ,ENABLED}, // { CMD_AMI_YAFU_GET_STATUS ,ENABLED}, // { CMD_AMI_YAFU_ACTIVATE_FLASH ,ENABLED}, // { CMD_AMI_YAFU_ALLOCATE_MEMORY ,ENABLED}, // { CMD_AMI_YAFU_FREE_MEMORY ,ENABLED}, // { CMD_AMI_YAFU_READ_FLASH ,ENABLED}, // { CMD_AMI_YAFU_WRITE_FLASH ,ENABLED}, // { CMD_AMI_YAFU_ERASE_FLASH ,ENABLED}, // { CMD_AMI_YAFU_PROTECT_FLASH ,ENABLED}, // { CMD_AMI_YAFU_ERASE_COPY_FLASH ,ENABLED}, // { CMD_AMI_YAFU_VERIFY_FLASH ,ENABLED}, // { CMD_AMI_YAFU_READ_MEMORY ,ENABLED}, // { CMD_AMI_YAFU_WRITE_MEMORY ,ENABLED}, // { CMD_AMI_YAFU_COPY_MEMORY ,ENABLED}, // { CMD_AMI_YAFU_COMPARE_MEMORY ,ENABLED}, // { CMD_AMI_YAFU_CLEAR_MEMORY ,ENABLED}, // { CMD_AMI_YAFU_GET_BOOT_CONFIG ,ENABLED}, // { CMD_AMI_YAFU_SET_BOOT_CONFIG ,ENABLED}, // { CMD_AMI_YAFU_GET_BOOT_VARS ,ENABLED}, // { CMD_AMI_YAFU_DEACTIVATE_FLASH_MODE ,ENABLED}, // { CMD_AMI_YAFU_RESET_DEVICE ,ENABLED}, // { CMD_AMI_YAFU_GET_ECF_STATUS ,ENABLED}, // { CMD_AMI_YAFU_GET_VERIFY_STATUS ,ENABLED}, // { CMD_AMI_YAFU_DUAL_IMAGE_SUP ,ENABLED}, // { CMD_AMI_GET_CHANNEL_NUM ,ENABLED}, // { CMD_AMI_GET_ETH_INDEX ,ENABLED}, // { CMD_AMI_YAFU_FIRMWARE_SELECT_FLASH ,ENABLED}, // { CMD_AMI_YAFU_SIGNIMAGEKEY_REPLACE ,ENABLED}, /*-------------------- AMI Smtp Commands -----------------------*/ // { CMD_SET_SMTP_CONFIG_PARAMS ,ENABLED}, // { CMD_GET_SMTP_CONFIG_PARAMS ,ENABLED}, // { CMD_AMI_GET_EMAIL_USER ,ENABLED}, // { CMD_AMI_SET_EMAIL_USER ,ENABLED}, // { CMD_AMI_GET_EMAILFORMAT_USER ,ENABLED}, // { CMD_AMI_SET_EMAILFORMAT_USER ,ENABLED}, // { CMD_AMI_RESET_PASS ,ENABLED}, // { CMD_AMI_RESTORE_DEF ,ENABLED}, // { CMD_AMI_GET_LOG_CONF ,ENABLED}, // { CMD_AMI_SET_LOG_CONF ,ENABLED}, /*-------------------- AMI Get Bios Code Commands -----------------------------------------*/ // { CMD_AMI_GET_BIOS_CODE ,ENABLED}, /*-------------------- AMI SERVICE Commands -----------------------------------------*/ // { CMD_AMI_GET_SERVICE_CONF ,ENABLED}, // { CMD_AMI_SET_SERVICE_CONF ,ENABLED}, // { CMD_AMI_LINK_DOWN_RESILENT ,ENABLED}, /*-------------------- AMI DNS Commands -----------------------------------------*/ // { CMD_AMI_GET_DNS_CONF ,ENABLED}, // { CMD_AMI_SET_DNS_CONF ,ENABLED}, /*-------------------- AMI Iface State Commands -----------------------------------------*/ // { CMD_AMI_GET_IFACE_STATE ,ENABLED}, // { CMD_AMI_SET_IFACE_STATE ,ENABLED}, // { CMD_AMI_SET_FIREWALL ,ENABLED}, // { CMD_AMI_GET_FIREWALL ,ENABLED}, // { CMD_AMI_GET_FRU_DETAILS ,ENABLED}, // { CMD_AMI_GET_ROOT_USER_ACCESS ,ENABLED}, // { CMD_AMI_SET_ROOT_PASSWORD ,ENABLED}, // { CMD_AMI_GET_USER_SHELLTYPE ,DISABLED}, // { CMD_AMI_SET_USER_SHELLTYPE ,DISABLED}, // { CMD_AMI_SET_EXTENDED_PRIV ,ENABLED}, // { CMD_AMI_GET_EXTENDED_PRIV ,ENABLED}, // { CMD_AMI_SET_TIMEZONE ,ENABLED}, // { CMD_AMI_GET_TIMEZONE ,ENABLED}, // { CMD_AMI_GET_NTP_CFG ,ENABLED}, // { CMD_AMI_SET_NTP_CFG ,ENABLED}, // { CMD_AMI_SET_TRIGGER_EVT ,ENABLED}, // { CMD_AMI_GET_TRIGGER_EVT ,ENABLED}, // { CMD_AMI_GET_SOL_CONFIG_PARAMS ,ENABLED}, // { CMD_AMI_SET_LOGIN_AUDIT_CFG, ENABLED }, // { CMD_AMI_GET_LOGIN_AUDIT_CFG, ENABLED }, // { CMD_AMI_GET_IPV6_ADDRESS, ENABLED }, // { CMD_AMI_SET_SNMP_CONF, ENABLED }, // { CMD_AMI_GET_SNMP_CONF, ENABLED }, // { CMD_AMI_SET_PAM_ORDER, ENABLED }, // { CMD_AMI_GET_PAM_ORDER, ENABLED }, // { CMD_AMI_GET_CHANNEL_TYPE, ENABLED }, /*------------------------------ AMI SEL Commands ------------------------------*/ // { CMD_AMI_GET_SEL_POLICY, ENABLED }, // { CMD_AMI_SET_SEL_POLICY, ENABLED }, // { CMD_AMI_SET_PRESERVE_CONF, ENABLED }, // { CMD_AMI_GET_PRESERVE_CONF, ENABLED }, // { CMD_AMI_GET_SEL_ENTIRES, ENABLED }, // { CMD_AMI_GET_SENSOR_INFO, ENABLED }, // { CMD_AMI_SET_ALL_PRESERVE_CONF, ENABLED }, // { CMD_AMI_GET_ALL_PRESERVE_CONF, ENABLED }, /*------------------------------- TFTP Firmware Update -------------------------*/ // { CMD_AMI_START_TFTP_FW_UPDATE, ENABLED }, // { CMD_AMI_GET_TFTP_FW_PROGRESS_STATUS, ENABLED }, // { CMD_AMI_SET_FW_CONFIGURATION, ENABLED }, // { CMD_AMI_GET_FW_CONFIGURATION, ENABLED }, // { CMD_AMI_SET_FW_PROTOCOL, ENABLED }, // { CMD_AMI_GET_FW_PROTOCOL, ENABLED }, // { CMD_AMI_GET_IPMI_SESSION_TIMEOUT, ENABLED}, /*------------------------------- UDS Channel Info Command ---------------------*/ // { CMD_AMI_GET_UDS_CHANNEL_INFO, ENABLED }, // { CMD_AMI_GET_UDS_SESSION_INFO, ENABLED }, /*-------------------------------AMI Dual Image Support Command-----------------*/ // { CMD_AMI_DUAL_IMG_SUPPORT, ENABLED }, /*---------- Password Encryption Key--------- */ // { CMD_AMI_SET_PWD_ENCRYPTION_KEY, ENABLED }, /*-------------------------------U-Boot Memory Test-----------------------------*/ // { CMD_AMI_SET_UBOOT_MEMTEST, ENABLED}, // { CMD_AMI_GET_UBOOT_MEMTEST_STATUS, ENABLED}, /*-------------------- AMI Remote Images serviceCommands ----------------------------*/ // { CMD_AMI_GET_RIS_CONF ,ENABLED}, // { CMD_AMI_SET_RIS_CONF ,ENABLED}, // { CMD_AMI_RIS_START_STOP ,ENABLED}, /*---------------------AMI Control Debug Messages Commands-----------------------*/ // { CMD_AMI_CTL_DBG_MSG, ENABLED }, // { CMD_AMI_GET_DBG_MSG_STATUS, ENABLED }, // { CMD_AMI_VIRTUAL_DEVICE_SET_STATUS, ENABLED }, // { CMD_AMI_VIRTUAL_DEVICE_GET_STATUS, ENABLED }, // { CMD_AMI_GET_LICENSE_VALIDITY, ENABLED}, // { CMD_AMI_ADD_LICENSE_KEY, ENABLED}, {0 ,0 } }; const NetFnCmds_T g_opma1 [] = { // { CMD_OPMA_SET_SENSOR_RD_OFFSET ,ENABLED}, // { CMD_OPMA_GET_SENSOR_RD_OFFSET ,ENABLED}, { 0 ,0 } }; const NetFnCmds_T g_opma2 [] = { // { CMD_OPMA_SET_SYS_TYPE_ID ,ENABLED}, // { CMD_OPMA_GET_SYS_TYPE_ID ,ENABLED}, // { CMD_OPMA_GET_MCARD_CAP ,ENABLED}, // { CMD_OPMA_CLR_CMOS ,ENABLED}, // { CMD_OPMA_SET_LOCAL_LOCKOUT ,ENABLED}, // { CMD_OPMA_GET_LOCAL_LOCKOUT ,ENABLED}, // { CMD_OPMA_GET_SUPPORTED_HOST_IDS ,ENABLED}, { 0 ,0 } }; const NetFnCmds_T g_apml [] = { // {CMD_APML_GET_INTERFACE_VERSION ,ENABLED }, // {CMD_APML_READ_RMI_REG ,ENABLED}, // {CMD_APML_WRITE_RMI_REG ,ENABLED}, // {CMD_APML_READ_CPUID ,ENABLED}, // {CMD_APML_READ_HTC_REG ,ENABLED}, // {CMD_APML_WRITE_HTC_REG ,ENABLED}, // {CMD_APML_READ_PSTATE ,ENABLED}, // {CMD_APML_READ_MAX_PSTATE ,ENABLED}, // {CMD_APML_READ_PSTATE_LIMIT ,ENABLED}, // {CMD_APML_WRITE_PSTATE_LIMIT ,ENABLED}, // {CMD_APML_READ_MCR ,ENABLED}, // {CMD_APML_WRITE_MCR ,ENABLED}, // {CMD_APML_READ_TSI_REG ,ENABLED}, // {CMD_APML_WRITE_TSI_REG ,ENABLED}, // {CMD_APML_READ_TDP_LIMIT_REG ,ENABLED}, // {CMD_APML_WRITE_TDP_LIMIT_REG ,ENABLED}, // {CMD_APML_READ_PROCESSOR_POWER_REG ,ENABLED}, // {CMD_APML_READ_POWER_AVERAGING_REG ,ENABLED}, // {CMD_APML_READ_DRAM_THROTTLE_REG ,ENABLED}, // {CMD_APML_WRITE_DRAM_THROTTLE_REG ,ENABLED}, {0 ,0 } }; const NetFnCmds_T g_dcmi [] = { /* DCMI Commands */ // { CMD_GET_DCMI_CAPABILITY_INFO ,ENABLED}, // { CMD_GET_POWER_READING ,ENABLED}, // { CMD_GET_POWER_LIMIT ,ENABLED}, // { CMD_SET_POWER_LIMIT ,ENABLED}, // { CMD_ACTIVATE_POWER_LIMIT ,ENABLED}, // { CMD_GET_ASSET_TAG ,ENABLED}, // { CMD_GET_DCMI_SENSOR_INFO ,ENABLED}, // { CMD_SET_ASSET_TAG ,ENABLED}, // { CMD_GET_MANAGEMENT_CONTROLLER_ID_STRING ,ENABLED}, // { CMD_SET_MANAGEMENT_CONTROLLER_ID_STRING ,ENABLED}, // {CMD_SET_THERMAL_LIMIT ,ENABLED}, // {CMD_GET_THERMAL_LIMIT ,ENABLED}, // {CMD_GET_TEMPERATURE_READING ,ENABLED}, // {CMD_SET_DCMI_CONF_PARAMS ,ENABLED}, // {CMD_GET_DCMI_CONF_PARAMS ,ENABLED}, { 0 ,0 } }; const NetFnCmds_T g_hpm [] = { // { CMD_GET_TARGET_UPLD_CAPABLITIES, ENABLED}, // { CMD_GET_COMPONENT_PROPERTIES, ENABLED}, // { CMD_INITIATE_UPG_ACTION, ENABLED}, // { CMD_QUERY_SELF_TEST_RESULTS, ENABLED}, // { CMD_ABORT_FIRMWARE_UPGRADE, ENABLED}, // { CMD_UPLOAD_FIRMWARE_BLOCK, ENABLED}, // { CMD_FINISH_FIRMWARE_UPLOAD, ENABLED}, // { CMD_GET_UPGRADE_STATUS, ENABLED}, // { CMD_ACTIVATE_FIRMWARE, ENABLED}, // { CMD_QUERY_ROLLBACK_STATUS, ENABLED}, // { CMD_INITIATE_MANUAL_ROLLBACK, ENABLED}, { 0, 0 } }; const NetFnCmds_T g_pnm [] = { // {CMD_PNM_OEM_GET_READING ,ENABLED}, // {CMD_PNM_OEM_ME_POWER_STATE_CHANGE ,ENABLED}, {0 ,0 } }; const NetFnCmds_T g_ssi [] = { // { CMD_SSICB_GET_COMPUTE_BLADE_PROPERTIES, ENABLED}, // { CMD_SSICB_GET_ADDR_INFO, ENABLED}, // { CMD_SSICB_PLATFORM_EVENT_MESSAGE, ENABLED}, // { CMD_SSICB_MODULE_BMI_CONTROL, ENABLED}, // { CMD_SSICB_MODULE_PAYLOAD_CONTROL, ENABLED}, // { CMD_SSICB_SET_SYSTEM_EVENT_LOG_POLICY, ENABLED}, // { CMD_SSICB_SET_MODULE_ACTIVATION_POLICY, ENABLED}, // { CMD_SSICB_GET_MODULE_ACTIVATION_POLICY, ENABLED}, // { CMD_SSICB_SET_MODULE_ACTIVATION, ENABLED}, // { CMD_SSICB_SET_POWER_LEVEL, ENABLED}, // { CMD_SSICB_GET_POWER_LEVEL, ENABLED}, // { CMD_SSICB_RENEGOTIATE_POWER, ENABLED}, // { CMD_SSICB_GET_SERVICE_INFO, ENABLED}, // { CMD_SSICB_GET_APPLET_PACKAGE_URI, ENABLED}, // { CMD_SSICB_GET_SERVICE_ENABLE_STATE, ENABLED}, // { CMD_SSICB_SET_SERVICE_ENABLE_STATE, ENABLED}, // { CMD_SSICB_SET_SERVICE_TICKET, ENABLED}, // { CMD_SSICB_STOP_SERVICE_SESSION, ENABLED}, { 0, 0} }; const NetFnCmds_T g_oem [] = //jimbo add { { CMD_EXAMPLE_1, ENABLED}, { CMD_EXAMPLE_2, ENABLED}, { CMD_EXAMPLE_3, ENABLED}, { CMD_EXAMPLE_4, ENABLED}, { CMD_EXAMPLE_5, ENABLED}, { CMD_EXAMPLE_6, ENABLED}, { CMD_EXAMPLE_7, ENABLED}, { CMD_EXAMPLE_8, ENABLED}, { CMD_EXAMPLE_9, ENABLED}, {0, 0} }; NETFNTable_T Netfntbl [] = { { NETFN_APP, GRPEXT_NA, g_App }, { NETFN_CHASSIS, GRPEXT_NA, g_Chassis }, { NETFN_BRIDGE, GRPEXT_NA, g_Bridge }, { NETFN_SENSOR, GRPEXT_NA, g_Sensor }, { NETFN_STORAGE, GRPEXT_NA, g_Storage }, { NETFN_TRANSPORT, GRPEXT_NA, g_Transport }, { NETFN_AMI, GRPEXT_NA, g_AMI }, { NETFN_OPMA1, GRPEXT_NA, g_opma1 }, { NETFN_OPMA2, GRPEXT_NA, g_opma2 }, { NETFN_APML, GRPEXT_NA, g_apml }, { NETFN_HPM, GRPEXT_HPM, g_hpm }, { NETFN_DCMI, GRPEXT_DCMI, g_dcmi }, { NETFN_PNM, GRPEXT_NA, g_pnm }, { NETFN_SSI, GRPEXT_SSI, g_ssi }, { NETFN_OEM, GRPEXT_NA, g_oem }, //jimbo add }; /* *@fn GetCommanEnabledStatus *@brief This function finds whether the command is enabled by the OEM *@param NetFunction - Pointer to the structure of NetFnCmds_T *@param Cmd - Command Number *@return Returns 0 on Enabled commands * Returns -1 on non-Enabled commands */ int GetCommanEnabledStatus(NETFNTable_T *NetFuntbl,INT8U Cmd) { int i=0; while(NetFuntbl->NetFunction[i].Status != 0) { if(NetFuntbl->NetFunction[i].CmdNum ==Cmd) { if(NetFuntbl->NetFunction[i].Status ==ENABLED) { return 0; } else { return -1; } } i++; } return -1; } /* *@fn IsCommandEnabled *@brief This function gives the status of Command *@param NetFn - Net Function *@param GroupExtnCode - Group Extension Code *@param Cmd - Command Number *@return Returns 0 if the command is Enabled * Returns -1 if the command is Disabled */ int IsCommandEnabled(INT8U NetFn,INT8U Cmd) { int i=0; _FAR_ BMCInfo_t* pBMCInfo = &g_BMCInfo; while(i<(sizeof(Netfntbl)/sizeof(NETFNTable_T))) { if(NetFn == Netfntbl[i].NetFn) { break; } i++; } if(i != sizeof(Netfntbl)/sizeof(NETFNTable_T)) { if(GetCommanEnabledStatus((NETFNTable_T*)&Netfntbl[i],Cmd) < 0) { return -1; } } else { return -1; } return 0; }