# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet v2.6.0-test6 -> 1.1383 # drivers/block/ps2esdi.c 1.69 -> 1.70 # drivers/net/eexpress.c 1.14 -> 1.15 # drivers/scsi/sym53c8xx_2/sym_hipd.c 1.12 -> 1.13 # arch/ia64/sn/io/sn2/module.c 1.3 -> 1.4 # drivers/net/Space.c 1.39 -> 1.40 # fs/jfs/jfs_imap.c 1.27 -> 1.28 # drivers/net/ibmlana.c 1.10 -> 1.11 # include/linux/mca.h 1.7 -> 1.8 # drivers/scsi/ncr53c8xx.c 1.36 -> 1.37 # drivers/net/at1700.c 1.18 -> 1.19 # drivers/net/ne3210.c 1.9 -> 1.10 # drivers/net/3c523.c 1.12 -> 1.13 # drivers/net/tokenring/smctr.c 1.25 -> 1.26 # drivers/ide/legacy/pdc4030.c 1.16 -> 1.17 # drivers/scsi/sym53c8xx_comm.h 1.14 -> 1.15 # drivers/net/3c527.c 1.15 -> 1.16 # arch/ia64/sn/io/sn2/pic.c 1.4 -> 1.5 # drivers/net/wireless/arlan-main.c 1.28 -> 1.30 # drivers/net/sk_mca.c 1.15 -> 1.16 # drivers/char/agp/amd64-agp.c 1.63 -> 1.64 # include/linux/hdlcdrv.h 1.3 -> 1.4 # drivers/mca/mca-proc.c 1.2 -> 1.3 # drivers/scsi/sym53c8xx_2/sym_misc.c 1.1 -> 1.2 # drivers/net/tokenring/madgemc.c 1.16 -> 1.17 # drivers/block/cciss.c 1.95 -> 1.96 # include/linux/mca-legacy.h 1.3 -> 1.4 # drivers/net/ne2.c 1.10 -> 1.11 # drivers/scsi/sym53c8xx_2/sym_glue.h 1.14 -> 1.15 # drivers/mca/mca-legacy.c 1.5 -> 1.6 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/27 torvalds@home.osdl.org 1.1375 # Linux 2.6.0-test6 # -------------------------------------------- # 03/09/28 jgarzik@redhat.com 1.1376 # [MCA] include linux/mca-legacy.h directly, to access deprecated MCA API # -------------------------------------------- # 03/09/28 jgarzik@redhat.com 1.1377 # [MCA] convert mca-proc to use not-deprecated functions # -------------------------------------------- # 03/09/28 jgarzik@redhat.com 1.1378 # [MCA] don't include linux/mca-legacy.h from linux/mca.h. # # As the functions and definitions in linux/mca-legacy.h are deprecated, # require that users explicitly include linux/mca-legacy.h as needed. # # Prior to this change, _all_ users of linux/mca.h (i.e. proper users) # issued a warning at compile time, when the MCA legacy API was enabled. # Now only actual users of the legacy API cause warnings, not all MCA drivers. # -------------------------------------------- # 03/09/28 jgarzik@redhat.com 1.1379 # [wireless arlan] fix modular build # # 'probe' module parameter is only used when arlan is built as a module. # -------------------------------------------- # 03/09/28 jgarzik@redhat.com 1.1380 # Misc warning fixes: # * block/cciss: eliminate "comparison always false" warning # * char/agp/amd64-agp: properly suffix 64-bit constants # * ide/legacy/pdc4030: fix incomplete conversion to new IDE module API # -------------------------------------------- # 03/09/28 jgarzik@redhat.com 1.1375.1.1 # [janitor] Replace bcopy() uses with memcpy(), where possible. # # Affects: JFS, scsi/{sym,sym2}, arch/ia64/sn/io/sn2/{module,pic}.c # -------------------------------------------- # 03/09/28 jgarzik@redhat.com 1.1381 # [BK] "bk ignore" aic7xxx auto-generated files # -------------------------------------------- # 03/09/28 romieu@fr.zoreil.com 1.1375.2.1 # [PATCH] Fix debug statement after return in drivers/net/wireless/arlan-main.c # # This patch applies to 2.5.68 and is listed on kbugs.org. The debug statement # is never executed because it is after a return. # -------------------------------------------- # 03/09/28 shemminger@osdl.org 1.1375.2.2 # [PATCH] Fix warnings in hamradio/baycom build # # Sorry, overlooked the corresponding .h file in that patch, here it is. # -------------------------------------------- # 03/09/28 mzyngier@freesurf.fr 1.1375.2.3 # [PATCH] ne3210 update # # The enclosed patch ports the ne3210 driver over the EISA probing API. # # It also fixes some ioremap/isa_memcopy_fromio problems (depending on # where the card memory was mapped) by using ioremap unconditionally and # letting memcopy_fromio do the right thing. # # Finally, it removes the card from Space.c (warning, potential # interface renumbering !). # # The module options are currently disabled, until Rusty's # module_param_array() patch is included. I will re-introduce them ASAP. # # Quite heavily tested on x86. # -------------------------------------------- # 03/09/28 torvalds@home.osdl.org 1.1382 # Merge bk://kernel.bkbits.net/jgarzik/misc-2.5 # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/09/28 torvalds@home.osdl.org 1.1383 # Merge bk://kernel.bkbits.net/jgarzik/bcopy-2.5 # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # diff -Nru a/arch/ia64/sn/io/sn2/module.c b/arch/ia64/sn/io/sn2/module.c --- a/arch/ia64/sn/io/sn2/module.c Sun Sep 28 15:49:42 2003 +++ b/arch/ia64/sn/io/sn2/module.c Sun Sep 28 15:49:42 2003 @@ -166,7 +166,6 @@ { lboard_t *board; klmod_serial_num_t *comp; - char * bcopy(const char * src, char * dest, int count); char serial_number[16]; /* @@ -215,9 +214,9 @@ #endif if (comp->snum.snum_str[0] != '\0') { - bcopy(comp->snum.snum_str, - m->sys_snum, - MAX_SERIAL_NUM_SIZE); + memcpy(m->sys_snum, + comp->snum.snum_str, + MAX_SERIAL_NUM_SIZE); m->sys_snum_valid = 1; } } diff -Nru a/arch/ia64/sn/io/sn2/pic.c b/arch/ia64/sn/io/sn2/pic.c --- a/arch/ia64/sn/io/sn2/pic.c Sun Sep 28 15:49:42 2003 +++ b/arch/ia64/sn/io/sn2/pic.c Sun Sep 28 15:49:42 2003 @@ -29,8 +29,6 @@ #include #include -extern char *bcopy(const char * src, char * dest, int count); - #define PCI_BUS_NO_1 1 @@ -51,7 +49,7 @@ (arbitrary_info_t *)&pinv) == GRAPH_SUCCESS) { NEW(peer_pinv); - bcopy((const char *)pinv, (char *)peer_pinv, sizeof(inventory_t)); + memcpy(peer_pinv, pinv, sizeof(inventory_t)); if (hwgraph_info_add_LBL(peer_conn_v, INFO_LBL_INVENT, (arbitrary_info_t)peer_pinv) != GRAPH_SUCCESS) { DEL(peer_pinv); diff -Nru a/drivers/block/cciss.c b/drivers/block/cciss.c --- a/drivers/block/cciss.c Sun Sep 28 15:49:42 2003 +++ b/drivers/block/cciss.c Sun Sep 28 15:49:42 2003 @@ -636,9 +636,11 @@ { return -EINVAL; } +#if 0 /* 'buf_size' member is 16-bits, and always smaller than kmalloc limit */ /* Check kmalloc limits */ if(iocommand.buf_size > 128000) return -EINVAL; +#endif if(iocommand.buf_size > 0) { buff = kmalloc(iocommand.buf_size, GFP_KERNEL); diff -Nru a/drivers/block/ps2esdi.c b/drivers/block/ps2esdi.c --- a/drivers/block/ps2esdi.c Sun Sep 28 15:49:42 2003 +++ b/drivers/block/ps2esdi.c Sun Sep 28 15:49:42 2003 @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c --- a/drivers/char/agp/amd64-agp.c Sun Sep 28 15:49:42 2003 +++ b/drivers/char/agp/amd64-agp.c Sun Sep 28 15:49:42 2003 @@ -91,9 +91,9 @@ for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { tmp = agp_bridge->driver->mask_memory(mem->memory[i], mem->type); - BUG_ON(tmp & 0xffffff0000000ffc); - pte = (tmp & 0x000000ff00000000) >> 28; - pte |=(tmp & 0x00000000fffff000); + BUG_ON(tmp & 0xffffff0000000ffcULL); + pte = (tmp & 0x000000ff00000000ULL) >> 28; + pte |=(tmp & 0x00000000fffff000ULL); pte |= GPTE_VALID | GPTE_COHERENT; agp_bridge->gatt_table[j] = pte; diff -Nru a/drivers/ide/legacy/pdc4030.c b/drivers/ide/legacy/pdc4030.c --- a/drivers/ide/legacy/pdc4030.c Sun Sep 28 15:49:42 2003 +++ b/drivers/ide/legacy/pdc4030.c Sun Sep 28 15:49:42 2003 @@ -304,22 +304,16 @@ #ifndef MODULE if (enable_promise_support == 0) - return; + return 0; #endif for (index = 0; index < MAX_HWIFS; index++) { hwif = &ide_hwifs[index]; - if (hwif->chipset == ide_unknown && detect_pdc4030(hwif)) { -#ifndef MODULE - setup_pdc4030(hwif); -#else + if (hwif->chipset == ide_unknown && detect_pdc4030(hwif)) return setup_pdc4030(hwif); -#endif - } } -#ifdef MODULE + return 0; -#endif } static void __exit release_pdc4030(ide_hwif_t *hwif, ide_hwif_t *mate) diff -Nru a/drivers/mca/mca-legacy.c b/drivers/mca/mca-legacy.c --- a/drivers/mca/mca-legacy.c Sun Sep 28 15:49:42 2003 +++ b/drivers/mca/mca-legacy.c Sun Sep 28 15:49:42 2003 @@ -28,7 +28,7 @@ #include #include -#include +#include #include /* NOTE: This structure is stack allocated */ diff -Nru a/drivers/mca/mca-proc.c b/drivers/mca/mca-proc.c --- a/drivers/mca/mca-proc.c Sun Sep 28 15:49:42 2003 +++ b/drivers/mca/mca-proc.c Sun Sep 28 15:49:42 2003 @@ -120,12 +120,13 @@ len += sprintf(buf+len, "Id: %02x%02x\n", mca_dev->pos[1], mca_dev->pos[0]); len += sprintf(buf+len, "Enabled: %s\nPOS: ", - mca_isenabled(slot) ? "Yes" : "No"); + mca_device_status(mca_dev) == MCA_ADAPTER_NORMAL ? + "Yes" : "No"); for(i=0; i<8; i++) { len += sprintf(buf+len, "%02x ", mca_dev->pos[i]); } len += sprintf(buf+len, "\nDriver Installed: %s", - mca_is_adapter_used(slot) ? "Yes" : "No"); + mca_device_claimed(mca_dev) ? "Yes" : "No"); buf[len++] = '\n'; buf[len] = 0; @@ -189,6 +190,7 @@ /* Initialize /proc/mca entries for existing adapters */ for(i = 0; i < MCA_NUMADAPTERS; i++) { + enum MCA_AdapterStatus status; mca_dev = mca_find_device_by_slot(i); if(!mca_dev) continue; @@ -200,7 +202,10 @@ else if(i == MCA_INTEGSCSI) sprintf(mca_dev->procname,"scsi"); else if(i == MCA_MOTHERBOARD) sprintf(mca_dev->procname,"planar"); - if(!mca_isadapter(i)) continue; + status = mca_device_status(mca_dev); + if (status != MCA_ADAPTER_NORMAL && + status != MCA_ADAPTER_DISABLED) + continue; node = create_proc_read_entry(mca_dev->procname, 0, proc_mca, mca_read_proc, (void *)mca_dev); diff -Nru a/drivers/net/3c523.c b/drivers/net/3c523.c --- a/drivers/net/3c523.c Sun Sep 28 15:49:42 2003 +++ b/drivers/net/3c523.c Sun Sep 28 15:49:42 2003 @@ -102,7 +102,7 @@ #include #include #include -#include +#include #include #include diff -Nru a/drivers/net/3c527.c b/drivers/net/3c527.c --- a/drivers/net/3c527.c Sun Sep 28 15:49:42 2003 +++ b/drivers/net/3c527.c Sun Sep 28 15:49:42 2003 @@ -92,7 +92,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Sun Sep 28 15:49:42 2003 +++ b/drivers/net/Space.c Sun Sep 28 15:49:42 2003 @@ -67,7 +67,6 @@ extern int ac3200_probe(struct net_device *); extern int es_probe(struct net_device *); extern int lne390_probe(struct net_device *); -extern int ne3210_probe(struct net_device *); extern int e2100_probe(struct net_device *); extern int ni5010_probe(struct net_device *); extern int ni52_probe(struct net_device *); @@ -154,9 +153,6 @@ #endif #ifdef CONFIG_LNE390 {lne390_probe, 0}, -#endif -#ifdef CONFIG_NE3210 - {ne3210_probe, 0}, #endif {NULL, 0}, }; diff -Nru a/drivers/net/at1700.c b/drivers/net/at1700.c --- a/drivers/net/at1700.c Sun Sep 28 15:49:42 2003 +++ b/drivers/net/at1700.c Sun Sep 28 15:49:42 2003 @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/drivers/net/eexpress.c b/drivers/net/eexpress.c --- a/drivers/net/eexpress.c Sun Sep 28 15:49:42 2003 +++ b/drivers/net/eexpress.c Sun Sep 28 15:49:42 2003 @@ -113,7 +113,6 @@ #include #include #include -#include #include #include diff -Nru a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c --- a/drivers/net/ibmlana.c Sun Sep 28 15:49:42 2003 +++ b/drivers/net/ibmlana.c Sun Sep 28 15:49:42 2003 @@ -82,7 +82,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/drivers/net/ne2.c b/drivers/net/ne2.c --- a/drivers/net/ne2.c Sun Sep 28 15:49:42 2003 +++ b/drivers/net/ne2.c Sun Sep 28 15:49:42 2003 @@ -70,7 +70,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/drivers/net/ne3210.c b/drivers/net/ne3210.c --- a/drivers/net/ne3210.c Sun Sep 28 15:49:42 2003 +++ b/drivers/net/ne3210.c Sun Sep 28 15:49:42 2003 @@ -23,6 +23,7 @@ This driver WILL NOT WORK FOR THE NE3200 - it is completely different and does not use an 8390 at all. + Updated to EISA probing API 5/2003 by Marc Zyngier. */ static const char *version = @@ -44,9 +45,6 @@ #include "8390.h" -int ne3210_probe(struct net_device *dev); -static int ne3210_probe1(struct net_device *dev, int ioaddr); - static int ne3210_open(struct net_device *dev); static int ne3210_close(struct net_device *dev); @@ -59,7 +57,6 @@ #define NE3210_START_PG 0x00 /* First page of TX buffer */ #define NE3210_STOP_PG 0x80 /* Last page +1 of RX ring */ -#define NE3210_ID_PORT 0xc80 /* Same for all EISA cards */ #define NE3210_IO_EXTENT 0x20 #define NE3210_SA_PROM 0x16 /* Start of e'net addr. */ #define NE3210_RESET_PORT 0xc84 @@ -69,10 +66,9 @@ #define NE3210_ADDR1 0x00 #define NE3210_ADDR2 0x1b -#define NE3210_ID 0x0118cc3a /* 0x3acc = 1110 10110 01100 = nvl */ - #define NE3210_CFG1 0xc84 /* NB: 0xc84 is also "reset" port. */ #define NE3210_CFG2 0xc90 +#define NE3210_CFG_EXTENT (NE3210_CFG2 - NE3210_CFG1 + 1) /* * You can OR any of the following bits together and assign it @@ -89,152 +85,108 @@ static unsigned char irq_map[] __initdata = {15, 12, 11, 10, 9, 7, 5, 3}; static unsigned int shmem_map[] __initdata = {0xff0, 0xfe0, 0xfff0, 0xd8, 0xffe0, 0xffc0, 0xd0, 0x0}; +static const char *ifmap[] __initdata = {"UTP", "?", "BNC", "AUI"}; +static int ifmap_val[] __initdata = { + IF_PORT_10BASET, + IF_PORT_UNKNOWN, + IF_PORT_10BASE2, + IF_PORT_AUI, +}; -/* - * Probe for the card. The best way is to read the EISA ID if it - * is known. Then we can check the prefix of the station address - * PROM for a match against the value assigned to Novell. - */ - -int __init ne3210_probe(struct net_device *dev) +static int __init ne3210_eisa_probe (struct device *device) { - unsigned short ioaddr = dev->base_addr; - - SET_MODULE_OWNER(dev); + unsigned long ioaddr, phys_mem; + int i, retval, port_index; + struct eisa_device *edev = to_eisa_device (device); + struct net_device *dev; - if (ioaddr > 0x1ff) /* Check a single specified location. */ - return ne3210_probe1(dev, ioaddr); - else if (ioaddr > 0) /* Don't probe at all. */ - return -ENXIO; - - if (!EISA_bus) { -#if NE3210_DEBUG & NE3210_D_PROBE - printk("ne3210-debug: Not an EISA bus. Not probing high ports.\n"); -#endif - return -ENXIO; + /* Allocate dev->priv and fill in 8390 specific dev fields. */ + if (!(dev = alloc_ei_netdev ())) { + printk ("ne3210.c: unable to allocate memory for dev!\n"); + return -ENOMEM; } - /* EISA spec allows for up to 16 slots, but 8 is typical. */ - for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) - if (ne3210_probe1(dev, ioaddr) == 0) - return 0; - - return -ENODEV; -} - -static int __init ne3210_probe1(struct net_device *dev, int ioaddr) -{ - int i, retval; - unsigned long eisa_id; - const char *ifmap[] = {"UTP", "?", "BNC", "AUI"}; - - if (!request_region(dev->base_addr, NE3210_IO_EXTENT, dev->name)) - return -EBUSY; + SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev, device); + device->driver_data = dev; + ioaddr = edev->base_addr; - if (inb_p(ioaddr + NE3210_ID_PORT) == 0xff) { - retval = -ENODEV; + if (ethdev_init (dev)) { + printk ("ne3210.c: unable to allocate memory for dev->priv!\n"); + retval = -ENOMEM; goto out; } -#if NE3210_DEBUG & NE3210_D_PROBE - printk("ne3210-debug: probe at %#x, ID %#8x\n", ioaddr, inl(ioaddr + NE3210_ID_PORT)); - printk("ne3210-debug: config regs: %#x %#x\n", - inb(ioaddr + NE3210_CFG1), inb(ioaddr + NE3210_CFG2)); -#endif - - -/* Check the EISA ID of the card. */ - eisa_id = inl(ioaddr + NE3210_ID_PORT); - if (eisa_id != NE3210_ID) { - retval = -ENODEV; + if (!request_region(ioaddr, NE3210_IO_EXTENT, dev->name)) { + retval = -EBUSY; goto out; } - -#if 0 -/* Check the vendor ID as well. Not really required. */ - if (inb(ioaddr + NE3210_SA_PROM + 0) != NE3210_ADDR0 - || inb(ioaddr + NE3210_SA_PROM + 1) != NE3210_ADDR1 - || inb(ioaddr + NE3210_SA_PROM + 2) != NE3210_ADDR2 ) { - printk("ne3210.c: card not found"); - for(i = 0; i < ETHER_ADDR_LEN; i++) - printk(" %02x", inb(ioaddr + NE3210_SA_PROM + i)); - printk(" (invalid prefix).\n"); - retval = -ENODEV; - goto out; + if (!request_region(ioaddr + NE3210_CFG1, + NE3210_CFG_EXTENT, dev->name)) { + retval = -EBUSY; + goto out1; } + +#if NE3210_DEBUG & NE3210_D_PROBE + printk("ne3210-debug: probe at %#x, ID %s\n", ioaddr, edev->id.sig); + printk("ne3210-debug: config regs: %#x %#x\n", + inb(ioaddr + NE3210_CFG1), inb(ioaddr + NE3210_CFG2)); #endif - /* Allocate dev->priv and fill in 8390 specific dev fields. */ - if (ethdev_init(dev)) { - printk ("ne3210.c: unable to allocate memory for dev->priv!\n"); - retval = -ENOMEM; - goto out; - } + port_index = inb(ioaddr + NE3210_CFG2) >> 6; printk("ne3210.c: NE3210 in EISA slot %d, media: %s, addr:", - ioaddr/0x1000, ifmap[inb(ioaddr + NE3210_CFG2) >> 6]); + edev->slot, ifmap[port_index]); for(i = 0; i < ETHER_ADDR_LEN; i++) printk(" %02x", (dev->dev_addr[i] = inb(ioaddr + NE3210_SA_PROM + i))); - printk(".\nne3210.c: "); + /* Snarf the interrupt now. CFG file has them all listed as `edge' with share=NO */ - if (dev->irq == 0) { - unsigned char irq_reg = inb(ioaddr + NE3210_CFG2) >> 3; - dev->irq = irq_map[irq_reg & 0x07]; - printk("using"); - } else { - /* This is useless unless we reprogram the card here too */ - if (dev->irq == 2) dev->irq = 9; /* Doh! */ - printk("assigning"); - } - printk(" IRQ %d,", dev->irq); + dev->irq = irq_map[(inb(ioaddr + NE3210_CFG2) >> 3) & 0x07]; + printk(".\nne3210.c: using IRQ %d, ", dev->irq); retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev); if (retval) { printk (" unable to get IRQ %d.\n", dev->irq); - goto out1; - } - - if (dev->mem_start == 0) { - unsigned char mem_reg = inb(ioaddr + NE3210_CFG2) & 0x07; - dev->mem_start = shmem_map[mem_reg] * 0x1000; - printk(" using "); - } else { - /* Should check for value in shmem_map and reprogram the card to use it */ - dev->mem_start &= 0xfff8000; - printk(" assigning "); + goto out2; } - printk("%dkB memory at physical address %#lx\n", - NE3210_STOP_PG/4, dev->mem_start); + phys_mem = shmem_map[inb(ioaddr + NE3210_CFG2) & 0x07] * 0x1000; /* BEWARE!! Some dain-bramaged EISA SCUs will allow you to put the card mem within the region covered by `normal' RAM !!! */ - if (dev->mem_start > 1024*1024) { /* phys addr > 1MB */ - if (dev->mem_start < virt_to_phys(high_memory)) { + if (phys_mem > 1024*1024) { /* phys addr > 1MB */ + if (phys_mem < virt_to_phys(high_memory)) { printk(KERN_CRIT "ne3210.c: Card RAM overlaps with normal memory!!!\n"); printk(KERN_CRIT "ne3210.c: Use EISA SCU to set card memory below 1MB,\n"); printk(KERN_CRIT "ne3210.c: or to an address above 0x%lx.\n", virt_to_phys(high_memory)); printk(KERN_CRIT "ne3210.c: Driver NOT installed.\n"); retval = -EINVAL; - goto out2; + goto out3; } - dev->mem_start = (unsigned long)ioremap(dev->mem_start, NE3210_STOP_PG*0x100); - if (dev->mem_start == 0) { - printk(KERN_ERR "ne3210.c: Unable to remap card memory above 1MB !!\n"); - printk(KERN_ERR "ne3210.c: Try using EISA SCU to set memory below 1MB.\n"); - printk(KERN_ERR "ne3210.c: Driver NOT installed.\n"); - retval = -EAGAIN; - goto out2; - } - ei_status.reg0 = 1; /* Use as remap flag */ - printk("ne3210.c: remapped %dkB card memory to virtual address %#lx\n", - NE3210_STOP_PG/4, dev->mem_start); } + + if (!request_mem_region (phys_mem, NE3210_STOP_PG*0x100, dev->name)) { + printk ("ne3210.c: Unable to request shared memory at physical address %#lx\n", + phys_mem); + goto out3; + } + + printk("%dkB memory at physical address %#lx\n", + NE3210_STOP_PG/4, phys_mem); + dev->mem_start = (unsigned long)ioremap(phys_mem, NE3210_STOP_PG*0x100); + if (dev->mem_start == 0) { + printk(KERN_ERR "ne3210.c: Unable to remap card memory !!\n"); + printk(KERN_ERR "ne3210.c: Driver NOT installed.\n"); + retval = -EAGAIN; + goto out4; + } + printk("ne3210.c: remapped %dkB card memory to virtual address %#lx\n", + NE3210_STOP_PG/4, dev->mem_start); dev->mem_end = ei_status.rmem_end = dev->mem_start + (NE3210_STOP_PG - NE3210_START_PG)*256; ei_status.rmem_start = dev->mem_start + TX_PAGES*256; @@ -247,6 +199,7 @@ ei_status.rx_start_page = NE3210_START_PG + TX_PAGES; ei_status.stop_page = NE3210_STOP_PG; ei_status.word16 = 1; + ei_status.priv = phys_mem; if (ei_debug > 0) printk(version); @@ -258,18 +211,46 @@ dev->open = &ne3210_open; dev->stop = &ne3210_close; + dev->if_port = ifmap_val[port_index]; + + if ((retval = register_netdev (dev))) + goto out5; + NS8390_init(dev, 0); return 0; -out2: - free_irq(dev->irq, dev); -out1: - kfree(dev->priv); - dev->priv = NULL; -out: - release_region(ioaddr, NE3210_IO_EXTENT); + + out5: + iounmap((void *)dev->mem_start); + out4: + release_mem_region (phys_mem, NE3210_STOP_PG*0x100); + out3: + free_irq (dev->irq, dev); + out2: + release_region (ioaddr + NE3210_CFG1, NE3210_CFG_EXTENT); + out1: + release_region (ioaddr, NE3210_IO_EXTENT); + out: + free_netdev (dev); + return retval; } +static int __devexit ne3210_eisa_remove (struct device *device) +{ + struct net_device *dev = device->driver_data; + unsigned long ioaddr = to_eisa_device (device)->base_addr; + + unregister_netdev (dev); + iounmap((void *)dev->mem_start); + release_mem_region (ei_status.priv, NE3210_STOP_PG*0x100); + free_irq (dev->irq, dev); + release_region (ioaddr + NE3210_CFG1, NE3210_CFG_EXTENT); + release_region (ioaddr, NE3210_IO_EXTENT); + free_netdev (dev); + + return 0; +} + /* * Reset by toggling the "Board Enable" bits (bit 2 and 0). */ @@ -309,7 +290,7 @@ ne3210_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page) { unsigned long hdr_start = dev->mem_start + ((ring_page - NE3210_START_PG)<<8); - isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); + memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); hdr->count = (hdr->count + 3) & ~3; /* Round up allocation. */ } @@ -327,12 +308,12 @@ if (xfer_start + count > ei_status.rmem_end) { /* Packet wraps over end of ring buffer. */ int semi_count = ei_status.rmem_end - xfer_start; - isa_memcpy_fromio(skb->data, xfer_start, semi_count); + memcpy_fromio(skb->data, xfer_start, semi_count); count -= semi_count; - isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count); + memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count); } else { /* Packet is in one chunk. */ - isa_memcpy_fromio(skb->data, xfer_start, count); + memcpy_fromio(skb->data, xfer_start, count); } } @@ -342,7 +323,7 @@ unsigned long shmem = dev->mem_start + ((start_page - NE3210_START_PG)<<8); count = (count + 3) & ~3; /* Round up to doubleword */ - isa_memcpy_toio(shmem, buf, count); + memcpy_toio(shmem, buf, count); } static int ne3210_open(struct net_device *dev) @@ -361,7 +342,23 @@ return 0; } +static struct eisa_device_id ne3210_ids[] = { + { "EGL0101" }, + { "NVL1801" }, + { "" }, +}; + +static struct eisa_driver ne3210_eisa_driver = { + .id_table = ne3210_ids, + .driver = { + .name = "ne3210", + .probe = ne3210_eisa_probe, + .remove = __devexit_p (ne3210_eisa_remove), + }, +}; + #ifdef MODULE +#if 0 #define MAX_NE3210_CARDS 4 /* Max number of NE3210 cards per module */ static struct net_device dev_ne3210[MAX_NE3210_CARDS]; static int io[MAX_NE3210_CARDS]; @@ -374,50 +371,22 @@ MODULE_PARM_DESC(io, "I/O base address(es)"); MODULE_PARM_DESC(irq, "IRQ number(s)"); MODULE_PARM_DESC(mem, "memory base address(es)"); +#endif +#endif /* MODULE */ + + MODULE_DESCRIPTION("NE3210 EISA Ethernet driver"); MODULE_LICENSE("GPL"); -int init_module(void) +int ne3210_init(void) { - int this_dev, found = 0; - - for (this_dev = 0; this_dev < MAX_NE3210_CARDS; this_dev++) { - struct net_device *dev = &dev_ne3210[this_dev]; - dev->irq = irq[this_dev]; - dev->base_addr = io[this_dev]; - dev->mem_start = mem[this_dev]; - dev->init = ne3210_probe; - /* Default is to only install one card. */ - if (io[this_dev] == 0 && this_dev != 0) break; - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "ne3210.c: No NE3210 card found (i/o = 0x%x).\n", io[this_dev]); - if (found != 0) { /* Got at least one. */ - return 0; - } - return -ENXIO; - } - found++; - } - return 0; + return eisa_driver_register (&ne3210_eisa_driver); } -void cleanup_module(void) +void ne3210_cleanup(void) { - int this_dev; - - for (this_dev = 0; this_dev < MAX_NE3210_CARDS; this_dev++) { - struct net_device *dev = &dev_ne3210[this_dev]; - if (dev->priv != NULL) { - free_irq(dev->irq, dev); - release_region(dev->base_addr, NE3210_IO_EXTENT); - if (ei_status.reg0) - iounmap((void *)dev->mem_start); - unregister_netdev(dev); - kfree(dev->priv); - dev->priv = NULL; - } - } + eisa_driver_unregister (&ne3210_eisa_driver); } -#endif /* MODULE */ - +module_init (ne3210_init); +module_exit (ne3210_cleanup); diff -Nru a/drivers/net/sk_mca.c b/drivers/net/sk_mca.c --- a/drivers/net/sk_mca.c Sun Sep 28 15:49:42 2003 +++ b/drivers/net/sk_mca.c Sun Sep 28 15:49:42 2003 @@ -89,7 +89,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c --- a/drivers/net/tokenring/madgemc.c Sun Sep 28 15:49:42 2003 +++ b/drivers/net/tokenring/madgemc.c Sun Sep 28 15:49:42 2003 @@ -20,7 +20,7 @@ static const char version[] = "madgemc.c: v0.91 23/01/2000 by Adam Fritzler\n"; #include -#include +#include #include #include #include diff -Nru a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c --- a/drivers/net/tokenring/smctr.c Sun Sep 28 15:49:42 2003 +++ b/drivers/net/tokenring/smctr.c Sun Sep 28 15:49:42 2003 @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c --- a/drivers/net/wireless/arlan-main.c Sun Sep 28 15:49:42 2003 +++ b/drivers/net/wireless/arlan-main.c Sun Sep 28 15:49:42 2003 @@ -721,9 +721,9 @@ else { netif_stop_queue (dev); - return -1; IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_ERR "TX TAIL & HEAD full, return, tailStart %d headEnd %d\n", tailStarts, headEnds); + return -1; } priv->out_bytes += length; priv->out_bytes10 += length; @@ -1880,6 +1880,8 @@ } #ifdef MODULE + +static int probe = probeUNKNOWN; static int __init arlan_find_devices(void) { diff -Nru a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c --- a/drivers/scsi/ncr53c8xx.c Sun Sep 28 15:49:42 2003 +++ b/drivers/scsi/ncr53c8xx.c Sun Sep 28 15:49:42 2003 @@ -7757,7 +7757,7 @@ cp->start.schedule.l_cmd = cpu_to_scr(SCR_JUMP); cp->start.p_phys = cpu_to_scr(CCB_PHYS(cp, phys)); - bcopy(&cp->start, &cp->restart, sizeof(cp->restart)); + memcpy(&cp->restart, &cp->start, sizeof(cp->restart)); cp->start.schedule.l_paddr = cpu_to_scr(NCB_SCRIPT_PHYS (np, idle)); cp->restart.schedule.l_paddr = cpu_to_scr(NCB_SCRIPTH_PHYS (np, abort)); diff -Nru a/drivers/scsi/sym53c8xx_2/sym_glue.h b/drivers/scsi/sym53c8xx_2/sym_glue.h --- a/drivers/scsi/sym53c8xx_2/sym_glue.h Sun Sep 28 15:49:42 2003 +++ b/drivers/scsi/sym53c8xx_2/sym_glue.h Sun Sep 28 15:49:42 2003 @@ -70,10 +70,6 @@ #include #include "../scsi.h" /* XXX: DID_* */ -#ifndef bcopy -#define bcopy(s, d, n) memcpy((d), (s), (n)) -#endif - #ifndef bzero #define bzero(d, n) memset((d), 0, (n)) #endif diff -Nru a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c --- a/drivers/scsi/sym53c8xx_2/sym_hipd.c Sun Sep 28 15:49:42 2003 +++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c Sun Sep 28 15:49:42 2003 @@ -5889,9 +5889,9 @@ /* * Copy scripts to controller instance. */ - bcopy(fw->a_base, np->scripta0, np->scripta_sz); - bcopy(fw->b_base, np->scriptb0, np->scriptb_sz); - bcopy(fw->z_base, np->scriptz0, np->scriptz_sz); + memcpy(np->scripta0, fw->a_base, np->scripta_sz); + memcpy(np->scriptb0, fw->b_base, np->scriptb_sz); + memcpy(np->scriptz0, fw->z_base, np->scriptz_sz); /* * Setup variable parts in scripts and compute diff -Nru a/drivers/scsi/sym53c8xx_2/sym_misc.c b/drivers/scsi/sym53c8xx_2/sym_misc.c --- a/drivers/scsi/sym53c8xx_2/sym_misc.c Sun Sep 28 15:49:42 2003 +++ b/drivers/scsi/sym53c8xx_2/sym_misc.c Sun Sep 28 15:49:42 2003 @@ -225,7 +225,7 @@ */ void sym_update_trans_settings(hcb_p np, tcb_p tp) { - bcopy(&tp->tinfo.user, &tp->tinfo.goal, sizeof(tp->tinfo.goal)); + memcpy(&tp->tinfo.goal, &tp->tinfo.user, sizeof(tp->tinfo.goal)); if (tp->inq_version >= 4) { switch(tp->inq_byte56 & INQ56_CLOCKING) { diff -Nru a/drivers/scsi/sym53c8xx_comm.h b/drivers/scsi/sym53c8xx_comm.h --- a/drivers/scsi/sym53c8xx_comm.h Sun Sep 28 15:49:42 2003 +++ b/drivers/scsi/sym53c8xx_comm.h Sun Sep 28 15:49:42 2003 @@ -88,10 +88,6 @@ #define u_int unsigned int #define u_long unsigned long -#ifndef bcopy -#define bcopy(s, d, n) memcpy((d), (s), (n)) -#endif - #ifndef bcmp #define bcmp(s, d, n) memcmp((d), (s), (n)) #endif diff -Nru a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c --- a/fs/jfs/jfs_imap.c Sun Sep 28 15:49:42 2003 +++ b/fs/jfs/jfs_imap.c Sun Sep 28 15:49:42 2003 @@ -838,7 +838,7 @@ */ if (S_ISDIR(ip->i_mode) && (ip->i_ipmnt->i_mntflag & JFS_DASD_ENABLED)) - bcopy(&ip->i_DASD, &dp->di_DASD, sizeof(struct dasd)); + memcpy(&dp->di_DASD, &ip->i_DASD, sizeof(struct dasd)); #endif /* _JFS_FASTDASD */ /* release the buffer holding the updated on-disk inode. diff -Nru a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h --- a/include/linux/hdlcdrv.h Sun Sep 28 15:49:42 2003 +++ b/include/linux/hdlcdrv.h Sun Sep 28 15:49:42 2003 @@ -359,11 +359,11 @@ void hdlcdrv_receiver(struct net_device *, struct hdlcdrv_state *); void hdlcdrv_transmitter(struct net_device *, struct hdlcdrv_state *); void hdlcdrv_arbitrate(struct net_device *, struct hdlcdrv_state *); -int hdlcdrv_register_hdlcdrv(struct net_device *dev, const struct hdlcdrv_ops *ops, - unsigned int privsize, char *ifname, - unsigned int baseaddr, unsigned int irq, - unsigned int dma); -int hdlcdrv_unregister_hdlcdrv(struct net_device *dev); +struct net_device *hdlcdrv_register(const struct hdlcdrv_ops *ops, + unsigned int privsize, const char *ifname, + unsigned int baseaddr, unsigned int irq, + unsigned int dma); +void hdlcdrv_unregister(struct net_device *dev); /* -------------------------------------------------------------------- */ diff -Nru a/include/linux/mca-legacy.h b/include/linux/mca-legacy.h --- a/include/linux/mca-legacy.h Sun Sep 28 15:49:42 2003 +++ b/include/linux/mca-legacy.h Sun Sep 28 15:49:42 2003 @@ -7,6 +7,8 @@ #ifndef _LINUX_MCA_LEGACY_H #define _LINUX_MCA_LEGACY_H +#include + #warning "MCA legacy - please move your driver to the new sysfs api" /* MCA_NOTFOUND is an error condition. The other two indicate diff -Nru a/include/linux/mca.h b/include/linux/mca.h --- a/include/linux/mca.h Sun Sep 28 15:49:42 2003 +++ b/include/linux/mca.h Sun Sep 28 15:49:42 2003 @@ -136,10 +136,6 @@ /* WARNING: only called by the boot time device setup */ extern int mca_register_device(int bus, struct mca_device *mca_dev); -#ifdef CONFIG_MCA_LEGACY -#include -#endif - #ifdef CONFIG_MCA_PROC_FS extern void mca_do_proc_init(void); extern void mca_set_adapter_procfn(int slot, MCA_ProcFn, void* dev);