#!/pkg/bin/ksh
# ---------------------------------------------------------------------
# show_tech_platform_specific_timing - Platform specific show tech-support 
# for common driver timing
# Cisco_user: Venkat Reddy Ennu(vreddye)
# Copyright (c) 2020 by cisco Systems, Inc.
# All rights reserved.
#--------------------------------------------------------------------

. /pkg/bin/show_tech_main_fragment

# Parse the arguments to the script.
__cardtype="unspecified"

while [ "$#" -gt "0" ]; do
   case "$1" in
        -t) __cardtype="$2"; shift 2;;
        *)  default_parser_function "$@"; shift $#;;
    esac
done

if [ "$__cardtype" == "unspecified" ]; then
    __cardtype=`node_type`
fi

cmd_index=1

rp_exec[$cmd_index]='show controllers timing driver trace all location $location'
rp__ksh[$cmd_index]='show_tmgctrl_trace -D -h $fq_nodeid'
((cmd_index++))

rp_exec[$cmd_index]='show controllers timing pll dump location $location'
rp__ksh[$cmd_index]='tmgctrl_core_show_ctrl -D -H $fq_nodeid;'
((cmd_index++))

rp_exec[cmd_index]="ctracedec -GAgkdtspwy tmgctrl"
rp__ksh[cmd_index]='ctracedec -GAgkdtspwy tmgctrl'
((cmd_index++))
rp_exec[$cmd_index]=''
rp__ksh[$cmd_index]=''

cmd_index = 1
rplc_exec[cmd_index]="ctracedec -GAgkdtspwy sync_agent"
rplc__ksh[cmd_index]='ctracedec -GAgkdtspwy sync_agent'
((cmd_index++))
rplc_exec[$cmd_index]=''
rplc__ksh[$cmd_index]=''
display() {

    # Get the card_type: SYS|RP|DRP|LC.
    if [ "$__cardtype" == "SYS" ]; then
        exec_commands sys
    else
        case "$__cardtype" in
        "DRP"|"RP")
            exec_commands rp
            ;;
        "LC")
            exec_commands rplc
            ;;
        esac
    fi

}

. /pkg/bin/show_tech_file_fragment
