AzureMXChip/MXCHIPAZ3166/core/lib/netxduo/common/src/nx_ip_interface_capability_set.c
UINT  _nx_ip_interface_capability_set(NX_IP *ip_ptr, UINT interface_index, ULONG interface_capability_flag)
{
#ifdef NX_ENABLE_INTERFACE_CAPABILITY

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

    /* Set interface capability flag. */
    ip_ptr -> nx_ip_interface[interface_index].nx_interface_capability_flag = interface_capability_flag;

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

    /* Return completion status.  */
    return(NX_SUCCESS);

#else /* NX_ENABLE_INTERFACE_CAPABILITY */
    NX_PARAMETER_NOT_USED(ip_ptr);
    NX_PARAMETER_NOT_USED(interface_index);
    NX_PARAMETER_NOT_USED(interface_capability_flag);

    return(NX_NOT_SUPPORTED);

#endif /* NX_ENABLE_INTERFACE_CAPABILITY */
}
/**************************************************************************/
/*                                                                        */
/*  FUNCTION                                               RELEASE        */
/*                                                                        */
/*    _nx_ip_interface_capability_set                     PORTABLE C      */
/*                                                           6.1          */
/*  AUTHOR                                                                */
/*                                                                        */
/*    Yuxin Zhou, Microsoft Corporation                                   */
/*                                                                        */
/*  DESCRIPTION                                                           */
/*                                                                        */
/*    This function sets the capability flag of the specified network     */
/*    interface.  It is typically called by the device driver during      */
/*    initializaion phase to notify the IP stack the hardware capability  */
/*    available from the this device.                                     */
/*                                                                        */
/*  INPUT                                                                 */
/*                                                                        */
/*    ip_ptr                                IP control block pointer      */
/*    interface_index                       Index to the network          */
/*                                            interface                   */
/*    interface_capability_flag             Interface capability flag     */
/*                                                                        */
/*  OUTPUT                                                                */
/*                                                                        */
/*    status                                Completion status             */
/*                                                                        */
/*  CALLS                                                                 */
/*                                                                        */
/*    tx_mutex_get                          Get protection mutex          */
/*    tx_mutex_put                          Put protection mutex          */
/*                                                                        */
/*  CALLED BY                                                             */
/*                                                                        */
/*    Application Code                                                    */
/*                                                                        */
/*  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_capability_set                     PORTABLE C
6.1
AUTHOR

Yuxin Zhou, Microsoft Corporation

DESCRIPTION

This function sets the capability flag of the specified network
interface.  It is typically called by the device driver during
initializaion phase to notify the IP stack the hardware capability
available from the this device.

INPUT

ip_ptr                                IP control block pointer
interface_index                       Index to the network
interface
interface_capability_flag             Interface capability flag

OUTPUT

status                                Completion status

CALLS

tx_mutex_get                          Get protection mutex
tx_mutex_put                          Put protection mutex

CALLED BY

Application Code

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_capability_set PORTABLE C 6 . 1 AUTHOR Yuxin Zhou Microsoft Corporation DESCRIPTION This function sets the capability flag of the specified network interface . It is typically called by the device driver during initializaion phase to notify the IP stack the hardware capability available from the this device . INPUT ip_ptr IP control block pointer interface_index Index to the network interface interface_capability_flag Interface capability flag OUTPUT status Completion status CALLS tx_mutex_get Get protection mutex tx_mutex_put Put protection mutex CALLED BY Application Code 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_capability_set(NX_IP *ip_ptr, UINT interface_index, ULONG interface_capability_flag)
{
#ifdef NX_ENABLE_INTERFACE_CAPABILITY
    tx_mutex_get(&(ip_ptr -> nx_ip_protection), TX_WAIT_FOREVER);
    ip_ptr -> nx_ip_interface[interface_index].nx_interface_capability_flag = interface_capability_flag;
    tx_mutex_put(&(ip_ptr -> nx_ip_protection));
    return(NX_SUCCESS);
#else 
    NX_PARAMETER_NOT_USED(ip_ptr);
    NX_PARAMETER_NOT_USED(interface_index);
    NX_PARAMETER_NOT_USED(interface_capability_flag);
    return(NX_NOT_SUPPORTED);
#endif 
}
UINT _nx_ip_interface_capability_set ( NX_IP * ip_ptr , UINT interface_index , ULONG interface_capability_flag ) { #ifdef NX_ENABLE_INTERFACE_CAPABILITY tx_mutex_get ( & ( ip_ptr -> nx_ip_protection ) , TX_WAIT_FOREVER ) ; ip_ptr -> nx_ip_interface [ interface_index ] . nx_interface_capability_flag = interface_capability_flag ; tx_mutex_put ( & ( ip_ptr -> nx_ip_protection ) ) ; return ( NX_SUCCESS ) ; #else NX_PARAMETER_NOT_USED ( ip_ptr ) ; NX_PARAMETER_NOT_USED ( interface_index ) ; NX_PARAMETER_NOT_USED ( interface_capability_flag ) ; return ( NX_NOT_SUPPORTED ) ; #endif }
FUNCTION                                               RELEASE
FUNCTION RELEASE
/* Get mutex protection.  */ /* Set interface capability flag. */ /* Release mutex protection.  */ /* Return completion status.  */ /* NX_ENABLE_INTERFACE_CAPABILITY */ /* NX_ENABLE_INTERFACE_CAPABILITY */