12/30/2011

How to backup the user info in android device

#!/system/bin/sh
GetBackupList() {
    RAW_LIST=`grep '<package' /data/system/packages.xml | grep "$APPS_DIR"`
    COUNT=`echo "$RAW_LIST" | wc -l`
    while [ "$COUNT" -gt 0 ];do
        BACKUP=`echo "$RAW_LIST" | sed -n $COUNT"p" | cut -d' ' -f2 | cut -d'=' -f2 | sed 's/"//g'`
        BACKUP=$BACKUP"|"`echo "$RAW_LIST" | sed -n $COUNT"p" | cut -d' ' -f3 | cut -d'=' -f2 | sed 's/"//g'`
        echo $BACKUP
        COUNT=$(($COUNT-1))
    done
}
FILE_PREFIX="recback"
DEF_BACKUP_PATH="/sdcard"
TMP_DIR="/data/recback_dir"
TMP_FILE="$TMP_DIR/recback.tmp"
WIFI_CONF="/data/misc/wifi/wpa_supplicant.conf"
APPS_DIR="/data/app"
DATA_DIR="/data/data"
TIMEOUT="10"
# the providers which will be backup or restored
PROVIDERS="
com.android.providers.calendar
com.android.providers.telephony
com.android.providers.contacts
com.android.providers.settings
"
if [ ! -d "$TMP_DIR" ];then
    mkdir $TMP_DIR
