Commit be11ba10 authored by Alexander Viro's avatar Alexander Viro Committed by Jeff Garzik

[PATCH] skfp iomem annotations, switch to io{read,write}

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
parent 24abc645
......@@ -21,11 +21,7 @@
#define _FPLUS_
#ifndef HW_PTR
#ifdef MEM_MAPPED_IO
#define HW_PTR u_long
#else
#define HW_PTR u_short
#endif
#define HW_PTR void __iomem *
#endif
/*
......
......@@ -33,11 +33,7 @@
#endif
#ifndef HW_PTR
#ifdef MEM_MAPPED_IO
#define HW_PTR u_long
#else
#define HW_PTR u_short
#endif
#define HW_PTR void __iomem *
#endif
#ifdef MULT_OEM
......
......@@ -53,7 +53,7 @@
// is redefined by linux, but we need our definition
#undef ADDR
#ifdef MEM_MAPPED_IO
#define ADDR(a) (char far *) smc->hw.iop+(a)
#define ADDR(a) (smc->hw.iop+(a))
#else
#define ADDR(a) (((a)>>7) ? (outp(smc->hw.iop+B0_RAP,(a)>>7), (smc->hw.iop+( ((a)&0x7F) | ((a)>>7 ? 0x80:0)) )) : (smc->hw.iop+(((a)&0x7F)|((a)>>7 ? 0x80:0))))
#endif
......
......@@ -29,20 +29,11 @@
#define _far
#endif
#ifndef MEM_MAPPED_IO // "normal" IO
#define inp(p) inb(p)
#define inpw(p) inw(p)
#define inpd(p) inl(p)
#define outp(p,c) outb(c,p)
#define outpw(p,s) outw(s,p)
#define outpd(p,l) outl(l,p)
#else // memory mapped io
#define inp(a) readb(a)
#define inpw(a) readw(a)
#define inpd(a) readl(a)
#define outp(a,v) writeb(v, a)
#define outpw(a,v) writew(v, a)
#define outpd(a,v) writel(v, a)
#endif
#define inp(p) ioread8(p)
#define inpw(p) ioread16(p)
#define inpd(p) ioread32(p)
#define outp(p,c) iowrite8(c,p)
#define outpw(p,s) iowrite16(s,p)
#define outpd(p,l) iowrite32(l,p)
#endif /* _TYPES_ */
......@@ -206,6 +206,7 @@ static int skfp_init_one(struct pci_dev *pdev,
struct net_device *dev;
struct s_smc *smc; /* board pointer */
unsigned long port, len;
void __iomem *mem;
int err;
PRINTK(KERN_INFO "entering skfp_init_one\n");
......@@ -263,16 +264,16 @@ static int skfp_init_one(struct pci_dev *pdev,
}
#ifdef MEM_MAPPED_IO
dev->base_addr = (unsigned long) ioremap(port, len);
if (!dev->base_addr) {
printk(KERN_ERR "skfp: Unable to map MEMORY register, "
mem = ioremap(port, len);
#else
mem =ioport_map(port, len);
#endif
if (!mem) {
printk(KERN_ERR "skfp: Unable to map register, "
"FDDI adapter will be disabled.\n");
err = -EIO;
goto err_out3;
}
#else
dev->base_addr = port;
#endif
dev->irq = pdev->irq;
dev->get_stats = &skfp_ctl_get_stats;
......@@ -296,9 +297,12 @@ static int skfp_init_one(struct pci_dev *pdev,
smc->os.MaxFrameSize = MAX_FRAME_SIZE;
smc->os.dev = dev;
smc->hw.slot = -1;
smc->hw.iop = mem;
smc->os.ResetRequested = FALSE;
skb_queue_head_init(&smc->os.SendSkbQueue);
dev->base_addr = (unsigned long)mem;
err = skfp_driver_init(dev);
if (err)
goto err_out4;
......@@ -328,7 +332,9 @@ static int skfp_init_one(struct pci_dev *pdev,
smc->os.LocalRxBuffer, smc->os.LocalRxBufferDMA);
err_out4:
#ifdef MEM_MAPPED_IO
iounmap((void *) dev->base_addr);
iounmap(smc->hw.iop);
#else
ioport_unmap(smc->hw.iop);
#endif
err_out3:
free_netdev(dev);
......@@ -363,7 +369,9 @@ static void __devexit skfp_remove_one(struct pci_dev *pdev)
lp->os.LocalRxBuffer = NULL;
}
#ifdef MEM_MAPPED_IO
iounmap((void *) p->base_addr);
iounmap(lp->hw.iop);
#else
ioport_unmap(lp->hw.iop);
#endif
pci_release_regions(pdev);
free_netdev(p);
......@@ -406,7 +414,6 @@ static int skfp_driver_init(struct net_device *dev)
// set the io address in private structures
bp->base_addr = dev->base_addr;
smc->hw.iop = dev->base_addr;
// Get the interrupt level from the PCI Configuration Table
smc->hw.irq = dev->irq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment