I'm hoping for some guidance to figure out what is going wrong in our setup.
System is DM3730 running Linux with a wl18xx module. We can send tx_start commands using calibrator, but always at Wifi channel 5 the output goes haywire and the module doesn't seem to recover until power is cycled. I'm asking for areas to look to troubleshoot the problem. Obviously there is enough working that the path from wifi->calibrator->driver->firmware works. But something is misconfigured somehow. What other information can I provide?
We have a script that calls calibrator (0.8) like so:
# ./wifi 5 1
Calibrator:: Stopping RX Simulation
Calibrator:: Stopping TX Tone
Cycle Delay = 200 usec
Calibrator:: Starting TX Simulation (delay=200, rate=0, size=2000, mode=0
data_type=0, BW=0, gi=0, opt1=0x0, opt2=0x0
src=11:22:33:44:55:66
dst=11:22:33:44:55:77)...
Good output for a lower channel is shown in the first attachment and bad output for channel 5 is the second attachment. 
Here is the 'wifi' script:
#!/bin/sh
CALIBRATOR=/usr/bin/calibrator
# load the driver if not already loaded
lsmod | grep wl18xx >> /dev/null
if [ 0 -ne $? ]
then
echo "Driver is not loaded."
echo "Please manually load the driver and try again"
exit 2
fi
Usage()
{
echo "Usage: wifi command"
echo "Commands:"
echo -e "\tstop"
echo -e "\t<channel> <bitrate> [bandwidth] [delay]"
echo -e "\t\t Channel: 1-14"
echo -e "\t\t Bitrate: CW - carrier wave,"
echo -e "\t\t RX - receive only mode, "
echo -e "\t\t 11b Mbs: 1, 2, 5, 11, "
echo -e "\t\t 11g Mbs: 6, 9, 12, 18, 24, 36, 48, 54,"
echo -e "\t\t 11n Mbs: 6.5(MCS0), 13(MCS1), 19.5(MCS2), 26(MCS3), 39(MCS4), 52(MCS5), 58.5(MCS6, 65(MCS7)"
echo -e "\t\t Note: add the suffix \"guard\" to use the short guard interval"
echo -e "\t\tBandwidth: 20(default), 20lo, 20up, 40lo, 40up"
echo -e "\t\t Delay: Delay in microseconds between packet transmission (200 minimum)"
exit 1
}
if [ $# -eq 0 ]
then
Usage
exit 1
fi
# if the user wants to stop plt mode then stop here and exit the script.
if [ "$1" = "stop" ]
then
$CALIBRATOR dev wlan0 wl18xx_plt stop_rx
$CALIBRATOR dev wlan0 wl18xx_plt stop_tx
$CALIBRATOR dev wlan0 wl18xx_plt tx_tone_stop
$CALIBRATOR dev wlan0 plt power_mode off
exit 0
fi
# if we are going to keep on going, then we are going to need to make
# sure that the plt mode is turned on.
$CALIBRATOR dev wlan0 wl18xx_plt stop_rx
$CALIBRATOR dev wlan0 wl18xx_plt stop_tx
$CALIBRATOR dev wlan0 wl18xx_plt tx_tone_stop
$CALIBRATOR dev wlan0 plt power_mode off
sleep 1
$CALIBRATOR dev wlan0 plt power_mode on
if [ 0 -ne $? ]
then
echo "Power on failed, attempting power cycle..."
$CALIBRATOR dev wlan0 plt power_mode off
sleep 1
$CALIBRATOR dev wlan0 plt power_mode on
if [ 0 -ne $? ]
then
echo "FATAL: Power on failed."
exit 2
fi
fi
# Is the requested channel valid?
if [ $1 -gt 14 -o $1 -lt 0 ]
then
Usage
exit 1
fi
# setup some default values
channel=$1
band=0 # we only support the 2.4G band
primary=0 # default to 20MHz
priloc=0 # primary location (different commands have different nomenclatures for this value)
bw=0 # default bw is 20MHz
power=20000 # 0 - 20000 (20.000dB)
limit=0 # enable limits from the ini file (1=enabled, 0=disabled)
src_mac=11:22:33:44:55:66
dest_mac=11:22:33:44:55:77
DUTYCYCLE=200 # default Tx test Cycle Delay (200 minimum)
if [ $# -ge 3 ]
then
case $3 in
"20") bw=0 ; primary=0 ; priloc=0 ;;
"20lo") bw=0 ; primary=0 ; priloc=1 ;;
"20up") bw=0 ; primary=0 ; priloc=-1 ;;
"40lo") bw=1 ; primary=2 ; priloc=1 ;;
"40up") bw=1 ; primary=3 ; priloc=-1 ;;
*)
Usage
exit 1
esac
if [ $# -ge 4 ]
then
if [ $4 -ge 200 ]
then
DUTYCYCLE=$4
echo "DUTYCYCLE is $DUTYCYCLE"
else
Usage
exit 1
fi
fi
fi
# tune the channel
$CALIBRATOR dev wlan0 wl18xx_plt tune_channel $channel $band $primary
sleep 1
# if we are supposed to be in RX mode then do that, and exit
if [ "$2" = "RX" -o "$2" = "rx" ]
then
# in case we are transmitting tone or test, stop that
$CALIBRATOR dev wlan0 wl18xx_plt stop_tx
$CALIBRATOR dev wlan0 wl18xx_plt tx_tone_stop
$CALIBRATOR dev wlan0 wl18xx_plt start_rx $src_mac $dest_mac
exit 0
fi
# set the power
sleep 1
$CALIBRATOR dev wlan0 wl18xx_plt set_tx_power $power 0 $band $channel $priloc 0 0 $limit 0 0 0 0
sleep 1
# if we are supposed to be in Carrier Wave mode then do that, and exit
if [ "$2" = "CW" -o "$2" = "cw" ]
then
# the supported CW modes are:
# 0 = silence (TX is on, but nothing should be transmitting)
# 1 = carrier feed through
# 2 = single tone
cw_mode=2
# in case we are doing an rx or tx test, stop that
$CALIBRATOR dev wlan0 wl18xx_plt stop_tx
$CALIBRATOR dev wlan0 wl18xx_plt stop_rx
$CALIBRATOR dev wlan0 wl18xx_plt tx_tone_start $cw_mode 0 0 0
exit 0
fi
# figure out the value to use for the rate
rate=-1
guard=1 # guard interval 0 = normal; 1 = short
case "$2" in
1) rate=0 ;;
2) rate=1 ;;
5) rate=2 ;;
11) rate=3 ;;
6) rate=4 ;;
9) rate=5 ;;
12) rate=6 ;;
18) rate=7 ;;
24) rate=8 ;;
36) rate=9 ;;
48) rate=10 ;;
54) rate=11 ;;
6.5|MCS0|mcs0) rate=12 ;;
13|MCS1|mcs1) rate=13 ;;
19.5|MCS2|mcs2) rate=14 ;;
26|MCS3|mcs3) rate=15 ;;
39|MCS4|mcs4) rate=16 ;;
52|MCS5|mcs5) rate=17 ;;
58.5|MCS6|mcs6) rate=18 ;;
65|MCS7|mcs7) rate=19 ;;
6.5guard|MCS0guard|mcs0guard) rate=12; guard=0 ;;
13guard|MCS1guard|mcs1guard) rate=13; guard=0 ;;
19.5guard|MCS2guard|mcs2guard) rate=14; guard=0 ;;
26guard|MCS3guard|mcs3guard) rate=15; guard=0 ;;
39guard|MCS4guard|mcs4guard) rate=16; guard=0 ;;
52guard|MCS5guard|mcs5guard) rate=17; guard=0 ;;
58.5guard|MCS6guard|mcs6guard) rate=18; guard=0 ;;
65guard|MCS7guard|mcs7guard) rate=19; guard=0 ;;
*) echo "Invalid bitrate"
Usage
exit 1
;;
esac
echo "Cycle Delay = ${DUTYCYCLE} usec"
size=2000 # packet size (0-4065)
mode=0 # number of packets to transmit (0=endless)
$CALIBRATOR dev wlan0 wl18xx_plt start_tx $DUTYCYCLE $rate $size $mode 0 $guard 0 0 $src_mac $dest_mac $bw
exit 0
