openMMC
Open Source Modular MMC for AMCs
Loading...
Searching...
No Matches

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"
Include dependency graph for ipmi.c:

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_recordipmiEntries = (t_req_handler_record *) &_ipmi_handlers
 IPMI handlers list start address.
 
volatile const t_req_handler_recordipmiEntries_end = (t_req_handler_record *) &_eipmi_handlers
 IPMI handlers list end address.
 
TaskHandle_t TaskIPMI_Handle
 

Detailed Description

IPMI module implementation.

Author
Henrique Silva henri.nosp@m.que..nosp@m.silva.nosp@m.@lnl.nosp@m.s.br, LNLS

Function Documentation

◆ ipmi_event_send()

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.

Parameters
[in]sensorPointer to sensor structure defined in sensor.h
[in]assert_deassertFlag to indicate an (de)assertion event
[in]evDataData buffer holding the event data, size indicated by length
[in]lengthLenght of evData buffer
Returns
ipmb_error return value from ipmb_send_request
See also
ipmb_send_request()

◆ IPMI_HANDLER() [1/8]

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() [2/8]

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.

Parameters
[in]reqpointer to request message
[out]rsppointer to response message
Returns
None

◆ IPMI_HANDLER() [3/8]

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.

Parameters
[in]reqPointer to request IPMI message
[out]rspPointer to response IPMI message
Returns
None

◆ IPMI_HANDLER() [4/8]

IPMI_HANDLER ( ipmi_get_device_locator_record ,
NETFN_GRPEXT ,
IPMI_PICMG_CMD_GET_DEVICE_LOCATOR_RECORD ,
ipmi_msg * req,
ipmi_msg * rsp )

◆ IPMI_HANDLER() [5/8]

IPMI_HANDLER ( ipmi_picmg_cmd_fru_control ,
NETFN_GRPEXT ,
IPMI_PICMG_CMD_FRU_CONTROL ,
ipmi_msg * req,
ipmi_msg * rsp )

◆ IPMI_HANDLER() [6/8]

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() [7/8]

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.

Parameters
[in]reqRequest to be handled and answered. Unused in this particular function.
[out]rspMessage with data, data length and completion code.

◆ IPMI_HANDLER() [8/8]

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.

Parameters
[in]reqRequest to be handled and answered. Unused in this particular function.
[out]rspMessage with data, data length and completion code.

◆ ipmi_init()

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

◆ ipmi_retrieve_handler()

t_req_handler ipmi_retrieve_handler ( uint8_t netfn,
uint8_t cmd )

Finds a handler associated with a given netfunction and command.

Parameters
[in]netfn8-bit network function code
[in]cmd8-bit command code
Returns
Pointer to the function which will handle this command, as defined in the netfn handler list.

◆ IPMITask()

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.

Parameters
pvParametersPointer to parameters buffer passed to this task in initialization

Call user-defined function, give request data and retrieve required response

Warning
Since IPMI task have a high priority, this handler function should not wait other tasks to unblock

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).

Variable Documentation

◆ ipmi_rxqueue

QueueHandle_t ipmi_rxqueue = NULL

Queue that holds the incoming IPMI messages.

◆ ipmiEntries

volatile const t_req_handler_record* ipmiEntries = (t_req_handler_record *) &_ipmi_handlers

IPMI handlers list start address.

◆ ipmiEntries_end

volatile const t_req_handler_record* ipmiEntries_end = (t_req_handler_record *) &_eipmi_handlers

IPMI handlers list end address.

◆ TaskIPMI_Handle

TaskHandle_t TaskIPMI_Handle