Change in osmo-bts[master]: osmo-bts-trx: cosmetic: TRXD 'header version' -> 'PDU version'

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
Wed Apr 21 13:24:28 UTC 2021


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

Change subject: osmo-bts-trx: cosmetic: TRXD 'header version' -> 'PDU version'
......................................................................

osmo-bts-trx: cosmetic: TRXD 'header version' -> 'PDU version'

TRXDv2 brings significant changes to the whole PDU structure, not
just the header.  Let's highlight this in the code / strings.

Change-Id: Id0274bd1ae5c419548596ed1852e6a28ec62b713
Related: SYS#4895, OS#4941, OS#4006
---
M include/osmo-bts/phy_link.h
M src/osmo-bts-trx/l1_if.h
M src/osmo-bts-trx/main.c
M src/osmo-bts-trx/trx_if.c
M src/osmo-bts-trx/trx_if.h
M src/osmo-bts-trx/trx_provision_fsm.c
M src/osmo-bts-trx/trx_vty.c
7 files changed, 50 insertions(+), 50 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h
index ef3df27..0c693bb 100644
--- a/include/osmo-bts/phy_link.h
+++ b/include/osmo-bts/phy_link.h
@@ -48,7 +48,7 @@
 			uint32_t clock_advance;
 			uint32_t rts_advance;
 			bool use_legacy_setbsic;
-			uint8_t	 trxd_hdr_ver_max; /* Maximum TRXD header version to negotiate */
+			uint8_t trxd_pdu_ver_max; /* Maximum TRXD PDU version to negotiate */
 			bool powered; /* last POWERON (true) or POWEROFF (false) confirmed */
 			bool poweronoff_sent; /* is there a POWERON/POWEROFF in transit? (one or the other based on ->powered) */
 		} osmotrx;
diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h
index 8c309db..112a6ab 100644
--- a/src/osmo-bts-trx/l1_if.h
+++ b/src/osmo-bts-trx/l1_if.h
@@ -60,8 +60,8 @@
 };
 
 struct trx_config {
-	uint8_t			trxd_hdr_ver_req; /* requested TRXD header version */
-	uint8_t			trxd_hdr_ver_use; /* actual TRXD header version in use */
+	uint8_t			trxd_pdu_ver_req; /* requested TRXD PDU version */
+	uint8_t			trxd_pdu_ver_use; /* actual TRXD PDU version in use */
 	bool			setformat_sent;
 	bool			setformat_acked;
 
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index 7e6dea9..e0a99a5 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -169,7 +169,7 @@
 	plink->u.osmotrx.clock_advance = 2;
 	plink->u.osmotrx.rts_advance = 3;
 	/* attempt use newest TRXD version by default: */
-	plink->u.osmotrx.trxd_hdr_ver_max = TRX_DATA_FORMAT_VER;
+	plink->u.osmotrx.trxd_pdu_ver_max = TRX_DATA_PDU_VER;
 }
 
 void bts_model_phy_instance_set_defaults(struct phy_instance *pinst)
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index 2e97319..bec6a5a 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -275,11 +275,11 @@
 	return trx_ctrl_cmd_cb(l1h, 1, cb, "POWERON", "");
 }
 
-/*! Send "SETFORMAT" command to TRX: change TRXD header format version */
+/*! Send "SETFORMAT" command to TRX: change TRXD PDU version */
 int trx_if_cmd_setformat(struct trx_l1h *l1h, uint8_t ver, trx_if_cmd_generic_cb *cb)
 {
 	LOGPPHI(l1h->phy_inst, DTRX, LOGL_INFO,
-		"Requesting TRXD header format version %u\n", ver);
+		"Requesting TRXD PDU version %u\n", ver);
 
 	return trx_ctrl_cmd_cb(l1h, 0, cb, "SETFORMAT", "%u", ver);
 }
@@ -510,7 +510,7 @@
 	return rsp->status == 0 ? 0 : -EINVAL;
 }
 
