AzureMXChip/MXCHIPAZ3166/core/lib/netxduo/common/src/nx_ip_interface_status_check.c
UINT  _nx_ip_interface_status_check(NX_IP *ip_ptr, UINT interface_index, ULONG needed_status,
                                    ULONG *actual_status, ULONG wait_option)
{

ULONG                  current_status;
NX_IP_DRIVER           driver_request;
ULONG                  return_value;

#ifdef TX_ENABLE_EVENT_TRACE
TX_TRACE_BUFFER_ENTRY *trace_event;
ULONG                  trace_timestamp;
#endif


    /* If trace is enabled, insert this event into the trace buffer.  */
    NX_TRACE_IN_LINE_INSERT(NX_TRACE_IP_STATUS_CHECK, ip_ptr, needed_status, 0, wait_option, NX_TRACE_IP_EVENTS, &trace_event, &trace_timestamp);

    /* Loop to keep checking for the proper status bits.  */
    for (;;)
    {

        /* Clear the current status.  */
        current_status =  0;

        /*  Process according to the status option specified.  */

        if (needed_status & NX_IP_INITIALIZE_DONE)
        {

            /* Check for initialization complete.  */
            if (ip_ptr -> nx_ip_initialize_done)
            {

                /* Yes, set the appropriate bit in the current status.  */
                current_status =  current_status | NX_IP_INITIALIZE_DONE;
            }
        }

#ifndef NX_DISABLE_IPV4
        if (needed_status & NX_IP_ADDRESS_RESOLVED)
        {

            /* Check for a non-zero IP address.  */
            if (ip_ptr -> nx_ip_interface[interface_index].nx_interface_ip_address)
            {

                /* Yes, set the appropriate bit in the current status.  */
                current_status =  current_status | NX_IP_ADDRESS_RESOLVED;
            }
        }

        if (needed_status & NX_IP_ARP_ENABLED)
        {

            /* Check for ARP being enabled.  */
            if (ip_ptr -> nx_ip_arp_periodic_update)
            {
                /* Yes, set the appropriate bit in the current status.  */
                current_status =  current_status | NX_IP_ARP_ENABLED;
            }
        }

        if (needed_status & NX_IP_RARP_COMPLETE)
        {

            /* This is effectively the same as the IP address resolved...  */

            /* Check for a non-zero IP address.  */
            if (ip_ptr -> nx_ip_interface[interface_index].nx_interface_ip_address)
            {

                /* Yes, set the appropriate bit in the current status.  */
                current_status =  current_status | NX_IP_RARP_COMPLETE;
            }
        }

        if (needed_status & NX_IP_IGMP_ENABLED)
        {

            /* Check for IGMP being enabled.  */
            if (ip_ptr -> nx_ip_igmp_packet_receive)
            {
                /* Yes, set the appropriate bit in the current status.  */
                current_status =  current_status | NX_IP_IGMP_ENABLED;
            }
        }
#endif /* !NX_DISABLE_IPV4  */

        if (needed_status & NX_IP_LINK_ENABLED)
        {

            /* Get mutex protection.  */
            tx_mutex_get(&(ip_ptr -> nx_ip_protection), TX_WAIT_FOREVER);

            /* Build the driver request structure.  */
            driver_request.nx_ip_driver_ptr =         ip_ptr;
            driver_request.nx_ip_driver_command =     NX_LINK_GET_STATUS;
            driver_request.nx_ip_driver_return_ptr =  &return_value;
            driver_request.nx_ip_driver_interface  =  &(ip_ptr -> nx_ip_interface[interface_index]);

            /* If trace is enabled, insert this event into the trace buffer.  */
            NX_TRACE_IN_LINE_INSERT(NX_TRACE_INTERNAL_IO_DRIVER_GET_STATUS, ip_ptr, 0, 0, 0, NX_TRACE_INTERNAL_EVENTS, 0, 0);

            /* Call link level driver.  */
            (ip_ptr -> nx_ip_interface[interface_index].nx_interface_link_driver_entry)(&driver_request);

            /* If the driver does not recognize this keyword, we fall back to reading the IP link status.*/
            /*lint -e{644} suppress variable might not be initialized, since "nx_ip_driver_status" was initialized in nx_interface_link_driver_entry. */
            if (driver_request.nx_ip_driver_status != NX_SUCCESS)
            {
                if (driver_request.nx_ip_driver_status == NX_UNHANDLED_COMMAND)
                {
                    if (ip_ptr -> nx_ip_interface[interface_index].nx_interface_link_up)
                    {
                        current_status = current_status | NX_IP_LINK_ENABLED;
                    }
                }
            }
            else
            {

                /* Check for a link up condition.  */
                /*lint -e{644} suppress variable might not be initialized, since "return_value" was initialized in nx_interface_link_driver_entry. */
                if (return_value == NX_TRUE)
                {

                    /* Yes, set the appropriate bit in the current status.  */
                    current_status =  current_status | NX_IP_LINK_ENABLED;
                }
            }

            /* Release mutex protection.  */
            tx_mutex_put(&(ip_ptr -> nx_ip_protection));
        }

        if (needed_status &  NX_IP_UDP_ENABLED)
        {

            /* Check for UDP being enabled.  */
            if (ip_ptr -> nx_ip_udp_packet_receive)
            {
                /* Yes, set the appropriate bit in the current status.  */
                current_status =  current_status | NX_IP_UDP_ENABLED;
            }
        }

        if (needed_status & NX_IP_TCP_ENABLED)
        {

            /* Check for TCP being enabled.  */
            if (ip_ptr -> nx_ip_tcp_packet_receive)
            {
                /* Yes, set the appropriate bit in the current status.  */
                current_status =  current_status | NX_IP_TCP_ENABLED;
            }
        }

        if (needed_status & NX_IP_INTERFACE_LINK_ENABLED)
        {

            /* Get mutex protection.  */
            tx_mutex_get(&(ip_ptr -> nx_ip_protection), TX_WAIT_FOREVER);

            /* Build the driver request structure.  */
            driver_request.nx_ip_driver_ptr =         ip_ptr;
            driver_request.nx_ip_driver_command =     NX_LINK_GET_STATUS;
            driver_request.nx_ip_driver_return_ptr =  &return_value;
            driver_request.nx_ip_driver_interface  =  &(ip_ptr -> nx_ip_interface[interface_index]);

            /* If trace is enabled, insert this event into the trace buffer.  */
            NX_TRACE_IN_LINE_INSERT(NX_TRACE_INTERNAL_IO_DRIVER_GET_STATUS, ip_ptr, 0, 0, 0, NX_TRACE_INTERNAL_EVENTS, 0, 0);

            /* Call link level driver.  */
            (ip_ptr -> nx_ip_interface[interface_index].nx_interface_link_driver_entry)(&driver_request);

            /* If the driver does not recognize this keyword, we fall back to reading the IP link status.*/
            /*lint -e{644} suppress variable might not be initialized, since "nx_ip_driver_status" was initialized in nx_interface_link_driver_entry. */
            if (driver_request.nx_ip_driver_status != NX_SUCCESS)
            {
                if (driver_request.nx_ip_driver_status == NX_UNHANDLED_COMMAND)
                {
                    if (ip_ptr -> nx_ip_interface[interface_index].nx_interface_link_up)
                    {
                        current_status = current_status | NX_IP_INTERFACE_LINK_ENABLED;
                    }
                }
            }
            else
            {

                /* Check for a link up condition.  */
                /*lint -e{644} suppress variable might not be initialized, since "return_value" was initialized in nx_interface_link_driver_entry. */
                if (return_value == NX_TRUE)
                {

                    /* Yes, set the appropriate bit in the current status.  */
                    current_status =  current_status | NX_IP_INTERFACE_LINK_ENABLED;
                }
            }

            /* Release mutex protection.  */
            tx_mutex_put(&(ip_ptr -> nx_ip_protection));
        }

        /* Determine if current status is the same.  If so, break out
           of this polling loop.  */
        if (current_status == needed_status)
        {
            break;
        }

        /* Check for suspension request.  */
        if (wait_option)
        {

            /* Decrease the wait time and sleep.  */
            if (wait_option > NX_IP_STATUS_CHECK_WAIT_TIME)
            {
                wait_option -= NX_IP_STATUS_CHECK_WAIT_TIME;
            }
            else
            {
                wait_option = 0;
            }

            /* Sleep for a tick and check again.  */
            tx_thread_sleep(NX_IP_STATUS_CHECK_WAIT_TIME);
        }
        else
        {

            /* Get out of the loop.  */
            break;
        }
    }

    /* Place the current status in the return destination.  */
    *actual_status =  current_status;

    /* Update the trace event with the status.  */
    NX_TRACE_EVENT_UPDATE(trace_event, trace_timestamp, NX_TRACE_IP_STATUS_CHECK, 0, 0, current_status, 0);

    /* Determine what status to return.  */
    if (needed_status == current_status)
    {

        /* Return a success.  */
        return(NX_SUCCESS);
    }
    else
    {

        /* Return an error.  */
        return(NX_NOT_SUCCESSFUL);
    }
}
/**************************************************************************/
/*                                                                        */
/*  FUNCTION                                               RELEASE        */
/*                                                                        */
/*    _nx_ip_interface_status_check                       PORTABLE C      */
/*                                                           6.1          */
/*  AUTHOR                                                                */
/*                                                                        */
/*    Yuxin Zhou, Microsoft Corporation                                   */
/*                                                                        */
/*  DESCRIPTION                                                           */
/*                                                                        */
/*    This function polls the specified interface for the link state using*/
/*    thread sleep for the necessary conditions n the IP instance. Where  */
/*    the requested status exists only at the IP instance, for example    */
/*    NX_IP_INITIALIZE_DONE this service supplies the IP setting for that */
/*    status.                                                             */
/*                                                                        */
/*  INPUT                                                                 */
/*                                                                        */
/*    ip_ptr                                Pointer to IP instance        */
/*    interface_index                       Index to the interface        */
/*    needed_status                         Status needed request         */
/*    actual_status                         Pointer to return status area */
/*    wait_option                           Maximum suspension time       */
/*                                                                        */
/*  OUTPUT                                                                */
/*                                                                        */
/*    status                                Completion status             */
/*                                                                        */
/*  CALLS                                                                 */
/*                                                                        */
/*    (ip_link_driver)                      User supplied link driver     */
/*    tx_mutex_get                          Get protection mutex          */
/*    tx_mutex_put                          Put protection mutex          */
/*    tx_thread_sleep                       Sleep until events are        */
/*                                            satisfied                   */
/*                                                                        */
/*  CALLED BY                                                             */
/*                                                                        */
/*    Application                                                         */
/*                                                                        */
/*  RELEASE HISTORY                                                       */
/*                                                                        */
/*    DATE              NAME                      DESCRIPTION             */
/*                                                                        */
/*  05-19-2020     Yuxin Zhou               Initial Version 6.0           */
/*  09-30-2020     Yuxin Zhou               Modified comment(s),          */
/*                                            resulting in version 6.1    */
/*                                                                        */
/**************************************************************************/
FUNCTION                                               RELEASE

