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 @@ ...@@ -21,11 +21,7 @@
#define _FPLUS_ #define _FPLUS_
#ifndef HW_PTR #ifndef HW_PTR
#ifdef MEM_MAPPED_IO #define HW_PTR void __iomem *
#define HW_PTR u_long
#else
#define HW_PTR u_short
#endif
#endif #endif
/* /*
......
...@@ -33,11 +33,7 @@ ...@@ -33,11 +33,7 @@
#endif #endif
#ifndef HW_PTR #ifndef HW_PTR
#ifdef MEM_MAPPED_IO #define HW_PTR void __iomem *
#define HW_PTR u_long
#else
#define HW_PTR u_short
#endif
#endif #endif
#ifdef MULT_OEM #ifdef MULT_OEM
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
// is redefined by linux, but we need our definition // is redefined by linux, but we need our definition
#undef ADDR #undef ADDR
#ifdef MEM_MAPPED_IO #ifdef MEM_MAPPED_IO
#define ADDR(a) (char far *) smc->hw.iop+(a) #define ADDR(a) (smc->hw.iop+(a))
#else #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)))) #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 #endif
......
...@@ -29,20 +29,11 @@ ...@@ -29,20 +29,11 @@
#define _far #define _far
#endif #endif
#ifndef MEM_MAPPED_IO // "normal" IO #define inp(p) ioread8(p)
#define inp(p) inb(p) #define inpw(p) ioread16(p)
#define inpw(p) inw(p) #define inpd(p) ioread32(p)
#define inpd(p) inl(p) #define outp(p,c) iowrite8(c,p)
#define outp(p,c) outb(c,p) #define outpw(p,s) iowrite16(s,p)
#define outpw(p,s) outw(s,p) #define outpd(p,l) iowrite32(l,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
#endif /* _TYPES_ */ #endif /* _TYPES_ */
...@@ -206,6 +206,7 @@ static int skfp_init_one(struct pci_dev *pdev, ...@@ -206,6 +206,7 @@ static int skfp_init_one(struct pci_dev *pdev,
struct net_device *dev; struct net_device *dev;
struct s_smc *smc; /* board pointer */ struct s_smc *smc; /* board pointer */
unsigned long port, len; unsigned long port, len;
void __iomem *mem;
int err; int err;
PRINTK(KERN_INFO "entering skfp_init_one\n"); PRINTK(KERN_INFO "entering skfp_init_one\n");
...@@ -263,16 +264,16 @@ static int skfp_init_one(struct pci_dev *pdev, ...@@ -263,16 +264,16 @@ static int skfp_init_one(struct pci_dev *pdev,
} }
#ifdef MEM_MAPPED_IO #ifdef MEM_MAPPED_IO
dev->base_addr = (unsigned long) ioremap(port, len); mem = ioremap(port, len);
if (!dev->base_addr) { #else
printk(KERN_ERR "skfp: Unable to map MEMORY register, " mem =ioport_map(port, len);
#endif
if (!mem) {
printk(KERN_ERR "skfp: Unable to map register, "
"FDDI adapter will be disabled.\n"); "FDDI adapter will be disabled.\n");
err = -EIO; err = -EIO;
goto err_out3; goto err_out3;
} }
#else
dev->base_addr = port;
#endif
dev->irq = pdev->irq; dev->irq = pdev->irq;
dev->get_stats = &skfp_ctl_get_stats; dev->get_stats = &skfp_ctl_get_stats;
...@@ -296,9 +297,12 @@ static int skfp_init_one(struct pci_dev *pdev, ...@@ -296,9 +297,12 @@ static int skfp_init_one(struct pci_dev *pdev,
smc->os.MaxFrameSize = MAX_FRAME_SIZE; smc->os.MaxFrameSize = MAX_FRAME_SIZE;
smc->os.dev = dev; smc->os.dev = dev;
smc->hw.slot = -1; smc->hw.slot = -1;
smc->hw.iop = mem;
smc->os.ResetRequested = FALSE; smc->os.ResetRequested = FALSE;
skb_queue_head_init(&smc->os.SendSkbQueue); skb_queue_head_init(&smc->os.SendSkbQueue);
dev->base_addr = (unsigned long)mem;
err = skfp_driver_init(dev); err = skfp_driver_init(dev);
if (err) if (err)
goto err_out4; goto err_out4;
...@@ -328,7 +332,9 @@ static int skfp_init_one(struct pci_dev *pdev, ...@@ -328,7 +332,9 @@ static int skfp_init_one(struct pci_dev *pdev,
smc->os.LocalRxBuffer, smc->os.LocalRxBufferDMA); smc->os.LocalRxBuffer, smc->os.LocalRxBufferDMA);
err_out4: err_out4:
#ifdef MEM_MAPPED_IO #ifdef MEM_MAPPED_IO
iounmap((void *) dev->base_addr); iounmap(smc->hw.iop);
#else
ioport_unmap(smc->hw.iop);
#endif #endif
err_out3: err_out3:
free_netdev(dev); free_netdev(dev);
...@@ -363,7 +369,9 @@ static void __devexit skfp_remove_one(struct pci_dev *pdev) ...@@ -363,7 +369,9 @@ static void __devexit skfp_remove_one(struct pci_dev *pdev)
lp->os.LocalRxBuffer = NULL; lp->os.LocalRxBuffer = NULL;
} }
#ifdef MEM_MAPPED_IO #ifdef MEM_MAPPED_IO
iounmap((void *) p->base_addr); iounmap(lp->hw.iop);
#else
ioport_unmap(lp->hw.iop);
#endif #endif
pci_release_regions(pdev); pci_release_regions(pdev);
free_netdev(p); free_netdev(p);
...@@ -406,7 +414,6 @@ static int skfp_driver_init(struct net_device *dev) ...@@ -406,7 +414,6 @@ static int skfp_driver_init(struct net_device *dev)
// set the io address in private structures // set the io address in private structures
bp->base_addr = dev->base_addr; bp->base_addr = dev->base_addr;
smc->hw.iop = dev->base_addr;
// Get the interrupt level from the PCI Configuration Table // Get the interrupt level from the PCI Configuration Table
smc->hw.irq = dev->irq; 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