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
alex037yang
OpenXG-RAN
Commits
86a308bb
Commit
86a308bb
authored
Jan 03, 2018
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added MAC header handling for TX
parent
5b59872d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
22 deletions
+97
-22
openair2/LAYER2/MAC/defs.h
openair2/LAYER2/MAC/defs.h
+63
-21
openair2/LAYER2/MAC/ue_procedures.c
openair2/LAYER2/MAC/ue_procedures.c
+34
-1
No files found.
openair2/LAYER2/MAC/defs.h
View file @
86a308bb
...
...
@@ -237,31 +237,73 @@ typedef struct {
}
__attribute__
((
__packed__
))
SCH_SUBHEADER_FIXED
;
// Panos:
/*!\brief MAC subheader long with 24bit DST field */
typedef
struct
{
uint8_t
V
:
4
;
//Version number: Possible values "0001", "0010", "0011" based on TS36.321 section 6.2.3.
uint32_t
SRC
:
24
;
//Prose UE source ID. Size 24 bits.
uint32_t
DST
:
24
;
//Prose UE destination ID. Size 16 or 24 bits.
uint8_t
LCID
:
5
;
uint8_t
L
:
7
;
// Length field indicating the size of the corresponding SDU in byes. Not sure about the size of this field (7).
uint8_t
F
:
1
;
uint8_t
E
:
1
;
uint8_t
R
:
1
;
}
__attribute__
((
__packed__
))
SLSCH_SUBHEADER_24_Bit_DST
;
/*!\brief MAC subheader long with 16bit DST field */
uint8_t
R0
:
4
;
uint8_t
V
:
4
;
//Version number: Possible values "0001", "0010", "0011" based on TS36.321 section 6.2.3.
uint8_t
SRC07
;
//Prose UE source ID. Size 24 bits.
uint8_t
SRC815
;
//Prose UE source ID. Size 24 bits.
uint8_t
SRC1623
;
//Prose UE source ID. Size 24 bits.
uint8_t
DST07
;
//Prose UE destination ID. Size 24 bits.
uint8_t
DST815
;
//Prose UE destination ID. Size 24 bits.
uint8_t
DST1623
;
//Prose UE destination ID. Size 24 bits.
uint8_t
LCID
:
5
;
uint8_t
E
:
1
;
uint8_t
R1
:
2
;
uint8_t
L
:
7
;
// Length field indicating the size of the corresponding SDU in bytes.
uint8_t
F
:
1
;
}
__attribute__
((
__packed__
))
SLSCH_SUBHEADER_24_Bit_DST_SHORT
;
/*!\brief MAC subheader long with 24bit DST field */
typedef
struct
{
uint8_t
V
:
4
;
//Version number: Possible values "0001", "0010", "0011" based on TS36.321 section 6.2.3.
uint32_t
SRC
:
24
;
//Prose UE source ID. Size 24 bits.
uint32_t
DST
:
16
;
//Prose UE destination ID. Size 16 or 24 bits.
uint8_t
LCID
:
5
;
uint8_t
L
:
7
;
// Length field indicating the size of the corresponding SDU in byes. Not sure about the size of this field (7).
uint8_t
F
:
1
;
uint8_t
E
:
1
;
uint8_t
R
:
1
;
}
__attribute__
((
__packed__
))
SLSCH_SUBHEADER_16_Bit_DST
;
uint8_t
R0
:
4
;
uint8_t
V
:
4
;
//Version number: Possible values "0001", "0010", "0011" based on TS36.321 section 6.2.3.
uint8_t
SRC07
;
//Prose UE source ID. Size 24 bits.
uint8_t
SRC815
;
//Prose UE source ID. Size 24 bits.
uint8_t
SRC1623
;
//Prose UE source ID. Size 24 bits.
uint8_t
DST07
;
//Prose UE destination ID. Size 24 bits.
uint8_t
DST815
;
//Prose UE destination ID. Size 24 bits.
uint8_t
DST1623
;
//Prose UE destination ID. Size 24 bits.
uint8_t
LCID
:
5
;
uint8_t
E
:
1
;
uint8_t
R1
:
2
;
uint8_t
L_MSB
:
7
;
// Length field indicating the size of the corresponding SDU in bytes.
uint8_t
F
:
1
;
uint8_t
L_LSB
:
8
;
}
__attribute__
((
__packed__
))
SLSCH_SUBHEADER_24_Bit_DST_LONG
;
/*!\brief MAC subheader long with 24bit DST field */
typedef
struct
{
uint8_t
R0
:
4
;
uint8_t
V
:
4
;
//Version number: Possible values "0001", "0010", "0011" based on TS36.321 section 6.2.3.
uint8_t
SRC07
;
//Prose UE source ID. Size 24 bits.
uint8_t
SRC815
;
//Prose UE source ID. Size 24 bits.
uint8_t
DST07
;
//Prose UE destination ID. Size 16 bits.
uint8_t
DST815
;
//Prose UE destination ID. Size 16 bits.
uint8_t
LCID
:
5
;
uint8_t
E
:
1
;
uint8_t
R1
:
2
;
uint8_t
L
:
7
;
// Length field indicating the size of the corresponding SDU in bytes.
uint8_t
F
:
1
;
}
__attribute__
((
__packed__
))
SLSCH_SUBHEADER_16_Bit_DST_SHORT
;
/*!\brief MAC subheader long with 24bit DST field */
typedef
struct
{
uint8_t
R0
:
4
;
uint8_t
V
:
4
;
//Version number: Possible values "0001", "0010", "0011" based on TS36.321 section 6.2.3.
uint8_t
SRC07
;
//Prose UE source ID. Size 24 bits.
uint8_t
SRC815
;
//Prose UE source ID. Size 24 bits.
uint8_t
SRC1623
;
//Prose UE source ID. Size 24 bits.
uint8_t
DST07
;
//Prose UE destination ID. Size 16 bits.
uint8_t
DST815
;
//Prose UE destination ID. Size 16 bits.
uint8_t
LCID
:
5
;
uint8_t
E
:
1
;
uint8_t
R1
:
2
;
uint8_t
L_MSB
:
7
;
// Length field indicating the size of the corresponding SDU in bytes.
uint8_t
F
:
1
;
uint8_t
L_LSB
:
8
;
}
__attribute__
((
__packed__
))
SLSCH_SUBHEADER_16_Bit_DST_LONG
;
/*!\brief mac control element: short buffer status report for a specific logical channel group ID*/
typedef
struct
{
...
...
openair2/LAYER2/MAC/ue_procedures.c
View file @
86a308bb
...
...
@@ -2724,11 +2724,44 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
MBMS_FLAG_NO
,
3
,
req
,
(
char
*
)
ue
->
slsch_pdu
.
payload
);
(
char
*
)
(
ue
->
slsch_pdu
.
payload
+
sizeof
(
SLSCH_SUBHEADER_24_Bit_DST_LONG
))
);
// Notes: 1. hard-coded to 24-bit destination format for now
// 2. LCID hard-coded to 3
// 3. SRC/DST IDs with debug values
if
(
sdu_length
>
0
)
{
LOG_I
(
MAC
,
"SFN.SF %d.%d : got %d bytes from Sidelink buffer (%d requested)
\n
"
,
frameP
,
subframeP
,
sdu_length
,
req
);
slsch
->
payload
=
(
unsigned
char
*
)
ue
->
slsch_pdu
.
payload
;
if
(
sdu_length
<
128
)
{
slsch
->
payload
++
;
SLSCH_SUBHEADER_24_Bit_DST_SHORT
*
shorth
=
(
SLSCH_SUBHEADER_24_Bit_DST_SHORT
*
)
slsch
->
payload
;
shorth
->
F
=
0
;
shorth
->
L
=
sdu_length
;
shorth
->
E
=
1
;
shorth
->
LCID
=
3
;
shorth
->
SRC07
=
0x12
;
shorth
->
SRC815
=
0x34
;
shorth
->
SRC1623
=
0x56
;
shorth
->
DST07
=
0x78
;
shorth
->
DST815
=
0x9A
;
shorth
->
DST1623
=
0xBC
;
shorth
->
V
=
0x1
;
}
else
{
SLSCH_SUBHEADER_24_Bit_DST_LONG
*
longh
=
(
SLSCH_SUBHEADER_24_Bit_DST_LONG
*
)
slsch
->
payload
;
longh
->
F
=
1
;
longh
->
L_LSB
=
sdu_length
&
0xff
;
longh
->
L_MSB
=
(
sdu_length
>>
8
)
&
0x7f
;
longh
->
E
=
1
;
longh
->
LCID
=
3
;
longh
->
SRC07
=
0x12
;
longh
->
SRC815
=
0x34
;
longh
->
SRC1623
=
0x56
;
longh
->
DST07
=
0x78
;
longh
->
DST815
=
0x9A
;
longh
->
DST1623
=
0xBC
;
longh
->
V
=
0x1
;
}
slsch
->
rvidx
=
0
;
slsch
->
payload_length
=
TBS
;
// fill in SLSCH configuration
...
...
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