ixgbe: make device_caps() generic
authorEmil Tantilov <emil.s.tantilov@intel.com>
Thu, 31 Mar 2011 09:36:18 +0000 (09:36 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 14 Apr 2011 02:26:06 +0000 (19:26 -0700)
x540 has the same device capability word in the EEPROM as 82599.
This patch renames ixgbe_get_device_caps_82599 to
ixgbe_get_device_caps_generic, moves it to ixgbe_common.h and
sets up the function pointer for x540.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ixgbe/ixgbe_82599.c
drivers/net/ixgbe/ixgbe_common.c
drivers/net/ixgbe/ixgbe_common.h
drivers/net/ixgbe/ixgbe_x540.c

index 63b4da6b5b77741ebf31a919b6e519cdb7e8b70a..e4323055347b0f0e03a8d24ae77e260c0daa918c 100644 (file)
@@ -1972,21 +1972,6 @@ static s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval)
        return 0;
 }
 
-/**
- *  ixgbe_get_device_caps_82599 - Get additional device capabilities
- *  @hw: pointer to hardware structure
- *  @device_caps: the EEPROM word with the extra device capabilities
- *
- *  This function will read the EEPROM location for the device capabilities,
- *  and return the word through device_caps.
- **/
-static s32 ixgbe_get_device_caps_82599(struct ixgbe_hw *hw, u16 *device_caps)
-{
-       hw->eeprom.ops.read(hw, IXGBE_DEVICE_CAPS, device_caps);
-
-       return 0;
-}
-
 /**
  *  ixgbe_verify_fw_version_82599 - verify fw version for 82599
  *  @hw: pointer to hardware structure
@@ -2087,7 +2072,7 @@ static struct ixgbe_mac_operations mac_ops_82599 = {
        .enable_rx_dma          = &ixgbe_enable_rx_dma_82599,
        .get_mac_addr           = &ixgbe_get_mac_addr_generic,
        .get_san_mac_addr       = &ixgbe_get_san_mac_addr_generic,
-       .get_device_caps        = &ixgbe_get_device_caps_82599,
+       .get_device_caps        = &ixgbe_get_device_caps_generic,
        .get_wwn_prefix         = &ixgbe_get_wwn_prefix_generic,
        .stop_adapter           = &ixgbe_stop_adapter_generic,
        .get_bus_info           = &ixgbe_get_bus_info_generic,
index fc31e0256c18a6ab3f70d9e1eb73d25bc31ed276..cb2e8e18dd395ed1973ddb60b6a7d731e706701c 100644 (file)
@@ -2968,3 +2968,18 @@ void ixgbe_set_vlan_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf)
                pfvfspoof &= ~(1 << vf_target_shift);
        IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg), pfvfspoof);
 }
+
+/**
+ *  ixgbe_get_device_caps_generic - Get additional device capabilities
+ *  @hw: pointer to hardware structure
+ *  @device_caps: the EEPROM word with the extra device capabilities
+ *
+ *  This function will read the EEPROM location for the device capabilities,
+ *  and return the word through device_caps.
+ **/
+s32 ixgbe_get_device_caps_generic(struct ixgbe_hw *hw, u16 *device_caps)
+{
+       hw->eeprom.ops.read(hw, IXGBE_DEVICE_CAPS, device_caps);
+
+       return 0;
+}
index e18dc136ad341bc55bd7d599f22e9d7343a39b3e..e850adbb32a19069242393a2f24a99aaeafdc6f6 100644 (file)
@@ -90,6 +90,7 @@ s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index);
 s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index);
 void ixgbe_set_mac_anti_spoofing(struct ixgbe_hw *hw, bool enable, int pf);
 void ixgbe_set_vlan_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf);
+s32 ixgbe_get_device_caps_generic(struct ixgbe_hw *hw, u16 *device_caps);
 
 #define IXGBE_WRITE_REG(a, reg, value) writel((value), ((a)->hw_addr + (reg)))
 
index 5433f15c1e1bd91b40d68fbef42914a80fabd526..05f8e9cddef466c75c6434d2b58464fd2fd5dde2 100644 (file)
@@ -754,7 +754,7 @@ static struct ixgbe_mac_operations mac_ops_X540 = {
        .enable_rx_dma          = &ixgbe_enable_rx_dma_generic,
        .get_mac_addr           = &ixgbe_get_mac_addr_generic,
        .get_san_mac_addr       = &ixgbe_get_san_mac_addr_generic,
-       .get_device_caps        = NULL,
+       .get_device_caps        = &ixgbe_get_device_caps_generic,
        .get_wwn_prefix         = &ixgbe_get_wwn_prefix_generic,
        .stop_adapter           = &ixgbe_stop_adapter_generic,
        .get_bus_info           = &ixgbe_get_bus_info_generic,