]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: Blink LED on 1G BaseT boards
authorHenry Tieman <henry.w.tieman@intel.com>
Tue, 8 Nov 2016 21:05:18 +0000 (13:05 -0800)
committerDhaval Giani <dhaval.giani@oracle.com>
Wed, 8 Mar 2017 00:41:35 +0000 (19:41 -0500)
Orabug: 24568124

Before this patch "ethtool -p" was not blinking the LEDs on boards
with 1G BaseT PHYs.

This commit identifies 1G BaseT boards as having the LEDs connected
to the MAC. Also, renamed the flag to be more descriptive of usage.
The flag is now I40E_FLAG_PHY_CONTROLS_LEDS.

Change-ID: I4eb741da9780da7849ddf2dc4c0cb27ffa42a801
Signed-off-by: Henry Tieman <henry.w.tieman@intel.com>
Signed-off-by: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4f9b4307543567b69d03806932c61dcda7f62ca0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
drivers/net/ethernet/intel/i40e/i40e_main.c

index 4933c7b54ad95a78cce687cb1ac831299bc7f75a..7c5646b077779c880ccd2ec815f26f0a2eb72a90 100644 (file)
@@ -356,7 +356,7 @@ struct i40e_pf {
 #define I40E_FLAG_NO_DCB_SUPPORT               BIT_ULL(45)
 #define I40E_FLAG_USE_SET_LLDP_MIB             BIT_ULL(46)
 #define I40E_FLAG_STOP_FW_LLDP                 BIT_ULL(47)
-#define I40E_FLAG_HAVE_10GBASET_PHY            BIT_ULL(48)
+#define I40E_FLAG_PHY_CONTROLS_LEDS            BIT_ULL(48)
 #define I40E_FLAG_PF_MAC                       BIT_ULL(50)
 #define I40E_FLAG_TRUE_PROMISC_SUPPORT         BIT_ULL(51)
 #define I40E_FLAG_HAVE_CRT_RETIMER             BIT_ULL(52)
index e3d8021fe60fcc707deaf1df981c816f3c209c84..832415407f4098ece25f823e8d3c6c3f306795ce 100644 (file)
@@ -1884,7 +1884,7 @@ static int i40e_set_phys_id(struct net_device *netdev,
 
        switch (state) {
        case ETHTOOL_ID_ACTIVE:
-               if (!(pf->flags & I40E_FLAG_HAVE_10GBASET_PHY)) {
+               if (!(pf->flags & I40E_FLAG_PHY_CONTROLS_LEDS)) {
                        pf->led_status = i40e_led_get(hw);
                } else {
                        i40e_aq_set_phy_debug(hw, I40E_PHY_DEBUG_ALL, NULL);
@@ -1894,20 +1894,20 @@ static int i40e_set_phys_id(struct net_device *netdev,
                }
                return blink_freq;
        case ETHTOOL_ID_ON:
-               if (!(pf->flags & I40E_FLAG_HAVE_10GBASET_PHY))
+               if (!(pf->flags & I40E_FLAG_PHY_CONTROLS_LEDS))
                        i40e_led_set(hw, 0xf, false);
                else
                        ret = i40e_led_set_phy(hw, true, pf->led_status, 0);
                break;
        case ETHTOOL_ID_OFF:
-               if (!(pf->flags & I40E_FLAG_HAVE_10GBASET_PHY))
+               if (!(pf->flags & I40E_FLAG_PHY_CONTROLS_LEDS))
                        i40e_led_set(hw, 0x0, false);
                else
                        ret = i40e_led_set_phy(hw, false, pf->led_status, 0);
                break;
        case ETHTOOL_ID_INACTIVE:
-               if (!(pf->flags & I40E_FLAG_HAVE_10GBASET_PHY)) {
-                       i40e_led_set(hw, false, pf->led_status);
+               if (!(pf->flags & I40E_FLAG_PHY_CONTROLS_LEDS)) {
+                       i40e_led_set(hw, pf->led_status, false);
                } else {
                        ret = i40e_led_set_phy(hw, false, pf->led_status,
                                               (pf->phy_led_val |
index c3ae48d0463680c6f385c7c434aea8b293e36370..60530b92cd6ca1bb1401c81d7c2cfa00010a37b7 100644 (file)
@@ -11269,8 +11269,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                                                       pf->main_vsi_seid);
 
        if ((pf->hw.device_id == I40E_DEV_ID_10G_BASE_T) ||
-           (pf->hw.device_id == I40E_DEV_ID_10G_BASE_T4))
-               pf->flags |= I40E_FLAG_HAVE_10GBASET_PHY;
+               (pf->hw.device_id == I40E_DEV_ID_10G_BASE_T4))
+               pf->flags |= I40E_FLAG_PHY_CONTROLS_LEDS;
        if (pf->hw.device_id == I40E_DEV_ID_SFP_I_X722)
                pf->flags |= I40E_FLAG_HAVE_CRT_RETIMER;
        /* print a string summarizing features */