-/* TRXD header format negotiation handler.
+/* TRXD PDU format negotiation handler.
  *
  * If the transceiver does not support the format negotiation, it would
  * reject SETFORMAT with 'RSP ERR 1'. If the requested version is not
@@ -526,7 +526,7 @@
 	if (strcmp(rsp->cmd, "SETFORMAT") != 0) {
 		LOGPPHI(l1h->phy_inst, DTRX, LOGL_NOTICE,
 			"Transceiver rejected the format negotiation command, "
-			"using legacy TRXD header format version (0)\n");
+			"using legacy TRXD PDU version (0)\n");
 		if (rsp->cb) {
 			cb = (trx_if_cmd_generic_cb*) rsp->cb;
 			cb(l1h, 0);
@@ -535,11 +535,11 @@
 	}
 
 	/* Status shall indicate a proper version supported by the transceiver */
-	if (rsp->status < 0 || rsp->status > l1h->config.trxd_hdr_ver_req) {
+	if (rsp->status < 0 || rsp->status > l1h->config.trxd_pdu_ver_req) {
 		LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR,
 			"Transceiver indicated an out of range "
-			"header format version %d (requested %u)\n",
-			rsp->status, l1h->config.trxd_hdr_ver_req);
+			"PDU version %d (requested %u)\n",
+			rsp->status, l1h->config.trxd_pdu_ver_req);
 		return -EINVAL;
 	}
 
@@ -814,7 +814,7 @@
 	return TRX_UL_V1HDR_LEN;
 }
 
-/* TRXD burst handler for header version 0 */
+/* TRXD burst handler for PDU version 0 */
 static int trx_data_handle_burst_v0(struct trx_l1h *l1h,
 				    struct trx_ul_burst_ind *bi,
 				    const uint8_t *buf, size_t buf_len)
@@ -850,7 +850,7 @@
 	return 0;
 }
 
-/* TRXD burst handler for header version 1 */
+/* TRXD burst handler for PDU version 1 */
 static int trx_data_handle_burst_v1(struct trx_l1h *l1h,
 				    struct trx_ul_burst_ind *bi,
 				    const uint8_t *buf, size_t buf_len)
@@ -869,7 +869,7 @@
 		return -EINVAL;
 	}
 
-	/* The burst format is the same as for version 0.
+	/* 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);
 }
@@ -937,7 +937,7 @@
  *   +-----------------+------------------------+
  *   | 7 6 5 4 3 2 1 0 | bit numbers            |
  *   +-----------------+------------------------+
- *   | X X X X . . . . | header version (0..15) |
+ *   | X X X X . . . . | PDU version (0..15)    |
  *   +-----------------+------------------------+
  *   | . . . . . X X X | TDMA TN (0..7)         |
  *   +-----------------+------------------------+
@@ -1040,7 +1040,7 @@
 	uint8_t buf[TRX_DATA_MSG_MAX_LEN];
 	struct trx_ul_burst_ind bi;
 	ssize_t hdr_len, buf_len;
-	uint8_t hdr_ver;
+	uint8_t pdu_ver;
 	int rc;
 
 	buf_len = recv(ofd->fd, buf, sizeof(buf), 0);
@@ -1054,9 +1054,9 @@
 	/* Pre-clean (initialize) the flags */
 	bi.flags = 0x00;
 
-	/* Parse the header depending on its version */
-	hdr_ver = buf[0] >> 4;
-	switch (hdr_ver) {
+	/* Parse header depending on the PDU version */
+	pdu_ver = buf[0] >> 4;
+	switch (pdu_ver) {
 	case 0:
 		/* Legacy protocol has no version indicator */
 		hdr_len = trx_data_handle_hdr_v0(l1h, &bi, buf, buf_len);
@@ -1066,7 +1066,7 @@
 		break;
 	default:
 		LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR,
-			"TRXD header version %u is not supported\n", hdr_ver);
+			"TRXD PDU version %u is not supported\n", pdu_ver);
 		return -ENOTSUP;
 	}
 
@@ -1083,7 +1083,7 @@
 	buf_len -= hdr_len;
 
 	/* Handle burst bits */
