aboutsummaryrefslogtreecommitdiffstats
path: root/package/comgt/files
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-10-10 12:32:29 +0000
committerFelix Fietkau <nbd@openwrt.org>2012-10-10 12:32:29 +0000
commit405e21d16731b2764ab82aaaadcf36a813b105f7 (patch)
treec6f9a8402389a5081519b91ce62c4a8cafcb8917 /package/comgt/files
parentd0ec348ded6f715b43b396b06ccb10599b37969d (diff)
downloadupstream-405e21d16731b2764ab82aaaadcf36a813b105f7.tar.gz
upstream-405e21d16731b2764ab82aaaadcf36a813b105f7.tar.bz2
upstream-405e21d16731b2764ab82aaaadcf36a813b105f7.zip
packages: sort network related packages into package/network/
SVN-Revision: 33688
Diffstat (limited to 'package/comgt/files')
-rw-r--r--package/comgt/files/3g.chat12
-rw-r--r--package/comgt/files/3g.sh97
-rw-r--r--package/comgt/files/3g.usb33
-rw-r--r--package/comgt/files/evdo.chat17
-rw-r--r--package/comgt/files/getcardinfo.gcom14
-rw-r--r--package/comgt/files/getcarrier.gcom20
-rw-r--r--package/comgt/files/getcnum.gcom20
-rw-r--r--package/comgt/files/getimsi.gcom17
-rw-r--r--package/comgt/files/getstrength.gcom14
-rw-r--r--package/comgt/files/setmode.gcom26
-rw-r--r--package/comgt/files/setpin.gcom55
11 files changed, 0 insertions, 325 deletions
diff --git a/package/comgt/files/3g.chat b/package/comgt/files/3g.chat
deleted file mode 100644
index a1fa2a02d6..0000000000
--- a/package/comgt/files/3g.chat
+++ /dev/null
@@ -1,12 +0,0 @@
-ABORT BUSY
-ABORT 'NO CARRIER'
-ABORT ERROR
-REPORT CONNECT
-TIMEOUT 10
-"" "AT&F"
-OK "ATE1"
-OK 'AT+CGDCONT=1,"IP","$USE_APN"'
-SAY "Calling UMTS/GPRS"
-TIMEOUT 30
-OK "ATD*99***1#"
-CONNECT ' '
diff --git a/package/comgt/files/3g.sh b/package/comgt/files/3g.sh
deleted file mode 100644
index 2ed74b4c08..0000000000
--- a/package/comgt/files/3g.sh
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/bin/sh
-INCLUDE_ONLY=1
-
-. ../netifd-proto.sh
-. ./ppp.sh
-init_proto "$@"
-
-proto_3g_init_config() {
- no_device=1
- available=1
- ppp_generic_init_config
- proto_config_add_string "device"
- proto_config_add_string "apn"
- proto_config_add_string "service"
- proto_config_add_string "pincode"
-}
-
-proto_3g_setup() {
- local interface="$1"
- local chat
-
- json_get_var device device
- json_get_var apn apn
- json_get_var service service
- json_get_var pincode pincode
-
- [ -e "$device" ] || {
- proto_set_available "$interface" 0
- return 1
- }
-
- case "$service" in
- cdma|evdo)
- chat="/etc/chatscripts/evdo.chat"
- ;;
- *)
- chat="/etc/chatscripts/3g.chat"
- cardinfo=$(gcom -d "$device" -s /etc/gcom/getcardinfo.gcom)
- if echo "$cardinfo" | grep -q Novatel; then
- case "$service" in
- umts_only) CODE=2;;
- gprs_only) CODE=1;;
- *) CODE=0;;
- esac
- export MODE="AT\$NWRAT=${CODE},2"
- elif echo "$cardinfo" | grep -q Option; then
- case "$service" in
- umts_only) CODE=1;;
- gprs_only) CODE=0;;
- *) CODE=3;;
- esac
- export MODE="AT_OPSYS=${CODE}"
- elif echo "$cardinfo" | grep -q "Sierra Wireless"; then
- SIERRA=1
- elif echo "$cardinfo" | grep -qi huawei; then
- case "$service" in
- umts_only) CODE="14,2";;
- gprs_only) CODE="13,1";;
- *) CODE="2,2";;
- esac
- export MODE="AT^SYSCFG=${CODE},3FFFFFFF,2,4"
- fi
-
- if [ -n "$pincode" ]; then
- PINCODE="$pincode" gcom -d "$device" -s /etc/gcom/setpin.gcom || {
- proto_notify_error "$interface" PIN_FAILED
- proto_block_restart "$interface"
- return 1
- }
- fi
- [ -n "$MODE" ] && gcom -d "$device" -s /etc/gcom/setmode.gcom
-
- # wait for carrier to avoid firmware stability bugs
- [ -n "$SIERRA" ] && {
- gcom -d "$device" -s /etc/gcom/getcarrier.gcom || return 1
- }
- ;;
- esac
-
- connect="${apn:+USE_APN=$apn }/usr/sbin/chat -t5 -v -E -f $chat"
- ppp_generic_setup "$interface" \
- noaccomp \
- nopcomp \
- novj \
- nobsdcomp \
- noauth \
- lock \
- crtscts \
- 115200 "$device"
- return 0
-}
-
-proto_3g_teardown() {
- proto_kill_command "$interface"
-}
-
-add_protocol 3g
diff --git a/package/comgt/files/3g.usb b/package/comgt/files/3g.usb
deleted file mode 100644
index fd6837e650..0000000000
--- a/package/comgt/files/3g.usb
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-. /lib/functions.sh
-. /lib/netifd/netifd-proto.sh
-
-find_3g_iface() {
- local cfg="$1"
- local tty="$2"
-
- local proto
- config_get proto "$cfg" proto
- [ "$proto" = 3g ] || return 0
-
- # bypass state vars here because 00-netstate could clobber .device
- local dev=$(uci_get network "$cfg" device)
-
- if [ "${dev##*/}" = "${tty##*/}" ]; then
- if [ "$ACTION" = add ]; then
- available=1
- else
- available=0
- fi
- proto_set_available "$cfg" $available
- fi
-}
-
-case "$DEVICENAME" in
- tty*)
- [ -e "/dev/$DEVICENAME" ] || [ "$ACTION" = remove ] || exit 0
- config_load network
- config_foreach find_3g_iface interface "/dev/$DEVICENAME"
- ;;
-esac
-
diff --git a/package/comgt/files/evdo.chat b/package/comgt/files/evdo.chat
deleted file mode 100644
index de49e41a1b..0000000000
--- a/package/comgt/files/evdo.chat
+++ /dev/null
@@ -1,17 +0,0 @@
-# This is a simple chat script based off of the one provided by Sierra Wireless
-# for CDMA connections. It should work for both Sprint and Verizon networks.
-
-ABORT BUSY
-ABORT 'NO CARRIER'
-ABORT ERROR
-ABORT 'NO DIAL TONE'
-ABORT 'NO ANSWER'
-ABORT DELAYED
-REPORT CONNECT
-TIMEOUT 10
-'' AT
-OK ATZ
-SAY 'Calling CDMA/EVDO'
-TIMEOUT 30
-OK ATDT#777
-CONNECT ''
diff --git a/package/comgt/files/getcardinfo.gcom b/package/comgt/files/getcardinfo.gcom
deleted file mode 100644
index 5c69a64604..0000000000
--- a/package/comgt/files/getcardinfo.gcom
+++ /dev/null
@@ -1,14 +0,0 @@
-opengt
- set com 115200n81
- set comecho off
- set senddelay 0.02
- waitquiet 0.2 0.2
- flash 0.1
-
-:start
- send "ATI^m"
- get 1 "" $s
- print $s
-
-:continue
- exit 0
diff --git a/package/comgt/files/getcarrier.gcom b/package/comgt/files/getcarrier.gcom
deleted file mode 100644
index 1e0216d46a..0000000000
--- a/package/comgt/files/getcarrier.gcom
+++ /dev/null
@@ -1,20 +0,0 @@
-opengt
- set senddelay 0.05
- waitquiet 1 0.2
- let c=1
- :loop
- inc c
- send "AT+CGATT?^m"
- waitfor 5 "+CGATT: 1","+CGATT: 0"
- print "\n."
- if % = -1 goto error
- if c > 10 goto toolong
- if % = 0 goto out
- sleep 2
- if % = 1 goto loop
- :toolong
- exit 1
- :error
- exit 0
- :out
- exit 0
diff --git a/package/comgt/files/getcnum.gcom b/package/comgt/files/getcnum.gcom
deleted file mode 100644
index 450cf8c413..0000000000
--- a/package/comgt/files/getcnum.gcom
+++ /dev/null
@@ -1,20 +0,0 @@
-opengt
- set com 115200n81
- set comecho off
- set senddelay 0.02
- waitquiet 0.2 0.2
- flash 0.1
-
-:start
- send "AT+CNUM^m"
- get 1 "^m" $n
- get 1 ":" $n
- get 1 "\"" $n
- get 1 "\"" $n
- get 1 "\"" $n
- get 1 "\"" $n
- let n = len($n)
- if n<1 goto continue
- print $n
-:continue
- exit 0
diff --git a/package/comgt/files/getimsi.gcom b/package/comgt/files/getimsi.gcom
deleted file mode 100644
index 04854561b1..0000000000
--- a/package/comgt/files/getimsi.gcom
+++ /dev/null
@@ -1,17 +0,0 @@
-opengt
- set com 115200n81
- set comecho off
- set senddelay 0.02
- waitquiet 0.2 0.2
- flash 0.1
-
-:start
- send "AT+CIMI^m"
- get 1 "^m" $s
- get 1 "^m" $s
- let x = len($s)
- if x<2 goto continue
- let $s = $right($s, x-1)
- print $s
-:continue
- exit 0
diff --git a/package/comgt/files/getstrength.gcom b/package/comgt/files/getstrength.gcom
deleted file mode 100644
index 2886285971..0000000000
--- a/package/comgt/files/getstrength.gcom
+++ /dev/null
@@ -1,14 +0,0 @@
-opengt
- set com 115200n81
- set comecho off
- set senddelay 0.02
- waitquiet 0.2 0.2
- flash 0.1
-
-:start
- send "AT+CSQ^m"
- get 1 "" $s
- print $s
-
-:continue
- exit 0
diff --git a/package/comgt/files/setmode.gcom b/package/comgt/files/setmode.gcom
deleted file mode 100644
index 4ce0b5fa78..0000000000
--- a/package/comgt/files/setmode.gcom
+++ /dev/null
@@ -1,26 +0,0 @@
-# set wwan mode from environment
-opengt
- set com 115200n81
- set senddelay 0.02
- waitquiet 1 0.2
- flash 0.1
-
-:start
- print "Trying to set mode\n"
- send $env("MODE")
- send "^m"
-
- waitfor 15 "OK","ERR","ERROR"
- if % = 0 goto continue
- if % = 1 goto modeerror
- if % = 2 goto modeerror
-
- print "Timeout setting WWAN mode!\n"
- exit 1
-
-:modeerror
- print "Error setting WWAN mode!\n"
- exit 1
-
-:continue
- exit 0
diff --git a/package/comgt/files/setpin.gcom b/package/comgt/files/setpin.gcom
deleted file mode 100644
index 66350fe20b..0000000000
--- a/package/comgt/files/setpin.gcom
+++ /dev/null
@@ -1,55 +0,0 @@
-# set pin code from evnironment "$PINCODE"
-opengt
- set com 115200n81
- set senddelay 0.05
- waitquiet 3 0.5
- flash 0.1
-
- let c=0
-:start
- send "AT+CPIN?^m"
- waitfor 15 "SIM PUK","SIM PIN","READY","ERROR","ERR"
- if % = -1 goto timeout
- if % = 0 goto ready
- if % = 1 goto setpin
- if % = 2 goto ready
- if % = 3 goto checkrepeat
- if % = 4 goto checkrepeat
-
-:checkrepeat
- inc c
- if c>3 goto pinerror
- waitquiet 12 0.5
- goto start
-
-:timeout
- print "timeout checking for PIN."
- exit 1
-
-:ready
- print "SIM ready\n"
- goto continue
- exit 0
-
-:setpin
- # check if output was "SIM PIN2", that's ok.
- waitfor 1 "2"
- if % = 0 goto ready
-
- print "Trying to set PIN\n"
- send "AT+CPIN=\""
- send $env("PINCODE")
- send "\"^m"
-
- waitfor 20 "OK","ERR"
- if % = -1 goto pinerror
- if % = 0 goto continue
- if % = 1 goto pinerror
-
-:pinerror
- print "Error setting PIN, check card manually\n"
- exit 1
-
-:continue
- print "PIN set successfully\n"
- exit 0