1.6.3.14 DRV_G3ADP_MAC_ParametersGet Function

C

TCPIP_MAC_RES DRV_G3ADP_MAC_ParametersGet(DRV_HANDLE hMac, TCPIP_MAC_PARAMETERS* pMacParams);

Summary

G3 ADP MAC parameter get function.

Description

This function returns the run time parameters of the G3 ADP MAC driver. This function is used to set the following parameters of the G3 stack: - Set G3 ADP Data Notification callbacks - Set G3 ADP Extended Address

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
pMacParamsAddress to store the MAC parameters

Returns

  • TCPIP_MAC_RES_OK if pMacParams updated properly

  • A TCPIP_MAC_RES error code if processing failed for some reason

Example

    SYS_STATUS macStat = DRV_G3ADP_MAC_Status(pNetIf->macObjHandle);
    if(macStat == SYS_STATUS_READY)
    {   // get the MAC address and MAC processing flags
        // set the default MTU; MAC driver will override if needed
        TCPIP_MAC_PARAMETERS macParams = {{{0}}};

        macParams.linkMtu = TCPIP_MAC_LINK_MTU_DEFAULT;
        DRV_G3ADP_MAC_ParametersGet(pNetIf->hIfMac, &macParams);
        memcpy(pNetIf->netMACAddr.v, macParams.ifPhyAddress.v, sizeof(pNetIf->netMACAddr));
        pNetIf->Flags.bMacProcessOnEvent = macParams.processFlags != TCPIP_MAC_PROCESS_FLAG_NONE;
        pNetIf->linkMtu = macParams.linkMtu;

        // enable the interface
        pNetIf->Flags.bInterfaceEnabled = true;
        pNetIf->Flags.bMacInitialize = false;
        pNetIf->Flags.bMacInitDone = true;
    }

Remarks

  • None.