]> git.hungrycats.org Git - linux/commitdiff
v2.4.7.5 -> v2.4.7.6
authorLinus Torvalds <torvalds@athlon.transmeta.com>
Tue, 5 Feb 2002 04:03:50 +0000 (20:03 -0800)
committerLinus Torvalds <torvalds@athlon.transmeta.com>
Tue, 5 Feb 2002 04:03:50 +0000 (20:03 -0800)
  - me: better dirty balancing
  - David Miller: sparc and network updates

37 files changed:
MAINTAINERS
arch/sparc/kernel/ebus.c
arch/sparc/mm/extable.c
arch/sparc64/defconfig
arch/sparc64/kernel/ioctl32.c
arch/sparc64/kernel/smp.c
arch/sparc64/mm/extable.c
arch/sparc64/mm/init.c
drivers/net/pci-skeleton.c
drivers/net/sk98lin/skge.c
drivers/net/sk98lin/skproc.c
drivers/net/sungem.c
drivers/net/sunhme.h
drivers/net/tulip/tulip_core.c
drivers/net/tun.c
drivers/video/aty/atyfb_base.c
fs/buffer.c
include/asm-sparc/pgtable.h
include/asm-sparc64/mmu_context.h
include/linux/netdevice.h
include/net/addrconf.h
mm/shmem.c
net/core/skbuff.c
net/ipv4/af_inet.c
net/ipv4/icmp.c
net/ipv4/ip_output.c
net/ipv4/netfilter/ip_conntrack_core.c
net/ipv4/netfilter/ip_nat_proto_tcp.c
net/ipv4/tcp_minisocks.c
net/ipv6/addrconf.c
net/ipv6/netfilter/Makefile
net/ipv6/netfilter/ip6_tables.c
net/netsyms.c
net/packet/af_packet.c
net/sched/cls_route.c
net/sched/cls_u32.c
net/sched/sch_cbq.c

index 81fb87ca9e8a3b0650da580d4b9f35c08f361a88..9f358ca745939d48a6986d09b5f4ba1faf8bc074 100644 (file)
@@ -486,7 +486,7 @@ ETHERNET BRIDGE
 P:     Lennert Buytenhek
 M:     buytenh@gnu.org
 L:     bridge@math.leidenuniv.nl
-W:     http://www.math.leidenuniv.nl/~buytenh/bridge
+W:     http://bridge.sourceforge.net/
 S:     Maintained
 
 ETHERTEAM 16I DRIVER
index d8800b0f3fbd66857602b0ff0500b5e1858194fc..5a5df71d48ce317cbb8c639a3a8c9e770f20d4dd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ebus.c,v 1.16 2001/02/13 01:16:43 davem Exp $
+/* $Id: ebus.c,v 1.17 2001/08/06 13:12:57 davem Exp $
  * ebus.c: PCI to EBus bridge device.
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -27,6 +27,7 @@ struct linux_ebus *ebus_chain = 0;
 #ifdef CONFIG_SUN_AUXIO
 extern void auxio_probe(void);
 #endif
+extern void rs_init(void);
 
 /* We are together with pcic.c under CONFIG_PCI. */
 extern unsigned int pcic_pin_to_irq(unsigned int, char *name);
@@ -358,6 +359,7 @@ void __init ebus_init(void)
                ++num_ebus;
        }
 
+       rs_init();
 #ifdef CONFIG_SUN_AUXIO
        auxio_probe();
 #endif
index 7fe26ad96edda0f499518fd6db79f9e96528e582..38f01f0dd87c9a6c3369568bd8aca1a708af6ed2 100644 (file)
@@ -46,24 +46,27 @@ search_one_table(const struct exception_table_entry *start,
 unsigned long
 search_exception_table(unsigned long addr, unsigned long *g2)
 {
-       unsigned long ret;
+       unsigned long ret = 0, flags;
 
 #ifndef CONFIG_MODULES
        /* There is only the kernel to search.  */
        ret = search_one_table(__start___ex_table,
                               __stop___ex_table-1, addr, g2);
-       if (ret) return ret;
+       return ret;
 #else
        /* The kernel is the last "module" -- no need to treat it special.  */
        struct module *mp;
+
+       spin_lock_irqsave(&modlist_lock, flags);
        for (mp = module_list; mp != NULL; mp = mp->next) {
-               if (mp->ex_table_start == NULL)
+               if (mp->ex_table_start == NULL || !(mp->flags & (MOD_RUNNING | MOD_INITIALIZING)))
                        continue;
                ret = search_one_table(mp->ex_table_start,
                                       mp->ex_table_end-1, addr, g2);
-               if (ret) return ret;
+               if (ret)
+                       break;
        }
+       spin_unlock_irqrestore(&modlist_lock, flags);
+       return ret;
 #endif
-
-       return 0;
 }
index a7898b493390f741c3d98a63e662c3d4b3b14f62..b6b3ae8313a68450bc6888d72bc413102d9b3ba7 100644 (file)
@@ -101,6 +101,8 @@ CONFIG_FB_PM2_PCI=y
 # CONFIG_FB_E1355 is not set
 # CONFIG_FB_MATROX is not set
 CONFIG_FB_ATY=y
+# CONFIG_FB_ATY_GX is not set
+CONFIG_FB_ATY_CT=y
 # CONFIG_FB_ATY128 is not set
 # CONFIG_FB_3DFX is not set
 # CONFIG_FB_SIS is not set
@@ -112,6 +114,7 @@ CONFIG_FB_CGSIX=y
 # CONFIG_FB_LEO is not set
 CONFIG_FB_PCI=y
 CONFIG_FB_ATY=y
+CONFIG_FB_ATY_CT=y
 # CONFIG_FB_VIRTUAL is not set
 # CONFIG_FBCON_ADVANCED is not set
 CONFIG_FBCON_CFB8=y
@@ -407,6 +410,7 @@ CONFIG_TUN=m
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
+# CONFIG_ARM_AM79C961A is not set
 CONFIG_SUNLANCE=y
 CONFIG_HAPPYMEAL=y
 CONFIG_SUNBMAC=m
index 335eb5328df1ee4f7cb2d2c4f10e8659c7d930b1..85548b4d41dfdf90d654e7a30497e2d9b974adc2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ioctl32.c,v 1.119 2001/07/21 00:28:25 davem Exp $
+/* $Id: ioctl32.c,v 1.121 2001/08/03 14:27:21 davem Exp $
  * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  *
  * Copyright (C) 1997-2000  Jakub Jelinek  (jakub@redhat.com)
@@ -51,9 +51,6 @@
 #include <linux/rtc.h>
 #include <linux/pci.h>
 #if defined(CONFIG_BLK_DEV_LVM) || defined(CONFIG_BLK_DEV_LVM_MODULE)
-/* Ugh. This header really is not clean */
-#define min min
-#define max max
 #include <linux/lvm.h>
 #endif /* LVM */
 
@@ -73,6 +70,7 @@
 #include <asm/envctrl.h>
 #include <asm/audioio.h>
 #include <linux/ethtool.h>
+#include <linux/mii.h>
 #include <asm/display7seg.h>
 #include <asm/watchdog.h>
 #include <asm/module.h>
@@ -544,7 +542,7 @@ static inline int dev_ifconf(unsigned int fd, unsigned int cmd, unsigned long ar
        return err;
 }
 
-static inline int ethtool_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
+static int ethtool_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
        struct ifreq ifr;
        mm_segment_t old_fs;
@@ -593,6 +591,44 @@ out:
        return err;
 }
 
