SAMV71 Xplained Ultra Software Package 1.3

GMAC Driver Functions
[Gmacd_module]

Collaboration diagram for GMAC Driver Functions:

Functions

void GMACD_Handler (sGmacd *pGmacd, gmacQueList_t queIdx)
 GMAC Interrupt handler.
void GMACD_Init (sGmacd *pGmacd, Gmac *pHw, uint8_t bID, uint8_t enableCAF, uint8_t enableNBC)
 Initialize the GMAC with the Gmac controller address.
uint8_t GMACD_InitTransfer (sGmacd *pGmacd, const sGmacInit *pInit, gmacQueList_t queIdx)
void GMACD_Reset (sGmacd *pGmacd)
uint8_t GMACD_SendSG (sGmacd *pGmacd, const sGmacSGList *sgl, fGmacdTransferCallback fTxCb, gmacQueList_t queIdx)
 Send a frame split into buffers. If the frame size is larger than transfer buffer size error returned. If frame transfer status is monitored, specify callback for each frame.
uint8_t GMACD_Send (sGmacd *pGmacd, void *pBuffer, uint32_t size, fGmacdTransferCallback fTxCb, gmacQueList_t queIdx)
 Send a packet with GMAC. If the packet size is larger than transfer buffer size error returned. If packet transfer status is monitored, specify callback for each packet.
uint32_t GMACD_TxLoad (sGmacd *pGmacd, gmacQueList_t queIdx)
uint8_t GMACD_Poll (sGmacd *pGmacd, uint8_t *pFrame, uint32_t frameSize, uint32_t *pRcvSize, gmacQueList_t queIdx)
 Receive a packet with GMAC. If not enough buffer for the packet, the remaining data is lost but right frame length is returned.
void GMACD_SetRxCallback (sGmacd *pGmacd, fGmacdTransferCallback fRxCb, gmacQueList_t queIdx)
 Registers pRxCb callback. Callback will be invoked after the next received frame. When GMAC_Poll() returns GMAC_RX_NO_DATA the application task call GMAC_Set_RxCb() to register pRxCb() callback and enters suspend state. The callback is in charge to resume the task once a new frame has been received. The next time GMAC_Poll() is called, it will be successful.
uint8_t GMACD_SetTxWakeupCallback (sGmacd *pGmacd, fGmacdWakeupCallback fWakeup, uint8_t bThreshold, gmacQueList_t queIdx)
void GMACD_TxPtpEvtMsgCBRegister (sGmacd *pGmacd, fGmacdTxPtpEvtCallBack pTxPtpEvtCb, gmacQueList_t queIdx)

Function Documentation

void GMACD_Handler ( sGmacd pGmacd,
gmacQueList_t  queIdx 
)

GMAC Interrupt handler.

Parameters:
pGmacd Pointer to GMAC Driver instance.

Definition at line 344 of file gmacd.c.

Here is the call graph for this function:

void GMACD_Init ( sGmacd pGmacd,
Gmac pHw,
uint8_t  bID,
uint8_t  enableCAF,
uint8_t  enableNBC 
)

Initialize the GMAC with the Gmac controller address.

Parameters:
pGmacd Pointer to GMAC Driver instance.
pHw Pointer to HW address for registers.
bID HW ID for power management
enableCAF Enable/Disable CopyAllFrame.
enableNBC Enable/Disable NoBroadCast.

Definition at line 487 of file gmacd.c.

Here is the call graph for this function:

uint8_t GMACD_InitTransfer ( sGmacd pGmacd,
const sGmacInit pInit,
gmacQueList_t  queIdx 
)

Initialize necessary allocated buffer lists for GMAC Driver to transfer data. Must be invoked after GMACD_Init() but before RX/TX start. Replace the deprecated GMACD_InitTransfer().

Parameters:
pGmacd Pointer to GMAC Driver instance.
pInit Pointer to sGmacInit.
pInit Pointer to gmacQueList_t for different queue.
Returns:
GMACD_OK or GMACD_PARAM.
Note:
If input address is not 8-byte aligned the address is automatically adjusted and the list size is reduced by one.

