Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
oran
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Cédric Roux
oran
Commits
82235bef
You need to sign in or sign up before continuing.
Commit
82235bef
authored
1 year ago
by
Cédric Roux
Browse files
Options
Downloads
Patches
Plain Diff
save
parent
bd5e1aa1
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
dl.c
+16
-0
16 additions, 0 deletions
dl.c
packetize.c
+3
-12
3 additions, 12 deletions
packetize.c
with
20 additions
and
13 deletions
Makefile
+
1
−
1
View file @
82235bef
...
...
@@ -5,7 +5,7 @@ PROG=oran
OBJS
=
main.o dl.o ul.o shared_buffer.o utils.o nr.o packetize.o
$(PROG)
:
$(OBJS)
$(
CC
)
$(
CFLAGS
)
-o
$(
PROG
)
$(
OBJS
)
$(
CC
)
$(
CFLAGS
)
-o
$(
PROG
)
$(
OBJS
)
-lm
%.o
:
%.c
$(
CC
)
$(
CFLAGS
)
-c
$<
...
...
This diff is collapsed.
Click to expand it.
dl.c
+
16
−
0
View file @
82235bef
...
...
@@ -10,6 +10,9 @@
#include
<errno.h>
/* todo: remove, this is for testing */
#include
<math.h>
#include
"utils.h"
#include
"nr.h"
#include
"packetize.h"
...
...
@@ -112,6 +115,16 @@ void transmit_dl_u_plane(processor_t *p, int frame, int subframe, int slot, int
rb_count
=
100
;
next:
int
v
;
if
(
rb_start
==
100
)
{
v
=
4000
;
}
else
{
v
=
0
;
}
short
*
z
=
(
short
*
)
iq
;
int
pos
=
36
*
12
+
cos
(
2
*
M_PI
*
(
frame
*
10
+
subframe
)
/
(
1024
))
*
100
;
z
[
pos
*
2
]
=
v
;
p
->
st
.
frame
=
frame
;
p
->
st
.
subframe
=
subframe
;
p
->
st
.
slot
=
slot
;
...
...
@@ -130,11 +143,14 @@ next:
addr
.
sll_ifindex
=
p
->
interface_index
;
errno
=
0
;
#if 0
{
printf(" f/sf/slot/symbol %d.%d.%d.%d [%d] (start %3d count %3d next seq %d)", frame, subframe, slot, symbol, len, rb_start, rb_count, p->st.seq_id_up_dl);
for (int i = 0; i < 50; i++) printf(" %2.2x", (unsigned char)b[i]);
printf("\n");
}
#endif
if
(
sendto
(
p
->
socket
,
b
,
len
,
0
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
))
!=
len
)
{
perror
(
"send"
);
}
rb_start
+=
100
;
...
...
This diff is collapsed.
Click to expand it.
packetize.c
+
3
−
12
View file @
82235bef
...
...
@@ -11,7 +11,6 @@
} while (0)
#define PUT_BIT(b) do { \
printf("b %d ret %d bit %d out %p\n", (b), ret, bit, out); \
if (ret == size) { printf("buffer too small\n"); return -1; } \
out[ret] &= ~((1) << (7 - bit)); \
out[ret] |= (b) << (7 - bit); \
...
...
@@ -71,13 +70,7 @@ static int make_cp_uldl(packet_config_t *cfg, packet_state_t *st, char *out, int
data_start
=
ret
;
PUT_BITS
(
cfg
->
eaxc_id_dl
,
16
);
if
(
dl
)
{
PUT_BITS
(
st
->
seq_id_cp_dl
,
8
);
// st->seq_id_cp_dl++;
}
else
{
PUT_BITS
(
st
->
seq_id_cp_ul
,
8
);
// st->seq_id_cp_ul++;
}
PUT_BITS
(
dl
?
st
->
seq_id_cp_dl
:
st
->
seq_id_cp_ul
,
8
);
PUT_BITS
(
1
,
1
);
/* E bit, always 1 */
PUT_BITS
(
0
,
7
);
/* subsequence ID, always 0 */
...
...
@@ -121,7 +114,7 @@ static int make_cp_uldl(packet_config_t *cfg, packet_state_t *st, char *out, int
PUT_BITS
(
0
,
1
);
/* ef = 0 (no extension) */
PUT_BITS
(
0
,
15
);
/* beam id */
/* put payload size
at the right position
*/
/* put payload size */
payload_size
=
ret
-
data_start
;
out_payload_size
[
0
]
=
payload_size
>>
8
;
out_payload_size
[
1
]
=
payload_size
&
255
;
...
...
@@ -146,7 +139,6 @@ void make_cp_prach()
int
make_up_dl
(
packet_config_t
*
cfg
,
packet_state_t
*
st
,
char
*
out
,
int
size
,
char
*
iq
,
int
rb_start
,
int
rb_count
,
int
symbol_id
)
{
printf
(
"make_up_dl start %d count %d
\n
"
,
rb_start
,
rb_count
);
int
ret
=
0
;
int
bit
=
0
;
int
data_start
;
...
...
@@ -173,7 +165,6 @@ printf("make_up_dl start %d count %d\n", rb_start, rb_count);
PUT_BITS
(
cfg
->
eaxc_id_dl
,
16
);
PUT_BITS
(
st
->
seq_id_up_dl
,
8
);
// st->seq_id_up_dl++;
PUT_BITS
(
1
,
1
);
/* E bit, always 1 */
PUT_BITS
(
0
,
7
);
/* subsequence ID, always 0 */
...
...
@@ -208,7 +199,7 @@ printf("make_up_dl start %d count %d\n", rb_start, rb_count);
ret
+=
iq_size
;
/* put payload size
at the right position
*/
/* put payload size */
payload_size
=
ret
-
data_start
;
out_payload_size
[
0
]
=
payload_size
>>
8
;
out_payload_size
[
1
]
=
payload_size
&
255
;
...
...
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