forked from KolibriOS/kolibrios
RTL8169 network driver
git-svn-id: svn://kolibrios.org@373 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
21dcb2539a
commit
6e47c89546
@ -52,7 +52,7 @@ goto :eof
|
|||||||
|
|
||||||
if not exist bin mkdir bin
|
if not exist bin mkdir bin
|
||||||
echo lang fix %lang% > lang.inc
|
echo lang fix %lang% > lang.inc
|
||||||
fasm kernel.asm bin\kernel.mnt
|
fasm -m 65536 kernel.asm bin\kernel.mnt
|
||||||
if not %errorlevel%==0 goto :Error_FasmFailed
|
if not %errorlevel%==0 goto :Error_FasmFailed
|
||||||
erase lang.inc
|
erase lang.inc
|
||||||
goto :eof
|
goto :eof
|
||||||
@ -72,7 +72,7 @@ goto :eof
|
|||||||
if not exist bin\drivers mkdir bin\drivers
|
if not exist bin\drivers mkdir bin\drivers
|
||||||
cd drivers
|
cd drivers
|
||||||
for %%a in (%drivers%) do (
|
for %%a in (%drivers%) do (
|
||||||
fasm %%a.asm ..\bin\drivers\%%a.obj
|
fasm -m 65536 %%a.asm ..\bin\drivers\%%a.obj
|
||||||
if not %errorlevel%==0 goto :Error_FasmFailed
|
if not %errorlevel%==0 goto :Error_FasmFailed
|
||||||
)
|
)
|
||||||
cd ..
|
cd ..
|
||||||
@ -84,7 +84,7 @@ goto :eof
|
|||||||
|
|
||||||
if not exist bin\skins mkdir bin\skins
|
if not exist bin\skins mkdir bin\skins
|
||||||
cd skin
|
cd skin
|
||||||
fasm default.asm ..\bin\skins\default.skn
|
fasm -m 65536 default.asm ..\bin\skins\default.skn
|
||||||
if not %errorlevel%==0 goto :Error_FasmFailed
|
if not %errorlevel%==0 goto :Error_FasmFailed
|
||||||
cd ..
|
cd ..
|
||||||
goto :eof
|
goto :eof
|
||||||
|
@ -4374,7 +4374,7 @@ sys_msg_board_str:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
uglobal
|
uglobal
|
||||||
msg_board_data: times 512 db 0
|
msg_board_data: times 4096 db 0
|
||||||
msg_board_count dd 0x0
|
msg_board_count dd 0x0
|
||||||
endg
|
endg
|
||||||
|
|
||||||
@ -4390,7 +4390,7 @@ sys_msg_board:
|
|||||||
|
|
||||||
mov [msg_board_data+ecx],bl
|
mov [msg_board_data+ecx],bl
|
||||||
inc ecx
|
inc ecx
|
||||||
and ecx, 511
|
and ecx, 4095
|
||||||
mov [msg_board_count], ecx
|
mov [msg_board_count], ecx
|
||||||
mov [check_idle_semaphore], 5
|
mov [check_idle_semaphore], 5
|
||||||
ret
|
ret
|
||||||
|
@ -75,30 +75,30 @@ end if
|
|||||||
}
|
}
|
||||||
; \end{diamond}[29.09.2006]
|
; \end{diamond}[29.09.2006]
|
||||||
|
|
||||||
struc db [a] { common . db a
|
;struc db [a] { common . db a
|
||||||
if ~used .
|
; if ~used .
|
||||||
display 'not used db: ',`.,13,10
|
; display 'not used db: ',`.,13,10
|
||||||
end if }
|
; end if }
|
||||||
struc dw [a] { common . dw a
|
;struc dw [a] { common . dw a
|
||||||
if ~used .
|
; if ~used .
|
||||||
display 'not used dw: ',`.,13,10
|
; display 'not used dw: ',`.,13,10
|
||||||
end if }
|
; end if }
|
||||||
struc dd [a] { common . dd a
|
;struc dd [a] { common . dd a
|
||||||
if ~used .
|
; if ~used .
|
||||||
display 'not used dd: ',`.,13,10
|
; display 'not used dd: ',`.,13,10
|
||||||
end if }
|
; end if }
|
||||||
struc dp [a] { common . dp a
|
;struc dp [a] { common . dp a
|
||||||
if ~used .
|
; if ~used .
|
||||||
display 'not used dp: ',`.,13,10
|
; display 'not used dp: ',`.,13,10
|
||||||
end if }
|
; end if }
|
||||||
struc dq [a] { common . dq a
|
;struc dq [a] { common . dq a
|
||||||
if ~used .
|
; if ~used .
|
||||||
display 'not used dq: ',`.,13,10
|
; display 'not used dq: ',`.,13,10
|
||||||
end if }
|
; end if }
|
||||||
struc dt [a] { common . dt a
|
;struc dt [a] { common . dt a
|
||||||
if ~used .
|
; if ~used .
|
||||||
display 'not used dt: ',`.,13,10
|
; display 'not used dt: ',`.,13,10
|
||||||
end if }
|
; end if }
|
||||||
|
|
||||||
struc RECT {
|
struc RECT {
|
||||||
.left dd ?
|
.left dd ?
|
||||||
|
@ -177,7 +177,7 @@ rtl8139_tx_buff equ rtl8139_rx_buff + (RTL8139_RX_BUFFER_SIZE + MAX_ETH_
|
|||||||
uglobal
|
uglobal
|
||||||
align 4
|
align 4
|
||||||
rtl8139_rx_buff_offset: dd 0
|
rtl8139_rx_buff_offset: dd 0
|
||||||
curr_tx_desc: dd 0
|
curr_tx_desc dd 0
|
||||||
endg
|
endg
|
||||||
|
|
||||||
iglobal
|
iglobal
|
||||||
@ -442,8 +442,8 @@ rtl8139_read_eeprom:
|
|||||||
; Transmits a packet of data via the ethernet card
|
; Transmits a packet of data via the ethernet card
|
||||||
; Pointer to 48 bit destination address in edi
|
; Pointer to 48 bit destination address in edi
|
||||||
; Type of packet in bx
|
; Type of packet in bx
|
||||||
; size of packet in ecx
|
; Size of packet in ecx
|
||||||
; pointer to packet data in esi
|
; Pointer to packet data in esi
|
||||||
; Destroyed registers
|
; Destroyed registers
|
||||||
; eax, edx, esi, edi
|
; eax, edx, esi, edi
|
||||||
; ToDo
|
; ToDo
|
||||||
|
1204
kernel/trunk/network/eth_drv/drivers/rtl8169.inc
Normal file
1204
kernel/trunk/network/eth_drv/drivers/rtl8169.inc
Normal file
File diff suppressed because it is too large
Load Diff
@ -98,6 +98,7 @@ include "drivers/3c59x.inc"
|
|||||||
include "drivers/sis900.inc"
|
include "drivers/sis900.inc"
|
||||||
include "drivers/pcnet32.inc"
|
include "drivers/pcnet32.inc"
|
||||||
;include "drivers/mtd80x.inc"
|
;include "drivers/mtd80x.inc"
|
||||||
|
include "drivers/rtl8169.inc"
|
||||||
|
|
||||||
; PCICards
|
; PCICards
|
||||||
; ========
|
; ========
|
||||||
@ -143,6 +144,11 @@ dd 0x1211126c, rtl8139_probe, rtl8139_reset, rtl8139_poll, rtl8139_transmit, rt
|
|||||||
dd 0x81391743, rtl8139_probe, rtl8139_reset, rtl8139_poll, rtl8139_transmit, rtl8139_cable
|
dd 0x81391743, rtl8139_probe, rtl8139_reset, rtl8139_poll, rtl8139_transmit, rtl8139_cable
|
||||||
dd 0x8139021b, rtl8139_probe, rtl8139_reset, rtl8139_poll, rtl8139_transmit, rtl8139_cable
|
dd 0x8139021b, rtl8139_probe, rtl8139_reset, rtl8139_poll, rtl8139_transmit, rtl8139_cable
|
||||||
|
|
||||||
|
dd 0x816810ec, rtl8169_probe, rtl8169_reset, rtl8169_poll, rtl8169_transmit, 0
|
||||||
|
dd 0x816910ec, rtl8169_probe, rtl8169_reset, rtl8169_poll, rtl8169_transmit, 0
|
||||||
|
dd 0x011616ec, rtl8169_probe, rtl8169_reset, rtl8169_poll, rtl8169_transmit, 0
|
||||||
|
dd 0x43001186, rtl8169_probe, rtl8169_reset, rtl8169_poll, rtl8169_transmit, 0
|
||||||
|
|
||||||
dd 0x590010b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0
|
dd 0x590010b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0
|
||||||
dd 0x592010b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0
|
dd 0x592010b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0
|
||||||
dd 0x597010b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0
|
dd 0x597010b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0
|
||||||
@ -433,12 +439,13 @@ eth_rx:
|
|||||||
jmp .exit ; If not IP or ARP, ignore
|
jmp .exit ; If not IP or ARP, ignore
|
||||||
|
|
||||||
.is_ip:
|
.is_ip:
|
||||||
|
DEBUGF 1,"K : eth_rx - IP packet\n"
|
||||||
inc dword [ip_rx_count]
|
inc dword [ip_rx_count]
|
||||||
call ether_IP_handler
|
call ether_IP_handler
|
||||||
jmp .exit
|
jmp .exit
|
||||||
|
|
||||||
.is_arp:
|
.is_arp:
|
||||||
|
DEBUGF 1,"K : eth_rx - ARP packet\n"
|
||||||
; At this point, the packet is still in the Ether_buffer
|
; At this point, the packet is still in the Ether_buffer
|
||||||
call arp_handler
|
call arp_handler
|
||||||
|
|
||||||
|
@ -158,6 +158,7 @@ local buffer_number dd ?
|
|||||||
|
|
||||||
cmp al , PROTOCOL_TCP
|
cmp al , PROTOCOL_TCP
|
||||||
jne .not_tcp
|
jne .not_tcp
|
||||||
|
DEBUGF 1,"K : ip_rx - TCP packet\n"
|
||||||
mov eax, dword[buffer_number]
|
mov eax, dword[buffer_number]
|
||||||
call tcp_rx
|
call tcp_rx
|
||||||
jmp .exit
|
jmp .exit
|
||||||
@ -165,6 +166,7 @@ local buffer_number dd ?
|
|||||||
.not_tcp:
|
.not_tcp:
|
||||||
cmp al, PROTOCOL_UDP
|
cmp al, PROTOCOL_UDP
|
||||||
jne .not_udp
|
jne .not_udp
|
||||||
|
DEBUGF 1,"K : ip_rx - UDP packet\n"
|
||||||
mov eax, dword[buffer_number]
|
mov eax, dword[buffer_number]
|
||||||
call udp_rx
|
call udp_rx
|
||||||
jmp .exit
|
jmp .exit
|
||||||
@ -173,6 +175,7 @@ local buffer_number dd ?
|
|||||||
cmp al , PROTOCOL_ICMP
|
cmp al , PROTOCOL_ICMP
|
||||||
jne .dump ;protocol ain't supported
|
jne .dump ;protocol ain't supported
|
||||||
|
|
||||||
|
DEBUGF 1,"K : ip_rx - ICMP packet\n"
|
||||||
;GET_IHL ecx, ebx + IP_PACKET.VersionAndIHL ;get packet length in ecx
|
;GET_IHL ecx, ebx + IP_PACKET.VersionAndIHL ;get packet length in ecx
|
||||||
mov eax, dword[buffer_number]
|
mov eax, dword[buffer_number]
|
||||||
stdcall icmp_rx,eax,ebx,ecx ;buffer_number,IPPacketBase,IPHeaderLength
|
stdcall icmp_rx,eax,ebx,ecx ;buffer_number,IPPacketBase,IPHeaderLength
|
||||||
|
Loading…
Reference in New Issue
Block a user