Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
6bfe76b0
Commit
6bfe76b0
authored
Oct 12, 2023
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MAC pdu fixes, testing RX patch of rlc/pdcp/sdap
parent
e568b2c8
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
15 deletions
+22
-15
openair1/PHY/NR_TRANSPORT/nr_dci.c
openair1/PHY/NR_TRANSPORT/nr_dci.c
+2
-2
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures_sl.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures_sl.c
+7
-3
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+1
-1
openair2/LAYER2/NR_MAC_UE/nr_ue_sci_slsch.c
openair2/LAYER2/NR_MAC_UE/nr_ue_sci_slsch.c
+5
-2
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
+2
-2
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
+2
-2
openair2/SDAP/nr_sdap/nr_sdap_entity.c
openair2/SDAP/nr_sdap/nr_sdap_entity.c
+3
-3
No files found.
openair1/PHY/NR_TRANSPORT/nr_dci.c
View file @
6bfe76b0
...
@@ -121,7 +121,7 @@ uint32_t nr_generate_dci(PHY_VARS_gNB *gNB, PHY_VARS_NR_UE *ue,
...
@@ -121,7 +121,7 @@ uint32_t nr_generate_dci(PHY_VARS_gNB *gNB, PHY_VARS_NR_UE *ue,
uint32_t
dmrs_length
=
(
n_rb
+
pdcch_pdu_rel15
->
BWPStart
)
*
6
;
//2(QPSK)*3(per RB)*6(REG per CCE)
uint32_t
dmrs_length
=
(
n_rb
+
pdcch_pdu_rel15
->
BWPStart
)
*
6
;
//2(QPSK)*3(per RB)*6(REG per CCE)
uint32_t
encoded_length
=
gNB
?
dci_pdu
->
AggregationLevel
*
108
:
dci_pdu
->
AggregationLevel
*
18
;
//2(QPSK)*9(per RB)*6(REG per CCE)
uint32_t
encoded_length
=
gNB
?
dci_pdu
->
AggregationLevel
*
108
:
dci_pdu
->
AggregationLevel
*
18
;
//2(QPSK)*9(per RB)*6(REG per CCE)
if
(
dci_pdu
->
RNTI
!=
0xFFFF
)
if
(
dci_pdu
->
RNTI
!=
0xFFFF
)
LOG_
D
(
PHY
,
"DL_DCI : rb_offset %d, nb_rb %d, DMRS length per symbol %d
\t
DCI encoded length %d (precoder_granularity %d, reg_mapping %d), Scrambling_Id %d, ScramblingRNTI %x, PayloadSizeBits %d
\n
"
,
LOG_
I
(
PHY
,
"DL_DCI : rb_offset %d, nb_rb %d, DMRS length per symbol %d
\t
DCI encoded length %d (precoder_granularity %d, reg_mapping %d), Scrambling_Id %d, ScramblingRNTI %x, PayloadSizeBits %d
\n
"
,
rb_offset
,
n_rb
,
dmrs_length
,
encoded_length
,
pdcch_pdu_rel15
->
precoderGranularity
,
pdcch_pdu_rel15
->
CceRegMappingType
,
rb_offset
,
n_rb
,
dmrs_length
,
encoded_length
,
pdcch_pdu_rel15
->
precoderGranularity
,
pdcch_pdu_rel15
->
CceRegMappingType
,
dci_pdu
->
ScramblingId
,
dci_pdu
->
ScramblingRNTI
,
dci_pdu
->
PayloadSizeBits
);
dci_pdu
->
ScramblingId
,
dci_pdu
->
ScramblingRNTI
,
dci_pdu
->
PayloadSizeBits
);
dmrs_length
+=
rb_offset
*
6
;
// To accommodate more DMRS symbols in case of rb offset
dmrs_length
+=
rb_offset
*
6
;
// To accommodate more DMRS symbols in case of rb offset
...
@@ -250,7 +250,7 @@ uint32_t nr_generate_dci(PHY_VARS_gNB *gNB, PHY_VARS_NR_UE *ue,
...
@@ -250,7 +250,7 @@ uint32_t nr_generate_dci(PHY_VARS_gNB *gNB, PHY_VARS_NR_UE *ue,
}
// reg_count
}
// reg_count
}
// symbol_idx
}
// symbol_idx
LOG_
D
(
PHY
,
LOG_
I
(
NR_
PHY
,
"DCI: payloadSize = %d | payload = %llx
\n
"
,
"DCI: payloadSize = %d | payload = %llx
\n
"
,
dci_pdu
->
PayloadSizeBits
,
dci_pdu
->
PayloadSizeBits
,
*
(
unsigned
long
long
*
)
dci_pdu
->
Payload
);
*
(
unsigned
long
long
*
)
dci_pdu
->
Payload
);
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures_sl.c
View file @
6bfe76b0
...
@@ -597,17 +597,17 @@ void nr_ue_process_mac_sl_pdu(int module_idP,
...
@@ -597,17 +597,17 @@ void nr_ue_process_mac_sl_pdu(int module_idP,
uint16_t
mac_subheader_len
=
0x0001
;
// default to fixed-length subheader = 1-oct
uint16_t
mac_subheader_len
=
0x0001
;
// default to fixed-length subheader = 1-oct
uint8_t
rx_lcid
=
((
NR_MAC_SUBHEADER_FIXED
*
)
pduP
)
->
LCID
;
uint8_t
rx_lcid
=
((
NR_MAC_SUBHEADER_FIXED
*
)
pduP
)
->
LCID
;
LOG_I
(
NR_MAC
,
"[UE
] LCID %d, PDU length %d
\n
"
,
rx_lcid
,
pdu_len
);
LOG_I
(
NR_MAC
,
"[UE
%x] LCID %d, PDU length %d
\n
"
,
mac
->
src_id
,
rx_lcid
,
pdu_len
);
bool
ret
;
bool
ret
;
switch
(
rx_lcid
){
switch
(
rx_lcid
){
// MAC CE
// MAC CE
case
SL_SCH_LCID_4_19
:
case
SL_SCH_LCID_4_19
:
if
(
!
get_mac_len
(
pduP
,
pdu_len
,
&
mac_len
,
&
mac_subheader_len
))
if
(
!
get_mac_len
(
pduP
,
pdu_len
,
&
mac_len
,
&
mac_subheader_len
))
return
;
return
;
LOG_
D
(
NR_MAC
,
"%4d.%2d : SLSCH -> LCID %d %d bytes
\n
"
,
frame
,
slot
,
rx_lcid
,
mac_len
);
LOG_
I
(
NR_MAC
,
"%4d.%2d : SLSCH -> LCID %d %d bytes
\n
"
,
frame
,
slot
,
rx_lcid
,
mac_len
);
mac_rlc_data_ind
(
module_idP
,
mac_rlc_data_ind
(
module_idP
,
0
,
mac
->
src_id
,
0
,
0
,
frame
,
frame
,
ENB_FLAG_NO
,
ENB_FLAG_NO
,
...
@@ -637,5 +637,9 @@ void nr_ue_process_mac_sl_pdu(int module_idP,
...
@@ -637,5 +637,9 @@ void nr_ue_process_mac_sl_pdu(int module_idP,
LOG_W
(
NR_MAC
,
"Received unsupported SL LCID %d
\n
"
,
rx_lcid
);
LOG_W
(
NR_MAC
,
"Received unsupported SL LCID %d
\n
"
,
rx_lcid
);
break
;
break
;
}
}
pduP
+=
(
mac_subheader_len
+
mac_len
);
pdu_len
-=
(
mac_subheader_len
+
mac_len
);
if
(
pdu_len
<
0
)
LOG_E
(
NR_MAC
,
"[UE %d][%d.%d] nr_ue_process_mac_pdu_sl, residual mac pdu length %d < 0!
\n
"
,
module_idP
,
frame
,
slot
,
pdu_len
);
}
}
}
}
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
6bfe76b0
...
@@ -3320,7 +3320,7 @@ bool nr_ue_sl_pssch_scheduler(NR_UE_MAC_INST_t *mac,
...
@@ -3320,7 +3320,7 @@ bool nr_ue_sl_pssch_scheduler(NR_UE_MAC_INST_t *mac,
start_meas
(
&
mac
->
rlc_data_req
);
start_meas
(
&
mac
->
rlc_data_req
);
sdu_length
=
mac_rlc_data_req
(
0
,
sdu_length
=
mac_rlc_data_req
(
0
,
0
,
mac
->
src_id
,
0
,
0
,
frame
,
frame
,
ENB_FLAG_NO
,
ENB_FLAG_NO
,
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_sci_slsch.c
View file @
6bfe76b0
...
@@ -210,6 +210,8 @@ void fill_pssch_pscch_pdu(sl_nr_tx_config_pscch_pssch_pdu_t *nr_sl_pssch_pscch_p
...
@@ -210,6 +210,8 @@ void fill_pssch_pscch_pdu(sl_nr_tx_config_pscch_pssch_pdu_t *nr_sl_pssch_pscch_p
int
sci_size
=
nr_sl_pssch_pscch_pdu
->
pscch_sci_payload_len
;
int
sci_size
=
nr_sl_pssch_pscch_pdu
->
pscch_sci_payload_len
;
int
sci2_size
=
nr_sl_pssch_pscch_pdu
->
sci2_payload_len
;
int
sci2_size
=
nr_sl_pssch_pscch_pdu
->
sci2_payload_len
;
*
sci_payload
=
0
;
*
sci2_payload
=
0
;
// freq domain allocation starts
// freq domain allocation starts
nr_sl_pssch_pscch_pdu
->
startrb
=*
sl_res_pool
->
sl_StartRB_Subchannel_r16
;
nr_sl_pssch_pscch_pdu
->
startrb
=*
sl_res_pool
->
sl_StartRB_Subchannel_r16
;
...
@@ -280,7 +282,7 @@ void fill_pssch_pscch_pdu(sl_nr_tx_config_pscch_pssch_pdu_t *nr_sl_pssch_pscch_p
...
@@ -280,7 +282,7 @@ void fill_pssch_pscch_pdu(sl_nr_tx_config_pscch_pssch_pdu_t *nr_sl_pssch_pscch_p
*
sci_payload
|=
(((
uint64_t
)
sci_pdu
->
resource_reservation_period
.
val
>>
(
fsize
-
i
-
1
))
&
1
)
<<
(
sci_size
-
pos
++
-
1
);
*
sci_payload
|=
(((
uint64_t
)
sci_pdu
->
resource_reservation_period
.
val
>>
(
fsize
-
i
-
1
))
&
1
)
<<
(
sci_size
-
pos
++
-
1
);
// DMRS pattern
// DMRS pattern
fsize
=
sci_pdu
->
dmrs_pattern
.
nbits
;
fsize
=
sci_pdu
->
dmrs_pattern
.
nbits
;
LOG_
D
(
NR_MAC
,
"SCI1A: dmrs_pattern (%d,%d) in position %d
\n
"
,
sci_pdu
->
dmrs_pattern
.
val
,
fsize
,
pos
);
LOG_
I
(
NR_MAC
,
"SCI1A: dmrs_pattern (%d,%d) in position %d
\n
"
,
sci_pdu
->
dmrs_pattern
.
val
,
fsize
,
pos
);
for
(
int
i
=
0
;
i
<
fsize
;
i
++
)
for
(
int
i
=
0
;
i
<
fsize
;
i
++
)
*
sci_payload
|=
(((
uint64_t
)
sci_pdu
->
dmrs_pattern
.
val
>>
(
fsize
-
i
-
1
))
&
1
)
<<
(
sci_size
-
pos
++
-
1
);
*
sci_payload
|=
(((
uint64_t
)
sci_pdu
->
dmrs_pattern
.
val
>>
(
fsize
-
i
-
1
))
&
1
)
<<
(
sci_size
-
pos
++
-
1
);
// second_stage_sci_format // 2 bits - Table 8.3.1.1-1
// second_stage_sci_format // 2 bits - Table 8.3.1.1-1
...
@@ -323,6 +325,7 @@ void fill_pssch_pscch_pdu(sl_nr_tx_config_pscch_pssch_pdu_t *nr_sl_pssch_pscch_p
...
@@ -323,6 +325,7 @@ void fill_pssch_pscch_pdu(sl_nr_tx_config_pscch_pssch_pdu_t *nr_sl_pssch_pscch_p
AssertFatal
(
1
==
0
,
"Unknown format1 %d
\n
"
,
format1
);
AssertFatal
(
1
==
0
,
"Unknown format1 %d
\n
"
,
format1
);
break
;
break
;
}
}
LOG_D
(
NR_MAC
,
"SCI1 payload : %x
\n
"
,
*
sci_payload
);
int
mcs_tb_ind
=
0
;
int
mcs_tb_ind
=
0
;
if
(
sci_pdu
->
additional_mcs
.
nbits
>
0
)
if
(
sci_pdu
->
additional_mcs
.
nbits
>
0
)
...
@@ -352,7 +355,7 @@ void fill_pssch_pscch_pdu(sl_nr_tx_config_pscch_pssch_pdu_t *nr_sl_pssch_pscch_p
...
@@ -352,7 +355,7 @@ void fill_pssch_pscch_pdu(sl_nr_tx_config_pscch_pssch_pdu_t *nr_sl_pssch_pscch_p
N_RE
,
1
+
(
sci_pdu
->
number_of_dmrs_port
&
1
))
>>
3
;
N_RE
,
1
+
(
sci_pdu
->
number_of_dmrs_port
&
1
))
>>
3
;
nr_sl_pssch_pscch_pdu
->
mcs
=
sci_pdu
->
mcs
;
nr_sl_pssch_pscch_pdu
->
mcs
=
sci_pdu
->
mcs
;
nr_sl_pssch_pscch_pdu
->
num_layers
=
sci_pdu
->
number_of_dmrs_port
+
1
;
nr_sl_pssch_pscch_pdu
->
num_layers
=
sci_pdu
->
number_of_dmrs_port
+
1
;
LOG_
D
(
NR_MAC
,
"PSSCH: mcs %d, coderate %d, Nl %d => tbs %d
\n
"
,
sci_pdu
->
mcs
,
nr_sl_pssch_pscch_pdu
->
target_coderate
,
nr_sl_pssch_pscch_pdu
->
num_layers
,
nr_sl_pssch_pscch_pdu
->
tb_size
);
LOG_
I
(
NR_MAC
,
"PSSCH: mcs %d, coderate %d, Nl %d => tbs %d
\n
"
,
sci_pdu
->
mcs
,
nr_sl_pssch_pscch_pdu
->
target_coderate
,
nr_sl_pssch_pscch_pdu
->
num_layers
,
nr_sl_pssch_pscch_pdu
->
tb_size
);
nr_sl_pssch_pscch_pdu
->
tbslbrm
=
nr_compute_tbslbrm
(
mcs_tb_ind
,
NRRIV2BW
(
sl_bwp
->
sl_BWP_Generic_r16
->
sl_BWP_r16
->
locationAndBandwidth
,
273
),
nr_sl_pssch_pscch_pdu
->
num_layers
);
nr_sl_pssch_pscch_pdu
->
tbslbrm
=
nr_compute_tbslbrm
(
mcs_tb_ind
,
NRRIV2BW
(
sl_bwp
->
sl_BWP_Generic_r16
->
sl_BWP_r16
->
locationAndBandwidth
,
273
),
nr_sl_pssch_pscch_pdu
->
num_layers
);
nr_sl_pssch_pscch_pdu
->
mcs_table
=
mcs_tb_ind
;
nr_sl_pssch_pscch_pdu
->
mcs_table
=
mcs_tb_ind
;
nr_sl_pssch_pscch_pdu
->
rv_index
=
sci2_pdu
->
rv_index
;
nr_sl_pssch_pscch_pdu
->
rv_index
=
sci2_pdu
->
rv_index
;
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
View file @
6bfe76b0
...
@@ -635,7 +635,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
...
@@ -635,7 +635,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
int
i
;
int
i
;
if
(
IS_SOFTMODEM_NOS1
||
UE_NAS_USE_TUN
)
{
if
(
IS_SOFTMODEM_NOS1
||
UE_NAS_USE_TUN
)
{
LOG_
D
(
PDCP
,
"IP packet received with size %d, to be sent to SDAP interface, UE ID/RNTI: %ld
\n
"
,
size
,
ue
->
rntiMaybeUEid
);
LOG_
I
(
PDCP
,
"IP packet received with size %d, to be sent to SDAP interface, UE ID/RNTI: %ld
\n
"
,
size
,
ue
->
rntiMaybeUEid
);
sdap_data_ind
(
entity
->
rb_id
,
entity
->
is_gnb
,
entity
->
has_sdap_rx
,
entity
->
pdusession_id
,
ue
->
rntiMaybeUEid
,
buf
,
size
);
sdap_data_ind
(
entity
->
rb_id
,
entity
->
is_gnb
,
entity
->
has_sdap_rx
,
entity
->
pdusession_id
,
ue
->
rntiMaybeUEid
,
buf
,
size
);
}
}
else
{
else
{
...
@@ -685,7 +685,7 @@ static void deliver_pdu_drb(void *deliver_pdu_data, ue_id_t ue_id, int rb_id,
...
@@ -685,7 +685,7 @@ static void deliver_pdu_drb(void *deliver_pdu_data, ue_id_t ue_id, int rb_id,
}
else
{
}
else
{
mem_block_t
*
memblock
=
get_free_mem_block
(
size
,
__FUNCTION__
);
mem_block_t
*
memblock
=
get_free_mem_block
(
size
,
__FUNCTION__
);
memcpy
(
memblock
->
data
,
buf
,
size
);
memcpy
(
memblock
->
data
,
buf
,
size
);
LOG_
D
(
PDCP
,
"%s(): (drb %d) calling rlc_data_req size %d
\n
"
,
__func__
,
rb_id
,
size
);
LOG_
I
(
PDCP
,
"%s(): (drb %d) calling rlc_data_req size %d
\n
"
,
__func__
,
rb_id
,
size
);
//for (i = 0; i < size; i++) printf(" %2.2x", (unsigned char)memblock->data[i]);
//for (i = 0; i < size; i++) printf(" %2.2x", (unsigned char)memblock->data[i]);
//printf("\n");
//printf("\n");
enqueue_rlc_data_req
(
&
ctxt
,
0
,
MBMS_FLAG_NO
,
rb_id
,
sdu_id
,
0
,
size
,
memblock
);
enqueue_rlc_data_req
(
&
ctxt
,
0
,
MBMS_FLAG_NO
,
rb_id
,
sdu_id
,
0
,
size
,
memblock
);
...
...
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
View file @
6bfe76b0
...
@@ -93,7 +93,7 @@ void mac_rlc_data_ind (
...
@@ -93,7 +93,7 @@ void mac_rlc_data_ind (
}
}
if
(
rb
!=
NULL
)
{
if
(
rb
!=
NULL
)
{
LOG_D
(
RLC
,
"RB found! (channel ID %d)
\n
"
,
channel_idP
);
LOG_I
(
RLC
,
"RB found! (channel ID %d)
\n
"
,
channel_idP
);
rb
->
set_time
(
rb
,
nr_rlc_current_time
);
rb
->
set_time
(
rb
,
nr_rlc_current_time
);
rb
->
recv_pdu
(
rb
,
buffer_pP
,
tb_sizeP
);
rb
->
recv_pdu
(
rb
,
buffer_pP
,
tb_sizeP
);
}
else
{
}
else
{
...
@@ -483,7 +483,7 @@ rb_found:
...
@@ -483,7 +483,7 @@ rb_found:
exit
(
1
);
exit
(
1
);
}
}
memcpy
(
memblock
->
data
,
buf
,
size
);
memcpy
(
memblock
->
data
,
buf
,
size
);
LOG_
D
(
PDCP
,
"Calling PDCP layer from RLC in %s
\n
"
,
__FUNCTION__
);
LOG_
I
(
PDCP
,
"Calling PDCP layer from RLC in %s
\n
"
,
__FUNCTION__
);
if
(
!
pdcp_data_ind
(
&
ctx
,
is_srb
,
0
,
rb_id
,
size
,
memblock
,
NULL
,
NULL
))
{
if
(
!
pdcp_data_ind
(
&
ctx
,
is_srb
,
0
,
rb_id
,
size
,
memblock
,
NULL
,
NULL
))
{
LOG_E
(
RLC
,
"%s:%d:%s: ERROR: pdcp_data_ind failed
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
LOG_E
(
RLC
,
"%s:%d:%s: ERROR: pdcp_data_ind failed
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
/* what to do in case of failure? for the moment: nothing */
/* what to do in case of failure? for the moment: nothing */
...
...
openair2/SDAP/nr_sdap/nr_sdap_entity.c
View file @
6bfe76b0
...
@@ -301,9 +301,9 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
...
@@ -301,9 +301,9 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
*/
*/
extern
int
nas_sock_fd
[];
extern
int
nas_sock_fd
[];
int
len
=
write
(
nas_sock_fd
[
0
],
&
buf
[
offset
],
size
-
offset
);
int
len
=
write
(
nas_sock_fd
[
0
],
&
buf
[
offset
],
size
-
offset
);
LOG_
D
(
SDAP
,
"RX Entity len : %d
\n
"
,
len
);
LOG_
I
(
SDAP
,
"RX Entity len : %d
\n
"
,
len
);
LOG_
D
(
SDAP
,
"RX Entity size : %d
\n
"
,
size
);
LOG_
I
(
SDAP
,
"RX Entity size : %d
\n
"
,
size
);
LOG_
D
(
SDAP
,
"RX Entity offset : %d
\n
"
,
offset
);
LOG_
I
(
SDAP
,
"RX Entity offset : %d
\n
"
,
offset
);
if
(
len
!=
size
-
offset
)
if
(
len
!=
size
-
offset
)
LOG_E
(
SDAP
,
"%s:%d:%s: fatal
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
LOG_E
(
SDAP
,
"%s:%d:%s: fatal
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment