summaryrefslogtreecommitdiff
path: root/recipes-kernel
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2016-11-10 19:07:42 -0600
committerJohn Klug <john.klug@multitech.com>2016-11-10 19:07:42 -0600
commite27bfd67df0d435dfe06424373a0036029dc1c02 (patch)
tree4e54df16318e6be38ac7ff5c91b62f060a937d6c /recipes-kernel
parent669f722c8f65748dbc7ce516cdb0284710390365 (diff)
downloadmeta-multitech-e27bfd67df0d435dfe06424373a0036029dc1c02.tar.gz
meta-multitech-e27bfd67df0d435dfe06424373a0036029dc1c02.tar.bz2
meta-multitech-e27bfd67df0d435dfe06424373a0036029dc1c02.zip
Move MTC written code into .net (eventually).
Diffstat (limited to 'recipes-kernel')
-rw-r--r--recipes-kernel/rs9113/files/rs9113/rs9113.default53
-rwxr-xr-xrecipes-kernel/rs9113/files/rs9113/rs9113.init93
-rwxr-xr-xrecipes-kernel/rs9113/files/rs9113/wpa_supplicant95
-rw-r--r--recipes-kernel/rs9113/rs9113-from-src_1.5.0.bb10
-rw-r--r--recipes-kernel/rs9113/rs9113.bb14
-rw-r--r--recipes-kernel/rs9113/rs9113_1.5.0.bb36
6 files changed, 280 insertions, 21 deletions
diff --git a/recipes-kernel/rs9113/files/rs9113/rs9113.default b/recipes-kernel/rs9113/files/rs9113/rs9113.default
new file mode 100644
index 0000000..9d474bc
--- /dev/null
+++ b/recipes-kernel/rs9113/files/rs9113/rs9113.default
@@ -0,0 +1,53 @@
+# Parameters for rs9113 driver
+#
+# Enable Antenna Diversity (1)
+RSI_ANTENNA_DIVERSITY=0
+
+# COEX_MODE options:
+# 1 WLAN STATION /WIFI-Direct/WLAN PER
+# 2 WLAN ACCESS POINT(including muliple APs on different vaps)
+# 3 WLAN ACCESS POINT + STATION MODE(on multiple vaps)
+# 4 BT CLASSIC MODE/BT CLASSIC PER MODE
+# 5 WLAN STATION + BT CLASSIC MODE
+# 6 WLAN ACCESS POINT + BT CLASSIC MODE
+# 8 BT LE MODE /BT LE PER MODE
+# 9 WLAN STATION + BT LE MODE
+# 12 BT CLASSIC + BT LE MODE
+# 14 WLAN ACCESS POINT + BT CLASSIC MODE+ BT LE MODE
+COEX_MODE=6
+
+# Power selection
+# 0x00 - For Both TX and RX High Power
+# 0x11 - For Both TX and RX Medium Power
+# 0x22 - For Both TX and RX LOW Power
+# 0x10 - For High Power TX and Medium RX Power
+# 0x20 - For High Power TX and LOW RX Power
+# 0x01 - For Medium TX and RX High Power
+# 0x21 - For Medium Power TX and LOW RX Power
+# 0x02 - For Low Power TX and RX High Power
+# 0x12 - For LOW Power TX and Medium RX Power
+WLAN_RF_PWR_MODE=0x00
+BT_RF_PWR_MODE=0x00
+
+#Power_mode type
+# 0 - HIGH POWER MODE
+# 1 - MEDIUM POWER MODE
+# 2 - LOW POWER MODE
+BT_RF_TX_POWER_MODE=0
+BT_RF_RX_POWER_MODE=0
+
+# Country Selection
+# 0 World Domain
+# 840 US Domain Maps to US Region
+# 276 Germany Maps to EU Region
+# 392 Japan Maps to Japan Region
+# from ISO 3166-1
+SET_COUNTRY_CODE=0
+
+# 2 – Select internal antenna
+# 3 – Select external antenna
+ANT_SEL_VAL=2
+
+ONBOARD_ANT_SEL=1
+SET_RETRY_COUNT=15
+
diff --git a/recipes-kernel/rs9113/files/rs9113/rs9113.init b/recipes-kernel/rs9113/files/rs9113/rs9113.init
new file mode 100755
index 0000000..2351ae4
--- /dev/null
+++ b/recipes-kernel/rs9113/files/rs9113/rs9113.init
@@ -0,0 +1,93 @@
+#!/bin/bash
+# Note that none of the INIT stuff below works in the current open-embedded.
+### BEGIN INIT INFO
+# Provides: rs9113
+# Required-Start: mts-io
+# Default-Start: S
+# Default-Stop: 0 6
+# X-Start-Before: networking
+# Short-Description: load the rs9113 drivers
+# Description: rs9113 drivers are used to provide access to Bluetooth
+# and WiFi.
+### END INIT INFO
+
+CONFIG=/etc/default/rs9113
+MTS_IODIR=/sys/devices/platform/mts-io
+RS9113_RESET=${MTS_IODIR}/wifi-bt-reset
+RS9113_INT=${MTS_IODIR}/wifi-bt-int
+RS9113_WKUP=${MTS_IODIR}/wifi-bt-lpwkup
+
+[ -f $CONFIG ] || exit 1
+
+. $CONFIG
+
+case "$1" in
+ start)
+ # Reset the RS9113 chip is ready, and
+ # wait for it to settle.
+ if [ -f "$RS9113_RESET" ] ; then
+ echo 1 >$RS9113_RESET
+ usleep 100
+ echo 0 >$RS9113_RESET
+ usleep 100
+ echo 1 >$RS9113_RESET
+ N=1
+ while [ $N -lt 20 ] ; do
+ INT=$(cat $RS9113_INT)
+ WKUP=$(cat $RS9113_WKUP)
+ if [ $INT -ne 1 -o $WKUP -ne 1 ] ; then
+ usleep 100
+ else
+ break
+ fi
+ done
+ if [ $INT -ne 1 ] ; then
+ logger -t rs9113 -p error -s "$RS9113_INT is $INT"
+ fi
+ if [ $WKUP -ne 1 ] ; then
+ logger -t rs9113 -p error -s "$RS9113_WKUP is $WKUP"
+ fi
+ fi
+ /usr/bin/logger -t "rs9113" -p info -s "Loading rs9113 modules with COEX=$COEX_MODE and Country=$SET_COUNTRY_CODE"
+ /usr/sbin/rs9113_load_modules.sh $CONFIG
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ] ; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ ;;
+
+ stop)
+ /usr/bin/logger -t "rs9113" -p info -s "Unloading rs9113 modules"
+ /usr/sbin/rs9113_remove_modules.sh
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ] ; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ for dir in /sys/class/net/rpine[0-9]* ; do
+ if [[ -d ${dir} ]] ; then
+ echo Driver is loaded
+ exit 0
+ fi
+ done
+ echo Driver is not loaded
+ exit 3
+ ;;
+ *)
+ "Usage: $0 {start|stop|status|restart}"
+ exit 2
+ ;;
+esac
+
+exit 0
+
diff --git a/recipes-kernel/rs9113/files/rs9113/wpa_supplicant b/recipes-kernel/rs9113/files/rs9113/wpa_supplicant
new file mode 100755
index 0000000..6aa6456
--- /dev/null
+++ b/recipes-kernel/rs9113/files/rs9113/wpa_supplicant
@@ -0,0 +1,95 @@
+#! /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)
+ if ! [[ -f ${CONF} ]] ; then
+ echo "Skipping. Configuration file ${CONF} not found."
+ exit 1
+ fi
+ 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-from-src_1.5.0.bb b/recipes-kernel/rs9113/rs9113-from-src_1.5.0.bb
index b1cf765..a7f2eee 100644
--- a/recipes-kernel/rs9113/rs9113-from-src_1.5.0.bb
+++ b/recipes-kernel/rs9113/rs9113-from-src_1.5.0.bb
@@ -2,6 +2,7 @@ DESCRIPTION = "USB Driver for Redpine RS9113"
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28"
PACKAGE_ARCH = "mtcdt"
+PROVIDES = "rs9113-from-src"
inherit module
@@ -30,7 +31,7 @@ inherit update-rc.d
INITSCRIPT_NAME = "rs9113"
INITSCRIPT_PARAMS = "start 00 2 3 4 5 . stop 81 0 6 1 ."
-FILES_${PN} = "/opt/rs9113 ${sbindir} ${sysconfdir}"
+FILES_${PN} = "/opt/rs9113 ${sbindir}"
FILES_${PN}-dbg = "/opt/rs9113/.debug/"
PARALLEL_MAKE = ""
@@ -46,15 +47,10 @@ do_compile () {
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 ${M}/rs9113_load_modules.sh ${D}${sbindir}/
install -m 0755 ${M}/rs9113_remove_modules.sh ${D}${sbindir}/
- install -m 0755 ${M}/rs9113.init ${D}${sysconfdir}/init.d/rs9113
- install -m 0644 ${M}/rs9113.default ${D}${sysconfdir}/default/rs9113
- install -m 0755 ${M}/wpa_supplicant ${D}/opt/rs9113/init.d
}
+
diff --git a/recipes-kernel/rs9113/rs9113.bb b/recipes-kernel/rs9113/rs9113.bb
deleted file mode 100644
index b24bed2..0000000
--- a/recipes-kernel/rs9113/rs9113.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-DESCRIPTION = "Package download of rs9113"
-LICENSE = "Proprietary"
-LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28"
-PACKAGE_ARCH = "mtcdt"
-PROVIDES = "rs9113"
-
-# NOTE: rs9113 binary is built with Jenkin's job using annex-client-fro3m-src.bb
-# To update this, manually copy ipk from Jenkin's job to .net/downloads/
-PR = "r0"
-SRC_URI = "http://multitech.net/downloads/rs9113-from-src_${PV}-${PR}.0_${TUNE_PKGARCH}.ipk \
-"
-
-SRC_URI[md5sum] = "b17462ba3883df6a06b226b37a523eba"
-SRC_URI[sha256sum] = "be903e7e27ad34832cb8045ef805f4e226aa6e254a3c995c5e61a0a9197a95b0"
diff --git a/recipes-kernel/rs9113/rs9113_1.5.0.bb b/recipes-kernel/rs9113/rs9113_1.5.0.bb
new file mode 100644
index 0000000..1e770e9
--- /dev/null
+++ b/recipes-kernel/rs9113/rs9113_1.5.0.bb
@@ -0,0 +1,36 @@
+DESCRIPTION = "USB Driver for Redpine RS9113"
+LICENSE = "Proprietary"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28"
+PACKAGE_ARCH = "mtcdt"
+PROVIDES = "rs9113"
+FILES_${PN} = "/opt/rs9113 ${sbindir} ${sysconfdir}"
+
+# NOTE: annex-client binary is built with Jenkin's job using annex-client-from-src.bb
+# To update this, manually copy ipk from Jenkin's job to .net/downloads/
+PR = "r0"
+SRC_URI = "http://akbar:8080/job/rs9113/lastSuccessfulBuild/artifact/mlinux/build/tmp/deploy/ipk/mtcdt/rs9113-from-src_${PV}-${PR}.0_${PACKAGE_ARCH}.ipk \
+ file://rs9113/rs9113.init \
+ file://rs9113/rs9113.default \
+ file://rs9113/wpa_supplicant \
+"
+
+SRC_URI[md5sum] = "3e2a36fc3fb32164820863fcde02c787"
+SRC_URI[sha256sum] = "f676c3f0814563ff1bb0f982dcd1fb55bd50b571594992000bbfad7bdec08a3a"
+
+M = "${WORKDIR}/rs9113"
+
+do_install() {
+ bbnote "pwd,ls: $(pwd) $(ls) WORKDIR is ${WORKDIR}"
+ (
+ cd ${WORKDIR}
+ find etc -print0 | cpio -0 -pdum ${D}
+ find usr -print0 | cpio -0 -pdum ${D}
+ find opt -print0 | cpio -0 -pdum ${D}
+ )
+ install -d ${D}/opt/rs9113/init.d
+ install -d ${D}${sysconfdir}/init.d/
+ install -d ${D}${sysconfdir}/default/
+ install -m 0755 ${M}/wpa_supplicant ${D}/opt/rs9113/init.d
+ install -m 0755 ${M}/rs9113.init ${D}${sysconfdir}/init.d/rs9113
+ install -m 0644 ${M}/rs9113.default ${D}${sysconfdir}/default/rs9113
+} \ No newline at end of file