Better debug output for i8254x and pcnet32 driver.

git-svn-id: svn://kolibrios.org@3855 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2013-08-05 11:00:22 +00:00
parent 713bc94bff
commit da3583db82
2 changed files with 21 additions and 23 deletions

View File

@ -25,7 +25,7 @@ format MS COFF
DEBUG = 1 DEBUG = 1
__DEBUG__ = 1 __DEBUG__ = 1
__DEBUG_LEVEL__ = 2 __DEBUG_LEVEL__ = 2 ; 1 = verbose, 2 = errors only
MAX_PKT_SIZE = 16384 ; Maximum packet size MAX_PKT_SIZE = 16384 ; Maximum packet size
@ -291,7 +291,7 @@ proc START stdcall, state:dword
.entry: .entry:
DEBUGF 2,"Loading %s driver\n", my_service DEBUGF 1,"Loading driver\n"
stdcall RegService, my_service, service_proc stdcall RegService, my_service, service_proc
ret ret
@ -493,7 +493,7 @@ probe:
stdcall AttachIntHandler, eax, int_handler, dword 0 stdcall AttachIntHandler, eax, int_handler, dword 0
test eax, eax test eax, eax
jnz @f jnz @f
DEBUGF 1,"\nCould not attach int handler!\n" DEBUGF 2,"Could not attach int handler!\n"
; or eax, -1 ; or eax, -1
; ret ; ret
@@: @@:
@ -698,7 +698,7 @@ int_handler:
push ebx esi edi push ebx esi edi
DEBUGF 1,"\n%s int\n", my_service DEBUGF 1,"INT\n"
;------------------------------------------- ;-------------------------------------------
; Find pointer of device wich made IRQ occur ; Find pointer of device wich made IRQ occur

View File

@ -20,7 +20,7 @@ format MS COFF
DEBUG = 1 DEBUG = 1
__DEBUG__ = 1 __DEBUG__ = 1
__DEBUG_LEVEL__ = 2 __DEBUG_LEVEL__ = 2 ; 1 = verbose, 2 = errors only
MAX_DEVICES = 4 MAX_DEVICES = 4
MAX_ETH_FRAME_SIZE = 1514 MAX_ETH_FRAME_SIZE = 1514
@ -371,7 +371,7 @@ proc START stdcall, state:dword
.entry: .entry:
DEBUGF 2,"Loading %s driver\n", my_service DEBUGF 1,"Loading driver\n"
stdcall RegService, my_service, service_proc stdcall RegService, my_service, service_proc
ret ret
@ -508,7 +508,7 @@ proc service_proc stdcall, ioctl:dword
dec [devices] dec [devices]
.err: .err:
DEBUGF 1,"Error, removing all data !\n" DEBUGF 2,"Error, removing all data !\n"
stdcall KernelFree, ebx stdcall KernelFree, ebx
.fail: .fail:
@ -598,7 +598,7 @@ probe:
jmp .L1 jmp .L1
.no_dev: .no_dev:
DEBUGF 1,"PCnet device not found!\n" DEBUGF 1,"device not found!\n"
mov eax, 1 mov eax, 1
ret ret
@ -723,7 +723,7 @@ reset:
stdcall AttachIntHandler, eax, int_handler, dword 0 stdcall AttachIntHandler, eax, int_handler, dword 0
test eax, eax test eax, eax
jnz @f jnz @f
DEBUGF 1,"\nCould not attach int handler!\n" DEBUGF 2,"Could not attach int handler!\n"
; or eax, -1 ; or eax, -1
; ret ; ret
@@: @@:
@ -861,7 +861,7 @@ reset:
cmp [device.phy], MAX_PHYS cmp [device.phy], MAX_PHYS
jb .mii_loop jb .mii_loop
DEBUGF 1, "No PHY found!\n" DEBUGF 2, "No PHY found!\n"
or eax, -1 or eax, -1
ret ret
@ -918,7 +918,7 @@ reset:
dec esi dec esi
jnz @r jnz @r
DEBUGF 1,"Initialize timeout!\n" DEBUGF 2,"Initialize timeout!\n"
@@: @@:
; Start the device and enable interrupts ; Start the device and enable interrupts
@ -1039,7 +1039,6 @@ transmit:
; get next descriptor 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, ... ; get next descriptor 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, ...
inc [device.cur_tx] inc [device.cur_tx]
and [device.cur_tx], TX_RING_SIZE - 1 and [device.cur_tx], TX_RING_SIZE - 1
DEBUGF 1," - Packet Sent! "
; Update stats ; Update stats
inc [device.packets_tx] inc [device.packets_tx]
@ -1053,7 +1052,7 @@ transmit:
ret 8 ret 8
.nospace: .nospace:
DEBUGF 1, 'ERROR: no free transmit descriptors\n' DEBUGF 2, "ERROR: no free transmit descriptors\n"
stdcall KernelFree, [esp+4] stdcall KernelFree, [esp+4]
or eax, -1 or eax, -1
ret 8 ret 8
@ -1071,7 +1070,7 @@ int_handler:
push ebx esi edi push ebx esi edi
DEBUGF 1,"\n%s int\n", my_service DEBUGF 1,"INT\n"
; find pointer of device wich made IRQ occur ; find pointer of device wich made IRQ occur
@ -1230,7 +1229,7 @@ write_mac: ; in: mac pushed onto stack (as 3 words)
;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;
align 4 align 4
read_mac: read_mac:
DEBUGF 1,"Reading MAC" DEBUGF 1,"Reading MAC:\n"
mov edx, [device.io_addr] mov edx, [device.io_addr]
add dx, 6 add dx, 6
@ -1239,7 +1238,6 @@ read_mac:
dec dx dec dx
in ax, dx in ax, dx
push ax push ax
DEBUGF 1,"."
cmp edx, [device.io_addr] cmp edx, [device.io_addr]
ja @r ja @r