Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53477
b: refs/heads/master
c: 40453c8
h: refs/heads/master
i:
  53475: 2ce606c
v: v3
  • Loading branch information
Michael Chan authored and David S. Miller committed May 3, 2007
1 parent 96f9608 commit a9592a3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5bae30c96a3bd09563e484b4ac7211b4b4664679
refs/heads/master: 40453c839fdbf86738256cae1c9c1ebe55645d4a
38 changes: 21 additions & 17 deletions trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -5711,6 +5711,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
unsigned long mem_len;
int rc;
u32 reg;
u64 dma_mask, persist_dma_mask;

SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
Expand Down Expand Up @@ -5749,21 +5750,6 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
goto err_out_release;
}

if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) == 0) {
bp->flags |= USING_DAC_FLAG;
if (pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK) != 0) {
dev_err(&pdev->dev,
"pci_set_consistent_dma_mask failed, aborting.\n");
rc = -EIO;
goto err_out_release;
}
}
else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) {
dev_err(&pdev->dev, "System does not support DMA, aborting.\n");
rc = -EIO;
goto err_out_release;
}

bp->dev = dev;
bp->pdev = pdev;

Expand Down Expand Up @@ -5805,6 +5791,26 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
}
}

/* 5708 cannot support DMA addresses > 40-bit. */
if (CHIP_NUM(bp) == CHIP_NUM_5708)
persist_dma_mask = dma_mask = DMA_40BIT_MASK;
else
persist_dma_mask = dma_mask = DMA_64BIT_MASK;

/* Configure DMA attributes. */
if (pci_set_dma_mask(pdev, dma_mask) == 0) {
dev->features |= NETIF_F_HIGHDMA;
rc = pci_set_consistent_dma_mask(pdev, persist_dma_mask);
if (rc) {
dev_err(&pdev->dev,
"pci_set_consistent_dma_mask failed, aborting.\n");
goto err_out_unmap;
}
} else if ((rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK)) != 0) {
dev_err(&pdev->dev, "System does not support DMA, aborting.\n");
goto err_out_unmap;
}

/* Get bus information. */
reg = REG_RD(bp, BNX2_PCICFG_MISC_STATUS);
if (reg & BNX2_PCICFG_MISC_STATUS_PCIX_DET) {
Expand Down Expand Up @@ -6114,8 +6120,6 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
printk("\n");

dev->features |= NETIF_F_SG;
if (bp->flags & USING_DAC_FLAG)
dev->features |= NETIF_F_HIGHDMA;
dev->features |= NETIF_F_IP_CSUM;
#ifdef BCM_VLAN
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/bnx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -6433,7 +6433,6 @@ struct bnx2 {
#define PCI_32BIT_FLAG 2
#define ONE_TDMA_FLAG 4 /* no longer used */
#define NO_WOL_FLAG 8
#define USING_DAC_FLAG 0x10
#define USING_MSI_FLAG 0x20
#define ASF_ENABLE_FLAG 0x40

Expand Down

0 comments on commit a9592a3

Please sign in to comment.