]> git.neil.brown.name Git - history.git/commitdiff
v2.4.7.1 -> v2.4.7.2
authorLinus Torvalds <torvalds@athlon.transmeta.com>
Tue, 5 Feb 2002 03:14:56 +0000 (19:14 -0800)
committerLinus Torvalds <torvalds@athlon.transmeta.com>
Tue, 5 Feb 2002 03:14:56 +0000 (19:14 -0800)
  - Kai Germaschewski: ISDN updates
  - David Miller: sparc and network updates
  - Andrea Arcangeli, Maksim Krasnyanskiy: tasklet fixes
  - Stelian Pop: Motion Eye camera driver update
  - Jens Axboe: DAC960 update

40 files changed:
Documentation/Configure.help
Documentation/isdn/HiSax.cert
Makefile
arch/sparc/Makefile
arch/sparc/kernel/ptrace.c
arch/sparc/mm/fault.c
arch/sparc64/Makefile
arch/sparc64/kernel/ioctl32.c
arch/sparc64/kernel/ptrace.c
drivers/block/DAC960.c
drivers/block/DAC960.h
drivers/char/mem.c
drivers/isdn/hisax/Makefile
drivers/isdn/hisax/cert.c
drivers/isdn/hisax/hfc_pci.c
drivers/isdn/hisax/md5sums.asc
drivers/isdn/hisax/sedlbauer_cs.c
drivers/isdn/isdn_net.c
drivers/isdn/isdn_ppp.c
drivers/isdn/isdn_tty.c
drivers/media/video/meye.c
drivers/media/video/meye.h
drivers/net/sunhme.c
drivers/video/cgfourteenfb.c
fs/partitions/msdos.c
include/asm-i386/math_emu.h
include/asm-i386/softirq.h
include/asm-sparc/bitops.h
include/linux/blkdev.h
include/linux/interrupt.h
include/linux/mii.h
include/linux/netdevice.h
include/linux/parport_pc.h
kernel/ksyms.c
kernel/softirq.c
mm/page_alloc.c
net/core/dev.c
net/core/sock.c
net/ipv4/igmp.c
net/unix/af_unix.c

index ce826df4e324d3a4ffc56c7212133741e7d16613..659e3960e1557d552a6521fa06d4771ee98d778c 100644 (file)
@@ -14228,6 +14228,19 @@ CONFIG_APPLICOM
 
   If unsure, say N.
 
+Sony Vaio Programmable I/O Control Device support
+CONFIG_SONYPI
+  This driver enables access to the Sony Programmable I/O Control Device
+  which can be found in many (all ?) Sony Vaio laptops.
+
+  If you have one of those laptops, read Documentation/sonypi.txt,
+  and say Y or M here.
+
+  If you want to compile the driver as a module ( = code which can be
+  inserted in and removed from the running kernel whenever you want),
+  say M here and read <file:Documentation/modules.txt>. The module will be
+  called sonypi.o.
+
 Intel Random Number Generator support
 CONFIG_INTEL_RNG
   This driver provides kernel-side support for the Random Number
@@ -17521,6 +17534,19 @@ CONFIG_VIDEO_PMS
   from the running kernel whenever you want). If you want to compile
   it as a module, say M here and read Documentation/modules.txt.
 
+CONFIG_VIDEO_MEYE
+  This is the video4linux driver for the Motion Eye camera found
+  in the Vaio Picturebook laptops. Please read the material in
+  <file:Documentation/video4linux/meye.txt> for more information.
+
+  If you say Y or M here, you need to say Y or M to "Sony Programmable
+  I/O Control Device" in the character device section.
+
+  This driver is available as a module called meye.o ( = code
+  which can be inserted in and removed from the running kernel
+  whenever you want). If you want to compile it as a module, say M
+  here and read <file:Documentation/modules.txt>.
+
 IBM's S/390 architecture
 CONFIG_ARCH_S390
   Select this option, if you want to run the Kernel on one of IBM's
index af128daaa4ff0dfdec3e5ccad2f43e0bc6aec10b..2e3523ca7d224afe9f4199e65f152dce8925cf1b 100644 (file)
@@ -20,6 +20,23 @@ The certification is only valid for the combination of the tested software
 version and the tested hardware. Any changes to the HiSax source code may
 therefore affect the certification.
 
+Additional ITU approval tests have been carried out for all generic cards
+using Colognechip single chip solutions HFC-S PCI A for PCI cards as well
+as HFC-S USB based USB ISDN ta adapters.
+These tests included all layers 1-3 and as well all functional tests for 
+the layer 1. Because all hardware based on these chips are complete ISDN
+solutions in one chip all cards and USB-TAs using these chips are to be
+regarded as approved for those tests. Some additional electrical tests
+of the layer 1 which are independant of the driver and related to a
+special hardware used will be regarded as approved if at least one 
+solution has been tested including those electrical tests. So if cards 
+or tas have been completely approved for any other os, the approval
+for those electrical tests is valid for linux, too.
+Please send any questions regarding this drivers or approval abouts to 
+werner@isdn-development.de 
+Additional information and the type approval documents will be found
+shortly on the Colognechip website www.colognechip.com 
+
 If you change the main files of the HiSax ISDN stack, the certification will
 become invalid. Because in most countries it is illegal to connect
 unapproved ISDN equipment to the public network, I have to guarantee that
@@ -50,6 +67,7 @@ drivers/isdn/hisax/l3_1tr6.c
 drivers/isdn/hisax/cert.c
 drivers/isdn/hisax/elsa.c
 drivers/isdn/hisax/diva.c
+drivers/isdn/hisax/hfc_pci.c
 
 Please send any changes, bugfixes and patches to me rather than implementing
 them directly into the HiSax sources.
index e071618339aa59e300dd3c2443d26d9bba6ef1d3..72a02233822b8e969121010855a99b6e3a2ebdcd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 8
-EXTRAVERSION =-pre1
+EXTRAVERSION =-pre2
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
index dc3f3a93c86662fa5b995e7035a2e6760c6cb7ac..8c6812c116e71ae330b8fccbcda47411a6b7b678 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.48 2000/12/15 00:41:24 davem Exp $
+# $Id: Makefile,v 1.49 2001/07/27 09:42:22 davem Exp $
 # sparc/Makefile
 #
 # Makefile for the architecture dependent flags and dependencies on the
@@ -60,7 +60,7 @@ archmrproper:
 
 archdep: check_asm
 
-check_asm:
+check_asm: include/linux/version.h
        $(MAKE) -C arch/sparc/kernel check_asm
 
 tftpboot.img:
