Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17091
b: refs/heads/master
c: bce7c95
h: refs/heads/master
i:
  17089: 047e767
  17087: 5a1a2ae
v: v3
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Jan 9, 2006
1 parent 831f931 commit ba11900
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 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: 17fa6e2f115ad734ef802b663071159a1a64d06f
refs/heads/master: bce7c95e4dd4d5e924deb2929b639b4caca09c93
28 changes: 24 additions & 4 deletions trunk/drivers/net/sk98lin/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -4775,16 +4775,30 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
struct net_device *dev = NULL;
static int boards_found = 0;
int error = -ENODEV;
int using_dac = 0;
char DeviceStr[80];

if (pci_enable_device(pdev))
goto out;

/* Configure DMA attributes. */
if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) &&
pci_set_dma_mask(pdev, DMA_32BIT_MASK))
goto out_disable_device;

if (sizeof(dma_addr_t) > sizeof(u32) &&
!(error = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) {
using_dac = 1;
error = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
if (error < 0) {
printk(KERN_ERR "sk98lin %s unable to obtain 64 bit DMA "
"for consistent allocations\n", pci_name(pdev));
goto out_disable_device;
}
} else {
error = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (error) {
printk(KERN_ERR "sk98lin %s no usable DMA configuration\n",
pci_name(pdev));
goto out_disable_device;
}
}

if ((dev = alloc_etherdev(sizeof(DEV_NET))) == NULL) {
printk(KERN_ERR "Unable to allocate etherdev "
Expand Down Expand Up @@ -4843,6 +4857,9 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
#endif
}

if (using_dac)
dev->features |= NETIF_F_HIGHDMA;

pAC->Index = boards_found++;

if (SkGeBoardInit(dev, pAC))
Expand Down Expand Up @@ -4919,6 +4936,9 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
#endif
}

if (using_dac)
dev->features |= NETIF_F_HIGHDMA;

if (register_netdev(dev)) {
printk(KERN_ERR "sk98lin: Could not register device for seconf port.\n");
free_netdev(dev);
Expand Down

0 comments on commit ba11900

Please sign in to comment.