diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-03-10 19:50:00 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-03-28 20:48:32 +0100 |
commit | ced45949bc282d23b0767f698f31b580602f0c9c (patch) | |
tree | fe42a9b240c3cf4c642f4975df358ffbff36aa83 | |
parent | bf628f732acedce1ff1837202627260c6fd4533d (diff) | |
download | vyos-1x-ced45949bc282d23b0767f698f31b580602f0c9c.tar.gz vyos-1x-ced45949bc282d23b0767f698f31b580602f0c9c.zip |
wwan: T1988: add support for Sierra Wireless MC7710 modem
-rw-r--r-- | debian/vyos-1x.install | 1 | ||||
-rwxr-xr-x | src/conf_mode/interfaces-wirelessmodem.py | 11 | ||||
-rw-r--r-- | src/etc/udev/rules.d/99-vyos-wwan.rules | 11 |
3 files changed, 22 insertions, 1 deletions
diff --git a/debian/vyos-1x.install b/debian/vyos-1x.install index 5bb7ea507..5004d111f 100644 --- a/debian/vyos-1x.install +++ b/debian/vyos-1x.install @@ -3,6 +3,7 @@ etc/init.d etc/ppp etc/rsyslog.d etc/systemd +etc/udev etc/vyos lib/ opt/ diff --git a/src/conf_mode/interfaces-wirelessmodem.py b/src/conf_mode/interfaces-wirelessmodem.py index 388d98f4e..93f60d038 100755 --- a/src/conf_mode/interfaces-wirelessmodem.py +++ b/src/conf_mode/interfaces-wirelessmodem.py @@ -32,6 +32,9 @@ config_wwan_tmpl = """### Autogenerated by interfaces-wirelessmodem.py ### # {{ description }} {% endif %} +# physical device +/dev/{{ device }} + ipparam {{ intf }} {{ metric }} {% if on_demand -%} demand @@ -53,6 +56,7 @@ crtscts lock persist + """ default_config_data = { @@ -136,9 +140,14 @@ def get_config(): return wwan def verify(wwan): - if wwan is None: + if wwan['deleted']: return None + # we can not use isfile() here as Linux device files are no regular files + # thus the check will return False + if not os.path.exists(f"/dev/{wwan['device']}"): + raise ConfigError(f"Device {wwan['device']} does not exist") + return None def generate(wwan): diff --git a/src/etc/udev/rules.d/99-vyos-wwan.rules b/src/etc/udev/rules.d/99-vyos-wwan.rules new file mode 100644 index 000000000..67f30a3dd --- /dev/null +++ b/src/etc/udev/rules.d/99-vyos-wwan.rules @@ -0,0 +1,11 @@ +ACTION!="add|change", GOTO="mbim_to_qmi_rules_end" + +SUBSYSTEM!="usb", GOTO="mbim_to_qmi_rules_end" + +# ignore any device with only one configuration +ATTR{bNumConfigurations}=="1", GOTO="mbim_to_qmi_rules_end" + +# force Sierra Wireless MC7710 to configuration #1 +ATTR{idVendor}=="1199",ATTR{idProduct}=="68a2",ATTR{bConfigurationValue}="1" + +LABEL="mbim_to_qmi_rules_end" |