Rev 2220 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2220 | Rev 2300 | ||
---|---|---|---|
Line 12... | Line 12... | ||
12 | ;; GNU GENERAL PUBLIC LICENSE ;; |
12 | ;; GNU GENERAL PUBLIC LICENSE ;; |
13 | ;; Version 2, June 1991 ;; |
13 | ;; Version 2, June 1991 ;; |
14 | ;; ;; |
14 | ;; ;; |
15 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
15 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 16... | Line 16... | ||
16 | 16 | ||
Line 17... | Line 17... | ||
17 | $Revision: 2220 $ |
17 | $Revision: 2300 $ |
18 | 18 | ||
19 | struct ETH_FRAME |
19 | struct ETH_FRAME |
20 | .DstMAC dp ? ; destination MAC-address |
20 | .DstMAC dp ? ; destination MAC-address |
Line 62... | Line 62... | ||
62 | mov eax, [esp] |
62 | mov eax, [esp] |
63 | mov ecx, [esp+4] |
63 | mov ecx, [esp+4] |
Line 64... | Line 64... | ||
64 | 64 | ||
65 | DEBUGF 1,"ETH_input - size: %u\n", ecx |
65 | DEBUGF 1,"ETH_input - size: %u\n", ecx |
66 | cmp ecx, 60 ; check packet length |
66 | cmp ecx, 60 ; check packet length |
67 | jl .dump |
67 | jb .dump |
Line 68... | Line 68... | ||
68 | sub ecx, ETH_FRAME.Data |
68 | sub ecx, ETH_FRAME.Data |
69 | 69 | ||
Line 108... | Line 108... | ||
108 | ETH_output: |
108 | ETH_output: |
Line 109... | Line 109... | ||
109 | 109 | ||
Line 110... | Line 110... | ||
110 | DEBUGF 1,"ETH_output: size=%u device:%x\n", ecx, ebx |
110 | DEBUGF 1,"ETH_output: size=%u device:%x\n", ecx, ebx |
111 | 111 | ||
Line 112... | Line 112... | ||
112 | cmp ecx, [ebx + NET_DEVICE.mtu] |
112 | cmp ecx, [ebx + NET_DEVICE.mtu] |
113 | jg .exit |
113 | ja .exit |
114 | 114 | ||
Line 138... | Line 138... | ||
138 | lea eax, [edi - ETH_FRAME.Data] ; Set eax to buffer start |
138 | lea eax, [edi - ETH_FRAME.Data] ; Set eax to buffer start |
139 | mov edx, ecx ; Set edx to complete buffer size |
139 | mov edx, ecx ; Set edx to complete buffer size |
Line 140... | Line 140... | ||
140 | 140 | ||
Line 141... | Line 141... | ||
141 | pop ecx ; >> 1 |
141 | pop ecx ; >> 1 |
142 | 142 | ||
143 | cmp edx, 60-1 ; minimum ethernet packet size |
143 | cmp edx, 60 ; minimum ethernet packet size |
144 | jle .adjust_size |
144 | jb .adjust_size |
Line 145... | Line 145... | ||
145 | DEBUGF 1,"ETH_output: done: %x total size: %u\n", eax, edx |
145 | DEBUGF 1,"ETH_output: done: %x total size: %u\n", eax, edx |
146 | ret |
146 | ret |
Line 179... | Line 179... | ||
179 | ;----------------------------------------------------------------- |
179 | ;----------------------------------------------------------------- |
180 | align 4 |
180 | align 4 |
181 | ETH_API: |
181 | ETH_API: |
Line 182... | Line 182... | ||
182 | 182 | ||
183 | cmp bh, MAX_NET_DEVICES |
183 | cmp bh, MAX_NET_DEVICES |
184 | jg .error |
184 | ja .error |
185 | movzx eax, bh |
185 | movzx eax, bh |
Line 186... | Line 186... | ||
186 | shl eax, 2 |
186 | shl eax, 2 |
187 | 187 |