ccim6ul_sbc: Add wireless concurrent as default setup

This commit adds the wireless concurrent mode as a default
configuration to the CC6UL machine.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>

https://jira.digi.com/browse/DEL-3818
This commit is contained in:
Mike Engel 2017-03-07 12:53:10 +01:00
parent 319576805a
commit 19563821d2
9 changed files with 112 additions and 0 deletions

View File

@ -16,6 +16,9 @@ UBOOT_SYMLINK = "u-boot-${MACHINE}.${UBOOT_SUFFIX}"
WIRELESS_MODULE ?= ""
WIRELESS_MODULE_append = " ${@base_conditional('HAVE_WIFI', '1', 'kernel-module-qualcomm', '', d)}"
# Wireless p2p interface
WLAN_P2P_INTERFACE ?= "p2p0"
# Firmware
MACHINE_FIRMWARE ?= ""

View File

@ -38,6 +38,9 @@ ETH1_STATIC_NETMASK ?= "255.255.255.0"
WLAN0_MODE ?= "static"
WLAN0_STATIC_IP ?= "192.168.43.30"
WLAN0_STATIC_NETMASK ?= "255.255.255.0"
WLAN1_MODE ?= "static"
WLAN1_STATIC_IP ?= "192.168.46.30"
WLAN1_STATIC_NETMASK ?= "255.255.255.0"
P2P0_STATIC_IP ?= "192.168.45.30"
P2P0_STATIC_NETMASK ?= "255.255.255.0"

View File

@ -0,0 +1,22 @@
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
interface=wlan1
driver=nl80211
# WPA2-AES encryption
ssid=ap-wpa2aes_a
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
wpa_passphrase=password-wpa2aes
# IEEE 802.11ac
hw_mode=a
channel=36
ieee80211ac=1
ieee80211n=1
# IEEE 802.11d - Country Code
ieee80211d=1
country_code=US

View File

@ -0,0 +1,7 @@
auto wlan0
iface wlan0 inet dhcp
udhcpc_opts -b
wpa-driver ##WPA_DRIVER##
wpa-conf /etc/wpa_supplicant.conf
post-up /bin/virtwlans.sh

View File

@ -0,0 +1,10 @@
auto wlan0
iface wlan0 inet static
address ##WLAN0_STATIC_IP##
netmask ##WLAN0_STATIC_NETMASK##
gateway ##WLAN0_STATIC_GATEWAY##
dns-nameservers ##WLAN0_STATIC_DNS##
wpa-driver ##WPA_DRIVER##
wpa-conf /etc/wpa_supplicant.conf
post-up /bin/virtwlans.sh

View File

@ -0,0 +1,6 @@
auto wlan1
iface wlan1 inet dhcp
udhcpc_opts -b
post-up /etc/init.d/hostapd start
pre-down /etc/init.d/hostapd stop

View File

@ -0,0 +1,9 @@
auto wlan1
iface wlan1 inet static
address ##WLAN1_STATIC_IP##
netmask ##WLAN1_STATIC_NETMASK##
gateway ##WLAN1_STATIC_GATEWAY##
dns-nameservers ##WLAN1_STATIC_DNS##
post-up /etc/init.d/hostapd start
pre-down /etc/init.d/hostapd stop

View File

@ -0,0 +1,26 @@
#!/bin/sh
#
# Copyright (c) 2017, Digi International Inc.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# This will create a second wireless network device
if [ -s "/proc/device-tree/wireless/mac-address1" ] &&
[ -s "/proc/device-tree/wireless/mac-address2" ] &&
[ -s "/proc/device-tree/wireless/mac-address3" ]; then
iw dev wlan0 interface add wlan1 type managed
else
echo "ERROR: Missing virtual MAC addresses, please"
echo "program one referring to the Digi U-Boot Documentation"
fi

View File

@ -18,6 +18,12 @@ SRC_URI_append = " \
file://resolv \
"
SRC_URI_append_ccimx6ul = "\
file://interfaces.wlan1.static \
file://interfaces.wlan1.dhcp \
file://virtwlans.sh \
"
WPA_DRIVER ?= "nl80211"
do_install_append() {
@ -113,3 +119,23 @@ do_install_append() {
sed -i -e "s,##P2P0_STATIC_DNS##,${P2P0_STATIC_DNS},g" ${D}${sysconfdir}/network/interfaces
sed -i -e "s,##WPA_DRIVER##,${WPA_DRIVER},g" ${D}${sysconfdir}/network/interfaces
}
do_install_append_ccimx6ul() {
install -d ${D}${base_bindir}
install -m 0755 ${WORKDIR}/virtwlans.sh ${D}${base_bindir}
if [ -n "${HAVE_WIFI}" ]; then
cat ${WORKDIR}/interfaces.wlan1.${WLAN1_MODE} >> ${D}${sysconfdir}/network/interfaces
fi
# Remove config entries if corresponding variable is not defined
[ -z "${WLAN1_STATIC_DNS}" ] && sed -i -e "/##WLAN1_STATIC_DNS##/d" ${D}${sysconfdir}/network/interfaces
[ -z "${WLAN1_STATIC_GATEWAY}" ] && sed -i -e "/##WLAN1_STATIC_GATEWAY##/d" ${D}${sysconfdir}/network/interfaces
[ -z "${WLAN1_STATIC_IP}" ] && sed -i -e "/##WLAN1_STATIC_IP##/d" ${D}${sysconfdir}/network/interfaces
[ -z "${WLAN1_STATIC_NETMASK}" ] && sed -i -e "/##WLAN1_STATIC_NETMASK##/d" ${D}${sysconfdir}/network/interfaces
# Replace interface parameters
sed -i -e "s,##WLAN1_STATIC_IP##,${WLAN1_STATIC_IP},g" ${D}${sysconfdir}/network/interfaces
sed -i -e "s,##WLAN1_STATIC_NETMASK##,${WLAN1_STATIC_NETMASK},g" ${D}${sysconfdir}/network/interfaces
sed -i -e "s,##WLAN1_STATIC_GATEWAY##,${WLAN1_STATIC_GATEWAY},g" ${D}${sysconfdir}/network/interfaces
sed -i -e "s,##WLAN1_STATIC_DNS##,${WLAN1_STATIC_DNS},g" ${D}${sysconfdir}/network/interfaces
}