aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJan-Bernd Themann <ossthema@de.ibm.com>2007-09-07 06:30:17 -0400
committerJeff Garzik <jeff@garzik.org>2007-09-13 00:13:51 -0400
commit8759cf76e9a6322fc68dcbfaa1cbad00c74b199e (patch)
tree8c503232920c6b5dd32ff8c7bbf9292c57f2f13d /drivers/net
parent026d7917e592f91063861e002adf1c806d7756ae (diff)
ehea: propagate physical port state
Introduces a module parameter to decide whether the physical port link state is propagated to the network stack or not. It makes sense not to take the physical port state into account on machines with more logical partitions that communicate with each other. This is always possible no matter what the physical port state is. Thus eHEA can be considered as a switch there. Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ehea/ehea.h5
-rw-r--r--drivers/net/ehea/ehea_main.c14
2 files changed, 17 insertions, 2 deletions
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index d67f97bfa3a4..8d58be56f4e3 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -39,7 +39,7 @@
39#include <asm/io.h> 39#include <asm/io.h>
40 40
41#define DRV_NAME "ehea" 41#define DRV_NAME "ehea"
42#define DRV_VERSION "EHEA_0073" 42#define DRV_VERSION "EHEA_0074"
43 43
44/* eHEA capability flags */ 44/* eHEA capability flags */
45#define DLPAR_PORT_ADD_REM 1 45#define DLPAR_PORT_ADD_REM 1
@@ -402,6 +402,8 @@ struct ehea_mc_list {
402 402
403#define EHEA_PORT_UP 1 403#define EHEA_PORT_UP 1
404#define EHEA_PORT_DOWN 0 404#define EHEA_PORT_DOWN 0
405#define EHEA_PHY_LINK_UP 1
406#define EHEA_PHY_LINK_DOWN 0
405#define EHEA_MAX_PORT_RES 16 407#define EHEA_MAX_PORT_RES 16
406struct ehea_port { 408struct ehea_port {
407 struct ehea_adapter *adapter; /* adapter that owns this port */ 409 struct ehea_adapter *adapter; /* adapter that owns this port */
@@ -427,6 +429,7 @@ struct ehea_port {
427 u32 msg_enable; 429 u32 msg_enable;
428 u32 sig_comp_iv; 430 u32 sig_comp_iv;
429 u32 state; 431 u32 state;
432 u8 phy_link;
430 u8 full_duplex; 433 u8 full_duplex;
431 u8 autoneg; 434 u8 autoneg;
432 u8 num_def_qps; 435 u8 num_def_qps;
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index db5747490a07..1e9fd6f36910 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -53,17 +53,21 @@ static int rq3_entries = EHEA_DEF_ENTRIES_RQ3;
53static int sq_entries = EHEA_DEF_ENTRIES_SQ; 53static int sq_entries = EHEA_DEF_ENTRIES_SQ;
54static int use_mcs = 0; 54static int use_mcs = 0;
55static int num_tx_qps = EHEA_NUM_TX_QP; 55static int num_tx_qps = EHEA_NUM_TX_QP;
56static int prop_carrier_state = 0;
56 57
57module_param(msg_level, int, 0); 58module_param(msg_level, int, 0);
58module_param(rq1_entries, int, 0); 59module_param(rq1_entries, int, 0);
59module_param(rq2_entries, int, 0); 60module_param(rq2_entries, int, 0);
60module_param(rq3_entries, int, 0); 61module_param(rq3_entries, int, 0);
61module_param(sq_entries, int, 0); 62module_param(sq_entries, int, 0);
63module_param(prop_carrier_state, int, 0);
62module_param(use_mcs, int, 0); 64module_param(use_mcs, int, 0);
63module_param(num_tx_qps, int, 0); 65module_param(num_tx_qps, int, 0);
64 66
65MODULE_PARM_DESC(num_tx_qps, "Number of TX-QPS"); 67MODULE_PARM_DESC(num_tx_qps, "Number of TX-QPS");
66MODULE_PARM_DESC(msg_level, "msg_level"); 68MODULE_PARM_DESC(msg_level, "msg_level");
69MODULE_PARM_DESC(prop_carrier_state, "Propagate carrier state of physical "
70 "port to stack. 1:yes, 0:no. Default = 0 ");
67MODULE_PARM_DESC(rq3_entries, "Number of entries for Receive Queue 3 " 71MODULE_PARM_DESC(rq3_entries, "Number of entries for Receive Queue 3 "
68 "[2^x - 1], x = [6..14]. Default = " 72 "[2^x - 1], x = [6..14]. Default = "
69 __MODULE_STRING(EHEA_DEF_ENTRIES_RQ3) ")"); 73 __MODULE_STRING(EHEA_DEF_ENTRIES_RQ3) ")");
@@ -814,7 +818,9 @@ int ehea_set_portspeed(struct ehea_port *port, u32 port_speed)
814 ehea_error("Failed setting port speed"); 818 ehea_error("Failed setting port speed");
815 } 819 }
816 } 820 }
817 netif_carrier_on(port->netdev); 821 if (!prop_carrier_state || (port->phy_link == EHEA_PHY_LINK_UP))
822 netif_carrier_on(port->netdev);
823
818 kfree(cb4); 824 kfree(cb4);
819out: 825out:
820 return ret; 826 return ret;
@@ -869,13 +875,19 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe)
869 } 875 }
870 876
871 if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PORT_UP, eqe)) { 877 if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PORT_UP, eqe)) {
878 port->phy_link = EHEA_PHY_LINK_UP;
872 if (netif_msg_link(port)) 879 if (netif_msg_link(port))
873 ehea_info("%s: Physical port up", 880 ehea_info("%s: Physical port up",
874 port->netdev->name); 881 port->netdev->name);
882 if (prop_carrier_state)
883 netif_carrier_on(port->netdev);
875 } else { 884 } else {
885 port->phy_link = EHEA_PHY_LINK_DOWN;
876 if (netif_msg_link(port)) 886 if (netif_msg_link(port))
877 ehea_info("%s: Physical port down", 887 ehea_info("%s: Physical port down",
878 port->netdev->name); 888 port->netdev->name);
889 if (prop_carrier_state)
890 netif_carrier_off(port->netdev);
879 } 891 }
880 892
881 if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PRIMARY, eqe)) 893 if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PRIMARY, eqe))