Added code and variables to set up the dot11req_start command for the AP case.
parent
ee77a4bc97
commit
3bddbcdfb0
|
@ -6,7 +6,7 @@
|
|||
|
||||
. ./shared
|
||||
|
||||
# set -x
|
||||
set -x
|
||||
|
||||
# Get device attributes
|
||||
get_info $DEVICE
|
||||
|
@ -19,22 +19,48 @@ ADDRESS="$SCHEME,$SOCKET,$INSTANCE,$HWADDR"
|
|||
case "$ACTION" in
|
||||
|
||||
'start')
|
||||
if ! is_true $WLAN_ENABLE ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if is_true $IS_AP; then
|
||||
prism2dl -r $AP_FWIMAGE
|
||||
wlanctl-ng $DEVICE start \
|
||||
ssid="$CREATE_SSID" \
|
||||
bsstype=infrastrucure \
|
||||
beaconperiod=100 \
|
||||
dtimperiod=3 \
|
||||
cfpollable=false \
|
||||
cfreq=false \
|
||||
dschannel=$CREATE_CHANNEL \
|
||||
basicrate1=2 \
|
||||
basicrate2=4 \
|
||||
operationalrate1=2 \
|
||||
operationalrate2=4 \
|
||||
operationalrate3=11 \
|
||||
operationalrate4=22
|
||||
if ! prism2dl -r $AP_FWIMAGE $DEVICE then ; then
|
||||
echo AP firmware download failed
|
||||
exit 1
|
||||
fi
|
||||
startcmd="wlanctl-ng $DEVICE dot11req_start "
|
||||
startcmd="$startcmd ssid=$CREATE_SSID"
|
||||
startcmd="$startcmd bsstype=infrastructure"
|
||||
startcmd="$startcmd beaconperiod=$APBCNINT"
|
||||
startcmd="$startcmd dtimperiod=$APDTIMINT"
|
||||
startcmd="$startcmd cfpollable=$APCFPOLLABLE"
|
||||
startcmd="$startcmd cfpollreq=$APCFPOLLREQ"
|
||||
startcmd="$startcmd probedelay=$APPROBEDELAY"
|
||||
startcmd="$startcmd dschannel=$CREATE_CHANNEL"
|
||||
j=1
|
||||
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
|
||||
|
||||
/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
|
||||
./network $1 $2
|
||||
|
||||
if is_true $IS_AP ; then
|
||||
ifconfig $BRIDGEDEVICE promisc
|
||||
ifconfig $DEVICE up
|
||||
brcfg start
|
||||
fi
|
||||
;;
|
||||
|
||||
'stop'|'check'|'cksum'|'restart'|'suspend'|'resume')
|
||||
|
||||
# Just handle it the same as any other net device
|
||||
echo calling network script
|
||||
if is_true $IS_AP ; then
|
||||
brcfg stop
|
||||
fi
|
||||
|
||||
./network $1 $2
|
||||
reval=$?
|
||||
|
||||
|
|
|
@ -8,15 +8,29 @@
|
|||
|
||||
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?
|
||||
IS_AP=n
|
||||
IS_AP=y
|
||||
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?
|
||||
DESIRED_SSID="Set your own here"
|
||||
|
||||
# Create SSID
|
||||
CREATE_SSID="SSID to create"
|
||||
CREATE_SSID="WLAN_PRISM2"
|
||||
CREATE_CHANNEL=6
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in New Issue