]> git.neil.brown.name Git - history.git/commitdiff
Linux 2.2.19pre13 2.2.19pre13
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:23:22 +0000 (15:23 -0500)
committerAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:23:22 +0000 (15:23 -0500)
o Fix up missing bits of Soohoon Lee's exec patch (Michael Jaegerman)
| not sure where some bits of it escaped too...
o Revert serial driver locking patch (Alan Cox)
| Seems to be causing crashes
o PPC BUG(), and other compile fixes needed   (Benjamin Herrenschmidt)
o ide_pmac_init to fix IDE probe power off    (Benjamin Herrenschmidt)
o atyfb128 and serial for pmac     (Benjamin Herrenschmidt)
o Workaround early imac firmware bug     (Benjamin Herrenschmidt)
o Ensure task is running in mm faults (Roger Larsson)
| from 2.4
o Fix nfs cache bug (Neil Brown)
o Further config.in cleanups/fixing     (Andrzej Krzysztofowicz)
o Clean up tulip changes remove accidental fix (Jeff Garzik)
reversions
o Update defconfig (Jeff Garzik)
o Update usb printer driver in 2.2 to match 2.4  (Randy Dunlap)
o Fix posix compliance on sockopts

44 files changed:
CREDITS
Documentation/Configure.help
Makefile
arch/alpha/config.in
arch/alpha/kernel/process.c
arch/i386/defconfig
arch/ppc/config.in
arch/ppc/kernel/feature.c
arch/ppc/kernel/openpic.c
arch/ppc/kernel/pmac_setup.c
arch/ppc/kernel/prom.c
arch/ppc/kernel/sleep.S
arch/sparc/config.in
drivers/block/ll_rw_blk.c
drivers/char/Config.in
drivers/char/serial.c
drivers/char/tty_io.c
drivers/isdn/Config.in
drivers/net/Config.in
drivers/net/gmac.c
drivers/net/tulip.c
drivers/scsi/Config.in
drivers/usb/printer.c
drivers/video/Config.in
drivers/video/aty128fb.c
fs/nfsd/nfscache.c
include/asm-ppc/ide.h
include/asm-ppc/mman.h
include/asm-ppc/page.h
mm/memory.c
net/ax25/af_ax25.c
net/core/sock.c
net/ipv4/ip_sockglue.c
net/ipv4/ipmr.c
net/ipv4/raw.c
net/ipv4/tcp.c
net/ipv6/ipv6_sockglue.c
net/ipv6/raw.c
net/ipx/af_ipx.c
net/irda/af_irda.c
net/netrom/af_netrom.c
net/rose/af_rose.c
net/socket.c
net/x25/af_x25.c

diff --git a/CREDITS b/CREDITS
index a3f219184196b832d03e5465bd7dd5b463a6336f..6d4ec34b3e9bb7e31002bd77ba25041897db919b 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -880,13 +880,13 @@ S: Mountain View, California 94043
 S: USA
 
 N: Benjamin Herrenschmidt
-E: bh40@calva.net
+E: benh@kernel.crashing.org
 E: benh@mipsys.com
-D: PowerMac booter (BootX)
+D: PowerMac booters (BootX, yaboot)
 D: Additional PowerBook support
 D: Apple "Core99" machines support (ibook,g4,...)
-S: 22, rue des Marguettes
-S: 75012 Paris
+S: 122, blvd. Baille
+S: 13005 Marseille
 S: France
 
 N: Sebastian Hetze
index 94ed557287851f28664d5bf9b70edc256b05e1df..ba218abac6609bb7b0183c5fdc8f3e9673cbe250 100644 (file)
@@ -2237,14 +2237,6 @@ CONFIG_PARPORT
 
   If unsure, say Y.
 
-IEEE1284 transfer modes
-CONFIG_PARPORT_1284
-  If you have a printer that supports status readback or device ID, or
-  want to use a device that uses enhanced parallel port transfer modes
-  such as EPP, you can say Y here to enable advanced IEEE 1284
-  transfer modes. Also say Y if you want device ID information to
-  appear in /proc/parport/*/autoprobe*. It is safe to say N.
 PC-style hardware 
 CONFIG_PARPORT_PC
   You should say Y here if you have a PC-style parallel port. All IBM
index bb75f54df543df9ff9da670f2d61686734abfc9e..3bdb8ac3b516936e13d4d538be230ca12438ffaf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 2
 SUBLEVEL = 19
-EXTRAVERSION = pre11
+EXTRAVERSION = pre13
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
 
index 7694727f10ef9cd8bd0b407c4c3e5d4a924361f3..afa7453afe0dfe25990b7974991d97a4b2c2889a 100644 (file)
@@ -252,9 +252,11 @@ source net/ax25/Config.in
 mainmenu_option next_comment
 comment 'ISDN subsystem'
 
-tristate 'ISDN support' CONFIG_ISDN
-if [ "$CONFIG_ISDN" != "n" ]; then
-  source drivers/isdn/Config.in
+if [ "$CONFIG_NET" != "n" ]; then
+   tristate 'ISDN support' CONFIG_ISDN
+   if [ "$CONFIG_ISDN" != "n" ]; then
+      source drivers/isdn/Config.in
+   fi
 fi
 endmenu
 
index e7ff1e47d40333a4dea81628f0297e8e41449ac2..7a4e0ee2180137f604b61b14ef3e6340e77a87d8 100644 (file)
@@ -475,3 +475,29 @@ out:
        unlock_kernel();
        return error;
 }
+
+#ifdef __SMP__
+/*
+ * execve() system call for in kernel use.
+ *
+ * Two(user and kernel) execve() have quite different call path and
+ * following function puts lock_kernel() and unlock_kernel() in kernel
+ * execve().  You could put them in unistd.h but you will have to
+ * modify many files to clear compile error -
+ *
+ * soohoon.lee@api-networks.com.  */
+
+asmlinkage int ___kernel_execve(char *filename, char **argp, char **envp,
+       struct pt_regs *regs)
+{
+       int error;
+
+       lock_kernel();
+
+       error = do_execve(filename, argp, envp, regs);
+
+       unlock_kernel();
+
+       return error;
+}
+#endif /* __SMP__ */
index db49025f23bcf05d8724891128a99b36ad75e730..c13143e0c19cd3a061b41d50836ae5d39b977213 100644 (file)
@@ -21,6 +21,9 @@ CONFIG_X86_BSWAP=y
 CONFIG_X86_POPAD_OK=y
 CONFIG_X86_TSC=y
 CONFIG_X86_GOOD_APIC=y
+# CONFIG_MICROCODE is not set
+# CONFIG_X86_MSR is not set
+# CONFIG_X86_CPUID is not set
 CONFIG_1GB=y
 # CONFIG_2GB is not set
 # CONFIG_MATH_EMULATION is not set
@@ -58,6 +61,7 @@ CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=y
 # CONFIG_PARPORT is not set
 # CONFIG_APM is not set
+# CONFIG_TOSHIBA is not set
 
 #
 # Plug and Play support
@@ -100,6 +104,7 @@ CONFIG_IDEDMA_AUTO=y
 CONFIG_PARIDE_PARPORT=y
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -132,6 +137,11 @@ CONFIG_SKB_LARGE=y
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
 
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
 #
 # Telephony Support
 #
@@ -148,6 +158,7 @@ CONFIG_SCSI=y
 #
 CONFIG_BLK_DEV_SD=y
 # CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
 # CONFIG_BLK_DEV_SR is not set
 # CONFIG_CHR_DEV_SG is not set
 
@@ -166,7 +177,6 @@ CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_AHA152X is not set
 # CONFIG_SCSI_AHA1542 is not set
 # CONFIG_SCSI_AHA1740 is not set
-# CONFIG_SCSI_AACRAID is not set
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_ADVANSYS is not set
@@ -174,6 +184,7 @@ CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_AM53C974 is not set
 # CONFIG_SCSI_MEGARAID is not set
 # CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DTC3280 is not set
 # CONFIG_SCSI_EATA is not set
 # CONFIG_SCSI_EATA_DMA is not set
@@ -192,7 +203,6 @@ CONFIG_SCSI_SYM53C8XX=y
 CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=4
 CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32
 CONFIG_SCSI_NCR53C8XX_SYNC=20
-# CONFIG_SCSI_NCR53C8XX_PROFILE is not set
 # CONFIG_SCSI_NCR53C8XX_IOMAPPED is not set
 # CONFIG_SCSI_NCR53C8XX_PQS_PDS is not set
 # CONFIG_SCSI_PAS16 is not set
@@ -208,6 +218,14 @@ CONFIG_SCSI_NCR53C8XX_SYNC=20
 # CONFIG_SCSI_U14_34F is not set
 # CONFIG_SCSI_ULTRASTOR is not set
 
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_PCI is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_SCSI is not set
+
 #
 # Network device support
 #
@@ -218,6 +236,7 @@ CONFIG_NETDEVICES=y
 #
 # CONFIG_ARCNET is not set
 CONFIG_DUMMY=m
+# CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_NET_SB1000 is not set
 
@@ -233,8 +252,8 @@ CONFIG_NET_ETHERNET=y
 CONFIG_NET_EISA=y
 # CONFIG_PCNET32 is not set
 # CONFIG_APRICOT is not set
+# CONFIG_LP486E is not set
 # CONFIG_CS89x0 is not set
