Subversion Repositories Kolibri OS

Rev

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

Rev 3555 Rev 3589
Line 26... Line 26...
26
;
26
;
27
;-----------------------------------------------------------------
27
;-----------------------------------------------------------------
28
align 4
28
align 4
29
TCP_output:
29
TCP_output:
Line 30... Line 30...
30
 
30
 
Line 31... Line 31...
31
        DEBUGF  1,"TCP_output: socket=%x\n", eax
31
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_output: socket=%x\n", eax
32
 
32
 
33
        push    eax
33
        push    eax
34
        lea     ecx, [eax + SOCKET.mutex]
34
        lea     ecx, [eax + SOCKET.mutex]
Line 76... Line 76...
76
; we will send what we can and go to transmit state
76
; we will send what we can and go to transmit state
Line 77... Line 77...
77
 
77
 
78
        cmp     [eax + TCP_SOCKET.t_force], 0
78
        cmp     [eax + TCP_SOCKET.t_force], 0
Line 79... Line 79...
79
        je      .no_force
79
        je      .no_force
Line 80... Line 80...
80
 
80
 
81
        DEBUGF 1,"TCP_output: forcing data out\n"
81
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_output: forcing data out\n"
Line 82... Line 82...
82
 
82
 
Line 200... Line 200...
200
  .len_zero:
200
  .len_zero:
Line 201... Line 201...
201
 
201
 
202
;----------------------------------------
202
;----------------------------------------
Line 203... Line 203...
203
; Check if a window update should be sent (154)
203
; Check if a window update should be sent (154)
Line 204... Line 204...
204
 
204
 
205
        DEBUGF  1,"TCP_output: window=%d\n", ecx
205
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_output: window=%d\n", ecx
206
 
206
 
Line 235... Line 235...
235
  .no_window:
235
  .no_window:
Line 236... Line 236...
236
 
236
 
237
;--------------------------
237
;--------------------------
Line 238... Line 238...
238
; Should a segment be sent? (174)
238
; Should a segment be sent? (174)
Line 239... Line 239...
239
 
239
 
240
        DEBUGF  1,"TCP_output: 174\n"
240
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_output: 174\n"
Line 241... Line 241...
241
 
241
 
Line 271... Line 271...
271
        cmp     [eax + TCP_SOCKET.timer_retransmission], 0
271
        cmp     [eax + TCP_SOCKET.timer_retransmission], 0
272
        jne     @f
272
        jne     @f
273
        cmp     [eax + TCP_SOCKET.timer_persist], 0     ; Persist timer already expired?
273
        cmp     [eax + TCP_SOCKET.timer_persist], 0     ; Persist timer already expired?
274
        jne     @f
274
        jne     @f
Line 275... Line 275...
275
 
275
 
Line 276... Line 276...
276
        DEBUGF  1,"TCP_output: Entering persist state\n"
276
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_output: Entering persist state\n"
277
 
277
 
278
        mov     [eax + TCP_SOCKET.t_rxtshift], 0
278
        mov     [eax + TCP_SOCKET.t_rxtshift], 0
Line 279... Line 279...
279
        call    TCP_set_persist
279
        call    TCP_set_persist
280
       @@:
280
       @@:
Line 281... Line 281...
281
 
281
 
Line 282... Line 282...
282
;----------------------------
282
;----------------------------
283
; No reason to send a segment (219)
283
; No reason to send a segment (219)
284
 
284
 
285
        DEBUGF  1,"TCP_output: No reason to send a segment\n"
285
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_output: No reason to send a segment\n"
Line 311... Line 311...
311
;
311
;
312
;-----------------------------------------------
312
;-----------------------------------------------
313
align 4
313
align 4
314
TCP_send:
314
TCP_send:
Line 315... Line 315...
315
 
315
 
Line 316... Line 316...
316
        DEBUGF  1,"TCP_send: socket=%x length=%u flags=%x\n", eax, esi, dl
316
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_send: socket=%x length=%u flags=%x\n", eax, esi, dl
317
 
317
 
318
        push    eax                     ; save socket ptr
318
        push    eax                     ; save socket ptr
Line 335... Line 335...
335
        or      ecx, TCP_OPT_MAXSEG shl 24 + 4 shl 16
335
        or      ecx, TCP_OPT_MAXSEG shl 24 + 4 shl 16
336
        bswap   ecx
