1.6.3.19 DRV_G3ADP_MAC_EventPendingGet Function

C

TCPIP_MAC_EVENT DRV_G3ADP_MAC_EventPendingGet(DRV_HANDLE hMac);

Summary

Returns the currently pending events.

Description

This function returns the currently pending G3 ADP MAC events. Multiple events will be ORed together as they accumulate. The stack should perform processing whenever a transmission related event (TCPIP_MAC_EV_RX_PKTPEND, TCPIP_MAC_EV_TX_DONE) is present. The other, non critical events, may not be managed by the stack and passed to an user. They will have to be eventually acknowledged if re-enabling is needed.

Precondition

DRV_G3ADP_MAC_Initialize must have been called to set up the driver. DRV_G3ADP_MAC_Open() should have been called to obtain a valid handle.

Parameters

ParamDescription
hMacHandle identifying the MAC driver client

Returns

The currently stack pending events.

Example

    TCPIP_MAC_EVENT activeEvents;

    // Get Pending events
    activeEvents = DRV_G3ADP_MAC_EventPendingGet(pNetIf->hIfMac);
    // Process events
    (...)
    // Acknowledge events
    DRV_G3ADP_MAC_EventAcknowledge( hMac, activeEvents );

Remarks

  • This is the preferred method to get the current pending G3 ADP MAC events. The stack maintains a proper image of the events from their occurrence to their acknowledgment.

  • Even with a notification handler in place it's better to use this function to get the current pending events rather than using the events passed by the notification handler which could be stale.

  • The events are persistent. They shouldn't be re-enabled unless they have been processed and the condition that generated them was removed. Re-enabling them immediately without proper processing will have dramatic effects on system performance.

  • The returned value is just a momentary value. The pending events can change any time.