24,7 → 24,7 |
|
ends |
|
ETH_FRAME_MINIMUM equ 60 |
ETH_FRAME_MINIMUM = 60 |
|
struct ETH_DEVICE NET_DEVICE |
|
78,7 → 78,7 |
je ARP_input |
|
; cmp ax, ETHER_PPP_DISCOVERY |
; je PPPOE_discovery |
; je PPPoE_discovery_input |
|
DEBUGF 2,"Unknown ethernet packet type %x\n", ax |
|
173,30 → 173,29 |
; |
;----------------------------------------------------------------- |
align 4 |
ETH_API: |
ETH_api: |
|
cmp bh, MAX_NET_DEVICES |
ja .error |
movzx eax, bh |
shl eax, 2 |
|
mov eax, dword [NET_DRV_LIST + eax] |
mov eax, dword [NET_DRV_LIST + 4*eax] |
cmp [eax + NET_DEVICE.type], NET_TYPE_ETH |
jne .error |
|
test bl, bl |
jz .packets_tx ; 0 |
dec bl |
jz .packets_rx ; 1 |
dec bl |
jz .bytes_tx ; 2 |
dec bl |
jz .bytes_rx ; 3 |
dec bl |
jz .read_mac ; 4 |
dec bl |
jz .write_mac ; 5 |
and ebx, 0xff |
cmp ebx, .number |
ja .error |
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 .write_mac ; 5 |
.number = ($ - .table) / 4 - 1 |
|
.error: |
DEBUGF 2,"Device is not ethernet type\n" |
or eax, -1 |