336
        bswap   ecx
337
        push    ecx
337
        push    ecx
338
        add     di, 4
338
        add     di, 4
Line 339... Line 339...
339
 
339
 
Line 340... Line 340...
340
        DEBUGF  1,"TCP_send: added maxseg option\n"
340
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_send: added maxseg option\n"
341
 
341
 
Line 342... Line 342...
342
        test    [eax + TCP_SOCKET.t_flags], TF_REQ_SCALE
342
        test    [eax + TCP_SOCKET.t_flags], TF_REQ_SCALE
Line 353... Line 353...
353
        mov     ch, TCP_OPT_NOP
353
        mov     ch, TCP_OPT_NOP
354
        pushw   cx
354
        pushw   cx
355
        pushw   TCP_OPT_WINDOW + 3 shl 8
355
        pushw   TCP_OPT_WINDOW + 3 shl 8
356
        add     di, 4
356
        add     di, 4
Line 357... Line 357...
357
 
357
 
Line 358... Line 358...
358
        DEBUGF  1,"TCP_send: added scale option\n"
358
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_send: added scale option\n"
359
 
359
 
Line 360... Line 360...
360
  .no_scale:
360
  .no_scale:
Line 379... Line 379...
379
        pushd   0
379
        pushd   0
380
        pushd   [timer_ticks]
380
        pushd   [timer_ticks]
381
        pushd   TCP_OPT_NOP + TCP_OPT_NOP shl 8 + TCP_OPT_TIMESTAMP shl 16 + 10 shl 24
381
        pushd   TCP_OPT_NOP + TCP_OPT_NOP shl 8 + TCP_OPT_TIMESTAMP shl 16 + 10 shl 24
382
        add     di, 12
382
        add     di, 12
Line 383... Line 383...
383
 
383
 
Line 384... Line 384...
384
        DEBUGF  1,"TCP_send: added timestamp\n"
384
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_send: added timestamp\n"
Line 385... Line 385...
385
 
385
 
Line 536... Line 536...
536
        mov     [esi + TCP_header.Checksum], dx
536
        mov     [esi + TCP_header.Checksum], dx
Line 537... Line 537...
537
 
537
 
538
;----------------
538
;----------------
Line 539... Line 539...
539
; Send the packet
539
; Send the packet
540
 
540
 
541
        DEBUGF  1,"TCP_send: Sending with device %x\n", ebx
541
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_send: Sending with device %x\n", ebx
Line 542... Line 542...
542
        call    [ebx + NET_DEVICE.transmit]
542
        call    [ebx + NET_DEVICE.transmit]
543
        jnz     .send_error
543
        jnz     .send_error
Line 578... Line 578...
578
; Check if we need more output
578
; Check if we need more output
Line 579... Line 579...
579
 
579
 
580
        test    [eax + TCP_SOCKET.temp_bits], TCP_BIT_SENDALOT
580
        test    [eax + TCP_SOCKET.temp_bits], TCP_BIT_SENDALOT
Line 581... Line 581...
581
        jnz     TCP_output.again
581
        jnz     TCP_output.again
Line 582... Line 582...
582
 
582
 
583
        DEBUGF 1,"TCP_send: success!\n"
583
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_send: success!\n"
Line 595... Line 595...
595
        mov     [eax + TCP_SOCKET.timer_retransmission], TCP_time_re_min
595
        mov     [eax + TCP_SOCKET.timer_retransmission], TCP_time_re_min
Line 596... Line 596...
596
 
596
 
597
        lea     ecx, [eax + SOCKET.mutex]
597
        lea     ecx, [eax + SOCKET.mutex]
Line 598... Line 598...
598
        call    mutex_unlock
598
        call    mutex_unlock
Line 599... Line 599...
599
 
599
 
600
        DEBUGF 1,"TCP_send: IP error\n"
600
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_send: IP error\n"
Line 607... Line 607...
607
        add     esp, 8
607
        add     esp, 8
Line 608... Line 608...
608
 
608
 
609
        lea     ecx, [eax + SOCKET.mutex]
609
        lea     ecx, [eax + SOCKET.mutex]
Line 610... Line 610...
610
        call    mutex_unlock
610
        call    mutex_unlock
Line 611... Line 611...
611
 
611
 
612
        DEBUGF 1,"TCP_send: sending failed\n"
612
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_send: sending failed\n"