From ca770ae77e38b6a634282e19d7b6e16a28db39f3 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Tue, 16 Feb 2021 17:31:22 +0100 Subject: [PATCH] gsm_08_58, gsm_44_004: add struct for l1 information Libosmocore currently does not offer any structs to encode and decode the l1 information on RSL level and the sacch l1 header on the air interface level. Both structs are identical but the field order in the first octet is reversed. Change-Id: I23c1890b89d5a0574eb05dace9f64cc59d6f6df7 --- include/Makefile.am | 1 + include/osmocom/gsm/protocol/gsm_08_58.h | 16 ++++++++++++++++ include/osmocom/gsm/protocol/gsm_44_004.h | 19 +++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 include/osmocom/gsm/protocol/gsm_44_004.h diff --git a/include/Makefile.am b/include/Makefile.am index 10f022159..8dae3d96b 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -144,6 +144,7 @@ nobase_include_HEADERS = \ osmocom/gsm/protocol/gsm_23_003.h \ osmocom/gsm/protocol/gsm_23_041.h \ osmocom/gsm/protocol/gsm_29_118.h \ + osmocom/gsm/protocol/gsm_44_004.h \ osmocom/gsm/protocol/gsm_44_318.h \ osmocom/gsm/protocol/gsm_48_049.h \ osmocom/gsm/protocol/gsm_48_071.h \ diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h index e9c14e6c3..6f974ce02 100644 --- a/include/osmocom/gsm/protocol/gsm_08_58.h +++ b/include/osmocom/gsm/protocol/gsm_08_58.h @@ -945,4 +945,20 @@ struct ipac_preproc_cfg { struct ipac_preproc_ho_ctl_param ho_ctl_param; }; +struct rsl_l1_info { +#if OSMO_IS_BIG_ENDIAN + uint8_t ms_pwr:5, + fpc_epc:1, + srr_sro:1, + reserved:1; + uint8_t ta; +#elif OSMO_IS_LITTLE_ENDIAN + uint8_t reserved:1, + srr_sro:1, + fpc_epc:1, + ms_pwr:5; + uint8_t ta; +#endif +} __attribute__ ((packed)); + /*! @} */ diff --git a/include/osmocom/gsm/protocol/gsm_44_004.h b/include/osmocom/gsm/protocol/gsm_44_004.h new file mode 100644 index 000000000..83be9bfd7 --- /dev/null +++ b/include/osmocom/gsm/protocol/gsm_44_004.h @@ -0,0 +1,19 @@ +#pragma once + +/* TS 44.004 Section 7.1 */ + +struct gsm_sacch_l1_hdr { +#if OSMO_IS_BIG_ENDIAN + uint8_t reserved:1, + srr_sro:1, + fpc_epc:1, + ms_pwr:5; + uint8_t ta; +#elif OSMO_IS_LITTLE_ENDIAN + uint8_t ms_pwr:5, + fpc_epc:1, + srr_sro:1, + reserved:1; + uint8_t ta; +#endif +} __attribute__ ((packed));