Change in osmo-bts[master]: osmo-bts-trx: pass 'struct phy_instance' to TRXD dissectors

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Sat Apr 24 09:38:37 UTC 2021


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/23864 )

Change subject: osmo-bts-trx: pass 'struct phy_instance' to TRXD dissectors
......................................................................

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
---
M src/osmo-bts-trx/trx_if.c
1 file changed, 15 insertions(+), 15 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index 28b5f2e..d2ad877 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -730,7 +730,7 @@
 };
 
 /* 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 @@
 }
 
 /* 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 @@
 		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 @@
 }
 
 /* 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 @@
 	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 @@
 }
 
 /* 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 @@
 		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 @@
 }
 
 /* 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 @@
 
 	/* 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 @@
 
 	/* 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 @@
 	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 @@
 	/* 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 */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/23864
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I626b4392a8bc57a3fe5e8c931aa1ce9dd505676c
Gerrit-Change-Number: 23864
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210424/ff3f0d8f/attachment.htm>


More information about the gerrit-log mailing list