# 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 1.1358 -> 1.1366 # drivers/net/pcnet32.c 1.35 -> 1.36 # drivers/net/pcmcia/xirc2ps_cs.c 1.19 -> 1.21 # drivers/net/sis900.c 1.37 -> 1.38 # drivers/net/amd8111e.c 1.5 -> 1.6 # drivers/net/tulip/Kconfig 1.3 -> 1.4 # drivers/net/ixgb/ixgb_ethtool.c 1.3 -> 1.4 # drivers/net/bonding/bond_main.c 1.25 -> 1.26 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/06/19 ak@muc.de 1.1359 # [PATCH] Remove copied inet_aton code in bond_main.c # # According to a report the my_inet_aton code in bond_main.c is copied # from 4.4BSD, but it doesn't carry a BSD copyright license. In addition # it is somewhat redundant with the standard in_aton. Convert it # to use the linux function. # # Error handling is a bit worse than before, but not much. # # Patch for 2.5 bonding. The 2.4 version has the same problem, but afaik # it is scheduled to be replaced by the 2.5 codebase anyways. # # -Andi # -------------------------------------------- # 03/06/19 reeja.john@amd.com 1.1360 # [netdrvr amd8111e] fix spinlock recursion / if close failure # -------------------------------------------- # 03/06/19 bunk@fs.tum.de 1.1361 # [netdrvr ixgb] fix clash with newly-updated ethtool.h # -------------------------------------------- # 03/06/19 zwane@linuxpower.ca 1.1362 # [PATCH] Remove warning due to comparison in drivers/net/pcnet32.c # # drivers/net/pcnet32.c: In function `pcnet32_init_ring': # drivers/net/pcnet32.c:1006: warning: comparison between pointer and integer # -------------------------------------------- # 03/06/19 daniel.ritz@gmx.ch 1.1363 # [PATCH] xirc2ps_cs update # # hi # # this patch does: # - net_device is no longer allocated as part of the driver's private structure, # instead it's allocated via alloc_netdev # - xirc2ps_detach calls xirc2ps_release if necessary (like the other drivers) # # against 2.5.70-bk. # # rgds # -daniel # -------------------------------------------- # 03/06/19 daniel.ritz@gmx.ch 1.1364 # [PATCH] xirc2ps_cs update # # the second patch: # replaces busy_loop with a simple macro doing a schedule_timeout. busy_loop was never # called from interrupt conext anyway, so no need for that. and the sti() is gone. # # rgds # -daniel # -------------------------------------------- # 03/06/19 jgarzik@redhat.com 1.1365 # [netdrvr sis900] add new phy id to phy table # # (pulled change from 2.4) # -------------------------------------------- # 03/06/19 mikpe@csd.uu.se 1.1366 # [netdrvr tulip] Kconfig help text fix # # While there is a separate driver for 2104x tulips (CONFIG_DE2104X), # drivers/net/tulip/Kconfig states that CONFIG_TULIP also supports # 2104x tulips. This is not the case since that support was removed # in December 2001. A user with an old tulip may thus be tricked into # configuring the wrong driver. (I was, on my PMac 4400.) # # The patch below removes this misinformation from tulip's Kconfig. # # -------------------------------------------- # diff -Nru a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c --- a/drivers/net/amd8111e.c Thu Jun 19 23:42:22 2003 +++ b/drivers/net/amd8111e.c Thu Jun 19 23:42:22 2003 @@ -53,6 +53,8 @@ 2. Bug fix: Fixed VLAN support failure. 3. Bug fix: Fixed receive interrupt coalescing bug. 4. Dynamic IPG support is disabled by default. + 3.0.3 06/05/2003 + 1. Bug fix: Fixed failure to close the interface if SMP is enabled. */ @@ -89,9 +91,9 @@ #include "amd8111e.h" #define MODULE_NAME "amd8111e" -#define MODULE_VERSION "3.0.2" +#define MODULE_VERSION "3.0.3" MODULE_AUTHOR("Advanced Micro Devices, Inc."); -MODULE_DESCRIPTION ("AMD8111 based 10/100 Ethernet Controller. Driver Version 3.0.2"); +MODULE_DESCRIPTION ("AMD8111 based 10/100 Ethernet Controller. Driver Version 3.0.3"); MODULE_LICENSE("GPL"); MODULE_PARM(speed_duplex, "1-" __MODULE_STRING (MAX_UNITS) "i"); MODULE_PARM_DESC(speed_duplex, "Set device speed and duplex modes, 0: Auto Negotitate, 1: 10Mbps Half Duplex, 2: 10Mbps Full Duplex, 3: 100Mbps Half Duplex, 4: 100Mbps Full Duplex"); @@ -1171,11 +1173,11 @@ if(lp->options & OPTION_DYN_IPG_ENABLE) del_timer_sync(&lp->ipg_data.ipg_timer); - /* Update the statistics before closing */ - amd8111e_get_stats(dev); spin_unlock_irq(&lp->lock); - free_irq(dev->irq, dev); + + /* Update the statistics before closing */ + amd8111e_get_stats(dev); lp->opened = 0; return 0; } diff -Nru a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Jun 19 23:42:22 2003 +++ b/drivers/net/bonding/bond_main.c Thu Jun 19 23:42:22 2003 @@ -390,6 +390,7 @@ #include #include #include +#include #include #include #include @@ -2792,84 +2793,6 @@ mod_timer(&bond->arp_timer, next_timer); } -typedef uint32_t in_addr_t; - -int -my_inet_aton(char *cp, unsigned long *the_addr) { - static const in_addr_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff }; - in_addr_t val; - char c; - union iaddr { - uint8_t bytes[4]; - uint32_t word; - } res; - uint8_t *pp = res.bytes; - int digit,base; - - res.word = 0; - - c = *cp; - for (;;) { - /* - * Collect number up to ``.''. - * Values are specified as for C: - * 0x=hex, 0=octal, isdigit=decimal. - */ - if (!isdigit(c)) goto ret_0; - val = 0; base = 10; digit = 0; - for (;;) { - if (isdigit(c)) { - val = (val * base) + (c - '0'); - c = *++cp; - digit = 1; - } else { - break; - } - } - if (c == '.') { - /* - * Internet format: - * a.b.c.d - * a.b.c (with c treated as 16 bits) - * a.b (with b treated as 24 bits) - */ - if (pp > res.bytes + 2 || val > 0xff) { - goto ret_0; - } - *pp++ = val; - c = *++cp; - } else - break; - } - /* - * Check for trailing characters. - */ - if (c != '\0' && (!isascii(c) || !isspace(c))) { - goto ret_0; - } - /* - * Did we get a valid digit? - */ - if (!digit) { - goto ret_0; - } - - /* Check whether the last part is in its limits depending on - the number of parts in total. */ - if (val > max[pp - res.bytes]) { - goto ret_0; - } - - if (the_addr != NULL) { - *the_addr = res.word | htonl (val); - } - - return (1); - -ret_0: - return (0); -} - static int bond_sethwaddr(struct net_device *master, struct net_device *slave) { #ifdef BONDING_DEBUG @@ -3877,15 +3800,18 @@ for (arp_ip_count=0 ; (arp_ip_count < MAX_ARP_IP_TARGETS) && arp_ip_target[arp_ip_count]; arp_ip_count++ ) { - /* TODO: check and log bad ip address */ - if (my_inet_aton(arp_ip_target[arp_ip_count], - &arp_target[arp_ip_count]) == 0) { + /* not complete check, but should be good enough to + catch mistakes */ + if (!isdigit(arp_ip_target[arp_ip_count][0])) { printk(KERN_WARNING "bonding_init(): bad arp_ip_target module " "parameter (%s), ARP monitoring will not be " "performed\n", arp_ip_target[arp_ip_count]); arp_interval = 0; + } else { + u32 ip = in_aton(arp_ip_target[arp_ip_count]); + *(u32 *)(arp_ip_target[arp_ip_count]) = ip; } } diff -Nru a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c --- a/drivers/net/ixgb/ixgb_ethtool.c Thu Jun 19 23:42:22 2003 +++ b/drivers/net/ixgb/ixgb_ethtool.c Thu Jun 19 23:42:22 2003 @@ -50,7 +50,6 @@ return (IXGB_EEPROM_SIZE << 1); } -#define SUPPORTED_10000baseT_Full (1 << 11) #define SPEED_10000 10000 static void diff -Nru a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c --- a/drivers/net/pcmcia/xirc2ps_cs.c Thu Jun 19 23:42:22 2003 +++ b/drivers/net/pcmcia/xirc2ps_cs.c Thu Jun 19 23:42:22 2003 @@ -358,7 +358,6 @@ typedef struct local_info_t { dev_link_t link; - struct net_device dev; dev_node_t node; struct net_device_stats stats; int card_type; @@ -432,22 +431,10 @@ #define PutByte(reg,value) outb((value), ioaddr+(reg)) #define PutWord(reg,value) outw((value), ioaddr+(reg)) -static void -busy_loop(u_long len) -{ - if (in_interrupt()) { - u_long timeout = jiffies + len; - u_long flags; - save_flags(flags); - sti(); - while (time_before_eq(jiffies, timeout)) - ; - restore_flags(flags); - } else { - __set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(len); - } -} +#define Wait(n) do { \ + set_current_state(TASK_UNINTERRUPTIBLE); \ + schedule_timeout(n); \ +} while (0) /*====== Functions used for debugging =================================*/ #if defined(PCMCIA_DEBUG) && 0 /* reading regs may change system status */ @@ -619,11 +606,12 @@ flush_stale_links(); /* Allocate the device structure */ - local = kmalloc(sizeof(*local), GFP_KERNEL); - if (!local) return NULL; - memset(local, 0, sizeof(*local)); - link = &local->link; dev = &local->dev; - link->priv = dev->priv = local; + dev = alloc_etherdev(sizeof(local_info_t)); + if (!dev) + return NULL; + local = dev->priv; + link = &local->link; + link->priv = dev; init_timer(&link->release); link->release.function = &xirc2ps_release; @@ -645,7 +633,6 @@ dev->get_stats = &do_get_stats; dev->do_ioctl = &do_ioctl; dev->set_multicast_list = &set_multicast_list; - ether_setup(dev); dev->open = &do_open; dev->stop = &do_stop; #ifdef HAVE_TX_TIMEOUT @@ -684,7 +671,7 @@ static void xirc2ps_detach(dev_link_t * link) { - local_info_t *local = link->priv; + struct net_device *dev = link->priv; dev_link_t **linkp; DEBUG(0, "detach(0x%p)\n", link); @@ -706,10 +693,11 @@ */ del_timer(&link->release); if (link->state & DEV_CONFIG) { - DEBUG(0, "detach postponed, '%s' still locked\n", - link->dev->dev_name); - link->state |= DEV_STALE_LINK; - return; + xirc2ps_release((unsigned long)link); + if (link->state & DEV_STALE_CONFIG) { + link->state |= DEV_STALE_LINK; + return; + } } /* Break the link with Card Services */ @@ -719,8 +707,8 @@ /* Unlink device structure, free it */ *linkp = link->next; if (link->dev) - unregister_netdev(&local->dev); - kfree(local); + unregister_netdev(dev); + kfree(dev); } /* xirc2ps_detach */ @@ -745,7 +733,8 @@ static int set_card_type(dev_link_t *link, const void *s) { - local_info_t *local = link->priv; + struct net_device *dev = link->priv; + local_info_t *local = dev->priv; #ifdef PCMCIA_DEBUG unsigned cisrev = ((const unsigned char *)s)[2]; #endif @@ -839,8 +828,8 @@ xirc2ps_config(dev_link_t * link) { client_handle_t handle = link->handle; - local_info_t *local = link->priv; - struct net_device *dev = &local->dev; + struct net_device *dev = link->priv; + local_info_t *local = dev->priv; tuple_t tuple; cisparse_t parse; ioaddr_t ioaddr; @@ -1195,11 +1184,10 @@ xirc2ps_release(u_long arg) { dev_link_t *link = (dev_link_t *) arg; - local_info_t *local = link->priv; - struct net_device *dev = &local->dev; DEBUG(0, "release(0x%p)\n", link); +#if 0 /* * If the device is currently in use, we won't release until it * is actually closed. @@ -1210,8 +1198,10 @@ link->state |= DEV_STALE_CONFIG; return; } +#endif if (link->win) { + struct net_device *dev = link->priv; local_info_t *local = dev->priv; if (local->dingo) iounmap(local->dingo_ccr - 0x0800); @@ -1243,8 +1233,7 @@ event_callback_args_t * args) { dev_link_t *link = args->client_data; - local_info_t *lp = link->priv; - struct net_device *dev = &lp->dev; + struct net_device *dev = link->priv; DEBUG(0, "event(%d)\n", (int)event); @@ -1779,12 +1768,12 @@ SelectPage(4); udelay(1); PutByte(XIRCREG4_GPR1, 0); /* clear bit 0: power down */ - busy_loop(HZ/25); /* wait 40 msec */ + Wait(HZ/25); /* wait 40 msec */ if (local->mohawk) PutByte(XIRCREG4_GPR1, 1); /* set bit 0: power up */ else PutByte(XIRCREG4_GPR1, 1 | 4); /* set bit 0: power up, bit 2: AIC */ - busy_loop(HZ/50); /* wait 20 msec */ + Wait(HZ/50); /* wait 20 msec */ } static void @@ -1798,9 +1787,9 @@ hardreset(dev); PutByte(XIRCREG_CR, SoftReset); /* set */ - busy_loop(HZ/50); /* wait 20 msec */ + Wait(HZ/50); /* wait 20 msec */ PutByte(XIRCREG_CR, 0); /* clear */ - busy_loop(HZ/25); /* wait 40 msec */ + Wait(HZ/25); /* wait 40 msec */ if (local->mohawk) { SelectPage(4); /* set pin GP1 and GP2 to output (0x0c) @@ -1811,7 +1800,7 @@ } /* give the circuits some time to power up */ - busy_loop(HZ/2); /* about 500ms */ + Wait(HZ/2); /* about 500ms */ local->last_ptr_value = 0; local->silicon = local->mohawk ? (GetByte(XIRCREG4_BOV) & 0x70) >> 4 @@ -1830,7 +1819,7 @@ SelectPage(0x42); PutByte(XIRCREG42_SWC1, 0x80); } - busy_loop(HZ/25); /* wait 40 msec to let it complete */ + Wait(HZ/25); /* wait 40 msec to let it complete */ #ifdef PCMCIA_DEBUG if (pc_debug) { @@ -1889,7 +1878,7 @@ printk(KERN_INFO "%s: MII selected\n", dev->name); SelectPage(2); PutByte(XIRCREG2_MSR, GetByte(XIRCREG2_MSR) | 0x08); - busy_loop(HZ/50); + Wait(HZ/50); } else { printk(KERN_INFO "%s: MII detected; using 10mbs\n", dev->name); @@ -1898,7 +1887,7 @@ PutByte(XIRCREG42_SWC1, 0xC0); else /* enable 10BaseT */ PutByte(XIRCREG42_SWC1, 0x80); - busy_loop(HZ/25); /* wait 40 msec to let it complete */ + Wait(HZ/25); /* wait 40 msec to let it complete */ } if (full_duplex) PutByte(XIRCREG1_ECR, GetByte(XIRCREG1_ECR | FullDuplex)); @@ -1991,7 +1980,7 @@ * Fixme: Better to use a timer here! */ for (i=0; i < 35; i++) { - busy_loop(HZ/10); /* wait 100 msec */ + Wait(HZ/10); /* wait 100 msec */ status = mii_rd(ioaddr, 0, 1); if ((status & 0x0020) && (status & 0x0004)) break; @@ -2083,12 +2072,8 @@ { pcmcia_unregister_driver(&xirc2ps_cs_driver); - while (dev_list) { - if (dev_list->state & DEV_CONFIG) - xirc2ps_release((u_long)dev_list); - if (dev_list) /* xirc2ps_release() might already have detached... */ - xirc2ps_detach(dev_list); - } + while (dev_list) + xirc2ps_detach(dev_list); } module_init(init_xirc2ps_cs); diff -Nru a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c --- a/drivers/net/pcnet32.c Thu Jun 19 23:42:22 2003 +++ b/drivers/net/pcnet32.c Thu Jun 19 23:42:22 2003 @@ -1003,7 +1003,7 @@ skb_reserve (rx_skbuff, 2); } - if (lp->rx_dma_addr[i] == NULL) + if (lp->rx_dma_addr[i] == 0) lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, rx_skbuff->tail, rx_skbuff->len, PCI_DMA_FROMDEVICE); lp->rx_ring[i].base = (u32)le32_to_cpu(lp->rx_dma_addr[i]); lp->rx_ring[i].buf_length = le16_to_cpu(-PKT_BUF_SZ); diff -Nru a/drivers/net/sis900.c b/drivers/net/sis900.c --- a/drivers/net/sis900.c Thu Jun 19 23:42:22 2003 +++ b/drivers/net/sis900.c Thu Jun 19 23:42:22 2003 @@ -124,6 +124,7 @@ { "ICS LAN PHY", 0x0015, 0xF440, LAN }, { "NS 83851 PHY", 0x2000, 0x5C20, MIX }, { "Realtek RTL8201 PHY", 0x0000, 0x8200, LAN }, + { "VIA 6103 PHY", 0x0101, 0x8f20, LAN }, {0,}, }; diff -Nru a/drivers/net/tulip/Kconfig b/drivers/net/tulip/Kconfig --- a/drivers/net/tulip/Kconfig Thu Jun 19 23:42:22 2003 +++ b/drivers/net/tulip/Kconfig Thu Jun 19 23:42:22 2003 @@ -37,7 +37,7 @@ ---help--- This driver is developed for the SMC EtherPower series Ethernet cards and also works with cards based on the DECchip - 21040/21041/21140 (Tulip series) chips. Some LinkSys PCI cards are + 21140 (Tulip series) chips. Some LinkSys PCI cards are of this type. (If your card is NOT SMC EtherPower 10/100 PCI (smc9332dst), you can also try the driver for "Generic DECchip" cards, above. However, most people with a network card of this type