|
openMMC
Open Source Modular MMC for AMCs
|
IPMI module implementation. More...
#include "string.h"#include "FreeRTOS.h"#include "ipmi.h"#include "port.h"#include "task_priorities.h"#include "led.h"#include "payload.h"#include "uart_debug.h"
Functions | |
| void | IPMITask (void *pvParameters) |
| IPMI dispatcher task. | |
| void | ipmi_init (void) |
| Initializes the IPMI Dispatcher. | |
| t_req_handler | ipmi_retrieve_handler (uint8_t netfn, uint8_t cmd) |
| Finds a handler associated with a given netfunction and command. | |
| ipmb_error | ipmi_event_send (sensor_t *sensor, uint8_t assert_deassert, uint8_t *evData, uint8_t length) |
| Sends an event message via IPMB interface. | |
| IPMI_HANDLER (ipmi_get_device_id, NETFN_APP, IPMI_GET_DEVICE_ID_CMD, ipmi_msg *req, ipmi_msg *rsp) | |
| Handler for GET Device ID command as in IPMI v2.0 section 20.1 for more information. | |
| IPMI_HANDLER (ipmi_get_device_guid, NETFN_APP, IPMI_GET_DEVICE_GUID_CMD, ipmi_msg *req, ipmi_msg *rsp) | |
| Handler for GET Device GUID command. | |
| IPMI_HANDLER (ipmi_picmg_get_properties, NETFN_GRPEXT, IPMI_PICMG_CMD_GET_PROPERTIES, ipmi_msg *req, ipmi_msg *rsp) | |
| Handler for GET Properties request. To be called by IPMI request handler, it must obey the predefined function signature and protocol. Check IPMI 2.0 table 3-11 for more information. | |
| IPMI_HANDLER (ipmi_picmg_cmd_set_amc_port_state, NETFN_GRPEXT, IPMI_PICMG_CMD_SET_AMC_PORT_STATE, ipmi_msg *req, ipmi_msg *rsp) | |
| Handler for Set AMC Port state request. Check IPMI 2.0 table 3-11 for more information. | |
| IPMI_HANDLER (ipmi_get_device_locator_record, NETFN_GRPEXT, IPMI_PICMG_CMD_GET_DEVICE_LOCATOR_RECORD, ipmi_msg *req, ipmi_msg *rsp) | |
| IPMI_HANDLER (ipmi_picmg_cmd_fru_control, NETFN_GRPEXT, IPMI_PICMG_CMD_FRU_CONTROL, ipmi_msg *req, ipmi_msg *rsp) | |
| IPMI_HANDLER (ipmi_picmg_cmd_get_fru_control_capabilities, NETFN_GRPEXT, IPMI_PICMG_CMD_FRU_CONTROL_CAPABILITIES, ipmi_msg *req, ipmi_msg *rsp) | |
| IPMI_HANDLER (ipmi_custom_cmd_get_free_heap, NETFN_CUSTOM, IPMI_CUSTOM_CMD_MMC_GET_FREE_HEAP, ipmi_msg *req, ipmi_msg *rsp) | |
Variables | |
| QueueHandle_t | ipmi_rxqueue = NULL |
| Queue that holds the incoming IPMI messages. | |
| volatile const t_req_handler_record * | ipmiEntries = (t_req_handler_record *) &_ipmi_handlers |
| IPMI handlers list start address. | |
| volatile const t_req_handler_record * | ipmiEntries_end = (t_req_handler_record *) &_eipmi_handlers |
| IPMI handlers list end address. | |
| TaskHandle_t | TaskIPMI_Handle |
IPMI module implementation.
| ipmb_error ipmi_event_send | ( | sensor_t * | sensor, |
| uint8_t | assert_deassert, | ||
| uint8_t * | evData, | ||
| uint8_t | length ) |
Sends an event message via IPMB interface.
Sends an event message (Platform Event) via IPMI.
| [in] | sensor | Pointer to sensor structure defined in sensor.h |
| [in] | assert_deassert | Flag to indicate an (de)assertion event |
| [in] | evData | Data buffer holding the event data, size indicated by length |
| [in] | length | Lenght of evData buffer |
| IPMI_HANDLER | ( | ipmi_custom_cmd_get_free_heap | , |
| NETFN_CUSTOM | , | ||
| IPMI_CUSTOM_CMD_MMC_GET_FREE_HEAP | , | ||
| ipmi_msg * | req, | ||
| ipmi_msg * | rsp ) |
| IPMI_HANDLER | ( | ipmi_get_device_guid | , |
| NETFN_APP | , | ||
| IPMI_GET_DEVICE_GUID_CMD | , | ||
| ipmi_msg * | req, | ||
| ipmi_msg * | rsp ) |
Handler for GET Device GUID command.
| [in] | req | pointer to request message |
| [out] | rsp | pointer to response message |
| IPMI_HANDLER | ( | ipmi_get_device_id | , |
| NETFN_APP | , | ||
| IPMI_GET_DEVICE_ID_CMD | , | ||
| ipmi_msg * | req, | ||
| ipmi_msg * | rsp ) |
Handler for GET Device ID command as in IPMI v2.0 section 20.1 for more information.
| [in] | req | Pointer to request IPMI message |
| [out] | rsp | Pointer to response IPMI message |
| IPMI_HANDLER | ( | ipmi_get_device_locator_record | , |
| NETFN_GRPEXT | , | ||
| IPMI_PICMG_CMD_GET_DEVICE_LOCATOR_RECORD | , | ||
| ipmi_msg * | req, | ||
| ipmi_msg * | rsp ) |
| IPMI_HANDLER | ( | ipmi_picmg_cmd_fru_control | , |
| NETFN_GRPEXT | , | ||
| IPMI_PICMG_CMD_FRU_CONTROL | , | ||
| ipmi_msg * | req, | ||
| ipmi_msg * | rsp ) |
| IPMI_HANDLER | ( | ipmi_picmg_cmd_get_fru_control_capabilities | , |
| NETFN_GRPEXT | , | ||
| IPMI_PICMG_CMD_FRU_CONTROL_CAPABILITIES | , | ||
| ipmi_msg * | req, | ||
| ipmi_msg * | rsp ) |
| IPMI_HANDLER | ( | ipmi_picmg_cmd_set_amc_port_state | , |
| NETFN_GRPEXT | , | ||
| IPMI_PICMG_CMD_SET_AMC_PORT_STATE | , | ||
| ipmi_msg * | req, | ||
| ipmi_msg * | rsp ) |
Handler for Set AMC Port state request. Check IPMI 2.0 table 3-11 for more information.
| [in] | req | Request to be handled and answered. Unused in this particular function. |
| [out] | rsp | Message with data, data length and completion code. |
| IPMI_HANDLER | ( | ipmi_picmg_get_properties | , |
| NETFN_GRPEXT | , | ||
| IPMI_PICMG_CMD_GET_PROPERTIES | , | ||
| ipmi_msg * | req, | ||
| ipmi_msg * | rsp ) |
Handler for GET Properties request. To be called by IPMI request handler, it must obey the predefined function signature and protocol. Check IPMI 2.0 table 3-11 for more information.
| [in] | req | Request to be handled and answered. Unused in this particular function. |
| [out] | rsp | Message with data, data length and completion code. |
| void ipmi_init | ( | void | ) |
Initializes the IPMI Dispatcher.
This function initializes the IPMB Layer, registers the RX queue for incoming requests and creates the IPMI task
| t_req_handler ipmi_retrieve_handler | ( | uint8_t | netfn, |
| uint8_t | cmd ) |
Finds a handler associated with a given netfunction and command.
| [in] | netfn | 8-bit network function code |
| [in] | cmd | 8-bit command code |
| void IPMITask | ( | void * | pvParameters | ) |
IPMI dispatcher task.
This task handles all the incoming IPMI messages previously decoded by IPMB tasks. Here the netfunction and commands are analyzed and the respective handler function is called.
| pvParameters | Pointer to parameters buffer passed to this task in initialization |
Call user-defined function, give request data and retrieve required response
In case of error during IPMB response, the MMC may wait for a new command from the MCH. Check this for debugging purposes only.
If there is no function handler, use data from received message to send "invalid command" response (IPMI table 5-2, page 44).
| QueueHandle_t ipmi_rxqueue = NULL |
Queue that holds the incoming IPMI messages.
| volatile const t_req_handler_record* ipmiEntries = (t_req_handler_record *) &_ipmi_handlers |
IPMI handlers list start address.
| volatile const t_req_handler_record* ipmiEntries_end = (t_req_handler_record *) &_eipmi_handlers |
IPMI handlers list end address.
| TaskHandle_t TaskIPMI_Handle |