-	switch (hdr_ver) {
+	switch (pdu_ver) {
 	case 0:
 		rc = trx_data_handle_burst_v0(l1h, &bi, buf + hdr_len, buf_len);
 		break;
@@ -1101,9 +1101,9 @@
 
 skip_burst:
 	/* Print header & burst info */
-	LOGPPHI(l1h->phy_inst, DTRX, LOGL_DEBUG, "Rx %s (hdr_ver=%u): %s\n",
+	LOGPPHI(l1h->phy_inst, DTRX, LOGL_DEBUG, "Rx %s (pdu_ver=%u): %s\n",
 		(bi.flags & TRX_BI_F_NOPE_IND) ? "NOPE.ind" : "UL burst",
-		hdr_ver, trx_data_desc_msg(&bi));
+		pdu_ver, trx_data_desc_msg(&bi));
 
 	/* feed received burst into scheduler code */
 	trx_sched_route_burst_ind(&bi, &l1h->l1s);
@@ -1118,7 +1118,7 @@
 int trx_if_send_burst(struct trx_l1h *l1h, const struct trx_dl_burst_req *br)
 {
 	ssize_t snd_len;
-	uint8_t hdr_ver = l1h->config.trxd_hdr_ver_use;
+	uint8_t pdu_ver = l1h->config.trxd_pdu_ver_use;
 	uint8_t buf[TRX_DATA_MSG_MAX_LEN];
 
 	if ((br->burst_len != GSM_BURST_LEN) && (br->burst_len != EGPRS_BURST_LEN)) {
@@ -1128,22 +1128,22 @@
 	}
 
 	LOGPPHI(l1h->phy_inst, DTRX, LOGL_DEBUG,
-		"Tx burst (hdr_ver=%u): tn=%u fn=%u att=%u\n",
-		hdr_ver, br->tn, br->fn, br->att);
+		"Tx burst (pdu_ver=%u): tn=%u fn=%u att=%u\n",
+		pdu_ver, br->tn, br->fn, br->att);
 
-	switch (hdr_ver) {
+	switch (pdu_ver) {
 	case 0:
 	case 1:
-		/* Both versions have the same header format */
+		/* Both versions have the same PDU format */
 		break;
 
 	default:
 		LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR,
-			"Requested TRXD header version %u is not supported\n", hdr_ver);
+			"Requested TRXD PDU version %u is not supported\n", pdu_ver);
 		return -ENOTSUP;
 	}
 
-	buf[0] = ((hdr_ver & 0x0f) << 4) | br->tn;
+	buf[0] = ((pdu_ver & 0x0f) << 4) | br->tn;
 	osmo_store32be(br->fn, buf + 1);
 	buf[5] = br->att;
 
diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h
index 17bc7db..120d3bd 100644
--- a/src/osmo-bts-trx/trx_if.h
+++ b/src/osmo-bts-trx/trx_if.h
@@ -39,8 +39,8 @@
 int trx_if_send_burst(struct trx_l1h *l1h, const struct trx_dl_burst_req *br);
 int trx_if_powered(struct trx_l1h *l1h);
 
-/* The latest supported TRXD header format version */
-#define TRX_DATA_FORMAT_VER    1
+/* The latest supported TRXD PDU version */
+#define TRX_DATA_PDU_VER    1
 
 /* Format negotiation command */
 int trx_if_cmd_setformat(struct trx_l1h *l1h, uint8_t ver, trx_if_cmd_generic_cb *cb);
diff --git a/src/osmo-bts-trx/trx_provision_fsm.c b/src/osmo-bts-trx/trx_provision_fsm.c
index e4721ba..1e5de2e 100644
--- a/src/osmo-bts-trx/trx_provision_fsm.c
+++ b/src/osmo-bts-trx/trx_provision_fsm.c
@@ -148,16 +148,16 @@
 		l1h->config.bsic_acked = false;
 	}
 
