FreeBSD kernel pms device code
mpi.h File Reference

The file defines the MPI constants and structures. More...

This graph shows which files directly or indirectly include this file:

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)
 

Detailed Description

The file defines the MPI constants and structures.

The file defines the MPI constants and structures

Definition in file mpi.h.

Macro Definition Documentation

◆ ANALOG_SETUP_ENTRY_NO

#define ANALOG_SETUP_ENTRY_NO   10

Definition at line 371 of file mpi.h.

◆ ANALOG_SETUP_ENTRY_SIZE

#define ANALOG_SETUP_ENTRY_SIZE   10

Definition at line 372 of file mpi.h.

◆ BAR0

#define BAR0   0x10

Definition at line 58 of file mpi.h.

◆ BAR1

#define BAR1   0x14

Definition at line 59 of file mpi.h.

◆ BAR2

#define BAR2   0x18

Definition at line 60 of file mpi.h.

◆ BAR3

#define BAR3   0x1C

Definition at line 61 of file mpi.h.

◆ BAR4

#define BAR4   0x20

Definition at line 62 of file mpi.h.

◆ BAR5

#define BAR5   0x24

Definition at line 63 of file mpi.h.

◆ MPI_IB_NUM_MASK

#define MPI_IB_NUM_MASK   0x0000FFFF

Mask of Inbound Queue Number

Definition at line 53 of file mpi.h.

◆ MPI_LOGSIZE

#define MPI_LOGSIZE   4096

default size

Definition at line 51 of file mpi.h.

◆ MPI_MAX_INBOUND_QUEUES

#define MPI_MAX_INBOUND_QUEUES   64

Maximum number of inbound queues

Definition at line 46 of file mpi.h.

◆ MPI_MAX_MEM_REGIONS

#define MPI_MAX_MEM_REGIONS   (MPI_MAX_INBOUND_QUEUES + MPI_MAX_OUTBOUND_QUEUES) + 4

Definition at line 50 of file mpi.h.

◆ MPI_MAX_OUTBOUND_QUEUES

#define MPI_MAX_OUTBOUND_QUEUES   64

Maximum number of outbound queues Max # of memory chunks supported

Definition at line 49 of file mpi.h.

◆ MPI_OB_NUM_MASK

#define MPI_OB_NUM_MASK   0xFFFF0000

Mask of Outbound Queue Number

Definition at line 54 of file mpi.h.

◆ MPI_OB_SHIFT

#define MPI_OB_SHIFT   16

bits shift for outbound queue number

Definition at line 55 of file mpi.h.

◆ MPI_QUEUE_PRIORITY_HIGHEST

#define MPI_QUEUE_PRIORITY_HIGHEST   0xFF

Highest queue priority

Definition at line 43 of file mpi.h.

◆ MPI_QUEUE_PRIORITY_LOWEST

#define MPI_QUEUE_PRIORITY_LOWEST   0x00

Lowest queue priority

Definition at line 44 of file mpi.h.

◆ RV_CFG1_OFFSET

#define RV_CFG1_OFFSET   0x18

Definition at line 437 of file mpi.h.

◆ RV_CFG2_OFFSET

#define RV_CFG2_OFFSET   0x1c

Definition at line 438 of file mpi.h.

◆ RV_PORT_CFG1_OFFSET

#define RV_PORT_CFG1_OFFSET   0x10

Definition at line 435 of file mpi.h.

◆ RV_PORT_CFG2_OFFSET

#define RV_PORT_CFG2_OFFSET   0x14

Definition at line 436 of file mpi.h.

◆ TX_CFG_OFFSET

#define TX_CFG_OFFSET   0x0c

Definition at line 434 of file mpi.h.

◆ TX_PORT_CFG1_OFFSET

#define TX_PORT_CFG1_OFFSET   0x00

Definition at line 431 of file mpi.h.

◆ TX_PORT_CFG2_OFFSET

#define TX_PORT_CFG2_OFFSET   0x04

Definition at line 432 of file mpi.h.

◆ TX_PORT_CFG3_OFFSET

#define TX_PORT_CFG3_OFFSET   0x08

Definition at line 433 of file mpi.h.

Typedef Documentation

◆ mpiConfig_t

typedef struct mpiConfig_s mpiConfig_t

Definition at line 429 of file mpi.h.

◆ mpiHostLLConfigDescriptor_t

Definition at line 299 of file mpi.h.

◆ mpiICQueue_t

typedef struct mpiICQueue_s mpiICQueue_t

Definition at line 197 of file mpi.h.

◆ mpiInboundQueueDescriptor_t

Definition at line 320 of file mpi.h.

◆ mpiMem_t

typedef struct mpiMem_s mpiMem_t

Definition at line 124 of file mpi.h.

◆ mpiMemReq_t

typedef struct mpiMemReq_s mpiMemReq_t

Definition at line 141 of file mpi.h.

◆ mpiMsgCategory_t

Definition at line 84 of file mpi.h.

◆ mpiOCQueue_t

typedef struct mpiOCQueue_s mpiOCQueue_t

Definition at line 168 of file mpi.h.

◆ mpiOutboundQueueDescriptor_t

Definition at line 346 of file mpi.h.

◆ mpiPhyCalibration_t

Definition at line 369 of file mpi.h.

Enumeration Type Documentation

◆ mpiMsgCategory_e

MPI message categories.

,

Enumerator
MPI_CATEGORY_ETHERNET 
MPI_CATEGORY_FC 
MPI_CATEGORY_SAS_SATA 
MPI_CATEGORY_SCSI 

Definition at line 76 of file mpi.h.

Function Documentation

◆ mpiMsgConsume()

◆ mpiMsgFreeGet()

FORCEINLINE bit32 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: