From 648247592c9429e80bc6236bfbc3e33d6c098f4c Mon Sep 17 00:00:00 2001 From: Akshai M Date: Thu, 14 May 2020 16:31:28 +0530 Subject: [PATCH] gnrc/tcp : Move GNRC_TCP_RCV_BUFFERS to 'CONFIG_' --- sys/include/net/gnrc/tcp.h | 2 +- sys/include/net/gnrc/tcp/config.h | 4 ++-- sys/net/gnrc/transport_layer/tcp/gnrc_tcp_rcvbuf.c | 6 +++--- sys/net/gnrc/transport_layer/tcp/internal/rcvbuf.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/include/net/gnrc/tcp.h b/sys/include/net/gnrc/tcp.h index dfaf53e3aa..d44412e41c 100644 --- a/sys/include/net/gnrc/tcp.h +++ b/sys/include/net/gnrc/tcp.h @@ -150,7 +150,7 @@ int gnrc_tcp_open_active(gnrc_tcp_tcb_t *tcb, const gnrc_tcp_ep_t *remote, * or the address in @p local is invalid. * @return -EISCONN if TCB is already in use. * @return -ENOMEM if the receive buffer for the TCB could not be allocated. - * Hint: Increase "GNRC_TCP_RCV_BUFFERS". + * Hint: Increase "CONFIG_GNRC_TCP_RCV_BUFFERS". */ int gnrc_tcp_open_passive(gnrc_tcp_tcb_t *tcb, const gnrc_tcp_ep_t *local); diff --git a/sys/include/net/gnrc/tcp/config.h b/sys/include/net/gnrc/tcp/config.h index c4aa11beb6..b849bdd829 100644 --- a/sys/include/net/gnrc/tcp/config.h +++ b/sys/include/net/gnrc/tcp/config.h @@ -96,8 +96,8 @@ extern "C" { * This value determines how many parallel TCP connections can be active at the * same time. */ -#ifndef GNRC_TCP_RCV_BUFFERS -#define GNRC_TCP_RCV_BUFFERS (1U) +#ifndef CONFIG_GNRC_TCP_RCV_BUFFERS +#define CONFIG_GNRC_TCP_RCV_BUFFERS (1U) #endif /** diff --git a/sys/net/gnrc/transport_layer/tcp/gnrc_tcp_rcvbuf.c b/sys/net/gnrc/transport_layer/tcp/gnrc_tcp_rcvbuf.c index 8058f4687e..e06fc5de0d 100644 --- a/sys/net/gnrc/transport_layer/tcp/gnrc_tcp_rcvbuf.c +++ b/sys/net/gnrc/transport_layer/tcp/gnrc_tcp_rcvbuf.c @@ -33,7 +33,7 @@ void _rcvbuf_init(void) { DEBUG("gnrc_tcp_rcvbuf.c : _rcvbuf_init() : entry\n"); mutex_init(&(_static_buf.lock)); - for (size_t i = 0; i < GNRC_TCP_RCV_BUFFERS; ++i) { + for (size_t i = 0; i < CONFIG_GNRC_TCP_RCV_BUFFERS; ++i) { _static_buf.entries[i].used = 0; } } @@ -49,7 +49,7 @@ static void* _rcvbuf_alloc(void) void *result = NULL; DEBUG("gnrc_tcp_rcvbuf.c : _rcvbuf_alloc() : Entry\n"); mutex_lock(&(_static_buf.lock)); - for (size_t i = 0; i < GNRC_TCP_RCV_BUFFERS; ++i) { + for (size_t i = 0; i < CONFIG_GNRC_TCP_RCV_BUFFERS; ++i) { if (_static_buf.entries[i].used == 0) { _static_buf.entries[i].used = 1; result = (void *)(_static_buf.entries[i].buffer); @@ -69,7 +69,7 @@ static void _rcvbuf_free(void * const buf) { DEBUG("gnrc_tcp_rcvbuf.c : _rcvbuf_free() : Entry\n"); mutex_lock(&(_static_buf.lock)); - for (size_t i = 0; i < GNRC_TCP_RCV_BUFFERS; ++i) { + for (size_t i = 0; i < CONFIG_GNRC_TCP_RCV_BUFFERS; ++i) { if ((_static_buf.entries[i].used == 1) && (buf == _static_buf.entries[i].buffer)) { _static_buf.entries[i].used = 0; } diff --git a/sys/net/gnrc/transport_layer/tcp/internal/rcvbuf.h b/sys/net/gnrc/transport_layer/tcp/internal/rcvbuf.h index 778726b61c..fe6a24da32 100644 --- a/sys/net/gnrc/transport_layer/tcp/internal/rcvbuf.h +++ b/sys/net/gnrc/transport_layer/tcp/internal/rcvbuf.h @@ -42,7 +42,7 @@ typedef struct rcvbuf_entry { */ typedef struct rcvbuf { mutex_t lock; /**< Lock for allocation synchronization */ - rcvbuf_entry_t entries[GNRC_TCP_RCV_BUFFERS]; /**< Maintained receive buffers */ + rcvbuf_entry_t entries[CONFIG_GNRC_TCP_RCV_BUFFERS]; /**< Maintained receive buffers */ } rcvbuf_t; /**