-# CONFIG_DM9102 is not set
 # CONFIG_DE4X5 is not set
 # CONFIG_DEC_ELCP is not set
 # CONFIG_DEC_ELCP_OLD is not set
@@ -267,9 +286,12 @@ CONFIG_EEXPRESS_PRO100=y
 # CONFIG_HOSTESS_SV11 is not set
 # CONFIG_COSA is not set
 # CONFIG_SEALEVEL_4021 is not set
+# CONFIG_SYNCLINK_SYNCPPP is not set
+# CONFIG_LANMEDIA is not set
 # CONFIG_COMX is not set
 # CONFIG_DLCI is not set
 # CONFIG_WAN_DRIVERS is not set
+# CONFIG_XPEED is not set
 # CONFIG_SBNI is not set
 
 #
@@ -323,6 +345,7 @@ CONFIG_82C710_MOUSE=y
 # CONFIG_WATCHDOG is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
+# CONFIG_INTEL_RNG is not set
 
 #
 # Video For Linux
@@ -335,6 +358,11 @@ CONFIG_82C710_MOUSE=y
 #
 # CONFIG_FTAPE is not set
 
+#
+# USB support
+#
+# CONFIG_USB is not set
+
 #
 # Filesystems
 #
@@ -363,6 +391,8 @@ CONFIG_EXT2_FS=y
 #
 # CONFIG_CODA_FS is not set
 CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+# CONFIG_NFSD is not set
 CONFIG_SUNRPC=y
 CONFIG_LOCKD=y
 # CONFIG_SMB_FS is not set
@@ -373,6 +403,7 @@ CONFIG_LOCKD=y
 #
 # CONFIG_BSD_DISKLABEL is not set
 # CONFIG_MAC_PARTITION is not set
+# CONFIG_MINIX_SUBPARTITION is not set
 # CONFIG_SMD_DISKLABEL is not set
 # CONFIG_SOLARIS_X86_PARTITION is not set
 # CONFIG_NLS is not set
index 5802f045b30a9683cbc256c7b2c67c02fad27d56..7f88609894e918511a0155bed46bfbe6a86ff51d 100644 (file)
@@ -151,9 +151,11 @@ source net/irda/Config.in
 mainmenu_option next_comment
 comment 'ISDN subsystem'
 
-tristate 'ISDN support' CONFIG_ISDN
-if [ "$CONFIG_ISDN" != "n" ]; then
-  source drivers/isdn/Config.in
+if [ "$CONFIG_NET" != "n" ]; then
+   tristate 'ISDN support' CONFIG_ISDN
+   if [ "$CONFIG_ISDN" != "n" ]; then
+      source drivers/isdn/Config.in
+   fi
 fi
 endmenu
 
@@ -177,7 +179,9 @@ source drivers/usb/Config.in
 mainmenu_option next_comment
 comment 'Mac device drivers'
 
-bool 'Use input layer for ADB keyboard and mouse' CONFIG_INPUT_ADBHID
+if [ "$CONFIG_INPUT_KEYBDEV" = "y" -o "$CONFIG_INPUT_MOUSEDEV" = "y" ]; then
+  bool 'Use input layer for ADB keyboard and mouse' CONFIG_INPUT_ADBHID
+fi
 if [ "$CONFIG_INPUT_ADBHID" = "y" ]; then
   define_bool CONFIG_INPUT_KEYBDEV $CONFIG_VT
   define_bool CONFIG_INPUT_MOUSEDEV y
index 8f2771b717254dbc28c7533567a9beaab32cda89..af535c16712eeb16f24fde8acbf940202a1ba0b5 100644 (file)
@@ -2,7 +2,7 @@
  *  arch/ppc/kernel/feature.c
  *
  *  Copyright (C) 1996 Paul Mackerras (paulus@cs.anu.edu.au)
- *                     Ben. Herrenschmidt (bh40@calva.net)
+ *                     Ben. Herrenschmidt (benh@kernel.crashing.org)
  *
  *  This program is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU General Public License
index be04097691cbca106786a0edc7a75c773c1b5485..75c2da31d7a4d1d29ea86696a7e68545085deb0a 100644 (file)
@@ -8,8 +8,7 @@
  *
  *  Added initialisation code for Apple Core99 machines, tweaked a few things
  *  to avoid bogus interrupts and to make sure the disable function exits with
- *  the interrupt actually masked.
- *    Benjamin Herrenschmidt <bh40@calva.net>
+ *  the interrupt actually masked. --BenH
  *  Todo: map interrupts to all available CPUs after the ack round
  * 
  *  This file is subject to the terms and conditions of the GNU General Public
index f85aa8d4a26d5efcc9cae3fea5ab2df743256c48..ef3810e52601ccd72c0999358ff1b757382641ee 100644 (file)
@@ -449,6 +449,16 @@ note_scsi_host(struct device_node *node, void *host))
 
 #ifdef CONFIG_BLK_DEV_IDE_PMAC
 
+void
+ide_pmac_init(void)
+{
+       if (_machine == _MACH_Pmac)
+               pmu_suspend();
+       ide_init();     
+       if (_machine == _MACH_Pmac)
+               pmu_resume();
+}
+
 extern kdev_t pmac_find_ide_boot(char *bootdevice, int n);
 
 __initfunc(kdev_t find_ide_boot(void))
index 4929adf8ce0644e42545685e4d7aca5d97939125..029af045715ab0ea4778411809d30b7f0567e383 100644 (file)
@@ -668,8 +668,8 @@ prom_init(int r3, int r4, prom_entry pp)
        }
        
 #endif 
