Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1518 → Rev 1519

/kernel/branches/net/drivers/RTL8029.asm
1,10 → 1,13
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; RTL8029/ne2000 driver for KolibriOS ;;
;; ;;
;; based on RTL8029.asm driver for menuetos ;;
;; and realtek8029.asm for SolarOS by Eugen Brasoveanu ;;
;; ;;
;; Written by hidnplayr@kolibrios.org ;;
;; with help from CleverMouse ;;
;; ;;
11,19 → 14,15
;; GNU GENERAL PUBLIC LICENSE ;;
;; Version 2, June 1991 ;;
;; ;;
;; current status (september 2009) - UNSTABLE ;;
;; ;;
;; based on RTL8029.asm driver for menuetos ;;
;; and realtek8029.asm for SolarOS by Eugen Brasoveanu ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
;$Revision$
 
format MS COFF
 
API_VERSION equ 0x01000100
DRIVER_VERSION equ 5
 
MAX_DEVICES equ 16
 
DEBUG equ 1
__DEBUG__ equ 1
__DEBUG_LEVEL__ equ 1
33,11 → 32,6
include 'fdo.inc'
include 'netdrv.inc'
 
OS_BASE equ 0
new_app_base equ 0x60400000
PROC_BASE equ OS_BASE+0x0080000
 
 
virtual at ebx
 
device:
68,8 → 62,6
public service_proc
public version
 
MAX_DEVICES equ 16 ; Max number of devices this driver may handle
 
P0_PSTART equ 0x01
P0_PSTOP equ 0x02
P0_BOUND equ 0x03
234,8 → 226,8
 
; check if the device is already listed
 
mov esi, DEVICE_LIST
mov ecx, [DEVICES]
mov esi, device_list
mov ecx, [devices]
test ecx, ecx
jz .firstdevice_pci
 
269,8 → 261,8
 
.isa:
 
mov esi, DEVICE_LIST
mov ecx, [DEVICES]
mov esi, device_list
mov ecx, [devices]
test ecx, ecx
jz .firstdevice_isa
mov al , [eax+3]
305,9 → 297,9
test eax, eax
jnz .err ; If an error occured, exit
 
mov eax, [DEVICES]
mov [DEVICE_LIST+4*eax], ebx
inc [DEVICES]
mov eax, [devices]
mov [device_list+4*eax], ebx
inc [devices]
 
mov [device.type], NET_TYPE_ETH
call NetRegDev
346,7 → 338,7
 
create_new_struct:
 
cmp [DEVICES], MAX_DEVICES
cmp [devices], MAX_DEVICES
jge .fail
 
push edx
670,6 → 662,9
mov ecx, 6
rep stosd
 
; Set the mtu, kernel will be able to send now
mov [device.mtu], 1514
 
; Indicate that we have successfully reset the card
DEBUGF 2,"Done!\n"
 
733,10 → 728,14
adc dword [device.bytes_tx + 4], 0
 
.finish:
call Kernelfree
add esp, 4
xor eax, eax
ret
 
.err:
call Kernelfree
add esp, 4
or eax, -1
ret
 
752,8 → 751,8
DEBUGF 2,"IRQ %x ",eax:2
 
; find pointer of device wich made INT occur
mov esi, DEVICE_LIST
mov ecx, [DEVICES]
mov esi, device_list
mov ecx, [devices]
.nextdevice:
mov ebx, [esi]
 
1197,8 → 1196,8
;all initialized data place here
align 4
 
DEVICES dd 0
version dd (5 shl 16) or (API_VERSION and 0xFFFF)
devices dd 0
version dd (DRIVER_VERSION shl 16) or (API_VERSION and 0xFFFF)
my_service db 'RTL8029/ne2000',0 ;max 16 chars include zero
 
device_1 db 'Realtek 8029',0
1213,7 → 1212,7
 
section '.data' data readable writable align 16 ;place all uninitialized data place here
 
DEVICE_LIST rd MAX_DEVICES
device_list rd MAX_DEVICES