Jump to main content

##

# 1.2.5.2.43 TCPIP_MAC_Process Function

## C

    TCPIP_MAC_RES TCPIP_MAC_Process(
        DRV_HANDLE hMac
    );

## Description

This is a function that allows for internal processing by the MAC driver. It is meant for processing that cannot be done from within ISR.

Normally this function will be called in response to an TX and/or RX event signaled by the driver. This is specified by the MAC driver using the TCPIP_MAC_PARAMETERS::processFlags.

An alternative approach is that the MAC driver uses a system service to create a timer signal that will call the TCPIP_MAC_Process on a periodic basis.

## Precondtions

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

## Parameters

Parameters | Description
--- | ---
hMac | Handle identifying the MAC driver client.

## Returns

- TCPIP_MAC_RES_OK - If all processing went on OK.
- TCPIP_MAC_RES error code - If processing failed for some reason.

## Remarks

Some of the processing that this function is intended for:

- The MAC driver can process its pending TX queues (although it could do that from within the TX ISR)
- RX buffers replenishing. If the number of packets in the RX queue falls below a specified limit, the MAC driver can use this function to allocate some extra RX packets. Similarly, if there are too many allocated RX packets, the MAC driver can free some of them.