Change in osmo-ttcn3-hacks[master]: library/L1CTL_Types: fix definition of L1ctlDmEstReq

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/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Oct 19 11:43:01 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20755 )

Change subject: library/L1CTL_Types: fix definition of L1ctlDmEstReq
......................................................................

library/L1CTL_Types: fix definition of L1ctlDmEstReq

In osmocom-bb 'struct l1ctl_dm_est_req' is defined as follows:

  struct l1ctl_dm_est_req {
    uint8_t tsc;
    uint8_t h;
    union {
      struct l1ctl_h0 h0;
      struct l1ctl_h1 h1;
    },
    uint8_t tch_mode;
    uint8_t audio_mode;
  } __attribute__((packed));

so the overall size of the union is size of the biggest member:

  sizeof(struct l1ctl_h0) is 2
  sizeof(struct l1ctl_h1) is 132

Therefore we need to fix our definitions:

  - introduce 'record L1ctlH0' (with padding),
  - introduce 'union L1ctlH0H1':
    - move hopping indicator to L1ctl{H0,H1},
    - use it as 'TAG' in 'union L1ctlH0H1'.

Change-Id: I53964f794260f0676cc2771a7acbb679befb06d5
Related: OS#4799
---
M library/L1CTL_Types.ttcn
1 file changed, 32 insertions(+), 18 deletions(-)

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



diff --git a/library/L1CTL_Types.ttcn b/library/L1CTL_Types.ttcn
index 5c90966..00503e6 100644
--- a/library/L1CTL_Types.ttcn
+++ b/library/L1CTL_Types.ttcn
@@ -296,8 +296,15 @@
 		octetstring	l2_payload
 	} with { variant "" };
 
+	type record L1ctlH0 {
+		uint8_t		h,
+		Arfcn		arfcn,
+		octetstring	padding length(130)
+	} with { variant "" };
+
 	type record length(0..64) of Arfcn L1ctlMA;
 	type record L1ctlH1 {
+		uint8_t		h,
 		uint8_t		hsn,
 		uint8_t		maio,
 		uint8_t		n,
@@ -314,15 +321,17 @@
 		 * variant (ma) "PADDING(128)" */
 	};
 
+	type union L1ctlH0H1 {
+		L1ctlH0		h0,
+		L1ctlH1		h1
+	} with { variant "TAG(h0, h = 0; h1, h = 1)" };
+
 	type record L1ctlDmEstReq {
 		GsmTsc		tsc,
-		uint8_t		h,
-		Arfcn		arfcn optional,
-		L1ctlH1		hopping optional,
+		L1ctlH0H1	h0h1,
 		L1ctlTchMode	tch_mode,
 		L1ctlAudioMode	audio_mode
-	} with { variant (arfcn) "PRESENCE(h = 0)"
-		 variant (hopping) "PRESENCE(h = 1)" };
+	} with { variant "" };
 
 	type record L1ctlReset {
 		L1ctlResetType	reset_type,
@@ -590,9 +599,13 @@
 	modifies ts_L1CTL_DM_EST_REQ := {
 		payload := {
 			dm_est_req := {
-				h := 0,
-				arfcn := { false, arfcn },
-				hopping := omit
+				h0h1 := {
+					h0 := {
+						h := 0,
+						arfcn := { false, arfcn },
+						padding := f_pad_oct(''O, 130, '00'O)
+					}
+				}
 			}
 		}
 	}
@@ -605,16 +618,17 @@
 	modifies ts_L1CTL_DM_EST_REQ := {
 		payload := {
 			dm_est_req := {
-				h := 1,
-				arfcn := omit,
-				hopping := {
-					hsn := hsn,
-					maio := maio,
-					n := sizeof(ma),
-					spare := '00'O,
-					ma := ma,
-					/* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562849 */
-					padding := f_pad_oct(''O, (64 - sizeof(ma)) * 2, '00'O)
+				h0h1 := {
+					h1 := {
+						h := 1,
+						hsn := hsn,
+						maio := maio,
+						n := sizeof(ma),
+						spare := '00'O,
+						ma := ma,
+						/* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562849 */
+						padding := f_pad_oct(''O, (64 - sizeof(ma)) * 2, '00'O)
+					}
 				}
 			}
 		}

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I53964f794260f0676cc2771a7acbb679befb06d5
Gerrit-Change-Number: 20755
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
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/20201019/1afa732a/attachment.htm>


More information about the gerrit-log mailing list