forked from KolibriOS/kolibrios
Network drivers now print driver name on debug output.
git-svn-id: svn://kolibrios.org@3845 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
fee4d46bd3
commit
28d79ed03f
@ -30,7 +30,7 @@ format MS COFF
|
|||||||
|
|
||||||
DEBUG = 1
|
DEBUG = 1
|
||||||
__DEBUG__ = 1
|
__DEBUG__ = 1
|
||||||
__DEBUG_LEVEL__ = 2
|
__DEBUG_LEVEL__ = 2 ; 1 = verbose, 2 = errors only
|
||||||
|
|
||||||
include '../proc32.inc'
|
include '../proc32.inc'
|
||||||
include '../imports.inc'
|
include '../imports.inc'
|
||||||
@ -194,7 +194,7 @@ proc START stdcall, state:dword
|
|||||||
|
|
||||||
.entry:
|
.entry:
|
||||||
|
|
||||||
DEBUGF 1,"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
|
||||||
|
|
||||||
@ -294,7 +294,7 @@ proc service_proc stdcall, ioctl:dword
|
|||||||
|
|
||||||
PCI_find_irq
|
PCI_find_irq
|
||||||
|
|
||||||
DEBUGF 2,"Hooking into device, dev:%x, bus:%x, irq:%x, addr:%x\n",\
|
DEBUGF 1,"Hooking into device, dev:%x, bus:%x, irq:%x, addr:%x\n",\
|
||||||
[device.pci_dev]:1,[device.pci_bus]:1,[device.irq_line]:1,[device.io_addr]:4
|
[device.pci_dev]:1,[device.pci_bus]:1,[device.irq_line]:1,[device.io_addr]:4
|
||||||
|
|
||||||
; Ok, the eth_device structure is ready, let's probe the device
|
; Ok, the eth_device structure is ready, let's probe the device
|
||||||
@ -376,7 +376,7 @@ ret
|
|||||||
align 4
|
align 4
|
||||||
probe:
|
probe:
|
||||||
|
|
||||||
DEBUGF 1,"Probing i8255x\n"
|
DEBUGF 1,"Probing\n"
|
||||||
|
|
||||||
PCI_make_bus_master
|
PCI_make_bus_master
|
||||||
|
|
||||||
@ -400,7 +400,7 @@ probe:
|
|||||||
jmp .found
|
jmp .found
|
||||||
|
|
||||||
.notfound:
|
.notfound:
|
||||||
DEBUGF 1,"ERROR: Unsupported device!\n"
|
DEBUGF 2,"Unsupported device!\n"
|
||||||
or eax, -1
|
or eax, -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -427,12 +427,12 @@ 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
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
DEBUGF 1,"Resetting %s\n", my_service
|
DEBUGF 1,"Resetting\n"
|
||||||
|
|
||||||
;---------------
|
;---------------
|
||||||
; reset the card
|
; reset the card
|
||||||
@ -558,7 +558,7 @@ reset:
|
|||||||
|
|
||||||
; Indicate that we have successfully reset the card
|
; Indicate that we have successfully reset the card
|
||||||
|
|
||||||
DEBUGF 1,"Resetting %s complete\n", my_service
|
DEBUGF 1,"Reset complete\n"
|
||||||
|
|
||||||
mov [device.mtu], 1514
|
mov [device.mtu], 1514
|
||||||
|
|
||||||
@ -693,7 +693,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
|
||||||
|
|
||||||
@ -861,7 +861,7 @@ cmd_wait:
|
|||||||
align 4
|
align 4
|
||||||
ee_read: ; esi = address to read
|
ee_read: ; esi = address to read
|
||||||
|
|
||||||
DEBUGF 1,"Eeprom read from 0x%x", esi
|
DEBUGF 1,"Eeprom read from 0x%x\n", esi
|
||||||
|
|
||||||
set_io 0
|
set_io 0
|
||||||
set_io reg_eeprom
|
set_io reg_eeprom
|
||||||
@ -931,7 +931,7 @@ ee_read: ; esi = address to read
|
|||||||
out dx, ax
|
out dx, ax
|
||||||
|
|
||||||
|
|
||||||
DEBUGF 1,"=0x%x\n", esi:4
|
DEBUGF 1,"0x%x\n", esi:4
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -1011,8 +1011,6 @@ ee_write: ; esi = address to write to, di = data
|
|||||||
align 4
|
align 4
|
||||||
ee_get_width:
|
ee_get_width:
|
||||||
|
|
||||||
; DEBUGF 1,"Eeprom get width\n"
|
|
||||||
|
|
||||||
set_io 0
|
set_io 0
|
||||||
set_io reg_eeprom
|
set_io reg_eeprom
|
||||||
|
|
||||||
@ -1044,21 +1042,20 @@ ee_get_width:
|
|||||||
test al, EE_DO
|
test al, EE_DO
|
||||||
jnz .loop
|
jnz .loop
|
||||||
|
|
||||||
.give_up:
|
|
||||||
xor al, al
|
xor al, al
|
||||||
out dx, al ; de-activate eeprom
|
out dx, al ; de-activate eeprom
|
||||||
|
|
||||||
sub cl, 3 ; dont count the opcode bits
|
sub cl, 3 ; dont count the opcode bits
|
||||||
|
|
||||||
mov [device.ee_bus_width], cl
|
mov [device.ee_bus_width], cl
|
||||||
DEBUGF 1,"Eeprom width=%u bit\n", ecx
|
DEBUGF 1, "Eeprom width=%u bit\n", ecx
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
;-----------------------
|
.give_up:
|
||||||
; de-activate the eeprom
|
DEBUGF 2, "Eeprom not found!\n"
|
||||||
|
|
||||||
xor eax, eax
|
xor al, al
|
||||||
out dx, eax
|
out dx, al ; de-activate eeprom
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@ -11,6 +11,17 @@
|
|||||||
include 'pci.inc'
|
include 'pci.inc'
|
||||||
include 'mii.inc'
|
include 'mii.inc'
|
||||||
|
|
||||||
|
; This macro will prepend driver name to all debug output through DEBUGF macro
|
||||||
|
; The driver name is taken from my_service label
|
||||||
|
|
||||||
|
if defined my_service
|
||||||
|
|
||||||
|
macro DEBUGF _level,_format, [args] {
|
||||||
|
common DEBUGF _level, "%s: " # _format, my_service, args
|
||||||
|
}
|
||||||
|
|
||||||
|
end if
|
||||||
|
|
||||||
; Kernel variables
|
; Kernel variables
|
||||||
|
|
||||||
PAGESIZE = 4096
|
PAGESIZE = 4096
|
||||||
|
Loading…
Reference in New Issue
Block a user