Rev 837 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 837 | Rev 914 | ||
---|---|---|---|
Line 19... | Line 19... | ||
19 | ;; ;; |
19 | ;; ;; |
20 | ;;10.01.2007 Bugfix for checksum function from Paolo Franchetti ;; |
20 | ;;10.01.2007 Bugfix for checksum function from Paolo Franchetti ;; |
21 | ;; ;; |
21 | ;; ;; |
22 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
22 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 23... | Line 23... | ||
23 | 23 | ||
Line 24... | Line 24... | ||
24 | $Revision: 593 $ |
24 | $Revision: 914 $ |
25 | 25 | ||
26 | 26 | ||
Line 35... | Line 35... | ||
35 | ; |
35 | ; |
36 | ;******************************************************************* |
36 | ;******************************************************************* |
Line 37... | Line 37... | ||
37 | 37 | ||
38 | uglobal |
38 | uglobal |
39 | StackCounters: |
39 | StackCounters: |
40 | dumped_rx_count: dd 0 |
40 | dumped_rx_count dd 0 |
41 | arp_tx_count: dd 0 |
41 | arp_tx_count: dd 0 |
42 | arp_rx_count: dd 0 |
42 | arp_rx_count: dd 0 |
43 | ip_rx_count: dd 0 |
43 | ip_rx_count: dd 0 |
44 | ip_tx_count: dd 0 |
44 | ip_tx_count: dd 0 |
Line 45... | Line 45... | ||
45 | endg |
45 | endg |
46 | 46 | ||
47 | ; socket buffers |
47 | ; socket buffers |
Line 48... | Line 48... | ||
48 | SOCKETBUFFSIZE equ 4096 ; state + config + buffer. |
48 | SOCKETBUFFSIZE equ 4096 ; state + config + buffer. |
Line 49... | Line 49... | ||
49 | SOCKETHEADERSIZE equ 76 ; thus 4096 - SOCKETHEADERSIZE bytes data |
49 | SOCKETHEADERSIZE equ 76+8+8 ; thus 4096 - SOCKETHEADERSIZE bytes data |
50 | 50 | ||
51 | NUM_SOCKETS equ 16 ; Number of open sockets supported. Was 20 |
51 | ;NUM_SOCKETS equ 16 ; Number of open sockets supported. Was 20 |
52 | 52 | ||
Line 92... | Line 92... | ||
92 | 92 | ||
Line 93... | Line 93... | ||
93 | 93 | ||
94 | ; TODO :: empty memory area |
94 | ; TODO :: empty memory area |
95 | 95 | ||
96 | ; Address of selected socket |
96 | ; Address of selected socket |
97 | sktAddr equ stack_data + 32 |
97 | ;sktAddr equ stack_data + 32 |
98 | ; Parameter to checksum routine - data ptr |
98 | ; Parameter to checksum routine - data ptr |
99 | checkAdd1 equ stack_data + 36 |
99 | checkAdd1 equ stack_data + 36 |
Line 108... | Line 108... | ||
108 | 108 | ||
109 | ; holds the TCP/UDP pseudo header. SA|DA|0|prot|UDP len| |
109 | ; holds the TCP/UDP pseudo header. SA|DA|0|prot|UDP len| |
Line 110... | Line 110... | ||
110 | pseudoHeader equ stack_data + 50 |
110 | pseudoHeader equ stack_data + 50 |
111 | 111 | ||
112 | ; receive and transmit IP buffer allocation |
112 | ; receive and transmit IP buffer allocation |
113 | sockets equ stack_data + 62 |
113 | ;sockets equ stack_data + 62 |
114 | Next_free2 equ sockets + (SOCKETBUFFSIZE * NUM_SOCKETS) |
114 | Next_free2 equ stack_data + 62;Next_free2 equ sockets + (SOCKETBUFFSIZE * NUM_SOCKETS) |
115 | ; 1560 byte buffer for rx / tx ethernet packets |
115 | ; 1560 byte buffer for rx / tx ethernet packets |
116 | Ether_buffer equ Next_free2 |
116 | Ether_buffer equ Next_free2 |
117 | Next_free3 equ Ether_buffer + 1518 |
117 | Next_free3 equ Ether_buffer + 1518 |
Line 126... | Line 126... | ||
126 | ; equ resendBuffer + ( IPBUFFSIZE * NUMRESENDENTRIES ) |
126 | ; equ resendBuffer + ( IPBUFFSIZE * NUMRESENDENTRIES ) |
Line 127... | Line 127... | ||
127 | 127 | ||
- | 128 | ||
128 | 129 | ||
Line -... | Line 130... | ||
- | 130 | ;resendQ equ 0x770000 |
|
- | 131 | ;resendBuffer equ resendQ + ( 4 * NUMRESENDENTRIES ) ; for TCP ; XTODO: validate size |
|
- | 132 | resendBuffer equ resendQ + ( 8 * NUMRESENDENTRIES ) ; for TCP |
|
- | 133 | ||
129 | 134 | ||
130 | ;resendQ equ 0x770000 |
135 | uglobal |
131 | resendBuffer equ resendQ + ( 4 * NUMRESENDENTRIES ) ; for TCP |
136 | net_sockets rd 2 |
132 | 137 | endg |
|
133 | 138 | ||
Line 149... | Line 154... | ||
149 | ; Below, the main network layer source code is included |
154 | ; Below, the main network layer source code is included |
150 | ; |
155 | ; |
151 | include "queue.inc" |
156 | include "queue.inc" |
152 | include "eth_drv/ethernet.inc" |
157 | include "eth_drv/ethernet.inc" |
153 | include "ip.inc" |
158 | include "ip.inc" |
154 | include "icmp.inc" |
- | |
155 | include "tcp.inc" |
- | |
156 | include "udp.inc" |
- | |
157 | include "socket.inc" |
159 | include "socket.inc" |
Line 158... | Line 160... | ||
158 | 160 | ||
159 | ;*************************************************************************** |
161 | ;*************************************************************************** |
160 | ; Function |
162 | ; Function |
Line 169... | Line 171... | ||
169 | ;*************************************************************************** |
171 | ;*************************************************************************** |
Line 170... | Line 172... | ||
170 | 172 | ||
171 | stack_init: |
173 | stack_init: |
172 | ; Init two address spaces with default values |
174 | ; Init two address spaces with default values |
173 | _memset_dw stack_data_start, 0, 0x20000/4 |
175 | _memset_dw stack_data_start, 0, 0x20000/4 |
- | 176 | _memset_dw resendQ, 0, NUMRESENDENTRIES * 2 |
|
- | 177 | ||
- | 178 | mov [net_sockets], 0 |
|
Line 174... | Line 179... | ||
174 | _memset_dw resendQ, 0xFFFFFFFF, NUMRESENDENTRIES |
179 | mov [net_sockets + 4], 0 |
175 | 180 | ||
Line 176... | Line 181... | ||
176 | ; Queries initialization |
181 | ; Queries initialization |