- 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()
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
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
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.
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.
"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.
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.
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
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
$(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
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;
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);
}
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);
-/* $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)
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 */
/* 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);
#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);
int try_port;
int ret;
struct socket *socket;
- struct dentry *dentry;
struct inode *inode;
struct file *file;
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;
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) {
}
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;
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... */
unsigned int minor;
unsigned long offset, len;
struct buffer_head *rbh;
+ char *bdata;
minor = MINOR(sbh->b_rdev);
}
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);
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++)
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];
};
static struct ns558 *ns558;
+static int ns558_pci;
/*
* ns558_isa_probe() tries to find an isa gameport at the
}
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;
* 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.
}
#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);
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);
{ 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;
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);
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)
}
}
- if(!i2o_proc_dir_root->count)
+ if(!atomic_read(&i2o_proc_dir_root->count))
remove_proc_entry("i2o", 0);
else
return -1;
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)))
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;
}
*/
#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/smp_lock.h>
#include <linux/input.h>
#include <linux/module.h>
#include <linux/random.h>
}
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);
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)))
|| 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;
}
#include <linux/input.h>
#include <linux/config.h>
#include <linux/smp_lock.h>
+#include <linux/random.h>
#ifndef CONFIG_INPUT_MOUSEDEV_SCREEN_X
#define CONFIG_INPUT_MOUSEDEV_SCREEN_X 1024
struct mousedev_list *list;
int index, size;
+ add_mouse_randomness((type << 4) ^ code ^ (code >> 4) ^ value);
+
while (*mousedev) {
list = (*mousedev)->list;
while (list) {
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)))
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;
}
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
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
-/* $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.
*
* 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
-/* $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).
*
* 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__
-/* $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).
*
* 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
-/* $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
* 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__
-/* $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.
*
* 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
-/* $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.
*
* 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"
#
-# $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.
#
# 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.
#
SUB_DIRS :=
MOD_SUB_DIRS :=
-ALL_SUB_DIRS := # fcpci fcclassic
+ALL_SUB_DIRS :=
#
# Objects that don't export a symtab
#
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)
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
struct sk_buff *skb;
unsigned ApplId;
- signed MsgLen;
+ unsigned MsgLen;
unsigned DataB3Len;
unsigned NCCI;
unsigned WindowSize;
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
/* ------------------------------------------------------------- */
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
/* ------------------------------------------------------------- */
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
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 */
/* ------------------------------------------------------------- */
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,
};
/* ------------------------------------------------------------- */
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;
/* ------------------------------------------------------------- */
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);
}
static struct capi_interface_user cuser = {
- "capi20",
- lower_callback,
+ name: "capi20",
+ callback: lower_callback,
};
static char rev[10];
}
}
-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;
}
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);
}
}
}
static struct capi_interface_user cuser = {
- "capidrv",
- lower_callback
+ name: "capidrv",
+ callback: lower_callback
};
int __init capidrv_init(void)
lookup: capifs_root_lookup,
};
-struct inode_operations capifs_inode_operations;
-
static struct dentry_operations capifs_dentry_operations = {
d_revalidate: capifs_revalidate,
};
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;
return;
}
- /* need dummy inode operations .... */
- inode->i_op = &capifs_inode_operations;
-
ino -= 2;
if ( ino >= sbi->max_ncci )
return; /* Bogus */
struct sk_buff *skb;
unsigned ApplId;
- signed MsgLen;
+ unsigned MsgLen;
unsigned DataB3Len;
unsigned NCCI;
unsigned WindowSize;
/* ------------------------------------------------------------- */
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
/* ------------------------------------------------------------- */
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
/*
- * $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.
*
* 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 <linux/module.h>
/*
- * $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.
*
* 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 <linux/config.h>
/*
- * $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.
*
* 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
- *
- *
- *
*/
/*
- * $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.
*
* 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
- *
*/
}
i++;
}
- if (strlen(str)) {
+ if (str && *str) {
strcpy(HiSaxID, str);
HiSax_id = HiSaxID;
} else {
-/* $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
*
extern const char *CardType[];
-const char *w6692_revision = "$Revision: 1.7 $";
+const char *w6692_revision = "$Revision: 1.8 $";
#define DBUSY_TIMER_VALUE 80
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));
-/* $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.
*
* 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__
-/* $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
* 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
- *
- *
*/
-/* $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
* 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__
#include "hysdn_defs.h"
#include <linux/kernelcapi.h>
-static char hycapi_revision[]="$Revision: 1.6 $";
+static char hycapi_revision[]="$Revision: 1.7 $";
typedef struct _hycapi_appl {
unsigned int ctrl_mask;
-/* $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.
*
* 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__
-/* $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
* 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
-/* $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
* 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 <linux/config.h>
#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 */
-/* $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.
*
* 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__
#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 */
-/* $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
* 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
- *
- *
*/
/************************/
-/* $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
* 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__
#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 */
-/* $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
* 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__
-/* $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.
*
* 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__
-/* $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.
*
* 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"
#undef MAP_DEBUG
static char
-*revision = "$Revision: 1.64 $";
+*revision = "$Revision: 1.65 $";
static int icn_addcard(int, char *, char *);
-/* $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.
*
* 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
-/* $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).
*
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];
-/* $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.
*
* 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 <linux/config.h>
#include "isdnloop.h"
static char
-*revision = "$Revision: 1.9 $";
+*revision = "$Revision: 1.11 $";
static int isdnloop_addcard(char *);
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:
-/* $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.
*
* 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
/*
- * $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
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);
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)
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;
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
* 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
* 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 <mostrows@styx.uwaterloo.ca>
* Contributors:
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;
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 )
/* 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;
if (!relay_po)
break;
+ sock_put(relay_po->sk);
sk->state |= PPPOX_RELAY;
err = 0;
break;
struct pppoe_hdr *ph;
struct net_device *dev;
char *start;
- int copied = 0;
if (sk->dead || !(sk->state & PPPOX_CONNECTED)) {
error = -ENOTCONN;
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) {
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;
}
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);
-/* $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.
#ifndef __sparc_v9__
#include <asm/io-unit.h>
#endif
-#include <asm/uaccess.h>
#endif
+#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/irq.h>
#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
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
HMD(("XXX>"));
hme_write32(hp, gregs + GREG_CFG, 0);
}
+#endif /* __sparc__ */
/* Turn off interrupts we do not want to hear. */
HMD((", enable global interrupts, "));
/* 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);
* 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 <linux/errno.h>
/*
* 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;
return (lapbeth != NULL) ? lapbeth->ethdev : NULL;
}
-
+#endif
/*
* Get the LAPB device for the ethernet device
*/
result = 1;
unregister_netdev(&lapbeth->axdev);
+ dev_put(lapbeth->ethdev);
kfree(lapbeth);
}
memset(lapbeth, 0, sizeof(struct lapbethdev));
+ dev_hold(dev);
lapbeth->ethdev = dev;
lapbeth->ethname[sizeof(lapbeth->ethname)-1] = '\0';
}
if (k == MAXLAPBDEV) {
+ dev_put(dev);
kfree(lapbeth);
return -ENODEV;
}
dev->init = lapbeth_dev_init;
if (register_netdev(dev) != 0) {
+ dev_put(dev);
kfree(lapbeth);
return -EIO;
}
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);
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;
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;
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)
{
static int usb_hub_thread(void *__hub)
{
- khubd_running = 1;
-
lock_kernel();
/*
} 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 [] = {
/* 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
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;
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;
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);
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);
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");
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;
(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;
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;
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 */
{
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++;
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..
*/
}
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
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) {
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
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;
continue;
}
- brelse(bh);
+ if (bh) brelse(bh);
return 0;
}
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,
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;
}
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
}
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;
* 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
*/
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);
}
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);
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);
}
}
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;
}
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;
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;
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);
/* 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;
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");
static struct inode_operations proc_link_inode_operations = {
readlink: proc_readlink,
- follow_link: proc_follow_link
+ follow_link: proc_follow_link,
};
/*
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);
(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;
}
struct proc_dir_entry * de_get(struct proc_dir_entry *de)
{
if (de)
- de->count++;
+ atomic_inc(&de->count);
return 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();
}
}
#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);
* 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,
};
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() */
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))
*err = -ENOMEM;
return NULL;
}
- inode->i_flags = 0;
*err = -ENOSPC;
block = udf_new_block(dir, UDF_I_LOCATION(dir).partitionReferenceNum,
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))
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; }
#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 */
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;
#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, ...);
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;
};
/* 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);
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();
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;
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);
/* 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);
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);
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)) {
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);
}
/* 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. */
EXPORT_SYMBOL(iomem_resource);
/* process management */
+EXPORT_SYMBOL(up_and_exit);
EXPORT_SYMBOL(__wake_up);
EXPORT_SYMBOL(wake_up_process);
EXPORT_SYMBOL(sleep_on);
}
/* Don't unregister proc entries that are still being used.. */
- if (de->count)
+ if (atomic_read(&de->count))
continue;
table->de = NULL;
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;
return 0;
}
+#ifdef CONFIG_HOTPLUG
/* Notify userspace when a netdevice event occurs,
* by running '/sbin/hotplug net' with certain
printk (KERN_WARNING "unable to register netdev notifier\n"
KERN_WARNING "/sbin/hotplug will not be run.\n");
}
+#endif
*
* 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
*
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)
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);
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;
changes +=AcceptConnections(CPUNR,MainSocket);
}
- set_current_state(TASK_INTERRUPTIBLE);
if (changes==0)
{
(void)interruptible_sleep_on_timeout(&(DummyWQ[CPUNR]),1);
}
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);
/*
* Socket ?
*/
- if (inode && inode->i_sock) {
+ if (inode->i_sock) {
struct socket * sock = &inode->u.socket_i;
struct sock * s = sock->sk;
* 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 <linux/config.h>
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)
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);
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;
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