## Automatically generated incremental diff
## From:   linux-2.2.21-rc3
## To:     linux-2.2.21-rc4
## Robot:  $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $

diff -urN linux-2.2.21-rc3/Makefile linux-2.2.21-rc4/Makefile
--- linux-2.2.21-rc3/Makefile	Wed May 15 13:34:05 2002
+++ linux-2.2.21-rc4/Makefile	Wed May 15 13:34:06 2002
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 2
 SUBLEVEL = 21
-EXTRAVERSION = rc3
+EXTRAVERSION = rc4
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
 
diff -urN linux-2.2.21-rc3/drivers/net/sis900.c linux-2.2.21-rc4/drivers/net/sis900.c
--- linux-2.2.21-rc3/drivers/net/sis900.c	Wed May 15 13:34:05 2002
+++ linux-2.2.21-rc4/drivers/net/sis900.c	Wed May 15 13:34:06 2002
@@ -1,6 +1,6 @@
 /* sis900.c: A SiS 900/7016 PCI Fast Ethernet driver for Linux.
    Copyright 1999 Silicon Integrated System Corporation 
-   Revision:	1.06.10 Feb 28 2002
+   Revision:	1.06.11 Apr. 30 2002
 
    Modified from the driver which is originally written by Donald Becker.
    
@@ -18,8 +18,9 @@
    preliminary Rev. 1.0 Jan. 18, 1998
    http://www.sis.com.tw/support/databook.htm
 
-   Rev 1.06.10 Feb. 28 2002 Allan Jacobsen (aj@2m.dk) Made RTL8201 PHY work on ECS K7S5A
-   Rev 1.06.09 Sep. 28 2001 Hui-Fen Hsu (hfhsu@sis.com.tw) update for 630ET & workaround for ICS1893 PHY
+   Rev 1.06.11 Apr. 25 2002 Mufasa Yang (mufasa@sis.com.tw) added SiS962 support
+   Rev 1.06.10 Dec. 18 2001 Hui-Fen Hsu workaround for EDB & RTL8201 PHY
+   Rev 1.06.09 Sep. 28 2001 Hui-Fen Hsu update for 630ET & workaround for ICS1893 PHY
    Rev 1.06.08 Mar.  2 2001 Hui-Fen Hsu (hfhsu@sis.com.tw) some bug fix & 635M/B support
    Rev 1.06.07 Jan.  8 2001 Lei-Chun Chang added RTL8201 PHY support
    Rev 1.06.06 Sep.  6 2000 Lei-Chun Chang added ICS1893 PHY support
@@ -56,7 +57,7 @@
 #include "sis900.h"
 
 static const char *version =
-"sis900.c: v1.06.10  02/28/2002\n";
+"sis900.c: v1.06.11  4/30/2002\n";
 
 static int max_interrupt_work = 20;
 static int multicast_filter_limit = 128;
@@ -102,7 +103,7 @@
 	{ "AMD 79C901 HomePNA PHY",		0x0000, 0x6B90, HOME},
 	{ "ICS LAN PHY",			0x0015, 0xF440, LAN },
 	{ "NS  83851 PHY",			0x2000, 0x5C20, MIX },
-	{ "Realtek RTL8201 PHY",		0x0000, 0x8200, LAN },
+        { "Realtek RTL8201 PHY",		0x0000, 0x8200, LAN },
 	{0,},
 };
 
@@ -305,6 +306,43 @@
 	return 1;
 }
 
+
+/**
+ *	sis962_get_mac_addr: - Get MAC address for SiS962 model
+ *	@pci_dev: the sis900 pci device
+ *	@net_dev: the net device to get address for 
+ *
+ *	SiS962 model, use EEPROM to store MAC address. And EEPROM is shared by
+ *	LAN and 1394. When access EEPROM, send EEREQ signal to hardware first 
+ *	and wait for EEGNT. If EEGNT is ON, EEPROM is permitted to be access 
+ *	by LAN, otherwise is not. After MAC address is read from EEPROM, send
+ *	EEDONE signal to refuse EEPROM access by LAN. 
+ *	MAC address is read into @net_dev->dev_addr.
+ */
+
+static int sis962_get_mac_addr(struct pci_dev * pci_dev, struct device *net_dev)
+{
+
+	long ioaddr = net_dev->base_addr;
+	long ee_addr = ioaddr + mear;
+	u32 waittime = 0;
+	int ret = 0;
+	
+	outl(EEREQ, ee_addr);
+	while(waittime < 2000) {
+		if(inl(ee_addr) & EEGNT) {
+			ret = sis900_get_mac_addr(pci_dev, net_dev);
+			outl(EEDONE, ee_addr);
+			return(ret);
+		} else {
+			udelay(1);	
+			waittime ++;
+		}
+	}
+	outl(EEDONE, ee_addr);
+	return 0;
+}
+
 static struct device * sis900_mac_probe (struct mac_chip_info * mac, struct pci_dev * pci_dev,
 					 struct device * net_dev)
 {
@@ -341,6 +379,8 @@
 		ret = sis630e_get_mac_addr(pci_dev, net_dev);
 	else if ((revision > 0x81) && (revision <= 0x90))
 		ret = sis635_get_mac_addr(pci_dev, net_dev);
+	else if (revision == SIS962_900_REV)
+		ret = sis962_get_mac_addr(pci_dev, net_dev);
 	else
 		ret = sis900_get_mac_addr(pci_dev, net_dev);
 
@@ -740,6 +780,9 @@
 	net_dev->interrupt = 0;
 	net_dev->start = 1;
 
+	/* Workaround for EDB */
+	sis900_set_mode(ioaddr, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED);
+
 	/* Enable all known interrupts by setting the interrupt mask. */
 	outl((RxSOVR|RxORN|RxERR|RxOK|TxURN|TxERR|TxIDLE), ioaddr + imr);
 	outl(RxENA | inl(ioaddr + cr), ioaddr + cr);
@@ -1107,17 +1150,16 @@
 	autorec = mdio_read(net_dev, phy_addr, MII_ANLPAR);
 	status = autoadv & autorec;
 
+	*speed = HW_SPEED_10_MBPS;
+	*duplex = FDX_CAPABLE_HALF_SELECTED;
+
 	if (status & (MII_NWAY_TX | MII_NWAY_TX_FDX))
 		*speed = HW_SPEED_100_MBPS;
-	else
-		*speed = HW_SPEED_10_MBPS;
 	if (status & ( MII_NWAY_TX_FDX | MII_NWAY_T_FDX))
 		*duplex = FDX_CAPABLE_FULL_SELECTED;
-	else
-		*duplex = FDX_CAPABLE_HALF_SELECTED;
 
 	sis_priv->autong_complete = 1;
-	
+
 	/* Workaround for Realtek RTL8201 PHY issue */
 	if((phy->phy_id0 == 0x0000) && ((phy->phy_id1 & 0xFFF0) == 0x8200)){
 		if(mdio_read(net_dev, phy_addr, MII_CONTROL) & MII_CNTL_FDX)
@@ -1125,7 +1167,7 @@
 		if(mdio_read(net_dev, phy_addr, 0x0019) & 0x01)
 			*speed = HW_SPEED_100_MBPS;
 	}
-
+			
 	printk(KERN_INFO "%s: Media Link On %s %s-duplex \n",
 	       net_dev->name,
 	       *speed == HW_SPEED_100_MBPS ?
@@ -1562,7 +1604,7 @@
 	}
 
 	/* leave 8 or 7 most siginifant bits */
-	if((revision == SIS635A_900_REV) || (revision == SIS900B_900_REV))
+	if((revision >= SIS635A_900_REV) || (revision == SIS900B_900_REV))
 		return ((int)(crc >> 24));
 	else
 		return ((int)(crc >> 25));
@@ -1579,7 +1621,7 @@
 
 	/* 635 Hash Table entires = 256(2^16) */
 	pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision);
