summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-05-15 17:29:04 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-05-17 14:36:32 +0700
commitd8d71f6d24d190d6087a9f5a4db721c06fa7ee22 (patch)
tree90f59f11c714232ecb823710ae8ae194df105e4f
parent7ec1c1ccc84536db35fa3c51eea6ef291a762cda (diff)
trxcon: use buffer size macros for TRXC/TRXD messages
-rw-r--r--src/host/trxcon/trx_if.c6
-rw-r--r--src/host/trxcon/trx_if.h5
2 files changed, 7 insertions, 4 deletions
diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index 20c64ec1..cb54c9ed 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -446,7 +446,7 @@ static int trx_ctrl_read_cb(struct osmo_fd *ofd, unsigned int what)
struct trx_instance *trx = ofd->data;
struct trx_ctrl_msg *tcm;
int resp, rsp_len;
- char buf[1500], *p;
+ char buf[TRXC_BUF_SIZE], *p;
ssize_t read_len;
read_len = read(ofd->fd, buf, sizeof(buf) - 1);
@@ -556,7 +556,7 @@ static int trx_data_rx_cb(struct osmo_fd *ofd, unsigned int what)
{
struct trx_instance *trx = ofd->data;
struct trx_meas_set meas;
- uint8_t buf[256];
+ uint8_t buf[TRXD_BUF_SIZE];
sbit_t bits[148];
int8_t rssi, tn;
int16_t toa256;
@@ -616,7 +616,7 @@ static int trx_data_rx_cb(struct osmo_fd *ofd, unsigned int what)
int trx_if_tx_burst(struct trx_instance *trx, uint8_t tn, uint32_t fn,
uint8_t pwr, const ubit_t *bits)
{
- uint8_t buf[256];
+ uint8_t buf[TRXD_BUF_SIZE];
/**
* We must be sure that we have clock,
diff --git a/src/host/trxcon/trx_if.h b/src/host/trxcon/trx_if.h
index a44600d9..2fafa56a 100644
--- a/src/host/trxcon/trx_if.h
+++ b/src/host/trxcon/trx_if.h
@@ -8,6 +8,9 @@
#include "scheduler.h"
#include "sched_trx.h"
+#define TRXC_BUF_SIZE 1024
+#define TRXD_BUF_SIZE 512
+
/* Forward declaration to avoid mutual include */
struct l1ctl_link;
@@ -49,7 +52,7 @@ struct trx_instance {
struct trx_ctrl_msg {
struct llist_head list;
- char cmd[128];
+ char cmd[TRXC_BUF_SIZE];
int retry_cnt;
int critical;
int cmd_len;