_nx_ip_interface_status_check                       PORTABLE C
6.1
AUTHOR

Yuxin Zhou, Microsoft Corporation

DESCRIPTION

This function polls the specified interface for the link state using
thread sleep for the necessary conditions n the IP instance. Where
the requested status exists only at the IP instance, for example
NX_IP_INITIALIZE_DONE this service supplies the IP setting for that
status.

INPUT

ip_ptr                                Pointer to IP instance
interface_index                       Index to the interface
needed_status                         Status needed request
actual_status                         Pointer to return status area
wait_option                           Maximum suspension time

OUTPUT

status                                Completion status

CALLS

(ip_link_driver)                      User supplied link driver
tx_mutex_get                          Get protection mutex
tx_mutex_put                          Put protection mutex
tx_thread_sleep                       Sleep until events are
satisfied

CALLED BY

Application

RELEASE HISTORY

DATE              NAME                      DESCRIPTION

05-19-2020     Yuxin Zhou               Initial Version 6.0
09-30-2020     Yuxin Zhou               Modified comment(s),
resulting in version 6.1
FUNCTION RELEASE _nx_ip_interface_status_check PORTABLE C 6 . 1 AUTHOR Yuxin Zhou Microsoft Corporation DESCRIPTION This function polls the specified interface for the link state using thread sleep for the necessary conditions n the IP instance . Where the requested status exists only at the IP instance for example NX_IP_INITIALIZE_DONE this service supplies the IP setting for that status . INPUT ip_ptr Pointer to IP instance interface_index Index to the interface needed_status Status needed request actual_status Pointer to return status area wait_option Maximum suspension time OUTPUT status Completion status CALLS ( ip_link_driver ) User supplied link driver tx_mutex_get Get protection mutex tx_mutex_put Put protection mutex tx_thread_sleep Sleep until events are satisfied CALLED BY Application RELEASE HISTORY DATE NAME DESCRIPTION 05 - 19 - 2020 Yuxin Zhou Initial Version 6 . 0 09 - 30 - 2020 Yuxin Zhou Modified comment ( s ) resulting in version 6 . 1
UINT  _nx_ip_interface_status_check(NX_IP *ip_ptr, UINT interface_index, ULONG needed_status,
                                    ULONG *actual_status, ULONG wait_option)
{
ULONG                  current_status;
NX_IP_DRIVER           driver_request;
ULONG                  return_value;
#ifdef TX_ENABLE_EVENT_TRACE
TX_TRACE_BUFFER_ENTRY *trace_event;
ULONG                  trace_timestamp;
#endif
    NX_TRACE_IN_LINE_INSERT(NX_TRACE_IP_STATUS_CHECK, ip_ptr, needed_status, 0, wait_option, NX_TRACE_IP_EVENTS, &trace_event, &trace_timestamp);
    for (;;)
    {
        current_status =  0;
        if (needed_status & NX_IP_INITIALIZE_DONE)
        {
            if (ip_ptr -> nx_ip_initialize_done)
            {
                current_status =  current_status | NX_IP_INITIALIZE_DONE;
            }
        }
#ifndef NX_DISABLE_IPV4
        if (needed_status & NX_IP_ADDRESS_RESOLVED)
        {
            if (ip_ptr -> nx_ip_interface[interface_index].nx_interface_ip_address)
            {
                current_status =  current_status | NX_IP_ADDRESS_RESOLVED;
            }
        }
        if (needed_status & NX_IP_ARP_ENABLED)
        {
            if (ip_ptr -> nx_ip_arp_periodic_update)
            {
                current_status =  current_status | NX_IP_ARP_ENABLED;
            }
        }
        if (needed_status & NX_IP_RARP_COMPLETE)
        {
            if (ip_ptr -> nx_ip_interface[interface_index].nx_interface_ip_address)
            {
                current_status =  current_status | NX_IP_RARP_COMPLETE;
            }
        }
        if (needed_status & NX_IP_IGMP_ENABLED)
        {
            if (ip_ptr -> nx_ip_igmp_packet_receive)
            {
                current_status =  current_status | NX_IP_IGMP_ENABLED;
            }
        }
#endif 
        if (needed_status & NX_IP_LINK_ENABLED)
        {
            tx_mutex_get(&(ip_ptr -> nx_ip_protection), TX_WAIT_FOREVER);
            driver_request.nx_ip_driver_ptr =         ip_ptr;
            driver_request.nx_ip_driver_command =     NX_LINK_GET_STATUS;
            driver_request.nx_ip_driver_return_ptr =  &return_value;
            driver_request.nx_ip_driver_interface  =  &(ip_ptr -> nx_ip_interface[interface_index]);
            NX_TRACE_IN_LINE_INSERT(NX_TRACE_INTERNAL_IO_DRIVER_GET_STATUS, ip_ptr, 0, 0, 0, NX_TRACE_INTERNAL_EVENTS, 0, 0);
            (ip_ptr -> nx_ip_interface[interface_index].nx_interface_link_driver_entry)(&driver_request);
            if (driver_request.nx_ip_driver_status != NX_SUCCESS)
            {
                if (driver_request.nx_ip_driver_status == NX_UNHANDLED_COMMAND)
                {
                    if (ip_ptr -> nx_ip_interface[interface_index].nx_interface_link_up)
                    {
                        current_status = current_status | NX_IP_LINK_ENABLED;
                    }
                }
            }
            else
            {
                if (return_value == NX_TRUE)
                {
                    current_status =  current_status | NX_IP_LINK_ENABLED;
                }
            }
            tx_mutex_put(&(ip_ptr -> nx_ip_protection));
        }
        if (needed_status &  NX_IP_UDP_ENABLED)
        {
            if (ip_ptr -> nx_ip_udp_packet_receive)
            {
                current_status =  current_status | NX_IP_UDP_ENABLED;
            }
        }
        if (needed_status & NX_IP_TCP_ENABLED)
        {
            if (ip_ptr -> nx_ip_tcp_packet_receive)
            {
                current_status =  current_status | NX_IP_TCP_ENABLED;
            }
        }
        if (needed_status & NX_IP_INTERFACE_LINK_ENABLED)
        {
            tx_mutex_get(&(ip_ptr -> nx_ip_protection), TX_WAIT_FOREVER);
            driver_request.nx_ip_driver_ptr =         ip_ptr;
            driver_request.nx_ip_driver_command =     NX_LINK_GET_STATUS;
            driver_request.nx_ip_driver_return_ptr =  &return_value;
            driver_request.nx_ip_driver_interface  =  &(ip_ptr -> nx_ip_interface[interface_index]);
            NX_TRACE_IN_LINE_INSERT(NX_TRACE_INTERNAL_IO_DRIVER_GET_STATUS, ip_ptr, 0, 0, 0, NX_TRACE_INTERNAL_EVENTS, 0, 0);
            (ip_ptr -> nx_ip_interface[interface_index].nx_interface_link_driver_entry)(&driver_request);
            if (driver_request.nx_ip_driver_status != NX_SUCCESS)
            {
                if (driver_request.nx_ip_driver_status == NX_UNHANDLED_COMMAND)
                {
                    if (ip_ptr -> nx_ip_interface[interface_index].nx_interface_link_up)
                    {
                        current_status = current_status | NX_IP_INTERFACE_LINK_ENABLED;
                    }
                }
            }
            else
            {
                if (return_value == NX_TRUE)
                {
                    current_status =  current_status | NX_IP_INTERFACE_LINK_ENABLED;
                }
            }
            tx_mutex_put(&(ip_ptr -> nx_ip_protection));
        }
        if (current_status == needed_status)
        {
            break;
        }
        if (wait_option)
        {
            if (wait_option > NX_IP_STATUS_CHECK_WAIT_TIME)
            {
                wait_option -= NX_IP_STATUS_CHECK_WAIT_TIME;
            }
            else
            {
                wait_option = 0;
            }
            tx_thread_sleep(NX_IP_STATUS_CHECK_WAIT_TIME);
        }
        else
        {
            break;
        }
    }
    *actual_status =  current_status;
    NX_TRACE_EVENT_UPDATE(trace_event, trace_timestamp, NX_TRACE_IP_STATUS_CHECK, 0, 0, current_status, 0);
    if (needed_status == current_status)
    {
        return(NX_SUCCESS);
    }
    else
    {
        return(NX_NOT_SUCCESSFUL);
    }
}
UINT _nx_ip_interface_status_check ( NX_IP * ip_ptr , UINT interface_index , ULONG needed_status , ULONG * actual_status , ULONG wait_option ) { ULONG current_status ; NX_IP_DRIVER driver_request ; ULONG return_value ; #ifdef TX_ENABLE_EVENT_TRACE TX_TRACE_BUFFER_ENTRY * trace_event ; ULONG trace_timestamp ; #endif NX_TRACE_IN_LINE_INSERT ( NX_TRACE_IP_STATUS_CHECK , ip_ptr , needed_status , 0 , wait_option , NX_TRACE_IP_EVENTS , & trace_event , & trace_timestamp ) ; for ( ; ; ) { current_status = 0 ; if ( needed_status & NX_IP_INITIALIZE_DONE ) { if ( ip_ptr -> nx_ip_initialize_done ) { current_status = current_status | NX_IP_INITIALIZE_DONE ; } } #ifndef NX_DISABLE_IPV4 if ( needed_status & NX_IP_ADDRESS_RESOLVED ) { if ( ip_ptr -> nx_ip_interface [ interface_index ] . nx_interface_ip_address ) { current_status = current_status | NX_IP_ADDRESS_RESOLVED ; } } if ( needed_status & NX_IP_ARP_ENABLED ) { if ( ip_ptr -> nx_ip_arp_periodic_update ) { current_status = current_status | NX_IP_ARP_ENABLED ; } } if ( needed_status & NX_IP_RARP_COMPLETE ) { if ( ip_ptr -> nx_ip_interface [ interface_index ] . nx_interface_ip_address ) { current_status = current_status | NX_IP_RARP_COMPLETE ; } } if ( needed_status & NX_IP_IGMP_ENABLED ) { if ( ip_ptr -> nx_ip_igmp_packet_receive ) { current_status = current_status | NX_IP_IGMP_ENABLED ; } } #endif if ( needed_status & NX_IP_LINK_ENABLED ) { tx_mutex_get ( & ( ip_ptr -> nx_ip_protection ) , TX_WAIT_FOREVER ) ; driver_request . nx_ip_driver_ptr = ip_ptr ; driver_request . nx_ip_driver_command = NX_LINK_GET_STATUS ; driver_request . nx_ip_driver_return_ptr = & return_value ; driver_request . nx_ip_driver_interface = & ( ip_ptr -> nx_ip_interface [ interface_index ] ) ; NX_TRACE_IN_LINE_INSERT ( NX_TRACE_INTERNAL_IO_DRIVER_GET_STATUS , ip_ptr , 0 , 0 , 0 , NX_TRACE_INTERNAL_EVENTS , 0 , 0 ) ; ( ip_ptr -> nx_ip_interface [ interface_index ] . nx_interface_link_driver_entry ) ( & driver_request ) ; if ( driver_request . nx_ip_driver_status != NX_SUCCESS ) { if ( driver_request . nx_ip_driver_status == NX_UNHANDLED_COMMAND ) { if ( ip_ptr -> nx_ip_interface [ interface_index ] . nx_interface_link_up ) { current_status = current_status | NX_IP_LINK_ENABLED ; } } } else { if ( return_value == NX_TRUE ) { current_status = current_status | NX_IP_LINK_ENABLED ; } } tx_mutex_put ( & ( ip_ptr -> nx_ip_protection ) ) ; } if ( needed_status & NX_IP_UDP_ENABLED ) { if ( ip_ptr -> nx_ip_udp_packet_receive ) { current_status = current_status | NX_IP_UDP_ENABLED ; } } if ( needed_status & NX_IP_TCP_ENABLED ) { if ( ip_ptr -> nx_ip_tcp_packet_receive ) { current_status = current_status | NX_IP_TCP_ENABLED ; } } if ( needed_status & NX_IP_INTERFACE_LINK_ENABLED ) { tx_mutex_get ( & ( ip_ptr -> nx_ip_protection ) , TX_WAIT_FOREVER ) ; driver_request . nx_ip_driver_ptr = ip_ptr ; driver_request . nx_ip_driver_command = NX_LINK_GET_STATUS ; driver_request . nx_ip_driver_return_ptr = & return_value ; driver_request . nx_ip_driver_interface = & ( ip_ptr -> nx_ip_interface [ interface_index ] ) ; NX_TRACE_IN_LINE_INSERT ( NX_TRACE_INTERNAL_IO_DRIVER_GET_STATUS , ip_ptr , 0 , 0 , 0 , NX_TRACE_INTERNAL_EVENTS , 0 , 0 ) ; ( ip_ptr -> nx_ip_interface [ interface_index ] . nx_interface_link_driver_entry ) ( & driver_request ) ; if ( driver_request . nx_ip_driver_status != NX_SUCCESS ) { if ( driver_request . nx_ip_driver_status == NX_UNHANDLED_COMMAND ) { if ( ip_ptr -> nx_ip_interface [ interface_index ] . nx_interface_link_up ) { current_status = current_status | NX_IP_INTERFACE_LINK_ENABLED ; } } } else { if ( return_value == NX_TRUE ) { current_status = current_status | NX_IP_INTERFACE_LINK_ENABLED ; } } tx_mutex_put ( & ( ip_ptr -> nx_ip_protection ) ) ; } if ( current_status == needed_status ) { break ; } if ( wait_option ) { if ( wait_option > NX_IP_STATUS_CHECK_WAIT_TIME ) { wait_option -= NX_IP_STATUS_CHECK_WAIT_TIME ; } else { wait_option = 0 ; } tx_thread_sleep ( NX_IP_STATUS_CHECK_WAIT_TIME ) ; } else { break ; } } * actual_status = current_status ; NX_TRACE_EVENT_UPDATE ( trace_event , trace_timestamp , NX_TRACE_IP_STATUS_CHECK , 0 , 0 , current_status , 0 ) ; if ( needed_status == current_status ) { return ( NX_SUCCESS ) ; } else { return ( NX_NOT_SUCCESSFUL ) ; } }
FUNCTION                                               RELEASE
FUNCTION RELEASE
/* If trace is enabled, insert this event into the trace buffer.  */ /* Loop to keep checking for the proper status bits.  */ /* Clear the current status.  */ /*  Process according to the status option specified.  */ /* Check for initialization complete.  */ /* Yes, set the appropriate bit in the current status.  */ /* Check for a non-zero IP address.  */ /* Yes, set the appropriate bit in the current status.  */ /* Check for ARP being enabled.  */ /* Yes, set the appropriate bit in the current status.  */ /* This is effectively the same as the IP address resolved...  */ /* Check for a non-zero IP address.  */ /* Yes, set the appropriate bit in the current status.  */ /* Check for IGMP being enabled.  */ /* Yes, set the appropriate bit in the current status.  */ /* !NX_DISABLE_IPV4  */ /* Get mutex protection.  */ /* Build the driver request structure.  */ /* If trace is enabled, insert this event into the trace buffer.  */ /* Call link level driver.  */ /* If the driver does not recognize this keyword, we fall back to reading the IP link status.*/ /*lint -e{644} suppress variable might not be initialized, since "nx_ip_driver_status" was initialized in nx_interface_link_driver_entry. */ /* Check for a link up condition.  */ /*lint -e{644} suppress variable might not be initialized, since "return_value" was initialized in nx_interface_link_driver_entry. */ /* Yes, set the appropriate bit in the current status.  */ /* Release mutex protection.  */ /* Check for UDP being enabled.  */ /* Yes, set the appropriate bit in the current status.  */ /* Check for TCP being enabled.  */ /* Yes, set the appropriate bit in the current status.  */ /* Get mutex protection.  */ /* Build the driver request structure.  */ /* If trace is enabled, insert this event into the trace buffer.  */ /* Call link level driver.  */ /* If the driver does not recognize this keyword, we fall back to reading the IP link status.*/ /*lint -e{644} suppress variable might not be initialized, since "nx_ip_driver_status" was initialized in nx_interface_link_driver_entry. */ /* Check for a link up condition.  */ /*lint -e{644} suppress variable might not be initialized, since "return_value" was initialized in nx_interface_link_driver_entry. */ /* Yes, set the appropriate bit in the current status.  */ /* Release mutex protection.  */ /* Determine if current status is the same.  If so, break out
           of this polling loop.  */ /* Check for suspension request.  */ /* Decrease the wait time and sleep.  */ /* Sleep for a tick and check again.  */ /* Get out of the loop.  */ /* Place the current status in the return destination.  */ /* Update the trace event with the status.  */ /* Determine what status to return.  */ /* Return a success.  */ /* Return an error.  */