From 65fa2636467f8248903c3a708b8befd0fbde83da Mon Sep 17 00:00:00 2001 From: CleverMouse Date: Thu, 24 Sep 2009 10:43:38 +0000 Subject: [PATCH] * UDP data length includes sizeof UDP header * fixes in RTL8139 driver * fixes in RTL8029 driver (works in Bochs, still problems in qemu) git-svn-id: svn://kolibrios.org@1173 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/drivers/RTL8029.asm | 5 +++-- kernel/branches/net/drivers/RTL8139.asm | 20 +++++--------------- kernel/branches/net/network/udp.inc | 2 +- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/kernel/branches/net/drivers/RTL8029.asm b/kernel/branches/net/drivers/RTL8029.asm index fe3c232c39..0404bebfc6 100644 --- a/kernel/branches/net/drivers/RTL8029.asm +++ b/kernel/branches/net/drivers/RTL8029.asm @@ -149,7 +149,7 @@ public version ISR_RDC equ 0x40 ; Remote DMA complete ISR_RST equ 0x80 ; reset - IRQ_MASK equ ISR_PRX + ISR_PTX + ISR_TXE + IRQ_MASK equ ISR_PRX ; + ISR_PTX + ISR_TXE RSTAT_PRX equ 0x01 ; successful recv RSTAT_CRC equ 0x02 ; CRC error @@ -459,7 +459,7 @@ probe: DEBUGF 2,"Trying 16-bit mode\n" - or [ebp + device.flags], FLAG_16BIT + or [ebp + device.flags], FLAG_16BIT or FLAG_PIO mov [ebp + device.memsize], MEM_32768 mov [ebp + device.tx_start], 64 add [ebp + device.rx_start], TXBUF_SIZE + 64 @@ -707,6 +707,7 @@ nsr_002: call read_mac ; clear interupt status + set_io 0 set_io P0_ISR mov al, 0xff out dx, al diff --git a/kernel/branches/net/drivers/RTL8139.asm b/kernel/branches/net/drivers/RTL8139.asm index 217c3103f7..85b408dc62 100644 --- a/kernel/branches/net/drivers/RTL8139.asm +++ b/kernel/branches/net/drivers/RTL8139.asm @@ -1192,25 +1192,15 @@ read_mac: DEBUGF 1,"Reading MAC: " mov edx, [ebx + device.io_addr] - - mov ecx, 2 - @@: - lea eax, [EE_93C46_REG_ETH_ID+ecx] - push ecx - call read_eeprom - pop ecx - push ax - dec cl - jns @r - - DEBUGF 1,"%x-%x-%x-%x-%x-%x\n",[esp+0]:2,[esp+1]:2,[esp+2]:2,[esp+3]:2,[esp+4]:2,[esp+5]:2 - lea edi, [ebx + device.mac] - pop eax + in eax, edx stosd - pop ax + add dx, 4 + in ax, dx stosw + DEBUGF 1,"%x-%x-%x-%x-%x-%x\n",[edi-6]:2,[edi-5]:2,[edi-4]:2,[edi-3]:2,[edi-2]:2,[edi-1]:2 + ret diff --git a/kernel/branches/net/network/udp.inc b/kernel/branches/net/network/udp.inc index c91e46d2fb..c143d4ca4e 100644 --- a/kernel/branches/net/network/udp.inc +++ b/kernel/branches/net/network/udp.inc @@ -219,9 +219,9 @@ UDP_create_Packet: cmp edi, -1 je .exit - sub ecx , UDP_Packet.Data mov byte[edi + UDP_Packet.Length], ch mov byte[edi + UDP_Packet.Length+1], cl + sub ecx , UDP_Packet.Data pop esi push edi