* 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
This commit is contained in:
CleverMouse 2009-09-24 10:43:38 +00:00
parent 26d83dcf4a
commit 65fa263646
3 changed files with 9 additions and 18 deletions

View File

@ -149,7 +149,7 @@ public version
ISR_RDC equ 0x40 ; Remote DMA complete ISR_RDC equ 0x40 ; Remote DMA complete
ISR_RST equ 0x80 ; reset 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_PRX equ 0x01 ; successful recv
RSTAT_CRC equ 0x02 ; CRC error RSTAT_CRC equ 0x02 ; CRC error
@ -459,7 +459,7 @@ probe:
DEBUGF 2,"Trying 16-bit mode\n" 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.memsize], MEM_32768
mov [ebp + device.tx_start], 64 mov [ebp + device.tx_start], 64
add [ebp + device.rx_start], TXBUF_SIZE + 64 add [ebp + device.rx_start], TXBUF_SIZE + 64
@ -707,6 +707,7 @@ nsr_002:
call read_mac call read_mac
; clear interupt status ; clear interupt status
set_io 0
set_io P0_ISR set_io P0_ISR
mov al, 0xff mov al, 0xff
out dx, al out dx, al

View File

@ -1192,25 +1192,15 @@ read_mac:
DEBUGF 1,"Reading MAC: " DEBUGF 1,"Reading MAC: "
mov edx, [ebx + device.io_addr] 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] lea edi, [ebx + device.mac]
pop eax in eax, edx
stosd stosd
pop ax add dx, 4
in ax, dx
stosw 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 ret

View File

@ -219,9 +219,9 @@ UDP_create_Packet:
cmp edi, -1 cmp edi, -1
je .exit je .exit
sub ecx , UDP_Packet.Data
mov byte[edi + UDP_Packet.Length], ch mov byte[edi + UDP_Packet.Length], ch
mov byte[edi + UDP_Packet.Length+1], cl mov byte[edi + UDP_Packet.Length+1], cl
sub ecx , UDP_Packet.Data
pop esi pop esi
push edi push edi