igb: make dev_spec a union and remove dynamic allocation
[deliverable/linux.git] / drivers / net / igb / e1000_mac.c
index e18747c70becb6521b58f046d7e740e45f410408..16fa0833368c5fdd009ddaba4528cb4224ac2b2a 100644 (file)
 static s32 igb_set_default_fc(struct e1000_hw *hw);
 static s32 igb_set_fc_watermarks(struct e1000_hw *hw);
 
-/**
- *  igb_remove_device - Free device specific structure
- *  @hw: pointer to the HW structure
- *
- *  If a device specific structure was allocated, this function will
- *  free it.
- **/
-void igb_remove_device(struct e1000_hw *hw)
-{
-       /* Freeing the dev_spec member of e1000_hw structure */
-       kfree(hw->dev_spec);
-}
-
-static void igb_read_pci_cfg(struct e1000_hw *hw, u32 reg, u16 *value)
-{
-       struct igb_adapter *adapter = hw->back;
-
-       pci_read_config_word(adapter->pdev, reg, value);
-}
-
 static s32 igb_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
 {
        struct igb_adapter *adapter = hw->back;
@@ -83,8 +63,8 @@ s32 igb_get_bus_info_pcie(struct e1000_hw *hw)
 {
        struct e1000_bus_info *bus = &hw->bus;
        s32 ret_val;
-       u32 status;
-       u16 pcie_link_status, pci_header_type;
+       u32 reg;
+       u16 pcie_link_status;
 
        bus->type = e1000_bus_type_pci_express;
        bus->speed = e1000_bus_speed_2500;
@@ -99,14 +79,8 @@ s32 igb_get_bus_info_pcie(struct e1000_hw *hw)
                                                     PCIE_LINK_WIDTH_MASK) >>
                                                     PCIE_LINK_WIDTH_SHIFT);
 
-       igb_read_pci_cfg(hw, PCI_HEADER_TYPE_REGISTER, &pci_header_type);
-       if (pci_header_type & PCI_HEADER_TYPE_MULTIFUNC) {
-               status = rd32(E1000_STATUS);
-               bus->func = (status & E1000_STATUS_FUNC_MASK)
-                           >> E1000_STATUS_FUNC_SHIFT;
-       } else {
-               bus->func = 0;
-       }
+       reg = rd32(E1000_STATUS);
+       bus->func = (reg & E1000_STATUS_FUNC_MASK) >> E1000_STATUS_FUNC_SHIFT;
 
        return 0;
 }
@@ -229,8 +203,8 @@ void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
        if (!hw->mac.disable_av)
                rar_high |= E1000_RAH_AV;
 
-       array_wr32(E1000_RA, (index << 1), rar_low);
-       array_wr32(E1000_RA, ((index << 1) + 1), rar_high);
+       wr32(E1000_RAL(index), rar_low);
+       wr32(E1000_RAH(index), rar_high);
 }
 
 /**
This page took 0.025264 seconds and 5 git commands to generate.