Commit 2f3d6bc9 authored by roux's avatar roux

This commit is a very unclean fix to deal with

extension version groups present in the RRC release 10
ASN.1 file (extensions between [[ and ]]).

Basically we do a syntactic replacement at compile time.
    [[ becomes '<name> SEQUENCE {'
    ]] becomes '} OPTIONAL'

<name> is 'ext<N>' where N is a number
increasing at each new extension group
in a given definition.

The UPER encoding for the two syntaxes is identical
(as far as y understanding of the specifications goes).

The XER encoding is different, due to the new 'ext<N>'
name.

Other encodings may be different.

The real solution is to fix the ASN.1 compiler.
This is not a simple task.



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7705 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 9a98566a
......@@ -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 {
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment