Patchwork [net-next] stmmac: modified pcs mode support for SGMII

login
register
mail settings
Submitter Byungho An
Date April 4, 2013, 5:57 a.m.
Message ID <00b401ce30f9$3a628c50$af27a4f0$%an@samsung.com>
Download mbox | patch
Permalink /patch/233622/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Byungho An - April 4, 2013, 5:57 a.m.
This patch modifies the pcs mode support for SGMII. Even though
SGMII does auto-negotiation with phy, it needs stmmac_init_phy and
stmmac_mdio_register function for initializing phy.

Signed-off-by: Byungho An <bh74.an@samsung.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

                if (ret < 0) {
@@ -2677,7 +2680,8 @@ int stmmac_dvr_remove(struct net_device *ndev)
        priv->hw->dma->stop_tx(priv->ioaddr);

        stmmac_set_mac(priv->ioaddr, false);
-       if (!priv->pcs)
+       if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs != STMMAC_PCS_TBI &&
+           priv->pcs != STMMAC_PCS_RTBI)
                stmmac_mdio_unregister(ndev);
        netif_carrier_off(ndev);
        unregister_netdev(ndev);
--
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - April 7, 2013, 9:08 p.m.
From: Byungho An <bh74.an@samsung.com>
Date: Thu, 04 Apr 2013 14:57:01 +0900

> This patch modifies the pcs mode support for SGMII. Even though
> SGMII does auto-negotiation with phy, it needs stmmac_init_phy and
> stmmac_mdio_register function for initializing phy.
> 
> Signed-off-by: Byungho An <bh74.an@samsung.com>

Your email client corrupted this patch, it turned all TAB characters
into spaces.  This makes your submission unusable.

Please fix this, email the patch to yourself, and only resubmit the
patch here if you are able to successfully apply the patch you receive
in a test email.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Byungho An - April 8, 2013, 3:56 a.m.
I fixed and resent this patch.

Thank you.

> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Monday, April 08, 2013 6:09 AM
> To: bh74.an@samsung.com
> Cc: netdev@vger.kernel.org; peppe.cavallaro@st.com; kgene.kim@samsung.com; cpgs@samsung.com
> Subject: Re: [net-next] stmmac: modified pcs mode support for SGMII
> 
> From: Byungho An <bh74.an@samsung.com>
> Date: Thu, 04 Apr 2013 14:57:01 +0900
> 
> > This patch modifies the pcs mode support for SGMII. Even though
> > SGMII does auto-negotiation with phy, it needs stmmac_init_phy and
> > stmmac_mdio_register function for initializing phy.
> >
> > Signed-off-by: Byungho An <bh74.an@samsung.com>
> 
> Your email client corrupted this patch, it turned all TAB characters
> into spaces.  This makes your submission unusable.
> 
> Please fix this, email the patch to yourself, and only resubmit the
> patch here if you are able to successfully apply the patch you receive
> in a test email.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 6b26d31..3ac9bd7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1504,7 +1504,8 @@  static int stmmac_open(struct net_device *dev)

        stmmac_check_ether_addr(priv);

-       if (!priv->pcs) {
+       if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs != STMMAC_PCS_TBI &&
+           priv->pcs != STMMAC_PCS_RTBI) {
                ret = stmmac_init_phy(dev);
                if (ret) {
                        pr_err("%s: Cannot attach to PHY (error: %d)\n",
@@ -1607,7 +1608,8 @@  static int stmmac_open(struct net_device *dev)
        /* Using PCS we cannot dial with the phy registers at this stage
         * so we do not support extra feature like EEE.
         */
-       if (!priv->pcs)
+       if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs != STMMAC_PCS_TBI &&
+           priv->pcs != STMMAC_PCS_RTBI)
                priv->eee_enabled = stmmac_eee_init(priv);

        stmmac_init_tx_coalesce(priv);
@@ -2637,7 +2639,8 @@  struct stmmac_priv *stmmac_dvr_probe(struct device
*device,

        stmmac_check_pcs_mode(priv);

-       if (!priv->pcs) {
+       if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs != STMMAC_PCS_TBI &&
+           priv->pcs != STMMAC_PCS_RTBI) {
                /* MDIO bus Registration */
                ret = stmmac_mdio_register(ndev);