Commit 0cf85158 authored by Louis Adrien Dufrene's avatar Louis Adrien Dufrene

Merge branch 'DRX_develop' into...

Merge branch 'DRX_develop' into 374-missing-rrc-inactivity-timer-missing-default-drx-ie-in-s1-setup-ue-s1-id-unknown-after-detach-for-switch-off
parents 2f115419 9a080ade
...@@ -141,7 +141,7 @@ x_image *x_create_image(x_connection *_x, unsigned char *data, ...@@ -141,7 +141,7 @@ x_image *x_create_image(x_connection *_x, unsigned char *data,
ret = calloc(1, sizeof(struct x_image)); if (ret == NULL) OOM; ret = calloc(1, sizeof(struct x_image)); if (ret == NULL) OOM;
template.class = TrueColor; template.class = TrueColor;
template.depth = 24; template.depth = 32;
template.red_mask = 0xff0000; template.red_mask = 0xff0000;
template.green_mask = 0x00ff00; template.green_mask = 0x00ff00;
template.blue_mask = 0x0000ff; template.blue_mask = 0x0000ff;
......
...@@ -65,7 +65,7 @@ typedef int32_t sdu_size_t; ...@@ -65,7 +65,7 @@ typedef int32_t sdu_size_t;
typedef uint32_t frame_t; typedef uint32_t frame_t;
typedef int32_t sframe_t; typedef int32_t sframe_t;
typedef uint32_t sub_frame_t; typedef uint32_t sub_frame_t;
typedef uint16_t module_id_t; typedef uint16_t module_id_t;
typedef uint8_t slice_id_t; typedef uint8_t slice_id_t;
typedef uint8_t eNB_index_t; typedef uint8_t eNB_index_t;
typedef uint16_t ue_id_t; typedef uint16_t ue_id_t;
......
This diff is collapsed.
...@@ -466,6 +466,8 @@ schedule_ue_spec(module_id_t module_idP, int slice_idxP, ...@@ -466,6 +466,8 @@ schedule_ue_spec(module_id_t module_idP, int slice_idxP,
int header_length_last; int header_length_last;
int header_length_total; int header_length_total;
rrc_eNB_ue_context_t *ue_contextP = NULL;
start_meas(&eNB->schedule_dlsch); start_meas(&eNB->schedule_dlsch);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH, VCD_FUNCTION_IN);
...@@ -1033,68 +1035,86 @@ schedule_ue_spec(module_id_t module_idP, int slice_idxP, ...@@ -1033,68 +1035,86 @@ schedule_ue_spec(module_id_t module_idP, int slice_idxP,
// TODO: check if the lcid is active // TODO: check if the lcid is active
LOG_D(MAC, "[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n", LOG_D(MAC, "[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n",
module_idP, frameP, lcid, TBS, module_idP,
TBS - ta_len - header_length_total - sdu_length_total - 3); frameP,
lcid,
TBS,
TBS - ta_len - header_length_total - sdu_length_total - 3);
if (TBS - ta_len - header_length_total - sdu_length_total - 3 > 0) { if (TBS - ta_len - header_length_total - sdu_length_total - 3 > 0) {
rlc_status = mac_rlc_status_ind(module_idP, rlc_status = mac_rlc_status_ind(module_idP,
rnti, rnti,
module_idP, module_idP,
frameP, frameP,
subframeP, subframeP,
ENB_FLAG_YES, ENB_FLAG_YES,
MBMS_FLAG_NO, MBMS_FLAG_NO,
lcid, lcid,
TBS - ta_len - header_length_total - sdu_length_total - 3 TBS - ta_len - header_length_total - sdu_length_total - 3
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,0, 0 , 0, 0
#endif #endif
); );
if (rlc_status.bytes_in_buffer > 0) { if (rlc_status.bytes_in_buffer > 0) {
LOG_D(MAC, LOG_D(MAC, "[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d)\n",
"[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d)\n", module_idP,
module_idP, frameP, frameP,
TBS - ta_len - header_length_total - sdu_length_total - 3, TBS - ta_len - header_length_total - sdu_length_total - 3,
lcid, lcid,
header_length_total); header_length_total);
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, rnti, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, lcid, sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
TBS, //not used rnti,
(char *)&dlsch_buffer[sdu_length_total] module_idP,
frameP,
ENB_FLAG_YES,
MBMS_FLAG_NO,
lcid,
TBS, //not used
(char *)&dlsch_buffer[sdu_length_total]
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,0, 0 , 0, 0
#endif #endif
); );
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T(T_ENB_MAC_UE_DL_SDU,
T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(module_idP),
T_INT(subframeP), T_INT(harq_pid), T_INT(CC_id),
T_INT(lcid), T_INT(sdu_lengths[num_sdus])); T_INT(rnti),
T_INT(frameP),
LOG_D(MAC, T_INT(subframeP),
"[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n", T_INT(harq_pid),
module_idP, sdu_lengths[num_sdus], lcid); T_INT(lcid),
T_INT(sdu_lengths[num_sdus]));
LOG_D(MAC, "[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n",
module_idP,
sdu_lengths[num_sdus],
lcid);
sdu_lcids[num_sdus] = lcid; sdu_lcids[num_sdus] = lcid;
sdu_length_total += sdu_lengths[num_sdus]; sdu_length_total += sdu_lengths[num_sdus];
UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid]++; UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid]++;
UE_list->eNB_UE_stats[CC_id][UE_id].lcid_sdu[num_sdus] = lcid; UE_list->eNB_UE_stats[CC_id][UE_id].lcid_sdu[num_sdus] = lcid;
UE_list->eNB_UE_stats[CC_id][UE_id].sdu_length_tx[lcid] = sdu_lengths[num_sdus]; UE_list->eNB_UE_stats[CC_id][UE_id].sdu_length_tx[lcid] = sdu_lengths[num_sdus];
UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid] += sdu_lengths[num_sdus]; UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid] += sdu_lengths[num_sdus];
header_length_last = 1 + 1 + (sdu_lengths[num_sdus] >= 128); header_length_last = 1 + 1 + (sdu_lengths[num_sdus] >= 128);
header_length_total += header_length_last; header_length_total += header_length_last;
num_sdus++; num_sdus++;
UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0; UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0;
}
} else { // reset RRC inactivity timer after uplane activity
// no TBS left ue_contextP = rrc_eNB_get_ue_context(RC.rrc[module_idP], rnti);
break; ue_contextP->ue_context.ue_rrc_inactivity_timer = 1;
} // end if (rlc_status.bytes_in_buffer > 0)
} else { // no TBS left
break; // break for (lcid = NB_RB_MAX - 1; lcid >= DTCH; lcid--)
} }
} }
......
...@@ -1404,85 +1404,95 @@ schedule_ue_spec_fairRR(module_id_t module_idP, ...@@ -1404,85 +1404,95 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
header_len_dtch = 0; header_len_dtch = 0;
header_len_dtch_last = 0; // the header length of the last mac sdu header_len_dtch_last = 0; // the header length of the last mac sdu
// lcid has to be sorted before the actual allocation (similar struct as ue_list). // lcid has to be sorted before the actual allocation (similar struct as ue_list).
/* TODO limited lcid for performance */ /* TODO limited lcid for performance */
for (lcid = DTCH; lcid >= DTCH; lcid--) { for (lcid = DTCH; lcid >= DTCH; lcid--) {
// TBD: check if the lcid is active // TBD: check if the lcid is active
header_len_dtch += 3;
header_len_dtch += 3; header_len_dtch_last = 3;
header_len_dtch_last = 3;
LOG_D(MAC, LOG_D(MAC, "[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n",
"[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n", module_idP,
module_idP, frameP, lcid, TBS, frameP,
TBS - ta_len - header_len_dcch - lcid,
sdu_length_total - header_len_dtch); TBS,
TBS - ta_len - header_len_dcch - sdu_length_total - header_len_dtch);
if (TBS - ta_len - header_len_dcch - sdu_length_total - header_len_dtch > 0) { // NN: > 2 ?
rlc_status = mac_rlc_status_ind(module_idP, if (TBS - ta_len - header_len_dcch - sdu_length_total - header_len_dtch > 0) { // NN: > 2 ?
rnti, rlc_status = mac_rlc_status_ind(module_idP,
module_idP, rnti,
frameP, module_idP,
subframeP, frameP,
ENB_FLAG_YES, subframeP,
MBMS_FLAG_NO, ENB_FLAG_YES,
lcid, MBMS_FLAG_NO,
TBS - ta_len - lcid,
header_len_dcch - TBS - ta_len - header_len_dcch - sdu_length_total - header_len_dtch
sdu_length_total - #ifdef Rel14
header_len_dtch , 0, 0
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,0, 0
#endif #endif
); );
if (rlc_status.bytes_in_buffer > 0) {
LOG_D(MAC, if (rlc_status.bytes_in_buffer > 0) {
"[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d)\n", LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d)\n",
module_idP, frameP, module_idP,
TBS - header_len_dcch - frameP,
sdu_length_total - header_len_dtch, lcid, TBS - header_len_dcch - sdu_length_total - header_len_dtch,
lcid,
header_len_dtch); header_len_dtch);
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, rnti, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, lcid, TBS, //not used
(char sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
*) rnti,
&dlsch_buffer module_idP,
[sdu_length_total] frameP,
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) ENB_FLAG_YES,
,0, 0 MBMS_FLAG_NO,
lcid,
TBS, //not used
(char *)&dlsch_buffer[sdu_length_total]
#ifdef Rel14
, 0, 0
#endif #endif
); );
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP),
T_INT(CC_id), T_INT(rnti), T_INT(frameP), T(T_ENB_MAC_UE_DL_SDU,
T_INT(subframeP), T_INT(harq_pid), T_INT(module_idP),
T_INT(lcid), T_INT(sdu_lengths[num_sdus])); T_INT(CC_id),
T_INT(rnti),
T_INT(frameP),
T_INT(subframeP),
T_INT(harq_pid),
T_INT(lcid),
T_INT(sdu_lengths[num_sdus]));
LOG_D(MAC, "[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n",
module_idP,
sdu_lengths[num_sdus],
lcid);
LOG_D(MAC,
"[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n",
module_idP, sdu_lengths[num_sdus], lcid);
sdu_lcids[num_sdus] = lcid; sdu_lcids[num_sdus] = lcid;
sdu_length_total += sdu_lengths[num_sdus]; sdu_length_total += sdu_lengths[num_sdus];
UE_list-> UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid] += 1;
eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid] UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid] += sdu_lengths[num_sdus];
+= 1;
UE_list-> if (sdu_lengths[num_sdus] < 128) {
eNB_UE_stats[CC_id][UE_id].num_bytes_tx header_len_dtch--;
[lcid] += sdu_lengths[num_sdus]; header_len_dtch_last--;
if (sdu_lengths[num_sdus] < 128) {
header_len_dtch--;
header_len_dtch_last--;
} }
num_sdus++; num_sdus++;
UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0;
} // no data for this LCID UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0;
else {
header_len_dtch -= 3; } else { // no data for this LCID
} header_len_dtch -= 3;
} // no TBS left }
else {
header_len_dtch -= 3; } else { // no TBS left
break; header_len_dtch -= 3;
}
break;
}
} }
if (header_len_dtch == 0) if (header_len_dtch == 0)
header_len_dtch_last = 0; header_len_dtch_last = 0;
......
...@@ -111,6 +111,8 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -111,6 +111,8 @@ rx_sdu(const module_id_t enb_mod_idP,
(RA_t *) & RC.mac[enb_mod_idP]->common_channels[CC_idP].ra[0]; (RA_t *) & RC.mac[enb_mod_idP]->common_channels[CC_idP].ra[0];
int first_rb = 0; int first_rb = 0;
rrc_eNB_ue_context_t *ue_contextP = NULL;
start_meas(&mac->rx_ulsch_sdu); start_meas(&mac->rx_ulsch_sdu);
if ((UE_id > MAX_MOBILES_PER_ENB) || (UE_id == -1)) if ((UE_id > MAX_MOBILES_PER_ENB) || (UE_id == -1))
...@@ -672,69 +674,92 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -672,69 +674,92 @@ rx_sdu(const module_id_t enb_mod_idP,
// } // }
break; break;
// all the DRBS // all the DRBS
case DTCH: case DTCH:
default: default:
#if defined(ENABLE_MAC_PAYLOAD_DEBUG) #if defined(ENABLE_MAC_PAYLOAD_DEBUG)
LOG_T(MAC, "offset: %d\n", LOG_T(MAC, "offset: %d\n",
(unsigned char) ((unsigned char *) payload_ptr - sduP)); (unsigned char) ((unsigned char *) payload_ptr - sduP));
for (j = 0; j < 32; j++) { for (j = 0; j < 32; j++) {
LOG_T(MAC, "%x ", payload_ptr[j]); LOG_T(MAC, "%x ", payload_ptr[j]);
} }
LOG_T(MAC, "\n"); LOG_T(MAC, "\n");
#endif #endif
if (rx_lcids[i] < NB_RB_MAX) {
LOG_D(MAC,
"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d\n",
enb_mod_idP, CC_idP, frameP, rx_lengths[i], UE_id,
rx_lcids[i]);
if (UE_id != -1) { if (rx_lcids[i] < NB_RB_MAX) {
// adjust buffer occupancy of the correponding logical channel group
LOG_D(MAC, LOG_D(MAC, "[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d\n",
"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d, removing from LCGID %ld, %d\n", enb_mod_idP,
enb_mod_idP, CC_idP, frameP, rx_lengths[i], CC_idP,
UE_id, rx_lcids[i], frameP,
UE_list->UE_template[CC_idP][UE_id]. rx_lengths[i],
lcgidmap[rx_lcids[i]], UE_id,
UE_list->UE_template[CC_idP][UE_id]. rx_lcids[i]);
ul_buffer_info[UE_list->UE_template[CC_idP]
[UE_id].lcgidmap[rx_lcids[i]]]); if (UE_id != -1) {
// adjust buffer occupancy of the correponding logical channel group
LOG_D(MAC, "[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d, removing from LCGID %ld, %d\n",
enb_mod_idP,
CC_idP,
frameP,
rx_lengths[i],
UE_id,
rx_lcids[i],
UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]],
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]]);
if (lcgid_updated[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] == 0) { if (lcgid_updated[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] == 0) {
if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i]) if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i]) {
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i]; UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i];
else } else {
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0; UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0;
}
UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer = UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer =
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[0] + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[0] +
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[1] + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[1] +
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[2] + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[2] +
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[3]; UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[3];
//UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer += UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer / 4;
} }
if ((rx_lengths[i] < SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0)) { // MAX SIZE OF transport block if ((rx_lengths[i] < SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0)) { // MAX SIZE OF transport block
mac_rlc_data_ind(enb_mod_idP, current_rnti, enb_mod_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, rx_lcids[i], (char *) payload_ptr, rx_lengths[i], 1, NULL); //(unsigned int*)crc_status); mac_rlc_data_ind(enb_mod_idP, current_rnti, enb_mod_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, rx_lcids[i], (char *) payload_ptr, rx_lengths[i], 1, NULL);
UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]] += 1; UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]] += 1;
UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]] += rx_lengths[i]; UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]] += rx_lengths[i];
//clear uplane_inactivity_timer
UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0; //clear uplane_inactivity_timer
} else { /* rx_length[i] */ UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0;
UE_list->eNB_UE_stats[CC_idP][UE_id].num_errors_rx += 1;
LOG_E(MAC, // reset RRC inactivity timer after uplane activity
"[eNB %d] CC_id %d Frame %d : Max size of transport block reached LCID %d from UE %d ", ue_contextP = rrc_eNB_get_ue_context(RC.rrc[enb_mod_idP], rntiP);
enb_mod_idP, CC_idP, frameP, rx_lcids[i], ue_contextP->ue_context.ue_rrc_inactivity_timer = 1;
UE_id);
} } else { /* rx_length[i] */
} else { /*(UE_id != -1 */ UE_list->eNB_UE_stats[CC_idP][UE_id].num_errors_rx += 1;
LOG_E(MAC,
"[eNB %d] CC_id %d Frame %d : received unsupported or unknown LCID %d from UE %d ", LOG_E(MAC, "[eNB %d] CC_id %d Frame %d : Max size of transport block reached LCID %d from UE %d ",
enb_mod_idP, CC_idP, frameP, rx_lcids[i], UE_id); enb_mod_idP,
} CC_idP,
frameP,
rx_lcids[i],
UE_id);
}
} else { // end if (UE_id != -1)
LOG_E(MAC,"[eNB %d] CC_id %d Frame %d : received unsupported or unknown LCID %d from UE %d ",
enb_mod_idP,
CC_idP,
frameP,
rx_lcids[i],
UE_id);
}
} }
break; break;
......
...@@ -279,6 +279,9 @@ mac_rrc_data_ind( ...@@ -279,6 +279,9 @@ mac_rrc_data_ind(
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
/*
* Get RRC status (Connected, Idle...) of UE from RNTI
*/
int int
mac_eNB_get_rrc_status( mac_eNB_get_rrc_status(
const module_id_t Mod_idP, const module_id_t Mod_idP,
...@@ -287,9 +290,7 @@ mac_eNB_get_rrc_status( ...@@ -287,9 +290,7 @@ mac_eNB_get_rrc_status(
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
struct rrc_eNB_ue_context_s* ue_context_p = NULL; struct rrc_eNB_ue_context_s* ue_context_p = NULL;
ue_context_p = rrc_eNB_get_ue_context( ue_context_p = rrc_eNB_get_ue_context(RC.rrc[Mod_idP], rntiP);
RC.rrc[Mod_idP],
rntiP);
if (ue_context_p != NULL) { if (ue_context_p != NULL) {
return(ue_context_p->ue_context.Status); return(ue_context_p->ue_context.Status);
......
...@@ -184,43 +184,43 @@ uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich ...@@ -184,43 +184,43 @@ uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich
asn_enc_rval_t enc_rval; asn_enc_rval_t enc_rval;
LTE_BCCH_BCH_Message_t *mib=&carrier->mib ; LTE_BCCH_BCH_Message_t *mib=&carrier->mib ;
uint8_t sfn = (uint8_t)((frame>>2)&0xff); uint8_t sfn = (uint8_t)((frame>>2)&0xff);
uint16_t *spare= calloc(1, sizeof(uint16_t)); uint16_t *spare = calloc(1, sizeof(uint16_t));
if (spare == NULL) abort(); if (spare == NULL) abort();
switch (N_RB_DL) { switch (N_RB_DL) {
case 6: case 6:
mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n6; mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n6;
break; break;
case 15: case 15:
mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n15; mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n15;
break; break;
case 25: case 25:
mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n25; mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n25;
break; break;
case 50: case 50:
mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n50; mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n50;
break; break;
case 75: case 75:
mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n75; mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n75;
break; break;
case 100: case 100:
mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n100; mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n100;
break; break;
default: default:
AssertFatal(1==0,"Unknown dl_Bandwidth %d\n",N_RB_DL); AssertFatal(1==0,"Unknown dl_Bandwidth %d\n",N_RB_DL);
} }
AssertFatal(phich_Resource <= LTE_PHICH_Config__phich_Resource_two,"Illegal phich_Resource\n"); AssertFatal(phich_Resource <= LTE_PHICH_Config__phich_Resource_two,"Illegal phich_Resource\n");
mib->message.phich_Config.phich_Resource = phich_Resource; mib->message.phich_Config.phich_Resource = phich_Resource;
AssertFatal(phich_duration <= LTE_PHICH_Config__phich_Duration_extended,"Illegal phich_Duration\n"); AssertFatal(phich_duration <= LTE_PHICH_Config__phich_Duration_extended,"Illegal phich_Duration\n");
mib->message.phich_Config.phich_Duration = phich_duration; mib->message.phich_Config.phich_Duration = phich_duration;
LOG_I(RRC,"[MIB] systemBandwidth %x, phich_duration %x, phich_resource %x,sfn %x\n", LOG_I(RRC,"[MIB] systemBandwidth %x, phich_duration %x, phich_resource %x, sfn %x\n",
(uint32_t)mib->message.dl_Bandwidth, (uint32_t)mib->message.dl_Bandwidth,
(uint32_t)phich_duration, (uint32_t)phich_duration,
(uint32_t)phich_Resource, (uint32_t)phich_Resource,
...@@ -704,6 +704,9 @@ uint8_t do_SIB23(uint8_t Mod_id, ...@@ -704,6 +704,9 @@ uint8_t do_SIB23(uint8_t Mod_id,
= configuration->pcch_defaultPagingCycle[CC_id]; = configuration->pcch_defaultPagingCycle[CC_id];
(*sib2)->radioResourceConfigCommon.pcch_Config.nB (*sib2)->radioResourceConfigCommon.pcch_Config.nB
= configuration->pcch_nB[CC_id]; = configuration->pcch_nB[CC_id];
LOG_I(RRC,"[SIB2] With ITTI. Basic config of paging cycle DRX: radio frame cycle length %x, paging occasion number %x\n",
(uint32_t)configuration->pcch_defaultPagingCycle[CC_id],
(uint32_t)configuration->pcch_nB[CC_id]);
// PRACH-Config // PRACH-Config
(*sib2)->radioResourceConfigCommon.prach_Config.rootSequenceIndex (*sib2)->radioResourceConfigCommon.prach_Config.rootSequenceIndex
......
...@@ -57,7 +57,7 @@ uint16_t get_adjacent_cell_id(uint8_t Mod_id,uint8_t index); ...@@ -57,7 +57,7 @@ uint16_t get_adjacent_cell_id(uint8_t Mod_id,uint8_t index);
uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId); uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId);
/** /**
\brief Generate configuration for SIB1 (eNB). \brief Generate configuration for MIB (eNB).
@param carrier pointer to Carrier information @param carrier pointer to Carrier information
@param N_RB_DL Number of downlink PRBs @param N_RB_DL Number of downlink PRBs
@param phich_Resource PHICH resoure parameter @param phich_Resource PHICH resoure parameter
......
...@@ -735,7 +735,7 @@ Paging-v1130-IEs ::= SEQUENCE { ...@@ -735,7 +735,7 @@ Paging-v1130-IEs ::= SEQUENCE {
} }
Paging-v1310-IEs ::= SEQUENCE { Paging-v1310-IEs ::= SEQUENCE {
redistributionIndication-r13 ENUMERATED {true} OPTIONAL, --Need ON redistributionIndication-r13 ENUMERATED {true} OPTIONAL, -- Need ON
systemInfoModification-eDRX-r13 ENUMERATED {true} OPTIONAL, -- Need ON systemInfoModification-eDRX-r13 ENUMERATED {true} OPTIONAL, -- Need ON
nonCriticalExtension SEQUENCE {} OPTIONAL nonCriticalExtension SEQUENCE {} OPTIONAL
} }
......
...@@ -387,10 +387,10 @@ typedef enum SL_TRIGGER_e { ...@@ -387,10 +387,10 @@ typedef enum SL_TRIGGER_e {
#define RRC_TRANSACTION_IDENTIFIER_NUMBER 3 #define RRC_TRANSACTION_IDENTIFIER_NUMBER 3
typedef struct { typedef struct {
unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */ unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */
unsigned short max_transport_blocks; /*!< \brief Maximum PDU size in bytes provided by RLC to MAC layer interface */ unsigned short max_transport_blocks; /*!< \brief Maximum PDU size in bytes provided by RLC to MAC layer interface */
unsigned long Guaranteed_bit_rate; /*!< \brief Guaranteed Bit Rate (average) to be offered by MAC layer scheduling*/ unsigned long Guaranteed_bit_rate; /*!< \brief Guaranteed Bit Rate (average) to be offered by MAC layer scheduling*/
unsigned long Max_bit_rate; /*!< \brief Maximum Bit Rate that can be offered by MAC layer scheduling*/ unsigned long Max_bit_rate; /*!< \brief Maximum Bit Rate that can be offered by MAC layer scheduling*/
uint8_t Delay_class; /*!< \brief Delay class offered by MAC layer scheduling*/ uint8_t Delay_class; /*!< \brief Delay class offered by MAC layer scheduling*/
uint8_t Target_bler; /*!< \brief Target Average Transport Block Error rate*/ uint8_t Target_bler; /*!< \brief Target Average Transport Block Error rate*/
uint8_t Lchan_t; /*!< \brief Logical Channel Type (BCCH,CCCH,DCCH,DTCH_B,DTCH,MRBCH)*/ uint8_t Lchan_t; /*!< \brief Logical Channel Type (BCCH,CCCH,DCCH,DTCH_B,DTCH,MRBCH)*/
...@@ -552,7 +552,7 @@ typedef struct eNB_RRC_UE_s { ...@@ -552,7 +552,7 @@ typedef struct eNB_RRC_UE_s {
LTE_CipheringAlgorithm_r12_t ciphering_algorithm; LTE_CipheringAlgorithm_r12_t ciphering_algorithm;
e_LTE_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm; e_LTE_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
uint8_t Status; uint8_t Status; // RRC status, type enum UE_STATE_t
rnti_t rnti; rnti_t rnti;
uint64_t random_ue_identity; uint64_t random_ue_identity;
...@@ -573,7 +573,7 @@ typedef struct eNB_RRC_UE_s { ...@@ -573,7 +573,7 @@ typedef struct eNB_RRC_UE_s {
security_capabilities_t security_capabilities; security_capabilities_t security_capabilities;
/* Total number of e_rab already setup in the list */ /* Total number of e_rab already setup in the list */
uint8_t setup_e_rabs; uint8_t setup_e_rabs;
/* Number of e_rab to be setup in the list */ /* Number of e_rab to be setup in the list */
uint8_t nb_of_e_rabs; uint8_t nb_of_e_rabs;
/* Number of e_rab to be modified in the list */ /* Number of e_rab to be modified in the list */
...@@ -599,6 +599,9 @@ typedef struct eNB_RRC_UE_s { ...@@ -599,6 +599,9 @@ typedef struct eNB_RRC_UE_s {
uint32_t ue_release_timer_thres_rrc; uint32_t ue_release_timer_thres_rrc;
uint32_t ue_reestablishment_timer; uint32_t ue_reestablishment_timer;
uint32_t ue_reestablishment_timer_thres; uint32_t ue_reestablishment_timer_thres;
/* RRC inactivity timer: on timeout, should release RRC connection for inactivity on all E-RABs */
uint32_t ue_rrc_inactivity_timer;
uint32_t ue_rrc_inactivity_timer_thres;
uint8_t e_rab_release_command_flag; uint8_t e_rab_release_command_flag;
int8_t reestablishment_xid; int8_t reestablishment_xid;
} eNB_RRC_UE_t; } eNB_RRC_UE_t;
......
This diff is collapsed.
This diff is collapsed.
...@@ -444,16 +444,22 @@ void *s1ap_eNB_task(void *arg) ...@@ -444,16 +444,22 @@ void *s1ap_eNB_task(void *arg)
return NULL; return NULL;
} }
//-----------------------------------------------------------------------------
/*
* eNB generate a S1 setup request towards MME
*/
static int s1ap_eNB_generate_s1_setup_request( static int s1ap_eNB_generate_s1_setup_request(
s1ap_eNB_instance_t *instance_p, s1ap_eNB_mme_data_t *s1ap_mme_data_p) s1ap_eNB_instance_t *instance_p,
s1ap_eNB_mme_data_t *s1ap_mme_data_p)
//-----------------------------------------------------------------------------
{ {
S1AP_S1AP_PDU_t pdu; S1AP_S1AP_PDU_t pdu;
S1AP_S1SetupRequest_t *out; S1AP_S1SetupRequest_t *out = NULL;
S1AP_S1SetupRequestIEs_t *ie; S1AP_S1SetupRequestIEs_t *ie = NULL;
S1AP_SupportedTAs_Item_t *ta; S1AP_SupportedTAs_Item_t *ta = NULL;
S1AP_PLMNidentity_t *plmn; S1AP_PLMNidentity_t *plmn = NULL;
uint8_t *buffer; uint8_t *buffer = NULL;
uint32_t len; uint32_t len = 0;
int ret = 0; int ret = 0;
DevAssert(instance_p != NULL); DevAssert(instance_p != NULL);
......
...@@ -863,11 +863,7 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id, ...@@ -863,11 +863,7 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
"existing UE context 0x%06lx\n", "existing UE context 0x%06lx\n",
assoc_id, assoc_id,
enb_ue_s1ap_id); enb_ue_s1ap_id);
/*MessageDef *msg_complete_p;
msg_complete_p = itti_alloc_new_message(TASK_RRC_ENB, S1AP_UE_CONTEXT_RELEASE_COMPLETE);
S1AP_UE_CONTEXT_RELEASE_COMPLETE(msg_complete_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
itti_send_msg_to_task(TASK_S1AP, ue_desc_p->eNB_instance->instance <=> 0, msg_complete_p);
*/
return -1; return -1;
} else { } else {
MSC_LOG_TX_MESSAGE( MSC_LOG_TX_MESSAGE(
...@@ -877,6 +873,11 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id, ...@@ -877,6 +873,11 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
"0 S1AP_UE_CONTEXT_RELEASE_COMMAND/%d eNB_ue_s1ap_id "S1AP_UE_ID_FMT" ", "0 S1AP_UE_CONTEXT_RELEASE_COMMAND/%d eNB_ue_s1ap_id "S1AP_UE_ID_FMT" ",
enb_ue_s1ap_id); enb_ue_s1ap_id);
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_UE_CONTEXT_RELEASE_COMMAND); message_p = itti_alloc_new_message(TASK_S1AP, S1AP_UE_CONTEXT_RELEASE_COMMAND);
if (ue_desc_p->mme_ue_s1ap_id == 0) { // case of Detach Request and switch off from RRC_IDLE mode
ue_desc_p->mme_ue_s1ap_id = mme_ue_s1ap_id;
}
S1AP_UE_CONTEXT_RELEASE_COMMAND(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id; S1AP_UE_CONTEXT_RELEASE_COMMAND(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p); itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
return 0; return 0;
......
...@@ -573,9 +573,6 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id, ...@@ -573,9 +573,6 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id,
ie->value.choice.NAS_PDU.buf, ie->value.choice.NAS_PDU.buf,
ie->value.choice.NAS_PDU.size); ie->value.choice.NAS_PDU.size);
// LG: Why set to 0 ??
//ue_desc_p->ue_initial_id = 0;
return 0; return 0;
} }
......
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