aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx/trx_if.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-04-22 04:55:28 +0200
committerlaforge <laforge@osmocom.org>2021-04-24 08:48:03 +0000
commitdd8439f889a805da195f0a973c7c2355980cd5e2 (patch)
treee5216ef8190a1da01d78a026a36464d4dfc16fd9 /src/osmo-bts-trx/trx_if.c
parent8a993652810b52014d82129ec14e0c356eef720e (diff)
osmo-bts-trx: pass 'struct phy_instance' to TRXD dissectors
All these functions need the PHY instance pointer for logging, they don't really need a pointer to 'struct trx_l1h'. Change-Id: I626b4392a8bc57a3fe5e8c931aa1ce9dd505676c Related: SYS#4895, OS#4941, OS#4006
Diffstat (limited to 'src/osmo-bts-trx/trx_if.c')
-rw-r--r--src/osmo-bts-trx/trx_if.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index 28b5f2e3..d2ad877d 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -730,7 +730,7 @@ static const uint8_t trx_data_rx_hdr_len[] = {
};
/* TRXD header dissector for version 0 */
-static int trx_data_handle_hdr_v0(struct trx_l1h *l1h,
+static int trx_data_handle_hdr_v0(struct phy_instance *phy_inst,
struct trx_ul_burst_ind *bi,
const uint8_t *buf, size_t buf_len)
{
@@ -743,7 +743,7 @@ static int trx_data_handle_hdr_v0(struct trx_l1h *l1h,
}
/* Parser for MTS (Modulation and Training Sequence) */
-static inline int trx_data_parse_mts(struct trx_l1h *l1h,
+static inline int trx_data_parse_mts(struct phy_instance *phy_inst,
struct trx_ul_burst_ind *bi,
const uint8_t mts)
{
@@ -762,7 +762,7 @@ static inline int trx_data_parse_mts(struct trx_l1h *l1h,
bi->mod = TRX_MOD_T_8PSK;
bi->tsc_set = (mts >> 3) & 0x01;
} else {
- LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR,
+ LOGPPHI(phy_inst, DTRX, LOGL_ERROR,
"Rx TRXD PDU with unknown or not supported "
"modulation (MTS=0x%02x)\n", mts);
return -ENOTSUP;
@@ -777,14 +777,14 @@ static inline int trx_data_parse_mts(struct trx_l1h *l1h,
}
/* TRXD header dissector for version 0x01 */
-static int trx_data_handle_hdr_v1(struct trx_l1h *l1h,
+static int trx_data_handle_hdr_v1(struct phy_instance *phy_inst,
struct trx_ul_burst_ind *bi,
const uint8_t *buf, size_t buf_len)
{
int rc;
/* Parse v0 specific part */
- rc = trx_data_handle_hdr_v0(l1h, bi, buf, buf_len);
+ rc = trx_data_handle_hdr_v0(phy_inst, bi, buf, buf_len);
if (rc < 0)
return rc;
@@ -793,7 +793,7 @@ static int trx_data_handle_hdr_v1(struct trx_l1h *l1h,
buf += rc;
/* MTS (Modulation and Training Sequence) */
- rc = trx_data_parse_mts(l1h, bi, buf[0]);
+ rc = trx_data_parse_mts(phy_inst, bi, buf[0]);
if (rc < 0)
return rc;
@@ -805,7 +805,7 @@ static int trx_data_handle_hdr_v1(struct trx_l1h *l1h,
}
/* TRXD burst handler for PDU version 0 */
-static int trx_data_handle_burst_v0(struct trx_l1h *l1h,
+static int trx_data_handle_burst_v0(struct phy_instance *phy_inst,
struct trx_ul_burst_ind *bi,
const uint8_t *buf, size_t buf_len)
{
@@ -824,7 +824,7 @@ static int trx_data_handle_burst_v0(struct trx_l1h *l1h,
break;
default:
- LOGPPHI(l1h->phy_inst, DTRX, LOGL_NOTICE,
+ LOGPPHI(phy_inst, DTRX, LOGL_NOTICE,
"Rx TRXD message with odd burst length %zu\n", buf_len);
return -EINVAL;
}
@@ -841,7 +841,7 @@ static int trx_data_handle_burst_v0(struct trx_l1h *l1h,
}
/* TRXD burst handler for PDU version 1 */
-static int trx_data_handle_burst_v1(struct trx_l1h *l1h,
+static int trx_data_handle_burst_v1(struct phy_instance *phy_inst,
struct trx_ul_burst_ind *bi,
const uint8_t *buf, size_t buf_len)
{
@@ -853,7 +853,7 @@ static int trx_data_handle_burst_v1(struct trx_l1h *l1h,
/* Verify burst length */
if (bl[bi->mod] != buf_len) {
- LOGPPHI(l1h->phy_inst, DTRX, LOGL_NOTICE,
+ LOGPPHI(phy_inst, DTRX, LOGL_NOTICE,
"Rx TRXD message with odd burst length %zu, "
"expected %zu\n", buf_len, bl[bi->mod]);
return -EINVAL;
@@ -861,7 +861,7 @@ static int trx_data_handle_burst_v1(struct trx_l1h *l1h,
/* The PDU format is the same as for version 0.
* NOTE: other modulation types to be handled separately. */
- return trx_data_handle_burst_v0(l1h, bi, buf, buf_len);
+ return trx_data_handle_burst_v0(phy_inst, bi, buf, buf_len);
}
static const char *trx_data_desc_msg(const struct trx_ul_burst_ind *bi)
@@ -950,10 +950,10 @@ static int trx_data_read_cb(struct osmo_fd *ofd, unsigned int what)
switch (pdu_ver) {
case 0:
/* Legacy protocol has no version indicator */
- hdr_len = trx_data_handle_hdr_v0(l1h, &bi, buf, buf_len);
+ hdr_len = trx_data_handle_hdr_v0(l1h->phy_inst, &bi, buf, buf_len);
break;
case 1:
- hdr_len = trx_data_handle_hdr_v1(l1h, &bi, buf, buf_len);
+ hdr_len = trx_data_handle_hdr_v1(l1h->phy_inst, &bi, buf, buf_len);
break;
default:
/* Shall not happen */
@@ -982,10 +982,10 @@ static int trx_data_read_cb(struct osmo_fd *ofd, unsigned int what)
/* Handle burst bits */
switch (pdu_ver) {
case 0:
- rc = trx_data_handle_burst_v0(l1h, &bi, buf + hdr_len, buf_len);
+ rc = trx_data_handle_burst_v0(l1h->phy_inst, &bi, buf + hdr_len, buf_len);
break;
case 1:
- rc = trx_data_handle_burst_v1(l1h, &bi, buf + hdr_len, buf_len);
+ rc = trx_data_handle_burst_v1(l1h->phy_inst, &bi, buf + hdr_len, buf_len);
break;
default:
/* Shall not happen, just to make GCC happy */