summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrecipes-bsp/multitech/mts-io/mts-io163
-rwxr-xr-xrecipes-bsp/multitech/mts-io/mts-io.init52
-rwxr-xr-xrecipes-kernel/rs9113/rs9113-1.4.3/wpa_supplicant91
-rw-r--r--recipes-kernel/rs9113/rs9113_1.4.3.bb5
4 files changed, 125 insertions, 186 deletions
diff --git a/recipes-bsp/multitech/mts-io/mts-io b/recipes-bsp/multitech/mts-io/mts-io
deleted file mode 100755
index 565b1a7..0000000
--- a/recipes-bsp/multitech/mts-io/mts-io
+++ /dev/null
@@ -1,163 +0,0 @@
-#!/bin/bash
-### BEGIN INIT INFO
-# Provides: mts-io
-# Default-Start: 2345
-# Default-Stop: 016
-# Short-Description: load the mts-io driver
-# Description: mts-io driver initializes the Conduit hardware and
-# provides user mode access through the driver to the
-# Conduit features.
-### END INIT INFO
-
-((fail=0))
-
-sysdir=/sys/devices/platform/mts-io
-gpiodir=/sys/class/gpio
-
-USBRST=${sysdir}/usbhub-reset
-
-RST[0]="${sysdir}/mtq-reset"
-RST[1]="${sysdir}/ap1-reset"
-RST[2]="${sysdir}/ap2-reset"
-RST[3]="${sysdir}/gnss-reset"
-RST[4]="${sysdir}/radio-reset"
-RST[5]="${sysdir}/secure-reset"
-RST[6]="${sysdir}/eth-reset"
-#RST[7]="${sysdir}/wifi-bt-reset"
-RS9113RST="${sysdir}/wifi-bt-reset"
-
-USLPTIME=30000 # 30 milliseconds
-WAIT="/bin/busybox usleep ${USLPTIME}"
-
-reset_path() {
- pin=$1
- /usr/bin/logger -t "mts-io" -p info Reset $pin
-
- if [[ -f ${pin} ]] ; then
- if ! ( (echo 1 >${pin}) && (echo 0 >${pin}) && ${WAIT} && (echo 1 >${pin}) ) ; then
- /usr/bin/logger -t "mts-io" -p error -s "Failed write to ${pin}"
- fi
- else
- /usr/bin/logger -t "mts-io" -p error -s "${pin} does not exist"
- return 1
- fi
- return 0
-}
-reset_array() {
- ((i=${#RST[@]}-1))
- while ((i>=0)) ; do
- if [[ -f ${RST[$i]} ]] ; then
- if ! ( (echo 1 >${RST[i]}) ) ; then
- /usr/bin/logger -t "mts-io" -p error -s "Failed write to ${RST[$i]}"
- fi
- else
- /usr/bin/logger -t "mts-io" -p info -s "${RST[$i]} does not exist"
- RST[$i]=""
- fi
- ((i--))
- done
- while ((i>0)) ; do
- if ((${#RST[$i] > 0)) && [[ -f ${RST[$i]} ]] ; then
- if ! ( (echo 0 >${RST[i]}) ) ; then
- /usr/bin/logger -t "mts-io" -p error -s "Failed write to ${RST[$i]}"
- fi
- else
- /usr/bin/logger -t "mts-io" -p info -s "${RST[$i]} does not exist"
- fi
- done
- ${WAIT}
- while ((i>0)) ; do
- if ((${#RST[$i] > 0)) && [[ -f ${RST[$i]} ]] ; then
- if ! ( (echo 1 >${RST[i]}) ) ; then
- /usr/bin/logger -t "mts-io" -p error -s "Failed write to ${RST[$i]}"
- fi
- else
- /usr/bin/logger -t "mts-io" -p info -s "${RST[$i]} does not exist"
- fi
- done
-}
-read_card_info() {
- ap1_product_id=""
- ap2_product_id=""
- mts_hw_version=""
-
- if [[ -d $sysdir/ap1 ]]; then
- ap1_product_id=$(cat $sysdir/ap1/product-id)
- fi
- if [[ -d $sysdir/ap2 ]]; then
- ap2_product_id=$(cat $sysdir/ap2/product-id)
- fi
-}
-
-mfser_init() {
- found_ap1=0
-
- if [[ $ap1_product_id =~ ^MTAC-MFSER- ]]; then
- /usr/bin/logger -t "mts-io" -p info -s "Linking /dev/mfser to /dev/ttyAP1"
- ln -sf /dev/ttyAP1 /dev/mfser
- found_ap1=1
- fi
-
- if [[ $ap2_product_id =~ ^MTAC-MFSER- ]]; then
- if [[ $found_ap1 = 1 ]]; then
- /usr/bin/logger -t "mts-io" -p info -s "Linking /dev/mfser-2 to /dev/ttyAP2"
- ln -sf /dev/ttyAP2 /dev/mfser-2
- else
- /usr/bin/logger -t "mts-io" -p info -s "Linking /dev/mfser to /dev/ttyAP2"
- ln -sf /dev/ttyAP2 /dev/mfser
- fi
- fi
-
-}
-
-case $1 in
- start)
- /usr/bin/logger -t "mts-io" -p info -s "Loading mts-io module"
- if ! modprobe mts_io ; then
- ((fail++))
- fi
- read_card_info
- if ! reset_path $USBRST ; then
- ((fail++))
- fi
- usleep 200
- reset_array
- mfser_init
- if ! reset_path $RS9113RST ; then
- ((fail++))
- fi
-
- if ((fail == 0)) ; then
- echo "OK"
- else
- echo "FAIL"
- fi
- exit $fail
- ;;
-
- stop)
- /usr/bin/logger -t "mts-io" -p info -s "Unloading mts-io module"
- modprobe -r mts_io
- RETVAL=$?
- if ((RETVAL == 0)) ; then
- echo "OK"
- else
- echo "FAIL"
- fi
- ;;
- status)
- if [[ -d ${sysdir} ]] ; then
- echo Driver is loaded
- exit 0
- else
- echo Driver is not loaded
- exit 3
- fi
- ;;
- *)
- echo "Usage: $0 {start|stop|status}"
- exit 2
- ;;
-esac
-
-
diff --git a/recipes-bsp/multitech/mts-io/mts-io.init b/recipes-bsp/multitech/mts-io/mts-io.init
index 03bb5b0..bbc9631 100755
--- a/recipes-bsp/multitech/mts-io/mts-io.init
+++ b/recipes-bsp/multitech/mts-io/mts-io.init
@@ -17,39 +17,45 @@ gpiodir=/sys/class/gpio
USBRST=${sysdir}/usbhub-reset
RST[0]="${sysdir}/mtq-reset"
-RST[1]="${sysdir}/ap1-reset"
-RST[2]="${sysdir}/ap2-reset"
-RST[3]="${sysdir}/gnss-reset"
-RST[4]="${sysdir}/secure-reset"
-RST[5]="${sysdir}/eth-reset"
+RST[1]="${sysdir}/ap1/reset"
+RST[2]="${sysdir}/ap1/creset"
+RST[3]="${sysdir}/ap2/reset"
+RST[4]="${sysdir}/ap2/creset"
+RST[5]="${sysdir}/gnss-reset"
+RST[6]="${sysdir}/secure-reset"
+RST[7]="${sysdir}/eth-reset"
+RST[8]="${sysdir}/sm1-reset"
+
RS9113RST="${sysdir}/wifi-bt-reset"
-USLPTIME=30000 # 30 milliseconds from Redpine Signals Reset Spec
+USLPTIME=100000 # 30 milliseconds from Redpine Signals Reset Spec
WAIT="/bin/busybox usleep ${USLPTIME}"
reset_path() {
pin=$1
- /usr/bin/logger -t "mts-io" -p info Reset $pin
+ /usr/bin/logger -t "mts-io" -p daemon.info Reset $pin
if [[ -f ${pin} ]] ; then
if ! ( (echo 1 >${pin}) && (echo 0 >${pin}) && ${WAIT} && (echo 1 >${pin}) ) ; then
- /usr/bin/logger -t "mts-io" -p error -s "Failed write to ${pin}"
+ /usr/bin/logger -t "mts-io" -p daemon.error -s "Failed write to ${pin}"
+ return 1
fi
else
- /usr/bin/logger -t "mts-io" -p error -s "${pin} does not exist"
- return 1
+ /usr/bin/logger -t "mts-io" -p daemon.info "${pin} does not exist"
fi
return 0
}
reset_array() {
+ fail=0
((i=${#RST[@]}-1))
while ((i>=0)) ; do
if [[ -f ${RST[$i]} ]] ; then
if ! ( (echo 1 >${RST[i]}) ) ; then
- /usr/bin/logger -t "mts-io" -p error -s "Failed write to ${RST[$i]}"
+ /usr/bin/logger -t "mts-io" -p daemon.error -s "Failed write to ${RST[$i]}"
+ fail=1
fi
else
- /usr/bin/logger -t "mts-io" -p info -s "${RST[$i]} does not exist"
+ /usr/bin/logger -t "mts-io" -p daemon.info "${RST[$i]} does not exist"
RST[$i]=""
fi
((i--))
@@ -57,27 +63,29 @@ reset_array() {
while ((i>0)) ; do
if ((${#RST[$i] > 0)) && [[ -f ${RST[$i]} ]] ; then
if ! ( (echo 0 >${RST[i]}) ) ; then
- /usr/bin/logger -t "mts-io" -p error -s "Failed write to ${RST[$i]}"
+ /usr/bin/logger -t "mts-io" -p daemon.error -s "Failed write to ${RST[$i]}"
+ fail=1
fi
else
- /usr/bin/logger -t "mts-io" -p info -s "${RST[$i]} does not exist"
+ /usr/bin/logger -t "mts-io" -p daemon.info "${RST[$i]} does not exist"
fi
done
${WAIT}
while ((i>0)) ; do
if ((${#RST[$i] > 0)) && [[ -f ${RST[$i]} ]] ; then
if ! ( (echo 1 >${RST[i]}) ) ; then
- /usr/bin/logger -t "mts-io" -p error -s "Failed write to ${RST[$i]}"
+ /usr/bin/logger -t "mts-io" -p daemon.error -s "Failed write to ${RST[$i]}"
+ fail=1
fi
else
- /usr/bin/logger -t "mts-io" -p info -s "${RST[$i]} does not exist"
+ /usr/bin/logger -t "mts-io" -p daemon.info "${RST[$i]} does not exist"
fi
done
+ return $fail
}
read_card_info() {
ap1_product_id=""
ap2_product_id=""
- mts_hw_version=""
if [[ -d $sysdir/ap1 ]]; then
ap1_product_id=$(cat $sysdir/ap1/product-id)
@@ -91,17 +99,17 @@ mfser_init() {
found_ap1=0
if [[ $ap1_product_id =~ ^MTAC-MFSER- ]]; then
- /usr/bin/logger -t "mts-io" -p info -s "Linking /dev/mfser to /dev/ttyAP1"
+ /usr/bin/logger -t "mts-io" -p daemon.info -s "Linking /dev/mfser to /dev/ttyAP1"
ln -sf /dev/ttyAP1 /dev/mfser
found_ap1=1
fi
if [[ $ap2_product_id =~ ^MTAC-MFSER- ]]; then
if [[ $found_ap1 = 1 ]]; then
- /usr/bin/logger -t "mts-io" -p info -s "Linking /dev/mfser-2 to /dev/ttyAP2"
+ /usr/bin/logger -t "mts-io" -p daemon.info -s "Linking /dev/mfser-2 to /dev/ttyAP2"
ln -sf /dev/ttyAP2 /dev/mfser-2
else
- /usr/bin/logger -t "mts-io" -p info -s "Linking /dev/mfser to /dev/ttyAP2"
+ /usr/bin/logger -t "mts-io" -p daemon.info -s "Linking /dev/mfser to /dev/ttyAP2"
ln -sf /dev/ttyAP2 /dev/mfser
fi
fi
@@ -110,7 +118,7 @@ mfser_init() {
case $1 in
start)
- /usr/bin/logger -t "mts-io" -p info -s "Loading mts-io module"
+ /usr/bin/logger -t "mts-io" -p daemon.info -s "Loading mts-io module"
if ! modprobe mts_io ; then
((fail++))
fi
@@ -135,7 +143,7 @@ case $1 in
;;
stop)
- /usr/bin/logger -t "mts-io" -p info -s "Unloading mts-io module"
+ /usr/bin/logger -t "mts-io" -p daemon.info -s "Unloading mts-io module"
modprobe -r mts_io
RETVAL=$?
if ((RETVAL == 0)) ; then
diff --git a/recipes-kernel/rs9113/rs9113-1.4.3/wpa_supplicant b/recipes-kernel/rs9113/rs9113-1.4.3/wpa_supplicant
new file mode 100755
index 0000000..b69f395
--- /dev/null
+++ b/recipes-kernel/rs9113/rs9113-1.4.3/wpa_supplicant
@@ -0,0 +1,91 @@
+#! /bin/sh
+# wpa_supplicant
+# Example for /etc/init.d
+# MTS
+#
+PATH=/sbin:/bin:/usr/bin:/usr/sbin
+PIDFILE=/var/run/wpa_suplicant
+CONF=/etc/wpa_supplicant/psk5g.conf
+TIMELIMIT=60
+DRIVERNAME=wifi0
+upinterface() {
+ ((loopcount=1))
+ while ((loopcount < TIMELIMIT)) ; do
+ if [[ $(iw dev ${DRIVERNAME} link) =~ "Connected to " ]] ; then
+ break;
+ fi
+ sleep 1
+ ((loopcount++))
+ done
+ ((loopcount=1))
+ while ((loopcount < TIMELIMIT)) ; do
+ ldifs="$IFS"
+ IFS=$'\n'
+ result=($(ifup wifi0 2>&1))
+ oldifs="$IFS"
+ show=$(ip addr show)
+ if [[ ${show} =~ [[:space:]]+inet[[:space:]]*[0-9].*[[:space:]]+global[[:space:]]+wifi0[[:space:]] ]] ; then
+ break
+ fi
+ ifdown wifi0
+ sleep 1
+ ((loopcount++))
+ done
+ for (( i=0; i < ${#result[@]}; i++ )); do
+ if [[ ${result[i]} =~ ^[[:space:]]*$ ]] ; then
+ continue;
+ fi
+ logger -t ifup -p daemon.info "${result[i]}"
+ done
+}
+
+# ntpd init.d script for ntpdc from ntp.isc.org
+test -x /usr/sbin/wpa_supplicant -a -r $CONF || exit 0
+if ! [[ -r $CONF ]] ; then
+ logger -s -t wpa_supplicant -p daemon.err "Cannot find configuration file $CONF"
+fi
+test -r /etc/default/rcS && . /etc/default/rcS
+
+# Functions to do individual actions
+startdaemon(){
+ echo -n "Starting wpa_supplicant: "
+ /opt/rs9113/onebox_util rpine0 enable_protocol 1
+ /opt/rs9113/onebox_util rpine0 set_country 840
+ /opt/rs9113/onebox_util rpine0 create_vap ${DRIVERNAME} sta sw_bmiss >/dev/null 2>&1
+ start-stop-daemon --start -x wpa_supplicant -- -i ${DRIVERNAME} -D nl80211 -P $PIDFILE /var/run/ -B -c $CONF
+}
+stopdaemon(){
+ echo -n "Stopping ntpd: "
+ start-stop-daemon --stop -p $PIDFILE
+ echo "done"
+}
+
+case "$1" in
+ start)
+ startdaemon
+ { upinterface & }
+ ;;
+ stop)
+ ifdown ${DRIVERNAME} >/dev/null 2>&1
+ stopdaemon
+ ;;
+ force-reload)
+ stopdaemon
+ startdaemon
+ ;;
+ restart)
+ # Don't reset the tick here
+ stopdaemon
+ startdaemon
+ ;;
+ reload)
+ stopdaemon
+ startdaemon
+ ;;
+ *)
+ echo "Usage: wpa_supplicant { start | stop | restart | reload }" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes-kernel/rs9113/rs9113_1.4.3.bb b/recipes-kernel/rs9113/rs9113_1.4.3.bb
index 32df0cf..57aa343 100644
--- a/recipes-kernel/rs9113/rs9113_1.4.3.bb
+++ b/recipes-kernel/rs9113/rs9113_1.4.3.bb
@@ -11,6 +11,7 @@ SRC_URI = " \
file://rs9113_remove_modules.sh \
file://rs9113.init \
file://rs9113.default \
+ file://wpa_supplicant \
"
# file://kthread.patch;patch=1;pnum=3
@@ -47,13 +48,15 @@ do_install() {
install -m 0755 -d ${D}/opt/rs9113
install -d ${D}${sysconfdir}/init.d/
install -d ${D}${sysconfdir}/default/
+ install -d ${D}/opt/rs9113/init.d
cp -r ${S}/release/* ${D}/opt/rs9113/
-
+ rm -rf ${D}/opt/rs9113/flash ${D}/opt/rs9113/certs ${D}/opt/rs9113/*zigb*
install -m 0755 -d ${D}${sbindir}
install -m 0755 ${WORKDIR}/rs9113_load_modules.sh ${D}${sbindir}/
install -m 0755 ${WORKDIR}/rs9113_remove_modules.sh ${D}${sbindir}/
install -m 0755 ${WORKDIR}/rs9113.init ${D}${sysconfdir}/init.d/rs9113
install -m 0644 ${WORKDIR}/rs9113.default ${D}${sysconfdir}/default/rs9113
+ install -m 0755 ${WORKDIR}/wpa_supplicant ${D}/opt/rs9113/init.d
}
python do_clean() {