FreeBSD kernel pms device code
mpi.c File Reference

The file is a MPI Libraries to implement the MPI functions. More...

#include <sys/cdefs.h>
#include <dev/pms/config.h>
#include <dev/pms/RefTisa/sallsdk/spc/saglobal.h>
Include dependency graph for mpi.c:

Go to the source code of this file.

Functions

 __FBSDID ("$FreeBSD$")
 
void mpiRequirementsGet (mpiConfig_t *config, mpiMemReq_t *memoryRequirement)
 Retrieves the MPI layer resource requirements. More...
 
GLOBAL FORCEINLINE bit32 mpiMsgFreeGet (mpiICQueue_t *circularQ, bit16 messageSize, void **messagePtr)
 Retrieves a free message buffer from an inbound queue. More...
 
GLOBAL FORCEINLINE bit32 mpiMsgProduce (mpiICQueue_t *circularQ, void *messagePtr, mpiMsgCategory_t category, bit16 opCode, bit8 responseQueue, bit8 hiPriority)
 
GLOBAL FORCEINLINE bit32 mpiMsgConsume (mpiOCQueue_t *circularQ, void **messagePtr1, mpiMsgCategory_t *pCategory, bit16 *pOpCode, bit8 *pBC)
 
GLOBAL FORCEINLINE bit32 mpiMsgFreeSet (mpiOCQueue_t *circularQ, void *messagePtr1, bit8 bc)
 

Detailed Description

The file is a MPI Libraries to implement the MPI functions.

The file implements the MPI Library functions.

Definition in file mpi.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ mpiMsgConsume()

◆ mpiMsgFreeGet()

mpiMsgFreeGet ( mpiICQueue_t circularQ,
bit16  messageSize,
void **  messagePtr 
)

Retrieves a free message buffer from an inbound queue.

Parameters
circularQPointer to an inbound circular queue
messageSizeRequested message size in bytes - only support 64 bytes/element
messagePtrPointer to the free message buffer payload (not including message header) or NULL if no free message buffers are available

This function is used to retrieve a free message buffer for the given inbound queue of at least messageSize bytes. The caller can use the returned buffer to construct the message and then call mpiMsgProduce() to deliver the message to the device message unit or mpiMsgInvalidate() if the message buffer is not going to be used

Return: AGSA_RC_SUCCESS if messagePtr contains a valid message buffer pointer AGSA_RC_FAILURE if messageSize larger than the elementSize of queue AGSA_RC_BUSY if there are not free message buffers (Queue full)

Definition at line 228 of file mpi.c.

References mpiICQueue_s::agRoot, AGSA_RC_BUSY, AGSA_RC_FAILURE, AGSA_RC_SUCCESS, mpiICQueue_s::ciPointer, mpiICQueue_s::consumerIdx, mpiICQueue_s::elementSize, mpiMsgHeader_s::Header, hpDBG_VERY_LOUD, mpiICQueue_s::memoryRegion, MSGU_HOST_SCRATCH_PAD_0, NULL, mpiICQueue_s::numElements, ossaHwRegRead(), mpiICQueue_s::producerIdx, SA_ASSERT, SA_DBG1, SA_DBG3, SA_DBG4, smTrace, and mpiMem_s::virtPtr.

Referenced by mpiBuildCmd(), saFlashExtExecute(), saFwFlashUpdate(), saSATAAbort(), saSATAStart(), saSendSMPIoctl(), saSMPStart(), saSSPAbort(), and saSSPStart().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpiMsgFreeSet()

◆ mpiMsgProduce()

◆ mpiRequirementsGet()

void mpiRequirementsGet ( mpiConfig_t config,
mpiMemReq_t memoryRequirement 
)

Retrieves the MPI layer resource requirements.

Parameters
configMPI configuration for the Host MPI Message Unit
memoryRequirementReturned data structure as defined by mpiMemReq_t that holds the different chunks of memory that are required

The mpiRequirementsGet() function is used to determine the resource requirements for the SPC device interface

Return: None

Definition at line 67 of file mpi.c.

References AGSA_CACHED_DMA_MEM, AGSA_DMA_MEM, mpiMem_s::alignment, mpiMemReq_s::count, mpiMem_s::elementSize, mpiInboundQueueDescriptor_s::elementSize, mpiOutboundQueueDescriptor_s::elementSize, mpiHostLLConfigDescriptor_s::eventLogSize, mpiConfig_s::inboundQueues, mpiHostLLConfigDescriptor_s::IOPeventLogSize, mpiConfig_s::mainConfig, MAX_QUEUE_EACH_MEM, NULL, mpiMem_s::numElements, mpiInboundQueueDescriptor_s::numElements, mpiOutboundQueueDescriptor_s::numElements, mpiConfig_s::numInboundQueues, mpiConfig_s::numOutboundQueues, mpiConfig_s::outboundQueues, mpiMemReq_s::region, SA_ASSERT, SA_DBG2, mpiMem_s::totalLength, and mpiMem_s::type.

Referenced by saGetRequirements().

Here is the caller graph for this function: