1.2.5.2.11 TCPIP_MAC_EventMaskSet Function

C

bool TCPIP_MAC_EventMaskSet(
    DRV_HANDLE hMac, 
    TCPIP_MAC_EVENT macEvents, 
    bool enable
);

Description

This is a function that enables or disables the events to be reported to the MAC client (TCP/IP stack).

All events that are to be enabled will be added to the notification process. All events that are to be disabled will be removed from the notification process. The stack (or stack user) has to catch the events that are notified and process them. After that the stack should call TCPIP_MAC_EventAcknowledge() so that the events can be re-enabled.

Precondtions

TCPIP_MAC_Initialize() should have been called. TCPIP_MAC_Open() should have been called to obtain a valid handle.

Parameters

ParametersDescription
hMacHandle identifying the MAC driver client.
macEventsEvents that the MAC client wants to add/delete for notification.
enableIf true, the events will be enabled; else, disabled.

Returns

  • True - If operation succeeded.

  • False - If some error occurred and the operation failed.

Remarks

Multiple events can be "ORed" together.

The event notification system enables the user of the MAC and of the stack to call into the stack for processing only when there are relevant events rather than being forced to periodically call from within a loop.

If the notification events are null the interrupt processing will be disabled. Otherwise the event notification will be enabled and the interrupts relating to the requested events will be enabled.

Note that once an event has been caught by the MAC and reported through the notification handler it may be disabled until the TCPIP_MAC_EventAcknowledge() is called.

Example

TCPIP_MAC_EventMaskSet( hMac, TCPIP_MAC_EV_RX_OVFLOW | TCPIP_MAC_EV_RX_BUFNA, true );