git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
net
/
wan
/
wanxl.c
diff --git
a/drivers/net/wan/wanxl.c
b/drivers/net/wan/wanxl.c
index
1e7b477
..
c736015
100644
(file)
--- a/
drivers/net/wan/wanxl.c
+++ b/
drivers/net/wan/wanxl.c
@@
-26,8
+26,9
@@
#include <linux/netdevice.h>
#include <linux/hdlc.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/hdlc.h>
#include <linux/pci.h>
+#include <linux/dma-mapping.h>
+#include <linux/delay.h>
#include <asm/io.h>
#include <asm/io.h>
-#include <asm/delay.h>
#include "wanxl.h"
#include "wanxl.h"
@@
-148,7
+149,10
@@
static inline void wanxl_cable_intr(port_t *port)
printk(KERN_INFO "%s: %s%s module, %s cable%s%s\n",
port->dev->name, pm, dte, cable, dsr, dcd);
printk(KERN_INFO "%s: %s%s module, %s cable%s%s\n",
port->dev->name, pm, dte, cable, dsr, dcd);
- hdlc_set_carrier(value & STATUS_CABLE_DCD, port->dev);
+ if (value & STATUS_CABLE_DCD)
+ netif_carrier_on(port->dev);
+ else
+ netif_carrier_off(port->dev);
}
}
@@
-240,7
+244,7
@@
static inline void wanxl_rx_intr(card_t *card)
-static irqreturn_t wanxl_intr(int irq, void* dev_id
, struct pt_regs *regs
)
+static irqreturn_t wanxl_intr(int irq, void* dev_id)
{
card_t *card = dev_id;
int i;
{
card_t *card = dev_id;
int i;
@@
-576,8
+580,8
@@
static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
We set both dma_mask and consistent_dma_mask to 28 bits
and pray pci_alloc_consistent() will use this info. It should
work on most platforms */
We set both dma_mask and consistent_dma_mask to 28 bits
and pray pci_alloc_consistent() will use this info. It should
work on most platforms */
- if (pci_set_consistent_dma_mask(pdev,
0x0FFFFFFF
) ||
- pci_set_dma_mask(pdev,
0x0FFFFFFF
)) {
+ if (pci_set_consistent_dma_mask(pdev,
DMA_28BIT_MASK
) ||
+ pci_set_dma_mask(pdev,
DMA_28BIT_MASK
)) {
printk(KERN_ERR "wanXL: No usable DMA configuration\n");
return -EIO;
}
printk(KERN_ERR "wanXL: No usable DMA configuration\n");
return -EIO;
}
@@
-624,8
+628,8
@@
static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
/* FIXME when PCI/DMA subsystems are fixed.
We set both dma_mask and consistent_dma_mask back to 32 bits
to indicate the card can do 32-bit DMA addressing */
/* FIXME when PCI/DMA subsystems are fixed.
We set both dma_mask and consistent_dma_mask back to 32 bits
to indicate the card can do 32-bit DMA addressing */
- if (pci_set_consistent_dma_mask(pdev,
0xFFFFFFFF
) ||
- pci_set_dma_mask(pdev,
0xFFFFFFFF
)) {
+ if (pci_set_consistent_dma_mask(pdev,
DMA_32BIT_MASK
) ||
+ pci_set_dma_mask(pdev,
DMA_32BIT_MASK
)) {
printk(KERN_ERR "wanXL: No usable DMA configuration\n");
wanxl_pci_remove_one(pdev);
return -EIO;
printk(KERN_ERR "wanXL: No usable DMA configuration\n");
wanxl_pci_remove_one(pdev);
return -EIO;
@@
-633,7
+637,13
@@
static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
/* set up PLX mapping */
plx_phy = pci_resource_start(pdev, 0);
/* set up PLX mapping */
plx_phy = pci_resource_start(pdev, 0);
+
card->plx = ioremap_nocache(plx_phy, 0x70);
card->plx = ioremap_nocache(plx_phy, 0x70);
+ if (!card->plx) {
+ printk(KERN_ERR "wanxl: ioremap() failed\n");
+ wanxl_pci_remove_one(pdev);
+ return -EFAULT;
+ }
#if RESET_WHILE_LOADING
wanxl_reset(card);
#if RESET_WHILE_LOADING
wanxl_reset(card);
@@
-699,6
+709,12
@@
static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
}
mem = ioremap_nocache(mem_phy, PDM_OFFSET + sizeof(firmware));
}
mem = ioremap_nocache(mem_phy, PDM_OFFSET + sizeof(firmware));
+ if (!mem) {
+ printk(KERN_ERR "wanxl: ioremap() failed\n");
+ wanxl_pci_remove_one(pdev);
+ return -EFAULT;
+ }
+
for (i = 0; i < sizeof(firmware); i += 4)
writel(htonl(*(u32*)(firmware + i)), mem + PDM_OFFSET + i);
for (i = 0; i < sizeof(firmware); i += 4)
writel(htonl(*(u32*)(firmware + i)), mem + PDM_OFFSET + i);
@@
-742,7
+758,7
@@
static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
pci_name(pdev), plx_phy, ramsize / 1024, mem_phy, pdev->irq);
/* Allocate IRQ */
pci_name(pdev), plx_phy, ramsize / 1024, mem_phy, pdev->irq);
/* Allocate IRQ */
- if (request_irq(pdev->irq, wanxl_intr,
SA_SHIRQ
, "wanXL", card)) {
+ if (request_irq(pdev->irq, wanxl_intr,
IRQF_SHARED
, "wanXL", card)) {
printk(KERN_WARNING "wanXL %s: could not allocate IRQ%i.\n",
pci_name(pdev), pdev->irq);
wanxl_pci_remove_one(pdev);
printk(KERN_WARNING "wanXL %s: could not allocate IRQ%i.\n",
pci_name(pdev), pdev->irq);
wanxl_pci_remove_one(pdev);
@@
-821,7
+837,7
@@
static int __init wanxl_init_module(void)
#ifdef MODULE
printk(KERN_INFO "%s\n", version);
#endif
#ifdef MODULE
printk(KERN_INFO "%s\n", version);
#endif
- return pci_
module_init
(&wanxl_pci_driver);
+ return pci_
register_driver
(&wanxl_pci_driver);
}
static void __exit wanxl_cleanup_module(void)
}
static void __exit wanxl_cleanup_module(void)