From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Carolyn Wyborny <carolyn.wyborny@intel.com>,
netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 3/8] igb: Update get cable length function for i210/i211
Date: Tue, 23 Oct 2012 03:24:42 -0700 [thread overview]
Message-ID: <1350987887-16161-4-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1350987887-16161-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Carolyn Wyborny <carolyn.wyborny@intel.com>
There was a problem in the initial implementation of the get cable length
function for i210 and it did not work properly. This patch fixes that
problem for i210/i211 devices.
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/e1000_phy.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/net/ethernet/intel/igb/e1000_phy.c b/drivers/net/ethernet/intel/igb/e1000_phy.c
index 3404bc7..c62a4c3 100644
--- a/drivers/net/ethernet/intel/igb/e1000_phy.c
+++ b/drivers/net/ethernet/intel/igb/e1000_phy.c
@@ -1710,6 +1710,26 @@ s32 igb_get_cable_length_m88_gen2(struct e1000_hw *hw)
switch (hw->phy.id) {
case I210_I_PHY_ID:
+ /* Get cable length from PHY Cable Diagnostics Control Reg */
+ ret_val = phy->ops.read_reg(hw, (0x7 << GS40G_PAGE_SHIFT) +
+ (I347AT4_PCDL + phy->addr),
+ &phy_data);
+ if (ret_val)
+ return ret_val;
+
+ /* Check if the unit of cable length is meters or cm */
+ ret_val = phy->ops.read_reg(hw, (0x7 << GS40G_PAGE_SHIFT) +
+ I347AT4_PCDC, &phy_data2);
+ if (ret_val)
+ return ret_val;
+
+ is_cm = !(phy_data2 & I347AT4_PCDC_CABLE_LENGTH_UNIT);
+
+ /* Populate the phy structure with cable length in meters */
+ phy->min_cable_length = phy_data / (is_cm ? 100 : 1);
+ phy->max_cable_length = phy_data / (is_cm ? 100 : 1);
+ phy->cable_length = phy_data / (is_cm ? 100 : 1);
+ break;
case I347AT4_E_PHY_ID:
/* Remember the original page select and set it to 7 */
ret_val = phy->ops.read_reg(hw, I347AT4_PAGE_SELECT,
--
1.7.11.7
next prev parent reply other threads:[~2012-10-23 10:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-23 10:24 [net-next 0/8][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-10-23 10:24 ` [net-next 1/8] e1000e: Minimum packet size must be 17 bytes Jeff Kirsher
2012-10-23 15:25 ` David Laight
2012-10-23 16:37 ` Alexander Duyck
2012-10-23 10:24 ` [net-next 2/8] maintainers: update with official intel support link, new maintainer Jeff Kirsher
2012-10-23 13:25 ` Joe Perches
2012-10-24 4:32 ` Jeff Kirsher
2012-10-24 4:52 ` Joe Perches
2012-10-24 5:13 ` Jeff Kirsher
2012-10-24 17:31 ` Rick Jones
2012-10-23 10:24 ` Jeff Kirsher [this message]
2012-10-23 10:24 ` [net-next 4/8] igb: Update version Jeff Kirsher
2012-10-23 10:24 ` [net-next 5/8] ixgbevf: make netif_napi_add and netif_napi_del symmetric Jeff Kirsher
2012-10-23 10:24 ` [net-next 6/8] ixgbevf: Check for error on dma_map_single call Jeff Kirsher
2012-10-23 10:24 ` [net-next 7/8] ixgbevf: fix softirq-safe to unsafe splat on internal mbx_lock Jeff Kirsher
2012-10-23 10:24 ` [net-next 8/8] ixgbevf: Update version string Jeff Kirsher
2012-10-23 17:28 ` [net-next 0/8][pull request] Intel Wired LAN Driver Updates David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350987887-16161-4-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=carolyn.wyborny@intel.com \
--cc=davem@davemloft.net \
--cc=gospo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=sassmann@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).