]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/igb/e1000_82575.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[mv-sheeva.git] / drivers / net / igb / e1000_82575.c
index 187622f1c81611f3b5b269c7c730610460c03210..0a2368fa6bc660906b2120a84e69570e4c1962d7 100644 (file)
@@ -132,6 +132,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
        case E1000_DEV_ID_82580_SERDES:
        case E1000_DEV_ID_82580_SGMII:
        case E1000_DEV_ID_82580_COPPER_DUAL:
+       case E1000_DEV_ID_DH89XXCC_SGMII:
+       case E1000_DEV_ID_DH89XXCC_SERDES:
+       case E1000_DEV_ID_DH89XXCC_BACKPLANE:
+       case E1000_DEV_ID_DH89XXCC_SFP:
                mac->type = e1000_82580;
                break;
        case E1000_DEV_ID_I350_COPPER:
@@ -282,10 +286,18 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
 
        /* Verify phy id and set remaining function pointers */
        switch (phy->id) {
+       case I347AT4_E_PHY_ID:
+       case M88E1112_E_PHY_ID:
        case M88E1111_I_PHY_ID:
                phy->type                   = e1000_phy_m88;
                phy->ops.get_phy_info       = igb_get_phy_info_m88;
-               phy->ops.get_cable_length   = igb_get_cable_length_m88;
+
+               if (phy->id == I347AT4_E_PHY_ID ||
+                   phy->id == M88E1112_E_PHY_ID)
+                       phy->ops.get_cable_length = igb_get_cable_length_m88_gen2;
+               else
+                       phy->ops.get_cable_length = igb_get_cable_length_m88;
+
                phy->ops.force_speed_duplex = igb_phy_force_speed_duplex_m88;
                break;
        case IGP03E1000_E_PHY_ID:
@@ -1058,7 +1070,11 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw)
        }
        switch (hw->phy.type) {
        case e1000_phy_m88:
-               ret_val = igb_copper_link_setup_m88(hw);
+               if (hw->phy.id == I347AT4_E_PHY_ID ||
+                   hw->phy.id == M88E1112_E_PHY_ID)
+                       ret_val = igb_copper_link_setup_m88_gen2(hw);
+               else
+                       ret_val = igb_copper_link_setup_m88(hw);
                break;
        case e1000_phy_igp_3:
                ret_val = igb_copper_link_setup_igp(hw);
@@ -1463,6 +1479,39 @@ out:
        return ret_val;
 }
 
+/**
+ *  igb_vmdq_set_anti_spoofing_pf - enable or disable anti-spoofing
+ *  @hw: pointer to the hardware struct
+ *  @enable: state to enter, either enabled or disabled
+ *  @pf: Physical Function pool - do not set anti-spoofing for the PF
+ *
+ *  enables/disables L2 switch anti-spoofing functionality.
+ **/
+void igb_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf)
+{
+       u32 dtxswc;
+
+       switch (hw->mac.type) {
+       case e1000_82576:
+       case e1000_i350:
+               dtxswc = rd32(E1000_DTXSWC);
+               if (enable) {
+                       dtxswc |= (E1000_DTXSWC_MAC_SPOOF_MASK |
+                                  E1000_DTXSWC_VLAN_SPOOF_MASK);
+                       /* The PF can spoof - it has to in order to
+                        * support emulation mode NICs */
+                       dtxswc ^= (1 << pf | 1 << (pf + MAX_NUM_VFS));
+               } else {
+                       dtxswc &= ~(E1000_DTXSWC_MAC_SPOOF_MASK |
+                                   E1000_DTXSWC_VLAN_SPOOF_MASK);
+               }
+               wr32(E1000_DTXSWC, dtxswc);
+               break;
+       default:
+               break;
+       }
+}
+
 /**
  *  igb_vmdq_set_loopback_pf - enable or disable vmdq loopback
  *  @hw: pointer to the hardware struct
@@ -1564,7 +1613,7 @@ static s32 igb_reset_mdicnfg_82580(struct e1000_hw *hw)
 {
        s32 ret_val = 0;
        u32 mdicnfg;
-       u16 nvm_data;
+       u16 nvm_data = 0;
 
        if (hw->mac.type != e1000_82580)
                goto out;