Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rdma-mwe
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
Titouan Soulard
rdma-mwe
Commits
f1384977
Commit
f1384977
authored
Jan 22, 2024
by
Titouan Soulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trx-bridge: implement parameters for start function
parent
65b11aac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
103 additions
and
0 deletions
+103
-0
trx-bridge/bridge.c
trx-bridge/bridge.c
+103
-0
No files found.
trx-bridge/bridge.c
View file @
f1384977
...
...
@@ -16,11 +16,109 @@ int bridge_trx_output_get_param_double(void *app_opaque, double *pval, const cha
return
potoml_toml_get_double
((
struct
PotomlTomlSubset
*
)
app_opaque
,
prop_name
);
}
TRXDriverParams2
*
fill_trx_driver_params
(
struct
PotomlTomlSubset
*
config
)
{
TRXDriverParams2
*
trx_driver_params
=
malloc
(
sizeof
(
TRXDriverParams2
));
int
rxi
,
txi
,
pi
,
ci
;
char
param_name
[
256
];
trx_driver_params
->
rx_channel_count
=
potoml_toml_get_long
(
config
,
"rx_channel_count"
);
trx_driver_params
->
tx_channel_count
=
potoml_toml_get_long
(
config
,
"tx_channel_count"
);
trx_driver_params
->
rf_port_count
=
potoml_toml_get_long
(
config
,
"rf_port_count"
);
trx_driver_params
->
cell_count
=
potoml_toml_get_long
(
config
,
"cell_count"
);
trx_driver_params
->
s72_enable
=
potoml_toml_get_long
(
config
,
"s72_enable"
);
trx_driver_params
->
rx_freq
=
malloc
(
trx_driver_params
->
rx_channel_count
*
sizeof
(
int64_t
));
trx_driver_params
->
rx_gain
=
malloc
(
trx_driver_params
->
rx_channel_count
*
sizeof
(
double
));
trx_driver_params
->
rx_bandwidth
=
malloc
(
trx_driver_params
->
rx_channel_count
*
sizeof
(
int
));
trx_driver_params
->
rx_port_channel_count
=
malloc
(
trx_driver_params
->
rx_channel_count
*
sizeof
(
int
));
for
(
rxi
=
0
;
rxi
<
trx_driver_params
->
rx_channel_count
;
rxi
++
)
{
sprintf
(
param_name
,
"rx%d.freq"
,
rxi
);
trx_driver_params
->
rx_freq
[
rxi
]
=
potoml_toml_get_long
(
config
,
param_name
);
sprintf
(
param_name
,
"rx%d.gain"
,
rxi
);
trx_driver_params
->
rx_gain
[
rxi
]
=
potoml_toml_get_double
(
config
,
param_name
);
sprintf
(
param_name
,
"rx%d.bandwidth"
,
rxi
);
trx_driver_params
->
rx_bandwidth
[
rxi
]
=
potoml_toml_get_long
(
config
,
param_name
);
sprintf
(
param_name
,
"rx%d.port_channel_count"
,
rxi
);
trx_driver_params
->
rx_port_channel_count
[
rxi
]
=
potoml_toml_get_long
(
config
,
param_name
);
}
trx_driver_params
->
tx_freq
=
malloc
(
trx_driver_params
->
tx_channel_count
*
sizeof
(
int64_t
));
trx_driver_params
->
tx_gain
=
malloc
(
trx_driver_params
->
tx_channel_count
*
sizeof
(
double
));
trx_driver_params
->
tx_bandwidth
=
malloc
(
trx_driver_params
->
tx_channel_count
*
sizeof
(
int
));
trx_driver_params
->
tx_port_channel_count
=
malloc
(
trx_driver_params
->
tx_channel_count
*
sizeof
(
int
));
for
(
txi
=
0
;
txi
<
trx_driver_params
->
tx_channel_count
;
txi
++
)
{
sprintf
(
param_name
,
"tx%d.freq"
,
txi
);
trx_driver_params
->
tx_freq
[
txi
]
=
potoml_toml_get_long
(
config
,
param_name
);
sprintf
(
param_name
,
"tx%d.gain"
,
txi
);
trx_driver_params
->
tx_gain
[
txi
]
=
potoml_toml_get_double
(
config
,
param_name
);
sprintf
(
param_name
,
"tx%d.bandwidth"
,
txi
);
trx_driver_params
->
tx_bandwidth
[
txi
]
=
potoml_toml_get_long
(
config
,
param_name
);
sprintf
(
param_name
,
"tx%d.port_channel_count"
,
txi
);
trx_driver_params
->
tx_port_channel_count
[
txi
]
=
potoml_toml_get_long
(
config
,
param_name
);
}
trx_driver_params
->
sample_rate
=
malloc
(
trx_driver_params
->
rf_port_count
*
sizeof
(
TRXFraction
));
for
(
pi
=
0
;
pi
<
trx_driver_params
->
rf_port_count
;
pi
++
)
{
sprintf
(
param_name
,
"port%d.sample_rate_num"
,
pi
);
trx_driver_params
->
sample_rate
[
pi
].
num
=
potoml_toml_get_long
(
config
,
param_name
);
sprintf
(
param_name
,
"port%d.sample_rate_den"
,
pi
);
trx_driver_params
->
sample_rate
[
pi
].
den
=
potoml_toml_get_long
(
config
,
param_name
);
}
trx_driver_params
->
cell_info
=
malloc
(
trx_driver_params
->
cell_count
*
sizeof
(
TRXCellInfo
));
for
(
ci
=
0
;
ci
<
trx_driver_params
->
cell_count
;
ci
++
)
{
sprintf
(
param_name
,
"cell%d.rf_port_index"
,
ci
);
trx_driver_params
->
cell_info
[
ci
].
rf_port_index
=
potoml_toml_get_long
(
config
,
param_name
);
sprintf
(
param_name
,
"cell%d.dl_earfcn"
,
ci
);
trx_driver_params
->
cell_info
[
ci
].
dl_earfcn
=
potoml_toml_get_long
(
config
,
param_name
);
sprintf
(
param_name
,
"cell%d.ul_earfcn"
,
ci
);
trx_driver_params
->
cell_info
[
ci
].
ul_earfcn
=
potoml_toml_get_long
(
config
,
param_name
);
sprintf
(
param_name
,
"cell%d.n_rb_dl"
,
ci
);
trx_driver_params
->
cell_info
[
ci
].
n_rb_dl
=
potoml_toml_get_long
(
config
,
param_name
);
sprintf
(
param_name
,
"cell%d.n_rb_ul"
,
ci
);
trx_driver_params
->
cell_info
[
ci
].
n_rb_ul
=
potoml_toml_get_long
(
config
,
param_name
);
sprintf
(
param_name
,
"cell%d.dl_cyclic_prefix"
,
ci
);
trx_driver_params
->
cell_info
[
ci
].
dl_cyclic_prefix
=
potoml_toml_get_long
(
config
,
param_name
);
sprintf
(
param_name
,
"cell%d.ul_cyclic_prefix"
,
ci
);
trx_driver_params
->
cell_info
[
ci
].
ul_cyclic_prefix
=
potoml_toml_get_long
(
config
,
param_name
);
sprintf
(
param_name
,
"cell%d.type"
,
ci
);
trx_driver_params
->
cell_info
[
ci
].
type
=
potoml_toml_get_long
(
config
,
param_name
);
sprintf
(
param_name
,
"cell%d.tdd.uldl_config"
,
ci
);
trx_driver_params
->
cell_info
[
ci
].
u
.
tdd
.
uldl_config
=
potoml_toml_get_long
(
config
,
param_name
);
sprintf
(
param_name
,
"cell%d.tdd.special_subframe_config"
,
ci
);
trx_driver_params
->
cell_info
[
ci
].
u
.
tdd
.
special_subframe_config
=
potoml_toml_get_long
(
config
,
param_name
);
}
return
trx_driver_params
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
struct
CommonHashtableTable
config
;
struct
PotomlTomlSubset
*
bridge_config
;
struct
PotomlTomlSubset
*
input_driver_config
;
struct
PotomlTomlSubset
*
output_driver_config
;
struct
PotomlTomlSubset
*
output_driver_start_config
;
int
opt
;
int
result
;
...
...
@@ -42,6 +140,7 @@ int main(int argc, char *argv[]) {
TRXState
input_trx_state
;
TRXState
output_trx_state
;
TRXDriverParams2
*
output_trx_start_params
;
// This is used for debugging purposes, and was improvised by nonprofessionals.
// Do not attempt to reproduce it.
...
...
@@ -79,6 +178,7 @@ int main(int argc, char *argv[]) {
bridge_config
=
potoml_toml_create_subset
(
&
config
,
"bridge"
);
input_driver_config
=
potoml_toml_create_subset
(
&
config
,
"input-driver"
);
output_driver_config
=
potoml_toml_create_subset
(
&
config
,
"output-driver"
);
output_driver_start_config
=
potoml_toml_create_subset
(
&
config
,
"output-driver-extra"
);
input_lib_name
=
potoml_toml_get_string
(
bridge_config
,
"input_driver_path"
);
output_lib_name
=
potoml_toml_get_string
(
bridge_config
,
"output_driver_path"
);
...
...
@@ -145,6 +245,9 @@ int main(int argc, char *argv[]) {
return
-
1
;
}
// XXX: genericity should also fill this struct for input
output_trx_start_params
=
fill_trx_driver_params
(
output_driver_start_config
);
dlclose
(
input_lib_handle
);
dlclose
(
output_lib_handle
);
...
...
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