FreeBSD kernel pms device code
|
The file defines the MPI constants and structures. More...
Go to the source code of this file.
Data Structures | |
struct | mpiMem_s |
Structure that descibes memory regions. More... | |
struct | mpiMemReq_s |
Describes MPI memory requirements. More... | |
struct | mpiOCQueue_s |
struct | mpiICQueue_s |
Circular Queue descriptor. More... | |
struct | mpiHostLLConfigDescriptor_s |
struct | mpiInboundQueueDescriptor_s |
MPI inbound queue attributes. More... | |
struct | mpiOutboundQueueDescriptor_s |
MPI outbound queue attributes. More... | |
struct | mpiPhyCalibration_s |
MPI Phy Calibration Table. More... | |
struct | mpiVConfig_s |
struct | mpiConfig_s |
MPI layer configuration parameters. More... | |
Macros | |
#define | MPI_QUEUE_PRIORITY_HIGHEST 0xFF |
#define | MPI_QUEUE_PRIORITY_LOWEST 0x00 |
#define | MPI_MAX_INBOUND_QUEUES 64 |
#define | MPI_MAX_OUTBOUND_QUEUES 64 |
#define | MPI_MAX_MEM_REGIONS (MPI_MAX_INBOUND_QUEUES + MPI_MAX_OUTBOUND_QUEUES) + 4 |
#define | MPI_LOGSIZE 4096 |
#define | MPI_IB_NUM_MASK 0x0000FFFF |
#define | MPI_OB_NUM_MASK 0xFFFF0000 |
#define | MPI_OB_SHIFT 16 |
#define | BAR0 0x10 |
#define | BAR1 0x14 |
#define | BAR2 0x18 |
#define | BAR3 0x1C |
#define | BAR4 0x20 |
#define | BAR5 0x24 |
#define | ANALOG_SETUP_ENTRY_NO 10 |
#define | ANALOG_SETUP_ENTRY_SIZE 10 |
#define | TX_PORT_CFG1_OFFSET 0x00 |
#define | TX_PORT_CFG2_OFFSET 0x04 |
#define | TX_PORT_CFG3_OFFSET 0x08 |
#define | TX_CFG_OFFSET 0x0c |
#define | RV_PORT_CFG1_OFFSET 0x10 |
#define | RV_PORT_CFG2_OFFSET 0x14 |
#define | RV_CFG1_OFFSET 0x18 |
#define | RV_CFG2_OFFSET 0x1c |
Typedefs | |
typedef enum mpiMsgCategory_e | mpiMsgCategory_t |
typedef struct mpiMem_s | mpiMem_t |
typedef struct mpiMemReq_s | mpiMemReq_t |
typedef struct mpiOCQueue_s | mpiOCQueue_t |
typedef struct mpiICQueue_s | mpiICQueue_t |
typedef struct mpiHostLLConfigDescriptor_s | mpiHostLLConfigDescriptor_t |
typedef struct mpiInboundQueueDescriptor_s | mpiInboundQueueDescriptor_t |
typedef struct mpiOutboundQueueDescriptor_s | mpiOutboundQueueDescriptor_t |
typedef struct mpiPhyCalibration_s | mpiPhyCalibration_t |
typedef struct mpiConfig_s | mpiConfig_t |
Enumerations | |
enum | mpiMsgCategory_e { MPI_CATEGORY_ETHERNET = 0 , MPI_CATEGORY_FC , MPI_CATEGORY_SAS_SATA , MPI_CATEGORY_SCSI } |
MPI message categories. More... | |
Functions | |
void | mpiRequirementsGet (mpiConfig_t *config, mpiMemReq_t *memoryRequirement) |
Retrieves the MPI layer resource requirements. More... | |
FORCEINLINE bit32 | mpiMsgFreeGet (mpiICQueue_t *circularQ, bit16 messageSize, void **messagePtr) |
Retrieves a free message buffer from an inbound queue. More... | |
FORCEINLINE bit32 | mpiMsgProduce (mpiICQueue_t *circularQ, void *messagePtr, mpiMsgCategory_t category, bit16 opCode, bit8 responseQueue, bit8 hiPriority) |
FORCEINLINE bit32 | mpiMsgConsume (mpiOCQueue_t *circularQ, void **messagePtr1, mpiMsgCategory_t *pCategory, bit16 *pOpCode, bit8 *pBC) |
FORCEINLINE bit32 | mpiMsgFreeSet (mpiOCQueue_t *circularQ, void *messagePtr1, bit8 bc) |
The file defines the MPI constants and structures.
The file defines the MPI constants and structures
Definition in file mpi.h.
#define MPI_IB_NUM_MASK 0x0000FFFF |
#define MPI_MAX_INBOUND_QUEUES 64 |
#define MPI_MAX_MEM_REGIONS (MPI_MAX_INBOUND_QUEUES + MPI_MAX_OUTBOUND_QUEUES) + 4 |
#define MPI_MAX_OUTBOUND_QUEUES 64 |
#define MPI_OB_NUM_MASK 0xFFFF0000 |
typedef struct mpiConfig_s mpiConfig_t |
typedef struct mpiHostLLConfigDescriptor_s mpiHostLLConfigDescriptor_t |
typedef struct mpiICQueue_s mpiICQueue_t |
typedef struct mpiInboundQueueDescriptor_s mpiInboundQueueDescriptor_t |
typedef struct mpiMemReq_s mpiMemReq_t |
typedef enum mpiMsgCategory_e mpiMsgCategory_t |
typedef struct mpiOCQueue_s mpiOCQueue_t |
typedef struct mpiOutboundQueueDescriptor_s mpiOutboundQueueDescriptor_t |
typedef struct mpiPhyCalibration_s mpiPhyCalibration_t |
enum mpiMsgCategory_e |
FORCEINLINE bit32 mpiMsgConsume | ( | mpiOCQueue_t * | circularQ, |
void ** | messagePtr1, | ||
mpiMsgCategory_t * | pCategory, | ||
bit16 * | pOpCode, | ||
bit8 * | pBC | ||
) |
Definition at line 660 of file mpi.c.
References mpiOCQueue_s::agRoot, AGSA_RC_BUSY, AGSA_RC_FAILURE, AGSA_RC_SUCCESS, mpiMem_s::appHandle, BC_MASK, CAT_MASK, mpiOCQueue_s::CIPCIBar, mpiOCQueue_s::CIPCIOffset, mpiOCQueue_s::consumerIdx, mpiOCQueue_s::elementSize, HEADER_BC_MASK, HEADER_V_MASK, mpiOCQueue_s::memoryRegion, MPI_DEBUG_TRACE, MPI_DEBUG_TRACE_OBQ, MPI_DEBUG_TRACE_QNUM_ERROR, NULL, mpiOCQueue_s::numElements, OPC_OUB_SKIP_ENTRY, OPCODE_MASK, OSSA_OFFSET_OF, ossaCacheInvalidate(), ossaHwRegReadExt(), ossaHwRegWriteExt(), mpiOCQueue_s::piPointer, mpiOCQueue_s::producerIdx, mpiOCQueue_s::qNumber, SA_ASSERT, SA_DBG1, SA_DBG3, SA_DBG4, SHIFT12, SHIFT24, and mpiMem_s::virtPtr.
Referenced by siProcessOBMsg().
FORCEINLINE bit32 mpiMsgFreeGet | ( | mpiICQueue_t * | circularQ, |
bit16 | messageSize, | ||
void ** | messagePtr | ||
) |
Retrieves a free message buffer from an inbound queue.
circularQ | Pointer to an inbound circular queue |
messageSize | Requested message size in bytes - only support 64 bytes/element |
messagePtr | Pointer 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().
FORCEINLINE bit32 mpiMsgFreeSet | ( | mpiOCQueue_t * | circularQ, |
void * | messagePtr1, | ||
bit8 | bc | ||
) |
Definition at line 817 of file mpi.c.
References mpiOCQueue_s::agRoot, AGSA_RC_SUCCESS, mpiOCQueue_s::CIPCIBar, mpiOCQueue_s::CIPCIOffset, mpiOCQueue_s::consumerIdx, mpiOCQueue_s::elementSize, mpiMsgHeader_s::Header, HEADER_V_MASK, mpiOCQueue_s::memoryRegion, NULL, mpiOCQueue_s::numElements, ossaHwRegWriteExt(), mpiOCQueue_s::piPointer, mpiOCQueue_s::producerIdx, mpiOCQueue_s::qNumber, SA_ASSERT, SA_DBG1, SA_DBG3, SA_DBG4, SA_DBG5, and mpiMem_s::virtPtr.
Referenced by siProcessOBMsg().
FORCEINLINE bit32 mpiMsgProduce | ( | mpiICQueue_t * | circularQ, |
void * | messagePtr, | ||
mpiMsgCategory_t | category, | ||
bit16 | opCode, | ||
bit8 | responseQueue, | ||
bit8 | hiPriority | ||
) |
Definition at line 461 of file mpi.c.
References agNULL, mpiICQueue_s::agRoot, AGSA_RC_SUCCESS, mpiMem_s::appHandle, BC_MASK, CAT_MASK, mpiICQueue_s::consumerIdx, mpiICQueue_s::elementSize, mpiMsgHeader_s::Header, hpDBG_IOMB, hpDBG_VERY_LOUD, mpiICQueue_s::memoryRegion, MPI_DEBUG_TRACE, MPI_DEBUG_TRACE_IBQ, MPI_MAX_OUTBOUND_QUEUES, NULL, mpiICQueue_s::numElements, OBID_MASK, OPCODE_MASK, OSSA_OFFSET_OF, ossaCacheFlush(), ossaCachePreFlush(), ossaHwRegWriteExt(), ossaLogIomb, mpiICQueue_s::PIPCIBar, mpiICQueue_s::PIPCIOffset, mpiICQueue_s::priority, mpiICQueue_s::producerIdx, mpiICQueue_s::qNumber, SA_ASSERT, SA_DBG1, SA_DBG4, SA_DBG6, agsaContext_s::sdkData, SHIFT12, SHIFT16, SHIFT24, SHIFT30, SHIFT31, smTrace, smTraceFuncEnter, smTraceFuncExit, agsaLLRoot_s::timeTick, TRUE, and V_BIT.
Referenced by mpiBuildCmd(), mpiSMPCmd(), saFlashExtExecute(), saFwFlashUpdate(), saSATAAbort(), saSATAStart(), saSSPAbort(), and saSSPStart().
void mpiRequirementsGet | ( | mpiConfig_t * | config, |
mpiMemReq_t * | memoryRequirement | ||
) |
Retrieves the MPI layer resource requirements.
config | MPI configuration for the Host MPI Message Unit |
memoryRequirement | Returned 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().