index 0e73266b415917a00ec3f516e2de70aa98367b68..c33b785afb088f2ae9e64d409a70defcfbb4a6ac 100644 (file)
@@ -318,8 +318,6 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 
        if ((current->personality == PER_SUNOS && request == PTRACE_SUNATTACH)
            || (current->personality != PER_SUNOS && request == PTRACE_ATTACH)) {
-               unsigned long flags;
-
                if (ptrace_attach(child)) {
                        pt_error_return(regs, EPERM);
                        goto out_tsk;
index 764bca89b14d6578aaae8430ef465a71d0b37cc2..e59e6ae4bb0197aa49e52fa7f1b623eee8736638 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: fault.c,v 1.119 2001/03/24 09:36:10 davem Exp $
+/* $Id: fault.c,v 1.120 2001/07/18 13:40:05 anton Exp $
  * fault.c:  Page fault handlers for the Sparc.
  *
  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -37,8 +37,6 @@
 extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];
 extern int prom_node_root;
 
-struct linux_romvec *romvec;
-
 /* At boot time we determine these two values necessary for setting
  * up the segment maps and page table entries (pte's).
  */
index f95dc46f93347a9df3a998d795a1a3d0b6bc4f13..31d37fa19bed7594c60be08991a52d70513f07b0 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.46 2000/12/14 22:57:26 davem Exp $
+# $Id: Makefile,v 1.47 2001/07/27 09:42:22 davem Exp $
 # sparc64/Makefile
 #
 # Makefile for the architecture dependent flags and dependencies on the
@@ -98,7 +98,7 @@ archmrproper:
 
 archdep: check_asm
 
-check_asm:
+check_asm: include/linux/version.h
        $(MAKE) -C arch/sparc64/kernel check_asm
 
 tftpboot.img:
index eb37f1bca3b177c60de2b70a359ba121aafcd519..335eb5328df1ee4f7cb2d2c4f10e8659c7d930b1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ioctl32.c,v 1.117 2001/06/02 21:39:55 davem Exp $
+/* $Id: ioctl32.c,v 1.119 2001/07/21 00:28:25 davem Exp $
  * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  *
  * Copyright (C) 1997-2000  Jakub Jelinek  (jakub@redhat.com)
 #include <linux/atm_tcp.h>
 #include <linux/sonet.h>
 #include <linux/atm_suni.h>
+#include <linux/mtd/mtd.h>
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci.h>
 
+#include <linux/usb.h>
+#include <linux/usbdevice_fs.h>
+
 /* Use this to get at 32-bit user passed pointers. 
    See sys_sparc32.c for description about these. */
 #define A(__x) ((unsigned long)(__x))
@@ -3081,6 +3085,453 @@ static int ioc_settimeout(unsigned int fd, unsigned int cmd, unsigned long arg)
        return rw_long(fd, AUTOFS_IOC_SETTIMEOUT, arg);
 }
 
+struct usbdevfs_ctrltransfer32 {
+       __u8 requesttype;
+       __u8 request;
+       __u16 value;
+       __u16 index;
+       __u16 length;
+       __u32 timeout;  /* in milliseconds */
+       __u32 data;
+};
+
+#define USBDEVFS_CONTROL32           _IOWR('U', 0, struct usbdevfs_ctrltransfer32)
+
+static int do_usbdevfs_control(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+       struct usbdevfs_ctrltransfer kctrl;
+       struct usbdevfs_ctrltransfer32 *uctrl;
+       mm_segment_t old_fs;
+       __u32 udata;
+       void *uptr, *kptr;
+       int err;
+
+       uctrl = (struct usbdevfs_ctrltransfer32 *) arg;
+
+       if (copy_from_user(&kctrl, uctrl,
+                          (sizeof(struct usbdevfs_ctrltransfer) -
+                           sizeof(void *))))
+               return -EFAULT;
+
+       if (get_user(udata, &uctrl->data))
+               return -EFAULT;
+       uptr = (void *) A(udata);
+
+       /* In usbdevice_fs, it limits the control buffer to a page,
+        * for simplicity so do we.
+        */
+       if (!uptr || kctrl.length > PAGE_SIZE)
+               return -EINVAL;
+
+       kptr = (void *)__get_free_page(GFP_KERNEL);
+
+       if ((kctrl.requesttype & 0x80) == 0) {
+               err = -EFAULT;
+               if (copy_from_user(kptr, uptr, kctrl.length))
+                       goto out;
+       }
+
+       kctrl.data = kptr;
+
+       old_fs = get_fs();
+       set_fs(KERNEL_DS);
+       err = sys_ioctl(fd, USBDEVFS_CONTROL, (unsigned long)&kctrl);
+       set_fs(old_fs);
+
+       if (err >= 0 &&
+           ((kctrl.requesttype & 0x80) != 0)) {
+               if (copy_to_user(uptr, kptr, kctrl.length))
+                       err = -EFAULT;
+       }
+
+out:
+       free_page((unsigned long) kptr);
+       return err;
+}
+
+struct usbdevfs_bulktransfer32 {
+       unsigned int ep;
+       unsigned int len;
+       unsigned int timeout; /* in milliseconds */
+       __u32 data;
+};
+
+#define USBDEVFS_BULK32              _IOWR('U', 2, struct usbdevfs_bulktransfer32)
+
+static int do_usbdevfs_bulk(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+       struct usbdevfs_bulktransfer kbulk;
+       struct usbdevfs_bulktransfer32 *ubulk;
+       mm_segment_t old_fs;
+       __u32 udata;
+       void *uptr, *kptr;
+       int err;
+
+       ubulk = (struct usbdevfs_bulktransfer32 *) arg;
+
+       if (get_user(kbulk.ep, &ubulk->ep) ||
+           get_user(kbulk.len, &ubulk->len) ||
+           get_user(kbulk.timeout, &ubulk->timeout) ||
+           get_user(udata, &ubulk->data))
+               return -EFAULT;
+
+       uptr = (void *) A(udata);
+
+       /* In usbdevice_fs, it limits the control buffer to a page,
+        * for simplicity so do we.
+        */
+       if (!uptr || kbulk.len > PAGE_SIZE)
+               return -EINVAL;
+
+       kptr = (void *) __get_free_page(GFP_KERNEL);
+
+       if ((kbulk.ep & 0x80) == 0) {
+               err = -EFAULT;
+               if (copy_from_user(kptr, uptr, kbulk.len))
+                       goto out;
+       }
+
+       kbulk.data = kptr;
+
+       old_fs = get_fs();
+       set_fs(KERNEL_DS);
+       err = sys_ioctl(fd, USBDEVFS_BULK, (unsigned long) &kbulk);
+       set_fs(old_fs);
+
+       if (err >= 0 &&
+           ((kbulk.ep & 0x80) != 0)) {
+               if (copy_to_user(uptr, kptr, kbulk.len))
+                       err = -EFAULT;
+       }
+
+out:
+       free_page((unsigned long) kptr);
+       return err;
+}
+
+/* This needs more work before we can enable it.  Unfortunately
+ * because of the fancy asynchronous way URB status/error is written
+ * back to userspace, we'll need to fiddle with USB devio internals
+ * and/or reimplement entirely the frontend of it ourselves. -DaveM
+ *
+ * The issue is:
+ *
+ *     When an URB is submitted via usbdevicefs it is put onto an
+ *     asynchronous queue.  When the URB completes, it may be reaped
+ *     via another ioctl.  During this reaping the status is written
+ *     back to userspace along with the length of the transfer.
+ *
+ *     We must translate into 64-bit kernel types so we pass in a kernel
+ *     space copy of the usbdevfs_urb structure.  This would mean that we
+ *     must do something to deal with the async entry reaping.  First we
+ *     have to deal somehow with this transitory memory we've allocated.
+ *     This is problematic since there are many call sites from which the
+ *     async entries can be destroyed (and thus when we'd need to free up
+ *     this kernel memory).  One of which is the close() op of usbdevicefs.
+ *     To handle that we'd need to make our own file_operations struct which
+ *     overrides usbdevicefs's release op with our own which runs usbdevicefs's
+ *     real release op then frees up the kernel memory.
+ *
+ *     But how to keep track of these kernel buffers?  We'd need to either
+ *     keep track of them in some table _or_ know about usbdevicefs internals
+ *     (ie. the exact layout of it's file private, which is actually defined
+ *     in linux/usbdevice_fs.h, the layout of the async queues are private to
+ *     devio.c)
+ *
+ * There is one possible other solution I considered, also involving knowledge
+ * of usbdevicefs internals:
+ *
+ *     After an URB is submitted, we "fix up" the address back to the user
+ *     space one.  This would work if the status/length fields written back
+ *     by the async URB completion lines up perfectly in the 32-bit type with
+ *     the 64-bit kernel type.  Unfortunately, it does not because the iso
+ *     frame descriptors, at the end of the struct, can be written back.
+ *
+ * I think we'll just need to simply duplicate the devio URB engine here.
+ */
+#if 0
+struct usbdevfs_urb32 {
+       __u8 type;
+       __u8 endpoint;
+       __s32 status;
+       __u32 flags;
+       __u32 buffer;
+       __s32 buffer_length;
+       __s32 actual_length;
+       __s32 start_frame;
+       __s32 number_of_packets;
+       __s32 error_count;
+       __u32 signr;
+       __u32 usercontext; /* unused */
+       struct usbdevfs_iso_packet_desc iso_frame_desc[0];
+};
+
+#define USBDEVFS_SUBMITURB32       _IOR('U', 10, struct usbdevfs_urb32)
+
+static int get_urb32(struct usbdevfs_urb *kurb,
+                    struct usbdevfs_urb32 *uurb)
+{
+       if (get_user(kurb->type, &uurb->type) ||
+           __get_user(kurb->endpoint, &uurb->endpoint) ||
+           __get_user(kurb->status, &uurb->status) ||
+           __get_user(kurb->flags, &uurb->flags) ||
+           __get_user(kurb->buffer_length, &uurb->buffer_length) ||
+           __get_user(kurb->actual_length, &uurb->actual_length) ||
+           __get_user(kurb->start_frame, &uurb->start_frame) ||
+           __get_user(kurb->number_of_packets, &uurb->number_of_packets) ||
+           __get_user(kurb->error_count, &uurb->error_count) ||
+           __get_user(kurb->signr, &uurb->signr))
+               return -EFAULT;
+
+       kurb->usercontext = 0; /* unused currently */
+
+       return 0;
+}
+
+/* Just put back the values which usbdevfs actually changes. */
+static int put_urb32(struct usbdevfs_urb *kurb,
+                    struct usbdevfs_urb32 *uurb)
+{
+       if (put_user(kurb->status, &uurb->status) ||
+           __put_user(kurb->actual_length, &uurb->actual_length) ||
+           __put_user(kurb->error_count, &uurb->error_count))
+               return -EFAULT;
+
+       if (kurb->number_of_packets != 0) {
+               int i;
+
+               for (i = 0; i < kurb->number_of_packets; i++) {
+                       if (__put_user(kurb->iso_frame_desc[i].actual_length,
+                                      &uurb->iso_frame_desc[i].actual_length) ||
+                           __put_user(kurb->iso_frame_desc[i].status,
+                                      &uurb->iso_frame_desc[i].status))
+                               return -EFAULT;
+               }
+       }
+
+       return 0;
+}
+
+static int get_urb32_isoframes(struct usbdevfs_urb *kurb,
+                              struct usbdevfs_urb32 *uurb)
+{
+       unsigned int totlen;
+       int i;
+
+       if (kurb->type != USBDEVFS_URB_TYPE_ISO) {
+               kurb->number_of_packets = 0;
+               return 0;
+       }
+
+       if (kurb->number_of_packets < 1 ||
+           kurb->number_of_packets > 128)
+               return -EINVAL;
+
+       if (copy_from_user(&kurb->iso_frame_desc[0],
+                          &uurb->iso_frame_desc[0],
+                          sizeof(struct usbdevfs_iso_packet_desc) *
+                          kurb->number_of_packets))
+               return -EFAULT;
+
+       totlen = 0;
+       for (i = 0; i < kurb->number_of_packets; i++) {
+               unsigned int this_len;
+
+               this_len = kurb->iso_frame_desc[i].length;
+               if (this_len > 1023)
+                       return -EINVAL;
+
+               totlen += this_len;
+       }
+
+       if (totlen > 32768)
+               return -EINVAL;
+
+       kurb->buffer_length = totlen;
+
+       return 0;
+}
+
+static int do_usbdevfs_urb(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+       struct usbdevfs_urb *kurb;
+       struct usbdevfs_urb32 *uurb;
+       mm_segment_t old_fs;
+       __u32 udata;
+       void *uptr, *kptr;
+       unsigned int buflen;
+       int err;
+
+       uurb = (struct usbdevfs_urb32 *) arg;
+
+       err = -ENOMEM;
+       kurb = kmalloc(sizeof(struct usbdevfs_urb) +
+                      (sizeof(struct usbdevfs_iso_packet_desc) * 128),
+                      GFP_KERNEL);
+       if (!kurb)
+               goto out;
+
+       err = -EFAULT;
+       if (get_urb32(kurb, uurb))
+               goto out;
+
+       err = get_urb32_isoframes(kurb, uurb);
+       if (err)
+               goto out;
+
+       err = -EFAULT;
+       if (__get_user(udata, &uurb->buffer))
+               goto out;
+       uptr = (void *) A(udata);
+
+       err = -ENOMEM;
+       buflen = kurb->buffer_length;
+       kptr = kmalloc(buflen, GFP_KERNEL);
+       if (!kptr)
+               goto out;
+
+       kurb->buffer = kptr;
+
+       err = -EFAULT;
+       if (copy_from_user(kptr, uptr, buflen))
+               goto out_kptr;
+
+       old_fs = get_fs();
+       set_fs(KERNEL_DS);
+       err = sys_ioctl(fd, USBDEVFS_SUBMITURB, (unsigned long) kurb);
+       set_fs(old_fs);
+
+       if (err >= 0) {
+               /* XXX Shit, this doesn't work for async URBs :-( XXX */
+               if (put_urb32(kurb, uurb)) {
+                       err = -EFAULT;
+               } else if ((kurb->endpoint & USB_DIR_IN) != 0) {
+                       if (copy_to_user(uptr, kptr, buflen))
+                               err = -EFAULT;
+               }
+       }
+
+out_kptr:
+       kfree(kptr);
+
+out:
+       kfree(kurb);
+       return err;
+}
+#endif
+
+#define USBDEVFS_REAPURB32         _IOW('U', 12, u32)
+#define USBDEVFS_REAPURBNDELAY32   _IOW('U', 13, u32)
+
+static int do_usbdevfs_reapurb(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+       mm_segment_t old_fs;
+       void *kptr;
+       int err;
+
+       old_fs = get_fs();
+       set_fs(KERNEL_DS);
+       err = sys_ioctl(fd,
+                       (cmd == USBDEVFS_REAPURB32 ?
+                        USBDEVFS_REAPURB :
+                        USBDEVFS_REAPURBNDELAY),
+                       (unsigned long) &kptr);
+       set_fs(old_fs);
+
+       if (err >= 0 &&
+           put_user(((u32)(long)kptr), (u32 *) A(arg)))
+               err = -EFAULT;
+
+       return err;
+}
+
+struct usbdevfs_disconnectsignal32 {
+       unsigned int signr;
+       u32 context;
+};
+
+#define USBDEVFS_DISCSIGNAL32      _IOR('U', 14, struct usbdevfs_disconnectsignal32)
+
+static int do_usbdevfs_discsignal(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+       struct usbdevfs_disconnectsignal kdis;
+       struct usbdevfs_disconnectsignal32 *udis;
+       mm_segment_t old_fs;
+       u32 uctx;
+       int err;
+
+       udis = (struct usbdevfs_disconnectsignal32 *) arg;
+
+       if (get_user(kdis.signr, &udis->signr) ||
+           __get_user(uctx, &udis->context))
+               return -EFAULT;
+
+       kdis.context = (void *) (long)uctx;
+
+       old_fs = get_fs();
+       set_fs(KERNEL_DS);
+       err = sys_ioctl(fd, USBDEVFS_DISCSIGNAL, (unsigned long) &kdis);
+       set_fs(old_fs);
+
+       return err;
+}
+
+struct mtd_oob_buf32 {
+       u32 start;
+       u32 length;
+       u32 ptr;        /* unsigned char* */
+};
+
+#define MEMWRITEOOB32  _IOWR('M',3,struct mtd_oob_buf32)
+#define MEMREADOOB32   _IOWR('M',4,struct mtd_oob_buf32)
+
+static inline int 
+mtd_rw_oob(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+       mm_segment_t                    old_fs  = get_fs();
+       struct mtd_oob_buf32    *uarg   = (struct mtd_oob_buf32 *)arg;
+       struct mtd_oob_buf              karg;
+       u32 tmp;
+       char *ptr;
+       int ret;
+
+       if (get_user(karg.start, &uarg->start)          ||
+           get_user(karg.length, &uarg->length)        ||
+           get_user(tmp, &uarg->ptr))
+               return -EFAULT;
+
+       ptr = (char *)A(tmp);
+       if (0 >= karg.length) 
+               return -EINVAL;
+
+       karg.ptr = kmalloc(karg.length, GFP_KERNEL);
+       if (NULL == karg.ptr)
+               return -ENOMEM;
+
+       if (copy_from_user(karg.ptr, ptr, karg.length)) {
+               kfree(karg.ptr);
+               return -EFAULT;
+       }
+
+       set_fs(KERNEL_DS);
+       if (MEMREADOOB32 == cmd) 
+               ret = sys_ioctl(fd, MEMREADOOB, (unsigned long)&karg);
+       else if (MEMWRITEOOB32 == cmd)
+               ret = sys_ioctl(fd, MEMWRITEOOB, (unsigned long)&karg);
+       else
+               ret = -EINVAL;
+       set_fs(old_fs);
+
+       if (0 == ret && cmd == MEMREADOOB32) {
+               ret = copy_to_user(ptr, karg.ptr, karg.length);
+               ret |= put_user(karg.start, &uarg->start);
+               ret |= put_user(karg.length, &uarg->length);
+       }
+
+       kfree(karg.ptr);
+       return ((0 == ret) ? 0 : -EFAULT);
+}      
+
 struct ioctl_trans {
        unsigned int cmd;
        unsigned int handler;
@@ -3744,7 +4195,28 @@ COMPATIBLE_IOCTL(PCIIOC_CONTROLLER)
 COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_IO)
 COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_MEM)
 COMPATIBLE_IOCTL(PCIIOC_WRITE_COMBINE)