-       /* If OpenFirmware version >= 3, then use quiesce call */
-       if (RELOC(prom_version) >= 3) {
+       /* If PowerMac, then use quiesce call */
+       if (!chrp) {
            prom_print(RELOC("Calling quiesce ...\n"));
            call_prom(RELOC("quiesce"), 0, 0);
            offset = reloc_offset();
index e356912b56d805bd37220558e6fc300824386852..349164a77bdb16ae7e3a803cc96ef0a79b7a1602 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file contains sleep low-level functions for PowerBook G3.
- *    Copyright (C) 1999 Benjamin Herrenschmidt (bh40@calva.net)
+ *    Copyright (C) 1999 Benjamin Herrenschmidt (benh@kernel.crashing.org)
  *    and Paul Mackerras (paulus@cs.anu.edu.au).
  *
  * This program is free software; you can redistribute it and/or
index 71ba40454c355e72a1f01e78709b1a240725a17d..a5a8314895c33d6c2ecaf5f6754de94b2d19f805 100644 (file)
@@ -133,9 +133,11 @@ fi
 mainmenu_option next_comment
 comment 'ISDN subsystem'
 
-tristate 'ISDN support' CONFIG_ISDN
-if [ "$CONFIG_ISDN" != "n" ]; then
-  source drivers/isdn/Config.in
+if [ "$CONFIG_NET" != "n" ]; then
+   tristate 'ISDN support' CONFIG_ISDN
+   if [ "$CONFIG_ISDN" != "n" ]; then
+      source drivers/isdn/Config.in
+   fi
 fi
 endmenu
 
index 8fd79d9a96287ec710c0df0b3ae5f69590ef3c33..b66d56ccf0676d1fe3db5604ad4f8bdceffe54e3 100644 (file)
 #include <asm/uaccess.h>
 #include <linux/blk.h>
 
+#ifdef CONFIG_POWERMAC
+#include <asm/ide.h>
+#endif
+
 #include <linux/module.h>
 
 /*
@@ -971,8 +975,12 @@ __initfunc(int blk_dev_init(void))
        isp16_init();
 #endif CONFIG_ISP16_CDI
 #ifdef CONFIG_BLK_DEV_IDE
+#ifdef CONFIG_POWERMAC
+       ide_pmac_init();
+#else
        ide_init();             /* this MUST precede hd_init */
 #endif
+#endif
 #ifdef CONFIG_BLK_DEV_HD
        hd_init();
 #endif
index 76a4ec56c0b92c97bc8e6dd6807cff5b08568b48..9a63dc3b783d90cbaf5264f88033075919a52a9d 100644 (file)
@@ -60,7 +60,7 @@ bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS
 if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then
        int 'Maximum number of Unix98 PTYs in use (0-2048)' CONFIG_UNIX98_PTY_COUNT 256
 fi
-if [ "$CONFIG_PARPORT" != "n" ]; then
+if [ "$CONFIG_PARPORT" = "y" -o "$CONFIG_PARPORT" = "m" ]; then
   dep_tristate 'Parallel printer support' CONFIG_PRINTER $CONFIG_PARPORT
   if [ "$CONFIG_PRINTER" != "n" ]; then
     bool '  Support IEEE1284 status readback' CONFIG_PRINTER_READBACK
@@ -128,7 +128,7 @@ if [ "$CONFIG_PCI" = "y" ]; then
 fi
 
 if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-   tristate '/dev/agpgart (AGP Support) (EXPERIMENTAL)' CONFIG_AGP n
+   tristate '/dev/agpgart (AGP Support) (EXPERIMENTAL)' CONFIG_AGP
    if [ "$CONFIG_AGP" != "n" ]; then
       bool '   Intel 440LX/BX/GX and I815/820 support' CONFIG_AGP_INTEL
       bool '   Intel I810/I815 (on-board video) support' CONFIG_AGP_I810
@@ -168,24 +168,22 @@ if [ "$CONFIG_VIDEO_DEV" != "n" ]; then
   if [ "$CONFIG_RADIO_TRUST" = "y" ]; then
     hex '  Trust FM Radio I/O port (0x350 or 0x358)' CONFIG_RADIO_TRUST_PORT 350
   fi
-  if [ "$CONFIG_PCI" != "n" ]; then
+  if [ "$CONFIG_PCI" = "y" ]; then
     dep_tristate 'BT848 Video For Linux' CONFIG_VIDEO_BT848 $CONFIG_VIDEO_DEV
     if [ "$CONFIG_VIDEO_BT848" != "n" ]; then
       comment '  MSP3400 sound decoder support is in the section "additional'
       comment '  low level sound drivers". You may need to enable it there.'
     fi
   fi
-  if [ "$CONFIG_PARPORT" != "n" ]; then
+  if [ "$CONFIG_PARPORT" = "y" -o "$CONFIG_PARPORT" = "m" ]; then
     dep_tristate 'Quickcam BW Video For Linux' CONFIG_VIDEO_BWQCAM $CONFIG_VIDEO_DEV $CONFIG_PARPORT
     dep_tristate 'Colour QuickCam Video For Linux (EXPERIMENTAL)' CONFIG_VIDEO_CQCAM $CONFIG_VIDEO_DEV $CONFIG_PARPORT
   fi
   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
     dep_tristate 'CPiA Video For Linux' CONFIG_VIDEO_CPIA $CONFIG_VIDEO_DEV
     if [ "$CONFIG_VIDEO_CPIA" != "n" ]; then
-      if [ "CONFIG_PARPORT_1284" != "n" ]; then
-        dep_tristate '  CPiA Parallel Port Lowlevel Support' CONFIG_VIDEO_CPIA_PP $CONFIG_VIDEO_CPIA $CONFIG_PARPORT
-      fi
-      if [ "$CONFIG_USB" != "n" ]; then
+      dep_tristate '  CPiA Parallel Port Lowlevel Support' CONFIG_VIDEO_CPIA_PP $CONFIG_VIDEO_CPIA $CONFIG_PARPORT
+      if [ "$CONFIG_USB" = "y" -o "$CONFIG_USB" = "m" ]; then
         dep_tristate '  CPiA USB Lowlevel Support' CONFIG_VIDEO_CPIA_USB $CONFIG_VIDEO_CPIA $CONFIG_USB
       fi
     fi
index 887fb6d13b376cff6e2825ef2873f485dd8596a2..dfbed89fd4516e43d49d1cc47af4af05b67bc120 100644 (file)
 #include <asm/bitops.h>
 #include <asm/serial.h>
 
+#ifdef CONFIG_MAC_SERIAL
+#define SERIAL_DEV_OFFSET      4
+#else
+#define SERIAL_DEV_OFFSET      0
+#endif
+
 #ifdef SERIAL_INLINE
 #define _INLINE_ inline
 #endif
@@ -2622,7 +2628,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
        tty->driver_data = info;
        info->tty = tty;
        if (serial_paranoia_check(info, tty->device, "rs_open")) {
-               MOD_DEC_USE_COUNT;
+               /* MOD_DEC_USE_COUNT; "info->tty" will cause this */
                return -ENODEV;
        }
 
@@ -2635,7 +2641,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
        if (!tmp_buf) {
                page = get_free_page(GFP_KERNEL);
                if (!page) {
-                       MOD_DEC_USE_COUNT;
+                       /* MOD_DEC_USE_COUNT; "info->tty" will cause this? */
                        return -ENOMEM;
                }
                if (tmp_buf)
@@ -2651,7 +2657,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
            (info->flags & ASYNC_CLOSING)) {
                if (info->flags & ASYNC_CLOSING)
                        interruptible_sleep_on(&info->close_wait);
-               MOD_DEC_USE_COUNT;
+               /* MOD_DEC_USE_COUNT; "info->tty" will cause this? */
 #ifdef SERIAL_DO_RESTART
                return ((info->flags & ASYNC_HUP_NOTIFY) ?
                        -EAGAIN : -ERESTARTSYS);
@@ -2665,13 +2671,13 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
         */
        retval = startup(info);
        if (retval) {
-               MOD_DEC_USE_COUNT;
+               /* MOD_DEC_USE_COUNT; "info->tty" will cause this? */
                return retval;
        }
 
        retval = block_til_ready(tty, filp, info);
        if (retval) {
-               MOD_DEC_USE_COUNT;
+               /* MOD_DEC_USE_COUNT; "info->tty" will cause this? */
 #ifdef SERIAL_DEBUG_OPEN
                printk("rs_open returning after block_til_ready with %d\n",
                       retval);
@@ -3130,7 +3136,7 @@ __initfunc(int rs_init(void))
        serial_driver.driver_name = "serial";
        serial_driver.name = "ttyS";
        serial_driver.major = TTY_MAJOR;
-       serial_driver.minor_start = 64;
+       serial_driver.minor_start = 64 + SERIAL_DEV_OFFSET;
        serial_driver.num = NR_PORTS;
        serial_driver.type = TTY_DRIVER_TYPE_SERIAL;
        serial_driver.subtype = SERIAL_TYPE_NORMAL;
@@ -3194,11 +3200,22 @@ __initfunc(int rs_init(void))
                state->icount.frame = state->icount.parity = 0;
                state->icount.overrun = state->icount.brk = 0;
                state->irq = irq_cannonicalize(state->irq);
-               if (check_region(state->port,8))
-                       continue;
-               if (state->flags & ASYNC_BOOT_AUTOCONF)
-                       autoconfig(state);
+#ifdef CONFIG_PPC
+               /* PowerMacs don't have legacy serial ports on IOs and would machine check */
+               if (_machine != _MACH_Pmac) {
+#endif         
+                       if (check_region(state->port,8))
+                               continue;
+                       if (state->flags & ASYNC_BOOT_AUTOCONF)
+                               autoconfig(state);
+#ifdef CONFIG_PPC
+               }
+#endif         
        }
+#ifdef CONFIG_PPC
+       if (_machine == _MACH_Pmac)
+               return 0;
+#endif
        /*
         * Detect the IRQ only once every port is initialised,
         * because some 16450 do not reset to 0 the MCR register.
@@ -3268,22 +3285,22 @@ int register_serial(struct serial_struct *req)
                state->irq = detect_uart_irq(state);
 
        printk(KERN_INFO "tty%02d at 0x%04x (irq = %d) is a %s\n",
-              state->line, state->port, state->irq,
+              state->line + SERIAL_DEV_OFFSET, state->port, state->irq,
               uart_config[state->type].name);
-       return state->line;
+       return state->line + SERIAL_DEV_OFFSET;
 }
 
 void unregister_serial(int line)
 {
        unsigned long flags;
-       struct serial_state *state = &rs_table[line];
+       struct serial_state *state = &rs_table[line + SERIAL_DEV_OFFSET];
 
        save_flags(flags);
        cli();
        if (state->info && state->info->tty)
                tty_hangup(state->info->tty);
        state->type = PORT_UNKNOWN;
-       printk(KERN_INFO "tty%02d unloaded\n", state->line);
+       printk(KERN_INFO "tty%02d unloaded\n", state->line + SERIAL_DEV_OFFSET);
        restore_flags(flags);
 }
 
index 8d29c6f5c1608060224b0375a6110effcd2a1905..fe4a15be0c76d2f6409cb5b8d1f0138d9e7d5cbc 100644 (file)
@@ -54,9 +54,6 @@
  *
  * Added support for a Unix98-style ptmx device.
  *      -- C. Scott Ananian <cananian@alumni.princeton.edu>, 14-Jan-1998
- *
- * Don't call close after a failed open.
- *     -- Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 21-Jan-2001
  */
 
 #include <linux/config.h>
@@ -1012,7 +1009,7 @@ static void release_mem(struct tty_struct *tty, int idx)
  * WSH 09/09/97: rewritten to avoid some nasty race conditions that could
  * lead to double frees or releasing memory still in use.
  */
-static void release_dev(struct file * filp, int do_close)
+static void release_dev(struct file * filp)
 {
        struct tty_struct *tty, *o_tty;
        int     pty_master, tty_closing, o_tty_closing, do_sleep;
@@ -1090,7 +1087,7 @@ static void release_dev(struct file * filp, int do_close)
        }
 #endif
 
-       if (do_close && tty->driver.close)
+       if (tty->driver.close)
                tty->driver.close(tty, filp);
 
        /*
@@ -1261,7 +1258,7 @@ static void release_dev(struct file * filp, int do_close)
 static int tty_open(struct inode * inode, struct file * filp)
 {
        struct tty_struct *tty;
-       int noctty, retval, open_ok;
+       int noctty, retval;
        kdev_t device;
        unsigned short saved_flags;
        char    buf[64];
@@ -1343,12 +1340,9 @@ init_dev_done:
 #ifdef TTY_DEBUG_HANGUP
        printk("opening %s...", tty_name(tty, buf));
 #endif
-       open_ok = 0;
-       if (tty->driver.open) {
+       if (tty->driver.open)
                retval = tty->driver.open(tty, filp);
-               if (!retval)
-                       open_ok = 1;
-       } else
+       else
                retval = -ENODEV;
        filp->f_flags = saved_flags;
 
@@ -1361,7 +1355,7 @@ init_dev_done:
                       tty_name(tty, buf));
 #endif
 
-               release_dev(filp, open_ok);
+               release_dev(filp);
                if (retval != -ERESTARTSYS)
                        return retval;
                if (signal_pending(current))
@@ -1400,7 +1394,7 @@ init_dev_done:
 
 static int tty_release(struct inode * inode, struct file * filp)
 {
-       release_dev(filp, 1);
+       release_dev(filp);
        return 0;
 }
 
index b97184a7b5fd2a6bed0d0c23359cd26e0a205571..71e3a3f527e12f0c3b4d5f3f5d84c2966740a0b7 100644 (file)
@@ -16,7 +16,9 @@ bool '  Support audio via ISDN' CONFIG_ISDN_AUDIO
 if [ "$CONFIG_ISDN_AUDIO" != "n" ]; then
    bool '    Support AT-Fax Class 1 and 2 commands' CONFIG_ISDN_TTY_FAX
 fi
-if [ "$CONFIG_X25" != "n" ]; then
+
+#  CONFIG_X25 is defined only when CONFIG_EXPERIMENTAL=y
+if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_X25" != "n" ]; then
    bool '  X.25 PLP on top of ISDN' CONFIG_ISDN_X25
 fi
 
index e1a0d9aaa32f266e367c80254f7f9276d69457cd..96b8ca1bf215893247176a1e3b5c2f0e8a8fdfdf 100644 (file)
@@ -188,7 +188,9 @@ comment 'Ethernet (1000 Mbit)'
       tristate 'Packet Engines GNIC-II (Hamachi) support' CONFIG_HAMACHI
       tristate 'Packet Engines Yellowfin Gigabit-NIC support' CONFIG_YELLOWFIN
     fi
-    dep_tristate 'SysKonnect SK-98xx support' CONFIG_SK98LIN $CONFIG_PCI
+    if [ "$CONFIG_PCI" = "y" ]; then
+      tristate 'SysKonnect SK-98xx support' CONFIG_SK98LIN
+    fi
 endmenu
 
 bool 'FDDI driver support' CONFIG_FDDI
@@ -311,7 +313,7 @@ tristate 'LanMedia Corp. SSI/V.35, T1/E1, HSSI, T3 boards' CONFIG_LANMEDIA
 #
 
 tristate 'MultiGate (COMX) synchronous serial boards support' CONFIG_COMX
-   if [ "$CONFIG_COMX" != "n" ]; then
+if [ "$CONFIG_COMX" != "n" ]; then
    dep_tristate '  Support for COMX/CMX/HiCOMX boards' CONFIG_COMX_HW_COMX $CONFIG_COMX
    dep_tristate '  Support for LoCOMX board' CONFIG_COMX_HW_LOCOMX $CONFIG_COMX
    dep_tristate '  Support for MixCOM board' CONFIG_COMX_HW_MIXCOM $CONFIG_COMX
@@ -332,7 +334,7 @@ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
     dep_tristate '  SDL RISCom/N2 support' CONFIG_N2 $CONFIG_HDLC
     dep_tristate '  Moxa C101 support' CONFIG_C101 $CONFIG_HDLC
 
-    if [ "$CONFIG_PCI" != "n" ]; then
+    if [ "$CONFIG_PCI" = "y" ]; then
       dep_tristate '  SBE wanXL support' CONFIG_WANXL $CONFIG_HDLC
       dep_tristate '  Cyclades-PC300 support' CONFIG_PC300 $CONFIG_HDLC
       if [ "$CONFIG_PC300" != "n" ]; then
@@ -353,12 +355,13 @@ fi
 #      Wan router core.
 #
 
-if [ "$CONFIG_WAN_ROUTER" != "n" ]; then
+#  CONFIG_WAN_ROUTER is defined only when CONFIG_EXPERIMENTAL=y
+if [ "$CONFIG_EXPERIMENTAL" = y -a "$CONFIG_WAN_ROUTER" != "n" ]; then
   bool 'WAN drivers' CONFIG_WAN_DRIVERS 
   if [ "$CONFIG_WAN_DRIVERS" = "y" ]; then
     dep_tristate 'Sangoma WANPIPE(tm) multi-port cards: (select M not Y !)' CONFIG_VENDOR_SANGOMA $CONFIG_WAN_DRIVERS 
     if [ "$CONFIG_INET" != "n" ]; then
-    if [ "$CONFIG_VENDOR_SANGOMA" != "n" ]; then
+      if [ "$CONFIG_VENDOR_SANGOMA" != "n" ]; then
         int  '  Maximum number of cards' CONFIG_WANPIPE_CARDS 1
         #bool '  WANPIPE X.25 support' CONFIG_WANPIPE_X25
         bool '  WANPIPE Frame Relay support' CONFIG_WANPIPE_FR
@@ -372,17 +375,21 @@ fi
 #
 # Xpeed drivers
 #
-dep_tristate 'Xpeed X200/X300 DSL NIC support' CONFIG_XPEED $CONFIG_PCI
+if [ "$CONFIG_PCI" = "y" ]; then
+   tristate 'Xpeed X200/X300 DSL NIC support' CONFIG_XPEED
+fi
 
 endmenu
 
 #
 # X.25 network drivers
 #
-if [ "$CONFIG_X25" != "n" ]; then
-if [ "$CONFIG_LAPB" = "y" -o "$CONFIG_LAPB" = "m" ]; then
+
+#  CONFIG_X25 is defined only when CONFIG_EXPERIMENTAL=y
+if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_X25" != "n" ]; then
+  if [ "$CONFIG_LAPB" = "y" -o "$CONFIG_LAPB" = "m" ]; then
     dep_tristate 'LAPB over Ethernet driver' CONFIG_LAPBETHER $CONFIG_LAPB
     dep_tristate 'X.25 async driver' CONFIG_X25_ASY $CONFIG_LAPB
-fi
+  fi
 fi
 tristate 'SBNI12-xx support' CONFIG_SBNI
index 3e625911a4da6c6c9c62ec7da07c8e084ebf7789..b14260c6987591f453242b60201240874101a79e 100644 (file)
@@ -9,7 +9,7 @@
  * Changes:
  * Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 08/06/2000
  * - check init_etherdev return in gmac_probe1
- * BenH <bh40@calva.net> - 03/09/2000
+ * BenH <benh@kernel.crashing.org> - 03/09/2000
  * - Add support for new PHYs
  * - Add some PowerBook sleep code
  * 
index 79baa359b4ea0556c5fc23b74951ea7aed9ff715..9e9b1a0c637e1a56cdcffbc72c9cdee55d38c829 100644 (file)
@@ -30,9 +30,6 @@ static const char version[] = "tulip.c:v0.91g-ppc 7/16/99 becker@cesdis.gsfc.nas
 
 /* A few user-configurable values. */
 
-/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
-static int max_interrupt_work = 25;
-
 #define MAX_UNITS 8
 /* Used to pass the full-duplex flag, etc. */
 static int full_duplex[MAX_UNITS] = {0, };
@@ -143,7 +140,6 @@ static int csr0 = 0x00A00000 | 0x4800;
 MODULE_AUTHOR("Donald Becker <becker@cesdis.gsfc.nasa.gov>");
 MODULE_DESCRIPTION("Digital 21*4* Tulip ethernet driver");
 MODULE_PARM(debug, "i");
-MODULE_PARM(max_interrupt_work, "i");
 MODULE_PARM(reverse_probe, "i");
 MODULE_PARM(rx_copybreak, "i");
 MODULE_PARM(csr0, "i");
@@ -153,10 +149,6 @@ MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i");
 
 #define RUN_AT(x) (jiffies + (x))
 
-#if (LINUX_VERSION_CODE >= 0x20100)
-static char kernel_version[] = UTS_RELEASE;
-#endif
-
 #if LINUX_VERSION_CODE < 0x20123
 #define hard_smp_processor_id() smp_processor_id()
 #define test_and_set_bit(val, addr) set_bit(val, addr)
@@ -429,7 +421,7 @@ static const char media_cap[] =
 {0,0,0,16,  3,19,16,24,  27,4,7,5, 0,20,23,20 };
 static u8 t21040_csr13[] = {2,0x0C,8,4,  4,0,0,0, 0,0,0,0, 4,0,0,0};
 /* 21041 transceiver register settings: 10-T, 10-2, AUI, 10-T, 10T-FD*/
-static u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, };
+static u16 t21041_csr13[] = { 0xEF05, 0xEF0D, 0xEF0D, 0xEF05, 0xEF05, };
 static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, };
 static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, };
 
