ccimx95: align Wi-Fi userspace with Murata brcmfmac

Adjust the ccimx95-specific networking pieces so they no longer inherit
the IW612-specific behavior from ccimx9:
- use wlan1/p2p0 instead of uap0/wfd0 where appropriate
- install hostapd_wlan1.conf instead of hostapd_uap0.conf
- restore virtual WLAN handling for ccimx95
- avoid IW612-specific suspend/resume actions such as moal reload and
  load_iw612.sh

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
This commit is contained in:
Francisco Gil 2026-05-18 13:43:47 +02:00
parent c7adf015f9
commit 6fe296b691
11 changed files with 134 additions and 14 deletions

View File

@ -2,14 +2,14 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
HOSTAPD_AP_IFACE ?= "wlan1"
HOSTAPD_AP_IFACE:ccimx91 = "uap0"
HOSTAPD_AP_IFACE:ccimx93 = "uap0"
SRC_URI:append = " \
file://hostapd_wlan0.conf \
file://hostapd@.service \
${@oe.utils.conditional('HAS_WIFI_VIRTWLANS', 'true', 'file://hostapd_wlan1.conf', '', d)} \
"
SRC_URI:append:ccimx9 = " \
file://hostapd_uap0.conf \
${@oe.utils.conditional('HAS_WIFI_VIRTWLANS', 'true', 'file://hostapd_${HOSTAPD_AP_IFACE}.conf', '', d)} \
"
# Patch series from Murata release
@ -89,14 +89,10 @@ add_hostapd_files() {
if ${HAS_WIFI_VIRTWLANS}; then
# Install custom hostapd_IFACE.conf file
install -m 0644 ${WORKDIR}/hostapd_wlan1.conf ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/hostapd_${HOSTAPD_AP_IFACE}.conf ${D}${sysconfdir}
fi
}
add_hostapd_files:ccimx9() {
install -m 0644 ${WORKDIR}/hostapd_uap0.conf ${D}${sysconfdir}
}
pkg_postinst_ontarget:${PN}() {
# Exit if there is no wireless hardware available
if [ ! -e /proc/device-tree/wireless/mac-address ]; then

View File

@ -1,4 +1,4 @@
# Copyright (C) 2017-2024, Digi International Inc.
# Copyright (C) 2017-2026, Digi International Inc.
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
@ -42,7 +42,8 @@ ETH1_STATIC_CIDR = "${@ipaddr_to_cidr('eth1', d)}"
WLAN0_STATIC_CIDR = "${@ipaddr_to_cidr('wlan0', d)}"
UNMANAGED_DEVICES = "interface-name:p2p*;interface-name:wlan1"
UNMANAGED_DEVICES:ccimx9 = "interface-name:p2p-wfd0-0;interface-name:wfd0;interface-name:uap0"
UNMANAGED_DEVICES:ccimx91 = "interface-name:p2p-wfd0-0;interface-name:wfd0;interface-name:uap0"
UNMANAGED_DEVICES:ccimx93 = "interface-name:p2p-wfd0-0;interface-name:wfd0;interface-name:uap0"
DNS_MANAGER = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd','systemd-resolved','default', d)}"
RC_MANAGER = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'unmanaged', 'file', d)}"

View File