+/* USB */
+COMPATIBLE_IOCTL(USBDEVFS_RESETEP)
+COMPATIBLE_IOCTL(USBDEVFS_SETINTERFACE)
+COMPATIBLE_IOCTL(USBDEVFS_SETCONFIGURATION)
+COMPATIBLE_IOCTL(USBDEVFS_GETDRIVER)
+COMPATIBLE_IOCTL(USBDEVFS_DISCARDURB)
+COMPATIBLE_IOCTL(USBDEVFS_CLAIMINTERFACE)
+COMPATIBLE_IOCTL(USBDEVFS_RELEASEINTERFACE)
+COMPATIBLE_IOCTL(USBDEVFS_CONNECTINFO)
+COMPATIBLE_IOCTL(USBDEVFS_HUB_PORTINFO)
+COMPATIBLE_IOCTL(USBDEVFS_RESET)
+COMPATIBLE_IOCTL(USBDEVFS_CLEAR_HALT)
+/* MTD */
+COMPATIBLE_IOCTL(MEMGETINFO)
+COMPATIBLE_IOCTL(MEMERASE)
+COMPATIBLE_IOCTL(MEMLOCK)
+COMPATIBLE_IOCTL(MEMUNLOCK)
+COMPATIBLE_IOCTL(MEMGETREGIONCOUNT)
+COMPATIBLE_IOCTL(MEMGETREGIONINFO)
 /* And these ioctls need translation */
+HANDLE_IOCTL(MEMREADOOB32, mtd_rw_oob)
+HANDLE_IOCTL(MEMWRITEOOB32, mtd_rw_oob)
 HANDLE_IOCTL(SIOCGIFNAME, dev_ifname32)
 HANDLE_IOCTL(SIOCGIFCONF, dev_ifconf)
 HANDLE_IOCTL(SIOCGIFFLAGS, dev_ifsioc)
@@ -3905,6 +4377,12 @@ HANDLE_IOCTL(RTC32_IRQP_SET, do_rtc_ioctl)
 HANDLE_IOCTL(RTC32_EPOCH_READ, do_rtc_ioctl)
 HANDLE_IOCTL(RTC32_EPOCH_SET, do_rtc_ioctl)
 #endif
+HANDLE_IOCTL(USBDEVFS_CONTROL32, do_usbdevfs_control)
+HANDLE_IOCTL(USBDEVFS_BULK32, do_usbdevfs_bulk)
+/*HANDLE_IOCTL(USBDEVFS_SUBMITURB32, do_usbdevfs_urb)*/
+HANDLE_IOCTL(USBDEVFS_REAPURB32, do_usbdevfs_reapurb)
+HANDLE_IOCTL(USBDEVFS_REAPURBNDELAY32, do_usbdevfs_reapurb)
+HANDLE_IOCTL(USBDEVFS_DISCSIGNAL32, do_usbdevfs_discsignal)
 IOCTL_TABLE_END
 
 unsigned int ioctl32_hash_table[1024];
index 1b13e569f68a31de1d31e9952a0a9e99519c5831..ea6e6b713e0fcc329683ffef5244cac139777caa 100644 (file)
@@ -168,8 +168,6 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 
        if ((current->personality == PER_SUNOS && request == PTRACE_SUNATTACH)
            || (current->personality != PER_SUNOS && request == PTRACE_ATTACH)) {
-               unsigned long flags;
-
                if (ptrace_attach(child)) {
                        pt_error_return(regs, EPERM);
                        goto out_tsk;
index 570b3f92a7c23f4fd1503350e7db6afd57b43b03..5f06d3aca3cb64d5710c6748ccc5e4547f49a415 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/spinlock.h>
 #include <linux/timer.h>
 #include <linux/pci.h>
+#include <linux/completion.h>
 #include <asm/io.h>
 #include <asm/segment.h>
 #include <asm/uaccess.h>
@@ -484,14 +485,14 @@ static void DAC960_PD_QueueCommand(DAC960_Command_T *Command)
 static void DAC960_ExecuteCommand(DAC960_Command_T *Command)
 {
   DAC960_Controller_T *Controller = Command->Controller;
-  DECLARE_MUTEX_LOCKED(Semaphore);
+  DECLARE_COMPLETION(Wait);
   unsigned long ProcessorFlags;
-  Command->Semaphore = &Semaphore;
+  Command->Waiting = &Wait;
   DAC960_AcquireControllerLock(Controller, &ProcessorFlags);
   DAC960_QueueCommand(Command);
   DAC960_ReleaseControllerLock(Controller, &ProcessorFlags);
   if (in_interrupt()) return;
-  down(&Semaphore);
+  wait_for_completion(&Wait);
 }
 
 
@@ -1316,7 +1317,7 @@ static boolean DAC960_V1_ReadDeviceConfiguration(DAC960_Controller_T
                                                 *Controller)
 {
   DAC960_V1_DCDB_T DCDBs[DAC960_V1_MaxChannels], *DCDB;
-  Semaphore_T Semaphores[DAC960_V1_MaxChannels], *Semaphore;
+  Completion_T Wait[DAC960_V1_MaxChannels], *wait;
   unsigned long ProcessorFlags;
   int Channel, TargetID;
   for (TargetID = 0; TargetID < Controller->Targets; TargetID++)
@@ -1327,12 +1328,12 @@ static boolean DAC960_V1_ReadDeviceConfiguration(DAC960_Controller_T
          DAC960_SCSI_Inquiry_T *InquiryStandardData =
            &Controller->V1.InquiryStandardData[Channel][TargetID];
          InquiryStandardData->PeripheralDeviceType = 0x1F;
-         Semaphore = &Semaphores[Channel];
-         init_MUTEX_LOCKED(Semaphore);
+         wait = &Wait[Channel];
+         init_completion(wait);
          DCDB = &DCDBs[Channel];
          DAC960_V1_ClearCommand(Command);
          Command->CommandType = DAC960_ImmediateCommand;
-         Command->Semaphore = Semaphore;
+         Command->Waiting = wait;
          Command->V1.CommandMailbox.Type3.CommandOpcode = DAC960_V1_DCDB;
          Command->V1.CommandMailbox.Type3.BusAddress = Virtual_to_Bus32(DCDB);
          DCDB->Channel = Channel;
@@ -1363,11 +1364,11 @@ static boolean DAC960_V1_ReadDeviceConfiguration(DAC960_Controller_T
          DAC960_SCSI_Inquiry_UnitSerialNumber_T *InquiryUnitSerialNumber =
            &Controller->V1.InquiryUnitSerialNumber[Channel][TargetID];
          InquiryUnitSerialNumber->PeripheralDeviceType = 0x1F;
-         Semaphore = &Semaphores[Channel];
-         down(Semaphore);
+         wait = &Wait[Channel];
+         wait_for_completion(wait);
          if (Command->V1.CommandStatus != DAC960_V1_NormalCompletion)
            continue;
-         Command->Semaphore = Semaphore;
+         Command->Waiting = wait;
          DCDB = &DCDBs[Channel];
          DCDB->TransferLength = sizeof(DAC960_SCSI_Inquiry_UnitSerialNumber_T);
          DCDB->BusAddress = Virtual_to_Bus32(InquiryUnitSerialNumber);
@@ -1381,7 +1382,7 @@ static boolean DAC960_V1_ReadDeviceConfiguration(DAC960_Controller_T
          DAC960_AcquireControllerLock(Controller, &ProcessorFlags);
          DAC960_QueueCommand(Command);
          DAC960_ReleaseControllerLock(Controller, &ProcessorFlags);
-         down(Semaphore);
+         wait_for_completion(wait);
        }
     }
   return true;
@@ -2768,7 +2769,7 @@ static boolean DAC960_ProcessRequest(DAC960_Controller_T *Controller,
   if (Request->cmd == READ)
     Command->CommandType = DAC960_ReadCommand;
   else Command->CommandType = DAC960_WriteCommand;
-  Command->Semaphore = Request->sem;
+  Command->Waiting = Request->waiting;
   Command->LogicalDriveNumber = DAC960_LogicalDriveNumber(Request->rq_dev);
   Command->BlockNumber =
     Request->sector
@@ -2924,10 +2925,10 @@ static void DAC960_V1_ProcessCompletedCommand(DAC960_Command_T *Command)
          /*
            Wake up requestor for swap file paging requests.
          */
-         if (Command->Semaphore != NULL)
+         if (Command->Waiting)
            {
-             up(Command->Semaphore);
-             Command->Semaphore = NULL;
+             complete(Command->Waiting);
+             Command->Waiting = NULL;
            }
          add_blkdev_randomness(DAC960_MAJOR + Controller->ControllerNumber);
        }
@@ -2969,13 +2970,10 @@ static void DAC960_V1_ProcessCompletedCommand(DAC960_Command_T *Command)
              DAC960_ProcessCompletedBuffer(BufferHeader, false);
              BufferHeader = NextBufferHeader;
            }
-         /*
-           Wake up requestor for swap file paging requests.
-         */
-         if (Command->Semaphore != NULL)
+         if (Command->Waiting)
            {
-             up(Command->Semaphore);
-             Command->Semaphore = NULL;
+             complete(Command->Waiting);
+             Command->Waiting = NULL;
            }
        }
     }
@@ -3589,8 +3587,8 @@ static void DAC960_V1_ProcessCompletedCommand(DAC960_Command_T *Command)
     }
   if (CommandType == DAC960_ImmediateCommand)
     {
-      up(Command->Semaphore);
-      Command->Semaphore = NULL;
+      complete(Command->Waiting);
+      Command->Waiting = NULL;
       return;
     }
   if (CommandType == DAC960_QueuedCommand)
@@ -3931,13 +3929,10 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command)
              DAC960_ProcessCompletedBuffer(BufferHeader, true);
              BufferHeader = NextBufferHeader;
            }
-         /*
-           Wake up requestor for swap file paging requests.
-         */
-         if (Command->Semaphore != NULL)
+         if (Command->Waiting)
            {
-             up(Command->Semaphore);
-             Command->Semaphore = NULL;
+             complete(Command->Waiting);
+             Command->Waiting = NULL;
            }
          add_blkdev_randomness(DAC960_MAJOR + Controller->ControllerNumber);
        }
@@ -3979,13 +3974,10 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command)
              DAC960_ProcessCompletedBuffer(BufferHeader, false);
              BufferHeader = NextBufferHeader;
            }
-         /*
-           Wake up requestor for swap file paging requests.
-         */
-         if (Command->Semaphore != NULL)
+         if (Command->Waiting)
            {
-             up(Command->Semaphore);
-             Command->Semaphore = NULL;
+             complete(Command->Waiting);
+             Command->Waiting = NULL;
            }
        }
     }
@@ -4539,8 +4531,8 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command)
     }
   if (CommandType == DAC960_ImmediateCommand)
     {
-      up(Command->Semaphore);
-      Command->Semaphore = NULL;
+      complete(Command->Waiting);
+      Command->Waiting = NULL;
       return;
     }
   if (CommandType == DAC960_QueuedCommand)
index ec68e38b7ec38d5860762b12595313dc1b10c9e2..44339b7c2b23a8cd296c432b6305d952dc6c0c0f 100644 (file)
@@ -2153,7 +2153,7 @@ typedef unsigned long ProcessorFlags_T;
 typedef struct pt_regs Registers_T;
 typedef struct request IO_Request_T;
 typedef request_queue_t RequestQueue_T;
