Commit 275d3262 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.85

parent 9ba95981
...@@ -730,6 +730,16 @@ S: 36 Mudtown Road ...@@ -730,6 +730,16 @@ S: 36 Mudtown Road
S: Wantage, New Jersey 07461 S: Wantage, New Jersey 07461
S: USA S: USA
N: Harald Hoyer
E: HarryH@Royal.Net
W: http://hot.spotline.de/
W: http://home.pages.de/~saturn
D: ip_masq_quake
D: md boot support
S: Alleenstrasse 27
S: D-71679 Asperg
S: Germany
N: Miguel de Icaza Amozurrutia N: Miguel de Icaza Amozurrutia
E: miguel@nuclecu.unam.mx E: miguel@nuclecu.unam.mx
D: Linux/SPARC team, Midnight Commander maintainer D: Linux/SPARC team, Midnight Commander maintainer
...@@ -1361,8 +1371,9 @@ S: 79098 Freiburg ...@@ -1361,8 +1371,9 @@ S: 79098 Freiburg
S: Germany S: Germany
N: Joerg Reuter N: Joerg Reuter
E: jreuter@lykos.oche.de E: jreuter@poboxes.com
E: dl1bke@db0pra.ampr.org W: http://www.rat.de/jr/
W: http://qsl.net/dl1bke/
D: Generic Z8530 driver, AX.25 DAMA slave implementation D: Generic Z8530 driver, AX.25 DAMA slave implementation
D: Several AX.25 hacks D: Several AX.25 hacks
......
...@@ -658,6 +658,11 @@ CONFIG_MD_RAID5 ...@@ -658,6 +658,11 @@ CONFIG_MD_RAID5
want to compile it as a module, say M here and read want to compile it as a module, say M here and read
Documentation/modules.txt. If unsure, say Y. Documentation/modules.txt. If unsure, say Y.
Boot support (linear, striped)
CONFIG_MD_BOOT
To boot with an initial linear or striped md device you have to
select this. For lilo and loadlin options see Documentation/md.txt.
Support for Deskstation RPC44 Support for Deskstation RPC44
CONFIG_DESKSTATION_RPC44 CONFIG_DESKSTATION_RPC44
This is a machine with a R4400 100 MHz CPU. To compile a Linux This is a machine with a R4400 100 MHz CPU. To compile a Linux
...@@ -2737,29 +2742,54 @@ CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT ...@@ -2737,29 +2742,54 @@ CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT
IBMMCA SCSI support IBMMCA SCSI support
CONFIG_SCSI_IBMMCA CONFIG_SCSI_IBMMCA
If your computer sports an MCA bus system architecture (IBM PS/2) This is support for the IBM SCSI adapter found in many of the PS/2
with an SCSI harddrive, say Y here. Please read series. CONFIG_MCA must be set for this to work. If the adapter
Documentation/mca.txt. This driver is also available as a module ( = isn't found during boot (a common problem for models 56, 57, 76, and
code which can be inserted in and removed from the running kernel 77) you'll need to use the 'ibmmcascsi=<pun>', where <pun> is the id
whenever you want). The module will be called ibmmca.o. If you want of the SCSI subsystem (usually 7, but if that doesn't work check your
to compile it as a module, say M here and read reference diskette). Owners of model 95 with a LED-matrix-display
Documentation/modules.txt. can in addition activate some activity info like under OS/2, but more
Normally, all IBM MCA SCSI adapters are automatically detected. If informative, by setting 'ibmmcascsi=display' as additional kernel-
that doesn't work right however, you can completely override parameter.
auto-detection by specifying "ibmmcascsi=io1,io2,..." at the boot
loader's command prompt or "io_port=io1,io2,... scsi_id=id1,id2,..." Standard SCSI-order
as a parameter of insmod. "io" and "id" are the I/O base address CONFIG_IBMMCA_SCSI_ORDER_STANDARD
and the SCSI ID of each adapter, respectively. In the PC-world and in most modern SCSI-BIOS-setups, SCSI-harddisks
If you want to compile this driver as a module ( = code which can be are assigned to the driveletters, starting with the lowest SCSI-id
inserted in and removed from the running kernel whenever you want), (physical number - pun) to be drive C:, as seen from DOS and similar
say M here and read Documentation/modules.txt. The module will be operating systems. When looking into papers, describing the
called ibmmca.o. ANSI-SCSI-standard, this assignment of drives appears to be wrong.
The SCSI-standard follows a hardware-hierarchy which says, that
reset SCSI-devices while booting id 7 has the highest priority and id 0 the lowest. Therefore, the
CONFIG_SCSI_IBMMCA_DEV_RESET hostadapters are still today everywhere placed as SCSI-id 7 by
If you say Y here, each connected SCSI device will get a reset default. In the SCSI-standard, the driveletters express the priority
command at boot time. This can be necessary for some special SCSI of the disk. C: should be the harddisk or a partition on it, with the
devices. If unsure, say N. highest priority. This must therefore be the disk with the highest
SCSI-id (e.g. 6) and not the one with the lowest! IBM-BIOS kept the
original definition of the SCSI-standard as also industrial- and
process-control-machines, like VME-CPUs running under realtime-OSs
(e.g. LynxOS, OS9) do.
If you like to run Linux on your MCA-machine with the same assignment,
of harddisks, as seen from e.g. DOS or OS/2 on your machine, which
is in addition conform to the SCSI-standard, you must say 'y' here.
This is also necessary for MCA-Linux-users who want to keep downward-
compatibility to older releases of the IBM-MCA-SCSI-driver (older than
driver-release 2.00 and older than June 1997).
If you like to have the lowest SCSI-id assigned as drive C:, as modern
SCSI-BIOS do, which is not conform to the standard, but widely spread
and common in the PC-world of today, you must say 'n' here.
Reset SCSI-devices at boottime
CONFIG_IBMMCA_SCSI_DEV_RESET
By default, SCSI-devices are reset, when the machine is powered on.
However, some devices exist, like special-control-devices,
SCSI-CNC-machines, SCSI-printer or scanners of older type, that
do not reset, when switched on. If you say 'y' here, each device
along your SCSI-bus will get a reset-command after it has been
probed, while the kernel is booting. Say always 'n' here, if you
have no such strange SCSI-devices on your bus. If you say 'y' and
some more modern devices, like harddisks, do not like too much
resets, your system will hang when booting.
Always IN2000 SCSI support Always IN2000 SCSI support
CONFIG_SCSI_IN2000 CONFIG_SCSI_IN2000
......
most (all) Intel SMP boards have the so-called 'IO-APIC', which is
an enhanced interrupt controller, able to route hardware interrupts
to multiple CPUs, or to CPU groups.
Linux supports the IO-APIC, but unfortunately there are broken boards
out there which make it unsafe to enable the IO-APIC unconditionally.
The Linux policy thus is to enable the IO-APIC only if it's 100% safe, ie.:
- the board is on the 'whitelist'
or - the board does not have PCI pins connected to the IO-APIC
or - the user has overriden blacklisted settings with the
pirq= boot option line.
Kernel messages tell you wether the board is 'safe'. If your box
boots with enabled IO-APIC IRQs, then you have nothing else to do. Your
/proc/interrupts will look like this one:
---------------------------->
hell:~> cat /proc/interrupts
CPU0 CPU1
0: 90782 0 XT PIC timer
1: 4135 2375 IO-APIC keyboard
2: 0 0 XT PIC cascade
3: 851 807 IO-APIC serial
9: 6 22 IO-APIC ncr53c8xx
11: 307 154 IO-APIC NE2000
13: 4 0 XT PIC fpu
14: 56000 30610 IO-APIC ide0
NMI: 0
IPI: 0
<----------------------------
some interrupts will still be 'XT PIC', but this is not a problem, none
of those IRQ sources is 'heavy'.
If one of your boot messages says 'unlisted/blacklisted board, DISABLING
IO-APIC IRQs', then you should do this to get multi-CPU IO-APIC IRQs
running:
A) if your board is unlisted, then mail to linux-smp to get
it into either the white or the blacklist
B) if your board is blacklisted, then figure out the apropriate
pirq= option to get your system boot
pirq= lines look like the following in /etc/lilo.conf:
append="pirq=15,11,10"
the actual numbers depend on your system, on your PCI cards and on their
PCI slot position. Usually PCI slots are 'daisy chained' before they are
connected to the PCI chipset irq routing facility (the incoming PIRQ1-4
lines):
,-. ,-. ,-. ,-. ,-.
PIRQ4 ----| |-. ,-| |-. ,-| |-. ,-| |--------| |
|S| \ / |S| \ / |S| \ / |S| |S|
PIRQ3 ----|l|-. `/---|l|-. `/---|l|-. `/---|l|--------|l|
|o| \/ |o| \/ |o| \/ |o| |o|
PIRQ2 ----|t|-./`----|t|-./`----|t|-./`----|t|--------|t|
|1| /\ |2| /\ |3| /\ |4| |5|
PIRQ1 ----| |- `----| |- `----| |- `----| |--------| |
`-' `-' `-' `-' `-'
every PCI card emits a PCI IRQ, which can be INTA,INTB,INTC,INTD:
,-.
INTD--| |
|S|
INTC--|l|
|o|
INTB--|t|
|x|
INTA--| |
`-'
These INTA-D PCI IRQs are always 'local to the card', their real meaning
depends on which slot they are in. If you look at the daisy chaining diagram,
a card in slot4, issuing INTA IRQ, it will end up as a signal on PIRQ2 of
the PCI chipset. Most cards issue INTA, this creates optimal distibution
between the PIRQ lines. (distributing IRQ sources properly is not a
necessity, PCI IRQs can be shared at will, but it's a good for performance
to have non shared interrupts). Slot5 should be used for videocards, they
dont use interrupts normally, thus they are not daisy chained either.
so if you have your SCSI card (IRQ11) in Slot1, Tulip card (IRQ9) in
Slot2, then you'll have to specify this pirq= line:
append="pirq=11,9"
the following script tries to figure out such a default pirq= line from
your PCI configuration:
echo -n pirq=; echo `scanpci | grep T_L | cut -c56-` | sed 's/ /,/g'
note that this script wont work if you have skipped a few slots or if your
board does not do default daisy-chaining. (or the IO-APIC has the PIRQ pins
connected in some strange way). Eg. if in the above case you have your SCSI
card (IRQ11) in Slot3, and have Slot1 empty:
append="pirq=0,9,11"
[value '0' is a generic 'placeholder', reserved for empty (or non-IRQ emitting)
slots.]
generally, it's always possible to find out the correct pirq= settings, just
permutate all IRQ numbers properly ... it will take some time though. An
'incorrect' pirq line will cause the booting process to hang, or a device
wont function properly (if it's inserted as eg. a module).
If you have 2 PCI buses, then you can use up to 8 pirq values. Although such
boards tend to have a good configuration and will be included in the
whitelist.
Be prepared that it might happen that you need some strange pirq line:
append="pirq=0,0,0,0,0,0,9,11"
use smart try-and-err techniques to find out the correct pirq line ...
the following pirq line can be used to force a board into the whitelist:
append="pirq=0"
[if your system works with no problems after this, then it should be added
to the official whitelist, contact us]
good luck and mail to linux-smp@vger.rutgers.edu or
linux-kernel@vger.rutger.edu if you have any problems that are not covered
by this document.
-- mingo
Mount options that are the same as for msdos and vfat partitions.
conv=binary Data is returned exactly as is, with CRLF's. [default]
conv=text (Carriage return, line feed) is replaced with newline.
conv=mtext (Carriage return, line feed) is returned as is (?).
conv=auto Chooses, file by file, conv=binary or conv=text (by guessing)
gid=nnn All files in the partition will be in group nnn.
uid=nnn All files in the partition will be owned by user id nnn.
umask=nnn The permission mask (see umask(1)) for the partition.
Mount options that are the same as vfat partitions. These are only useful
when using discs encoded using Microsoft's Joliet extensions.
iocharset=name Character set to use for converting from Unicode to
ASCII. Joliet filenames are stored in Unicode format, but
Unix for the most part doesn't know how to deal with Unicode.
There is also an option of doing UTF8 translations with the
utf8 option.
utf8 Encode Unicode names in UTF8 format. Default is no.
Mount options that are unique to the isofs filesystem.
block=512 Set the block size for the disk to 512 bytes
block=1024 Set the block size for the disk to 1024 bytes
block=2048 Set the block size for the disk to 2048 bytes
check=relaxed Matches filenames with different cases
check=strict Matches only filenames with the exact same case
cruft Try to handle badly formatted CDs.
map=off Do not map non-rockridge filenames to lowercase
map=normal Map rockridge filenames to lowercase
mode=xxx Sets the permissions on files to xxx
nojoliet Ignore Joliet extensions if they are present.
norock Ignore rockridge extensions if they are present.
unhide Show hidden files.
Tools that manage md devices can be found at sweet-smoke.ufr-info-p7.ibp.fr
in public/Linux/md035.tar.gz.
Marc ZYNGIER <zyngier@ufr-info-p7.ibp.fr>
--
You can boot (if you selected boot support in the configuration) with your md
device with the following kernel command line:
md=<md device no.>,<raid level>,<chunk size factor>,<fault level>,dev0,dev1,...,devn
md device no. = the number of the md device ...
0 means md0,
1 md1,
2 md2,
3 md3,
4 md4
raid level = -1 linear mode
0 striped mode
other modes are currently unsupported.
chunk size factor = (raid-0 and raid-1 only)
Set the chunk size as PAGE_SIZE << n.
fault level = (raid-1 only)
Set the maximum fault number as n.
Currently unsupported due to lack of boot support for raid1.
dev0-devn: e.g. /dev/hda1,/dev/hdc1,/dev/sda1,/dev/sdb1
my loadlin line looks like this:
e:\loadlin\loadlin e:\zimage root=/dev/md0 md=0,0,4,0,/dev/hdb2,/dev/hdc3 ro
Harald Hoyer <HarryH@Royal.Net>
You will find subset of the documentation in
linux/Documentation/networking/z8530drv.txt
To use this driver you MUST have the full package from:
Internet:
=========
1. db0bm.automation.fh-aachen.de/incoming/dl1bke/z8530drv-utils-3.0.tar.gz
2. ftp.ucsd.edu:/hamradio/packet/tcpip/incoming/z8530drv-utils-3.0.tar.gz
If you can't find it there, try .../tcpip/linux/z8530drv-utils-3.0.tar.gz
and various mirrors (i.e. nic.switch.ch)
The package includes the utilities necessary to initialize and
control the driver.
Joerg Reuter ampr-net: dl1bke@db0pra.ampr.org
AX-25 : DL1BKE @ DB0ACH.#NRW.DEU.EU
Internet: jreuter@lykos.oche.de
...@@ -4,9 +4,9 @@ full package from: ...@@ -4,9 +4,9 @@ full package from:
Internet: Internet:
========= =========
1. ftp://db0bm.automation.fh-aachen.de/incoming/z8530drv/z8530drv-utils-3.0.tar.gz 1. ftp://ftp.ccac.rwth-aachen.de/pub/jr/z8530drv-utils-3.0-1.tar.gz
2. ftp://ftp.pspt.fi/pub/ham/linux/ax25/z8530drv-utils-3.0.tar.gz 2. ftp://ftp.pspt.fi/pub/ham/linux/ax25/z8530drv-utils-3.0-1.tar.gz
3. ftp://ftp.ucsd.edu/hamradio/packet/tcpip/incoming/z8530drv-utils-3.0.tar.gz 3. ftp://ftp.ucsd.edu/hamradio/packet/tcpip/incoming/z8530drv-utils-3.0.tar.gz
If you can't find it there, try .../tcpip/linux/z8530drv-utils-3.0.tar.gz If you can't find it there, try .../tcpip/linux/z8530drv-utils-3.0.tar.gz
...@@ -23,7 +23,7 @@ http://www.rat.de/jr ...@@ -23,7 +23,7 @@ http://www.rat.de/jr
******************************************************************** ********************************************************************
(c) 1993,1997 by Joerg Reuter DL1BKE <jreuter@poboxes.com> (c) 1993,1998 by Joerg Reuter DL1BKE <jreuter@poboxes.com>
portions (c) 1993 Guido ten Dolle PE1NNZ portions (c) 1993 Guido ten Dolle PE1NNZ
......
...@@ -156,7 +156,9 @@ S: Supported ...@@ -156,7 +156,9 @@ S: Supported
DAMA SLAVE for AX.25 DAMA SLAVE for AX.25
P: Joerg Reuter P: Joerg Reuter
M: jreuter@lykos.oche.de M: jreuter@poboxes.com
W: http://www.rat.de/jr/
W: http://qsl.net/dl1bke/
L: linux-hams@vger.rutgers.edu L: linux-hams@vger.rutgers.edu
S: Maintained S: Maintained
...@@ -602,7 +604,9 @@ S: Maintained ...@@ -602,7 +604,9 @@ S: Maintained
Z8530 DRIVER FOR AX.25 Z8530 DRIVER FOR AX.25
P: Joerg Reuter P: Joerg Reuter
M: jreuter@lykos.oche.de M: jreuter@poboxes.com
W: http://www.rat.de/jr/
W: http://qsl.net/dl1bke/
L: linux-hams@vger.rutgers.edu L: linux-hams@vger.rutgers.edu
S: Maintained S: Maintained
......
VERSION = 2 VERSION = 2
PATCHLEVEL = 1 PATCHLEVEL = 1
SUBLEVEL = 84 SUBLEVEL = 85
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/) ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
......
...@@ -191,7 +191,7 @@ if [ "$CONFIG_NET" = "y" ]; then ...@@ -191,7 +191,7 @@ if [ "$CONFIG_NET" = "y" ]; then
endmenu endmenu
fi fi
source drivers/net/hamradio/Config.in source net/ax25/Config.in
mainmenu_option next_comment mainmenu_option next_comment
comment 'ISDN subsystem' comment 'ISDN subsystem'
......
...@@ -40,7 +40,7 @@ extern void __remlu (void); ...@@ -40,7 +40,7 @@ extern void __remlu (void);
extern void __divqu (void); extern void __divqu (void);
extern void __remqu (void); extern void __remqu (void);
EXPORT_SYMBOL(__alpha_bh_counter); EXPORT_SYMBOL(local_bh_count);
EXPORT_SYMBOL(local_irq_count); EXPORT_SYMBOL(local_irq_count);
/* platform dependent support */ /* platform dependent support */
......
...@@ -524,7 +524,7 @@ static inline void handle_nmi(struct pt_regs * regs) ...@@ -524,7 +524,7 @@ static inline void handle_nmi(struct pt_regs * regs)
} }
unsigned int local_irq_count[NR_CPUS]; unsigned int local_irq_count[NR_CPUS];
atomic_t __alpha_bh_counter; unsigned int local_bh_count[NR_CPUS];
#ifdef __SMP__ #ifdef __SMP__
#error "Me no hablo Alpha SMP" #error "Me no hablo Alpha SMP"
......
...@@ -23,7 +23,9 @@ OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S ...@@ -23,7 +23,9 @@ OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
LDFLAGS=-e stext LDFLAGS=-e stext
LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinux.lds $(LDFLAGS) LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinux.lds $(LDFLAGS)
CFLAGS := $(CFLAGS) -pipe -fno-strength-reduce CFLAGS_PIPE := -pipe
CFLAGS_NSR := -fno-strength-reduce
CFLAGS := $(CFLAGS) $(CFLAGS_PIPE) $(CFLAGS_NSR)
ifdef CONFIG_M386 ifdef CONFIG_M386
CFLAGS := $(CFLAGS) -m386 -DCPU=386 CFLAGS := $(CFLAGS) -m386 -DCPU=386
......
...@@ -93,7 +93,7 @@ if [ "$CONFIG_NET" = "y" ]; then ...@@ -93,7 +93,7 @@ if [ "$CONFIG_NET" = "y" ]; then
endmenu endmenu
fi fi
source drivers/net/hamradio/Config.in source net/ax25/Config.in
mainmenu_option next_comment mainmenu_option next_comment
comment 'ISDN subsystem' comment 'ISDN subsystem'
......
...@@ -78,6 +78,13 @@ ...@@ -78,6 +78,13 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/io.h> #include <asm/io.h>
#include <linux/smp_lock.h>
#include <asm/irq.h>
#include <asm/bitops.h>
#include <asm/smp.h>
#include "irq.h"
/* /*
* Generic PCI access -- indirect calls according to detected HW. * Generic PCI access -- indirect calls according to detected HW.
*/ */
...@@ -133,7 +140,39 @@ int pcibios_find_device (unsigned short vendor, unsigned short device_id, ...@@ -133,7 +140,39 @@ int pcibios_find_device (unsigned short vendor, unsigned short device_id,
int pcibios_read_config_byte (unsigned char bus, int pcibios_read_config_byte (unsigned char bus,
unsigned char device_fn, unsigned char where, unsigned char *value) unsigned char device_fn, unsigned char where, unsigned char *value)
{ {
return access_pci->read_config_byte(bus, device_fn, where, value); int res;
res = access_pci->read_config_byte(bus, device_fn, where, value);
#ifdef __SMP__
/*
* IOAPICs can take PCI IRQs directly, lets first check the mptable:
*/
if (where == PCI_INTERRUPT_LINE) {
int irq;
char pin;
/*
* get the PCI IRQ INT _physical pin_ for this device
*/
access_pci->read_config_byte(bus, device_fn,
PCI_INTERRUPT_PIN, &pin);
/*
* subtle, PCI pins are numbered starting from 1 ...
*/
pin--;
irq = IO_APIC_get_PCI_irq_vector (bus,PCI_SLOT(device_fn),pin);
if (irq != -1)
*value = (unsigned char) irq;
printk("PCI->APIC IRQ transform: (B%d,I%d,P%d) -> %d\n",
bus,PCI_SLOT(device_fn), pin, irq);
}
#endif
return res;
} }
int pcibios_read_config_word (unsigned char bus, int pcibios_read_config_word (unsigned char bus,
......
...@@ -109,7 +109,7 @@ void io_apic_write (unsigned int reg, unsigned int value) ...@@ -109,7 +109,7 @@ void io_apic_write (unsigned int reg, unsigned int value)
*(io_apic_reg+4) = value; *(io_apic_reg+4) = value;
} }
void enable_IO_APIC_irq (int irq) void enable_IO_APIC_irq (unsigned int irq)
{ {
struct IO_APIC_route_entry entry; struct IO_APIC_route_entry entry;
...@@ -121,7 +121,11 @@ void enable_IO_APIC_irq (int irq) ...@@ -121,7 +121,11 @@ void enable_IO_APIC_irq (int irq)
io_apic_write(0x10+2*irq, *(((int *)&entry)+0)); io_apic_write(0x10+2*irq, *(((int *)&entry)+0));
} }
void disable_IO_APIC_irq (int irq) /*
* this function is just here to make things complete, otherwise it's
* unused
*/
void disable_IO_APIC_irq (unsigned int irq)
{ {
struct IO_APIC_route_entry entry; struct IO_APIC_route_entry entry;
...@@ -133,7 +137,7 @@ void disable_IO_APIC_irq (int irq) ...@@ -133,7 +137,7 @@ void disable_IO_APIC_irq (int irq)
io_apic_write(0x10+2*irq, *(((int *)&entry)+0)); io_apic_write(0x10+2*irq, *(((int *)&entry)+0));
} }
void clear_IO_APIC_irq (int irq) void clear_IO_APIC_irq (unsigned int irq)
{ {
struct IO_APIC_route_entry entry; struct IO_APIC_route_entry entry;
...@@ -151,8 +155,9 @@ void clear_IO_APIC_irq (int irq) ...@@ -151,8 +155,9 @@ void clear_IO_APIC_irq (int irq)
* specific CPU-side IRQs. * specific CPU-side IRQs.
*/ */
#define MAX_PIRQS 4 #define MAX_PIRQS 8
int pirq_entries [MAX_PIRQS]; int pirq_entries [MAX_PIRQS];
int pirqs_enabled;
void ioapic_pirq_setup(char *str, int *ints) void ioapic_pirq_setup(char *str, int *ints)
{ {
...@@ -161,9 +166,12 @@ void ioapic_pirq_setup(char *str, int *ints) ...@@ -161,9 +166,12 @@ void ioapic_pirq_setup(char *str, int *ints)
for (i=0; i<MAX_PIRQS; i++) for (i=0; i<MAX_PIRQS; i++)
pirq_entries[i]=-1; pirq_entries[i]=-1;
if (!ints) if (!ints) {
pirqs_enabled=0;
printk("PIRQ redirection SETUP, trusting MP-BIOS.\n"); printk("PIRQ redirection SETUP, trusting MP-BIOS.\n");
else {
} else {
pirqs_enabled=1;
printk("PIRQ redirection SETUP, working around broken MP-BIOS.\n"); printk("PIRQ redirection SETUP, working around broken MP-BIOS.\n");
max = MAX_PIRQS; max = MAX_PIRQS;
if (ints[0] < MAX_PIRQS) if (ints[0] < MAX_PIRQS)
...@@ -229,9 +237,10 @@ void setup_IO_APIC_irqs (void) ...@@ -229,9 +237,10 @@ void setup_IO_APIC_irqs (void)
} }
case MP_BUS_PCI: /* PCI pin */ case MP_BUS_PCI: /* PCI pin */
{ {
irq = mp_irqs[idx].mpc_srcbusirq >> 2; /*
if (irq>=16) * PCI IRQs are 'directly mapped'
printk("WARNING: MP BIOS says PIRQ%d is redirected to %d, suspicious.\n",idx-16, irq); */
irq = i;
break; break;
} }
default: default:
...@@ -358,7 +367,7 @@ void setup_IO_APIC_irqs (void) ...@@ -358,7 +367,7 @@ void setup_IO_APIC_irqs (void)
printk(" not connected.\n"); printk(" not connected.\n");
} }
void setup_IO_APIC_irq_ISA_default (int irq) void setup_IO_APIC_irq_ISA_default (unsigned int irq)
{ {
struct IO_APIC_route_entry entry; struct IO_APIC_route_entry entry;
...@@ -381,8 +390,23 @@ void setup_IO_APIC_irq_ISA_default (int irq) ...@@ -381,8 +390,23 @@ void setup_IO_APIC_irq_ISA_default (int irq)
io_apic_write(0x11+2*irq, *(((int *)&entry)+1)); io_apic_write(0x11+2*irq, *(((int *)&entry)+1));
} }
void setup_IO_APIC_irq (int irq) int IO_APIC_get_PCI_irq_vector (int bus, int slot, int pci_pin)
{ {
int i;
for (i=0; i<mp_irq_entries; i++) {
int lbus = mp_irqs[i].mpc_srcbus;
if (IO_APIC_IRQ(i) &&
(mp_bus_id_to_type[lbus] == MP_BUS_PCI) &&
!mp_irqs[i].mpc_irqtype &&
(bus == mp_irqs[i].mpc_srcbus) &&
(slot == (mp_irqs[i].mpc_srcbusirq >> 2)) &&
(pci_pin == (mp_irqs[i].mpc_srcbusirq & 3)))
return mp_irqs[i].mpc_dstirq;
}
return -1;
} }
void print_IO_APIC (void) void print_IO_APIC (void)
...@@ -471,6 +495,47 @@ void init_sym_mode (void) ...@@ -471,6 +495,47 @@ void init_sym_mode (void)
printk("...done.\n"); printk("...done.\n");
} }
char ioapic_OEM_ID [16];
char ioapic_Product_ID [16];
struct ioapic_list_entry {
char * oem_id;
char * product_id;
};
struct ioapic_list_entry ioapic_whitelist [] = {
{ "INTEL " , "PR440FX " },
{ 0 , 0 }
};
struct ioapic_list_entry ioapic_blacklist [] = {
{ "OEM00000" , "PROD00000000" },
{ 0 , 0 }
};
static int in_ioapic_list (struct ioapic_list_entry * table)
{
for (;table->oem_id; table++)
if ((!strcmp(table->oem_id,ioapic_OEM_ID)) &&
(!strcmp(table->product_id,ioapic_Product_ID)))
return 1;
return 0;
}
static int ioapic_whitelisted (void)
{
return in_ioapic_list(ioapic_whitelist);
}
static int ioapic_blacklisted (void)
{
return in_ioapic_list(ioapic_blacklist);
}
void setup_IO_APIC (void) void setup_IO_APIC (void)
{ {
int i; int i;
...@@ -490,8 +555,6 @@ void setup_IO_APIC (void) ...@@ -490,8 +555,6 @@ void setup_IO_APIC (void)
nr_ioapic_registers = reg_01.entries+1; nr_ioapic_registers = reg_01.entries+1;
} }
init_IO_APIC_traps();
/* /*
* do not trust the IO-APIC being empty at bootup * do not trust the IO-APIC being empty at bootup
*/ */
...@@ -504,6 +567,30 @@ void setup_IO_APIC (void) ...@@ -504,6 +567,30 @@ void setup_IO_APIC (void)
setup_IO_APIC_irq_ISA_default (i); setup_IO_APIC_irq_ISA_default (i);
#endif #endif
/*
* the following IO-APIC's can be enabled:
*
* - whitelisted ones
* - those which have no PCI pins connected
* - those for which the user has specified a pirq= parameter
*/
if ( ioapic_whitelisted() ||
(nr_ioapic_registers == 16) ||
pirqs_enabled)
{
printk("ENABLING IO-APIC IRQs\n");
io_apic_irqs = ~((1<<0)|(1<<2)|(1<<13));
} else {
if (ioapic_blacklisted())
printk(" blacklisted board, DISABLING IO-APIC IRQs\n");
else
printk(" unlisted board, DISABLING IO-APIC IRQs\n");
printk(" see Documentation/IO-APIC.txt to enable them\n");
io_apic_irqs = 0;
}
init_IO_APIC_traps();
setup_IO_APIC_irqs (); setup_IO_APIC_irqs ();
printk("nr of MP irq sources: %d.\n", mp_irq_entries); printk("nr of MP irq sources: %d.\n", mp_irq_entries);
......
This diff is collapsed.
...@@ -9,15 +9,15 @@ ...@@ -9,15 +9,15 @@
#define IO_APIC_GATE_OFFSET 0x51 #define IO_APIC_GATE_OFFSET 0x51
void mask_irq(unsigned int irq_nr); void mask_irq(unsigned int irq);
void unmask_irq(unsigned int irq_nr); void unmask_irq(unsigned int irq);
void enable_IO_APIC_irq (int irq); void enable_IO_APIC_irq (unsigned int irq);
void disable_IO_APIC_irq (int irq); void disable_IO_APIC_irq (unsigned int irq);
void set_8259A_irq_mask(int irq_nr); void set_8259A_irq_mask(unsigned int irq);
void setup_IO_APIC_irq (int irq);
void ack_APIC_irq (void); void ack_APIC_irq (void);
void setup_IO_APIC (void); void setup_IO_APIC (void);
void init_IO_APIC_traps(void); void init_IO_APIC_traps(void);
int IO_APIC_get_PCI_irq_vector (int bus, int slot, int fn);
#ifdef __SMP__ #ifdef __SMP__
extern unsigned int io_apic_irqs; extern unsigned int io_apic_irqs;
...@@ -34,6 +34,8 @@ enum mp_bustype { ...@@ -34,6 +34,8 @@ enum mp_bustype {
MP_BUS_PCI MP_BUS_PCI
}; };
extern int mp_bus_id_to_type [MAX_MP_BUSSES]; extern int mp_bus_id_to_type [MAX_MP_BUSSES];
extern char ioapic_OEM_ID [16];
extern char ioapic_Product_ID [16];
extern spinlock_t irq_controller_lock; /* extern spinlock_t irq_controller_lock; /*
* Protects both the 8259 and the * Protects both the 8259 and the
...@@ -44,7 +46,7 @@ extern spinlock_t irq_controller_lock; /* ...@@ -44,7 +46,7 @@ extern spinlock_t irq_controller_lock; /*
#include <asm/atomic.h> #include <asm/atomic.h>
static inline void irq_enter(int cpu, int irq) static inline void irq_enter(int cpu, unsigned int irq)
{ {
hardirq_enter(cpu); hardirq_enter(cpu);
while (test_bit(0,&global_irq_lock)) { while (test_bit(0,&global_irq_lock)) {
...@@ -52,7 +54,7 @@ static inline void irq_enter(int cpu, int irq) ...@@ -52,7 +54,7 @@ static inline void irq_enter(int cpu, int irq)
} }
} }
static inline void irq_exit(int cpu, int irq) static inline void irq_exit(int cpu, unsigned int irq)
{ {
hardirq_exit(cpu); hardirq_exit(cpu);
release_irqlock(cpu); release_irqlock(cpu);
......
...@@ -331,8 +331,9 @@ struct cpu_model_info { ...@@ -331,8 +331,9 @@ struct cpu_model_info {
static struct cpu_model_info cpu_models[] __initdata = { static struct cpu_model_info cpu_models[] __initdata = {
{ X86_VENDOR_INTEL, 4, { X86_VENDOR_INTEL, 4,
{ "486 DX-25/33", "486 DX-50", "486 SX", "487 DX", "486 DX/2", "486 SL", "486 SX/2", { "486 DX-25/33", "486 DX-50", "486 SX", "486 DX/2", "486 SL", "486 SX/2",
NULL, "486 DX/2-WB", "486 DX/4", "486 DX/4-WB", NULL, NULL, NULL, NULL }}, NULL, "486 DX/2-WB", "486 DX/4", "486 DX/4-WB", NULL, NULL, NULL, NULL,
NULL, NULL }},
{ X86_VENDOR_INTEL, 5, { X86_VENDOR_INTEL, 5,
{ "Pentium 60/66 A-step", "Pentium 60/66", "Pentium 75+", { "Pentium 60/66 A-step", "Pentium 60/66", "Pentium 75+",
"OverDrive PODP5V83", "Pentium MMX", NULL, NULL, "OverDrive PODP5V83", "Pentium MMX", NULL, NULL,
......
...@@ -258,10 +258,14 @@ __initfunc(static int smp_read_mpc(struct mp_config_table *mpc)) ...@@ -258,10 +258,14 @@ __initfunc(static int smp_read_mpc(struct mp_config_table *mpc))
} }
memcpy(str,mpc->mpc_oem,8); memcpy(str,mpc->mpc_oem,8);
str[8]=0; str[8]=0;
memcpy(ioapic_OEM_ID,str,9);
printk("OEM ID: %s ",str); printk("OEM ID: %s ",str);
memcpy(str,mpc->mpc_productid,12); memcpy(str,mpc->mpc_productid,12);
str[12]=0; str[12]=0;
memcpy(ioapic_Product_ID,str,13);
printk("Product ID: %s ",str); printk("Product ID: %s ",str);
printk("APIC at: 0x%lX\n",mpc->mpc_lapic); printk("APIC at: 0x%lX\n",mpc->mpc_lapic);
/* set the local APIC address */ /* set the local APIC address */
...@@ -367,14 +371,6 @@ __initfunc(static int smp_read_mpc(struct mp_config_table *mpc)) ...@@ -367,14 +371,6 @@ __initfunc(static int smp_read_mpc(struct mp_config_table *mpc))
--mp_irq_entries; --mp_irq_entries;
} }
printk(" Itype:%d Iflag:%d srcbus:%d srcbusI:%d dstapic:%d dstI:%d.\n",
m->mpc_irqtype,
m->mpc_irqflag,
m->mpc_srcbus,
m->mpc_srcbusirq,
m->mpc_dstapic,
m->mpc_dstirq);
mpt+=sizeof(*m); mpt+=sizeof(*m);
count+=sizeof(*m); count+=sizeof(*m);
break; break;
...@@ -1372,10 +1368,13 @@ void smp_local_timer_interrupt(struct pt_regs * regs) ...@@ -1372,10 +1368,13 @@ void smp_local_timer_interrupt(struct pt_regs * regs)
p->counter = 0; p->counter = 0;
need_resched = 1; need_resched = 1;
} }
if (p->priority < DEF_PRIORITY) if (p->priority < DEF_PRIORITY) {
kstat.cpu_nice += user; kstat.cpu_nice += user;
else kstat.per_cpu_nice[cpu] += user;
} else {
kstat.cpu_user += user; kstat.cpu_user += user;
kstat.per_cpu_user[cpu] += user;
}
kstat.cpu_system += system; kstat.cpu_system += system;
kstat.per_cpu_system[cpu] += system; kstat.per_cpu_system[cpu] += system;
......
...@@ -129,7 +129,7 @@ if [ "$CONFIG_NET" = "y" ]; then ...@@ -129,7 +129,7 @@ if [ "$CONFIG_NET" = "y" ]; then
endmenu endmenu
fi fi
source drivers/net/hamradio/Config.in source net/ax25/Config.in
mainmenu_option next_comment mainmenu_option next_comment
comment 'ISDN subsystem' comment 'ISDN subsystem'
......
...@@ -65,6 +65,9 @@ if [ "$CONFIG_BLK_DEV_MD" = "y" ]; then ...@@ -65,6 +65,9 @@ if [ "$CONFIG_BLK_DEV_MD" = "y" ]; then
tristate ' RAID-1 (mirroring) mode' CONFIG_MD_MIRRORING tristate ' RAID-1 (mirroring) mode' CONFIG_MD_MIRRORING
tristate ' RAID-4/RAID-5 mode' CONFIG_MD_RAID5 tristate ' RAID-4/RAID-5 mode' CONFIG_MD_RAID5
fi fi
if [ "$CONFIG_MD_LINEAR" = "y" -o "$CONFIG_MD_STRIPED" = "y" ]; then
bool ' Boot support (linear, striped)' CONFIG_MD_BOOT
fi
tristate 'RAM disk support' CONFIG_BLK_DEV_RAM tristate 'RAM disk support' CONFIG_BLK_DEV_RAM
if [ "$CONFIG_BLK_DEV_RAM" = "y" ]; then if [ "$CONFIG_BLK_DEV_RAM" = "y" ]; then
bool ' Initial RAM disk (initrd) support' CONFIG_BLK_DEV_INITRD bool ' Initial RAM disk (initrd) support' CONFIG_BLK_DEV_INITRD
......
...@@ -1093,6 +1093,9 @@ __initfunc(void device_setup(void)) ...@@ -1093,6 +1093,9 @@ __initfunc(void device_setup(void))
extern void console_map_init(void); extern void console_map_init(void);
#ifdef CONFIG_PARPORT #ifdef CONFIG_PARPORT
extern int parport_init(void); extern int parport_init(void);
#endif
#ifdef CONFIG_MD_BOOT
extern void md_setup_drive(void) __init;
#endif #endif
struct gendisk *p; struct gendisk *p;
int nr=0; int nr=0;
...@@ -1124,4 +1127,7 @@ __initfunc(void device_setup(void)) ...@@ -1124,4 +1127,7 @@ __initfunc(void device_setup(void))
#endif #endif
rd_load(); rd_load();
#endif #endif
#ifdef CONFIG_MD_BOOT
md_setup_drive();
#endif
} }
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
A lot of inspiration came from hd.c ... A lot of inspiration came from hd.c ...
kerneld support by Boris Tobotras <boris@xtalk.msk.su> kerneld support by Boris Tobotras <boris@xtalk.msk.su>
boot support for linear and striped mode by Harald Hoyer <HarryH@Royal.Net>
RAID-1/RAID-5 extensions by: RAID-1/RAID-5 extensions by:
Ingo Molnar, Miguel de Icaza, Gadi Oxman Ingo Molnar, Miguel de Icaza, Gadi Oxman
...@@ -59,6 +60,10 @@ ...@@ -59,6 +60,10 @@
#include <asm/bitops.h> #include <asm/bitops.h>
#include <asm/atomic.h> #include <asm/atomic.h>
#ifdef CONFIG_MD_BOOT
extern dev_t name_to_dev_t(char *line) __init;
#endif
static struct hd_struct md_hd_struct[MAX_MD_DEV]; static struct hd_struct md_hd_struct[MAX_MD_DEV];
static int md_blocksizes[MAX_MD_DEV]; static int md_blocksizes[MAX_MD_DEV];
int md_maxreadahead[MAX_MD_DEV]; int md_maxreadahead[MAX_MD_DEV];
...@@ -988,10 +993,13 @@ int md_thread(void * arg) ...@@ -988,10 +993,13 @@ int md_thread(void * arg)
cli(); cli();
if (!test_bit(THREAD_WAKEUP, &thread->flags)) { if (!test_bit(THREAD_WAKEUP, &thread->flags)) {
do { do {
spin_lock_irq(&current->sigmask_lock); spin_lock(&current->sigmask_lock);
flush_signals(current); flush_signals(current);
spin_unlock_irq(&current->sigmask_lock); spin_unlock(&current->sigmask_lock);
interruptible_sleep_on(&thread->wqueue); interruptible_sleep_on(&thread->wqueue);
cli();
if (test_bit(THREAD_WAKEUP, &thread->flags))
break;
} while (signal_pending(current)); } while (signal_pending(current));
} }
} }
...@@ -1055,7 +1063,7 @@ int md_do_sync(struct md_dev *mddev) ...@@ -1055,7 +1063,7 @@ int md_do_sync(struct md_dev *mddev)
*/ */
curr_bsize = blksize_size[major][minor]; curr_bsize = blksize_size[major][minor];
if (curr_bsize != blocksize) { if (curr_bsize != blocksize) {
diff_blocksize: diff_blocksize:
if (curr_bsize > blocksize) if (curr_bsize > blocksize)
/* /*
* this is safe, rounds downwards. * this is safe, rounds downwards.
...@@ -1163,6 +1171,102 @@ void mdsyncd (void *data) ...@@ -1163,6 +1171,102 @@ void mdsyncd (void *data)
} }
#ifdef CONFIG_MD_BOOT
struct {
int set;
int ints[100];
char str[100];
} md_setup_args __initdata = {
0,{0},{0}
};
/* called from init/main.c */
__initfunc(void md_setup(char *str,int *ints))
{
int i;
for(i=0;i<=ints[0];i++) {
md_setup_args.ints[i] = ints[i];
strcpy(md_setup_args.str, str);
/* printk ("md: ints[%d]=%d.\n", i, ints[i]);*/
}
md_setup_args.set=1;
return;
}
__initfunc(void do_md_setup(char *str,int *ints))
{
int minor, pers, factor, fault;
dev_t dev;
int i=1;
if(ints[0] < 4) {
printk ("md: Too few Arguments (%d).\n", ints[0]);
return;
}
minor=ints[i++];
if (minor >= MAX_MD_DEV) {
printk ("md: Minor device number too high.\n");
return;
}
pers = 0;
switch(ints[i++]) { /* Raidlevel */
case -1:
#ifdef CONFIG_MD_LINEAR
pers = LINEAR;
printk ("md: Setting up md%d as linear device.\n",minor);
#else
printk ("md: Linear mode not configured."
"Recompile the kernel with linear mode enabled!\n");
#endif
break;
case 0:
pers = STRIPED;
#ifdef CONFIG_MD_STRIPED
printk ("md: Setting up md%d as a striped device.\n",minor);
#else
printk ("md: Striped mode not configured."
"Recompile the kernel with striped mode enabled!\n");
#endif
break;
/* not supported yet
case 1:
pers = RAID1;
printk ("md: Setting up md%d as a raid1 device.\n",minor);
break;
case 5:
pers = RAID5;
printk ("md: Setting up md%d as a raid5 device.\n",minor);
break;
*/
default:
printk ("md: Unknown or not supported raid level %d.\n", ints[--i]);
return;
}
if(pers) {
factor=ints[i++]; /* Chunksize */
fault =ints[i++]; /* Faultlevel */
pers=pers | factor | (fault << FAULT_SHIFT);
while( str && (dev = name_to_dev_t(str))) {
do_md_add (minor, dev);
if(str = strchr (str, ','))
str++;
}
do_md_run (minor, pers);
printk ("md: Loading md%d.\n",minor);
}
}
#endif
void linear_init (void); void linear_init (void);
void raid0_init (void); void raid0_init (void);
void raid1_init (void); void raid1_init (void);
...@@ -1216,6 +1320,13 @@ __initfunc(int md_init (void)) ...@@ -1216,6 +1320,13 @@ __initfunc(int md_init (void))
#ifdef CONFIG_MD_RAID5 #ifdef CONFIG_MD_RAID5
raid5_init (); raid5_init ();
#endif #endif
return (0); return (0);
} }
#ifdef CONFIG_MD_BOOT
__initfunc(void md_setup_drive(void))
{
if(md_setup_args.set)
do_md_setup(md_setup_args.str, md_setup_args.ints);
}
#endif
comment 'Misc. hamradio protocols'
tristate 'Shortwave radio modem driver' CONFIG_HFMODEM
if [ "$CONFIG_HFMODEM" != "n" ]; then
bool ' HFmodem support for Soundblaster and compatible cards' CONFIG_HFMODEM_SBC
bool ' HFmodem support for WSS and Crystal cards' CONFIG_HFMODEM_WSS
fi
...@@ -54,6 +54,8 @@ static const char *version = ...@@ -54,6 +54,8 @@ static const char *version =
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/bitops.h> #include <asm/bitops.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h>
#include <asm/delay.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include <linux/in.h> #include <linux/in.h>
...@@ -185,10 +187,12 @@ static int ei_start_xmit(struct sk_buff *skb, struct device *dev) ...@@ -185,10 +187,12 @@ static int ei_start_xmit(struct sk_buff *skb, struct device *dev)
/* Mask interrupts from the ethercard. */ /* Mask interrupts from the ethercard. */
outb_p(0x00, e8390_base + EN0_IMR); outb_p(0x00, e8390_base + EN0_IMR);
disable_irq(dev->irq);
synchronize_irq(); synchronize_irq();
if (dev->interrupt) { if (dev->interrupt) {
printk("%s: Tx request while isr active.\n",dev->name); printk("%s: Tx request while isr active.\n",dev->name);
outb_p(ENISR_ALL, e8390_base + EN0_IMR); outb_p(ENISR_ALL, e8390_base + EN0_IMR);
enable_irq(dev->irq);
ei_local->stat.tx_errors++; ei_local->stat.tx_errors++;
dev_kfree_skb(skb, FREE_WRITE); dev_kfree_skb(skb, FREE_WRITE);
return 0; return 0;
...@@ -226,6 +230,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct device *dev) ...@@ -226,6 +230,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct device *dev)
ei_local->irqlock = 0; ei_local->irqlock = 0;
dev->tbusy = 1; dev->tbusy = 1;
outb_p(ENISR_ALL, e8390_base + EN0_IMR); outb_p(ENISR_ALL, e8390_base + EN0_IMR);
enable_irq(dev->irq);
ei_local->stat.tx_errors++; ei_local->stat.tx_errors++;
return 1; return 1;
} }
...@@ -272,6 +277,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct device *dev) ...@@ -272,6 +277,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct device *dev)
/* Turn 8390 interrupts back on. */ /* Turn 8390 interrupts back on. */
ei_local->irqlock = 0; ei_local->irqlock = 0;
outb_p(ENISR_ALL, e8390_base + EN0_IMR); outb_p(ENISR_ALL, e8390_base + EN0_IMR);
enable_irq(dev->irq);
dev_kfree_skb (skb, FREE_WRITE); dev_kfree_skb (skb, FREE_WRITE);
ei_local->stat.tx_bytes += send_length; ei_local->stat.tx_bytes += send_length;
...@@ -608,7 +614,6 @@ static void ei_receive(struct device *dev) ...@@ -608,7 +614,6 @@ static void ei_receive(struct device *dev)
static void ei_rx_overrun(struct device *dev) static void ei_rx_overrun(struct device *dev)
{ {
int e8390_base = dev->base_addr; int e8390_base = dev->base_addr;
unsigned long wait_start_time;
unsigned char was_txing, must_resend = 0; unsigned char was_txing, must_resend = 0;
struct ei_device *ei_local = (struct ei_device *) dev->priv; struct ei_device *ei_local = (struct ei_device *) dev->priv;
...@@ -629,9 +634,7 @@ static void ei_rx_overrun(struct device *dev) ...@@ -629,9 +634,7 @@ static void ei_rx_overrun(struct device *dev)
* it "is not a reliable indicator and subsequently should be ignored." * it "is not a reliable indicator and subsequently should be ignored."
* We wait at least 10ms. * We wait at least 10ms.
*/ */
wait_start_time = jiffies; udelay(10*1000);
while (jiffies - wait_start_time <= 1*HZ/100)
barrier();
/* /*
* Reset RBCR[01] back to zero as per magic incantation. * Reset RBCR[01] back to zero as per magic incantation.
......
...@@ -2216,7 +2216,7 @@ pci_probe(struct device *dev, u_long ioaddr)) ...@@ -2216,7 +2216,7 @@ pci_probe(struct device *dev, u_long ioaddr))
__initfunc(static void __initfunc(static void
srom_search(int index)) srom_search(int index))
{ {
u_char pb, dev_fn; u_char pb, dev_fn, tirq;
u_short dev_id, dev_num, vendor, status; u_short dev_id, dev_num, vendor, status;
u_int tmp, irq = 0, device, class = DE4X5_CLASS_CODE; u_int tmp, irq = 0, device, class = DE4X5_CLASS_CODE;
u_long iobase = 0; /* Clear upper 32 bits in Alphas */ u_long iobase = 0; /* Clear upper 32 bits in Alphas */
...@@ -2266,8 +2266,8 @@ srom_search(int index)) ...@@ -2266,8 +2266,8 @@ srom_search(int index))
/* Fetch the IRQ to be used */ /* Fetch the IRQ to be used */
#ifndef __sparc_v9__ #ifndef __sparc_v9__
pcibios_read_config_byte(pb, PCI_DEVICE, PCI_INTERRUPT_LINE, pcibios_read_config_byte(pb, PCI_DEVICE, PCI_INTERRUPT_LINE, &tirq);
(char *)&irq); irq = tirq;
#else #else
irq = pdev->irq; irq = pdev->irq;
#endif #endif
......
# comment 'AX.25 network device drivers'
# Amateur Radio protocols and AX.25 device configuration
#
# 19971130 Now in an own category to make correct compilation of the
# AX.25 stuff easier...
# Joerg Reuter DL1BKE <jreuter@poboxes.com>
mainmenu_option next_comment dep_tristate 'Serial port KISS driver' CONFIG_MKISS $CONFIG_AX25
comment 'Amateur Radio support' # dep_tristate 'Serial port 6PACK driver' CONFIG_6PACK $CONFIG_AX25
bool 'Amateur Radio support' CONFIG_HAMRADIO dep_tristate 'BPQ Ethernet driver' CONFIG_BPQETHER $CONFIG_AX25
if [ "$CONFIG_HAMRADIO" != "n" ] ; then
if [ "$CONFIG_NET" != "n" ] ; then
comment 'Packet Radio protocols'
tristate 'Amateur Radio AX.25 Level 2 protocol' CONFIG_AX25
if [ "$CONFIG_AX25" != "n" ]; then
bool ' AX.25 DAMA Slave support' CONFIG_AX25_DAMA_SLAVE
# bool ' AX.25 DAMA Master support' CONFIG_AX25_DAMA_MASTER
dep_tristate ' Amateur Radio NET/ROM protocol' CONFIG_NETROM $CONFIG_AX25
dep_tristate ' Amateur Radio X.25 PLP (Rose)' CONFIG_ROSE $CONFIG_AX25
fi
if [ "$CONFIG_AX25" != "n" ]; then
comment 'AX.25 network device drivers'
tristate 'Serial port KISS driver' CONFIG_MKISS
# tristate 'Serial port 6PACK driver' CONFIG_6PACK
tristate 'BPQ Ethernet driver' CONFIG_BPQETHER
dep_tristate 'High-speed (DMA) SCC driver for AX.25' CONFIG_DMASCC $CONFIG_AX25
tristate 'Z8530 SCC driver' CONFIG_SCC
if [ "$CONFIG_SCC" != "n" ]; then
bool ' additional delay for PA0HZP OptoSCC compatible boards' CONFIG_SCC_DELAY
bool ' support for TRX that feedback the tx signal to rx' CONFIG_SCC_TRXECHO
fi
tristate 'BAYCOM ser12 fullduplex driver for AX.25' CONFIG_BAYCOM_SER_FDX dep_tristate 'High-speed (DMA) SCC driver for AX.25' CONFIG_DMASCC $CONFIG_AX25
tristate 'BAYCOM ser12 halfduplex driver for AX.25' CONFIG_BAYCOM_SER_HDX dep_tristate 'Z8530 SCC driver' CONFIG_SCC $CONFIG_AX25
tristate 'BAYCOM picpar and par96 driver for AX.25' CONFIG_BAYCOM_PAR if [ "$CONFIG_SCC" != "n" ]; then
bool ' additional delay for PA0HZP OptoSCC compatible boards' CONFIG_SCC_DELAY
tristate 'Soundcard modem driver' CONFIG_SOUNDMODEM bool ' support for TRX that feedback the tx signal to rx' CONFIG_SCC_TRXECHO
if [ "$CONFIG_SOUNDMODEM" != "n" ]; then
bool ' soundmodem support for Soundblaster and compatible cards' CONFIG_SOUNDMODEM_SBC
bool ' soundmodem support for WSS and Crystal cards' CONFIG_SOUNDMODEM_WSS
bool ' soundmodem support for 1200 baud AFSK modulation' CONFIG_SOUNDMODEM_AFSK1200
bool ' soundmodem support for 2400 baud AFSK modulation (7.3728MHz crystal)' CONFIG_SOUNDMODEM_AFSK2400_7
bool ' soundmodem support for 2400 baud AFSK modulation (8MHz crystal)' CONFIG_SOUNDMODEM_AFSK2400_8
bool ' soundmodem support for 4800 baud HAPN-1 modulation' CONFIG_SOUNDMODEM_HAPN4800
bool ' soundmodem support for 9600 baud FSK G3RUH modulation' CONFIG_SOUNDMODEM_FSK9600
fi
fi
fi
comment 'Misc. hamradio protocols'
tristate 'Shortwave radio modem driver' CONFIG_HFMODEM
if [ "$CONFIG_HFMODEM" != "n" ]; then
bool ' HFmodem support for Soundblaster and compatible cards' CONFIG_HFMODEM_SBC
bool ' HFmodem support for WSS and Crystal cards' CONFIG_HFMODEM_WSS
fi
fi fi
dep_tristate 'BAYCOM ser12 fullduplex driver for AX.25' CONFIG_BAYCOM_SER_FDX $CONFIG_AX25
dep_tristate 'BAYCOM ser12 halfduplex driver for AX.25' CONFIG_BAYCOM_SER_HDX $CONFIG_AX25
dep_tristate 'BAYCOM picpar and par96 driver for AX.25' CONFIG_BAYCOM_PAR $CONFIG_AX25
endmenu dep_tristate 'Soundcard modem driver' CONFIG_SOUNDMODEM $CONFIG_AX25
if [ "$CONFIG_SOUNDMODEM" != "n" ]; then
bool ' soundmodem support for Soundblaster and compatible cards' CONFIG_SOUNDMODEM_SBC
bool ' soundmodem support for WSS and Crystal cards' CONFIG_SOUNDMODEM_WSS
bool ' soundmodem support for 1200 baud AFSK modulation' CONFIG_SOUNDMODEM_AFSK1200
bool ' soundmodem support for 2400 baud AFSK modulation (7.3728MHz crystal)' CONFIG_SOUNDMODEM_AFSK2400_7
bool ' soundmodem support for 2400 baud AFSK modulation (8MHz crystal)' CONFIG_SOUNDMODEM_AFSK2400_8
bool ' soundmodem support for 4800 baud HAPN-1 modulation' CONFIG_SOUNDMODEM_HAPN4800
bool ' soundmodem support for 9600 baud FSK G3RUH modulation' CONFIG_SOUNDMODEM_FSK9600
fi
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
* call. * call.
* Fixed to match Linux networking * Fixed to match Linux networking
* changes - 2.1.15. * changes - 2.1.15.
* BPQ 004 Joerg(DL1BKE) Fixed to not lock up on ifconfig.
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -78,6 +79,7 @@ ...@@ -78,6 +79,7 @@
#include <linux/firewall.h> #include <linux/firewall.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/rtnetlink.h>
#include <net/ip.h> #include <net/ip.h>
#include <net/arp.h> #include <net/arp.h>
...@@ -186,7 +188,11 @@ static int bpq_check_devices(struct device *dev) ...@@ -186,7 +188,11 @@ static int bpq_check_devices(struct device *dev)
if (&bpq->axdev == dev) if (&bpq->axdev == dev)
result = 1; result = 1;
unregister_netdev(&bpq->axdev); /* We should be locked, call
* unregister_netdevice directly
*/
unregister_netdevice(&bpq->axdev);
kfree(bpq); kfree(bpq);
} }
...@@ -531,7 +537,9 @@ static int bpq_new_device(struct device *dev) ...@@ -531,7 +537,9 @@ static int bpq_new_device(struct device *dev)
dev->name = buf; dev->name = buf;
dev->init = bpq_dev_init; dev->init = bpq_dev_init;
if (register_netdev(dev) != 0) { /* We should be locked, call register_netdevice() directly. */
if (register_netdevice(dev) != 0) {
kfree(bpq); kfree(bpq);
return -EIO; return -EIO;
} }
......
#define RCS_ID "$Id: scc.c,v 1.71 1997/11/29 19:59:20 jreuter Exp jreuter $" #define RCS_ID "$Id: scc.c,v 1.73 1998/01/29 17:38:51 jreuter Exp jreuter $"
#define VERSION "3.0" #define VERSION "3.0"
#define BANNER "Z8530 SCC driver version "VERSION".dl1bke (experimental) by DL1BKE\n" #define BANNER "Z8530 SCC driver version "VERSION".dl1bke (experimental) by DL1BKE\n"
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
/* /*
* Please use z8530drv-utils-3.0 with this version. * Please use z8530drv-utils-3.0 with this version.
* ------------------ * ------------------
*
* You can find a subset of the documentation in
* linux/Documentation/networking/z8530drv.txt.
*/ */
/* /*
...@@ -16,7 +19,7 @@ ...@@ -16,7 +19,7 @@
******************************************************************** ********************************************************************
Copyright (c) 1993, 1997 Joerg Reuter DL1BKE Copyright (c) 1993, 1998 Joerg Reuter DL1BKE
portions (c) 1993 Guido ten Dolle PE1NNZ portions (c) 1993 Guido ten Dolle PE1NNZ
...@@ -89,7 +92,8 @@ ...@@ -89,7 +92,8 @@
970108 - Fixed the remaining problems. 970108 - Fixed the remaining problems.
970402 - Hopefully fixed the problems with the new *_timer() 970402 - Hopefully fixed the problems with the new *_timer()
routines, added calibration code. routines, added calibration code.
971012 - made SCC_DELAY a CONFIG option, added CONFIG_SCC_TRXECHO 971012 - Made SCC_DELAY a CONFIG option, added CONFIG_SCC_TRXECHO
980129 - Small fix to avoid lock-up on initialization
Thanks to all who contributed to this driver with ideas and bug Thanks to all who contributed to this driver with ideas and bug
reports! reports!
...@@ -195,7 +199,7 @@ static void scc_key_trx (struct scc_channel *scc, char tx); ...@@ -195,7 +199,7 @@ static void scc_key_trx (struct scc_channel *scc, char tx);
static void scc_isr(int irq, void *dev_id, struct pt_regs *regs); static void scc_isr(int irq, void *dev_id, struct pt_regs *regs);
static void scc_init_timer(struct scc_channel *scc); static void scc_init_timer(struct scc_channel *scc);
static int scc_net_setup(struct scc_channel *scc, unsigned char *name); static int scc_net_setup(struct scc_channel *scc, unsigned char *name, int addev);
static int scc_net_init(struct device *dev); static int scc_net_init(struct device *dev);
static int scc_net_open(struct device *dev); static int scc_net_open(struct device *dev);
static int scc_net_close(struct device *dev); static int scc_net_close(struct device *dev);
...@@ -1529,7 +1533,7 @@ static void z8530_init(void) ...@@ -1529,7 +1533,7 @@ static void z8530_init(void)
* Allocate device structure, err, instance, and register driver * Allocate device structure, err, instance, and register driver
*/ */
static int scc_net_setup(struct scc_channel *scc, unsigned char *name) static int scc_net_setup(struct scc_channel *scc, unsigned char *name, int addev)
{ {
unsigned char *buf; unsigned char *buf;
struct device *dev; struct device *dev;
...@@ -1553,11 +1557,11 @@ static int scc_net_setup(struct scc_channel *scc, unsigned char *name) ...@@ -1553,11 +1557,11 @@ static int scc_net_setup(struct scc_channel *scc, unsigned char *name)
dev->name = buf; dev->name = buf;
dev->init = scc_net_init; dev->init = scc_net_init;
if (register_netdev(dev) != 0) if ((addev? register_netdevice(dev) : register_netdev(dev)) != 0)
{ {
kfree(dev); kfree(dev);
return -EIO; return -EIO;
} }
return 0; return 0;
} }
...@@ -1868,7 +1872,7 @@ static int scc_net_ioctl(struct device *dev, struct ifreq *ifr, int cmd) ...@@ -1868,7 +1872,7 @@ static int scc_net_ioctl(struct device *dev, struct ifreq *ifr, int cmd)
request_region(SCC_Info[2*Nchips+chan].ctrl, 1, "scc ctrl"); request_region(SCC_Info[2*Nchips+chan].ctrl, 1, "scc ctrl");
request_region(SCC_Info[2*Nchips+chan].data, 1, "scc data"); request_region(SCC_Info[2*Nchips+chan].data, 1, "scc data");
if (Nchips+chan != 0) if (Nchips+chan != 0)
scc_net_setup(&SCC_Info[2*Nchips+chan], device_name); scc_net_setup(&SCC_Info[2*Nchips+chan], device_name, 1);
} }
} }
...@@ -2178,7 +2182,7 @@ __initfunc(int scc_init (void)) ...@@ -2178,7 +2182,7 @@ __initfunc(int scc_init (void))
sprintf(devname,"%s0", SCC_DriverName); sprintf(devname,"%s0", SCC_DriverName);
result = scc_net_setup(SCC_Info, devname); result = scc_net_setup(SCC_Info, devname, 0);
if (result) if (result)
{ {
printk(KERN_ERR "z8530drv: cannot initialize module\n"); printk(KERN_ERR "z8530drv: cannot initialize module\n");
...@@ -2203,7 +2207,7 @@ int init_module(void) ...@@ -2203,7 +2207,7 @@ int init_module(void)
result = scc_init(); result = scc_init();
if (result == 0) if (result == 0)
printk(KERN_INFO "Copyright 1993,1997 Joerg Reuter DL1BKE (jreuter@poboxes.com)\n"); printk(KERN_INFO "Copyright 1993,1998 Joerg Reuter DL1BKE (jreuter@poboxes.com)\n");
return result; return result;
} }
......
...@@ -84,10 +84,11 @@ if [ "$CONFIG_PCI" = "y" -a "$CONFIG_SCSI_NCR53C7xx" != "y" ]; then ...@@ -84,10 +84,11 @@ if [ "$CONFIG_PCI" = "y" -a "$CONFIG_SCSI_NCR53C7xx" != "y" ]; then
fi fi
fi fi
if [ "$CONFIG_MCA" = "y" ]; then if [ "$CONFIG_MCA" = "y" ]; then
dep_tristate 'IBMMCA SCSI support' CONFIG_SCSI_IBMMCA $CONFIG_SCSI bool 'IBMMCA SCSI support' CONFIG_SCSI_IBMMCA
if [ "$CONFIG_SCSI_IBMMCA" != "n" ]; then if [ "$CONFIG_SCSI_IBMMCA" = "y" ]; then
bool ' reset SCSI-devices while booting' CONFIG_SCSI_IBMMCA_DEV_RESET bool ' Standard SCSI-order' CONFIG_IBMMCA_SCSI_ORDER_STANDARD
fi bool ' Reset SCSI-devices at boottime' CONFIG_IBMMCA_SCSI_DEV_RESET
fi
fi fi
if [ "$CONFIG_PARPORT" != "n" ]; then if [ "$CONFIG_PARPORT" != "n" ]; then
dep_tristate 'IOMEGA Parallel Port ZIP drive SCSI support' CONFIG_SCSI_PPA $CONFIG_SCSI $CONFIG_PARPORT dep_tristate 'IOMEGA Parallel Port ZIP drive SCSI support' CONFIG_SCSI_PPA $CONFIG_SCSI $CONFIG_PARPORT
......
This diff is collapsed.
...@@ -19,22 +19,30 @@ int ibmmca_biosparam (Disk *, kdev_t, int *); ...@@ -19,22 +19,30 @@ int ibmmca_biosparam (Disk *, kdev_t, int *);
extern struct proc_dir_entry proc_scsi_ibmmca; extern struct proc_dir_entry proc_scsi_ibmmca;
/*initialization for Scsi_host_template type */ /*initialization for Scsi_host_template type */
#define IBMMCA { \ #define IBMMCA { \
proc_dir: &proc_scsi_ibmmca, /*proc_dir*/ \ NULL, /*next*/ \
proc_info: ibmmca_proc_info, /*proc info fn*/ \ NULL, /*usage_count*/ \
name: "IBMMCA", /*name*/ \ &proc_scsi_ibmmca, /*proc_dir*/ \
detect: ibmmca_detect, /*detect fn*/ \ ibmmca_proc_info, /*proc info fn*/ \
release: ibmmca_release, /*release fn*/ \ "IBMMCA", /*name*/ \
command: ibmmca_command, /*command fn*/ \ ibmmca_detect, /*detect fn*/ \
queuecommand: ibmmca_queuecommand, /*queuecommand fn*/ \ ibmmca_release, /*release fn*/ \
abort: ibmmca_abort, /*abort fn*/ \ NULL, /*info fn*/ \
reset: ibmmca_reset, /*reset fn*/ \ ibmmca_command, /*command fn*/ \
bios_param: ibmmca_biosparam, /*bios fn*/ \ ibmmca_queuecommand, /*queuecommand fn*/ \
can_queue: 16, /*can_queue*/ \ ibmmca_abort, /*abort fn*/ \
this_id: 7, /*set by detect*/ \ ibmmca_reset, /*reset fn*/ \
sg_tablesize: 16, /*sg_tablesize*/ \ NULL, /*slave_attach fn*/ \
cmd_per_lun: 1, /*cmd_per_lun*/ \ ibmmca_biosparam, /*bios fn*/ \
use_clustering: ENABLE_CLUSTERING /*use_clustering*/ \ 16, /*can_queue*/ \
7, /*set by detect*/ \
16, /*sg_tablesize*/ \
1, /*cmd_per_lun*/ \
0, /*present*/ \
0, /*unchecked_isa_dma*/ \
ENABLE_CLUSTERING /*use_clustering*/ \
} }
#endif /* _IBMMCA_H */ #endif /* _IBMMCA_H */
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* linux/fs/autofs/dirhash.c * linux/fs/autofs/dirhash.c
* *
* Copyright 1997 Transmeta Corporation -- All Rights Reserved * Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
* *
* This file is part of the Linux kernel and is made available under * This file is part of the Linux kernel and is made available under
* the terms of the GNU General Public License, version 2, or at your * the terms of the GNU General Public License, version 2, or at your
...@@ -84,11 +84,15 @@ void autofs_hash_insert(struct autofs_dirhash *dh, struct autofs_dir_ent *ent) ...@@ -84,11 +84,15 @@ void autofs_hash_insert(struct autofs_dirhash *dh, struct autofs_dir_ent *ent)
ent->next = *dhnp; ent->next = *dhnp;
ent->back = dhnp; ent->back = dhnp;
*dhnp = ent; *dhnp = ent;
if ( ent->next )
ent->next->back = &(ent->next);
} }
void autofs_hash_delete(struct autofs_dir_ent *ent) void autofs_hash_delete(struct autofs_dir_ent *ent)
{ {
*(ent->back) = ent->next; *(ent->back) = ent->next;
if ( ent->next )
ent->next->back = ent->back;
autofs_delete_usage(ent); autofs_delete_usage(ent);
......
...@@ -757,6 +757,30 @@ char * d_path(struct dentry *dentry, char *buffer, int buflen) ...@@ -757,6 +757,30 @@ char * d_path(struct dentry *dentry, char *buffer, int buflen)
return retval; return retval;
} }
/*
* Test whether new_dentry is a subdirectory of old_dentry.
*
* Trivially implemented using the dcache structure
*/
int is_subdir(struct dentry * new_dentry, struct dentry * old_dentry)
{
int result;
result = 0;
for (;;) {
if (new_dentry != old_dentry) {
struct dentry * parent = new_dentry->d_parent;
if (parent == new_dentry)
break;
new_dentry = parent;
continue;
}
result = 1;
break;
}
return result;
}
/* /*
* Check whether a dentry already exists for the given name, * Check whether a dentry already exists for the given name,
* and return the inode number if it has an inode. * and return the inode number if it has an inode.
......
...@@ -621,13 +621,6 @@ static struct proc_dir_entry proc_root_slab = { ...@@ -621,13 +621,6 @@ static struct proc_dir_entry proc_root_slab = {
S_IFREG | S_IRUGO, 1, 0, 0, S_IFREG | S_IRUGO, 1, 0, 0,
0, &proc_array_inode_operations 0, &proc_array_inode_operations
}; };
#ifdef CONFIG_OMIRR
static struct proc_dir_entry proc_root_omirr = {
PROC_OMIRR, 5, "omirr",
S_IFREG | S_IRUSR, 1, 0, 0,
0, &proc_omirr_inode_operations
};
#endif
#ifdef __powerpc__ #ifdef __powerpc__
static struct proc_dir_entry proc_root_ppc_htab = { static struct proc_dir_entry proc_root_ppc_htab = {
PROC_PPC_HTAB, 8, "ppc_htab", PROC_PPC_HTAB, 8, "ppc_htab",
......
...@@ -7,3 +7,10 @@ Fri Jan 23 1998 Krzysztof G. Baranowski <kgb@manjak.knm.org.pl> ...@@ -7,3 +7,10 @@ Fri Jan 23 1998 Krzysztof G. Baranowski <kgb@manjak.knm.org.pl>
in detected_[xenix,sysv4,sysv2,coherent]. Thanks in detected_[xenix,sysv4,sysv2,coherent]. Thanks
to Andrzej Krzysztofowicz <ankry@mif.pg.gda.pl> to Andrzej Krzysztofowicz <ankry@mif.pg.gda.pl>
for identifying the problem. for identifying the problem.
Tue Jan 27 1998 Krzysztof G. Baranowski <kgb@manjak.knm.org.pl>
* inode.c: added 2048-byte block support to SystemV FS.
Merged detected_bs[512,1024,2048] into one function:
void detected_bs (u_char type, struct super_block *sb).
Thanks to Andrzej Krzysztofowicz <ankry@mif.pg.gda.pl>
for the patch.
...@@ -18,7 +18,7 @@ These filesystems are rather similar. Here is a comparison with Minix FS: ...@@ -18,7 +18,7 @@ These filesystems are rather similar. Here is a comparison with Minix FS:
* Size of a block or zone (data allocation unit on disk) * Size of a block or zone (data allocation unit on disk)
- Minix FS 1024 - Minix FS 1024
- Xenix FS 1024 (also 512 ??) - Xenix FS 1024 (also 512 ??)
- SystemV FS 1024 (also 512) - SystemV FS 1024 (also 512 and 2048)
- Coherent FS 512 - Coherent FS 512
* General layout: all have one boot block, one super block and * General layout: all have one boot block, one super block and
...@@ -180,4 +180,3 @@ and not the disk driver's notion of "block". ...@@ -180,4 +180,3 @@ and not the disk driver's notion of "block".
Bruno Haible <haible@ma2s2.mathematik.uni-karlsruhe.de> Bruno Haible <haible@ma2s2.mathematik.uni-karlsruhe.de>
This diff is collapsed.
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
* *
* sysv/namei.c * sysv/namei.c
* Copyright (C) 1993 Bruno Haible * Copyright (C) 1993 Bruno Haible
*
*/ */
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include <linux/tasks.h> #include <linux/tasks.h>
extern unsigned int local_irq_count[NR_CPUS]; extern unsigned int local_irq_count[NR_CPUS];
#define in_interrupt() (local_irq_count[smp_processor_id()] != 0)
#ifndef __SMP__ #ifndef __SMP__
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* is entirely private to an implementation, it should not be * is entirely private to an implementation, it should not be
* referenced at all outside of this file. * referenced at all outside of this file.
*/ */
extern atomic_t __alpha_bh_counter; extern unsigned int local_bh_count[NR_CPUS];
#define get_active_bhs() (bh_mask & bh_active) #define get_active_bhs() (bh_mask & bh_active)
...@@ -42,52 +42,50 @@ extern inline void mark_bh(int nr) ...@@ -42,52 +42,50 @@ extern inline void mark_bh(int nr)
set_bit(nr, &bh_active); set_bit(nr, &bh_active);
} }
/*
* These use a mask count to correctly handle
* nested disable/enable calls
*/
extern inline void disable_bh(int nr)
{
bh_mask &= ~(1 << nr);
bh_mask_count[nr]++;
}
extern inline void enable_bh(int nr)
{
if (!--bh_mask_count[nr])
bh_mask |= 1 << nr;
}
/* /*
* start_bh_atomic/end_bh_atomic also nest * start_bh_atomic/end_bh_atomic also nest
* naturally by using a counter * naturally by using a counter
*/ */
extern inline void start_bh_atomic(void) extern inline void start_bh_atomic(void)
{ {
#ifdef __SMP__ local_bh_count[smp_processor_id()]++;
atomic_inc(&__alpha_bh_counter); barrier();
synchronize_irq();
#else
atomic_inc(&__alpha_bh_counter);
#endif
} }
extern inline void end_bh_atomic(void) extern inline void end_bh_atomic(void)
{ {
atomic_dec(&__alpha_bh_counter); barrier();
local_bh_count[smp_processor_id()]--;
} }
#ifndef __SMP__ #ifndef __SMP__
/* These are for the irq's testing the lock */ /* These are for the irq's testing the lock */
#define softirq_trylock(cpu) (atomic_read(&__alpha_bh_counter) ? \ #define softirq_trylock(cpu) \
0 : \ (local_bh_count[cpu] ? 0 : (local_bh_count[cpu] = 1))
((atomic_set(&__alpha_bh_counter,1)),1)) #define softirq_endlock(cpu) \
#define softirq_endlock(cpu) (atomic_set(&__alpha_bh_counter, 0)) (local_bh_count[cpu] = 0)
#else #else
#error FIXME #error FIXME
#endif /* __SMP__ */ #endif /* __SMP__ */
/*
* These use a mask count to correctly handle
* nested disable/enable calls
*/
extern inline void disable_bh(int nr)
{
bh_mask &= ~(1 << nr);
bh_mask_count[nr]++;
}
extern inline void enable_bh(int nr)
{
if (!--bh_mask_count[nr])
bh_mask |= 1 << nr;
}
#endif /* _ALPHA_SOFTIRQ_H */ #endif /* _ALPHA_SOFTIRQ_H */
...@@ -728,6 +728,9 @@ extern void put_write_access(struct inode *inode); ...@@ -728,6 +728,9 @@ extern void put_write_access(struct inode *inode);
extern struct dentry * open_namei(const char * pathname, int flag, int mode); extern struct dentry * open_namei(const char * pathname, int flag, int mode);
extern struct dentry * do_mknod(const char * filename, int mode, dev_t dev); extern struct dentry * do_mknod(const char * filename, int mode, dev_t dev);
extern int do_pipe(int *); extern int do_pipe(int *);
/* fs/dcache.c -- generic fs support functions */
extern int is_subdir(struct dentry *, struct dentry *);
extern ino_t find_inode_number(struct dentry *, struct qstr *); extern ino_t find_inode_number(struct dentry *, struct qstr *);
/* /*
......
...@@ -48,7 +48,6 @@ enum root_directory_inos { ...@@ -48,7 +48,6 @@ enum root_directory_inos {
PROC_HARDWARE, PROC_HARDWARE,
PROC_SLABINFO, PROC_SLABINFO,
PROC_PARPORT, PROC_PARPORT,
PROC_OMIRR, /* whether enabled or not */
PROC_PPC_HTAB, PROC_PPC_HTAB,
PROC_SOUND PROC_SOUND
}; };
......
...@@ -15,8 +15,8 @@ struct sysv_sb_info { ...@@ -15,8 +15,8 @@ struct sysv_sb_info {
unsigned int s_block_size; /* zone size, = 512 or = 1024 */ unsigned int s_block_size; /* zone size, = 512 or = 1024 */
unsigned int s_block_size_1; /* block_size - 1 */ unsigned int s_block_size_1; /* block_size - 1 */
unsigned int s_block_size_bits; /* log2(block_size) */ unsigned int s_block_size_bits; /* log2(block_size) */
unsigned int s_block_size_ratio; /* BLOCK_SIZE / block_size */ unsigned int s_block_size_inc_bits; /* log2(block_size/BLOCK_SIZE) if >0 */
unsigned int s_block_size_ratio_bits; /* log2(block_size_ratio) */ unsigned int s_block_size_dec_bits; /* log2(BLOCK_SIZE/block_size) if >0 */
char s_convert; /* flag whether byte ordering requires conversion */ char s_convert; /* flag whether byte ordering requires conversion */
char s_kludge_symlinks; /* flag whether symlinks have a kludgey mode */ char s_kludge_symlinks; /* flag whether symlinks have a kludgey mode */
char s_truncate; /* if 1: names > SYSV_NAMELEN chars are truncated */ char s_truncate; /* if 1: names > SYSV_NAMELEN chars are truncated */
...@@ -66,15 +66,15 @@ struct sysv_sb_info { ...@@ -66,15 +66,15 @@ struct sysv_sb_info {
unsigned long s_ndatazones; /* total number of data zones */ unsigned long s_ndatazones; /* total number of data zones */
unsigned long s_nzones; /* same as s_sbd->s_fsize */ unsigned long s_nzones; /* same as s_sbd->s_fsize */
}; };
/* The fields s_block_size_ratio, s_ind_per_block_2_1, s_toobig_block are currently unused. */ /* The fields s_ind_per_block_2_1, s_toobig_block are currently unused. */
/* sv_ == u.sysv_sb.s_ */ /* sv_ == u.sysv_sb.s_ */
#define sv_type u.sysv_sb.s_type #define sv_type u.sysv_sb.s_type
#define sv_block_size u.sysv_sb.s_block_size #define sv_block_size u.sysv_sb.s_block_size
#define sv_block_size_1 u.sysv_sb.s_block_size_1 #define sv_block_size_1 u.sysv_sb.s_block_size_1
#define sv_block_size_bits u.sysv_sb.s_block_size_bits #define sv_block_size_bits u.sysv_sb.s_block_size_bits
#define sv_block_size_ratio u.sysv_sb.s_block_size_ratio #define sv_block_size_inc_bits u.sysv_sb.s_block_size_inc_bits
#define sv_block_size_ratio_bits u.sysv_sb.s_block_size_ratio_bits #define sv_block_size_dec_bits u.sysv_sb.s_block_size_dec_bits
#define sv_convert u.sysv_sb.s_convert #define sv_convert u.sysv_sb.s_convert
#define sv_kludge_symlinks u.sysv_sb.s_kludge_symlinks #define sv_kludge_symlinks u.sysv_sb.s_kludge_symlinks
#define sv_truncate u.sysv_sb.s_truncate #define sv_truncate u.sysv_sb.s_truncate
......
...@@ -2,58 +2,26 @@ ...@@ -2,58 +2,26 @@
#define _LINUX_TIMER_H #define _LINUX_TIMER_H
/* /*
* DON'T CHANGE THESE!! Most of them are hardcoded into some assembly language * Old-style timers. Please don't use for any new code.
* as well as being defined here.
*/
/*
* The timers are:
*
* BLANK_TIMER console screen-saver timer
*
* BEEP_TIMER console beep timer
*
* RS_TIMER timer for the RS-232 ports
*
* SWAP_TIMER timer for the background pageout daemon
*
* HD_TIMER harddisk timer
*
* HD_TIMER2 (atdisk2 patches)
*
* FLOPPY_TIMER floppy disk timer (not used right now)
*
* NET_TIMER tcp/ip timeout timer
*
* COPRO_TIMER 387 timeout for buggy hardware..
*
* QIC02_TAPE_TIMER timer for QIC-02 tape driver (it's not hardcoded)
*
* MCD_TIMER Mitsumi CD-ROM Timer
*
* GSCD_TIMER Goldstar CD-ROM Timer
* *
* Numbering of these timers should be consecutive to minimize
* processing delays. [MJ]
*/ */
#define BLANK_TIMER 0 #define BLANK_TIMER 0 /* Console screen-saver */
#define BEEP_TIMER 1 #define BEEP_TIMER 1 /* Console beep */
#define RS_TIMER 2 #define RS_TIMER 2 /* RS-232 ports */
#define SWAP_TIMER 3 #define SWAP_TIMER 3 /* Background pageout */
#define BACKGR_TIMER 4 /* io_request background I/O */
#define HD_TIMER 16 #define HD_TIMER 5 /* Old IDE driver */
#define FLOPPY_TIMER 17 #define FLOPPY_TIMER 6 /* Floppy */
#define NET_TIMER 19 #define QIC02_TAPE_TIMER 7 /* QIC 02 tape */
#define SOUND_TIMER 20 #define MCD_TIMER 8 /* Mitsumi CDROM */
#define COPRO_TIMER 21 #define GSCD_TIMER 9 /* Goldstar CDROM */
#define COMTROL_TIMER 10 /* Comtrol serial */
#define QIC02_TAPE_TIMER 22 /* hhb */ #define DIGI_TIMER 11 /* Digi serial */
#define MCD_TIMER 23
#define HD_TIMER2 24
#define GSCD_TIMER 25
#define COMTROL_TIMER 26
#define DIGI_TIMER 29 #define COPRO_TIMER 31 /* 387 timeout for buggy hardware (boot only) */
struct timer_struct { struct timer_struct {
unsigned long expires; unsigned long expires;
......
...@@ -282,6 +282,10 @@ extern void ftape_setup(char *str, int *ints); ...@@ -282,6 +282,10 @@ extern void ftape_setup(char *str, int *ints);
extern void ipc_init(void); extern void ipc_init(void);
#endif #endif
#ifdef CONFIG_MD_BOOT
extern void md_setup(char *str,int *ints) __init;
#endif
#ifdef __sparc__ #ifdef __sparc__
extern int serial_console; extern int serial_console;
#endif #endif
...@@ -378,6 +382,9 @@ static struct dev_name_struct { ...@@ -378,6 +382,9 @@ static struct dev_name_struct {
#ifdef CONFIG_BLK_DEV_FD #ifdef CONFIG_BLK_DEV_FD
{ "fd", 0x0200 }, { "fd", 0x0200 },
#endif #endif
#ifdef CONFIG_MD_BOOT
{ "md", 0x0900 },
#endif
#ifdef CONFIG_BLK_DEV_XD #ifdef CONFIG_BLK_DEV_XD
{ "xda", 0x0d00 }, { "xda", 0x0d00 },
{ "xdb", 0x0d40 }, { "xdb", 0x0d40 },
...@@ -419,7 +426,7 @@ static struct dev_name_struct { ...@@ -419,7 +426,7 @@ static struct dev_name_struct {
{ NULL, 0 } { NULL, 0 }
}; };
__initfunc(static void root_dev_setup(char *line, int *num)) __initfunc(dev_t name_to_dev_t(char *line))
{ {
int base = 0; int base = 0;
if (strncmp(line,"/dev/",5) == 0) { if (strncmp(line,"/dev/",5) == 0) {
...@@ -435,7 +442,12 @@ __initfunc(static void root_dev_setup(char *line, int *num)) ...@@ -435,7 +442,12 @@ __initfunc(static void root_dev_setup(char *line, int *num))
dev++; dev++;
} while (dev->name); } while (dev->name);
} }
ROOT_DEV = to_kdev_t(base + simple_strtoul(line,NULL,base?10:16)); return to_kdev_t(base + simple_strtoul(line,NULL,base?10:16));
}
__initfunc(static void root_dev_setup(char *line, int *num))
{
ROOT_DEV = name_to_dev_t(line);
} }
/* /*
...@@ -713,6 +725,9 @@ static struct kernel_param cooked_params[] __initdata = { ...@@ -713,6 +725,9 @@ static struct kernel_param cooked_params[] __initdata = {
#endif #endif
#ifdef CONFIG_FTAPE #ifdef CONFIG_FTAPE
{ "ftape=", ftape_setup}, { "ftape=", ftape_setup},
#endif
#ifdef CONFIG_MD_BOOT
{ "md=", md_setup},
#endif #endif
{ 0, 0 } { 0, 0 }
}; };
......
...@@ -143,6 +143,7 @@ EXPORT_SYMBOL(update_vm_cache); ...@@ -143,6 +143,7 @@ EXPORT_SYMBOL(update_vm_cache);
EXPORT_SYMBOL(vmtruncate); EXPORT_SYMBOL(vmtruncate);
/* filesystem internal functions */ /* filesystem internal functions */
EXPORT_SYMBOL(update_atime);
EXPORT_SYMBOL(get_super); EXPORT_SYMBOL(get_super);
EXPORT_SYMBOL(getname); EXPORT_SYMBOL(getname);
EXPORT_SYMBOL(putname); EXPORT_SYMBOL(putname);
...@@ -203,6 +204,7 @@ EXPORT_SYMBOL(prune_dcache); ...@@ -203,6 +204,7 @@ EXPORT_SYMBOL(prune_dcache);
EXPORT_SYMBOL(shrink_dcache_sb); EXPORT_SYMBOL(shrink_dcache_sb);
EXPORT_SYMBOL(shrink_dcache_parent); EXPORT_SYMBOL(shrink_dcache_parent);
EXPORT_SYMBOL(find_inode_number); EXPORT_SYMBOL(find_inode_number);
EXPORT_SYMBOL(is_subdir);
#if !defined(CONFIG_NFSD) && defined(CONFIG_NFSD_MODULE) #if !defined(CONFIG_NFSD) && defined(CONFIG_NFSD_MODULE)
EXPORT_SYMBOL(do_nfsservctl); EXPORT_SYMBOL(do_nfsservctl);
......
#
# Amateur Radio protocols and AX.25 device configuration
#
# 19971130 Now in an own category to make correct compilation of the
# AX.25 stuff easier...
# Joerg Reuter DL1BKE <jreuter@poboxes.com>
# 19980129 Moved to net/ax25/Config.in, sourcing device drivers.
mainmenu_option next_comment
comment 'Amateur Radio support'
bool 'Amateur Radio support' CONFIG_HAMRADIO
if [ "$CONFIG_HAMRADIO" != "n" ] ; then
if [ "$CONFIG_NET" != "n" ] ; then
comment 'Packet Radio protocols'
tristate 'Amateur Radio AX.25 Level 2 protocol' CONFIG_AX25
if [ "$CONFIG_AX25" != "n" ]; then
bool ' AX.25 DAMA Slave support' CONFIG_AX25_DAMA_SLAVE
# bool ' AX.25 DAMA Master support' CONFIG_AX25_DAMA_MASTER
dep_tristate ' Amateur Radio NET/ROM protocol' CONFIG_NETROM $CONFIG_AX25
dep_tristate ' Amateur Radio X.25 PLP (Rose)' CONFIG_ROSE $CONFIG_AX25
fi
if [ "$CONFIG_AX25" != "n" ]; then
source drivers/net/hamradio/Config.in
fi
fi
source drivers/char/hfmodem/Config.in
fi
endmenu
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
* Thomas Bogendoerfer : Return ENODEV for dev_open, if there * Thomas Bogendoerfer : Return ENODEV for dev_open, if there
* is no device open function. * is no device open function.
* Andi Kleen : Fix error reporting for SIOCGIFCONF * Andi Kleen : Fix error reporting for SIOCGIFCONF
* Rgis Duchesne : Fix the argument check in dev_ioctl()
* *
*/ */
...@@ -1534,7 +1535,6 @@ static int dev_ifsioc(struct ifreq *ifr, unsigned int cmd) ...@@ -1534,7 +1535,6 @@ static int dev_ifsioc(struct ifreq *ifr, unsigned int cmd)
return -EINVAL; return -EINVAL;
} }
/* /*
* This function handles all "interface"-type I/O control requests. The actual * This function handles all "interface"-type I/O control requests. The actual
* 'doing' part of this is dev_ifsioc above. * 'doing' part of this is dev_ifsioc above.
...@@ -1566,25 +1566,19 @@ int dev_ioctl(unsigned int cmd, void *arg) ...@@ -1566,25 +1566,19 @@ int dev_ioctl(unsigned int cmd, void *arg)
return dev_ifname((struct ifreq *)arg); return dev_ifname((struct ifreq *)arg);
} }
/*
* Fetch the interface name from the info block.
*/
if (copy_from_user(&ifr, arg, sizeof(struct ifreq))) if (copy_from_user(&ifr, arg, sizeof(struct ifreq)))
return -EFAULT; return -EFAULT;
ifr.ifr_name[IFNAMSIZ-1] = 0; ifr.ifr_name[IFNAMSIZ-1] = 0;
#ifdef CONFIG_NET_ALIAS #ifdef CONFIG_NET_ALIAS
colon = strchr(ifr.ifr_name, ':'); colon = strchr(ifr.ifr_name, ':');
if (colon) if (colon)
*colon = 0; *colon = 0;
#endif #endif
/*
* See which interface the caller is talking about.
*/
#ifdef CONFIG_KERNELD
dev_load(ifr.ifr_name);
#endif
switch(cmd) switch(cmd)
{ {
/* /*
...@@ -1602,6 +1596,9 @@ int dev_ioctl(unsigned int cmd, void *arg) ...@@ -1602,6 +1596,9 @@ int dev_ioctl(unsigned int cmd, void *arg)
case SIOCGIFMAP: case SIOCGIFMAP:
case SIOCGIFINDEX: case SIOCGIFINDEX:
case SIOCGIFTXQLEN: case SIOCGIFTXQLEN:
#ifdef CONFIG_KERNELD
dev_load(ifr.ifr_name);
#endif
ret = dev_ifsioc(&ifr, cmd); ret = dev_ifsioc(&ifr, cmd);
if (!ret) { if (!ret) {
#ifdef CONFIG_NET_ALIAS #ifdef CONFIG_NET_ALIAS
...@@ -1632,6 +1629,9 @@ int dev_ioctl(unsigned int cmd, void *arg) ...@@ -1632,6 +1629,9 @@ int dev_ioctl(unsigned int cmd, void *arg)
case SIOCSIFTXQLEN: case SIOCSIFTXQLEN:
if (!suser()) if (!suser())
return -EPERM; return -EPERM;
#ifdef CONFIG_KERNELD
dev_load(ifr.ifr_name);
#endif
rtnl_lock(); rtnl_lock();
ret = dev_ifsioc(&ifr, cmd); ret = dev_ifsioc(&ifr, cmd);
rtnl_unlock(); rtnl_unlock();
...@@ -1652,6 +1652,9 @@ int dev_ioctl(unsigned int cmd, void *arg) ...@@ -1652,6 +1652,9 @@ int dev_ioctl(unsigned int cmd, void *arg)
default: default:
if (cmd >= SIOCDEVPRIVATE && if (cmd >= SIOCDEVPRIVATE &&
cmd <= SIOCDEVPRIVATE + 15) { cmd <= SIOCDEVPRIVATE + 15) {
#ifdef CONFIG_KERNELD
dev_load(ifr.ifr_name);
#endif
rtnl_lock(); rtnl_lock();
ret = dev_ifsioc(&ifr, cmd); ret = dev_ifsioc(&ifr, cmd);
rtnl_unlock(); rtnl_unlock();
...@@ -1664,8 +1667,15 @@ int dev_ioctl(unsigned int cmd, void *arg) ...@@ -1664,8 +1667,15 @@ int dev_ioctl(unsigned int cmd, void *arg)
if (IW_IS_SET(cmd)) { if (IW_IS_SET(cmd)) {
if (!suser()) if (!suser())
return -EPERM; return -EPERM;
#ifdef CONFIG_KERNELD
dev_load(ifr.ifr_name);
#endif
rtnl_lock(); rtnl_lock();
} }
#ifdef CONFIG_KERNELD
else
dev_load(ifr.ifr_name);
#endif
ret = dev_ifsioc(&ifr, cmd); ret = dev_ifsioc(&ifr, cmd);
if (IW_IS_SET(cmd)) if (IW_IS_SET(cmd))
rtnl_unlock(); rtnl_unlock();
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/major.h> #include <linux/major.h>
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/socket.h> #include <linux/socket.h>
#include <linux/file.h>
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include <linux/net.h> #include <linux/net.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -44,6 +45,7 @@ ...@@ -44,6 +45,7 @@
static __inline__ int scm_check_creds(struct ucred *creds) static __inline__ int scm_check_creds(struct ucred *creds)
{ {
/* N.B. The test for suser should follow the credential check */
if (suser()) if (suser())
return 0; return 0;
if (creds->pid != current->pid || if (creds->pid != current->pid ||
...@@ -58,11 +60,10 @@ static __inline__ int scm_check_creds(struct ucred *creds) ...@@ -58,11 +60,10 @@ static __inline__ int scm_check_creds(struct ucred *creds)
static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp) static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)
{ {
int num; int *fdp = (int*)CMSG_DATA(cmsg);
struct scm_fp_list *fpl = *fplp; struct scm_fp_list *fpl = *fplp;
struct file **fpp; struct file **fpp;
int *fdp = (int*)CMSG_DATA(cmsg); int i, num;
int i;
num = (cmsg->cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr)))/sizeof(int); num = (cmsg->cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr)))/sizeof(int);
...@@ -86,41 +87,33 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp) ...@@ -86,41 +87,33 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)
return -EINVAL; return -EINVAL;
/* /*
* Verify the descriptors. * Verify the descriptors and increment the usage count.
*/ */
for (i=0; i< num; i++) for (i=0; i< num; i++)
{ {
int fd; int fd = fdp[i];
struct file *file;
fd = fdp[i];
if (fd < 0 || fd >= NR_OPEN) if (fd < 0 || !(file = fget(fd)))
return -EBADF;
if (current->files->fd[fd]==NULL)
return -EBADF; return -EBADF;
fpp[i] = current->files->fd[fd]; *fpp++ = file;
fpl->count++;
} }
/* add another reference to these files */
for (i=0; i< num; i++, fpp++)
(*fpp)->f_count++;
fpl->count += num;
return num; return num;
} }
void __scm_destroy(struct scm_cookie *scm) void __scm_destroy(struct scm_cookie *scm)
{ {
int i;
struct scm_fp_list *fpl = scm->fp; struct scm_fp_list *fpl = scm->fp;
int i;
if (!fpl) if (fpl) {
return; scm->fp = NULL;
for (i=fpl->count-1; i>=0; i--)
for (i=fpl->count-1; i>=0; i--) close_fp(fpl->fp[i]);
close_fp(fpl->fp[i]); kfree(fpl);
}
kfree(fpl);
} }
...@@ -223,14 +216,17 @@ int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data) ...@@ -223,14 +216,17 @@ int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data)
cmhdr.cmsg_level = level; cmhdr.cmsg_level = level;
cmhdr.cmsg_type = type; cmhdr.cmsg_type = type;
cmhdr.cmsg_len = cmlen; cmhdr.cmsg_len = cmlen;
err = copy_to_user(cm, &cmhdr, sizeof cmhdr);
if (!err) err = -EFAULT;
err = copy_to_user(CMSG_DATA(cm), data, cmlen - sizeof(struct cmsghdr)); if (copy_to_user(cm, &cmhdr, sizeof cmhdr))
if (!err) { goto out;
cmlen = CMSG_SPACE(len); if (copy_to_user(CMSG_DATA(cm), data, cmlen - sizeof(struct cmsghdr)))
msg->msg_control += cmlen; goto out;
msg->msg_controllen -= cmlen; cmlen = CMSG_SPACE(len);
} msg->msg_control += cmlen;
msg->msg_controllen -= cmlen;
err = 0;
out:
return err; return err;
} }
...@@ -240,21 +236,28 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm) ...@@ -240,21 +236,28 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
int fdmax = (msg->msg_controllen - sizeof(struct cmsghdr))/sizeof(int); int fdmax = (msg->msg_controllen - sizeof(struct cmsghdr))/sizeof(int);
int fdnum = scm->fp->count; int fdnum = scm->fp->count;
int *cmfptr;
int err = 0;
int i;
struct file **fp = scm->fp->fp; struct file **fp = scm->fp->fp;
int *cmfptr;
int err = 0, i;
if (fdnum < fdmax) if (fdnum < fdmax)
fdmax = fdnum; fdmax = fdnum;
for (i=0, cmfptr=(int*)CMSG_DATA(cm); i<fdmax; i++, cmfptr++) for (i=0, cmfptr=(int*)CMSG_DATA(cm); i<fdmax; i++, cmfptr++)
{ {
int new_fd = get_unused_fd(); int new_fd;
if (new_fd < 0) err = get_unused_fd();
if (err < 0)
break; break;
current->files->fd[new_fd] = fp[i]; new_fd = err;
err = put_user(new_fd, cmfptr); err = put_user(new_fd, cmfptr);
if (err) {
put_unused_fd(new_fd);
break;
}
/* Bump the usage count and install the file. */
fp[i]->f_count++;
current->files->fd[new_fd] = fp[i];
} }
if (i > 0) if (i > 0)
...@@ -272,38 +275,30 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm) ...@@ -272,38 +275,30 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
msg->msg_controllen -= cmlen; msg->msg_controllen -= cmlen;
} }
} }
if (i < fdnum)
if (err) msg->msg_flags |= MSG_CTRUNC;
i = 0;
/* /*
* Dump those that don't fit. * All of the files that fit in the message have had their
* usage counts incremented, so we just free the list.
*/ */
for ( ; i < fdnum; i++) { __scm_destroy(scm);
msg->msg_flags |= MSG_CTRUNC;
close_fp(fp[i]);
}
kfree (scm->fp);
scm->fp = NULL;
} }
struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl) struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl)
{ {
int i;
struct scm_fp_list *new_fpl; struct scm_fp_list *new_fpl;
int i;
if (!fpl) if (!fpl)
return NULL; return NULL;
new_fpl = kmalloc(fpl->count*sizeof(int) + sizeof(*fpl), GFP_KERNEL); new_fpl = kmalloc(sizeof(*fpl), GFP_KERNEL);
if (!new_fpl) if (new_fpl) {
return NULL; memcpy(new_fpl, fpl, sizeof(*fpl));
memcpy(new_fpl, fpl, fpl->count*sizeof(int) + sizeof(*fpl));
for (i=fpl->count-1; i>=0; i--)
fpl->fp[i]->f_count++;
for (i=fpl->count-1; i>=0; i--)
fpl->fp[i]->f_count++;
}
return new_fpl; return new_fpl;
} }
...@@ -767,7 +767,7 @@ __initfunc(static int ic_bootp_string(char *dest, char *src, int len, int max)) ...@@ -767,7 +767,7 @@ __initfunc(static int ic_bootp_string(char *dest, char *src, int len, int max))
/* /*
* Process BOOTP extension. * Process BOOTP extension.
*/ */
__initfunc(static void ic_do_bootp_ext(struct bootp_pkt *b, u8 *ext)) __initfunc(static void ic_do_bootp_ext(u8 *ext))
{ {
#ifdef IPCONFIG_DEBUG #ifdef IPCONFIG_DEBUG
u8 *c; u8 *c;
...@@ -864,7 +864,7 @@ __initfunc(static void ic_bootp_recv(void)) ...@@ -864,7 +864,7 @@ __initfunc(static void ic_bootp_recv(void))
opt = ext; opt = ext;
ext += ext[1] + 2; ext += ext[1] + 2;
if (ext <= end) if (ext <= end)
ic_do_bootp_ext(b, opt); ic_do_bootp_ext(opt);
} }
} }
} }
......
#! /usr/bin/perl #! /usr/bin/perl
# #
# checkconfig: find uses of CONFIG_* names without matching definitions. # checkconfig: find uses of CONFIG_* names without matching definitions.
# Copyright abandoned, 1998, Michael Elizabeth Chastain <mailto:mec@shout.net>.
use integer; use integer;
$| = 1;
foreach $file (@ARGV) foreach $file (@ARGV)
{ {
# Open this file. # Open this file.
...@@ -24,15 +27,15 @@ foreach $file (@ARGV) ...@@ -24,15 +27,15 @@ foreach $file (@ARGV)
# Pick up definitions. # Pick up definitions.
if ( m/^#/o ) if ( m/^#/o )
{ {
$iLinuxConfig = $. if m/^#\s*include\s+<linux\/config\.h>/o; $iLinuxConfig = $. if m/^#\s*include\s*<linux\/config\.h>/o;
$configList{uc $1} = 1 if m/^#\s*include\s+<config\/(\S*)\.h>/o; $configList{uc $1} = 1 if m/^#\s*include\s*<config\/(\S*)\.h>/o;
$configList{$1} = 1 if m/^#\s*define\s+CONFIG_(\w*)/o; $configList{$1} = 1 if m/^#\s*define\s+CONFIG_(\w*)/o;
$configList{$1} = 1 if m/^#\s*undef\s+CONFIG_(\w*)/o; $configList{$1} = 1 if m/^#\s*undef\s+CONFIG_(\w*)/o;
} }
# Look for usages. # Look for usages.
next unless m/CONFIG_/o; next unless m/CONFIG_/o;
WORD: while ( m/\bCONFIG_(\w*)/og ) WORD: while ( m/\bCONFIG_(\w+)/og )
{ {
$fUseConfig = 1; $fUseConfig = 1;
last LINE if $iLinuxConfig; last LINE if $iLinuxConfig;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment