Updates to the startup scripts and settings, particularly for ADHOC support.
parent
7903450ab0
commit
0c6bae463e
|
@ -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.
|
||||
# ==========PCMCIA NETDEVICE=============================
|
||||
# Append the SSID to the pcmcia scheme name
|
||||
wlan_set_ssid_schemefile "$WLAN_SCHEMESSID"
|
||||
|
||||
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"
|
||||
|
||||
# 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"
|
||||
|
||||
# ==========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
|
||||
|
||||
# ==========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
|
||||
|
||||
# Restore scheme file to it's prior contents
|
||||
wlan_restore_schemefile
|
||||
# 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"
|
||||
|
||||
# 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
|
||||
;;
|
||||
|
||||
*)
|
||||
|
|
|
@ -76,7 +76,7 @@ wlannoenable,*,*,*)
|
|||
# Just uncomment the variable and set the assignments
|
||||
# the way you want them.
|
||||
|
||||
USER_MIBS="p2CnfRoamingMode=1"
|
||||
#USER_MIBS="p2CnfRoamingMode=1"
|
||||
|
||||
#=======WEP===========================================
|
||||
# [Dis/En]able WEP. Settings only matter if PrivacyInvoked is true
|
||||
|
@ -97,55 +97,20 @@ wlannoenable,*,*,*)
|
|||
dot11WEPDefaultKey2= # e.g. 01:20:03:40:05 or
|
||||
dot11WEPDefaultKey3= # 01:02:03:04:05:06:07:08:09:0a:0b:0c:0d
|
||||
|
||||
#=======STA START=====================================
|
||||
#=======SELECT STATION MODE===================
|
||||
IS_ADHOC=n # y|n, y - adhoc, n - infrastructure
|
||||
|
||||
#=======INFRASTRUCTURE STATION START===================
|
||||
# SSID is all we have for now
|
||||
AuthType="opensystem" # opensystem | sharedkey (requires WEP)
|
||||
DesiredSSID="linux-wlan"
|
||||
|
||||
#=======DOWNLOAD======================================
|
||||
# Do we need to download code/data to the card?
|
||||
WLAN_DOWNLOAD=n
|
||||
WLAN_DOWNLOADER=/sbin/prism2dl
|
||||
WLAN_DLIMAGE=/etc/pcmcia/t10002c5.hex
|
||||
|
||||
#=======ADHOC START====================================
|
||||
IS_ADHOC=y # y|n, y - adhoc, n - infrastructure
|
||||
SSID="linux-wlan"
|
||||
#=======ADHOC STATION START============================
|
||||
SSID="linux-wlan" # SSID
|
||||
BCNINT=100 # Beacon interval (in Kus)
|
||||
CHANNEL=6 # DS channel for BSS (1-14, depends
|
||||
# on regulatory domain)
|
||||
BASICRATES="2 4" # Rates for mgmt&ctl frames (in 500Kb/s)
|
||||
OPRATES="2 4 11 22" # Supported rates in BSS (in 500Kb/s)
|
||||
|
||||
#=======AP START======================================
|
||||
# If IS_AP is 'y', then the following settings will be
|
||||
# used in the creation of a BSS with this station acting
|
||||
# as the AP. If IS_AP is 'n', these settings are ignored.
|
||||
IS_AP=n # y|n
|
||||
IS_BRIDGE=n # Are we a bridging AP?
|
||||
IS_OLDBRIDGE=n # Which kernel bridge code are we using?
|
||||
APWIREDDEVICE=eth0 # Must be an ethernet device
|
||||
APBRIDGEDEVICE=apbr0 # Bridge interface name
|
||||
AP_IPADDR=192.168.200.150 # Bridge IP address (and only bridge)
|
||||
APSSID="linux-wlan" # SSID the AP will use, max 32 chars
|
||||
APBCNINT=100 # Beacon interval (in Kus)
|
||||
APDTIMINT=3 # DTIM interval (in beacons)
|
||||
APCFPOLLABLE=false # AP's CFP support (see table below)
|
||||
APCFPOLLREQ=false # AP's CFP support (see table below)
|
||||
APCFPPERIOD=3 # CFP period, if CFP enabled(in beacons)
|
||||
APCFPMAXDURATION=100 # CFP max length (in Kus)
|
||||
APPROBEDELAY=100 # Not currently used
|
||||
APCHANNEL=6 # DS channel for BSS (1-14, depends
|
||||
# on regulatory domain)
|
||||
APBASICRATES="2 4" # Rates for mgmt&ctl frames (in 500Kb/s)
|
||||
APOPRATES="2 4 11 22" # Supported rates in BSS (in 500Kb/s)
|
||||
|
||||
# Table of CFPOLL* values:
|
||||
# CFPOLLABLE CFPOLLREQ AP Behavior
|
||||
#----------------------------------------------------
|
||||
# false false No Point Coordinator (CFP) at AP
|
||||
# false true CFP for delivery only (no polling)
|
||||
# true false CFP delivery and polling
|
||||
# true true Reserved, do not use
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in New Issue