cc93 wlan: fix the check for Wi-Fi module correctly loaded

The result of the modprobe operation doesn't guarantee the driver loaded
correctly. The module may succeed and be loaded, but failures during the
probe may not propagate and result in an error of modprobe.
The valid condition is to check the existence of the interface in
/sys/class/net/wlan0.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://onedigi.atlassian.net/browse/DEL-8821
This commit is contained in:
Hector Palacios 2024-01-10 09:34:57 +01:00
parent 0aa5003267
commit 9248c9ab79
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ fi
WLANADDR=$(hexdump -ve '1/1 "%02X" ":"' /proc/device-tree/wireless/mac-address 2>/dev/null | sed 's/:$//g')
modprobe mlan && \
modprobe moal ${MOAL_PARAMS} mac_addr=${WLANADDR} && \
log "Wi-Fi activated" && exit 0
[ -d "/sys/class/net/wlan0" ] && log "Wi-Fi activated" && exit 0
log "[ERROR] cannot load Wi-Fi driver"
exit 1