diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-02-15 02:15:32 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-02-15 02:15:32 +0000 |
commit | 86464aed71025541805e7b1515541aee89879e33 (patch) | |
tree | e01a457a4912a8553bc65524aa3125d51f29f810 /drivers/net/3c523.c | |
parent | 88f99939ecc6a95a79614574cb7d95ffccfc3466 (diff) |
Merge with Linux 2.2.1.
Diffstat (limited to 'drivers/net/3c523.c')
-rw-r--r-- | drivers/net/3c523.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c index 968168d01..d907fe7f3 100644 --- a/drivers/net/3c523.c +++ b/drivers/net/3c523.c @@ -184,7 +184,7 @@ static void set_multicast_list(struct device *dev); /* helper-functions */ static int init586(struct device *dev); -static int check586(struct device *dev, char *where, unsigned size); +static int check586(struct device *dev, unsigned long where, unsigned size); static void alloc586(struct device *dev); static void startrecv586(struct device *dev); static void *alloc_rfa(struct device *dev, void *ptr); @@ -311,19 +311,19 @@ static int elmc_open(struct device *dev) * Check to see if there's an 82586 out there. */ -__initfunc(static int check586(struct device *dev, char *where, unsigned size)) +__initfunc(static int check586(struct device *dev, unsigned long where, unsigned size)) { struct priv *p = (struct priv *) dev->priv; char *iscp_addrs[2]; int i = 0; - p->base = (unsigned long) where + size - 0x01000000; - p->memtop = where + size; - p->scp = (struct scp_struct *) (p->base + SCP_DEFAULT_ADDRESS); + p->base = where + size - 0x01000000; + p->memtop = phys_to_virt(where) + size; + p->scp = (struct scp_struct *)phys_to_virt(p->base + SCP_DEFAULT_ADDRESS); memset((char *) p->scp, 0, sizeof(struct scp_struct)); p->scp->sysbus = SYSBUSVAL; /* 1 = 8Bit-Bus, 0 = 16 Bit */ - iscp_addrs[0] = where; + iscp_addrs[0] = phys_to_virt(where); iscp_addrs[1] = (char *) p->scp - sizeof(struct iscp_struct); for (i = 0; i < 2; i++) { @@ -358,8 +358,8 @@ void alloc586(struct device *dev) elmc_id_reset586(); DELAY(2); - p->scp = (struct scp_struct *) (p->base + SCP_DEFAULT_ADDRESS); - p->scb = (struct scb_struct *) (dev->mem_start); + p->scp = (struct scp_struct *) phys_to_virt(p->base + SCP_DEFAULT_ADDRESS); + p->scb = (struct scb_struct *) phys_to_virt(dev->mem_start); p->iscp = (struct iscp_struct *) ((char *) p->scp - sizeof(struct iscp_struct)); memset((char *) p->iscp, 0, sizeof(struct iscp_struct)); @@ -521,9 +521,9 @@ __initfunc(int elmc_probe(struct device *dev)) /* The 3c523 has a 24K chunk of memory. The first 16K is the shared memory, while the last 8K is for the EtherStart BIOS ROM. Which we don't care much about here. We'll just tell Linux that - we're using 16K. MCA won't permit adress space conflicts caused + we're using 16K. MCA won't permit address space conflicts caused by not mapping the other 8K. */ - dev->mem_start = phys_to_virt(shm_table[(status & ELMC_STATUS_MEMORY_SELECT) >> 3]); + dev->mem_start = shm_table[(status & ELMC_STATUS_MEMORY_SELECT) >> 3]; /* We're using MCA, so it's a given that the information about memory size is correct. The Crynwr drivers do something like this. */ @@ -531,7 +531,7 @@ __initfunc(int elmc_probe(struct device *dev)) elmc_id_reset586(); /* seems like a good idea before checking it... */ size = 0x4000; /* check for 16K mem */ - if (!check586(dev, (char *) dev->mem_start, size)) { + if (!check586(dev, dev->mem_start, size)) { printk("%s: memprobe, Can't find memory at 0x%lx!\n", dev->name, dev->mem_start); release_region(dev->base_addr, ELMC_IO_EXTENT); @@ -550,8 +550,7 @@ __initfunc(int elmc_probe(struct device *dev)) /* dump all the assorted information */ printk("%s: IRQ %d, %sternal xcvr, memory %#lx-%#lx.\n", dev->name, dev->irq, dev->if_port ? "ex" : "in", - virt_to_phys(dev->mem_start), - virt_to_phys(dev->mem_end - 1)); + dev->mem_start, dev->mem_end - 1); /* The hardware address for the 3c523 is stored in the first six bytes of the IO address. */ @@ -628,7 +627,7 @@ static int init586(struct device *dev) s = jiffies; /* warning: only active with interrupts on !! */ while (!(cfg_cmd->cmd_status & STAT_COMPL)) { - if (jiffies - s > 30) + if (jiffies - s > 30*HZ/100) break; } @@ -654,7 +653,7 @@ static int init586(struct device *dev) s = jiffies; while (!(ias_cmd->cmd_status & STAT_COMPL)) { - if (jiffies - s > 30) + if (jiffies - s > 30*HZ/100) break; } @@ -679,7 +678,7 @@ static int init586(struct device *dev) s = jiffies; while (!(tdr_cmd->cmd_status & STAT_COMPL)) { - if (jiffies - s > 30) { + if (jiffies - s > 30*HZ/100) { printk("%s: %d Problems while running the TDR.\n", dev->name, __LINE__); result = 1; break; @@ -768,7 +767,7 @@ static int init586(struct device *dev) elmc_id_attn586(); s = jiffies; while (!(mc_cmd->cmd_status & STAT_COMPL)) { - if (jiffies - s > 30) + if (jiffies - s > 30*HZ/100) break; } if (!(mc_cmd->cmd_status & STAT_COMPL)) { @@ -964,7 +963,7 @@ static void elmc_rcv_int(struct device *dev) if (skb != NULL) { skb->dev = dev; skb_reserve(skb, 2); /* 16 byte alignment */ - memcpy(skb_put(skb, totlen), (char *) p->base + (unsigned long) rbd->buffer, totlen); + memcpy(skb_put(skb, totlen), (u8 *)phys_to_virt(p->base) + (unsigned long) rbd->buffer, totlen); skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); p->stats.rx_packets++; |