@@ -730,39 +730,61 @@ s32 ixgbe_setup_phy_link_speed_generic(struct ixgbe_hw *hw,
730
730
}
731
731
732
732
/**
733
- * ixgbe_get_copper_link_capabilities_generic - Determines link capabilities
733
+ * ixgbe_get_copper_speeds_supported - Get copper link speed from phy
734
734
* @hw: pointer to hardware structure
735
- * @speed: pointer to link speed
736
- * @autoneg: boolean auto-negotiation value
737
735
*
738
- * Determines the link capabilities by reading the AUTOC register.
736
+ * Determines the supported link capabilities by reading the PHY auto
737
+ * negotiation register.
739
738
*/
740
- s32 ixgbe_get_copper_link_capabilities_generic (struct ixgbe_hw * hw ,
741
- ixgbe_link_speed * speed ,
742
- bool * autoneg )
739
+ static s32 ixgbe_get_copper_speeds_supported (struct ixgbe_hw * hw )
743
740
{
744
- s32 status ;
745
741
u16 speed_ability ;
746
-
747
- * speed = 0 ;
748
- * autoneg = true;
742
+ s32 status ;
749
743
750
744
status = hw -> phy .ops .read_reg (hw , MDIO_SPEED , MDIO_MMD_PMAPMD ,
751
745
& speed_ability );
746
+ if (status )
747
+ return status ;
752
748
753
- if (status == 0 ) {
754
- if (speed_ability & MDIO_SPEED_10G )
755
- * speed |= IXGBE_LINK_SPEED_10GB_FULL ;
756
- if (speed_ability & MDIO_PMA_SPEED_1000 )
757
- * speed |= IXGBE_LINK_SPEED_1GB_FULL ;
758
- if (speed_ability & MDIO_PMA_SPEED_100 )
759
- * speed |= IXGBE_LINK_SPEED_100_FULL ;
749
+ if (speed_ability & MDIO_SPEED_10G )
750
+ hw -> phy .speeds_supported |= IXGBE_LINK_SPEED_10GB_FULL ;
751
+ if (speed_ability & MDIO_PMA_SPEED_1000 )
752
+ hw -> phy .speeds_supported |= IXGBE_LINK_SPEED_1GB_FULL ;
753
+ if (speed_ability & MDIO_PMA_SPEED_100 )
754
+ hw -> phy .speeds_supported |= IXGBE_LINK_SPEED_100_FULL ;
755
+
756
+ switch (hw -> mac .type ) {
757
+ case ixgbe_mac_X550 :
758
+ hw -> phy .speeds_supported |= IXGBE_LINK_SPEED_2_5GB_FULL ;
759
+ hw -> phy .speeds_supported |= IXGBE_LINK_SPEED_5GB_FULL ;
760
+ break ;
761
+ case ixgbe_mac_X550EM_x :
762
+ hw -> phy .speeds_supported &= ~IXGBE_LINK_SPEED_100_FULL ;
763
+ break ;
764
+ default :
765
+ break ;
760
766
}
761
767
762
- /* Internal PHY does not support 100 Mbps */
763
- if (hw -> mac .type == ixgbe_mac_X550EM_x )
764
- * speed &= ~IXGBE_LINK_SPEED_100_FULL ;
768
+ return 0 ;
769
+ }
770
+
771
+ /**
772
+ * ixgbe_get_copper_link_capabilities_generic - Determines link capabilities
773
+ * @hw: pointer to hardware structure
774
+ * @speed: pointer to link speed
775
+ * @autoneg: boolean auto-negotiation value
776
+ */
777
+ s32 ixgbe_get_copper_link_capabilities_generic (struct ixgbe_hw * hw ,
778
+ ixgbe_link_speed * speed ,
779
+ bool * autoneg )
780
+ {
781
+ s32 status = 0 ;
782
+
783
+ * autoneg = true;
784
+ if (!hw -> phy .speeds_supported )
785
+ status = ixgbe_get_copper_speeds_supported (hw );
765
786
787
+ * speed = hw -> phy .speeds_supported ;
766
788
return status ;
767
789
}
768
790
0 commit comments