Commit 315c48e7 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

avoid potential issues when repeating establish/release procedure for 1-1

parent 0bae28af
......@@ -1392,7 +1392,13 @@ rrc_mac_config_req_ue(
j = 0;
k = 0;
for (k = 0; k< MAX_NUM_LCID_DATA; k++) {
if ((UE_mac_inst[Mod_idP].sl_info[k].LCID == 0) && (j == 0)) j = k+1;
if ((UE_mac_inst[Mod_idP].sl_info[k].LCID == 0) && (UE_mac_inst[Mod_idP].sl_info[k].destinationL2Id == 0) && (UE_mac_inst[Mod_idP].sl_info[k].groupL2Id == 0) && (j == 0)) j = k+1;
if ((UE_mac_inst[Mod_idP].sl_info[k].groupL2Id == *groupL2Id) && (UE_mac_inst[Mod_idP].sl_info[k].LCID == 0 )) {
UE_mac_inst[Mod_idP].sl_info[k].LCID = logicalChannelIdentity;
break; //(LCID, G) already exists!
}
if ((UE_mac_inst[Mod_idP].sl_info[k].LCID == logicalChannelIdentity) && (UE_mac_inst[Mod_idP].sl_info[k].groupL2Id == *groupL2Id)) break; //(LCID, G) already exists!
}
if ((k == MAX_NUM_LCID_DATA) && (j > 0)) {
......@@ -1411,7 +1417,11 @@ rrc_mac_config_req_ue(
j = 0;
k = 0;
for (k = 0; k< MAX_NUM_LCID_DATA; k++) {
if ((UE_mac_inst[Mod_idP].sl_info[k].LCID == 0) && (j == 0)) j = k+1;
if ((UE_mac_inst[Mod_idP].sl_info[k].LCID == 0) && (UE_mac_inst[Mod_idP].sl_info[k].destinationL2Id == 0) && (UE_mac_inst[Mod_idP].sl_info[k].groupL2Id == 0) && (j == 0)) j = k+1;
if ((UE_mac_inst[Mod_idP].sl_info[k].destinationL2Id == *destinationL2Id) && (UE_mac_inst[Mod_idP].sl_info[k].LCID == 0 )) {
UE_mac_inst[Mod_idP].sl_info[k].LCID = logicalChannelIdentity;
break; //(LCID, D) already exists!
}
if ((UE_mac_inst[Mod_idP].sl_info[k].LCID == logicalChannelIdentity) && (UE_mac_inst[Mod_idP].sl_info[k].destinationL2Id == *destinationL2Id)) break; //(LCID, D) already exists!
}
if ((k == MAX_NUM_LCID_DATA) && (j > 0)) {
......@@ -1430,7 +1440,13 @@ rrc_mac_config_req_ue(
j = 0;
k = 0;
for (k = MAX_NUM_LCID_DATA; k < MAX_NUM_LCID; k++) {
if ((UE_mac_inst[Mod_idP].sl_info[k].LCID == 0) && (j == 0)) j = k+1;
if ((UE_mac_inst[Mod_idP].sl_info[k].LCID == 0) && (UE_mac_inst[Mod_idP].sl_info[k].destinationL2Id == 0) && (UE_mac_inst[Mod_idP].sl_info[k].groupL2Id == 0) && (j == 0)) j = k+1;
if (destinationL2Id){
if ((UE_mac_inst[Mod_idP].sl_info[k].LCID == 0) && (UE_mac_inst[Mod_idP].sl_info[k].destinationL2Id == *destinationL2Id )) {
UE_mac_inst[Mod_idP].sl_info[k].LCID = logicalChannelIdentity;
break;
}
}
if ((UE_mac_inst[Mod_idP].sl_info[k].LCID == logicalChannelIdentity)) break;
//&& (UE_mac_inst[Mod_idP].sl_info[k].destinationL2Id == *destinationL2Id)) break; //(LCID, D) already exists!
}
......
......@@ -825,11 +825,11 @@ void ue_send_sl_sdu(module_id_t module_idP,
//match the destinationL2Id with UE L2Id or groupL2ID
if (!(((destinationL2Id == UE_mac_inst[module_idP].sourceL2Id) && (j < MAX_NUM_LCID)) | ((destinationL2Id == UE_mac_inst[module_idP].sourceL2Id) && (longh->LCID >= MAX_NUM_LCID_DATA)) | (i < MAX_NUM_LCID))){
LOG_D( MAC, "[Destination Id is neither matched with Source Id nor with Group Id, drop the packet!!! \n");
LOG_I( MAC, "[Destination Id is neither matched with Source Id nor with Group Id, drop the packet!!! \n");
return;
}
if (lcid == 0) {
LOG_D( MAC, "[Destination Id is neither matched with Source Id nor with Group Id, drop the packet!!! \n");
LOG_I( MAC, "[Destination Id is neither matched with Source Id nor with Group Id, drop the packet!!! \n");
return;
}
......
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