Subversion Repositories Kolibri OS

Rev

Rev 2607 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2607 Rev 2614
Line 12... Line 12...
12
;;          GNU GENERAL PUBLIC LICENSE                             ;;
12
;;          GNU GENERAL PUBLIC LICENSE                             ;;
13
;;             Version 2, June 1991                                ;;
13
;;             Version 2, June 1991                                ;;
14
;;                                                                 ;;
14
;;                                                                 ;;
15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 16... Line 16...
16
 
16
 
Line 17... Line 17...
17
$Revision: 2607 $
17
$Revision: 2614 $
Line 18... Line 18...
18
 
18
 
19
struct  ETH_header
19
struct  ETH_header
20
 
20
 
Line 21... Line 21...
21
        DstMAC          dp  ?  ; destination MAC-address
21
        DstMAC          dp  ?  ; destination MAC-address
Line 22... Line 22...
22
        SrcMAC          dp  ?  ; source MAC-address
22
        SrcMAC          dp  ?  ; source MAC-address
Line 23... Line 23...
23
        Type            dw  ?  ; type of the upper-layer protocol
23
        Type            dw  ?  ; type of the upper-layer protocol
Line 24... Line 24...
24
 
24
 
25
ends
25
ends
Line 76... Line 76...
76
 
76
 
77
        cmp     ax, ETHER_ARP
77
        cmp     ax, ETHER_ARP
Line 78... Line 78...
78
        je      ARP_input
78
        je      ARP_input
79
 
79
 
Line 80... Line 80...
80
;        cmp     ax, ETHER_PPP_DISCOVERY
80
;        cmp     ax, ETHER_PPP_DISCOVERY
Line 81... Line 81...
81
;        je      PPPOE_discovery
81
;        je      PPPoE_discovery_input
82
 
82
 
Line 171... Line 171...
171
;
171
;
172
; OUT:
172
; OUT:
173
;
173
;
174
;-----------------------------------------------------------------
174
;-----------------------------------------------------------------
175
align 4
175
align 4
176
ETH_API:
176
ETH_api:
Line 177... Line 177...
177
 
177
 
178
        cmp     bh, MAX_NET_DEVICES
178
        cmp     bh, MAX_NET_DEVICES
179
        ja      .error
179
        ja      .error
180
        movzx   eax, bh
-
 
181
        shl     eax, 2
-
 
182
 
180
        movzx   eax, bh
183
        mov     eax, dword [NET_DRV_LIST + eax]
181
        mov     eax, dword [NET_DRV_LIST + 4*eax]
184
        cmp     [eax + NET_DEVICE.type], NET_TYPE_ETH
182
        cmp     [eax + NET_DEVICE.type], NET_TYPE_ETH
Line 185... Line 183...
185
        jne     .error
183
        jne     .error
186
 
184
 
187
        test    bl, bl
185
        and     ebx, 0xff
188
        jz      .packets_tx     ; 0
186
        cmp     ebx, .number
-
 
187
        ja      .error
189
        dec     bl
188
        jmp     dword [.table + 4*ebx]
190
        jz      .packets_rx     ; 1
189
 
191
        dec     bl
190
  .table:
192
        jz      .bytes_tx       ; 2
191
        dd      .packets_tx     ; 0
193
        dec     bl
192
        dd      .packets_rx     ; 1
194
        jz      .bytes_rx       ; 3
193
        dd      .bytes_tx       ; 2
195
        dec     bl
194
        dd      .bytes_rx       ; 3
196
        jz      .read_mac       ; 4
195
        dd      .read_mac       ; 4
Line 197... Line 196...
197
        dec     bl
196
        dd      .write_mac      ; 5
198
        jz      .write_mac      ; 5
197
  .number = ($ - .table) / 4 - 1
199
 
198
 
200
  .error:
199
  .error: