From b85b388eb59760d94044dc55c5142127652e3bac Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 4 Mar 2024 14:57:58 +0100 Subject: [PATCH] ipq95xx: make the ucentral-schema data model work Signed-off-by: John Crispin --- feeds/ipq95xx/hostapd/files/hostapd.sh | 2 +- .../hostapd/patches/901-cfg-section.patch | 37 +++++++++++++++++++ .../hostapd/patches/999-probe-request.patch | 26 ++++++++----- .../ipq53xx/base-files/etc/init.d/ath12k | 9 +++++ .../base-files/lib/upgrade/platform.sh | 2 + .../arm64/boot/dts/qcom/ipq5332-cig-wf198.dts | 8 +++- feeds/ipq95xx/mac80211/Makefile | 2 - .../files/lib/netifd/wireless/mac80211.sh | 6 +-- .../mac80211/files/lib/wifi/mac80211.sh | 12 +++--- feeds/ipq95xx/mac80211/files/mac80211.hotplug | 5 --- profiles/cig_wf198.yml | 2 + profiles/sercomm_ap72tip.yml | 2 + 12 files changed, 84 insertions(+), 29 deletions(-) create mode 100644 feeds/ipq95xx/hostapd/patches/901-cfg-section.patch create mode 100755 feeds/ipq95xx/ipq53xx/base-files/etc/init.d/ath12k delete mode 100644 feeds/ipq95xx/mac80211/files/mac80211.hotplug diff --git a/feeds/ipq95xx/hostapd/files/hostapd.sh b/feeds/ipq95xx/hostapd/files/hostapd.sh index 5f4ab26e4..f5f65c777 100644 --- a/feeds/ipq95xx/hostapd/files/hostapd.sh +++ b/feeds/ipq95xx/hostapd/files/hostapd.sh @@ -251,7 +251,7 @@ hostapd_prepare_device_config() { [ -n "$maxassoc" ] && append base_cfg "iface_max_num_sta=$maxassoc" "$N" [ "$maxassoc_ignore_probe" -gt 0 ] && append base_cfg "no_probe_resp_if_max_sta=1" "$N" [ "$rnr_beacon" -gt 0 ] && append base_cfg "rnr_beacon=$rnr_beacon" "$N" - [ "$he_co_locate" -gt 0 ] && append base_cfg "he_co_locate=$he_co_locate" "$N" +# [ "$he_co_locate" -gt 0 ] && append base_cfg "he_co_locate=$he_co_locate" "$N" [ "$multiple_bssid" -gt 0 ] && append base_cfg "multiple_bssid=$multiple_bssid" "$N" [ "$ema" -gt 0 ] && append base_cfg "ema=$ema" "$N" [ "$mlo" -gt 0 ] && append base_cfg "mlo=1" "$N" diff --git a/feeds/ipq95xx/hostapd/patches/901-cfg-section.patch b/feeds/ipq95xx/hostapd/patches/901-cfg-section.patch new file mode 100644 index 000000000..152e18a0c --- /dev/null +++ b/feeds/ipq95xx/hostapd/patches/901-cfg-section.patch @@ -0,0 +1,37 @@ +Index: hostapd-2023-02-21-ath12.3-cs/hostapd/config_file.c +=================================================================== +--- hostapd-2023-02-21-ath12.3-cs.orig/hostapd/config_file.c ++++ hostapd-2023-02-21-ath12.3-cs/hostapd/config_file.c +@@ -2271,6 +2271,8 @@ static int hostapd_config_fill(struct ho + return 1; + } + conf->driver = driver; ++ } else if (os_strcmp(buf, "uci_section") == 0) { ++ bss->uci_section = os_strdup(pos); + } else if (os_strcmp(buf, "driver_params") == 0) { + os_free(conf->driver_params); + conf->driver_params = os_strdup(pos); +Index: hostapd-2023-02-21-ath12.3-cs/src/ap/ap_config.h +=================================================================== +--- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/ap_config.h ++++ hostapd-2023-02-21-ath12.3-cs/src/ap/ap_config.h +@@ -287,6 +287,7 @@ struct hostapd_bss_config { + char snoop_iface[IFNAMSIZ + 1]; + char vlan_bridge[IFNAMSIZ + 1]; + char wds_bridge[IFNAMSIZ + 1]; ++ char *uci_section; + + #ifdef CONFIG_IEEE80211BE + unsigned int mlo_link_id; +Index: hostapd-2023-02-21-ath12.3-cs/src/ap/ap_config.c +=================================================================== +--- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/ap_config.c ++++ hostapd-2023-02-21-ath12.3-cs/src/ap/ap_config.c +@@ -825,6 +825,7 @@ void hostapd_config_free_bss(struct host + os_free(conf->radius_server_clients); + os_free(conf->radius); + os_free(conf->radius_das_shared_secret); ++ os_free(conf->uci_section); + hostapd_config_free_vlan(conf); + os_free(conf->time_zone); + diff --git a/feeds/ipq95xx/hostapd/patches/999-probe-request.patch b/feeds/ipq95xx/hostapd/patches/999-probe-request.patch index a239c8432..1a867d22f 100644 --- a/feeds/ipq95xx/hostapd/patches/999-probe-request.patch +++ b/feeds/ipq95xx/hostapd/patches/999-probe-request.patch @@ -1,6 +1,8 @@ ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -3337,6 +3337,8 @@ static int hostapd_config_fill(struct ho +Index: hostapd-2023-02-21-ath12.3-cs/hostapd/config_file.c +=================================================================== +--- hostapd-2023-02-21-ath12.3-cs.orig/hostapd/config_file.c ++++ hostapd-2023-02-21-ath12.3-cs/hostapd/config_file.c +@@ -3286,6 +3286,8 @@ static int hostapd_config_fill(struct ho bss->ignore_broadcast_ssid = atoi(pos); } else if (os_strcmp(buf, "no_probe_resp_if_max_sta") == 0) { bss->no_probe_resp_if_max_sta = atoi(pos); @@ -9,9 +11,11 @@ #ifdef CONFIG_WEP } else if (os_strcmp(buf, "wep_default_key") == 0) { bss->ssid.wep.idx = atoi(pos); ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -459,6 +459,7 @@ struct hostapd_bss_config { +Index: hostapd-2023-02-21-ath12.3-cs/src/ap/ap_config.h +=================================================================== +--- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/ap_config.h ++++ hostapd-2023-02-21-ath12.3-cs/src/ap/ap_config.h +@@ -473,6 +473,7 @@ struct hostapd_bss_config { int ap_max_inactivity; int ignore_broadcast_ssid; int no_probe_resp_if_max_sta; @@ -19,9 +23,11 @@ int wmm_enabled; int wmm_uapsd; ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c -@@ -920,7 +920,8 @@ void handle_probe_req(struct hostapd_dat +Index: hostapd-2023-02-21-ath12.3-cs/src/ap/beacon.c +=================================================================== +--- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/beacon.c ++++ hostapd-2023-02-21-ath12.3-cs/src/ap/beacon.c +@@ -1523,7 +1523,8 @@ void handle_probe_req(struct hostapd_dat } #endif /* CONFIG_P2P */ @@ -31,7 +37,7 @@ elems.ssid_list_len == 0 && elems.short_ssid_list_len == 0) { wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR " for " "broadcast SSID ignored", MAC2STR(mgmt->sa)); -@@ -967,7 +968,8 @@ void handle_probe_req(struct hostapd_dat +@@ -1570,7 +1571,8 @@ void handle_probe_req(struct hostapd_dat return; } diff --git a/feeds/ipq95xx/ipq53xx/base-files/etc/init.d/ath12k b/feeds/ipq95xx/ipq53xx/base-files/etc/init.d/ath12k new file mode 100755 index 000000000..07cb2142a --- /dev/null +++ b/feeds/ipq95xx/ipq53xx/base-files/etc/init.d/ath12k @@ -0,0 +1,9 @@ +#!/bin/sh /etc/rc.common + +START=98 + +boot() { + rm /etc/config/wireless + wifi config + cp /etc/config/wireless /etc/config-shadow +} diff --git a/feeds/ipq95xx/ipq53xx/base-files/lib/upgrade/platform.sh b/feeds/ipq95xx/ipq53xx/base-files/lib/upgrade/platform.sh index 0e79272d7..5b4a4b7c0 100644 --- a/feeds/ipq95xx/ipq53xx/base-files/lib/upgrade/platform.sh +++ b/feeds/ipq95xx/ipq53xx/base-files/lib/upgrade/platform.sh @@ -16,6 +16,8 @@ platform_do_upgrade() { board=$(board_name) case $board in + cig,wf198|\ + sercomm,ap72tip|\ qcom,ipq9574-ap-al02-c4|\ qcom,ipq9574-ap-al02-c15) nand_upgrade_tar "$1" diff --git a/feeds/ipq95xx/ipq53xx/files/arch/arm64/boot/dts/qcom/ipq5332-cig-wf198.dts b/feeds/ipq95xx/ipq53xx/files/arch/arm64/boot/dts/qcom/ipq5332-cig-wf198.dts index a8cb111e2..8503de51b 100644 --- a/feeds/ipq95xx/ipq53xx/files/arch/arm64/boot/dts/qcom/ipq5332-cig-wf198.dts +++ b/feeds/ipq95xx/ipq53xx/files/arch/arm64/boot/dts/qcom/ipq5332-cig-wf198.dts @@ -28,6 +28,10 @@ serial1 = &blsp1_uart1; ethernet0 = "/soc/dp1"; ethernet1 = "/soc/dp2"; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; }; chosen { @@ -357,8 +361,8 @@ pwms = <&pwm 0 10000>; max-brightness = <255>; }; - led2 { - label = "led2"; + led_power: led2 { + label = "green:status"; pwms = <&pwm 1 10000>; max-brightness = <255>; }; diff --git a/feeds/ipq95xx/mac80211/Makefile b/feeds/ipq95xx/mac80211/Makefile index 2347cd12e..47e95364d 100644 --- a/feeds/ipq95xx/mac80211/Makefile +++ b/feeds/ipq95xx/mac80211/Makefile @@ -262,8 +262,6 @@ define KernelPackage/cfg80211/install $(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi $(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless - $(INSTALL_DIR) $(1)/etc/hotplug.d/ieee80211 - $(INSTALL_DATA) ./files/mac80211.hotplug $(1)/etc/hotplug.d/ieee80211/10-wifi-detect endef $(eval $(foreach drv,$(PKG_DRIVERS),$(call KernelPackage,$(drv)))) diff --git a/feeds/ipq95xx/mac80211/files/lib/netifd/wireless/mac80211.sh b/feeds/ipq95xx/mac80211/files/lib/netifd/wireless/mac80211.sh index 371c11286..690fc37d1 100644 --- a/feeds/ipq95xx/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/feeds/ipq95xx/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -1142,9 +1142,9 @@ drv_mac80211_setup() { [ "$rxantenna" = "$prev_rxantenna" -a "$txantenna" = "$prev_txantenna" ] || mac80211_reset_config "$phy" wireless_set_data phy="$phy" txantenna="$txantenna" rxantenna="$rxantenna" - iw phy "$phy" set antenna $txantenna $rxantenna >/dev/null 2>&1 - iw phy "$phy" set antenna_gain $antenna_gain >/dev/null 2>&1 - iw phy "$phy" set distance "$distance" >/dev/null 2>&1 +# iw phy "$phy" set antenna $txantenna $rxantenna >/dev/null 2>&1 +# iw phy "$phy" set antenna_gain $antenna_gain >/dev/null 2>&1 +# iw phy "$phy" set distance "$distance" >/dev/null 2>&1 if [ -n "$txpower" ]; then iw phy "$phy" set txpower fixed "${txpower%%.*}00" diff --git a/feeds/ipq95xx/mac80211/files/lib/wifi/mac80211.sh b/feeds/ipq95xx/mac80211/files/lib/wifi/mac80211.sh index f624f6e18..c256c105f 100644 --- a/feeds/ipq95xx/mac80211/files/lib/wifi/mac80211.sh +++ b/feeds/ipq95xx/mac80211/files/lib/wifi/mac80211.sh @@ -188,12 +188,12 @@ detect_mac80211() { ${scanning} set wireless.radio${devidx}.disabled=1 - set wireless.default_radio${devidx}=wifi-iface - set wireless.default_radio${devidx}.device=radio${devidx} - set wireless.default_radio${devidx}.network=lan - set wireless.default_radio${devidx}.mode=ap - set wireless.default_radio${devidx}.ssid=OpenWrt - set wireless.default_radio${devidx}.encryption=none + #set wireless.default_radio${devidx}=wifi-iface + #set wireless.default_radio${devidx}.device=radio${devidx} + #set wireless.default_radio${devidx}.network=lan + #set wireless.default_radio${devidx}.mode=ap + #set wireless.default_radio${devidx}.ssid=OpenWrt + #set wireless.default_radio${devidx}.encryption=none EOF uci -q commit wireless diff --git a/feeds/ipq95xx/mac80211/files/mac80211.hotplug b/feeds/ipq95xx/mac80211/files/mac80211.hotplug deleted file mode 100644 index b86555266..000000000 --- a/feeds/ipq95xx/mac80211/files/mac80211.hotplug +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -[ "${ACTION}" = "add" ] && { - /sbin/wifi config -} diff --git a/profiles/cig_wf198.yml b/profiles/cig_wf198.yml index fec9653a3..b1b41c83a 100644 --- a/profiles/cig_wf198.yml +++ b/profiles/cig_wf198.yml @@ -9,5 +9,7 @@ feeds: path: ../../feeds/ipq95xx packages: - ipq53xx +include: + - ucentral-ap diffconfig: | CONFIG_KERNEL_IPQ_MEM_PROFILE=0 diff --git a/profiles/sercomm_ap72tip.yml b/profiles/sercomm_ap72tip.yml index 6a70afd1d..6a759ef25 100644 --- a/profiles/sercomm_ap72tip.yml +++ b/profiles/sercomm_ap72tip.yml @@ -9,5 +9,7 @@ feeds: path: ../../feeds/ipq95xx packages: - ipq53xx +include: + - ucentral-ap diffconfig: | CONFIG_KERNEL_IPQ_MEM_PROFILE=0