Replaced signed relative jumps with unsigned ones were needed.

(I must lose this bad habbit in 2013...)

git-svn-id: svn://kolibrios.org@3155 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2013-01-10 17:35:32 +00:00
parent 1dfb449935
commit efb37b3598
12 changed files with 336 additions and 339 deletions

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; 3Com network driver for KolibriOS ;;
@ -374,7 +374,7 @@ proc START stdcall, state:dword
.entry:
DEBUGF 1,"Loading 3com network driver\n"
DEBUGF 1,"Loading %s driver\n", my_service
stdcall RegService, my_service, service_proc
ret
@ -408,7 +408,7 @@ proc service_proc stdcall, ioctl:dword
jne @F
cmp [IOCTL.out_size], 4
jl .fail
jb .fail
mov eax, [IOCTL.output]
mov [eax], dword API_VERSION
@ -421,7 +421,7 @@ proc service_proc stdcall, ioctl:dword
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jl .fail
jb .fail
mov eax, [IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
@ -465,7 +465,7 @@ proc service_proc stdcall, ioctl:dword
mov ecx, [BOOMERANG_DEVICES]
add ecx, [VORTEX_DEVICES]
cmp ecx, MAX_DEVICES ; First check if the driver can handle one more card
jge .fail
jae .fail
allocate_and_clear ebx, device.size, .fail ; Allocate the buffer for device structure
@ -2270,7 +2270,7 @@ boomerang_transmit:
[eax+13]:2,[eax+12]:2
cmp dword [esp+8], MAX_ETH_FRAME_SIZE
jg .fail
ja .fail
call check_tx_status
@ -2280,7 +2280,7 @@ boomerang_transmit:
add esi, dpd.size
lea ecx, [device.dpd_buffer + (NUM_TX_DESC)*dpd.size]
cmp esi, ecx
jl @f
jb @f
lea esi, [device.dpd_buffer] ; Wrap if needed
@@:
DEBUGF 1,"Found a free DPD: %x\n", esi
@ -2740,7 +2740,7 @@ int_boomerang:
add esi, upd.size
lea ecx, [device.upd_buffer+(NUM_RX_DESC)*upd.size]
cmp esi, ecx
jl @f
jb @f
lea esi, [device.upd_buffer]
@@:
mov [device.curr_upd], esi

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; R6040 driver for KolibriOS ;;
@ -224,7 +224,7 @@ proc START stdcall, state:dword
.entry:
DEBUGF 2,"Loading R6040 driver\n"
DEBUGF 2,"Loading %s driver\n", my_service
stdcall RegService, my_service, service_proc
ret
@ -255,7 +255,7 @@ proc service_proc stdcall, ioctl:dword
jne @F
cmp [IOCTL.out_size], 4
jl .fail
jb .fail
mov eax, [IOCTL.output]
mov [eax], dword API_VERSION
@ -268,7 +268,7 @@ proc service_proc stdcall, ioctl:dword
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jl .fail
jb .fail
mov eax, [IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
@ -294,7 +294,7 @@ proc service_proc stdcall, ioctl:dword
; This device doesnt have its own eth_device structure yet, lets create one
.firstdevice:
cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card
jge .fail
jae .fail
allocate_and_clear ebx, device.size, .fail ; Allocate the buffer for device structure
@ -756,9 +756,9 @@ transmit:
[eax+13]:2,[eax+12]:2
cmp dword [esp+8], 1514
jg .fail
ja .fail
cmp dword [esp+8], 60
jl .fail
jb .fail
movzx edi, [device.cur_tx]
shl edi, 5
@ -813,7 +813,7 @@ transmit:
call Sleep
call GetTimerTicks
cmp edx, eax
jl .l2
jb .l2
DEBUGF 1,"Send timeout\n"
xor eax, eax

View File

@ -198,7 +198,7 @@ proc service_proc stdcall, ioctl:dword
jne @F ;---------------
cmp [IOCTL.out_size], 4
jl .fail
jb .fail
mov eax, [IOCTL.output]
mov [eax], dword API_VERSION
@ -215,12 +215,12 @@ proc service_proc stdcall, ioctl:dword
mov eax, [IOCTL.input]
cmp [IOCTL.inp_size], 3
jl .fail
jb .fail
cmp byte [eax], 1
je .pci
cmp [IOCTL.inp_size], 4
jl .fail
jb .fail
cmp byte [eax], 0
je .isa
@ -674,9 +674,9 @@ transmit:
[esi+0]:2,[esi+1]:2,[esi+2]:2,[esi+3]:2,[esi+4]:2,[esi+5]:2,[esi+6]:2,[esi+7]:2,[esi+8]:2,[esi+9]:2,[esi+10]:2,[esi+11]:2,[esi+13]:2,[esi+12]:2
cmp ecx, ETH_FRAME_LEN
jg .err ; packet is too long
ja .err ; packet is too long
cmp ecx, ETH_ZLEN
jl .err ; packet is too short
jb .err ; packet is too short
movzx edi, [device.tx_start]
shl edi, 8
@ -1171,11 +1171,11 @@ 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
device_2 db 'Realtek 8019',0
device_3 db 'Realtek 8019AS',0
device_4 db 'ne2000',0
device_5 db 'DP8390',0
;device_1 db 'Realtek 8029',0
;device_2 db 'Realtek 8019',0
;device_3 db 'Realtek 8019AS',0
;device_4 db 'ne2000',0
;device_5 db 'DP8390',0
include_debug_strings

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; Realtek 8139 driver for KolibriOS ;;
@ -23,14 +23,16 @@ format MS COFF
MAX_DEVICES = 16
RBLEN = 3 ; Receive buffer size: 0==8K 1==16k 2==32k 3==64k
NUM_TX_DESC = 4
DEBUG = 1
__DEBUG__ = 1
__DEBUG_LEVEL__ = 2
__DEBUG_LEVEL__ = 1
include 'proc32.inc'
include 'imports.inc'
include 'fdo.inc'
include '../struct.inc'
include 'netdrv.inc'
public START
@ -135,8 +137,7 @@ public version
(1 shl BIT_AM) ; Accept multicast packets
RX_BUFFER_SIZE = (8192 shl RBLEN);+16
MAX_ETH_FRAME_SIZE = 1516 ; exactly 1514 wthout CRC
NUM_TX_DESC = 4
MAX_ETH_FRAME_SIZE = 1514
EE_93C46_REG_ETH_ID = 7 ; MAC offset
EE_93C46_READ_CMD = (6 shl 6) ; 110b + 6bit address
@ -237,7 +238,7 @@ proc START stdcall, state:dword
.entry:
DEBUGF 2,"Loading rtl8139 driver\n"
DEBUGF 2, "Loading %s driver\n", my_service
stdcall RegService, my_service, service_proc
ret
@ -268,7 +269,7 @@ proc service_proc stdcall, ioctl:dword
jne @F
cmp [IOCTL.out_size], 4
jl .fail
jb .fail
mov eax, [IOCTL.output]
mov [eax], dword API_VERSION
@ -281,7 +282,7 @@ proc service_proc stdcall, ioctl:dword
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jl .fail
jb .fail
mov eax, [IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
@ -306,7 +307,7 @@ proc service_proc stdcall, ioctl:dword
; This device doesnt have its own eth_device structure yet, lets create one
.firstdevice:
cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card
jge .fail
jae .fail
allocate_and_clear ebx, device.size, .fail ; Allocate the buffer for device structure
@ -379,7 +380,7 @@ proc service_proc stdcall, ioctl:dword
; todo: reset device into virgin state
.err:
stdcall KernelFree, dword [device.rx_buffer]
stdcall KernelFree, [device.rx_buffer]
stdcall KernelFree, ebx
.fail:
@ -419,7 +420,7 @@ ret
align 4
probe:
DEBUGF 2,"Probing rtl8139 device: "
DEBUGF 2, "Probing %s device\n", my_service
make_bus_master [device.pci_bus], [device.pci_dev]
@ -442,7 +443,7 @@ probe:
mov ecx, 8
.chip_ver_found:
cmp ecx, 8
jg .unknown
ja .unknown
mov [device.hw_ver_id], cl
@ -469,7 +470,7 @@ probe:
set_io REG_CONFIG1
in al, dx
cmp [device.hw_ver_id], IDX_RTL8139B
jl .old_chip
jb .old_chip
; set LWAKE pin to active high (default value).
; it is for Wake-On-LAN functionality of some motherboards.
@ -510,7 +511,7 @@ probe:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
reset:
DEBUGF 2,"Resetting rtl8139\n"
DEBUGF 2, "Resetting\n"
; attach int handler
@ -769,7 +770,7 @@ int_handler:
.got_it:
DEBUGF 1,"Device: %x Status: %x ", ebx, ax
DEBUGF 1, "Device: %x Status: %x\n", ebx, ax
;----------------------------------------------------
; Received packet ok?
@ -842,7 +843,7 @@ int_handler:
and eax, not 3 ; dword alignment
cmp eax, RX_BUFFER_SIZE
jl .no_wrap
jb .no_wrap
DEBUGF 2, "Wrapping"
sub eax, RX_BUFFER_SIZE
.no_wrap:
@ -891,8 +892,8 @@ int_handler:
jz @f
push ax
xor ecx, ecx
.txdesloop:
mov ecx, (NUM_TX_DESC-1)*4
.txdescloop:
set_io 0
set_io REG_TSD0
add edx, ecx
@ -933,9 +934,8 @@ int_handler:
mov [device.TX_DESC+ecx], 0
.notthisone:
add ecx, 4
cmp ecx, 16
jl .txdesloop
sub ecx, 4
ja .txdescloop
pop ax
;----------------------------------------------------
@ -986,6 +986,7 @@ int_handler:
call cable
.fail:
DEBUGF 2, "\n"
ret

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; RTL8169 driver for KolibriOS ;;
@ -8,9 +8,7 @@
;; Copyright 2007 mike.dld, ;;
;; mike.dld@gmail.com ;;
;; ;;
;; Version 0.1 11 February 2007 ;;
;; Version 0.2 3 August 2010 - port to net branch by hidnplayr ;;
;; Version 0.3 31 Januari 2011 - bugfixes by hidnplayr ;;
;; port to net branch by hidnplayr ;;
;; ;;
;; References: ;;
;; r8169.c - linux driver (etherboot project) ;;
@ -414,7 +412,7 @@ proc service_proc stdcall, ioctl:dword
jne @F
cmp [IOCTL.out_size], 4
jl .fail
jb .fail
mov eax, [IOCTL.output]
mov [eax], dword API_VERSION
@ -427,7 +425,7 @@ proc service_proc stdcall, ioctl:dword
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jl .fail
jb .fail
mov eax, [IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
@ -453,7 +451,7 @@ proc service_proc stdcall, ioctl:dword
; This device doesnt have its own eth_device structure yet, lets create one
.firstdevice:
cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card
jge .fail
jae .fail
allocate_and_clear ebx, device_size, .fail ; Allocate memory to put the device structure in

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; DEC 21x4x driver for KolibriOS ;;
@ -351,7 +351,7 @@ proc service_proc stdcall, ioctl:dword
jne @F
cmp [IOCTL.out_size], 4
jl .fail
jb .fail
mov eax, [IOCTL.output]
mov [eax], dword API_VERSION
@ -364,7 +364,7 @@ proc service_proc stdcall, ioctl:dword
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jl .fail
jb .fail
mov eax, [IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
@ -390,7 +390,7 @@ proc service_proc stdcall, ioctl:dword
; This device doesnt have its own eth_device structure yet, lets create one
.firstdevice:
cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card
jge .fail
jae .fail
push edx
stdcall KernelAlloc, dword device.size ; Allocate the buffer for eth_device structure
@ -1085,7 +1085,7 @@ int_handler:
; inc free desc
inc [device.tx_free_des]
cmp [device.tx_free_des], TX_DES_COUNT
jle @f
jbe @f
mov [device.tx_free_des], TX_DES_COUNT
@@:
@ -1239,7 +1239,7 @@ read_mac_eeprom:
stosw
inc esi
cmp esi, 26/2
jl .loop
jb .loop
DEBUGF 2,"%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
@ -1297,7 +1297,7 @@ SROM_GetWidth: ; should be 6 or 8 according to some manuals (returns in ecx)
inc ecx
cmp ecx, 12
jle .loop2
jbe .loop2
.end_loop2:
DEBUGF 1,"Srom width=%u\n", ecx

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; i8254x driver for KolibriOS ;;
@ -166,7 +166,7 @@ MDIC_E = 0x40000000 ; Error
ICR_TXDW = 0x00000001 ; TX Desc Written back
ICR_TXQE = 0x00000002 ; TX Queue Empty
ICR_LSC = 0x00000004 ; Link Status Change
ICR_RXSEQ = 0x00000008 ; RX S= ence Error
ICR_RXSEQ = 0x00000008 ; RX Sence Error
ICR_RXDMT0 = 0x00000010 ; RX Desc min threshold reached
ICR_RXO = 0x00000040 ; RX Overrun
ICR_RXT0 = 0x00000080 ; RX Timer Interrupt
@ -324,7 +324,7 @@ proc service_proc stdcall, ioctl:dword
jne @F
cmp [IOCTL.out_size], 4
jl .fail
jb .fail
mov eax, [IOCTL.output]
mov [eax], dword API_VERSION
@ -337,7 +337,7 @@ proc service_proc stdcall, ioctl:dword
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jl .fail
jb .fail
mov eax, [IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
@ -366,7 +366,7 @@ proc service_proc stdcall, ioctl:dword
; This device doesnt have its own eth_device structure yet, lets create one
.firstdevice:
cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card
jge .fail
jae .fail
allocate_and_clear ebx, sizeof.device_struct, .fail ; Allocate the buffer for device structure
@ -569,6 +569,10 @@ reset_dontstart:
xor eax, eax
ret
align 4
reset:
call reset_dontstart
start_i8254x:
xor eax, eax
@ -584,12 +588,6 @@ start_i8254x:
xor eax, eax
ret
align 4
reset:
call reset_dontstart
call start_i8254x
ret
@ -652,9 +650,9 @@ transmit:
[eax+13]:2,[eax+12]:2
cmp dword [esp + 8], 1514
jg .fail
ja .fail
cmp dword [esp + 8], 60
jl .fail
jb .fail
; Program the descriptor (use legacy mode)

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; i8255x (Intel eepro 100) driver for KolibriOS ;;
@ -217,7 +217,7 @@ proc service_proc stdcall, ioctl:dword
jne @F
cmp [IOCTL.out_size], 4
jl .fail
jb .fail
mov eax, [IOCTL.output]
mov [eax], dword API_VERSION
@ -230,7 +230,7 @@ proc service_proc stdcall, ioctl:dword
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jl .fail
jb .fail
mov eax, [IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
@ -594,9 +594,9 @@ transmit:
[eax+13]:2,[eax+12]:2
cmp dword [esp+8], 1500
jg .error ; packet is too long
ja .error ; packet is too long
cmp dword [esp+8], 60
jl .error ; packet is too short
jb .error ; packet is too short
set_io 0
in ax, dx

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; MTD80x driver for KolibriOS ;;
@ -325,7 +325,7 @@ proc START stdcall, state:dword
.entry:
DEBUGF 2,"Loading mtd80x driver\n"
DEBUGF 2,"Loading %s driver\n", my_service
stdcall RegService, my_service, service_proc
ret
@ -356,7 +356,7 @@ proc service_proc stdcall, ioctl:dword
jne @F
cmp [IOCTL.out_size], 4
jl .fail
jb .fail
mov eax, [IOCTL.output]
mov [eax], dword API_VERSION
@ -369,7 +369,7 @@ proc service_proc stdcall, ioctl:dword
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jl .fail
jb .fail
mov eax, [IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
@ -395,7 +395,7 @@ proc service_proc stdcall, ioctl:dword
; This device doesnt have its own eth_device structure yet, lets create one
.firstdevice:
cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card
jge .fail
jae .fail
allocate_and_clear ebx, device_size, .fail

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; PCnet driver for KolibriOS ;;
@ -14,7 +14,7 @@
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $Revision$
$Revision$
format MS COFF
@ -365,7 +365,7 @@ proc START stdcall, state:dword
.entry:
DEBUGF 1,"Loading PCnet driver\n"
DEBUGF 1,"Loading %s driver\n", my_service
stdcall RegService, my_service, service_proc
ret
@ -396,7 +396,7 @@ proc service_proc stdcall, ioctl:dword
jne @F
cmp [IOCTL.out_size], 4
jl .fail
jb .fail
mov eax, [IOCTL.output]
mov [eax], dword API_VERSION
@ -409,7 +409,7 @@ proc service_proc stdcall, ioctl:dword
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jl .fail
jb .fail
mov eax, [IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
@ -435,7 +435,7 @@ proc service_proc stdcall, ioctl:dword
.firstdevice:
cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card
jge .fail
jae .fail
allocate_and_clear ebx, device_size, .fail
@ -955,9 +955,9 @@ transmit:
[eax+13]:2,[eax+12]:2
cmp dword [esp+8], 1514
jg .nospace ; packet is too long
ja .nospace ; packet is too long
cmp dword [esp+8], 60
jl .nospace ; packet is too short
jb .nospace ; packet is too short
; check descriptor
movzx eax, [device.cur_tx]
@ -1161,7 +1161,7 @@ write_mac: ; in: mac pushed onto stack (as 3 words)
DEBUGF 1,"."
inc ecx
cmp ecx, PCNET_CSR_PAR2
jl @r
jb @r
DEBUGF 1,"\n"
@ -1185,7 +1185,7 @@ read_mac:
push ax
DEBUGF 1,"."
cmp edx, [device.io_addr]
jg @r
ja @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

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2010-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; rhine.asm ;;
@ -584,7 +584,7 @@ proc service_proc stdcall, ioctl:dword
jne @F
cmp [IOCTL.out_size], 4
jl .fail
jb .fail
mov eax, [IOCTL.output]
mov [eax], dword API_VERSION
@ -597,7 +597,7 @@ proc service_proc stdcall, ioctl:dword
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jl .fail
jb .fail
mov eax, [IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
@ -623,7 +623,7 @@ proc service_proc stdcall, ioctl:dword
; This device doesnt have its own eth_device structure yet, lets create one
.firstdevice:
cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card
jge .fail
jae .fail
allocate_and_clear ebx, device.size, .fail ; Allocate the buffer for device structure

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; Ethernet driver for KolibriOS ;;
@ -271,7 +271,7 @@ service_proc:
; 3. This is SRV_GETVERSION request, no input, 4 bytes output, API_VERSION.
; 3a. Output size must be at least 4 bytes.
cmp [IOCTL.out_size], 4
jl .fail
jb .fail
; 3b. Write result to the output buffer.
mov eax, [IOCTL.output]
mov [eax], dword API_VERSION
@ -285,7 +285,7 @@ service_proc:
; 4a. The driver works only with PCI devices,
; so input must be at least 3 bytes long.
cmp [IOCTL.inp_size], 3
jl .fail
jb .fail
; 4b. First byte of input is bus type, 1 stands for PCI.
mov eax, [IOCTL.input]
cmp byte [eax], 1
@ -313,7 +313,7 @@ service_proc:
.firstdevice:
; 4f. Check that we have place for new device.
cmp [devices], MAX_DEVICES
jge .fail
jae .fail
; 4g. Allocate memory for device descriptor and receive+transmit buffers.
; 4h. Zero the structure.
allocate_and_clear ebx, device.size, .fail