diff options
Diffstat (limited to 'drivers/net/ehea/ehea_main.c')
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index db5747490a07..717b12984d10 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; | |||
53 | static int sq_entries = EHEA_DEF_ENTRIES_SQ; | 53 | static int sq_entries = EHEA_DEF_ENTRIES_SQ; |
54 | static int use_mcs = 0; | 54 | static int use_mcs = 0; |
55 | static int num_tx_qps = EHEA_NUM_TX_QP; | 55 | static int num_tx_qps = EHEA_NUM_TX_QP; |
56 | static int prop_carrier_state = 0; | ||
56 | 57 | ||
57 | module_param(msg_level, int, 0); | 58 | module_param(msg_level, int, 0); |
58 | module_param(rq1_entries, int, 0); | 59 | module_param(rq1_entries, int, 0); |
59 | module_param(rq2_entries, int, 0); | 60 | module_param(rq2_entries, int, 0); |
60 | module_param(rq3_entries, int, 0); | 61 | module_param(rq3_entries, int, 0); |
61 | module_param(sq_entries, int, 0); | 62 | module_param(sq_entries, int, 0); |
63 | module_param(prop_carrier_state, int, 0); | ||
62 | module_param(use_mcs, int, 0); | 64 | module_param(use_mcs, int, 0); |
63 | module_param(num_tx_qps, int, 0); | 65 | module_param(num_tx_qps, int, 0); |
64 | 66 | ||
65 | MODULE_PARM_DESC(num_tx_qps, "Number of TX-QPS"); | 67 | MODULE_PARM_DESC(num_tx_qps, "Number of TX-QPS"); |
66 | MODULE_PARM_DESC(msg_level, "msg_level"); | 68 | MODULE_PARM_DESC(msg_level, "msg_level"); |
69 | MODULE_PARM_DESC(prop_carrier_state, "Propagate carrier state of physical " | ||
70 | "port to stack. 1:yes, 0:no. Default = 0 "); | ||
67 | MODULE_PARM_DESC(rq3_entries, "Number of entries for Receive Queue 3 " | 71 | MODULE_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) ")"); |
@@ -467,7 +471,7 @@ static struct ehea_cqe *ehea_proc_rwqes(struct net_device *dev, | |||
467 | else | 471 | else |
468 | netif_receive_skb(skb); | 472 | netif_receive_skb(skb); |
469 | 473 | ||
470 | dev->last_rx = jiffies; | 474 | port->netdev->last_rx = jiffies; |
471 | } else { | 475 | } else { |
472 | pr->p_stats.poll_receive_errors++; | 476 | pr->p_stats.poll_receive_errors++; |
473 | port_reset = ehea_treat_poll_error(pr, rq, cqe, | 477 | port_reset = ehea_treat_poll_error(pr, rq, cqe, |
@@ -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); |
819 | out: | 825 | out: |
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)) |