aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-04-15 04:14:03 +0200
committerlaforge <laforge@osmocom.org>2021-04-24 08:47:00 +0000
commit61fcfa6ae7fcfd68a33e15b7d9a3190437b47107 (patch)
treea3625fa079d8eeec90522d9c386e9a12c03d1bee
parent708fca343e1430f1d429025d357fc4c1df74abd5 (diff)
osmo-bts-trx: define TRXC/TRXD message buffer size
-rw-r--r--src/osmo-bts-trx/trx_if.c13
-rw-r--r--src/osmo-bts-trx/trx_if.h5
2 files changed, 10 insertions, 8 deletions
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;