[PATCH] : Fix io mapaddr for 3c503 Card

Stephane Casset (casset@pipo.u-strasbg.fr)
Tue, 26 Oct 1999 12:26:48 +0200


--a8Wt8u1KmwUX3Y2C
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

<!--
Hi,

My logs were filled with :
io mapaddr 0xdc000 not valid at 3c503.c blabla

So I fix it by the following patch.

Please someone have a look at it, it works but as I'm not a expert it can be
plain wrong...

Regards,

Stéphane Casset

-- 
<< On ne voit bien qu'avec le coeur, |          Stephane Casset 
 l'essentiel est invisible           |      casset@inforezo.u-strasbg.fr
     pour les yeux >>   St. Exupery  |  http://inforezo.u-strasbg.fr/~casset
-->Si vous ne voyez rien c'est normal utilisez un VRAI lecteur de mails !

--a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="3c503.diff"

--- 3c503.c.old Tue Oct 26 12:14:39 1999 +++ 3c503.c Tue Oct 26 12:15:12 1999 @@ -155,6 +155,7 @@ el2_probe1(struct net_device *dev, int ioaddr) { int i, iobase_reg, membase_reg, saved_406, wordlength; + unsigned long mem_start ; static unsigned version_printed = 0; unsigned long vendor_id; @@ -237,11 +238,11 @@ printk(", using %sternal xcvr.\n", ei_status.interface_num == 0 ? "in" : "ex"); if ((membase_reg & 0xf0) == 0) { - dev->mem_start = 0; + mem_start = 0; ei_status.name = "3c503-PIO"; } else { - dev->mem_start = ((membase_reg & 0xc0) ? 0xD8000 : 0xC8000) + - ((membase_reg & 0xA0) ? 0x4000 : 0); + mem_start = ((membase_reg & 0xc0) ? 0xD8000 : 0xC8000) + + ((membase_reg & 0xA0) ? 0x4000 : 0); #define EL2_MEMSIZE (EL2_MB1_STOP_PG - EL2_MB1_START_PG)*256 #ifdef EL2MEMTEST @@ -249,7 +250,7 @@ Note that it only tests the 2nd 8kB on 16kB 3c503/16 cards between card addr. 0x2000 and 0x3fff. */ { /* Check the card's memory. */ - unsigned long mem_base = dev->mem_start; + unsigned long mem_base = mem_start; unsigned int test_val = 0xbbadf00d; writel(0xba5eba5e, mem_base); for (i = sizeof(test_val); i < EL2_MEMSIZE; i+=sizeof(test_val)) { @@ -257,7 +258,7 @@ if (readl(mem_base) != 0xba5eba5e || readl(mem_base + i) != test_val) { printk("3c503: memory failure or memory address conflict.\n"); - dev->mem_start = 0; + mem_start = 0; ei_status.name = "3c503-PIO"; break; } @@ -267,16 +268,6 @@ } #endif /* EL2MEMTEST */ - dev->mem_end = dev->rmem_end = dev->mem_start + EL2_MEMSIZE; - - if (wordlength) { /* No Tx pages to skip over to get to Rx */ - dev->rmem_start = dev->mem_start; - ei_status.name = "3c503/16"; - } else { - dev->rmem_start = TX_PAGES*256 + dev->mem_start; - ei_status.name = "3c503"; - } - } /* @@ -303,8 +294,6 @@ ei_status.block_input = &el2_block_input; ei_status.block_output = &el2_block_output; - request_region(ioaddr, EL2_IO_EXTENT, ei_status.name); - if (dev->irq == 2) dev->irq = 9; else if (dev->irq > 5 && dev->irq != 9) { @@ -319,19 +308,32 @@ dev->open = &el2_open; dev->stop = &el2_close; - if (dev->mem_start) + if (mem_start) { + dev->mem_start=(unsigned long)ioremap(mem_start,EL2_MEMSIZE); + if (wordlength) { + ei_status.name = "3c503/16"; + dev->rmem_start = dev->mem_start ; + } else { + dev->rmem_start = TX_PAGES*256 + dev->mem_start ; + ei_status.name = "3c503"; + } + dev->mem_end = dev->rmem_end = dev->mem_start + EL2_MEMSIZE; printk("%s: %s - %dkB RAM, 8kB shared mem window at %#6lx-%#6lx.\n", dev->name, ei_status.name, (wordlength+1)<<3, - dev->mem_start, dev->mem_end -1); + mem_start, mem_start + EL2_MEMSIZE -1); } else { + dev->mem_start=0; ei_status.tx_start_page = EL2_MB1_START_PG; ei_status.rx_start_page = EL2_MB1_START_PG + TX_PAGES; printk("\n%s: %s, %dkB RAM, using programmed I/O (REJUMPER for SHARED MEMORY).\n", dev->name, ei_status.name, (wordlength+1)<<3); } + + request_region(ioaddr, EL2_IO_EXTENT, ei_status.name); + return 0; }

--a8Wt8u1KmwUX3Y2C--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/