-/* $Id: irq.c,v 1.82 2000/02/09 11:15:07 davem Exp $
+/* $Id: irq.c,v 1.83 2000/02/11 06:57:17 jj Exp $
* irq.c: UltraSparc IRQ handling/init/registry.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
#ifndef __SMP__
unsigned int __up_workvec[16] __attribute__ ((aligned (64)));
-#define irq_work(__cpu, __pil) &(__up_workvec[(__pil)])
+#define irq_work(__cpu, __pil) &(__up_workvec[(void)(__cpu), (__pil)])
#else
#define irq_work(__cpu, __pil) &(cpu_data[(__cpu)].irq_worklists[(__pil)])
#endif
#ifndef _AGP_BACKEND_PRIV_H
#define _AGP_BACKEND_PRIV_H 1
-#include <linux/config.h>
-
enum aper_size_type {
U8_APER_SIZE,
U16_APER_SIZE,
printk(KERN_ERR "%s: bogus last_tx_buffer %d, tx1=%d.\n",
ei_local->name, ei_local->lasttx, ei_local->tx1);
ei_local->tx1 = 0;
- netif_start_queue(dev);
if (ei_local->tx2 > 0)
{
ei_local->txing = 1;
printk("%s: bogus last_tx_buffer %d, tx2=%d.\n",
ei_local->name, ei_local->lasttx, ei_local->tx2);
ei_local->tx2 = 0;
- netif_start_queue(dev);
if (ei_local->tx1 > 0)
{
ei_local->txing = 1;
* Single Tx buffer: mark it free so another packet can be loaded.
*/
ei_local->txing = 0;
- netif_start_queue(dev);
#endif
/* Minimize Tx latency: update the statistics after we restart TXing. */
+#include <linux/config.h>
/*
* Declare these here even if Tigon I support is disabled to avoid
* the compiler complaining about undefined symbols.
*
*
* History:
- * 0.1 xx.xx.98 Initial version by Matthias Welwarsky (dg2fef)
- * 0.2 21.04.98 Massive rework by Thomas Sailer
- * Integrated FPGA EPP modem configuration routines
- * 0.3 11.05.98 Took FPGA config out and moved it into a separate program
- * 0.4 26.07.99 Adapted to new lowlevel parport driver interface
- * 0.5 03.08.99 adapt to Linus' new __setup/__initcall
- * removed some pre-2.2 kernel compatibility cruft
- * 0.6 10.08.99 Check if parport can do SPP and is safe to access during interrupt contexts
+ * 0.1 xx.xx.1998 Initial version by Matthias Welwarsky (dg2fef)
+ * 0.2 21.04.1998 Massive rework by Thomas Sailer
+ * Integrated FPGA EPP modem configuration routines
+ * 0.3 11.05.1998 Took FPGA config out and moved it into a separate program
+ * 0.4 26.07.1999 Adapted to new lowlevel parport driver interface
+ * 0.5 03.08.1999 adapt to Linus' new __setup/__initcall
+ * removed some pre-2.2 kernel compatibility cruft
+ * 0.6 10.08.1999 Check if parport can do SPP and is safe to access during interrupt contexts
+ * 0.7 12.02.2000 adapted to softnet driver interface
*
*/
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <linux/if_arp.h>
+#include <linux/kmod.h>
#include <linux/hdlcdrv.h>
#include <linux/baycom.h>
#include <linux/soundmodem.h>
/* --------------------------------------------------------------------- */
static const char bc_drvname[] = "baycom_epp";
-static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-1999 Thomas Sailer, HB9JNX/AE4WA\n"
-KERN_INFO "baycom_epp: version 0.5 compiled " __TIME__ " " __DATE__ "\n";
+static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-2000 Thomas Sailer, HB9JNX/AE4WA\n"
+KERN_INFO "baycom_epp: version 0.7 compiled " __TIME__ " " __DATE__ "\n";
/* --------------------------------------------------------------------- */
static int errno;
-static inline void use_init_fs_context(void)
-{
- struct fs_struct *our_fs, *init_fs;
-
- /*
- * Make modprobe's fs context be a copy of init's.
- *
- * We cannot use the user's fs context, because it
- * may have a different root than init.
- * Since init was created with CLONE_FS, we can grab
- * its fs context from "init_task".
- *
- * The fs context has to be a copy. If it is shared
- * with init, then any chdir() call in modprobe will
- * also affect init and the other threads sharing
- * init_task's fs context.
- *
- * We created the exec_modprobe thread without CLONE_FS,
- * so we can update the fields in our fs context freely.
- */
- lock_kernel();
-
- our_fs = current->fs;
- dput(our_fs->root);
- dput(our_fs->pwd);
-
- init_fs = init_task.fs;
- our_fs->umask = init_fs->umask;
- our_fs->root = dget(init_fs->root);
- our_fs->pwd = dget(init_fs->pwd);
-
- unlock_kernel();
-}
-
static int exec_eppfpga(void *b)
{
struct baycom_state *bc = (struct baycom_state *)b;
sprintf(portarg, "%ld", bc->pdev->port->base);
printk(KERN_DEBUG "%s: %s -s -p %s -m %s\n", bc_drvname, eppconfig_path, portarg, modearg);
- current->session = 1;
- current->pgrp = 1;
-
- use_init_fs_context();
-
- /* Prevent parent user process from sending signals to child.
- Otherwise, if the modprobe program does not exist, it might
- be possible to get a user defined signal handler to execute
- as the super user right after the execve fails if you time
- the signal just right.
- */
- spin_lock_irq(¤t->sigmask_lock);
- flush_signals(current);
- flush_signal_handlers(current);
- spin_unlock_irq(¤t->sigmask_lock);
-
- for (i = 0; i < current->files->max_fds; i++ ) {
- if (current->files->fd[i]) close(i);
- }
-
- /* Drop the "current user" thing */
- free_uid(current);
-
- /* Give kmod all privileges.. */
- current->uid = current->euid = current->fsuid = 0;
- cap_set_full(current->cap_inheritable);
- cap_set_full(current->cap_effective);
-
- /* Allow execve args to be in kernel space. */
- set_fs(KERNEL_DS);
-
- if (execve(eppconfig_path, argv, envp) < 0) {
+ i = exec_usermodehelper(eppconfig_path, argv, envp);
+ if (i < 0) {
printk(KERN_ERR "%s: failed to exec %s -s -p %s -m %s, errno = %d\n",
- bc_drvname, eppconfig_path, portarg, modearg, errno);
- return -errno;
+ bc_drvname, eppconfig_path, portarg, modearg, i);
+ return i;
}
return 0;
}
dev->addr_len = AX25_ADDR_LEN; /* sizeof an ax.25 address */
memcpy(dev->broadcast, ax25_bcast, AX25_ADDR_LEN);
memcpy(dev->dev_addr, ax25_nocall, AX25_ADDR_LEN);
+ dev->tx_queue_len = 16;
/* New style flags */
dev->flags = 0;
*
*
* History:
- * 0.1 26.06.96 Adapted from baycom.c and made network driver interface
- * 18.10.96 Changed to new user space access routines (copy_{to,from}_user)
- * 0.3 26.04.97 init code/data tagged
- * 0.4 08.07.97 alternative ser12 decoding algorithm (uses delta CTS ints)
- * 0.5 11.11.97 split into separate files for ser12/par96
- * 0.6 03.08.99 adapt to Linus' new __setup/__initcall
- * removed some pre-2.2 kernel compatibility cruft
- * 0.7 10.08.99 Check if parport can do SPP and is safe to access during interrupt contexts
+ * 0.1 26.06.1996 Adapted from baycom.c and made network driver interface
+ * 18.10.1996 Changed to new user space access routines (copy_{to,from}_user)
+ * 0.3 26.04.1997 init code/data tagged
+ * 0.4 08.07.1997 alternative ser12 decoding algorithm (uses delta CTS ints)
+ * 0.5 11.11.1997 split into separate files for ser12/par96
+ * 0.6 03.08.1999 adapt to Linus' new __setup/__initcall
+ * removed some pre-2.2 kernel compatibility cruft
+ * 0.7 10.08.1999 Check if parport can do SPP and is safe to access during interrupt contexts
+ * 0.8 12.02.2000 adapted to softnet driver interface
+ * removed direct parport access, uses parport driver methods
*/
/*****************************************************************************/
#include <linux/string.h>
#include <asm/system.h>
#include <asm/bitops.h>
-#include <asm/io.h>
#include <asm/uaccess.h>
#include <linux/init.h>
#include <linux/delay.h>
/* --------------------------------------------------------------------- */
static const char bc_drvname[] = "baycom_par";
-static const char bc_drvinfo[] = KERN_INFO "baycom_par: (C) 1996-1999 Thomas Sailer, HB9JNX/AE4WA\n"
-KERN_INFO "baycom_par: version 0.6 compiled " __TIME__ " " __DATE__ "\n";
+static const char bc_drvinfo[] = KERN_INFO "baycom_par: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n"
+KERN_INFO "baycom_par: version 0.8 compiled " __TIME__ " " __DATE__ "\n";
/* --------------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
-#define SER12_EXTENT 8
-
-#define LPT_DATA(dev) ((dev)->base_addr+0)
-#define LPT_STATUS(dev) ((dev)->base_addr+1)
-#define LPT_CONTROL(dev) ((dev)->base_addr+2)
-#define LPT_IRQ_ENABLE 0x10
-
#define PAR96_BURSTBITS 16
#define PAR96_BURST 4
#define PAR96_PTT 2
{
int i;
unsigned int data = hdlcdrv_getbits(&bc->hdrv);
+ struct parport *pp = bc->pdev->port;
for(i = 0; i < PAR96_BURSTBITS; i++, data >>= 1) {
unsigned char val = PAR97_POWER;
(PAR96_SCRAM_TAPN << 1);
if (bc->modem.par96.scram & (PAR96_SCRAM_TAP1 << 2))
val |= PAR96_TXBIT;
- outb(val, LPT_DATA(dev));
- outb(val | PAR96_BURST, LPT_DATA(dev));
+ pp->ops->write_data(pp, val);
+ pp->ops->write_data(pp, val | PAR96_BURST);
}
}
{
int i;
unsigned int data, mask, mask2, descx;
+ struct parport *pp = bc->pdev->port;
/*
* do receiver; differential decode and descramble on the fly
*/
for(data = i = 0; i < PAR96_BURSTBITS; i++) {
bc->modem.par96.descram = (bc->modem.par96.descram << 1);
- if (inb(LPT_STATUS(dev)) & PAR96_RXBIT)
+ if (pp->ops->read_status(pp) & PAR96_RXBIT)
bc->modem.par96.descram |= 1;
descx = bc->modem.par96.descram ^
(bc->modem.par96.descram >> 1);
/* now the diff decoded data is inverted in descram */
- outb(PAR97_POWER | PAR96_PTT, LPT_DATA(dev));
+ pp->ops->write_data(pp, PAR97_POWER | PAR96_PTT);
descx ^= ((descx >> PAR96_DESCRAM_TAPSH1) ^
(descx >> PAR96_DESCRAM_TAPSH2));
data >>= 1;
if (!(descx & 1))
data |= 0x8000;
- outb(PAR97_POWER | PAR96_PTT | PAR96_BURST, LPT_DATA(dev));
+ pp->ops->write_data(pp, PAR97_POWER | PAR96_PTT | PAR96_BURST);
}
hdlcdrv_putbits(&bc->hdrv, data);
/*
bc->modem.par96.dcd_count -= 2;
hdlcdrv_setdcd(&bc->hdrv, bc->modem.par96.dcd_count > 0);
} else {
- hdlcdrv_setdcd(&bc->hdrv, !!(inb(LPT_STATUS(dev)) & PAR96_DCD));
+ hdlcdrv_setdcd(&bc->hdrv, !!(pp->ops->read_status(pp) & PAR96_DCD));
}
}
parport_unregister_device(bc->pdev);
return -EBUSY;
}
+ pp = bc->pdev->port;
dev->irq = pp->irq;
- /* bc->pdev->port->ops->change_mode(bc->pdev->port, PARPORT_MODE_PCSPP); not yet implemented */
+ pp->ops->data_forward(pp);
bc->hdrv.par.bitrate = 9600;
- /* switch off PTT */
- outb(PAR96_PTT | PAR97_POWER, LPT_DATA(dev));
- /*bc->pdev->port->ops->enable_irq(bc->pdev->port); not yet implemented */
- outb(LPT_IRQ_ENABLE, LPT_CONTROL(dev));
+ pp->ops->write_data(pp, PAR96_PTT | PAR97_POWER); /* switch off PTT */
+ pp->ops->enable_irq(pp);
printk(KERN_INFO "%s: par96 at iobase 0x%lx irq %u options 0x%x\n",
bc_drvname, dev->base_addr, dev->irq, bc->options);
MOD_INC_USE_COUNT;
static int par96_close(struct net_device *dev)
{
struct baycom_state *bc = (struct baycom_state *)dev->priv;
+ struct parport *pp;
if (!dev || !bc)
return -EINVAL;
+ pp = bc->pdev->port;
/* disable interrupt */
- outb(0, LPT_CONTROL(dev));
- /*bc->pdev->port->ops->disable_irq(bc->pdev->port); not yet implemented */
+ pp->ops->disable_irq(pp);
/* switch off PTT */
- outb(PAR96_PTT | PAR97_POWER, LPT_DATA(dev));
+ pp->ops->write_data(pp, PAR96_PTT | PAR97_POWER);
parport_release(bc->pdev);
parport_unregister_device(bc->pdev);
printk(KERN_INFO "%s: close par96 at iobase 0x%lx irq %u\n",
*
*
* History:
- * 0.1 26.06.96 Adapted from baycom.c and made network driver interface
- * 18.10.96 Changed to new user space access routines (copy_{to,from}_user)
- * 0.3 26.04.97 init code/data tagged
- * 0.4 08.07.97 alternative ser12 decoding algorithm (uses delta CTS ints)
- * 0.5 11.11.97 ser12/par96 split into separate files
- * 0.6 24.01.98 Thorsten Kranzkowski, dl8bcu and Thomas Sailer:
- * reduced interrupt load in transmit case
- * reworked receiver
- * 0.7 03.08.99 adapt to Linus' new __setup/__initcall
- * 0.8 10.08.99 use module_init/module_exit
+ * 0.1 26.06.1996 Adapted from baycom.c and made network driver interface
+ * 18.10.1996 Changed to new user space access routines (copy_{to,from}_user)
+ * 0.3 26.04.1997 init code/data tagged
+ * 0.4 08.07.1997 alternative ser12 decoding algorithm (uses delta CTS ints)
+ * 0.5 11.11.1997 ser12/par96 split into separate files
+ * 0.6 24.01.1998 Thorsten Kranzkowski, dl8bcu and Thomas Sailer:
+ * reduced interrupt load in transmit case
+ * reworked receiver
+ * 0.7 03.08.1999 adapt to Linus' new __setup/__initcall
+ * 0.8 10.08.1999 use module_init/module_exit
+ * 0.9 12.02.2000 adapted to softnet driver interface
*/
/*****************************************************************************/
/* --------------------------------------------------------------------- */
static const char bc_drvname[] = "baycom_ser_fdx";
-static const char bc_drvinfo[] = KERN_INFO "baycom_ser_fdx: (C) 1996-1999 Thomas Sailer, HB9JNX/AE4WA\n"
-KERN_INFO "baycom_ser_fdx: version 0.7 compiled " __TIME__ " " __DATE__ "\n";
+static const char bc_drvinfo[] = KERN_INFO "baycom_ser_fdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n"
+KERN_INFO "baycom_ser_fdx: version 0.9 compiled " __TIME__ " " __DATE__ "\n";
/* --------------------------------------------------------------------- */
/*
* baycom_ser_hdx.c -- baycom ser12 halfduplex radio modem driver.
*
- * Copyright (C) 1996-1999 Thomas Sailer (sailer@ife.ee.ethz.ch)
+ * Copyright (C) 1996-2000 Thomas Sailer (sailer@ife.ee.ethz.ch)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
*
* History:
- * 0.1 26.06.96 Adapted from baycom.c and made network driver interface
- * 18.10.96 Changed to new user space access routines (copy_{to,from}_user)
- * 0.3 26.04.97 init code/data tagged
- * 0.4 08.07.97 alternative ser12 decoding algorithm (uses delta CTS ints)
- * 0.5 11.11.97 ser12/par96 split into separate files
- * 0.6 14.04.98 cleanups
- * 0.7 03.08.99 adapt to Linus' new __setup/__initcall
- * 0.8 10.08.99 use module_init/module_exit
+ * 0.1 26.06.1996 Adapted from baycom.c and made network driver interface
+ * 18.10.1996 Changed to new user space access routines (copy_{to,from}_user)
+ * 0.3 26.04.1997 init code/data tagged
+ * 0.4 08.07.1997 alternative ser12 decoding algorithm (uses delta CTS ints)
+ * 0.5 11.11.1997 ser12/par96 split into separate files
+ * 0.6 14.04.1998 cleanups
+ * 0.7 03.08.1999 adapt to Linus' new __setup/__initcall
+ * 0.8 10.08.1999 use module_init/module_exit
+ * 0.9 12.02.2000 adapted to softnet driver interface
*/
/*****************************************************************************/
/* --------------------------------------------------------------------- */
static const char bc_drvname[] = "baycom_ser_hdx";
-static const char bc_drvinfo[] = KERN_INFO "baycom_ser_hdx: (C) 1996-1999 Thomas Sailer, HB9JNX/AE4WA\n"
-KERN_INFO "baycom_ser_hdx: version 0.7 compiled " __TIME__ " " __DATE__ "\n";
+static const char bc_drvinfo[] = KERN_INFO "baycom_ser_hdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n"
+KERN_INFO "baycom_ser_hdx: version 0.9 compiled " __TIME__ " " __DATE__ "\n";
/* --------------------------------------------------------------------- */
return 0;
case HDLCDRVCTL_SETMODE:
- if (dev->start || !suser())
+ if (test_bit(LINK_STATE_START, &dev->state) || !suser())
return -EACCES;
hi->data.modename[sizeof(hi->data.modename)-1] = '\0';
return baycom_setmode(bc, hi->data.modename);
* Written 1993-94 by Donald Becker.
*
* History:
- * 0.1 21.09.96 Started
- * 18.10.96 Changed to new user space access routines
- * (copy_{to,from}_user)
- * 0.2 21.11.96 various small changes
- * 0.3 03.03.97 fixed (hopefully) IP not working with ax.25 as a module
- * 0.4 16.04.97 init code/data tagged
- * 0.5 30.07.97 made HDLC buffers bigger (solves a problem with the
- * soundmodem driver)
- * 0.6 05.04.98 add spinlocks
- * 0.7 03.08.99 removed some old compatibility cruft
+ * 0.1 21.09.1996 Started
+ * 18.10.1996 Changed to new user space access routines
+ * (copy_{to,from}_user)
+ * 0.2 21.11.1996 various small changes
+ * 0.3 03.03.1997 fixed (hopefully) IP not working with ax.25 as a module
+ * 0.4 16.04.1997 init code/data tagged
+ * 0.5 30.07.1997 made HDLC buffers bigger (solves a problem with the
+ * soundmodem driver)
+ * 0.6 05.04.1998 add spinlocks
+ * 0.7 03.08.1999 removed some old compatibility cruft
+ * 0.8 12.02.2000 adapted to softnet driver interface
*/
/*****************************************************************************/
dev->get_stats = hdlcdrv_get_stats;
/* Fill in the fields of the device structure */
-
dev_init_buffers(dev);
s->skb = NULL;
dev->addr_len = AX25_ADDR_LEN; /* sizeof an ax.25 address */
memcpy(dev->broadcast, ax25_bcast, AX25_ADDR_LEN);
memcpy(dev->dev_addr, ax25_nocall, AX25_ADDR_LEN);
+ dev->tx_queue_len = 16;
/* New style flags */
dev->flags = 0;
int __init init_module(void)
{
- printk(KERN_INFO "hdlcdrv: (C) 1996 Thomas Sailer HB9JNX/AE4WA\n");
- printk(KERN_INFO "hdlcdrv: version 0.7 compiled " __TIME__ " " __DATE__ "\n");
+ printk(KERN_INFO "hdlcdrv: (C) 1996-2000 Thomas Sailer HB9JNX/AE4WA\n");
+ printk(KERN_INFO "hdlcdrv: version 0.8 compiled " __TIME__ " " __DATE__ "\n");
return 0;
}
*
*
* History:
- * 0.1 21.09.96 Started
- * 18.10.96 Changed to new user space access routines (copy_{to,from}_user)
- * 0.4 21.01.97 Separately compileable soundcard/modem modules
- * 0.5 03.03.97 fixed LPT probing (check_lpt result was interpreted the wrong way round)
- * 0.6 16.04.97 init code/data tagged
- * 0.7 30.07.97 fixed halfduplex interrupt handlers/hotfix for CS423X
- * 0.8 14.04.98 cleanups
- * 0.9 03.08.99 adapt to Linus' new __setup/__initcall
- * use parport lowlevel drivers instead of directly writing to a parallel port
- * removed some pre-2.2 kernel compatibility cruft
- * 0.10 10.08.99 Check if parport can do SPP and is safe to access during interrupt contexts
+ * 0.1 21.09.1996 Started
+ * 18.10.1996 Changed to new user space access routines (copy_{to,from}_user)
+ * 0.4 21.01.1997 Separately compileable soundcard/modem modules
+ * 0.5 03.03.1997 fixed LPT probing (check_lpt result was interpreted the wrong way round)
+ * 0.6 16.04.1997 init code/data tagged
+ * 0.7 30.07.1997 fixed halfduplex interrupt handlers/hotfix for CS423X
+ * 0.8 14.04.1998 cleanups
+ * 0.9 03.08.1999 adapt to Linus' new __setup/__initcall
+ * use parport lowlevel drivers instead of directly writing to a parallel port
+ * removed some pre-2.2 kernel compatibility cruft
+ * 0.10 10.08.1999 Check if parport can do SPP and is safe to access during interrupt contexts
+ * 0.11 12.02.2000 adapted to softnet driver interface
*/
/*****************************************************************************/
/* --------------------------------------------------------------------- */
/*static*/ const char sm_drvname[] = "soundmodem";
-static const char sm_drvinfo[] = KERN_INFO "soundmodem: (C) 1996-1999 Thomas Sailer, HB9JNX/AE4WA\n"
-KERN_INFO "soundmodem: version 0.9 compiled " __TIME__ " " __DATE__ "\n";
+static const char sm_drvinfo[] = KERN_INFO "soundmodem: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n"
+KERN_INFO "soundmodem: version 0.11 compiled " __TIME__ " " __DATE__ "\n";
/* --------------------------------------------------------------------- */
#else
#define PCI_SUPPORT_VER2
#endif
-#if LINUX_VERSION_CODE < 0x20159
-#define dev_free_skb(skb) dev_kfree_skb(skb, FREE_WRITE);
-#else
-#define dev_free_skb(skb) dev_kfree_skb(skb);
-#endif
/* The I/O extent. */
#define RTL8129_TOTAL_SIZE 0x80
if (skb) {
if (mapping)
pci_unmap_single(tp->pdev, mapping, skb->len);
- dev_free_skb(skb);
+ dev_kfree_skb(skb);
}
tp->tx_info[i].skb = NULL;
tp->tx_info[i].mapping = 0;
#define RUN_AT(x) (jiffies + (x))
-#define DEV_FREE_SKB(skb) dev_kfree_skb(skb);
-
/* The PCI I/O space extent. */
#define YELLOWFIN_TOTAL_SIZE 0x100
if (yp->tx_ring[entry].status == 0)
break;
/* Free the original skb. */
- DEV_FREE_SKB(yp->tx_skbuff[entry]);
+ dev_kfree_skb_irq(yp->tx_skbuff[entry]);
yp->tx_skbuff[entry] = 0;
yp->stats.tx_packets++;
}
}
/* Free the original skb. */
- DEV_FREE_SKB(yp->tx_skbuff[entry]);
+ dev_kfree_skb_irq(yp->tx_skbuff[entry]);
yp->tx_skbuff[entry] = 0;
/* Mark status as empty. */
yp->tx_status[entry].tx_errs = 0;
yp->rx_ring[i].cmd = CMD_STOP;
yp->rx_ring[i].addr = 0xBADF00D0; /* An invalid address. */
if (yp->rx_skbuff[i]) {
- DEV_FREE_SKB(yp->rx_skbuff[i]);
+ dev_kfree_skb(yp->rx_skbuff[i]);
}
yp->rx_skbuff[i] = 0;
}
for (i = 0; i < TX_RING_SIZE; i++) {
if (yp->tx_skbuff[i])
- DEV_FREE_SKB(yp->tx_skbuff[i]);
+ dev_kfree_skb(yp->tx_skbuff[i]);
yp->tx_skbuff[i] = 0;
}
SCpnt->sense_buffer[2] = 0;
scsi_wait_cmd(SCpnt, (void *) cmd, (void *) buffer,
- 512, SD_TIMEOUT, MAX_RETRIES);
+ 0/*512*/, SD_TIMEOUT, MAX_RETRIES);
}
spintime = 1;
spintime_value = jiffies;
*/
#define in_interrupt() ((local_irq_count + local_bh_count) != 0)
-#define hardirq_trylock(cpu) (local_irq_count == 0)
-#define hardirq_endlock(cpu) do { } while (0)
+#define hardirq_trylock(cpu) ((void)(cpu), local_irq_count == 0)
+#define hardirq_endlock(cpu) do { (void)(cpu); } while (0)
#define hardirq_enter(cpu) (local_irq_count++)
#define hardirq_exit(cpu) (local_irq_count--)
#ifndef __SMP__
-#define hardirq_trylock(cpu) (local_irq_count == 0)
-#define hardirq_endlock(cpu) do { } while(0)
+#define hardirq_trylock(cpu) ((void)(cpu), local_irq_count == 0)
+#define hardirq_endlock(cpu) do { (void)(cpu); } while(0)
-#define hardirq_enter(cpu) (local_irq_count++)
-#define hardirq_exit(cpu) (local_irq_count--)
+#define hardirq_enter(cpu) ((void)(cpu), local_irq_count++)
+#define hardirq_exit(cpu) ((void)(cpu), local_irq_count--)
#define synchronize_irq() barrier()
! spin_is_locked (&global_irq_lock));
}
-#define hardirq_endlock(cpu) do { } while (0)
+#define hardirq_endlock(cpu) do { (void)(cpu); } while (0)
extern void synchronize_irq(void);
#include <linux/kernel.h>
#include <linux/smp.h>
+#include <linux/cache.h>
#include <asm/bitops.h>
#include <asm/atomic.h>
#ifdef CONFIG_KMOD
extern int request_module(const char * name);
+extern int exec_usermodehelper(char *program_path, char *argv[], char *envp[]);
#else
#define request_module(x) do {} while(0)
+extern inline int exec_usermodehelper(char *program_path, char *argv[], char *envp[])
+{
+ return -EACCES;
+}
#endif
extern const char *if_port_text[];
+#include <linux/cache.h>
#include <linux/skbuff.h>
struct neighbour;
#include <linux/config.h>
#include <linux/timer.h>
+#include <linux/cache.h>
#include <linux/in.h> /* struct sockaddr_in */
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
unlock_kernel();
}
-static int exec_modprobe(void * module_name)
+int exec_usermodehelper(char *program_path, char *argv[], char *envp[])
{
- static char * envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
- char *argv[] = { modprobe_path, "-s", "-k", (char*)module_name, NULL };
int i;
current->session = 1;
set_fs(KERNEL_DS);
/* Go, go, go... */
- if (execve(modprobe_path, argv, envp) < 0) {
+ if (execve(program_path, argv, envp) < 0)
+ return -errno;
+ return 0;
+}
+
+static int exec_modprobe(void * module_name)
+{
+ static char * envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
+ char *argv[] = { modprobe_path, "-s", "-k", (char*)module_name, NULL };
+ int ret;
+
+ ret = exec_usermodehelper(modprobe_path, argv, envp);
+ if (ret) {
printk(KERN_ERR
"kmod: failed to exec %s -s -k %s, errno = %d\n",
modprobe_path, (char*) module_name, errno);
- return -errno;
}
- return 0;
+ return ret;
}
/*
#ifdef CONFIG_KMOD
EXPORT_SYMBOL(request_module);
+EXPORT_SYMBOL(exec_usermodehelper);
#endif
#ifdef CONFIG_MODULES
* Authors: Alan Cox <iiitac@pyr.swan.ac.uk>
* Florian La Roche <rzsfl@rz.uni-sb.de>
*
- * Version: $Id: skbuff.c,v 1.66 2000/02/09 21:11:30 davem Exp $
+ * Version: $Id: skbuff.c,v 1.67 2000/02/11 22:27:23 davem Exp $
*
* Fixes:
* Alan Cox : Fixed the worst of the load balancer bugs.
#include <linux/string.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
+#include <linux/cache.h>
#include <linux/init.h>
#include <net/ip.h>
#ifdef CONFIG_DECNET_RAW
proc_net_create("decnet_raw", 0, dn_raw_get_info);
#endif
- dn_dev_init();
dn_neigh_init();
+ dn_dev_init();
dn_route_init();
#ifdef CONFIG_DECNET_ROUTER
unregister_netdevice_notifier(&dn_dev_notifier);
dn_route_cleanup();
- dn_neigh_cleanup();
dn_dev_cleanup();
+ dn_neigh_cleanup();
#ifdef CONFIG_DECNET_ROUTER
dn_fib_cleanup();
*
* Implementation of the Transmission Control Protocol(TCP).
*
- * Version: $Id: tcp_ipv4.c,v 1.199 2000/02/08 21:27:17 davem Exp $
+ * Version: $Id: tcp_ipv4.c,v 1.200 2000/02/11 22:27:26 davem Exp $
*
* IPv4 specific functions
*
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/random.h>
+#include <linux/cache.h>
#include <linux/init.h>
#include <net/icmp.h>
#include <linux/wanrouter.h>
#include <linux/init.h>
#include <linux/poll.h>
+#include <linux/cache.h>
#if defined(CONFIG_KMOD) && defined(CONFIG_NET)
#include <linux/kmod.h>
static inline void
svc_serv_enqueue(struct svc_serv *serv, struct svc_rqst *rqstp)
{
- BUG_TRAP(spin_is_locked(&serv->sv_lock));
rpc_append_list(&serv->sv_threads, rqstp);
}
static inline void
svc_serv_dequeue(struct svc_serv *serv, struct svc_rqst *rqstp)
{
- BUG_TRAP(spin_is_locked(&serv->sv_lock));
rpc_remove_list(&serv->sv_threads, rqstp);
}
struct svc_serv *serv = svsk->sk_server;
struct svc_rqst *rqstp;
- BUG_TRAP(spin_is_locked(&svsk->sk_lock));
-
/* NOTE: Local BH is already disabled by our caller. */
spin_lock(&serv->sv_lock);
{
struct svc_sock *svsk;
- BUG_TRAP(spin_is_locked(&serv->sv_lock));
-
if ((svsk = serv->sv_sockets) != NULL)
rpc_remove_list(&serv->sv_sockets, svsk);