From 38fd27755792985d7655b879687bedd9d5f80bae Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Sun, 25 Aug 2019 19:02:34 +0000 Subject: [PATCH] small network code updates, annotations git-svn-id: svn://kolibrios.org@7680 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/network/socket.inc | 13 ++++++------- kernel/trunk/network/tcp_output.inc | 4 ++-- kernel/trunk/network/tcp_subr.inc | 2 ++ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/kernel/trunk/network/socket.inc b/kernel/trunk/network/socket.inc index 7375ec956b..10ef347ea9 100644 --- a/kernel/trunk/network/socket.inc +++ b/kernel/trunk/network/socket.inc @@ -920,7 +920,7 @@ socket_receive_stream: DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_receive: STREAM\n" - cmp [eax + STREAM_SOCKET.rcv + RING_BUFFER.size], 0 + cmp [eax + STREAM_SOCKET.rcv.size], 0 je .wouldblock test edi, MSG_PEEK @@ -936,7 +936,7 @@ socket_receive_stream: call socket_ring_free ; free read memory pop eax - cmp [eax + STREAM_SOCKET.rcv + RING_BUFFER.size], 0 + cmp [eax + STREAM_SOCKET.rcv.size], 0 jne .more_data xor ebx, ebx ; errorcode = 0 (no error) ret @@ -953,7 +953,7 @@ socket_receive_stream: ret .peek: - mov ecx, [eax + STREAM_SOCKET.rcv + RING_BUFFER.size] + mov ecx, [eax + STREAM_SOCKET.rcv.size] xor ebx, ebx ret @@ -1561,7 +1561,7 @@ socket_input: jmp socket_notify .full: - DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_input: socket %x is full!\n", eax + DEBUGF DEBUG_NETWORK_ERROR, "SOCKET_input: socket %x is full!\n", eax pusha lea ecx, [eax + SOCKET.mutex] @@ -1657,7 +1657,6 @@ socket_ring_write: jb @f sub edi, SOCKET_BUFFER_SIZE ; WRAP @@: - mov [eax + RING_BUFFER.write_ptr], edi pop edi @@ -1753,7 +1752,7 @@ socket_ring_read: call mutex_unlock ; TODO: check what registers this function actually destroys popa - DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_ring_read: no data at all!\n" + DEBUGF DEBUG_NETWORK_ERROR, "SOCKET_ring_read: no data at all!\n" xor ecx, ecx ret @@ -1800,7 +1799,7 @@ socket_ring_free: ret .error: ; we could free all available bytes, but that would be stupid, i guess.. - DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_ring_free: buffer=%x error!\n", eax + DEBUGF DEBUG_NETWORK_ERROR, "SOCKET_ring_free: buffer=%x error!\n", eax add [eax + RING_BUFFER.size], ecx push eax diff --git a/kernel/trunk/network/tcp_output.inc b/kernel/trunk/network/tcp_output.inc index 259ace8280..484763a9f4 100644 --- a/kernel/trunk/network/tcp_output.inc +++ b/kernel/trunk/network/tcp_output.inc @@ -495,9 +495,9 @@ endl xor ebx, ebx @@: - cmp ebx, TCP_max_win + cmp ebx, TCP_max_win ;;;; shl rcv_scale jbe @f - mov ebx, TCP_max_win + mov ebx, TCP_max_win ;;;; shl rcv_scale @@: mov ecx, [eax + TCP_SOCKET.RCV_ADV] diff --git a/kernel/trunk/network/tcp_subr.inc b/kernel/trunk/network/tcp_subr.inc index cb499c2eb6..5e50a2d066 100644 --- a/kernel/trunk/network/tcp_subr.inc +++ b/kernel/trunk/network/tcp_subr.inc @@ -89,6 +89,8 @@ macro tcp_rcvseqinit ptr { macro tcp_init_socket socket { +; new tcp control block + mov [socket + TCP_SOCKET.t_maxseg], TCP_mss_default mov [socket + TCP_SOCKET.t_flags], TF_REQ_SCALE or TF_REQ_TSTMP