Commit ae1df909 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 89f1ccb3
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
{%- set dev_argv = [] %} {%- set dev_argv = [] %}
{%- set ru_cpri_dict = {} %} {# dev -> ru for ru with link_kind = cpri #} {%- set ru_cpri_dict = {} %} {# dev -> ru for ru with link_kind = cpri #}
{%- for rf_port, (ru_ref, ru) in enumerate(ru_dict|dictsort) %} {%- for rf_port, (ru_ref, ru) in enumerate(ru_dict|dictsort) %}
{%- do ru['.rf_port'] = rf_port %} {%- do ru.update({'.rf_port': rf_port}) %}
{%- if ru['ru_type'] == 'sdr' %} {%- if ru['ru_type'] == 'sdr' %}
XXX move to ru/sdr ? XXX move to ru/sdr ?
{%- for n in ru['dev_list'] %} {%- for n in ru['dev_list'] %}
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
rx_antenna:"tx_rx", XXX -> ru/sdr ? rx_antenna:"tx_rx", XXX -> ru/sdr ?
tdd_tx_mod: 1, tdd_tx_mod: 1,
{%- elif ru['ru_link_type'] == 'cpri' %} {%- elif ru['ru_link_type'] == 'cpri' %}
{%- do ru_cpri_dict[len(dev_argv)] = ru %} {%- do ru_cpri_dict.update({len(dev_argv): ru}) %}
{%- do dev_argv.append("dev%d=/dev/sdr%d@%d" % (len(dev_argv), ru['sdr_dev'], ru['sfp_port'])) %} {%- do dev_argv.append("dev%d=/dev/sdr%d@%d" % (len(dev_argv), ru['sdr_dev'], ru['sfp_port'])) %}
{# set cpri parameters to default #} {# set cpri parameters to default #}
{%- do ru.setdefault('cpri_mapping', 'hw') %} XXX <- should be preset set by ru? (specific to ru?) {%- do ru.setdefault('cpri_mapping', 'hw') %} XXX <- should be preset set by ru? (specific to ru?)
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
{%- if ru_cpri_dict|length > 0 %} {%- if ru_cpri_dict|length > 0 %}
{%- set vcpri = [None]*(dev_argv|length) %} {%- set vcpri = [None]*(dev_argv|length) %}
{%- for dev, ru in ru_cpri_dict|dictsort %} {%- for dev, ru in ru_cpri_dict|dictsort %}
{%- do vcpri[dev] = ru %} {%- do vcpri.__setitem__(dev, ru) %}
{%- endfor %} {%- endfor %}
cpri_mapping: "{{ vcpri | map(attribute='cpri_mapping') | join(',') }}", cpri_mapping: "{{ vcpri | map(attribute='cpri_mapping') | join(',') }}",
cpri_mult: "{{ vcpri | map(attribute='cpri_mult') | join(',') }}", cpri_mult: "{{ vcpri | map(attribute='cpri_mult') | join(',') }}",
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
{%- set tap = "%s-%d" % (tap_base, i) %} {%- set tap = "%s-%d" % (tap_base, i) %}
{%- else %} {%- else %}
{%- set tap = tap_base %} {%- set tap = tap_base %}
{%- do vtap[dev] = tap %} {%- do vtap.__setitem__(dev, tap) %}
{%- endfor %} {%- endfor %}
ifname: "{{ vtap | join(',') }}", ifname: "{{ vtap | join(',') }}",
{%- endif %} {%- endif %}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment