diff options
Diffstat (limited to 'packages')
14 files changed, 388 insertions, 0 deletions
diff --git a/packages/wlan-ng/files/post-down b/packages/wlan-ng/files/post-down index e69de29bb2..bf4ba0ae60 100644 --- a/packages/wlan-ng/files/post-down +++ b/packages/wlan-ng/files/post-down @@ -0,0 +1,31 @@ +#!/bin/sh +# +# This script takes care of bringing down wlan-ng devices. +# It is run by ifdown. + +WLANCTL=/sbin/wlanctl-ng + +if [ ! -x $WLANCTL ] ; then + exit 0 +fi + +case $IFACE in +wlan?) + # Reset device to make sure it is not trying to generate + # interrupts. + result=`$WLANCTL $IFACE lnxreq_ifstate ifstate=disable` + + # Remove modules. Of course, for all I know they are still in use + # by another interface, in which case these rmmods will fail. Also, + # depending on how modutils is set up, different prism2 modules + # might be loaded. + ( + rmmod prism2_pci || rmmod prism2_cs || rmmod prism2_usb || \ + rmmod prism2_plx || true + rmmod p80211 || true + ) 2>/dev/null + + # Remove lock file, just in case. + rm -f /var/lock/wlan-$IFACE.lock +;; +esac diff --git a/packages/wlan-ng/files/pre-up b/packages/wlan-ng/files/pre-up index e69de29bb2..0ae410edfa 100644 --- a/packages/wlan-ng/files/pre-up +++ b/packages/wlan-ng/files/pre-up @@ -0,0 +1,227 @@ +#!/bin/sh + +case "$METHOD" in loopback) exit 0 ;; esac + +# +# This script takes care of bringing up wlan-ng device. +# It is run by ifup, and gets information from the +# /etc/network/interfaces file. It is derived from the +# init.d/wlan script in the wlan-ng distribution + +WLANCTL=/sbin/wlanctl-ng +PRIV_GENERATOR=/sbin/nwepgen + +if [ ! -x $WLANCTL ] ; then + exit 0 +fi + +# Detect and act only on linux-wlan-ng interfaces +if [ "$IF_WIRELESS_TYPE" != "wlan-ng" ]; then + exit 0 +fi + +# Create a lock file; remove on script exit. This is a fairly crummy lock, +# but all it needs to do is prevent hotplug from calling this script, +# which may happen when the module is loaded below. Since it should only +# happen when the module is loaded, I don't need a proper lock. +if [ -e /var/lock/wlan-$IFACE.lock ]; then + exit 0 +fi +touch /var/lock/wlan-$IFACE.lock +cleanup () { + rm -f /var/lock/wlan-$IFACE.lock +} +trap cleanup 0 + +if [ -z "$IF_WIRELESS_MODE" ]; then + IF_WIRELESS_MODE="ad_hoc" +fi + +if [ -z "$IF_WLAN_NG_HOSTWEP" ]; then + IF_WLAN_NG_HOSTWEP=false +fi + +if [ -z "$IF_WLAN_NG_DEFAULT_KEY_ID" ]; then + IF_WLAN_NG_DEFAULT_KEY_ID=0 +fi + +if [ -z "$IF_WLAN_NG_EXCLUDE_UNENCRYPTED" ]; then + IF_WLAN_NG_EXCLUDE_UNENCRYPTED=true +fi + +if [ -z "$IF_WLAN_NG_PRIV_KEY128" ]; then + IF_WLAN_NG_PRIV_KEY128=false +fi + +if [ -z "$IF_WLAN_NG_BCINT" ]; then + IF_WLAN_NG_BCINT=100 +fi + +if [ -z "$IF_WLAN_NG_BASICRATES" ]; then + IF_WLAN_NG_BASICRATES="2 4" +fi + +if [ -z "$IF_WLAN_NG_OPRATES" ]; then + IF_WLAN_NG_OPRATES="2 4 11 22" +fi + +if [ -z "$IF_WLAN_NG_AUTHTYPE" ]; then + IF_WLAN_NG_AUTHTYPE="opensystem" +fi + +if [ -z "$IF_WIRELESS_CHANNEL" ]; then + IF_WIRELESS_CHANNEL=1 +fi + +if ! modprobe p80211; then + echo "Failed to load p80211.o." >&2 + exit 1 +fi + +# NOTE: We don't explicitly insmod the card driver here. The +# best thing to do is to specify an alias in /etc/modules.conf. +# Then, the first time we call wlanctl with the named device, +# the kernel module autoload stuff will take over. +# But, if you prefer, you could modprobe it here. + + +# Bring the card up into an operable state. +result=`$WLANCTL $IFACE lnxreq_ifstate ifstate=enable` +if [ $? = 0 ] ; then + eval $result + if [ $resultcode != "success" ]; then + echo "Failed to enable the device, resultcode=" $resultcode "." >&2 + exit 1 + fi +else + echo "Failed to enable the device, exitcode=" $? "." >&2 + exit 1 +fi + +# Set user-specified MIB items. +for i in $IF_WLAN_NG_USER_MIBS; do + result=`$WLANCTL $IFACE dot11req_mibset "mibattribute=$i"` + + if [ $? = 0 ] ; then + eval $result + if [ $resultcode != "success" ] ; then + echo "Failed to set user MIB $i." >&2 + exit 1 + fi + else + echo "Failed to set user MIB $i." >&2 + exit 1 + fi +done + +if [ "$IF_WIRELESS_ENC" = "on" ]; then + # Set up WEP. + result=`$WLANCTL $IFACE dot11req_mibget mibattribute=dot11PrivacyOptionImplemented` + if [ $? = 0 ] ; then + eval $result + eval $mibattribute + else + echo "mibget failed." >&2 + exit 1 + fi + + if [ "$dot11PrivacyOptionImplemented" != "true" ]; then + echo "Cannot enable privacy, dot11PrivacyOptionImplemented=$dot11PrivacyOptionImplemented." >&2 + exit 1 + fi + + $WLANCTL $IFACE lnxreq_hostwep decrypt=$IF_WLAN_NG_HOSTWEP encrypt=$IF_WLAN_NG_HOSTWEP >/dev/null + + $WLANCTL $IFACE dot11req_mibset \ + mibattribute=dot11WEPDefaultKeyID=$IF_WLAN_NG_DEFAULT_KEY_ID \ + >/dev/null + + $WLANCTL $IFACE dot11req_mibset \ + mibattribute=dot11ExcludeUnencrypted=$IF_WLAN_NG_EXCLUDE_UNENCRYPTED \ + >/dev/null + + $WLANCTL $IFACE dot11req_mibset \ + mibattribute=dot11PrivacyInvoked=true >/dev/null + + if [ -e "$IF_WLAN_NG_KEYFILE" ]; then + IF_WLAN_NG_PRIV_GENSTR=`cat $IF_WLAN_NG_KEYFILE` + fi + if [ ! -z "$IF_WLAN_NG_PRIV_GENSTR" ]; then + if [ "$IF_WLAN_NG_PRIV_KEY128" = "false" ]; then + keys=`$PRIV_GENERATOR "$IF_WLAN_NG_PRIV_GENSTR" 5` + else + keys=`$PRIV_GENERATOR "$IF_WLAN_NG_PRIV_GENSTR" 13` + fi + + knum=0 + for i in $keys; do + $WLANCTL $IFACE dot11req_mibset \ + mibattribute=dot11WEPDefaultKey$knum=$i \ + >/dev/null + knum=$(expr $knum + 1) + done + else + $WLANCTL $IFACE dot11req_mibset \ + mibattribute=dot11WEPDefaultKey0=$IF_WLAN_NG_KEY0 \ + >/dev/null + $WLANCTL $IFACE dot11req_mibset \ + mibattribute=dot11WEPDefaultKey1=$IF_WLAN_NG_KEY1 \ + >/dev/null + $WLANCTL $IFACE dot11req_mibset \ + mibattribute=dot11WEPDefaultKey2=$IF_WLAN_NG_KEY2 \ + >/dev/null + $WLANCTL $IFACE dot11req_mibset \ + mibattribute=dot11WEPDefaultKey3=$IF_WLAN_NG_KEY3 \ + >/dev/null + fi +fi + +# MAC startup +if [ "$IF_WIRELESS_MODE" = "ad_hoc" ] || + [ "$IF_WIRELESS_MODE" = "ad-hoc" ]; then + startcmd="$WLANCTL $IFACE dot11req_start " + startcmd="$startcmd ssid=$IF_WIRELESS_ESSID" + startcmd="$startcmd bsstype=independent" + startcmd="$startcmd beaconperiod=$IF_WLAN_NG_BCINT" + startcmd="$startcmd dtimperiod=3" + startcmd="$startcmd cfpollable=false" + startcmd="$startcmd cfpollreq=false" + startcmd="$startcmd cfpperiod=3" + startcmd="$startcmd cfpmaxduration=100" + startcmd="$startcmd probedelay=100" + startcmd="$startcmd dschannel=$IF_WIRELESS_CHANNEL" + j=1 + for i in $IF_WLAN_NG_BASICRATES; do + startcmd="$startcmd basicrate$j=$i" + j=$(expr $j + 1) + done + j=1 + for i in $IF_WLAN_NG_OPRATES; do + startcmd="$startcmd operationalrate$j=$i" + j=$(expr $j + 1) + done + + results=`$startcmd` + if [ $? = 0 ]; then + eval $results + if [ $resultcode != "success" ] ; then + echo "IBSS not started, resultcode=$resultcode" >&2 + exit 1 + fi + else + echo FAILED: $startcmd >&2 + exit 1 + fi +else + # Infrastructure mode. + results=`$WLANCTL $IFACE lnxreq_autojoin \ + "ssid=$IF_WIRELESS_ESSID" \ + authtype=$IF_WLAN_NG_AUTHTYPE | sed 's/\([^=]*\)=\(.*\)/\1="\2"/'` + if [ $? = 0 ]; then + eval $results + if [ ${resultcode:-"failure"} != "success" ]; then + echo 'error: Autojoin indicated failure!' >&2 + exit 1 + fi + fi +fi diff --git a/packages/wlan-ng/files/resume b/packages/wlan-ng/files/resume index e69de29bb2..f875939da6 100644 --- a/packages/wlan-ng/files/resume +++ b/packages/wlan-ng/files/resume @@ -0,0 +1,22 @@ +#!/bin/sh +# This script is run on resume to force a down and up of any linux-wlanng +# iterfaces. Otherwise they could get into a weird state. +IFACES=$(ifconfig | grep -B 1 ^wlan | cut -d ' ' -f 1) +for iface in $IFACES; do + echo down $ifcase >>/tmp/log + ifdown $iface || ifconfig $iface down +done + +rmmod prism2_pci 2>/dev/null +rmmod prism2_usb 2>/dev/null +rmmod prism2_cs 2>/dev/null +rmmod prism2_plx 2>/dev/null +rmmod p80211 2>/dev/null + +# There is a race here for some reason. +sleep 2 + +for iface in $IFACES; do + ifup $iface +done + diff --git a/packages/wlan-ng/files/usbctl b/packages/wlan-ng/files/usbctl Binary files differindex e69de29bb2..5a34b03c39 100644 --- a/packages/wlan-ng/files/usbctl +++ b/packages/wlan-ng/files/usbctl diff --git a/packages/wlan-ng/files/wlan-ng.modutils b/packages/wlan-ng/files/wlan-ng.modutils index e69de29bb2..010e20d375 100644 --- a/packages/wlan-ng/files/wlan-ng.modutils +++ b/packages/wlan-ng/files/wlan-ng.modutils @@ -0,0 +1 @@ +alias wlan0 prism2_usb diff --git a/packages/wlan-ng/files/wlan.agent b/packages/wlan-ng/files/wlan.agent index e69de29bb2..945d646984 100644 --- a/packages/wlan-ng/files/wlan.agent +++ b/packages/wlan-ng/files/wlan.agent @@ -0,0 +1,107 @@ +#!/bin/sh +# +# p80211/wlan hotplug policy agent. +# +# wlan hotplug params include: +# +# ACTION=%s [register|remove|shutdown|startup|suspend|resume] +# INTERFACE=%s +# NSDNAME=%s +# + +cd /etc/hotplug +# must have ./ here or busybox shell barfs +. ./hotplug.functions + +#DEBUG=yes export DEBUG + +if [ "$INTERFACE" = "" ]; then + mesg Bad WLAN invocation: \$INTERFACE is not set + exit 1 +fi + +if [ "$NSDNAME" = "" ]; then + mesg Bad WLAN invocation: \$NSDNAME is not set + exit 1 +fi + +debug_mesg WLAN $ACTION on $INTERFACE \($NSDNAME\) + +if [ "$NSDNAME" = "prism2_cs" ] ; then + mesg "WLAN Hotplug bypassed for pcmcia" + exit 0 +fi + +# load up the shared scripts +if [ ! -f /etc/wlan/shared ] ; then + mesg "/etc/wlan/shared not present, aborting" + exit 1 +fi + +ECHO=mesg +. /etc/wlan/shared + +case $ACTION in +'register'|'resume') + eval 'WLAN_ENABLE=$ENABLE_'$INTERFACE + if ! is_true $WLAN_ENABLE ; then + mesg "WLAN $ACTION - interface $INTERFACE not enabled, aborting" + exit 1 + fi + debug_mesg WLAN $INTERFACE registered. + wlan_bring_it_up $INTERFACE + if [ $? = 0 ] ; then + mesg WLAN $INTERFACE brought up successfully. + if [ -x /etc/wlan/network ] ; then + mesg "WLAN bringing up layer 3+ with /etc/wlan/network" + /etc/wlan/network start $INTERFACE + elif [ -x /etc/wlan/pre-ifup ] ; then + # pre-ifup is presumed to call ifup if it + # wants to...it may choose to skip it. + mesg "WLAN bringing up layer 3+ with /etc/wlan/pre-ifup" + /etc/wlan/pre-ifup $INTERFACE + else + mesg "WLAN bringing up layer 3+ with /sbin/ifup" + /sbin/ifup $INTERFACE + fi + else + mesg WLAN Could not bring up $INTERFACE + exit 1 + fi + # eventually invoke net.agent on $INTERFACE w/ REGISTER +;; +'remove'|'suspend') + debug_mesg WLAN $INTERFACE removed. + eval 'WLAN_ENABLE=$ENABLE_'$INTERFACE + if ! is_true $WLAN_ENABLE ; then + mesg "WLAN $ACTION - interface $INTERFACE not enabled, aborting" + exit 1 + fi + if [ -x /etc/wlan/network ] ; then + mesg "WLAN taking down layer 3+ with /etc/wlan/network" + /etc/wlan/network stop $INTERFACE + elif [ -x /etc/wlan/post-ifdown ] ; then + # post-ifdown is presumed to call ifdown if it + # wants to...it may choose to skip it. + mesg "WLAN taking down layer 3+ with /etc/wlan/post-ifdown" + /etc/wlan/post-ifdown $INTERFACE + else + mesg "WLAN taking down layer 3+ with /sbin/ifdown" + /sbin/ifdown $INTERFACE + fi + wlan_disable $INTERFACE +;; +'startup') + # kick off wland. + debug_mesg WLAN p80211 starting! + start_wland +;; +'shutdown') + debug_mesg WLAN p80211 shutting down! + stop_wland +;; +*) + debug_mesg WLAN $ACTION event not supported + exit 1 ;; + +esac diff --git a/packages/wlan-ng/files/Ambit_usb.patch b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/Ambit_usb.patch index e69de29bb2..e69de29bb2 100644 --- a/packages/wlan-ng/files/Ambit_usb.patch +++ b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/Ambit_usb.patch diff --git a/packages/wlan-ng/files/OZ-Configure.patch b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/OZ-Configure.patch index e69de29bb2..e69de29bb2 100644 --- a/packages/wlan-ng/files/OZ-Configure.patch +++ b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/OZ-Configure.patch diff --git a/packages/wlan-ng/files/config.in b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/config.in index e69de29bb2..e69de29bb2 100644 --- a/packages/wlan-ng/files/config.in +++ b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/config.in diff --git a/packages/wlan-ng/files/config.mk b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/config.mk index e69de29bb2..e69de29bb2 100644 --- a/packages/wlan-ng/files/config.mk +++ b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/config.mk diff --git a/packages/wlan-ng/files/no-compat.patch b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/no-compat.patch index e69de29bb2..e69de29bb2 100644 --- a/packages/wlan-ng/files/no-compat.patch +++ b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/no-compat.patch diff --git a/packages/wlan-ng/files/pass-kernel-cross.patch b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/pass-kernel-cross.patch index e69de29bb2..e69de29bb2 100644 --- a/packages/wlan-ng/files/pass-kernel-cross.patch +++ b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/pass-kernel-cross.patch diff --git a/packages/wlan-ng/files/scripts-makefile-hostcc.diff b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/scripts-makefile-hostcc.diff index e69de29bb2..e69de29bb2 100644 --- a/packages/wlan-ng/files/scripts-makefile-hostcc.diff +++ b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/scripts-makefile-hostcc.diff diff --git a/packages/wlan-ng/files/version.h b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/version.h index e69de29bb2..e69de29bb2 100644 --- a/packages/wlan-ng/files/version.h +++ b/packages/wlan-ng/wlan-ng-modules-0.2.1-pre23/version.h |