Added code and variables to set up the dot11req_start command for the AP case.
This commit is contained in:
parent
ee77a4bc97
commit
3bddbcdfb0
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
. ./shared
|
. ./shared
|
||||||
|
|
||||||
# set -x
|
set -x
|
||||||
|
|
||||||
# Get device attributes
|
# Get device attributes
|
||||||
get_info $DEVICE
|
get_info $DEVICE
|
||||||
|
@ -19,22 +19,48 @@ ADDRESS="$SCHEME,$SOCKET,$INSTANCE,$HWADDR"
|
||||||
case "$ACTION" in
|
case "$ACTION" in
|
||||||
|
|
||||||
'start')
|
'start')
|
||||||
|
if ! is_true $WLAN_ENABLE ; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if is_true $IS_AP; then
|
if is_true $IS_AP; then
|
||||||
prism2dl -r $AP_FWIMAGE
|
if ! prism2dl -r $AP_FWIMAGE $DEVICE then ; then
|
||||||
wlanctl-ng $DEVICE start \
|
echo AP firmware download failed
|
||||||
ssid="$CREATE_SSID" \
|
exit 1
|
||||||
bsstype=infrastrucure \
|
fi
|
||||||
beaconperiod=100 \
|
startcmd="wlanctl-ng $DEVICE dot11req_start "
|
||||||
dtimperiod=3 \
|
startcmd="$startcmd ssid=$CREATE_SSID"
|
||||||
cfpollable=false \
|
startcmd="$startcmd bsstype=infrastructure"
|
||||||
cfreq=false \
|
startcmd="$startcmd beaconperiod=$APBCNINT"
|
||||||
dschannel=$CREATE_CHANNEL \
|
startcmd="$startcmd dtimperiod=$APDTIMINT"
|
||||||
basicrate1=2 \
|
startcmd="$startcmd cfpollable=$APCFPOLLABLE"
|
||||||
basicrate2=4 \
|
startcmd="$startcmd cfpollreq=$APCFPOLLREQ"
|
||||||
operationalrate1=2 \
|
startcmd="$startcmd probedelay=$APPROBEDELAY"
|
||||||
operationalrate2=4 \
|
startcmd="$startcmd dschannel=$CREATE_CHANNEL"
|
||||||
operationalrate3=11 \
|
j=1
|
||||||
operationalrate4=22
|
for i in $APBASICRATES ; do
|
||||||
|
startcmd="$startcmd basicrate$j=$i"
|
||||||
|
j=$[j + 1]
|
||||||
|
done
|
||||||
|
j=1
|
||||||
|
for i in $APOPRATES ; do
|
||||||
|
startcmd="$startcmd operationalrate$j=$i"
|
||||||
|
j=$[j + 1]
|
||||||
|
done
|
||||||
|
echo $startcmd
|
||||||
|
results=`$startcmd`
|
||||||
|
if [ $? = 0 ]; then
|
||||||
|
eval $results
|
||||||
|
if [ $resultcode != "success" ] ; then
|
||||||
|
echo "AP failed to start, resultcode=$resultcode"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "WLAN AP mode started"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo FAILED: $startcmd
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
|
|
||||||
/sbin/wlanctl-ng $DEVICE dot11req_mibset "mibattribute=dot11DesiredSSID=$DESIRED_SSID"
|
/sbin/wlanctl-ng $DEVICE dot11req_mibset "mibattribute=dot11DesiredSSID=$DESIRED_SSID"
|
||||||
|
@ -44,12 +70,21 @@ case "$ACTION" in
|
||||||
# Now initialize the network interface in the normal way
|
# Now initialize the network interface in the normal way
|
||||||
./network $1 $2
|
./network $1 $2
|
||||||
|
|
||||||
|
if is_true $IS_AP ; then
|
||||||
|
ifconfig $BRIDGEDEVICE promisc
|
||||||
|
ifconfig $DEVICE up
|
||||||
|
brcfg start
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
'stop'|'check'|'cksum'|'restart'|'suspend'|'resume')
|
'stop'|'check'|'cksum'|'restart'|'suspend'|'resume')
|
||||||
|
|
||||||
# Just handle it the same as any other net device
|
# Just handle it the same as any other net device
|
||||||
echo calling network script
|
echo calling network script
|
||||||
|
if is_true $IS_AP ; then
|
||||||
|
brcfg stop
|
||||||
|
fi
|
||||||
|
|
||||||
./network $1 $2
|
./network $1 $2
|
||||||
reval=$?
|
reval=$?
|
||||||
|
|
||||||
|
|
|
@ -8,15 +8,29 @@
|
||||||
|
|
||||||
case "$ADDRESS" in
|
case "$ADDRESS" in
|
||||||
*,*,*,*)
|
*,*,*,*)
|
||||||
|
# Do we want to enable the card at all? Set to 'n' if you wish
|
||||||
|
# to load the flash.
|
||||||
|
WLAN_ENABLE=y
|
||||||
|
|
||||||
# Do we want to be an AP?
|
# Do we want to be an AP?
|
||||||
IS_AP=n
|
IS_AP=y
|
||||||
AP_FWIMAGE=/etc/wlan/t10001c0.hex
|
AP_FWIMAGE=/etc/wlan/t10001c0.hex
|
||||||
|
BRIDGEDEVICE=eth0
|
||||||
|
APSSID="WLAN_PRISM2"
|
||||||
|
APBCNINT=100
|
||||||
|
APDTIMINT=3
|
||||||
|
APCFPOLLABLE=false
|
||||||
|
APCFPOLLREQ=false
|
||||||
|
APPROBEDELAY=100
|
||||||
|
APCHANNEL=6
|
||||||
|
APBASICRATES="2 4"
|
||||||
|
APOPRATES="2 4"
|
||||||
|
|
||||||
# Scan for which SSID?
|
# Scan for which SSID?
|
||||||
DESIRED_SSID="Set your own here"
|
DESIRED_SSID="Set your own here"
|
||||||
|
|
||||||
# Create SSID
|
# Create SSID
|
||||||
CREATE_SSID="SSID to create"
|
CREATE_SSID="WLAN_PRISM2"
|
||||||
CREATE_CHANNEL=6
|
CREATE_CHANNEL=6
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue