Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Shweta Shrivastava
openairinterface5G
Commits
86a308bb
Commit
86a308bb
authored
7 years ago
by
knopp
Browse files
Options
Downloads
Patches
Plain Diff
added MAC header handling for TX
parent
5b59872d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openair2/LAYER2/MAC/defs.h
+63
-21
63 additions, 21 deletions
openair2/LAYER2/MAC/defs.h
openair2/LAYER2/MAC/ue_procedures.c
+34
-1
34 additions, 1 deletion
openair2/LAYER2/MAC/ue_procedures.c
with
97 additions
and
22 deletions
openair2/LAYER2/MAC/defs.h
+
63
−
21
View file @
86a308bb
...
@@ -237,31 +237,73 @@ typedef struct {
...
@@ -237,31 +237,73 @@ typedef struct {
}
__attribute__
((
__packed__
))
SCH_SUBHEADER_FIXED
;
}
__attribute__
((
__packed__
))
SCH_SUBHEADER_FIXED
;
// Panos:
/*!\brief MAC subheader long with 24bit DST field */
/*!\brief MAC subheader long with 24bit DST field */
typedef
struct
{
typedef
struct
{
uint8_t
V
:
4
;
//Version number: Possible values "0001", "0010", "0011" based on TS36.321 section 6.2.3.
uint8_t
R0
:
4
;
uint32_t
SRC
:
24
;
//Prose UE source ID. Size 24 bits.
uint8_t
V
:
4
;
//Version number: Possible values "0001", "0010", "0011" based on TS36.321 section 6.2.3.
uint32_t
DST
:
24
;
//Prose UE destination ID. Size 16 or 24 bits.
uint8_t
SRC07
;
//Prose UE source ID. Size 24 bits.
uint8_t
LCID
:
5
;
uint8_t
SRC815
;
//Prose UE source ID. Size 24 bits.
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
SRC1623
;
//Prose UE source ID. Size 24 bits.
uint8_t
F
:
1
;
uint8_t
DST07
;
//Prose UE destination ID. Size 24 bits.
uint8_t
E
:
1
;
uint8_t
DST815
;
//Prose UE destination ID. Size 24 bits.
uint8_t
R
:
1
;
uint8_t
DST1623
;
//Prose UE destination ID. Size 24 bits.
}
__attribute__
((
__packed__
))
SLSCH_SUBHEADER_24_Bit_DST
;
uint8_t
LCID
:
5
;
uint8_t
E
:
1
;
/*!\brief MAC subheader long with 16bit DST field */
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
{
typedef
struct
{
uint8_t
V
:
4
;
//Version number: Possible values "0001", "0010", "0011" based on TS36.321 section 6.2.3.
uint8_t
R0
:
4
;
uint32_t
SRC
:
24
;
//Prose UE source ID. Size 24 bits.
uint8_t
V
:
4
;
//Version number: Possible values "0001", "0010", "0011" based on TS36.321 section 6.2.3.
uint32_t
DST
:
16
;
//Prose UE destination ID. Size 16 or 24 bits.
uint8_t
SRC07
;
//Prose UE source ID. Size 24 bits.
uint8_t
LCID
:
5
;
uint8_t
SRC815
;
//Prose UE source ID. Size 24 bits.
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
SRC1623
;
//Prose UE source ID. Size 24 bits.
uint8_t
F
:
1
;
uint8_t
DST07
;
//Prose UE destination ID. Size 24 bits.
uint8_t
E
:
1
;
uint8_t
DST815
;
//Prose UE destination ID. Size 24 bits.
uint8_t
R
:
1
;
uint8_t
DST1623
;
//Prose UE destination ID. Size 24 bits.
}
__attribute__
((
__packed__
))
SLSCH_SUBHEADER_16_Bit_DST
;
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*/
/*!\brief mac control element: short buffer status report for a specific logical channel group ID*/
typedef
struct
{
typedef
struct
{
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/MAC/ue_procedures.c
+
34
−
1
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_
...
@@ -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
,
MBMS_FLAG_NO
,
3
,
3
,
req
,
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
)
{
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
);
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
;
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
->
rvidx
=
0
;
slsch
->
payload_length
=
TBS
;
slsch
->
payload_length
=
TBS
;
// fill in SLSCH configuration
// fill in SLSCH configuration
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment