Change in libosmocore[master]: gsm_04_08.h: fix big endian structs
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/18210 ) Change subject: gsm_04_08.h: fix big endian structs .. gsm_04_08.h: fix big endian structs Affected: - struct gsm48_range_1024 - struct gsm48_range_512 - struct gsm48_range_256 - struct gsm48_range_128 In commit [1], the automatic little-to-big-endian compatibility by struct_endianness.py introduced doubled little/big endian struct listings by accident, resulting in a wrong big endian structure (due to double reversal in the original big endian part). Remove the old conditionals around the new automatic ones to fix the structs for big endian. [1] Ia0b99d76932aeb03e93bd0c62d3bf025dec5f9d2 Change-Id: Iaccdd4a204841209f5eb50f336b30962ff00da0b --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 0 insertions(+), 238 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/18210/1 diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 8370eca..1bca068 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -77,7 +77,6 @@ void osmo_gsm48_classmark_update(struct osmo_gsm48_classmark *dst, const struct osmo_gsm48_classmark *src); int8_t osmo_gsm48_rfpowercap2powerclass(enum gsm_band band, uint8_t rf_power_cap); /* Chapter 10.5.2.1b.3 */ -#if OSMO_IS_LITTLE_ENDIAN == 1 struct gsm48_range_1024 { #if OSMO_IS_LITTLE_ENDIAN uint8_t w1_hi:2, @@ -131,64 +130,8 @@ uint8_t w15_lo:2, w16:6; #endif } __attribute__ ((packed)); -#else -struct gsm48_range_1024 { -#if OSMO_IS_LITTLE_ENDIAN - uint8_t form_id:5, - f0:1, - w1_hi:2; - uint8_t w1_lo; - uint8_t w2_hi; - uint8_t w2_lo:1, - w3_hi:7; - uint8_t w3_lo:2, - w4_hi:6; - uint8_t w4_lo:2, - w5_hi:6; - uint8_t w5_lo:2, - w6_hi:6; - uint8_t w6_lo:2, - w7_hi:6; - uint8_t w7_lo:2, - w8_hi:6; - uint8_t w8_lo:1, - w9:7; - uint8_t w10:7, - w11_hi:1; - uint8_t w11_lo:6, - w12_hi:2; - uint8_t w12_lo:5, - w13_hi:3; - uint8_t w13_lo:4, - w14_hi:4; - uint8_t w14_lo:3, - w15_hi:5; - uint8_t w15_lo:2, - w16:6; -#elif OSMO_IS_BIG_ENDIAN -/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ - uint8_t w1_hi:2, f0:1, form_id:5; - uint8_t w1_lo; - uint8_t w2_hi; - uint8_t w3_hi:7, w2_lo:1; - uint8_t w4_hi:6, w3_lo:2; - uint8_t w5_hi:6, w4_lo:2; - uint8_t w6_hi:6, w5_lo:2; - uint8_t w7_hi:6, w6_lo:2; - uint8_t w8_hi:6, w7_lo:2; - uint8_t w9:7, w8_lo:1; - uint8_t w11_hi:1, w10:7; - uint8_t w12_hi:2, w11_lo:6; - uint8_t w13_hi:3, w12_lo:5; - uint8_t w14_hi:4, w13_lo:4; - uint8_t w15_hi:5, w14_lo:3; - uint8_t w16:6, w15_lo:2; -#endif -} __attribute__ ((packed)); -#endif /* Chapter 10.5.2.1b.4 */ -#if OSMO_IS_LITTLE_ENDIAN == 1 struct gsm48_range_512 { #if OSMO_IS_LITTLE_ENDIAN uint8_t orig_arfcn_hi:1, @@ -242,64 +185,8 @@ uint8_t w16_lo:3, w17:5; #endif } __attribute__ ((packed)); -#else -struct gsm48_range_512 { -#if OSMO_IS_LITTLE_ENDIAN - uint8_t form_id:7, - orig_arfcn_hi:1; - uint8_t orig_arfcn_mid; - uint8_t orig_arfcn_lo:1, - w1_hi:7; - uint8_t w1_lo:2, - w2_hi:6; - uint8_t w2_lo:2, - w3_hi:6; - uint8_t w3_lo:2, - w4_hi:6; - uint8_t w4_lo:1, - w5:7; - uint8_t w6:7, - w7_hi:1; - uint8_t w7_lo:6, - w8_hi:2; - uint8_t w8_lo:4, - w9_hi:4; - uint8_t w9_lo:2, - w10:6; - uint8_t w11:6, - w12_hi:2; - uint8_t w12_lo:4, - w13_hi:4; - uint8_t w13_lo:2, - w14:6; - uint8_t w15:6, - w16_hi:2; - uint8_t w16_lo:3, - w17:5; -#elif OSMO_IS_BIG_ENDIAN -/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ - uint8_t orig_arfcn_hi:1, form_id:7; - uint8_t orig_arfcn_mid; - uint8_t w1_hi:7, orig_arfcn_lo:1; - uint8_t w2_hi:6, w1_lo:2; - uint8_t w3_hi:6, w2_lo:2; - uint8_t w4_hi:6, w3_lo:2; - uint8_t w5:7, w4_lo:1; - uint8_t w7_hi:1, w6:7; - uint8_t w8_hi:2, w7_lo:6; - uint8_t w9_hi:4, w8_lo:4; - uint8_t w10:6, w9_lo:2; - uint8_t w12_hi:2, w11:6; - uint8_t w13_hi:4, w12_lo:4; - uint8_t w14:6, w13_lo:2; - uint8_t w16_hi:2, w15:6; - u
Change in libosmocore[master]: gsm_04_08.h: fix big endian structs
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/18210 ) Change subject: gsm_04_08.h: fix big endian structs .. Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18210 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Iaccdd4a204841209f5eb50f336b30962ff00da0b Gerrit-Change-Number: 18210 Gerrit-PatchSet: 1 Gerrit-Owner: neels Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin Gerrit-Comment-Date: Mon, 11 May 2020 20:56:31 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in libosmocore[master]: gsm_04_08.h: fix big endian structs
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/18210 ) Change subject: gsm_04_08.h: fix big endian structs .. Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18210 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Iaccdd4a204841209f5eb50f336b30962ff00da0b Gerrit-Change-Number: 18210 Gerrit-PatchSet: 1 Gerrit-Owner: neels Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: pespin Gerrit-Comment-Date: Tue, 12 May 2020 06:13:14 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in libosmocore[master]: gsm_04_08.h: fix big endian structs
neels has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/18210 ) Change subject: gsm_04_08.h: fix big endian structs .. gsm_04_08.h: fix big endian structs Affected: - struct gsm48_range_1024 - struct gsm48_range_512 - struct gsm48_range_256 - struct gsm48_range_128 In commit [1], the automatic little-to-big-endian compatibility by struct_endianness.py introduced doubled little/big endian struct listings by accident, resulting in a wrong big endian structure (due to double reversal in the original big endian part). Remove the old conditionals around the new automatic ones to fix the structs for big endian. [1] Ia0b99d76932aeb03e93bd0c62d3bf025dec5f9d2 Change-Id: Iaccdd4a204841209f5eb50f336b30962ff00da0b --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 0 insertions(+), 238 deletions(-) Approvals: fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 8370eca..1bca068 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -77,7 +77,6 @@ void osmo_gsm48_classmark_update(struct osmo_gsm48_classmark *dst, const struct osmo_gsm48_classmark *src); int8_t osmo_gsm48_rfpowercap2powerclass(enum gsm_band band, uint8_t rf_power_cap); /* Chapter 10.5.2.1b.3 */ -#if OSMO_IS_LITTLE_ENDIAN == 1 struct gsm48_range_1024 { #if OSMO_IS_LITTLE_ENDIAN uint8_t w1_hi:2, @@ -131,64 +130,8 @@ uint8_t w15_lo:2, w16:6; #endif } __attribute__ ((packed)); -#else -struct gsm48_range_1024 { -#if OSMO_IS_LITTLE_ENDIAN - uint8_t form_id:5, - f0:1, - w1_hi:2; - uint8_t w1_lo; - uint8_t w2_hi; - uint8_t w2_lo:1, - w3_hi:7; - uint8_t w3_lo:2, - w4_hi:6; - uint8_t w4_lo:2, - w5_hi:6; - uint8_t w5_lo:2, - w6_hi:6; - uint8_t w6_lo:2, - w7_hi:6; - uint8_t w7_lo:2, - w8_hi:6; - uint8_t w8_lo:1, - w9:7; - uint8_t w10:7, - w11_hi:1; - uint8_t w11_lo:6, - w12_hi:2; - uint8_t w12_lo:5, - w13_hi:3; - uint8_t w13_lo:4, - w14_hi:4; - uint8_t w14_lo:3, - w15_hi:5; - uint8_t w15_lo:2, - w16:6; -#elif OSMO_IS_BIG_ENDIAN -/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ - uint8_t w1_hi:2, f0:1, form_id:5; - uint8_t w1_lo; - uint8_t w2_hi; - uint8_t w3_hi:7, w2_lo:1; - uint8_t w4_hi:6, w3_lo:2; - uint8_t w5_hi:6, w4_lo:2; - uint8_t w6_hi:6, w5_lo:2; - uint8_t w7_hi:6, w6_lo:2; - uint8_t w8_hi:6, w7_lo:2; - uint8_t w9:7, w8_lo:1; - uint8_t w11_hi:1, w10:7; - uint8_t w12_hi:2, w11_lo:6; - uint8_t w13_hi:3, w12_lo:5; - uint8_t w14_hi:4, w13_lo:4; - uint8_t w15_hi:5, w14_lo:3; - uint8_t w16:6, w15_lo:2; -#endif -} __attribute__ ((packed)); -#endif /* Chapter 10.5.2.1b.4 */ -#if OSMO_IS_LITTLE_ENDIAN == 1 struct gsm48_range_512 { #if OSMO_IS_LITTLE_ENDIAN uint8_t orig_arfcn_hi:1, @@ -242,64 +185,8 @@ uint8_t w16_lo:3, w17:5; #endif } __attribute__ ((packed)); -#else -struct gsm48_range_512 { -#if OSMO_IS_LITTLE_ENDIAN - uint8_t form_id:7, - orig_arfcn_hi:1; - uint8_t orig_arfcn_mid; - uint8_t orig_arfcn_lo:1, - w1_hi:7; - uint8_t w1_lo:2, - w2_hi:6; - uint8_t w2_lo:2, - w3_hi:6; - uint8_t w3_lo:2, - w4_hi:6; - uint8_t w4_lo:1, - w5:7; - uint8_t w6:7, - w7_hi:1; - uint8_t w7_lo:6, - w8_hi:2; - uint8_t w8_lo:4, - w9_hi:4; - uint8_t w9_lo:2, - w10:6; - uint8_t w11:6, - w12_hi:2; - uint8_t w12_lo:4, - w13_hi:4; - uint8_t w13_lo:2, - w14:6; - uint8_t w15:6, - w16_hi:2; - uint8_t w16_lo:3, - w17:5; -#elif OSMO_IS_BIG_ENDIAN -/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ - uint8_t orig_arfcn_hi:1, form_id:7; - uint8_t orig_arfcn_mid; - uint8_t w1_hi:7, orig_arfcn_lo:1; - uint8_t w2_hi:6, w1_lo:2; - uint8_t w3_hi:6, w2_lo:2; - uint8_t w4_hi:6, w3_lo:2; - uint8_t w5:7, w4_lo:1; - uint8_t w7_hi:1, w6:7; - uint8_t w8_hi:2, w7_lo:6; - uint8_t w9_hi:4, w8_lo:4; - uint8_t w10:6, w9_lo:2; - uint8_t w12_hi:2, w11:6; - uint8_t w13_hi:4, w12_lo:4; - uint8_t w14:6, w13_lo: