From 61fcfa6ae7fcfd68a33e15b7d9a3190437b47107 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Thu, 15 Apr 2021 04:14:03 +0200 Subject: osmo-bts-trx: define TRXC/TRXD message buffer size Change-Id: I4cb05600fa8af33e1c92e93cc1a86c14f21b9fb2 Related: SYS#4895, OS#4941, OS#4006 --- src/osmo-bts-trx/trx_if.c | 13 +++++-------- src/osmo-bts-trx/trx_if.h | 5 +++++ 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 495de920..905d3da2 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -95,7 +95,7 @@ static int trx_clk_read_cb(struct osmo_fd *ofd, unsigned int what) { struct phy_link *plink = ofd->data; struct phy_instance *pinst = phy_instance_by_num(plink, 0); - char buf[1500]; + char buf[TRXC_MSG_BUF_SIZE]; ssize_t len; uint32_t fn; @@ -148,7 +148,7 @@ static int trx_clk_read_cb(struct osmo_fd *ofd, unsigned int what) static void trx_ctrl_send(struct trx_l1h *l1h) { struct trx_ctrl_msg *tcm; - char buf[1500]; + char buf[TRXC_MSG_BUF_SIZE]; int len; ssize_t snd_len; @@ -634,7 +634,7 @@ static int trx_ctrl_read_cb(struct osmo_fd *ofd, unsigned int what) { struct trx_l1h *l1h = ofd->data; struct phy_instance *pinst = l1h->phy_inst; - char buf[1500]; + char buf[TRXC_MSG_BUF_SIZE]; struct trx_ctrl_rsp rsp; int len, rc; struct trx_ctrl_msg *tcm; @@ -718,9 +718,6 @@ rsp_error: * TRX burst data socket */ -/* Maximum DATA message length (header + burst) */ -#define TRX_DATA_MSG_MAX_LEN 512 - /* Common header length: 1/2 VER + 1/2 TDMA TN + 4 TDMA FN */ #define TRX_CHDR_LEN (1 + 4) /* Uplink v0 header length: 1 RSSI + 2 ToA256 */ @@ -920,7 +917,7 @@ static const char *trx_data_desc_msg(const struct trx_ul_burst_ind *bi) static int trx_data_read_cb(struct osmo_fd *ofd, unsigned int what) { struct trx_l1h *l1h = ofd->data; - uint8_t buf[TRX_DATA_MSG_MAX_LEN]; + uint8_t buf[TRXD_MSG_BUF_SIZE]; struct trx_ul_burst_ind bi; ssize_t hdr_len, buf_len; uint8_t pdu_ver; @@ -1002,7 +999,7 @@ int trx_if_send_burst(struct trx_l1h *l1h, const struct trx_dl_burst_req *br) { ssize_t snd_len; uint8_t pdu_ver = l1h->config.trxd_pdu_ver_use; - uint8_t buf[TRX_DATA_MSG_MAX_LEN]; + uint8_t buf[TRXD_MSG_BUF_SIZE]; if ((br->burst_len != GSM_BURST_LEN) && (br->burst_len != EGPRS_BURST_LEN)) { LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR, "Tx burst length %zu invalid\n", diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 18ba74f3..ca3d51b6 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -1,5 +1,10 @@ #pragma once +/* TRXC read/send buffer size */ +#define TRXC_MSG_BUF_SIZE 1500 +/* TRXD read/send buffer size */ +#define TRXD_MSG_BUF_SIZE 512 + struct trx_dl_burst_req; struct trx_l1h; -- cgit v1.2.3