/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * Copyright (c) 2025-present Eclipse ThreadX Contributors * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT **************************************************************************/ /**************************************************************************/ /**************************************************************************/ /** */ /** NetX Component */ /** */ /**************************************************************************/ /**************************************************************************/ #define NX_SOURCE_CODE /* Include necessary system files. */ #include "nx_api.h" #include "nx_ip.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _nx_ip_driver_link_status_event PORTABLE C */ /* 6.4.3 */ /* AUTHOR */ /* */ /* Yuxin Zhou, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function deferrs link status event from ISR to the IP helper */ /* thread. */ /* */ /* INPUT */ /* */ /* ip_ptr Pointer to IP control block */ /* interface_index Index of interface */ /* */ /* OUTPUT */ /* */ /* None */ /* */ /* CALLS */ /* */ /* tx_event_flags_set Wakeup IP helper thread */ /* */ /* CALLED BY */ /* */ /* Application I/O Driver */ /* */ /**************************************************************************/ VOID _nx_ip_driver_link_status_event(NX_IP *ip_ptr, UINT interface_index) { TX_INTERRUPT_SAVE_AREA /* Disable interrupts. */ TX_DISABLE /* Mark link status changed. */ ip_ptr -> nx_ip_interface[interface_index].nx_interface_link_status_change = NX_TRUE; /* Wakeup IP helper thread to process the link status event. */ tx_event_flags_set(&(ip_ptr -> nx_ip_events), NX_IP_LINK_STATUS_EVENT, TX_OR); /* Restore interrupts. */ TX_RESTORE }