Subversion Repositories Kolibri OS

Rev

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

Rev 5363 Rev 5522
Line 19... Line 19...
19
;;          GNU GENERAL PUBLIC LICENSE                             ;;
19
;;          GNU GENERAL PUBLIC LICENSE                             ;;
20
;;             Version 2, June 1991                                ;;
20
;;             Version 2, June 1991                                ;;
21
;;                                                                 ;;
21
;;                                                                 ;;
22
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 23... Line 23...
23
 
23
 
Line 24... Line 24...
24
$Revision: 5363 $
24
$Revision: 5522 $
25
 
25
 
26
uglobal
26
uglobal
27
        net_10ms        dd ?
27
        net_10ms        dd ?
Line 153... Line 153...
153
 
153
 
154
; Hardware acceleration bits
154
; Hardware acceleration bits
155
NET_HWACC_TCP_IPv4_IN   = 1 shl 0
155
NET_HWACC_TCP_IPv4_IN   = 1 shl 0
Line -... Line 156...
-
 
156
NET_HWACC_TCP_IPv4_OUT  = 1 shl 1
-
 
157
 
-
 
158
; Network frame types
-
 
159
NET_BUFF_LOOPBACK      = 0
156
NET_HWACC_TCP_IPv4_OUT  = 1 shl 1
160
NET_BUFF_ETH           = 1
Line 157... Line 161...
157
 
161
 
158
struct  NET_DEVICE
162
struct  NET_DEVICE
159
 
163
 
Line 173... Line 177...
173
        link_state      dd ?    ; link state (0 = no link)
177
        link_state      dd ?    ; link state (0 = no link)
174
        hwacc           dd ?    ; bitmask stating enabled HW accelerations (offload engines)
178
        hwacc           dd ?    ; bitmask stating enabled HW accelerations (offload engines)
Line 175... Line 179...
175
 
179
 
Line -... Line 180...
-
 
180
ends
-
 
181
 
-
 
182
struct  NET_BUFF
-
 
183
 
-
 
184
        NextPtr         dd ?    ; pointer to next frame in list
-
 
185
        PrevPtr         dd ?    ; pointer to previous frame in list
-
 
186
        device          dd ?    ; ptr to NET_DEVICE structure
-
 
187
        type            dd ?    ; encapsulation type: e.g. Ethernet
-
 
188
        length          dd ?    ; size of encapsulated data
-
 
189
        offset          dd ?    ; offset to actual data (24 bytes for default frame)
-
 
190
        data            rb 0
-
 
191
 
Line 176... Line 192...
176
ends
192
ends
177
 
193
 
178
 
194
 
179
; Exactly as it says..
195
; Exactly as it says..
Line 325... Line 341...
325
  .exit:
341
  .exit:
326
        ret
342
        ret
Line 327... Line 343...
327
 
343
 
-
 
344
 
-
 
345
align 4
-
 
346
NET_BUFF_alloc:
-
 
347
        add     dword[esp+4], NET_BUFF.data
-
 
348
        jmp     kernel_alloc
-
 
349
 
328
 
350
 
329
align 4
351
align 4
330
NET_packet_free:
352
NET_BUFF_free:
Line 331... Line 353...
331
        and     dword[esp+4], not 0xfff
353
        and     dword[esp+4], not 0xfff
Line 480... Line 502...
480
        ret
502
        ret
Line 481... Line 503...
481
 
503
 
482
align 4
504
align 4
Line 483... Line 505...
483
NET_ptr_to_num4:                ; Todo, place number in device structure so we only need to verify?
505
NET_ptr_to_num4:                ; Todo, place number in device structure so we only need to verify?
-
 
506
 
Line -... Line 507...
-
 
507
        test    ebx, ebx
484
 
508
        jz      .fail
485
        push    ecx
509
 
486
 
510
        push    ecx
487
        mov     ecx, NET_DEVICES_MAX
511
        mov     ecx, NET_DEVICES_MAX
488
        mov     edi, NET_DRV_LIST
512
        mov     edi, NET_DRV_LIST
489
  .loop:
513
  .loop:
490
        cmp     ebx, [edi]
514
        cmp     ebx, [edi]
491
        je      .found
515
        je      .found
Line 492... Line -...
492
        add     edi, 4
-
 
493
        dec     ecx
516
        add     edi, 4
-
 
517
        dec     ecx
-
 
518
        jnz     .loop
494
        jnz     .loop
519
 
Line 495... Line 520...
495
 
520
        pop     ecx
496
        or      edi, -1
521
  .fail:
497
        pop     ecx
522
        or      edi, -1