diff --git a/cmake_targets/tools/generate_asn1 b/cmake_targets/tools/generate_asn1 index 97058384895ed142308289ee42dc2d71495f1e25..79becbf28881395dd495bad7921ee11dce02100b 100755 --- a/cmake_targets/tools/generate_asn1 +++ b/cmake_targets/tools/generate_asn1 @@ -6,7 +6,110 @@ mkdir -p $1 cd $1 shift -asn1c -gen-PER -fcompound-names $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample +#if this script is called with only 2 arguments (so 1 here after the shift), it's for RRC +#(there may be a better way...) +if [ $# -eq 1 ]; then + +#asn1c does not work well with extension groups, we need the following fix: +# replace [[ by '<name> SEQUENCE {' +# and ]] by '} OPTIONAL' +#<name> is ext<N> with N starting from 1 and incremented at each new [[ ]] just +#following another [[ ]] +# +#this is what the following C program does + +echo generate asnfix.c + +cat << EOF > asnfix.c +/* transforms: + * '[[' to 'name SEQUENCE {' + * ']]' to '} OPTIONAL' + * name is ext1, ext2, ..., for each [[ at the same level + * levels are delimited by { and } + * -- to end of line is a comment and unprocessed + * nested [[ ]] not handled + * { and } must be balanced + * [[ and ]] can be whatever, every combination is valid + */ +#include <stdio.h> +#include <stdlib.h> + +void level(int toplevel) +{ + int c; + int next_name = 1; + + while (1) { + c = getchar(); +next: + if (c == EOF) { if (toplevel) break; abort(); } + + if (c == '-') { + c = getchar(); + if (c != '-') { putchar('-'); goto next; } + putchar(c); putchar(c); + while (1) { + c = getchar(); if (c == EOF) abort(); + putchar(c); + if (c == '\n') break; + } + continue; + } + + if (c == '[') { + c = getchar(); + if (c != '[') { putchar('['); goto next; } + printf("ext%d SEQUENCE {", next_name); + next_name++; + continue; + } + + if (c == ']') { + c = getchar(); + if (c != ']') { putchar(']'); goto next; } + printf("} OPTIONAL"); + continue; + } + + putchar(c); + if (c == '}') { if (toplevel) abort(); break; } + if (c == '{') level(0); + } +} + +int main(void) +{ + level(1); + fflush(stdout); + return 0; +} +EOF + +echo compile asnfix.c + +gcc -Wall -o asnfix asnfix.c + +echo run asnfix on $1 + +./asnfix < $1 > fixed_grammar.asn + +rm -f asnfix asnfix.c + +echo done with asnfix + +echo running asn1c + +asn1c -gen-PER -fcompound-names fixed_grammar.asn 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample + +rm -f fixed_grammar.asn + +echo asn1c done + +else + +asn1c -gen-PER -fcompound-names $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample + +fi awk ' BEGIN { diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index 61dea4889c85833db61977de743376966d66b24f..b19e7f72e89cd09737f83190cd1a19cb4edac231 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -220,8 +220,8 @@ rrc_mac_config_req( #ifdef Rel10 - if (mac_MainConfig->sr_ProhibitTimer_r9) { - UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) *mac_MainConfig->sr_ProhibitTimer_r9; + if (mac_MainConfig->ext1 && mac_MainConfig->ext1->sr_ProhibitTimer_r9) { + UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) *mac_MainConfig->ext1->sr_ProhibitTimer_r9; } else { UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) 0; } diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 0ec3a2959088d5a1bc513e45cc6b58898bdde0a6..5b10c19600249d0886266009dbdda999d553e260 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -688,10 +688,14 @@ uint8_t do_SIB23(uint8_t Mod_id, (*sib2)->ac_BarringInfo = NULL; #ifdef Rel10 +#if 0 (*sib2)->ssac_BarringForMMTEL_Voice_r9 = NULL; (*sib2)->ssac_BarringForMMTEL_Video_r9 = NULL; (*sib2)->ac_BarringForCSFB_r10 = NULL; #endif + (*sib2)->ext1 = NULL; + (*sib2)->ext2 = NULL; +#endif #if defined(ENABLE_ITTI) @@ -989,10 +993,13 @@ uint8_t do_SIB23(uint8_t Mod_id, /// (*SIB3) #ifdef Rel10 + (*sib3)->ext1 = NULL; +#if 0 (*sib3)->s_IntraSearch_v920=NULL; (*sib3)->s_NonIntraSearch_v920=NULL; (*sib3)->q_QualMin_r9=NULL; (*sib3)->threshServingLowQ_r9=NULL; +#endif #endif (*sib3)->cellReselectionInfoCommon.q_Hyst=SystemInformationBlockType3__cellReselectionInfoCommon__q_Hyst_dB4; diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c index 69ee1b1b16629a0512bae0a4254701fc79129be6..bfeb3ef7e8e3381ce018975a23ca09fa553f540d 100644 --- a/openair2/RRC/LITE/rrc_UE.c +++ b/openair2/RRC/LITE/rrc_UE.c @@ -2883,33 +2883,33 @@ static void dump_sib2( SystemInformationBlockType2_t *sib2 ) } else LOG_I( RRC, "lateNonCriticalExtension : not defined\n" ); - if (sib2->ssac_BarringForMMTEL_Voice_r9) { + if (sib2->ext1 && sib2->ext1->ssac_BarringForMMTEL_Voice_r9) { LOG_I( RRC, "ssac_BarringForMMTEL_Voice_r9->ac_BarringFactor : %ld\n", - sib2->ssac_BarringForMMTEL_Voice_r9->ac_BarringFactor ); + sib2->ext1->ssac_BarringForMMTEL_Voice_r9->ac_BarringFactor ); LOG_I( RRC, "ssac_BarringForMMTEL_Voice_r9->ac_BarringTime : %ld\n", - sib2->ssac_BarringForMMTEL_Voice_r9->ac_BarringTime ); + sib2->ext1->ssac_BarringForMMTEL_Voice_r9->ac_BarringTime ); LOG_I( RRC, "ssac_BarringForMMTEL_Voice_r9->ac_BarringForSpecialAC : %"PRIu32"\n", - BIT_STRING_to_uint32(&sib2->ssac_BarringForMMTEL_Voice_r9->ac_BarringForSpecialAC) ); + BIT_STRING_to_uint32(&sib2->ext1->ssac_BarringForMMTEL_Voice_r9->ac_BarringForSpecialAC) ); } else LOG_I( RRC, "ssac_BarringForMMTEL_Voice_r9 : not defined\n" ); - if (sib2->ssac_BarringForMMTEL_Video_r9) { + if (sib2->ext1 && sib2->ext1->ssac_BarringForMMTEL_Video_r9) { LOG_I( RRC, "ssac_BarringForMMTEL_Video_r9->ac_BarringFactor : %ld\n", - sib2->ssac_BarringForMMTEL_Video_r9->ac_BarringFactor ); + sib2->ext1->ssac_BarringForMMTEL_Video_r9->ac_BarringFactor ); LOG_I( RRC, "ssac_BarringForMMTEL_Video_r9->ac_BarringTime : %ld\n", - sib2->ssac_BarringForMMTEL_Video_r9->ac_BarringTime ); + sib2->ext1->ssac_BarringForMMTEL_Video_r9->ac_BarringTime ); LOG_I( RRC, "ssac_BarringForMMTEL_Video_r9->ac_BarringForSpecialAC : %"PRIu32"\n", - BIT_STRING_to_uint32(&sib2->ssac_BarringForMMTEL_Video_r9->ac_BarringForSpecialAC) ); + BIT_STRING_to_uint32(&sib2->ext1->ssac_BarringForMMTEL_Video_r9->ac_BarringForSpecialAC) ); } else LOG_I( RRC, "ssac_BarringForMMTEL_Video_r9 : not defined\n" ); - if (sib2->ac_BarringForCSFB_r10) { + if (sib2->ext2 && sib2->ext2->ac_BarringForCSFB_r10) { LOG_I( RRC, "ac_BarringForCSFB_r10->ac_BarringFactor : %ld\n", - sib2->ac_BarringForCSFB_r10->ac_BarringFactor ); + sib2->ext2->ac_BarringForCSFB_r10->ac_BarringFactor ); LOG_I( RRC, "ac_BarringForCSFB_r10->ac_BarringTime : %ld\n", - sib2->ac_BarringForCSFB_r10->ac_BarringTime ); + sib2->ext2->ac_BarringForCSFB_r10->ac_BarringTime ); LOG_I( RRC, "ac_BarringForCSFB_r10->ac_BarringForSpecialAC : %"PRIu32"\n", - BIT_STRING_to_uint32(&sib2->ac_BarringForCSFB_r10->ac_BarringForSpecialAC) ); + BIT_STRING_to_uint32(&sib2->ext2->ac_BarringForCSFB_r10->ac_BarringForSpecialAC) ); } else LOG_I( RRC, "ac_BarringForCSFB_r10 : not defined\n" ); @@ -3143,12 +3143,12 @@ static void dump_sib5( SystemInformationBlockType5_t *sib5 ) } } #ifdef Rel10 - if (ifcfInfo->q_QualMin_r9) - LOG_I(RRC," Q_QualMin_r9 : %d\n",*ifcfInfo->q_QualMin_r9); + if (ifcfInfo->ext1 && ifcfInfo->ext1->q_QualMin_r9) + LOG_I(RRC," Q_QualMin_r9 : %d\n",*ifcfInfo->ext1->q_QualMin_r9); - if (ifcfInfo->threshX_Q_r9) { - LOG_I(RRC," threshX_HighQ_r9 : %d\n",ifcfInfo->threshX_Q_r9->threshX_HighQ_r9); - LOG_I(RRC," threshX_LowQ_r9: %d\n",ifcfInfo->threshX_Q_r9->threshX_LowQ_r9); + if (ifcfInfo->ext1 && ifcfInfo->ext1->threshX_Q_r9) { + LOG_I(RRC," threshX_HighQ_r9 : %d\n",ifcfInfo->ext1->threshX_Q_r9->threshX_HighQ_r9); + LOG_I(RRC," threshX_LowQ_r9: %d\n",ifcfInfo->ext1->threshX_Q_r9->threshX_LowQ_r9); } #endif } diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 1f21216fd82e549c0fd9781290410e68f399232f..bc73873719a3c72fe81479976e25c6dc4ffd562a 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -1268,7 +1268,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration( #ifdef Rel10 sr_ProhibitTimer_r9 = CALLOC(1, sizeof(long)); *sr_ProhibitTimer_r9 = 0; // SR tx on PUCCH, Value in number of SR period(s). Value 0 = no timer for SR, Value 2= 2*SR - mac_MainConfig->sr_ProhibitTimer_r9 = sr_ProhibitTimer_r9; + mac_MainConfig->ext1 = CALLOC(1, sizeof(struct MAC_MainConfig__ext1)); + mac_MainConfig->ext1->sr_ProhibitTimer_r9 = sr_ProhibitTimer_r9; //sps_RA_ConfigList_rlola = NULL; #endif @@ -2408,7 +2409,8 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover( #ifdef Rel10 sr_ProhibitTimer_r9 = CALLOC(1, sizeof(long)); *sr_ProhibitTimer_r9 = 0; // SR tx on PUCCH, Value in number of SR period(s). Value 0 = no timer for SR, Value 2= 2*SR - mac_MainConfig->sr_ProhibitTimer_r9 = sr_ProhibitTimer_r9; + mac_MainConfig->ext1 = CALLOC(1, sizeof(struct MAC_MainConfig__ext1)); + mac_MainConfig->ext1->sr_ProhibitTimer_r9 = sr_ProhibitTimer_r9; //sps_RA_ConfigList_rlola = NULL; #endif // Measurement ID list