-	if((revision == SIS635A_900_REV) || (revision == SIS900B_900_REV))
+	if((revision >= SIS635A_900_REV) || (revision == SIS900B_900_REV))
 		table_entries = 16;
 	else
 		table_entries = 8;
@@ -1651,7 +1693,7 @@
 	}
 
 	pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision);
-	if( (revision == SIS635A_900_REV) || (revision == SIS900B_900_REV) )
+	if( (revision >= SIS635A_900_REV) || (revision == SIS900B_900_REV) )
 		outl(PESEL | RND_CNT, ioaddr + cfg);
 	else
 		outl(PESEL, ioaddr + cfg);
diff -urN linux-2.2.21-rc3/drivers/net/sis900.h linux-2.2.21-rc4/drivers/net/sis900.h
--- linux-2.2.21-rc3/drivers/net/sis900.h	Fri Nov  2 08:39:07 2001
+++ linux-2.2.21-rc4/drivers/net/sis900.h	Wed May 15 13:34:06 2002
@@ -132,6 +132,11 @@
 	EEaddrMask = 0x013F, EEcmdShift = 16
 };
 
+/* For SiS962, request the eeprom software access */
+enum sis962_eeprom_command {
+	EEREQ = 0x00000400, EEDONE = 0x00000200, EEGNT = 0x00000100
+};
+
 /* Manamgement Data I/O (mdio) frame */
 #define MIIread         0x6000
 #define MIIwrite        0x5002
