Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2909 → Rev 2908

/kernel/branches/net/drivers/sis900.asm
25,12 → 25,6
 
format MS COFF
 
NUM_RX_DESC = 4 ;* Number of RX descriptors *
NUM_TX_DESC = 1 ;* Number of TX descriptors *
RX_BUFF_SZ = 1520 ;* Buffer size for each Rx buffer *
TX_BUFF_SZ = 1516 ;* Buffer size for each Tx buffer *
MAX_ETH_FRAME_SIZE = 1516
 
API_VERSION = 0x01000100
DRIVER_VERSION = 5
 
48,6 → 42,12
public START
public version
 
NUM_RX_DESC = 4 ;* Number of RX descriptors *
NUM_TX_DESC = 1 ;* Number of TX descriptors *
RX_BUFF_SZ = 1520 ;* Buffer size for each Rx buffer *
TX_BUFF_SZ = 1516 ;* Buffer size for each Tx buffer *
MAX_ETH_FRAME_SIZE = 1516
 
virtual at ebx
device:
 
222,6 → 222,7
.err:
stdcall KernelFree, ebx
 
 
.fail:
xor eax, eax
ret 4
421,7 → 422,6
;***************************************************************************
align 4
probe:
DEBUGF 1, "Probe\n"
 
movzx eax, [device.pci_bus]
movzx edx, [device.pci_dev]
490,10 → 490,8
;***************************************************************************
align 4
init:
DEBUGF 1, "Init\n"
 
call reset
jnz .ret
call init_rxfilter
call init_txd
call init_rxd
517,7 → 515,6
 
mov [device.mtu], 1514
 
.ret:
ret
 
;***************************************************************************
529,8 → 526,6
;***************************************************************************
align 4
reset:
DEBUGF 1, "reset\n"
 
movzx eax, [device.irq_line]
stdcall AttachIntHandler, eax, int_handler, 0
 
565,8 → 560,8
dec ecx
jz .error
in eax, dx ; move interrup status to eax
test eax, 0x03000000 ; CHECKME
jz .loop
cmp eax, 0x03000000
jne .loop
 
;------------------------------------------------------
; Set Configuration Register depending on Card Revision
603,7 → 598,6
;***************************************************************************
align 4
init_rxfilter:
DEBUGF 1, "Init RxFilter\n"
 
;------------------------------------
; Get Receive Filter Control Register
655,7 → 649,6
;***************************************************************************
align 4
init_txd:
DEBUGF 1, "Init TxD\n"
 
;-------------------------
; initialize TX descriptor
684,7 → 677,6
;***************************************************************************
align 4
init_rxd:
DEBUGF 1, "Init RxD\n"
 
; init RX descriptors
mov ecx, NUM_RX_DESC
691,22 → 683,19
lea esi, [device.rxd]
 
.loop:
lea eax, [esi + 16] ; next ptr
lea eax, [esi + 16]
GetRealAddr
mov dword [esi], eax
mov dword [esi + 4], RX_BUFF_SZ ; size
mov dword [esi+0], eax
mov dword [esi+4], RX_BUFF_SZ
 
push ecx
stdcall KernelAlloc, RX_BUFF_SZ
pop ecx
test eax, eax
jz .fail
mov dword [esi + 12], eax ; address
mov dword [esi+12], eax
GetRealAddr
mov dword [esi + 8], eax ; real address
mov dword [esi+8], eax
add esi, 16
dec ecx
jnz .loop
loop .loop
 
lea eax, [device.rxd]
GetRealAddr
745,7 → 734,6
;***************************************************************************
align 4
set_tx_mode:
DEBUGF 1, "set TX mode\n"
 
set_io 0
set_io cr
788,7 → 776,6
;***************************************************************************
align 4
set_rx_mode:
DEBUGF 1, "set RX mode\n"
 
;----------------------------------------------
; update Multicast Hash Table in Receive Filter
859,7 → 846,6
;***************************************************************************
align 4
SIS960_get_mac_addr:
DEBUGF 1, "SIS960 - get mac: "
 
;-------------------------------
; Send Request for eeprom access
933,7 → 919,6
;***************************************************************************
align 4
SIS900_get_mac_addr:
DEBUGF 1, "SIS900 - get mac: "
 
;------------------------------------
; check to see if we have sane EEPROM
982,8 → 967,6
align 4
Get_Mac_SIS635_900_REV:
 
DEBUGF 1, "SIS635 - get mac: "
 
set_io 0
set_io rfcr
in eax, dx
1029,8 → 1012,6
; or eax, RFEN
; out dx, eax
 
DEBUGF 2,"%x-%x-%x-%x-%x-%x\n",[device.mac]:2,[device.mac+1]:2,[device.mac+2]:2,[device.mac+3]:2,[device.mac+4]:2,[device.mac+5]:2
 
xor eax, eax
ret
 
1141,8 → 1122,6
;***************************************************************************
align 4
int_handler:
DEBUGF 1, "Int!\n"
 
; find pointer of device which made IRQ occur
mov esi, device_list
mov ecx, [devices]