1 /**************************************************************************/
2 /* */
3 /* Copyright (c) Microsoft Corporation. All rights reserved. */
4 /* */
5 /* This software is licensed under the Microsoft Software License */
6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */
7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
8 /* and in the root directory of this software. */
9 /* */
10 /**************************************************************************/
11
12
13 /**************************************************************************/
14 /**************************************************************************/
15 /** */
16 /** NetX Component */
17 /** */
18 /** Internet Protocol (IP) */
19 /** */
20 /**************************************************************************/
21 /**************************************************************************/
22
23 #define NX_SOURCE_CODE
24
25
26 /* Include necessary system files. */
27
28 #include "nx_api.h"
29 #include "nx_ip.h"
30
31
32 /**************************************************************************/
33 /* */
34 /* FUNCTION RELEASE */
35 /* */
36 /* _nx_ip_driver_deferred_processing PORTABLE C */
37 /* 6.1 */
38 /* AUTHOR */
39 /* */
40 /* Yuxin Zhou, Microsoft Corporation */
41 /* */
42 /* DESCRIPTION */
43 /* */
44 /* This function causes the driver to be called from the IP helper */
45 /* thread in order to finish some deferred processing. A typical */
46 /* example of this is the transmit complete interrupt. Instead of */
47 /* loading the packet inside the transmit complete interrupt, the */
48 /* driver can setup some internal variables and call this routine */
49 /* to be called subsequently from the IP helper thread to finish */
50 /* the transmit complete interrupt processing. */
51 /* */
52 /* INPUT */
53 /* */
54 /* ip_ptr Pointer to IP control block */
55 /* */
56 /* OUTPUT */
57 /* */
58 /* None */
59 /* */
60 /* CALLS */
61 /* */
62 /* tx_event_flags_set Set event flags to wake IP */
63 /* helper thread */
64 /* */
65 /* CALLED BY */
66 /* */
67 /* Application Driver */
68 /* */
69 /* RELEASE HISTORY */
70 /* */
71 /* DATE NAME DESCRIPTION */
72 /* */
73 /* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
74 /* 09-30-2020 Yuxin Zhou Modified comment(s), */
75 /* resulting in version 6.1 */
76 /* */
77 /**************************************************************************/
_nx_ip_driver_deferred_processing(NX_IP * ip_ptr)78 VOID _nx_ip_driver_deferred_processing(NX_IP *ip_ptr)
79 {
80
81 /* Set event flags to wake the IP helper thread, which will in turn
82 call the driver with the NX_LINK_DEFERRED_PROCESSING command. */
83 tx_event_flags_set(&(ip_ptr -> nx_ip_events), NX_IP_DRIVER_DEFERRED_EVENT, TX_OR);
84 }
85
86