Commit c6d705d6 authored by Raymond Knopp's avatar Raymond Knopp

DRB/LCID associations

parent f416f68d
......@@ -3440,9 +3440,11 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
if (absSF<O) return((SLSCH_t *)NULL);
absSF_modP = absSF_offset % P;
LOG_D(MAC,"Checking SLSCH for absSF %d\n",absSF);
if (absSF_offset == 0) { // this is the first subframe of PSCCH period, check for data and generate SCI
if (absSF_modP == 0) { // this is the first subframe of PSCCH period, check for data and generate SCI
ue->sltx_active = 0;
for (i = 0; i < MAX_NUM_LCID; i++){
if (ue->sl_info[i].LCID > 0) {
......@@ -3450,6 +3452,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
if ((ue->sourceL2Id > 0) && (ue->sl_info[i].destinationL2Id >0) ){
rlc_status = mac_rlc_status_ind(module_idP, 0x1234,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
ue->sl_info[i].LCID, 0xFFFF, ue->sourceL2Id, ue->sl_info[i].destinationL2Id );
LOG_I(MAC,"absSF_offset %d : Checking status (%d,Dest %d) => LCID %d => %d bytes\n",absSF_offset,ue->sourceL2Id,ue->sl_info[i].destinationL2Id,ue->sl_info[i].LCID,rlc_status.bytes_in_buffer);
if (rlc_status.bytes_in_buffer > 2){
LOG_I(MAC,"SFN.SF %d.%d: Scheduling for %d bytes in Sidelink buffer \n",frameP,subframeP,rlc_status.bytes_in_buffer);
......@@ -3464,8 +3467,9 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
}
if ((ue->sourceL2Id > 0) && (ue->sl_info[i].groupL2Id >0) ){
rlc_status = mac_rlc_status_ind(module_idP, 0x1234,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
rlc_status = mac_rlc_status_ind(module_idP, 0x1234,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
ue->sl_info[i].LCID, 0xFFFF, ue->sourceL2Id, ue->sl_info[i].groupL2Id);
LOG_I(MAC,"Checking status (%d,Group %d) => LCID %d => %d bytes\n",ue->sourceL2Id,ue->sl_info[i].destinationL2Id);
if (rlc_status.bytes_in_buffer > 2){
LOG_I(MAC,"SFN.SF %d.%d: Scheduling for %d bytes in Sidelink buffer\n",frameP,subframeP,rlc_status.bytes_in_buffer);
// Fill in group id for off-network communications
......@@ -3494,6 +3498,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
slsch->timing_advance_indication = 0;
slsch->group_destination_id = ue->destinationL2Id&0xff;
LOG_I(MAC,"Generated SCI with n_pscch %d, RBC %x, TRP %d, mcs %d, groupid %x\n",slsch->n_pscch,slsch->resource_block_coding,slsch->time_resource_pattern,mcs,slsch->group_destination_id);
} // we're in the SCI period
else if (ue->sltx_active == 1) { // every 4th subframe, check for new data from RLC
// 10 PRBs, mcs 19
......
......@@ -760,7 +760,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
if (len<=0) {
// nothing in pdcp NAS socket
//LOG_D(PDCP, "[PDCP][NETLINK] Nothing in socket, length %d \n", len);
LOG_D(PDCP, "[PDCP][NETLINK] Nothing in socket, length %d \n", len);
} else {
msg_len = len;
......
......@@ -289,7 +289,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
continue;
}
LOG_D(RLC, "Adding DRB %ld, lc_id %d\n",drb_id,lc_id);
LOG_I(RLC, "Adding DRB %ld, lc_id %d\n",drb_id,lc_id);
if (drb_toaddmod_p->rlc_Config) {
......
......@@ -57,7 +57,7 @@
ntohs((addr)->s6_addr16[7])
//#define OAI_DRV_DEBUG_SEND
#define OAI_DRV_DEBUG_SEND
//#define OAI_DRV_DEBUG_RECEIVE
void
......@@ -297,19 +297,24 @@ ue_ip_common_ip2wireless(
case 4:
src_addr = (unsigned char *)&((struct iphdr *)&skb_pP->data[hard_header_len])->saddr;
dst_addr = (unsigned char *)&((struct iphdr *)&skb_pP->data[hard_header_len])->daddr;
#ifdef OAI_DRV_DEBUG_SEND
if (src_addr) {
printk("[UE_IP_DRV][%s] Source %d.%d.%d.%d\n",__FUNCTION__, src_addr[0],src_addr[1],src_addr[2],src_addr[3]);
}
dst_addr = (unsigned char *)&((struct iphdr *)&skb_pP->data[hard_header_len])->daddr;
if (dst_addr) {
printk("[UE_IP_DRV][%s] Dest %d.%d.%d.%d\n",__FUNCTION__, dst_addr[0],dst_addr[1],dst_addr[2],dst_addr[3]);
}
printk("[UE_IP_DRV][%s] slrb_id %d\n",__FUNCTION__, pdcph.rb_id);
#endif
//get Ipv4 address and pass to PCDP header
printk("[UE_IP_DRV] source Id: 0x%08x\n",pdcph.sourceL2Id );
printk("[UE_IP_DRV] destinationL2Id Id: 0x%08x\n",pdcph.destinationL2Id );
pdcph.sourceL2Id = ntohl( ((struct iphdr *)&skb_pP->data[hard_header_len])->saddr) & 0x00FFFFFF;
pdcph.destinationL2Id = ntohl( ((struct iphdr *)&skb_pP->data[hard_header_len])->daddr) & 0x00FFFFFF;
#ifdef OAI_DRV_DEBUG_SEND
printk("[UE_IP_DRV] source Id: 0x%08x\n",pdcph.sourceL2Id );
printk("[UE_IP_DRV] destinationL2Id Id: 0x%08x\n",pdcph.destinationL2Id );
#endif
break;
default:
......
......@@ -5755,6 +5755,7 @@ void *rrc_control_socket_thread_fct(void *arg)
//configure MAC with sourceL2Id/groupL2ID
LOG_I(PHY,"Configuration MAC for sourceL2Id/GroupL2ID %d/%d\n",sourceL2Id,groupL2Id);
rrc_mac_config_req_ue(module_id,0,0, //eNB_index =0
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
......@@ -5764,7 +5765,7 @@ void *rrc_control_socket_thread_fct(void *arg)
#endif
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
3, //LCID
UE->DRB_config[0][0]->drb_Identity, //LCID
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
......@@ -6049,7 +6050,7 @@ void *rrc_control_socket_thread_fct(void *arg)
#endif
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
3, //LCID
UE->DRB_config[0][0]->drb_Identity, //LCID
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
......
......@@ -913,6 +913,37 @@ static void *UE_thread_rxn_txnp4(void *arg) {
phy_procedures_UE_SL_RX(UE,proc);
if (UE->SLonly==1 &&
UE->mac_enabled==1) {
ret = ue_scheduler(UE->Mod_id,
proc->frame_rx,
proc->subframe_rx,
proc->frame_tx,
proc->subframe_tx,
subframe_select(&UE->frame_parms,proc->subframe_tx),
0,
0/*FIXME CC_id*/);
if ( ret != CONNECTION_OK) {
char *txt;
switch (ret) {
case CONNECTION_LOST:
txt="RRC Connection lost, returning to PRACH";
break;
case PHY_RESYNCH:
txt="RRC Connection lost, trying to resynch";
break;
case RESYNCH:
txt="return to PRACH and perform a contention-free access";
break;
default:
txt="UNKNOWN RETURN CODE";
}
LOG_E( PHY, "[UE %"PRIu8"] Frame %"PRIu32", subframe %u %s\n",
UE->Mod_id, proc->frame_rx, proc->subframe_tx,txt );
}
}
phy_procedures_UE_SL_TX(UE,proc);
}
......
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