-typedef struct semaphore Semaphore_T;
+typedef struct completion Completion_T;
 typedef struct super_block SuperBlock_T;
 typedef struct timer_list Timer_T;
 typedef wait_queue_head_t WaitQueue_T;
@@ -2220,7 +2220,7 @@ typedef struct DAC960_Command
   DAC960_CommandType_T CommandType;
   struct DAC960_Controller *Controller;
   struct DAC960_Command *Next;
-  Semaphore_T *Semaphore;
+  Completion_T *Waiting;
   unsigned int LogicalDriveNumber;
   unsigned int BlockNumber;
   unsigned int BlockCount;
index dc8977570f5b65e84a391362c9d29e804deac96e..6b0c3ee867c3cd3066764c36ea1d0c8d6112927b 100644 (file)
@@ -260,7 +260,9 @@ static ssize_t read_kmem(struct file *file, char *buf,
                        if (len > PAGE_SIZE)
                                len = PAGE_SIZE;
                        len = vread(kbuf, (char *)p, len);
-                       if (len && copy_to_user(buf, kbuf, len)) {
+                       if (!len)
+                               break;
+                       if (copy_to_user(buf, kbuf, len)) {
                                free_page((unsigned long)kbuf);
                                return -EFAULT;
                        }
index 84ca1fad3378025991f10fe3969fccec125d3cec..3d79592d565dd5dd1a74648d8aa1ea5acb6bab01 100644 (file)
@@ -58,9 +58,6 @@ obj-$(CONFIG_ISDN_DRV_HISAX)  += hisax.o
 obj-$(CONFIG_HISAX_SEDLBAUER_CS)       += sedlbauer_cs.o
 obj-$(CONFIG_HISAX_ELSA_CS)    += elsa_cs.o
 
-MD5FILES       := isac.c isdnl1.c isdnl2.c isdnl3.c \
-                  tei.c callc.c cert.c l3dss1.c l3_1tr6.c \
-                  elsa.c diva.c sedlbauer.c
 CERT := $(shell md5sum -c md5sums.asc >> /dev/null;echo $$?)
 CFLAGS_cert.o := -DCERTIFICATION=$(CERT)
 
index a372362c43a5510cfdacc92db91fac53e520f2dc..af7c4e14c477aefc89828b540489990783e2b7a8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: cert.c,v 2.3.6.1 2001/02/16 16:43:25 kai Exp $
+/* $Id: cert.c,v 2.3.6.2 2001/07/27 09:08:27 kai Exp $
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
@@ -20,6 +20,7 @@ certification_check(int output) {
                printk(KERN_INFO "HiSax: Approved with ELSA Microlink PCI cards\n");
                printk(KERN_INFO "HiSax: Approved with Eicon Technology Diva 2.01 PCI cards\n");
                printk(KERN_INFO "HiSax: Approved with Sedlbauer Speedfax + cards\n");
+               printk(KERN_INFO "HiSax: Approved with HFC-S PCI A based cards\n");
        }
        return(0);
 #endif
index 33b1bd104f818805b97d752a74d20e8ddef61194..ab9b6bb740942a6745dc164fae4c28c4b93ff043 100644 (file)
@@ -1,11 +1,12 @@
-/* $Id: hfc_pci.c,v 1.34.6.6 2001/06/09 15:14:17 kai Exp $
+/* $Id: hfc_pci.c,v 1.34.6.7 2001/07/27 09:08:27 kai Exp $
 
  * hfc_pci.c     low level driver for CCD´s hfc-pci based cards
  *
  * Author     Werner Cornelius (werner@isdn4linux.de)
  *            based on existing driver for CCD hfc ISA cards
+ *            type approval valid for HFC-S PCI A based card 
  *
- * Copyright 1999  by Werner Cornelius (werner@isdn4linux.de)
+ * Copyright 1999  by Werner Cornelius (werner@isdn-development.de)
  * Copyright 1999  by Karsten Keil (keil@isdn4linux.de)
  *
  * This program is free software; you can redistribute it and/or modify
@@ -35,7 +36,7 @@
 
 extern const char *CardType[];
 
-static const char *hfcpci_revision = "$Revision: 1.34.6.6 $";
+static const char *hfcpci_revision = "$Revision: 1.34.6.7 $";
 
 /* table entry in the PCI devices list */
 typedef struct {
@@ -1232,7 +1233,7 @@ HFCPCI_l1hw(struct PStack *st, int pr, void *arg)
                        l1_msg(cs, HW_POWERUP | CONFIRM, NULL);
                        break;
                case (HW_ENABLE | REQUEST):
-                       Write_hfc(cs, HFCPCI_STATES, HFCPCI_ACTIVATE | HFCPCI_DO_ACTION);
+                       Write_hfc(cs, HFCPCI_STATES, HFCPCI_DO_ACTION);
                        break;
                case (HW_DEACTIVATE | REQUEST):
                        cs->hw.hfcpci.mst_m &= ~HFCPCI_MASTER;
index f658ab4efd581631e9073c5f15dece1994237900..9e0c2d66f211a1fd32192c50081e1940f4cbbb8f 100644 (file)
@@ -1,10 +1,9 @@
------BEGIN PGP SIGNED MESSAGE-----
-
 # This are valid md5sums for certificated HiSax driver.
 # The certification is valid only if the md5sums of all files match.
 # The certification is valid only for ELSA Microlink PCI,
-# Eicon Technology Diva 2.01 PCI and Sedlbauer SpeedFax+
-# cards in the moment.
+# Eicon Technology Diva 2.01 PCI, Sedlbauer SpeedFax+, 
+# HFC-S PCI A based cards and HFC-S USB based isdn tas 
+# in the moment.
 # Read ../../../Documentation/isdn/HiSax.cert for more informations.
 # 
 6f9433a8b696076562562d090e3c420f  isac.c
@@ -13,11 +12,11 @@ addcff863b0ff1e366c0f2ae9fa6e81e  isdnl2.c
 7076deb94a363945c21ea27aca4a720a  isdnl3.c
 51c603829b6cc4f8421f744ad657ceff  tei.c
 669050ab5079f02887ed0239d86e5474  callc.c
-e592db58630c1f1029cc064110108156  cert.c
+ecacd146b8f8881ef9349935dab3df4a  cert.c
 fadeb3b85bb23bc1ac48470c0848d6fa  l3dss1.c
 cf7dec9fac6283716904d26b99188476  l3_1tr6.c
-65d9e5471bc129624f858ebcf0743525  elsa.c
+2f75c8765e1be13d114d5f4433cf364b  elsa.c
 b4cf8a4dceed9ea6dcba65a85b4eecc7  diva.c
-99e67bea8f6945fa0d4e0aded5bf0fa0  sedlbauer.c
+dee3f8f40c6fe78a4b57729804b7e6cd  sedlbauer.c
+0d79fe6dfc5bfaa4826970c41a6d273d  hfc_pci.c
 # end of md5sums
-
index a89447bcfc1b45e9a2d6d4a3cb57da93d3227267..347ce442ace534fbbd5b04b0672cf63694460357 100644 (file)
@@ -42,7 +42,7 @@
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/ioport.h>
index 123b9d3695828758cc31ecac2d6a33f4bdaa878a..8fcfdc543dcc0fc7d7c0b7c08d8440384accd151 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: isdn_net.c,v 1.140.6.6 2001/06/11 22:08:37 kai Exp $
+/* $Id: isdn_net.c,v 1.140.6.7 2001/07/27 11:15:53 kai Exp $
 
  * Linux ISDN subsystem, network interfaces and related functions (linklevel).
  *
@@ -190,7 +190,7 @@ static int isdn_net_start_xmit(struct sk_buff *, struct net_device *);
 static void isdn_net_ciscohdlck_connected(isdn_net_local *lp);
 static void isdn_net_ciscohdlck_disconnected(isdn_net_local *lp);
 
-char *isdn_net_revision = "$Revision: 1.140.6.6 $";
+char *isdn_net_revision = "$Revision: 1.140.6.7 $";
 
  /*
   * Code for raw-networking over ISDN
@@ -2028,17 +2028,8 @@ isdn_net_init(struct net_device *ndev)
 {
        ushort max_hlhdr_len = 0;
        isdn_net_local *lp = (isdn_net_local *) ndev->priv;
-       int drvidx,
-        i;
+       int drvidx, i;
 
-       if (ndev == NULL) {
-               printk(KERN_WARNING "isdn_net_init: dev = NULL!\n");
-               return -ENODEV;
-       }
-       if (ndev->priv == NULL) {
-               printk(KERN_WARNING "isdn_net_init: dev->priv = NULL!\n");
-               return -ENODEV;
-       }
        ether_setup(ndev);
        lp->org_hhc = ndev->hard_header_cache;
        lp->org_hcu = ndev->header_cache_update;
index 53467f8e2aecec6ab8fa4e9ce5b1b15b608b63d3..fcdcc616af78d887c97355f61c1776f61c1c9f6b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: isdn_ppp.c,v 1.85.6.5 2001/05/26 15:19:56 kai Exp $
+/* $Id: isdn_ppp.c,v 1.85.6.6 2001/07/27 09:08:27 kai Exp $
  *
  * Linux ISDN subsystem, functions for synchronous PPP (linklevel).
  *
@@ -83,7 +83,7 @@ static void isdn_ppp_mp_cleanup( isdn_net_local * lp );
 static int isdn_ppp_bundle(struct ippp_struct *, int unit);
 #endif /* CONFIG_ISDN_MPP */
   
-char *isdn_ppp_revision = "$Revision: 1.85.6.5 $";
+char *isdn_ppp_revision = "$Revision: 1.85.6.6 $";
 
 static struct ippp_struct *ippp_table[ISDN_MAX_CHANNELS];
 
@@ -1913,8 +1913,15 @@ isdn_ppp_hangup_slave(char *name)
        sdev = lp->slave;
        while (sdev) {
                isdn_net_local *mlp = (isdn_net_local *) sdev->priv;
-               if ((mlp->flags & ISDN_NET_CONNECTED))
+
+               if (mlp->slave) { /* find last connected link in chain */
+                       isdn_net_local *nlp = (isdn_net_local *) mlp->slave->priv;
+
+                       if (!(nlp->flags & ISDN_NET_CONNECTED))
+                               break;
+               } else if (mlp->flags & ISDN_NET_CONNECTED)
                        break;
+               
                sdev = mlp->slave;
        }
        if (!sdev)
index df3645e9d8d60a06313101db0fb12b3f76af8930..d0b4baf52e5b162ce0f748ec8ca94f2722648378 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: isdn_tty.c,v 1.94.6.3 2001/07/03 14:48:25 kai Exp $
+/* $Id: isdn_tty.c,v 1.94.6.4 2001/07/27 11:15:53 kai Exp $
 
  * Linux ISDN subsystem, tty functions and AT-command emulator (linklevel).
  *
@@ -66,7 +66,7 @@ static int bit2si[8] =
 static int si2bit[8] =
 {4, 1, 4, 4, 4, 4, 4, 4};
 
-char *isdn_tty_revision = "$Revision: 1.94.6.3 $";
+char *isdn_tty_revision = "$Revision: 1.94.6.4 $";
 
 
 /* isdn_tty_try_read() is called from within isdn_tty_rcv_skb()
@@ -1182,8 +1182,6 @@ isdn_tty_write(struct tty_struct *tty, int from_user, const u_char * buf, int co
 
        if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_write"))
                return 0;
-       if (!tty)
-               return 0;
        if (from_user)
                down(&info->write_sem);
        /* See isdn_tty_senddown() */
index 61935e079ca00eb5f5f85098919da31db7c199c6..5a3b656f6b5e501fd0a13b993d850b93c963553b 100644 (file)
@@ -209,28 +209,23 @@ static void rvfree(void * mem, signed long size) {
 
 /* return a page table pointing to N pages of locked memory */
 static void *ptable_alloc(int npages, u32 *pt_addr) {
-       int i = 0;
+       int i;
        void *vmem;
-       u32 ptable[npages+1];
-       signed long size;
+       u32 *ptable;
        unsigned long adr;
 
-       size = (npages + 1) * PAGE_SIZE;
-       vmem = rvmalloc(size);
+       vmem = rvmalloc((npages + 1) * PAGE_SIZE);
        if (!vmem)
                return NULL;
 
-       memset(ptable, 0, sizeof(ptable));
         adr = (unsigned long)vmem;
-       while (size > 0) {
-               ptable[i++] = virt_to_bus(__va(kvirt_to_pa(adr)));
+       ptable = (u32 *)(vmem + npages * PAGE_SIZE);
+       for (i = 0; i < npages; i++) {
+               ptable[i] = (u32) kvirt_to_bus(adr);
                adr += PAGE_SIZE;
-               size -= PAGE_SIZE;
        }
 
-       memcpy(vmem + npages * PAGE_SIZE, ptable, PAGE_SIZE);
-       *pt_addr = ptable[npages];
-
+       *pt_addr = (u32) kvirt_to_bus(adr);
        return vmem;
 }
 
index 10c28bee236a87579986fadcbcd064e051ecbd82..e30493051324fc1bea939c52a97f72f293516a74 100644 (file)
@@ -29,7 +29,7 @@
 #define _MEYE_PRIV_H_
 
 #define MEYE_DRIVER_MAJORVERSION       1
-#define MEYE_DRIVER_MINORVERSION       0
+#define MEYE_DRIVER_MINORVERSION       1
 
 /****************************************************************************/
 /* Motion JPEG chip registers                                               */
index 54e8dfb746f5171f7468bdcae1ee2dd65984a913..42f737de5fd45d8541be17d59bbe1b59ebc9ebbb 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sunhme.c,v 1.120 2001/06/14 17:37:23 jgarzik Exp $
+/* $Id: sunhme.c,v 1.121 2001/07/27 10:22:57 davem Exp $
  * sunhme.c: Sparc HME/BigMac 10/100baseT half/full duplex auto switching,
  *           auto carrier detecting ethernet driver.  Also known as the
  *           "Happy Meal Ethernet" found on SunSwift SBUS cards.
@@ -32,6 +32,7 @@ static char version[] =
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/ethtool.h>
+#include <linux/mii.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
 #include <asm/io.h>
@@ -569,21 +570,21 @@ static void happy_meal_tcvr_write(struct happy_meal *hp,
  */
 static int try_next_permutation(struct happy_meal *hp, unsigned long tregs)
 {
-       hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+       hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
 
        /* Downgrade from full to half duplex.  Only possible
         * via ethtool.
         */
        if (hp->sw_bmcr & BMCR_FULLDPLX) {
                hp->sw_bmcr &= ~(BMCR_FULLDPLX);
-               happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+               happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
                return 0;
        }
 
        /* Downgrade from 100 to 10. */
        if (hp->sw_bmcr & BMCR_SPEED100) {
                hp->sw_bmcr &= ~(BMCR_SPEED100);
-               happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+               happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
                return 0;
        }
 
@@ -599,7 +600,7 @@ static void display_link_mode(struct happy_meal *hp, unsigned long tregs)
        else
                printk("internal ");
        printk("transceiver at ");
-       hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, DP83840_LPA);
+       hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA);
        if (hp->sw_lpa & (LPA_100HALF | LPA_100FULL)) {
                if (hp->sw_lpa & LPA_100FULL)
                        printk("100Mb/s, Full Duplex.\n");
@@ -621,7 +622,7 @@ static void display_forced_link_mode(struct happy_meal *hp, unsigned long tregs)
        else
                printk("internal ");
        printk("transceiver at ");
-       hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+       hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
        if (hp->sw_bmcr & BMCR_SPEED100)
                printk("100Mb/s, ");
        else
@@ -640,7 +641,7 @@ static int set_happy_link_modes(struct happy_meal *hp, unsigned long tregs)
         * proper duplex setting.
         */
        if (hp->timer_state == arbwait) {
-               hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, DP83840_LPA);
+               hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA);
                if (!(hp->sw_lpa & (LPA_10HALF | LPA_10FULL | LPA_100HALF | LPA_100FULL)))
                        goto no_response;
                if (hp->sw_lpa & LPA_100FULL)
@@ -653,7 +654,7 @@ static int set_happy_link_modes(struct happy_meal *hp, unsigned long tregs)
                        full = 0;
        } else {
                /* Forcing a link mode. */
-               hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+               hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
                if (hp->sw_bmcr & BMCR_FULLDPLX)
                        full = 1;
                else
@@ -728,11 +729,11 @@ static void happy_meal_timer(unsigned long data)
                if (hp->timer_ticks >= 10) {
                        /* Enter force mode. */
        do_force_mode:
-                       hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+                       hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
                        printk(KERN_NOTICE "%s: Auto-Negotiation unsuccessful, trying force link mode\n",
                               hp->dev->name);
                        hp->sw_bmcr = BMCR_SPEED100;
-                       happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+                       happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
 
                        if (!is_lucent_phy(hp)) {
                                /* OK, seems we need do disable the transceiver for the first
@@ -748,7 +749,7 @@ static void happy_meal_timer(unsigned long data)
                        restart_timer = 1;
                } else {
                        /* Anything interesting happen? */
-                       hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, DP83840_BMSR);
+                       hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR);
                        if (hp->sw_bmsr & BMSR_ANEGCOMPLETE) {
                                int ret;
 
@@ -779,7 +780,7 @@ static void happy_meal_timer(unsigned long data)
                 * forever until some sort of error is signalled, reporting
                 * a message to the user at 10 second intervals.
                 */
-               hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, DP83840_BMSR);
+               hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR);
                if (hp->sw_bmsr & BMSR_LSTATUS) {
                        /* Wheee, it's up, display the link mode in use and put
                         * the timer to sleep.
@@ -805,7 +806,7 @@ static void happy_meal_timer(unsigned long data)
                 * permutations, but then again this is essentially
                 * error recovery code for the most part.
                 */
-               hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, DP83840_BMSR);
+               hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR);
                hp->sw_csconfig = happy_meal_tcvr_read(hp, tregs, DP83840_CSCONFIG);
                if (hp->timer_ticks == 1) {
                        if (!is_lucent_phy(hp)) {
@@ -1066,9 +1067,9 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, unsigned long tregs)
                hp->tcvr_type = internal;
                hp->paddr = TCV_PADDR_ITX;
                ASD(("ISOLATE,"));
-               happy_meal_tcvr_write(hp, tregs, DP83840_BMCR,
+               happy_meal_tcvr_write(hp, tregs, MII_BMCR,
                                      (BMCR_LOOPBACK|BMCR_PDOWN|BMCR_ISOLATE));
-               result = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+               result = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
                if (result == TCVR_FAILURE) {
                        ASD(("phyread_fail>\n"));
                        return -1;
@@ -1082,9 +1083,9 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, unsigned long tregs)
                        ASD(("internal<PSELECT,"));
                        hme_write32(hp, tregs + TCVR_CFG, (tconfig | TCV_CFG_PSELECT));
                        ASD(("ISOLATE,"));
-                       happy_meal_tcvr_write(hp, tregs, DP83840_BMCR,
+                       happy_meal_tcvr_write(hp, tregs, MII_BMCR,
                                              (BMCR_LOOPBACK|BMCR_PDOWN|BMCR_ISOLATE));
-                       result = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+                       result = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
                        if (result == TCVR_FAILURE) {
                                ASD(("phyread_fail>\n"));
                                return -1;
@@ -1097,10 +1098,10 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, unsigned long tregs)
        }
 
        ASD(("BMCR_RESET "));
-       happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, BMCR_RESET);
+       happy_meal_tcvr_write(hp, tregs, MII_BMCR, BMCR_RESET);
 
        while (--tries) {
-               result = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+               result = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
                if (result == TCVR_FAILURE)
                        return -1;
                hp->sw_bmcr = result;
@@ -1115,18 +1116,18 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, unsigned long tregs)
        ASD(("RESET_OK\n"));
 
        /* Get fresh copies of the PHY registers. */
-       hp->sw_bmsr      = happy_meal_tcvr_read(hp, tregs, DP83840_BMSR);
-       hp->sw_physid1   = happy_meal_tcvr_read(hp, tregs, DP83840_PHYSID1);
-       hp->sw_physid2   = happy_meal_tcvr_read(hp, tregs, DP83840_PHYSID2);
-       hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, DP83840_ADVERTISE);
+       hp->sw_bmsr      = happy_meal_tcvr_read(hp, tregs, MII_BMSR);
+       hp->sw_physid1   = happy_meal_tcvr_read(hp, tregs, MII_PHYSID1);
+       hp->sw_physid2   = happy_meal_tcvr_read(hp, tregs, MII_PHYSID2);
+       hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE);
 
        ASD(("UNISOLATE"));
        hp->sw_bmcr &= ~(BMCR_ISOLATE);
-       happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+       happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
 
        tries = TCVR_UNISOLATE_TRIES;
        while (--tries) {
-               result = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+               result = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
                if (result == TCVR_FAILURE)
                        return -1;
                if (!(result & BMCR_ISOLATE))
@@ -1350,14 +1351,14 @@ static void happy_meal_begin_auto_negotiation(struct happy_meal *hp,
        int timeout;
 
        /* Read all of the registers we are interested in now. */
-       hp->sw_bmsr      = happy_meal_tcvr_read(hp, tregs, DP83840_BMSR);
-       hp->sw_bmcr      = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
-       hp->sw_physid1   = happy_meal_tcvr_read(hp, tregs, DP83840_PHYSID1);
-       hp->sw_physid2   = happy_meal_tcvr_read(hp, tregs, DP83840_PHYSID2);
+       hp->sw_bmsr      = happy_meal_tcvr_read(hp, tregs, MII_BMSR);
+       hp->sw_bmcr      = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
+       hp->sw_physid1   = happy_meal_tcvr_read(hp, tregs, MII_PHYSID1);
+       hp->sw_physid2   = happy_meal_tcvr_read(hp, tregs, MII_PHYSID2);
 
        /* XXX Check BMSR_ANEGCAPABLE, should not be necessary though. */
 
-       hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, DP83840_ADVERTISE);
+       hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE);
        if (ep == NULL || ep->autoneg == AUTONEG_ENABLE) {
                /* Advertise everything we can support. */
                if (hp->sw_bmsr & BMSR_10HALF)
@@ -1377,7 +1378,7 @@ static void happy_meal_begin_auto_negotiation(struct happy_meal *hp,
                        hp->sw_advertise |= (ADVERTISE_100FULL);
                else
                        hp->sw_advertise &= ~(ADVERTISE_100FULL);
-               happy_meal_tcvr_write(hp, tregs, DP83840_ADVERTISE, hp->sw_advertise);
+               happy_meal_tcvr_write(hp, tregs, MII_ADVERTISE, hp->sw_advertise);
 
                /* XXX Currently no Happy Meal cards I know off support 100BaseT4,
                 * XXX and this is because the DP83840 does not support it, changes
@@ -1399,17 +1400,17 @@ static void happy_meal_begin_auto_negotiation(struct happy_meal *hp,
 
                /* Enable Auto-Negotiation, this is usually on already... */
                hp->sw_bmcr |= BMCR_ANENABLE;
-               happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+               happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
 
                /* Restart it to make sure it is going. */
                hp->sw_bmcr |= BMCR_ANRESTART;
-               happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+               happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
 
                /* BMCR_ANRESTART self clears when the process has begun. */
 
                timeout = 64;  /* More than enough. */
                while (--timeout) {
-                       hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+                       hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
                        if (!(hp->sw_bmcr & BMCR_ANRESTART))
                                break; /* got it. */
                        udelay(10);
@@ -1443,7 +1444,7 @@ force_link:
                        if (ep->duplex == DUPLEX_FULL)
                                hp->sw_bmcr |= BMCR_FULLDPLX;
                }
-               happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+               happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
 
                if (!is_lucent_phy(hp)) {
                        /* OK, seems we need do disable the transceiver for the first
@@ -1782,8 +1783,8 @@ static void happy_meal_set_initial_advertisement(struct happy_meal *hp)
                return;
 
        /* Latch PHY registers as of now. */
-       hp->sw_bmsr      = happy_meal_tcvr_read(hp, tregs, DP83840_BMSR);
-       hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, DP83840_ADVERTISE);
+       hp->sw_bmsr      = happy_meal_tcvr_read(hp, tregs, MII_BMSR);
+       hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE);
 
        /* Advertise everything we can support. */
        if (hp->sw_bmsr & BMSR_10HALF)
@@ -1805,7 +1806,7 @@ static void happy_meal_set_initial_advertisement(struct happy_meal *hp)
                hp->sw_advertise &= ~(ADVERTISE_100FULL);
 
        /* Update the PHY advertisement register. */
-       happy_meal_tcvr_write(hp, tregs, DP83840_ADVERTISE, hp->sw_advertise);
+       happy_meal_tcvr_write(hp, tregs, MII_ADVERTISE, hp->sw_advertise);
 }
 
 /* Once status is latched (by happy_meal_interrupt) it is cleared by
@@ -1929,8 +1930,8 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp)
        unsigned long tregs = hp->tcvregs;
 
        printk(KERN_INFO "%s: Link status change.\n", hp->dev->name);
-       hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
-       hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, DP83840_LPA);
+       hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
+       hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA);
 
        /* Use the fastest transmission protocol possible. */
        if (hp->sw_lpa & LPA_100FULL) {
@@ -1945,7 +1946,7 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp)
        } else {
                printk(KERN_INFO "%s: Using 10Mbps at half duplex.", hp->dev->name);
        }
