Commit 0294f4bd authored by Linus Torvalds's avatar Linus Torvalds

Import 1.3.100

parent db3c909e
......@@ -425,6 +425,13 @@ S: 6/1 M.Koneva bl, apt #125
S: Poltava 314023
S: Ukraine
N: John E. Gotts
E: jgotts@engin.umich.edu
D: kernel hacker
S: 8124 Constitution Apt. 7
S: Sterling Heights, MI 48313
S: USA
N: Grant Guenther
E: grant@torque.net
D: Iomega PPA / ZIP driver
......@@ -984,6 +991,14 @@ S: Tallak 95
S: 8103 Rein
S: Austria
N: Stefan Reinauer
E: stepan@home.culture.mipt.ru
W: http://home.culture.mipt.ru/~stepan
D: Modulized affs and ufs. Minor fixes.
S: Rebmannsweg 34h
S: 79539 Loerrach
S: Germany
N: William E. Roadcap
E: roadcapw@cfw.com
W: http://www.cfw.com/~roadcapw
......
......@@ -608,6 +608,21 @@ CONFIG_BINFMT_AOUT
format. Saying M or N here is dangerous, because some crucial
programs on your system might be in A.OUT format.
Kernel support for JAVA binaries
CONFIG_BINFMT_JAVA
JAVA binaries are becoming a universal executable format. This
option allows Java binaries and Java Applets to be handled invisibly
to the OS. As more and more Java programs become available, the use
for this will gradually increase. If you want to use this, read the
Java on Linux HOWTO, available via ftp (user: anonymous) at
sunsite.unc.edu:/pub/Linux/docs/HOWTO. In order to execute Java binaries,
you will also need to install the Java Developers Kit. If you disable
this option it will reduce your kernel by about one page. This is not
much and by itself does not warrant removing support. However its
removal is a good idea if you do not have the JDK installed. If you
don't know what to answer at this point then answer Y. You may answer
M for module support and later load the module when you install the
JDK or find a interesting Java program that you can't live without.
Processor type
CONFIG_M386
This is the processor type of your CPU. It is used for optimizing
......@@ -1369,18 +1384,15 @@ CONFIG_SCSI_NCR53C7xx_DISCONNECT
### Dunno
###
Always IN2000 SCSI support (test release)
Always IN2000 SCSI support
CONFIG_SCSI_IN2000
Believe it or not, there is a SCSI host adaptor of that name. It is
explained in section 3.6 of the SCSI-HOWTO, available via ftp (user:
anonymous) at sunsite.unc.edu:/pub/Linux/docs/HOWTO. If it doesn't
work out of the box, you may have to change some settings in
drivers/scsi/in2000.h. You may also want to drop in a rewritten,
and probably more reliable, driver from John Shifflett, which you
can get from ftp://ftp.netcom.com/pub/js/jshiffle/in2000/ . If you
want to compile this as a module ( = code which can be inserted in
and removed from the running kernel whenever you want), say M here
and read Documentation/modules.txt.
This is support for an ISA bus SCSI host adaptor. You'll find
more information in drivers/scsi/in2000.readme. If it doesn't
work out of the box, you may have to change the jumpers for IRQ
or address selection. If you want to compile this as a module
( = code which can be inserted in and removed from the running
kernel whenever you want), say M here and read
Documentation/modules.txt.
PAS16 SCSI support
CONFIG_SCSI_PAS16
......
......@@ -42,7 +42,7 @@ foo \kill}%
%
\title{{\bf Linux Allocated Devices}}
\author{Maintained by H. Peter Anvin $<$hpa@zytor.com$>$}
\date{Last revised: May 5, 1996}
\date{Last revised: May 9, 1996}
\maketitle
%
\noindent
......@@ -167,7 +167,8 @@ least not without contacting me first.
\major{48}{}{char }{SDL RISCom serial card}
\major{49}{}{char }{SDL RISCom serial card -- alternate devices}
\major{50}{}{char }{Reserved for GLINT}
\major{51}{--59}{}{Unallocated}
\major{51}{}{char }{Baycom radio modem}
\major{52}{--59}{}{Unallocated}
\major{60}{--63}{}{Local/experimental use}
\major{64}{--119}{}{Unallocated}
\major{120}{--127}{}{Local/experimental use}
......@@ -1027,7 +1028,18 @@ driver with this number should not cause ill effects to the system
\end{devicelist}
\begin{devicelist}
\major{50}{--59}{}{Unallocated}
\major{50}{}{char}{Reserved for GLINT}
\end{devicelist}
\begin{devicelist}
\major{51}{}{char }{Baycom radio modem}
\minor{0}{/dev/bc0}{First Baycom radio modem}
\minor{1}{/dev/bc1}{Second Baycom radio modem}
\minordots
\end{devicelist}
\begin{devicelist}
\major{52}{--59}{}{Unallocated}
\end{devicelist}
\begin{devicelist}
......
......@@ -2,7 +2,7 @@
Maintained by H. Peter Anvin <hpa@zytor.com>
Last revised: May 5, 1996
Last revised: May 9, 1996
This list is the successor to Rick Miller's Linux Device List, which
he stopped maintaining when he got busy with other things in 1993. It
......@@ -708,7 +708,14 @@ least not without contacting me first.
1 = /dev/cul1 Callout device corresponding to ttyL1
...
50-59 UNALLOCATED
50 char Reserved for GLINT
51 char Baycom radio modem
0 = /dev/bc0 First Baycom radio modem
1 = /dev/bc1 Second Baycom radio modem
...
52-59 UNALLOCATED
60-63 LOCAL/EXPERIMENTAL USE
Allocated for local/experimental use. For devices not
......
......@@ -19,7 +19,7 @@ DOS\3 The "international" Fast File System. Supported.
DOS\4 The original filesystem with directory cache. The directory
cache speeds up directory accesses on floppies considerably,
but slowes down file creation/deletion. Doesn't make much
but slows down file creation/deletion. Doesn't make much
sense on hard disks. Not supported.
DOS\5 The Fast File System with directory cache. Not supported.
......@@ -37,7 +37,7 @@ protect If this option is set, the protection bits cannot be altered.
uid[=uid] This sets the uid of the root directory (i. e. the mount point
to uid or to the uid of the current user, if the =uid is
ommitted.
omitted.
gid[=gid] Same as above, but for gid.
......@@ -49,7 +49,7 @@ setgid[=gid] Same as above, but for gid.
use_mp The uid and gid are taken from the now covered mount point
instead of the current user or value defined.
mode=mode Sets the mode flags to the given (octal) value, regardles
mode=mode Sets the mode flags to the given (octal) value, regardless
of the original permissions. Directories will get an x
permission, if the corresponding r bit is set.
This is useful since most of the plain AmigaOS files
......@@ -58,12 +58,12 @@ mode=mode Sets the mode flags to the given (octal) value, regardles
reserved=num Sets the number of reserved blocks at the start of the
partition to num. Default is 2.
root=block Sets the block number of the root block. This schould never
be neccessary.
root=block Sets the block number of the root block. This should never
be necessary.
bs=blksize Sets the blocksize to blksize. Valid block sizes are 512,
1024, 2048 and 4096. Like the root option, this should
never be neccessary, as the affs can figure it out itself.
never be necessary, as the affs can figure it out itself.
quiet The file system will not return an error for disallowed
mode changes.
......
JAVA Binary Kernel Support for Linux v1.01
------------------------------------------
Linux beats them ALL! While all other OS's are TALKING about direct
support of Java Binaries in the OS, Linux is doing it!
You execute Java classes as you would any other executable, after a few
small details:
1) You MUST FIRST install the Java Developers Kit for Linux.
The Java on Linux HOWTO gives the details on getting and
installing this. This HOWTO can be found at:
ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/Java-HOWTO
If you install the JDK in a location other than the suggested
directory of /usr/local/java, then you will need to edit the
kernel's fs/binfmt_java.c file and make the needed change to the
_PATH_JAVA definition at the top of that file.
2) You must chmod the '*.class' files you wish to execute with
the execute bit. This is not normally (till now) done with
'.class' files.
3) You must optionally export a CLASSPATH environment variable,
if you plan to use Java applications installed outside of
/usr/local/java/classes/*.
4) Either compile your kernel with Java support builtin, or
as a loadable module. If a module, load it with insmod or
kerneld.
To test your new setup, enter in the following simple Java app, and name
it "HelloWorld.java":
class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello World!");
}
}
Now compile the application with:
/usr/local/java/bin/javac HelloWorld.java
Set the executable permissions of the binary file, with:
chmod 755 HelloWorld.class
And then execute it:
./HellowWorld.class
Yes, it's JUST THAT EASY! ;-)
-----------------------------------------------------------------
Nope, I didn't forget about Java Applets! ;-)
While this may not be the best way to do this, it works!
Take any html file used with the Java appletviewer (like the
demo/Blink/example1.html file), and:
1) Insert a new first line of:
<!--applet-->
Make sure the '<' is the first character in the file. This
will be treated as a valid HTML comment outside of this
Java Applet support, so the modified file can still be used
with all known browsers.
2) If you install the JDK in a location other than the suggested
directory of /usr/local/java, then you will need to edit the
kernel's fs/binfmt_java.c file and make the needed change to the
_PATH_APPLET definition at the top of that file.
3) You must chmod the '*.html' files you wish to execute with
the execute bit. This is not normally (till now) done with
'.html' files.
4) And then execute it.
Brian A. Lantz
brian@lantz.com
......@@ -59,6 +59,7 @@ The set of modules is rapidly increasing, but so far these are known:
Some misc modules:
lp: line printer
binfmt_elf: elf loader
binfmt_java: java loader
isp16: cdrom interface
When you have made the kernel, you create the modules by doing:
......
......@@ -287,7 +287,6 @@ M: begemot@bgm.rosprint.net
L: linux-kernel@vger.rutgers.edu
S: Maintained
MOUSE AND MISC DEVICES [GENERAL]
P: Alessandro Rubini
M: rubini@ipvvis.unipv.it
......@@ -306,6 +305,12 @@ M: tsbogend@bigbug.franken.de
L: linux-net@vger.rutgers.edu
S: Maintained
ADVANSYS SCSI DRIVER
P: Bob Frey
M: Bob Frey <bobf@advansys.com>
W: http://www.advansys.com/linux
S: Maintained
REST:
P: Linus Torvalds
S: Buried alive in email
VERSION = 1
PATCHLEVEL = 3
SUBLEVEL = 99
SUBLEVEL = 100
ARCH = i386
......
......@@ -32,7 +32,6 @@ CONFIG_ALPHA_EV5=y
CONFIG_ALPHA_ALCOR=y
# CONFIG_SERIAL_ECHO is not set
# CONFIG_TGA_CONSOLE is not set
CONFIG_PCI_OPTIMIZE=y
CONFIG_NET=y
CONFIG_SYSVIPC=y
CONFIG_BINFMT_AOUT=y
......
......@@ -33,6 +33,7 @@ fi
bool 'System V IPC' CONFIG_SYSVIPC
tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
tristate 'Kernel support for JAVA binaries' CONFIG_BINFMT_JAVA
bool 'Compile kernel as ELF - if your GCC is ELF-GCC' CONFIG_KERNEL_ELF
choice 'Processor type' \
......
......@@ -21,10 +21,10 @@ CONFIG_MODULES=y
CONFIG_NET=y
# CONFIG_MAX_16M is not set
CONFIG_PCI=y
CONFIG_PCI_OPTIMIZE=y
CONFIG_SYSVIPC=y
CONFIG_BINFMT_AOUT=y
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_JAVA is not set
CONFIG_KERNEL_ELF=y
# CONFIG_M386 is not set
# CONFIG_M486 is not set
......
......@@ -208,7 +208,7 @@ static const char * i486model(unsigned int nr)
{
static const char *model[] = {
"0","DX","SX","DX/2","4","SX/2","6","DX/2-WB","DX/4","DX/4-WB",
"10","11","12","13","Am5x85-WT","Am5x86-WB"
"10","11","12","13","Am5x86-WT","Am5x86-WB"
};
if (nr < sizeof(model)/sizeof(char *))
return model[nr];
......
......@@ -58,7 +58,8 @@
#ifndef __ASSEMBLY__
#include <asm/sigcontext.h> /* for struct _fpstate */
#include <linux/math_emu.h>
#include <asm/math_emu.h>
#include <linux/linkage.h>
/*
......
This diff is collapsed.
......@@ -94,10 +94,17 @@
* 3.10 Apr 10, 1996 -- Fix compilation error with STANDARD_ATAPI.
* 3.11 Apr 29, 1996 -- Patch from Heiko Eissfeldt <heiko@colossus.escape.de>
* to remove redundant verify_area calls.
* 3.12 May 7, 1996 -- Rudimentary changer support. Based on patches
* from Gerhard Zuber <zuber@berlin.snafu.de>.
* Let open succeed even if there's no loaded disc.
*
* NOTE: Direct audio reads will only work on some types of drive.
* So far, i've received reports of success for Sony and Toshiba drives.
*
* NOTE: The changer functions were tested with the NEC CDR-251 drive.
* They may not work with the Sanyo 3-cd changer, which i understand
* uses a different protocol.
*
* ATAPI cd-rom driver. To be used with ide.c.
*
* Copyright (C) 1994, 1995, 1996 scott snyder <snyder@fnald0.fnal.gov>
......@@ -182,6 +189,8 @@
#define MODE_SELECT_10 0x55
#define READ_CD 0xbe
#define LOAD_UNLOAD 0xa6
/* ATAPI sense keys (mostly copied from scsi.h). */
......@@ -1957,6 +1966,23 @@ cdrom_read_block (ide_drive_t *drive, int format, int lba,
}
/* If SLOT<0, unload the current slot. Otherwise, try to load SLOT. */
static int
cdrom_load_unload (ide_drive_t *drive, unsigned long slot,
struct atapi_request_sense *reqbuf)
{
struct packet_command pc;
memset (&pc, 0, sizeof (pc));
pc.sense_data = reqbuf;
pc.c[0] = LOAD_UNLOAD;
pc.c[4] = 2 + (slot >= 0);
pc.c[8] = slot;
return cdrom_queue_packet_command (drive, &pc);
}
int ide_cdrom_ioctl (ide_drive_t *drive, struct inode *inode,
struct file *file, unsigned int cmd, unsigned long arg)
{
......@@ -2370,6 +2396,33 @@ int ide_cdrom_ioctl (ide_drive_t *drive, struct inode *inode,
return stat;
}
case CDROMLOADFROMSLOT: {
struct atapi_request_sense my_reqbuf;
int stat;
if (drive->usage > 1)
return -EBUSY;
stat = cdrom_load_unload (drive, -1, NULL);
if (stat) return stat;
cdrom_saw_media_change (drive);
if (arg == -1) {
(void) cdrom_lockdoor (drive, 0, NULL);
return 0;
}
stat = cdrom_load_unload (drive, arg, NULL);
if (stat) return stat;
stat = cdrom_check_status (drive, &my_reqbuf);
if (stat && my_reqbuf.sense_key == NOT_READY) {
return -ENOENT;
}
/* And try to read the TOC information now. */
return cdrom_read_toc (drive, &my_reqbuf);
}
#if 0 /* Doesn't work reliably yet. */
case CDROMRESET: {
struct request req;
......@@ -2471,17 +2524,12 @@ int ide_cdrom_open (struct inode *ip, struct file *fp, ide_drive_t *drive)
stat = cdrom_check_status (drive, &my_reqbuf);
}
/* Return an error if there are still problems. */
if (stat && my_reqbuf.sense_key != UNIT_ATTENTION) {
--drive->usage;
return -ENXIO;
/* If things worked ok, lock the door and read the
TOC information. */
if (stat == 0 || my_reqbuf.sense_key == UNIT_ATTENTION) {
(void) cdrom_lockdoor (drive, 1, &my_reqbuf);
(void) cdrom_read_toc (drive, &my_reqbuf);
}
/* Now lock the door. */
(void) cdrom_lockdoor (drive, 1, &my_reqbuf);
/* And try to read the TOC information now. */
(void) cdrom_read_toc (drive, &my_reqbuf);
}
return 0;
......@@ -2593,7 +2641,7 @@ void ide_cdrom_setup (ide_drive_t *drive)
* duplicated functionality between read and ioctl paths?
* Establish interfaces for an IDE port driver, and break out the cdrom
* code into a loadable module.
* Support changers.
* Support changers better.
* Write some real documentation.
*/
......
/*
* linux/drivers/block/ide.c Version 5.39 May 3, 1996
* linux/drivers/block/ide.c Version 5.41 May 9, 1996
*
* Copyright (C) 1994-1996 Linus Torvalds & authors (see below)
*/
......@@ -231,6 +231,10 @@
* mask drive irq after use, if sharing with another hwif
* add code to help debug weird cmd640 problems
* Version 5.39 fix horrible error in earlier irq sharing "fix"
* Version 5.40 fix serialization -- was broken in 5.39
* help sharing by masking device irq after probing
* Version 5.41 more fixes to irq sharing/serialize detection
* disable io_32bit by default on drive reset
*
* Some additional driver compile-time options are in ide.h
*
......@@ -705,8 +709,10 @@ static void do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
/* For an ATAPI device, first try an ATAPI SRST. */
if (drive->media != ide_disk) {
if (!do_not_try_atapi) {
if (!drive->keep_settings)
if (!drive->keep_settings) {
drive->unmask = 0;
drive->io_32bit = 0;
}
OUT_BYTE (drive->select.all, IDE_SELECT_REG);
udelay (20);
OUT_BYTE (WIN_SRST, IDE_COMMAND_REG);
......@@ -732,6 +738,7 @@ static void do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
if (!rdrive->keep_settings) {
rdrive->mult_req = 0;
rdrive->unmask = 0;
rdrive->io_32bit = 0;
if (rdrive->using_dma) {
rdrive->using_dma = 0;
printk("%s: disabled DMA\n", rdrive->name);
......@@ -2376,8 +2383,11 @@ static int try_to_identify (ide_drive_t *drive, byte cmd)
#if CONFIG_BLK_DEV_PROMISE
if (IS_PROMISE_DRIVE) {
if(promise_cmd(drive,PROMISE_IDENTIFY))
if (promise_cmd(drive,PROMISE_IDENTIFY)) {
if (irqs)
(void) probe_irq_off(irqs);
return 1;
}
} else
#endif /* CONFIG_BLK_DEV_PROMISE */
OUT_BYTE(cmd,IDE_COMMAND_REG); /* ask drive for ID */
......@@ -2385,7 +2395,7 @@ static int try_to_identify (ide_drive_t *drive, byte cmd)
timeout += jiffies;
do {
if (jiffies > timeout) {
if (!HWIF(drive)->irq)
if (irqs)
(void) probe_irq_off(irqs);
return 1; /* drive timed-out */
}
......@@ -2409,10 +2419,13 @@ static int try_to_identify (ide_drive_t *drive, byte cmd)
} else
rc = 2; /* drive refused ID */
if (!HWIF(drive)->irq) {
irqs = probe_irq_off(irqs); /* get irq number */
if (irqs > 0)
HWIF(drive)->irq = irqs;
else { /* Mmmm.. multiple IRQs */
irqs = probe_irq_off(irqs); /* get our irq number */
if (irqs > 0) {
HWIF(drive)->irq = irqs; /* save it for later */
irqs = probe_irq_on(); /* grab irqs, to ignore next edge */
OUT_BYTE(drive->ctl|2,IDE_CONTROL_REG); /* mask device irq */
(void) probe_irq_off(irqs); /* restore irqs again */
} else { /* Mmmm.. multiple IRQs.. don't know which was ours */
printk("%s: IRQ probe failed (%d)\n", drive->name, irqs);
#ifdef CONFIG_BLK_DEV_CMD640
if (HWIF(drive)->chipset == ide_cmd640) {
......@@ -2998,11 +3011,40 @@ int ide_xlate_1024 (kdev_t i_rdev, int xparm, const char *msg)
return 1;
}
#if MAX_HWIFS > 1
/*
* save_match() is used to simplify logic in init_irq() below.
*
* A loophole here is that we may not know about a particular
* hwif's irq until after that hwif is actually probed/initialized..
* This could be a problem for the case where an hwif is on a
* dual interface that requires serialization (eg. cmd640) and another
* hwif using one of the same irqs is initialized beforehand.
*
* This routine detects and reports such situations, but does not fix them.
*/
static void save_match (ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match)
{
ide_hwif_t *m = *match;
if (m && m->hwgroup && m->hwgroup != new->hwgroup) {
if (!new->hwgroup)
return;
printk("%s: potential irq problem with %s and %s\n", hwif->name, new->name, m->name);
}
if (m->irq != hwif->irq) /* don't undo a prior perfect match */
*match = new;
}
#endif /* MAX_HWIFS > 1 */
/*
* This routine sets up the irq for an ide interface, and creates a new
* hwgroup for the irq/hwif if none was previously assigned.
*
* Much of the code is for correctly detecting/handling irq sharing
* and irq serialization situations. This is somewhat complex because
* it handles static as well as dynamic (PCMCIA) IDE interfaces.
*
* The SA_INTERRUPT in sa_flags means ide_intr() is always entered with
* interrupts completely disabled. This can be bad for interrupt latency,
* but anything else has led to problems on some machines. We re-enable
......@@ -3011,48 +3053,52 @@ int ide_xlate_1024 (kdev_t i_rdev, int xparm, const char *msg)
static int init_irq (ide_hwif_t *hwif)
{
unsigned long flags;
ide_hwgroup_t *hwgroup = hwif->hwgroup;
ide_hwif_t *mate_hwif;
unsigned int index, mate_irq = hwif->irq;
unsigned int index;
ide_hwgroup_t *hwgroup;
ide_hwif_t *match = NULL;
save_flags(flags);
cli();
hwif->hwgroup = NULL;
#if MAX_HWIFS > 1
/*
* Handle serialization, regardless of init sequence
*/
mate_hwif = &ide_hwifs[hwif->index ^ 1];
if (hwif->serialized && mate_hwif->present)
mate_irq = mate_hwif->irq;
/*
* Group up with any other hwifs that share our irq(s)
* Group up with any other hwifs that share our irq(s).
*/
for (index = 0; index < MAX_HWIFS; index++) {
if (index != hwif->index) {
ide_hwif_t *h = &ide_hwifs[index];
if (h->irq == hwif->irq || h->irq == mate_irq) {
ide_hwif_t *h = &ide_hwifs[index];
if (h->hwgroup) { /* scan only initialized hwif's */
if (hwif->irq == h->irq) {
hwif->sharing_irq = h->sharing_irq = 1;
if (hwgroup && !h->hwgroup)
h->hwgroup = hwgroup;
else if (!hwgroup)
hwgroup = h->hwgroup;
save_match(hwif, h, &match);
}
if (hwif->serialized) {
ide_hwif_t *mate = &ide_hwifs[hwif->index^1];
if (index == mate->index || h->irq == mate->irq)
save_match(hwif, h, &match);
}
if (h->serialized) {
ide_hwif_t *mate = &ide_hwifs[h->index^1];
if (hwif->irq == mate->irq)
save_match(hwif, h, &match);
}
}
}
#endif /* MAX_HWIFS > 1 */
/*
* If we are still without a hwgroup, then form a new one
*/
if (hwgroup == NULL) {
hwgroup = kmalloc (sizeof(ide_hwgroup_t), GFP_KERNEL);
if (match) {
hwgroup = match->hwgroup;
} else {
hwgroup = kmalloc(sizeof(ide_hwgroup_t), GFP_KERNEL);
hwgroup->hwif = hwgroup->next_hwif = hwif->next = hwif;
hwgroup->rq = NULL;
hwgroup->handler = NULL;
if (hwif->drives[0].present)
hwgroup->drive = &hwif->drives[0];
hwgroup->drive = &hwif->drives[0];
else
hwgroup->drive = &hwif->drives[1];
hwgroup->drive = &hwif->drives[1];
hwgroup->poll_timeout = 0;
init_timer(&hwgroup->timer);
hwgroup->timer.function = &timer_expiry;
......@@ -3062,16 +3108,13 @@ static int init_irq (ide_hwif_t *hwif)
/*
* Allocate the irq, if not already obtained for another hwif
*/
if (!hwif->got_irq) {
if (!match || match->irq != hwif->irq) {
if (request_irq(hwif->irq, ide_intr, SA_INTERRUPT|SA_SAMPLE_RANDOM, hwif->name, hwgroup)) {
if (!match)
kfree(hwgroup);
restore_flags(flags);
return 1;
}
for (index = 0; index < MAX_HWIFS; index++) {
ide_hwif_t *g = &ide_hwifs[index];
if (g->irq == hwif->irq)
g->got_irq = 1;
}
}
/*
......@@ -3085,8 +3128,8 @@ static int init_irq (ide_hwif_t *hwif)
printk("%s at 0x%03x-0x%03x,0x%03x on irq %d", hwif->name,
hwif->io_base, hwif->io_base+7, hwif->ctl_port, hwif->irq);
if (hwgroup->hwif != hwif)
printk(" (serialized with %s)", hwgroup->hwif->name);
if (match)
printk(" (%sed with %s)", hwif->sharing_irq ? "shar" : "serializ", match->name);
printk("\n");
return 0;
}
......
......@@ -419,7 +419,6 @@ typedef struct hwif_s {
unsigned present : 1; /* this interface exists */
unsigned serialized : 1; /* serialized operation with mate hwif */
unsigned no_unmask : 1; /* disallow setting unmask bits */
unsigned got_irq : 1; /* 1 = already alloc'd our irq */
unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */
#ifdef CONFIG_BLK_DEV_PROMISE
unsigned is_promise2: 1; /* 2nd i/f on promise DC4030 */
......
......@@ -617,6 +617,9 @@ int blk_dev_init(void)
#ifdef CONFIG_BLK_DEV_LOOP
loop_init();
#endif
#ifdef CONFIG_CDI_INIT
cdi_init(); /* this MUST precede ide_init */
#endif CONFIG_CDI_INIT
#ifdef CONFIG_BLK_DEV_IDE
ide_init(); /* this MUST precede hd_init */
#endif
......@@ -631,9 +634,6 @@ int blk_dev_init(void)
#else
outb_p(0xc, 0x3f2);
#endif
#ifdef CONFIG_CDI_INIT
cdi_init();
#endif CONFIG_CDI_INIT
#ifdef CONFIG_CDU31A
cdu31a_init();
#endif CONFIG_CDU31A
......
/*
* linux/drivers/block/umc8672.c Version 0.03 Feb 09, 1996
* linux/drivers/block/umc8672.c Version 0.04 May 09, 1996
*
* Copyright (C) 1995-1996 Linus Torvalds & author (see below)
*/
......@@ -35,7 +35,7 @@
* the results from the DOS speed test program supplied from UMC. 11 is the
* highest speed (about PIO mode 3)
*/
#undef REALLY_SLOW_IO /* most systems can safely undef this */
#define REALLY_SLOW_IO /* some systems can safely undef this */
#include <linux/types.h>
#include <linux/kernel.h>
......
Tue May 7 22:51:11 1996 <tytso@rsts-11.mit.edu>
* random.c (add_timer_randomness): Limit the amount randomness
that we estimate to 12 bits. (An arbitrary amount).
(extract_entropy): To make it harder to analyze the hash
function, fold the hash function in half using XOR, and
use the folded result as the value to emit to the user.
Also, add timer randomness each pass through the
exact_entropy call, to increase the amount of unknown
values during the extraction process.
(random_ioctl): Use IOR/IOW definitions to define the
ioctl values used by the /dev/random driver. Allow the
old ioctl values to be used for backwards compatibility
(for a limited amount of time).
Wed Apr 24 14:02:04 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
* random.c (add_timer_randomness): Use 2nd derivative as well to
......
......@@ -47,6 +47,13 @@
#include <asm/irq.h>
static struct mouse_status mouse;
static int mouse_irq = MOUSE_IRQ;
void msmouse_setup(char *str, int *ints)
{
if (ints[0] > 0)
mouse_irq=ints[1];
}
static void ms_mouse_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{
......@@ -97,7 +104,7 @@ static void release_mouse(struct inode * inode, struct file * file)
return;
MS_MSE_INT_OFF();
mouse.ready = 0;
free_irq(MOUSE_IRQ, NULL);
free_irq(mouse_irq, NULL);
MOD_DEC_USE_COUNT;
}
......@@ -107,7 +114,7 @@ static int open_mouse(struct inode * inode, struct file * file)
return -EINVAL;
if (mouse.active++)
return 0;
if (request_irq(MOUSE_IRQ, ms_mouse_interrupt, 0, "MS Busmouse", NULL)) {
if (request_irq(mouse_irq, ms_mouse_interrupt, 0, "MS Busmouse", NULL)) {
mouse.active--;
return -EBUSY;
}
......
/*
* random.c -- A strong random number generator
*
* Version 0.97, last modified 24-Apr-96
* Version 0.98, last modified 7-May-96
*
* Copyright Theodore Ts'o, 1994, 1995, 1996. All rights reserved.
*
......@@ -458,7 +458,6 @@ static inline void add_entropy_word(struct random_bucket *r,
* On the i386, this is assumed to be at most 16 bits, and the high bits
* are used for a high-resolution timer.
*
* TODO: Read the time stamp register on the Pentium.
*/
static void add_timer_randomness(struct random_bucket *r,
struct timer_rand_state *state, unsigned num)
......@@ -475,21 +474,6 @@ static void add_timer_randomness(struct random_bucket *r,
time = (__u32) low;
num ^= (__u32) high;
} else {
#if 0
/*
* On a 386, read the high resolution timer. We assume that
* this gives us 2 bits of randomness.
*
* This is turned off for now because of the speed hit
* it entails.
*/
outb_p(0x00, 0x43); /* latch the count ASAP */
num |= inb_p(0x40) << 16;
num |= inb(0x40) << 24;
if (!state->dont_count_entropy)
r->entropy_count += 2;
#endif
time = jiffies;
}
#else
......@@ -521,6 +505,13 @@ static void add_timer_randomness(struct random_bucket *r,
for (nbits = 0; delta; nbits++)
delta >>= 1;
/*
* In no case do we assume we've added more than 12
* bits of randomness.
*/
if (nbits > 12)
nbits = 12;
r->entropy_count += nbits;
/* Prevent overflow */
......@@ -844,6 +835,7 @@ static inline int extract_entropy(struct random_bucket *r, char * buf,
{
int ret, i;
__u32 tmp[HASH_BUFFER_SIZE];
char *cp,*dp;
add_timer_randomness(r, &extract_timer_state, nbytes);
......@@ -885,15 +877,27 @@ static inline int extract_entropy(struct random_bucket *r, char * buf,
* add_entropy_word().
*/
HASH_TRANSFORM(tmp, r->pool);
/*
* In case the hash function has some recognizeable
* output pattern, we fold it half.
*/
cp = (char *) tmp;
dp = cp + (HASH_BUFFER_SIZE*sizeof(__u32)) - 1;
for (i=0; i < HASH_BUFFER_SIZE*sizeof(__u32)/2; i++) {
*cp ^= *dp;
cp++; dp--;
}
/* Copy data to destination buffer */
i = MIN(nbytes, HASH_BUFFER_SIZE*sizeof(__u32));
i = MIN(nbytes, HASH_BUFFER_SIZE*sizeof(__u32)/2);
if (to_user)
memcpy_tofs(buf, (__u8 const *)tmp, i);
else
memcpy(buf, (__u8 const *)tmp, i);
nbytes -= i;
buf += i;
add_timer_randomness(r, &extract_timer_state, nbytes);
}
/* Wipe data from memory */
......@@ -1029,6 +1033,20 @@ random_ioctl(struct inode * inode, struct file * file,
int *p, size, ent_count;
int retval;
/*
* Translate old 1.3.XX values.
* Remove this code in 2.1.0.
* <mec@duracef.shout.net>
*/
switch (cmd) {
case 0x01080000: cmd = RNDGETENTCNT; break;
case 0x01080001: cmd = RNDADDTOENTCNT; break;
case 0x01080002: cmd = RNDGETPOOL; break;
case 0x01080003: cmd = RNDADDENTROPY; break;
case 0x01080004: cmd = RNDZAPENTCNT; break;
case 0x01080006: cmd = RNDCLEARPOOL; break;
}
switch (cmd) {
case RNDGETENTCNT:
retval = verify_area(VERIFY_WRITE, (void *) arg, sizeof(int));
......
......@@ -382,7 +382,7 @@ static void hydra_interrupt(int irq, struct pt_regs *fp, void *data)
#endif
/* overwrite warning occured, stop NIC & check the BOUNDARY pointer */
/* overwrite warning occurred, stop NIC & check the BOUNDARY pointer */
/* FIXME - real overwrite handling needed !! */
printk("hydra_interrupt(): overwrite warning, resetting NIC\n");
......
......@@ -117,7 +117,7 @@
#define ISR_PTX 0x02 /* Packet transmitted without errors */
#define ISR_RXE 0x04 /* Receive error */
#define ISR_TXE 0x08 /* Transmit error */
#define ISR_OVW 0x10 /* Ring buffer overrrun */
#define ISR_OVW 0x10 /* Ring buffer overrun */
#define ISR_CNT 0x20 /* Counter overflow */
#define ISR_RDC 0x40 /* Remote DMA compile */
#define ISR_RST 0x80 /* Reset status */
......
......@@ -40,7 +40,7 @@ if [ "$CONFIG_PCI" = "y" ]; then
bool ' allow DISCONNECT' CONFIG_SCSI_NCR53C7xx_DISCONNECT
fi
fi
dep_tristate 'Always IN2000 SCSI support (test release)' CONFIG_SCSI_IN2000 $CONFIG_SCSI
dep_tristate 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 $CONFIG_SCSI
dep_tristate 'PAS16 SCSI support' CONFIG_SCSI_PAS16 $CONFIG_SCSI
dep_tristate 'QLOGIC SCSI support' CONFIG_SCSI_QLOGIC $CONFIG_SCSI
dep_tristate 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE $CONFIG_SCSI
......
/* $Id: advansys.c,v 1.12 1996/02/23 20:48:27 bobf Exp bobf $ */
/* $Id: advansys.c,v 1.14 1996/05/10 00:26:31 bobf Exp bobf $ */
/*
* advansys.c - Linux Host Driver for AdvanSys SCSI Adapters
*
......@@ -14,8 +14,8 @@
* bobf@advansys.com (Bob Frey)
*/
/* The driver has been tested with Linux v1.2.1 and v1.3.57 kernels. */
#define ASC_VERSION "1.3" /* AdvanSys Driver Version */
/* The driver has been tested with Linux v1.2.13 and v1.3.57 kernels. */
#define ASC_VERSION "1.4" /* AdvanSys Driver Version */
/*
......@@ -359,6 +359,15 @@
4. Eliminate 'make dep' warning.
5. Try to fix problem with handling resets by increasing their
timeout value.
5/8/96 1.4:
1. Change definitions to eliminate conflicts with other subsystems.
2. Add versioning code for the shared interrupt changes.
3. Eliminate problem in asc_rmqueue() with iterating after removing
a request.
4. Remove reset request loop problem from the "Known Problems or
Issues" section. This problem was isolated and fixed in the
mid-level SCSI driver.
H. Known Problems or Issues
......@@ -377,10 +386,6 @@
value is only changed on the first scsi command for each device
and never thereafter. The same change is made for reset commands.
3. The driver occasionally enters a loop handling reset requests. It
isn't clear yet whether this is a bug in the upper or mid-level
scsi modules or in this driver.
I. Credits
Nathan Hartwell <mage@cdc3.cdc.net> provided the directions and
......@@ -482,11 +487,6 @@
#define ASC_LIB_SERIAL_NUMBER 53
typedef unsigned char uchar;
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef int BOOL;
#ifndef NULL
#define NULL (0)
......@@ -502,33 +502,33 @@ typedef int BOOL;
#define REG register
#define rchar REG char
#define rshort REG short
#define rint REG int
#define rlong REG long
#define rchar REG __s8
#define rshort REG __s16
#define rint REG __s32
#define rlong REG __s32
#define ruchar REG uchar
#define rushort REG ushort
#define ruint REG uint
#define rulong REG ulong
#define ruchar REG __u8
#define rushort REG __u16
#define ruint REG __u32
#define rulong REG __u32
#define NULLPTR ( void *)0
#define FNULLPTR ( void dosfar *)0UL
#define EOF (-1)
#define EOS '\0'
#define ERR (-1)
#define UB_ERR (uchar)(0xFF)
#define UW_ERR (uint)(0xFFFF)
#define UL_ERR (ulong)(0xFFFFFFFFUL)
#define UB_ERR (__u8)(0xFF)
#define UW_ERR (__u16)(0xFFFF)
#define UL_ERR (__u32)(0xFFFFFFFFUL)
#define iseven_word( val ) ( ( ( ( uint )val) & ( uint )0x0001 ) == 0 )
#define isodd_word( val ) ( ( ( ( uint )val) & ( uint )0x0001 ) != 0 )
#define toeven_word( val ) ( ( ( uint )val ) & ( uint )0xFFFE )
#define iseven_word( val ) ( ( ( ( __u16 )val) & ( __u16 )0x0001 ) == 0 )
#define isodd_word( val ) ( ( ( ( __u16 )val) & ( __u16 )0x0001 ) != 0 )
#define toeven_word( val ) ( ( ( __u16 )val ) & ( __u16 )0xFFFE )
#define biton( val, bits ) ((( uint )( val >> bits ) & (uint)0x0001 ) != 0 )
#define bitoff( val, bits ) ((( uint )( val >> bits ) & (uint)0x0001 ) == 0 )
#define lbiton( val, bits ) ((( ulong )( val >> bits ) & (ulong)0x00000001UL ) != 0 )
#define lbitoff( val, bits ) ((( ulong )( val >> bits ) & (ulong)0x00000001UL ) == 0 )
#define biton( val, bits ) ((( __u16 )( val >> bits ) & (__u16)0x0001 ) != 0 )
#define bitoff( val, bits ) ((( __u16 )( val >> bits ) & (__u16)0x0001 ) == 0 )
#define lbiton( val, bits ) ((( __u32 )( val >> bits ) & (__u32)0x00000001UL ) != 0 )
#define lbitoff( val, bits ) ((( __u32 )( val >> bits ) & (__u32)0x00000001UL ) == 0 )
#define absh( val ) ( ( val ) < 0 ? -( val ) : ( val ) )
......@@ -546,25 +546,25 @@ typedef int BOOL;
#define KBYTE (0x400)
#endif
#define HI_BYTE(x) ( *( ( BYTE *)(&x)+1 ) )
#define LO_BYTE(x) ( *( ( BYTE *)&x ) )
#define HI_BYTE(x) ( *( ( __u8 *)(&x)+1 ) )
#define LO_BYTE(x) ( *( ( __u8 *)&x ) )
#define HI_WORD(x) ( *( ( WORD *)(&x)+1 ) )
#define LO_WORD(x) ( *( ( WORD *)&x ) )
#define HI_WORD(x) ( *( ( __u16 *)(&x)+1 ) )
#define LO_WORD(x) ( *( ( __u16 *)&x ) )
#ifndef MAKEWORD
#define MAKEWORD(lo, hi) ((WORD) (((WORD) lo) | ((WORD) hi << 8)))
#define MAKEWORD(lo, hi) ((__u16) (((__u16) lo) | ((__u16) hi << 8)))
#endif
#ifndef MAKELONG
#define MAKELONG(lo, hi) ((DWORD) (((DWORD) lo) | ((DWORD) hi << 16)))
#define MAKELONG(lo, hi) ((__u32) (((__u32) lo) | ((__u32) hi << 16)))
#endif
#define SwapWords(dWord) ((DWORD) ((dWord >> 16) | (dWord << 16)))
#define SwapBytes(word) ((WORD) ((word >> 8) | (word << 8)))
#define SwapWords(dWord) ((__u32) ((dWord >> 16) | (dWord << 16)))
#define SwapBytes(word) ((__u16) ((word >> 8) | (word << 8)))
#define BigToLittle(dWord) \
((DWORD) (SwapWords(MAKELONG(SwapBytes(LO_WORD(dWord)), SwapBytes(HI_WORD(dWord))))))
((__u32) (SwapWords(MAKELONG(SwapBytes(LO_WORD(dWord)), SwapBytes(HI_WORD(dWord))))))
#define LittleToBig(dWord) BigToLittle(dWord)
#define Lptr
......@@ -2551,7 +2551,11 @@ int asc_dbglvl = 0;
#ifdef LINUX_1_3
STATIC int asc_proc_copy(off_t, off_t, char *, int , char *, int);
#endif /* LINUX_1_3 */
#ifdef LINUX_1_2
STATIC void advansys_interrupt(int, struct pt_regs *);
#else /* LINUX_1_3 */
STATIC void advansys_interrupt(int, void *, struct pt_regs *);
#endif /* LINUX_1_3 */
STATIC void advansys_command_done(Scsi_Cmnd *);
STATIC int asc_execute_scsi_cmnd(Scsi_Cmnd *);
STATIC void asc_isr_callback(ASC_DVC_VAR *, ASC_QDONE_INFO *);
......@@ -3106,8 +3110,13 @@ advansys_detect(Scsi_Host_Template *tpnt)
/* Register IRQ Number. */
ASC_DBG1(2, "advansys_detect: request_irq() %d\n", shp->irq);
#ifdef LINUX_1_2
if ((ret = request_irq(shp->irq, advansys_interrupt,
SA_INTERRUPT, "advansys")) != 0) {
#else /* LINUX_1_3 */
if ((ret = request_irq(shp->irq, advansys_interrupt,
SA_INTERRUPT, "advansys", NULL)) != 0) {
#endif /* LINUX_1_3 */
ASC_DBG1(0, "advansys_detect: request_irq() failed %d\n", ret);
release_region(shp->io_port, shp->n_io_port);
if (shp->dma_channel != NO_ISA_DMA) {
......@@ -3130,7 +3139,11 @@ advansys_detect(Scsi_Host_Template *tpnt)
if (shp->dma_channel != NO_ISA_DMA) {
free_dma(shp->dma_channel);
}
#ifdef LINUX_1_2
free_irq(shp->irq);
#else /* LINUX_1_3 */
free_irq(shp->irq, NULL);
#endif /* LINUX_1_3 */
scsi_unregister(shp);
asc_board_count--;
continue;
......@@ -3152,7 +3165,11 @@ int
advansys_release(struct Scsi_Host *shp)
{
ASC_DBG(1, "advansys_release: begin\n");
#ifdef LINUX_1_2
free_irq(shp->irq);
#else /* LINUX_1_3 */
free_irq(shp->irq, NULL);
#endif /* LINUX_1_3 */
if (shp->dma_channel != NO_ISA_DMA) {
ASC_DBG(1, "advansys_release: free_dma()\n");
free_dma(shp->dma_channel);
......@@ -3577,7 +3594,11 @@ asc_proc_copy(off_t advoffset, off_t offset, char *curbuf, int leftlen,
* First-level interrupt handler.
*/
STATIC void
#ifdef LINUX_1_2
advansys_interrupt(int irq, struct pt_regs *regs)
#else /* LINUX_1_3 */
advansys_interrupt(int irq, void *dev_id, struct pt_regs *regs)
#endif /* LINUX_1_3 */
{
int i;
int flags;
......@@ -4455,6 +4476,7 @@ asc_rmqueue(struct Scsi_Host *shp, Scsi_Cmnd *scp, int tid)
scp->host_scribble = NULL;
ASC_STATS(rmqueue);
ret = ASC_TRUE;
break; /* Note: Don't iterate, *scpp may be NULL. */
}
}
if (ASC_BOARD(shp)->pending[tid] == NULL) {
......
......@@ -1220,9 +1220,9 @@ int aha152x_biosparam(Scsi_Disk * disk, kdev_t dev, int *info_array)
info_array[1]=32;
info_array[2]=disk->capacity / (64 * 32);
} else {
info_array[0] = 256;
info_array[0] = 255;
info_array[1] = 63;
info_array[2] = disk->capacity / (256 * 63);
info_array[2] = disk->capacity / (255 * 63);
if(info_array[2] > 1023)
info_array[2]=1023;
}
......
......@@ -1118,7 +1118,7 @@ short register_HBA(u32 base, struct get_conf *gc, Scsi_Host_Template * tpnt,
/*
* If we are using a ISA board, we can't use extended SG,
* because we would need exessive amounts of memory for
* because we would need excessive amounts of memory for
* bounce buffers.
*/
if (gc->SG_64K==TRUE && ntohs(gc->SGsiz)==64 && hd->bustype!=IS_ISA){
......
......@@ -82,7 +82,7 @@
*
*
* TODO:
* proc interface. tagged queuing. multiple cards.
* tagged queuing. multiple cards.
*
*
* NOTE:
......@@ -120,32 +120,28 @@
#include "hosts.h"
#include "in2000.h"
#if LINUX_VERSION_CODE >= 0x010300
#include <linux/blk.h>
#else
#include "../block/blk.h"
#endif
#include <linux/stat.h>
#ifdef MODULE
#include <linux/module.h>
#endif
#define PROC_INTERFACE /* add code for /proc/scsi/in2000/xxx interface */
#define FAST_READ_IO /* No problems with these on my machine */
#define FAST_WRITE_IO
#define IN2000_VERSION "1.28"
#define IN2000_DATE "07/May/1996"
#define PROC_INTERFACE /* add code for /proc/scsi/in2000/xxx interface */
#define SYNC_DEBUG /* extra info on sync negotiation printed */
#define DEBUGGING_ON /* enable command-line debugging bitmask */
#define DEBUG_DEFAULTS 0 /* default bitmask - change from command-line */
#define IN2000_VERSION "1.28"
#define IN2000_DATE "27/Apr/1996"
#define FAST_READ_IO /* No problems with these on my machine */
#define FAST_WRITE_IO
#ifdef DEBUGGING_ON
#define DB(f,a) if (hostdata->args & (f)) a;
#define CHECK_NULL(p,s) if (!(p)) {printk("\n"); while (1) printk("NP:%s\r",(s));}
#define CHECK_NULL(p,s) /* if (!(p)) {printk("\n"); while (1) printk("NP:%s\r",(s));} */
#else
#define DB(f,a)
#define CHECK_NULL(p,s)
......@@ -851,11 +847,7 @@ int i;
* re-think the multiple card capability....
*/
#if LINUX_VERSION_CODE >= 0x010346 /* 1.3.70 */
void in2000_intr (int irqnum, void * dev_id, struct pt_regs *ptregs)
#else
void in2000_intr (int irqnum, struct pt_regs *ptregs)
#endif
{
struct Scsi_Host *instance;
struct IN2000_hostdata *hostdata;
......@@ -1684,11 +1676,7 @@ unsigned long flags;
#if LINUX_VERSION_CODE >= 0x010359 /* 1.3.89 */
int in2000_reset(Scsi_Cmnd *cmd, unsigned int reset_flags)
#else
int in2000_reset(Scsi_Cmnd *cmd)
#endif
{
unsigned long flags;
struct Scsi_Host *instance;
......@@ -1930,13 +1918,10 @@ char *cp;
#if LINUX_VERSION_CODE >= 0x010300
#include <linux/stat.h>
struct proc_dir_entry proc_scsi_in2000 = {
PROC_SCSI_IN2000, 6, "in2000",
S_IFDIR | S_IRUGO | S_IXUGO, 2
};
#endif
const unsigned int *bios_tab[] = {
......@@ -1995,12 +1980,12 @@ char buf[32];
if (check_setup_strings("ioport",&flags,&val,buf)) {
base = val;
switches = ~inb(base + IO_SWITCHES) & 0xff;
printk("Forcing detection at IOport 0x%x.\n",base);
printk("Forcing IN2000 detection at IOport 0x%x ",base);
bios = 2;
}
else if (*(bios_tab[bios]+0x04) == 0x41564f4e ||
*(bios_tab[bios]+0x0c) == 0x61776c41) {
printk("Found IN2000 BIOS at 0x%x.\n",(unsigned int)bios_tab[bios]);
printk("Found IN2000 BIOS at 0x%x ",(unsigned int)bios_tab[bios]);
/* Read the switch image that's mapped into EPROM space */
......@@ -2015,7 +2000,7 @@ char buf[32];
x = ~inb(base + IO_SWITCHES) & 0xff;
if (x != switches) {
printk("Bad IO signature: %02x vs %02x\n",x,switches);
printk("Bad IO signature: %02x vs %02x.\n",x,switches);
continue;
}
}
......@@ -2054,10 +2039,7 @@ char buf[32];
* initialize it.
*/
#if LINUX_VERSION_CODE >= 0x010300
tpnt->proc_dir = &proc_scsi_in2000; /* done more than once? harmless. */
#endif
detect_count++;
instance = scsi_register(tpnt, sizeof(struct IN2000_hostdata));
if (!instance_list)
......@@ -2071,12 +2053,7 @@ char buf[32];
write1_io(0,IO_FIFO_READ); /* start fifo out in read mode */
write1_io(0,IO_INTR_MASK); /* allow all ints */
x = int_tab[(switches & (SW_INT0 | SW_INT1)) >> SW_INT_SHIFT];
#if LINUX_VERSION_CODE >= 0x010346 /* 1.3.70 */
if (request_irq(x, in2000_intr, SA_INTERRUPT, "in2000", NULL)) {
#else
if (request_irq(x, in2000_intr, SA_INTERRUPT, "in2000")) {
#endif
printk("in2000_detect: Unable to allocate IRQ.\n");
detect_count--;
continue;
......@@ -2119,7 +2096,6 @@ char buf[32];
disc_taken_total = 0;
#endif
if (check_setup_strings("nosync",&flags,&val,buf))
hostdata->sync_off = val;
......@@ -2139,7 +2115,7 @@ char buf[32];
if (check_setup_strings("debug",&flags,&val,buf))
hostdata->args = (val & DB_MASK);
while (check_setup_strings("proc",&flags,&val,buf))
if (check_setup_strings("proc",&flags,&val,buf))
hostdata->proc = val;
x = reset_hardware(instance,(hostdata->args & A_NO_SCSI_RESET)?RESET_CARD:RESET_CARD_AND_BUS);
......@@ -2154,27 +2130,26 @@ char buf[32];
else
hostdata->chip = C_WD33C93;
printk("in2000-%d: dip_switch=%02x: irq=%d ioport=%02x floppy=%s sync/DOS5=%s\n",
instance->host_no,(switches & 0x7f),
printk("dip_switch=%02x irq=%d ioport=%02x floppy=%s sync/DOS5=%s ",
(switches & 0x7f),
instance->irq,hostdata->io_base,
(switches & SW_FLOPPY)?"Yes":"No",
(switches & SW_SYNC_DOS5)?"Yes":"No");
printk("in2000-%d: hardware_ver=%02x chip=%s microcode=%02x\n",
instance->host_no,hrev,
printk("hardware_ver=%02x chip=%s microcode=%02x\n",
hrev,
(hostdata->chip==C_WD33C93)?"WD33c93":
(hostdata->chip==C_WD33C93A)?"WD33c93A":
(hostdata->chip==C_WD33C93B)?"WD33c93B":"unknown",
hostdata->microcode);
#ifdef DEBUGGING_ON
printk("in2000-%d: setup_strings = ",instance->host_no);
printk("setup_strings = ");
for (x=0; x<8; x++)
printk("%s,",setup_strings[x]);
printk("\n");
#endif
if (hostdata->sync_off == 0xff)
printk("in2000-%d: Sync-transfer DISABLED on all devices: ENABLE from command-line\n",instance->host_no);
printk("in2000-%d: driver version %s - %s\n",instance->host_no,
IN2000_VERSION,IN2000_DATE);
printk("Sync-transfer DISABLED on all devices: ENABLE from command-line\n");
printk("IN2000 driver version %s - %s\n",IN2000_VERSION,IN2000_DATE);
}
return detect_count;
......@@ -2186,11 +2161,7 @@ char buf[32];
* supposed to do...
*/
#if LINUX_VERSION_CODE >= 0x010300
int in2000_biosparam(Disk *disk, kdev_t dev, int *iinfo)
#else
int in2000_biosparam(Disk *disk, int dev, int *iinfo)
#endif
{
int size;
......@@ -2224,6 +2195,26 @@ int size;
}
#ifdef PROC_INTERFACE
/* Certain older compilers (such as a.out 2.5.8) choke and give a
* "Too many reloads" error when there are a lot of calls to 'strcat()'
* in one function. Modern kernels define 'strcat()' as an inline
* function - I _guess_ this is related to the problem. Regardless,
* we can make everyone happy by doing some macro fudging to force
* gcc to do calls instead of inline expansion.
*/
char * in2000_strcat(char * dest, const char * src)
{
return strcat(dest,src);
}
#define strcat(d,s) (in2000_strcat((d),(s)))
#endif
int in2000_proc_info(char *buf, char **start, off_t off, int len, int hn, int in)
{
......
......@@ -2,7 +2,7 @@
* in2000.h - Linux device driver definitions for the
* Always IN2000 ISA SCSI card.
*
* IMPORTANT: This file is for version 1.28 - 27/Apr/1996
* IMPORTANT: This file is for version 1.28 - 07/May/1996
*
* Copyright (c) 1996 John Shifflett, GeoLog Consulting
* john@geolog.com
......@@ -25,16 +25,6 @@
#include <asm/io.h>
/* We include version.h to get 'LINUX_VERSION_CODE' - a define used here
* and there in the source to get around various compatibility problems:
* - pre-1.3.xx kernels didn't have 'kdev_t' or proc, and their
* <blk.h> was in a different place.
* - 1.3.70 introduced an additional argument for interrupt functions
* - 1.3.89 added an argument to in2000_reset(), which we don't really
* use at the moment. But for completeness...
*/
#include <linux/version.h>
#define uchar unsigned char
......@@ -325,17 +315,8 @@ int in2000_abort(Scsi_Cmnd *);
void in2000_setup(char *, int *);
int in2000_proc_info(char *, char **, off_t, int, int, int);
struct proc_dir_entry proc_scsi_in2000;
#if LINUX_VERSION_CODE >= 0x010300
int in2000_biosparam(struct scsi_disk *, kdev_t, int *);
#else
int in2000_biosparam(Disk *, int, int *);
#endif
#if LINUX_VERSION_CODE >= 0x010359 /* 1.3.89 */
int in2000_reset(Scsi_Cmnd *, unsigned int);
#else
int in2000_reset(Scsi_Cmnd *);
#endif
#define IN2000_CAN_Q 16
......@@ -343,7 +324,6 @@ int in2000_reset(Scsi_Cmnd *);
#define IN2000_CPL 2
#define IN2000_HOST_ID 7
#if LINUX_VERSION_CODE >= 0x010300
#define IN2000 { NULL, /* link pointer for modules */ \
NULL, /* usage_count for modules */ \
&proc_scsi_in2000, /* pointer to /proc/scsi directory entry */ \
......@@ -367,30 +347,5 @@ int in2000_reset(Scsi_Cmnd *);
DISABLE_CLUSTERING \
}
#else
#define IN2000 { NULL, /* link pointer for modules */ \
NULL, /* usage_count for modules */ \
/* NULL,*/ /* pointer to /proc/scsi directory entry */ \
/* NULL,*/ /* pointer to proc info function */ \
"Always IN2000", /* device name */ \
in2000_detect, /* returns number of in2000's found */ \
NULL, /* optional unload function for modules */ \
NULL, /* optional misc info function */ \
NULL, /* send scsi command, wait for completion */ \
in2000_queuecommand, /* queue scsi command, don't wait */ \
in2000_abort, /* abort current command */ \
in2000_reset, /* reset scsi bus */ \
NULL, /* slave_attach - unused */ \
in2000_biosparam, /* figures out BIOS parameters for lilo, etc */ \
IN2000_CAN_Q, /* max commands we can queue up */ \
IN2000_HOST_ID, /* host-adapter scsi id */ \
IN2000_SG, /* scatter-gather table size */ \
IN2000_CPL, /* commands per lun */ \
0, /* board counter */ \
0, /* unchecked dma */ \
DISABLE_CLUSTERING \
}
#endif
#endif /* IN2000_H */
UPDATE NEWS: version 1.28 - 27 Apr 96
UPDATE NEWS: version 1.28 - 07 May 96
Tightened up the "interrupts enabled/disabled" discipline
in 'in2000_queuecommand()' and maybe 1 or 2 other places.
......@@ -70,51 +70,8 @@ UPDATE NEWS: version 1.24 - 23 Feb 96
advantage. In a single device system, or if only 1 device
is being accessed, transfers usually go faster if disconnects
are not allowed.
Hackers -> the positions of some of the 'setup_default' flags
have changed, so check your command-line args if
you've been using them with a previous version.
Hi everyone:
A revamped IN2000 SCSI driver is available for download and
testing at my ftp site:
ftp.netcom.com/pub/js/jshiffle
in the 'in2000' directory. It has what I think are a few
improvements over the stock driver, including disconnect/
reselect, synchronous transfer, easier debugging, command-
line arguments for setting run-time parameters and debug
output, and better FIFO handling. Swap partitions work now,
as do tape drives and anything else that used to butt heads
with the old driver's 2k block size limit. See the top
of the 'in2000.c' file for more details.
This is a rewrite of the in2000.[ch] files for Linux. They
are drop-in replacements for the originals in linux/drivers/scsi
- just copy them over the old ones. The driver has been tested
in 1.2.13 with and without ELF, and in the 1.3 series somewhere
up into the 60's. I don't expect any problems with newer kernels.
It is "modular-ised" for those who prefer that route.
------- Hackers take note: ------------------
Anyone who wants to use LILO to pass a command line to this driver
will have to make 2 small changes to the file 'init/main.c'. Find
the area between lines 60-80 where all the 'xxxxx_setup()' extern
declarations are and insert a new one like the following:
extern void in2000_setup(char *str, int *ints);
Then do a search for "bootsetups" - add a new entry to this array
(somewhere in the middle) that looks like this:
#ifdef CONFIG_SCSI_IN2000
{ "in2000=", in2000_setup },
#endif
[You can skip the above if you're only loading the driver as a module
or if the driver defaults are OK.]
The default arguments (you get these when you don't give an 'in2000'
command-line argument, or you give a blank argument) will cause
......@@ -142,30 +99,15 @@ line with the 'period' keyword.
------------------------------------------------
I have run a LOT of tests on this driver, and it seems very solid,
including with up to 3 simultaneous large copy or tar commands
running between 6 devices at once. Synchronous transfers are
working fine for the devices I have to test, although others have
reported some failures (CDROM drives, mostly). Tape drives work
well (finally!) and so do CD-ROM drives.
I should mention that Drew Eckhardt's 'Generic NCR5380' sources
were my main inspiration, with lots of reference to the IN2000
driver currently distributed in the kernel source. I also owe
much to a driver written by Hamish Macdonald for Linux-m68k(!).
And to Eric Wright for being an ALPHA guinea pig. And to Bill
Earnest for 2 tons of great input and information. And to David
Willmore for extensive 'bonnie' testing.
Be forewarned that while I've had good luck with it, this
is the first time it's been loose out in the wide world.
It wouldn't surprise me if people uncover problems that
I haven't caught....
Willmore for extensive 'bonnie' testing. And to Joe Mack for
continual testing and feedback.
Please try the driver out. Test it, beat on it. And PLEASE get back
to me - I really need to hear about bugs, stupid or bad code,
and any ideas for enhancements.
Thanks very much...
John Shifflett jshiffle@netcom.com
......@@ -173,6 +173,14 @@ else
endif
endif
ifeq ($(CONFIG_BINFMT_JAVA),y)
BINFMTS += binfmt_java.o
else
ifeq ($(CONFIG_BINFMT_JAVA),m)
M_OBJS += binfmt_java.o
endif
endif
# binfmt_script is always there
BINFMTS += binfmt_script.o
......
......@@ -128,7 +128,7 @@ affs_fix_link_pred(struct inode *startino, LONG key, LONG newkey)
while (1) {
if (nextkey == 0)
break;
pr_debug("AFFS: find_link_pred(): next key=%d\n", nextkey));
pr_debug("AFFS: find_link_pred(): next key=%d\n", nextkey);
if (!(bh = affs_bread(startino->i_dev,nextkey,AFFS_I2BSIZE(startino))))
break;
if (affs_checksum_block(AFFS_I2BSIZE(startino),bh->b_data,&ptype,&stype)
......
......@@ -603,7 +603,7 @@ affs_rename(struct inode *old_dir, const char *old_name, int old_len,
if (affs_parent_ino(old_inode) != old_dir->i_ino)
goto end_rename;
}
/* Unlink destination if existant */
/* Unlink destination if existent */
if (new_inode) {
if ((retval = affs_fix_hash_pred(new_dir,affs_hash_name(new_name,new_len,
AFFS_I2FSTYPE(new_dir),AFFS_I2HSIZE(new_dir)) + 6,
......
/*
* linux/fs/binfmt_java.c
*
* Copyright (C) 1996 Brian A. Lantz
* derived from binfmt_script.c
*/
#include <linux/module.h>
#include <linux/string.h>
#include <linux/stat.h>
#include <linux/malloc.h>
#include <linux/binfmts.h>
#include <paths.h>
#define _PATH_JAVA "/usr/local/java/bin/java"
#define _PATH_APPLET "/usr/local/java/bin/appletviewer"
#define _PATH_BASH "/bin/bash"
static int do_load_script(struct linux_binprm *bprm,struct pt_regs *regs)
{
char *cp, *interp, *i_name;
int retval;
unsigned char *ucp = (unsigned char *) bprm->buf;
if ((ucp[0] != 0xca) || (ucp[1] != 0xfe) || (ucp[2] != 0xba) || (ucp[3] != 0xbe))
return -ENOEXEC;
iput(bprm->inode);
bprm->dont_iput=1;
/*
* OK, we've set the interpreter name
* Splice in (1) the interpreter's name for argv[0] (_PATH_BASH)
* (2) the name of the java wrapper for argv[1] (_PATH_JAVA)
* (3) filename of Java class (replace argv[0])
* without leading path or trailing '.class'
*
* This is done in reverse order, because of how the
* user environment and arguments are stored.
*/
remove_arg_zero(bprm);
if ((cp = strstr (bprm->filename, ".class")) != NULL)
*cp = 0;
if ((i_name = strrchr (bprm->filename, '/')) != NULL)
i_name++;
else
i_name = bprm->filename;
bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
bprm->argc++;
strcpy (bprm->buf, _PATH_JAVA);
cp = bprm->buf;
bprm->p = copy_strings(1, &cp, bprm->page, bprm->p, 2);
bprm->argc++;
strcpy (bprm->buf, _PATH_BASH);
interp = bprm->buf;
if ((i_name = strrchr (bprm->buf, '/')) != NULL)
i_name++;
else
i_name = bprm->buf;
bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
bprm->argc++;
if (!bprm->p)
return -E2BIG;
/*
* OK, now restart the process with the interpreter's inode.
* Note that we use open_namei() as the name is now in kernel
* space, and we don't need to copy it.
*/
retval = open_namei(interp, 0, 0, &bprm->inode, NULL);
if (retval)
return retval;
bprm->dont_iput=0;
retval=prepare_binprm(bprm);
if(retval<0)
return retval;
return search_binary_handler(bprm,regs);
}
static int do_load_applet(struct linux_binprm *bprm,struct pt_regs *regs)
{
char *cp, *interp, *i_name;
int retval;
if (strncmp (bprm->buf, "<!--applet", 10))
return -ENOEXEC;
iput(bprm->inode);
bprm->dont_iput=1;
/*
* OK, we've set the interpreter name
* Splice in (1) the interpreter's name for argv[0] (_PATH_BSHELL)
* (2) the name of the appletviewer wrapper for argv[1] (_PATH_APPLET)
* (3) filename of html file (replace argv[0])
*
* This is done in reverse order, because of how the
* user environment and arguments are stored.
*/
remove_arg_zero(bprm);
i_name = bprm->filename;
bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
bprm->argc++;
strcpy (bprm->buf, _PATH_APPLET);
cp = bprm->buf;
bprm->p = copy_strings(1, &cp, bprm->page, bprm->p, 2);
bprm->argc++;
strcpy (bprm->buf, _PATH_BSHELL);
interp = bprm->buf;
if ((i_name = strrchr (bprm->buf, '/')) != NULL)
i_name++;
else
i_name = bprm->buf;
bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
bprm->argc++;
if (!bprm->p)
return -E2BIG;
/*
* OK, now restart the process with the interpreter's inode.
* Note that we use open_namei() as the name is now in kernel
* space, and we don't need to copy it.
*/
retval = open_namei(interp, 0, 0, &bprm->inode, NULL);
if (retval)
return retval;
bprm->dont_iput=0;
retval=prepare_binprm(bprm);
if(retval<0)
return retval;
return search_binary_handler(bprm,regs);
}
static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
{
int retval;
MOD_INC_USE_COUNT;
retval = do_load_script(bprm,regs);
MOD_DEC_USE_COUNT;
return retval;
}
struct linux_binfmt java_format = {
#ifndef MODULE
NULL, 0, load_script, NULL, NULL
#else
NULL, &mod_use_count_, load_script, NULL, NULL
#endif
};
static int load_applet(struct linux_binprm *bprm,struct pt_regs *regs)
{
int retval;
MOD_INC_USE_COUNT;
retval = do_load_applet(bprm,regs);
MOD_DEC_USE_COUNT;
return retval;
}
struct linux_binfmt applet_format = {
#ifndef MODULE
NULL, 0, load_applet, NULL, NULL
#else
NULL, &mod_use_count_, load_applet, NULL, NULL
#endif
};
int init_java_binfmt(void) {
printk(KERN_INFO "JAVA Binary support v1.01 for Linux 1.3.98 (C)1996 Brian A. Lantz\n");
register_binfmt(&java_format);
return register_binfmt(&applet_format);
}
#ifdef MODULE
int init_module(void)
{
return init_java_binfmt();
}
void cleanup_module( void) {
printk(KERN_INFO "Removing JAVA Binary support...\n");
unregister_binfmt(&java_format);
unregister_binfmt(&applet_format);
}
#endif
......@@ -70,6 +70,10 @@ void binfmt_setup(void)
#ifdef CONFIG_BINFMT_AOUT
init_aout_binfmt();
#endif
#ifdef CONFIG_BINFMT_JAVA
init_java_binfmt();
#endif
/* This cannot be configured out of the kernel */
init_script_binfmt();
}
......
......@@ -15,16 +15,19 @@ struct buffer_head *fat_bread (
int block)
{
struct buffer_head *ret = NULL;
if (sb->s_blocksize == 512){
/* ret = bread (sb->s_dev,block,512); */
ret = breada (sb->s_dev,block,512,0,18*1024);
}else{
/* struct buffer_head *real = bread (sb->s_dev,block>>1,1024); */
struct buffer_head *real = breada (sb->s_dev,block>>1,1024,0,18*1024);
/* Note that the blocksize is 512 or 1024, but the first read
is always of size 1024. Doing readahead may be counterproductive
or just plain wrong. */
if (sb->s_blocksize == 512) {
ret = bread (sb->s_dev,block,512);
} else {
struct buffer_head *real = bread (sb->s_dev,block>>1,1024);
if (real != NULL){
ret = (struct buffer_head *)kmalloc (sizeof(struct buffer_head)
,GFP_KERNEL);
if (ret != NULL){
ret = (struct buffer_head *)
kmalloc (sizeof(struct buffer_head), GFP_KERNEL);
if (ret != NULL) {
/* #Specification: msdos / strategy / special device / dummy blocks
Many special device (Scsi optical disk for one) use
larger hardware sector size. This allows for higher
......
......@@ -22,26 +22,27 @@ int fat_access(struct super_block *sb,int nr,int new_value)
{
struct buffer_head *bh,*bh2,*c_bh,*c_bh2;
unsigned char *p_first,*p_last;
int first,last,next,copy;
int first,last,next,copy,b;
if ((unsigned) (nr-2) >= MSDOS_SB(sb)->clusters) return 0;
if (MSDOS_SB(sb)->fat_bits == 16) first = last = nr*2;
else {
if ((unsigned) (nr-2) >= MSDOS_SB(sb)->clusters)
return 0;
if (MSDOS_SB(sb)->fat_bits == 16) {
first = last = nr*2;
} else {
first = nr*3/2;
last = first+1;
}
if (!(bh = breada(sb->s_dev,MSDOS_SB(sb)->fat_start+(first >>
SECTOR_BITS),SECTOR_SIZE,0,FAT_READAHEAD))) {
printk("breada in fat_access failed\n");
b = MSDOS_SB(sb)->fat_start + (first >> SECTOR_BITS);
if (!(bh = fat_bread(sb, b))) {
printk("bread in fat_access failed\n");
return 0;
}
if ((first >> SECTOR_BITS) == (last >> SECTOR_BITS))
if ((first >> SECTOR_BITS) == (last >> SECTOR_BITS)) {
bh2 = bh;
else {
if (!(bh2 = breada(sb->s_dev,MSDOS_SB(sb)->fat_start+(last
>> SECTOR_BITS),SECTOR_SIZE,0,FAT_READAHEAD))) {
brelse(bh);
printk("breada in fat_access failed\n");
} else {
if (!(bh2 = fat_bread(sb, b+1))) {
fat_brelse(sb, bh);
printk("2nd bread in fat_access failed\n");
return 0;
}
}
......@@ -72,31 +73,30 @@ int fat_access(struct super_block *sb,int nr,int new_value)
*p_first = new_value & 0xff;
*p_last = (*p_last & 0xf0) | (new_value >> 8);
}
mark_buffer_dirty(bh2, 1);
fat_mark_buffer_dirty(sb, bh2, 1);
}
mark_buffer_dirty(bh, 1);
fat_mark_buffer_dirty(sb, bh, 1);
for (copy = 1; copy < MSDOS_SB(sb)->fats; copy++) {
if (!(c_bh = breada(sb->s_dev,MSDOS_SB(sb)->
fat_start+(first >> SECTOR_BITS)+MSDOS_SB(sb)->
fat_length*copy,SECTOR_SIZE,0,FAT_READAHEAD))) break;
b = MSDOS_SB(sb)->fat_start + (first >> SECTOR_BITS) +
MSDOS_SB(sb)->fat_length * copy;
if (!(c_bh = fat_bread(sb, b)))
break;
memcpy(c_bh->b_data,bh->b_data,SECTOR_SIZE);
mark_buffer_dirty(c_bh, 1);
fat_mark_buffer_dirty(sb, c_bh, 1);
if (bh != bh2) {
if (!(c_bh2 = breada(sb->s_dev,
MSDOS_SB(sb)->fat_start+(first >>
SECTOR_BITS)+MSDOS_SB(sb)->fat_length*copy
+1,SECTOR_SIZE,0,FAT_READAHEAD))) {
brelse(c_bh);
if (!(c_bh2 = fat_bread(sb, b+1))) {
fat_brelse(sb, c_bh);
break;
}
memcpy(c_bh2->b_data,bh2->b_data,SECTOR_SIZE);
brelse(c_bh2);
fat_brelse(sb, c_bh2);
}
brelse(c_bh);
fat_brelse(sb, c_bh);
}
}
brelse(bh);
if (bh != bh2) brelse(bh2);
fat_brelse(sb, bh);
if (bh != bh2)
fat_brelse(sb, bh2);
return next;
}
......
......@@ -295,7 +295,8 @@ int fat_readdirx(
}
ino = fat_get_entry(inode,&filp->f_pos,&bh,&de);
}
if (bh) brelse(bh);
if (bh)
fat_brelse(sb, bh);
if (unicode) {
free_page((unsigned long) unicode);
}
......
......@@ -123,12 +123,12 @@ struct fat_pre {
static void fat_prefetch (
struct inode *inode,
struct fat_pre *pre,
int nb) /* How many must be prefetch at once */
int nb) /* How many must we prefetch at once */
{
struct super_block *sb = inode->i_sb;
struct buffer_head *bhreq[MSDOS_PREFETCH]; /* Buffers not */
/* already read */
int nbreq=0; /* Number of buffers in bhreq */
/* already read */
int nbreq = 0; /* Number of buffers in bhreq */
int i;
for (i=0; i<nb; i++){
int sector = fat_smap(inode,pre->file_sector);
......@@ -136,10 +136,11 @@ static void fat_prefetch (
struct buffer_head *bh;
PRINTK (("fsector2 %d -> %d\n",pre->file_sector-1,sector));
pre->file_sector++;
bh = getblk(inode->i_dev,sector,SECTOR_SIZE);
bh = fat_getblk(sb, sector);
if (bh == NULL) break;
pre->bhlist[pre->nblist++] = bh;
if (!fat_is_uptodate(sb,bh)) bhreq[nbreq++] = bh;
if (!fat_is_uptodate(sb,bh))
bhreq[nbreq++] = bh;
}else{
break;
}
......@@ -229,7 +230,7 @@ int fat_file_read(
wait_on_buffer(bh);
if (!fat_is_uptodate(sb,bh)){
/* read error ? */
brelse (bh);
fat_brelse (sb, bh);
break;
}
offset = filp->f_pos & (SECTOR_SIZE-1);
......@@ -252,12 +253,15 @@ int fat_file_read(
}
}
}
brelse(bh);
fat_brelse(sb, bh);
}
PRINTK (("--- %d -> %d\n",count,(int)(buf-start)));
for (i=0; i<pre.nblist; i++) brelse (pre.bhlist[i]);
if (start == buf) return -EIO;
if (!IS_RDONLY(inode)) inode->i_atime = CURRENT_TIME;
for (i=0; i<pre.nblist; i++)
fat_brelse (sb, pre.bhlist[i]);
if (start == buf)
return -EIO;
if (!IS_RDONLY(inode))
inode->i_atime = CURRENT_TIME;
filp->f_reada = 1; /* Will be reset if a lseek is done */
return buf-start;
}
......@@ -288,14 +292,17 @@ int fat_file_write(
printk("fat_file_write: mode = %07o\n",inode->i_mode);
return -EINVAL;
}
/* system files are immutable */
if (IS_IMMUTABLE(inode)) return -EPERM;
/* system files may be immutable */
if (IS_IMMUTABLE(inode))
return -EPERM;
/*
* ok, append may not work when many processes are writing at the same time
* but so what. That way leads to madness anyway.
*/
if (filp->f_flags & O_APPEND) filp->f_pos = inode->i_size;
if (count <= 0) return 0;
if (filp->f_flags & O_APPEND)
filp->f_pos = inode->i_size;
if (count <= 0)
return 0;
error = carry = 0;
for (start = buf; count || carry; count -= size) {
while (!(sector = fat_smap(inode,filp->f_pos >> SECTOR_BITS)))
......@@ -313,19 +320,18 @@ int fat_file_write(
/* No need to read the block first since we will */
/* completely overwrite it */
/* or at least write past the end of file */
if (!(bh = getblk(inode->i_dev,sector,SECTOR_SIZE))){
if (!(bh = fat_getblk(sb,sector))){
error = -EIO;
break;
}
}else if (!(bh = bread(inode->i_dev,sector,SECTOR_SIZE))) {
} else if (!(bh = fat_bread(sb,sector))) {
error = -EIO;
break;
}
if (binary_mode) {
memcpy_fromfs(bh->b_data+offset,buf,written = size);
buf += size;
}
else {
} else {
written = left = SECTOR_SIZE-offset;
to = (char *) bh->b_data+(filp->f_pos & (SECTOR_SIZE-1));
if (carry) {
......@@ -352,9 +358,9 @@ int fat_file_write(
inode->i_size = filp->f_pos;
inode->i_dirt = 1;
}
fat_set_uptodate(sb,bh,1);
mark_buffer_dirty(bh, 0);
brelse(bh);
fat_set_uptodate(sb, bh, 1);
fat_mark_buffer_dirty(sb, bh, 0);
fat_brelse(sb, bh);
}
if (start == buf)
return error;
......@@ -369,7 +375,8 @@ void fat_truncate(struct inode *inode)
int cluster;
/* Why no return value? Surely the disk could fail... */
if (IS_IMMUTABLE(inode)) return /* -EPERM */;
if (IS_IMMUTABLE(inode))
return /* -EPERM */;
cluster = SECTOR_SIZE*MSDOS_SB(inode->i_sb)->cluster_size;
(void) fat_free(inode,(inode->i_size+(cluster-1))/cluster);
MSDOS_I(inode)->i_attrs |= ATTR_ARCH;
......
......@@ -213,10 +213,10 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
/* The first read is always 1024 bytes */
sb->s_blocksize = 1024;
set_blocksize(sb->s_dev, 1024);
bh = bread(sb->s_dev, 0, 1024);
bh = fat_bread(sb, 0);
unlock_super(sb);
if (bh == NULL || !fat_is_uptodate(sb,bh)) {
brelse (bh);
fat_brelse (sb, bh);
sb->s_dev = 0;
printk("FAT bread failed\n");
MOD_DEC_USE_COUNT;
......@@ -271,15 +271,15 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
MSDOS_MAX_EXTRA || (logical_sector_size & (SECTOR_SIZE-1))
|| !b->secs_track || !b->heads;
}
brelse(bh);
fat_brelse(sb, bh);
/*
This must be done after the brelse because the bh is a dummy
allocated by fat_bread (see buffer.c)
*/
sb->s_blocksize = blksize; /* Using this small block size solve the */
sb->s_blocksize = blksize; /* Using this small block size solves */
/* the misfit with buffer cache and cluster */
/* because cluster (DOS) are often aligned */
/* on odd sector */
/* because clusters (DOS) are often aligned */
/* on odd sectors. */
sb->s_blocksize_bits = blksize == 512 ? 9 : 10;
if (error || debug) {
/* The MSDOS_CAN_BMAP is obsolete, but left just to remember */
......@@ -383,33 +383,31 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
struct msdos_dir_entry *raw_entry;
int nr;
/* printk("read inode %d\n",inode->i_ino); */
MSDOS_I(inode)->i_busy = 0;
MSDOS_I(inode)->i_depend = MSDOS_I(inode)->i_old = NULL;
MSDOS_I(inode)->i_linked = MSDOS_I(inode)->i_oldlink = NULL;
MSDOS_I(inode)->i_binary = 1;
inode->i_uid = MSDOS_SB(inode->i_sb)->options.fs_uid;
inode->i_gid = MSDOS_SB(inode->i_sb)->options.fs_gid;
inode->i_uid = MSDOS_SB(sb)->options.fs_uid;
inode->i_gid = MSDOS_SB(sb)->options.fs_gid;
inode->i_version = ++event;
if (inode->i_ino == MSDOS_ROOT_INO) {
inode->i_mode = (S_IRWXUGO & ~MSDOS_SB(inode->i_sb)->options.fs_umask) |
inode->i_mode = (S_IRWXUGO & ~MSDOS_SB(sb)->options.fs_umask) |
S_IFDIR;
inode->i_op = fs_dir_inode_ops;
inode->i_nlink = fat_subdirs(inode)+2;
/* subdirs (neither . nor ..) plus . and "self" */
inode->i_size = MSDOS_SB(inode->i_sb)->dir_entries*
inode->i_size = MSDOS_SB(sb)->dir_entries*
sizeof(struct msdos_dir_entry);
inode->i_blksize = MSDOS_SB(inode->i_sb)->cluster_size*
inode->i_blksize = MSDOS_SB(sb)->cluster_size*
SECTOR_SIZE;
inode->i_blocks = (inode->i_size+inode->i_blksize-1)/
inode->i_blksize*MSDOS_SB(inode->i_sb)->cluster_size;
inode->i_blksize*MSDOS_SB(sb)->cluster_size;
MSDOS_I(inode)->i_start = 0;
MSDOS_I(inode)->i_attrs = 0;
inode->i_mtime = inode->i_atime = inode->i_ctime = 0;
return;
}
if (!(bh = bread(inode->i_dev,inode->i_ino >> MSDOS_DPB_BITS,
SECTOR_SIZE))) {
if (!(bh = fat_bread(sb, inode->i_ino >> MSDOS_DPB_BITS))) {
printk("dev = %s, ino = %ld\n",
kdevname(inode->i_dev), inode->i_ino);
panic("fat_read_inode: unable to read i-node block");
......@@ -418,7 +416,7 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
[inode->i_ino & (MSDOS_DPB-1)];
if ((raw_entry->attr & ATTR_DIR) && !IS_FREE(raw_entry->name)) {
inode->i_mode = MSDOS_MKMODE(raw_entry->attr,S_IRWXUGO &
~MSDOS_SB(inode->i_sb)->options.fs_umask) | S_IFDIR;
~MSDOS_SB(sb)->options.fs_umask) | S_IFDIR;
inode->i_op = fs_dir_inode_ops;
MSDOS_I(inode)->i_start = CF_LE_W(raw_entry->start);
......@@ -435,7 +433,7 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
while (nr != -1) {
inode->i_size += SECTOR_SIZE*MSDOS_SB(inode->
i_sb)->cluster_size;
if (!(nr = fat_access(inode->i_sb,nr,-1))) {
if (!(nr = fat_access(sb,nr,-1))) {
printk("Directory %ld: bad FAT\n",
inode->i_ino);
break;
......@@ -444,10 +442,10 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
} else { /* not a directory */
inode->i_mode = MSDOS_MKMODE(raw_entry->attr,
((IS_NOEXEC(inode) ||
(MSDOS_SB(inode->i_sb)->options.showexec &&
(MSDOS_SB(sb)->options.showexec &&
!is_exec(raw_entry->ext)))
? S_IRUGO|S_IWUGO : S_IRWXUGO)
& ~MSDOS_SB(inode->i_sb)->options.fs_umask) | S_IFREG;
& ~MSDOS_SB(sb)->options.fs_umask) | S_IFREG;
inode->i_op = (sb->s_blocksize == 1024)
? &fat_file_inode_operations_1024
: &fat_file_inode_operations;
......@@ -456,22 +454,22 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
inode->i_size = CF_LE_L(raw_entry->size);
}
if(raw_entry->attr & ATTR_SYS)
if (MSDOS_SB(inode->i_sb)->options.sys_immutable)
if (MSDOS_SB(sb)->options.sys_immutable)
inode->i_flags |= S_IMMUTABLE;
MSDOS_I(inode)->i_binary = is_binary(MSDOS_SB(inode->i_sb)->options.conversion,
MSDOS_I(inode)->i_binary = is_binary(MSDOS_SB(sb)->options.conversion,
raw_entry->ext);
MSDOS_I(inode)->i_attrs = raw_entry->attr & ATTR_UNUSED;
/* this is as close to the truth as we can get ... */
inode->i_blksize = MSDOS_SB(inode->i_sb)->cluster_size*SECTOR_SIZE;
inode->i_blksize = MSDOS_SB(sb)->cluster_size*SECTOR_SIZE;
inode->i_blocks = (inode->i_size+inode->i_blksize-1)/
inode->i_blksize*MSDOS_SB(inode->i_sb)->cluster_size;
inode->i_blksize*MSDOS_SB(sb)->cluster_size;
inode->i_mtime = inode->i_atime =
date_dos2unix(CF_LE_W(raw_entry->time),CF_LE_W(raw_entry->date));
inode->i_ctime =
MSDOS_SB(inode->i_sb)->options.isvfat
MSDOS_SB(sb)->options.isvfat
? date_dos2unix(CF_LE_W(raw_entry->ctime),CF_LE_W(raw_entry->cdate))
: inode->i_mtime;
brelse(bh);
fat_brelse(sb, bh);
}
......@@ -506,8 +504,7 @@ void fat_write_inode(struct inode *inode)
inode->i_dirt = 0;
if (inode->i_ino == MSDOS_ROOT_INO || !inode->i_nlink) return;
if (!(bh = bread(inode->i_dev,inode->i_ino >> MSDOS_DPB_BITS,
SECTOR_SIZE))) {
if (!(bh = fat_bread(sb, inode->i_ino >> MSDOS_DPB_BITS))) {
printk("dev = %s, ino = %ld\n",
kdevname(inode->i_dev), inode->i_ino);
panic("msdos_write_inode: unable to read i-node block");
......@@ -533,29 +530,30 @@ void fat_write_inode(struct inode *inode)
raw_entry->ctime = CT_LE_W(raw_entry->ctime);
raw_entry->cdate = CT_LE_W(raw_entry->cdate);
}
mark_buffer_dirty(bh, 1);
brelse(bh);
fat_mark_buffer_dirty(sb, bh, 1);
fat_brelse(sb, bh);
}
int fat_notify_change(struct inode * inode,struct iattr * attr)
{
struct super_block *sb = inode->i_sb;
int error;
error = inode_change_ok(inode, attr);
if (error)
return MSDOS_SB(inode->i_sb)->options.quiet ? 0 : error;
return MSDOS_SB(sb)->options.quiet ? 0 : error;
if (((attr->ia_valid & ATTR_UID) &&
(attr->ia_uid != MSDOS_SB(inode->i_sb)->options.fs_uid)) ||
(attr->ia_uid != MSDOS_SB(sb)->options.fs_uid)) ||
((attr->ia_valid & ATTR_GID) &&
(attr->ia_gid != MSDOS_SB(inode->i_sb)->options.fs_gid)) ||
(attr->ia_gid != MSDOS_SB(sb)->options.fs_gid)) ||
((attr->ia_valid & ATTR_MODE) &&
(attr->ia_mode & ~MSDOS_VALID_MODE)))
error = -EPERM;
if (error)
return MSDOS_SB(inode->i_sb)->options.quiet ? 0 : error;
return MSDOS_SB(sb)->options.quiet ? 0 : error;
inode_setattr(inode, attr);
......@@ -565,8 +563,8 @@ int fat_notify_change(struct inode * inode,struct iattr * attr)
inode->i_mode |= S_IXUGO;
inode->i_mode = ((inode->i_mode & S_IFMT) | ((((inode->i_mode & S_IRWXU
& ~MSDOS_SB(inode->i_sb)->options.fs_umask) | S_IRUSR) >> 6)*S_IXUGO)) &
~MSDOS_SB(inode->i_sb)->options.fs_umask;
& ~MSDOS_SB(sb)->options.fs_umask) | S_IRUSR) >> 6)*S_IXUGO)) &
~MSDOS_SB(sb)->options.fs_umask;
return 0;
}
......
......@@ -118,35 +118,34 @@ int fat_add_cluster(struct inode *inode)
struct super_block *sb = inode->i_sb;
int count,nr,limit,last,curr,sector,last_sector,file_cluster;
struct buffer_head *bh;
int cluster_size = MSDOS_SB(inode->i_sb)->cluster_size;
int cluster_size = MSDOS_SB(sb)->cluster_size;
if (inode->i_ino == MSDOS_ROOT_INO) return -ENOSPC;
if (!MSDOS_SB(inode->i_sb)->free_clusters) return -ENOSPC;
lock_fat(inode->i_sb);
limit = MSDOS_SB(inode->i_sb)->clusters;
if (!MSDOS_SB(sb)->free_clusters) return -ENOSPC;
lock_fat(sb);
limit = MSDOS_SB(sb)->clusters;
nr = limit; /* to keep GCC happy */
for (count = 0; count < limit; count++) {
nr = ((count+MSDOS_SB(inode->i_sb)->prev_free) % limit)+2;
if (fat_access(inode->i_sb,nr,-1) == 0) break;
nr = ((count+MSDOS_SB(sb)->prev_free) % limit)+2;
if (fat_access(sb,nr,-1) == 0) break;
}
PRINTK (("cnt = %d --",count));
#ifdef DEBUG
printk("free cluster: %d\n",nr);
#endif
MSDOS_SB(inode->i_sb)->prev_free = (count+MSDOS_SB(inode->i_sb)->
prev_free+1) % limit;
MSDOS_SB(sb)->prev_free = (count+MSDOS_SB(sb)->prev_free+1) % limit;
if (count >= limit) {
MSDOS_SB(inode->i_sb)->free_clusters = 0;
unlock_fat(inode->i_sb);
MSDOS_SB(sb)->free_clusters = 0;
unlock_fat(sb);
return -ENOSPC;
}
fat_access(inode->i_sb,nr,MSDOS_SB(inode->i_sb)->fat_bits == 12 ?
fat_access(sb,nr,MSDOS_SB(sb)->fat_bits == 12 ?
0xff8 : 0xfff8);
if (MSDOS_SB(inode->i_sb)->free_clusters != -1)
MSDOS_SB(inode->i_sb)->free_clusters--;
unlock_fat(inode->i_sb);
if (MSDOS_SB(sb)->free_clusters != -1)
MSDOS_SB(sb)->free_clusters--;
unlock_fat(sb);
#ifdef DEBUG
printk("set to %x\n",fat_access(inode->i_sb,nr,-1));
printk("set to %x\n",fat_access(sb,nr,-1));
#endif
last = 0;
/* We must locate the last cluster of the file to add this
......@@ -166,9 +165,9 @@ printk("set to %x\n",fat_access(inode->i_sb,nr,-1));
while (curr && curr != -1){
PRINTK (("."));
file_cluster++;
if (!(curr = fat_access(inode->i_sb,
if (!(curr = fat_access(sb,
last = curr,-1))) {
fat_fs_panic(inode->i_sb,"File without EOF");
fat_fs_panic(sb,"File without EOF");
return -ENOSPC;
}
}
......@@ -177,27 +176,27 @@ printk("set to %x\n",fat_access(inode->i_sb,nr,-1));
#ifdef DEBUG
printk("last = %d\n",last);
#endif
if (last) fat_access(inode->i_sb,last,nr);
if (last) fat_access(sb,last,nr);
else {
MSDOS_I(inode)->i_start = nr;
inode->i_dirt = 1;
}
#ifdef DEBUG
if (last) printk("next set to %d\n",fat_access(inode->i_sb,last,-1));
if (last) printk("next set to %d\n",fat_access(sb,last,-1));
#endif
sector = MSDOS_SB(inode->i_sb)->data_start+(nr-2)*cluster_size;
sector = MSDOS_SB(sb)->data_start+(nr-2)*cluster_size;
last_sector = sector + cluster_size;
for ( ; sector < last_sector; sector++) {
#ifdef DEBUG
printk("zeroing sector %d\n",sector);
#endif
if (!(bh = getblk(inode->i_dev,sector,SECTOR_SIZE)))
if (!(bh = fat_getblk(sb, sector)))
printk("getblk failed\n");
else {
memset(bh->b_data,0,SECTOR_SIZE);
fat_set_uptodate(sb,bh,1);
mark_buffer_dirty(bh, 1);
brelse(bh);
fat_set_uptodate(sb, bh, 1);
fat_mark_buffer_dirty(sb, bh, 1);
fat_brelse(sb, bh);
}
}
if (file_cluster != inode->i_blocks/cluster_size){
......@@ -209,7 +208,7 @@ if (last) printk("next set to %d\n",fat_access(inode->i_sb,last,-1));
inode->i_blocks += cluster_size;
if (S_ISDIR(inode->i_mode)) {
if (inode->i_size & (SECTOR_SIZE-1)) {
fat_fs_panic(inode->i_sb,"Odd directory size");
fat_fs_panic(sb,"Odd directory size");
inode->i_size = (inode->i_size+SECTOR_SIZE) &
~(SECTOR_SIZE-1);
}
......@@ -284,7 +283,7 @@ int fat_get_entry(struct inode *dir, loff_t *pos,struct buffer_head **bh,
struct msdos_dir_entry **de)
{
struct super_block *sb = dir->i_sb;
int sector,offset;
int sector, offset;
while (1) {
offset = *pos;
......@@ -296,9 +295,9 @@ int fat_get_entry(struct inode *dir, loff_t *pos,struct buffer_head **bh,
return -1; /* beyond EOF */
*pos += sizeof(struct msdos_dir_entry);
if (*bh)
brelse(*bh);
fat_brelse(sb, *bh);
PRINTK (("get_entry sector apres brelse\n"));
if (!(*bh = breada(dir->i_dev,sector,SECTOR_SIZE,0,FAT_READAHEAD))) {
if (!(*bh = fat_bread(sb, sector))) {
printk("Directory sread (sector %d) failed\n",sector);
continue;
}
......@@ -372,7 +371,8 @@ static int raw_scan_sector(struct super_block *sb,int sector,const char *name,
struct inode *inode;
int entry,start,done;
if (!(bh = breada(sb->s_dev,sector,SECTOR_SIZE,0,FAT_READAHEAD))) return -EIO;
if (!(bh = fat_bread(sb,sector)))
return -EIO;
data = (struct msdos_dir_entry *) bh->b_data;
for (entry = 0; entry < MSDOS_DPS; entry++) {
/* RSS_COUNT: if (data[entry].name == name) done=true else done=false. */
......@@ -393,7 +393,8 @@ static int raw_scan_sector(struct super_block *sb,int sector,const char *name,
if (done) {
if (ino) *ino = sector*MSDOS_DPS+entry;
start = CF_LE_W(data[entry].start);
if (!res_bh) brelse(bh);
if (!res_bh)
fat_brelse(sb, bh);
else {
*res_bh = bh;
*res_de = &data[entry];
......@@ -401,7 +402,7 @@ static int raw_scan_sector(struct super_block *sb,int sector,const char *name,
return start;
}
}
brelse(bh);
fat_brelse(sb, bh);
return -ENOENT;
}
......
......@@ -13,24 +13,3 @@ void fat_set_uptodate (struct super_block *sb,
int fat_is_uptodate (struct super_block *sb, struct buffer_head *bh);
void fat_ll_rw_block (struct super_block *sb, int opr,
int nbreq, struct buffer_head *bh[32]);
/* These macros exist to avoid modifying all the code */
/* They should be removed one day I guess */
/* The versioning mechanism of the modules system defines those macros */
/* This removes some warnings */
#ifdef brelse
#undef brelse
#endif
#ifdef bread
#undef bread
#endif
#ifdef getblk
#undef getblk
#endif
#define brelse(b) fat_brelse(sb,b)
#define bread(d,b,s) fat_bread(sb,b)
#define getblk(d,b,s) fat_getblk(sb,b)
#define mark_buffer_dirty(b,v) fat_mark_buffer_dirty(sb,b,v)
......@@ -216,9 +216,9 @@ int msdos_lookup(struct inode *dir,const char *name,int len,
return res;
}
PRINTK (("msdos_lookup 4\n"));
if (bh) brelse(bh);
if (bh)
fat_brelse(sb, bh);
PRINTK (("msdos_lookup 4.5\n"));
/* printk("lookup: ino=%d\n",ino); */
if (!(*result = iget(dir->i_sb,ino))) {
iput(dir);
return -EACCES;
......@@ -279,10 +279,10 @@ static int msdos_create_entry(struct inode *dir, const char *name,int len,
de->start = 0;
fat_date_unix2dos(dir->i_mtime,&de->time,&de->date);
de->size = 0;
mark_buffer_dirty(bh, 1);
fat_mark_buffer_dirty(sb, bh, 1);
if ((*result = iget(dir->i_sb,ino)) != NULL)
msdos_read_inode(*result);
brelse(bh);
fat_brelse(sb, bh);
if (!*result) return -EIO;
(*result)->i_mtime = (*result)->i_atime = (*result)->i_ctime =
CURRENT_TIME;
......@@ -316,13 +316,13 @@ int msdos_create(struct inode *dir,const char *name,int len,int mode,
*/
if (fat_scan(dir,msdos_name,&bh,&de,&ino,SCAN_HID) >= 0) {
fat_unlock_creation();
brelse(bh);
fat_brelse(sb, bh);
iput(dir);
return is_hid ? -EEXIST : -EINVAL;
}
if (fat_scan(dir,msdos_name,&bh,&de,&ino,SCAN_NOTHID) >= 0) {
fat_unlock_creation();
brelse(bh);
fat_brelse(sb, bh);
iput(dir);
return is_hid ? -EINVAL : -EEXIST;
}
......@@ -370,11 +370,11 @@ static int msdos_empty(struct inode *dir)
if (!IS_FREE(de->name) && strncmp(de->name,MSDOS_DOT,
MSDOS_NAME) && strncmp(de->name,MSDOS_DOTDOT,
MSDOS_NAME)) {
brelse(bh);
fat_brelse(sb, bh);
return -ENOTEMPTY;
}
if (bh)
brelse(bh);
fat_brelse(sb, bh);
}
return 0;
}
......@@ -409,10 +409,10 @@ int msdos_rmdir(struct inode *dir,const char *name,int len)
dir->i_nlink--;
inode->i_dirt = dir->i_dirt = 1;
de->name[0] = DELETED_FLAG;
mark_buffer_dirty(bh, 1);
fat_mark_buffer_dirty(sb, bh, 1);
res = 0;
rmdir_done:
brelse(bh);
fat_brelse(sb, bh);
iput(dir);
iput(inode);
return res;
......@@ -438,7 +438,7 @@ int msdos_mkdir(struct inode *dir,const char *name,int len,int mode)
fat_lock_creation();
if (fat_scan(dir,msdos_name,&bh,&de,&ino,SCAN_ANY) >= 0) {
fat_unlock_creation();
brelse(bh);
fat_brelse(sb, bh);
iput(dir);
return -EEXIST;
}
......@@ -513,9 +513,9 @@ static int msdos_unlinkx(
MSDOS_I(inode)->i_busy = 1;
inode->i_dirt = dir->i_dirt = 1;
de->name[0] = DELETED_FLAG;
mark_buffer_dirty(bh, 1);
fat_mark_buffer_dirty(sb, bh, 1);
unlink_done:
brelse(bh);
fat_brelse(sb, bh);
iput(inode);
iput(dir);
return res;
......@@ -548,12 +548,13 @@ static int rename_same_dir(struct inode *old_dir,char *old_name,int old_len,
if (!strncmp(old_name,new_name,MSDOS_NAME)) goto set_hid;
exists = fat_scan(new_dir,new_name,&new_bh,&new_de,&new_ino,SCAN_ANY) >= 0;
if (*(unsigned char *) old_de->name == DELETED_FLAG) {
if (exists) brelse(new_bh);
if (exists)
fat_brelse(sb, new_bh);
return -ENOENT;
}
if (exists) {
if (!(new_inode = iget(new_dir->i_sb,new_ino))) {
brelse(new_bh);
fat_brelse(sb, new_bh);
return -EIO;
}
error = S_ISDIR(new_inode->i_mode)
......@@ -566,7 +567,7 @@ static int rename_same_dir(struct inode *old_dir,char *old_name,int old_len,
if (!error && (old_de->attr & ATTR_SYS)) error = -EPERM;
if (error) {
iput(new_inode);
brelse(new_bh);
fat_brelse(sb, new_bh);
return error;
}
if (S_ISDIR(new_inode->i_mode)) {
......@@ -577,17 +578,17 @@ static int rename_same_dir(struct inode *old_dir,char *old_name,int old_len,
MSDOS_I(new_inode)->i_busy = 1;
new_inode->i_dirt = 1;
new_de->name[0] = DELETED_FLAG;
mark_buffer_dirty(new_bh, 1);
fat_mark_buffer_dirty(sb, new_bh, 1);
dcache_add(new_dir, new_name, new_len, new_ino);
iput(new_inode);
brelse(new_bh);
fat_brelse(sb, new_bh);
}
memcpy(old_de->name,new_name,MSDOS_NAME);
set_hid:
old_de->attr = is_hid
? (old_de->attr | ATTR_HIDDEN)
: (old_de->attr &~ ATTR_HIDDEN);
mark_buffer_dirty(old_bh, 1);
fat_mark_buffer_dirty(sb, old_bh, 1);
/* update binary info for conversion, i_attrs */
if ((old_inode = iget(old_dir->i_sb,old_ino)) != NULL) {
MSDOS_I(old_inode)->i_attrs = is_hid
......@@ -632,21 +633,23 @@ static int rename_diff_dir(struct inode *old_dir,char *old_name,int old_len,
}
exists = fat_scan(new_dir,new_name,&new_bh,&new_de,&new_ino,SCAN_ANY) >= 0;
if (!(old_inode = iget(old_dir->i_sb,old_ino))) {
brelse(free_bh);
if (exists) brelse(new_bh);
fat_brelse(sb, free_bh);
if (exists)
fat_brelse(sb, new_bh);
return -EIO;
}
if (*(unsigned char *) old_de->name == DELETED_FLAG) {
iput(old_inode);
brelse(free_bh);
if (exists) brelse(new_bh);
fat_brelse(sb, free_bh);
if (exists)
fat_brelse(sb, new_bh);
return -ENOENT;
}
new_inode = NULL; /* to make GCC happy */
if (exists) { /* Trash the old file! */
if (!(new_inode = iget(new_dir->i_sb,new_ino))) {
iput(old_inode);
brelse(new_bh);
fat_brelse(sb, new_bh);
return -EIO;
}
error = S_ISDIR(new_inode->i_mode)
......@@ -660,14 +663,14 @@ static int rename_diff_dir(struct inode *old_dir,char *old_name,int old_len,
if (error) {
iput(new_inode);
iput(old_inode);
brelse(new_bh);
fat_brelse(sb, new_bh);
return error;
}
new_inode->i_nlink = 0;
MSDOS_I(new_inode)->i_busy = 1;
new_inode->i_dirt = 1;
new_de->name[0] = DELETED_FLAG;
mark_buffer_dirty(new_bh, 1);
fat_mark_buffer_dirty(sb, new_bh, 1);
}
memcpy(free_de,old_de,sizeof(struct msdos_dir_entry));
memcpy(free_de->name,new_name,MSDOS_NAME);
......@@ -677,10 +680,10 @@ static int rename_diff_dir(struct inode *old_dir,char *old_name,int old_len,
if (!(free_inode = iget(new_dir->i_sb,free_ino))) {
free_de->name[0] = DELETED_FLAG;
/* Don't mark free_bh as dirty. Both states are supposed to be equivalent. */
brelse(free_bh);
fat_brelse(sb, free_bh);
if (exists) {
iput(new_inode);
brelse(new_bh);
fat_brelse(sb, new_bh);
}
return -EIO;
}
......@@ -695,8 +698,8 @@ static int rename_diff_dir(struct inode *old_dir,char *old_name,int old_len,
fat_cache_inval_inode(old_inode);
old_inode->i_dirt = 1;
old_de->name[0] = DELETED_FLAG;
mark_buffer_dirty(old_bh, 1);
mark_buffer_dirty(free_bh, 1);
fat_mark_buffer_dirty(sb, old_bh, 1);
fat_mark_buffer_dirty(sb, free_bh, 1);
if (exists) {
MSDOS_I(new_inode)->i_depend = free_inode;
MSDOS_I(free_inode)->i_old = new_inode;
......@@ -705,30 +708,30 @@ static int rename_diff_dir(struct inode *old_dir,char *old_name,int old_len,
/* free_inode is put after putting new_inode and old_inode */
iput(new_inode);
dcache_add(new_dir, new_name, new_len, new_ino);
brelse(new_bh);
fat_brelse(sb, new_bh);
}
if (S_ISDIR(old_inode->i_mode)) {
if ((error = fat_scan(old_inode,MSDOS_DOTDOT,&dotdot_bh,
&dotdot_de,&dotdot_ino,SCAN_ANY)) < 0) goto rename_done;
if (!(dotdot_inode = iget(old_inode->i_sb,dotdot_ino))) {
brelse(dotdot_bh);
fat_brelse(sb, dotdot_bh);
error = -EIO;
goto rename_done;
}
dotdot_de->start = MSDOS_I(dotdot_inode)->i_start =
MSDOS_I(new_dir)->i_start;
dotdot_inode->i_dirt = 1;
mark_buffer_dirty(dotdot_bh, 1);
fat_mark_buffer_dirty(sb, dotdot_bh, 1);
old_dir->i_nlink--;
new_dir->i_nlink++;
/* no need to mark them dirty */
dotdot_inode->i_nlink = new_dir->i_nlink;
iput(dotdot_inode);
brelse(dotdot_bh);
fat_brelse(sb, dotdot_bh);
}
error = 0;
rename_done:
brelse(free_bh);
fat_brelse(sb, free_bh);
iput(old_inode);
return error;
}
......@@ -763,7 +766,7 @@ int msdos_rename(struct inode *old_dir,const char *old_name,int old_len,
else error = rename_diff_dir(old_dir,old_msdos_name,old_len,new_dir,
new_msdos_name,new_len,old_bh,old_de,old_ino,is_hid);
fat_unlock_creation();
brelse(old_bh);
fat_brelse(sb, old_bh);
rename_done:
iput(old_dir);
iput(new_dir);
......
......@@ -573,7 +573,7 @@ static loff_t vfat_find_free_slots(struct inode *dir,int slots)
if (done) {
row++;
if (row == slots) {
brelse(bh);
fat_brelse(sb, bh);
/* printk("----- Free offset at %d\n", offset); */
return offset;
}
......@@ -868,7 +868,7 @@ static int vfat_find(struct inode *dir,const char *name,int len,
return sinfo_out->ino;
}
memcpy(de, ps, sizeof(struct msdos_dir_slot));
mark_buffer_dirty(bh, 1);
fat_mark_buffer_dirty(sb, bh, 1);
}
PRINTK(("vfat_find: create file 4\n"));
......@@ -888,8 +888,8 @@ static int vfat_find(struct inode *dir,const char *name,int len,
de->lcase = CASE_LOWER_BASE | CASE_LOWER_EXT;
mark_buffer_dirty(bh, 1);
brelse(bh);
fat_mark_buffer_dirty(sb, bh, 1);
fat_brelse(sb, bh);
sinfo_out->is_long = (slots > 1) ? 1 : 0;
if (sinfo_out->is_long) {
......@@ -999,15 +999,17 @@ static int vfat_create_entry(struct inode *dir,const char *name,int len,
ino = fat_get_entry(dir, &offset, &bh, &de);
if (ino < 0) {
PRINTK(("vfat_mkdir problem\n"));
if (bh) brelse(bh);
if (bh)
fat_brelse(sb, bh);
return ino;
}
PRINTK(("vfat_create_entry 3\n"));
if ((*result = iget(dir->i_sb,ino)) != NULL)
vfat_read_inode(*result);
brelse(bh);
if (!*result) return -EIO;
fat_brelse(sb, bh);
if (!*result)
return -EIO;
(*result)->i_mtime = (*result)->i_atime = (*result)->i_ctime =
CURRENT_TIME;
(*result)->i_dirt = 1;
......@@ -1058,7 +1060,7 @@ static int vfat_create_a_dotdir(struct inode *dir,struct inode *parent,
de->ctime = de->time;
de->adate = de->cdate = de->date;
de->size = 0;
mark_buffer_dirty(bh, 1);
fat_mark_buffer_dirty(sb, bh, 1);
if ((dot = iget(dir->i_sb,ino)) != NULL)
vfat_read_inode(dot);
if (!dot) return -EIO;
......@@ -1100,20 +1102,20 @@ static int vfat_create_dotdirs(struct inode *dir, struct inode *parent)
res = vfat_create_a_dotdir(dir, parent, bh, de, res, MSDOS_DOT, 1);
PRINTK(("vfat_create_dotdirs 4\n"));
if (res < 0) {
brelse(bh);
fat_brelse(sb, bh);
return res;
}
PRINTK(("vfat_create_dotdirs 5\n"));
if ((res = fat_get_entry(dir,&offset,&bh,&de)) < 0) {
brelse(bh);
fat_brelse(sb, bh);
return res;
}
PRINTK(("vfat_create_dotdirs 6\n"));
res = vfat_create_a_dotdir(dir, parent, bh, de, res, MSDOS_DOTDOT, 0);
PRINTK(("vfat_create_dotdirs 7\n"));
brelse(bh);
fat_brelse(sb, bh);
return res;
}
......@@ -1138,12 +1140,12 @@ static int vfat_empty(struct inode *dir)
if (!IS_FREE(de->name) && strncmp(de->name,MSDOS_DOT,
MSDOS_NAME) && strncmp(de->name,MSDOS_DOTDOT,
MSDOS_NAME)) {
brelse(bh);
fat_brelse(sb, bh);
return -ENOTEMPTY;
}
}
if (bh)
brelse(bh);
fat_brelse(sb, bh);
}
return 0;
}
......@@ -1176,7 +1178,7 @@ static int vfat_rmdir_free_ino(struct inode *dir,struct buffer_head *bh,
dir->i_nlink--;
inode->i_dirt = dir->i_dirt = 1;
de->name[0] = DELETED_FLAG;
mark_buffer_dirty(bh, 1);
fat_mark_buffer_dirty(sb, bh, 1);
iput(inode);
return 0;
......@@ -1199,7 +1201,7 @@ static int vfat_unlink_free_ino(struct inode *dir,struct buffer_head *bh,
MSDOS_I(inode)->i_busy = 1;
inode->i_dirt = dir->i_dirt = 1;
de->name[0] = DELETED_FLAG;
mark_buffer_dirty(bh, 1);
fat_mark_buffer_dirty(sb, bh, 1);
iput(inode);
return 0;
......@@ -1234,7 +1236,7 @@ static int vfat_remove_entry(struct inode *dir,struct slot_info *sinfo,
}
(*de)->name[0] = DELETED_FLAG;
(*de)->attr = 0;
mark_buffer_dirty(*bh, 1);
fat_mark_buffer_dirty(sb, *bh, 1);
}
return 0;
}
......@@ -1265,7 +1267,7 @@ static int vfat_rmdirx(struct inode *dir,const char *name,int len)
dir->i_version = ++event;
rmdir_done:
brelse(bh);
fat_brelse(sb, bh);
return res;
}
......@@ -1305,7 +1307,7 @@ static int vfat_unlinkx(
}
unlink_done:
brelse(bh);
fat_brelse(sb, bh);
return res;
}
......@@ -1489,11 +1491,11 @@ int vfat_rename(struct inode *old_dir,const char *old_name,int old_len,
}
old_de->name[0] = DELETED_FLAG;
old_de->attr = 0;
mark_buffer_dirty(old_bh, 1);
fat_mark_buffer_dirty(sb, old_bh, 1);
}
PRINTK(("vfat_rename 15b\n"));
mark_buffer_dirty(new_bh, 1);
fat_mark_buffer_dirty(sb, new_bh, 1);
dcache_add(new_dir, new_name, new_len, new_ino);
/* XXX: There is some code in the original MSDOS rename that
......@@ -1505,29 +1507,33 @@ int vfat_rename(struct inode *old_dir,const char *old_name,int old_len,
if ((res = fat_scan(old_inode,MSDOS_DOTDOT,&dotdot_bh,
&dotdot_de,&dotdot_ino,SCAN_ANY)) < 0) goto rename_done;
if (!(dotdot_inode = iget(old_inode->i_sb,dotdot_ino))) {
brelse(dotdot_bh);
fat_brelse(sb, dotdot_bh);
res = -EIO;
goto rename_done;
}
dotdot_de->start = MSDOS_I(dotdot_inode)->i_start =
MSDOS_I(new_dir)->i_start;
dotdot_inode->i_dirt = 1;
mark_buffer_dirty(dotdot_bh, 1);
fat_mark_buffer_dirty(sb, dotdot_bh, 1);
old_dir->i_nlink--;
new_dir->i_nlink++;
/* no need to mark them dirty */
dotdot_inode->i_nlink = new_dir->i_nlink;
iput(dotdot_inode);
brelse(dotdot_bh);
fat_brelse(sb, dotdot_bh);
}
if (res > 0) res = 0;
rename_done:
if (locked) fat_unlock_creation();
if (old_bh) brelse(old_bh);
if (new_bh) brelse(new_bh);
if (old_inode) iput(old_inode);
if (locked)
fat_unlock_creation();
if (old_bh)
fat_brelse(sb, old_bh);
if (new_bh)
fat_brelse(sb, new_bh);
if (old_inode)
iput(old_inode);
iput(old_dir);
iput(new_dir);
return res;
......
......@@ -124,6 +124,7 @@ struct termios {
#define B57600 00020
#define B115200 00021
#define B230400 00022
#define B460800 00023
#define CSIZE 00001400
#define CS5 00000000
......
......@@ -7,6 +7,9 @@
#ifndef __ASM_I386_PROCESSOR_H
#define __ASM_I386_PROCESSOR_H
#include <asm/vm86.h>
#include <asm/math_emu.h>
/*
* System setup and hardware bug flags..
* [Note we don't test the 386 multiply bug or popad bug]
......
......@@ -120,6 +120,7 @@ struct termios {
#define B57600 0010001
#define B115200 0010002
#define B230400 0010003
#define B460800 0010004
#define CIBAUD 002003600000 /* input baud rate (not used) */
#define CRTSCTS 020000000000 /* flow control */
......
......@@ -231,7 +231,7 @@ struct async_struct {
boards carrying several UART's,
like some Amiga boards. */
unsigned short nr_uarts; /* UART-counter, that indicates
how manu UART's there are on
how many UART's there are on
the board. If the board has a
IRQ-register, this can be used
to check if any of the uarts,
......
......@@ -121,6 +121,7 @@ struct termios {
#define B57600 0010001
#define B115200 0010002
#define B230400 0010003
#define B460800 0010004
#define CIBAUD 002003600000 /* input baud rate (not used) */
#define CRTSCTS 020000000000 /* flow control */
......
......@@ -232,6 +232,7 @@
#define B57600 0010001
#define B115200 0010002
#define B230400 0010003
#define B460800 0010004
#define CIBAUD 002003600000 /* input baud rate (not used) */
#define CRTSCTS 020000000000 /* flow control */
#endif
......
......@@ -268,6 +268,7 @@ struct termios {
#define B57600 00020
#define B115200 00021
#define B230400 00022
#define B460800 00023
#define CSIZE 00001400
#define CS5 00000000
......
......@@ -66,6 +66,8 @@ static struct sun_floppy_ops sun_fdops;
#define fd_cacheflush(addr, size) /* nothing... */
#define fd_request_irq() sun_fd_request_irq()
#define fd_free_irq() /* nothing... */
#define fd_dma_mem_alloc(size) ((unsigned long) vmalloc(size))
#define fd_dma_mem_free(addr,size) (vfree((void *)(addr)))
#define FLOPPY_MOTOR_MASK 0x10
......
......@@ -134,6 +134,7 @@ struct termios {
#define B57600 0x00010001
#define B115200 0x00010002
#define B230400 0x00010003
#define B460800 0x00010004
#define CIBAUD 0x000f0000 /* input baud rate (not used) */
#define CRTSCTS 0x80000000 /* flow control */
......
......@@ -43,9 +43,9 @@ struct affs_sb_info {
int s_bm_count; /* Number of bitmap blocks. */
int s_nextzone; /* Next zone to look for free blocks. */
int s_num_zones; /* Total number of zones. */
struct affs_zone *s_zones; /* The zones themselfes. */
struct affs_zone *s_zones; /* The zones themselves. */
char *s_zonemap; /* Bitmap for zones. */
char *s_prefix; /* Prefix for volumes and assignes. */
char *s_prefix; /* Prefix for volumes and assigns. */
int s_prefix_len; /* Length of prefix. */
char s_volume[32]; /* Volume prefix for absolute symlinks. */
};
......
......@@ -25,7 +25,7 @@
#elif defined(__BIG_ENDIAN)
#define BO_EXBITS 0x00UL
#else
#error Endianess must be known for affs to work.
#error Endianness must be known for affs to work.
#endif
/* The following constants will be checked against the values read native */
......
......@@ -49,6 +49,7 @@ extern int open_inode(struct inode * inode, int mode);
extern int init_elf_binfmt(void);
extern int init_aout_binfmt(void);
extern int init_script_binfmt(void);
extern int init_java_binfmt(void);
extern int prepare_binprm(struct linux_binprm *);
extern void remove_arg_zero(struct linux_binprm *);
......
......@@ -278,6 +278,12 @@ struct cdrom_multisession
#define CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */
/*
* For controlling a changer. (Used by ATAPI driver.)
*/
#define CDROMLOADFROMSLOT 0x531a /* LOAD disk from slot*/
/*
* CD-ROM-specific SCSI command opcodes
*/
......
......@@ -10,7 +10,23 @@
#define KERNELD_BLANKER 7 /* from drivers/char/console.c */
#define KERNELD_ARP 256 /* from net/ipv4/arp.c */
/*
* Uncomment the following line for the new kerneld protocol
* This includes the pid of the kernel level requestor into the kerneld header
*/
/*
#define NEW_KERNELD_PROTOCOL
*/
#ifdef NEW_KERNELD_PROTOCOL
#define OLDIPC_KERNELD 00040000 /* use the kerneld message channel */
#define IPC_KERNELD 00140000 /* use the kerneld message channel, new protocol */
#define KDHDR (sizeof(long) + sizeof(short) + sizeof(short))
#define NULL_KDHDR 0, 2, 0
#else
#define IPC_KERNELD 00040000 /* use the kerneld message channel */
#define KDHDR (sizeof(long))
#define NULL_KDHDR 0
#endif
#define KERNELD_MAXCMD 0x7ffeffff
#define KERNELD_MINSEQ 0x7fff0000 /* "commands" legal up to 0x7ffeffff */
#define KERNELD_WAIT 0x80000000
......@@ -19,6 +35,10 @@
struct kerneld_msg {
long mtype;
long id;
#ifdef NEW_KERNELD_PROTOCOL
short version;
short pid;
#endif
#ifdef __KERNEL__
char *text;
#else
......
......@@ -60,6 +60,7 @@ struct msg {
struct msg *msg_next; /* next message on queue */
long msg_type;
char *msg_spot; /* message text address */
time_t msg_stime; /* msgsnd time */
short msg_ts; /* message text size */
};
......
......@@ -7,28 +7,30 @@
#ifndef _LINUX_RANDOM_H
#define _LINUX_RANDOM_H
#include <linux/ioctl.h>
/* ioctl()'s for the random number generator */
/* Get the entropy count. */
#define RNDGETENTCNT 0x01080000
#define RNDGETENTCNT _IOR( 'R', 0x00, int )
/* Add to (or subtract from) the entropy count. (Superuser only.) */
#define RNDADDTOENTCNT 0x01080001
#define RNDADDTOENTCNT _IOW( 'R', 0x01, int )
/* Get the contents of the entropy pool. (Superuser only.) */
#define RNDGETPOOL 0x01080002
#define RNDGETPOOL _IOR( 'R', 0x02, int [2] )
/*
* Write bytes into the entropy pool and add to the entropy count.
* (Superuser only.)
*/
#define RNDADDENTROPY 0x01080003
#define RNDADDENTROPY _IOW( 'R', 0x03, int [2] )
/* Clear entropy count to 0. (Superuser only.) */
#define RNDZAPENTCNT 0x01080004
#define RNDZAPENTCNT _IO( 'R', 0x04 )
/* Clear the entropy pool and associated counters. (Superuser only.) */
#define RNDCLEARPOOL 0x01080006
#define RNDCLEARPOOL _IO( 'R', 0x06 )
struct rand_pool_info {
int entropy_count;
......
......@@ -74,8 +74,6 @@ extern int last_pid;
#include <linux/time.h>
#include <linux/param.h>
#include <linux/resource.h>
#include <linux/vm86.h>
#include <linux/math_emu.h>
#include <linux/ptrace.h>
#include <linux/timer.h>
......
......@@ -13,9 +13,13 @@
#define SCSI_REMOVAL_PREVENT 1
#define SCSI_REMOVAL_ALLOW 0
#ifdef __KERNEL__
extern int scsi_ioctl (Scsi_Device *dev, int cmd, void *arg);
extern int kernel_scsi_ioctl (Scsi_Device *dev, int cmd, void *arg);
#endif
#endif
......@@ -62,6 +62,7 @@ extern void swap_setup(char *str, int *ints);
extern void buff_setup(char *str, int *ints);
extern void panic_setup(char *str, int *ints);
extern void bmouse_setup(char *str, int *ints);
extern void msmouse_setup(char *str, int *ints);
extern void lp_setup(char *str, int *ints);
extern void eth_setup(char *str, int *ints);
extern void xd_setup(char *str, int *ints);
......@@ -274,6 +275,9 @@ struct {
#ifdef CONFIG_BUSMOUSE
{ "bmouse=", bmouse_setup },
#endif
#ifdef CONFIG_MS_BUSMOUSE
{ "msmouse=", msmouse_setup },
#endif
#ifdef CONFIG_SCSI_SEAGATE
{ "st0x=", st0x_setup },
{ "tmc8xx=", tmc8xx_setup },
......
This diff is collapsed.
......@@ -1431,7 +1431,7 @@ int arp_find(unsigned char *haddr, u32 paddr, struct device *dev,
* all possible race conditions should be resolved by
* cli()/sti() pairs.
*
* Important note: hhs never disapear from lists, if ARP_LOCKED,
* Important note: hhs never disappear from lists, if ARP_LOCKED,
* this fact allows to scan hh lists with enabled interrupts,
* but results in generating duplicate hh entries.
* It is harmless. (and I've never seen such event)
......@@ -2036,7 +2036,7 @@ static int arp_req_set(struct arpreq *r, struct device * dev)
entry->mask = mask;
entry->flags = r->arp_flags;
entry->next = (*entryp)->next;
entry->next = *entryp;
*entryp = entry;
}
......
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