diff options
-rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 16 | ||||
-rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe.h | 5 |
2 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c index 072b9f664597..e3d361e242aa 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | |||
@@ -437,6 +437,9 @@ static void xgbe_an73_disable(struct xgbe_prv_data *pdata) | |||
437 | 437 | ||
438 | static void xgbe_an_restart(struct xgbe_prv_data *pdata) | 438 | static void xgbe_an_restart(struct xgbe_prv_data *pdata) |
439 | { | 439 | { |
440 | if (pdata->phy_if.phy_impl.an_pre) | ||
441 | pdata->phy_if.phy_impl.an_pre(pdata); | ||
442 | |||
440 | switch (pdata->an_mode) { | 443 | switch (pdata->an_mode) { |
441 | case XGBE_AN_MODE_CL73: | 444 | case XGBE_AN_MODE_CL73: |
442 | case XGBE_AN_MODE_CL73_REDRV: | 445 | case XGBE_AN_MODE_CL73_REDRV: |
@@ -453,6 +456,9 @@ static void xgbe_an_restart(struct xgbe_prv_data *pdata) | |||
453 | 456 | ||
454 | static void xgbe_an_disable(struct xgbe_prv_data *pdata) | 457 | static void xgbe_an_disable(struct xgbe_prv_data *pdata) |
455 | { | 458 | { |
459 | if (pdata->phy_if.phy_impl.an_post) | ||
460 | pdata->phy_if.phy_impl.an_post(pdata); | ||
461 | |||
456 | switch (pdata->an_mode) { | 462 | switch (pdata->an_mode) { |
457 | case XGBE_AN_MODE_CL73: | 463 | case XGBE_AN_MODE_CL73: |
458 | case XGBE_AN_MODE_CL73_REDRV: | 464 | case XGBE_AN_MODE_CL73_REDRV: |
@@ -637,11 +643,11 @@ static enum xgbe_an xgbe_an73_incompat_link(struct xgbe_prv_data *pdata) | |||
637 | return XGBE_AN_NO_LINK; | 643 | return XGBE_AN_NO_LINK; |
638 | } | 644 | } |
639 | 645 | ||
640 | xgbe_an73_disable(pdata); | 646 | xgbe_an_disable(pdata); |
641 | 647 | ||
642 | xgbe_switch_mode(pdata); | 648 | xgbe_switch_mode(pdata); |
643 | 649 | ||
644 | xgbe_an73_restart(pdata); | 650 | xgbe_an_restart(pdata); |
645 | 651 | ||
646 | return XGBE_AN_INCOMPAT_LINK; | 652 | return XGBE_AN_INCOMPAT_LINK; |
647 | } | 653 | } |
@@ -820,6 +826,9 @@ static void xgbe_an37_state_machine(struct xgbe_prv_data *pdata) | |||
820 | pdata->an_result = pdata->an_state; | 826 | pdata->an_result = pdata->an_state; |
821 | pdata->an_state = XGBE_AN_READY; | 827 | pdata->an_state = XGBE_AN_READY; |
822 | 828 | ||
829 | if (pdata->phy_if.phy_impl.an_post) | ||
830 | pdata->phy_if.phy_impl.an_post(pdata); | ||
831 | |||
823 | netif_dbg(pdata, link, pdata->netdev, "CL37 AN result: %s\n", | 832 | netif_dbg(pdata, link, pdata->netdev, "CL37 AN result: %s\n", |
824 | xgbe_state_as_string(pdata->an_result)); | 833 | xgbe_state_as_string(pdata->an_result)); |
825 | } | 834 | } |
@@ -903,6 +912,9 @@ again: | |||
903 | pdata->kx_state = XGBE_RX_BPA; | 912 | pdata->kx_state = XGBE_RX_BPA; |
904 | pdata->an_start = 0; | 913 | pdata->an_start = 0; |
905 | 914 | ||
915 | if (pdata->phy_if.phy_impl.an_post) | ||
916 | pdata->phy_if.phy_impl.an_post(pdata); | ||
917 | |||
906 | netif_dbg(pdata, link, pdata->netdev, "CL73 AN result: %s\n", | 918 | netif_dbg(pdata, link, pdata->netdev, "CL73 AN result: %s\n", |
907 | xgbe_state_as_string(pdata->an_result)); | 919 | xgbe_state_as_string(pdata->an_result)); |
908 | } | 920 | } |
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h index ad102c8bac7b..fa0b51ea1b95 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe.h +++ b/drivers/net/ethernet/amd/xgbe/xgbe.h | |||
@@ -833,6 +833,7 @@ struct xgbe_hw_if { | |||
833 | /* This structure represents implementation specific routines for an | 833 | /* This structure represents implementation specific routines for an |
834 | * implementation of a PHY. All routines are required unless noted below. | 834 | * implementation of a PHY. All routines are required unless noted below. |
835 | * Optional routines: | 835 | * Optional routines: |
836 | * an_pre, an_post | ||
836 | * kr_training_pre, kr_training_post | 837 | * kr_training_pre, kr_training_post |
837 | */ | 838 | */ |
838 | struct xgbe_phy_impl_if { | 839 | struct xgbe_phy_impl_if { |
@@ -875,6 +876,10 @@ struct xgbe_phy_impl_if { | |||
875 | /* Process results of auto-negotiation */ | 876 | /* Process results of auto-negotiation */ |
876 | enum xgbe_mode (*an_outcome)(struct xgbe_prv_data *); | 877 | enum xgbe_mode (*an_outcome)(struct xgbe_prv_data *); |
877 | 878 | ||
879 | /* Pre/Post auto-negotiation support */ | ||
880 | void (*an_pre)(struct xgbe_prv_data *); | ||
881 | void (*an_post)(struct xgbe_prv_data *); | ||
882 | |||
878 | /* Pre/Post KR training enablement support */ | 883 | /* Pre/Post KR training enablement support */ |
879 | void (*kr_training_pre)(struct xgbe_prv_data *); | 884 | void (*kr_training_pre)(struct xgbe_prv_data *); |
880 | void (*kr_training_post)(struct xgbe_prv_data *); | 885 | void (*kr_training_post)(struct xgbe_prv_data *); |