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

Change subject: Run struct_endianness.py
......................................................................

Run struct_endianness.py

Ensure there is no diff to prepare to run this in CI.

Related: OS#5884
Change-Id: I617c967c5f34c0be2cf6fd43ceb1af17897f2bf1
---
M src/host/gprsdecode/rlcmac.h
M src/host/layer23/include/osmocom/bb/common/sim.h
2 files changed, 49 insertions(+), 0 deletions(-)

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




diff --git a/src/host/gprsdecode/rlcmac.h b/src/host/gprsdecode/rlcmac.h
index 2381d77..41c0dec 100644
--- a/src/host/gprsdecode/rlcmac.h
+++ b/src/host/gprsdecode/rlcmac.h
@@ -2,6 +2,7 @@

 #include <stdint.h>
 #include <stdbool.h>
+#include <osmocom/core/endian.h>

 #define OLD_TIME 2000

@@ -16,10 +17,16 @@
 };

 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 321baf4..35b48f4 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 <osmocom/gsm/protocol/gsm_04_08.h>
+#include <osmocom/core/endian.h>

 /* 9.2 commands */
 #define GSM1111_CLASS_GSM              0xa0
@@ -211,6 +212,7 @@
 } __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 @@
                 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 @@
                 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 */

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I617c967c5f34c0be2cf6fd43ceb1af17897f2bf1
Gerrit-Change-Number: 31403
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-MessageType: merged

Reply via email to