summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRalf Bächle <ralf@linux-mips.org>2003-06-25 09:03:18 -0400
committerRalf Bächle <ralf@linux-mips.org>2003-06-25 09:03:18 -0400
commit022dc70eb9f01cce8aad132aa92d8c84fa7d92db (patch)
treeef4fa79272c9e4025e25cb9984f05b84351fbbf5 /drivers
parentf0e373dc194bba55389b428b6a778304ea050cac (diff)
[netdrvr] update ioc3_eth
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/Makefile.lib1
-rw-r--r--drivers/net/ioc3-eth.c104
2 files changed, 8 insertions, 97 deletions
diff --git a/drivers/net/Makefile.lib b/drivers/net/Makefile.lib
index 44e3b9b329e9..d3bf5b39d4ce 100644
--- a/drivers/net/Makefile.lib
+++ b/drivers/net/Makefile.lib
@@ -24,6 +24,7 @@ obj-$(CONFIG_PCMCIA_FMVJ18X) += crc32.o
obj-$(CONFIG_PCMCIA_SMC91C92) += crc32.o
obj-$(CONFIG_PCMCIA_XIRTULIP) += crc32.o
obj-$(CONFIG_PCNET32) += crc32.o
+obj-$(CONFIG_SGI_IOC3_ETH) += crc32.o
obj-$(CONFIG_SIS900) += crc32.o
obj-$(CONFIG_SMC9194) += crc32.o
obj-$(CONFIG_ADAPTEC_STARFIRE) += crc32.o
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index e63251ffe323..63ce2856ef1e 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -5,7 +5,7 @@
*
* Driver for SGI's IOC3 based Ethernet cards as found in the PCI card.
*
- * Copyright (C) 1999, 2000, 2001 Ralf Baechle
+ * Copyright (C) 1999, 2000, 2001, 2003 Ralf Baechle
* Copyright (C) 1995, 1999, 2000, 2001 by Silicon Graphics, Inc.
*
* References:
@@ -36,7 +36,7 @@
#include <linux/pci.h>
#include <linux/crc32.h>
-#ifdef CONFIG_SERIAL
+#ifdef CONFIG_SERIAL_8250
#include <linux/serial.h>
#include <asm/serial.h>
#define IOC3_BAUD (22000000 / (3*16))
@@ -377,82 +377,6 @@ static void ioc3_get_eaddr_nic(struct ioc3_private *ip)
ip->dev->dev_addr[i - 2] = nic[i];
}
-#if defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_SGI_SN2)
-/*
- * Get the ether-address on SN1 nodes
- */
-static void ioc3_get_eaddr_sn(struct ioc3_private *ip)
-{
- int ibrick_mac_addr_get(nasid_t, char *);
- struct ioc3 *ioc3 = ip->regs;
- nasid_t nasid_of_ioc3;
- char io7eaddr[20];
- long mac;
- int err_val;
-
- /*
- * err_val = ibrick_mac_addr_get(get_nasid(), io7eaddr );
- *
- * BAD!! The above call uses get_nasid() and assumes that
- * the ioc3 pointed to by struct ioc3 is hooked up to the
- * cbrick that we're running on. The proper way to make this call
- * is to figure out which nasid the ioc3 is connected to
- * and use that to call ibrick_mac_addr_get. Below is
- * a hack to do just that.
- */
-
- /*
- * Get the nasid of the ioc3 from the ioc3's base addr.
- * FIXME: the 8 at the end assumes we're in memory mode,
- * not node mode (for that, we'd change it to a 9).
- * Is there a call to extract this info from a physical
- * addr somewhere in an sn header file already? If so,
- * we should probably use that, or restructure this routine
- * to use pci_dev and generic numa nodeid getting stuff.
- */
- nasid_of_ioc3 = (((unsigned long)ioc3 >> 33) & ~(-1 << 8));
- err_val = ibrick_mac_addr_get(nasid_of_ioc3, io7eaddr );
-
-
- if (err_val) {
- /* Couldn't read the eeprom; try OSLoadOptions. */
- printk("WARNING: ibrick_mac_addr_get failed: %d\n", err_val);
-
- /* this is where we hardwire the mac address
- * 1st ibrick had 08:00:69:11:34:75
- * 2nd ibrick had 08:00:69:11:35:35
- *
- * Eagan Machines:
- * mankato1 08:00:69:11:BE:95
- * warroad 08:00:69:11:bd:60
- * duron 08:00:69:11:34:60
- *
- * an easy way to get the mac address is to hook
- * up an ip35, then from L1 do 'cti serial'
- * and then look for MAC line XXX THIS DOESN"T QUITE WORK!!
- */
- printk("ioc3_get_eaddr: setting ethernet address to:\n -----> ");
- ip->dev->dev_addr[0] = 0x8;
- ip->dev->dev_addr[1] = 0x0;
- ip->dev->dev_addr[2] = 0x69;
- ip->dev->dev_addr[3] = 0x11;
- ip->dev->dev_addr[4] = 0x34;
- ip->dev->dev_addr[5] = 0x60;
- }
- else {
- long simple_strtol(const char *,char **,unsigned int);
-
- mac = simple_strtol(io7eaddr, (char **)0, 16);
- ip->dev->dev_addr[0] = (mac >> 40) & 0xff;
- ip->dev->dev_addr[1] = (mac >> 32) & 0xff;
- ip->dev->dev_addr[2] = (mac >> 24) & 0xff;
- ip->dev->dev_addr[3] = (mac >> 16) & 0xff;
- ip->dev->dev_addr[4] = (mac >> 8) & 0xff;
- ip->dev->dev_addr[5] = mac & 0xff;
- }
-}
-#endif
-
/*
* Ok, this is hosed by design. It's necessary to know what machine the
* NIC is in in order to know how to read the NIC address. We also have
@@ -460,30 +384,15 @@ static void ioc3_get_eaddr_sn(struct ioc3_private *ip)
*/
static void ioc3_get_eaddr(struct ioc3_private *ip)
{
- void (*do_get_eaddr)(struct ioc3_private *ip) = NULL;
int i;
- /*
- * We should also use this code for PCI cards, no matter what host
- * machine but how to know that we're a PCI card?
- */
-#ifdef CONFIG_SGI_IP27
- do_get_eaddr = ioc3_get_eaddr_nic;
-#endif
-#if defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_SGI_SN2)
- do_get_eaddr = ioc3_get_eaddr_sn;
-#endif
- if (!do_get_eaddr) {
- printk(KERN_ERR "Don't know how to read MAC address of this "
- "IOC3 NIC\n");
- return;
- }
+ ioc3_get_eaddr_nic(ip);
printk("Ethernet address is ");
for (i = 0; i < 6; i++) {
printk("%02x", ip->dev->dev_addr[i]);
- if (i < 7)
+ if (i < 5)
printk(":");
}
printk(".\n");
@@ -588,7 +497,7 @@ ioc3_rx(struct ioc3_private *ip)
ip->stats.rx_frame_errors++;
next:
ip->rx_skbs[n_entry] = new_skb;
- rxr[n_entry] = cpu_to_be32((0xa5UL << 56) |
+ rxr[n_entry] = cpu_to_be64((0xa5UL << 56) |
((unsigned long) rxb & TO_PHYS_MASK));
rxb->w0 = 0; /* Clear valid flag */
n_entry = (n_entry + 1) & 511; /* Update erpir */
@@ -1550,7 +1459,7 @@ static int __devinit ioc3_probe(struct pci_dev *pdev,
}
ip->regs = ioc3;
-#ifdef CONFIG_SERIAL
+#ifdef CONFIG_SERIAL_8250
ioc3_serial_probe(pdev, ioc3);
#endif
@@ -1613,6 +1522,7 @@ static void __devexit ioc3_remove_one (struct pci_dev *pdev)
struct ioc3_private *ip = dev->priv;
struct ioc3 *ioc3 = ip->regs;
+ unregister_netdev(dev);
iounmap(ioc3);
pci_release_regions(pdev);
kfree(dev);