Subversion Repositories Kolibri OS

Rev

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

Rev 3600 Rev 3601
Line 65... Line 65...
65
        mov     ax, [eax + ETH_header.Type]
65
        mov     ax, [eax + ETH_header.Type]
Line 66... Line 66...
66
 
66
 
67
        cmp     ax, ETHER_PROTO_IPv4
67
        cmp     ax, ETHER_PROTO_IPv4
Line 68... Line 68...
68
        je      IPv4_input
68
        je      IPv4_input
69
 
69
 
Line 70... Line 70...
70
        cmp     ax, ETHER_PROTO_IPv4
70
        cmp     ax, ETHER_PROTO_ARP
71
        je      ARP_input
71
        je      ARP_input
Line 72... Line 72...
72
 
72
 
73
        cmp     ax, ETHER_PROTO_IPv4
73
        cmp     ax, ETHER_PROTO_IPv6
Line 160... Line 160...
160
 
160
 
161
;-----------------------------------------------------------------
161
;-----------------------------------------------------------------
162
;
162
;
163
; ETH_API
163
; ETH_API
164
;
164
;
165
; This function is called by system function 75
165
; This function is called by system function 76
166
;
166
;
167
; IN:  subfunction number in bl
167
; IN:  subfunction number in bl
168
;      device number in bh
168
;      device number in bh
169
;      ecx, edx, .. depends on subfunction
169
;      ecx, edx, .. depends on subfunction
Line 185... Line 185...
185
        cmp     ebx, .number
185
        cmp     ebx, .number
186
        ja      .error
186
        ja      .error
187
        jmp     dword [.table + 4*ebx]
187
        jmp     dword [.table + 4*ebx]
Line 188... Line 188...
188
 
188
 
189
  .table:
-
 
190
        dd      .packets_tx     ; 0
-
 
191
        dd      .packets_rx     ; 1
-
 
192
        dd      .bytes_tx       ; 2
-
 
193
        dd      .bytes_rx       ; 3
189
  .table:
194
        dd      .read_mac       ; 4
-
 
195
        dd      .state          ; 5
190
        dd      .read_mac       ; 0
Line 196... Line 191...
196
  .number = ($ - .table) / 4 - 1
191
  .number = ($ - .table) / 4 - 1
197
 
192
 
198
  .error:
193
  .error:
Line 199... Line -...
199
        or      eax, -1
-
 
200
        ret
-
 
201
 
-
 
202
  .packets_tx:
-
 
203
        mov     eax, [eax + NET_DEVICE.packets_tx]
-
 
204
 
-
 
205
        ret
-
 
206
 
-
 
207
  .packets_rx:
-
 
208
        mov     eax, [eax + NET_DEVICE.packets_rx]
-
 
209
        ret
-
 
210
 
-
 
211
  .bytes_tx:
-
 
212
        mov     ebx, dword [eax + NET_DEVICE.bytes_tx + 4]
-
 
213
        mov     eax, dword [eax + NET_DEVICE.bytes_tx]
-
 
214
        mov     [esp+20+4], ebx                         ; TODO: fix this ugly code
-
 
215
        ret
-
 
216
 
-
 
217
  .bytes_rx:
-
 
218
        mov     ebx, dword [eax + NET_DEVICE.bytes_rx + 4]
-
 
219
        mov     eax, dword [eax + NET_DEVICE.bytes_rx]
-
 
Line 220... Line 194...
220
        mov     [esp+20+4], ebx                         ; TODO: fix this ugly code
194
        or      eax, -1
221
        ret
195
        ret
222
 
196
 
223
 
197
 
224
  .read_mac:
198
  .read_mac:
Line 225... Line -...
225
        movzx   ebx, word [eax + ETH_DEVICE.mac]
-
 
226
        mov     eax, dword [eax + ETH_DEVICE.mac + 2]
-
 
227
        mov     [esp+20+4], ebx                         ; TODO: fix this ugly code
-