@@ -237,7 +242,7 @@
 	SIS630A_900_REV = 0x80, 	SIS630E_900_REV = 0x81,
 	SIS630S_900_REV = 0x82,		SIS630EA1_900_REV = 0x83,
 	SIS630ET_900_REV = 0x84,        SIS635A_900_REV = 0x90,
-	SIS900B_900_REV = 0x03
+	SIS962_900_REV = 0X91,		SIS900B_900_REV = 0x03
 };
 
 enum sis630_revision_id {
diff -urN linux-2.2.21-rc3/drivers/scsi/sg.c linux-2.2.21-rc4/drivers/scsi/sg.c
--- linux-2.2.21-rc3/drivers/scsi/sg.c	Fri Nov  2 08:39:08 2001
+++ linux-2.2.21-rc4/drivers/scsi/sg.c	Wed May 15 13:34:06 2002
@@ -16,8 +16,8 @@
  *
  *  Borrows code from st driver. Thanks to Alessandro Rubini's "dd" book.
  */
- static char * sg_version_str = "Version: 2.1.40 (20010620)";
- static int sg_version_num = 20140; /* 2 digits for each component */
+ static char * sg_version_str = "Version: 2.1.41 (20020409)";
+ static int sg_version_num = 20141; /* 2 digits for each component */
 /*
  *  D. P. Gilbert (dgilbert@interlog.com, dougg@triode.net.au), notes:
  *      - scsi logging is available via SCSI_LOG_TIMEOUT macros. First
@@ -1644,10 +1644,14 @@
         return resp;
     if (SG_HEAP_KMAL == mem_src) {
         resp = kmalloc(rqSz, page_mask);
-        if (resp && retSzp) *retSzp = rqSz;
+	if (resp) {
+	    if (! capable(CAP_SYS_ADMIN))
+	    	memset(resp, 0, rqSz);
+	    if (retSzp) *retSzp = rqSz;
 #ifdef SG_DEBUG
-        if (resp) ++sg_num_kmal;
+	    ++sg_num_kmal;
 #endif
+	}
         return resp;
     }
     if (SG_HEAP_POOL == mem_src) {
@@ -1664,6 +1668,8 @@
                 (scsi_dma_free_sectors > (SG_LOW_POOL_THRESHHOLD + num_sect))) {
                 resp = scsi_malloc(rqSz);
                 if (resp) {
+		    if (! capable(CAP_SYS_ADMIN))
+			memset(resp, 0, rqSz);
                     if (retSzp) *retSzp = rqSz;
                     sg_pool_secs_avail -= num_sect;
 #ifdef SG_DEBUG
@@ -1692,10 +1698,14 @@
             resp = (char *)__get_free_pages(page_mask, order); /* try half */
             resSz = a_size;
         }
-        if (retSzp) *retSzp = resSz;
+	if (resp) {
+	    if (! capable(CAP_SYS_ADMIN))
+		memset(resp, 0, resSz);
+	    if (retSzp) *retSzp = resSz;
 #ifdef SG_DEBUG
-        if (resp) ++sg_num_page;
+	    ++sg_num_page;
 #endif
+	}
     }
     else
         printk("sg_low_malloc: bad mem_src=%d, rqSz=%df\n", mem_src, rqSz);
diff -urN linux-2.2.21-rc3/include/linux/kd.h linux-2.2.21-rc4/include/linux/kd.h
--- linux-2.2.21-rc3/include/linux/kd.h	Sun Mar 25 08:31:03 2001
+++ linux-2.2.21-rc4/include/linux/kd.h	Wed May 15 13:34:06 2002
@@ -26,8 +26,8 @@
 #define KDGETLED	0x4B31	/* return current led state */
 #define KDSETLED	0x4B32	/* set led state [lights, not flags] */
 #define 	LED_SCR		0x01	/* scroll lock led */
-#define 	LED_CAP		0x04	/* caps lock led */
 #define 	LED_NUM		0x02	/* num lock led */
+#define 	LED_CAP		0x04	/* caps lock led */
 
 #define KDGKBTYPE	0x4B33	/* get keyboard type */
 #define 	KB_84		0x01
