igb: Implementation of i210/i211 LED support
authorAkeem G. Abodunrin <akeem.g.abodunrin@intel.com>
Wed, 1 May 2013 05:44:45 +0000 (05:44 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 21 May 2013 10:01:58 +0000 (03:01 -0700)
This patch fixes LED issues with i210 and i211 devices, due to changes in the
device registers.

Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/e1000_i210.h
drivers/net/ethernet/intel/igb/e1000_mac.c

index bfc08e05c90741849d3445cbca337f98d466db2d..5caa332e7556628806491b186ada8e43ec88abf0 100644 (file)
@@ -82,11 +82,11 @@ enum E1000_INVM_STRUCTURE_TYPE {
 #define E1000_INVM_MAJOR_SHIFT         4
 
 #define ID_LED_DEFAULT_I210            ((ID_LED_OFF1_ON2  << 8) | \
-                                        (ID_LED_OFF1_OFF2 <<  4) | \
-                                        (ID_LED_DEF1_DEF2))
+                                        (ID_LED_DEF1_DEF2 <<  4) | \
+                                        (ID_LED_OFF1_OFF2))
 #define ID_LED_DEFAULT_I210_SERDES     ((ID_LED_DEF1_DEF2 << 8) | \
                                         (ID_LED_DEF1_DEF2 <<  4) | \
-                                        (ID_LED_DEF1_DEF2))
+                                        (ID_LED_OFF1_ON2))
 
 /* NVM offset defaults for i211 device */
 #define NVM_INIT_CTRL_2_DEFAULT_I211   0X7243
index 660b7addfbb0514356a37367921c1bb8ccdce9cd..bab556a47fcc48cdb7d90a044f582ef18c335be0 100644 (file)
@@ -1332,7 +1332,13 @@ s32 igb_id_led_init(struct e1000_hw *hw)
        u16 data, i, temp;
        const u16 led_mask = 0x0F;
 
-       ret_val = igb_valid_led_default(hw, &data);
+       /* i210 and i211 devices have different LED mechanism */
+       if ((hw->mac.type == e1000_i210) ||
+           (hw->mac.type == e1000_i211))
+               ret_val = igb_valid_led_default_i210(hw, &data);
+       else
+               ret_val = igb_valid_led_default(hw, &data);
+
        if (ret_val)
                goto out;