1
10
13
14
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
...
...
...
#define NX_SOURCE_CODE
#define NX_SYSTEM_INIT
#include "nx_api.h"
#include "nx_system.h"
#include "nx_packet.h"
#include "nx_arp.h"
#include "nx_rarp.h"
#include "nx_ip.h"
#include "nx_udp.h"
#include "nx_icmp.h"
#include "nx_igmp.h"
#include "nx_tcp.h"
10 includes
#ifdef FEATURE_NX_IPV6
#include "nx_nd_cache.h"
#endif
...
...
VOID _nx_system_initialize(VOID)
{
if (_nx_system_build_options_1 | _nx_system_build_options_2 |
_nx_system_build_options_3 | _nx_system_build_options_4 | _nx_system_build_options_5)
{
return;
}if (_nx_system_build_options_1 | _nx_system_build_options_2 | _nx_system_build_options_3 | _nx_system_build_options_4 | _nx_system_build_options_5) { ... }
NX_TRACE_IN_LINE_INSERT(NX_TRACE_SYSTEM_INITIALIZE, 0, 0, 0, 0, NX_TRACE_INTERNAL_EVENTS, 0, 0);
_nx_packet_pool_initialize();
_nx_ip_initialize();
_nx_tcp_initialize();
_nx_system_build_options_1 = 0
#ifdef NX_LITTLE_ENDIAN
| (((ULONG)1) << 31)
#endif
#ifdef NX_DISABLE_ARP_AUTO_ENTRY
| (((ULONG)1) << 30)
#endif
#ifdef NX_ENABLE_TCP_KEEPALIVE
| (((ULONG)1) << 29)
#endif
#ifdef NX_TCP_IMMEDIATE_ACK
| (((ULONG)1) << 28)
#endif
#ifdef NX_DRIVER_DEFERRED_PROCESSING
| (((ULONG)1) << 27)
#endif
#ifdef NX_DISABLE_FRAGMENTATION
| (((ULONG)1) << 26)
#endif
#ifdef NX_DISABLE_IP_RX_CHECKSUM
| (((ULONG)1) << 25)
#endif
#ifdef NX_DISABLE_IP_TX_CHECKSUM
| (((ULONG)1) << 24)
#endif
#ifdef NX_DISABLE_TCP_RX_CHECKSUM
| (((ULONG)1) << 23)
#endif
#ifdef NX_DISABLE_TCP_TX_CHECKSUM
| (((ULONG)1) << 22)
#endif
#ifdef NX_DISABLE_RESET_DISCONNECT
| (((ULONG)1) << 21)
#endif
#ifdef NX_DISABLE_RX_SIZE_CHECKING
| (((ULONG)1) << 20)
#endif
#ifdef NX_DISABLE_ARP_INFO
| (((ULONG)1) << 19)
#endif
#ifdef NX_DISABLE_IP_INFO
| (((ULONG)1) << 18)
#endif
#ifdef NX_DISABLE_ICMP_INFO
| (((ULONG)1) << 17)
#endif
#ifdef NX_DISABLE_IGMP_INFO
| (((ULONG)1) << 16)
#endif
#ifdef NX_DISABLE_PACKET_INFO
| (((ULONG)1) << 15)
#endif
#ifdef NX_DISABLE_RARP_INFO
| (((ULONG)1) << 14)
#endif
#ifdef NX_DISABLE_TCP_INFO
| (((ULONG)1) << 13)
#endif
#ifdef NX_DISABLE_UDP_INFO
| (((ULONG)1) << 12)
#endif
;
#if (NX_TCP_RETRY_SHIFT > 0xF)
_nx_system_build_options_1 |= 0xF;
#else
_nx_system_build_options_1 |= NX_TCP_RETRY_SHIFT;
#endif
#if (NX_IP_PERIODIC_RATE > 0xFFFFUL)
_nx_system_build_options_2 = ((ULONG)0xFFFF0000);
#else
_nx_system_build_options_2 = ((ULONG)NX_IP_PERIODIC_RATE) << 16;
#endif
#if (NX_ARP_EXPIRATION_RATE > 0xFF)
_nx_system_build_options_2 |= ((ULONG)0xFF) << 8;
#else
_nx_system_build_options_2 |= ((ULONG)NX_ARP_EXPIRATION_RATE) << 8;
#endif
#if (NX_ARP_UPDATE_RATE > 0xFF)
_nx_system_build_options_2 |= ((ULONG)0xFF);
#else
_nx_system_build_options_2 |= ((ULONG)NX_ARP_UPDATE_RATE);
#endif
#if (NX_TCP_ACK_TIMER_RATE > 0xFF)
_nx_system_build_options_3 = ((ULONG)0xFF000000);
#else
_nx_system_build_options_3 = ((ULONG)NX_TCP_ACK_TIMER_RATE) << 24;
#endif
#if (NX_TCP_FAST_TIMER_RATE > 0xFF)
_nx_system_build_options_3 |= ((ULONG)0xFF) << 16;
#else
_nx_system_build_options_3 |= ((ULONG)NX_TCP_FAST_TIMER_RATE) << 16;
#endif
#if (NX_TCP_TRANSMIT_TIMER_RATE > 0xFF)
_nx_system_build_options_3 |= ((ULONG)0xFF) << 8;
#else
_nx_system_build_options_3 |= ((ULONG)NX_TCP_TRANSMIT_TIMER_RATE) << 8;
#endif
#if (NX_TCP_KEEPALIVE_RETRY > 0xFF)
_nx_system_build_options_3 |= ((ULONG)0xFF);
#else
_nx_system_build_options_3 |= ((ULONG)NX_TCP_KEEPALIVE_RETRY);
#endif
#if (NX_TCP_KEEPALIVE_INITIAL > 0xFFFFUL)
_nx_system_build_options_4 = ((ULONG)0xFFFF0000);
#else
_nx_system_build_options_4 = ((ULONG)NX_TCP_KEEPALIVE_INITIAL) << 16;
#endif
#if (NX_ARP_MAXIMUM_RETRIES > 0xFF)
_nx_system_build_options_4 |= ((ULONG)0xFF) << 8;
#else
_nx_system_build_options_4 |= ((ULONG)NX_ARP_MAXIMUM_RETRIES) << 8;
#endif
#if (NX_ARP_MAX_QUEUE_DEPTH > 0xF)
_nx_system_build_options_4 |= ((ULONG)0xF) << 4;
#else
_nx_system_build_options_4 |= ((ULONG)NX_ARP_MAX_QUEUE_DEPTH) << 4;
#endif
#if (NX_TCP_KEEPALIVE_RETRIES > 0xF)
_nx_system_build_options_4 |= ((ULONG)0xF);
#else
_nx_system_build_options_4 |= ((ULONG)NX_TCP_KEEPALIVE_RETRIES);
#endif
#if (NX_MAX_MULTICAST_GROUPS > 0xFF)
_nx_system_build_options_5 = ((ULONG)0xFF000000);
#else
_nx_system_build_options_5 = ((ULONG)NX_MAX_MULTICAST_GROUPS) << 24;
#endif
#if (NX_MAX_LISTEN_REQUESTS > 0xFF)
_nx_system_build_options_5 |= ((ULONG)0xFF) << 16;
#else
_nx_system_build_options_5 |= ((ULONG)NX_MAX_LISTEN_REQUESTS) << 16;
#endif
#if (NX_TCP_MAXIMUM_RETRIES > 0xFF)
_nx_system_build_options_5 |= ((ULONG)0xFF) << 8;
#else
_nx_system_build_options_5 |= ((ULONG)NX_TCP_MAXIMUM_RETRIES) << 8;
#endif
#if (NX_TCP_MAXIMUM_TX_QUEUE > 0xFF)
_nx_system_build_options_5 |= ((ULONG)0xFF);
#else
_nx_system_build_options_5 |= ((ULONG)NX_TCP_MAXIMUM_TX_QUEUE);
#endif
}{ ... }