@@ -89,10 +89,10 @@
 #define KDSKBMETA	0x4B63	/* sets meta key handling mode */
 
 #define		K_SCROLLLOCK	0x01
-#define		K_CAPSLOCK	0x02
-#define		K_NUMLOCK	0x04
+#define		K_NUMLOCK	0x02
+#define		K_CAPSLOCK	0x04
 #define	KDGKBLED	0x4B64	/* get led flags (not lights) */
-#define KDSKBLED	0x4B65	/* set led flags (not lights) */
+#define	KDSKBLED	0x4B65	/* set led flags (not lights) */
 
 struct kbentry {
 	unsigned char kb_table;
diff -urN linux-2.2.21-rc3/include/scsi/sg.h linux-2.2.21-rc4/include/scsi/sg.h
--- linux-2.2.21-rc3/include/scsi/sg.h	Fri Nov  2 08:39:16 2001
+++ linux-2.2.21-rc4/include/scsi/sg.h	Wed May 15 13:34:06 2002
@@ -11,10 +11,12 @@
 2.x extensions to driver:
 *       Copyright (C) 1998 - 2001 Douglas Gilbert
 
-    Version: 2.1.40 (20010620)
+    Version: 2.1.41 (20020409)
     This version for 2.2.x series kernels
     D. P. Gilbert (dgilbert@interlog.com, dougg@triode.net.au)
 
+    Changes since 2.1.40 (20010620)
+    	- zero buffers for non-root users
     Changes since 2.1.38 (20000626)
         - fix bug that caused long wait when large buffer requested
     Changes since 2.1.38 (20000527)
diff -urN linux-2.2.21-rc3/x1 linux-2.2.21-rc4/x1
--- linux-2.2.21-rc3/x1	Wed May 15 13:34:05 2002
+++ linux-2.2.21-rc4/x1	Wed Dec 31 16:00:00 1969
@@ -1,180 +0,0 @@
-From: Paul Mackerras <paulus@samba.org>
-Date: Tue, 19 Mar 2002 16:01:22 +1100 (EST)
-To: marcelo@conectiva.com.br, linux-kernel@vger.kernel.org
-Subject: Re: [PATCH] zlib double-free bug
-
-Someone pointed me at a previously-posted patch for the zlib
-vulnerability.  While I was looking at that patch I realized that both
-that patch and mine were buggy in different ways.  My patch was
-freeing s->sub.trees.blens after that word had been overwritten by an
-assignment to s->sub.decode.codes, whereas with the previously-posted
-patch, it is still possible to get a double-free (if inflate_codes_new
-returns NULL, it will leave s->mode == DTREE but s->sub.trees.blens
-has already been freed).
-
-Here is a new patch which should fix both those problems.
-
-Paul.
-
-diff -urN linux-2.4.19-pre3/arch/ppc/boot/lib/zlib.c pmac/arch/ppc/boot/lib/zlib.c
---- linux-2.4.19-pre3/arch/ppc/boot/lib/zlib.c	Mon Mar 18 13:34:47 2002
-+++ pmac/arch/ppc/boot/lib/zlib.c	Tue Mar 19 15:46:09 2002
-@@ -1,5 +1,5 @@
- /*
-- * BK Id: SCCS/s.zlib.c 1.10 01/11/02 10:46:07 trini
-+ * BK Id: SCCS/s.zlib.c 1.9 12/05/01 16:19:42 mporter
-  */
- /*
-  * This file is derived from various .h and .c files from the zlib-0.95
-@@ -928,7 +928,10 @@
-       {
-         r = t;
-         if (r == Z_DATA_ERROR)
-+	{
-+          ZFREE(z, s->sub.trees.blens, s->sub.trees.nblens * sizeof(uInt));
-           s->mode = BADB;
-+	}
-         LEAVE
-       }
-       s->sub.trees.index = 0;
-@@ -964,6 +967,7 @@
-           if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
-               (c == 16 && i < 1))
-           {
-+            ZFREE(z, s->sub.trees.blens, s->sub.trees.nblens * sizeof(uInt));
-             s->mode = BADB;
-             z->msg = "invalid bit length repeat";
-             r = Z_DATA_ERROR;
-@@ -991,7 +995,10 @@
-         if (t != Z_OK)
-         {
-           if (t == (uInt)Z_DATA_ERROR)
-+	  {
-+            ZFREE(z, s->sub.trees.blens, s->sub.trees.nblens * sizeof(uInt));
-             s->mode = BADB;
-+	  }
-           r = t;
-           LEAVE
-         }
-diff -urN linux-2.4.19-pre3/drivers/net/zlib.c pmac/drivers/net/zlib.c
---- linux-2.4.19-pre3/drivers/net/zlib.c	Sat Apr 28 23:02:45 2001
-+++ pmac/drivers/net/zlib.c	Tue Mar 19 15:45:40 2002
-@@ -14,7 +14,7 @@
-  */
- 
- /* 
-- *  ==FILEVERSION 971210==
-+ *  ==FILEVERSION 20020318==
-  *
-  * This marker is used by the Linux installation script to determine
-  * whether an up-to-date version of this file is already installed.
-@@ -772,7 +772,7 @@
-         windowBits = -windowBits;
-     }
-     if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
--        windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
-+        windowBits < 9 || windowBits > 15 || level < 0 || level > 9 ||
- 	strategy < 0 || strategy > Z_HUFFMAN_ONLY) {
-         return Z_STREAM_ERROR;
-     }
-@@ -3860,10 +3860,12 @@
-                              &s->sub.trees.tb, z);
-       if (t != Z_OK)
-       {
--        ZFREE(z, s->sub.trees.blens);
-         r = t;
-         if (r == Z_DATA_ERROR)
-+	{
-+	  ZFREE(z, s->sub.trees.blens);
-           s->mode = BADB;
-+	}
-         LEAVE
-       }
-       s->sub.trees.index = 0;
-@@ -3928,11 +3930,13 @@
- #endif
-         t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
-                                   s->sub.trees.blens, &bl, &bd, &tl, &td, z);
--        ZFREE(z, s->sub.trees.blens);
-         if (t != Z_OK)
-         {
-           if (t == (uInt)Z_DATA_ERROR)
-+	  {
-+	    ZFREE(z, s->sub.trees.blens);
-             s->mode = BADB;
-+	  }
-           r = t;
-           LEAVE
-         }
-@@ -3945,6 +3949,7 @@
-           r = Z_MEM_ERROR;
-           LEAVE
-         }
-+        ZFREE(z, s->sub.trees.blens);
-         s->sub.decode.codes = c;
-         s->sub.decode.tl = tl;
-         s->sub.decode.td = td;
-diff -urN linux-2.4.19-pre3/fs/jffs2/zlib.c pmac/fs/jffs2/zlib.c
---- linux-2.4.19-pre3/fs/jffs2/zlib.c	Mon Sep 24 09:31:33 2001
-+++ pmac/fs/jffs2/zlib.c	Tue Mar 19 15:46:47 2002
-@@ -14,7 +14,7 @@
-  */
- 
- /* 
-- *  ==FILEVERSION 971210==
-+ *  ==FILEVERSION 20020318==
-  *
-  * This marker is used by the Linux installation script to determine
-  * whether an up-to-date version of this file is already installed.
-@@ -772,7 +772,7 @@
-         windowBits = -windowBits;
-     }
-     if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
--        windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
-+        windowBits < 9 || windowBits > 15 || level < 0 || level > 9 ||
- 	strategy < 0 || strategy > Z_HUFFMAN_ONLY) {
-         return Z_STREAM_ERROR;
-     }
-@@ -3860,10 +3860,12 @@
-                              &s->sub.trees.tb, z);
-       if (t != Z_OK)
-       {
--        ZFREE(z, s->sub.trees.blens);
-         r = t;
-         if (r == Z_DATA_ERROR)
-+	{
-+	  ZFREE(z, s->sub.trees.blens);
-           s->mode = BADB;
-+	}
-         LEAVE
-       }
-       s->sub.trees.index = 0;
-@@ -3928,11 +3930,13 @@
- #endif
-         t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
-                                   s->sub.trees.blens, &bl, &bd, &tl, &td, z);
--        ZFREE(z, s->sub.trees.blens);
-         if (t != Z_OK)
-         {
-           if (t == (uInt)Z_DATA_ERROR)
-+	  {
-+	    ZFREE(z, s->sub.trees.blens);
-             s->mode = BADB;
-+	  }
-           r = t;
-           LEAVE
-         }
-@@ -3945,6 +3949,7 @@
-           r = Z_MEM_ERROR;
-           LEAVE
-         }
-+        ZFREE(z, s->sub.trees.blens);
-         s->sub.decode.codes = c;
-         s->sub.decode.tl = tl;
-         s->sub.decode.td = td;
--
-To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
-the body of a message to majordomo@vger.kernel.org
-More majordomo info at  http://vger.kernel.org/majordomo-info.html
-Please read the FAQ at  http://www.tux.org/lkml/
-
