aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavem <davem>2001-12-07 00:00:11 +0000
committerdavem <davem>2001-12-07 00:00:11 +0000
commitdcc095be51221730b3cdae016c48a90ac5920476 (patch)
treebfda82192eeb9e2809e0750ea371c3aae1d5aba5
parenta025606f42044ca068f7601e092f5492a3cec87a (diff)
downloadnetdev-vger-cvs-dcc095be51221730b3cdae016c48a90ac5920476.tar.gz
Merge mainline to 2.4.17-pre5
-rw-r--r--CREDITS2
-rw-r--r--Documentation/Configure.help1384
-rw-r--r--Documentation/filesystems/devfs/ChangeLog4
-rw-r--r--Documentation/filesystems/tmpfs.txt102
-rw-r--r--MAINTAINERS6
-rw-r--r--Makefile2
-rw-r--r--arch/i386/kernel/setup.c76
-rw-r--r--arch/i386/kernel/smpboot.c34
-rw-r--r--drivers/block/floppy.c2
-rw-r--r--drivers/block/loop.c4
-rw-r--r--drivers/block/paride/pf.c3
-rw-r--r--drivers/block/paride/pg.c3
-rw-r--r--drivers/block/paride/pseudo.h4
-rw-r--r--drivers/block/paride/pt.c3
-rw-r--r--drivers/char/agp/agpgart_be.c14
-rw-r--r--drivers/ide/ide-disk.c2
-rw-r--r--drivers/ide/ide-floppy.c2
-rw-r--r--drivers/isdn/hisax/config.c50
-rw-r--r--drivers/net/8139too.c11
-rw-r--r--drivers/parport/ChangeLog6
-rw-r--r--drivers/parport/Config.in10
-rw-r--r--drivers/parport/ieee1284_ops.c3
-rw-r--r--drivers/scsi/NCR5380.c1063
-rw-r--r--drivers/scsi/NCR5380.h226
-rw-r--r--drivers/scsi/README.ncr53c8xx6
-rw-r--r--drivers/scsi/g_NCR5380.c1060
-rw-r--r--drivers/scsi/g_NCR5380.h18
-rw-r--r--drivers/scsi/ncr53c8xx.c4
-rw-r--r--drivers/scsi/ncr53c8xx.h2
-rw-r--r--drivers/scsi/scsi.c2
-rw-r--r--drivers/scsi/scsi_scan.c4
-rw-r--r--drivers/scsi/sg.c300
-rw-r--r--drivers/scsi/sym53c8xx.c4
-rw-r--r--drivers/scsi/sym53c8xx.h4
-rw-r--r--drivers/scsi/sym53c8xx_2/ChangeLog.txt18
-rw-r--r--drivers/scsi/sym53c8xx_2/sym53c8xx.h10
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_glue.c10
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_glue.h3
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_hipd.c13
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_hipd.h3
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_nvram.c8
-rw-r--r--drivers/scsi/sym53c8xx_comm.h4
-rw-r--r--drivers/scsi/sym53c8xx_defs.h4
-rw-r--r--drivers/sound/ymfpci.c32
-rw-r--r--fs/devfs/base.c34
-rw-r--r--fs/reiserfs/bitmap.c40
-rw-r--r--fs/reiserfs/buffer2.c288
-rw-r--r--fs/reiserfs/dir.c86
-rw-r--r--fs/reiserfs/do_balan.c7
-rw-r--r--fs/reiserfs/file.c12
-rw-r--r--fs/reiserfs/fix_node.c28
-rw-r--r--fs/reiserfs/inode.c111
-rw-r--r--fs/reiserfs/ioctl.c6
-rw-r--r--fs/reiserfs/journal.c26
-rw-r--r--fs/reiserfs/lbalance.c4
-rw-r--r--fs/reiserfs/namei.c125
-rw-r--r--fs/reiserfs/objectid.c2
-rw-r--r--fs/reiserfs/prints.c2
-rw-r--r--fs/reiserfs/resize.c2
-rw-r--r--fs/reiserfs/stree.c47
-rw-r--r--fs/reiserfs/super.c285
-rw-r--r--fs/reiserfs/tail_conversion.c2
-rw-r--r--include/asm-i386/cpufeature.h1
-rw-r--r--include/asm-i386/msr.h1
-rw-r--r--include/asm-i386/smp.h3
-rw-r--r--include/linux/reiserfs_fs.h526
-rw-r--r--include/linux/reiserfs_fs_i.h79
-rw-r--r--include/linux/shmem_fs.h2
-rw-r--r--include/scsi/sg.h91
-rw-r--r--kernel/sched.c15
-rw-r--r--mm/shmem.c30
71 files changed, 3253 insertions, 3127 deletions
diff --git a/CREDITS b/CREDITS
index 9d23d88cd..5ea4b775f 100644
--- a/CREDITS
+++ b/CREDITS
@@ -2512,7 +2512,7 @@ S: Wanniassa ACT 2903
S: Australia
N: Gerard Roudier
-E: groudier@iplus.fr
+E: groudier@free.fr
D: Contributed to asynchronous read-ahead improvement
S: 21 Rue Carnot
S: 95170 Deuil La Barre
diff --git a/Documentation/Configure.help b/Documentation/Configure.help
index 5c02e7f8c..6ab6683c1 100644
--- a/Documentation/Configure.help
+++ b/Documentation/Configure.help
@@ -2,10 +2,10 @@
# Eric S. Raymond <mailto:esr@thyrsus.com>
# Steven Cole <mailto:elenstev@mesatop.com>
#
-# Merged version 2.49: Current with 2.4.15-pre1 and 2.4.13-ac8.
+# Merged version 2.66: current with 2.4.17-pre2/2.5.1-pre5.
#
# This version of the Linux kernel configuration help texts
-# corresponds to the kernel versions 2.4.x.
+# corresponds to kernel versions 2.4.x and 2.5.x.
#
# Translations of this file available on the WWW:
#
@@ -14,11 +14,13 @@
# - Russian, by <mailto:kaf@linux.nevod.perm.su>, at
# <http://nevod.perm.su/service/linux/doc/kernel/Configure.help>
# - French, by Pierre Tane <mailto:tanep@bigfoot.com>, at
-# <http://www.traduc.org/kernelfr>
+# <http://www.traduc.org/kernelfr/>
# - Polish, by Dominik Mierzejewski <mailto:dmierzej@elka.pw.edu.pl>, at
# <http://home.elka.pw.edu.pl/~dmierzej/linux/kernel/>
-# - German, by SuSE, at <http://www.suse.de/~ke/kernel>. This patch
+# - German, by SuSE, at <http://www.suse.de/~ke/kernel/>. This patch
# also includes infrastructure to support different languages.
+# - Catalan, by Antoni Bella <mailto:bella5@teleline.es>, at
+# <http://www.terra.es/personal7/bella5/traduccions.htm>
#
# To access a document on the WWW, you need to have a direct Internet
# connection and a browser program such as netscape or lynx. If you
@@ -133,8 +135,8 @@ CONFIG_SMP
See also the <file:Documentation/smp.tex>,
<file:Documentation/smp.txt>, <file:Documentation/i386/IO-APIC.txt>,
- <file:Documentation/nmi_watchdog.txt> and the SMP-FAQ on the WWW at
- <http://www.irisa.fr/prive/mentre/smp-faq/>.
+ <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
+ <http://www.linuxdoc.org/docs.html#howto>.
If you don't know what to do here, say N.
@@ -239,7 +241,7 @@ CONFIG_MULTIQUAD
You will need a new lynxer.elf file to flash your firmware with - send
email to Martin.Bligh@us.ibm.com
-IO-APIC Support on Uniprocessors
+IO-APIC support on uniprocessors
CONFIG_X86_UP_IOAPIC
An IO-APIC (I/O Advanced Programmable Interrupt Controller) is an
SMP-capable replacement for PC-style interrupt controllers. Most
@@ -374,7 +376,7 @@ CONFIG_HIGHMEM64G
Select this if you have a 32-bit processor and more than 4
gigabytes of physical RAM.
-Normal PC floppy disk support
+Normal floppy disk support
CONFIG_BLK_DEV_FD
If you want to use the floppy disk drive(s) of your PC under Linux,
say Y. Information about this driver, especially important for IBM
@@ -577,7 +579,7 @@ CONFIG_BLK_DEV_IDE
To fine-tune ATA/IDE drive/interface parameters for improved
performance, look for the hdparm package at
- <http://www.ibiblio.org/pub/Linux/system/hardware>.
+ <ftp://ibiblio.org/pub/Linux/system/hardware/>.
If you want to compile this driver as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
@@ -666,12 +668,9 @@ CONFIG_BLK_DEV_IDECD
CD-ROM drive, you can say N to all other CD-ROM options, but be sure
to say Y or M to "ISO 9660 CD-ROM file system support".
- Read the CD-ROM-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto> and
- <file:Documentation/cdrom/ide-cd>. Note that older versions of lilo
- (the Linux boot loader) cannot properly deal with IDE/ATAPI CD-ROMs,
- so install lilo-16 or higher, available from
- <ftp://metalab.unc.edu/pub/Linux/system/boot/lilo>.
+ Note that older versions of LILO (LInux LOader) cannot properly deal
+ with IDE/ATAPI CD-ROMs, so install LILO 16 or higher, available from
+ <ftp://brun.dyndns.org/pub/linux/lilo/>.
If you want to compile the driver as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
@@ -820,7 +819,7 @@ CONFIG_BLK_DEV_IDEDMA_PCI
for these drives, but you can change that by saying Y to the
following question "Use DMA by default when available". You can get
the latest version of the hdparm utility from
- <ftp://metalab.unc.edu/pub/Linux/system/hardware/>.
+ <ftp://ibiblio.org/pub/Linux/system/hardware/>.
Read the comments at the beginning of <file:drivers/ide/ide-dma.c>
and the file <file:Documentation/ide.txt> for more information.
@@ -914,7 +913,7 @@ CONFIG_BLK_DEV_ADMA
Pacific Digital A-DMA support (EXPERIMENTAL)
CONFIG_BLK_DEV_PDC_ADMA
- Please read the comments at the top of <file:drivers/ide/pdcadma.c>.
+ Please read the comments at the top of <file:drivers/ide/ide-pci.c>.
3ware Hardware ATA-RAID support
CONFIG_BLK_DEV_3W_XXXX_RAID
@@ -973,7 +972,7 @@ CONFIG_WDC_ALI15X3
SAY N!
-AMD Viper support
+AMD Viper (7401/7409/7411) chipset support
CONFIG_BLK_DEV_AMD74XX
This driver ensures (U)DMA support for the AMD756/760 Viper
chipsets.
@@ -984,7 +983,7 @@ CONFIG_BLK_DEV_AMD74XX
If unsure, say N.
-AMD Viper ATA-66 Override (WIP)
+AMD Viper ATA-66 Override support (WIP)
CONFIG_AMD74XX_OVERRIDE
This option auto-forces the ata66 flag.
This effect can be also invoked by calling "idex=ata66"
@@ -1118,11 +1117,13 @@ CONFIG_BLK_DEV_PDC202XX
Special UDMA Feature
CONFIG_PDC202XX_BURST
- For PDC20246, PDC20262, PDC20265 and PDC20267 Ultra DMA chipsets.
- Designed originally for PDC20246/Ultra33 that has BIOS setup
- failures when using 3 or more cards.
+ This option causes the pdc202xx driver to enable UDMA modes on the
+ PDC202xx even when the PDC202xx BIOS has not done so.
- Unknown for PDC20265/PDC20267 Ultra DMA 100.
+ It was originally designed for the PDC20246/Ultra33, whose BIOS will
+ only setup UDMA on the first two PDC20246 cards. It has also been
+ used succesfully on a PDC20265/Ultra100, allowing use of UDMA modes
+ when the PDC20265 BIOS has been disabled (for faster boot up).
Please read the comments at the top of
<file:drivers/ide/pdc202xx.c>.
@@ -1251,15 +1252,6 @@ CONFIG_BLK_DEV_PDC4030
<file:Documentation/ide.txt> and <file:drivers/ide/pdc4030.c> files
for more info.
-# This is for Linus's tree.
-QDI QD6580 support
-CONFIG_BLK_DEV_QD6580
- This driver is enabled at runtime using the "ide0=qd6580" kernel
- boot parameter. It permits faster I/O speeds to be set. See the
- <file:Documentation/ide.txt> and <file:drivers/ide/qd6580.c> for
- more info.
-
-# This is for Alan's tree. Note the name difference.
QDI QD65XX support
CONFIG_BLK_DEV_QD65XX
This driver is enabled at runtime using the "ide0=qd65xx" kernel
@@ -1488,7 +1480,7 @@ Parallel port generic ATAPI devices
CONFIG_PARIDE_PG
This option enables a special high-level driver for generic ATAPI
devices connected through a parallel port. The driver allows user
- programs, such as cdrecord, to send ATAPI commands directly to a
+ programs, such as cdrtools, to send ATAPI commands directly to a
device.
If you chose to build PARIDE support into your kernel, you may
@@ -1502,7 +1494,7 @@ CONFIG_PARIDE_PG
This driver implements an API loosely related to the generic SCSI
driver. See <file:include/linux/pg.h>. for details.
- You can obtain the most recent version of cdrecord from
+ You can obtain the most recent version of cdrtools from
<ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/>. Versions 1.6.1a3 and
later fully support this driver.
@@ -1603,7 +1595,7 @@ CONFIG_PARIDE_FIT2
(low speed) adapter that is used in some portable hard drives. If
you chose to build PARIDE support into your kernel, you may answer Y
here to build in the protocol driver, otherwise you should answer M
- to build it as a loadable module. The module will be called ktti.o.
+ to build it as a loadable module. The module will be called fit2.o.
You must also have a high-level driver for the type of device that
you want to support.
@@ -1716,9 +1708,9 @@ CONFIG_BLK_DEV_MD
controller, you do not need to say Y here.
More information about Software RAID on Linux is contained in the
- Software-RAID mini-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>. There you will also
- learn where to get the supporting user space utilities raidtools.
+ Software RAID mini-HOWTO, available from
+ <http://www.linuxdoc.org/docs.html#howto>. There you will also learn
+ where to get the supporting user space utilities raidtools.
If unsure, say N.
@@ -1811,7 +1803,6 @@ CONFIG_MD_MULTIPATH
If unsure, say N.
-# AC tree only
Support for IDE Raid controllers
CONFIG_BLK_DEV_ATARAID
Say Y or M if you have an IDE Raid controller and want linux
@@ -1824,7 +1815,6 @@ CONFIG_BLK_DEV_ATARAID
has its own Raid drivers, which you should use if you need better
performance.
-# AC tree only
Support Promise software RAID (Fasttrak(tm))
CONFIG_BLK_DEV_ATARAID_PDC
Say Y or M if you have a Promise Fasttrak (tm) Raid controller
@@ -1835,7 +1825,6 @@ CONFIG_BLK_DEV_ATARAID_PDC
If you choose to compile this as a module, the module will be called
pdcraid.o.
-# AC tree only
Highpoint 370 software RAID
CONFIG_BLK_DEV_ATARAID_HPT
Say Y or M if you have a Highpoint HPT 370 Raid controller
@@ -1851,19 +1840,19 @@ CONFIG_ACER_PICA_61
This is a machine with a R4400 133/150 MHz CPU. To compile a Linux
kernel that runs on these, say Y here. For details about Linux on
the MIPS architecture, check out the Linux/MIPS FAQ on the WWW at
- <http://oss.sgi.com/mips>.
+ <http://oss.sgi.com/mips/>.
Support for Algorithmics P4032 (EXPERIMENTAL)
CONFIG_ALGOR_P4032
This is an evaluation board of the British company Algorithmics.
The board uses the R4300 and a R5230 CPUs. For more information
- about this board see <http://www.algor.co.uk>.
+ about this board see <http://www.algor.co.uk/>.
Support for BAGET MIPS series
CONFIG_BAGET_MIPS
This enables support for the Baget, a Russian embedded system. For
more details about the Baget see the Linux/MIPS FAQ on
- <http://oss.sgi.com/mips>.
+ <http://oss.sgi.com/mips/>.
Baget AMD LANCE support
CONFIG_BAGETLANCE
@@ -1874,8 +1863,8 @@ CONFIG_BAGETLANCE
Support for DECstations
CONFIG_DECSTATION
This enables support for DEC's MIPS based workstations. For details
- see the Linux/MIPS FAQ on <http://oss.sgi.com/mips> and the
- DECstation porting pages on <http://decstation.unix-ag.org>.
+ see the Linux/MIPS FAQ on <http://oss.sgi.com/mips/> and the
+ DECstation porting pages on <http://decstation.unix-ag.org/>.
If you have one of the following DECstation Models you definitely
want to choose R4xx0 for the CPU Type:
@@ -1904,7 +1893,7 @@ CONFIG_COBALT_28
Support for the Momentum Computer Ocelot SBC
CONFIG_MOMENCO_OCELOT
The Ocelot is a MIPS-based Single Board Computer (SBC) made by
- Momentum Computer <http://www.momenco.com>.
+ Momentum Computer <http://www.momenco.com/>.
Support for NEC DDB Vrc-5074
CONFIG_DDB5074
@@ -1917,7 +1906,7 @@ CONFIG_DDB5476
evaluation board.
Features : kernel debugging, serial terminal, NFS root fs, on-board
- ether port (Need an additional patch at <http://linux.junsun.net>),
+ ether port (Need an additional patch at <http://linux.junsun.net/>),
USB, AC97, PCI, PCI VGA card & framebuffer console, IDE controller,
PS2 keyboard, PS2 mouse, etc.
@@ -1927,7 +1916,7 @@ CONFIG_DDB5477
evaluation board.
Features : kernel debugging, serial terminal, NFS root fs, on-board
- ether port (Need an additional patch at <http://linux.junsun.net>),
+ ether port (Need an additional patch at <http://linux.junsun.net/>),
USB, AC97, PCI, etc.
Support for MIPS Atlas board
@@ -1953,7 +1942,7 @@ CONFIG_MIPS_MAGNUM_4000
This is a machine with a R4000 100 MHz CPU. To compile a Linux
kernel that runs on these, say Y here. For details about Linux on
the MIPS architecture, check out the Linux/MIPS FAQ on the WWW at
- <http://oss.sgi.com/mips>.
+ <http://oss.sgi.com/mips/>.
Enable Qtronix 990P Keyboard Support
CONFIG_QTRONIX_KEYBOARD
@@ -1965,7 +1954,7 @@ CONFIG_OLIVETTI_M700
This is a machine with a R4000 100 MHz CPU. To compile a Linux
kernel that runs on these, say Y here. For details about Linux on
the MIPS architecture, check out the Linux/MIPS FAQ on the WWW at
- <http://oss.sgi.com/mips>.
+ <http://oss.sgi.com/mips/>.
Support for SNI RM200 PCI
CONFIG_SNI_RM200_PCI
@@ -1974,13 +1963,13 @@ CONFIG_SNI_RM200_PCI
Technology and now in turn merged with Fujitsu. Say Y here to
support this machine type.
-Support for SGI IP22
+Support for SGI-IP22 (Indy/Indigo2)
CONFIG_SGI_IP22
This are the SGI Indy, Challenge S and Indigo2, as well as certain
OEM variants like the Tandem CMN B006S. To compile a Linux kernel
that runs on these, say Y here.
-Support for SGI IP27
+Support for SGI IP27 (Origin200/2000)
CONFIG_SGI_IP27
This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
workstations. To compile a Linux kernel that runs on these, say Y
@@ -2036,13 +2025,26 @@ CONFIG_DZ
DZ11-family serial controllers for VAXstations, including the
DC7085, M7814, and M7819.
-
TURBOchannel support
CONFIG_TC
TurboChannel is a DEC (now Compaq) bus for Alpha and MIPS processors.
Documentation on writing device drivers for TurboChannel is available at:
<http://www.cs.arizona.edu/computer.help/policy/DIGITAL_unix/AA-PS3HD-TET1_html/TITLE.html>.
+# Choice: galileo_clock
+75
+CONFIG_SYSCLK_75
+ Configure the kernel for clock speed of your Galileo board.
+ The choices are 75MHz, 83.3MHz, and 100MHz.
+
+83.3
+CONFIG_SYSCLK_83
+ Configure the Galileo kernel for a clock speed of 83.3 MHz.
+
+100
+CONFIG_SYSCLK_100
+ Configure the Galileo kernel for a clock speed of 100 MHz.
+
Z85C30 Serial Support
CONFIG_ZS
Documentation on the Zilog 85C350 serial communications controller
@@ -2072,7 +2074,7 @@ NinjaSCSI-3 / NinjaSCSI-32Bi (16bit) PCMCIA support
CONFIG_PCMCIA_NINJA_SCSI
If you intend to attach this type of PCMCIA SCSI host adapter to
your computer, say Y here and read
- <file:Documentation/README.nsp_cs>.
+ <file:Documentation/README.nsp_cs.eng>.
This driver is also available as a module called nsp_cs.o ( =
code which can be inserted in and removed from the running kernel
@@ -2197,7 +2199,7 @@ CONFIG_NUMA
Access). This option is for configuring high-end multiprocessor
server machines. If in doubt, say N.
-CPU type
+R41xx
CONFIG_CPU_VR41XX
The options selects support for the NEC VR41xx series of processors.
Only choose this option if you have one of these processors as a
@@ -2209,7 +2211,7 @@ CONFIG_CPU_ADVANCED
Saying yes here allows you to select support for various features
your CPU may or may not have. Most people should say N here.
-ll/sc Instructions available
+ll and sc instructions available
CONFIG_CPU_HAS_LLSC
MIPS R4000 series and later provide the Load Linked (ll)
and Store Conditional (sc) instructions. More information is
@@ -2219,7 +2221,7 @@ CONFIG_CPU_HAS_LLSC
for better performance, N if you don't know. You must say Y here
for multiprocessor machines.
-lld and scd instructions
+lld and scd instructions available
CONFIG_CPU_HAS_LLDSCD
Say Y here if your CPU has the lld and scd instructions, the 64-bit
equivalents of ll and sc. Say Y here for better performance, N if
@@ -2263,7 +2265,7 @@ CONFIG_NET
of which are given in <file:Documentation/Changes>.
For a general introduction to Linux networking, it is highly
- recommended to read the NET-3-HOWTO, available from
+ recommended to read the NET-HOWTO, available from
<http://www.linuxdoc.org/docs.html#howto>.
Socket filtering
@@ -2352,7 +2354,7 @@ CONFIG_IP_NF_CONNTRACK
If you want to compile it as a module, say M here and read
<file:Documentation/modules.txt>. If unsure, say `N'.
-IRC Send/Chat support
+IRC Send/Chat protocol support
CONFIG_IP_NF_IRC
There is a commonly-used extension to IRC called
Direct Client-to-Client Protocol (DCC). This enables users to send
@@ -2436,7 +2438,7 @@ CONFIG_IP_NF_MATCH_TTL
If you want to compile it as a module, say M here and read
Documentation/modules.txt. If unsure, say `N'.
-length match support
+LENGTH match support
CONFIG_IP_NF_MATCH_LENGTH
This option allows you to match the length of a packet against a
specific value or range of values.
@@ -2658,6 +2660,23 @@ CONFIG_IP6_NF_MATCH_MARK
If you want to compile it as a module, say M here and read
<file:Documentation/modules.txt>. If unsure, say `N'.
+Multiple port match support
+CONFIG_IP6_NF_MATCH_MULTIPORT
+ Multiport matching allows you to match TCP or UDP packets based on
+ a series of source or destination ports: normally a rule can only
+ match a single range of ports.
+
+ If you want to compile it as a module, say M here and read
+ <file:Documentation/modules.txt>. If unsure, say `N'.
+
+Owner match support
+CONFIG_IP6_NF_MATCH_OWNER
+ Packet owner matching allows you to match locally-generated packets
+ based on who created them: the user, group, process or session.
+
+ If you want to compile it as a module, say M here and read
+ <file:Documentation/modules.txt>. If unsure, say `N'.
+
Packet filtering
CONFIG_IP6_NF_FILTER
Packet filtering defines a table `filter', which has a series of
@@ -2724,6 +2743,14 @@ CONFIG_IP6_NF_MATCH_LIMIT
If you want to compile it as a module, say M here and read
<file:Documentation/modules.txt>. If unsure, say `N'.
+LOG target support
+CONFIG_IP6_NF_TARGET_LOG
+ This option adds a `LOG' target, which allows you to create rules in
+ any iptables table which records the packet header to the syslog.
+
+ If you want to compile it as a module, say M here and read
+ <file:Documentation/modules.txt>. If unsure, say `N'.
+
SYN flood protection
CONFIG_SYN_COOKIES
Normal TCP/IP networking is open to an attack known as "SYN
@@ -2776,7 +2803,7 @@ CONFIG_ALPHA_GENERIC
To find out what type of Alpha system you have, you may want to
check out the Linux/Alpha FAQ, accessible on the WWW from
- <http://www.alphalinux.org>. In summary:
+ <http://www.alphalinux.org/>. In summary:
Alcor/Alpha-XLT AS 600
Alpha-XL XL-233, XL-266
@@ -2955,13 +2982,18 @@ EV5 CPU(s) (model 5/xxx)
CONFIG_ALPHA_GAMMA
Say Y if you have an AS 2000 5/xxx or an AS 2100 5/xxx.
+EV67 (or later) CPU (speed > 600MHz)?
+CONFIG_ALPHA_EV67
+ Is this a machine based on the EV67 core? If in doubt, select N here
+ and the machine will be treated as an EV6.
+
Use SRM as bootloader
CONFIG_ALPHA_SRM
There are two different types of booting firmware on Alphas: SRM,
which is command line driven, and ARC, which uses menus and arrow
keys. Details about the Linux/Alpha booting process are contained in
the Linux/Alpha FAQ, accessible on the WWW from
- <http://www.alphalinux.org>.
+ <http://www.alphalinux.org/>.
The usual way to load Linux on an Alpha machine is to use MILO
(a bootloader that lets you pass command line parameters to the
@@ -3130,7 +3162,7 @@ CONFIG_MWAVE
The user level application needed to use this driver can be found at
the IBM Linux Technology Center (LTC) web site:
- http://www.ibm.com/linux/ltc/
+ <http://www.ibm.com/linux/ltc/>.
If you own one of the above IBM Thinkpads which has the Mwave chipset
in it, say Y.
@@ -3300,7 +3332,7 @@ CONFIG_PCI_NAMES
When in doubt, say Y.
-PCI Hotplug support
+Generic PCI hotplug support
CONFIG_HOTPLUG_PCI
Say Y here if you have a motherboard with a PCI Hotplug controller.
This allows you to add and remove PCI cards while the machine is
@@ -3314,7 +3346,7 @@ CONFIG_HOTPLUG_PCI
When in doubt, say N.
-PCI Compaq Hotplug controller
+Compaq PCI Hotplug driver
CONFIG_HOTPLUG_PCI_COMPAQ
Say Y here if you have a motherboard with a Compaq PCI Hotplug
controller.
@@ -3505,7 +3537,7 @@ CONFIG_HOTPLUG
example, used on modern desktops as well as laptops, is USB.
Enable HOTPLUG and KMOD, and build a modular kernel. Get agent
- software (at <http://linux-hotplug.sourceforge.net>) and install it.
+ software (at <http://linux-hotplug.sourceforge.net/>) and install it.
Then your kernel will automatically call out to a user mode "policy
agent" (/sbin/hotplug) to load modules and set up software needed
to use devices as you hotplug them.
@@ -3547,6 +3579,12 @@ CONFIG_CARDBUS
If unsure, say Y.
+i82092 compatible bridge support
+CONFIG_I82092
+ This provides support for the Intel I82092AA PCI-to-PCMCIA bridge device,
+ found in some older laptops and more commonly in evaluation boards for the
+ chip.
+
i82365 compatible host bridge support
CONFIG_I82365
Say Y here to include support for ISA-bus PCMCIA host bridges that
@@ -3625,7 +3663,6 @@ CONFIG_KCORE_ELF
don't understand what this means or are not a kernel hacker, just
leave it at its default value ELF.
-# Choice: kcore
Select a.out format for /proc/kcore
CONFIG_KCORE_AOUT
Not necessary unless you're using a very out-of-date binutils
@@ -3748,7 +3785,7 @@ CONFIG_ENVCTRL
The module will be called envctrl.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
-# Choice: x86
+# Choice: x86type
Processor family
CONFIG_M386
This is the processor type of your CPU. This information is used for
@@ -3821,7 +3858,7 @@ CONFIG_VGA_CONSOLE
The program SVGATextMode can be used to utilize SVGA video cards to
their full potential in text mode. Download it from
- <ftp://metalab.unc.edu/pub/Linux/utils/console>.
+ <ftp://ibiblio.org/pub/Linux/utils/console/>.
Say Y.
@@ -4053,21 +4090,18 @@ CONFIG_FB_ATY128
module will be called aty128fb.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
-# AC tree only
Maxine (Personal DECstation) onboard framebuffer support
CONFIG_FB_MAXINE
Say Y here to directly support the on-board framebuffer in the
Maxine (5000/20, /25, /33) version of the DECstation. There is a
page dedicated to Linux on DECstations at <http://decstation.unix-ag.org/>.
-# AC tree only
PMAG-BA TURBOchannel framebuffer support
CONFIG_FB_PMAG_BA
Say Y here to directly support the on-board PMAG-BA framebuffer in
the 5000/1xx versions of the DECstation. There is a page dedicated
to Linux on DECstations at <http://decstation.unix-ag.org/>.
-# AC tree only
PMAGB-B TURBOchannel framebuffer support
CONFIG_FB_PMAGB_B
Say Y here to directly support the on-board PMAGB-B framebuffer in
@@ -4079,10 +4113,32 @@ CONFIG_ARCH_FTVPCI
Say Y here if you intend to run this kernel on a FutureTV (nee Nexus
Electronics) StrongARM PCI card.
-P720T
-CONFIG_ARCH_P720T
- Say Y here if you intend to run this kernel on the ARM Prospector
- 720T.
+ANAKIN Vehicle Telematics Platform
+CONFIG_ARCH_ANAKIN
+ The Anakin is a StrongArm based SA110 - 2 DIN Vehicle Telematics Platform.
+ 64MB SDRAM - 4 Mb Flash - Compact Flash Interface - 1 MB VRAM
+
+ On board peripherals:
+ * Front display: 400x234 16 bit TFT touchscreen
+ * External independent second screen interface
+ * CAN controller SJA1000
+ * USB host controller
+ * 6 channel video codec with hardware overlay
+ * Smartcard reader
+ * IrDa
+
+ Modules interfaced over the Multi Media Extension slots:
+ * A communication card
+ Wavecom GPRS modem
+ uBlock GPS
+ Bosch DAB module
+ * An audio card ( 4 * 40W, AC97 Codec, I2S)
+
+Altera Excalibur XA10 Dev Board
+ARCH_CAMELOT
+ This enables support for Altera's Excalibur XA10 development board.
+ If you would like to build your kernel to run on one of these boards
+ then you must say 'Y' here. Otherwise say 'N'
Link-Up Systems LCD support
CONFIG_FB_L7200
@@ -4306,10 +4362,8 @@ CONFIG_FB_MATROX
a module, say M here and read <file:Documentation/modules.txt>.
You can pass several parameters to the driver at boot time or at
- module load time. The parameters look like "video=matrox:XXX", where
- the meaning of XXX can be found at the end of the main source file
- (<file:drivers/video/matroxfb.c>). Please see
- <file:Documentation/fb/matroxfb.txt>.
+ module load time. The parameters look like "video=matrox:XXX", and
+ are described in <file:Documentation/fb/matroxfb.txt>.
Matrox Millennium I/II support
CONFIG_FB_MATROX_MILLENIUM
@@ -4372,7 +4426,7 @@ CONFIG_FB_MATROX_MAVEN
The driver starts in monitor mode and you must use the matroxset
tool (available at
- <ftp://platan.vc.cvut.cz/pub/linux/matrox-latest>) to switch it to
+ <ftp://platan.vc.cvut.cz/pub/linux/matrox-latest/>) to switch it to
PAL or NTSC or to swap primary and secondary head outputs.
Secondary head driver also always start in 640x480 resolution, you
must use fbset to change it.
@@ -4394,7 +4448,7 @@ CONFIG_FB_MATROX_G450
The driver starts in monitor mode and currently does not support
output in TV modes. You must use the matroxset tool (available
- at <ftp://platan.vc.cvut.cz/pub/linux/matrox-latest>) to swap
+ at <ftp://platan.vc.cvut.cz/pub/linux/matrox-latest/>) to swap
primary and secondary head outputs. Secondary head driver always
start in 640x480 resolution and you must use fbset to change it.
@@ -4504,19 +4558,17 @@ CONFIG_FB_HIT
This is the frame buffer device driver for the Hitachi HD64461 LCD
frame buffer card.
-SIS 630/540 display support
+SIS acceleration
CONFIG_FB_SIS
This is the frame buffer device driver for the SiS 630 and 640 Super
Socket 7 UMA cards. Specs available at <http://www.sis.com.tw/>.
-# AC tree only
SIS 630/540/730 support
CONFIG_FB_SIS_300
This is the frame buffer device driver for the SiS 630 and related
Super Socket 7 UMA cards. Specs available at
<http://www.sis.com.tw/>.
-# AC tree only
SIS 315H/315 support
CONFIG_FB_SIS_315
This is the frame buffer device driver for the SiS 315 graphics
@@ -4570,7 +4622,6 @@ CONFIG_FB_ATY_GX
is at
<http://support.ati.com/products/pc/mach64/graphics_xpression.html>.
-# AC tree only
ATI Radeon display support
CONFIG_FB_RADEON
Choose this option if you want to use an ATI Radeon graphics card as
@@ -4697,7 +4748,8 @@ CONFIG_PARPORT
drive, PLIP link (Parallel Line Internet Protocol is mainly used to
create a mini network by connecting the parallel ports of two local
machines) etc., then you need to say Y here; please read
- <file:Documentation/parport.txt> and drivers/parport/BUGS-parport.
+ <file:Documentation/parport.txt> and
+ <file:drivers/parport/BUGS-parport>.
For extensive information about drivers for many devices attaching
to the parallel port see <http://www.torque.net/linux-pp.html> on
@@ -4729,7 +4781,7 @@ CONFIG_PARPORT_PC
If unsure, say Y.
-Parallel+serial PCI card support
+Parallel+serial PCI multi-IO card support
CONFIG_PARPORT_SERIAL
This adds support for multi-IO PCI cards that have parallel and
serial ports. You should say Y or M here. If you say M, the module
@@ -5179,7 +5231,7 @@ CONFIG_IPX
used for local networks of Windows machines. You need it if you
want to access Novell NetWare file or print servers using the Linux
Novell client ncpfs (available from
- <ftp://metalab.unc.edu/pub/Linux/system/filesystems/>) or from
+ <ftp://platan.vc.cvut.cz/pub/linux/ncpfs/>) or from
within the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO,
available from <http://www.linuxdoc.org/docs.html#howto>). In order
to do the former, you'll also have to say Y to "NCP file system
@@ -5191,8 +5243,8 @@ CONFIG_IPX
To turn your Linux box into a fully featured NetWare file server and
IPX router, say Y here and fetch either lwared from
- <ftp://metalab.unc.edu/pub/Linux/system/network/daemons/> or
- mars_nwe from <ftp://ftp.gwdg.de/pub/linux/misc/ncpfs>. For more
+ <ftp://ibiblio.org/pub/Linux/system/network/daemons/> or
+ mars_nwe from <ftp://www.compu-art.de/mars_nwe/>. For more
information, read the IPX-HOWTO available from
<http://www.linuxdoc.org/docs.html#howto>.
@@ -5228,7 +5280,7 @@ CONFIG_IPX_INTERN
'special' sockets to sockets listening on the primary network is
disabled. This might break existing applications, especially RIP/SAP
daemons. A RIP/SAP daemon that works well with the full internal net
- can be found on <ftp://ftp.gwdg.de/pub/linux/misc/ncpfs>.
+ can be found on <ftp://ftp.gwdg.de/pub/linux/misc/ncpfs/>.
If you don't know what you are doing, say N.
@@ -5296,7 +5348,7 @@ CONFIG_DECNET_ROUTER
network link driver", "Routing messages" and "Network packet
filtering". The first two are required to allow configuration via
rtnetlink (currently you need Alexey Kuznetsov's iproute2 package
- from <ftp://ftp.inr.ac.ru>). The "Network packet filtering" option
+ from <ftp://ftp.inr.ac.ru/>). The "Network packet filtering" option
will be required for the forthcoming routing daemon to work.
See <file:Documentation/networking/decnet.txt> for more information.
@@ -5417,9 +5469,8 @@ CONFIG_COPS_TANGENT
Amateur Radio support
CONFIG_HAMRADIO
If you want to connect your Linux box to an amateur radio, answer Y
- here. You want to read <http://www.tapr.org/tapr/html/pkthome.html>
- and the HAM-HOWTO and the AX25-HOWTO, both available from
- <http://www.linuxdoc.org/docs.html#howto>.
+ here. You want to read <http://www.tapr.org/tapr/html/pkthome.html> and
+ the AX25-HOWTO, available from <http://www.linuxdoc.org/docs.html#howto>.
Note that the answer to this question won't directly affect the
kernel: saying N will just cause the configurator to skip all
@@ -5626,7 +5677,7 @@ CONFIG_BAYCOM_PAR
connect to a parallel interface. The driver supports the picpar and
par96 designs. To configure the driver, use the sethdlc utility
available in the standard ax25 utilities package. For information on
- the modems, see <http://www.baycom.de> and the file
+ the modems, see <http://www.baycom.de/> and the file
<file:Documentation/networking/baycom.txt>.
If you want to compile this driver as a module ( = code which can be
@@ -5640,7 +5691,7 @@ CONFIG_BAYCOM_EPP
connect to a parallel interface. The driver supports the EPP
designs. To configure the driver, use the sethdlc utility available
in the standard ax25 utilities package. For information on the
- modems, see <http://www.baycom.de> and the file
+ modems, see <http://www.baycom.de/> and the file
<file:Documentation/networking/baycom.txt>.
If you want to compile this driver as a module ( = code which can be
@@ -5659,7 +5710,7 @@ CONFIG_BAYCOM_SER_FDX
driver and still provided in case this driver does not work with
your serial interface chip. To configure the driver, use the sethdlc
utility available in the standard ax25 utilities package. For
- information on the modems, see <http://www.baycom.de> and
+ information on the modems, see <http://www.baycom.de/> and
<file:Documentation/networking/baycom.txt>.
If you want to compile this driver as a module ( = code which can be
@@ -5676,7 +5727,7 @@ CONFIG_BAYCOM_SER_HDX
the full-duplex driver. This driver is depreciated. To configure
the driver, use the sethdlc utility available in the standard ax25
utilities package. For information on the modems, see
- <http://www.baycom.de> and
+ <http://www.baycom.de/> and
<file:Documentation/networking/baycom.txt>.
If you want to compile this driver as a module ( = code which can be
@@ -5853,7 +5904,7 @@ CONFIG_NET_DIVERT
- etc...
For more informations, please refer to:
- <http://www.freshmeat.net/projects/etherdivert>
+ <http://diverter.sourceforge.net/>
<http://perso.wanadoo.fr/magpie/EtherDivert.html>
If unsure, say N.
@@ -6191,7 +6242,7 @@ CONFIG_ATM_IA
control memory (128K-1KVC, 512K-4KVC), the size of the packet
memory (128K, 512K, 1M), and the PHY type (Single/Multi mode OC3,
UTP155, UTP25, DS3 and E3). Go to:
- www.iphase.com/products/ClassSheet.cfm?ClassID=ATM
+ <http://www.iphase.com/products/ClassSheet.cfm?ClassID=ATM>
for more info about the cards. Say Y (or M to compile as a module
named iphase.o) here if you have one of these cards.
@@ -6204,7 +6255,7 @@ CONFIG_ATM_IA_DEBUG
messages is controlled by a bitmap. This may be specified as a
module argument (kernel command line argument as well?), changed
dynamically using an ioctl (Get the debug utility, iadbg, from
- <ftp://ftp.iphase.com/pub/atm/pci>).
+ <ftp://ftp.iphase.com/pub/atm/pci/>).
See the file <file:drivers/atm/iphase.h> for the meanings of the
bits in the mask.
@@ -6213,6 +6264,13 @@ CONFIG_ATM_IA_DEBUG
speed of the driver, and the size of your syslog files! When
inactive, they will have only a modest impact on performance.
+Efficient Networks Speedstream 3010
+CONFIG_ATM_LANAI
+ Supports ATM cards based on the Efficient Networks "Lanai"
+ chipset such as the Speedstream 3010 and the ENI-25p. The
+ Speedstream 3060 is currently not supported since we don't
+ have the code to drive the on-board Alcatel DSL chipset (yet).
+
Linux telephony support
CONFIG_PHONE
Say Y here if you have a telephony card, which for example allows
@@ -6331,6 +6389,13 @@ CONFIG_ATM_FORE200E_DEBUG
the performances of the driver, and the size of your syslog files!
Keep the debugging level to 0 during normal operations.
+PPP over ATM
+CONFIG_PPPOATM
+ Support PPP (Point to Point Protocol) encapsulated in ATM frames.
+ This implementation does not yet comply with section 8 of RFC2364,
+ which can lead to bad results idf the ATM peer loses state and
+ changes its encapsulation unilaterally.
+
Fusion MPT device support
CONFIG_FUSION
LSI Logic Fusion(TM) Message Passing Technology (MPT) device support
@@ -6456,12 +6521,6 @@ CONFIG_SCSI
You also need to say Y here if you want support for the parallel
port version of the 100 MB IOMEGA ZIP drive.
- Please read the SCSI-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>. The
- SCSI-Programming-HOWTO contains information about how to add or
- remove an SCSI device from a running Linux machine without
- rebooting.
-
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called scsi_mod.o. If you want to compile it as
@@ -6539,7 +6598,7 @@ CONFIG_CHR_DEV_OSST
tape drives (ADR-x0) that supports the standard SCSI-2 commands for
tapes (QIC-157) and can be driven by the standard driver st.
For more information, you may have a look at the SCSI-HOWTO
- <ftp://metalab.unc.edu/pub/Linux/docs/HOWTO> and
+ <http://www.linuxdoc.org/docs.html#howto> and
<file:drivers/scsi/README.osst> in the kernel source.
More info on the OnStream driver may be found on
<http://linux1.onstream.nl/test/>
@@ -6594,12 +6653,12 @@ CONFIG_CHR_DEV_SG
directly, so you need some additional software which knows how to
talk to these devices using the SCSI protocol:
- For scanners, look at SANE (<http://www.mostang.com/sane>). For CD
- writer software look at cdrecord
+ For scanners, look at SANE (<http://www.mostang.com/sane/>). For CD
+ writer software look at Cdrtools
(<http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html>)
- and for burning a "disk at once": cdrdao
- (<http://www.ping.de/sites/daneb/cdrdao.html>). Cdparanoia is a high
- quality digital reader of audio CDs (<http://www.xiph.org/paranoia>).
+ and for burning a "disk at once": CDRDAO
+ (<http://cdrdao.sourceforge.net/>). Cdparanoia is a high
+ quality digital reader of audio CDs (<http://www.xiph.org/paranoia/>).
For other devices, it's possible that you'll have to write the
driver software yourself. Please read the file
<file:Documentation/scsi-generic.txt> for more information.
@@ -6610,17 +6669,6 @@ CONFIG_CHR_DEV_SG
<file:Documentation/scsi.txt>. The module will be called sg.o. If unsure,
say N.
-Enable extra checks in SCSI queueing code
-CONFIG_SCSI_DEBUG_QUEUES
- This option turns on a lot of additional consistency checking for
- the new queueing code. This will adversely affect performance, but
- it is likely that bugs will be caught sooner if this is turned on.
- This will typically cause the kernel to panic if an error is
- detected, but it would have probably crashed if the panic weren't
- there. Comments/questions/problems to linux-scsi mailing list
- please. See <http://www.andante.org/scsi_queue.html> for more
- up-to-date information.
-
Probe all LUNs on each SCSI device
CONFIG_SCSI_MULTI_LUN
If you have a SCSI device that supports more than one LUN (Logical
@@ -6734,7 +6782,7 @@ CONFIG_SCSI_AIC7XXX
intended to replace the previous aic7xxx driver maintained by Doug
Ledford since Doug is no longer maintaining that driver.
-Adaptec I2O RAID controllers
+Adaptec I2O RAID support
CONFIG_SCSI_DPT_I2O
This driver supports all of Adaptec's I2O based RAID controllers as
well as the DPT SmartRaid V cards. This is an Adaptec maintained
@@ -6907,10 +6955,10 @@ CONFIG_SCSI_BUSLOGIC
This is support for BusLogic MultiMaster and FlashPoint SCSI Host
Adapters. Consult the SCSI-HOWTO, available from
<http://www.linuxdoc.org/docs.html#howto>, and the files
- README.BusLogic and README.FlashPoint in drivers/scsi for more
- information. If this driver does not work correctly without
- modification, please contact the author, Leonard N. Zubkoff, by
- email to lnz@dandelion.com.
+ <file:drivers/scsi/README.BusLogic> and
+ <file:drivers/scsi/README.FlashPoint> for more information. If this
+ driver does not work correctly without modification, please contact
+ the author, Leonard N. Zubkoff, by email to lnz@dandelion.com.
You can also build this driver as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
@@ -7087,7 +7135,7 @@ CONFIG_SCSI_NCR_D700
Unless you have an NCR manufactured machine, the chances are that
you do not have this SCSI card, so say N.
-HP LASI SCSI support for 53c700
+HP LASI SCSI support for 53c700/710
CONFIG_SCSI_LASI700
This is a driver for the lasi baseboard in some parisc machines
which is based on the 53c700 chip. Will also support LASI subsystems
@@ -7152,7 +7200,7 @@ CONFIG_SCSI_SYM53C8XX_2
If your system has problems using this new major version of the
SYM53C8XX driver, you may switch back to driver version 1.
- Please read drivers/scsi/sym53c8xx_2/Documentation.txt for more
+ Please read <file:drivers/scsi/sym53c8xx_2/Documentation.txt> for more
information.
PCI DMA addressing mode
@@ -7693,7 +7741,7 @@ CONFIG_SCSI_EATA_MAX_TAGS
NCR53c406a SCSI support
CONFIG_SCSI_NCR53C406A
This is support for the NCR53c406a SCSI host adapter. For user
- configurable parameters, check out <file:drivers/scsi/NCR53c406.c>
+ configurable parameters, check out <file:drivers/scsi/NCR53c406a.c>
in the kernel source. Also read the SCSI-HOWTO, available from
<http://www.linuxdoc.org/docs.html#howto>.
@@ -7799,13 +7847,14 @@ CONFIG_SCSI_MEGARAID
say M here and read <file:Documentation/modules.txt>. The module
will be called megaraid.o.
-Intel/ICP (former GDT SCSI Disk Array) RAID Controller Support
+Intel/ICP (former GDT SCSI Disk Array) RAID Controller support
CONFIG_SCSI_GDTH
Formerly called GDT SCSI Disk Array Controller Support.
This is a driver for RAID/SCSI Disk Array Controllers (EISA/ISA/PCI)
manufactured by Intel/ICP vortex (an Intel Company). It is documented
- in the kernel source in drivers/scsi/gdth.c and drivers/scsi/gdth.h.
+ in the kernel source in <file:drivers/scsi/gdth.c> and
+ <file:drivers/scsi/gdth.h.>
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -8088,7 +8137,7 @@ CONFIG_IEEE1394_PCILYNX_PORTS
# say M here and read <file:Documentation/modules.txt>. The module
# will be called aic5800.o.
#
-OHCI-1394 support
+OHCI-1394 (Open Host Controller Interface) support
CONFIG_IEEE1394_OHCI1394
Enable this driver if you have an IEEE 1394 controller based on the
OHCI-1394 specification. The current driver is only tested with OHCI
@@ -8218,8 +8267,8 @@ CONFIG_SLIP
Normally, your access provider has to support SLIP in order for you
to be able to use it, but there is now a SLIP emulator called SLiRP
- around (available via FTP (user: anonymous) from
- <ftp://metalab.unc.edu/pub/Linux/system/network/serial/>) which
+ around (available from
+ <ftp://ibiblio.org/pub/Linux/system/network/serial/>) which
allows you to use SLIP over a regular dial up shell connection. If
you plan to use SLiRP, make sure to say Y to CSLIP, below. The
NET-3-HOWTO, available from
@@ -8244,7 +8293,7 @@ CONFIG_SLIP_COMPRESSED
on both ends. Ask your access provider if you are not sure and
answer Y, just in case. You will still be able to use plain SLIP. If
you plan to use SLiRP, the SLIP emulator (available from
- <ftp://metalab.unc.edu/pub/Linux/system/network/serial/>) which
+ <ftp://ibiblio.org/pub/Linux/system/network/serial/>) which
allows you to use SLIP over a regular dial up shell connection, you
definitely want to say Y here. The NET-3-HOWTO, available from
<http://www.linuxdoc.org/docs.html#howto>, explains how to configure
@@ -8381,7 +8430,7 @@ CONFIG_PPPOE
This driver requires a specially patched pppd daemon. The patch to
pppd, along with binaries of a patched pppd package can be found at:
- <http://www.shoshin.uwaterloo.ca/~mostrows>.
+ <http://www.shoshin.uwaterloo.ca/~mostrows/>.
Wireless LAN (non-hamradio)
CONFIG_NET_RADIO
@@ -8403,7 +8452,7 @@ CONFIG_NET_RADIO
Some user-level drivers for scarab devices which don't require
special kernel support are available from
- <ftp://shadow.cabi.net/pub/Linux>.
+ <ftp://shadow.cabi.net/pub/Linux/>.
STRIP (Metricom Starmode radio IP)
CONFIG_STRIP
@@ -8663,6 +8712,19 @@ CONFIG_PCMCIA_AXNET
a module, say M here and read <file:Documentation/modules.txt>. If
unsure, say N.
+Asix AX88190 PCMCIA support
+CONFIG_PCMCIA_AXNET
+ Say Y here if you intend to attach an Asix AX88190-based PCMCIA
+ (PC-card) Fast Ethernet card to your computer. These cards are
+ nearly NE2000 compatible but need a separate driver due to a few
+ misfeatures.
+
+ This driver is also available as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want).
+ The module will be called axnet_cs.o. If you want to compile it as
+ a module, say M here and read <file:Documentation/modules.txt>. If
+ unsure, say N.
+
New Media PCMCIA support
CONFIG_PCMCIA_NMCLAN
Say Y here if you intend to attach a New Media Ethernet or LiveWire
@@ -8718,7 +8780,7 @@ CONFIG_PCMCIA_IBMTR
The module will be called ibmtr_cs.o. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
-Xircom Tulip-like CardBus support
+Xircom Tulip-like CardBus support (old driver)
CONFIG_PCMCIA_XIRTULIP
This driver is for the Digital "Tulip" Ethernet CardBus adapters.
It should work with most DEC 21*4*-based chips/ethercards, as well
@@ -8762,12 +8824,6 @@ CONFIG_HERMES
configure your card and that /etc/pcmcia/wireless.opts works :
<http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html>
-Apple Airport support (built-in)
-CONFIG_APPLE_AIRPORT
- Enable support for the Apple Airport card (which is essentially a
- Lucent Orinoco card with a non-standard interface) built into some
- newer Apple Macintosh machines.
-
Hermes 802.11b in PLX9052 based PCI adaptor support
CONFIG_PLX_HERMES
Enable support for PCMCIA cards supported by the "Hermes" (aka
@@ -8849,7 +8905,8 @@ Apple Airport support (built-in)
CONFIG_APPLE_AIRPORT
Say Y here to support the Airport 802.11b wireless Ethernet hardware
built into the Macintosh iBook and other recent PowerPC-based
- Macintosh machines.
+ Macintosh machines. This is essentially a Lucent Orinoco card with
+ a non-standard interface
Xircom Netwave AirSurfer wireless support
CONFIG_PCMCIA_NETWAVE
@@ -8994,7 +9051,7 @@ CONFIG_SYNCLINK_SYNCPPP
of the Cisco HDLC/PPP driver (syncppp.c).
The SyncLink WAN driver (in character devices) must also be enabled.
-FarSync T-Series support
+FarSync T-Series X.21 (and V.35/V.24) cards
CONFIG_FARSYNC
This driver supports the FarSync T-Series X.21 (and V.35/V.24) cards
from FarSite Communications Ltd.
@@ -9097,7 +9154,7 @@ CONFIG_WAN_ROUTER
the price of an external router. If you have one of those cards and
wish to use your Linux box as a WAN router, say Y here and also to
the WAN driver for your card, below. You will then need the
- wan-tools package which is available from <ftp://ftp.sangoma.com>.
+ wan-tools package which is available from <ftp://ftp.sangoma.com/>.
Read <file:Documentation/networking/wan-router.txt> for more
information.
@@ -9479,7 +9536,7 @@ CONFIG_COSA
up. Look at the <http://www.fi.muni.cz/~kas/cosa/> for more
information about the cards (including the pointer to the user-space
utilities). You can also read the comment at the top of the
- <file:drivers/net/cosa.c> for details about the cards and the driver
+ <file:drivers/net/wan/cosa.c> for details about the cards and the driver
itself.
The driver will be compiled as a module ( = code which can be
@@ -9491,7 +9548,7 @@ Etinc PCISYNC serial board support
CONFIG_DSCC4
This is a driver for Etinc PCISYNC boards based on the Infineon
(ex. Siemens) DSCC4 chipset. It is supposed to work with the four
- ports card. Take a look at <http://www.cogenit.fr/dscc4>
+ ports card. Take a look at <http://www.cogenit.fr/dscc4/>
for further informations about the driver and his configuration.
The driver will be compiled as a module ( = code which can be
@@ -9518,7 +9575,7 @@ CONFIG_LANMEDIA
additional external hardware.
To change setting such as syncPPP vs cisco HDLC or clock source you
- will need lmcctl. It is available at <ftp://ftp.lanmedia.com>.
+ will need lmcctl. It is available at <ftp://ftp.lanmedia.com/>.
This code is also available as a module called lmc.o ( = code
which can be inserted in and removed from the running kernel
@@ -9563,12 +9620,12 @@ CONFIG_SBNI
module will be called sbni.o).
You can find more information and last versions of drivers and
- utilities at <http://www.granch.ru>. If you have any question you
+ utilities at <http://www.granch.ru/>. If you have any question you
can send email to sbni@granch.ru.
Say N if unsure.
-SBNI Adapters Multiline feature
+SBNI multiple-line feature support
CONFIG_SBNI_MULTILINE
Schedule traffic for some parallel lines, via SBNI12 adapters.
If you have two computers connected with two parallel lines it's
@@ -9586,7 +9643,7 @@ CONFIG_WAN_ROUTER_DRIVERS
Router".
You will need the wan-tools package which is available from
- <ftp://ftp.sangoma.com>. Read
+ <ftp://ftp.sangoma.com/>. Read
<file:Documentation/networking/wan-router.txt> for more information.
Note that the answer to this question won't directly affect the
@@ -9595,7 +9652,7 @@ CONFIG_WAN_ROUTER_DRIVERS
Sangoma WANPIPE(tm) multiprotocol cards
CONFIG_VENDOR_SANGOMA
- WANPIPE from Sangoma Technologies Inc. (<http://www.sangoma.com>)
+ WANPIPE from Sangoma Technologies Inc. (<http://www.sangoma.com/>)
is a family of intelligent multiprotocol WAN adapters with data
transfer rates up to 4Mbps. They are also known as Synchronous
Data Link Adapters (SDLA) and are designated as S514-PCI or
@@ -9683,7 +9740,7 @@ CONFIG_COMX
Read <file:Documentation/networking/comx.txt> for help on
configuring and using COMX interfaces. Further info on these cards
- can be found at <http://www.itc.hu> or <info@itc.hu>.
+ can be found at <http://www.itc.hu/> or <info@itc.hu>.
You must say Y to "/proc file system support" (CONFIG_PROC_FS) to
use this driver.
@@ -9777,8 +9834,8 @@ CONFIG_COMX_PROTO_FR
Cyclom 2X(tm) multiprotocol cards
CONFIG_CYCLADES_SYNC
- Cyclom 2X from Cyclades Corporation (<http://www.cyclades.com> and
- <http://www.cyclades.com.br)> is an intelligent multiprotocol WAN
+ Cyclom 2X from Cyclades Corporation (<http://www.cyclades.com/> and
+ <http://www.cyclades.com.br/>) is an intelligent multiprotocol WAN
adapter with data transfer rates up to 512 Kbps. These cards support
the X.25 and SNA related protocols. If you have one or more of these
cards, say Y to this option. The next questions will ask you about
@@ -9787,10 +9844,10 @@ CONFIG_CYCLADES_SYNC
While no documentation is available at this time please grab the
wanconfig tarball in
- <http://www.conectiva.com.br/~acme/cycsyn-devel> (with minor changes
+ <http://www.conectiva.com.br/~acme/cycsyn-devel/> (with minor changes
to make it compile with the current wanrouter include files; efforts
are being made to use the original package available at
- <ftp://ftp.sangoma.com>).
+ <ftp://ftp.sangoma.com/>).
Feel free to contact me or the cycsyn-devel mailing list at
acme@conectiva.com.br and cycsyn-devel@bazar.conectiva.com.br for
@@ -10267,15 +10324,7 @@ CONFIG_STNIC
is a 10Mbit/sec Ethernet controller. Product overview and specs at
<http://www.national.com/pf/DP/DP83902A.html>.
-CompactFlash Connection Area
-CONFIG_CF_AREA5
- If your board has "Directly Connected" CompactFlash, You should
- select the area where your CF is connected to.
-
- - "Area5" if CompactFlash is connected to Area 5 (0x14000000)
- - "Area6" if it is connected to Area 6 (0x18000000)
-
- "Area6" will work for most boards. For ADX, select "Area5".
+ If unsure, say N.
3COM cards
CONFIG_NET_VENDOR_3COM
@@ -10622,7 +10671,7 @@ CONFIG_FMV18X
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
-EtherExpressPro support/EtherExpress 10 (i82595) support
+EtherExpressPro and EtherExpress 10 (i82595) support
CONFIG_EEXPRESS_PRO
If you have a network (Ethernet) card of this type, say Y. This
driver supports intel i82595{FX,TX} based boards. Note however
@@ -10766,10 +10815,7 @@ CONFIG_IBMLANA
driver and as a module ( = code which can be inserted in and removed
from the running kernel whenever you want). If you want to compile
it as a module, say M here and read <file:Documentation/modules.txt>
- as well as <file:Documentation/networking/net-modules.txt>.
- If you plan to use more than one network card under linux, read the
- Multiple-Ethernet-mini-HOWTO, available from
- <ftp://sunsite.unc.edu:/pub/Linux/docs/HOWTO/mini>. The only
+ as well as <file:Documentation/networking/net-modules.txt>. The only
currently supported card is the IBM LAN Adapter/A for Ethernet. It
will both support 16K and 32K memory windows, however a 32K window
gives a better security against packet losses. Usage of multiple
@@ -10893,6 +10939,13 @@ CONFIG_TULIP_MWI
If unsure, say N.
+Use PCI shared memory for NIC registers
+CONFIG_TULIP_MMIO
+ Use PCI shared memory for the NIC registers, rather than going through
+ the Tulip's PIO (programmed I/O ports). Faster, but could produce
+ obscure bugs if your mainboard has memory controller timing issues.
+ If in doubt, say N.
+
Digi Intl. RightSwitch SE-X support
CONFIG_DGRS
This is support for the Digi International RightSwitch series of
@@ -10936,7 +10989,7 @@ Myson MTD-8xx PCI Ethernet support
CONFIG_FEALNX
Say Y here to support the Mysom MTD-800 family of PCI-based Ethernet
cards. Specifications and data at
- <http:www.myson.com.hk/mtd/datasheet>.
+ <http://www.myson.com.hk/mtd/datasheet/>.
ICL EtherTeam 16i/32 support
CONFIG_ETH16I
@@ -10980,10 +11033,21 @@ CONFIG_VIA_RHINE
a module, say M here and read <file:Documentation/modules.txt> as
well as <file:Documentation/networking/net-modules.txt>.
+VIA Rhine MMIO support (EXPERIMENTAL)
+CONFIG_VIA_RHINE_MMIO
+ This instructs the driver to use PCI shared memory (MMIO) instead of
+ programmed I/O ports (PIO). Enabling this gives an improvement in
+ processing time in parts of the driver.
+
+ It is not known if this works reliably on all "rhine" based cards,
+ but it has been tested successfully on some DFE-530TX adapters.
+
+ If unsure, say N.
+
Davicom DM910x/DM980x support
CONFIG_DM9102
This driver is for DM9102(A)/DM9132/DM9801 compatible PCI cards from
- Davicom (<http://www.davicom.com.tw>). If you have such a network
+ Davicom (<http://www.davicom.com.tw/>). If you have such a network
(Ethernet) card, say Y. Some information is contained in the file
<file:Documentation/networking/dmfe.txt>.
@@ -11168,8 +11232,7 @@ CONFIG_IBMOL
Wake On Lan, and PCI 100/16/4 adapters.
If you have such an adapter, say Y and read the Token-Ring
- mini-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>.
+ mini-HOWTO, available from <http://www.linuxdoc.org/docs.html#howto>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -11178,15 +11241,14 @@ CONFIG_IBMOL
Also read <file:Documentation/networking/olympic.txt> or check the
Linux Token Ring Project site for the latest information at
- <http://www.linuxtr.net>.
+ <http://www.linuxtr.net/>.
IBM Lanstreamer chipset PCI adapter support
CONFIG_IBMLS
This is support for IBM Lanstreamer PCI Token Ring Cards.
If you have such an adapter, say Y and read the Token-Ring
- mini-HOWTO available via FTP (user:anonymous) from
- <ftp://metalab.unc/edu/pub/Linux/docs/HOWTO>.
+ mini-HOWTO, available from <http://www.linuxdoc.org/docs.html#howto>.
This driver is also available as a modules ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -11337,7 +11399,7 @@ CONFIG_SHAPER
say Y to "QoS and/or fair queueing" above.
To set up and configure shaper devices, you need the shapecfg
- program, available from <ftp://shadow.cabi.net/pub/Linux> in the
+ program, available from <ftp://shadow.cabi.net/pub/Linux/> in the
shaper package.
This driver is also available as a module ( = code which can be
@@ -11598,7 +11660,7 @@ CONFIG_SBPCD2
Say Y here only if you have two CD-ROM controller cards of this type
(usually only if you have more than four drives). You should enter
the parameters for the second, third and fourth interface card into
- <file:include/linux/sbpcd.h> before compiling the new kernel. Read
+ <file:drivers/cdrom/sbpcd.h> before compiling the new kernel. Read
the file <file:Documentation/cdrom/sbpcd>.
Matsushita/Panasonic, ... third CD-ROM controller support
@@ -11883,7 +11945,7 @@ CONFIG_NFTL_RW
<linux-mtd@lists.infradead.org> if you want to help to make it more
reliable.
-Common Flash Interface (CFI) support
+Detect flash chips by Common Flash Interface (CFI) probe
CONFIG_MTD_CFI
The Common Flash Interface specification was developed by Intel,
AMD and other flash manufactures that provides a universal method
@@ -11940,7 +12002,7 @@ CONFIG_MTD_CFI_I4
If your flash chips are interleaved in fours - i.e. you have four
flash chips addressed by each bus cycle, then say 'Y'.
-# Choice: mtd_swap_data
+# Choice: mtd_data_swap
Flash cmd/query data swapping
CONFIG_MTD_CFI_NOSWAP
This option defines the way in which the CPU attempts to arrange
@@ -12080,7 +12142,7 @@ CONFIG_MTD_PNC2000
PNC-2000 is the name of Network Camera product from PHOTRON
Ltd. in Japan. It uses CFI-compliant flash.
-Flash chip mapping on RPXlite PPC board
+Flash chip mapping on RPXlite or CLLF PPC board
CONFIG_MTD_RPXLITE
The RPXLite PowerPC board has CFI-compliant chips mapped in
a strange sparse mapping. This 'mapping' driver supports that
@@ -12156,26 +12218,26 @@ CONFIG_MTD_CSTM_MIPS_IXX
allow a window into the flash. Both CFI and JEDEC probes are
called.
-Physical start location of flash mapping
+Physical start location of flash chip mapping
CONFIG_MTD_CSTM_MIPS_IXX_START
This is the physical memory location that the MTD driver will
use for the flash chips on your particular target board.
Refer to the memory map which should hopefully be in the
documentation for your board.
-Physical length of flash mapping
+Physical length of flash chip mapping
CONFIG_MTD_CSTM_MIPS_IXX_LEN
This is the total length that the MTD driver will use for the
flash chips on your particular board. Refer to the memory
map which should hopefully be in the documentation for your
board.
-Physical bus width of flash mapping
+Physical bus width of flash mapping in bytes
CONFIG_MTD_CSTM_MIPS_IXX_BUSWIDTH
This is the total bus width of the mapping of the flash chips
on your particular board.
-Flash chip mapping on Mixcom piggyback card
+JEDEC Flash device mapped on Mixcom piggyback card
CONFIG_MTD_MIXMEM
This supports the paging arrangement for access to flash chips
on the MixCOM piggyback card, allowing the flash chip drivers
@@ -12184,14 +12246,14 @@ CONFIG_MTD_MIXMEM
you probably want to enable this mapping driver. More info is at
<http://www.itc.hu/>.
-Flash chip mapping on Octagon 5066 SBC
+JEDEC Flash device mapped on Octagon 5066 SBC
CONFIG_MTD_OCTAGON
This provides a 'mapping' driver which supports the way in which
the flash chips are connected in the Octagon-5066 Single Board
Computer. More information on the board is available at
<http://www.octagonsystems.com/Products/5066/5066.html>.
-Flash chip mapping on Tempustech VMAX SBC301
+JEDEC Flash device mapped on Tempustech VMAX SBC301
CONFIG_MTD_VMAX
This provides a 'mapping' driver which supports the way in which
the flash chips are connected in the Tempustech VMAX SBC301 Single
@@ -12362,7 +12424,7 @@ CONFIG_MTDRAM_ABS_POS
allocating space from Linux's available memory. Otherwise, leave
this set to zero. Most people will want to leave this as zero.
-Flash chip mapping on the Flaga Digital Module
+CFI Flash device mapping on the Flaga Digital Module
CONFIG_MTD_CFI_FLAGADM
Mapping for the Flaga digital module. If you don´t have one, ignore
this setting.
@@ -12373,6 +12435,100 @@ CONFIG_MTD_OCELOT
NVRAM on the Momenco Ocelot board. If you have one of these boards
and would like access to either of these, say 'Y'.
+Support for absent chips in bus mapping
+CONFIG_MTD_ABSENT
+ This option enables support for a dummy probing driver used to
+ allocated placeholder MTD devices on systems that have socketed
+ or removable media. Use of this driver as a fallback chip probe
+ preserves the expected registration order of MTD device nodes on
+ the system regardless of media presence. Device nodes created
+ with this driver will return -ENODEV upon access.
+
+MTD emulation using block device
+CONFIG_MTD_BLKMTD
+ This driver allows a block device to appear as an MTD. It would
+ generally be used in the following cases:
+
+ Using Compact Flash as an MTD, these usually present themselves to
+ the system as an ATA drive.
+ Testing MTD users (eg JFFS2) on large media and media that might
+ be removed during a write (using the floppy drive).
+
+Cirrus CDB89712 evaluation board mappings
+CONFIG_MTD_CDB89712
+ This enables access to the flash or ROM chips on the CDB89712 board.
+ If you have such a board, say 'Y'.
+
+Detect non-CFI AMD/JEDEC-compatible flash chips
+CONFIG_MTD_JEDECPROBE
+ This option enables JEDEC-style probing of flash chips which are not
+ compatible with the Common Flash Interface, but will use the common
+ CFI-targetted flash drivers for any chips which are identified which
+ are in fact compatible in all but the probe method. This actually
+ covers most AMD/Fujitsu-compatible chips, and will shortly cover also
+ non-CFI Intel chips (that code is in MTD CVS and should shortly be sent
+ for inclusion in Linus' tree)
+
+BIOS flash chip on Intel L440GX boards
+CONFIG_MTD_L440GX
+ Support for treating the BIOS flash chip on Intel L440GX motherboards
+ as an MTD device - with this you can reprogram your BIOS.
+
+ BE VERY CAREFUL.
+
+28F160xx flash driver for LART
+CONFIG_MTD_LART
+ This enables the flash driver for LART. Please note that you do
+ not need any mapping/chip driver for LART. This one does it all
+ for you, so go disable all of those if you enabled some of them (:
+
+Older (theoretically obsoleted now) drivers for non-CFI chips
+CONFIG_MTD_OBSOLETE_CHIPS
+ This option does not enable any code directly, but will allow you to
+ select some other chip drivers which are now considered obsolete,
+ because the generic CONFIG_JEDEC_PROBE code above should now detect
+ the chips which are supported by these drivers, and allow the generic
+ CFI-compatible drivers to drive the chips. Say 'N' here unless you have
+ already tried the CONFIG_JEDEC_PROBE method and reported its failure
+ to the MTD mailing list at <linux-mtd@lists.infradead.org>
+
+CFI Flash device mapped on Hitachi SolutionEngine
+CONFIG_MTD_SOLUTIONENGINE
+ This enables access to the flash chips on the Hitachi SolutionEngine and
+ similar boards. Say 'Y' if you are building a kernel for such a board.
+
+CFI Flash device mapped on TQM8XXL PPC board
+CONFIG_MTD_TQM8XXL
+ The TQM8xxL PowerPC board has up to two banks of CFI-compliant
+ chips, currently uses AMD one. This 'mapping' driver supports
+ that arrangement, allowing the CFI probe and command set driver
+ code to communicate with the chips on the TQM8xxL board. More at
+ <http://www.denx.de/embedded-ppc-en.html>.
+
+Darkness
+CONFIG_MEMORY_SET
+ This is an option about which you will never be asked a question.
+ Therefore, I conclude that you do not exist - go away.
+
+ There is a grue here.
+
+Physical memory size
+CONFIG_MEMORY_SIZE
+ This sets the default memory size assumed by your SH kernel. It can
+ be overridden as normal by the 'mem=' argument on the kernel command
+ line. If unsure, consult your board specifications or just leave it
+ as 0x00400000 which was the default value before this became
+ configurable.
+
+Cache and PCI noncoherent
+CONFIG_SH_PCIDMA_NONCOHERENT
+ Enable this option if your platform does not have a CPU cache which
+ remains coherent with PCI DMA. It is safest to say 'Y', although you
+ will see better performance if you can say 'N', because the PCI DMA
+ code will not have to flush the CPU's caches. If you have a PCI host
+ bridge integrated with your SH CPU, refer carefully to the chip specs
+ to see if you can say 'N' here. Otherwise, leave it as 'Y'.
+
USB (Universal Serial Bus) support
CONFIG_USB
Universal Serial Bus (USB) is a specification for a serial bus
@@ -12417,7 +12573,7 @@ CONFIG_USB_LARGE_CONFIG
If you have an APC UPS, say Y; otherwise say N.
-USB long timeout
+USB long timeout for slow-responding devices (some MGE Ellipse UPSes)
CONFIG_USB_LONG_TIMEOUT
This option makes the standard time out a bit longer. Basically,
some devices are just slow to respond, so this makes usb more
@@ -12558,7 +12714,7 @@ CONFIG_USB_AIPTEK
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called aiptek.o. If you want to compile it as a
- module, say M here and read Documentation/modules.txt.
+ module, say M here and read <file:Documentation/modules.txt>.
Use input layer for ADB devices
CONFIG_INPUT_ADBHID
@@ -12719,7 +12875,7 @@ USB Handspring Visor Driver
CONFIG_USB_SERIAL_VISOR
Say Y here if you want to connect to your HandSpring Visor, Palm
m500 or m505 through its USB docking station. See
- <http://usbvisor.sourceforge.net> for more information on using this
+ <http://usbvisor.sourceforge.net/> for more information on using this
driver.
This code is also available as a module ( = code which can be
@@ -12755,7 +12911,7 @@ CONFIG_USB_SERIAL_FTDI_SIO
converter device. The implementation I have is called the USC-1000.
This driver has also be tested with the 245 and 232 devices.
- See http://ftdi-usb-sio.sourceforge.net for more
+ See <http://ftdi-usb-sio.sourceforge.net/> for more
information on this driver and the device.
This code is also available as a module ( = code which can be
@@ -12987,12 +13143,12 @@ CONFIG_USB_OV511
The module will be called ov511.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
-USB Communication Class Ethernet driver
+USB Communication Class Ethernet device support
CONFIG_USB_CDCETHER
This driver supports devices conforming to the Communication Device
Class Ethernet Control Model. This is used in some cable modems.
For more details on the specification, get the Communication Device
- Class specification from <http://www.usb.org>.
+ Class specification from <http://www.usb.org/>.
This driver should work with the following devices:
* Ericsson PipeRider (all variants)
@@ -13056,7 +13212,7 @@ CONFIG_USB_PEGASUS
The module will be called pegasus.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
-USB KLSI KL5USB101-based Ethernet device support '
+USB KLSI KL5USB101-based Ethernet device support
CONFIG_USB_KAWETH
Say Y here if you want to use one of the following 10Mbps only
USB Ethernet adapters based on the KLSI KL5KUSB101B chipset:
@@ -13119,7 +13275,7 @@ CONFIG_USB_DC2XX
Say Y here if you want to connect this type of still camera to your
computer's USB port. See <file:Documentation/usb/dc2xx.txt> for
more information; some non-Kodak cameras may also work with this
- driver, given application support (such as <http://www.gPhoto.org>).
+ driver, given application support (such as <http://www.gphoto.org/>).
This code is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -13130,7 +13286,7 @@ USB Mustek MDC800 Digital Camera support
CONFIG_USB_MDC800
Say Y here if you want to connect this type of still camera to
your computer's USB port. This driver can be used with gphoto 0.4.3
- and higher (look at <http://www.gphoto.org>).
+ and higher (look at <http://www.gphoto.org/>).
To use it create a device node with "mknod /dev/mustek c 180 32" and
configure it in your software.
@@ -13154,7 +13310,7 @@ CONFIG_USB_STORAGE_DEBUG
Say Y here in order to have the USB Mass Storage code generate
verbose debugging messages.
-ISD-200 USB/ATA driver
+ISD-200 USB/ATA Bridge support
CONFIG_USB_STORAGE_ISD200
Say Y here if you want to use USB Mass Store devices based
on the In-Systems Design ISD-200 USB/ATA bridge.
@@ -13234,7 +13390,7 @@ CONFIG_USB_BANDWIDTH
DABUSB driver
CONFIG_USB_DABUSB
A Digital Audio Broadcasting (DAB) Receiver for USB and Linux
- brought to you by the DAB-Team (<http://dab.in.tum.de>). This
+ brought to you by the DAB-Team (<http://dab.in.tum.de/>). This
driver can be taken as an example for URB-based bulk, control, and
isochronous transactions. URB's are explained in
<file:Documentation/usb/URB.txt>.
@@ -13274,7 +13430,7 @@ CONFIG_USB_STORAGE_DPCM
reader, details at <http://www.microtechint.com/zio/index.html>.
This driver treats the flash card as a removable storage device.
-Sandisk SDDR-09 SmartMedia reader support
+SanDisk SDDR-09 (and other SmartMedia) support
CONFIG_USB_STORAGE_SDDR09
Say Y here to include additional code to support the Sandisk SDDR-09
SmartMedia reader in the USB Mass Storage driver.
@@ -13472,7 +13628,7 @@ CONFIG_UML_NET_ETHERTAP
running UML to exchange packets with its host over one of the
host's Ethertap devices, such as /dev/tap0. Additional running
UMLs can use additional Ethertap devices, one per running UML.
- While the UML believes its on a (multi-device, broadcast) virtual
+ While the UML believes it's on a (multi-device, broadcast) virtual
Ethernet network, it's in fact communicating over a point-to-point
link with the host.
@@ -13557,7 +13713,7 @@ CONFIG_USB_MICROTEK
and work. SANE 1.0.4 or newer is needed to make use of your scanner.
This driver can be compiled as a module.
-HP 53xx and Minolta Dual Scanner support
+HP53xx and Minolta Dual Scanner support
CONFIG_USB_HPUSBSCSI
Say Y here if you want support for the HP 53xx series of scanners
and the Minolta Scan Dual. This driver is experimental.
@@ -13567,7 +13723,7 @@ USB Bluetooth support
CONFIG_USB_BLUETOOTH
Say Y here if you want to connect a USB Bluetooth device to your
computer's USB port. You will need the Bluetooth stack (available
- at <http://developer.axis.com/software/index.shtml)> to fully use
+ at <http://developer.axis.com/software/index.shtml>) to fully use
the device.
This code is also available as a module ( = code which can be
@@ -13596,14 +13752,14 @@ CONFIG_MINIX_FS
Reiserfs support
CONFIG_REISERFS_FS
Stores not just filenames but the files themselves in a balanced
- tree. Uses journaling.
+ tree. Uses journalling.
Balanced trees are more efficient than traditional file system
architectural foundations.
In general, ReiserFS is as fast as ext2, but is very efficient with
large directories and small files. Additional patches are needed
- for NFS and quotas, please see <http://www.reiserfs.org> for links.
+ for NFS and quotas, please see <http://www.reiserfs.org/> for links.
It is more easily extended to have features currently found in
database and keyword search systems than block allocation based file
@@ -13611,7 +13767,7 @@ CONFIG_REISERFS_FS
plugins consistent with our motto ``It takes more than a license to
make source code open.''
- Read <http://www.reiserfs.org> to learn more about reiserfs.
+ Read <http://www.reiserfs.org/> to learn more about reiserfs.
Sponsored by Threshold Networks, Emusic.com, and Bigstorage.com.
@@ -13639,15 +13795,6 @@ CONFIG_REISERFS_PROC_INFO
everyone but ReiserFS developers and people fine-tuning reiserfs or
tracing problems should say N.
-Publish some reiserfs-specific info under /proc/fs/reiserfs
-CONFIG_REISERFS_PROC_INFO
- Create under /proc/fs/reiserfs hierarchy of files, displaying
- various ReiserFS statistics and internal data on the expense of
- making your kernel or module slightly larger (+8K). This also increases
- amount of kernel memory required for each mount. Almost everyone
- but ReiserFS developers and people fine-tuning reiserfs or tracing
- problems should say NO.
-
Second extended fs support
CONFIG_EXT2_FS
This is the de facto standard Linux file system (method to organize
@@ -13677,10 +13824,10 @@ CONFIG_EXT2_FS
directories on ext2 file systems, use chattr ("man chattr").
Ext2fs partitions can be read from within DOS using the ext2tool
- command line tool package (available via FTP (user: anonymous) from
- <ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2>) and from
+ command line tool package (available from
+ <ftp://ibiblio.org/pub/Linux/system/filesystems/ext2/>) and from
within Windows NT using the ext2nt command line tool package from
- <ftp://metalab.unc.edu/pub/Linux/utils/dos>. Explore2fs is a
+ <ftp://ibiblio.org/pub/Linux/utils/dos/>. Explore2fs is a
graphical explorer for ext2fs partitions which runs on Windows 95
and Windows NT and includes experimental write support; it is
available from
@@ -13694,13 +13841,13 @@ CONFIG_EXT2_FS
be compiled as a module, and so this could be dangerous. Most
everyone wants to say Y here.
-Ext3 journaling file system support (EXPERIMENTAL)
+Ext3 journalling file system support (EXPERIMENTAL)
CONFIG_EXT3_FS
- This is the journaling version of the Second extended file system
+ This is the journalling version of the Second extended file system
(often called ext3), the de facto standard Linux file system
(method to organize files on a storage device) for hard disks.
- The journaling code included in this driver means you do not have
+ The journalling code included in this driver means you do not have
to run e2fsck (file system checker) on your file systems after a
crash. The journal keeps track of any changes that were being made
at the time the system crashed, and can ensure that your file system
@@ -13728,7 +13875,7 @@ CONFIG_EXT3_FS
Journal Block Device support (JBD for ext3) (EXPERIMENTAL)
CONFIG_JBD
- This is a generic journaling layer for block devices. It is
+ This is a generic journalling layer for block devices. It is
currently used by the ext3 file system, but it could also be used to
add journal support to other file systems or block devices such as
RAID or LVM.
@@ -13861,7 +14008,7 @@ CONFIG_JOLIET
which allows for long filenames in unicode format (unicode is the
new 16 bit character code, successor to ASCII, which encodes the
characters of almost all languages of the world; see
- <http://www.unicode.org> for more information). Say Y here if you
+ <http://www.unicode.org/> for more information). Say Y here if you
want to be able to read Joliet CD-ROMs under Linux.
Transparent decompression extension
@@ -13946,7 +14093,7 @@ CONFIG_MSDOS_FS
Linux, you can either use the DOS emulator DOSEMU, described in the
DOSEMU-HOWTO, available from
<http://www.linuxdoc.org/docs.html#howto>, or try dmsdosfs in
- <ftp://metalab.unc.edu/pub/Linux/system/filesystems/dosfs>. If you
+ <ftp://ibiblio.org/pub/Linux/system/filesystems/dosfs/>. If you
intend to use dosemu with a non-compressed MSDOS partition, say Y
here) and MSDOS floppies. This means that file access becomes
transparent, i.e. the MSDOS files look and behave just like all
@@ -14121,8 +14268,9 @@ CONFIG_NFS_FS
level IP autoconfiguration" above and to "Root file system on NFS"
below. You cannot compile this driver as a module in this case.
There are two packages designed for booting diskless machines over
- the net: netboot and etherboot, both available via FTP from
- <ftp://metalab.unc.edu/pub/Linux/system/boot/Ethernet/>.
+ the net: netboot, available from
+ <http://ftp1.sourceforge.net/netboot/>, and Etherboot,
+ available from <http://ftp1.sourceforge.net/etherboot/>.
If you don't know what all this is about, say N.
@@ -14245,7 +14393,7 @@ CONFIG_SYSV_FS
a set of kernel modules that lets you run SCO, Xenix, Wyse,
UnixWare, Dell Unix and System V programs under Linux. It is
available via FTP (user: ftp) from
- <ftp://ftp.openlinux.org/pub/people/hch/linux-abi>).
+ <ftp://ftp.openlinux.org/pub/people/hch/linux-abi/>).
NOTE: that will work only for binaries from Intel-based systems;
PDP ones will have to wait until somebody ports Linux to -11 ;-)
@@ -14374,7 +14522,7 @@ CONFIG_AUTOFS4_FS
automounter (amd), which is a pure user space daemon.
To use the automounter you need the user-space tools from
- <ftp://ftp.kernel.org/pub/linux/daemons/autofs/testing-v4>; you also
+ <ftp://ftp.kernel.org/pub/linux/daemons/autofs/testing-v4/>; you also
want to answer Y to "NFS file system support", below.
If you want to compile this as a module ( = code which can be
@@ -14405,7 +14553,7 @@ CONFIG_EFS_FS
Journalling Flash File System (JFFS) support
CONFIG_JFFS_FS
- JFFS is the Journaling Flash File System developed by Axis
+ JFFS is the Journalling Flash File System developed by Axis
Communications in Sweden, aimed at providing a crash/powerdown-safe
file system for disk-less embedded devices. Further information is
available at (<http://developer.axis.com/software/jffs/>).
@@ -14438,6 +14586,11 @@ CONFIG_JFFS2_FS_DEBUG
If reporting bugs, please try to have available a full dump of the
messages at debug level 1 while the misbehaviour was occurring.
+JFFS stats available in /proc filesystem
+CONFIG_JFFS_PROC_FS
+ Enabling this option will cause statistics from mounted JFFS file systems
+ to be made available to the user in the /proc/fs/jffs/ directory.
+
UFS file system support (read-only)
CONFIG_UFS_FS
BSD and derivate versions of Unix (such as SunOS, FreeBSD, NetBSD,
@@ -14522,7 +14675,7 @@ CONFIG_MAC_PARTITION
Say Y here if you would like to use hard disks under Linux which
were partitioned on a Macintosh.
-Windows' Logical Disk Manager (Dynamic Disk) support (EXPERIMENTAL)
+Windows Logical Disk Manager (Dynamic Disk) support (EXPERIMENTAL)
CONFIG_LDM_PARTITION
Say Y here if you would like to use hard disks under Linux which
were partitioned using Windows 2000's or XP's Logical Disk Manager.
@@ -14538,11 +14691,11 @@ CONFIG_LDM_PARTITION
XP.
Technical documentation to accompany this driver is available from:
- <http://linux-ntfs.sf.net/ldm>.
+ <http://linux-ntfs.sf.net/ldm/>.
If unsure, say N.
-Windows' LDM extra logging
+Windows LDM extra logging
CONFIG_LDM_DEBUG
Say Y here if you would like LDM to log verbosely. This could be
helpful if the driver doesn't work as expected and you'd like to
@@ -14666,7 +14819,6 @@ CONFIG_DEVPTS_FS
Note that the experimental "/dev file system support"
(CONFIG_DEVFS_FS) is a more general facility.
-# This is for Linus's tree
FreeVxFS file system support (VERITAS VxFS(TM) compatible)
CONFIG_VXFS_FS
FreeVxFS is a file system driver that support the VERITAS VxFS(TM)
@@ -14685,25 +14837,6 @@ CONFIG_VXFS_FS
module, say M here and read <file:Documentation/modules.txt>. If
unsure, say N.
-# This is for Alan's tree. Note the name difference.
-FreeVxFS file system support (VERITAS VxFS(TM) compatible)
-CONFIG_FREEVXFS_FS
- FreeVxFS is a file system driver that support the VERITAS VxFS(TM)
- file system format. VERITAS VxFS(TM) is the standard file system
- of SCO UnixWare (and possibly others) and optionally available
- for Sunsoft Solaris, HP-UX and many other operating systems.
- Currently only readonly access is supported.
-
- NOTE: the file system type as used by mount(1), mount(2) and
- fstab(5) is 'vxfs' as it describes the filesystem format, not
- the actual driver.
-
- This file system is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module is called freevxfs.o. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>. If
- unsure, say N.
-
UnixWare slices support
CONFIG_UNIXWARE_DISKLABEL
Like some systems, UnixWare uses its own slice table inside a
@@ -14737,8 +14870,8 @@ CONFIG_SMB_FS
Note: if you just want your box to act as an SMB *server* and make
files and printing services available to Windows clients (which need
to have a TCP/IP stack), you don't need to say Y here; you can use
- the program samba (available via FTP (user: anonymous) in
- <ftp://metalab.unc.edu/pub/Linux/system/network/samba>) for that.
+ the program SAMBA (available from <ftp://ftp.samba.org/pub/samba/>)
+ for that.
General information about how to connect Linux, Windows machines and
Macs is on the WWW at <http://www.eats.com/linux_mac_win.html>.
@@ -14787,14 +14920,14 @@ CONFIG_CODA_FS
client and server. Servers are currently user level, i.e. they need
no kernel support. Please read
<file:Documentation/filesystems/coda.txt> and check out the Coda
- home page <http://www.coda.cs.cmu.edu>.
+ home page <http://www.coda.cs.cmu.edu/>.
If you want to compile the coda client support as a module ( = code
which can be inserted in and removed from the running kernel
whenever you want), say M here and read
<file:Documentation/modules.txt>. The module will be called coda.o.
-InterMezzo file system support (experimental, replicating fs)
+InterMezzo file system support (replicating fs)
CONFIG_INTERMEZZO_FS
InterMezzo is a networked file system with disconnected operation
and kernel level write back caching. It is most often used for
@@ -14803,7 +14936,7 @@ CONFIG_INTERMEZZO_FS
If you say Y or M your kernel or module will provide InterMezzo
support. You will also need a file server daemon, which you can get
- from <http://www.inter-mezzo.org>.
+ from <http://www.inter-mezzo.org/>.
NCP file system support (to mount NetWare volumes)
CONFIG_NCP_FS
@@ -15374,6 +15507,7 @@ CONFIG_SCC_ENET
Enable Ethernet support via the Motorola MPC8xx serial
commmunications controller.
+# Choice: scc_ethernet
Ethernet on SCC1
CONFIG_SCC1_ENET
Use MPC8xx serial communications controller 1 to drive Ethernet
@@ -15455,7 +15589,7 @@ Include IOP (IIfx/Quadra 9x0) ADB driver
CONFIG_ADB_IOP
The I/O Processor (IOP) is an Apple custom IC designed to provide
intelligent support for I/O controllers. It is described at
- <http://www.angelfire.com/ca2/dev68k/iopdesc.html;> to enable direct
+ <http://www.angelfire.com/ca2/dev68k/iopdesc.html> to enable direct
support for it, say 'Y' here.
Mac II style Apple Desktop Bus support
@@ -16150,7 +16284,7 @@ CONFIG_I2C_CHARDEV
<file:Documentation/modules.txt>.
The module will be called i2c-dev.o.
-I2C /proc support
+I2C /proc interface (required for hardware sensors)
CONFIG_I2C_PROC
This provides support for i2c device entries in the /proc filesystem.
The entries will be found in /proc/sys/dev/sensors.
@@ -16164,9 +16298,7 @@ CONFIG_BUSMOUSE
Say Y here if your machine has a bus mouse as opposed to a serial
mouse. Most people have a regular serial MouseSystem or
Microsoft mouse (made by Logitech) that plugs into a COM port
- (rectangular with 9 or 25 pins). These people say N here. If you
- have something else, read the Busmouse-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>, and say Y here.
+ (rectangular with 9 or 25 pins). These people say N here.
If you have a laptop, you either have to check the documentation or
experiment a bit to find out whether the trackball is a serial mouse
@@ -16231,8 +16363,8 @@ CONFIG_PSMOUSE
When using a PS/2 mouse, you can get problems if you want to use the
mouse both on the Linux console and under X. Using the "-R" option
of the Linux mouse managing program gpm (available from
- <ftp://metalab.unc.edu/pub/Linux/system/mouse>) solves this
- problem, or you can get the "mconv2" utility from the same location.
+ <ftp://gnu.systemy.it/pub/gpm/>) solves this problem, or you can get
+ the "mconv2" utility from <ftp://ibiblio.org/pub/Linux/system/mouse/>.
C&T 82C710 mouse port support (as on TI Travelmate)
CONFIG_82C710_MOUSE
@@ -16351,7 +16483,7 @@ CONFIG_FTAPE
Note that the Ftape-HOWTO is out of date (sorry) and documents the
older version 2.08 of this software but still contains useful
information. There is a web page with more recent documentation at
- <http://www.math1.rwth-aachen.de/~heine/ftape/>. This page
+ <http://www.instmath.rwth-aachen.de/~heine/ftape/>. This page
always contains the latest release of the ftape driver and useful
information (backup software, ftape related patches and
documentation, FAQ). Note that the file system interface has
@@ -16387,7 +16519,7 @@ CONFIG_ZFTAPE
file <file:Documentation/ftape.txt> contains a short description of
the most important changes in the file system interface compared to
previous versions of ftape. The ftape home page
- <http://www-math.math.rwth-aachen.de/~LBFM/claus/ftape/> contains
+ <http://www.instmath.rwth-aachen.de/~heine/ftape/> contains
further information.
IMPORTANT NOTE: zftape can read archives created by previous
@@ -16630,7 +16762,7 @@ CONFIG_DRM
introduced in XFree86 4.0. If you say Y here, you need to select
the module that's right for your graphics card from the list below.
These modules provide support for synchronization, security, and
- DMA transfers. Please see <http://dri.sourceforge.net> for more
+ DMA transfers. Please see <http://dri.sourceforge.net/> for more
details. You should also select and configure AGP
(/dev/agpgart) support.
@@ -17096,9 +17228,9 @@ CONFIG_WATCHDOG
in the kernel source.
The watchdog is usually used together with the watchdog daemon
- which is available via FTP (user: anonymous) from
- <ftp://tsx-11.mit.edu/pub/linux/sources/sbin/>. This daemon can also
- monitor NFS connections and can reboot the machine when the process
+ which is available from
+ <ftp://ibiblio.org/pub/Linux/system/daemons/watchdog/>. This daemon can
+ also monitor NFS connections and can reboot the machine when the process
table is full.
If unsure, say N.
@@ -17172,7 +17304,7 @@ CONFIG_PCWATCHDOG
and if it does, it reboots your computer after a certain amount of
time. This driver is like the WDT501 driver but for different
hardware. Please read <file:Documentation/pcwd-watchdog.txt>. The PC
- watchdog cards can be ordered from <http://www.berkprod.com>.
+ watchdog cards can be ordered from <http://www.berkprod.com/>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17407,7 +17539,6 @@ CONFIG_NVRAM
The module will be called nvram.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
-# Linus tree only
Joystick support
CONFIG_JOYSTICK
If you have a joystick, 6dof controller, gamepad, steering wheel,
@@ -17415,18 +17546,17 @@ CONFIG_JOYSTICK
enable generic support for these controllers. You will also need to
say Y or M to at least one of the hardware specific drivers. This
will make the controllers available as /dev/input/jsX devices.
- Please read the file <file:Documentation/joystick.txt> which
+ Please read the file <file:Documentation/input/joystick.txt> which
contains more information and the location of the joystick package
that you'll need.
-# AC tree only
Game port support
CONFIG_INPUT_GAMEPORT
Gameport support is for the standard 15-pin PC gameport. If you
have a joystick, gamepad, gameport card, a soundcard with a gameport
or anything else that uses the gameport, say Y or M here and also to
at least one of the hardware specific drivers.
- Please read the file <file:Documentation/joystick.txt> which
+ Please read the file <file:Documentation/input/joystick.txt> which
contains more information and the location of the joystick package
that you'll need if you use the gameport with a joystick.
@@ -17439,7 +17569,7 @@ Classic ISA/PnP gameports
CONFIG_INPUT_NS558
Say Y here if you have an ISA or PnP gameport.
For more information on how to use the driver please read
- <file:Documentation/joystick.txt>.
+ <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17450,7 +17580,7 @@ PDPI Lightning 4 gamecard
CONFIG_INPUT_LIGHTNING
Say Y here if you have a PDPI Lightning 4 gamecard. For more
information on how to use the driver please read
- <file:Documentation/joystick.txt>.
+ <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17472,7 +17602,7 @@ Aureal Vortex and Trident 4DWave gameports
CONFIG_INPUT_PCIGAME
Say Y here if you have a Trident 4DWave DX/NX or Aureal Vortex 1/2
card. For more information on how to use the driver please read
- <file:Documentation/joystick.txt>.
+ <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17483,7 +17613,7 @@ SoundBlaster Live! gameports
CONFIG_INPUT_EMU10K1
Say Y here if you have a SoundBlaster Live! card and want to use
its gameport. For more information on how to use the driver
- please read <file:Documentation/joystick.txt>.
+ please read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17498,7 +17628,7 @@ CONFIG_INPUT_ANALOG
additional hats and buttons compatible with CH Flightstick Pro,
ThrustMaster FCS, 6 and 8 button gamepads, or Saitek Cyborg
joysticks. For more information on how to use the driver please
- read <file:Documentation/joystick.txt>.
+ read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17509,7 +17639,7 @@ Assassin 3D and MadCatz Panther devices
CONFIG_INPUT_A3D
Say Y here if you have an FPGaming or MadCatz controller using the
A3D protocol over the PC gameport. For more information on how to
- use the driver please read <file:Documentation/joystick.txt>.
+ use the driver please read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17520,7 +17650,7 @@ Logitech ADI digital joysticks and gamepads
CONFIG_INPUT_ADI
Say Y here if you have a Logitech controller using the ADI
protocol over the PC gameport. For more information on how to use
- the driver please read <file:Documentation/joystick.txt>.
+ the driver please read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17531,7 +17661,7 @@ Creative Labs Blaster Cobra gamepad
CONFIG_INPUT_COBRA
Say Y here if you have a Creative Labs Blaster Cobra gamepad.
For more information on how to use the driver please read
- <file:Documentation/joystick.txt>.
+ <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17542,7 +17672,7 @@ Genius Flight2000 Digital joysticks and gamepads
CONFIG_INPUT_GF2K
Say Y here if you have a Genius Flight2000 or MaxFighter digitally
communicating joystick or gamepad. For more information on how to
- use the driver please read <file:Documentation/joystick.txt>.
+ use the driver please read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17553,7 +17683,7 @@ Gravis GrIP joysticks and gamepads
CONFIG_INPUT_GRIP
Say Y here if you have a Gravis controller using the GrIP protocol
over the PC gameport. For more information on how to use the driver
- please read <file:Documentation/joystick.txt>.
+ please read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17564,7 +17694,7 @@ InterAct digital joysticks and gamepads
CONFIG_INPUT_INTERACT
Say Y hereif you have an InterAct gameport or joystick
communicating digitally over the gameport. For more information on
- how to use the driver please read <file:Documentation/joystick.txt>.
+ how to use the driver please read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17576,7 +17706,7 @@ CONFIG_INPUT_TMDC
Say Y here if you have a ThrustMaster controller using the
DirectConnect (BSP) protocol over the PC gameport. For more
information on how to use the driver please read
- <file:Documentation/joystick.txt>.
+ <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17587,7 +17717,7 @@ Microsoft SideWinder digital joysticks and gamepads
CONFIG_INPUT_SIDEWINDER
Say Y here if you have a Microsoft controller using the Digital
Overdrive protocol over PC gameport. For more information on how to
- use the driver please read <file:Documentation/joystick.txt>.
+ use the driver please read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17599,7 +17729,7 @@ CONFIG_INPUT_SERIO
Say Y here and to the Serial port input line discipline option if
you plan to use a joystick that communicates over the serial (COM)
port. For more information on how to use the driver please read
- <file:Documentation/joystick.txt>.
+ <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17610,7 +17740,7 @@ Serial port input line discipline
CONFIG_INPUT_SERPORT
Say Y here if you plan to use a joystick that communicates over the
serial (COM) port. For more information on how to use the driver
- please read <file:Documentation/joystick.txt>.
+ please read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17621,7 +17751,7 @@ Logitech WingMan Warrior joystick
CONFIG_INPUT_WARRIOR
Say Y here if you have a Logitech WingMan Warrior joystick connected
to your computer's serial port. For more information on how to use
- the driver please read <file:Documentation/joystick.txt>.
+ the driver please read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17632,7 +17762,7 @@ LogiCad3d Magellan/SpaceMouse 6dof controller
CONFIG_INPUT_MAGELLAN
Say Y here if you have a Magellan or Space Mouse 6DOF controller
connected to your computer's serial port. For more information on
- how to use the driver please read <file:Documentation/joystick.txt>.
+ how to use the driver please read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17644,7 +17774,7 @@ CONFIG_INPUT_SPACEORB
Say Y here if you have a SpaceOrb 360 or SpaceBall Avenger 6DOF
controller connected to your computer's serial port. For more
information on how to use the driver please read
- <file:Documentation/joystick.txt>.
+ <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17655,7 +17785,7 @@ SpaceTec SpaceBall 4000 FLX 6dof controller
CONFIG_INPUT_SPACEBALL
Say Y here if you have a SpaceTec SpaceBall 4000 FLX controller
connected to your computer's serial port. For more information on
- how to use the driver please read <file:Documentation/joystick.txt>.
+ how to use the driver please read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17666,7 +17796,7 @@ Gravis Stinger gamepad
CONFIG_INPUT_STINGER
Say Y here if you have a Gravis Stinger connected to one of your
serial ports. For more information on how to use the driver please
- read <file:Documentation/joystick.txt>.
+ read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17677,7 +17807,7 @@ I-Force joysticks/wheels
CONFIG_INPUT_IFORCE_232
Say Y here if you have an I-Force joystick or steering wheel
connected to your serial (COM) port. For more information on how
- to use the driver please read <file:Documentation/joystick.txt>.
+ to use the driver please read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17688,7 +17818,7 @@ I-Force joysticks/wheels
CONFIG_INPUT_IFORCE_USB
Say Y here if you have an I-Force joystick or steering wheel
connected to your USB port. For more information on how to use the
- driver please read <file:Documentation/joystick.txt>.
+ driver please read <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17701,8 +17831,8 @@ CONFIG_INPUT_DB9
gamepad, Sega Saturn gamepad, or a Multisystem -- Atari, Amiga,
Commodore, Amstrad CPC joystick connected to your parallel port.
For more information on how to use the driver please read
- <file:Documentation/joystick.txt> and
- <file:Documentation/joystick-parport.txt>.
+ <file:Documentation/input/joystick.txt> and
+ <file:Documentation/input/joystick-parport.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17716,8 +17846,8 @@ CONFIG_INPUT_GAMECON
Sony PlayStation gamepad or a Multisystem -- Atari, Amiga,
Commodore, Amstrad CPC joystick connected to your parallel port.
For more information on how to use the driver please read
- <file:Documentation/joystick.txt> and
- <file:Documentation/joystick-parport.txt>.
+ <file:Documentation/input/joystick.txt> and
+ <file:Documentation/input/joystick-parport.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17729,8 +17859,8 @@ CONFIG_INPUT_TURBOGRAFX
Say Y here if you have the TurboGraFX interface by Steffen Schwenke,
and want to use it with Multisystem -- Atari, Amiga, Commodore,
Amstrad CPC joystick. For more information on how to use the driver
- please read <file:Documentation/joystick.txt> and
- <file:Documentation/joystick-parport.txt>.
+ please read <file:Documentation/input/joystick.txt> and
+ <file:Documentation/input/joystick-parport.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -17741,7 +17871,7 @@ Amiga joysticks
CONFIG_INPUT_AMIJOY
Say Y here if you have an Amiga with a digital joystick connected
to it. For more information on how to use the driver please read
- <file:Documentation/joystick.txt>.
+ <file:Documentation/input/joystick.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -18314,7 +18444,7 @@ CONFIG_SOUND_AEDSP16
questions.
Read the <file:Documentation/sound/README.OSS> file and the head of
- <file:drivers/sound/lowlevel/aedsp16.c> as well as
+ <file:drivers/sound/aedsp16.c> as well as
<file:Documentation/sound/AudioExcelDSP16> to get more information
about this driver and its configuration.
@@ -18373,12 +18503,20 @@ CONFIG_SOUND_CMPCI
or the CMI8378 chipset. Data on these chips are available at
<http://www.cmedia.com.tw/>.
+ A userspace utility to control some internal registers of these
+ chips is available at
+ <http://member.nifty.ne.jp/Breeze/softwares/unix/cmictl-e.html>.
+
Support CMI8738 based audio cards
CONFIG_SOUND_CMPCI_CM8738
Say Y or M if you have a PCI sound card using the CMI8338
or the CMI8378 chipset. Data on this chip is available at
<http://www.cmedia.com.tw/doc8738.htm>.
+ A userspace utility to control some internal registers of these
+ chips is available at
+ <http://member.nifty.ne.jp/Breeze/softwares/unix/cmictl-e.html>.
+
Enable joystick
CONFIG_SOUND_CMPCI_JOYSTICK
Say here in order to enable the joystick port on a sound crd using
@@ -18396,13 +18534,19 @@ CONFIG_SOUND_CMPCI_SPDIFLOOP
"The 8738 Audio SPDIF In/Out Technical Data" on the technical
support page at <http://www.cmedia.com.tw/>.
+ A userspace utility to control even more internal registers of these
+ chips is available at
+ <http://member.nifty.ne.jp/Breeze/softwares/unix/cmictl-e.html>.
+ This package will among other things help you enable SPDIF
+ out/in/loop/monitor.
+
Creative SBLive! (EMU10K1) based PCI sound cards
CONFIG_SOUND_EMU10K1
Say Y or M if you have a PCI sound card using the EMU10K1 chipset,
such as the Creative SBLive!, SB PCI512 or Emu-APS.
For more information on this driver and the degree of support for the
- different card models please check <http://opensource.creative.com>.
+ different card models please check <http://opensource.creative.com/>.
It is now possible to load dsp microcode patches into the EMU10K1
chip. These patches are used to implement real time sound
@@ -18411,7 +18555,7 @@ CONFIG_SOUND_EMU10K1
Userspace tools to create new patches and load/unload them can be
found at <http://opensource.creative.com/dist.html>.
-Creative EMU10K1 MIDI
+Creative SBLive! (EMU10K1) MIDI
CONFIG_MIDI_EMU10K1
Say Y if you want to be able to use the OSS /dev/sequencer
interface. This code is still experimental.
@@ -18635,7 +18779,7 @@ CONFIG_MIPS_EV96100
Support for ITE 8172G board
CONFIG_MIPS_ITE8172
- Ths is an evaluation board made by ITE (http://www.ite.com.tw/)
+ Ths is an evaluation board made by ITE <http://www.ite.com.tw/>
with ATX form factor that utilizes a MIPS R5000 to work with its
ITE8172G companion internet appliance chip. The MIPS core can be
either a NEC Vr5432 or QED RM5231. Say Y here if you wish to build
@@ -18664,20 +18808,21 @@ CONFIG_NINO
website at <http://www.realitydiluted.com/projects/nino/index.html>
will have more information.
-Model-500/510
-CONFIG_NINO_16MB
- Say Y here to build a kernel specifically for Nino 500/501 color
- Palm PCs from Philips (INCOMPLETE).
+# Choice: nino_model
+CONFIG_NINO_4MB
+ Say Y here to build a kernel specifically for Nino Palm PCs with
+ 4MB of memory. These include models 300/301/302/319.
Model-200/210/312/320/325/350/390
CONFIG_NINO_8MB
Say Y here to build a kernel specifically for Nino Palm PCs with
8MB of memory. These include models 200/210/312/320/325/350/390.
+Model-500/510
+CONFIG_NINO_16MB
+ Say Y here to build a kernel specifically for Nino 500/501 color
+ Palm PCs from Philips (INCOMPLETE).
Model-300/301/302/319
-CONFIG_NINO_4MB
- Say Y here to build a kernel specifically for Nino Palm PCs with
- 4MB of memory. These include models 300/301/302/319.
Low-level debugging
CONFIG_LL_DEBUG
@@ -19123,7 +19268,7 @@ CONFIG_HISAX_SEDLBAUER_CS
This enables the PCMCIA client driver for the Sedlbauer Speed Star
and Speed Star II cards.
-ST5481 USB ISDN adapter
+ST5481 USB ISDN modem
CONFIG_HISAX_ST5481
This enables the driver for ST5481 based USB ISDN adapters,
e.g. the BeWan Gazel 128 USB
@@ -19149,7 +19294,7 @@ CONFIG_ISDN_DRV_SC
can be inserted in and removed from the running kernel whenever you
want, details in <file:Documentation/modules.txt>); the module will
be called sc.o. See <file:Documentation/isdn/README.sc> and
- <http://www.spellcast.com> for more information.
+ <http://www.spellcast.com/> for more information.
Eicon active card support
CONFIG_ISDN_DRV_EICON
@@ -19291,7 +19436,7 @@ CONFIG_ISDN_DRV_TPAM
This enables support for the Auvertech TurboPAM ISDN-card.
For running this card, additional firmware is necessary, which has
to be downloaded into the card using a utility which is distributed
- separately from the Auvertech's web site: <http://www.auvertech.fr>.
+ separately from the Auvertech's web site: <http://www.auvertech.fr/>.
Please redirect all support questions to support@auvertech.fr.
@@ -19486,7 +19631,7 @@ CONFIG_BLUEZ
It was designed as a replacement for cables and other short-range
technologies like IrDA. Bluetooth operates in personal area range
that typically extends up to 10 meters. More information about
- Bluetooth can be found at <http://www.bluetooth.com>.
+ Bluetooth can be found at <http://www.bluetooth.com/>.
Linux Bluetooth subsystem consist of several layers:
HCI Core (device and connection manager, scheduler)
@@ -19499,7 +19644,7 @@ CONFIG_BLUEZ
To use Linux Bluetooth subsystem, you will need several user-space
utilities like hciconfig and hcid. These utilities and updates to
Bluetooth kernel modules are provided in the BlueZ package.
- For more information, see <http://bluez.sf.net>.
+ For more information, see <http://bluez.sourceforge.net/>.
If you want to compile HCI Core as module (hci.o) say M here.
@@ -19541,62 +19686,6 @@ CONFIG_BLUEZ_HCIVHCI
# The following options are for Linux when running on the Hitachi
# SuperH family of RISC microprocessors.
-CPU Selection
-CONFIG_CPU_SUBTYPE_SH7707
- This is the type of your Hitachi SuperH processor. This information is
- used for optimizing and configuration purposes.
-
- - "SH7707" for SH7707
- - "SH7708" for SH7708, SH7708S, SH7708R
- - "SH7709" for SH7707, SH7709, SH7709A, and SH7729.
- - "SH7750" for SH7750, SH7750S
- - "SH7751" for SH7751
- - "ST40STB1" for ST40STB1
-
-Target machine selection
-CONFIG_SH_GENERIC
- This is machine type of your target.
-
- - "Generic" for Generic kernel which might support all of them
- - "SolutionEngine" for Hitachi SolutionEngine (7709A, 7750, 7750S)
- - "SolutionEngine7751" for Hitachi SolutionEngine (7751)
- - "STB1_Harp" for STMicroelectronics HARP
- - "STB1_Overdrive" for STMicroelectronics Overdrive
- - "HP620" for HP 'Jornada' 620
- - "HP680" for HP 'Jornada' 680
- - "HP690" for HP 'Jornada' 690
- - "CqREEK" for CQ Publishing CqREEK SH-4
- - "DMIDA" for DMIDA, industrial data assistant
- - "EC3104" for Compaq Aero 8000
- - "Dreamcast" for SEGA Dreamcast
- - "CAT68701" for CAT 68701 Evaluation Board (SH7708)
- - "BigSur" for Big Sur Evaluation Board
- - "SH2000" for SH2000 Evaluation Board (SH7709A)
- - "ADX" for A&D ADX
- - "BareCPU" for Bare CPU board such as CqREEK SH-3
-
- If unsure, select "BareCPU".
-
-Physical memory start address
-CONFIG_MEMORY_START
- Computers built with Hitachi SuperH processors always
- map the ROM starting at address zero. But the processor
- does not specify the range that RAM takes. RAM is usually
- mapped starting at 0c000000, but it may be elsewhere.
-
- You should set this value to the address of the lowest
- RAM location.
-
- A value of 0c000000 will work for most boards.
-
-Directly Connected Compact Flash support
-CONFIG_CF_ENABLER
- If your board has "Directly Connected" CompactFlash at area 5 or 6,
- you may want to enable this option. Then, you can use CF as
- primary IDE drive (only tested for SanDisk).
-
- If in doubt, press "n".
-
SuperH RTC support
CONFIG_SH_RTC
Selecting this option will allow the Linux kernel to emulate
@@ -19611,38 +19700,7 @@ CONFIG_SH_DMA
If unsure, say N.
-SuperH SCI (serial) support
-CONFIG_SH_SCI
- Selecting this option will allow the Linux kernel to transfer
- data over SCI (Serial Communication Interface) and/or SCIF
- which are built into the Hitachi SuperH processor.
-
- If unsure, say N.
-
-Use LinuxSH standard BIOS
-CONFIG_SH_STANDARD_BIOS
- Say Y here if your target has the gdb-sh-stub package from
- www.m17n.org (or any conforming standard LinuxSH BIOS) in FLASH
- or EPROM. The kernel will use standard BIOS calls during boot
- for various housekeeping tasks. Note this does not work with
- WindowsCE machines. If unsure, say N.
-
-Early printk support
-CONFIG_SH_EARLY_PRINTK
- If you say Y here, the kernel printk routine will begin output to
- the console much earlier in the boot process, before the serial
- console is initialised, instead of buffering output. Standard
- LinuxSH BIOS calls are used for the output. This helps when
- debugging fatal problems early in the boot sequence. This is only
- useful for kernel hackers. If unsure, say N.
-
-National Semiconductor DP83902AV 'ST-NIC' support
-CONFIG_STNIC
- If you have a network adaptor with National Semiconductor DP83902AV,
- say Y or M (for module).
-
- If unsure, say N.
-
+# Choice: cf_area
CompactFlash Connection Area
CONFIG_CF_AREA5
If your board has "Directly Connected" CompactFlash, You should
@@ -19724,6 +19782,12 @@ CONFIG_Q40
Q60. Select your CPU below. For 68LC060 don't forget to enable FPU
emulation.
+Q40/Q60 IDE interface support
+CONFIG_BLK_DEV_Q40IDE
+ Enable the on-board IDE controller in the Q40/Q60. This should
+ normally be on; disable it only if you are running a custom hard
+ drive subsystem through an expansion card.
+
Sun 3 support
CONFIG_SUN3
This option enables support for the Sun 3 series of workstations.
@@ -20332,7 +20396,7 @@ CONFIG_8260
If in doubt, say N.
-# Choice: Machine type
+# Choice: ppc4xxtype
Oak
CONFIG_OAK
Select Oak if you have an IBM 403GCX "Oak" Evaluation Board.
@@ -20377,13 +20441,14 @@ CONFIG_8xx_CPU6
If in doubt, say N here.
-MPC8xx IDE support
+MPC8xx direct IDE support on PCMCIA port
CONFIG_BLK_DEV_MPC8xx_IDE
This option provides support for IDE on Motorola MPC8xx Systems.
Please see 'Type of MPC8xx IDE interface' for details.
If unsure, say N.
+# Choice: mpc8xxtype
Type of MPC8xx IDE interface
CONFIG_IDE_8xx_PCCARD
Select how the IDE devices are connected to the MPC8xx system:
@@ -20444,7 +20509,7 @@ CONFIG_ALL_PPC
<http://www.synergymicro.com/PressRel/97_10_15.html>.
Select APUS if configuring for a PowerUP Amiga. More information is
- available at: <http://linux-apus.sourceforge.net>.
+ available at: <http://linux-apus.sourceforge.net/>.
Synergy-Gemini
CONFIG_GEMINI
@@ -20456,124 +20521,9 @@ Amiga-Apus
CONFIG_APUS
Select APUS if configuring for a PowerUP Amiga.
More information is available at:
- <http://linux-apus.sourceforge.net>.
+ <http://linux-apus.sourceforge.net/>.
-Embedded 8xx Board Type
-CONFIG_RPXLITE
- RPX-Lite:
- Embedded Planet RPX Lite
-
- RPX-Classic:
- Embedded Planet RPX Classic Low-fat.
-
- BSE-IP:
- Bright Star Engineering ip-Engine.
-
- TQM823L:
- TQM850L:
- TQM855L:
- TQM860L:
- MPC8xx based family of mini modules, half credit card size,
- up to 64 MB of RAM, 8 MB Flash, (Fast) Ethernet, 2 x serial ports,
- 2 x CAN bus interface, ...
- Manufacturer: TQ Components, www.tq-group.de
- Date of Release: October (?) 1999
- End of Life: not yet :-)
- URL:
- - module: http://www.denx.de/PDF/TQM8xxLHWM201.pdf
- - starter kit: http://www.denx.de/PDF/STK8xxLHWM201.pdf
- - images: http://www.denx.de/embedded-ppc-en.html
-
- FPS850L:
- FingerPrint Sensor System (based on TQM850L)
- Manufacturer: IKENDI AG, http://www.ikendi.com/
- Date of Release: November 1999
- End of life: end 2000 ?
- URL: see TQM850L
-
- SPD823TS:
- MPC823 based board used in the "Tele Server" product
- Manufacturer: Speech Design, http://www.speech-design.de/
- Date of Release: Mid 2000 (?)
- End of life: -
- URL: http://www.speech-design.de/
- select "English", then "Teleteam Solutions", then "TeleServer"
-
- IVMS8:
- MPC860 based board used in the "Integrated Voice Mail System",
- Small Version (8 voice channels)
- Manufacturer: Speech Design, http://www.speech-design.de/
- Date of Release: December 2000 (?)
- End of life: -
- URL: http://www.speech-design.de/
-
- IVML24:
- MPC860 based board used in the "Integrated Voice Mail System",
- Large Version (24 voice channels)
- Manufacturer: Speech Design, http://www.speech-design.de/
- Date of Release: March 2001 (?)
- End of life: -
- URL: http://www.speech-design.de/
-
- SM850:
- Service Module (based on TQM850L)
- Manufacturer: Dependable Computer Systems, http://www.decomsys.com/
- Date of Release: end 2000 (?)
- End of life: mid 2001 (?)
- URL: http://www.tz-mikroelektronik.de/ServiceModule/index.html
-
- HERMES:
- Hermes-Pro ISDN/LAN router with integrated 8 x hub
- Manufacturer: Multidata Gesellschaft für Datentechnik und Informatik
- http://www.multidata.de/
- Date of Release: 2000 (?)
- End of life: -
- URL: http://www.multidata.de/english/products/hpro.htm
-
- IP860:
- VMEBus IP (Industry Pack) carrier board with MPC860
- Manufacturer: MicroSys GmbH, http://www.microsys.de/
- Date of Release: ?
- End of life: -
- URL: http://www.microsys.de/html/ip860.html
-
- PCU_E:
- PCU = Peripheral Controller Unit, Extended
- Manufacturer: Siemens AG, ICN (Information and Communication Networks)
- http://www.siemens.de/page/1,3771,224315-1-999_2_226207-0,00.html
- Date of Release: April 2001
- End of life: August 2001
- URL: n. a.
-
-Embedded 82xx Board Type
-CONFIG_EST8260
- EST8260: Wind River System, Inc. EST SBC8260
-
- TQM8260:
- MPC8260 based module, little larger than credit card,
- up to 128 MB global + 64 MB local RAM, 32 MB Flash,
- 32 kB EEPROM, 256 kB L@ Cache, 10baseT + 100baseT Ethernet,
- 2 x serial ports, ...
- Manufacturer: TQ Components, www.tq-group.de
- Date of Release: June 2001
- End of Life: not yet :-)
- URL: http://www.denx.de/PDF/TQM82xx_SPEC_Rev005.pdf
-
- PM826:
- Modular system with MPC8260 CPU
- Manufacturer: MicroSys GmbH, http://www.microsys.de/
- Date of Release: mid 2001
- End of life: -
- URL: http://www.microsys.de/html/pm826.html
-
- CU824:
- VMEBus Board with PCI extension with MPC8240 CPU
- Manufacturer: MicroSys GmbH, http://www.microsys.de/
- Date of Release: early 2001 (?)
- End of life: -
- URL: http://www.microsys.de/html/cu824.html
-
-AltiVec Kernel Support
+AltiVec kernel support
CONFIG_ALTIVEC
This option enables kernel support for the Altivec extensions to the
PowerPC processor. The kernel currently supports saving and restoring
@@ -20645,26 +20595,97 @@ CONFIG_PMAC_BACKLIGHT
change the screen brightness.
# Choice: ppc8xxtype
-RPX-Lite
+Embedded 8xx Board Type
CONFIG_RPXLITE
Single-board computers based around the PowerPC MPC8xx chips and
intended for embedded applications. The following types are
supported:
- RPX-Lite -- PC104 form-factor SBC based on the MPC823
- RPX-Classic -- Credit-card-size SBC based on the MPC 860
- BSE-IP -- Bright Star Engineering BSE-IP SBC
- TQM823L -- TQM823L SBC from TQ Components
- TQM850L -- TQM850L SBC from TQ Components
- TQM855L -- TQM855L SBC from TQ Components
- TQM860L -- TQM860L SBC from TQ Components
- FPS850L -- FingerPrint Sensor from TQ Components
- TQM860 -- TQM860 SBC from IKENDI AG
- SPD823TS -- Speech Design TeleServer from Speech Design
- IVMS8 -- Integrated VoiceMail SBC from Speech Design
- SM850 -- Service Module 850 from Dependable Computer Systems
- MBX -- MBX821 and MBX860 SBCs
- Wincept -- Wincept SBCs for thin-client machines
+ RPX-Lite:
+ Embedded Planet RPX Lite. PC104 form-factor SBC based on the MPC823.
+
+ RPX-Classic:
+ Embedded Planet RPX Classic Low-fat. Credit-card-size SBC based on
+ the MPC 860
+
+ BSE-IP:
+ Bright Star Engineering ip-Engine.
+
+ TQM823L:
+ TQM850L:
+ TQM855L:
+ TQM860L:
+ MPC8xx based family of mini modules, half credit card size,
+ up to 64 MB of RAM, 8 MB Flash, (Fast) Ethernet, 2 x serial ports,
+ 2 x CAN bus interface, ...
+ Manufacturer: TQ Components, www.tq-group.de
+ Date of Release: October (?) 1999
+ End of Life: not yet :-)
+ URL:
+ - module: <http://www.denx.de/PDF/TQM8xxLHWM201.pdf>
+ - starter kit: <http://www.denx.de/PDF/STK8xxLHWM201.pdf>
+ - images: <http://www.denx.de/embedded-ppc-en.html>
+
+ FPS850L:
+ FingerPrint Sensor System (based on TQM850L)
+ Manufacturer: IKENDI AG, <http://www.ikendi.com/>
+ Date of Release: November 1999
+ End of life: end 2000 ?
+ URL: see TQM850L
+
+ SPD823TS:
+ MPC823 based board used in the "Tele Server" product
+ Manufacturer: Speech Design, <http://www.speech-design.de/>
+ Date of Release: Mid 2000 (?)
+ End of life: -
+ URL: <http://www.speech-design.de/>
+ select "English", then "Teleteam Solutions", then "TeleServer"
+
+ IVMS8:
+ MPC860 based board used in the "Integrated Voice Mail System",
+ Small Version (8 voice channels)
+ Manufacturer: Speech Design, <http://www.speech-design.de/>
+ Date of Release: December 2000 (?)
+ End of life: -
+ URL: <http://www.speech-design.de/>
+
+ IVML24:
+ MPC860 based board used in the "Integrated Voice Mail System",
+ Large Version (24 voice channels)
+ Manufacturer: Speech Design, <http://www.speech-design.de/>
+ Date of Release: March 2001 (?)
+ End of life: -
+ URL: <http://www.speech-design.de/>
+
+ SM850:
+ Service Module (based on TQM850L)
+ Manufacturer: Dependable Computer Systems, <http://www.decomsys.com/>
+ Date of Release: end 2000 (?)
+ End of life: mid 2001 (?)
+ URL: <http://www.tz-mikroelektronik.de/ServiceModule/index.html>
+
+ HERMES:
+ Hermes-Pro ISDN/LAN router with integrated 8 x hub
+ Manufacturer: Multidata Gesellschaft für Datentechnik und Informatik
+ <http://www.multidata.de/>
+ Date of Release: 2000 (?)
+ End of life: -
+ URL: <http://www.multidata.de/english/products/hpro.htm>
+
+ IP860:
+ VMEBus IP (Industry Pack) carrier board with MPC860
+ Manufacturer: MicroSys GmbH, <http://www.microsys.de/>
+ Date of Release: ?
+ End of life: -
+ URL: <http://www.microsys.de/html/ip860.html>
+
+ PCU_E:
+ PCU = Peripheral Controller Unit, Extended
+ Manufacturer: Siemens AG, ICN (Information and Communication Networks)
+ <http://www.siemens.de/page/1,3771,224315-1-999_2_226207-0,00.html>
+ Date of Release: April 2001
+ End of life: August 2001
+ URL: n. a.
RPX-Classic
CONFIG_RPXCLASSIC
@@ -20792,7 +20813,7 @@ CONFIG_WINCEPT
# Manufacturer: MicroSys GmbH, <http://www.microsys.de/>
# Date of Release: early 2001 (?)
# End of life: -
-# URL: <http://www.microsys.de/html/cu824.html
+# URL: <http://www.microsys.de/html/cu824.html>
#
# PM826:
# Modular system with MPC8260 CPU
@@ -20811,13 +20832,39 @@ CONFIG_WINCEPT
# End of life: -
# URL: n. a.o
-Support for EST8260
+# Choice: ppc82xxtype
+Embedded 82xx Board Type
CONFIG_EST8260
- The EST8260 is a single-board computer manufactured by Wind River
- Systems, Inc. (formerly Embedded Support Tools Corp.) and based on
- the MPC8260. Wind River Systems has a website at
- <http://www.windriver.com/>, but the EST8260 cannot be found on it
- and has probably been discontinued or rebadged.
+ EST8260:
+ The EST8260 is a single-board computer manufactured by Wind River
+ Systems, Inc. (formerly Embedded Support Tools Corp.) and based on
+ the MPC8260. Wind River Systems has a website at
+ <http://www.windriver.com/>, but the EST8260 cannot be found on it
+ and has probably been discontinued or rebadged.
+
+ TQM8260:
+ MPC8260 based module, little larger than credit card,
+ up to 128 MB global + 64 MB local RAM, 32 MB Flash,
+ 32 kB EEPROM, 256 kB L@ Cache, 10baseT + 100baseT Ethernet,
+ 2 x serial ports, ...
+ Manufacturer: TQ Components, www.tq-group.de
+ Date of Release: June 2001
+ End of Life: not yet :-)
+ URL: <http://www.denx.de/PDF/TQM82xx_SPEC_Rev005.pdf>
+
+ PM826:
+ Modular system with MPC8260 CPU
+ Manufacturer: MicroSys GmbH, <http://www.microsys.de/>
+ Date of Release: mid 2001
+ End of life: -
+ URL: <http://www.microsys.de/html/pm826.html>
+
+ CU824:
+ VMEBus Board with PCI extension with MPC8240 CPU
+ Manufacturer: MicroSys GmbH, http://www.microsys.de/
+ Date of Release: early 2001 (?)
+ End of life: -
+ URL: <http://www.microsys.de/html/cu824.html>
ADB raw keycode support
CONFIG_MAC_ADBKEYCODES
@@ -20831,6 +20878,13 @@ CONFIG_MAC_ADBKEYCODES
If unsure, say Y here.
+I2C/SPI Microcode Patch
+CONFIG_UCODE_PATCH
+ Motorola releases microcode updates for their 8xx CPM modules. The
+ microcode update file has updates for IIC, SMC and USB. Currently only
+ the USB update is available by default, if the MPC8xx USB option is
+ enabled. If in doubt, say 'N' here.
+
Mouse button 2+3 emulation support
CONFIG_MAC_EMUMOUSEBTN
This provides generic support for emulating the 2nd and 3rd mouse
@@ -20974,7 +21028,7 @@ CONFIG_VIDEO_DEV
Support for audio/video capture and overlay devices and FM radio
cards. The exact capabilities of each device vary. User tools for
this are available from
- <ftp://ftp.uk.linux.org/pub/linux/video4linux>.
+ <ftp://ftp.uk.linux.org/pub/linux/video4linux/>.
If you are interested in writing a driver for such an audio/video
device or user software interacting with such a driver, please read
@@ -21214,7 +21268,7 @@ CONFIG_RADIO_MAESTRO
Guillemot MAXI Radio FM 2000 Radio Card
CONFIG_RADIO_MAXIRADIO
Choose Y here if you have this radio card. This card may also be
- found as Gemtek PCI FM.
+ found as GemTek PCI FM.
In order to control your radio card, you will need to use programs
that are compatible with the Video For Linux API. Information on
@@ -21245,10 +21299,10 @@ GemTek I/O port
CONFIG_RADIO_GEMTEK_PORT
Enter either 0x20c, 0x30c, 0x24c or 0x34c here. The card default is
0x34c, if you haven't changed the jumper setting on the card. On
- Sound Vision 16 Gold PnP with FM Radio (ESS1869+FM Gemtek), the I/O
+ Sound Vision 16 Gold PnP with FM Radio (ESS1869+FM GemTek), the I/O
port is 0x28c.
-Gemtek PCI Radio
+GemTek PCI Radio Card support
CONFIG_RADIO_GEMTEK_PCI
Choose Y here if you have this PCI FM radio card.
@@ -21326,7 +21380,7 @@ CONFIG_VIDEO_BT848
whenever you want). If you want to compile it as a module, say M
here and read <file:Documentation/modules.txt>.
-BT878 Audio DMA
+BT878 audio DMA
CONFIG_SOUND_BT878
Audio DMA support for bt878 based grabber boards. As you might have
already noticed, bt878 is listed with two functions in /proc/pci.
@@ -21360,7 +21414,7 @@ CONFIG_VIDEO_ZORAN
Miro DC10 and DC30 video capture cards).
Include support for Iomega Buz
-CONFIG_VIDEO_BUZ
+CONFIG_VIDEO_ZORAN_BUZ
Say Y here to include support for the Iomega Buz video card. There
is a Buz/Linux homepage at <http://www.lysator.liu.se/~gz/buz/>.
@@ -21453,7 +21507,7 @@ CONFIG_VIDEO_PMS
it as a module, say M here and read
<file:Documentation/modules.txt>.
-Sony Vaio Picturebook Motion Eye Video for Linux
+Sony Vaio Picturebook Motion Eye Video For Linux
CONFIG_VIDEO_MEYE
This is the video4linux driver for the Motion Eye camera found
in the Vaio Picturebook laptops. Please read the material in
@@ -21516,16 +21570,16 @@ CONFIG_S390_PARTITION
attached to another IBM mainframe operation system (OS/390,
VM/ESA, VSE/ESA).
-ECKD devices
+Support for ECKD hard disks
CONFIG_DASD_ECKD
- ECKD devices are the most commonly used devices. you should enable
- this option unless you are very sure to have no ECKD device.
+ ECKD devices are the most commonly used devices. You should enable
+ this option unless you are very sure you have no ECKD device.
CKD devices
CONFIG_DASD_CKD
CKD devices are currently unsupported.
-FBA devices
+Support for FBA hard disks
CONFIG_DASD_FBA
FBA devices are currently unsupported.
@@ -21538,25 +21592,23 @@ CONFIG_IPLABLE
CONFIG_IPLABE.
Support for 3215 line mode terminal
-CONFIG_3215
- Include support for IBM 3215 line-mode terminals. Can't be used
- if 3270 console support is chosen.
+CONFIG_TN3215
+ Include support for IBM 3215 line-mode terminals.
Support for console on 3215 line mode terminal
-CONFIG_3215_CONSOLE
- Include support for using an IBM 3215 line-mode terminal as the
- Linux system console. Can't be used if 3270 console support is
- chosen.
+CONFIG_TN3215_CONSOLE
+ Include support for using an IBM 3215 line-mode terminal as a
+ Linux system console.
Support for 3270 line mode terminal
-CONFIG_3270
+CONFIG_TN3270
Include support for IBM 3270 line-mode terminals.
Support for console on 3270 line mode terminal
-CONFIG_3270_CONSOLE
- Include support for using an IBM 3270 line-mode terminal as the
- Linux system console. Excludes using 3215s. Available only if 3270
- support is compiled in statically.
+CONFIG_TN3270_CONSOLE
+ Include support for using an IBM 3270 line-mode terminal as a Linux
+ system console. Available only if 3270 support is compiled in
+ statically.
Support for HWC line mode terminal
CONFIG_HWC
@@ -21807,7 +21859,7 @@ CONFIG_ARCH_PERSONAL_SERVER
There are no product plans beyond the current research
prototypes at this time. Information is available at:
- <http://crl.research.compaq.com/projects/personalserver>
+ <http://crl.research.compaq.com/projects/personalserver/>
If you have any questions or comments about the Compaq Personal
Server, send e-mail to skiff@crl.dec.com.
@@ -21858,6 +21910,12 @@ CONFIG_SA1100_CERF
Say Y if configuring for an Intrinsyc CerfBoard.
Say N otherwise.
+FlexaNet
+CONFIG_SA1100_FLEXANET
+ Say Y here if you intend to run this kernel on the FlexaNet
+ handheld instruments. Information about this machine can be
+ found at: <http://www.flexanet.com/>.
+
nanoEngine
CONFIG_SA1100_NANOENGINE
The nanoEngine is a StrongARM 1110-based single board computer
@@ -21884,6 +21942,38 @@ CONFIG_SA1100_VICTOR
<http://www.visuaide.com/pagevictor.en.html> for information on
this system.
+# Choice: cerf_ram
+Cerf on-board RAM size
+CONFIG_SA1100_CERF_8MB
+ Declare the size of the CerfBoard's on-board RAM.
+ Alternatives are 8, 16, 32, and 64MB.
+
+16MB
+CONFIG_SA1100_CERF_16MB
+ Declare that the CerfBoard has 16MB RAM.
+
+32MB
+CONFIG_SA1100_CERF_32MB
+ Declare that the CerfBoard has 32MB RAM.
+
+64MB
+CONFIG_SA1100_CERF_64MB
+ Declare that the CerfBoard has 64MB RAM.
+
+# Choice: cerf_flash
+Cerf flash memory size
+CONFIG_SA1100_CERF_FLASH_8MB
+ Tell the Cerf kernel the size of on-board memory. The choices
+ are 8MB, 16MB, or 32MB.
+
+16MB
+CONFIG_SA1100_CERF_FLASH_16MB
+ Configure the Cerf kernel to expect 16MB of flash memory.
+
+32MB
+CONFIG_SA1100_CERF_FLASH_32MB
+ Configure the Cerf kernel to expect 32MB of flash memory.
+
Support ARM610 processor
CONFIG_CPU_ARM610
The ARM610 is the successor to the ARM3 processor
@@ -22245,11 +22335,6 @@ CONFIG_IRDA_ULTRA
no management frames, simple fixed header).
Ultra is available as a special socket : socket(AF_IRDA, SOCK_DGRAM, 1);
-IrDA protocol options
-CONFIG_IRDA_OPTIONS
- Say Y here if you want to configure any of the following IrDA
- options.
-
IrDA cache last LSAP
CONFIG_IRDA_CACHE_LAST_LSAP
Say Y here if you want IrLMP to cache the last LSAP used. This
@@ -22261,47 +22346,35 @@ CONFIG_IRDA_CACHE_LAST_LSAP
IrDA Fast RRs
CONFIG_IRDA_FAST_RR
Say Y here is you want IrLAP to send fast RR (Receive Ready) frames
- when acting as a primary station. This will make IrLAP send out a RR
- frame immediately when receiving a frame if its own transmit queue
- is currently empty. This will give a lot of speed improvement when
- receiving much data since the secondary station will not have to
- wait the max. turn around time before it is allowed to transmit the
- next time. If the transmit queue of the secondary is also empty the
- primary will back off waiting longer for sending out the RR frame
- until the timeout reaches the normal value. Enabling this option
- will make the IR-diode burn more power and thus reduce your battery
- life.
+ when acting as a primary station.
+ Disabling this option will make latency over IrDA very bad. Enabling
+ this option will make the IrDA stack send more packet than strictly
+ necessary, thus reduce your battery life (but not that much).
+
+ Fast RR will make IrLAP send out a RR frame immediately when
+ receiving a frame if its own transmit queue is currently empty. This
+ will give a lot of speed improvement when receiving much data since
+ the secondary station will not have to wait the max. turn around
+ time (usually 500ms) before it is allowed to transmit the next time.
+ If the transmit queue of the secondary is also empty, the primary will
+ start backing-off before sending another RR frame, waiting longer
+ each time until the back-off reaches the max. turn around time.
+ This back-off increase in controlled via
+ /proc/sys/net/irda/fast_poll_increase
- If unsure, say N.
+ If unsure, say Y.
IrDA debugging information
CONFIG_IRDA_DEBUG
Say Y here if you want the IrDA subsystem to write debug information
to your syslog. You can change the debug level in
/proc/sys/net/irda/debug .
+ When this option is enabled, the IrDA also perform many extra internal
+ verifications which will usually prevent the kernel to crash in case of
+ bugs.
If unsure, say Y (since it makes it easier to find the bugs).
-IrLAP compression support
-CONFIG_IRDA_COMPRESSION
- Compression is _not_ part of the IrDA(tm) protocol specification,
- but it's working great! Linux is the first to try out compression
- support at the IrLAP layer. This means that you will only benefit
- from compression if you are running a Linux <-> Linux configuration.
-
- If you say Y here, you also need to say Y or M to a compression
- protocol below.
-
-IrLAP Deflate compression
-CONFIG_IRDA_DEFLATE
- Say Y here if you want to build support for the Deflate compression
- protocol. The deflate compression (GZIP) is exactly
- the same as the one used by the PPP protocol.
-
- If you want to compile this compression support as a module, say M
- here and read <file:Documentation/modules.txt>. The module will be
- called irda_deflate.o.
-
IrLAN protocol
CONFIG_IRLAN
Say Y here if you want to build support for the IrLAN protocol. If
@@ -22399,7 +22472,7 @@ CONFIG_NSC_FIR
<file:Documentation/modules.txt>. The module will be called
nsc-ircc.o.
-National Semiconductor DP83820 series driver
+National Semiconductor DP83820 support
CONFIG_NS83820
This is a driver for the National Semiconductor DP83820 series
of gigabit ethernet MACs. Cards using this chipset include
@@ -22423,7 +22496,7 @@ CONFIG_SMC_IRCC_FIR
here and read <file:Documentation/modules.txt>. The module will be
called smc-ircc.o.
-ALi M5123 FIR Controller Driver
+ALi M5123 FIR controller driver
CONFIG_ALI_FIR
Say Y here if you want to build support for the ALi M5123 FIR
Controller. The ALi M5123 FIR Controller is embedded in ALi M1543C,
@@ -22434,7 +22507,7 @@ CONFIG_ALI_FIR
<file:Documentation/modules.txt>. The module will be called
ali-ircc.o.
-VLSI 82C147 PCI-IrDA Controller Driver
+VLSI 82C147 PCI-IrDA SIR/MIR/FIR Controller driver
CONFIG_VLSI_FIR
Say Y here if you want to build support for the VLSI 82C147
PCI-IrDA Controller. This controller is used by the HP OmniBook 800
@@ -22645,6 +22718,7 @@ ETRAX Flash Memory configuration
CONFIG_ETRAX_FLASH_BUSWIDTH
Width in bytes of the Flash bus (1, 2 or 4). Is usually 2.
+# Choice: crisleds
LED configuration on PA
CONFIG_ETRAX_PA_LEDS
The Etrax network driver is responsible for flashing LED's when
@@ -23129,6 +23203,7 @@ Etrax100 I2C EEPROM (NVRAM) size/8kB
CONFIG_ETRAX_I2C_EEPROM_8KB
Use a 8kB EEPROM.
+# Choice: etrax_eeprom
Etrax100 I2C EEPROM (NVRAM) size/probe
CONFIG_ETRAX_I2C_EEPROM_PROBE
Specifies size or auto probe of the EEPROM size.
@@ -23176,7 +23251,7 @@ Etrax 100 IDE Reset
CONFIG_ETRAX_IDE_CSPE1_16_RESET
Configures the pin used to reset the IDE bus.
-Etrax 100 ATA/IDE support
+Delay for drives to regain consciousness
CONFIG_ETRAX_IDE_DELAY
Sets the time to wait for disks to regain consciousness after reset.
@@ -23184,6 +23259,7 @@ Etrax 100 IDE Reset
CONFIG_ETRAX_IDE_G27_RESET
Configures the pin used to reset the IDE bus.
+# Choice: ide_reset
IDE reset on PB Bit 7
CONFIG_ETRAX_IDE_PB7_RESET
Configures the pin used to reset the IDE bus.
@@ -23502,7 +23578,7 @@ CONFIG_IA32_SUPPORT
this. If in doubt, say Y.
/proc/efi/vars support
-CONFIG_IA64_EFIVARS
+CONFIG_EFI_VARS
If you say Y here, you are able to get EFI (Extensible Firmware
Interface) variable information in /proc/efi/vars. You may read,
write, create, and destroy EFI variables through this interface.
@@ -23535,7 +23611,7 @@ CONFIG_DEBUG_SLAB
allocation as well as poisoning memory on free to catch use of freed
memory.
-Memory mapped I/O debug support
+Memory mapped I/O debugging
CONFIG_DEBUG_IOVIRT
Say Y here to get warned whenever an attempt is made to do I/O on
obviously invalid addresses such as those generated when ioremap()
@@ -23659,7 +23735,7 @@ CONFIG_SH_GENERIC
each of the machines below is described by a machine vector.
Select SolutionEngine if configuring for a Hitachi SH7709
- or SH7750 evalutation board.
+ or SH7750/7750S evalutation board.
Select Overdrive if configuring for a ST407750 Overdrive board.
More information at
@@ -23667,34 +23743,43 @@ CONFIG_SH_GENERIC
Select HP620 if configuring for a HP Jornada HP620.
More information (hardware only) at
- <http://www.hp.com/jornada>.
+ <http://www.hp.com/jornada/>.
Select HP680 if configuring for a HP Jornada HP680.
More information (hardware only) at
- <http://www.hp.com/jornada/products/680>.
+ <http://www.hp.com/jornada/products/680/>.
Select HP690 if configuring for a HP Jornada HP690.
More information (hardware only) at
- <http://www.hp.com/jornada/products/680>.
+ <http://www.hp.com/jornada/products/680/>.
Select CqREEK if configuring for a CqREEK SH7708 or SH7750.
More information at
<http://sources.redhat.com/ecos/hardware.html#SuperH>.
Select DMIDA if configuring for a DataMyte 4000 Industrial
- Digital Assistant. More information at <http://www.dmida.com>.
+ Digital Assistant. More information at <http://www.dmida.com/>.
Select EC3104 if configuring for a system with an Eclipse
- International EC3104 chip, e.g. the Harris AD2000.
+ International EC3104 chip, e.g. the Harris AD2000 or Compaq Aero 8000.
Select Dreamcast if configuring for a SEGA Dreamcast.
More information at
- <http://www.m17n.org/linux-sh/dreamcast>. There is a
+ <http://www.m17n.org/linux-sh/dreamcast/>. There is a
Dreamcast project is at <http://linuxdc.sourceforge.net/>.
Select BareCPU if you know what this means, and it applies
to your system.
+# These may have to be merged in when we go to CML2:
+# - "SolutionEngine7751" for Hitachi SolutionEngine (7751)
+# - "STB1_Harp" for STMicroelectronics HARP
+# - "CqREEK" for CQ Publishing CqREEK SH-4
+# - "CAT68701" for CAT 68701 Evaluation Board (SH7708)
+# - "BigSur" for Big Sur Evaluation Board
+# - "SH2000" for SH2000 Evaluation Board (SH7709A)
+# - "ADX" for A&D ADX
+
SolutionEngine
CONFIG_SH_SOLUTION_ENGINE
Select SolutionEngine if configuring for a Hitachi SH7709
@@ -23715,19 +23800,19 @@ HP620
CONFIG_SH_HP620
Select HP620 if configuring for a HP jornada HP620.
More information (hardware only) at
- <http://www.hp.com/jornada>.
+ <http://www.hp.com/jornada/>.
HP680
CONFIG_SH_HP680
Select HP680 if configuring for a HP Jornada HP680.
More information (hardware only) at
- <http://www.hp.com/jornada/products/680>.
+ <http://www.hp.com/jornada/products/680/>.
HP690
CONFIG_SH_HP690
Select HP690 if configuring for a HP Jornada HP690.
More information (hardware only)
- at <http://www.hp.com/jornada/products/680>.
+ at <http://www.hp.com/jornada/products/680/>.
CqREEK
CONFIG_SH_CQREEK
@@ -23738,7 +23823,7 @@ CONFIG_SH_CQREEK
DMIDA
CONFIG_SH_DMIDA
Select DMIDA if configuring for a DataMyte 4000 Industrial
- Digital Assistant. More information at <http://www.dmida.com>.
+ Digital Assistant. More information at <http://www.dmida.com/>.
EC3104
CONFIG_SH_EC3104
@@ -23749,7 +23834,7 @@ Dreamcast
CONFIG_SH_DREAMCAST
Select Dreamcast if configuring for a SEGA Dreamcast.
More information at
- <http://www.m17n.org/linux-sh/dreamcast>. There is a
+ <http://www.m17n.org/linux-sh/dreamcast/>. There is a
Dreamcast project is at <http://linuxdc.sourceforge.net/>.
BareCPU
@@ -23766,7 +23851,8 @@ CONFIG_SH_UNKNOWN
# Choice: superhtype
SH7707
CONFIG_CPU_SUBTYPE_SH7707
- Select the type of SuperH processor you have.
+ Select the type of SuperH processor you have. This information is
+ used for optimizing and configuration purposes.
Select SH7707 if you have a 60 Mhz SH-3 HD6417707 CPU.
@@ -23777,6 +23863,10 @@ CONFIG_CPU_SUBTYPE_SH7707
Select SH7750 if you have a 200 Mhz SH-4 HD6417750 CPU.
+ Select SH7751 if you have a SH7751
+
+ Select ST40STB1 if you have a ST40STB1
+
SH7708
CONFIG_CPU_SUBTYPE_SH7708
Select SH7708 if you have a 60 Mhz SH-3 HD6417708S or
@@ -23792,7 +23882,11 @@ CONFIG_CPU_SUBTYPE_SH7750
Physical memory start address
CONFIG_MEMORY_START
- The physical memory start address will be automatically
+ Computers built with Hitachi SuperH processors always
+ map the ROM starting at address zero. But the processor
+ does not specify the range that RAM takes.
+
+ The physical memory (RAM) start address will be automatically
set to 08000000, unless you selected one of the following
processor types: SolutionEngine, Overdrive, HP620, HP680, HP690,
in which case the start address will be set to 0c000000.
@@ -23850,15 +23944,15 @@ CONFIG_HD64465_IOBASE
The default setting of the HD64465 IO base address is 0xb0000000.
Do not change this unless you know what you are doing.
-
+
Early printk support
CONFIG_SH_EARLY_PRINTK
- Say Y here to redirect kernel messages to the serial port
+ Say Y here to redirect kernel printk messages to the serial port
used by the SH-IPL bootloader, starting very early in the boot
process and ending when the kernel's serial console is initialised.
This option is only useful porting the kernel to a new machine,
when the kernel may crash or hang before the serial console is
- initialised.
+ initialised. If unsure, say N.
SuperH SCI (serial) support
CONFIG_SH_SCI
@@ -23912,7 +24006,7 @@ CONFIG_GDB_CONSOLE
#
# This is used by Emacs' spell checker ispell.el:
#
-# LocalWords: CONFIG coprocessor DX Pentium SX lilo loadlin HOWTO ftp metalab
+# LocalWords: CONFIG coprocessor DX Pentium SX lilo loadlin HOWTO ftp ibiblio
# LocalWords: unc edu docs emu README kB BLK DEV FD Thinkpad fd MFM RLL IDE gz
# LocalWords: cdrom diskless netboot nfs xzvf ATAPI MB ide pavia rubini pl pd
# LocalWords: HD CD-ROMs IDECD NEC MITSUMI filesystem XT XD PCI BIOS cezar ATEN
@@ -23958,7 +24052,7 @@ CONFIG_GDB_CONSOLE
# LocalWords: bsd comp SPARCstation le SunOS ie Gracilis PackeTwin PT pt LU FX
# LocalWords: FX TEAC CR LCS mS ramdisk IDETAPE cmd fperllo encis tcfs unisa
# LocalWords: Vertos Genoa Funai hsfs NCP NetWare tgz APM apm ioctls UltraLite
-# LocalWords: TravelMate CDT LCD backlight VC RPC Mips AXP barlow cdrecord pg
+# LocalWords: TravelMate CDT LCD backlight VC RPC Mips AXP barlow cdrtools pg
# LocalWords: PMAX MILO Alphas Multia Tseng linuxelf endian mipsel mips drv HT
# LocalWords: kerneld callouts AdvanSys advansys Admin WDT DataStor EP verden
# LocalWords: wdt hdb hdc bugfix SiS vlb Acculogic CSA DTC dtc Holtek ht QDI
diff --git a/Documentation/filesystems/devfs/ChangeLog b/Documentation/filesystems/devfs/ChangeLog
index f8b1c4899..29198d7cc 100644
--- a/Documentation/filesystems/devfs/ChangeLog
+++ b/Documentation/filesystems/devfs/ChangeLog
@@ -1815,3 +1815,7 @@ Changes for patch v199.2
- Fixed bug in <devfsd_close>: was dereferencing freed pointer
- Added process group check for devfsd privileges
+===============================================================================
+Changes for patch v199.3
+
+- Use SLAB_ATOMIC in <devfsd_notify_de> from <devfs_d_delete>
diff --git a/Documentation/filesystems/tmpfs.txt b/Documentation/filesystems/tmpfs.txt
new file mode 100644
index 000000000..cc78cab18
--- /dev/null
+++ b/Documentation/filesystems/tmpfs.txt
@@ -0,0 +1,102 @@
+Tmpfs is a file system which keeps all files in virtual memory.
+
+
+Everything in tmpfs is temporary in the sense that no files will be
+created on your hard drive. If you unmount a tmpfs instance,
+everything stored therein is lost.
+
+tmpfs puts everything into the kernel internal caches and grows and
+shrinks to accommodate the files it contains and is able to swap
+unneeded pages out to swap space. It has maximum size limits which can
+be adjusted on the fly via 'mount -o remount ...'
+
+If you compare it to ramfs (which was the template to create tmpfs)
+you gain swapping and limit checking. Another similar thing is the RAM
+disk (/dev/ram*), which simulates a fixed size hard disk in physical
+RAM, where you have to create an ordinary filesystem on top. Ramdisks
+cannot swap and you do not have the possibility to resize them.
+
+Since tmpfs lives completely in the page cache and on swap, all tmpfs
+pages currently in memory will show up as cached. It will not show up
+as shared or something like that. Further on you can check the actual
+RAM+swap use of a tmpfs instance with df(1) and du(1).
+
+
+tmpfs has the following uses:
+
+1) There is always a kernel internal mount which you will not see at
+ all. This is used for shared anonymous mappings and SYSV shared
+ memory.
+
+ This mount does not depend on CONFIG_TMPFS. If CONFIG_TMPFS is not
+ set, the user visible part of tmpfs is not build. But the internal
+ mechanisms are always present.
+
+2) glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
+ POSIX shared memory (shm_open, shm_unlink). Adding the following
+ line to /etc/fstab should take care of this:
+
+ tmpfs /dev/shm tmpfs defaults 0 0
+
+ Remember to create the directory that you intend to mount tmpfs on
+ if necessary (/dev/shm is automagically created if you use devfs).
+
+ This mount is _not_ needed for SYSV shared memory. The internal
+ mount is used for that. (In the 2.3 kernel versions it was
+ necessary to mount the predecessor of tmpfs (shm fs) to use SYSV
+ shared memory)
+
+3) Some people (including me) find it very convenient to mount it
+ e.g. on /tmp and /var/tmp and have a big swap partition. But be
+ aware: loop mounts of tmpfs files do not work due to the internal
+ design. So mkinitrd shipped by most distributions will fail with a
+ tmpfs /tmp.
+
+4) And probably a lot more I do not know about :-)
+
+
+tmpfs has a couple of mount options:
+
+size: The limit of allocated bytes for this tmpfs instance. The
+ default is half of your physical RAM without swap. If you
+ oversize your tmpfs instances the machine will deadlock
+ since the OOM handler will not be able to free that memory.
+nr_blocks: The same as size, but in blocks of PAGECACHE_SIZE.
+nr_inodes: The maximum number of inodes for this instance. The default
+ is half of the number of your physical RAM pages.
+
+These parameters accept a suffix k, m or g for kilo, mega and giga and
+can be changed on remount.
+
+To specify the initial root directory you can use the following mount
+options:
+
+mode: The permissions as an octal number
+uid: The user id
+gid: The group id
+
+These options do not have any effect on remount. You can change these
+parameters with chmod(1), chown(1) and chgrp(1) on a mounted filesystem.
+
+
+So 'mount -t tmpfs -o size=10G,nr_inodes=10k,mode=700 tmpfs /mytmpfs'
+will give you tmpfs instance on /mytmpfs which can allocate 10GB
+RAM/SWAP in 10240 inodes and it is only accessible by root.
+
+
+TODOs:
+
+1) give the size option a percent semantic: If you give a mount option
+ size=50% the tmpfs instance should be able to grow to 50 percent of
+ RAM + swap. So the instance should adapt automatically if you add
+ or remove swap space.
+2) loop mounts: This is difficult since loop.c relies on the readpage
+ operation. This operation gets a page from the caller to be filled
+ with the content of the file at that position. But tmpfs always has
+ the page and thus cannot copy the content to the given page. So it
+ cannot provide this operation. The VM had to be changed seriously
+ to achieve this.
+3) Show the number of tmpfs RAM pages. (As shared?)
+
+Author:
+ Christoph Rohland <cr@sap.com>, 1.12.01
diff --git a/MAINTAINERS b/MAINTAINERS
index a92b3d077..49d63240b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -932,6 +932,12 @@ L: linux-LVM@sistina.com
W: http://www.sistina.com/lvm
S: Maintained
+LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers
+P: Gerard Roudier
+M: groudier@free.fr
+L: linux-scsi@vger.kernel.org
+S: Maintained
+
M68K
P: Jes Sorensen
M: jes@trained-monkey.org
diff --git a/Makefile b/Makefile
index a9d16a658..3c1f52196 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 17
-EXTRAVERSION = -pre4
+EXTRAVERSION = -pre5
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index ae576debd..d85fff88d 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -1280,9 +1280,28 @@ static int __init init_amd(struct cpuinfo_x86 *c)
}
break;
- case 6: /* An Athlon/Duron. We can trust the BIOS probably */
- mcheck_init(c);
- break;
+ case 6: /* An Athlon/Duron */
+ mcheck_init(c);
+
+ /* Bit 15 of Athlon specific MSR 15, needs to be 0
+ * to enable SSE on Palomino/Morgan CPU's.
+ * If the BIOS didn't enable it already, enable it
+ * here.
+ */
+ if (c->x86_model == 6 || c->x86_model == 7) {
+ if (!test_bit(X86_FEATURE_XMM,
+ &c->x86_capability)) {
+ printk(KERN_INFO
+ "Enabling Disabled K7/SSE Support...\n");
+ rdmsr(MSR_K7_HWCR, l, h);
+ l &= ~0x00008000;
+ wrmsr(MSR_K7_HWCR, l, h);
+ set_bit(X86_FEATURE_XMM,
+ &c->x86_capability);
+ }
+ }
+ break;
+
}
display_cacheinfo(c);
@@ -2193,7 +2212,56 @@ static void __init init_intel(struct cpuinfo_x86 *c)
if ( p )
strcpy(c->x86_model_id, p);
+
+#ifdef CONFIG_SMP
+ if (test_bit(X86_FEATURE_HT, &c->x86_capability[0])) {
+ extern int phys_proc_id[NR_CPUS];
+
+ u32 eax, ebx, ecx, edx;
+ int index_lsb, index_msb, tmp;
+ int initial_apic_id;
+ int cpu = smp_processor_id();
+
+ cpuid(1, &eax, &ebx, &ecx, &edx);
+ smp_num_siblings = (ebx & 0xff0000) >> 16;
+
+ if (smp_num_siblings == 1) {
+ printk(KERN_INFO "CPU: Hyper-Threading is disabled\n");
+ } else if (smp_num_siblings > 1 ) {
+ index_lsb = 0;
+ index_msb = 31;
+ /*
+ * At this point we only support two siblings per
+ * processor package.
+ */
+#define NR_SIBLINGS 2
+ if (smp_num_siblings != NR_SIBLINGS) {
+ printk(KERN_WARNING "CPU: Unsuppored number of the siblings %d", smp_num_siblings);
+ smp_num_siblings = 1;
+ goto too_many_siblings;
+ }
+ tmp = smp_num_siblings;
+ while ((tmp & 1) == 0) {
+ tmp >>=1 ;
+ index_lsb++;
+ }
+ tmp = smp_num_siblings;
+ while ((tmp & 0x80000000 ) == 0) {
+ tmp <<=1 ;
+ index_msb--;
+ }
+ if (index_lsb != index_msb )
+ index_msb++;
+ initial_apic_id = ebx >> 24 & 0xff;
+ phys_proc_id[cpu] = initial_apic_id >> index_msb;
+ printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
+ phys_proc_id[cpu]);
+ }
+
+ }
+too_many_siblings:
+#endif
/* Enable MCA if available */
mcheck_init(c);
}
@@ -2699,7 +2767,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
"fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
"cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
"pat", "pse36", "pn", "clflush", NULL, "dts", "acpi", "mmx",
- "fxsr", "sse", "sse2", "ss", NULL, "tm", "ia64", NULL,
+ "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", NULL,
/* AMD-defined */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 64d6c827c..73727329a 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -56,6 +56,10 @@ static int max_cpus = -1;
/* Total count of live CPUs */
int smp_num_cpus = 1;
+/* Number of siblings per CPU package */
+int smp_num_siblings = 1;
+int __initdata phys_proc_id[NR_CPUS]; /* Package ID of each logical CPU */
+
/* Bitmask of currently online CPUs */
unsigned long cpu_online_map;
@@ -971,6 +975,8 @@ static int boot_cpu_logical_apicid;
/* Where the IO area was mapped on multiquad, always 0 otherwise */
void *xquad_portio = NULL;
+int cpu_sibling_map[NR_CPUS] __cacheline_aligned;
+
void __init smp_boot_cpus(void)
{
int apicid, cpu, bit;
@@ -1162,6 +1168,34 @@ void __init smp_boot_cpus(void)
printk(KERN_WARNING "WARNING: SMP operation may be unreliable with B stepping processors.\n");
Dprintk("Boot done.\n");
+ /*
+ * If Hyper-Threading is avaialble, construct cpu_sibling_map[], so
+ * that we can tell the sibling CPU efficiently.
+ */
+ if (test_bit(X86_FEATURE_HT, boot_cpu_data.x86_capability)
+ && smp_num_siblings > 1) {
+ for (cpu = 0; cpu < NR_CPUS; cpu++)
+ cpu_sibling_map[cpu] = NO_PROC_ID;
+
+ for (cpu = 0; cpu < smp_num_cpus; cpu++) {
+ int i;
+
+ for (i = 0; i < smp_num_cpus; i++) {
+ if (i == cpu)
+ continue;
+ if (phys_proc_id[cpu] == phys_proc_id[i]) {
+ cpu_sibling_map[cpu] = i;
+ printk("cpu_sibling_map[%d] = %d\n", cpu, cpu_sibling_map[cpu]);
+ break;
+ }
+ }
+ if (cpu_sibling_map[cpu] == NO_PROC_ID) {
+ smp_num_siblings = 1;
+ printk(KERN_WARNING "WARNING: No sibling found for CPU %d.\n", cpu);
+ }
+ }
+ }
+
#ifndef CONFIG_VISWS
/*
* Here we can be sure that there is an IO-APIC in the system. Let's
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 8a4263ff7..30f23d214 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4498,3 +4498,5 @@ void floppy_eject(void)
}
}
#endif
+
+EXPORT_NO_SYMBOLS;
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 238d2d77c..b46648a7f 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -640,6 +640,10 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, kdev_t dev,
if (S_ISBLK(inode->i_mode)) {
lo_device = inode->i_rdev;
+ if (lo_device == dev) {
+ error = -EBUSY;
+ goto out;
+ }
} else if (S_ISREG(inode->i_mode)) {
struct address_space_operations *aops = inode->i_mapping->a_ops;
/*
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index c00517e95..8ec90ae47 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -733,7 +733,8 @@ static void xs( char *buf, char *targ, int offs, int len )
for (k=0;k<len;k++)
if((buf[k+offs]!=0x20)||(buf[k+offs]!=l))
l=targ[j++]=buf[k+offs];
- if (l==0x20) j--; targ[j]=0;
+ if (l==0x20) j--;
+ targ[j]=0;
}
static int xl( char *buf, int offs )
diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c
index 96ef0c3a1..1d68f97c9 100644
--- a/drivers/block/paride/pg.c
+++ b/drivers/block/paride/pg.c
@@ -491,7 +491,8 @@ static void xs( char *buf, char *targ, int offs, int len )
for (k=0;k<len;k++)
if((buf[k+offs]!=0x20)||(buf[k+offs]!=l))
l=targ[j++]=buf[k+offs];
- if (l==0x20) j--; targ[j]=0;
+ if (l==0x20) j--;
+ targ[j]=0;
}
static int pg_identify( int unit, int log )
diff --git a/drivers/block/paride/pseudo.h b/drivers/block/paride/pseudo.h
index 31cf68d5c..25cde3063 100644
--- a/drivers/block/paride/pseudo.h
+++ b/drivers/block/paride/pseudo.h
@@ -102,7 +102,7 @@ static void ps_tq_int( void *data )
spin_unlock_irqrestore(&ps_spinlock,flags);
return;
}
- if (!ps_ready || ps_ready() || (jiffies >= ps_timeout)) {
+ if (!ps_ready || ps_ready() || time_after_eq(jiffies, ps_timeout)) {
ps_continuation = NULL;
spin_unlock_irqrestore(&ps_spinlock,flags);
con();
@@ -131,7 +131,7 @@ static void ps_timer_int( unsigned long data)
spin_unlock_irqrestore(&ps_spinlock,flags);
return;
}
- if (!ps_ready || ps_ready() || (jiffies >= ps_timeout)) {
+ if (!ps_ready || ps_ready() || time_after_eq(jiffies, ps_timeout)) {
ps_continuation = NULL;
spin_unlock_irqrestore(&ps_spinlock,flags);
con();
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
index e5bdcd73a..8d24f5acf 100644
--- a/drivers/block/paride/pt.c
+++ b/drivers/block/paride/pt.c
@@ -577,7 +577,8 @@ static void xs( char *buf, char *targ, int offs, int len )
for (k=0;k<len;k++)
if((buf[k+offs]!=0x20)||(buf[k+offs]!=l))
l=targ[j++]=buf[k+offs];
- if (l==0x20) j--; targ[j]=0;
+ if (l==0x20) j--;
+ targ[j]=0;
}
static int xn( char *buf, int offs, int size )
diff --git a/drivers/char/agp/agpgart_be.c b/drivers/char/agp/agpgart_be.c
index 8e507bcd4..1f3cba6d8 100644
--- a/drivers/char/agp/agpgart_be.c
+++ b/drivers/char/agp/agpgart_be.c
@@ -409,8 +409,18 @@ static void agp_generic_agp_enable(u32 mode)
* AGP devices and collect their data.
*/
- while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
- device)) != NULL) {
+
+ pci_for_each_dev(device)
+ {
+ /*
+ * Enable AGP devices. Most will be VGA display but
+ * some may be coprocessors on non VGA devices too
+ */
+
+ if((((device->class >> 16) & 0xFF) != PCI_BASE_CLASS_DISPLAY) &&
+ (device->class != (PCI_CLASS_PROCESSOR_CO << 8)))
+ continue;
+
pci_read_config_dword(device, 0x04, &scratch);
if (!(scratch & 0x00100000))
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index e5aced875..784e5267c 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -858,8 +858,10 @@ static void __exit idedisk_exit (void)
}
/* We must remove proc entries defined in this module.
Otherwise we oops while accessing these entries */
+#ifdef CONFIG_PROC_FS
if (drive->proc)
ide_remove_proc_entries(drive->proc, idedisk_proc);
+#endif
}
ide_unregister_module(&idedisk_module);
}
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 15bac64f9..2897ca4f3 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -2071,8 +2071,10 @@ static void __exit idefloppy_exit (void)
}
/* We must remove proc entries defined in this module.
Otherwise we oops while accessing these entries */
+#ifdef CONFIG_PROC_FS
if (drive->proc)
ide_remove_proc_entries(drive->proc, idefloppy_proc);
+#endif
}
ide_unregister_module(&idefloppy_module);
}
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index 583fec931..c056dc334 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -338,7 +338,7 @@ EXPORT_SYMBOL(HiSax_closecard);
#define EMPTY_CARD {0, DEFAULT_PROTO, {0, 0, 0, 0}, NULL}
-struct IsdnCard cards[] = {
+struct IsdnCard cards[HISAX_MAX_CARDS] = {
FIRST_CARD,
EMPTY_CARD,
EMPTY_CARD,
@@ -349,14 +349,15 @@ struct IsdnCard cards[] = {
EMPTY_CARD,
};
-static char HiSaxID[64] __devinitdata = { 0, };
+#define HISAX_IDSIZE (HISAX_MAX_CARDS*8)
+static char HiSaxID[HISAX_IDSIZE] __devinitdata = { 0, };
char *HiSax_id __devinitdata = HiSaxID;
#ifdef MODULE
/* Variables for insmod */
-static int type[8] __devinitdata = { 0, };
-static int protocol[8] __devinitdata = { 0, };
-static int io[8] __devinitdata = { 0, };
+static int type[HISAX_MAX_CARDS] __devinitdata = { 0, };
+static int protocol[HISAX_MAX_CARDS] __devinitdata = { 0, };
+static int io[HISAX_MAX_CARDS] __devinitdata = { 0, };
#undef IO0_IO1
#ifdef CONFIG_HISAX_16_3
#define IO0_IO1
@@ -366,25 +367,30 @@ static int io[8] __devinitdata = { 0, };
#define IO0_IO1
#endif
#ifdef IO0_IO1
-static int io0[8] __devinitdata = { 0, };
-static int io1[8] __devinitdata = { 0, };
+static int io0[HISAX_MAX_CARDS] __devinitdata = { 0, };
+static int io1[HISAX_MAX_CARDS] __devinitdata = { 0, };
#endif
-static int irq[8] __devinitdata = { 0, };
-static int mem[8] __devinitdata = { 0, };
+static int irq[HISAX_MAX_CARDS] __devinitdata = { 0, };
+static int mem[HISAX_MAX_CARDS] __devinitdata = { 0, };
static char *id __devinitdata = HiSaxID;
+/* string magic */
+#define h1(s) h2(s)
+#define h2(s) #s
+#define PARM_PARA "1-"h1(HISAX_MAX_CARDS)"i"
+
MODULE_DESCRIPTION("ISDN4Linux: Driver for passive ISDN cards");
MODULE_AUTHOR("Karsten Keil");
MODULE_LICENSE("GPL");
-MODULE_PARM(type, "1-8i");
-MODULE_PARM(protocol, "1-8i");
-MODULE_PARM(io, "1-8i");
-MODULE_PARM(irq, "1-8i");
-MODULE_PARM(mem, "1-8i");
+MODULE_PARM(type, PARM_PARA);
+MODULE_PARM(protocol, PARM_PARA);
+MODULE_PARM(io, PARM_PARA);
+MODULE_PARM(irq, PARM_PARA);
+MODULE_PARM(mem, PARM_PARA);
MODULE_PARM(id, "s");
#ifdef IO0_IO1
-MODULE_PARM(io0, "1-8i");
-MODULE_PARM(io1, "1-8i");
+MODULE_PARM(io0, PARM_PARA);
+MODULE_PARM(io1, PARM_PARA);
#endif
#endif /* MODULE */
@@ -476,12 +482,14 @@ static int __init HiSax_setup(char *line)
i++;
}
if (str && *str) {
- strcpy(HiSaxID, str);
- HiSax_id = HiSaxID;
- } else {
+ if (strlen(str) < HISAX_IDSIZE)
+ strcpy(HiSaxID, str);
+ else
+ printk(KERN_WARNING "HiSax: ID too long!")
+ } else
strcpy(HiSaxID, "HiSax");
- HiSax_id = HiSaxID;
- }
+
+ HiSax_id = HiSaxID;
return 1;
}
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 2d219b466..45d102065 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -1636,23 +1636,24 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
struct rtl8139_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr;
unsigned int entry;
+ unsigned int len = skb->len;
/* Calculate the next Tx descriptor entry. */
entry = tp->cur_tx % NUM_TX_DESC;
- if (likely(skb->len < TX_BUF_SIZE)) {
+ if (likely(len < TX_BUF_SIZE)) {
skb_copy_and_csum_dev(skb, tp->tx_buf[entry]);
dev_kfree_skb(skb);
} else {
dev_kfree_skb(skb);
tp->stats.tx_dropped++;
return 0;
- }
+ }
/* Note: the chip doesn't have auto-pad! */
spin_lock_irq(&tp->lock);
RTL_W32_F (TxStatus0 + (entry * sizeof (u32)),
- tp->tx_flag | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN));
+ tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
dev->trans_start = jiffies;
@@ -1663,8 +1664,8 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
netif_stop_queue (dev);
spin_unlock_irq(&tp->lock);
- DPRINTK ("%s: Queued Tx packet at %p size %u to slot %d.\n",
- dev->name, skb->data, skb->len, entry);
+ DPRINTK ("%s: Queued Tx packet size %u to slot %d.\n",
+ dev->name, len, entry);
return 0;
}
diff --git a/drivers/parport/ChangeLog b/drivers/parport/ChangeLog
index 39ef2e14d..129450bf6 100644
--- a/drivers/parport/ChangeLog
+++ b/drivers/parport/ChangeLog
@@ -1,3 +1,9 @@
+2001-12-06 Tim Waugh <twaugh@redhat.com>
+
+ * ieee1284_ops.c (parport_ieee1284_ecp_read_data): Mask off
+ PARPORT_CONTROL_AUTOFD as well. Bug spotted by Joe
+ <joeja@mindspring.com>.
+
2001-11-12 Tim Waugh <twaugh@redhat.com>
* parport_pc.c (init_module): Warn when parameters are ignored.
diff --git a/drivers/parport/Config.in b/drivers/parport/Config.in
index b4d643315..eb13f0748 100644
--- a/drivers/parport/Config.in
+++ b/drivers/parport/Config.in
@@ -24,9 +24,13 @@ if [ "$CONFIG_PARPORT" != "n" ]; then
bool ' Use FIFO/DMA if available (EXPERIMENTAL)' CONFIG_PARPORT_PC_FIFO
bool ' SuperIO chipset support (EXPERIMENTAL)' CONFIG_PARPORT_PC_SUPERIO
fi
- fi
- if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then
- dep_tristate ' Support for PCMCIA management for PC-style ports' CONFIG_PARPORT_PC_PCMCIA $CONFIG_PCMCIA
+ if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then
+ if [ "$CONFIG_PARPORT_PC" = "y" ]; then
+ dep_tristate ' Support for PCMCIA management for PC-style ports' CONFIG_PARPORT_PC_PCMCIA $CONFIG_PCMCIA
+ else
+ dep_tristate ' Support for PCMCIA management for PC-style ports' CONFIG_PARPORT_PC_PCMCIA $CONFIG_PARPORT_PC
+ fi
+ fi
fi
if [ "$CONFIG_ARM" = "y" ]; then
dep_tristate ' Archimedes hardware' CONFIG_PARPORT_ARC $CONFIG_PARPORT
diff --git a/drivers/parport/ieee1284_ops.c b/drivers/parport/ieee1284_ops.c
index 51f771a62..8fcd6f2f1 100644
--- a/drivers/parport/ieee1284_ops.c
+++ b/drivers/parport/ieee1284_ops.c
@@ -514,7 +514,8 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port,
/* Set HostAck low to start accepting data. */
ctl = parport_read_control (port);
- ctl &= ~(PARPORT_CONTROL_STROBE | PARPORT_CONTROL_INIT);
+ ctl &= ~(PARPORT_CONTROL_STROBE | PARPORT_CONTROL_INIT |
+ PARPORT_CONTROL_AUTOFD);
parport_write_control (port,
ctl | PARPORT_CONTROL_AUTOFD);
while (count < len) {
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 4d007c240..2f7a1d721 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -364,78 +364,36 @@ static struct {
const char *name;
} signals[] = { {
- SR_DBP, "PARITY"
-}, {
- SR_RST, "RST"
-}, {
- SR_BSY, "BSY"
-},
-{
- SR_REQ, "REQ"
-}, {
- SR_MSG, "MSG"
-}, {
- SR_CD, "CD"
-}, {
- SR_IO, "IO"
-},
-{
- SR_SEL, "SEL"
-}, {
- 0, NULL
-}
-},
-
-basrs[] = { {
- BASR_ATN, "ATN"
-}, {
- BASR_ACK, "ACK"
-}, {
- 0, NULL
-}
-},
-
-icrs[] = { {
- ICR_ASSERT_RST, "ASSERT RST"
-}, {
- ICR_ASSERT_ACK, "ASSERT ACK"
-},
-{
- ICR_ASSERT_BSY, "ASSERT BSY"
-}, {
- ICR_ASSERT_SEL, "ASSERT SEL"
-},
-{
- ICR_ASSERT_ATN, "ASSERT ATN"
-}, {
- ICR_ASSERT_DATA, "ASSERT DATA"
-},
-{
- 0, NULL
-}
-},
-
-mrs[] = { {
- MR_BLOCK_DMA_MODE, "MODE BLOCK DMA"
-}, {
- MR_TARGET, "MODE TARGET"
-},
-{
- MR_ENABLE_PAR_CHECK, "MODE PARITY CHECK"
-}, {
- MR_ENABLE_PAR_INTR,
- "MODE PARITY INTR"
-}, {
- MR_MONITOR_BSY, "MODE MONITOR BSY"
-},
-{
- MR_DMA_MODE, "MODE DMA"
-}, {
- MR_ARBITRATE, "MODE ARBITRATION"
-},
-{
- 0, NULL
-}
+SR_DBP, "PARITY"}, {
+SR_RST, "RST"}, {
+SR_BSY, "BSY"}, {
+SR_REQ, "REQ"}, {
+SR_MSG, "MSG"}, {
+SR_CD, "CD"}, {
+SR_IO, "IO"}, {
+SR_SEL, "SEL"}, {
+0, NULL}
+}, basrs[] = { {
+BASR_ATN, "ATN"}, {
+BASR_ACK, "ACK"}, {
+0, NULL}
+}, icrs[] = { {
+ICR_ASSERT_RST, "ASSERT RST"}, {
+ICR_ASSERT_ACK, "ASSERT ACK"}, {
+ICR_ASSERT_BSY, "ASSERT BSY"}, {
+ICR_ASSERT_SEL, "ASSERT SEL"}, {
+ICR_ASSERT_ATN, "ASSERT ATN"}, {
+ICR_ASSERT_DATA, "ASSERT DATA"}, {
+0, NULL}
+}, mrs[] = { {
+MR_BLOCK_DMA_MODE, "MODE BLOCK DMA"}, {
+MR_TARGET, "MODE TARGET"}, {
+MR_ENABLE_PAR_CHECK, "MODE PARITY CHECK"}, {
+MR_ENABLE_PAR_INTR, "MODE PARITY INTR"}, {
+MR_MONITOR_BSY, "MODE MONITOR BSY"}, {
+MR_DMA_MODE, "MODE DMA"}, {
+MR_ARBITRATE, "MODE ARBITRATION"}, {
+0, NULL}
};
/*
@@ -485,22 +443,13 @@ static struct {
} phases[] = {
{
- PHASE_DATAOUT, "DATAOUT"
- }, {
- PHASE_DATAIN, "DATAIN"
- }, {
- PHASE_CMDOUT, "CMDOUT"
- },
- {
- PHASE_STATIN, "STATIN"
- }, {
- PHASE_MSGOUT, "MSGOUT"
- }, {
- PHASE_MSGIN, "MSGIN"
- },
- {
- PHASE_UNKNOWN, "UNKNOWN"
- }
+ PHASE_DATAOUT, "DATAOUT"}, {
+ PHASE_DATAIN, "DATAIN"}, {
+ PHASE_CMDOUT, "CMDOUT"}, {
+ PHASE_STATIN, "STATIN"}, {
+ PHASE_MSGOUT, "MSGOUT"}, {
+ PHASE_MSGIN, "MSGIN"}, {
+ PHASE_UNKNOWN, "UNKNOWN"}
};
/*
@@ -520,11 +469,9 @@ static void NCR5380_print_phase(struct Scsi_Host *instance)
status = NCR5380_read(STATUS_REG);
if (!(status & SR_REQ))
- printk("scsi%d : REQ not asserted, phase unknown.\n",
- instance->host_no);
+ printk("scsi%d : REQ not asserted, phase unknown.\n", instance->host_no);
else {
- for (i = 0; (phases[i].value != PHASE_UNKNOWN) &&
- (phases[i].value != (status & PHASE_MASK)); ++i);
+ for (i = 0; (phases[i].value != PHASE_UNKNOWN) && (phases[i].value != (status & PHASE_MASK)); ++i);
printk("scsi%d : phase %s\n", instance->host_no, phases[i].name);
}
}
@@ -621,20 +568,20 @@ static struct Scsi_Host *expires_first = NULL;
static int should_disconnect(unsigned char cmd)
{
switch (cmd) {
- case READ_6:
- case WRITE_6:
- case SEEK_6:
- case READ_10:
- case WRITE_10:
- case SEEK_10:
- return DISCONNECT_TIME_TO_DATA;
- case FORMAT_UNIT:
- case SEARCH_HIGH:
- case SEARCH_LOW:
- case SEARCH_EQUAL:
- return DISCONNECT_LONG;
- default:
- return DISCONNECT_NONE;
+ case READ_6:
+ case WRITE_6:
+ case SEEK_6:
+ case READ_10:
+ case WRITE_10:
+ case SEEK_10:
+ return DISCONNECT_TIME_TO_DATA;
+ case FORMAT_UNIT:
+ case SEARCH_HIGH:
+ case SEARCH_LOW:
+ case SEARCH_EQUAL:
+ return DISCONNECT_LONG;
+ default:
+ return DISCONNECT_NONE;
}
}
@@ -653,16 +600,13 @@ static int NCR5380_set_timer(struct Scsi_Host *instance)
restore_flags(flags);
return -1;
}
- for (prev = &expires_first, tmp = expires_first; tmp;
- prev = &(((struct NCR5380_hostdata *) tmp->hostdata)->next_timer),
- tmp = ((struct NCR5380_hostdata *) tmp->hostdata)->next_timer)
- if (((struct NCR5380_hostdata *)instance->hostdata)->time_expires <
- ((struct NCR5380_hostdata *)tmp->hostdata)->time_expires)
+ for (prev = &expires_first, tmp = expires_first; tmp; prev = &(((struct NCR5380_hostdata *) tmp->hostdata)->next_timer), tmp = ((struct NCR5380_hostdata *) tmp->hostdata)->next_timer)
+ if (((struct NCR5380_hostdata *) instance->hostdata)->time_expires < ((struct NCR5380_hostdata *) tmp->hostdata)->time_expires)
break;
((struct NCR5380_hostdata *) instance->hostdata)->next_timer = tmp;
*prev = instance;
-
+
mod_timer(&usleep_timer, ((struct NCR5380_hostdata *) expires_first->hostdata)->time_expires);
restore_flags(flags);
return 0;
@@ -675,9 +619,7 @@ void NCR5380_timer_fn(unsigned long surplus_to_requirements)
struct Scsi_Host *instance;
save_flags(flags);
cli();
- for (; expires_first &&
- time_before_eq(((struct NCR5380_hostdata *)expires_first->hostdata)->time_expires, jiffies); )
- {
+ for (; expires_first && time_before_eq(((struct NCR5380_hostdata *) expires_first->hostdata)->time_expires, jiffies);) {
instance = ((struct NCR5380_hostdata *) expires_first->hostdata)->next_timer;
((struct NCR5380_hostdata *) expires_first->hostdata)->next_timer = NULL;
((struct NCR5380_hostdata *) expires_first->hostdata)->time_expires = 0;
@@ -685,9 +627,8 @@ void NCR5380_timer_fn(unsigned long surplus_to_requirements)
}
del_timer(&usleep_timer);
- if (expires_first)
- {
- usleep_timer.expires = ((struct NCR5380_hostdata *)expires_first->hostdata)->time_expires;
+ if (expires_first) {
+ usleep_timer.expires = ((struct NCR5380_hostdata *) expires_first->hostdata)->time_expires;
add_timer(&usleep_timer);
}
restore_flags(flags);
@@ -738,8 +679,7 @@ static void __init probe_intr(int irq, void *dev_id, struct pt_regs *regs)
static int __init NCR5380_probe_irq(struct Scsi_Host *instance, int possible)
{
NCR5380_local_declare();
- struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *)
- instance->hostdata;
+ struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
unsigned long timeout;
int trying_irqs, i, mask;
NCR5380_setup(instance);
@@ -765,10 +705,9 @@ static int __init NCR5380_probe_irq(struct Scsi_Host *instance, int possible)
NCR5380_write(TARGET_COMMAND_REG, 0);
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
NCR5380_write(OUTPUT_DATA_REG, hostdata->id_mask);
- NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA |
- ICR_ASSERT_SEL);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA | ICR_ASSERT_SEL);
- while (probe_irq == IRQ_NONE && time_before(jiffies,timeout))
+ while (probe_irq == IRQ_NONE && time_before(jiffies, timeout))
barrier();
NCR5380_write(SELECT_ENABLE_REG, 0);
@@ -846,16 +785,14 @@ static void NCR5380_print_status(struct Scsi_Host *instance)
char *start;
int len;
- printk("NCR5380 : coroutine is%s running.\n",
- main_running ? "" : "n't");
+ printk("NCR5380 : coroutine is%s running.\n", main_running ? "" : "n't");
#ifdef NDEBUG
NCR5380_print(instance);
NCR5380_print_phase(instance);
#endif
- len = NCR5380_proc_info(pr_bfr, &start, 0, sizeof(pr_bfr),
- instance->host_no, 0);
+ len = NCR5380_proc_info(pr_bfr, &start, 0, sizeof(pr_bfr), instance->host_no, 0);
pr_bfr[len] = 0;
printk("\n%s\n", pr_bfr);
}
@@ -886,9 +823,7 @@ char *lprint_opcode(int opcode, char *pos, char *buffer, int length);
#ifndef NCR5380_proc_info
static
#endif
-int NCR5380_proc_info(
- char *buffer, char **start, off_t offset,
- int length, int hostno, int inout)
+int NCR5380_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout)
{
unsigned long flags;
char *pos = buffer;
@@ -896,8 +831,7 @@ int NCR5380_proc_info(
struct NCR5380_hostdata *hostdata;
Scsi_Cmnd *ptr;
- for (instance = first_instance; instance &&
- instance->host_no != hostno; instance = instance->next);
+ for (instance = first_instance; instance && instance->host_no != hostno; instance = instance->next);
if (!instance)
return (-ESRCH);
hostdata = (struct NCR5380_hostdata *) instance->hostdata;
@@ -935,12 +869,10 @@ int NCR5380_proc_info(
SPRINTF("IRQ: %d.\n", instance->irq);
#ifdef DTC_PUBLIC_RELEASE
- SPRINTF("Highwater I/O busy_spin_counts -- write: %d read: %d\n",
- dtc_wmaxi, dtc_maxi);
+ SPRINTF("Highwater I/O busy_spin_counts -- write: %d read: %d\n", dtc_wmaxi, dtc_maxi);
#endif
#ifdef PAS16_PUBLIC_RELEASE
- SPRINTF("Highwater I/O busy_spin_counts -- write: %d read: %d\n",
- pas_wmaxi, pas_maxi);
+ SPRINTF("Highwater I/O busy_spin_counts -- write: %d read: %d\n", pas_wmaxi, pas_maxi);
#endif
save_flags(flags);
cli();
@@ -948,16 +880,13 @@ int NCR5380_proc_info(
if (!hostdata->connected)
SPRINTF("scsi%d: no currently connected command\n", instance->host_no);
else
- pos = lprint_Scsi_Cmnd((Scsi_Cmnd *) hostdata->connected,
- pos, buffer, length);
+ pos = lprint_Scsi_Cmnd((Scsi_Cmnd *) hostdata->connected, pos, buffer, length);
SPRINTF("scsi%d: issue_queue\n", instance->host_no);
- for (ptr = (Scsi_Cmnd *) hostdata->issue_queue; ptr;
- ptr = (Scsi_Cmnd *) ptr->host_scribble)
+ for (ptr = (Scsi_Cmnd *) hostdata->issue_queue; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
pos = lprint_Scsi_Cmnd(ptr, pos, buffer, length);
SPRINTF("scsi%d: disconnected_queue\n", instance->host_no);
- for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr;
- ptr = (Scsi_Cmnd *) ptr->host_scribble)
+ for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
pos = lprint_Scsi_Cmnd(ptr, pos, buffer, length);
restore_flags(flags);
@@ -972,16 +901,14 @@ int NCR5380_proc_info(
static
char *lprint_Scsi_Cmnd(Scsi_Cmnd * cmd, char *pos, char *buffer, int length)
{
- SPRINTF("scsi%d : destination target %d, lun %d\n",
- cmd->host->host_no, cmd->target, cmd->lun);
+ SPRINTF("scsi%d : destination target %d, lun %d\n", cmd->host->host_no, cmd->target, cmd->lun);
SPRINTF(" command = ");
pos = lprint_command(cmd->cmnd, pos, buffer, length);
return (pos);
}
static
-char *lprint_command(unsigned char *command,
- char *pos, char *buffer, int length)
+char *lprint_command(unsigned char *command, char *pos, char *buffer, int length)
{
int i, s;
pos = lprint_opcode(command[0], pos, buffer, length);
@@ -1017,8 +944,7 @@ static void __init NCR5380_init(struct Scsi_Host *instance, int flags)
NCR5380_local_declare();
int i, pass;
unsigned long timeout;
- struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *)
- instance->hostdata;
+ struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
/*
* On NCR53C400 boards, NCR5380 registers are mapped 8 past
@@ -1078,9 +1004,7 @@ static void __init NCR5380_init(struct Scsi_Host *instance, int flags)
#ifndef AUTOSENSE
if ((instance->cmd_per_lun > 1) || instance->can_queue > 1)
)
- printk("scsi%d : WARNING : support for multiple outstanding commands enabled\n"
- " without AUTOSENSE option, contingent allegiance conditions may\n"
- " be incorrectly cleared.\n", instance->host_no);
+ printk("scsi%d : WARNING : support for multiple outstanding commands enabled\n" " without AUTOSENSE option, contingent allegiance conditions may\n" " be incorrectly cleared.\n", instance->host_no);
#endif /* def AUTOSENSE */
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
@@ -1106,30 +1030,25 @@ static void __init NCR5380_init(struct Scsi_Host *instance, int flags)
* failing, do a hard reset of the SCSI bus
*/
- for (pass = 1; (NCR5380_read(STATUS_REG) & SR_BSY) &&
- pass <= 6; ++pass) {
+ for (pass = 1; (NCR5380_read(STATUS_REG) & SR_BSY) && pass <= 6; ++pass) {
switch (pass) {
case 1:
case 3:
case 5:
- printk("scsi%d: SCSI bus busy, waiting up to five seconds\n",
- instance->host_no);
+ printk("scsi%d: SCSI bus busy, waiting up to five seconds\n", instance->host_no);
timeout = jiffies + 5 * HZ;
- while (time_before(jiffies,timeout) && (NCR5380_read(STATUS_REG) & SR_BSY));
+ while (time_before(jiffies, timeout) && (NCR5380_read(STATUS_REG) & SR_BSY));
break;
case 2:
- printk("scsi%d: bus busy, attempting abort\n",
- instance->host_no);
+ printk("scsi%d: bus busy, attempting abort\n", instance->host_no);
do_abort(instance);
break;
case 4:
- printk("scsi%d: bus busy, attempting reset\n",
- instance->host_no);
+ printk("scsi%d: bus busy, attempting reset\n", instance->host_no);
do_reset(instance);
break;
case 6:
- printk("scsi%d: bus locked solid or invalid override\n",
- instance->host_no);
+ printk("scsi%d: bus locked solid or invalid override\n", instance->host_no);
}
}
}
@@ -1158,16 +1077,14 @@ static
#endif
int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) {
struct Scsi_Host *instance = cmd->host;
- struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *)
- instance->hostdata;
+ struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
Scsi_Cmnd *tmp;
#if (NDEBUG & NDEBUG_NO_WRITE)
switch (cmd->cmnd[0]) {
- case WRITE_6:
- case WRITE_10:
- printk("scsi%d : WRITE attempted with NO_WRITE debugging flag set\n",
- instance->host_no);
+ case WRITE_6:
+ case WRITE_10:
+ printk("scsi%d : WRITE attempted with NO_WRITE debugging flag set\n", instance->host_no);
cmd->result = (DID_ERROR << 16);
done(cmd);
return 0;
@@ -1176,8 +1093,7 @@ int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) {
#ifdef NCR5380_STATS
#if 0
- if (!hostdata->connected && !hostdata->issue_queue &&
- !hostdata->disconnected_queue) {
+ if (!hostdata->connected && !hostdata->issue_queue && !hostdata->disconnected_queue) {
hostdata->timebase = jiffies;
}
#endif
@@ -1185,17 +1101,17 @@ int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) {
if (cmd->request_bufflen > NCR5380_STAT_LIMIT)
#endif
switch (cmd->cmnd[0]) {
- case WRITE:
- case WRITE_6:
- case WRITE_10:
- hostdata->time_write[cmd->target] -= (jiffies - hostdata->timebase);
+ case WRITE:
+ case WRITE_6:
+ case WRITE_10:
+ hostdata->time_write[cmd->target] -= (jiffies - hostdata->timebase);
hostdata->bytes_write[cmd->target] += cmd->request_bufflen;
hostdata->pendingw++;
break;
- case READ:
- case READ_6:
- case READ_10:
- hostdata->time_read[cmd->target] -= (jiffies - hostdata->timebase);
+ case READ:
+ case READ_6:
+ case READ_10:
+ hostdata->time_read[cmd->target] -= (jiffies - hostdata->timebase);
hostdata->bytes_read[cmd->target] += cmd->request_bufflen;
hostdata->pendingr++;
break;
@@ -1225,14 +1141,12 @@ int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) {
cmd->host_scribble = (unsigned char *) hostdata->issue_queue;
hostdata->issue_queue = cmd;
} else {
- for (tmp = (Scsi_Cmnd *) hostdata->issue_queue; tmp->host_scribble;
- tmp = (Scsi_Cmnd *) tmp->host_scribble);
+ for (tmp = (Scsi_Cmnd *) hostdata->issue_queue; tmp->host_scribble; tmp = (Scsi_Cmnd *) tmp->host_scribble);
LIST(cmd, tmp);
tmp->host_scribble = (unsigned char *) cmd;
}
#if (NDEBUG & NDEBUG_QUEUES)
- printk("scsi%d : command added to %s of queue\n", instance->host_no,
- (cmd->cmnd[0] == REQUEST_SENSE) ? "head" : "tail");
+ printk("scsi%d : command added to %s of queue\n", instance->host_no, (cmd->cmnd[0] == REQUEST_SENSE) ? "head" : "tail");
#endif
/* Run the coroutine if it isn't already running. */
@@ -1271,22 +1185,21 @@ static void NCR5380_main(void) {
* this should prevent any race conditions.
*/
- spin_unlock_irq(&io_request_lock);
-
- save_flags(flags);
-
+ spin_unlock_irq(&io_request_lock);
+
+ save_flags(flags);
+
do {
cli(); /* Freeze request queues */
done = 1;
- for (instance = first_instance; instance &&
- instance->hostt == the_template; instance = instance->next) {
- hostdata = (struct NCR5380_hostdata *) instance->hostdata;
- cli();
+ for (instance = first_instance; instance && instance->hostt == the_template; instance = instance->next) {
+ hostdata = (struct NCR5380_hostdata *) instance->hostdata;
+ cli();
#ifdef USLEEP
if (!hostdata->connected && !hostdata->selecting) {
#else
if (!hostdata->connected) {
-#endif
+#endif
#if (NDEBUG & NDEBUG_MAIN)
printk("scsi%d : not connected\n", instance->host_no);
#endif
@@ -1300,9 +1213,7 @@ static void NCR5380_main(void) {
if ((tmp == prev) && tmp)
printk(" LOOP\n"); /* else printk("\n"); */
#endif
- for (tmp = (Scsi_Cmnd *) hostdata->issue_queue,
- prev = NULL; tmp; prev = tmp, tmp = (Scsi_Cmnd *)
- tmp->host_scribble) {
+ for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, prev = NULL; tmp; prev = tmp, tmp = (Scsi_Cmnd *) tmp->host_scribble) {
#if (NDEBUG & NDEBUG_LISTS)
if (prev != tmp)
@@ -1329,8 +1240,7 @@ static void NCR5380_main(void) {
* issue queue so we can keep trying.
*/
#if (NDEBUG & (NDEBUG_MAIN | NDEBUG_QUEUES))
- printk("scsi%d : main() : command for target %d lun %d removed from issue_queue\n",
- instance->host_no, tmp->target, tmp->lun);
+ printk("scsi%d : main() : command for target %d lun %d removed from issue_queue\n", instance->host_no, tmp->target, tmp->lun);
#endif
/*
@@ -1344,19 +1254,18 @@ static void NCR5380_main(void) {
* with failures we will restart.
*/
#ifdef USLEEP
- hostdata->selecting = 0; /* RvC: have to preset this
- to indicate a new command is being performed */
+ hostdata->selecting = 0; /* RvC: have to preset this
+ to indicate a new command is being performed */
#endif
if (!NCR5380_select(instance, tmp,
- /*
- * REQUEST SENSE commands are issued without tagged
- * queueing, even on SCSI-II devices because the
- * contingent allegiance condition exists for the
- * entire unit.
- */
- (tmp->cmnd[0] == REQUEST_SENSE) ? TAG_NONE :
- TAG_NEXT)) {
+ /*
+ * REQUEST SENSE commands are issued without tagged
+ * queueing, even on SCSI-II devices because the
+ * contingent allegiance condition exists for the
+ * entire unit.
+ */
+ (tmp->cmnd[0] == REQUEST_SENSE) ? TAG_NONE : TAG_NEXT)) {
break;
} else {
cli();
@@ -1367,30 +1276,23 @@ static void NCR5380_main(void) {
done = 0;
restore_flags(flags);
#if (NDEBUG & (NDEBUG_MAIN | NDEBUG_QUEUES))
- printk("scsi%d : main(): select() failed, returned to issue_queue\n",
- instance->host_no);
+ printk("scsi%d : main(): select() failed, returned to issue_queue\n", instance->host_no);
#endif
}
} /* if target/lun is not busy */
} /* for */
} /* if (!hostdata->connected) */
#ifdef USLEEP
- if (hostdata->selecting)
- {
- tmp = (Scsi_Cmnd *)hostdata->selecting;
- if (!NCR5380_select(instance, tmp,
- (tmp->cmnd[0] == REQUEST_SENSE) ? TAG_NONE : TAG_NEXT))
- {
+ if (hostdata->selecting) {
+ tmp = (Scsi_Cmnd *) hostdata->selecting;
+ if (!NCR5380_select(instance, tmp, (tmp->cmnd[0] == REQUEST_SENSE) ? TAG_NONE : TAG_NEXT)) {
/* Ok ?? */
- }
- else
- {
+ } else {
/* RvC: device failed, so we wait a long time
- this is needed for Mustek scanners, that
- do not respond to commands immediately
- after a scan */
- printk(KERN_DEBUG "scsi%d: device %d did not respond in time\n",
- instance->host_no, tmp->target);
+ this is needed for Mustek scanners, that
+ do not respond to commands immediately
+ after a scan */
+ printk(KERN_DEBUG "scsi%d: device %d did not respond in time\n", instance->host_no, tmp->target);
cli();
LIST(tmp, hostdata->issue_queue);
tmp->host_scribble = (unsigned char *) hostdata->issue_queue;
@@ -1398,9 +1300,9 @@ static void NCR5380_main(void) {
restore_flags(flags);
hostdata->time_expires = jiffies + USLEEP_WAITLONG;
- NCR5380_set_timer (instance);
+ NCR5380_set_timer(instance);
}
- } /* if hostdata->selecting */
+ } /* if hostdata->selecting */
#endif
if (hostdata->connected
#ifdef REAL_DMA
@@ -1412,8 +1314,7 @@ static void NCR5380_main(void) {
) {
restore_flags(flags);
#if (NDEBUG & NDEBUG_MAIN)
- printk("scsi%d : main() : performing information transfer\n",
- instance->host_no);
+ printk("scsi%d : main() : performing information transfer\n", instance->host_no);
#endif
NCR5380_information_transfer(instance);
#if (NDEBUG & NDEBUG_MAIN)
@@ -1425,7 +1326,7 @@ static void NCR5380_main(void) {
} /* for instance */
} while (!done);
spin_lock_irq(&io_request_lock);
- /* cli();*/
+ /* cli(); */
main_running = 0;
}
@@ -1458,8 +1359,7 @@ static void NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs) {
#endif
do {
done = 1;
- for (instance = first_instance; instance && (instance->hostt ==
- the_template); instance = instance->next)
+ for (instance = first_instance; instance && (instance->hostt == the_template); instance = instance->next)
if (instance->irq == irq) {
/* Look for pending interrupts */
@@ -1470,8 +1370,7 @@ static void NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs) {
#if (NDEBUG & NDEBUG_INTR)
NCR5380_print(instance);
#endif
- if ((NCR5380_read(STATUS_REG) & (SR_SEL | SR_IO)) ==
- (SR_SEL | SR_IO)) {
+ if ((NCR5380_read(STATUS_REG) & (SR_SEL | SR_IO)) == (SR_SEL | SR_IO)) {
done = 0;
restore_flags(flags);
#if (NDEBUG & NDEBUG_INTR)
@@ -1502,14 +1401,11 @@ static void NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs) {
* the current setting of the MODE register.
*/
- if ((NCR5380_read(MODE_REG) & MR_DMA) && ((basr &
- BASR_END_DMA_TRANSFER) ||
- !(basr & BASR_PHASE_MATCH))) {
+ if ((NCR5380_read(MODE_REG) & MR_DMA) && ((basr & BASR_END_DMA_TRANSFER) || !(basr & BASR_PHASE_MATCH))) {
int transfered;
if (!hostdata->connected)
- panic("scsi%d : received end of DMA interrupt with no connected cmd\n",
- instance->hostno);
+ panic("scsi%d : received end of DMA interrupt with no connected cmd\n", instance->hostno);
transfered = (hostdata->dmalen - NCR5380_dma_residual(instance));
hostdata->connected->SCp.this_residual -= transferred;
@@ -1522,13 +1418,11 @@ static void NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs) {
unsigned long timeout = jiffies + NCR_TIMEOUT;
spin_unlock_irq(&io_request_lock);
- while (NCR5380_read(BUS_AND_STATUS_REG) & BASR_ACK
- && time_before(jiffies, timeout));
+ while (NCR5380_read(BUS_AND_STATUS_REG) & BASR_ACK && time_before(jiffies, timeout));
spin_lock_irq(&io_request_lock);
-
- if (time_after_eq(jiffies, timeout) )
- printk("scsi%d: timeout at NCR5380.c:%d\n",
- host->host_no, __LINE__);
+
+ if (time_after_eq(jiffies, timeout))
+ printk("scsi%d: timeout at NCR5380.c:%d\n", host->host_no, __LINE__);
}
#else /* NCR_TIMEOUT */
while (NCR5380_read(BUS_AND_STATUS_REG) & BASR_ACK);
@@ -1559,26 +1453,21 @@ static void do_NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs) {
NCR5380_intr(irq, dev_id, regs);
spin_unlock_irqrestore(&io_request_lock, flags);
}
-
#endif
-
#ifdef NCR5380_STATS
static void collect_stats(struct NCR5380_hostdata *hostdata, Scsi_Cmnd * cmd) {
#ifdef NCR5380_STAT_LIMIT
if (cmd->request_bufflen > NCR5380_STAT_LIMIT)
#endif
switch (cmd->cmnd[0]) {
- case WRITE:
- case WRITE_6:
- case WRITE_10:
- hostdata->time_write[cmd->target] += (jiffies - hostdata->timebase);
+ case WRITE:
+ case WRITE_6:
+ case WRITE_10:
+ hostdata->time_write[cmd->target] += (jiffies - hostdata->timebase);
/*hostdata->bytes_write[cmd->target] += cmd->request_bufflen; */
hostdata->pendingw--;
break;
- case READ:
- case READ_6:
- case READ_10:
- hostdata->time_read[cmd->target] += (jiffies - hostdata->timebase);
+ case READ:case READ_6:case READ_10:hostdata->time_read[cmd->target] += (jiffies - hostdata->timebase);
/*hostdata->bytes_read[cmd->target] += cmd->request_bufflen; */
hostdata->pendingr--;
break;
@@ -1614,8 +1503,7 @@ static void collect_stats(struct NCR5380_hostdata *hostdata, Scsi_Cmnd * cmd) {
*
* If failed (no target) : cmd->scsi_done() will be called, and the
* cmd->result host byte set to DID_BAD_TARGET.
- */
-static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag) {
+ */ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag) {
NCR5380_local_declare();
struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
unsigned char tmp[3], phase;
@@ -1627,42 +1515,39 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag)
unsigned char value;
#endif
- NCR5380_setup(instance);
+ NCR5380_setup(instance);
#ifdef USLEEP
- if (hostdata->selecting)
- {
+ if (hostdata->selecting) {
goto part2; /* RvC: sorry prof. Dijkstra, but it keeps the
rest of the code nearly the same */
}
#endif
-
- hostdata->restart_select = 0;
+ hostdata->restart_select = 0;
#if defined (NDEBUG) && (NDEBUG & NDEBUG_ARBITRATION)
- NCR5380_print(instance);
- printk("scsi%d : starting arbitration, id = %d\n", instance->host_no,
- instance->this_id);
+ NCR5380_print(instance);
+ printk("scsi%d : starting arbitration, id = %d\n", instance->host_no, instance->this_id);
#endif
- save_flags(flags);
- cli();
+ save_flags(flags);
+ cli();
/*
* Set the phase bits to 0, otherwise the NCR5380 won't drive the
* data bus during SELECTION.
*/
- NCR5380_write(TARGET_COMMAND_REG, 0);
+ NCR5380_write(TARGET_COMMAND_REG, 0);
/*
* Start arbitration.
*/
- NCR5380_write(OUTPUT_DATA_REG, hostdata->id_mask);
- NCR5380_write(MODE_REG, MR_ARBITRATE);
+ NCR5380_write(OUTPUT_DATA_REG, hostdata->id_mask);
+ NCR5380_write(MODE_REG, MR_ARBITRATE);
- restore_flags(flags);
+ restore_flags(flags);
/* Wait for arbitration logic to complete */
#if NCR_TIMEOUT
@@ -1672,11 +1557,11 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag)
spin_unlock_irq(&io_request_lock);
while (!(NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_PROGRESS)
- && time_before(jiffies,timeout));
+ && time_before(jiffies, timeout));
spin_lock_irq(&io_request_lock);
-
- if (time_after_eq(jiffies,timeout)) {
+
+ if (time_after_eq(jiffies, timeout)) {
printk("scsi: arbitration timeout at %d\n", __LINE__);
NCR5380_write(MODE_REG, MR_BASE);
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
@@ -1688,9 +1573,9 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag)
#endif
#if (NDEBUG & NDEBUG_ARBITRATION)
- printk("scsi%d : arbitration complete\n", instance->host_no);
+ printk("scsi%d : arbitration complete\n", instance->host_no);
/* Avoid GCC 2.4.5 asm needs to many reloads error */
- __asm__("nop");
+ __asm__("nop");
#endif
/*
@@ -1700,33 +1585,28 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag)
*
*/
- udelay(3);
+ udelay(3);
/* Check for lost arbitration */
- if ((NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST) ||
- (NCR5380_read(CURRENT_SCSI_DATA_REG) & hostdata->id_higher_mask) ||
- (NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST)) {
+ if ((NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST) || (NCR5380_read(CURRENT_SCSI_DATA_REG) & hostdata->id_higher_mask) || (NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST)) {
NCR5380_write(MODE_REG, MR_BASE);
#if (NDEBUG & NDEBUG_ARBITRATION)
- printk("scsi%d : lost arbitration, deasserting MR_ARBITRATE\n",
- instance->host_no);
+ printk("scsi%d : lost arbitration, deasserting MR_ARBITRATE\n", instance->host_no);
#endif
return -1;
}
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_SEL);
if (!(hostdata->flags & FLAG_DTC3181E) &&
- /* RvC: DTC3181E has some trouble with this
- * so we simply removed it. Seems to work with
- * only Mustek scanner attached
- */
- (NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST))
- {
+ /* RvC: DTC3181E has some trouble with this
+ * so we simply removed it. Seems to work with
+ * only Mustek scanner attached
+ */
+ (NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST)) {
NCR5380_write(MODE_REG, MR_BASE);
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
#if (NDEBUG & NDEBUG_ARBITRATION)
- printk("scsi%d : lost arbitration, deasserting ICR_ASSERT_SEL\n",
- instance->host_no);
+ printk("scsi%d : lost arbitration, deasserting ICR_ASSERT_SEL\n", instance->host_no);
#endif
return -1;
}
@@ -1755,8 +1635,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag)
* phase immediately after selection.
*/
- NCR5380_write(INITIATOR_COMMAND_REG, (ICR_BASE | ICR_ASSERT_BSY |
- ICR_ASSERT_DATA | ICR_ASSERT_ATN | ICR_ASSERT_SEL));
+ NCR5380_write(INITIATOR_COMMAND_REG, (ICR_BASE | ICR_ASSERT_BSY | ICR_ASSERT_DATA | ICR_ASSERT_ATN | ICR_ASSERT_SEL));
NCR5380_write(MODE_REG, MR_BASE);
/*
@@ -1772,8 +1651,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag)
udelay(1); /* wingel -- wait two bus deskew delay >2*45ns */
/* Reset BSY */
- NCR5380_write(INITIATOR_COMMAND_REG, (ICR_BASE | ICR_ASSERT_DATA |
- ICR_ASSERT_ATN | ICR_ASSERT_SEL));
+ NCR5380_write(INITIATOR_COMMAND_REG, (ICR_BASE | ICR_ASSERT_DATA | ICR_ASSERT_ATN | ICR_ASSERT_SEL));
/*
* Something weird happens when we cease to drive BSY - looks
@@ -1812,39 +1690,35 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag)
*/
#ifdef USLEEP
- hostdata->select_time = 0; /* we count the clock ticks at which we polled */
+ hostdata->select_time = 0; /* we count the clock ticks at which we polled */
hostdata->selecting = cmd;
-part2:
- /* RvC: here we enter after a sleeping period, or immediately after
- execution of part 1
- we poll only once ech clock tick */
+ part2:
+ /* RvC: here we enter after a sleeping period, or immediately after
+ execution of part 1
+ we poll only once ech clock tick */
value = NCR5380_read(STATUS_REG) & (SR_BSY | SR_IO);
- if (!value && (hostdata->select_time < 25))
- {
+ if (!value && (hostdata->select_time < 25)) {
/* RvC: we still must wait for a device response */
- hostdata->select_time++; /* after 25 ticks the device has failed */
+ hostdata->select_time++; /* after 25 ticks the device has failed */
hostdata->time_expires = jiffies + 1;
NCR5380_set_timer(instance);
return 0; /* RvC: we return here with hostdata->selecting set,
to go to sleep */
}
- hostdata->selecting = 0; /* clear this pointer, because we passed the
- waiting period */
+ hostdata->selecting = 0; /* clear this pointer, because we passed the
+ waiting period */
#else
spin_unlock_irq(&io_request_lock);
- while (time_before(jiffies, timeout) && !(NCR5380_read(STATUS_REG) &
- (SR_BSY | SR_IO)));
+ while (time_before(jiffies, timeout) && !(NCR5380_read(STATUS_REG) & (SR_BSY | SR_IO)));
spin_lock_irq(&io_request_lock);
#endif
- if ((NCR5380_read(STATUS_REG) & (SR_SEL | SR_IO)) ==
- (SR_SEL | SR_IO)) {
+ if ((NCR5380_read(STATUS_REG) & (SR_SEL | SR_IO)) == (SR_SEL | SR_IO)) {
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
NCR5380_reselect(instance);
- printk("scsi%d : reselection after won arbitration?\n",
- instance->host_no);
+ printk("scsi%d : reselection after won arbitration?\n", instance->host_no);
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
return -1;
}
@@ -1877,8 +1751,7 @@ part2:
cmd->scsi_done(cmd);
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
#if (NDEBUG & NDEBUG_SELECTION)
- printk("scsi%d : target did not respond within 250ms\n",
- instance->host_no);
+ printk("scsi%d : target did not respond within 250ms\n", instance->host_no);
#endif
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
return 0;
@@ -1908,7 +1781,7 @@ part2:
spin_unlock_irq(&io_request_lock);
while (!(NCR5380_read(STATUS_REG) & SR_REQ) && time_before(jiffies, timeout));
spin_lock_irq(&io_request_lock);
-
+
if (time_after_eq(jiffies, timeout)) {
printk("scsi%d: timeout at NCR5380.c:%d\n", instance->host_no, __LINE__);
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
@@ -1920,8 +1793,7 @@ part2:
#endif /* def NCR_TIMEOUT */
#if (NDEBUG & NDEBUG_SELECTION)
- printk("scsi%d : target %d selected, going into MESSAGE OUT phase.\n",
- instance->host_no, cmd->target);
+ printk("scsi%d : target %d selected, going into MESSAGE OUT phase.\n", instance->host_no, cmd->target);
#endif
tmp[0] = IDENTIFY(((instance->irq == IRQ_NONE) ? 0 : 1), cmd->lun);
#ifdef SCSI2
@@ -1992,20 +1864,19 @@ part2:
* counts, we will always do a pseudo DMA or DMA transfer.
*/
-static int NCR5380_transfer_pio(struct Scsi_Host *instance,
- unsigned char *phase, int *count, unsigned char **data) {
+static int NCR5380_transfer_pio(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data) {
NCR5380_local_declare();
register unsigned char p = *phase, tmp;
register int c = *count;
register unsigned char *d = *data;
#ifdef USLEEP
/*
- * RvC: some administrative data to process polling time
+ * RvC: some administrative data to process polling time
*/
int break_allowed = 0;
struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
#endif
- NCR5380_setup(instance);
+ NCR5380_setup(instance);
#if (NDEBUG & NDEBUG_PIO)
if (!(p & SR_IO))
@@ -2024,15 +1895,12 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance,
#ifdef USLEEP
/* RvC: don't know if this is necessary, but other SCSI I/O is short
- * so breaks are not necessary there
+ * so breaks are not necessary there
*/
- if ((p == PHASE_DATAIN) || (p == PHASE_DATAOUT))
- {
+ if ((p == PHASE_DATAIN) || (p == PHASE_DATAOUT)) {
break_allowed = 1;
}
#endif
-
-
do {
/*
* Wait for assertion of REQ, after which the phase bits will be
@@ -2041,21 +1909,19 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance,
#ifdef USLEEP
/* RvC: we simply poll once, after that we stop temporarily
- * and let the device buffer fill up
- * if breaking is not allowed, we keep polling as long as needed
+ * and let the device buffer fill up
+ * if breaking is not allowed, we keep polling as long as needed
*/
- while ( !((tmp = NCR5380_read(STATUS_REG)) & SR_REQ) &&
- !break_allowed );
- if (!(tmp & SR_REQ))
- {
+ while (!((tmp = NCR5380_read(STATUS_REG)) & SR_REQ) && !break_allowed);
+ if (!(tmp & SR_REQ)) {
/* timeout condition */
hostdata->time_expires = jiffies + USLEEP_SLEEP;
- NCR5380_set_timer (instance);
+ NCR5380_set_timer(instance);
break;
}
#else
- while ( !((tmp = NCR5380_read(STATUS_REG)) & SR_REQ) );
+ while (!((tmp = NCR5380_read(STATUS_REG)) & SR_REQ));
#endif
#if (NDEBUG & NDEBUG_HANDSHAKE)
@@ -2070,8 +1936,9 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance,
#endif
break;
}
- /* Do actual transfer from SCSI bus to / from memory */ if (!(p & SR_IO))
- NCR5380_write(OUTPUT_DATA_REG, *d);
+ /* Do actual transfer from SCSI bus to / from memory */
+ if (!(p & SR_IO))
+ NCR5380_write(OUTPUT_DATA_REG, *d);
else
*d = NCR5380_read(CURRENT_SCSI_DATA_REG);
@@ -2086,21 +1953,17 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance,
if (!(p & SR_IO)) {
if (!((p & SR_MSG) && c > 1)) {
- NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE |
- ICR_ASSERT_DATA);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA);
#if (NDEBUG & NDEBUG_PIO)
NCR5380_print(instance);
#endif
- NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE |
- ICR_ASSERT_DATA | ICR_ASSERT_ACK);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA | ICR_ASSERT_ACK);
} else {
- NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE |
- ICR_ASSERT_DATA | ICR_ASSERT_ATN);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA | ICR_ASSERT_ATN);
#if (NDEBUG & NDEBUG_PIO)
NCR5380_print(instance);
#endif
- NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE |
- ICR_ASSERT_DATA | ICR_ASSERT_ATN | ICR_ASSERT_ACK);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA | ICR_ASSERT_ATN | ICR_ASSERT_ACK);
}
} else {
#if (NDEBUG & NDEBUG_PIO)
@@ -2159,8 +2022,7 @@ static void do_reset(struct Scsi_Host *host) {
save_flags(flags);
cli();
- NCR5380_write(TARGET_COMMAND_REG,
- PHASE_SR_TO_TCR(NCR5380_read(STATUS_REG) & PHASE_MASK));
+ NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(NCR5380_read(STATUS_REG) & PHASE_MASK));
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_RST);
udelay(25);
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
@@ -2198,8 +2060,7 @@ static void do_reset(struct Scsi_Host *host) {
NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(tmp));
if ((tmp & PHASE_MASK) != PHASE_MSGOUT) {
- NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN |
- ICR_ASSERT_ACK);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN | ICR_ASSERT_ACK);
while (NCR5380_read(STATUS_REG) & SR_REQ);
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN);
}
@@ -2238,8 +2099,7 @@ static void do_reset(struct Scsi_Host *host) {
*/
-static int NCR5380_transfer_dma(struct Scsi_Host *instance,
- unsigned char *phase, int *count, unsigned char **data) {
+static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data) {
NCR5380_local_declare();
register int c = *count;
register unsigned char p = *phase;
@@ -2264,25 +2124,23 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance,
return -1;
}
#if defined(REAL_DMA) || defined(REAL_DMA_POLL)
-#ifdef READ_OVERRUNS
- if (p & SR_IO) { c -= 2; }
+#ifdef READ_OVERRUNS
+ if (p & SR_IO) {
+ c -= 2;
+ }
#endif
#if (NDEBUG & NDEBUG_DMA)
-printk("scsi%d : initializing DMA channel %d for %s, %d bytes %s %0x\n",
- instance->host_no, instance->dma_channel, (p & SR_IO) ? "reading" :
- "writing", c, (p & SR_IO) ? "to" : "from", (unsigned) d);
+ printk("scsi%d : initializing DMA channel %d for %s, %d bytes %s %0x\n", instance->host_no, instance->dma_channel, (p & SR_IO) ? "reading" : "writing", c, (p & SR_IO) ? "to" : "from", (unsigned) d);
#endif
-hostdata->dma_len = (p & SR_IO) ?
-NCR5380_dma_read_setup(instance, d, c) :
-NCR5380_dma_write_setup(instance, d, c);
+ hostdata->dma_len = (p & SR_IO) ? NCR5380_dma_read_setup(instance, d, c) : NCR5380_dma_write_setup(instance, d, c);
#endif
-NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(p));
+ NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(p));
#ifdef REAL_DMA
-NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE | MR_ENABLE_EOP_INTR | MR_MONITOR_BSY);
+ NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE | MR_ENABLE_EOP_INTR | MR_MONITOR_BSY);
#elif defined(REAL_DMA_POLL)
-NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE);
+ NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE);
#else
/*
* Note : on my sample board, watch-dog timeouts occurred when interrupts
@@ -2291,20 +2149,18 @@ NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE);
*/
#if defined(PSEUDO_DMA) && !defined(UNSAFE)
-save_flags(flags);
-cli();
+ save_flags(flags);
+ cli();
#endif
/* KLL May need eop and parity in 53c400 */
-if (hostdata->flags & FLAG_NCR53C400)
- NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE | MR_ENABLE_PAR_CHECK
- | MR_ENABLE_PAR_INTR | MR_ENABLE_EOP_INTR | MR_DMA_MODE
- | MR_MONITOR_BSY);
-else
- NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE);
+ if (hostdata->flags & FLAG_NCR53C400)
+ NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE | MR_ENABLE_PAR_CHECK | MR_ENABLE_PAR_INTR | MR_ENABLE_EOP_INTR | MR_DMA_MODE | MR_MONITOR_BSY);
+ else
+ NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE);
#endif /* def REAL_DMA */
#if (NDEBUG & NDEBUG_DMA) & 0
-printk("scsi%d : mode reg = 0x%X\n", instance->host_no, NCR5380_read(MODE_REG));
+ printk("scsi%d : mode reg = 0x%X\n", instance->host_no, NCR5380_read(MODE_REG));
#endif
/*
@@ -2316,32 +2172,29 @@ printk("scsi%d : mode reg = 0x%X\n", instance->host_no, NCR5380_read(MODE_REG));
* is the problem?
*/
-if (p & SR_IO)
-{
+ if (p & SR_IO) {
#ifndef FOO
-udelay(1);
+ udelay(1);
#endif
-NCR5380_write(START_DMA_INITIATOR_RECEIVE_REG, 0);
-} else {
+ NCR5380_write(START_DMA_INITIATOR_RECEIVE_REG, 0);
+ } else {
#ifndef FOO
- udelay(1);
+ udelay(1);
#endif
- NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA);
#ifndef FOO
- udelay(1);
+ udelay(1);
#endif
- NCR5380_write(START_DMA_SEND_REG, 0);
+ NCR5380_write(START_DMA_SEND_REG, 0);
#ifndef FOO
- udelay(1);
+ udelay(1);
#endif
-}
+ }
#if defined(REAL_DMA_POLL)
-do {
- tmp = NCR5380_read(BUS_AND_STATUS_REG);
-} while ((tmp & BASR_PHASE_MATCH) && !(tmp & (BASR_BUSY_ERROR |
-
- BASR_END_DMA_TRANSFER)));
+ do {
+ tmp = NCR5380_read(BUS_AND_STATUS_REG);
+ } while ((tmp & BASR_PHASE_MATCH) && !(tmp & (BASR_BUSY_ERROR | BASR_END_DMA_TRANSFER)));
/*
At this point, either we've completed DMA, or we have a phase mismatch,
@@ -2379,172 +2232,149 @@ do {
request.
*/
-if (p & SR_IO) {
+ if (p & SR_IO) {
#ifdef READ_OVERRUNS
- udelay(10);
- if (((NCR5380_read(BUS_AND_STATUS_REG) & (BASR_PHASE_MATCH | BASR_ACK)) ==
- (BASR_PHASE_MATCH | BASR_ACK))) {
- saved_data = NCR5380_read(INPUT_DATA_REGISTER);
- overrun = 1;
- }
+ udelay(10);
+ if (((NCR5380_read(BUS_AND_STATUS_REG) & (BASR_PHASE_MATCH | BASR_ACK)) == (BASR_PHASE_MATCH | BASR_ACK))) {
+ saved_data = NCR5380_read(INPUT_DATA_REGISTER);
+ overrun = 1;
+ }
#endif
-} else {
- int limit = 100;
- while (((tmp = NCR5380_read(BUS_AND_STATUS_REG)) & BASR_ACK) ||
- (NCR5380_read(STATUS_REG) & SR_REQ)) {
- if (!(tmp & BASR_PHASE_MATCH))
- break;
- if (--limit < 0)
- break;
+ } else {
+ int limit = 100;
+ while (((tmp = NCR5380_read(BUS_AND_STATUS_REG)) & BASR_ACK) || (NCR5380_read(STATUS_REG) & SR_REQ)) {
+ if (!(tmp & BASR_PHASE_MATCH))
+ break;
+ if (--limit < 0)
+ break;
+ }
}
-}
#if (NDEBUG & NDEBUG_DMA)
-printk("scsi%d : polled DMA transfer complete, basr 0x%X, sr 0x%X\n",
- instance->host_no, tmp, NCR5380_read(STATUS_REG));
+ printk("scsi%d : polled DMA transfer complete, basr 0x%X, sr 0x%X\n", instance->host_no, tmp, NCR5380_read(STATUS_REG));
#endif
-NCR5380_write(MODE_REG, MR_BASE);
-NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
+ NCR5380_write(MODE_REG, MR_BASE);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-residue = NCR5380_dma_residual(instance);
-c -= residue;
-*count -= c;
-*data += c;
-*phase = NCR5380_read(STATUS_REG) & PHASE_MASK;
+ residue = NCR5380_dma_residual(instance);
+ c -= residue;
+ *count -= c;
+ *data += c;
+ *phase = NCR5380_read(STATUS_REG) & PHASE_MASK;
#ifdef READ_OVERRUNS
-if (*phase == p && (p & SR_IO) && residue == 0)
-{
-if (overrun) {
+ if (*phase == p && (p & SR_IO) && residue == 0) {
+ if (overrun) {
#if (NDEBUG & NDEBUG_DMA)
- printk("Got an input overrun, using saved byte\n");
-#endif
- **data = saved_data;
- *data += 1;
- *count -= 1;
- cnt = toPIO = 1;
-} else {
- printk("No overrun??\n");
- cnt = toPIO = 2;
-}
+ printk("Got an input overrun, using saved byte\n");
+#endif
+ **data = saved_data;
+ *data += 1;
+ *count -= 1;
+ cnt = toPIO = 1;
+ } else {
+ printk("No overrun??\n");
+ cnt = toPIO = 2;
+ }
#if (NDEBUG & NDEBUG_DMA)
-printk("Doing %d-byte PIO to 0x%X\n", cnt, *data);
+ printk("Doing %d-byte PIO to 0x%X\n", cnt, *data);
#endif
-NCR5380_transfer_pio(instance, phase, &cnt, data);
-*count -= toPIO - cnt;
-}
+ NCR5380_transfer_pio(instance, phase, &cnt, data);
+ *count -= toPIO - cnt;
+ }
#endif
#if (NDEBUG & NDEBUG_DMA)
-printk("Return with data ptr = 0x%X, count %d, last 0x%X, next 0x%X\n",
- *data, *count, *(*data + *count - 1), *(*data + *count));
+ printk("Return with data ptr = 0x%X, count %d, last 0x%X, next 0x%X\n", *data, *count, *(*data + *count - 1), *(*data + *count));
#endif
-return 0;
+ return 0;
#elif defined(REAL_DMA)
-return 0;
+ return 0;
#else /* defined(REAL_DMA_POLL) */
-if (p & SR_IO) {
+ if (p & SR_IO) {
#ifdef DMA_WORKS_RIGHT
- foo = NCR5380_pread(instance, d, c);
+ foo = NCR5380_pread(instance, d, c);
#else
- int diff = 1;
- if (hostdata->flags & FLAG_NCR53C400) {
- diff = 0;
- }
- if (!(foo = NCR5380_pread(instance, d, c - diff))) {
- /*
- * We can't disable DMA mode after successfully transferring
- * what we plan to be the last byte, since that would open up
- * a race condition where if the target asserted REQ before
- * we got the DMA mode reset, the NCR5380 would have latched
- * an additional byte into the INPUT DATA register and we'd
- * have dropped it.
- *
- * The workaround was to transfer one fewer bytes than we
- * intended to with the pseudo-DMA read function, wait for
- * the chip to latch the last byte, read it, and then disable
- * pseudo-DMA mode.
- *
- * After REQ is asserted, the NCR5380 asserts DRQ and ACK.
- * REQ is deasserted when ACK is asserted, and not reasserted
- * until ACK goes false. Since the NCR5380 won't lower ACK
- * until DACK is asserted, which won't happen unless we twiddle
- * the DMA port or we take the NCR5380 out of DMA mode, we
- * can guarantee that we won't handshake another extra
- * byte.
- */
+ int diff = 1;
+ if (hostdata->flags & FLAG_NCR53C400) {
+ diff = 0;
+ }
+ if (!(foo = NCR5380_pread(instance, d, c - diff))) {
+ /*
+ * We can't disable DMA mode after successfully transferring
+ * what we plan to be the last byte, since that would open up
+ * a race condition where if the target asserted REQ before
+ * we got the DMA mode reset, the NCR5380 would have latched
+ * an additional byte into the INPUT DATA register and we'd
+ * have dropped it.
+ *
+ * The workaround was to transfer one fewer bytes than we
+ * intended to with the pseudo-DMA read function, wait for
+ * the chip to latch the last byte, read it, and then disable
+ * pseudo-DMA mode.
+ *
+ * After REQ is asserted, the NCR5380 asserts DRQ and ACK.
+ * REQ is deasserted when ACK is asserted, and not reasserted
+ * until ACK goes false. Since the NCR5380 won't lower ACK
+ * until DACK is asserted, which won't happen unless we twiddle
+ * the DMA port or we take the NCR5380 out of DMA mode, we
+ * can guarantee that we won't handshake another extra
+ * byte.
+ */
- if (!(hostdata->flags & FLAG_NCR53C400)) {
- while (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ));
- /* Wait for clean handshake */
- while (NCR5380_read(STATUS_REG) & SR_REQ);
- d[c - 1] = NCR5380_read(INPUT_DATA_REG);
+ if (!(hostdata->flags & FLAG_NCR53C400)) {
+ while (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ));
+ /* Wait for clean handshake */
+ while (NCR5380_read(STATUS_REG) & SR_REQ);
+ d[c - 1] = NCR5380_read(INPUT_DATA_REG);
+ }
}
- }
#endif
-} else {
+ } else {
#ifdef DMA_WORKS_RIGHT
- foo = NCR5380_pwrite(instance, d, c);
+ foo = NCR5380_pwrite(instance, d, c);
#else
- int timeout;
+ int timeout;
#if (NDEBUG & NDEBUG_C400_PWRITE)
- printk("About to pwrite %d bytes\n", c);
-#endif
- if (!(foo = NCR5380_pwrite(instance, d, c))) {
- /*
- * Wait for the last byte to be sent. If REQ is being asserted for
- * the byte we're interested, we'll ACK it and it will go false.
- */
- if (!(hostdata->flags & FLAG_HAS_LAST_BYTE_SENT)) {
- timeout = 20000;
-#if 1
-#if 1
- while (!(NCR5380_read(BUS_AND_STATUS_REG) &
- BASR_DRQ) && (NCR5380_read(BUS_AND_STATUS_REG) &
- BASR_PHASE_MATCH));
-#else
- if (NCR5380_read(STATUS_REG) & SR_REQ) {
- for (; timeout &&
- !(NCR5380_read(BUS_AND_STATUS_REG) & BASR_ACK);
- --timeout);
- for (; timeout && (NCR5380_read(STATUS_REG) & SR_REQ);
- --timeout);
- }
+ printk("About to pwrite %d bytes\n", c);
#endif
+ if (!(foo = NCR5380_pwrite(instance, d, c))) {
+ /*
+ * Wait for the last byte to be sent. If REQ is being asserted for
+ * the byte we're interested, we'll ACK it and it will go false.
+ */
+ if (!(hostdata->flags & FLAG_HAS_LAST_BYTE_SENT)) {
+ timeout = 20000;
+ while (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ) && (NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH));
#if (NDEBUG & NDEBUG_LAST_BYTE_SENT)
- if (!timeout)
- printk("scsi%d : timed out on last byte\n",
- instance->host_no);
+ if (!timeout)
+ printk("scsi%d : timed out on last byte\n", instance->host_no);
#endif
- if (hostdata->flags & FLAG_CHECK_LAST_BYTE_SENT) {
- hostdata->flags &= ~FLAG_CHECK_LAST_BYTE_SENT;
- if (NCR5380_read(TARGET_COMMAND_REG) & TCR_LAST_BYTE_SENT) {
- hostdata->flags |= FLAG_HAS_LAST_BYTE_SENT;
+ if (hostdata->flags & FLAG_CHECK_LAST_BYTE_SENT) {
+ hostdata->flags &= ~FLAG_CHECK_LAST_BYTE_SENT;
+ if (NCR5380_read(TARGET_COMMAND_REG) & TCR_LAST_BYTE_SENT) {
+ hostdata->flags |= FLAG_HAS_LAST_BYTE_SENT;
#if (NDEBUG & NDEBUG_LAST_BYTE_SENT)
- printk("scsi%d : last bit sent works\n",
- instance->host_no);
+ printk("scsi%d : last bit sent works\n", instance->host_no);
#endif
+ }
}
- }
- } else {
+ } else {
#if (NDEBUG & NDEBUG_C400_PWRITE)
- printk("Waiting for LASTBYTE\n");
+ printk("Waiting for LASTBYTE\n");
#endif
- while (!(NCR5380_read(TARGET_COMMAND_REG) & TCR_LAST_BYTE_SENT));
+ while (!(NCR5380_read(TARGET_COMMAND_REG) & TCR_LAST_BYTE_SENT));
#if (NDEBUG & NDEBUG_C400_PWRITE)
- printk("Got LASTBYTE\n");
-#endif
- }
-#else
- udelay(5);
+ printk("Got LASTBYTE\n");
#endif
+ }
}
#endif
}
@@ -2613,7 +2443,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
unsigned long poll_time = jiffies + USLEEP_POLL;
#endif
- NCR5380_setup(instance);
+ NCR5380_setup(instance);
while (1) {
tmp = NCR5380_read(STATUS_REG);
@@ -2629,20 +2459,17 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
if (sink && (phase != PHASE_MSGOUT)) {
NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(tmp));
- NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN |
- ICR_ASSERT_ACK);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN | ICR_ASSERT_ACK);
while (NCR5380_read(STATUS_REG) & SR_REQ);
- NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE |
- ICR_ASSERT_ATN);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN);
sink = 0;
continue;
}
switch (phase) {
- case PHASE_DATAIN:
- case PHASE_DATAOUT:
+ case PHASE_DATAIN:
+ case PHASE_DATAOUT:
#if (NDEBUG & NDEBUG_NO_DATAOUT)
- printk("scsi%d : NDEBUG_NO_DATAOUT set, attempted DATAOUT aborted\n",
- instance->host_no);
+ printk("scsi%d : NDEBUG_NO_DATAOUT set, attempted DATAOUT aborted\n", instance->host_no);
sink = 1;
do_abort(instance);
cmd->result = DID_ERROR << 16;
@@ -2660,9 +2487,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
cmd->SCp.this_residual = cmd->SCp.buffer->length;
cmd->SCp.ptr = cmd->SCp.buffer->address;
#if (NDEBUG & NDEBUG_INFORMATION)
- printk("scsi%d : %d bytes and %d buffers left\n",
- instance->host_no, cmd->SCp.this_residual,
- cmd->SCp.buffers_residual);
+ printk("scsi%d : %d bytes and %d buffers left\n", instance->host_no, cmd->SCp.this_residual, cmd->SCp.buffers_residual);
#endif
}
/*
@@ -2684,9 +2509,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
* We supplement these 2 if's with the flag.
*/
#ifdef NCR5380_dma_xfer_len
- if (!cmd->device->borken &&
- !(hostdata->flags & FLAG_NO_PSEUDO_DMA) &&
- (transfersize = NCR5380_dma_xfer_len(instance, cmd)) != 0) {
+ if (!cmd->device->borken && !(hostdata->flags & FLAG_NO_PSEUDO_DMA) && (transfersize = NCR5380_dma_xfer_len(instance, cmd)) != 0) {
#else
transfersize = cmd->transfersize;
@@ -2695,27 +2518,21 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
transfersize = 512;
#endif /* LIMIT_TRANSFERSIZE */
- if (!cmd->device->borken && transfersize &&
- !(hostdata->flags & FLAG_NO_PSEUDO_DMA) &&
- cmd->SCp.this_residual && !(cmd->SCp.this_residual %
- transfersize)) {
+ if (!cmd->device->borken && transfersize && !(hostdata->flags & FLAG_NO_PSEUDO_DMA) && cmd->SCp.this_residual && !(cmd->SCp.this_residual % transfersize)) {
/* Limit transfers to 32K, for xx400 & xx406
* pseudoDMA that transfers in 128 bytes blocks. */
if (transfersize > 32 * 1024)
transfersize = 32 * 1024;
#endif
len = transfersize;
- if (NCR5380_transfer_dma(instance, &phase,
- &len, (unsigned char **) &cmd->SCp.ptr)) {
+ if (NCR5380_transfer_dma(instance, &phase, &len, (unsigned char **) &cmd->SCp.ptr)) {
/*
* If the watchdog timer fires, all future accesses to this
* device will use the polled-IO.
*/
- printk("scsi%d : switching target %d lun %d to slow handshake\n",
- instance->host_no, cmd->target, cmd->lun);
+ printk("scsi%d : switching target %d lun %d to slow handshake\n", instance->host_no, cmd->target, cmd->lun);
cmd->device->borken = 1;
- NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE |
- ICR_ASSERT_ATN);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN);
sink = 1;
do_abort(instance);
cmd->result = DID_ERROR << 16;
@@ -2725,12 +2542,11 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
cmd->SCp.this_residual -= transfersize - len;
} else
#endif /* defined(PSEUDO_DMA) || defined(REAL_DMA_POLL) */
- NCR5380_transfer_pio(instance, &phase,
- (int *) &cmd->SCp.this_residual, (unsigned char **)
- &cmd->SCp.ptr);
+ NCR5380_transfer_pio(instance, &phase, (int *) &cmd->SCp.this_residual, (unsigned char **)
+ &cmd->SCp.ptr);
break;
- case PHASE_MSGIN:
- len = 1;
+ case PHASE_MSGIN:
+ len = 1;
data = &tmp;
NCR5380_transfer_pio(instance, &phase, &len, &data);
cmd->SCp.Message = tmp;
@@ -2747,14 +2563,13 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
* next_link, done() is called as with unlinked commands.
*/
#ifdef LINKED
- case LINKED_CMD_COMPLETE:
- case LINKED_FLG_CMD_COMPLETE:
+ case LINKED_CMD_COMPLETE:
+ case LINKED_FLG_CMD_COMPLETE:
/* Accept message by clearing ACK */
- NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
#if (NDEBUG & NDEBUG_LINKED)
- printk("scsi%d : target %d lun %d linked command complete.\n",
- instance->host_no, cmd->target, cmd->lun);
+ printk("scsi%d : target %d lun %d linked command complete.\n", instance->host_no, cmd->target, cmd->lun);
#endif
/*
* Sanity check : A linked command should only terminate with
@@ -2763,8 +2578,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
*/
if (!cmd->next_link) {
- printk("scsi%d : target %d lun %d linked command complete, no next_link\n"
- instance->host_no, cmd->target, cmd->lun);
+ printk("scsi%d : target %d lun %d linked command complete, no next_link\n" instance->host_no, cmd->target, cmd->lun);
sink = 1;
do_abort(instance);
return;
@@ -2774,8 +2588,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
cmd->next_link->tag = cmd->tag;
cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8);
#if (NDEBUG & NDEBUG_LINKED)
- printk("scsi%d : target %d lun %d linked request done, calling scsi_done().\n",
- instance->host_no, cmd->target, cmd->lun);
+ printk("scsi%d : target %d lun %d linked request done, calling scsi_done().\n", instance->host_no, cmd->target, cmd->lun);
#endif
#ifdef NCR5380_STATS
collect_stats(hostdata, cmd);
@@ -2784,15 +2597,14 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
cmd = hostdata->connected;
break;
#endif /* def LINKED */
- case ABORT:
- case COMMAND_COMPLETE:
+ case ABORT:
+ case COMMAND_COMPLETE:
/* Accept message by clearing ACK */
- sink = 1;
+ sink = 1;
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
hostdata->connected = NULL;
#if (NDEBUG & NDEBUG_QUEUES)
- printk("scsi%d : command for target %d, lun %d completed\n",
- instance->host_no, cmd->target, cmd->lun);
+ printk("scsi%d : command for target %d, lun %d completed\n", instance->host_no, cmd->target, cmd->lun);
#endif
hostdata->busy[cmd->target] &= ~(1 << cmd->lun);
@@ -2818,12 +2630,10 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
cmd->result = (cmd->result & 0x00ffff) | (DID_ERROR << 16);
#ifdef AUTOSENSE
- if ((cmd->cmnd[0] != REQUEST_SENSE) &&
- (cmd->SCp.Status == CHECK_CONDITION)) {
+ if ((cmd->cmnd[0] != REQUEST_SENSE) && (cmd->SCp.Status == CHECK_CONDITION)) {
unsigned long flags;
#if (NDEBUG & NDEBUG_AUTOSENSE)
- printk("scsi%d : performing request sense\n",
- instance->host_no);
+ printk("scsi%d : performing request sense\n", instance->host_no);
#endif
cmd->cmnd[0] = REQUEST_SENSE;
cmd->cmnd[1] &= 0xe0;
@@ -2865,20 +2675,20 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
while ((NCR5380_read(STATUS_REG) & SR_BSY) && !hostdata->connected)
barrier();
return;
- case MESSAGE_REJECT:
+ case MESSAGE_REJECT:
/* Accept message by clearing ACK */
- NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
switch (hostdata->last_message) {
- case HEAD_OF_QUEUE_TAG:
- case ORDERED_QUEUE_TAG:
- case SIMPLE_QUEUE_TAG:
- cmd->device->tagged_queue = 0;
+ case HEAD_OF_QUEUE_TAG:
+ case ORDERED_QUEUE_TAG:
+ case SIMPLE_QUEUE_TAG:
+ cmd->device->tagged_queue = 0;
hostdata->busy[cmd->target] |= (1 << cmd->lun);
break;
- default:
- break;
+ default:
+ break;
}
- case DISCONNECT: {
+ case DISCONNECT:{
unsigned long flags;
/* Accept message by clearing ACK */
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
@@ -2892,9 +2702,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
hostdata->disconnected_queue = cmd;
restore_flags(flags);
#if (NDEBUG & NDEBUG_QUEUES)
- printk("scsi%d : command for target %d lun %d was moved from connected to"
- " the disconnected_queue\n", instance->host_no,
- cmd->target, cmd->lun);
+ printk("scsi%d : command for target %d lun %d was moved from connected to" " the disconnected_queue\n", instance->host_no, cmd->target, cmd->lun);
#endif
/*
* Restore phase bits to 0 so an interrupted selection,
@@ -2922,12 +2730,12 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
* disconnecting, and we have to break spec to remain
* compatible.
*/
- case SAVE_POINTERS:
- case RESTORE_POINTERS:
+ case SAVE_POINTERS:
+ case RESTORE_POINTERS:
/* Accept message by clearing ACK */
- NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
break;
- case EXTENDED_MESSAGE:
+ case EXTENDED_MESSAGE:
/*
* Extended messages are sent in the following format :
* Byte
@@ -2940,13 +2748,12 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
* Start the extended message buffer with the EXTENDED_MESSAGE
* byte, since print_msg() wants the whole thing.
*/
- extended_msg[0] = EXTENDED_MESSAGE;
+ extended_msg[0] = EXTENDED_MESSAGE;
/* Accept first byte by clearing ACK */
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
#if (NDEBUG & NDEBUG_EXTENDED)
- printk("scsi%d : receiving extended message\n",
- instance->host_no);
+ printk("scsi%d : receiving extended message\n", instance->host_no);
#endif
len = 2;
@@ -2955,13 +2762,10 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
NCR5380_transfer_pio(instance, &phase, &len, &data);
#if (NDEBUG & NDEBUG_EXTENDED)
- printk("scsi%d : length=%d, code=0x%02x\n",
- instance->host_no, (int) extended_msg[1],
- (int) extended_msg[2]);
+ printk("scsi%d : length=%d, code=0x%02x\n", instance->host_no, (int) extended_msg[1], (int) extended_msg[2]);
#endif
- if (!len && extended_msg[1] <=
- (sizeof(extended_msg) - 1)) {
+ if (!len && extended_msg[1] <= (sizeof(extended_msg) - 1)) {
/* Accept third byte by clearing ACK */
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
len = extended_msg[1] - 1;
@@ -2971,24 +2775,21 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
NCR5380_transfer_pio(instance, &phase, &len, &data);
#if (NDEBUG & NDEBUG_EXTENDED)
- printk("scsi%d : message received, residual %d\n",
- instance->host_no, len);
+ printk("scsi%d : message received, residual %d\n", instance->host_no, len);
#endif
switch (extended_msg[2]) {
- case EXTENDED_SDTR:
- case EXTENDED_WDTR:
- case EXTENDED_MODIFY_DATA_POINTER:
- case EXTENDED_EXTENDED_IDENTIFY:
- tmp = 0;
+ case EXTENDED_SDTR:
+ case EXTENDED_WDTR:
+ case EXTENDED_MODIFY_DATA_POINTER:
+ case EXTENDED_EXTENDED_IDENTIFY:
+ tmp = 0;
}
} else if (len) {
- printk("scsi%d: error receiving extended message\n",
- instance->host_no);
+ printk("scsi%d: error receiving extended message\n", instance->host_no);
tmp = 0;
} else {
- printk("scsi%d: extended message code %02x length %d is too long\n",
- instance->host_no, extended_msg[2], extended_msg[1]);
+ printk("scsi%d: extended message code %02x length %d is too long\n", instance->host_no, extended_msg[2], extended_msg[1]);
tmp = 0;
}
/* Fall through to reject message */
@@ -2997,26 +2798,23 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
* If we get something weird that we aren't expecting,
* reject it.
*/
- default:
- if (!tmp) {
+ default:
+ if (!tmp) {
printk("scsi%d: rejecting message ", instance->host_no);
print_msg(extended_msg);
printk("\n");
} else if (tmp != EXTENDED_MESSAGE)
- printk("scsi%d: rejecting unknown message %02x from target %d, lun %d\n",
- instance->host_no, tmp, cmd->target, cmd->lun);
+ printk("scsi%d: rejecting unknown message %02x from target %d, lun %d\n", instance->host_no, tmp, cmd->target, cmd->lun);
else
- printk("scsi%d: rejecting unknown extended message code %02x, length %d from target %d, lun %d\n",
- instance->host_no, extended_msg[1], extended_msg[0], cmd->target, cmd->lun);
+ printk("scsi%d: rejecting unknown extended message code %02x, length %d from target %d, lun %d\n", instance->host_no, extended_msg[1], extended_msg[0], cmd->target, cmd->lun);
msgout = MESSAGE_REJECT;
- NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE |
- ICR_ASSERT_ATN);
+ NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN);
break;
} /* switch (tmp) */
break;
- case PHASE_MSGOUT:
- len = 1;
+ case PHASE_MSGOUT:
+ len = 1;
data = &msgout;
hostdata->last_message = msgout;
NCR5380_transfer_pio(instance, &phase, &len, &data);
@@ -3033,54 +2831,47 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
}
msgout = NOP;
break;
- case PHASE_CMDOUT:
- len = cmd->cmd_len;
+ case PHASE_CMDOUT:
+ len = cmd->cmd_len;
data = cmd->cmnd;
/*
* XXX for performance reasons, on machines with a
* PSEUDO-DMA architecture we should probably
* use the dma transfer function.
*/
- NCR5380_transfer_pio(instance, &phase, &len,
- &data);
+ NCR5380_transfer_pio(instance, &phase, &len, &data);
#ifdef USLEEP
- if (!cmd->device->disconnect &&
- should_disconnect(cmd->cmnd[0]))
- {
+ if (!cmd->device->disconnect && should_disconnect(cmd->cmnd[0])) {
hostdata->time_expires = jiffies + USLEEP_SLEEP;
#if (NDEBUG & NDEBUG_USLEEP)
- printk("scsi%d : issued command, sleeping until %ul\n", instance->host_no,
- hostdata->time_expires);
+ printk("scsi%d : issued command, sleeping until %ul\n", instance->host_no, hostdata->time_expires);
#endif
NCR5380_set_timer(instance);
return;
}
#endif /* def USLEEP */
break;
- case PHASE_STATIN:
- len = 1;
+ case PHASE_STATIN:
+ len = 1;
data = &tmp;
NCR5380_transfer_pio(instance, &phase, &len, &data);
cmd->SCp.Status = tmp;
break;
- default:
- printk("scsi%d : unknown phase\n", instance->host_no);
+ default:
+ printk("scsi%d : unknown phase\n", instance->host_no);
#ifdef NDEBUG
NCR5380_print(instance);
#endif
} /* switch(phase) */
} /* if (tmp * SR_REQ) */
#ifdef USLEEP
- else
- {
+ else {
/* RvC: go to sleep if polling time expired
*/
- if (!cmd->device->disconnect && time_after_eq(jiffies, poll_time))
- {
+ if (!cmd->device->disconnect && time_after_eq(jiffies, poll_time)) {
hostdata->time_expires = jiffies + USLEEP_SLEEP;
#if (NDEBUG & NDEBUG_USLEEP)
- printk("scsi%d : poll timed out, sleeping until %ul\n", instance->host_no,
- hostdata->time_expires);
+ printk("scsi%d : poll timed out, sleeping until %ul\n", instance->host_no, hostdata->time_expires);
#endif
NCR5380_set_timer(instance);
return;
@@ -3159,8 +2950,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
if (!msg[0] & 0x80) {
- printk("scsi%d : expecting IDENTIFY message, got ",
- instance->host_no);
+ printk("scsi%d : expecting IDENTIFY message, got ", instance->host_no);
print_msg(msg);
abort = 1;
} else {
@@ -3184,8 +2974,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
*/
- for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue, prev = NULL;
- tmp; prev = tmp, tmp = (Scsi_Cmnd *) tmp->host_scribble)
+ for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue, prev = NULL; tmp; prev = tmp, tmp = (Scsi_Cmnd *) tmp->host_scribble)
if ((target_mask == (1 << tmp->target)) && (lun == tmp->lun)
#ifdef SCSI2
&& (tag == tmp->tag)
@@ -3203,11 +2992,9 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
}
if (!tmp) {
#ifdef SCSI2
- printk("scsi%d : warning : target bitmask %02x lun %d tag %d not in disconnect_queue.\n",
- instance->host_no, target_mask, lun, tag);
+ printk("scsi%d : warning : target bitmask %02x lun %d tag %d not in disconnect_queue.\n", instance->host_no, target_mask, lun, tag);
#else
- printk("scsi%d : warning : target bitmask %02x lun %d not in disconnect_queue.\n",
- instance->host_no, target_mask, lun);
+ printk("scsi%d : warning : target bitmask %02x lun %d not in disconnect_queue.\n", instance->host_no, target_mask, lun);
#endif
/*
* Since we have an established nexus that we can't do anything with,
@@ -3222,8 +3009,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
} else {
hostdata->connected = tmp;
#if (NDEBUG & NDEBUG_RESELECTION)
- printk("scsi%d : nexus established, target = %d, lun = %d, tag = %d\n",
- instance->host_no, tmp->target, tmp->lun, tmp->tag);
+ printk("scsi%d : nexus established, target = %d, lun = %d, tag = %d\n", instance->host_no, tmp->target, tmp->lun, tmp->tag);
#endif
}
}
@@ -3243,8 +3029,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
#ifdef REAL_DMA
static void NCR5380_dma_complete(NCR5380_instance * instance) {
NCR5380_local_declare();
- struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *
- instance->hostdata);
+ struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata * instance->hostdata);
int transferred;
NCR5380_setup(instance);
@@ -3320,8 +3105,7 @@ int NCR5380_abort(Scsi_Cmnd * cmd) {
#if (NDEBUG & NDEBUG_ABORT)
printk("scsi%d : abort called\n", instance->host_no);
- printk(" basr 0x%X, sr 0x%X\n",
- NCR5380_read(BUS_AND_STATUS_REG), NCR5380_read(STATUS_REG));
+ printk(" basr 0x%X, sr 0x%X\n", NCR5380_read(BUS_AND_STATUS_REG), NCR5380_read(STATUS_REG));
#endif
#if 0
@@ -3365,10 +3149,7 @@ int NCR5380_abort(Scsi_Cmnd * cmd) {
/* KLL */
printk("scsi%d : abort going into loop.\n", instance->host_no);
#endif
- for (prev = (Scsi_Cmnd **) & (hostdata->issue_queue),
- tmp = (Scsi_Cmnd *) hostdata->issue_queue;
- tmp; prev = (Scsi_Cmnd **) & (tmp->host_scribble), tmp =
- (Scsi_Cmnd *) tmp->host_scribble)
+ for (prev = (Scsi_Cmnd **) & (hostdata->issue_queue), tmp = (Scsi_Cmnd *) hostdata->issue_queue; tmp; prev = (Scsi_Cmnd **) & (tmp->host_scribble), tmp = (Scsi_Cmnd *) tmp->host_scribble)
if (cmd == tmp) {
REMOVE(5, *prev, tmp, tmp->host_scribble);
(*prev) = (Scsi_Cmnd *) tmp->host_scribble;
@@ -3376,8 +3157,7 @@ int NCR5380_abort(Scsi_Cmnd * cmd) {
tmp->result = DID_ABORT << 16;
restore_flags(flags);
#if (NDEBUG & NDEBUG_ABORT)
- printk("scsi%d : abort removed command from issue queue.\n",
- instance->host_no);
+ printk("scsi%d : abort removed command from issue queue.\n", instance->host_no);
#endif
tmp->done(tmp);
return SCSI_ABORT_SUCCESS;
@@ -3431,8 +3211,7 @@ int NCR5380_abort(Scsi_Cmnd * cmd) {
* it from the disconnected queue.
*/
- for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue; tmp;
- tmp = (Scsi_Cmnd *) tmp->host_scribble)
+ for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue; tmp; tmp = (Scsi_Cmnd *) tmp->host_scribble)
if (cmd == tmp) {
restore_flags(flags);
#if (NDEBUG & NDEBUG_ABORT)
@@ -3449,10 +3228,7 @@ int NCR5380_abort(Scsi_Cmnd * cmd) {
do_abort(instance);
cli();
- for (prev = (Scsi_Cmnd **) & (hostdata->disconnected_queue),
- tmp = (Scsi_Cmnd *) hostdata->disconnected_queue;
- tmp; prev = (Scsi_Cmnd **) & (tmp->host_scribble), tmp =
- (Scsi_Cmnd *) tmp->host_scribble)
+ for (prev = (Scsi_Cmnd **) & (hostdata->disconnected_queue), tmp = (Scsi_Cmnd *) hostdata->disconnected_queue; tmp; prev = (Scsi_Cmnd **) & (tmp->host_scribble), tmp = (Scsi_Cmnd *) tmp->host_scribble)
if (cmd == tmp) {
REMOVE(5, *prev, tmp, tmp->host_scribble);
*prev = (Scsi_Cmnd *) tmp->host_scribble;
@@ -3474,8 +3250,7 @@ int NCR5380_abort(Scsi_Cmnd * cmd) {
*/
restore_flags(flags);
- printk("scsi%d : warning : SCSI command probably completed successfully\n"
- " before abortion\n", instance->host_no);
+ printk("scsi%d : warning : SCSI command probably completed successfully\n" " before abortion\n", instance->host_no);
return SCSI_ABORT_NOT_RUNNING;
}
diff --git a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h
index af6d8122d..a577589aa 100644
--- a/drivers/scsi/NCR5380.h
+++ b/drivers/scsi/NCR5380.h
@@ -62,8 +62,8 @@
* bit in the INITIATOR COMMAND register is set.
*/
-#define OUTPUT_DATA_REG 0 /* wo DATA lines on SCSI bus */
-#define CURRENT_SCSI_DATA_REG 0 /* ro same */
+#define OUTPUT_DATA_REG 0 /* wo DATA lines on SCSI bus */
+#define CURRENT_SCSI_DATA_REG 0 /* ro same */
#define INITIATOR_COMMAND_REG 1 /* rw */
#define ICR_ASSERT_RST 0x80 /* rw Set to assert RST */
@@ -116,7 +116,7 @@
* Note : a set bit indicates an active signal, driven by us or another
* device.
*/
-#define SR_RST 0x80
+#define SR_RST 0x80
#define SR_BSY 0x40
#define SR_REQ 0x20
#define SR_MSG 0x10
@@ -159,17 +159,17 @@
/* Write any value to this register to start an ini mode DMA receive */
#define START_DMA_INITIATOR_RECEIVE_REG 7 /* wo */
-#define C400_CONTROL_STATUS_REG NCR53C400_register_offset-8 /* rw */
+#define C400_CONTROL_STATUS_REG NCR53C400_register_offset-8 /* rw */
-#define CSR_RESET 0x80 /* wo Resets 53c400 */
-#define CSR_53C80_REG 0x80 /* ro 5380 registers busy */
-#define CSR_TRANS_DIR 0x40 /* rw Data transfer direction */
-#define CSR_SCSI_BUFF_INTR 0x20 /* rw Enable int on transfer ready */
-#define CSR_53C80_INTR 0x10 /* rw Enable 53c80 interrupts */
-#define CSR_SHARED_INTR 0x08 /* rw Interrupt sharing */
-#define CSR_HOST_BUF_NOT_RDY 0x04 /* ro Is Host buffer ready */
-#define CSR_SCSI_BUF_RDY 0x02 /* ro SCSI buffer read */
-#define CSR_GATED_53C80_IRQ 0x01 /* ro Last block xferred */
+#define CSR_RESET 0x80 /* wo Resets 53c400 */
+#define CSR_53C80_REG 0x80 /* ro 5380 registers busy */
+#define CSR_TRANS_DIR 0x40 /* rw Data transfer direction */
+#define CSR_SCSI_BUFF_INTR 0x20 /* rw Enable int on transfer ready */
+#define CSR_53C80_INTR 0x10 /* rw Enable 53c80 interrupts */
+#define CSR_SHARED_INTR 0x08 /* rw Interrupt sharing */
+#define CSR_HOST_BUF_NOT_RDY 0x04 /* ro Is Host buffer ready */
+#define CSR_SCSI_BUF_RDY 0x02 /* ro SCSI buffer read */
+#define CSR_GATED_53C80_IRQ 0x01 /* ro Last block xferred */
#if 0
#define CSR_BASE CSR_SCSI_BUFF_INTR | CSR_53C80_INTR
@@ -178,13 +178,13 @@
#endif
/* Number of 128-byte blocks to be transferred */
-#define C400_BLOCK_COUNTER_REG NCR53C400_register_offset-7 /* rw */
+#define C400_BLOCK_COUNTER_REG NCR53C400_register_offset-7 /* rw */
/* Resume transfer after disconnect */
-#define C400_RESUME_TRANSFER_REG NCR53C400_register_offset-6 /* wo */
+#define C400_RESUME_TRANSFER_REG NCR53C400_register_offset-6 /* wo */
/* Access to host buffer stack */
-#define C400_HOST_BUFFER NCR53C400_register_offset-4 /* rw */
+#define C400_HOST_BUFFER NCR53C400_register_offset-4 /* rw */
/* Note : PHASE_* macros are based on the values of the STATUS register */
@@ -203,8 +203,8 @@
* the target register so we can get phase mismatch interrupts on DMA
* transfers.
*/
-
-#define PHASE_SR_TO_TCR(phase) ((phase) >> 2)
+
+#define PHASE_SR_TO_TCR(phase) ((phase) >> 2)
/*
* The internal should_disconnect() function returns these based on the
@@ -220,7 +220,7 @@
* These are "special" values for the tag parameter passed to NCR5380_select.
*/
-#define TAG_NEXT -1 /* Use next free tag */
+#define TAG_NEXT -1 /* Use next free tag */
#define TAG_NONE -2 /*
* Establish I_T_L nexus instead of I_T_L_Q
* even on SCSI-II devices.
@@ -235,7 +235,7 @@
#define DMA_NONE 255
#define IRQ_AUTO 254
#define DMA_AUTO 254
-#define PORT_AUTO 0xffff /* autoprobe io port for 53c400a */
+#define PORT_AUTO 0xffff /* autoprobe io port for 53c400a */
#define FLAG_HAS_LAST_BYTE_SENT 1 /* NCR53c81 or better */
#define FLAG_CHECK_LAST_BYTE_SENT 2 /* Only test once */
@@ -245,134 +245,134 @@
#ifndef ASM
struct NCR5380_hostdata {
- NCR5380_implementation_fields; /* implementation specific */
- unsigned char id_mask, id_higher_mask; /* 1 << id, all bits greater */
- unsigned char targets_present; /* targets we have connected
- to, so we can call a select
- failure a retryable condition */
- volatile unsigned char busy[8]; /* index = target, bit = lun */
+ NCR5380_implementation_fields; /* implementation specific */
+ unsigned char id_mask, id_higher_mask; /* 1 << id, all bits greater */
+ unsigned char targets_present; /* targets we have connected
+ to, so we can call a select
+ failure a retryable condition */
+ volatile unsigned char busy[8]; /* index = target, bit = lun */
#if defined(REAL_DMA) || defined(REAL_DMA_POLL)
- volatile int dma_len; /* requested length of DMA */
+ volatile int dma_len; /* requested length of DMA */
#endif
- volatile unsigned char last_message; /* last message OUT */
- volatile Scsi_Cmnd *connected; /* currently connected command */
- volatile Scsi_Cmnd *issue_queue; /* waiting to be issued */
- volatile Scsi_Cmnd *disconnected_queue; /* waiting for reconnect */
- volatile int restart_select; /* we have disconnected,
- used to restart
- NCR5380_select() */
- volatile unsigned aborted:1; /* flag, says aborted */
- int flags;
+ volatile unsigned char last_message; /* last message OUT */
+ volatile Scsi_Cmnd *connected; /* currently connected command */
+ volatile Scsi_Cmnd *issue_queue; /* waiting to be issued */
+ volatile Scsi_Cmnd *disconnected_queue; /* waiting for reconnect */
+ volatile int restart_select; /* we have disconnected,
+ used to restart
+ NCR5380_select() */
+ volatile unsigned aborted:1; /* flag, says aborted */
+ int flags;
#ifdef USLEEP
- unsigned long time_expires; /* in jiffies, set prior to sleeping */
- struct Scsi_Host *next_timer;
- int select_time; /* timer in select for target response */
- volatile Scsi_Cmnd *selecting;
+ unsigned long time_expires; /* in jiffies, set prior to sleeping */
+ struct Scsi_Host *next_timer;
+ int select_time; /* timer in select for target response */
+ volatile Scsi_Cmnd *selecting;
#endif
#ifdef NCR5380_STATS
- unsigned timebase; /* Base for time calcs */
- long time_read[8]; /* time to do reads */
- long time_write[8]; /* time to do writes */
- unsigned long bytes_read[8]; /* bytes read */
- unsigned long bytes_write[8]; /* bytes written */
- unsigned pendingr;
- unsigned pendingw;
+ unsigned timebase; /* Base for time calcs */
+ long time_read[8]; /* time to do reads */
+ long time_write[8]; /* time to do writes */
+ unsigned long bytes_read[8]; /* bytes read */
+ unsigned long bytes_write[8]; /* bytes written */
+ unsigned pendingr;
+ unsigned pendingw;
#endif
};
#ifdef __KERNEL__
-static struct Scsi_Host *first_instance; /* linked list of 5380's */
+static struct Scsi_Host *first_instance; /* linked list of 5380's */
#if defined(AUTOPROBE_IRQ)
-static int NCR5380_probe_irq (struct Scsi_Host *instance, int possible);
+static int NCR5380_probe_irq(struct Scsi_Host *instance, int possible);
#endif
-static void NCR5380_init (struct Scsi_Host *instance, int flags);
-static void NCR5380_information_transfer (struct Scsi_Host *instance);
+static void NCR5380_init(struct Scsi_Host *instance, int flags);
+static void NCR5380_information_transfer(struct Scsi_Host *instance);
#ifndef DONT_USE_INTR
-static void NCR5380_intr (int irq, void *dev_id, struct pt_regs * regs);
-static void do_NCR5380_intr (int irq, void *dev_id, struct pt_regs * regs);
+static void NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs);
+static void do_NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs);
#endif
-static void NCR5380_main (void);
-static void NCR5380_print_options (struct Scsi_Host *instance);
-static void NCR5380_print_phase (struct Scsi_Host *instance);
-static void NCR5380_print (struct Scsi_Host *instance);
+static void NCR5380_main(void);
+static void NCR5380_print_options(struct Scsi_Host *instance);
+static void NCR5380_print_phase(struct Scsi_Host *instance);
+static void NCR5380_print(struct Scsi_Host *instance);
#ifndef NCR5380_abort
static
#endif
-int NCR5380_abort (Scsi_Cmnd *cmd);
+int NCR5380_abort(Scsi_Cmnd * cmd);
#ifndef NCR5380_reset
static
#endif
-int NCR5380_reset (Scsi_Cmnd *cmd, unsigned int reset_flags);
+int NCR5380_reset(Scsi_Cmnd * cmd, unsigned int reset_flags);
#ifndef NCR5380_queue_command
-static
+static
#endif
-int NCR5380_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *));
+int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *));
-static void NCR5380_reselect (struct Scsi_Host *instance);
-static int NCR5380_select (struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag);
+static void NCR5380_reselect(struct Scsi_Host *instance);
+static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag);
#if defined(PSEUDO_DMA) || defined(REAL_DMA) || defined(REAL_DMA_POLL)
-static int NCR5380_transfer_dma (struct Scsi_Host *instance,
- unsigned char *phase, int *count, unsigned char **data);
+static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data);
#endif
-static int NCR5380_transfer_pio (struct Scsi_Host *instance,
- unsigned char *phase, int *count, unsigned char **data);
+static int NCR5380_transfer_pio(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data);
#if (defined(REAL_DMA) || defined(REAL_DMA_POLL))
#if defined(i386) || defined(__alpha__)
-static __inline__ int NCR5380_pc_dma_setup (struct Scsi_Host *instance,
- unsigned char *ptr, unsigned int count, unsigned char mode) {
- unsigned limit;
- unsigned long bus_addr = virt_to_bus(ptr);
-
- if (instance->dma_channel <=3) {
- if (count > 65536)
- count = 65536;
- limit = 65536 - (bus_addr & 0xFFFF);
- } else {
- if (count > 65536 * 2)
- count = 65536 * 2;
- limit = 65536* 2 - (bus_addr & 0x1FFFF);
- }
-
- if (count > limit) count = limit;
-
- if ((count & 1) || (bus_addr & 1))
- panic ("scsi%d : attempted unaligned DMA transfer\n", instance->host_no);
- cli();
- disable_dma(instance->dma_channel);
- clear_dma_ff(instance->dma_channel);
- set_dma_addr(instance->dma_channel, bus_addr);
- set_dma_count(instance->dma_channel, count);
- set_dma_mode(instance->dma_channel, mode);
- enable_dma(instance->dma_channel);
- sti();
- return count;
+static __inline__ int NCR5380_pc_dma_setup(struct Scsi_Host *instance, unsigned char *ptr, unsigned int count, unsigned char mode)
+{
+ unsigned limit;
+ unsigned long bus_addr = virt_to_bus(ptr);
+
+ if (instance->dma_channel <= 3) {
+ if (count > 65536)
+ count = 65536;
+ limit = 65536 - (bus_addr & 0xFFFF);
+ } else {
+ if (count > 65536 * 2)
+ count = 65536 * 2;
+ limit = 65536 * 2 - (bus_addr & 0x1FFFF);
+ }
+
+ if (count > limit)
+ count = limit;
+
+ if ((count & 1) || (bus_addr & 1))
+ panic("scsi%d : attempted unaligned DMA transfer\n", instance->host_no);
+ cli();
+ disable_dma(instance->dma_channel);
+ clear_dma_ff(instance->dma_channel);
+ set_dma_addr(instance->dma_channel, bus_addr);
+ set_dma_count(instance->dma_channel, count);
+ set_dma_mode(instance->dma_channel, mode);
+ enable_dma(instance->dma_channel);
+ sti();
+ return count;
}
-static __inline__ int NCR5380_pc_dma_write_setup (struct Scsi_Host *instance,
- unsigned char *src, unsigned int count) {
- return NCR5380_pc_dma_setup (instance, src, count, DMA_MODE_WRITE);
+static __inline__ int NCR5380_pc_dma_write_setup(struct Scsi_Host *instance, unsigned char *src, unsigned int count)
+{
+ return NCR5380_pc_dma_setup(instance, src, count, DMA_MODE_WRITE);
}
-static __inline__ int NCR5380_pc_dma_read_setup (struct Scsi_Host *instance,
- unsigned char *src, unsigned int count) {
- return NCR5380_pc_dma_setup (instance, src, count, DMA_MODE_READ);
+static __inline__ int NCR5380_pc_dma_read_setup(struct Scsi_Host *instance, unsigned char *src, unsigned int count)
+{
+ return NCR5380_pc_dma_setup(instance, src, count, DMA_MODE_READ);
}
-static __inline__ int NCR5380_pc_dma_residual (struct Scsi_Host *instance) {
- register int tmp;
- cli();
- clear_dma_ff(instance->dma_channel);
- tmp = get_dma_residue(instance->dma_channel);
- sti();
- return tmp;
+static __inline__ int NCR5380_pc_dma_residual(struct Scsi_Host *instance)
+{
+ register int tmp;
+ cli();
+ clear_dma_ff(instance->dma_channel);
+ tmp = get_dma_residue(instance->dma_channel);
+ sti();
+ return tmp;
}
-#endif /* defined(i386) || defined(__alpha__) */
-#endif /* defined(REAL_DMA) */
-#endif /* __KERNEL__ */
-#endif /* ndef ASM */
-#endif /* NCR5380_H */
+#endif /* defined(i386) || defined(__alpha__) */
+#endif /* defined(REAL_DMA) */
+#endif /* __KERNEL__ */
+#endif /* ndef ASM */
+#endif /* NCR5380_H */
diff --git a/drivers/scsi/README.ncr53c8xx b/drivers/scsi/README.ncr53c8xx
index 206233d1a..514c2be6b 100644
--- a/drivers/scsi/README.ncr53c8xx
+++ b/drivers/scsi/README.ncr53c8xx
@@ -1,6 +1,6 @@
The Linux NCR53C8XX/SYM53C8XX drivers README file
-Written by Gerard Roudier <groudier@club-internet.fr>
+Written by Gerard Roudier <groudier@free.fr>
21 Rue Carnot
95170 DEUIL LA BARRE - FRANCE
@@ -87,7 +87,7 @@ Written by Gerard Roudier <groudier@club-internet.fr>
The initial Linux ncr53c8xx driver has been a port of the ncr driver from
FreeBSD that has been achieved in November 1995 by:
- Gerard Roudier <groudier@club-internet.fr>
+ Gerard Roudier <groudier@free.fr>
The original driver has been written for 386bsd and FreeBSD by:
Wolfgang Stanglmeier <wolf@cologne.de>
@@ -1287,7 +1287,7 @@ appropriate mailing lists or news-groups. Send me a copy in order to
be sure I will receive it. Obviously, a bug in the driver code is
possible.
- My email address: Gerard Roudier <groudier@club-internet.fr>
+ My email address: Gerard Roudier <groudier@free.fr>
Allowing disconnections is important if you use several devices on
your SCSI bus but often causes problems with buggy devices.
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index 1d15edfbb..1fbb5199d 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -77,7 +77,7 @@
* IRQ line if overridden on the command line.
*
*/
-
+
/*
* $Log: generic_NCR5380.c,v $
*/
@@ -124,24 +124,25 @@
#include <linux/isapnp.h>
#define NCR_NOT_SET 0
-static int ncr_irq=NCR_NOT_SET;
-static int ncr_dma=NCR_NOT_SET;
-static int ncr_addr=NCR_NOT_SET;
-static int ncr_5380=NCR_NOT_SET;
-static int ncr_53c400=NCR_NOT_SET;
-static int ncr_53c400a=NCR_NOT_SET;
-static int dtc_3181e=NCR_NOT_SET;
+static int ncr_irq = NCR_NOT_SET;
+static int ncr_dma = NCR_NOT_SET;
+static int ncr_addr = NCR_NOT_SET;
+static int ncr_5380 = NCR_NOT_SET;
+static int ncr_53c400 = NCR_NOT_SET;
+static int ncr_53c400a = NCR_NOT_SET;
+static int dtc_3181e = NCR_NOT_SET;
static struct override {
NCR5380_implementation_fields;
- int irq;
- int dma;
- int board; /* Use NCR53c400, Ricoh, etc. extensions ? */
-} overrides
-#ifdef GENERIC_NCR5380_OVERRIDE
- [] __initdata = GENERIC_NCR5380_OVERRIDE;
+ int irq;
+ int dma;
+ int board; /* Use NCR53c400, Ricoh, etc. extensions ? */
+} overrides
+#ifdef GENERIC_NCR5380_OVERRIDE
+[] __initdata = GENERIC_NCR5380_OVERRIDE;
#else
- [1] __initdata = {{0,},};
+[1] __initdata = { {
+0,},};
#endif
#define NO_OVERRIDES (sizeof(overrides) / sizeof(struct override))
@@ -157,45 +158,46 @@ static struct override {
*
*/
-static void __init internal_setup(int board, char *str, int *ints){
- static int commandline_current = 0;
- switch (board) {
- case BOARD_NCR5380:
- if (ints[0] != 2 && ints[0] != 3) {
- printk("generic_NCR5380_setup : usage ncr5380=" STRVAL(NCR5380_map_name) ",irq,dma\n");
- return;
- }
- break;
- case BOARD_NCR53C400:
- if (ints[0] != 2) {
- printk("generic_NCR53C400_setup : usage ncr53c400=" STRVAL(NCR5380_map_name) ",irq\n");
- return;
- }
- break;
- case BOARD_NCR53C400A:
- if (ints[0] != 2) {
- printk("generic_NCR53C400A_setup : usage ncr53c400a=" STRVAL(NCR5380_map_name) ",irq\n");
- return;
+static void __init internal_setup(int board, char *str, int *ints)
+{
+ static int commandline_current = 0;
+ switch (board) {
+ case BOARD_NCR5380:
+ if (ints[0] != 2 && ints[0] != 3) {
+ printk("generic_NCR5380_setup : usage ncr5380=" STRVAL(NCR5380_map_name) ",irq,dma\n");
+ return;
+ }
+ break;
+ case BOARD_NCR53C400:
+ if (ints[0] != 2) {
+ printk("generic_NCR53C400_setup : usage ncr53c400=" STRVAL(NCR5380_map_name) ",irq\n");
+ return;
+ }
+ break;
+ case BOARD_NCR53C400A:
+ if (ints[0] != 2) {
+ printk("generic_NCR53C400A_setup : usage ncr53c400a=" STRVAL(NCR5380_map_name) ",irq\n");
+ return;
+ }
+ break;
+ case BOARD_DTC3181E:
+ if (ints[0] != 2) {
+ printk("generic_DTC3181E_setup : usage dtc3181e=" STRVAL(NCR5380_map_name) ",irq\n");
+ return;
+ }
+ break;
}
- break;
- case BOARD_DTC3181E:
- if (ints[0] != 2) {
- printk("generic_DTC3181E_setup : usage dtc3181e=" STRVAL(NCR5380_map_name) ",irq\n");
- return;
+
+ if (commandline_current < NO_OVERRIDES) {
+ overrides[commandline_current].NCR5380_map_name = (NCR5380_map_type) ints[1];
+ overrides[commandline_current].irq = ints[2];
+ if (ints[0] == 3)
+ overrides[commandline_current].dma = ints[3];
+ else
+ overrides[commandline_current].dma = DMA_NONE;
+ overrides[commandline_current].board = board;
+ ++commandline_current;
}
- break;
- }
-
- if (commandline_current < NO_OVERRIDES) {
- overrides[commandline_current].NCR5380_map_name = (NCR5380_map_type)ints[1];
- overrides[commandline_current].irq = ints[2];
- if (ints[0] == 3)
- overrides[commandline_current].dma = ints[3];
- else
- overrides[commandline_current].dma = DMA_NONE;
- overrides[commandline_current].board = board;
- ++commandline_current;
- }
}
/*
@@ -207,8 +209,9 @@ static void __init internal_setup(int board, char *str, int *ints){
* equal to the number of ints.
*/
-void __init generic_NCR5380_setup (char *str, int *ints){
- internal_setup (BOARD_NCR5380, str, ints);
+void __init generic_NCR5380_setup(char *str, int *ints)
+{
+ internal_setup(BOARD_NCR5380, str, ints);
}
/*
@@ -220,8 +223,9 @@ void __init generic_NCR5380_setup (char *str, int *ints){
* equal to the number of ints.
*/
-void __init generic_NCR53C400_setup (char *str, int *ints){
- internal_setup (BOARD_NCR53C400, str, ints);
+void __init generic_NCR53C400_setup(char *str, int *ints)
+{
+ internal_setup(BOARD_NCR53C400, str, ints);
}
/*
@@ -233,8 +237,9 @@ void __init generic_NCR53C400_setup (char *str, int *ints){
* equal to the number of ints.
*/
-void generic_NCR53C400A_setup (char *str, int *ints) {
- internal_setup (BOARD_NCR53C400A, str, ints);
+void generic_NCR53C400A_setup(char *str, int *ints)
+{
+ internal_setup(BOARD_NCR53C400A, str, ints);
}
/*
@@ -246,8 +251,9 @@ void generic_NCR53C400A_setup (char *str, int *ints) {
* equal to the number of ints.
*/
-void generic_DTC3181E_setup (char *str, int *ints) {
- internal_setup (BOARD_DTC3181E, str, ints);
+void generic_DTC3181E_setup(char *str, int *ints)
+{
+ internal_setup(BOARD_DTC3181E, str, ints);
}
/*
@@ -262,202 +268,197 @@ void generic_DTC3181E_setup (char *str, int *ints) {
*
*/
-int __init generic_NCR5380_detect(Scsi_Host_Template * tpnt){
- static int current_override = 0;
- int count, i;
- u_int *ports;
- u_int ncr_53c400a_ports[] = {0x280, 0x290, 0x300, 0x310, 0x330,
- 0x340, 0x348, 0x350, 0};
- u_int dtc_3181e_ports[] = {0x220, 0x240, 0x280, 0x2a0, 0x2c0,
- 0x300, 0x320, 0x340, 0};
- int flags = 0;
- struct Scsi_Host *instance;
-
- if (ncr_irq != NCR_NOT_SET)
- overrides[0].irq=ncr_irq;
- if (ncr_dma != NCR_NOT_SET)
- overrides[0].dma=ncr_dma;
- if (ncr_addr != NCR_NOT_SET)
- overrides[0].NCR5380_map_name=(NCR5380_map_type)ncr_addr;
- if (ncr_5380 != NCR_NOT_SET)
- overrides[0].board=BOARD_NCR5380;
- else if (ncr_53c400 != NCR_NOT_SET)
- overrides[0].board=BOARD_NCR53C400;
- else if (ncr_53c400a != NCR_NOT_SET)
- overrides[0].board=BOARD_NCR53C400A;
- else if (dtc_3181e != NCR_NOT_SET)
- overrides[0].board=BOARD_DTC3181E;
-
- if (!current_override && isapnp_present()) {
- struct pci_dev *dev = NULL;
- count = 0;
- while ((dev = isapnp_find_dev(NULL, ISAPNP_VENDOR('D','T','C'), ISAPNP_FUNCTION(0x436e), dev))) {
- if (count >= NO_OVERRIDES)
- break;
- if (!dev->active && dev->prepare(dev) < 0) {
- printk(KERN_ERR "dtc436e probe: prepare failed\n");
- continue;
- }
- if (!(dev->resource[0].flags & IORESOURCE_IO))
- continue;
- if (!dev->active && dev->activate(dev) < 0) {
- printk(KERN_ERR "dtc436e probe: activate failed\n");
- continue;
- }
- if (dev->irq_resource[0].flags & IORESOURCE_IRQ)
- overrides[count].irq=dev->irq_resource[0].start;
- else
- overrides[count].irq=IRQ_NONE;
- if (dev->dma_resource[0].flags & IORESOURCE_DMA)
- overrides[count].dma=dev->dma_resource[0].start;
- else
- overrides[count].dma=DMA_NONE;
- overrides[count].NCR5380_map_name=(NCR5380_map_type)dev->resource[0].start;
- overrides[count].board=BOARD_DTC3181E;
- count++;
- }
- }
-
- tpnt->proc_name = "g_NCR5380";
-
- for (count = 0; current_override < NO_OVERRIDES; ++current_override) {
- if (!(overrides[current_override].NCR5380_map_name))
- continue;
-
- ports = 0;
- switch (overrides[current_override].board) {
- case BOARD_NCR5380:
- flags = FLAG_NO_PSEUDO_DMA;
- break;
- case BOARD_NCR53C400:
- flags = FLAG_NCR53C400;
- break;
- case BOARD_NCR53C400A:
- flags = FLAG_NO_PSEUDO_DMA;
- ports = ncr_53c400a_ports;
- break;
- case BOARD_DTC3181E:
- flags = FLAG_NO_PSEUDO_DMA | FLAG_DTC3181E;
- ports = dtc_3181e_ports;
- break;
+int __init generic_NCR5380_detect(Scsi_Host_Template * tpnt)
+{
+ static int current_override = 0;
+ int count, i;
+ u_int *ports;
+ u_int ncr_53c400a_ports[] = { 0x280, 0x290, 0x300, 0x310, 0x330,
+ 0x340, 0x348, 0x350, 0
+ };
+ u_int dtc_3181e_ports[] = { 0x220, 0x240, 0x280, 0x2a0, 0x2c0,
+ 0x300, 0x320, 0x340, 0
+ };
+ int flags = 0;
+ struct Scsi_Host *instance;
+
+ if (ncr_irq != NCR_NOT_SET)
+ overrides[0].irq = ncr_irq;
+ if (ncr_dma != NCR_NOT_SET)
+ overrides[0].dma = ncr_dma;
+ if (ncr_addr != NCR_NOT_SET)
+ overrides[0].NCR5380_map_name = (NCR5380_map_type) ncr_addr;
+ if (ncr_5380 != NCR_NOT_SET)
+ overrides[0].board = BOARD_NCR5380;
+ else if (ncr_53c400 != NCR_NOT_SET)
+ overrides[0].board = BOARD_NCR53C400;
+ else if (ncr_53c400a != NCR_NOT_SET)
+ overrides[0].board = BOARD_NCR53C400A;
+ else if (dtc_3181e != NCR_NOT_SET)
+ overrides[0].board = BOARD_DTC3181E;
+
+ if (!current_override && isapnp_present()) {
+ struct pci_dev *dev = NULL;
+ count = 0;
+ while ((dev = isapnp_find_dev(NULL, ISAPNP_VENDOR('D', 'T', 'C'), ISAPNP_FUNCTION(0x436e), dev))) {
+ if (count >= NO_OVERRIDES)
+ break;
+ if (!dev->active && dev->prepare(dev) < 0) {
+ printk(KERN_ERR "dtc436e probe: prepare failed\n");
+ continue;
+ }
+ if (!(dev->resource[0].flags & IORESOURCE_IO))
+ continue;
+ if (!dev->active && dev->activate(dev) < 0) {
+ printk(KERN_ERR "dtc436e probe: activate failed\n");
+ continue;
+ }
+ if (dev->irq_resource[0].flags & IORESOURCE_IRQ)
+ overrides[count].irq = dev->irq_resource[0].start;
+ else
+ overrides[count].irq = IRQ_NONE;
+ if (dev->dma_resource[0].flags & IORESOURCE_DMA)
+ overrides[count].dma = dev->dma_resource[0].start;
+ else
+ overrides[count].dma = DMA_NONE;
+ overrides[count].NCR5380_map_name = (NCR5380_map_type) dev->resource[0].start;
+ overrides[count].board = BOARD_DTC3181E;
+ count++;
+ }
}
+ tpnt->proc_name = "g_NCR5380";
+
+ for (count = 0; current_override < NO_OVERRIDES; ++current_override) {
+ if (!(overrides[current_override].NCR5380_map_name))
+ continue;
+
+ ports = 0;
+ switch (overrides[current_override].board) {
+ case BOARD_NCR5380:
+ flags = FLAG_NO_PSEUDO_DMA;
+ break;
+ case BOARD_NCR53C400:
+ flags = FLAG_NCR53C400;
+ break;
+ case BOARD_NCR53C400A:
+ flags = FLAG_NO_PSEUDO_DMA;
+ ports = ncr_53c400a_ports;
+ break;
+ case BOARD_DTC3181E:
+ flags = FLAG_NO_PSEUDO_DMA | FLAG_DTC3181E;
+ ports = dtc_3181e_ports;
+ break;
+ }
+
#ifdef CONFIG_SCSI_G_NCR5380_PORT
- if (ports) {
- /* wakeup sequence for the NCR53C400A and DTC3181E*/
-
- /* Disable the adapter and look for a free io port */
- outb(0x59, 0x779);
- outb(0xb9, 0x379);
- outb(0xc5, 0x379);
- outb(0xae, 0x379);
- outb(0xa6, 0x379);
- outb(0x00, 0x379);
-
- if (overrides[current_override].NCR5380_map_name != PORT_AUTO)
- for(i=0; ports[i]; i++) {
- if (overrides[current_override].NCR5380_map_name == ports[i])
- break;
- }
- else
- for(i=0; ports[i]; i++) {
- if ((!check_region(ports[i], 16)) && (inb(ports[i]) == 0xff))
- break;
+ if (ports) {
+ /* wakeup sequence for the NCR53C400A and DTC3181E */
+
+ /* Disable the adapter and look for a free io port */
+ outb(0x59, 0x779);
+ outb(0xb9, 0x379);
+ outb(0xc5, 0x379);
+ outb(0xae, 0x379);
+ outb(0xa6, 0x379);
+ outb(0x00, 0x379);
+
+ if (overrides[current_override].NCR5380_map_name != PORT_AUTO)
+ for (i = 0; ports[i]; i++) {
+ if (overrides[current_override].NCR5380_map_name == ports[i])
+ break;
+ } else
+ for (i = 0; ports[i]; i++) {
+ if ((!check_region(ports[i], 16)) && (inb(ports[i]) == 0xff))
+ break;
+ }
+ if (ports[i]) {
+ outb(0x59, 0x779);
+ outb(0xb9, 0x379);
+ outb(0xc5, 0x379);
+ outb(0xae, 0x379);
+ outb(0xa6, 0x379);
+ outb(0x80 | i, 0x379); /* set io port to be used */
+ outb(0xc0, ports[i] + 9);
+ if (inb(ports[i] + 9) != 0x80)
+ continue;
+ else
+ overrides[current_override].NCR5380_map_name = ports[i];
+ } else
+ continue;
}
- if (ports[i]) {
- outb(0x59, 0x779);
- outb(0xb9, 0x379);
- outb(0xc5, 0x379);
- outb(0xae, 0x379);
- outb(0xa6, 0x379);
- outb(0x80 | i, 0x379); /* set io port to be used */
- outb(0xc0, ports[i] + 9);
- if (inb(ports[i] + 9) != 0x80)
- continue;
- else
- overrides[current_override].NCR5380_map_name=ports[i];
- } else
- continue;
- }
- request_region(overrides[current_override].NCR5380_map_name,
- NCR5380_region_size, "ncr5380");
+ request_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size, "ncr5380");
#else
- if(check_mem_region(overrides[current_override].NCR5380_map_name,
- NCR5380_region_size))
- continue;
- request_mem_region(overrides[current_override].NCR5380_map_name,
- NCR5380_region_size, "ncr5380");
-#endif
- instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
- if(instance == NULL)
- {
+ if (check_mem_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size))
+ continue;
+ request_mem_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size, "ncr5380");
+#endif
+ instance = scsi_register(tpnt, sizeof(struct NCR5380_hostdata));
+ if (instance == NULL) {
#ifdef CONFIG_SCSI_G_NCR5380_PORT
- release_region(overrides[current_override].NCR5380_map_name,
- NCR5380_region_size);
+ release_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size);
#else
- release_mem_region(overrides[current_override].NCR5380_map_name,
- NCR5380_region_size);
+ release_mem_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size);
#endif
- continue;
- }
-
- instance->NCR5380_instance_name = overrides[current_override].NCR5380_map_name;
-
- NCR5380_init(instance, flags);
-
- if (overrides[current_override].irq != IRQ_AUTO)
- instance->irq = overrides[current_override].irq;
- else
- instance->irq = NCR5380_probe_irq(instance, 0xffff);
-
- if (instance->irq != IRQ_NONE)
- if (request_irq(instance->irq, do_generic_NCR5380_intr, SA_INTERRUPT, "NCR5380", NULL)) {
- printk("scsi%d : IRQ%d not free, interrupts disabled\n",
- instance->host_no, instance->irq);
- instance->irq = IRQ_NONE;
- }
-
- if (instance->irq == IRQ_NONE) {
- printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no);
- printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no);
- }
+ continue;
+ }
+
+ instance->NCR5380_instance_name = overrides[current_override].NCR5380_map_name;
+
+ NCR5380_init(instance, flags);
+
+ if (overrides[current_override].irq != IRQ_AUTO)
+ instance->irq = overrides[current_override].irq;
+ else
+ instance->irq = NCR5380_probe_irq(instance, 0xffff);
+
+ if (instance->irq != IRQ_NONE)
+ if (request_irq(instance->irq, do_generic_NCR5380_intr, SA_INTERRUPT, "NCR5380", NULL)) {
+ printk("scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq);
+ instance->irq = IRQ_NONE;
+ }
- printk("scsi%d : at " STRVAL(NCR5380_map_name) " 0x%x", instance->host_no, (unsigned int)instance->NCR5380_instance_name);
- if (instance->irq == IRQ_NONE)
- printk (" interrupts disabled");
- else
- printk (" irq %d", instance->irq);
- printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d",
- CAN_QUEUE, CMD_PER_LUN, GENERIC_NCR5380_PUBLIC_RELEASE);
- NCR5380_print_options(instance);
- printk("\n");
-
- ++current_override;
- ++count;
- }
- return count;
+ if (instance->irq == IRQ_NONE) {
+ printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no);
+ printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no);
+ }
+
+ printk("scsi%d : at " STRVAL(NCR5380_map_name) " 0x%x", instance->host_no, (unsigned int) instance->NCR5380_instance_name);
+ if (instance->irq == IRQ_NONE)
+ printk(" interrupts disabled");
+ else
+ printk(" irq %d", instance->irq);
+ printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d", CAN_QUEUE, CMD_PER_LUN, GENERIC_NCR5380_PUBLIC_RELEASE);
+ NCR5380_print_options(instance);
+ printk("\n");
+
+ ++current_override;
+ ++count;
+ }
+ return count;
}
-const char * generic_NCR5380_info (struct Scsi_Host* host) {
- static const char string[]="Generic NCR5380/53C400 Driver";
- return string;
+const char *generic_NCR5380_info(struct Scsi_Host *host)
+{
+ static const char string[] = "Generic NCR5380/53C400 Driver";
+ return string;
}
-int generic_NCR5380_release_resources(struct Scsi_Host * instance)
+int generic_NCR5380_release_resources(struct Scsi_Host *instance)
{
- NCR5380_local_declare();
+ NCR5380_local_declare();
- NCR5380_setup(instance);
+ NCR5380_setup(instance);
#ifdef CONFIG_SCSI_G_NCR5380_PORT
- release_region(instance->NCR5380_instance_name, NCR5380_region_size);
+ release_region(instance->NCR5380_instance_name, NCR5380_region_size);
#else
- release_mem_region(instance->NCR5380_instance_name, NCR5380_region_size);
-#endif
+ release_mem_region(instance->NCR5380_instance_name, NCR5380_region_size);
+#endif
- if (instance->irq != IRQ_NONE)
- free_irq(instance->irq, NULL);
+ if (instance->irq != IRQ_NONE)
+ free_irq(instance->irq, NULL);
return 0;
}
@@ -485,112 +486,109 @@ int generic_NCR5380_release_resources(struct Scsi_Host * instance)
int generic_NCR5380_biosparam(Disk * disk, kdev_t dev, int *ip)
{
- int size = disk->capacity;
- ip[0] = 64;
- ip[1] = 32;
- ip[2] = size >> 11;
- return 0;
+ int size = disk->capacity;
+ ip[0] = 64;
+ ip[1] = 32;
+ ip[2] = size >> 11;
+ return 0;
}
#endif
#if NCR53C400_PSEUDO_DMA
-static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst, int len)
+static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst, int len)
{
- int blocks = len / 128;
- int start = 0;
- int bl;
+ int blocks = len / 128;
+ int start = 0;
+ int bl;
#ifdef CONFIG_SCSI_G_NCR5380_PORT
- int i;
-#endif
+ int i;
+#endif
- NCR5380_local_declare();
+ NCR5380_local_declare();
- NCR5380_setup(instance);
+ NCR5380_setup(instance);
#if (NDEBUG & NDEBUG_C400_PREAD)
- printk("53C400r: About to read %d blocks for %d bytes\n", blocks, len);
+ printk("53C400r: About to read %d blocks for %d bytes\n", blocks, len);
#endif
- NCR5380_write(C400_CONTROL_STATUS_REG, CSR_BASE | CSR_TRANS_DIR);
- NCR5380_write(C400_BLOCK_COUNTER_REG, blocks);
- while (1) {
-
+ NCR5380_write(C400_CONTROL_STATUS_REG, CSR_BASE | CSR_TRANS_DIR);
+ NCR5380_write(C400_BLOCK_COUNTER_REG, blocks);
+ while (1) {
+
#if (NDEBUG & NDEBUG_C400_PREAD)
- printk("53C400r: %d blocks left\n", blocks);
+ printk("53C400r: %d blocks left\n", blocks);
#endif
- if ((bl=NCR5380_read(C400_BLOCK_COUNTER_REG)) == 0) {
+ if ((bl = NCR5380_read(C400_BLOCK_COUNTER_REG)) == 0) {
#if (NDEBUG & NDEBUG_C400_PREAD)
- if (blocks)
- printk("53C400r: blocks still == %d\n", blocks);
- else
- printk("53C400r: Exiting loop\n");
+ if (blocks)
+ printk("53C400r: blocks still == %d\n", blocks);
+ else
+ printk("53C400r: Exiting loop\n");
#endif
- break;
- }
-
+ break;
+ }
#if 1
- if (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_GATED_53C80_IRQ) {
- printk("53C400r: Got 53C80_IRQ start=%d, blocks=%d\n", start, blocks);
- return -1;
- }
+ if (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_GATED_53C80_IRQ) {
+ printk("53C400r: Got 53C80_IRQ start=%d, blocks=%d\n", start, blocks);
+ return -1;
+ }
#endif
#if (NDEBUG & NDEBUG_C400_PREAD)
- printk("53C400r: Waiting for buffer, bl=%d\n", bl);
+ printk("53C400r: Waiting for buffer, bl=%d\n", bl);
#endif
- while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY)
- ;
+ while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY);
#if (NDEBUG & NDEBUG_C400_PREAD)
- printk("53C400r: Transferring 128 bytes\n");
+ printk("53C400r: Transferring 128 bytes\n");
#endif
#ifdef CONFIG_SCSI_G_NCR5380_PORT
- for (i=0; i<128; i++)
- dst[start+i] = NCR5380_read(C400_HOST_BUFFER);
+ for (i = 0; i < 128; i++)
+ dst[start + i] = NCR5380_read(C400_HOST_BUFFER);
#else
- /* implies CONFIG_SCSI_G_NCR5380_MEM */
- isa_memcpy_fromio(dst+start,NCR53C400_host_buffer+NCR5380_map_name,128);
+ /* implies CONFIG_SCSI_G_NCR5380_MEM */
+ isa_memcpy_fromio(dst + start, NCR53C400_host_buffer + NCR5380_map_name, 128);
#endif
- start+=128;
- blocks--;
- }
+ start += 128;
+ blocks--;
+ }
- if (blocks) {
+ if (blocks) {
#if (NDEBUG & NDEBUG_C400_PREAD)
- printk("53C400r: EXTRA: Waiting for buffer\n");
+ printk("53C400r: EXTRA: Waiting for buffer\n");
#endif
- while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY)
- ;
+ while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY);
#if (NDEBUG & NDEBUG_C400_PREAD)
- printk("53C400r: Transferring EXTRA 128 bytes\n");
+ printk("53C400r: Transferring EXTRA 128 bytes\n");
#endif
#ifdef CONFIG_SCSI_G_NCR5380_PORT
- for (i=0; i<128; i++)
- dst[start+i] = NCR5380_read(C400_HOST_BUFFER);
+ for (i = 0; i < 128; i++)
+ dst[start + i] = NCR5380_read(C400_HOST_BUFFER);
#else
- /* implies CONFIG_SCSI_G_NCR5380_MEM */
- isa_memcpy_fromio(dst+start,NCR53C400_host_buffer+NCR5380_map_name,128);
+ /* implies CONFIG_SCSI_G_NCR5380_MEM */
+ isa_memcpy_fromio(dst + start, NCR53C400_host_buffer + NCR5380_map_name, 128);
#endif
- start+=128;
- blocks--;
- }
+ start += 128;
+ blocks--;
+ }
#if (NDEBUG & NDEBUG_C400_PREAD)
- else
- printk("53C400r: No EXTRA required\n");
+ else
+ printk("53C400r: No EXTRA required\n");
#endif
#if (NDEBUG & NDEBUG_C400_PREAD)
- printk("53C400r: Final values: blocks=%d start=%d\n", blocks, start);
+ printk("53C400r: Final values: blocks=%d start=%d\n", blocks, start);
#endif
- if (!(NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_GATED_53C80_IRQ))
- printk("53C400r: no 53C80 gated irq after transfer");
+ if (!(NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_GATED_53C80_IRQ))
+ printk("53C400r: no 53C80 gated irq after transfer");
#if (NDEBUG & NDEBUG_C400_PREAD)
- else
- printk("53C400r: Got 53C80 interrupt and tried to clear it\n");
+ else
+ printk("53C400r: Got 53C80 interrupt and tried to clear it\n");
#endif
/* DON'T DO THIS - THEY NEVER ARRIVE!
@@ -599,299 +597,287 @@ static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst,
;
*/
- if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_END_DMA_TRANSFER))
- printk("53C400r: no end dma signal\n");
+ if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_END_DMA_TRANSFER))
+ printk("53C400r: no end dma signal\n");
#if (NDEBUG & NDEBUG_C400_PREAD)
- else
- printk("53C400r: end dma as expected\n");
+ else
+ printk("53C400r: end dma as expected\n");
#endif
- NCR5380_write(MODE_REG, MR_BASE);
- NCR5380_read(RESET_PARITY_INTERRUPT_REG);
- return 0;
+ NCR5380_write(MODE_REG, MR_BASE);
+ NCR5380_read(RESET_PARITY_INTERRUPT_REG);
+ return 0;
}
-
-static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src, int len)
+
+static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *src, int len)
{
- int blocks = len / 128;
- int start = 0;
- int i;
- int bl;
- NCR5380_local_declare();
+ int blocks = len / 128;
+ int start = 0;
+ int i;
+ int bl;
+ NCR5380_local_declare();
- NCR5380_setup(instance);
+ NCR5380_setup(instance);
#if (NDEBUG & NDEBUG_C400_PWRITE)
- printk("53C400w: About to write %d blocks for %d bytes\n", blocks, len);
+ printk("53C400w: About to write %d blocks for %d bytes\n", blocks, len);
#endif
- NCR5380_write(C400_CONTROL_STATUS_REG, CSR_BASE);
- NCR5380_write(C400_BLOCK_COUNTER_REG, blocks);
- while (1) {
- if (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_GATED_53C80_IRQ) {
- printk("53C400w: Got 53C80_IRQ start=%d, blocks=%d\n", start, blocks);
- return -1;
- }
+ NCR5380_write(C400_CONTROL_STATUS_REG, CSR_BASE);
+ NCR5380_write(C400_BLOCK_COUNTER_REG, blocks);
+ while (1) {
+ if (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_GATED_53C80_IRQ) {
+ printk("53C400w: Got 53C80_IRQ start=%d, blocks=%d\n", start, blocks);
+ return -1;
+ }
- if ((bl=NCR5380_read(C400_BLOCK_COUNTER_REG)) == 0) {
+ if ((bl = NCR5380_read(C400_BLOCK_COUNTER_REG)) == 0) {
#if (NDEBUG & NDEBUG_C400_PWRITE)
- if (blocks)
- printk("53C400w: exiting loop, blocks still == %d\n", blocks);
- else
- printk("53C400w: exiting loop\n");
+ if (blocks)
+ printk("53C400w: exiting loop, blocks still == %d\n", blocks);
+ else
+ printk("53C400w: exiting loop\n");
#endif
- break;
- }
-
+ break;
+ }
#if (NDEBUG & NDEBUG_C400_PWRITE)
- printk("53C400w: %d blocks left\n", blocks);
+ printk("53C400w: %d blocks left\n", blocks);
- printk("53C400w: waiting for buffer, bl=%d\n", bl);
+ printk("53C400w: waiting for buffer, bl=%d\n", bl);
#endif
- while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY)
- ;
+ while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY);
#if (NDEBUG & NDEBUG_C400_PWRITE)
- printk("53C400w: transferring 128 bytes\n");
+ printk("53C400w: transferring 128 bytes\n");
#endif
#ifdef CONFIG_SCSI_G_NCR5380_PORT
- for (i=0; i<128; i++)
- NCR5380_write(C400_HOST_BUFFER, src[start+i]);
+ for (i = 0; i < 128; i++)
+ NCR5380_write(C400_HOST_BUFFER, src[start + i]);
#else
- /* implies CONFIG_SCSI_G_NCR5380_MEM */
- isa_memcpy_toio(NCR53C400_host_buffer+NCR5380_map_name,src+start,128);
+ /* implies CONFIG_SCSI_G_NCR5380_MEM */
+ isa_memcpy_toio(NCR53C400_host_buffer + NCR5380_map_name, src + start, 128);
#endif
- start+=128;
- blocks--;
- }
- if (blocks) {
+ start += 128;
+ blocks--;
+ }
+ if (blocks) {
#if (NDEBUG & NDEBUG_C400_PWRITE)
- printk("53C400w: EXTRA waiting for buffer\n");
+ printk("53C400w: EXTRA waiting for buffer\n");
#endif
- while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY)
- ;
+ while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY);
#if (NDEBUG & NDEBUG_C400_PWRITE)
- printk("53C400w: transferring EXTRA 128 bytes\n");
+ printk("53C400w: transferring EXTRA 128 bytes\n");
#endif
#ifdef CONFIG_SCSI_G_NCR5380_PORT
- for (i=0; i<128; i++)
- NCR5380_write(C400_HOST_BUFFER, src[start+i]);
+ for (i = 0; i < 128; i++)
+ NCR5380_write(C400_HOST_BUFFER, src[start + i]);
#else
- /* implies CONFIG_SCSI_G_NCR5380_MEM */
- isa_memcpy_toio(NCR53C400_host_buffer+NCR5380_map_name,src+start,128);
+ /* implies CONFIG_SCSI_G_NCR5380_MEM */
+ isa_memcpy_toio(NCR53C400_host_buffer + NCR5380_map_name, src + start, 128);
#endif
- start+=128;
- blocks--;
- }
+ start += 128;
+ blocks--;
+ }
#if (NDEBUG & NDEBUG_C400_PWRITE)
- else
- printk("53C400w: No EXTRA required\n");
+ else
+ printk("53C400w: No EXTRA required\n");
#endif
-
+
#if (NDEBUG & NDEBUG_C400_PWRITE)
- printk("53C400w: Final values: blocks=%d start=%d\n", blocks, start);
+ printk("53C400w: Final values: blocks=%d start=%d\n", blocks, start);
#endif
#if 0
- printk("53C400w: waiting for registers to be available\n");
- THEY NEVER DO!
- while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_53C80_REG)
- ;
- printk("53C400w: Got em\n");
-#endif
-
- /* Let's wait for this instead - could be ugly */
- /* All documentation says to check for this. Maybe my hardware is too
- * fast. Waiting for it seems to work fine! KLL
- */
- while (!(i = NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_GATED_53C80_IRQ))
- ;
-
- /*
- * I know. i is certainly != 0 here but the loop is new. See previous
- * comment.
- */
- if (i) {
+ printk("53C400w: waiting for registers to be available\n");
+ THEY NEVER DO ! while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_53C80_REG);
+ printk("53C400w: Got em\n");
+#endif
+
+ /* Let's wait for this instead - could be ugly */
+ /* All documentation says to check for this. Maybe my hardware is too
+ * fast. Waiting for it seems to work fine! KLL
+ */
+ while (!(i = NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_GATED_53C80_IRQ));
+
+ /*
+ * I know. i is certainly != 0 here but the loop is new. See previous
+ * comment.
+ */
+ if (i) {
#if (NDEBUG & NDEBUG_C400_PWRITE)
- printk("53C400w: got 53C80 gated irq (last block)\n");
+ printk("53C400w: got 53C80 gated irq (last block)\n");
#endif
- if (!((i=NCR5380_read(BUS_AND_STATUS_REG)) & BASR_END_DMA_TRANSFER))
- printk("53C400w: No END OF DMA bit - WHOOPS! BASR=%0x\n",i);
+ if (!((i = NCR5380_read(BUS_AND_STATUS_REG)) & BASR_END_DMA_TRANSFER))
+ printk("53C400w: No END OF DMA bit - WHOOPS! BASR=%0x\n", i);
#if (NDEBUG & NDEBUG_C400_PWRITE)
- else
- printk("53C400w: Got END OF DMA\n");
+ else
+ printk("53C400w: Got END OF DMA\n");
#endif
- }
- else
- printk("53C400w: no 53C80 gated irq after transfer (last block)\n");
+ } else
+ printk("53C400w: no 53C80 gated irq after transfer (last block)\n");
#if 0
- if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_END_DMA_TRANSFER)) {
- printk("53C400w: no end dma signal\n");
- }
+ if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_END_DMA_TRANSFER)) {
+ printk("53C400w: no end dma signal\n");
+ }
#endif
#if (NDEBUG & NDEBUG_C400_PWRITE)
- printk("53C400w: waiting for last byte...\n");
+ printk("53C400w: waiting for last byte...\n");
#endif
- while (!(NCR5380_read(TARGET_COMMAND_REG) & TCR_LAST_BYTE_SENT))
- ;
+ while (!(NCR5380_read(TARGET_COMMAND_REG) & TCR_LAST_BYTE_SENT));
#if (NDEBUG & NDEBUG_C400_PWRITE)
- printk("53C400w: got last byte.\n");
- printk("53C400w: pwrite exiting with status 0, whoopee!\n");
+ printk("53C400w: got last byte.\n");
+ printk("53C400w: pwrite exiting with status 0, whoopee!\n");
#endif
- return 0;
+ return 0;
}
-#endif /* PSEUDO_DMA */
+#endif /* PSEUDO_DMA */
#include "NCR5380.c"
#define PRINTP(x) len += sprintf(buffer+len, x)
#define ANDP ,
-static int sprint_opcode(char* buffer, int len, int opcode) {
- int start = len;
- PRINTP("0x%02x " ANDP opcode);
- return len-start;
+static int sprint_opcode(char *buffer, int len, int opcode)
+{
+ int start = len;
+ PRINTP("0x%02x " ANDP opcode);
+ return len - start;
}
-static int sprint_command (char* buffer, int len, unsigned char *command) {
- int i,s,start=len;
- len += sprint_opcode(buffer, len, command[0]);
- for ( i = 1, s = COMMAND_SIZE(command[0]); i < s; ++i)
- PRINTP("%02x " ANDP command[i]);
- PRINTP("\n");
- return len-start;
+static int sprint_command(char *buffer, int len, unsigned char *command)
+{
+ int i, s, start = len;
+ len += sprint_opcode(buffer, len, command[0]);
+ for (i = 1, s = COMMAND_SIZE(command[0]); i < s; ++i)
+ PRINTP("%02x " ANDP command[i]);
+ PRINTP("\n");
+ return len - start;
}
-static int sprint_Scsi_Cmnd (char* buffer, int len, Scsi_Cmnd *cmd) {
- int start = len;
- PRINTP("host number %d destination target %d, lun %d\n" ANDP
- cmd->host->host_no ANDP
- cmd->target ANDP
- cmd->lun);
- PRINTP(" command = ");
- len += sprint_command (buffer, len, cmd->cmnd);
- return len-start;
+static int sprint_Scsi_Cmnd(char *buffer, int len, Scsi_Cmnd * cmd)
+{
+ int start = len;
+ PRINTP("host number %d destination target %d, lun %d\n" ANDP cmd->host->host_no ANDP cmd->target ANDP cmd->lun);
+ PRINTP(" command = ");
+ len += sprint_command(buffer, len, cmd->cmnd);
+ return len - start;
}
-int generic_NCR5380_proc_info(char* buffer, char** start, off_t offset, int length, int hostno, int inout)
+int generic_NCR5380_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout)
{
- int len = 0;
- NCR5380_local_declare();
- unsigned long flags;
- unsigned char status;
- int i;
- struct Scsi_Host *scsi_ptr;
- Scsi_Cmnd *ptr;
- struct NCR5380_hostdata *hostdata;
+ int len = 0;
+ NCR5380_local_declare();
+ unsigned long flags;
+ unsigned char status;
+ int i;
+ struct Scsi_Host *scsi_ptr;
+ Scsi_Cmnd *ptr;
+ struct NCR5380_hostdata *hostdata;
#ifdef NCR5380_STATS
- Scsi_Device *dev;
- extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
+ Scsi_Device *dev;
+ extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
#endif
- save_flags(flags);
- cli();
+ save_flags(flags);
+ cli();
- for (scsi_ptr = first_instance; scsi_ptr; scsi_ptr=scsi_ptr->next)
- if (scsi_ptr->host_no == hostno)
- break;
- NCR5380_setup(scsi_ptr);
- hostdata = (struct NCR5380_hostdata *)scsi_ptr->hostdata;
+ for (scsi_ptr = first_instance; scsi_ptr; scsi_ptr = scsi_ptr->next)
+ if (scsi_ptr->host_no == hostno)
+ break;
+ NCR5380_setup(scsi_ptr);
+ hostdata = (struct NCR5380_hostdata *) scsi_ptr->hostdata;
- PRINTP("SCSI host number %d : %s\n" ANDP scsi_ptr->host_no ANDP scsi_ptr->hostt->name);
- PRINTP("Generic NCR5380 driver version %d\n" ANDP GENERIC_NCR5380_PUBLIC_RELEASE);
- PRINTP("NCR5380 core version %d\n" ANDP NCR5380_PUBLIC_RELEASE);
+ PRINTP("SCSI host number %d : %s\n" ANDP scsi_ptr->host_no ANDP scsi_ptr->hostt->name);
+ PRINTP("Generic NCR5380 driver version %d\n" ANDP GENERIC_NCR5380_PUBLIC_RELEASE);
+ PRINTP("NCR5380 core version %d\n" ANDP NCR5380_PUBLIC_RELEASE);
#ifdef NCR53C400
- PRINTP("NCR53C400 extension version %d\n" ANDP NCR53C400_PUBLIC_RELEASE);
- PRINTP("NCR53C400 card%s detected\n" ANDP (((struct NCR5380_hostdata *)scsi_ptr->hostdata)->flags & FLAG_NCR53C400)?"":" not");
+ PRINTP("NCR53C400 extension version %d\n" ANDP NCR53C400_PUBLIC_RELEASE);
+ PRINTP("NCR53C400 card%s detected\n" ANDP(((struct NCR5380_hostdata *) scsi_ptr->hostdata)->flags & FLAG_NCR53C400) ? "" : " not");
# if NCR53C400_PSEUDO_DMA
- PRINTP("NCR53C400 pseudo DMA used\n");
+ PRINTP("NCR53C400 pseudo DMA used\n");
# endif
#else
- PRINTP("NO NCR53C400 driver extensions\n");
+ PRINTP("NO NCR53C400 driver extensions\n");
#endif
- PRINTP("Using %s mapping at %s 0x%lx, " ANDP STRVAL(NCR5380_map_config) ANDP STRVAL(NCR5380_map_name) ANDP scsi_ptr->NCR5380_instance_name);
- if (scsi_ptr->irq == IRQ_NONE)
- PRINTP("no interrupt\n");
- else
- PRINTP("on interrupt %d\n" ANDP scsi_ptr->irq);
+ PRINTP("Using %s mapping at %s 0x%lx, " ANDP STRVAL(NCR5380_map_config) ANDP STRVAL(NCR5380_map_name) ANDP scsi_ptr->NCR5380_instance_name);
+ if (scsi_ptr->irq == IRQ_NONE)
+ PRINTP("no interrupt\n");
+ else
+ PRINTP("on interrupt %d\n" ANDP scsi_ptr->irq);
#ifdef NCR5380_STATS
- if (hostdata->connected || hostdata->issue_queue || hostdata->disconnected_queue)
- PRINTP("There are commands pending, transfer rates may be crud\n");
- if (hostdata->pendingr)
- PRINTP(" %d pending reads" ANDP hostdata->pendingr);
- if (hostdata->pendingw)
- PRINTP(" %d pending writes" ANDP hostdata->pendingw);
- if (hostdata->pendingr || hostdata->pendingw)
- PRINTP("\n");
- for (dev = scsi_ptr->host_queue; dev; dev=dev->next) {
- unsigned long br = hostdata->bytes_read[dev->id];
- unsigned long bw = hostdata->bytes_write[dev->id];
- long tr = hostdata->time_read[dev->id] / HZ;
- long tw = hostdata->time_write[dev->id] / HZ;
-
- PRINTP(" T:%d %s " ANDP dev->id ANDP (dev->type < MAX_SCSI_DEVICE_CODE) ? scsi_device_types[(int)dev->type] : "Unknown");
- for (i=0; i<8; i++)
- if (dev->vendor[i] >= 0x20)
- *(buffer+(len++)) = dev->vendor[i];
- *(buffer+(len++)) = ' ';
- for (i=0; i<16; i++)
- if (dev->model[i] >= 0x20)
- *(buffer+(len++)) = dev->model[i];
- *(buffer+(len++)) = ' ';
- for (i=0; i<4; i++)
- if (dev->rev[i] >= 0x20)
- *(buffer+(len++)) = dev->rev[i];
- *(buffer+(len++)) = ' ';
-
- PRINTP("\n%10ld kb read in %5ld secs" ANDP br/1024 ANDP tr);
- if (tr)
- PRINTP(" @ %5ld bps" ANDP br / tr);
-
- PRINTP("\n%10ld kb written in %5ld secs" ANDP bw/1024 ANDP tw);
- if (tw)
- PRINTP(" @ %5ld bps" ANDP bw / tw);
- PRINTP("\n");
- }
-#endif
-
- status = NCR5380_read(STATUS_REG);
- if (!(status & SR_REQ))
- PRINTP("REQ not asserted, phase unknown.\n");
- else {
- for (i = 0; (phases[i].value != PHASE_UNKNOWN) &&
- (phases[i].value != (status & PHASE_MASK)); ++i)
- ;
- PRINTP("Phase %s\n" ANDP phases[i].name);
- }
-
- if (!hostdata->connected) {
- PRINTP("No currently connected command\n");
- } else {
- len += sprint_Scsi_Cmnd (buffer, len, (Scsi_Cmnd *) hostdata->connected);
- }
-
- PRINTP("issue_queue\n");
-
- for (ptr = (Scsi_Cmnd *) hostdata->issue_queue; ptr;
- ptr = (Scsi_Cmnd *) ptr->host_scribble)
- len += sprint_Scsi_Cmnd (buffer, len, ptr);
-
- PRINTP("disconnected_queue\n");
-
- for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr;
- ptr = (Scsi_Cmnd *) ptr->host_scribble)
- len += sprint_Scsi_Cmnd (buffer, len, ptr);
-
- *start = buffer + offset;
- len -= offset;
- if (len > length)
- len = length;
- restore_flags(flags);
- return len;
+ if (hostdata->connected || hostdata->issue_queue || hostdata->disconnected_queue)
+ PRINTP("There are commands pending, transfer rates may be crud\n");
+ if (hostdata->pendingr)
+ PRINTP(" %d pending reads" ANDP hostdata->pendingr);
+ if (hostdata->pendingw)
+ PRINTP(" %d pending writes" ANDP hostdata->pendingw);
+ if (hostdata->pendingr || hostdata->pendingw)
+ PRINTP("\n");
+ for (dev = scsi_ptr->host_queue; dev; dev = dev->next) {
+ unsigned long br = hostdata->bytes_read[dev->id];
+ unsigned long bw = hostdata->bytes_write[dev->id];
+ long tr = hostdata->time_read[dev->id] / HZ;
+ long tw = hostdata->time_write[dev->id] / HZ;
+
+ PRINTP(" T:%d %s " ANDP dev->id ANDP(dev->type < MAX_SCSI_DEVICE_CODE) ? scsi_device_types[(int) dev->type] : "Unknown");
+ for (i = 0; i < 8; i++)
+ if (dev->vendor[i] >= 0x20)
+ *(buffer + (len++)) = dev->vendor[i];
+ *(buffer + (len++)) = ' ';
+ for (i = 0; i < 16; i++)
+ if (dev->model[i] >= 0x20)
+ *(buffer + (len++)) = dev->model[i];
+ *(buffer + (len++)) = ' ';
+ for (i = 0; i < 4; i++)
+ if (dev->rev[i] >= 0x20)
+ *(buffer + (len++)) = dev->rev[i];
+ *(buffer + (len++)) = ' ';
+
+ PRINTP("\n%10ld kb read in %5ld secs" ANDP br / 1024 ANDP tr);
+ if (tr)
+ PRINTP(" @ %5ld bps" ANDP br / tr);
+
+ PRINTP("\n%10ld kb written in %5ld secs" ANDP bw / 1024 ANDP tw);
+ if (tw)
+ PRINTP(" @ %5ld bps" ANDP bw / tw);
+ PRINTP("\n");
+ }
+#endif
+
+ status = NCR5380_read(STATUS_REG);
+ if (!(status & SR_REQ))
+ PRINTP("REQ not asserted, phase unknown.\n");
+ else {
+ for (i = 0; (phases[i].value != PHASE_UNKNOWN) && (phases[i].value != (status & PHASE_MASK)); ++i);
+ PRINTP("Phase %s\n" ANDP phases[i].name);
+ }
+
+ if (!hostdata->connected) {
+ PRINTP("No currently connected command\n");
+ } else {
+ len += sprint_Scsi_Cmnd(buffer, len, (Scsi_Cmnd *) hostdata->connected);
+ }
+
+ PRINTP("issue_queue\n");
+
+ for (ptr = (Scsi_Cmnd *) hostdata->issue_queue; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
+ len += sprint_Scsi_Cmnd(buffer, len, ptr);
+
+ PRINTP("disconnected_queue\n");
+
+ for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
+ len += sprint_Scsi_Cmnd(buffer, len, ptr);
+
+ *start = buffer + offset;
+ len -= offset;
+ if (len > length)
+ len = length;
+ restore_flags(flags);
+ return len;
}
#undef PRINTP
@@ -903,7 +889,7 @@ static Scsi_Host_Template driver_template = GENERIC_NCR5380;
#include <linux/module.h>
#include "scsi_module.c"
-#ifdef MODULE
+#ifdef MODULE
MODULE_PARM(ncr_irq, "i");
MODULE_PARM(ncr_dma, "i");
@@ -917,42 +903,42 @@ MODULE_LICENSE("GPL");
static int __init do_NCR5380_setup(char *str)
{
- int ints[10];
+ int ints[10];
- get_options(str, sizeof(ints)/sizeof(int), ints);
- generic_NCR5380_setup(str,ints);
+ get_options(str, sizeof(ints) / sizeof(int), ints);
+ generic_NCR5380_setup(str, ints);
- return 1;
+ return 1;
}
static int __init do_NCR53C400_setup(char *str)
{
- int ints[10];
+ int ints[10];
- get_options(str, sizeof(ints)/sizeof(int), ints);
- generic_NCR53C400_setup(str,ints);
+ get_options(str, sizeof(ints) / sizeof(int), ints);
+ generic_NCR53C400_setup(str, ints);
- return 1;
+ return 1;
}
static int __init do_NCR53C400A_setup(char *str)
{
- int ints[10];
+ int ints[10];
- get_options(str, sizeof(ints)/sizeof(int), ints);
- generic_NCR53C400A_setup(str,ints);
+ get_options(str, sizeof(ints) / sizeof(int), ints);
+ generic_NCR53C400A_setup(str, ints);
- return 1;
+ return 1;
}
static int __init do_DTC3181E_setup(char *str)
{
- int ints[10];
+ int ints[10];
- get_options(str, sizeof(ints)/sizeof(int), ints);
- generic_DTC3181E_setup(str,ints);
+ get_options(str, sizeof(ints) / sizeof(int), ints);
+ generic_DTC3181E_setup(str, ints);
- return 1;
+ return 1;
}
__setup("ncr5380=", do_NCR5380_setup);
@@ -962,10 +948,9 @@ __setup("dtc3181e=", do_DTC3181E_setup);
static struct isapnp_device_id id_table[] __devinitdata = {
{
- ISAPNP_ANY_ID, ISAPNP_ANY_ID,
- ISAPNP_VENDOR('D','T','C'), ISAPNP_FUNCTION(0x436e),
- 0
- },
+ ISAPNP_ANY_ID, ISAPNP_ANY_ID,
+ ISAPNP_VENDOR('D', 'T', 'C'), ISAPNP_FUNCTION(0x436e),
+ 0},
{0}
};
@@ -974,4 +959,3 @@ MODULE_LICENSE("GPL");
#endif
-
diff --git a/drivers/scsi/g_NCR5380.h b/drivers/scsi/g_NCR5380.h
index 3ab55b6f7..8e7b68128 100644
--- a/drivers/scsi/g_NCR5380.h
+++ b/drivers/scsi/g_NCR5380.h
@@ -47,16 +47,15 @@
int generic_NCR5380_abort(Scsi_Cmnd *);
int generic_NCR5380_detect(Scsi_Host_Template *);
int generic_NCR5380_release_resources(struct Scsi_Host *);
-int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
+int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
int generic_NCR5380_reset(Scsi_Cmnd *, unsigned int);
-int notyet_generic_proc_info (char *buffer ,char **start, off_t offset,
- int length, int hostno, int inout);
-const char* generic_NCR5380_info(struct Scsi_Host *);
+int notyet_generic_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout);
+const char *generic_NCR5380_info(struct Scsi_Host *);
#ifdef BIOSPARAM
int generic_NCR5380_biosparam(Disk *, kdev_t, int *);
#endif
-int generic_NCR5380_proc_info(char* buffer, char** start, off_t offset, int length, int hostno, int inout);
+int generic_NCR5380_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout);
#ifndef NULL
#define NULL 0
@@ -114,7 +113,7 @@ int generic_NCR5380_proc_info(char* buffer, char** start, off_t offset, int leng
#define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
#define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
-#else
+#else
/* therefore CONFIG_SCSI_G_NCR5380_MEM */
#define NCR5380_map_config memory
@@ -164,7 +163,6 @@ int generic_NCR5380_proc_info(char* buffer, char** start, off_t offset, int leng
#define BOARD_NCR53C400A 2
#define BOARD_DTC3181E 3
-#endif /* else def HOSTS_C */
-#endif /* ndef ASM */
-#endif /* GENERIC_NCR5380_H */
-
+#endif /* else def HOSTS_C */
+#endif /* ndef ASM */
+#endif /* GENERIC_NCR5380_H */
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c
index 263e1827d..f8688af4f 100644
--- a/drivers/scsi/ncr53c8xx.c
+++ b/drivers/scsi/ncr53c8xx.c
@@ -22,7 +22,7 @@
** This driver has been ported to Linux from the FreeBSD NCR53C8XX driver
** and is currently maintained by
**
-** Gerard Roudier <groudier@club-internet.fr>
+** Gerard Roudier <groudier@free.fr>
**
** Being given that this driver originates from the FreeBSD version, and
** in order to keep synergy on both, any suggested enhancements and corrections
@@ -63,7 +63,7 @@
** August 18 1997 by Cort <cort@cs.nmt.edu>:
** Support for Power/PC (Big Endian).
**
-** June 20 1998 by Gerard Roudier <groudier@club-internet.fr>:
+** June 20 1998 by Gerard Roudier
** Support for up to 64 tags per lun.
** O(1) everywhere (C and SCRIPTS) for normal cases.
** Low PCI traffic for command handling when on-chip RAM is present.
diff --git a/drivers/scsi/ncr53c8xx.h b/drivers/scsi/ncr53c8xx.h
index ac3f3b9e8..ac4e795a1 100644
--- a/drivers/scsi/ncr53c8xx.h
+++ b/drivers/scsi/ncr53c8xx.h
@@ -22,7 +22,7 @@
** This driver has been ported to Linux from the FreeBSD NCR53C8XX driver
** and is currently maintained by
**
-** Gerard Roudier <groudier@club-internet.fr>
+** Gerard Roudier <groudier@free.fr>
**
** Being given that this driver originates from the FreeBSD version, and
** in order to keep synergy on both, any suggested enhancements and corrections
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index aa7d5efb8..d156c7dcd 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -769,11 +769,13 @@ void scsi_wait_req (Scsi_Request * SRpnt, const void *cmnd ,
int timeout, int retries)
{
DECLARE_COMPLETION(wait);
+ request_queue_t *q = &SRpnt->sr_device->request_queue;
SRpnt->sr_request.waiting = &wait;
SRpnt->sr_request.rq_status = RQ_SCSI_BUSY;
scsi_do_req (SRpnt, (void *) cmnd,
buffer, bufflen, scsi_wait_done, timeout, retries);
+ generic_unplug_device(q);
wait_for_completion(&wait);
SRpnt->sr_request.waiting = NULL;
if( SRpnt->sr_command != NULL )
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index ad3e31af5..a8745e4b1 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -155,6 +155,7 @@ static struct dev_info device_list[] =
{"EMC", "SYMMETRIX", "*", BLIST_SPARSELUN},
{"CMD", "CRA-7280", "*", BLIST_SPARSELUN}, // CMD RAID Controller
{"CNSI", "G7324", "*", BLIST_SPARSELUN}, // Chaparral G7324 RAID
+ {"CNSi", "G8324", "*", BLIST_SPARSELUN}, // Chaparral G8324 RAID
{"Zzyzx", "RocketStor 500S", "*", BLIST_SPARSELUN},
{"Zzyzx", "RocketStor 2000", "*", BLIST_SPARSELUN},
{"SONY", "TSL", "*", BLIST_FORCELUN}, // DDS3 & DDS4 autoloaders
@@ -500,6 +501,7 @@ static int scan_scsis_single(unsigned int channel, unsigned int dev,
Scsi_Request * SRpnt;
int bflags, type = -1;
extern devfs_handle_t scsi_devfs_handle;
+ int scsi_level;
SDpnt->host = shpnt;
SDpnt->id = dev;
@@ -672,6 +674,7 @@ static int scan_scsis_single(unsigned int channel, unsigned int dev,
(SDpnt->scsi_level == 1 &&
(scsi_result[3] & 0x0f) == 1))
SDpnt->scsi_level++;
+ scsi_level = SDpnt->scsi_level;
/*
* Accommodate drivers that want to sleep when they should be in a polling
@@ -749,6 +752,7 @@ static int scan_scsis_single(unsigned int channel, unsigned int dev,
SDpnt->queue_depth = 1;
SDpnt->host = shpnt;
SDpnt->online = TRUE;
+ SDpnt->scsi_level = scsi_level;
/*
* Register the queue for the device. All I/O requests will come
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 71fb97133..5dfb403ff 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -19,9 +19,9 @@
*/
#include <linux/config.h>
#ifdef CONFIG_PROC_FS
- static char sg_version_str[] = "Version: 3.1.20 (20010814)";
+ static char sg_version_str[] = "Version: 3.1.22 (20011128)";
#endif
- static int sg_version_num = 30120; /* 2 digits for each component */
+ static int sg_version_num = 30122; /* 2 digits for each component */
/*
* D. P. Gilbert (dgilbert@interlog.com, dougg@triode.net.au), notes:
* - scsi logging is available via SCSI_LOG_TIMEOUT macros. First
@@ -82,6 +82,8 @@ static void sg_proc_cleanup(void);
#include <linux/iobuf.h>
#endif
+#define SG_NEW_KIOVEC 0 /* use alloc_kiovec(), not alloc_kiovec_sz() */
+
int sg_big_buff = SG_DEF_RESERVED_SIZE;
/* N.B. This variable is readable and writeable via
/proc/scsi/sg/def_reserved_size . Each time sg_open() is called a buffer
@@ -135,10 +137,10 @@ static struct Scsi_Device_Template sg_template =
typedef struct sg_scatter_hold /* holding area for scsi scatter gather info */
{
unsigned short k_use_sg; /* Count of kernel scatter-gather pieces */
- unsigned short sglist_len; /* size of malloc'd scatter-gather list */
+ unsigned short sglist_len; /* size of malloc'd scatter-gather list ++ */
unsigned bufflen; /* Size of (aggregate) data buffer */
unsigned b_malloc_len; /* actual len malloc'ed in buffer */
- void * buffer; /* Data buffer or scatter list,12 bytes each*/
+ void * buffer; /* Data buffer or scatter list + mem_src_arr */
struct kiobuf * kiobp; /* for direct IO information */
char mapped; /* indicates kiobp has locked pages */
char buffer_mem_src; /* heap whereabouts of 'buffer' */
@@ -181,6 +183,7 @@ typedef struct sg_fd /* holds the state of a file descriptor */
char cmd_q; /* 1 -> allow command queuing, 0 -> don't */
char next_cmd_len; /* 0 -> automatic (def), >0 -> use on next write() */
char keep_orphan; /* 0 -> drop orphan (def), 1 -> keep for read() */
+ char mmap_called; /* 0 -> mmap() never called on this fd */
} Sg_fd; /* 2760 bytes long on i386 */
typedef struct sg_device /* holds the state of each scsi generic device */
@@ -202,7 +205,8 @@ static void sg_cmd_done_bh(Scsi_Cmnd * SCpnt);
static int sg_start_req(Sg_request * srp);
static void sg_finish_rem_req(Sg_request * srp);
static int sg_build_indi(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size);
-static int sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp);
+static int sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp,
+ int tablesize);
static ssize_t sg_new_read(Sg_fd * sfp, char * buf, size_t count,
Sg_request * srp);
static ssize_t sg_new_write(Sg_fd * sfp, const char * buf, size_t count,
@@ -232,13 +236,14 @@ static Sg_request * sg_get_rq_mark(Sg_fd * sfp, int pack_id);
static Sg_request * sg_add_request(Sg_fd * sfp);
static int sg_remove_request(Sg_fd * sfp, Sg_request * srp);
static int sg_res_in_use(Sg_fd * sfp);
-static void sg_clr_srpnt(Scsi_Request * SRpnt);
static int sg_ms_to_jif(unsigned int msecs);
-static unsigned sg_jif_to_ms(int jifs);
+static inline unsigned sg_jif_to_ms(int jifs);
static int sg_allow_access(unsigned char opcode, char dev_type);
static int sg_build_dir(Sg_request * srp, Sg_fd * sfp, int dxfer_len);
static void sg_unmap_and(Sg_scatter_hold * schp, int free_also);
static Sg_device * sg_get_dev(int dev);
+static inline int sg_alloc_kiovec(int nr, struct kiobuf **bufp, int *szp);
+static inline void sg_free_kiovec(int nr, struct kiobuf **bufp, int *szp);
#ifdef CONFIG_PROC_FS
static int sg_last_dev(void);
#endif
@@ -617,6 +622,20 @@ static ssize_t sg_new_write(Sg_fd * sfp, const char * buf, size_t count,
sg_remove_request(sfp, srp);
return -ENOSYS;
}
+ if (hp->flags & SG_FLAG_MMAP_IO) {
+ if (hp->dxfer_len > sfp->reserve.bufflen) {
+ sg_remove_request(sfp, srp);
+ return -ENOMEM; /* MMAP_IO size must fit in reserve buffer */
+ }
+ if (hp->flags & SG_FLAG_DIRECT_IO) {
+ sg_remove_request(sfp, srp);
+ return -EINVAL; /* either MMAP_IO or DIRECT_IO (not both) */
+ }
+ if (sg_res_in_use(sfp)) {
+ sg_remove_request(sfp, srp);
+ return -EBUSY; /* reserve buffer already being used */
+ }
+ }
timeout = sg_ms_to_jif(srp->header.timeout);
if ((! hp->cmdp) || (hp->cmd_len < 6) || (hp->cmd_len > sizeof(cmnd))) {
sg_remove_request(sfp, srp);
@@ -717,7 +736,9 @@ static int sg_common_write(Sg_fd * sfp, Sg_request * srp,
(void *)SRpnt->sr_buffer, hp->dxfer_len,
sg_cmd_done_bh, timeout, SG_DEFAULT_RETRIES);
/* dxfer_len overwrites SRpnt->sr_bufflen, hence need for b_malloc_len */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,1)
generic_unplug_device(q);
+#endif
return 0;
}
@@ -851,7 +872,7 @@ static int sg_ioctl(struct inode * inode, struct file * filp,
result = get_user(val, (int *)arg);
if (result) return result;
if (val != sfp->reserve.bufflen) {
- if (sg_res_in_use(sfp))
+ if (sg_res_in_use(sfp) || sfp->mmap_called)
return -EBUSY;
sg_remove_scat(&sfp->reserve);
sg_build_reserve(sfp, val);
@@ -1032,6 +1053,139 @@ static int sg_fasync(int fd, struct file * filp, int mode)
return (retval < 0) ? retval : 0;
}
+static void sg_rb_correct4mmap(Sg_scatter_hold * rsv_schp, int startFinish)
+{
+ void * page_ptr;
+ struct page * page;
+ int k, m;
+
+ SCSI_LOG_TIMEOUT(3, printk("sg_rb_correct4mmap: startFinish=%d, "
+ "scatg=%d\n", startFinish, rsv_schp->k_use_sg));
+ /* N.B. correction _not_ applied to base page of aech allocation */
+ if (rsv_schp->k_use_sg) { /* reserve buffer is a scatter gather list */
+ struct scatterlist * sclp = rsv_schp->buffer;
+
+ for (k = 0; k < rsv_schp->k_use_sg; ++k, ++sclp) {
+ for (m = PAGE_SIZE; m < sclp->length; m += PAGE_SIZE) {
+ page_ptr = (unsigned char *)sclp->address + m;
+ page = virt_to_page(page_ptr);
+ if (startFinish)
+ get_page(page); /* increment page count */
+ else {
+ if (page_count(page) > 0)
+ put_page_testzero(page); /* decrement page count */
+ }
+ }
+ }
+ }
+ else { /* reserve buffer is just a single allocation */
+ for (m = PAGE_SIZE; m < rsv_schp->bufflen; m += PAGE_SIZE) {
+ page_ptr = (unsigned char *)rsv_schp->buffer + m;
+ page = virt_to_page(page_ptr);
+ if (startFinish)
+ get_page(page); /* increment page count */
+ else {
+ if (page_count(page) > 0)
+ put_page_testzero(page); /* decrement page count */
+ }
+ }
+ }
+}
+
+static struct page * sg_vma_nopage(struct vm_area_struct *vma,
+ unsigned long addr, int unused)
+{
+ Sg_fd * sfp;
+ struct page * page = NOPAGE_SIGBUS;
+ void * page_ptr = NULL;
+ unsigned long offset;
+ Sg_scatter_hold * rsv_schp;
+
+ if ((NULL == vma) || (! (sfp = (Sg_fd *)vma->vm_private_data)))
+ return page;
+ rsv_schp = &sfp->reserve;
+ offset = addr - vma->vm_start;
+ if (offset >= rsv_schp->bufflen)
+ return page;
+ SCSI_LOG_TIMEOUT(3, printk("sg_vma_nopage: offset=%lu, scatg=%d\n",
+ offset, rsv_schp->k_use_sg));
+ if (rsv_schp->k_use_sg) { /* reserve buffer is a scatter gather list */
+ int k;
+ unsigned long sa = vma->vm_start;
+ unsigned long len;
+ struct scatterlist * sclp = rsv_schp->buffer;
+
+ for (k = 0; (k < rsv_schp->k_use_sg) && (sa < vma->vm_end);
+ ++k, ++sclp) {
+ len = vma->vm_end - sa;
+ len = (len < sclp->length) ? len : sclp->length;
+ if (offset < len) {
+ page_ptr = (unsigned char *)sclp->address + offset;
+ page = virt_to_page(page_ptr);
+ get_page(page); /* increment page count */
+ break;
+ }
+ sa += len;
+ offset -= len;
+ }
+ }
+ else { /* reserve buffer is just a single allocation */
+ page_ptr = (unsigned char *)rsv_schp->buffer + offset;
+ page = virt_to_page(page_ptr);
+ get_page(page); /* increment page count */
+ }
+ return page;
+}
+
+static struct vm_operations_struct sg_mmap_vm_ops = {
+ nopage : sg_vma_nopage,
+};
+
+static int sg_mmap(struct file * filp, struct vm_area_struct *vma)
+{
+ Sg_fd * sfp;
+ unsigned long req_sz = vma->vm_end - vma->vm_start;
+ Sg_scatter_hold * rsv_schp;
+
+ if ((! filp) || (! vma) || (! (sfp = (Sg_fd *)filp->private_data)))
+ return -ENXIO;
+ SCSI_LOG_TIMEOUT(3, printk("sg_mmap starting, vm_start=%p, len=%d\n",
+ (void *)vma->vm_start, (int)req_sz));
+ if (vma->vm_pgoff)
+ return -EINVAL; /* want no offset */
+ rsv_schp = &sfp->reserve;
+ if (req_sz > rsv_schp->bufflen)
+ return -ENOMEM; /* cannot map more than reserved buffer */
+
+ if (rsv_schp->k_use_sg) { /* reserve buffer is a scatter gather list */
+ int k;
+ unsigned long sa = vma->vm_start;
+ unsigned long len;
+ struct scatterlist * sclp = rsv_schp->buffer;
+
+ for (k = 0; (k < rsv_schp->k_use_sg) && (sa < vma->vm_end);
+ ++k, ++sclp) {
+ if ((unsigned long)sclp->address & (PAGE_SIZE - 1))
+ return -EFAULT; /* non page aligned memory ?? */
+ len = vma->vm_end - sa;
+ len = (len < sclp->length) ? len : sclp->length;
+ sa += len;
+ }
+ }
+ else { /* reserve buffer is just a single allocation */
+ if ((unsigned long)rsv_schp->buffer & (PAGE_SIZE - 1))
+ return -EFAULT; /* non page aligned memory ?? */
+ }
+ if (0 == sfp->mmap_called) {
+ sg_rb_correct4mmap(rsv_schp, 1); /* do only once per fd lifetime */
+ sfp->mmap_called = 1;
+ }
+ vma->vm_flags |= (VM_RESERVED | VM_IO);
+ vma->vm_private_data = sfp;
+ vma->vm_ops = &sg_mmap_vm_ops;
+ return 0;
+}
+
/* This function is a "bottom half" handler that is called by the
* mid level when a command is completed (or has failed). */
static void sg_cmd_done_bh(Scsi_Cmnd * SCpnt)
@@ -1078,7 +1232,14 @@ static void sg_cmd_done_bh(Scsi_Cmnd * SCpnt)
srp->data.sglist_len = SRpnt->sr_sglist_len;
srp->data.bufflen = SRpnt->sr_bufflen;
srp->data.buffer = SRpnt->sr_buffer;
- sg_clr_srpnt(SRpnt);
+ /* now clear out request structure */
+ SRpnt->sr_use_sg = 0;
+ SRpnt->sr_sglist_len = 0;
+ SRpnt->sr_bufflen = 0;
+ SRpnt->sr_buffer = NULL;
+ SRpnt->sr_underflow = 0;
+ SRpnt->sr_request.rq_dev = MKDEV(0, 0); /* "sg" _disowns_ request blk */
+
srp->my_cmdp = NULL;
srp->done = 1;
read_unlock(&sg_dev_arr_lock);
@@ -1154,6 +1315,7 @@ static struct file_operations sg_fops = {
poll: sg_poll,
ioctl: sg_ioctl,
open: sg_open,
+ mmap: sg_mmap,
release: sg_release,
fasync: sg_fasync,
};
@@ -1178,7 +1340,7 @@ static int sg_init()
if(!sg_registered) {
if (devfs_register_chrdev(SCSI_GENERIC_MAJOR,"sg",&sg_fops))
{
- printk("Unable to get major %d for generic SCSI device\n",
+ printk(KERN_ERR "Unable to get major %d for generic SCSI device\n",
SCSI_GENERIC_MAJOR);
write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
return 1;
@@ -1191,7 +1353,7 @@ static int sg_init()
sg_dev_arr = (Sg_device **)kmalloc(sg_template.dev_max *
sizeof(Sg_device *), GFP_ATOMIC);
if (NULL == sg_dev_arr) {
- printk("sg_init: no space for sg_dev_arr\n");
+ printk(KERN_ERR "sg_init: no space for sg_dev_arr\n");
write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
return 1;
}
@@ -1214,8 +1376,8 @@ static int __init sg_def_reserved_size_setup(char *str)
sg_big_buff = tmp;
return 1;
} else {
- printk("sg_def_reserved_size : usage sg_def_reserved_size=n "
- "(n could be 65536, 131072 or 262144)\n");
+ printk(KERN_WARNING "sg_def_reserved_size : usage "
+ "sg_def_reserved_size=n (n could be 65536, 131072 or 262144)\n");
return 0;
}
}
@@ -1240,7 +1402,7 @@ static int sg_attach(Scsi_Device * scsidp)
if (NULL == tmp_da) {
scsidp->attached--;
write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
- printk("sg_attach: device array cannot be resized\n");
+ printk(KERN_ERR "sg_attach: device array cannot be resized\n");
return 1;
}
memset(tmp_da, 0, tmp_dev_max * sizeof(Sg_device *));
@@ -1255,7 +1417,7 @@ static int sg_attach(Scsi_Device * scsidp)
if (k > MINORMASK) {
scsidp->attached--;
write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
- printk("Unable to attach sg device <%d, %d, %d, %d>"
+ printk(KERN_WARNING "Unable to attach sg device <%d, %d, %d, %d>"
" type=%d, minor number exceed %d\n", scsidp->host->host_no,
scsidp->channel, scsidp->id, scsidp->lun, scsidp->type,
MINORMASK);
@@ -1268,7 +1430,7 @@ static int sg_attach(Scsi_Device * scsidp)
if (NULL == sdp) {
scsidp->attached--;
write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
- printk("sg_attach: Sg_device cannot be allocated\n");
+ printk(KERN_ERR "sg_attach: Sg_device cannot be allocated\n");
return 1;
}
@@ -1295,8 +1457,8 @@ static int sg_attach(Scsi_Device * scsidp)
case TYPE_WORM:
case TYPE_TAPE: break;
default:
- printk("Attached scsi generic sg%d at scsi%d, channel %d, id %d,"
- " lun %d, type %d\n", k, scsidp->host->host_no,
+ printk(KERN_NOTICE "Attached scsi generic sg%d at scsi%d, channel"
+ " %d, id %d, lun %d, type %d\n", k, scsidp->host->host_no,
scsidp->channel, scsidp->id, scsidp->lun, scsidp->type);
}
return 0;
@@ -1373,7 +1535,10 @@ static void sg_detach(Scsi_Device * scsidp)
MODULE_AUTHOR("Douglas Gilbert");
MODULE_DESCRIPTION("SCSI generic (sg) driver");
+
+#ifdef MODULE_LICENSE
MODULE_LICENSE("GPL");
+#endif
MODULE_PARM(def_reserved_size, "i");
MODULE_PARM_DESC(def_reserved_size, "size of buffer reserved for each fd");
@@ -1420,9 +1585,8 @@ static int sg_start_req(Sg_request * srp)
if (res <= 0) /* -ve -> error, 0 -> done, 1 -> try indirect */
return res;
}
- if ((! sg_res_in_use(sfp)) && (dxfer_len <= rsv_schp->bufflen)) {
+ if ((! sg_res_in_use(sfp)) && (dxfer_len <= rsv_schp->bufflen))
sg_link_reserve(sfp, srp, dxfer_len);
- }
else {
res = sg_build_indi(req_schp, sfp, dxfer_len);
if (res) {
@@ -1448,23 +1612,24 @@ static void sg_finish_rem_req(Sg_request * srp)
sg_remove_request(sfp, srp);
}
-static int sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp)
+static int sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp,
+ int tablesize)
{
int mem_src, ret_sz;
- int sg_bufflen = PAGE_SIZE;
int elem_sz = sizeof(struct scatterlist) + sizeof(char);
- int mx_sc_elems = (sg_bufflen / elem_sz) - 1;
+ /* scatter gather array, followed by mem_src_arr (array of chars) */
+ int sg_bufflen = tablesize * elem_sz;
+ int mx_sc_elems = tablesize;
mem_src = SG_HEAP_KMAL;
- schp->buffer = (struct scatterlist *)sg_malloc(sfp, sg_bufflen,
- &ret_sz, &mem_src);
- schp->buffer_mem_src = (char)mem_src;
+ schp->buffer = sg_malloc(sfp, sg_bufflen, &ret_sz, &mem_src);
if (! schp->buffer)
return -ENOMEM;
else if (ret_sz != sg_bufflen) {
sg_bufflen = ret_sz;
- mx_sc_elems = (sg_bufflen / elem_sz) - 1;
+ mx_sc_elems = sg_bufflen / elem_sz;
}
+ schp->buffer_mem_src = (char)mem_src;
schp->sglist_len = sg_bufflen;
memset(schp->buffer, 0, sg_bufflen);
return mx_sc_elems; /* number of scat_gath elements allocated */
@@ -1473,13 +1638,15 @@ static int sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp)
static void sg_unmap_and(Sg_scatter_hold * schp, int free_also)
{
#ifdef SG_ALLOW_DIO_CODE
+ int nbhs = 0;
+
if (schp && schp->kiobp) {
if (schp->mapped) {
unmap_kiobuf(schp->kiobp);
schp->mapped = 0;
}
if (free_also) {
- free_kiovec(1, &schp->kiobp);
+ sg_free_kiovec(1, &schp->kiobp, &nbhs);
schp->kiobp = NULL;
}
}
@@ -1497,10 +1664,12 @@ static int sg_build_dir(Sg_request * srp, Sg_fd * sfp, int dxfer_len)
sg_io_hdr_t * hp = &srp->header;
Sg_scatter_hold * schp = &srp->data;
int sg_tablesize = sfp->parentdp->sg_tablesize;
+ int nbhs = 0;
- res = alloc_kiovec(1, &schp->kiobp);
+ res = sg_alloc_kiovec(1, &schp->kiobp, &nbhs);
if (0 != res) {
- SCSI_LOG_TIMEOUT(5, printk("sg_build_dir: alloc_kiovec res=%d\n", res));
+ SCSI_LOG_TIMEOUT(5, printk("sg_build_dir: sg_alloc_kiovec res=%d\n",
+ res));
return 1;
}
res = map_user_kiobuf((SG_DXFER_TO_DEV == hp->dxfer_direction) ? 1 : 0,
@@ -1530,7 +1699,7 @@ static int sg_build_dir(Sg_request * srp, Sg_fd * sfp, int dxfer_len)
hp->info |= SG_INFO_DIRECT_IO;
return 0;
}
- mx_sc_elems = sg_build_sgat(schp, sfp);
+ mx_sc_elems = sg_build_sgat(schp, sfp, sg_tablesize);
if (mx_sc_elems <= 1) {
sg_unmap_and(schp, 1);
sg_remove_scat(schp);
@@ -1538,13 +1707,15 @@ static int sg_build_dir(Sg_request * srp, Sg_fd * sfp, int dxfer_len)
}
mem_src_arr = schp->buffer + (mx_sc_elems * sizeof(struct scatterlist));
for (k = 0, sclp = schp->buffer, rem_sz = dxfer_len;
- (k < sg_tablesize) && (rem_sz > 0) && (k < mx_sc_elems);
+ (rem_sz > 0) && (k < mx_sc_elems);
++k, ++sclp) {
offset = (0 == k) ? kp->offset : 0;
num = (rem_sz > (PAGE_SIZE - offset)) ? (PAGE_SIZE - offset) :
rem_sz;
sclp->address = page_address(kp->maplist[k]) + offset;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,13)
sclp->page = NULL;
+#endif
sclp->length = num;
mem_src_arr[k] = SG_USER_MEM;
rem_sz -= num;
@@ -1612,14 +1783,14 @@ static int sg_build_indi(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size)
char * mem_src_arr;
/* N.B. ret_sz and mem_src carried into this block ... */
- mx_sc_elems = sg_build_sgat(schp, sfp);
+ mx_sc_elems = sg_build_sgat(schp, sfp, sg_tablesize);
if (mx_sc_elems < 0)
return mx_sc_elems; /* most likely -ENOMEM */
mem_src_arr = schp->buffer +
(mx_sc_elems * sizeof(struct scatterlist));
for (k = 0, sclp = schp->buffer, rem_sz = blk_size;
- (k < sg_tablesize) && (rem_sz > 0) && (k < mx_sc_elems);
+ (rem_sz > 0) && (k < mx_sc_elems);
++k, rem_sz -= ret_sz, ++sclp) {
if (first)
first = 0;
@@ -1631,7 +1802,9 @@ static int sg_build_indi(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size)
break;
}
sclp->address = p;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,13)
sclp->page = NULL;
+#endif
sclp->length = ret_sz;
mem_src_arr[k] = mem_src;
@@ -1667,7 +1840,8 @@ static int sg_write_xfer(Sg_request * srp)
if (schp->bufflen < num_xfer)
num_xfer = schp->bufflen;
}
- if ((num_xfer <= 0) || (new_interface && (SG_FLAG_NO_DXFER & hp->flags)))
+ if ((num_xfer <= 0) ||
+ (new_interface && ((SG_FLAG_NO_DXFER | SG_FLAG_MMAP_IO) & hp->flags)))
return 0;
SCSI_LOG_TIMEOUT(4,
@@ -1769,7 +1943,7 @@ static int sg_u_iovec(sg_io_hdr_t * hp, int sg_num, int ind,
static char * sg_get_sgat_msa(Sg_scatter_hold * schp)
{
int elem_sz = sizeof(struct scatterlist) + sizeof(char);
- int mx_sc_elems = (schp->sglist_len / elem_sz) - 1;
+ int mx_sc_elems = schp->sglist_len / elem_sz;
return schp->buffer + (sizeof(struct scatterlist) * mx_sc_elems);
}
@@ -1789,7 +1963,9 @@ static void sg_remove_scat(Sg_scatter_hold * schp)
k, sclp->address, sclp->length, mem_src));
sg_free(sclp->address, sclp->length, mem_src);
sclp->address = NULL;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,13)
sclp->page = NULL;
+#endif
sclp->length = 0;
}
sg_free(schp->buffer, schp->sglist_len, schp->buffer_mem_src);
@@ -1817,7 +1993,8 @@ static int sg_read_xfer(Sg_request * srp)
if (schp->bufflen < num_xfer)
num_xfer = schp->bufflen;
}
- if ((num_xfer <= 0) || (new_interface && (SG_FLAG_NO_DXFER & hp->flags)))
+ if ((num_xfer <= 0) ||
+ (new_interface && ((SG_FLAG_NO_DXFER | SG_FLAG_MMAP_IO) & hp->flags)))
return 0;
SCSI_LOG_TIMEOUT(4,
@@ -2192,6 +2369,8 @@ static void __sg_remove_sfp(Sg_device * sdp, Sg_fd * sfp)
if (sfp->reserve.bufflen > 0) {
SCSI_LOG_TIMEOUT(6, printk("__sg_remove_sfp: bufflen=%d, k_use_sg=%d\n",
(int)sfp->reserve.bufflen, (int)sfp->reserve.k_use_sg));
+ if (sfp->mmap_called)
+ sg_rb_correct4mmap(&sfp->reserve, 0); /* undo correction */
sg_remove_scat(&sfp->reserve);
}
sfp->parentdp = NULL;
@@ -2240,7 +2419,7 @@ static int sg_remove_sfp(Sg_device * sdp, Sg_fd * sfp)
/* MOD_INC's to inhibit unloading sg and associated adapter driver */
if (sg_template.module)
__MOD_INC_USE_COUNT(sg_template.module);
- if (sdp->device->host->hostt->module)
+ if (sdp->device->host->hostt->module)
__MOD_INC_USE_COUNT(sdp->device->host->hostt->module);
SCSI_LOG_TIMEOUT(1, printk(
"sg_remove_sfp: worrisome, %d writes pending\n", dirty));
@@ -2315,7 +2494,8 @@ static char * sg_low_malloc(int rqSz, int lowDma, int mem_src, int * retSzp)
if (retSzp) *retSzp = resSz;
}
else
- printk("sg_low_malloc: bad mem_src=%d, rqSz=%df\n", mem_src, rqSz);
+ printk(KERN_ERR "sg_low_malloc: bad mem_src=%d, rqSz=%df\n",
+ mem_src, rqSz);
return resp;
}
@@ -2350,7 +2530,7 @@ static char * sg_malloc(const Sg_fd * sfp, int size, int * retSzp,
if (resp && retSzp) *retSzp = size;
break;
case SG_HEAP_KMAL:
- l_ms = SG_HEAP_PAGE;
+ l_ms = SG_HEAP_KMAL; /* was SG_HEAP_PAGE */
resp = sg_low_malloc(size, low_dma, l_ms, 0);
if (resp)
break;
@@ -2369,6 +2549,15 @@ static char * sg_malloc(const Sg_fd * sfp, int size, int * retSzp,
return resp;
}
+static inline int sg_alloc_kiovec(int nr, struct kiobuf **bufp, int *szp)
+{
+#if SG_NEW_KIOVEC
+ return alloc_kiovec_sz(nr, bufp, szp);
+#else
+ return alloc_kiovec(nr, bufp);
+#endif
+}
+
static void sg_low_free(char * buff, int size, int mem_src)
{
if (! buff) return;
@@ -2396,7 +2585,7 @@ static void sg_low_free(char * buff, int size, int mem_src)
case SG_USER_MEM:
break; /* nothing to do */
default:
- printk("sg_low_free: bad mem_src=%d, buff=0x%p, rqSz=%d\n",
+ printk(KERN_ERR "sg_low_free: bad mem_src=%d, buff=0x%p, rqSz=%d\n",
mem_src, buff, size);
break;
}
@@ -2412,14 +2601,13 @@ static void sg_free(char * buff, int size, int mem_src)
sg_low_free(buff, size, mem_src);
}
-static void sg_clr_srpnt(Scsi_Request * SRpnt)
+static inline void sg_free_kiovec(int nr, struct kiobuf **bufp, int *szp)
{
- SRpnt->sr_use_sg = 0;
- SRpnt->sr_sglist_len = 0;
- SRpnt->sr_bufflen = 0;
- SRpnt->sr_buffer = NULL;
- SRpnt->sr_underflow = 0;
- SRpnt->sr_request.rq_dev = MKDEV(0, 0); /* "sg" _disowns_ command blk */
+#if SG_NEW_KIOVEC
+ free_kiovec_sz(nr, bufp, szp);
+#else
+ free_kiovec(nr, bufp);
+#endif
}
static int sg_ms_to_jif(unsigned int msecs)
@@ -2431,7 +2619,7 @@ static int sg_ms_to_jif(unsigned int msecs)
: (((int)msecs / 1000) * HZ);
}
-static unsigned sg_jif_to_ms(int jifs)
+static inline unsigned sg_jif_to_ms(int jifs)
{
if (jifs <= 0)
return 0U;
@@ -2481,8 +2669,8 @@ static Sg_device * sg_get_dev(int dev)
if (sg_dev_arr && (dev >= 0))
{
read_lock_irqsave(&sg_dev_arr_lock, iflags);
- if (dev < sg_template.dev_max)
- sdp = sg_dev_arr[dev];
+ if (dev < sg_template.dev_max)
+ sdp = sg_dev_arr[dev];
read_unlock_irqrestore(&sg_dev_arr_lock, iflags);
}
return sdp;
@@ -2675,7 +2863,7 @@ static int sg_proc_debug_info(char * buffer, int * len, off_t * begin,
{
Sg_device * sdp;
const sg_io_hdr_t * hp;
- int j, max_dev;
+ int j, max_dev, new_interface;
if (NULL == sg_dev_arr) {
PRINT_PROC("sg_dev_arr NULL, driver not initialized\n");
@@ -2722,8 +2910,10 @@ static int sg_proc_debug_info(char * buffer, int * len, off_t * begin,
(int)fp->keep_orphan, (int)fp->closed);
for (m = 0; (srp = sg_get_nth_request(fp, m)); ++m) {
hp = &srp->header;
+ new_interface = (hp->interface_id == '\0') ? 0 : 1;
/* stop indenting so far ... */
- PRINT_PROC(srp->res_used ? " rb>> " :
+ PRINT_PROC(srp->res_used ? ((new_interface &&
+ (SG_FLAG_MMAP_IO & hp->flags)) ? " mmap>> " : " rb>> ") :
((SG_INFO_DIRECT_IO_MASK & hp->info) ? " dio>> " : " "));
blen = srp->my_cmdp ? srp->my_cmdp->sr_bufflen : srp->data.bufflen;
usg = srp->my_cmdp ? srp->my_cmdp->sr_use_sg : srp->data.k_use_sg;
@@ -2733,8 +2923,8 @@ static int sg_proc_debug_info(char * buffer, int * len, off_t * begin,
if (srp->done)
PRINT_PROC(" dur=%d", hp->duration);
else
- PRINT_PROC(" t_o/elap=%d/%d", ((hp->interface_id == '\0') ?
- sg_jif_to_ms(fp->timeout) : hp->timeout),
+ PRINT_PROC(" t_o/elap=%d/%d", new_interface ? hp->timeout :
+ sg_jif_to_ms(fp->timeout),
sg_jif_to_ms(hp->duration ? (jiffies - hp->duration) : 0));
PRINT_PROC("ms sgat=%d op=0x%02x\n", usg, (int)srp->data.cmd_opcode);
/* reset indenting */
diff --git a/drivers/scsi/sym53c8xx.c b/drivers/scsi/sym53c8xx.c
index 1c9a1be83..dd2dd8647 100644
--- a/drivers/scsi/sym53c8xx.c
+++ b/drivers/scsi/sym53c8xx.c
@@ -1,7 +1,7 @@
/******************************************************************************
** High Performance device driver for the Symbios 53C896 controller.
**
-** Copyright (C) 1998-2000 Gerard Roudier <groudier@club-internet.fr>
+** Copyright (C) 1998-2001 Gerard Roudier <groudier@free.fr>
**
** This driver also supports all the Symbios 53C8XX controller family,
** except 53C810 revisions < 16, 53C825 revisions < 16 and all
@@ -32,7 +32,7 @@
** The Linux port of the FreeBSD ncr driver has been achieved in
** november 1995 by:
**
-** Gerard Roudier <groudier@club-internet.fr>
+** Gerard Roudier <groudier@free.fr>
**
** Being given that this driver originates from the FreeBSD version, and
** in order to keep synergy on both, any suggested enhancements and corrections
diff --git a/drivers/scsi/sym53c8xx.h b/drivers/scsi/sym53c8xx.h
index 63883cd24..2f5df986f 100644
--- a/drivers/scsi/sym53c8xx.h
+++ b/drivers/scsi/sym53c8xx.h
@@ -1,7 +1,7 @@
/******************************************************************************
** High Performance device driver for the Symbios 53C896 controller.
**
-** Copyright (C) 1998-2000 Gerard Roudier <groudier@club-internet.fr>
+** Copyright (C) 1998-2001 Gerard Roudier <groudier@free.fr>
**
** This driver also supports all the Symbios 53C8XX controller family,
** except 53C810 revisions < 16, 53C825 revisions < 16 and all
@@ -32,7 +32,7 @@
** The Linux port of the FreeBSD ncr driver has been achieved in
** november 1995 by:
**
-** Gerard Roudier <groudier@club-internet.fr>
+** Gerard Roudier <groudier@free.fr>
**
** Being given that this driver originates from the FreeBSD version, and
** in order to keep synergy on both, any suggested enhancements and corrections
diff --git a/drivers/scsi/sym53c8xx_2/ChangeLog.txt b/drivers/scsi/sym53c8xx_2/ChangeLog.txt
index c020492c0..6a4a3f855 100644
--- a/drivers/scsi/sym53c8xx_2/ChangeLog.txt
+++ b/drivers/scsi/sym53c8xx_2/ChangeLog.txt
@@ -128,3 +128,21 @@ Sun Oct 28 15:00 2001 Gerard Roudier
* version sym-2.1.16-20011028
- Slightly simplify driver configuration.
- Prepare a new patch against linux-2.4.13.
+
+Sat Nov 17 10:00 2001 Gerard Roudier
+ * version sym-2.1.17
+ - Fix a couple of gcc/gcc3 warnings.
+ - Allocate separately from the HCB the array for CCBs hashed by DSA.
+ All driver memory allocations are now not greater than 1 PAGE
+ even on PPC64 / 4KB PAGE surprising setup.
+
+Sat Dec 01 18:00 2001 Gerard Roudier
+ * version sym-2.1.17a
+ - Use u_long instead of U32 for the IO base cookie. This is more
+ consistent with what archs are expecting.
+ - Use MMIO per default for Power PC instead of some fake normal IO,
+ as Paul Mackerras stated that MMIO works fine now on this arch.
+
+
+
+
diff --git a/drivers/scsi/sym53c8xx_2/sym53c8xx.h b/drivers/scsi/sym53c8xx_2/sym53c8xx.h
index c7963af18..d1d611f43 100644
--- a/drivers/scsi/sym53c8xx_2/sym53c8xx.h
+++ b/drivers/scsi/sym53c8xx_2/sym53c8xx.h
@@ -130,17 +130,17 @@ int sym53c8xx_release(struct Scsi_Host *);
#if !defined(HOSTS_C)
/*
- * Use normal IO if configured. Forced for alpha and powerpc.
- * Powerpc fails copying to on-chip RAM using memcpy_toio().
+ * Use normal IO if configured.
+ * Normal IO forced for alpha.
* Forced to MMIO for sparc.
*/
#if defined(__alpha__)
#define SYM_CONF_IOMAPPED
-#elif defined(__powerpc__)
-#define SYM_CONF_IOMAPPED
-#define SYM_OPT_NO_BUS_MEMORY_MAPPING
#elif defined(__sparc__)
#undef SYM_CONF_IOMAPPED
+/* #elif defined(__powerpc__) */
+/* #define SYM_CONF_IOMAPPED */
+/* #define SYM_OPT_NO_BUS_MEMORY_MAPPING */
#elif defined(CONFIG_SCSI_SYM53C8XX_IOMAPPED)
#define SYM_CONF_IOMAPPED
#endif
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
index 408db5e19..fa43752c2 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -2456,8 +2456,8 @@ sym53c8xx_pci_init(Scsi_Host_Template *tpnt, pcidev_t pdev, sym_device *device)
u_char pci_fix_up = SYM_SETUP_PCI_FIX_UP;
u_char revision;
u_int irq;
- u_long base, base_2, io_port;
- u_long base_c, base_2_c;
+ u_long base, base_2, base_io;
+ u_long base_c, base_2_c, io_port;
int i;
sym_chip *chip;
@@ -2474,7 +2474,7 @@ sym53c8xx_pci_init(Scsi_Host_Template *tpnt, pcidev_t pdev, sym_device *device)
device_id = PciDeviceId(pdev);
irq = PciIrqLine(pdev);
- i = pci_get_base_address(pdev, 0, &io_port);
+ i = pci_get_base_address(pdev, 0, &base_io);
io_port = pci_get_base_cookie(pdev, 0);
base_c = pci_get_base_cookie(pdev, i);
@@ -2492,9 +2492,9 @@ sym53c8xx_pci_init(Scsi_Host_Template *tpnt, pcidev_t pdev, sym_device *device)
/*
* If user excluded this chip, donnot initialize it.
*/
- if (io_port) {
+ if (base_io) {
for (i = 0 ; i < 8 ; i++) {
- if (sym_driver_setup.excludes[i] == io_port)
+ if (sym_driver_setup.excludes[i] == base_io)
return -1;
}
}
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.h b/drivers/scsi/sym53c8xx_2/sym_glue.h
index 49d6d32f9..d29896045 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.h
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.h
@@ -77,7 +77,6 @@
#include <linux/errno.h>
#include <linux/pci.h>
#include <linux/string.h>
-#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/ioport.h>
#include <linux/time.h>
@@ -463,7 +462,7 @@ struct sym_shcb {
vm_offset_t mmio_va; /* MMIO kernel virtual address */
vm_offset_t ram_va; /* RAM kernel virtual address */
- u32 io_port; /* IO port address */
+ u_long io_port; /* IO port address cookie */
u_short io_ws; /* IO window size */
int irq; /* IRQ number */
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c
index 2464f4c27..1160f8a5f 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -50,7 +50,7 @@
* SUCH DAMAGE.
*/
-#define SYM_DRIVER_NAME "sym-2.1.16a"
+#define SYM_DRIVER_NAME "sym-2.1.17a"
#ifdef __FreeBSD__
#include <dev/sym/sym_glue.h>
@@ -4691,6 +4691,7 @@ out_clrack:
OUTL_DSP (SCRIPTA_BA (np, clrack));
return;
out_stuck:
+ return;
}
/*
@@ -5226,6 +5227,7 @@ static void sym_alloc_lcb_tags (hcb_p np, u_char tn, u_char ln)
return;
fail:
+ return;
}
/*
@@ -5788,6 +5790,13 @@ int sym_hcb_attach(hcb_p np, struct sym_fw *fw)
goto attach_failed;
/*
+ * Allocate the array of lists of CCBs hashed by DSA.
+ */
+ np->ccbh = sym_calloc(sizeof(ccb_p *)*CCB_HASH_SIZE, "CCBH");
+ if (!np->ccbh)
+ goto attach_failed;
+
+ /*
* Initialyze the CCB free and busy queues.
*/
sym_que_init(&np->free_ccbq);
@@ -5978,6 +5987,8 @@ void sym_hcb_free(hcb_p np)
sym_mfree_dma(cp, sizeof(*cp), "CCB");
}
}
+ if (np->ccbh)
+ sym_mfree(np->ccbh, sizeof(ccb_p *)*CCB_HASH_SIZE, "CCBH");
if (np->badluntbl)
sym_mfree_dma(np->badluntbl, 256,"BADLUNTBL");
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.h b/drivers/scsi/sym53c8xx_2/sym_hipd.h
index 62530d4c4..cd8d7919e 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.h
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.h
@@ -1068,7 +1068,8 @@ struct sym_hcb {
/*
* CCB lists and queue.
*/
- ccb_p ccbh[CCB_HASH_SIZE]; /* CCB hashed by DSA value */
+ ccb_p *ccbh; /* CCBs hashed by DSA value */
+ /* CCB_HASH_SIZE lists of CCBs */
SYM_QUEHEAD free_ccbq; /* Queue of available CCBs */
SYM_QUEHEAD busy_ccbq; /* Queue of busy CCBs */
diff --git a/drivers/scsi/sym53c8xx_2/sym_nvram.c b/drivers/scsi/sym53c8xx_2/sym_nvram.c
index 66ce54ffe..4c75662b1 100644
--- a/drivers/scsi/sym53c8xx_2/sym_nvram.c
+++ b/drivers/scsi/sym53c8xx_2/sym_nvram.c
@@ -505,10 +505,10 @@ out:
return retv;
}
-#undef SET_BIT 0
-#undef CLR_BIT 1
-#undef SET_CLK 2
-#undef CLR_CLK 3
+#undef SET_BIT
+#undef CLR_BIT
+#undef SET_CLK
+#undef CLR_CLK
/*
* Try reading Symbios NVRAM.
diff --git a/drivers/scsi/sym53c8xx_comm.h b/drivers/scsi/sym53c8xx_comm.h
index 57934acc0..ec4f1cc41 100644
--- a/drivers/scsi/sym53c8xx_comm.h
+++ b/drivers/scsi/sym53c8xx_comm.h
@@ -1,7 +1,7 @@
/******************************************************************************
** High Performance device driver for the Symbios 53C896 controller.
**
-** Copyright (C) 1998-2000 Gerard Roudier <groudier@club-internet.fr>
+** Copyright (C) 1998-2001 Gerard Roudier <groudier@free.fr>
**
** This driver also supports all the Symbios 53C8XX controller family,
** except 53C810 revisions < 16, 53C825 revisions < 16 and all
@@ -32,7 +32,7 @@
** The Linux port of the FreeBSD ncr driver has been achieved in
** november 1995 by:
**
-** Gerard Roudier <groudier@club-internet.fr>
+** Gerard Roudier <groudier@free.fr>
**
** Being given that this driver originates from the FreeBSD version, and
** in order to keep synergy on both, any suggested enhancements and corrections
diff --git a/drivers/scsi/sym53c8xx_defs.h b/drivers/scsi/sym53c8xx_defs.h
index 52bd0eaab..82f3f1119 100644
--- a/drivers/scsi/sym53c8xx_defs.h
+++ b/drivers/scsi/sym53c8xx_defs.h
@@ -1,7 +1,7 @@
/******************************************************************************
** High Performance device driver for the Symbios 53C896 controller.
**
-** Copyright (C) 1998-2000 Gerard Roudier <groudier@club-internet.fr>
+** Copyright (C) 1998-2001 Gerard Roudier <groudier@free.fr>
**
** This driver also supports all the Symbios 53C8XX controller family,
** except 53C810 revisions < 16, 53C825 revisions < 16 and all
@@ -32,7 +32,7 @@
** The Linux port of the FreeBSD ncr driver has been achieved in
** november 1995 by:
**
-** Gerard Roudier <groudier@club-internet.fr>
+** Gerard Roudier <groudier@free.fr>
**
** Being given that this driver originates from the FreeBSD version, and
** in order to keep synergy on both, any suggested enhancements and corrections
diff --git a/drivers/sound/ymfpci.c b/drivers/sound/ymfpci.c
index e412b2919..8d5de5c37 100644
--- a/drivers/sound/ymfpci.c
+++ b/drivers/sound/ymfpci.c
@@ -39,8 +39,6 @@
* native synthesizer through a playback slot.
* - Use new 2.3.x cache coherent PCI DMA routines instead of virt_to_bus.
* - Make the thing big endian compatible. ALSA has it done.
- * - 2001/10/25 Since Civ:CTP forced redzone outside of pre-set fragments,
- * all ioctls that report free space lie a little. Adjust their returns.
* - 2001/11/29 ac97_save_state
*/
@@ -158,7 +156,7 @@ static int ymfpci_codec_ready(ymfpci_t *codec, int secondary, int sched)
schedule_timeout(1);
}
} while (end_time - (signed long)jiffies >= 0);
- printk("ymfpci_codec_ready: codec %i is not ready [0x%x]\n",
+ printk(KERN_ERR "ymfpci_codec_ready: codec %i is not ready [0x%x]\n",
secondary, ymfpci_readw(codec, reg));
return -EBUSY;
}
@@ -407,7 +405,7 @@ static int prog_dmabuf(struct ymf_state *state, int rec)
dmabuf->ready = 1;
#if 0
- printk("prog_dmabuf: rate %d format 0x%x,"
+ printk(KERN_DEBUG "prog_dmabuf: rate %d format 0x%x,"
" numfrag %d fragsize %d dmasize %d\n",
state->format.rate, state->format.format, dmabuf->numfrag,
dmabuf->fragsize, dmabuf->dmasize);
@@ -618,7 +616,7 @@ static void ymf_pcm_interrupt(ymfpci_t *codec, ymfpci_voice_t *voice)
dmabuf->hwptr = pos;
if (dmabuf->count == 0) {
- printk("ymfpci%d: %d: strain: hwptr %d\n",
+ printk(KERN_ERR "ymfpci%d: %d: strain: hwptr %d\n",
codec->dev_audio, voice->number, dmabuf->hwptr);
ymf_playback_trigger(codec, ypcm, 0);
}
@@ -636,7 +634,7 @@ static void ymf_pcm_interrupt(ymfpci_t *codec, ymfpci_voice_t *voice)
/*
* Lost interrupt or other screwage.
*/
- printk("ymfpci%d: %d: lost: delta %d"
+ printk(KERN_ERR "ymfpci%d: %d: lost: delta %d"
" hwptr %d swptr %d distance %d count %d\n",
codec->dev_audio, voice->number, delta,
dmabuf->hwptr, swptr, distance, dmabuf->count);
@@ -644,10 +642,10 @@ static void ymf_pcm_interrupt(ymfpci_t *codec, ymfpci_voice_t *voice)
/*
* Normal end of DMA.
*/
-// printk("ymfpci%d: %d: done: delta %d"
-// " hwptr %d swptr %d distance %d count %d\n",
-// codec->dev_audio, voice->number, delta,
-// dmabuf->hwptr, swptr, distance, dmabuf->count);
+ YMFDBGI("ymfpci%d: %d: done: delta %d"
+ " hwptr %d swptr %d distance %d count %d\n",
+ codec->dev_audio, voice->number, delta,
+ dmabuf->hwptr, swptr, distance, dmabuf->count);
}
played = dmabuf->count;
if (ypcm->running) {
@@ -1511,6 +1509,7 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
unsigned long flags;
audio_buf_info abinfo;
count_info cinfo;
+ int redzone;
int val;
switch (cmd) {
@@ -1734,9 +1733,12 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
dmabuf = &state->wpcm.dmabuf;
if (!dmabuf->ready && (val = prog_dmabuf(state, 0)) != 0)
return val;
+ redzone = ymf_calc_lend(state->format.rate);
+ redzone <<= state->format.shift;
+ redzone *= 3;
spin_lock_irqsave(&state->unit->reg_lock, flags);
abinfo.fragsize = dmabuf->fragsize;
- abinfo.bytes = dmabuf->dmasize - dmabuf->count;
+ abinfo.bytes = dmabuf->dmasize - dmabuf->count - redzone;
abinfo.fragstotal = dmabuf->numfrag;
abinfo.fragments = abinfo.bytes >> dmabuf->fragshift;
spin_unlock_irqrestore(&state->unit->reg_lock, flags);
@@ -1777,9 +1779,6 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
cinfo.bytes = dmabuf->total_bytes;
cinfo.blocks = dmabuf->count >> dmabuf->fragshift;
cinfo.ptr = dmabuf->hwptr;
- /* XXX fishy - breaks invariant count=hwptr-swptr */
- if (dmabuf->mapped)
- dmabuf->count &= dmabuf->fragsize-1;
spin_unlock_irqrestore(&state->unit->reg_lock, flags);
YMFDBGX("ymf_ioctl: GETIPTR ptr %d bytes %d\n",
cinfo.ptr, cinfo.bytes);
@@ -1794,9 +1793,6 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
cinfo.bytes = dmabuf->total_bytes;
cinfo.blocks = dmabuf->count >> dmabuf->fragshift;
cinfo.ptr = dmabuf->hwptr;
- /* XXX fishy - breaks invariant count=swptr-hwptr */
- if (dmabuf->mapped)
- dmabuf->count &= dmabuf->fragsize-1;
spin_unlock_irqrestore(&state->unit->reg_lock, flags);
YMFDBGX("ymf_ioctl: GETOPTR ptr %d bytes %d\n",
cinfo.ptr, cinfo.bytes);
@@ -2393,7 +2389,7 @@ static int ymf_ac97_init(ymfpci_t *unit, int num_ac97)
codec->codec_write = ymfpci_codec_write;
if (ac97_probe_codec(codec) == 0) {
- printk("ymfpci: ac97_probe_codec failed\n");
+ printk(KERN_ERR "ymfpci: ac97_probe_codec failed\n");
goto out_kfree;
}
diff --git a/fs/devfs/base.c b/fs/devfs/base.c
index c5a57e284..4fe0cc7b3 100644
--- a/fs/devfs/base.c
+++ b/fs/devfs/base.c
@@ -576,6 +576,9 @@
Fixed bug in <devfsd_close>: was dereferencing freed pointer.
Added process group check for devfsd privileges.
v1.4
+ 20011204 Richard Gooch <rgooch@atnf.csiro.au>
+ Use SLAB_ATOMIC in <devfsd_notify_de> from <devfs_d_delete>.
+ v1.5
*/
#include <linux/types.h>
#include <linux/errno.h>
@@ -608,7 +611,7 @@
#include <asm/bitops.h>
#include <asm/atomic.h>
-#define DEVFS_VERSION "1.4 (20011203)"
+#define DEVFS_VERSION "1.5 (20011204)"
#define DEVFS_NAME "devfs"
@@ -1394,13 +1397,16 @@ static int wait_for_devfsd_finished (struct fs_info *fs_info)
static int devfsd_notify_de (struct devfs_entry *de,
unsigned short type, umode_t mode,
- uid_t uid, gid_t gid, struct fs_info *fs_info)
+ uid_t uid, gid_t gid, struct fs_info *fs_info,
+ int atomic)
{
struct devfsd_buf_entry *entry;
struct devfs_entry *curr;
if ( !( fs_info->devfsd_event_mask & (1 << type) ) ) return (FALSE);
- if ( ( entry = kmem_cache_alloc (devfsd_buf_cache, 0) ) == NULL )
+ if ( ( entry = kmem_cache_alloc (devfsd_buf_cache,
+ atomic ? SLAB_ATOMIC : SLAB_KERNEL) )
+ == NULL )
{
atomic_inc (&fs_info->devfsd_overrun_count);
return (FALSE);
@@ -1433,7 +1439,7 @@ static int devfsd_notify_de (struct devfs_entry *de,
static void devfsd_notify (struct devfs_entry *de,unsigned short type,int wait)
{
if (devfsd_notify_de (de, type, de->mode, current->euid,
- current->egid, &fs_info) && wait)
+ current->egid, &fs_info, 0) && wait)
wait_for_devfsd_finished (&fs_info);
} /* End Function devfsd_notify */
@@ -1783,7 +1789,7 @@ devfs_handle_t devfs_mk_dir (devfs_handle_t dir, const char *name, void *info)
printk ("%s: devfs_mk_dir(%s): de: %p dir: %p \"%s\"\n",
DEVFS_NAME, name, de, dir, dir->name);
#endif
- devfsd_notify (de, DEVFSD_NOTIFY_REGISTERED, DEVFS_FL_NONE);
+ devfsd_notify (de, DEVFSD_NOTIFY_REGISTERED, 0);
devfs_put (dir);
return de;
} /* End Function devfs_mk_dir */
@@ -2289,7 +2295,7 @@ static int try_modload (struct devfs_entry *parent, struct fs_info *fs_info,
buf->namelen = namelen;
buf->u.name = name;
if ( !devfsd_notify_de (buf, DEVFSD_NOTIFY_LOOKUP, 0,
- current->euid, current->egid, fs_info) )
+ current->euid, current->egid, fs_info, 0) )
return -ENOENT;
/* Possible success */
return 0;
@@ -2420,7 +2426,7 @@ static int devfs_notify_change (struct dentry *dentry, struct iattr *iattr)
if ( ( iattr->ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID) ) &&
!is_devfsd_or_child (fs_info) )
devfsd_notify_de (de, DEVFSD_NOTIFY_CHANGE, inode->i_mode,
- inode->i_uid, inode->i_gid, fs_info);
+ inode->i_uid, inode->i_gid, fs_info, 0);
return 0;
} /* End Function devfs_notify_change */
@@ -2660,7 +2666,7 @@ static int devfs_open (struct inode *inode, struct file *file)
}
if ( df->aopen_notify && !is_devfsd_or_child (fs_info) )
devfsd_notify_de (de, DEVFSD_NOTIFY_ASYNC_OPEN, inode->i_mode,
- current->euid, current->egid, fs_info);
+ current->euid, current->egid, fs_info, 0);
return 0;
} /* End Function devfs_open */
@@ -2775,7 +2781,7 @@ static int devfs_d_delete (struct dentry *dentry)
de->u.fcb.open = FALSE;
if (de->u.fcb.aopen_notify)
devfsd_notify_de (de, DEVFSD_NOTIFY_CLOSE, inode->i_mode,
- current->euid, current->egid, fs_info);
+ current->euid, current->egid, fs_info, 1);
if (!de->u.fcb.auto_owner) return 0;
/* Change the ownership/protection back */
inode->i_mode = (de->mode & S_IFMT) | S_IRUGO | S_IWUGO;
@@ -2932,7 +2938,7 @@ static int devfs_unlink (struct inode *dir, struct dentry *dentry)
if (!unhooked) return -ENOENT;
if ( !is_devfsd_or_child (fs_info) )
devfsd_notify_de (de, DEVFSD_NOTIFY_DELETE, inode->i_mode,
- inode->i_uid, inode->i_gid, fs_info);
+ inode->i_uid, inode->i_gid, fs_info, 0);
free_dentry (de);
devfs_put (de);
return 0;
@@ -2973,7 +2979,7 @@ static int devfs_symlink (struct inode *dir, struct dentry *dentry,
d_instantiate (dentry, inode);
if ( !is_devfsd_or_child (fs_info) )
devfsd_notify_de (de, DEVFSD_NOTIFY_CREATE, inode->i_mode,
- inode->i_uid, inode->i_gid, fs_info);
+ inode->i_uid, inode->i_gid, fs_info, 0);
return 0;
} /* End Function devfs_symlink */
@@ -3007,7 +3013,7 @@ static int devfs_mkdir (struct inode *dir, struct dentry *dentry, int mode)
d_instantiate (dentry, inode);
if ( !is_devfsd_or_child (fs_info) )
devfsd_notify_de (de, DEVFSD_NOTIFY_CREATE, inode->i_mode,
- inode->i_uid, inode->i_gid, fs_info);
+ inode->i_uid, inode->i_gid, fs_info, 0);
return 0;
} /* End Function devfs_mkdir */
@@ -3036,7 +3042,7 @@ static int devfs_rmdir (struct inode *dir, struct dentry *dentry)
if (err) return err;
if ( !is_devfsd_or_child (fs_info) )
devfsd_notify_de (de, DEVFSD_NOTIFY_DELETE, inode->i_mode,
- inode->i_uid, inode->i_gid, fs_info);
+ inode->i_uid, inode->i_gid, fs_info, 0);
free_dentry (de);
devfs_put (de);
return 0;
@@ -3082,7 +3088,7 @@ static int devfs_mknod (struct inode *dir, struct dentry *dentry, int mode,
d_instantiate (dentry, inode);
if ( !is_devfsd_or_child (fs_info) )
devfsd_notify_de (de, DEVFSD_NOTIFY_CREATE, inode->i_mode,
- inode->i_uid, inode->i_gid, fs_info);
+ inode->i_uid, inode->i_gid, fs_info, 0);
return 0;
} /* End Function devfs_mknod */
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index ecf7fbc7e..528882de0 100644
--- a/fs/reiserfs/bitmap.c
+++ b/fs/reiserfs/bitmap.c
@@ -84,7 +84,7 @@ static inline void get_bit_address (struct super_block * s, unsigned long block,
to free a list of blocks at once. -Hans */
/* I wonder if it would be less modest
now that we use journaling. -Hans */
-void reiserfs_free_block (struct reiserfs_transaction_handle *th, unsigned long block)
+static void _reiserfs_free_block (struct reiserfs_transaction_handle *th, unsigned long block)
{
struct super_block * s = th->t_super;
struct reiserfs_super_block * rs;
@@ -92,9 +92,6 @@ void reiserfs_free_block (struct reiserfs_transaction_handle *th, unsigned long
struct buffer_head ** apbh;
int nr, offset;
- RFALSE(!s, "vs-4060: trying to free block on nonexistent device");
- RFALSE(is_reusable (s, block, 1) == 0, "vs-4070: can not free such block");
-
PROC_INFO_INC( s, free_block );
rs = SB_DISK_SUPER_BLOCK (s);
@@ -110,9 +107,6 @@ void reiserfs_free_block (struct reiserfs_transaction_handle *th, unsigned long
return;
}
- /* mark it before we clear it, just in case */
- journal_mark_freed(th, s, block) ;
-
reiserfs_prepare_for_journal(s, apbh[nr], 1 ) ;
/* clear bit for the given block in bit map */
@@ -131,7 +125,26 @@ void reiserfs_free_block (struct reiserfs_transaction_handle *th, unsigned long
s->s_dirt = 1;
}
+void reiserfs_free_block (struct reiserfs_transaction_handle *th,
+ unsigned long block) {
+ struct super_block * s = th->t_super;
+
+ RFALSE(!s, "vs-4061: trying to free block on nonexistent device");
+ RFALSE(is_reusable (s, block, 1) == 0, "vs-4071: can not free such block");
+ /* mark it before we clear it, just in case */
+ journal_mark_freed(th, s, block) ;
+ _reiserfs_free_block(th, block) ;
+}
+
+/* preallocated blocks don't need to be run through journal_mark_freed */
+void reiserfs_free_prealloc_block (struct reiserfs_transaction_handle *th,
+ unsigned long block) {
+ struct super_block * s = th->t_super;
+ RFALSE(!s, "vs-4060: trying to free block on nonexistent device");
+ RFALSE(is_reusable (s, block, 1) == 0, "vs-4070: can not free such block");
+ _reiserfs_free_block(th, block) ;
+}
/* beginning from offset-th bit in bmap_nr-th bitmap block,
find_forward finds the closest zero bit. It returns 1 and zero
@@ -409,7 +422,6 @@ free_and_return:
** has allocated it. loop around and try again
*/
if (reiserfs_test_and_set_le_bit (j, SB_AP_BITMAP (s)[i]->b_data)) {
- reiserfs_warning("vs-4150: reiserfs_new_blocknrs, block not free");
reiserfs_restore_prepared_buffer(s, SB_AP_BITMAP(s)[i]) ;
amount_needed++ ;
continue ;
@@ -495,12 +507,7 @@ int reiserfs_new_unf_blocknrs2 (struct reiserfs_transaction_handle *th,
** to be grouped towards the start of the border
*/
border = le32_to_cpu(INODE_PKEY(p_s_inode)->k_dir_id) % (SB_BLOCK_COUNT(th->t_super) - bstart - 1) ;
- } else {
- /* why would we want to delcare a local variable to this if statement
- ** name border????? -chris
- ** unsigned long border = 0;
- */
- if (!reiserfs_hashed_relocation(th->t_super)) {
+ } else if (!reiserfs_hashed_relocation(th->t_super)) {
hash_in = le32_to_cpu((INODE_PKEY(p_s_inode))->k_dir_id);
/* I wonder if the CPU cost of the
hash will obscure the layout
@@ -510,7 +517,6 @@ int reiserfs_new_unf_blocknrs2 (struct reiserfs_transaction_handle *th,
hash_out = keyed_hash(((char *) (&hash_in)), 4);
border = hash_out % (SB_BLOCK_COUNT(th->t_super) - bstart - 1) ;
- }
}
border += bstart ;
allocated[0] = 0 ; /* important. Allows a check later on to see if at
@@ -666,11 +672,13 @@ int reiserfs_new_unf_blocknrs2 (struct reiserfs_transaction_handle *th,
static void __discard_prealloc (struct reiserfs_transaction_handle * th,
struct inode * inode)
{
+ unsigned long save = inode->u.reiserfs_i.i_prealloc_block ;
while (inode->u.reiserfs_i.i_prealloc_count > 0) {
- reiserfs_free_block(th,inode->u.reiserfs_i.i_prealloc_block);
+ reiserfs_free_prealloc_block(th,inode->u.reiserfs_i.i_prealloc_block);
inode->u.reiserfs_i.i_prealloc_block++;
inode->u.reiserfs_i.i_prealloc_count --;
}
+ inode->u.reiserfs_i.i_prealloc_block = save ;
list_del (&(inode->u.reiserfs_i.i_prealloc_list));
}
diff --git a/fs/reiserfs/buffer2.c b/fs/reiserfs/buffer2.c
index 26570b6d3..367a4dcbf 100644
--- a/fs/reiserfs/buffer2.c
+++ b/fs/reiserfs/buffer2.c
@@ -2,15 +2,6 @@
* Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
*/
-
-/*
- * Contains code from
- *
- * linux/include/linux/lock.h and linux/fs/buffer.c /linux/fs/minix/fsync.c
- *
- * Copyright (C) 1991, 1992 Linus Torvalds
- */
-
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/locks.h>
@@ -21,12 +12,8 @@
/*
* wait_buffer_until_released
* reiserfs_bread
- * reiserfs_getblk
- * get_new_buffer
*/
-
-
/* when we allocate a new block (get_new_buffer, get_empty_nodes) and
get buffer for it, it is possible that it is held by someone else
or even by this process. In this function we wait until all other
@@ -47,7 +34,6 @@ void wait_buffer_until_released (const struct buffer_head * bh)
}
run_task_queue(&tq_disk);
current->policy |= SCHED_YIELD;
- /*current->counter = 0;*/
schedule();
}
if (repeat_counter > 30000000) {
@@ -63,7 +49,6 @@ void wait_buffer_until_released (const struct buffer_head * bh)
then it creates a new buffer and schedules I/O to read the
block. */
/* The function is NOT SCHEDULE-SAFE! */
-
struct buffer_head * reiserfs_bread (struct super_block *super, int n_block, int n_size)
{
struct buffer_head *result;
@@ -76,276 +61,3 @@ struct buffer_head * reiserfs_bread (struct super_block *super, int n_block, in
return result;
}
-/* This function looks for a buffer which contains a given block. If
- the block is in cache it returns it, otherwise it returns a new
- buffer which is not uptodate. This is called by reiserfs_bread and
- other functions. Note that get_new_buffer ought to be called this
- and this ought to be called get_new_buffer, since this doesn't
- actually get the block off of the disk. */
-/* The function is NOT SCHEDULE-SAFE! */
-
-struct buffer_head * reiserfs_getblk (kdev_t n_dev, int n_block, int n_size)
-{
- return getblk (n_dev, n_block, n_size);
-}
-
-#ifdef NEW_GET_NEW_BUFFER
-
-/* returns one buffer with a blocknr near blocknr. */
-static int get_new_buffer_near_blocknr(
- struct super_block * p_s_sb,
- int blocknr,
- struct buffer_head ** pp_s_new_bh,
- struct path * p_s_path
- ) {
- unsigned long n_new_blocknumber = 0;
- int n_ret_value,
- n_repeat = CARRY_ON;
-
-#ifdef CONFIG_REISERFS_CHECK
- int repeat_counter = 0;
-
- if (!blocknr)
- printk ("blocknr passed to get_new_buffer_near_blocknr was 0");
-#endif
-
-
- if ( (n_ret_value = reiserfs_new_blocknrs (p_s_sb, &n_new_blocknumber,
- blocknr, 1)) == NO_DISK_SPACE )
- return NO_DISK_SPACE;
-
- *pp_s_new_bh = reiserfs_getblk(p_s_sb->s_dev, n_new_blocknumber, p_s_sb->s_blocksize);
- if ( buffer_uptodate(*pp_s_new_bh) ) {
-
- RFALSE( buffer_dirty(*pp_s_new_bh) || (*pp_s_new_bh)->b_dev == NODEV,
- "PAP-14080: invalid uptodate buffer %b for the new block",
- *pp_s_new_bh);
-
- /* Free path buffers to prevent deadlock. */
- /* It is possible that this process has the buffer, which this function is getting, already in
- its path, and is responsible for double incrementing the value of b_count. If we recalculate
- the path after schedule we can avoid risking an endless loop. This problematic situation is
- possible in a multiple processing environment. Suppose process 1 has acquired a path P; then
- process 2 balanced and remove block A from the tree. Process 1 continues and runs
- get_new_buffer, that returns buffer with block A. If node A was on the path P, then it will
- have b_count == 2. If we now will simply wait in while ( (*pp_s_new_bh)->b_count > 1 ) we get
- into an endless loop, as nobody will release this buffer and the current process holds buffer
- twice. That is why we do decrement_counters_in_path(p_s_path) before waiting until b_count
- becomes 1. (it there were other processes holding node A, then eventually we will get a
- moment, when all of them released a buffer). */
- if ( atomic_read (&((*pp_s_new_bh)->b_count)) > 1 ) {
- decrement_counters_in_path(p_s_path);
- n_ret_value |= SCHEDULE_OCCURRED;
- }
-
- while ( atomic_read (&((*pp_s_new_bh)->b_count)) > 1 ) {
-
-#ifdef REISERFS_INFO
- printk("get_new_buffer() calls schedule to decrement b_count\n");
-#endif
-
-#ifdef CONFIG_REISERFS_CHECK
- if ( ! (++repeat_counter % 10000) )
- printk("get_new_buffer(%u): counter(%d) too big", current->pid, repeat_counter);
-#endif
-
- current->counter = 0;
- schedule();
- }
-
-#ifdef CONFIG_REISERFS_CHECK
- if ( buffer_dirty(*pp_s_new_bh) || (*pp_s_new_bh)->b_dev == NODEV ) {
- print_buffer_head(*pp_s_new_bh,"get_new_buffer");
- reiserfs_panic(p_s_sb, "PAP-14090: get_new_buffer: invalid uptodate buffer %b for the new block(case 2)", *pp_s_new_bh);
- }
-#endif
-
- }
- else {
- ;
-
- RFALSE( atomic_read (&((*pp_s_new_bh)->b_count)) != 1,
- "PAP-14100: not uptodate buffer %b for the new block has b_count more than one",
- *pp_s_new_bh);
-
- }
- return (n_ret_value | n_repeat);
-}
-
-
-/* returns the block number of the last unformatted node, assumes p_s_key_to_search.k_offset is a byte in the tail of
- the file, Useful for when you want to append to a file, and convert a direct item into an unformatted node near the
- last unformatted node of the file. Putting the unformatted node near the direct item is potentially very bad to do.
- If there is no unformatted node in the file, then we return the block number of the direct item. */
-/* The function is NOT SCHEDULE-SAFE! */
-inline int get_last_unformatted_node_blocknr_of_file( struct key * p_s_key_to_search, struct super_block * p_s_sb,
- struct buffer_head * p_s_bh
- struct path * p_unf_search_path, struct inode * p_s_inode)
-
-{
- struct key unf_key_to_search;
- struct item_head * p_s_ih;
- int n_pos_in_item;
- struct buffer_head * p_indirect_item_bh;
-
- copy_key(&unf_key_to_search,p_s_key_to_search);
- unf_key_to_search.k_uniqueness = TYPE_INDIRECT;
- unf_key_to_search.k_offset = p_s_inode->u.reiserfs_i.i_first_direct_byte - 1;
-
- /* p_s_key_to_search->k_offset - MAX_ITEM_LEN(p_s_sb->s_blocksize); */
- if (search_for_position_by_key (p_s_sb, &unf_key_to_search, p_unf_search_path, &n_pos_in_item) == POSITION_FOUND)
- {
- p_s_ih = B_N_PITEM_HEAD(p_indirect_item_bh = PATH_PLAST_BUFFER(p_unf_search_path), PATH_LAST_POSITION(p_unf_search_path));
- return (B_I_POS_UNFM_POINTER(p_indirect_item_bh, p_s_ih, n_pos_in_item));
- }
- /* else */
- printk("reiser-1800: search for unformatted node failed, p_s_key_to_search->k_offset = %u, unf_key_to_search.k_offset = %u, MAX_ITEM_LEN(p_s_sb->s_blocksize) = %ld, debug this\n", p_s_key_to_search->k_offset, unf_key_to_search.k_offset, MAX_ITEM_LEN(p_s_sb->s_blocksize) );
- print_buffer_head(PATH_PLAST_BUFFER(p_unf_search_path), "the buffer holding the item before the key we failed to find");
- print_block_head(PATH_PLAST_BUFFER(p_unf_search_path), "the block head");
- return 0; /* keeps the compiler quiet */
-}
-
-
- /* hasn't been out of disk space tested */
-/* The function is NOT SCHEDULE-SAFE! */
-static int get_buffer_near_last_unf ( struct super_block * p_s_sb, struct key * p_s_key_to_search,
- struct inode * p_s_inode, struct buffer_head * p_s_bh,
- struct buffer_head ** pp_s_un_bh, struct path * p_s_search_path)
-{
- int unf_blocknr = 0, /* blocknr from which we start search for a free block for an unformatted node, if 0
- then we didn't find an unformatted node though we might have found a file hole */
- n_repeat = CARRY_ON;
- struct key unf_key_to_search;
- struct path unf_search_path;
-
- copy_key(&unf_key_to_search,p_s_key_to_search);
- unf_key_to_search.k_uniqueness = TYPE_INDIRECT;
-
- if (
- (p_s_inode->u.reiserfs_i.i_first_direct_byte > 4095) /* i_first_direct_byte gets used for all sorts of
- crap other than what the name indicates, thus
- testing to see if it is 0 is not enough */
- && (p_s_inode->u.reiserfs_i.i_first_direct_byte < MAX_KEY_OFFSET) /* if there is no direct item then
- i_first_direct_byte = MAX_KEY_OFFSET */
- )
- {
- /* actually, we don't want the last unformatted node, we want the last unformatted node
- which is before the current file offset */
- unf_key_to_search.k_offset = ((p_s_inode->u.reiserfs_i.i_first_direct_byte -1) < unf_key_to_search.k_offset) ? p_s_inode->u.reiserfs_i.i_first_direct_byte -1 : unf_key_to_search.k_offset;
-
- while (unf_key_to_search.k_offset > -1)
- {
- /* This is our poorly documented way of initializing paths. -Hans */
- init_path (&unf_search_path);
- /* get the blocknr from which we start the search for a free block. */
- unf_blocknr = get_last_unformatted_node_blocknr_of_file( p_s_key_to_search, /* assumes this points to the file tail */
- p_s_sb, /* lets us figure out the block size */
- p_s_bh, /* if there is no unformatted node in the file,
- then it returns p_s_bh->b_blocknr */
- &unf_search_path,
- p_s_inode
- );
-/* printk("in while loop: unf_blocknr = %d, *pp_s_un_bh = %p\n", unf_blocknr, *pp_s_un_bh); */
- if (unf_blocknr)
- break;
- else /* release the path and search again, this could be really slow for huge
- holes.....better to spend the coding time adding compression though.... -Hans */
- {
- /* Vladimir, is it a problem that I don't brelse these buffers ?-Hans */
- decrement_counters_in_path(&unf_search_path);
- unf_key_to_search.k_offset -= 4096;
- }
- }
- if (unf_blocknr) {
- n_repeat |= get_new_buffer_near_blocknr(p_s_sb, unf_blocknr, pp_s_un_bh, p_s_search_path);
- }
- else { /* all unformatted nodes are holes */
- n_repeat |= get_new_buffer_near_blocknr(p_s_sb, p_s_bh->b_blocknr, pp_s_un_bh, p_s_search_path);
- }
- }
- else { /* file has no unformatted nodes */
- n_repeat |= get_new_buffer_near_blocknr(p_s_sb, p_s_bh->b_blocknr, pp_s_un_bh, p_s_search_path);
-/* printk("in else: unf_blocknr = %d, *pp_s_un_bh = %p\n", unf_blocknr, *pp_s_un_bh); */
-/* print_path (0, p_s_search_path); */
- }
-
- return n_repeat;
-}
-
-#endif /* NEW_GET_NEW_BUFFER */
-
-
-#ifdef OLD_GET_NEW_BUFFER
-
-/* The function is NOT SCHEDULE-SAFE! */
-int get_new_buffer(
- struct reiserfs_transaction_handle *th,
- struct buffer_head * p_s_bh,
- struct buffer_head ** pp_s_new_bh,
- struct path * p_s_path
- ) {
- unsigned long n_new_blocknumber = 0;
- int n_repeat;
- struct super_block * p_s_sb = th->t_super;
-
- if ( (n_repeat = reiserfs_new_unf_blocknrs (th, &n_new_blocknumber, p_s_bh->b_blocknr)) == NO_DISK_SPACE )
- return NO_DISK_SPACE;
-
- *pp_s_new_bh = reiserfs_getblk(p_s_sb->s_dev, n_new_blocknumber, p_s_sb->s_blocksize);
- if (atomic_read (&(*pp_s_new_bh)->b_count) > 1) {
- /* Free path buffers to prevent deadlock which can occur in the
- situation like : this process holds p_s_path; Block
- (*pp_s_new_bh)->b_blocknr is on the path p_s_path, but it is
- not necessary, that *pp_s_new_bh is in the tree; process 2
- could remove it from the tree and freed block
- (*pp_s_new_bh)->b_blocknr. Reiserfs_new_blocknrs in above
- returns block (*pp_s_new_bh)->b_blocknr. Reiserfs_getblk gets
- buffer for it, and it has b_count > 1. If we now will simply
- wait in while ( (*pp_s_new_bh)->b_count > 1 ) we get into an
- endless loop, as nobody will release this buffer and the
- current process holds buffer twice. That is why we do
- decrement_counters_in_path(p_s_path) before waiting until
- b_count becomes 1. (it there were other processes holding node
- pp_s_new_bh, then eventually we will get a moment, when all of
- them released a buffer). */
- decrement_counters_in_path(p_s_path);
- wait_buffer_until_released (*pp_s_new_bh);
- n_repeat |= SCHEDULE_OCCURRED;
- }
-
- RFALSE( atomic_read (&((*pp_s_new_bh)->b_count)) != 1 ||
- buffer_dirty (*pp_s_new_bh),
- "PAP-14100: not free or dirty buffer %b for the new block",
- *pp_s_new_bh);
-
- return n_repeat;
-}
-
-#endif /* OLD_GET_NEW_BUFFER */
-
-
-#ifdef GET_MANY_BLOCKNRS
- /* code not yet functional */
-get_next_blocknr (
- unsigned long * p_blocknr_array, /* we get a whole bunch of blocknrs all at once for
- the write. This is better than getting them one at
- a time. */
- unsigned long ** p_blocknr_index, /* pointer to current offset into the array. */
- unsigned long blocknr_array_length
-)
-{
- unsigned long return_value;
-
- if (*p_blocknr_index < p_blocknr_array + blocknr_array_length) {
- return_value = **p_blocknr_index;
- **p_blocknr_index = 0;
- *p_blocknr_index++;
- return (return_value);
- }
- else
- {
- kfree (p_blocknr_array);
- }
-}
-#endif /* GET_MANY_BLOCKNRS */
-
diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c
index 228d97277..ca9393ea5 100644
--- a/fs/reiserfs/dir.c
+++ b/fs/reiserfs/dir.c
@@ -22,22 +22,6 @@ struct file_operations reiserfs_dir_operations = {
fsync: reiserfs_dir_fsync,
};
-/*
- * directories can handle most operations...
- */
-struct inode_operations reiserfs_dir_inode_operations = {
- //&reiserfs_dir_operations, /* default_file_ops */
- create: reiserfs_create,
- lookup: reiserfs_lookup,
- link: reiserfs_link,
- unlink: reiserfs_unlink,
- symlink: reiserfs_symlink,
- mkdir: reiserfs_mkdir,
- rmdir: reiserfs_rmdir,
- mknod: reiserfs_mknod,
- rename: reiserfs_rename,
-};
-
int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry, int datasync) {
lock_kernel();
reiserfs_commit_for_inode(dentry->d_inode) ;
@@ -186,7 +170,7 @@ static int reiserfs_readdir (struct file * filp, void * dirent, filldir_t filldi
}
/* directory continues in the right neighboring block */
- set_cpu_key_k_offset (&pos_key, le_key_k_offset (ITEM_VERSION_1, rkey));
+ set_cpu_key_k_offset (&pos_key, le_key_k_offset (KEY_FORMAT_3_5, rkey));
} /* while */
@@ -198,3 +182,71 @@ static int reiserfs_readdir (struct file * filp, void * dirent, filldir_t filldi
reiserfs_check_path(&path_to_entry) ;
return 0;
}
+
+/* compose directory item containing "." and ".." entries (entries are
+ not aligned to 4 byte boundary) */
+/* the last four params are LE */
+void make_empty_dir_item_v1 (char * body, __u32 dirid, __u32 objid,
+ __u32 par_dirid, __u32 par_objid)
+{
+ struct reiserfs_de_head * deh;
+
+ memset (body, 0, EMPTY_DIR_SIZE_V1);
+ deh = (struct reiserfs_de_head *)body;
+
+ /* direntry header of "." */
+ put_deh_offset( &(deh[0]), DOT_OFFSET );
+ /* these two are from make_le_item_head, and are are LE */
+ deh[0].deh_dir_id = dirid;
+ deh[0].deh_objectid = objid;
+ deh[0].deh_state = 0; /* Endian safe if 0 */
+ put_deh_location( &(deh[0]), EMPTY_DIR_SIZE_V1 - strlen( "." ));
+ mark_de_visible(&(deh[0]));
+
+ /* direntry header of ".." */
+ put_deh_offset( &(deh[1]), DOT_DOT_OFFSET);
+ /* key of ".." for the root directory */
+ /* these two are from the inode, and are are LE */
+ deh[1].deh_dir_id = par_dirid;
+ deh[1].deh_objectid = par_objid;
+ deh[1].deh_state = 0; /* Endian safe if 0 */
+ put_deh_location( &(deh[1]), deh_location( &(deh[0]) ) - strlen( ".." ) );
+ mark_de_visible(&(deh[1]));
+
+ /* copy ".." and "." */
+ memcpy (body + deh_location( &(deh[0]) ), ".", 1);
+ memcpy (body + deh_location( &(deh[1]) ), "..", 2);
+}
+
+/* compose directory item containing "." and ".." entries */
+void make_empty_dir_item (char * body, __u32 dirid, __u32 objid,
+ __u32 par_dirid, __u32 par_objid)
+{
+ struct reiserfs_de_head * deh;
+
+ memset (body, 0, EMPTY_DIR_SIZE);
+ deh = (struct reiserfs_de_head *)body;
+
+ /* direntry header of "." */
+ put_deh_offset( &(deh[0]), DOT_OFFSET );
+ /* these two are from make_le_item_head, and are are LE */
+ deh[0].deh_dir_id = dirid;
+ deh[0].deh_objectid = objid;
+ deh[0].deh_state = 0; /* Endian safe if 0 */
+ put_deh_location( &(deh[0]), EMPTY_DIR_SIZE - ROUND_UP( strlen( "." ) ) );
+ mark_de_visible(&(deh[0]));
+
+ /* direntry header of ".." */
+ put_deh_offset( &(deh[1]), DOT_DOT_OFFSET );
+ /* key of ".." for the root directory */
+ /* these two are from the inode, and are are LE */
+ deh[1].deh_dir_id = par_dirid;
+ deh[1].deh_objectid = par_objid;
+ deh[1].deh_state = 0; /* Endian safe if 0 */
+ put_deh_location( &(deh[1]), deh_location( &(deh[0])) - ROUND_UP( strlen( ".." ) ) );
+ mark_de_visible(&(deh[1]));
+
+ /* copy ".." and "." */
+ memcpy (body + deh_location( &(deh[0]) ), ".", 1);
+ memcpy (body + deh_location( &(deh[1]) ), "..", 2);
+}
diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c
index 270917411..1c9e1bca9 100644
--- a/fs/reiserfs/do_balan.c
+++ b/fs/reiserfs/do_balan.c
@@ -274,13 +274,6 @@ static int balance_leaf (struct tree_balance * tb,
int pos_in_item;
int zeros_num;
-#if 0
- if (tb->insert_size [0] % 4) {
- reiserfs_panic (tb->tb_sb, "balance_leaf: wrong insert_size %d",
- tb->insert_size [0]);
- }
-#endif
-
PROC_INFO_INC( tb -> tb_sb, balance_at[ 0 ] );
/* Make balance in case insert_size[0] < 0 */
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index 3a41dc5f4..739176d42 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -33,7 +33,7 @@ static int reiserfs_file_release (struct inode * inode, struct file * filp)
/* fast out for when nothing needs to be done */
if ((atomic_read(&inode->i_count) > 1 ||
- !inode->u.reiserfs_i.i_pack_on_close ||
+ !(inode->u.reiserfs_i.i_flags & i_pack_on_close_mask) ||
!tail_has_to_be_packed(inode)) &&
inode->u.reiserfs_i.i_prealloc_count <= 0) {
return 0;
@@ -50,7 +50,7 @@ static int reiserfs_file_release (struct inode * inode, struct file * filp)
journal_end(&th, inode->i_sb, JOURNAL_PER_BALANCE_CNT * 3) ;
if (atomic_read(&inode->i_count) <= 1 &&
- inode->u.reiserfs_i.i_pack_on_close &&
+ (inode->u.reiserfs_i.i_flags & i_pack_on_close_mask) &&
tail_has_to_be_packed (inode)) {
/* if regular file is released by last holder and it has been
appended (we append by unformatted node only) or its direct
@@ -97,11 +97,17 @@ static int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) {
/* version 2 items will be caught by the s_maxbytes check
** done for us in vmtruncate
*/
- if (inode_items_version(inode) == ITEM_VERSION_1 &&
+ if (get_inode_item_key_version(inode) == KEY_FORMAT_3_5 &&
attr->ia_size > MAX_NON_LFS)
return -EFBIG ;
}
+ if ((((attr->ia_valid & ATTR_UID) && (attr->ia_uid & ~0xffff)) ||
+ ((attr->ia_valid & ATTR_GID) && (attr->ia_gid & ~0xffff))) &&
+ (get_inode_sd_version (inode) == STAT_DATA_V1))
+ /* stat data of format v3.5 has 16 bit uid and gid */
+ return -EINVAL;
+
error = inode_change_ok(inode, attr) ;
if (!error)
inode_setattr(inode, attr) ;
diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c
index 4c61dfdea..44f599bee 100644
--- a/fs/reiserfs/fix_node.c
+++ b/fs/reiserfs/fix_node.c
@@ -806,7 +806,7 @@ static int get_empty_nodes(
RFALSE( ! *p_n_blocknr,
"PAP-8135: reiserfs_new_blocknrs failed when got new blocks");
- p_s_new_bh = reiserfs_getblk(p_s_sb->s_dev, *p_n_blocknr, p_s_sb->s_blocksize);
+ p_s_new_bh = getblk(p_s_sb->s_dev, *p_n_blocknr, p_s_sb->s_blocksize);
if (atomic_read (&(p_s_new_bh->b_count)) > 1) {
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/*
@@ -2021,23 +2021,6 @@ static int get_virtual_node_size (struct super_block * sb, struct buffer_head *
// entry would eat 2 byte of virtual node space
return sb->s_blocksize;
-#if 0
- size = sizeof (struct virtual_node) + sizeof (struct virtual_item);
- ih = B_N_PITEM_HEAD (bh, 0);
- nr_items = B_NR_ITEMS (bh);
- for (i = 0; i < nr_items; i ++, ih ++) {
- /* each item occupies some space in virtual node */
- size += sizeof (struct virtual_item);
- if (is_direntry_le_ih (ih))
- /* each entry and new one occupeis 2 byte in the virtual node */
- size += (ih_entry_count(ih) + 1) * sizeof( __u16 );
- }
-
- /* 1 bit for each bitmap block to note whether bitmap block was
- dirtied in the operation */
- /* size += (SB_BMAP_NR (sb) * 2 / 8 + 4);*/
- return size;
-#endif
}
@@ -2343,15 +2326,6 @@ int fix_nodes (int n_op_mode,
"at the beginning of fix_nodes or not in tree (mode %c)", p_s_tbS0, p_s_tbS0, n_op_mode);
}
- // FIXME: new items have to be of 8 byte multiples. Including new
- // directory items those look like old ones
- /*
- if (p_s_tb->insert_size[0] % 8)
- reiserfs_panic (p_s_tb->tb_sb, "vs-: fix_nodes: incorrect insert_size %d, "
- "mode %c",
- p_s_tb->insert_size[0], n_op_mode);
- */
-
/* Check parameters. */
switch (n_op_mode) {
case M_INSERT:
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 0d93af1d8..793db9bd1 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -17,6 +17,8 @@
#define GET_BLOCK_READ_DIRECT 4 /* read the tail if indirect item not found */
#define GET_BLOCK_NO_ISEM 8 /* i_sem is not held, don't preallocate */
+static int reiserfs_get_block (struct inode * inode, long block,
+ struct buffer_head * bh_result, int create);
//
// initially this function was derived from minix or ext2's analog and
// evolved as the prototype did
@@ -40,11 +42,13 @@ void reiserfs_delete_inode (struct inode * inode)
reiserfs_delete_object (&th, inode);
pop_journal_writer(windex) ;
- reiserfs_release_objectid (&th, inode->i_ino);
journal_end(&th, inode->i_sb, jbegin_count) ;
- up (&inode->i_sem);
+ up (&inode->i_sem);
+
+ /* all items of file are deleted, so we can remove "save" link */
+ remove_save_link (inode, 0/* not truncate */);
} else {
/* no object items are in the tree */
;
@@ -72,9 +76,9 @@ static void _make_cpu_key (struct cpu_key * key, int version, __u32 dirid, __u32
void make_cpu_key (struct cpu_key * key, const struct inode * inode, loff_t offset,
int type, int length )
{
- _make_cpu_key (key, inode_items_version (inode), le32_to_cpu (INODE_PKEY (inode)->k_dir_id),
- le32_to_cpu (INODE_PKEY (inode)->k_objectid),
- offset, type, length);
+ _make_cpu_key (key, get_inode_item_key_version (inode), le32_to_cpu (INODE_PKEY (inode)->k_dir_id),
+ le32_to_cpu (INODE_PKEY (inode)->k_objectid),
+ offset, type, length);
}
@@ -215,9 +219,9 @@ static inline void set_block_dev_mapped (struct buffer_head * bh,
// files which were created in the earlier version can not be longer,
// than 2 gb
//
-int file_capable (struct inode * inode, long block)
+static int file_capable (struct inode * inode, long block)
{
- if (inode_items_version (inode) != ITEM_VERSION_1 || // it is new file.
+ if (get_inode_item_key_version (inode) != KEY_FORMAT_3_5 || // it is new file.
block < (1 << (31 - inode->i_sb->s_blocksize_bits))) // old file, but 'block' is inside of 2gb
return 1;
@@ -511,8 +515,8 @@ static inline int _allocate_block(struct reiserfs_transaction_handle *th,
// determine which parts are derivative, if any, understanding that
// there are only so many ways to code to a given interface.
//
-int reiserfs_get_block (struct inode * inode, long block,
- struct buffer_head * bh_result, int create)
+static int reiserfs_get_block (struct inode * inode, long block,
+ struct buffer_head * bh_result, int create)
{
int repeat, retval;
unsigned long tag;
@@ -540,7 +544,7 @@ int reiserfs_get_block (struct inode * inode, long block,
/* bad.... */
lock_kernel() ;
th.t_trans_id = 0 ;
- version = inode_items_version (inode);
+ version = get_inode_item_key_version (inode);
if (block < 0) {
unlock_kernel();
@@ -564,7 +568,7 @@ int reiserfs_get_block (struct inode * inode, long block,
return ret;
}
- inode->u.reiserfs_i.i_pack_on_close = 1 ;
+ inode->u.reiserfs_i.i_flags |= i_pack_on_close_mask;
windex = push_journal_writer("reiserfs_get_block") ;
@@ -880,7 +884,8 @@ static void init_inode (struct inode * inode, struct path * path)
struct stat_data_v1 * sd = (struct stat_data_v1 *)B_I_PITEM (bh, ih);
unsigned long blocks;
- inode_items_version (inode) = ITEM_VERSION_1;
+ set_inode_item_key_version (inode, KEY_FORMAT_3_5);
+ set_inode_sd_version (inode, STAT_DATA_V1);
inode->i_mode = sd_v1_mode(sd);
inode->i_nlink = sd_v1_nlink(sd);
inode->i_uid = sd_v1_uid(sd);
@@ -929,13 +934,13 @@ static void init_inode (struct inode * inode, struct path * path)
inode->i_generation = sd_v2_generation(sd);
if (S_ISDIR (inode->i_mode) || S_ISLNK (inode->i_mode))
- inode_items_version (inode) = ITEM_VERSION_1;
+ set_inode_item_key_version (inode, KEY_FORMAT_3_5);
else
- inode_items_version (inode) = ITEM_VERSION_2;
+ set_inode_item_key_version (inode, KEY_FORMAT_3_6);
}
/* nopack = 0, by default */
- inode->u.reiserfs_i.nopack = 0;
+ inode->u.reiserfs_i.i_flags &= ~i_nopack_mask;
pathrelse (path);
if (S_ISREG (inode->i_mode)) {
@@ -1115,7 +1120,7 @@ void reiserfs_read_inode2 (struct inode * inode, void *p)
/* set version 1, version 2 could be used too, because stat data
key is the same in both versions */
- key.version = ITEM_VERSION_1;
+ key.version = KEY_FORMAT_3_5;
key.on_disk_key.k_dir_id = dirino;
key.on_disk_key.k_objectid = inode->i_ino;
key.on_disk_key.u.k_offset_v1.k_offset = SD_OFFSET;
@@ -1186,7 +1191,7 @@ struct inode * reiserfs_iget (struct super_block * s, const struct cpu_key * key
}
struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, __u32 *data,
- int len, int fhtype, int parent) {
+ int len, int fhtype, int parent) {
struct cpu_key key ;
struct inode *inode = NULL ;
struct list_head *lp;
@@ -1327,26 +1332,6 @@ void reiserfs_write_inode (struct inode * inode, int do_sync) {
}
}
-void reiserfs_dirty_inode (struct inode * inode) {
- struct reiserfs_transaction_handle th ;
-
- if (inode->i_sb->s_flags & MS_RDONLY) {
- reiserfs_warning("clm-6006: writing inode %lu on readonly FS\n",
- inode->i_ino) ;
- return ;
- }
- lock_kernel() ;
-
- /* this is really only used for atime updates, so they don't have
- ** to be included in O_SYNC or fsync
- */
- journal_begin(&th, inode->i_sb, 1) ;
- reiserfs_update_sd (&th, inode);
- journal_end(&th, inode->i_sb, 1) ;
- unlock_kernel() ;
-}
-
-
/* FIXME: no need any more. right? */
int reiserfs_sync_inode (struct reiserfs_transaction_handle *th, struct inode * inode)
{
@@ -1369,20 +1354,20 @@ static int reiserfs_new_directory (struct reiserfs_transaction_handle *th,
struct cpu_key key;
int retval;
- _make_cpu_key (&key, ITEM_VERSION_1, le32_to_cpu (ih->ih_key.k_dir_id),
+ _make_cpu_key (&key, KEY_FORMAT_3_5, le32_to_cpu (ih->ih_key.k_dir_id),
le32_to_cpu (ih->ih_key.k_objectid), DOT_OFFSET, TYPE_DIRENTRY, 3/*key length*/);
/* compose item head for new item. Directories consist of items of
old type (ITEM_VERSION_1). Do not set key (second arg is 0), it
is done by reiserfs_new_inode */
if (old_format_only (sb)) {
- make_le_item_head (ih, 0, ITEM_VERSION_1, DOT_OFFSET, TYPE_DIRENTRY, EMPTY_DIR_SIZE_V1, 2);
+ make_le_item_head (ih, 0, KEY_FORMAT_3_5, DOT_OFFSET, TYPE_DIRENTRY, EMPTY_DIR_SIZE_V1, 2);
make_empty_dir_item_v1 (body, ih->ih_key.k_dir_id, ih->ih_key.k_objectid,
INODE_PKEY (dir)->k_dir_id,
INODE_PKEY (dir)->k_objectid );
} else {
- make_le_item_head (ih, 0, ITEM_VERSION_1, DOT_OFFSET, TYPE_DIRENTRY, EMPTY_DIR_SIZE, 2);
+ make_le_item_head (ih, 0, KEY_FORMAT_3_5, DOT_OFFSET, TYPE_DIRENTRY, EMPTY_DIR_SIZE, 2);
make_empty_dir_item (body, ih->ih_key.k_dir_id, ih->ih_key.k_objectid,
INODE_PKEY (dir)->k_dir_id,
@@ -1418,12 +1403,12 @@ static int reiserfs_new_symlink (struct reiserfs_transaction_handle *th,
struct cpu_key key;
int retval;
- _make_cpu_key (&key, ITEM_VERSION_1,
+ _make_cpu_key (&key, KEY_FORMAT_3_5,
le32_to_cpu (ih->ih_key.k_dir_id),
le32_to_cpu (ih->ih_key.k_objectid),
1, TYPE_DIRECT, 3/*key length*/);
- make_le_item_head (ih, 0, ITEM_VERSION_1, 1, TYPE_DIRECT, item_len, 0/*free_space*/);
+ make_le_item_head (ih, 0, KEY_FORMAT_3_5, 1, TYPE_DIRECT, item_len, 0/*free_space*/);
/* look for place in the tree for new item */
retval = search_item (sb, &key, path);
@@ -1494,13 +1479,13 @@ struct inode * reiserfs_new_inode (struct reiserfs_transaction_handle *th,
inode->i_generation = ++event;
#endif
if (old_format_only (sb))
- make_le_item_head (&ih, 0, ITEM_VERSION_1, SD_OFFSET, TYPE_STAT_DATA, SD_V1_SIZE, MAX_US_INT);
+ make_le_item_head (&ih, 0, KEY_FORMAT_3_5, SD_OFFSET, TYPE_STAT_DATA, SD_V1_SIZE, MAX_US_INT);
else
- make_le_item_head (&ih, 0, ITEM_VERSION_2, SD_OFFSET, TYPE_STAT_DATA, SD_SIZE, MAX_US_INT);
+ make_le_item_head (&ih, 0, KEY_FORMAT_3_6, SD_OFFSET, TYPE_STAT_DATA, SD_SIZE, MAX_US_INT);
/* key to search for correct place for new stat data */
- _make_cpu_key (&key, ITEM_VERSION_2, le32_to_cpu (ih.ih_key.k_dir_id),
+ _make_cpu_key (&key, KEY_FORMAT_3_6, le32_to_cpu (ih.ih_key.k_dir_id),
le32_to_cpu (ih.ih_key.k_objectid), SD_OFFSET, TYPE_STAT_DATA, 3/*key length*/);
/* find proper place for inserting of stat data */
@@ -1536,9 +1521,16 @@ struct inode * reiserfs_new_inode (struct reiserfs_transaction_handle *th,
INIT_LIST_HEAD(&inode->u.reiserfs_i.i_prealloc_list) ;
- if (old_format_only (sb))
+ if (old_format_only (sb)) {
+ if (inode->i_uid & ~0xffff || inode->i_gid & ~0xffff) {
+ pathrelse (&path_to_key);
+ /* i_uid or i_gid is too big to be stored in stat data v3.5 */
+ iput (inode);
+ *err = -EINVAL;
+ return NULL;
+ }
inode2sd_v1 (&sd, inode);
- else
+ } else
inode2sd (&sd, inode);
// these do not go to on-disk stat data
@@ -1551,10 +1543,14 @@ struct inode * reiserfs_new_inode (struct reiserfs_transaction_handle *th,
// format, other new objects will consist of new items)
memcpy (INODE_PKEY (inode), &(ih.ih_key), KEY_SIZE);
if (old_format_only (sb) || S_ISDIR(mode) || S_ISLNK(mode))
- inode_items_version (inode) = ITEM_VERSION_1;
+ set_inode_item_key_version (inode, KEY_FORMAT_3_5);
else
- inode_items_version (inode) = ITEM_VERSION_2;
-
+ set_inode_item_key_version (inode, KEY_FORMAT_3_6);
+ if (old_format_only (sb))
+ set_inode_sd_version (inode, STAT_DATA_V1);
+ else
+ set_inode_sd_version (inode, STAT_DATA_V2);
+
/* insert the stat data into the tree */
retval = reiserfs_insert_item (th, &path_to_key, &key, &ih, (char *)(&sd));
if (retval) {
@@ -1714,12 +1710,23 @@ void reiserfs_truncate_file(struct inode *p_s_inode, int update_timestamps) {
** because the truncate might pack the item anyway
** (it will unmap bh if it packs).
*/
- journal_begin(&th, p_s_inode->i_sb, JOURNAL_PER_BALANCE_CNT * 2 ) ;
+ /* it is enough to reserve space in transaction for 2 balancings:
+ one for "save" link adding and another for the first
+ cut_from_item. 1 is for update_sd */
+ journal_begin(&th, p_s_inode->i_sb, JOURNAL_PER_BALANCE_CNT * 2 + 1 ) ;
reiserfs_update_inode_transaction(p_s_inode) ;
windex = push_journal_writer("reiserfs_vfs_truncate_file") ;
+ if (update_timestamps)
+ /* we are doing real truncate: if the system crashes before the last
+ transaction of truncating gets committed - on reboot the file
+ either appears truncated properly or not truncated at all */
+ add_save_link (&th, p_s_inode, 1);
reiserfs_do_truncate (&th, p_s_inode, page, update_timestamps) ;
pop_journal_writer(windex) ;
- journal_end(&th, p_s_inode->i_sb, JOURNAL_PER_BALANCE_CNT * 2 ) ;
+ journal_end(&th, p_s_inode->i_sb, JOURNAL_PER_BALANCE_CNT * 2 + 1 ) ;
+
+ if (update_timestamps)
+ remove_save_link (p_s_inode, 1/* truncate */);
if (page) {
length = offset & (blocksize - 1) ;
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c
index d142a322c..95cb132ee 100644
--- a/fs/reiserfs/ioctl.c
+++ b/fs/reiserfs/ioctl.c
@@ -46,7 +46,7 @@ int reiserfs_unpack (struct inode * inode, struct file * filp)
return -EINVAL ;
}
/* ioctl already done */
- if (inode->u.reiserfs_i.nopack) {
+ if (inode->u.reiserfs_i.i_flags & i_nopack_mask) {
return 0 ;
}
lock_kernel();
@@ -59,7 +59,7 @@ int reiserfs_unpack (struct inode * inode, struct file * filp)
write_from = inode->i_size & (blocksize - 1) ;
/* if we are on a block boundary, we are already unpacked. */
if ( write_from == 0) {
- inode->u.reiserfs_i.nopack = 1;
+ inode->u.reiserfs_i.i_flags |= i_nopack_mask;
goto out ;
}
@@ -79,7 +79,7 @@ int reiserfs_unpack (struct inode * inode, struct file * filp)
/* conversion can change page contents, must flush */
flush_dcache_page(page) ;
- inode->u.reiserfs_i.nopack = 1;
+ inode->u.reiserfs_i.i_flags |= i_nopack_mask;
kunmap(page) ; /* mapped by prepare_write */
out_unlock:
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 2c71fd471..564553186 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -92,6 +92,8 @@ static int do_journal_end(struct reiserfs_transaction_handle *,struct super_bloc
static int flush_journal_list(struct super_block *s, struct reiserfs_journal_list *jl, int flushall) ;
static int flush_commit_list(struct super_block *s, struct reiserfs_journal_list *jl, int flushall) ;
static int can_dirty(struct reiserfs_journal_cnode *cn) ;
+static int remove_from_journal_list(struct super_block *s, struct reiserfs_journal_list *jl, struct buffer_head *bh, int remove_freed);
+static int journal_join(struct reiserfs_transaction_handle *th, struct super_block *p_s_sb, unsigned long nblocks);
static void init_journal_hash(struct super_block *p_s_sb) {
memset(SB_JOURNAL(p_s_sb)->j_hash_table, 0, JOURNAL_HASH_SIZE * sizeof(struct reiserfs_journal_cnode *)) ;
@@ -1697,7 +1699,7 @@ static int journal_read(struct super_block *p_s_sb) {
/* step three, starting at the oldest transaction, replay */
if (last_flush_start > 0) {
oldest_start = last_flush_start ;
- oldest_trans_id = last_flush_trans_id ;
+ oldest_trans_id = last_flush_trans_id + 1 ;
}
cur_dblock = oldest_start ;
if (oldest_trans_id) {
@@ -1717,6 +1719,8 @@ static int journal_read(struct super_block *p_s_sb) {
}
cur_dblock = reiserfs_get_journal_block(p_s_sb) + SB_JOURNAL(p_s_sb)->j_start ;
replay_count++ ;
+ if (cur_dblock == oldest_start)
+ break;
}
if (oldest_trans_id == 0) {
@@ -2083,7 +2087,7 @@ relock:
}
-int journal_join(struct reiserfs_transaction_handle *th, struct super_block *p_s_sb, unsigned long nblocks) {
+static int journal_join(struct reiserfs_transaction_handle *th, struct super_block *p_s_sb, unsigned long nblocks) {
return do_journal_begin_r(th, p_s_sb, nblocks, 1) ;
}
@@ -2238,7 +2242,7 @@ int journal_end(struct reiserfs_transaction_handle *th, struct super_block *p_s_
**
** returns 1 if it cleaned and relsed the buffer. 0 otherwise
*/
-int remove_from_transaction(struct super_block *p_s_sb, unsigned long blocknr, int already_cleaned) {
+static int remove_from_transaction(struct super_block *p_s_sb, unsigned long blocknr, int already_cleaned) {
struct buffer_head *bh ;
struct reiserfs_journal_cnode *cn ;
int ret = 0;
@@ -2279,7 +2283,7 @@ int remove_from_transaction(struct super_block *p_s_sb, unsigned long blocknr, i
}
/* removes from a specific journal list hash */
-int remove_from_journal_list(struct super_block *s, struct reiserfs_journal_list *jl, struct buffer_head *bh, int remove_freed) {
+static int remove_from_journal_list(struct super_block *s, struct reiserfs_journal_list *jl, struct buffer_head *bh, int remove_freed) {
remove_journal_hash(SB_JOURNAL(s)->j_list_hash_table, jl, bh, remove_freed) ;
return 0 ;
}
@@ -2341,20 +2345,6 @@ int journal_end_sync(struct reiserfs_transaction_handle *th, struct super_block
int show_reiserfs_locks(void) {
dump_journal_writers() ;
-#if 0 /* debugging code for when we are compiled static don't delete */
- p_s_sb = sb_entry(super_blocks.next);
- while (p_s_sb != sb_entry(&super_blocks)) {
- if (reiserfs_is_super(p_s_sb)) {
-printk("journal lock is %d, join lock is %d, writers %d must wait is %d\n",
- atomic_read(&(SB_JOURNAL(p_s_sb)->j_wlock)),
- atomic_read(&(SB_JOURNAL(p_s_sb)->j_jlock)),
- atomic_read(&(SB_JOURNAL(p_s_sb)->j_wcount)),
- SB_JOURNAL(p_s_sb)->j_must_wait) ;
- printk("used cnodes %d, free cnodes %d\n", SB_JOURNAL(p_s_sb)->j_cnode_used, SB_JOURNAL(p_s_sb)->j_cnode_free) ;
- }
- p_s_sb = sb_entry(p_s_sb->s_list.next);
- }
-#endif
return 0 ;
}
diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c
index 9046956d5..64f2dba60 100644
--- a/fs/reiserfs/lbalance.c
+++ b/fs/reiserfs/lbalance.c
@@ -63,7 +63,7 @@ static void leaf_copy_dir_entries (struct buffer_info * dest_bi, struct buffer_h
/* form item header */
memcpy (&new_ih.ih_key, &ih->ih_key, KEY_SIZE);
- put_ih_version( &new_ih, ITEM_VERSION_1 );
+ put_ih_version( &new_ih, KEY_FORMAT_3_5 );
/* calculate item len */
put_ih_item_len( &new_ih, DEH_SIZE * copy_count + copy_records_len );
put_ih_entry_count( &new_ih, 0 );
@@ -78,7 +78,7 @@ static void leaf_copy_dir_entries (struct buffer_info * dest_bi, struct buffer_h
set_le_ih_k_offset (&new_ih, U32_MAX);
/* this item is not yet valid, but we want I_IS_DIRECTORY_ITEM to return 1 for it, so we -1 */
}
- set_le_key_k_type (ITEM_VERSION_1, &(new_ih.ih_key), TYPE_DIRENTRY);
+ set_le_key_k_type (KEY_FORMAT_3_5, &(new_ih.ih_key), TYPE_DIRENTRY);
}
/* insert item into dest buffer */
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index de5ddcca9..a81e7417b 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -17,17 +17,6 @@
#include <linux/reiserfs_fs.h>
#include <linux/smp_lock.h>
- /* there should be an overview right
- here, as there should be in every
- conceptual grouping of code. This
- should be combined with dir.c and
- called dir.c (naming will become
- too large to be called one file in
- a few years), stop senselessly
- imitating the incoherent
- structuring of code used by other
- filesystems. */
-
#define INC_DIR_INODE_NLINK(i) if (i->i_nlink != 1) { i->i_nlink++; if (i->i_nlink >= REISERFS_LINK_MAX) i->i_nlink=1; }
#define DEC_DIR_INODE_NLINK(i) if (i->i_nlink != 1) i->i_nlink--;
@@ -105,7 +94,7 @@ static inline void store_de_entry_key (struct reiserfs_dir_entry * de)
BUG ();
/* store key of the found entry */
- de->de_entry_key.version = ITEM_VERSION_1;
+ de->de_entry_key.version = KEY_FORMAT_3_5;
de->de_entry_key.on_disk_key.k_dir_id = le32_to_cpu (de->de_ih->ih_key.k_dir_id);
de->de_entry_key.on_disk_key.k_objectid = le32_to_cpu (de->de_ih->ih_key.k_objectid);
set_cpu_key_k_offset (&(de->de_entry_key), deh_offset (deh));
@@ -347,7 +336,7 @@ static int reiserfs_find_entry (struct inode * dir, const char * name, int namel
// at the ext2 code and comparing. It's subfunctions contain no code
// used as a template unless they are so labeled.
//
-struct dentry * reiserfs_lookup (struct inode * dir, struct dentry * dentry)
+static struct dentry * reiserfs_lookup (struct inode * dir, struct dentry * dentry)
{
int retval;
struct inode * inode = 0;
@@ -373,7 +362,6 @@ struct dentry * reiserfs_lookup (struct inode * dir, struct dentry * dentry)
return NULL;
}
-
//
// a portion of this function, particularly the VFS interface portion,
// was derived from minix or ext2's analog and evolved as the
@@ -518,7 +506,7 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in
// at the ext2 code and comparing. It's subfunctions contain no code
// used as a template unless they are so labeled.
//
-int reiserfs_create (struct inode * dir, struct dentry *dentry, int mode)
+static int reiserfs_create (struct inode * dir, struct dentry *dentry, int mode)
{
int retval;
struct inode * inode;
@@ -574,7 +562,7 @@ int reiserfs_create (struct inode * dir, struct dentry *dentry, int mode)
// at the ext2 code and comparing. It's subfunctions contain no code
// used as a template unless they are so labeled.
//
-int reiserfs_mknod (struct inode * dir, struct dentry *dentry, int mode, int rdev)
+static int reiserfs_mknod (struct inode * dir, struct dentry *dentry, int mode, int rdev)
{
int retval;
struct inode * inode;
@@ -629,7 +617,7 @@ int reiserfs_mknod (struct inode * dir, struct dentry *dentry, int mode, int rde
// at the ext2 code and comparing. It's subfunctions contain no code
// used as a template unless they are so labeled.
//
-int reiserfs_mkdir (struct inode * dir, struct dentry *dentry, int mode)
+static int reiserfs_mkdir (struct inode * dir, struct dentry *dentry, int mode)
{
int retval;
struct inode * inode;
@@ -708,17 +696,20 @@ static inline int reiserfs_empty_dir(struct inode *inode) {
// at the ext2 code and comparing. It's subfunctions contain no code
// used as a template unless they are so labeled.
//
-int reiserfs_rmdir (struct inode * dir, struct dentry *dentry)
+static int reiserfs_rmdir (struct inode * dir, struct dentry *dentry)
{
int retval;
struct inode * inode;
int windex ;
struct reiserfs_transaction_handle th ;
- int jbegin_count = JOURNAL_PER_BALANCE_CNT * 3;
+ int jbegin_count;
INITIALIZE_PATH (path);
struct reiserfs_dir_entry de;
+ /* we will be doing 2 balancings and update 2 stat data */
+ jbegin_count = JOURNAL_PER_BALANCE_CNT * 2 + 2;
+
journal_begin(&th, dir->i_sb, jbegin_count) ;
windex = push_journal_writer("reiserfs_rmdir") ;
@@ -762,6 +753,9 @@ int reiserfs_rmdir (struct inode * dir, struct dentry *dentry)
dir->i_blocks = ((dir->i_size + 511) >> 9);
reiserfs_update_sd (&th, dir);
+ /* prevent empty directory from getting lost */
+ add_save_link (&th, inode, 0/* not truncate */);
+
pop_journal_writer(windex) ;
journal_end(&th, dir->i_sb, jbegin_count) ;
reiserfs_check_path(&path) ;
@@ -785,7 +779,7 @@ int reiserfs_rmdir (struct inode * dir, struct dentry *dentry)
// at the ext2 code and comparing. It's subfunctions contain no code
// used as a template unless they are so labeled.
//
-int reiserfs_unlink (struct inode * dir, struct dentry *dentry)
+static int reiserfs_unlink (struct inode * dir, struct dentry *dentry)
{
int retval;
struct inode * inode;
@@ -793,7 +787,13 @@ int reiserfs_unlink (struct inode * dir, struct dentry *dentry)
INITIALIZE_PATH (path);
int windex ;
struct reiserfs_transaction_handle th ;
- int jbegin_count = JOURNAL_PER_BALANCE_CNT * 3;
+ int jbegin_count;
+
+ inode = dentry->d_inode;
+
+ /* in this transaction we can be doing at max two balancings and update
+ two stat datas */
+ jbegin_count = JOURNAL_PER_BALANCE_CNT * 2 + 2;
journal_begin(&th, dir->i_sb, jbegin_count) ;
windex = push_journal_writer("reiserfs_unlink") ;
@@ -803,7 +803,6 @@ int reiserfs_unlink (struct inode * dir, struct dentry *dentry)
retval = -ENOENT;
goto end_unlink;
}
- inode = dentry->d_inode;
reiserfs_update_inode_transaction(inode) ;
reiserfs_update_inode_transaction(dir) ;
@@ -834,6 +833,10 @@ int reiserfs_unlink (struct inode * dir, struct dentry *dentry)
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
reiserfs_update_sd (&th, dir);
+ if (!inode->i_nlink)
+ /* prevent file from getting lost */
+ add_save_link (&th, inode, 0/* not truncate */);
+
pop_journal_writer(windex) ;
journal_end(&th, dir->i_sb, jbegin_count) ;
reiserfs_check_path(&path) ;
@@ -855,7 +858,7 @@ int reiserfs_unlink (struct inode * dir, struct dentry *dentry)
// at the ext2 code and comparing. It's subfunctions contain no code
// used as a template unless they are so labeled.
//
-int reiserfs_symlink (struct inode * dir, struct dentry * dentry, const char * symname)
+static int reiserfs_symlink (struct inode * dir, struct dentry * dentry, const char * symname)
{
int retval;
struct inode * inode;
@@ -932,7 +935,7 @@ int reiserfs_symlink (struct inode * dir, struct dentry * dentry, const char * s
// at the ext2 code and comparing. It's subfunctions contain no code
// used as a template unless they are so labeled.
//
-int reiserfs_link (struct dentry * old_dentry, struct inode * dir, struct dentry * dentry)
+static int reiserfs_link (struct dentry * old_dentry, struct inode * dir, struct dentry * dentry)
{
int retval;
struct inode *inode = old_dentry->d_inode;
@@ -1032,8 +1035,8 @@ static void set_ino_in_dir_entry (struct reiserfs_dir_entry * de, struct key * k
* one path. If it holds 2 or more, it can get into endless waiting in
* get_empty_nodes or its clones
*/
-int reiserfs_rename (struct inode * old_dir, struct dentry *old_dentry,
- struct inode * new_dir, struct dentry *new_dentry)
+static int reiserfs_rename (struct inode * old_dir, struct dentry *old_dentry,
+ struct inode * new_dir, struct dentry *new_dentry)
{
int retval;
INITIALIZE_PATH (old_entry_path);
@@ -1044,8 +1047,13 @@ int reiserfs_rename (struct inode * old_dir, struct dentry *old_dentry,
struct inode * old_inode, * new_inode;
int windex ;
struct reiserfs_transaction_handle th ;
- int jbegin_count = JOURNAL_PER_BALANCE_CNT * 3;
+ int jbegin_count ;
+
+ /* two balancings: old name removal, new name insertion or "save" link,
+ stat data updates: old directory and new directory and maybe block
+ containing ".." of renamed directory */
+ jbegin_count = JOURNAL_PER_BALANCE_CNT * 3 + 3;
old_inode = old_dentry->d_inode;
new_inode = new_dentry->d_inode;
@@ -1096,8 +1104,8 @@ int reiserfs_rename (struct inode * old_dir, struct dentry *old_dentry,
// FIXME: is it possible, that new_inode == 0 here? If yes, it
// is not clear how does ext2 handle that
if (!new_inode) {
- printk ("reiserfs_rename: new entry is found, new inode == 0\n");
- BUG ();
+ reiserfs_panic (old_dir->i_sb,
+ "vs-7050: new entry is found, new inode == 0\n");
}
} else if (retval) {
pop_journal_writer(windex) ;
@@ -1164,13 +1172,6 @@ int reiserfs_rename (struct inode * old_dir, struct dentry *old_dentry,
reiserfs_restore_prepared_buffer (old_inode->i_sb, new_de.de_bh);
if (S_ISDIR(old_inode->i_mode))
reiserfs_restore_prepared_buffer (old_inode->i_sb, dot_dot_de.de_bh);
-#if 0
- // FIXME: do we need this? shouldn't we simply continue?
- run_task_queue(&tq_disk);
- current->policy |= SCHED_YIELD;
- /*current->counter = 0;*/
- schedule();
-#endif
continue;
}
@@ -1195,29 +1196,25 @@ int reiserfs_rename (struct inode * old_dir, struct dentry *old_dentry,
if (new_inode) {
// adjust link number of the victim
if (S_ISDIR(new_inode->i_mode)) {
- DEC_DIR_INODE_NLINK(new_inode)
+ new_inode->i_nlink = 0;
} else {
- new_inode->i_nlink--;
+ new_inode->i_nlink--;
}
new_inode->i_ctime = CURRENT_TIME;
}
if (S_ISDIR(old_inode->i_mode)) {
- //if (dot_dot_de.de_bh) {
- // adjust ".." of renamed directory
+ // adjust ".." of renamed directory
set_ino_in_dir_entry (&dot_dot_de, INODE_PKEY (new_dir));
journal_mark_dirty (&th, new_dir->i_sb, dot_dot_de.de_bh);
-
- DEC_DIR_INODE_NLINK(old_dir)
- if (new_inode) {
- if (S_ISDIR(new_inode->i_mode)) {
- DEC_DIR_INODE_NLINK(new_inode)
- } else {
- new_inode->i_nlink--;
- }
- } else {
- INC_DIR_INODE_NLINK(new_dir)
- }
+
+ if (!new_inode)
+ /* there (in new_dir) was no directory, so it got new link
+ (".." of renamed directory) */
+ INC_DIR_INODE_NLINK(new_dir);
+
+ /* old directory lost one link - ".. " of renamed directory */
+ DEC_DIR_INODE_NLINK(old_dir);
}
// looks like in 2.3.99pre3 brelse is atomic. so we can use pathrelse
@@ -1228,18 +1225,40 @@ int reiserfs_rename (struct inode * old_dir, struct dentry *old_dentry,
// anybody, but it will panic if will not be able to find the
// entry. This needs one more clean up
if (reiserfs_cut_from_item (&th, &old_entry_path, &(old_de.de_entry_key), old_dir, NULL, 0) < 0)
- reiserfs_warning ("vs-: reiserfs_rename: coudl not cut old name. Fsck later?\n");
+ reiserfs_warning ("vs-7060: reiserfs_rename: couldn't not cut old name. Fsck later?\n");
old_dir->i_size -= DEH_SIZE + old_de.de_entrylen;
old_dir->i_blocks = ((old_dir->i_size + 511) >> 9);
reiserfs_update_sd (&th, old_dir);
reiserfs_update_sd (&th, new_dir);
- if (new_inode)
+
+ if (new_inode) {
+ if (new_inode->i_nlink == 0)
+ add_save_link (&th, new_inode, 0/* not truncate */);
reiserfs_update_sd (&th, new_inode);
+ }
pop_journal_writer(windex) ;
journal_end(&th, old_dir->i_sb, jbegin_count) ;
return 0;
}
+
+
+/*
+ * directories can handle most operations...
+ */
+struct inode_operations reiserfs_dir_inode_operations = {
+ //&reiserfs_dir_operations, /* default_file_ops */
+ create: reiserfs_create,
+ lookup: reiserfs_lookup,
+ link: reiserfs_link,
+ unlink: reiserfs_unlink,
+ symlink: reiserfs_symlink,
+ mkdir: reiserfs_mkdir,
+ rmdir: reiserfs_rmdir,
+ mknod: reiserfs_mknod,
+ rename: reiserfs_rename,
+};
+
diff --git a/fs/reiserfs/objectid.c b/fs/reiserfs/objectid.c
index 78e84e750..7ce8d4a54 100644
--- a/fs/reiserfs/objectid.c
+++ b/fs/reiserfs/objectid.c
@@ -162,7 +162,7 @@ void reiserfs_release_objectid (struct reiserfs_transaction_handle *th,
i += 2;
}
- reiserfs_warning ("vs-15010: reiserfs_release_objectid: tried to free free object id (%lu)",
+ reiserfs_warning ("vs-15011: reiserfs_release_objectid: tried to free free object id (%lu)\n",
( long unsigned ) objectid_to_release);
}
diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c
index 5fce65fec..79706e940 100644
--- a/fs/reiserfs/prints.c
+++ b/fs/reiserfs/prints.c
@@ -109,7 +109,7 @@ static void sprintf_de_head( char *buf, struct reiserfs_de_head *deh )
static void sprintf_item_head (char * buf, struct item_head * ih)
{
if (ih) {
- sprintf (buf, "%s", (ih_version (ih) == ITEM_VERSION_2) ? "*NEW* " : "*OLD*");
+ sprintf (buf, "%s", (ih_version (ih) == KEY_FORMAT_3_6) ? "*3.6* " : "*3.5*");
sprintf_le_key (buf + strlen (buf), &(ih->ih_key));
sprintf (buf + strlen (buf), ", item_len %d, item_location %d, "
"free_space(entry_count) %d",
diff --git a/fs/reiserfs/resize.c b/fs/reiserfs/resize.c
index 9fed21369..2d038566c 100644
--- a/fs/reiserfs/resize.c
+++ b/fs/reiserfs/resize.c
@@ -111,7 +111,7 @@ int reiserfs_resize (struct super_block * s, unsigned long block_count_new)
for (i = 0; i < bmap_nr; i++)
bitmap[i] = SB_AP_BITMAP(s)[i];
for (i = bmap_nr; i < bmap_nr_new; i++) {
- bitmap[i] = reiserfs_getblk(s->s_dev, i * s->s_blocksize * 8, s->s_blocksize);
+ bitmap[i] = getblk(s->s_dev, i * s->s_blocksize * 8, s->s_blocksize);
memset(bitmap[i]->b_data, 0, sb->s_blocksize);
reiserfs_test_and_set_le_bit(0, bitmap[i]->b_data);
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
index 9a3eb670d..21a75f4e9 100644
--- a/fs/reiserfs/stree.c
+++ b/fs/reiserfs/stree.c
@@ -225,7 +225,7 @@ inline void le_key2cpu_key (struct cpu_key * to, const struct key * from)
// find out version of the key
to->version = le_key_version (from);
- if (to->version == ITEM_VERSION_1) {
+ if (to->version == KEY_FORMAT_3_5) {
to->on_disk_key.u.k_offset_v1.k_offset = le32_to_cpu (from->u.k_offset_v1.k_offset);
to->on_disk_key.u.k_offset_v1.k_uniqueness = le32_to_cpu (from->u.k_offset_v1.k_uniqueness);
} else {
@@ -604,7 +604,7 @@ static void search_by_key_reada (struct super_block * s, int blocknr)
if (blocknr == 0)
return;
- bh = reiserfs_getblk (s->s_dev, blocknr, s->s_blocksize);
+ bh = getblk (s->s_dev, blocknr, s->s_blocksize);
if (!buffer_uptodate (bh)) {
ll_rw_block (READA, 1, &bh);
@@ -727,7 +727,11 @@ int search_by_key (struct super_block * p_s_sb,
continue;
}
- RFALSE( ! key_in_buffer(p_s_search_path, p_s_key, p_s_sb),
+ /* only check that the key is in the buffer if p_s_key is not
+ equal to the MAX_KEY. Latter case is only possible in
+ "finish_unfinished()" processing during mount. */
+ RFALSE( COMP_KEYS( &MAX_KEY, p_s_key ) &&
+ ! key_in_buffer(p_s_search_path, p_s_key, p_s_sb),
"PAP-5130: key is not in the buffer");
#ifdef CONFIG_REISERFS_CHECK
if ( cur_tb ) {
@@ -917,7 +921,7 @@ static inline int prepare_for_direct_item (struct path * path,
}
// new file gets truncated
- if (inode_items_version (inode) == ITEM_VERSION_2) {
+ if (get_inode_item_key_version (inode) == KEY_FORMAT_3_6) {
//
round_len = ROUND_UP (new_file_length);
/* this was n_new_file_length < le_ih ... */
@@ -1314,8 +1318,8 @@ int reiserfs_delete_item (struct reiserfs_transaction_handle *th,
/* this deletes item which never gets split */
-static void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th,
- struct key * key)
+void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th,
+ struct key * key)
{
struct tree_balance tb;
INITIALIZE_PATH (path);
@@ -1329,13 +1333,13 @@ static void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th,
while (1) {
retval = search_item (th->t_super, &cpu_key, &path);
if (retval == IO_ERROR) {
- reiserfs_warning ("vs-: reiserfs_delete_solid_item: "
+ reiserfs_warning ("vs-5350: reiserfs_delete_solid_item: "
"i/o failure occurred trying to delete %K\n", &cpu_key);
break;
}
if (retval != ITEM_FOUND) {
pathrelse (&path);
- reiserfs_warning ("vs-: reiserfs_delete_solid_item: %k not found",
+ reiserfs_warning ("vs-5355: reiserfs_delete_solid_item: %k not found",
key);
break;
}
@@ -1355,7 +1359,7 @@ static void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th,
}
// IO_ERROR, NO_DISK_SPACE, etc
- reiserfs_warning ("vs-: reiserfs_delete_solid_item: "
+ reiserfs_warning ("vs-5360: reiserfs_delete_solid_item: "
"could not delete %K due to fix_nodes failure\n", &cpu_key);
unfix_nodes (&tb);
break;
@@ -1372,15 +1376,6 @@ void reiserfs_delete_object (struct reiserfs_transaction_handle *th, struct inod
/* for directory this deletes item containing "." and ".." */
reiserfs_do_truncate (th, inode, NULL, 0/*no timestamp updates*/);
- /* delete stat data */
- /* this debug code needs to go away. Trying to find a truncate race
- ** -- clm -- 4/1/2000
- */
-#if 0
- if (inode->i_nlink != 0) {
- reiserfs_warning("clm-4001: deleting inode with link count==%d\n", inode->i_nlink) ;
- }
-#endif
#if defined( USE_INODE_GENERATION_COUNTER )
if( !old_format_only ( th -> t_super ) )
{
@@ -1417,7 +1412,7 @@ static int maybe_indirect_to_direct (struct reiserfs_transaction_handle *th,
*/
if (atomic_read(&p_s_inode->i_count) > 1 ||
!tail_has_to_be_packed (p_s_inode) ||
- !page || p_s_inode->u.reiserfs_i.nopack) {
+ !page || (p_s_inode->u.reiserfs_i.i_flags & i_nopack_mask)) {
// leave tail in an unformatted node
*p_c_mode = M_SKIP_BALANCING;
cut_bytes = n_block_size - (n_new_file_size & (n_block_size - 1));
@@ -1619,7 +1614,7 @@ int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th,
** be flushed before the transaction commits, so we don't need to
** deal with it here.
*/
- p_s_inode->u.reiserfs_i.i_pack_on_close = 0 ;
+ p_s_inode->u.reiserfs_i.i_flags &= ~i_pack_on_close_mask;
}
return n_ret_value;
}
@@ -1628,14 +1623,14 @@ int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th,
static void truncate_directory (struct reiserfs_transaction_handle *th, struct inode * inode)
{
if (inode->i_nlink)
- reiserfs_warning ("vs-5655: truncate_directory: link count != 0");
+ reiserfs_warning ("vs-5655: truncate_directory: link count != 0\n");
- set_le_key_k_offset (ITEM_VERSION_1, INODE_PKEY (inode), DOT_OFFSET);
- set_le_key_k_type (ITEM_VERSION_1, INODE_PKEY (inode), TYPE_DIRENTRY);
+ set_le_key_k_offset (KEY_FORMAT_3_5, INODE_PKEY (inode), DOT_OFFSET);
+ set_le_key_k_type (KEY_FORMAT_3_5, INODE_PKEY (inode), TYPE_DIRENTRY);
reiserfs_delete_solid_item (th, INODE_PKEY (inode));
- set_le_key_k_offset (ITEM_VERSION_1, INODE_PKEY (inode), SD_OFFSET);
- set_le_key_k_type (ITEM_VERSION_1, INODE_PKEY (inode), TYPE_STAT_DATA);
+ set_le_key_k_offset (KEY_FORMAT_3_5, INODE_PKEY (inode), SD_OFFSET);
+ set_le_key_k_type (KEY_FORMAT_3_5, INODE_PKEY (inode), TYPE_STAT_DATA);
}
@@ -1708,6 +1703,7 @@ void reiserfs_do_truncate (struct reiserfs_transaction_handle *th,
pathrelse(&s_search_path);
return;
}
+
/* Update key to search for the last file item. */
set_cpu_key_k_offset (&s_item_key, n_file_size);
@@ -1744,7 +1740,6 @@ void reiserfs_do_truncate (struct reiserfs_transaction_handle *th,
if (update_timestamps) {
p_s_inode->i_mtime = p_s_inode->i_ctime = CURRENT_TIME;
- // FIXME: sd gets wrong size here
}
reiserfs_update_sd(th, p_s_inode) ;
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index f36b63582..3da31d7d1 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -26,6 +26,9 @@
char reiserfs_super_magic_string[] = REISERFS_SUPER_MAGIC_STRING;
char reiser2fs_super_magic_string[] = REISER2FS_SUPER_MAGIC_STRING;
+static int reiserfs_remount (struct super_block * s, int * flags, char * data);
+static int reiserfs_statfs (struct super_block * s, struct statfs * buf);
+
//
// a portion of this function, particularly the VFS interface portion,
// was derived from minix or ext2's analog and evolved as the
@@ -33,7 +36,7 @@ char reiser2fs_super_magic_string[] = REISER2FS_SUPER_MAGIC_STRING;
// at the ext2 code and comparing. It's subfunctions contain no code
// used as a template unless they are so labeled.
//
-void reiserfs_write_super (struct super_block * s)
+static void reiserfs_write_super (struct super_block * s)
{
int dirty = 0 ;
@@ -52,7 +55,7 @@ void reiserfs_write_super (struct super_block * s)
// at the ext2 code and comparing. It's subfunctions contain no code
// used as a template unless they are so labeled.
//
-void reiserfs_write_super_lockfs (struct super_block * s)
+static void reiserfs_write_super_lockfs (struct super_block * s)
{
int dirty = 0 ;
@@ -73,6 +76,247 @@ void reiserfs_unlockfs(struct super_block *s) {
reiserfs_allow_writes(s) ;
}
+extern const struct key MAX_KEY;
+
+
+/* this is used to delete "save link" when there are no items of a
+ file it points to. It can either happen if unlink is completed but
+ "save unlink" removal, or if file has both unlink and truncate
+ pending and as unlink completes first (because key of "save link"
+ protecting unlink is bigger that a key lf "save link" which
+ protects truncate), so there left no items to make truncate
+ completion on */
+static void remove_save_link_only (struct super_block * s, struct key * key)
+{
+ struct reiserfs_transaction_handle th;
+
+ /* we are going to do one balancing */
+ journal_begin (&th, s, JOURNAL_PER_BALANCE_CNT);
+
+ reiserfs_delete_solid_item (&th, key);
+ if (is_direct_le_key (KEY_FORMAT_3_5, key))
+ /* removals are protected by direct items */
+ reiserfs_release_objectid (&th, le32_to_cpu (key->k_objectid));
+
+ journal_end (&th, s, JOURNAL_PER_BALANCE_CNT);
+}
+
+
+/* look for uncompleted unlinks and truncates and complete them */
+static void finish_unfinished (struct super_block * s)
+{
+ INITIALIZE_PATH (path);
+ struct cpu_key max_cpu_key, obj_key;
+ struct key save_link_key;
+ int retval;
+ struct item_head * ih;
+ struct buffer_head * bh;
+ int item_pos;
+ char * item;
+ int done;
+ struct inode * inode;
+ int truncate;
+
+
+ /* compose key to look for "save" links */
+ max_cpu_key.version = KEY_FORMAT_3_5;
+ max_cpu_key.on_disk_key = MAX_KEY;
+ max_cpu_key.key_length = 3;
+
+ done = 0;
+ s -> u.reiserfs_sb.s_is_unlinked_ok = 1;
+ while (1) {
+ retval = search_item (s, &max_cpu_key, &path);
+ if (retval != ITEM_NOT_FOUND) {
+ reiserfs_warning ("vs-2140: finish_unfinished: search_by_key returned %d\n",
+ retval);
+ break;
+ }
+
+ bh = get_last_bh (&path);
+ item_pos = get_item_pos (&path);
+ if (item_pos != B_NR_ITEMS (bh)) {
+ reiserfs_warning ("vs-2060: finish_unfinished: wrong position found\n");
+ break;
+ }
+ item_pos --;
+ ih = B_N_PITEM_HEAD (bh, item_pos);
+
+ if (le32_to_cpu (ih->ih_key.k_dir_id) != MAX_KEY_OBJECTID)
+ /* there are no "save" links anymore */
+ break;
+
+ save_link_key = ih->ih_key;
+ if (is_indirect_le_ih (ih))
+ truncate = 1;
+ else
+ truncate = 0;
+
+ /* reiserfs_iget needs k_dirid and k_objectid only */
+ item = B_I_PITEM (bh, ih);
+ obj_key.on_disk_key.k_dir_id = le32_to_cpu (*(__u32 *)item);
+ obj_key.on_disk_key.k_objectid = le32_to_cpu (ih->ih_key.k_objectid);
+ obj_key.on_disk_key.u.k_offset_v1.k_offset = 0;
+ obj_key.on_disk_key.u.k_offset_v1.k_uniqueness = 0;
+
+ pathrelse (&path);
+
+ inode = reiserfs_iget (s, &obj_key);
+ if (!inode) {
+ /* the unlink almost completed, it just did not manage to remove
+ "save" link and release objectid */
+ reiserfs_warning ("vs-2180: finish_unfinished: iget failed for %K\n",
+ &obj_key);
+ remove_save_link_only (s, &save_link_key);
+ continue;
+ }
+
+ if (!truncate && inode->i_nlink) {
+ /* file is not unlinked */
+ reiserfs_warning ("vs-2185: finish_unfinished: file %K is not unlinked\n",
+ &obj_key);
+ remove_save_link_only (s, &save_link_key);
+ continue;
+ }
+
+ if (truncate) {
+ inode -> u.reiserfs_i.i_flags |= i_link_saved_truncate_mask;
+ /* not completed truncate found. New size was committed together
+ with "save" link */
+ reiserfs_warning ("Truncating %k to %Ld ..",
+ INODE_PKEY (inode), inode->i_size);
+ reiserfs_truncate_file (inode, 0/*don't update modification time*/);
+ remove_save_link (inode, truncate);
+ } else {
+ inode -> u.reiserfs_i.i_flags |= i_link_saved_unlink_mask;
+ /* not completed unlink (rmdir) found */
+ reiserfs_warning ("Removing %k..", INODE_PKEY (inode));
+ /* removal gets completed in iput */
+ }
+
+ iput (inode);
+ reiserfs_warning ("done\n");
+ done ++;
+ }
+ s -> u.reiserfs_sb.s_is_unlinked_ok = 0;
+
+ pathrelse (&path);
+ if (done)
+ reiserfs_warning ("There were %d uncompleted unlinks/truncates. "
+ "Completed\n", done);
+}
+
+/* to protect file being unlinked from getting lost we "safe" link files
+ being unlinked. This link will be deleted in the same transaction with last
+ item of file. mounting the filesytem we scan all these links and remove
+ files which almost got lost */
+void add_save_link (struct reiserfs_transaction_handle * th,
+ struct inode * inode, int truncate)
+{
+ INITIALIZE_PATH (path);
+ int retval;
+ struct cpu_key key;
+ struct item_head ih;
+ __u32 link;
+
+ /* file can only get one "save link" of each kind */
+ RFALSE( truncate &&
+ ( inode -> u.reiserfs_i.i_flags & i_link_saved_truncate_mask ),
+ "saved link already exists for truncated inode %lx",
+ ( long ) inode -> i_ino );
+ RFALSE( !truncate &&
+ ( inode -> u.reiserfs_i.i_flags & i_link_saved_unlink_mask ),
+ "saved link already exists for unlinked inode %lx",
+ ( long ) inode -> i_ino );
+
+ /* setup key of "save" link */
+ key.version = KEY_FORMAT_3_5;
+ key.on_disk_key.k_dir_id = MAX_KEY_OBJECTID;
+ key.on_disk_key.k_objectid = inode->i_ino;
+ if (!truncate) {
+ /* unlink, rmdir, rename */
+ set_cpu_key_k_offset (&key, 1 + inode->i_sb->s_blocksize);
+ set_cpu_key_k_type (&key, TYPE_DIRECT);
+
+ /* item head of "safe" link */
+ make_le_item_head (&ih, &key, key.version, 1 + inode->i_sb->s_blocksize, TYPE_DIRECT,
+ 4/*length*/, 0xffff/*free space*/);
+ } else {
+ /* truncate */
+ set_cpu_key_k_offset (&key, 1);
+ set_cpu_key_k_type (&key, TYPE_INDIRECT);
+
+ /* item head of "safe" link */
+ make_le_item_head (&ih, &key, key.version, 1, TYPE_INDIRECT,
+ 4/*length*/, 0/*free space*/);
+ }
+ key.key_length = 3;
+
+ /* look for its place in the tree */
+ retval = search_item (inode->i_sb, &key, &path);
+ if (retval != ITEM_NOT_FOUND) {
+ reiserfs_warning ("vs-2100: add_save_link:"
+ "search_by_key (%K) returned %d\n", &key, retval);
+ pathrelse (&path);
+ return;
+ }
+
+ /* body of "save" link */
+ link = cpu_to_le32 (INODE_PKEY (inode)->k_dir_id);
+
+ /* put "save" link inot tree */
+ retval = reiserfs_insert_item (th, &path, &key, &ih, (char *)&link);
+ if (retval)
+ reiserfs_warning ("vs-2120: add_save_link: insert_item returned %d\n",
+ retval);
+ else {
+ if( truncate )
+ inode -> u.reiserfs_i.i_flags |= i_link_saved_truncate_mask;
+ else
+ inode -> u.reiserfs_i.i_flags |= i_link_saved_unlink_mask;
+ }
+}
+
+
+/* this opens transaction unlike add_save_link */
+void remove_save_link (struct inode * inode, int truncate)
+{
+ struct reiserfs_transaction_handle th;
+ struct key key;
+
+
+ /* we are going to do one balancing only */
+ journal_begin (&th, inode->i_sb, JOURNAL_PER_BALANCE_CNT);
+
+ /* setup key of "save" link */
+ key.k_dir_id = cpu_to_le32 (MAX_KEY_OBJECTID);
+ key.k_objectid = INODE_PKEY (inode)->k_objectid;
+ if (!truncate) {
+ /* unlink, rmdir, rename */
+ set_le_key_k_offset (KEY_FORMAT_3_5, &key,
+ 1 + inode->i_sb->s_blocksize);
+ set_le_key_k_type (KEY_FORMAT_3_5, &key, TYPE_DIRECT);
+ } else {
+ /* truncate */
+ set_le_key_k_offset (KEY_FORMAT_3_5, &key, 1);
+ set_le_key_k_type (KEY_FORMAT_3_5, &key, TYPE_INDIRECT);
+ }
+
+ if( ( truncate &&
+ ( inode -> u.reiserfs_i.i_flags & i_link_saved_truncate_mask ) ) ||
+ ( !truncate &&
+ ( inode -> u.reiserfs_i.i_flags & i_link_saved_unlink_mask ) ) )
+ reiserfs_delete_solid_item (&th, &key);
+ if (!truncate) {
+ reiserfs_release_objectid (&th, inode->i_ino);
+ inode -> u.reiserfs_i.i_flags &= ~i_link_saved_unlink_mask;
+ } else
+ inode -> u.reiserfs_i.i_flags &= ~i_link_saved_truncate_mask;
+
+ journal_end (&th, inode->i_sb, JOURNAL_PER_BALANCE_CNT);
+}
+
+
//
// a portion of this function, particularly the VFS interface portion,
// was derived from minix or ext2's analog and evolved as the
@@ -80,7 +324,7 @@ void reiserfs_unlockfs(struct super_block *s) {
// at the ext2 code and comparing. It's subfunctions contain no code
// used as a template unless they are so labeled.
//
-void reiserfs_put_super (struct super_block * s)
+static void reiserfs_put_super (struct super_block * s)
{
int i;
struct reiserfs_transaction_handle th ;
@@ -123,6 +367,26 @@ void reiserfs_put_super (struct super_block * s)
return;
}
+/* we don't mark inodes dirty, we just log them */
+static void reiserfs_dirty_inode (struct inode * inode) {
+ struct reiserfs_transaction_handle th ;
+
+ if (inode->i_sb->s_flags & MS_RDONLY) {
+ reiserfs_warning("clm-6006: writing inode %lu on readonly FS\n",
+ inode->i_ino) ;
+ return ;
+ }
+ lock_kernel() ;
+
+ /* this is really only used for atime updates, so they don't have
+ ** to be included in O_SYNC or fsync
+ */
+ journal_begin(&th, inode->i_sb, 1) ;
+ reiserfs_update_sd (&th, inode);
+ journal_end(&th, inode->i_sb, 1) ;
+ unlock_kernel() ;
+}
+
struct super_operations reiserfs_sops =
{
read_inode: reiserfs_read_inode,
@@ -231,7 +495,7 @@ int reiserfs_is_super(struct super_block *s) {
// at the ext2 code and comparing. It's subfunctions contain no code
// used as a template unless they are so labeled.
//
-int reiserfs_remount (struct super_block * s, int * flags, char * data)
+static int reiserfs_remount (struct super_block * s, int * flags, char * data)
{
struct reiserfs_super_block * rs;
struct reiserfs_transaction_handle th ;
@@ -284,6 +548,10 @@ int reiserfs_remount (struct super_block * s, int * flags, char * data)
/* this will force a full flush of all journal lists */
SB_JOURNAL(s)->j_must_wait = 1 ;
journal_end(&th, s, 10) ;
+
+ if (!( *flags & MS_RDONLY ) )
+ finish_unfinished( s );
+
return 0;
}
@@ -608,7 +876,7 @@ int function2code (hashf_t func)
// at the ext2 code and comparing. It's subfunctions contain no code
// used as a template unless they are so labeled.
//
-struct super_block * reiserfs_read_super (struct super_block * s, void * data, int silent)
+static struct super_block * reiserfs_read_super (struct super_block * s, void * data, int silent)
{
int size;
struct inode *root_inode;
@@ -744,6 +1012,10 @@ struct super_block * reiserfs_read_super (struct super_block * s, void * data, i
journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB (s));
journal_end(&th, s, 1) ;
+
+ /* look for files which were to be removed in previous session */
+ finish_unfinished (s);
+
s->s_dirt = 0;
} else {
struct reiserfs_super_block * rs = SB_DISK_SUPER_BLOCK (s);
@@ -792,7 +1064,7 @@ struct super_block * reiserfs_read_super (struct super_block * s, void * data, i
// at the ext2 code and comparing. It's subfunctions contain no code
// used as a template unless they are so labeled.
//
-int reiserfs_statfs (struct super_block * s, struct statfs * buf)
+static int reiserfs_statfs (struct super_block * s, struct statfs * buf)
{
struct reiserfs_super_block * rs = SB_DISK_SUPER_BLOCK (s);
@@ -836,6 +1108,7 @@ static void __exit exit_reiserfs_fs(void)
unregister_filesystem(&reiserfs_fs_type);
}
+
module_init(init_reiserfs_fs) ;
module_exit(exit_reiserfs_fs) ;
diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c
index 775f81cbc..d3734ec8c 100644
--- a/fs/reiserfs/tail_conversion.c
+++ b/fs/reiserfs/tail_conversion.c
@@ -240,7 +240,7 @@ int indirect2direct (struct reiserfs_transaction_handle *th,
/* Set direct item header to insert. */
- make_le_item_head (&s_ih, 0, inode_items_version (p_s_inode), pos1 + 1,
+ make_le_item_head (&s_ih, 0, get_inode_item_key_version (p_s_inode), pos1 + 1,
TYPE_DIRECT, round_tail_len, 0xffff/*ih_free_space*/);
/* we want a pointer to the first byte of the tail in the page.
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h
index 598edbdaf..0cf51b706 100644
--- a/include/asm-i386/cpufeature.h
+++ b/include/asm-i386/cpufeature.h
@@ -40,6 +40,7 @@
#define X86_FEATURE_XMM (0*32+25) /* Streaming SIMD Extensions */
#define X86_FEATURE_XMM2 (0*32+26) /* Streaming SIMD Extensions-2 */
#define X86_FEATURE_SELFSNOOP (0*32+27) /* CPU self snoop */
+#define X86_FEATURE_HT (0*32+28) /* Hyper-Threading */
#define X86_FEATURE_ACC (0*32+29) /* Automatic clock control */
#define X86_FEATURE_IA64 (0*32+30) /* IA-64 processor */
diff --git a/include/asm-i386/msr.h b/include/asm-i386/msr.h
index 11bcb7f29..d3f23faa6 100644
--- a/include/asm-i386/msr.h
+++ b/include/asm-i386/msr.h
@@ -81,6 +81,7 @@
#define MSR_K7_EVNTSEL0 0xC0010000
#define MSR_K7_PERFCTR0 0xC0010004
+#define MSR_K7_HWCR 0xC0010015
/* Centaur-Hauls/IDT defined MSRs. */
#define MSR_IDT_FCR1 0x107
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index bc76210ea..ce81f42c9 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -57,6 +57,9 @@ extern unsigned long phys_cpu_present_map;
extern unsigned long cpu_online_map;
extern volatile unsigned long smp_invalidate_needed;
extern int pic_mode;
+extern int smp_num_siblings;
+extern int cpu_sibling_map[];
+
extern void smp_flush_tlb(void);
extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs);
extern void smp_send_reschedule(int cpu);
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 9a1be8145..eda113f2b 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -52,48 +52,17 @@
*/
- /* Vladimir, what is the story with
- new_get_new_buffer nowadays? I
- want a complete explanation written
- here. */
-
-/* NEW_GET_NEW_BUFFER will try to allocate new blocks better */
-/*#define NEW_GET_NEW_BUFFER*/
-#define OLD_GET_NEW_BUFFER
-
- /* Vladimir, what about this one too? */
-/* if this is undefined, all inode changes get into stat data immediately, if it can be found in RAM */
-#define DIRTY_LATER
-
-/* enable journalling */
-#define ENABLE_JOURNAL
-
#define USE_INODE_GENERATION_COUNTER
-
-#ifdef __KERNEL__
-
-/* #define REISERFS_CHECK */
-
#define REISERFS_PREALLOCATE
-#endif
#define PREALLOCATION_SIZE 8
-/* if this is undefined, all inode changes get into stat data
- immediately, if it can be found in RAM */
-#define DIRTY_LATER
-
-
-/*#define READ_LOCK_REISERFS*/
-
-
/* n must be power of 2 */
#define _ROUND_UP(x,n) (((x)+(n)-1u) & ~((n)-1u))
// to be ok for alpha and others we have to align structures to 8 byte
// boundary.
// FIXME: do not change 4 by anything else: there is code which relies on that
- /* what 4? -Hans */
#define ROUND_UP(x) _ROUND_UP(x,8LL)
/* debug levels. Right now, CONFIG_REISERFS_CHECK means print all debug
@@ -148,22 +117,17 @@ static inline int is_reiserfs_magic_string (const struct reiserfs_super_block *
strlen ( reiser2fs_super_magic_string)));
}
- /* ReiserFS leaves the first 64k unused,
- so that partition labels have enough
- space. If someone wants to write a
- fancy bootloader that needs more than
- 64k, let us know, and this will be
- increased in size. This number must
- be larger than than the largest block
- size on any platform, or code will
- break. -Hans */
+/* ReiserFS leaves the first 64k unused, so that partition labels have
+ enough space. If someone wants to write a fancy bootloader that
+ needs more than 64k, let us know, and this will be increased in size.
+ This number must be larger than than the largest block size on any
+ platform, or code will break. -Hans */
#define REISERFS_DISK_OFFSET_IN_BYTES (64 * 1024)
#define REISERFS_FIRST_BLOCK unused_define
/* the spot for the super in versions 3.5 - 3.5.10 (inclusive) */
#define REISERFS_OLD_DISK_OFFSET_IN_BYTES (8 * 1024)
-
// reiserfs internal error code (used by search_by_key adn fix_nodes))
#define CARRY_ON 0
#define REPEAT_SEARCH -1
@@ -172,53 +136,54 @@ static inline int is_reiserfs_magic_string (const struct reiserfs_super_block *
#define NO_BALANCING_NEEDED (-4)
#define NO_MORE_UNUSED_CONTIGUOUS_BLOCKS (-5)
-//#define SCHEDULE_OCCURRED 1
-//#define PATH_INCORRECT 2
-
-//#define NO_DISK_SPACE (-1)
-
-
-
typedef unsigned long b_blocknr_t;
typedef __u32 unp_t;
- /* who is responsible for this
- completely uncommented struct? */
struct unfm_nodeinfo {
- /* This is what? */
unp_t unfm_nodenum;
- /* now this I know what it is, and
- most of the people on our project
- know what it is, but I bet nobody
- new I hire will have a clue. */
unsigned short unfm_freespace;
};
-/* when reiserfs_file_write is called with a byte count >= MIN_PACK_ON_CLOSE,
-** it sets the inode to pack on close, and when extending the file, will only
-** use unformatted nodes.
-**
-** This is a big speed up for the journal, which is badly hurt by direct->indirect
-** conversions (they must be logged).
-*/
-#define MIN_PACK_ON_CLOSE 512
-
-// this says about version of all items (but stat data) the object
-// consists of
-#define inode_items_version(inode) ((inode)->u.reiserfs_i.i_version)
-
-
- /* This is an aggressive tail suppression policy, I am hoping it
- improves our benchmarks. The principle behind it is that
- percentage space saving is what matters, not absolute space
- saving. This is non-intuitive, but it helps to understand it if
- you consider that the cost to access 4 blocks is not much more
- than the cost to access 1 block, if you have to do a seek and
- rotate. A tail risks a non-linear disk access that is
- significant as a percentage of total time cost for a 4 block file
- and saves an amount of space that is less significant as a
- percentage of space, or so goes the hypothesis. -Hans */
+/* there are two formats of keys: 3.5 and 3.6
+ */
+#define KEY_FORMAT_3_5 0
+#define KEY_FORMAT_3_6 1
+
+/* there are two stat datas */
+#define STAT_DATA_V1 0
+#define STAT_DATA_V2 1
+
+/** this says about version of key of all items (but stat data) the
+ object consists of */
+#define get_inode_item_key_version( inode ) \
+ (((inode)->u.reiserfs_i.i_flags & i_item_key_version_mask) ? KEY_FORMAT_3_6 : KEY_FORMAT_3_5)
+
+#define set_inode_item_key_version( inode, version ) \
+ ({ if((version)==KEY_FORMAT_3_6) \
+ (inode)->u.reiserfs_i.i_flags |= i_item_key_version_mask; \
+ else \
+ (inode)->u.reiserfs_i.i_flags &= ~i_item_key_version_mask; })
+
+#define get_inode_sd_version(inode) \
+ (((inode)->u.reiserfs_i.i_flags & i_stat_data_version_mask) ? STAT_DATA_V2 : STAT_DATA_V1)
+
+#define set_inode_sd_version(inode, version) \
+ ({ if((version)==STAT_DATA_V2) \
+ (inode)->u.reiserfs_i.i_flags |= i_stat_data_version_mask; \
+ else \
+ (inode)->u.reiserfs_i.i_flags &= ~i_stat_data_version_mask; })
+
+/* This is an aggressive tail suppression policy, I am hoping it
+ improves our benchmarks. The principle behind it is that percentage
+ space saving is what matters, not absolute space saving. This is
+ non-intuitive, but it helps to understand it if you consider that the
+ cost to access 4 blocks is not much more than the cost to access 1
+ block, if you have to do a seek and rotate. A tail risks a
+ non-linear disk access that is significant as a percentage of total
+ time cost for a 4 block file and saves an amount of space that is
+ less significant as a percentage of space, or so goes the hypothesis.
+ -Hans */
#define STORE_TAIL_IN_UNFM(n_file_size,n_tail_size,n_block_size) \
(\
(!(n_tail_size)) || \
@@ -246,21 +211,6 @@ struct unfm_nodeinfo {
/***************************************************************************/
//
-// we do support for old format of reiserfs: the problem is to
-// distinuquish keys with 32 bit offset and keys with 60 bit ones. On
-// leaf level we use ih_version of struct item_head (was
-// ih_reserved). For all old items it is set to 0
-// (ITEM_VERSION_1). For new items it is ITEM_VERSION_2. On internal
-// levels we have to know version of item key belongs to.
-//
-#define ITEM_VERSION_1 0
-#define ITEM_VERSION_2 1
-
-
-/* loff_t - long long */
-
-
-//
// directories use this key as well as old files
//
struct offset_v1 {
@@ -341,18 +291,11 @@ struct cpu_key {
indirect2direct conversion */
};
-
-
-
-
-
-
- /* Our function for comparing keys can compare keys of different
- lengths. It takes as a parameter the length of the keys it is to
- compare. These defines are used in determining what is to be
- passed to it as that parameter. */
+/* Our function for comparing keys can compare keys of different
+ lengths. It takes as a parameter the length of the keys it is to
+ compare. These defines are used in determining what is to be passed
+ to it as that parameter. */
#define REISERFS_FULL_KEY_LEN 4
-
#define REISERFS_SHORT_KEY_LEN 2
/* The result of the key compare */
@@ -362,7 +305,6 @@ struct cpu_key {
#define KEY_FOUND 1
#define KEY_NOT_FOUND 0
-
#define KEY_SIZE (sizeof(struct key))
#define SHORT_KEY_SIZE (sizeof (__u32) + sizeof (__u32))
@@ -387,8 +329,6 @@ struct cpu_key {
#define GOTO_PREVIOUS_ITEM 2
#define NAME_FOUND_INVISIBLE 3
-
-
/* Everything in the filesystem is stored as a set of items. The
item head contains the key of the item, its free space (for
indirect items) and specifies the location of the item itself
@@ -396,37 +336,28 @@ struct cpu_key {
struct item_head
{
- struct key ih_key; /* Everything in the tree is found by searching for it based on its key.*/
-
- /* This is bloat, this should be part
- of the item not the item
- header. -Hans */
- union {
- __u16 ih_free_space_reserved; /* The free space in the last unformatted node of an indirect item if this
- is an indirect item. This equals 0xFFFF iff this is a direct item or
- stat data item. Note that the key, not this field, is used to determine
- the item type, and thus which field this union contains. */
- __u16 ih_entry_count; /* Iff this is a directory item, this field equals the number of directory
- entries in the directory item. */
- } __attribute__ ((__packed__)) u;
- __u16 ih_item_len; /* total size of the item body */
- __u16 ih_item_location; /* an offset to the item body within the block */
- /* I thought we were going to use this
- for having lots of item types? Why
- don't you use this for item type
- not item version. That is how you
- talked me into this field a year
- ago, remember? I am still not
- convinced it needs to be 16 bits
- (for at least many years), but at
- least I can sympathize with that
- hope. Change the name from version
- to type, and tell people not to use
- FFFF in case 16 bits is someday too
- small and needs to be extended:-). */
- __u16 ih_version; /* 0 for all old items, 2 for new
- ones. Highest bit is set by fsck
- temporary, cleaned after all done */
+ /* Everything in the tree is found by searching for it based on
+ * its key.*/
+ struct key ih_key;
+ union {
+ /* The free space in the last unformatted node of an
+ indirect item if this is an indirect item. This
+ equals 0xFFFF iff this is a direct item or stat data
+ item. Note that the key, not this field, is used to
+ determine the item type, and thus which field this
+ union contains. */
+ __u16 ih_free_space_reserved;
+ /* Iff this is a directory item, this field equals the
+ number of directory entries in the directory item. */
+ __u16 ih_entry_count;
+ } __attribute__ ((__packed__)) u;
+ __u16 ih_item_len; /* total size of the item body */
+ __u16 ih_item_location; /* an offset to the item body
+ * within the block */
+ __u16 ih_version; /* 0 for all old items, 2 for new
+ ones. Highest bit is set by fsck
+ temporary, cleaned after all
+ done */
} __attribute__ ((__packed__));
/* size of item header */
#define IH_SIZE (sizeof(struct item_head))
@@ -446,8 +377,8 @@ struct item_head
#define unreachable_item(ih) (ih_version(ih) & (1 << 15))
-#define get_ih_free_space(ih) (ih_version (ih) == ITEM_VERSION_2 ? 0 : ih_free_space (ih))
-#define set_ih_free_space(ih,val) put_ih_free_space((ih), ((ih_version(ih) == ITEM_VERSION_2) ? 0 : (val)))
+#define get_ih_free_space(ih) (ih_version (ih) == KEY_FORMAT_3_6 ? 0 : ih_free_space (ih))
+#define set_ih_free_space(ih,val) put_ih_free_space((ih), ((ih_version(ih) == KEY_FORMAT_3_6) ? 0 : (val)))
/* these operate on indirect items, where you've got an array of ints
** at a possibly unaligned location. These are a noop on ia32
@@ -476,6 +407,9 @@ struct item_head
#define V1_DIRENTRY_UNIQUENESS 500
#define V1_ANY_UNIQUENESS 555 // FIXME: comment is required
+extern void reiserfs_warning (const char * fmt, ...);
+/* __attribute__( ( format ( printf, 1, 2 ) ) ); */
+
//
// here are conversion routines
//
@@ -487,14 +421,11 @@ static inline int uniqueness2type (__u32 uniqueness)
case V1_INDIRECT_UNIQUENESS: return TYPE_INDIRECT;
case V1_DIRECT_UNIQUENESS: return TYPE_DIRECT;
case V1_DIRENTRY_UNIQUENESS: return TYPE_DIRENTRY;
+ default:
+ reiserfs_warning( "vs-500: unknown uniqueness %d\n", uniqueness);
+ case V1_ANY_UNIQUENESS:
+ return TYPE_ANY;
}
-/*
- if (uniqueness != V1_ANY_UNIQUENESS) {
- printk ("uniqueness %d\n", uniqueness);
- BUG ();
- }
-*/
- return TYPE_ANY;
}
static inline __u32 type2uniqueness (int type) CONSTF;
@@ -505,15 +436,13 @@ static inline __u32 type2uniqueness (int type)
case TYPE_INDIRECT: return V1_INDIRECT_UNIQUENESS;
case TYPE_DIRECT: return V1_DIRECT_UNIQUENESS;
case TYPE_DIRENTRY: return V1_DIRENTRY_UNIQUENESS;
+ default:
+ reiserfs_warning( "vs-501: unknown type %d\n", type);
+ case TYPE_ANY:
+ return V1_ANY_UNIQUENESS;
}
- /*
- if (type != TYPE_ANY)
- BUG ();
- */
- return V1_ANY_UNIQUENESS;
}
-
//
// key is pointer to on disk key which is stored in le, result is cpu,
// there is no way to get version of object from key, so, provide
@@ -521,7 +450,7 @@ static inline __u32 type2uniqueness (int type)
//
static inline loff_t le_key_k_offset (int version, const struct key * key)
{
- return (version == ITEM_VERSION_1) ?
+ return (version == KEY_FORMAT_3_5) ?
le32_to_cpu( key->u.k_offset_v1.k_offset ) :
offset_v2_k_offset( &(key->u.k_offset_v2) );
}
@@ -533,7 +462,7 @@ static inline loff_t le_ih_k_offset (const struct item_head * ih)
static inline loff_t le_key_k_type (int version, const struct key * key)
{
- return (version == ITEM_VERSION_1) ?
+ return (version == KEY_FORMAT_3_5) ?
uniqueness2type( le32_to_cpu( key->u.k_offset_v1.k_uniqueness)) :
offset_v2_k_type( &(key->u.k_offset_v2) );
}
@@ -546,20 +475,21 @@ static inline loff_t le_ih_k_type (const struct item_head * ih)
static inline void set_le_key_k_offset (int version, struct key * key, loff_t offset)
{
- (version == ITEM_VERSION_1) ?
+ (version == KEY_FORMAT_3_5) ?
(key->u.k_offset_v1.k_offset = cpu_to_le32 (offset)) : /* jdm check */
(set_offset_v2_k_offset( &(key->u.k_offset_v2), offset ));
}
+
+
static inline void set_le_ih_k_offset (struct item_head * ih, loff_t offset)
{
set_le_key_k_offset (ih_version (ih), &(ih->ih_key), offset);
}
-
static inline void set_le_key_k_type (int version, struct key * key, int type)
{
- (version == ITEM_VERSION_1) ?
+ (version == KEY_FORMAT_3_5) ?
(key->u.k_offset_v1.k_uniqueness = cpu_to_le32(type2uniqueness(type))):
(set_offset_v2_k_type( &(key->u.k_offset_v2), type ));
}
@@ -589,21 +519,21 @@ static inline void set_le_ih_k_type (struct item_head * ih, int type)
//
static inline loff_t cpu_key_k_offset (const struct cpu_key * key)
{
- return (key->version == ITEM_VERSION_1) ?
+ return (key->version == KEY_FORMAT_3_5) ?
key->on_disk_key.u.k_offset_v1.k_offset :
key->on_disk_key.u.k_offset_v2.k_offset;
}
static inline loff_t cpu_key_k_type (const struct cpu_key * key)
{
- return (key->version == ITEM_VERSION_1) ?
+ return (key->version == KEY_FORMAT_3_5) ?
uniqueness2type (key->on_disk_key.u.k_offset_v1.k_uniqueness) :
key->on_disk_key.u.k_offset_v2.k_type;
}
static inline void set_cpu_key_k_offset (struct cpu_key * key, loff_t offset)
{
- (key->version == ITEM_VERSION_1) ?
+ (key->version == KEY_FORMAT_3_5) ?
(key->on_disk_key.u.k_offset_v1.k_offset = offset) :
(key->on_disk_key.u.k_offset_v2.k_offset = offset);
}
@@ -611,14 +541,15 @@ static inline void set_cpu_key_k_offset (struct cpu_key * key, loff_t offset)
static inline void set_cpu_key_k_type (struct cpu_key * key, int type)
{
- (key->version == ITEM_VERSION_1) ?
+ (key->version == KEY_FORMAT_3_5) ?
(key->on_disk_key.u.k_offset_v1.k_uniqueness = type2uniqueness (type)):
(key->on_disk_key.u.k_offset_v2.k_type = type);
}
+
static inline void cpu_key_k_offset_dec (struct cpu_key * key)
{
- if (key->version == ITEM_VERSION_1)
+ if (key->version == KEY_FORMAT_3_5)
key->on_disk_key.u.k_offset_v1.k_offset --;
else
key->on_disk_key.u.k_offset_v2.k_offset --;
@@ -761,7 +692,7 @@ struct stat_data_v1
} __attribute__ ((__packed__));
#define SD_V1_SIZE (sizeof(struct stat_data_v1))
-#define stat_data_v1(ih) (ih_version (ih) == ITEM_VERSION_1)
+#define stat_data_v1(ih) (ih_version (ih) == KEY_FORMAT_3_5)
#define sd_v1_mode(sdp) (le16_to_cpu((sdp)->sd_mode))
#define set_sd_v1_mode(sdp,v) ((sdp)->sd_mode = cpu_to_le16(v))
#define sd_v1_nlink(sdp) (le16_to_cpu((sdp)->sd_nlink))
@@ -815,11 +746,11 @@ struct stat_data {
} __attribute__ ((__packed__)) u;
} __attribute__ ((__packed__));
//
-// this is 40 bytes long
+// this is 44 bytes long
//
#define SD_SIZE (sizeof(struct stat_data))
#define SD_V2_SIZE SD_SIZE
-#define stat_data_v2(ih) (ih_version (ih) == ITEM_VERSION_2)
+#define stat_data_v2(ih) (ih_version (ih) == KEY_FORMAT_3_6)
#define sd_v2_mode(sdp) (le16_to_cpu((sdp)->sd_mode))
#define set_sd_v2_mode(sdp,v) ((sdp)->sd_mode = cpu_to_le16(v))
/* sd_reserved */
@@ -949,76 +880,10 @@ struct reiserfs_de_head
#define de_visible(deh) test_bit_unaligned (DEH_Visible, &((deh)->deh_state))
#define de_hidden(deh) !test_bit_unaligned (DEH_Visible, &((deh)->deh_state))
-/* compose directory item containing "." and ".." entries (entries are
- not aligned to 4 byte boundary) */
-/* the last four params are LE */
-static inline void make_empty_dir_item_v1 (char * body,
- __u32 dirid, __u32 objid,
- __u32 par_dirid, __u32 par_objid)
-{
- struct reiserfs_de_head * deh;
-
- memset (body, 0, EMPTY_DIR_SIZE_V1);
- deh = (struct reiserfs_de_head *)body;
-
- /* direntry header of "." */
- put_deh_offset( &(deh[0]), DOT_OFFSET );
- /* these two are from make_le_item_head, and are are LE */
- deh[0].deh_dir_id = dirid;
- deh[0].deh_objectid = objid;
- deh[0].deh_state = 0; /* Endian safe if 0 */
- put_deh_location( &(deh[0]), EMPTY_DIR_SIZE_V1 - strlen( "." ));
- mark_de_visible(&(deh[0]));
-
- /* direntry header of ".." */
- put_deh_offset( &(deh[1]), DOT_DOT_OFFSET);
- /* key of ".." for the root directory */
- /* these two are from the inode, and are are LE */
- deh[1].deh_dir_id = par_dirid;
- deh[1].deh_objectid = par_objid;
- deh[1].deh_state = 0; /* Endian safe if 0 */
- put_deh_location( &(deh[1]), deh_location( &(deh[0]) ) - strlen( ".." ) );
- mark_de_visible(&(deh[1]));
-
- /* copy ".." and "." */
- memcpy (body + deh_location( &(deh[0]) ), ".", 1);
- memcpy (body + deh_location( &(deh[1]) ), "..", 2);
-}
-
-/* compose directory item containing "." and ".." entries */
-static inline void make_empty_dir_item (char * body,
- __u32 dirid, __u32 objid,
- __u32 par_dirid, __u32 par_objid)
-{
- struct reiserfs_de_head * deh;
-
- memset (body, 0, EMPTY_DIR_SIZE);
- deh = (struct reiserfs_de_head *)body;
-
- /* direntry header of "." */
- put_deh_offset( &(deh[0]), DOT_OFFSET );
- /* these two are from make_le_item_head, and are are LE */
- deh[0].deh_dir_id = dirid;
- deh[0].deh_objectid = objid;
- deh[0].deh_state = 0; /* Endian safe if 0 */
- put_deh_location( &(deh[0]), EMPTY_DIR_SIZE - ROUND_UP( strlen( "." ) ) );
- mark_de_visible(&(deh[0]));
-
- /* direntry header of ".." */
- put_deh_offset( &(deh[1]), DOT_DOT_OFFSET );
- /* key of ".." for the root directory */
- /* these two are from the inode, and are are LE */
- deh[1].deh_dir_id = par_dirid;
- deh[1].deh_objectid = par_objid;
- deh[1].deh_state = 0; /* Endian safe if 0 */
- put_deh_location( &(deh[1]), deh_location( &(deh[0])) - ROUND_UP( strlen( ".." ) ) );
- mark_de_visible(&(deh[1]));
-
- /* copy ".." and "." */
- memcpy (body + deh_location( &(deh[0]) ), ".", 1);
- memcpy (body + deh_location( &(deh[1]) ), "..", 2);
-}
-
+extern void make_empty_dir_item_v1 (char * body, __u32 dirid, __u32 objid,
+ __u32 par_dirid, __u32 par_objid);
+extern void make_empty_dir_item (char * body, __u32 dirid, __u32 objid,
+ __u32 par_dirid, __u32 par_objid);
/* array of the entry headers */
/* get item body */
@@ -1059,13 +924,9 @@ static inline int entry_length (const struct buffer_head * bh,
// two entries per block (at least)
//#define REISERFS_MAX_NAME_LEN(block_size)
//((block_size - BLKH_SIZE - IH_SIZE - DEH_SIZE * 2) / 2)
-
-// two entries per block (at least)
#define REISERFS_MAX_NAME_LEN(block_size) 255
-
-
/* this structure is used for operations on directory entries. It is
not a disk structure. */
/* When reiserfs_find_entry or search_by_entry_key find directory
@@ -1258,23 +1119,17 @@ struct path var = {ILLEGAL_PATH_ELEMENT_OFFSET, }
// in in-core inode key is stored on le form
#define INODE_PKEY(inode) ((struct key *)((inode)->u.reiserfs_i.i_key))
-//#define mark_tail_converted(inode) (atomic_set(&((inode)->u.reiserfs_i.i_converted),1))
-//#define unmark_tail_converted(inode) (atomic_set(&((inode)->u.reiserfs_i.i_converted), 0))
-//#define is_tail_converted(inode) (atomic_read(&((inode)->u.reiserfs_i.i_converted)))
-
-
#define MAX_UL_INT 0xffffffff
#define MAX_INT 0x7ffffff
#define MAX_US_INT 0xffff
-///#define TOO_LONG_LENGTH (~0ULL)
-
// reiserfs version 2 has max offset 60 bits. Version 1 - 32 bit offset
#define U32_MAX (~(__u32)0)
+
static inline loff_t max_reiserfs_offset (const struct inode * inode)
{
- if (inode_items_version (inode) == ITEM_VERSION_1)
+ if (get_inode_item_key_version(inode) == KEY_FORMAT_3_5)
return (loff_t)U32_MAX;
return (loff_t)((~(__u64)0) >> 4);
@@ -1307,13 +1162,6 @@ static inline loff_t max_reiserfs_offset (const struct inode * inode)
/* FIXATE NODES */
/***************************************************************************/
-//#define VI_TYPE_STAT_DATA 1
-//#define VI_TYPE_DIRECT 2
-//#define VI_TYPE_INDIRECT 4
-//#define VI_TYPE_DIRECTORY 8
-//#define VI_TYPE_FIRST_DIRECTORY_ITEM 16
-//#define VI_TYPE_INSERTED_DIRECTORY_ITEM 32
-
#define VI_TYPE_LEFT_MERGEABLE 1
#define VI_TYPE_RIGHT_MERGEABLE 2
@@ -1536,11 +1384,7 @@ extern struct item_operations * item_ops [4];
#define COMP_KEYS comp_keys
#define COMP_SHORT_KEYS comp_short_keys
-#define keys_of_same_object comp_short_keys
-
-/*#define COMP_KEYS(p_s_key1, p_s_key2) comp_keys((unsigned long *)(p_s_key1), (unsigned long *)(p_s_key2))
-#define COMP_SHORT_KEYS(p_s_key1, p_s_key2) comp_short_keys((unsigned long *)(p_s_key1), (unsigned long *)(p_s_key2))*/
-
+/*#define keys_of_same_object comp_short_keys*/
/* number of blocks pointed to by the indirect item */
#define I_UNFM_NUM(p_s_ih) ( ih_item_len(p_s_ih) / UNFM_P_SIZE )
@@ -1675,18 +1519,12 @@ int journal_mark_dirty_nolog(struct reiserfs_transaction_handle *, struct super_
int journal_mark_freed(struct reiserfs_transaction_handle *, struct super_block *, unsigned long blocknr) ;
int push_journal_writer(char *w) ;
int pop_journal_writer(int windex) ;
-int journal_lock_dobalance(struct super_block *p_s_sb) ;
-int journal_unlock_dobalance(struct super_block *p_s_sb) ;
int journal_transaction_should_end(struct reiserfs_transaction_handle *, int) ;
int reiserfs_in_journal(struct super_block *p_s_sb, kdev_t dev, unsigned long bl, int size, int searchall, unsigned long *next) ;
int journal_begin(struct reiserfs_transaction_handle *, struct super_block *p_s_sb, unsigned long) ;
-int journal_join(struct reiserfs_transaction_handle *, struct super_block *p_s_sb, unsigned long) ;
struct super_block *reiserfs_get_super(kdev_t dev) ;
void flush_async_commits(struct super_block *p_s_sb) ;
-int remove_from_transaction(struct super_block *p_s_sb, unsigned long blocknr, int already_cleaned) ;
-int remove_from_journal_list(struct super_block *s, struct reiserfs_journal_list *jl, struct buffer_head *bh, int remove_freed) ;
-
int buffer_journaled(const struct buffer_head *bh) ;
int mark_buffer_journal_new(struct buffer_head *bh) ;
int reiserfs_sync_all_buffers(kdev_t dev, int wait) ;
@@ -1725,6 +1563,10 @@ static inline int mark_buffer_notjournal_new(struct buffer_head *bh) {
return 0 ;
}
+void add_save_link (struct reiserfs_transaction_handle * th,
+ struct inode * inode, int truncate);
+void remove_save_link (struct inode * inode, int truncate);
+
/* objectid.c */
__u32 reiserfs_get_unused_objectid (struct reiserfs_transaction_handle *th);
void reiserfs_release_objectid (struct reiserfs_transaction_handle *th, __u32 objectid_to_release);
@@ -1762,16 +1604,16 @@ static inline int le_key_version (const struct key * key)
type = offset_v2_k_type( &(key->u.k_offset_v2));
if (type != TYPE_DIRECT && type != TYPE_INDIRECT && type != TYPE_DIRENTRY)
- return ITEM_VERSION_1;
+ return KEY_FORMAT_3_5;
- return ITEM_VERSION_2;
+ return KEY_FORMAT_3_6;
}
static inline void copy_key (struct key *to, const struct key *from)
{
- memcpy (to, from, KEY_SIZE);
+ memcpy (to, from, KEY_SIZE);
}
@@ -1815,17 +1657,12 @@ int reiserfs_delete_item (struct reiserfs_transaction_handle *th,
struct inode * inode,
struct buffer_head * p_s_un_bh);
-
+void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th,
+ struct key * key);
void reiserfs_delete_object (struct reiserfs_transaction_handle *th, struct inode * p_s_inode);
void reiserfs_do_truncate (struct reiserfs_transaction_handle *th,
struct inode * p_s_inode, struct page *,
int update_timestamps);
-//
-//void lock_inode_to_convert (struct inode * p_s_inode);
-//void unlock_inode_after_convert (struct inode * p_s_inode);
-//void increment_i_read_sync_counter (struct inode * p_s_inode);
-//void decrement_i_read_sync_counter (struct inode * p_s_inode);
-
#define block_size(inode) ((inode)->i_sb->s_blocksize)
#define file_size(inode) ((inode)->i_size)
@@ -1834,19 +1671,18 @@ void reiserfs_do_truncate (struct reiserfs_transaction_handle *th,
#define tail_has_to_be_packed(inode) (!dont_have_tails ((inode)->i_sb) &&\
!STORE_TAIL_IN_UNFM(file_size (inode), tail_size(inode), block_size (inode)))
-/*
-int get_buffer_by_range (struct super_block * p_s_sb, struct key * p_s_range_begin, struct key * p_s_range_end,
- struct buffer_head ** pp_s_buf, unsigned long * p_n_objectid);
-int get_buffers_from_range (struct super_block * p_s_sb, struct key * p_s_range_start, struct key * p_s_range_end,
- struct buffer_head ** p_s_range_buffers,
- int n_max_nr_buffers_to_return);
-*/
-
void padd_item (char * item, int total_length, int length);
-
/* inode.c */
+void reiserfs_read_inode (struct inode * inode) ;
+void reiserfs_read_inode2(struct inode * inode, void *p) ;
+void reiserfs_delete_inode (struct inode * inode);
+void reiserfs_write_inode (struct inode * inode, int) ;
+struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, __u32 *data,
+ int len, int fhtype, int parent);
+int reiserfs_dentry_to_fh(struct dentry *dentry, __u32 *data, int *lenp, int need_parent);
+
int reiserfs_prepare_write(struct file *, struct page *, unsigned, unsigned) ;
void reiserfs_truncate_file(struct inode *, int update_timestamps) ;
void make_cpu_key (struct cpu_key * cpu_key, const struct inode * inode, loff_t offset,
@@ -1854,24 +1690,9 @@ void make_cpu_key (struct cpu_key * cpu_key, const struct inode * inode, loff_t
void make_le_item_head (struct item_head * ih, const struct cpu_key * key,
int version,
loff_t offset, int type, int length, int entry_count);
-/*void store_key (struct key * key);
-void forget_key (struct key * key);*/
-int reiserfs_get_block (struct inode * inode, long block,
- struct buffer_head * bh_result, int create);
struct inode * reiserfs_iget (struct super_block * s,
const struct cpu_key * key);
-void reiserfs_read_inode (struct inode * inode) ;
-void reiserfs_read_inode2(struct inode * inode, void *p) ;
-void reiserfs_delete_inode (struct inode * inode);
-extern int reiserfs_notify_change(struct dentry * dentry, struct iattr * attr);
-void reiserfs_write_inode (struct inode * inode, int) ;
-/* nfsd support functions */
-struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, __u32 *fh, int len, int fhtype, int parent);
-int reiserfs_dentry_to_fh(struct dentry *, __u32 *fh, int *lenp, int need_parent);
-
-/* we don't mark inodes dirty, we just log them */
-void reiserfs_dirty_inode (struct inode * inode) ;
struct inode * reiserfs_new_inode (struct reiserfs_transaction_handle *th,
const struct inode * dir, int mode,
@@ -1879,36 +1700,12 @@ struct inode * reiserfs_new_inode (struct reiserfs_transaction_handle *th,
struct dentry *dentry, struct inode *inode, int * err);
int reiserfs_sync_inode (struct reiserfs_transaction_handle *th, struct inode * inode);
void reiserfs_update_sd (struct reiserfs_transaction_handle *th, struct inode * inode);
-int reiserfs_inode_setattr(struct dentry *, struct iattr * attr);
/* namei.c */
inline void set_de_name_and_namelen (struct reiserfs_dir_entry * de);
int search_by_entry_key (struct super_block * sb, const struct cpu_key * key,
struct path * path,
struct reiserfs_dir_entry * de);
-struct dentry * reiserfs_lookup (struct inode * dir, struct dentry *dentry);
-int reiserfs_create (struct inode * dir, struct dentry *dentry, int mode);
-int reiserfs_mknod (struct inode * dir_inode, struct dentry *dentry, int mode, int rdev);
-int reiserfs_mkdir (struct inode * dir, struct dentry *dentry, int mode);
-int reiserfs_rmdir (struct inode * dir, struct dentry *dentry);
-int reiserfs_unlink (struct inode * dir, struct dentry *dentry);
-int reiserfs_symlink (struct inode * dir, struct dentry *dentry, const char * symname);
-int reiserfs_link (struct dentry * old_dentry, struct inode * dir, struct dentry *dentry);
-int reiserfs_rename (struct inode * old_dir, struct dentry *old_dentry, struct inode * new_dir, struct dentry *new_dentry);
-
-/* super.c */
-inline void reiserfs_mark_buffer_dirty (struct buffer_head * bh, int flag);
-inline void reiserfs_mark_buffer_clean (struct buffer_head * bh);
-void reiserfs_write_super (struct super_block * s);
-void reiserfs_put_super (struct super_block * s);
-int reiserfs_remount (struct super_block * s, int * flags, char * data);
-/*int read_super_block (struct super_block * s, int size);
-int read_bitmaps (struct super_block * s);
-int read_old_bitmaps (struct super_block * s);
-int read_old_super_block (struct super_block * s, int size);*/
-struct super_block * reiserfs_read_super (struct super_block * s, void * data, int silent);
-int reiserfs_statfs (struct super_block * s, struct statfs * buf);
-
/* procfs.c */
#if defined( CONFIG_PROC_FS ) && defined( CONFIG_REISERFS_PROC_INFO )
@@ -2006,8 +1803,6 @@ void free_buffers_in_tb (struct tree_balance * p_s_tb);
/* prints.c */
void reiserfs_panic (struct super_block * s, const char * fmt, ...)
__attribute__ ( ( noreturn ) );/* __attribute__( ( format ( printf, 2, 3 ) ) ) */
-void reiserfs_warning (const char * fmt, ...);
-/* __attribute__( ( format ( printf, 1, 2 ) ) ); */
void reiserfs_debug (struct super_block *s, int level, const char * fmt, ...);
/* __attribute__( ( format ( printf, 3, 4 ) ) ); */
void print_virtual_node (struct virtual_node * vn);
@@ -2100,83 +1895,6 @@ const char *reiserfs_get_version_string(void) CONSTF;
#define reiserfs_test_le_bit ext2_test_bit
#define reiserfs_find_next_zero_le_bit ext2_find_next_zero_bit
-
-//
-// this was totally copied from from linux's
-// find_first_zero_bit and changed a bit
-//
-
-#ifdef __i386__
-
-static __inline__ int
-find_first_nonzero_bit(const void * addr, unsigned size) {
- int res;
- int __d0;
- void *__d1;
-
-
- if (!size) {
- return (0);
- }
- __asm__ __volatile__ (
- "cld\n\t"
- "xorl %%eax,%%eax\n\t"
- "repe; scasl\n\t"
- "je 1f\n\t"
- "movl -4(%%edi),%%eax\n\t"
- "subl $4, %%edi\n\t"
- "bsfl %%eax,%%eax\n\t"
- "1:\tsubl %%edx,%%edi\n\t"
- "shll $3,%%edi\n\t"
- "addl %%edi,%%eax"
- :"=a" (res),
- "=c"(__d0), "=D"(__d1)
- :"1" ((size + 31) >> 5), "d" (addr), "2" (addr));
- return (res);
-}
-
-#else /* __i386__ */
-
-static __inline__ int find_next_nonzero_bit(const void * addr, unsigned size,
- unsigned offset)
-{
- unsigned int * p = ((unsigned int *) addr) + (offset >> 5);
- unsigned int result = offset & ~31UL;
- unsigned int tmp;
-
- if (offset >= size)
- return size;
- size -= result;
- offset &= 31UL;
- if (offset) {
- tmp = *p++;
- /* set to zero first offset bits */
- tmp &= ~(~0UL >> (32-offset));
- if (size < 32)
- goto found_first;
- if (tmp != 0U)
- goto found_middle;
- size -= 32;
- result += 32;
- }
- while (size >= 32) {
- if ((tmp = *p++) != 0U)
- goto found_middle;
- result += 32;
- size -= 32;
- }
- if (!size)
- return result;
- tmp = *p;
-found_first:
-found_middle:
- return result + ffs(tmp);
-}
-
-#define find_first_nonzero_bit(addr,size) find_next_nonzero_bit((addr), (size), 0)
-
-#endif /* 0 */
-
/* sometimes reiserfs_truncate may require to allocate few new blocks
to perform indirect2direct conversion. People probably used to
think, that truncate should work without problems on a filesystem
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h
index 08445c120..6520bcab8 100644
--- a/include/linux/reiserfs_fs_i.h
+++ b/include/linux/reiserfs_fs_i.h
@@ -3,50 +3,47 @@
#include <linux/list.h>
+/** bitmasks for i_flags field in reiserfs-specific part of inode */
+typedef enum {
+ /** this says what format of key do all items (but stat data) of
+ an object have. If this is set, that format is 3.6 otherwise
+ - 3.5 */
+ i_item_key_version_mask = 0x0001,
+ /** If this is unset, object has 3.5 stat data, otherwise, it has
+ 3.6 stat data with 64bit size, 32bit nlink etc. */
+ i_stat_data_version_mask = 0x0002,
+ /** file might need tail packing on close */
+ i_pack_on_close_mask = 0x0004,
+ /** don't pack tail of file */
+ i_nopack_mask = 0x0008,
+ /** If those is set, "safe link" was created for this file during
+ truncate or unlink. Safe link is used to avoid leakage of disk
+ space on crash with some files open, but unlinked. */
+ i_link_saved_unlink_mask = 0x0010,
+ i_link_saved_truncate_mask = 0x0020
+} reiserfs_inode_flags;
+
+
struct reiserfs_inode_info {
- __u32 i_key [4];/* key is still 4 32 bit integers */
+ __u32 i_key [4];/* key is still 4 32 bit integers */
- /* this comment will be totally
- cryptic to readers not familiar
- with 3.5/3.6 format conversion, and
- it does not consider that that 3.6
- might not be the last version */
- int i_version; // this says whether file is old or new
-
- int i_pack_on_close ; // file might need tail packing on close
-
- __u32 i_first_direct_byte; // offset of first byte stored in direct item.
-
- /* My guess is this contains the first
- unused block of a sequence of
- blocks plus the length of the
- sequence, which I think is always
- at least two at the time of the
- preallocation. I really prefer
- allocate on flush conceptually.....
-
- You know, it really annoys me when
- code is this badly commented that I
- have to guess what it does.
- Neither I nor anyone else has time
- for guessing what your
- datastructures mean. -Hans */
- //For preallocation
- int i_prealloc_block;
- int i_prealloc_count;
- struct list_head i_prealloc_list; /* per-transaction list of inodes which
- * have preallocated blocks */
- /* I regret that you think the below
- is a comment you should make.... -Hans */
- //nopack-attribute
- int nopack;
+ /** transient inode flags that are never stored on disk. Bitmasks
+ for this field are defined above. */
+ __u32 i_flags;
+
+ __u32 i_first_direct_byte; // offset of first byte stored in direct item.
+
+ int i_prealloc_block; /* first unused block of a sequence of unused blocks */
+ int i_prealloc_count; /* length of that sequence */
+ struct list_head i_prealloc_list; /* per-transaction list of inodes which
+ * have preallocated blocks */
- /* we use these for fsync or O_SYNC to decide which transaction needs
- ** to be committed in order for this inode to be properly flushed
- */
- unsigned long i_trans_id ;
- unsigned long i_trans_index ;
+ /* we use these for fsync or O_SYNC to decide which transaction
+ ** needs to be committed in order for this inode to be properly
+ ** flushed */
+ unsigned long i_trans_id ;
+ unsigned long i_trans_index ;
};
-
#endif
+
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index fbcfce81e..070eef7b5 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -11,7 +11,7 @@
* swapper address space.
*
* We have to move it here, since not every user of fs.h is including
- * mm.h, but m.h is including fs.h via sched .h :-/
+ * mm.h, but mm.h is including fs.h via sched .h :-/
*/
typedef struct {
unsigned long val;
diff --git a/include/scsi/sg.h b/include/scsi/sg.h
index 26ee7fea2..863b89120 100644
--- a/include/scsi/sg.h
+++ b/include/scsi/sg.h
@@ -11,9 +11,20 @@ Original driver (sg.h):
Version 2 and 3 extensions to driver:
* Copyright (C) 1998 - 2001 Douglas Gilbert
- Version: 3.1.20 (20010814)
+ Version: 3.1.22 (20011128)
This version is for 2.4 series kernels.
+ Changes since 3.1.21 (20011029)
+ - add support for SG_FLAG_MMAP_IO [permit mmap() on sg devices]
+ - update documentation pointers in this header
+ - put KERNEL_VERSION macros around code that breaks early 2.4 series
+ - switch back to alloc_kiovec()
+ Changes since 3.1.20 (20010814)
+ - use alloc_kiovec_sz() to speed dio [set num_buffer_heads==0]
+ - changes to cope with larger scatter gather element sizes
+ - clean up some printk()s
+ - add MODULE_LICENSE("GPL") [in a 3.1.20 subversion]
+ - fix race around generic_unplug_device() [in a 3.1.20 subversion]
Changes since 3.1.19 (20010623)
- add SG_GET_ACCESS_COUNT ioctl
- make open() increment and close() decrement access_count
@@ -33,56 +44,57 @@ Version 2 and 3 extensions to driver:
Map of SG verions to the Linux kernels in which they appear:
---------- ----------------------------------
original all kernels < 2.2.6
- 2.1.38 2.2.16
- 2.1.39 2.2.17 - 2.2.19
+ 2.1.40 2.2.20
3.0.x optional version 3 sg driver for 2.2 series
- 3.1.17 2.4.0 ++
+ 3.1.17++ 2.4.0++
Major new features in SG 3.x driver (cf SG 2.x drivers)
- SG_IO ioctl() combines function if write() and read()
- new interface (sg_io_hdr_t) but still supports old interface
- - scatter/gather in user space and direct IO supported
-
- The term "indirect IO" refers a method by which data is DMAed into kernel
- buffers from the hardware and afterwards is transferred into the user
- space (or vice versa if you are writing). Transfer speeds of up to 20 to
- 30MBytes/sec have been measured using indirect IO. For faster throughputs
- "direct IO" which cuts out the double handling of data is required.
- Direct IO is supported by the SG 3.x drivers on 2.4 series Linux kernels
- and requires the use of the new interface.
-
- Requests for direct IO with the new interface will automatically fall back
- to indirect IO mode if they cannot be fulfilled. An example of such a case
- is an ISA SCSI adapter which is only capable of DMAing to the lower 16MB of
- memory due to the architecture of ISA. The 'info' field in the new
- interface indicates whether a direct or indirect data transfer took place.
-
- Obtaining memory for the kernel buffers used in indirect IO is done by
- first checking if the "reserved buffer" for the current file descriptor
- is available and large enough. If these conditions are _not_ met then
- kernel memory is obtained on a per SCSI command basis. This corresponds
- to a write(), read() sequence or a SG_IO ioctl() call. Further, the
- kernel memory that is suitable for DMA may be constrained by the
- architecture of the SCSI adapter (e.g. ISA adapters).
+ - scatter/gather in user space, direct IO, and mmap supported
+
+ The normal action of this driver is to use the adapter (HBA) driver to DMA
+ data into kernel buffers and then use the CPU to copy the data into the
+ user space (vice versa for writes). That is called "indirect" IO due to
+ the double handling of data. There are two methods offered to remove the
+ redundant copy: 1) direct IO which uses the kernel kiobuf mechanism and
+ 2) using the mmap() system call to map the reserve buffer (this driver has
+ one reserve buffer per fd) into the user space. Both have their advantages.
+ In terms of absolute speed mmap() is faster. If speed is not a concern,
+ indirect IO should be fine. Read the documentation for more information.
** N.B. To use direct IO 'echo 1 > /proc/scsi/sg/allow_dio' may be
needed. That pseudo file's content is defaulted to 0. **
+
+ Historical note: this SCSI pass-through driver has been known as "sg" for
+ a decade. In broader kernel discussions "sg" is used to refer to scatter
+ gather techniques. The context should clarify which "sg" is referred to.
Documentation
=============
- A web site for SG device drivers can be found at:
+ A web site for the SG device driver can be found at:
http://www.torque.net/sg [alternatively check the MAINTAINERS file]
- The main documents are still based on 2.x versions:
+ The documentation for the sg version 3 driver can be found at:
+ http://www.torque.net/sg/p/sg_v3_ho.html
+ This is a rendering from DocBook source [change the extension to "sgml"
+ or "xml"]. There are renderings in "ps", "pdf", "rtf" and "txt" (soon).
+
+ The older, version 2 documents discuss the original sg interface in detail:
http://www.torque.net/sg/p/scsi-generic.txt
http://www.torque.net/sg/p/scsi-generic_long.txt
- Documentation on the changes and additions in 3.x version of the sg driver
- can be found at: http://www.torque.net/sg/p/scsi-generic_v3.txt
A version of this document (potentially out of date) may also be found in
the kernel source tree, probably at:
/usr/src/linux/Documentation/scsi-generic.txt .
- Utility and test programs are available at the sg web site.
+
+ Utility and test programs are available at the sg web site. They are
+ bundled as sg_utils (for the lk 2.2 series) and sg3_utils (for the
+ lk 2.4 series).
+
+ There is a HOWTO on the Linux SCSI subsystem in the lk 2.4 series at:
+ http://www.linuxdoc.org/HOWTO/SCSI-2.4-HOWTO
*/
+
/* New interface introduced in the 3.x SG drivers follows */
typedef struct sg_iovec /* same structure as used by readv() Linux system */
@@ -120,19 +132,20 @@ typedef struct sg_io_hdr
} sg_io_hdr_t; /* 64 bytes long (on i386) */
/* Use negative values to flag difference from original sg_header structure */
-#define SG_DXFER_NONE -1 /* e.g. a SCSI Test Unit Ready command */
-#define SG_DXFER_TO_DEV -2 /* e.g. a SCSI WRITE command */
-#define SG_DXFER_FROM_DEV -3 /* e.g. a SCSI READ command */
-#define SG_DXFER_TO_FROM_DEV -4 /* treated like SG_DXFER_FROM_DEV with the
+#define SG_DXFER_NONE (-1) /* e.g. a SCSI Test Unit Ready command */
+#define SG_DXFER_TO_DEV (-2) /* e.g. a SCSI WRITE command */
+#define SG_DXFER_FROM_DEV (-3) /* e.g. a SCSI READ command */
+#define SG_DXFER_TO_FROM_DEV (-4) /* treated like SG_DXFER_FROM_DEV with the
additional property than during indirect
IO the user buffer is copied into the
kernel buffers before the transfer */
-#define SG_DXFER_UNKNOWN -5 /* Unknown data direction */
+#define SG_DXFER_UNKNOWN (-5) /* Unknown data direction */
/* following flag values can be "or"-ed together */
#define SG_FLAG_DIRECT_IO 1 /* default is indirect IO */
-#define SG_FLAG_LUN_INHIBIT 2 /* default is to put device's lun into */
- /* the 2nd byte of SCSI command */
+#define SG_FLAG_LUN_INHIBIT 2 /* default is overwrite lun in SCSI */
+ /* command block (when <= SCSI_2) */
+#define SG_FLAG_MMAP_IO 4 /* request memory mapped IO */
#define SG_FLAG_NO_DXFER 0x10000 /* no transfer of kernel buffers to/from */
/* user space (debug indirect IO) */
diff --git a/kernel/sched.c b/kernel/sched.c
index db3e42f74..aa3546552 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -262,6 +262,21 @@ send_now_idle:
* a problem.
*/
if (tsk == idle_task(cpu)) {
+#if defined(__i386__) && defined(CONFIG_SMP)
+ /*
+ * Check if two siblings are idle in the same
+ * physical package. Use them if found.
+ */
+ if (smp_num_siblings == 2) {
+ if (cpu_curr(cpu_sibling_map[cpu]) ==
+ idle_task(cpu_sibling_map[cpu])) {
+ oldest_idle = last_schedule(cpu);
+ target_tsk = tsk;
+ break;
+ }
+
+ }
+#endif
if (last_schedule(cpu) < oldest_idle) {
oldest_idle = last_schedule(cpu);
target_tsk = tsk;
diff --git a/mm/shmem.c b/mm/shmem.c
index ddcac7a48..1eb57db74 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1193,7 +1193,7 @@ static struct inode_operations shmem_symlink_inode_operations = {
follow_link: shmem_follow_link,
};
-static int shmem_parse_options(char *options, int *mode, unsigned long * blocks, unsigned long *inodes)
+static int shmem_parse_options(char *options, int *mode, uid_t *uid, gid_t *gid, unsigned long * blocks, unsigned long *inodes)
{
char *this_char, *value, *rest;
@@ -1205,7 +1205,7 @@ static int shmem_parse_options(char *options, int *mode, unsigned long * blocks,
*value++ = 0;
} else {
printk(KERN_ERR
- "shmem_parse_options: No value for option '%s'\n",
+ "tmpfs: No value for mount option '%s'\n",
this_char);
return 1;
}
@@ -1230,8 +1230,20 @@ static int shmem_parse_options(char *options, int *mode, unsigned long * blocks,
*mode = simple_strtoul(value,&rest,8);
if (*rest)
goto bad_val;
+ } else if (!strcmp(this_char,"uid")) {
+ if (!uid)
+ continue;
+ *uid = simple_strtoul(value,&rest,0);
+ if (*rest)
+ goto bad_val;
+ } else if (!strcmp(this_char,"gid")) {
+ if (!gid)
+ continue;
+ *gid = simple_strtoul(value,&rest,0);
+ if (*rest)
+ goto bad_val;
} else {
- printk(KERN_ERR "shmem_parse_options: Bad option %s\n",
+ printk(KERN_ERR "tmpfs: Bad mount option %s\n",
this_char);
return 1;
}
@@ -1239,7 +1251,7 @@ static int shmem_parse_options(char *options, int *mode, unsigned long * blocks,
return 0;
bad_val:
- printk(KERN_ERR "shmem_parse_options: Bad value '%s' for option '%s'\n",
+ printk(KERN_ERR "tmpfs: Bad value '%s' for mount option '%s'\n",
value, this_char);
return 1;
@@ -1251,7 +1263,7 @@ static int shmem_remount_fs (struct super_block *sb, int *flags, char *data)
unsigned long max_blocks = sbinfo->max_blocks;
unsigned long max_inodes = sbinfo->max_inodes;
- if (shmem_parse_options (data, NULL, &max_blocks, &max_inodes))
+ if (shmem_parse_options (data, NULL, NULL, NULL, &max_blocks, &max_inodes))
return -EINVAL;
return shmem_set_size(sbinfo, max_blocks, max_inodes);
}
@@ -1268,6 +1280,8 @@ static struct super_block *shmem_read_super(struct super_block * sb, void * data
struct dentry * root;
unsigned long blocks, inodes;
int mode = S_IRWXUGO | S_ISVTX;
+ uid_t uid = current->fsuid;
+ gid_t gid = current->fsgid;
struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
struct sysinfo si;
@@ -1279,10 +1293,8 @@ static struct super_block *shmem_read_super(struct super_block * sb, void * data
blocks = inodes = si.totalram / 2;
#ifdef CONFIG_TMPFS
- if (shmem_parse_options (data, &mode, &blocks, &inodes)) {
- printk(KERN_ERR "tmpfs invalid option\n");
+ if (shmem_parse_options (data, &mode, &uid, &gid, &blocks, &inodes))
return NULL;
- }
#endif
spin_lock_init (&sbinfo->stat_lock);
@@ -1299,6 +1311,8 @@ static struct super_block *shmem_read_super(struct super_block * sb, void * data
if (!inode)
return NULL;
+ inode->i_uid = uid;
+ inode->i_gid = gid;
root = d_alloc_root(inode);
if (!root) {
iput(inode);