+static int mii_ioctl(unsigned long fd, unsigned int cmd, unsigned long arg)
+{
+       struct ifreq ifr;
+       mm_segment_t old_fs;
+       int err;
+       u32 data;
+
+       if (copy_from_user(&ifr, (struct ifreq32 *)arg, sizeof(struct ifreq32)))
+               return -EFAULT;
+       ifr.ifr_data = (__kernel_caddr_t) kmalloc(sizeof(struct mii_ioctl_data),
+                                                 GFP_KERNEL);
+       if (!ifr.ifr_data)
+               return -EAGAIN;
+
+       __get_user(data, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_data));
+       if (copy_from_user(ifr.ifr_data, (char *)A(data),
+                          sizeof(struct mii_ioctl_data))) {
+               err = -EFAULT;
+               goto out;
+       }
+
+       old_fs = get_fs();
+       set_fs(KERNEL_DS);
+       err = sys_ioctl(fd, cmd, (unsigned long)&ifr);
+       set_fs(old_fs);
+
+       if (!err) {
+               if (copy_to_user((char *)A(data),
+                                ifr.ifr_data,
+                                sizeof(struct mii_ioctl_data)))
+                       err = -EFAULT;
+       }
+
+out:
+       kfree(ifr.ifr_data);
+       return err;
+}
+
 static inline int dev_ifsioc(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
        struct ifreq ifr;
@@ -4250,6 +4286,9 @@ HANDLE_IOCTL(SIOCGPPPVER, dev_ifsioc)
 HANDLE_IOCTL(SIOCGIFTXQLEN, dev_ifsioc)
 HANDLE_IOCTL(SIOCSIFTXQLEN, dev_ifsioc)
 HANDLE_IOCTL(SIOCETHTOOL, ethtool_ioctl)
+HANDLE_IOCTL(SIOCGMIIPHY, mii_ioctl)
+HANDLE_IOCTL(SIOCGMIIREG, mii_ioctl)
+HANDLE_IOCTL(SIOCSMIIREG, mii_ioctl)
 HANDLE_IOCTL(SIOCADDRT, routing_ioctl)
 HANDLE_IOCTL(SIOCDELRT, routing_ioctl)
 /* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */
index 0ed650898af25562308797273942ccc376c0212f..4610aee96db10e90e081a8c20c80319e5e7b0fcb 100644 (file)
@@ -604,9 +604,6 @@ void smp_flush_tlb_all(void)
  * are flush_tlb_*() routines, and these run after flush_cache_*()
  * which performs the flushw.
  *
- * XXX I diked out the fancy flush avoidance code for the
- * XXX swapping cases for now until the new MM code stabilizes. -DaveM
- *
  * The SMP TLB coherency scheme we use works as follows:
  *
  * 1) mm->cpu_vm_mask is a bit mask of which cpus an address
@@ -642,10 +639,20 @@ void smp_flush_tlb_all(void)
  *    call won't even show up on the performance radar.  But in any case we do get
  *    rid of the cross-call when the task has a dead context or the task has only
  *    ever run on the local cpu.