fi
if [ "$1" == "-r" ];then
    shift
    if [ -z "$1" ];then
        echo "Expect parameter: Need to specify the backup file"
        return 1
    fi
    if [ ! -r "$1" ];then
        echo "Expect a readable backup file"
        return 1
    fi
    BACKUP_FILE="$1"
    echo "Restoring..."
    GetBackupList > "$TMP_FILE"
    # ========= Restore APKs =============
    TAR_APKS=`tar -tvf $BACKUP_FILE | grep '.apk' | sed 's/[ ][ ][ ]*/ /g' | \
                    cut -d' ' -f6`
    # Remove old apks and data
    for TAR_APK in $TAR_APKS;do
        # To avoid the name of *-1.apk
        APK_REAL_NAME=${TAR_APK%.*}  # exclude the extension name
        if [ $(echo ${APK_REAL_NAME##*-} | grep -E "[^0-9]" -v -c) -ne 0 ];then
            # This case means the file name is formatted as *-[0-9] with the
            # numbered postfix, so we should change the name to real name
            APK_REAL_NAME=${APK_REAL_NAME%-*}  # exclude the numbered postfix
        fi
        if [ -f "/$APK_REAL_NAME"-*.apk ];then
            APK_DATA_PATH="$DATA_DIR/"`cat "$TMP_FILE" | grep "$APK_REAL_NAME" | \
                             cut -d'|' -f1`
            if [ -d "$APK_DATA_PATH" ];then
                rm -r $APK_DATA_PATH
            fi
            rm "/$APK_REAL_NAME"-*.apk
        fi
    done
    PRE_CD=`pwd`
    cd $TMP_DIR
    for TAR_APK in $TAR_APKS;do
        tar -xvf $BACKUP_FILE $TAR_APK
        # To avoid the name of *-1.apk
        APK_REAL_NAME=${TAR_APK%.*}  # exclude the extension name
        if [ $(echo ${APK_REAL_NAME##*-} | grep -E "[^0-9]" -v -c) -ne 0 ];then
            # This case means the file name is formatted as *-[0-9] with the
            # numbered postfix, so we should change the name to real name
            APK_REAL_NAME=${APK_REAL_NAME%-*}  # exclude the numbered postfix
            mv $TAR_APK $APK_REAL_NAME".apk"
            TAR_APK=$APK_REAL_NAME".apk"
        fi
        cp -f $TAR_APK "$APPS_DIR"    # install the apk
        rm $TAR_APK
        PKG_NAME=`grep '<package' /data/system/packages.xml | grep "$TAR_APK" | \
                        cut -d' ' -f2 | cut -d'=' -f2 | sed 's/"//g'`
        NATIVE_LIB=`grep '<package' /data/system/packages.xml | grep "$TAR_APK" | \
                        cut -d' ' -f4 | cut -d'=' -f2 | sed 's/"//g'`
        TIMEOUT="10"
        while [ -z "$PKG_NAME" ] || [ -z "$NATIVE_LIB" ];do
            echo "wait system update $PKG_NAME ..."
            sleep 1
            PKG_NAME=`grep '<package' /data/system/packages.xml | grep "$TAR_APK" | \
                        cut -d' ' -f2 | cut -d'=' -f2 | sed 's/"//g'`
            NATIVE_LIB=`grep '<package' /data/system/packages.xml | grep "$TAR_APK" | \
                        cut -d' ' -f4 | cut -d'=' -f2 | sed 's/"//g'`
            if [ $TIMEOUT -gt 0 ];then
                TIMEOUT=$(($TIMEOUT-1))
            else
                rm "/$TAR_APK"
                break
            fi
        done
        if [ -n "$PKG_NAME" ];then
            DATA_OWN=`ls -l $DATA_DIR | grep "$PKG_NAME" | sed 's/\t/ /g' | \
                          sed 's/[ ][ ][ ]*/ /g' | cut -d' ' -f2`
            DATA_GROUP=`ls -l $DATA_DIR | grep "$PKG_NAME" | sed 's/\t/ /g' | \
                          sed 's/[ ][ ][ ]*/ /g' | cut -d' ' -f3`
            if [ -z "$DATA_OWN" ] || [ -z "$DATA_GROUP" ];then
                BEGIN_INDEX="5"
                while [ $(echo $DATA_OWN | grep "userId" -c) -eq 0 ] && \
                      [ $(echo $DATA_OWN | grep "sharedUserId" -c) -eq 0 ];do
                    DATA_OWN=`grep '<package' /data/system/packages.xml | \
                                    grep "$TAR_APK" | cut -d' ' -f"$BEGIN_INDEX"`
                    BEGIN_INDEX=$(($BEGIN_INDEX+1))
                done
                DATA_OWN=`echo $DATA_OWN | cut -d'=' -f2 | sed 's/"//g' | sed 's/\>//g'`
                DATA_GROUP="$DATA_OWN"
            fi
           
            echo "tar $BACKUP_FILE data/data/$PKG_NAME"
            tar -xvf $BACKUP_FILE "data/data/$PKG_NAME"
            echo "Copy data/data/$PKG_NAME"
            if [ -d "$DATA_DIR/$PKG_NAME/lib" ];then
                rm -r "data/data/$PKG_NAME/lib"
            fi
            cp -rf "data/data/$PKG_NAME" "$DATA_DIR/"
            rm -r "data/data/$PKG_NAME"    # delete immediately for more free space

            echo "pkgname: $PKG_NAME | lib: $NATIVE_LIB | own: $DATA_OWN | group: $DATA_GROUP"
            # Get each package data file and change the own permission to current apk
            PKG_DATA_FILES=`find $DATA_DIR/$PKG_NAME`
            chown $DATA_OWN"."$DATA_GROUP $PKG_DATA_FILES
            PKG_LIB_FILES=`find $NATIVE_LIB`
            chown "system.system" $PKG_LIB_FILES
        else
            # need to do sth?
            echo "ERROR: install $TAR_APK failed, PKG_NAME null"
        fi
    done
    # ========= End of restore APKs =============
    # ========= Restore Wifi configuration =============
    if [ ! -d "/data/misc" ];then
        mkdir /data/misc
    fi
    if [ ! -d "/data/misc/wifi" ];then
        mkdir /data/misc/wifi
    fi
    tar -xvf $BACKUP_FILE "data/misc/wifi/wpa_supplicant.conf"
    cp -f data/misc/wifi/wpa_supplicant.conf /data/misc/wifi/
    chown "wifi.wifi" /data/misc/wifi/wpa_supplicant.conf
    # ========= End of restore Wifi configuration =============
    # ========= Restore Providers =============
    # backup origin providers
    PROVIDER_LIST=""
    for PROVIDER in $PROVIDERS;do
        if [ -d "$DATA_DIR/$PROVIDER" ];then
            PROVIDER_LIST="$PROVIDER_LIST $DATA_DIR/$PROVIDER"
        else
            echo "ERROR: the provider [$PROVIDER] not existed"
        fi
    done
    tar -cvf $DEF_BACKUP_PATH"/providers_"$TIME_STAMP".tar" $PROVIDER_LIST
    TAR_PROVIDERS=`tar -tvf $BACKUP_FILE | \
                        grep 'com.android.providers.*/databases/' | \
                        grep "^d" | sed 's/[ ][ ][ ]*/ /g' | cut -d' ' -f6`
    for TAR_PROVIDER in $TAR_PROVIDERS;do
        tar -xvf $BACKUP_FILE $TAR_PROVIDER
        if [ ! -d "/$TAR_PROVIDER" ];then
            echo "skipped /$TAR_PROVIDER"
            continue
        fi
       
        DATA_OWN=`ls -l /$TAR_PROVIDER | head -n1 | sed 's/\t/ /g' | \
                      sed 's/[ ][ ][ ]*/ /g' | cut -d' ' -f2`
        DATA_GROUP=`ls -l /$TAR_PROVIDER | head -n1 | sed 's/\t/ /g' | \
                      sed 's/[ ][ ][ ]*/ /g' | cut -d' ' -f3`
        echo "Copy $TAR_PROVIDER"
        cp -rf $TAR_PROVIDER/* "/$TAR_PROVIDER"
        DATABASES_FILES=`find /$TAR_PROVIDER`
        chown "$DATA_OWN.$DATA_GROUP" $DATABASES_FILES
        rm -r $TAR_PROVIDER
    done
   
    # ========= End of restore Providers =============
    rm "$TMP_FILE"
    cd "$PRE_CD"
elif [ "$1" == "-b" ];then
    echo "Begin backup: $TIME_STAMP"
    GetBackupList > "$TMP_FILE"
    BACKUP_LIST=`cat "$TMP_FILE" | cut -d'|' -f1 | sed 's/^/\/data\/data\//g'`
    PROVIDER_LIST=""
    for PROVIDER in $PROVIDERS;do
        if [ -d "$DATA_DIR/$PROVIDER/databases" ];then
            PROVIDER_LIST="$PROVIDER_LIST $DATA_DIR/$PROVIDER/databases"
        else
            echo "ERROR: the provider [$PROVIDER] not existed"
        fi
    done
   
    TIME_STAMP=`date "+%y%m%d%H%M%S"`

    if [ ! -f "$WIFI_CONF" ];then
        WIFI_CONF=""
    fi
    if [ ! -d "$APPS_DIR" ];then
        APPS_DIR=""
    fi
    PRE_CD=`pwd`
    cd "/data"
    tar -cvf $DEF_BACKUP_PATH"/"$FILE_PREFIX$TIME_STAMP".tar" \
               $BACKUP_LIST $PROVIDER_LIST $WIFI_CONF $APPS_DIR
    echo "Done: "$DEF_BACKUP_PATH"/"$FILE_PREFIX$TIME_STAMP".tar"
    cd "$PRE_CD"
    rm "$TMP_FILE"
elif [ "$1" == "-l" ];then       
    ls -l $DEF_BACKUP_PATH/$FILE_PREFIX*.tar | sed 's/\t/ /g' | sed 's/[ ][ ][ ]*/ /g' | cut -d' ' -f7 | sed "s/^/\/sdcard\//g"
else
    echo "Useage: recback.sh <option> [file]"
    echo "          -b         backup user data"
    echo "          -r <file>  restore the specified backup file"
    echo "          -l         list the backup files in default path"
    echo "                     default backup path: /sdcard"
fi
rm -r "$TMP_DIR"
  

how to mount the SDcard in init.rc manually

in init.rc 
please add the following:
# mount mtd partitions
mount vfat /dev/block/mmcblk1p1 /sdcard
chown system system /sdcard
chmod 0777 /sdcard
setprop EXTERNAL_STORAGE_STATE mounted

How to mount the USB disk storage decies in android device

in device/qcom/msm7627_7x_surf/vold.fstab
change:
dev_mount sdcard /mnt/sdcard auto /devices/platform/msm_sdcc.1/mmc_host
to
dev_mount sdcard /mnt/sdcard auto /devices/platform/msm_hsusb_host.0/usb1

How to get the max frequency of CPU var ADB shell

get the max:
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
get the current:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

wlarm_android usage

# ./wlarm_android -h
./wlarm_android -h
Usage: ./wlarm_android [-a|i <adapter>] [-h] [-d|u|x] <command> [arguments]
  -h        this message and command descriptions
  -h [cmd]  command description for cmd
  -a, -i    adapter name or number
  -d        output format signed integer
  -u        output format unsigned integer
  -x        output format hexdecimal
ver     get version information
cmds    generate a short list of available commands
up      reinitialize and mark adapter up (operational)
down    reset and mark adapter down (disabled)
out     mark adapter down but do not reset hardware(disabled)
        On dualband cards, cards must be bandlocked before use.
clk     set board clock state. return error for set_clk attempt if the driver is
 not down
        0: clock off
        1: clock on
restart Restart driver.  Driver must already be down.
reboot  Reboot platform
radio   Set the radio on or off.
        "on" or "off"
dump    Give suboption "list" to list various suboptions
nvram_dump
        print nvram variables to stdout
nvset   set an nvram variable
        name=value (no spaces around '=')
nvget   get the value of an nvram variable
nvram_get
        get the value of an nvram variable
revinfo get hardware revision information
msglevel
        set driver console debugging message bitvector
        type 'wl msglevel ?' for values
PM      set driver power management mode:
        0: CAM (constantly awake)
        1: PS  (power-save)
        2: FAST PS mode
wake    set driver power-save mode sleep state:
        0: core-managed
        1: awake
promisc set promiscuous mode ethernet address reception
        0 - disable
        1 - enable
monitor set monitor mode
        0 - disable
        1 - enable active monitor mode (interface still operates)
frag    Deprecated. Use fragthresh.
rts     Deprecated. Use rtsthresh.
cwmin   Set the cwmin.  (integer [1, 255])
cwmax   Set the cwmax.  (integer [256, 2047])
srl     Set the short retry limit.  (integer [1, 255])
lrl     Set the long retry limit.  (integer [1, 255])
rate    force a fixed rate:
        valid values for 802.11a are (6, 9, 12, 18, 24, 36, 48, 54)
        valid values for 802.11b are (1, 2, 5.5, 11)
        valid values for 802.11g are (1, 2, 5.5, 6, 9, 11, 12, 18, 24, 36, 48, 5
4)
        -1 (default) means automatically determine the best rate
mrate   force a fixed multicast rate:
        valid values for 802.11a are (6, 9, 12, 18, 24, 36, 48, 54)
        valid values for 802.11b are (1, 2, 5.5, 11)
        valid values for 802.11g are (1, 2, 5.5, 6, 9, 11, 12, 18, 24, 36, 48, 5
4)
        -1 (default) means automatically determine the best rate
a_rate  force a fixed rate for the A PHY:
        valid values for 802.11a are (6, 9, 12, 18, 24, 36, 48, 54)
        -1 (default) means automatically determine the best rate
a_mrate force a fixed multicast rate for the A PHY:
        valid values for 802.11a are (6, 9, 12, 18, 24, 36, 48, 54)
        -1 (default) means automatically determine the best rate
bg_rate force a fixed rate for the B/G PHY:
        valid values for 802.11b are (1, 2, 5.5, 11)
        valid values for 802.11g are (1, 2, 5.5, 6, 9, 11, 12, 18, 24, 36, 48, 5
4)
        -1 (default) means automatically determine the best rate
bg_mrate
        force a fixed multicast rate for the B/G PHY:
        valid values for 802.11b are (1, 2, 5.5, 11)
        valid values for 802.11g are (1, 2, 5.5, 6, 9, 11, 12, 18, 24, 36, 48, 5
4)
        -1 (default) means automatically determine the best rate
infra   Set Infrastructure mode: 0 (IBSS) or 1 (Infra BSS)
ap      Set AP mode: 0 (STA) or 1 (AP)
bssid   Get the BSSID value, error if STA and not associated
bssmax  get number of BSSes
channel Set the channel:
        valid channels for 802.11b/g (2.4GHz band) are 1 through 14
        valid channels for 802.11a  (5 GHz band) are:
                36, 40, 44, 48, 52, 56, 60, 64,
                100, 104, 108, 112, 116,120, 124, 128, 132, 136, 140,
                149, 153, 157, 161,
                184, 188, 192, 196, 200, 204, 208, 212, 216
cur_mcsset
        Get the current mcs set
chanspecs
        Get all the valid chanspecs (default: all within current locale):
        -b band (5(a) or 2(b/g))
        -w bandwidth, 10,20 or 40
        [-c country_abbrev]

chanspec
        Set <channel>[a,b][n][u,l]
        channel number (0-224)
        band a=5G, b=2G, default to 2G if channel <= 14
        bandwidth, n=10, none for 20 & 40
        ctl sideband, l=lower, u=upper
OR Set channel with legacy format:
        -c channel number (0-224)
        -b band (5(a) or 2(b/g))
        -w bandwidth, 10,20 or 40
        -s ctl sideband, -1=lower, 0=none, 1=upper
dfs_channel_forced
        Set <channel>[a,b][n][u,l]
        channel number (0-224)
        band a=5G, b=2G, default to 2G if channel <= 14
        bandwidth, n=10, non for 20 & 40
        ctl sideband, l=lower, u=upper

tssi    Get the tssi value from radio
txpwr   Set tx power in milliwatts.  Range [1, 84].
txpwr1  Set tx power in in various units. Choose one of (default: dbm):
        -d dbm units
        -q quarter dbm units
        -m milliwatt units
Can be combined with:
        -o turn on override to disable regulatory and other limitations
Use wl txpwr -1 to restore defaults
txpathpwr
        Turn the tx path power on or off on 2050 radios
txpwrlimit
        Return current tx power limit
powerindex
        Set the transmit power for A band(0-63).
        -1 - default value
atten   Set the transmit attenuation for B band. Args: bb radio txctl1.
        auto to revert to automatic control
        manual to supspend automatic control
phyreg  Get/Set a phy register:
        offset [ value ] [ band ]
radioreg
        Get/Set a radio register:
        offset [ value ] [ band/core ]
ucflags Get/Set ucode flags 1, 2, 3(16 bits each)
        offset [ value ] [ band ]
shmem   Get/Set a shared memory location:
        offset [ value ] [band ]
macreg  Get/Set any mac registers(include IHR and SB):
        macreg offset size[2,4] [ value ] [ band ]
ucantdiv
        Enable/disable ucode antenna diversity (1/0 or on/off)
gpioout Set any GPIO pins to any value. Use with caution as GPIOs would be assig
ned to chipcommon
        Usage: gpiomask gpioval
ampdu_tid
        enable/disable per-tid ampdu; usage: wl ampdu_tid <tid> [0/1]
ampdu_send_addba
        send addba to specified ea-tid; usage: wl ampdu_send_addba <tid> <ea>
ampdu_send_delba
        send delba to specified ea-tid; usage: wl ampdu_send_delba <tid> <ea>
ampdu_clear_dump
        clear ampdu counters
dpt_deny
        adds/removes ea to dpt deny list
        usage: wl dpt_deny <add,remove> <ea>

dpt_endpoint
        creates/updates/deletes dpt endpoint for ea
        usage: wl dpt_endpoint <create, update, delete> <ea>

dpt_pmk sets DPT pre-shared key
dpt_fname
        sets/gets DPT friendly name
dpt_list
        gets status of all dpt peers
bdd_fname
        sets/gets BDD friendly name
p2p_fname
        sets/gets P2P friendly name
p2p_discoverable
        sets/gets P2P discovery mode
antdiv  Set antenna diversity for rx
        0 - force use of antenna 0
        1 - force use of antenna 1
        3 - automatic selection of antenna diversity
txant   Set the transmit antenna
        0 - force use of antenna 0
        1 - force use of antenna 1
        3 - use the RX antenna selection that was in force during
            the most recently received good PLCP header
plcphdr Set the plcp header.
        "long" or "auto" or "debug"
phytype Get phy type
rateparam
        set driver rate selection tunables
        arg 1: tunable id
        arg 2: tunable value
wepstatus
        Set or Get WEP status
        wepstatus [on|off]
primary_key
        Set or get index of primary key
addwep  Set an encryption key.  The key must be 5, 13 or 16 bytes long, or
        10, 26, 32, or 64 hex digits long.  The encryption algorithm is
        automatically selected based on the key size. keytype is accepted
        only when key length is 16 bytes/32 hex digits and specifies
        whether AES-OCB or AES-CCM encryption is used. Default is ccm.
        addwep <keyindex> <keydata> [ocb | ccm] [notx] [xx:xx:xx:xx:xx:xx]
rmwep   Remove the encryption key at the specified key index.
keys    Prints a list of the current WEP keys
tsc     Print Tx Sequence Couter for key at specified key index.
wsec_test
        Generate wsec errors
        wsec_test <test_type> <keyindex|xx:xx:xx:xx:xx:xx>
        type 'wl wsec_test ?' for test_types
tkip_countermeasures
        Enable or disable TKIP countermeasures (TKIP-enabled AP only)
        0 - disable
        1 - enable
wsec_restrict
        Drop unencrypted packets if WSEC is enabled
        0 - disable
        1 - enable
eap     restrict traffic to 802.1X packets until 802.1X authorization succeeds
        0 - disable
        1 - enable
cur_etheraddr
        Get/set the current hw address
authorize
        restrict traffic to 802.1X packets until 802.1X authorization succeeds
deauthorize
        do not restrict traffic to 802.1X packets until 802.1X authorization suc
ceeds
deauthenticate
        deauthenticate a STA from the AP with optional reason code (AP ONLY)
wsec    wireless security bit vector
        1 - WEP enabled
        2 - TKIP enabled
        4 - AES enabled
        8 - WSEC in software
        0x80 - FIPS enabled
auth    set/get 802.11 authentication type. 0 = OpenSystem, 1= SharedKey
wpa_auth
        Bitvector of WPA authorization modes:
        1       WPA-NONE
        2       WPA-802.1X/WPA-Professional
        4       WPA-PSK/WPA-Personal
        64      WPA2-802.1X/WPA2-Professional
        128     WPA2-PSK/WPA2-Personal
        0       disable WPA
wpa_cap set/get 802.11i RSN capabilities
set_pmk Set passphrase for PMK in driver-resident supplicant.
scan    Initiate a scan.
        Default an active scan across all channels for any SSID.
        Optional arg: SSIDs, list of [up to 10] SSIDs to scan (comma or space se
parated).
        Options:
        -s S, --ssid=S          SSIDs to scan
        -t ST, --scan_type=ST   [active|passive] scan type
        --bss_type=BT           [bss/infra|ibss/adhoc] bss type to scan
        -b MAC, --bssid=MAC     particular BSSID MAC address to scan, xx:xx:xx:x
x:xx:xx
        -n N, --nprobes=N       number of probes per scanned channel
        -a N, --active=N        dwell time per channel for active scanning
        -p N, --passive=N       dwell time per channel for passive scanning
        -h N, --home=N          dwell time for the home channel between channel
scans
        -c L, --channels=L      comma or space separated list of channels to sca
n
iscan_s Initiate an incremental scan.
        Default an active scan across all channels for any SSID.
        Optional arg: SSIDs, list of [up to 10] SSIDs to scan (comma or space se
parated).
        Options:
        -s S, --ssid=S          SSIDs to scan
        -t ST, --scan_type=ST   [active|passive] scan type
        --bss_type=BT           [bss/infra|ibss/adhoc] bss type to scan
        -b MAC, --bssid=MAC     particular BSSID MAC address to scan, xx:xx:xx:x
x:xx:xx
        -n N, --nprobes=N       number of probes per scanned channel
        -a N, --active=N        dwell time per channel for active scanning
        -p N, --passive=N       dwell time per channel for passive scanning
        -h N, --home=N          dwell time for the home channel between channel
scans
        -c L, --channels=L      comma or space separated list of channels to sca
n
iscan_c Continue an incremental scan.
        Default an active scan across all channels for any SSID.
        Optional arg: SSIDs, list of [up to 10] SSIDs to scan (comma or space se
parated).
        Options:
        -s S, --ssid=S          SSIDs to scan
        -t ST, --scan_type=ST   [active|passive] scan type
        --bss_type=BT           [bss/infra|ibss/adhoc] bss type to scan
        -b MAC, --bssid=MAC     particular BSSID MAC address to scan, xx:xx:xx:x
x:xx:xx
        -n N, --nprobes=N       number of probes per scanned channel
        -a N, --active=N        dwell time per channel for active scanning
        -p N, --passive=N       dwell time per channel for passive scanning
        -h N, --home=N          dwell time for the home channel between channel
scans
        -c L, --channels=L      comma or space separated list of channels to sca
n
passive Puts scan engine into passive mode
regulatory
        Get/Set regulatory domain mode (802.11d). Driver must be down.
spect   Get/Set 802.11h Spectrum Management mode.
        0 - Off
        1 - Loose interpretation of 11h spec - may join non-11h APs
        2 - Strict interpretation of 11h spec - may not join non-11h APs
        3 - Disable 11h and enable 11d
        4 - Loose interpretation of 11h+d spec - may join non-11h APs
scanresults
        Return results from last scan.
iscanresults
        Return results from last iscan. Specify a buflen (max 8188)
        to artificially limit the size of the results buffer.
        iscanresults [buflen]

assoc   Print information about current network association.
        (also known as "status")
status  Print information about current network association.
        (also known as "assoc")
disassoc
        Disassociate from the current BSS/IBSS.
chanlist
        Deprecated. Use channels.
channels
        Return valid channels for the current settings.
channels_in_country
        Return valid channels for the country specified.
        Arg 1 is the country abbreviation
        Arg 2 is the band(a or b)
curpower
        Return current tx power settings.
        -q (quiet): estimated power only.
txinstpwr
        Return tx power based on instant TSSI
scansuppress
        Suppress all scans for testing.
        0 - allow scans
        1 - suppress scans
evm     Start an EVM test on the given channel, or stop EVM test.
        Arg 1 is channel number 1-14, or "off" or 0 to stop the test.
        Arg 2 is optional rate (1, 2, 5.5 or 11)
rateset Returns or sets the supported and basic rateset, (b) indicates basic
        With no args, returns the rateset. Args are
        rateset "default" | "all" | <arbitrary rateset>
                default - driver defaults
                all - all rates are basic rates
                arbitrary rateset - list of rates
        List of rates are in Mbps and each rate is optionally followed
        by "(b)" or "b" for a Basic rate. Example: 1(b) 2b 5.5 11
        At least one rate must be Basic for a legal rateset.
roam_trigger
        Get or Set the roam trigger RSSI threshold:
        Get: roam_trigger [a|b]
        Set: roam_trigger <integer> [a|b|all]
        integer -   0: default
                    1: optimize bandwidth
                    2: optimize distance
            [-1, -99]: dBm trigger value
roam_delta
        Set the roam candidate qualification delta. roam_delta [integer [, a/b]]

roam_scan_period
        Set the roam candidate qualification delta.  (integer)
suprates
        Returns or sets the 11g override for the supported rateset
        With no args, returns the rateset. Args are a list of rates,
        or 0 or -1 to specify an empty rateset to clear the override.
        List of rates are in Mbps, example: 1 2 5.5 11
scan_channel_time
        Get/Set scan channel time
scan_unassoc_time
        Get/Set unassociated scan channel dwell time
scan_home_time
        Get/Set scan home channel dwell time
scan_passive_time
        Get/Set passive scan channel dwell time
scan_nprobes
        Get/Set scan parameter for number of probes to use per channel scanned
prb_resp_timeout
        Get/Set probe response timeout
channel_qa
        Get last channel quality measurment
channel_qa_start
        Start a channel quality measurment
country Select Country Code for driver operational region
        For simple country setting: wl country <country>
        Where <country> is either a long name or country code from ISO 3166; for
 example "Germany" or "DE"
        For a specific built-in country definition: wl country <built-in> [<adve
rtised-country>]
        Where <built-in> is a country country code followed by '/' and regulator
y revision number.
        For example, "US/3".
        And where <advertised-country> is either a long name or country code fro
m ISO 3166.
        If <advertised-country> is omitted, it will be the same as the built-in
country code.
        Use 'wl country list [band(a or b)]' for the list of supported countries

autocountry_default
        Select Country Code for use with Auto Contry Discovery
join    Join a specified network SSID.
        Join syntax is: join <ssid> [key xxxxx] [imode bss|ibss] [amode open|sha
red|openshared|wpa|wpapsk|wpa2|wpa2psk|wpanone]
ssid    Set or get a configuration's SSID.
        wl ssid [-C num]|[--cfg=num] [<ssid>]
        If the configuration index 'num' is not given, configuraion #0 is assume
d and
        setting will initiate an assoication attempt if in infrastructure mode,
        or join/creation of an IBSS if in IBSS mode,
        or creation of a BSS if in AP mode.
mac     Set or get the list of source MAC address matches.
        wl mac xx:xx:xx:xx:xx:xx [xx:xx:xx:xx:xx:xx ...]
        To Clear the list: wl mac none
macmode Set the mode of the MAC list.
        0 - Disable MAC address matching.
        1 - Deny association to stations on the MAC list.
        2 - Allow association to stations on the MAC list.
wds     Set or get the list of WDS member MAC addresses.
        Set using a space separated list of MAC addresses.
         wl wds xx:xx:xx:xx:xx:xx [xx:xx:xx:xx:xx:xx ...]
lazywds Set or get "lazy" WDS mode (dynamically grant WDS membership to anyone).

noise   Get noise (moving average) right after tx in dBm
fqacurcy
        Manufacturing test: set frequency accuracy mode.
        freqacuracy syntax is: fqacurcy <channel>
        Arg is channel number 1-14, or 0 to stop the test.
crsuprs Manufacturing test: set carrier suppression mode.
        carriersuprs syntax is: crsuprs <channel>
        Arg is channel number 1-14, or 0 to stop the test.
longtrain
        Manufacturing test: set longtraining mode.
        longtrain syntax is: longtrain <channel>
        Arg is A band channel number or 0 to stop the test.
band    Returns or sets the current band
        auto - auto switch between available bands (default)
        a - force use of 802.11a band
        b - force use of 802.11b band
bands   Return the list of available 802.11 bands
phylist Return the list of available phytypes
shortslot
        Get current 11g Short Slot Timing mode. (0=long, 1=short)
shortslot_override
        Get/Set 11g Short Slot Timing mode override. (-1=auto, 0=long, 1=short)
shortslot_restrict
        Get/Set AP Restriction on associations for 11g Short Slot Timing capable
 STAs.
        0 - Do not restrict association based on ShortSlot capability
        1 - Restrict association to STAs with ShortSlot capability
ignore_bcns
        AP only (G mode): Check for beacons without NONERP element(0=Examine bea
cons, 1=Ignore beacons)
pktcnt  Get the summary of good and bad packets.
upgrade Upgrade the firmware on an embedded device
gmode   Set the 54g Mode (LegacyB|Auto||GOnly|BDeferred|Performance|LRS)
gmode_protection
        Get G protection mode. (0=disabled, 1=enabled)
gmode_protection_control
        Get/Set 11g protection mode control alg.(0=always off, 1=monitor local a
ssociation, 2=monitor overlapping BSS)
gmode_protection_override
        Get/Set 11g protection mode override. (-1=auto, 0=disable, 1=enable)
protection_control
        Get/Set protection mode control alg.(0=always off, 1=monitor local assoc
iation, 2=monitor overlapping BSS)
legacy_erp
        Get/Set 11g legacy ERP inclusion (0=disable, 1=enable)
scb_timeout
        AP only: inactivity timeout value for authenticated stas
assoclist
        AP only: Get the list of associated MAC addresses.
isup    Get driver operational state (0=down, 1=up)
rssi    Get the current RSSI val, for an AP you must specify the mac addr of the
 STA
rssi_event
        Set parameters associated with RSSI event notification
        usage: wl rssi_event <rate_limit> <rssi_levels>
        rate_limit: Number of events posted to application will be limited to 1
per this rate limit. Set to 0 to disable rate limit.
        rssi_levels: Variable number of RSSI levels (maximum 8)  in increasing o
rder (e.g. -85 -70 -60). An event will be posted each time the RSSI of received
beacons/packets crosses a level.

phy_rssi_ant
        Get RSSI per antenna (only gives RSSI of current antenna for SISO PHY)

fasttimer
        Deprecated. Use fast_timer.
slowtimer
        Deprecated. Use slow_timer.
glacialtimer
        Deprecated. Use glacial_timer.
radar   Enable/Disable radar
radarargs
        Get/Set Radar parameters in
        order as version, npulses, ncontig, min_pw , max_pw, thresh0,
        thresh1, blank, fmdemodcfg, npulses_lp, min_pw_lp, max_pw_lp,
        min_fm_lp, max_deltat_lp, min_deltat, max_deltat,
        autocorr, st_level_time

radarargs40
        Get/Set Radar parameters for 40Mhz channel in
        order as version, npulses, ncontig, min_pw , max_pw, thresh0,
        thresh1, blank, fmdemodcfg, npulses_lp, min_pw_lp, max_pw_lp,
        min_fm_lp, max_deltat_lp, min_deltat, max_deltat,
        autocorr, st_level_time

dfs_status
        Get dfs status
interference
        Get/Set interference mitigation mode. Choices are:
        0 = none
        1 = non wlan
        2 = wlan manual
        3 = wlan automatic
frameburst
        Disable/Enable frameburst mode
pwr_percent
        Get/Set power output percentage
toe     Enable/Disable tcpip offload feature
toe_ol  Get/Set tcpip offload components
toe_stats
        Display checksum offload statistics
toe_stats_clear
        Clear checksum offload statistics
arpoe   Enable/Disable arp agent offload feature
arp_ol  Get/Set arp offload components
arp_peerage
        Get/Set age of the arp entry in minutes
arp_table_clear
        Clear arp cache
arp_hostip
        Add a host-ip address or display them
arp_hostip_clear
        Clear all host-ip addresses
arp_stats
        Display ARP offload statistics
arp_stats_clear
        Clear ARP offload statistics
wet     Get/Set wireless ethernet bridging mode
bi      Get/Set the beacon period (bi=beacon interval)
dtim    Get/Set DTIM
wds_remote_mac
        Get WDS link remote endpoint's MAC address
wds_wpa_role_old
        Get WDS link local endpoint's WPA role (old)
wds_wpa_role
        Get/Set WDS link local endpoint's WPA role
authe_sta_list
        Get authenticated sta mac address list
autho_sta_list
        Get authorized sta mac address list
measure_req
        Send an 802.11h measurement request.
        Usage: wl measure_req <type> <target MAC addr>
        Measurement types are: TPC, Basic, CCA, RPI
        Target MAC addr format is xx:xx:xx:xx:xx:xx
quiet   Send an 802.11h quiet command.
        Usage: wl quiet <TBTTs until start>, <duration (in TUs)>, <offset (in TU
s)>
csa     Send an 802.11h channel switch anouncement with chanspec:
        <mode> <count> <channel>[a,b][n][u,l]
        mode (0 or 1)
        count (0-254)
        channel number (0-224)
        band a=5G, b=2G
        bandwidth n=10, non for 20 & 40
        ctl sideband, l=lower, u=upper, default no ctl sideband

constraint
        Send an 802.11h Power Constraint IE
        Usage: wl constraint 1-255 db
rm_req  Request a radio measurement of type basic, cca, or rpi
        specify a series of measurement types each followed by options.
        example: wl rm_req cca -c 1 -d 50 cca -c 6 cca -c 11
        Options:
        -t n  numeric token id for measurement set or measurement
        -c n  channel
        -d n  duration in TUs (1024 us)
        -p    parallel flag, measurement starts at the same time as previous
        Each measurement specified uses the same channel and duration as the
        previous unless a new channel or duration is specified.
rm_rep  Get current radio measurement report
join_pref
        Set/Get join target preferences.
assoc_pref
        Set/Get association preference.
Usage: wl assoc_pref [auto|a|b|g]
wme     Set WME (Wireless Multimedia Extensions) mode (0=off, 1=on, -1=auto)
wme_ac  wl wme_ac ap|sta [be|bk|vi|vo [ecwmax|ecwmin|txop|aifsn|acm <value>] ...
]
wme_apsd
        Set APSD (Automatic Power Save Delivery) mode on AP (0=off, 1=on)
wme_apsd_sta
        Set APSD parameters on STA. Driver must be down.
Usage: wl wme_apsd_sta <max_sp_len> <be> <bk> <vi> <vo>
   <max_sp_len>: number of frames per USP: 0 (all), 2, 4, or 6
   <xx>: value 0 to disable, 1 to enable U-APSD per AC
wme_dp  Set AC queue discard policy.
Usage: wl wme_dp <be> <bk> <vi> <vo>
   <xx>: value 0 for newest-first, 1 for oldest-first
wme_counters
        print WMM stats
wme_clear_counters
        clear WMM counters
wme_tx_params
        wl wme_tx_params [be|bk|vi|vo [short|sfb|long|lfb|max_rate <value>] ...]

wme_maxbw_params
        wl wme_maxbw_params [be|bk|vi|vo <value> ....]
lifetime
        Set Lifetime parameter (milliseconds) for each ac.
wl lifetime be|bk|vi|vo [<value>]
reinit  Reinitialize device
sta_info
        wl sta_info <xx:xx:xx:xx:xx:xx>
nphy_test_tssi
        wl nphy_test_tssi val
nphy_test_tssi_offs
        wl nphy_test_tssi_offs val
nphy_rssiant
        wl nphy_rssiant antindex(0-3)
cap     driver capabilities
malloc_dump
        Deprecated. Folded under 'wl dump malloc
chan_info
        channel info
add_ie  Add a vendor proprietary IE to 802.11 management packets
Usage: wl add_ie <pktflag> length OUI hexdata
<pktflag>: Bit 0 - Beacons
           Bit 1 - Probe Rsp
           Bit 2 - Assoc/Reassoc Rsp
           Bit 3 - Auth Rsp
           Bit 4 - Probe Req
           Bit 5 - Assoc/Reassoc Req
Example: wl add_ie 3 10 00:90:4C 0101050c121a03
         to add this IE to beacons and probe responses
del_ie  Delete a vendor proprietary IE from 802.11 management packets
Usage: wl del_ie <pktflag> length OUI hexdata
<pktflag>: Bit 0 - Beacons
           Bit 1 - Probe Rsp
           Bit 2 - Assoc/Reassoc Rsp
           Bit 3 - Auth Rsp
           Bit 4 - Probe Req
           Bit 5 - Assoc/Reassoc Req
Example: wl del_ie 3 10 00:90:4C 0101050c121a03
list_ie Dump the list of vendor proprietary IEs
rand    Get a 2-byte Random Number from the MAC's PRNG
Usage: wl rand
otpw    Write an srom image to on-chip otp
Usage: wl otpw file
nvotpw  Write nvram to on-chip otp
Usage: wl nvotpw file
bcmerrorstr
        errorstring
freqtrack
        Set Frequency Tracking Mode (0=Auto, 1=On, 2=OFF)
eventing
        set/get 128-bit hex filter bitmask for MAC event reporting up to applica
tion layer
event_msgs
        set/get 128-bit hex filter bitmask for MAC event reporting via packet in
dications
counters
        Return driver counter values
delta_stats_interval
        set/get the delta statistics interval in seconds (0 to disable)
delta_stats
        get the delta statistics for the last interval
assoc_info
        Returns the assoc req and resp information [STA only]
autochannel
        auto channel selection:
        1 to issue a channel scanning;
        2 to set channel based on the channel scanning result;
        without argument to only show the channel selected;
        ssid must set to null before this process, RF must be up
csscantimer
        auto channel scan timer in minutes (0 to disable)
closed  hides the network from active scans, 0 or 1.
        0 is open, 1 is hide
pmkid_info
        Returns the pmkid table
abminrate
        get/set afterburner minimum rate threshold
bss     set/get BSS enabled status: up/down
closednet
        set/get BSS closed network attribute
ap_isolate
        set/get AP isolation
eap_restrict
        set/get EAP restriction
diag    diag testindex(1-interrupt, 2-loopback, 3-memory, 4-led); precede by 'wl
 down' and follow by 'wl up'
reset_d11cnts
        reset 802.11 MIB counters
staname get/set station name:
        Maximum name length is 15 bytes
apname  get AP name
otpdump Dump raw otp
nrate   -r legacy rate (CCK, OFDM)-m mcs index-s stf mode (0=SISO,1=CDD,2=STBC(n
ot supported),3=SDM)
mimo_txbw
        get/set mimo txbw (2=20Mhz(lower), 3=20Mhz upper, 4=40Mhz, 5=40Mhz dup<m
cs32 only)
cac_addts
        add TSPEC, error if STA is not associated or WME is not enabled
        arg1: G711, signal, ICMP , Aggregated, UDL, UUL or starting TSPEC parame
ter input list
        arg2: direction for G711, ICMP, Aggregated, UDL,        UUL     and sign
al(bi-direction by default):
                 1: uplink direction
                 2: downlink direction
cac_delts
        delete TSPEC, error if STA is not associated or WME is not enabled
        arg1: G711, signal, ICMP, Aggregated, UDL, UUL or starting TSPEC paramet
er input list
        arg2: direction for G711, ICMP, Aggregated, UDL, UUL    or signal(bi-dir
ection by default):
                 1: uplink direction
                 2: downlink direction
cac_delts_ea
        delete TSPEC, error if STA is not associated or WME is not enabled
        arg1: Desired TSINFO for the given tspec
        arg2: Desired MAC address
                 1: uplink direction
                 2: downlink direction
cac_tslist
        Get the list of TSINFO in driver
        eg. 'wl cac_tslist' get a list of TSINFO
cac_tslist_ea
        Get the list of TSINFO for given STA in driver
        eg. 'wl cac_tslist_ea ea' get a list of TSINFO
cac_tspec
        Get specific TSPEC with matching TSINFO
        eg. 'wl cac_tspec 0xaa 0xbb 0xcc' where 0xaa 0xbb & 0xcc are TSINFO octe
ts
cac_tspec_ea
        Get specific TSPEC for given STA with matching TSINFO
        eg. 'wl cac_tspec 0xaa 0xbb 0xcc xx:xx:xx:xx:xx:xx'     where 0xaa 0xbb
& 0xcc are TSINFO octets        where xx:xx:xx:xx:xx:xx is mac address
sd_cis  dump sdio CIS
sd_devreg
        g/set device register across SDIO bus
sd_drivestrength
        g/set SDIO bus drive strenth in mA
sd_hostreg
        g/set local controller register
sd_blockmode
        g/set blockmode
sd_blocksize
        g/set block size for a function
sd_ints g/set client ints
sd_dma  g/set dma usage
sd_numints
        number of device interrupts
sd_numlocalints
        number of non-device controller interrupts
sd_divisor
        set the divisor for SDIO clock generation
sd_mode g/set SDIO bus mode (spi, sd1, sd4)
sd_highspeed
        set the high-speed clocking mode
sd_msglevel
        g/set debug message level
nphy_antsel
        get/set antenna configuration
        set: -1(AUTO), 0xAB(fixed antenna selection)
                where A and B is the antenna numbers used for RF chain 0 and 1 r
espectively
        query: <utx>[AUTO] <urx>[AUTO] <dtx>[AUTO] <drx>[AUTO]
                where utx = TX unicast antenna configuration
                        urx = RX unicast antenna configuration
                        dtx = TX default (non-unicast) antenna configuration
                        drx = RX default (non-unicast) antenna configuration

txfifo_sz
        set/get the txfifo size; usage: wl txfifo_sz <fifonum> <size_in_bytes>
pfnset  Configures preferred network off load parameter
        pfnset syntax is: pfnset [scanfrq xxxxx(30 sec)] [netimeout xxxx(60 sec)
][rssi_delta xxxx(30 dBm)] [sort (listorder)|rssi] [bkgscan (0)|1] [autoswitch (
0)|1][immediate 0|(1)] [autoconnect (0)|1
pfnadd  Adding preferred network to monitor and connect
        pfnadd syntax is: pfnadd <SSID> [key xxxxx] [imode (bss)|ibss][amode (op
en)|shared] [wpa_auth (wpadisabled)|wpapsk|wpa2psk|wpanone][wsec WEP|TKIP|AES|TK
IPAES]
pfn     Enable/disable preferred network off load monitoring
        pfn syntax is: pfn 0|1
pfnclear
        Clear the preferred network list
        pfn syntax is: pfnclear
pfneventchk
        Listen and prints the preferred network off load event from dongle
        pfneventchk syntax is: pfneventchk [(eth1)ifname]
event_filter
        Set/get event filter
        event_filter syntax is: event_filter [value]
phy_rxiqest
        Get phy RX IQ noise in dBm:
        -s # of samples (2^n)
        -a antenna select, 0,1 or 3

rifs    set/get the rifs status; usage: wl rifs <1/0> (On/Off)

pkteng_start
        start packet engine tx usage: wl pkteng_start <xx:xx:xx:xx:xx:xx> <tx|tx
withack> [(async)|sync] [ipg] [len] [nframes] [src]
        start packet engine rx usage: wl pkteng_start <xx:xx:xx:xx:xx:xx> <rx|rx
withack> [(async)|sync] [rxframes] [rxtimeout]
        sync: synchronous mode
        ipg: inter packet gap in us
        len: packet length
        nframes: number of frames; 0 indicates continuous tx test
        src: source mac address
        rxframes: number of receive frames (sync mode only)
        rxtimeout: maximum timout in msec (sync mode only)

pkteng_stop
        stop packet engine; usage: wl pkteng_stop <tx|rx>
pkteng_stats
        packet engine stats; usage: wl pkteng_stats
wowl    Enable/disable WOWL events
  0   - Clear all events
Bit 0 - Wakeup on Magic Packet
Bit 1 - Wakeup on NetPattern (use 'wl wowl_pattern' to configure pattern)
Bit 2 - Wakeup on loss-of-link due to Disassociation/Deauth
Bit 3 - Wakeup on retrograde tsf
Bit 4 - Wakeup on loss of beacon (use 'wl wowl_bcn_loss' to configure time)

wowl_bcn_loss
        Set #of seconds of beacon loss for wakeup event

wowl_pattern
        usage: wowl_pattern [ [ add | del ] offset mask value ]
No options -- lists existing pattern list
add -- Adds the pattern to the list
del -- Removes a pattern from the list
offset -- Starting offset for the pattern
mask -- Mask to be used for pattern. Bit i of mask => byte i of the pattern
value -- Value of the pattern

wowl_wakeind
        usage: wowl_wakeind [clear]
Shows last system wakeup event indications from PCI and D11 cores
clear - Clear the indications

lpphy_papdepstbl
        print papd eps table; Usage: wl lpphy_papdepstbl
lpphy_txiqcc
        usage: lpphy_txiqcc [a b]
Set/get the iqcc a, b values

lpphy_txlocc
        usage: lpphy_txlocc [di dq ei eq fi fq]
Set/get locc di dq ei eq fi fq values

phytable
        usage: wl phytable table_id offset width_of_table_element [table_element
]
Set/get table element of a table with the given ID at the given offset
Note that table width supplied should be 8 or 16 or 32
table ID, table offset can not be -ve

lpphy_paparams
        usage: lpphy_paparms [b0 b1 a1]
Set/get the PA parameters, specific to lpphy (only for driver already up)
NOTE: Command will be deprecated, should switch to pavars instead.
wowl_pkt
        Send a wakeup frame to wakup a sleeping STA in WAKE mode
Usage: wl wowl_pkt <len> <dst ea | bcast | ucast <STA ea>>[ magic <STA ea> | net
 <offset> <pattern>]
e.g. To send bcast magic frame -- wl wowl_pkt 102 ff:ff:ff:ff:ff:ff magic 00:90:
4c:AA:BB:CC
     To send ucast magic frame -- wl wowl_pkt 102 00:90:4c:aa:bb:cc magic 00:90:
4c:AA:BB:CC
     To send a frame with L2 unicast - wl wowl_pkt 102 00:90:4c:aa:bb:cc net 0 0
x00904caabbcc
 NOTE: offset for netpattern frame starts from "Dest EA" of ethernet frame.So de
st ea will be used only when offset is >= 6

wme_apsd_trigger
        Set Periodic APSD Trigger Frame Timer timeout in ms (0=off)
wme_autotrigger
        Enable/Disable sending of APSD Trigger frame when all ac are delivery en
abled
reassoc Initiate an extended (re)association request.
        Default active scan across all channels for any SSID.
        Optional args: BSSID and list of channels to scan.
        Options:
        -b -BSSID=xx:xx:xx:xx:xx:xx,            BSSID to scan and join
        -c L, --channels=L      comma or space separated list of channels to sea
rch in  -r --radioband (5(a) or 2(b/g))
        -w --bandwidth, 10,20 or 40
        -s ctl sideband, -1=lower, 0=none, 1=upper
send_nulldata
        Sed a null frame to the specified hw address
btc_params
        g/set BT Coex parameters
btc_flags
        g/set BT Coex flags
obss_scan_params
        set/get Overlapping BSS scan parameters
Usage: wl obss_scan a b c d e ...; where
        a-Passive Dwell, {5-1000TU}, default = 100
        b-Active Dwell, {10-1000TU}, default = 20
        c-Width Trigger Scan Interval, {10-900sec}, default = 300
        d-Passive Total per Channel, {200-10000TU}, default = 200
        e-Active Total per Channel, {20-1000TU}, default = 20
        f-Channel Transition Delay Factor, {5-100}, default = 5
        g-Activity Threshold, {0-100%}, default = 25

keep_alive
        Send specified "keep-alive" packet periodically.
        Usage: wl keep_alive <period> <packet>
                period: Re-transmission period in milli-seconds. 0 to disable pa
cket transmits.
                packet: Hex packet contents to transmit. The packet contents sho
uld include the entire ethernet packet (ethernet header, IP header, UDP header,
and UDP payload) specified in network byte order.
        e.g. Send keep alive packet every 30 seconds:
        wl keep_alive 30000 0x0014a54b164f000f66f45b7e08004500001e000040004011c5
2a0a8830700a88302513c413c4000a00000a0d

pkt_filter_add
        Install a packet filter.
        Usage: wl pkt_filter_add <id> <polarity> <type> <offset> <bitmask> <patt
ern>
        id:       Integer. User specified id.
        type:     0 (Pattern matching filter).
        offset:   Integer. Offset within received packets to start matching.
        polarity: Set to 1 to negate match result. 0 is default.
        bitmask:  Hex bitmask that indicates which bits of 'pattern' to match. M
ust be same
                size as 'pattern'. Bit 0 of bitmask corresponds to bit 0 of patt
ern, etc.
                If bit N of bitmask is 0, then do *not* match bit N of the patte
rn with
                the received payload. If bit N of bitmask is 1, then perform mat
ch.
        pattern:  Hex pattern to match.

pkt_filter_clear_stats
        Clear packet filter statistic counter values.
        Usage: wl pkt_filter_clear_stats <id>

pkt_filter_enable
        Enable/disable a packet filter.
        Usage: wl pkt_filter_enable <id> <0|1>

pkt_filter_list
        List installed packet filters.
        Usage: wl pkt_filter_list [val]
        val: 0 (disabled filters) 1 (enabled filters)

pkt_filter_mode
        Set packet filter match action.
        Usage: wl pkt_filter_mode <value>
        value: 1 - Forward packet on match, discard on non-match (default).
               0 - Discard packet on match, forward on non-match.

pkt_filter_delete
        Uninstall a packet filter.
        Usage: wl pkt_filter_delete <id>

pkt_filter_stats
        Retrieve packet filter statistic counter values.
        Usage: wl pkt_filter_stats <id>

seq_start
        Initiates command batching sequence. Subsequent IOCTLs will be queued un
til
seq_stop is received.
seq_stop
        Defines the end of command batching sequence. Queued IOCTLs will be exec
uted.
seq_delay
        Driver should spin for the indicated amount of time.
It is only valid within the context of batched commands.
seq_error_index
        Used to retrieve the index (starting at 1) of the command that failed wi
thin a batch
findserver
        Used to find the remote server with proper mac address given by the user
,this cmd is specific to wifi protocol.

Daisy-chain on primary JTAG, USB Trace32 for qualcomm msm7x27A

To use a daisy-chain JTAG configuration and a USB connection to the debugger, perform the  steps described in this section. This configuration has not been extensively tested with 3 AMSS 76xx, and is provided for reference only.
1. Copy the following files from the release products\76XX\tools\T32 directory to C:\T32:
config-chain-arm9-usb.t32
config-chain-cortex-usb.t32
startup-chain-arm9.cmm
startup-chain-cortex.cmm



2. Create a shortcut to start the ARM9 Trace32 session with the following properties:

Name: Trace32 ARM9 USB Daisy-Chain
Target: C:\T32\t32marm.exe -c config-chain-arm9-usb.t32, startup-chain-arm9.cmm
Start in: C:\T32
Note that there is a comma between the configuration filename and the startup filename, but no comma between the startup filename and the debugger name.
3. Create a shortcut to start the CORTEX A5 Trace32 session with the following properties:
Name: Trace32 CORTEX A5 USB Daisy-Chain
Target: C:\T32\t32marm.exe -c config-chain-cortex-usb.t32, startup-24 chain-cortex.cmm
Start in: C:\T32
4. Start the ARM9 Trace32 session by opening the Trace32 ARM9 USB Daisy-Chain shortcut.
5. Start the CORTEX A5 session by opening the Trace32 CORTEX A5 USB Daisy-Chain shortcut.

12/09/2011

Daisy-chain on primary JTAG, USB Trace32 for qualcomm msm8x55

3 To operate properly in a dual-processor environment, Trace32 requires a special configuration
4 file and startup script. There must be a different set of these files for each processor. The files are
5 also dependent on the JTAG configuration. Example files are included in the AMSS release, in
6 the directory AMSS\products\<asic>\tools\t32.
7 By default, the Trace32 configuration file config.t32 is located in the Trace32 install directory.
8 The default startup script is t32.cmm and is also located in the same directory. For this
9 description, it is assumed that the Trace32 install directory is C:\T32.
10 Perform the following steps to install Trace32 and Qualcomm hardware support:
11 1. Follow vendor instructions to install Trace32 software to the Windows host.
12 2. Copy all of the files from the AMSS\products\<asic>\tools\T32 directory to C:\T32.

The MSM7x30 shortcuts include the following:
8 􀂄 Trace32 Modem chain
9 􀂅 Target – C:\T32\t32marm.exe -c C:\T32\config-chain-modem.t32,
10 startup-chain-modem.cmm
11 􀂅 Start in – C:\T32


􀂄 Trace32 Applications chain
17 􀂅 Target – C:\T32\t32marm.exe -c c:\T32\config-chain-apps.t32,
18 startup-chain-apps.cmm
19 􀂅 Start in – C:\T32


Lauterbach JTAG debugger equipment 5
6 The Modem JTAG and Applications processor JTAG can be set up in the following
7 configurations:
8 􀂄 Daisy-chain Modem and Applications processor on primary JTAG – In this configuration,
9 the Modem and Applications processor JTAG tap controllers are internally daisy-chained
10 and appear on the primary JTAG port. In this configuration, the following equipment is
11 required:
12 􀂅 LA-7699 Power Debug II ETH
13 􀂅 LA-7742 JTAG ARM9™ with the following license extensions:
14 – LA-7765X JTAG Debugger Extension for ARM11
15 – LA-7843X JTAG Debugger Extension for Cortex
16 􀂄 Primary Modem JTAG and auxiliary Applications processor JTAG – In this configuration,
17 the Modem JTAG tap controller appears on the primary JTAG port, and the Applications
18 processor appears on the auxiliary JTAG port. The following additional equipment is
19 required:
20 􀂅 LA-7699 Power Debug II ETH
21 􀂅 LA-7705 Debug ETH
22 􀂅 LA-7742 JTAG ARM9 with the following license extension:
23 – LA-7843X JTAG Debugger Extension for Cortex
24 􀂅 LA-7765 JTAG ARM11
25 NOTE: In the primary Modem JTAG and auxiliary Applications processor JTAG configuration, the
26 auxiliary JTAG port pins are the GPIO pins, whereas the primary port has dedicated pins.

11/08/2011

How to format SD card via adb shell in android



do the following.

adb shell
# newfs_msdos �F 32 /dev/block/mmcblk0


newfs_msdos
usage: newfs_msdos [ -options ] special [disktype]
where the options are:
        -@ create file system at specified offset
        -B get bootstrap from file
        -C create image file with specified size
        -F FAT type (12, 16, or 32)
        -I volume ID
        -L volume label
        -N don't create file system: just print out parameters
        -O OEM string
        -S bytes/sector
        -a sectors/FAT
        -b block size
        -c sectors/cluster
        -e root directory entries
        -f standard format
        -h drive heads
        -i file system info sector
        -k backup boot sector
        -m media descriptor
        -n number of FATs
        -o hidden sectors
        -r reserved sectors
        -s file system size (sectors)
        -u sectors/track


11/03/2011

Daisy-chain on primary JTAG, USB Trace32 for qualcomm msm7x27

Daisy-chain on primary JTAG, USBTrace32
11 To use a daisy-chain JTAG configuration and a USB connection to the debugger, perform the
12 steps described in this section. This configuration has not been extensively tested with
13 AMSS 76xx, and is provided for reference only.
14 1. Copy the following files from the release products\76XX\tools\T32 directory to C:\T32:
15
16 config-chain-arm9-usb.t32
17 config-chain-arm11-usb.t32
18 startup-chain-arm11.cmm
19 startup-chain-arm9.cmm
20
21 2. Create a shortcut to start the ARM9 Trace32 session with the following properties:
22
23 Name: Trace32 ARM9 USB Daisy-Chain
24 Target: C:\T32\t32marm.exe -c config-chain-arm9-usb.t32, startup-chain-arm9.cmm
25 Start in: C:\T32
26
27 Note that there is a comma between the configuration filename and the startup filename, but
28 no comma between the startup filename and the debugger name.
29 3. Create a shortcut to start the ARM11 Trace32 session with the following properties:
30
31 Name: Trace32 ARM11 USB Daisy-Chain
32 Target: C:\T32\t32marm.exe -c config-chain-arm11-usb.t32, startup-chain-arm11.cmm
33 Start in: C:\T32
34
35 4. Start the ARM9 Trace32 session by opening the Trace32 ARM9 USB Daisy-Chain shortcut.
36 5. Start the ARM11 session by opening the Trace32 ARM11 USB Daisy-Chain shortcut.
5.4.5 AMSS Trace32 scripts
2 This section describes how to use the AMSS Trace32 development scripts. Unless otherwise
3 mentioned, all scripts are located in the <root>\AMSS\products\76XX\build\ms directory.
4 5.4.5.1 JTAG load
5 Steps to program the Flash and load build on the SURF or FFA with Trace32 are:
6 1. Start the ARM9 Trace32 session. Start the ARM11 Trace32 session if you want to load the
7 ARM11 image.
8 2. Run dev_mjnload_android.cmm from the ARM9 and select the modem ELF. It will prompt
9 for the apps product directory; select LINUX/android/vendor/qcom/msm7627_surf. It will
10 then prompt for vmlinux; select it by going through out/target/product/msm7627_surf/obj/
11 KERNEL_OBJ. Wait for ARM9 image loading to complete.
12 3. If the ARM11 Trace32 session is running, then the ARM11 loading process will begin.
NOTE It may be necessary to hold down the FB key after the ARM11 loads the boot image, to prevent
the bootloader from attempting to boot into the kernel. This will result in system image flashing
errors.
13 4. Wait for the ARM9 to stop at the soft_breakpoints_enabled breakpoint. Execute "do sync",
14 then "go". ARM9 and ARM11 kernel symbols will be loaded.
15 􀂈 To individually load the modem symbols, use the m_jload_dev_flash.cmm script.
16 􀂈 To individually load kernel symbols, load vmlinux with d.load.elf.
17 Android user space debugging may only be performed using Eclipse/ADB.
18 It is only necessary to run dev_mjnload_android.cmm when the Flash must be programmed. If
19 you have already run one of these scripts to load your build into the Flash, then you can use
20 jload.cmm to only reload the symbols, or reset.cmm to reset without reloading the symbols. Both
21 scripts are described in later sections.
22
NOTE If you rebuild, then you must run dev_mjnload_android.cmm to load the new build into the
Flash.
23
24 If you wish to debug the L4 kernel, then run the debug_kernel.cmm script. This will cause the
25 jload process to stop the ARM9 and ARM11 processors at the kernel entry point, instead of at the
26 soft_breakpoints_enabled breakpoint. At the kernel entry, the MMU is disabled, so software
27 breakpoints cannot be used. On-chip hardware breakpoints must be set instead. Note that there are
28 only two available within each ARM core. It is not until soft_breakpoints_enabled that software
29 breakpoints can be enabled. When kernel debug is enabled, it will remain enabled until it is
30 disabled or Trace32 is closed