diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh index 93ab404d57c..9b86abcee5d 100755 --- a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh @@ -195,6 +195,7 @@ function setup_phy(phy, config, data) { log(`Configuring '${phy}' txantenna: ${config.txantenna}, rxantenna: ${config.rxantenna} distance: ${config.distance}`); system(`iw phy ${phy} set antenna ${config.txantenna} ${config.rxantenna}`); system(`iw phy ${phy} set distance ${config.distance}`); + system(`iw phy ${phy} set txpower ${config.txpower}`); if (config.frag) system(`iw phy ${phy} set frag ${frag}`); diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh index 5d9bf8ee09e..9e9922e0b35 100755 --- a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh @@ -1210,6 +1210,14 @@ drv_mac80211_setup() { wdev_tool "$phy$phy_suffix" set_config "$(json_dump)" $active_ifnames json_set_namespace "$prev" + [ -z "$phy_suffix" ] && { + if [ -n "$txpower" ]; then + iw phy "$phy" set txpower fixed "${txpower%%.*}00" + else + iw phy "$phy" set txpower auto + fi + } + for_each_interface "ap sta adhoc mesh monitor" mac80211_set_vif_txpower wireless_set_up }