1,6 → 1,6 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; |
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; DEC 21x4x driver for KolibriOS ;; |
11,8 → 11,6 |
;; ;; |
;; Written by hidnplayr@kolibrios.org ;; |
;; ;; |
;; 0.1 - 5 june 2010 ;; |
;; ;; |
;; GNU GENERAL PUBLIC LICENSE ;; |
;; Version 2, June 1991 ;; |
;; ;; |
21,7 → 19,10 |
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 |
31,15 → 32,10 |
include 'fdo.inc' |
include 'netdrv.inc' |
|
OS_BASE equ 0 |
new_app_base equ 0x60400000 |
PROC_BASE equ OS_BASE+0x0080000 |
|
public START |
public service_proc |
public version |
|
|
virtual at ebx |
|
device: |
46,7 → 42,6 |
|
ETH_DEVICE |
|
; device specific |
.rx_p_des dd ? ; descriptors ring with received packets |
.tx_p_des dd ? ; descriptors ring with 'to transmit' packets |
.tx_free_des dd ? ; Tx descriptors available |
63,10 → 58,6 |
|
end virtual |
|
|
|
MAX_DEVICES equ 16 |
|
;------------------------------------------- |
; configuration registers |
;------------------------------------------- |
381,7 → 372,7 |
|
; check if the device is already listed |
|
mov esi, DEVICE_LIST |
mov esi, device_list |
mov ecx, [devices] |
test ecx, ecx |
jz .firstdevice |
442,7 → 433,7 |
; Ok, the eth_device structure is ready, let's probe the device |
; Because initialization fires IRQ, IRQ handler must be aware of this device |
mov eax, [devices] ; Add the device structure to our device list |
mov [DEVICE_LIST+4*eax], ebx ; (IRQ handler uses this list to find device) |
mov [device_list+4*eax], ebx ; (IRQ handler uses this list to find device) |
inc [devices] ; |
|
call probe ; this function will output in eax |
771,6 → 762,9 |
mov ecx, 6 |
rep stosd |
|
; Set the mtu, kernel will be able to send now |
mov [device.mtu], 1514 |
|
DEBUGF 1,"Reset done\n" |
|
ret |
1000,15 → 994,18 |
|
DEBUGF 1,"transmit ok\n" |
xor eax, eax |
call Kernelfree |
add esp, 4 |
ret |
|
.fail: |
DEBUGF 1,"transmit failed\n" |
or eax, -1 |
call Kernelfree |
add esp, 4 |
ret |
|
|
|
;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Interrupt handler ;; |
1025,7 → 1022,7 |
mov ecx, [devices] |
test ecx, ecx |
jz .fail |
mov esi, DEVICE_LIST |
mov esi, device_list |
.nextdevice: |
mov ebx, dword [esi] |
|
1701,11 → 1698,10 |
|
|
; End of code |
|
align 4 ; Place all initialised data here |
|
devices dd 0 |
version dd (5 shl 16) or (API_VERSION and 0xFFFF) |
version dd (DRIVER_VERSION shl 16) or (API_VERSION and 0xFFFF) |
my_service db 'DEC21X4X',0 ; max 16 chars include zero |
|
include_debug_strings ; All data wich FDO uses will be included here |
1712,6 → 1708,6 |
|
section '.data' data readable writable align 16 ; place all uninitialized data place here |
|
DEVICE_LIST rd MAX_DEVICES ; This list contains all pointers to device structures the driver is handling |
device_list rd MAX_DEVICES ; This list contains all pointers to device structures the driver is handling |
|
|