]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/igb/e1000_mac.c
drivers/net: Remove unnecessary returns from void function()s
[karo-tx-linux.git] / drivers / net / igb / e1000_mac.c
index 2a8a886b37eb698bfed13f145b3e677cf363e9c2..90c5e01e9235875ba6b954e31ab3a52cbcee9fb1 100644 (file)
@@ -53,17 +53,30 @@ s32 igb_get_bus_info_pcie(struct e1000_hw *hw)
        u16 pcie_link_status;
 
        bus->type = e1000_bus_type_pci_express;
-       bus->speed = e1000_bus_speed_2500;
 
        ret_val = igb_read_pcie_cap_reg(hw,
-                                         PCIE_LINK_STATUS,
-                                         &pcie_link_status);
-       if (ret_val)
+                                       PCI_EXP_LNKSTA,
+                                       &pcie_link_status);
+       if (ret_val) {
                bus->width = e1000_bus_width_unknown;
-       else
+               bus->speed = e1000_bus_speed_unknown;
+       } else {
+               switch (pcie_link_status & PCI_EXP_LNKSTA_CLS) {
+               case PCI_EXP_LNKSTA_CLS_2_5GB:
+                       bus->speed = e1000_bus_speed_2500;
+                       break;
+               case PCI_EXP_LNKSTA_CLS_5_0GB:
+                       bus->speed = e1000_bus_speed_5000;
+                       break;
+               default:
+                       bus->speed = e1000_bus_speed_unknown;
+                       break;
+               }
+
                bus->width = (enum e1000_bus_width)((pcie_link_status &
-                                                    PCIE_LINK_WIDTH_MASK) >>
-                                                    PCIE_LINK_WIDTH_SHIFT);
+                                                    PCI_EXP_LNKSTA_NLW) >>
+                                                    PCI_EXP_LNKSTA_NLW_SHIFT);
+       }
 
        reg = rd32(E1000_STATUS);
        bus->func = (reg & E1000_STATUS_FUNC_MASK) >> E1000_STATUS_FUNC_SHIFT;
@@ -1367,7 +1380,8 @@ out:
  *  igb_enable_mng_pass_thru - Enable processing of ARP's
  *  @hw: pointer to the HW structure
  *
- *  Verifies the hardware needs to allow ARPs to be processed by the host.
+ *  Verifies the hardware needs to leave interface enabled so that frames can
+ *  be directed to and from the management interface.
  **/
 bool igb_enable_mng_pass_thru(struct e1000_hw *hw)
 {
@@ -1380,8 +1394,7 @@ bool igb_enable_mng_pass_thru(struct e1000_hw *hw)
 
        manc = rd32(E1000_MANC);
 
-       if (!(manc & E1000_MANC_RCV_TCO_EN) ||
-           !(manc & E1000_MANC_EN_MAC_ADDR_FILTER))
+       if (!(manc & E1000_MANC_RCV_TCO_EN))
                goto out;
 
        if (hw->mac.arc_subsystem_valid) {