Subversion Repositories Kolibri OS

Rev

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

Rev 3275 Rev 3289
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: 3275 $
17
$Revision: 3289 $
18
 
18
 
19
;-----------------------------------------------------------------
19
;-----------------------------------------------------------------
20
;
20
;
Line 287... Line 287...
287
        pusha
287
        pusha
288
        lea     ecx, [eax + SOCKET.mutex]
288
        lea     ecx, [eax + SOCKET.mutex]
289
        call    mutex_unlock
289
        call    mutex_unlock
290
        popa
290
        popa
Line -... Line 291...
-
 
291
 
-
 
292
; Fixme: returnvalue?
291
 
293
 
Line 531... Line 533...
531
; Create the checksum
533
; Create the checksum
Line 532... Line 534...
532
 
534
 
533
        TCP_checksum (eax + IP_SOCKET.LocalIP), (eax + IP_SOCKET.RemoteIP)
535
        TCP_checksum (eax + IP_SOCKET.LocalIP), (eax + IP_SOCKET.RemoteIP)
Line 534... Line -...
534
        mov     [esi + TCP_header.Checksum], dx
-
 
535
 
-
 
536
; unlock socket
-
 
537
        lea     ecx, [eax + SOCKET.mutex]
-
 
538
        call    mutex_unlock
536
        mov     [esi + TCP_header.Checksum], dx
539
 
537
 
Line 540... Line 538...
540
;----------------
538
;----------------
541
; Send the packet
539
; Send the packet
Line 550... Line 548...
550
        pop     ecx
548
        pop     ecx
551
        pop     eax
549
        pop     eax
Line 552... Line 550...
552
 
550
 
Line 553... Line -...
553
        inc     [TCP_segments_tx]       ; FIXME: correct interface?
-
 
554
 
-
 
555
; unlock socket
-
 
556
        lea     ecx, [eax + SOCKET.mutex]
-
 
557
        call    mutex_lock
551
        inc     [TCP_segments_tx]       ; FIXME: correct interface?
558
 
552
 
559
; update advertised receive window
553
; update advertised receive window
560
        test    ecx, ecx
554
        test    ecx, ecx
561
        jz      @f
555
        jz      @f
Line 570... Line 564...
570
        pop     [eax + TCP_SOCKET.last_ack_sent]
564
        pop     [eax + TCP_SOCKET.last_ack_sent]
Line 571... Line 565...
571
 
565
 
572
; and flags
566
; and flags
Line 573... Line -...
573
        and     [eax + TCP_SOCKET.t_flags], not (TF_ACKNOW + TF_DELACK)
-
 
574
 
567
        and     [eax + TCP_SOCKET.t_flags], not (TF_ACKNOW + TF_DELACK)
575
        test    [eax + TCP_SOCKET.temp_bits], TCP_BIT_SENDALOT
-
 
576
        jnz     TCP_output.again
568
 
-
 
569
;--------------
-
 
570
; unlock socket
577
 
571
 
578
; unlock socket
572
        push    eax
-
 
573
        lea     ecx, [eax + SOCKET.mutex]
-
 
574
        call    mutex_unlock
-
 
575
        pop     eax
-
 
576
 
-
 
577
;-----------------------------
-
 
578
; Check if we need more output
-
 
579
 
Line 579... Line 580...
579
        lea     ecx, [eax + SOCKET.mutex]
580
        test    [eax + TCP_SOCKET.temp_bits], TCP_BIT_SENDALOT
Line 580... Line 581...
580
        call    mutex_unlock
581
        jnz     TCP_output.again
581
 
582
 
Line 591... Line 592...
591
        add     esp, 4
592
        add     esp, 4
592
        pop     eax
593
        pop     eax
Line 593... Line 594...
593
 
594
 
Line 594... Line -...
594
        mov     [eax + TCP_SOCKET.timer_retransmission], TCP_time_re_min
-
 
595
 
595
        mov     [eax + TCP_SOCKET.timer_retransmission], TCP_time_re_min
596
; unlock socket
596
 
Line 597... Line 597...
597
        lea     ecx, [eax + SOCKET.mutex]
597
        lea     ecx, [eax + SOCKET.mutex]
Line 598... Line 598...
598
        call    mutex_unlock
598
        call    mutex_unlock
599
 
599
 
Line -... Line 600...
-
 
600
        DEBUGF 1,"TCP_send: IP error\n"
600
        DEBUGF 1,"TCP_send: IP error\n"
601
 
601
 
602
        or      eax, -1
Line -... Line 603...
-
 
603
        ret
-
 
604
 
-
 
605
 
602
        or      eax, -1
606
  .send_error:
Line 603... Line 607...
603
        ret
607
        add     esp, 8
604
 
608