@ -0,0 +1,90 @@
#!/bin/sh
#===============================================================================
#
# standby-actions
#
# Copyright (C) 2023, 2024 by Digi International Inc.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
#
# !Description: manage interfaces before suspending and after resuming from
# suspend
#
#===============================================================================
RESUME_FILE="/tmp/resume_actions"
RESUME_ACTIONS=""
wifi_actions_needed() {
[ -d "/proc/device-tree/wireless" ] && [ ! -e "/sys/firmware/devicetree/base/soc@0/bus@42800000/mmc@428b0000/keep-power-in-suspend" ]
}
bt_actions_needed() {
systemctl -q is-active bluetooth-init && [ ! -e "/sys/firmware/devicetree/base/soc@0/bus@42800000/mmc@428b0000/keep-power-in-suspend" ]
}
if [ "${1}" = "pre" ]; then
rm -f "${RESUME_FILE}"
# Stop NetworkManager before suspend
systemctl stop NetworkManager
if bt_actions_needed; then
# bluetooth service relies on bluetooth-init service so
# stop it unconditionally
systemctl stop bluetooth-init
systemctl stop bluetooth
# Program the resume actions to start the services
RESUME_ACTIONS_BT="systemctl start bluetooth-init; systemctl start bluetooth;"
fi
if wifi_actions_needed; then
RESUME_ACTIONS_WIFI=""
for iface in wlan0 uap0 wfd0; do
if grep -qs ${iface} /var/run/ifstate; then
# Bring the interface down
ifdown ${iface}
# Program the resume action to bring it up
# (prepend to use reverse order)
RESUME_ACTIONS_WIFI="ifup ${iface};${RESUME_ACTIONS_WIFI}"
fi
done
# Unload Wi-Fi modules
modprobe -r moal
# Program the resume action to reload the modules
# (prepend to use reverse order)
RESUME_ACTIONS_WIFI="/etc/udev/scripts/load_iw612.sh;${RESUME_ACTIONS_WIFI}"
fi
# Compound resume actions (enable BT first, or else add a sleep, to give
# some time to the system to be ready to load the Wi-Fi)
if [ -n "${RESUME_ACTIONS_BT}" ]; then
RESUME_ACTIONS="${RESUME_ACTIONS_BT}"
fi
if [ -n "${RESUME_ACTIONS_WIFI}" ]; then
if [ -z "${RESUME_ACTIONS_BT}" ]; then
RESUME_ACTIONS="sleep 0.5;"
fi
RESUME_ACTIONS="${RESUME_ACTIONS}${RESUME_ACTIONS_WIFI}"
fi
if [ -n "${RESUME_ACTIONS}" ]; then
# Create temp file with resume actions
echo "${RESUME_ACTIONS}" > "${RESUME_FILE}"
chmod +x "${RESUME_FILE}"
fi
elif [ "${1}" = "post" ]; then
if [ -f "${RESUME_FILE}" ]; then
eval "${RESUME_FILE}"
# Clean-up
rm -f "${RESUME_FILE}"
fi
# Resume NetworkManager after suspend
systemctl start NetworkManager
fi

View File

@ -0,0 +1,6 @@
## Example bridge between eth0 and uap0 (NXP IW612)
#auto br0
#iface br0 inet dhcp
# bridge_ports eth0 uap0
# pre-up [ -d /proc/device-tree/wireless ]

View File

@ -0,0 +1,8 @@
# Wi-Fi AP interface (NXP IW612)
#auto uap0
iface uap0 inet dhcp
udhcpc_opts -S -b >/dev/null &
pre-up [ -d /proc/device-tree/wireless ]
post-up ##WLAN1_POST_UP_ACTION##
pre-down ##WLAN1_PRE_DOWN_ACTION##

View File

@ -0,0 +1,11 @@
# Wi-Fi AP interface (NXP IW612)
#auto uap0
iface uap0 inet static
address ##WLAN1_STATIC_IP##
netmask ##WLAN1_STATIC_NETMASK##
gateway ##WLAN1_STATIC_GATEWAY##
dns-nameservers ##WLAN1_STATIC_DNS##
pre-up [ -d /proc/device-tree/wireless ]
post-up ##WLAN1_POST_UP_ACTION##
pre-down ##WLAN1_PRE_DOWN_ACTION##

View File

@ -1,4 +1,4 @@
# Copyright (C) 2013-2024, Digi International Inc.
# Copyright (C) 2013-2026, Digi International Inc.
FILESEXTRAPATHS:prepend := "${THISDIR}/${BP}:"
@ -73,7 +73,12 @@ install_virtwlans() {
ln -s ../if-pre-up.d/virtwlans ${D}${sysconfdir}/network/if-post-down.d/virtwlans
}
install_virtwlans:ccimx9() {
install_virtwlans:ccimx91() {
# Skip
:
}
install_virtwlans:ccimx93() {
# Skip
:
}
@ -84,6 +89,9 @@ WLAN1_PRE_DOWN_ACTION = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'sys
WLAN1_POST_UP_ACTION:ccimx9 = "systemctl start hostapd@uap0.service"
WLAN1_PRE_DOWN_ACTION:ccimx9 = "systemctl stop hostapd@uap0.service"
WLAN1_POST_UP_ACTION:ccimx95 = "systemctl start hostapd@wlan1.service"
WLAN1_PRE_DOWN_ACTION:ccimx95 = "systemctl stop hostapd@wlan1.service"
install_wlan1() {
cat ${WORKDIR}/interfaces.wlan1.${WLAN1_MODE} >> ${D}${sysconfdir}/network/interfaces