Change in osmocom-bb[master]: trxcon: fix l1ctl_proc_est_req_h0(): convert to host byte order

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
Thu May 28 11:47:41 UTC 2020


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/18519 )

Change subject: trxcon: fix l1ctl_proc_est_req_h0(): convert to host byte order
......................................................................

trxcon: fix l1ctl_proc_est_req_h0(): convert to host byte order

L1CTL is using the network byte order, because this protocol is
spoken between different devices and architectures.  Somehow I
forgot about this while adding SETFH command back in 2018.

Change-Id: Ia2f70f0d5e35b6bf05e1fa6fb51a15c1bbe3ca4c
Related: OS#4546
---
M src/host/trxcon/l1ctl.c
1 file changed, 7 insertions(+), 2 deletions(-)

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



diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index e722624..84e1ec6 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -595,7 +595,8 @@
 
 static int l1ctl_proc_est_req_h1(struct trx_instance *trx, struct l1ctl_h1 *h)
 {
-	int rc;
+	uint16_t ma[64];
+	int i, rc;
 
 	LOGP(DL1C, LOGL_NOTICE, "L1CTL_DM_EST_REQ indicates a Frequency "
 		"Hopping (hsn=%u, maio=%u, chans=%u) channel\n",
@@ -607,8 +608,12 @@
 		return -EINVAL;
 	}
 
+	/* Convert from network to host byte order */
+	for (i = 0; i < h->n; i++)
+		ma[i] = ntohs(h->ma[i]);
+
 	/* Forward hopping parameters to TRX */
-	rc = trx_if_cmd_setfh(trx, h->hsn, h->maio, h->ma, h->n);
+	rc = trx_if_cmd_setfh(trx, h->hsn, h->maio, ma, h->n);
 	if (rc)
 		return rc;
 

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ia2f70f0d5e35b6bf05e1fa6fb51a15c1bbe3ca4c
Gerrit-Change-Number: 18519
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200528/ed106acf/attachment.htm>


More information about the gerrit-log mailing list