diff -Nru a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c --- a/drivers/net/appletalk/cops.c Thu Jul 10 19:52:01 2003 +++ b/drivers/net/appletalk/cops.c Thu Jul 10 19:52:01 2003 @@ -424,7 +424,7 @@ init_timer(&cops_timer); cops_timer.function = cops_poll; cops_timer.data = (unsigned long)dev; - cops_timer.expires = jiffies + 5; + cops_timer.expires = jiffies + HZ/20; add_timer(&cops_timer); } else @@ -700,7 +700,8 @@ status = inb(ioaddr+TANG_CARD_STATUS); } while((++boguscount < 20) && (status&(TANG_RX_READY|TANG_TX_READY))); - cops_timer.expires = jiffies+5; + /* poll 20 times per second */ + cops_timer.expires = jiffies + HZ/20; add_timer(&cops_timer); return; diff -Nru a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c --- a/drivers/net/appletalk/ltpc.c Thu Jul 10 19:52:01 2003 +++ b/drivers/net/appletalk/ltpc.c Thu Jul 10 19:52:01 2003 @@ -926,8 +926,9 @@ if (!dev) return; /* we've been downed */ + /* poll 20 times per second */ idle(dev); - ltpc_timer.expires = jiffies+5; + ltpc_timer.expires = jiffies + HZ/20; add_timer(<pc_timer); } @@ -1217,7 +1218,7 @@ ltpc_timer.function=ltpc_poll; ltpc_timer.data = (unsigned long) dev; - ltpc_timer.expires = jiffies + 5; + ltpc_timer.expires = jiffies + HZ/20; add_timer(<pc_timer); } diff -Nru a/drivers/net/declance.c b/drivers/net/declance.c --- a/drivers/net/declance.c Thu Jul 10 19:52:01 2003 +++ b/drivers/net/declance.c Thu Jul 10 19:52:01 2003 @@ -992,7 +992,7 @@ return; if (lp->tx_old != lp->tx_new) { - mod_timer(&lp->multicast_timer, jiffies + 4); + mod_timer(&lp->multicast_timer, jiffies + 4 * HZ/100); netif_wake_queue(dev); return; } diff -Nru a/drivers/net/dgrs.c b/drivers/net/dgrs.c --- a/drivers/net/dgrs.c Thu Jul 10 19:52:01 2003 +++ b/drivers/net/dgrs.c Thu Jul 10 19:52:01 2003 @@ -1252,18 +1252,12 @@ { DGRS_PRIV *priv; struct net_device *dev, *aux; - - /* Allocate and fill new device structure. */ - int dev_size = sizeof(struct net_device) + sizeof(DGRS_PRIV); int i, ret; - dev = (struct net_device *) kmalloc(dev_size, GFP_KERNEL); - + dev = alloc_etherdev(sizeof(DGRS_PRIV)); if (!dev) return -ENOMEM; - memset(dev, 0, dev_size); - dev->priv = ((void *)dev) + sizeof(struct net_device); priv = (DGRS_PRIV *)dev->priv; dev->base_addr = io; @@ -1279,7 +1273,7 @@ dev->init = dgrs_probe1; SET_MODULE_OWNER(dev); - ether_setup(dev); + if (register_netdev(dev) != 0) { kfree(dev); return -EIO; @@ -1302,15 +1296,18 @@ struct net_device *devN; DGRS_PRIV *privN; /* Allocate new dev and priv structures */ - devN = (struct net_device *) kmalloc(dev_size, GFP_KERNEL); - /* Make it an exact copy of dev[0]... */ + devN = alloc_etherdev(sizeof(DGRS_PRIV)); ret = -ENOMEM; if (!devN) goto fail; - memcpy(devN, dev, dev_size); - memset(devN->name, 0, sizeof(devN->name)); - devN->priv = ((void *)devN) + sizeof(struct net_device); + + /* Make it an exact copy of dev[0]... */ + *devN = *dev; + + /* copy the priv structure of dev[0] */ privN = (DGRS_PRIV *)devN->priv; + *privN = *priv; + /* ... and zero out VM areas */ privN->vmem = 0; privN->vplxdma = 0; @@ -1318,9 +1315,11 @@ devN->irq = 0; /* ... and base MAC address off address of 1st port */ devN->dev_addr[5] += i; + /* ... choose a new name */ + strncpy(devN->name, "eth%d", IFNAMSIZ); devN->init = dgrs_initclone; SET_MODULE_OWNER(devN); - ether_setup(devN); + ret = -EIO; if (register_netdev(devN)) { kfree(devN); diff -Nru a/drivers/net/e100/e100_main.c b/drivers/net/e100/e100_main.c --- a/drivers/net/e100/e100_main.c Thu Jul 10 19:52:01 2003 +++ b/drivers/net/e100/e100_main.c Thu Jul 10 19:52:01 2003 @@ -46,6 +46,13 @@ /* Change Log * + * 2.3.18 07/08/03 + * o Bug fix: read skb->len after freeing skb + * [Andrew Morton] akpm@zip.com.au + * o Bug fix: 82557 (with National PHY) timeout during init + * [Adam Kropelin] akropel1@rochester.rr.com + * o Feature add: allow to change Wake On LAN when EEPROM disabled + * * 2.3.13 05/08/03 * o Feature remove: /proc/net/PRO_LAN_Adapters support gone completely * o Feature remove: IDIAG support (use ethtool -t instead) @@ -65,20 +72,6 @@ * o Bug fix: statistic command failure would stop statistic collection. * * 2.2.21 02/11/03 - * o Removed marketing brand strings. Instead, Using generic string - * "Intel(R) PRO/100 Network Connection" for all adapters. - * o Implemented ethtool -S option - * o Strip /proc/net/PRO_LAN_Adapters files for kernel driver - * o Bug fix: Read wrong byte in EEPROM when offset is odd number - * o Bug fix: PHY loopback test fails on ICH devices - * o Bug fix: System panic on e100_close when repeating Hot Remove and - * Add in a team - * o Bug fix: Linux Bonding driver claims adapter's link loss because of - * not updating last_rx field - * o Bug fix: e100 does not check validity of MAC address - * o New feature: added ICH5 support - * - * 2.1.27 11/20/02 */ #include @@ -144,7 +137,7 @@ static inline void e100_tx_skb_free(struct e100_private *bdp, tcb_t *tcb); /* Global Data structures and variables */ char e100_copyright[] __devinitdata = "Copyright (c) 2003 Intel Corporation"; -char e100_driver_version[]="2.3.13-k1"; +char e100_driver_version[]="2.3.18-k1"; const char *e100_full_driver_name = "Intel(R) PRO/100 Network Driver"; char e100_short_driver_name[] = "e100"; static int e100nics = 0; @@ -689,17 +682,16 @@ bdp->wolsupported = 0; bdp->wolopts = 0; + if (bdp->rev_id >= D101A4_REV_ID) + bdp->wolsupported = WAKE_PHY | WAKE_MAGIC; + if (bdp->rev_id >= D101MA_REV_ID) + bdp->wolsupported |= WAKE_UCAST | WAKE_ARP; /* Check if WoL is enabled on EEPROM */ if (e100_eeprom_read(bdp, EEPROM_ID_WORD) & BIT_5) { /* Magic Packet WoL is enabled on device by default */ /* if EEPROM WoL bit is TRUE */ - bdp->wolsupported = WAKE_MAGIC; bdp->wolopts = WAKE_MAGIC; - if (bdp->rev_id >= D101A4_REV_ID) - bdp->wolsupported = WAKE_PHY | WAKE_MAGIC; - if (bdp->rev_id >= D101MA_REV_ID) - bdp->wolsupported |= WAKE_UCAST | WAKE_ARP; } printk(KERN_NOTICE "\n"); diff -Nru a/drivers/net/e100/e100_phy.c b/drivers/net/e100/e100_phy.c --- a/drivers/net/e100/e100_phy.c Thu Jul 10 19:52:01 2003 +++ b/drivers/net/e100/e100_phy.c Thu Jul 10 19:52:01 2003 @@ -919,6 +919,7 @@ unsigned char __devinit e100_phy_init(struct e100_private *bdp) { + e100_phy_reset(bdp); e100_phy_address_detect(bdp); e100_phy_isolate(bdp); e100_phy_id_detect(bdp); @@ -930,7 +931,6 @@ bdp->PhyDelay = 0; bdp->zlock_state = ZLOCK_INITIAL; - e100_phy_reset(bdp); e100_phy_set_speed_duplex(bdp, false); e100_fix_polarity(bdp); diff -Nru a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c --- a/drivers/net/hamradio/mkiss.c Thu Jul 10 19:52:02 2003 +++ b/drivers/net/hamradio/mkiss.c Thu Jul 10 19:52:02 2003 @@ -22,6 +22,8 @@ * Matthias (DG2FEF) Added support for FlexNet CRC (on special request) * Fixed bug in ax25_close(): dev_lock_wait() was * called twice, causing a deadlock. + * Jeroen (PE1RXQ) Removed old MKISS_MAGIC stuff and calls to + * MOD_*_USE_COUNT */ #include @@ -55,15 +57,6 @@ static char banner[] __initdata = KERN_INFO "mkiss: AX.25 Multikiss, Hans Albas PE1AYX\n"; -#define NR_MKISS 4 -#define MKISS_SERIAL_TYPE_NORMAL 1 - -struct mkiss_channel { - int magic; /* magic word */ - int init; /* channel exists? */ - struct tty_struct *tty; /* link to tty control structure */ -}; - typedef struct ax25_ctrl { struct ax_disp ctrl; /* */ struct net_device dev; /* the device */ @@ -310,19 +303,11 @@ /* Send one completely decapsulated AX.25 packet to the AX.25 layer. */ static void ax_bump(struct ax_disp *ax) { - struct ax_disp *tmp_ax; struct sk_buff *skb; - struct mkiss_channel *mkiss; int count; - tmp_ax = ax; - if (ax->rbuff[0] > 0x0f) { - if (ax->mkiss != NULL) { - mkiss= ax->mkiss->tty->driver_data; - if (mkiss->magic == MKISS_DRIVER_MAGIC) - tmp_ax = ax->mkiss; - } else if (ax->rbuff[0] & 0x20) { + if (ax->rbuff[0] & 0x20) { ax->crcmode = CRC_MODE_FLEX; if (check_crc_flex(ax->rbuff, ax->rcount) < 0) { ax->rx_errors++; @@ -346,14 +331,14 @@ return; } - skb->dev = tmp_ax->dev; + skb->dev = ax->dev; memcpy(skb_put(skb,count), ax->rbuff, count); skb->mac.raw = skb->data; skb->protocol = htons(ETH_P_AX25); netif_rx(skb); - tmp_ax->dev->last_rx = jiffies; - tmp_ax->rx_packets++; - tmp_ax->rx_bytes+=count; + ax->dev->last_rx = jiffies; + ax->rx_packets++; + ax->rx_bytes+=count; } /* Encapsulate one AX.25 packet and stuff into a TTY queue. */ @@ -361,7 +346,6 @@ { unsigned char *p; int actual, count; - struct mkiss_channel *mkiss = ax->tty->driver_data; if (ax->mtu != ax->dev->mtu + 73) /* Someone has been ifconfigging */ ax_changedmtu(ax); @@ -376,37 +360,26 @@ p = icp; - if (mkiss->magic != MKISS_DRIVER_MAGIC) { - switch (ax->crcmode) { - unsigned short crc; - - case CRC_MODE_FLEX: - *p |= 0x20; - crc = calc_crc_flex(p, len); - count = kiss_esc_crc(p, (unsigned char *)ax->xbuff, crc, len+2); - break; - - default: - count = kiss_esc(p, (unsigned char *)ax->xbuff, len); - break; - } - ax->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); - actual = ax->tty->driver->write(ax->tty, 0, ax->xbuff, count); - ax->tx_packets++; - ax->tx_bytes+=actual; - ax->dev->trans_start = jiffies; - ax->xleft = count - actual; - ax->xhead = ax->xbuff + actual; - } else { - count = kiss_esc(p, (unsigned char *) ax->mkiss->xbuff, len); - ax->mkiss->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); - actual = ax->mkiss->tty->driver->write(ax->mkiss->tty, 0, ax->mkiss->xbuff, count); - ax->tx_packets++; - ax->tx_bytes+=actual; - ax->mkiss->dev->trans_start = jiffies; - ax->mkiss->xleft = count - actual; - ax->mkiss->xhead = ax->mkiss->xbuff + actual; - } + switch (ax->crcmode) { + unsigned short crc; + + case CRC_MODE_FLEX: + *p |= 0x20; + crc = calc_crc_flex(p, len); + count = kiss_esc_crc(p, (unsigned char *)ax->xbuff, crc, len+2); + break; + + default: + count = kiss_esc(p, (unsigned char *)ax->xbuff, len); + break; + } + ax->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); + actual = ax->tty->driver->write(ax->tty, 0, ax->xbuff, count); + ax->tx_packets++; + ax->tx_bytes+=actual; + ax->dev->trans_start = jiffies; + ax->xleft = count - actual; + ax->xhead = ax->xbuff + actual; } /* @@ -417,7 +390,6 @@ { int actual; struct ax_disp *ax = (struct ax_disp *) tty->disc_data; - struct mkiss_channel *mkiss; /* First make sure we're connected. */ if (ax == NULL || ax->magic != AX25_MAGIC || !netif_running(ax->dev)) @@ -428,12 +400,6 @@ */ tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); - if (ax->mkiss != NULL) { - mkiss= ax->mkiss->tty->driver_data; - if (mkiss->magic == MKISS_DRIVER_MAGIC) - ax_unlock(ax->mkiss); - } - netif_wake_queue(ax->dev); return; } @@ -447,32 +413,12 @@ static int ax_xmit(struct sk_buff *skb, struct net_device *dev) { struct ax_disp *ax = (struct ax_disp *) dev->priv; - struct mkiss_channel *mkiss = ax->tty->driver_data; - struct ax_disp *tmp_ax; - - tmp_ax = NULL; - - if (mkiss->magic == MKISS_DRIVER_MAGIC) { - if (skb->data[0] < 0x10) - skb->data[0] = skb->data[0] + 0x10; - tmp_ax = ax->mkiss; - } if (!netif_running(dev)) { printk(KERN_ERR "mkiss: %s: xmit call when iface is down\n", dev->name); return 1; } - if (tmp_ax != NULL) - if (netif_queue_stopped(tmp_ax->dev)) - return 1; - - if (tmp_ax != NULL) - if (netif_queue_stopped(dev)) { - printk(KERN_ERR "mkiss: dev busy while serial dev is free\n"); - ax_unlock(ax); - } - if (netif_queue_stopped(dev)) { /* * May be we must check transmitter timeout here ? @@ -495,8 +441,6 @@ /* We were not busy, so we are now... :-) */ if (skb != NULL) { ax_lock(ax); - if (tmp_ax != NULL) - ax_lock(tmp_ax); ax_encaps(ax, skb->data, skb->len); kfree_skb(skb); } @@ -634,9 +578,7 @@ static int ax25_open(struct tty_struct *tty) { struct ax_disp *ax = (struct ax_disp *) tty->disc_data; - struct ax_disp *tmp_ax; - struct mkiss_channel *mkiss; - int err, cnt; + int err; /* First make sure we're not already connected. */ if (ax && ax->magic == AX25_MAGIC) @@ -649,9 +591,6 @@ ax->tty = tty; tty->disc_data = ax; - ax->mkiss = NULL; - tmp_ax = NULL; - if (tty->driver->flush_buffer) tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) @@ -664,29 +603,6 @@ if ((err = ax_open(ax->dev))) return err; - mkiss = ax->tty->driver_data; - - if (mkiss->magic == MKISS_DRIVER_MAGIC) { - for (cnt = 1; cnt < ax25_maxdev; cnt++) { - if (ax25_ctrls[cnt]) { - if (netif_running(&ax25_ctrls[cnt]->dev)) { - if (ax == &ax25_ctrls[cnt]->ctrl) { - cnt--; - tmp_ax = &ax25_ctrls[cnt]->ctrl; - break; - } - } - } - } - } - - if (tmp_ax != NULL) { - ax->mkiss = tmp_ax; - tmp_ax->mkiss = ax; - } - - MOD_INC_USE_COUNT; - /* Done. We have linked the TTY line to a channel. */ return ax->dev->base_addr; } @@ -705,7 +621,6 @@ ax->tty = NULL; ax_free(ax); - MOD_DEC_USE_COUNT; } diff -Nru a/drivers/net/hamradio/mkiss.h b/drivers/net/hamradio/mkiss.h --- a/drivers/net/hamradio/mkiss.h Thu Jul 10 19:52:01 2003 +++ b/drivers/net/hamradio/mkiss.h Thu Jul 10 19:52:01 2003 @@ -19,7 +19,6 @@ /* Various fields. */ struct tty_struct *tty; /* ptr to TTY structure */ struct net_device *dev; /* easy for intr handling */ - struct ax_disp *mkiss; /* mkiss txport if mkiss channel*/ /* These are pointers to the malloc()ed frame buffers. */ unsigned char *rbuff; /* receiver buffer */ @@ -60,4 +59,3 @@ }; #define AX25_MAGIC 0x5316 -#define MKISS_DRIVER_MAGIC 1215 diff -Nru a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c --- a/drivers/net/pcmcia/3c574_cs.c Thu Jul 10 19:52:01 2003 +++ b/drivers/net/pcmcia/3c574_cs.c Thu Jul 10 19:52:01 2003 @@ -1048,7 +1048,7 @@ } if (lp->fast_poll) { lp->fast_poll--; - lp->media.expires = jiffies + 2; + lp->media.expires = jiffies + 2*HZ/100; add_timer(&lp->media); return; } diff -Nru a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c --- a/drivers/net/pcmcia/3c589_cs.c Thu Jul 10 19:52:02 2003 +++ b/drivers/net/pcmcia/3c589_cs.c Thu Jul 10 19:52:02 2003 @@ -921,7 +921,7 @@ } if (lp->fast_poll) { lp->fast_poll--; - lp->media.expires = jiffies + 1; + lp->media.expires = jiffies + HZ/100; add_timer(&lp->media); return; } diff -Nru a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c --- a/drivers/net/pcmcia/smc91c92_cs.c Thu Jul 10 19:52:02 2003 +++ b/drivers/net/pcmcia/smc91c92_cs.c Thu Jul 10 19:52:02 2003 @@ -1996,7 +1996,7 @@ } if (smc->fast_poll) { smc->fast_poll--; - smc->media.expires = jiffies + 1; + smc->media.expires = jiffies + HZ/100; add_timer(&smc->media); SMC_SELECT_BANK(saved_bank); return; diff -Nru a/drivers/net/plip.c b/drivers/net/plip.c --- a/drivers/net/plip.c Thu Jul 10 19:52:02 2003 +++ b/drivers/net/plip.c Thu Jul 10 19:52:02 2003 @@ -277,27 +277,10 @@ then calls us here. */ -int __init -plip_init_dev(struct net_device *dev, struct parport *pb) +static int +plip_init_netdev(struct net_device *dev) { - struct net_local *nl; - struct pardevice *pardev; - - SET_MODULE_OWNER(dev); - dev->irq = pb->irq; - dev->base_addr = pb->base; - - if (pb->irq == -1) { - printk(KERN_INFO "plip: %s has no IRQ. Using IRQ-less mode," - "which is fairly inefficient!\n", pb->name); - } - - pardev = parport_register_device(pb, dev->name, plip_preempt, - plip_wakeup, plip_interrupt, - 0, dev); - - if (!pardev) - return -ENODEV; + struct net_local *nl = dev->priv; printk(KERN_INFO "%s", version); if (dev->irq != -1) @@ -307,9 +290,6 @@ printk(KERN_INFO "%s: Parallel port at %#3lx, not using IRQ.\n", dev->name, dev->base_addr); - /* Fill in the generic fields of the device structure. */ - ether_setup(dev); - /* Then, override parts of it */ dev->hard_start_xmit = plip_tx_packet; dev->open = plip_open; @@ -322,22 +302,12 @@ memset(dev->dev_addr, 0xfc, ETH_ALEN); /* Set the private structure */ - dev->priv = kmalloc(sizeof (struct net_local), GFP_KERNEL); - if (dev->priv == NULL) { - printk(KERN_ERR "%s: out of memory\n", dev->name); - parport_unregister_device(pardev); - return -ENOMEM; - } - memset(dev->priv, 0, sizeof(struct net_local)); - nl = (struct net_local *) dev->priv; - nl->orig_hard_header = dev->hard_header; dev->hard_header = plip_hard_header; nl->orig_hard_header_cache = dev->hard_header_cache; dev->hard_header_cache = plip_hard_header_cache; - nl->pardev = pardev; nl->port_owner = 0; @@ -1299,29 +1269,52 @@ * available to use. */ static void plip_attach (struct parport *port) { - static int i; + static int unit; + struct net_device *dev; + struct net_local *nl; + char name[IFNAMSIZ]; if ((parport[0] == -1 && (!timid || !port->devices)) || plip_searchfor(parport, port->number)) { - if (i == PLIP_MAX) { + if (unit == PLIP_MAX) { printk(KERN_ERR "plip: too many devices\n"); return; } - dev_plip[i] = kmalloc(sizeof(struct net_device), - GFP_KERNEL); - if (!dev_plip[i]) { + + sprintf(name, "plip%d", unit); + dev = alloc_netdev(sizeof(struct net_local), name, + ether_setup); + if (!dev) { printk(KERN_ERR "plip: memory squeeze\n"); return; } - memset(dev_plip[i], 0, sizeof(struct net_device)); - sprintf(dev_plip[i]->name, "plip%d", i); - dev_plip[i]->priv = port; - if (plip_init_dev(dev_plip[i],port) || - register_netdev(dev_plip[i])) { - kfree(dev_plip[i]); - dev_plip[i] = NULL; + + dev->init = plip_init_netdev; + + SET_MODULE_OWNER(dev); + dev->irq = port->irq; + dev->base_addr = port->base; + if (port->irq == -1) { + printk(KERN_INFO "plip: %s has no IRQ. Using IRQ-less mode," + "which is fairly inefficient!\n", port->name); + } + + nl = dev->priv; + nl->pardev = parport_register_device(port, name, plip_preempt, + plip_wakeup, plip_interrupt, + 0, dev); + + if (!nl->pardev) { + printk(KERN_ERR "%s: parport_register failed\n", name); + kfree(dev); + return; + } + + if (register_netdev(dev)) { + printk(KERN_ERR "%s: network register failed\n", name); + kfree(dev); } else { - i++; + dev_plip[unit++] = dev; } } } @@ -1341,20 +1334,19 @@ static void __exit plip_cleanup_module (void) { + struct net_device *dev; int i; parport_unregister_driver (&plip_driver); for (i=0; i < PLIP_MAX; i++) { - if (dev_plip[i]) { - struct net_local *nl = - (struct net_local *)dev_plip[i]->priv; - unregister_netdev(dev_plip[i]); + if ((dev = dev_plip[i])) { + struct net_local *nl = dev->priv; + unregister_netdev(dev); if (nl->port_owner) parport_release(nl->pardev); parport_unregister_device(nl->pardev); - kfree(dev_plip[i]->priv); - kfree(dev_plip[i]); + kfree(dev); dev_plip[i] = NULL; } } diff -Nru a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c --- a/drivers/net/sb1250-mac.c Thu Jul 10 19:52:02 2003 +++ b/drivers/net/sb1250-mac.c Thu Jul 10 19:52:02 2003 @@ -2493,7 +2493,7 @@ /* Set the timer to check for link beat. */ init_timer(&sc->sbm_timer); - sc->sbm_timer.expires = jiffies + 2; + sc->sbm_timer.expires = jiffies + 2 * HZ/100; sc->sbm_timer.data = (unsigned long)dev; sc->sbm_timer.function = &sbmac_timer; add_timer(&sc->sbm_timer); diff -Nru a/drivers/net/sk_mca.c b/drivers/net/sk_mca.c --- a/drivers/net/sk_mca.c Thu Jul 10 19:52:01 2003 +++ b/drivers/net/sk_mca.c Thu Jul 10 19:52:01 2003 @@ -537,7 +537,7 @@ ResetBoard(dev); InitBoard(dev); - njiffies = jiffies + 100; + njiffies = jiffies + HZ; do { csr0val = GetLANCE(dev, LANCE_CSR0); } diff -Nru a/drivers/net/sundance.c b/drivers/net/sundance.c --- a/drivers/net/sundance.c Thu Jul 10 19:52:01 2003 +++ b/drivers/net/sundance.c Thu Jul 10 19:52:01 2003 @@ -87,11 +87,15 @@ Version LK1.09 (D-Link): - Fix the flowctrl bug. - Set Pause bit in MII ANAR if flow control enabled. + + Version LK1.09a (ICPlus): + - Add the delay time in reading the contents of EEPROM + */ #define DRV_NAME "sundance" #define DRV_VERSION "1.01+LK1.09a" -#define DRV_RELDATE "16-May-2003" +#define DRV_RELDATE "10-Jul-2003" /* The user-configurable values. @@ -744,12 +748,14 @@ return 0; } +#define eeprom_delay(ee_addr) readl(ee_addr) /* Read the EEPROM and MII Management Data I/O (MDIO) interfaces. */ static int __devinit eeprom_read(long ioaddr, int location) { - int boguscnt = 1000; /* Typical 190 ticks. */ + int boguscnt = 10000; /* Typical 1900 ticks. */ writew(0x0200 | (location & 0xff), ioaddr + EECtrl); do { + eeprom_delay(ioaddr + EECtrl); if (! (readw(ioaddr + EECtrl) & 0x8000)) { return readw(ioaddr + EEData); } diff -Nru a/drivers/net/tg3.c b/drivers/net/tg3.c --- a/drivers/net/tg3.c Thu Jul 10 19:52:01 2003 +++ b/drivers/net/tg3.c Thu Jul 10 19:52:01 2003 @@ -6679,10 +6679,9 @@ } /* Configure DMA attributes. */ - if (!pci_set_dma_mask(pdev, (u64) 0xffffffffffffffffULL)) { + if (!pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) { pci_using_dac = 1; - if (pci_set_consistent_dma_mask(pdev, - (u64) 0xffffffffffffffff)) { + if (pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL)) { printk(KERN_ERR PFX "Unable to obtain 64 bit DMA " "for consistent allocations\n"); goto err_out_free_res; diff -Nru a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c --- a/drivers/net/tokenring/3c359.c Thu Jul 10 19:52:02 2003 +++ b/drivers/net/tokenring/3c359.c Thu Jul 10 19:52:02 2003 @@ -464,7 +464,7 @@ printk(KERN_INFO "3C359: Uploading Microcode: "); - for (i = start,j=0; (j < mc_size && i <= 0xffff) ; i++,j++) { + for (i = start, j = 0; j < mc_size; i++, j++) { writel(MEM_BYTE_WRITE | 0XD0000 | i, xl_mmio + MMIO_MAC_ACCESS_CMD) ; writeb(microcode[j],xl_mmio + MMIO_MACDATA) ; if (j % 1024 == 0) diff -Nru a/drivers/net/tokenring/proteon.c b/drivers/net/tokenring/proteon.c --- a/drivers/net/tokenring/proteon.c Thu Jul 10 19:52:02 2003 +++ b/drivers/net/tokenring/proteon.c Thu Jul 10 19:52:02 2003 @@ -401,7 +401,6 @@ int init_module(void) { int i, num; - struct net_device *dev; num = 0; if (io[0]) { /* Only probe addresses from command line */ diff -Nru a/drivers/net/tokenring/skisa.c b/drivers/net/tokenring/skisa.c --- a/drivers/net/tokenring/skisa.c Thu Jul 10 19:52:01 2003 +++ b/drivers/net/tokenring/skisa.c Thu Jul 10 19:52:01 2003 @@ -414,7 +414,6 @@ int init_module(void) { int i, num; - struct net_device *dev; num = 0; if (io[0]) { /* Only probe addresses from command line */ diff -Nru a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c --- a/drivers/net/via-rhine.c Thu Jul 10 19:52:02 2003 +++ b/drivers/net/via-rhine.c Thu Jul 10 19:52:02 2003 @@ -1152,7 +1152,7 @@ /* Set the timer to check for link beat. */ init_timer(&np->timer); - np->timer.expires = jiffies + 2; + np->timer.expires = jiffies + 2 * HZ/100; np->timer.data = (unsigned long)dev; np->timer.function = &via_rhine_timer; /* timer handler */ add_timer(&np->timer); diff -Nru a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c --- a/drivers/net/wireless/atmel_cs.c Thu Jul 10 19:52:01 2003 +++ b/drivers/net/wireless/atmel_cs.c Thu Jul 10 19:52:01 2003 @@ -391,7 +391,7 @@ local_info_t *dev; int last_fn, last_ret; u_char buf[64]; - int card_index = -1; + int card_index = -1, done = 0; handle = link->handle; dev = link->priv; @@ -415,13 +415,13 @@ manfid->manf == card_table[i].manf && manfid->card == card_table[i].card) { card_index = i; - goto done; + done = 1; } } } tuple.DesiredTuple = CISTPL_VERS_1; - if (CardServices(GetFirstTuple, handle, &tuple) == 0) { + if (!done && (CardServices(GetFirstTuple, handle, &tuple) == 0)) { int i, j, k; cistpl_vers_1_t *ver1; CS_CHECK(GetTupleData, handle, &tuple); @@ -446,12 +446,11 @@ goto mismatch; } card_index = i; - goto done; + break; /* done */ mismatch: - + j = 0; /* dummy stmt to shut up compiler */ } - done: } /* diff -Nru a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c --- a/drivers/net/wireless/wavelan.c Thu Jul 10 19:52:02 2003 +++ b/drivers/net/wireless/wavelan.c Thu Jul 10 19:52:02 2003 @@ -3730,8 +3730,8 @@ int i; /* Loop counter */ /* Check if the base address if available. */ - if (check_region(ioaddr, sizeof(ha_t))) - return -EADDRINUSE; /* ioaddr already used */ + if (!request_region(ioaddr, sizeof(ha_t), "wavelan probe")) + return -EBUSY; /* ioaddr already used */ /* Reset host interface */ wv_hacr_reset(ioaddr); @@ -3739,6 +3739,8 @@ /* Read the MAC address from the parameter storage area. */ psa_read(ioaddr, HACR_DEFAULT, psaoff(0, psa_univ_mac_addr), mac, 6); + + release_region(ioaddr, sizeof(ha_t)); /* * Check the first three octets of the address for the manufacturer's code.