+ *
+ * 4) If the mm never had a valid context yet, there is nothing to
+ *    flush.  CTX_NEVER_WAS_VALID checks this.
+ *
+ *    This check used to be done with CTX_VALID(), but Kanoj Sarcar has
+ *    pointed out that this is an invalid optimization.  It can cause
+ *    stale translations to be left in the TLB.
  */
 void smp_flush_tlb_mm(struct mm_struct *mm)
 {
-       if (CTX_VALID(mm->context)) {
+       if (CTX_NEVER_WAS_VALID(mm->context))
+               return;
+
+       {
                u32 ctx = CTX_HWBITS(mm->context);
                int cpu = smp_processor_id();
 
@@ -665,7 +672,10 @@ void smp_flush_tlb_mm(struct mm_struct *mm)
 void smp_flush_tlb_range(struct mm_struct *mm, unsigned long start,
                         unsigned long end)
 {
-       if (CTX_VALID(mm->context)) {
+       if (CTX_NEVER_WAS_VALID(mm->context))
+               return;
+
+       {
                u32 ctx = CTX_HWBITS(mm->context);
                int cpu = smp_processor_id();
 
@@ -686,7 +696,10 @@ void smp_flush_tlb_range(struct mm_struct *mm, unsigned long start,
 
 void smp_flush_tlb_page(struct mm_struct *mm, unsigned long page)
 {
-       if (CTX_VALID(mm->context)) {
+       if (CTX_NEVER_WAS_VALID(mm->context))
+               return;
+
+       {
                u32 ctx = CTX_HWBITS(mm->context);
                int cpu = smp_processor_id();
 
index b2df0e169ac0763a96e4be2010eacab967cf644a..dcd982b7bc462aaf8f2109695a0b28c13836595f 100644 (file)
@@ -43,27 +43,32 @@ search_one_table(const struct exception_table_entry *start,
         return 0;
 }
 
+extern spinlock_t modlist_lock;
+
 unsigned long
 search_exception_table(unsigned long addr, unsigned long *g2)
 {
-       unsigned long ret;
+       unsigned long ret = 0, flags;
 
 #ifndef CONFIG_MODULES
        /* There is only the kernel to search.  */
        ret = search_one_table(__start___ex_table,
                               __stop___ex_table-1, addr, g2);
-       if (ret) return ret;
+       return ret;
 #else
        /* The kernel is the last "module" -- no need to treat it special.  */
        struct module *mp;
+
+       spin_lock_irqsave(&modlist_lock, flags);
        for (mp = module_list; mp != NULL; mp = mp->next) {
-               if (mp->ex_table_start == NULL)
+               if (mp->ex_table_start == NULL || !(mp->flags & (MOD_RUNNING | MOD_INITIALIZING)))
                        continue;
                ret = search_one_table(mp->ex_table_start,
                                       mp->ex_table_end-1, addr, g2);
-               if (ret) return ret;
+               if (ret)
+                       break;
        }
+       spin_unlock_irqrestore(&modlist_lock, flags);
+       return ret;
 #endif
-
-       return 0;
 }
index 91d0870ca5a601325c68f8a3a35168624e97d593..08efb8c18de57e381305df543a4e7f35c5db2aec 100644 (file)
@@ -1,4 +1,4 @@
-/*  $Id: init.c,v 1.176 2001/05/16 15:07:11 davem Exp $
+/*  $Id: init.c,v 1.178 2001/08/06 13:09:00 davem Exp $
  *  arch/sparc64/mm/init.c
  *
  *  Copyright (C) 1996-1999 David S. Miller (davem@caip.rutgers.edu)
@@ -833,6 +833,7 @@ void __flush_tlb_all(void)
 }
 
 /* Caller does TLB context flushing on local CPU if necessary.
+ * The caller also ensures that CTX_VALID(mm->context) is false.
  *
  * We must be careful about boundary cases so that we never
  * let the user have CTX 0 (nucleus) or we ever use a CTX
@@ -845,12 +846,6 @@ void get_new_mmu_context(struct mm_struct *mm)
        
        spin_lock(&ctx_alloc_lock);
        ctx = CTX_HWBITS(tlb_context_cache + 1);
-       if (ctx == 0)
-               ctx = 1;
-       if (CTX_VALID(mm->context)) {
-               unsigned long nr = CTX_HWBITS(mm->context);
-               mmu_context_bmap[nr>>6] &= ~(1UL << (nr & 63));
-       }
        new_ctx = find_next_zero_bit(mmu_context_bmap, 1UL << CTX_VERSION_SHIFT, ctx);
        if (new_ctx >= (1UL << CTX_VERSION_SHIFT)) {
                new_ctx = find_next_zero_bit(mmu_context_bmap, ctx, 1);
index 09078e922d689d915c0d0464635cbee4261469bb..26c1a4964796e52c59e5009a9b8b809a8fa0aee1 100644 (file)
@@ -94,6 +94,7 @@ IVc. Errata
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/delay.h>
+#include <linux/ethtool.h>
 #include <linux/mii.h>
 #include <asm/io.h>
 
index f955b003a1ddaab3627d78a6dc17b36877362353..463d815529ec5e41546e6783f51777e6197c423e 100644 (file)
@@ -368,7 +368,7 @@ static void DumpLong(char*, int);
 
 /* global variables *********************************************************/
 static const char *BootString = BOOT_STRING;
-static struct net_device *root_dev = NULL;
+struct net_device *sk98lin_root_dev = NULL;
 static int probed __initdata = 0;
 struct inode_operations SkInodeOps;
 //static struct file_operations SkFileOps;  /* with open/relase */
@@ -685,7 +685,7 @@ static int options[SK_MAX_CARD_PARAM] = {0, }; /* not used */
 static int __init skge_init_module(void)
 {
        int cards;
-       root_dev = NULL;
+       sk98lin_root_dev = NULL;
        
        /* just to avoid warnings ... */
        debug = 0;
@@ -717,12 +717,12 @@ struct net_device *next;
 unsigned long Flags;
 SK_EVPARA EvPara;
 
-       while (root_dev) {
-               pNet = (DEV_NET*) root_dev->priv;
+       while (sk98lin_root_dev) {
+               pNet = (DEV_NET*) sk98lin_root_dev->priv;
                pAC = pNet->pAC;
                next = pAC->Next;
 
-               netif_stop_queue(root_dev);
+               netif_stop_queue(sk98lin_root_dev);
                SkGeYellowLED(pAC, pAC->IoBase, 0);
 
                if(pAC->BoardLevel == 2) {
@@ -754,17 +754,17 @@ SK_EVPARA EvPara;
                        kfree(pAC->dev[1]);
                }
 
-               FreeResources(root_dev);
+               FreeResources(sk98lin_root_dev);
 
-               root_dev->get_stats = NULL;
+               sk98lin_root_dev->get_stats = NULL;
                /* 
                 * otherwise unregister_netdev calls get_stats with
                 * invalid IO ...  :-(
                 */
-               unregister_netdev(root_dev);
-               kfree(root_dev);
+               unregister_netdev(sk98lin_root_dev);
+               kfree(sk98lin_root_dev);
                kfree(pAC);
-               root_dev = next;
+               sk98lin_root_dev = next;
        }
 
        /* clear proc-dir */
@@ -911,8 +911,8 @@ int Ret;                    /* return code of request_irq */
        /*
         * Register the device here
         */
-       pAC->Next = root_dev;
-       root_dev = dev;
+       pAC->Next = sk98lin_root_dev;
+       sk98lin_root_dev = dev;
 
        return (0);
 } /* SkGeBoardInit */
index 3771db393875924c2ba5665c51ef3ffcfef7cdb7..9c07f9c270bb2cb88f7e5b844bc45ebe61c7cbda 100644 (file)
@@ -65,7 +65,7 @@ int proc_read(char *buffer,
                                void *data);
 
 static const char SK_Root_Dir_entry[] = "sk98lin";
-extern struct net_device *root_dev;
+extern struct net_device *sk98lin_root_dev;
 
 
 struct proc_dir_entry pSkRootDir = { 
@@ -106,7 +106,7 @@ void *data)
        unsigned long                   Flags;          
        unsigned int                    Size;
        struct net_device               *next;
-       struct net_device               *SkgeProcDev = root_dev;
+       struct net_device               *SkgeProcDev = sk98lin_root_dev;
 
        SK_PNMI_STRUCT_DATA     *pPnmiStruct;
        SK_PNMI_STAT            *pPnmiStat;
index ac3369ccf6726f334fcaad4878b8109fcff891d1..230ae012f71ec2ea86b3f1831408e97cbd817eaf 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sungem.c,v 1.17 2001/06/17 09:22:46 jgarzik Exp $
+/* $Id: sungem.c,v 1.18 2001/08/06 13:34:47 davem Exp $
  * sungem.c: Sun GEM ethernet driver.
  *
  * Copyright (C) 2000, 2001 David S. Miller (davem@redhat.com)
@@ -1576,8 +1576,10 @@ static int __devinit gem_check_invariants(struct gem *gp)
 
 static int __devinit gem_get_device_address(struct gem *gp)
 {
+#if defined(__sparc__) || defined(__powerpc__)
        struct net_device *dev = gp->dev;
        struct pci_dev *pdev = gp->pdev;
+#endif
 
 #ifdef __sparc__
        struct pcidev_cookie *pcp = pdev->sysdata;
index 83e3cec781f5f8eef16b96d66cf7a99565fa6502..051d438216c3a9edb47bd9fd1b4110da79e815d4 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sunhme.h,v 1.32 2000/12/13 18:31:47 davem Exp $
+/* $Id: sunhme.h,v 1.33 2001/08/03 06:23:04 davem Exp $
  * sunhme.h: Definitions for Sparc HME/BigMac 10/100baseT ethernet driver.
  *           Also known as the "Happy Meal".
  *
  * Debugging eeprom burnt code is more fun than programming this chip!
  */
 
-/* First, the DP83840 register numbers. */
-#define DP83840_BMCR            0x00        /* Basic mode control register */
-#define DP83840_BMSR            0x01        /* Basic mode status register  */
-#define DP83840_PHYSID1         0x02        /* PHYS ID 1                   */
-#define DP83840_PHYSID2         0x03        /* PHYS ID 2                   */
-#define DP83840_ADVERTISE       0x04        /* Advertisement control reg   */
-#define DP83840_LPA             0x05        /* Link partner ability reg    */
-#define DP83840_EXPANSION       0x06        /* Expansion register          */
-#define DP83840_DCOUNTER        0x12        /* Disconnect counter          */
-#define DP83840_FCSCOUNTER      0x13        /* False carrier counter       */
-#define DP83840_NWAYTEST        0x14        /* N-way auto-neg test reg     */
-#define DP83840_RERRCOUNTER     0x15        /* Receive error counter       */
-#define DP83840_SREVISION       0x16        /* Silicon revision            */
+/* Generic MII registers defined in linux/mii.h, these below
+ * are DP83840 specific.
+ */
 #define DP83840_CSCONFIG        0x17        /* CS configuration            */
-#define DP83840_LBRERROR        0x18        /* Lpback, rx, bypass error    */
-#define DP83840_PHYADDR         0x19        /* PHY address                 */
-#define DP83840_RESERVED        0x1a        /* Unused...                   */
-#define DP83840_TPISTATUS       0x1b        /* TPI status for 10mbps       */
-#define DP83840_NCONFIG         0x1c        /* Network interface config    */
-
-/* Basic mode control register. */
-#define BMCR_RESV               0x007f  /* Unused...                   */
-#define BMCR_CTST               0x0080  /* Collision test              */
-#define BMCR_FULLDPLX           0x0100  /* Full duplex                 */
-#define BMCR_ANRESTART          0x0200  /* Auto negotiation restart    */
-#define BMCR_ISOLATE            0x0400  /* Disconnect DP83840 from MII */
-#define BMCR_PDOWN              0x0800  /* Powerdown the DP83840       */
-#define BMCR_ANENABLE           0x1000  /* Enable auto negotiation     */
-#define BMCR_SPEED100           0x2000  /* Select 100Mbps              */
-#define BMCR_LOOPBACK           0x4000  /* TXD loopback bits           */
-#define BMCR_RESET              0x8000  /* Reset the DP83840           */
-
-/* Basic mode status register. */
-#define BMSR_ERCAP              0x0001  /* Ext-reg capability          */
-#define BMSR_JCD                0x0002  /* Jabber detected             */
-#define BMSR_LSTATUS            0x0004  /* Link status                 */
-#define BMSR_ANEGCAPABLE        0x0008  /* Able to do auto-negotiation */
-#define BMSR_RFAULT             0x0010  /* Remote fault detected       */
-#define BMSR_ANEGCOMPLETE       0x0020  /* Auto-negotiation complete   */
-#define BMSR_RESV               0x07c0  /* Unused...                   */
-#define BMSR_10HALF             0x0800  /* Can do 10mbps, half-duplex  */
-#define BMSR_10FULL             0x1000  /* Can do 10mbps, full-duplex  */
-#define BMSR_100HALF            0x2000  /* Can do 100mbps, half-duplex */
-#define BMSR_100FULL            0x4000  /* Can do 100mbps, full-duplex */
-#define BMSR_100BASE4           0x8000  /* Can do 100mbps, 4k packets  */
-
-/* Advertisement control register. */
-#define ADVERTISE_SLCT          0x001f  /* Selector bits               */
-#define ADVERTISE_CSMA          0x0001  /* Only selector supported     */
-#define ADVERTISE_10HALF        0x0020  /* Try for 10mbps half-duplex  */
-#define ADVERTISE_10FULL        0x0040  /* Try for 10mbps full-duplex  */
-#define ADVERTISE_100HALF       0x0080  /* Try for 100mbps half-duplex */
-#define ADVERTISE_100FULL       0x0100  /* Try for 100mbps full-duplex */
-#define ADVERTISE_100BASE4      0x0200  /* Try for 100mbps 4k packets  */
-#define ADVERTISE_RESV          0x1c00  /* Unused...                   */
-#define ADVERTISE_RFAULT        0x2000  /* Say we can detect faults    */
-#define ADVERTISE_LPACK         0x4000  /* Ack link partners response  */
-#define ADVERTISE_NPAGE         0x8000  /* Next page bit               */
-
-#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
-                       ADVERTISE_100HALF | ADVERTISE_100FULL)
-
-/* Link partner ability register. */
-#define LPA_SLCT                0x001f  /* Same as advertise selector  */
-#define LPA_10HALF              0x0020  /* Can do 10mbps half-duplex   */
-#define LPA_10FULL              0x0040  /* Can do 10mbps full-duplex   */
-#define LPA_100HALF             0x0080  /* Can do 100mbps half-duplex  */
-#define LPA_100FULL             0x0100  /* Can do 100mbps full-duplex  */
-#define LPA_100BASE4            0x0200  /* Can do 100mbps 4k packets   */
-#define LPA_RESV                0x1c00  /* Unused...                   */
-#define LPA_RFAULT              0x2000  /* Link partner faulted        */
-#define LPA_LPACK               0x4000  /* Link partner acked us       */
-#define LPA_NPAGE               0x8000  /* Next page bit               */
-
-/* Expansion register for auto-negotiation. */
-#define EXPANSION_NWAY          0x0001  /* Can do N-way auto-nego      */
-#define EXPANSION_LCWP          0x0002  /* Got new RX page code word   */
-#define EXPANSION_ENABLENPAGE   0x0004  /* This enables npage words    */
-#define EXPANSION_NPCAPABLE     0x0008  /* Link partner supports npage */
-#define EXPANSION_MFAULTS       0x0010  /* Multiple faults detected    */
-#define EXPANSION_RESV          0xffe0  /* Unused...                   */
-
-/* N-way test register. */
-#define NWAYTEST_RESV1          0x00ff  /* Unused...                   */
-#define NWAYTEST_LOOPBACK       0x0100  /* Enable loopback for N-way   */
-#define NWAYTEST_RESV2          0xfe00  /* Unused...                   */
 
 /* The Carrier Sense config register. */
 #define CSCONFIG_RESV1          0x0001  /* Unused...                   */
 #define CSCONFIG_RESV4          0x4000  /* Unused...                   */
 #define CSCONFIG_NDISABLE       0x8000  /* Disable NRZI                */
 
-/* Loopback, receive, bypass error register. */
-#define LBRERROR_EBUFFER        0x0001  /* Show elasticity buf errors  */
-#define LBRERROR_PACKET         0x0002  /* Show packet errors          */
-#define LBRERROR_LINK           0x0004  /* Show link errors            */
-#define LBRERROR_END            0x0008  /* Show premature end errors   */
-#define LBRERROR_CODE           0x0010  /* Show code errors            */
-#define LBRERROR_RESV1          0x00e0  /* Unused...                   */
-#define LBRERROR_LBACK          0x0300  /* Remote and twister loopback */
-#define LBRERROR_10TX           0x0400  /* Transceiver loopback 10mbps */
-#define LBRERROR_ENDEC          0x0800  /* ENDEC loopback 10mbps       */
-#define LBRERROR_ALIGN          0x1000  /* Bypass symbol alignment     */
-#define LBRERROR_SCRAMBLER      0x2000  /* Bypass (de)scrambler        */
-#define LBRERROR_ENCODER        0x4000  /* Bypass 4B5B/5B4B encoders   */
-#define LBRERROR_BEBUF          0x8000  /* Bypass elasticity buffers   */
-
-/* Physical address register. */
-#define PHYADDR_ADDRESS         0x001f  /* The address itself          */
-#define PHYADDR_DISCONNECT      0x0020  /* Disconnect status           */
-#define PHYADDR_10MBPS          0x0040  /* 1=10mbps, 0=100mbps         */
-#define PHYADDR_RESV            0xff80  /* Unused...                   */
-
-/* TPI status register for 10mbps. */
-#define TPISTATUS_RESV1         0x01ff  /* Unused...                   */
-#define TPISTATUS_SERIAL        0x0200  /* Enable 10mbps serial mode   */
-#define TPISTATUS_RESV2         0xfc00  /* Unused...                   */
-
-/* Network interface config register. */
-#define NCONFIG_JENABLE         0x0001  /* Jabber enable               */
-#define NCONFIG_RESV1           0x0002  /* Unused...                   */
-#define NCONFIG_SQUELCH         0x0004  /* Use low squelch             */
-#define NCONFIG_UTP             0x0008  /* 1=UTP, 0=STP                */
-#define NCONFIG_HBEAT           0x0010  /* Heart-beat enable           */
-#define NCONFIG_LDISABLE        0x0020  /* Disable the link            */
-#define NCONFIG_RESV2           0xffc0  /* Unused...                   */
-
 /* Happy Meal descriptor rings and such.
  * All descriptor rings must be aligned on a 2K boundry.
  * All receive buffers must be 64 byte aligned.
index b007dd78df02b85ecaf3a3f6dfe4c58bb859ed52..8df9e438c5600509d9c16d3282dbd8e715fe3482 100644 (file)
@@ -1420,6 +1420,10 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
        if (chip_idx == LC82C168)
                csr0 &= ~0xfff10000; /* zero reserved bits 31:20, 16 */
 
+       /* DM9102A has troubles with MRM, clear bit 24 too. */
+       if (pdev->vendor == 0x1282 && pdev->device == 0x9102)
+               csr0 &= ~0x01200000;
+
        /*
         *      And back to business
         */
@@ -1762,9 +1766,9 @@ err_out_mtable:
                kfree (tp->mtable);
 #ifndef USE_IO_OPS
        iounmap((void *)ioaddr);
-#endif
 
 err_out_free_res:
+#endif
        pci_release_regions (pdev);
 
 err_out_free_netdev:
index 9e6ee2b2673e51ed39f458064bba936c200fdfb0..b14907f7d2204513dc1f21b53ec729b90043aa57 100644 (file)
@@ -218,7 +218,7 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, const char *buf,
        if (tun->flags & TUN_NOCHECKSUM)
                skb->ip_summed = CHECKSUM_UNNECESSARY;
  
-       netif_rx(skb);
+       netif_rx_ni(skb);
    
        tun->stats.rx_packets++;
        tun->stats.rx_bytes += len;
index 82fab8a38e995b98387dd2d2288e30b07c5d017a..a9c35f7353e7db3f92b6e7ff850b679a55ad75f1 100644 (file)
@@ -61,6 +61,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/vt_kern.h>
+#include <linux/kd.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
index e2ccafa93f79b686d6f75c6d147f8afc55ec1c18..9cc2668d4eef4eda64ff3dbe30e80605acdd4e5c 100644 (file)
@@ -219,9 +219,9 @@ static int write_some_buffers(kdev_t dev)
                        continue;
                if (test_and_set_bit(BH_Lock, &bh->b_state))
                        continue;
-               get_bh(bh);
                if (atomic_set_buffer_clean(bh)) {
                        __refile_buffer(bh);
+                       get_bh(bh);
                        array[count++] = bh;
                        if (count < NRSYNC)
                                continue;
@@ -231,7 +231,6 @@ static int write_some_buffers(kdev_t dev)
                        return -EAGAIN;
                }
                unlock_buffer(bh);
-               put_bh(bh);
        }
        spin_unlock(&lru_list_lock);
 
@@ -251,13 +250,17 @@ static void write_unlocked_buffers(kdev_t dev)
        run_task_queue(&tq_disk);
 }
 
-static int wait_for_locked_buffers(kdev_t dev, int index, int refile)
+/*
+ * Wait for a buffer on the proper list.
+ *
+ * This must be called with the LRU lock held, and
+ * will return with it released.
+ */
+static int wait_for_buffers(kdev_t dev, int index, int refile)
 {
        struct buffer_head * next;
        int nr;
 
-repeat:
-       spin_lock(&lru_list_lock);
        next = lru_list[index];
        nr = nr_buffers_type[index] * 2;
        while (next && --nr >= 0) {
@@ -276,12 +279,26 @@ repeat:
                spin_unlock(&lru_list_lock);
                wait_on_buffer (bh);
                put_bh(bh);
-               goto repeat;
+               return -EAGAIN;
        }
        spin_unlock(&lru_list_lock);
        return 0;
 }
 
+static inline void wait_for_some_buffers(kdev_t dev)
+{
+       spin_lock(&lru_list_lock);
+       wait_for_buffers(dev, BUF_LOCKED, 1);
+}
+
+static int wait_for_locked_buffers(kdev_t dev, int index, int refile)
+{
+       do {
+               spin_lock(&lru_list_lock);
+       } while (wait_for_buffers(dev, index, refile));
+       return 0;
+}
+
 /* Call sync_buffers with wait!=0 to ensure that the call does not
  * return until all buffer writes have completed.  Sync() may return
  * before the writes have finished; fsync() may not.
@@ -775,15 +792,16 @@ void set_blocksize(kdev_t dev, int size)
 /*
  * We used to try various strange things. Let's not.
  * We'll just try to balance dirty buffers, and possibly
- * launder some pages.
+ * launder some pages and do our best to make more memory
+ * available.
  */
 static void refill_freelist(int size)
 {
-       balance_dirty(NODEV);
-       if (free_shortage())
-               page_launder(GFP_NOFS, 0);
        if (!grow_buffers(size)) {
+               balance_dirty(NODEV);
+               page_launder(GFP_NOFS, 0);              
                wakeup_bdflush();
+               wakeup_kswapd();
                current->policy |= SCHED_YIELD;
                __set_current_state(TASK_RUNNING);
                schedule();
@@ -1094,19 +1112,19 @@ void balance_dirty(kdev_t dev)
 
        if (state < 0)
                return;
+
+       /* If we're getting into imbalance, start write-out */
+       spin_lock(&lru_list_lock);
+       write_some_buffers(dev);
        wakeup_bdflush();
 
        /*
-        * If we're getting a lot out of balance, start some IO ourselves.
-        *
-        * This only queues it, and does not actually start it - we'll let
-        * bdflush do that, or let it happen as a result of a lot of calls
-        * to balance_dirty() filling up the request queues.
+        * And if we're _really_ out of balance, wait for
+        * some of the dirty/locked buffers ourselves.
+        * This will throttle heavy writers.
         */
-       if (state > 0) {
-               spin_lock(&lru_list_lock);
-               write_some_buffers(dev);
-       }
+       if (state > 0)
+               wait_for_some_buffers(dev);
 }
 
 static __inline__ void __mark_dirty(struct buffer_head *bh)
@@ -2581,7 +2599,7 @@ static int sync_old_buffers(void)
 
                        spin_lock(&lru_list_lock);
                        bh = lru_list[BUF_DIRTY];
-                       if (!time_before(jiffies, bh->b_flushtime))
+                       if (bh && !time_before(jiffies, bh->b_flushtime))
                                continue;
                        spin_unlock(&lru_list_lock);
                }
@@ -2682,7 +2700,7 @@ int bdflush(void *startup)
 
                spin_lock(&lru_list_lock);
                if (!write_some_buffers(NODEV) || balance_dirty_state(NODEV) < 0) {
-                       run_task_queue(&tq_disk);
+                       wait_for_some_buffers(NODEV);
                        interruptible_sleep_on(&bdflush_wait);
                }
        }
@@ -2713,6 +2731,8 @@ int kupdate(void *startup)
        complete((struct completion *)startup);
 
        for (;;) {
+               wait_for_some_buffers(NODEV);
+
                /* update interval */
                interval = bdf_prm.b_un.interval;
                if (interval) {
index 020b68fbbb55523ab0347a31b58d4ae3d179e91f..fa318a5b581c63f4a1326c3d231548f45d5f11cd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.106 2000/11/08 04:49:24 davem Exp $ */
+/* $Id: pgtable.h,v 1.107 2001/08/06 13:16:37 davem Exp $ */
 #ifndef _SPARC_PGTABLE_H
 #define _SPARC_PGTABLE_H
 
@@ -27,6 +27,7 @@
 #ifndef __ASSEMBLY__
 
 extern void load_mmu(void);
+extern unsigned long calc_highpages(void);
                               
 BTFIXUPDEF_CALL(void, quick_kernel_fault, unsigned long)
 
index 27609bfbe468fc75dbcbc84445ca91f7922cb95e..f1d14f0112cef3e6d96e9f4febbe34a56db51a13 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mmu_context.h,v 1.47 2001/03/22 07:26:04 davem Exp $ */
+/* $Id: mmu_context.h,v 1.48 2001/08/03 06:18:52 davem Exp $ */
 #ifndef __SPARC64_MMU_CONTEXT_H
 #define __SPARC64_MMU_CONTEXT_H
 
@@ -23,6 +23,7 @@ extern unsigned long mmu_context_bmap[];
 #define CTX_FIRST_VERSION      ((1UL << CTX_VERSION_SHIFT) + 1UL)
 #define CTX_VALID(__ctx)       \
         (!(((__ctx) ^ tlb_context_cache) & CTX_VERSION_MASK))
+#define CTX_NEVER_WAS_VALID(__ctx) ((__ctx) == 0UL)
 #define CTX_HWBITS(__ctx)      ((__ctx) & ~CTX_VERSION_MASK)
 
 extern void get_new_mmu_context(struct mm_struct *mm);
index a00adf046d5066fdd88e30c2673399c548c96774..003326eb3361e024b41798afad2039f2165ba9a6 100644 (file)
@@ -562,6 +562,17 @@ extern void                dev_init(void);
 
 extern int             netdev_nit;
 
+/* Post buffer to the network code from _non interrupt_ context.
+ * see net/core/dev.c for netif_rx description.
+ */
+static inline int netif_rx_ni(struct sk_buff *skb)
+{
+       int err = netif_rx(skb);
+       if (softirq_pending(smp_processor_id()))
+               do_softirq();
+       return err;
+}
+
 static inline void dev_init_buffers(struct net_device *dev)
 {
        /* WILL BE REMOVED IN 2.5.0 */
index b237fa6bb96080ca509deb14a453c1e1dfcb7bc3..3237e19fabc7b95db18388b957417dd322780c90 100644 (file)
@@ -88,6 +88,10 @@ extern int                   ipv6_chk_mcast_addr(struct net_device *dev,
 extern void                    addrconf_prefix_rcv(struct net_device *dev,
                                                    u8 *opt, int len);
 
+/* Device notifier */
+extern int register_inet6addr_notifier(struct notifier_block *nb);
+extern int unregister_inet6addr_notifier(struct notifier_block *nb);
+
 static inline struct inet6_dev *
 __in6_dev_get(struct net_device *dev)
 {
index 5eb87a6d5df737614c40481a4314ec2f05c520cd..38d4b3ad326a42660065cc9e4d22b683f08e5902 100644 (file)
@@ -537,6 +537,30 @@ struct inode *shmem_get_inode(struct super_block *sb, int mode, int dev)
        return inode;
 }
 
+static int shmem_set_size(struct shmem_sb_info *info,
+                         unsigned long max_blocks, unsigned long max_inodes)
+{
+       int error;
+       unsigned long blocks, inodes;
+
+       spin_lock(&info->stat_lock);
+       blocks = info->max_blocks - info->free_blocks;
+       inodes = info->max_inodes - info->free_inodes;
+       error = -EINVAL;
+       if (max_blocks < blocks)
+               goto out;
+       if (max_inodes < inodes)
+               goto out;
+       error = 0;
+       info->max_blocks  = max_blocks;
+       info->free_blocks = max_blocks - blocks;
+       info->max_inodes  = max_inodes;
+       info->free_inodes = max_inodes - inodes;
+out:
+       spin_unlock(&info->stat_lock);
+       return error;
+}
+
 #ifdef CONFIG_TMPFS
 static ssize_t
 shmem_file_write(struct file *file,const char *buf,size_t count,loff_t *ppos)
@@ -1003,30 +1027,6 @@ static int shmem_parse_options(char *options, int *mode, unsigned long * blocks,
        return 0;
 }
 
-static int shmem_set_size(struct shmem_sb_info *info,
-                         unsigned long max_blocks, unsigned long max_inodes)
-{
-       int error;
-       unsigned long blocks, inodes;
-
-       spin_lock(&info->stat_lock);
-       blocks = info->max_blocks - info->free_blocks;
-       inodes = info->max_inodes - info->free_inodes;
-       error = -EINVAL;
-       if (max_blocks < blocks)
-               goto out;
-       if (max_inodes < inodes)
-               goto out;
-       error = 0;
-       info->max_blocks  = max_blocks;
-       info->free_blocks = max_blocks - blocks;
-       info->max_inodes  = max_inodes;
-       info->free_inodes = max_inodes - inodes;
-out:
-       spin_unlock(&info->stat_lock);
-       return error;
-}
-
 static int shmem_remount_fs (struct super_block *sb, int *flags, char *data)
 {
        struct shmem_sb_info *info = &sb->u.shmem_sb;
index 1385479d5099dc86e491158d75058f359e27818f..47939675f8045b35a5c61263caf1b8b6f40448a6 100644 (file)
@@ -4,7 +4,7 @@
  *     Authors:        Alan Cox <iiitac@pyr.swan.ac.uk>
  *                     Florian La Roche <rzsfl@rz.uni-sb.de>
  *
- *     Version:        $Id: skbuff.c,v 1.88 2001/07/09 23:19:14 davem Exp $
+ *     Version:        $Id: skbuff.c,v 1.89 2001/08/06 13:25:02 davem Exp $
  *
  *     Fixes:  
  *             Alan Cox        :       Fixed the worst of the load balancer bugs.
@@ -180,7 +180,7 @@ struct sk_buff *alloc_skb(unsigned int size,int gfp_mask)
        /* Get the HEAD */
        skb = skb_head_from_pool();
        if (skb == NULL) {
-               skb = kmem_cache_alloc(skbuff_head_cache, gfp_mask);
+               skb = kmem_cache_alloc(skbuff_head_cache, gfp_mask & ~__GFP_DMA);
                if (skb == NULL)
                        goto nohead;
        }
index 8a4100c145bf882bb639f9f0f48a488bd2f322f4..9d6243f4069951119f8ecda0f720ba2238261241 100644 (file)
@@ -5,7 +5,7 @@
  *
  *             PF_INET protocol family socket handler.
  *
- * Version:    $Id: af_inet.c,v 1.131 2001/06/13 16:25:03 davem Exp $
+ * Version:    $Id: af_inet.c,v 1.133 2001/08/06 13:21:16 davem Exp $
  *
  * Authors:    Ross Biro, <bir7@leland.Stanford.Edu>
  *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
 #include <linux/wireless.h>            /* Note : will define WIRELESS_EXT */
 #endif /* CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO */
 
-#define min(a,b)       ((a)<(b)?(a):(b))
-
 struct linux_mib net_statistics[NR_CPUS*2];
 
 #ifdef INET_REFCNT_DEBUG
@@ -882,14 +880,15 @@ static int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                        if (br_ioctl_hook != NULL)
                                return br_ioctl_hook(arg);
 #endif
+                       return -ENOPKG;
+
                case SIOCGIFDIVERT:
                case SIOCSIFDIVERT:
 #ifdef CONFIG_NET_DIVERT
-                       return(divert_ioctl(cmd, (struct divert_cf *) arg));
+                       return divert_ioctl(cmd, (struct divert_cf *) arg);
 #else
                        return -ENOPKG;
 #endif /* CONFIG_NET_DIVERT */
-                       return -ENOPKG;
                        
                case SIOCADDDLCI:
                case SIOCDELDLCI:
index bac58f337845161b9a2f1edc7a9626cc081a2da3..12ac051597dde17c8f46b6d4fb8fd3740a88a99b 100644 (file)
@@ -3,7 +3,7 @@
  *     
  *             Alan Cox, <alan@redhat.com>
  *
- *     Version: $Id: icmp.c,v 1.77 2001/06/14 13:40:46 davem Exp $
+ *     Version: $Id: icmp.c,v 1.79 2001/08/03 22:20:39 davem Exp $
  *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
@@ -88,8 +88,6 @@
 #include <asm/uaccess.h>
 #include <net/checksum.h>
 
-#define min(a,b)       ((a)<(b)?(a):(b))
-
 /*
  *     Build xmit assembly blocks
  */
@@ -240,12 +238,15 @@ static __inline__ void icmp_xmit_unlock(void)
 int xrlim_allow(struct dst_entry *dst, int timeout)
 {
        unsigned long now;
+       static int burst = HZ;
 
        now = jiffies;
        dst->rate_tokens += now - dst->rate_last;
        dst->rate_last = now;
-       if (dst->rate_tokens > XRLIM_BURST_FACTOR*timeout)
-               dst->rate_tokens = XRLIM_BURST_FACTOR*timeout;
+       if (burst < XRLIM_BURST_FACTOR*timeout)
+               burst = XRLIM_BURST_FACTOR*timeout;
+       if (dst->rate_tokens > burst)
+               dst->rate_tokens = burst;
        if (dst->rate_tokens >= timeout) {
                dst->rate_tokens -= timeout;
                return 1;
@@ -635,8 +636,8 @@ static void icmp_unreach(struct sk_buff *skb)
        read_lock(&raw_v4_lock);
        if ((raw_sk = raw_v4_htable[hash]) != NULL) 
        {
-               while ((raw_sk = __raw_v4_lookup(raw_sk, protocol, iph->saddr,
-                                                iph->daddr, skb->dev->ifindex)) != NULL) {
+               while ((raw_sk = __raw_v4_lookup(raw_sk, protocol, iph->daddr,
+                                                iph->saddr, skb->dev->ifindex)) != NULL) {
                        raw_err(raw_sk, skb, info);
                        raw_sk = raw_sk->next;
                        iph = (struct iphdr *)skb->data;
index e3b9e1fd91e08231f65bdc29a5efa9105e4812cb..214dc38b95ff4205a94ee4fae95f71c747fd43a8 100644 (file)
@@ -5,7 +5,7 @@
  *
  *             The Internet Protocol (IP) output module.
  *
- * Version:    $Id: ip_output.c,v 1.94 2001/07/10 00:40:13 davem Exp $
+ * Version:    $Id: ip_output.c,v 1.96 2001/08/03 22:20:39 davem Exp $
  *
  * Authors:    Ross Biro, <bir7@leland.Stanford.Edu>
  *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -211,7 +211,8 @@ int ip_mc_output(struct sk_buff *skb)
         *      Multicasts are looped back for other local users
         */
 
-       if (rt->rt_flags&RTCF_MULTICAST && (!sk || sk->protinfo.af_inet.mc_loop)) {
+       if (rt->rt_flags&RTCF_MULTICAST) {
+               if ((!sk || sk->protinfo.af_inet.mc_loop)
 #ifdef CONFIG_IP_MROUTE
                /* Small optimization: do not loopback not local frames,
                   which returned after forwarding; they will be  dropped
@@ -221,9 +222,9 @@ int ip_mc_output(struct sk_buff *skb)
 
                   This check is duplicated in ip_mr_input at the moment.
                 */
-               if ((rt->rt_flags&RTCF_LOCAL) || !(IPCB(skb)->flags&IPSKB_FORWARDED))
+                   && ((rt->rt_flags&RTCF_LOCAL) || !(IPCB(skb)->flags&IPSKB_FORWARDED))
 #endif
-               {
+               {
                        struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC);
                        if (newskb)
                                NF_HOOK(PF_INET, NF_IP_POST_ROUTING, newskb, NULL,
@@ -342,6 +343,13 @@ int ip_queue_xmit(struct sk_buff *skb)
        struct rtable *rt;
        struct iphdr *iph;
 
+       /* Skip all of this if the packet is already routed,
+        * f.e. by something like SCTP.
+        */
+       rt = (struct rtable *) skb->dst;
+       if (rt != NULL)
+               goto packet_routed;
+
        /* Make sure we can route this packet. */
        rt = (struct rtable *)__sk_dst_check(sk, 0);
        if (rt == NULL) {
@@ -365,6 +373,7 @@ int ip_queue_xmit(struct sk_buff *skb)
        }
        skb->dst = dst_clone(&rt->u.dst);
 
+packet_routed:
        if (opt && opt->is_strictroute && rt->rt_dst != rt->rt_gateway)
                goto no_route;
 
index 91eb091f5484a7bca582b42889d7e06c1b980e9a..939f52abc070470f7b9a613a3d0a23bd0a0982c5 100644 (file)
@@ -356,7 +356,7 @@ icmp_error_track(struct sk_buff *skb,
        inner = (struct iphdr *)(hdr + 1);
        datalen = skb->len - iph->ihl*4 - sizeof(*hdr);
 
-       if (skb->len < iph->ihl * 4 + sizeof(struct icmphdr)) {
+       if (skb->len < iph->ihl * 4 + sizeof(*hdr) + sizeof(*iph)) {
                DEBUGP("icmp_error_track: too short\n");
                return NULL;
        }
index 7ff6ccb50b373199d27d859bd775aef26d6c13f4..ff25da08cd097b8db101f223f53fc2e745300ff1 100644 (file)
@@ -92,10 +92,17 @@ tcp_manip_pkt(struct iphdr *iph, size_t len,
                oldip = iph->daddr;
                portptr = &hdr->dest;
        }
-       hdr->check = ip_nat_cheat_check(~oldip, manip->ip,
+
+       /* this could be a inner header returned in icmp packet; in such
+          cases we cannot update the checksum field since it is outside of
+          the 8 bytes of transport layer headers we are guaranteed */
+       if(((void *)&hdr->check + sizeof(hdr->check) - (void *)iph) <= len) {
+               hdr->check = ip_nat_cheat_check(~oldip, manip->ip,
                                        ip_nat_cheat_check(*portptr ^ 0xFFFF,
                                                           manip->u.tcp.port,
                                                           hdr->check));
+       }
+
        *portptr = manip->u.tcp.port;
 }
 
index 66f968decf2087a5e790b12f9a884aa674d27f7f..97fb6c8ca97bf391bfcbb4ca92dadcc0523e74b0 100644 (file)
@@ -5,7 +5,7 @@
  *
  *             Implementation of the Transmission Control Protocol(TCP).
  *
- * Version:    $Id: tcp_minisocks.c,v 1.9 2001/03/06 22:42:56 davem Exp $
+ * Version:    $Id: tcp_minisocks.c,v 1.11 2001/08/03 14:27:25 davem Exp $
  *
  * Authors:    Ross Biro, <bir7@leland.Stanford.Edu>
  *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -371,7 +371,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
                tw->family      = sk->family;
                tw->reuse       = sk->reuse;
                tw->rcv_wscale  = tp->rcv_wscale;
-               atomic_set(&tw->refcnt, 0);
+               atomic_set(&tw->refcnt, 1);
 
                tw->hashent     = sk->hashent;
                tw->rcv_nxt     = tp->rcv_nxt;
@@ -407,6 +407,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
                }
 
                tcp_tw_schedule(tw, timeo);
+               tcp_tw_put(tw);
        } else {
                /* Sorry, if we're out of memory, just CLOSE this
                 * socket up.  We've got bigger problems than
index a12aa25158c28cea8e6dfe19c9b1635b63700e3c..482b025d1fb03adfa87049678a64409f3365c93d 100644 (file)
@@ -6,7 +6,7 @@
  *     Pedro Roque             <roque@di.fc.ul.pt>     
  *     Alexey Kuznetsov        <kuznet@ms2.inr.ac.ru>
  *
- *     $Id: addrconf.c,v 1.66 2001/06/11 00:39:29 davem Exp $
+ *     $Id: addrconf.c,v 1.67 2001/08/03 09:32:17 davem Exp $
  *
  *     This program is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU General Public License
@@ -45,6 +45,7 @@
 #include <linux/sysctl.h>
 #endif
 #include <linux/delay.h>
+#include <linux/notifier.h>
 
 #include <linux/proc_fs.h>
 #include <net/sock.h>
@@ -99,6 +100,8 @@ static void addrconf_dad_completed(struct inet6_ifaddr *ifp);
 static void addrconf_rs_timer(unsigned long data);
 static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa);
 
+static struct notifier_block *inet6addr_chain;
+
 struct ipv6_devconf ipv6_devconf =
 {
        0,                              /* forwarding           */
@@ -392,6 +395,8 @@ ipv6_add_addr(struct inet6_dev *idev, struct in6_addr *addr, int pfxlen,
        write_unlock_bh(&idev->lock);
        read_unlock(&addrconf_lock);
 
+       notifier_call_chain(&inet6addr_chain,NETDEV_UP,ifa);
+
        return ifa;
 }
 
@@ -433,6 +438,7 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp)
 
        ipv6_ifa_notify(RTM_DELADDR, ifp);
 
+       notifier_call_chain(&inet6addr_chain,NETDEV_DOWN,ifp);
 
        addrconf_del_timer(ifp);
 
@@ -1959,6 +1965,20 @@ static void addrconf_sysctl_unregister(struct ipv6_devconf *p)
 
 #endif
 
+/*
+ *      Device notifier
+ */
+
+int register_inet6addr_notifier(struct notifier_block *nb)
+{
+        return notifier_chain_register(&inet6addr_chain, nb);
+}
+
+int unregister_inet6addr_notifier(struct notifier_block *nb)
+{
+        return notifier_chain_unregister(&inet6addr_chain,nb);
+}
+
 /*
  *     Init / cleanup code
  */
index 8ca6b2eed0099c555d49d3bebd77c55cfedb124b..d7fb6ce804da14d3378f91a1d7321de4991c52a0 100644 (file)
@@ -9,7 +9,7 @@
 
 O_TARGET := netfilter.o
 
-export-objs :=
+export-objs := ip6_tables.o
 
 # Link order matters here.
 obj-$(CONFIG_IP6_NF_IPTABLES) += ip6_tables.o
index 0c55a5d171daf70bf72729a9f338aeb006f53c8f..20a668c43339509aa55d2828498ee92eb5ad4204 100644 (file)
@@ -1791,5 +1791,13 @@ static void __exit fini(void)
 #endif
 }
 
+EXPORT_SYMBOL(ip6t_register_table);
+EXPORT_SYMBOL(ip6t_unregister_table);
+EXPORT_SYMBOL(ip6t_do_table);
+EXPORT_SYMBOL(ip6t_register_match);
+EXPORT_SYMBOL(ip6t_unregister_match);
+EXPORT_SYMBOL(ip6t_register_target);
+EXPORT_SYMBOL(ip6t_unregister_target);
+
 module_init(init);
 module_exit(fini);
index 0c32350b2aac76571f9782dfe1f2e3aebf742685..62aa7bd536d5ba2b014b8e0832b8a19e0aff4c29 100644 (file)
@@ -61,6 +61,7 @@ extern struct net_proto_family inet_family_ops;
 #include <net/ipv6.h>
 #include <net/ndisc.h>
 #include <net/transp_v6.h>
+#include <net/addrconf.h>
 
 extern int sysctl_local_port_range[2];
 extern int tcp_port_rover;
@@ -280,6 +281,9 @@ EXPORT_SYMBOL(dlci_ioctl_hook);
 #ifdef CONFIG_IPV6
 EXPORT_SYMBOL(ipv6_addr_type);
 EXPORT_SYMBOL(icmpv6_send);
+EXPORT_SYMBOL(ndisc_mc_map);
+EXPORT_SYMBOL(register_inet6addr_notifier);
+EXPORT_SYMBOL(unregister_inet6addr_notifier);
 #endif
 #if defined (CONFIG_IPV6_MODULE) || defined (CONFIG_KHTTPD) || defined (CONFIG_KHTTPD_MODULE)
 /* inet functions common to v4 and v6 */
index 3249ac79828b4671fb23a7d6ddb8d5ee97d2ad18..f1136f94b5d684cb7093e9c7d0367ddcc57d9033 100644 (file)
@@ -5,7 +5,7 @@
  *
  *             PACKET - implements raw packet sockets.
  *
- * Version:    $Id: af_packet.c,v 1.55 2001/06/28 01:34:29 davem Exp $
+ * Version:    $Id: af_packet.c,v 1.56 2001/08/06 13:21:16 davem Exp $
  *
  * Authors:    Ross Biro, <bir7@leland.Stanford.Edu>
  *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -1488,14 +1488,15 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
                                return br_ioctl_hook(arg);
 #endif
 #endif                         
+                       return -ENOPKG;
 
                case SIOCGIFDIVERT:
                case SIOCSIFDIVERT:
 #ifdef CONFIG_NET_DIVERT
-                       return(divert_ioctl(cmd, (struct divert_cf *) arg));
-#endif /* CONFIG_NET_DIVERT */
-
+                       return divert_ioctl(cmd, (struct divert_cf *) arg);
+#else
                        return -ENOPKG;
+#endif /* CONFIG_NET_DIVERT */
                        
 #ifdef CONFIG_INET
                case SIOCADDRT:
index 3d90c2538c847738564bc78d7c9a884c21c8b990..60cdf0ea6999273145c1f5e312da9d6f1953db62 100644 (file)
@@ -316,13 +316,14 @@ static int route4_delete(struct tcf_proto *tp, unsigned long arg)
 {
        struct route4_head *head = (struct route4_head*)tp->root;
        struct route4_filter **fp, *f = (struct route4_filter*)arg;
-       unsigned h = f->handle;
+       unsigned h = 0;
        struct route4_bucket *b;
        int i;
 
        if (!head || !f)
                return -EINVAL;
 
+       h = f->handle;
        b = f->bkt;
 
        for (fp = &b->ht[from_hash(h>>16)]; *fp; fp = &(*fp)->next) {
index 43ed8e26b18cc8c3a959ced9c1abd3d141768623..413cf129d4be695f8b95185939699d7341fa3612 100644 (file)
@@ -162,7 +162,7 @@ check_terminal:
                if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT)))
                        goto next_ht;
 
-               if (n->sel.flags&(TC_U32_EAT|TC_U32_VAROFFSET)) {
+               if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) {
                        off2 = n->sel.off + 3;
                        if (n->sel.flags&TC_U32_VAROFFSET)
                                off2 += ntohs(n->sel.offmask & *(u16*)(ptr+n->sel.offoff)) >>n->sel.offshift;
index 13617a60d264be9fa93468a60d83da9bc81cf882..0ece0280713e38e718cabd47a792e255116fbd01 100644 (file)
@@ -1245,8 +1245,10 @@ static int cbq_drop(struct Qdisc* sch)
 
                cl = cl_head;
                do {
-                       if (cl->q->ops->drop && cl->q->ops->drop(cl->q))
+                       if (cl->q->ops->drop && cl->q->ops->drop(cl->q)) {
+                               sch->q.qlen--;
                                return 1;
+                       }
                } while ((cl = cl->next_alive) != cl_head);
        }
        return 0;