Skip to content

Commit

Permalink
DEBUG: net: e1000e: Add debug output
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Färber <afaerber@suse.de>
  • Loading branch information
afaerber committed Sep 16, 2020
1 parent fc13f30 commit 43309e0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
9 changes: 7 additions & 2 deletions drivers/net/ethernet/intel/e1000e/82571.c
Expand Up @@ -47,6 +47,8 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
struct e1000_phy_info *phy = &hw->phy;
s32 ret_val;

pr_info("%s\n", __func__);

if (hw->phy.media_type != e1000_media_type_copper) {
phy->type = e1000_phy_none;
return 0;
Expand Down Expand Up @@ -76,13 +78,14 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82574;
break;
default:
pr_info("Unexpected MAC type 0x%x\n", hw->mac.type);
return -E1000_ERR_PHY;
}

/* This can only be done after all function pointers are setup. */
ret_val = e1000_get_phy_id_82571(hw);
if (ret_val) {
e_dbg("Error getting PHY ID\n");
pr_info("Error getting PHY ID\n");
return ret_val;
}

Expand All @@ -108,7 +111,7 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
}

if (ret_val)
e_dbg("PHY ID unknown: type = 0x%08x\n", phy->id);
pr_info("PHY ID unknown: type = 0x%08x\n", phy->id);

return ret_val;
}
Expand Down Expand Up @@ -318,6 +321,8 @@ static s32 e1000_get_variants_82571(struct e1000_adapter *adapter)
int is_port_b = er32(STATUS) & E1000_STATUS_FUNC_1;
s32 rc;

pci_info(pdev, "%s\n", __func__);

rc = e1000_init_mac_params_82571(hw);
if (rc)
return rc;
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/intel/e1000e/netdev.c
Expand Up @@ -7445,6 +7445,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

/* setup adapter struct */
err = e1000_sw_init(adapter);
pci_info(pdev, "%s: e1000_sw_init = %d\n", __func__, err);
if (err)
goto err_sw_init;

Expand All @@ -7453,6 +7454,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
memcpy(&hw->phy.ops, ei->phy_ops, sizeof(hw->phy.ops));

err = ei->get_variants(adapter);
pci_info(pdev, "%s: get_variants = %d\n", __func__, err);
if (err)
goto err_hw_init;

Expand Down Expand Up @@ -7631,6 +7633,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

strlcpy(netdev->name, "eth%d", sizeof(netdev->name));
err = register_netdev(netdev);
pci_info(pdev, "%s: register_netdev = %d\n", __func__, err);
if (err)
goto err_register;

Expand Down
11 changes: 7 additions & 4 deletions drivers/net/ethernet/intel/e1000e/phy.c
Expand Up @@ -120,8 +120,10 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
struct e1000_phy_info *phy = &hw->phy;
u32 i, mdic = 0;

pr_info("%s\n", __func__);

if (offset > MAX_PHY_REG_ADDRESS) {
e_dbg("PHY Address %d is out of range\n", offset);
pr_err("PHY Address %d is out of range\n", offset);
return -E1000_ERR_PARAM;
}

Expand All @@ -145,16 +147,17 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
if (mdic & E1000_MDIC_READY)
break;
}
pr_info("%s mdic = 0x%08x\n", __func__, mdic);
if (!(mdic & E1000_MDIC_READY)) {
e_dbg("MDI Read did not complete\n");
pr_info("MDI Read did not complete\n");
return -E1000_ERR_PHY;
}
if (mdic & E1000_MDIC_ERROR) {
e_dbg("MDI Error\n");
pr_info("MDI Error\n");
return -E1000_ERR_PHY;
}
if (((mdic & E1000_MDIC_REG_MASK) >> E1000_MDIC_REG_SHIFT) != offset) {
e_dbg("MDI Read offset error - requested %d, returned %d\n",
pr_info("MDI Read offset error - requested %d, returned %d\n",
offset,
(mdic & E1000_MDIC_REG_MASK) >> E1000_MDIC_REG_SHIFT);
return -E1000_ERR_PHY;
Expand Down

0 comments on commit 43309e0

Please sign in to comment.