|
|
|
@ -171,47 +171,7 @@ case "$ACTION" in
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#=======MAC STARTUP=========================================
|
|
|
|
|
if is_true $IS_AP ; then
|
|
|
|
|
#=======AP STARTUP==================================
|
|
|
|
|
startcmd="$WLANCTL $DEVICE dot11req_start "
|
|
|
|
|
startcmd="$startcmd ssid=$APSSID"
|
|
|
|
|
startcmd="$startcmd bsstype=infrastructure"
|
|
|
|
|
startcmd="$startcmd beaconperiod=$APBCNINT"
|
|
|
|
|
startcmd="$startcmd dtimperiod=$APDTIMINT"
|
|
|
|
|
startcmd="$startcmd cfpollable=$APCFPOLLABLE"
|
|
|
|
|
startcmd="$startcmd cfpollreq=$APCFPOLLREQ"
|
|
|
|
|
startcmd="$startcmd cfpperiod=$APCFPPERIOD"
|
|
|
|
|
startcmd="$startcmd cfpmaxduration=$APCFPMAXDURATION"
|
|
|
|
|
startcmd="$startcmd probedelay=$APPROBEDELAY"
|
|
|
|
|
startcmd="$startcmd dschannel=$APCHANNEL"
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
results=`$startcmd` # Here's where it runs
|
|
|
|
|
if [ $? = 0 ]; then
|
|
|
|
|
eval $results
|
|
|
|
|
if [ $resultcode != "success" ] ; then
|
|
|
|
|
echo "AP not started, resultcode=$resultcode"
|
|
|
|
|
exit 1
|
|
|
|
|
else
|
|
|
|
|
echo "WLAN AP mode started"
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
echo FAILED: $startcmd
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
WLAN_SCHEMESSID="$APSSID"
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
if is_true $IS_ADHOC ; then
|
|
|
|
|
#=======IBSS STARTUP==================================
|
|
|
|
|
startcmd="$WLANCTL $DEVICE dot11req_start "
|
|
|
|
@ -251,7 +211,7 @@ case "$ACTION" in
|
|
|
|
|
fi
|
|
|
|
|
WLAN_SCHEMESSID="$SSID"
|
|
|
|
|
else #----------------------------
|
|
|
|
|
#=======STA STARTUP==================================
|
|
|
|
|
#======= INFRASTRUCURE STARTUP===========================
|
|
|
|
|
results=`$WLANCTL $DEVICE lnxreq_autojoin \
|
|
|
|
|
"ssid=$DesiredSSID" authtype=${AuthType:="opensystem"}`
|
|
|
|
|
if [ $? = 0 ]; then
|
|
|
|
@ -262,132 +222,71 @@ case "$ACTION" in
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
WLAN_SCHEMESSID="$DesiredSSID"
|
|
|
|
|
|
|
|
|
|
# ==========PCMCIA NETDEVICE=============================
|
|
|
|
|
# Append the SSID to the pcmcia scheme name
|
|
|
|
|
wlan_set_ssid_schemefile "$WLAN_SCHEMESSID"
|
|
|
|
|
|
|
|
|
|
# Call the normal network initialization
|
|
|
|
|
./network $1 $2
|
|
|
|
|
if [ ! $? ] ; then
|
|
|
|
|
echo "/etc/pcmcia/network initialization failed."
|
|
|
|
|
wlan_restore_schemefile
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Restore scheme file to it's prior contents
|
|
|
|
|
wlan_restore_schemefile
|
|
|
|
|
fi # david
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# ==========AP Interface====================================
|
|
|
|
|
# For AP, interface initialization depends on whether we're
|
|
|
|
|
# routing or bridging. If routing, bring up the interface
|
|
|
|
|
# using the standard pcmcia-cs network script (like a STA).
|
|
|
|
|
# Note that routing APs will require that STAs have their
|
|
|
|
|
# gateway address set to the AP's address.
|
|
|
|
|
# If bridging, do NOT put the wlan MAC in promisc
|
|
|
|
|
# mode. The code here will set up the bridge device and
|
|
|
|
|
# set it up. NOTE: Physically ejecting either card while the bridge
|
|
|
|
|
# is active commonly leaves a system unstable (or locked). Use
|
|
|
|
|
# 'cardctl eject' on the wlan device prior to removal.
|
|
|
|
|
|
|
|
|
|
if is_true $IS_AP ; then if is_true $IS_BRIDGE; then
|
|
|
|
|
if is_true $IS_OLDBRIDGE; then
|
|
|
|
|
ifconfig $APWIREDDEVICE promisc
|
|
|
|
|
ifconfig $DEVICE up
|
|
|
|
|
brcfg start
|
|
|
|
|
else
|
|
|
|
|
ifconfig $APWIREDDEVICE down
|
|
|
|
|
ifconfig $DEVICE down
|
|
|
|
|
brctl addbr $APBRIDGEDEVICE
|
|
|
|
|
brctl addif $APBRIDGEDEVICE $APWIREDDEVICE
|
|
|
|
|
brctl addif $APBRIDGEDEVICE $DEVICE
|
|
|
|
|
ifconfig $APWIREDDEVICE up 0.0.0.0
|
|
|
|
|
ifconfig $DEVICE up 0.0.0.0
|
|
|
|
|
ifconfig $APBRIDGEDEVICE up $AP_IPADDR
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
# Just set up the AP interface like any other net
|
|
|
|
|
# device.
|
|
|
|
|
# ==========PCMCIA NETDEVICE=============================
|
|
|
|
|
# Append the SSID to the pcmcia scheme name
|
|
|
|
|
wlan_set_ssid_schemefile "$WLAN_SCHEMESSID"
|
|
|
|
|
|
|
|
|
|
# ==========PCMCIA NETDEVICE=============================
|
|
|
|
|
# Append the SSID to the pcmcia scheme name
|
|
|
|
|
wlan_set_ssid_schemefile "$WLAN_SCHEMESSID"
|
|
|
|
|
|
|
|
|
|
# Call the normal network initialization
|
|
|
|
|
./network $1 $2
|
|
|
|
|
if [ ! $? ] ; then
|
|
|
|
|
echo "/etc/pcmcia/network initialization failed."
|
|
|
|
|
wlan_restore_schemefile
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Restore scheme file to it's prior contents
|
|
|
|
|
# Call the normal network initialization
|
|
|
|
|
./network $1 $2
|
|
|
|
|
if [ ! $? ] ; then
|
|
|
|
|
echo "/etc/pcmcia/network initialization failed."
|
|
|
|
|
wlan_restore_schemefile
|
|
|
|
|
fi;fi
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Restore scheme file to it's prior contents
|
|
|
|
|
wlan_restore_schemefile
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
'stop'|'suspend')
|
|
|
|
|
# ==========AP BRIDGE====================================
|
|
|
|
|
if is_true $IS_AP ; then if is_true $IS_BRIDGE; then
|
|
|
|
|
if is_true $IS_OLDBRIDGE; then
|
|
|
|
|
brcfg stop
|
|
|
|
|
ifconfig $APWIREDDEVICE down
|
|
|
|
|
ifconfig $DEVICE down
|
|
|
|
|
else
|
|
|
|
|
ifconfig $APBRIDGEDEVICE down
|
|
|
|
|
ifconfig $DEVICE down
|
|
|
|
|
ifconfig $APWIREDDEVICE down
|
|
|
|
|
brctl delif $APBRIDGEDEVICE $APWIREDDEVICE
|
|
|
|
|
brctl delif $APBRIDGEDEVICE $DEVICE
|
|
|
|
|
brctl delbr $APBRIDGEDEVICE
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
./network $1 $2
|
|
|
|
|
fi
|
|
|
|
|
if [ IS_ADHOC = 'y' ]; then
|
|
|
|
|
WLAN_SCHEMESSID="$SSID"
|
|
|
|
|
else
|
|
|
|
|
WLAN_SCHEMESSID="$DesiredSSID"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# ==========PCMCIA NETDEVICE=============================
|
|
|
|
|
# Append the SSID to the pcmcia scheme name
|
|
|
|
|
wlan_set_ssid_schemefile "$WLAN_SCHEMESSID"
|
|
|
|
|
|
|
|
|
|
# Call the normal network initialization
|
|
|
|
|
./network $1 $2
|
|
|
|
|
if [ ! $? ] ; then
|
|
|
|
|
echo "/etc/pcmcia/network initialization failed."
|
|
|
|
|
wlan_restore_schemefile
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Restore scheme file to it's prior contents
|
|
|
|
|
# ==========PCMCIA NETDEVICE=============================
|
|
|
|
|
# Append the SSID to the pcmcia scheme name
|
|
|
|
|
wlan_set_ssid_schemefile "$WLAN_SCHEMESSID"
|
|
|
|
|
|
|
|
|
|
# Call the normal network initialization
|
|
|
|
|
./network $1 $2
|
|
|
|
|
if [ ! $? ] ; then
|
|
|
|
|
echo "/etc/pcmcia/network initialization failed."
|
|
|
|
|
wlan_restore_schemefile
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Restore scheme file to it's prior contents
|
|
|
|
|
wlan_restore_schemefile
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
'check'|'cksum'|'restart')
|
|
|
|
|
# ==========STA ====================================
|
|
|
|
|
# Station just passes through for normal network device
|
|
|
|
|
# behavior. AP does nothing.
|
|
|
|
|
if ! is_true $IS_AP ; then
|
|
|
|
|
WLAN_SCHEMESSID="$dot11DesiredSSID"
|
|
|
|
|
|
|
|
|
|
# ==========PCMCIA NETDEVICE=============================
|
|
|
|
|
# Append the SSID to the pcmcia scheme name
|
|
|
|
|
wlan_set_ssid_schemefile "$WLAN_SCHEMESSID"
|
|
|
|
|
|
|
|
|
|
# Call the normal network initialization
|
|
|
|
|
./network $1 $2
|
|
|
|
|
if [ ! $? ] ; then
|
|
|
|
|
echo "/etc/pcmcia/network initialization failed."
|
|
|
|
|
wlan_restore_schemefile
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
# Just passes through for normal network device
|
|
|
|
|
# behavior.
|
|
|
|
|
if [ IS_ADHOC = 'y' ]; then
|
|
|
|
|
WLAN_SCHEMESSID="$SSID"
|
|
|
|
|
else
|
|
|
|
|
WLAN_SCHEMESSID="$DesiredSSID"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# ==========PCMCIA NETDEVICE=============================
|
|
|
|
|
# Append the SSID to the pcmcia scheme name
|
|
|
|
|
wlan_set_ssid_schemefile "$WLAN_SCHEMESSID"
|
|
|
|
|
|
|
|
|
|
# Restore scheme file to it's prior contents
|
|
|
|
|
# Call the normal network initialization
|
|
|
|
|
./network $1 $2
|
|
|
|
|
if [ ! $? ] ; then
|
|
|
|
|
echo "/etc/pcmcia/network initialization failed."
|
|
|
|
|
wlan_restore_schemefile
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Restore scheme file to it's prior contents
|
|
|
|
|
wlan_restore_schemefile
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
*)
|
|
|
|
|