Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2908 → Rev 2909

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