bprdctl/bp_msg.h
2020-10-21 09:50:28 +02:00

255 lines
18 KiB
C
Executable file

#ifndef _BP_MSG_H
#define _BP_MSG_H
#define OK 1
#define ERROR 0
#define HELP_ENTRY "help"
#define INFO_ENTRY "info"
#define RID_ENTRY "rid"
#define MID_ENTRY "mid"
#define IS_BYPASS_ENTRY "is_bypass"
#define GET_BYPASS_SLAVE_ENTRY "get_bypass_slave"
#define GET_BYPASS_CAPS_ENTRY "get_bypass_caps"
#define GET_WD_SET_CAPS_ENTRY "get_wd_set_caps"
#define SET_BYPASS_ENTRY "set_bypass"
#define GET_BYPASS_ENTRY "get_bypass"
#define GET_BYPASS_CHANGE_ENTRY "get_bypass_change"
#define SET_DIS_BYPASS_ENTRY "set_dis_bypass"
#define GET_DIS_BYPASS_ENTRY "get_dis_bypass"
#define SET_BYPASS_PWOFF_ENTRY "set_bypass_pwoff"
#define GET_BYPASS_PWOFF_ENTRY "get_bypass_pwoff"
#define SET_BYPASS_PWUP_ENTRY "set_bypass_pwup"
#define GET_BYPASS_PWUP_ENTRY "get_bypass_pwup"
#define SET_STD_NIC_ENTRY "set_std_nic"
#define GET_STD_NIC_ENTRY "get_std_nic"
#define SET_BYPASS_WD_ENTRY "set_bypass_wd"
#define GET_BYPASS_WD_ENTRY "get_bypass_wd"
#define GET_WD_EXPIRE_TIME_ENTRY "get_wd_time_expire"
#define GET_WD_EXPIRE_ENTRY "get_wd_expire"
#define RESET_BYPASS_WD_TIMER_ENTRY "reset_bypass_wd"
#define SET_TX_ENTRY "set_tx"
#define GET_TX_ENTRY "get_tx"
#define BYPASS_ENABLE "on"
#define BYPASS_DISABLE "off"
#define TAP_MODE "tap"
#define BYPASS_MODE "bypass"
#define DISC_MODE "disc"
#define NORMAL_MODE "normal"
#define SET_TAP_ENTRY "set_tap"
#define GET_TAP_ENTRY "get_tap"
#define GET_TAP_CHANGE_ENTRY "get_tap_change"
#define SET_DIS_TAP_ENTRY "set_dis_tap"
#define GET_DIS_TAP_ENTRY "get_dis_tap"
#define SET_TAP_PWUP_ENTRY "set_tap_pwup"
#define GET_TAP_PWUP_ENTRY "get_tap_pwup"
#define SET_DISC_ENTRY "set_disc"
#define GET_DISC_ENTRY "get_disc"
#define GET_DISC_CHANGE_ENTRY "get_disc_change"
#define SET_DIS_DISC_ENTRY "set_dis_disc"
#define GET_DIS_DISC_ENTRY "get_dis_disc"
#define SET_DISC_PWUP_ENTRY "set_disc_pwup"
#define GET_DISC_PWUP_ENTRY "get_disc_pwup"
#define SET_WD_EXP_MODE_ENTRY "set_wd_exp_mode"
#define GET_WD_EXP_MODE_ENTRY "get_wd_exp_mode"
#define SET_WD_AUTORESET_ENTRY "set_wd_autoreset"
#define GET_WD_AUTORESET_ENTRY "get_wd_autoreset"
#define SET_TPL_ENTRY "set_tpl"
#define GET_TPL_ENTRY "get_tpl"
#define GET_BYPASS_INFO_ENTRY "get_bypass_info"
#define GET_BP_VMNIC_INFO_ENTRY "get_vmnic_info"
#define GET_BP_PCI_INFO_ENTRY "get_pci_info"
#define GET_BP_ALL_INFO_ENTRY "get_all_info"
#define GET_BP_DEV_NUM_ENTRY "get_dev_num"
#define GET_BP_DRV_VER_ENTRY "get_drv_ver"
#define GET_BP_CFG_DATA0_ENTRY "get_cfg_data0"
#define SET_BP_BLINK_ENTRY "blink_test"
#define SET_MANUF_ENTRY "set_bp_manuf"
#define SET_HW_RESET_ENTRY "set_hw_reset"
#define GET_HW_RESET_ENTRY "get_hw_reset"
#define SET_WAIT_AT_PWUP_ENTRY "set_wait_at_pwup"
#define GET_WAIT_AT_PWUP_ENTRY "get_wait_at_pwup"
#define IF_NAME "eth"
/********MESSAGES*************/
#define NOT_SUPP_MSG "The interface is not capable of the operation.\n"
#define NOT_SUPP_TPL_EN_MSG "The interface is not capable of the operation or TPL mode is enabled.\n"
#define NOT_SUPP_BP_MSG "The interface doesn't support Bypass.\n"
#define NOT_SUPP_BPT_MSG "The interface doesn't support Bypass/TAP.\n"
#define SLAVE_IF_MSG "The interface is a slave interface.\n"
#define MASTER_IF_MSG "The interface is a control interface.\n"
#define MNG_IF_MSG "The interface is a management interface.\n"
#define NOT_SUPP_BPT_SLAVE_MSG "The interface is a slave interface or doesn't support Bypass/TAP.\n"
#define NOT_SUPP_BP_SLAVE_MSG "The interface is a slave interface or doesn't support Bypass.\n"
#define NOT_SUPP_BP_SLAVE_UN_MSG "The interface is a slave interface or doesn't support Bypass or Bypass state is unknown.\n"
#define NOT_SUPP_TAP_SLAVE_MSG "The interface is a slave interface or doesn't support TAP.\n"
#define NOT_SUPP_DISC_SLAVE_MSG "The interface is a slave interface or doesn't support Disconnect.\n"
#define NOT_SUPP_SLAVE_MSG "The interface is a slave interface or doesn't support this feature.\n"
#define BP_PAIR_MSG "Port num. %d is a slave port.\n"
#define SUCCESS_MSG "completed successfully.\n"
#define BP_MODE_MSG "The interface is in the Bypass mode.\n"
#define NON_BP_MODE_MSG "The interface is in the non-Bypass mode.\n"
#define TAP_MODE_MSG "The interface is in the TAP mode.\n"
#define DISC_MODE_MSG "The interface is in the Disconnect mode.\n"
#define NON_TAP_MODE_MSG "The interface is in the non-TAP mode.\n"
#define NON_DISC_MODE_MSG "The interface is in the non-Disconnect mode.\n"
#define TPL_MODE_MSG "The interface is in the TPL mode.\n"
#define NON_TPL_MODE_MSG "The interface is in the non-TPL mode.\n"
#define NORMAL_MODE_MSG "The interface is in the Normal mode.\n"
#define NONDISC_MODE_LAST_MSG "There was no change to disconnect from the last read\n"
#define NONTAP_MODE_LAST_MSG "There was no change to TAP from the last read\n"
#define NONBYPASS_MODE_LAST_MSG "There was no change to bypass from the last read\n"
#define TAP_MODE_LAST_MSG "There was a change to TAP state.\n"
#define NON_TAP_MODE_LAST_MSG "There was a change to non-TAP state.\n"
#define BP_MODE_LAST_MSG "There was a change to Bypass state.\n"
#define DISC_MODE_LAST_MSG "There was a change to Disconnect state.\n"
#define BP_MODE_EN_MSG "Bypass mode is enabled.\n"
#define BP_MODE_DIS_MSG "Bypass mode is disabled.\n"
#define TAP_MODE_EN_MSG "TAP mode is enabled.\n"
#define TAP_MODE_DIS_MSG "TAP mode is disabled.\n"
#define DISC_MODE_EN_MSG "Disconnect mode is enabled.\n"
#define DISC_MODE_DIS_MSG "Disconnect mode is disabled.\n"
#define BP_DIS_PWOFF_MSG "The interface is in the non-Bypass mode at power off state.\n"
#define BP_EN_PWOFF_MSG "The interface is in the Bypass mode at power off state.\n"
#define BP_DIS_PWUP_MSG "The interface is in the non-Bypass mode at power up state.\n"
#define BP_EN_PWUP_MSG "The interface is in the Bypass mode at power up state.\n"
#define TAP_EN_PWUP_MSG "The interface is in the TAP mode at power up state.\n"
#define TAP_DIS_PWUP_MSG "The interface is in the non-TAP mode at power up state.\n"
#define DISC_EN_PWUP_MSG "The interface is in the Disconnnect mode at power up state.\n"
#define DISC_DIS_PWUP_MSG "The interface is in the non-Disconnect mode at power up state.\n"
#define WDT_STATE_MSG "WDT is enabled with %d msec timeout value.\n"
#define WD_DIS_MSG "WDT is disabled.\n"
#define NOT_WD_DIS_MSG "WDT is disabled or WDT state is unknown.\n"
#define WD_STATE_EXT_MSG "WDT is enabled with %d msec timeout value.\n"
#define WD_TIME_LEFT_MSG "WDT is enabled; %d msec time left till WDT expired.\n"
#define WD_STATE_UNKNOWN_MSG "WDT state is unknown.\n"
#define NOT_NET_DEV_MSG "%s does not appear to be a Silicom Bypass device. Must be "IF_NAME"<if_num>.\n"
#define NOT_WDT_SLAVE_MSG "The interface is a slave interface or WDT state is unknown.\n"
#define NOT_WDT_DIS_SLAVE_MSG "The interface is a slave interface or WDT is disabled.\n"
#define WDT_EXP_MSG "WDT has expired.\n"
#define WDT_NOT_EXP_MSG "WDT not expired.\n"
#define STD_NIC_MODE_MSG "The interface is in Standard NIC mode.\n"
#define NON_STD_NIC_MODE_MSG "The interface is not in Standard NIC mode.\n"
#define TX_EN_MSG "Transmit is enabled.\n"
#define TX_DIS_MSG "Transmit is disabled.\n"
#define TAP_WD_EXP_MODE_MSG "When WDT timeout occurs, the interface will be in the TAP mode.\n"
#define BYPASS_WD_EXP_MODE_MSG "When WDT timeout occurs, the interface will be in the Bypass mode.\n"
#define NORMAL_WD_EXP_MODE_MSG "When WDT timeout occurs, the interface will be in the Normal NIC mode.\n"
#define DISC_WD_EXP_MODE_MSG "When WDT timeout occurs, the interface will be in the Disconnect mode.\n"
#define NOT_DEV_MSG "No such device.\n"
#define WD_AUTORESET_DIS_MSG "WDT autoreset is disabled.\n"
#define WD_AUTORESET_STATE_MSG "WDT autoreset is enabled with %d msec period.\n"
#define BP_HW_RESET_EN_MSG "hw_reset is enable.\n"
#define BP_HW_RESET_DIS_MSG "hw_reset is disable.\n"
#define BP_WAIT_AT_PWUP_EN_MSG "wait_at_pwup is enable.\n"
#define BP_WAIT_AT_PWUP_DIS_MSG "wait_at_pwup is disable.\n"
#define BP_CAP_MSG "\nBP_CAP The interface is Bypass/TAP capable in general.\n"
#define BP_STATUS_CAP_MSG "\nBP_STATUS_CAP The interface can report of the current Bypass mode.\n"
#define BP_STATUS_CHANGE_CAP_MSG "\nBP_STATUS_CHANGE_CAP The interface can report on a change to bypass mode\n" \
" from the last time the mode was defined\n"
#define SW_CTL_CAP_MSG "\nSW_CTL_CAP The interface is Software controlled capable for\n" \
" bypass/non bypass/TAP/non TAP modes.\n"
#define BP_DIS_CAP_MSG "\nBP_DIS_CAP The interface is capable of disabling the Bypass mode\n" \
" at all times. This mode will retain its mode even\n" \
" during power loss and also after power recovery. This\n" \
" will overcome on any bypass operation due to watchdog\n" \
" timeout or set bypass command.\n"
#define BP_DIS_STATUS_CAP_MSG "\nBP_DIS_STATUS_CAP The interface can report of the current DIS_BP_CAP.\n"
#define STD_NIC_CAP_MSG "\nSTD_NIC_CAP The interface is capable to be configured to operate\n" \
" as standard, non Bypass, NIC interface (have direct\n" \
" connection to interfaces at all power modes).\n"
#define BP_PWOFF_ON_CAP_MSG "\nBP_PWOFF_ON_CAP The interface can be in Bypass mode at power off state.\n"
#define BP_PWOFF_OFF_CAP_MSG "\nBP_PWOFF_OFF_CAP The interface can disconnect the Bypass mode at\n" \
" power off state without effecting all the other\n" \
" states of operation.\n"
#define BP_PWOFF_CTL_CAP_MSG "\nBP_PWOFF_CTL_CAP The behavior of the Bypass mode at Power-off state\n" \
" can be controlled by software without effecting any\n" \
" other state.\n"
#define BP_PWUP_ON_CAP_MSG "\nBP_PWUP_ON_CAP The interface can be in Bypass mode when power is\n" \
" turned on (until the system take control of the\n" \
" bypass functionality).\n"
#define BP_PWUP_OFF_CAP_MSG "\nBP_PWUP_OFF_CAP The interface can disconnect from Bypass mode when\n" \
" power is turned on (until the system take control\n" \
" of the bypass functionality).\n"
#define BP_PWUP_CTL_CAP_MSG "\nBP_PWUP_CTL_CAP The behavior of the Bypass mode at Power-up can be\n" \
" controlled by software\n"
#define WD_CTL_CAP_MSG "\nWD_CTL_CAP The interface has watchdog capabilities to turn to\n" \
" Bypass mode when not reset for defined period of time.\n"
#define WD_STATUS_CAP_MSG "\nWD_STATUS_CAP The interface can report on the watchdog status\n" \
" (active/inactive)\n"
#define WD_TIMEOUT_CAP_MSG "\nWD_TIMEOUT_CAP The interface can report the time left till watchdog\n" \
" triggers to Bypass mode.\n"
#define WD_MIN_TIME_MSG "\nWD_MIN_TIME = %d The interface WD minimal time period (ms).\n\n"
#define WD_STEP_TIME_MSG "\nWD_STEP_TIME = %d The steps of the WD timer in\n" \
" 0 - for linear steps (WD_MIN_TIME * X)\n" \
" 1 - for multiply by 2 from previous step (WD_MIN_TIME * 2^X).\n"
#define WD_STEP_COUNT_MSG "\nWD_STEP_COUNT_MSG = %d Number of bits available for defining the number of WDT steps.\n" \
" From that the number of steps the WDT will have is 2^Y\n" \
" (Y number of bits available for defining the value).\n\n"
#define TX_CTL_CAP_MSG "\nTX_CTL_CAP The interface is capable to control PHY transmitter on and off.\n"
#define TX_STATUS_CAP_MSG "\nTX_STATUS_CAP The interface can report the status of the PHY transmitter.\n"
#define TAP_CAP_MSG "\nTAP_CAP The interface is TAP capable in general.\n"
#define TAP_STATUS_CAP_MSG "\nTAP_STATUS_CAP The interface can report of the current TAP mode.\n"
#define TAP_STATUS_CHANGE_CAP_MSG "\nTAP_STATUS_CHANGE_CAP The interface can report on a change to TAP mode\n" \
" from the last time the mode was defined\n"
#define TAP_DIS_CAP_MSG "\nTAP_DIS_CAP The interface is capable of disabling the TAP mode\n" \
" at all times. This mode will retain its mode even\n" \
" during power loss and also after power recovery. This\n" \
" will overcome on any TAP operation due to watchdog\n" \
" timeout or set TAP command.\n"
#define TAP_DIS_STATUS_CAP_MSG "\nTAP_DIS_STATUS_CAP The interface can report of the current DIS_TAP_CAP.\n"
#define TAP_PWUP_ON_CAP_MSG "\nTAP_PWUP_ON_CAP The interface can be in TAP mode when power is\n" \
" turned on (until the system take control of the\n" \
" TAP functionality).\n"
#define TAP_PWUP_OFF_CAP_MSG "\nTAP_PWUP_OFF_CAP The interface can disconnect from TAP mode when\n" \
" power is turned on (until the system take control\n" \
" of the TAP functionality).\n"
#define TAP_PWUP_CTL_CAP_MSG "\nTAP_PWUP_CTL_CAP The behavior of the TAP mode at Power-up can be\n" \
" controlled by software\n"
#define NIC_CAP_NEG_MSG "\nNIC_CAP_NEG The interface is NIC capable in general - \n" \
" negative polarity (0 - NIC capable)\n"
#define TPL_CAP_MSG "\nTPL_CAP The interface is TPL capable in general.\n"
#define DISC_CAP_MSG "\nDISC_CAP The interface is Disconnect capable in general.\n"
#define DISC_STATUS_CAP_MSG "\nDISC_STATUS_CAP The interface can report of the current Disconnect mode.\n"
#if 0
#define DISC_STATUS_CHANGE_CAP_MSG "\nDISC_STATUS_CHANGE_CAP The interface can report on a change to Disconnect \n" \
" mode from the last time the mode was defined\n"
#endif
#define DISC_DIS_CAP_MSG "\nDISC_DIS_CAP The interface is capable of disabling the Disconnect mode\n" \
" at all times. This mode will retain its mode even\n" \
" during power loss and also after power recovery. This\n" \
" will overcome on any Disconnect operation due to watchdog\n" \
" timeout or set Disconnect command.\n"
#if 0
#define DISC_DIS_STATUS_CAP_MSG "\nDISC_DIS_STATUS_CAP The interface can report of the current DIS_DISC_CAP.\n"
#define DISC_PWUP_ON_CAP_MSG "\nDISC_PWUP_ON_CAP The interface can be in Disconnect mode when power is\n" \
" turned on (until the system take control of the\n" \
" Disconnect functionality).\n"
#define DISC_PWUP_OFF_CAP_MSG "\nDISC_PWUP_OFF_CAP The interface can disconnect from Disconnect mode when\n" \
" power is turned on (until the system take control\n" \
" of the Disconnect functionality).\n"
#endif
#define DISC_PWUP_CTL_CAP_MSG "\nDISC_PWUP_CTL_CAP The behavior of the Disconnect mode at Power-up can be\n" \
" controlled by software\n"
#endif