From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kok, Auke" Subject: [PATCH 04/22] e1000: display FC link properties Date: Fri, 08 Dec 2006 15:02:53 -0800 Message-ID: <20061208230253.30109.8336.stgit@gitlost.site> References: <20061208230209.30109.49157.stgit@gitlost.site> Cc: netdev@vger.kernel.org, "Brandeburg, Jesse" , "Kok, Auke" , "Kok, Auke" , "Ronciak, John" Return-path: Received: from [63.64.152.142] ([63.64.152.142]:4356 "EHLO gitlost.site" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1947453AbWLHWwL (ORCPT ); Fri, 8 Dec 2006 17:52:11 -0500 To: "Garzik, Jeff" In-Reply-To: <20061208230209.30109.49157.stgit@gitlost.site> Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Previously there was no way of determining the actual flow control properties of a link state. We display them at link up to provide this information as some other drivers do. Ethtool needs probably to add this status information. Signed-off-by: Auke Kok --- drivers/net/e1000/e1000_main.c | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 73f3a85..fae30c7 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -2454,15 +2454,22 @@ e1000_watchdog(unsigned long data) if (link) { if (!netif_carrier_ok(netdev)) { + uint32_t ctrl; boolean_t txb2b = 1; e1000_get_speed_and_duplex(&adapter->hw, &adapter->link_speed, &adapter->link_duplex); - DPRINTK(LINK, INFO, "NIC Link is Up %d Mbps %s\n", - adapter->link_speed, - adapter->link_duplex == FULL_DUPLEX ? - "Full Duplex" : "Half Duplex"); + ctrl = E1000_READ_REG(&adapter->hw, CTRL); + DPRINTK(LINK, INFO, "NIC Link is Up %d Mbps %s, " + "Flow Control: %s\n", + adapter->link_speed, + adapter->link_duplex == FULL_DUPLEX ? + "Full Duplex" : "Half Duplex", + ((ctrl & E1000_CTRL_TFCE) && (ctrl & + E1000_CTRL_RFCE)) ? "RX/TX" : ((ctrl & + E1000_CTRL_RFCE) ? "RX" : ((ctrl & + E1000_CTRL_TFCE) ? "TX" : "None" ))); /* tweak tx_queue_len according to speed/duplex * and adjust the timeout factor */ --- Auke Kok