Skip to content

Commit 431716f

Browse files
committed
network: split qmi out from network data structure
1 parent eb7fe9c commit 431716f

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

locations/pktplsmobil.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@ networks:
6565
ifname: wwan0
6666
role: uplink
6767
uplink_mode: direct
68-
wwan:
69-
proto: qmi
70-
device: /dev/cdc-wdm0
71-
apn: internet
72-
pdptype: ipv4
7368

7469
- role: tunnel
7570
ifname: ts_wg0
7671
mtu: 1280
7772
prefix: 10.248.17.226/32
7873
wireguard_port: 51820
74+
75+
qmi:
76+
- name: wwan
77+
device: /dev/cdc-wdm0
78+
apn: internet
79+
pdptype: ipv4

roles/cfg_openwrt/templates/common/config/network.j2

+10-9
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,6 @@ config interface '{{ name }}'
8585
{% endif %}
8686
{% endif %}
8787

88-
{% if 'wwan' in network %}
89-
config interface 'wwan'
90-
{% set wwan = network['wwan'] %}
91-
option proto '{{ wwan['proto'] }}'
92-
option device '{{ wwan['device'] }}'
93-
option apn '{{ wwan['apn'] }}'
94-
option pdptype '{{ wwan['pdptype'] }}'
95-
{% endif %}
96-
9788
{% if libnetwork.isPortNeeded(network) | from_json and libnetwork.isBridgeNeeded(network) | from_json %}
9889
config device
9990
option name '{{ libnetwork.getBridgeIfname(network) }}'
@@ -111,3 +102,13 @@ config device '{{ i }}_dev'
111102
option macaddr '{{ mac_override[i] }}'
112103

113104
{% endfor %}
105+
{% if qmi is defined %}
106+
{% for q in qmi %}
107+
config interface '{{ q['name'] }}'
108+
option proto 'qmi'
109+
option device '{{ q['device'] }}'
110+
option apn '{{ q['apn'] }}'
111+
option pdptype '{{ q['pdptype'] }}'
112+
113+
{% endfor %}
114+
{% endif %}

0 commit comments

Comments
 (0)