Jump to main content

##

# 1.2.5.2.25 TCPIP_MAC_MODULE_CTRL Structure

## C

    typedef struct {
    TCPIP_MAC_HEAP_MallocF mallocF;
    TCPIP_MAC_HEAP_CallocF callocF;
    TCPIP_MAC_HEAP_FreeF freeF;
    TCPIP_MAC_HEAP_HANDLE memH;
    TCPIP_MAC_PKT_AllocF pktAllocF;
    TCPIP_MAC_PKT_FreeF pktFreeF;
    TCPIP_MAC_PKT_AckF pktAckF;
    TCPIP_MAC_SynchReqF synchF;
    TCPIP_MAC_EventF eventF;
    const void* eventParam;
    uint16_t nIfs;
    uint16_t moduleId;
    uint16_t netIx;
    uint16_t segLoadOffset;
    uint8_t macAction;
    uint8_t powerMode;
    TCPIP_MAC_ADDR ifPhyAddress;
    } TCPIP_MAC_MODULE_CTRL;

## Description

MAC Initialization Data.

This is the data structure that the MAC user (TCP/IP stack) passes on to the MAC driver at the MAC initialization time. It contains all the data needed for the MAC to initialize itself and to start processing packets.

## Members

Members | Description
--- | ---
mallocF | Malloc type allocation function.
callocF | Calloc type allocation function.
freeF | Free type allocation free function.
memH | Handle to be used in the stack allocation service calls.
pktAllocF | Packet allocation function.
pktFreeF | Packet free function.
pktAckF | Packet allocation function.
synchF | Synchronization object request function.
eventF | Event notification function. used by the MAC for event reporting.
eventParam | Parameter to be used when the event function is called.
nIfs | Number of the interfaces supported in this session.
moduleId | Module identifier. Allows multiple channels/ports, etc. MAC support.
netIx | Index of the current interface.
segLoadOffset | The extra space allocated at the beginning of the segment data buffer: TCPIP_MAC_DATA_SEGMENT.segLoad segLoadOffset == sizeof(TCPIP_MAC_SEGMENT_PAYLOAD::segmentPktPtr) + sizeof(TCPIP_MAC_SEGMENT_PAYLOAD::segmentDataGap). It can be different based on the MAC type included in the build MAC driver uses it to have the layout of the data segment.
macAction | Current action for the MAC/stack: TCPIP_MAC_ACTION value.
powerMode | The power mode for this interface to go to. Valid only if stackAction == init/reinit. Ignored for deinitialize operation. TCPIP_MAC_POWER_MODE value.
ifPhyAddress | Physical address of the interface. MAC sets this field as part of the initialization function. The stack will use this data as the interface address.

## Remarks

Most of the data that's passed in this structure is permanent data. It is maintained by the stack for one full session i.e., across Initialize() -> DeInitialize() calls.

Some fields are module specific though (like the memory allocation handle, allocation functions, etc.) that could be different from one module to the other.