From 4d265de38a2a36a7f438e0de42c00289fd03a00b Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 30 Jun 2021 11:48:38 +0200 Subject: [PATCH] ucentral: development update * add missing patch for over the air roaming * update usteer init.d script * add Indio um-305ac support * add support for tplink powerline * update ucentral-schema Signed-off-by: John Crispin --- .github/workflows/build-dev.yml | 2 +- .../0039-hostapd-upsate-to-latest-HEAD.patch | 52 +++++- feeds/ucentral/ucentral-schema/Makefile | 2 +- feeds/ucentral/usteer/files/etc/init.d/usteer | 15 ++ .../hostapd/patches/730-ft_iface.patch | 38 ++++ ...26-ath79-add-support-for-Indio-305AC.patch | 172 ++++++++++++++++++ patches/0027-ath79-tl-wpa8630p-fixes.patch | 47 +++++ profiles/indio_um-305ac.yml | 9 + profiles/tplink_wpa8630p.yml | 8 + profiles/ucentral-powerline.yml | 45 +++++ 10 files changed, 385 insertions(+), 5 deletions(-) create mode 100644 feeds/wifi-ax/hostapd/patches/730-ft_iface.patch create mode 100644 patches/0026-ath79-add-support-for-Indio-305AC.patch create mode 100644 patches/0027-ath79-tl-wpa8630p-fixes.patch create mode 100755 profiles/indio_um-305ac.yml create mode 100644 profiles/tplink_wpa8630p.yml create mode 100644 profiles/ucentral-powerline.yml diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index 0b77551c4..395bcecd7 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - target: ['cig_wf188', 'cig_wf194c', 'cig_wf160d', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_ecs4100-12ph', 'edgecore_ecw5211', 'edgecore_ecw5410', 'edgecore_oap100', 'linksys_e8450-ubi', 'linksys_ea8300', 'tplink_cpe210_v3', 'tplink_cpe510_v3', 'tplink_eap225_outdoor_v1', 'tplink_ec420', 'tplink_ex227', 'tplink_ex228', 'tplink_ex447' ] + target: ['cig_wf188', 'cig_wf194c', 'cig_wf160d', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_ecs4100-12ph', 'edgecore_ecw5211', 'edgecore_ecw5410', 'edgecore_oap100', 'indio_um-305ac', 'linksys_e8450-ubi', 'linksys_ea8300', 'tplink_cpe210_v3', 'tplink_cpe510_v3', 'tplink_eap225_outdoor_v1', 'tplink_ec420', 'tplink_ex227', 'tplink_ex228', 'tplink_ex447' ] steps: - uses: actions/checkout@v2 diff --git a/backports/0039-hostapd-upsate-to-latest-HEAD.patch b/backports/0039-hostapd-upsate-to-latest-HEAD.patch index 949f19c46..c8ae0dbde 100644 --- a/backports/0039-hostapd-upsate-to-latest-HEAD.patch +++ b/backports/0039-hostapd-upsate-to-latest-HEAD.patch @@ -1,7 +1,7 @@ -From 6661e39d14a72d9f293553222a89e4d2c9f1e0e2 Mon Sep 17 00:00:00 2001 +From 5519a028a1181e1a538010acff9e0a2390e8f0b0 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 27 May 2021 13:25:19 +0200 -Subject: [PATCH 01/34] hostapd: upsate to latest HEAD +Subject: [PATCH 01/36] hostapd: upsate to latest HEAD Signed-off-by: John Crispin --- @@ -62,11 +62,12 @@ Signed-off-by: John Crispin .../hostapd/patches/710-vlan_no_bridge.patch | 41 +++ .../720-ACS-fix-channel-100-frequency.patch | 30 ++ .../patches/720-iface_max_num_sta.patch | 82 ++++++ + .../hostapd/patches/730-ft_iface.patch | 38 +++ ...ate-if-no-available-channel-is-found.patch | 37 --- ...of-secondary-device-types-for-P2P-gr.patch | 33 --- .../services/hostapd/src/src/ap/ubus.c | 70 ++++- .../services/hostapd/src/src/ap/ubus.h | 16 ++ - 61 files changed, 719 insertions(+), 2320 deletions(-) + 62 files changed, 757 insertions(+), 2320 deletions(-) delete mode 100644 package/network/services/hostapd/patches/001-HE-VHT-fix-frequency-setup-with-HE-enabled.patch create mode 100644 package/network/services/hostapd/patches/001-wolfssl-init-RNG-with-ECC-key.patch delete mode 100644 package/network/services/hostapd/patches/002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch @@ -96,6 +97,7 @@ Signed-off-by: John Crispin create mode 100644 package/network/services/hostapd/patches/710-vlan_no_bridge.patch create mode 100644 package/network/services/hostapd/patches/720-ACS-fix-channel-100-frequency.patch create mode 100644 package/network/services/hostapd/patches/720-iface_max_num_sta.patch + create mode 100644 package/network/services/hostapd/patches/730-ft_iface.patch delete mode 100644 package/network/services/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch delete mode 100644 package/network/services/hostapd/patches/801-P2P-Fix-copying-of-secondary-device-types-for-P2P-gr.patch @@ -4858,6 +4860,50 @@ index 0000000000..b93a0bcbef + char country[3]; /* first two octets: country code as described in + * ISO/IEC 3166-1. Third octet: + * ' ' (ascii 32): all environments +diff --git a/package/network/services/hostapd/patches/730-ft_iface.patch b/package/network/services/hostapd/patches/730-ft_iface.patch +new file mode 100644 +index 0000000000..793e8e0194 +--- /dev/null ++++ b/package/network/services/hostapd/patches/730-ft_iface.patch +@@ -0,0 +1,38 @@ ++--- a/hostapd/config_file.c +++++ b/hostapd/config_file.c ++@@ -3031,6 +3031,8 @@ static int hostapd_config_fill(struct ho ++ wpa_printf(MSG_INFO, ++ "Line %d: Obsolete peerkey parameter ignored", line); ++ #ifdef CONFIG_IEEE80211R_AP +++ } else if (os_strcmp(buf, "ft_iface") == 0) { +++ os_strlcpy(bss->ft_iface, pos, sizeof(bss->ft_iface)); ++ } else if (os_strcmp(buf, "mobility_domain") == 0) { ++ if (os_strlen(pos) != 2 * MOBILITY_DOMAIN_ID_LEN || ++ hexstr2bin(pos, bss->mobility_domain, ++--- a/src/ap/ap_config.h +++++ b/src/ap/ap_config.h ++@@ -277,6 +277,7 @@ struct airtime_sta_weight { ++ struct hostapd_bss_config { ++ char iface[IFNAMSIZ + 1]; ++ char bridge[IFNAMSIZ + 1]; +++ char ft_iface[IFNAMSIZ + 1]; ++ char vlan_bridge[IFNAMSIZ + 1]; ++ char wds_bridge[IFNAMSIZ + 1]; ++ ++--- a/src/ap/wpa_auth_glue.c +++++ b/src/ap/wpa_auth_glue.c ++@@ -1565,8 +1565,12 @@ int hostapd_setup_wpa(struct hostapd_dat ++ wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) { ++ const char *ft_iface; ++ ++- ft_iface = hapd->conf->bridge[0] ? hapd->conf->bridge : ++- hapd->conf->iface; +++ if (hapd->conf->ft_iface[0]) +++ ft_iface = hapd->conf->ft_iface; +++ else if (hapd->conf->bridge[0]) +++ ft_iface = hapd->conf->bridge; +++ else +++ ft_iface = hapd->conf->iface; ++ hapd->l2 = l2_packet_init(ft_iface, NULL, ETH_P_RRB, ++ hostapd_rrb_receive, hapd, 1); ++ if (!hapd->l2) { diff --git a/package/network/services/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch b/package/network/services/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch deleted file mode 100644 index 3e4638d7ff..0000000000 diff --git a/feeds/ucentral/ucentral-schema/Makefile b/feeds/ucentral/ucentral-schema/Makefile index c0ff4fd39..c77044fb4 100644 --- a/feeds/ucentral/ucentral-schema/Makefile +++ b/feeds/ucentral/ucentral-schema/Makefile @@ -6,7 +6,7 @@ PKG_RELEASE:=1 PKG_SOURCE_URL=https://github.com/blogic/ucentral-schema.git PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE:=2021-02-15 -PKG_SOURCE_VERSION:=f348023ccac79036bef52576a12350f99fa5c5c5 +PKG_SOURCE_VERSION:=978604e4720dcdec388171ea3b037c2ed7e19aab PKG_MAINTAINER:=John Crispin PKG_LICENSE:=BSD-3-Clause diff --git a/feeds/ucentral/usteer/files/etc/init.d/usteer b/feeds/ucentral/usteer/files/etc/init.d/usteer index f89751147..92895577f 100755 --- a/feeds/ucentral/usteer/files/etc/init.d/usteer +++ b/feeds/ucentral/usteer/files/etc/init.d/usteer @@ -21,6 +21,19 @@ load_ifaces() { done } +_add_string() { + json_add_string "" "$1" +} + +uci_option_to_json_string_array() { + local cfg="$1" + local option="$2" + + json_add_array "$option" + config_list_foreach "$cfg" "$option" _add_string + json_close_array +} + uci_option_to_json_bool() { local cfg="$1" local option="$2" @@ -55,6 +68,8 @@ uci_usteer() { uci_option_to_json_bool "$cfg" load_kick_enabled uci_option_to_json_bool "$cfg" assoc_steering uci_option_to_json_string "$cfg" node_up_script + uci_option_to_json_string_array "$cfg" ssid_list + uci_option_to_json_string_array "$cfg" event_log_types for opt in \ debug_level \ diff --git a/feeds/wifi-ax/hostapd/patches/730-ft_iface.patch b/feeds/wifi-ax/hostapd/patches/730-ft_iface.patch new file mode 100644 index 000000000..793e8e019 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/730-ft_iface.patch @@ -0,0 +1,38 @@ +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -3031,6 +3031,8 @@ static int hostapd_config_fill(struct ho + wpa_printf(MSG_INFO, + "Line %d: Obsolete peerkey parameter ignored", line); + #ifdef CONFIG_IEEE80211R_AP ++ } else if (os_strcmp(buf, "ft_iface") == 0) { ++ os_strlcpy(bss->ft_iface, pos, sizeof(bss->ft_iface)); + } else if (os_strcmp(buf, "mobility_domain") == 0) { + if (os_strlen(pos) != 2 * MOBILITY_DOMAIN_ID_LEN || + hexstr2bin(pos, bss->mobility_domain, +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -277,6 +277,7 @@ struct airtime_sta_weight { + struct hostapd_bss_config { + char iface[IFNAMSIZ + 1]; + char bridge[IFNAMSIZ + 1]; ++ char ft_iface[IFNAMSIZ + 1]; + char vlan_bridge[IFNAMSIZ + 1]; + char wds_bridge[IFNAMSIZ + 1]; + +--- a/src/ap/wpa_auth_glue.c ++++ b/src/ap/wpa_auth_glue.c +@@ -1565,8 +1565,12 @@ int hostapd_setup_wpa(struct hostapd_dat + wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) { + const char *ft_iface; + +- ft_iface = hapd->conf->bridge[0] ? hapd->conf->bridge : +- hapd->conf->iface; ++ if (hapd->conf->ft_iface[0]) ++ ft_iface = hapd->conf->ft_iface; ++ else if (hapd->conf->bridge[0]) ++ ft_iface = hapd->conf->bridge; ++ else ++ ft_iface = hapd->conf->iface; + hapd->l2 = l2_packet_init(ft_iface, NULL, ETH_P_RRB, + hostapd_rrb_receive, hapd, 1); + if (!hapd->l2) { diff --git a/patches/0026-ath79-add-support-for-Indio-305AC.patch b/patches/0026-ath79-add-support-for-Indio-305AC.patch new file mode 100644 index 000000000..47e8aabe4 --- /dev/null +++ b/patches/0026-ath79-add-support-for-Indio-305AC.patch @@ -0,0 +1,172 @@ +From 008a385635cafdce3498ebd6a6b429a1aa2e03bd Mon Sep 17 00:00:00 2001 +From: Rohan Nathi +Date: Thu, 24 Jun 2021 13:48:45 +0000 +Subject: [PATCH] ath79: add Support for Indio 305AC + +Signed-off-by: Rohan Nathi +--- + .../ath79/dts/qca9531_indio_um-305ac.dts | 116 ++++++++++++++++++ + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + + target/linux/ath79/image/generic.mk | 11 ++ + 3 files changed, 128 insertions(+) + create mode 100755 target/linux/ath79/dts/qca9531_indio_um-305ac.dts + +diff --git a/target/linux/ath79/dts/qca9531_indio_um-305ac.dts b/target/linux/ath79/dts/qca9531_indio_um-305ac.dts +new file mode 100755 +index 0000000000..763fdcefa8 +--- /dev/null ++++ b/target/linux/ath79/dts/qca9531_indio_um-305ac.dts +@@ -0,0 +1,116 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include "qca953x.dtsi" ++ ++#include ++#include ++ ++/ { ++ model = "Indio UM-305AC"; ++ compatible = "indio,um-305ac", "qca,qca9531"; ++ ++ aliases { ++ led-boot = &led_status; ++ led-failsafe = &led_status; ++ led-running = &led_status; ++ led-upgrade = &led_status; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpio 17 GPIO_ACTIVE_LOW>; ++ debounce-interval = <60>; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ lan { ++ label = "green:lan"; ++ gpios = <&gpio 16 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led_status: status { ++ label = "green:status"; ++ gpios = <&gpio 12 GPIO_ACTIVE_LOW>; ++ default-state = "keep"; ++ }; ++ ++ wan { ++ label = "green:wan"; ++ gpios = <&gpio 4 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wlan2g { ++ label = "red:wlan2g"; ++ gpios = <&gpio 13 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "phy1tpt"; ++ }; ++ }; ++}; ++ ++&spi { ++ status = "okay"; ++ ++ flash@0 { ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <25000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x000000 0x040000>; ++ read-only; ++ }; ++ ++ partition@40000 { ++ label = "u-boot-env"; ++ reg = <0x040000 0x010000>; ++ }; ++ ++ partition@50000 { ++ compatible = "denx,uimage"; ++ label = "firmware"; ++ reg = <0x050000 0xfa0000>; ++ }; ++ ++ art: partition@ff0000 { ++ label = "art"; ++ reg = <0xff0000 0x010000>; ++ read-only; ++ }; ++ }; ++ }; ++}; ++ ++ð0 { ++ status = "okay"; ++ ++ phy-handle = <&swphy4>; ++ ++ mtd-mac-address = <&art 0x0>; ++}; ++ ++ð1 { ++ mtd-mac-address = <&art 0x6>; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&wmac { ++ status = "okay"; ++ ++ mtd-cal-data = <&art 0x1000>; ++}; +diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +index 5a44dd94e5..94afc9c726 100644 +--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata ++++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +@@ -43,6 +43,7 @@ case "$FIRMWARE" in + ubnt,powerbeam-5ac-500|\ + ubnt,powerbeam-5ac-gen2|\ + ubnt,unifiac-pro|\ ++ indio,um-305ac|\ + yuncore,a770) + caldata_extract "art" 0x5000 0x844 + ;; +diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk +index d93ebbaeba..da95360281 100644 +--- a/target/linux/ath79/image/generic.mk ++++ b/target/linux/ath79/image/generic.mk +@@ -2191,6 +2191,17 @@ define Device/yuncore_a770 + endef + TARGET_DEVICES += yuncore_a770 + ++define Device/indio_um-305ac ++ SOC := qca9531 ++ DEVICE_VENDOR := Indio Network ++ DEVICE_MODEL := UM-305AC ++ DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9887 ++ IMAGE_SIZE := 16000k ++ IMAGES += tftp.bin ++ IMAGE/tftp.bin := $$(IMAGE/sysupgrade.bin) | yuncore-tftp-header-16m ++endef ++TARGET_DEVICES += indio_um-305ac ++ + define Device/yuncore_a782 + SOC := qca9563 + DEVICE_VENDOR := YunCore +-- +2.25.1 + diff --git a/patches/0027-ath79-tl-wpa8630p-fixes.patch b/patches/0027-ath79-tl-wpa8630p-fixes.patch new file mode 100644 index 000000000..75bd24ad2 --- /dev/null +++ b/patches/0027-ath79-tl-wpa8630p-fixes.patch @@ -0,0 +1,47 @@ +From a14a7d3580ba376227eba8c28d7e632f0f4e1ffc Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Wed, 30 Jun 2021 11:36:13 +0200 +Subject: [PATCH 35/36] ath79: tl-wpa8630p fixes + +* a certificates partition and change default port mapping + +Signed-off-by: John Crispin +--- + target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi | 7 ++++++- + .../linux/ath79/generic/base-files/etc/board.d/02_network | 2 +- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi +index 9e6d23de4e..c39dbc515b 100644 +--- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi ++++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi +@@ -24,7 +24,12 @@ + partition@40000 { + compatible = "tplink,firmware"; + label = "firmware"; +- reg = <0x040000 0x5e0000>; ++ reg = <0x040000 0x5d0000>; ++ }; ++ ++ partition@610000 { ++ label = "certificates"; ++ reg = <0x610000 0x10000>; + }; + }; + +diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network +index b8bc38348e..f300077dba 100755 +--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network ++++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network +@@ -380,7 +380,7 @@ ath79_setup_interfaces() + tplink,tl-wpa8630p-v2.1-eu) + # port 5 (internal) is the power-line port + ucidef_add_switch "switch0" \ +- "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4" ++ "0@eth0" "2:wan:3" "3:wan:2" "5:wan:4" "4:lan:1" + ;; + tplink,tl-wr842n-v2) + ucidef_set_interface_wan "eth1" +-- +2.25.1 + diff --git a/profiles/indio_um-305ac.yml b/profiles/indio_um-305ac.yml new file mode 100755 index 000000000..c5b581b9e --- /dev/null +++ b/profiles/indio_um-305ac.yml @@ -0,0 +1,9 @@ +--- +profile: indio_um-305ac +target: ath79 +subtarget: generic +description: Build image for the Indio 305AC +image: bin/targets/ath79/generic/openwrt-ath79-generic-indio_um-305ac-squashfs-sysupgrade.bin +include: + - ucentral-ap + diff --git a/profiles/tplink_wpa8630p.yml b/profiles/tplink_wpa8630p.yml new file mode 100644 index 000000000..4bf899d26 --- /dev/null +++ b/profiles/tplink_wpa8630p.yml @@ -0,0 +1,8 @@ +--- +profile: tplink_tl-wpa8630p-v2.0-eu +target: ath79 +subtarget: generic +description: Build image for the TPLink WPA8630p +image: bin/targets/ath79/generic/openwrt-ath79-generic-tplink_cpe210-v3-squashfs-sysupgrade.bin +include: + - ucentral-powerline diff --git a/profiles/ucentral-powerline.yml b/profiles/ucentral-powerline.yml new file mode 100644 index 000000000..a310f66bd --- /dev/null +++ b/profiles/ucentral-powerline.yml @@ -0,0 +1,45 @@ +--- +description: Add the ucentral dependencies +feeds: + - name: ucentral + path: ../../feeds/ucentral + - name: tip + path: ../../feeds/tip + +packages: + - cJSON + - curl + - firstcontact + - ip-bridge + - lldpd + - rtty-openssl + - tip-defaults + - ucentral-client + - ucentral-schema + - ucode + - open-plc-utils-plcrate + - open-plc-utils + - open-plc-utils-plctool +diffconfig: | + CONFIG_OPENSSL_ENGINE=y + CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM=y + CONFIG_OPENSSL_WITH_ASM=y + CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y + CONFIG_OPENSSL_WITH_CMS=y + CONFIG_OPENSSL_WITH_DEPRECATED=y + CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y + CONFIG_OPENSSL_WITH_PSK=y + CONFIG_OPENSSL_WITH_SRP=y + CONFIG_OPENSSL_WITH_TLS13=y + # CONFIG_PACKAGE_ppp is not set + # CONFIG_PACKAGE_kmod-ppp is not set + # CONFIG_PACKAGE_hostapd-common is not set + # CONFIG_PACKAGE_wpad is not set + # CONFIG_PACKAGE_wpad-basic-wolfssl is not set + # CONFIG_PACKAGE_kmod-ath9k is not set + # CONFIG_PACKAGE_kmod-ath10k-ct is not set + # CONFIG_PACKAGE_ath10k-firmware-qca9888-ct is not set + CONFIG_IMAGEOPT=y + CONFIG_PREINITOPT=y + CONFIG_TARGET_PREINIT_SUPPRESS_STDERR=y + CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE=y