openwrt/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wmac-migration
Marcin Jurkowski fcc716e21d ath79: add TP-Link TL-WR710N v1
This commit adds support for TP-Link TL-WR710N v1 router.

CPU: Atheros AR9331 400MHz
RAM: 32MB
FLASH: 8MiB
PORTS: 1 Port 100/10 LAN (connected to a switch), 1 Port 100/10 WAN
WiFi: Atheros AR9331 1x2:1 bgn
USB: ChipIdea HDRC USB2.0
LED: SYS
BTN: Reset

Sysupgrade from `ar71xx` works without glitches.
Network interfaces assigned for LAN and WAN ports are `eth1` and `eth0`
respectively, what's consistent with `ar71xx` target. Wireless radio
path is automatically upgraded from `platform/ar933x_wmac` to
`platform/ahb/18100000.wmac`.

Signed-off-by: Marcin Jurkowski <marcin1j@gmail.com>
2019-03-24 01:44:27 +01:00

37 lines
624 B
Bash

#!/bin/sh
WMAC_PATH_CHANGED=0
. /lib/functions.sh
migrate_wmac_path() {
local section="$1"
local path
config_get path ${section} path
case ${path} in
"platform/qca955x_wmac")
path="platform/ahb/ahb:apb/18100000.wmac"
WMAC_PATH_CHANGED=1
;;
"platform/ar933x_wmac")
path="platform/ahb/18100000.wmac"
WMAC_PATH_CHANGED=1
;;
*)
return 0
;;
esac
uci set wireless.${section}.path=${path}
}
[ "${ACTION}" = "add" ] && {
[ ! -e /etc/config/wireless ] && return 0
config_load wireless
config_foreach migrate_wmac_path wifi-device
[ "${WMAC_PATH_CHANGED}" = "1" ] && uci commit wireless
}