From 03c3593050dd8e7ad24b14458c1a678c0b702c61 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Thu, 23 Mar 2023 10:09:26 +0100 Subject: [PATCH] hostapd: ccimx93: configure AP mode https://onedigi.atlassian.net/browse/DEL-8346 Signed-off-by: Isaac Hermida --- .../hostapd/hostapd/hostapd_uap0.conf | 42 +++++++++++++++++++ .../hostapd/hostapd_%.bbappend | 32 ++++++++++---- 2 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 meta-digi-dey/recipes-connectivity/hostapd/hostapd/hostapd_uap0.conf diff --git a/meta-digi-dey/recipes-connectivity/hostapd/hostapd/hostapd_uap0.conf b/meta-digi-dey/recipes-connectivity/hostapd/hostapd/hostapd_uap0.conf new file mode 100644 index 000000000..860aa6dc5 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/hostapd/hostapd/hostapd_uap0.conf @@ -0,0 +1,42 @@ +ctrl_interface=/var/run/hostapd +ctrl_interface_group=0 +interface=uap0 +driver=nl80211 + +# SSID to identify the network +ssid=ap-uap0-##MAC## + +# 802.11a (5 GHz) mode +hw_mode=a + +# Set the channel to use. If 0 (ACS), channel will be automatically selected +channel=44 + +# IEEE 802.11i, WPA2 encryption with PSK authentication +auth_algs=1 +wpa=2 +wpa_key_mgmt=WPA-PSK +wpa_pairwise=CCMP +wpa_passphrase=password-wpa2aes + +# Uncomment to enable WPA3-SAE authentication +# wpa_key_mgmt=WPA-PSK SAE +# sae_password=password-wpa3sae + +# IEEE 802.11n (Wi-Fi 4) features +ieee80211n=1 +ht_capab=[HT20][HT40+][HT40-][SHORT-GI-20][SHORT-GI-40] + +# IEEE 802.11ac (Wi-Fi 5) features +ieee80211ac=1 +vht_oper_chwidth=0 +vht_capab=[SHORT-GI-80] + +# IEEE 802.11ax (Wi-Fi 6) features +ieee80211ax=1 +he_su_beamformer=1 +he_su_beamformee=1 + +# IEEE 802.11d (country information) +ieee80211d=1 +country_code=US diff --git a/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend b/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend index 67e1fb75a..157e18fdd 100644 --- a/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend +++ b/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend @@ -8,6 +8,10 @@ SRC_URI:append = " \ ${@oe.utils.conditional('HAS_WIFI_VIRTWLANS', 'true', 'file://hostapd_wlan1.conf', '', d)} \ " +SRC_URI:append:ccimx93 = " \ + file://hostapd_uap0.conf \ +" + # Patch series from Murata release MURATA_COMMON_PATCHES = " \ file://murata/0003-nl80211-Report-connection-authorized-in-EVENT_ASSOC.patch \ @@ -53,23 +57,33 @@ SYSTEMD_SERVICE:${PN}:append = " hostapd@.service" do_install:append() { # Remove the default hostapd.conf - rm -f ${WORKDIR}/hostapd.conf - # Install custom hostapd_IFACE.conf file - install -m 0644 ${WORKDIR}/hostapd_wlan0.conf ${D}${sysconfdir} + rm -f ${D}${sysconfdir}/hostapd.conf + + # Install custom hostapd_IFACE.conf files + add_hostapd_files + # Install interface-specific systemd service install -m 0644 ${WORKDIR}/hostapd@.service ${D}${systemd_unitdir}/system/ sed -i -e 's,@SBINDIR@,${sbindir},g' -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/hostapd@.service + # Read-only rootfs: actions that substitute postinst script + # - append the ${DIGI_FAMILY} string to SSID + if [ -n "${@bb.utils.contains('IMAGE_FEATURES', 'read-only-rootfs', '1', '', d)}" ]; then + sed -i -e "s,##MAC##,${DIGI_FAMILY},g" ${D}${sysconfdir}/hostapd_*.conf + fi +} + +add_hostapd_files() { + install -m 0644 ${WORKDIR}/hostapd_wlan0.conf ${D}${sysconfdir} + if ${HAS_WIFI_VIRTWLANS}; then # Install custom hostapd_IFACE.conf file install -m 0644 ${WORKDIR}/hostapd_wlan1.conf ${D}${sysconfdir} fi +} - # Read-only rootfs: actions that substitute postinst script - # - append the ${DIGI_FAMILY} string to SSID - if [ -n "${@bb.utils.contains('IMAGE_FEATURES', 'read-only-rootfs', '1', '', d)}" ]; then - sed -i -e "s,##MAC##,${DIGI_FAMILY},g" ${D}${sysconfdir}/hostapd_wlan?.conf - fi +add_hostapd_files:ccimx93() { + install -m 0644 ${WORKDIR}/hostapd_uap0.conf ${D}${sysconfdir} } pkg_postinst_ontarget:${PN}() { @@ -84,7 +98,7 @@ pkg_postinst_ontarget:${PN}() { # Get the last two bytes of the wlan0 MAC address MAC="$(dd conv=swab if=/proc/device-tree/wireless/mac-address 2>/dev/null | hexdump | head -n 1 | cut -d ' ' -f 4)" - find "${sysconfdir}" -type f -name 'hostapd_wlan?.conf' -exec \ + find "${sysconfdir}" -type f -name 'hostapd_*.conf' -exec \ sed -i -e "s,##MAC##,${MAC},g" {} \; # Do not autostart hostapd daemon, it will conflict with wpa-supplicant.