summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-10-19 14:17:38 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-10-19 14:33:24 +0700
commit2cdb97f1663c48f359fc39f3ff642d01099226c0 (patch)
treeae2b14b109cbd1164e6a3e89ddeaef42ac1635cb /library
parentfe052960b24ad1a6a7f6a2dd0dc81eb342d10aa4 (diff)
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
Diffstat (limited to 'library')
-rw-r--r--library/L1CTL_Types.ttcn50
1 files changed, 32 insertions, 18 deletions
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 @@ module L1CTL_Types {
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 @@ module L1CTL_Types {
* 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 @@ module L1CTL_Types {
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 @@ module L1CTL_Types {
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)
+ }
}
}
}