int ioaddr = dev->base_addr - ULTRA32_NIC_OFFSET;
/* NB: ultra32_close_card() does free_irq */
release_region(ioaddr, ULTRA32_IO_EXTENT);
+ iounmap(ei_status.mem);
}
/* Probe for the Ultra32. This looks like a 8013 with the station
/* All Ultra32 cards have 32KB memory with an 8KB window. */
ei_status.stop_page = 128;
- ei_status.rmem_start = dev->mem_start + TX_PAGES*256;
- dev->mem_end = ei_status.rmem_end = dev->mem_start + 0x1fff;
+ ei_status.mem = ioremap(dev->mem_start, 0x2000);
+ if (!ei_status.mem) {
+ printk(", failed to ioremap.\n");
+ retval = -ENOMEM;
+ goto out;
+ }
+ dev->mem_end = dev->mem_start + 0x1fff;
printk(", IRQ %d, 32KB memory, 8KB window at 0x%lx-0x%lx.\n",
dev->irq, dev->mem_start, dev->mem_end);
struct e8390_pkt_hdr *hdr,
int ring_page)
{
- unsigned long hdr_start = dev->mem_start + ((ring_page & 0x1f) << 8);
+ void __iomem *hdr_start = ei_status.mem + ((ring_page & 0x1f) << 8);
unsigned int RamReg = dev->base_addr - ULTRA32_NIC_OFFSET + ULTRA32_CFG3;
/* Select correct 8KB Window. */
#ifdef __BIG_ENDIAN
/* Officially this is what we are doing, but the readl() is faster */
/* unfortunately it isn't endian aware of the struct */
- isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
+ memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
hdr->count = le16_to_cpu(hdr->count);
#else
- ((unsigned int*)hdr)[0] = isa_readl(hdr_start);
+ ((unsigned int*)hdr)[0] = readl(hdr_start);
#endif
}
struct sk_buff *skb,
int ring_offset)
{
- unsigned long xfer_start = dev->mem_start + (ring_offset & 0x1fff);
+ void __iomem *xfer_start = ei_status.mem + (ring_offset & 0x1fff);
unsigned int RamReg = dev->base_addr - ULTRA32_NIC_OFFSET + ULTRA32_CFG3;
if ((ring_offset & ~0x1fff) != ((ring_offset + count - 1) & ~0x1fff)) {
int semi_count = 8192 - (ring_offset & 0x1FFF);
- isa_memcpy_fromio(skb->data, xfer_start, semi_count);
+ memcpy_fromio(skb->data, xfer_start, semi_count);
count -= semi_count;
if (ring_offset < 96*256) {
/* Select next 8KB Window. */
ring_offset += semi_count;
outb(ei_status.reg0 | ((ring_offset & 0x6000) >> 13), RamReg);
- isa_memcpy_fromio(skb->data + semi_count, dev->mem_start, count);
+ memcpy_fromio(skb->data + semi_count, ei_status.mem, count);
} else {
/* Select first 8KB Window. */
outb(ei_status.reg0, RamReg);
- isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count);
+ memcpy_fromio(skb->data + semi_count, ei_status.mem + TX_PAGES * 256, count);
}
} else {
/* Packet is in one chunk -- we can copy + cksum. */
- isa_eth_io_copy_and_sum(skb, xfer_start, count, 0);
+ eth_io_copy_and_sum(skb, xfer_start, count, 0);
}
}
const unsigned char *buf,
int start_page)
{
- unsigned long xfer_start = dev->mem_start + (start_page<<8);
+ void __iomem *xfer_start = ei_status.mem + (start_page<<8);
unsigned int RamReg = dev->base_addr - ULTRA32_NIC_OFFSET + ULTRA32_CFG3;
/* Select first 8KB Window. */
outb(ei_status.reg0, RamReg);
- isa_memcpy_toio(xfer_start, buf, count);
+ memcpy_toio(xfer_start, buf, count);
}
\f
#ifdef MODULE