diff --git a/kernel/branches/net/drivers/pcnet32.asm b/kernel/branches/net/drivers/pcnet32.asm index e350f471f4..493aa024fb 100644 --- a/kernel/branches/net/drivers/pcnet32.asm +++ b/kernel/branches/net/drivers/pcnet32.asm @@ -10,7 +10,7 @@ ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision$ +; $Revision$ format MS COFF @@ -1258,6 +1258,7 @@ int_handler: test ax, PCNET_CSR_RINT jz @f +.receiver_test_loop: movzx eax, [ebx + device.cur_rx] ; and eax, PCNET_RX_RING_MOD_MASK mov edi, eax @@ -1288,6 +1289,7 @@ int_handler: test eax, eax ; Test if we allocated succesfully jz .abort ; + push .receiver_test_loop ; push ecx ; for eth_receiver push eax ; diff --git a/kernel/branches/net/network/ARP.inc b/kernel/branches/net/network/ARP.inc index 082fa52857..77fcf60ccb 100644 --- a/kernel/branches/net/network/ARP.inc +++ b/kernel/branches/net/network/ARP.inc @@ -345,8 +345,8 @@ ARP_add_entry: test ecx, ecx jz .add - mov eax, dword[esp + ARP_ENTRY.MAC] - mov bx , word[esp + ARP_ENTRY.MAC + 4] + mov eax, dword[esp + 4 + ARP_ENTRY.MAC] + mov bx , word[esp + 4 + ARP_ENTRY.MAC + 4] mov esi, ARPTable .loop: @@ -357,7 +357,7 @@ ARP_add_entry: cmp dword[esi + ARP_ENTRY.TTL], 0xFFFF ; static entry jne .notstatic - cmp dword[esp + ARP_ENTRY.TTL], 0xFFFF + cmp dword[esp + 4 + ARP_ENTRY.TTL], 0xFFFF jne .error .notstatic: @@ -386,10 +386,8 @@ ARP_add_entry: pop eax .exit: - pop ebx ; return addr - add esp, ARP_ENTRY.size DEBUGF 1,"Exiting\n" - jmp ebx + ret ARP_ENTRY.size .error: @@ -639,7 +637,8 @@ ARP_API: mov edi, esp mov ecx, ARP_ENTRY.size/2 rep movsw - jmp ARP_add_entry ;out: eax = entry number, -1 on error + call ARP_add_entry ;out: eax = entry number, -1 on error + ret .remove: ; ecx = # entry diff --git a/kernel/branches/net/network/IPv4.inc b/kernel/branches/net/network/IPv4.inc index 80102e06de..826c84166e 100644 --- a/kernel/branches/net/network/IPv4.inc +++ b/kernel/branches/net/network/IPv4.inc @@ -529,7 +529,7 @@ IPv4_create_packet: cmp ecx, 1480 jg .exit_ - cmp ebx, ebx ; if dest ip = 0 + test ebx, ebx ; if dest ip = 0 jnz .ip_ok ; and local ip is valid ; use local ip instead cmp [IP_LIST],0xffffffff ; diff --git a/kernel/branches/net/network/stack.inc b/kernel/branches/net/network/stack.inc index 899e27f0af..9712e9d3a1 100644 --- a/kernel/branches/net/network/stack.inc +++ b/kernel/branches/net/network/stack.inc @@ -177,9 +177,8 @@ checksum_1: popf jnc .end - lodsb - shl ax, 8 - add edx, eax + add dh, [esi] + adc edx, 0 .end: diff --git a/kernel/branches/net/network/udp.inc b/kernel/branches/net/network/udp.inc index 75ae1a6f64..91da91ce66 100644 --- a/kernel/branches/net/network/udp.inc +++ b/kernel/branches/net/network/udp.inc @@ -210,8 +210,6 @@ UDP_socket_send: ; Create the pseudoheader in stack, ; (now that we still have all the variables that are needed.) push dword IP_PROTO_UDP shl 8 - push eax - push ebx add ecx, UDP_Packet.Data @@ -222,12 +220,12 @@ UDP_socket_send: cmp edi, -1 je .fail - mov [esp + 8 + 12], eax ; pointer to buffer start - mov [esp + 8 + 12 + 4], edx ; buffer size + mov [esp + 8 + 4], eax ; pointer to buffer start + mov [esp + 8 + 4 + 4], edx ; buffer size rol cx, 8 mov [edi + UDP_Packet.Length], cx - mov [esp + 8 + 10], cx + mov [esp + 8 + 2], cx ror cx, 8 pop esi @@ -237,7 +235,7 @@ UDP_socket_send: shr ecx, 2 rep movsd mov ecx, [esp] - and cx , 3 + and ecx, 3 rep movsb pop ecx edi @@ -249,6 +247,8 @@ UDP_socket_send: mov esi, edi call checksum_1 ; Checksum for pseudoheader + pushd [edi-4] ; destination address + pushd [edi-8] ; source address mov ecx, 12 mov esi, esp call checksum_1