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

View File

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