@@ -590,7 +582,7 @@ int __init tulip_probe(struct device *dev)
                return -ENODEV;
 
        for (;pci_index < 0xff; pci_index++) {
-               u16 vendor, device, pci_command, new_command;
+               u16 vendor, device, pci_command, new_command, subvendor;
                int chip_idx;
                int irq;
                long ioaddr;
@@ -608,6 +600,13 @@ int __init tulip_probe(struct device *dev)
                                                                 PCI_VENDOR_ID, &vendor);
                pcibios_read_config_word(pci_bus, pci_device_fn,
                                                                 PCI_DEVICE_ID, &device);
+               pcibios_read_config_word(pci_bus, pci_device_fn,
+                                                                PCI_SUBSYSTEM_VENDOR_ID, &subvendor);
+               
+               if( subvendor == 0x1376 ){
+                       printk("tulip: skipping LMC card.\n");
+                       continue;
+               }       
 
                for (chip_idx = 0; pci_tbl[chip_idx].vendor_id; chip_idx++)
                        if (vendor == pci_tbl[chip_idx].vendor_id
@@ -749,13 +748,7 @@ static struct device *tulip_probe1(int pci_bus, int pci_devfn,
                        put_unaligned(le16_to_cpu(value), ((u16*)dev->dev_addr) + i);
                        sum += value & 0xffff;
                }
-       } else if (chip_idx == COMET){
-               /* No need to read the EEPROM. */
-               put_unaligned(inl(ioaddr + 0xA4), (u32 *)dev->dev_addr);
-               put_unaligned(inl(ioaddr + 0xA8), (u16 *)(dev->dev_addr + 4));
-               for (i = 0; i < 6; i ++)
-                       sum += dev->dev_addr[i];
-       } else if (chip_idx == COMET5){
+       } else if ((chip_idx == COMET) || (chip_idx == COMET5)) {
                /* No need to read the EEPROM. */
                put_unaligned(inl(ioaddr + 0xA4), (u32 *)dev->dev_addr);
                put_unaligned(inl(ioaddr + 0xA8), (u16 *)(dev->dev_addr + 4));
@@ -998,8 +991,6 @@ static struct device *tulip_probe1(int pci_bus, int pci_devfn,
                outl(0x00001000, ioaddr + CSR12);
                break;
        case COMET:
-               /* No initialization necessary. */
-               break;
        case COMET5:
                /* No initialization necessary. */
                break;
@@ -1318,18 +1309,7 @@ static int mdio_read(struct device *dev, int phy_id, int location)
                return 0xffff;
        }
 
-       if (tp->chip_id == COMET) {
-               if (phy_id == 1) {
-                       if (location < 7)
-                               return inl(ioaddr + 0xB4 + (location<<2));
-                       else if (location == 17)
-                               return inl(ioaddr + 0xD0);
-                       else if (location >= 29 && location <= 31)
-                               return inl(ioaddr + 0xD4 + ((location-29)<<2));
-               }
-               return 0xffff;
-       }
-       if (tp->chip_id == COMET5) {
+       if ((tp->chip_id == COMET) || (tp->chip_id == COMET5)) {
                if (phy_id == 1) {
                        if (location < 7)
                                return inl(ioaddr + 0xB4 + (location<<2));
@@ -1386,19 +1366,7 @@ static void mdio_write(struct device *dev, int phy_id, int location, int value)
                return;
        }
 
-       if (tp->chip_id == COMET) {
-               if (phy_id != 1)
-                       return;
-               if (location < 7)
-                       outl(value, ioaddr + 0xB4 + (location<<2));
-               else if (location == 17)
-                       outl(value, ioaddr + 0xD0);
-               else if (location >= 29 && location <= 31)
-                       outl(value, ioaddr + 0xD4 + ((location-29)<<2));
-               return;
-       }
-
-       if (tp->chip_id == COMET5) {
+       if ((tp->chip_id == COMET) || (tp->chip_id == COMET5)) {
                if (phy_id != 1)
                        return;
                if (location < 7)
@@ -1488,12 +1456,7 @@ tulip_open(struct device *dev)
                        outl(addr_low,  ioaddr + CSR14);
                        outl(1, ioaddr + CSR13);
                        outl(addr_high, ioaddr + CSR14);
-               } else if (tp->chip_id == COMET) {
-                       outl(addr_low,  ioaddr + 0xA4);
-                       outl(addr_high, ioaddr + 0xA8);
-                       outl(0, ioaddr + 0xAC);
-                       outl(0, ioaddr + 0xB0);
-               } else if (tp->chip_id == COMET5) {
+               } else if ((tp->chip_id == COMET) || (tp->chip_id == COMET5)) {
                        outl(addr_low,  ioaddr + 0xA4);
                        outl(addr_high, ioaddr + 0xA8);
                        outl(0, ioaddr + 0xAC);
@@ -1608,10 +1571,7 @@ media_picked:
                outl(0x0000, ioaddr + CSR13);
                outl(0x0000, ioaddr + CSR14);
                outl(0x0008, ioaddr + CSR15);
-       } else if (tp->chip_id == COMET) {
-               dev->if_port = 0;
-               tp->csr6 = 0x00040000;
-       } else if (tp->chip_id == COMET5) {
+       } else if ((tp->chip_id == COMET) || (tp->chip_id == COMET5)) {
                dev->if_port = 0;
                tp->csr6 = 0x00040000;
        } else if (tp->chip_id == AX88140) {
@@ -3051,9 +3011,7 @@ static int private_ioctl(struct device *dev, struct ifreq *rq, int cmd)
                        data[0] = phy;
                else if (tp->flags & HAS_NWAY143)
                        data[0] = 32;
-               else if (tp->chip_id == COMET)
-                       data[0] = 1;
-               else if (tp->chip_id == COMET5)
+               else if ((tp->chip_id == COMET) || (tp->chip_id == COMET5))
                        data[0] = 1;
                else
                        return -ENODEV;
@@ -3180,10 +3138,9 @@ static void set_rx_mode(struct device *dev)
                                outl(mc_filter[0], ioaddr + CSR14);
                                outl(3, ioaddr + CSR13);
                                outl(mc_filter[1], ioaddr + CSR14);
-                       } else if (tp->chip_id == COMET) { /* Has a simple hash filter. */
-                               outl(mc_filter[0], ioaddr + 0xAC);
-                               outl(mc_filter[1], ioaddr + 0xB0);
-                       } else if (tp->chip_id == COMET5) { /* Has a simple hash filter. */
+
+                       /* Has a simple hash filter. */
+                       } else if ((tp->chip_id == COMET) || (tp->chip_id == COMET5)) {
                                outl(mc_filter[0], ioaddr + 0xAC);
                                outl(mc_filter[1], ioaddr + 0xB0);
                        }
index 53bb27411bef16bcc1edebcaea9c7761a454e88e..fe12eb6fa252b042c441512bdd06111f60ad3452 100644 (file)
@@ -29,9 +29,9 @@ dep_tristate 'Adaptec AHA1542 support' CONFIG_SCSI_AHA1542 $CONFIG_SCSI
 dep_tristate 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 $CONFIG_SCSI
 dep_tristate 'Adaptec AIC7xxx support' CONFIG_SCSI_AIC7XXX $CONFIG_SCSI
 if [ "$CONFIG_SCSI_AIC7XXX" != "n" ]; then
-    bool '   Enable Tagged Command Queueing (TCQ) by default' CONFIG_AIC7XXX_TCQ_ON_BY_DEFAULT y
+    bool '   Enable Tagged Command Queueing (TCQ) by default' CONFIG_AIC7XXX_TCQ_ON_BY_DEFAULT
     int  '   Maximum number of TCQ commands per device' CONFIG_AIC7XXX_CMDS_PER_DEVICE 24
-    bool '   Collect statistics to report in /proc' CONFIG_AIC7XXX_PROC_STATS y
+    bool '   Collect statistics to report in /proc' CONFIG_AIC7XXX_PROC_STATS
 fi
 dep_tristate 'IBM ServeRAID support' CONFIG_SCSI_IPS $CONFIG_SCSI
 dep_tristate 'AdvanSys SCSI support' CONFIG_SCSI_ADVANSYS $CONFIG_SCSI
@@ -71,7 +71,7 @@ if [ "$CONFIG_PCI" = "y" ]; then
   dep_tristate 'Initio 9100U(W) support' CONFIG_SCSI_INITIO $CONFIG_SCSI
   dep_tristate 'Initio INI-A100U2W support' CONFIG_SCSI_INIA100 $CONFIG_SCSI
 fi
-if [ "$CONFIG_PARPORT" != "n" ]; then
+if [ "$CONFIG_PARPORT" = "y" -o "$CONFIG_PARPORT" = "m" ]; then
   dep_tristate 'IOMEGA parallel port (ppa - older drives)' CONFIG_SCSI_PPA $CONFIG_SCSI $CONFIG_PARPORT
   dep_tristate 'IOMEGA parallel port (imm - newer drives)' CONFIG_SCSI_IMM $CONFIG_SCSI $CONFIG_PARPORT
   if [ "$CONFIG_SCSI_PPA" != "n" -o "$CONFIG_SCSI_IMM" != "n" ]; then
index 7cd2be2422bd6936d62279150f2dc1aaec27e8c2..fb3cf80dc902fbc96657d59a040de85f2e4bfa77 100644 (file)
@@ -17,6 +17,7 @@
  *     v0.4 - fixes in unidirectional mode
  *     v0.5 - add DEVICE_ID string support
  *     v0.6 - never time out
+ *     v0.? - fixed bulk-IN read and poll (David Paschal, paschal@rcsis.com)
  */
 
 /*
@@ -52,6 +53,7 @@
 
 #define IOCNR_GET_DEVICE_ID    1
 #define LPIOC_GET_DEVICE_ID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)        /* get device_id string */
+#define LPGETSTATUS            0x060b          /* same as in drivers/char/lp.c */
 
 /*
  * A DEVICE_ID string may include the printer's serial number.
@@ -81,6 +83,7 @@ struct usblp {
        int                     readcount;              /* Counter for reads */
        int                     ifnum;                  /* Interface number */
        int                     minor;                  /* minor number of device */
+       unsigned int            quirks;                 /* quirks flags */
        unsigned char           used;                   /* True if open */
        unsigned char           bidir;                  /* interface is bidirectional */
        unsigned char           *device_id_string;      /* IEEE 1284 DEVICE ID string (ptr) */
@@ -89,6 +92,26 @@ struct usblp {
 
 static struct usblp *usblp_table[USBLP_MINORS];
 
+/* Quirks: various printer quirks are handled by this table & its flags. */
+
+struct quirk_printer_struct {
+       __u16 vendorId;
+       __u16 productId;
+       unsigned int quirks;
+};
+
+#define USBLP_QUIRK_BIDIR      0x1     /* reports bidir but requires unidirectional mode (no INs/reads) */
+#define USBLP_QUIRK_USB_INIT   0x2     /* needs vendor USB init string */
+
+static struct quirk_printer_struct quirk_printers[] = {
+       { 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */
+       { 0x03f0, 0x0104, USBLP_QUIRK_BIDIR }, /* HP DeskJet 880C */
+       { 0x03f0, 0x0204, USBLP_QUIRK_BIDIR }, /* HP DeskJet 815C */
+       { 0x03f0, 0x0304, USBLP_QUIRK_BIDIR }, /* HP DeskJet 810C/812C */
+       { 0x03f0, 0x0404, USBLP_QUIRK_BIDIR }, /* HP DeskJet 830C */
+       { 0, 0 }
+};
+
 /*
  * Functions for usblp control messages.
  */
@@ -179,10 +202,19 @@ static int usblp_open(struct inode *inode, struct file *file)
        if (usblp->used)
                goto out;
 
+       /*
+        * TODO: need to implement LP_ABORTOPEN + O_NONBLOCK as in drivers/char/lp.c ???
+        * This is #if 0-ed because we *don't* want to fail an open
+        * just because the printer is off-line.
+        */
+#if 0
        if ((retval = usblp_check_status(usblp, 0))) {
                retval = retval > 1 ? -EIO : -ENOSPC;
                goto out;
        }
+#else
+       retval = 0;     
+#endif
 
        usblp->used = 1;
        file->private_data = usblp;
@@ -192,6 +224,7 @@ static int usblp_open(struct inode *inode, struct file *file)
 
        if (usblp->bidir) {
                usblp->readcount = 0;
+               usblp->readurb.dev = usblp->dev;
                usb_submit_urb(&usblp->readurb);
        }
 out:
@@ -224,37 +257,66 @@ static unsigned int usblp_poll(struct file *file, struct poll_table_struct *wait
 {
        struct usblp *usblp = file->private_data;
        poll_wait(file, &usblp->wait, wait);
-       return ((usblp->bidir || usblp->readurb.status  == -EINPROGRESS) ? 0 : POLLIN  | POLLRDNORM)
-                             | (usblp->writeurb.status == -EINPROGRESS  ? 0 : POLLOUT | POLLWRNORM);
+       return ((!usblp->bidir || usblp->readurb.status  == -EINPROGRESS) ? 0 : POLLIN  | POLLRDNORM)
+                              | (usblp->writeurb.status == -EINPROGRESS  ? 0 : POLLOUT | POLLWRNORM);
 }
 
 static int usblp_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
        struct usblp *usblp = file->private_data;
-       int length;
+       int length, err;
+       unsigned char status;
 
-       if ((_IOC_TYPE(cmd) != 'P') || (_IOC_DIR(cmd) != _IOC_READ))
-               return -EINVAL;
+       if (_IOC_TYPE(cmd) == 'P')      /* new-style ioctl number */
+       
+               switch (_IOC_NR(cmd)) {
 
-       switch (_IOC_NR(cmd)) {
+                       case IOCNR_GET_DEVICE_ID: /* get the DEVICE_ID string */
+                               if (_IOC_DIR(cmd) != _IOC_READ)
+                                       return -EINVAL;
 
-               case IOCNR_GET_DEVICE_ID: /* get the DEVICE_ID string */
+                               err = usblp_get_id(usblp, 0, usblp->device_id_string, DEVICE_ID_SIZE - 1);
+                               if (err < 0) {
+                                       dbg ("usblp%d: error = %d reading IEEE-1284 Device ID string",
+                                               usblp->minor, err);
+                                       usblp->device_id_string[0] = usblp->device_id_string[1] = '\0';
+                                       return -EIO;
+                               }
 
-                       length = (usblp->device_id_string[0] << 8) + usblp->device_id_string[1]; /* big-endian */
+                               length = (usblp->device_id_string[0] << 8) + usblp->device_id_string[1]; /* big-endian */
+                               if (length < DEVICE_ID_SIZE)
+                                       usblp->device_id_string[length] = '\0';
+                               else
+                                       usblp->device_id_string[DEVICE_ID_SIZE - 1] = '\0';
 
-                       dbg ("usblp_ioctl GET_DEVICE_ID actlen: %d, size: %d, string: '%s'",
-                               length, _IOC_SIZE(cmd), &usblp->device_id_string[2]);
+                               dbg ("usblp%d Device ID string [%d/max %d]='%s'",
+                                       usblp->minor, length, _IOC_SIZE(cmd), &usblp->device_id_string[2]);
 
-                       if (length > _IOC_SIZE(cmd)) length = _IOC_SIZE(cmd); /* truncate */
+                               if (length > _IOC_SIZE(cmd)) length = _IOC_SIZE(cmd); /* truncate */
 
-                       if (copy_to_user((unsigned char *) arg, usblp->device_id_string, (unsigned long) length))
-                               return -EFAULT;
+                               if (copy_to_user((unsigned char *) arg, usblp->device_id_string, (unsigned long) length))
+                                       return -EFAULT;
 
-                       break;
+                               break;
 
-               default:
-                       return -EINVAL;
-       }
+                       default:
+                               return -EINVAL;
+               }
+       else    /* old-style ioctl value */
+               switch (cmd) {
+
+                       case LPGETSTATUS:
+                               if (usblp_read_status(usblp, &status)) {
+                                       err("usblp%d: failed reading printer status", usblp->minor);
+                                       return -EIO;
+                               }
+                               if (copy_to_user ((unsigned char *)arg, &status, 1))
+                                       return -EFAULT;
+                               break;
+
+                       default:
+                               return -EINVAL;
+               }
 
        return 0;
 }
@@ -285,8 +347,17 @@ static ssize_t usblp_write(struct file *file, const char *buffer, size_t count,
                        return -ENODEV;
 
                if (usblp->writeurb.status) {
-                       err = usblp_check_status(usblp, err);
-                       continue;
+                       if (usblp->quirks & USBLP_QUIRK_BIDIR) {
+                               if (usblp->writeurb.status != -EINPROGRESS)
+                                       err("usblp%d: error %d writing to printer",
+                                               usblp->minor, usblp->writeurb.status);
+                               err = usblp->writeurb.status;
+                               continue;
+                       }
+                       else {
+                               err = usblp_check_status(usblp, err);
+                               continue;
+                       }
                }
 
                writecount += usblp->writeurb.transfer_buffer_length;
@@ -301,6 +372,7 @@ static ssize_t usblp_write(struct file *file, const char *buffer, size_t count,
                if (copy_from_user(usblp->writeurb.transfer_buffer, buffer + writecount,
                                usblp->writeurb.transfer_buffer_length)) return -EFAULT;
 
+               usblp->writeurb.dev = usblp->dev;
                usb_submit_urb(&usblp->writeurb);
        }
 
@@ -332,6 +404,8 @@ static ssize_t usblp_read(struct file *file, char *buffer, size_t count, loff_t
        if (usblp->readurb.status) {
                err("usblp%d: error %d reading from printer",
                        usblp->minor, usblp->readurb.status);
+               usblp->readurb.dev = usblp->dev;
+               usblp->readcount = 0;
                usb_submit_urb(&usblp->readurb);
                return -EIO;
        }
@@ -342,21 +416,55 @@ static ssize_t usblp_read(struct file *file, char *buffer, size_t count, loff_t
        if (copy_to_user(buffer, usblp->readurb.transfer_buffer + usblp->readcount, count))
                return -EFAULT;
 
-       if ((usblp->readcount += count) == usblp->readurb.actual_length)
+       if ((usblp->readcount += count) == usblp->readurb.actual_length) {
+               usblp->readcount = 0;
+               usblp->readurb.dev = usblp->dev;
                usb_submit_urb(&usblp->readurb);
+       }
 
        return count;
 }
 
+/*
+ * Checks for printers that have quirks, such as requiring unidirectional
+ * communication but reporting bidirectional; currently some HP printers
+ * have this flaw (HP 810, 880, 895, etc.), or needing an init string
+ * sent at each open (like some Epsons).
+ * Returns 1 if found, 0 if not found.
+ *
+ * HP recommended that we use the bidirectional interface but
+ * don't attempt any bulk IN transfers from the IN endpoint.
+ * Here's some more detail on the problem:
+ * The problem is not that it isn't bidirectional though. The problem
+ * is that if you request a device ID, or status information, while
+ * the buffers are full, the return data will end up in the print data
+ * buffer. For example if you make sure you never request the device ID
+ * while you are sending print data, and you don't try to query the
+ * printer status every couple of milliseconds, you will probably be OK.
+ */
+static unsigned int usblp_quirks (__u16 vendor, __u16 product)
+{
+       int i;
+
+       for (i = 0; quirk_printers[i].vendorId; i++) {
+               if (vendor == quirk_printers[i].vendorId &&
+                   product == quirk_printers[i].productId)
+                       return quirk_printers[i].quirks;
+       }
+       return 0;
+}
+
 static void *usblp_probe(struct usb_device *dev, unsigned int ifnum)
 {
        struct usb_interface_descriptor *interface;
        struct usb_endpoint_descriptor *epread, *epwrite;
        struct usblp *usblp;
-       int minor, i, alts = -1, bidir = 0;
+       int minor, i, bidir = 0, quirks;
+       int alts = dev->actconfig->interface[ifnum].act_altsetting;
        int length, err;
        char *buf;
 
+       /* If a bidirectional interface exists, use it. */
        for (i = 0; i < dev->actconfig->interface[ifnum].num_altsetting; i++) {
 
                interface = &dev->actconfig->interface[ifnum].altsetting[i];
@@ -366,18 +474,13 @@ static void *usblp_probe(struct usb_device *dev, unsigned int ifnum)
                   (interface->bInterfaceProtocol > 1 && interface->bNumEndpoints < 2))
                        continue;
 
-               if (alts == -1)
-                       alts = i;
-
-               if (!bidir && interface->bInterfaceProtocol > 1) {
+               if (interface->bInterfaceProtocol > 1) {
                        bidir = 1;
                        alts = i;
+                       break;
                }
        }
 
-       if (alts == -1)
-               return NULL;
-
        interface = &dev->actconfig->interface[ifnum].altsetting[alts];
        if (usb_set_interface(dev, ifnum, alts))
                err("can't set desired altsetting %d on interface %d", alts, ifnum);
@@ -410,10 +513,21 @@ static void *usblp_probe(struct usb_device *dev, unsigned int ifnum)
        }
        memset(usblp, 0, sizeof(struct usblp));
 
+       /* lookup quirks for this printer */
+       quirks = usblp_quirks(dev->descriptor.idVendor, dev->descriptor.idProduct);
+
+       if (bidir && (quirks & USBLP_QUIRK_BIDIR)) {
+               bidir = 0;
+               epread = NULL;
+               info ("Disabling reads from problem bidirectional printer on usblp%d",
+                       minor);
+       }
+
        usblp->dev = dev;
        usblp->ifnum = ifnum;
        usblp->minor = minor;
        usblp->bidir = bidir;
+       usblp->quirks = quirks;
 
        init_waitqueue_head(&usblp->wait);
 
@@ -455,7 +569,7 @@ static void *usblp_probe(struct usb_device *dev, unsigned int ifnum)
        }
 
 #ifdef DEBUG
-       usblp_check_status(usblp);
+       usblp_check_status(usblp, 0);
 #endif
 
        info("usblp%d: USB %sdirectional printer dev %d if %d alt %d",
@@ -503,7 +617,7 @@ static struct usb_driver usblp_driver = {
        probe:          usblp_probe,
        disconnect:     usblp_disconnect,
        fops:           &usblp_fops,
-       minor:          USBLP_MINOR_BASE
+       minor:          USBLP_MINOR_BASE,
 };
 
 static int __init usblp_init(void)
index 8620081ce4c31273fb38748f730a24905a94dde2..63754b20ed926d33fb41a04c9d3e78f133382062 100644 (file)
@@ -50,7 +50,7 @@ if [ "$CONFIG_FB" = "y" ]; then
   if [ "$CONFIG_ATARI" = "y" ]; then
     bool 'Atari native chipset support' CONFIG_FB_ATARI
   fi
-  if [ "$CONFIG_ATARI" = "y" -o "$CONFIG_PCI" != "n" ]; then
+  if [ "$CONFIG_ATARI" = "y" -o "$CONFIG_PCI" = "y" ]; then
     tristate 'ATI Mach64 display support' CONFIG_FB_ATY
   fi
   if [ "$CONFIG_PPC" = "y" ]; then
@@ -86,7 +86,7 @@ if [ "$CONFIG_FB" = "y" ]; then
     define_bool CONFIG_BUS_I2C y
   fi
   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-    if [ "$CONFIG_PCI" != "n" -a "$ARCH" != "sparc" -a "$ARCH" != "sparc64" ]; then
+    if [ "$CONFIG_PCI" = "y" -a "$ARCH" != "sparc" -a "$ARCH" != "sparc64" ]; then
       tristate 'Matrox acceleration' CONFIG_FB_MATROX
       if  [ "$CONFIG_FB_MATROX" != "n" ]; then
         bool '  Millennium I/II support' CONFIG_FB_MATROX_MILLENIUM
@@ -114,7 +114,7 @@ if [ "$CONFIG_FB" = "y" ]; then
     fi
   fi
   if [ "$ARCH" = "sparc" ]; then
-    if [ "$CONFIG_PCI" != "n" ]; then
+    if [ "$CONFIG_PCI" = "y" ]; then
       bool 'PCI framebuffers' CONFIG_FB_PCI
       if [ "$CONFIG_FB_PCI" != "n" ]; then
         bool '  IGA 168x display support' CONFIG_FB_IGA
index c7de4a3ea6b4185e888c8b87bf33c873a1d131da..eb091649ee1a12238c991633d685ed45845e6244 100644 (file)
@@ -262,7 +262,6 @@ struct fb_info_aty128 {
     int chip_gen;
     struct aty128fb_par default_par, current_par;
     struct display disp;
-    struct display_switch dispsw;       /* for cursor and font */
     struct { u8 red, green, blue, pad; } palette[256];
 #ifdef CONFIG_PMAC_PBOOK
     unsigned char *save_framebuffer;
@@ -1436,29 +1435,25 @@ aty128_set_disp(struct display *disp,
     switch (bpp) {
 #ifdef FBCON_HAS_CFB8
     case 8:
-       info->dispsw = accel ? fbcon_aty128_8 : fbcon_cfb8;
-        disp->dispsw = &info->dispsw;
+       disp->dispsw = accel ? &fbcon_aty128_8 : &fbcon_cfb8;
        break;
 #endif
 #ifdef FBCON_HAS_CFB16
     case 15:
     case 16:
-       info->dispsw = accel ? fbcon_aty128_16 : fbcon_cfb16;
-        disp->dispsw = &info->dispsw;
+       disp->dispsw = accel ? &fbcon_aty128_16 : &fbcon_cfb16;
        disp->dispsw_data = info->fbcon_cmap.cfb16;
        break;
 #endif
 #ifdef FBCON_HAS_CFB24
     case 24:
-       info->dispsw = accel ? fbcon_aty128_24 : fbcon_cfb24;
-        disp->dispsw = &info->dispsw;
+       disp->dispsw = accel ? &fbcon_aty128_24 : &fbcon_cfb24;
        disp->dispsw_data = info->fbcon_cmap.cfb24;
        break;
 #endif
 #ifdef FBCON_HAS_CFB32
     case 32:
-       info->dispsw = accel ? fbcon_aty128_32 : fbcon_cfb32;
-        disp->dispsw = &info->dispsw;
+       disp->dispsw = accel ? &fbcon_aty128_32 : &fbcon_cfb32;
        disp->dispsw_data = info->fbcon_cmap.cfb32;
        break;
 #endif
@@ -1752,18 +1747,17 @@ aty128_init(struct fb_info_aty128 *info, const char *name)
     memset(&var, 0, sizeof(var));
 
 #ifdef CONFIG_FB_OF
-    if (default_vmode == VMODE_CHOOSE) {
-#endif /* CONFIG_FB_OF */
+    /* New iBook */
+    if (default_vmode == VMODE_CHOOSE &&
+       machine_is_compatible("PowerBook2,2"))
+        default_vmode = VMODE_800_600_60;
+        
+    if (default_vmode == VMODE_CHOOSE)
+        var = default_var;
+    else if (mac_vmode_to_var(default_vmode, default_cmode, &var))
+       var = default_var;
+#else /* CONFIG_FB_OF */
         var = default_var;
-
-#ifdef CONFIG_FB_OF
-       /* New iBook */
-       if (machine_is_compatible("PowerBook2,2"))
-               default_vmode = VMODE_800_600_60;
-    } else {
-       if (mac_vmode_to_var(default_vmode, default_cmode, &var))
-           var = default_var;
-    }
 #endif /* CONFIG_FB_OF */
 
 #endif /* MODULE */
index a106421ab9fbcb91714909a26a9e9794072db411..d8c691411e8657daa0161308fb1ce05e6c16f63c 100644 (file)
@@ -161,7 +161,7 @@ nfsd_cache_lookup(struct svc_rqst *rqstp, int type)
                    xid == rp->c_xid && proc == rp->c_proc &&
                    proto == rp->c_prot && vers == rp->c_vers &&
                    time_before(jiffies, rp->c_timestamp + 120*HZ) &&
-                   memcmp((char*)&rqstp->rq_addr, (char*)&rp->c_addr, rqstp->rq_addrlen)==0) {
+                   memcmp((char*)&rqstp->rq_addr, (char*)&rp->c_addr, sizeof(rp->c_addr))==0) {
                        nfsdstats.rchits++;
                        goto found_entry;
                }
index 689cc93b24e985c03490c23a6e7c789f89e1900a..074efb3deece09bf9e07a62b685fb46c88cbe951 100644 (file)
@@ -36,6 +36,7 @@ extern ide_ioreg_t chrp_ide_regbase[MAX_HWIFS];
 extern ide_ioreg_t chrp_idedma_regbase; /* one for both channels */
 extern unsigned int chrp_ide_irq;
 extern void chrp_ide_probe(void);
+extern void ide_pmac_init(void);
 
 struct ide_machdep_calls {
         void        (*insw)(ide_ioreg_t port, void *buf, int ns);
index ebea80172b0d72158d188cdcf3bd2a09ca89eaa7..78bd10e017c85bccbe5f47bdc00c8d5d90b578d6 100644 (file)
@@ -13,6 +13,7 @@
 #define MAP_ANONYMOUS  0x20            /* don't use a file */
 #define MAP_RENAME      MAP_ANONYMOUS   /* In SunOS terminology */
 #define MAP_NORESERVE   0x40            /* don't reserve swap pages */
+#define MAP_LOCKED     0x80
 
 #define MAP_GROWSDOWN  0x0100          /* stack-like segment */
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
index 55e9b6e3d01e905bee850314115bdc8d1a0c42e7..c8d648af6dafc74e16c110403144bb4a258d8231 100644 (file)
 #ifndef __ASSEMBLY__
 #ifdef __KERNEL__
 
+#ifdef CONFIG_XMON
+#define BUG() do { \
+       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
+       xmon(0); \
+} while (0)
+#else
+#define BUG() do { \
+       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
+       __asm__ __volatile__(".long 0x0"); \
+} while (0)
+#endif
+#define PAGE_BUG(page) do { BUG(); } while (0)
+
 #define STRICT_MM_TYPECHECKS
 
 #ifdef STRICT_MM_TYPECHECKS
index f15458fd231c7b51fc407f5d94f06dda26696b18..fb5b5611b8d2280e7088881a25ff4d26f5416c3c 100644 (file)
@@ -935,6 +935,7 @@ int handle_mm_fault(struct task_struct *tsk, struct vm_area_struct * vma,
        pte_t * pte;
        int ret;
 
+       current->state = TASK_RUNNING;
        pgd = pgd_offset(vma->vm_mm, address);
        pmd = pmd_alloc(pgd, address);
        if (!pmd)
index 3aa4543d78cd80793467f6b3ca97c4e5abfbef62..01ff5f58732a958236c0a43746e73aa644a7c944 100644 (file)
@@ -720,6 +720,9 @@ static int ax25_getsockopt(struct socket *sock, int level, int optname, char *op
        if (get_user(len, optlen))
                return -EFAULT;
 
+       if (len < 0)
+               return -EINVAL;
+               
        switch (optname) {
                case AX25_WINDOW:
                        val = sk->protinfo.ax25->window;
index 70324492115415484f8a8faec8d19810121bb6b7..2b3fc9b5f0d77295e5c808d01f1ab5d67b9ab5b4 100644 (file)
@@ -377,11 +377,14 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
                struct timeval tm;
        } v;
        
-       unsigned int lv=sizeof(int),len;
+       int lv=sizeof(int),len;
        
        if(get_user(len,optlen))
                return -EFAULT;
 
+       if(len < 0)
+               return -EINVAL;
+               
        switch(optname) 
        {
                case SO_DEBUG:          
index 369a6770cc5e5a249a4ab4a4499a7af1e00c9d9a..4b7cbd934233ff87eadf92fed2f186850e9a79d1 100644 (file)
@@ -636,6 +636,9 @@ int ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *op
        if(get_user(len,optlen))
                return -EFAULT;
 
+       if(len < 0)
+               return -EINVAL;
+               
        switch(optname)
        {
                case IP_OPTIONS:
index cd51cd9a011627faab887d441e09f1662aa5a1c3..ad3955e55d05fac7e78d50e2b4a71bd489bc338f 100644 (file)
@@ -877,6 +877,10 @@ int ip_mroute_getsockopt(struct sock *sk,int optname,char *optval,int *optlen)
                return -EFAULT;
 
        olr=min(olr,sizeof(int));
+       
+       if(olr < 0)
+               return -EINVAL;
+               
        if(put_user(olr,optlen))
                return -EFAULT;
        if(optname==MRT_VERSION)
index 5e7910dd3c9b99b083ada71ecda25b4674a4bbf1..859b44e8387c561c5aa6a9fd6ba3586cd62d6d97 100644 (file)
@@ -497,6 +497,8 @@ static int raw_geticmpfilter(struct sock *sk, char *optval, int *optlen)
 
        if (get_user(len,optlen))
                return -EFAULT;
+       if (len < 0)
+               return -EINVAL;
        if (len > sizeof(struct icmp_filter))
                len = sizeof(struct icmp_filter);
        if (put_user(len, optlen))
index 938671966d96d022121d13ab12872c52564a86e5..4f7e4f1ad0f493a1ae3e457054adb0f212767ae0 100644 (file)
@@ -1779,6 +1779,9 @@ int tcp_getsockopt(struct sock *sk, int level, int optname, char *optval,
                return -EFAULT;
 
        len = min(len, sizeof(int));
+       
+       if(len < 0)
+               return -EINVAL;
 
        switch(optname) {
        case TCP_MAXSEG:
index 20de5bb2e22bcacf4313e2172cb958be3fbcc197..c855d26920f6a6121a9abb9379dd13f4994e20db 100644 (file)
@@ -359,6 +359,8 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname, char *optval,
                return -ENOPROTOOPT;
        if (get_user(len, optlen))
                return -EFAULT;
+       if(len < 0)
+               return -EINVAL;
        switch (optname) {
        case IPV6_PKTOPTIONS:
        {
index a05dc37c73a49440f81b722394bda1902f7195fa..8834cee567654379f1f999bcfbb5e66d793dde1e 100644 (file)
@@ -492,6 +492,8 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname,
        case ICMPV6_FILTER:
                if (get_user(len, optlen))
                        return -EFAULT;
+               if (len < 0)
+                       return -EINVAL;
                if (len > sizeof(struct icmp6_filter))
                        len = sizeof(struct icmp6_filter);
                if (put_user(len, optlen))
index e66f28cca59944257d88c2b6617f20dcd165c76f..a6dcbf4d9d4c98461c24bf3ad2581695a59344f3 100644 (file)
@@ -1769,6 +1769,10 @@ static int ipx_getsockopt(struct socket *sock, int level, int optname,
                return (-EFAULT);
 
        len = min(len, sizeof(int));
+       
+       if(len < 0)
+               return -EINVAL;
+               
        if(put_user(len, optlen))
                return (-EFAULT);
 
index 34d61d2314ab5afca3eeb62b69510d115359a0eb..56ac6590ab5174527cee9b2fa6a8f3da90263419 100644 (file)
@@ -1842,6 +1842,9 @@ static int irda_getsockopt(struct socket *sock, int level, int optname,
        if (get_user(len, optlen))
                return -EFAULT;
 
+       if (len < 0)
+               return -EINVAL;
+               
        switch (optname) {
        case IRLMP_ENUMDEVICES:
                /* Tell IrLMP we want to be notified */
index 1cff39fa171782e6e075d12e862a718ad20041c6..4384306577efa54efe4cf02a89b7ff10aa6bf81c 100644 (file)
@@ -407,6 +407,9 @@ static int nr_getsockopt(struct socket *sock, int level, int optname,
        if (get_user(len, optlen))
                return -EFAULT;
 
+       if (len < 0)
+               return -EINVAL;
+               
        switch (optname) {
                case NETROM_T1:
                        val = sk->protinfo.nr->t1 / HZ;
index 7264bc6f3c19fb18e59fabca10d827256a222491..df9f9bf5470515b54da68d123b78f0c35b9e0319 100644 (file)
@@ -471,6 +471,9 @@ static int rose_getsockopt(struct socket *sock, int level, int optname,
                
        if (get_user(len, optlen))
                return -EFAULT;
+               
+       if (len < 0)
+               return -EINVAL;
        
        switch (optname) {
                case ROSE_DEFER:
index 5a6422092d6c18b8bf0d00a6bc671f253992f78e..c81c2dea83ac58a8e6873a7be3b2c00b46bd147f 100644 (file)
@@ -1048,7 +1048,10 @@ asmlinkage int sys_setsockopt(int fd, int level, int optname, char *optval, int
 {
        int err;
        struct socket *sock;
-       
+
+       if(optlen < 0)  
+               return -EINVAL;
+               
        lock_kernel();
        if ((sock = sockfd_lookup(fd, &err))!=NULL)
        {
index 259e6d33456fb2260c1a92acc645b40779a6e90b..bd591a76ee09dd00ce1f81f3a614455bb47440f0 100644 (file)
@@ -389,6 +389,9 @@ static int x25_getsockopt(struct socket *sock, int level, int optname,
        if (get_user(len, optlen))
                return -EFAULT;
 
+       if (len < 0)
+               return -EINVAL;
+               
        switch (optname) {
                case X25_QBITINCL:
                        val = sk->protinfo.x25->qbitincl;