📄 mplclient.h
字号:
// Return Value
// NS_STATUS_SUCCESS
// The capabilities were successfully returned
//
//*****************************************************************************
MPL_STATUS
MplGetCaps (
IN NS_VOID *pMplHandle,
OUT MPL_CAPS *pMplCaps
);
//*****************************************************************************
// MplCfgMTU
// Configures the maximum packet size supported by MPL
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize
// mtu
// The maximum packet size queued for transmission or reception
//
// Return Value
// NS_STATUS_SUCCESS
// The requested MTU was successfully configured on the device.
// NS_STATUS_INVALID_PARM
// The size is greater than the maximum supported on the device.
//
//*****************************************************************************
MPL_STATUS
MplCfgMTU (
IN NS_VOID *pMplHandle,
IN NS_UINT mtu
);
//+++++ Transmit Engine APIs
//##########################
//*****************************************************************************
// MplTransmitCfg
// Configures the transmit engine on the device.
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize
// pCfgTransmit
// Pointer to a caller allocated MPL_TRANSMIT_CFG structure with
// configuration values for the transmit engine
//
// Return Value
// NS_STATUS_SUCCESS
// The configurations were successfully applied
// NS_STATUS_INVALID_PARM
// An invalid parameter value was detected
// NS_STATUS_RESOURCES
// Failed to allocate required resources
//
//*****************************************************************************
MPL_STATUS
MplTransmitCfg (
IN NS_VOID *pMplHandle,
IN MPL_TRANSMIT_CFG *pCfgTransmit
);
//*****************************************************************************
// MplTransmitGetFreeDesc
// Returns the total free transmit descriptors currently available.
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize
// pQueue
// Queue (1,2...max tx queues) from which the free count is desired
// pTxdCnt
// Pointer to a caller allocated fields in which the count of free
// transmit descriptors is returned
//
// Return Value
// NS_STATUS_SUCCESS
// The count was successfully returned.
// NS_STATUS_INVALID_PARM
// The priority queue count is invalid
//
//*****************************************************************************
MPL_STATUS
MplTransmitGetFreeDesc (
IN NS_VOID *pMplHandle,
IN NS_UINT8 pQueue,
OUT NS_UINT *pTxdCnt
);
//*****************************************************************************
// MplTransmit
// Queues up one or more packets for transmission by the device.
// NOTE: This function is non-reentrant with respect to itself,
// MplTransmitReset and MplTransmitDone
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize
// pktCount
// The count of packets being queued for transmission
// pPackets
// Pointer to a list of MPL_PKT structures due for transmission
//
// Return Value
// NS_STATUS_SUCCESS
// All packets were successfully queued up for transmission
// NS_STATUS_FAILURE
// One or more of the packets where unacceptable for transmission
// Per packet status (pPacket->packetStatus) is one of
// NS_STATUS_INVALID_PARM
// The priority queue count is invalid
// NS_STATUS_RESOURCES
// Failed to allocate the required resources (Txds)
//
//*****************************************************************************
MPL_STATUS
MplTransmit (
IN NS_VOID *pMplHandle,
IN NS_UINT pktCount,
IN MPL_PKT *pPackets
);
//*****************************************************************************
// MplTrasmitDone
// Processes transmit engine related events.
// NOTE: This function is non-reentrant with respect to itself,
// MplTransmitReset and MplTransmit
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize
// maxEvents
// The maximum transmit engine related events (e.g. transmit complete)
// that MPL should process before returning back to the caller.
//
// Return Value
// NS_STATUS_SUCCESS
// The transmit event was successfully handled.
// NS_STATUS_ABORTED
// The processing was aborted since the maximum event count specified
// was met.
//
//*****************************************************************************
MPL_STATUS
MplTransmitDone (
IN NS_VOID *pMplHandle,
IN NS_UINT maxEvents
);
//*****************************************************************************
// MplTransmitReset
// Resets the transmit engine on the device and associated resources.
// NOTE: This function is non-reentrant with respect to itself,
// MplTransmit and MplTransmitDone
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize
//
// Return Value
// NS_STATUS_SUCCESS
// The transmit engine was successfully reset.
// NS_STATUS_HARDWARE_FAILURE
// Unexpected hardware error - No reset done notification from Hw
//
//*****************************************************************************
MPL_STATUS
MplTransmitReset (
IN NS_VOID *pMplHandle
);
//+++++ Receive Engine APIs
//##########################
//*****************************************************************************
// MplReceiveCfg
// Configures the receive engine on the device.
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize
// pCfgReceive
// Pointer to a caller allocated MPL_RECEIVE_CFG structure with
// configuration values for the receive engine
//
// Return Value
// NS_STATUS_SUCCESS
// The configurations were successfully applied
// NS_STATUS_INVALID_PARM
// An invalid parameter value was detected
//
//*****************************************************************************
MPL_STATUS
MplReceiveCfg (
IN NS_VOID *pMplHandle,
IN MPL_RECEIVE_CFG *pCfgReceive
);
//*****************************************************************************
// MplReceiveSetFilter
// MplReceiveSetFilter enables receive filters on the device.
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize
// filterFlag
// Bit-map of receiver filter types that need to be enabled on the
// device
// Note: This function overwrites all previous filter settings and
// sets the device's behavior to that of the filterFlag passed to it.
//
// Return Value
// NS_STATUS_SUCCESS
// The filter configurations were successfully applied
// NS_STATUS_NOT_SUPPORTED
// The device did not support one or more filters
//
//*****************************************************************************
MPL_STATUS
MplReceiveSetFilter (
IN NS_VOID *pMplHandle,
IN NS_UINT filterFlag
);
// MPL Receive Filter Bits
#define MPL_RECEIVE_FILTER_ACCEPTALL_BROADCAST 0x00000001
#define MPL_RECEIVE_FILTER_ACCEPTALL_MCAST 0x00000002
#define MPL_RECEIVE_FILTER_ACCEPTALL_UNICAST 0x00000004
#define MPL_RECEIVE_FILTER_ACCEPTALL_ARP 0x00000008
#define MPL_RECEIVE_FILTER_PROMISCUOUS_MODE 0x00000010
#define MPL_RECEIVE_FILTER_DIRECTED_UNICAST 0x00000020
#define MPL_RECEIVE_FILTER_DIRECTED_MCAST 0x00000040
#define MPL_RECEIVE_FILTER_ERROREDPKTS 0x00000080
//*****************************************************************************
// MplReceive
// Handles the packet reception event and moves the received packet from
// the device to the host.
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize
// maxEvents
// The maximum receive engine related events (e.g. receive complete)
// that MPL should process before returning back to the caller.
// pBufFragConsumed
// A caller supplied pointer variable in which this function returns the
// number of buffer fragments that were consumed while processing this
// receive pass.
//
// Return Value
// NS_STATUS_SUCCESS
// The receive events were successfully processed.
// NS_STATUS_ABORTED
// The processing was aborted since the maximum event count specified
// was met.
//
//*****************************************************************************
MPL_STATUS
MplReceive (
IN NS_VOID *pMplHandle,
IN NS_UINT maxEvents,
OUT NS_UINT *pBufFragConsumed
);
//*****************************************************************************
// MplReceiveReplenish
// Restock the MPL receive engine with fresh buffers for packet reception.
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize.
// bufFragCount
// Number of buffer fragments being replenished.
// pFragList
// Pointer to a caller supplied variable of type MPL_PKT_FRAG pointing
// to the head node of the buffer fragment list being replenished.
// If all the buffer fragments were not consumed by MPL then the
// pointer to the first unused fragment is returned back to NSM.
//
// Return Value
// NS_STATUS_SUCCESS
// The buffers were successfully replenished.
//
//*****************************************************************************
MPL_STATUS
MplReceiveReplenish (
IN NS_VOID *pMplHandle,
IN NS_UINT bufFragCount,
IN OUT MPL_PKT_FRAG **pFragList
);
//*****************************************************************************
// MplQueryPacketLength
// Returns the size (in bytes) of the data frame within a MPL_PKT structure
//
// Parameters
// pPacket
// Pointer to the MPL_PKT structure who data frame length is being
// queried.
//
// Return Value
// The total size of the data frame in bytes (could be 0x0 also).
//
//*****************************************************************************
NS_UINT
MplQueryPacketLength (
IN MPL_PKT *pPacket
);
//*****************************************************************************
// MplReceiveReset
// Resets the receive engine on the device and associated software
// resources.
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize
//
// Return Value
// NS_STATUS_SUCCESS
// The receive engine was successfully reset.
// NS_STATUS_HARDWARE_FAILURE
// Unexpected hardware error - No reset done notification from Hw
//
//*****************************************************************************
MPL_STATUS
MplReceiveReset (
IN NS_VOID *pMplHandle
);
//*****************************************************************************
// MplReceiveGetEmptyDesc
// Returns the count of the Rxds that are empty i.e. no attached buffers
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize
// pQueue
// Queue (1,2...max tx queues) from which the empty count is desired
// pRxdCnt
// Pointer to a caller allocated fields in which the count of empty
// receive descriptors is returned
//
// Return Value
// NS_STATUS_SUCCESS
// The count was successfully returned.
// NS_STATUS_INVALID_PARM
// The priority queue count is invalid
//
//*****************************************************************************
MPL_STATUS
MplReceiveGetEmptyDesc (
IN NS_VOID *pMplHandle,
IN NS_UINT8 pQueue,
OUT NS_UINT *pRxdCnt
);
//+++++ Interrupt Module APIs
//###########################
//*****************************************************************************
// MplInterruptCfg
// Configure the interrupt hold-off delay (for interrupt coalescing).
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize
// delayMSec
// Interrupt hold off delay in microseconds
// transmitHold
// Interrupts hold off based on number of Tx pkts sent
// receiveHold
// Interrupts hold off based on number of Rx pkts sent
//
// Return Value
// NS_STATUS_SUCCESS
// Interrupts were successfully configured
//
//*****************************************************************************
MPL_STATUS
MplInterruptCfg (
IN NS_VOID *pMplHandle,
IN NS_UINT delayMSec,
IN NS_UINT transmitHold,
IN NS_UINT receiveHold
);
//*****************************************************************************
// MplInterruptEnable
// Enable the interrupt line on the network device.
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize
//
// Return Value
// NS_STATUS_SUCCESS
// Interrupts were successfully enabled
//
//*****************************************************************************
MPL_STATUS
MplInterruptEnable (
IN NS_VOID *pMplHandle
);
//*****************************************************************************
// MplInterruptDisable
// Disable the interrupt line on the network device.
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize
// Return Value
// NS_STATUS_SUCCESS
// Interrupts were successfully disabled
//
//*****************************************************************************
MPL_STATUS
MplInterruptDisable (
IN NS_VOID *pMplHandle
);
//*****************************************************************************
// MplInterruptCheck
// Checks for and clears pending interrupt conditions on the device.
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize.
// pIrqsPresent
// A caller supplied variable in which the current interrupting
// conditions are noted.
//
// Return Value
// NS_STATUS_SUCCESS
// The current interrupting conditions were successfully read from the
// device and pending events do exist.
// NS_STATUS_FAILURE
// Interrupts are currently disabled, so no interrupt conditions exist.
// or the mask bits and status bits don't match
//
//*****************************************************************************
MPL_STATUS
MplInterruptCheck (
IN NS_VOID *pMplHandle
);
//*****************************************************************************
// MplInterruptCheckTransmit
// Checks for the presence of transmit engine related interrupt events.
//
// Parameters
// pMplHandle
// MPL device handle returned following a call to MplInitialize.
//
// Return Value
// NS_STATUS_SUCCESS
// Pending transmit related events exist on the device
// NS_STATUS_FAILURE
// No transmit related events detected.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -