ixgbe: Remove MAC X550EM_X 1Gbase-t led_[on|off] support
authorPaul Greenwalt <paul.greenwalt@intel.com>
Fri, 21 Apr 2017 09:37:13 +0000 (05:37 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 31 May 2017 11:31:43 +0000 (04:31 -0700)
Since FW configures the PHY and MAC X550EM_X has no
PHY access, led_[on|off] is not supported with the 1Gbase-t design.

Removed MAC X550EM_X 1Gbase-t led_[on|off] support by setting
function pointers to NULL and added NULL pointer checks. Also set
init_led_link_act to NULL and added NULL pointer check.

Signed-off-by: Paul Greenwalt <paul.greenwalt@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c

index c38d50c1fcf783fdd83782c3380c14cdb0c4dd9d..3af6127f0d44b3a0eb36e24c9958a75e61409681 100644 (file)
@@ -395,7 +395,8 @@ s32 ixgbe_init_hw_generic(struct ixgbe_hw *hw)
        }
 
        /* Initialize the LED link active for LED blink support */
-       hw->mac.ops.init_led_link_act(hw);
+       if (hw->mac.ops.init_led_link_act)
+               hw->mac.ops.init_led_link_act(hw);
 
        return status;
 }
index 7e5e336d7dcc0ec297a300e984fbb4ecda40be34..cced74dd5a63395f778b219ab9453bdcb1e1aab5 100644 (file)
@@ -2254,6 +2254,9 @@ static int ixgbe_set_phys_id(struct net_device *netdev,
        struct ixgbe_adapter *adapter = netdev_priv(netdev);
        struct ixgbe_hw *hw = &adapter->hw;
 
+       if (!hw->mac.ops.led_on || !hw->mac.ops.led_off)
+               return -EOPNOTSUPP;
+
        switch (state) {
        case ETHTOOL_ID_ACTIVE:
                adapter->led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
index 2ba024b575ea84f619d719e7bb25676e9534a478..50aaa2bd3c818458b1d7982c079e901c246cfb4d 100644 (file)
@@ -3206,6 +3206,7 @@ static s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
                phy->ops.setup_link = NULL;
                phy->ops.read_reg = NULL;
                phy->ops.write_reg = NULL;
+               phy->ops.reset = NULL;
                break;
        default:
                break;
@@ -3819,6 +3820,28 @@ static const struct ixgbe_mac_operations mac_ops_X550EM_x = {
        .write_iosf_sb_reg      = ixgbe_write_iosf_sb_reg_x550,
 };
 
+static const struct ixgbe_mac_operations mac_ops_X550EM_x_fw = {
+       X550_COMMON_MAC
+       .led_on                 = NULL,
+       .led_off                = NULL,
+       .init_led_link_act      = NULL,
+       .reset_hw               = &ixgbe_reset_hw_X550em,
+       .get_media_type         = &ixgbe_get_media_type_X550em,
+       .get_san_mac_addr       = NULL,
+       .get_wwn_prefix         = NULL,
+       .setup_link             = &ixgbe_setup_mac_link_X540,
+       .get_link_capabilities  = &ixgbe_get_link_capabilities_X550em,
+       .get_bus_info           = &ixgbe_get_bus_info_X550em,
+       .setup_sfp              = ixgbe_setup_sfp_modules_X550em,
+       .acquire_swfw_sync      = &ixgbe_acquire_swfw_sync_X550em,
+       .release_swfw_sync      = &ixgbe_release_swfw_sync_X550em,
+       .init_swfw_sync         = &ixgbe_init_swfw_sync_X540,
+       .setup_fc               = NULL,
+       .fc_autoneg             = ixgbe_fc_autoneg,
+       .read_iosf_sb_reg       = ixgbe_read_iosf_sb_reg_x550,
+       .write_iosf_sb_reg      = ixgbe_write_iosf_sb_reg_x550,
+};
+
 static struct ixgbe_mac_operations mac_ops_x550em_a = {
        X550_COMMON_MAC
        .led_on                 = ixgbe_led_on_t_x550em,
@@ -3986,7 +4009,7 @@ const struct ixgbe_info ixgbe_X550EM_x_info = {
 const struct ixgbe_info ixgbe_x550em_x_fw_info = {
        .mac                    = ixgbe_mac_X550EM_x,
        .get_invariants         = ixgbe_get_invariants_X550_x_fw,
-       .mac_ops                = &mac_ops_X550EM_x,
+       .mac_ops                = &mac_ops_X550EM_x_fw,
        .eeprom_ops             = &eeprom_ops_X550EM_x,
        .phy_ops                = &phy_ops_x550em_x_fw,
        .mbx_ops                = &mbx_ops_generic,