Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3625 → Rev 3626

/kernel/branches/Kolibri-acpi/network/ethernet.inc
64,19 → 64,19
lea edx, [eax + sizeof.ETH_header]
mov ax, [eax + ETH_header.Type]
 
cmp ax, ETHER_IPv4
cmp ax, ETHER_PROTO_IPv4
je IPv4_input
 
cmp ax, ETHER_ARP
cmp ax, ETHER_PROTO_ARP
je ARP_input
 
cmp ax, ETHER_IPv6
cmp ax, ETHER_PROTO_IPv6
je IPv6_input
 
cmp ax, ETHER_PPP_DISCOVERY
cmp ax, ETHER_PROTO_PPP_DISCOVERY
je PPPoE_discovery_input
 
cmp ax, ETHER_PPP_SESSION
cmp ax, ETHER_PROTO_PPP_SESSION
je PPPoE_session_input
 
DEBUGF DEBUG_NETWORK_ERROR, "ETH_input: Unknown packet type=%x\n", ax
162,7 → 162,7
;
; ETH_API
;
; This function is called by system function 75
; This function is called by system function 76
;
; IN: subfunction number in bl
; device number in bh
174,11 → 174,11
align 4
ETH_api:
 
cmp bh, MAX_NET_DEVICES
cmp bh, NET_DEVICES_MAX
ja .error
movzx eax, bh
mov eax, dword [NET_DRV_LIST + 4*eax]
cmp [eax + NET_DEVICE.type], NET_TYPE_ETH
cmp [eax + NET_DEVICE.device_type], NET_DEVICE_ETH
jne .error
 
and ebx, 0xff
187,12 → 187,7
jmp dword [.table + 4*ebx]
 
.table:
dd .packets_tx ; 0
dd .packets_rx ; 1
dd .bytes_tx ; 2
dd .bytes_rx ; 3
dd .read_mac ; 4
dd .state ; 5
dd .read_mac ; 0
.number = ($ - .table) / 4 - 1
 
.error:
199,28 → 194,7
or eax, -1
ret
 
.packets_tx:
mov eax, [eax + NET_DEVICE.packets_tx]
 
ret
 
.packets_rx:
mov eax, [eax + NET_DEVICE.packets_rx]
ret
 
.bytes_tx:
mov ebx, dword [eax + NET_DEVICE.bytes_tx + 4]
mov eax, dword [eax + NET_DEVICE.bytes_tx]
mov [esp+20+4], ebx ; TODO: fix this ugly code
ret
 
.bytes_rx:
mov ebx, dword [eax + NET_DEVICE.bytes_rx + 4]
mov eax, dword [eax + NET_DEVICE.bytes_rx]
mov [esp+20+4], ebx ; TODO: fix this ugly code
ret
 
 
.read_mac:
movzx ebx, word [eax + ETH_DEVICE.mac]
mov eax, dword [eax + ETH_DEVICE.mac + 2]
227,7 → 201,4
mov [esp+20+4], ebx ; TODO: fix this ugly code
ret
 
.state:
mov eax, [eax + NET_DEVICE.state]
ret