From d8d71f6d24d190d6087a9f5a4db721c06fa7ee22 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Fri, 15 May 2020 17:29:04 +0700 Subject: trxcon: use buffer size macros for TRXC/TRXD messages Change-Id: I6f2b8682c4691ed3da1bf804e302a7169f33e283 --- src/host/trxcon/trx_if.c | 6 +++--- src/host/trxcon/trx_if.h | 5 ++++- 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; -- cgit v1.2.3