1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Revert "add qca feed"

This reverts commit 26ac03f3f6.
This commit is contained in:
suyuan 2022-09-10 05:51:33 +08:00
parent 26ac03f3f6
commit 1cac57d1f3
451 changed files with 12069 additions and 111139 deletions

View file

@ -1,137 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=LinuxART2
PKG_VERSION:=CS10.2v4.9.455
PKG_RELEASE:=1
PKG_BRANCH:=$(basename $(PKG_VERSION))
PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://qcawebsrvr.qualcomm.com/cnss_win/santaclara/dev01/ART2/$(PKG_NAME)$(PKG_BRANCH)/$(PKG_NAME)$(PKG_VERSION)
PKG_MD5SUM:=9607e35711cba23d247b642cd726bcc5
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
#########################################################
############ ART DRIVER BUILD CONFIGURATION ############
#########################################################
ifeq ($(CONFIG_TARGET_ar71xx), y)
TARGET_CFLAGS+=-fpie
else
TARGET_CFLAGS+=-Wall -Werror -fpie
endif
TARGET_LDFLAGS+=-pie
export C_FLAGS:=$(TARGET_CFLAGS)
export LD_FLAGS:=$(TARGET_LDFLAGS)
ART2_APP_OPTS+= \
$(TARGET_CONFIGURE_OPTS) \
ART_ROOT=$(PKG_BUILD_DIR) \
WORKAREA=$(PKG_BUILD_DIR) \
TOOL_PREFIX=$(TARGET_CROSS)
ifeq ($(BUILD_VARIANT),netlink)
ART2_APP_OPTS+=USE_NETLINK=1
endif
EXTRA_CFLAGS+= \
-DUSE_PLATFORM_FRAMEWORK=1 \
-DCFG_64BIT=0 \
-I$(PKG_BUILD_DIR) \
-I$(PKG_BUILD_DIR)/driver/linux/modules/include \
ifneq ($(CONFIG_DEBUG),)
ART2_APP_OPTS+= \
GDB=1
endif
ifeq (y, $(findstring y, $(CONFIG_TARGET_ipq)$(CONFIG_TARGET_ipq806x)$(CONFIG_TARGET_ipq_ipq806x)$(CONFIG_TARGET_ipq40xx)$(CONFIG_TARGET_ipq_ipq40xx)$(CONFIG_TARGET_ipq807x)$(CONFIG_TARGET_ipq_ipq807x)$(CONFIG_TARGET_ipq807x_64)$(CONFIG_TARGET_ipq_ipq807x_64)))
ART2_APP_OPTS+=AKRONITE=1
EXTRA_CFLAGS+=-DAKRONITE_ART
endif
ifeq ($(CONFIG_TARGET_ar71xx), y)
EXTRA_CFLAGS+= -DAP83 -DWASP
endif
define KernelPackage/art2/Default
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros
TITLE:=$(1) - QCA ART Driver & tools
DEPENDS:=@!TARGET_ipq50xx @!TARGET_ipq807x_generic @!TARGET_ipq_ipq807x_64 @!TARGET_ipq_ipq60xx_64 @!TARGET_ipq_ipq50xx_64 +libpthread +libc +librt
FILES:=$(PKG_BUILD_DIR)/driver/linux/modules/art.$(LINUX_KMOD_SUFFIX)
endef
define KernelPackage/art2/Description/Default
This package contains a driver for ART and the tools to use it:
- art.ko
- nart.out
- NART related libs
It has been build specifically for $(1)
endef
define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
ARCH="$(LINUX_KARCH)" \
SUBDIRS="$(PKG_BUILD_DIR)/driver/linux/modules" \
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
modules
$(MAKE) -C $(PKG_BUILD_DIR) $(strip $(ART2_APP_OPTS)) \
-f makefile.nart all
endef
define KernelPackage/art2/install/Default
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/nartbuild/*.out $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/nartbuild/*.so $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/BoardData/*.bin $(1)/usr/sbin
$(INSTALL_BIN) ./files/art.init $(1)/etc/init.d/art
endef
define KernelPackage/art2
$(call KernelPackage/art2/Default)
DEPENDS+=libnl-tiny
endef
define KernelPackage/art2/Description
$(call KernelPackage/art2/Description/Default)
endef
define KernelPackage/art2/config
$(call KernelPackage/art2/config/Default)
endef
define KernelPackage/art2/install
$(call KernelPackage/art2/install/Default,$(1))
endef
$(eval $(call KernelPackage,art2))
define KernelPackage/art2-netlink
$(call KernelPackage/art2/Default,netlink)
VARIANT:=netlink
DEPENDS+=libnl-tiny
endef
define KernelPackage/art2-netlink/Description
$(call KernelPackage/art2/Description/Default)
endef
define KernelPackage/art2-netlink/config
$(call KernelPackage/art2/config/Default,-netlink)
endef
define KernelPackage/art2-netlink/install
$(call KernelPackage/art2/install/Default,$(1))
endef
$(eval $(call KernelPackage,art2-netlink))

View file

@ -1,372 +0,0 @@
#!/bin/sh /etc/rc.common
#
# Copyright (c) 2013, 2017 Qualcomm Technologies, Inc.
#
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# 2013 Qualcomm Atheros, Inc.
# All Rights Reserved.
# Qualcomm Atheros Confidential and Proprietary.
#
# We don't want to start ART2 automatically at boot time as we want the
# default to be a working user configuration.
# At the end of the boot process, the user can start art using:
# put the START value as 99 in below defined variable ( ex. START=99)
# /etc/init.d/art enable
# /etc/init.d/art start
# now art should be running automatically at every boot, but if user wants
# to disable it back then he should use below command to disable it back:
# /etc/init.d/art disable
START=
SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
#wlan_dir is for ath10K platform
wlan_dir=/sys/class/net/wlan
wifi_dir=/sys/class/net/wifi
arm_platform=`uname -m | grep arm`
third_party=""
board_id=""
if [ -f /etc/modules.d/33-qca-wifi* ]; then
qcawifi_modules=/etc/modules.d/33-qca-wifi*
else
qcawifi_modules=/lib/wifi/qca-wifi-modules
fi
ART_QCA_WIFI_DETECTED=1
MTD_ART_PART_NAME="ART"
unload_wifi_art_modules() {
if [ "${ART_QCA_WIFI_DETECTED}" -eq 1 ]; then
for mod in art $(cat $qcawifi_modules | sed '1!G;h;$!d'); do
case ${mod} in
mem_manager) continue;
;;
art) continue;
;;
esac
[ -d /sys/module/${mod} ] && rmmod ${mod}
done
else
[ -d /sys/module/art ] && rmmod art
fi
}
load_wifi_art_modules() {
if [ "${ART_QCA_WIFI_DETECTED}" -eq 1 ]; then
if [ -n "$arm_platform" ] ; then
for mod in $(cat $qcawifi_modules) art ; do
case ${mod} in
umac) [ -d /sys/module/${mod} ] || { \
insmod ${mod} ahbskip=1 || { \
unload_wifi_art_modules
}
};;
qca_ol) [ -d /sys/module/${mod} ] || { \
insmod ${mod} testmode=1 || { \
unload_wifi_art_modules
}
};;
*) [ -d /sys/module/${mod} ] || { \
insmod ${mod} || { \
unload_wifi_art_modules
}
};;
esac
done
else
for mod in art $(cat $qcawifi_modules) ; do
case ${mod} in
umac) [ -d /sys/module/${mod} ] || { \
insmod ${mod} ahbskip=1 || { \
unload_wifi_art_modules
}
};;
qca_ol) [ -d /sys/module/${mod} ] || { \
insmod ${mod} testmode=1 || { \
unload_wifi_art_modules
}
};;
*) [ -d /sys/module/${mod} ] || { \
insmod ${mod} || { \
unload_wifi_art_modules
}
};;
esac
done
fi
else
for mod in $(lsmod | grep ath) ; do
case ${mod} in
ath9k) rmmod ${mod};;
esac
done
[ -d /sys/module/art ] || insmod art
fi
}
is_art_runnable() {
# First argument represents wifi_dir/wlan_dir
# Second argument represents wifi index/wlan index
local dir=$1
local index=$2
if [ -e "$dir$index/device/device" ]; then
read dev_id < "$dir$index/device/device"
case "$dev_id" in
"0x0040")
return 0
;;
"0x0046")
return 0
;;
"0x0056")
return 0
;;
"0x0050")
return 0
;;
"0x003c")
return 0
;;
*)
return 1
;;
esac
fi
return 1
}
start_nart_out() {
# First argument represents the wifi directory name/wlan directory name to be use
# Second argument represents the wifi index/wlan index to be use
local dir=$1
local wifi_index=$2
local inst=$3
is_art_runnable $dir $wifi_index && return
SERVICE_PID_FILE=/var/run/nart${wifi_index}.pid
if [ -n "$arm_platform" ] || [ -n "$third_party" ]; then
service_start /usr/sbin/nart.out -instance ${wifi_index} -pcie ${wifi_index}
else
case "$board_id" in
"ap135"|\
"ap147"|\
"ap151"|\
"ap152"|\
"ap137"|\
"apjet01")
SERVICE_PID_FILE=/var/run/nart${inst}.pid
service_start /usr/sbin/nart.out -instance ${inst} -pcie ${wifi_index}
;;
*)
service_start /usr/sbin/nart.out -instance ${wifi_index}
;;
esac
fi
}
stop_nart_out() {
# First argument represents the wifi directory name/wlan directory name to be use
# Second argument represents the wifi index/wlan index to be use
local dir=$1
local wifi_index=$2
local inst=$3
is_art_runnable $dir $wifi_index && return
# in qca-wifi, cfg name is the wifi iface name
SERVICE_PID_FILE=/var/run/nart${wifi_index}.pid
if [ -n "$arm_platform" ] || [ -n "$third_party" ]; then
service_stop /usr/sbin/nart.out -instance ${wifi_index} -pcie ${wifi_index}
else
case "$board_id" in
"ap135"|\
"ap147"|\
"ap151"|\
"ap152"|\
"ap137"|\
"apjet01")
SERVICE_PID_FILE=/var/run/nart${inst}.pid
service_stop /usr/sbin/nart.out -instance ${inst} -pcie ${wifi_index}
;;
*)
service_stop /usr/sbin/nart.out -instance ${wifi_index}
;;
esac
fi
}
art_qca_wifi_detect() {
local qca_wifi_entry
local wlan_entry
if [ -f $qcawifi_modules ]; then
qca_wifi_entry=`cat $qcawifi_modules`
[ -n "$qca_wifi_entry" ] || ART_QCA_WIFI_DETECTED=0
elif [ -f /etc/modules.d/ath10k ]; then
wlan_entry=`cat /etc/modules.d/ath10k`
[ -n "$wlan_entry" ] || ART_QCA_WIFI_DETECTED=0
else
ART_QCA_WIFI_DETECTED=0
fi
}
start() {
local art_inst=1
local nor_flash=""
art_qca_wifi_detect
config_load wireless
# ART2 conflicts with the WiFi driver so we don't start anything here
# We'll just prepare the field in case we want to start nart.out
[ -c /dev/dk0 ] || mknod /dev/dk0 c 63 0
[ -c /dev/dk1 ] || mknod /dev/dk1 c 63 1
mtd_name=$(grep -i -w ${MTD_ART_PART_NAME} /proc/mtd | cut -f1 -d:)
nor_flash=`find /sys/bus/spi/devices/*/mtd -name ${mtd_name} 2> /dev/null`
if [ -n "$nor_flash" -a -n "$arm_platform" ]; then
[ -L /dev/caldata ] || \
ln -s /dev/${mtd_name} /dev/caldata
elif [ -n "$mtd_name" ]; then
[ -L /dev/caldata ] || \
ln -s /dev/${mtd_name//mtd/mtdblock} /dev/caldata
fi
unload_wifi_art_modules
load_wifi_art_modules
if [ -n "$mtd_name" ]; then
third_party=""
if [ -n "$arm_platform" ]; then
. /lib/ipq806x.sh
board_id=$(ipq806x_board_name)
else
. /lib/ar71xx.sh
board_id=$(ar71xx_board_name)
fi
else
third_party="true"
fi
# Start the daemon
if [ "${ART_QCA_WIFI_DETECTED}" -eq 1 ]; then
case "$board_id" in
"ap135"|\
"ap147"|\
"ap151"|\
"ap152"|\
"ap137"|\
"apjet01")
SERVICE_PID_FILE=/var/run/nart0.pid
service_start /usr/sbin/nart.out -instance 0
service_start /usr/sbin/nart.out -instance 1 -pcie 0
# Check for ath10K driver
# If ath10K driver installed,
# use wlan_dir instead of wifi_dir to check for device existence
# and launch nart.out application accordingly
if [ -n "`lsmod | grep ath10k`" ] ; then
for dir in /sys/class/net/wlan*; do
[ -d "$dir" ] || continue
start_nart_out $wlan_dir "${dir#"$wlan_dir"}" $art_inst
art_inst=`expr $art_inst + 1`
done
else
for dir in /sys/class/net/wifi*; do
[ -d "$dir" ] || continue
start_nart_out $wifi_dir "${dir#"$wifi_dir"}" $art_inst
art_inst=`expr $art_inst + 1`
done
fi
;;
*)
if [ -n "`lsmod | grep ath10k`" ] ; then
for dir in /sys/class/net/wlan*; do
[ -d "$dir" ] || continue
start_nart_out $wlan_dir "${dir#"$wlan_dir"}" $art_inst
done
else
#config_foreach start_nart_out $wifi_dir wifi-device "0"
for dir in /sys/class/net/wifi*; do
[ -d "$dir" ] || continue
start_nart_out $wifi_dir "${dir#"$wifi_dir"}" $art_inst
art_inst=`expr $art_inst + 1`
done
fi
;;
esac
else
start_nart_out "0" "0" "0"
fi
}
stop() {
local art_inst=1
art_qca_wifi_detect
config_load wireless
# Stop the daemon
if [ "${ART_QCA_WIFI_DETECTED}" -eq 1 ]; then
case "$board_id" in
"ap135"|\
"ap147"|\
"ap151"|\
"ap152"|\
"ap137"|\
"apjet01")
SERVICE_PID_FILE=/var/run/nart0.pid
service_stop /usr/sbin/nart.out -instance 0
# Check for ath10K driver
# If ath10K driver installed,
# use wlan_dir instead of wifi_dir to check for device existence
# and stop art application accordingly
if [ -n "`lsmod | grep ath10k`" ] ; then
for dir in /sys/class/net/wlan*; do
[ -d "$dir" ] || continue
stop_nart_out $wlan_dir "${dir#"$wlan_dir"}" $art_inst
art_inst=`expr $art_inst + 1`
done
else
for dir in /sys/class/net/wifi*; do
[ -d "$dir" ] || continue
stop_nart_out $wifi_dir "${dir#"$wifi_dir"}" $art_inst
art_inst=`expr $art_inst + 1`
done
fi
;;
*)
if [ -n "`lsmod | grep ath10k`" ] ; then
for dir in /sys/class/net/wlan*; do
[ -d "$dir" ] || continue
stop_nart_out $wlan_dir "${dir#"$wlan_dir"}" $art_inst
done
else
#config_foreach stop_nart_out $wifi_dir wifi-device "0"
for dir in /sys/class/net/wifi*; do
[ -d "$dir" ] || continue
stop_nart_out $wifi_dir "${dir#"$wifi_dir"}" $art_inst
art_inst=`expr $art_inst + 1`
done
fi
;;
esac
else
stop_nart_out "0" "0" "0"
fi
unload_wifi_art_modules
[ -c /dev/dk0 ] && rm /dev/dk0
[ -c /dev/dk1 ] && rm /dev/dk1
[ -L /dev/caldata ] && rm /dev/caldata
}

View file

@ -1,10 +0,0 @@
--- a/os/Linux/os_if_nl.c
+++ b/os/Linux/os_if_nl.c
@@ -4,6 +4,7 @@
* Qualcomm Atheros Confidential and Proprietary.
*/
+#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

View file

@ -1,13 +0,0 @@
Index: LinuxART2CS10.2v4.9.437/art/makefile.dart
===================================================================
--- LinuxART2CS10.2v4.9.437.orig/art/makefile.dart 2016-11-24 17:40:31.000000000 +0530
+++ LinuxART2CS10.2v4.9.437/art/makefile.dart 2017-04-12 16:19:15.857810084 +0530
@@ -54,7 +54,7 @@
LDFLAGS = -L./ -L../shared/Linux -L../field/Linux -L../anwi/Linux -L../Link/Linux -L../libtlv/outputTemplate/Linux -L../libtlv/libtlvutil/Linux -L../LinkQc9K/Linux -L../calibration/cal-2p/Linux_ar9300 -L../devlib/Linux_ar9287 -L../devlib/Linux_qc98xx -L../devlib/Linux_ar9300 \
-rdynamic \
--lm -lpthread -ldl \
+-lm -lpthread -ldl -lrt \
-lfield -lpart -lanwi -llinkAr9k -ltlvtemplate -ltlvutil -lLinkQc9K -lcal-2p -lar9300 -lar9287 -lqc98xx\
BIN = $(OUTPUT_DIR)/nart.out

View file

@ -1,83 +0,0 @@
--- a/art/AnwiDriverInterface.h
+++ b/art/AnwiDriverInterface.h
@@ -10,7 +10,10 @@
#ifdef __LINUX_MIPS64_ARCH__
#include <linux/version.h>
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
+
+#ifdef __KERNEL__
+#include <linux/version.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
#if defined(THIRD_PARTY_INTEL)
#if !defined(__LINUX_MIPS64_ARCH__) && !defined(__LINUX_ARM_ARCH__)&& !defined(__i386__)
@@ -22,6 +25,7 @@
#endif
#endif
#endif
+#endif
#endif
extern ANWIDLLSPEC int AnwiDriverDetach(void);
--- a/common/hw_routines.c
+++ b/common/hw_routines.c
@@ -8,7 +8,7 @@
#if defined(Linux) || defined(__APPLE__)
#include <unistd.h>
-#include <sys/types.h>
+ //#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/mman.h>
--- a/devlib/qc98xx/Qc98xxEepromPrint.c
+++ b/devlib/qc98xx/Qc98xxEepromPrint.c
@@ -6,6 +6,7 @@
#include <string.h>
#include <math.h>
#include <ctype.h>
+#include <sys/types.h>
#include "wlantype.h"
#include "smatch.h"
--- a/devlib/qc98xx/Qc98xxEepromSave.h
+++ b/devlib/qc98xx/Qc98xxEepromSave.h
@@ -1,6 +1,7 @@
#ifndef _QC98XX_EEPROM_SAVE_H_
#define _QC98XX_EEPROM_SAVE_H_
+#include <sys/types.h>
#if defined (AP_BUILD) || defined (MDK_AP)
#define SWAP16(_x) ( (u_int16_t)( (((const u_int8_t *)(&_x))[0] ) |\
--- a/libtlv/libtlvutil/genTxBinCmdTlv.c
+++ b/libtlv/libtlvutil/genTxBinCmdTlv.c
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/types.h>
#if defined(_HOST_SIM_TESTING)
#include "otaHostCommon.h"
--- a/common/linux_ansi.h
+++ b/common/linux_ansi.h
@@ -5,7 +5,6 @@
extern "C" {
#endif // __cplusplus
-#include <sys/types.h>
extern void ansi_init();
extern void itoa(int,char *,int);
--- a/devlib/qc98xx/Qc98xxEepromSave.c
+++ b/devlib/qc98xx/Qc98xxEepromSave.c
@@ -5,6 +5,7 @@
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
+#include <sys/types.h>
#if 0
#include <sys/file.h>

View file

@ -1,50 +0,0 @@
include $(TOPDIR)/rules.mk
PKG:=athdiag
PKG_NAME:=$(PKG)
PKG_SOURCE_PROTO:=git
PKG_BRANCH:=master
PKG_RELEASE:=1
ifeq ($(CONFIG_WIFI_TARGET_WIFI_2_0),y)
export WIFI_TARGET_2_0:=1
endif
include $(INCLUDE_DIR)/local-development.mk
TARGET_LDFLAGS += $(if $(CONFIG_USE_EGLIBC),-lrt) -pie
TARGET_CFLAGS += -fpie -Wall -Werror
include $(INCLUDE_DIR)/package.mk
FW_hw2_asic:=qca-wifi-fw-hw2-10.4-asic
define Package/athdiag
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
TITLE:= QCA ATHDIAG(athdiag) Driver & tools
URL:=http://www.qca.qualcomm.com
PKG_BUILD_DEPENDS+=$(FW_hw2_asic)
endef
define Package/athdiag/description
athdiag command support for ath10k
endef
define Build/Compile
CFLAGS="$(TARGET_CFLAGS)" \
$(MAKE) -C $(PKG_BUILD_DIR)/ \
TOOLPREFIX="$(TARGET_CROSS)" \
LIBS="$(TARGET_LDFLAGS)" \
DL_DIR="$(DL_DIR)" \
WLAN_TOP=$(PKG_BUILD_DIR) \
all
endef
define Package/athdiag/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/athdiag $(1)/usr/sbin
#$(INSTALL_DATA) $(PKG_BUILD_DIR)/testcmd_tlv/Linux/*.so $(1)/lib
endef
$(eval $(call BuildPackage,athdiag))

View file

@ -1,119 +0,0 @@
include $(TOPDIR)/rules.mk
PKG:=athtestcmd
PKG_NAME:=$(PKG)
PKG_SOURCE_PROTO:=git
PKG_BRANCH:=master
PKG_RELEASE:=1
include $(INCLUDE_DIR)/local-development.mk
include $(INCLUDE_DIR)/package.mk
define Package/athtestcmd
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
TITLE:= QCA TLVCMD(athtestcmd) Driver & tools
DEPENDS:=+librt +libnl-tiny
URL:=http://www.qca.qualcomm.com
VARIANT:=ath10k
endef
define Package/athtestcmd/description
athtestcmd command support for ath10k
endef
define Package/athtestcmd-lith
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
TITLE:= QCA TLVCMD(qcatestcmd) Driver & tools
DEPENDS:=@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq60xx||TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64
URL:=http://www.qca.qualcomm.com
VARIANT:=lithium
endef
define Package/athtestcmd-lith/description
qcatestcmd command support for lithium
endef
define Package/athtestcmd-lith-nl
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
TITLE:= QCA TLVCMD(qcatestcmd) Driver & tools
DEPENDS:=@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64 +libnl +libtcmd
URL:=http://www.qca.qualcomm.com
VARIANT:=lithium-netlink
endef
define Package/athtestcmd-lith-nl/description
qcatestcmd command support for lithium-netlink
endef
ifeq ($(BUILD_VARIANT),ath10k)
TARGET_CPPFLAGS += \
-I$(STAGING_DIR)/usr/include/libnl-tiny
endif
ifeq ($(BUILD_VARIANT),lithium-netlink)
export $(BUILD_VARIANT)
endif
define Build/Compile/lithium-netlink
CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
$(MAKE) -C $(PKG_BUILD_DIR)/lithium/tools/testcmd \
-f makefile.linux \
TOOLPREFIX="$(TARGET_CROSS)" \
LIBS="$(TARGET_LDFLAGS)" \
WLAN_TOP=$(PKG_BUILD_DIR)/$(BUILD_VARIANT)
endef
define Build/Compile/lithium
CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
$(MAKE) -C $(PKG_BUILD_DIR)/lithium/tools/testcmd \
-f makefile.linux \
TOOLPREFIX="$(TARGET_CROSS)" \
LIBS="$(TARGET_LDFLAGS)" \
WLAN_TOP=$(PKG_BUILD_DIR)/$(BUILD_VARIANT)
endef
define Build/Compile/ath10k
CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
$(MAKE) -C $(PKG_BUILD_DIR)/ath10k/testcmd_tlv \
TOOLPREFIX="$(TARGET_CROSS)" \
LIBS="$(TARGET_LDFLAGS)" \
WLAN_TOP=$(PKG_BUILD_DIR)/$(BUILD_VARIANT) \
all
endef
define Build/Compile
$(Build/Compile/$(BUILD_VARIANT))
endef
define Package/athtestcmd/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ath10k/testcmd_tlv/Linux/athtestcmd $(1)/usr/sbin
$(INSTALL_DATA) $(PKG_BUILD_DIR)/ath10k/testcmd_tlv/Linux/*.so $(1)/lib
endef
define Package/athtestcmd-lith/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lithium/tools/testcmd/Linux/qcatestcmd $(1)/usr/sbin
$(INSTALL_DATA) $(PKG_BUILD_DIR)/lithium/tools/testcmd/Linux/*.so $(1)/usr/lib
endef
define Package/athtestcmd-lith-nl/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lithium/tools/testcmd/Linux/qcatestcmd $(1)/usr/sbin
$(INSTALL_DATA) $(PKG_BUILD_DIR)/lithium/tools/testcmd/Linux/*.so $(1)/usr/lib
endef
$(eval $(call BuildPackage,athtestcmd))
$(eval $(call BuildPackage,athtestcmd-lith))
$(eval $(call BuildPackage,athtestcmd-lith-nl))

View file

@ -1,195 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_SOURCE_NAME:=bluetopia
PKG_NAME:=bluetopia-mini
PKG_VERSION:=4.2.1.c1_26
PKG_DIST_VERSION:=4.2.1.c1
PKG_RELEASE:=1
PKG_FOLDER=BLUETOPIA
PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://qcawebsrvr.qualcomm.com/cnss_win/santaclara/dev01/$(PKG_FOLDER)/
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_DIST_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_DIST_VERSION)
PKG_MD5SUM:=ad1a200e30c51254bf1f63b948134037
# Bluetopia Root Paths
export BLUETOPIA_SOURCE_PATH:=$(PKG_BUILD_DIR)/bt_host/Build
export BLUETOPIAPM_SOURCE_PATH:=$(PKG_BUILD_DIR)/bt_host_pm/Build
export BLUETOPIA_ROOT_PATH:=$(PKG_DIST_DIR)/Bluetopia_Dist
export BTPM_DIST_PATH:=$(PKG_DIST_DIR)/BluetopiaPM_Dist
# Bluetopia Core Include and Library Path
BLUETOPIA_INCLUDE_PATH:=$(BLUETOPIA_ROOT_PATH)/include
export BLUETOPIA_LIB_PATH:=$(BLUETOPIA_ROOT_PATH)/lib
# Bluetopia Debug Include and Library Path
BLUETOPIA_DEBUG_INCLUDE_PATH:=$(BLUETOPIA_ROOT_PATH)/debug/include
BLUETOPIA_DEBUG_LIB_PATH:=$(BLUETOPIA_ROOT_PATH)/debug/lib
# Bluetopia Profiles Root Path
export BLUETOPIA_PROFILE_ROOT_PATH:=$(BLUETOPIA_ROOT_PATH)/profiles
# Bluetopia VSER Include and Library Path
BLUETOPIA_VSER_INCLUDE_PATH:=$(BLUETOPIA_ROOT_PATH)/VSER/include
BLUETOPIA_VSER_LIB_PATH:=$(BLUETOPIA_ROOT_PATH)/VSER/lib
# Bluetopia VNET Include and Library Path
BLUETOPIA_VNET_INCLUDE_PATH:=$(BLUETOPIA_ROOT_PATH)/VNET/include
BLUETOPIA_VNET_LIB_PATH:=$(BLUETOPIA_ROOT_PATH)/VNET/lib
# Bluetopia SBC Include and Library Path
BLUETOPIA_SBC_INCLUDE_PATH:=$(BLUETOPIA_ROOT_PATH)/SBC/include
BLUETOPIA_SBC_LIB_PATH:=$(BLUETOPIA_ROOT_PATH)/SBC/lib
# Bluetopia Simple XML Parser Path
export BLUETOPIA_XML_PATH:=$(BLUETOPIA_ROOT_PATH)/XML/SS1SXMLP
# Bluetopia Distribution Path
export BLUETOPIA_PATH:=$(BLUETOPIA_ROOT_PATH)
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=QTI
CATEGORY:=QTI software
TITLE:=$(1) - QTI mini-Bluetopia
DEPENDS:=+libpthread +libopenssl
endef
define Package/$(PKG_NAME)/description
This package contains mini-Bluetopia PM and mini-Bluetopia binaries
endef
SOC=DK07
ifneq (, $(findstring $(SUBTARGET), ipq50xx ipq50xx_64))
SOC=Maple
endif
TARGET_CFLAGS += -Werror -Wall
MAKE_FLAGS="CC=$$(TARGET_CC)" \
"GLOBLDFLAGS=$$(TARGET_LDFLAGS)" \
"GLOBCFLAGS=$$(TARGET_CFLAGS)" \
"GLOBLDLIBS= -lssl -lcrypto"
MAKE_KWFLAG_BTPSKRNL="CC=$$(TARGET_CC)" \
"GLOBLDFLAGS=$$(TARGET_LDFLAGS)" \
"GLOBCFLAGS=$$(TARGET_CFLAGS) -DBTPS_KERNEL_USE_C_RUN_TIME_IMPLEMENTATION=0"
INCLDIRS = -I$(BLUETOPIA_INCLUDE_PATH) \
-I$(BLUETOPIA_DEBUG_INCLUDE_PATH) \
-I$(BLUETOPIA_VSER_INCLUDE_PATH) \
-I$(BLUETOPIA_VNET_INCLUDE_PATH) \
-I$(BLUETOPIA_SBC_INCLUDE_PATH)
LIBDIRS = -L$(BLUETOPIA_LIB_PATH) \
-L$(BLUETOPIA_DEBUG_LIB_PATH) \
-L$(BLUETOPIA_VSER_LIB_PATH) \
-L$(BLUETOPIA_VNET_LIB_PATH) \
-L$(BLUETOPIA_SBC_LIB_PATH)
PM_MAKE_FLAGS="CC=$$(TARGET_CC)" \
"GLOBLDFLAGS=$$(TARGET_LDFLAGS)" \
"GLOBCFLAGS=$$(TARGET_CFLAGS)" \
"BLUETOPIA_INCLUDE_PATH=$$(BLUETOPIA_ROOT_PATH)/include" \
"GLOBLDLIBS= -lssl -lcrypto"
define Build/Prepare
$(TAR) xjvf $(TOPDIR)/dl/$(PKG_SOURCE) -C $(PKG_BUILD_DIR)
$(Build/Patch)
$(CP) $(PKG_BUILD_DIR)/bt_host/Build/Ports/Platform/$(SOC)/* $(PKG_BUILD_DIR)/bt_host/Build/Linux/
ifeq ($(SOC), DK07)
$(CP) $(PKG_BUILD_DIR)/bt_host/Build/Ports/Common/btpssec/openssl/* $(PKG_BUILD_DIR)/bt_host/Build/Linux/btpssec/
endif
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/btpscert -f BTPSCERT.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/btpsfile -f BTPSFILE.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/btpskrnl -f BTPSKRNL.mak all $(MAKE_KWFLAG_BTPSKRNL)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/btpsvend -f BTPSVEND.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/btpssec -f BTPSSEC.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/debug/SS1BTDBG -f SS1BTDBG.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/hcidrv_lin -f HCIDRV.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/ss1btps -f SS1BTPS.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/ss1btle -f SS1BTPS.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/VSER/SS1SER -f SS1SER.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/VSER/SS1VSER -f SS1VSER.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/VNET/SS1VNET -f SS1VNET.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/XML/SS1SXMLP -f SS1SXMLP.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/profiles/GATT -f SS1BTGAT.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/profiles/GATT -f SS1BTGAT_LE.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/profiles_gatt/GAPS -f SS1BTGAP.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/profiles_gatt/DIS -f SS1BTDIS.mak all $(MAKE_FLAGS)
ifeq ($(SOC), DK07)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/profiles_gatt/sample/LinuxSPPLE -f LinuxSPPLE.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/sample/LinuxSPP -f LinuxSPP.mak all $(MAKE_FLAGS)
endif
echo 'creating mini-Bluetopia Dist area'
/bin/sh $(PKG_BUILD_DIR)/bt_host/Build/MakeFull_win.sh /d $(BLUETOPIA_ROOT_PATH) /s $(BLUETOPIA_SOURCE_PATH)
echo 'done creating mini-Bluetopia Dist area'
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmcert -f BTPMCERT.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmdbg -f BTPMDBG.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmerr -f BTPMERR.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmset -f BTPMSET.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmipc/client -f BTPMIPC.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmipc/server -f BTPMIPC.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmmodc/client -f BTPMMODC.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmmodc/server -f BTPMMODC.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmscom/client -f BTPMSCOM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmscom/server -f BTPMSCOM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmsppm/client -f BTPMSPPM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmsppm/server -f BTPMSPPM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmgatm/client -f BTPMGATM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmgatm/server -f BTPMGATM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmdevm/client -f BTPMDEVM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmdevm/server -f BTPMDEVM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/ss1btpml/client -f SS1BTPML.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/ss1btpml/server -f SS1BTPML.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/ss1btpm/client -f SS1BTPM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/ss1btpm/server -f SS1BTPM.mak all $(PM_MAKE_FLAGS)
ifeq ($(SOC), Maple)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/sample/LinuxSPPLE_PM -f LinuxSPPLE_PM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/sample/LinuxSPPM -f LinuxSPPM.mak all $(PM_MAKE_FLAGS)
endif
echo 'creating mini-BluetopiaPM Dist area with default interval 20sec'
/bin/sh $(PKG_BUILD_DIR)/bt_host_pm/Build/MakeFull.sh /d $(BTPM_DIST_PATH) /s $(BLUETOPIAPM_SOURCE_PATH)
echo 'done creating mini-Bluetopia Dist area'
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/bin
ifeq ($(SOC), DK07)
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/profile.d
$(INSTALL_BIN) ./files/PS_KEY_CSR8811.txt $(1)/usr/bin
$(INSTALL_BIN) ./files/bluetopia.init $(1)/etc/init.d/bluetopia
$(INSTALL_BIN) ./files/bt_env.sh $(1)/etc/profile.d/bt_env.sh
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host/Build/Linux/profiles_gatt/sample/LinuxSPPLE/LinuxSPPLE $(1)/usr/bin
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host/Build/Linux/sample/LinuxSPP/LinuxSPP $(1)/usr/bin
endif
ifeq ($(SOC), Maple)
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/ss1btpm/server/SS1BTPM $(1)/usr/bin
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/sample/LinuxSPPLE_PM/LinuxSPPLE_PM $(1)/usr/bin
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/sample/LinuxSPPM/LinuxSPPM $(1)/usr/bin
endif
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View file

@ -1,83 +0,0 @@
#
# Copyright (c) 2020 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# PSKEY_COEX_SCHEME
\x06\xC2\x02\x00\x09\x00\x34\x00\x03\x70\x00\x00\x80\x24\x01\x00\x00\x00\x03\x00
# PSKEY_COEX_PIO_UNITY_3_BT_ACTIVE (BT_active)
\x05\xC2\x02\x00\x0A\x00\x35\x00\x03\x70\x00\x00\x83\x24\x02\x00\x00\x00\x05\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_STATUS (BT_STATUS)
\x05\xC2\x02\x00\x0A\x00\x36\x00\x03\x70\x00\x00\x84\x24\x02\x00\x00\x00\x01\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_DENY (WLAN active?)
\x05\xC2\x02\x00\x0A\x00\x37\x00\x03\x70\x00\x00\x85\x24\x02\x00\x00\x00\x04\x00\x01\x00
#PSKEY_COEX_BLE_TRANSACTION_PRIORITY_TABLE (0x2493, 16 word)
\x05\xC2\x02\x00\x18\x00\x38\x00\x03\x70\x00\x00\x93\x24\x10\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00
#PSKEY_COEX_TRANSACTION_PRIORITY_TABLE (0x2488, 17 word)
\x05\xC2\x02\x00\x19\x00\x39\x00\x03\x70\x00\x00\x88\x24\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00
# PSKEY_PATCH63
\x05\xC2\x02\x00\x29\x00\x20\x00\x03\x70\x00\x00\x39\x21\x21\x00\x00\x00\x02\x00\xDD\x2C\x1B\x01\x12\x0B\x80\x10\xF0\x05\x17\x00\x36\x00\x19\xE1\x12\x02\x14\x02\x99\xE0\xF4\x02\x14\x11\x1B\x00\x12\x2F\x80\x0F\x2C\x05\x19\xE0\x00\xFA\x26\x43\xE0\x05\x00\xF8\x30\x5A\x19\xE0\x26\x00\x18\x02\x2B\xFF\x0E\xFF\x00\x2D\x18\xEB\xE2\x00\xFC\x4C"
# PSKEY_PATCH64
\x05\xC2\x02\x00\x29\x00\x21\x00\x03\x70\x00\x00\x3A\x21\x21\x00\x00\x00\x02\x00\x41\x2E\x1B\x01\x12\x0B\x80\x10\xF0\x05\x17\x00\x36\x00\x19\xE1\x12\x02\x14\x02\x99\xE0\xF4\x02\x14\x0E\x1B\x00\x12\x2F\x80\x0F\x2C\x05\x19\xE0\x00\xFA\x26\x43\xE0\x05\x00\xF8\x30\x5A\x19\xE0\x26\x00\x18\x02\x2B\xFF\x0E\xFF\x00\x2E\x18\x4F\xE2\x00\x99\xE9"
# PSKEY_PATCH65
\x05\xC2\x02\x00\x3E\x00\x22\x00\x03\x70\x00\x00\x3B\x21\x36\x00\x00\x00\x02\x00\x13\x2B\x12\x25\xC0\x10\xF0\x30\x19\xE1\x1A\x00\x00\xE7\x11\x6A\x39\xE0\x16\x02\x99\xE1\xF4\x03\x14\x11\xE0\x02\x14\x02\x19\xE0\x12\x28\xF4\x04\x80\x01\xF0\x20\xE0\x04\x84\x02\xF4\x02\x14\x0E\x1A\x2F\x88\x0F\x2C\x04\x00\xFA\x26\x43\xE0\x04\x00\xF8\x38\x5A\x26\x00\x00\xE7\x15\x6A\x99\xE0\xF4\x08\x11\xE1\x18\x02\x2B\xFF\x0E\xFF\x00\x2B\x18\x3D\xE2\x00\x11\xE1\x18\x02\x2B\xFF\x0E\xFF\x00\x2B\x18\x27\xE2\x00\x0F\xFE\xC4\xB0"
# WARM RESET
\x00\xC2\x02\x00\x09\x00\x47\x00\x02\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
#
#
# For CASCADE PLATFORM, USE THE BELOW PSKEYS
#
# PSKEY_COEX_SCHEME
#\x06\xC2\x02\x00\x09\x00\x34\x00\x03\x70\x00\x00\x80\x24\x01\x00\x00\x00\x03\x00
# PSKEY_COEX_PIO_UNITY_3_BT_ACTIVE (BT_active)
#\x05\xC2\x02\x00\x0A\x00\x35\x00\x03\x70\x00\x00\x83\x24\x02\x00\x00\x00\x09\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_STATUS (BT_STATUS)
#\x05\xC2\x02\x00\x0A\x00\x36\x00\x03\x70\x00\x00\x84\x24\x02\x00\x00\x00\x01\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_DENY (WLAN active?)
#\x05\xC2\x02\x00\x0A\x00\x37\x00\x03\x70\x00\x00\x85\x24\x02\x00\x00\x00\x00\x00\x01\x00
#PSKEY_COEX_BLE_TRANSACTION_PRIORITY_TABLE (0x2493, 16 word)
#\x05\xC2\x02\x00\x18\x00\x38\x00\x03\x70\x00\x00\x93\x24\x10\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00
#PSKEY_COEX_TRANSACTION_PRIORITY_TABLE (0x2488, 17 word)
#\x05\xC2\x02\x00\x19\x00\x39\x00\x03\x70\x00\x00\x88\x24\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00
# WARM RESET
#\x00\xC2\x02\x00\x09\x00\x47\x00\x02\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
#
#
# For HAWKEYE PLATFORM, USE THE BELOW PSKEYS
#
# PSKEY_COEX_SCHEME
#\x06\xC2\x02\x00\x09\x00\x34\x00\x03\x70\x00\x00\x80\x24\x01\x00\x00\x00\x03\x00
# PSKEY_COEX_PIO_UNITY_3_BT_ACTIVE (BT_active)
#\x05\xC2\x02\x00\x0A\x00\x35\x00\x03\x70\x00\x00\x83\x24\x02\x00\x00\x00\x05\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_STATUS (BT_STATUS)
#\x05\xC2\x02\x00\x0A\x00\x36\x00\x03\x70\x00\x00\x84\x24\x02\x00\x00\x00\x01\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_DENY (WLAN active?)
#\x05\xC2\x02\x00\x0A\x00\x37\x00\x03\x70\x00\x00\x85\x24\x02\x00\x00\x00\x04\x00\x01\x00
#PSKEY_COEX_BLE_TRANSACTION_PRIORITY_TABLE (0x2493, 16 word)
#\x05\xC2\x02\x00\x18\x00\x38\x00\x03\x70\x00\x00\x93\x24\x10\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00
#PSKEY_COEX_TRANSACTION_PRIORITY_TABLE (0x2488, 17 word)
#\x05\xC2\x02\x00\x19\x00\x39\x00\x03\x70\x00\x00\x88\x24\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00
# WARM RESET
#\x00\xC2\x02\x00\x09\x00\x47\x00\x02\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
#
#
# For CYPRESS PLATFORM, USE THE BELOW PSKEYS
#
# PSKEY_COEX_SCHEME
#\x06\xC2\x02\x00\x09\x00\x34\x00\x03\x70\x00\x00\x80\x24\x01\x00\x00\x00\x03\x00
# PSKEY_COEX_PIO_UNITY_3_BT_ACTIVE (BT_active)
#\x05\xC2\x02\x00\x0A\x00\x35\x00\x03\x70\x00\x00\x83\x24\x02\x00\x00\x00\x05\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_STATUS (BT_STATUS)
#\x05\xC2\x02\x00\x0A\x00\x36\x00\x03\x70\x00\x00\x84\x24\x02\x00\x00\x00\x01\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_DENY (WLAN active?)
#\x05\xC2\x02\x00\x0A\x00\x37\x00\x03\x70\x00\x00\x85\x24\x02\x00\x00\x00\x04\x00\x01\x00
#PSKEY_COEX_BLE_TRANSACTION_PRIORITY_TABLE (0x2493, 16 word)
#\x05\xC2\x02\x00\x18\x00\x38\x00\x03\x70\x00\x00\x93\x24\x10\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00
#PSKEY_COEX_TRANSACTION_PRIORITY_TABLE (0x2488, 17 word)
#\x05\xC2\x02\x00\x19\x00\x39\x00\x03\x70\x00\x00\x88\x24\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00
# WARM RESET
#\x00\xC2\x02\x00\x09\x00\x47\x00\x02\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
#
#

View file

@ -1,20 +0,0 @@
#!/bin/sh /etc/rc.common
#
#
#Copyright (c) 2020 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
START=15
boot() {
. /lib/functions.sh
art_partition=$(find_mtd_part 0:ART)
export BTHOST_BD_ADDR=0x$(hexdump -n 6 -s 64 $art_partition | cut -d " " -f2-4 | sed 's/ //g'| head -n 1)
echo "$BTHOST_BD_ADDR" > /tmp/BTHOST_BD_ADDR
export BTHOST_XCAL_TRIM=0x$(hexdump -n 7 -s 64 $art_partition | cut -d " " -f5 | head -n 1)
echo "$BTHOST_XCAL_TRIM" > /tmp/BTHOST_XCAL_TRIM
}

View file

@ -1,10 +0,0 @@
#!/bin/sh
#
# Copyright (c) 2020 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
[ -f /tmp/BTHOST_BD_ADDR ] && export BTHOST_BD_ADDR=$(cat /tmp/BTHOST_BD_ADDR)
[ -f /tmp/BTHOST_XCAL_TRIM ] && export BTHOST_XCAL_TRIM=$(cat /tmp/BTHOST_XCAL_TRIM)

View file

@ -1,50 +0,0 @@
diff --git a/bt_host/Build/Core/ss1btps/OTP.c b/bt_host/Build/Core/ss1btps/OTP.c
index a70d71a..751354a 100644
--- a/bt_host/Build/Core/ss1btps/OTP.c
+++ b/bt_host/Build/Core/ss1btps/OTP.c
@@ -1694,7 +1694,7 @@ static char *ExtractNameFromObjectInfo(OTP_ObjectInfo_t *ObjectInfoPtr)
/* The Extended Name Bit is set, extract the pointer to the */
/* Name from the end of the Name member in the Object */
/* Information Structure. */
- ret_val = (char *)READ_OBJECT_INFO_EXTENDED_NAME(ObjectInfoPtr->Name);
+ ret_val = (char *)(uintptr_t)READ_OBJECT_INFO_EXTENDED_NAME(ObjectInfoPtr->Name);
}
else
{
@@ -1738,7 +1738,7 @@ static unsigned int ExtractNameLengthFromObjectInfo(OTP_ObjectInfo_t *ObjectInfo
/* The Extended Name Bit is set, extract the pointer to the */
/* Name from the end of the Name member in the Object */
/* Information Structure. */
- TempCharPtr = (char *)READ_OBJECT_INFO_EXTENDED_NAME(ObjectInfoPtr->Name);
+ TempCharPtr = (char *)(uintptr_t)READ_OBJECT_INFO_EXTENDED_NAME(ObjectInfoPtr->Name);
/* Set the return value to the length of the name. */
ret_val = BTPS_StringLength(TempCharPtr);
@@ -4798,7 +4798,7 @@ static void OTP_GetResponseEvent(unsigned int BluetoothStackID, OTP_Info_t *OTPI
/* Name member. If so free the memory that was */
/* allocated for this response. */
if(EventData->Event_Data.OTP_Get_Directory_Response_Data->DirInfo.ObjectInfo[TempIndex].FieldMask & OTP_OBJECT_INFO_MASK_EXTENDED_NAME)
- BTPS_FreeMemory((void *)READ_OBJECT_INFO_EXTENDED_NAME(EventData->Event_Data.OTP_Get_Directory_Response_Data->DirInfo.ObjectInfo[TempIndex].Name));
+ BTPS_FreeMemory((void *)(uintptr_t)READ_OBJECT_INFO_EXTENDED_NAME(EventData->Event_Data.OTP_Get_Directory_Response_Data->DirInfo.ObjectInfo[TempIndex].Name));
}
}
}
diff --git a/bt_host/Build/Linux/include/BaseTypes.h b/bt_host/Build/Linux/include/BaseTypes.h
index e04173a..cef6b84 100644
--- a/bt_host/Build/Linux/include/BaseTypes.h
+++ b/bt_host/Build/Linux/include/BaseTypes.h
@@ -218,10 +218,10 @@ typedef __PACKED_STRUCT_BEGIN__ struct _tagNonAlignedSQWord_t /* Unaligned Sign
/* format of the Native Host's processor. */
#define ASSIGN_HOST_DWORD_TO_LITTLE_ENDIAN_UNALIGNED_DWORD(_x, _y) \
{ \
- ((Byte_t *)(_x))[0] = ((Byte_t)(((DWord_t)(_y)) & 0xFF)); \
- ((Byte_t *)(_x))[1] = ((Byte_t)((((DWord_t)(_y)) >> 8) & 0xFF)); \
- ((Byte_t *)(_x))[2] = ((Byte_t)((((DWord_t)(_y)) >> 16) & 0xFF)); \
- ((Byte_t *)(_x))[3] = ((Byte_t)((((DWord_t)(_y)) >> 24) & 0xFF)); \
+ ((Byte_t *)(_x))[0] = ((Byte_t)(((DWord_t)(uintptr_t)(_y)) & 0xFF)); \
+ ((Byte_t *)(_x))[1] = ((Byte_t)((((DWord_t)(uintptr_t)(_y)) >> 8) & 0xFF)); \
+ ((Byte_t *)(_x))[2] = ((Byte_t)((((DWord_t)(uintptr_t)(_y)) >> 16) & 0xFF)); \
+ ((Byte_t *)(_x))[3] = ((Byte_t)((((DWord_t)(uintptr_t)(_y)) >> 24) & 0xFF)); \
}
/* The following is a utility MACRO that exists to Assign a */

View file

@ -1,213 +0,0 @@
#
# Copyright (c) 2015 Qualcomm Atheros, Inc.
#
# All Rights Reserved.
# Qualcomm Atheros Confidential and Proprietary.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=bluetopia
PKG_VERSION:=4.2.1.c1_26
PKG_DIST_VERSION:=4.2.1.c1
PKG_RELEASE:=1
PKG_FOLDER=BLUETOPIA
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://qcawebsrvr.qualcomm.com/cnss_win/santaclara/dev01/$(PKG_FOLDER)/
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_DIST_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_DIST_VERSION)
PKG_MD5SUM:=ad1a200e30c51254bf1f63b948134037
# Bluetopia Root Paths
export BLUETOPIA_SOURCE_PATH:=$(PKG_BUILD_DIR)/bt_host/Build
export BLUETOPIAPM_SOURCE_PATH:=$(PKG_BUILD_DIR)/bt_host_pm/Build
export BLUETOPIA_ROOT_PATH:=$(PKG_DIST_DIR)/Bluetopia_Dist
export BTPM_DIST_PATH:=$(PKG_DIST_DIR)/BluetopiaPM_Dist
# Bluetopia Core Include and Library Path
BLUETOPIA_INCLUDE_PATH:=$(BLUETOPIA_ROOT_PATH)/include
export BLUETOPIA_LIB_PATH:=$(BLUETOPIA_ROOT_PATH)/lib
# Bluetopia Debug Include and Library Path
BLUETOPIA_DEBUG_INCLUDE_PATH:=$(BLUETOPIA_ROOT_PATH)/debug/include
BLUETOPIA_DEBUG_LIB_PATH:=$(BLUETOPIA_ROOT_PATH)/debug/lib
# Bluetopia Profiles Root Path
export BLUETOPIA_PROFILE_ROOT_PATH:=$(BLUETOPIA_ROOT_PATH)/profiles
# Bluetopia VSER Include and Library Path
BLUETOPIA_VSER_INCLUDE_PATH:=$(BLUETOPIA_ROOT_PATH)/VSER/include
BLUETOPIA_VSER_LIB_PATH:=$(BLUETOPIA_ROOT_PATH)/VSER/lib
# Bluetopia VNET Include and Library Path
BLUETOPIA_VNET_INCLUDE_PATH:=$(BLUETOPIA_ROOT_PATH)/VNET/include
BLUETOPIA_VNET_LIB_PATH:=$(BLUETOPIA_ROOT_PATH)/VNET/lib
# Bluetopia SBC Include and Library Path
BLUETOPIA_SBC_INCLUDE_PATH:=$(BLUETOPIA_ROOT_PATH)/SBC/include
BLUETOPIA_SBC_LIB_PATH:=$(BLUETOPIA_ROOT_PATH)/SBC/lib
# Bluetopia Simple XML Parser Path
export BLUETOPIA_XML_PATH:=$(BLUETOPIA_ROOT_PATH)/XML/SS1SXMLP
# Bluetopia Distribution Path
export BLUETOPIA_PATH:=$(BLUETOPIA_ROOT_PATH)
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=QCA
CATEGORY:=QTI software
TITLE:=$(1) - QCA Bluetopia
DEPENDS:=+libpthread +libopenssl
endef
define Package/$(PKG_NAME)/description
This package contains Bluetopia PM and Bluetopia binaries
endef
SOC=DK07
ifneq (, $(findstring $(SUBTARGET), ipq50xx ipq50xx_64))
SOC=Maple
endif
TARGET_CFLAGS += -Werror -Wall
MAKE_FLAGS="CC=$$(TARGET_CC)" \
"GLOBLDFLAGS=$$(TARGET_LDFLAGS)" \
"GLOBCFLAGS=$$(TARGET_CFLAGS)" \
"GLOBLDLIBS= -lssl -lcrypto"
MAKE_KWFLAG_BTPSKRNL="CC=$$(TARGET_CC)" \
"GLOBLDFLAGS=$$(TARGET_LDFLAGS)" \
"GLOBCFLAGS=$$(TARGET_CFLAGS) -DBTPS_KERNEL_USE_C_RUN_TIME_IMPLEMENTATION=0"
INCLDIRS = -I$(BLUETOPIA_INCLUDE_PATH) \
-I$(BLUETOPIA_DEBUG_INCLUDE_PATH) \
-I$(BLUETOPIA_VSER_INCLUDE_PATH) \
-I$(BLUETOPIA_VNET_INCLUDE_PATH) \
-I$(BLUETOPIA_SBC_INCLUDE_PATH)
LIBDIRS = -L$(BLUETOPIA_LIB_PATH) \
-L$(BLUETOPIA_DEBUG_LIB_PATH) \
-L$(BLUETOPIA_VSER_LIB_PATH) \
-L$(BLUETOPIA_VNET_LIB_PATH) \
-L$(BLUETOPIA_SBC_LIB_PATH)
PM_MAKE_FLAGS="CC=$$(TARGET_CC)" \
"GLOBLDFLAGS=$$(TARGET_LDFLAGS)" \
"GLOBCFLAGS=$$(TARGET_CFLAGS)" \
"BLUETOPIA_INCLUDE_PATH=$$(BLUETOPIA_ROOT_PATH)/include" \
"GLOBLDLIBS= -lssl -lcrypto"
define Build/Prepare
$(TAR) xjvf $(TOPDIR)/dl/$(PKG_SOURCE) -C $(PKG_BUILD_DIR)
$(Build/Patch)
$(CP) $(PKG_BUILD_DIR)/bt_host/Build/Ports/Platform/$(SOC)/* $(PKG_BUILD_DIR)/bt_host/Build/Linux/
ifeq ($(SOC), DK07)
$(CP) $(PKG_BUILD_DIR)/bt_host/Build/Ports/Common/btpssec/openssl/* $(PKG_BUILD_DIR)/bt_host/Build/Linux/btpssec/
endif
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/btpscert -f BTPSCERT.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/btpsfile -f BTPSFILE.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/btpskrnl -f BTPSKRNL.mak all $(MAKE_KWFLAG_BTPSKRNL)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/btpsvend -f BTPSVEND.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/btpssec -f BTPSSEC.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/debug/SS1BTDBG -f SS1BTDBG.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/hcidrv_lin -f HCIDRV.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/ss1btps -f SS1BTPS.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/ss1btle -f SS1BTPS.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/VSER/SS1SER -f SS1SER.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/VSER/SS1VSER -f SS1VSER.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/VNET/SS1VNET -f SS1VNET.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/XML/SS1SXMLP -f SS1SXMLP.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/profiles/GATT -f SS1BTGAT.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/profiles/GATT -f SS1BTGAT_LE.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/profiles_gatt/GAPS -f SS1BTGAP.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/profiles_gatt/DIS -f SS1BTDIS.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/profiles_gatt/sample/LinuxSPPLE -f LinuxSPPLE.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/sample/LinuxSCO -f LinuxSCO.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/sample/LinuxHCI -f LinuxHCI.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/sample/LinuxL2CAP -f LinuxL2CAP.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/sample/LinuxSDP -f LinuxSDP.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/sample/SS1BTVEN -f SS1BTVEN.mak all $(MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host/Build/Linux/sample/LinuxSPP -f LinuxSPP.mak all $(MAKE_FLAGS)
echo 'creating Bluetopia Dist area'
/bin/sh $(PKG_BUILD_DIR)/bt_host/Build/MakeFull_win.sh /d $(BLUETOPIA_ROOT_PATH) /s $(BLUETOPIA_SOURCE_PATH)
echo 'done creating Bluetopia Dist area'
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmcert -f BTPMCERT.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmdbg -f BTPMDBG.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmerr -f BTPMERR.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmset -f BTPMSET.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmipc/client -f BTPMIPC.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmipc/server -f BTPMIPC.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmmodc/client -f BTPMMODC.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmmodc/server -f BTPMMODC.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmscom/client -f BTPMSCOM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmscom/server -f BTPMSCOM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmsppm/client -f BTPMSPPM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmsppm/server -f BTPMSPPM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmgatm/client -f BTPMGATM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmgatm/server -f BTPMGATM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmdevm/client -f BTPMDEVM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/btpmdevm/server -f BTPMDEVM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/ss1btpml/client -f SS1BTPML.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/ss1btpml/server -f SS1BTPML.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/ss1btpm/client -f SS1BTPM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/ss1btpm/server -f SS1BTPM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/sample/LinuxSPPLE_PM -f LinuxSPPLE_PM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/sample/LinuxSPPM -f LinuxSPPM.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/sample/LinuxGATM -f LinuxGATM_CLT.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/sample/LinuxGATM -f LinuxGATM_SRV.mak all $(PM_MAKE_FLAGS)
$(MAKE) -C $(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/sample/LinuxDEVM -f LinuxDEVM.mak all $(PM_MAKE_FLAGS)
echo 'creating BluetopiaPM Dist area with default interval 20sec'
/bin/sh $(PKG_BUILD_DIR)/bt_host_pm/Build/MakeFull.sh /d $(BTPM_DIST_PATH) /s $(BLUETOPIAPM_SOURCE_PATH)
echo 'done creating Bluetopia Dist area'
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/profile.d
$(INSTALL_BIN) ./files/PS_KEY_CSR8811.txt $(1)/usr/bin
$(INSTALL_BIN) ./files/bluetopia.init $(1)/etc/init.d/bluetopia
$(INSTALL_BIN) ./files/bt_env.sh $(1)/etc/profile.d/bt_env.sh
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host/Build/Linux/sample/LinuxHCI/LinuxHCI $(1)/usr/bin/
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host/Build/Linux/sample/LinuxL2CAP/LinuxL2CAP $(1)/usr/bin/
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host/Build/Linux/sample/LinuxSCO/LinuxSCO $(1)/usr/bin/
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host/Build/Linux/sample/LinuxSDP/LinuxSDP $(1)/usr/bin/
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host/Build/Linux/profiles_gatt/sample/LinuxSPPLE/LinuxSPPLE $(1)/usr/bin
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host/Build/Linux/sample/LinuxSPP/LinuxSPP $(1)/usr/bin
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/ss1btpm/server/SS1BTPM $(1)/usr/bin
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/sample/LinuxSPPLE_PM/LinuxSPPLE_PM $(1)/usr/bin
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/sample/LinuxSPPM/LinuxSPPM $(1)/usr/bin
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/sample/LinuxGATM/LinuxGATM_CLT $(1)/usr/bin
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/bt_host_pm/Build/Linux/sample/LinuxDEVM/LinuxDEVM $(1)/usr/bin
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View file

@ -1,76 +0,0 @@
# PSKEY_COEX_SCHEME
\x06\xC2\x02\x00\x09\x00\x34\x00\x03\x70\x00\x00\x80\x24\x01\x00\x00\x00\x03\x00
# PSKEY_COEX_PIO_UNITY_3_BT_ACTIVE (BT_active)
\x05\xC2\x02\x00\x0A\x00\x35\x00\x03\x70\x00\x00\x83\x24\x02\x00\x00\x00\x05\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_STATUS (BT_STATUS)
\x05\xC2\x02\x00\x0A\x00\x36\x00\x03\x70\x00\x00\x84\x24\x02\x00\x00\x00\x01\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_DENY (WLAN active?)
\x05\xC2\x02\x00\x0A\x00\x37\x00\x03\x70\x00\x00\x85\x24\x02\x00\x00\x00\x04\x00\x01\x00
#PSKEY_COEX_BLE_TRANSACTION_PRIORITY_TABLE (0x2493, 16 word)
\x05\xC2\x02\x00\x18\x00\x38\x00\x03\x70\x00\x00\x93\x24\x10\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00
#PSKEY_COEX_TRANSACTION_PRIORITY_TABLE (0x2488, 17 word)
\x05\xC2\x02\x00\x19\x00\x39\x00\x03\x70\x00\x00\x88\x24\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00
# PSKEY_PATCH63
\x05\xC2\x02\x00\x29\x00\x20\x00\x03\x70\x00\x00\x39\x21\x21\x00\x00\x00\x02\x00\xDD\x2C\x1B\x01\x12\x0B\x80\x10\xF0\x05\x17\x00\x36\x00\x19\xE1\x12\x02\x14\x02\x99\xE0\xF4\x02\x14\x11\x1B\x00\x12\x2F\x80\x0F\x2C\x05\x19\xE0\x00\xFA\x26\x43\xE0\x05\x00\xF8\x30\x5A\x19\xE0\x26\x00\x18\x02\x2B\xFF\x0E\xFF\x00\x2D\x18\xEB\xE2\x00\xFC\x4C"
# PSKEY_PATCH64
\x05\xC2\x02\x00\x29\x00\x21\x00\x03\x70\x00\x00\x3A\x21\x21\x00\x00\x00\x02\x00\x41\x2E\x1B\x01\x12\x0B\x80\x10\xF0\x05\x17\x00\x36\x00\x19\xE1\x12\x02\x14\x02\x99\xE0\xF4\x02\x14\x0E\x1B\x00\x12\x2F\x80\x0F\x2C\x05\x19\xE0\x00\xFA\x26\x43\xE0\x05\x00\xF8\x30\x5A\x19\xE0\x26\x00\x18\x02\x2B\xFF\x0E\xFF\x00\x2E\x18\x4F\xE2\x00\x99\xE9"
# PSKEY_PATCH65
\x05\xC2\x02\x00\x3E\x00\x22\x00\x03\x70\x00\x00\x3B\x21\x36\x00\x00\x00\x02\x00\x13\x2B\x12\x25\xC0\x10\xF0\x30\x19\xE1\x1A\x00\x00\xE7\x11\x6A\x39\xE0\x16\x02\x99\xE1\xF4\x03\x14\x11\xE0\x02\x14\x02\x19\xE0\x12\x28\xF4\x04\x80\x01\xF0\x20\xE0\x04\x84\x02\xF4\x02\x14\x0E\x1A\x2F\x88\x0F\x2C\x04\x00\xFA\x26\x43\xE0\x04\x00\xF8\x38\x5A\x26\x00\x00\xE7\x15\x6A\x99\xE0\xF4\x08\x11\xE1\x18\x02\x2B\xFF\x0E\xFF\x00\x2B\x18\x3D\xE2\x00\x11\xE1\x18\x02\x2B\xFF\x0E\xFF\x00\x2B\x18\x27\xE2\x00\x0F\xFE\xC4\xB0"
# WARM RESET
\x00\xC2\x02\x00\x09\x00\x47\x00\x02\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
#
#
# For CASCADE PLATFORM, USE THE BELOW PSKEYS
#
# PSKEY_COEX_SCHEME
#\x06\xC2\x02\x00\x09\x00\x34\x00\x03\x70\x00\x00\x80\x24\x01\x00\x00\x00\x03\x00
# PSKEY_COEX_PIO_UNITY_3_BT_ACTIVE (BT_active)
#\x05\xC2\x02\x00\x0A\x00\x35\x00\x03\x70\x00\x00\x83\x24\x02\x00\x00\x00\x09\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_STATUS (BT_STATUS)
#\x05\xC2\x02\x00\x0A\x00\x36\x00\x03\x70\x00\x00\x84\x24\x02\x00\x00\x00\x01\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_DENY (WLAN active?)
#\x05\xC2\x02\x00\x0A\x00\x37\x00\x03\x70\x00\x00\x85\x24\x02\x00\x00\x00\x00\x00\x01\x00
#PSKEY_COEX_BLE_TRANSACTION_PRIORITY_TABLE (0x2493, 16 word)
#\x05\xC2\x02\x00\x18\x00\x38\x00\x03\x70\x00\x00\x93\x24\x10\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00
#PSKEY_COEX_TRANSACTION_PRIORITY_TABLE (0x2488, 17 word)
#\x05\xC2\x02\x00\x19\x00\x39\x00\x03\x70\x00\x00\x88\x24\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00
# WARM RESET
#\x00\xC2\x02\x00\x09\x00\x47\x00\x02\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
#
#
# For HAWKEYE PLATFORM, USE THE BELOW PSKEYS
#
# PSKEY_COEX_SCHEME
#\x06\xC2\x02\x00\x09\x00\x34\x00\x03\x70\x00\x00\x80\x24\x01\x00\x00\x00\x03\x00
# PSKEY_COEX_PIO_UNITY_3_BT_ACTIVE (BT_active)
#\x05\xC2\x02\x00\x0A\x00\x35\x00\x03\x70\x00\x00\x83\x24\x02\x00\x00\x00\x05\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_STATUS (BT_STATUS)
#\x05\xC2\x02\x00\x0A\x00\x36\x00\x03\x70\x00\x00\x84\x24\x02\x00\x00\x00\x01\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_DENY (WLAN active?)
#\x05\xC2\x02\x00\x0A\x00\x37\x00\x03\x70\x00\x00\x85\x24\x02\x00\x00\x00\x04\x00\x01\x00
#PSKEY_COEX_BLE_TRANSACTION_PRIORITY_TABLE (0x2493, 16 word)
#\x05\xC2\x02\x00\x18\x00\x38\x00\x03\x70\x00\x00\x93\x24\x10\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00
#PSKEY_COEX_TRANSACTION_PRIORITY_TABLE (0x2488, 17 word)
#\x05\xC2\x02\x00\x19\x00\x39\x00\x03\x70\x00\x00\x88\x24\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00
# WARM RESET
#\x00\xC2\x02\x00\x09\x00\x47\x00\x02\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
#
#
# For CYPRESS PLATFORM, USE THE BELOW PSKEYS
#
# PSKEY_COEX_SCHEME
#\x06\xC2\x02\x00\x09\x00\x34\x00\x03\x70\x00\x00\x80\x24\x01\x00\x00\x00\x03\x00
# PSKEY_COEX_PIO_UNITY_3_BT_ACTIVE (BT_active)
#\x05\xC2\x02\x00\x0A\x00\x35\x00\x03\x70\x00\x00\x83\x24\x02\x00\x00\x00\x05\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_STATUS (BT_STATUS)
#\x05\xC2\x02\x00\x0A\x00\x36\x00\x03\x70\x00\x00\x84\x24\x02\x00\x00\x00\x01\x00\x01\x00
# PSKEY_COEX_PIO_UNITY_3_BT_DENY (WLAN active?)
#\x05\xC2\x02\x00\x0A\x00\x37\x00\x03\x70\x00\x00\x85\x24\x02\x00\x00\x00\x04\x00\x01\x00
#PSKEY_COEX_BLE_TRANSACTION_PRIORITY_TABLE (0x2493, 16 word)
#\x05\xC2\x02\x00\x18\x00\x38\x00\x03\x70\x00\x00\x93\x24\x10\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00
#PSKEY_COEX_TRANSACTION_PRIORITY_TABLE (0x2488, 17 word)
#\x05\xC2\x02\x00\x19\x00\x39\x00\x03\x70\x00\x00\x88\x24\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00
# WARM RESET
#\x00\xC2\x02\x00\x09\x00\x47\x00\x02\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
#
#

View file

@ -1,20 +0,0 @@
#!/bin/sh /etc/rc.common
#
#
#Copyright (c) 2016 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
START=15
boot() {
. /lib/functions.sh
art_partition=$(find_mtd_part 0:ART)
export BTHOST_BD_ADDR=0x$(hexdump -n 6 -s 64 $art_partition | cut -d " " -f2-4 | sed 's/ //g'| head -n 1)
echo "$BTHOST_BD_ADDR" > /tmp/BTHOST_BD_ADDR
export BTHOST_XCAL_TRIM=0x$(hexdump -n 7 -s 64 $art_partition | cut -d " " -f5 | head -n 1)
echo "$BTHOST_XCAL_TRIM" > /tmp/BTHOST_XCAL_TRIM
}

View file

@ -1,10 +0,0 @@
#!/bin/sh
#
# Copyright (c) 2020 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
[ -f /tmp/BTHOST_BD_ADDR ] && export BTHOST_BD_ADDR=$(cat /tmp/BTHOST_BD_ADDR)
[ -f /tmp/BTHOST_XCAL_TRIM ] && export BTHOST_XCAL_TRIM=$(cat /tmp/BTHOST_XCAL_TRIM)

View file

@ -1,50 +0,0 @@
diff --git a/bt_host/Build/Core/ss1btps/OTP.c b/bt_host/Build/Core/ss1btps/OTP.c
index a70d71a..751354a 100644
--- a/bt_host/Build/Core/ss1btps/OTP.c
+++ b/bt_host/Build/Core/ss1btps/OTP.c
@@ -1694,7 +1694,7 @@ static char *ExtractNameFromObjectInfo(OTP_ObjectInfo_t *ObjectInfoPtr)
/* The Extended Name Bit is set, extract the pointer to the */
/* Name from the end of the Name member in the Object */
/* Information Structure. */
- ret_val = (char *)READ_OBJECT_INFO_EXTENDED_NAME(ObjectInfoPtr->Name);
+ ret_val = (char *)(uintptr_t)READ_OBJECT_INFO_EXTENDED_NAME(ObjectInfoPtr->Name);
}
else
{
@@ -1738,7 +1738,7 @@ static unsigned int ExtractNameLengthFromObjectInfo(OTP_ObjectInfo_t *ObjectInfo
/* The Extended Name Bit is set, extract the pointer to the */
/* Name from the end of the Name member in the Object */
/* Information Structure. */
- TempCharPtr = (char *)READ_OBJECT_INFO_EXTENDED_NAME(ObjectInfoPtr->Name);
+ TempCharPtr = (char *)(uintptr_t)READ_OBJECT_INFO_EXTENDED_NAME(ObjectInfoPtr->Name);
/* Set the return value to the length of the name. */
ret_val = BTPS_StringLength(TempCharPtr);
@@ -4798,7 +4798,7 @@ static void OTP_GetResponseEvent(unsigned int BluetoothStackID, OTP_Info_t *OTPI
/* Name member. If so free the memory that was */
/* allocated for this response. */
if(EventData->Event_Data.OTP_Get_Directory_Response_Data->DirInfo.ObjectInfo[TempIndex].FieldMask & OTP_OBJECT_INFO_MASK_EXTENDED_NAME)
- BTPS_FreeMemory((void *)READ_OBJECT_INFO_EXTENDED_NAME(EventData->Event_Data.OTP_Get_Directory_Response_Data->DirInfo.ObjectInfo[TempIndex].Name));
+ BTPS_FreeMemory((void *)(uintptr_t)READ_OBJECT_INFO_EXTENDED_NAME(EventData->Event_Data.OTP_Get_Directory_Response_Data->DirInfo.ObjectInfo[TempIndex].Name));
}
}
}
diff --git a/bt_host/Build/Linux/include/BaseTypes.h b/bt_host/Build/Linux/include/BaseTypes.h
index e04173a..cef6b84 100644
--- a/bt_host/Build/Linux/include/BaseTypes.h
+++ b/bt_host/Build/Linux/include/BaseTypes.h
@@ -218,10 +218,10 @@ typedef __PACKED_STRUCT_BEGIN__ struct _tagNonAlignedSQWord_t /* Unaligned Sign
/* format of the Native Host's processor. */
#define ASSIGN_HOST_DWORD_TO_LITTLE_ENDIAN_UNALIGNED_DWORD(_x, _y) \
{ \
- ((Byte_t *)(_x))[0] = ((Byte_t)(((DWord_t)(_y)) & 0xFF)); \
- ((Byte_t *)(_x))[1] = ((Byte_t)((((DWord_t)(_y)) >> 8) & 0xFF)); \
- ((Byte_t *)(_x))[2] = ((Byte_t)((((DWord_t)(_y)) >> 16) & 0xFF)); \
- ((Byte_t *)(_x))[3] = ((Byte_t)((((DWord_t)(_y)) >> 24) & 0xFF)); \
+ ((Byte_t *)(_x))[0] = ((Byte_t)(((DWord_t)(uintptr_t)(_y)) & 0xFF)); \
+ ((Byte_t *)(_x))[1] = ((Byte_t)((((DWord_t)(uintptr_t)(_y)) >> 8) & 0xFF)); \
+ ((Byte_t *)(_x))[2] = ((Byte_t)((((DWord_t)(uintptr_t)(_y)) >> 16) & 0xFF)); \
+ ((Byte_t *)(_x))[3] = ((Byte_t)((((DWord_t)(uintptr_t)(_y)) >> 24) & 0xFF)); \
}
/* The following is a utility MACRO that exists to Assign a */

View file

@ -1,8 +0,0 @@
config FEATURE_QCA_IOT_IPQ50XX_SUPPORT
bool "Enables btdaemon package for ipq50xx"
depends on TARGET_ipq_ipq50xx || TARGET_ipq_ipq50xx_64
default no
select PACKAGE_btdaemon
help
Enables btdaemon for IPQ50xx Platform

View file

@ -1,51 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/package.mk
PKG_NAME:=btdaemon
PKG_VERSION:=1.0
PKG_RELEASE:=1
LOCAL_SRC:=$(TOPDIR)/qca/src/btdaemon
define Package/$(PKG_NAME)
SECTION:=btdaemon
CATEGORY:=btdaemon
TITLE:=Bluetooth Daemon Library to transport Packets from FTM Application to Future Platforms.
DEPENDS:=@TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64 +qca-diag
endef
define Package/$(PKG_NAME)/description
Bluetooth Daemon Application to transport HCI Packets
endef
TARGET_CFLAGS += \
-DIPQ_IPQ50XX_SUPPORT \
-DDEBUG \
-DBTD_DEBUG \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/qca-diag \
-Wall \
-Werror
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
cp $(LOCAL_SRC)/* $(PKG_BUILD_DIR)
$(Build/Patch)
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR)/usr/include/btdaemon
$(CP) $(PKG_BUILD_DIR)/btdaemon.h $(STAGING_DIR)/usr/include/btdaemon
$(CP) $(PKG_BUILD_DIR)/libbtdaemon.so $(STAGING_DIR)/usr/lib
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libbtdaemon.so $(1)/usr/lib
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View file

@ -0,0 +1,70 @@
#
# Copyright (C) 2021 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=nss-firmware
PKG_SOURCE_DATE:=2021-03-12
PKG_SOURCE_VERSION:=73f378d6be21a9c20a69b77000dbb54a537006a9
PKG_MIRROR_HASH:=0c21afe29002754edf2983bc9e8543dddd722e75bd12e961e300e99a310d1f62
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/quic/qca-sdk-nss-fw.git
PKG_LICENSE_FILES:=LICENSE.md
PKG_MAINTAINER:=Robert Marko <robimarko@gmail.com>
include $(INCLUDE_DIR)/package.mk
VERSION_PATH=$(PKG_BUILD_DIR)/QCA_Networking_2020.SPF_11.3/CS
define Package/nss-firmware-default
SECTION:=firmware
CATEGORY:=Firmware
URL:=$(PKG_SOURCE_URL)
DEPENDS:=@(TARGET_ipq807x||TARGET_ipq60xx)
endef
define Package/nss-firmware-ipq6018
$(Package/nss-firmware-default)
TITLE:=NSS firmware for IPQ6018 devices
NSS_ARCHIVE:=$(VERSION_PATH)/IPQ6018.ATH.11.3/BIN-NSS.CP.11.3-9-R.tar.bz2
endef
define Package/nss-firmware-ipq8074
$(Package/nss-firmware-default)
TITLE:=NSS firmware for IPQ8074 devices
NSS_ARCHIVE:=$(VERSION_PATH)/IPQ8074.ATH.11.3/BIN-NSS.HK.11.3-9-R.tar.bz2
endef
define Build/Compile
endef
define Package/nss-firmware-ipq6018/install
$(TAR) -C $(PKG_BUILD_DIR) -xf $(NSS_ARCHIVE)
$(INSTALL_DIR) $(1)/lib/firmware/
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/BIN-NSS.CP.11.3-9-R/retail_router0.bin \
$(1)/lib/firmware/qca-nss0-retail.bin
endef
define Package/nss-firmware-ipq8074/install
$(TAR) -C $(PKG_BUILD_DIR) -xf $(NSS_ARCHIVE)
$(INSTALL_DIR) $(1)/lib/firmware/
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/BIN-NSS.HK.11.3-9-R/retail_router0.bin \
$(1)/lib/firmware/qca-nss0-retail.bin
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/BIN-NSS.HK.11.3-9-R/retail_router1.bin \
$(1)/lib/firmware/qca-nss1-retail.bin
endef
$(eval $(call BuildPackage,nss-firmware-ipq6018))
$(eval $(call BuildPackage,nss-firmware-ipq8074))

View file

@ -1,132 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/package.mk
PKG_RELEASE:=1
define Package/hyfi/Default
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros
DEPENDS:=+kmod-qca-hyfi-bridge +qca-libhyfi-bridge \
+qca-hyctl +libwpa2 \
+libhyficommon +libstorage +libieee1905 +SUPPORT_WIFISON_EXT_LIB:qca-wifison-ext-lib
MAINTAINER:=Qualcomm Atheros
endef
define Package/hyfi
$(call Package/hyfi/Default)
TITLE:=Hy-Fi - selects all Hy-Fi components for build
DEPENDS+=+qca-hyd +qca-wsplcd
MAINTAINER:=Qualcomm Atheros
endef
define Package/hyfi/description
Meta package which selects all Hy-Fi components require for build
endef
define Package/hyfi/install
@true
endef
define Package/hyfi-plc
$(call Package/hyfi/Default)
TITLE:=Hy-Fi - selects all Hy-Fi and PLC components for build
DEPENDS+=+qca-hyd-plc +qca-wsplcd +qca-vhyfid +qca-plc-serv
endef
define Package/hyfi-plc/description
Meta package which selects all Hy-Fi and PLC components require for build
endef
define Package/hyfi-plc/install
@true
endef
define Package/hyfi-son
$(call Package/hyfi/Default)
TITLE:=Hy-Fi - selects all Hy-Fi components for build (with SON Features)
DEPENDS+=+qca-hyd-son +qca-wsplcd-son
endef
define Package/hyfi-son/description
Meta package which selects all Hy-Fi SON components require for build
endef
define Package/hyfi-son/install
@true
endef
define Package/hyfi-map
$(call Package/hyfi/Default)
TITLE:=Hy-Fi - selects all Hy-Fi components for build (with MAP Features)
DEPENDS+=+qca-wsplcd-map
endef
define Package/hyfi-map/description
Meta package which selects all Hy-Fi MAP components require for build
endef
define Package/hyfi-map/install
@true
endef
define Package/hyfi-sonplc
$(call Package/hyfi/Default)
TITLE:=Hy-Fi - selects all Hy-Fi and PLC components for build (with SON Features)
DEPENDS+=+qca-hyd-sonplc +qca-wsplcd-son +qca-vhyfid +qca-plc-serv
endef
define Package/hyfi-sonplc/description
Meta package which selects all Hy-Fi SON and PLC components require for build
endef
define Package/hyfi-sonplc/install
@true
endef
# =============== Engg
#
define Package/hyfi-mesh
$(call Package/hyfi/Default)
TITLE:=Hy-Fi - selects all Hy-Fi components for build
DEPENDS+=+qca-wsplcd-map +qca-hyd-son +qca-wsplcd-son
endef
define Package/hyfi-mesh/description
Meta package which selects all Hy-Fi components require for build
endef
define Package/hyfi-mesh/install
@true
endef
PKG_NAME:=hyfi-ui
define Package/$(PKG_NAME)
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros
TITLE:=Hy-Fi - selects all Hy-Fi web interfaces
DEPENDS:=+luci-hyfi +luci-hyfi-advanced +luci-wsplc +luci-wsplc-advanced
MAINTAINER:=Qualcomm Atheros
endef
define Package/$(PKG_NAME)/description
Meta package which selects all Hy-Fi web interfaces
endef
define Package/$(PKG_NAME)/install
@true
endef
define Build/Compile
endef
$(eval $(call BuildPackage,hyfi))
$(eval $(call BuildPackage,hyfi-plc))
$(eval $(call BuildPackage,hyfi-ui))
$(eval $(call BuildPackage,hyfi-son))
$(eval $(call BuildPackage,hyfi-map))
$(eval $(call BuildPackage,hyfi-sonplc))
$(eval $(call BuildPackage,hyfi-mesh))

View file

@ -1,64 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qca-hyctl
PKG_VERSION:=g26508a7
PKG_RELEASE:=1
include $(INCLUDE_DIR)/local-development.mk
ifeq ($(DUMP)$(PKG_VERSION),)
PKG_REV:=26508a7
PKG_VERSION:=g26508a7
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
TARGET_CFLAGS += -fpie
TARGET_LDFLAGS += -pie
QCAHYCTL_MAKE_OPTS:= \
CROSS=$(TARGET_CROSS) \
GWLIB=$(STAGING_DIR)/usr/lib \
GWINCLUDE=$(STAGING_DIR)/usr/include/qca \
HYFIDIR=$(STAGING_DIR)/usr/include/hyfibr \
HYFIMCDIR=$(STAGING_DIR)/usr/include/hyfibr \
HYFIBRLIBDIR=$(STAGING_DIR)/usr/include/libhyfibr \
EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
EXTRA_LDFLAGS="-Wl,--gc-sections $(TARGET_LDFLAGS)" \
INSTALL_ROOT=$(PKG_BUILD_DIR)/install
QCAHYCTL_DEPENDS+=+ENABLE_SON_MEMORY_DEBUG:qca-son-mem-debug
ifeq ($(CONFIG_ENABLE_SON_MEMORY_DEBUG),y)
QCAHYCTL_MAKE_OPTS+=ENABLE_SON_MEMORY_DEBUG=y
QCAHYCTL_MAKE_OPTS+=SONMEMDEBUGINCLUDE=$(STAGING_DIR)/usr/include/son-mem-dbg
endif
define Package/qca-hyctl
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros, Inc.
DEPENDS:=+kmod-qca-hyfi-bridge +qca-libhyfi-bridge $(QCAHYCTL_DEPENDS)
TITLE:=Hy-Fi Control and Configuration command line utility
SUBMENU:=Hy-Fi features
endef
define Package/qca-hyctl/description
This package installs the Hy-Fi control command line utility
endef
define Build/Compile
mkdir -p $(PKG_BUILD_DIR)/install/lib
mkdir -p $(PKG_BUILD_DIR)/install/include
$(MAKE) -C $(PKG_BUILD_DIR) $(strip $(QCAHYCTL_MAKE_OPTS)) all
endef
define Package/qca-hyctl/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/install/hyctl $(1)/usr/sbin
endef
$(eval $(call BuildPackage,qca-hyctl))

View file

@ -1,88 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qca-hyfi-bridge
PKG_RELEASE:=1
include $(INCLUDE_DIR)/local-development.mk
ifeq ($(DUMP)$(PKG_VERSION),)
PKG_VERSION:=g3cfe593
endif
PKG_BUILD_DEPENDS += qca-ssdk
include $(INCLUDE_DIR)/package.mk
QCAHYFI_BRIDGE_MAKE_OPTS:= \
CROSS_COMPILE=$(KERNEL_CROSS) \
ARCH=$(LINUX_KARCH) \
HYBRID_MC_MLD=1 \
KERNELPATH=$(LINUX_SRC_DIR) \
KBUILDPATH=$(LINUX_DIR) \
KERNELRELEASE=$(LINUX_RELEASE) \
MDIR=$(PKG_BUILD_DIR) \
STAGING_DIR=$(STAGING_DIR)
ifeq ($(CONFIG_PACKAGE_qca-plc-serv),y)
QCAHYFI_BRIDGE_MAKE_OPTS += PLC_SUPPORT_NF=1
endif
ifeq ($(CONFIG_HYFI_DISABLE_SSDK_SUPPORT),y)
QCAHYFI_BRIDGE_MAKE_OPTS+= DISABLE_SSDK_SUPPORT=1
endif
ifneq ($(CONFIG_PACKAGE_kmod-emesh-sp),)
QCAHYFI_BRIDGE_MAKE_OPTS += HYFI_BRIDGE_EMESH_ENABLE=1
endif
QCAHYBRID_MODULE_LIST:=$(PKG_BUILD_DIR)/hyfi-bridging.ko
define KernelPackage/qca-hyfi-bridge
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros, Inc.
TITLE:=Hy-Fi Bridging Netfilter Module
KCONFIG:= \
CONFIG_NETFILTER=y \
CONFIG_BRIDGE_NETFILTER=y
DEPENDS:=+LINUX_5_4:kmod-qca-ssdk-nohnat +PACKAGE_kmod-emesh-sp:kmod-emesh-sp
FILES:= $(strip $(QCAHYBRID_MODULE_LIST))
AUTOLOAD:=$(call AutoLoad,51,hyfi-bridging)
SUBMENU:=Hy-Fi features
endef
define KernelPackage/qca-hyfi-bridge/description
This package installs the Hy-Fi bridging Netfilter Module
endef
define KernelPackage/qca-hyfi-bridge/config
config HYFI_DISABLE_SSDK_SUPPORT
bool "Disable SSDK support for IPQ platform"
default n
help
This option disable SSDK support
endef
QCA_HYFI_BRIDGE_HEADERS= \
$(PKG_BUILD_DIR)/hyfi-multicast/mc_api.h \
$(PKG_BUILD_DIR)/hyfi-netfilter/hyfi_ecm.h \
$(PKG_BUILD_DIR)/hyfi-netfilter/hyfi_api.h \
$(PKG_BUILD_DIR)/hyfi-netfilter/hyfi_hash.h
ifneq ($(CONFIG_PACKAGE_kmod-qca-hyfi-bridge),)
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/hyfibr
$(foreach header_file,$(QCA_HYFI_BRIDGE_HEADERS), $(CP) $(header_file) $(1)/usr/include/hyfibr;)
endef
endif
define Build/Compile
$(MAKE) -C $(LINUX_DIR) M=$(PKG_BUILD_DIR) $(strip $(QCAHYFI_BRIDGE_MAKE_OPTS))
endef
define KernelPackage/qca-hyfi-bridge/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/hyfi-bridging.init $(1)/etc/init.d/hyfi-bridging
endef
$(eval $(call KernelPackage,qca-hyfi-bridge))

View file

@ -1,92 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (c) 2016 Qualcomm Atheros, Inc.
#
# All Rights Reserved.
# Qualcomm Atheros Confidential and Proprietary.
START=54
ECM_SYSFS_FILE="/sys/kernel/debug/ecm/ecm_classifier_hyfi/enabled"
ieee1905managed_bridge=
ieee1905managed_bridge2=
. /lib/functions/hyfi-debug.sh
. /lib/functions/hyfi-iface.sh
. /lib/functions/hyfi-network.sh
config_load 'repacd'
config_get_bool ezmesh repacd 'Ezmesh' '0'
if [ "$ezmesh" -eq 1 ]; then
MAP='ezmesh'
else
MAP='hyd'
fi
start() {
config_load $MAP
config_get_bool enabled config 'Enable' '0'
local hyfi_bridging_rcd_enabled=`ls /etc/rc.d/S${START}hyfi-bridging 2> /dev/null`
[ "$enabled" -gt 0 -a -n "$hyfi_bridging_rcd_enabled" ] || {
return 1
}
# Enable hyfi-netfilter
if [ -f /proc/sys/net/bridge/bridge-nf-call-custom ]; then
sysctl -w net.bridge.bridge-nf-call-custom=1
fi
# Get the IEEE1905.1 managed bridge name and attach
hyfi_get_ieee1905_managed_iface ieee1905managed_bridge ieee1905managed_bridge2
# Bail out from starting hyd if attach fails.
if ! hyctl attach br-$ieee1905managed_bridge; then
stop
return 1
fi
if [ -n "$ieee1905managed_bridge2" ];then
if ! hyctl attach br-$ieee1905managed_bridge2; then
stop
return 1
fi
fi
# Get Secondary bridge Names and attach
hyfi_get_ieee1905_brguest_map ieee1905_brguest_map ieee1905_brbh_map
if [ -n "$ieee1905_brguest_map" ];then
for br_name in $ieee1905_brguest_map; do
ifnames=`uci get "network.$br_name.ifname"`
if [ -n "$ifnames" -a "$ifnames" != " " ]; then
if ! hyctl attach br-$br_name; then
stop
return 1
fi
fi
done
fi
}
stop() {
config_load $MAP
# Disable hyfi-netfilter
if [ -f /proc/sys/net/bridge/bridge-nf-call-custom ]; then
sysctl -w net.bridge.bridge-nf-call-custom=0
fi
# Get the IEEE1905.1 managed bridge name and detach
hyfi_get_ieee1905_managed_iface ieee1905managed_bridge ieee1905managed_bridge2
hyctl detach br-$ieee1905managed_bridge
if [ -n "$ieee1905managed_bridge2" ]; then
hyctl detach br-$ieee1905managed_bridge2
fi
# Get Secondary bridge Names and detach
hyfi_get_ieee1905_brguest_map ieee1905_brguest_map ieee1905_brbh_map
if [ -n "$ieee1905_brguest_map" ];then
for br_name in $ieee1905_brguest_map; do
hyctl detach br-$br_name
done
fi
}

View file

@ -1,61 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qca-hyfi-iptv-helper
PKG_RELEASE:=1
include $(INCLUDE_DIR)/local-development.mk
ifeq ($(DUMP)$(PKG_VERSION),)
PKG_REV:=98e294d
PKG_VERSION:=g98e294d
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
WIFI_U:=PACKAGE_kmod-qca-wifi-unified-profile
WIFI_C:=PACKAGE_kmod-qca-wifi-custc-profile
WIFI_A:=PACKAGE_kmod-qca-wifi-akronite-perf
WIFI_D:=PACKAGE_kmod-qca-wifi-dakota-perf
WIFI_MIPS:=PACKAGE_kmod-qca-wifi-perf
WIFI_MIPS_UNIFIED:=PACKAGE_kmod-qca-wifi-unified-perf
WIFI_10_2_MIPS:=PACKAGE_kmod-qca-wifi-perf
WIFI_10_2_ARM:=PACKAGE_kmod-qca-wifi-akronite-perf
WIFI_L:=PACKAGE_kmod-qca-wifi-lowmem-profile
WIFI_16M:=PACKAGE_kmod-qca-wifi-flash_16mb-profile
WIFI_PKGS:=$(WIFI_U)||$(WIFI_C)||$(WIFI_A)||$(WIFI_D)||$(WIFI_MIPS)||$(WIFI_MIPS_UNIFIED)||$(WIFI_10_2_MIPS)||$(WIFI_10_2_ARM)||$(WIFI_L)||$(WIFI_16M)
PKG_BUILD_DEPENDS:=$(WIFI_U):qca-wifi $(WIFI_C):qca-wifi $(WIFI_A):qca-wifi $(WIFI_D):qca-wifi $(WIFI_MIPS):qca-wifi \
$(WIFI_MIPS_UNIFIED):qca-wifi $(WIFI_10_2_MIPS):qca-wifi $(WIFI_10_2_ARM):qca-wifi $(WIFI_L):qca-wifi $(WIFI_16M):qca-wifi
QCAHYFI_IPTV_HELPER_MAKE_OPTS:= \
CROSS_COMPILE=$(KERNEL_CROSS) \
ARCH=$(LINUX_KARCH) \
KERNELPATH=$(LINUX_SRC_DIR) \
KBUILDPATH=$(LINUX_DIR) \
KERNELRELEASE=$(LINUX_RELEASE)
include $(INCLUDE_DIR)/package.mk
QCAHYBRID_MODULE_LIST:=$(PKG_BUILD_DIR)/hyfi-iptv-helper.ko
define KernelPackage/qca-hyfi-iptv-helper
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros, Inc.
TITLE:=IPTV on Wireless Interface Netfilter Module
DEPENDS:=@$(WIFI_PKGS) +kmod-bridge
KCONFIG:= \
CONFIG_NETFILTER=y \
CONFIG_BRIDGE_NETFILTER=y
FILES:= $(strip $(QCAHYBRID_MODULE_LIST))
SUBMENU:=Hy-Fi features
endef
define KernelPackage/qca-hyfi-iptv-helper/description
This package installs the QCA Hy-Fi Netfilter for IPTV implementations on Wireless interface
endef
define Build/Compile
$(MAKE) -C $(LINUX_DIR) M=$(PKG_BUILD_DIR) $(strip $(QCAHYFI_IPTV_HELPER_MAKE_OPTS))
endef
$(eval $(call KernelPackage,qca-hyfi-iptv-helper))

View file

@ -1,43 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qca-hyfi-qdisc
PKG_RELEASE:=1
include $(INCLUDE_DIR)/local-development.mk
ifeq ($(DUMP)$(PKG_VERSION),)
PKG_VERSION:=g846e528
endif
QCAHYFI_QDISC_MAKE_OPTS:= \
CROSS_COMPILE=$(KERNEL_CROSS) \
ARCH=$(LINUX_KARCH) \
KERNELPATH=$(LINUX_DIR) \
KERNELRELEASE=$(LINUX_RELEASE)
include $(INCLUDE_DIR)/package.mk
QCAHYBRID_MODULE_LIST:=$(PKG_BUILD_DIR)/hyfi_qdisc.ko
define KernelPackage/qca-hyfi-qdisc
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros
TITLE:=Hy-Fi Queue Discipline Module
DEPENDS:=
KCONFIG:=CONFIG_NET_SCHED=y
FILES:= $(strip $(QCAHYBRID_MODULE_LIST))
AUTOLOAD:=$(call AutoLoad,40,hyfi_qdisc)
SUBMENU:=Hy-Fi features
endef
define KernelPackage/qca-hyfi-qdisc/description
This package installs the QCA Hy-Fi QDISC for raising priority of IEEE 1905.1 and HomePlugAV MME packets
endef
define Build/Compile
$(MAKE) -C $(LINUX_DIR) M=$(PKG_BUILD_DIR) $(strip $(QCAHYFI_QDISC_MAKE_OPTS))
endef
$(eval $(call KernelPackage,qca-hyfi-qdisc))

View file

@ -1,67 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qca-libhyfi-bridge
PKG_RELEASE:=1
include $(INCLUDE_DIR)/local-development.mk
ifeq ($(DUMP)$(PKG_VERSION),)
PKG_REV:=c5b6eb6
PKG_VERSION:=gc5b6eb6
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
QCALIBHYFI_BRIDGE_MAKE_OPTS:= \
CROSS=$(TARGET_CROSS) \
GWLIB=$(STAGING_DIR)/usr/lib \
GWINCLUDE=$(STAGING_DIR)/usr/include/qca \
EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
HYFIDIR=$(STAGING_DIR)/usr/include/hyfibr \
HYFIMCDIR=$(STAGING_DIR)/usr/include/hyfibr
QCALIBHYFI_BRIDGE_DEPENDS+=+ENABLE_SON_MEMORY_DEBUG:qca-son-mem-debug
ifeq ($(CONFIG_ENABLE_SON_MEMORY_DEBUG),y)
QCALIBHYFI_BRIDGE_MAKE_OPTS+=ENABLE_SON_MEMORY_DEBUG=y
QCALIBHYFI_BRIDGE_MAKE_OPTS+=SONMEMDEBUGINCLUDE=$(STAGING_DIR)/usr/include/son-mem-dbg
endif
define Package/qca-libhyfi-bridge
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros, Inc.
DEPENDS:=+kmod-qca-hyfi-bridge $(QCALIBHYFI_BRIDGE_DEPENDS)
TITLE:=Hy-Fi Bridging API Library
SUBMENU:=Hy-Fi features
endef
define Package/qca-libhyfi-bridge/description
This package installs the Hy-Fi Bridging API Library
endef
INSTALL_LIBS:= libhyfi-bridge
INSTALL_HEADERS=hyfi-bridge.h
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include/libhyfibr
$(if $(INSTALL_LIBS),$(CP) $(foreach lib,$(INSTALL_LIBS),$(PKG_BUILD_DIR)/install/lib/$(lib).so) $(1)/usr/lib)
$(if $(INSTALL_HEADERS),$(CP) $(foreach header,$(INSTALL_HEADERS),$(PKG_BUILD_DIR)/install/include/$(header)) $(1)/usr/include/libhyfibr)
endef
define Build/Compile
mkdir -p $(PKG_BUILD_DIR)/install/lib
mkdir -p $(PKG_BUILD_DIR)/install/include
$(MAKE) -C $(PKG_BUILD_DIR) $(strip $(QCALIBHYFI_BRIDGE_MAKE_OPTS))
endef
define Package/qca-libhyfi-bridge/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/install/lib/libhyfi-bridge.so $(1)/usr/lib
endef
$(eval $(call BuildPackage,qca-libhyfi-bridge))

View file

@ -1,58 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=hyfi-ui
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
define Package/luci-hyfi/Default
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros
SUBMENU:=Hy-Fi features
endef
define Package/luci-hyfi
$(call Package/luci-hyfi/Default)
DEPENDS:=+luci +luci-mod-admin-full
TITLE:=Hy-Fi Web UI
endef
define Package/luci-hyfi/description
Luci WebUI for Hy-Fi
endef
define Package/luci-hyfi-advanced
$(call Package/luci-hyfi/Default)
DEPENDS:=+luci +luci-mod-admin-full +luci-hyfi
TITLE:=Hy-Fi Web UI - Advanced
endef
define Package/luci-hyfi-advanced/description
Luci WebUI for Hy-Fi - Advanced
endef
define Build/Compile
true
endef
define Package/luci-hyfi/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/hyfi
$(CP) files/luci-hyfi/luasrc/model/cbi/hyfi/hyfi.lua /$(1)/usr/lib/lua/luci/model/cbi/hyfi/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/hyfi
$(CP) files/luci-hyfi/luasrc/view/hyfi/dview_js.htm /$(1)/usr/lib/lua/luci/view/hyfi/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
$(CP) files/luci-hyfi/luasrc/controller/hyfi.lua /$(1)/usr/lib/lua/luci/controller/
endef
define Package/luci-hyfi-advanced/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/hyfi
$(CP) files/luci-hyfi/luasrc/model/cbi/hyfi/advanced.lua /$(1)/usr/lib/lua/luci/model/cbi/hyfi/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/hyfi
$(CP) files/luci-hyfi/luasrc/view/hyfi/btn_adv.htm /$(1)/usr/lib/lua/luci/view/hyfi/
endef
$(eval $(call BuildPackage,luci-hyfi))
$(eval $(call BuildPackage,luci-hyfi-advanced))

View file

@ -1,2 +0,0 @@
include ../../build/config.mk
include ../../build/module.mk

View file

@ -1,23 +0,0 @@
--[[
LuCI - Lua Configuration Interface
Copyright (c) 2013 Qualcomm Atheros, Inc.
All Rights Reserved.
Qualcomm Atheros Confidential and Proprietary.
]]--
module("luci.controller.hyfi", package.seeall)
function index()
if not nixio.fs.access("/etc/config/hyd") then
return
end
local page
page = entry({"admin", "network", "hyfi"}, cbi("hyfi/hyfi"), _("HyFi Network"))
page.dependent = true
end

View file

@ -1,711 +0,0 @@
--[[
LuCI - Lua Configuration Interface
Copyright (c) 2013, 2017-2019 Qualcomm Technologies, Inc.
All Rights Reserved.
Confidential and Proprietary - Qualcomm Technologies, Inc.
2013 Qualcomm Atheros, Inc.
All Rights Reserved.
Qualcomm Atheros Confidential and Proprietary.
]]--
local m, s = ...
------------------------------------------------------------------------------------------------
--Advanced Hy-Fi
------------------------------------------------------------------------------------------------
s = m:section(TypedSection, "hy", translate("Advanced Hy-Fi Settings"))
s.anonymous = true
li = s:option(ListValue, "LoadBalancingSeamless", translate("Load-balancing seamless path switching"))
li:value("1", translate("Enable"))
li:value("0", translate("Disable"))
li.default = "1"
vl = s:option(Value, "MaxLBReordTimeout", translate("Max LB reordering timeout"))
vl.datatype = "uinteger"
li = s:option(ListValue, "StrictIEEE1905Mode", translate("Strict IEEE 1905.1 Mode"))
li:value("1", translate("Enable"))
li:value("0", translate("Disable"))
li.default = "1"
function li.cfgvalue(self, section)
return m.uci:get(m.config, "IEEE1905Settings", self.option)
end
function li.write(self, section, value)
m.uci:set(m.config, "IEEE1905Settings", self.option, value)
end
li = s:option(ListValue, "GenerateLLDP", translate("Generate LLDP packets"))
li:value("1", translate("Enable"))
li:value("0", translate("Disable"))
li.default = "1"
function li.cfgvalue(self, section)
return m.uci:get(m.config, "IEEE1905Settings", self.option)
end
function li.write(self, section, value)
m.uci:set(m.config, "IEEE1905Settings", self.option, value)
end
li = s:option(ListValue, "AvoidDupRenew", translate("Avoid Duplicate Renew packets Upstream"))
li:value("1", translate("Enable"))
li:value("0", translate("Disable"))
li.default = "0"
function li.cfgvalue(self, section)
return m.uci:get(m.config, "IEEE1905Settings", self.option)
end
function li.write(self, section, value)
m.uci:set(m.config, "IEEE1905Settings", self.option, value)
end
li = s:option(ListValue, "AvoidDupTopologyNotification", translate("Avoid Duplicate Topology Notification packets Upstream"))
li:value("1", translate("Enable"))
li:value("0", translate("Disable"))
li.default = "0"
function li.cfgvalue(self, section)
return m.uci:get(m.config, "IEEE1905Settings", self.option)
end
function li.write(self, section, value)
m.uci:set(m.config, "IEEE1905Settings", self.option, value)
end
li = s:option(ListValue, "V1Compat", translate("Hy-Fi 1.0 Compatibility Mode"))
li:value("1", translate("Enable"))
li:value("0", translate("Disable"))
li.default = "1"
function li.cfgvalue(self, section)
return m.uci:get(m.config, "HCPSettings", self.option)
end
function li.write(self, section, value)
m.uci:set(m.config, "HCPSettings", self.option, value)
end
li = s:option(ListValue, "ConstrainTCPMedium", translate("Constrain TCP-ACK streams to the same medium as their primary TCP-DATA stream"))
li:value("1", translate("Enable"))
li:value("0", translate("Disable"))
li.default = "1"
vl = s:option(Value, "HActiveMaxAge", translate("Maximum age of a H-Active entry before it will be aged out (ms)"))
vl.datatype = "uinteger"
li = s:option(ListValue, "ForwardingMode", translate("Hy-Fi Netfilter forwarding mode"))
li:value("APS", translate("APS"))
li:value("SINGLE", translate("No Hybrid Tables"))
li:value("MCAST", translate("Multicast Only"))
li.default = "APS"
vl = s:option(Value, "ExtraQueryResponseTime", translate("IGMP Extra Query response time"))
vl.datatype = "uinteger"
------------------------------------------------------------------------------------------------
--Auto Configuration
------------------------------------------------------------------------------------------------
if nixio.fs.access("/etc/init.d/acd") then
function acdValue(section, option, title)
vl = section:option(Value, option, translate(title))
vl.datatype = "uinteger"
vl.cfgvalue = function (self, section)
return m.uci:get("acd", "config", self.option)
end
vl.write = function (self, section, value)
m.uci:set("acd", "config", self.option, value)
end
return vl
end
function acdEnableList(section, option, title)
li = section:option(ListValue, option, translate(title))
li:value("1", translate("Enable"))
li:value("0", translate("Disable"))
li.default = "1"
li.cfgvalue = function (self, section)
return m.uci:get("acd", "config", self.option)
end
li.write = function (self, section, value)
m.uci:set("acd", "config", self.option, value)
end
return li
end
s = m:section(TypedSection, "hy", translate("Advanced Auto-Configuration Settings"))
s.anonymous = true
acdValue(s, "HCSecsBetweenDHCPRequestPackets", "Interval Between DHCP Discovery Messages (sec)")
acdValue(s, "HRSecsBetweenDHCPRequestPackets", "HR Number of Seconds Between DHCP Retries")
acdValue(s, "HRSecsBetweenStateContinuityCheck", "HR Maintenance Interval Between DHCP Discovery Messages (sec)")
acdValue(s, "HRMaxTriesWaitingForDHCPResponse", "HR Max Number of DHCP Retries")
acdValue(s, "HCMaxTxTriesBeforeGettingIPAddr", "Re-Check IP Address on Every N Retries")
acdValue(s, "SecsBetweenChecksForCableConnection", "Link Status Check Interval (sec)")
acdValue(s, "AcdDebugLevel", "Debug Level")
acdEnableList(s, "DisableHCMode", "Hybrid Client Always in Range Extender Mode")
acdEnableList(s, "DisableWDSSTAInHREMode", "Disable local WDS station in Range Extender Mode")
end
------------------------------------------------------------------------------------------------
--General WLAN Path Characterization Setting
------------------------------------------------------------------------------------------------
s = m:section(TypedSection, "PathChWlan", translate("General WLAN Path Characterization Setting"))
s.anonymous = true
vl = s:option(Value, "UseWHCAlgorithm", translate("Use the WHC algorithm to calculate link capacity"))
vl.datatype = "uinteger"
vl = s:option(Value, "NumUpdatesUntilStatsValid", translate("Number of capacity updates to receive after link change before considered valid"))
vl.datatype = "uinteger"
------------------------------------------------------------------------------------------------
--WLAN 5G Path Characterization Setting
------------------------------------------------------------------------------------------------
s = m:section(TypedSection, "PathChWlan", translate("WLAN 5G Path Characterization Setting"))
s.anonymous = true
vl = s:option(Value, "UpdatedStatsInterval_W5", translate("UpdatedStatsInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "StatsAgedOutInterval_W5", translate("StatsAgedOutInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "MaxMediumUtilization_W5", translate("MaxMediumUtilization"))
vl.datatype = "uinteger"
vl = s:option(Value, "MediumChangeThreshold_W5", translate("MediumChangeThreshold"))
vl.datatype = "uinteger"
vl = s:option(Value, "LinkChangeThreshold_W5", translate("LinkChangeThreshold"))
vl.datatype = "uinteger"
vl = s:option(Value, "MaxMediumUtilizationForLC_W5", translate("MaxMediumUtilizationForLC"))
vl.datatype = "uinteger"
vl = s:option(Value, "CPULimitedTCPThroughput_W5", translate("CPULimitedTCPThroughput"))
vl.datatype = "uinteger"
vl = s:option(Value, "CPULimitedUDPThroughput_W5", translate("CPULimitedUDPThroughput"))
vl.datatype = "uinteger"
vl = s:option(Value, "PHYRateThresholdForMU_W5", translate("PHYRateThresholdForMU"))
vl.datatype = "uinteger"
vl = s:option(Value, "ProbePacketInterval_W5", translate("ProbePacketInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "ProbePacketSize_W5", translate("ProbePacketSize"))
vl.datatype = "uinteger"
vl = s:option(Value, "EnableProbe_W5", translate("EnableProbe"))
vl.datatype = "uinteger"
vl = s:option(Value, "AssocDetectionDelay_W5", translate("AssocDetectionDelay"))
vl.datatype = "uinteger"
vl = s:option(Value, "ScalingFactorHighRate_W5", translate("Rate above which ScalingFactorHigh is used"))
vl.datatype = "uinteger"
------------------------------------------------------------------------------------------------
--WLAN 6G Path Characterization Setting
------------------------------------------------------------------------------------------------
s = m:section(TypedSection, "PathChWlan", translate("WLAN 6G Path Characterization Setting"))
s.anonymous = true
vl = s:option(Value, "UpdatedStatsInterval_W6", translate("UpdatedStatsInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "StatsAgedOutInterval_W6", translate("StatsAgedOutInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "MaxMediumUtilization_W6", translate("MaxMediumUtilization"))
vl.datatype = "uinteger"
vl = s:option(Value, "MediumChangeThreshold_W6", translate("MediumChangeThreshold"))
vl.datatype = "uinteger"
vl = s:option(Value, "LinkChangeThreshold_W6", translate("LinkChangeThreshold"))
vl.datatype = "uinteger"
vl = s:option(Value, "MaxMediumUtilizationForLC_W6", translate("MaxMediumUtilizationForLC"))
vl.datatype = "uinteger"
vl = s:option(Value, "CPULimitedTCPThroughput_W6", translate("CPULimitedTCPThroughput"))
vl.datatype = "uinteger"
vl = s:option(Value, "CPULimitedUDPThroughput_W6", translate("CPULimitedUDPThroughput"))
vl.datatype = "uinteger"
vl = s:option(Value, "PHYRateThresholdForMU_W6", translate("PHYRateThresholdForMU"))
vl.datatype = "uinteger"
vl = s:option(Value, "ProbePacketInterval_W6", translate("ProbePacketInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "ProbePacketSize_W6", translate("ProbePacketSize"))
vl.datatype = "uinteger"
vl = s:option(Value, "EnableProbe_W6", translate("EnableProbe"))
vl.datatype = "uinteger"
vl = s:option(Value, "AssocDetectionDelay_W6", translate("AssocDetectionDelay"))
vl.datatype = "uinteger"
vl = s:option(Value, "ScalingFactorHighRate_W6", translate("Rate above which ScalingFactorHigh is used"))
vl.datatype = "uinteger"
------------------------------------------------------------------------------------------------
--WLAN 2G Path Characterization Setting
------------------------------------------------------------------------------------------------
s = m:section(TypedSection, "PathChWlan", translate("WLAN 2.4G Path Characterization Setting"))
s.anonymous = true
vl = s:option(Value, "UpdatedStatsInterval_W2", translate("UpdatedStatsInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "StatsAgedOutInterval_W2", translate("StatsAgedOutInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "MaxMediumUtilization_W2", translate("MaxMediumUtilization"))
vl.datatype = "uinteger"
vl = s:option(Value, "MediumChangeThreshold_W2", translate("MediumChangeThreshold"))
vl.datatype = "uinteger"
vl = s:option(Value, "LinkChangeThreshold_W2", translate("LinkChangeThreshold"))
vl.datatype = "uinteger"
vl = s:option(Value, "MaxMediumUtilizationForLC_W2", translate("MaxMediumUtilizationForLC"))
vl.datatype = "uinteger"
vl = s:option(Value, "CPULimitedTCPThroughput_W2", translate("CPULimitedTCPThroughput"))
vl.datatype = "uinteger"
vl = s:option(Value, "CPULimitedUDPThroughput_W2", translate("CPULimitedUDPThroughput"))
vl.datatype = "uinteger"
vl = s:option(Value, "PHYRateThresholdForMU_W2", translate("PHYRateThresholdForMU"))
vl.datatype = "uinteger"
vl = s:option(Value, "ProbePacketInterval_W2", translate("ProbePacketInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "ProbePacketSize_W2", translate("ProbePacketSize"))
vl.datatype = "uinteger"
vl = s:option(Value, "EnableProbe_W2", translate("EnableProbe"))
vl.datatype = "uinteger"
vl = s:option(Value, "AssocDetectionDelay_W2", translate("AssocDetectionDelay"))
vl.datatype = "uinteger"
vl = s:option(Value, "ScalingFactorHighRate_W2", translate("Rate above which ScalingFactorHigh is used"))
vl.datatype = "uinteger"
------------------------------------------------------------------------------------------------
--PLC Path Characterization Setting
------------------------------------------------------------------------------------------------
s = m:section(TypedSection, "PathChPlc", translate("PLC Path Characterization Setting"))
s.anonymous = true
vl = s:option(Value, "MaxMediumUtilization", translate("MaxMediumUtilization"))
vl.datatype = "uinteger"
vl = s:option(Value, "MediumChangeThreshold", translate("MediumChangeThreshold"))
vl.datatype = "uinteger"
vl = s:option(Value, "LinkChangeThreshold", translate("LinkChangeThreshold"))
vl.datatype = "uinteger"
vl = s:option(Value, "StatsAgedOutInterval", translate("StatsAgedOutInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "UpdateStatsInterval", translate("UpdateStatsInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "EntryExpirationInterval", translate("EntryExpirationInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "MaxMediumUtilizationForLC", translate("MaxMediumUtilizationForLC"))
vl.datatype = "uinteger"
vl = s:option(Value, "LCThresholdForUnreachable", translate("LCThresholdForUnreachable"))
vl.datatype = "uinteger"
vl = s:option(Value, "LCThresholdForReachable", translate("LCThresholdForReachable"))
vl.datatype = "uinteger"
vl = s:option(Value, "HostPLCInterfaceSpeed", translate("HostPLCInterfaceSpeed"))
vl.datatype = "uinteger"
------------------------------------------------------------------------------------------------
--Stream Estimation Setting
------------------------------------------------------------------------------------------------
s = m:section(TypedSection, "HSPECEst", translate("Stream Estimation Setting"))
s.anonymous = true
vl = s:option(Value, "UpdateHSPECInterval", translate("UpdateHSPECInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "NotificationThresholdLimit", translate("NotificationThresholdLimit"))
vl.datatype = "uinteger"
vl = s:option(Value, "NotificationThresholdPercentage", translate("NotificationThresholdPercentage"))
vl.datatype = "uinteger"
vl = s:option(Value, "AlphaNumerator", translate("AlphaNumerator"))
vl.datatype = "uinteger"
vl = s:option(Value, "AlphaDenominator", translate("AlphaDenominator"))
vl.datatype = "uinteger"
vl = s:option(Value, "LocalFlowRateThreshold", translate("LocalFlowRateThreshold"))
vl.datatype = "uinteger"
vl = s:option(Value, "LocalFlowRatioThreshold", translate("LocalFlowRatioThreshold"))
vl.datatype = "uinteger"
vl = s:option(Value, "MaxHActiveEntries", translate("Maximum number of H-Active entries supported in user-space"))
vl.datatype = "uinteger"
------------------------------------------------------------------------------------------------
--Topology Discovery Setting
------------------------------------------------------------------------------------------------
s = m:section(TypedSection, "Topology", translate("Topology Discovery Setting"))
s.anonymous = true
vl = s:option(Value, "ND_UPDATE_INTERVAL", translate("ND_UPDATE_INTERVAL"))
vl.datatype = "uinteger"
vl = s:option(Value, "BD_UPDATE_INTERVAL", translate("BD_UPDATE_INTERVAL"))
vl.datatype = "uinteger"
vl = s:option(Value, "HOLDING_TIME", translate("HOLDING_TIME"))
vl.datatype = "uinteger"
vl = s:option(Value, "TIMER_LOW_BOUND", translate("TIMER_LOW_BOUND"))
vl.datatype = "uinteger"
vl = s:option(Value, "TIMER_UPPER_BOUND", translate("TIMER_UPPER_BOUND"))
vl.datatype = "uinteger"
vl = s:option(Value, "MSGID_DELTA", translate("MSGID_DELTA"))
vl.datatype = "uinteger"
vl = s:option(Value, "HA_AGING_INTERVAL", translate("HA_AGING_INTERVAL"))
vl.datatype = "uinteger"
vl = s:option(Value, "ENABLE_TD3", translate("ENABLE_TD3"))
vl.datatype = "uinteger"
vl = s:option(Value, "ENABLE_BD_SPOOFING", translate("ENABLE_BD_SPOOFING"))
vl.datatype = "uinteger"
vl = s:option(Value, "NOTIFICATION_THROTTLING_WINDOW", translate("NOTIFICATION_THROTTLING_WINDOW"))
vl.datatype = "uinteger"
vl = s:option(Value, "PERIODIC_QUERY_INTERVAL", translate("PERIODIC_QUERY_INTERVAL"))
vl.datatype = "uinteger"
vl = s:option(Flag, "ENABLE_NOTIFICATION_UNICAST", translate("ENABLE_NOTIFICATION_UNICAST"))
vl.rmempty = false
------------------------------------------------------------------------------------------------
--Path Selection Setting
------------------------------------------------------------------------------------------------
s = m:section(TypedSection, "PathSelect", translate("Path Selection Setting"))
s.anonymous = true
vl = s:option(Value, "UpdateHDInterval", translate("UpdateHDInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "LinkCapacityThreshold", translate("LinkCapacityThreshold"))
vl.datatype = "uinteger"
vl = s:option(Value, "UDPInterfaceOrder", translate("UDPInterfaceOrder"))
vl.datatype = "string"
vl = s:option(Value, "NonUDPInterfaceOrder", translate("NonUDPInterfaceOrder"))
vl.datatype = "string"
vl = s:option(Value, "SerialflowIterations", translate("SerialflowIterations"))
vl.datatype = "uinteger"
vl = s:option(Value, "DeltaLCThreshold", translate("DeltaLCThreshold"))
vl.datatype = "uinteger"
vl = s:option(Flag, "EnableBadLinkStatsSwitchFlow", translate("EnableBadLinkStatsSwitchFlow"))
vl.rmempty = false
------------------------------------------------------------------------------------------------
--WLAN Manager Settings
------------------------------------------------------------------------------------------------
s = m:section(TypedSection, "Wlan", translate("WLAN Manager Settings"))
s.anonymous = true
vl = s:option(Value, "WlanCheckFreqInterval", translate("WlanCheckFreqInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "WlanALDNLNumOverride", translate("WlanALDNLNumOverride"))
vl.datatype = "uinteger"
------------------------------------------------------------------------------------------------
--LOG settings
------------------------------------------------------------------------------------------------
s = m:section(TypedSection, "LogSettings", translate("LOG settings"))
s.anonymous = true
vl = s:option(Value, "EnableLog", translate("EnableLog"))
vl.datatype = "uinteger"
vl = s:option(Value, "LogRestartIntervalSec", translate("LogRestartIntervalSec"))
vl.datatype = "uinteger"
vl = s:option(Value, "LogPCSummaryPeriodSec", translate("LogPCSummaryPeriodSec"))
vl.datatype = "uinteger"
vl = s:option(Value, "LogServerIP", translate("LogServerIP"))
vl.datatype = "ipaddr"
vl = s:option(Value, "LogServerPort", translate("LogServerPort"))
vl.datatype = "uinteger"
vl = s:option(Value, "EnableLogPCW2", translate("EnableLogPCW2"))
vl.datatype = "uinteger"
vl = s:option(Value, "EnableLogPCW5", translate("EnableLogPCW5"))
vl.datatype = "uinteger"
vl = s:option(Value, "EnableLogPCW6", translate("EnableLogPCW6"))
vl.datatype = "uinteger"
vl = s:option(Value, "EnableLogPCP", translate("EnableLogPCP"))
vl.datatype = "uinteger"
vl = s:option(Value, "EnableLogTD", translate("EnableLogTD"))
vl.datatype = "uinteger"
vl = s:option(Value, "EnableLogHE", translate("EnableLogHE"))
vl.datatype = "uinteger"
vl = s:option(Value, "EnableLogHETables", translate("EnableLogHETables"))
vl.datatype = "uinteger"
vl = s:option(Value, "EnableLogPS", translate("EnableLogPS"))
vl.datatype = "uinteger"
vl = s:option(Value, "EnableLogPSTables", translate("EnableLogPSTables"))
vl.datatype = "uinteger"
vl = s:option(Value, "LogHEThreshold1", translate("LogHEThreshold1"))
vl.datatype = "uinteger"
vl = s:option(Value, "LogHEThreshold2", translate("LogHEThreshold2"))
vl.datatype = "uinteger"
------------------------------------------------------------------------------------------------
--Multi-AP Implementation settings
------------------------------------------------------------------------------------------------
s = m:section(TypedSection, "MultiAP", translate("Multi-AP Implementation settings"))
s.anonymous = true
vl = s:option(Flag, "EnableController", translate("EnableController"))
vl.rmempty = false
vl = s:option(Flag, "EnableAgent", translate("EnableAgent"))
vl.rmempty = false
vl = s:option(Flag, "EnableSigmaDUT", translate("EnableSigmaDUT"))
vl.rmempty = false
vl = s:option(Flag, "EnableMapV2", translate("EnableMapV2"))
vl.rmempty = false
vl = s:option(Value, "ClientAssocCtrlTimeoutSec", translate("ClientAssocCtrlTimeout (s)"))
vl.datatype = "uinteger"
vl = s:option(Value, "ClientAssocCtrlTimeoutUsec", translate("ClientAssocCtrlTimeout (us)"))
vl.datatype = "uinteger"
vl = s:option(Value, "ShortBlacklistTimeSec", translate("ShortBlacklistTime (s)"))
vl.datatype = "uinteger"
vl = s:option(Flag, "AlwaysClearBlacklists", translate("AlwaysClearBlacklists"))
vl.rmempty = true
vl = s:option(Value, "ClientSteerTimeoutSec", translate("ClientSteerTimeout (s)"))
vl.datatype = "uinteger"
vl = s:option(Value, "ClientSteerTimeoutUsec", translate("ClientSteerTimeout (us)"))
vl.datatype = "uinteger"
vl = s:option(Value, "MetricsReportingInterval", translate("MetricsReportingInterval (s)"))
vl.datatype = "uinteger"
vl = s:option(Value, "RSSIHysteresis_W2", translate("RSSIHysteresis on 2.4 GHz"))
vl.datatype = "uinteger"
vl = s:option(Value, "RSSIHysteresis_W5", translate("RSSIHysteresis on 5 GHz"))
vl.datatype = "uinteger"
vl = s:option(Value, "RSSIHysteresis_W6", translate("RSSIHysteresis on 6 GHz"))
vl.datatype = "uinteger"
vl = s:option(Value, "LoadBalancingInterval", translate("LoadBalancingInterval (s)"))
vl.datatype = "uinteger"
vl = s:option(Flag, "EnableChannelSelection", translate("EnableChannelSelection"))
vl.rmempty = false
vl = s:option(Value, "MinPreferredChannelIndex", translate("MinPreferredChannelIndex"))
vl.datatype = "uinteger"
vl = s:option(Value, "MaxPreferredChannelIndex", translate("MaxPreferredChannelIndex"))
vl.datatype = "uinteger"
vl = s:option(Flag, "EnableTopologyOpt", translate("EnableTopologyOpt"))
vl.rmempty = false
vl = s:option(Value, "TopologyOptCron", translate("TopologyOptCron"))
vl.datatype = "string"
vl = s:option(Value, "TopologyOptNewAgentDelay", translate("TopologyOptNewAgentDelay"))
vl.datatype = "uinteger"
vl = s:option(Value, "TopologyOptDelAgentDelay", translate("TopologyOptDelAgentDelay"))
vl.datatype = "uinteger"
vl = s:option(Value, "TopologyOptCollectionTime", translate("TopologyOptCollectionTime"))
vl.datatype = "uinteger"
vl = s:option(Value, "TopologyOptActivityMonitoringSecs", translate("TopologyOptActivityMonitoringSecs"))
vl.datatype = "uinteger"
vl = s:option(Value, "TopologyOptMinIncreasePercentage", translate("TopologyOptMinIncreasePercentage"))
vl.datatype = "and(uinteger(range(0, 100))"
vl = s:option(Flag, "TopologyOptAllowActiveSteer", translate("TopologyOptAllowActiveSteer"))
vl.rmempty = false
vl = s:option(Value, "TopologyOptMaxIdleWaitSecs", translate("TopologyOptMaxIdleWaitSecs"))
vl.datatype = "uinteger"
vl = s:option(Value, "TopologyOptSettlingTime", translate("TopologyOptSettlingTime"))
vl.datatype = "uinteger"
vl = s:option(Value, "UnassocMetricsRspWaitTimeSec", translate("UnassocMetricsRspWaitTime (s)"))
vl.datatype = "uinteger"
vl = s:option(Value, "UnassocMetricsRspMsgTimeout", translate("UnassocMetricsRspMsgTimeout (s)"))
vl.datatype = "uinteger"
vl = s:option(Value, "CBSDwellSplitMSec", translate("CBSDwellSplit (ms)"))
vl.datatype = "uinteger"
vl = s:option(Value, "CBSDelaySec", translate("CBSDelay (s)"))
vl.datatype = "uinteger"
vl = s:option(Value, "CBSStateResetSec", translate("CBSStateReset (s)"))
vl.datatype = "uinteger"
vl = s:option(Value, "BkScanIntervalMin", translate("BkScanInterval (minutes)"))
vl.datatype = "uinteger"
vl = s:option(Flag, "EnableCronBasedBkScan", translate("EnableCronBasedBkScan"))
vl.rmempty = false
vl = s:option(Value, "BkScanCron", translate("BkScanCron"))
vl.datatype = "string"
vl = s:option(Flag, "UseCBSRankForHomeChan", translate("UseCBSRankForHomeChan"))
vl.rmempty = false
vl = s:option(Flag, "EnableChanPrefQuery", translate("EnableChanPrefQuery"))
vl.rmempty = false
vl = s:option(Value, "ChanPrefQueryCron", translate("ChanPrefQueryCron"))
vl.datatype = "string"
vl = s:option(Flag, "ChannelSelectionOnGlobalPref", translate("ChannelSelectionOnGlobalPref"))
vl.rmempty = false
vl = s:option(Flag, "ChannelSelectionDelaySec", translate("ChannelSelectionDelay (sec)"))
vl.datatype = "uinteger"
vl = s:option(Flag, "ChanSupervisionMinDelaySec", translate("MinChannelSupervisionDelay(sec)"))
vl.datatype = "uinteger"
vl = s:option(Flag, "ChanSupervisionMaxDelaySec", translate("MaxChannelSupervisionDelay (sec)"))
vl.datatype = "uinteger"
vl = s:option(Flag, "ChanSupervisionMaxAttempts", translate("MaxChannelSupervisionAttempts"))
vl.datatype = "uinteger"
vl = s:option(Flag, "ChanSupervisionIntervalSec", translate("ChannelSupervisionInterval (sec)"))
vl.datatype = "uinteger"
vl = s:option(Flag, "ChanSupervisionTolerate40MHzCoexRulesOn24GHz", translate("ChanSupervisionTolerate40MHzCoexRulesOn24GHz"))
vl.rmempty = false
vl = s:option(Flag, "ControllerChanSelection160MHz", translate("ControllerChanSelection160MHz"))
vl.rmempty = false
vl = s:option(Flag, "AgentChanSelection160MHz", translate("AgentChanSelection160MHz"))
vl.rmempty = false
vl = s:option(Flag, "ControllerChanSelection40MHzOn2G", translate("ControllerChanSelection40MHzOn2G"))
vl.rmempty = false
vl = s:option(Flag, "AgentChanSelection40MHzOn2G", translate("AgentChanSelection40MHzOn2G"))
vl.rmempty = false
vl = s:option(Flag, "ChanSelectionMinIncPercent", translate("ChannelSelectionMinIncPercent"))
vl.datatype = "uinteger"
vl = s:option(Flag, "AgentChanMismatchCheckInterval", translate("AgentChanMismatchCheckInterval"))
vl.datatype = "uinteger"
vl = s:option(Value, "UnassocRSSIAgeLimitSec", translate("UnassocRSSIAgeLimit (s)"))
vl.datatype = "uinteger"
vl = s:option(Value, "UnassocPeriodicQueryTimeSec", translate("UnassocPeriodicQueryTime (s)"))
vl.datatype = "uinteger"
vl = s:option(Value, "UnassocActiveClientTimeoutSec", translate("UnassocActiveClientTimeoutSec (s)"))
vl.datatype = "uinteger"
vl = s:option(Value, "UnassocMetricsDriverPollingTime", translate("UnassocMetricsDriverPollingTime (s)"))
vl.datatype = "uinteger"
vl = s:option(Flag, "EnableBootOnlyScan", translate("EnableBootOnlyScan"))
vl.rmempty = false
vl = s:option(Value, "ChanScanIntervalMin", translate("ChanScanIntervalMin (minutes)"))
vl.datatype = "uinteger"
vl = s:option(Value, "MapR1R2MixNotSupported", translate("MapR1R2MixNotSupported"))
vl.datatype = "uinteger"
vl = s:option(Value, "MapPFCompliant", translate("MapPFCompliant"))
vl = s:option(Value, "NumberOfVLANSupported", translate("NumberOfVLANSupported"))
vl.datatype = "uinteger"
vl = s:option(Value, "Map2TrafficSepEnabled", translate("Map2TrafficSepEnabled"))
vl.datatype = "uinteger"
vl = s:option(Value, "Map8021QPCP", translate("Map8021QPCP"))
vl.datatype = "uinteger"
vl = s:option(Value, "FronthaulSSIDPrimary", translate("FronthaulSSIDPrimary"))
vl.datatype = "string"
vl = s:option(Value, "VlanIDNwPrimary", translate("VlanIDNwPrimary"))
vl.datatype = "uinteger"
vl = s:option(Value, "FronthaulSSIDNwOne", translate("FronthaulSSIDNwOne"))
vl.datatype = "string"
vl = s:option(Value, "VlanIDNwOne", translate("VlanIDNwOne"))
vl.datatype = "uinteger"
vl = s:option(Value, "FronthaulSSIDNwTwo", translate("FronthaulSSIDNwTwo"))
vl.datatype = "string"
vl = s:option(Value, "VlanIDNwTwo", translate("VlanIDNwTwo"))
vl.datatype = "uinteger"
vl = s:option(Value, "FronthaulSSIDNwThree", translate("FronthaulSSIDNwThree"))
vl.datatype = "string"
vl = s:option(Value, "VlanIDNwThree", translate("VlanIDNwThree"))
vl.datatype = "uinteger"
vl = s:option(Value, "CombinedR1R2Backhaul", translate("CombinedR1R2Backhaul"))
vl.datatype = "uinteger"
vl = s:option(Value, "VlanNetworkPrimary", translate("VlanNetworkPrimary"))
vl.datatype = "string"
vl = s:option(Value, "EnableChannelScanRequest", translate("EnableChannelScanRequest"))
vl.datatype = "uinteger"
vl = s:option(Value, "EnableRptIndependentScan", translate("EnableRptIndependentScan"))
vl.datatype = "uinteger"
------------------------------------------------------------------------------------------------
--Steering Message settings
------------------------------------------------------------------------------------------------
s = m:section(TypedSection, "SteerMsg", translate("Steering Message settings"))
s.anonymous = true
vl = s:option(Value, "AvgUtilReqTimeout", translate("AvgUtilReqTimeout"))
vl.datatype = "uinteger"
vl = s:option(Value, "LoadBalancingCompleteTimeout", translate("LoadBalancingCompleteTimeout"))
vl.datatype = "uinteger"
vl = s:option(Value, "RspTimeout", translate("RspTimeout"))
vl.datatype = "uinteger"
------------------------------------------------------------------------------------------------
--Monitoring settings
------------------------------------------------------------------------------------------------
s = m:section(TypedSection, "Monitor", translate("Monitoring settings"))
s.anonymous = true
vl = s:option(Value, "MonitorTimer", translate("MonitorTimer"))
vl.datatype = "uinteger"
vl = s:option(Value, "MonitorResponseTimeout", translate("MonitorResponseTimeout"))
vl.datatype = "uinteger"

View file

@ -1,309 +0,0 @@
--[[
LuCI - Lua Configuration Interface
Copyright (c) 2013 Qualcomm Atheros, Inc.
All Rights Reserved.
Qualcomm Atheros Confidential and Proprietary.
]]--
local acd_enabled_prev = nil
local hyfi_enabled_prev = nil
local vhyfi_enabled_prev = nil
local uci = require "luci.model.uci"
function isvhyfi()
local vhyfi = true
local fd = io.open("/tmp/sysinfo/board_name", "r")
if fd then
local ln = fd:read("*l")
if (ln and (ln == "reh132" or
ln == "aph131" or
ln == "aph126" or
ln == "aph128" )) then
vhyfi = false
end
fd:close()
end
if (vhyfi == false) then
return false
end
if not nixio.fs.access("/etc/init.d/vhyfid") then
return false
end
return true
end
function has_acd()
if not nixio.fs.access("/etc/init.d/acd") then
return false
else
return true
end
end
function has_wan()
local uci_r = uci.cursor()
local wanif
wanif = uci_r:get("network", "wan", "ifname")
if (wanif == nil) then
return false
else
return true
end
end
function fork_exec(command)
local pid = nixio.fork()
if pid > 0 then
return
elseif pid == 0 then
-- change to root dir
nixio.chdir("/")
-- patch stdin, out, err to /dev/null
local null = nixio.open("/dev/null", "w+")
if null then
nixio.dup(null, nixio.stderr)
nixio.dup(null, nixio.stdout)
nixio.dup(null, nixio.stdin)
if null:fileno() > 2 then
null:close()
end
end
-- replace with target command
nixio.exec("/bin/sh", "-c", command)
end
end
if (isvhyfi()) then
m1 = Map("vhyfid", translate("Virtual HyFi Settings"),
translate("Configuration of Virtual HyFi networks "))
m1.on_before_save = function()
local uci_r = uci.cursor()
vhyfi_enabled_prev = uci_r:get("vhyfid", "config", "Enable")
end
s = m1:section(TypedSection, "config", translate("Virtual Hy-Fi Settings"))
s.anonymous = true
e = s:option(Flag, "Enable", translate("Virtual Hy-Fi Feature"))
e.rmempty = false
vl = s:option(Value, "PLCHFIDList", translate("HFID List"))
vl.datatype = "string"
vl = s:option(Value, "PLCOUIList", translate("OUI List"))
vl.datatype = "string"
--[[li = s:option(ListValue, "AllowPLCFwUpdate", translate("Allow PLC Firmware Update"))
li:value("1", translate("Enable"))
li:value("0", translate("Disable"))
li.default = "1"
--]]
li = s:option(ListValue, "DisableHyFiIfNoManufacturerMatch", translate("Disable Virtual Hy-Fi if Manufacturer not Matching"))
li:value("1", translate("Enable"))
li:value("0", translate("Disable"))
li.default = "1"
end
m2 = Map("hyd", translate("HyFi Network Settings"),
translate("Configuration of HyFi networks "))
m2:chain("acd")
m2.on_before_save = function()
local uci_r = uci.cursor()
if (has_acd()) then
acd_enabled_prev = uci_r:get("acd", "config", "AutoConfigEnable")
end
hyfi_enabled_prev = uci_r:get("hyd", "config", "Enable")
end
m2.on_after_commit = function()
local command = ""
local acd_enabled_new
local hyfi_enabled_new
local vhyfi_enabled_new
local hyfi_control
if (has_acd()) then
acd_enabled_new=m2.uci:get("acd", "config", "AutoConfigEnable")
if (acd_enabled_new == "0") then
command = "/etc/init.d/acd stop; "
elseif (acd_enabled_prev == "0") then
command = "/etc/init.d/acd start; "
else
command = "/etc/init.d/acd restart; "
end
end
if (isvhyfi()) then
vhyfi_enabled_new = m2.uci:get("vhyfid", "config", "Enable")
if (vhyfi_enabled_new == "0") then
command = command .. "/etc/init.d/vhyfid stop; "
elseif (vhyfi_enabled_prev == "0") then
command = command .. "/etc/init.d/vhyfid start; "
else
command = command .. "/etc/init.d/vhyfid restart; "
end
end
hyfi_control = m2.uci:get("hyd", "config", "Control")
if (hyfi_control == "manual" ) then
hyfi_enabled_new = m2.uci:get("hyd", "config", "Enable")
if (hyfi_enabled_new == "0") then
command = command .. "/etc/init.d/hyd stop"
command = command .. "/etc/init.d/hyfi-bridging stop"
command = command .. "uci set mcsd.config.Enable=1; "
command = command .. "uci commit; "
command = command .. "/etc/init.d/mcsd start; "
elseif (hyfi_enabled_prev == "0") then
command = command .. "uci set mcsd.config.Enable=0; "
command = command .. "uci commit; "
command = command .. "/etc/init.d/mcsd stop; "
command = command .. "/etc/init.d/hyfi-bridging start"
command = command .. "/etc/init.d/hyd start"
else
command = command .. "uci set mcsd.config.Enable=0; "
command = command .. "uci commit; "
command = command .. "/etc/init.d/mcsd stop; "
command = command .. "/etc/init.d/hyd stop; "
command = command .. "/etc/init.d/hyfi-bridging restart; "
command = command .. "/etc/init.d/hyd start"
end
end
fork_exec(command)
end
s = m2:section(TypedSection, "config", translate("Basic Hy-Fi Settings"))
s.anonymous = true
li = s:option(ListValue, "Enable", translate("Hy-Fi Feature"))
li:value("Enable", translate("Enable"))
li:value("Auto", translate("Auto"))
li:value("Disable", translate("Disable"))
function li.cfgvalue(self, section)
local hyd_control
local hyfi_status
local vhyfi_enable
local hyd_enable
if (isvhyfi() == true) then
vhyfi_enable = m2.uci:get("vhyfid", "config", "Enable")
else
vhyfi_enable = "0"
end
if (vhyfi_enable == "1") then
hyd_control = m2.uci:get("hyd", "config", "Control")
if (hyd_control == "auto") then
hyfi_status = "Auto"
else
hyfi_status = "Enable"
end
else
hyd_enable = m2.uci:get("hyd", "config", "Enable")
if (hyd_enable == "0") then
hyfi_status = "Disable"
else
hyfi_status = "Enable"
end
end
return hyfi_status
end
function li.write(self, section, value)
local vhyfi_enable
local hyd_enable
local hyd_control
if (isvhyfi() == true) then
vhyfi_enable = m2.uci:get("vhyfid", "config", "Enable")
else
vhyfi_enable = "0"
end
if (vhyfi_enable == "1") then
if (value == "Auto") then
hyd_enable = "0"
hyd_control = "auto"
else
hyd_enable = "1"
hyd_control = "manual"
end
else
if (value == "Enable") then
hyd_enable = "1"
hyd_control = "manual"
else
hyd_enable = "0"
hyd_control = "manual"
end
end
m2.uci:set("hyd", "config", "Enable", hyd_enable)
m2.uci:set("hyd", "config", "Control", hyd_control)
end
if (has_acd()) then
e = s:option(Flag, "AutoConfigEnable", translate("Hy-Fi Auto Configuration"))
e.rmempty = false
function e.cfgvalue(self, section)
return m2.uci:get("acd", section, self.option)
end
function e.write(self, section, value)
local vhyfi_enable = "0"
local hyd_enable = "0"
if (isvhyfi() == true) then
vhyfi_enable = m2.uci:get("vhyfid", "config", "Enable")
end
hyd_enable = m2.uci:get("hyd", "config", "Enable")
if (hyfi_enable == "0" and hyd_enable == "0") then
value = 0
end
m2.uci:set("acd", section, self.option, value)
end
end
li = s:option(ListValue, "Mode", translate("Hy-Fi Configuration Mode"))
if (has_wan()) then
li:value("HYROUTER", translate("Hy-Fi Enabled Router"))
else
li:value("HYROUTER", translate("Hy-Fi Enabled GW-Bridge"))
li:value("HYCLIENT", translate("Hy-Fi Enabled Range-Extender"))
end
li.default = "1"
js = s:option(DummyValue, "script", translate("script for Hyfi"))
js.template = "hyfi/dview_js"
local form, ferr = loadfile(luci.util.libpath() .. "/model/cbi/hyfi/advanced.lua")
if form then
bt = s:option(DummyValue, "showadv", translate("show advanced"))
bt.template = "hyfi/btn_adv"
setfenv(form, getfenv(1))(m2, s)
end
if (m1 ~= nil) then
return m1, m2
else
return m2
end

View file

@ -1,11 +0,0 @@
<table>
<tr class="cbi-section-table">
<td></td>
<td class="cbi-value-field">
<input id="hybrid-advance" class="cbi-button cbi-button-apply" onclick="javascript:void(0)" type="button" />
</td>
<td>
</td>
</tr>
</table>

View file

@ -1,207 +0,0 @@
<script type="text/javascript">//<![CDATA[
var HideAdvance = 0;
function showHyfiOptions( )
{
var objVhyfi = document.getElementById("cbid.vhyfid.config.Enable");
var objHyfi = document.getElementById("cbid.hyd.config.Enable");
var vhyfiChecked;
var autoOptIndex = -1;
var disableOptIndex = -1;
var defaultOptChanged = 0;
if (objVhyfi && objVhyfi.checked == true)
vhyfiChecked = 1;
else
vhyfiChecked = 0;
if (!objHyfi)
return;
for (var i = 0; i < objHyfi.length; i ++)
{
var optValue = objHyfi.options[i].value;
if (optValue == "Auto")
{
autoOptIndex = i;
}
if ( optValue == "Disable")
{
disableOptIndex = i;
}
}
// update select options
if (vhyfiChecked == 1) //Show "Auto"
{
if (disableOptIndex != -1)
{
if (objHyfi.options[disableOptIndex].selected == 1)
defaultOptChanged = 1;
objHyfi.options.remove(disableOptIndex);
}
if (autoOptIndex == -1)
objHyfi.options.add(new Option("Auto", "Auto"));
}
else //Show "Disable"
{
if (autoOptIndex != -1)
{
if (objHyfi.options[autoOptIndex].selected == 1)
defaultOptChanged = 1;
objHyfi.options.remove(autoOptIndex);
}
if (disableOptIndex == -1)
objHyfi.options.add(new Option("Disable", "Disable"));
}
if (defaultOptChanged)
{
var defOption;
if (vhyfiChecked == 1)
defOption = "Auto";
else
defOption = "Disable";
for (var i = 0; i < objHyfi.length; i ++)
{
if (objHyfi.options[i].value == defOption)
{
objHyfi.options[i].selected = 1;
break;
}
}
}
if (objHyfi.onchange) {
objHyfi.onchange();
}
}
function onHyfiAdvance( )
{
var objAdv = document.getElementById("hybrid-advance");
if (!objAdv)
return;
if(HideAdvance)
{
HideAdvance = 0;
objAdv.value = "Hide Advanced Settings";
}
else
{
HideAdvance = 1;
objAdv.value = "Show Advanced Settings";
}
for (var i=0; i<objAdv.form.length; i++ )
{
var objElm = objAdv.form.elements[i];
if (objElm.className == "cbi-section"
&& objElm.id != "cbi-hyd-config"
&& objElm.id != "cbi-vhyfid-config"
&& objElm.id != "cbi-apply-hyd")
{
if (HideAdvance)
objElm.style.display = "none";
else
objElm.style.display = "block";
}
}
}
function onVhyfiEnable( )
{
var objVhyfi = document.getElementById("cbid.vhyfid.config.Enable");
if (!objVhyfi)
return;
//vHyFi changed, updating Hyfi options
showHyfiOptions();
}
function onHyfiEnable( )
{
var objHyfi = document.getElementById("cbid.hyd.config.Enable");
var objAcd = document.getElementById("cbid.hyd.config.AutoConfigEnable");
if (!objHyfi || !objAcd)
return;
if(objHyfi.value != "Disable")
{
objAcd.disabled = false;
}
else
{
objAcd.disabled = true;
}
}
function onAcdEnable( )
{
var objAcd = document.getElementById("cbid.hyd.config.AutoConfigEnable");
var objMode = document.getElementById("cbid.hyd.config.Mode");
if (!objAcd || !objMode)
return;
if(objAcd.checked == true)
{
objMode.disabled = true;
}
else
{
objMode.disabled = false;
}
}
function onHyfiLoad()
{
var objHyfi = document.getElementById("cbid.hyd.config.Enable");
if (objHyfi)
{
objHyfi.onchange = onHyfiEnable;
}
var objAcd = document.getElementById("cbid.hyd.config.AutoConfigEnable");
if (objAcd)
{
objAcd.onchange = onAcdEnable;
}
var objAdv = document.getElementById("hybrid-advance");
if (objAdv)
{
objAdv.onclick = onHyfiAdvance;
}
var objVhyfi = document.getElementById("cbid.vhyfid.config.Enable");
if (objVhyfi)
{
objVhyfi.onchange = onVhyfiEnable;
}
onAcdEnable();
onHyfiEnable();
onHyfiAdvance();
onVhyfiEnable();
showHyfiOptions();
}
if (document.all)
window.attachEvent('onload', onHyfiLoad);
else
window.addEventListener('load', onHyfiLoad, false);
//]]></script>

View file

@ -1,35 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qca-acd
PKG_VERSION:=master.131
include $(INCLUDE_DIR)/package.mk
define Package/qca-acd
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros, Inc.
DEPENDS:=+qca-ieee1905-init +kmod-qca-hyfi-bridge +qca-hyctl
TITLE:=Hy-Fi Auto-configuration
SUBMENU:=Hy-Fi features
endef
define Package/qca-acd/description
This package installs the Hy-Fi Auto-configuration scripts
endef
define Build/Compile
endef
define Package/qca-acd/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) ./files/acd-run.sh $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/acd.init $(1)/etc/init.d/acd
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/acd.config $(1)/etc/config/acd
endef
$(eval $(call BuildPackage,qca-acd))

View file

@ -1,335 +0,0 @@
#!/bin/sh
# Copyright (c) 2013 Qualcomm Atheros, Inc.
#
# All Rights Reserved.
# Qualcomm Atheros Confidential and Proprietary.
ACD_DEBUG_OUTOUT=0
ACD_SWITCH_CONFIG_COMMAND=swconfig
. /lib/functions.sh
. /lib/functions/hyfi-iface.sh
. /lib/functions/hyfi-network.sh
local link prev_link=2 router_detected=0 gw_iface="" gw_switch_port=""
local ieee1905managed switch_iface="" vlan_group="" switch_ports
local cpu_portmap=0
local start_mode="init"
__acd_echo() {
if [ "$ACD_DEBUG_OUTOUT" -gt 0 ]; then
echo "$1" > /dev/console
else
echo "$1"
fi
}
__acd_find_switch() {
local vlan_grp
__hyfi_get_switch_iface switch_iface
if [ -n "$switch_iface" ]; then
$ACD_SWITCH_CONFIG_COMMAND dev switch0 set flush_arl 2>/dev/null
vlan_grp="`echo $ether_iface | awk -F. '{print $2}' 2>/dev/null`"
fi
if [ -z "$vlan_grp" ]; then
vlan_group="1"
else
vlan_group="$vlan_grp"
fi
}
__acd_get_switch_ports() {
local local config="$1"
local vlan_group="$2"
local ports vlan cpu_port __cpu_portmap
config_get vlan "$config" vlan
config_get ports "$config" ports
[ ! "$vlan" = "$vlan_group" ] && return
cpu_port=`echo $ports | awk '{print $1}'`
ports=`echo $ports | sed 's/'$cpu_port' //g'`
eval "$3='$ports'"
cpu_port=`echo $cpu_port | awk -Ft '{print $1}'`
case $cpu_port in
0) __cpu_portmap=0x01;;
1) __cpu_portmap=0x02;;
2) __cpu_portmap=0x04;;
3) __cpu_portmap=0x08;;
4) __cpu_portmap=0x10;;
5) __cpu_portmap=0x20;;
6) __cpu_portmap=0x40;;
7) __cpu_portmap=0x80;;
esac
eval "$4='$__cpu_portmap'"
}
# __acd_check_links
# input: $1 1905.1 managed bridge
# output: $2 1 if link is up in at least 1 Ethernet port
__acd_check_links() {
local ether_ifaces_full ether_ifaces
local ether_iface ret
# Get all Ethernet interfaces
hyfi_get_ether_ifaces $1 ether_ifaces_full
hyfi_strip_list $ether_ifaces_full ether_ifaces
for ether_iface in $ether_ifaces; do
if [ "$switch_iface" = "$ether_iface" ]; then
local port link_status
for port in $switch_ports; do
if [ -n "$gw_switch_port" -a "$gw_switch_port" = "$port" ]; then
continue
fi
link_status=`$ACD_SWITCH_CONFIG_COMMAND dev switch0 port $port show | grep link | awk -F: '{print $NF}' 2>/dev/null`
if [ ! "$link_status" = "down" ]; then
# link is up
eval "$2='1'"
__acd_echo "acd: Link on port $port is UP"
return
fi
done
continue
fi
if [ -n "$gw_iface" -a "$gw_iface" = "$ether_iface" ]; then
continue
fi
ret=`ifconfig $ether_iface | grep UP[A-Z' ']*RUNNING`
if [ -n "$ret" ]; then
#link is up
eval "$2='1'"
__acd_echo "acd: Link on interface $ether_iface is UP"
return
fi
done
eval "$2='0'"
__acd_echo "acd: Link is DOWN"
}
__acd_check_gw_iface_link() {
local ret
if [ "$gw_iface" = "$switch_iface" ]; then
local link_status
link_status=`$ACD_SWITCH_CONFIG_COMMAND dev switch0 port $gw_switch_port show | grep link | awk -F: '{print $NF}'`
if [ ! "$link_status" = "down" ]; then
# link is up
__acd_echo "acd: Link to GW UP"
return 1
fi
else
ret=`ifconfig $gw_iface | grep UP[A-Z' ']*RUNNING`
[ -n "$ret" ] && return 1
fi
__acd_echo "acd: Link to GW DOWN"
return 0
}
# __acd_check_gateway
# input: $1 1905.1 managed bridge
# output: $2 Gateway interface
# returns: 1 if gateway is detected
__acd_check_gateway() {
local gw_ip gw_mac __gw_iface
local ether_ifaces_full ether_ifaces
local ether_iface ret
gw_ip=`route | grep default | grep br-$1 | awk '{print $2}'`
[ -z "$gw_ip" ] && return 0
ping $gw_ip -c1 >/dev/null
gw_mac=`cat /proc/net/arp | grep -w $gw_ip | awk '{print $4}'`
[ -z "$gw_mac" ] && return 0
__gw_iface=`hyctl getfdb br-$1 1024 | grep -i $gw_mac | awk '{print $4}'`
[ -z "$__gw_iface" ] && return 0
# Get all Ethernet interfaces
hyfi_get_ether_ifaces $1 ether_ifaces_full
hyfi_strip_list $ether_ifaces_full ether_ifaces
# Check if this interface belongs to our network
for ether_iface in $ether_ifaces; do
if [ "$ether_iface" = "$__gw_iface" ]; then
gw_iface=$__gw_iface
__acd_echo "acd: Detected Gateway on interface $gw_iface"
if [ "$ether_iface" = "$switch_iface" ]; then
local portmap __gw_switch_port=99
local __switch_iface="`echo $ether_iface | awk -F. '{print $1}' 2>/dev/null`"
portmap=`$ACD_SWITCH_CONFIG_COMMAND dev $__switch_iface get dump_arl | grep -i $gw_mac | grep -v $cpu_portmap | awk '{print $NF}'`
case $portmap in
0x01) __gw_switch_port=0;;
0x02) __gw_switch_port=1;;
0x04) __gw_switch_port=2;;
0x08) __gw_switch_port=3;;
0x10) __gw_switch_port=4;;
0x20) __gw_switch_port=5;;
0x40) __gw_switch_port=6;;
0x80) __gw_switch_port=7;;
esac
if [ "$__gw_switch_port" -eq 99 ]; then
__acd_echo "acd: invalid port map $portmap"
return 0
fi
gw_switch_port=$__gw_switch_port
fi
return 1
fi
done
return 0
}
__acd_restart() {
local __mode="$1"
__acd_echo "acd: restart in $__mode mode"
/etc/init.d/acd restart_in_${__mode}_mode
exit 0
}
# __acd_disable_vaps
# input: $1 config
# input: $2 network
# input: $3 mode: sta or ap
# input: $4 1 - disable, 0 - enable
# input-output: $5 change counter
__acd_disable_vaps() {
local config="$1"
local mode network disabled
local changed="$5"
config_get mode "$config" mode
config_get network "$config" network
config_get disabled "$config" disabled
if [ "$2" = "$network" -a "$3" = "$mode" -a ! "$4" = "$disabled" ]; then
uci_set wireless $config disabled $4
changed=$((changed + 1))
eval "$5='$changed'"
fi
}
# Get the IEEE1905.1 managed bridge name
hyfi_get_ieee1905_managed_iface ieee1905managed
__acd_find_switch $ieee1905managed
[ -n "$switch_iface" ] && __acd_echo "acd: found switch on $switch_iface VLAN=$vlan_group"
config_load network
config_foreach __acd_get_switch_ports switch_vlan $vlan_group switch_ports cpu_portmap
__acd_echo "acd: switch ports in the $ieee1905managed network: $switch_ports"
local hyd_mode
config_load hyd
config_get hyd_mode config 'Mode'
[ -n "$1" ] && start_mode="$1"
__acd_echo "acd: Hy-Fi mode: $hyd_mode, start mode: $start_mode"
__acd_check_gateway $ieee1905managed
router_detected=$?
if [ "$hyd_mode" = "HYROUTER" ]; then
if [ "$router_detected" -eq 0 ]; then
if [ ! "$start_mode" = "hr" ]; then
__acd_restart hc
else
local retries=3
while [ "$retries" -gt 0 ]; do
__acd_check_gateway $ieee1905managed
router_detected=$?
[ "$router_detected" -gt 0 ] && break
retries=$((retries -1))
__acd_echo "acd: redetecting gateway ($retries retries left)"
done
if [ "$router_detected" -gt 0 ]; then
__acd_restart hc
fi
fi
fi
else
if [ "$router_detected" -eq 1 ]; then
__acd_restart hr
fi
fi
local config_changed
while true; do
config_changed=0
if [ "$router_detected" -eq 0 ]; then
__acd_check_gateway $ieee1905managed
router_detected=$?
if [ "$router_detected" -gt 0 ]; then
__acd_restart hr
fi
else
__acd_check_gw_iface_link
if [ "$?" -eq 0 ]; then
# Gateway is gone
router_detected=0
gw_iface=""
gw_switch_port=""
__acd_restart hc
fi
sleep 2;
continue
fi
__acd_check_links $ieee1905managed link
if [ ! "$prev_link" = "$link" ]; then
if [ "$link" -gt 0 ]; then
local disable_hc_mode
config_load acd
config_get disable_hc_mode config DisableHCMode
config_load wireless
if [ "$disable_hc_mode" -eq 0 ]; then
# Link is up, turn off range extender
config_foreach __acd_disable_vaps wifi-iface $ieee1905managed 'ap' '1' config_changed
else
config_foreach __acd_disable_vaps wifi-iface $ieee1905managed 'ap' '0' config_changed
fi
config_foreach __acd_disable_vaps wifi-iface $ieee1905managed 'sta' '0' config_changed
else
config_load wireless
config_foreach __acd_disable_vaps wifi-iface $ieee1905managed 'sta' '0' config_changed
config_foreach __acd_disable_vaps wifi-iface $ieee1905managed 'ap' '0' config_changed
fi
prev_link=link;
if [ "$config_changed" -gt 0 ]; then
uci commit wireless
[ -f "/etc/init.d/hyd" ] && /etc/init.d/hyd stop
[ -f "/etc/init.d/wsplcd" ] && /etc/init.d/wsplcd stop
hyfi_network_restart
fi
fi
sleep 2;
done

View file

@ -1,12 +0,0 @@
config default 'config'
option AutoConfigEnable '0'
option HCSecsBetweenDHCPRequestPackets '2'
option HRSecsBetweenDHCPRequestPackets '3'
option HRSecsBetweenStateContinuityCheck '15'
option HRMaxTriesWaitingForDHCPResponse '3'
option HCMaxTxTriesBeforeGettingIPAddr '10'
option SecsBetweenChecksForCableConnection '5'
option AcdDebugLevel '1'
option DisableHCMode '1'
option DisableWDSSTAInHREMode '0'

View file

@ -1,488 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (c) 2013 Qualcomm Atheros, Inc.
#
# All Rights Reserved.
# Qualcomm Atheros Confidential and Proprietary.
START=50
SERVICE_WRITE_PID=1
SERVICE_DAEMONIZE=1
#SERVICE_DEBUG=1
NETWORK_RESTART=0
SERVICE_DEBUG_OUTPUT=0
ACD_DEBUG_OUTOUT=0
SERVICE_PATH="/usr/sbin/acd"
ACD_CONFIG_FILE="/tmp/acd.conf"
WIRELESS_CONFIG_FILE="/etc/config/wireless"
EXTRA_COMMANDS="restart_in_hc_mode restart_in_hr_mode"
EXTRA_HELP=<<EOF
restart_in_hc_mode Reconfigure the system in Hybrid Client mode
restart_in_hr_mode Reconfigure the system in Hybrid Router mode
EOF
. /lib/functions/hyfi-debug.sh
. /lib/functions/hyfi-iface.sh
. /lib/functions/hyfi-network.sh
ieee1905managed= config_changed=
wsplcd_start=0 wsplcd_restart=0
hyd_start=0 vhyfid_start=0
__acd_echo() {
if [ "$ACD_DEBUG_OUTOUT" -gt 0 ]; then
echo "acd: $1" > /dev/console
else
echo "acd: $1"
fi
}
__acd_append_wireless() {
echo "$1" >> "$WIRELESS_CONFIG_FILE"
}
__acd_router_mode() {
local wan_iface
config_load network
config_get wan_iface wan ifname
[ -n "$wan_iface" ] && return 1
return 0
}
__acd_get_freq_from_standard() {
config_get hwmode $1 hwmode '11ng'
case "$hwmode" in
11ac|11na|11a)
eval "$2='5G'"
;;
*)
eval "$2='2G'"
;;
esac
}
__acd_vaps_in_default_config() {
local ssid encryption last_vap
ssid=`uci show wireless | grep "ssid=OpenWrt"`
encryption=`uci show wireless | grep "encryption=none"`
__acd_echo "ssid=$ssid encryption=$encryption"
if [ -n "$ssid" -a -n "$encryption" ]; then
return 1
fi
last_vap=`uci show wireless.@wifi-iface[-1]`
__acd_echo "last_vap=$last_vap"
[ -z "$last_vap" ] && return 1
return 0
}
__acd_destroy_vaps() {
local retval
/sbin/wifi down
/etc/init.d/network stop
uci delete wireless.@wifi-iface[0] 2>/dev/null; retval=$?
while [ "$retval" -eq 0 ]; do
uci delete wireless.@wifi-iface[0] 2>/dev/null
retval=$?
done
uci commit wireless
}
__acd_enable_wifi() {
local DEVICES=
local device changed=0
config_cb() {
local type="$1"
local section="$2"
case "$type" in
wifi-device)
append DEVICES "$section"
;;
esac
}
config_load wireless
for device in $DEVICES ; do
config_get_bool disabled $device disabled
[ -z "$disabled" ] && continue
[ "$disabled" -eq 0 ] && continue
uci_set wireless $device disabled '0'
changed=1
done
if [ "$changed" -gt 0 ]; then
uci_commit wireless
config_changed=1
fi
}
__acd_create_vaps() {
local DEVICES=
local HYFI_SEED=
local AP_disabled=0 STA_disabled=0
config_cb() {
local type="$1"
local section="$2"
case "$type" in
wifi-device)
append DEVICES "$section"
;;
esac
}
config_load wireless
HYFI_SEED=`ifconfig br-$ieee1905managed | grep HWaddr | awk '{print $5}' | awk -F":" '{print $4$5$6}'`
if [ -z "$DEVICES" ]; then
DEVICES=`ls /sys/class/net/wifi* -d1 | awk -F/ '{print $NF}'`
fi
for device in $DEVICES ; do
uci_set wireless $device disabled '0'
__acd_append_wireless ""
__acd_append_wireless "config wifi-iface"
__acd_append_wireless " option device '$device'"
__acd_append_wireless " option mode 'ap'"
__acd_append_wireless " option athnewind '0'"
__acd_append_wireless " option ssid 'Hy-Fi Network $HYFI_SEED'"
__acd_append_wireless " option wds '1'"
__acd_append_wireless " option network '$ieee1905managed'"
__acd_append_wireless " option encryption 'psk2'"
__acd_append_wireless " option key 'hyfi$HYFI_SEED'"
__acd_append_wireless " option wps_pbc '1'"
__acd_append_wireless " option disabled '$AP_disabled'"
__acd_append_wireless ""
__acd_append_wireless "config wifi-iface"
__acd_append_wireless " option device '$device'"
__acd_append_wireless " option mode 'sta'"
__acd_append_wireless " option athnewind '0'"
__acd_append_wireless " option ssid 'Hy-Fi Network $HYFI_SEED'"
__acd_append_wireless " option wds '1'"
__acd_append_wireless " option network '$ieee1905managed'"
__acd_append_wireless " option encryption 'psk2'"
__acd_append_wireless " option key 'hyfi$HYFI_SEED'"
__acd_append_wireless " option wps_pbc '1'"
__acd_append_wireless " option disabled '$STA_disabled'"
__acd_append_wireless ""
done
uci_commit wireless
}
# __acd_disable_vaps
# input: $1 config
# input: $2 network
# input: $3 mode: sta or ap
# input: $4 1 - disable, 0 - enable
# input-output: $5 change counter
__acd_disable_vaps() {
local config="$1"
local mode network disabled
local changed="$5"
config_get mode "$config" mode
config_get network "$config" network
config_get disabled "$config" disabled
if [ "$2" = "$network" -a "$3" = "$mode" -a ! "$4" = "$disabled" ]; then
uci_set wireless $config disabled $4
changed=$((changed + 1))
eval "$5='$changed'"
__acd_echo "Set VAP $config to Disabled=$4"
fi
}
__acd_config_hr_mode() {
config_load hyd
config_get mode config 'Mode'
if [ ! "$mode" = 'HYROUTER' ]; then
uci_set hyd config 'Mode' 'HYROUTER'
config_changed=1
uci commit hyd
__acd_echo "Set hyd in HR mode"
fi
config_load wsplcd
config_get mode config 'RunMode'
if [ ! "$mode" = 'REGISTRAR' ]; then
uci_set wsplcd config 'RunMode' 'REGISTRAR'
config_changed=1
uci commit wsplcd
__acd_echo "Set wsplcd in REGISTRAR mode"
wsplcd_restart=1
fi
config_load wireless
config_foreach __acd_disable_vaps wifi-iface $ieee1905managed 'sta' '1' config_changed
config_foreach __acd_disable_vaps wifi-iface $ieee1905managed 'ap' '0' config_changed
uci commit wireless
}
__acd_config_hc_mode() {
config_load hyd
config_get mode config 'Mode'
if [ ! "$mode" = 'HYCLIENT' ]; then
uci_set hyd config 'Mode' 'HYCLIENT'
config_changed=1
uci commit hyd
__acd_echo "Set hyd in HC mode"
fi
config_load wsplcd
config_get mode config 'RunMode'
if [ ! "$mode" = 'ENROLLEE' ]; then
uci_set wsplcd config 'RunMode' 'ENROLLEE'
config_changed=1
uci commit wsplcd
__acd_echo "Set wsplcd in ENROLLEE mode"
wsplcd_restart=1
fi
config_load wireless
config_foreach __acd_disable_vaps wifi-iface $ieee1905managed 'sta' '0' config_changed
config_foreach __acd_disable_vaps wifi-iface $ieee1905managed 'ap' '1' config_changed
uci commit wireless
}
__acd_config_hc_boot_mode() {
config_load hyd
config_get mode config 'Mode'
config_get_bool hyd_enabled config 'Enable' 0
config_load vhyfid
config_get_bool vhyfid_enabled config 'Enable' 0
local disable_sta=1
if [ "$hyd_enabled" -eq 1 -a "$vhyfid_enabled" -eq 0 ]; then
disable_sta=0
fi
if [ ! "$mode" = 'HYCLIENT' ]; then
uci_set hyd config 'Mode' 'HYCLIENT'
config_changed=1
uci commit hyd
__acd_echo "Set hyd in HC mode"
fi
config_load wsplcd
config_get mode config 'RunMode'
if [ ! "$mode" = 'ENROLLEE' ]; then
uci_set wsplcd config 'RunMode' 'ENROLLEE'
config_changed=1
uci commit wsplcd
__acd_echo "Set wsplcd in ENROLLEE mode"
wsplcd_restart=1
fi
config_load wireless
config_foreach __acd_disable_vaps wifi-iface $ieee1905managed 'sta' $disable_sta config_changed
uci commit wireless
}
__acd_restart_dependencies() {
__acd_echo "Restarting network stack..."
hyfi_network_restart
if [ "$wsplcd_start" -gt 0 ]; then
/etc/init.d/wsplcd start
else
[ "$wsplcd_restart" -gt 0 ] && /etc/init.d/wsplcd restart
fi
[ "$hyd_start" -gt 0 ] && /etc/init.d/hyd start
[ "$vhyfid_start" -gt 0 ] && /etc/init.d/vhyfid start
}
__stop_acd_run() {
PID=$(ps | grep acd-run | grep -v grep | awk '{print $1}')
if [ $PID ]; then
kill -s SIGTERM $PID
__acd_echo "stopped acd-run process $PID"
fi
}
start() {
local enabled default_vaps router_mode
local mode
stop
config_changed=0
config_load 'acd'
config_get_bool enabled config 'AutoConfigEnable' '0'
[ "$enabled" -gt 0 ] || {
return 1
}
hyfi_echo acd "starting Hy-Fi auto-configuration"
# Get the IEEE1905.1 managed bridge name
hyfi_get_ieee1905_managed_iface ieee1905managed
__acd_echo "Managed bridge: $ieee1905managed"
__acd_vaps_in_default_config
if [ "$?" -gt 0 ]; then
__acd_destroy_vaps
__acd_create_vaps
config_changed=1
__acd_echo "Created new VAPs"
fi
__acd_enable_wifi
__acd_router_mode
if [ "$?" -gt 0 ]; then
# WAN group not empty
__acd_config_hr_mode
else
# WAN group empty or non-existent
# Disable all STAs and reset hyd state
__acd_config_hc_boot_mode
fi
local vhyfid_rcd_enabled=`ls /etc/rc.d/S??vhyfid 2> /dev/null`
config_load hyd
config_get_bool enabled config 'Enable' 0
config_get hyd_control config 'Control'
if [ "$hyd_control" = "manual" ]; then
if [ "$enabled" -eq 0 ]; then
uci_set hyd config 'Enable' '1'
config_changed=1
uci commit hyd
hyd_start=1
else
if [ ! -f /var/run/.hyd ]; then
config_changed=1
hyd_start=1
fi
fi
fi
if [ -n "$vhyfid_rcd_enabled" ]; then
config_load vhyfid
config_get_bool enabled config 'Enable' 0
if [ "$enabled" -eq 0 ]; then
uci_set vhyfid config 'Enable' '1'
config_changed=1
uci commit vhyfid
__acd_echo "Enabled Virtual Hy-Fi"
vhyfid_start=1
fi
fi
if [ -f "/etc/init.d/wsplcd" ]; then
config_load wsplcd
config_get_bool enabled config 'HyFiSecurity' 0
if [ "$enabled" -eq 0 ]; then
uci_set wsplcd config 'HyFiSecurity' '1'
config_changed=1
uci commit wsplcd
__acd_echo "Enabled security and configuration"
wsplcd_start=1
fi
fi
if [ "$config_changed" -gt 0 ]; then
__acd_restart_dependencies
fi
__acd_router_mode
if [ "$?" -eq 0 ]; then
config_load hyd
config_get_bool hyd_enabled config 'Enable' 0
hyfi_network_sync
__stop_acd_run
if [ "$hyd_enabled" -gt 0 ]; then
# Monitor Ethernet ports
start-stop-daemon -S -x /usr/sbin/acd-run.sh -b
fi
fi
}
stop() {
hyfi_network_sync
__stop_acd_run
}
restart() {
stop
config_load 'acd'
config_get_bool enabled config 'AutoConfigEnable' '0'
[ "$enabled" -gt 0 ] || {
return 1
}
__acd_router_mode
if [ "$?" -eq 0 ]; then
config_load hyd
config_get_bool hyd_enabled config 'Enable' 0
if [ "$hyd_enabled" -gt 0 ]; then
# Monitor Ethernet ports
start-stop-daemon -S -x /usr/sbin/acd-run.sh -b
fi
else
start
fi
}
restart_in_hc_mode() {
hyfi_get_ieee1905_managed_iface ieee1905managed
stop
__acd_config_hc_mode
__acd_restart_dependencies
/etc/init.d/hyd restart
__acd_router_mode
if [ "$?" -eq 0 ]; then
# Monitor Ethernet ports
start-stop-daemon -S -x /usr/sbin/acd-run.sh -b
fi
}
restart_in_hr_mode() {
hyfi_get_ieee1905_managed_iface ieee1905managed
stop
__acd_config_hr_mode
__acd_restart_dependencies
/etc/init.d/hyd restart
__acd_router_mode
if [ "$?" -eq 0 ]; then
# Monitor Ethernet ports
start-stop-daemon -S -x /usr/sbin/acd-run.sh -b -- hr
fi
}

View file

@ -1,61 +0,0 @@
choice
prompt "Ethernet Speed"
default HYD_GIGABIT_ETHERNET
help
set Ethernet speed
config HYD_GIGABIT_ETHERNET
bool "Gigabit Ethernet"
help
use gigabit ethernet
config HYD_FAST_ETHERNET
bool "Fast Ethernet"
help
use fast ethernet
endchoice
config HYD_WIFI_LOAD_BALANCING
bool "Enable Wi-Fi Load Balancing Feature"
default y
help
This enables Wi-Fi load balancing (aka. steering) in hyd
config HYD_SUPPORT_VHT160
bool "Support VHT 160 MHz"
depends on PACKAGE_kmod-qca-wifi-akronite-perf||PACKAGE_kmod-qca-wifi-dakota-perf||PACKAGE_kmod-qca-wifi-perf||PACKAGE_kmod-qca-wifi-unified-perf||PACKAGE_kmod-qca-wifi-unified-profile||PACKAGE_kmod-qca-wifi-custc-profile||PACKAGE_kmod-qca-wifi-lowmem-profile||PACKAGE_kmod-qca-wifi-flash_16mb-profile
default y
help
This enables the HYD support for 160 MHz
config HYD_SUPPORT_CFG80211
bool "Flag cfg80211 based config layer for HYD"
depends on PACKAGE_qca-cfg80211
default y
help
CFG80211 support for HYD
config HYD_SUPPORT_CALLTRACE
bool "Enable calltrace support for HYD"
help
calltrace support for HYD
config HYD_SUPPORT_BREAKPAD
bool "Enable Breakpad Debugging Support for HYD"
default y
help
Breakpad Debugging Support for HYD
config SUPPORT_WIFISON_EXT_LIB
bool "Enable QCA Wifi-SON Extended library"
default y
help
Extended library support for SON event service in HYD
config HYD_DPP_ONBOARD_ENABLE
bool "Device Provisioning Protocol for onboarding for EasyMesh Devices"
default y
help
This enables Device Provisioning Protocol for onboarding EasyMesh Devices

View file

@ -1,362 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qca-hyd
PKG_RELEASE:=1
include $(INCLUDE_DIR)/local-development.mk
ifeq ($(DUMP)$(PKG_VERSION),)
PKG_REV:=4ce25fc
PKG_VERSION:=g4ce25fc
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)$(PKG)_$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
WIFI_U:=PACKAGE_kmod-qca-wifi-unified-profile
WIFI_C:=PACKAGE_kmod-qca-wifi-custc-profile
WIFI_A:=PACKAGE_kmod-qca-wifi-akronite-perf
WIFI_D:=PACKAGE_kmod-qca-wifi-dakota-perf
WIFI_MIPS:=PACKAGE_kmod-qca-wifi-perf
WIFI_MIPS_UNIFIED:=PACKAGE_kmod-qca-wifi-unified-perf
WIFI_10_2_MIPS:=PACKAGE_kmod-qca-wifi-perf
WIFI_L:=PACKAGE_kmod-qca-wifi-lowmem-profile
WIFI_16M:=PACKAGE_kmod-qca-wifi-flash_16mb-profile
QCA_PLC:=PACKAGE_qca-plc-serv
WIFI_10_2_ARM:=PACKAGE_kmod-qca-wifi-akronite-perf
WIFI_PKGS:=$(WIFI_U)||$(WIFI_C)||$(WIFI_A)||$(WIFI_D)||$(WIFI_MIPS)||$(WIFI_MIPS_UNIFIED)||$(WIFI_10_2_MIPS)||$(WIFI_10_2_ARM)||$(WIFI_L)||$(WIFI_16M)
PKG_BUILD_DEPENDS:=$(WIFI_U):qca-wifi $(WIFI_C):qca-wifi $(WIFI_A):qca-wifi $(WIFI_D):qca-wifi $(WIFI_MIPS):qca-wifi $(WIFI_L):qca-wifi $(WIFI_16M):qca-wifi \
$(WIFI_MIPS_UNIFIED):qca-wifi $(WIFI_10_2_MIPS):qca-wifi $(WIFI_10_2_ARM):qca-wifi +qca-ssdk
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include/plcserv/
TARGET_CFLAGS += -fpie
TARGET_LDFLAGS += -pie
QCAHYD_MAKE_OPTS:= \
CROSS=$(TARGET_CROSS) \
GWLIB=$(STAGING_DIR)/usr/lib \
HYTOP=$(PKG_BUILD_DIR) \
GWINCLUDE=$(STAGING_DIR)/usr/include/hyficommon \
ATHDIR=$(STAGING_DIR)/usr/include \
PLCSRV=$(STAGING_DIR)/usr/include/plcserv \
HYFIDIR=$(STAGING_DIR)/usr/include/hyfibr \
HYFIMCDIR=$(STAGING_DIR)/usr/include/hyfibr \
HYFIBRLIBDIR=$(STAGING_DIR)/usr/include/libhyfibr \
IEEE1905DIR=$(STAGING_DIR)/usr/include/ieee1905 \
WPA2INCLUDE=$(STAGING_DIR)/usr/include/wpa2 \
QCASSDKDIR=$(STAGING_DIR)/usr/include/qca-ssdk \
QCACFLAGS="$(TARGET_CFLAGS)" \
QCALDFLAGS="-Wl,--gc-sections $(TARGET_LDFLAGS)" \
INSTALL_ROOT=$(PKG_BUILD_DIR)/install \
KERNELVERSION=$(LINUX_VERSION) \
STAGING_DIR=$(STAGING_DIR) \
ARCH="$(ARCH)"
ifneq ($(CONFIG_SUPPORT_WIFISON_EXT_LIB),)
QCAHYD_MAKE_OPTS+= \
SONEVENTINCLUDE=$(STAGING_DIR)/usr/include/qca-wifison-ext-lib \
HYD_MODULE_SONEVENT=y
endif
ifneq ($(CONFIG_HYD_SUPPORT_CFG80211),)
QCAHYD_MAKE_OPTS+= \
LIBCFG80211_SUPPORT=y
endif
ifneq ($(CONFIG_HYD_GIGABIT_ETHERNET),)
QCAHYD_MAKE_OPTS+= \
HYBRID_ETH_SPEED=1000
endif
ifneq ($(CONFIG_PACKAGE_qca-plc-serv),)
QCAHYD_MAKE_OPTS+= \
HYD_MODULE_PLC=y
endif
ifneq ($(CONFIG_HYD_FAST_ETHERNET),)
QCAHYD_MAKE_OPTS+= \
HYBRID_ETH_SPEED=100
endif
ifeq ($(CONFIG_PACKAGE_qca-vhyfid),y)
QCAHYD_MAKE_OPTS+= \
GATEWAY_PROFILE_VHYFI=y
endif
ifeq ($(CONFIG_HYD_WIFI_LOAD_BALANCING),y)
QCAHYD_MAKE_OPTS+= \
WHCWLBDIR=$(STAGING_DIR)/usr/include/whc-wlb \
HYD_MODULE_WLB=y
endif
ifeq ($(CONFIG_HYD_SUPPORT_VHT160),y)
QCAHYD_MAKE_OPTS+= \
HYD_SUPPORT_VHT160=y
endif
ifneq ($(CONFIG_HYD_SUPPORT_CALLTRACE),)
RSTRIP:=:
STRIP:=:
QCAHYD_MAKE_OPTS+= \
CALLTRACE_SUPPORT=y
endif
ifeq ($(CONFIG_HYD_SUPPORT_BREAKPAD),y)
QCAHYD_MAKE_OPTS+=QCACFLAGS+=" -DINCLUDE_BREAKPAD -g3"
QCAHYD_MAKE_OPTS+=QCALDFLAGS+=" -lbreakpad_qcawrapper"
endif
ifeq ($(CONFIG_ENABLE_SON_MEMORY_DEBUG),y)
QCAHYD_MAKE_OPTS+= \
ENABLE_SON_MEMORY_DEBUG=y \
SONMEMDEBUGINCLUDE=$(STAGING_DIR)/usr/include/son-mem-dbg
endif
ifneq ($(CONFIG_PACKAGE_qca-mad),)
QCAHYD_MAKE_OPTS+= \
HYD_SUPPORT_DESERVICE=y
endif
ifneq ($(CONFIG_HYD_DPP_ONBOARD_ENABLE),)
QCAHYD_MAKE_OPTS+= \
MAP_SUPPORT_DPP_ENABLE=y
endif
QCAHYD_DEPENDS+=+ENABLE_SON_MEMORY_DEBUG:qca-son-mem-debug
__busybox_have_default:=$(shell $(SH_FUNC) grep '^CONFIG_BUSYBOX_DEFAULT_HAVE_DOT_CONFIG' $(TOPDIR)/.config)
ifeq ($(__busybox_have_default),)
BUSYBOX_SYM:=CONFIG
else
BUSYBOX_SYM:=DEFAULT
endif
LOCAL_VARIANT=$(patsubst qca-hyd-%,%,$(patsubst qca-hyd-%,%,$(BUILD_VARIANT)))
ifeq ($(LOCAL_VARIANT),all)
QCAHYD_MAKE_OPTS+= \
ENABLE_SON=y \
ENABLE_MAP=y
endif
ifeq ($(LOCAL_VARIANT),son)
QCAHYD_MAKE_OPTS+= \
ENABLE_SON=y
endif
ifeq ($(LOCAL_VARIANT),map)
QCAHYD_MAKE_OPTS+= \
ENABLE_MAP=y
endif
ifeq ($(LOCAL_VARIANT),init)
QCAHYD_MAKE_OPTS+= \
ENABLE_SON=y \
ENABLE_MAP=y
endif
ifeq ($(LOCAL_VARIANT),plc)
QCAHYD_MAKE_OPTS+= \
ENABLE_SON=y \
ENABLE_MAP=y
endif
ifeq ($(LOCAL_VARIANT),sonplc)
QCAHYD_MAKE_OPTS+= \
ENABLE_SON=y
endif
INSTALL_LIBS:= libpluginManager libpsService libmcfwdtblwlan5g libmcfwdtblwlan2g libmcfwdtblwlan6g libmcfwdtbleswitch
define Package/qca-hyd/Default
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros
DEPENDS+=+HYD_SUPPORT_CALLTRACE:libunwind @$(WIFI_PKGS) +qca-ieee1905-init +kmod-qca-hyfi-bridge +qca-libhyfi-bridge +libieee1905 +libubus +libubox \
+qca-hyctl +libhyficommon +SUPPORT_WIFISON_EXT_LIB:qca-wifison-ext-lib +libwifisoncfg +libpthread +libuci +libwpa2 +@BUSYBOX_$(BUSYBOX_SYM)_STAT \
+@BUSYBOX_$(BUSYBOX_SYM)_FEATURE_STAT_FORMAT +HYD_WIFI_LOAD_BALANCING:qca-whc-lbd \
+jansson +HYD_SUPPORT_BREAKPAD:breakpad-wrapper $(QCAHYD_DEPENDS)
TITLE:=Hy-Fi Path-Selection daemon
SUBMENU:=Hy-Fi features
endef
define Package/qca-hyd/Default/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/usr/lib/
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(if $(INSTALL_LIBS),$(CP) $(foreach lib,$(INSTALL_LIBS),$(PKG_BUILD_DIR)/install/lib/$(lib).so) $(1)/usr/lib)
$(INSTALL_BIN) ./files/hyt $(1)/usr/sbin/hyt
$(INSTALL_CONF) ./files/hyd.config $(1)/etc/config/hyd
ifeq ($(LINUX_VERSION),3.3.8)
$(INSTALL_BIN) ./files/hyd_noprocd.init $(1)/etc/init.d/hyd
else
$(INSTALL_BIN) ./files/hyd.init $(1)/etc/init.d/hyd
endif
$(INSTALL_DIR) $(1)/etc/hotplug.d/net
$(INSTALL_BIN) ./files/hyd.hotplug $(1)/etc/hotplug.d/net/30-hyd
endef
# HYD COMMON
define Package/qca-hyd-init
$(call Package/qca-hyd/Default)
TITLE+= (Common package files)
VARIANT:=init
endef
define Package/qca-hyd-init/description
This package installs the Hy-Fi Path-Selection daemon init package files for SON and MAP execution
support.
endef
# SINGLE PACKAGE (MAP + SON) =============================
define Package/qca-hyd
$(call Package/qca-hyd/Default)
TITLE+= (with SON and MAP features)
VARIANT:=all
endef
define Package/qca-hyd/description
This package installs the Hy-Fi Path-Selection daemon build with both SON and MAP features
endef
define Package/qca-hyd/config
source "$(SOURCE)/Config.in"
endef
# SON PACKAGE =============================
define Package/qca-hyd-son
$(call Package/qca-hyd/Default)
DEPENDS+=+qca-hyd-init
TITLE+= (with SON features)
VARIANT:=son
endef
define Package/qca-hyd-son/description
This package installs the Hy-Fi Path-Selection daemon build with SON
endef
# MAP PACKAGE =============================
define Package/qca-hyd-map
$(call Package/qca-hyd/Default)
DEPENDS+=+qca-hyd-init
TITLE+= (with MAP features)
VARIANT:=map
endef
define Package/qca-hyd-map/description
This package installs the Hy-Fi Path-Selection daemon build with MAP
endef
# HYD PLC SON PACKAGE
define Package/qca-hyd-sonplc
$(call Package/qca-hyd/Default)
DEPENDS+=+qca-hyd-init +qca-plc-serv
TITLE+= (with SON and PLC features)
VARIANT:=sonplc
endef
define Package/qca-hyd-sonplc/description
This package installs the Hy-Fi Path-Selection daemon build with SON and PLC features
endef
# HYD SON + MAP + PLC PACKAGE
define Package/qca-hyd-plc
$(call Package/qca-hyd/Default)
DEPENDS+=+qca-plc-serv
TITLE+= (with SON/MAP and PLC features)
VARIANT:=plc
endef
define Package/qca-hyd-plc/description
This package installs the Hy-Fi Path-Selection daemon build with SON/MAP and PLC
support.
endef
# qca-wifison-ext-lib package
define Package/qca-wifison-ext-lib
$(call Package/qca-hyd/Default)
DEPENDS+=+SUPPORT_WIFISON_EXT_LIB:qca-wifison-ext-lib
endef
QCA_HYD_HEADERS= \
$(PKG_BUILD_DIR)/include/heServiceConfig.h \
$(PKG_BUILD_DIR)/include/logServiceConfig.h \
$(PKG_BUILD_DIR)/include/pcpServiceConfig.h \
$(PKG_BUILD_DIR)/include/pcwServiceConfig.h \
$(PKG_BUILD_DIR)/include/psServiceConfig.h \
$(PKG_BUILD_DIR)/include/tdServiceConfig.h \
$(PKG_BUILD_DIR)/include/wlanManagerConfig.h \
$(PKG_BUILD_DIR)/include/hcpConfig.h \
$(PKG_BUILD_DIR)/include/ieee1905Config.h
ifneq ($(shell [ -d $(LOCAL_SRC) ] && echo true),)
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/hyd
$(foreach header_file,$(QCA_HYD_HEADERS), $(CP) $(header_file) $(1)/usr/include/hyd;)
endef
endif
define Build/Compile
mkdir -p $(PKG_BUILD_DIR)/install/lib
mkdir -p $(PKG_BUILD_DIR)/install/include
mkdir -p $(PKG_BUILD_DIR)/install/sbin
$(MAKE) -C $(PKG_BUILD_DIR) $(strip $(QCAHYD_MAKE_OPTS)) subdirs
endef
# install
define Package/qca-hyd/install
$(call Package/qca-hyd/Default/install, $(1))
$(INSTALL_BIN) $(PKG_BUILD_DIR)/install/sbin/hyd $(1)/usr/sbin/
$(INSTALL_BIN) ./files/hyd-map-cmd $(1)/usr/sbin/hyd-map-cmd
endef
define Package/qca-hyd-plc/install
$(call Package/qca-hyd/Default/install, $(1))
$(INSTALL_BIN) $(PKG_BUILD_DIR)/install/sbin/hyd $(1)/usr/sbin/
endef
define Package/qca-hyd-son/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/install/sbin/hyd-son $(1)/usr/sbin/
endef
define Package/qca-hyd-map/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/hyd/map/
$(INSTALL_BIN) ./files/hyd-map-cmd $(1)/usr/sbin/hyd-map-cmd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/install/sbin/hyd-map $(1)/usr/sbin/
$(INSTALL_CONF) ./files/sp-rules.conf $(1)/etc/hyd/map/
endef
define Package/qca-hyd-sonplc/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/install/sbin/hyd-son $(1)/usr/sbin/
endef
define Package/qca-hyd-init/install
$(call Package/qca-hyd/Default/install, $(1))
endef
# Customer install - TBD
$(eval $(call BuildPackage,qca-hyd))
$(eval $(call BuildPackage,qca-hyd-plc))
$(eval $(call BuildPackage,qca-hyd-son))
$(eval $(call BuildPackage,qca-hyd-map))
$(eval $(call BuildPackage,qca-hyd-sonplc))
$(eval $(call BuildPackage,qca-hyd-init))

View file

@ -1,10 +0,0 @@
#!/bin/sh
# Copyright (c) 2018 Qualcomm Technologies, Inc.
#
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
PIPE_PATH="/var/run/hyd-map-cmd.fifo"
if [ -p $PIPE_PATH ] && [ -w $PIPE_PATH ]; then
echo $* > $PIPE_PATH
fi

View file

@ -1,275 +0,0 @@
config config 'config'
option Enable '0'
option ForceWextMode '0'
option SwitchInterface 'auto'
option SwitchLanVid '1'
option Control 'manual'
option DisableSteering '0'
config hy 'hy'
option LoadBalancingSeamless '1'
option ConstrainTCPMedium '0'
option MaxLBReordTimeout '1500'
option HActiveMaxAge '120000'
option ForwardingMode 'APS'
option HMWDSProgramRetryCount '0'
config Wlan 'Wlan'
option WlanCheckFreqInterval '10'
option WlanALDNLNumOverride '0'
option WlanALDMulticast '0'
config Vlanid
option ifname 'eth1'
option vid '1'
config Vlanid
option ifname 'eth0'
option vid '2'
config PathChWlan 'PathChWlan'
option UpdatedStatsInterval_W2 '1'
option StatsAgedOutInterval_W2 '30'
option MaxMediumUtilization_W2 '70'
option MediumChangeThreshold_W2 '10'
option LinkChangeThreshold_W2 '10'
option MaxMediumUtilizationForLC_W2 '70'
option CPULimitedTCPThroughput_W2 '0'
option CPULimitedUDPThroughput_W2 '0'
option PHYRateThresholdForMU_W2 '2000'
option ProbePacketInterval_W2 '1'
option ProbePacketSize_W2 '64'
option EnableProbe_W2 '1'
option AssocDetectionDelay_W2 '5'
option UpdatedStatsInterval_W5 '1'
option StatsAgedOutInterval_W5 '30'
option MaxMediumUtilization_W5 '70'
option MediumChangeThreshold_W5 '10'
option LinkChangeThreshold_W5 '10'
option MaxMediumUtilizationForLC_W5 '70'
option CPULimitedTCPThroughput_W5 '0'
option CPULimitedUDPThroughput_W5 '0'
option PHYRateThresholdForMU_W5 '2000'
option ProbePacketInterval_W5 '1'
option ProbePacketSize_W5 '64'
option EnableProbe_W5 '1'
option AssocDetectionDelay_W5 '5'
option UpdatedStatsInterval_W6 '1'
option StatsAgedOutInterval_W6 '30'
option MaxMediumUtilization_W6 '70'
option MediumChangeThreshold_W6 '10'
option LinkChangeThreshold_W6 '10'
option MaxMediumUtilizationForLC_W6 '70'
option CPULimitedTCPThroughput_W6 '0'
option CPULimitedUDPThroughput_W6 '0'
option PHYRateThresholdForMU_W6 '2000'
option ProbePacketInterval_W6 '1'
option ProbePacketSize_W6 '64'
option EnableProbe_W6 '1'
option AssocDetectionDelay_W6 '5'
option UseWHCAlgorithm '1'
option NumUpdatesUntilStatsValid '3'
config PathChPlc 'PathChPlc'
option MaxMediumUtilization '80'
option MediumChangeThreshold '10'
option LinkChangeThreshold '10'
option StatsAgedOutInterval '60'
option UpdateStatsInterval '1'
option EntryExpirationInterval '120'
option MaxMediumUtilizationForLC '80'
option LCThresholdForUnreachable '5'
option LCThresholdForReachable '10'
option HostPLCInterfaceSpeed '0'
config Topology 'Topology'
option ND_UPDATE_INTERVAL '15'
option BD_UPDATE_INTERVAL '3'
option HOLDING_TIME '190'
option TIMER_LOW_BOUND '7'
option TIMER_UPPER_BOUND '11'
option MSGID_DELTA '64'
option HA_AGING_INTERVAL '120'
option ENABLE_TD3 '1'
option ENABLE_BD_SPOOFING '1'
option NOTIFICATION_THROTTLING_WINDOW '1'
option PERIODIC_QUERY_INTERVAL '60'
option ENABLE_NOTIFICATION_UNICAST '1'
config HSPECEst 'HSPECEst'
option UpdateHSPECInterval '1'
option NotificationThresholdLimit '10'
option NotificationThresholdPercentage '20'
option AlphaNumerator '3'
option AlphaDenominator '8'
option LocalFlowRateThreshold '2000000'
option LocalFlowRatioThreshold '5'
option MaxHActiveEntries '8192'
config PathSelect 'PathSelect'
option UpdateHDInterval '10'
option LinkCapacityThreshold '20'
option UDPInterfaceOrder 'EP652'
option NonUDPInterfaceOrder 'EP652'
option SerialflowIterations '10'
option DeltaLCThreshold '10'
option EnableBadLinkStatsSwitchFlow '1'
config LogSettings 'LogSettings'
option EnableLog '0'
option LogRestartIntervalSec '10'
option LogPCSummaryPeriodSec '0'
option LogServerIP '192.168.1.10'
option LogServerPort '5555'
option EnableLogPCW2 '1'
option EnableLogPCW5 '1'
option EnableLogPCW6 '1'
option EnableLogPCP '1'
option EnableLogTD '1'
option EnableLogHE '1'
option EnableLogHETables '1'
option EnableLogPS '1'
option EnableLogPSTables '1'
option LogHEThreshold1 '200000'
option LogHEThreshold2 '10000000'
config IEEE1905Settings 'IEEE1905Settings'
option StrictIEEE1905Mode '0'
option GenerateLLDP '1'
option AvoidDupRenew '0'
option AvoidDupTopologyNotification '0'
option MapVersionEnabled '0'
config HCPSettings 'HCPSettings'
option V1Compat '1'
config MultiAP 'MultiAP'
option EnableController '0'
option EnableAgent '0'
option EnableSigmaDUT '0'
option MapVersion '1'
option EnableIEEE1905Assist '0'
option ClientAssocCtrlTimeoutSec '0'
option ClientAssocCtrlTimeoutUsec '200000'
option ShortBlacklistTimeSec '2'
option AlwaysClearBlacklists '1'
option ClientSteerTimeoutSec '1'
option ClientSteerTimeoutUsec '0'
option MetricsReportingInterval '5'
option RSSIHysteresis_W2 '5'
option RSSIHysteresis_W5 '5'
option RSSIHysteresis_W6 '5'
option LoadBalancingInterval '30'
option EnableChannelSelection '0'
option MinPreferredChannelIndex '36'
option MaxPreferredChannelIndex '99'
option EnableTopologyOpt '0'
option TopologyOptCron '0 3 * * *'
option TopologyOptNewAgentDelay '300'
option TopologyOptDelAgentDelay '180'
option TopologyOptCollectionTime '3'
option TopologyOptActivityMonitoringSecs '45'
option TopologyOptMinIncreasePercentage '20'
option TopologyOptAllowActiveSteer '0'
option TopologyOptMaxIdleWaitSecs '1800'
option TopologyOptSettlingTime '120'
option BackhaulSteeringRspSendTimeout '10'
option UnassocMetricsRspWaitTimeSec '8'
option UnassocMetricsRspMsgTimeout '5'
option CBSDwellSplitMSec '50'
option CBSDelaySec '300'
option CBSStateResetSec '300'
option BkScanIntervalMin '0'
option EnableCronBasedBkScan '0'
option BkScanCron '0 * * * *'
option UseCBSRankForHomeChan '0'
option EnableChanPrefQuery '0'
option ChanPrefQueryCron '0 2 * * *'
option ChannelSelectionDelaySec '0'
option ChannelSelectionOnGlobalPref '0'
option ChanSupervisionMinDelaySec '4'
option ChanSupervisionMaxDelaySec '32'
option ChanSupervisionMaxAttempts '8'
option ChanSupervisionIntervalSec '450'
option ChanSupervisionTolerate40MHzCoexRulesOn24GHz '1'
option ControllerChanSelection160MHz '0'
option AgentChanSelection160MHz '0'
option ControllerChanSelection40MHzOn2G '0'
option AgentChanSelection40MHzOn2G '0'
option ChanSelectionMinIncPercent '30'
option AgentChanMismatchCheckInterval '60'
option UnassocRSSIAgeLimitSec '15'
option UnassocPeriodicQueryTimeSec '8'
option UnassocActiveClientTimeoutSec '300'
option UnassocMetricsDriverPollingTime '1'
option EnableBootOnlyScan '0'
option ChanScanIntervalMin '60'
option MapR1R2MixNotSupported '1'
option MapPFCompliant '0'
option NumberOfVLANSupported '0'
option Map2TrafficSepEnabled '0'
option Map8021QPCP '0'
option FronthaulSSIDPrimary ''
option VlanIDNwPrimary '0'
option FronthaulSSIDNwOne ''
option VlanIDNwOne '0'
option FronthaulSSIDNwTwo ''
option VlanIDNwTwo '0'
option FronthaulSSIDNwThree ''
option VlanIDNwThree '0'
option VlanNetworkPrimary ''
option CombinedR1R2Backhaul '1'
option EnableChannelScanRequest '1'
option EnableRptIndependentScan '1'
option UseCACResultForChanSelection '0'
option fallback_freq_5GH '5745'
option fallback_freq_5GL '5180'
option EnableZeroBss '0'
option BasicCap2G '02 03 51 e2 02 0c 0d 53 e2 00 54 e2 02 0c 0d'
option BasicCap5G '02 07 73 e2 00 74 e2 00 75 e2 00 76 e2 00 77 e2 00 78 e2 00 80 e2 04 6a 7a 8a 9b'
option EnableQCapability '0'
option Enable1905Security '0'
config MultiAPSPSettings 'MAPSPSettings'
option EnableSP '0'
option EnableEnhancedSP '0'
option MaxSPRules '0'
option EnableQSP '0'
option SPRulesConfPath '/etc/hyd/map/sp-rules.conf'
config MultiAPInventorySettings 'MAPInventorySettings'
option SerialNumber '8074'
option ExecutionEnvironment 'Linux'
option ChipsetVendor "QTI"
option SoftwareVersion "11.x"
config SteerMsg 'SteerMsg'
option AvgUtilReqTimeout '1'
option LoadBalancingCompleteTimeout '90'
option RspTimeout '2'
config Monitor 'Monitor'
option MonitorTimer '60'
option MonitorResponseTimeout '5'
config Debug 'Debug'
option EnableMemDebug '0'
config mc 'mc'
option AlwaysFloodUpdate '0'
config MultiAPConfigSettings 'MAPConfigSettings'
option EnableConfigService '0'
option MapConfigDumpToFile '0'
option RoleController '0'
option RoleAgent '0'
option DebugLevel '0'
option MapEProfile 'generic'
option MapMaxBss '4'
option bridge1 ''
option bridge2 ''
option bridge3 ''
option backhaul ''
option MapOnboardingType ''
option DPPConfiguratorKey ''
option DPPMyBootstrap ''

View file

@ -1,83 +0,0 @@
#!/bin/sh
. /lib/functions.sh
. /lib/functions/network.sh
. /lib/functions/hyfi-iface.sh
. /lib/functions/hyfi-network.sh
wan_protocol="pppoe"
__wan_pppoe_mode() {
local ifname wan_proto
ifname=`uci get network.wan.ifname`
wan_proto=`uci get network.wan.proto`
case "$ACTION" in
add)
if [[ "${ifname}" = "${INTERFACE}" -a "${wan_protocol}" = "${wan_proto}" ]];
then
return 1
fi
;;
remove)
if [[ "${ifname}" = "${INTERFACE}" -a "${wan_protocol}" = "${wan_proto}" ]];
then
return 1
fi
;;
esac
return 0
}
hyd_restart_aggr() {
local fileflag="/tmp/.hyd.restart.pending"
touch "$fileflag"
sleep 7
[ -f "$fileflag" ] || return
a=`stat -c %Y $fileflag`
b=`date +%s`
c=`expr $b - $a`
[ "$c" -ge 7 ] || return
[ -f "$fileflag" ] || return
rm -f $fileflag
/etc/init.d/hyd restart
}
hyd_restart() {
local exescript
exescript=`ls /etc/hotplug.d/net/*hyd* 2>&-`
[ -n "$exescript" ] || return
# Restart with aggregation(background)
exescript="$exescript &"
eval $exescript
}
trap '' INT TERM ABRT QUIT ALRM
enabled
config_load 'hyd'
config_get_bool enabled config 'Enable' '0'
[ "$enabled" -eq 0 ] && return
if [ -n "$1" ] ; then # Called by hotplugd
case "$INTERFACE" in
ath*|eth*|eth*.*|br*)
__wan_pppoe_mode
if [ "$?" -eq 0 ]; then
hyd_restart
fi
;;
esac
else # Called directly
hyd_restart_aggr
fi

File diff suppressed because it is too large Load diff

View file

@ -1,950 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (c) 2013, 2017-2019 Qualcomm Technologies, Inc.
#
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# 2013 Qualcomm Atheros, Inc.
#
# All Rights Reserved.
# Qualcomm Atheros Confidential and Proprietary.
START=55
SERVICE_WRITE_PID=1
SERVICE_DAEMONIZE=1
SERVICE_DEBUG_OUTPUT=0
SERVICE_PATH="/usr/sbin/hyd"
HYD_CONFIG_FILE_PREFIX="/tmp/hyd"
HYD_CONFIG_FILE="/tmp/hyd.conf"
HYD_RUN_FILE="/var/run/.hyd"
ECM_SYSFS_FILE="/sys/kernel/debug/ecm/ecm_classifier_hyfi/enabled"
# The stop_wifidown command is a special command that does not try to do
# any locking in order to prevent deadlocks during a wifi down operation
# that is actually part of a Wi-Fi interface restart.
EXTRA_COMMANDS="stop_wifidown"
EXTRA_HELP=<<EOF
stop_wifidown Stop hyd while bring down Wi-Fi interfaces
EOF
#check hyd config to enable/disable cfg80211
config_load 'hyd'
config_get_bool hyd_cfg config 'cfg80211_enable' '0'
if [ "$hyd_cfg" -eq "1" ]; then
HYD_CFG80211=-cfg80211
else
HYD_CFG80211=
fi
ieee1905managed_bridge=
ieee1905managed_bridge2=
ieee1905_brguest_map=""
ieee1905_brbh_map=""
. /lib/functions/hyfi-debug.sh
. /lib/functions/hyfi-iface.sh
. /lib/functions/hyfi-network.sh
if [ -f /lib/functions/lbd-config.sh ]; then
. /lib/functions/lbd-config.sh
fi
__hyd_cfg_append() {
local configfile=$2
echo "$1" >> "$configfile"
}
__hyd_cfg_nl_append() {
local configfile=$2
echo "" >> "$configfile"
echo "$1" >> "$configfile"
}
# __hyd_cfg_add_str <section> <option> <output key> <config file>
__hyd_cfg_add_str_new_key() {
local key="$2"
local section="$1"
local option="$2"
local output_key="$3"
local configfile=$4
config_get val "${section}" "${option}"
[ -n "${val}" ] && __hyd_cfg_append "${output_key}=${val}" $configfile
}
# __hyd_cfg_add_str <section> <option> <config file>
__hyd_cfg_add_str() {
__hyd_cfg_add_str_new_key $1 $2 $2 $3
}
__hyd_get_default_mode() {
local wan_iface
config_load network
config_get wan_iface wan ifname
if [ -n "$wan_iface" ]; then
eval "$1='HYROUTER'"
else
eval "$1='HYCLIENT'"
fi
}
__hyd_get_wlan_sta_ifaces() {
local config="$1"
local iface network mode disabled
config_get iface "$config" ifname
config_get network "$config" network
config_get mode "$config" mode
config_get disabled "$config" disabled '0'
if [ "$2" = "$network" -a "$mode" = "sta" -a "$disabled" -eq 0 ]; then
non_relay_ifaces=${non_relay_ifaces}${non_relay_ifaces:+","}${iface}
fi
}
# __hyd_get_nonrelay_eth_iface()
# input: $1 IEEE1905.1 managed bridge interface
# output: $2 Name of the upstream Ethernet interface
__hyd_get_nonrelay_eth_iface() {
local ieee1905managed="$1"
local eth_ifaces_full eth_ifaces
local ifname=""
# Query user config first. Even with Ethernet monitoring disabled, a
# manually configured upstream interface will always be non-relaying.
config_load hyd
config_get ifname config NonRelayingEthernetInterface ""
if [ -n "${ifname}" ]; then
eval "$2='${ifname}'"
return
fi
# If ethernet monitoring is disabled, there should be no nonrelaying
# ethernet interfaces.
if [ "$(uci get repacd.repacd.EnableEthernetMonitoring)" != "1" ]; then
eval "$2=''"
return
fi
# assume that our upstream interface is eth0, but verify it
# exists first. if it doesn't exist, we may be running on an
# unknown board.
# the reason we look for an interface that matches a pattern
# instead of referencing it directly is because the upstream port
# could be in a VLAN, for example if guest networks are configured.
hyfi_get_ether_ifaces ${ieee1905managed} eth_ifaces_full
hyfi_strip_list ${eth_ifaces_full} eth_ifaces
for eth_iface in ${eth_ifaces}; do
case ${eth_iface} in
eth0*)
ifname=${eth_iface}
;;
esac
done
eval "$2='${ifname}'"
}
__hyd_cfg_add_guest_interface() {
local all_ifaces wlan_ifaces
local configfile=$1
local br_name_guest=$ieee1905_brguest_map
local br_name_bh=$ieee1905_brbh_map
# Add other bridge names and interface list to config file
if [ -n "$br_name_guest" ]; then
br_num=1
for br in $br_name_guest; do
__hyd_cfg_append bridge$br_num=br-"$br" "$configfile"
# Get a list of all interfaces
hyfi_get_ifaces $br all_ifaces wlan_ifaces
if [ -n "$all_ifaces" ]; then
__hyd_cfg_append ManagedInterfacesList$br_num=$all_ifaces $configfile
fi
if [ -n "$wlan_ifaces" ]; then
__hyd_cfg_append WlanInterfaces$br_num=$wlan_ifaces $configfile
fi
br_num=$((br_num+1))
done
fi
if [ -n "$br_name_bh" ]; then
# Append backhaul interface to config file
__hyd_cfg_append backhaul="$br_name_bh" "$configfile"
# Get a list of all interfaces
hyfi_get_ifaces $br_name_bh all_ifaces wlan_ifaces
if [ -n "$all_ifaces" ]; then
__hyd_cfg_append 'ManagedInterfacesListBH='$all_ifaces $configfile
fi
if [ -n "$wlan_ifaces" ]; then
__hyd_cfg_append 'WlanInterfacesBH='$wlan_ifaces $configfile
fi
fi
}
__hyd_cfg_add_interface() {
local all_ifaces wlan_ifaces plc_iface non_relay_ifaces default_mode
local non_relay_eth_iface
local wlan_vlan_sta_ifaces
local br_name=$1
local configfile=$2
__hyd_cfg_append 'HybridBridgeInterfaceName=br-'$br_name $configfile
# Get a list of all interfaces
hyfi_get_ifaces $br_name all_ifaces wlan_ifaces
__hyd_cfg_append 'ManagedInterfacesList='$all_ifaces $configfile
__hyd_cfg_append 'WlanInterfaces='$wlan_ifaces $configfile
__hyd_get_default_mode default_mode
config_get mode config 'Mode' "$default_mode"
if [ "${mode}" = 'HYCLIENT' ];then
# Get PLC interface
hyfi_get_plc_iface $br_name plc_iface
if [ -n "$plc_iface" ]; then
hyfi_strip_list $plc_iface plc_iface
non_relay_ifaces=$plc_iface
fi
# Get all WLAN interfaces bound to the managed bridge
config_load wireless
config_foreach __hyd_get_wlan_sta_ifaces wifi-iface $br_name
hyfi_get_wlan_vlan_sta_ifaces $br_name wlan_vlan_sta_ifaces
if [ -n "${wlan_vlan_sta_ifaces}" ]; then
non_relay_ifaces=${non_relay_ifaces}${non_relay_ifaces:+","}${wlan_vlan_sta_ifaces}
fi
# Get the Ethernet interface to be included in the
# non-relaying group
__hyd_get_nonrelay_eth_iface $br_name non_relay_eth_iface
if [ -n "${non_relay_eth_iface}" ]; then
non_relay_ifaces=${non_relay_ifaces}${non_relay_ifaces:+","}${non_relay_eth_iface}
fi
__hyd_cfg_append 'NoRelayGroupList='"$non_relay_ifaces" $configfile
__hyd_cfg_append 'ForceGroupRelaying=1' $configfile
fi
local switch_lan_vid
local switch_cpu_root_port
__hyfi_get_switch_lan_vid switch_lan_vid
__hyfi_get_switch_cpu_port switch_cpu_root_port
__hyd_cfg_append 'SwitchLanVid='"$switch_lan_vid" $configfile
__hyd_cfg_append 'SwitchCpuPort='"$switch_cpu_root_port" $configfile
local iface_vlanids
hyfi_get_iface_vlanids iface_vlanids
__hyd_cfg_append 'VlanIds='"$iface_vlanids" $configfile
}
# Add or replace a line in the crontab based on the matching expression
# input: $1 match: the string to match against for deletion
# input: $2 line: the line to add to the crontab
__hyd_add_cron_line() {
local match=$1
local line=$2
# Need to make sure the crontab exists since otherwise an error will
# be produced
if crontab -l > /dev/null 2>&1; then
crontab -l | ( sed -e "/${match}/d"; echo "${line}" ) | crontab -
else
echo "${line}" | crontab -
fi
}
# Delete a line in the crontab based on the matching expression
# input: $1 match: the string to match against for deletion
__hyd_del_cron_line() {
local match=$1
local num_lines
if crontab -l > /dev/null 2>&1; then
crontab -l | sed -e "/${match}/d" | crontab -
num_lines=$(crontab -l | wc -l)
if [ "${num_lines}" -eq 0 ]; then
crontab -d
fi
fi
}
# Determine whether there are any crontabs installed
# Return 0 if there are, otherwise non-zero
__hyd_has_crontabs() {
if [ -z "$(ls /etc/crontabs/ | grep -v cron.update)" ]; then
return 1
else
return 0
fi
}
# Add a command into cron table
__hyd_add_crontab_cmd () {
local en=$1
local cron_expr=$2
local short_cmd=$3
local cmd
if [ "${en}" -gt 0 ] && [ -n "${cron_expr}" ]; then
cmd="${cron_expr} /usr/sbin/hyd-map-cmd ${short_cmd}"
__hyd_add_cron_line "$short_cmd" "$cmd"
else
__hyd_del_cron_line "$short_cmd"
fi
}
# Generate a new crontab based on the current settings and install it.
# Also manage whether the cron daemon is running or not based on
# there is now a new crontab or there are no longer any entries in
# the crontab.
__hyd_manage_cron() {
# Generate the lines for cron jobs
local crontabs_empty=0
local en
local cron_expr
local num_lines
if ! __hyd_has_crontabs; then
crontabs_empty=1
fi
# Generate the line for topology optimization
config_get_bool en "MultiAP" "EnableTopologyOpt" 0
config_get cron_expr "MultiAP" "TopologyOptCron"
__hyd_add_crontab_cmd "${en}" "${cron_expr}" "topopt"
# Generate the line for channel preference query
config_get_bool en "MultiAP" "EnableChanPrefQuery" 0
config_get cron_expr "MultiAP" "ChanPrefQueryCron"
__hyd_add_crontab_cmd "${en}" "${cron_expr}" "chanprefquery"
# Generate the line for background scanning on agent
config_get_bool en "MultiAP" "EnableCronBasedBkScan" 0
config_get cron_expr "MultiAP" "BkScanCron"
__hyd_add_crontab_cmd "${en}" "${cron_expr}" "bkscan"
if [ "${crontabs_empty}" -gt 0 ] && __hyd_has_crontabs;then
hyfi_echo hyd "Starting cron due to new crontabs"
/etc/init.d/cron start
elif [ "${crontabs_empty}" -eq 0 ] && ! __hyd_has_crontabs;then
hyfi_echo hyd "Stopping cron due to no crontabs"
/etc/init.d/cron stop
fi
}
__hyd_cfg_add_head() {
local configfile=$1
echo ";" >"$configfile"
__hyd_cfg_append '; Automatically generated hyd configure file,do not change it.' $configfile
__hyd_cfg_append ';' $configfile
__hyd_cfg_append '; INTERFACE: interface manager' $configfile
__hyd_cfg_append '; HY: hy manager' $configfile
__hyd_cfg_append '; WLAN: wlan manager' $configfile
__hyd_cfg_append '; PLC: plc manager' $configfile
__hyd_cfg_append '; ETH: eth manager' $configfile
__hyd_cfg_append '; PATHCH: pc service' $configfile
__hyd_cfg_append '; PATHCHWLAN: pcw service' $configfile
__hyd_cfg_append '; PATHCHPLC: pcp service' $configfile
__hyd_cfg_append '; PATHCHETH: pce service' $configfile
__hyd_cfg_append '; TOPOLOGY: td service' $configfile
__hyd_cfg_append '; HSPECEST: he service' $configfile
__hyd_cfg_append '; PATHSELECT: ps service' $configfile
__hyd_cfg_append '; LOGSETTINGS: log service' $configfile
__hyd_cfg_append '; IEEE1905: IEEE 1905.1 settings' $configfile
__hyd_cfg_append '; HCP: HCP settings' $configfile
__hyd_cfg_append '; MAP: Multi-AP SIG settings' $configfile
__hyd_cfg_append '; DPP: DPP service' $configfile
__hyd_cfg_append '; MC: mc manager' $configfile
__hyd_cfg_append ';' $configfile
}
__hyd_create_config() {
local br_name=$1
local configfile=$2
config_load 'hyd'
__hyd_cfg_add_head $configfile
config_get MapVersion MultiAP 'MapVersion' '0'
config_get num_vlan_supported MultiAP 'NumberOfVLANSupported' '0'
if [ "$MapVersion" -gt 1 ] && [ "$num_vlan_supported" -gt 0 ]; then
# Get the Guest Bridge Names
hyfi_get_ieee1905_brguest_map ieee1905_brguest_map ieee1905_brbh_map
fi
__hyd_cfg_nl_append '[INTERFACE]' $configfile
__hyd_cfg_add_interface $br_name $configfile
__hyd_cfg_add_guest_interface $configfile
__hyd_cfg_add_str hy ForwardingMode $configfile
__hyd_cfg_nl_append '[HY]' $configfile
__hyd_cfg_add_str hy LoadBalancingSeamless $configfile
__hyd_cfg_add_str hy ConstrainTCPMedium $configfile
__hyd_cfg_add_str hy MaxLBReordTimeout $configfile
__hyd_cfg_add_str hy HActiveMaxAge $configfile
__hyd_cfg_add_str hy HMWDSProgramRetryCount $configfile
__hyd_cfg_nl_append '[PATHCH]' $configfile
# The following parameters are taken from the LBD config.
config_load 'lbd'
__hyd_cfg_add_str_new_key Offload MUSafetyThreshold_W2 ChanUtilSafetyThreshold_W2 $configfile
__hyd_cfg_add_str_new_key Offload MUSafetyThreshold_W5 ChanUtilSafetyThreshold_W5 $configfile
__hyd_cfg_add_str_new_key Offload MUSafetyThreshold_W6 ChanUtilSafetyThreshold_W6 $configfile
config_load 'hyd' # in case loading whc clobbered any values
__hyd_cfg_nl_append '[PATHCHWLAN]' $configfile
__hyd_cfg_add_str PathChWlan UpdatedStatsInterval_W2 $configfile
__hyd_cfg_add_str PathChWlan StatsAgedOutInterval_W2 $configfile
__hyd_cfg_add_str PathChWlan MaxMediumUtilization_W2 $configfile
__hyd_cfg_add_str PathChWlan MediumChangeThreshold_W2 $configfile
__hyd_cfg_add_str PathChWlan LinkChangeThreshold_W2 $configfile
__hyd_cfg_add_str PathChWlan MaxMediumUtilizationForLC_W2 $configfile
__hyd_cfg_add_str PathChWlan CPULimitedTCPThroughput_W2 $configfile
__hyd_cfg_add_str PathChWlan CPULimitedUDPThroughput_W2 $configfile
__hyd_cfg_add_str PathChWlan PHYRateThresholdForMU_W2 $configfile
__hyd_cfg_add_str PathChWlan ProbePacketInterval_W2 $configfile
__hyd_cfg_add_str PathChWlan ProbePacketSize_W2 $configfile
__hyd_cfg_add_str PathChWlan EnableProbe_W2 $configfile
__hyd_cfg_add_str PathChWlan AssocDetectionDelay_W2 $configfile
__hyd_cfg_add_str PathChWlan UpdatedStatsInterval_W5 $configfile
__hyd_cfg_add_str PathChWlan StatsAgedOutInterval_W5 $configfile
__hyd_cfg_add_str PathChWlan MaxMediumUtilization_W5 $configfile
__hyd_cfg_add_str PathChWlan MediumChangeThreshold_W5 $configfile
__hyd_cfg_add_str PathChWlan LinkChangeThreshold_W5 $configfile
__hyd_cfg_add_str PathChWlan MaxMediumUtilizationForLC_W5 $configfile
__hyd_cfg_add_str PathChWlan CPULimitedTCPThroughput_W5 $configfile
__hyd_cfg_add_str PathChWlan CPULimitedUDPThroughput_W5 $configfile
__hyd_cfg_add_str PathChWlan PHYRateThresholdForMU_W5 $configfile
__hyd_cfg_add_str PathChWlan ProbePacketInterval_W5 $configfile
__hyd_cfg_add_str PathChWlan ProbePacketSize_W5 $configfile
__hyd_cfg_add_str PathChWlan EnableProbe_W5 $configfile
__hyd_cfg_add_str PathChWlan AssocDetectionDelay_W5 $configfile
__hyd_cfg_add_str PathChWlan UpdatedStatsInterval_W6 $configfile
__hyd_cfg_add_str PathChWlan StatsAgedOutInterval_W6 $configfile
__hyd_cfg_add_str PathChWlan MaxMediumUtilization_W6 $configfile
__hyd_cfg_add_str PathChWlan MediumChangeThreshold_W6 $configfile
__hyd_cfg_add_str PathChWlan LinkChangeThreshold_W6 $configfile
__hyd_cfg_add_str PathChWlan MaxMediumUtilizationForLC_W6 $configfile
__hyd_cfg_add_str PathChWlan CPULimitedTCPThroughput_W6 $configfile
__hyd_cfg_add_str PathChWlan CPULimitedUDPThroughput_W6 $configfile
__hyd_cfg_add_str PathChWlan PHYRateThresholdForMU_W6 $configfile
__hyd_cfg_add_str PathChWlan ProbePacketInterval_W6 $configfile
__hyd_cfg_add_str PathChWlan ProbePacketSize_W6 $configfile
__hyd_cfg_add_str PathChWlan EnableProbe_W6 $configfile
__hyd_cfg_add_str PathChWlan AssocDetectionDelay_W6 $configfile
__hyd_cfg_add_str PathSelect LinkCapacityThreshold $configfile
# These parameters are shared with LBD, so read them from there
# and remap them to the keys needed by pcwService.
config_load 'lbd'
__hyd_cfg_add_str_new_key Estimator_Adv LowPhyRateThreshold LinkCapacityThreshold $configfile
__hyd_cfg_add_str_new_key Estimator_Adv HighPhyRateThreshold_W2 ScalingFactorHighRate_W2 $configfile
__hyd_cfg_add_str_new_key Estimator_Adv HighPhyRateThreshold_W5 ScalingFactorHighRate_W5 $configfile
__hyd_cfg_add_str_new_key Estimator_Adv HighPhyRateThreshold_W6 ScalingFactorHighRate_W6 $configfile
__hyd_cfg_add_str_new_key Estimator_Adv PhyRateScalingFactorLow ScalingFactorLow $configfile
__hyd_cfg_add_str_new_key Estimator_Adv PhyRateScalingFactorMedium ScalingFactorMedium $configfile
__hyd_cfg_add_str_new_key Estimator_Adv PhyRateScalingFactorHigh ScalingFactorHigh $configfile
__hyd_cfg_add_str_new_key Estimator_Adv PhyScalingFactorTCP ScalingFactorTCP $configfile
config_load 'hyd'
__hyd_cfg_add_str PathChWlan UseWHCAlgorithm $configfile
__hyd_cfg_nl_append '[PATHCHPLC]' $configfile
__hyd_cfg_add_str PathChPlc MaxMediumUtilization $configfile
__hyd_cfg_add_str PathChPlc MediumChangeThreshold $configfile
__hyd_cfg_add_str PathChPlc LinkChangeThreshold $configfile
__hyd_cfg_add_str PathChPlc StatsAgedOutInterval $configfile
__hyd_cfg_add_str PathChPlc UpdateStatsInterval $configfile
__hyd_cfg_add_str PathChPlc EntryExpirationInterval $configfile
__hyd_cfg_add_str PathChPlc MaxMediumUtilizationForLC $configfile
__hyd_cfg_add_str PathChPlc LCThresholdForUnreachable $configfile
__hyd_cfg_add_str PathChPlc LCThresholdForReachable $configfile
__hyd_cfg_add_str PathChPlc HostPLCInterfaceSpeed $configfile
__hyd_cfg_nl_append '[TOPOLOGY]' $configfile
__hyd_cfg_add_str Topology ND_UPDATE_INTERVAL $configfile
__hyd_cfg_add_str Topology BD_UPDATE_INTERVAL $configfile
__hyd_cfg_add_str Topology HOLDING_TIME $configfile
__hyd_cfg_add_str Topology TIMER_LOW_BOUND $configfile
__hyd_cfg_add_str Topology TIMER_UPPER_BOUND $configfile
__hyd_cfg_add_str Topology MSGID_DELTA $configfile
__hyd_cfg_add_str Topology HA_AGING_INTERVAL $configfile
__hyd_cfg_add_str Topology ENABLE_TD3 $configfile
__hyd_cfg_add_str Topology ENABLE_BD_SPOOFING $configfile
__hyd_cfg_add_str Topology NOTIFICATION_THROTTLING_WINDOW $configfile
__hyd_cfg_add_str Topology PERIODIC_QUERY_INTERVAL $configfile
__hyd_cfg_add_str Topology ENABLE_NOTIFICATION_UNICAST $configfile
__hyd_cfg_nl_append '[PATHSELECT]' $configfile
__hyd_cfg_add_str PathSelect UpdateHDInterval $configfile
__hyd_cfg_add_str PathSelect LinkCapacityThreshold $configfile
__hyd_cfg_add_str PathSelect UDPInterfaceOrder $configfile
__hyd_cfg_add_str PathSelect NonUDPInterfaceOrder $configfile
__hyd_cfg_add_str PathSelect SerialflowIterations $configfile
__hyd_cfg_add_str PathSelect DeltaLCThreshold $configfile
__hyd_cfg_add_str PathSelect EnableBadLinkStatsSwitchFlow $configfile
__hyd_cfg_nl_append '[HSPECEST]' $configfile
__hyd_cfg_add_str HSPECEst UpdateHSPECInterval $configfile
__hyd_cfg_add_str HSPECEst NotificationThresholdLimit $configfile
__hyd_cfg_add_str HSPECEst NotificationThresholdPercentage $configfile
__hyd_cfg_add_str HSPECEst AlphaNumerator $configfile
__hyd_cfg_add_str HSPECEst AlphaDenominator $configfile
__hyd_cfg_add_str HSPECEst LocalFlowRateThreshold $configfile
__hyd_cfg_add_str HSPECEst LocalFlowRatioThreshold $configfile
__hyd_cfg_add_str HSPECEst MaxHActiveEntries $configfile
__hyd_cfg_nl_append '[LOGSETTINGS]' $configfile
__hyd_cfg_add_str LogSettings EnableLog $configfile
__hyd_cfg_add_str LogSettings LogRestartIntervalSec $configfile
__hyd_cfg_add_str LogSettings LogPCSummaryIntervalSec $configfile
__hyd_cfg_add_str LogSettings LogServerIP $configfile
__hyd_cfg_add_str LogSettings LogServerPort $configfile
__hyd_cfg_add_str LogSettings EnableLogPCW2 $configfile
__hyd_cfg_add_str LogSettings EnableLogPCW5 $configfile
__hyd_cfg_add_str LogSettings EnableLogPCW6 $configfile
__hyd_cfg_add_str LogSettings EnableLogPCP $configfile
__hyd_cfg_add_str LogSettings EnableLogTD $configfile
__hyd_cfg_add_str LogSettings EnableLogHE $configfile
__hyd_cfg_add_str LogSettings EnableLogPS $configfile
__hyd_cfg_add_str LogSettings LogHEThreshold1 $configfile
__hyd_cfg_add_str LogSettings LogHEThreshold2 $configfile
__hyd_cfg_nl_append '[IEEE1905]' $configfile
__hyd_cfg_add_str IEEE1905Settings StrictIEEE1905Mode $configfile
__hyd_cfg_add_str IEEE1905Settings GenerateLLDP $configfile
__hyd_cfg_add_str IEEE1905Settings AvoidDupRenew $configfile
__hyd_cfg_add_str IEEE1905Settings AvoidDupTopologyNotification $configfile
__hyd_cfg_nl_append '[HCP]' $configfile
__hyd_cfg_add_str HCPSettings V1Compat $configfile
__hyd_cfg_nl_append '[WLAN]' $configfile
__hyd_cfg_add_str Wlan WlanCheckFreqInterval $configfile
__hyd_cfg_add_str Wlan WlanALDNLNumOverride $configfile
__hyd_cfg_nl_append '[MAP]' $configfile
__hyd_cfg_add_str MultiAP EnableController $configfile
__hyd_cfg_add_str MultiAP EnableAgent $configfile
__hyd_cfg_add_str MultiAP EnableSigmaDUT $configfile
__hyd_cfg_add_str MultiAP MapVersion $configfile
__hyd_cfg_add_str MultiAP EnableIEEE1905Assist $configfile
__hyd_cfg_add_str MultiAP ClientAssocCtrlTimeoutSec $configfile
__hyd_cfg_add_str MultiAP ClientAssocCtrlTimeoutUsec $configfil
__hyd_cfg_add_str MultiAP ShortBlacklistTimeSec $configfile
__hyd_cfg_add_str MultiAP AlwaysClearBlacklists $configfile
__hyd_cfg_add_str MultiAP ClientSteerTimeoutSec $configfile
__hyd_cfg_add_str MultiAP ClientSteerTimeoutUsec $configfile
__hyd_cfg_add_str MultiAP MetricsReportingInterval $configfile
__hyd_cfg_add_str MultiAP RSSIHysteresis_W2 $configfile
__hyd_cfg_add_str MultiAP RSSIHysteresis_W5 $configfile
__hyd_cfg_add_str MultiAP RSSIHysteresis_W6 $configfile
__hyd_cfg_add_str MultiAP LoadBalancingInterval $configfile
__hyd_cfg_add_str MultiAP EnableChannelSelection $configfile
__hyd_cfg_add_str MultiAP MinPreferredChannelIndex $configfile
__hyd_cfg_add_str MultiAP MaxPreferredChannelIndex $configfile
__hyd_cfg_add_str MultiAP EnableTopologyOpt $configfile
__hyd_cfg_add_str MultiAP TopologyOptNewAgentDelay $configfile
__hyd_cfg_add_str MultiAP TopologyOptDelAgentDelay $configfile
__hyd_cfg_add_str MultiAP TopologyOptCollectionTime $configfile
__hyd_cfg_add_str MultiAP TopologyOptActivityMonitoringSecs $configfile
__hyd_cfg_add_str MultiAP TopologyOptMinIncreasePercentage $configfile
__hyd_cfg_add_str MultiAP TopologyOptAllowActiveSteer $configfile
__hyd_cfg_add_str MultiAP TopologyOptMaxIdleWaitSecs $configfile
__hyd_cfg_add_str MultiAP TopologyOptSettlingTime $configfile
__hyd_cfg_add_str MultiAP BackhaulSteeringRspSendTimeout $configfile
__hyd_cfg_add_str MultiAP UnassocMetricsRspWaitTimeSec $configfile
__hyd_cfg_add_str MultiAP UnassocMetricsRspMsgTimeout $configfile
__hyd_cfg_add_str MultiAP CBSDwellSplitMSec $configfile
__hyd_cfg_add_str MultiAP CBSDelaySec $configfile
__hyd_cfg_add_str MultiAP CBSStateResetSec $configfile
__hyd_cfg_add_str MultiAP BkScanIntervalMin $configfile
__hyd_cfg_add_str MultiAP EnableCronBasedBkScan $configfile
__hyd_cfg_add_str MultiAP UseCBSRankForHomeChan $configfile
__hyd_cfg_add_str MultiAP EnableChanPrefQuery $configfile
__hyd_cfg_add_str MultiAP ChannelSelectionOnGlobalPref $configfile
__hyd_cfg_add_str MultiAP ChannelSelectionDelaySec $configfile
__hyd_cfg_add_str MultiAP ChanSupervisionMinDelaySec $configfile
__hyd_cfg_add_str MultiAP ChanSupervisionMaxDelaySec $configfile
__hyd_cfg_add_str MultiAP ChanSupervisionMaxAttempts $configfile
__hyd_cfg_add_str MultiAP ChanSupervisionIntervalSec $configfile
__hyd_cfg_add_str MultiAP ChanSupervisionTolerate40MHzCoexRulesOn24GHz $configfile
__hyd_cfg_add_str MultiAP ControllerChanSelection160MHz $configfile
__hyd_cfg_add_str MultiAP AgentChanSelection160MHz $configfile
__hyd_cfg_add_str MultiAP ControllerChanSelection40MHzOn2G $configfile
__hyd_cfg_add_str MultiAP AgentChanSelection40MHzOn2G $configfile
__hyd_cfg_add_str MultiAP AgentChanMismatchCheckInterval $configfile
__hyd_cfg_add_str MultiAP ChanSelectionMinIncPercent $configfile
__hyd_cfg_add_str MultiAP UnassocRSSIAgeLimitSec $configfile
__hyd_cfg_add_str MultiAP UnassocPeriodicQueryTimeSec $configfile
__hyd_cfg_add_str MultiAP UnassocActiveClientTimeoutSec $configfile
__hyd_cfg_add_str MultiAP UnassocMetricsDriverPollingTime $configfile
__hyd_cfg_add_str MultiAP NumberOfVLANSupported $configfile
__hyd_cfg_add_str MultiAP Map2TrafficSepEnabled $configfile
__hyd_cfg_add_str MultiAP Map8021QPCP $configfile
__hyd_cfg_add_str MultiAP FronthaulSSIDPrimary $configfile
__hyd_cfg_add_str MultiAP AdditionalFH $configfile
__hyd_cfg_add_str MultiAP VlanIDNwPrimary $configfile
__hyd_cfg_add_str MultiAP FronthaulSSIDNwOne $configfile
__hyd_cfg_add_str MultiAP VlanIDNwOne $configfile
__hyd_cfg_add_str MultiAP FronthaulSSIDNwTwo $configfile
__hyd_cfg_add_str MultiAP VlanIDNwTwo $configfile
__hyd_cfg_add_str MultiAP FronthaulSSIDNwThree $configfile
__hyd_cfg_add_str MultiAP VlanIDNwThree $configfile
__hyd_cfg_add_str MultiAP VlanNetworkPrimary $configfile
__hyd_cfg_add_str MultiAP CombinedR1R2Backhaul $configfile
__hyd_cfg_add_str MultiAP UseCACResultForChanSelection $configfile
__hyd_cfg_add_str MultiAP fallback_freq_5GH $configfile
__hyd_cfg_add_str MultiAP fallback_freq_5GL $configfile
__hyd_cfg_add_str MultiAP EnableZeroBss $configfile
__hyd_cfg_add_str MultiAP BasicCap2G $configfile
__hyd_cfg_add_str MultiAP BasicCap5G $configfile
# Update the root user's crontab for any periodic actions
__hyd_manage_cron
# The following parameters are taken from the LBD config.
config_load 'lbd'
__hyd_cfg_add_str_new_key Offload MUOverloadThreshold_W2 ChanUtilSteeringThreshold_W2 $configfile
__hyd_cfg_add_str_new_key Offload MUOverloadThreshold_W5 ChanUtilSteeringThreshold_W5 $configfile
__hyd_cfg_add_str_new_key Offload MUOverloadThreshold_W6 ChanUtilSteeringThreshold_W6 $configfile
__hyd_cfg_add_str_new_key Offload MUOverloadThreshold_W2 ChanUtilReportingThreshold_W2 $configfile
__hyd_cfg_add_str_new_key Offload MUOverloadThreshold_W5 ChanUtilReportingThreshold_W5 $configfile
__hyd_cfg_add_str_new_key Offload MUOverloadThreshold_W6 ChanUtilReportingThreshold_W6 $configfile
__hyd_cfg_add_str_new_key APSteer LowRSSIAPSteerThreshold_SIG RSSISteeringThreshold_W2 $configfile
__hyd_cfg_add_str_new_key APSteer LowRSSIAPSteerThreshold_SIG RSSISteeringThreshold_W5 $configfile
__hyd_cfg_add_str_new_key APSteer LowRSSIAPSteerThreshold_SIG RSSISteeringThreshold_W6 $configfile
__hyd_cfg_add_str_new_key APSteer LowRSSIAPSteerThreshold_SIG RSSIReportingThreshold_W2 $configfile
__hyd_cfg_add_str_new_key APSteer LowRSSIAPSteerThreshold_SIG RSSIReportingThreshold_W5 $configfile
__hyd_cfg_add_str_new_key APSteer LowRSSIAPSteerThreshold_SIG RSSIReportingThreshold_W6 $configfile
__hyd_cfg_add_str_new_key ActiveSteer TxRateXingThreshold_UG HighTxRateXingThreshold $configfile
__hyd_cfg_add_str_new_key ActiveSteer TxRateXingThreshold_DG LowTxRateXingThreshold $configfile
__hyd_cfg_add_str_new_key ActiveSteer RateRSSIXingThreshold_UG HighRateRSSIXingThreshold $configfile
__hyd_cfg_add_str_new_key ActiveSteer RateRSSIXingThreshold_DG LowRateRSSIXingThreshold $configfile
__hyd_cfg_add_str_new_key IdleSteer RSSISteeringPoint_UG InactRSSIXingHighThreshold $configfile
__hyd_cfg_add_str_new_key IdleSteer RSSISteeringPoint_DG InactRSSIXingLowThreshold $configfile
config_load 'hyd'
__hyd_cfg_nl_append '[DPP]' $configfile
__hyd_cfg_add_str DPP EnableDPP $configfile
__hyd_cfg_nl_append '[MC]' $configfile
__hyd_cfg_add_str mc AlwaysFloodUpdate $configfile
config_load 'hyd' # in case loading whc clobbered any values
__hyd_cfg_nl_append '[STEERMSG]' $configfile
__hyd_cfg_add_str SteerMsg AvgUtilReqTimeout $configfile
__hyd_cfg_add_str SteerMsg LoadBalancingCompleteTimeout $configfile
__hyd_cfg_add_str SteerMsg RspTimeout $configfile
__hyd_cfg_nl_append '[MONITOR]' $configfile
__hyd_cfg_add_str Monitor MonitorTimer $configfile
__hyd_cfg_add_str Monitor MonitorResponseTimeout $configfile
# If the configuration exists, go ahead and append it. Even if the Wi-Fi load
# balancing feature is disabled, there should be no harm in doing so.
if [ -f /etc/config/lbd ]; then
local default_mode enable_ctrl enable_agent multi_ap_mode
__hyd_get_default_mode default_mode
config_get mode config 'Mode' "$default_mode"
config_get enable_ctrl MultiAP 'EnableController' '0'
config_get enable_agent MultiAP 'EnableAgent' '0'
if [ "$enable_ctrl" -gt 0 ] || [ "$enable_agent" -gt 0 ]; then
multi_ap_mode='map'
else
multi_ap_mode='son'
fi
__hyd_cfg_nl_append '[WLB]' "$configfile"
__hyd_cfg_add_str config DisableSteering "$configfile"
if [ "${mode}" = 'HYCLIENT' ];then
# running in multi-AP RE mode
lbd_create_config "$configfile" $multi_ap_mode 0 "$br_name"
else
# running in multi-AP CAP mode
lbd_create_config "$configfile" $multi_ap_mode 1 "$br_name"
fi
fi
}
__hyd_set_wlan_mcastenhance() {
hyfi_get_wlan_ifaces $ieee1905managed_bridge wlan_ifaces wlan_included_ifaces
[ -z "$wlan_ifaces" ] && return
hyfi_strip_list $wlan_ifaces wlan_ifaces
for wlan_iface in ${wlan_ifaces}; do
if [ -z $HYD_CFG80211 ]; then
iwpriv $wlan_iface mcastenhance $1
else
cfg80211tool $wlan_iface mcastenhance $1
fi
done
if [ -n "$ieee1905managed_bridge2" ];then
hyfi_get_wlan_ifaces $ieee1905managed_bridge2 wlan_ifaces2 wlan_included_ifaces2
[ -z "$wlan_ifaces2" ] && return
hyfi_strip_list $wlan_ifaces2 wlan_ifaces2
for wlan_iface in ${wlan_ifaces}; do
if [ -z $HYD_CFG80211 ]; then
iwpriv $wlan_iface2 mcastenhance $1
else
cfg80211tool $wlan_iface2 mcastenhance $1
fi
done
fi
}
__hyd_reset_cpu_limit_value_for_legacy_boards() {
config_load 'hyd'
local tcp2g udp2g tcp5g udp5g tcp6g udp6g limit name
config_get tcp2g PathChWlan 'CPULimitedTCPThroughput_W2' '0'
[ "$tcp2g" -gt 0 ] && return 1
config_get udp2g PathChWlan 'CPULimitedUDPThroughput_W2' '0'
[ "$udp2g" -gt 0 ] && return 1
config_get tcp5g PathChWlan 'CPULimitedTCPThroughput_W5' '0'
[ "$tcp5g" -gt 0 ] && return 1
config_get udp5g PathChWlan 'CPULimitedUDPThroughput_W5' '0'
[ "$udp5g" -gt 0 ] && return 1
config_get tcp6g PathChWlan 'CPULimitedTCPThroughput_W6' '0'
[ "$tcp6g" -gt 0 ] && return 1
config_get udp6g PathChWlan 'CPULimitedUDPThroughput_W6' '0'
[ "$udp6g" -gt 0 ] && return 1
[ -f /tmp/sysinfo/board_name ] || return 1
name=`cat /tmp/sysinfo/board_name`
case "$name" in
reh132 | aph126 | aph128 | db120)
limit=160
;;
aph131)
limit=300
;;
*)
# Max u_int32. If the throughput should be limited for a particular
# board, add an entry for it above.
limit=4294967295
;;
esac
uci set hyd.PathChWlan.CPULimitedTCPThroughput_W2=$limit
uci set hyd.PathChWlan.CPULimitedUDPThroughput_W2=$limit
uci set hyd.PathChWlan.CPULimitedTCPThroughput_W5=$limit
uci set hyd.PathChWlan.CPULimitedUDPThroughput_W5=$limit
uci set hyd.PathChWlan.CPULimitedTCPThroughput_W6=$limit
uci set hyd.PathChWlan.CPULimitedUDPThroughput_W6=$limit
uci commit hyd
}
# this block of code is for checking if all the configured interfaces are ready.
# a global flag is used for passing the rechecking resule
is_iface_all_up=1
__hyd_check_one_iface_ready() {
local config=$1
local network mode disabled device dev_disabled
config_get iface "$config" ifname
config_get network "$config" network
config_get mode "$config" mode
config_get disabled "$config" disabled '0'
# Skip this interface if disabled at the device level
config_get device "$config" device
config_get dev_disabled "$device" disabled '0'
if [ "$dev_disabled" -gt 0 ]; then
return
fi
if [ "$2" = "$network" -a "$disabled" -eq 0 ]; then
# interface name may not be available
if [ -z "$iface" ]; then
is_iface_all_up=0
else
# interface may not be up
iwconfig $iface 2>/dev/null |grep $iface
retval=$?
if [ $retval -ne 0 ] ;then
is_iface_all_up=0
fi
fi
fi
}
__hyd_check_interfaces_ready () {
config_load wireless
is_iface_all_up=1
config_foreach __hyd_check_one_iface_ready wifi-iface $1
if [ $is_iface_all_up -ne 1 ] ;then
hyfi_echo hyd "some interface(s) are not ready."
fi
}
start() {
hyfi_lock # Ensure only single config file generator
__stop_daemon
config_load 'hyd'
config_get_bool enabled config 'Enable' '0'
local hyd_rcd_enabled=`ls /etc/rc.d/S${START}hyd 2> /dev/null`
[ "$enabled" -gt 0 -a -n "$hyd_rcd_enabled" ] || {
hyfi_unlock
return 1
}
# Enable hyfi-netfilter
if [ -f /proc/sys/net/bridge/bridge-nf-call-custom ]; then
sysctl -w net.bridge.bridge-nf-call-custom=1
fi
# Get the IEEE1905.1 managed bridge name and attach
hyfi_get_ieee1905_managed_iface ieee1905managed_bridge ieee1905managed_bridge2
# Make sure the bridge is attached first
# Bail out from starting hyd if attach fails.
if ! hyctl attach br-$ieee1905managed_bridge; then
stop
hyfi_unlock
return 1
fi
if [ -n "$ieee1905managed_bridge2" ] ;then
if ! hyctl show br-$ieee1905managed_bridge2 | grep -q br-$ieee1905managed_bridge2 ; then
hyfi_error "hyd" "Bridge is not attached; start hyfi-bridging first"
hyfi_unlock
return 1
fi
fi
# Enable wlan Hy-Fi multicast enhancement
__hyd_set_wlan_mcastenhance 5
# By default disable retag of DSCP when multicast enhancement is enabled.
hyctl setmc br-$ieee1905managed_bridge retag disable
if [ -n "$ieee1905managed_bridge2" ] ;then
hyctl setmc br-$ieee1905managed_bridge2 retag disable
fi
__hyd_reset_cpu_limit_value_for_legacy_boards
# check for all the interfaces for private network ready
__hyd_check_interfaces_ready ${ieee1905managed_bridge}
if [ $is_iface_all_up -eq 0 ]; then
hyfi_error "hyd" "Private network interface checking failed"
hyfi_unlock
return 1
fi
if [ -n "$ieee1905managed_bridge2" ] ;then
# check for all the interfaces for guest network ready
__hyd_check_interfaces_ready ${ieee1905managed_bridge2}
if [ $is_iface_all_up -eq 0 ]; then
hyfi_error "hyd" "Guest network interface checking failed" >> /tmp/bill.log
hyfi_unlock
return 1
fi
fi
# Create temp configuration files, then rename and then start hyd
hyd_temp_file=${HYD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge}-tmp.conf
hyd_temp_file2=${HYD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge2}-tmp.conf
__hyd_create_config $ieee1905managed_bridge ${hyd_temp_file}
if [ -n "$ieee1905managed_bridge2" ] ;then
__hyd_create_config $ieee1905managed_bridge2 ${hyd_temp_file2}
fi
hyfi_echo hyd "starting daemon"
# rename the temp files to final files
mv ${hyd_temp_file} ${HYD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge}.conf
if [ -n "$ieee1905managed_bridge2" ] ;then
mv ${hyd_temp_file2} ${HYD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge2}.conf
fi
export SERVICE_PID_FILE=/var/run/hyd-${ieee1905managed_bridge}.pid
${SVCDBG}service_start ${SERVICE_PATH} -d -C ${HYD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge}.conf -P 7777 $HYD_CFG80211
touch $HYD_RUN_FILE
# By default disable retag of DSCP when multicast enhancement is enabled.
hyctl setmc br-$ieee1905managed_bridge retag disable
if [ -n "$ieee1905managed_bridge2" ] ;then
hyfi_echo hyd "starting daemon ${ieee1905managed_bridge2}"
export SERVICE_PID_FILE=/var/run/hyd-${ieee1905managed_bridge2}.pid
${SVCDBG}service_start ${SERVICE_PATH} -d -C ${HYD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge2}.conf -P 8888 $HYD_CFG80211
fi
hyfi_unlock
}
__stop_daemon() {
# Disable the ECM classifier
if [ -w "${ECM_SYSFS_FILE}" ]; then
echo 0 > "${ECM_SYSFS_FILE}"
fi
${SVCDBG}service_stop ${SERVICE_PATH}
# Workaround, sometimes service_stop does not kill hyd
start-stop-daemon -K -x ${SERVICE_PATH} -s SIGKILL > /dev/null
}
__stop_hyfi_bridging() {
config_load 'hyd'
# Disable hyfi-netfilter
if [ -f /proc/sys/net/bridge/bridge-nf-call-custom ]; then
sysctl -w net.bridge.bridge-nf-call-custom=0
fi
# Get the IEEE1905.1 managed bridge name and detach
hyfi_get_ieee1905_managed_iface ieee1905managed_bridge
hyctl detach br-$ieee1905managed_bridge
}
stop() {
__stop_daemon
__stop_hyfi_bridging
# Disable wlan Hy-Fi multicast enhancement
__hyd_set_wlan_mcastenhance 2
}
stop_wifidown() {
__stop_daemon
# Do not stop the bridging since the interfaces are still attached
# to the bridge. If we stopped the bridging, this can cause a temporary
# loop and may lead to incorrect WDS entries. By leaving the bridging
# rules in place even though hyd is not running, we should be able to
# prevent the loops prior to the point the Wi-Fi interfaces are destroyed.
# No need to stop multicast enhancement when the interfaces are being
# destroyed.
}
restart() {
[ -f "$HYD_RUN_FILE" ] || return
start
}

View file

@ -1 +0,0 @@
telnet 127.0.0.1 7777

View file

@ -1,52 +0,0 @@
# Copyright (c) 2021 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# The purpose of this file is to enter the service prioritization rules. A max of 64 rules
# can be entered in the file.
# The types of rules that can be entered:
# 1. Basic Service Prioritization:
# format - bsp,alId,ruleid,ruleprecedence,
# 2. Enhanced Service Prioritization:
# format - esp,alId,ruleid,ruleprecedence,ruleoutput,matchflags,userpriority,mac_addr,dest_macaddr,
# 3. Q Service Priotization:
# format - qsp,alId,ruleid,ruleprecedence,ruleoutput,matchflags,qmatchflags,userpriority,mac_addr,
# dest_macaddr,srcipv4addr,srcipv6addr,dstipaAddr,dstipv6addr,srcport,dstPort,protocolNumber,
# vlanid,dscp,serviceintervalDl,serviceintervalUl,burstsizeDl,burstsizeUl,
# Notes:
# 1. NO spaces between parameters.
# 2. All parameters preceeding matchFlags and qMatchFlags are mandatory.
# 3. All parameters after matchFlags and qMatchFlags are dependant on the flags set (See 4 and 5).
# 4. wifi params are mandatory for qsp irrepsective of flags set.
# 5. matchFlags
# Bit 7 (10000000): rule_match_always_true
# Bit 6 (01000000): Reserved
# Bit 5 (00100000): matchup
# Bit 4 (00010000): match_up_sense
# Bit 3 (00001000): match_source_mac
# Bit 2 (00000100): match_source_mac_sense
# Bit 1 (00000010): match_dst_mac
# Bit 0 (00000001): match_dst_mac_sense
# 6. qMatchFlags
# Bit 31 (10000000 00000000 00000000 00000000): match_source_ipv4
# Bit 30 (01000000 00000000 00000000 00000000): match_source_ipv4_sense
# Bit 29 (00100000 00000000 00000000 00000000): match_dst_ipv4
# Bit 28 (00010000 00000000 00000000 00000000): match_dst_ipv4_sense
# Bit 27 (00001000 00000000 00000000 00000000): match_source_ipv6
# Bit 26 (00000100 00000000 00000000 00000000): match_source_ipv6_sense
# Bit 25 (00000010 00000000 00000000 00000000): match_dst_ipv6
# Bit 24 (00000001 00000000 00000000 00000000): match_dst_ipv6Sense
# Bit 23 (00000000 10000000 00000000 00000000): match_source_port
# Bit 22 (00000000 01000000 00000000 00000000): match_source_port_sense
# Bit 21 (00000000 00100000 00000000 00000000): match_dst_port
# Bit 20 (00000000 00010000 00000000 00000000): match_dst_port_sense
# Bit 19 (00000000 00001000 00000000 00000000): match_protocol_number
# Bit 18 (00000000 00000100 00000000 00000000): match_protocol_number_sense
# Bit 17 (00000000 00000010 00000000 00000000): match_vlan_id
# Bit 16 (00000000 00000001 00000000 00000000): match_vlan_id_sense
# Bit 15 (00000000 00000000 10000000 00000000): match_dscp
# Bit 14 (00000000 00000000 01000000 00000000): match_dscp_sense
# Bit 13 - Bit 0 : Reserved
#
# Enter the rules from here:
bsp,FF:FF:FF:FF:FF:FF,0x00,0xFE,

View file

@ -1,62 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qca-vhyfid
PKG_RELEASE:=1
include $(INCLUDE_DIR)/local-development.mk
ifeq ($(DUMP)$(PKG_VERSION),)
PKG_REV:=9b756b9
PKG_VERSION:=g9b756b9
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
QCAVHYFID_MAKE_OPTS:= \
CROSS=$(TARGET_CROSS) \
GWLIB=$(STAGING_DIR)/usr/lib \
HYTOP=$(PKG_BUILD_DIR) \
GWINCLUDE=$(STAGING_DIR)/usr/include/hyficommon \
PLCSRV=$(STAGING_DIR)/usr/include/plcserv \
QCACFLAGS="$(TARGET_CFLAGS)" \
QCALDFLAGS="-Wl,--gc-sections $(TARGET_LDFLAGS)" \
INSTALL_ROOT=$(PKG_BUILD_DIR)/install \
STAGING_DIR=$(STAGING_DIR)
include $(INCLUDE_DIR)/package.mk
define Package/qca-vhyfid
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros, Inc.
DEPENDS:=+qca-ieee1905-init +libhyficommon +qca-hyd-plc +qca-plc-serv
TITLE:=Virtual Hy-Fi daemon (For non-embedded PLC platforms)
SUBMENU:=Hy-Fi features
endef
define Package/qca-vhyfid/description
This package installs the Virtual Hy-Fi daemon. It is designed for non-embedded PLC platforms, and detects plugged in PLC devices. It requires qca-plc-host package.
endef
define Build/Compile
mkdir -p $(PKG_BUILD_DIR)/install/lib
mkdir -p $(PKG_BUILD_DIR)/install/include
mkdir -p $(PKG_BUILD_DIR)/install/sbin
$(MAKE) -C $(PKG_BUILD_DIR) $(strip $(QCAVHYFID_MAKE_OPTS)) subdirs
endef
define Package/qca-vhyfid/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/usr/share/vhyfi
$(INSTALL_BIN) $(PKG_BUILD_DIR)/install/sbin/vhyfid $(1)/usr/sbin
$(INSTALL_CONF) ./files/vhyfid.config $(1)/etc/config/vhyfid
$(INSTALL_BIN) ./files/vhyfid.init $(1)/etc/init.d/vhyfid
$(INSTALL_BIN) ./files/start_hyfi $(1)/usr/share/vhyfi
$(INSTALL_BIN) ./files/stop_hyfi $(1)/usr/share/vhyfi
$(INSTALL_BIN) ./files/vhyfi.sh $(1)/usr/share/vhyfi
endef
$(eval $(call BuildPackage,qca-vhyfid))

View file

@ -1,192 +0,0 @@
#!/bin/sh
. /lib/functions.sh
. /lib/functions/network.sh
. /lib/functions/hyfi-network.sh
. /lib/functions/hyfi-debug.sh
. /lib/functions/hyfi-iface.sh
###############################################################################
#
# Script for starting HyFi features
# Usage: start_hyfi PORTID
#
###############################################################################
CPU_PORTID=0
CPU_PORT_FOUND=0
CPU_PORT_TAGGED=0
if [ -n "${1}" ]; then
PLC_PORTID=${1}
else
echo "No PLC PORTID"
exit 1
fi
#Delete PLC ports
vhyfid_del_plc_ports() {
config_get vlan "$1" "vlan"
if [ "${vlan}" = ${PLC_VLANID} ];then
uci delete network.$1
fi
}
# remove the PLC port from the lan vlan
vhyfid_update_lan_ports() {
config_get vlan "$1" "vlan"
if [ "${vlan}" = ${LAN_VLANID} ];then
config_get ports "$1" "ports"
for port in $ports; do
[ "${CPU_PORT_TAGGED}" -eq 0 ] && [ "${port}" = ${CPU_PORTID} ] && port="${port}t"
[ "${port}" != "${PLC_PORTID}" ] && new_ports=${new_ports}${new_ports:+" "}${port}
done;
uci set network.$1.ports="${new_ports}"
fi
}
# find out the cpu port id
vhyfid_get_cpu_portid() {
config_get vlan "$1" "vlan"
config_get ports "$1" "ports"
config_get device "$1" "device"
if [ "${vlan}" = ${LAN_VLANID} ];then
CPU_PORT_FOUND=1
SWITCH_NAME=${device}
CPU_PORTID=`echo ${ports} |sed 's/t//g' |cut -f 1 -d " "`
tagged=`echo ${ports} |grep t`
[ -n "${tagged}" ] && CPU_PORT_TAGGED=1
fi
}
__enable_vaps() {
local config="$1"
local mode network disabled
config_get mode "$config" mode
config_get network "$config" network
config_get disabled "$config" disabled
if [ "$2" = "$network" -a "sta" = "$mode" -a "1" = "$disabled" ]; then
uci_set wireless $config disabled 0
fi
}
__router_mode() {
local wan_iface
config_load network
config_get wan_iface wan ifname
[ -n "$wan_iface" ] && return 1
return 0
}
#Enable WLAN STAs which are disabled
vhyfid_enable_wlan_stas() {
config_load acd
config_get_bool enabled config 'AutoConfigEnable' '0'
# If auto-configuration is enabled, let it manage
[ "$enabled" -gt 0 ] && return
# No auto-config, check if this is a router.
# No need to enable STAs for router
__router_mode
[ "$?" -gt 0 ] && return
# No auto-config and not a router
# Assume that if there are STAs defined by
# the user, then they are needed to be on.
hyfi_get_ieee1905_managed_iface ieee1905managed
config_load wireless
config_foreach __enable_vaps wifi-iface $ieee1905managed
uci commit wireless
}
LANIF=`uci get vhyfid.config.LanInterfaceName`
LAN_VLANID=`uci get vhyfid.config.LanVlanID`
PLC_VLANID=`uci get vhyfid.config.PLCVlanID`
PLCIF=${LANIF}${LANIF:+"."}${PLC_VLANID}
SWITCH_NAME=${LANIF}
config_load network
config_foreach vhyfid_get_cpu_portid switch_vlan
[ "${CPU_PORT_FOUND}" -gt 0 ] || return 1
config_foreach vhyfid_del_plc_ports switch_vlan
config_foreach vhyfid_update_lan_ports switch_vlan
# Enable Wi-Fi STAs for Hy-Fi connectivity
vhyfid_enable_wlan_stas
#Add new vlan for PLC device port
uci add network switch_vlan
uci set network.@switch_vlan[-1].device="${SWITCH_NAME}"
uci set network.@switch_vlan[-1].vlan="${PLC_VLANID}"
uci set network.@switch_vlan[-1].ports="${CPU_PORTID}""t ""${PLC_PORTID}"
#Add PLC interface to lan interface
VIFS=`uci get network.lan.ifname`
if [ "${CPU_PORT_TAGGED}" -eq 0 ];then
for vif in ${VIFS}; do
[ "${vif}" != ${LANIF} ] && new_vifs=${new_vifs}${new_vifs:+" "}${vif}
done;
VIFS=${new_vifs}
fi
LAN_VLANIF=${LANIF}${LANIF:+"."}${LAN_VLANID}
FOUND=`echo ${VIFS} |grep ${LAN_VLANIF}`
[ -z "${FOUND}" ] && VIFS="${VIFS}"" ${LAN_VLANIF}"
FOUND=`echo ${VIFS} |grep ${PLCIF}`
[ -z "${FOUND}" ] && VIFS="${VIFS}"" ${PLCIF}"
uci set network.lan.ifname="${VIFS}"
#Read PLC IF speed
READ_SW_SCRIPT=`uci get vhyfid.config.ReadSwitchScriptPath`
PLC_IF_SPEED=`${READ_SW_SCRIPT} ${LANIF} 2 ${PLC_PORTID}`
#Enable HyFi features
local hyd_enabled
local hyd_control
hyd_enabled=`uci get hyd.config.Enable`
hyd_control=`uci get hyd.config.Control`
if [ "$hyd_enabled" = "0" -a "$hyd_control" = "manual" ]; then
# correct the configuration
uci set hyd.config.Control=auto
hyd_control=auto
fi
uci set hyd.config.Enable=1
uci set hyd.PathChPlc.HostPLCInterfaceSpeed=${PLC_IF_SPEED}
uci set plc.config.PlcIfname=${PLCIF}
uci commit
if [ "$hyd_control" = "auto" ]; then
hyfi_echo vhyfid "starting Hy-Fi"
else
hyfi_echo vhyfid "configuring PLC interface"
fi
/etc/init.d/hyd stop
/etc/init.d/wsplcd stop
hyfi_network_sync
/etc/init.d/acd stop
hyfi_network_restart
/etc/init.d/plc reload
/etc/init.d/acd restart
if [ "$hyd_enabled" -gt 0 ]; then
/etc/init.d/hyd restart
else
/etc/init.d/hyd start
fi
# exit successfully
exit 0

View file

@ -1,123 +0,0 @@
#!/bin/sh
. /lib/functions.sh
. /lib/functions/network.sh
. /lib/functions/hyfi-network.sh
. /lib/functions/hyfi-debug.sh
. /lib/functions/hyfi-iface.sh
###############################################################################
#
# Script for stoping HyFi features
#
###############################################################################
#Delete PLC ports and get PLC port ID
vhyfid_del_plc_ports() {
config_get vlan "$1" "vlan"
if [ "${vlan}" = ${PLC_VLANID} ];then
PORTID=`uci get network.$1.ports |cut -f 2 -d " "`
uci delete network.$1
fi
}
#Add the PLC port back to vlan1
vhyfid_update_lan_ports() {
config_get vlan "$1" "vlan"
if [ "${vlan}" = ${LAN_VLANID} ];then
config_get ports "$1" "ports"
new_ports=${ports}${ports:+" "}${PORTID}
[ "${VLAN_TAGGED}" -eq 0 ] && new_ports=`echo ${new_ports} |sed 's/t//g'`
uci set network.$1.ports="${new_ports}"
fi
}
__disable_vaps() {
local config="$1"
local mode network disabled
config_get mode "$config" mode
config_get network "$config" network
config_get disabled "$config" disabled
if [ "$2" = "$network" -a "sta" = "$mode" -a "0" = "$disabled" ]; then
uci_set wireless $config disabled 1
fi
}
#Disable WLAN STAs, avoid loops when Hy-Fi is disabled
vhyfid_disable_wlan_stas() {
hyfi_get_ieee1905_managed_iface ieee1905managed
config_load wireless
config_foreach __disable_vaps wifi-iface $ieee1905managed
uci commit wireless
}
LANIF=`uci get vhyfid.config.LanInterfaceName`
LAN_VLANID=`uci get vhyfid.config.LanVlanID`
PLC_VLANID=`uci get vhyfid.config.PLCVlanID`
VLAN_TAGGED=`uci get vhyfid.config.LanVlanTagged`
LAN_VLANIF=${LANIF}${LANIF:+"."}${LAN_VLANID}
PLCIF=${LANIF}${LANIF:+"."}${PLC_VLANID}
config_load network
config_foreach vhyfid_del_plc_ports switch_vlan
config_foreach vhyfid_update_lan_ports switch_vlan
#Remove PLC interface from lan interface
VIFS=`uci get network.lan.ifname`
for vif in $VIFS; do
if [ "${vif}" != ${PLCIF} ];then
[ "${VLAN_TAGGED}" -eq 0 ] && [ "${vif}" = ${LAN_VLANIF} -o "${vif}" = ${LANIF} ] && continue
new_vifs=${new_vifs}${new_vifs:+" "}${vif}
fi
done;
[ "${VLAN_TAGGED}" -eq 0 ] && new_vifs=${new_vifs}" ${LANIF}"
cur_vifs=`uci get network.lan.ifname`
# Check if there was any change
if [ "$cur_vifs" = "${new_vifs}" ]; then
uci set plc.config.PlcIfname=''
uci commit
return
fi
uci set network.lan.ifname="${new_vifs}"
#Restore plc interface name for plc
uci set plc.config.PlcIfname=''
#Disable HyFi features
local control=`uci get hyd.config.Control`
local hyd_enabled=`uci get hyd.config.Enable`
if [ "$control" = "auto" ]; then
uci set hyd.config.Enable=0
hyfi_echo vhyfid "stopping Hy-Fi"
else
hyfi_echo vhyfid "removing PLC interface"
fi
uci commit
if [ "$hyd_enabled" = "0" ]; then
# Shut down STAs to avoid loops
vhyfid_disable_wlan_stas
fi
# Stop/restart all Hy-Fi Daemons
/etc/init.d/hyd stop
/etc/init.d/wsplcd stop
hyfi_network_sync
/etc/init.d/acd stop
/etc/init.d/plc reload
# Restart the network
hyfi_network_restart
/etc/init.d/acd restart
# exit successfully
exit 0

View file

@ -1,84 +0,0 @@
#!/bin/sh
###############################################################################
#
# Script for reading switch ports' link status...
# Usage: vhyfi.sh dev mgmtdev command [MAC] [PORTID]
# command - 0: Read switch ports' link status, output format: port:x link:down[/up]
# 1: Read switch port id by sepcify MAC, output format: port:x
# 2: Read switch port link speed, output format: [0/100/1000]
#
# e.g. vhyfi.sh eth1 switch0 0
# port:0 link:up
# port:1 link:down
# port:2 link:down
# port:3 link:up
# port:4 link:down
# vhyfi.sh eth1 switch0 1 00:03:7f:00:12:34
# port:3
# vhyfi.sh eth1 switch0 2 1
# 100
###############################################################################
if [ -n "${1}" ]; then
IFNAME=${1}
else
exit 1
fi
if [ -n "${2}" ]; then
MGMTIFNAME=${2}
else
exit 1
fi
if [ -n "${3}" ]; then
COMMAND=${3}
else
exit 1
fi
print_port_id() {
case $1 in
0x01) echo "port:0";;
0x02) echo "port:1";;
0x04) echo "port:2";;
0x08) echo "port:3";;
0x10) echo "port:4";;
0x20) echo "port:5";;
0x40) echo "port:6";;
0x80) echo "port:7";;
*) echo "port:";;
esac
}
case $COMMAND in
0)
swconfig dev $MGMTIFNAME show |grep link |cut -f 2,3 -d " "
;;
1)
if [ -n "${4}" ]; then
MAC=${4}
else
exit 1
fi
swconfig dev $MGMTIFNAME set flush_arl
plchost -i $IFNAME -r > /dev/null
sleep 1
PORTMAP=`swconfig dev $MGMTIFNAME get dump_arl |grep $MAC |cut -f 4 -d " "`
print_port_id $PORTMAP
;;
2)
Speed=`swconfig dev $MGMTIFNAME show |grep "port:$3" |cut -f 5 -d ":" |sed s/[a-z,A-Z,-]//g`
[ -n "${Speed}" ] || Speed=0
echo "${Speed}"
;;
*)
echo "error: invalid command $COMMAND"
;;
esac
# exit successfully
exit 0

View file

@ -1,19 +0,0 @@
config config 'config'
option Enable '0'
option PLCHFIDList ''
option PLCOUIList ''
option PLCQueryExpireTime '5'
option PLCUPDTFWExpireTime '60'
option PLCUPDTPIBExpireTime '5'
option AllowPLCFwUpdate '0'
option DisableHyFiIfNoManufacturerMatch '1'
option LanVlanID '1'
option PLCVlanID '100'
option MaxConsecutiveLinkDownReads '8'
option LanInterfaceName 'eth1' #NOTE, specified by user
option SwitchManagementInterfaceName 'switch0' #NOTE, specified by user
option LanVlanTagged '' #Auto detect, don't change it
option StartHyFiScriptPath '/usr/share/vhyfi/start_hyfi'
option StopHyFiScriptPath '/usr/share/vhyfi/stop_hyfi'
option ReadSwitchScriptPath '/usr/share/vhyfi/vhyfi.sh'
option PLCFirmwarePath '/lib/firmware/plc/'

View file

@ -1,193 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (c) 2013 Qualcomm Atheros, Inc.
#
# All Rights Reserved.
# Qualcomm Atheros Confidential and Proprietary.
START=54
SERVICE_WRITE_PID=1
SERVICE_DAEMONIZE=1
SERVICE_DEBUG_OUTPUT=0
SERVICE_PATH="/usr/sbin/vhyfid"
VHYFID_CONFIG_FILE="/tmp/vhyfid.conf"
. /lib/functions/hyfi-iface.sh
. /lib/functions/hyfi-debug.sh
vhyfid_cfg_append() {
echo "$1" >> "$VHYFID_CONFIG_FILE"
}
# vhyfid_cfg_add_str <section> <option>
vhyfid_cfg_add_str() {
local key="$2"
local section="$1"
local option="$2"
config_get val "${section}" "${option}"
[ -n "${val}" ] && vhyfid_cfg_append "${key}=${val}"
}
vhyfid_cfg_add_plchip_info_one() {
local curpath="${3}${1}/"
local inipath="${curpath}${2}.ini"
local nvmpath="${curpath}${1}.nvm"
local pibpath="${curpath}${2}.pib"
sed "s/=/${chipindex}=/" $inipath >> "$VHYFID_CONFIG_FILE"
echo "NVMPath${chipindex}=${nvmpath}" >> "$VHYFID_CONFIG_FILE"
echo "PIBPath${chipindex}=${pibpath}" >> "$VHYFID_CONFIG_FILE"
chipindex=$(($chipindex + 1))
}
vhyfid_cfg_add_plchip_info() {
chipindex=0
config_get plcpath config 'PLCFirmwarePath' '/lib/firmware/plc/'
chip_families=`ls ${plcpath}`
for chip_family in $chip_families; do
ini_files=`ls ${plcpath}/${chip_family}/*.ini`
for ini in $ini_files; do
chip=`basename ${ini} .ini`
vhyfid_cfg_add_plchip_info_one $chip_family $chip ${plcpath}
done;
done;
}
vhyfid_cfg_add_head() {
echo ";" > "$VHYFID_CONFIG_FILE"
vhyfid_cfg_append '; Automatically generated vhyfid configure file,do not change it.'
vhyfid_cfg_append ';'
vhyfid_cfg_append '; PLC: plc manager'
vhyfid_cfg_append '; ETH: eth manager'
vhyfid_cfg_append '; CONFIG: config service'
vhyfid_cfg_append ';'
}
vhyfid_create_config() {
config_load 'vhyfid'
vhyfid_cfg_add_head
vhyfid_cfg_append '[CONFIG]'
vhyfid_cfg_add_str config StartHyFiScriptPath
vhyfid_cfg_add_str config StopHyFiScriptPath
vhyfid_cfg_append '[ETH]'
vhyfid_cfg_add_str config MaxConsecutiveLinkDownReads
vhyfid_cfg_add_str config LanInterfaceName
vhyfid_cfg_add_str config SwitchManagementInterfaceName
vhyfid_cfg_add_str config ReadSwitchScriptPath
vhyfid_cfg_append '[PLC]'
vhyfid_cfg_add_str config LanVlanID
vhyfid_cfg_add_str config PLCVlanID
vhyfid_cfg_add_str config LanVlanTagged
vhyfid_cfg_add_str config PLCHFIDList
vhyfid_cfg_add_str config DisableHyFiIfNoManufacturerMatch
vhyfid_cfg_add_str config PLCQueryExpireTime
vhyfid_cfg_add_str config PLCUPDTFWExpireTime
vhyfid_cfg_add_str config PLCUPDTPIBExpireTime
vhyfid_cfg_add_str config AllowPLCFwUpdate
vhyfid_cfg_add_str config PLCOUIList
vhyfid_cfg_add_str config PLCDongleInfoPath
vhyfid_cfg_add_plchip_info
}
vhyfid_find_lan_vlan() {
config_get ports "$1" "ports"
config_get vlan "$1" "vlan"
has_vlan=`echo ${ports} |grep t`
if [ "${vlan}" = ${LAN_VLANID} ] && [ -n "${has_vlan}" ];then
LanVlanTagged=1
fi
}
vhyfid_lan_vlan_detect() {
LanVlanTagged=0
LAN_VLANID=`uci get vhyfid.config.LanVlanID`
config_get val config 'LanVlanTagged'
[ -n "${val}" ] && return
config_load network
config_foreach vhyfid_find_lan_vlan switch_vlan
uci set vhyfid.config.LanVlanTagged=${LanVlanTagged}
uci commit
}
vhyfid_enable_plc()
{
uci set plc.config.Enabled='1'
uci commit plc
/etc/init.d/plc start
sleep 2
}
vhyfid_disable_plc()
{
uci set plc.config.Enabled='0'
uci commit plc
/etc/init.d/plc stop
}
#vhyfid_disable_hyfi
#Stop hyd and vlan setting
#It must be called with hyfi_lock unlocked
vhyfid_disable_hyfi()
{
local stop_hyfi
config_get stop_hyfi config 'StopHyFiScriptPath'
if [ -n "$stop_hyfi" ]; then
eval $stop_hyfi
fi
}
__stop() {
#disable plchost
#vhyfid_disable_plc
${SVCDBG}service_stop ${SERVICE_PATH}
}
start() {
hyfi_lock
__stop
config_load 'vhyfid'
config_get_bool enabled config 'Enable' '0'
local vhyfid_rcd_enabled=`ls /etc/rc.d/S${START}vhyfid 2> /dev/null`
[ "$enabled" -gt 0 -a -n "$vhyfid_rcd_enabled" ] || {
hyfi_unlock
return 1
}
vhyfid_create_config
#enable plchost
#vhyfid_enable_plc
vhyfid_lan_vlan_detect
hyfi_echo vhyfid "starting daemon"
${SVCDBG}service_start ${SERVICE_PATH} -d -C "$VHYFID_CONFIG_FILE"
hyfi_unlock
}
stop() {
config_load 'vhyfid'
__stop
vhyfid_disable_hyfi
}
restart() {
start
}

View file

@ -1,8 +0,0 @@
config ENABLE_SON_CLI
bool "Enable SON_CLI support"
depends on PACKAGE_kmod-qca-wifi-akronite-perf||PACKAGE_kmod-qca-wifi-dakota-perf||PACKAGE_kmod-qca-wifi-perf||PACKAGE_kmod-qca-wifi-unified-perf||PACKAGE_kmod-qca-wifi-unified-profile||PACKAGE_kmod-qca-wifi-custc-profile||PACKAGE_kmod-qca-wifi-lowmem-profile||PACKAGE_kmod-qca-wifi-flash_16mb-profile
select PACKAGE_qca-son-cli
default y
help
This enables SON_CLI support

View file

@ -1,79 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/local-development.mk
PKG_NAME:=qca-son-cli
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
TARGET_CFLAGS += -fpie
TARGET_LDFLAGS += -pie
WIFI_U:=PACKAGE_kmod-qca-wifi-unified-profile
WIFI_C:=PACKAGE_kmod-qca-wifi-custc-profile
WIFI_A:=PACKAGE_kmod-qca-wifi-akronite-perf
WIFI_D:=PACKAGE_kmod-qca-wifi-dakota-perf
WIFI_MIPS:=PACKAGE_kmod-qca-wifi-perf
WIFI_MIPS_UNIFIED:=PACKAGE_kmod-qca-wifi-unified-perf
WIFI_10_2_MIPS:=PACKAGE_kmod-qca-wifi-perf
WIFI_10_2_ARM:=PACKAGE_kmod-qca-wifi-akronite-perf
WIFI_L:=PACKAGE_kmod-qca-wifi-lowmem-profile
WIFI_16M:=PACKAGE_kmod-qca-wifi-flash_16mb-profile
WIFI_PKGS:=$(WIFI_U)||$(WIFI_C)||$(WIFI_A)||$(WIFI_D)||$(WIFI_MIPS)||$(WIFI_MIPS_UNIFIED)||$(WIFI_10_2_MIPS)||$(WIFI_10_2_ARM)||$(WIFI_L)||$(WIFI_16M)
PKG_BUILD_DEPENDS:=$(WIFI_U):qca-wifi $(WIFI_C):qca-wifi $(WIFI_A):qca-wifi $(WIFI_D):qca-wifi $(WIFI_MIPS):qca-wifi \
$(WIFI_MIPS_UNIFIED):qca-wifi $(WIFI_10_2_MIPS):qca-wifi $(WIFI_10_2_ARM):qca-wifi $(WIFI_L):qca-wifi $(WIFI_16M):qca-wifi
QCASONCLI_MAKE_OPTS:= \
CROSS=$(TARGET_CROSS) \
INSTALL_ROOT=$(PKG_BUILD_DIR)/install \
EXTRA_CFLAGS="$(TARGET_CFLAGS)"\
EXTRA_LDFLAGS="-Wl,--gc-sections $(TARGET_LDFLAGS)"\
STAGING_DIR=$(STAGING_DIR)
define Package/qca-son-cli/config
source "$(SOURCE)/Config.in"
endef
SONCLI_DEPENDS:=@$(WIFI_PKGS) +libpthread +libnl +libnl-genl +libhyficommon +qca-cfg80211
ifeq ($(CONFIG_ENABLE_SON_MEMORY_DEBUG),y)
QCASONCLI_MAKE_OPTS+=ENABLE_SON_MEMORY_DEBUG=y
endif
define Package/qca-son-cli
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros
DEPENDS:=$(SONCLI_DEPENDS)
TITLE:=SON stats daemon
SUBMENU:=SON Statistics and Memory Utilization command line interface
endef
define Package/qca-son-cli/description
This package installs the SON_CLI Tool
endef
define Package/qca-son-cli/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/lib/functions
$(INSTALL_BIN) $(PKG_BUILD_DIR)/install/sbin/son_cli $(1)/usr/sbin/
@cp ./files/commands.sh $(1)/lib/functions/
endef
define Build/Compile
$(INSTALL_DIR) -p $(PKG_BUILD_DIR)/install/sbin
mkdir -p $(PKG_BUILD_DIR)/install/include/
$(MAKE) -C $(PKG_BUILD_DIR) $(strip $(QCASONCLI_MAKE_OPTS)) all
endef
INSTALL_HEADERS=meminfo.h
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/son-cli
$(if $(INSTALL_HEADERS),$(CP) $(foreach header,$(INSTALL_HEADERS),$(PKG_BUILD_DIR)/install/include/$(header)) $(1)/usr/include/son-cli)
endef
$(eval $(call BuildPackage,qca-son-cli))

View file

@ -1,175 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (c) 2020 Qualcomm Technologies, Inc.
#
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
START=55
USE_PROCD=1
RESPAWN_THRESHOLD=120
RESPAWN_TIMEOUT=5
RESPAWN_RETRIES=1
. /lib/functions/procd.sh
init()
{
/sbin/wifi detect > /etc/config/wireless
return 0
}
config()
{
/sbin/uci set wireless.wifi0=wifi-device
/sbin/uci set wireless.wifi0.type='qcawificfg80211'
/sbin/uci set wireless.wifi0.channel='auto'
/sbin/uci set wireless.wifi0.macaddr='00:03:7f:75:53:17'
/sbin uci set wireless.wifi0.hwmode='11axa'
/sbin/uci set wireless.wifi0.htmode='HT80'
/sbin/uci set wireless.wifi0.disabled='0'
/sbin/uci set network.lan.ipaddr='192.168.1.1'
/sbin/uci set wireless.@wifi-iface[0]=wifi-iface
/sbin/uci set wireless.@wifi-iface[0].device='wifi0'
/sbin/uci set wireless.@wifi-iface[0].network='lan'
/sbin/uci set wireless.@wifi-iface[0].mode='ap'
/sbin/uci set wireless.@wifi-iface[0].ssid='son_cli_5g'
/sbin/uci set wireless.@wifi-iface[0].encryption='none'
/sbin/uci set wireless.@wifi-iface[0].wds='1'
/sbin/uci set wireless.wifi1=wifi-device
/sbin/uci set wireless.wifi1.type='qcawificfg80211'
/sbin/uci set wireless.wifi1.channel='auto'
/sbin/uci set wireless.wifi1.macaddr='00:03:7f:75:63:17'
/sbin/uci set wireless.wifi1.hwmode='11axg'
/sbin/uci set wireless.wifi1.htmode='HT20'
/sbin/uci set wireless.wifi1.disabled='0'
/sbin/uci set network.lan.ipaddr='192.168.1.1'
/sbin/uci set wireless.@wifi-iface[1]=wifi-iface
/sbin/uci set wireless.@wifi-iface[1].device='wifi1'
/sbin/uci set wireless.@wifi-iface[1].network='lan'
/sbin/uci set wireless.@wifi-iface[1].mode='ap'
/sbin/uci set wireless.@wifi-iface[1].ssid='son_cli_2g'
/sbin/uci set wireless.@wifi-iface[1].encryption='none'
/sbin/uci set wireless.@wifi-iface[1].wds='1'
/sbin/uci commit wireless
/sbin/uci commit network
return 0
}
config3r()
{
/sbin/uci set wireless.wifi0=wifi-device
/sbin/uci set wireless.wifi0.type='qcawificfg80211'
/sbin/uci set wireless.wifi0.channel='auto'
/sbin/uci set wireless.wifi0.macaddr='00:03:7f:12:21:f3'
/sbin uci set wireless.wifi0.hwmode='11axa'
/sbin/uci set wireless.wifi0.htmode='HT80'
/sbin/uci set wireless.wifi0.band='3'
/sbin/uci set wireless.wifi0.country='US4'
/sbin/uci set wireless.wifi0.disabled='0'
/sbin/uci set wireless.@wifi-iface[0]=wifi-iface
/sbin/uci set wireless.@wifi-iface[0].device='wifi0'
/sbin/uci set wireless.@wifi-iface[0].network='lan'
/sbin/uci set wireless.@wifi-iface[0].mode='ap'
/sbin/uci set wireless.@wifi-iface[0].ssid='son_cli_6g'
/sbin/uci set wireless.@wifi-iface[0].encryption='none'
/sbin/uci set wireless.@wifi-iface[0].wds='1'
/sbin/uci set wireless.wifi1=wifi-device
/sbin/uci set wireless.wifi1.type='qcawificfg80211'
/sbin/uci set wireless.wifi1.channel='auto'
/sbin/uci set wireless.wifi1.macaddr='00:03:7f:12:55:c7'
/sbin/uci set wireless.wifi1.hwmode='11axg'
/sbin/uci set wireless.wifi1.htmode='HT20'
/sbin/uci set wireless.wifi1.disabled='0'
/sbin/uci set wireless.@wifi-iface[1]=wifi-iface
/sbin/uci set wireless.@wifi-iface[1].device='wifi1'
/sbin/uci set wireless.@wifi-iface[1].network='lan'
/sbin/uci set wireless.@wifi-iface[1].mode='ap'
/sbin/uci set wireless.@wifi-iface[1].ssid='son_cli_2g'
/sbin/uci set wireless.@wifi-iface[1].encryption='none'
/sbin/uci set wireless.@wifi-iface[1].wds='1'
/sbin/uci set wireless.wifi2=wifi-device
/sbin/uci set wireless.wifi2.type='qcawificfg80211'
/sbin/uci set wireless.wifi2.channel='auto'
/sbin/uci set wireless.wifi2.macaddr='00:03:7f:12:e9:fb'
/sbin/uci set wireless.wifi2.hwmode='11axa'
/sbin/uci set wireless.wifi2.htmode='HT80'
/sbin/uci set wireless.wifi2.disabled='0'
/sbin/uci set wireless.@wifi-iface[2]=wifi-iface
/sbin/uci set wireless.@wifi-iface[2].device='wifi2'
/sbin/uci set wireless.@wifi-iface[2].network='lan'
/sbin/uci set wireless.@wifi-iface[2].mode='ap'
/sbin/uci set wireless.@wifi-iface[2].ssid='son_cli_5g'
/sbin/uci set wireless.@wifi-iface[2].encryption='none'
/sbin/uci set wireless.@wifi-iface[2].wds='1'
/sbin/uci commit wireless
return 0
}
wifi()
{
/sbin/wifi
return 0
}
ping_test()
{
ping -w 1 192.168.1.2 -c1 > /dev/null
eval "$1='$?'"
}
iperf_test()
{
procd_open_instance
procd_set_param command /usr/bin/iperf -u -c 192.168.1.2 -i 1 -t $1 -P 5 -b 400M
procd_close_instance
return 0
}
txpow_test()
{
# echo "1 = $1 2 = $2"
iwconfig $1 txpow $2
}
start_service()
{
local ping_ret=0
if [ "$1" == "init" ]
then
init
return 0
fi
if [ "$1" == "config" ]
then
config
return 0
fi
if [ "$1" == "wifi" ]
then
wifi
return 0
fi
if [ "$1" == "ping_test" ]
then
ping_test ping_ret
if [ "$ping_ret" == "0" ]; then
return 0
fi
fi
if [ "$1" == "txpow_test" ]
then
txpow_test $2 $3
return 0
fi
if [ "$1" == "iperf_test" ]
then
iperf_test $2
return 0
fi
exit 1
}

View file

@ -1,71 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libieee1905
PKG_RELEASE:=1
include $(INCLUDE_DIR)/local-development.mk
ifeq ($(DUMP)$(PKG_VERSION),)
PKG_REV:=$(shell git ls-remote $(PKG_SOURCE_URL) $(PKG_BRANCH) | cut -b -7)
PKG_VERSION:=g$(PKG_REV)
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
QCAIEEE1905_DEPENDS:=+libhyficommon
QCAIEEE1905_MAKEOPTS:= \
TOOLPREFIX=$(TARGET_CROSS) \
GWINCLUDE=$(STAGING_DIR)/usr/include/hyficommon/ \
EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
INSTALL_ROOT=$(PKG_BUILD_DIR)/install
QCAIEEE1905_DEPENDS+=+ENABLE_SON_MEMORY_DEBUG:qca-son-mem-debug
ifeq ($(CONFIG_ENABLE_SON_MEMORY_DEBUG),y)
QCAIEEE1905_MAKEOPTS+=ENABLE_SON_MEMORY_DEBUG=y
QCAIEEE1905_MAKEOPTS+=SONMEMDEBUGINCLUDE=$(STAGING_DIR)/usr/include/son-mem-dbg
endif
define Package/libieee1905
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros, Inc.
TITLE:=IEEE1905.1 Library
DEPENDS:=$(QCAIEEE1905_DEPENDS)
SUBMENU:=IEEE1905.1 features
endef
define Package/libieee1905/description
This Package contains the IEEE1905.1 library
endef
define Package/libieee1905/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/install/lib/libieee1905.so $(1)/usr/lib/
endef
define Build/Compile
mkdir -p $(PKG_BUILD_DIR)/install
mkdir -p $(PKG_BUILD_DIR)/install/lib/
mkdir -p $(PKG_BUILD_DIR)/install/include/
$(MAKE) -C $(PKG_BUILD_DIR)/ $(strip $(QCAIEEE1905_MAKEOPTS))
endef
INSTALL_LIBS:= libieee1905
INSTALL_HEADERS=ieee1905_defs.h \
ieee1905.h \
ieee1905_vendor.h \
ieee1905_vendor_consts.h \
mid.h
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include/ieee1905
$(if $(INSTALL_LIBS),$(CP) $(foreach lib,$(INSTALL_LIBS),$(PKG_BUILD_DIR)/install/lib/$(lib).so) $(1)/usr/lib)
$(if $(INSTALL_HEADERS),$(CP) $(foreach header,$(INSTALL_HEADERS),$(PKG_BUILD_DIR)/install/include/$(header)) $(1)/usr/include/ieee1905)
endef
$(eval $(call BuildPackage,libieee1905))

View file

@ -1,85 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libstorage
PKG_RELEASE:=1
include $(INCLUDE_DIR)/local-development.mk
ifeq ($(DUMP)$(PKG_VERSION),)
PKG_REV:=$(shell git ls-remote $(PKG_SOURCE_URL) $(PKG_BRANCH) | cut -b -7)
PKG_VERSION:=g$(PKG_REV)
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
WIFI_U:=PACKAGE_kmod-qca-wifi-unified-profile
WIFI_C:=PACKAGE_kmod-qca-wifi-custc-profile
WIFI_A:=PACKAGE_kmod-qca-wifi-akronite-perf
WIFI_D:=PACKAGE_kmod-qca-wifi-dakota-perf
WIFI_MIPS:=PACKAGE_kmod-qca-wifi-perf
WIFI_MIPS_UNIFIED:=PACKAGE_kmod-qca-wifi-unified-perf
WIFI_10_2_MIPS:=PACKAGE_kmod-qca-wifi-perf
WIFI_10_2_ARM:=PACKAGE_kmod-qca-wifi-akronite-perf
WIFI_L:=PACKAGE_kmod-qca-wifi-lowmem-profile
WIFI_16M:=PACKAGE_kmod-qca-wifi-flash_16mb-profile
WIFI_PKGS:=$(WIFI_U)||$(WIFI_C)||$(WIFI_A)||$(WIFI_D)||$(WIFI_MIPS)||$(WIFI_MIPS_UNIFIED)||$(WIFI_10_2_MIPS)||$(WIFI_10_2_ARM)||$(WIFI_L)||$(WIFI_16M)
PKG_BUILD_DEPENDS:=$(WIFI_U):qca-wifi $(WIFI_C):qca-wifi $(WIFI_A):qca-wifi $(WIFI_D):qca-wifi $(WIFI_MIPS):qca-wifi $(WIFI_16M):qca-wifi \
$(WIFI_MIPS_UNIFIED):qca-wifi $(WIFI_10_2_MIPS):qca-wifi $(WIFI_10_2_ARM):qca-wifi $(WIFI_L):qca-wifi
include $(INCLUDE_DIR)/package.mk
QCASTORAGE_MAKEOPTS:= \
TOOLPREFIX=$(TARGET_CROSS) \
GWINCLUDE=$(STAGING_DIR)/usr/include/hyficommon \
INSTALL_ROOT=$(PKG_BUILD_DIR)/install \
ATHDIR=$(STAGING_DIR)/usr/include \
EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
LIB_STORAGE_USE_UCI_FORMAT=y
QCASTORAGE_DEPENDS:=@$(WIFI_PKGS) +libhyficommon +libuci +libwifisoncfg
QCASTORAGE_DEPENDS+=+ENABLE_SON_MEMORY_DEBUG:qca-son-mem-debug
ifeq ($(CONFIG_ENABLE_SON_MEMORY_DEBUG),y)
QCASTORAGE_MAKEOPTS+=ENABLE_SON_MEMORY_DEBUG=y
QCASTORAGE_MAKEOPTS+=SONMEMDEBUGINCLUDE=$(STAGING_DIR)/usr/include/son-mem-dbg
endif
define Package/libstorage
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros, Inc.
TITLE:=Storage Abstration Library
DEPENDS:=$(QCASTORAGE_DEPENDS)
SUBMENU:=IEEE1905.1 features
endef
define Package/libstorage/description
This Package installs the Storage Abstration Library
endef
define Package/libstorage/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/install/lib/libstorage.so $(1)/usr/lib/
endef
define Build/Compile
mkdir -p $(PKG_BUILD_DIR)/install
mkdir -p $(PKG_BUILD_DIR)/install/lib/
mkdir -p $(PKG_BUILD_DIR)/install/include/
$(MAKE) -C $(PKG_BUILD_DIR)/ $(strip $(QCASTORAGE_MAKEOPTS))
endef
INSTALL_LIBS:= libstorage
INSTALL_HEADERS=storage.h
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include/storage
$(if $(INSTALL_LIBS),$(CP) $(foreach lib,$(INSTALL_LIBS),$(PKG_BUILD_DIR)/install/lib/$(lib).so) $(1)/usr/lib)
$(if $(INSTALL_HEADERS),$(CP) $(foreach header,$(INSTALL_HEADERS),$(PKG_BUILD_DIR)/install/include/$(header)) $(1)/usr/include/storage)
endef
$(eval $(call BuildPackage,libstorage))

View file

@ -1,88 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libwpa2
PKG_RELEASE:=1
include $(INCLUDE_DIR)/local-development.mk
ifeq ($(DUMP)$(PKG_VERSION),)
PKG_REV:=$(shell git ls-remote $(PKG_SOURCE_URL) $(PKG_BRANCH) | cut -b -7)
PKG_VERSION:=g$(PKG_REV)
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
LIBWPA2_MAKEOPTS:= \
TOOLPREFIX=$(TARGET_CROSS) \
EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
INSTALL_ROOT=$(PKG_BUILD_DIR)/install
LIBWPA2_DEPENDS+=+ENABLE_SON_MEMORY_DEBUG:qca-son-mem-debug
ifeq ($(CONFIG_ENABLE_SON_MEMORY_DEBUG),y)
LIBWPA2_MAKEOPTS+=ENABLE_SON_MEMORY_DEBUG=y
LIBWPA2_MAKEOPTS+=SONMEMDEBUGINCLUDE=$(STAGING_DIR)/usr/include/son-mem-dbg
endif
define Package/libwpa2
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros, Inc.
TITLE:=WPA2 Library
DEPENDS:=$(LIBWPA2_DEPENDS)
SUBMENU:=IEEE1905.1 features
endef
define Package/libwpa2/description
This Package contains the wpa2 library
endef
define Package/libwpa2/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/install/lib/libwpa2.so $(1)/usr/lib/
endef
define Build/Compile
mkdir -p $(PKG_BUILD_DIR)/install
mkdir -p $(PKG_BUILD_DIR)/install/lib/
mkdir -p $(PKG_BUILD_DIR)/install/include/
$(MAKE) -C $(PKG_BUILD_DIR)/ $(strip $(LIBWPA2_MAKEOPTS))
endef
INSTALL_LIBS:= libwpa2
INSTALL_HEADERS=\
aes.h \
aes_wrap.h \
asn1.h \
bignum.h \
build_config.h \
common.h \
crypto.h \
defs.h \
eap_defs.h \
eloop.h \
includes.h \
l2_packet.h \
md5.h \
os.h \
rc4.h \
rsa.h \
sha1.h \
sha256.h \
wpa_common.h \
wps_config.h \
wps_parser.h \
base64.h \
aes_siv.h
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include/wpa2
$(if $(INSTALL_LIBS),$(CP) $(foreach lib,$(INSTALL_LIBS),$(PKG_BUILD_DIR)/install/lib/$(lib).so) $(1)/usr/lib)
$(if $(INSTALL_HEADERS),$(CP) $(foreach header,$(INSTALL_HEADERS),$(PKG_BUILD_DIR)/install/include/$(header)) $(1)/usr/include/wpa2)
endef
$(eval $(call BuildPackage,libwpa2))

View file

@ -1,33 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=qca-ieee1905-init
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
define Package/qca-ieee1905-init
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros
TITLE:=IEEE1905.1 Init Script Helpers
DEPENDS:=
SUBMENU:=IEEE1905.1 features
endef
define Package/qca-ieee1905-init/description
This Package contains the script helper files for the IEEE1905.1 init scripts
endef
define Package/qca-ieee1905-init/install
$(INSTALL_DIR) $(1)/lib/functions/
$(CP) ./files/hyfi-debug.sh $(1)/lib/functions/
$(CP) ./files/hyfi-iface.sh $(1)/lib/functions/
$(CP) ./files/hyfi-network.sh $(1)/lib/functions/
endef
define Build/Compile
true
endef
$(eval $(call BuildPackage,qca-ieee1905-init))

View file

@ -1,57 +0,0 @@
if [ -n "${SERVICE_DEBUG_OUTPUT}" ]; then
[ "${SERVICE_DEBUG_OUTPUT}" -eq 1 ] && export SVCDBG="debug_"
fi
debug_service_start() {
local serv="`echo $1 | awk -F'/' '{print $NF}'`"
"$@" >/dev/console 2>/dev/console &
echo `ps | grep $1 | grep -v grep | awk '{print \$1}'`> /var/run/${serv}.pid
}
debug_service_stop() {
local serv="`echo $1 | awk -F'/' '{print $NF}'`"
local serv_pid="`ps | grep $1 | grep -v grep | awk '{print \$1}'`"
[ -z "$serv_pid" ] || kill $serv_pid
rm -f /var/run/${serv}.pid
}
hyfi_debug() {
if [ -n "$HYFI_DEBUG_OUTPUT" ]; then
if [ "$HYFI_DEBUG_OUTPUT" -gt 0 ]; then
echo "${1}: ""$2"> /dev/console
fi
fi
}
hyfi_echo() {
echo "${1}: ""$2"> /dev/console
}
hyfi_error() {
echo "${1}: ERROR: ""$2"> /dev/console
}
__LOCK=/var/run/`echo $0 | awk -F/ '{print $NF}'`${1}.lock
__hyfi_trap_cb() {
hyfi_error $0 "unexpected termination"
}
# hyfi_lock
# input: $1: (optional) lock suffix, $2: (optional) trap callback
hyfi_lock() {
local trap_cb="$2"
__LOCK=/var/run/`echo $0 | awk -F/ '{print $NF}'`${1}.lock
lock $__LOCK
[ -z "$trap_cb" ] && trap_cb=__hyfi_trap_cb
trap $trap_cb INT TERM ABRT QUIT ALRM
}
# hyfi_unlock
hyfi_unlock() {
trap - INT TERM ABRT QUIT ALRM
lock -u $__LOCK
}

View file

@ -1,744 +0,0 @@
WLAN_DEVICES=
WLAN_INCLUDED_DEVICES=
WLAN_VLAN_DEVICES=
WLAN_VLAN_STA_DEVICES=
WLAN_DEVICE_NUM=
ETHER_DEVICES=
PLC_DEVICE=
ALL_DEVICES=
IFACE_VLANIDS=
. /lib/functions/hyfi-debug.sh
ieee1905managed_found=0
ieee1905managed_bridge=""
ieee1905managed_bridge2=""
bound_bridge=""
device_wlan=1
backhaul_network="backhaul"
traffic_separation_enabled=0
traffic_separation_active=0
map_traffic_separation_active=0
map_bh_nw="backhaul"
# Network names parsed in hyfi_get_ieee1905_brguest_map()
map_nw_One=""
map_nw_Two=""
map_nw_Three=""
iface_config=
config_load 'repacd'
config_get_bool ezmesh repacd 'Ezmesh' '0'
if [ "$ezmesh" -eq 1 ]; then
MAP='ezmesh'
else
MAP='hyd'
fi
__hyfi_get_wlan_vifnum() {
local config="$1"
local iface network disabled
local phydev phydisabled
config_get network "$config" network
config_get disabled "$config" disabled '0'
config_get phydev "$config" device ""
if [ -z "$phydev" ]; then
return
fi
config_get phydisabled ${phydev} disabled 0
if [ $phydisabled -eq 0 -a "$2" = "$network" -a "$disabled" -eq 0 ]; then
WLAN_DEVICE_NUM=$((WLAN_DEVICE_NUM + 1))
fi
}
# hyfi_get_wlan_vifnum()
# input: $1 IEEE1905.1 managed bridge interface
# output: $2 number of WLAN interfaces bound to the bridge
hyfi_get_wlan_vifnum() {
local ieee1905managed="$1"
WLAN_DEVICE_NUM=0
config_load wireless
config_foreach __hyfi_get_wlan_vifnum wifi-iface $ieee1905managed
eval "$2='${WLAN_DEVICE_NUM}'"
}
__hyfi_get_iface_vlanids() {
local config="$1"
local loc_iface loc_vid
config_get loc_iface "$config" ifname
config_get loc_vid "$config" vid
if [ "$loc_iface" -a "$loc_vid" ]; then
IFACE_VLANIDS="${IFACE_VLANIDS}${IFACE_VLANIDS:+","}${loc_iface}.${loc_vid}"
fi
}
hyfi_get_iface_vlanids() {
IFACE_VLANIDS=""
config_load $MAP
config_foreach __hyfi_get_iface_vlanids Vlanid
eval "$1='${IFACE_VLANIDS}'"
}
__hyfi_is_iface_up() {
local iface="$1"
bitRate=$(iwconfig $iface | grep Rate | awk '{print$2}' | cut -d ":" -f2 | cut -d "." -f1)
accessPoint=$(iwconfig $iface | grep Access | awk '{print$6}')
if [ "$bitRate" -eq 0 ] || [ "$accessPoint" = "Not-Associated" ]; then
return 0
fi
return 1
}
__hyfi_get_wlan_ifaces() {
local config="$1"
local iface network disabled device
config_get iface "$config" ifname
config_get network "$config" network
config_get disabled "$config" disabled '0'
config_get device "$config" device
config_get mapEnable "$config" map
config_get mode "$config" mode
if [ -n "$mapEnable" ]; then
config_load $MAP
config_get sigmaEnabled MultiAP 'EnableSigmaDUT' '0'
# Ignore if sigma flag is enabled
if [ -n "$iface" -a "$mapEnable" -gt 0 -a "$disabled" -eq 0 \
-a "$mode" = "sta" -a "$sigmaEnabled" -eq 0 ]; then
__hyfi_is_iface_up $iface
is_iface_up=$?
if [ "$is_iface_up" -eq 0 ]; then
return
fi
fi
fi
if [ -n "$iface" -a "$disabled" -eq 0 ]; then
if [ "$network" = "$2" ]; then
WLAN_DEVICES="${WLAN_DEVICES}${WLAN_DEVICES:+","}${iface}@${device}&${network}:WLAN"
fi
# include network=backhaul for guest network support
if [ "$network" = "$2" -o "$network" = "backhaul" ]; then
WLAN_INCLUDED_DEVICES="${WLAN_INCLUDED_DEVICES}${WLAN_INCLUDED_DEVICES:+","}${device}:${iface}"
fi
fi
}
# hyfi_get_wlan_ifaces()
# input: $1 IEEE1905.1 managed bridge interface
# output: $2 List of all WLAN interfaces bound to the bridge
# output: $3 List of all WLAN devices/radios bound to the bridge
hyfi_get_wlan_ifaces() {
local ieee1905managed="$1"
WLAN_DEVICES=""
WLAN_INCLUDED_DEVICES=""
hyfi_network_sync
config_load wireless
config_foreach __hyfi_get_wlan_ifaces wifi-iface $ieee1905managed
eval "$2='${WLAN_DEVICES}'"
eval "$3='${WLAN_INCLUDED_DEVICES}'"
}
__hyfi_get_switch_iface() {
local loc_switch_iface loc_eswitch_support="0"
local ref_design
local loc_switch_num="0"
local loc_switch_present="1"
config_load hyd
config_get loc_switch_iface config SwitchInterface ""
if [ "$loc_switch_iface" = "auto" ]; then
ref_design=`cat /tmp/sysinfo/board_name`
# List of supported reference designs. For other designs
# either add to cases, or setup SwitchInterface.
case "$ref_design" in
ap145|ap147|ap148*|db149|ap151)
# S17c switch
# ap148_1xx is also a supported board type
loc_switch_iface="eth1"
loc_eswitch_support="1"
;;
ap160|ap161)
# S17c switch support is disabled even though interface is identified
loc_switch_iface="eth1"
loc_eswitch_support="0"
;;
ap152|apjet01)
loc_switch_iface="eth0"
loc_eswitch_support="0"
;;
ap-dk*)
# Malibu switch with a single host port connected in a VLAN
# tagged manner. Since the switch config indicates the host
# port is tagged (as it is from the switch's perspective) but
# the host interfaces are not VLAN tagged, a special option
# is needed to force the interface names to be untagged.
loc_switch_iface="eth1"
force_untagged_iface=1
loc_eswitch_support="0"
;;
ap-mp03.1*|db-mp03.1*)
loc_switch_iface="eth1"
force_untagged_iface=1
loc_eswitch_support="0"
loc_switch_num="1"
echo 1 > /sys/ssdk/dev_id
;;
ap-mp02.1*|db-mp02.1*|ap-mp03.3*|dp-mp03.3*|ap-mp03.4*|db-mp03.4*|ap-mp03.5*|db-mp03.5*|ap-mp03.6*|db-mp03.6*)
loc_switch_iface=""
loc_switch_present="0"
;;
ap135)
loc_switch_iface="eth1"
loc_eswitch_support="0"
;;
*)
loc_switch_iface=""
;;
esac
fi
if [ -z "$loc_switch_iface" ]; then
eval "$1=''"
eval "$2='$loc_eswitch_support'"
eval "$3='$loc_switch_num'"
eval "$4='$loc_switch_present'"
return
fi
local loc_switch_cpu_port
__hyfi_get_switch_cpu_port loc_switch_cpu_port
local lan_vid
__hyfi_get_switch_lan_vid lan_vid
if [ -z "$switch_cpu_port_tagged" -o -n "$force_untagged_iface" ]; then
eval "$1='$loc_switch_iface'"
else
eval "$1='${loc_switch_iface}.${lan_vid}'"
fi
eval "$2='$loc_eswitch_support'"
eval "$3='$loc_switch_num'"
eval "$4='$loc_switch_present'"
}
__hyfi_get_switch_lan_vid() {
local loc_lan_vid
config_load hyd
config_get loc_lan_vid config SwitchLanVid ""
eval "$1='$loc_lan_vid'"
}
__hyfi_get_switch_cpu_port_iterate() {
config_get vlan "$1" "vlan"
config_get ports "$1" "ports"
if [ "${vlan}" = "$2" ]; then
switch_cpu_port=`echo ${ports} |sed 's/t//g' |cut -f 1 -d " "`
switch_cpu_port_tagged=`echo ${ports} |grep t`
fi
}
__hyfi_get_switch_cpu_port() {
local lan_vid
__hyfi_get_switch_lan_vid lan_vid
config_load network
config_foreach __hyfi_get_switch_cpu_port_iterate switch_vlan $lan_vid
eval "$1='$switch_cpu_port'"
}
__hyfi_get_ether_ifaces() {
local config="$1"
local ifnames network plciface bridge_name dev
#config_get ifnames "$config" device
ifnames=`uci get network.$1.ifname`
config_get bridge_name "$config" ifname
config_load plc
config_get plciface config PlcIfname
local switch_iface eswitch_support switch_num switch_present
__hyfi_get_switch_iface switch_iface eswitch_support switch_num switch_present
if [ "$2" = "$config" ]; then
# Check the ifnames parameter is populated correctly
if [ -z "$ifnames" ]; then
# If the ifnames parameter doesn't contain the device list, it should
# be present in the bridge_name. However, it's possible a race
# condition occured, and neither parameter contains the device list.
# Check the device list again if the bridge_name actually contains the
# name of the bridge.
if echo $bridge_name | grep -q br-; then
hyfi_debug hyiface "Missing device names, and ifname matches bridge, fetching device names again"
config_get ifnames "$config" device
if [ -z "$ifnames" ]; then
ifnames=`uci get "network.$1.ifname"`
hyfi_error hyiface "Device names missing, defaulting to $ifnames"
else
hyfi_debug hyiface "Device names now populated correctly"
fi
else
ifnames=$bridge_name
hyfi_debug hyiface "Missing device names, so using ifname parameter instead"
fi
fi
for iface in $ifnames; do
[ "$iface" = "$plciface" ] && continue
if [ "$traffic_separation_enabled" -gt 0 ] && \
[ "$traffic_separation_active" -gt 0 ]; then
if __hyfi_is_vlan_iface $iface; then
if __hyfi_is_device_wlan $iface dev; then
continue
fi
fi
fi
if [ "$map_traffic_separation_active" -gt 0 ]; then
if __hyfi_is_device_wlan $iface dev; then
continue
fi
fi
if [ "$iface" = "$switch_iface" -a "$eswitch_support" = "1" ]; then
ETHER_DEVICES="${ETHER_DEVICES}${ETHER_DEVICES:+","}${iface}:ESWITCH"
else
ETHER_DEVICES="${ETHER_DEVICES}${ETHER_DEVICES:+","}${iface}&${config}:ETHER"
fi
done
fi
}
# hyfi_get_ether_ifaces()
# input: $1 IEEE1905.1 managed bridge interface
# output: $2 List of all Ethernet interfaces bound to the bridge
hyfi_get_ether_ifaces() {
local ieee1905managed="$1"
ETHER_DEVICES=""
hyfi_network_sync
config_load repacd
config_get traffic_separation_enabled repacd TrafficSeparationEnabled '0'
config_get traffic_separation_active repacd TrafficSeparationActive '0'
config_get backhaul_network repacd NetworkBackhaul 'backhaul'
config_get map_bh_nw MAPConfig VlanNetworkBackHaul 'backhaul'
config_get map_traffic_separation_active MAPConfig 'MapTrafficSeparationActive' '0'
config_load network
config_foreach __hyfi_get_ether_ifaces interface $ieee1905managed
eval "$2='${ETHER_DEVICES}'"
}
__hyfi_is_vlan_iface() {
local iface="$1"
echo "$iface" | grep '\.' >/dev/null 2>&1
if [ "$?" -eq "0" ]; then
return 0
fi
return 1
}
__hyfi_iterate_wlan_ifaces() {
local config="$1"
local iface network disabled
local interface
local device
config_get iface "$config" ifname
config_get network "$config" network
config_get disabled "$config" disabled '0'
config_get device "$config" device
if [ -n "$iface" -a "$backhaul_network" = "$network" -a "$disabled" -eq 0 ]; then
interface=`echo "$2" | cut -d '.' -f1`
if [ "$interface" = "$iface" ]; then
eval "$3='0'"
eval "$4=$config"
eval "$5=$device"
fi
fi
if [ "$map_traffic_separation_active" -gt 0 ]; then
if [ -n "$iface" -a "$disabled" -eq 0 ]; then
if [ "$network" = "$map_bh_nw" ] || \
[ "$network" = "$map_nw_One" ] || \
[ "$network" = "$map_nw_Two" ] || \
[ "$network" = "$map_nw_Three" ] || \
[ "$network" = "lan" ]; then
interface=`echo "$2" | cut -d '.' -f1`
if [ "$interface" = "$iface" ]; then
eval "$3='0'"
eval "$4=$config"
eval "$5=$device"
fi
fi
fi
fi
}
__hyfi_is_device_wlan() {
local iface="$1"
device_wlan=1
local wdev
if [ -n "$backhaul_network" ] || [ -n "$map_bh_nw" ]; then
config_load wireless
config_foreach __hyfi_iterate_wlan_ifaces wifi-iface $iface device_wlan iface_config wdev
fi
eval "$2=$wdev"
return $device_wlan
}
__hyfi_get_wlan_vlan_ifaces() {
local config="$1"
local ifnames bridge_name
local wdevice
config_get ifnames "$config" device
config_get bridge_name "$config" ifname
if [ "$2" = "$config" ]; then
#initially VLAN interfaces are added using vconfig and brctl tool
#to avoid multiple restarts.VLAN interfaces added this way are not
#detected by config_get, so using direct command here.
ifnames=`uci get "network.$1.ifname"`
for iface in $ifnames; do
if __hyfi_is_vlan_iface $iface; then
if __hyfi_is_device_wlan $iface wdevice; then
WLAN_VLAN_DEVICES="${WLAN_VLAN_DEVICES}${WLAN_VLAN_DEVICES:+","}${iface}@${wdevice}&${config}:WLAN_VLAN"
fi
fi
done
fi
}
__hyfi_get_wlan_vlan_sta_ifaces() {
local config="$1"
local ifnames bridge_name dev
local mode
config_get ifnames "$config" device
config_get bridge_name "$config" ifname
if [ "$2" = "$config" ]; then
ifnames=`uci get "network.$1.ifname"`
for iface in $ifnames; do
if __hyfi_is_vlan_iface $iface; then
if __hyfi_is_device_wlan $iface dev; then
config_load wireless
config_get mode "$iface_config" mode
if [ "$mode" = "sta" ]; then
WLAN_VLAN_STA_DEVICES="${WLAN_VLAN_STA_DEVICES}${WLAN_VLAN_STA_DEVICES:+","}${iface}"
fi
fi
fi
done
fi
}
hyfi_get_wlan_vlan_ifaces() {
local ieee1905managed="$1"
WLAN_VLAN_DEVICES=""
hyfi_network_sync
config_load repacd
config_get traffic_separation_enabled repacd TrafficSeparationEnabled '0'
config_get traffic_separation_active repacd TrafficSeparationActive '0'
config_get backhaul_network repacd NetworkBackhaul 'backhaul'
config_get map_bh_nw MAPConfig VlanNetworkBackHaul 'backhaul'
config_get map_traffic_separation_active MAPConfig 'MapTrafficSeparationActive' '0'
if [ "$traffic_separation_enabled" -gt 0 ] && \
[ "$traffic_separation_active" -gt 0 ] || \
[ "$map_traffic_separation_active" -gt 0 ]; then
config_load network
config_foreach __hyfi_get_wlan_vlan_ifaces interface $ieee1905managed
fi
eval "$2='${WLAN_VLAN_DEVICES}'"
}
hyfi_get_wlan_vlan_sta_ifaces() {
local ieee1905managed="$1"
WLAN_VLAN_STA_DEVICES=""
hyfi_network_sync
config_load repacd
config_get traffic_separation_enabled repacd TrafficSeparationEnabled '0'
config_get traffic_separation_active repacd TrafficSeparationActive '0'
config_get backhaul_network repacd NetworkBackhaul 'backhaul'
config_get map_bh_nw MAPConfig VlanNetworkBackHaul 'backhaul'
config_get map_traffic_separation_active MAPConfig 'MapTrafficSeparationActive' '0'
if [ "$traffic_separation_enabled" -gt 0 ] && \
[ "$traffic_separation_active" -gt 0 ] || \
[ "$map_traffic_separation_active" -gt 0 ]; then
config_load network
config_foreach __hyfi_get_wlan_vlan_sta_ifaces interface $ieee1905managed
fi
eval "$2='${WLAN_VLAN_STA_DEVICES}'"
}
__hyfi_get_plc_iface() {
local plciface iface bridge_name
local ieee1905managed="$1"
config_load plc
config_get plciface config PlcIfname
[ -z "$plciface" ] && return
config_get bridge_name "$ieee1905managed" ifname
config_load network
config_get ifnames $ieee1905managed device
# Check the ifnames parameter is populated correctly
if [ -z "$ifnames" ]; then
# If the ifnames parameter doesn't contain the device list, it should
# be present in the bridge_name. However, it's possible a race
# condition occured, and neither parameter contains the device list.
# Check the device list again if the bridge_name actually contains the
# name of the bridge.
if echo $bridge_name | grep -q br-; then
hyfi_debug hyiface "Missing device names, and ifname matches bridge, fetching device names again"
config_get ifnames "$ieee1905managed" device
if [ -z "$ifnames" ]; then
ifnames=`uci get "network.$1.ifname"`
hyfi_error hyiface "Device names missing, defaulting to $ifnames"
else
hyfi_debug hyiface "Device names now populated correctly"
fi
else
ifnames=$bridge_name
hyfi_debug hyiface "Missing device names, so using ifname parameter instead"
fi
fi
for iface in $ifnames; do
if [ "$iface" = "$plciface" ]; then
PLC_DEVICE="${plciface}&${ieee1905managed}:PLC"
return
fi
done
}
# hyfi_get_plc_iface()
# input: $1 IEEE1905.1 managed bridge interface
# output: $2 PLC interface bound to the bridge
hyfi_get_plc_iface() {
local ieee1905managed="$1"
PLC_DEVICE=""
hyfi_network_sync
__hyfi_get_plc_iface $ieee1905managed
eval "$2='${PLC_DEVICE}'"
}
# hyfi_get_ifaces()
# input: $1 IEEE1905.1 managed bridge interface
# output: $2 List of ALL interface bound to the bridge
# output: $3 List of ALL WLAN devices/radios bound to the bridge
hyfi_get_ifaces() {
local ieee1905managed="$1"
WLAN_DEVICES=""
WLAN_INCLUDED_DEVICES=""
WLAN_VLAN_DEVICES=""
ETHER_DEVICES=""
PLC_DEVICE=""
hyfi_network_sync
config_load repacd
config_get traffic_separation_enabled repacd TrafficSeparationEnabled '0'
config_get traffic_separation_active repacd TrafficSeparationActive '0'
config_get backhaul_network repacd NetworkBackhaul 'backhaul'
config_get map_traffic_separation_active MAPConfig 'MapTrafficSeparationActive' '0'
config_get map_bh_nw MAPConfig VlanNetworkBackHaul 'backhaul'
config_load network
config_foreach __hyfi_get_ether_ifaces interface $ieee1905managed
config_load wireless
config_foreach __hyfi_get_wlan_ifaces wifi-iface $ieee1905managed
if [ "$traffic_separation_enabled" -gt 0 ] && \
[ "$traffic_separation_active" -gt 0 ] || \
[ "$map_traffic_separation_active" -gt 0 ]; then
config_load network
config_foreach __hyfi_get_wlan_vlan_ifaces interface $ieee1905managed
fi
__hyfi_get_plc_iface $ieee1905managed
ALL_DEVICES=$WLAN_DEVICES
if [ -n "$ETHER_DEVICES" ]; then
[ -z "$ALL_DEVICES" ] || ALL_DEVICES="${ALL_DEVICES},"
ALL_DEVICES="${ALL_DEVICES}${ETHER_DEVICES}"
fi
if [ -n "$PLC_DEVICE" ]; then
[ -z "$ALL_DEVICES" ] || ALL_DEVICES="${ALL_DEVICES},"
ALL_DEVICES="${ALL_DEVICES}${PLC_DEVICE}"
fi
if [ -n "$WLAN_VLAN_DEVICES" ]; then
[ -z "$ALL_DEVICES" ] || ALL_DEVICES="${ALL_DEVICES},"
ALL_DEVICES="${ALL_DEVICES}${WLAN_VLAN_DEVICES}"
fi
eval "$2='${ALL_DEVICES}'"
eval "$3='${WLAN_INCLUDED_DEVICES}'"
}
__hyfi_iterate_networks() {
local config="$1"
local type ieee1905managed
config_get type "$config" type
[ -z "$type" -o ! "$type" = "bridge" ] && return
config_get_bool ieee1905managed "$config" ieee1905managed
[ -z "$ieee1905managed" ] && return
if [ "$ieee1905managed" -eq "1" ]; then
ieee1905managed_found=1
if [ -n "$ieee1905managed_bridge" ]
then
ieee1905managed_bridge2="$config"
else
ieee1905managed_bridge="$config"
fi
fi
}
__hyfi_iterate_networks2() {
local config="$1"
local my_iface="$2"
local ifnames iface type
[ -n "$bound_bridge" ] && return
config_get type "$config" type
[ -z "$type" -o ! "$type" = "bridge" ] && return
config_get ifnames "$config" device
for iface in $ifnames; do
if [ "$iface" = "$my_iface" ]; then
bound_bridge=br-$config
return
fi
done
}
# hyfi_get_ieee1905_managed_iface()
# output: $1 IEEE1905.1 managed bridge interface
# output: $2 2nd IEEE1905.1 managed bridge interface
# Note: If no entry exists, the function will set the "lan"
# interface as the default managed bridge
hyfi_get_ieee1905_managed_iface() {
ieee1905managed_found=0
ieee1905managed_bridge=""
ieee1905managed_bridge2=""
config_load network
config_foreach __hyfi_iterate_networks interface
eval "$1='$ieee1905managed_bridge'"
eval "$2='$ieee1905managed_bridge2'"
[ "$ieee1905managed_found" -eq "1" ] && return
ieee1905managed_bridge="lan"
uci_set network $ieee1905managed_bridge ieee1905managed 1
uci_commit network
config_load network
__hyfi_iterate_networks $ieee1905managed_bridge
eval "$1='$ieee1905managed_bridge'"
}
# hyfi_strip_list
# input: $1 list of interfaces with attached type
# output: $2 same list with type stripped
hyfi_strip_list() {
eval "$2='`echo $1 | sed 's/@[a-zA-Z0-9]*//g' | sed 's/:[A-Z]*,/ /g' | sed 's/:[A-Z]*//g' | sed 's/&[a-zA-Z0-9]*//g'`'"
}
# hyfi_get_bridge_from_iface()
# input: $1 interface name
# output: $2 bridge the interface is bound to
hyfi_get_bridge_from_iface() {
bound_bridge=""
local iface="$1"
config_load network
config_foreach __hyfi_iterate_networks2 interface $iface
eval "$2='$bound_bridge'"
}
# hyfi_get_ieee1905_brguest_map()
# output: $1 IEEE1905.1 secondary network names
# output: $2 IEEE1905.1 backhaul network name
hyfi_get_ieee1905_brguest_map() {
nw_names=""
config_load repacd
config_get num_vlan_supported MAPConfig 'NumberOfVLANSupported' '0'
# Exclude lan from this list
num_vlan_supported=$((num_vlan_supported-1))
for i in One Two Three; do
if [ "$num_vlan_supported" -eq 0 ]; then
break
fi
config_get nw MAPConfig "VlanNetwork"$i '0'
config_get type $nw type
[ -z "$type" -o ! "$type" = "bridge" ] && return
if [ -n "$nw_names" ]; then
nw_names="$nw_names $nw"
else
nw_names="$nw"
fi
eval map_nw_$i=$nw
num_vlan_supported=$((num_vlan_supported-1))
done
# Get BackHaul Network Name
config_get nw_bh MAPConfig VlanNetworkBackHaul '0'
eval "$1='$nw_names'"
eval "$2='$nw_bh'"
}

View file

@ -1,22 +0,0 @@
hyfi_network_sync() {
lock -w /var/run/hyfi_network.lock
}
hyfi_network_restart() {
trap __hyfi_trap_cb INT ABRT QUIT ALRM
lock /var/run/hyfi_network.lock
hyfi_echo "hyfi network" "process $0 ($$) requested network restart"
/etc/init.d/network restart
local radios=`uci show wireless | grep ".disabled=" | grep -v "@" | wc -l`
local vaps=`uci show wireless | grep "].disabled=0" | wc -l`
if [ $vaps -gt $radios ]; then
# Workaround for Wi-Fi, needs a clean environment
env -i /sbin/wifi
fi
lock -u /var/run/hyfi_network.lock
trap - INT ABRT QUIT ALRM
}

View file

@ -1,18 +0,0 @@
config WSPLCD_SUPPORT_PLC
bool "Support PLC credential cloning"
depends on PACKAGE_qca-plc-serv
default y
help
This enables the WSPLCD support for PLC interfaces
config WSPLCD_SUPPORT_CFG80211
bool "Support cfg80211 config layer for WSPLCD"
depends on PACKAGE_qca-cfg80211
default y
help
CFG80211 support for WSPLCD
config WSPLCD_SUPPORT_CALLTRACE
bool "Enable calltrace support for WSPLCD"
help
Calltrace support for WSPLCD

View file

@ -1,233 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qca-wsplcd
PKG_RELEASE:=1
include $(INCLUDE_DIR)/local-development.mk
ifeq ($(DUMP)$(PKG_VERSION),)
PKG_REV:=$(shell git ls-remote $(PKG_SOURCE_URL) $(PKG_BRANCH) | cut -b -7)
PKG_VERSION:=g$(PKG_REV)
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)$(PKG)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
TARGET_CFLAGS += -fpie
TARGET_LDFLAGS += -pie
WIFI_U:=PACKAGE_kmod-qca-wifi-unified-profile
WIFI_C:=PACKAGE_kmod-qca-wifi-custc-profile
WIFI_A:=PACKAGE_kmod-qca-wifi-akronite-perf
WIFI_D:=PACKAGE_kmod-qca-wifi-dakota-perf
WIFI_MIPS:=PACKAGE_kmod-qca-wifi-perf
WIFI_MIPS_UNIFIED:=PACKAGE_kmod-qca-wifi-unified-perf
WIFI_10_2_MIPS:=PACKAGE_kmod-qca-wifi-perf
WIFI_10_2_ARM:=PACKAGE_kmod-qca-wifi-akronite-perf
WIFI_L:=PACKAGE_kmod-qca-wifi-lowmem-profile
WIFI_16M:=PACKAGE_kmod-qca-wifi-flash_16mb-profile
WIFI_PKGS:=$(WIFI_U)||$(WIFI_C)||$(WIFI_A)||$(WIFI_D)||$(WIFI_MIPS)||$(WIFI_MIPS_UNIFIED)||$(WIFI_10_2_MIPS)||$(WIFI_10_2_ARM)||$(WIFI_L)||$(WIFI_16M)
PKG_BUILD_DEPENDS:=$(WIFI_U):qca-wifi $(WIFI_C):qca-wifi $(WIFI_A):qca-wifi $(WIFI_D):qca-wifi $(WIFI_MIPS):qca-wifi \
$(WIFI_MIPS_UNIFIED):qca-wifi $(WIFI_10_2_MIPS):qca-wifi $(WIFI_10_2_ARM):qca-wifi $(WIFI_L):qca-wifi $(WIFI_16M):qca-wifi
QCAWSPLCD_MAKE_OPTS:= \
CROSS=$(TARGET_CROSS) \
GWLIB=$(STAGING_DIR)/usr/lib \
GWINCLUDE=$(STAGING_DIR)/usr/include/hyficommon \
WPA2INCLUDE=$(STAGING_DIR)/usr/include/wpa2 \
HYDINCLUDE=$(STAGING_DIR)/usr/include/hyd \
STORAGEINCLUE=$(STAGING_DIR)/usr/include/storage \
IEEE1905INCLUDE=$(STAGING_DIR)/usr/include/ieee1905 \
PLCSRV=$(STAGING_DIR)/usr/include/plcserv \
ATHDIR=$(STAGING_DIR)/usr/include \
INSTALL_ROOT=$(PKG_BUILD_DIR)/install \
EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
LIBSTORAGE_UCI=y \
ARCH="$(ARCH)"
QCAWSPLCD_DEPENDS:=@$(WIFI_PKGS) +qca-ieee1905-init +libhyficommon +libstorage +libwpa2 +libieee1905 +libuci +libpthread +libwifisoncfg
QCAWSPLCD_DEPENDS+=+ENABLE_SON_MEMORY_DEBUG:qca-son-mem-debug
ifeq ($(CONFIG_ENABLE_SON_MEMORY_DEBUG),y)
QCAWSPLCD_MAKE_OPTS+= \
ENABLE_SON_MEMORY_DEBUG=y \
SONMEMDEBUGINCLUDE=$(STAGING_DIR)/usr/include/son-mem-dbg
endif
ifeq ($(CONFIG_WSPLCD_SUPPORT_PLC),y)
QCAWSPLCD_MAKE_OPTS+= \
WSPLCD_SUPPORT_PLC=y \
QCAWSPLCD_DEPENDS+=+qca-plc-serv
endif
ifeq ($(CONFIG_WSPLCD_SUPPORT_CFG80211),y)
QCAWSPLCD_MAKE_OPTS+= \
WSPLCD_SUPPORT_CFG80211=y
endif
ifneq ($(CONFIG_WSPLCD_SUPPORT_CALLTRACE),)
RSTRIP:=:
STRIP:=:
QCAWSPLCD_MAKE_OPTS+= \
CALLTRACE_SUPPORT=y
endif
LOCAL_VARIANT=$(patsubst qca-wsplcd-%,%,$(patsubst qca-wsplcd-%,%,$(BUILD_VARIANT)))
ifeq ($(LOCAL_VARIANT),all)
QCAWSPLCD_MAKE_OPTS+= \
ENABLE_SON=y \
ENABLE_MAP=y
endif
ifeq ($(LOCAL_VARIANT),son)
QCAWSPLCD_MAKE_OPTS+= \
ENABLE_SON=y
endif
ifeq ($(LOCAL_VARIANT),map)
QCAWSPLCD_MAKE_OPTS+= \
ENABLE_MAP=y
endif
ifeq ($(LOCAL_VARIANT),init)
QCAWSPLCD_MAKE_OPTS+= \
ENABLE_SON=y \
ENABLE_MAP=y
endif
define Package/qca-wsplcd/Default
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros, Inc.
DEPENDS:=+WSPLCD_SUPPORT_CALLTRACE:libunwind $(QCAWSPLCD_DEPENDS)
TITLE:=IEEE 1905.1 AP Auto-Configuration daemon
SUBMENU:=IEEE1905.1 features
endef
define Package/qca-wsplcd/Default/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc
$(INSTALL_BIN) $(PKG_BUILD_DIR)/install/sbin/ucpkgen $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/install/etc/athx100.conf $(1)/etc
$(INSTALL_DIR) $(1)/etc/init.d
ifeq ($(LINUX_VERSION),3.3.8)
$(INSTALL_BIN) ./files/wsplcd_no_procd.init $(1)/etc/init.d/wsplcd
else
$(INSTALL_BIN) ./files/wsplcd.init $(1)/etc/init.d/wsplcd
endif
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/wsplcd.config $(1)/etc/config/wsplcd
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) ./files/uci2cfg.sh $(1)/sbin/uci2cfg.sh
$(INSTALL_DIR) $(1)/etc/hotplug.d/button
$(INSTALL_BIN) ./files/wsplcd.button $(1)/etc/hotplug.d/button/40-wsplcd
endef
# COMMON PACKAGE
define Package/qca-wsplcd-init
$(call Package/qca-wsplcd/Default)
TITLE+= (Common package files)
VARIANT:=init
endef
define Package/qca-wsplcd-init/description
This package installs the IEEE 1905.1 AP Auto-Configuration daemon init package files for SON and MAP execution
endef
define Package/qca-wsplcd-init/config
source "$(SOURCE)/Config.in"
endef
# SINGLE PACKAGE (SON + MAP)
define Package/qca-wsplcd
$(call Package/qca-wsplcd/Default)
TITLE+= (with SON and MAP features)
VARIANT:=all
endef
define Package/qca-wsplcd/description
This package installs the IEEE 1905.1 AP Auto-Configuration daemon (SON and MAP): Wi-Fi credential cloning over backbone network (e.g. HomePlugAV, Ethernet, Wi-Fi)
endef
define Package/qca-wsplcd/config
source "$(SOURCE)/Config.in"
endef
# SON PACKAGE
define Package/qca-wsplcd-son
$(call Package/qca-wsplcd/Default)
DEPENDS+=+qca-wsplcd-init
TITLE+= (with SON features)
VARIANT:=son
endef
define Package/qca-wsplcd-son/description
This package installs the IEEE 1905.1 AP Auto-Configuration SON daemon: Wi-Fi credential cloning over backbone network (e.g. HomePlugAV, Ethernet, Wi-Fi)
endef
define Package/qca-wsplcd-son/config
source "$(SOURCE)/Config.in"
endef
# MAP PACKAGE
define Package/qca-wsplcd-map
$(call Package/qca-wsplcd/Default)
DEPENDS+=+qca-wsplcd-init
TITLE+= (with MAP features)
VARIANT:=map
endef
define Package/qca-wsplcd-map/description
This package installs the IEEE 1905.1 AP Auto-Configuration MAP daemon: Wi-Fi credential cloning over backbone network (e.g. HomePlugAV, Ethernet, Wi-Fi)
endef
define Package/qca-wsplcd-map/config
source "$(SOURCE)/Config.in"
endef
# ============
define Build/Compile
mkdir -p $(PKG_BUILD_DIR)/install/etc
mkdir -p $(PKG_BUILD_DIR)/install/sbin
$(MAKE) -C $(PKG_BUILD_DIR) $(strip $(QCAWSPLCD_MAKE_OPTS)) install
endef
define Package/qca-wsplcd/install
$(call Package/qca-wsplcd/Default/install, $(1))
$(INSTALL_BIN) $(PKG_BUILD_DIR)/install/sbin/wsplcd $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/wsplcd/map/templates
$(INSTALL_CONF) ./files/scheme-*.conf $(1)/etc/wsplcd/map/templates
endef
define Package/qca-wsplcd-son/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/install/sbin/wsplcd-son $(1)/usr/sbin
endef
define Package/qca-wsplcd-map/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/install/sbin/wsplcd-map $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/wsplcd/map/templates
$(INSTALL_CONF) ./files/scheme-*.conf $(1)/etc/wsplcd/map/templates
endef
define Package/qca-wsplcd-init/install
$(call Package/qca-wsplcd/Default/install, $(1))
endef
$(eval $(call BuildPackage,qca-wsplcd))
$(eval $(call BuildPackage,qca-wsplcd-son))
$(eval $(call BuildPackage,qca-wsplcd-map))
$(eval $(call BuildPackage,qca-wsplcd-init))

View file

@ -1,9 +0,0 @@
SSID: FH,__FH_SSID_REPLACE__,__FH_AUTH_TYPE_REPLACE__,0x0008,__FH_KEY_REPLACE__,0,1
SSID: BH,__BH_SSID_REPLACE__,__BH_AUTH_TYPE_REPLACE__,0x0008,__BH_KEY_REPLACE__,1,0
SSID: FHA1,__FHA1_SSID_REPLACE__,__FHA1_AUTH_TYPE_REPLACE__,0x0008,__FHA1_KEY_REPLACE__,0,1
SSID: FHA2,__FHA2_SSID_REPLACE__,__FHA2_AUTH_TYPE_REPLACE__,0x0008,__FHA2_KEY_REPLACE__,0,1
SSID: FHA3,__FHA3_SSID_REPLACE__,__FHA3_AUTH_TYPE_REPLACE__,0x0008,__FHA3_KEY_REPLACE__,0,1
Generic-Policy: 2,115,120,121,127,FH,BH,FHA1,FHA2,FHA3
Generic-Policy: 1,80,89,FH,BH,FHA1,FHA2,FHA3
Generic-Policy: 1,115,120,FH,BH,FHA1,FHA2,FHA3
Generic-Policy: 1,121,127,BH

View file

@ -1,9 +0,0 @@
SSID: FH,__FH_SSID_REPLACE__,__FH_AUTH_TYPE_REPLACE__,0x0008,__FH_KEY_REPLACE__,0,1
SSID: BH,__BH_SSID_REPLACE__,__BH_AUTH_TYPE_REPLACE__,0x0008,__BH_KEY_REPLACE__,1,0
SSID: FHA1,__FHA1_SSID_REPLACE__,__FHA1_AUTH_TYPE_REPLACE__,0x0008,__FHA1_KEY_REPLACE__,0,1
SSID: FHA2,__FHA2_SSID_REPLACE__,__FHA2_AUTH_TYPE_REPLACE__,0x0008,__FHA2_KEY_REPLACE__,0,1
SSID: FHA3,__FHA3_SSID_REPLACE__,__FHA3_AUTH_TYPE_REPLACE__,0x0008,__FHA3_KEY_REPLACE__,0,1
Generic-Policy: 2,115,120,121,127,FH,BH,FHA1,FHA2,FHA3
Generic-Policy: 1,80,89,FH,BH,FHA1,FHA2,FHA3
Generic-Policy: 1,115,120,FH,FHA1,FHA2,FHA3
Generic-Policy: 1,121,127,BH

View file

@ -1,8 +0,0 @@
SSID: FHBH,__FHBH_SSID_REPLACE__,__FHBH_AUTH_TYPE_REPLACE__,0x0008,__FHBH_KEY_REPLACE__,1,1
SSID: FHBHA1,__FHBHA1_SSID_REPLACE__,__FHBHA1_AUTH_TYPE_REPLACE__,0x0008,__FHBHA1_KEY_REPLACE__,1,1
SSID: FHBHA2,__FHBHA2_SSID_REPLACE__,__FHBHA2_AUTH_TYPE_REPLACE__,0x0008,__FHBHA2_KEY_REPLACE__,1,1
SSID: FHBHA3,__FHBHA3_SSID_REPLACE__,__FHBHA3_AUTH_TYPE_REPLACE__,0x0008,__FHBHA3_KEY_REPLACE__,1,1
Generic-Policy: 2,115,120,121,127,FHBH,FHBHA1,FHBHA2,FHBHA3
Generic-Policy: 1,80,89,FHBH,FHBHA1,FHBHA2,FHBHA3
Generic-Policy: 1,115,120,FHBH,FHBHA1,FHBHA2,FHBHA3
Generic-Policy: 1,121,127,FHBH,FHBHA1,FHBHA2,FHBHA3

View file

@ -1,13 +0,0 @@
SSID: FH,__FH_SSID_REPLACE__,__FH_AUTH_TYPE_REPLACE__,0x0008,__FH_KEY_REPLACE__,0,1,B5,__PRIMARY_VLAN__,__PCP__,B6,__PRIMARY_VLAN__
SSID: BH1,__BH_SSID_REPLACE__,__BH_AUTH_TYPE_REPLACE__,0x0008,__BH_KEY_REPLACE__,1,0,__R1_BSTA_ASSOC_DISALLOW_BH1__,__R2_BSTA_ASSOC_DISALLOW_BH1__
SSID: BH2,__BH2_SSID_REPLACE__,__BH2_AUTH_TYPE_REPLACE__,0x0008,__BH_KEY_REPLACE__,1,0,__R1_BSTA_ASSOC_DISALLOW_BH2__,__R2_BSTA_ASSOC_DISALLOW_BH2__
SSID: FH1,__FH_SSID_REPLACE_NW_One__,__FH_AUTH_TYPE_REPLACE_NW_One__,0x0008,__FH_KEY_REPLACE_NW_One__,0,1,B5,__PRIMARY_VLAN__,__PCP__,B6,__VLAN_ID_NW_One__
SSID: FH2,__FH_SSID_REPLACE_NW_Two__,__FH_AUTH_TYPE_REPLACE_NW_Two__,0x0008,__FH_KEY_REPLACE_NW_Two__,0,1,B5,__PRIMARY_VLAN__,__PCP__,B6,__VLAN_ID_NW_Two__
SSID: FH3,__FH_SSID_REPLACE_NW_Three__,__FH_AUTH_TYPE_REPLACE_NW_Three__,0x0008,__FH_KEY_REPLACE_NW_Three__,0,1,B5,__PRIMARY_VLAN__,__PCP__,B6,__VLAN_ID_NW_Three__
SSID: FHA1,__FHA1_SSID_REPLACE__,__FHA1_AUTH_TYPE_REPLACE__,0x0008,__FHA1_KEY_REPLACE__,0,1,B5,__PRIMARY_VLAN__,__PCP__,B6,__PRIMARY_VLAN__
SSID: FHA2,__FHA2_SSID_REPLACE__,__FHA2_AUTH_TYPE_REPLACE__,0x0008,__FHA2_KEY_REPLACE__,0,1,B5,__PRIMARY_VLAN__,__PCP__,B6,__PRIMARY_VLAN__
SSID: FHA3,__FHA3_SSID_REPLACE__,__FHA3_AUTH_TYPE_REPLACE__,0x0008,__FHA3_KEY_REPLACE__,0,1,B5,__PRIMARY_VLAN__,__PCP__,B6,__PRIMARY_VLAN__
Generic-Policy: 2,115,120,121,127,FH,BH1,BH2,FH1,FH2,FH3,FHA1,FHA2,FHA3
Generic-Policy: 1,80,89,FH,BH1,BH2,FH1,FH2,FH3,FHA1,FHA2,FHA3
Generic-Policy: 1,115,120,FH,BH1,BH2,FH1,FH2,FH3,FHA1,FHA2,FHA3
Generic-Policy: 1,121,127,FH,BH1,BH2,FH1,FH2,FH3,FHA1,FHA2,FHA3

View file

@ -1,669 +0,0 @@
#!/bin/sh
# Copyright (c) 2013 Qualcomm Atheros, Inc.
#
# All Rights Reserved.
# Qualcomm Atheros Confidential and Proprietary.
. /lib/functions.sh
IGNORE_NON_WIFISEC=0
IS_CURRENT_WIFISEC=0
# This counter is used to record the correct indices of VAPs in wireless config
# file.
TOTAL_NUM_VIFS=0
cfg_append() {
if [ "$IGNORE_NON_WIFISEC" -gt 0 ] && [ "$IS_CURRENT_WIFISEC" -eq 0 ]; then
return
fi
echo "$1"
}
cfg_radio_set() {
local radioidx=$(($1 + 1))
local cfg="$2"
local val="$3"
cfg_append "RADIO.$radioidx.$cfg=$val"
}
cfg_radio_add() {
local device="$1"
local radioidx=$(($2 + 1))
local cfg="$3"
local key="$4"
local def="$5"
local val
config_get val $device $key $def
[ -n "$val" ] && cfg_append "RADIO.$radioidx.$cfg=$val"
}
cfg_vif_set() {
local vifidx=$(($1 + 1))
local cfg="$2"
local val="$3"
cfg_append "WLAN.$vifidx.$cfg=$val"
}
cfg_vif_add() {
local vif="$1"
local vifidx=$(($2 + 1))
local cfg="$3"
local key="$4"
local def="$5"
local val
config_get val $vif $key $def
[ -n "$val" ] && cfg_append "WLAN.$vifidx.$cfg=$val"
}
cfg_vifsec_set() {
IS_CURRENT_WIFISEC=1
cfg_vif_set "$@"
IS_CURRENT_WIFISEC=0
}
cfg_vifsec_add() {
IS_CURRENT_WIFISEC=1
cfg_vif_add "$@"
IS_CURRENT_WIFISEC=0
}
scan_wifi() {
local cfgfile="$1"
DEVICES=
config_load "${cfgfile:-wireless}"
# Create a virtual interface list field for each wifi-device
#
# input: $1 section: section name of each wifi-device
create_vifs_list() {
local section="$1"
append DEVICES "$section"
config_set "$section" vifs ""
}
config_foreach create_vifs_list wifi-device
# Append each wifi-iface to the virtual interface list of its associated wifi-device
#
# input: $1 section: section name of each wifi-iface
append_vif() {
local section="$1"
config_get device "$section" device
config_get vifs "$device" vifs
append vifs "$section"
config_set "$device" vifs "$vifs"
# For wifi-iface (VAP), record its index and section name in variable
# vifname_#. This will be used later when generating wsplcd config file
# to match the VAP with correct index.
eval "vifname_${TOTAL_NUM_VIFS}=$section"
TOTAL_NUM_VIFS=$(($TOTAL_NUM_VIFS + 1))
}
config_foreach append_vif wifi-iface
}
cfg_get_wifi() {
local vifidx=0
local managed_network=$1
local network=""
scan_wifi
for device in $DEVICES; do
local radioidx=${device#wifi}
local vidx_per_radio=0
local channel
local wsplcd_unmanaged
# All of the radio parameters are not used in IEEE1905.1 cloning
config_get channel "$device" channel '0'
config_get macaddr "$device" macaddr
[ "$channel" = "auto" ] && channel=0
cfg_radio_set $radioidx Channel $channel
config_get disabled "$device" disabled '0'
[ "$disabled" = "1" ] && radioena=0 || radioena=1
cfg_radio_set $radioidx RadioEnabled $radioena
cfg_radio_set $radioidx macaddr $macaddr
# UCI based targets have different definition of "txpower" from mib based targets
cfg_radio_add $device $radioidx X_ATH-COM_Powerlevel txpower
cfg_radio_add $device $radioidx X_ATH-COM_Rxchainmask rxchainmask
cfg_radio_add $device $radioidx X_ATH-COM_Txchainmask txchainmask
# X_ATH-COM_TBRLimit is not implemented in QSDK
# cfg_radio_add $device $radioidx X_ATH-COM_TBRLimit tbrlimit
cfg_radio_add $device $radioidx X_ATH-COM_AMPDUEnabled AMPDU
cfg_radio_add $device $radioidx X_ATH-COM_AMPDULimit AMPDULim
# X_ATH-COM_AMPDUFrames is not implemented in QSDK
# cfg_radio_add $device $radioidx X_ATH-COM_AMPDUFrames AMPDUFrames
config_get hwmode "$device" hwmode auto
config_get htmode "$device" htmode auto
case "$hwmode:$htmode" in
# The parsing stops at the first match so we need to make sure
# these are in the right orders (most generic at the end)
*ng:HT20) hwmode=ng20;;
*ng:HT40-) hwmode=ng40minus;;
*ng:HT40+) hwmode=ng40plus;;
*ng:HT40) hwmode=ng40;;
*ng:*) hwmode=ng20;;
*na:HT20) hwmode=na20;;
*na:HT40-) hwmode=na40minus;;
*na:HT40+) hwmode=na40plus;;
*na:HT40) hwmode=na40;;
*na:*) hwmode=na40;;
*ac:HT20) hwmode=acvht20;;
*ac:HT40+) hwmode=acvht40plus;;
*ac:HT40-) hwmode=acvht40minus;;
*ac:HT40) hwmode=acvht40;;
*ac:HT80) hwmode=acvht80;;
*ac:HT160) hwmode=acvht160;;
*ac:HT80_80) hwmode=acvht80_80;;
*ac:*) hwmode=acvht80;;
*b:*) hwmode=b;;
*bg:*) hwmode=g;;
*g:*) hwmode=g;;
*a:*) hwmode=a;;
*) hwmode=auto;;
esac
config_get_bool device_unmanaged "$device" wsplcd_unmanaged '0'
config_get vifs "$device" vifs
# determine vif name
for vif in $vifs; do
local vifname
config_get network "$vif" network
[ "$network" = "$managed_network" ] || continue
config_get_bool disabled "$vif" disabled 0
[ "$disabled" = 0 ] ||
{
config_set "$vif" ifname ""
continue
}
[ $vidx_per_radio -gt 0 ] && vifname="ath${radioidx}${vidx_per_radio}" || vifname="ath${radioidx}"
config_get ifname "$vif" ifname
config_set "$vif" ifname "${ifname:-$vifname}"
vidx_per_radio=$(($vidx_per_radio + 1))
done
for vif in $vifs; do
local bssid enc
local beacontype wepencrmode wepauthmode wpaencrmode wpaauthmode wpa2encrmode wpa2authmode
local vapidx=0
local vifidx
config_get network "$vif" network
[ "$network" = "$managed_network" ] || continue
# First need to find the correct VAP index for the current vif. This
# can be done by looking for the matching interface name from
# vifname_${vapidx} variables,
while [ $vapidx -lt $TOTAL_NUM_VIFS ]
do
local name=$(eval "echo \$vifname_${vapidx}")
if [ "$name" == "$vif" ];
then
vifidx=$vapidx
break
fi
vapidx=$(($vapidx + 1))
done
[ -n "$vifidx" ] || continue
config_get_bool disabled "$vif" disabled 0
[ "$disabled" = "1" ] && vifena=0 || vifena=1
cfg_vif_set $vifidx Enable $vifena
cfg_vif_set $vifidx X_ATH-COM_RadioIndex $(($radioidx +1))
config_get ifname "$vif" ifname
bssid=`ifconfig $ifname 2>&1 | awk '/HWaddr/ {print \$5}'`
cfg_vif_set $vifidx BSSID $bssid
cfg_vifsec_add $vif $vifidx SSID ssid
cfg_vifsec_add $vif $vifidx backhaul_ap backhaul_ap
cfg_vifsec_add $vif $vifidx SteeringDisabled SteeringDisabled
[ "$hwmode" == "auto" ] && {
local is5G=`iwconfig $ifname 2>&1 | grep Frequency:5`
[ -n "$is5G" ] && hwmode="na40minus" || hwmode="ng20"
}
config_load wsplcd
config_get deep_clone_son config 'DeepClone_SON' 1
config_get map_enable config 'MapEnable' 0
config_load wireless
if [ "$deep_clone_son" = 1 ] && [ "$map_enable" = 0 ]; then
local current_channel=`iwlist $ifname 2>&1 channel | grep "Current Frequency" | awk -F" " '{print $5}' | awk -F')' '{print $1}'`
local current_operating_mode=`cfg80211tool $ifname 2>&1 get_mode | grep "get_mode" | awk -F" " '{print $2}' | awk -F':' '{print $2}'`
local current_freq=`iwlist $ifname 2>&1 channel | grep "Current Frequency" | awk -F':' '{print $2}' | awk -F" " '{print $1}' | sed 's/\.//g' | cut -c1-1`
local band_freq=`iwlist $ifname 2>&1 channel | grep "Current Frequency" | awk -F':' '{print $2}' | awk -F" " '{print $1}' | sed 's/\.//g' | sed -e "s/\<\([0-9]\{1,4\}\)\>/\10000/; s/\([0-9]\{4\}\)/\1/" | awk '{ print $1; }' | sed -n 's/\([0-9]\{4\}\).*/\1/p' `
if [ "$band_freq" -gt 5950 ] && [ "$band_freq" -lt 7130 ]; then
if [ "$current_operating_mode" == "11AHE80_80" ]; then
cfg_vifsec_set $vifidx Standard axahe80_80_6g
elif [ "$current_operating_mode" == "11AHE160" ]; then
cfg_vifsec_set $vifidx Standard axahe160_6g
elif [ "$current_operating_mode" == "11AHE80" ]; then
cfg_vifsec_set $vifidx Standard axahe80_6g
elif [ "$current_operating_mode" == "11AHE40PLUS" ]; then
cfg_vifsec_set $vifidx Standard axahe40plus_6g
elif [ "$current_operating_mode" == "11AHE40MINUS" ]; then
cfg_vifsec_set $vifidx Standard axahe40minus_6g
elif [ "$current_operating_mode" == "11AHE20" ]; then
cfg_vifsec_set $vifidx Standard axahe20_6g
fi
fi
if [ "$band_freq" -gt 5175 ] && [ "$band_freq" -lt 5900 ] && [ "$current_freq" == 5 ] ; then
if [ "$current_channel" -gt 35 ] && [ "$current_channel" -lt 99 ]; then
if [ "$current_operating_mode" == "11AHE80_80" ]; then
cfg_vifsec_set $vifidx Standard axahe80_80low
elif [ "$current_operating_mode" == "11AHE160" ]; then
cfg_vifsec_set $vifidx Standard axahe160low
elif [ "$current_operating_mode" == "11AHE80" ]; then
cfg_vifsec_set $vifidx Standard axahe80low
elif [ "$current_operating_mode" == "11AHE40PLUS" ]; then
cfg_vifsec_set $vifidx Standard axahe40pluslow
elif [ "$current_operating_mode" == "11AHE40MINUS" ]; then
cfg_vifsec_set $vifidx Standard axahe40minuslow
elif [ "$current_operating_mode" == "11AHE20" ]; then
cfg_vifsec_set $vifidx Standard axahe20low
elif [ "$current_operating_mode" == "11ACVHT80_80" ]; then
cfg_vifsec_set $vifidx Standard acvht80_80low
elif [ "$current_operating_mode" == "11ACVHT160" ]; then
cfg_vifsec_set $vifidx Standard acvht160low
elif [ "$current_operating_mode" == "11ACVHT80" ]; then
cfg_vifsec_set $vifidx Standard acvht80low
elif [ "$current_operating_mode" == "11ACVHT40PLUS" ]; then
cfg_vifsec_set $vifidx Standard acvht40pluslow
elif [ "$current_operating_mode" == "11ACVHT40MINUS" ]; then
cfg_vifsec_set $vifidx Standard acvht40minuslow
elif [ "$current_operating_mode" == "11ACVHT20" ]; then
cfg_vifsec_set $vifidx Standard acvht20low
elif [ "$current_operating_mode" == "11NAHT20" ]; then
cfg_vifsec_set $vifidx Standard na20low
elif [ "$current_operating_mode" == "11NAHT40MINUS" ]; then
cfg_vifsec_set $vifidx Standard na40minuslow
elif [ "$current_operating_mode" == "11NAHT40PLUS" ]; then
cfg_vifsec_set $vifidx Standard na40pluslow
elif [ "$current_operating_mode" == "11NAHT40" ]; then
cfg_vifsec_set $vifidx Standard na40low
elif [ "$current_operating_mode" == "11A" ]; then
cfg_vifsec_set $vifidx Standard alow
fi
fi
if [ "$current_channel" -gt 99 ]; then
if [ "$current_operating_mode" == "11AHE80_80" ]; then
cfg_vifsec_set $vifidx Standard axahe80_80
elif [ "$current_operating_mode" == "11AHE160" ]; then
cfg_vifsec_set $vifidx Standard axahe160
elif [ "$current_operating_mode" == "11AHE80" ]; then
cfg_vifsec_set $vifidx Standard axahe80
elif [ "$current_operating_mode" == "11AHE40PLUS" ]; then
cfg_vifsec_set $vifidx Standard axahe40plus
elif [ "$current_operating_mode" == "11AHE40MINUS" ]; then
cfg_vifsec_set $vifidx Standard axahe40minus
elif [ "$current_operating_mode" == "11AHE20" ]; then
cfg_vifsec_set $vifidx Standard axahe20
elif [ "$current_operating_mode" == "11ACVHT80_80" ]; then
cfg_vifsec_set $vifidx Standard acvht80_80
elif [ "$current_operating_mode" == "11ACVHT160" ]; then
cfg_vifsec_set $vifidx Standard acvht160
elif [ "$current_operating_mode" == "11ACVHT80" ]; then
cfg_vifsec_set $vifidx Standard acvht80
elif [ "$current_operating_mode" == "11ACVHT40PLUS" ]; then
cfg_vifsec_set $vifidx Standard acvht40plus
elif [ "$current_operating_mode" == "11ACVHT40MINUS" ]; then
cfg_vifsec_set $vifidx Standard acvht40minus
elif [ "$current_operating_mode" == "11ACVHT20" ]; then
cfg_vifsec_set $vifidx Standard acvht20
elif [ "$current_operating_mode" == "11NAHT20" ]; then
cfg_vifsec_set $vifidx Standard na20
elif [ "$current_operating_mode" == "11NAHT40MINUS" ]; then
cfg_vifsec_set $vifidx Standard na40minus
elif [ "$current_operating_mode" == "11NAHT40PLUS" ]; then
cfg_vifsec_set $vifidx Standard na40plus
elif [ "$current_operating_mode" == "11NAHT40" ]; then
cfg_vifsec_set $vifidx Standard na40
elif [ "$current_operating_mode" == "11A" ]; then
cfg_vifsec_set $vifidx Standard a
fi
fi
fi
if [ "$current_freq" == 2 ] ; then
if [ "$current_channel" -lt 15 ]; then
if [ "$current_operating_mode" == "11NGHT20" ]; then
cfg_vifsec_set $vifidx Standard ng20
elif [ "$current_operating_mode" == "11NGHT40MINUS" ]; then
cfg_vifsec_set $vifidx Standard ng40minus
elif [ "$current_operating_mode" == "11NGHT40PLUS" ]; then
cfg_vifsec_set $vifidx Standard ng40plus
elif [ "$current_operating_mode" == "11NGHT40" ]; then
cfg_vifsec_set $vifidx Standard ng40
elif [ "$current_operating_mode" == "11GHE20" ]; then
cfg_vifsec_set $vifidx Standard axghe20
elif [ "$current_operating_mode" == "11GHE40PLUS" ]; then
cfg_vifsec_set $vifidx Standard axghe40plus
elif [ "$current_operating_mode" == "11GHE40MINUS" ]; then
cfg_vifsec_set $vifidx Standard axghe40minus
elif [ "$current_operating_mode" == "11G" ]; then
cfg_vifsec_set $vifidx Standard g
elif [ "$current_operating_mode" == "11B" ]; then
cfg_vifsec_set $vifidx Standard b
fi
fi
fi
cfg_vif_set $vifidx Channel $current_channel
else
cfg_vifsec_set $vifidx Standard $hwmode
cfg_vif_set $vifidx Channel $channel
fi
cfg_vif_set $vifidx Network $network
config_get enc "$vif" encryption "none"
case "$enc" in
none)
beacontype="None"
;;
*wep*)
beacontype="Basic"
wepencrmode="WEPEncryption"
case "$enc" in
*shared*)
wepauthmode="SharedAuthentication"
;;
*mixed*)
wepauthmode="Both"
;;
*)
wepauthmode="None"
;;
esac
;;
*mixed*)
beacontype="WPAand11i"
wpa2authmode="PSKAuthentication"
wpa2encrmode="TKIPandAESEncryption"
case "$enc" in
*psk*)
wpa2authmode="PSKAuthentication"
;;
*wpa*)
wpa2authmode="EAPAuthentication"
;;
esac
;;
*psk2*)
beacontype="11i"
wpa2authmode="PSKAuthentication"
wpa2encrmode="AESEncryption"
;;
*wpa2*)
beacontype="11i"
wpa2authmode="EAPAuthentication"
wpa2encrmode="AESEncryption"
;;
*psk*)
beacontype="WPA"
wpaauthmode="PSKAuthentication"
wpaencrmode="TKIPEncryption"
;;
*wpa*)
beacontype="WPA"
wpaauthmode="EAPAuthentication"
wpaencrmode="TKIPEncryption"
;;
8021x)
beacontype="Basic"
wepencrmode="WEPEncryption"
wepauthmode="EAPAuthentication"
;;
ccmp)
beacontype="11i"
wpa2authmode="WPA3Authentication"
wpa2encrmode="AESEncryption"
;;
esac
# explicit override for crypto setting
case "$enc" in
*tkip+aes|*tkip+ccmp|*aes+tkip|*ccmp+tkip) crypto="TKIPandAESEncryption";;
*aes|*ccmp) crypto="AESEncryption";;
*tkip) crypto="TKIPEncryption";;
esac
[ -n "$crypto" ] &&
case "$beacontype" in
WPA)
wpaencrmode=$crypto
;;
11i|WPAand11i)
wpa2encrmode=$crypto
;;
esac
cfg_vifsec_set $vifidx BeaconType $beacontype
cfg_vifsec_set $vifidx BasicEncryptionModes $wepencrmode
cfg_vifsec_set $vifidx BasicAuthenticationMode $wepauthmode
cfg_vifsec_set $vifidx WPAEncryptionModes ${wpaencrmode}
cfg_vifsec_set $vifidx WPAAuthenticationMode $wpaauthmode
cfg_vifsec_set $vifidx IEEE11iEncryptionModes ${wpa2encrmode}
cfg_vifsec_set $vifidx IEEE11iAuthenticationMode $wpa2authmode
config_get key "$vif" key
case "$enc" in
*wep*)#WEP key
;;
*)#WPA psk
if [ ${#key} -eq 64 ]; then
cfg_vifsec_set $vifidx PreSharedKey.1.PreSharedKey "$key"
else
cfg_vifsec_set $vifidx KeyPassphrase "$key"
fi
;;
esac
cfg_vif_add $vif $vifidx BasicDataTransmitRates mcast_rate
config_get wds "$vif" wds
case "$wds" in
1|on|enabled) wds=1;;
*) wds=0;;
esac
config_get mode "$vif" mode
case "$mode" in
ap)
[ "$wds" = 1 ] && opmode=RootAP || opmode=InfrastructureAccessPoint
;;
sta)
[ "$wds" = 1 ] && opmode=WDSStation || opmode=WirelessStation
;;
adhoc)
# don't support adhoc
;;
wds)
opmode=WDSStation
;;
esac
cfg_vif_set $vifidx DeviceOperationMode $opmode
# WPA3: Add SAE Configurations
#SAE Enable
config_get sae "$vif" sae
[ -n "$sae" ] &&
case "$sae" in
1|on|enabled)
sae=1;;
*)
sae=0;;
esac
[ -n "$sae" ] && cfg_vifsec_set $vifidx EnableSAE $sae
append_list_parameter() {
cfg_vifsec_set $vifidx "${2}" "${1}"
}
#SAE_PASSWORD / SAE GROUPS / OWE GROUPS
case "$mode" in
ap)
config_list_foreach "$vif" sae_password append_list_parameter SAEPassword
config_list_foreach "$vif" sae_groups append_list_parameter SAEGroups
config_list_foreach "$vif" owe_groups append_list_parameter OWEGroups
;;
sta)
config_get sae_password "$vif" sae_password
[ -n "$sae_password" ] && cfg_vifsec_set $vifidx SAEPassword "$sae_password"
config_get sae_groups "$vif" sae_groups
[ -n "$sae_groups" ] && cfg_vifsec_set $vifidx SAEGroups "$sae_groups"
config_get owe_groups "$vif" owe_groups
[ -n "$owe_groups" ] && cfg_vifsec_set $vifidx OWEGroups "$owe_groups"
;;
esac
#SAE ANTI CLOGGING THRESHOLD
config_get sae_anti_clogging_threshold "$vif" sae_anti_clogging_threshold
[ -n "$sae_anti_clogging_threshold" ] && cfg_vifsec_set $vifidx SAEAntiCloggingThreshold $sae_anti_clogging_threshold
#SAE SYNC
config_get sae_sync "$vif" sae_sync
[ -n "$sae_sync" ] && cfg_vifsec_set $vifidx SAESync $sae_sync
#SAE REQUIRE MFP
config_get sae_require_mfp "$vif" sae_require_mfp
[ -n "$sae_require_mfp" ] && cfg_vifsec_set $vifidx SAERequireMFP $sae_require_mfp
#OWE: Add OWE Configurations
#OWE Enable
config_get owe "$vif" owe
[ -n "$owe" ] &&
case "$owe" in
1|on|enabled)
owe=1;;
*)
owe=0;;
esac
[ -n "$owe" ] && cfg_vifsec_set $vifidx EnableOWE $owe
config_get owe_transition_ifname "$vif" owe_transition_ifname
[ -n "$owe_transition_ifname" ] && cfg_vifsec_set $vifidx OWETransIfname "$owe_transition_ifname"
config_get owe_transition_ssid "$vif" owe_transition_ssid
[ -n "$owe_transition_ssid" ] && cfg_vifsec_set $vifidx OWETransSSID "$owe_transition_ssid"
config_get owe_transition_bssid "$vif" owe_transition_bssid
[ -n "$owe_transition_bssid" ] && cfg_vifsec_set $vifidx OWETransBSSID "$owe_transition_bssid"
#SUITE_B: Add SUITE_B Configurations
config_get suite_b "$vif" suite_b
[ -n "$suite_b" ] && cfg_vifsec_set $vifidx SuiteB "$suite_b"
# IEEE802.11i Management Frame Protection (MFP)
# MFP Enable
config_get ieee80211w "$vif" ieee80211w
[ -n "$ieee80211w" ] && cfg_vifsec_set $vifidx IEEE80211w $ieee80211w
# SAE mandatory parameter for 6G band
cfg_vifsec_add $vif $vifidx SAEPWE sae_pwe
cfg_vifsec_add $vif $vifidx SAEEn6GSecComp en_6g_sec_comp
# X_ATH-COM Authentication fields
config_get auth_server "$vif" auth_server
[ -n "$auth_server" ] && cfg_vifsec_set $vifidx X_ATH-COM_AuthServerAddr $auth_server
config_get auth_port "$vif" auth_port
[ -n "$auth_port" ] && cfg_vifsec_set $vifidx X_ATH-COM_AuthServerPort $auth_port
config_get auth_secret "$vif" auth_secret
[ -n "$auth_secret" ] && cfg_vifsec_set $vifidx X_ATH-COM_AuthServerSecret $auth_secret
config_get nasid "$vif" nasid
[ -n "$nasid" ] && cfg_vifsec_set $vifidx X_ATH-COM_NASID $nasid
# RTS and Rragmentation have different definitions from mib based targets
cfg_vif_add $vif $vifidx RTS rts
cfg_vif_add $vif $vifidx Fragmentation frag
cfg_vif_add $vif $vifidx X_ATH-COM_SSIDHide hidden
cfg_vif_set $vifidx X_ATH-COM_APModuleEnable $vifena
cfg_vif_add $vif $vifidx X_ATH-COM_WPSPin wps_pin "12345670"
[ "$disabled" = "1" ] || cfg_vif_set $vifidx X_ATH-COM_VapIfname "$ifname"
if [ "$enc" = "none" ] ; then
cfg_vif_set $vifidx X_ATH-COM_WPSConfigured NOTCONFIGURED
else
cfg_vif_set $vifidx X_ATH-COM_WPSConfigured CONFIGURED
fi;
cfg_vif_add $vif $vifidx X_ATH-COM_ShortGI shortgi
cfg_vif_add $vif $vifidx X_ATH-COM_CWMEnable 1
cfg_vif_add $vif $vifidx X_ATH-COM_WMM wmm
# Note that disablecoext and HT40Coexist are logical negations of
# one another, hence the inverted logic here. libstorage takes
# care of mapping back to the UCI setting.
# As per HOST design, disablecoext should be configured for only
# one vap. Otherwise it will take the value of disablecoext from
# the last created vap. So avoided to configure disablecoext for
# multiple vaps. Considered only if disablecoext is 0/1.
# If no value in disablecoext then, no need to do anything.
config_get_bool disablecoext "$vif" disablecoext
if [ "$disablecoext" = 1 ] ; then
cfg_vif_set $vifidx X_ATH-COM_HT40Coexist 0
else
if [ "$disablecoext" = 0 ] ; then
cfg_vif_set $vifidx X_ATH-COM_HT40Coexist 1
fi
fi
if [ "$device_unmanaged" -gt 0 ] ; then
wsplcd_unmanaged=1
else
config_get_bool wsplcd_unmanaged "$vif" wsplcd_unmanaged 0
fi
cfg_vif_set $vifidx WsplcdUnmanaged $wsplcd_unmanaged
# HBR is not implemented in QSDK
# cfg_vif_set $vifidx X_ATH-COM_HBREnable 0
# cfg_vif_set $vifidx X_ATH-COM_HBRPERLow 20
# cfg_vif_set $vifidx X_ATH-COM_HBRPERHigh 35
# Multicast Enhancement is not implemented in QSDK
# cfg_vif_set $vifidx X_ATH-COM_MEMode Translate
# cfg_vif_set $vifidx X_ATH-COM_MELength 32
# cfg_vif_set $vifidx X_ATH-COM_METimer 30000
# cfg_vif_set $vifidx X_ATH-COM_METimeout 120000
# cfg_vif_set $vifidx X_ATH-COM_MEDropMcast 1
done
done
}
case "$1" in
"wifisec")
IGNORE_NON_WIFISEC=1
network_name=$2
cfg_get_wifi $network_name
;;
"wifi")
network_name=$2
cfg_get_wifi $network_name
;;
*)
network_name=$1
cfg_get_wifi $network_name
;;
esac

View file

@ -1,17 +0,0 @@
#
# Copyright (c) 2013 Qualcomm Atheros, Inc..
#
# All Rights Reserved.
# Qualcomm Atheros Confidential and Proprietary.
#
if [ "$ACTION" = "released" -a "$BUTTON" = "wps" ]; then
enable=`/sbin/uci -q get wsplcd.config.HyFiSecurity`
if [ -n "$enable" -a "$enable" -ne 0 ] ; then
echo "Push button event of 1905.1 AP Auto Configuration" > /dev/console
echo "wps_pbc $SEEN" > /var/run/wsplc.pipe &
echo "wps_pbc $SEEN" > /var/run/wsplc_sec.pipe &
fi
fi

View file

@ -1,67 +0,0 @@
config wsplcd config
option HyFiSecurity '0'
option 'ForceWextMode' '0'
# RunMode REGISTRAR, ENROLLEE, NONE or AUTO
option RunMode 'AUTO'
option DesignatedPBAP '0'
# WPSMethod WPS_M2 or WPS_M8
option WPSMethod 'WPS_M2'
option ConfigSta '1'
option SearchTimeout '60'
option WPSSessionTimeout '120'
option WPSRetransmitTimeout '5'
option WPSPerMessageTimeout '15'
option PushButtonTimeout '120'
option PBSearchTimeout '10'
option SSIDSuffix ''
option NetworkKey1905 ''
option UCPKSalt ''
# WPAPassphraseType LONG or SHORT
option WPAPassphraseType 'LONG'
# DebugLevel DUMP,DEBUG,INFO,ERROR
option DebugLevel 'ERROR'
option BandSel '0'
option BandChoice '5G'
option RMCollectTimeout '10'
option DeepClone '1'
option DeepClone_SON '1'
option DeepCloneNoBSSID '0'
option ManageVAPInd '1'
option Prefered5GLChannel '40'
option Prefered5GHChannel '149'
option Prefered6GChannel '33'
option EnableNBTLV '0'
option NBTLVbuff '0'
option ResponseRcvd '0'
# Following are configuration for 1.0 AP Cloning
option APCloning '0'
# ButtonMode ONEBUTTON or TWOBUTTON
option ButtonMode 'TWOBUTTON'
option CloneTimeout '180'
option WalkTimeout '120'
option RepeatTimeout '1'
option InternalTimeout '15'
option WaitOtherBandsSecs '20'
option WaitFirstBandSecs '30'
# Write debug log to file: NONE, APPEND, TRUNCATE
option WriteDebugLogToFile 'NONE'
# Config push restart and apply timeouts in secs
# Applicable to Registrar
option ConfigRestartShortTimeout '5'
# Applicable to Enrollee only
option ConfigRestartLongTimeout '15'
option ConfigApplyTimeout '30'
# Basic radio capability default values in hex
# These bytes will be used if radio has zero BSS
# Byte 1 : Maximum BSS support (0x02)
# Byte 2 : Operating class count (0x07)
# Byte 3 : Operating class (0x73)
# Byte 4 : Maximum transmit power (0xe2)
# Byte 5 : Number of non-operable channels (0x00)
# Refer AP Radio Basic Capabilities TLV format
option 5GBasic '02 07 73 e2 00 74 e2 00 75 e2 00 76 e2 00 77 e2 00 78 e2 00 80 e2 04 6a 7a 8a 9b'
option 2GBasic '02 03 51 e2 02 0c 0d 53 e2 00 54 e2 02 0c 0d'

View file

@ -1,979 +0,0 @@
#!/bin/sh /etc/rc.common
#
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2013, 2015-2018 Qualcomm Technologies, Inc.
#
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# 2013, 2015-2016 Qualcomm Atheros, Inc.
#
# All Rights Reserved.
# Qualcomm Atheros Confidential and Proprietary.
#
# @@-COPYRIGHT-END-@@
#
# shellcheck disable=SC2034
START=52
# shellcheck disable=SC2034
USE_PROCD=1
RESPAWN_THRESHOLD=120
RESPAWN_TIMEOUT=5
RESPAWN_RETRIES=10
SERVICE_PATH="/usr/sbin/wsplcd"
WSPLCD_CONFIG_FILE="/tmp/wsplcd.conf"
WSPLCD_CONFIG_FILE_PREFIX="/tmp/wsplcd"
WSPLCD_RUN_FILE="/var/run/.wsplcd"
config_load 'repacd'
config_get_bool ezmesh repacd 'Ezmesh' '0'
if [ "$ezmesh" -eq 1 ]; then
MAP='ezmesh'
else
MAP='hyd'
fi
NON_PBC_IFACES=
ZERO_WLAN_DEVICES=''
# Esy Mesh definitions
ieee1905_brguest_map=""
ieee1905_brbh=""
# This restart_* command is only intended to be used after a config change
#
EXTRA_COMMANDS="restart_after_config_change"
EXTRA_HELP=<<EOF
restart_after_config_change Restart triggered due to change in wireless configuration
EOF
. /lib/functions/hyfi-debug.sh
. /lib/functions/hyfi-iface.sh
. /lib/functions/hyfi-network.sh
. /lib/functions/whc-iface.sh
atf_ssidcmd_idx=1 atf_stacmd_idx=1 atf_groupcmd_idx=1 atf_radioparams_idx=1 cfg_changed=0
#check wsplcd config to enable/disable cfg80211
config_load 'wsplcd'
config_get_bool wsplcd_wxt config 'ForceWextMode' '0'
#check wireless config to enable/disable cfg80211 for wsplcd
wireless_cfg=
config_load 'wireless'
config_foreach __whc_check_wlan_cfg_mode wifi-device wireless_cfg
if [ "$wsplcd_wxt" == "0" -a "$wireless_cfg" == "1" ]; then
WSPLCD_CFG80211=-cfg80211
else
WSPLCD_CFG80211=
fi
wsplcd_cfg_append() {
local configfile=$2
echo "$1" >> "$configfile"
}
wsplcd_cfg_add_str() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_bool() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get_bool val config "$key" "$def"
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_debuglevel() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
case "$val" in
DUMP)
val='0'
;;
DEBUG)
val='1'
;;
INFO)
val='2'
;;
ERROR)
val='3'
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
__wsplcd_get_default_mode() {
local wan_iface
config_load network
config_get wan_iface wan ifname
if [ -n "$wan_iface" ]; then
eval "$1='REGISTRAR'"
else
eval "$1='ENROLLEE'"
fi
}
wsplcd_cfg_add_role() {
local cfg="$1"
local key="$2"
local configfile="$3"
local default_mode
local val
__wsplcd_get_default_mode default_mode
config_get val config "$key"
case "$val" in
REGISTRAR)
val='0'
;;
ENROLLEE)
val='1'
;;
NONE)
val='2'
;;
*)
if [ "$default_mode" = "REGISTRAR" ]; then
val='0'
else
val='1'
fi
uci_set wsplcd config "$key" "$default_mode"
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_wpsmethod() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
case "$val" in
WPS_M2)
val='M2'
;;
WPS_M8)
val='M8'
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_wpstxmode() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
case "$val" in
WPS_TX_ENCRYPTED)
val='encrypted'
;;
WPS_TX_NONE)
val='none'
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_wpsrxmode() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
case "$val" in
WPS_RX_ENCRYPTED)
val='encrypted'
;;
WPS_RX_EITHER)
val='either'
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_configsta() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
case "$val" in
1)
val='yes'
;;
0)
val='no'
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_wpatype() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
case "$val" in
LONG)
val='0'
;;
SHORT)
val='1'
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_buttonmode() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
case "$val" in
ONEBUTTON)
val='1'
;;
TWOBUTTON)
val='2'
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
__wsplcd_iterate_wlan_ifaces_nonpbc() {
local config="$1"
local iface network mode wps_pbc
config_get iface "$config" ifname
config_get network "$config" network
config_get mode "$config" mode
config_get_bool wps_pbc "$config" wps_pbc 0
if [ "$2" = "$network" ] && [ "$wps_pbc" -eq "0" ]; then
NON_PBC_IFACES="${NON_PBC_IFACES}${NON_PBC_IFACES:+","}${iface}"
fi
}
wsplcd_cfg_add_nonpbc() {
local br_name="$1"
local configfile="$2"
NON_PBC_IFACES=
config_load wireless
config_foreach __wsplcd_iterate_wlan_ifaces_nonpbc wifi-iface "$br_name"
if [ -n "$NON_PBC_IFACES" ]; then
wsplcd_cfg_append 'NonPBCInterfaces='$NON_PBC_IFACES "$configfile"
fi
}
wsplcd_cfg_add_guest_interface() {
local all_ifaces wlan_ifaces
local configfile=$1
local br_name_guest=$ieee1905_brguest_map
local br_name_bh=$ieee1905_brbh
# Add other bridge names and interface list to config file
if [ -n "$br_name_guest" ]; then
br_num=1
for br in $br_name_guest; do
wsplcd_cfg_append bridge$br_num=br-"$br" "$configfile"
# Get all WLAN interfaces bound to the managed bridge
hyfi_get_wlan_ifaces "$br" wlan_ifaces wlan_included_ifaces
if [ -n "$wlan_ifaces" ]; then
wsplcd_cfg_append '1905InterfacesWlan='"$wlan_ifaces" "$configfile"
fi
br_num=$((br_num+1))
done
fi
if [ -n "$br_name_bh" ]; then
# Append backhaul interface to config file
wsplcd_cfg_append backhaul="$br_name_bh" "$configfile"
# Get all WLAN interfaces bound to the managed bridge
hyfi_get_wlan_ifaces "$br_name_bh" wlan_ifaces wlan_included_ifaces
if [ -n "$wlan_ifaces" ]; then
wsplcd_cfg_append '1905InterfacesWlan='"$wlan_ifaces" "$configfile"
fi
fi
}
wsplcd_cfg_add_interface() {
local br_name=$1
local configfile="$2"
local wlan_ifaces wlan_included_ifaces ether_ifaces plc_iface non_wlan_ifaces
local wlan_vlan_ifaces
local wlan_zero_radios
local basic2g
local basic5g
local is_zerobss_enabled
wsplcd_cfg_append 'bridge=br-'"$br_name" "$configfile"
# Get all WLAN interfaces bound to the managed bridge
hyfi_get_wlan_ifaces "$br_name" wlan_ifaces wlan_included_ifaces
wsplcd_cfg_append '1905InterfacesWlan='"$wlan_ifaces" "$configfile"
config_load $MAP
config_get is_zerobss_enabled MultiAP 'EnableZeroBss' '0'
if [ $is_zerobss_enabled -eq 1 ]; then
get_wlan_radio_zero_bss_string "$br_name" wlan_zero_radios
wsplcd_cfg_append 'ZeroWlanInterfaces='"$wlan_zero_radios" "$configfile"
config_load wsplcd
config_get basic5g config 5GBasic ''
config_get basic2g config 2GBasic ''
wsplcd_cfg_append '5GBasic='"$basic5g" "$configfile"
wsplcd_cfg_append '2GBasic='"$basic2g" "$configfile"
wsplcd_cfg_append 'IsZeroBssEnabled='"1" "$configfile"
fi
# Get all WLAN VLAN interfaces bound to the managed bridge
hyfi_get_wlan_vlan_ifaces "$br_name" wlan_vlan_ifaces
# Get all Ethernet interfaces and PLC interface
hyfi_get_ether_ifaces "$br_name" ether_ifaces
hyfi_get_plc_iface "$br_name" plc_iface
if [ -n "${plc_iface}" ] ; then
non_wlan_ifaces=${ether_ifaces}${ether_ifaces:+","}${plc_iface}
else
non_wlan_ifaces=${ether_ifaces}
fi
if [ -n "${wlan_vlan_ifaces}" ] ; then
non_wlan_ifaces=${non_wlan_ifaces}${non_wlan_ifaces:+","}${wlan_vlan_ifaces}
fi
non_wlan_ifaces=$(echo "$non_wlan_ifaces" | sed 's/ESWITCH/ETHER/g')
wsplcd_cfg_append '1905InterfacesElse='"$non_wlan_ifaces" "$configfile"
wsplcd_cfg_add_nonpbc "$br_name" "$configfile"
}
wsplcd_atf_re_mac_cfg() {
local configfile="$3"
local cfg
local val
cfg="REmac"
config_get val "$1" "$cfg"
[ -n "$val" ] && wsplcd_cfg_append "${2}${cfg}_entry=$val" "$configfile"
}
wsplcd_getlist_atf_grpssid() {
local val="$1"
local configfile="$2"
wsplcd_cfg_append "${2}group_ssid_${atf_groupcmd_idx}=$val" "$configfile"
numssid=$((numssid + 1))
}
wsplcd_atf_group_cfg() {
local cfg
local grpname
local cmd
local dev
local val
local numssid
local status
local cmdidx=$atf_groupcmd_idx
local config=$1
local prefix=$2
local configfile="$3"
while :; do
cfg="group_wifidev"
config_get dev "$1" "$cfg"
[ -n "$dev" ] || break
wsplcd_cfg_append "${2}group_wifidev_${cmdidx}=$dev" "$configfile"
cfg="group_enable"
config_get status "$1" "$cfg"
if [ -n "$status" ]; then
wsplcd_cfg_append "${2}group_enable_${cmdidx}=$status" "$configfile"
fi
cfg="group"
config_get grpname "$1" "$cfg"
[ -n "$grpname" ] || break
cfg="group_cmd"
config_get cmd "$1" "$cfg"
[ -n "$cmd" ] || break
cfg="group_val"
config_get val "$1" "$cfg"
echo "group_val $val"
if [ -z "$val" ] && [ "$cmd" == "addgroup" ]; then
break
fi
cfg="group_ssid"
numssid=0
config_list_foreach "$config" "group_ssid" wsplcd_getlist_atf_grpssid "$prefix"
if [ $numssid -eq 0 ] && [ "$cmd" == "addgroup" ]; then
break
fi
wsplcd_cfg_append "${2}group_entry_${cmdidx}=$grpname" "$configfile"
wsplcd_cfg_append "${2}group_cmd_${cmdidx}=$cmd" "$configfile"
if [ -n "$val" ]; then
wsplcd_cfg_append "${2}group_val_${cmdidx}=$val" "$configfile"
fi
cmdidx=$((cmdidx + 1))
break
done
atf_groupcmd_idx=$cmdidx
}
wsplcd_atf_ssid_cfg() {
local cfg
local ssid
local cmd
local dev
local val
local cmdidx=$atf_ssidcmd_idx
local configfile=$3
while :; do
cfg="ssid"
config_get ssid "$1" "$cfg"
[ -n "$ssid" ] || break
cfg="ssid_cmd"
config_get cmd "$1" "$cfg"
[ -n "$cmd" ] || break
cfg="ssid_wifidev"
config_get dev "$1" "$cfg"
[ -n "$dev" ] || break
cfg="ssid_val"
config_get val "$1" "$cfg"
if [ -z "$val" ] && [ "$cmd" == "addssid" ]; then
break
fi
wsplcd_cfg_append "${2}ssid_entry_${cmdidx}=$ssid" "$configfile"
wsplcd_cfg_append "${2}ssid_cmd_${cmdidx}=$cmd" "$configfile"
wsplcd_cfg_append "${2}ssid_wifidev_${cmdidx}=$dev" "$configfile"
wsplcd_cfg_append "${2}ssid_val_${cmdidx}=$val" "$configfile"
cmdidx=$((cmdidx + 1))
break
done
atf_ssidcmd_idx=$cmdidx
}
wsplcd_atf_sta_cfg() {
local cfg
local stamac
local cmd
local dev
local val
local ssid
local cmdidx=$atf_stacmd_idx
local configfile=$3
while :; do
cfg="sta"
config_get stamac "$1" "$cfg"
[ -n "$stamac" ] || break
cfg="sta_cmd"
config_get cmd "$1" "$cfg"
[ -n "$cmd" ] || break
cfg="sta_wifidev"
config_get dev "$1" "$cfg"
[ -n "$dev" ] || break
cfg="sta_val"
config_get val "$1" "$cfg"
if [ -z "$val" ] && [ "$cmd" == "addsta" ]; then
break
fi
cfg="sta_ssid"
config_get ssid "$1" "$cfg"
wsplcd_cfg_append "${2}sta_entry_${cmdidx}=$stamac" "$configfile"
wsplcd_cfg_append "${2}sta_cmd_${cmdidx}=$cmd" "$configfile"
wsplcd_cfg_append "${2}sta_wifidev_${cmdidx}=$dev" "$configfile"
wsplcd_cfg_append "${2}sta_val_${cmdidx}=$val" "$configfile"
wsplcd_cfg_append "${2}sta_ssid_${cmdidx}=$ssid" "$configfile"
cmdidx=$((cmdidx + 1))
break
done
atf_stacmd_idx=$cmdidx
}
wsplcd_parse_re_atf_config() {
local cfg
local val
local config=$1
local configfile=$4
cfg="REname"
config_get val "$1" "$cfg"
if [ -n "$val" ] && [ "$val" == "$2" ] ; then
#Get ATF SSID Config
wsplcd_atf_ssid_cfg "$config" "$3" "$configfile"
#Get ATF STA Config
wsplcd_atf_sta_cfg "$config" "$3" "$configfile"
#Get ATF Group Config
wsplcd_atf_group_cfg "$config" "$3" "$configfile"
fi
}
wsplcd_parse_radioparams_atfconfig() {
local cfg
local val
local config=$1
local configfile=$4
cfg="REname"
config_get val "$1" "$cfg"
if [ -n "$val" ] && [ "$val" == "$2" ] ; then
#Get Radio name
cfg="radio_name"
config_get val "$1" "$cfg"
if [ -n "$val" ] ; then
wsplcd_cfg_append "${3}radio_name_${atf_radioparams_idx}=$val" "$configfile"
fi
#Get ATF scheduling policy
cfg="sched_policy"
config_get val "$1" "$cfg"
if [ -n "$val" ] ; then
wsplcd_cfg_append "${3}radio_sched_${atf_radioparams_idx}=$val" "$configfile"
fi
#Get ATF OBSS scheduling (0/1)
cfg="sched_obss_enable"
config_get val "$1" "$cfg"
if [ -n "$val" ] ; then
wsplcd_cfg_append "${3}radio_obss_${atf_radioparams_idx}=$val" "$configfile"
fi
#Get ATF Inter group policy
cfg="sched_group_policy"
config_get val "$1" "$cfg"
if [ -n "$val" ] ; then
wsplcd_cfg_append "${3}radio_grouppolicy_${atf_radioparams_idx}=$val" "$configfile"
fi
atf_radioparams_idx=$((atf_radioparams_idx + 1))
fi
}
wsplcd_parse_atf_config() {
local cfg
local prefix
local rename
local config=$1
local configfile=$2
repeater_id=$((repeater_id + 1))
prefix="ATF.RE${repeater_id}_"
cfg="REname"
config_get rename "$1" "$cfg"
#Get RE MAC
wsplcd_atf_re_mac_cfg "$config" $prefix "$configfile"
#reset command indexes for each repeater entry
atf_ssidcmd_idx=1
atf_stacmd_idx=1
atf_groupcmd_idx=1
atf_radioparams_idx=1
#Parse re-config section & get atf configuration
config_load wsplcd
config_foreach wsplcd_parse_re_atf_config atf-re-config "$rename" $prefix "$configfile"
config_foreach wsplcd_parse_radioparams_atfconfig atf-re-radioparams-config "$rename" $prefix "$configfile"
}
wsplcd_cfg_add_atf() {
local cfg="$1"
local key="$2"
local def="$3"
local val
local repeater_id=0
local configfile=$4
config_get_bool val config "$key" "$def"
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
#Read ATF Params if ATF config is enabled
if [ -n "$val" ] && [ "$val" == 1 ] ; then
config_load wsplcd
config_foreach wsplcd_parse_atf_config atf-config "$configfile"
fi
}
wsplcd_create_config() {
lock /var/run/wsplcd.lock
local br_name=$1
local configfile=$2
config_get map_enable config 'MapEnable' '0'
config_get num_vlan_supported config 'NumberOfVLANSupported' '0'
config_load repacd
config_get TS_enabled repacd 'TrafficSeparationEnabled' '0'
if [ "$map_enable" -ge 2 ] && [ "$num_vlan_supported" -gt 0 ]; then
# Get the Guest Bridge Names
hyfi_get_ieee1905_brguest_map ieee1905_brguest_map ieee1905_brbh
else
if [ "$ieee1905managed_bridge" == "$br_name" -a "$TS_enabled" == "1" -a "$map_enable" -eq 0 ]; then
ieee1905_brbh="backhaul"
else
ieee1905_brbh=
fi
fi
echo "# Config file for wsplcd, automatically created by script" > "$configfile"
wsplcd_cfg_add_debuglevel debug_level DebugLevel 'ERROR' "$configfile"
wsplcd_cfg_add_interface "$br_name" "$configfile"
wsplcd_cfg_add_guest_interface $configfile
wsplcd_cfg_add_role role RunMode "$configfile"
wsplcd_cfg_add_bool designated_pb_ap DesignatedPBAP '0' "$configfile"
wsplcd_cfg_add_wpsmethod WPS_method WPSMethod 'WPS_M2' "$configfile"
wsplcd_cfg_add_wpstxmode WPS_tx_mode TXMode 'WPS_TX_ENCRYPTED' "$configfile"
wsplcd_cfg_add_wpsrxmode WPS_rx_mode RXMode 'WPS_RX_ENCRYPTED' "$configfile"
wsplcd_cfg_add_configsta config_station ConfigSta '1' "$configfile"
wsplcd_cfg_add_str ssid_suffix SSIDSuffix '' "$configfile"
wsplcd_cfg_add_str search_timeout SearchTimeout '60' "$configfile"
wsplcd_cfg_add_str WPS_session_timeout WPSSessionTimeout '120' "$configfile"
wsplcd_cfg_add_str WPS_retransmission_timeout WPSRetransmitTimeout '5' "$configfile"
wsplcd_cfg_add_str WPS_per_message_timeout WPSPerMessageTimeout '15' "$configfile"
wsplcd_cfg_add_bool band_sel_enable BandSel '1' "$configfile"
wsplcd_cfg_add_bool band_choice BandChoice '5G' "$configfile"
wsplcd_cfg_add_str rm_collect_timeout RMCollectTimeout '10' "$configfile"
wsplcd_cfg_add_str prefered_low_channel Prefered5GLChannel '40' "$configfile"
wsplcd_cfg_add_str prefered_high_channel Prefered5GHChannel '149' "$configfile"
wsplcd_cfg_add_str prefered_6g_channel Prefered6GChannel '33' "$configfile"
wsplcd_cfg_add_bool EnableNBTLV EnableNBTLV '0' "$configfile"
wsplcd_cfg_add_str NBTLVbuff NBTLVbuff '0' "$configfile"
wsplcd_cfg_add_bool deep_clone_enable DeepClone '1' "$configfile"
wsplcd_cfg_add_bool deep_clone_no_bssid DeepCloneNoBSSID '0' "$configfile"
wsplcd_cfg_add_bool manage_vap_ind ManageVAPInd '1' "$configfile"
wsplcd_cfg_add_str 1905Nwkey NetworkKey1905 '' "$configfile"
wsplcd_cfg_add_str ucpk_salt UCPKSalt '' "$configfile"
wsplcd_cfg_add_wpatype wpa_passphrase_type WPAPassphraseType 'LONG' "$configfile"
wsplcd_cfg_append 'config_methods=push_button virtual_push_button physical_push_button' "$configfile"
wsplcd_cfg_append 'manufacturer=Qualcomm Atheros' "$configfile"
wsplcd_cfg_append 'model_name=ModelNameHere' "$configfile"
wsplcd_cfg_append 'model_number=ModelNumberHere' "$configfile"
wsplcd_cfg_append 'serial_number=SerialNumberHere' "$configfile"
wsplcd_cfg_append 'device_type=6-0050f204-1' "$configfile"
wsplcd_cfg_append 'device_name=ExampleWpa' "$configfile"
wsplcd_cfg_append 'os_version=01020300' "$configfile"
wsplcd_cfg_append '#AP Cloning 1.0 parameters' "$configfile"
wsplcd_cfg_add_bool APCloning APCloning '0' "$configfile"
wsplcd_cfg_add_str MapEnable MapEnable '0' "$configfile"
wsplcd_cfg_add_bool MapPFCompliant MapPFCompliant '0' "$configfile"
wsplcd_cfg_add_bool Map2TSSetFromHYD Map2TSSetFromHYD '0' "$configfile"
wsplcd_cfg_add_bool Map2EnableMboOcePmf Map2EnableMboOcePmf '0' "$configfile"
wsplcd_cfg_add_bool MapConfigServiceEnabled MapConfigServiceEnabled "$mapConfigServiceEnabled" "$configfile"
wsplcd_cfg_add_str NumberOfVLANSupported NumberOfVLANSupported '0' "$configfile"
wsplcd_cfg_add_str Map2TrafficSepEnabled Map2TrafficSepEnabled '0' "$configfile"
wsplcd_cfg_add_str CombinedR1R2Backhaul CombinedR1R2Backhaul '0' "$configfile"
wsplcd_cfg_add_str MapMaxBss MapMaxBss '0' "$configfile"
wsplcd_cfg_add_buttonmode button_mode ButtonMode 'TWOBUTTON' "$configfile"
wsplcd_cfg_add_str clone_timeout CloneTimeout '180' "$configfile"
wsplcd_cfg_add_str walk_timeout WalkTimeout '120' "$configfile"
wsplcd_cfg_add_str repeat_timeout RepeatTimeout '1' "$configfile"
wsplcd_cfg_add_str internal_timeout InternalTimeout '15' "$configfile"
wsplcd_cfg_add_str wait_wifi_config_secs_other WaitOtherBandsSecs '20' "$configfile"
wsplcd_cfg_add_str wait_wifi_config_secs_first WaitFirstBandSecs '30' "$configfile"
wsplcd_cfg_add_atf atf_config_en atfConfigEnable '0' "$configfile"
wsplcd_cfg_append "cfg_changed=$cfg_changed" "$configfile"
wsplcd_cfg_add_str EnableMemDebug EnableMemDebug '0' "$configfile"
wsplcd_cfg_add_str MemDbgAuditingOnly MemDbgAuditingOnly '0' "$configfile"
wsplcd_cfg_add_str MemDbgDisableModule MemDbgDisableModule '0' "$configfile"
wsplcd_cfg_add_str MemDbgFreedMemCount MemDbgFreedMemCount '0' "$configfile"
wsplcd_cfg_add_str MemDbgWriteLogToFile MemDbgWriteLogToFile '0' "$configfile"
wsplcd_cfg_add_str MemDbgEnableFilter MemDbgEnableFilter '0' "$configfile"
wsplcd_cfg_add_str MemDbgFilterFileName MemDbgFilterFileName '0' "$configfile"
wsplcd_cfg_add_str MemDbgReportInterval MemDbgReportInterval '0' "$configfile"
local cfg_restart_long_timeout
local cfg_restart_short_timeout
local cfg_apply_timeout
config_get cfg_restart_long_timeout config "ConfigRestartLongTimeout" "20"
config_get cfg_restart_short_timeout config "ConfigRestartShortTimeout" "5"
config_get cfg_apply_timeout config "ConfigApplyTimeout" "10"
wsplcd_cfg_append "cfg_restart_long_timeout=$cfg_restart_long_timeout" "$configfile"
wsplcd_cfg_append "cfg_restart_short_timeout=$cfg_restart_short_timeout" "$configfile"
wsplcd_cfg_append "cfg_apply_timeout=$cfg_apply_timeout" "$configfile"
wsplcd_cfg_append "TrafficSeparationEnabled=$TS_enabled" "$configfile"
[ -x "/sbin/uci2cfg.sh" ] && {
/sbin/uci2cfg.sh "$br_name" >> "$configfile"
/sbin/uci2cfg.sh wifisec "$br_name" > "/tmp/.wsplc.wifisec"
if [ -n "$ieee1905_brguest_map" ]; then
for br in $ieee1905_brguest_map; do
hyfi_get_wlan_ifaces "$br" wlan_ifaces wlan_included_ifaces
if [ -n "$wlan_ifaces" ]; then
/sbin/uci2cfg.sh "$br" >> "$configfile"
fi
done
fi
if [ -n "$ieee1905_brbh" ]; then
hyfi_get_wlan_ifaces "$ieee1905_brbh" wlan_ifaces wlan_included_ifaces
if [ -n "$wlan_ifaces" ]; then
/sbin/uci2cfg.sh "$ieee1905_brbh" > "/tmp/backhaul_bridge"
#To avoid duplicate RADIO.X entry grep WLAN while including backhaul VAP config
cat "/tmp/backhaul_bridge" | grep WLAN >> "$configfile"
rm /tmp/backhaul_bridge
fi
fi
}
lock -u /var/run/wsplcd.lock
return 0
}
__wsplcd_wlanif_ready() {
local vif vifs
local vifstat
local configfile=$1
vifs=$(grep '^1905InterfacesWlan=' "$configfile" | sed -e 's/1905InterfacesWlan=//' -e 's/@[a-zA-Z0-9]*//g' -e 's/,/ /g' -e 's/:WLAN//g' -e 's/&[a-zA-Z0-9]*//g')
if [ -z "$vifs" ]; then
echo "[wsplcd]WLAN interface is not ready" > /dev/console
return 0
fi
for vif in $vifs; do
vifstat=$(ifconfig "$vif" 2>/dev/null)
if [ -z "$vifstat" ]; then
echo "[wsplcd]WLAN interface $vif is not ready" > /dev/console
return 0
fi
done
return 1
}
start_service() {
local enabled
local ieee1905managed_bridge
local ieee1905managed_bridge2
local log_mode
local map_enable
local map_mode=''
local map_policy_file=''
local allow_zero_ap_interfaces
config_load 'wsplcd'
config_get_bool enabled config 'HyFiSecurity' '0'
[ "$enabled" -gt 0 ] || {
return 1
}
config_load $MAP
config_get_bool mapConfigServiceEnabled MAPConfigSettings 'EnableConfigService' '0'
config_get_bool mapRoleController MAPConfigSettings 'RoleController' '0'
if [ "$mapRoleController" -eq 0 -a "$mapConfigServiceEnabled" -eq 1 ]; then
hyfi_echo wsplcd "MAP Config Service Enabled . Not Starting Wsplcd on Agent"
return 1
fi
config_get log_mode config "WriteDebugLogToFile" "NONE"
case "$log_mode" in
NONE)
log_mode=''
;;
APPEND)
log_mode='-a'
;;
TRUNCATE)
log_mode='-w'
;;
esac
config_get map_enable config 'MapEnable' '0'
if [ "$map_enable" -gt 0 ]; then
config_get map_policy_file config 'MapGenericPolicyFile'
if [ -n "$map_policy_file" ]; then
map_mode='-M'
else
config_get map_policy_file config 'MapPolicyFile' '/etc/config/map.conf'
map_mode='-m'
fi
fi
# Get the IEEE1905.1 managed bridge name
hyfi_get_ieee1905_managed_iface ieee1905managed_bridge ieee1905managed_bridge2
if [ "$map_enable" -gt 0 ] && [ -n "$ieee1905managed_bridge2" ]; then
hyfi_echo wsplcd "MAP mode only supports a single bridge"
return 1
fi
wsplcd_create_config "$ieee1905managed_bridge" "${WSPLCD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge}.conf" || return 1
if [ -n "$ieee1905managed_bridge2" ]
then
wsplcd_create_config "$ieee1905managed_bridge2" "${WSPLCD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge2}.conf" || return 1
fi
config_get allow_zero_ap_interfaces config 'AllowZeroAPInterfaces' '0'
__wsplcd_wlanif_ready "${WSPLCD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge}.conf"
if [ $? -eq 1 ] || [ "$allow_zero_ap_interfaces" -gt 0 ]; then
hyfi_echo wsplcd "starting daemon"
procd_open_instance
procd_set_param command ${SERVICE_PATH} -c "${WSPLCD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge}.conf" "$log_mode" "$map_mode" "$map_policy_file" $WSPLCD_CFG80211
procd_set_param respawn ${RESPAWN_THRESHOLD} ${RESPAWN_TIMEOUT} ${RESPAWN_RETRIES}
procd_add_reload_trigger "$MAP" "lbd"
procd_close_instance
if [ -n "$ieee1905managed_bridge2" ]
then
procd_open_instance
procd_set_param command ${SERVICE_PATH} -c "${WSPLCD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge2}.conf" "$log_mode" -i1 $WSPLCD_CFG80211
procd_set_param respawn ${RESPAWN_THRESHOLD} ${RESPAWN_TIMEOUT} ${RESPAWN_RETRIES}
procd_add_reload_trigger "$MAP" "lbd"
procd_close_instance
fi
fi
touch $WSPLCD_RUN_FILE
}
stop_service() {
# Save aside the old config file just for debugging purposes.
[ -f "$WSPLCD_CONFIG_FILE" ] &&
mv ${WSPLCD_CONFIG_FILE} ${WSPLCD_CONFIG_FILE}.bak &&
rm ${WSPLCD_CONFIG_FILE_PREFIX}-*.conf
}
restart_after_config_change() {
[ -f "$WSPLCD_RUN_FILE" ] || return
hyfi_lock
# No longer have an explicit stop function since we are now using
# procd, so do an explicit stop via the init script.
/etc/init.d/wsplcd stop
cfg_changed=1
start
hyfi_unlock
}
# input: $1 radio device as uci section
# input: $2 network name
# output: $3 zero bss string to be used in wsplcd.conf
wsplcd_get_zero_wlan_radios() {
local radio="$1"
local network="$2"
local cnt=0
local band=''
config_load wireless
config_get hwmode $radio 'hwmode' ''
if [ $hwmode = "11axa" -o $hwmode = "11a" -o $hwmode = "11na" ]; then
band=5
elif [ $hwmode = "11axg" -o $hwmode = "11b" -o $hwmode = "11ng" ]; then
band=2
fi
config_foreach __wsplcd_get_zero_wlan_ifaces wifi-iface "$radio" cnt $network
if [ $cnt -eq 0 ]; then
ZERO_WLAN_DEVICES="${ZERO_WLAN_DEVICES}${ZERO_WLAN_DEVICES:+","}@${radio}-${band}&${network}:WLAN"
eval "$3='$ZERO_WLAN_DEVICES'"
fi
}
# input: $1 vap interface as uci section
# input: $2 wifi radio device
# output: $3 number of vaps count
# input: $4 network
__wsplcd_get_zero_wlan_ifaces() {
local config="$1"
local radio="$2"
local count="$3"
local net="$4"
local iface network disabled device
config_get iface "$config" ifname
config_get network "$config" network
config_get disabled "$config" disabled '0'
config_get device "$config" device
config_get mapEnable "$config" map
config_get mode "$config" mode
if [ "$mode" = "ap" ]; then
if [ -n "$iface" ] && [ "$disabled" -eq 0 ] &&
[ "$device" = "$radio" ]; then
count=$((count + 1))
eval "$3='$count'"
fi
fi
}
# input: $1 network
# output: $2 zero bss string to be used in wsplcd.conf
get_wlan_radio_zero_bss_string() {
local network="$1"
local zero_radios=""
config_load wireless
config_foreach wsplcd_get_zero_wlan_radios wifi-device "$network" zero_radios
eval "$2='$zero_radios'"
}

View file

@ -1,854 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (c) 2016, 2018 Qualcomm Technologies, Inc.
#
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# 2016 Qualcomm Atheros, Inc.
#
# All Rights Reserved.
# Qualcomm Atheros Confidential and Proprietary.
START=52
SERVICE_WRITE_PID=1
SERVICE_DAEMONIZE=1
#SERVICE_DEBUG=1
SERVICE_DEBUG_OUTPUT=0
SERVICE_PATH="/usr/sbin/wsplcd"
WSPLCD_CONFIG_FILE="/tmp/wsplcd.conf"
WSPLCD_CONFIG_FILE_PREFIX="/tmp/wsplcd"
WSPLCD_RUN_FILE="/var/run/.wsplcd"
NON_PBC_IFACES=
# Easy Mesh Definitions
ieee1905_brguest_map=""
ieee1905_brbh=""
# This restart_* command is only intended to be used after a config change
#
EXTRA_COMMANDS="restart_after_config_change"
EXTRA_HELP=<<EOF
restart_after_config_change Restart triggered due to change in wireless configuration
EOF
#check wsplcd config to enable/disable cfg80211
config_load 'wsplcd'
config_get_bool wsplcd_cfg config 'cfg80211_enable' '0'
if [ "$wsplcd_cfg" == "1" ]; then
WSPLCD_CFG80211=-cfg80211
else
WSPLCD_CFG80211=
fi
. /lib/functions/hyfi-debug.sh
. /lib/functions/hyfi-iface.sh
. /lib/functions/hyfi-network.sh
atf_ssidcmd_idx=1 atf_stacmd_idx=1 atf_groupcmd_idx=1 atf_radioparams_idx=1 cfg_changed=0
wsplcd_cfg_append() {
local configfile=$2
echo "$1" >> "$configfile"
}
wsplcd_cfg_add_str() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_bool() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get_bool val config "$key" "$def"
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_debuglevel() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
case "$val" in
DUMP)
val='0'
;;
DEBUG)
val='1'
;;
INFO)
val='2'
;;
ERROR)
val='3'
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
__wsplcd_get_default_mode() {
local wan_iface
config_load network
config_get wan_iface wan ifname
if [ -n "$wan_iface" ]; then
eval "$1='REGISTRAR'"
else
eval "$1='ENROLLEE'"
fi
}
wsplcd_cfg_add_role() {
local cfg="$1"
local key="$2"
local configfile="$3"
local default_mode
local val
__wsplcd_get_default_mode default_mode
config_get val config "$key"
case "$val" in
REGISTRAR)
val='0'
;;
ENROLLEE)
val='1'
;;
NONE)
val='2'
;;
*)
if [ "$default_mode" = "REGISTRAR" ]; then
val='0'
else
val='1'
fi
uci_set wsplcd config "$key" "$default_mode"
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_wpsmethod() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
case "$val" in
WPS_M2)
val='M2'
;;
WPS_M8)
val='M8'
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_wpstxmode() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
case "$val" in
WPS_TX_ENCRYPTED)
val='encrypted'
;;
WPS_TX_NONE)
val='none'
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_wpsrxmode() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
case "$val" in
WPS_RX_ENCRYPTED)
val='encrypted'
;;
WPS_RX_EITHER)
val='either'
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_configsta() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
case "$val" in
1)
val='yes'
;;
0)
val='no'
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_wpatype() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
case "$val" in
LONG)
val='0'
;;
SHORT)
val='1'
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
wsplcd_cfg_add_buttonmode() {
local cfg="$1"
local key="$2"
local def="$3"
local configfile="$4"
local val
config_get val config "$key" "$def"
case "$val" in
ONEBUTTON)
val='1'
;;
TWOBUTTON)
val='2'
;;
esac
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
}
__wsplcd_iterate_wlan_ifaces_nonpbc() {
local config="$1"
local iface network mode wps_pbc
config_get iface "$config" ifname
config_get network "$config" network
config_get mode "$config" mode
config_get_bool wps_pbc "$config" wps_pbc 0
if [ "$2" = "$network" ] && [ "$wps_pbc" -eq "0" ]; then
NON_PBC_IFACES="${NON_PBC_IFACES}${NON_PBC_IFACES:+","}${iface}"
fi
}
wsplcd_cfg_add_nonpbc() {
local br_name="$1"
local configfile="$2"
NON_PBC_IFACES=
config_load wireless
config_foreach __wsplcd_iterate_wlan_ifaces_nonpbc wifi-iface "$br_name"
if [ -n "$NON_PBC_IFACES" ]; then
wsplcd_cfg_append 'NonPBCInterfaces='$NON_PBC_IFACES "$configfile"
fi
}
wsplcd_cfg_add_guest_interface() {
local all_ifaces wlan_ifaces
local configfile=$1
local br_name_guest=$ieee1905_brguest_map
local br_name_bh=$ieee1905_brbh
# Add other bridge names and interface list to config file
if [ -n "$br_name_guest" ]; then
br_num=1
for br in $br_name_guest; do
wsplcd_cfg_append bridge$br_num=br-"$br" "$configfile"
# Get all WLAN interfaces bound to the managed bridge
hyfi_get_wlan_ifaces "$br" wlan_ifaces wlan_included_ifaces
if [ -n "$wlan_ifaces" ]; then
wsplcd_cfg_append '1905InterfacesWlan='"$wlan_ifaces" "$configfile"
fi
br_num=$((br_num+1))
done
fi
if [ -n "$br_name_bh" ]; then
# Append backhaul interface to config file
wsplcd_cfg_append backhaul="$br_name_bh" "$configfile"
# Get all WLAN interfaces bound to the managed bridge
hyfi_get_wlan_ifaces "$br_name_bh" wlan_ifaces wlan_included_ifaces
if [ -n "$wlan_ifaces" ]; then
wsplcd_cfg_append '1905InterfacesWlan='"$wlan_ifaces" "$configfile"
fi
fi
}
wsplcd_cfg_add_interface() {
local br_name=$1
local configfile="$2"
local wlan_ifaces wlan_included_ifaces ether_ifaces plc_iface non_wlan_ifaces
local wlan_vlan_ifaces
wsplcd_cfg_append 'bridge=br-'"$br_name" "$configfile"
# Get all WLAN interfaces bound to the managed bridge
hyfi_get_wlan_ifaces $br_name wlan_ifaces wlan_included_ifaces
wsplcd_cfg_append '1905InterfacesWlan='$wlan_ifaces $configfile
# Get all WLAN VLAN interfaces bound to the managed bridge
hyfi_get_wlan_vlan_ifaces "$br_name" wlan_vlan_ifaces
# Get all Ethernet interfaces and PLC interface
hyfi_get_ether_ifaces "$br_name" ether_ifaces
hyfi_get_plc_iface "$br_name" plc_iface
if [ -n "${plc_iface}" ] ; then
non_wlan_ifaces=${ether_ifaces}${ether_ifaces:+","}${plc_iface}
else
non_wlan_ifaces=${ether_ifaces}
fi
if [ -n "${wlan_vlan_ifaces}" ] ; then
non_wlan_ifaces=${non_wlan_ifaces}${non_wlan_ifaces:+","}${wlan_vlan_ifaces}
fi
non_wlan_ifaces=$(echo "$non_wlan_ifaces" | sed 's/ESWITCH/ETHER/g')
wsplcd_cfg_append '1905InterfacesElse='"$non_wlan_ifaces" "$configfile"
wsplcd_cfg_add_nonpbc "$br_name" "$configfile"
}
wsplcd_atf_re_mac_cfg() {
local configfile="$3"
local cfg
local val
cfg="REmac"
config_get val "$1" "$cfg"
[ -n "$val" ] && wsplcd_cfg_append "${2}${cfg}_entry=$val" "$configfile"
}
wsplcd_getlist_atf_grpssid() {
local val="$1"
local configfile="$2"
wsplcd_cfg_append "${2}group_ssid_${atf_groupcmd_idx}=$val" "$configfile"
numssid=$((numssid + 1))
}
wsplcd_atf_group_cfg() {
local cfg
local grpname
local cmd
local dev
local val
local numssid
local status
local cmdidx=$atf_groupcmd_idx
local config=$1
local prefix=$2
local configfile="$3"
while :; do
cfg="group_wifidev"
config_get dev "$1" "$cfg"
[ -n "$dev" ] || break
wsplcd_cfg_append "${2}group_wifidev_${cmdidx}=$dev" "$configfile"
cfg="group_enable"
config_get status "$1" "$cfg"
if [ -n "$status" ]; then
wsplcd_cfg_append "${2}group_enable_${cmdidx}=$status" "$configfile"
fi
cfg="group"
config_get grpname "$1" "$cfg"
[ -n "$grpname" ] || break
cfg="group_cmd"
config_get cmd "$1" "$cfg"
[ -n "$cmd" ] || break
cfg="group_val"
config_get val "$1" "$cfg"
echo "group_val $val"
if [ -z "$val" ] && [ "$cmd" == "addgroup" ]; then
break
fi
cfg="group_ssid"
numssid=0
config_list_foreach "$config" "group_ssid" wsplcd_getlist_atf_grpssid "$prefix"
if [ $numssid -eq 0 ] && [ "$cmd" == "addgroup" ]; then
break
fi
wsplcd_cfg_append "${2}group_entry_${cmdidx}=$grpname" "$configfile"
wsplcd_cfg_append "${2}group_cmd_${cmdidx}=$cmd" "$configfile"
if [ -n "$val" ]; then
wsplcd_cfg_append "${2}group_val_${cmdidx}=$val" "$configfile"
fi
cmdidx=$((cmdidx + 1))
break
done
atf_groupcmd_idx=$cmdidx
}
wsplcd_atf_ssid_cfg() {
local cfg
local ssid
local cmd
local dev
local val
local cmdidx=$atf_ssidcmd_idx
local configfile=$3
while :; do
cfg="ssid"
config_get ssid "$1" "$cfg"
[ -n "$ssid" ] || break
cfg="ssid_cmd"
config_get cmd "$1" "$cfg"
[ -n "$cmd" ] || break
cfg="ssid_wifidev"
config_get dev "$1" "$cfg"
[ -n "$dev" ] || break
cfg="ssid_val"
config_get val "$1" "$cfg"
if [ -z "$val" ] && [ "$cmd" == "addssid" ]; then
break
fi
wsplcd_cfg_append "${2}ssid_entry_${cmdidx}=$ssid" "$configfile"
wsplcd_cfg_append "${2}ssid_cmd_${cmdidx}=$cmd" "$configfile"
wsplcd_cfg_append "${2}ssid_wifidev_${cmdidx}=$dev" "$configfile"
wsplcd_cfg_append "${2}ssid_val_${cmdidx}=$val" "$configfile"
cmdidx=$((cmdidx + 1))
break
done
atf_ssidcmd_idx=$cmdidx
}
wsplcd_atf_sta_cfg() {
local cfg
local stamac
local cmd
local dev
local val
local ssid
local cmdidx=$atf_stacmd_idx
local configfile=$3
while :; do
cfg="sta"
config_get stamac "$1" "$cfg"
[ -n "$stamac" ] || break
cfg="sta_cmd"
config_get cmd "$1" "$cfg"
[ -n "$cmd" ] || break
cfg="sta_wifidev"
config_get dev "$1" "$cfg"
[ -n "$dev" ] || break
cfg="sta_val"
config_get val "$1" "$cfg"
if [ -z "$val" ] && [ "$cmd" == "addsta" ]; then
break
fi
cfg="sta_ssid"
config_get ssid "$1" "$cfg"
wsplcd_cfg_append "${2}sta_entry_${cmdidx}=$stamac" "$configfile"
wsplcd_cfg_append "${2}sta_cmd_${cmdidx}=$cmd" "$configfile"
wsplcd_cfg_append "${2}sta_wifidev_${cmdidx}=$dev" "$configfile"
wsplcd_cfg_append "${2}sta_val_${cmdidx}=$val" "$configfile"
wsplcd_cfg_append "${2}sta_ssid_${cmdidx}=$ssid" "$configfile"
cmdidx=$((cmdidx + 1))
break
done
atf_stacmd_idx=$cmdidx
}
wsplcd_parse_re_atf_config() {
local cfg
local val
local config=$1
local configfile=$4
cfg="REname"
config_get val "$1" "$cfg"
if [ -n "$val" ] && [ "$val" == "$2" ] ; then
#Get ATF SSID Config
wsplcd_atf_ssid_cfg "$config" "$3" "$configfile"
#Get ATF STA Config
wsplcd_atf_sta_cfg "$config" "$3" "$configfile"
#Get ATF Group Config
wsplcd_atf_group_cfg "$config" "$3" "$configfile"
fi
}
wsplcd_parse_radioparams_atfconfig() {
local cfg
local val
local config=$1
local configfile=$4
cfg="REname"
config_get val "$1" "$cfg"
if [ -n "$val" ] && [ "$val" == "$2" ] ; then
#Get Radio name
cfg="radio_name"
config_get val "$1" "$cfg"
if [ -n "$val" ] ; then
wsplcd_cfg_append "${3}radio_name_${atf_radioparams_idx}=$val" "$configfile"
fi
#Get ATF scheduling policy
cfg="sched_policy"
config_get val "$1" "$cfg"
if [ -n "$val" ] ; then
wsplcd_cfg_append "${3}radio_sched_${atf_radioparams_idx}=$val" "$configfile"
fi
#Get ATF OBSS scheduling (0/1)
cfg="sched_obss_enable"
config_get val "$1" "$cfg"
if [ -n "$val" ] ; then
wsplcd_cfg_append "${3}radio_obss_${atf_radioparams_idx}=$val" "$configfile"
fi
#Get ATF Inter group policy
cfg="sched_group_policy"
config_get val "$1" "$cfg"
if [ -n "$val" ] ; then
wsplcd_cfg_append "${3}radio_grouppolicy_${atf_radioparams_idx}=$val" "$configfile"
fi
atf_radioparams_idx=$((atf_radioparams_idx + 1))
fi
}
wsplcd_parse_atf_config() {
local cfg
local prefix
local rename
local config=$1
local configfile=$2
repeater_id=$((repeater_id + 1))
prefix="ATF.RE${repeater_id}_"
cfg="REname"
config_get rename "$1" "$cfg"
#Get RE MAC
wsplcd_atf_re_mac_cfg "$config" $prefix "$configfile"
#reset command indexes for each repeater entry
atf_ssidcmd_idx=1
atf_stacmd_idx=1
atf_groupcmd_idx=1
atf_radioparams_idx=1
#Parse re-config section & get atf configuration
config_load wsplcd
config_foreach wsplcd_parse_re_atf_config atf-re-config "$rename" $prefix "$configfile"
config_foreach wsplcd_parse_radioparams_atfconfig atf-re-radioparams-config "$rename" $prefix "$configfile"
}
wsplcd_cfg_add_atf() {
local cfg="$1"
local key="$2"
local def="$3"
local val
local repeater_id=0
local configfile=$4
config_get_bool val config "$key" "$def"
[ -n "$val" ] && wsplcd_cfg_append "$cfg=$val" "$configfile"
#Read ATF Params if ATF config is enabled
if [ -n "$val" ] && [ "$val" == 1 ] ; then
config_load wsplcd
config_foreach wsplcd_parse_atf_config atf-config "$configfile"
fi
}
wsplcd_create_config() {
lock /var/run/wsplcd.lock
local br_name=$1
local configfile=$2
config_get map_enable config 'MapEnable' '0'
config_get num_vlan_supported config 'NumberOfVLANSupported' '0'
config_load repacd
config_get TS_enabled repacd 'TrafficSeparationEnabled' '0'
if [ "$map_enable" -ge 2 ] && [ "$num_vlan_supported" -gt 0 ]; then
# Get the Guest Bridge Names
hyfi_get_ieee1905_brguest_map ieee1905_brguest_map ieee1905_brbh
else
if [ "$ieee1905managed_bridge" == "$br_name" -a "$TS_enabled" == "1" -a "$map_enable" -eq 0 ]; then
ieee1905_brbh="backhaul"
else
ieee1905_brbh=
fi
fi
echo "# Config file for wsplcd, automatically created by script" > "$configfile"
wsplcd_cfg_add_debuglevel debug_level DebugLevel 'ERROR' "$configfile"
wsplcd_cfg_add_interface "$br_name" "$configfile"
wsplcd_cfg_add_guest_interface $configfile
wsplcd_cfg_add_role role RunMode "$configfile"
wsplcd_cfg_add_bool designated_pb_ap DesignatedPBAP '0' "$configfile"
wsplcd_cfg_add_wpsmethod WPS_method WPSMethod 'WPS_M2' "$configfile"
wsplcd_cfg_add_wpstxmode WPS_tx_mode TXMode 'WPS_TX_ENCRYPTED' "$configfile"
wsplcd_cfg_add_wpsrxmode WPS_rx_mode RXMode 'WPS_RX_ENCRYPTED' "$configfile"
wsplcd_cfg_add_configsta config_station ConfigSta '1' "$configfile"
wsplcd_cfg_add_str ssid_suffix SSIDSuffix '' "$configfile"
wsplcd_cfg_add_str search_timeout SearchTimeout '60' "$configfile"
wsplcd_cfg_add_str WPS_session_timeout WPSSessionTimeout '120' "$configfile"
wsplcd_cfg_add_str WPS_retransmission_timeout WPSRetransmitTimeout '5' "$configfile"
wsplcd_cfg_add_str WPS_per_message_timeout WPSPerMessageTimeout '15' "$configfile"
wsplcd_cfg_add_bool band_sel_enable BandSel '1' "$configfile"
wsplcd_cfg_add_bool band_choice BandChoice '5G' "$configfile"
wsplcd_cfg_add_str rm_collect_timeout RMCollectTimeout '10' "$configfile"
wsplcd_cfg_add_bool deep_clone_enable DeepClone '1' "$configfile"
wsplcd_cfg_add_bool deep_clone_no_bssid DeepCloneNoBSSID '0' "$configfile"
wsplcd_cfg_add_bool manage_vap_ind ManageVAPInd '1' "$configfile"
wsplcd_cfg_add_str 1905Nwkey NetworkKey1905 '' "$configfile"
wsplcd_cfg_add_str ucpk_salt UCPKSalt '' "$configfile"
wsplcd_cfg_add_wpatype wpa_passphrase_type WPAPassphraseType 'LONG' "$configfile"
wsplcd_cfg_append 'config_methods=push_button virtual_push_button physical_push_button' "$configfile"
wsplcd_cfg_append 'manufacturer=Qualcomm Atheros' "$configfile"
wsplcd_cfg_append 'model_name=ModelNameHere' "$configfile"
wsplcd_cfg_append 'model_number=ModelNumberHere' "$configfile"
wsplcd_cfg_append 'serial_number=SerialNumberHere' "$configfile"
wsplcd_cfg_append 'device_type=6-0050f204-1' "$configfile"
wsplcd_cfg_append 'device_name=ExampleWpa' "$configfile"
wsplcd_cfg_append 'os_version=01020300' "$configfile"
wsplcd_cfg_append '#AP Cloning 1.0 parameters' "$configfile"
wsplcd_cfg_add_bool APCloning APCloning '0' "$configfile"
wsplcd_cfg_add_str MapEnable MapEnable '0' "$configfile"
wsplcd_cfg_add_bool MapPFCompliant MapPFCompliant '0' "$configfile"
wsplcd_cfg_add_str NumberOfVLANSupported NumberOfVLANSupported '0' "$configfile"
wsplcd_cfg_add_str Map2TrafficSepEnabled Map2TrafficSepEnabled '0' "$configfile"
wsplcd_cfg_add_str CombinedR1R2Backhaul CombinedR1R2Backhaul '0' "$configfile"
wsplcd_cfg_add_str MapMaxBss MapMaxBss '0' "$configfile"
wsplcd_cfg_add_buttonmode button_mode ButtonMode 'TWOBUTTON' "$configfile"
wsplcd_cfg_add_str clone_timeout CloneTimeout '180' "$configfile"
wsplcd_cfg_add_str walk_timeout WalkTimeout '120' "$configfile"
wsplcd_cfg_add_str repeat_timeout RepeatTimeout '1' "$configfile"
wsplcd_cfg_add_str internal_timeout InternalTimeout '15' "$configfile"
wsplcd_cfg_add_str wait_wifi_config_secs_other WaitOtherBandsSecs '20' "$configfile"
wsplcd_cfg_add_str wait_wifi_config_secs_first WaitFirstBandSecs '30' "$configfile"
wsplcd_cfg_add_atf atf_config_en atfConfigEnable '0' "$configfile"
wsplcd_cfg_append "cfg_changed=$cfg_changed" "$configfile"
local cfg_restart_long_timeout
local cfg_restart_short_timeout
local cfg_apply_timeout
config_get cfg_restart_long_timeout config "ConfigRestartLongTimeout" "20"
config_get cfg_restart_short_timeout config "ConfigRestartShortTimeout" "5"
config_get cfg_apply_timeout config "ConfigApplyTimeout" "10"
wsplcd_cfg_append "cfg_restart_long_timeout=$cfg_restart_long_timeout" "$configfile"
wsplcd_cfg_append "cfg_restart_short_timeout=$cfg_restart_short_timeout" "$configfile"
wsplcd_cfg_append "cfg_apply_timeout=$cfg_apply_timeout" "$configfile"
wsplcd_cfg_append "TrafficSeparationEnabled=$TS_enabled" "$configfile"
[ -x "/sbin/uci2cfg.sh" ] && {
/sbin/uci2cfg.sh "$br_name" >> "$configfile"
/sbin/uci2cfg.sh wifisec "$br_name" > "/tmp/.wsplc.wifisec"
if [ -n "$ieee1905_brguest_map" ]; then
for br in $ieee1905_brguest_map; do
hyfi_get_wlan_ifaces "$br" wlan_ifaces wlan_included_ifaces
if [ -n "$wlan_ifaces" ]; then
/sbin/uci2cfg.sh "$br" >> "$configfile"
fi
done
fi
if [ -n "$ieee1905_brbh" ]; then
hyfi_get_wlan_ifaces "$ieee1905_brbh" wlan_ifaces wlan_included_ifaces
if [ -n "$wlan_ifaces" ]; then
/sbin/uci2cfg.sh "$ieee1905_brbh" > "/tmp/backhaul_bridge"
#To avoid duplicate RADIO.X entry grep WLAN while including backhaul VAP config
cat "/tmp/backhaul_bridge" | grep WLAN >> "$configfile"
rm /tmp/backhaul_bridge
fi
fi
}
lock -u /var/run/wsplcd.lock
return 0
}
__wsplcd_wlanif_ready() {
local vif vifs
local vifstat
local configfile=$1
vifs=$(grep '^1905InterfacesWlan' "$configfile" | sed -e 's/1905InterfacesWlan=//' -e 's/@[a-zA-Z0-9]*//g' -e 's/,/ /g' -e 's/:WLAN//g' -e 's/&[a-zA-Z0-9]*//g')
if [ -z "$vifs" ]; then
echo "[wsplcd]WLAN interface is not ready" > /dev/console
return 0
fi
for vif in $vifs; do
vifstat=$(ifconfig "$vif" 2>/dev/null)
if [ -z "$vifstat" ]; then
echo "[wsplcd]WLAN interface $vif is not ready" > /dev/console
return 0
fi
done
return 1
}
start() {
local enabled
local ieee1905managed_bridge
local ieee1905managed_bridge2
local log_mode
local map_enable
local map_mode=''
local map_policy_file=''
local allow_zero_ap_interfaces
config_load 'wsplcd'
config_get_bool enabled config 'HyFiSecurity' '0'
[ "$enabled" -gt 0 ] || {
return 1
}
config_get log_mode config "WriteDebugLogToFile" "NONE"
case "$log_mode" in
NONE)
log_mode=''
;;
APPEND)
log_mode='-a'
;;
TRUNCATE)
log_mode='-w'
;;
esac
config_get map_enable config 'MapEnable' '0'
if [ "$map_enable" -gt 0 ]; then
config_get map_policy_file config 'MapGenericPolicyFile'
if [ -n "$map_policy_file" ]; then
map_mode='-M'
else
config_get map_policy_file config 'MapPolicyFile' '/etc/config/map.conf'
map_mode='-m'
fi
fi
# Get the IEEE1905.1 managed bridge name
hyfi_get_ieee1905_managed_iface ieee1905managed_bridge ieee1905managed_bridge2
if [ "$map_enable" -gt 0 ] && [ -n "$ieee1905managed_bridge2" ]; then
hyfi_echo wsplcd "MAP mode only supports a single bridge"
return 1
fi
wsplcd_create_config "$ieee1905managed_bridge" "${WSPLCD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge}.conf" || return 1
if [ -n "$ieee1905managed_bridge2" ]
then
wsplcd_create_config "$ieee1905managed_bridge2" "${WSPLCD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge2}.conf" || return 1
fi
config_get allow_zero_ap_interfaces config 'AllowZeroAPInterfaces' '0'
__wsplcd_wlanif_ready "${WSPLCD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge}.conf"
if [ $? -eq 1 ] || [ "$allow_zero_ap_interfaces" -gt 0 ]; then
hyfi_echo wsplcd "starting daemon"
${SVCDBG}service_start ${SERVICE_PATH} -d -c "${WSPLCD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge}.conf" "$log_mode" "$map_mode" "$map_policy_file" $WSPLCD_CFG80211
if [ -n "$ieee1905managed_bridge2" ]
then
${SVCDBG}service_start ${SERVICE_PATH} -d -c "${WSPLCD_CONFIG_FILE_PREFIX}-${ieee1905managed_bridge2}.conf" "$log_mode" $WSPLCD_CFG80211
fi
fi
touch $WSPLCD_RUN_FILE
}
stop() {
${SVCDBG}service_stop ${SERVICE_PATH}
# Save aside the old config file just for debugging purposes.
[ -f "$WSPLCD_CONFIG_FILE" ] &&
mv ${WSPLCD_CONFIG_FILE} ${WSPLCD_CONFIG_FILE}.bak &&
rm ${WSPLCD_CONFIG_FILE_PREFIX}-*.conf
}
restart() {
[ -f "$WSPLCD_RUN_FILE" ] || return
hyfi_lock
stop
start
hyfi_unlock
}
restart_after_config_change() {
[ -f "$WSPLCD_RUN_FILE" ] || return
hyfi_lock
# No longer have an explicit stop function since we are now using
# procd, so do an explicit stop via the init script.
/etc/init.d/wsplcd stop
cfg_changed=1
start
hyfi_unlock
}

View file

@ -1,58 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=wsplc-ui
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
define Package/luci-wsplc/Default
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros
SUBMENU:=IEEE1905.1 features
endef
define Package/luci-wsplc
$(call Package/luci-wsplc/Default)
DEPENDS:=+luci +luci-mod-admin-full
TITLE:=IEEE1905.1 Security Web UI
endef
define Package/luci-wsplc/description
Luci WebUI for 1905.1 AP Auto Configuration and Security
endef
define Package/luci-wsplc-advanced
$(call Package/luci-wsplc/Default)
DEPENDS:=+luci +luci-mod-admin-full +luci-wsplc
TITLE:=IEEE1905.1 Security Web UI - Advanced
endef
define Package/luci-wsplc-advanced/description
Luci WebUI for 1905.1 AP Auto Configuration and Security - Advanced
endef
define Build/Compile
true
endef
define Package/luci-wsplc/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/wsplc
$(CP) files/luci-wsplc/luasrc/model/cbi/wsplc/wsplc.lua /$(1)/usr/lib/lua/luci/model/cbi/wsplc/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/wsplc
$(CP) files/luci-wsplc/luasrc/view/wsplc/dview_js.htm /$(1)/usr/lib/lua/luci/view/wsplc/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
$(CP) files/luci-wsplc/luasrc/controller/wsplc.lua /$(1)/usr/lib/lua/luci/controller/
endef
define Package/luci-wsplc-advanced/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/wsplc
$(CP) files/luci-wsplc/luasrc/model/cbi/wsplc/advanced.lua /$(1)/usr/lib/lua/luci/model/cbi/wsplc/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/wsplc
$(CP) files/luci-wsplc/luasrc/view/wsplc/btn_adv.htm /$(1)/usr/lib/lua/luci//view/wsplc/
endef
$(eval $(call BuildPackage,luci-wsplc))
$(eval $(call BuildPackage,luci-wsplc-advanced))

View file

@ -1,2 +0,0 @@
include ../../build/config.mk
include ../../build/module.mk

View file

@ -1,23 +0,0 @@
--[[
LuCI - Lua Configuration Interface
Copyright (c) 2013 Qualcomm Atheros, Inc.
All Rights Reserved.
Qualcomm Atheros Confidential and Proprietary.
]]--
module("luci.controller.wsplc", package.seeall)
function index()
if not nixio.fs.access("/etc/config/wsplcd") then
return
end
local page
page = entry({"admin", "network", "wsplc"}, cbi("wsplc/wsplc"), _("HyFi Security"))
page.dependent = true
end

View file

@ -1,115 +0,0 @@
--[[
LuCI - Lua Configuration Interface
Copyright (c) 2013 Qualcomm Atheros, Inc.
All Rights Reserved.
Qualcomm Atheros Confidential and Proprietary.
]]--
local m, s = ...
s = m:section(TypedSection, "wsplcd", translate("Advanced Settings - IEEE1905.1 Security"))
s.anonymous = true
li = s:option(ListValue, "WPSMethod", translate("WPS Method"))
li:value("WPS_M2", translate("WPS_M2"))
li:value("WPS_M8", translate("WPS_M8"))
li.default = "WPS_M2"
li = s:option(ListValue, "TXMode", translate("TX Mode of M2"))
li:value("WPS_TX_ENCRYPTED", translate("Encrypted"))
li:value("WPS_TX_NONE", translate("Non-encrypted"))
li.default = "WPS_TX_ENCRYPTED"
li = s:option(ListValue, "RXMode", translate("RX Mode of M2"))
li:value("WPS_RX_ENCRYPTED", translate("Encrypted"))
li:value("WPS_RX_EITHER", translate("Encrypted or Non-encrypted"))
li.default = "WPS_RX_ENCRYPTED"
li = s:option(ListValue, "ConfigSta", translate("Configure Station"))
li:value("1", translate("Yes"))
li:value("0", translate("No"))
li.default = "1"
vl = s:option(Value, "SearchTimeout", translate("Search Interval"))
vl.datatype = "uinteger"
v = s:option(Value, "WPSSessionTimeout", translate("WPS Session Timeout"))
v.datatype = "uinteger"
v = s:option(Value, "WPSRetransmitTimeout", translate("WPS Retransmission Timeout"))
v.datatype = "uinteger"
v = s:option(Value, "WPSPerMessageTimeout", translate("WPS Per-Message Timeout"))
v.datatype = "uinteger"
v = s:option(Value, "PushButtonTimeout", translate("Push Button Timeout"))
v.datatype = "uinteger"
v = s:option(Value, "PBSearchTimeout", translate("PB Search Interval"))
v.datatype = "uinteger"
v = s:option(Value, "SSIDSuffix", translate("SSID Suffix (demo mode)"))
v.datatype = "string"
l = s:option(ListValue, "DebugLevel", translate("Debug Level"))
l:value("ERROR", translate("ERROR"))
l:value("INFO", translate("INFO"))
l:value("DEBUG", translate("DEBUG"))
l:value("DUMP", translate("DUMP"))
l.default = "INFO"
l = s:option(ListValue, "BandSel", translate("DB Band Adaptation"))
l:value("1", translate("Enable"))
l:value("0", translate("Disable"))
l.default = "1"
l = s:option(ListValue, "BandChoice", translate("DB Preferred Band"))
l:value("5G", translate("5G"))
l:value("2G", translate("2G"))
l.default = "5G"
v = s:option(Value, "RMCollectTimeout", translate("DB Mode Time Window"))
v.datatype = "uinteger"
l = s:option(ListValue, "DeepClone", translate("Deep Cloning"))
l:value("1", translate("Enable"))
l:value("0", translate("Disable"))
l.default = "1"
l = s:option(ListValue, "DeepCloneNoBSSID", translate("Deep Cloning Without BSSID"))
l:value("1", translate("Enable"))
l:value("0", translate("Disable"))
l.default = "0"
l = s:option(ListValue, "ManageVAPInd", translate("Manage VAP Independent Mode"))
l:value("1", translate("Enable"))
l:value("0", translate("Disable"))
l.default = "1"
l = s:option(ListValue, "WPAPassphraseType", translate("UCPK-Generated WLAN Passphrase Length"))
l:value("LONG", translate("Long"))
l:value("SHORT", translate("Short"))
l.default = "LONG"
v = s:option(Value, "WaitAllBandsSecs", translate("Maximum number of seconds to wait until APAC completes on all bands"))
v.datatype = "uinteger"
s = m:section(TypedSection, "wsplcd", translate("Advanced Settings - HYFI 1.0"))
s.anonymous = true
l = s:option(ListValue, "APCloning", translate("HYFI 1.0 AP Cloning"))
l:value("1", translate("Enable"))
l:value("0", translate("Disable"))
l.default = "0"
v = s:option(Value, "CloneTimeout", translate("AP Cloning Timeout"))
v.datatype = "uinteger"
v = s:option(Value, "RepeatTimeout", translate("Repeat Timeout"))
v.datatype = "uinteger"
v = s:option(Value, "InternalTimeout", translate("Internal Timeout"))
v.datatype = "uinteger"

View file

@ -1,155 +0,0 @@
--[[
LuCI - Lua Configuration Interface
Copyright (c) 2013 Qualcomm Atheros, Inc.
All Rights Reserved.
Qualcomm Atheros Confidential and Proprietary.
]]--
local enabled_prev = nil
local uci = require "luci.model.uci"
function fork_exec(command)
local pid = nixio.fork()
if pid > 0 then
return
elseif pid == 0 then
-- change to root dir
nixio.chdir("/")
-- patch stdin, out, err to /dev/null
local null = nixio.open("/dev/null", "w+")
if null then
nixio.dup(null, nixio.stderr)
nixio.dup(null, nixio.stdout)
nixio.dup(null, nixio.stdin)
if null:fileno() > 2 then
null:close()
end
end
-- replace with target command
nixio.exec("/bin/sh", "-c", command)
end
end
m = Map("wsplcd", translate("HyFi Security Settings"),
translate("Security configuration of HyFi networks "))
m.on_before_save = function()
local uci_r = uci.cursor()
enabled_prev = uci_r:get("wsplcd", "config", "HyFiSecurity")
end
m.on_after_commit = function()
local enabled_new = nil
enabled_new = m.uci:get("wsplcd", "config", "HyFiSecurity")
if (enabled_new == "1" and enabled_prev == "0") then
fork_exec("/etc/init.d/wsplcd start")
else
fork_exec("/etc/init.d/wsplcd restart")
end
end
s = m:section(NamedSection, "config", translate("Basic Settings"))
s.anonymous = true
e = s:option(Flag, "HyFiSecurity", translate("Enable"))
e.rmempty = false
e = s:option(Flag, "MapEnable", translate("Multi-AP SIG Enable"))
e.rmempty = false
li = s:option(ListValue, "RunMode", translate("1905.1 Configuration Role"))
li:value("REGISTRAR", translate("Registrar"))
li:value("ENROLLEE", translate("Enrollee"))
li:value("NONE", translate("None"))
li.default = "ENROLLEE"
li = s:option(ListValue, "DesignatedPBAP", translate("Designated Push Button AP"))
li:value("1", translate("Selected"))
li:value("0", translate("Not selected"))
li.default = "1"
vl = s:option(Value, "MapPolicyFile", translate("AL MAC-specific Multi-AP BSS Instantiation Policy File"))
vl.datatype = "string"
vl = s:option(Value, "MapGenericPolicyFile", translate("Generic Multi-AP BSS Instantiation Policy File"))
vl.datatype = "string"
vl = s:option(Value, "MapMaxBss", translate("Maximum supported BSSes per radio in Multi-AP Mode"))
vl.datatype = "uinteger"
vl = s:option(Value, "NetworkKey1905", translate("1905.1 UCPK"))
vl.datatype = "string"
vl = s:option(Value, "UCPKSalt", translate("1905.1 UCPK Salt"))
vl.datatype = "string"
function ucpkgen()
local ucpk = m.uci:get("wsplcd", "config", "NetworkKey1905")
local salt = m.uci:get("wsplcd", "config", "UCPKSalt")
local keytype = m.uci:get("wsplcd", "config", "WPAPassphraseType")
local wpapsk = ""
local plcnmk = ""
if ucpk and ucpk:len() > 0 then
local cmd
local fp
cmd = "ucpkgen"
if keytype and keytype:len() > 0 then
if keytype == "SHORT" then
cmd = cmd .. " -s"
else
cmd = cmd .. " -l"
end
end
if salt and salt:len() > 0 then
cmd = cmd .. " -n \"" .. salt .. "\""
end
cmd = cmd .. " \"" .. ucpk .. "\""
fp = io.popen(cmd)
if fp then
local lines
lines = fp:read("*all")
_,_,wpapsk = lines:find("WPA PSK%s+:(%x+)")
_,_,plcnmk = lines:find("1901 NMK%s+:(%x+)")
fp:close()
end
end
return wpapsk, plcnmk
end
vl = s:option(Value, "WPAPSK", translate("WPA PSK"))
function vl.cfgvalue(self, section)
local wpapsk = ucpkgen()
return wpapsk
end
function vl.write(self, section, value)
end
vl = s:option(Value, "1901NMK", translate("1901 NMK"))
function vl.cfgvalue(self, section)
local plcnmk
_,plcnmk = ucpkgen()
return plcnmk
end
function vl.write(self, section, value)
end
js = s:option(DummyValue, "script", translate("script for Wsplc"))
js.template = "wsplc/dview_js"
local form, ferr = loadfile(luci.util.libpath() .. "/model/cbi/wsplc/advanced.lua")
if form then
bt = s:option(DummyValue, "showadv", translate("show advanced"))
bt.template = "wsplc/btn_adv"
setfenv(form, getfenv(1))(m, s)
end
return m

View file

@ -1,11 +0,0 @@
<table>
<tr class="cbi-section-table">
<td></td>
<td class="cbi-value-field">
<input id="wsplc-advance" class="cbi-button cbi-button-apply" onclick="javascript:void(0)" type="button" />
</td>
<td>
</td>
</tr>
</table>

View file

@ -1,165 +0,0 @@
<script type="text/javascript">//<![CDATA[
var HideAdvance = 0;
function onWsplcAdvance( )
{
var objAdv = document.getElementById("wsplc-advance");
if(HideAdvance)
{
HideAdvance = 0;
objAdv.value = "Hide Advanced Settings";
}
else
{
HideAdvance = 1;
objAdv.value = "Show Advanced Settings";
}
for (var i=0; i<objAdv.form.length; i++ )
{
var objElm = objAdv.form.elements[i];
if (objElm.className == "cbi-section"
&& objElm.id != "cbi-wsplcd-config"
&& objElm.id != "cbi-apply-wsplcd")
{
if (HideAdvance)
objElm.style.display = "none";
else
objElm.style.display = "block";
}
}
}
function wsplcSetDisabled(option, disabled)
{
var id = "cbid.wsplcd.config." + option;
var obj = document.getElementById(id);
if (!obj)
return;
if (obj.type == "text")
obj.readOnly = disabled;
else
obj.disabled = disabled;
}
function onConfigChange( )
{
var objHyfisec = document.getElementById("cbid.wsplcd.config.HyFiSecurity");
var objMode = document.getElementById("cbid.wsplcd.config.RunMode");
var objBandSel = document.getElementById("cbid.wsplcd.config.BandSel");
if (objHyfisec.checked == false)
{
wsplcSetDisabled("RunMode", true);
}
else
{
wsplcSetDisabled("RunMode", false);
}
if (objHyfisec.value == 0 || objMode.value == "ENROLLEE")
{
wsplcSetDisabled("NetworkKey1905", true);
wsplcSetDisabled("UCPKSalt", true);
}
else
{
wsplcSetDisabled("NetworkKey1905", false);
wsplcSetDisabled("UCPKSalt", false);
}
if (objMode.value == "REGISTRAR" ||
objMode.value == "NONE")
{
wsplcSetDisabled("ConfigSta", true);
wsplcSetDisabled("SearchTimeout", true);
wsplcSetDisabled("SSIDSuffix", true);
wsplcSetDisabled("BandSel", true);
wsplcSetDisabled("BandChoice", true);
wsplcSetDisabled("RMCollectTimeout", true);
wsplcSetDisabled("RXMode", true);
if (objMode.value == "NONE")
{
wsplcSetDisabled("WPSSessionTimeout", true);
wsplcSetDisabled("WPSRetransmitTimeout", true);
wsplcSetDisabled("WPSPerMessageTimeout", true);
}
else
{
wsplcSetDisabled("WPSSessionTimeout", false);
wsplcSetDisabled("WPSRetransmitTimeout", false);
wsplcSetDisabled("WPSPerMessageTimeout", false);
}
wsplcSetDisabled("WPSMethod", false);
wsplcSetDisabled("TXMode", false);
}
else
{
wsplcSetDisabled("ConfigSta", false);
wsplcSetDisabled("SearchTimeout", false);
wsplcSetDisabled("SSIDSuffix", false);
wsplcSetDisabled("BandSel", false);
if (objBandSel && objBandSel.value == 1)
{
wsplcSetDisabled("BandChoice", false);
wsplcSetDisabled("RMCollectTimeout", false);
}
else
{
wsplcSetDisabled("BandChoice", true);
wsplcSetDisabled("RMCollectTimeout", true);
}
wsplcSetDisabled("RXMode", false);
wsplcSetDisabled("WPSSessionTimeout", false);
wsplcSetDisabled("WPSRetransmitTimeout", false);
wsplcSetDisabled("WPSPerMessageTimeout", false);
wsplcSetDisabled("WPSMethod", true);
wsplcSetDisabled("TXMode", true);
}
}
function onModeChange( )
{
var objMode = document.getElementById("cbid.wsplcd.config.RunMode");
var objPbap = document.getElementById("cbid.wsplcd.config.DesignatedPBAP");
if (objMode.value == "REGISTRAR")
objPbap.value = 1;
else
objPbap.value = 0;
onConfigChange();
}
function onWsplcLoad()
{
var objHyfisec = document.getElementById("cbid.wsplcd.config.HyFiSecurity");
objHyfisec.onchange = onConfigChange;
var objMode = document.getElementById("cbid.wsplcd.config.RunMode");
objMode.onchange = onModeChange;
var objBandSel = document.getElementById("cbid.wsplcd.config.BandSel");
objBandSel.onchange = onConfigChange;
var objAdv = document.getElementById("wsplc-advance");
if (objAdv)
{
objAdv.onclick = onWsplcAdvance;
}
wsplcSetDisabled("WPAPSK", true);
wsplcSetDisabled("1901NMK", true);
onConfigChange();
onWsplcAdvance();
}
if (document.all)
window.attachEvent('onload', onWsplcLoad);
else
window.addEventListener('load', onWsplcLoad, false);
//]]></script>

View file

@ -1,61 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sierra-cm
PKG_VERSION:=SLQS03.03.10.bin
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://qcawebsrvr.qualcomm.com/CoreWLAN/Components/NBU/LTE-IPQ/$(PKG_NAME)/$(PKG_VERSION)/src
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
URL:=http://www.qca.qualcomm.com
MAINTAINER:=Qualcomm Atheros
TITLE:=LTE Connection Manager for Sierra
DEPENDS:=@TARGET_ipq806x||TARGET_ipq_ipq40xx +kmod-sierra-driver
endef
define Package/$(PKG_NAME)/description
This package contains the LTE Connection Manager for Sierra EM7455
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/include
TARGET_LDFLAGS += \
-L$(STAGING_DIR)/lib
MAKE_FLAGS += \
CROSS_COMPILE="$(TARGET_CROSS)" \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)"
define Build/Compile
mkdir -p $(PKG_BUILD_DIR)/SampleApps/QCA_Connection_Manager
$(CP) $(PKG_BUILD_DIR)/SampleApps/Connection_Manager/* $(PKG_BUILD_DIR)/SampleApps/QCA_Connection_Manager/
$(CP) ./src/connectionmgr.c $(PKG_BUILD_DIR)/SampleApps/QCA_Connection_Manager/src/
$(MAKE_FLAGS) \
make -C $(PKG_BUILD_DIR)/SampleApps MYFLAGS="-l gcc_eh -L$(PKG_BUILD_DIR)/build/lib/arm"
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/lib/lte-cm
$(INSTALL_BIN) $(PKG_BUILD_DIR)/SampleApps/QCA_Connection_Manager/bin/connectionmgrarm \
$(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/build/bin/arm/slqssdk $(1)/usr/bin/
$(INSTALL_BIN) ./files/usr/bin/sierra-cm $(1)/usr/bin/lte-cm
$(INSTALL_BIN) ./files/usr/bin/channel_avoidance.sh $(1)/usr/bin/
$(INSTALL_BIN) ./files/usr/bin/lte_apn_setup.sh $(1)/usr/bin/
$(INSTALL_DATA) ./files/etc/config/sierra-cm $(1)/etc/config/
$(INSTALL_DATA) ./files/usr/lib/lte-cm/lte_channel_table.txt $(1)/usr/lib/lte-cm
endef
$(eval $(call BuildPackage,sierra-cm))

View file

@ -1,38 +0,0 @@
config sierra-cm 'config'
option disabled '1'
config profile
option name 'default'
option enabled '1'
# User can create own profiles using below values to start LTE connection manager.
# name : user can decide any name
# enabled : 0 - inactive, 1 - active
# (any 1 profile can be active at a time)
# connectiontype : LTE
# ipfamily : 4 - IPv4, 6 - IPv6, 7 - IPv4v6
# pdptype : 0 - IPv4, 1 - PPP, 2 - IPV6, 3 - IPV4V6
# ipaddress : xx.xx.xx.xx
# primarydns : xx.xx.xx.xx
# secondarydns : xx.xx.xx.xx
# (above format is for IPv4, xx can be any number of digits.
# use proper format for IPv6)
# authvalue : 0 - None, 1 - PAP, 2 - CHAP, 3 - PAP/CHAP
# apn : based on service provider
# username : based on service provider
# password : based on service provider
config profile
option name 'profile1'
option enabled '0'
option connectiontype 'LTE'
option ipfamily '4'
option pdptype '0'
option ipaddress '0.0.0.0'
option primarydns '0.0.0.0'
option secondarydns '0.0.0.0'
option authvalue '0'
option apn 'airtelgprs.com'
option username ''
option password ''

View file

@ -1,69 +0,0 @@
#! /bin/sh
#
# Copyright (c) 2016 Qualcomm Atheros, Inc.
#
# All Rights Reserved.
# Qualcomm Atheros Confidential and Proprietary.
#
. /lib/functions.sh
add_delete_per_vap() {
local vap_id=$1
local wifi_device_name=$2
local channels=$3
local vap_name="${wifi_device_name/wifi/ath}"
config_get device_name $vap_id device && {
[ "$device_name" == "$wifi_device_name" ] && {
[ -z "$channels" ] && {
config_get is_available $vap_id channel_block_list && {
[ -n "$is_available" ] && {
echo "Deleting entry channel_block_list from $vap_name" > /dev/console
uci delete wireless.$vap_id.channel_block_list
uci commit wireless
wifitool $vap_name block_acs_channel 0
}
}
}
[ -n "$channels" ] && {
echo "Adding $channels to channel_block_list entry on $vap_name" > /dev/console
uci set wireless.$vap_id.channel_block_list=$channels
uci commit wireless
echo "Blocking channels $channels on $vap_name" > /dev/console
wifitool $vap_name block_acs_channel 0
wifitool $vap_name block_acs_channel $channels
iwconfig $vap_name channel 0
}
break
}
}
}
channel_addition_deletion() {
local wifi_device_name=$1
local channels=$2
config_get wifi_hwmode "$wifi_device_name" hwmode
case "$wifi_hwmode" in
11n* | 11b* | 11c*) echo "$wifi_device_name operating in co-existence range" > /dev/console
config_foreach add_delete_per_vap wifi-iface $wifi_device_name $channels;;
*) echo "$wifi_device_name not operating in co-existence range" > /dev/console;;
esac
}
configure_channel_list() {
local channels=$1
config_load wireless && {
config_foreach channel_addition_deletion wifi-device
[ -n "$channels" ] && {
config_foreach channel_addition_deletion wifi-device $channels
}
return 0
}
}
configure_channel_list $1

View file

@ -1,63 +0,0 @@
#! /bin/sh
#
# Copyright (c) 2016 Qualcomm Atheros, Inc.
#
# All Rights Reserved.
# Qualcomm Atheros Confidential and Proprietary.
#
. /lib/functions.sh
find_active_profile() {
local profile_id=$1
config_get_bool enabled "$profile_id" enabled '0'
echo "$profile_id enabled = $enabled"
[ $enabled -eq 1 ] && {
config_get profile_name "$profile_id" name ""
[ "$profile_name" = "default" ] && {
echo "Default profile enabled" > /dev/console
break
}
config_get profile_conn_type "$profile_id" connectiontype ""
config_get profile_ip_family "$profile_id" ipfamily ""
config_get profile_pdp "$profile_id" pdptype ""
config_get profile_ipaddress "$profile_id" ipaddress ""
config_get profile_primarydns "$profile_id" primarydns ""
config_get profile_secondarydns "$profile_id" secondarydns ""
config_get profile_auth "$profile_id" authvalue ""
config_get profile_apn "$profile_id" apn ""
config_get profile_user "$profile_id" username ""
config_get profile_pass "$profile_id" password ""
[ -z "$profile_conn_type" ] ||[ -z "$profile_ip_family" ] ||
[ -z "$profile_pdp" ] || [ -z "$profile_ipaddress" ] ||
[ -z "$profile_primarydns" ] || [ -z "$profile_secondarydns" ] ||
[ -z "$profile_auth" ] && {
echo "Invalid profile values" > /dev/console
return 1
}
echo "Writing $profile_name values to profiles.txt"
echo "$profile_conn_type $profile_ip_family $profile_pdp $profile_ipaddress" \
"$profile_primarydns $profile_secondarydns $profile_auth $profile_name" \
"$profile_apn $profile_user $profile_pass" > /usr/lib/lte-cm/profiles.txt
}
}
config_load sierra-cm && {
local value
config_get_bool disabled config 'disabled' '1'
echo $disabled
[ $disabled -eq 0 ] || {
return 1
}
[ -e "/usr/lib/lte-cm/profiles.txt" ] && {
rm /usr/lib/lte-cm/profiles.txt
}
config_foreach find_active_profile profile
return 0
}

View file

@ -1,89 +0,0 @@
#!/bin/sh /etc/rc.common
#
# Copyright (c) 2016 Qualcomm Atheros, Inc.
#
# All Rights Reserved.
# Qualcomm Atheros Confidential and Proprietary.
#
configure_firewall_zone() {
local zone_id=$1
local disabled=$2
local is_found
config_get zone_name "$zone_id" name
if [ "$zone_name" == "wan" ]; then {
config_get network_name "$zone_id" network
if [ -n "$network_name" ]; then {
echo $network_name | grep -q "wan2"
is_found=$?
if [ $is_found -ne 0 ] && [ $disabled -eq 0 ]; then {
uci add_list firewall.$zone_id.network=wan2
uci add_list firewall.$zone_id.network=wan2_6
uci commit
}
elif [ $is_found -eq 0 ] && [ $disabled -ne 0 ]; then {
uci del_list firewall.$zone_id.network=wan2
uci del_list firewall.$zone_id.network=wan2_6
uci commit
}
fi
break
}
fi
}
fi
}
configure_wan2_interface() {
local disabled=$1
config_load network && {
config_get ifname wan2 ifname
if [ -z "$ifname" ] && [ $disabled -eq 0 ]; then {
uci set network.wan2='interface'
uci set network.wan2.ifname='eth2'
uci set network.wan2.proto='dhcp'
uci set network.wan2_6='interface'
uci set network.wan2_6.ifname='@wan2'
uci set network.wan2_6.proto='dhcpv6'
uci commit
}
elif [ -n "$ifname" ] && [ $disabled -ne 0 ]; then {
uci delete network.wan2
uci delete network.wan2_6
uci commit
}
fi
}
}
start() {
local SERVICE_DAEMONIZE=1
local SERVICE_WRITE_PID=1
local disabled
config_load sierra-cm && {
config_get_bool disabled config 'disabled' '1'
configure_wan2_interface $disabled
config_load firewall && {
config_foreach configure_firewall_zone zone $disabled
}
[ $disabled -eq 0 ] || {
return 1
}
service_start /usr/bin/connectionmgrarm /usr/bin/slqssdk 0
}
}
stop() {
config_load sierra-cm && {
config_get_bool disabled config 'disabled' '1'
configure_wan2_interface $disabled
config_load firewall && {
config_foreach configure_firewall_zone zone $disabled
}
service_stop /usr/bin/connectionmgrarm
killall slqssdk 2&> /dev/null
}
}

View file

@ -1,15 +0,0 @@
# This file contains LTE channel ranges (low and high) and
# corresponding Wi-Fi channels which needs to be blocked.
# Charlietalkd daemon will use this table as input to avoid
# frequency co-existence between LTE and Wi-Fi.
#
# Below table is for LTE Band 7, 41 and Bandwidth 20MHz
#
# LOWER_CHANNEL UPPER_CHANNEL channel1,channel2...,channel(n)
2750 2999 10,11,12,13,14
3000 3269 14
3270 3369 14
3370 3429 14
3430 3449 14
39700 40619 7,8,9,10,11,12,13,14
40620 41539 9,10,11,12,13,14

View file

@ -1,21 +0,0 @@
{
"Status" : "",
"Duration" : "",
"Manufacture ID" : "",
"Model ID" : "",
"Firmware Revisions" : "",
"Boot Revisions" : "",
"PRI Versions" : "",
"PRL Version" : "",
"PRL Preference" : "",
"IMSI" : "",
"Hardware Revision" : "",
"IPAddress" : "",
"Subnet Mask" : "",
"Gateway" : "",
"Primary DNS" : "",
"Secondary DNS" : "",
"Radio Interface" : "",
"Band Class" : "",
"Active Channel" : ""
}

View file

@ -1,55 +0,0 @@
Index: sierra-cm-SLQS03.03.10.bin/SampleApps/Makefile
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ sierra-cm-SLQS03.03.10.bin/SampleApps/Makefile 2016-05-24 21:15:52.585360952 +0530
@@ -0,0 +1,9 @@
+FOLDERS=QCA_Connection_Manager
+
+.PHONY: clean
+
+all:
+ @for folder in ${FOLDERS}; do ${MAKE} -C $${folder} CPU="arm" || exit 1; done
+
+clean:
+ @for folder in ${FOLDERS}; do ${MAKE} -C $${folder} clean || exit 1; done
Index: sierra-cm-SLQS03.03.10.bin/SampleApps/SampleApps.mak
===================================================================
--- sierra-cm-SLQS03.03.10.bin.orig/SampleApps/SampleApps.mak 2015-07-09 08:44:56.000000000 +0530
+++ sierra-cm-SLQS03.03.10.bin/SampleApps/SampleApps.mak 2016-05-24 21:20:02.954616238 +0530
@@ -43,8 +43,8 @@
VPATH =
SRCDIR = src/
ODIR = obj/$(CPU)/
-LDIR = ../../build/lib/$(CPU)/ -static -lrt -lpthread
+LDIR = ../build/lib/$(CPU)/ -static -lrt -lpthread
BINDIR = bin/
DEPS = $(IDIR)SWIWWANCMAPI.h
-LIBS = -l slqsqmi -l slqsapi -l slqscore -L $(LDIR)
+LIBS = -l slqsqmi -l slqsapi -l slqscore -L $(LDIR) $(MYFLAGS)
Index: sierra-cm-SLQS03.03.10.bin/pkgs/slqscompile.mak
===================================================================
--- sierra-cm-SLQS03.03.10.bin.orig/pkgs/slqscompile.mak 2015-07-09 08:44:53.000000000 +0530
+++ sierra-cm-SLQS03.03.10.bin/pkgs/slqscompile.mak 2016-05-24 21:18:34.838174071 +0530
@@ -7,7 +7,7 @@
QMI_BUILD_BASE:=$(shell until [ -d pkgs ]; do cd ..; done; pwd)
endif
SLQSHOSTTYPE := $(shell uname -m)
-CFLAGS := -c -Wall -Werror -Wextra
+CFLAGS := -c -Wall -Wextra
INCLUDE := -I.. $(QMI_INCLUDE)
LDFLAGS := -static -lrt -lpthread
DEPSDIR := ./dep
@@ -84,10 +84,12 @@
# will simply fail.
#-------------------------------------------------------------------------------
ifeq ($(CPU),arm)
+ ifndef MYFLAGS
CROSS_COMPILE := $(HOME)/toolchain/arm/bin/arm-none-linux-gnueabi-
INCLUDE += -I$(HOME)/toolchain/arm/arm-none-linux-gnueabi/libc/usr/include
LDFLAGS += -L$(HOME)/toolchain/arm/lib/gcc/arm-none-linux-gnueabi/4.2.0/
CFLAGS += -march=armv5te
+ endif
endif
# this is for backward compatibility
ifeq ($(CPU),arm9)

File diff suppressed because it is too large Load diff

View file

@ -1,35 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sierra-driver
PKG_VERSION:=S2.25N2.36
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://qcawebsrvr.qualcomm.com/CoreWLAN/Components/NBU/LTE-IPQ/$(PKG_NAME)/$(PKG_VERSION)/src
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk
define KernelPackage/$(PKG_NAME)
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
TITLE:=Kernel gobi drivers for Sierra Connection Manager
DEPENDS:=@TARGET_ipq806x||TARGET_ipq_ipq40xx +kmod-usb-net +kmod-usb-serial
FILES:= $(PKG_BUILD_DIR)/GobiNet/GobiNet.ko $(PKG_BUILD_DIR)/GobiSerial/GobiSerial.ko
AUTOLOAD:=$(call AutoLoad,81,GobiNet GobiSerial)
endef
define KernelPackage/$(PKG_NAME)/description
This package contains the Sierra gobinet and gobiserial modules for Sierra Connection Manager
endef
MAKE_FLAGS += \
CROSS_COMPILE="$(TARGET_CROSS)"
define Build/Compile
$(MAKE_FLAGS) \
make -C $(PKG_BUILD_DIR)/GobiNet/ KDIR=$(LINUX_DIR) ARCH=$(LINUX_KARCH)
$(MAKE_FLAGS) \
make -C $(PKG_BUILD_DIR)/GobiSerial/ KDIR=$(LINUX_DIR) ARCH=$(LINUX_KARCH)
endef
$(eval $(call KernelPackage,$(PKG_NAME)))

View file

@ -1,48 +0,0 @@
include $(TOPDIR)/rules.mk
PKG:=minidump
PKG_NAME:=$(PKG)
PKG_RELEASE:=1
LOCAL_SRC:=$(TOPDIR)/qca/src/minidump
include $(INCLUDE_DIR)/local-development.mk
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=QTI
CATEGORY:=Qualcomm Technologies, Inc. Proprietary software
URL:=http://www.qualcomm.com
MAINTAINER:=Qualcomm Technologies, Inc.
TITLE:= QTI minidump
DEPENDS:= @TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq807x||TARGET_ipq60xx
endef
define Package/$(PKG_NAME)/description/Default
Minidump Package Support
endef
TARGET_CFLAGS += -MMD -O2 -Wall -g -fpie
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
TARGET_LDFLAGS += -pie
TARGET_CSRCS := minidump.c
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
CC="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
CSRCS="$(TARGET_CSRCS)"
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/hotplug.d/minidump
$(INSTALL_BIN) $(PKG_BUILD_DIR)/minidump $(1)/usr/sbin/
$(CP) ./files/minidump.conf $(1)/etc/config/minidump
$(CP) ./files/00-minidump $(1)/etc/hotplug.d/minidump
endef
$(eval $(call BuildPackage,minidump))

View file

@ -1,78 +0,0 @@
#!/bin/sh
: '
Copyright (c) 2020 Qualcomm Technologies, Inc.
All Rights Reserved.
Confidential and Proprietary - Qualcomm Technologies, Inc.
'
# If minidump utility is not present, exit.
[ ! -e /usr/sbin/minidump ] && exit 0
LIVEDUMP=$(uci get minidump.config.enable_livedump);
# If livedump config option is disabled, exit.
if [ "$LIVEDUMP" -ne 1 ]; then
./usr/sbin/minidump 0
exit 0
fi
# Read user config options for live minidump
SERVER=$(fw_printenv serverip | cut -c10-24);
MAX_COUNT=$(uci get minidump.livedump.dump_count);
DUMP_PATH=$(uci get minidump.livedump.path);
TFTP=$(uci get minidump.livedump.tftp);
SAVE_DUMPS=$(uci get minidump.livedump.save_dump);
# For Lowmem profiles, disable save to filesystem option
[ -e /proc/device-tree/MP_512 ] && SAVE_DUMPS=0
[ -e /proc/device-tree/MP_256 ] && SAVE_DUMPS=0
if [ -e /dev/$DEVICENAME ] && [ "$ACTION" = add ]; then
mkdir $DUMP_PATH
count=$(ls -1 $DUMP_PATH/*.gz | wc -l)
# If number of dumps exceed max count, delete the oldest dumpfile
if [ $count -ge $MAX_COUNT ]; then
oldest=$(ls -1t $DUMP_PATH/*.gz | tail -1)
echo "Deleting file $oldest" > /dev/console
rm $oldest
fi
# Path to store dumps is prefixed with timestamp
timestamp="$(date +"%s")"
mkdir $DUMP_PATH/$timestamp
# Invoke minidump utility and provide path to store dumps
printf "%s\n" "starting minidump utility" > /dev/console
./usr/sbin/minidump 1 $DUMP_PATH/$timestamp > /dev/console
# Compress dump binaries
cd $DUMP_PATH
chmod 777 -R $timestamp/*
rm $timestamp/log.txt
tar -czvf minidump_$timestamp.tar.gz $timestamp/*
rm -rf $timestamp
# If tftp option is enabled, send dumps to tftp server
if [ "$TFTP" -eq 1 ]; then
if [ ! -n "$SERVER" ]; then
printf "%s\n" "Wrong configuaration SERVER = $SERVER" > /dev/console
exit 0
fi
printf "%s\n" "Collecting $DEVICENAME dump in $SERVER" > /dev/console
$(tftp -l minidump_$timestamp.tar.gz -p $SERVER 2>&1)
if [ $? -eq 0 ]; then
printf "%s\n" "$DEVICENAME dump collected in $SERVER" > /dev/console
else
printf "%s\n" "$DEVICENAME dump collection failed in $SERVER" > /dev/console
fi
fi
# If save dump to filesystem option is disabled, delete dump file
if [ "$SAVE_DUMPS" -ne 1 ]; then
rm minidump_$timestamp.tar.gz
fi
cd-
fi

View file

@ -1,8 +0,0 @@
config config 'config'
option enable_livedump '1'
config livedump 'livedump'
option path '/tmp/minidump'
option dump_count '10'
option tftp '1'
option save_dump '1'

View file

@ -1,55 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=aq-fw-download
PKG_BRANCH:=master
PKG_VERSION:=1.0
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/aq-fw-download
include $(INCLUDE_DIR)/package.mk
define AquantiaUtil
define Package/aq-fw-download
SECTION:=QCA
CATEGORY:=$(QTI_SOFTWARE_CATEGORY)
DEPENDS:=@TARGET_ipq806x||TARGET_ipq||TARGET_ipq40xx||TARGET_ipq807x_32||TARGET_ipq807x
TITLE:=Aquantia FW downloader utitlity
endef
define Package/aq-fw-download/description
Aquantia FW downloader utitlity
endef
TARGET_CPPFLAGS := \
-D_GNU_SOURCE \
-I$(LINUX_SRC_DIR)/include \
-I$(LINUX_SRC_DIR)/arch/$(LINUX_KARCH)/include \
-I$(PKG_BUILD_DIR) \
$(TARGET_CPPFLAGS)
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS)
endef
define Package/aq-fw-download/install
$(INSTALL_DIR) $$(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/aq-fw-download $$(1)/sbin/aq-fw-download
endef
$$(eval $$(call BuildPackage,aq-fw-download))
endef
#Build/Compile=true
$(eval $(call AquantiaUtil))

View file

@ -1,14 +0,0 @@
ifndef CFLAGS
CFLAGS = -O2 -g
endif
INCLUDES=-Iinclude -Iinclude/registerMap \
-Iinclude/registerMap/APPIA \
-Iinclude/registerMap/HHD
all: aq-fw-download
%.o: %.c
$(CC) $(INCLUDES) $(CFLAGS) -c -o $@ $^
aq-fw-download: mdioBootLoadCLD.o src/AQ_PhyInterface.o src/AQ_API.o
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)

View file

@ -1,246 +0,0 @@
/*
* Copyright (c) 2015, Aquantia
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* 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.
*/
/*! \file
This file contains the AQ_API function and datatype declarations. */
#ifndef AQ_API_TOKEN
#define AQ_API_TOKEN
#include <stdint.h>
#include "AQ_User.h"
#include "AQ_ReturnCodes.h"
/*******************************************************************
General
*******************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/*! This typedef defines the bool datatype which takes the values
true and false.*/
typedef enum {False = 0, True = 1} AQ_boolean;
/*@}*/
/*******************************************************************
Device Identity
*******************************************************************/
/*! \defgroup deviceIdentity Device Identity
All AQ_API functions accept a parameter identifying the target PHY that
should be acted upon. */
/*@{*/
/*! This enumeration is used to describe the different types of
Aquantia PHY.*/
typedef enum
{
/*! 1/2/4-port package, 40nm architechture.*/
AQ_DEVICE_APPIA,
/*! 1/2/4-port package, 28nm architechture.*/
AQ_DEVICE_HHD
} AQ_API_Device;
/*! This structure is used to specify a particular Aquantia PHY port
within the system.*/
typedef struct
{
/*! The type of Aquantia PHY*/
AQ_API_Device device;
/*! Uniquely identifies the port within the system. AQ_Port must be
defined to whatever data type is suitable for the platform.
AQ_API functions will never do anything with PHY_ID other than
pass it down to the platform's PHY register read/write
functions.*/
AQ_Port PHY_ID;
} AQ_API_Port;
/*@}*/
/*! This function boot-loads the instruction and data memory (IRAM and
DRAM) of a set of Aquantia PHYs from a .cld format image file (the
same image file used to burn the FLASH). During boot-load of each
Aquantia PHY, the processor is halted, and after programming is
complete the processor is released. Note that calling this
function leaves the daisy-chain disabled to prevent RAM over-
write. To exit MDIO boot-load mode, use the function
AQ_API_EnableDaisyChain.
Unlike most of the other functions in this API, this function can
operate on a group of PHYs simultaneously. This is referred to as
gang-loading. To facilitate this, this function takes as
parameters 3 parallel arrays: PHY_IDs, provisioningAddresses, and
resultCodes. The length of these arrays must be identical, and is
specified by the num_PHY_IDs parameter.
In order to check the integrity of the boot-load operation, a
CRC-16 value is calculated over the IRAM and DRAM. After the image
has been loaded, this value is directly compared against each
PHY's Mailbox CRC-16 in 1E.0201.
The value of register 1E.C441 must be the same for all the boot-
loaded PHYs. This will be checked before the boot-load is
performed, and if a non-uniform value is read from any of the
PHYs, the function will fail before any writes are performed.
A separate result code is returned for each of the boot-loaded
PHYs, in the OUT parameter, resultCodes.
Individual Port Return codes:
AQ_RET_BOOTLOAD_PROVADDR_OOR: The specified provisioning address
was outside of the permitted range.
AQ_RET_BOOTLOAD_NONUNIFORM_REGVALS: The values of the register(s)
that must be uniform across the ports being bootloaded were not
uniform.
AQ_RET_BOOTLOAD_CRC_MISMATCH: The image was completely loaded into
memory, but the after the port exited bootload the running
checksum that was read from the uP memory mailbox was not the
expected value. This indicates that the memory has potentially
been corrupted, and the PHY should be reset before trying the
bootload again.
Overall Return codes (the return value from the function call):
AQ_RET_OK: all ports were successfully bootloaded.
AQ_RET_ERROR: One or more ports were not successfully bootloaded.
*/
AQ_Retcode AQ_API_WriteBootLoadImage
(
/*! An array identifying the target PHY ports.*/
AQ_API_Port** ports,
/*! The length of the arrays ports, provisioningAddresses, and
resultCodes. These are parallel arrays, and must all be of the
same length.*/
unsigned int numPorts,
/*! The provisioning addresses of each of the PHYs specified in
ports. This can range from 0 through 47, and is also known as
the daisy-chain address or the hop-count. If the PHYs are
connected to a FLASH using the daisy-chain, this is the distance
from the PHY to the FLASH, and is used to identify customized
provisioning for each PHY from the provisioning data within the
image. Otherwise, it is an arbitrary number. The length of this
array must match the length of ports.*/
unsigned int* provisioningAddresses,
/*! OUT: The result code indicating success or failure of boot-
loading each of the PHYs specified in ports.*/
AQ_Retcode* resultCodes,
/*! A pointer to the size of the image (in bytes) that is being
loaded into the Aquantia PHY.*/
uint32_t* imageSizePointer,
/*! The image being loaded into the Aquantia PHY. This is the same
regardless of whether the target is internal RAM or FLASH.*/
uint8_t* image,
/*! The 5-bit address to be used during the gang-loading operation.
During the boot-loading process, each of the PHYs specified in
ports will be changed such that they are addressed on the MDIO
bus at gangloadAddress. This allows all the PHYs to be loaded
simultaneously. Before returning, each PHY will be moved back to
its original MDIO address. If ports contains only a single
element, callers will probably want to use the PHY's original
MDIO address for this parameter.*/
uint8_t gangload_MDIO_address,
/*! The address of the PHYs while in gangload mode. This is
ultimately some combination of the system address and the
gangload MDIO address, specified by gangload_MDIO_address. For
most platforms, gangload_MDIO_address and gangload_PHY_ID should
have the same value.*/
AQ_API_Port* gangloadPort
);
/*! This function boot-loads the instruction and data memory (IRAM and
DRAM) of a set of Aquantia PHYs from a .cld format image file (the
same image file used to burn the FLASH), as well as a separately
provided provisioning table image file.The provisioning table
image allows additional provisioning to be provided, beyond what
is built in to the .cld image. If provTableSizePointer or
provTableImage are NULL, this function behaves like
AQ_API_WriteBootLoadImage.
Aside from the additional provisioing table, this function behaves
exactly the same as AQ_API_WriteBootLoadImage. For additional
documentation and information on return codes, refer to
AQ_API_WriteBootLoadImage.
Individual Port Return codes (same as AQ_API_WriteBootLoadImage,
plus):
AQ_RET_BOOTLOAD_PROVTABLE_TOO_LARGE: The supplied provisioning
table image does not fit within the alloted space.*/
AQ_Retcode AQ_API_WriteBootLoadImageWithProvTable
(
/*! An array identifying the target PHY ports.*/
AQ_API_Port** ports,
/*! The length of the arrays ports, provisioningAddresses, and
resultCodes. These are parallel arrays, and must all be of the
same length.*/
unsigned int numPorts,
/*! The provisioning addresses of each of the PHYs specified in
ports. This can range from 0 through 47, and is also known as
the daisy-chain address or the hop-count. If the PHYs are
connected to a FLASH using the daisy-chain, this is the distance
from the PHY to the FLASH, and is used to identify customized
provisioning for each PHY from the provisioning data within the
image. Otherwise, it is an arbitrary number. The length of this
array must match the length of ports.*/
unsigned int* provisioningAddresses,
/*! OUT: The result code indicating success or failure of boot-
loading each of the PHYs specified in ports.*/
AQ_Retcode* resultCodes,
/*! A pointer to the size of the image (in bytes) that is being
loaded into the Aquantia PHY.*/
uint32_t* imageSizePointer,
/*! The image being loaded into the Aquantia PHY. This is the same
regardless of whether the target is internal RAM or FLASH.*/
uint8_t* image,
/*! The 5-bit address to be used during the gang-loading operation.
During the boot-loading process, each of the PHYs specified in
ports will be changed such that they are addressed on the MDIO
bus at gangloadAddress. This allows all the PHYs to be loaded
simultaneously. Before returning, each PHY will be moved back to
its original MDIO address. If ports contains only a single
element, callers will probably want to use the PHY's original
MDIO address for this parameter.*/
uint8_t gangload_MDIO_address,
/*! The address of the PHYs while in gangload mode. This is
ultimately some combination of the system address and the
gangload MDIO address, specified by gangload_MDIO_address. For
most platforms, gangload_MDIO_address and gangload_PHY_ID should
have the same value.*/
AQ_API_Port* gangloadPort,
/*! A pointer to the size of the provTableImage (in bytes) that is
being loaded into the Aquantia PHY.*/
uint32_t* provTableSizePointer,
/*! The additional provisioning table image being loaded into the
Aquantia PHY.*/
uint8_t* provTableImage
);
/*! Calling this function disables boot-loading and enables the daisy-
chain. This would typically be called after using MDIO boot-
loading on a daisy-chain enabled PHY. Re-enabling the daisy-chain
after performing an MDIO bootload will cause the PHY to reboot
from FLASH.*/
AQ_Retcode AQ_API_EnableDaisyChain
(
/*! The target PHY port.*/
AQ_API_Port* port
);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,171 +0,0 @@
/* AQ_PhyInterface.h */
/***********************************************************************
* Copyright (c) 2015, Aquantia
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* 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.
*
* Description:
*
* Declares the base PHY register read and write functions that are
* called by the API functions. The platform integrator must provide
* the implementation of these routines.
*
***********************************************************************/
/*! \file
* Declares the base PHY register read and write functions that are
* called by the API functions. The platform integrator must provide
* the implementation of these routines. */
#ifndef AQ_PHY_INTERFACE_TOKEN
#define AQ_PHY_INTERFACE_TOKEN
#include "AQ_API.h"
#include "AQ_User.h"
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************
MDIO Access Functions
*******************************************************************/
/*! \defgroup mdioAccessFunctions MDIO Access Functions
The MDIO access functions are required by the API to access the register space
of each Aquantia PHY deployed in a system. The body of these functions needs to
be written by the system designer, as the method of accessing the PHY will
be unique to the target system. They are designed to be generic read and
write access functions, as the MDIO addressing scheme relies on each
MMD to maintain a 16 bit address pointer that determines the register where
the next read or write is coming from. Consequently, various levels of
optimization of the MDIO interface are possible: from re-writing the MMD
address pointer on every transaction, to storing shadow copies of the MMD
address pointers and only updating the MMD address pointer as necessary.
Thus these functions leave the MDIO optimization to the system engineer.
*/
/*@{*/
/*! Provides generic synchronous PHY register write functionality. It is the
* responsibility of the system designer to provide the specific MDIO address
* pointer updates, etc. in order to accomplish this write operation.
* It will be assumed that the write has been completed by the time this
* function returns.*/
void AQ_API_MDIO_Write
(
/*! Uniquely identifies the port within the system. AQ_Port must be
* defined to a whatever data type is suitable for the platform.*/
AQ_Port PHY_ID,
/*! The address of the MMD within the target PHY. */
unsigned int MMD,
/*! The 16-bit address of the PHY register being written. */
unsigned int address,
/*! The 16-bits of data to write to the specified PHY register. */
unsigned int data
);
/*! Provides generic synchronous PHY register read functionality. It is the
* responsibility of the system designer to provide the specific MDIO address
* pointer updates, etc. in order to accomplish this read operation.*/
unsigned int AQ_API_MDIO_Read
(
/*! Uniquely identifies the port within the system. AQ_Port must be
* defined to a whatever data type is suitable for the platform.*/
AQ_Port PHY_ID,
/*! The address of the MMD within the target PHY. */
unsigned int MMD,
/*! The 16-bit address of the PHY register being read. */
unsigned int address
);
#ifdef AQ_PHY_SUPPORTS_BLOCK_READ_WRITE
/*! Provides generic asynchronous/buffered PHY register write functionality.
* It is the responsibility of the system designer to provide the specific
* MDIO address pointer updates, etc. in order to accomplish this write
* operation. The write need not necessarily have been completed by the time
* this function returns. All register reads and writes to a particular PHY_ID
* that are requested by calling AQ_API_MDIO_BlockWrite or AQ_API_MDIO_BlockRead
* MUST be performed in the order that the calls are made. */
void AQ_API_MDIO_BlockWrite
(
/*! Uniquely identifies the port within the system. AQ_Port must be
* defined to a whatever data type is suitable for the platform.*/
AQ_Port PHY_ID,
/*! The address of the MMD within the target PHY. */
unsigned int MMD,
/*! The 16-bit address of the PHY register being written. */
unsigned int address,
/*! The 16-bits of data to write to the specified PHY register. */
unsigned int data
);
/*! Provides generic asynchronous/buffered PHY register read functionality.
* It is the responsibility of the system designer to provide the specific
* MDIO address pointer updates, etc. in order to accomplish this read
* operation. All register reads and writes to a particular PHY_ID that
* are requested by calling AQ_API_MDIO_BlockWrite or AQ_API_MDIO_BlockRead
* MUST be performed in the order that the calls are made. The register value
* may subsequently be fetched by calling AQ_API_MDIO_BlockOperationExecute.*/
void AQ_API_MDIO_BlockRead
(
/*! Uniquely identifies the port within the system. AQ_Port must be
* defined to a whatever data type is suitable for the platform.*/
AQ_Port PHY_ID,
/*! The address of the MMD within the target PHY. */
unsigned int MMD,
/*! The 16-bit address of the PHY register being read. */
unsigned int address
);
/* Retrieve the results of all PHY register reads to PHY_ID previously
* requested via calls to AQ_API_MDIO_BlockRead. The read and write
* operations previously performed by calls to AQ_API_MDIO_BlockRead and
* AQ_API_MDIO_BlockRead must have all been completed by the time this
* function returns, in the order that the calls were performed. The
* return value is an array representing the fetched results of all
* pending calls to AQ_API_MDIO_BlockRead, in the order that the calls
* were performed. Callers should track the number of pending block
* reads to determine the size of the returned array. */
unsigned int * AQ_API_MDIO_BlockOperationExecute
(
/*! Uniquely identifies the port within the system. AQ_Port must be
* defined to a whatever data type is suitable for the platform.*/
AQ_Port PHY_ID
);
/* Returns the maximum number of asynchronous/buffered PHY register
* read/write operations. Callers will call AQ_API_MDIO_BlockOperationExecute
* before issuing additional calls to AQ_API_MDIO_BlockWrite or
* AQ_API_MDIO_BlockRead to avoid a buffer overflow. */
unsigned int AQ_API_MDIO_MaxBlockOperations
(
);
#endif
/*@}*/
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,71 +0,0 @@
/*AQ_PlatformRoutines.h*/
/************************************************************************************
* Copyright (c) 2015, Aquantia
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* 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.
*
* Description:
*
* Declares the platform interface functions that will be called by AQ_API
* functions. The platform integrator must provide the implementation of
* these functions.
*
************************************************************************************/
/*! \file
* Declares the platform interface functions that will be called by AQ_API
* functions. The platform integrator must provide the implementation of
* these functions. */
#ifndef AQ_PHY_PLATFORMROUTINES_TOKEN
#define AQ_PHY_PLATFORMROUTINES_TOKEN
#include <stdint.h>
#include "AQ_API.h"
#include "AQ_User.h"
#include "AQ_ReturnCodes.h"
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************
Time Delay
*******************************************************************/
/*! \defgroup delay Time Delay
@{
*/
/*! Returns after at least milliseconds have elapsed. This must be implemented
* in a platform-approriate way. AQ_API functions will call this function to
* block for the specified period of time. If necessary, PHY register reads
* may be performed on port to busy-wait. */
void AQ_API_Wait
(
uint32_t milliseconds, /*!< The delay in milliseconds */
AQ_API_Port* port /*!< The PHY to use if delay reads are necessary*/
);
/*@}*/
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,323 +0,0 @@
/* Copyright (c) 2015, Aquantia
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* 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.
*/
/*! \file
This file contains macros for accessing the AQ PHYs' registers
using the device-specific register map data structures and definitions.
*/
#ifndef AQ_REG_MACRO_TOKEN
#define AQ_REG_MACRO_TOKEN
#include "AQ_PhyInterface.h"
#define AQ_API_ReadRegister(id,reg,wd) AQ_API_ReadRegister_DeviceRestricted(APPIA_HHD,id,reg,wd)
#define AQ_API_ReadRegister_DeviceRestricted(devices,id,reg,wd) AQ_API_ReadRegister_Devs_ ## devices(id,reg,wd)
#define AQ_API_ReadRegister_Devs_APPIA(id,reg,wd) \
((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_Read (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd)) : \
(0))
#define AQ_API_ReadRegister_Devs_HHD(id,reg,wd) \
((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_Read (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd)) : \
(0))
#define AQ_API_ReadRegister_Devs_APPIA_HHD(id,reg,wd) \
((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_Read (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd)) : \
((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_Read (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd)) : \
(0)))
#define AQ_API_ReadRegister_Devs_HHD_APPIA(id,reg,wd) AQ_API_ReadRegister_Devs_APPIA_HHD(id,reg,wd)
#define AQ_API_WriteRegister(id,reg,wd,value) AQ_API_WriteRegister_DeviceRestricted(APPIA_HHD,id,reg,wd,value)
#define AQ_API_WriteRegister_DeviceRestricted(devices,id,reg,wd,value) AQ_API_WriteRegister_Devs_ ## devices(id,reg,wd,value)
#define AQ_API_WriteRegister_Devs_APPIA(id,reg,wd,value) \
((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_Write (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd),value) : \
((void)0))
#define AQ_API_WriteRegister_Devs_HHD(id,reg,wd,value) \
((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_Write (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd),value) : \
((void)0))
#define AQ_API_WriteRegister_Devs_APPIA_HHD(id,reg,wd,value) \
((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_Write (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd),value) : \
((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_Write (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd),value) : \
((void)0)))
#define AQ_API_WriteRegister_Devs_HHD_APPIA(id,reg,wd,value) AQ_API_WriteRegister_Devs_APPIA_HHD(id,reg,wd,value)
#ifdef AQ_PHY_SUPPORTS_BLOCK_READ_WRITE
#define AQ_API_BlockReadRegister(id,reg,wd) AQ_API_BlockReadRegister_DeviceRestricted(APPIA_HHD,id,reg,wd)
#define AQ_API_BlockReadRegister_DeviceRestricted(devices,id,reg,wd) AQ_API_BlockReadRegister_Devs_ ## devices(id,reg,wd)
#define AQ_API_BlockReadRegister_Devs_APPIA(id,reg,wd) \
((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_BlockRead (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd)) : \
((void)0))
#define AQ_API_BlockReadRegister_Devs_HHD(id,reg,wd) \
((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_BlockRead (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd)) : \
((void)0))
#define AQ_API_BlockReadRegister_Devs_APPIA_HHD(id,reg,wd) \
((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_BlockRead (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd)) : \
((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_BlockRead (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd)) : \
((void)0)))
#define AQ_API_BlockReadRegister_Devs_HHD_APPIA(id,reg,wd) AQ_API_BlockReadRegister_Devs_APPIA_HHD(id,reg,wd)
#define AQ_API_BlockWriteRegister(id,reg,wd,value) AQ_API_BlockWriteRegister_DeviceRestricted(APPIA_HHD,id,reg,wd,value)
#define AQ_API_BlockWriteRegister_DeviceRestricted(devices,id,reg,wd,value) AQ_API_BlockWriteRegister_Devs_ ## devices(id,reg,wd,value)
#define AQ_API_BlockWriteRegister_Devs_APPIA(id,reg,wd,value) \
((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_BlockWrite (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd),value) : \
((void)0))
#define AQ_API_BlockWriteRegister_Devs_HHD(id,reg,wd,value) \
((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_BlockWrite (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd),value) : \
((void)0))
#define AQ_API_BlockWriteRegister_Devs_APPIA_HHD(id,reg,wd,value) \
((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_BlockWrite (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd),value) : \
((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_BlockWrite (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd),value) : \
((void)0)))
#define AQ_API_BlockWriteRegister_Devs_HHD_APPIA(id,reg,wd,value) AQ_API_BlockWriteRegister_Devs_APPIA_HHD(id,reg,wd,value)
#endif
#define AQ_API_Variable(reg) AQ_API_Variable_DeviceRestricted(APPIA_HHD,reg)
#define AQ_API_Variable_DeviceRestricted(devices,reg) AQ_API_Variable_Devs_ ## devices(reg)
#define AQ_API_Variable_Devs_APPIA(reg) uint8_t _local ## reg ## _space[ sizeof(reg ## _BiggestVersion) ];\
reg ## _APPIA* _local ## reg ## _APPIA = (reg ## _APPIA*) _local ## reg ## _space; \
#define AQ_API_Variable_Devs_HHD(reg) uint8_t _local ## reg ## _space[ sizeof(reg ## _BiggestVersion) ];\
reg ## _HHD* _local ## reg ## _HHD = (reg ## _HHD*) _local ## reg ## _space; \
#define AQ_API_Variable_Devs_APPIA_HHD(reg) uint8_t _local ## reg ## _space[ sizeof(reg ## _BiggestVersion) ];\
reg ## _APPIA* _local ## reg ## _APPIA = (reg ## _APPIA*) _local ## reg ## _space; \
reg ## _HHD* _local ## reg ## _HHD = (reg ## _HHD*) _local ## reg ## _space; \
#define AQ_API_Variable_Devs_HHD_APPIA(reg) AQ_API_Variable_Devs_APPIA_HHD(reg)
#define AQ_API_DeclareLocalStruct(reg,localvar) AQ_API_DeclareLocalStruct_DeviceRestricted(APPIA_HHD,reg,localvar)
#define AQ_API_DeclareLocalStruct_DeviceRestricted(devices,reg,localvar) AQ_API_DeclareLocalStruct_Devs_ ## devices(reg,localvar)
#define AQ_API_DeclareLocalStruct_Devs_APPIA(reg,localvar) uint8_t localvar ## _space[ sizeof(reg ## _BiggestVersion) ];\
reg ## _APPIA* localvar ## _APPIA = (reg ## _APPIA*) localvar ## _space; \
#define AQ_API_DeclareLocalStruct_Devs_HHD(reg,localvar) uint8_t localvar ## _space[ sizeof(reg ## _BiggestVersion) ];\
reg ## _HHD* localvar ## _HHD = (reg ## _HHD*) localvar ## _space; \
#define AQ_API_DeclareLocalStruct_Devs_APPIA_HHD(reg,localvar) uint8_t localvar ## _space[ sizeof(reg ## _BiggestVersion) ];\
reg ## _APPIA* localvar ## _APPIA = (reg ## _APPIA*) localvar ## _space; \
reg ## _HHD* localvar ## _HHD = (reg ## _HHD*) localvar ## _space; \
#define AQ_API_DeclareLocalStruct_Devs_HHD_APPIA(reg,localvar) AQ_API_DeclareLocalStruct_Devs_APPIA_HHD(reg,localvar)
#define AQ_API_Set(id,reg,field,value) AQ_API_Set_DeviceRestricted(APPIA_HHD,id,reg,field,value)
#define AQ_API_Set_DeviceRestricted(devices,id,reg,field,value) AQ_API_Set_Devs_ ## devices(id,reg,field,value)
#define AQ_API_Set_Devs_APPIA(id,reg,field,value) { \
switch (port->device) { \
case AQ_DEVICE_APPIA: \
_local ## reg ## _APPIA->word_ ## reg ## _APPIA_ ## field = AQ_API_ReadRegister_Devs_APPIA(id,reg,reg ## _APPIA_ ## field); \
if (_local ## reg ## _APPIA->bits_ ## reg ## _APPIA_ ## field.field != value) \
{ \
_local ## reg ## _APPIA->bits_ ## reg ## _APPIA_ ## field.field = value; \
AQ_API_WriteRegister_Devs_APPIA(id,reg,reg ## _APPIA_ ## field,_local ## reg ## _APPIA->word_ ## reg ## _APPIA_ ## field); \
} \
break; \
default: break; \
} \
}
#define AQ_API_Set_Devs_HHD(id,reg,field,value) { \
switch (port->device) { \
case AQ_DEVICE_HHD: \
_local ## reg ## _HHD->word_ ## reg ## _HHD_ ## field = AQ_API_ReadRegister_Devs_HHD(id,reg,reg ## _HHD_ ## field); \
if (_local ## reg ## _HHD->bits_ ## reg ## _HHD_ ## field.field != value) \
{ \
_local ## reg ## _HHD->bits_ ## reg ## _HHD_ ## field.field = value; \
AQ_API_WriteRegister_Devs_HHD(id,reg,reg ## _HHD_ ## field,_local ## reg ## _HHD->word_ ## reg ## _HHD_ ## field); \
} \
break; \
default: break; \
} \
}
#define AQ_API_Set_Devs_APPIA_HHD(id,reg,field,value) { \
switch (port->device) { \
case AQ_DEVICE_APPIA: \
_local ## reg ## _APPIA->word_ ## reg ## _APPIA_ ## field = AQ_API_ReadRegister_Devs_APPIA_HHD(id,reg,reg ## _APPIA_ ## field); \
if (_local ## reg ## _APPIA->bits_ ## reg ## _APPIA_ ## field.field != value) \
{ \
_local ## reg ## _APPIA->bits_ ## reg ## _APPIA_ ## field.field = value; \
AQ_API_WriteRegister_Devs_APPIA_HHD(id,reg,reg ## _APPIA_ ## field,_local ## reg ## _APPIA->word_ ## reg ## _APPIA_ ## field); \
} \
break; \
case AQ_DEVICE_HHD: \
_local ## reg ## _HHD->word_ ## reg ## _HHD_ ## field = AQ_API_ReadRegister_Devs_APPIA_HHD(id,reg,reg ## _HHD_ ## field); \
if (_local ## reg ## _HHD->bits_ ## reg ## _HHD_ ## field.field != value) \
{ \
_local ## reg ## _HHD->bits_ ## reg ## _HHD_ ## field.field = value; \
AQ_API_WriteRegister_Devs_APPIA_HHD(id,reg,reg ## _HHD_ ## field,_local ## reg ## _HHD->word_ ## reg ## _HHD_ ## field); \
} \
break; \
default: break; \
} \
}
#define AQ_API_Set_Devs_HHD_APPIA(id,reg,field,value) AQ_API_Set_Devs_APPIA_HHD(id,reg,field,value)
#define AQ_API_Get(id,reg,field,value) AQ_API_Get_DeviceRestricted(APPIA_HHD,id,reg,field,value)
#define AQ_API_Get_DeviceRestricted(devices,id,reg,field,value) AQ_API_Get_Devs_ ## devices(id,reg,field,value)
#define AQ_API_Get_Devs_APPIA(id,reg,field,value) { \
switch (port->device) { \
case AQ_DEVICE_APPIA: \
_local ## reg ## _APPIA->word_ ## reg ## _APPIA_ ## field = AQ_API_ReadRegister_Devs_APPIA(id,reg,reg ## _APPIA_ ## field); \
value = _local ## reg ## _APPIA->bits_ ## reg ## _APPIA_ ## field.field; \
break; \
default: value = 0; break; \
} \
}
#define AQ_API_Get_Devs_HHD(id,reg,field,value) { \
switch (port->device) { \
case AQ_DEVICE_HHD: \
_local ## reg ## _HHD->word_ ## reg ## _HHD_ ## field = AQ_API_ReadRegister_Devs_HHD(id,reg,reg ## _HHD_ ## field); \
value = _local ## reg ## _HHD->bits_ ## reg ## _HHD_ ## field.field; \
break; \
default: value = 0; break; \
} \
}
#define AQ_API_Get_Devs_APPIA_HHD(id,reg,field,value) { \
switch (port->device) { \
case AQ_DEVICE_APPIA: \
_local ## reg ## _APPIA->word_ ## reg ## _APPIA_ ## field = AQ_API_ReadRegister_Devs_APPIA_HHD(id,reg,reg ## _APPIA_ ## field); \
value = _local ## reg ## _APPIA->bits_ ## reg ## _APPIA_ ## field.field; \
break; \
case AQ_DEVICE_HHD: \
_local ## reg ## _HHD->word_ ## reg ## _HHD_ ## field = AQ_API_ReadRegister_Devs_APPIA_HHD(id,reg,reg ## _HHD_ ## field); \
value = _local ## reg ## _HHD->bits_ ## reg ## _HHD_ ## field.field; \
break; \
default: value = 0; break; \
} \
}
#define AQ_API_Get_Devs_HHD_APPIA(id,reg,field,value) AQ_API_Get_Devs_APPIA_HHD(id,reg,field,value)
#define AQ_API_BitfieldOfLocalStruct(reg,localvar,field) AQ_API_BitfieldOfLocalStruct_DeviceRestricted(APPIA_HHD,reg,localvar,field)
#define AQ_API_BitfieldOfLocalStruct_DeviceRestricted(devices,reg,localvar,field) AQ_API_BitfieldOfLocalStruct_Devs_ ## devices(reg,localvar,field)
#define AQ_API_BitfieldOfLocalStruct_Devs_APPIA(reg,localvar,field) \
((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->bits_ ## reg ## _APPIA ## _ ## field.field) : \
(0))
#define AQ_API_BitfieldOfLocalStruct_Devs_HHD(reg,localvar,field) \
((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->bits_ ## reg ## _HHD ## _ ## field.field) : \
(0))
#define AQ_API_BitfieldOfLocalStruct_Devs_APPIA_HHD(reg,localvar,field) \
((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->bits_ ## reg ## _HHD ## _ ## field.field) : \
((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->bits_ ## reg ## _APPIA ## _ ## field.field) : \
(0)))
#define AQ_API_BitfieldOfLocalStruct_Devs_HHD_APPIA(reg,localvar,field) AQ_API_BitfieldOfLocalStruct_Devs_APPIA_HHD(reg,localvar,field)
#define AQ_API_AssignBitfieldOfLocalStruct(reg,localvar,field,value) AQ_API_AssignBitfieldOfLocalStruct_DeviceRestricted(APPIA_HHD,reg,localvar,field,value)
#define AQ_API_AssignBitfieldOfLocalStruct_DeviceRestricted(devices,reg,localvar,field,value) AQ_API_AssignBitfieldOfLocalStruct_Devs_ ## devices(reg,localvar,field,value)
#define AQ_API_AssignBitfieldOfLocalStruct_Devs_APPIA(reg,localvar,field,value) \
((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->bits_ ## reg ## _APPIA ## _ ## field.field = value) : \
(0))
#define AQ_API_AssignBitfieldOfLocalStruct_Devs_HHD(reg,localvar,field,value) \
((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->bits_ ## reg ## _HHD ## _ ## field.field = value) : \
(0))
#define AQ_API_AssignBitfieldOfLocalStruct_Devs_APPIA_HHD(reg,localvar,field,value) \
((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->bits_ ## reg ## _HHD ## _ ## field.field = value) : \
((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->bits_ ## reg ## _APPIA ## _ ## field.field = value) : \
(0)))
#define AQ_API_AssignBitfieldOfLocalStruct_Devs_HHD_APPIA(reg,localvar,field,value) AQ_API_AssignBitfieldOfLocalStruct_Devs_APPIA_HHD(reg,localvar,field,value)
#define AQ_API_WordOfLocalStruct(localvar,wd) AQ_API_WordOfLocalStruct_DeviceRestricted(APPIA_HHD,localvar,wd)
#define AQ_API_WordOfLocalStruct_DeviceRestricted(devices,localvar,wd) AQ_API_WordOfLocalStruct_Devs_ ## devices(localvar,wd)
#define AQ_API_WordOfLocalStruct_Devs_APPIA(localvar,wd) \
((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->u ## wd.word_ ## wd) : \
(0))
#define AQ_API_WordOfLocalStruct_Devs_HHD(localvar,wd) \
((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->u ## wd.word_ ## wd) : \
(0))
#define AQ_API_WordOfLocalStruct_Devs_APPIA_HHD(localvar,wd) \
((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->u ## wd.word_ ## wd) : \
((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->u ## wd.word_ ## wd) : \
(0)))
#define AQ_API_WordOfLocalStruct_Devs_HHD_APPIA(localvar,wd) AQ_API_WordOfLocalStruct_Devs_APPIA_HHD(localvar,wd)
#define AQ_API_AssignWordOfLocalStruct(localvar,wd,value) AQ_API_AssignWordOfLocalStruct_DeviceRestricted(APPIA_HHD,localvar,wd,value)
#define AQ_API_AssignWordOfLocalStruct_DeviceRestricted(devices,localvar,wd,value) AQ_API_AssignWordOfLocalStruct_Devs_ ## devices(localvar,wd,value)
#define AQ_API_AssignWordOfLocalStruct_Devs_APPIA(localvar,wd,value) \
((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->u ## wd.word_ ## wd = value) : \
(0))
#define AQ_API_AssignWordOfLocalStruct_Devs_HHD(localvar,wd,value) \
((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->u ## wd.word_ ## wd = value) : \
(0))
#define AQ_API_AssignWordOfLocalStruct_Devs_APPIA_HHD(localvar,wd,value) \
((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->u ## wd.word_ ## wd = value) : \
((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->u ## wd.word_ ## wd = value) : \
(0)))
#define AQ_API_AssignWordOfLocalStruct_Devs_HHD_APPIA(localvar,wd,value) AQ_API_AssignWordOfLocalStruct_Devs_APPIA_HHD(localvar,wd,value)
#endif

Some files were not shown because too many files have changed in this diff Show more