aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 2f8dbbbd7a86..62c59eda1239 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -8652,6 +8652,7 @@ u32 bnx2x_send_unload_req(struct bnx2x *bp, int unload_mode)
8652 else if (bp->wol) { 8652 else if (bp->wol) {
8653 u32 emac_base = port ? GRCBASE_EMAC1 : GRCBASE_EMAC0; 8653 u32 emac_base = port ? GRCBASE_EMAC1 : GRCBASE_EMAC0;
8654 u8 *mac_addr = bp->dev->dev_addr; 8654 u8 *mac_addr = bp->dev->dev_addr;
8655 struct pci_dev *pdev = bp->pdev;
8655 u32 val; 8656 u32 val;
8656 u16 pmc; 8657 u16 pmc;
8657 8658
@@ -8668,9 +8669,9 @@ u32 bnx2x_send_unload_req(struct bnx2x *bp, int unload_mode)
8668 EMAC_WR(bp, EMAC_REG_EMAC_MAC_MATCH + entry + 4, val); 8669 EMAC_WR(bp, EMAC_REG_EMAC_MAC_MATCH + entry + 4, val);
8669 8670
8670 /* Enable the PME and clear the status */ 8671 /* Enable the PME and clear the status */
8671 pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pmc); 8672 pci_read_config_word(pdev, pdev->pm_cap + PCI_PM_CTRL, &pmc);
8672 pmc |= PCI_PM_CTRL_PME_ENABLE | PCI_PM_CTRL_PME_STATUS; 8673 pmc |= PCI_PM_CTRL_PME_ENABLE | PCI_PM_CTRL_PME_STATUS;
8673 pci_write_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, pmc); 8674 pci_write_config_word(pdev, pdev->pm_cap + PCI_PM_CTRL, pmc);
8674 8675
8675 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_EN; 8676 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_EN;
8676 8677
@@ -10399,7 +10400,7 @@ static void bnx2x_get_common_hwinfo(struct bnx2x *bp)
10399 break; 10400 break;
10400 } 10401 }
10401 10402
10402 pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_PMC, &pmc); 10403 pci_read_config_word(bp->pdev, bp->pdev->pm_cap + PCI_PM_PMC, &pmc);
10403 bp->flags |= (pmc & PCI_PM_CAP_PME_D3cold) ? 0 : NO_WOL_FLAG; 10404 bp->flags |= (pmc & PCI_PM_CAP_PME_D3cold) ? 0 : NO_WOL_FLAG;
10404 10405
10405 BNX2X_DEV_INFO("%sWoL capable\n", 10406 BNX2X_DEV_INFO("%sWoL capable\n",
@@ -12141,8 +12142,7 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev,
12141 } 12142 }
12142 12143
12143 if (IS_PF(bp)) { 12144 if (IS_PF(bp)) {
12144 bp->pm_cap = pdev->pm_cap; 12145 if (!pdev->pm_cap) {
12145 if (bp->pm_cap == 0) {
12146 dev_err(&bp->pdev->dev, 12146 dev_err(&bp->pdev->dev,
12147 "Cannot find power management capability, aborting\n"); 12147 "Cannot find power management capability, aborting\n");
12148 rc = -EIO; 12148 rc = -EIO;