You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
3.0 KiB
Bash

#!/bin/sh
#
# Copyright (C) 2017 devolo AG
#
[ -f /etc/customization.sh ] && . /etc/customization.sh
. /lib/functions.sh
. /lib/delos-functions.sh
board=
if [ -e /lib/ar71xx.sh ]; then
. /lib/ar71xx.sh
board=$(ar71xx_board_name)
elif [ -e /lib/ipq806x.sh ];then
. /lib/ipq806x.sh
board=$(ipq806x_board_name)
fi
# check marker
uci_get wireless delos_uninitialized >/dev/null || exit 0
WIFI0_HTMODE="${_DVL_DEFAULT_WIFI_2G_HTMODE:-HT40}"
WIFI0=$(cat <<EOF
config wifi-device 'wifi0'
option type 'qcawifi'
option channel 'auto'
option txpower '20'
option htmode '${WIFI0_HTMODE}'
option hwmode '11g'
option country 'DE'
option autorescan '1'
option autorescan_interval '120'
list supported_rates '54000'
list supported_rates '48000'
list supported_rates '36000'
list supported_rates '24000'
list supported_rates '18000'
list supported_rates '12000'
list supported_rates '11000'
list supported_rates '9000'
list supported_rates '6000'
list supported_rates '5500'
list supported_rates '2000'
list supported_rates '1000'
list basic_rate '11000'
list basic_rate '5500'
list basic_rate '2000'
list basic_rate '1000'
config wifi-iface
option device 'wifi0'
option network 'lan'
option mode 'ap'
option wds '1'
option ssid 'devolo'
option encryption 'psk2'
option key 'oloved42'
option ieee80211w '1'
option wps_config 'push_button virtual_push_button physical_push_button display virtual_display'
option dvl_main '1'
option rrm '1'
option wnm '1'
option ieee80211r '0'
option rsn_preauth '1'
EOF
)
WIFI1_HTMODE="${_DVL_DEFAULT_WIFI_5G_HTMODE:-VHT80}"
WIFI1=$(cat <<EOF
config wifi-device 'wifi1'
option type 'qcawifi'
option channel 'auto'
option txpower '27'
option htmode '${WIFI1_HTMODE}'
option hwmode '11a'
option country 'DE'
option autorescan '1'
option autorescan_interval '120'
list supported_rates '54000'
list supported_rates '48000'
list supported_rates '36000'
list supported_rates '24000'
list supported_rates '18000'
list supported_rates '12000'
list supported_rates '9000'
list supported_rates '6000'
list basic_rate '24000'
list basic_rate '12000'
list basic_rate '6000'
list acs_chanlist '36-112'
list acs_chanlist '132-140'
config wifi-iface
option device 'wifi1'
option network 'lan'
option mode 'ap'
option wds '1'
option ssid 'devolo'
option encryption 'psk2'
option key 'oloved42'
option ieee80211w '1'
option wps_config 'push_button virtual_push_button physical_push_button display virtual_display'
option dvl_main '1'
option rrm '1'
option wnm '1'
option ieee80211r '1'
option rsn_preauth '1'
EOF
)
WIFI_COMMON=$(cat <<EOF
config wps 'wps'
option min_hold_time 0
option max_hold_time 3
config qcawifi 'qcawifi'
option atf_mode '1'
EOF
)
case "$board" in
dvl-1750c |\
dlan-1000-ac |\
dlan2-2400-ac |\
dlan-pro-1200-ac |\
ew7479cap | \
ap-dk07.1-c1 | \
ap151)
cat >/etc/config/wireless <<EOF
$WIFI0
$WIFI1
$WIFI_COMMON
EOF
;;
dlan-550-wifi |\
dlan-pro-1200-n)
cat >/etc/config/wireless <<EOF
$WIFI0
$WIFI_COMMON
EOF
;;
esac
exit 0