From bf628f732acedce1ff1837202627260c6fd4533d Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 26 Jan 2020 18:06:22 +0100 Subject: wwan: T1988: initial XML/Python representation --- src/etc/ppp/peers/chat/att | 6 ++++++ src/etc/ppp/peers/chat/sc1 | 13 +++++++++++++ src/etc/ppp/peers/chat/verizon | 5 +++++ 3 files changed, 24 insertions(+) create mode 100644 src/etc/ppp/peers/chat/att create mode 100644 src/etc/ppp/peers/chat/sc1 create mode 100644 src/etc/ppp/peers/chat/verizon (limited to 'src/etc') diff --git a/src/etc/ppp/peers/chat/att b/src/etc/ppp/peers/chat/att new file mode 100644 index 000000000..7a02682f5 --- /dev/null +++ b/src/etc/ppp/peers/chat/att @@ -0,0 +1,6 @@ +ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT 'NO CARRIER' ABORT DELAYED +'' AT +OK ATZ +OK 'AT+CGDCONT=1,"IP","ISP.CINGULAR"' +OK ATD*99# +CONNECT '' diff --git a/src/etc/ppp/peers/chat/sc1 b/src/etc/ppp/peers/chat/sc1 new file mode 100644 index 000000000..fbfabd8c2 --- /dev/null +++ b/src/etc/ppp/peers/chat/sc1 @@ -0,0 +1,13 @@ +TIMEOUT 60 +ABORT ERROR +ABORT BUSY +ABORT VOICE +ABORT "NO CARRIER" +ABORT "NO DIALTONE" +ABORT "NO DIAL TONE" +ABORT "NO ANSWER" +"" "ATZ" +"" "AT&FH0M0" +OK-AT-OK "ATDT*99#" +TIMEOUT 75 +CONNECT diff --git a/src/etc/ppp/peers/chat/verizon b/src/etc/ppp/peers/chat/verizon new file mode 100644 index 000000000..a36a3e915 --- /dev/null +++ b/src/etc/ppp/peers/chat/verizon @@ -0,0 +1,5 @@ +ABORT 'NO CARRIER' ABORT 'ERROR' ABORT 'NO DIALTONE' ABORT +'BUSY' ABORT 'NO ANSWER' +'' ATZ +OK-AT-OK ATDT#777 +CONNECT \d\c -- cgit v1.2.3 From ced45949bc282d23b0767f698f31b580602f0c9c Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 10 Mar 2020 19:50:00 +0100 Subject: wwan: T1988: add support for Sierra Wireless MC7710 modem --- debian/vyos-1x.install | 1 + src/conf_mode/interfaces-wirelessmodem.py | 11 ++++++++++- src/etc/udev/rules.d/99-vyos-wwan.rules | 11 +++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/etc/udev/rules.d/99-vyos-wwan.rules (limited to 'src/etc') 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" -- cgit v1.2.3