Definition at line 552 of file gmacd.c.

Here is the call graph for this function:

uint8_t GMACD_Poll ( sGmacd pGmacd,
uint8_t *  pFrame,
uint32_t  frameSize,
uint32_t *  pRcvSize,
gmacQueList_t  queIdx 
)

Receive a packet with GMAC. If not enough buffer for the packet, the remaining data is lost but right frame length is returned.

Parameters:
pGmacd Pointer to GMAC Driver instance.
pFrame Buffer to store the frame
frameSize Size of the frame
pRcvSize Received size
Returns:
OK, no data, or frame too small

Definition at line 863 of file gmacd.c.

void GMACD_Reset ( sGmacd pGmacd  ) 

Reset TX & RX queue & statistics

Parameters:
pGmacd Pointer to GMAC Driver instance.

Definition at line 666 of file gmacd.c.

Here is the call graph for this function:

uint8_t GMACD_Send ( sGmacd pGmacd,
void *  pBuffer,
uint32_t  size,
fGmacdTransferCallback  fTxCb,
gmacQueList_t  queIdx 
)

Send a packet with GMAC. If the packet size is larger than transfer buffer size error returned. If packet transfer status is monitored, specify callback for each packet.

Parameters:
pGmacd Pointer to GMAC Driver instance.
pBuffer The buffer to be send
size The size of buffer to be send
fTxCb Threshold Wakeup callback
Returns:
OK, Busy or invalid packet

Definition at line 796 of file gmacd.c.

Here is the call graph for this function:

uint8_t GMACD_SendSG ( sGmacd pGmacd,
const sGmacSGList sgl,
fGmacdTransferCallback  fTxCb,
gmacQueList_t  queIdx 
)

Send a frame split into buffers. If the frame size is larger than transfer buffer size error returned. If frame transfer status is monitored, specify callback for each frame.

Parameters:
pGmacd Pointer to GMAC Driver instance.
sgl Pointer to a scatter-gather list describing the buffers of the ethernet frame.
fTxCb Pointer to callback function.

Definition at line 692 of file gmacd.c.

Here is the call graph for this function:

void GMACD_SetRxCallback ( sGmacd pGmacd,
fGmacdTransferCallback  fRxCb,
gmacQueList_t  queIdx 
)

Registers pRxCb callback. Callback will be invoked after the next received frame. When GMAC_Poll() returns GMAC_RX_NO_DATA the application task call GMAC_Set_RxCb() to register pRxCb() callback and enters suspend state. The callback is in charge to resume the task once a new frame has been received. The next time GMAC_Poll() is called, it will be successful.

Parameters:
pGmacd Pointer to GMAC Driver instance.
fRxCb Pointer to callback function
Returns:
OK, no data, or frame too small

Definition at line 978 of file gmacd.c.

Here is the call graph for this function:

uint8_t GMACD_SetTxWakeupCallback ( sGmacd pGmacd,
fGmacdWakeupCallback  fWakeup,
uint8_t  bThreshold,
gmacQueList_t  queIdx 
)

Register/Clear TX wakeup callback.

When GMACD_Send() returns GMACD_TX_BUSY (all TD busy) the application task calls GMACD_SetTxWakeupCallback() to register fWakeup() callback and enters suspend state. The callback is in charge to resume the task once several TD have been released. The next time GMACD_Send() will be called, it shall be successful.

This function is usually invoked with NULL callback from the TX wakeup callback itself, to unregister. Once the callback has resumed the application task, there is no need to invoke the callback again.

Parameters:
pGmacd Pointer to GMAC Driver instance.
fWakeup Wakeup callback.
bThreshold Number of free TD before wakeup callback invoked.
Returns:
GMACD_OK, GMACD_PARAM on parameter error.

Definition at line 1009 of file gmacd.c.

uint32_t GMACD_TxLoad ( sGmacd pGmacd,
gmacQueList_t  queIdx 
)

Return current load of TX.

Parameters:
pGmacd Pointer to GMAC Driver instance.

Definition at line 846 of file gmacd.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines