From: Wenzhuo Lu <wenzhuo.lu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 20/26] ixgbe/base: ixgbe_setup_internal_phy_x550em function clean-up
Date: Fri, 5 Jun 2015 13:21:52 +0800 [thread overview]
Message-ID: <1433481718-24253-21-git-send-email-wenzhuo.lu@intel.com> (raw)
In-Reply-To: <1433481718-24253-1-git-send-email-wenzhuo.lu@intel.com>
This patch cleans up the ixgbe_setup_internal_phy_ x550em() function as follows:
- Renames it to ixgbe_setup_internal_phy_t_x550em to clarify that it is
specific to copper
- Returns an error if called for non-copper devices
- Corrects the comments
- Removed the LASI(Link Alarm Status Interrupt) status register checks as
this was incorrect and never worked correctly anyway.
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
drivers/net/ixgbe/base/ixgbe_x550.c | 31 ++++++++++++-------------------
drivers/net/ixgbe/base/ixgbe_x550.h | 2 +-
2 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c
index 87942bb..669d0ce 100644
--- a/drivers/net/ixgbe/base/ixgbe_x550.c
+++ b/drivers/net/ixgbe/base/ixgbe_x550.c
@@ -1150,7 +1150,8 @@ s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
phy->ops.write_reg = ixgbe_write_phy_reg_x550em;
break;
case ixgbe_phy_x550em_ext_t:
- phy->ops.setup_internal_link = ixgbe_setup_internal_phy_x550em;
+ phy->ops.setup_internal_link =
+ ixgbe_setup_internal_phy_t_x550em;
phy->ops.enter_lplu = ixgbe_enter_lplu_t_x550em;
break;
default:
@@ -1537,35 +1538,27 @@ s32 ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw,
}
/**
- * ixgbe_setup_internal_phy_x550em - Configure integrated KR PHY
+ * ixgbe_setup_internal_phy_t_x550em - Configure KR PHY to X557 link
* @hw: point to hardware structure
*
- * Configures the integrated KR PHY to talk to the external PHY. The base
- * driver will call this function when it gets notification via interrupt from
- * the external PHY. This function forces the internal PHY into iXFI mode at
- * the correct speed.
+ * Configures the link between the integrated KR PHY and the external X557 PHY
+ * The driver will call this function when it gets a link status change
+ * interrupt from the X557 PHY. This function configures the link speed
+ * between the PHYs to match the link speed of the BASE-T link.
*
* A return of a non-zero value indicates an error, and the base driver should
* not report link up.
*/
-s32 ixgbe_setup_internal_phy_x550em(struct ixgbe_hw *hw)
+s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw)
{
u32 status;
- u16 lasi, autoneg_status, speed;
+ u16 autoneg_status, speed;
ixgbe_link_speed force_speed;
- /* Verify that the external link status has changed */
- status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_XENPAK_LASI_STATUS,
- IXGBE_MDIO_PMA_PMD_DEV_TYPE,
- &lasi);
- if (status != IXGBE_SUCCESS)
- return status;
-
- /* If there was no change in link status, we can just exit */
- if (!(lasi & IXGBE_XENPAK_LASI_LINK_STATUS_ALARM))
- return IXGBE_SUCCESS;
+ if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
+ return IXGBE_ERR_CONFIG;
- /* we read this twice back to back to indicate current status */
+ /* read this twice back to back to indicate current status */
status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
&autoneg_status);
diff --git a/drivers/net/ixgbe/base/ixgbe_x550.h b/drivers/net/ixgbe/base/ixgbe_x550.h
index a60c7ce..bd6ce9d 100644
--- a/drivers/net/ixgbe/base/ixgbe_x550.h
+++ b/drivers/net/ixgbe/base/ixgbe_x550.h
@@ -83,7 +83,7 @@ s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw);
s32 ixgbe_setup_kr_x550em(struct ixgbe_hw *hw);
s32 ixgbe_setup_kx4_x550em(struct ixgbe_hw *hw);
s32 ixgbe_init_ext_t_x550em(struct ixgbe_hw *hw);
-s32 ixgbe_setup_internal_phy_x550em(struct ixgbe_hw *hw);
+s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw);
s32 ixgbe_setup_phy_loopback_x550em(struct ixgbe_hw *hw);
u32 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw);
void ixgbe_disable_rx_x550(struct ixgbe_hw *hw);
--
1.9.3
next prev parent reply other threads:[~2015-06-05 5:22 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-05 5:21 [dpdk-dev] [PATCH 00/26] update ixgbe base driver Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 01/26] ixgbe/base: update copyright and readme Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 02/26] ixgbe/base: fix code comment, double from Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 03/26] ixgbe/base: fix typo error in code comment Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 04/26] ixgbe/base: check return value after calling Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 05/26] ixgbe/base: allow tunneled UDP and TCP frames to reach their destination Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 06/26] ixgbe/base: erase ixgbe_get_hi_status Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 07/26] ixgbe/base: provide unlocked I2C methods Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 08/26] ixgbe/base: reduce I2C retry count on X550 devices Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 09/26] ixgbe/base: issue firmware command when coming up Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 10/26] ixgbe/base: add logic to reset CS4227 when needed Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 11/26] ixgbe/base: restore ESDP settings after MAC reset Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 12/26] ixgbe/base: disable FEC(Forward Error Correction) to save power Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 13/26] ixgbe/base: set lan_id for non-PCIe devices Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 14/26] ixgbe/base: add SFP+ dual-speed support Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 15/26] ixgbe/base: add SW based LPLU support Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 16/26] ixgbe/base: fix flow control for KR backplane Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 17/26] ixgbe/base: new simplified x550em init flow Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 18/26] ixgbe/base: move I2C MUX function from ixgbe_x540.c to ixgbe_x550.c Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 19/26] ixgbe/base: change return value for ixgbe_setup_internal_phy_t_x550em Wenzhuo Lu
2015-06-05 5:21 ` Wenzhuo Lu [this message]
2015-06-05 5:21 ` [dpdk-dev] [PATCH 21/26] ixgbe/base: add x550em Auto neg Flow Control support Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 22/26] ixgbe/base: add x550em PHY interrupt and forced 1G/10G support Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 23/26] ixgbe/base: add link check support for x550em PHY Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 24/26] ixgbe/base: set lan_id before first I2C access Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 25/26] ixgbe/base: added x550em PHY reset function Wenzhuo Lu
2015-06-05 5:21 ` [dpdk-dev] [PATCH 26/26] ixgbe/base: block EEE(Energy Efficient Ethernet) setup on the interfaces that don't support EEE Wenzhuo Lu
2015-06-09 4:10 ` [dpdk-dev] [PATCH 00/26] update ixgbe base driver Zhang, Helin
2015-06-15 20:49 ` Thomas Monjalon
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=1433481718-24253-21-git-send-email-wenzhuo.lu@intel.com \
--to=wenzhuo.lu@intel.com \
--cc=dev@dpdk.org \
/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).