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

[PATCH] e2100 iomem annotations and fixes

added mission ioremap(); driver was using readw() et.al. on non-remapped
addresses.
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
parent a2cc1c35
......@@ -72,7 +72,7 @@ static int e21_probe_list[] = {0x300, 0x280, 0x380, 0x220, 0};
#define E21_SAPROM 0x10 /* Offset to station address data. */
#define E21_IO_EXTENT 0x20
static inline void mem_on(short port, volatile char *mem_base,
static inline void mem_on(short port, volatile char __iomem *mem_base,
unsigned char start_page )
{
/* This is a little weird: set the shared memory window by doing a
......@@ -143,6 +143,7 @@ static int __init do_e2100_probe(struct net_device *dev)
static void cleanup_card(struct net_device *dev)
{
/* NB: e21_close() handles free_irq */
iounmap(ei_status.mem);
release_region(dev->base_addr, E21_IO_EXTENT);
}
......@@ -257,6 +258,13 @@ static int __init e21_probe1(struct net_device *dev, int ioaddr)
if (dev->mem_start == 0)
dev->mem_start = 0xd0000;
ei_status.mem = ioremap(dev->mem_start, 2*1024);
if (!ei_status.mem) {
printk("unable to remap memory\n");
retval = -EAGAIN;
goto out;
}
#ifdef notdef
/* These values are unused. The E2100 has a 2K window into the packet
buffer. The window can be set to start on any page boundary. */
......@@ -329,7 +337,7 @@ e21_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_pag
{
short ioaddr = dev->base_addr;
char *shared_mem = (char *)dev->mem_start;
char __iomem *shared_mem = ei_status.mem;
mem_on(ioaddr, shared_mem, ring_page);
......@@ -352,12 +360,12 @@ static void
e21_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset)
{
short ioaddr = dev->base_addr;
char *shared_mem = (char *)dev->mem_start;
char __iomem *shared_mem = ei_status.mem;
mem_on(ioaddr, shared_mem, (ring_offset>>8));
/* Packet is always in one chunk -- we can copy + cksum. */
eth_io_copy_and_sum(skb, dev->mem_start + (ring_offset & 0xff), count, 0);
eth_io_copy_and_sum(skb, ei_status.mem + (ring_offset & 0xff), count, 0);
mem_off(ioaddr);
}
......@@ -367,7 +375,7 @@ e21_block_output(struct net_device *dev, int count, const unsigned char *buf,
int start_page)
{
short ioaddr = dev->base_addr;
volatile char *shared_mem = (char *)dev->mem_start;
volatile char __iomem *shared_mem = ei_status.mem;
/* Set the shared memory window start by doing a read, with the low address
bits specifying the starting page. */
......
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