1 /***************************************************************************
2  * Copyright (c) 2024 Microsoft Corporation
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the MIT License which is available at
6  * https://opensource.org/licenses/MIT.
7  *
8  * SPDX-License-Identifier: MIT
9  **************************************************************************/
10 
11 
12 /**************************************************************************/
13 /**************************************************************************/
14 /**                                                                       */
15 /** NetX Component                                                        */
16 /**                                                                       */
17 /**   System Management (System)                                          */
18 /**                                                                       */
19 /**************************************************************************/
20 /**************************************************************************/
21 
22 
23 /**************************************************************************/
24 /*                                                                        */
25 /*  COMPONENT DEFINITION                                   RELEASE        */
26 /*                                                                        */
27 /*    nx_system.h                                         PORTABLE C      */
28 /*                                                           6.1          */
29 /*  AUTHOR                                                                */
30 /*                                                                        */
31 /*    Yuxin Zhou, Microsoft Corporation                                   */
32 /*                                                                        */
33 /*  DESCRIPTION                                                           */
34 /*                                                                        */
35 /*    This file defines the NetX system management component,             */
36 /*    including all data types and external references.  It is assumed    */
37 /*    that nx_api.h and nx_port.h have already been included.             */
38 /*                                                                        */
39 /*  RELEASE HISTORY                                                       */
40 /*                                                                        */
41 /*    DATE              NAME                      DESCRIPTION             */
42 /*                                                                        */
43 /*  05-19-2020     Yuxin Zhou               Initial Version 6.0           */
44 /*  09-30-2020     Yuxin Zhou               Modified comment(s),          */
45 /*                                            resulting in version 6.1    */
46 /*                                                                        */
47 /**************************************************************************/
48 
49 #ifndef NX_SYS_H
50 #define NX_SYS_H
51 
52 
53 
54 /* Define system management function prototypes.  */
55 
56 VOID _nx_system_initialize(VOID);
57 
58 
59 /* Define error checking shells for API services.  These are only referenced by the
60    application.  */
61 
62 /* System management component data declarations follow.  */
63 
64 /* Determine if the initialization function of this component is including
65    this file.  If so, make the data definitions really happen.  Otherwise,
66    make them extern so other functions in the component can access them.  */
67 
68 /*lint -e767 suppress different definitions.  */
69 #ifdef NX_SYSTEM_INIT
70 #define SYSTEM_DECLARE
71 #else
72 #define SYSTEM_DECLARE extern
73 #endif
74 /*lint +e767 enable checking for different definitions.  */
75 
76 
77 /* Define the global NetX build options variables. These variables contain a bit
78    map representing how the NetX library was built. The following are the bit
79    field definitions:
80 
81     _nx_system_build_options_1:
82 
83                     Bit(s)                   Meaning
84 
85                     31                  NX_LITTLE_ENDIAN
86                     30                  NX_DISABLE_ARP_AUTO_ENTRY
87                     29                  NX_ENABLE_TCP_KEEPALIVE
88                     28                  NX_TCP_IMMEDIATE_ACK
89                     27                  NX_DRIVER_DEFERRED_PROCESSING
90                     26                  NX_DISABLE_FRAGMENTATION
91                     25                  NX_DISABLE_IP_RX_CHECKSUM
92                     24                  NX_DISABLE_IP_TX_CHECKSUM
93                     23                  NX_DISABLE_TCP_RX_CHECKSUM
94                     22                  NX_DISABLE_TCP_TX_CHECKSUM
95                     21                  NX_DISABLE_RESET_DISCONNECT
96                     20                  NX_DISABLE_RX_SIZE_CHECKING
97                     19                  NX_DISABLE_ARP_INFO
98                     18                  NX_DISABLE_IP_INFO
99                     17                  NX_DISABLE_ICMP_INFO
100                     16                  NX_DISABLE_IGMP_INFO
101                     15                  NX_DISABLE_PACKET_INFO
102                     14                  NX_DISABLE_RARP_INFO
103                     13                  NX_DISABLE_TCP_INFO
104                     12                  NX_DISABLE_UDP_INFO
105                     3-0                 NX_TCP_RETRY_SHIFT
106 
107     _nx_system_build_options_2:
108 
109                     Bit(s)                   Meaning
110 
111                     31-16               NX_IP_PERIODIC_RATE
112                     15-8                NX_ARP_EXPIRATION_RATE
113                     7-0                 NX_ARP_UPDATE_RATE
114 
115     _nx_system_build_options_3:
116 
117                     Bit(s)                   Meaning
118 
119                     31-24               NX_TCP_ACK_TIMER_RATE
120                     23-16               NX_TCP_FAST_TIMER_RATE
121                     15-8                NX_TCP_TRANSMIT_TIMER_RATE
122                     7-0                 NX_TCP_KEEPALIVE_RETRY
123 
124     _nx_system_build_options_4:
125 
126                     Bit(s)                   Meaning
127 
128                     31-16               NX_TCP_KEEPALIVE_INITIAL
129                     15-8                NX_ARP_MAXIMUM_RETRIES
130                     7-4                 NX_ARP_MAX_QUEUE_DEPTH
131                     3-0                 NX_TCP_KEEPALIVE_RETRIES
132 
133     _nx_system_build_options_5:
134 
135                     Bit(s)                   Meaning
136 
137                     31-24               NX_MAX_MULTICAST_GROUPS
138                     23-16               NX_MAX_LISTEN_REQUESTS
139                     15-8                NX_TCP_MAXIMUM_RETRIES
140                     7-0                 NX_TCP_MAXIMUM_TX_QUEUE
141 
142    Note that values greater than the value that can be represented in the build options
143    bit field are represented as all ones in the bit field. For example, if NX_TCP_ACK_TIMER_RATE
144    is 256, the value in the bits 31-24 of _nx_system_build_options_3 is 0xFF, which is 255
145    decimal.  */
146 
147 SYSTEM_DECLARE  ULONG       _nx_system_build_options_1;
148 SYSTEM_DECLARE  ULONG       _nx_system_build_options_2;
149 SYSTEM_DECLARE  ULONG       _nx_system_build_options_3;
150 SYSTEM_DECLARE  ULONG       _nx_system_build_options_4;
151 SYSTEM_DECLARE  ULONG       _nx_system_build_options_5;
152 
153 
154 #endif
155 
156