-       happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+       happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
 
        /* Finally stop polling and shut up the MIF. */
        happy_meal_poll_stop(hp, tregs);
@@ -2458,8 +2459,8 @@ static int happy_meal_ioctl(struct net_device *dev,
                ecmd.phy_address = 0; /* XXX fixed PHYAD */
 
                /* Record PHY settings. */
-               hp->sw_bmcr = happy_meal_tcvr_read(hp, hp->tcvregs, DP83840_BMCR);
-               hp->sw_lpa = happy_meal_tcvr_read(hp, hp->tcvregs, DP83840_LPA);
+               hp->sw_bmcr = happy_meal_tcvr_read(hp, hp->tcvregs, MII_BMCR);
+               hp->sw_lpa = happy_meal_tcvr_read(hp, hp->tcvregs, MII_LPA);
                if (hp->sw_bmcr & BMCR_ANENABLE) {
                        ecmd.autoneg = AUTONEG_ENABLE;
                        ecmd.speed =
index 14bad795ee6a8cb59d710b644deb3ba76bfe9416..826359e484fac216cf21069577d727af4a131149 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: cgfourteenfb.c,v 1.9 2001/02/13 01:17:14 davem Exp $
+/* $Id: cgfourteenfb.c,v 1.10 2001/07/27 09:44:00 davem Exp $
  * cgfourteenfb.c: CGfourteen frame buffer driver
  *
  * Copyright (C) 1996,1998 Jakub Jelinek (jj@ultra.linux.cz)
@@ -243,6 +243,11 @@ static void cg14_setcursor (struct fb_info_sbusfb *fb)
 
                tmp |= CG14_CCR_ENABLE;
                sbus_writeb(tmp, &cur->ccr);
+       } else {
+               u8 tmp = sbus_readb(&cur->ccr);
+
+               tmp &= ~CG14_CCR_ENABLE;
+               sbus_writeb(tmp, &cur->ccr);
        }
        sbus_writew(((c->cpos.fbx - c->chot.fbx) & 0xfff), &cur->cursx);
        sbus_writew(((c->cpos.fby - c->chot.fby) & 0xfff), &cur->cursy);
index 952e79b0147cc8f4d9bc3690c5f3ea3e7ffdf33a..52e626ab8459abf8bf65b3c292f3c3407249db25 100644 (file)
@@ -84,6 +84,14 @@ static char __attribute__ ((unused))
 #endif
 }
 
+#define MSDOS_LABEL_MAGIC1     0x55
+#define MSDOS_LABEL_MAGIC2     0xAA
+
+static inline int
+msdos_magic_present(unsigned char *p) {
+       return (p[0] == MSDOS_LABEL_MAGIC1 && p[1] == MSDOS_LABEL_MAGIC2);
+}
+
 /*
  * Create devices for each logical partition in an extended partition.
  * The logical partitions form a linked list, with each entry being
@@ -118,10 +126,10 @@ static void extended_partition(struct gendisk *hd, kdev_t dev)
                if (!(bh = bread(dev,0,get_ptable_blocksize(dev))))
                        return;
 
-               if ((*(__u16 *) (bh->b_data+510)) != cpu_to_le16(MSDOS_LABEL_MAGIC))
+               if (!msdos_magic_present(bh->b_data + 510))
                        goto done;
 
-               p = (struct partition *) (0x1BE + bh->b_data);
+               p = (struct partition *) (bh->b_data + 0x1be);
 
                this_size = hd->part[MINOR(dev)].nr_sects;
 
@@ -399,7 +407,7 @@ static void minix_partition(struct gendisk *hd, int minor)
        /* The first sector of a Minix partition can have either
         * a secondary MBR describing its subpartitions, or
         * the normal boot sector. */
-       if ((*(__u16 *) (bh->b_data + 510)) != cpu_to_le16(MSDOS_LABEL_MAGIC) &&
+       if (msdos_magic_present (bh->b_data + 510) &&
            SYS_IND(p) == MINIX_PARTITION) { /* subpartition table present */
 
                printk(" %s: <minix:", partition_name(hd, minor, buf));
@@ -441,11 +449,11 @@ read_mbr:
 check_table:
 #endif /* CONFIG_BLK_DEV_IDE */
        /* Use bforget(), because we may have changed the disk geometry */
-       if (*(unsigned short *)  (0x1fe + data) != cpu_to_le16(MSDOS_LABEL_MAGIC)) {
+       if (!msdos_magic_present(data + 510)) {
                bforget(bh);
                return 0;
        }
-       p = (struct partition *) (0x1be + data);
+       p = (struct partition *) (data + 0x1be);
 
 #ifdef CONFIG_BLK_DEV_IDE
        if (!tested_for_xlate++) {      /* Do this only once per disk */
@@ -542,7 +550,7 @@ check_table:
        /*
         *  Check for old-style Disk Manager partition table
         */
-       if (*(unsigned short *) (data+0xfc) == cpu_to_le16(MSDOS_LABEL_MAGIC)) {
+       if (msdos_magic_present(data + 0xfc)) {
                p = (struct partition *) (0x1be + data);
                for (i = 4 ; i < 16 ; i++, current_minor++) {
                        p--;
index a5e7361e4f88ef189b6fd41741a660bc136b30e2..bc8421d5e5ff4380e182dd871bf78b7cc27db425 100644 (file)
@@ -12,7 +12,6 @@ int save_i387_soft(void *s387, struct _fpstate * buf);
    */
 struct info {
        long ___orig_eip;
-       long ___ret_from_system_call;
        long ___ebx;
        long ___ecx;
        long ___edx;
index 4bf8d607b906beabdbb5f225eb44e9fbf8df6f47..2e4cf1762073f26dd092e8ffc4244658f320a669 100644 (file)
 #define local_bh_enable()                                              \
 do {                                                                   \
        unsigned int *ptr = &local_bh_count(smp_processor_id());        \
+       unsigned long flags;                                            \
                                                                        \
+       __save_flags(flags);                                            \
+       if (!(flags & (1 << 9)))                                        \
+               BUG();                                                  \
        barrier();                                                      \
        if (!--*ptr)                                                    \
                __asm__ __volatile__ (                                  \
index e75775f853bee5e2e56152d622abef441837d049..40eaa82244ac41d67e9ef938db8a8687015111ea 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bitops.h,v 1.63 2001/07/17 16:17:33 anton Exp $
+/* $Id: bitops.h,v 1.64 2001/07/18 13:48:23 anton Exp $
  * bitops.h: Bit string operations on the Sparc.
  *
  * Copyright 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -25,22 +25,36 @@ static __inline__ int test_and_set_bit(unsigned long nr, volatile void *addr)
 {
        register unsigned long mask asm("g2");
        register unsigned long *ADDR asm("g1");
+
        ADDR = ((unsigned long *) addr) + (nr >> 5);
        mask = 1 << (nr & 31);
+
        __asm__ __volatile__("
        mov     %%o7, %%g4
        call    ___set_bit
         add    %%o7, 8, %%o7
 "      : "=&r" (mask)
        : "0" (mask), "r" (ADDR)
-       : "g3", "g4", "g5", "g7", "cc");
+       : "g3", "g4", "g5", "g7", "memory", "cc");
 
        return mask != 0;
 }
 
 static __inline__ void set_bit(unsigned long nr, volatile void *addr)
 {
-       (void) test_and_set_bit(nr, addr);
+       register unsigned long mask asm("g2");
+       register unsigned long *ADDR asm("g1");
+
+       ADDR = ((unsigned long *) addr) + (nr >> 5);
+       mask = 1 << (nr & 31);
+
+       __asm__ __volatile__("
+       mov     %%o7, %%g4
+       call    ___set_bit
+        add    %%o7, 8, %%o7
+"      : "=&r" (mask)
+       : "0" (mask), "r" (ADDR)
+       : "g3", "g4", "g5", "g7", "cc");
 }
 
 static __inline__ int test_and_clear_bit(unsigned long nr, volatile void *addr)
@@ -50,20 +64,33 @@ static __inline__ int test_and_clear_bit(unsigned long nr, volatile void *addr)
 
        ADDR = ((unsigned long *) addr) + (nr >> 5);
        mask = 1 << (nr & 31);
+
        __asm__ __volatile__("
        mov     %%o7, %%g4
        call    ___clear_bit
         add    %%o7, 8, %%o7
 "      : "=&r" (mask)
        : "0" (mask), "r" (ADDR)
-       : "g3", "g4", "g5", "g7", "cc");
+       : "g3", "g4", "g5", "g7", "memory", "cc");
 
        return mask != 0;
 }
 
 static __inline__ void clear_bit(unsigned long nr, volatile void *addr)
 {
-       (void) test_and_clear_bit(nr, addr);
+       register unsigned long mask asm("g2");
+       register unsigned long *ADDR asm("g1");
+
+       ADDR = ((unsigned long *) addr) + (nr >> 5);
+       mask = 1 << (nr & 31);
+
+       __asm__ __volatile__("
+       mov     %%o7, %%g4
+       call    ___clear_bit
+        add    %%o7, 8, %%o7
+"      : "=&r" (mask)
+       : "0" (mask), "r" (ADDR)
+       : "g3", "g4", "g5", "g7", "cc");
 }
 
 static __inline__ int test_and_change_bit(unsigned long nr, volatile void *addr)
@@ -73,20 +100,33 @@ static __inline__ int test_and_change_bit(unsigned long nr, volatile void *addr)
 
        ADDR = ((unsigned long *) addr) + (nr >> 5);
        mask = 1 << (nr & 31);
+
        __asm__ __volatile__("
        mov     %%o7, %%g4
        call    ___change_bit
         add    %%o7, 8, %%o7
 "      : "=&r" (mask)
        : "0" (mask), "r" (ADDR)
-       : "g3", "g4", "g5", "g7", "cc");
+       : "g3", "g4", "g5", "g7", "memory", "cc");
 
        return mask != 0;
 }
 
 static __inline__ void change_bit(unsigned long nr, volatile void *addr)
 {
-       (void) test_and_change_bit(nr, addr);
+       register unsigned long mask asm("g2");
+       register unsigned long *ADDR asm("g1");
+
+       ADDR = ((unsigned long *) addr) + (nr >> 5);
+       mask = 1 << (nr & 31);
+
+       __asm__ __volatile__("
+       mov     %%o7, %%g4
+       call    ___change_bit
+        add    %%o7, 8, %%o7
+"      : "=&r" (mask)
+       : "0" (mask), "r" (ADDR)
+       : "g3", "g4", "g5", "g7", "cc");
 }
 
 /*
index 3fd98287a0936be088bc795c29e8ae72019a1668..1c45c2cb363720c576a13698bb687f4eb07dc50e 100644 (file)
@@ -14,9 +14,7 @@ typedef struct elevator_s elevator_t;
 
 /*
  * Ok, this is an expanded form so that we can use the same
- * request for paging requests when that is implemented. In
- * paging, 'bh' is NULL, and the completion is used to wait
- * for the IO to be ready.
+ * request for paging requests.
  */
 struct request {
        struct list_head queue;
@@ -184,7 +182,7 @@ extern atomic_t queued_sectors;
 #define PageAlignSize(size) (((size) + PAGE_SIZE -1) & PAGE_MASK)
 
 /* read-ahead in pages.. */
-#define MAX_READAHEAD  31
+#define MAX_READAHEAD  127
 #define MIN_READAHEAD  3
 
 #define blkdev_entry_to_request(entry) list_entry((entry), struct request, queue)
index 5e8c520f42bf064e07d2feb9fb769ddff6ca7da3..d5e7e9acf99ce966e0049ac558bbcd339025b2ff 100644 (file)
@@ -118,7 +118,7 @@ struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data }
 enum
 {
        TASKLET_STATE_SCHED,    /* Tasklet is scheduled for execution */
-       TASKLET_STATE_RUN       /* Tasklet is running */
+       TASKLET_STATE_RUN       /* Tasklet is running (SMP only) */
 };
 
 struct tasklet_head
@@ -129,34 +129,68 @@ struct tasklet_head
 extern struct tasklet_head tasklet_vec[NR_CPUS];
 extern struct tasklet_head tasklet_hi_vec[NR_CPUS];
 
-#define tasklet_trylock(t) (!test_and_set_bit(TASKLET_STATE_RUN, &(t)->state))
-#define tasklet_unlock(t) do { smp_mb__before_clear_bit(); clear_bit(TASKLET_STATE_RUN, &(t)->state); } while(0)
-#define tasklet_unlock_wait(t) while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); }
+#ifdef CONFIG_SMP
+static inline int tasklet_trylock(struct tasklet_struct *t)
+{
+       return !test_and_set_bit(TASKLET_STATE_RUN, &(t)->state);
+}
+
+static inline void tasklet_unlock(struct tasklet_struct *t)
+{
+       smp_mb__before_clear_bit(); 
+       clear_bit(TASKLET_STATE_RUN, &(t)->state);
+}
+
+static inline void tasklet_unlock_wait(struct tasklet_struct *t)
+{
+       while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); }
+}
+#else
+#define tasklet_trylock(t) 1
+#define tasklet_unlock_wait(t) do { } while (0)
+#define tasklet_unlock(t) do { } while (0)
+#endif
+
+extern void FASTCALL(__tasklet_schedule(struct tasklet_struct *t));
+
+static inline void tasklet_schedule(struct tasklet_struct *t)
+{
+       if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
+               __tasklet_schedule(t);
+}
+
+extern void FASTCALL(__tasklet_hi_schedule(struct tasklet_struct *t));
+
+static inline void tasklet_hi_schedule(struct tasklet_struct *t)
+{
+       if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
+               __tasklet_hi_schedule(t);
+}
 
-extern void tasklet_schedule(struct tasklet_struct *t);
-extern void tasklet_hi_schedule(struct tasklet_struct *t);
 
 static inline void tasklet_disable_nosync(struct tasklet_struct *t)
 {
        atomic_inc(&t->count);
+       smp_mb__after_atomic_inc();
 }
 
 static inline void tasklet_disable(struct tasklet_struct *t)
 {
        tasklet_disable_nosync(t);
        tasklet_unlock_wait(t);
+       smp_mb();
 }
 
 static inline void tasklet_enable(struct tasklet_struct *t)
 {
-       if (atomic_dec_and_test(&t->count))
-               tasklet_schedule(t);
+       smp_mb__before_atomic_dec();
+       atomic_dec(&t->count);
 }
 
 static inline void tasklet_hi_enable(struct tasklet_struct *t)
 {
-       if (atomic_dec_and_test(&t->count))
-               tasklet_hi_schedule(t);
+       smp_mb__before_atomic_dec();
+       atomic_dec(&t->count);
 }
 
 extern void tasklet_kill(struct tasklet_struct *t);
index be785d31c96f0ad3e6cfe410e788a98b95a7e36d..943913583deaaffb93c7dac9e45985a8f1fba3f9 100644 (file)
@@ -2,7 +2,7 @@
  * linux/mii.h: definitions for MII-compatible transceivers
  * Originally drivers/net/sunhme.h.
  *
- * Copyright (C) 1996, 1999 David S. Miller (davem@redhat.com)
+ * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com)
  */
 
 #ifndef __LINUX_MII_H__
 
 #include <linux/types.h>
 
-/* Inside the Happy Meal transceiver is the physical layer, they use an
- * implementations for National Semiconductor, part number DP83840VCE.
- * You can retrieve the data sheets and programming docs for this beast
- * from http://www.national.com/
- *
- * The DP83840 is capable of both 10 and 100Mbps ethernet, in both
- * half and full duplex mode.  It also supports auto negotiation.
- *
- * But.... THIS THING IS A PAIN IN THE ASS TO PROGRAM!
- * Debugging eeprom burnt code is more fun than programming this chip!
- */
+/* Generic MII registers. */
 
-/* First, the MII register numbers (actually DP83840 register numbers). */
 #define MII_BMCR            0x00        /* Basic mode control register */
 #define MII_BMSR            0x01        /* Basic mode status register  */
 #define MII_PHYSID1         0x02        /* PHYS ID 1                   */
 #define MII_NWAYTEST        0x14        /* N-way auto-neg test reg     */
 #define MII_RERRCOUNTER     0x15        /* Receive error counter       */
 #define MII_SREVISION       0x16        /* Silicon revision            */
-#define MII_CSCONFIG        0x17        /* CS configuration            */
+#define MII_RESV1           0x17        /* Reserved...                 */
 #define MII_LBRERROR        0x18        /* Lpback, rx, bypass error    */
 #define MII_PHYADDR         0x19        /* PHY address                 */
-#define MII_RESERVED        0x1a        /* Unused...                   */
+#define MII_RESV2           0x1a        /* Reserved...                 */
 #define MII_TPISTATUS       0x1b        /* TPI status for 10mbps       */
 #define MII_NCONFIG         0x1c        /* Network interface config    */
 
 #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_LED4           0x0002  /* Pin for full-dplx LED4      */
-#define CSCONFIG_LED1           0x0004  /* Pin for conn-status LED1    */
-#define CSCONFIG_RESV2          0x0008  /* Unused...                   */
-#define CSCONFIG_TCVDISAB       0x0010  /* Turns off the transceiver   */
-#define CSCONFIG_DFBYPASS       0x0020  /* Bypass disconnect function  */
-#define CSCONFIG_GLFORCE        0x0040  /* Good link force for 100mbps */
-#define CSCONFIG_CLKTRISTATE    0x0080  /* Tristate 25m clock          */
-#define CSCONFIG_RESV3          0x0700  /* Unused...                   */
-#define CSCONFIG_ENCODE         0x0800  /* 1=MLT-3, 0=binary           */
-#define CSCONFIG_RENABLE        0x1000  /* Repeater mode enable        */
-#define CSCONFIG_TCDISABLE      0x2000  /* Disable timeout counter     */
-#define CSCONFIG_RESV4          0x4000  /* Unused...                   */
-#define CSCONFIG_NDISABLE       0x8000  /* Disable NRZI                */
-
-
 /* This structure is used in all SIOCxMIIxxx ioctl calls */
 struct mii_ioctl_data {
        u16             phy_id;
index 090f05fe7951904f5d6ee9674f9639311019c369..a00adf046d5066fdd88e30c2673399c548c96774 100644 (file)
@@ -298,7 +298,6 @@ struct net_device
 
        /* Interface address info. */
        unsigned char           broadcast[MAX_ADDR_LEN];        /* hw bcast add */
-       unsigned char           pad;            /* make dev_addr aligned to 8 bytes */
        unsigned char           dev_addr[MAX_ADDR_LEN]; /* hw address   */
        unsigned char           addr_len;       /* hardware address length      */
 
index fb48227816b9025a0cc48a6b3ff0cc948a911c76..9e2f6468c63c6587f8a4a00f437ca9c118e60cbf 100644 (file)
@@ -41,7 +41,7 @@ struct parport_pc_private {
        struct pci_dev *dev;
 };
 
-static __inline__ void parport_pc_write_data(struct parport *p, unsigned char d)
+extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char d)
 {
 #ifdef DEBUG_PARPORT
        printk (KERN_DEBUG "parport_pc_write_data(%p,0x%02x)\n", p, d);
@@ -49,7 +49,7 @@ static __inline__ void parport_pc_write_data(struct parport *p, unsigned char d)
        outb(d, DATA(p));
 }
 
-static __inline__ unsigned char parport_pc_read_data(struct parport *p)
+extern __inline__ unsigned char parport_pc_read_data(struct parport *p)
 {
        unsigned char val = inb (DATA (p));
 #ifdef DEBUG_PARPORT
@@ -60,7 +60,7 @@ static __inline__ unsigned char parport_pc_read_data(struct parport *p)
 }
 
 #ifdef DEBUG_PARPORT
-static __inline__ void dump_parport_state (char *str, struct parport *p)
+extern __inline__ void dump_parport_state (char *str, struct parport *p)
 {
        /* here's hoping that reading these ports won't side-effect anything underneath */
        unsigned char ecr = inb (ECONTROL (p));
@@ -124,17 +124,17 @@ static __inline__ unsigned char __parport_pc_frob_control (struct parport *p,
        return ctr;
 }
 
-static __inline__ void parport_pc_data_reverse (struct parport *p)
+extern __inline__ void parport_pc_data_reverse (struct parport *p)
 {
        __parport_pc_frob_control (p, 0x20, 0x20);
 }
 
-static __inline__ void parport_pc_data_forward (struct parport *p)
+extern __inline__ void parport_pc_data_forward (struct parport *p)
 {
        __parport_pc_frob_control (p, 0x20, 0x00);
 }
 
-static __inline__ void parport_pc_write_control (struct parport *p,
+extern __inline__ void parport_pc_write_control (struct parport *p,
                                                 unsigned char d)
 {
        const unsigned char wm = (PARPORT_CONTROL_STROBE |
@@ -152,7 +152,7 @@ static __inline__ void parport_pc_write_control (struct parport *p,
        __parport_pc_frob_control (p, wm, d & wm);
 }
 
-static __inline__ unsigned char parport_pc_read_control(struct parport *p)
+extern __inline__ unsigned char parport_pc_read_control(struct parport *p)
 {
        const unsigned char rm = (PARPORT_CONTROL_STROBE |
                                  PARPORT_CONTROL_AUTOFD |
@@ -162,7 +162,7 @@ static __inline__ unsigned char parport_pc_read_control(struct parport *p)
        return priv->ctr & rm; /* Use soft copy */
 }
 
-static __inline__ unsigned char parport_pc_frob_control (struct parport *p,
+extern __inline__ unsigned char parport_pc_frob_control (struct parport *p,
                                                         unsigned char mask,
                                                         unsigned char val)
 {
@@ -189,18 +189,18 @@ static __inline__ unsigned char parport_pc_frob_control (struct parport *p,
        return __parport_pc_frob_control (p, mask, val);
 }
 
-static __inline__ unsigned char parport_pc_read_status(struct parport *p)
+extern __inline__ unsigned char parport_pc_read_status(struct parport *p)
 {
        return inb(STATUS(p));
 }
 
 
-static __inline__ void parport_pc_disable_irq(struct parport *p)
+extern __inline__ void parport_pc_disable_irq(struct parport *p)
 {
        __parport_pc_frob_control (p, 0x10, 0x00);
 }
 
-static __inline__ void parport_pc_enable_irq(struct parport *p)
+extern __inline__ void parport_pc_enable_irq(struct parport *p)
 {
        __parport_pc_frob_control (p, 0x10, 0x10);
 }
index 6eb9bc55a2768e22adf5fc33677fedfc20e2b4c2..b1ad6fb90dbd7a831cfe84597469acb031fe515a 100644 (file)
@@ -543,8 +543,8 @@ EXPORT_SYMBOL(__run_task_queue);
 EXPORT_SYMBOL(do_softirq);
 EXPORT_SYMBOL(raise_softirq);
 EXPORT_SYMBOL(cpu_raise_softirq);
-EXPORT_SYMBOL(tasklet_schedule);
-EXPORT_SYMBOL(tasklet_hi_schedule);
+EXPORT_SYMBOL(__tasklet_schedule);
+EXPORT_SYMBOL(__tasklet_hi_schedule);
 
 /* init task, for moving kthread roots - ought to export a function ?? */
 
index fa94305456b5b99979a978ccac183e281be419d7..3737fa91fb4f93af3a65fa05c6b18335f553bdec 100644 (file)
@@ -140,41 +140,29 @@ void open_softirq(int nr, void (*action)(struct softirq_action*), void *data)
 /* Tasklets */
 
 struct tasklet_head tasklet_vec[NR_CPUS] __cacheline_aligned;
+struct tasklet_head tasklet_hi_vec[NR_CPUS] __cacheline_aligned;
 
-void tasklet_schedule(struct tasklet_struct *t)
+void __tasklet_schedule(struct tasklet_struct *t)
 {
+       int cpu = smp_processor_id();
        unsigned long flags;
-       int cpu;
 
-       cpu = smp_processor_id();
        local_irq_save(flags);
-       /*
-        * If nobody is running it then add it to this CPU's
-        * tasklet queue.
-        */
-       if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) {
-               t->next = tasklet_vec[cpu].list;
-               tasklet_vec[cpu].list = t;
-               cpu_raise_softirq(cpu, TASKLET_SOFTIRQ);
-               tasklet_unlock(t);
-       }
+       t->next = tasklet_vec[cpu].list;
+       tasklet_vec[cpu].list = t;
+       cpu_raise_softirq(cpu, TASKLET_SOFTIRQ);
        local_irq_restore(flags);
 }
 
-void tasklet_hi_schedule(struct tasklet_struct *t)
+void __tasklet_hi_schedule(struct tasklet_struct *t)
 {
+       int cpu = smp_processor_id();
        unsigned long flags;
-       int cpu;
 
-       cpu = smp_processor_id();
        local_irq_save(flags);
-
-       if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) {
-               t->next = tasklet_hi_vec[cpu].list;
-               tasklet_hi_vec[cpu].list = t;
-               cpu_raise_softirq(cpu, HI_SOFTIRQ);
-               tasklet_unlock(t);
-       }
+       t->next = tasklet_hi_vec[cpu].list;
+       tasklet_hi_vec[cpu].list = t;
+       cpu_raise_softirq(cpu, HI_SOFTIRQ);
        local_irq_restore(flags);
 }
 
@@ -193,29 +181,25 @@ static void tasklet_action(struct softirq_action *a)
 
                list = list->next;
 
-               if (!tasklet_trylock(t))
-                       BUG();
-               if (!atomic_read(&t->count)) {
-                       if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
-                               BUG();
-                       t->func(t->data);
+               if (tasklet_trylock(t)) {
+                       if (!atomic_read(&t->count)) {
+                               if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
+                                       BUG();
+                               t->func(t->data);
+                               tasklet_unlock(t);
+                               continue;
+                       }
                        tasklet_unlock(t);
-                       continue;
                }
-               tasklet_unlock(t);
 
                local_irq_disable();
                t->next = tasklet_vec[cpu].list;
                tasklet_vec[cpu].list = t;
-               cpu_raise_softirq(cpu, TASKLET_SOFTIRQ);
                local_irq_enable();
+               __cpu_raise_softirq(cpu, TASKLET_SOFTIRQ);
        }
 }
 
-
-
-struct tasklet_head tasklet_hi_vec[NR_CPUS] __cacheline_aligned;
-
 static void tasklet_hi_action(struct softirq_action *a)
 {
        int cpu = smp_processor_id();
@@ -231,22 +215,22 @@ static void tasklet_hi_action(struct softirq_action *a)
 
                list = list->next;
 
-               if (!tasklet_trylock(t))
-                       BUG();
-               if (!atomic_read(&t->count)) {
-                       if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
-                               BUG();
-                       t->func(t->data);
+               if (tasklet_trylock(t)) {
+                       if (!atomic_read(&t->count)) {
+                               if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
+                                       BUG();
+                               t->func(t->data);
+                               tasklet_unlock(t);
+                               continue;
+                       }
                        tasklet_unlock(t);
-                       continue;
                }
-               tasklet_unlock(t);
 
                local_irq_disable();
                t->next = tasklet_hi_vec[cpu].list;
                tasklet_hi_vec[cpu].list = t;
-               cpu_raise_softirq(cpu, HI_SOFTIRQ);
                local_irq_enable();
+               __cpu_raise_softirq(cpu, HI_SOFTIRQ);
        }
 }
 
index a8df2173cfed51fcdd85a328ab627a5fd14f1e57..2a7f832b8b34117f9397c7297a2d15efc58c5af4 100644 (file)
@@ -903,7 +903,6 @@ void __init free_area_init_core(int nid, pg_data_t *pgdat, struct page **gmap,
                }
 
                offset += size;
-               mask = -1;
                for (i = 0; ; i++) {
                        unsigned long bitmap_size;
 
@@ -912,11 +911,32 @@ void __init free_area_init_core(int nid, pg_data_t *pgdat, struct page **gmap,
                                zone->free_area[i].map = NULL;
                                break;
                        }
-                       mask += mask;
-                       size = (size + ~mask) & mask;
-                       bitmap_size = size >> (i+1);
-                       bitmap_size = (bitmap_size + 7) >> 3;
-                       bitmap_size = LONG_ALIGN(bitmap_size);
+
+                       /*
+                        * Page buddy system uses "index >> (i+1)",
+                        * where "index" is at most "size-1".
+                        *
+                        * The extra "+3" is to round down to byte
+                        * size (8 bits per byte assumption). Thus
+                        * we get "(size-1) >> (i+4)" as the last byte
+                        * we can access.
+                        *
+                        * The "+1" is because we want to round the
+                        * byte allocation up rather than down. So
+                        * we should have had a "+7" before we shifted
+                        * down by three. Also, we have to add one as
+                        * we actually _use_ the last bit (it's [0,n]
+                        * inclusive, not [0,n[).
+                        *
+                        * So we actually had +7+1 before we shift
+                        * down by 3. But (n+8) >> 3 == (n >> 3) + 1
+                        * (modulo overflows, which we do not have).
+                        *
+                        * Finally, we LONG_ALIGN because all bitmap
+                        * operations are on longs.
+                        */
+                       bitmap_size = (size-1) >> (i+4);
+                       bitmap_size = LONG_ALIGN(bitmap_size+1);
                        zone->free_area[i].map = 
                          (unsigned long *) alloc_bootmem_node(pgdat, bitmap_size);
                }
index c5b8ccfb6295bdcc1e0899de246701c87beeb406..7bd8fee7b424c048d4f79ae0acc7c8d6ae20cab9 100644 (file)
@@ -1217,10 +1217,10 @@ int netif_rx(struct sk_buff *skb)
 enqueue:
                        dev_hold(skb->dev);
                        __skb_queue_tail(&queue->input_pkt_queue,skb);
+                       local_irq_restore(flags);
 
                        /* Runs from irqs or BH's, no need to wake BH */
                        __cpu_raise_softirq(this_cpu, NET_RX_SOFTIRQ);
-                       local_irq_restore(flags);
 #ifndef OFFLINE_SAMPLE
                        get_sample_stats(this_cpu);
 #endif
@@ -1529,10 +1529,10 @@ softnet_break:
 
        local_irq_disable();
        netdev_rx_stat[this_cpu].time_squeeze++;
+       local_irq_enable();
 
        /* This already runs in BH context, no need to wake up BH's */
        __cpu_raise_softirq(this_cpu, NET_RX_SOFTIRQ);
-       local_irq_enable();
 
        NET_PROFILE_LEAVE(softnet_process);
        return;
index 3b836e33296202243b9ff9e6caca2261080e4980..e9767be6379447919fd17f2712292827da8a7693 100644 (file)
@@ -7,7 +7,7 @@
  *             handler for protocols to use and generic option handler.
  *
  *
- * Version:    $Id: sock.c,v 1.111 2001/06/26 23:29:17 davem Exp $
+ * Version:    $Id: sock.c,v 1.112 2001/07/27 09:54:48 davem Exp $
  *
  * Authors:    Ross Biro, <bir7@leland.Stanford.Edu>
  *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
 #include <linux/filter.h>
 #endif
 
-#define min(a,b)       ((a)<(b)?(a):(b))
-
 /* Run time adjustable parameters. */
 __u32 sysctl_wmem_max = SK_WMEM_MAX;
 __u32 sysctl_rmem_max = SK_RMEM_MAX;
@@ -232,7 +230,10 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
                                val = sysctl_wmem_max;
 
                        sk->userlocks |= SOCK_SNDBUF_LOCK;
-                       sk->sndbuf = max(val*2,SOCK_MIN_SNDBUF);
+                       if ((val * 2) < SOCK_MIN_SNDBUF)
+                               sk->sndbuf = SOCK_MIN_SNDBUF;
+                       else
+                               sk->sndbuf = (val * 2);
 
                        /*
                         *      Wake up sending tasks if we
@@ -252,7 +253,10 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
 
                        sk->userlocks |= SOCK_RCVBUF_LOCK;
                        /* FIXME: is this lower bound the right one? */
-                       sk->rcvbuf = max(val*2,SOCK_MIN_RCVBUF);
+                       if ((val * 2) < SOCK_MIN_RCVBUF)
+                               sk->rcvbuf = SOCK_MIN_RCVBUF;
+                       else
+                               sk->rcvbuf = (val * 2);
                        break;
 
                case SO_KEEPALIVE:
@@ -533,9 +537,9 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
                        break;
 
                case SO_PEERCRED:
-                       lv=sizeof(sk->peercred);
-                       len=min(len, lv);
-                       if(copy_to_user((void*)optval, &sk->peercred, len))
+                       if (len > sizeof(sk->peercred))
+                               len = sizeof(sk->peercred);
+                       if (copy_to_user(optval, &sk->peercred, len))
                                return -EFAULT;
                        goto lenout;
 
@@ -562,11 +566,12 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
                default:
                        return(-ENOPROTOOPT);
        }
-       len=min(len,lv);
-       if(copy_to_user(optval,&v,len))
+       if (len > lv)
+               len = lv;
+       if (copy_to_user(optval, &v, len))
                return -EFAULT;
 lenout:
-       if(put_user(len, optlen))
+       if (put_user(len, optlen))
                return -EFAULT;
        return 0;
 }
index f2e69603ce4b69fef613eda38078e25233b72147..aab8be4956d256e4180cf71bee5058db5af70c28 100644 (file)
@@ -8,7 +8,7 @@
  *     the older version didn't come out right using gcc 2.5.8, the newer one
  *     seems to fall out with gcc 2.6.2.
  *
- *     Version: $Id: igmp.c,v 1.45 2001/02/23 06:32:11 davem Exp $
+ *     Version: $Id: igmp.c,v 1.46 2001/07/27 09:27:29 davem Exp $
  *
  *     Authors:
  *             Alan Cox <Alan.Cox@linux.org>
 #define IGMP_Unsolicited_Report_Count          2
 
 
-#define IGMP_Initial_Report_Delay              (1*HZ)
+#define IGMP_Initial_Report_Delay              (1)
 
 /* IGMP_Initial_Report_Delay is not from IGMP specs!
  * IGMP specs require to report membership immediately after
index 5261b8267a7be8ae9c6690eec00a5675fc9d64b7..1147480aa3a5b28c399b7ffd4c43d2d38bfd6bd3 100644 (file)
@@ -8,7 +8,7 @@
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  *
- * Version:    $Id: af_unix.c,v 1.117 2001/07/01 06:59:10 davem Exp $
+ * Version:    $Id: af_unix.c,v 1.118 2001/07/18 07:52:37 davem Exp $
  *
  * Fixes:
  *             Linus Torvalds  :       Assorted bug cures.