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
102
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
141
142
143
144
145
146
149
150
151
152
153
154
155
156
157
158
159
160
161
167
168
169
170
171
172
173
174
175
176
177
178
...
...
...
#define NX_SOURCE_CODE
#include "nx_api.h"
#include "nx_arp.h"
#include "nx_ip.h"
#include "nx_packet.h"
#ifndef NX_DISABLE_IPV4...
...
VOID _nx_arp_queue_send(NX_IP *ip_ptr, NX_ARP *arp_ptr)
{
TX_INTERRUPT_SAVE_AREA
NX_PACKET *queued_list_head;
NX_PACKET *packet_ptr;
NX_IP_DRIVER driver_request;
queued_list_head = NX_NULL;
TX_DISABLE
if (arp_ptr -> nx_arp_packets_waiting)
{
queued_list_head = arp_ptr -> nx_arp_packets_waiting;
arp_ptr -> nx_arp_packets_waiting = NX_NULL;
}if (arp_ptr -> nx_arp_packets_waiting) { ... }
TX_RESTORE
while (queued_list_head)
{
packet_ptr = queued_list_head;
queued_list_head = queued_list_head -> nx_packet_queue_next;
packet_ptr -> nx_packet_queue_next = NX_NULL;
packet_ptr -> nx_packet_address.nx_packet_interface_ptr = arp_ptr -> nx_arp_ip_interface;
driver_request.nx_ip_driver_physical_address_msw = arp_ptr -> nx_arp_physical_address_msw;
driver_request.nx_ip_driver_physical_address_lsw = arp_ptr -> nx_arp_physical_address_lsw;
driver_request.nx_ip_driver_ptr = ip_ptr;
driver_request.nx_ip_driver_command = NX_LINK_PACKET_SEND;
driver_request.nx_ip_driver_packet = packet_ptr;
driver_request.nx_ip_driver_interface = packet_ptr -> nx_packet_address.nx_packet_interface_ptr;
if (packet_ptr -> nx_packet_length > packet_ptr -> nx_packet_address.nx_packet_interface_ptr -> nx_interface_ip_mtu_size)
{
#ifndef NX_DISABLE_FRAGMENTATION
if (ip_ptr -> nx_ip_fragment_processing)
{
(ip_ptr -> nx_ip_fragment_processing)(&driver_request);
}if (ip_ptr -> nx_ip_fragment_processing) { ... }
else
{
#endif
#ifndef NX_DISABLE_IP_INFO
ip_ptr -> nx_ip_send_packets_dropped++;/* ... */
#endif
_nx_packet_transmit_release(packet_ptr);
#ifndef NX_DISABLE_FRAGMENTATION
}else { ... }
#endif
}if (packet_ptr -> nx_packet_length > packet_ptr -> nx_packet_address.nx_packet_interface_ptr -> nx_interface_ip_mtu_size) { ... }
else
{
#ifndef NX_DISABLE_IP_INFO
ip_ptr -> nx_ip_total_packets_sent++;
ip_ptr -> nx_ip_total_bytes_sent += packet_ptr -> nx_packet_length - (ULONG)sizeof(NX_IPV4_HEADER);/* ... */
#endif
NX_TRACE_IN_LINE_INSERT(NX_TRACE_INTERNAL_IO_DRIVER_PACKET_SEND, ip_ptr, packet_ptr, packet_ptr -> nx_packet_length, 0, NX_TRACE_INTERNAL_EVENTS, 0, 0);
(packet_ptr -> nx_packet_address.nx_packet_interface_ptr -> nx_interface_link_driver_entry)(&driver_request);
}else { ... }
}while (queued_list_head) { ... }
}{ ... }
#endif/* ... */