###################################################################################
##  apcfg
##
##  Configuration file for Atheros AP.
##  All settings that affect the operation of the AP are included in this file.  For
##  those settings not define here, defaults are used.  This file should be used in
##  lieu of manual configuration.
##
###################################################################################
##
## Network Address Selection
## Selects between DHCP or a static fixed address
##
## AP_IPADDR  = IP address of the bridge
## WAN_IPADDR = Fixed IP address of the WAN, if it's not bridged
## WAN_MODE   = bridged for attached to bridged, Get address if dhcp, fixed address
##              if static
##
###################################################################################

export AP_IPADDR=192.168.1.2
export AP_NETMASK=255.255.255.0
export WAN_MODE=bridged
export WAN_IPADDR=192.168.2.1

#
# Indicate if you want the WLAN to be activated on boot up.
#

export WLAN_ON_BOOT=n

#
# AP Start Mode
# This can be overridded by environmental variables
# Modes can be
#    standard := standard single AP start mode
#      rootap := WDS root AP for WDS modes
#    reptater := WDS repeater station
#      client := WDS "virtual wire" client
#       multi := Multiple BSSID with all encryption types
#
#

if [ "${AP_STARTMODE}" = "" ]; then
    export AP_STARTMODE=standard
fi

#################################################################################
## Default Parameters
## If these are not set explictly by exporting environmental variables, the following
## Defaults will be applied
#################################################################################

if [ "${AP_PRIMARY_CH}" = "" ]; then
    # AP_PRIMARY_CH could be
    #                a number or
    #                11na (which means auto-scan in 11na mode) or
    #                11ng (which means auto-scan in 11ng mode)

    export AP_PRIMARY_CH=6
fi


if [ "${AP_CHMODE}" = "" ]; then
    # For this default, we will be in HT20 mode
    export AP_CHMODE=11NGHT20
fi

##
## Set the default interfaces if not already defined
##

if [ "${AP_IFNUM}" = "" ]; then
    export AP_IFNUM=0:RF:$AP_PRIMARY_CH:$AP_CHMODE
fi

if [ "${AP_IFNUM_2}" = "" ]; then
    export AP_IFNUM_2=0::$AP_PRIMARY_CH:$AP_CHMODE
fi

if [ "${AP_IFNUM_3}" = "" ]; then
    export AP_IFNUM_3=0::$AP_PRIMARY_CH:$AP_CHMODE
fi

if [ "${AP_IFNUM_4}" = "" ]; then
    export AP_IFNUM_4=0::$AP_PRIMARY_CH:$AP_CHMODE
fi

##
## Set the default modes for multi configuration
##

if [ "${AP_MODE}" = "" ]; then
    export AP_MODE=ap
fi

if [ "${AP_MODE_2}" = "" ]; then
    export AP_MODE_2=ap
fi

if [ "${AP_MODE_3}" = "" ]; then
    export AP_MODE_3=ap
fi

if [ "${AP_MODE_4}" = "" ]; then
    export AP_MODE_4=ap
fi

##
## Channel Configuration Section
##

if [ "${TXQUEUELEN}" = "" ]; then
    export TXQUEUELEN=1000
fi

if [ "${SHORTGI}" = "" ]; then
    export SHORTGI=1
fi

#
# Aggregation.  First parameter enables/disables,
# second parameter sets the size limit
#

if [ "${AMPDUENABLE}" = "" ]; then
    export AMPDUENABLE=1
fi

if [ "${AMPDUFRAMES}" = "" ]; then
    export AMPDUFRAMES=32
fi

if [ "${AMPDULIMIT}" = "" ]; then
    export AMPDULIMIT=50000
fi

if [ "${CWMMODE}" = "" ]; then
    export CWMMODE=1
fi

if [ "${RATECTL}" = "" ]; then
    export RATECTL=auto
fi

if [ "${MANRATE}" = "" ]; then
    export MANRATE=0x8c8c8c8c
fi

if [ "${MANRETRIES}" = "" ]; then
    export MANRETRIES=0x04040404
fi

if [ "${RX_CHAINMASK}" = "" ]; then
    export RX_CHAINMASK=7
fi

if [ "${TX_CHAINMASK}" = "" ]; then
    export TX_CHAINMASK=5
fi

##
## AP Identification Section
##

if [ "${AP_SSID}" = "" ]; then
    export AP_SSID=Atheros_XSpan
fi

#####################################################################################
## The following parameters are board specific, and should not be modified
#####################################################################################

export ATH_use_eeprom=1

