From 156fe7fa864618e8a192b26f6dd706107e272b11 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:40:10 -0500 Subject: [PATCH] - pre7: - Kai Germaschewski: more ISDN cleanups and small fixes. - Al Viro: fix ntfs_new_inode() that he broke. Cleanups. - various: handle !CONFIG_HOTPLUG properly - David Miller: sparc and networking - Linus: more iso9660 fixes. - Neil Brown: fix rd and RAID on highmem machines - Vojtech Pavlik: input driver fixes - David Woodhouse: module unload races - up_and_exit() --- CREDITS | 7 +- Documentation/Configure.help | 12 +- MAINTAINERS | 6 + Makefile | 2 +- arch/alpha/kernel/irq.c | 9 +- arch/ia64/ia32/sys_ia32.c | 2 +- arch/sparc64/kernel/sparc64_ksyms.c | 51 +++--- arch/sparc64/kernel/sys_sunos32.c | 4 +- arch/sparc64/solaris/ioctl.c | 4 +- arch/sparc64/solaris/socket.c | 2 +- drivers/block/loop.c | 4 - drivers/block/rd.c | 10 +- drivers/char/joystick/adi.c | 4 +- drivers/char/joystick/ns558.c | 17 +- drivers/char/joystick/sidewinder.c | 2 +- drivers/i2o/i2o_proc.c | 6 +- drivers/input/evdev.c | 4 +- drivers/input/input.c | 6 + drivers/input/joydev.c | 4 +- drivers/input/mousedev.c | 7 +- drivers/isdn/Config.in | 2 +- drivers/isdn/act2000/Makefile | 2 +- drivers/isdn/act2000/act2000.h | 27 +-- drivers/isdn/act2000/act2000_isa.c | 39 +---- drivers/isdn/act2000/act2000_isa.h | 13 +- drivers/isdn/act2000/capi.c | 30 +--- drivers/isdn/act2000/capi.h | 21 +-- drivers/isdn/act2000/module.c | 44 +---- drivers/isdn/avmb1/Makefile | 35 ++-- drivers/isdn/avmb1/b1.c | 2 +- drivers/isdn/avmb1/b1dma.c | 3 +- drivers/isdn/avmb1/b1isa.c | 28 ++-- drivers/isdn/avmb1/b1pci.c | 56 +++---- drivers/isdn/avmb1/b1pcmcia.c | 28 ++-- drivers/isdn/avmb1/c4.c | 32 ++-- drivers/isdn/avmb1/capi.c | 4 +- drivers/isdn/avmb1/capidrv.c | 18 +- drivers/isdn/avmb1/capifs.c | 7 - drivers/isdn/avmb1/t1isa.c | 30 ++-- drivers/isdn/avmb1/t1pci.c | 28 ++-- drivers/isdn/divert/divert_init.c | 18 +- drivers/isdn/divert/divert_procfs.c | 34 +--- drivers/isdn/divert/isdn_divert.c | 21 +-- drivers/isdn/divert/isdn_divert.h | 15 +- drivers/isdn/hisax/config.c | 2 +- drivers/isdn/hisax/w6692.c | 5 +- drivers/isdn/hysdn/boardergo.c | 14 +- drivers/isdn/hysdn/boardergo.h | 8 +- drivers/isdn/hysdn/hycapi.c | 24 +-- drivers/isdn/hysdn/hysdn_boot.c | 14 +- drivers/isdn/hysdn/hysdn_defs.h | 14 +- drivers/isdn/hysdn/hysdn_init.c | 22 +-- drivers/isdn/hysdn/hysdn_net.c | 31 +--- drivers/isdn/hysdn/hysdn_pof.h | 8 +- drivers/isdn/hysdn/hysdn_procconf.c | 31 +--- drivers/isdn/hysdn/hysdn_proclog.c | 29 +--- drivers/isdn/hysdn/hysdn_sched.c | 14 +- drivers/isdn/icn/icn.c | 225 +------------------------ drivers/isdn/icn/icn.h | 106 +----------- drivers/isdn/isdn_ppp.c | 4 +- drivers/isdn/isdnloop/isdnloop.c | 40 +---- drivers/isdn/isdnloop/isdnloop.h | 17 +- drivers/isdn/sc/debug.c | 2 +- drivers/md/raid5.c | 18 +- drivers/net/pppoe.c | 39 +++-- drivers/net/sunhme.c | 30 +++- drivers/net/wan/lapbether.c | 9 +- drivers/nubus/proc.c | 2 +- drivers/pci/proc.c | 2 +- drivers/usb/hub.c | 19 +-- fs/autofs/inode.c | 1 - fs/devfs/base.c | 6 - fs/dquot.c | 2 - fs/efs/dir.c | 3 - fs/fat/inode.c | 2 - fs/file_table.c | 7 +- fs/isofs/dir.c | 55 +++--- fs/isofs/inode.c | 249 +++++++--------------------- fs/isofs/joliet.c | 3 +- fs/isofs/namei.c | 197 +++++++--------------- fs/jffs/inode-v23.c | 1 - fs/jffs/intrep.c | 3 +- fs/namei.c | 5 +- fs/ncpfs/file.c | 9 - fs/nfs/inode.c | 1 - fs/ntfs/inode.c | 6 +- fs/proc/generic.c | 10 +- fs/proc/inode.c | 15 +- fs/proc/root.c | 14 +- fs/sysv/ialloc.c | 1 - fs/udf/dir.c | 6 - fs/udf/ialloc.c | 2 - include/linux/highmem.h | 14 ++ include/linux/iso_fs.h | 5 +- include/linux/kernel.h | 4 + include/linux/proc_fs.h | 2 +- include/net/x25.h | 1 + init/main.c | 2 + ipc/shm.c | 15 +- kernel/exit.c | 8 + kernel/kmod.c | 3 +- kernel/ksyms.c | 1 + kernel/sysctl.c | 2 +- mm/filemap.c | 2 - net/core/dev.c | 2 + net/ipv4/tcp_ipv4.c | 143 ++++++++-------- net/ipv6/ndisc.c | 3 +- net/khttpd/datasending.c | 2 +- net/khttpd/main.c | 1 - net/socket.c | 2 +- net/unix/garbage.c | 2 +- net/x25/af_x25.c | 8 +- net/x25/x25_in.c | 10 ++ 113 files changed, 654 insertions(+), 1605 deletions(-) diff --git a/CREDITS b/CREDITS index fd299379efb8..7f8a8c70c4c0 100644 --- a/CREDITS +++ b/CREDITS @@ -765,11 +765,10 @@ S: D-57250 Netphen S: Germany N: Rik Faith -E: faith@cs.unc.edu E: faith@acm.org -D: Author: Future Domain TMC-16x0 SCSI driver -D: Debugging: SCSI code; Cyclades serial driver; APM driver -D: Debugging: XFree86 Mach 32 server, accelerated server code +D: Future Domain TMC-16x0 SCSI driver (author) +D: APM driver (early port) +D: DRM drivers (author of several) N: János Farkas E: chexum@shadow.banki.hu diff --git a/Documentation/Configure.help b/Documentation/Configure.help index d89d228a0266..ee2e3e87350c 100644 --- a/Documentation/Configure.help +++ b/Documentation/Configure.help @@ -77,7 +77,7 @@ CONFIG_EXPERIMENTAL in some special cases. Detailed bug reports from people familiar with the kernel internals are usually welcomed by the developers (before submitting bug reports, please read the documents README, - MAINTAINERS, REPORTING_BUGS, Documentation/BUG-HUNTING, and + MAINTAINERS, REPORTING-BUGS, Documentation/BUG-HUNTING, and Documentation/oops-tracing.txt in the kernel source). This option will also make obsoleted drivers available. These are @@ -113,7 +113,7 @@ CONFIG_SMP Management" code will be disabled if you say Y here. See also the files Documentation/smp.tex, Documentation/smp.txt, - Documentation/IO-APIC.txt, Documentation/nmi_watchdog.txt and the + Documentation/i386/IO-APIC.txt, Documentation/nmi_watchdog.txt and the SMP-FAQ on the WWW at http://www.irisa.fr/prive/mentre/smp-faq/ . If you don't know what to do here, say N. @@ -3503,7 +3503,7 @@ CONFIG_PARPORT The module will be called parport.o. If you have more than one parallel port and want to specify which port and IRQ to be used by this driver at module load time, take a look at - Documentation/networking/parport.txt. + Documentation/parport.txt. If unsure, say Y. @@ -3646,7 +3646,7 @@ CONFIG_INET "Sysctl support" below, you can change various aspects of the behavior of the TCP/IP code by writing to the (virtual) files in /proc/sys/net/ipv4/*; the options are explained in the file - Documentation/Networking/ip-sysctl.txt. + Documentation/networking/ip-sysctl.txt. Short answer: say Y. @@ -5027,7 +5027,7 @@ Compaq Smart Array support CONFIG_BLK_CPQ_CISS_DA This is the driver for Compaq Smart Array controllers. Everyone using these boards should say Y here. - See "linux/Documentation/cciss.txt" for the current list of + See Documentation/cciss.txt for the current list of boards supported by this driver, and for further information on the use of this driver. @@ -14027,7 +14027,7 @@ CONFIG_SOUND_MSS SGI Visual Workstation on-board audio CONFIG_SOUND_VWSND Say Y or M if you have an SGI Visual Workstation and you want to - be able to use its on-board audio. Read Documentation/sound/visws + be able to use its on-board audio. Read Documentation/sound/vwsnd for more info on this driver's capabilities. Ensoniq Soundscape support diff --git a/MAINTAINERS b/MAINTAINERS index 24f6a6cf1b80..072d1da5d3dc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -379,6 +379,12 @@ M: jrv@vanzandt.mv.com L: blinux-list@redhat.com S: Maintained +DRM DRIVERS +P: Rik Faith +M: faith@valinux.com +L: dri-devel@lists.sourceforge.net +S: Supported + EATA-DMA SCSI DRIVER P: Michael Neuffer M: mike@i-Connect.Net diff --git a/Makefile b/Makefile index 25940fe6e241..e87bfc0cc065 100644 --- a/Makefile +++ b/Makefile @@ -497,4 +497,4 @@ scripts/mkdep: scripts/mkdep.c $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c scripts/split-include: scripts/split-include.c - $(HOSTCC) $(HOSTCFLAGS) -I$(HPATH) -o scripts/split-include scripts/split-include.c + $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c index ac7ca67f89f2..080e48e43f32 100644 --- a/arch/alpha/kernel/irq.c +++ b/arch/alpha/kernel/irq.c @@ -747,7 +747,7 @@ probe_irq_mask(unsigned long val) unsigned int mask; mask = 0; - for (i = 0; i < 16; i++) { + for (i = 0; i < NR_IRQS; i++) { irq_desc_t *desc = irq_desc + i; unsigned int status; @@ -755,8 +755,11 @@ probe_irq_mask(unsigned long val) status = desc->status; if (status & IRQ_AUTODETECT) { - if (!(status & IRQ_WAITING)) - mask |= 1 << i; + /* We only react to ISA interrupts */ + if (!(status & IRQ_WAITING)) { + if (i < 16) + mask |= 1 << i; + } desc->status = status & ~IRQ_AUTODETECT; desc->handler->shutdown(i); diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index 0383741a0cb3..416b23faa8be 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c @@ -3392,7 +3392,7 @@ sockfd_lookup(int fd, int *err) } inode = file->f_dentry->d_inode; - if (!inode || !inode->i_sock || !socki_lookup(inode)) + if (!inode->i_sock || !socki_lookup(inode)) { *err = -ENOTSOCK; fput(file); diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c index 20d8a1a43a75..e1ae982bf4b9 100644 --- a/arch/sparc64/kernel/sparc64_ksyms.c +++ b/arch/sparc64/kernel/sparc64_ksyms.c @@ -1,4 +1,4 @@ -/* $Id: sparc64_ksyms.c,v 1.96 2000/11/06 06:59:03 davem Exp $ +/* $Id: sparc64_ksyms.c,v 1.98 2000/11/13 10:03:32 davem Exp $ * arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -109,25 +109,14 @@ extern void _do_write_unlock(rwlock_t *rw); extern unsigned long phys_base; -/* One thing to note is that the way the symbols of the mul/div - * support routines are named is a mess, they all start with - * a '.' which makes it a bitch to export, here is the trick: - */ - -#define EXPORT_SYMBOL_PRIVATE(sym) \ -extern int __sparc_priv_ ## sym (int) __asm__("__" #sym); \ -const struct module_symbol __export_priv_##sym \ -__attribute__((section("__ksymtab"))) = \ -{ (unsigned long) &__sparc_priv_ ## sym, "__" #sym } - /* used by various drivers */ #ifdef CONFIG_SMP #ifndef SPIN_LOCK_DEBUG /* Out of line rw-locking implementation. */ -EXPORT_SYMBOL_PRIVATE(read_lock); -EXPORT_SYMBOL_PRIVATE(read_unlock); -EXPORT_SYMBOL_PRIVATE(write_lock); -EXPORT_SYMBOL_PRIVATE(write_unlock); +EXPORT_SYMBOL(__read_lock); +EXPORT_SYMBOL(__read_unlock); +EXPORT_SYMBOL(__write_lock); +EXPORT_SYMBOL(__write_unlock); #endif /* Kernel wide locking */ @@ -136,10 +125,10 @@ EXPORT_SYMBOL(kernel_flag); /* Hard IRQ locking */ EXPORT_SYMBOL(global_irq_holder); EXPORT_SYMBOL(synchronize_irq); -EXPORT_SYMBOL_PRIVATE(global_cli); -EXPORT_SYMBOL_PRIVATE(global_sti); -EXPORT_SYMBOL_PRIVATE(global_save_flags); -EXPORT_SYMBOL_PRIVATE(global_restore_flags); +EXPORT_SYMBOL(__global_cli); +EXPORT_SYMBOL(__global_sti); +EXPORT_SYMBOL(__global_save_flags); +EXPORT_SYMBOL(__global_restore_flags); /* Per-CPU information table */ EXPORT_SYMBOL(cpu_data); @@ -162,27 +151,33 @@ EXPORT_SYMBOL(_do_write_unlock); #endif +/* semaphores */ +EXPORT_SYMBOL(__down); +EXPORT_SYMBOL(__down_interruptible); +EXPORT_SYMBOL(__down_trylock); +EXPORT_SYMBOL(__up); + /* rw semaphores */ EXPORT_SYMBOL_NOVERS(__down_read_failed); EXPORT_SYMBOL_NOVERS(__down_write_failed); EXPORT_SYMBOL_NOVERS(__rwsem_wake); /* Atomic counter implementation. */ -EXPORT_SYMBOL_PRIVATE(atomic_add); -EXPORT_SYMBOL_PRIVATE(atomic_sub); +EXPORT_SYMBOL(__atomic_add); +EXPORT_SYMBOL(__atomic_sub); /* Atomic bit operations. */ -EXPORT_SYMBOL_PRIVATE(test_and_set_bit); -EXPORT_SYMBOL_PRIVATE(test_and_clear_bit); -EXPORT_SYMBOL_PRIVATE(test_and_change_bit); -EXPORT_SYMBOL_PRIVATE(test_and_set_le_bit); -EXPORT_SYMBOL_PRIVATE(test_and_clear_le_bit); +EXPORT_SYMBOL(__test_and_set_bit); +EXPORT_SYMBOL(__test_and_clear_bit); +EXPORT_SYMBOL(__test_and_change_bit); +EXPORT_SYMBOL(__test_and_set_le_bit); +EXPORT_SYMBOL(__test_and_clear_le_bit); EXPORT_SYMBOL(ivector_table); EXPORT_SYMBOL(enable_irq); EXPORT_SYMBOL(disable_irq); -EXPORT_SYMBOL_PRIVATE(flushw_user); +EXPORT_SYMBOL(__flushw_user); EXPORT_SYMBOL(__flush_dcache_page); diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c index 75d5c096eb0e..a5f5411f525d 100644 --- a/arch/sparc64/kernel/sys_sunos32.c +++ b/arch/sparc64/kernel/sys_sunos32.c @@ -601,7 +601,6 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr) int try_port; int ret; struct socket *socket; - struct dentry *dentry; struct inode *inode; struct file *file; @@ -609,8 +608,7 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr) if(!file) return 0; - dentry = file->f_dentry; - inode = dentry->d_inode; + inode = file->f_dentry->d_inode; socket = &inode->u.socket_i; local.sin_family = AF_INET; diff --git a/arch/sparc64/solaris/ioctl.c b/arch/sparc64/solaris/ioctl.c index 0e899da18d95..4a10c1b4c905 100644 --- a/arch/sparc64/solaris/ioctl.c +++ b/arch/sparc64/solaris/ioctl.c @@ -464,8 +464,8 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd struct sol_socket_struct *sock; struct module_info *mi; - if (! (ino = filp->f_dentry->d_inode) || - ! ino->i_sock) + ino = filp->f_dentry->d_inode; + if (! ino->i_sock) return -EBADF; sock = filp->private_data; if (! sock) { diff --git a/arch/sparc64/solaris/socket.c b/arch/sparc64/solaris/socket.c index 3013d43cf5a1..9b910a63328c 100644 --- a/arch/sparc64/solaris/socket.c +++ b/arch/sparc64/solaris/socket.c @@ -265,7 +265,7 @@ extern __inline__ struct socket *sockfd_lookup(int fd, int *err) } inode = file->f_dentry->d_inode; - if (!inode || !inode->i_sock || !socki_lookup(inode)) { + if (!inode->i_sock || !socki_lookup(inode)) { *err = -ENOTSOCK; fput(file); return NULL; diff --git a/drivers/block/loop.c b/drivers/block/loop.c index ae8489380edb..dc5ecd1519f7 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -411,10 +411,6 @@ static int loop_set_fd(struct loop_device *lo, kdev_t dev, unsigned int arg) error = -EINVAL; inode = file->f_dentry->d_inode; - if (!inode) { - printk(KERN_ERR "loop_set_fd: NULL inode?!?\n"); - goto out_putf; - } if (S_ISBLK(inode->i_mode)) { /* dentry will be wired, so... */ diff --git a/drivers/block/rd.c b/drivers/block/rd.c index 2d0b54648b36..1799ccef536e 100644 --- a/drivers/block/rd.c +++ b/drivers/block/rd.c @@ -199,6 +199,7 @@ static int rd_make_request(request_queue_t * q, int rw, struct buffer_head *sbh) unsigned int minor; unsigned long offset, len; struct buffer_head *rbh; + char *bdata; minor = MINOR(sbh->b_rdev); @@ -221,12 +222,17 @@ static int rd_make_request(request_queue_t * q, int rw, struct buffer_head *sbh) } rbh = getblk(sbh->b_rdev, sbh->b_rsector/(sbh->b_size>>9), sbh->b_size); + /* I think that it is safe to assume that rbh is not in HighMem, though + * sbh might be - NeilBrown + */ + bdata = bh_kmap(sbh); if (rw == READ) { if (sbh != rbh) - memcpy(sbh->b_data, rbh->b_data, rbh->b_size); + memcpy(bdata, rbh->b_data, rbh->b_size); } else if (sbh != rbh) - memcpy(rbh->b_data, sbh->b_data, rbh->b_size); + memcpy(rbh->b_data, bdata, rbh->b_size); + bh_kunmap(sbh); mark_buffer_protected(rbh); brelse(rbh); diff --git a/drivers/char/joystick/adi.c b/drivers/char/joystick/adi.c index 3195fce03c0b..a2f68d74eb05 100644 --- a/drivers/char/joystick/adi.c +++ b/drivers/char/joystick/adi.c @@ -418,7 +418,7 @@ static void adi_init_input(struct adi *adi, struct adi_port *port) adi->dev.private = port; adi->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - for (i = 0; i < adi->axes10 + adi->axes8 + adi->hats * 2; i++) + for (i = 0; i < adi->axes10 + adi->axes8 + (adi->hats + (adi->pad > 0)) * 2; i++) set_bit(adi->abs[i], &adi->dev.absbit); for (i = 0; i < adi->buttons; i++) @@ -431,7 +431,7 @@ static void adi_init_center(struct adi *adi) if (!adi->length) return; - for (i = 0; i < adi->axes10 + adi->axes8 + adi->hats * 2; i++) { + for (i = 0; i < adi->axes10 + adi->axes8 + (adi->hats + (adi->pad > 0)) * 2; i++) { t = adi->abs[i]; x = adi->dev.abs[t]; diff --git a/drivers/char/joystick/ns558.c b/drivers/char/joystick/ns558.c index 838deb09c0ee..36c5d9f9e22a 100644 --- a/drivers/char/joystick/ns558.c +++ b/drivers/char/joystick/ns558.c @@ -58,6 +58,7 @@ struct ns558 { }; static struct ns558 *ns558; +static int ns558_pci; /* * ns558_isa_probe() tries to find an isa gameport at the @@ -187,12 +188,10 @@ static int __devinit ns558_pci_probe(struct pci_dev *pdev, const struct pci_devi } memset(port, 0, sizeof(struct ns558)); - port->next = ns558; port->type = NS558_PCI; port->gameport.io = ioport; port->gameport.size = iolen; port->dev = pdev; - ns558 = port; pdev->driver_data = port; @@ -315,8 +314,7 @@ int __init ns558_init(void) * it is the least-invasive probe. */ - i = pci_register_driver(&ns558_pci_driver); - if (i < 0) return i; + ns558_pci = !pci_module_init(&ns558_pci_driver); /* * Probe for ISA ports. @@ -337,12 +335,12 @@ int __init ns558_init(void) } #endif - return 0; + return (ns558 || ns558_pci) ? 0 : -ENODEV; } void __exit ns558_exit(void) { - struct ns558 *port = ns558; + struct ns558 *next, *port = ns558; while (port) { gameport_unregister_port(&port->gameport); @@ -363,10 +361,13 @@ void __exit ns558_exit(void) break; } - port = port->next; + next = port->next; + kfree(port); + port = next; } - pci_unregister_driver(&ns558_pci_driver); + if (ns558_pci) + pci_unregister_driver(&ns558_pci_driver); } module_init(ns558_init); diff --git a/drivers/char/joystick/sidewinder.c b/drivers/char/joystick/sidewinder.c index 85be9f8b11de..ae31265cbbe1 100644 --- a/drivers/char/joystick/sidewinder.c +++ b/drivers/char/joystick/sidewinder.c @@ -102,7 +102,7 @@ static short sw_btn[][12] = { { BTN_TRIGGER, BTN_THUMB, BTN_TOP, BTN_TOP2, BTN_BASE, BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_SELECT }, { BTN_TRIGGER, BTN_THUMB, BTN_TOP, BTN_TOP2, BTN_BASE, BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_SELECT }, { BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, BTN_TL, BTN_TR, BTN_START, BTN_MODE, BTN_SELECT }, - { BTN_TRIGGER, BTN_TOP, BTN_THUMB, BTN_THUMB2, BTN_BASE, BTN_BASE2, BTN_BASE3 }}; + { BTN_TRIGGER, BTN_TOP, BTN_THUMB, BTN_THUMB2, BTN_BASE, BTN_BASE2, BTN_BASE3, BTN_BASE4 }}; static struct { int x; diff --git a/drivers/i2o/i2o_proc.c b/drivers/i2o/i2o_proc.c index 4c92ff09d1c0..dc70e732228a 100644 --- a/drivers/i2o/i2o_proc.c +++ b/drivers/i2o/i2o_proc.c @@ -3237,7 +3237,7 @@ static void i2o_proc_remove_controller(struct i2o_controller *pctrl, for(dev=pctrl->devices; dev; dev=dev->next) i2o_proc_remove_device(dev); - if(!pctrl->proc_entry->count) + if(!atomic_read(&pctrl->proc_entry->count)) { sprintf(buff, "iop%d", pctrl->unit); @@ -3257,7 +3257,7 @@ void i2o_proc_remove_device(struct i2o_device *dev) i2o_device_notify_off(dev, &i2o_proc_handler); /* Would it be safe to remove _files_ even if they are in use? */ - if((de) && (!de->count)) + if((de) && (!atomic_read(&de->count))) { i2o_proc_remove_entries(generic_dev_entries, de); switch(dev->lct_data.class_id) @@ -3334,7 +3334,7 @@ static int __exit destroy_i2o_procfs(void) } } - if(!i2o_proc_dir_root->count) + if(!atomic_read(&i2o_proc_dir_root->count)) remove_proc_entry("i2o", 0); else return -1; diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 65109e9ca377..8e676b8da378 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -123,7 +123,7 @@ static int evdev_open(struct inode * inode, struct file * file) struct evdev_list *list; int i = MINOR(inode->i_rdev) - EVDEV_MINOR_BASE; - if (i > EVDEV_MINORS || !evdev_table[i]) + if (i >= EVDEV_MINORS || !evdev_table[i]) return -ENODEV; if (!(list = kmalloc(sizeof(struct evdev_list), GFP_KERNEL))) @@ -288,7 +288,7 @@ static struct input_handle *evdev_connect(struct input_handler *handler, struct int minor; for (minor = 0; minor < EVDEV_MINORS && evdev_table[minor]; minor++); - if (evdev_table[minor]) { + if (minor == EVDEV_MINORS) { printk(KERN_ERR "evdev: no more free evdev devices\n"); return NULL; } diff --git a/drivers/input/input.c b/drivers/input/input.c index e121192a6d8a..c78e490864e7 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -29,6 +29,8 @@ */ #include +#include +#include #include #include #include @@ -378,7 +380,11 @@ static int input_open_file(struct inode *inode, struct file *file) } old_fops = file->f_op; file->f_op = new_fops; + + lock_kernel(); err = new_fops->open(inode, file); + unlock_kernel(); + if (err) { fops_put(file->f_op); file->f_op = fops_get(old_fops); diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 90c4dbcef1a1..4e12f55b7234 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -193,7 +193,7 @@ static int joydev_open(struct inode *inode, struct file *file) struct joydev_list *list; int i = MINOR(inode->i_rdev) - JOYDEV_MINOR_BASE; - if (i > JOYDEV_MINORS || !joydev_table[i]) + if (i >= JOYDEV_MINORS || !joydev_table[i]) return -ENODEV; if (!(list = kmalloc(sizeof(struct joydev_list), GFP_KERNEL))) @@ -395,7 +395,7 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct || test_bit(BTN_1, dev->keybit)))) return NULL; for (minor = 0; minor < JOYDEV_MINORS && joydev_table[minor]; minor++); - if (joydev_table[minor]) { + if (minor == JOYDEV_MINORS) { printk(KERN_ERR "joydev: no more free joydev devices\n"); return NULL; } diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index 1aa85e227399..e6a9e02a131a 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c @@ -39,6 +39,7 @@ #include #include #include +#include #ifndef CONFIG_INPUT_MOUSEDEV_SCREEN_X #define CONFIG_INPUT_MOUSEDEV_SCREEN_X 1024 @@ -86,6 +87,8 @@ static void mousedev_event(struct input_handle *handle, unsigned int type, unsig struct mousedev_list *list; int index, size; + add_mouse_randomness((type << 4) ^ code ^ (code >> 4) ^ value); + while (*mousedev) { list = (*mousedev)->list; while (list) { @@ -213,7 +216,7 @@ static int mousedev_open(struct inode * inode, struct file * file) struct mousedev_list *list; int i = MINOR(inode->i_rdev) - MOUSEDEV_MINOR_BASE; - if (i > MOUSEDEV_MINORS || !mousedev_table[i]) + if (i >= MOUSEDEV_MINORS || !mousedev_table[i]) return -ENODEV; if (!(list = kmalloc(sizeof(struct mousedev_list), GFP_KERNEL))) @@ -407,7 +410,7 @@ static struct input_handle *mousedev_connect(struct input_handler *handler, stru return NULL; for (minor = 0; minor < MOUSEDEV_MINORS && mousedev_table[minor]; minor++); - if (mousedev_table[minor]) { + if (minor == MOUSEDEV_MINORS) { printk(KERN_ERR "mousedev: no more free mousedev devices\n"); return NULL; } diff --git a/drivers/isdn/Config.in b/drivers/isdn/Config.in index 2062f753c3c5..f42516b12d17 100644 --- a/drivers/isdn/Config.in +++ b/drivers/isdn/Config.in @@ -10,7 +10,7 @@ if [ "$CONFIG_INET" != "n" ]; then fi bool ' Support audio via ISDN' CONFIG_ISDN_AUDIO if [ "$CONFIG_ISDN_AUDIO" != "n" ]; then - bool ' Support AT-Fax Class 2 commands' CONFIG_ISDN_TTY_FAX + bool ' Support AT-Fax Class 1 and 2 commands' CONFIG_ISDN_TTY_FAX fi if [ "$CONFIG_X25" != "n" ]; then bool ' X.25 PLP on top of ISDN' CONFIG_ISDN_X25 diff --git a/drivers/isdn/act2000/Makefile b/drivers/isdn/act2000/Makefile index 0e3c4a7e18f7..31312e8f6df1 100644 --- a/drivers/isdn/act2000/Makefile +++ b/drivers/isdn/act2000/Makefile @@ -7,7 +7,7 @@ ifeq ($(CONFIG_ISDN_DRV_ACT2000),y) O_TARGET += act2000.o else ifeq ($(CONFIG_ISDN_DRV_ACT2000),m) - O_TARGET += act2000.o + O_TARGET += act2000.o M_OBJS = act2000.o endif endif diff --git a/drivers/isdn/act2000/act2000.h b/drivers/isdn/act2000/act2000.h index 5d35a12ecd3a..432f433cb396 100644 --- a/drivers/isdn/act2000/act2000.h +++ b/drivers/isdn/act2000/act2000.h @@ -1,4 +1,4 @@ -/* $Id: act2000.h,v 1.7 1999/04/12 13:13:54 fritz Exp $ +/* $Id: act2000.h,v 1.8 2000/11/12 16:32:06 kai Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * @@ -19,31 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: act2000.h,v $ - * Revision 1.7 1999/04/12 13:13:54 fritz - * Made cards pointer static to avoid name-clash. - * - * Revision 1.6 1998/11/05 22:12:38 fritz - * Changed mail-address. - * - * Revision 1.5 1997/10/09 22:22:59 fritz - * New HL<->LL interface: - * New BSENT callback with nr. of bytes included. - * Sending without ACK. - * - * Revision 1.4 1997/09/25 17:25:37 fritz - * Support for adding cards at runtime. - * Support for new Firmware. - * - * Revision 1.3 1997/09/24 23:11:43 fritz - * Optimized IRQ load and polling-mode. - * - * Revision 1.2 1997/09/24 19:44:12 fritz - * Added MSN mapping support, some cleanup. - * - * Revision 1.1 1997/09/23 18:00:05 fritz - * New driver for IBM Active 2000. - * */ #ifndef act2000_h diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c index 99c93dbed6ec..216269dcae72 100644 --- a/drivers/isdn/act2000/act2000_isa.c +++ b/drivers/isdn/act2000/act2000_isa.c @@ -1,4 +1,4 @@ -/* $Id: act2000_isa.c,v 1.10 1999/10/24 18:46:05 fritz Exp $ +/* $Id: act2000_isa.c,v 1.11 2000/11/12 16:32:06 kai Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version). * @@ -19,43 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: act2000_isa.c,v $ - * Revision 1.10 1999/10/24 18:46:05 fritz - * Changed isa_ prefix to act2000_isa_ to prevent name-clash in latest - * kernels. - * - * Revision 1.9 1999/09/04 06:20:04 keil - * Changes from kernel set_current_state() - * - * Revision 1.8 1999/01/05 18:29:25 he - * merged remaining schedule_timeout() changes from 2.1.127 - * - * Revision 1.7 1998/11/05 22:12:41 fritz - * Changed mail-address. - * - * Revision 1.6 1998/06/17 19:51:09 he - * merged with 2.1.10[34] (cosmetics and udelay() -> mdelay()) - * brute force fix to avoid Ugh's in isdn_tty_write() - * cleaned up some dead code - * - * Revision 1.5 1998/02/12 23:06:47 keil - * change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb() - * - * Revision 1.4 1997/10/09 22:23:00 fritz - * New HL<->LL interface: - * New BSENT callback with nr. of bytes included. - * Sending without ACK. - * - * Revision 1.3 1997/09/25 17:25:38 fritz - * Support for adding cards at runtime. - * Support for new Firmware. - * - * Revision 1.2 1997/09/24 23:11:44 fritz - * Optimized IRQ load and polling-mode. - * - * Revision 1.1 1997/09/23 18:00:05 fritz - * New driver for IBM Active 2000. - * */ #define __NO_VERSION__ diff --git a/drivers/isdn/act2000/act2000_isa.h b/drivers/isdn/act2000/act2000_isa.h index ff3e5419aeb7..0b705d33fe59 100644 --- a/drivers/isdn/act2000/act2000_isa.h +++ b/drivers/isdn/act2000/act2000_isa.h @@ -1,4 +1,4 @@ -/* $Id: act2000_isa.h,v 1.3 1999/10/24 18:46:05 fritz Exp $ +/* $Id: act2000_isa.h,v 1.4 2000/11/12 16:32:06 kai Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version). * @@ -19,17 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: act2000_isa.h,v $ - * Revision 1.3 1999/10/24 18:46:05 fritz - * Changed isa_ prefix to act2000_isa_ to prevent name-clash in latest - * kernels. - * - * Revision 1.2 1998/11/05 22:12:43 fritz - * Changed mail-address. - * - * Revision 1.1 1997/09/23 18:00:07 fritz - * New driver for IBM Active 2000. - * */ #ifndef act2000_isa_h diff --git a/drivers/isdn/act2000/capi.c b/drivers/isdn/act2000/capi.c index 9502b314e1c3..ad2471a171b7 100644 --- a/drivers/isdn/act2000/capi.c +++ b/drivers/isdn/act2000/capi.c @@ -1,4 +1,4 @@ -/* $Id: capi.c,v 1.8 1998/11/05 22:12:46 fritz Exp $ +/* $Id: capi.c,v 1.9 2000/11/12 16:32:06 kai Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * CAPI encoder/decoder @@ -20,34 +20,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: capi.c,v $ - * Revision 1.8 1998/11/05 22:12:46 fritz - * Changed mail-address. - * - * Revision 1.7 1998/02/23 23:35:41 fritz - * Eliminated some compiler warnings. - * - * Revision 1.6 1998/02/12 23:06:50 keil - * change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb() - * - * Revision 1.5 1997/10/09 22:23:02 fritz - * New HL<->LL interface: - * New BSENT callback with nr. of bytes included. - * Sending without ACK. - * - * Revision 1.4 1997/09/25 17:25:39 fritz - * Support for adding cards at runtime. - * Support for new Firmware. - * - * Revision 1.3 1997/09/24 19:44:14 fritz - * Added MSN mapping support, some cleanup. - * - * Revision 1.2 1997/09/23 19:41:24 fritz - * Disabled Logging of DATA_B3_IND/RESP/REQ/CONF Messages. - * - * Revision 1.1 1997/09/23 18:00:08 fritz - * New driver for IBM Active 2000. - * */ #define __NO_VERSION__ diff --git a/drivers/isdn/act2000/capi.h b/drivers/isdn/act2000/capi.h index 0500550db90f..88e9b1aabf24 100644 --- a/drivers/isdn/act2000/capi.h +++ b/drivers/isdn/act2000/capi.h @@ -1,4 +1,4 @@ -/* $Id: capi.h,v 1.5 1998/11/05 22:12:48 fritz Exp $ +/* $Id: capi.h,v 1.6 2000/11/12 16:32:06 kai Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * @@ -19,25 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: capi.h,v $ - * Revision 1.5 1998/11/05 22:12:48 fritz - * Changed mail-address. - * - * Revision 1.4 1997/10/01 09:21:04 fritz - * Removed old compatibility stuff for 2.0.X kernels. - * From now on, this code is for 2.1.X ONLY! - * Old stuff is still in the separate branch. - * - * Revision 1.3 1997/09/25 17:25:41 fritz - * Support for adding cards at runtime. - * Support for new Firmware. - * - * Revision 1.2 1997/09/24 19:44:15 fritz - * Added MSN mapping support, some cleanup. - * - * Revision 1.1 1997/09/23 18:00:10 fritz - * New driver for IBM Active 2000. - * */ #ifndef CAPI_H diff --git a/drivers/isdn/act2000/module.c b/drivers/isdn/act2000/module.c index 87f98b02984e..c602d945f27e 100644 --- a/drivers/isdn/act2000/module.c +++ b/drivers/isdn/act2000/module.c @@ -1,4 +1,4 @@ -/* $Id: module.c,v 1.12 2000/05/06 00:52:36 kai Exp $ +/* $Id: module.c,v 1.14 2000/11/12 16:32:06 kai Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * @@ -19,48 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: module.c,v $ - * Revision 1.12 2000/05/06 00:52:36 kai - * merged changes from kernel tree - * fixed timer and net_device->name breakage - * - * Revision 1.11 1999/10/30 09:48:04 keil - * miss one prefix act2000 - * - * Revision 1.10 1999/10/24 18:46:05 fritz - * Changed isa_ prefix to act2000_isa_ to prevent name-clash in latest - * kernels. - * - * Revision 1.9 1999/04/12 13:13:56 fritz - * Made cards pointer static to avoid name-clash. - * - * Revision 1.8 1998/11/05 22:12:51 fritz - * Changed mail-address. - * - * Revision 1.7 1998/02/12 23:06:52 keil - * change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb() - * - * Revision 1.6 1998/01/31 22:10:42 keil - * changes for 2.1.82 - * - * Revision 1.5 1997/10/09 22:23:04 fritz - * New HL<->LL interface: - * New BSENT callback with nr. of bytes included. - * Sending without ACK. - * - * Revision 1.4 1997/09/25 17:25:43 fritz - * Support for adding cards at runtime. - * Support for new Firmware. - * - * Revision 1.3 1997/09/24 23:11:45 fritz - * Optimized IRQ load and polling-mode. - * - * Revision 1.2 1997/09/24 19:44:17 fritz - * Added MSN mapping support, some cleanup. - * - * Revision 1.1 1997/09/23 18:00:13 fritz - * New driver for IBM Active 2000. - * */ #include "act2000.h" diff --git a/drivers/isdn/avmb1/Makefile b/drivers/isdn/avmb1/Makefile index cd2223911521..56f7ac4be57c 100644 --- a/drivers/isdn/avmb1/Makefile +++ b/drivers/isdn/avmb1/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile,v 1.18 2000/04/03 16:39:25 calle Exp $ +# $Id: Makefile,v 1.21 2000/11/01 14:05:02 calle Exp $ # # Makefile for the CAPI and AVM-B1 device drivers. # @@ -11,6 +11,23 @@ # parent makes.. # # $Log: Makefile,v $ +# Revision 1.21 2000/11/01 14:05:02 calle +# - use module_init/module_exit from linux/init.h. +# - all static struct variables are initialized with "membername:" now. +# - avm_cs.c, let it work with newer pcmcia-cs. +# +# Revision 1.20 2000/10/18 06:13:34 ostoyke +# Removing CAPI4Linux from I4L CVS. +# +# Revision 1.19 2000/08/10 14:46:25 ostoyke +# CAPI4Linux. +# +# Revision 1.18 2000/04/03 16:39:25 calle +# Makefile checked in with future things :-( +# +# Revision 1.17 2000/04/03 16:38:05 calle +# made suppress_pollack static. +# # Revision 1.16 2000/03/17 12:15:44 calle # ALL_SUB_DIRS were wrong. # @@ -109,7 +126,7 @@ SUB_DIRS := MOD_SUB_DIRS := -ALL_SUB_DIRS := # fcpci fcclassic +ALL_SUB_DIRS := # # Objects that don't export a symtab # @@ -158,14 +175,6 @@ ifeq ($(CONFIG_ISDN_CAPI),y) ifdef CONFIG_ISDN_DRV_AVMB1_C4 O_OBJS += c4.o endif - ifdef CONFIG_ISDN_DRV_AVMB1_FCPCI - SUB_DIRS += fcpci - MOD_SUB_DIRS += fcpci - endif - ifdef CONFIG_ISDN_DRV_AVMB1_FCCLASSIC - SUB_DIRS += fcclassic - MOD_SUB_DIRS += fcclassic - endif OX_OBJS += capiutil.o capidrv.o b1.o b1dma.o else ifeq ($(CONFIG_ISDN_CAPI),m) @@ -198,12 +207,6 @@ else ifdef CONFIG_ISDN_DRV_AVMB1_C4 M_OBJS += c4.o endif - ifdef CONFIG_ISDN_DRV_AVMB1_FCPCI - MOD_SUB_DIRS += fcpci - endif - ifdef CONFIG_ISDN_DRV_AVMB1_FCCLASSIC - MOD_SUB_DIRS += fcclassic - endif MX_OBJS += capiutil.o capidrv.o b1.o b1dma.o endif endif diff --git a/drivers/isdn/avmb1/b1.c b/drivers/isdn/avmb1/b1.c index 8ccf5fc7ef58..747b5ea7f2bf 100644 --- a/drivers/isdn/avmb1/b1.c +++ b/drivers/isdn/avmb1/b1.c @@ -517,7 +517,7 @@ void b1_handle_interrupt(avmcard * card) struct sk_buff *skb; unsigned ApplId; - signed MsgLen; + unsigned MsgLen; unsigned DataB3Len; unsigned NCCI; unsigned WindowSize; diff --git a/drivers/isdn/avmb1/b1dma.c b/drivers/isdn/avmb1/b1dma.c index 9da7a21ac3d8..6cdc6c5a40ae 100644 --- a/drivers/isdn/avmb1/b1dma.c +++ b/drivers/isdn/avmb1/b1dma.c @@ -483,8 +483,7 @@ static void b1dma_handle_rx(avmcard *card) struct capi_ctr *ctrl = cinfo->capi_ctrl; struct sk_buff *skb; void *p = dma->recvbuf+4; - __u32 ApplId, DataB3Len, NCCI, WindowSize; - __s32 MsgLen; + __u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize; __u8 b1cmd = _get_byte(&p); #ifdef CONFIG_B1DMA_DEBUG diff --git a/drivers/isdn/avmb1/b1isa.c b/drivers/isdn/avmb1/b1isa.c index 9c67a0a42342..486a0f28d10c 100644 --- a/drivers/isdn/avmb1/b1isa.c +++ b/drivers/isdn/avmb1/b1isa.c @@ -244,20 +244,20 @@ static char *b1isa_procinfo(struct capi_ctr *ctrl) /* ------------------------------------------------------------- */ static struct capi_driver b1isa_driver = { - "b1isa", - "0.0", - b1_load_firmware, - b1_reset_ctr, - b1isa_remove_ctr, - b1_register_appl, - b1_release_appl, - b1_send_message, - - b1isa_procinfo, - b1ctl_read_proc, - 0, /* use standard driver_read_proc */ - - b1isa_add_card, + name: "b1isa", + revision: "0.0", + load_firmware: b1_load_firmware, + reset_ctr: b1_reset_ctr, + remove_ctr: b1isa_remove_ctr, + register_appl: b1_register_appl, + release_appl: b1_release_appl, + send_message: b1_send_message, + + procinfo: b1isa_procinfo, + ctr_read_proc: b1ctl_read_proc, + driver_read_proc: 0, /* use standard driver_read_proc */ + + add_card: b1isa_add_card, }; #ifdef MODULE diff --git a/drivers/isdn/avmb1/b1pci.c b/drivers/isdn/avmb1/b1pci.c index 69bab9557904..27af2e27b80a 100644 --- a/drivers/isdn/avmb1/b1pci.c +++ b/drivers/isdn/avmb1/b1pci.c @@ -276,20 +276,20 @@ static int b1pci_add_card(struct capi_driver *driver, struct capicardparams *p) /* ------------------------------------------------------------- */ static struct capi_driver b1pci_driver = { - "b1pci", - "0.0", - b1_load_firmware, - b1_reset_ctr, - b1pci_remove_ctr, - b1_register_appl, - b1_release_appl, - b1_send_message, - - b1pci_procinfo, - b1ctl_read_proc, - 0, /* use standard driver_read_proc */ - - 0, /* no add_card function */ + name: "b1pci", + revision: "0.0", + load_firmware: b1_load_firmware, + reset_ctr: b1_reset_ctr, + remove_ctr: b1pci_remove_ctr, + register_appl: b1_register_appl, + release_appl: b1_release_appl, + send_message: b1_send_message, + + procinfo: b1pci_procinfo, + ctr_read_proc: b1ctl_read_proc, + driver_read_proc: 0, /* use standard driver_read_proc */ + + add_card: 0, /* no add_card function */ }; #ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4 @@ -463,20 +463,20 @@ static int b1pciv4_add_card(struct capi_driver *driver, struct capicardparams *p static struct capi_driver b1pciv4_driver = { - "b1pciv4", - "0.0", - b1dma_load_firmware, - b1dma_reset_ctr, - b1pciv4_remove_ctr, - b1dma_register_appl, - b1dma_release_appl, - b1dma_send_message, - - b1pciv4_procinfo, - b1dmactl_read_proc, - 0, /* use standard driver_read_proc */ - - 0, /* no add_card function */ + name: "b1pciv4", + revision: "0.0", + load_firmware: b1dma_load_firmware, + reset_ctr: b1dma_reset_ctr, + remove_ctr: b1pciv4_remove_ctr, + register_appl: b1dma_register_appl, + release_appl: b1dma_release_appl, + send_message: b1dma_send_message, + + procinfo: b1pciv4_procinfo, + ctr_read_proc: b1dmactl_read_proc, + driver_read_proc: 0, /* use standard driver_read_proc */ + + add_card: 0, /* no add_card function */ }; #endif /* CONFIG_ISDN_DRV_AVMB1_B1PCIV4 */ diff --git a/drivers/isdn/avmb1/b1pcmcia.c b/drivers/isdn/avmb1/b1pcmcia.c index c3537c363cb1..20b8515482fd 100644 --- a/drivers/isdn/avmb1/b1pcmcia.c +++ b/drivers/isdn/avmb1/b1pcmcia.c @@ -245,20 +245,20 @@ static char *b1pcmcia_procinfo(struct capi_ctr *ctrl) /* ------------------------------------------------------------- */ static struct capi_driver b1pcmcia_driver = { - "b1pcmcia", - "0.0", - b1_load_firmware, - b1_reset_ctr, - b1pcmcia_remove_ctr, - b1_register_appl, - b1_release_appl, - b1_send_message, - - b1pcmcia_procinfo, - b1ctl_read_proc, - 0, /* use standard driver_read_proc */ - - 0, + name: "b1pcmcia", + revision: "0.0", + load_firmware: b1_load_firmware, + reset_ctr: b1_reset_ctr, + remove_ctr: b1pcmcia_remove_ctr, + register_appl: b1_register_appl, + release_appl: b1_release_appl, + send_message: b1_send_message, + + procinfo: b1pcmcia_procinfo, + ctr_read_proc: b1ctl_read_proc, + driver_read_proc: 0, /* use standard driver_read_proc */ + + add_card: 0, }; /* ------------------------------------------------------------- */ diff --git a/drivers/isdn/avmb1/c4.c b/drivers/isdn/avmb1/c4.c index ae2c492610ea..7f13400019c9 100644 --- a/drivers/isdn/avmb1/c4.c +++ b/drivers/isdn/avmb1/c4.c @@ -580,8 +580,7 @@ static void c4_handle_rx(avmcard *card) avmctrl_info *cinfo; struct sk_buff *skb; void *p = dma->recvbuf; - __u32 ApplId, DataB3Len, NCCI, WindowSize; - __s32 MsgLen; + __u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize; __u8 b1cmd = _get_byte(&p); __u32 cidx; @@ -1311,22 +1310,23 @@ static int c4_add_card(struct capi_driver *driver, struct capicardparams *p) /* ------------------------------------------------------------- */ static struct capi_driver c4_driver = { - "c4", - "0.0", - c4_load_firmware, - c4_reset_ctr, - c4_remove_ctr, - c4_register_appl, - c4_release_appl, - c4_send_message, - - c4_procinfo, - c4_read_proc, - 0, /* use standard driver_read_proc */ - - 0, /* no add_card function */ + name: "c4", + revision: "0.0", + load_firmware: c4_load_firmware, + reset_ctr: c4_reset_ctr, + remove_ctr: c4_remove_ctr, + register_appl: c4_register_appl, + release_appl: c4_release_appl, + send_message: c4_send_message, + + procinfo: c4_procinfo, + ctr_read_proc: c4_read_proc, + driver_read_proc: 0, /* use standard driver_read_proc */ + + add_card: 0, /* no add_card function */ }; + #ifdef MODULE #define c4_init init_module void cleanup_module(void); diff --git a/drivers/isdn/avmb1/capi.c b/drivers/isdn/avmb1/capi.c index ff91a89f84ab..69385b4df28b 100644 --- a/drivers/isdn/avmb1/capi.c +++ b/drivers/isdn/avmb1/capi.c @@ -2054,8 +2054,8 @@ static void lower_callback(unsigned int cmd, __u32 contr, void *data) } static struct capi_interface_user cuser = { - "capi20", - lower_callback, + name: "capi20", + callback: lower_callback, }; static char rev[10]; diff --git a/drivers/isdn/avmb1/capidrv.c b/drivers/isdn/avmb1/capidrv.c index a66057e1c0f2..e512c8672e9c 100644 --- a/drivers/isdn/avmb1/capidrv.c +++ b/drivers/isdn/avmb1/capidrv.c @@ -386,16 +386,16 @@ static inline __u32 b3prot(int l2, int l3) } } -static _cstruct b1config_sync_v110(__u16 rate) +static _cstruct b1config_async_v110(__u16 rate) { /* CAPI-Spec "B1 Configuration" */ static unsigned char buf[9]; buf[0] = 8; /* len */ /* maximum bitrate */ buf[1] = rate & 0xff; buf[2] = (rate >> 8) & 0xff; - buf[3] = buf[4] = 0; /* reserved, bits per character */ - buf[5] = buf[6] = 0; /* reserved, parity */ - buf[7] = buf[9] = 0; /* reserved, stop bits */ + buf[3] = 8; buf[4] = 0; /* 8 bits per character */ + buf[5] = 0; buf[6] = 0; /* parity none */ + buf[7] = 0; buf[8] = 0; /* 1 stop bit */ return buf; } @@ -410,11 +410,11 @@ static _cstruct b1config(int l2, int l3) default: return 0; case ISDN_PROTO_L2_V11096: - return b1config_sync_v110(9600); + return b1config_async_v110(9600); case ISDN_PROTO_L2_V11019: - return b1config_sync_v110(19200); + return b1config_async_v110(19200); case ISDN_PROTO_L2_V11038: - return b1config_sync_v110(38400); + return b1config_async_v110(38400); } } @@ -2464,8 +2464,8 @@ static void __exit proc_exit(void) } static struct capi_interface_user cuser = { - "capidrv", - lower_callback + name: "capidrv", + callback: lower_callback }; int __init capidrv_init(void) diff --git a/drivers/isdn/avmb1/capifs.c b/drivers/isdn/avmb1/capifs.c index d4956c45bb9e..b932c17e0019 100644 --- a/drivers/isdn/avmb1/capifs.c +++ b/drivers/isdn/avmb1/capifs.c @@ -119,8 +119,6 @@ struct inode_operations capifs_root_inode_operations = { lookup: capifs_root_lookup, }; -struct inode_operations capifs_inode_operations; - static struct dentry_operations capifs_dentry_operations = { d_revalidate: capifs_revalidate, }; @@ -468,10 +466,8 @@ static void capifs_read_inode(struct inode *inode) ino_t ino = inode->i_ino; struct capifs_sb_info *sbi = SBI(inode->i_sb); - inode->i_op = NULL; inode->i_mode = 0; inode->i_nlink = 0; - inode->i_size = 0; inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; inode->i_blocks = 0; inode->i_blksize = 1024; @@ -485,9 +481,6 @@ static void capifs_read_inode(struct inode *inode) return; } - /* need dummy inode operations .... */ - inode->i_op = &capifs_inode_operations; - ino -= 2; if ( ino >= sbi->max_ncci ) return; /* Bogus */ diff --git a/drivers/isdn/avmb1/t1isa.c b/drivers/isdn/avmb1/t1isa.c index 7a69f7b52b35..ff77c5f20c93 100644 --- a/drivers/isdn/avmb1/t1isa.c +++ b/drivers/isdn/avmb1/t1isa.c @@ -209,7 +209,7 @@ static void t1_handle_interrupt(avmcard * card) struct sk_buff *skb; unsigned ApplId; - signed MsgLen; + unsigned MsgLen; unsigned DataB3Len; unsigned NCCI; unsigned WindowSize; @@ -597,20 +597,20 @@ static char *t1isa_procinfo(struct capi_ctr *ctrl) /* ------------------------------------------------------------- */ static struct capi_driver t1isa_driver = { - "t1isa", - "0.0", - t1isa_load_firmware, - t1isa_reset_ctr, - t1isa_remove_ctr, - b1_register_appl, - b1_release_appl, - t1isa_send_message, - - t1isa_procinfo, - b1ctl_read_proc, - 0, /* use standard driver_read_proc */ - - t1isa_add_card, + name: "t1isa", + revision: "0.0", + load_firmware: t1isa_load_firmware, + reset_ctr: t1isa_reset_ctr, + remove_ctr: t1isa_remove_ctr, + register_appl: b1_register_appl, + release_appl: b1_release_appl, + send_message: t1isa_send_message, + + procinfo: t1isa_procinfo, + ctr_read_proc: b1ctl_read_proc, + driver_read_proc: 0, /* use standard driver_read_proc */ + + add_card: t1isa_add_card, }; #ifdef MODULE diff --git a/drivers/isdn/avmb1/t1pci.c b/drivers/isdn/avmb1/t1pci.c index d2303feab66f..50ecc729df5f 100644 --- a/drivers/isdn/avmb1/t1pci.c +++ b/drivers/isdn/avmb1/t1pci.c @@ -259,20 +259,20 @@ static char *t1pci_procinfo(struct capi_ctr *ctrl) /* ------------------------------------------------------------- */ static struct capi_driver t1pci_driver = { - "t1pci", - "0.0", - b1dma_load_firmware, - b1dma_reset_ctr, - t1pci_remove_ctr, - b1dma_register_appl, - b1dma_release_appl, - b1dma_send_message, - - t1pci_procinfo, - b1dmactl_read_proc, - 0, /* use standard driver_read_proc */ - - 0, /* no add_card function */ + name: "t1pci", + revision: "0.0", + load_firmware: b1dma_load_firmware, + reset_ctr: b1dma_reset_ctr, + remove_ctr: t1pci_remove_ctr, + register_appl: b1dma_register_appl, + release_appl: b1dma_release_appl, + send_message: b1dma_send_message, + + procinfo: t1pci_procinfo, + ctr_read_proc: b1dmactl_read_proc, + driver_read_proc: 0, /* use standard driver_read_proc */ + + add_card: 0, /* no add_card function */ }; #ifdef MODULE diff --git a/drivers/isdn/divert/divert_init.c b/drivers/isdn/divert/divert_init.c index ce44cfa19cd3..0e0c439641dc 100644 --- a/drivers/isdn/divert/divert_init.c +++ b/drivers/isdn/divert/divert_init.c @@ -1,5 +1,5 @@ /* - * $Id: divert_init.c,v 1.4 1999/08/22 20:26:32 calle Exp $ + * $Id: divert_init.c,v 1.5 2000/11/13 22:51:47 kai Exp $ * * Module init for DSS1 diversion services for i4l. * @@ -19,22 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: divert_init.c,v $ - * Revision 1.4 1999/08/22 20:26:32 calle - * backported changes from kernel 2.3.14: - * - several #include "config.h" gone, others come. - * - "struct device" changed to "struct net_device" in 2.3.14, added a - * define in isdn_compat.h for older kernel versions. - * - * Revision 1.3 1999/07/05 20:21:39 werner - * changes to use diversion sources for all kernel versions. - * removed static device, only proc filesystem used - * - * Revision 1.2 1999/07/04 21:37:30 werner - * Ported from kernel version 2.0 - * - * - * */ #include diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c index 5b08e8025981..8cff1683ae41 100644 --- a/drivers/isdn/divert/divert_procfs.c +++ b/drivers/isdn/divert/divert_procfs.c @@ -1,5 +1,5 @@ /* - * $Id: divert_procfs.c,v 1.9 2000/08/20 07:40:14 keil Exp $ + * $Id: divert_procfs.c,v 1.10 2000/11/13 22:51:47 kai Exp $ * * Filesystem handling for the diversion supplementary services. * @@ -19,38 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: divert_procfs.c,v $ - * Revision 1.9 2000/08/20 07:40:14 keil - * changes from 2.4 - * - * Revision 1.8 2000/03/03 16:37:11 kai - * incorporated some cosmetic changes from the official kernel tree back - * into CVS - * - * Revision 1.7 2000/03/02 00:11:06 werner - * - * Changes related to procfs for 2.3.48 - * - * Revision 1.6 2000/02/14 19:23:03 werner - * - * Changed handling of proc filesystem tables to a more portable version - * - * Revision 1.5 1999/09/14 20:31:01 werner - * - * Removed obsoleted functions for proc fs and synced with new ones. - * - * Revision 1.4 1999/08/06 07:42:48 calle - * Added COMPAT_HAS_NEW_WAITQ for rd_queue for newer kernels. - * - * Revision 1.3 1999/07/05 20:21:41 werner - * changes to use diversion sources for all kernel versions. - * removed static device, only proc filesystem used - * - * Revision 1.2 1999/07/04 21:37:31 werner - * Ported from kernel version 2.0 - * - * - * */ #include diff --git a/drivers/isdn/divert/isdn_divert.c b/drivers/isdn/divert/isdn_divert.c index 7079232e7dcf..f5b6b8773753 100644 --- a/drivers/isdn/divert/isdn_divert.c +++ b/drivers/isdn/divert/isdn_divert.c @@ -1,5 +1,5 @@ /* - * $Id: isdn_divert.c,v 1.5 1999/08/31 11:20:04 paul Exp $ + * $Id: isdn_divert.c,v 1.6 2000/11/13 22:51:47 kai Exp $ * * DSS1 main diversion supplementary handling for i4l. * @@ -19,25 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: isdn_divert.c,v $ - * Revision 1.5 1999/08/31 11:20:04 paul - * various spelling corrections (new checksums may be needed, Karsten!) - * - * Revision 1.4 1999/08/25 20:02:21 werner - * Changed return values for stat_icall(w) from 3->4 and 4->5 because of conflicts - * with existing software definitions. (PtP incomplete called party number) - * - * Revision 1.3 1999/08/22 20:26:35 calle - * backported changes from kernel 2.3.14: - * - several #include "config.h" gone, others come. - * - "struct device" changed to "struct net_device" in 2.3.14, added a - * define in isdn_compat.h for older kernel versions. - * - * Revision 1.2 1999/07/04 21:37:32 werner - * Ported from kernel version 2.0 - * - * - * */ diff --git a/drivers/isdn/divert/isdn_divert.h b/drivers/isdn/divert/isdn_divert.h index 6ab119ed9527..84390c9976c5 100644 --- a/drivers/isdn/divert/isdn_divert.h +++ b/drivers/isdn/divert/isdn_divert.h @@ -1,5 +1,5 @@ /* - * $Id: isdn_divert.h,v 1.4 1999/09/02 13:24:12 paul Exp $ + * $Id: isdn_divert.h,v 1.5 2000/11/13 22:51:47 kai Exp $ * * Header for the diversion supplementary ioctl interface. * @@ -19,19 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: isdn_divert.h,v $ - * Revision 1.4 1999/09/02 13:24:12 paul - * cosmetics; text following #endif is not ANSI C - * - * Revision 1.3 1999/08/22 20:26:37 calle - * backported changes from kernel 2.3.14: - * - several #include "config.h" gone, others come. - * - "struct device" changed to "struct net_device" in 2.3.14, added a - * define in isdn_compat.h for older kernel versions. - * - * Revision 1.2 1999/07/04 21:37:33 werner - * Ported from kernel version 2.0 - * */ diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index 4ed7e4129afa..614f145cb266 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -484,7 +484,7 @@ HiSax_setup(char *line) } i++; } - if (strlen(str)) { + if (str && *str) { strcpy(HiSaxID, str); HiSax_id = HiSaxID; } else { diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c index eca66942e16c..0a2e1d4eca8c 100644 --- a/drivers/isdn/hisax/w6692.c +++ b/drivers/isdn/hisax/w6692.c @@ -1,4 +1,4 @@ -/* $Id: w6692.c,v 1.7 2000/06/26 08:59:15 keil Exp $ +/* $Id: w6692.c,v 1.8 2000/09/07 20:33:30 werner Exp $ * * w6692.c Winbond W6692 specific routines * @@ -46,7 +46,7 @@ static const PCI_ENTRY id_list[] = extern const char *CardType[]; -const char *w6692_revision = "$Revision: 1.7 $"; +const char *w6692_revision = "$Revision: 1.8 $"; #define DBUSY_TIMER_VALUE 80 @@ -1056,6 +1056,7 @@ __initfunc(int setup_w6692(struct IsdnCard *card)) cs->BC_Send_Data = &W6692B_fill_fifo; cs->cardmsg = &w6692_card_msg; cs->irq_func = &W6692_interrupt; + cs->irq_flags |= SA_SHIRQ; W6692Version(cs, "W6692:"); printk(KERN_INFO "W6692 ISTA=0x%X\n", ReadW6692(cs, W_ISTA)); printk(KERN_INFO "W6692 IMASK=0x%X\n", ReadW6692(cs, W_IMASK)); diff --git a/drivers/isdn/hysdn/boardergo.c b/drivers/isdn/hysdn/boardergo.c index 471ec549ec9c..17fc82ffc547 100644 --- a/drivers/isdn/hysdn/boardergo.c +++ b/drivers/isdn/hysdn/boardergo.c @@ -1,4 +1,4 @@ -/* $Id: boardergo.c,v 1.3 2000/05/17 11:41:30 ualbrecht Exp $ +/* $Id: boardergo.c,v 1.4 2000/11/13 22:51:47 kai Exp $ * Linux driver for HYSDN cards, specific routines for ergo type boards. * @@ -24,18 +24,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: boardergo.c,v $ - * Revision 1.3 2000/05/17 11:41:30 ualbrecht - * CAPI 2.0 support added - * - * Revision 1.2 2000/04/23 14:18:36 kai - * merge changes from main tree - * - * Revision 1.1 2000/02/10 19:45:18 werner - * - * Initial release - * - * */ #define __NO_VERSION__ diff --git a/drivers/isdn/hysdn/boardergo.h b/drivers/isdn/hysdn/boardergo.h index 0e2c3f678784..224d1823aa6d 100644 --- a/drivers/isdn/hysdn/boardergo.h +++ b/drivers/isdn/hysdn/boardergo.h @@ -1,4 +1,4 @@ -/* $Id: boardergo.h,v 1.1 2000/02/10 19:44:30 werner Exp $ +/* $Id: boardergo.h,v 1.2 2000/11/13 22:51:47 kai Exp $ * Linux driver for HYSDN cards, definitions for ergo type boards (buffers..). * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH @@ -19,12 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: boardergo.h,v $ - * Revision 1.1 2000/02/10 19:44:30 werner - * - * Initial release - * - * */ diff --git a/drivers/isdn/hysdn/hycapi.c b/drivers/isdn/hysdn/hycapi.c index aabb28b8d1fb..f90d902e25ac 100644 --- a/drivers/isdn/hysdn/hycapi.c +++ b/drivers/isdn/hysdn/hycapi.c @@ -1,4 +1,4 @@ -/* $Id: hycapi.c,v 1.6 2000/07/25 08:07:42 ualbrecht Exp $ +/* $Id: hycapi.c,v 1.7 2000/11/13 22:51:47 kai Exp $ * * Linux driver for HYSDN cards, CAPI2.0-Interface. * written by Ulrich Albrecht (u.albrecht@hypercope.de) for Hypercope GmbH @@ -19,26 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: hycapi.c,v $ - * Revision 1.6 2000/07/25 08:07:42 ualbrecht - * Fixed stupid re-registering bug resulting in system-freeze - * - * Revision 1.5 2000/06/18 16:08:18 keil - * 2.4 PCI changes and some cosmetics - * - * Revision 1.4 2000/06/13 09:13:06 ualbrecht - * Changed internal application handling: Registration is now deferred - * until a CAPI-message is actually sent to the controller (no good - * wasting memory on the card if it's never used anyways). - * Module will now unload more gracefully. - * - * Revision 1.2 2000/05/22 10:31:22 ualbrecht - * Parameter-checking for app-registration fixed - * - * Revision 1.1 2000/05/17 11:34:30 ualbrecht - * Initial release - * - * */ #define __NO_VERSION__ @@ -61,7 +41,7 @@ #include "hysdn_defs.h" #include -static char hycapi_revision[]="$Revision: 1.6 $"; +static char hycapi_revision[]="$Revision: 1.7 $"; typedef struct _hycapi_appl { unsigned int ctrl_mask; diff --git a/drivers/isdn/hysdn/hysdn_boot.c b/drivers/isdn/hysdn/hysdn_boot.c index 31eaa14cb1e2..2af44170e50b 100644 --- a/drivers/isdn/hysdn/hysdn_boot.c +++ b/drivers/isdn/hysdn/hysdn_boot.c @@ -1,4 +1,4 @@ -/* $Id: hysdn_boot.c,v 1.3 2000/05/17 11:41:30 ualbrecht Exp $ +/* $Id: hysdn_boot.c,v 1.4 2000/11/13 22:51:47 kai Exp $ * Linux driver for HYSDN cards, specific routines for booting and pof handling. * @@ -20,18 +20,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: hysdn_boot.c,v $ - * Revision 1.3 2000/05/17 11:41:30 ualbrecht - * CAPI 2.0 support added - * - * Revision 1.2 2000/04/23 14:18:36 kai - * merge changes from main tree - * - * Revision 1.1 2000/02/10 19:45:18 werner - * - * Initial release - * - * */ #define __NO_VERSION__ diff --git a/drivers/isdn/hysdn/hysdn_defs.h b/drivers/isdn/hysdn/hysdn_defs.h index e5ad863d4b93..0e4794c394de 100644 --- a/drivers/isdn/hysdn/hysdn_defs.h +++ b/drivers/isdn/hysdn/hysdn_defs.h @@ -1,4 +1,4 @@ -/* $Id: hysdn_defs.h,v 1.3 2000/06/13 09:14:26 ualbrecht Exp $ +/* $Id: hysdn_defs.h,v 1.4 2000/11/13 22:51:47 kai Exp $ * Linux driver for HYSDN cards, global definitions and exported vars and functions. * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH @@ -19,18 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: hysdn_defs.h,v $ - * Revision 1.3 2000/06/13 09:14:26 ualbrecht - * Removed obsolete struct for CAPI-application tracking. - * - * Revision 1.2 2000/05/17 11:41:30 ualbrecht - * CAPI 2.0 support added - * - * Revision 1.1 2000/02/10 19:44:30 werner - * - * Initial release - * - * */ #ifndef HYSDN_DEFS_H diff --git a/drivers/isdn/hysdn/hysdn_init.c b/drivers/isdn/hysdn/hysdn_init.c index 6ae0c3a7fe93..2b3916753640 100644 --- a/drivers/isdn/hysdn/hysdn_init.c +++ b/drivers/isdn/hysdn/hysdn_init.c @@ -1,4 +1,4 @@ -/* $Id: hysdn_init.c,v 1.5 2000/08/20 16:46:09 keil Exp $ +/* $Id: hysdn_init.c,v 1.6 2000/11/13 22:51:47 kai Exp $ * Linux driver for HYSDN cards, init functions. * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH @@ -19,24 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: hysdn_init.c,v $ - * Revision 1.5 2000/08/20 16:46:09 keil - * Changes for 2.4 - * - * Revision 1.4 2000/06/18 16:08:18 keil - * 2.4 PCI changes and some cosmetics - * - * Revision 1.3 2000/06/13 09:15:07 ualbrecht - * Module will now unload more gracefully. - * - * Revision 1.2 2000/05/17 11:41:30 ualbrecht - * CAPI 2.0 support added - * - * Revision 1.1 2000/02/10 19:45:18 werner - * - * Initial release - * - * */ #include @@ -49,7 +31,7 @@ #include "hysdn_defs.h" -static char *hysdn_init_revision = "$Revision: 1.5 $"; +static char *hysdn_init_revision = "$Revision: 1.6 $"; int cardmax; /* number of found cards */ hysdn_card *card_root = NULL; /* pointer to first card */ diff --git a/drivers/isdn/hysdn/hysdn_net.c b/drivers/isdn/hysdn/hysdn_net.c index 61441da10ef6..cf250e48d924 100644 --- a/drivers/isdn/hysdn/hysdn_net.c +++ b/drivers/isdn/hysdn/hysdn_net.c @@ -1,4 +1,4 @@ -/* $Id: hysdn_net.c,v 1.7 2000/05/23 06:48:54 ualbrecht Exp $ +/* $Id: hysdn_net.c,v 1.8 2000/11/13 22:51:47 kai Exp $ * Linux driver for HYSDN cards, net (ethernet type) handling routines. * @@ -23,33 +23,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: hysdn_net.c,v $ - * Revision 1.7 2000/05/23 06:48:54 ualbrecht - * Reverted last change in dev->name assignment (broken netdevice.h in 2.3.99pre6?) - * - * Revision 1.6 2000/05/17 11:43:03 ualbrecht - * Fixed a NULL-pointer kernel-oops assigning the device-name - * - * Revision 1.5 2000/05/06 00:52:38 kai - * merged changes from kernel tree - * fixed timer and net_device->name breakage - * - * Revision 1.4 2000/04/23 14:18:36 kai - * merge changes from main tree - * - * Revision 1.3 2000/02/14 19:24:12 werner - * - * Removed superflous file - * - * Revision 1.2 2000/02/13 17:32:19 werner - * - * Added support for new network layer of 2.3.43 and 44 kernels and tested driver. - * - * Revision 1.1 2000/02/10 19:45:18 werner - * - * Initial release - * - * */ #define __NO_VERSION__ @@ -65,7 +38,7 @@ #include "hysdn_defs.h" /* store the actual version for log reporting */ -char *hysdn_net_revision = "$Revision: 1.7 $"; +char *hysdn_net_revision = "$Revision: 1.8 $"; #define MAX_SKB_BUFFERS 20 /* number of buffers for keeping TX-data */ diff --git a/drivers/isdn/hysdn/hysdn_pof.h b/drivers/isdn/hysdn/hysdn_pof.h index 619c07897850..524b7a0ae9c5 100644 --- a/drivers/isdn/hysdn/hysdn_pof.h +++ b/drivers/isdn/hysdn/hysdn_pof.h @@ -1,4 +1,4 @@ -/* $Id: hysdn_pof.h,v 1.1 2000/02/10 19:44:30 werner Exp $ +/* $Id: hysdn_pof.h,v 1.2 2000/11/13 22:51:47 kai Exp $ * Linux driver for HYSDN cards, definitions used for handling pof-files. * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH @@ -19,12 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: hysdn_pof.h,v $ - * Revision 1.1 2000/02/10 19:44:30 werner - * - * Initial release - * - * */ /************************/ diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c index aa17c10146bd..2200f9906711 100644 --- a/drivers/isdn/hysdn/hysdn_procconf.c +++ b/drivers/isdn/hysdn/hysdn_procconf.c @@ -1,4 +1,4 @@ -/* $Id: hysdn_procconf.c,v 1.7 2000/08/20 16:46:09 keil Exp $ +/* $Id: hysdn_procconf.c,v 1.8 2000/11/13 22:51:47 kai Exp $ * Linux driver for HYSDN cards, /proc/net filesystem dir and conf functions. * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH @@ -19,33 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: hysdn_procconf.c,v $ - * Revision 1.7 2000/08/20 16:46:09 keil - * Changes for 2.4 - * - * Revision 1.6 2000/05/17 11:41:30 ualbrecht - * CAPI 2.0 support added - * - * Revision 1.5 2000/04/23 14:18:36 kai - * merge changes from main tree - * - * Revision 1.4 2000/03/03 16:37:12 kai - * incorporated some cosmetic changes from the official kernel tree back - * into CVS - * - * Revision 1.3 2000/03/02 00:11:07 werner - * - * Changes related to procfs for 2.3.48 - * - * Revision 1.2 2000/02/14 19:23:03 werner - * - * Changed handling of proc filesystem tables to a more portable version - * - * Revision 1.1 2000/02/10 19:45:18 werner - * - * Initial release - * - * */ #define __NO_VERSION__ @@ -58,7 +31,7 @@ #include "hysdn_defs.h" -static char *hysdn_procconf_revision = "$Revision: 1.7 $"; +static char *hysdn_procconf_revision = "$Revision: 1.8 $"; #define INFO_OUT_LEN 80 /* length of info line including lf */ diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c index a0ac125fe1b9..09c595236672 100644 --- a/drivers/isdn/hysdn/hysdn_proclog.c +++ b/drivers/isdn/hysdn/hysdn_proclog.c @@ -1,4 +1,4 @@ -/* $Id: hysdn_proclog.c,v 1.7 2000/08/20 16:46:09 keil Exp $ +/* $Id: hysdn_proclog.c,v 1.8 2000/11/13 22:51:47 kai Exp $ * Linux driver for HYSDN cards, /proc/net filesystem log functions. * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH @@ -19,33 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: hysdn_proclog.c,v $ - * Revision 1.7 2000/08/20 16:46:09 keil - * Changes for 2.4 - * - * Revision 1.6 2000/06/18 16:08:18 keil - * 2.4 PCI changes and some cosmetics - * - * Revision 1.5 2000/04/23 14:18:36 kai - * merge changes from main tree - * - * Revision 1.4 2000/03/03 16:37:12 kai - * incorporated some cosmetic changes from the official kernel tree back - * into CVS - * - * Revision 1.3 2000/03/02 00:11:07 werner - * - * Changes related to procfs for 2.3.48 - * - * Revision 1.2 2000/02/14 19:23:03 werner - * - * Changed handling of proc filesystem tables to a more portable version - * - * Revision 1.1 2000/02/10 19:45:18 werner - * - * Initial release - * - * */ #define __NO_VERSION__ diff --git a/drivers/isdn/hysdn/hysdn_sched.c b/drivers/isdn/hysdn/hysdn_sched.c index 64b8782f0e6d..3091c2bc1622 100644 --- a/drivers/isdn/hysdn/hysdn_sched.c +++ b/drivers/isdn/hysdn/hysdn_sched.c @@ -1,4 +1,4 @@ -/* $Id: hysdn_sched.c,v 1.3 2000/05/17 11:41:30 ualbrecht Exp $ +/* $Id: hysdn_sched.c,v 1.4 2000/11/13 22:51:47 kai Exp $ * Linux driver for HYSDN cards, scheduler routines for handling exchange card <-> pc. * @@ -20,18 +20,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: hysdn_sched.c,v $ - * Revision 1.3 2000/05/17 11:41:30 ualbrecht - * CAPI 2.0 support added - * - * Revision 1.2 2000/04/23 14:18:36 kai - * merge changes from main tree - * - * Revision 1.1 2000/02/10 19:45:18 werner - * - * Initial release - * - * */ #define __NO_VERSION__ diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c index 29245ddff572..180b3711a4e5 100644 --- a/drivers/isdn/icn/icn.c +++ b/drivers/isdn/icn/icn.c @@ -1,4 +1,4 @@ -/* $Id: icn.c,v 1.64 2000/10/02 17:33:43 keil Exp $ +/* $Id: icn.c,v 1.65 2000/11/13 22:51:48 kai Exp $ * ISDN low-level module for the ICN active ISDN-Card. * @@ -18,227 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: icn.c,v $ - * Revision 1.64 2000/10/02 17:33:43 keil - * Fix NULL pointer error (thanks Luca Montecchia) - * - * Revision 1.63 2000/05/06 00:52:39 kai - * merged changes from kernel tree - * fixed timer and net_device->name breakage - * - * Revision 1.62 1999/09/06 07:29:35 fritz - * Changed my mail-address. - * - * Revision 1.61 1999/09/03 14:06:58 fritz - * Fixed a memory leak. - * - * Revision 1.60 1999/08/31 11:20:32 paul - * various spelling corrections (new checksums may be needed, Karsten!) - * - * Revision 1.59 1999/08/28 22:10:55 keil - * __setup function should be static - * - * Revision 1.58 1999/08/25 16:44:17 keil - * Support for new __setup function - * - * Revision 1.57 1999/07/06 16:15:30 detabc - * remove unused messages - * - * Revision 1.56 1999/04/12 13:15:07 fritz - * Fixed a cast. - * - * Revision 1.55 1999/04/12 12:34:02 fritz - * Changes from 2.0 tree. - * - * Revision 1.54 1999/01/05 18:29:39 he - * merged remaining schedule_timeout() changes from 2.1.127 - * - * Revision 1.53 1998/06/17 19:51:28 he - * merged with 2.1.10[34] (cosmetics and udelay() -> mdelay()) - * brute force fix to avoid Ugh's in isdn_tty_write() - * cleaned up some dead code - * - * Revision 1.52 1998/05/20 19:29:58 tsbogend - * fixed bug introduced by changes for new BSENT callback - * - * Revision 1.51 1998/03/07 22:29:55 fritz - * Adapted Detlef's chenges for 2.1. - * - * Revision 1.49 1998/02/13 11:14:15 keil - * change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb() - * - * Revision 1.48 1997/10/10 15:56:14 fritz - * New HL<->LL interface: - * New BSENT callback with nr. of bytes included. - * Sending without ACK. - * - * Revision 1.47 1997/10/01 09:21:51 fritz - * Removed old compatibility stuff for 2.0.X kernels. - * From now on, this code is for 2.1.X ONLY! - * Old stuff is still in the separate branch. - * - * Revision 1.46 1997/08/21 22:38:33 fritz - * Fixed a typo. - * - * Revision 1.45 1997/06/21 10:42:06 fritz - * Added availability to select leased mode on only one channel. - * - * Revision 1.44 1997/03/30 16:51:26 calle - * changed calls to copy_from_user/copy_to_user and removed verify_area - * were possible. - * - * Revision 1.43 1997/03/21 18:27:04 fritz - * Corrected parsing of incoming setup. - * - * Revision 1.42 1997/03/05 21:13:18 fritz - * Bugfix: sndcount was not reset on hangup. - * - * Revision 1.41 1997/02/24 23:34:29 fritz - * Bugfix in Layer1 error-recovery. - * - * Revision 1.40 1997/02/23 23:34:45 fritz - * Minor bugfixes in debugging code. - * - * Revision 1.39 1997/02/23 16:21:56 fritz - * Bugfix: Check for NULL pointer in icn_parse_status(). - * - * Revision 1.38 1997/02/11 18:29:31 fritz - * Bugfix in D64S initialization. - * - * Revision 1.37 1997/02/10 22:43:20 fritz - * Added plan and screen elements on ISDN_STAT_ICALL - * - * Revision 1.36 1997/02/10 21:31:20 fritz - * Changed setup-interface (incoming and outgoing). - * - * Revision 1.35 1997/02/10 10:10:28 fritz - * Changes for Kernel 2.1.X compatibility. - * Enhanced initialization, can recover from - * misconfiguration by other autoprobing drivers. - * - * Revision 1.34 1997/01/29 22:34:44 fritz - * Cleanup, Corrected D64S setup of 2nd channel. - * - * Revision 1.33 1996/12/05 20:31:48 tsbogend - * added handling of L2: DATA LINK LOST messages - * - * Revision 1.32 1996/11/14 23:49:18 fritz - * Bugfix: copy_to_user/copy_from_user mismatch in debugging-ioctl. - * - * Revision 1.31 1996/11/13 02:36:25 fritz - * Fixed a race condition in writecmd. - * Some optimizations and cleanup. - * - * Revision 1.30 1996/10/22 23:14:09 fritz - * Changes for compatibility to 2.0.X and 2.1.X kernels. - * - * Revision 1.29 1996/08/29 20:34:54 fritz - * Bugfix in send queue management: - * sndcount was not updated correctly. - * Minor Bugfixes. - * - * Revision 1.28 1996/06/28 17:02:53 fritz - * replaced memcpy_fromfs_toio. - * - * Revision 1.27 1996/06/25 18:38:59 fritz - * Fixed function name in error message. - * - * Revision 1.26 1996/06/24 17:20:35 fritz - * Bugfixes in pollbchan_send(): - * - Using lock field of skbuff breaks networking. - * - Added channel locking - * - changed dequeuing scheme. - * Eliminated misc. compiler warnings. - * - * Revision 1.25 1996/06/11 22:53:35 tsbogend - * fixed problem with large array on stack - * made the driver working on Linux/alpha - * - * Revision 1.24 1996/06/06 13:58:33 fritz - * Changed code to be architecture independent - * - * Revision 1.23 1996/06/03 19:59:00 fritz - * Fixed typos. - * - * Revision 1.22 1996/05/17 15:46:41 fritz - * Removed own queue management. - * Changed queue management to use sk_buffs. - * - * Revision 1.21 1996/05/02 04:01:20 fritz - * Bugfix: - * - icn_addcard() evaluated wrong driverId. - * - * Revision 1.20 1996/05/02 00:40:27 fritz - * Major rewrite to support more than one card - * with a single module. - * Support for new firmware. - * - * Revision 1.19 1996/04/21 17:43:32 fritz - * Changes for Support of new Firmware BRV3.02 - * - * Revision 1.18 1996/04/20 16:50:26 fritz - * Fixed status-buffer overrun. - * Misc. typos - * - * Revision 1.17 1996/02/11 02:39:04 fritz - * Increased Buffer for status-messages. - * Removed conditionals for HDLC-firmware. - * - * Revision 1.16 1996/01/22 05:01:55 fritz - * Revert to GPL. - * - * Revision 1.15 1996/01/10 20:57:39 fritz - * Bugfix: Loading firmware twice caused the device stop working. - * - * Revision 1.14 1995/12/18 18:23:37 fritz - * Support for ICN-2B Cards. - * Change for supporting user-settable service-octet. - * - * Revision 1.13 1995/10/29 21:41:07 fritz - * Added support for DriverId's, added Jan's patches for Kernel versions. - * - * Revision 1.12 1995/04/29 13:07:35 fritz - * Added support for new Euro-ISDN-firmware - * - * Revision 1.11 1995/04/23 13:40:45 fritz - * Added support for SPV's. - * Changed Dial-Command to support MSN's on DSS1-Lines. - * - * Revision 1.10 1995/03/25 23:23:24 fritz - * Changed configurable Ports, to allow settings for DIP-Switch Cardversions. - * - * Revision 1.9 1995/03/25 23:17:30 fritz - * Fixed race-condition in pollbchan_send - * - * Revision 1.8 1995/03/15 12:49:44 fritz - * Added support for SPV's - * Split pollbchan_work for calling send-routine directly - * - * Revision 1.7 1995/02/20 03:48:03 fritz - * Added support of new request_region-function. - * Minor bugfixes. - * - * Revision 1.6 1995/01/31 15:48:45 fritz - * Added Cause-Messages to be signaled to upper layers. - * Added Revision-Info on load. - * - * Revision 1.5 1995/01/29 23:34:59 fritz - * Added stopdriver() and appropriate calls. - * Changed printk-statements to support loglevels. - * - * Revision 1.4 1995/01/09 07:40:46 fritz - * Added GPL-Notice - * - * Revision 1.3 1995/01/04 05:15:18 fritz - * Added undocumented "bootload-finished"-command in download-code - * to satisfy some brain-damaged icn card-versions. - * - * Revision 1.2 1995/01/02 02:14:45 fritz - * Misc Bugfixes - * - * Revision 1.1 1994/12/14 17:56:06 fritz - * Initial revision - * */ #include "icn.h" @@ -254,7 +33,7 @@ #undef MAP_DEBUG static char -*revision = "$Revision: 1.64 $"; +*revision = "$Revision: 1.65 $"; static int icn_addcard(int, char *, char *); diff --git a/drivers/isdn/icn/icn.h b/drivers/isdn/icn/icn.h index 6d40a695c434..b49887c2aadf 100644 --- a/drivers/isdn/icn/icn.h +++ b/drivers/isdn/icn/icn.h @@ -1,4 +1,4 @@ -/* $Id: icn.h,v 1.29 1999/09/06 07:29:35 fritz Exp $ +/* $Id: icn.h,v 1.30 2000/11/13 22:51:48 kai Exp $ * ISDN lowlevel-module for the ICN active ISDN-Card. * @@ -18,110 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: icn.h,v $ - * Revision 1.29 1999/09/06 07:29:35 fritz - * Changed my mail-address. - * - * Revision 1.28 1997/10/10 15:56:18 fritz - * New HL<->LL interface: - * New BSENT callback with nr. of bytes included. - * Sending without ACK. - * - * Revision 1.27 1997/10/01 09:21:56 fritz - * Removed old compatibility stuff for 2.0.X kernels. - * From now on, this code is for 2.1.X ONLY! - * Old stuff is still in the separate branch. - * - * Revision 1.26 1997/02/14 12:23:16 fritz - * Added support for new insmod parameter handling. - * - * Revision 1.25 1997/02/10 10:10:31 fritz - * Changes for Kernel 2.1.X compatibility. - * Enhanced initialization, can recover from - * misconfiguration by other autoprobing drivers. - * - * Revision 1.24 1997/01/29 22:34:46 fritz - * Cleanup, Corrected D64S setup of 2nd channel. - * - * Revision 1.23 1996/12/17 18:47:55 tsbogend - * changed timeouts from absolute numbers to HZ based values - * - * Revision 1.22 1996/11/13 02:37:33 fritz - * Added delay include. - * - * Revision 1.21 1996/08/29 20:35:57 fritz - * Speed up B-Channel polling interval. - * - * Revision 1.20 1996/06/24 17:20:37 fritz - * Bugfixes in pollbchan_send(): - * - Using lock field of skbuff breaks networking. - * - Added channel locking - * - changed dequeuing scheme. - * Eliminated misc. compiler warnings. - * - * Revision 1.19 1996/06/06 13:58:35 fritz - * Changed code to be architecture independent - * - * Revision 1.18 1996/06/03 19:59:30 fritz - * Removed include of config.h - * - * Revision 1.17 1996/05/18 00:47:04 fritz - * Removed callback debug code. - * - * Revision 1.16 1996/05/17 15:46:43 fritz - * Removed own queue management. - * Changed queue management to use sk_buffs. - * - * Revision 1.15 1996/05/02 04:01:57 fritz - * Removed ICN_MAXCARDS - * - * Revision 1.14 1996/05/02 00:40:29 fritz - * Major rewrite to support more than one card - * with a single module. - * Support for new firmware. - * - * Revision 1.13 1996/04/20 16:51:41 fritz - * Increased status buffer. - * Misc. typos - * - * Revision 1.12 1996/01/22 05:01:22 fritz - * Revert to GPL. - * - * Revision 1.11 1995/12/18 18:25:00 fritz - * Support for ICN-2B Cards. - * Change for supporting user-settable service-octet. - * - * Revision 1.10 1995/10/29 21:43:10 fritz - * Added support for leased lines. - * - * Revision 1.9 1995/04/23 13:42:10 fritz - * Added some constants for distinguishing 1TR6 and DSS1 - * - * Revision 1.8 1995/03/25 23:18:55 fritz - * Changed ICN_PORTLEN to reflect correct number of ports. - * - * Revision 1.7 1995/03/15 12:52:06 fritz - * Some cleanup - * - * Revision 1.6 1995/02/20 03:49:22 fritz - * Fixed ICN_MAX_SQUEUE to correctly reflect outstanding bytes, not number - * of buffers. - * - * Revision 1.5 1995/01/29 23:36:50 fritz - * Minor cleanup. - * - * Revision 1.4 1995/01/09 07:41:20 fritz - * Added GPL-Notice - * - * Revision 1.3 1995/01/04 05:14:20 fritz - * removed include of linux/asm/string.h for compiling with Linux 1.1.76 - * - * Revision 1.2 1995/01/02 02:15:57 fritz - * Misc. Bugfixes - * - * Revision 1.1 1994/12/14 18:02:38 fritz - * Initial revision - * */ #ifndef icn_h diff --git a/drivers/isdn/isdn_ppp.c b/drivers/isdn/isdn_ppp.c index 66b7dfd493aa..5ad0edc6a9ea 100644 --- a/drivers/isdn/isdn_ppp.c +++ b/drivers/isdn/isdn_ppp.c @@ -1,4 +1,4 @@ -/* $Id: isdn_ppp.c,v 1.82 2000/11/02 22:48:30 kai Exp $ +/* $Id: isdn_ppp.c,v 1.84 2000/11/13 22:51:46 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.82 $"; +char *isdn_ppp_revision = "$Revision: 1.84 $"; static struct ippp_struct *ippp_table[ISDN_MAX_CHANNELS]; diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c index 9168aca8cbba..f91723bbe078 100644 --- a/drivers/isdn/isdnloop/isdnloop.c +++ b/drivers/isdn/isdnloop/isdnloop.c @@ -1,4 +1,4 @@ -/* $Id: isdnloop.c,v 1.9 1999/09/06 07:29:36 fritz Exp $ +/* $Id: isdnloop.c,v 1.11 2000/11/13 22:51:50 kai Exp $ * ISDN low-level module implementing a dummy loop driver. * @@ -18,48 +18,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: isdnloop.c,v $ - * Revision 1.9 1999/09/06 07:29:36 fritz - * Changed my mail-address. - * - * Revision 1.8 1998/11/18 18:59:43 armin - * changes for 2.1.127 - * - * Revision 1.7 1998/10/30 18:58:03 he - * typecast to suppress a compiler warning - * - * Revision 1.6 1998/06/17 19:51:37 he - * merged with 2.1.10[34] (cosmetics and udelay() -> mdelay()) - * brute force fix to avoid Ugh's in isdn_tty_write() - * cleaned up some dead code - * - * Revision 1.5 1998/04/14 20:59:32 he - * merged 2.1.94 changes - * - * Revision 1.4 1998/02/24 21:39:05 he - * L2_PROT_X25DTE / DCE - * additional state 17 and new internal signal messages "BCON_I" - * (for reliable connect confirmation primitive as needed by x.25 upper layer) - * Changes for new LL-HL interface - * - * Revision 1.3 1998/02/20 17:33:30 fritz - * Changes for recent kernels. - * - * Revision 1.2 1997/10/01 09:22:03 fritz - * Removed old compatibility stuff for 2.0.X kernels. - * From now on, this code is for 2.1.X ONLY! - * Old stuff is still in the separate branch. - * - * Revision 1.1 1997/03/24 23:02:04 fritz - * Added isdnloop driver. - * */ #include #include "isdnloop.h" static char -*revision = "$Revision: 1.9 $"; +*revision = "$Revision: 1.11 $"; static int isdnloop_addcard(char *); @@ -865,6 +830,7 @@ isdnloop_parse_cmd(isdnloop_card * card) if (card->rcard[ch - 1]) { isdnloop_fake(card->rcard[ch - 1], "BCON_I", card->rch[ch - 1] + 1); + isdnloop_fake(card, "BCON_C", ch); } break; case 17: diff --git a/drivers/isdn/isdnloop/isdnloop.h b/drivers/isdn/isdnloop/isdnloop.h index 82266edbe393..e0ddaaf36a37 100644 --- a/drivers/isdn/isdnloop/isdnloop.h +++ b/drivers/isdn/isdnloop/isdnloop.h @@ -1,4 +1,4 @@ -/* $Id: isdnloop.h,v 1.4 1999/09/06 07:29:36 fritz Exp $ +/* $Id: isdnloop.h,v 1.5 2000/11/13 22:51:50 kai Exp $ * Loopback lowlevel module for testing of linklevel. * @@ -18,21 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: isdnloop.h,v $ - * Revision 1.4 1999/09/06 07:29:36 fritz - * Changed my mail-address. - * - * Revision 1.3 1998/04/14 20:59:35 he - * merged 2.1.94 changes - * - * Revision 1.2 1997/10/01 09:22:07 fritz - * Removed old compatibility stuff for 2.0.X kernels. - * From now on, this code is for 2.1.X ONLY! - * Old stuff is still in the separate branch. - * - * Revision 1.1 1997/03/24 23:02:05 fritz - * Added isdnloop driver. - * */ #ifndef isdnloop_h diff --git a/drivers/isdn/sc/debug.c b/drivers/isdn/sc/debug.c index d032508acec4..09c11f57da03 100644 --- a/drivers/isdn/sc/debug.c +++ b/drivers/isdn/sc/debug.c @@ -1,5 +1,5 @@ /* - * $Id: debug.c,v 1.4 2000/10/28 23:03:40 kai Exp $ + * $Id: debug.c,v 1.5 2000/11/12 15:29:37 kai Exp $ * Copyright (C) 1996 SpellCaster Telecommunications Inc. * * This program is free software; you can redistribute it and/or modify diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index ff67aad62b09..4103b0ea58ad 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -858,13 +858,16 @@ static void compute_parity(struct stripe_head *sh, int method) PRINTK("compute_parity, stripe %lu, method %d\n", sh->sector, method); for (i = 0; i < disks; i++) { + char *bdata; if (i == pd_idx || !sh->bh_new[i]) continue; if (!sh->bh_copy[i]) sh->bh_copy[i] = raid5_alloc_buffer(sh, sh->size); raid5_build_block(sh, sh->bh_copy[i], i); atomic_set_buffer_dirty(sh->bh_copy[i]); - memcpy(sh->bh_copy[i]->b_data, sh->bh_new[i]->b_data, sh->size); + bdata = bh_kmap(sh->bh_new[i]); + memcpy(sh->bh_copy[i]->b_data, bdata, sh->size); + bh_kunmap(sh->bh_new[i]); } if (sh->bh_copy[pd_idx] == NULL) { sh->bh_copy[pd_idx] = raid5_alloc_buffer(sh, sh->size); @@ -965,12 +968,14 @@ static void complete_stripe(struct stripe_head *sh) if (!sh->new[i]) { #if 0 if (sh->cmd == STRIPE_WRITE) { - if (memcmp(sh->bh_new[i]->b_data, sh->bh_copy[i]->b_data, sh->size)) { + char *bdata = bh_kmap(sh->bh_new[i]); + if (memcmp(bdata, sh->bh_copy[i]->b_data, sh->size)) { printk("copy differs, %s, sector %lu ", test_bit(BH_Dirty, &sh->bh_new[i]->b_state) ? "dirty" : "clean", sh->sector); } else if (test_bit(BH_Dirty, &sh->bh_new[i]->b_state)) printk("sector %lu dirty\n", sh->sector); + bh_kunmap(sh->bh_new[i]); } #endif if (sh->cmd == STRIPE_WRITE) @@ -1136,11 +1141,14 @@ static void handle_stripe_read (mddev_t *mddev , raid5_conf_t *conf, if (!method1 || (method1 == 1 && nr_cache == disks - 1)) { PRINTK("read %lu completed from cache\n", sh->sector); for (i = 0; i < disks; i++) { + char *bdata; if (!sh->bh_new[i]) continue; if (!sh->bh_old[i]) compute_block(sh, i); - memcpy(sh->bh_new[i]->b_data, sh->bh_old[i]->b_data, sh->size); + bdata = bh_kmap(sh->bh_new[i]); + memcpy(bdata, sh->bh_old[i]->b_data, sh->size); + bh_kunmap(sh->bh_new[i]); } complete_stripe(sh); return; @@ -1168,7 +1176,9 @@ static void handle_stripe_read (mddev_t *mddev , raid5_conf_t *conf, if (!sh->bh_new[i]) continue; if (sh->bh_old[i]) { - memcpy(sh->bh_new[i]->b_data, sh->bh_old[i]->b_data, sh->size); + char *bdata = bh_kmap(sh->bh_new[i]); + memcpy(bdata, sh->bh_old[i]->b_data, sh->size); + bh_kunmap(sh->bh_new[i]); continue; } #if RAID5_PARANOIA diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 7714370c9dab..feb72365193f 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c @@ -5,7 +5,7 @@ * PPPoE --- PPP over Ethernet (RFC 2516) * * - * Version: 0.6.3 + * Version: 0.6.4 * * 030700 : Fixed connect logic to allow for disconnect. * 270700 : Fixed potential SMP problems; we must protect against @@ -13,12 +13,11 @@ * and ppp_unregister_channel. * 040800 : Respect reference count mechanisms on net-devices. * 200800 : fix kfree(skb) in pppoe_rcv (acme) - * * Module reference count is decremented in the right spot now, * guards against sock_put not actually freeing the sk * in pppoe_release. - * - * 051000 : Initialization cleanup + * 051000 : Initialization cleanup. + * 111100 : Fix recvmsg. * * Author: Michal Ostrowski * Contributors: @@ -533,13 +532,10 @@ int pppoe_release(struct socket *sock) if (po->pppoe_dev) dev_put(po->pppoe_dev); - /* Should also do a queue purge here */ - sock_orphan(sk); sock->sk = NULL; skb_queue_purge(&sk->receive_queue); - sock_put(sk); return error; @@ -566,7 +562,7 @@ int pppoe_connect(struct socket *sock, struct sockaddr *uservaddr, if ((sk->state & PPPOX_CONNECTED) && sp->sa_addr.pppoe.sid) goto end; - /* Check for already disconnected sockets, + /* Check for already disconnected sockets, on attempts to disconnect */ error = -EALREADY; if((sk->state & PPPOX_DEAD) && !sp->sa_addr.pppoe.sid ) @@ -590,7 +586,7 @@ int pppoe_connect(struct socket *sock, struct sockaddr *uservaddr, /* Don't re-bind if sid==0 */ if (sp->sa_addr.pppoe.sid != 0) { dev = dev_get_by_name(sp->sa_addr.pppoe.dev); - + error = -ENODEV; if (!dev) goto end; @@ -726,6 +722,7 @@ int pppoe_ioctl(struct socket *sock, unsigned int cmd, if (!relay_po) break; + sock_put(relay_po->sk); sk->state |= PPPOX_RELAY; err = 0; break; @@ -757,7 +754,6 @@ int pppoe_sendmsg(struct socket *sock, struct msghdr *m, struct pppoe_hdr *ph; struct net_device *dev; char *start; - int copied = 0; if (sk->dead || !(sk->state & PPPOX_CONNECTED)) { error = -ENOTCONN; @@ -773,6 +769,11 @@ int pppoe_sendmsg(struct socket *sock, struct msghdr *m, dev = sk->protinfo.pppox->pppoe_dev; + error = -EMSGSIZE; + if(total_len > dev->mtu+dev->hard_header_len) + goto end; + + skb = sock_wmalloc(sk, total_len + dev->hard_header_len + 32, 0, GFP_KERNEL); if (!skb) { @@ -793,21 +794,25 @@ int pppoe_sendmsg(struct socket *sock, struct msghdr *m, ph = (struct pppoe_hdr *) skb_put(skb, total_len + sizeof(struct pppoe_hdr)); start = (char *) &ph->tag[0]; - error = copied = memcpy_fromiovec( start, m->msg_iov, m->msg_iovlen); - if( error <= 0 ) - goto end; + error = memcpy_fromiovec( start, m->msg_iov, total_len); + + if (error < 0) { + kfree_skb(skb); + goto end; + } + error = total_len; dev->hard_header(skb, dev, ETH_P_PPP_SES, sk->protinfo.pppox->pppoe_pa.remote, - NULL, copied); + NULL, total_len); memcpy(ph, &hdr, sizeof(struct pppoe_hdr)); - ph->length = htons(copied); + ph->length = htons(total_len); dev_queue_xmit(skb); -end: + end: release_sock(sk); return error; } @@ -1025,7 +1030,7 @@ int __init pppoe_init(void) int err = register_pppox_proto(PX_PROTO_OE, &pppoe_proto); if (err == 0) { - printk(KERN_INFO "Registered PPPoE v0.6.3\n"); + printk(KERN_INFO "Registered PPPoE v0.6.4\n"); dev_add_pack(&pppoes_ptype); register_netdevice_notifier(&pppoe_notifier); diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index af184f47294f..bfb0f57dfd00 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c @@ -1,4 +1,4 @@ -/* $Id: sunhme.c,v 1.100 2000/11/12 10:23:30 davem Exp $ +/* $Id: sunhme.c,v 1.104 2000/11/17 01:40:00 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. @@ -48,8 +48,8 @@ static char *version = #ifndef __sparc_v9__ #include #endif -#include #endif +#include #include #include @@ -171,6 +171,25 @@ static __inline__ void tx_dump_ring(struct happy_meal *hp) #define DEFAULT_IPG2 4 /* For all modes */ #define DEFAULT_JAMSIZE 4 /* Toe jam */ +#ifdef CONFIG_PCI +/* This happy_pci_ids is declared __initdata because it is only used + as an advisory to depmod. If this is ported to the new PCI interface + where it could be referenced at any time due to hot plugging, + it should be changed to __devinitdata. */ + +struct pci_device_id happymeal_pci_ids[] __initdata = { + { + vendor: PCI_VENDOR_ID_SUN, + device: PCI_DEVICE_ID_SUN_HAPPYMEAL, + subvendor: PCI_ANY_ID, + subdevice: PCI_ANY_ID, + }, + { } /* Terminating entry */ +}; + +MODULE_DEVICE_TABLE(pci, happymeal_pci_ids); +#endif + /* NOTE: In the descriptor writes one _must_ write the address * member _first_. The card must not be allowed to see * the updated descriptor flags until the address is @@ -1600,6 +1619,10 @@ static int happy_meal_init(struct happy_meal *hp, int from_irq) HMD(("happy_meal_init: old[%08x] bursts<", hme_read32(hp, gregs + GREG_CFG))); +#ifndef __sparc__ + /* It is always PCI and can handle 64byte bursts. */ + hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST64); +#else if ((hp->happy_bursts & DMA_BURST64) && ((hp->happy_flags & HFLAG_PCI) != 0 #ifdef CONFIG_SBUS @@ -1633,6 +1656,7 @@ static int happy_meal_init(struct happy_meal *hp, int from_irq) HMD(("XXX>")); hme_write32(hp, gregs + GREG_CFG, 0); } +#endif /* __sparc__ */ /* Turn off interrupts we do not want to hear. */ HMD((", enable global interrupts, ")); @@ -2887,8 +2911,10 @@ static int __init happy_meal_pci_init(struct net_device *dev, struct pci_dev *pd /* And of course, indicate this is PCI. */ hp->happy_flags |= HFLAG_PCI; +#ifdef __sparc__ /* Assume PCI happy meals can handle all burst sizes. */ hp->happy_bursts = DMA_BURSTBITS; +#endif hp->happy_block = (struct hmeal_init_block *) pci_alloc_consistent(pdev, PAGE_SIZE, &hp->hblock_dvma); diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index f101e25f7f18..eaba0cd3415f 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c @@ -17,6 +17,7 @@ * History * LAPBETH 001 Jonathan Naylor Cloned from bpqether.c * 2000-10-29 Henner Eisen lapb_data_indication() return status. + * 2000-11-14 Henner Eisen dev_hold/put, NETDEV_GOING_DOWN support */ #include @@ -80,6 +81,7 @@ static struct lapbethdev { /* * Get the ethernet device for a LAPB device */ +#if 0 static __inline__ struct net_device *lapbeth_get_ether_dev(struct net_device *dev) { struct lapbethdev *lapbeth; @@ -88,7 +90,7 @@ static __inline__ struct net_device *lapbeth_get_ether_dev(struct net_device *de return (lapbeth != NULL) ? lapbeth->ethdev : NULL; } - +#endif /* * Get the LAPB device for the ethernet device */ @@ -137,6 +139,7 @@ static int lapbeth_check_devices(struct net_device *dev) result = 1; unregister_netdev(&lapbeth->axdev); + dev_put(lapbeth->ethdev); kfree(lapbeth); } @@ -419,6 +422,7 @@ static int lapbeth_new_device(struct net_device *dev) memset(lapbeth, 0, sizeof(struct lapbethdev)); + dev_hold(dev); lapbeth->ethdev = dev; lapbeth->ethname[sizeof(lapbeth->ethname)-1] = '\0'; @@ -437,6 +441,7 @@ static int lapbeth_new_device(struct net_device *dev) } if (k == MAXLAPBDEV) { + dev_put(dev); kfree(lapbeth); return -ENODEV; } @@ -446,6 +451,7 @@ static int lapbeth_new_device(struct net_device *dev) dev->init = lapbeth_dev_init; if (register_netdev(dev) != 0) { + dev_put(dev); kfree(lapbeth); return -EIO; } @@ -499,6 +505,7 @@ static int lapbeth_device_event(struct notifier_block *this,unsigned long event, lapbeth_new_device(dev); break; + case NETDEV_GOING_DOWN: case NETDEV_DOWN: /* ethernet device closed -> close LAPB interface */ if ((dev = lapbeth_get_x25_dev(dev)) != NULL) dev_close(dev); diff --git a/drivers/nubus/proc.c b/drivers/nubus/proc.c index f41daa570279..40ca15bb075b 100644 --- a/drivers/nubus/proc.c +++ b/drivers/nubus/proc.c @@ -148,7 +148,7 @@ int nubus_proc_detach_device(struct nubus_dev *dev) struct proc_dir_entry *e; if ((e = dev->procdir)) { - if (e->count) + if (atomic_read(&e->count)) return -EBUSY; remove_proc_entry(e->name, proc_bus_nubus_dir); dev->procdir = NULL; diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index 81902c5729df..049cdcf35456 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c @@ -279,7 +279,7 @@ int pci_proc_detach_device(struct pci_dev *dev) struct proc_dir_entry *e; if ((e = dev->procent)) { - if (e->count) + if (atomic_read(&e->count)) return -EBUSY; remove_proc_entry(e->name, dev->bus->procdir); dev->procent = NULL; diff --git a/drivers/usb/hub.c b/drivers/usb/hub.c index dc662182357c..8ecc1221bb66 100644 --- a/drivers/usb/hub.c +++ b/drivers/usb/hub.c @@ -36,7 +36,7 @@ static LIST_HEAD(hub_list); /* List containing all of the hubs (for cleanup) */ static DECLARE_WAIT_QUEUE_HEAD(khubd_wait); static int khubd_pid = 0; /* PID of khubd */ -static int khubd_running = 0; +static DECLARE_MUTEX_LOCKED(khubd_exited); static int usb_get_hub_descriptor(struct usb_device *dev, void *data, int size) { @@ -741,8 +741,6 @@ he_unlock: static int usb_hub_thread(void *__hub) { - khubd_running = 1; - lock_kernel(); /* @@ -762,9 +760,8 @@ static int usb_hub_thread(void *__hub) } while (!signal_pending(current)); dbg("usb_hub_thread exiting"); - khubd_running = 0; - return 0; + up_and_exit(&khubd_exited, 0); } static struct usb_device_id hub_id_table [] = { @@ -815,18 +812,8 @@ void usb_hub_cleanup(void) /* Kill the thread */ ret = kill_proc(khubd_pid, SIGTERM, 1); - if (!ret) { - /* Wait 10 seconds */ - int count = 10 * 100; - while (khubd_running && --count) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(1); - } - - if (!count) - err("giving up on killing khubd"); - } + down(&khubd_exited); /* * Hub resources are freed for us by usb_deregister. It calls diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c index ae157d1aceb7..0eb91f3c20b0 100644 --- a/fs/autofs/inode.c +++ b/fs/autofs/inode.c @@ -211,7 +211,6 @@ static void autofs_read_inode(struct inode *inode) inode->i_fop = &autofs_dir_operations; inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO; inode->i_nlink = 2; - inode->i_size = 0; inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; inode->i_blocks = 0; inode->i_blksize = 1024; diff --git a/fs/devfs/base.c b/fs/devfs/base.c index 67962d5dcc5b..5c412e301f99 100644 --- a/fs/devfs/base.c +++ b/fs/devfs/base.c @@ -2250,7 +2250,6 @@ static void devfs_read_inode (struct inode *inode) printk ("%s: read_inode(%d): VFS inode: %p devfs_entry: %p\n", DEVFS_NAME, (int) inode->i_ino, inode, de); #endif - inode->i_size = 0; inode->i_blocks = 0; inode->i_blksize = 1024; inode->i_op = &devfs_iops; @@ -2416,11 +2415,6 @@ static int devfs_readdir (struct file *file, void *dirent, filldir_t filldir) struct devfs_entry *parent, *de; struct inode *inode = file->f_dentry->d_inode; - if (inode == NULL) - { - printk ("%s: readdir(): NULL inode\n", DEVFS_NAME); - return -EBADF; - } if ( !S_ISDIR (inode->i_mode) ) { printk ("%s: readdir(): inode is not a directory\n", DEVFS_NAME); diff --git a/fs/dquot.c b/fs/dquot.c index ef1f15016f36..1bcd12ceb2e1 100644 --- a/fs/dquot.c +++ b/fs/dquot.c @@ -679,8 +679,6 @@ restart: if (!filp->f_dentry) continue; inode = filp->f_dentry->d_inode; - if (!inode) - continue; if (filp->f_mode & FMODE_WRITE && dqinit_needed(inode, type)) { file_list_unlock(); sb->dq_op->initialize(inode, type); diff --git a/fs/efs/dir.c b/fs/efs/dir.c index ac64b8aeb320..9bba7a2cbfa2 100644 --- a/fs/efs/dir.c +++ b/fs/efs/dir.c @@ -28,9 +28,6 @@ static int efs_readdir(struct file *filp, void *dirent, filldir_t filldir) { int slot, namelen; char *nameptr; - if (!inode || !S_ISDIR(inode->i_mode)) - return -EBADF; - if (inode->i_size & (EFS_DIRBSIZE-1)) printk(KERN_WARNING "EFS: WARNING: readdir(): directory size not a multiple of EFS_DIRBSIZE\n"); diff --git a/fs/fat/inode.c b/fs/fat/inode.c index aed45096d6bd..7537ee5693b1 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -794,7 +794,6 @@ static void fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) inode->i_nlink = 1; } #endif - inode->i_size = 0; if ((nr = MSDOS_I(inode)->i_start) != 0) while (nr != -1) { inode->i_size += SECTOR_SIZE*sbi->cluster_size; @@ -818,7 +817,6 @@ static void fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) (CF_LE_W(de->starthi) << 16); } MSDOS_I(inode)->i_logstart = MSDOS_I(inode)->i_start; - inode->i_nlink = 1; inode->i_size = CF_LE_L(de->size); inode->i_op = &fat_file_inode_operations; inode->i_fop = &fat_file_operations; diff --git a/fs/file_table.c b/fs/file_table.c index 931314661e61..09b28574dc26 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -176,10 +176,13 @@ int fs_may_remount_ro(struct super_block *sb) file_list_lock(); for (p = sb->s_files.next; p != &sb->s_files; p = p->next) { struct file *file = list_entry(p, struct file, f_list); - struct inode *inode = file->f_dentry->d_inode; - if (!inode) + struct inode *inode; + + if (!file->f_dentry) continue; + inode = file->f_dentry->d_inode; + /* File with pending delete? */ if (inode->i_nlink == 0) goto too_bad; diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c index 8d77ed2f7483..c9915cf809a0 100644 --- a/fs/isofs/dir.c +++ b/fs/isofs/dir.c @@ -40,14 +40,17 @@ struct inode_operations isofs_dir_inode_operations = lookup: isofs_lookup, }; -static int isofs_name_translate(char * old, int len, char * new) +int isofs_name_translate(struct iso_directory_record *de, char *new, struct inode *inode) { - int i, c; + char * old = de->name; + int len = de->name_len[0]; + int i; for (i = 0; i < len; i++) { - c = old[i]; + unsigned char c = old[i]; if (!c) break; + if (c >= 'A' && c <= 'Z') c |= 0x20; /* lower case */ @@ -74,8 +77,7 @@ int get_acorn_filename(struct iso_directory_record * de, { int std; unsigned char * chr; - int retnamlen = isofs_name_translate(de->name, - de->name_len[0], retname); + int retnamlen = isofs_name_translate(de, retname, inode); if (retnamlen == 0) return 0; std = sizeof(struct iso_directory_record) + de->name_len[0]; if (std & 1) std++; @@ -94,14 +96,6 @@ int get_acorn_filename(struct iso_directory_record * de, return retnamlen; } -static struct buffer_head *isofs_bread(struct inode *inode, unsigned int bufsize, unsigned int block) -{ - unsigned int blknr = isofs_bmap(inode, block); - if (!blknr) - return NULL; - return bread(inode->i_dev, blknr, bufsize); -} - /* * This should _really_ be cleaned up some day.. */ @@ -138,12 +132,9 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp, } de = (struct iso_directory_record *) (bh->b_data + offset); - if (first_de) inode_number = (bh->b_blocknr << bufbits) + (offset & (bufsize - 1)); + if (first_de) inode_number = (bh->b_blocknr << bufbits) + offset; de_len = *(unsigned char *) de; -#ifdef DEBUG - printk("de_len = %d\n", de_len); -#endif /* If the length byte is zero, we should move on to the next CDROM sector. If we are at the end of the directory, we @@ -152,32 +143,29 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp, if (de_len == 0) { brelse(bh); bh = NULL; - filp->f_pos = ((filp->f_pos & ~(ISOFS_BLOCK_SIZE - 1)) + ISOFS_BLOCK_SIZE); + filp->f_pos = (filp->f_pos + ISOFS_BLOCK_SIZE) & ~(ISOFS_BLOCK_SIZE - 1); block = filp->f_pos >> bufbits; offset = 0; continue; } offset += de_len; - if (offset == bufsize) { - offset = 0; - block++; - brelse(bh); - bh = NULL; - } /* Make sure we have a full directory entry */ - if (offset > bufsize) { + if (offset >= bufsize) { int slop = bufsize - offset + de_len; memcpy(tmpde, de, slop); offset &= bufsize - 1; block++; brelse(bh); - bh = isofs_bread(inode, bufsize, block); - if (!bh) - return 0; - memcpy((void *) tmpde + slop, bh->b_data, de_len - slop); - de = tmpde; + bh = NULL; + if (offset) { + bh = isofs_bread(inode, bufsize, block); + if (!bh) + return 0; + memcpy((void *) tmpde + slop, bh->b_data, offset); + } + de = tmpde; } if (de->flags[-high_sierra] & 0x80) { @@ -227,7 +215,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp, if (map) { #ifdef CONFIG_JOLIET if (inode->i_sb->u.isofs_sb.s_joliet_level) { - len = get_joliet_filename(de, inode, tmpname); + len = get_joliet_filename(de, tmpname, inode); p = tmpname; } else #endif @@ -236,8 +224,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp, p = tmpname; } else if (inode->i_sb->u.isofs_sb.s_mapping == 'n') { - len = isofs_name_translate(de->name, - de->name_len[0], tmpname); + len = isofs_name_translate(de, tmpname, inode); p = tmpname; } else { p = de->name; @@ -252,7 +239,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp, continue; } - brelse(bh); + if (bh) brelse(bh); return 0; } diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 157b8ebbab4d..453e4a456c36 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -972,14 +972,24 @@ int isofs_bmap(struct inode *inode, int block) return 0; } +struct buffer_head *isofs_bread(struct inode *inode, unsigned int bufsize, unsigned int block) +{ + unsigned int blknr = isofs_bmap(inode, block); + if (!blknr) + return NULL; + return bread(inode->i_dev, blknr, bufsize); +} + static int isofs_readpage(struct file *file, struct page *page) { return block_read_full_page(page,isofs_get_block); } + static int _isofs_bmap(struct address_space *mapping, long block) { return generic_block_bmap(mapping,block,isofs_get_block); } + static struct address_space_operations isofs_aops = { readpage: isofs_readpage, sync_page: block_sync_page, @@ -1002,93 +1012,89 @@ static inline void test_and_set_gid(gid_t *p, gid_t value) static int isofs_read_level3_size(struct inode * inode) { - unsigned long ino = inode->i_ino; + unsigned long f_pos = inode->i_ino; unsigned long bufsize = ISOFS_BUFFER_SIZE(inode); int high_sierra = inode->i_sb->u.isofs_sb.s_high_sierra; struct buffer_head * bh = NULL; - int block = 0; + unsigned long block, offset; int i = 0; int more_entries = 0; - void *cpnt; - struct iso_directory_record * raw_inode; + struct iso_directory_record * tmpde = kmalloc(256, GFP_KERNEL); + + if (!tmpde) + return -ENOMEM; inode->i_size = 0; inode->u.isofs_i.i_next_section_ino = 0; + + block = f_pos >> ISOFS_BUFFER_BITS(inode); + offset = f_pos & (bufsize-1); + do { - unsigned char *pnt; - unsigned int reclen; - int offset = (ino & (bufsize - 1)); - - cpnt = NULL; - /* Check whether to update our buffer */ - if (block != ino >> ISOFS_BUFFER_BITS(inode)) { - block = ino >> ISOFS_BUFFER_BITS(inode); - brelse(bh); + struct iso_directory_record * de; + unsigned int de_len; + + if (!bh) { bh = bread(inode->i_dev, block, bufsize); if (!bh) goto out_noread; } - pnt = ((unsigned char *) bh->b_data + offset); - /* - * Note: this is invariant even if the record - * spans buffers and must be copied ... - */ - reclen = *pnt; + de = (struct iso_directory_record *) (bh->b_data + offset); + de_len = *(unsigned char *) de; - /* N.B. this test doesn't trigger the i++ code ... */ - if(reclen == 0) { - ino = (ino & ~(ISOFS_BLOCK_SIZE - 1)) + ISOFS_BLOCK_SIZE; + if (de_len == 0) { + brelse(bh); + bh = NULL; + f_pos = (f_pos + ISOFS_BLOCK_SIZE) & ~(ISOFS_BLOCK_SIZE - 1); + block = f_pos >> ISOFS_BUFFER_BITS(inode); + offset = 0; continue; } - raw_inode = ((struct iso_directory_record *) pnt); - - /* Check whether the raw inode spans the buffer ... */ - if (offset + reclen > bufsize){ - int frag1 = bufsize - offset; - - cpnt = kmalloc(reclen, GFP_KERNEL); - if (cpnt == NULL) - goto out_nomem; - memcpy(cpnt, pnt, frag1); + + offset += de_len; + + /* Make sure we have a full directory entry */ + if (offset >= bufsize) { + int slop = bufsize - offset + de_len; + memcpy(tmpde, de, slop); + offset &= bufsize - 1; + block++; brelse(bh); - bh = bread(inode->i_dev, ++block, bufsize); - if (!bh) - goto out_noread; - offset += reclen - bufsize; - memcpy((char *)cpnt+frag1, bh->b_data, offset); - raw_inode = ((struct iso_directory_record *) cpnt); + bh = NULL; + if (offset) { + bh = bread(inode->i_dev, block, bufsize); + if (!bh) + goto out_noread; + memcpy((void *) tmpde + slop, bh->b_data, offset); + } + de = tmpde; } - inode->i_size += isonum_733 (raw_inode->size); - if(i == 1) inode->u.isofs_i.i_next_section_ino = ino; + inode->i_size += isonum_733(de->size); + if (i == 1) + inode->u.isofs_i.i_next_section_ino = f_pos; - more_entries = raw_inode->flags[-high_sierra] & 0x80; + more_entries = de->flags[-high_sierra] & 0x80; - ino += reclen; - if (cpnt) - kfree (cpnt); + f_pos += de_len; i++; if(i > 100) goto out_toomany; } while(more_entries); out: - brelse(bh); + kfree(tmpde); + if (bh) brelse(bh); return 0; -out_nomem: - printk(KERN_INFO "ISOFS: NoMem ISO inode %lu\n", inode->i_ino); - brelse(bh); - return 1; out_noread: - printk(KERN_INFO "ISOFS: unable to read i-node block %d\n", block); - if (cpnt) - kfree(cpnt); + printk(KERN_INFO "ISOFS: unable to read i-node block %lu\n", block); + kfree(tmpde); return 1; out_toomany: printk(KERN_INFO "isofs_read_level3_size: " "More than 100 file sections ?!?, aborting...\n" "isofs_read_level3_size: inode=%lu ino=%lu\n", - inode->i_ino, ino); + inode->i_ino, f_pos); goto out; } @@ -1259,143 +1265,6 @@ static void isofs_read_inode(struct inode * inode) return; } -/* There are times when we need to know the inode number of a parent of - a particular directory. When control passes through a routine that - has access to the parent information, it fills it into the inode structure, - but sometimes the inode gets flushed out of the queue, and someone - remembers the number. When they try to open up again, we have lost - the information. The '..' entry on the disc points to the data area - for a particular inode, so we can follow these links back up, but since - we do not know the inode number, we do not actually know how large the - directory is. The disc is almost always correct, and there is - enough error checking on the drive itself, but an open ended search - makes me a little nervous. - - The BSD iso filesystem uses the extent number for an inode, and this - would work really nicely for us except that the read_inode function - would not have any clean way of finding the actual directory record - that goes with the file. If we had such info, then it would pay - to change the inode numbers and eliminate this function. -*/ - -int isofs_lookup_grandparent(struct inode * parent, int extent) -{ - unsigned long bufsize = ISOFS_BUFFER_SIZE(parent); - unsigned char bufbits = ISOFS_BUFFER_BITS(parent); - unsigned int block,offset; - int parent_dir, inode_number; - int result; - int directory_size; - struct buffer_head * bh; - struct iso_directory_record * de; - - offset = 0; - block = extent << (ISOFS_ZONE_BITS(parent) - bufbits); - if (!(bh = bread(parent->i_dev, block, bufsize))) return -1; - - while (1 == 1) { - de = (struct iso_directory_record *) (bh->b_data + offset); - if (*((unsigned char *) de) == 0) - { - brelse(bh); - printk("Directory .. not found\n"); - return -1; - } - - offset += *((unsigned char *) de); - - if (offset >= bufsize) - { - printk(".. Directory not in first block" - " of directory.\n"); - brelse(bh); - return -1; - } - - if (de->name_len[0] == 1 && de->name[0] == 1) - { - parent_dir = find_rock_ridge_relocation(de, parent); - directory_size = isonum_733 (de->size); - brelse(bh); - break; - } - } -#ifdef DEBUG - printk("Parent dir:%x\n",parent_dir); -#endif - /* Now we know the extent where the parent dir starts on. */ - - result = -1; - - offset = 0; - block = parent_dir << (ISOFS_ZONE_BITS(parent) - bufbits); - if (!block || !(bh = bread(parent->i_dev,block, bufsize))) - { - return -1; - } - - for(;;) - { - de = (struct iso_directory_record *) (bh->b_data + offset); - inode_number = (block << bufbits)+(offset & (bufsize - 1)); - - /* If the length byte is zero, we should move on to the next - CDROM sector. If we are at the end of the directory, we - kick out of the while loop. */ - - if ((*((unsigned char *) de) == 0) || (offset == bufsize) ) - { - brelse(bh); - offset = 0; - block++; - directory_size -= bufsize; - if(directory_size < 0) return -1; - if((block & 1) && (ISOFS_ZONE_BITS(parent) - bufbits) == 1) - { - return -1; - } - if((block & 3) && (ISOFS_ZONE_BITS(parent) - bufbits) == 2) - { - return -1; - } - if (!block - || !(bh = bread(parent->i_dev,block, bufsize))) - { - return -1; - } - continue; - } - - /* Make sure that the entire directory record is in the current - bh block. If not, we malloc a buffer, and put the two - halves together, so that we can cleanly read the block. */ - - offset += *((unsigned char *) de); - - if (offset > bufsize) - { - printk("Directory overrun\n"); - goto out; - } - - if (find_rock_ridge_relocation(de, parent) == extent){ - result = inode_number; - goto out; - } - - } - - /* We go here for any condition we cannot handle. - We also drop through to here at the end of the directory. */ - - out: - brelse(bh); -#ifdef DEBUG - printk("Resultant Inode %d\n",result); -#endif - return result; -} - #ifdef LEAK_CHECK #undef malloc #undef free_s diff --git a/fs/isofs/joliet.c b/fs/isofs/joliet.c index 009314a82416..5b93f458154b 100644 --- a/fs/isofs/joliet.c +++ b/fs/isofs/joliet.c @@ -70,8 +70,7 @@ wcsntombs_be(__u8 *s, const __u8 *pwcs, int inlen, int maxlen) } int -get_joliet_filename(struct iso_directory_record * de, struct inode * inode, - unsigned char *outname) +get_joliet_filename(struct iso_directory_record * de, unsigned char *outname, struct inode * inode) { unsigned char utf8; struct nls_table *nls; diff --git a/fs/isofs/namei.c b/fs/isofs/namei.c index 7d4ca4e98088..c5d64240c454 100644 --- a/fs/isofs/namei.c +++ b/fs/isofs/namei.c @@ -57,147 +57,87 @@ isofs_cmp(struct dentry * dentry, const char * compare, int dlen) * itself (as an inode number). It does NOT read the inode of the * entry - you'll have to do that yourself if you want to. */ -static struct buffer_head * -isofs_find_entry(struct inode *dir, struct dentry *dentry, unsigned long *ino) +static unsigned long +isofs_find_entry(struct inode *dir, struct dentry *dentry, + char * tmpname, struct iso_directory_record * tmpde) { + unsigned long inode_number; unsigned long bufsize = ISOFS_BUFFER_SIZE(dir); unsigned char bufbits = ISOFS_BUFFER_BITS(dir); - unsigned int block, i, f_pos, offset, - inode_number = 0; /* shut gcc up */ - struct buffer_head * bh , * retval = NULL; - unsigned int old_offset; - int dlen, match; - char * dpnt; - unsigned char *page = NULL; - struct iso_directory_record * de = NULL; /* shut gcc up */ - char de_not_in_buf = 0; /* true if de is in kmalloc'd memory */ - char c; - - *ino = 0; - - if (!(block = dir->u.isofs_i.i_first_extent)) return NULL; + unsigned int block, f_pos, offset; + struct buffer_head * bh = NULL; + + if (!dir->u.isofs_i.i_first_extent) + return 0; f_pos = 0; - - offset = f_pos & (bufsize - 1); - block = isofs_bmap(dir,f_pos >> bufbits); - - if (!block || !(bh = bread(dir->i_dev,block,bufsize))) return NULL; + offset = 0; + block = 0; while (f_pos < dir->i_size) { + struct iso_directory_record * de; + int de_len, match, i, dlen; + char *dpnt; - /* if de is in kmalloc'd memory, do not point to the - next de, instead we will move to the next sector */ - if(!de_not_in_buf) { - de = (struct iso_directory_record *) - (bh->b_data + offset); + if (!bh) { + bh = isofs_bread(dir, bufsize, block); + if (!bh) + return 0; } - inode_number = (block << bufbits) + (offset & (bufsize - 1)); - - /* If byte is zero, or we had to fetch this de past - the end of the buffer, this is the end of file, or - time to move to the next sector. Usually 2048 byte - boundaries. */ - - if (*((unsigned char *) de) == 0 || de_not_in_buf) { - if(de_not_in_buf) { - /* james@bpgc.com: Since we slopped - past the end of the last buffer, we - must start some way into the new - one */ - de_not_in_buf = 0; - kfree(de); - f_pos += offset; - } - else { - offset = 0; - f_pos = ((f_pos & ~(ISOFS_BLOCK_SIZE - 1)) - + ISOFS_BLOCK_SIZE); - } - brelse(bh); - bh = NULL; - - if (f_pos >= dir->i_size) - break; - block = isofs_bmap(dir,f_pos>>bufbits); - if (!block || !(bh = bread(dir->i_dev,block,bufsize))) - break; + de = (struct iso_directory_record *) (bh->b_data + offset); + inode_number = (bh->b_blocknr << bufbits) + offset; - continue; /* Will kick out if past end of directory */ + de_len = *(unsigned char *) de; + if (!de_len) { + brelse(bh); + bh = NULL; + f_pos = (f_pos + ISOFS_BLOCK_SIZE) & ~(ISOFS_BLOCK_SIZE - 1); + block = f_pos >> bufbits; + offset = 0; + continue; } - old_offset = offset; - offset += *((unsigned char *) de); - f_pos += *((unsigned char *) de); + offset += de_len; + f_pos += de_len; - /* james@bpgc.com: new code to handle case where the - directory entry spans two blocks. Usually 1024 - byte boundaries */ + /* Make sure we have a full directory entry */ if (offset >= bufsize) { - struct buffer_head *bh_next; - - /* james@bpgc.com: read the next block, and - copy the split de into a newly kmalloc'd - buffer */ - block = isofs_bmap(dir,f_pos>>bufbits); - if (!block || - !(bh_next = bread(dir->i_dev,block,bufsize))) - break; - - de = (struct iso_directory_record *) - kmalloc(offset - old_offset, GFP_KERNEL); - memcpy((char *)de, bh->b_data + old_offset, - bufsize - old_offset); - memcpy((char *)de + bufsize - old_offset, - bh_next->b_data, offset - bufsize); - brelse(bh_next); - de_not_in_buf = 1; - offset -= bufsize; + int slop = bufsize - offset + de_len; + memcpy(tmpde, de, slop); + offset &= bufsize - 1; + block++; + brelse(bh); + bh = NULL; + if (offset) { + bh = isofs_bread(dir, bufsize, block); + if (!bh) + return 0; + memcpy((void *) tmpde + slop, bh->b_data, offset); + } + de = tmpde; } + dlen = de->name_len[0]; dpnt = de->name; - if (dir->i_sb->u.isofs_sb.s_rock || - dir->i_sb->u.isofs_sb.s_joliet_level || - dir->i_sb->u.isofs_sb.s_mapping == 'n' || - dir->i_sb->u.isofs_sb.s_mapping == 'a') { - if (! page) { - page = (unsigned char *) - __get_free_page(GFP_KERNEL); - if (!page) break; - } - } if (dir->i_sb->u.isofs_sb.s_rock && - ((i = get_rock_ridge_filename(de, page, dir)))) { + ((i = get_rock_ridge_filename(de, tmpname, dir)))) { dlen = i; - dpnt = page; + dpnt = tmpname; #ifdef CONFIG_JOLIET } else if (dir->i_sb->u.isofs_sb.s_joliet_level) { - dlen = get_joliet_filename(de, dir, page); - dpnt = page; + dlen = get_joliet_filename(de, dir, tmpname); + dpnt = tmpname; #endif } else if (dir->i_sb->u.isofs_sb.s_mapping == 'a') { - dlen = get_acorn_filename(de, page, dir); - dpnt = page; + dlen = get_acorn_filename(de, tmpname, dir); + dpnt = tmpname; } else if (dir->i_sb->u.isofs_sb.s_mapping == 'n') { - for (i = 0; i < dlen; i++) { - c = dpnt[i]; - /* lower case */ - if (c >= 'A' && c <= 'Z') c |= 0x20; - if (c == ';' && i == dlen-2 && dpnt[i+1] == '1') { - dlen -= 2; - break; - } - if (c == ';') c = '.'; - page[i] = c; - } - /* This allows us to match with and without - * a trailing period. */ - if(page[dlen-1] == '.' && dentry->d_name.len == dlen-1) - dlen--; - dpnt = page; + dlen = isofs_name_translate(de, tmpname, dir); + dpnt = tmpname; } + /* * Skip hidden or associated files unless unhide is set */ @@ -208,43 +148,32 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry, unsigned long *ino) match = (isofs_cmp(dentry,dpnt,dlen) == 0); } if (match) { - if(inode_number == -1) { - /* Should only happen for the '..' entry */ - inode_number = - isofs_lookup_grandparent(dir, - find_rock_ridge_relocation(de,dir)); - } - *ino = inode_number; - retval = bh; - bh = NULL; - break; + if (bh) brelse(bh); + return inode_number; } } - if (page) free_page((unsigned long) page); if (bh) brelse(bh); - if(de_not_in_buf) - kfree(de); - return retval; + return 0; } struct dentry *isofs_lookup(struct inode * dir, struct dentry * dentry) { unsigned long ino; - struct buffer_head * bh; struct inode *inode; + struct page *page; #ifdef DEBUG printk("lookup: %x %s\n",dir->i_ino, dentry->d_name.name); #endif dentry->d_op = dir->i_sb->s_root->d_op; - bh = isofs_find_entry(dir, dentry, &ino); + page = alloc_page(GFP_USER); + ino = isofs_find_entry(dir, dentry, page_address(page), 1024 + page_address(page)); + __free_page(page); inode = NULL; - if (bh) { - brelse(bh); - - inode = iget(dir->i_sb,ino); + if (ino) { + inode = iget(dir->i_sb, ino); if (!inode) return ERR_PTR(-EACCES); } diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c index 9ea3cafdb1cc..f61005aaca61 100644 --- a/fs/jffs/inode-v23.c +++ b/fs/jffs/inode-v23.c @@ -349,7 +349,6 @@ jffs_new_inode(const struct inode * dir, struct jffs_raw_inode *raw_inode, inode->i_blksize = PAGE_SIZE; inode->i_blocks = (inode->i_size + 511) >> 9; inode->i_version = 0; - inode->i_flags = sb->s_flags; inode->u.generic_ip = (void *)jffs_find_file(c, raw_inode->ino); insert_inode_hash(inode); diff --git a/fs/jffs/intrep.c b/fs/jffs/intrep.c index d3706c05e8e8..09e88d7bad77 100644 --- a/fs/jffs/intrep.c +++ b/fs/jffs/intrep.c @@ -3054,9 +3054,8 @@ jffs_garbage_collect_thread(void *ptr) case SIGKILL: D1(printk("jffs_garbage_collect_thread(): SIGKILL received.\n")); c->gc_task = NULL; - up(&c->gc_thread_sem); unlock_kernel(); - return(0); + up_and_exit(&c->gc_thread_sem, 0); } } diff --git a/fs/namei.c b/fs/namei.c index 026dc7e1039b..c0d1abc36e57 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1381,7 +1381,10 @@ asmlinkage long sys_rmdir(const char * pathname) case LAST_DOTDOT: error = -ENOTEMPTY; goto exit1; - case LAST_ROOT: case LAST_DOT: + case LAST_DOT: + error = -EINVAL; + goto exit1; + case LAST_ROOT: error = -EBUSY; goto exit1; } diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c index 139c9262de1d..ac4de2b832b3 100644 --- a/fs/ncpfs/file.c +++ b/fs/ncpfs/file.c @@ -120,11 +120,6 @@ ncp_file_read(struct file *file, char *buf, size_t count, loff_t *ppos) DPRINTK("ncp_file_read: enter %s/%s\n", dentry->d_parent->d_name.name, dentry->d_name.name); - error = -EINVAL; - if (inode == NULL) { - DPRINTK("ncp_file_read: inode = NULL\n"); - goto out; - } error = -EIO; if (!ncp_conn_valid(NCP_SERVER(inode))) goto out; @@ -210,10 +205,6 @@ ncp_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos) DPRINTK("ncp_file_write: enter %s/%s\n", dentry->d_parent->d_name.name, dentry->d_name.name); - if (inode == NULL) { - DPRINTK("ncp_file_write: inode = NULL\n"); - return -EINVAL; - } errno = -EIO; if (!ncp_conn_valid(NCP_SERVER(inode))) goto out; diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index fee191bd7612..5b582024ef94 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -723,7 +723,6 @@ nfs_fhget(struct dentry *dentry, struct nfs_fh *fhandle, struct inode *inode = new_inode(sb); if (!inode) goto out; - inode->i_flags = 0; inode->i_ino = nfs_fattr_to_ino_t(fattr); nfs_read_inode(inode); nfs_fill_inode(inode, fattr); diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 910ffe095030..3fdc84ed131b 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -1050,7 +1050,7 @@ ntfs_clear_bit (unsigned char *byte, int bit) /* We have to skip the 16 metafiles and the 8 reserved entries */ static int -new_inode (ntfs_volume* vol,int* result) +ntfs_new_inode (ntfs_volume* vol,int* result) { int byte,error; int bit; @@ -1236,11 +1236,11 @@ int ntfs_alloc_inode (ntfs_inode *dir, ntfs_inode *result, ntfs_volume* vol=dir->vol; int byte,bit; - error=new_inode (vol,&(result->i_number)); + error=ntfs_new_inode (vol,&(result->i_number)); if(error==ENOSPC){ error=ntfs_extend_mft(vol); if(error)return error; - error=new_inode(vol,&(result->i_number)); + error=ntfs_new_inode(vol,&(result->i_number)); } if(error){ ntfs_error ("ntfs_get_empty_inode: no free inodes\n"); diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 0dd6e6063402..e58b04e02ebb 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -215,7 +215,7 @@ static int proc_follow_link(struct dentry *dentry, struct nameidata *nd) static struct inode_operations proc_link_inode_operations = { readlink: proc_readlink, - follow_link: proc_follow_link + follow_link: proc_follow_link, }; /* @@ -396,8 +396,6 @@ static void proc_kill_inodes(struct proc_dir_entry *de) if (dentry->d_op != &proc_dentry_operations) continue; inode = dentry->d_inode; - if (!inode) - continue; if (inode->u.generic_ip != de) continue; fops_put(filp->f_op); @@ -573,12 +571,12 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent) (void *) proc_alloc_map); proc_kill_inodes(de); de->nlink = 0; - de->deleted = 1; - if (!de->count) + if (!atomic_read(&de->count)) free_proc_entry(de); else { + de->deleted = 1; printk("remove_proc_entry: %s/%s busy, count=%d\n", - parent->name, de->name, de->count); + parent->name, de->name, atomic_read(&de->count)); } break; } diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 7b571398af8c..3453bf88b7d2 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -25,7 +25,7 @@ extern void free_proc_entry(struct proc_dir_entry *); struct proc_dir_entry * de_get(struct proc_dir_entry *de) { if (de) - de->count++; + atomic_inc(&de->count); return de; } @@ -34,20 +34,21 @@ struct proc_dir_entry * de_get(struct proc_dir_entry *de) */ void de_put(struct proc_dir_entry *de) { - if (de) { - lock_kernel(); /* FIXME: count should be atomic_t */ - if (!de->count) { + if (de) { + lock_kernel(); + if (!atomic_read(&de->count)) { printk("de_put: entry %s already free!\n", de->name); + unlock_kernel(); return; } - if (!--de->count) { + if (atomic_dec_and_test(&de->count)) { if (de->deleted) { printk("de_put: deferred delete of %s\n", de->name); free_proc_entry(de); } - } + } unlock_kernel(); } } @@ -139,7 +140,7 @@ struct inode * proc_get_inode(struct super_block * sb, int ino, #if 1 /* shouldn't ever happen */ if (de && de->deleted) -printk("proc_iget: using deleted entry %s, count=%d\n", de->name, de->count); +printk("proc_iget: using deleted entry %s, count=%d\n", de->name, atomic_read(&de->count)); #endif inode = iget(sb, ino); diff --git a/fs/proc/root.c b/fs/proc/root.c index 075a5843df66..cae8619608da 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -96,10 +96,12 @@ static struct inode_operations proc_root_inode_operations = { * This is the root "inode" in the /proc tree.. */ struct proc_dir_entry proc_root = { - PROC_ROOT_INO, 5, "/proc", - S_IFDIR | S_IRUGO | S_IXUGO, 2, 0, 0, - 0, &proc_root_inode_operations, &proc_root_operations, - NULL, NULL, - NULL, - &proc_root, NULL + low_ino: PROC_ROOT_INO, + namelen: 5, + name: "/proc", + mode: S_IFDIR | S_IRUGO | S_IXUGO, + nlink: 2, + proc_iops: &proc_root_inode_operations, + proc_fops: &proc_root_operations, + parent: &proc_root, }; diff --git a/fs/sysv/ialloc.c b/fs/sysv/ialloc.c index d45304cfae58..7709ade8d904 100644 --- a/fs/sysv/ialloc.c +++ b/fs/sysv/ialloc.c @@ -142,7 +142,6 @@ struct inode * sysv_new_inode(const struct inode * dir) mark_inode_dirty(inode); /* Change directory entry: */ inode->i_mode = 0; /* for sysv_write_inode() */ - inode->i_size = 0; /* ditto */ sysv_write_inode(inode, 0); /* ensure inode not allocated again */ /* FIXME: caller may call this too. */ mark_inode_dirty(inode); /* cleared by sysv_write_inode() */ diff --git a/fs/udf/dir.c b/fs/udf/dir.c index 9f093c536bc1..9ec279e47a62 100644 --- a/fs/udf/dir.c +++ b/fs/udf/dir.c @@ -86,12 +86,6 @@ int udf_readdir(struct file *filp, void *dirent, filldir_t filldir) struct inode *dir = filp->f_dentry->d_inode; int result; - if (!dir) - return -EBADF; - - if (!S_ISDIR(dir->i_mode)) - return -ENOTDIR; - if ( filp->f_pos == 0 ) { if (filldir(dirent, ".", 1, filp->f_pos, dir->i_ino, DT_DIR)) diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index 9bffe61fdc4e..5a2e7a1dc30e 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c @@ -84,7 +84,6 @@ struct inode * udf_new_inode (const struct inode *dir, int mode, int * err) *err = -ENOMEM; return NULL; } - inode->i_flags = 0; *err = -ENOSPC; block = udf_new_block(dir, UDF_I_LOCATION(dir).partitionReferenceNum, @@ -128,7 +127,6 @@ struct inode * udf_new_inode (const struct inode *dir, int mode, int * err) inode->i_ino = udf_get_lb_pblock(sb, UDF_I_LOCATION(inode), 0); inode->i_blksize = PAGE_SIZE; inode->i_blocks = 0; - inode->i_size = 0; UDF_I_LENEATTR(inode) = 0; UDF_I_LENALLOC(inode) = 0; if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_EXTENDED_FE)) diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 88dc7d7f538b..9fcd98f34206 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -17,6 +17,17 @@ extern struct page * prepare_highmem_swapout(struct page *); extern struct page * replace_with_highmem(struct page *); extern struct buffer_head * create_bounce(int rw, struct buffer_head * bh_orig); + +static inline char *bh_kmap(struct buffer_head *bh) +{ + return kmap(bh->p_page) + bh_offset(bh); +} + +static inline void bh_kunmap(struct buffer_head *bh) +{ + kunmap(bh->b_page); +} + #else /* CONFIG_HIGHMEM */ static inline unsigned int nr_free_highpages(void) { return 0; } @@ -30,6 +41,9 @@ static inline void *kmap(struct page *page) { return page_address(page); } #define kmap_atomic(page,idx) kmap(page) #define kunmap_atomic(page,idx) kunmap(page) +#define bh_kmap(bh) ((bh)->b_data) +#define bh_kunmap(bh) do { } while (0); + #endif /* CONFIG_HIGHMEM */ /* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h index 63543da77790..471c9af2c202 100644 --- a/include/linux/iso_fs.h +++ b/include/linux/iso_fs.h @@ -177,16 +177,17 @@ extern int iso_date(char *, int); extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *); extern int get_rock_ridge_filename(struct iso_directory_record *, char *, struct inode *); +extern int isofs_name_translate(struct iso_directory_record *, char *, struct inode *); extern int find_rock_ridge_relocation(struct iso_directory_record *, struct inode *); -int get_joliet_filename(struct iso_directory_record *, struct inode *, unsigned char *); +int get_joliet_filename(struct iso_directory_record *, unsigned char *, struct inode *); int get_acorn_filename(struct iso_directory_record *, char *, struct inode *); extern struct dentry *isofs_lookup(struct inode *, struct dentry *); extern int isofs_get_block(struct inode *, long, struct buffer_head *, int); extern int isofs_bmap(struct inode *, int); -extern int isofs_lookup_grandparent(struct inode *, int); +extern struct buffer_head *isofs_bread(struct inode *, unsigned int, unsigned int); extern struct inode_operations isofs_dir_inode_operations; extern struct file_operations isofs_dir_operations; diff --git a/include/linux/kernel.h b/include/linux/kernel.h index aa337fe6c3aa..beb41bfa3c1b 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -45,11 +45,15 @@ #define FASTCALL(x) x #endif +struct semaphore; + extern struct notifier_block *panic_notifier_list; NORET_TYPE void panic(const char * fmt, ...) __attribute__ ((NORET_AND format (printf, 1, 2))); NORET_TYPE void do_exit(long error_code) ATTRIB_NORET; +NORET_TYPE void up_and_exit(struct semaphore *, long) + ATTRIB_NORET; extern unsigned long simple_strtoul(const char *,char **,unsigned int); extern long simple_strtol(const char *,char **,unsigned int); extern int sprintf(char * buf, const char * fmt, ...); diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 28bf3daa02aa..da8f6b3dc0e0 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -67,7 +67,7 @@ struct proc_dir_entry { void *data; read_proc_t *read_proc; write_proc_t *write_proc; - unsigned int count; /* use count */ + atomic_t count; /* use count */ int deleted; /* delete flag */ kdev_t rdev; }; diff --git a/include/net/x25.h b/include/net/x25.h index 22cd0863cafb..257618d44983 100644 --- a/include/net/x25.h +++ b/include/net/x25.h @@ -169,6 +169,7 @@ extern void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *); /* x25_in.c */ extern int x25_process_rx_frame(struct sock *, struct sk_buff *); +extern int x25_backlog_rcv(struct sock *, struct sk_buff *); /* x25_link.c */ extern void x25_link_control(struct sk_buff *, struct x25_neigh *, unsigned short); diff --git a/init/main.c b/init/main.c index 3ed437693cf2..f7486444bfd6 100644 --- a/init/main.c +++ b/init/main.c @@ -712,11 +712,13 @@ static void __init do_basic_setup(void) init_pcmcia_ds(); /* Do this last */ #endif +#ifdef CONFIG_HOTPLUG /* do this after other 'do this last' stuff, because we want * to minimize spurious executions of /sbin/hotplug * during boot-up */ net_notifier_init(); +#endif /* Mount the root filesystem.. */ mount_root(); diff --git a/ipc/shm.c b/ipc/shm.c index 6205bc2d1b3c..c4607fd5e3ac 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -376,13 +376,14 @@ static void shm_read_inode(struct inode * inode) struct shmid_kernel *shp; id = inode->i_ino; - inode->i_op = NULL; inode->i_mode = 0; inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; if (id < SEQ_MULTIPLIER) { - if (!(shp = shm_lock (id))) + if (!(shp = shm_lock (id))) { + make_bad_inode(inode); return; + } inode->i_mode = (shp->shm_flags & S_IALLUGO) | S_IFREG; inode->i_uid = shp->shm_perm.uid; inode->i_gid = shp->shm_perm.gid; @@ -572,13 +573,13 @@ static pte_t **shm_alloc(unsigned long pages, int doacc) if (pages == 0) return NULL; - ret = kmalloc ((dir+1) * sizeof(pte_t *), GFP_KERNEL); + ret = kmalloc ((dir+1) * sizeof(pte_t *), GFP_USER); if (!ret) goto nomem; for (ptr = ret; ptr < ret+dir ; ptr++) { - *ptr = (pte_t *)__get_free_page (GFP_KERNEL); + *ptr = (pte_t *)__get_free_page (GFP_USER); if (!*ptr) goto free; init_ptes (*ptr, PTES_PER_PAGE); @@ -586,7 +587,7 @@ static pte_t **shm_alloc(unsigned long pages, int doacc) /* The last one is probably not of PAGE_SIZE: we use kmalloc */ if (last) { - *ptr = kmalloc (last*sizeof(pte_t), GFP_KERNEL); + *ptr = kmalloc (last*sizeof(pte_t), GFP_USER); if (!*ptr) goto free; init_ptes (*ptr, last); @@ -724,7 +725,7 @@ static struct shmid_kernel *seg_alloc(int numpages, size_t namelen) struct shmid_kernel *shp; pte_t **dir; - shp = (struct shmid_kernel *) kmalloc (sizeof (*shp) + namelen, GFP_KERNEL); + shp = (struct shmid_kernel *) kmalloc (sizeof (*shp) + namelen, GFP_USER); if (!shp) return ERR_PTR(-ENOMEM); @@ -1202,7 +1203,7 @@ asmlinkage long sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *raddr) char name[SHM_FMT_LEN+1]; void *user_addr; - if (!shm_sb || (shmid % SEQ_MULTIPLIER) == zero_id) + if (!shm_sb || shmid < 0 || (shmid % SEQ_MULTIPLIER) == zero_id) return -EINVAL; if ((addr = (ulong)shmaddr)) { diff --git a/kernel/exit.c b/kernel/exit.c index 35114e2a6e27..3045d7ac60c9 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -467,6 +467,14 @@ fake_volatile: goto fake_volatile; } +NORET_TYPE void up_and_exit(struct semaphore *sem, long code) +{ + if (sem) + up(sem); + + do_exit(code); +} + asmlinkage long sys_exit(int error_code) { do_exit((error_code&0xff)<<8); diff --git a/kernel/kmod.c b/kernel/kmod.c index 7655f4ddadfe..a21507eecfd7 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -114,7 +114,8 @@ int exec_usermodehelper(char *program_path, char *argv[], char *envp[]) } /* Give kmod all effective privileges.. */ - current->uid = current->euid = current->fsuid = 0; + current->euid = current->fsuid = 0; + current->egid = current->fsgid = 0; cap_set_full(current->cap_effective); /* Allow execve args to be in kernel space. */ diff --git a/kernel/ksyms.c b/kernel/ksyms.c index 07bebb3592aa..100adaeb3687 100644 --- a/kernel/ksyms.c +++ b/kernel/ksyms.c @@ -418,6 +418,7 @@ EXPORT_SYMBOL(ioport_resource); EXPORT_SYMBOL(iomem_resource); /* process management */ +EXPORT_SYMBOL(up_and_exit); EXPORT_SYMBOL(__wake_up); EXPORT_SYMBOL(wake_up_process); EXPORT_SYMBOL(sleep_on); diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 3da5df9d9071..5591ee2bcf4a 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -571,7 +571,7 @@ static void unregister_proc_table(ctl_table * table, struct proc_dir_entry *root } /* Don't unregister proc entries that are still being used.. */ - if (de->count) + if (atomic_read(&de->count)) continue; table->de = NULL; diff --git a/mm/filemap.c b/mm/filemap.c index 55d3fcfe3d95..a191cc2f4ae2 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1208,8 +1208,6 @@ asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t cou if (!out_file->f_op || !out_file->f_op->write) goto fput_out; out_inode = out_file->f_dentry->d_inode; - if (!out_inode) - goto fput_out; retval = locks_verify_area(FLOCK_VERIFY_WRITE, out_inode, out_file, out_file->f_pos, count); if (retval) goto fput_out; diff --git a/net/core/dev.c b/net/core/dev.c index 673638998c13..1e5b59c3d74b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2704,6 +2704,7 @@ int __init net_dev_init(void) return 0; } +#ifdef CONFIG_HOTPLUG /* Notify userspace when a netdevice event occurs, * by running '/sbin/hotplug net' with certain @@ -2765,3 +2766,4 @@ void __init net_notifier_init (void) printk (KERN_WARNING "unable to register netdev notifier\n" KERN_WARNING "/sbin/hotplug will not be run.\n"); } +#endif diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index a72471f99be1..9f16a976cfac 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp_ipv4.c,v 1.219 2000/11/10 04:02:04 davem Exp $ + * Version: $Id: tcp_ipv4.c,v 1.220 2000/11/14 07:26:02 davem Exp $ * * IPv4 specific functions * @@ -1721,93 +1721,88 @@ static void __tcp_v4_rehash(struct sock *sk) sk->prot->hash(sk); } -int tcp_v4_rebuild_header(struct sock *sk) +static int tcp_v4_reselect_saddr(struct sock *sk) { - struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0); + int err; + struct rtable *rt; + __u32 old_saddr = sk->saddr; __u32 new_saddr; - int want_rewrite = sysctl_ip_dynaddr && sk->state == TCP_SYN_SENT && - !(sk->userlocks & SOCK_BINDADDR_LOCK); + __u32 daddr = sk->daddr; - if (rt == NULL) { - int err; + if(sk->protinfo.af_inet.opt && sk->protinfo.af_inet.opt->srr) + daddr = sk->protinfo.af_inet.opt->faddr; - u32 daddr = sk->daddr; + /* Query new route. */ + err = ip_route_connect(&rt, daddr, 0, + RT_TOS(sk->protinfo.af_inet.tos)|sk->localroute, + sk->bound_dev_if); + if (err) + return err; - if(sk->protinfo.af_inet.opt && sk->protinfo.af_inet.opt->srr) - daddr = sk->protinfo.af_inet.opt->faddr; + __sk_dst_set(sk, &rt->u.dst); + /* sk->route_caps = rt->u.dst.dev->features; */ - err = ip_route_output(&rt, daddr, sk->saddr, - RT_TOS(sk->protinfo.af_inet.tos) | RTO_CONN | sk->localroute, - sk->bound_dev_if); - if (err) { - sk->err_soft=-err; - sk->error_report(sk); - return -1; - } - __sk_dst_set(sk, &rt->u.dst); - } + new_saddr = rt->rt_src; - /* Force route checking if want_rewrite. */ - if (want_rewrite) { - int tmp; - struct rtable *new_rt; - __u32 old_saddr = rt->rt_src; - - /* Query new route using another rt buffer */ - tmp = ip_route_connect(&new_rt, rt->rt_dst, 0, - RT_TOS(sk->protinfo.af_inet.tos)|sk->localroute, - sk->bound_dev_if); - - /* Only useful if different source addrs */ - if (tmp == 0) { - /* - * Only useful if different source addrs - */ - if (new_rt->rt_src != old_saddr ) { - __sk_dst_set(sk, &new_rt->u.dst); - rt = new_rt; - goto do_rewrite; - } - dst_release(&new_rt->u.dst); - } + if (new_saddr == old_saddr) + return 0; + + if (sysctl_ip_dynaddr > 1) { + printk(KERN_INFO "tcp_v4_rebuild_header(): shifting sk->saddr " + "from %d.%d.%d.%d to %d.%d.%d.%d\n", + NIPQUAD(old_saddr), + NIPQUAD(new_saddr)); } + sk->saddr = new_saddr; + sk->rcv_saddr = new_saddr; + + /* XXX The only one ugly spot where we need to + * XXX really change the sockets identity after + * XXX it has entered the hashes. -DaveM + * + * Besides that, it does not check for connection + * uniqueness. Wait for troubles. + */ + __tcp_v4_rehash(sk); return 0; +} -do_rewrite: - new_saddr = rt->rt_src; - - /* Ouch!, this should not happen. */ - if (!sk->saddr || !sk->rcv_saddr) { - printk(KERN_WARNING "tcp_v4_rebuild_header(): not valid sock addrs: " - "saddr=%08X rcv_saddr=%08X\n", - ntohl(sk->saddr), - ntohl(sk->rcv_saddr)); - return -1; - } +int tcp_v4_rebuild_header(struct sock *sk) +{ + struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0); + u32 daddr; + int err; - if (new_saddr != sk->saddr) { - if (sysctl_ip_dynaddr > 1) { - printk(KERN_INFO "tcp_v4_rebuild_header(): shifting sk->saddr " - "from %d.%d.%d.%d to %d.%d.%d.%d\n", - NIPQUAD(sk->saddr), - NIPQUAD(new_saddr)); - } + /* Route is OK, nothing to do. */ + if (rt != NULL) + return 0; - sk->saddr = new_saddr; - sk->rcv_saddr = new_saddr; + /* Reroute. */ + daddr = sk->daddr; + if(sk->protinfo.af_inet.opt && sk->protinfo.af_inet.opt->srr) + daddr = sk->protinfo.af_inet.opt->faddr; - /* XXX The only one ugly spot where we need to - * XXX really change the sockets identity after - * XXX it has entered the hashes. -DaveM - * - * Besides that, it does not check for connection - * uniqueness. Wait for troubles. - */ - __tcp_v4_rehash(sk); - } - - return 0; + err = ip_route_output(&rt, daddr, sk->saddr, + RT_TOS(sk->protinfo.af_inet.tos) | RTO_CONN | sk->localroute, + sk->bound_dev_if); + if (!err) { + __sk_dst_set(sk, &rt->u.dst); + /* sk->route_caps = rt->u.dst.dev->features; */ + return 0; + } + + /* Routing failed... */ + /* sk->route_caps = 0; */ + + if (!sysctl_ip_dynaddr || + sk->state != TCP_SYN_SENT || + (sk->userlocks & SOCK_BINDADDR_LOCK) || + (err = tcp_v4_reselect_saddr(sk)) != 0) { + sk->err_soft=-err; + /* sk->error_report(sk); */ + } + return err; } static void v4_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr) diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 4a9af93e1c20..520a3b6c16c9 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -660,7 +660,8 @@ static void ndisc_router_discovery(struct sk_buff *skb) if (ra_msg->reachable_time) { __u32 rtime = (ntohl(ra_msg->reachable_time)*HZ)/1000; - if (rtime != in6_dev->nd_parms->base_reachable_time) { + if (rtime && + rtime != in6_dev->nd_parms->base_reachable_time) { in6_dev->nd_parms->base_reachable_time = rtime; in6_dev->nd_parms->gc_staletime = 3 * rtime; in6_dev->nd_parms->reachable_time = neigh_rand_reach_time(rtime); diff --git a/net/khttpd/datasending.c b/net/khttpd/datasending.c index 7908d726c7fa..5726dca3297e 100644 --- a/net/khttpd/datasending.c +++ b/net/khttpd/datasending.c @@ -114,7 +114,7 @@ int DataSending(const int CPUNR) inode = CurrentRequest->filp->f_dentry->d_inode; - if (inode && inode->i_mapping->a_ops->readpage) { + if (inode->i_mapping->a_ops->readpage) { /* This does the actual transfer using sendfile */ read_descriptor_t desc; loff_t *ppos; diff --git a/net/khttpd/main.c b/net/khttpd/main.c index ae44b3a6e95a..2ade82be2685 100644 --- a/net/khttpd/main.c +++ b/net/khttpd/main.c @@ -145,7 +145,6 @@ static int MainDaemon(void *cpu_pointer) changes +=AcceptConnections(CPUNR,MainSocket); } - set_current_state(TASK_INTERRUPTIBLE); if (changes==0) { (void)interruptible_sleep_on_timeout(&(DummyWQ[CPUNR]),1); diff --git a/net/socket.c b/net/socket.c index 8c33a03c41c9..5c5c5a85b21d 100644 --- a/net/socket.c +++ b/net/socket.c @@ -405,7 +405,7 @@ struct socket *sockfd_lookup(int fd, int *err) } inode = file->f_dentry->d_inode; - if (!inode || !inode->i_sock || !(sock = socki_lookup(inode))) + if (!inode->i_sock || !(sock = socki_lookup(inode))) { *err = -ENOTSOCK; fput(file); diff --git a/net/unix/garbage.c b/net/unix/garbage.c index 3fcf7464c124..16d46de54386 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c @@ -100,7 +100,7 @@ extern inline unix_socket *unix_get_socket(struct file *filp) /* * Socket ? */ - if (inode && inode->i_sock) { + if (inode->i_sock) { struct socket * sock = &inode->u.socket_i; struct sock * s = sock->sk; diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 409e3bc46130..0242b12e5c5c 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -25,6 +25,7 @@ * Fixed x25_output() related skb leakage. * 2000-10-02 Henner Eisen Made x25_kick() single threaded per socket. * 2000-10-27 Henner Eisen MSG_DONTWAIT for fragment allocation. + * 2000-11-14 Henner Eisen Closing datalink from NETDEV_GOING_DOWN */ #include @@ -193,6 +194,7 @@ static void x25_kill_by_device(struct net_device *dev) static int x25_device_event(struct notifier_block *this, unsigned long event, void *ptr) { struct net_device *dev = (struct net_device *)ptr; + struct x25_neigh *neigh; if (dev->type == ARPHRD_X25 #if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE) @@ -203,6 +205,10 @@ static int x25_device_event(struct notifier_block *this, unsigned long event, vo case NETDEV_UP: x25_link_device_up(dev); break; + case NETDEV_GOING_DOWN: + if ((neigh = x25_get_neigh(dev))) + x25_terminate_link(neigh); + break; case NETDEV_DOWN: x25_kill_by_device(dev); x25_route_device_down(dev); @@ -473,7 +479,7 @@ static int x25_create(struct socket *sock, int protocol) sock->ops = &x25_proto_ops; sk->protocol = protocol; - sk->backlog_rcv = x25_process_rx_frame; + sk->backlog_rcv = x25_backlog_rcv; x25->t21 = sysctl_x25_call_request_timeout; x25->t22 = sysctl_x25_reset_request_timeout; diff --git a/net/x25/x25_in.c b/net/x25/x25_in.c index c285af6c886f..bcb5f1cf49b6 100644 --- a/net/x25/x25_in.c +++ b/net/x25/x25_in.c @@ -360,4 +360,14 @@ int x25_process_rx_frame(struct sock *sk, struct sk_buff *skb) return queued; } +int x25_backlog_rcv(struct sock *sk, struct sk_buff *skb) +{ + int queued; + + queued = x25_process_rx_frame(sk,skb); + if(!queued) kfree_skb(skb); + + return 0; +} + #endif -- 2.39.5