Commit c8251361 authored by Raymond Knopp's avatar Raymond Knopp

Merge branch 'l1-sidelink' of https://gitlab.eurecom.fr/matzakos/LTE-D2D into l1-sidelink

parents 5f13240f 5ffe7a2e
......@@ -34,24 +34,34 @@ OAI build/execute
- cp ../../../targets/bin/.usim* .
- sudo insmod ../../../targets/bin/ue_ip.ko
Get and build vencore_app from d2d-l3-stub (branch: l3_stub)
- git clone https://gitlab.eurecom.fr/tien-thinh.nguyen/d2d-l3-stub
- git checkout l3-stub
- gcc -I . vencore_app.c -o vencore_app -lpthread
UE1:
- sudo ifconfig oip0 10.0.0.1
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 224.0.0.3 -j MARK --set-mark 3
- (if necessary) sudo route add default gw 10.10.10.1 eth0
UE2:
- sudo ifconfig oip0 10.0.0.2
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 224.0.0.3 -j MARK --set-mark 3
- (if necessary) sudo route add default gw 10.10.10.1 eno1
UE1 and UE2: Get and build vencore_app from d2d-l3-stub (branch: l3_stub)
- gcc -I . vencore_app.c -o vencore_app -lpthread
For the moment, we suppose that L2Ids of UE1, UE2 are Ox01, 0x02 respectively. GroupL2Id is set to 0x03.
--------------------------------
TEST ONE-TO-MANY
Run UE1 then UE2, for example:
UE1: sudo ./lte-softmodem-stub -U --emul-iface eth0
UE2: sudo ./lte-softmodem-stub -U --emul-iface eno1
- UE1: sudo ./lte-softmodem-stub -U --emul-iface eth0
- UE1 ./vencore_app -g 0x01 0x03 #0x01 - UE1-L2Id, 0x03-groupL2Id
# a SLRB will be established for this communication (check SLRB_ID from vencore_app's screen)
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 224.0.0.3 -j MARK --set-mark XXX #XXX is SLRB_ID
- UE2: sudo ./lte-softmodem-stub -U --emul-iface eno1
- UE2 ./vencore_app -g 0x02 0x03 #0x02 - UE2-L2Id, 0x03-groupL2Id
# a SLRB will be established for this communication (check SLRB_ID from vencore_app's screen)
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 224.0.0.3 -j MARK --set-mark XXX #XXX is SLRB_ID
Test with Ping
- Sender - UE1: ping -I oip0 224.0.0.3
- Receiver - UE2: using wireshark
......@@ -61,41 +71,55 @@ Test with Iperf
- Receiver - UE2: sudo ./mcreceive 224.0.0.3 5001
Filter the incomming packets according to GroupL2Id: receiver (one-to-many) can discard the packets if it doesn't belong to this group.
For the moment, both sender and receiver use the same set of Ids (hardcoded)
UE1 (sender)
- sudo ./lte-softmodem-stub -U --emul-iface eth0
- ./vencore_app #send the sourceL2Id, groupL2Id to OAI
- ./vencore_app -g 0x01 0x03 #0x01 - UE1's L2Id, 0x03-groupL2Id
# a SLRB will be established for this communication (check SLRB_ID from vencore_app's screen)
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 224.0.0.3 -j MARK --set-mark XXX #XXX is SLRB_ID
- ping -I oip0 224.0.0.3
UE2(receiver)
UE2(receiver)
- sudo ./lte-softmodem-stub -U --emul-iface eno1
#we can see the incomming packets from OAI log, however, cannot see from Wireshark -> they are discarded at MAC layer
- ./vencore_app #we can see the packets appearing in Wireshark
#we can see the incomming packets from OAI log, however, cannot see from Wireshark -> they are discarded at MAC layer
-./vencore_app -g 0x02 0x03 #0x02 - UE2-L2Id, 0x03-groupL2Id
# a SLRB will be established for this communication (check SLRB_ID from vencore_app's screen)
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 224.0.0.3 -j MARK --set-mark XXX #XXX is SLRB_ID
#we can see the packets appearing in Wireshark
--------------------------------------
TEST PC5-S (UE1 -sender, UE2 - receiver) and PC5-U for ONE-TO-ONE scenario
TEST PC5-S (UE1 - sender, UE2 - receiver) and PC5-U for ONE-TO-ONE scenario (and PC5-U for ONE-TO-MANY scenario)
Configure UE1/UE2
UE1:
- sudo ifconfig oip0 10.0.0.1
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 10.0.0.2 -j MARK --set-mark 3
- sudo route add default gw 10.10.10.1 eth0
UE2:
- sudo ifconfig oip0 10.0.0.2
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 10.0.0.1 -j MARK --set-mark 3
- sudo route add default gw 10.10.10.1 eno1
step 1:
- UE1: sudo ./lte-softmodem-stub -U --emul-iface eth0
- UE1: sudo ./lte-softmodem-stub -U --emul-iface eth0
step 2:
- UE2: sudo ./lte-softmodem-stub -U --emul-iface eno1
- UE2: ./vencore_app -r #listen to incomming message from PC5-S
- UE2: sudo ./lte-softmodem-stub -U --emul-iface eno1
- UE2: ./vencore_app -r 0x02 0x01 #listen to incomming PC5-S message and incomming PC5-U packet from UE1, 0x02 - UE2-L2Id, 0x01 - UE1-L2Id
# mark the packets with the corresponding SLRB (since UE2 is receiver, we should mark only the unicast flow)
# 2 SLRBs will be established: 1 for unicast communication and 1 for multicast (check SLRB_ID from vencore_app's screen)
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 10.0.0.1 -j MARK --set-mark XXX #XXX is SLRB_ID for unicast communication
step 3:
- UE1: ./vencore_app -s #send a message via PC5-S (e.g., DirectCommunicationRequest)
- UE1: ./vencore_app -s 0x01 0x02 #send a message via PC5-S (e.g., DirectCommunicationRequest) and establish 1-1 communication, 0x01 - UE1-L2Id, 0x02 - UE2-L2Id
# mark the packets with the corresponding SLRB
# 2 SLRBs will be established: 1 for unicast communication and 1 for multicast (check SLRB_ID from vencore_app's screen)
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 224.0.0.3 -j MARK --set-mark XXX #XXX is SLRB_ID for multicast communication
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 10.0.0.2 -j MARK --set-mark XXX #XXX is SLRB_ID for unicast communication
Generate unicast traffic
UE1: ping -I oip0 10.0.0.2
- UE1: ping -I oip0 10.0.0.2
Generate multicast traffic
- UE1: ping -I oip0 224.0.0.3
--------------------------------------
TEST PC5-D
step 1:
......@@ -105,3 +129,87 @@ step 2:
- UE2: sudo ./lte-softmodem-stub -U --emul-iface eno1
- UE2: ./vencore_app -d #send a PC5-Discovery-Announcement via PC5D
-----------------------------------------
Scenario 2 : Off-network UE2UE link (3 UEs, 4 communication flows: 2 unicast + 2 multicast)
SynchREF UE (UE1)
UE1(eth0 - 10.10.10.1)-----Hub------UE2(eno1 - 10.10.10.2)
|
|
UE3 (eno1 - 10.0.0.4)
UE1-L2ID: 0x01
UE2-L2ID: 0x02
UE3-L2ID: 0x04
Group1 L2ID: 0x03 (224.0.0.3)
Group2 L2ID: 0x05 (225.0.0.5)
Unicast Flow 1: UE1 -> UE2
Unicast Flow 2: UE1 -> UE3
Multicast Flow 1: UE1 -> UE2 + UE3
Multicast Flow 2: UE1 -> UE2 + UE3
--------------------------------------
TEST PC5-U for ONE-TO-ONE scenario (UE1 - sender, UE2/3 - receiver) and PC5-U for ONE-TO-MANY scenario (UE1 - sender, UE2/3 - receiver)
- configure UE1, UE2, UE3 as mentioned in the previous section
UE1:
- sudo ifconfig oip0 10.0.0.1
- sudo route add default gw 10.10.10.1 eth0
UE2:
- sudo ifconfig oip0 10.0.0.2
- sudo route add default gw 10.10.10.1 eno1
- configure UE3
UE3:
- sudo ifconfig oip0 10.0.0.4
- sudo route add default gw 10.10.10.1 eno1
Step 1:
- UE1: sudo ./lte-softmodem-stub -U --emul-iface eth0
Step 2:
- UE2: sudo ./lte-softmodem-stub -U --emul-iface eno1
- UE2: ./vencore_app -r 0x02 0x01 # listen to incomming PC5-S message and incomming PC5-U packet from UE1, 0x02 - UE2-L2Id, 0x01 - UE1-L2Id
# groupL2Id is hardcoded for the moment (0x03, Ox05)
# mark the packets with the corresponding SLRB
# 3 SLRBs will be established: 1 for unicast and 2 for multicast (check SLRB_ID from vencore_app's screen)
# since UE2 is receiver, we should mark only the unicast flow
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 10.0.0.1 -j MARK --set-mark XXX #XXX is SLRB_ID for unicast communication
- UE3: sudo ./lte-softmodem-stub -U --emul-iface eno1
- UE3: ./vencore_app -r 0x04 0x01 # listen to incomming PC5-S message and incomming PC5-U packet from UE1, 0x04 - UE3-L2Id, 0x01 - UE1-L2Id
# groupL2Id is hardcoded for the moment (0x03, Ox05)
# mark the packets with the corresponding SLRB
# 3 SLRBs will be established: 1 for unicast and 2 for multicast (check SLRB_ID from vencore_app's screen)
# since UE3 is receiver, we should mark only the unicast flow
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 10.0.0.1 -j MARK --set-mark XXX #XXX is SLRB_ID for unicast communication
Step 3:
- UE1: ./vencore_app -s 0x01 0x02 # 0x01 - UE1-L2Id, 0x02 - UE2-L2Id
# groupL2Id is hardcoded for the moment (0x03, 0x05)
# mark the packets with the corresponding SLRB
# 4 SLRBs will be established: 2 for unicast communication and 2 for multicast (check SLRB_ID from vencore_app's screen)
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 10.0.0.2 -j MARK --set-mark XXX #XXX is SLRB_ID for the first unicast communication
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 10.0.0.4 -j MARK --set-mark XXX #XXX is SLRB_ID for the second unicast communication
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 224.0.0.3 -j MARK --set-mark XXX #XXX is SLRB_ID for the first multicast communication
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 224.0.0.5 -j MARK --set-mark XXX #XXX is SLRB_ID for the first multicast communication
Generate unicast traffic
- UE1: ping -I oip0 10.0.0.2 #flow 1
- UE1: ping -I oip0 10.0.0.4 #flow 2
Generate multicast traffic
- UE1: ping -I oip0 224.0.0.3 #flow 3
- UE1: ping -I oip0 224.0.0.5 #flow 4
Expected results:
- UE2 can receive both unicast and multicast traffic (flow 1, flow 3 and flow 4)
- UE3 can receive both unicast and multicast traffic (flow 2, flow 3 and flow 4)
Note:
- Use wireshark to observe unicast/multicast traffic from UE2/3.
......@@ -284,10 +284,11 @@ void sldch_decoding(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subfra
// printf("slsch decoding round %d ret %d\n",ue->dlsch_rx_sldch->harq_processes[0]->round,ret);
if (ret<ue->dlsch_rx_sldch[npsdch]->max_turbo_iterations) {
LOG_I(PHY,"SLDCH received for npsdch %d (rvidx %d, iter %d)\n",
LOG_D(PHY,"SLDCH received for npsdch %d (rvidx %d, iter %d)\n",
npsdch,
rvidx,ret);
ue->sldch_received[npsdch] = 1;
ue->sldch_rxcnt[npsdch]++;
}
//exit(-1);
......@@ -422,6 +423,8 @@ void sldch_codingmodulation(PHY_VARS_UE *ue,int frame_tx,int subframe_tx,int npr
LOG_D(PHY,"Generating SLDCH in %d.%d for rvidx %d, npsdch %d, first rb %d\n",
frame_tx,subframe_tx,rvidx,sldch->n_psdch,nprb);
if (rvidx==0) ue->sldch_txcnt[sldch->n_psdch]++;
dlsch->harq_processes[0]->nb_rb = 2;
dlsch->harq_processes[0]->TBS = 256;
dlsch->harq_processes[0]->Qm = 2;
......
......@@ -1313,6 +1313,8 @@ typedef struct {
LTE_UE_DLSCH_t *dlsch_rx_slsch;
LTE_UE_DLSCH_t *dlsch_rx_sldch[MAX_SLDCH];
int sldch_received[MAX_SLDCH];
int sldch_rxcnt[MAX_SLDCH];
int sldch_txcnt[MAX_SLDCH];
int16_t **sl_rxdataF[RX_NB_TH_MAX];
int16_t **sl_rxdata_7_5kHz[RX_NB_TH_MAX];
int16_t *slsch_dlsch_llr;
......
......@@ -2391,6 +2391,8 @@ void phy_procedures_UE_SL_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc) {
}
if (frame_tx==0 && subframe_tx ==0)
for (int i=0;i<MAX_SLDCH;i++) if (ue->sldch_txcnt[i]>0) LOG_I(PHY,"n_psdch %d TX count %d\n",i,ue->sldch_txcnt[i]);
}
void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type) {
......@@ -4788,7 +4790,8 @@ void phy_procedures_UE_SL_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc) {
if (ue->is_SynchRef == 0 && frame_rx==0 && subframe_rx==0) LOG_I(PHY,"Connected with SyncRef UE (slbch errors %d/%d)\n",
ue->slbch_errors,ue->slbch_rxops);
if (frame_rx==0 && subframe_rx==0)
for (int i=0;i<MAX_SLDCH;i++) if (ue->sldch_rxcnt[i]>0) LOG_I(PHY,"n_psdch %d RX count %d\n",i,ue->sldch_rxcnt[i]);
}
int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,
......
......@@ -345,7 +345,12 @@ typedef struct {
//RLC_INTERFACE_FUNCTIONS
void (*pdcp_run)(void);
void (*pdcp_data_req)(module_id_t, rb_id_t, sdu_size_t, char*);
signed int (*rrc_rlc_config_req)(unsigned int, unsigned int, unsigned int, unsigned int, rlc_info_t );
signed int (*rrc_rlc_config_req)(unsigned int, unsigned int, unsigned int, unsigned int, rlc_info_t
#ifdef Rel14
,unsigned int
,unsigned int
#endif
);
int (*rrc_mac_config_req)(uint8_t Mod_id,uint8_t eNB_flag,uint8_t UE_id,uint8_t eNB_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct PhysicalConfigDedicated *physicalConfigDedicated,
......@@ -370,7 +375,11 @@ typedef struct {
,uint32_t
#endif
);
void (*mac_rlc_data_ind)(module_id_t, logical_chan_id_t, char*, tb_size_t, num_tb_t, crc_t* );
void (*mac_rlc_data_ind)(module_id_t, logical_chan_id_t, char*, tb_size_t, num_tb_t, crc_t*
#ifdef Rel14
, sl_reset_rlc_flag_t sl_reset_rlc_flag
#endif
);
mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, sub_frame_t subframeP, eNB_flag_t eNB_flagP, MBMS_flag_t MBMS_flagP,
logical_chan_id_t channel_idP, tb_size_t tb_sizeP
#ifdef Rel14
......
......@@ -92,6 +92,10 @@ typedef boolean_t sl_discovery_flag_t;
#define SL_DISCOVERY_FLAG_NO FALSE
#define SL_DISCOVERY_FLAG_YES TRUE
typedef boolean_t sl_reset_rlc_flag_t;
#define SL_RESET_RLC_FLAG_NO FALSE
#define SL_RESET_RLC_FLAG_YES TRUE
typedef enum link_direction_e {
UNKNOWN_DIR = 0,
DIR_UPLINK = 1,
......
......@@ -963,7 +963,79 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP,
mbms_SessionList[i]->list.count);
}
}
#endif
LOG_E(MAC, "%s() %s:%d RC.mac[Mod_idP]->if_inst->PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.mac[Mod_idP]->if_inst->PHY_config_req);
// if in nFAPI mode
if (
(nfapi_mode == 1 || nfapi_mode == 2) &&
(RC.mac[Mod_idP]->if_inst->PHY_config_req == NULL)
)
{
while(RC.mac[Mod_idP]->if_inst->PHY_config_req == NULL) {
// DJP AssertFatal(RC.mac[Mod_idP]->if_inst->PHY_config_req != NULL,"if_inst->phy_config_request is null\n");
usleep(100 * 1000);
printf("Waiting for PHY_config_req\n");
}
}
PHY_Config_t phycfg;
phycfg.Mod_id = Mod_idP;
phycfg.CC_id = CC_idP;
phycfg.cfg = &RC.mac[Mod_idP]->config[CC_idP];
LOG_E(MAC, "%s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
if (RC.mac[Mod_idP]->if_inst->PHY_config_req) RC.mac[Mod_idP]->if_inst->PHY_config_req(&phycfg);
LOG_E(MAC, "%s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT);
return(0);
}
/*
// P: New function supporting the MAC interface
void config_sib1_ue()
{
}
// P: New function supporting the MAC interface
void config_sib2_ue()
{
}
// P: New function supporting the MAC interface
void config_meas_ue()
{
}
// P: New function supporting the MAC interface
// to substitute call to phy_config_afterHO_ue().
void config_afterHO_ue()
{
}
// P: New function supporting the MAC interface
void config_sib13_ue()
{
}
// P: New function supporting the MAC interface
void config_dedicated_ue()
{
}
*/
#endif
LOG_E(MAC, "%s() %s:%d RC.mac[Mod_idP]->if_inst->PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.mac[Mod_idP]->if_inst->PHY_config_req);
......
......@@ -136,9 +136,10 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
, uint8_t num_active_cba_groups, uint16_t cba_rnti
#endif
#if defined(Rel14)
,config_action_t config_action
,const uint32_t * const sourceL2Id
,const uint32_t * const destinationL2Id,
,config_action_t config_action,
const uint32_t * const sourceL2Id,
const uint32_t * const destinationL2Id,
const uint32_t * const groupL2Id,
SL_Preconfiguration_r12_t *SL_Preconfiguration_r12,
uint32_t directFrameNumber_r12,
long directSubframeNumber_r12,
......@@ -588,7 +589,7 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
#endif
//for D2D
#if defined(Rel14)
#if defined(Rel10) || defined(Rel14)
int j = 0;
int k = 0;
switch (config_action) {
......@@ -597,39 +598,125 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
UE_mac_inst[Mod_idP].sourceL2Id = *sourceL2Id;
LOG_I(MAC,"[UE %d] Configure source L2Id 0x%08x \n", Mod_idP, *sourceL2Id );
}
if (destinationL2Id) {
LOG_I(MAC,"[UE %d] Configure destination L2Id 0x%08x\n", Mod_idP, *destinationL2Id );
for (k=0; k< MAX_NUM_DEST; k++) {
if ((UE_mac_inst[Mod_idP].destinationList[k] == 0) && (j == 0)) j = k+1;
if (UE_mac_inst[Mod_idP].destinationList[k] == *destinationL2Id) break; //destination already exists!
}
if ((k == MAX_NUM_DEST) && (j > 0)) {
UE_mac_inst[Mod_idP].destinationList[j-1] = *destinationL2Id;
// UE_mac_inst[Mod_idP].numCommFlows++;
//store list of (S,D,G,LCID) for SL
if ((logicalChannelIdentity > 0) && (logicalChannelIdentity < MAX_NUM_LCID_DATA)) {
if (groupL2Id){
LOG_I(MAC,"[UE %d] Configure group L2Id 0x%08x\n", Mod_idP, *groupL2Id );
j = 0;
k = 0;
for (k = 0; k< MAX_NUM_LCID_DATA; k++) {
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)) {
UE_mac_inst[Mod_idP].sl_info[j-1].LCID = logicalChannelIdentity;
UE_mac_inst[Mod_idP].sl_info[j-1].groupL2Id = *groupL2Id;
UE_mac_inst[Mod_idP].sl_info[j-1].sourceL2Id = *sourceL2Id;
UE_mac_inst[Mod_idP].numCommFlows++;
}
for (k = 0; k < MAX_NUM_LCID_DATA; k++) {
LOG_I(MAC,"[UE %d] logical channel %d channel id %d, groupL2Id %d\n", Mod_idP,k,UE_mac_inst[Mod_idP].sl_info[k].LCID, UE_mac_inst[Mod_idP].sl_info[k].groupL2Id );
}
}
for (k=0; k< MAX_NUM_DEST; k++) {
LOG_I(MAC,"[UE %d] destination %d L2Id 0x%08x\n", Mod_idP,k,UE_mac_inst[Mod_idP].destinationList[k] );
if (destinationL2Id){
LOG_I(MAC,"[UE %d] Configure destination L2Id 0x%08x\n", Mod_idP, *destinationL2Id );
j = 0;
k = 0;
for (k = 0; k< MAX_NUM_LCID_DATA; k++) {
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)) {
UE_mac_inst[Mod_idP].sl_info[j-1].LCID = logicalChannelIdentity;
UE_mac_inst[Mod_idP].sl_info[j-1].destinationL2Id = *destinationL2Id;
UE_mac_inst[Mod_idP].sl_info[j-1].sourceL2Id = *sourceL2Id;
UE_mac_inst[Mod_idP].numCommFlows++;
}
for (k = 0; k < MAX_NUM_LCID_DATA; k++) {
LOG_I(MAC,"[UE %d] logical channel %d channel id %d, destinationL2Id %d\n", Mod_idP,k,UE_mac_inst[Mod_idP].sl_info[k].LCID, UE_mac_inst[Mod_idP].sl_info[k].destinationL2Id);
}
}
}
//store list of LCIDs for SL
if (logicalChannelIdentity >0 ){
} else if ((logicalChannelIdentity >= MAX_NUM_LCID_DATA) && (logicalChannelIdentity < MAX_NUM_LCID)) {
LOG_I(MAC,"[UE %d] Configure LCID %d for PC5S\n", Mod_idP, logicalChannelIdentity );
j = 0;
for (k=0; k< MAX_NUM_LCID; k++) {
if ((UE_mac_inst[Mod_idP].SL_LCID[k] == 0) && (j == 0)) j = k+1;
if (UE_mac_inst[Mod_idP].SL_LCID[k] == logicalChannelIdentity) break; //LCID already exists!
k = 0;
for (k = MAX_NUM_LCID_DATA; k < MAX_NUM_LCID; k++) {
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!
}
if ((k == MAX_NUM_LCID) && (j > 0)) {
UE_mac_inst[Mod_idP].SL_LCID[j-1] = logicalChannelIdentity;
UE_mac_inst[Mod_idP].sl_info[j-1].LCID = logicalChannelIdentity;
if (destinationL2Id) UE_mac_inst[Mod_idP].sl_info[j-1].destinationL2Id = *destinationL2Id;
UE_mac_inst[Mod_idP].sl_info[j-1].sourceL2Id = *sourceL2Id;
UE_mac_inst[Mod_idP].numCommFlows++;
}
for (k=0; k< MAX_NUM_LCID; k++) {
LOG_I(MAC,"[UE %d] logical channel %d channel id %d\n", Mod_idP,k,UE_mac_inst[Mod_idP].SL_LCID[k] );
for (k = MAX_NUM_LCID_DATA; k < MAX_NUM_LCID; k++) {
LOG_I(MAC,"[UE %d] logical channel %d channel id %d, destinationL2Id %d\n", Mod_idP,k,UE_mac_inst[Mod_idP].sl_info[k].LCID, UE_mac_inst[Mod_idP].sl_info[k].destinationL2Id);
}
}
break;
case CONFIG_ACTION_REMOVE:
//TODO
// OK for the moment since LCID is unique per flow
if ((logicalChannelIdentity > 0) && (logicalChannelIdentity < MAX_NUM_LCID_DATA)) {
LOG_I(MAC,"[UE %d] Remove (logicalChannelIdentity %d)\n", Mod_idP, logicalChannelIdentity );
k = 0;
for (k = 0; k < MAX_NUM_LCID_DATA; k++) {
if (UE_mac_inst[Mod_idP].sl_info[k].LCID == logicalChannelIdentity) {
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;
UE_mac_inst[Mod_idP].numCommFlows--;
break;
}
}
for (k = 0; k < MAX_NUM_LCID_DATA; k++) {
LOG_I(MAC,"[UE %d] channel id %d, destinationL2Id %d, groupL2Id %d\n", Mod_idP, UE_mac_inst[Mod_idP].sl_info[k].LCID, UE_mac_inst[Mod_idP].sl_info[k].destinationL2Id, UE_mac_inst[Mod_idP].sl_info[k].groupL2Id);
}
} else if ((logicalChannelIdentity >= MAX_NUM_LCID_DATA) && (logicalChannelIdentity < MAX_NUM_LCID)) {
//remove RBID for PCS5
LOG_I(MAC,"[UE %d] Remove (logicalChannelIdentity %d)\n", Mod_idP, logicalChannelIdentity );
k = 0;
for (k = MAX_NUM_LCID_DATA; k < MAX_NUM_LCID; k++) {
if (UE_mac_inst[Mod_idP].sl_info[k].LCID == logicalChannelIdentity) {
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;
UE_mac_inst[Mod_idP].numCommFlows--;
break;
}
}
for (k = MAX_NUM_LCID_DATA; k < MAX_NUM_LCID; k++) {
LOG_I(MAC,"[UE %d] channel id %d, destinationL2Id %d, groupL2Id %d\n", Mod_idP, UE_mac_inst[Mod_idP].sl_info[k].LCID, UE_mac_inst[Mod_idP].sl_info[k].destinationL2Id, UE_mac_inst[Mod_idP].sl_info[k].groupL2Id);
}
}
break;
default:
break;
}
......
......@@ -120,6 +120,7 @@
#define LCGID3 3
/*!\brief Maximum number of logical chanels */
#define MAX_NUM_LCID 11
#define MAX_NUM_LCID_DATA 8
/*!\brief Maximum number od control elemenets */
#define MAX_NUM_CE 5
/*!\brief Maximum number of random access process */
......@@ -1323,6 +1324,18 @@ typedef struct {
// Bucket size per lcid
int16_t bucket_size[MAX_NUM_LCID];
} UE_SCHEDULING_INFO;
typedef struct {
//SL source L2Id
uint32_t sourceL2Id;
//SL groupL2Id
uint32_t groupL2Id;
//SL destinationL2Id
uint32_t destinationL2Id;
//LCID
uint32_t LCID;
} SL_INFO;
/*!\brief Top level UE MAC structure */
typedef struct {
uint16_t Node_id;
......@@ -1374,10 +1387,9 @@ typedef struct {
uint32_t groupL2Id;
//SL destinationL2Id
uint32_t destinationL2Id;
//List of destinations
uint32_t destinationList[MAX_NUM_DEST];
uint8_t numCommFlows;
uint32_t SL_LCID[MAX_NUM_LCID];
//list of (SLID, G, D)s
SL_INFO sl_info[MAX_NUM_LCID];
#endif
/// pointer to TDD Configuration (NULL for FDD)
......
......@@ -629,7 +629,11 @@ rx_sdu(const module_id_t enb_mod_idP,
enb_mod_idP, CC_idP, frameP, rx_lengths[i], UE_id,
rx_lcids[i]);
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,
#ifdef Rel14
,SL_RESET_RLC_FLAG_NO
#endif
); //(unsigned int*)crc_status);
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];
......@@ -685,7 +689,11 @@ rx_sdu(const module_id_t enb_mod_idP,
}
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
#ifdef Rel14
,SL_RESET_RLC_FLAG_NO
#endif
); //(unsigned int*)crc_status);
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];
......
......@@ -1030,6 +1030,7 @@ int rrc_mac_config_req_ue(module_id_t module_idP,
,config_action_t config_action,
const uint32_t * const sourceL2Id,
const uint32_t * const destinationL2Id,
const uint32_t * const groupL2Id,
SL_Preconfiguration_r12_t *SL_Preconfiguration_r12_t,
uint32_t directFrame_r12,
long directSubframe_r12,
......
This diff is collapsed.
......@@ -1790,7 +1790,12 @@ rrc_pdcp_config_req (
const srb_flag_t srb_flagP,
const uint32_t actionP,
const rb_id_t rb_idP,
const uint8_t security_modeP)
const uint8_t security_modeP
#ifdef Rel14
,const uint32_t sourceL2Id
,const uint32_t destinationL2Id
#endif
)
//-----------------------------------------------------------------------------
{
pdcp_t *pdcp_p = NULL;
......
......@@ -302,7 +302,12 @@ public_pdcp(void rrc_pdcp_config_req (
const srb_flag_t srb_flagP,
const uint32_t actionP,
const rb_id_t rb_idP,
const uint8_t security_modeP);)
const uint8_t security_modeP
#ifdef Rel14
,const uint32_t sourceL2Id
,const uint32_t destinationL2Id
#endif
);)
/*! \fn bool rrc_pdcp_config_asn1_req (const protocol_ctxt_t* const , SRB_ToAddModList_t* srb2add_list, DRB_ToAddModList_t* drb2add_list, DRB_ToReleaseList_t* drb2release_list)
* \brief Function for RRC to configure a Radio Bearer.
......
......@@ -201,7 +201,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
char send_buf[BUFSIZE];
int rb_id = ((pdcp_data_ind_header_t *)(sdu_p->data))->rb_id;
if (rb_id == 10) { //hardcoded for PC5-Signaling
if (rb_id >= MAX_NUM_LCID_DATA) { //hardcoded for PC5-Signaling
//if ((rb_id == 28) | (rb_id == 29) | (rb_id == 30))
#ifdef PDCP_DEBUG
......
......@@ -173,7 +173,11 @@ rlc_um_get_pdus (const protocol_ctxt_t* const ctxt_pP, void *argP)
//-----------------------------------------------------------------------------
void
rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, void *argP, struct mac_data_ind data_indP)
rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, void *argP, struct mac_data_ind data_indP
#ifdef Rel14
, sl_reset_rlc_flag_t sl_reset_rlc_flag
#endif
)
{
rlc_um_entity_t *l_rlc_p = (rlc_um_entity_t *) argP;
#if TRACE_RLC_UM_PDU || MESSAGE_CHART_GENERATOR
......@@ -374,6 +378,44 @@ rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, void *argP, struct mac_data_ind
}
#endif
#ifdef Rel14
//trick to make UE receive multicast packet from different sources
mem_block_t *tb_p = NULL;
uint8_t *first_byte_p = NULL;
//rlc_um_entity_t *
tb_p = list_get_head(&data_indP.data);
first_byte_p = ((struct mac_tb_ind *) (tb_p->data))->data_ptr;
rlc_um_pdu_sn_10_t* pdu_mem_pP = (rlc_um_pdu_sn_10_t*)first_byte_p;
rlc_sn_t sn = -1;
if (l_rlc_p->rx_sn_length == 10) {
sn = ((pdu_mem_pP->b1 & 0x00000003) << 8) + pdu_mem_pP->b2;
} else if (l_rlc_p->rx_sn_length == 5) {
sn = pdu_mem_pP->b1 & 0x1F;
}
LOG_I(RLC, "[rlc_um_rx]DEBUG SN %d, rlc_pP->vr_uh %d rlc_pP->vr_ur %d, l_rlc_p->vr_ux %d \n", sn, l_rlc_p->vr_uh, l_rlc_p->vr_ur, l_rlc_p->vr_ux);
l_rlc_p->vr_ur = sn;
l_rlc_p->vr_uh = sn;
/*
if (sl_reset_rlc_flag == SL_RESET_RLC_FLAG_YES) {
l_rlc_p->vr_ur = 0;
l_rlc_p->vr_ux = 0;
l_rlc_p->vr_uh = 0;
}
if (l_rlc_p->channel_id == MAX_NUM_LCID_DATA) {
l_rlc_p->vr_ur = l_rlc_p->vr_ur % 3;
l_rlc_p->vr_ux = l_rlc_p->vr_ux % 3;
l_rlc_p->vr_uh = l_rlc_p->vr_uh % 3;
}
*/
#endif
rlc_um_receive (ctxt_pP, l_rlc_p, data_indP);
break;
......@@ -676,9 +718,17 @@ rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP,cons
//-----------------------------------------------------------------------------
void
rlc_um_mac_data_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP, struct mac_data_ind data_indP)
rlc_um_mac_data_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP, struct mac_data_ind data_indP
#ifdef Rel14
, sl_reset_rlc_flag_t sl_reset_rlc_flag
#endif
)
{
rlc_um_rx (ctxt_pP, rlc_pP, data_indP);
rlc_um_rx (ctxt_pP, rlc_pP, data_indP
#ifdef Rel14
,sl_reset_rlc_flag
#endif
);
rlc_um_check_timer_dar_time_out(ctxt_pP, rlc_pP);
}
......
......@@ -173,7 +173,11 @@ private_rlc_um( void rlc_um_get_pdus (const protocol_ctxt_t* const ctxt_pP
* \param[in] rlc_pP RLC UM protocol instance pointer.
* \param[in] data_indication PDUs from MAC.
*/
protected_rlc_um( void rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, struct mac_data_ind data_indication);)
protected_rlc_um( void rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, struct mac_data_ind data_indication
#ifdef Rel14
, sl_reset_rlc_flag_t sl_reset_rlc_flag
#endif
);)
/*! \fn struct mac_status_resp rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP)
* \brief Request the maximum number of bytes that can be served by RLC instance to MAC and fix the amount of bytes requested by MAC for next RLC transmission.
......@@ -208,7 +212,11 @@ public_rlc_um( struct mac_data_req rlc_um_mac_data_request (const protocol_ct
* \param[in] rlc_pP RLC UM protocol instance pointer.
* \param[in] data_indP PDUs from MAC.
*/
public_rlc_um( void rlc_um_mac_data_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, struct mac_data_ind data_indP);)
public_rlc_um( void rlc_um_mac_data_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, struct mac_data_ind data_indP
#ifdef Rel14
, sl_reset_rlc_flag_t sl_reset_rlc_flag
#endif
);)
/*! \fn uint32_t rlc_um_get_buffer_occupancy (rlc_um_entity_t *rlc_pP)
* \brief Gets Tx Buffer Occupancy.
......
......@@ -1006,6 +1006,8 @@ rlc_um_receive_process_dar (
free_mem_block(pdu_mem_pP, __func__);
}
LOG_I(RLC, "DEBUG SN %d, rlc_pP->vr_uh %d rlc_pP->vr_ur %d \n", sn, rlc_pP->vr_uh, rlc_pP->vr_ur);
RLC_UM_MUTEX_LOCK(&rlc_pP->lock_dar_buffer, ctxt_pP, rlc_pP);
in_window = rlc_um_in_window(ctxt_pP, rlc_pP, rlc_pP->vr_uh - rlc_pP->rx_um_window_size, sn, rlc_pP->vr_ur);
......
......@@ -479,8 +479,16 @@ void rlc_um_v9_3_0_test_exchange_pdus(rlc_um_entity_t *um_txP,
rlc_um_v9_3_0_test_mac_rlc_loop(&data_ind_rx, &data_request_tx, &g_drop_tx, &g_tx_packets, &g_dropped_tx_packets);
rlc_um_v9_3_0_test_mac_rlc_loop(&data_ind_tx, &data_request_rx, &g_drop_rx, &g_rx_packets, &g_dropped_rx_packets);
rlc_um_mac_data_indication(um_rxP, g_frame, um_rxP->is_enb, data_ind_rx);
rlc_um_mac_data_indication(um_txP, g_frame, um_txP->is_enb, data_ind_tx);
rlc_um_mac_data_indication(um_rxP, g_frame, um_rxP->is_enb, data_ind_rx
#ifdef Rel14
,SL_RESET_RLC_FLAG_NO
#endif
);
rlc_um_mac_data_indication(um_txP, g_frame, um_txP->is_enb, data_ind_tx
#ifdef Rel14
,SL_RESET_RLC_FLAG_NO
#endif
);
g_frame += 1;
//check_mem_area();
//display_mem_load();
......@@ -530,10 +538,18 @@ void rlc_um_v9_3_0_test_exchange_delayed_pdus(rlc_um_entity_t *um_txP,
rlc_um_v9_3_0_buffer_delayed_tx_mac_data_ind(&data_ind_tx, time_rx_delayedP);
rlc_um_mac_data_indication(um_rxP, g_frame, um_rxP->is_enb, g_rx_delayed_indications[frame_modulo]);
rlc_um_mac_data_indication(um_rxP, g_frame, um_rxP->is_enb, g_rx_delayed_indications[frame_modulo]
#ifdef Rel14
,SL_RESET_RLC_FLAG_NO
#endif
);
memset(&g_rx_delayed_indications[frame_modulo], 0, sizeof(struct mac_data_ind));
rlc_um_mac_data_indication(um_txP, g_frame, um_txP->is_enb, g_tx_delayed_indications[frame_modulo]);
rlc_um_mac_data_indication(um_txP, g_frame, um_txP->is_enb, g_tx_delayed_indications[frame_modulo]
#ifdef Rel14
,SL_RESET_RLC_FLAG_NO
#endif
);
memset(&g_tx_delayed_indications[frame_modulo], 0, sizeof(struct mac_data_ind));
if (is_frame_incrementedP) {
......
......@@ -386,7 +386,12 @@ public_rlc_rrc(rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const);
* \param[in] rb_idP Radio bearer identifier.
* \return A status about the processing, OK or error code.
*/
public_rlc_rrc(rlc_op_status_t rrc_rlc_remove_rlc (const protocol_ctxt_t* const, const srb_flag_t, const MBMS_flag_t, const rb_id_t );)
public_rlc_rrc(rlc_op_status_t rrc_rlc_remove_rlc (const protocol_ctxt_t* const, const srb_flag_t, const MBMS_flag_t, const rb_id_t
#ifdef Rel14
,const uint32_t sourceL2Id
,const uint32_t destinationL2Id
#endif
);)
/*! \fn rlc_union_t* rrc_rlc_add_rlc (const protocol_ctxt_t* const ctxtP, const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP, logical_chan_id_t chan_idP, rlc_mode_t rlc_modeP)
* \brief Add a RLC protocol instance to a radio bearer.
......@@ -419,6 +424,8 @@ private_rlc_rrc(rlc_union_t* rrc_rlc_add_rlc (const protocol_ctxt_t* const
* \param[in] actionP Action for this radio bearer (add, modify, remove).
* \param[in] rb_idP Radio bearer identifier.
* \param[in] rlc_infoP RLC configuration parameters issued from Radio Resource Manager.
* \param[in] sourceL2ID [D2D] source L2 Identity.
* \param[in] destinationL2ID [D2D] destination L2 Identity.
* \return A status about the processing, OK or error code.
*/
public_rlc_rrc( rlc_op_status_t rrc_rlc_config_req (
......@@ -427,7 +434,12 @@ public_rlc_rrc( rlc_op_status_t rrc_rlc_config_req (
const MBMS_flag_t,
config_action_t,
const rb_id_t,
rlc_info_t );)
rlc_info_t
#ifdef Rel14
,const uint32_t
,const uint32_t
#endif
);)
/*! \fn rlc_op_status_t rrc_rlc_data_req (const protocol_ctxt_t* const ctxtP, const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP, mui_t muiP, confirm_t confirmP, sdu_size_t sdu_sizeP, char* sduP)
* \brief Function for RRC to send a SDU through a Signalling Radio Bearer.
......@@ -485,7 +497,11 @@ public_rlc_mac(tbs_size_t mac_rlc_data_req (const module_id_t, co
* \param[in] crcs Array of CRC decoding.
*/
public_rlc_mac(void mac_rlc_data_ind (const module_id_t, const rnti_t, const eNB_index_t,const frame_t, const eNB_flag_t, const MBMS_flag_t, logical_chan_id_t, char*, tb_size_t, num_tb_t,
crc_t* );)
crc_t*
#ifdef Rel14
, sl_reset_rlc_flag_t
#endif
);)
/*! \fn mac_rlc_status_resp_t mac_rlc_status_ind (const module_id_t mod_idP, const rnti_t rntiP, const frame_t frameP, const sub_frame_t subframeP, const eNB_flag_t eNB_flagP, const MBMS_flag_t MBMS_flagP, logical_chan_id_t rb_idP, tb_size_t tb_sizeP)
* \brief Interface with MAC layer, request and set the number of bytes scheduled for transmission by the RLC instance corresponding to the radio bearer identifier.
......
......@@ -232,7 +232,11 @@ void mac_rlc_data_ind (
char *buffer_pP,
const tb_size_t tb_sizeP,
num_tb_t num_tbP,
crc_t *crcs_pP)
crc_t *crcs_pP
#ifdef Rel14
, sl_reset_rlc_flag_t sl_reset_rlc_flag
#endif
)
{
//-----------------------------------------------------------------------------
rlc_mode_t rlc_mode = RLC_MODE_NONE;
......@@ -296,7 +300,11 @@ void mac_rlc_data_ind (
break;
case RLC_MODE_UM:
rlc_um_mac_data_indication(&ctxt, &rlc_union_p->rlc.um, data_ind);
rlc_um_mac_data_indication(&ctxt, &rlc_union_p->rlc.um, data_ind
#ifdef Rel14
,sl_reset_rlc_flag
#endif
);
break;
case RLC_MODE_TM:
......
......@@ -397,12 +397,19 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
if (drb2release_listP != NULL) {
for (cnt=0; cnt<drb2release_listP->list.count; cnt++) {
pdrb_id = drb2release_listP->list.array[cnt];
drb_id = drb2release_listP->list.array[cnt];
LOG_I(RLC, "Releasing rb_id %d\n",drb_id);
rrc_rlc_remove_rlc(
ctxt_pP,
SRB_FLAG_NO,
MBMS_FLAG_NO,
*pdrb_id);
drb_id
#ifdef Rel14
,sourceL2Id,
destinationL2Id
#endif
);
}
}
......@@ -526,14 +533,22 @@ rlc_op_status_t rrc_rlc_remove_ue (
rrc_rlc_remove_rlc(ctxt_pP,
SRB_FLAG_YES,
MBMS_FLAG_NO,
rb_id);
rb_id
#ifdef Rel14
,0, 0
#endif
);
}
for (rb_id = 1; rb_id <= maxDRB; rb_id++) {
rrc_rlc_remove_rlc(ctxt_pP,
SRB_FLAG_NO,
MBMS_FLAG_NO,
rb_id);
rb_id
#ifdef Rel14
,0, 0
#endif
);
}
return RLC_OP_STATUS_OK;
......@@ -544,7 +559,12 @@ rlc_op_status_t rrc_rlc_remove_rlc (
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
const MBMS_flag_t MBMS_flagP,
const rb_id_t rb_idP)
const rb_id_t rb_idP
#ifdef Rel14
,const uint32_t sourceL2Id
,const uint32_t destinationL2Id
#endif
)
{
//-----------------------------------------------------------------------------
logical_chan_id_t lcid = 0;
......@@ -579,10 +599,13 @@ rlc_op_status_t rrc_rlc_remove_rlc (
}
key = RLC_COLL_KEY_MBMS_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, mbms_id_p->service_id, mbms_id_p->session_id);
}
if ((sourceL2Id > 0) && (destinationL2Id > 0) ){
key = RLC_COLL_KEY_SOURCE_DEST_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, sourceL2Id, destinationL2Id, srb_flagP);
} else
#endif
{
key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
}
......@@ -591,24 +614,31 @@ rlc_op_status_t rrc_rlc_remove_rlc (
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
if (h_rc == HASH_TABLE_OK) {
// also remove the hash-key created by LC-id
switch (rlc_union_p->mode) {
case RLC_MODE_AM:
lcid = rlc_union_p->rlc.am.channel_id;
break;
case RLC_MODE_UM:
lcid = rlc_union_p->rlc.um.channel_id;
break;
case RLC_MODE_TM:
lcid = rlc_union_p->rlc.tm.channel_id;
break;
default:
LOG_E(RLC, PROTOCOL_CTXT_FMT"[%s %u] RLC mode is unknown!\n",
PROTOCOL_CTXT_ARGS(ctxt_pP),
(srb_flagP) ? "SRB" : "DRB",
rb_idP);
// also remove the hash-key created by LC-id
switch (rlc_union_p->mode) {
case RLC_MODE_AM:
lcid = rlc_union_p->rlc.am.channel_id;
break;
case RLC_MODE_UM:
lcid = rlc_union_p->rlc.um.channel_id;
break;
case RLC_MODE_TM:
lcid = rlc_union_p->rlc.tm.channel_id;
break;
default:
LOG_E(RLC, PROTOCOL_CTXT_FMT"[%s %u] RLC mode is unknown!\n",
PROTOCOL_CTXT_ARGS(ctxt_pP),
(srb_flagP) ? "SRB" : "DRB",
rb_idP);
}
#ifdef Rel14
if ((sourceL2Id > 0) && (destinationL2Id > 0) ){
key_lcid = RLC_COLL_KEY_LCID_SOURCE_DEST_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, lcid, sourceL2Id, destinationL2Id, srb_flagP);
} else
#endif
{
key_lcid = RLC_COLL_KEY_LCID_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, lcid, srb_flagP);
}
key_lcid = RLC_COLL_KEY_LCID_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, lcid, srb_flagP);
h_lcid_rc = hashtable_get(rlc_coll_p, key_lcid, (void**)&rlc_union_p);
} else {
h_lcid_rc = HASH_TABLE_KEY_NOT_EXISTS;
......@@ -617,13 +647,13 @@ rlc_op_status_t rrc_rlc_remove_rlc (
if ((h_rc == HASH_TABLE_OK) && (h_lcid_rc == HASH_TABLE_OK)) {
h_lcid_rc = hashtable_remove(rlc_coll_p, key_lcid);
h_rc = hashtable_remove(rlc_coll_p, key);
LOG_D(RLC, PROTOCOL_CTXT_FMT"[%s %u LCID %d] RELEASED %s\n",
LOG_I(RLC, PROTOCOL_CTXT_FMT"[%s %u LCID %d] RELEASED %s\n",
PROTOCOL_CTXT_ARGS(ctxt_pP),
(srb_flagP) ? "SRB" : "DRB",
rb_idP, lcid,
(srb_flagP) ? "SRB" : "DRB");
} else if ((h_rc == HASH_TABLE_KEY_NOT_EXISTS) || (h_lcid_rc == HASH_TABLE_KEY_NOT_EXISTS)) {
LOG_D(RLC, PROTOCOL_CTXT_FMT"[%s %u LCID %d] RELEASE : RLC NOT FOUND %s, by RB-ID=%d, by LC-ID=%d\n",
LOG_I(RLC, PROTOCOL_CTXT_FMT"[%s %u LCID %d] RELEASE : RLC NOT FOUND %s, by RB-ID=%d, by LC-ID=%d\n",
PROTOCOL_CTXT_ARGS(ctxt_pP),
(srb_flagP) ? "SRB" : "DRB",
rb_idP, lcid,
......@@ -762,7 +792,12 @@ rlc_op_status_t rrc_rlc_config_req (
const MBMS_flag_t mbms_flagP,
const config_action_t actionP,
const rb_id_t rb_idP,
const rlc_info_t rlc_infoP)
const rlc_info_t rlc_infoP
#ifdef Rel14
,const uint32_t sourceL2Id
,const uint32_t destinationL2Id
#endif
)
{
//-----------------------------------------------------------------------------
//rlc_op_status_t status;
......@@ -829,7 +864,12 @@ rlc_op_status_t rrc_rlc_config_req (
break;
case CONFIG_ACTION_REMOVE:
return rrc_rlc_remove_rlc(ctxt_pP, srb_flagP, mbms_flagP, rb_idP);
return rrc_rlc_remove_rlc(ctxt_pP, srb_flagP, mbms_flagP, rb_idP
#ifdef Rel14
,sourceL2Id
,destinationL2Id
#endif
);
break;
default:
......
......@@ -654,6 +654,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
sib18_part = CALLOC(1,sizeof(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
sib19_part = CALLOC(1,sizeof(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
//sib21_part = CALLOC(1,sizeof(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
memset(sib18_part,0,sizeof(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
memset(sib19_part,0,sizeof(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
//memset(sib21_part,0,sizeof(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
......@@ -666,8 +667,6 @@ uint8_t do_SIB23(uint8_t Mod_id,
*sib19 = &sib19_part->choice.sib19_v1250;
//*sib21 = &sib19_part->choice.sib21_v14x0;
// sib2
(*sib2)->ac_BarringInfo = NULL;
......@@ -1328,7 +1327,6 @@ uint8_t do_SIB23(uint8_t Mod_id,
//end SIB19
bcch_message->message.present = BCCH_DL_SCH_MessageType_PR_c1;
bcch_message->message.choice.c1.present = BCCH_DL_SCH_MessageType__c1_PR_systemInformation;
......@@ -1360,7 +1358,6 @@ uint8_t do_SIB23(uint8_t Mod_id,
//ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib21_part);
#ifdef XER_PRINT
xer_fprint(stdout, &asn_DEF_BCCH_DL_SCH_Message, (void*)bcch_message);
#endif
......
......@@ -82,13 +82,15 @@
#define DIRECT_COMMUNICATION_ESTABLISH_RSP 6
#define GROUP_COMMUNICATION_RELEASE_REQ 7
#define GROUP_COMMUNICATION_RELEASE_RSP 8
#define PC5S_ESTABLISH_REQ 9
#define PC5S_ESTABLISH_RSP 10
#define PC5_DISCOVERY_MESSAGE 11
#define PC5_DISCOVERY_PAYLOAD_SIZE 29
#define DIRECT_COMMUNICATION_RELEASE_REQ 9
#define DIRECT_COMMUNICATION_RELEASE_RSP 10
#define PC5S_ESTABLISH_REQ 11
#define PC5S_ESTABLISH_RSP 12
#define PC5_DISCOVERY_MESSAGE 13
#define PC5S_RELEASE_REQ 14
#define PC5S_RELEASE_RSP 15
#define PC5_DISCOVERY_PAYLOAD_SIZE 29
typedef enum {
UE_STATE_OFF_NETWORK,
......@@ -131,6 +133,11 @@ struct PC5SEstablishRsp{
uint32_t slrbid_lcid30;
};
typedef enum {
PC5S_RELEASE_OK = 0,
PC5S_RELEASE_FAILURE
} PC5S_Release_Status_t;
//PC5_DISCOVERY MESSAGE
typedef struct {
......@@ -138,6 +145,10 @@ typedef struct {
uint32_t measuredPower;
} __attribute__((__packed__)) PC5DiscoveryMessage ;
typedef enum {
DIRECT_COMMUNICATION_RELEASE_OK = 0,
DIRECT_COMMUNICATION_RELEASE_FAILURE
} Direct_Communication_Status_t;
struct sidelink_ctrl_element {
unsigned short type;
......@@ -145,7 +156,8 @@ struct sidelink_ctrl_element {
struct GroupCommunicationEstablishReq group_comm_establish_req;
struct DirectCommunicationEstablishReq direct_comm_establish_req;
Group_Communication_Status_t group_comm_release_rsp;
//struct DirectCommunicationReleaseReq direct_comm_release_req;
Direct_Communication_Status_t direct_comm_release_rsp;
PC5S_Release_Status_t pc5s_release_rsp;
SL_UE_STATE_t ue_state;
int slrb_id;
struct PC5SEstablishReq pc5s_establish_req;
......@@ -660,7 +672,7 @@ typedef struct {
SystemInformationBlockType18_r12_t *sib18;
SystemInformationBlockType19_r12_t *sib19;
SystemInformationBlockType21_r14_t *sib21;
// End - TTN
SRB_INFO SI;
SRB_INFO Srb0;
uint8_t *paging[NUMBER_OF_UE_MAX];
......@@ -768,8 +780,7 @@ typedef struct UE_RRC_INST_s {
uint32_t groupL2Id;
//current destination
uint32_t destinationL2Id;
//List of destinations
uint32_t destinationList[MAX_NUM_DEST];
SL_INFO sl_info[MAX_NUM_LCID];
//sl_discovery..
SRB_INFO SL_Discovery[NB_CNX_UE];
#endif
......
This diff is collapsed.
......@@ -5603,7 +5603,12 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
MBMS_FLAG_NO,
CONFIG_ACTION_REMOVE,
DRB2LCHAN[i],
Rlc_info_um);
Rlc_info_um
#ifdef Rel14
,0
,0
#endif
);
}
ue_context_pP->ue_context.DRB_active[drb_id] = 0;
......
......@@ -971,16 +971,15 @@ void ue_stub_rx_handler(unsigned int num_bytes, char *rx_buffer) {
wakeup_thread(&UE->timer_mutex,&UE->timer_cond,&UE->instance_cnt_timer,"timer_thread");
break;
case SLSCH:
LOG_I(PHY,"Emulator SFN.SF %d.%d, Got SLSCH packet\n",emulator_absSF/10,emulator_absSF%10);
LOG_I(PHY,"Received %d bytes on UE-UE link for SFN.SF %d.%d, sending SLSCH payload (%d bytes) to MAC\n",num_bytes,
LOG_D(PHY,"Emulator SFN.SF %d.%d, Got SLSCH packet\n",emulator_absSF/10,emulator_absSF%10);
LOG_D(PHY,"Received %d bytes on UE-UE link for SFN.SF %d.%d, sending SLSCH payload (%d bytes) to MAC\n",num_bytes,
pdu->header.absSF/10,pdu->header.absSF%10,
slsch->payload_length);
#ifdef DEBUG_UE_RX
printf("SLSCH:");
for (int i=0;i<sizeof(SLSCH_t);i++) printf("%x ",((uint8_t*)slsch)[i]);
printf("\n");
#endif
int frame = pdu->header.absSF/10;
int subframe = pdu->header.absSF%10;
if (UE->sidelink_l2_emulation == 2) {
......@@ -1001,16 +1000,15 @@ void ue_stub_rx_handler(unsigned int num_bytes, char *rx_buffer) {
break;
case SLDCH:
LOG_I(PHY,"Emulator SFN.SF %d.%d, Got SLDCH packet\n",emulator_absSF/10,emulator_absSF%10);
LOG_I(PHY,"Received %d bytes on UE-UE link for SFN.SF %d.%d, sending SLDCH payload (%d bytes) to MAC\n",num_bytes,
LOG_D(PHY,"Emulator SFN.SF %d.%d, Got SLDCH packet\n",emulator_absSF/10,emulator_absSF%10);
LOG_D(PHY,"Received %d bytes on UE-UE link for SFN.SF %d.%d, sending SLDCH payload (%d bytes) to MAC\n",num_bytes,
pdu->header.absSF/10,pdu->header.absSF%10,
sldch->payload_length);
#ifdef DEBUG_UE_RX
printf("SLDCH:");
for (int i=0;i<sizeof(SLDCH_t);i++) printf("%x ",((uint8_t*)sldch)[i]);
printf("\n");
#endif
ue_send_sl_sdu(0,
0,
pdu->header.absSF/10,
......@@ -1170,7 +1168,6 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) {
//#endif
}
//>>>>>>> Stashed changes
#if UE_TIMING_TRACE
start_meas(&UE->generic_stat);
......
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