From 65957cf8771c4aa321b51ea4a7253d0a20b6b17e Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 20 Feb 2023 11:01:08 +0100 Subject: Run struct_endianness.py Ensure there is no diff to prepare to run this in CI. Related: OS#5884 Change-Id: I617c967c5f34c0be2cf6fd43ceb1af17897f2bf1 --- src/host/gprsdecode/rlcmac.h | 7 ++++++ src/host/layer23/include/osmocom/bb/common/sim.h | 30 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/host/gprsdecode/rlcmac.h b/src/host/gprsdecode/rlcmac.h index 2381d771..41c0decd 100644 --- a/src/host/gprsdecode/rlcmac.h +++ b/src/host/gprsdecode/rlcmac.h @@ -2,6 +2,7 @@ #include #include +#include #define OLD_TIME 2000 @@ -16,10 +17,16 @@ struct gprs_message { }; struct gprs_lime { +#if OSMO_IS_LITTLE_ENDIAN uint8_t li:6, m:1, e:1; uint8_t used; +#elif OSMO_IS_BIG_ENDIAN +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ + uint8_t e:1, m:1, li:6; + uint8_t used; +#endif } __attribute__ ((packed)); struct gprs_frag { diff --git a/src/host/layer23/include/osmocom/bb/common/sim.h b/src/host/layer23/include/osmocom/bb/common/sim.h index 321baf49..35b48f47 100644 --- a/src/host/layer23/include/osmocom/bb/common/sim.h +++ b/src/host/layer23/include/osmocom/bb/common/sim.h @@ -18,6 +18,7 @@ #pragma once #include +#include /* 9.2 commands */ #define GSM1111_CLASS_GSM 0xa0 @@ -211,6 +212,7 @@ struct gsm1111_response_mfdf { } __attribute__ ((packed)); struct gsm1111_response_mfdf_gsm { +#if OSMO_IS_LITTLE_ENDIAN uint8_t file_char; uint8_t num_df; uint8_t num_ef; @@ -229,10 +231,24 @@ struct gsm1111_response_mfdf_gsm { rfu5:3, unblk2_init:1; uint8_t more_data[0]; +#elif OSMO_IS_BIG_ENDIAN +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ + uint8_t file_char; + uint8_t num_df; + uint8_t num_ef; + uint8_t num_codes; + uint8_t rfu1; + uint8_t chv1_init:1, rfu2:3, chv1_remain:4; + uint8_t unblk1_init:1, rfu3:3, unblk1_remain:4; + uint8_t chv2_init:1, rfu4:3, chv2_remain:4; + uint8_t unblk2_init:1, rfu5:3, unblk2_remain:4; + uint8_t more_data[0]; +#endif } __attribute__ ((packed)); /* Section 9.2.1 (response to selecting EF) */ struct gsm1111_response_ef { +#if OSMO_IS_LITTLE_ENDIAN uint16_t rfu1; uint16_t file_size; uint16_t file_id; @@ -250,6 +266,20 @@ struct gsm1111_response_ef { rfu4:5; uint8_t length; uint8_t structure; +#elif OSMO_IS_BIG_ENDIAN +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ + uint16_t rfu1; + uint16_t file_size; + uint16_t file_id; + uint8_t tof; + uint8_t inc_allowed; + uint8_t acc_read:4, acc_update:4; + uint8_t acc_inc:4, rfu2:4; + uint8_t acc_reha:4, acc_inval:4; + uint8_t rfu4:5, ru_inval:1, rfu3:1, not_inval:1; + uint8_t length; + uint8_t structure; +#endif } __attribute__ ((packed)); /* Section 10.3.17 */ -- cgit v1.2.3