📄 apifunctions.c
字号:
BOOLEAN *pFlag
)
{
U32 RegisterValue;
// Get EEPROM status register
RegisterValue =
PLX_REG_READ(
pdx,
PCI9050_EEPROM_CTRL
);
if (RegisterValue & (1 << 28))
{
*pFlag = TRUE;
}
else
{
*pFlag = FALSE;
}
return ApiSuccess;
}
/******************************************************************************
*
* Function : PlxEepromReadByOffset
*
* Description: Read a value from the EEPROM at a specified offset
*
******************************************************************************/
RETURN_CODE
PlxEepromReadByOffset(
DEVICE_EXTENSION *pdx,
U16 offset,
U32 *pValue
)
{
// Verify the offset
if ((offset & 0x3) || (offset > 0x200))
{
DebugPrintf(("ERROR - Invalid EEPROM offset\n"));
return ApiInvalidOffset;
}
// Read EEPROM
Pci9000_EepromReadByOffset(
pdx,
Eeprom93CS46,
offset,
pValue
);
DebugPrintf((
"EEPROM Offset %02X = %08X\n",
offset,
*pValue
));
return ApiSuccess;
}
/******************************************************************************
*
* Function : PlxEepromWriteByOffset
*
* Description: Write a 32-bit value to the EEPROM at a specified offset
*
******************************************************************************/
RETURN_CODE
PlxEepromWriteByOffset(
DEVICE_EXTENSION *pdx,
U16 offset,
U32 value
)
{
// Verify the offset
if ((offset & 0x3) || (offset > 0x200))
{
DebugPrintf(("ERROR - Invalid EEPROM offset\n"));
return ApiInvalidOffset;
}
// 9050 does not protect the EEPROM from write access, do nothing
// Write to EEPROM
Pci9000_EepromWriteByOffset(
pdx,
Eeprom93CS46,
offset,
value
);
DebugPrintf((
"Wrote %08X to EEPROM Offset %02X\n",
value,
offset
));
return ApiSuccess;
}
/******************************************************************************
*
* Function : PlxRegisterMailboxRead
*
* Description: Reads a valid Mailbox register from the PLX device
*
******************************************************************************/
RETURN_CODE
PlxRegisterMailboxRead(
DEVICE_EXTENSION *pdx,
MAILBOX_ID MailboxId,
U32 *pValue
)
{
*pValue = (U32)-1;
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxRegisterMailboxWrite
*
* Description: Write to one of the PLX device's Mailbox registers
*
******************************************************************************/
RETURN_CODE
PlxRegisterMailboxWrite(
DEVICE_EXTENSION *pdx,
MAILBOX_ID MailboxId,
U32 value
)
{
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxRegisterDoorbellRead
*
* Description: Returns the last doorbell interrupt value
*
******************************************************************************/
RETURN_CODE
PlxRegisterDoorbellRead(
DEVICE_EXTENSION *pdx,
U32 *pValue
)
{
*pValue = (U32)-1;
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxRegisterDoorbellWrite
*
* Description: Sets the local Doorbell Register
*
******************************************************************************/
RETURN_CODE
PlxRegisterDoorbellWrite(
DEVICE_EXTENSION *pdx,
U32 value
)
{
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxMuInboundPortRead
*
* Description: Read the Inbound messaging port of a PLX device
*
******************************************************************************/
RETURN_CODE
PlxMuInboundPortRead(
DEVICE_EXTENSION *pdx,
U32 *pFrame
)
{
*pFrame = (U32)-1;
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxMuInboundPortWrite
*
* Description: Write a posted message frame to the inbound port
*
******************************************************************************/
RETURN_CODE
PlxMuInboundPortWrite(
DEVICE_EXTENSION *pdx,
U32 Frame
)
{
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxMuOutboundPortRead
*
* Description: Reads the posted message frame from the outbound port
*
******************************************************************************/
RETURN_CODE
PlxMuOutboundPortRead(
DEVICE_EXTENSION *pdx,
U32 *pFrame
)
{
*pFrame = (U32)-1;
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxMuOutboundPortWrite
*
* Description: Writes to the outbound port with a free message frame
*
******************************************************************************/
RETURN_CODE
PlxMuOutboundPortWrite(
DEVICE_EXTENSION *pdx,
U32 Frame
)
{
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxDmaControl
*
* Description: Control the DMA engine
*
******************************************************************************/
RETURN_CODE
PlxDmaControl(
DEVICE_EXTENSION *pdx,
DMA_CHANNEL channel,
DMA_COMMAND command
)
{
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxDmaStatus
*
* Description: Get status of a DMA channel
*
******************************************************************************/
RETURN_CODE
PlxDmaStatus(
DEVICE_EXTENSION *pdx,
DMA_CHANNEL channel
)
{
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxDmaBlockChannelOpen
*
* Description: Requests usage of a device's DMA channel
*
******************************************************************************/
RETURN_CODE
PlxDmaBlockChannelOpen(
DEVICE_EXTENSION *pdx,
DMA_CHANNEL channel,
DMA_CHANNEL_DESC *pDesc,
VOID *pOwner
)
{
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxDmaBlockTransfer
*
* Description: Performs DMA block transfer
*
******************************************************************************/
RETURN_CODE
PlxDmaBlockTransfer(
DEVICE_EXTENSION *pdx,
DMA_CHANNEL channel,
DMA_TRANSFER_ELEMENT *pDmaData
)
{
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxDmaBlockChannelClose
*
* Description: Close a previously opened channel
*
******************************************************************************/
RETURN_CODE
PlxDmaBlockChannelClose(
DEVICE_EXTENSION *pdx,
DMA_CHANNEL channel,
BOOLEAN bCheckInProgress
)
{
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxDmaSglChannelOpen
*
* Description: Open a DMA channel for SGL mode
*
******************************************************************************/
RETURN_CODE
PlxDmaSglChannelOpen(
DEVICE_EXTENSION *pdx,
DMA_CHANNEL channel,
DMA_CHANNEL_DESC *pDesc,
VOID *pOwner
)
{
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxDmaSglTransfer
*
* Description: Performs a DMA SGL transfer
*
******************************************************************************/
RETURN_CODE
PlxDmaSglTransfer(
DEVICE_EXTENSION *pdx,
DMA_CHANNEL channel,
DMA_TRANSFER_ELEMENT *pDmaData
)
{
return ApiUnsupportedFunction;
}
/******************************************************************************
*
* Function : PlxDmaSglChannelClose
*
* Description: Close a previously opened channel
*
******************************************************************************/
RETURN_CODE
PlxDmaSglChannelClose(
DEVICE_EXTENSION *pdx,
DMA_CHANNEL channel,
BOOLEAN bCheckInProgress
)
{
return ApiUnsupportedFunction;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -