This is also an easy way to automate ath_info, it would be nice if we
included that on the script too...

#!/bin/bash

#See if madwifi is loaded...
lsmod|grep ath_pci > /dev/null
if [ $? != 0 ]
then
        modprobe ath_pci
fi

#Get memory address for ath_info...
mem=`dmesg|grep Atheros|awk '{print $4}'|awk -F"=" '{print $2}'`

#Run ath_info and save output...
ath_info $mem > /tmp/ath_info.log

madwifi-unload

2007/10/23, bruno randolf <[EMAIL PROTECTED]>:
> hi nick!
>
> well, then that would be like this script: does a) b) c) but not d).
> it includes the text conversion with sed.
>
> bruno
>
> ---
> #!/bin/sh
>
> IF=ath0
>
> count=1
>
> # trace <command> <logfilename>
> trace() {
>         echo 1 > /proc/sys/dev/ath/hal/alq
>         filename=`printf "%02d\n" $count`-$2.log
>         echo "'$1' -> $filename"
>         $1
>         sleep 1
>         echo 0 > /proc/sys/dev/ath/hal/alq
>         sed 's/\x00//g' /tmp/ath_hal.log > /tmp/$filename
>         rm /tmp/ath_hal.log
>         let count++
> }
>
> load_hal_debug() {
>         modprobe ath_hal
>         echo 2 > /proc/sys/dev/ath/hal/debug
> }
>
> # trace commands
> load_hal_debug
> trace "modprobe ath_pci" "modprobe"
> trace "ifconfig $IF up" "ifup"
> trace "iwpriv $IF mode 1" "mode1"
> trace "iwconfig $IF channel 36" "chan36"
> trace "iwpriv $IF mode 2" "mode2"
> trace "iwconfig $IF channel 1" "chan1"
> trace "iwpriv $IF mode 3" "mode3"
> trace "iwconfig $IF channel 2" "chan2"
>
> for opmode in "sta" "ap" "adhoc"; do
>         for mode in 1 2 3; do
>                 load_hal_debug;
>                 trace "modprobe ath_pci autocreate=$opmode" "modprobe-$opmode"
>                 trace "iwpriv $IF mode $mode" "$opmode-set-mode-$mode"
>                 trace "ifconfig $IF up" "$opmode-mode$mode-ifup"
>                 trace "ifconfig $IF down" "$opmode-mode$mode-ifdown"
>                 madwifi-unload
>         done;
> done;
> ---
>
> On Monday 22 October 2007 17:31:09 Nick Kossifidis wrote:
> > looks nice, here is what we want for now...
> >
> > a) At least a channel change for each mode, eg.
> > iwpriv ath0 mode 1 (a)
> > iwconfig ath0 channel 100
> > iwpriv ath0 mode 2 (b)
> > iwconfig ath0 channel 1
> > iwpriv ath0 mode 3 (g)
> > iwconfig ath0 channel 2
> > so we can create the init. table for PHY (check out hw.h)
> >
> >
> > b) ifup/down only with mode pre-set so we can have a better look at
> > the initialization, eg.
> > modprobe ath_pci
> > iwpriv ath0 mode 1
> > ifconfig ath0 up
> > ifconfig ath0 down
> > madwii-unload
> > modprobe ath_pci
> > iwpriv ath0 mode 2
> > ifconfig ath0 up
> > ifconfig ath0 down
> > madwifi-unload
> > modprobe ath_pci
> > iwpriv ath0 mode 3
> > ifconfig ath0 up
> > ifconfig ath0 down
> >
> > c) b + also set operation mode (eg. master/managed/ad-hoc)
> >
> > d) c + establish connection (-> set up a testbed)
> >
> > 2007/10/22, bruno randolf <[EMAIL PROTECTED]>:
> > > On Monday 22 October 2007 02:26:51 Nick Kossifidis wrote:
> > > > Automated script is on the way, i'll let you know when i'm done with
> > > > it.
> > >
> > > hi!
> > >
> > > i don't know what nick has in the making, but we could use something
> > > similar to this:
> > >
> > > ---
> > > #!/bin/sh
> > >
> > > count=1
> > >
> > > # trace <command> <logfilename>
> > > trace() {
> > >         echo 1 > /proc/sys/dev/ath/hal/alq
> > >         echo "'$1' -> $count-$2.log"
> > >         $1
> > >         sleep 1
> > >         echo 0 > /proc/sys/dev/ath/hal/alq
> > >         mv /tmp/ath_hal.log /tmp/$count-$2.log.raw
> > >         let count++
> > > }
> > >
> > > # prepare
> > > rm -f /tmp/*.log
> > > modprobe ath_hal
> > > echo 2 > /proc/sys/dev/ath/hal/debug
> > >
> > > # trace commands
> > > trace "modprobe ath_pci autocreate=none" "modprobe"
> > > trace "wlanconfig ath0 create wlandev wifi0 wlanmode ad-hoc" "wlanconfig"
> > > trace "iwconfig ath0 channel 1" "iwconfig-chan1"
> > > trace "iwconfig ath0 essid xxx" "iwconfig-essid"
> > > trace "ifconfig ath0 up" "ifconfig-up"
> > > ---
> > >
> > > bruno
>
>
>


-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel

Reply via email to