Signed-off-by: Anna Lukin <annal@silicom.co.il>
diff -uprN ethtool-3.14/bp.h ethtool-3.14__/bp.h
--- ethtool-3.14/bp.h	1970-01-01 02:00:00.000000000 +0200
+++ ethtool-3.14__/bp.h	2014-06-09 11:36:24.000000000 +0300
@@ -0,0 +1,8 @@
+#ifndef BPCTL_UTIL_H
+#define BPCTL_UTIL_H
+
+
+int parse_bypass(int argc, char **argp, int flag);
+
+#endif
+
diff -uprN ethtool-3.14/bp_ioctl.h ethtool-3.14__/bp_ioctl.h
--- ethtool-3.14/bp_ioctl.h	1970-01-01 02:00:00.000000000 +0200
+++ ethtool-3.14__/bp_ioctl.h	2014-06-09 11:36:24.000000000 +0300
@@ -0,0 +1,150 @@
+/******************************************************************************/
+/*                                                                            */
+/* Silicom Bypass Control Utility, Copyright (c) 2005-2007 Silicom            */
+/* All rights reserved.                                                       */
+/*                                                                            */
+/* This program is free software; you can redistribute it and/or modify       */
+/* it under the terms of the GNU General Public License as published by       */
+/* the Free Software Foundation, located in the file LICENSE.                 */
+/*                                                                            */
+/*                                                                            */
+/******************************************************************************/
+
+#ifndef BP_IOCTL_H
+#define BP_IOCTL_H
+
+#define BP_CAP                   0x01    /*BIT_0*/
+#define BP_STATUS_CAP            0x02    /*BIT_1*/
+#define BP_STATUS_CHANGE_CAP     0x04    /*BIT_2*/
+#define SW_CTL_CAP               0x08    /*BIT_3*/
+#define BP_DIS_CAP               0x10    /*BIT_4*/
+#define BP_DIS_STATUS_CAP        0x20    /*BIT_5*/
+#define STD_NIC_CAP              0x40    /*BIT_6*/
+#define BP_PWOFF_ON_CAP          0x80    /*BIT_7*/
+#define BP_PWOFF_OFF_CAP         0x0100  /*BIT_8*/
+#define BP_PWOFF_CTL_CAP         0x0200  /*BIT_9*/
+#define BP_PWUP_ON_CAP           0x0400  /*BIT_10*/
+#define BP_PWUP_OFF_CAP          0x0800  /*BIT_11*/
+#define BP_PWUP_CTL_CAP          0x1000  /*BIT_12*/
+#define WD_CTL_CAP               0x2000  /*BIT_13*/
+#define WD_STATUS_CAP            0x4000  /*BIT_14*/
+#define WD_TIMEOUT_CAP           0x8000  /*BIT_15*/
+#define TX_CTL_CAP               0x10000 /*BIT_16*/
+#define TX_STATUS_CAP            0x20000 /*BIT_17*/
+#define TAP_CAP                  0x40000   /*BIT_18*/
+#define TAP_STATUS_CAP           0x80000   /*BIT_19*/
+#define TAP_STATUS_CHANGE_CAP    0x100000  /*BIT_20*/
+#define TAP_DIS_CAP              0x200000 /*BIT_21*/
+#define TAP_DIS_STATUS_CAP       0x400000 /*BIT_22*/
+#define TAP_PWUP_ON_CAP          0x800000 /*BIT_23*/
+#define TAP_PWUP_OFF_CAP         0x1000000 /*BIT 24*/
+#define TAP_PWUP_CTL_CAP         0x2000000 /*BIT 25*/
+#define NIC_CAP_NEG              0x4000000 /*BIT 26*/
+#define TPL_CAP                  0x8000000 /*BIT 27*/
+#define DISC_CAP                 0x10000000 /*BIT 28*/
+#define DISC_DIS_CAP             0x20000000 /*BIT 29*/
+#define DISC_PWUP_CTL_CAP        0x40000000 /*BIT 30*/
+
+#define TPL2_CAP_EX              0x01
+#define DISC_PORT_CAP_EX         0x02
+
+
+
+
+#define WD_MIN_TIME_MASK(val)      (val & 0xf)
+#define WD_STEP_COUNT_MASK(val)    ((val & 0xf) << 5)
+#define WDT_STEP_TIME              0x10    /*BIT_4*/
+
+#define WD_MIN_TIME_GET(desc)   (desc & 0xf)
+#define WD_STEP_COUNT_GET(desc) ((desc>>5) & 0xf)
+
+
+enum {
+    IF_SCAN ,
+    GET_DEV_NUM ,
+    IS_BYPASS ,
+    GET_BYPASS_SLAVE ,
+    GET_BYPASS_CAPS ,
+    GET_WD_SET_CAPS ,
+    SET_BYPASS ,
+    GET_BYPASS ,
+    GET_BYPASS_CHANGE ,
+    SET_BYPASS_WD ,
+    GET_BYPASS_WD ,
+    GET_WD_EXPIRE_TIME ,
+    RESET_BYPASS_WD_TIMER,
+    SET_DIS_BYPASS ,
+    GET_DIS_BYPASS ,
+    SET_BYPASS_PWOFF ,
+    GET_BYPASS_PWOFF ,
+    SET_BYPASS_PWUP ,
+    GET_BYPASS_PWUP ,
+    SET_STD_NIC ,
+    GET_STD_NIC ,
+    SET_TX,
+    GET_TX,
+    SET_TAP ,
+    GET_TAP ,
+    GET_TAP_CHANGE ,
+    SET_DIS_TAP ,
+    GET_DIS_TAP ,
+    SET_TAP_PWUP ,
+    GET_TAP_PWUP ,
+    SET_WD_EXP_MODE,
+    GET_WD_EXP_MODE,
+    SET_WD_AUTORESET,
+    GET_WD_AUTORESET,
+    SET_TPL,
+    GET_TPL,
+    SET_DISC ,
+    GET_DISC ,
+    GET_DISC_CHANGE ,
+    SET_DIS_DISC ,
+    GET_DIS_DISC ,
+    SET_DISC_PWUP ,
+    GET_DISC_PWUP ,
+    GET_BYPASS_INFO = 100,
+    GET_BP_WAIT_AT_PWUP,
+    SET_BP_WAIT_AT_PWUP,
+    GET_BP_HW_RESET,
+    SET_BP_HW_RESET,
+    SET_DISC_PORT,
+    GET_DISC_PORT,
+    SET_DISC_PORT_PWUP,
+    GET_DISC_PORT_PWUP,
+    SET_BP_FORCE_LINK,
+    GET_BP_FORCE_LINK,
+#ifdef BP_SELF_TEST
+    SET_BP_SELF_TEST = 200,
+    GET_BP_SELF_TEST,
+#endif
+
+} CMND_TYPE_SD ;
+
+/*
+* The major device number. We can't rely on dynamic
+* registration any more, because ioctls need to know
+* it.
+*/
+
+
+#define MAGIC_NUM 'J'
+
+/* for passing single values */
+struct bpctl_cmd {
+    int status;
+    int data[8];
+    int in_param[8];
+    int out_param[8];
+};
+
+
+#define IOCTL_TX_MSG(cmd) _IOWR(MAGIC_NUM, cmd, struct bpctl_cmd)
+
+#define DEVICE_NODE "/dev/bpctl0"
+#define DEVICE_NAME "bpctl"
+
+
+#endif
+
+
diff -uprN ethtool-3.14/bp_msg.h ethtool-3.14__/bp_msg.h
--- ethtool-3.14/bp_msg.h	1970-01-01 02:00:00.000000000 +0200
+++ ethtool-3.14__/bp_msg.h	2014-06-09 11:28:28.000000000 +0300
@@ -0,0 +1,414 @@
+/******************************************************************************/
+/*                                                                            */
+/* Bypass Control utility, Copyright (c) 2005 Silicom, Ltd                    */
+/*                                                                            */
+/* This program is free software; you can redistribute it and/or modify       */
+/* it under the terms of the GNU General Public License as published by       */
+/* the Free Software Foundation, located in the file LICENSE.                 */
+/*                                                                            */
+/*                                                                            */
+/* bp_msg.h                                                                   */
+/*                                                                            */
+/******************************************************************************/
+
+#ifndef _BP_MSG_H
+#define _BP_MSG_H
+
+#define HELP_ENTRY                   "help"
+#define INFO_ENTRY                   "info"
+#define  SET_TPL_ENTRY               "set_tpl"
+#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  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  SET_TAP_ENTRY               "set_tap"
+#define  GET_TAP_ENTRY               "get_tap"
+#define  SET_FORCE_LINK_ENTRY        "set_force_link_on"
+#define  GET_FORCE_LINK_ENTRY        "get_force_link_on"
+
+
+#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  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  GET_BYPASS_INFO_ENTRY       "get_bypass_info"
+#define  SET_BP_WAIT_AT_PWUP_ENTRY   "set_wait_at_pwup"
+#define  SET_DISC_PORT_PWUP_ENTRY    "set_disc_port_pwup"
+#define  SET_BP_HW_RESET_ENTRY       "set_hw_reset"
+
+#ifdef BP_SELF_TEST
+    #define  SET_BP_SELF_TEST_ENTRY      "set_bst"
+    #define  GET_BP_SELF_TEST_ENTRY      "get_bst"
+#endif
+
+#define IF_NAME "eth"
+
+/********MESSAGES*************/
+#define NO_BPT_DEV_MSG          "No Bypass/TAP control devices " \
+"were found\n"
+#define NOT_SUPP_MSG            "The interface is not capable " \
+"of the operation.\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 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_SLAVE_MSG      "The interface is a slave interface or " \
+"doesn't support this feature.\n"
+#define BP_PAIR_MSG             "%s 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 DISC_PORT_MODE_MSG        "The interface is in the " \
+"Disconnect Port 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 NON_DISC_PORT_MODE_MSG    "The interface is in the non-Disconnect " \
+"Port mode.\n"
+#define NORMAL_MODE_MSG           "The interface is in the Normal mode.\n"
+#define TAP_BP_MODE_EN_MSG        "Bypass/TAP mode is enabled.\n"
+#define NORMAL_MODE_LAST_MSG      "There was no change to bypass/tap/disc " \
+"from last read of the status.\n"
+#define NON_BYPASS_MODE_LAST_MSG      "There was no change to bypass from " \
+"last read of the status.\n"
+#define NON_TAP_MODE_LAST_MSG         "There was no change to tap from " \
+"last read of the status.\n"
+#define NON_DISC_MODE_LAST_MSG        "There was no change to disconnect " \
+"from last read of the status.\n"
+#define TAP_MODE_LAST_MSG         "There was a change to TAP state " \
+"or it's now in TAP state.\n"
+#define DISC_MODE_LAST_MSG         "There was a change to Disconnect state " \
+"or it's now in Disconnect state.\n"
+#define BP_MODE_LAST_MSG          "There was a change to Bypass state " \
+"or it's now in Bypass 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 Disconnect 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 DISC_PORT_EN_PWUP_MSG      "The interface is in the Disconnect Port" \
+" mode at power up state.\n"
+#define DISC_PORT_DIS_PWUP_MSG    "The interface is in the non-Disconnect" \
+" Port mode at power up state.\n"
+#define WDT_STATE_MSG             "WDT is enabled with %d ms 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 ms timeout value.\n"
+#define WD_TIME_LEFT_MSG          "WDT is enabled; %d ms 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 WDT_EXP_MSG               "WDT has 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 enable.\n"
+#define TX_DIS_MSG                "Transmit is disable.\n"
+#define TPL_EN_MSG                 "TPL is enable.\n"
+#define TPL_DIS_MSG                "TPL is disable.\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 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_HW_RESET_EN_MSG         "hw_reset is enable.\n"
+#define BP_HW_RESET_DIS_MSG        "hw_reset is disable.\n"
+#define FORCE_LINK_EN_MSG         "Force link is enable.\n"
+#define FORCE_LINK_DIS_MSG        "Force link is disable.\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 GET_BPSLAVE_FAIL_MSG      "Get Bypass slave failed.\n"
+#define SET_BP_FAIL_MSG           "Set Bypass failed.\n"
+#define GET_BP_FAIL_MSG           "Get Bypass failed.\n"
+#define GET_BP_CHANGE_FAIL_MSG    "Get Bypass change failed.\n"
+#define SET_DIS_BP_FAIL_MSG       "Set disable Bypass failed.\n"
+#define GET_DIS_BP_FAIL_MSG       "Get disable Bypass failed.\n"
+#define SET_BP_PWOFF_FAIL_MSG     "Set Bypass/Normal mode on " \
+"Power Off failed.\n"
+#define GET_BP_PWOFF_FAIL_MSG     "Get Bypass/Normal mode on " \
+"Power Off failed.\n"
+#define SET_BP_PWUP_FAIL_MSG      "Set Bypass/Normal mode on " \
+"Power Up failed.\n"
+#define GET_BP_PWUP_FAIL_MSG      "Get Bypass/Normal mode on " \
+"Power Up failed.\n"
+#define SET_BP_WD_FAIL_MSG        "Set Bypass WD failed.\n"
+#define GET_BP_WD_FAIL_MSG        "Get Bypass WD failed.\n"
+#define RESET_BP_WD_FAIL_MSG      "Reset Bypass WD failed\n"
+#define SET_STD_NIC_FAIL_MSG      "Set Standard NIC mode failed\n"
+#define GET_TAP_PWUP_FAIL_MSG     "Get TAP mode on power up failed\n"
+#define GET_TAP_FAIL_MSG          "Get TAP mode failed\n"
+#define GET_TAP_CHANGE_FAIL_MSG   "Get TAP change failed.\n"
+#define GET_DIS_TAP_FAIL_MSG      "Get disable TAP failed.\n"
+
+#define GET_DISC_PWUP_FAIL_MSG     "Get Disconnect mode on power up failed\n"
+#define GET_DISC_FAIL_MSG          "Get Disconnect mode failed\n"
+
+#define GET_DISC_PORT_PWUP_FAIL_MSG     "Get Disconnect Port mode " \
+"on power up failed\n"
+#define GET_DISC_PORT_FAIL_MSG          "Get Disconnect Port mode failed\n"
+
+#define GET_DISC_CHANGE_FAIL_MSG   "Get Disconnect change failed.\n"
+#define GET_DIS_DISC_FAIL_MSG      "Get disable Disconnect failed.\n"
+
+#define WD_AUTORESET_STATE_MSG    "WDT autoreset is enabled with %d ms" \
+" period.\n"
+#define WD_AUTORESET_DIS_MSG      "WDT autoreset is disabled.\n"
+
+#ifdef BP_SELF_TEST
+    #define BP_SELF_TEST_MSG          "Bypass Self Test is enabled " \
+    "with %d ms period.\n"
+    #define BP_SELF_TEST_DIS_MSG      "Bypass Self Test is disabled.\n"
+#endif
+
+
+#define NOT_SUPP_TXCTL_MSG       "The interface doesn't support " \
+"TX Control feature.\n"
+#define NOT_SUPP_TXCTL_SLAVE_MSG "The interface is a slave interface.\n"
+#define NO_TXCTL_DEV_MSG         "No TX control devices were found\n"
+#define TXCTL_FAIL_MSG           "Set Transmit mode failed.\n"
+#define TXCTL_OK_MSG             "Set Transmit mode completed successfully.\n"
+#define GET_DEV_NUM_FAIL_MSG     "Get TX Control devices number failed\n"
+#define GET_TXCTL_FAIL_MSG       "Get Transmit mode failed.\n"
+
+#define NO_BPCTL_DEV_MSG         "No Bypass-SD/TAP-SD control devices" \
+" were found\n"
+#define NOT_SUPP_BPCTL_MSG       "The interface is not Bypass-SD/TAP-SD" \
+" device.\n"
+#define NO_BP_DEV_MSG            "No Bypass-SD control devices were found\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"
+#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"
+#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
diff -uprN ethtool-3.14/bp_util.c ethtool-3.14__/bp_util.c
--- ethtool-3.14/bp_util.c	1970-01-01 02:00:00.000000000 +0200
+++ ethtool-3.14__/bp_util.c	2014-06-09 11:45:37.000000000 +0300
@@ -0,0 +1,4101 @@
+/******************************************************************************/
+/*                                                                            */
+/* Bypass Control utility, Copyright (c) 2005-2007 Silicom, Ltd               */
+/*                                                                            */
+/* This program is free software; you can redistribute it and/or modify       */
+/* it under the terms of the GNU General Public License as published by       */
+/* the Free Software Foundation, located in the file LICENSE.                 */
+/*                                                                            */
+/*                                                                            */
+/* bp_util.c                                                                  */
+/*                                                                            */
+/******************************************************************************/
+
+#include <fcntl.h> /* open */
+#include <unistd.h> /* exit */
+#include <sys/ioctl.h> /* ioctl */
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <net/if.h>
+#include "bp_ioctl.h"
+#include "bp_util.h"
+
+
+
+#define BPCTL_GET_CMD(fn, file_desc, if_index, dev_num, bus, slot, func) \
+   ({if ((bus) || (slot) || (func) || (if_index)) \
+   get_##fn##_cmd(file_desc, if_index, bus, slot, func); \
+   else \
+   get_##fn##_all_cmd(file_desc, dev_num); })
+
+#define BPCTL_SET_CMD(fn, file_desc, \
+if_index, dev_num, param, bus, slot, func) \
+   ({if ((bus) || (slot) || (func) || (if_index)) \
+   set_##fn##_cmd(file_desc, if_index, param, bus, slot, func); \
+	else \
+	set_##fn##_all_cmd(file_desc, dev_num, param); })
+
+#define IS_BYPASS_CMD(file_desc, if_index, dev_num, bus, slot, func) \
+   ({if ((bus) || (slot) || (func) || (if_index)) \
+   is_bypass_cmd(file_desc, if_index, bus, slot, func); \
+	else \
+	is_bypass_all_cmd(file_desc, dev_num); })
+
+#define RESET_WD_CMD(file_desc, if_index, dev_num, bus, slot, func) \
+   ({if ((bus) || (slot) || (func) || (if_index)) \
+   reset_bypass_wd_cmd(file_desc, if_index, bus, slot, func); \
+	else \
+	reset_bypass_wd_all_cmd(file_desc, dev_num); })
+
+
+
+
+int if_info_msg(struct bpctl_cmd *bpctl_cmd)
+{
+	char if_name[IFNAMSIZ];
+
+	printf("%02x:%02x.%x ", bpctl_cmd->out_param[0],
+	bpctl_cmd->out_param[1], bpctl_cmd->out_param[2]);
+	if ((bpctl_cmd->out_param[3] > 0) &&
+		(if_indextoname(bpctl_cmd->out_param[3],
+		(char *)&if_name) != NULL))
+		printf("%s ", if_name);
+	else
+	printf("     ");
+	if ((bpctl_cmd->out_param[2] == 1) ||
+		(bpctl_cmd->out_param[2] == 3)) {
+			printf("slave\n");
+	return 0;
+	} else
+	return 1;
+}
+
+int if_infox_msg(struct bpctl_cmd *bpctl_cmd)
+{
+	char if_name[IFNAMSIZ];
+
+	printf("%02x:%02x.%x ", bpctl_cmd->out_param[0],
+	bpctl_cmd->out_param[1], bpctl_cmd->out_param[2]);
+	if ((bpctl_cmd->out_param[3] > 0) &&
+		(if_indextoname(bpctl_cmd->out_param[3],
+						(char *)&if_name) != NULL))
+			printf("%s ", if_name);
+	else
+		printf("     ");
+	if ((bpctl_cmd->out_param[2] == 1) ||
+		(bpctl_cmd->out_param[2] == 3)) {
+		return 0;
+	} else
+		return 1;
+}
+
+int if_infoxx_msg(struct bpctl_cmd *bpctl_cmd)
+{
+
+	if ((bpctl_cmd->out_param[2] == 1) ||
+		(bpctl_cmd->out_param[2] == 3)) {
+		return 0;
+	} else
+		return 1;
+}
+
+
+
+void set_dis_bypass_cmd(int file_desc,
+						int if_index, int bp_mode,
+						int bus, int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = bp_mode;
+
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+	ret_val = ioctl(file_desc,
+						 IOCTL_TX_MSG(SET_DIS_BYPASS),
+						&bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val == 0) && (bpctl_cmd.status == 0))
+		printf(SET_DIS_BYPASS_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_SLAVE_MSG);
+}
+
+void set_dis_bypass_all_cmd(int file_desc,
+							int dev_num,
+							int bp_mode)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = bp_mode;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(SET_DIS_BYPASS), &bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+		else
+			printf("fail\n");
+
+		}
+	}
+}
+
+
+
+
+
+void set_bypass_cmd(int file_desc, int if_index,
+int tx_state, int bus, int slot, int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = tx_state;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+					IOCTL_TX_MSG(SET_BYPASS), &bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val == 0) && (bpctl_cmd.status == 0))
+		printf(SET_BYPASS_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_BP_SLAVE_MSG);
+}
+
+void set_bypass_all_cmd(int file_desc,
+						int dev_num, int tx_state)
+{
+
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = tx_state;
+
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+						IOCTL_TX_MSG(SET_BYPASS),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+void set_tx_cmd(int file_desc,
+				int if_index, int tx_state,
+				int bus, int slot, int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = tx_state;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_TX), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(SET_TX_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_MSG);
+}
+
+void set_tx_all_cmd(int file_desc,
+					int dev_num, int tx_state)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = tx_state;
+
+	for (i = 0; i < dev_num; i++) {
+		int ret_info = 0;
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+IOCTL_TX_MSG(SET_TX), &bpctl_cmd);
+		if (ret_val == 0) {
+			ret_info = if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else {
+				if (ret_info == 0)
+					printf("slave\n");
+				else
+					printf("fail\n");
+			}
+		}
+	}
+}
+
+void get_tx_cmd(int file_desc,
+				int if_index, int bus,
+				int slot, int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(GET_TX),
+	&bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+
+	if ((ret_val != 0) || (bpctl_cmd.status < 0)) {
+		printf(NOT_SUPP_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(TX_DIS_MSG);
+	else
+		printf(TX_EN_MSG);
+}
+
+void get_tx_all_cmd(int file_desc,
+					int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(GET_TX),
+		&bpctl_cmd);
+		if (ret_val == 0) {
+			int ret_info = if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status < 0) {
+				if (ret_info == 0)
+					printf("slave\n");
+				else
+					printf("fail\n");
+			} else {
+				if (bpctl_cmd.status == 0)
+					printf("off\n");
+				else if (bpctl_cmd.status == 1)
+					printf("on\n");
+			}
+		}
+	}
+
+}
+#ifdef BP_DBI_FLAG
+
+void set_bp_force_link_cmd(int file_desc,
+						int if_index,
+						int tx_state,
+						int bus,
+						int slot, int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = tx_state;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(SET_BP_FORCE_LINK),
+	&bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(SET_FORCE_LINK_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_MSG);
+}
+
+void set_bp_force_link_all_cmd(int file_desc,
+							int dev_num,
+							int tx_state)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = tx_state;
+
+	for (i = 0; i < dev_num; i++) {
+		int ret_info = 0;
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(SET_BP_FORCE_LINK),
+		&bpctl_cmd);
+		if (ret_val == 0) {
+			ret_info = if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else {
+				if (ret_info == 0)
+					printf("slave\n");
+				else
+					printf("fail\n");
+			}
+		}
+	}
+}
+
+void get_bp_force_link_cmd(int file_desc,
+						int if_index,
+						int bus,
+						int slot,
+						int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(GET_BP_FORCE_LINK),
+	&bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+
+	if ((ret_val != 0) || (bpctl_cmd.status < 0)) {
+		printf(NOT_SUPP_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(FORCE_LINK_DIS_MSG);
+	else
+		printf(FORCE_LINK_EN_MSG);
+}
+
+void get_bp_force_link_all_cmd(int file_desc,
+							   int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(GET_BP_FORCE_LINK),
+		&bpctl_cmd);
+		if (ret_val == 0) {
+			int ret_info = if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status < 0) {
+				if (ret_info == 0)
+					printf("slave\n");
+				else
+					printf("fail\n");
+			} else {
+				if (bpctl_cmd.status == 0)
+					printf("off\n");
+				else if (bpctl_cmd.status == 1)
+					printf("on\n");
+			}
+		}
+	}
+
+}
+#endif /*BP_DBI_FLAG*/
+void set_tpl_cmd(int file_desc,
+				int if_index,
+				int tpl_state,
+				int bus,
+				int slot,
+				int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = tpl_state;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(SET_TPL),
+	&bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(SET_TPL_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_SLAVE_MSG);
+}
+
+void set_tpl_all_cmd(int file_desc,
+					int dev_num,
+					int tpl_state)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = tpl_state;
+
+	for (i = 0; i < dev_num; i++) {
+		int ret_info = 0;
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(SET_TPL),
+		&bpctl_cmd);
+		if (ret_val == 0) {
+			ret_info = if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else {
+				if (ret_info == 0)
+					printf("slave\n");
+				else
+					printf("fail\n");
+			}
+		}
+	}
+}
+
+void get_tpl_cmd(int file_desc,
+				int if_index,
+				int bus,
+				int slot,
+				int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(GET_TPL),
+	&bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+
+	if ((ret_val != 0) || (bpctl_cmd.status < 0)) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(TPL_DIS_MSG);
+	else
+		printf(TPL_EN_MSG);
+}
+
+void get_tpl_all_cmd(int file_desc,
+					int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(GET_TPL),
+		&bpctl_cmd);
+		if (ret_val == 0) {
+			int ret_info = if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status < 0) {
+				if (ret_info == 0)
+					printf("slave\n");
+				else
+					printf("fail\n") ;
+			} else {
+				if (bpctl_cmd.status == 0)
+					printf("off\n");
+				else if (bpctl_cmd.status == 1)
+					printf("on\n");
+			}
+		}
+	}
+
+}
+void set_bp_wait_at_pwup_cmd(int file_desc,
+							int if_index,
+							int state,
+							int bus,
+							int slot,
+							int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = state;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(SET_BP_WAIT_AT_PWUP),
+	&bpctl_cmd);
+
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(SET_BP_WAIT_AT_PWUP_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_MSG);
+}
+
+void set_bp_wait_at_pwup_all_cmd(int file_desc,
+								int dev_num,
+								int state)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = state;
+
+	for (i = 0; i < dev_num; i++) {
+		int ret_info = 0;
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(SET_BP_WAIT_AT_PWUP),
+		&bpctl_cmd);
+		if (ret_val == 0) {
+			ret_info = if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else {
+				if (ret_info == 0)
+					printf("slave\n");
+				else
+					printf("fail\n");
+			}
+		}
+	}
+}
+
+void get_bp_wait_at_pwup_cmd(int file_desc,
+							int if_index,
+							int bus,
+							int slot,
+							int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(GET_BP_WAIT_AT_PWUP),
+	&bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+
+	if ((ret_val != 0) || (bpctl_cmd.status < 0)) {
+		printf(NOT_SUPP_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(BP_WAIT_AT_PWUP_DIS_MSG);
+	else
+		printf(BP_WAIT_AT_PWUP_EN_MSG);
+}
+
+void get_bp_wait_at_pwup_all_cmd(int file_desc,
+								 int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(GET_BP_WAIT_AT_PWUP),
+		&bpctl_cmd);
+		if (ret_val == 0) {
+			int ret_info = if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status < 0) {
+				if (ret_info == 0)
+					printf("slave\n");
+				else
+					printf("fail\n") ;
+			} else {
+				if (bpctl_cmd.status == 0)
+					printf("off\n");
+				else if (bpctl_cmd.status == 1)
+					printf("on\n");
+			}
+		}
+	}
+
+}
+
+void set_bp_hw_reset_cmd(int file_desc,
+						int if_index,
+						int state,
+						int bus,
+						int slot,
+						int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = state;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(SET_BP_HW_RESET),
+	&bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(SET_BP_HW_RESET_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_MSG);
+}
+
+void set_bp_hw_reset_all_cmd(int file_desc,
+							int dev_num,
+							int state)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = state;
+
+	for (i = 0; i < dev_num; i++) {
+		int ret_info = 0;
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(SET_BP_HW_RESET),
+		&bpctl_cmd);
+		if (ret_val == 0) {
+			ret_info = if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else {
+				if (ret_info == 0)
+					printf("slave\n");
+				else
+					printf("fail\n");
+			}
+		}
+	}
+}
+
+void get_bp_hw_reset_cmd(int file_desc,
+						int if_index,
+						int bus,
+						int slot,
+						int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(GET_BP_HW_RESET),
+	&bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+
+	if ((ret_val != 0) || (bpctl_cmd.status < 0)) {
+		printf(NOT_SUPP_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(BP_HW_RESET_DIS_MSG);
+	else
+		printf(BP_HW_RESET_EN_MSG);
+}
+
+void get_bp_hw_reset_all_cmd(int file_desc,
+							 int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(GET_BP_HW_RESET),
+		&bpctl_cmd);
+		if (ret_val == 0) {
+			int ret_info = if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status < 0) {
+				if (ret_info == 0)
+					printf("slave\n");
+				else
+					printf("fail\n");
+			} else {
+				if (bpctl_cmd.status == 0)
+					printf("off\n");
+				else if (bpctl_cmd.status == 1)
+					printf("on\n");
+			}
+		}
+	}
+
+}
+
+void set_wd_autoreset_cmd(int file_desc,
+						int if_index,
+						int param,
+						int bus,
+						int slot,
+						int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = param;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(SET_WD_AUTORESET),
+	&bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(SET_WD_AUTORESET_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_BPT_SLAVE_MSG);
+}
+
+void set_wd_autoreset_all_cmd(int file_desc,
+							int dev_num, int param)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = param;
+
+	for (i = 0; i < dev_num; i++) {
+		int ret_info = 0;
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+						IOCTL_TX_MSG(SET_WD_AUTORESET),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			ret_info = if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else {
+				if (ret_info == 0)
+					printf("slave\n");
+				else
+					printf("fail\n");
+			}
+		}
+	}
+}
+
+void get_wd_autoreset_cmd(int file_desc,
+						int if_index, int bus,
+						int slot, int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_WD_AUTORESET), &bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val != 0) || (bpctl_cmd.status < 0)) {
+		printf(NOT_SUPP_BPT_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(WD_AUTORESET_DIS_MSG);
+	else
+		printf(WD_AUTORESET_STATE_MSG, bpctl_cmd.status);
+}
+
+void get_wd_autoreset_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(GET_WD_AUTORESET), &bpctl_cmd);
+		if (ret_val == 0) {
+			int ret_info = 0;
+
+			if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status < 0) {
+				if (ret_info == 0)
+					printf("slave\n");
+				else
+					printf("fail\n");
+			} else {
+				if (bpctl_cmd.status == 0)
+					printf("disable\n");
+				else
+					printf("%d ms\n", bpctl_cmd.status);
+			}
+		}
+	}
+}
+
+#ifdef BP_SELF_TEST
+void set_bp_self_test_cmd(int file_desc, int if_index,
+						int param, int bus, int slot,
+						int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = param;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_BP_SELF_TEST), &bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(SET_BP_SELF_TEST_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_BPT_SLAVE_MSG);
+}
+
+void set_bp_self_test_all_cmd(int file_desc,
+							int dev_num, int param)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = param;
+
+	for (i = 0; i < dev_num; i++) {
+		int ret_info = 0;
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(SET_BP_SELF_TEST), &bpctl_cmd);
+		if (ret_val == 0) {
+			ret_info = if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else {
+				if (ret_info == 0)
+					printf("slave\n");
+				else
+					printf("fail\n");
+			}
+		}
+	}
+}
+
+void get_bp_self_test_cmd(int file_desc, int if_index,
+						 int bus, int slot, int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(GET_BP_SELF_TEST), &bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val != 0) || (bpctl_cmd.status < 0)) {
+		printf(NOT_SUPP_BPT_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(BP_SELF_TEST_DIS_MSG);
+	else
+		printf(BP_SELF_TEST_MSG, bpctl_cmd.status);
+}
+
+void get_bp_self_test_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(GET_BP_SELF_TEST), &bpctl_cmd);
+		if (ret_val == 0) {
+			int ret_info = 0;
+
+			if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status < 0) {
+				if (ret_info == 0)
+					printf("slave\n");
+				else
+					printf("fail\n");
+			} else {
+				if (bpctl_cmd.status == 0)
+					printf("disable\n");
+				else
+					printf("%d ms\n", bpctl_cmd.status);
+			}
+		}
+	}
+}
+
+#endif
+
+void get_dis_bypass_cmd(int file_desc, int if_index,
+						int bus, int slot, int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_DIS_BYPASS), &bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(BP_MODE_EN_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(BP_MODE_DIS_MSG);
+	else
+		printf(GET_DIS_BP_FAIL_MSG);
+}
+
+void get_dis_bypass_all_cmd(int file_desc, int dev_num)
+{
+	struct bpctl_cmd bpctl_cmd;
+	int ret_val, i;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(GET_DIS_BYPASS), &bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+
+	}
+}
+
+
+void get_bypass_change_cmd(int file_desc,
+						   int if_index, int bus,
+						   int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_BYPASS_CHANGE), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(NON_BYPASS_MODE_LAST_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(BP_MODE_LAST_MSG);
+	else
+		printf(GET_BP_CHANGE_FAIL_MSG);
+}
+
+void get_bypass_change_all_cmd(int file_desc,
+							   int dev_num) {
+	int ret_val = 0, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(GET_BYPASS_CHANGE), &bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+
+void get_bypass_cmd(int file_desc, int if_index,
+					int bus, int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_BYPASS), &bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_BP_SLAVE_UN_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(NON_BP_MODE_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(BP_MODE_MSG);
+	else
+		printf(GET_BP_FAIL_MSG);
+}
+
+void get_bypass_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(GET_BYPASS), &bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+void get_bypass_caps_cmd(int file_desc, int if_index,
+						int bus, int slot, int func){
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_BYPASS_CAPS),
+					&bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_BPT_MSG);
+		return;
+	}
+	printf("bypass_caps: 0x%x\n", bpctl_cmd.status);
+
+	for (i = 0; bp_cap_array[i].flag; i++) {
+		if (bpctl_cmd.status & bp_cap_array[i].flag)
+			printf(bp_cap_array[i].desc);
+	}
+}
+
+void get_bypass_caps_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_BYPASS_CAPS),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if_infox_msg(&bpctl_cmd);
+			printf("0x%x\n", bpctl_cmd.status);
+		}
+	}
+}
+
+void get_bypass_slave_cmd(int file_desc, int if_index,
+						int bus, int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	char if_name[IFNAMSIZ];
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_BYPASS_SLAVE), &bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_BPT_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0) {
+		printf(SLAVE_IF_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 1) {
+
+		printf("slave: %02x:%02x.%x ", bpctl_cmd.out_param[4],
+			bpctl_cmd.out_param[5], bpctl_cmd.out_param[6]);
+		if ((bpctl_cmd.out_param[7] > 0) &&
+			(if_indextoname(bpctl_cmd.out_param[7],
+			(char *)&if_name) != NULL))
+			printf("%s", if_name);
+		printf("\n");
+	}
+
+	else {
+		printf(GET_BPSLAVE_FAIL_MSG);
+		return;
+	}
+}
+
+void get_bypass_slave_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	char if_name[IFNAMSIZ];
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_BYPASS_SLAVE),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status != 1)
+				printf("fail\n");
+			else {
+				printf("slave: %02x:%02x.%x ",
+				bpctl_cmd.out_param[4],
+					bpctl_cmd.out_param[5],
+					bpctl_cmd.out_param[6]);
+				if ((bpctl_cmd.out_param[7] > 0) &&
+					(if_indextoname(bpctl_cmd.out_param[7],
+					(char *)&if_name) != NULL))
+					printf("%s", if_name);
+				printf("\n");
+
+
+			}
+
+
+		}
+	}
+}
+
+
+void is_bypass_cmd(int file_desc, int if_index, int bus,
+				int slot, int func){
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(IS_BYPASS), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_BPT_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(SLAVE_IF_MSG);
+	else
+		printf(MASTER_IF_MSG);
+}
+
+void is_bypass_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(IS_BYPASS), &bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status < 0)
+				printf("fail\n");
+			else
+				printf("%s\n",
+				bpctl_cmd.status == 0 ? "slave" : "master");
+		}
+	}
+}
+
+int parse_bypass_mode(char *param)
+{
+	int bypass_mode = -1;
+
+	if (!strcmp(param, BYPASS_ENABLE))
+		bypass_mode = 1;
+	else if (!strcmp(param, BYPASS_DISABLE))
+		bypass_mode = 0;
+	return bypass_mode;
+}
+
+int parse_wd_exp_mode(char *param)
+{
+	int mode = -1;
+
+	if (!strcmp(param, TAP_MODE))
+		mode = 1;
+	else if (!strcmp(param, BYPASS_MODE))
+		mode = 0;
+	else if (!strcmp(param, DISC_MODE))
+		mode = 2;
+
+	return mode;
+}
+
+void get_wd_set_caps_cmd(int file_desc,
+						 int if_index, int bus,
+						int slot, int func){
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_WD_SET_CAPS), &bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0) {
+		printf(SLAVE_IF_MSG);
+		return;
+	}
+	printf(WD_MIN_TIME_MSG, WD_MIN_TIME_GET(bpctl_cmd.status)*100);
+	printf(WD_STEP_TIME_MSG, ((bpctl_cmd.status & WDT_STEP_TIME) ? 1 : 0));
+	printf(WD_STEP_COUNT_MSG, WD_STEP_COUNT_GET(bpctl_cmd.status));
+}
+
+void get_wd_set_caps_all_cmd(int file_desc,
+							 int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_WD_SET_CAPS),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+			if (bpctl_cmd.status < 0)
+				printf("fail\n");
+			else
+				printf("0x%x\n", bpctl_cmd.status);
+		}
+	}
+}
+
+void set_bypass_pwoff_cmd(int file_desc,
+						int if_index, int bypass_mode,
+						int bus, int slot, int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = bypass_mode;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_BYPASS_PWOFF), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+
+	if ((ret_val == 0) && (bpctl_cmd.status == 0))
+		printf(SET_BYPASS_PWOFF_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_SLAVE_MSG);
+}
+
+void set_bypass_pwoff_all_cmd(int file_desc,
+							int dev_num,
+							int bypass_mode)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = bypass_mode;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_BYPASS_PWOFF),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+
+void get_bypass_pwoff_cmd(int file_desc, int if_index,
+						int bus, int slot, int func){
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_BYPASS_PWOFF), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(BP_DIS_PWOFF_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(BP_EN_PWOFF_MSG);
+	else
+		printf(GET_BP_PWOFF_FAIL_MSG);
+}
+
+void get_bypass_pwoff_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_BYPASS_PWOFF),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+
+void set_bypass_pwup_cmd(int file_desc, int if_index,
+						int bypass_mode,
+						int bus, int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = bypass_mode;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_BYPASS_PWUP), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+
+	if ((ret_val == 0) && (bpctl_cmd.status == 0))
+		printf(SET_BYPASS_PWUP_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_SLAVE_MSG);
+}
+
+void set_bypass_pwup_all_cmd(int file_desc,
+							int dev_num,
+							int bypass_mode)
+{
+
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = bypass_mode;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_BYPASS_PWUP),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else
+				printf("fail\n");
+
+
+		}
+	}
+}
+
+
+void get_bypass_pwup_cmd(int file_desc,
+						int if_index, int bus,
+						int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_BYPASS_PWUP), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(BP_DIS_PWUP_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(BP_EN_PWUP_MSG);
+	else
+		printf(GET_BP_PWUP_FAIL_MSG);
+}
+
+void get_bypass_pwup_all_cmd(int file_desc, int dev_num)
+{
+
+
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_BYPASS_PWUP),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+
+void set_bypass_wd_cmd(int file_desc,
+					 int if_index, int timeout,
+					int bus, int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = timeout;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_BYPASS_WD), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val == 0) && (bpctl_cmd.status >= 0)) {
+		if (!bpctl_cmd.status)
+			printf(WD_DIS_MSG);
+		else if (bpctl_cmd.status > 0)
+			printf(WDT_STATE_MSG, bpctl_cmd.status);
+	} else {
+		printf(NOT_SUPP_SLAVE_MSG);
+	}
+}
+
+void set_bypass_wd_all_cmd(int file_desc,
+						int dev_num, int timeout)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = timeout;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(SET_BYPASS_WD), &bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status < 0)
+				printf("fail\n");
+			else if (bpctl_cmd.status == 0)
+				printf("disable\n");
+			else
+				printf("%d\n", bpctl_cmd.status);
+		}
+
+
+
+	}
+}
+
+
+void get_bypass_wd_cmd(int file_desc, int if_index, int bus,
+					int slot, int func) {
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_BYPASS_WD), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	if (!bpctl_cmd.data[0])
+		printf(WD_DIS_MSG);
+	else if (bpctl_cmd.data[0] > 0)
+		printf(WD_STATE_EXT_MSG, bpctl_cmd.data[0]);
+	else
+		printf(WD_STATE_UNKNOWN_MSG);
+}
+
+void get_bypass_wd_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_BYPASS_WD),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status < 0)
+				printf("fail\n");
+			else if (!bpctl_cmd.data[0])
+				printf("disable\n");
+			else if (bpctl_cmd.data[0] > 0)
+				printf("%d\n", bpctl_cmd.data[0]);
+			else
+				printf("unknown\n");
+		}
+
+
+
+	}
+}
+
+void get_wd_expire_time_cmd(int file_desc,
+							int if_index, int bus,
+							int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(GET_WD_EXPIRE_TIME), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0)
+		printf(NOT_WDT_SLAVE_MSG);
+	else if (!bpctl_cmd.data[0])
+		printf(WD_DIS_MSG);
+	else if (bpctl_cmd.data[0] > 0)
+		printf(WD_TIME_LEFT_MSG, bpctl_cmd.data[0]);
+	else
+		printf(WDT_EXP_MSG);
+}
+
+void get_wd_expire_time_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_WD_EXPIRE_TIME),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status < 0)
+				printf("fail\n");
+			else if (!bpctl_cmd.data[0])
+				printf("disable\n");
+			else if (bpctl_cmd.data[0] > 0)
+				printf("%d\n", bpctl_cmd.data[0]);
+			else
+				printf("expired\n");
+		}
+
+
+
+	}
+}
+
+void reset_bypass_wd_cmd(int file_desc,
+						int if_index, int bus,
+						int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(RESET_BYPASS_WD_TIMER),
+			&bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val == 0) && (bpctl_cmd.status >= 0)) {
+		if (bpctl_cmd.status < 0)
+			printf(NOT_WDT_SLAVE_MSG);
+		else if (!bpctl_cmd.status)
+			printf(WD_DIS_MSG);
+		else if (bpctl_cmd.status > 0)
+			printf(RESET_BYPASS_WD_TIMER_ENTRY" "SUCCESS_MSG);
+	} else {
+		printf(NOT_SUPP_SLAVE_MSG);
+	}
+}
+
+void reset_bypass_wd_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(RESET_BYPASS_WD_TIMER),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status < 0)
+				printf("fail\n");
+			else if (bpctl_cmd.status == 0)
+				printf("disable\n");
+			else
+				printf("ok\n");
+		}
+	}
+}
+
+void set_std_nic_cmd(int file_desc,
+					int if_index, int nic_mode, int bus,
+					int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = nic_mode;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_STD_NIC), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val == 0) && (bpctl_cmd.status >= 0))
+		printf(SET_STD_NIC_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_SLAVE_MSG);
+}
+
+void set_std_nic_all_cmd(int file_desc, int dev_num, int nic_mode)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = nic_mode;
+
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(SET_STD_NIC), &bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status < 0)
+				printf("fail\n");
+			else
+				printf("ok\n");
+
+
+
+		}
+	}
+}
+
+
+void get_std_nic_cmd(int file_desc, int if_index, int bus,
+					int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_STD_NIC), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0)
+		printf(NOT_SUPP_SLAVE_MSG);
+	else if (!bpctl_cmd.status)
+		printf(NON_STD_NIC_MODE_MSG);
+	else
+		printf(STD_NIC_MODE_MSG);
+}
+
+void get_std_nic_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(GET_STD_NIC), &bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status < 0)
+				printf("fail\n");
+			else if (bpctl_cmd.status == 0)
+				printf("non-standard\n");
+			else
+				printf("standard\n");
+		}
+	}
+}
+
+void set_dis_tap_cmd(int file_desc,
+					int if_index, int tap_mode,
+					int bus, int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = tap_mode;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_DIS_TAP), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val == 0) && (bpctl_cmd.status == 0))
+		printf(SET_DIS_TAP_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_SLAVE_MSG);
+}
+
+void set_dis_tap_all_cmd(int file_desc, int dev_num, int tap_mode)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = tap_mode;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_DIS_TAP),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+
+void set_tap_cmd(int file_desc,
+				int if_index, int tap_mode,
+				int bus, int slot, int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = tap_mode;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_TAP),
+					&bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val == 0) && (bpctl_cmd.status == 0))
+		printf(SET_TAP_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_BP_SLAVE_MSG);
+}
+
+void set_tap_all_cmd(int file_desc, int dev_num, int tap_mode)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = tap_mode;
+
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_TAP),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+void get_dis_tap_cmd(int file_desc, int if_index, int bus,
+					int slot, int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_DIS_TAP),
+					&bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(TAP_MODE_EN_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(TAP_MODE_DIS_MSG);
+	else
+		printf(GET_DIS_TAP_FAIL_MSG);
+}
+
+void get_dis_tap_all_cmd(int file_desc, int dev_num)
+{
+	struct bpctl_cmd bpctl_cmd;
+	int ret_val = 0, i;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_DIS_TAP),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+
+void get_tap_change_cmd(int file_desc,
+						int if_index, int bus,
+						int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_TAP_CHANGE),
+					&bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(NON_TAP_MODE_LAST_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(TAP_MODE_LAST_MSG);
+	else
+		printf(GET_TAP_CHANGE_FAIL_MSG);
+}
+
+void get_tap_change_all_cmd(int file_desc, int dev_num)
+{
+	struct bpctl_cmd bpctl_cmd;
+	int ret_val = 0, i;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_TAP_CHANGE),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+void get_tap_cmd(int file_desc, int if_index, int bus,
+				int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_TAP),
+					&bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_BPT_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(NON_TAP_MODE_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(TAP_MODE_MSG);
+	else
+		printf(GET_TAP_FAIL_MSG);
+}
+
+void get_tap_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_TAP),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+void set_tap_pwup_cmd(int file_desc,
+					int if_index, int tap_mode,
+					int bus, int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = tap_mode;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_TAP_PWUP),
+					&bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val == 0) && (bpctl_cmd.status == 0))
+		printf(SET_TAP_PWUP_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_SLAVE_MSG);
+}
+
+void set_tap_pwup_all_cmd(int file_desc, int dev_num,
+						int tap_mode) {
+
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = tap_mode;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_TAP_PWUP),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+
+void get_tap_pwup_cmd(int file_desc, int if_index,
+					int bus, int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_TAP_PWUP),
+					&bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(TAP_DIS_PWUP_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(TAP_EN_PWUP_MSG);
+	else
+		printf(GET_TAP_PWUP_FAIL_MSG);
+}
+
+void get_tap_pwup_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(GET_TAP_PWUP),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+void set_dis_disc_cmd(int file_desc,
+					int if_index, int disc_mode,
+					int bus, int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = disc_mode;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_DIS_DISC),
+					&bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val == 0) && (bpctl_cmd.status == 0))
+		printf(SET_DIS_DISC_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_SLAVE_MSG);
+}
+
+void set_dis_disc_all_cmd(int file_desc, int dev_num,
+						int disc_mode)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = disc_mode;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_DIS_DISC),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+
+void set_disc_cmd(int file_desc, int if_index, int disc_mode,
+				int bus, int slot, int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = disc_mode;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_DISC), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val == 0) && (bpctl_cmd.status == 0))
+		printf(SET_DISC_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_BP_SLAVE_MSG);
+}
+
+void set_disc_all_cmd(int file_desc, int dev_num, int disc_mode)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = disc_mode;
+
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_DISC),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+void get_dis_disc_cmd(int file_desc, int if_index, int bus,
+					int slot, int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_DIS_DISC), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(DISC_MODE_EN_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(DISC_MODE_DIS_MSG);
+	else
+		printf(GET_DIS_DISC_FAIL_MSG);
+}
+
+void get_dis_disc_all_cmd(int file_desc, int dev_num)
+{
+	struct bpctl_cmd bpctl_cmd;
+	int ret_val = 0, i;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_DIS_DISC),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+
+void get_disc_change_cmd(int file_desc, int if_index, int bus,
+						int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_DISC_CHANGE), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(NON_DISC_MODE_LAST_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(DISC_MODE_LAST_MSG);
+	else
+		printf(GET_DISC_CHANGE_FAIL_MSG);
+}
+
+void get_disc_change_all_cmd(int file_desc, int dev_num)
+{
+	struct bpctl_cmd bpctl_cmd;
+	int ret_val = 0, i;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_DISC_CHANGE),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+void get_disc_cmd(int file_desc, int if_index, int bus,
+					int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_DISC), &bpctl_cmd);
+
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_BPT_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(NON_DISC_MODE_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(DISC_MODE_MSG);
+	else
+		printf(GET_DISC_FAIL_MSG);
+}
+
+void get_disc_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_DISC),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+void set_disc_pwup_cmd(int file_desc,
+					int if_index, int disc_mode,
+					int bus, int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = disc_mode;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_DISC_PWUP), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val == 0) && (bpctl_cmd.status == 0))
+		printf(SET_DISC_PWUP_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_SLAVE_MSG);
+}
+
+void set_disc_pwup_all_cmd(int file_desc,
+						int dev_num, int disc_mode)
+{
+
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = disc_mode;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_DISC_PWUP),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+
+void get_disc_pwup_cmd(int file_desc, int if_index,
+						int bus, int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_DISC_PWUP), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(DISC_DIS_PWUP_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(DISC_EN_PWUP_MSG);
+	else
+		printf(GET_DISC_PWUP_FAIL_MSG);
+}
+
+void get_disc_pwup_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_DISC_PWUP),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+void set_disc_port_cmd(int file_desc,
+					int if_index, int disc_mode,
+					int bus, int slot, int func)
+{
+	int ret_val ;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = disc_mode;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_DISC_PORT), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val == 0) && (bpctl_cmd.status == 0))
+		printf(SET_DISC_PORT_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_BP_SLAVE_MSG);
+}
+
+void set_disc_port_all_cmd(int file_desc,
+						int dev_num, int disc_mode)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = disc_mode;
+
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_DISC_PORT),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+
+void get_disc_port_cmd(int file_desc, int if_index,
+						int bus, int slot, int func){
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(GET_DISC_PORT), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_BPT_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(NON_DISC_PORT_MODE_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(DISC_PORT_MODE_MSG);
+	else
+		printf(GET_DISC_FAIL_MSG);
+}
+
+void get_disc_port_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_DISC_PORT),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+void set_disc_port_pwup_cmd(int file_desc, int if_index,
+							int disc_mode, int bus,
+							int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = disc_mode;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(SET_DISC_PORT_PWUP), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if ((ret_val == 0) && (bpctl_cmd.status == 0))
+		printf(SET_DISC_PORT_PWUP_ENTRY" "SUCCESS_MSG);
+	else
+		printf(NOT_SUPP_SLAVE_MSG);
+}
+
+void set_disc_port_pwup_all_cmd(int file_desc, int dev_num,
+								int disc_mode)
+{
+
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = disc_mode;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_DISC_PORT_PWUP),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else
+				printf("fail\n");
+
+
+
+		}
+	}
+}
+
+
+void get_disc_port_pwup_cmd(int file_desc,
+							int if_index,
+							int bus, int slot,
+							int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(GET_DISC_PORT_PWUP), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	if (bpctl_cmd.status == 0)
+		printf(DISC_PORT_DIS_PWUP_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(DISC_PORT_EN_PWUP_MSG);
+	else
+		printf(GET_DISC_PORT_PWUP_FAIL_MSG);
+}
+
+void get_disc_port_pwup_all_cmd(int file_desc, int dev_num)
+{
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_DISC_PORT_PWUP),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("off\n");
+			else if (bpctl_cmd.status == 1)
+				printf("on\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+
+
+void set_wd_exp_mode_cmd(int file_desc,
+						int if_index, int mode,
+						int bus, int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[2] = mode;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(SET_WD_EXP_MODE), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0)
+		printf(NOT_SUPP_SLAVE_MSG);
+	else
+		printf(SET_WD_EXP_MODE_ENTRY" "SUCCESS_MSG);
+}
+
+void set_wd_exp_mode_all_cmd(int file_desc,
+							int dev_num, int mode)
+{
+
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	bpctl_cmd.in_param[2] = mode;
+
+	for (i = 0; i < dev_num; i++) {
+
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(SET_WD_EXP_MODE), &bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+
+			if (bpctl_cmd.status == 0)
+				printf("ok\n");
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+void get_wd_exp_mode_cmd(int file_desc, int if_index,
+						int bus, int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc,
+	IOCTL_TX_MSG(GET_WD_EXP_MODE), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0)
+		printf(NOT_SUPP_SLAVE_MSG);
+	else if (!bpctl_cmd.status)
+		printf(BYPASS_WD_EXP_MODE_MSG);
+	else if (bpctl_cmd.status == 1)
+		printf(TAP_WD_EXP_MODE_MSG);
+	else if (bpctl_cmd.status == 2)
+		printf(DISC_WD_EXP_MODE_MSG);
+	else
+		printf("fail\n");
+
+}
+
+void get_wd_exp_mode_all_cmd(int file_desc, int dev_num)
+{
+
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	bpctl_cmd.in_param[1] = 0;
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc,
+		IOCTL_TX_MSG(GET_WD_EXP_MODE),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+			if (bpctl_cmd.status == 0)
+				printf("bypass\n");
+			else if (bpctl_cmd.status == 1)
+				printf("tap\n");
+			else if (bpctl_cmd.status == 2)
+				printf("disc\n");
+
+			else
+				printf("fail\n");
+		}
+	}
+}
+
+void get_bypass_info_cmd(int file_desc, int if_index,
+						int bus, int slot, int func) {
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_BYPASS_INFO), &bpctl_cmd);
+	if (ret_val < 0) {
+		printf(NOT_SUPP_BPCTL_MSG);
+		return;
+	}
+	if (bpctl_cmd.status < 0) {
+		printf(NOT_SUPP_SLAVE_MSG);
+		return;
+	}
+	printf("Name\t\t\t%s\n", (char *)bpctl_cmd.data);
+	printf("Firmware version\t0x%x\n", bpctl_cmd.out_param[4]);
+}
+
+void get_bypass_info_all_cmd(int file_desc, int dev_num)
+{
+
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(GET_BYPASS_INFO),
+						&bpctl_cmd);
+		if (ret_val == 0) {
+			if (if_info_msg(&bpctl_cmd) == 0)
+				continue;
+			if (bpctl_cmd.status == 0) {
+				printf("\n\tName\t\t\t%s\n",
+				(char *)bpctl_cmd.data);
+				printf("\tFirmware version\t0x%x\n",
+				bpctl_cmd.out_param[4]);
+			} else
+				printf("fail\n");
+		}
+	}
+}
+
+void get_bypass_param_cmd(struct bpctl_cmd *bpctl_cmd,
+						int io_param,
+						int dev_num, int in_param,
+						int file_desc)
+{
+	int ret_val = 0, i = 0;
+	char if_name[IFNAMSIZ];
+
+
+	if (!bpctl_cmd)
+		return;
+	if (dev_num) {
+		memset(bpctl_cmd, 0, sizeof(struct bpctl_cmd));
+		bpctl_cmd->in_param[0] = in_param;
+	}
+	for (i = 0; bp_list_array[i].flag; i++) {
+		if (io_param == bp_list_array[i].flag) {
+
+			printf(bp_list_array[i].desc);
+			break;
+		}
+	}
+	printf(" ");
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(io_param), bpctl_cmd);
+	if (ret_val == 0) {
+		int ret_info = if_infoxx_msg(bpctl_cmd);
+
+		if (bpctl_cmd->status < 0) {
+			if (ret_info == 0)
+				printf("slave\n");
+			else
+				printf("fail\n") ;
+		} else {
+			switch (io_param) {
+			case GET_BYPASS_INFO:
+				if (bpctl_cmd->status == 0) {
+					printf("%s 0x%x\n",
+					(char *)bpctl_cmd->data,
+					bpctl_cmd->out_param[4]);
+				} else
+					printf("fail\n");
+				break;
+			case GET_WD_EXP_MODE:
+				if (bpctl_cmd->status == 0)
+					printf("bypass\n");
+				else if (bpctl_cmd->status == 1)
+					printf("tap\n");
+				else if (bpctl_cmd->status == 2)
+					printf("disc\n");
+
+				else
+					printf("fail\n");
+				break;
+			case GET_WD_AUTORESET:
+				if (bpctl_cmd->status == 0)
+					printf("disable\n");
+				else
+					printf("%d ms\n", bpctl_cmd->status);
+				break;
+			case GET_BYPASS_CAPS:
+				printf("0x%x\n", bpctl_cmd->status);
+				break;
+			case GET_BYPASS_SLAVE:
+				if (bpctl_cmd->status != 1)
+					printf("fail\n");
+				else {
+					printf("%02x:%02x.%x ",
+						bpctl_cmd->out_param[4],
+						bpctl_cmd->out_param[5],
+						bpctl_cmd->out_param[6]);
+					if ((bpctl_cmd->out_param[7] > 0) &&
+						(if_indextoname(
+						bpctl_cmd->out_param[7],
+						(char *)&if_name) != NULL))
+						printf("%s", if_name);
+					printf("\n");
+				}
+
+				break;
+			case GET_WD_SET_CAPS:
+				if (bpctl_cmd->status < 0)
+					printf("fail\n");
+				else
+					printf("0x%x\n", bpctl_cmd->status);
+				break;
+			case GET_BYPASS_WD:
+				if (bpctl_cmd->status < 0)
+					printf("fail\n");
+				else if (!bpctl_cmd->data[0])
+					printf("disable\n");
+				else if (bpctl_cmd->data[0] > 0)
+					printf("%d\n", bpctl_cmd->data[0]);
+				else
+					printf("unknown\n");
+				break;
+			case GET_WD_EXPIRE_TIME:
+				if (bpctl_cmd->status < 0)
+					printf("fail\n");
+				else if (!bpctl_cmd->data[0])
+					printf("disable\n");
+				else if (bpctl_cmd->data[0] > 0)
+					printf("%d\n", bpctl_cmd->data[0]);
+				else
+					printf("expired\n");
+				break;
+
+			default:
+				if (bpctl_cmd->status == 0)
+					printf("off\n");
+				else if (bpctl_cmd->status == 1)
+					printf("on\n");
+				break;
+
+
+
+			}
+		}
+	}
+
+}
+
+void get_bypass_list_all_cmd(int file_desc, int dev_num)
+{
+
+	int ret_val, i;
+	struct bpctl_cmd bpctl_cmd;
+
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+	for (i = 0; i < dev_num; i++) {
+		bpctl_cmd.in_param[0] = i;
+		ret_val = ioctl(file_desc, IOCTL_TX_MSG(IS_BYPASS), &bpctl_cmd);
+		if (ret_val == 0) {
+			if_infox_msg(&bpctl_cmd);
+
+			if (bpctl_cmd.status < 0)
+				printf("non-bypass\n");
+			else
+				printf("%s\n", bpctl_cmd.status ==
+					0 ? "slave" : "master");
+		}
+
+
+		get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_INFO,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_WD_EXP_MODE,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_WD_AUTORESET,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_CAPS,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_SLAVE,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_WD_SET_CAPS,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_WD,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_WD_EXPIRE_TIME,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_TX,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_TPL,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_BP_WAIT_AT_PWUP,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_BP_HW_RESET,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_DIS_BYPASS,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_CHANGE,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_CHANGE,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_PWOFF,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_PWUP,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_STD_NIC,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_DIS_TAP,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_TAP_CHANGE,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_TAP,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_TAP_PWUP,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_DIS_DISC,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_DISC_CHANGE,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_DISC,
+							dev_num, i, file_desc);
+		get_bypass_param_cmd(&bpctl_cmd, GET_DISC_PWUP,
+							dev_num, i, file_desc);
+
+
+	}
+}
+void get_bypass_list_cmd(int file_desc, int if_index,
+						int bus, int slot, int func)
+{
+	int ret_val;
+	struct bpctl_cmd bpctl_cmd;
+	memset(&bpctl_cmd, 0, sizeof(bpctl_cmd));
+
+
+	bpctl_cmd.in_param[1] = if_index;
+	bpctl_cmd.in_param[5] = bus;
+	bpctl_cmd.in_param[6] = slot;
+	bpctl_cmd.in_param[7] = func;
+	ret_val = ioctl(file_desc, IOCTL_TX_MSG(IS_BYPASS), &bpctl_cmd);
+	if (ret_val == 0) {
+		if_infox_msg(&bpctl_cmd);
+
+		if (bpctl_cmd.status < 0)
+			printf("non-bypass\n");
+		else
+			printf("%s\n", bpctl_cmd.status ==
+			0 ? "slave" : "master");
+	}
+
+
+	get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_INFO, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_WD_EXP_MODE, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_WD_AUTORESET, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_CAPS, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_SLAVE, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_WD_SET_CAPS, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_WD, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_WD_EXPIRE_TIME, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_TX, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_TPL, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_BP_WAIT_AT_PWUP, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_BP_HW_RESET, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_DIS_BYPASS, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_CHANGE, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_CHANGE, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_PWOFF, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_BYPASS_PWUP, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_STD_NIC, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_DIS_TAP, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_TAP_CHANGE, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_TAP, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_TAP_PWUP, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_DIS_DISC, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_DISC_CHANGE, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_DISC, 0, 0, file_desc);
+	get_bypass_param_cmd(&bpctl_cmd, GET_DISC_PWUP, 0, 0, file_desc);
+}
+
+
+
+static void str_low(char *str)
+{
+	int i;
+
+	for (i = 0; i < strlen(str); i++)
+		if ((str[i] >= 65) && (str[i] <= 90))
+			str[i] += 32;
+}
+
+static unsigned long str_to_hex(char *p)
+{
+	unsigned long      hex    = 0;
+	unsigned long     length = strlen(p), shift  = 0;
+	unsigned char     dig    = 0;
+
+	str_low(p);
+
+	length = strlen(p);
+
+	if (length == 0)
+		return 0;
+
+	do {
+		dig  = p[--length];
+		dig  = dig < 'a' ? (dig - '0') : (dig - 'a' + 0xa);
+		hex |= (dig<<shift);
+		shift += 4;
+	} while (length);
+	return hex;
+}
+
+
+int parse_bypass_cmdline(int argc,
+						char **argp,
+						int file_desc,
+						int flag) {
+	int if_index = 0, dev_num = 0, i = 0;
+	char *if_name;
+	int bus = 0, slot = 0, func = 0;
+	char *cmd_user;
+
+
+	if (argc >= 1) {
+		struct bpctl_cmd bpctl_cmd;
+
+		if (strstr(argp[0], ":")) {
+			cmd_user = strdup(argp[0]);
+			bus = str_to_hex(strsep(&cmd_user, ":"));
+			if (!strstr(cmd_user, "."))
+				goto cmd_err;
+			slot = str_to_hex(strsep(&cmd_user, "."));
+			func =  str_to_hex(cmd_user);
+		} else if (!strcmp(argp[0], "all")) {
+			if_index = 0;
+			if (ioctl(file_desc, IOCTL_TX_MSG(GET_DEV_NUM),
+					&bpctl_cmd) < 0) {
+				printf(GET_DEV_NUM_FAIL_MSG);
+				return ERROR;
+			}
+			dev_num = bpctl_cmd.out_param[0];
+			if (dev_num == 0) {
+				printf(NO_BPCTL_DEV_MSG);
+				return ERROR;
+			}
+
+		} else {
+			if_name = argp[0];
+			if_index = if_nametoindex(if_name);
+			if (if_index == 0)
+				return ERROR;
+			bpctl_cmd.in_param[1] = if_index;
+		}
+		if (argc == 1) {
+			if (flag)
+				return  ERROR;
+			BPCTL_GET_CMD(bypass_list, file_desc,
+			if_index, dev_num, bus, slot, func);
+			return OK;
+
+		}
+		i = 1;
+		if (!strcmp(argp[i], TX_ENTRY)) {
+			int nic_mode = 0;
+			if (flag) {
+				int j = i + 2;
+				nic_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < j) ||
+					(nic_mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(tx, file_desc,
+				if_index, dev_num, nic_mode, bus, slot, func);
+			} else
+				BPCTL_GET_CMD(tx, file_desc,
+				if_index, dev_num, bus, slot, func);
+			return OK;
+
+		}
+		if (!strcmp(argp[i], TPL_ENTRY)) {
+				int nic_mode = 0;
+				if (flag) {
+					int j = i + 2;
+					nic_mode = parse_bypass_mode(argp[i+1]);
+					if ((argc < j) ||
+						(nic_mode < 0))
+						goto cmd_err;
+					BPCTL_SET_CMD(tpl, file_desc,
+					if_index, dev_num,
+					nic_mode, bus, slot, func);
+			} else
+				BPCTL_GET_CMD(tpl, file_desc,
+				if_index, dev_num, bus, slot, func);
+
+			return OK;
+		} else if (!strcmp(argp[i], IS_BYPASS_ENTRY)) {
+			IS_BYPASS_CMD(file_desc, if_index,
+			dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], BYPASS_SLAVE_ENTRY)) {
+			BPCTL_GET_CMD(bypass_slave, file_desc,
+			if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], BYPASS_CAPS_ENTRY)) {
+			BPCTL_GET_CMD(bypass_caps, file_desc,
+			if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], WD_SET_CAPS_ENTRY)) {
+			BPCTL_GET_CMD(wd_set_caps, file_desc,
+			if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], BYPASS_ENTRY)) {
+			int nic_mode = 0;
+			if (flag) {
+				int j = i + 2;
+				nic_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < j) ||
+					(nic_mode < 0))
+					goto cmd_err;
+				BPCTL_SET_CMD(bypass, file_desc,
+				if_index, dev_num, nic_mode, bus, slot, func);
+			} else
+				BPCTL_GET_CMD(bypass, file_desc,
+				if_index, dev_num, bus, slot, func);
+			return OK;
+
+		} else if (!strcmp(argp[i], BYPASS_CHANGE_ENTRY)) {
+			BPCTL_GET_CMD(bypass_change, file_desc,
+			if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], DIS_BYPASS_ENTRY)) {
+			int nic_mode = 0;
+			if (flag) {
+				int j = i + 2;
+				nic_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < j) ||
+					(nic_mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(dis_bypass, file_desc,
+				if_index, dev_num, nic_mode, bus, slot, func);
+			} else
+				BPCTL_GET_CMD(dis_bypass, file_desc,
+				if_index, dev_num, bus, slot, func);
+
+			return OK;
+		} else if (!strcmp(argp[i], BYPASS_PWOFF_ENTRY)) {
+			int bypass_mode = 0;
+			if (flag) {
+				int j = i + 2;
+				bypass_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < j) ||
+					(bypass_mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(bypass_pwoff, file_desc,
+				if_index, dev_num, bypass_mode,
+				bus, slot, func);
+			} else
+				BPCTL_GET_CMD(bypass_pwoff, file_desc,
+				if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], BYPASS_PWUP_ENTRY)) {
+			int bypass_mode = 0;
+			if (flag) {
+				int j = i + 2;
+				bypass_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < j) ||
+					(bypass_mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(bypass_pwup, file_desc,
+				if_index, dev_num, bypass_mode,
+				bus, slot, func);
+			} else
+				BPCTL_GET_CMD(bypass_pwup, file_desc,
+				if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], STD_NIC_ENTRY)) {
+			int nic_mode = 0;
+			if (flag) {
+				nic_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < (i+2)) ||
+					(nic_mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(std_nic, file_desc,
+				if_index, dev_num, nic_mode, bus, slot, func);
+			} else
+				BPCTL_GET_CMD(std_nic, file_desc,
+				if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], TX_ENTRY)) {
+			int nic_mode = 0;
+			if (flag) {
+				int j = i + 2;
+				nic_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < j) ||
+					(nic_mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(tx, file_desc,
+				if_index, dev_num, nic_mode, bus, slot, func);
+			} else
+				BPCTL_GET_CMD(tx, file_desc,
+				if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], BYPASS_WD_ENTRY)) {
+			int timeout = 0;
+			if (flag) {
+				int j = i + 2;
+				if (argc < j)
+					goto cmd_err;
+
+				timeout = atoi(argp[i+1]);
+
+				BPCTL_SET_CMD(bypass_wd, file_desc,
+				if_index, dev_num, timeout, bus, slot, func);
+			} else
+				BPCTL_GET_CMD(bypass_wd, file_desc,
+				if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], WD_EXPIRE_TIME_ENTRY)) {
+			BPCTL_GET_CMD(wd_expire_time, file_desc,
+			if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], RESET_BYPASS_WD_TIMER_ENTRY)) {
+			RESET_WD_CMD(file_desc,
+			if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], TAP_ENTRY)) {
+			int bypass_mode = 0;
+			if (flag) {
+				int j = i + 2;
+				bypass_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < j) ||
+					(bypass_mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(tap, file_desc,
+				if_index, dev_num, bypass_mode,
+				bus, slot, func);
+			} else
+				BPCTL_GET_CMD(tap, file_desc,
+				if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], TAP_CHANGE_ENTRY)) {
+			BPCTL_GET_CMD(tap_change, file_desc,
+			if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], DIS_TAP_ENTRY)) {
+			int bypass_mode = 0;
+			if (flag) {
+				int j = i + 2;
+				bypass_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < j) ||
+					(bypass_mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(dis_tap, file_desc, if_index,
+				dev_num, bypass_mode, bus, slot, func);
+			} else
+				BPCTL_GET_CMD(dis_tap, file_desc,
+				if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], TAP_PWUP_ENTRY)) {
+			int bypass_mode = 0;
+			if (flag) {
+				int j = i + 2;
+				bypass_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < j) ||
+					(bypass_mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(tap_pwup, file_desc,
+				if_index, dev_num, bypass_mode,
+				bus, slot, func);
+			} else
+				BPCTL_GET_CMD(tap_pwup, file_desc,
+				if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], DISC_ENTRY)) {
+			int bypass_mode = 0;
+			if (flag) {
+				int j = i + 2;
+				bypass_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < j) ||
+					(bypass_mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(disc, file_desc,
+				if_index, dev_num, bypass_mode,
+				bus, slot, func);
+			} else
+				BPCTL_GET_CMD(disc, file_desc,
+				if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], DISC_CHANGE_ENTRY)) {
+			BPCTL_GET_CMD(disc_change, file_desc,
+			if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], DIS_DISC_ENTRY)) {
+			int bypass_mode = 0;
+			if (flag) {
+				int j = i + 2;
+				bypass_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < j) ||
+					(bypass_mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(dis_disc, file_desc,
+				if_index, dev_num, bypass_mode,
+				bus, slot, func);
+			} else
+				BPCTL_GET_CMD(dis_disc, file_desc,
+				if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], DISC_PWUP_ENTRY)) {
+			int bypass_mode = 0;
+			if (flag) {
+				int j = i + 2;
+				bypass_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < j) ||
+					(bypass_mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(disc_pwup, file_desc,
+				if_index, dev_num, bypass_mode, bus,
+				slot, func);
+			} else
+				BPCTL_GET_CMD(disc_pwup, file_desc,
+				if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], WD_EXP_MODE_ENTRY)) {
+			int mode = 0;
+			if (flag) {
+				int j = i + 2;
+				mode = parse_wd_exp_mode(argp[i+1]);
+				if ((argc < j) ||
+					(mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(wd_exp_mode, file_desc,
+				if_index, dev_num, mode, bus, slot, func);
+			} else
+				BPCTL_GET_CMD(wd_exp_mode, file_desc, if_index,
+				dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], WD_AUTORESET_ENTRY)) {
+			int timeout = 0;
+			if (flag) {
+				int j = i + 2;
+				if (argc < j)
+					goto cmd_err;
+
+
+				timeout = atoi(argp[i+1]);
+
+				BPCTL_SET_CMD(wd_autoreset, file_desc,
+				if_index, dev_num, timeout, bus, slot, func);
+			} else
+				BPCTL_GET_CMD(wd_autoreset, file_desc,
+				if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], GET_WD_AUTORESET_ENTRY)) {
+			BPCTL_GET_CMD(wd_autoreset, file_desc,
+			if_index, dev_num, bus, slot, func);
+			return OK;
+#ifdef BP_DBI_FLAG
+		} else if (!strcmp(argp[i], SET_FORCE_LINK_ENTRY)) {
+			int bypass_mode = 0;
+			bypass_mode = parse_bypass_mode(argp[i+1]);
+			if ((argc < j) ||
+				(bypass_mode < 0))
+				goto cmd_err;
+			BPCTL_SET_CMD(bp_force_link, file_desc,
+			if_index, dev_num, bypass_mode, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], GET_FORCE_LINK_ENTRY)) {
+			BPCTL_GET_CMD(bp_force_link, file_desc,
+			if_index, dev_num, bus, slot, func);
+			return OK;
+#endif
+
+#ifdef BP_SELF_TEST
+		} else if (!strcmp(argp[i], BP_SELF_TEST_ENTRY)) {
+			int timeout = 0;
+			if (flag) {
+				int j = i + 2;
+				if (argc < j)
+					goto cmd_err;
+
+
+				timeout = atoi(argp[i+1]);
+
+				BPCTL_SET_CMD(bp_self_test, file_desc,
+				if_index, dev_num, timeout, bus, slot, func);
+			} else
+				BPCTL_GET_CMD(bp_self_test, file_desc,
+				if_index, dev_num, bus, slot, func);
+
+			return OK;
+
+#endif
+
+		} else if (!strcmp(argp[i], HW_RESET_ENTRY)) {
+			int bypass_mode = 0;
+			if (flag) {
+				int j = i + 2;
+				bypass_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < j) ||
+					(bypass_mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(bp_hw_reset, file_desc, if_index,
+				dev_num, bypass_mode, bus, slot, func);
+			} else
+				BPCTL_GET_CMD(bp_hw_reset, file_desc,
+					if_index, dev_num, bus, slot, func);
+			return OK;
+		} else if (!strcmp(argp[i], WAIT_AT_PWUP_ENTRY)) {
+			int bypass_mode = 0;
+			if (flag) {
+				int j = i + 2;
+				bypass_mode = parse_bypass_mode(argp[i+1]);
+				if ((argc < j) ||
+					(bypass_mode < 0))
+					goto cmd_err;
+
+				BPCTL_SET_CMD(bp_wait_at_pwup, file_desc,
+					if_index, dev_num,
+					bypass_mode, bus, slot, func);
+			} else
+				BPCTL_GET_CMD(bp_wait_at_pwup, file_desc,
+					if_index, dev_num, bus, slot, func);
+
+			return OK;
+		} else if (!strcmp(argp[i], BYPASS_INFO_ENTRY)) {
+			BPCTL_GET_CMD(bypass_info, file_desc, if_index,
+						dev_num, bus, slot, func);
+			return OK;
+		}
+	}
+cmd_err:
+	return -1;
+}
+
+/*
+* Main - Call the ioctl functions
+*/
+int parse_bypass(int argc, char **argp, int flag)
+{
+	int file_desc, ret;
+	file_desc = open(DEVICE_NODE, 0);
+
+	if (file_desc < 0) {
+		/*printf("Can't open device file: %s\n", DEVICE_NAME);*/
+		return 0;
+	}
+	ret = parse_bypass_cmdline(argc, argp, file_desc, flag);
+	close(file_desc);
+	return ret;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -uprN ethtool-3.14/bp_util.h ethtool-3.14__/bp_util.h
--- ethtool-3.14/bp_util.h	1970-01-01 02:00:00.000000000 +0200
+++ ethtool-3.14__/bp_util.h	2014-06-09 11:36:24.000000000 +0300
@@ -0,0 +1,183 @@
+/******************************************************************************/
+/*                                                                            */
+/* Bypass Control utility, Copyright (c) 2005 Silicom, Ltd                    */
+/*                                                                            */
+/* This program is free software; you can redistribute it and/or modify       */
+/* it under the terms of the GNU General Public License as published by       */
+/* the Free Software Foundation, located in the file LICENSE.                 */
+/*                                                                            */
+/*                                                                            */
+/*                                                                            */
+/******************************************************************************/
+
+#ifndef BPCTL_UTIL_H
+#define BPCTL_UTIL_H
+
+#include "bp_msg.h"
+
+
+#define APP_NAME     "Bypass-SD Control utility"
+#define COPYRT_MSG   "Copyright Silicom Ltd."
+#define PROG_NAME    "ethtool"
+
+#define OK                           1
+#define ERROR                        0
+
+#define HELP_ENTRY                   "help"
+#define INFO_ENTRY                   "info"
+#define IF_SCAN_ENTRY                "if-scan"
+
+
+
+#define  IS_BYPASS_ENTRY             "is-bypass"
+#define  RESET_BYPASS_WD_TIMER_ENTRY "reset-bypass-wd"
+#define  BYPASS_ENABLE               "on"
+#define  BYPASS_DISABLE              "off"
+#define  TAP_MODE                    "tap"
+#define  BYPASS_MODE                 "bypass"
+
+
+
+#define  BYPASS_SLAVE_ENTRY      "bypass-slave"
+#define  BYPASS_CAPS_ENTRY       "bypass-caps"
+#define  WD_SET_CAPS_ENTRY       "wd-set-caps"
+#define  BYPASS_ENTRY            "bypass"
+#define  BYPASS_CHANGE_ENTRY     "bypass-change"
+#define  DIS_BYPASS_ENTRY        "dis-bypass"
+#define  BYPASS_PWOFF_ENTRY      "bypass-pwoff"
+#define  BYPASS_PWUP_ENTRY       "bypass-pwup"
+#define  STD_NIC_ENTRY           "std-nic"
+#define  BYPASS_WD_ENTRY         "bypass-wd"
+#define  WD_EXPIRE_TIME_ENTRY    "wd-time-expire"
+#define  RESET_BYPASS_WD_TIMER_ENTRY "reset-bypass-wd"
+#define  TX_ENTRY                "tx"
+#define  BYPASS_ENABLE               "on"
+#define  BYPASS_DISABLE              "off"
+#define  TAP_MODE                    "tap"
+#define  BYPASS_MODE                 "bypass"
+#define  TAP_ENTRY               "tap"
+#define  TAP_CHANGE_ENTRY        "tap-change"
+#define  DIS_TAP_ENTRY           "dis-tap"
+#define  TAP_PWUP_ENTRY          "tap-pwup"
+#define  WD_EXP_MODE_ENTRY       "wd-exp-mode"
+#define  FORCE_LINK_ENTRY        "force-link-on"
+#define WD_AUTORESET_ENTRY       "wd-autoreset"
+
+#define  BP_WAIT_AT_PWUP_ENTRY   "wait-at-pwup"
+#define  BP_HW_RESET_ENTRY       "hw-reset"
+#define  TPL_ENTRY               "tpl"
+#define  DISC_ENTRY              "disc"
+#define  DISC_CHANGE_ENTRY       "disc-change"
+#define  DIS_DISC_ENTRY    "dis-disc"
+#define BP_FORCE_LINK_ENTRY      "bp-force-link"
+#define BYPASS_INFO_ENTRY        "bypass-info"
+#define DISC_PWUP_ENTRY          "disc-pwup"
+#define  SET_DISC_PORT_ENTRY         "set_disc_port"
+#define  HW_RESET_ENTRY           "hw-reset"
+#define  WAIT_AT_PWUP_ENTRY       "wait-at-pwup"
+
+
+
+
+
+
+
+
+#define  BYPASS_ENABLE                "on"
+#define  BYPASS_DISABLE               "off"
+#define  IF_NAME                      "eth"
+#define  ALL_NAME                     "all "
+
+
+#define IF_NAME "eth"
+
+struct bp_cap {
+    int   flag;
+    char *desc;
+} bp_cap, *pbp_cap;
+
+struct bp_list {
+    int   flag;
+    char *desc;
+} bp_list, *pbp_list;
+
+
+
+
+
+
+struct bp_list bp_list_array[] = {
+    {GET_BYPASS_SLAVE                , BYPASS_SLAVE_ENTRY},
+    {GET_BYPASS_CAPS         , BYPASS_CAPS_ENTRY},
+    {GET_BYPASS  , BYPASS_ENTRY},
+    {GET_BYPASS_CHANGE            , BYPASS_CHANGE_ENTRY},
+    {GET_BYPASS_WD            , BYPASS_WD_ENTRY},
+    {GET_WD_EXPIRE_TIME     , WD_EXPIRE_TIME_ENTRY},
+    {GET_DIS_BYPASS           , DIS_BYPASS_ENTRY},
+    {GET_BYPASS_PWOFF       , BYPASS_PWOFF_ENTRY},
+    {GET_BYPASS_PWUP      , BYPASS_PWUP_ENTRY},
+    {GET_STD_NIC      , STD_NIC_ENTRY},
+    {GET_TX        , TX_ENTRY},
+    {GET_TAP       , TAP_ENTRY},
+    {GET_TAP_CHANGE       , TAP_CHANGE_ENTRY},
+    {GET_DIS_TAP            , DIS_TAP_ENTRY},
+    {GET_TAP_PWUP         , TAP_PWUP_ENTRY},
+    {GET_WD_EXP_MODE        , WD_EXP_MODE_ENTRY},
+    {GET_WD_AUTORESET            , WD_AUTORESET_ENTRY},
+    {GET_TPL         , TPL_ENTRY},
+    {GET_DISC               , DISC_ENTRY},
+    {GET_DISC_CHANGE        , DISC_CHANGE_ENTRY},
+    {GET_DIS_DISC , DIS_DISC_ENTRY},
+    {GET_DISC_PWUP           , DISC_PWUP_ENTRY},
+    {GET_BYPASS_INFO    , BYPASS_INFO_ENTRY},
+    {GET_BP_WAIT_AT_PWUP       , BP_WAIT_AT_PWUP_ENTRY},
+    {GET_BP_HW_RESET      , BP_HW_RESET_ENTRY},
+    {GET_BP_FORCE_LINK               , BP_FORCE_LINK_ENTRY},
+    {GET_WD_SET_CAPS,     WD_SET_CAPS_ENTRY},
+
+    {0, NULL}
+} ;
+
+struct bp_cap bp_cap_array[] = {
+    {BP_CAP                , BP_CAP_MSG},
+    {BP_STATUS_CAP         , BP_STATUS_CAP_MSG},
+    {BP_STATUS_CHANGE_CAP  , BP_STATUS_CHANGE_CAP_MSG},
+    {SW_CTL_CAP            , SW_CTL_CAP_MSG},
+    {BP_DIS_CAP            , BP_DIS_CAP_MSG},
+    {BP_DIS_STATUS_CAP     , BP_DIS_STATUS_CAP_MSG},
+    {STD_NIC_CAP           , STD_NIC_CAP_MSG},
+    {BP_PWOFF_ON_CAP       , BP_PWOFF_ON_CAP_MSG},
+    {BP_PWOFF_OFF_CAP      , BP_PWOFF_OFF_CAP_MSG},
+    {BP_PWOFF_CTL_CAP      , BP_PWOFF_CTL_CAP_MSG},
+    {BP_PWUP_ON_CAP        , BP_PWUP_ON_CAP_MSG},
+    {BP_PWUP_OFF_CAP       , BP_PWUP_OFF_CAP_MSG},
+    {BP_PWUP_CTL_CAP       , BP_PWUP_CTL_CAP_MSG},
+    {WD_CTL_CAP            , WD_CTL_CAP_MSG},
+    {WD_STATUS_CAP         , WD_STATUS_CAP_MSG},
+    {WD_TIMEOUT_CAP        , WD_TIMEOUT_CAP_MSG},
+    {TX_CTL_CAP            , TX_CTL_CAP_MSG},
+    {TX_STATUS_CAP         , TX_STATUS_CAP_MSG},
+    {TAP_CAP               , TAP_CAP_MSG},
+    {TAP_STATUS_CAP        , TAP_STATUS_CAP_MSG},
+    {TAP_STATUS_CHANGE_CAP , TAP_STATUS_CHANGE_CAP_MSG},
+    {TAP_DIS_CAP           , TAP_DIS_CAP_MSG},
+    {TAP_DIS_STATUS_CAP    , TAP_DIS_STATUS_CAP_MSG},
+    {TAP_PWUP_ON_CAP       , TAP_PWUP_ON_CAP_MSG},
+    {TAP_PWUP_OFF_CAP      , TAP_PWUP_OFF_CAP_MSG},
+    {TAP_PWUP_CTL_CAP      , TAP_PWUP_CTL_CAP_MSG},
+    {NIC_CAP_NEG           , NIC_CAP_NEG_MSG},
+    {TPL_CAP               , TPL_CAP_MSG},
+    {DISC_CAP               , DISC_CAP_MSG},
+    {DISC_DIS_CAP           , DISC_DIS_CAP_MSG},
+    {DISC_PWUP_CTL_CAP      , DISC_PWUP_CTL_CAP_MSG},
+
+    {0, NULL}
+} ;
+
+
+
+
+
+
+
+#endif
diff -uprN ethtool-3.14/ethtool.8 ethtool-3.14__/ethtool.8
--- ethtool-3.14/ethtool.8	2014-04-22 01:24:46.000000000 +0300
+++ ethtool-3.14__/ethtool.8	2014-06-09 11:36:24.000000000 +0300
@@ -337,6 +337,66 @@ ethtool \- query or control network driv
 .BN advertise
 .
 .\" Adjust lines (i.e. full justification) and hyphenate.
+.HP
+.B ethtool \-b|\-\-show\-bypass
+.I devname
+| bus:slot.function | all
+.\" (*GB
+.B [is-bypass|bypass-slave|bypass-pwoff|bypass-info|bypass-caps|wd-set-caps|bypass-change|bypass|bypass-pwup\
+|dis-bypass|tap|tap-pwup|dis-tap|disc|disc-pwup|dis-disc|std-nic|tx|tpl|wait-at-pwup|wd-autoreset|hw-reset\
+|bypass-wd|wd-time-expire|wd-exp-mode|disc-change]
+.HP
+.B ethtool \-B|-\-bypass
+.I devname
+| bus:slot.function | all
+.B2 bypass on off
+|
+.B2 bypass-pwoff on off
+|
+.B2 bypass-pwup on off
+|
+.B2 dis-bypass on off
+|
+.B2 tap on off
+|
+.B2 tap-pwup on off
+|
+.B2 dis-tap on off
+|
+.B2 disc on off
+|
+.B2 disc-pwup on off
+|
+.B2 dis-disc on off
+|
+.B2 std-nic on off
+|
+.B2 tx on off
+|
+.B2 tpl on off
+|
+.B2 wait-at-pwup on|off
+|
+.B2 hw-reset on off
+|
+.BN bypass-wd
+|
+.B [wd-exp-mode bypass|tap|disc]
+|
+.BN wd-autoreset
+|
+.B [reset-bypass-wd]
+
+
+
+
+
+
+
+
+
+
+
 .ad
 .hy
 
diff -uprN ethtool-3.14/ethtool.8.in ethtool-3.14__/ethtool.8.in
--- ethtool-3.14/ethtool.8.in	2014-01-28 02:19:52.000000000 +0200
+++ ethtool-3.14__/ethtool.8.in	2014-06-09 11:36:24.000000000 +0300
@@ -337,6 +337,66 @@ ethtool \- query or control network driv
 .BN advertise
 .
 .\" Adjust lines (i.e. full justification) and hyphenate.
+.HP
+.B ethtool \-b|\-\-show\-bypass
+.I devname
+| bus:slot.function | all
+.\" (*GB
+.B [is-bypass|bypass-slave|bypass-pwoff|bypass-info|bypass-caps|wd-set-caps|bypass-change|bypass|bypass-pwup\
+|dis-bypass|tap|tap-pwup|dis-tap|disc|disc-pwup|dis-disc|std-nic|tx|tpl|wait-at-pwup|wd-autoreset|hw-reset\
+|bypass-wd|wd-time-expire|wd-exp-mode|disc-change]
+.HP
+.B ethtool \-B|-\-bypass
+.I devname
+| bus:slot.function | all
+.B2 bypass on off
+|
+.B2 bypass-pwoff on off
+|
+.B2 bypass-pwup on off
+|
+.B2 dis-bypass on off
+|
+.B2 tap on off
+|
+.B2 tap-pwup on off
+|
+.B2 dis-tap on off
+|
+.B2 disc on off
+|
+.B2 disc-pwup on off
+|
+.B2 dis-disc on off
+|
+.B2 std-nic on off
+|
+.B2 tx on off
+|
+.B2 tpl on off
+|
+.B2 wait-at-pwup on|off
+|
+.B2 hw-reset on off
+|
+.BN bypass-wd
+|
+.B [wd-exp-mode bypass|tap|disc]
+|
+.BN wd-autoreset
+|
+.B [reset-bypass-wd]
+
+
+
+
+
+
+
+
+
+
+
 .ad
 .hy
 
diff -uprN ethtool-3.14/ethtool.c ethtool-3.14__/ethtool.c
--- ethtool-3.14/ethtool.c	2014-04-22 01:21:12.000000000 +0300
+++ ethtool-3.14__/ethtool.c	2014-06-09 11:36:24.000000000 +0300
@@ -41,6 +41,8 @@
 #include <arpa/inet.h>
 
 #include <linux/sockios.h>
+#include "bp.h"
+
 
 #ifndef MAX_ADDR_LEN
 #define MAX_ADDR_LEN	32
@@ -3722,6 +3724,30 @@ static int do_seee(struct cmd_context *c
 	return 0;
 }
 
+static int do_gbypass(struct cmd_context *ctx)
+{
+    int ret = parse_bypass(ctx->argc, ctx->argp, 0);
+
+    if (ret < 0)
+	exit_bad_args();
+
+    return (ret == 0 ? 1 : 0);
+}
+
+static int do_sbypass(struct cmd_context *ctx)
+{
+     int ret = parse_bypass(ctx->argc, ctx->argp , 1);
+
+
+     if (ret < 0)
+	exit_bad_args();
+
+	return (ret == 0 ? 1 : 0);
+}
+
+
+
+
 #ifndef TEST_ETHTOOL
 int send_ioctl(struct cmd_context *ctx, void *cmd)
 {
@@ -3880,6 +3906,73 @@ static const struct option {
 	  "		[ tx-timer %d ]\n"},
 	{ "-h|--help", 0, show_usage, "Show this help" },
 	{ "--version", 0, do_version, "Show version number" },
+	{"-b|--show-bypass", 0, do_gbypass, "Bypass Status commands\n"
+	"NOTE: Please check that bpctl_mod driver is loaded!\n"
+	"ethtool -b|--show-bypass DEVNAME|bus:slot.function|all "
+	"Show all bypass options status\n"
+	"ethtool -b|--show-bypass DEVNAME|bus:slot.function|all <option> "
+	"Show defined options status\n"
+	"	[is-bypass] check if device is a Bypass/TAP "
+		"controlling device\n"
+	"	[bypass-slave] get the second port participate "
+		"in the Bypass/TAP pair\n"
+	"	[bypass-info] get bypass/TAP info\n"
+	"	[bypass-caps] obtain Bypass/TAP capabilities information\n"
+	"	[wd-set-caps] obtain watchdog timer settings capabilities\n"
+	"	[bypass-change] get change of Bypass mode state "
+		"from last status check\n"
+	"	[bypass] get Bypass mode state\n"
+	"	[bypass-pwoff] get Bypass mode at power-off state\n"
+	"	[bypass-pwup] get Bypass mode at power-up state\n"
+	"	[dis-bypass] get Disable Bypass mode state\n"
+	"	[tap] get TAP mode state\n"
+	"	[tap-pwup] get TAP mode at power-up state\n"
+	"	[dis-tap] get Disable TAP mode state\n"
+	"	[disc-change] get change of Disconnect mode state "
+		"from last status check\n"
+	"	[disc] get Disconnect mode state\n"
+	"	[disc-pwup] get Disconnect mode at power-up state\n"
+	"	[dis-disc] get Disable Disconnect mode state\n"
+	"	[std-nic] get Standard NIC mode of operation\n"
+	"	[tx] get transmitter state (enabled / disabled)\n"
+	"	[tpl] get Two Port Link state\n"
+	"	[wait-at-pwup] get wait-at-pwup (enabled / disabled)\n"
+	"	[hw-reset] get hw-reset (enabled / disabled)\n"
+	"	[bypass-wd] get WDT state\n"
+	"	[wd-time-expire]  get watchdog expired time\n"
+	"	[wd-exp-mode] WDT expired mode\n"
+	"	[wd-autoreset] WDT autoreset interval, msec "
+		"(0 for disabling WDT autoreset)\n"
+	"Example:	ethtool -b 0b:00.0 bypass-info\n"
+	"		ethtool -b 0b:00.0"},
+	{"-B|--bypass", 0, do_sbypass, "Bypass Control commands\n"
+	"NOTE: Please check that bpctl_mod driver is loaded!\n"
+	"ethtool -B|--bypass DEVNAME|bus:slot.function|all <option> "
+		"Set bypass options\n"
+	"	[bypass on|off] set Bypass mode state\n"
+	"	[bypass-pwoff on|off] set Bypass mode at power-off state\n"
+	"	[bypass-pwup on|off] set Bypass mode at power-up state\n"
+	"	[dis-bypass on|off] set Disable Bypass mode state\n"
+	"	[tap on|off] set TAP mode state\n"
+	"	[tap-pwup on|off] set TAP mode at power-up state\n"
+	"	[dis-tap on|off] set Disable TAP mode state\n"
+	"	[disc on|off] set Disconnect mode state\n"
+	"	[disc-pwup on|off] set Disconnect mode at power-up state\n"
+	"	[dis-disc on|off] set Disable Disconnect mode state\n"
+	"	[std-nic on|off] set Standard NIC mode of operation\n"
+	"	[tx on|off] set transmitter state (enabled / disabled)\n"
+	"	[tpl on|off] enable/disable Two Port Link\n"
+	"	[wait-at-pwup on|off] set wait-at-pwup (enabled / disabled)\n"
+	"	[hw-reset on|off] get hw-reset (enabled / disabled)\n"
+	"	[bypass-wd N] WDT timeout interval, "
+		"msec (0 for disabling WDT)\n"
+	"	[wd-exp-mode bypass|tap|disc] WDT expired mode\n"
+	"	[wd-autoreset N] WDT autoreset interval, "
+		"msec (0 for disabling WDT autoreset)\n"
+	"	[reset-bypass-wd] - reset watchdog timer\n"
+	"Example:	ethtool -B eth0 bypass-wd 5000\n"
+	"		ethtool -B all bypass on\n"
+	"		ethtool -B eth0 wd-exp-mode tap"},
 	{}
 };
 
diff -uprN ethtool-3.14/Makefile.am ethtool-3.14__/Makefile.am
--- ethtool-3.14/Makefile.am	2014-03-16 04:04:04.000000000 +0200
+++ ethtool-3.14__/Makefile.am	2014-06-09 11:36:24.000000000 +0300
@@ -13,7 +13,8 @@ ethtool_SOURCES += \
 		  fec_8xx.c ibm_emac.c ixgb.c ixgbe.c natsemi.c	\
 		  pcnet32.c realtek.c tg3.c marvell.c vioc.c	\
 		  smsc911x.c at76c50x-usb.c sfc.c stmmac.c	\
-		  sfpid.c sfpdiag.c ixgbevf.c
+		  sfpid.c sfpdiag.c ixgbevf.c bp_util.c bp.h
+
 endif
 
 TESTS = test-cmdline test-features