-	/* Ask transceiver to use the newest TRXD header version if not using it yet */
+	/* Ask transceiver to use the newest TRXD PDU version if not using it yet */
 	if (!l1h->config.setformat_sent) {
 		l1h->config.setformat_sent = true;
-		if (plink->u.osmotrx.trxd_hdr_ver_max == 0) {
+		if (plink->u.osmotrx.trxd_pdu_ver_max == 0) {
 			LOGPPHI(pinst, DL1C, LOGL_INFO,
 				"No need to negotiate max TRXD version 0");
-			l1h->config.trxd_hdr_ver_use = 0;
+			l1h->config.trxd_pdu_ver_use = 0;
 			l1h->config.setformat_acked = true;
 		} else {
-			trx_if_cmd_setformat(l1h, l1h->config.trxd_hdr_ver_req, l1if_setformat_cb);
+			trx_if_cmd_setformat(l1h, l1h->config.trxd_pdu_ver_req, l1if_setformat_cb);
 			l1h->config.setformat_acked = false;
 		}
 	}
@@ -276,7 +276,7 @@
 	struct trx_l1h *l1h = (struct trx_l1h *)fi->priv;
 	struct phy_instance *pinst = l1h->phy_inst;
 
-	l1h->config.trxd_hdr_ver_req = pinst->phy_link->u.osmotrx.trxd_hdr_ver_max;
+	l1h->config.trxd_pdu_ver_req = pinst->phy_link->u.osmotrx.trxd_pdu_ver_max;
 
 	/* Apply initial RFMUTE state */
 	trx_if_cmd_rfmute(l1h, pinst->trx->mo.nm_state.administrative != NM_STATE_UNLOCKED);
@@ -354,18 +354,18 @@
 	case TRX_PROV_EV_SETFORMAT_CNF:
 		status = (int)(intptr_t)data;
 		/* Transceiver may suggest a lower version (than requested) */
-		if (status == l1h->config.trxd_hdr_ver_req) {
-			l1h->config.trxd_hdr_ver_use = status;
+		if (status == l1h->config.trxd_pdu_ver_req) {
+			l1h->config.trxd_pdu_ver_use = status;
 			l1h->config.setformat_acked = true;
 			LOGPPHI(l1h->phy_inst, DTRX, LOGL_INFO,
-				"Using TRXD header format version %u\n",
-				l1h->config.trxd_hdr_ver_use);
+				"Using TRXD PDU version %u\n",
+				l1h->config.trxd_pdu_ver_use);
 		} else {
 			LOGPPHI(l1h->phy_inst, DTRX, LOGL_DEBUG,
-				"Transceiver suggests TRXD header version %u (requested %u)\n",
-				status, l1h->config.trxd_hdr_ver_req);
+				"Transceiver suggests TRXD PDU version %u (requested %u)\n",
+				status, l1h->config.trxd_pdu_ver_req);
 			/* Send another SETFORMAT with suggested version */
-			l1h->config.trxd_hdr_ver_req = status;
+			l1h->config.trxd_pdu_ver_req = status;
 			l1h->config.setformat_sent = false;
 		}
 		break;
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index 4e8c8d6..b85dcdc 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -517,15 +517,15 @@
 
 	int max_ver;
 	if (strcmp(argv[0], "latest") == 0)
-		max_ver = TRX_DATA_FORMAT_VER;
+		max_ver = TRX_DATA_PDU_VER;
 	else
 		max_ver = atoi(argv[0]);
-	if (max_ver > TRX_DATA_FORMAT_VER) {
+	if (max_ver > TRX_DATA_PDU_VER) {
 		vty_out(vty, "%% Format version %d is not supported, maximum supported is %d%s",
-			max_ver, TRX_DATA_FORMAT_VER, VTY_NEWLINE);
+			max_ver, TRX_DATA_PDU_VER, VTY_NEWLINE);
 		return CMD_WARNING;
 	}
-	plink->u.osmotrx.trxd_hdr_ver_max = max_ver;
+	plink->u.osmotrx.trxd_pdu_ver_max = max_ver;
 
 	return CMD_SUCCESS;
 }
@@ -554,8 +554,8 @@
 	if (plink->u.osmotrx.use_legacy_setbsic)
 		vty_out(vty, " osmotrx legacy-setbsic%s", VTY_NEWLINE);
 
-	if (plink->u.osmotrx.trxd_hdr_ver_max != TRX_DATA_FORMAT_VER)
-		vty_out(vty, " osmotrx trxd-max-version %d%s", plink->u.osmotrx.trxd_hdr_ver_max, VTY_NEWLINE);
+	if (plink->u.osmotrx.trxd_pdu_ver_max != TRX_DATA_PDU_VER)
+		vty_out(vty, " osmotrx trxd-max-version %d%s", plink->u.osmotrx.trxd_pdu_ver_max, VTY_NEWLINE);
 }
 
 void bts_model_config_write_phy_inst(struct vty *vty, const struct phy_instance *pinst)

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Id0274bd1ae5c419548596ed1852e6a28ec62b713
Gerrit-Change-Number: 23822
Gerrit-PatchSet: 3
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-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210421/97657d96/attachment.htm>


More information about the gerrit-log mailing list