]> git.neil.brown.name Git - history.git/commitdiff
Import 2.3.10pre5 2.3.10pre5
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:26:05 +0000 (15:26 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:26:05 +0000 (15:26 -0500)
191 files changed:
CREDITS
Documentation/networking/baycom.txt
Documentation/networking/cs89x0.txt
Documentation/networking/policy-routing.txt
Documentation/networking/z8530drv.txt
Documentation/pcwd-watchdog.txt
MAINTAINERS
arch/i386/defconfig
arch/mips/kernel/irixioctl.c
arch/sparc/kernel/sunos_ioctl.c
arch/sparc64/config.in
arch/sparc64/defconfig
arch/sparc64/kernel/ioctl32.c
arch/sparc64/kernel/sys_sparc32.c
arch/sparc64/kernel/sys_sunos32.c
arch/sparc64/solaris/ioctl.c
drivers/block/amiflop.c
drivers/block/ataflop.c
drivers/block/cmd646.c
drivers/block/cpqarray.c
drivers/block/cpqarray.h
drivers/block/floppy.c
drivers/block/hd.c
drivers/block/ide-tape.c
drivers/cdrom/aztcd.c
drivers/cdrom/cdu31a.c
drivers/cdrom/cm206.c
drivers/cdrom/gscd.c
drivers/cdrom/isp16.c
drivers/cdrom/mcd.c
drivers/cdrom/mcdx.c
drivers/cdrom/optcd.c
drivers/cdrom/sbpcd.c
drivers/cdrom/sjcd.c
drivers/cdrom/sonycd535.c
drivers/char/Config.in
drivers/char/Makefile
drivers/char/acquirewdt.c
drivers/char/adbmouse.c
drivers/char/amigamouse.c
drivers/char/amikeyb.c
drivers/char/atarimouse.c
drivers/char/atixlmouse.c
drivers/char/busmouse.c
drivers/char/buz.c
drivers/char/console.c
drivers/char/consolemap.c
drivers/char/cyclades.c
drivers/char/dn_keyb.c
drivers/char/dsp56k.c
drivers/char/esp.c
drivers/char/ftape/lowlevel/ftape-init.c
drivers/char/ftape/lowlevel/ftape-proc.c
drivers/char/ftape/lowlevel/ftape-setup.c
drivers/char/ftape/zftape/zftape-init.c
drivers/char/hfmodem/main.c
drivers/char/hfmodem/refclock.c
drivers/char/pcwd.c
drivers/char/tpqic02.c
drivers/i2o/i2o_core.c
drivers/isdn/hisax/amd7930.c
drivers/isdn/hisax/asuscom.c
drivers/isdn/hisax/avm_a1.c
drivers/isdn/hisax/config.c
drivers/isdn/hisax/diva.c
drivers/isdn/hisax/foreign.c
drivers/isdn/hisax/hfc_2bds0.c
drivers/isdn/hisax/hfc_2bs0.c
drivers/isdn/hisax/ix1_micro.c
drivers/isdn/hisax/mic.c
drivers/isdn/hisax/netjet.c
drivers/isdn/hisax/niccy.c
drivers/isdn/hisax/sedlbauer.c
drivers/isdn/hisax/sportster.c
drivers/isdn/hisax/teleint.c
drivers/isdn/hisax/teles0.c
drivers/isdn/hisax/teles3.c
drivers/isdn/hisax/teles3c.c
drivers/misc/parport_ieee1284_ops.c
drivers/net/3c501.c
drivers/net/3c503.c
drivers/net/3c505.c
drivers/net/3c507.c
drivers/net/3c523.c
drivers/net/3c527.c
drivers/net/82596.c
drivers/net/Config.in
drivers/net/Makefile
drivers/net/Space.c
drivers/net/a2065.c
drivers/net/ac3200.c
drivers/net/acenic.c
drivers/net/apne.c
drivers/net/arc-rimi.c
drivers/net/arcnet.c
drivers/net/ariadne.c
drivers/net/ariadne2.c
drivers/net/arlan-proc.c
drivers/net/arlan.c
drivers/net/atari_bionet.c
drivers/net/atari_pamsnet.c
drivers/net/atarilance.c
drivers/net/atp.c
drivers/net/com20020.c
drivers/net/com90io.c
drivers/net/com90xx.c
drivers/net/cops.c
drivers/net/cosa.c
drivers/net/cs89x0.c
drivers/net/de4x5.c
drivers/net/de600.c
drivers/net/de620.c
drivers/net/defxx.c
drivers/net/depca.c
drivers/net/dgrs.c
drivers/net/dlci.c
drivers/net/dummy.c
drivers/net/e2100.c
drivers/net/eexpress.c
drivers/net/es3210.c
drivers/net/ethertap.c
drivers/net/fmv18x.c
drivers/net/hamradio/6pack.c
drivers/net/hamradio/baycom_par.c
drivers/net/hamradio/baycom_ser_fdx.c
drivers/net/hamradio/baycom_ser_hdx.c
drivers/net/hamradio/bpqether.c
drivers/net/hamradio/dmascc.c
drivers/net/hamradio/hdlcdrv.c
drivers/net/hamradio/mkiss.c
drivers/net/hamradio/pi2.c
drivers/net/hamradio/pt.c
drivers/net/hamradio/scc.c
drivers/net/hamradio/soundmodem/sm.c
drivers/net/hp-plus.c
drivers/net/hp.c
drivers/net/hp100.c
drivers/net/hplance.c
drivers/net/hydra.c
drivers/net/ibmtr.c
drivers/net/irda/actisys.c
drivers/net/irda/esi.c
drivers/net/irda/girbil.c
drivers/net/irda/irport.c
drivers/net/irda/irtty.c
drivers/net/irda/litelink.c
drivers/net/irda/pc87108.c
drivers/net/irda/smc-ircc.c
drivers/net/irda/tekram.c
drivers/net/irda/uircc.c
drivers/net/irda/w83977af_ir.c
drivers/net/lance.c
drivers/net/lne390.c
drivers/net/loopback.c
drivers/net/ltpc.c
drivers/net/myri_sbus.c
drivers/net/ne.c
drivers/net/ne2.c
drivers/net/ne3210.c
drivers/net/olympic.c
drivers/net/wavelan.c
drivers/pci/oldproc.c
drivers/scsi/aha152x.c
drivers/scsi/ide-scsi.c
drivers/scsi/sd.c
drivers/sound/sb_ess.c
fs/coda/cache.c
fs/coda/cnode.c
fs/coda/coda_linux.c
fs/coda/dir.c
fs/coda/inode.c
fs/coda/sysctl.c
fs/coda/upcall.c
fs/fat/dir.c
fs/minix/file.c
fs/nfs/read.c
fs/pipe.c
include/linux/coda.h
include/linux/coda_proc.h
include/linux/coda_psdev.h
include/linux/cyclades.h
include/linux/isdn_timru.h [deleted file]
include/linux/mount.h
include/linux/pci.h
mm/filemap.c
mm/memory.c
mm/mlock.c
mm/mmap.c
mm/mprotect.c
mm/mremap.c
net/unix/garbage.c

diff --git a/CREDITS b/CREDITS
index 04a8c9d310894f338f1df1d52491258ed7b534f0..1850a7b29d6ae44c5e6163e655f70602c80409a6 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -163,7 +163,7 @@ D: Driver for WaveFront soundcards (Turtle Beach Maui, Tropez, Tropez+)
 D: Various bugfixes and changes to sound drivers
 S: USA 
 
-M: Krzysztof G. Baranowski
+N: Krzysztof G. Baranowski
 E: kgb@manjak.knm.org.pl
 P: 1024/FA6F16D1 96 D1 1A CF 5F CA 69 EC  F9 4F 36 1F 6D 60 7B DA
 D: Maintainer of the System V file system.
index 8d5bc3566781654ea73572ed54a7caf53b3fc0ea..71e0c76dfde7ee76a0f276d8192a61a0a387825e 100644 (file)
@@ -31,7 +31,7 @@ baycom_par:
   Its devices are called bcp0 through bcp3.
 
 baycom_epp:
-  This driver supports the epp modem.
+  This driver supports the EPP modem.
   Its devices are called bce0 through bce3.
   This driver is work-in-progress.
 
@@ -60,10 +60,10 @@ picpar: This is a redesign of the par96 modem by Henning Rech, DF9IC. The modem
         an additional power supply. Furthermore, it incorporates a carrier
         detect circuitry.
 
-epp:    This is a high speed modem adaptor that connects to an enhanced parallel port.
+EPP:    This is a high-speed modem adaptor that connects to an enhanced parallel port.
         Its target audience is users working over a high speed hub (76.8kbit/s).
 
-eppfpga: This is a redesign of the epp adaptor.
+eppfpga: This is a redesign of the EPP adaptor.
 
 
 
index 839db8eceb5bc0c5a37cb8a17773a741c3b28636..1da37d5ce00b9e1d281039d20e06506cbfe91bd3 100644 (file)
@@ -203,7 +203,7 @@ configuration options are available on the command line:
 * io=###              - specify IO address (200h-360h)
 * irq=##              - specify interrupt level
 * mmode=#####         - specify memory base address
-* dma=#               - specify dma channel
+* dma=#               - specify DMA channel
 * media=rj45          - specify media type
    or media=2
    or media=aui
@@ -412,33 +412,33 @@ its ability to communicate across the ISA bus based on the system resources
 assigned during hardware configuration.  The following tests are performed:
 
    * IO Register Read/Write Test
-     The IO Register Read/Write test insures that the CS8900/20 can be 
+     The IO Register Read/Write test ensures that the CS8900/20 can be 
      accessed in IO mode, and that the IO base address is correct.
 
    * Shared Memory Test
-     The Shared Memory test insures the CS8900/20 can be accessed in memory 
+     The Shared Memory test ensures the CS8900/20 can be accessed in memory 
      mode and that the range of memory addresses assigned does not conflict 
      with other devices in the system.
 
    * Interrupt Test
-     The Interrupt test insures there are no conflicts with the assigned IRQ
+     The Interrupt test ensures there are no conflicts with the assigned IRQ
      signal.
 
    * EEPROM Test
-     The EEPROM test insures the EEPROM can be read.
+     The EEPROM test ensures the EEPROM can be read.
 
    * Chip RAM Test
-     The Chip RAM test insures the 4K of memory internal to the CS8900/20 is
+     The Chip RAM test ensures the 4 K of memory internal to the CS8900/20 is
      working properly.
 
    * Internal Loop-back Test
-     The Internal Loop Back test insures the adapter's transmitter and 
+     The Internal Loop Back test ensures the adapter's transmitter and 
      receiver are operating properly.  If this test fails, make sure the 
      adapter's cable is connected to the network (check for LED activity for 
      example).
 
    * Boot PROM Test
-     The Boot PROM  test insures the Boot PROM is present, and can be read.
+     The Boot PROM test ensures the Boot PROM is present, and can be read.
      Failure indicates the Boot PROM  was not successfully read due to a
      hardware problem or due to a conflicts on the Boot PROM address
      assignment. (Test only applies if the adapter is configured to use the
@@ -564,7 +564,7 @@ Crystal's CS89XX Technical Application Support can be reached at:
 Telephone  :(800) 888-5016 (from inside U.S. and Canada)
            :(512) 442-7555 (from outside the U.S. and Canada)
 Fax       :(512) 912-3871
-Email     :ethernet@crystal.cirrus.com
+E-mail    :ethernet@crystal.cirrus.com
 WWW        :http://www.crystal.com
 
 
index 376dd6e80fa3f260d7ff07403ccb964d6a13230f..36f6936d7f21e5c654c000cc63a276423a93c922 100644 (file)
@@ -83,7 +83,7 @@ Applications
 2.     Opposite case. Just forget all that you know about routing
        tables. Every rule is supplied with its own gateway, device
        info. record. This approach is not appropriate for automated
-       route maintanance, but it is ideal for manual configuration.
+       route maintenance, but it is ideal for manual configuration.
 
        HOWTO:  iproute addrule [ from PREFIX ] [ to PREFIX ] [ tos TOS ]
                [ dev INPUTDEV] [ pref PREFERENCE ] route [ gw GATEWAY ]
index cf7dc609b6c6b1fe2d31475c2c0313361ad94a0d..c74fb4253e6bb50a435b245b5a9240c5bfa954c4 100644 (file)
@@ -252,7 +252,7 @@ device scc0 # the device for the following params
 
 speed 1200             # the default baudrate
 clock dpll             # clock source: 
-                       #       dpll     = normal halfduplex operation
+                       #       dpll     = normal half duplex operation
                        #       external = MODEM provides own Rx/Tx clock
                        #       divider  = use full duplex divider if
                        #                  installed (1)
index 878ca69f337e40a2a75fc153d36954f4527e612b..a586667aa67c72eb0aa36d402dbbaa999272e9f6 100644 (file)
@@ -1,6 +1,6 @@
                      Berkshire Products PC Watchdog Card
                    Support for ISA Cards  Revision A and C
-           Documentation and Driver by Ken Hollis <khollis@nurk.org>
+           Documentation and Driver by Ken Hollis <kenji@bitgate.com>
 
  The PC Watchdog is a card that offers the same type of functionality that
  the WDT card does, only it doesn't require an IRQ to run.  Furthermore,
@@ -15,7 +15,7 @@
  The Watchdog Driver will automatically find your watchdog card, and will
  attach a running driver for use with that card.  After the watchdog
  drivers have initialized, you can then talk to the card using the PC
- Watchdog program, available from ftp.bitgate.com:/pub/bitgate/pcwd.
+ Watchdog program, available from http://ftp.bitgate.com/pcwd/.
 
  I suggest putting a "watchdog -d" before the beginning of an fsck, and
  a "watchdog -e -t 1" immediately after the end of an fsck.  (Remember
@@ -128,4 +128,7 @@ int main(int argc, char *argv[])
  And that's all she wrote!
 
  -- Ken Hollis
-    (khollis@nurk.org)
+    (kenji@bitgate.com)
+
+(This documentation may be out of date.  Check
+ http://ftp.bitgate.com/pcwd/ for the absolute latest additions.)
index 45b782ec90b14087cea722696120b95b6dbfd816..bec26c8da42c3be9fdcdc7d6516c430c61be70a3 100644 (file)
@@ -16,8 +16,8 @@ trivial patch so apply some common sense.
        SMC etherpower for that.)
 
 3.     Make sure your changes compile correctly in multiple
-       configurations. In paticular check changes work both as a module
-       and built into the kernel.
+       configurations. In particular check that changes work both as a
+       module and built into the kernel.
 
 4.     When you are happy with a change make it generally available for
        testing and await feedback.
@@ -28,7 +28,7 @@ trivial patch so apply some common sense.
        and variable names.  These aren't as silly as they seem. One
        job the maintainers (and especially Linus) do is to keep things
        looking the same. Sometimes this means that the clever hack in
-       your driver to get around a problem actual needs to become a
+       your driver to get around a problem actually needs to become a
        generalized kernel feature ready for next time. See 
        Documentation/CodingStyle for guidance here.
 
@@ -49,8 +49,8 @@ trivial patch so apply some common sense.
 
 Maintainers List (try to look for most precise areas first)
 
-Note: For the hard of thinking, this list is meant to remain in Alphabetical
-order. If you could add yourselves to it in Alphabetical order that would
+Note: For the hard of thinking, this list is meant to remain in alphabetical
+order. If you could add yourselves to it in alphabetical order that would
 so much easier [Ed]
 
 P: Person
@@ -163,6 +163,12 @@ L: linux-hams@vger.rutgers.edu
 W:     http://www.ife.ee.ethz.ch/~sailer/ham/ham.html
 S:     Maintained
 
+BERKSHIRE PRODUCTS PC WATCHDOG DRIVER
+P:     Kenji Hollis
+M:     kenji@bitgate.com
+W:     http://ftp.bitgate.com/pcwd/
+S:     Maintained
+
 BUSLOGIC SCSI DRIVER
 P:     Leonard N. Zubkoff
 M:     Leonard N. Zubkoff <lnz@dandelion.com>
@@ -271,6 +277,12 @@ M: mike@i-Connect.Net
 L:     linux-eata@i-connect.net, linux-scsi@vger.rutgers.edu
 S:     Maintained
 
+COMPAQ SMART2 RAID DRIVER
+P:     Charles White   
+M:     Charles White <arrays@compaq.com>
+L:     compaqandlinux@yps.org  
+S:     Maintained
+
 EATA ISA/EISA/PCI SCSI DRIVER
 P:     Dario Ballabio
 M:     dario@milano.europe.dg.com
@@ -579,6 +591,26 @@ M: emoenke@gwdg.de
 L:     linux-kernel@vger.rutgers.edu
 S:     Maintained
 
+OLYMPIC NETWORK DRIVER
+P:     Peter De Shrijver
+M:     p2@ace.ulyssis.sutdent.kuleuven.ac.be   
+P:     Mike Phillips
+M:     phillim@amtrak.com
+L:     linux-net@vger.rutgers.edu
+L:     linux-tr@emissary.aus-etc.com
+W:     http://www.linuxtr.net
+S:     Maintained
+
+OLYMPIC NETWORK DRIVER
+P:     Peter De Shrijver
+M:     p2@ace.ulyssis.sutdent.kuleuven.ac.be   
+P:     Mike Phillips
+M:     phillim@amtrak.com
+L:     linux-net@vger.rutgers.edu
+L:     linux-tr@emissary.aus-etc.com
+W:     http://www.linuxtr.net
+S:     Maintained
+
 OPL3-SA2, SA3, and SAx DRIVER
 P:     Scott Murray
 M:     scottm@interlog.com
@@ -645,7 +677,7 @@ S:  Maintained
 
 REAL TIME CLOCK DRIVER
 P:     Paul Gortmaker
-M      gpg109@rsphy1.anu.edu.au
+M:     gpg109@rsphy1.anu.edu.au
 L:     linux-kernel@vger.rutgers.edu
 S:     Maintained
 
@@ -697,9 +729,10 @@ M: mingo@redhat.com
 S:     Maintained
 
 SMB FILESYSTEM
-P:     Volker Lendecke
-M:     vl@kki.org
-L:     samba@listproc.anu.edu.au
+P:     Andrew Tridgell
+M:     tridge@samba.org
+W:     http://samba.org/
+L:     samba@samba.org
 S:     Maintained
 
 SMP: (except SPARC)
index 881cb153ff81c811a0e3ffa622b6d684b3eae732..3ff204313e5a44e0c3a755f6b8fee92565141d1f 100644 (file)
@@ -212,9 +212,17 @@ CONFIG_SCSI_NCR53C8XX_SYNC=20
 # Network device support
 #
 CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
 # CONFIG_ARCNET is not set
 CONFIG_DUMMY=m
 # CONFIG_EQUALIZER is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
 CONFIG_NET_ETHERNET=y
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_LANCE is not set
@@ -234,14 +242,22 @@ CONFIG_EEXPRESS_PRO100=y
 # CONFIG_VIA_RHINE is not set
 # CONFIG_NET_POCKET is not set
 # CONFIG_FDDI is not set
-# CONFIG_DLCI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 # CONFIG_NET_RADIO is not set
+
+#
+# Token ring devices
+#
 # CONFIG_TR is not set
+
+#
+# Wan interfaces
+#
 # CONFIG_HOSTESS_SV11 is not set
 # CONFIG_COSA is not set
-# CONFIG_RCPCI is not set
+# CONFIG_SEALEVEL_4021 is not set
+# CONFIG_DLCI is not set
 # CONFIG_WAN_DRIVERS is not set
 # CONFIG_LAPBETHER is not set
 # CONFIG_X25_ASY is not set
index 2bb99ef993efd8d7d4dfaaeba0d85f645ed0e400..10ca5b15e8c40c8b3f43ee6994228815cf05e983 100644 (file)
@@ -29,20 +29,21 @@ extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd,
                                unsigned long arg);
 extern asmlinkage int sys_write(unsigned int fd,char * buf,unsigned int count);
 extern void start_tty(struct tty_struct *tty);
-
 static struct tty_struct *get_tty(int fd)
 {
        struct file *filp;
+       struct tty_struct *ttyp = NULL;
 
-       if(!(filp = fcheck(fd)))
-               return ((struct tty_struct *) 0);
-       if(filp->private_data) {
-               struct tty_struct *ttyp = (struct tty_struct *) filp->private_data;
+       read_lock(&current->files->file_lock);
+       filp = fcheck(fd);
+       if(filp && filp->private_data) {
+               ttyp = (struct tty_struct *) filp->private_data;
 
-               if(ttyp->magic == TTY_MAGIC)
-                       return ttyp;
+               if(ttyp->magic != TTY_MAGIC)
+                       ttyp =NULL;
        }
-       return ((struct tty_struct *) 0);
+       read_unlock(&current->files->file_lock);
+       return ttyp;
 }
 
 static struct tty_struct *get_real_tty(struct tty_struct *tp)
index 2f0fe9ed73fc6fe0b9b382b45ff85da28d9bc81a..d85bbe2d915d32eaa823626ee1e737e0955de276 100644 (file)
@@ -36,11 +36,10 @@ extern asmlinkage int sys_setsid(void);
 
 asmlinkage int sunos_ioctl (int fd, unsigned long cmd, unsigned long arg)
 {
-       struct file *filp;
        int ret = -EBADF;
 
        lock_kernel();
-       if (fd >= SUNOS_NR_OPEN || !(filp = current->files->fd [fd]))
+       if (fd >= SUNOS_NR_OPEN || !fcheck(fd))
                goto out;
 
        /* First handle an easy compat. case for tty ldisc. */
index eb192c584be452b92de8b600d47a2f8be4652c02..e03e9b4279a06c8920726dd89e6dbf155ee8eba8 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: config.in,v 1.66 1999/03/29 05:08:42 davem Exp $
+# $Id: config.in,v 1.67 1999/05/01 09:17:37 davem Exp $
 # For a description of the syntax of this configuration file,
 # see the Configure script.
 #
@@ -223,6 +223,16 @@ if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then
 fi
 endmenu
 
+mainmenu_option next_comment
+comment 'Video For Linux'
+tristate 'Video For Linux' CONFIG_VIDEO_DEV
+if [ "$CONFIG_VIDEO_DEV" != "n" ]; then
+  if [ "$CONFIG_PCI" != "n" ]; then
+    dep_tristate 'BT848 Video For Linux' CONFIG_VIDEO_BT848 $CONFIG_VIDEO_DEV
+  fi
+fi
+endmenu
+
 source fs/Config.in
 
 mainmenu_option next_comment
index 9a616445782f6341306caa0308aaaa1d97d6d6c7..6d865228df4c611a3a97f71b1f64d5eff5c47f68 100644 (file)
@@ -263,6 +263,12 @@ CONFIG_VORTEX=m
 CONFIG_UNIX98_PTYS=y
 CONFIG_UNIX98_PTY_COUNT=256
 
+#
+# Video For Linux
+#
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_BT848=y
+
 #
 # Filesystems
 #
index 6759f74d452707b62762e31f79619baa9d4b4fc1..833331202bd7393b9725e46f06a3afd79e7377c3 100644 (file)
@@ -1696,9 +1696,9 @@ asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
        int error = -EBADF;
 
        lock_kernel();
-       filp = fcheck(fd);
+       filp = fget(fd);
        if(!filp)
-               goto out;
+               goto out2;
 
        if (!filp->f_op || !filp->f_op->ioctl) {
                error = sys_ioctl (fd, cmd, arg);
@@ -2381,6 +2381,8 @@ asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
                break;
        }
 out:
+       fput(filp);
+out2:
        unlock_kernel();
        return error;
 }
index cddc73e6835df22cc1a32878e7b5a09554bd0305..5bfc1612b90add43efab673df80c3a244287ab05 100644 (file)
@@ -2324,8 +2324,8 @@ static void scm_detach_fds32(struct msghdr *kmsg, struct scm_cookie *scm)
                        break;
                }
                /* Bump the usage count and install the file. */
-               atomic_inc(&fp[i]->f_count);
-               current->files->fd[new_fd] = fp[i];
+               get_file(fp[i]);
+               fd_install(new_fd, fp[i]);
        }
 
        if (i > 0) {
index b6b58c30a0e1207e442210bb9a0aa2f540d0160f..8b01df62d8a87e1a1527889a68b75a9a2ba42706 100644 (file)
@@ -711,7 +711,7 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr)
        struct inode  *inode;
        struct file   *file;
 
-       file = current->files->fd [fd];
+       file = fcheck(fd);
        if(!file)
                return 0;
 
index 9f1c0f4d14505a428714b31c99d97a1bdbf1d61b..82a583c29249e6c8fc93819631914b43a0dac0f9 100644 (file)
@@ -367,15 +367,8 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
 static inline int solaris_timod(unsigned int fd, unsigned int cmd, u32 arg,
                                     int len, int *len_p)
 {
-        struct file *filp;
         struct inode *ino;
        int ret;
-
-        filp = current->files->fd[fd];
-        if (! filp ||
-           ! (ino = filp->f_dentry->d_inode) ||
-           ! ino->i_sock)
-               return TBADF;
                
        switch (cmd & 0xff) {
        case 141: /* TI_OPTMGMT */
@@ -459,7 +452,7 @@ static inline int solaris_timod(unsigned int fd, unsigned int cmd, u32 arg,
        return TNOTSUPPORT;
 }
 
-static inline int solaris_S(unsigned int fd, unsigned int cmd, u32 arg)
+static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd, u32 arg)
 {
        char *p;
        int ret;
@@ -470,9 +463,7 @@ static inline int solaris_S(unsigned int fd, unsigned int cmd, u32 arg)
         struct sol_socket_struct *sock;
         struct module_info *mi;
 
-        filp = current->files->fd[fd];
-        if (! filp ||
-           ! (ino = filp->f_dentry->d_inode) ||
+        if (! (ino = filp->f_dentry->d_inode) ||
            ! ino->i_sock)
                return -EBADF;
         sock = filp->private_data;
@@ -696,14 +687,14 @@ asmlinkage int solaris_ioctl(unsigned int fd, unsigned int cmd, u32 arg)
        struct file *filp;
        int error = -EBADF;
 
-       lock_kernel();
-       filp = fcheck(fd);
+       filp = fget(fd);
        if (!filp)
                goto out;
 
+       lock_kernel();
        error = -EFAULT;
        switch ((cmd >> 8) & 0xff) {
-       case 'S': error = solaris_S(fd, cmd, arg); break;
+       case 'S': error = solaris_S(filp, fd, cmd, arg); break;
        case 'T': error = solaris_T(fd, cmd, arg); break;
        case 'i': error = solaris_i(fd, cmd, arg); break;
        case 'r': error = solaris_r(fd, cmd, arg); break;
@@ -714,6 +705,8 @@ asmlinkage int solaris_ioctl(unsigned int fd, unsigned int cmd, u32 arg)
                error = -ENOSYS;
                break;
        }
+       unlock_kernel();
+       fput(filp);
 out:
        if (error == -ENOSYS) {
                unsigned char c = cmd>>8;
@@ -723,6 +716,5 @@ out:
                       (int)fd, (unsigned int)cmd, c, (unsigned int)arg);
                error = -EINVAL;
        }
-       unlock_kernel();
        return error;
 }
index 27ad0ec758da1c1796d6d1eb6193f12cc64755b3..8e3459d3f4191ac00f08b526e894d3f0a5196030 100644 (file)
@@ -1755,13 +1755,13 @@ static struct file_operations floppy_fops = {
        NULL,                   /* revalidate */
 };
 
-__initfunc(void amiga_floppy_setup (char *str, int *ints))
+void __init amiga_floppy_setup (char *str, int *ints)
 {
        printk (KERN_INFO "amiflop: Setting default df0 to %x\n", ints[1]);
        fd_def_df0 = ints[1];
 }
 
-__initfunc(static int fd_probe_drives(void))
+static int __init fd_probe_drives(void)
 {
        int drive,drives,nomem;
 
@@ -1791,7 +1791,7 @@ __initfunc(static int fd_probe_drives(void))
        return -ENOMEM;
 }
 
-__initfunc(int amiga_floppy_init(void))
+int __init amiga_floppy_init(void)
 {
   int i;
 
index f105efd6873f854cfc97e82451b0f93f065a55b4..cf408b8c79765caa67af4305e13ddf6c8769bda7 100644 (file)
@@ -1771,7 +1771,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
 
 /* Initialize the 'unit' variable for drive 'drive' */
 
-__initfunc(static void fd_probe( int drive ))
+static void __init fd_probe( int drive )
 {
        UD.connected = 0;
        UDT  = NULL;
@@ -1814,7 +1814,7 @@ __initfunc(static void fd_probe( int drive ))
  * declared absent.
  */
 
-__initfunc(static int fd_test_drive_present( int drive ))
+static int __init fd_test_drive_present( int drive )
 {
        unsigned long timeout;
        unsigned char status;
@@ -1861,7 +1861,7 @@ __initfunc(static int fd_test_drive_present( int drive ))
  * floppies, additionally start the disk-change and motor-off timers.
  */
 
-__initfunc(static void config_types( void ))
+static void __init config_types( void )
 {
        int drive, cnt = 0;
 
@@ -2006,7 +2006,7 @@ static struct file_operations floppy_fops = {
        floppy_revalidate,      /* revalidate */
 };
 
-__initfunc(int atari_floppy_init (void))
+int __init atari_floppy_init (void)
 {
        int i;
 
@@ -2075,7 +2075,7 @@ __initfunc(int atari_floppy_init (void))
 }
 
 
-__initfunc(void atari_floppy_setup( char *str, int *ints ))
+void __init atari_floppy_setup( char *str, int *ints )
 {
        int i;
        
index 1a1d5a7335911d06f62d27bea879e3d1cfa5ec73..52e5725076963a456c10dee8bad3a7d2766515af 100644 (file)
@@ -240,7 +240,7 @@ static int cmd646_1_dmaproc(ide_dma_action_t func, ide_drive_t *drive)
        return cmd646_dmaproc(func, drive);
 }
 
-__initfunc(void ide_init_cmd646 (ide_hwif_t *hwif))
+void __init ide_init_cmd646 (ide_hwif_t *hwif)
 {
        struct pci_dev *dev = hwif->pci_dev;
        unsigned char mrdmode;
index 6dbb7511b3cb5e6150e8c34546ad17848f8a40ab..7aeff3bfb4a3b0ece7651ce647a9fa49c72fd2cb 100644 (file)
@@ -22,7 +22,6 @@
  *    driver, you'll probably need the Compaq Array Controller Interface
  *    Specificiation (Document number ECG086/1198)
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/types.h>
index 457d44a6e76f9381d130e93e3e9a6ae5ed3e61ea..fa51d3dee4021fa66b86b64d5f29c3775fac4781 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/blkdev.h>
 #include <linux/locks.h>
 #include <linux/malloc.h>
-#include <linux/config.h>
 #include <linux/proc_fs.h>
 #include <linux/md.h>
 #include <linux/timer.h>
index 7cfb115b93e96a456f53d568ea0cec7b6c4405c6..3580b67bfaaed3285934b9d29bf8c60d005421e6 100644 (file)
@@ -3896,7 +3896,7 @@ static struct file_operations floppy_fops = {
 
 /* Determine the floppy disk controller type */
 /* This routine was written by David C. Niemi */
-__initfunc(static char get_fdc_version(void))
+static char __init get_fdc_version(void)
 {
        int r;
 
@@ -3974,7 +3974,7 @@ __initfunc(static char get_fdc_version(void))
 
 /* lilo configuration */
 
-__initfunc(static void floppy_set_flags(int *ints,int param, int param2))
+static void __init floppy_set_flags(int *ints,int param, int param2)
 {
        int i;
 
@@ -3987,7 +3987,7 @@ __initfunc(static void floppy_set_flags(int *ints,int param, int param2))
        DPRINT("%s flag 0x%x\n", param2 ? "Setting" : "Clearing", param);
 }
 
-__initfunc(static void daring(int *ints,int param, int param2))
+static void __init daring(int *ints,int param, int param2)
 {
        int i;
 
@@ -4003,7 +4003,7 @@ __initfunc(static void daring(int *ints,int param, int param2))
        DPRINT("Assuming %s floppy hardware\n", param ? "standard" : "broken");
 }
 
-__initfunc(static void set_cmos(int *ints, int dummy, int dummy2))
+static void __init set_cmos(int *ints, int dummy, int dummy2)
 {
        int current_drive=0;
 
@@ -4063,7 +4063,7 @@ static struct param_table {
        { "L40SX", 0, &print_unex, 0, 0 } };
 
 #define FLOPPY_SETUP
-__initfunc(void floppy_setup(char *str, int *ints))
+void __init floppy_setup(char *str, int *ints)
 {
        int i;
        int param;
@@ -4101,7 +4101,7 @@ __initfunc(void floppy_setup(char *str, int *ints))
 static int have_no_fdc= -EIO;
 
 
-__initfunc(int floppy_init(void))
+int __init floppy_init(void)
 {
        int i,unit,drive;
 
@@ -4362,7 +4362,7 @@ extern char *get_options(char *str, int *ints);
 
 char *floppy=NULL;
 
-__initfunc(static void parse_floppy_cfg_string(char *cfg))
+static void __init parse_floppy_cfg_string(char *cfg)
 {
        char *ptr;
        int ints[11];
@@ -4378,7 +4378,7 @@ __initfunc(static void parse_floppy_cfg_string(char *cfg))
        }
 }
 
-__initfunc(static void mod_setup(char *pattern, void (*setup)(char *, int *)))
+static void __init mod_setup(char *pattern, void (*setup)(char *, int *))
 {
        unsigned long i;
        char c;
index f01d7475d5bd4ae7b23b80ea1887ec138eee376f..164835bfc1613e4e63f0c03e0a308fddfc270e91 100644 (file)
@@ -113,7 +113,7 @@ unsigned long read_timer(void)
 }
 #endif
 
-__initfunc(void hd_setup(char *str, int *ints))
+void __init hd_setup(char *str, int *ints)
 {
        int hdind = 0;
 
@@ -783,7 +783,7 @@ static struct file_operations hd_fops = {
        block_fsync             /* fsync */
 };
 
-__initfunc(int hd_init(void))
+int __init hd_init(void)
 {
        if (register_blkdev(MAJOR_NR,"hd",&hd_fops)) {
                printk("hd: unable to get major %d for hard disk\n",MAJOR_NR);
index 74c89cff011bd9f846d82bd4013fe33e892d41b7..ed278655ea90250c66db4f7d9a6b9f08f5f2bd26 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * linux/drivers/block/ide-tape.c      Version 1.14            Dec  30, 1998
+ * linux/drivers/block/ide-tape.c      Version 1.15            Jul   4, 1999
  *
- * Copyright (C) 1995 - 1998 Gadi Oxman <gadio@netvision.net.il>
+ * Copyright (C) 1995 - 1999 Gadi Oxman <gadio@netvision.net.il>
  *
  * This driver was constructed as a student project in the software laboratory
  * of the faculty of electrical engineering in the Technion - Israel's
  * Ver 1.13  Jan  2 98   Add "speed == 0" work-around for HP COLORADO 5GB
  * Ver 1.14  Dec 30 98   Partial fixes for the Sony/AIWA tape drives.
  *                       Replace cli()/sti() with hwgroup spinlocks.
+ * Ver 1.15  Mar 25 99   Fix SMP race condition by replacing hwgroup
+ *                        spinlock with private per-tape spinlock.
+ *                       Fix use of freed memory.
  *
  * Here are some words from the first releases of hd.c, which are quoted
  * in ide.c and apply here as well:
@@ -697,6 +700,7 @@ typedef struct {
        int excess_bh_size;                     /* Wasted space in each stage */
 
        unsigned int flags;                     /* Status/Action flags */
+       spinlock_t spinlock;                    /* protects the ide-tape queue */
 } idetape_tape_t;
 
 /*
@@ -1443,7 +1447,7 @@ static void idetape_add_stage_tail (ide_drive_t *drive,idetape_stage_t *stage)
 #if IDETAPE_DEBUG_LOG
        printk (KERN_INFO "Reached idetape_add_stage_tail\n");
 #endif /* IDETAPE_DEBUG_LOG */
-       spin_lock_irqsave(&HWGROUP(drive)->spinlock, flags);
+       spin_lock_irqsave(&tape->spinlock, flags);
        stage->next=NULL;
        if (tape->last_stage != NULL)
                tape->last_stage->next=stage;
@@ -1454,7 +1458,7 @@ static void idetape_add_stage_tail (ide_drive_t *drive,idetape_stage_t *stage)
                tape->next_stage=tape->last_stage;
        tape->nr_stages++;
        tape->nr_pending_stages++;
-       spin_unlock_irqrestore(&HWGROUP(drive)->spinlock, flags);
+       spin_unlock_irqrestore(&tape->spinlock, flags);
 }
 
 /*
@@ -1556,7 +1560,9 @@ static void idetape_end_request (byte uptodate, ide_hwgroup_t *hwgroup)
        ide_drive_t *drive = hwgroup->drive;
        struct request *rq = hwgroup->rq;
        idetape_tape_t *tape = drive->driver_data;
+       unsigned long flags;
        int error;
+       int remove_stage = 0;
 
 #if IDETAPE_DEBUG_LOG
        printk (KERN_INFO "Reached idetape_end_request\n");
@@ -1571,6 +1577,7 @@ static void idetape_end_request (byte uptodate, ide_hwgroup_t *hwgroup)
        if (error)
                tape->failed_pc = NULL;
 
+       spin_lock_irqsave(&tape->spinlock, flags);
        if (tape->active_data_request == rq) {          /* The request was a pipelined data transfer request */
                tape->active_stage = NULL;
                tape->active_data_request = NULL;
@@ -1581,7 +1588,7 @@ static void idetape_end_request (byte uptodate, ide_hwgroup_t *hwgroup)
                                if (error == IDETAPE_ERROR_EOD)
                                        idetape_abort_pipeline (drive);
                        }
-                       idetape_remove_stage_head (drive);
+                       remove_stage = 1;
                }
                if (tape->next_stage != NULL) {
                        idetape_active_next_stage (drive);
@@ -1599,6 +1606,9 @@ static void idetape_end_request (byte uptodate, ide_hwgroup_t *hwgroup)
                        idetape_increase_max_pipeline_stages (drive);
        }
        ide_end_drive_cmd (drive, 0, 0);
+       if (remove_stage)
+               idetape_remove_stage_head (drive);
+       spin_unlock_irqrestore(&tape->spinlock, flags);
 }
 
 /*
@@ -2340,6 +2350,7 @@ static int idetape_queue_pc_tail (ide_drive_t *drive,idetape_pc_t *pc)
 static void idetape_wait_for_request (ide_drive_t *drive, struct request *rq)
 {
        DECLARE_MUTEX_LOCKED(sem);
+       idetape_tape_t *tape = drive->driver_data;
 
 #if IDETAPE_DEBUG_BUGS
        if (rq == NULL || !IDETAPE_RQ_CMD (rq->cmd)) {
@@ -2348,9 +2359,9 @@ static void idetape_wait_for_request (ide_drive_t *drive, struct request *rq)
        }
 #endif /* IDETAPE_DEBUG_BUGS */
        rq->sem = &sem;
-       spin_unlock(&HWGROUP(drive)->spinlock);
+       spin_unlock(&tape->spinlock);
        down(&sem);
-       spin_lock_irq(&HWGROUP(drive)->spinlock);
+       spin_lock_irq(&tape->spinlock);
 }
 
 /*
@@ -2424,10 +2435,10 @@ static int idetape_add_chrdev_read_request (ide_drive_t *drive,int blocks)
                 */
                return (idetape_queue_rw_tail (drive, IDETAPE_READ_RQ, blocks, tape->merge_stage->bh));
        }
-       spin_lock_irqsave(&HWGROUP(drive)->spinlock, flags);
+       spin_lock_irqsave(&tape->spinlock, flags);
        if (tape->active_stage == tape->first_stage)
                idetape_wait_for_request(drive, tape->active_data_request);
-       spin_unlock_irqrestore(&HWGROUP(drive)->spinlock, flags);
+       spin_unlock_irqrestore(&tape->spinlock, flags);
 
        rq_ptr = &tape->first_stage->rq;
        bytes_read = tape->tape_block_size * (rq_ptr->nr_sectors - rq_ptr->current_nr_sectors);
@@ -2476,12 +2487,12 @@ static int idetape_add_chrdev_write_request (ide_drive_t *drive, int blocks)
         *      Pay special attention to possible race conditions.
         */
        while ((new_stage = idetape_kmalloc_stage (tape)) == NULL) {
-               spin_lock_irqsave(&HWGROUP(drive)->spinlock, flags);
+               spin_lock_irqsave(&tape->spinlock, flags);
                if (idetape_pipeline_active (tape)) {
                        idetape_wait_for_request(drive, tape->active_data_request);
-                       spin_unlock_irqrestore(&HWGROUP(drive)->spinlock, flags);
+                       spin_unlock_irqrestore(&tape->spinlock, flags);
                } else {
-                       spin_unlock_irqrestore(&HWGROUP(drive)->spinlock, flags);
+                       spin_unlock_irqrestore(&tape->spinlock, flags);
                        idetape_insert_pipeline_into_queue (drive);
                        if (idetape_pipeline_active (tape))
                                continue;
@@ -2538,11 +2549,11 @@ static void idetape_discard_read_pipeline (ide_drive_t *drive)
        if (tape->first_stage == NULL)
                return;
 
-       spin_lock_irqsave(&HWGROUP(drive)->spinlock, flags);
+       spin_lock_irqsave(&tape->spinlock, flags);
        tape->next_stage = NULL;
        if (idetape_pipeline_active (tape))
                idetape_wait_for_request(drive, tape->active_data_request);
-       spin_unlock_irqrestore(&HWGROUP(drive)->spinlock, flags);
+       spin_unlock_irqrestore(&tape->spinlock, flags);
 
        while (tape->first_stage != NULL)
                idetape_remove_stage_head (drive);
@@ -2562,7 +2573,7 @@ static void idetape_wait_for_pipeline (ide_drive_t *drive)
        if (!idetape_pipeline_active (tape))
                idetape_insert_pipeline_into_queue (drive);
 
-       spin_lock_irqsave(&HWGROUP(drive)->spinlock, flags);
+       spin_lock_irqsave(&tape->spinlock, flags);
        if (!idetape_pipeline_active (tape))
                goto abort;
 #if IDETAPE_DEBUG_BUGS
@@ -2572,7 +2583,7 @@ static void idetape_wait_for_pipeline (ide_drive_t *drive)
 #endif /* IDETAPE_DEBUG_BUGS */
        idetape_wait_for_request(drive, &tape->last_stage->rq);
 abort:
-       spin_unlock_irqrestore(&HWGROUP(drive)->spinlock, flags);
+       spin_unlock_irqrestore(&tape->spinlock, flags);
 }
 
 static void idetape_pad_zeros (ide_drive_t *drive, int bcount)
@@ -2817,10 +2828,10 @@ static int idetape_space_over_filemarks (ide_drive_t *drive,short mt_op,int mt_c
                         *      Wait until the first read-ahead request
                         *      is serviced.
                         */
-                       spin_lock_irqsave(&HWGROUP(drive)->spinlock, flags);
+                       spin_lock_irqsave(&tape->spinlock, flags);
                        if (tape->active_stage == tape->first_stage)
                                idetape_wait_for_request(drive, tape->active_data_request);
-                       spin_unlock_irqrestore(&HWGROUP(drive)->spinlock, flags);
+                       spin_unlock_irqrestore(&tape->spinlock, flags);
 
                        if (tape->first_stage->rq.errors == IDETAPE_ERROR_FILEMARK)
                                count++;
@@ -3564,6 +3575,8 @@ static void idetape_setup (ide_drive_t *drive, idetape_tape_t *tape, int minor)
        u16 speed;
        struct idetape_id_gcw gcw;
 
+       memset (tape, 0, sizeof (idetape_tape_t));
+       spin_lock_init(&tape->spinlock);
        drive->driver_data = tape;
        drive->ready_stat = 0;                  /* An ATAPI device ignores DRDY */
 #ifdef CONFIG_BLK_DEV_IDEPCI
index eaa4e86196a81afb702f9b1ae37d5d9f53b9aec9..4c03f4917b121eb4a88370c637590443e4b6e72d 100644 (file)
@@ -1087,7 +1087,7 @@ static int aztGetToc(int multi)
 #ifdef AZT_KERNEL_PRIOR_2_1
 void aztcd_setup(char *str, int *ints)
 #else
-__initfunc(void aztcd_setup(char *str, int *ints))
+void __init aztcd_setup(char *str, int *ints)
 #endif
 {  if (ints[0] > 0)
       azt_port = ints[1];
@@ -1617,7 +1617,7 @@ static int  aztcd_release(struct inode * inode, struct file * file)
 #ifdef AZT_KERNEL_PRIOR_2_1
 int aztcd_init(void)
 #else
-__initfunc(int aztcd_init(void))
+int __init aztcd_init(void)
 #endif
 {       long int count, max_count;
        unsigned char result[50];
index c825b83446187144f95f4ab74da30a0ffa8ee243..edb90ee76e45c2d82bea509bf50723ea758e0b39 100644 (file)
@@ -3251,10 +3251,10 @@ static struct cdrom_device_info scd_info = {
 /* The different types of disc loading mechanisms supported */
 static const char *load_mech[] __initdata = { "caddy", "tray", "pop-up", "unknown" };
 
-__initfunc(static void
+static void __init 
 get_drive_configuration(unsigned short base_io,
                         unsigned char res_reg[],
-                        unsigned int *res_size))
+                        unsigned int *res_size)
 {
    int retry_count;
 
@@ -3318,9 +3318,9 @@ get_drive_configuration(unsigned short base_io,
 /*
  * Set up base I/O and interrupts, called from main.c.
  */
-__initfunc(void
+void __init 
 cdu31a_setup(char *strings,
-            int  *ints))
+            int  *ints)
 {
    if (ints[0] > 0)
    {
@@ -3349,8 +3349,8 @@ static int cdu31a_block_size;
 /*
  * Initialize the driver.
  */
-__initfunc(int
-cdu31a_init(void))
+int __init 
+cdu31a_init(void)
 {
    struct s_sony_drive_config drive_config;
    unsigned int res_size;
index 72f7cb98163ed0c607d45f9b4d062178253e8633..3ab0533f8bc575f6cb95d9c942f5683124d10ce6 100644 (file)
@@ -1294,7 +1294,7 @@ static void cleanup(int level)
    check_region, 15 bits of one port and 6 of another make things
    likely enough to accept the region on the first hit...
  */
-__initfunc(int probe_base_port(int base))
+int __init probe_base_port(int base)
 {
   int b=0x300, e=0x370;                /* this is the range of start addresses */
   volatile int fool, i;
@@ -1314,7 +1314,7 @@ __initfunc(int probe_base_port(int base))
 
 #if !defined(MODULE) || defined(AUTO_PROBE_MODULE)
 /* Probe for irq# nr. If nr==0, probe for all possible irq's. */
-__initfunc(int probe_irq(int nr)) {
+int __init probe_irq(int nr){
   int irqs, irq;
   outw(dc_normal | READ_AHEAD, r_data_control);        /* disable irq-generation */
   sti(); 
@@ -1328,7 +1328,7 @@ __initfunc(int probe_irq(int nr)) {
 }
 #endif
 
-__initfunc(int cm206_init(void))
+int __init cm206_init(void)
 {
   uch e=0;
   long int size=sizeof(struct cm206_struct);
@@ -1413,7 +1413,7 @@ __initfunc(int cm206_init(void))
 
 static int cm206[2] = {0,0};   /* for compatible `insmod' parameter passing */
 
-__initfunc(void parse_options(void))
+void __init parse_options(void)
 {
   int i;
   for (i=0; i<2; i++) {
@@ -1447,7 +1447,7 @@ void cleanup_module(void)
 
 /* This setup function accepts either `auto' or numbers in the range
  * 3--11 (for irq) or 0x300--0x370 (for base port) or both. */
-__initfunc(void cm206_setup(char *s, int *p))
+void __init cm206_setup(char *s, int *p)
 {
   int i;
   if (!strcmp(s, "auto")) auto_probe=1;
index cf5c1a556d11c631279a1119467db9648c4226c9..07c36f51b3ca04ca963d3b883112f5190587e107 100644 (file)
@@ -194,7 +194,7 @@ static int check_gscd_med_chg (kdev_t full_dev)
 }
 
 
-__initfunc(void gscd_setup (char *str, int *ints))
+void __init gscd_setup (char *str, int *ints)
 {
   if (ints[0] > 0) 
   {
@@ -851,7 +851,7 @@ int  i;
      return;
 }
 
-__initfunc(int find_drives (void))
+int __init find_drives (void)
 {
 int *pdrv;
 int drvnum;
@@ -902,7 +902,7 @@ int i;
     return drvnum;
 }    
 
-__initfunc(void init_cd_drive ( int num ))
+void __init init_cd_drive ( int num )
 {
 char resp [50];
 int  i;
@@ -994,7 +994,7 @@ void cleanup_module (void)
 
 
 /* Test for presence of drive and initialize it.  Called only at boot time. */
-__initfunc(int gscd_init (void))
+int __init gscd_init (void)
 {
    return my_gscd_init ();
 }
@@ -1002,7 +1002,7 @@ __initfunc(int gscd_init (void))
 
 /* This is the common initialisation for the GoldStar drive. */
 /* It is called at boot time AND for module init.           */
-__initfunc(int my_gscd_init (void))
+int __init my_gscd_init (void)
 {
 int i;
 int result;
index f0b5e7499f7d085acbf6e1d71746173c4d9c29e4..7b070170749ac8eeadbd5a4bf2fd16786e403000 100644 (file)
@@ -77,8 +77,8 @@ void cleanup_module(void);
 #define ISP16_OUT(p,b) (outb(isp16_ctrl,ISP16_CTRL_PORT), outb(b,p))
 
 
-__initfunc(void
-isp16_setup(char *str, int *ints))
+void __init 
+isp16_setup(char *str, int *ints)
 {
   if ( ints[0] > 0 )
     isp16_cdrom_base = ints[1];
@@ -94,8 +94,8 @@ isp16_setup(char *str, int *ints))
  *  ISP16 initialisation.
  *
  */
-__initfunc(int
-isp16_init(void))
+int __init 
+isp16_init(void)
 {
   u_char expected_drive;
 
@@ -144,8 +144,8 @@ isp16_init(void))
   return(0);
 }
 
-__initfunc(static short
-isp16_detect(void))
+static short __init 
+isp16_detect(void)
 {
 
   if ( isp16_c929__detect() >= 0 )
@@ -154,8 +154,8 @@ isp16_detect(void))
     return(isp16_c928__detect());
 }
 
-__initfunc(static short
-isp16_c928__detect(void))
+static short __init 
+isp16_c928__detect(void)
 {
   u_char ctrl;
   u_char enable_cdrom;
@@ -203,8 +203,8 @@ isp16_c928__detect(void))
   return(i);
 }
 
-__initfunc(static short
-isp16_c929__detect(void))
+static short __init 
+isp16_c929__detect(void)
 {
   u_char ctrl;
   u_char tmp;
@@ -230,8 +230,8 @@ isp16_c929__detect(void))
   return(2);
 }
 
-__initfunc(static short
-isp16_cdi_config(int base, u_char drive_type, int irq, int dma))
+static short __init 
+isp16_cdi_config(int base, u_char drive_type, int irq, int dma)
 {
   u_char base_code;
   u_char irq_code;
index 4297ae48c6f0abed29919b78710b3aff22661611..81f9bd7626a386cb02dc09ec9ba6f40198bf53f0 100644 (file)
@@ -230,8 +230,7 @@ static struct cdrom_device_info mcd_info = {
 };
 
 
-
-__initfunc(void mcd_setup(char *str, int *ints))
+void __init mcd_setup(char *str, int *ints)
 {
    if (ints[0] > 0)
       mcd_port = ints[1];
@@ -1155,7 +1154,7 @@ static void cleanup(int level)
  * Test for presence of drive and initialize it.  Called at boot time.
  */
 
-__initfunc(int mcd_init(void))
+int __init mcd_init(void)
 {
        int count;
        unsigned char result[3];
index 684d7a29e2b264ce7c30479486532bb6a88948f2..fa3f363103565a159d82b88859345d1015d457b2 100644 (file)
@@ -770,7 +770,7 @@ static int mcdx_media_changed(struct cdrom_device_info * cdi, int disc_nr)
        return 1;
 }
 
-__initfunc(void mcdx_setup(char *str, int *pi))
+void __init mcdx_setup(char *str, int *pi)
 {
        if (pi[0] > 0) mcdx_drive_map[0][0] = pi[1];
        if (pi[0] > 1) mcdx_drive_map[0][1] = pi[2];
@@ -1013,7 +1013,7 @@ void cleanup_module(void)
 
 /* Support functions ************************************************/
 
-__initfunc(int mcdx_init_drive(int drive))
+int __init mcdx_init_drive(int drive)
 {
        struct s_version version;
        struct s_drive_stuff* stuffp;
@@ -1174,7 +1174,7 @@ __initfunc(int mcdx_init_drive(int drive))
        return 0;
 }
 
-__initfunc(int mcdx_init(void))
+int __init mcdx_init(void)
 {
        int drive;
 #ifdef MODULE
index df829dfb96c499e13e11998e21e9df59ed854529..68a22cbd11606ccd16139af87bab2cc01a318c9d 100644 (file)
@@ -1966,7 +1966,7 @@ static int opt_media_change(kdev_t dev)
 
 /* Returns 1 if a drive is detected with a version string
    starting with "DOLPHIN". Otherwise 0. */
-__initfunc(static int version_ok(void))
+static int __init version_ok(void)
 {
        char devname[100];
        int count, i, ch, status;
@@ -2022,7 +2022,7 @@ static struct file_operations opt_fops = {
 
 
 /* Get kernel parameter when used as a kernel driver */
-__initfunc(void optcd_setup(char *str, int *ints))
+void __init optcd_setup(char *str, int *ints)
 {
        if (ints[0] > 0)
                optcd_port = ints[1];
@@ -2030,7 +2030,7 @@ __initfunc(void optcd_setup(char *str, int *ints))
 
 /* Test for presence of drive and initialize it. Called at boot time
    or during module initialisation. */
-__initfunc(int optcd_init(void))
+int __init optcd_init(void)
 {
        int status;
 
index d19b940d69e087a8e36ff8f7b68526d5c26bc761..3e704b0d81a22911c887243ae3ae8cc17d21479a 100644 (file)
@@ -3215,7 +3215,7 @@ static int cc_SubChanInfo(int frame, int count, u_char *buffer)
 }
 #endif FUTURE
 /*==========================================================================*/
-__initfunc(static void check_datarate(void))
+static void __init check_datarate(void)
 {
        int i=0;
        
@@ -3285,7 +3285,7 @@ static int c2_ReadError(int fam)
 }
 #endif
 /*==========================================================================*/
-__initfunc(static void ask_mail(void))
+static void __init ask_mail(void)
 {
        int i;
        
@@ -3304,7 +3304,7 @@ __initfunc(static void ask_mail(void))
        msg(DBG_INF,"infobuf =%s\n", msgbuf);
 }
 /*==========================================================================*/
-__initfunc(static int check_version(void))
+static int __init check_version(void)
 {
        int i, j, l;
        int teac_possible=0;
@@ -3602,7 +3602,7 @@ static void switch_drive(int i)
 /*
  * probe for the presence of an interface card
  */
-__initfunc(static int check_card(int port))
+static int __init check_card(int port)
 {
 #undef N_RESPO
 #define N_RESPO 20
@@ -3706,7 +3706,7 @@ __initfunc(static int check_card(int port))
 /*
  * probe for the presence of drives on the selected controller
  */
-__initfunc(static int check_drives(void))
+static int __init check_drives(void)
 {
        int i, j;
        
@@ -5458,9 +5458,9 @@ static struct cdrom_device_info sbpcd_info = {
  *
  */
 #if (SBPCD_ISSUE-1)
-__initfunc(static void sbpcd_setup(const char *s, int *p))
+static void __init sbpcd_setup(const char *s, int *p)
 #else
-__initfunc(void sbpcd_setup(const char *s, int *p))
+void __init sbpcd_setup(const char *s, int *p)
 #endif
 {
        setup_done++;
@@ -5512,7 +5512,7 @@ __initfunc(void sbpcd_setup(const char *s, int *p))
  *        port 0x330, we have to use an offset of 8; so, the real CDROM port
  *        address is 0x338.
  */
-__initfunc(static int config_spea(void))
+static int __init config_spea(void)
 {
        /*
          * base address offset between configuration port and CDROM port,
@@ -5571,7 +5571,7 @@ __initfunc(static int config_spea(void))
 #ifdef MODULE
 int init_module(void)
 #else
-__initfunc(int SBPCD_INIT(void))
+int __init SBPCD_INIT(void)
 #endif MODULE
 {
        int i=0, j=0;
index 8d16b83634706d84badce164710c9478f85b486e..35697369fec70095dcaa1ca42431dcf58205818a 100644 (file)
@@ -163,7 +163,7 @@ static int sjcd_cleanup(void);
  * Set up device, i.e., use command line data to set
  * base address.
  */
-__initfunc(void sjcd_setup( char *str, int *ints ))
+void __init sjcd_setup( char *str, int *ints )
 {
    if (ints[0] > 0)
       sjcd_base = ints[1];
@@ -1457,7 +1457,7 @@ static struct {
  * Test for presence of drive and initialize it. Called at boot time.
  * Probe cdrom, find out version and status.
  */
-__initfunc(int sjcd_init( void )){
+int __init sjcd_init( void ){
   int i;
 
   printk(KERN_INFO "SJCD: Sanyo CDR-H94A cdrom driver version %d.%d.\n", SJCD_VERSION_MAJOR,
index b4bce667989665012247b68e28b2d1cee8952f5a..97b1afdde04c2514c4eca4ee3918588f6e886943 100644 (file)
@@ -1486,8 +1486,8 @@ static int sonycd535_block_size = CDU535_BLOCK_SIZE;
 /*
  * Initialize the driver.
  */
-__initfunc(int
-sony535_init(void))
+int __init 
+sony535_init(void)
 {
        struct s535_sony_drive_config drive_config;
        Byte cmd_buff[3];
@@ -1655,8 +1655,8 @@ sony535_init(void))
  *
  * the address value has to be the existing CDROM port address.
  */
-__initfunc(void
-sonycd535_setup(char *strings, int *ints))
+void __init 
+sonycd535_setup(char *strings, int *ints)
 {
        /* if IRQ change and default io base desired,
         * then call with io base of 0
index 4885f3caf1ab280eddb9695d53566e79c3783c5d..d68e307460ef03954093237a2fcafe6836b7d3cc 100644 (file)
@@ -28,6 +28,9 @@ if [ "$CONFIG_SERIAL_NONSTANDARD" = "y" ]; then
       tristate 'Digiboard PC/Xx Support' CONFIG_DIGI
    fi
    tristate 'Cyclades async mux support' CONFIG_CYCLADES
+   if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_CYCLADES" != "n" ]; then
+      bool '  Cyclades-Z interrupt mode operation (EXPERIMENTAL)' CONFIG_CYZ_INTR
+   fi
    bool 'Stallion multiport serial support' CONFIG_STALDRV
    if [ "$CONFIG_STALDRV" = "y" ]; then
      tristate '  Stallion EasyIO or EC8/32 support' CONFIG_STALLION
@@ -80,6 +83,9 @@ if [ "$CONFIG_QIC02_TAPE" != "n" ]; then
     comment '   from the tpqic02-support package.  It is available at'
     comment '   metalab.unc.edu or ftp://titus.cfw.com/pub/Linux/util/'
   fi
+  dep_tristate 'Zoran ZR36057/36060 support' CONFIG_VIDEO_ZORAN $CONFIG_VIDEO_DEV
+  dep_tristate ' Include support for Iomega Buz' CONFIG_VIDEO_BUZ $CONFIG_VIDEO_ZORAN
+  dep_tristate '  Include support for LML33' CONFIG_VIDEO_LML33 $CONFIG_VIDEO_ZORAN
 fi
 
 bool 'Watchdog Timer Support'  CONFIG_WATCHDOG
@@ -112,6 +118,7 @@ comment 'Video For Linux'
 
 tristate 'Video For Linux' CONFIG_VIDEO_DEV
 if [ "$CONFIG_VIDEO_DEV" != "n" ]; then
+  dep_tristate 'ADS Cadet AM/FM Tuner' CONFIG_RADIO_CADET $CONFIG_VIDEO_DEV
   dep_tristate 'AIMSlab RadioTrack (aka RadioReveal) support' CONFIG_RADIO_RTRACK $CONFIG_VIDEO_DEV
   if [ "$CONFIG_RADIO_RTRACK" = "y" ]; then
     hex '  RadioTrack i/o port (0x20f or 0x30f)' CONFIG_RADIO_RTRACK_PORT 20f
@@ -124,12 +131,15 @@ if [ "$CONFIG_VIDEO_DEV" != "n" ]; then
   if [ "$CONFIG_RADIO_AZTECH" = "y" ]; then
     hex '  Aztech/Packard Bell I/O port (0x350 or 0x358)' CONFIG_RADIO_AZTECH_PORT 350
   fi
-  dep_tristate 'ADS Cadet AM/FM Tuner' CONFIG_RADIO_CADET $CONFIG_VIDEO_DEV
-  dep_tristate 'Miro PCM20 Radio' CONFIG_RADIO_MIROPCM20 $CONFIG_VIDEO_DEV
   dep_tristate 'GemTek Radio Card support' CONFIG_RADIO_GEMTEK $CONFIG_VIDEO_DEV
   if [ "$CONFIG_RADIO_GEMTEK" = "y" ]; then
     hex '  GemTek i/o port (0x20c, 0x30c, 0x24c or 0x34c)' CONFIG_RADIO_GEMTEK_PORT 34c
   fi
+  dep_tristate 'Miro PCM20 Radio' CONFIG_RADIO_MIROPCM20 $CONFIG_VIDEO_DEV
+  dep_tristate 'TerraTec ActiveRadio ISA Standalone' CONFIG_RADIO_TERRATEC $CONFIG_VIDEO_DEV
+  if [ "$CONFIG_RADIO_TERRATEC" = "y" ]; then
+    hex '  Terratec i/o port (normally 0x590)' CONFIG_RADIO_TERRATEC_PORT 590
+  fi
   if [ "$CONFIG_PCI" != "n" ]; then
     dep_tristate 'BT848 Video For Linux' CONFIG_VIDEO_BT848 $CONFIG_VIDEO_DEV
   fi
index 686b7c4fc618f247451f261ab7d4ad2d0e737326..05057193295616c7f320f24d567f349f59edaf2e 100644 (file)
@@ -356,6 +356,30 @@ else
   endif
 endif
 
+ifeq ($(CONFIG_VIDEO_ZORAN),y)
+L_OBJS += buz.o
+else
+  ifeq ($(CONFIG_VIDEO_LML33),m)
+    M_OBJS += buz.o
+  endif
+endif
+
+ifeq ($(CONFIG_VIDEO_LML33),y)
+L_OBJS += bt856.o bt819.o
+else
+  ifeq ($(CONFIG_VIDEO_LML33),m)
+    M_OBJS += bt856.o bt819.o
+  endif
+endif
+
+ifeq ($(CONFIG_VIDEO_BUZ),y)
+L_OBJS += saa7111.o saa7185.o
+else
+  ifeq ($(CONFIG_VIDEO_BUZ),m)
+    M_OBJS += saa7111.o saa7185.o
+  endif
+endif
+
 ifeq ($(CONFIG_VIDEO_PMS),y)
 L_OBJS += pms.o
 else
@@ -372,6 +396,14 @@ else
   endif
 endif
 
+ifeq ($(CONFIG_VIDEO_VINO),y)
+L_OBJS += vino.o
+else
+  ifeq ($(CONFIG_VIDEO_VINO),m)
+  M_OBJS += vino.o
+  endif
+endif
+
 ifeq ($(CONFIG_RADIO_AZTECH),y)
 L_OBJS += radio-aztech.o
 else
@@ -444,6 +476,14 @@ else
   endif
 endif                                             
 
+ifeq ($(CONFIG_RADIO_TERRATEC),y)
+L_OBJS += radio-terratec.o
+else
+  ifeq ($(CONFIG_RADIO_TERRATEC),m)
+  M_OBJS += radio-terratec.o
+  endif
+endif
+
 ifeq ($(CONFIG_QIC02_TAPE),y)
 L_OBJS += tpqic02.o
 else
index 74ad52cfcc0292537de9879d7bdc7e99dfb2a60c..784360daf6ec09d16c6e660137512c458e150dbc 100644 (file)
@@ -212,7 +212,7 @@ void cleanup_module(void)
 
 #endif
 
-__initfunc(int acq_init(void))
+int __init acq_init(void)
 {
        printk("WDT driver for Acquire single board computer initialising.\n");
 
index a7ed0881587b0cdaabd387d5abbc0c6343d3d28d..24ed4d9d946dd3f196f3d0720c21fd03b8d94099 100644 (file)
@@ -242,7 +242,7 @@ static struct miscdevice adb_mouse = {
     ADB_MOUSE_MINOR, "adbmouse", &adb_mouse_fops
 };
 
-__initfunc(int adb_mouse_init(void))
+int __init adb_mouse_init(void)
 {
     mouse.active = 0;
     mouse.ready = 0;
@@ -268,7 +268,7 @@ __initfunc(int adb_mouse_init(void))
  * option, which is about using ADB keyboard buttons to emulate
  * mouse buttons. -- paulus
  */
-__initfunc(void adb_mouse_setup(char *str, int *ints))
+void __init adb_mouse_setup(char *str, int *ints)
 {
        if (ints[0] >= 1) {
                adb_emulate_buttons = ints[1] > 0;
index 274230c64989454ffac7da46738ebc724f99372b..70e20b887065e4f721f034d708eb3947c840cc9d 100644 (file)
@@ -309,7 +309,7 @@ static struct miscdevice amiga_mouse = {
        AMIGAMOUSE_MINOR, "amigamouse", &amiga_mouse_fops
 };
 
-__initfunc(int amiga_mouse_init(void))
+int __init amiga_mouse_init(void)
 {
        if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_MOUSE))
                return -ENODEV;
index 8c8c58388d32dff81ccad71220109df87897f6b6..d9ebd1084a3ceae95727edc215d6a2b706b9b97f 100644 (file)
@@ -295,7 +295,7 @@ static void keyboard_interrupt(int irq, void *dummy, struct pt_regs *fp)
        }
 }
 
-__initfunc(int amiga_keyb_init(void))
+int __init amiga_keyb_init(void)
 {
     if (!AMIGAHW_PRESENT(AMI_KEYBOARD))
         return -EIO;
@@ -343,6 +343,6 @@ int amiga_kbdrate( struct kbd_repeat *k )
 }
 
 /* for "kbd-reset" cmdline param */
-__initfunc(void amiga_kbd_reset_setup(char *str, int *ints))
+void __init amiga_kbd_reset_setup(char *str, int *ints)
 {
 }
index 33d71d3769d44e8ddbc09ba7f56ae55817e4caaa..b813510eb08bd12f115d58bd52818095c3b43e5f 100644 (file)
@@ -159,7 +159,7 @@ static struct miscdevice atari_mouse = {
     ATARIMOUSE_MINOR, "atarimouse", &atari_mouse_fops
 };
 
-__initfunc(int atari_mouse_init(void))
+int __init atari_mouse_init(void)
 {
        int r;
 
@@ -182,7 +182,7 @@ __initfunc(int atari_mouse_init(void))
 #define        MIN_THRESHOLD 1
 #define        MAX_THRESHOLD 20        /* more seems not reasonable... */
 
-__initfunc(void atari_mouse_setup( char *str, int *ints ))
+void __init atari_mouse_setup( char *str, int *ints )
 {
     if (ints[0] < 1) {
        printk( "atari_mouse_setup: no arguments!\n" );
index 69fcbf004dfe8667fe8c1fa6137c61d62d127d12..ecddff26ce3c3ff174bf4bd8c03abcde5cdd5bcc 100644 (file)
@@ -202,7 +202,7 @@ static struct miscdevice atixl_mouse = {
 };
 
 
-__initfunc(int atixl_busmouse_init(void))
+int __init atixl_busmouse_init(void)
 {
        unsigned char a,b,c;
 
index 1ec37e864b57c0b1dd25532503aa329858dd6315..70b75ecc13cb70f3c690af693437f7781096fb80 100644 (file)
@@ -60,7 +60,7 @@ static int mouse_irq = MOUSE_IRQ;
 MODULE_PARM(mouse_irq, "i");
 #endif
 
-__initfunc(void bmouse_setup(char *str, int *ints))
+void __init bmouse_setup(char *str, int *ints)
 {
        if (ints[0] > 0)
                mouse_irq=ints[1];
@@ -252,7 +252,7 @@ static struct miscdevice bus_mouse = {
        LOGITECH_BUSMOUSE, "busmouse", &bus_mouse_fops
 };
 
-__initfunc(int bus_mouse_init(void))
+int __init bus_mouse_init(void)
 {
        if (check_region(LOGIBM_BASE, LOGIBM_EXTENT)) {
          mouse.present = 0;
index b207e0b2190f6df5acde821938b60d6c53934de4..1a37e2944812816205f98c6d4578280afcf5a927 100644 (file)
@@ -30,7 +30,6 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
index 2005390d943fa9d81a71125999469d3465f11748..db165915c3e334bb89be6b3aa9af3fce3ca18219 100644 (file)
@@ -2282,7 +2282,7 @@ static void vc_init(unsigned int currcons, unsigned int rows, unsigned int cols,
 struct tty_driver console_driver;
 static int console_refcount;
 
-__initfunc(unsigned long con_init(unsigned long kmem_start))
+unsigned long __init con_init(unsigned long kmem_start)
 {
        const char *display_desc = NULL;
        unsigned int currcons = 0;
index 7e97e1fe7ea2eaa4ac557e784fc6cfa458411756..272074936ed31f7ad3f27559e4caeba38c6e4e47 100644 (file)
@@ -671,8 +671,8 @@ conv_uni_to_pc(struct vc_data *conp, long ucs)
  * initialized.  It must be possible to call kmalloc(..., GFP_KERNEL)
  * from this function, hence the call from sys_setup.
  */
-__initfunc(void
-console_map_init(void))
+void __init 
+console_map_init(void)
 {
        int i;
        
index 2d84f18c32af7cf51625f2e9110da6543628ed23..cae9bb8181c275c8f1f11e8e88c72a3e5bd91fba 100644 (file)
@@ -1,7 +1,7 @@
 #define BLOCKMOVE
 #define        Z_WAKE
 static char rcsid[] =
-"$Revision: 2.2.2.2 $$Date: 1999/05/21 17:18:15 $";
+"$Revision: 2.2.2.3 $$Date: 1999/06/28 11:13:29 $";
 
 /*
  *  linux/drivers/char/cyclades.c
@@ -31,6 +31,16 @@ static char rcsid[] =
  *   void cleanup_module(void);
  *
  * $Log: cyclades.c,v $
+ * Revision 2.2.2.3   1999/06/28 11:13:29 ivan
+ * Added support for interrupt mode operation for the Z cards;
+ * Removed the driver inactivity control for the Z;
+ * Added a missing MOD_DEC_USE_COUNT in the cy_open function for when 
+ * the Z firmware is not loaded yet;
+ * Replaced the "manual" Z Tx flush buffer by a call to a FW command of 
+ * same functionality;
+ * Implemented workaround for IRQ setting loss on the PCI configuration 
+ * registers after a PCI bridge EEPROM reload (affects PLX9060 only);
+ *
  * Revision 2.2.2.2  1999/05/14 17:18:15 ivan
  * /proc entry location changed to /proc/tty/driver/cyclades;
  * Added support to shared IRQ's (only for PCI boards);
@@ -528,7 +538,7 @@ static char rcsid[] =
    constant in the definition below. No other change is necessary to
    support more boards/ports. */
 
-#define NR_PORTS        128
+#define NR_PORTS        256
 
 #define ZE_V1_NPORTS   64
 #define ZO_V1  0
@@ -810,13 +820,15 @@ static void set_line_char(struct cyclades_port *);
 #ifndef CONFIG_COBALT_27
 static void cy_probe(int, void *, struct pt_regs *);
 #endif /* CONFIG_COBALT_27 */
-static void cyz_poll(unsigned long);
 #ifdef CYCLOM_SHOW_STATUS
 static void show_status(int);
 #endif
 
 static int cyclades_get_proc_info(char *, char **, off_t , int , int *, void *);
 
+#ifndef CONFIG_CYZ_INTR
+static void cyz_poll(unsigned long);
+
 /* The Cyclades-Z polling cycle is defined by this variable */
 static long cyz_polling_cycle = CZ_DEF_POLL;
 
@@ -825,6 +837,7 @@ static struct timer_list
 cyz_timerlist = {
     NULL, NULL, 0, 0, cyz_poll
 };
+#endif /* CONFIG_CYZ_INTR */
 
 /**************************************************
 error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(unsigned long));
@@ -1197,7 +1210,7 @@ cyy_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
     if((cinfo = (struct cyclades_card *)dev_id) == 0){
 #ifdef CY_DEBUG_INTERRUPTS
-       printk("cy_interrupt: spurious interrupt %d\n\r", irq);
+       printk("cyy_interrupt: spurious interrupt %d\n\r", irq);
 #endif
         return; /* spurious interrupt */
     }
@@ -1229,7 +1242,7 @@ cyy_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                 }
                 if (status & CySRReceive) { /* reception interrupt */
 #ifdef CY_DEBUG_INTERRUPTS
-                   printk("cy_interrupt: rcvd intr, chip %d\n\r", chip);
+                   printk("cyy_interrupt: rcvd intr, chip %d\n\r", chip);
 #endif
                     /* determine the channel & change to that context */
                     save_xir = (u_char) cy_readb(base_addr+(CyRIR<<index));
@@ -1356,7 +1369,7 @@ cyy_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                        is empty, we know we can always stuff a dozen
                        characters. */
 #ifdef CY_DEBUG_INTERRUPTS
-                   printk("cy_interrupt: xmit intr, chip %d\n\r", chip);
+                   printk("cyy_interrupt: xmit intr, chip %d\n\r", chip);
 #endif
 
                     /* determine the channel & change to that context */
@@ -1636,12 +1649,285 @@ cyz_update_channel( struct cyclades_card *cinfo,
 } /* cyz_update_channel */
 #endif
 
-
+#ifdef CONFIG_CYZ_INTR
 static void
 cyz_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
+  struct tty_struct *tty;
+  struct cyclades_card *cinfo;
+  struct cyclades_port *info;
+  static volatile struct FIRM_ID *firm_id;
+  static volatile struct ZFW_CTRL *zfw_ctrl;
+  static volatile struct BOARD_CTRL *board_ctrl;
+  static volatile struct CH_CTRL *ch_ctrl;
+  static volatile struct BUF_CTRL *buf_ctrl;
+  uclong channel;
+  ucchar cmd;
+  uclong param;
+  uclong hw_ver, fw_ver;
+  char data;
+  volatile int char_count, special_count;
+#ifdef BLOCKMOVE
+  int small_count;
+#endif
+  volatile uclong tx_put, tx_get, tx_bufsize;
+  volatile uclong rx_put, rx_get, rx_bufsize;
+
+    if((cinfo = (struct cyclades_card *)dev_id) == 0){
+#ifdef CY_DEBUG_INTERRUPTS
+       printk("cyz_interrupt: spurious interrupt %d\n\r", irq);
+#endif
+        return; /* spurious interrupt */
+    }
+
+       firm_id = (struct FIRM_ID *)(cinfo->base_addr + ID_ADDRESS);
+        if (!ISZLOADED(*cinfo)) {
+#ifdef CY_DEBUG_INTERRUPTS
+           printk("cyz_interrupt: board not yet loaded (INT %d).\n\r", irq);
+#endif
+           return;
+       }
+
+       zfw_ctrl = (struct ZFW_CTRL *)
+                  (cinfo->base_addr + cy_readl(&firm_id->zfwctrl_addr));
+       board_ctrl = &(zfw_ctrl->board_ctrl);
+       fw_ver = cy_readl(&board_ctrl->fw_version);
+       hw_ver = cy_readl(&((struct RUNTIME_9060 *)
+                            (cinfo->ctl_addr))->mail_box_0);
+
+       while(cyz_fetch_msg(cinfo, &channel, &cmd, &param) == 1) {
+           special_count = 0;
+           info = &cy_port[channel + cinfo->first_line];
+            if((tty = info->tty) == 0) continue;
+           ch_ctrl = &(zfw_ctrl->ch_ctrl[channel]);
+           buf_ctrl = &(zfw_ctrl->buf_ctrl[channel]);
+
+           switch(cmd){
+           case C_CM_PR_ERROR:
+               tty->flip.count++;
+               *tty->flip.flag_buf_ptr++ = TTY_PARITY;
+               *tty->flip.char_buf_ptr++ = 0;
+               special_count++;
+               break;
+           case C_CM_FR_ERROR:
+               tty->flip.count++;
+               *tty->flip.flag_buf_ptr++ = TTY_FRAME;
+               *tty->flip.char_buf_ptr++ = 0;
+               special_count++;
+               break;
+           case C_CM_RXBRK:
+               tty->flip.count++;
+               *tty->flip.flag_buf_ptr++ = TTY_BREAK;
+               *tty->flip.char_buf_ptr++ = 0;
+               special_count++;
+               break;
+           case C_CM_MDCD:
+               if (info->flags & ASYNC_CHECK_CD){
+                   if ((fw_ver > 241 ? 
+                          ((u_long)param) : 
+                          cy_readl(&ch_ctrl[channel].rs_status)) & C_RS_DCD) {
+                       /* SP("Open Wakeup\n"); */
+                       cy_sched_event(info,
+                           Cy_EVENT_OPEN_WAKEUP);
+                   }else if(!((info->flags
+                               & ASYNC_CALLOUT_ACTIVE)
+                        &&(info->flags
+                           & ASYNC_CALLOUT_NOHUP))){
+                       /* SP("Hangup\n"); */
+                       cy_sched_event(info,
+                           Cy_EVENT_HANGUP);
+                   }
+               }
+               break;
+           case C_CM_MCTS:
+               if (info->flags & ASYNC_CTS_FLOW) {
+                   if(info->tty->hw_stopped){
+                       if( cy_readl(&ch_ctrl[channel].rs_status) & C_RS_DCD){
+                           /* cy_start isn't used because... 
+                              HW flow is handled by the board */
+                           /* SP("Write Wakeup\n"); */
+                           cy_sched_event(info,
+                               Cy_EVENT_WRITE_WAKEUP);
+                       }
+                   }else{
+                       if(!(cy_readl(&ch_ctrl[channel].rs_status) & C_RS_CTS)){
+                           /* cy_stop isn't used because 
+                              HW flow is handled by the board */
+                           /* SP("Write stop\n"); */
+                       }
+                   }
+               }
+               break;
+           case C_CM_MRI:
+               break;
+           case C_CM_MDSR:
+               break;
+#ifdef Z_WAKE
+           case C_CM_IOCTLW:
+               cy_sched_event(info, Cy_EVENT_SHUTDOWN_WAKEUP);
+               break;
+#endif
+           case C_CM_RXHIWM:
+           case C_CM_RXNNDT:
+               /* Reception Interrupt */
+#ifdef CY_DEBUG_INTERRUPTS
+           printk("cyz_interrupt: rcvd intr, card %d, port %ld\n\r", 
+               info->card, channel);
+#endif
+
+           rx_get = cy_readl(&buf_ctrl->rx_get);
+           rx_put = cy_readl(&buf_ctrl->rx_put);
+           rx_bufsize = cy_readl(&buf_ctrl->rx_bufsize);
+           if (rx_put >= rx_get)
+               char_count = rx_put - rx_get;
+           else
+               char_count = rx_put - rx_get + rx_bufsize;
+
+           if ( char_count ){
+
+#ifdef CY_ENABLE_MONITORING
+               info->mon.int_count++;
+               info->mon.char_count += char_count;
+               if (char_count > info->mon.char_max)
+                  info->mon.char_max = char_count;
+               info->mon.char_last = char_count;
+#endif
+               info->idle_stats.recv_bytes += char_count;
+               info->idle_stats.recv_idle   = jiffies;
+               if( tty == 0){
+                   /* flush received characters */
+                   rx_get = (rx_get + char_count) & (rx_bufsize - 1);
+                   /* SP("-"); */
+                   info->rflush_count++;
+               }else{
+#ifdef BLOCKMOVE
+               /* we'd like to use memcpy(t, f, n) and memset(s, c, count)
+                  for performance, but because of buffer boundaries, there
+                  may be several steps to the operation */
+                   while(0 < (small_count
+                       = cy_min((rx_bufsize - rx_get),
+                                cy_min((TTY_FLIPBUF_SIZE - tty->flip.count),
+                                       char_count)))){
+
+                       memcpy_fromio(tty->flip.char_buf_ptr,
+                                     (char *)(cinfo->base_addr
+                                      + cy_readl(&buf_ctrl->rx_bufaddr)
+                                      + rx_get),
+                                     small_count);
+
+                       tty->flip.char_buf_ptr += small_count;
+                       memset(tty->flip.flag_buf_ptr,
+                              TTY_NORMAL,
+                              small_count);
+                       tty->flip.flag_buf_ptr += small_count;
+                       rx_get = (rx_get + small_count) & (rx_bufsize - 1);
+                       char_count -= small_count;
+                       tty->flip.count += small_count;
+                   }
+#else
+                   while(char_count--){
+                       if (tty->flip.count >= TTY_FLIPBUF_SIZE){
+                               break;
+                       }
+                       data = cy_readb(cinfo->base_addr +
+                                  cy_readl(&buf_ctrl->rx_bufaddr) + rx_get);
+                       rx_get = (rx_get + 1) & (rx_bufsize - 1);
+                       tty->flip.count++;
+                       *tty->flip.flag_buf_ptr++ = TTY_NORMAL;
+                       *tty->flip.char_buf_ptr++ = data;
+                   }
+#endif
+                   queue_task(&tty->flip.tqueue, &tq_timer);
+               }
+               /* Update rx_get */
+               cy_writel(&buf_ctrl->rx_get, rx_get);
+           }
+               break;
+           case C_CM_TXBEMPTY:
+           case C_CM_TXLOWWM:
+           case C_CM_INTBACK:
+               /* Transmission Interrupt */
+#ifdef CY_DEBUG_INTERRUPTS
+           printk("cyz_interrupt: xmit intr, card %d, port %ld\n\r", 
+               info->card, channel);
+#endif
+
+           tx_get = cy_readl(&buf_ctrl->tx_get);
+           tx_put = cy_readl(&buf_ctrl->tx_put);
+           tx_bufsize = cy_readl(&buf_ctrl->tx_bufsize);
+           if (tx_put >= tx_get)
+               char_count = tx_get - tx_put - 1 + tx_bufsize;
+           else
+               char_count = tx_get - tx_put - 1;
+
+           if ( char_count ){
+
+               if( tty == 0 ){
+                   goto ztxdone;
+               }
+
+               if(info->x_char) { /* send special char */
+                   data = info->x_char;
+
+                   cy_writeb((cinfo->base_addr +
+                             cy_readl(&buf_ctrl->tx_bufaddr) + tx_put), data);
+                   tx_put = (tx_put + 1) & (tx_bufsize - 1);
+                   info->x_char = 0;
+                   char_count--;
+               }
+#ifdef BLOCKMOVE
+               while(0 < (small_count
+                   = cy_min((tx_bufsize - tx_put),
+                            cy_min ((SERIAL_XMIT_SIZE - info->xmit_tail),
+                                    cy_min(info->xmit_cnt, char_count))))){
+
+                   memcpy_toio((char *)(cinfo->base_addr
+                                + cy_readl(&buf_ctrl->tx_bufaddr) + tx_put),
+                               &info->xmit_buf[info->xmit_tail],
+                               small_count);
+
+                   tx_put = (tx_put + small_count) & (tx_bufsize - 1);
+                   char_count -= small_count;
+                   info->xmit_cnt -= small_count;
+                   info->xmit_tail =
+                      (info->xmit_tail + small_count) & (SERIAL_XMIT_SIZE - 1);
+               }
+#else
+               while (info->xmit_cnt && char_count){
+                   data = info->xmit_buf[info->xmit_tail];
+                   info->xmit_cnt--;
+                   info->xmit_tail =
+                       (info->xmit_tail + 1) & (SERIAL_XMIT_SIZE - 1);
+
+                   cy_writeb(cinfo->base_addr +
+                             cy_readl(&buf_ctrl->tx_bufaddr) + tx_put, 
+                             data);
+                   tx_put = (tx_put + 1) & (tx_bufsize - 1);
+                   char_count--;
+               }
+
+#endif
+           ztxdone:
+               if (info->xmit_cnt < WAKEUP_CHARS) {
+                   cy_sched_event(info, Cy_EVENT_WRITE_WAKEUP);
+               }
+               /* Update tx_put */
+               cy_writel(&buf_ctrl->tx_put, tx_put);
+           }
+               break;
+           case C_CM_FATAL:
+               /* should do something with this !!! */
+               break;
+           }
+           if(special_count){
+               queue_task(&tty->flip.tqueue, &tq_timer);
+           }
+       }
+
+    return;
 } /* cyz_interrupt */
 
+#else /* CONFIG_CYZ_INTR */
 
 static void
 cyz_poll(unsigned long arg)
@@ -1675,7 +1961,6 @@ cyz_poll(unsigned long arg)
 
        firm_id = (struct FIRM_ID *)(cinfo->base_addr + ID_ADDRESS);
         if (!ISZLOADED(*cinfo)) {
-           cinfo->inact_ctrl = 0;
            continue;
        }
 
@@ -1686,12 +1971,6 @@ cyz_poll(unsigned long arg)
        hw_ver = cy_readl(&((struct RUNTIME_9060 *)
                             (cinfo->ctl_addr))->mail_box_0);
 
-       /* Enables the firmware inactivity control */
-       if ((fw_ver > 0x00000310L) && (!cinfo->inact_ctrl)) {
-           param = cyz_issue_cmd( &cy_card[card], 0L, C_CM_TINACT, 0L);
-           cinfo->inact_ctrl = 1;
-       }
-
        while(cyz_fetch_msg(cinfo, &channel, &cmd, &param) == 1){
            char_count = 0;
            info = &cy_port[ channel + cinfo->first_line ];
@@ -1922,17 +2201,13 @@ cyz_poll(unsigned long arg)
        }
        /* poll every 40 ms */
        cyz_timerlist.expires = jiffies + cyz_polling_cycle;
-
-       /* refresh inactivity counter */
-       if (cinfo->inact_ctrl) {
-               cy_writel(&board_ctrl->inactivity, (uclong) ZF_TINACT);
-       }
     }
     add_timer(&cyz_timerlist);
 
     return;
 } /* cyz_poll */
 
+#endif /* CONFIG_CYZ_INTR */
 
 /********** End of block of Cyclades-Z specific code *********/
 /***********************************************************/
@@ -2053,12 +2328,27 @@ startup(struct cyclades_port * info)
 
        cy_writel(&ch_ctrl[channel].op_mode, C_CH_ENABLE);
 #ifdef Z_WAKE
+#ifdef CONFIG_CYZ_INTR
        cy_writel(&ch_ctrl[channel].intr_enable, 
-                 C_IN_MDCD|C_IN_MCTS|C_IN_IOCTLW);
+                 C_IN_TXBEMPTY|C_IN_TXLOWWM|C_IN_RXHIWM|C_IN_RXNNDT|
+                 C_IN_IOCTLW|
+                 C_IN_MDCD|C_IN_MCTS);
 #else
        cy_writel(&ch_ctrl[channel].intr_enable, 
+                 C_IN_IOCTLW|
                  C_IN_MDCD|C_IN_MCTS);
-#endif
+#endif /* CONFIG_CYZ_INTR */
+#else
+#ifdef CONFIG_CYZ_INTR
+       cy_writel(&ch_ctrl[channel].intr_enable, 
+                 C_IN_TXBEMPTY|C_IN_TXLOWWM|C_IN_RXHIWM|C_IN_RXNNDT|
+                 C_IN_MDCD|C_IN_MCTS);
+#else
+       cy_writel(&ch_ctrl[channel].intr_enable, 
+                 C_IN_MDCD|C_IN_MCTS);
+#endif /* CONFIG_CYZ_INTR */
+#endif /* Z_WAKE */
+
        retval = cyz_issue_cmd( &cy_card[card],
            channel, C_CM_IOCTL, 0L);   /* was C_CM_RESET */
        if (retval != 0){
@@ -2126,11 +2416,21 @@ start_xmit( struct cyclades_port *info )
                cy_readb(base_addr+(CySRER<<index)) | CyTxMpty);
        restore_flags(flags);
     } else {
+#ifdef CONFIG_CYZ_INTR
+      int retval;
+
+       save_flags(flags); cli();
+           retval = cyz_issue_cmd(&cy_card[card], channel, C_CM_INTBACK, 0L);
+           if (retval != 0){
+               printk("cyc:start_xmit retval was %x\n", retval);
+           }
+       restore_flags(flags);
+#else /* CONFIG_CYZ_INTR */
        /* Don't have to do anything at this time */
+#endif /* CONFIG_CYZ_INTR */
     }
 } /* start_xmit */
 
-
 /*
  * This routine shuts down a serial port; interrupts are disabled,
  * and DTR is dropped if the hangup on close termio flag is on.
@@ -2504,8 +2804,24 @@ cy_open(struct tty_struct *tty, struct file * filp)
            } else {
                printk("cyc:Cyclades-Z firmware not yet loaded\n");
            }
+           MOD_DEC_USE_COUNT;
            return -ENODEV;
        }
+#ifdef CONFIG_CYZ_INTR
+       else {
+           /* In case this Z board is operating in interrupt mode, its 
+              interrupts should be enabled as soon as the first open happens 
+              to one of its ports. */
+           if (!cy_card[info->card].intr_enabled) {
+               retval = cyz_issue_cmd(&cy_card[info->card], 
+                                       0, C_CM_IRQ_ENBL, 0L);
+               if (retval != 0){
+                   printk("cyc:IRQ enable retval was %x\n", retval);
+               }
+               cy_card[info->card].intr_enabled = 1;
+           }
+       }
+#endif /* CONFIG_CYZ_INTR */
     }
 #ifdef CY_DEBUG_OTHER
     printk("cyc:cy_open ttyC%d\n", info->line); /* */
@@ -3796,14 +4112,14 @@ cy_break(struct tty_struct *tty, int break_state)
        if (break_state == -1) {
            if (!info->breakon) {
                info->breakon = 1;
-               if (!info->xmit_cnt ) {
+               if (!info->xmit_cnt) {
                    start_xmit(info);
                }
            }
        } else {
            if (!info->breakoff) {
                info->breakoff = 1;
-               if (!info->xmit_cnt ) {
+               if (!info->xmit_cnt) {
                    start_xmit(info);
                }
            }
@@ -4051,6 +4367,7 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
        case CYGETCD1400VER:
            ret_val = info->chip_rev;
            break;
+#ifndef CONFIG_CYZ_INTR
        case CYZSETPOLLCYCLE:
             cyz_polling_cycle = (arg * HZ) / 1000;
            ret_val = 0;
@@ -4058,6 +4375,7 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
        case CYZGETPOLLCYCLE:
             ret_val = (cyz_polling_cycle * 1000) / HZ;
            break;
+#endif /* CONFIG_CYZ_INTR */
        case CYSETWAIT:
            info->closing_wait = (unsigned short)arg * HZ/100;
            ret_val = 0;
@@ -4331,7 +4649,7 @@ static void
 cy_flush_buffer(struct tty_struct *tty)
 {
   struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
-  int card, channel;
+  int card, channel, retval;
   unsigned long flags;
                                 
 #ifdef CY_DEBUG_IO
@@ -4349,19 +4667,10 @@ cy_flush_buffer(struct tty_struct *tty)
 
     if (IS_CYC_Z(cy_card[card])) { /* If it is a Z card, flush the on-board 
                                      buffers as well */
-       static volatile struct FIRM_ID *firm_id;
-       static volatile struct ZFW_CTRL *zfw_ctrl;
-       static volatile struct CH_CTRL *ch_ctrl;
-       static volatile struct BUF_CTRL *buf_ctrl;
-
-       firm_id = (struct FIRM_ID *)(cy_card[card].base_addr + ID_ADDRESS);
-       zfw_ctrl = (struct ZFW_CTRL *) (cy_card[card].base_addr +
-                               cy_readl(&firm_id->zfwctrl_addr));
-       ch_ctrl = &(zfw_ctrl->ch_ctrl[channel]);
-       buf_ctrl = &(zfw_ctrl->buf_ctrl[channel]);
-
-       while (cy_readl(&buf_ctrl->tx_get) != cy_readl(&buf_ctrl->tx_put))
-               cy_writel(&buf_ctrl->tx_put, cy_readl(&buf_ctrl->tx_get));
+       retval = cyz_issue_cmd(&cy_card[card], channel, C_CM_FLUSH_TX, 0L);
+       if (retval != 0) {
+           printk("cyc: flush_buffer retval was %x\n", retval);
+       }
     }
     wake_up_interruptible(&tty->write_wait);
     if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP))
@@ -4408,8 +4717,8 @@ cy_hangup(struct tty_struct *tty)
 
 /* initialize chips on Cyclom-Y card -- return number of valid
    chips (which is number of ports/4) */
-__initfunc(static unsigned short
-cyy_init_card(volatile ucchar *true_base_addr,int index))
+static unsigned short __init 
+cyy_init_card(volatile ucchar *true_base_addr,int index)
 {
   unsigned int chip_number;
   volatile ucchar* base_addr;
@@ -4494,8 +4803,7 @@ cyy_init_card(volatile ucchar *true_base_addr,int index))
  * sets global variables and return the number of ISA boards found.
  * ---------------------------------------------------------------------
  */
-__initfunc(static int
-cy_detect_isa(void))
+static int __init cy_detect_isa(void)
 {
   unsigned short       cy_isa_irq,nboard;
   volatile ucchar      *cy_isa_address;
@@ -4602,8 +4910,8 @@ static void plx_init(uclong addr, uclong initctl)
  * sets global variables and return the number of PCI boards found.
  * ---------------------------------------------------------------------
  */
-__initfunc(static int
-cy_detect_pci(void))
+static int __init 
+cy_detect_pci(void)
 {
 #ifdef CONFIG_PCI
 
@@ -4870,10 +5178,11 @@ cy_detect_pci(void))
                    return(i);
                 }
 
+#ifdef CONFIG_CYZ_INTR
                 /* allocate IRQ only if board has an IRQ */
-               if( (1 < cy_pci_irq) && (cy_pci_irq < 15) ) {
-                   if(request_irq(cy_pci_irq,cyz_interrupt,
-                       SA_SHIRQ,"Cyclades-Z",&cy_card[j]))
+               if( (cy_pci_irq != 0) && (cy_pci_irq != 255) ) {
+                   if(request_irq(cy_pci_irq, cyz_interrupt,
+                       SA_SHIRQ, "Cyclades-Z", &cy_card[j]))
                    {
                        printk("Could not allocate IRQ%d ",
                            cy_pci_irq);
@@ -4882,6 +5191,7 @@ cy_detect_pci(void))
                        return(i);
                    }
                }
+#endif /* CONFIG_CYZ_INTR */
 
 
                 /* set cy_card */
@@ -4894,7 +5204,7 @@ cy_detect_pci(void))
 
                 /* print message */
                /* don't report IRQ if board is no IRQ */
-               if( (cy_pci_irq < 15) && (cy_pci_irq > 1) ) {
+               if( (cy_pci_irq != 0) && (cy_pci_irq != 255) ) {
                    printk("Cyclades-8Zo/PCI #%d: 0x%lx-0x%lx, IRQ%d, ",
                        j+1,(ulong)cy_pci_addr2,
                        (ulong)(cy_pci_addr2 + CyPCI_Zwin - 1),
@@ -4906,6 +5216,11 @@ cy_detect_pci(void))
                }
                 printk("%d channels starting from port %d.\n",
                    cy_pci_nchan,cy_next_channel);
+#ifdef CONFIG_CYZ_INTR
+               /* Enable interrupts on the PLX chip */
+               cy_writew(cy_pci_addr0+0x68,
+                       cy_readw(cy_pci_addr0+0x68)|0x0900);
+#endif /* CONFIG_CYZ_INTR */
                 cy_next_channel += cy_pci_nchan;
     }
         }
@@ -4925,10 +5240,6 @@ cy_detect_pci(void))
                 (ulong)cy_pci_addr2, (ulong)cy_pci_addr0);
            printk("Cyclades-Z/PCI: New Cyclades-Z board.  FPGA not loaded\n");
 #endif
-           /* The following clears the firmware id word.  This ensures
-              that the driver will not attempt to talk to the board
-              until it has been properly initialized.
-            */
                PAUSE
                 /* This must be the new Cyclades-Ze/PCI. */
                 cy_pci_nchan = ZE_V1_NPORTS;
@@ -4953,10 +5264,11 @@ cy_detect_pci(void))
                    return(i);
                 }
 
+#ifdef CONFIG_CYZ_INTR
                 /* allocate IRQ only if board has an IRQ */
-               if( (1 < cy_pci_irq) && (cy_pci_irq < 15) ) {
-                   if(request_irq(cy_pci_irq,cyz_interrupt,
-                       SA_SHIRQ,"Cyclades-Z",&cy_card[j]))
+               if( (cy_pci_irq != 0) && (cy_pci_irq != 255) ) {
+                   if(request_irq(cy_pci_irq, cyz_interrupt,
+                       SA_SHIRQ, "Cyclades-Z", &cy_card[j]))
                    {
                        printk("Could not allocate IRQ%d ",
                            cy_pci_irq);
@@ -4965,6 +5277,7 @@ cy_detect_pci(void))
                        return(i);
                    }
                }
+#endif /* CONFIG_CYZ_INTR */
 
                 /* set cy_card */
                 cy_card[j].base_addr = cy_pci_addr2;
@@ -4976,7 +5289,7 @@ cy_detect_pci(void))
 
                 /* print message */
                /* don't report IRQ if board is no IRQ */
-               if( (cy_pci_irq < 15) && (cy_pci_irq > 1) ) {
+               if( (cy_pci_irq != 0) && (cy_pci_irq != 255) ) {
                    printk("Cyclades-Ze/PCI #%d: 0x%lx-0x%lx, IRQ%d, ",
                        j+1,(ulong)cy_pci_addr2,
                        (ulong)(cy_pci_addr2 + CyPCI_Ze_win - 1),
@@ -4988,6 +5301,11 @@ cy_detect_pci(void))
                }
                 printk("%d channels starting from port %d.\n",
                    cy_pci_nchan,cy_next_channel);
+#ifdef CONFIG_CYZ_INTR
+               /* Enable interrupts on the PLX chip */
+               cy_writew(cy_pci_addr0+0x68,
+                       cy_readw(cy_pci_addr0+0x68)|0x0900);
+#endif /* CONFIG_CYZ_INTR */
                 cy_next_channel += cy_pci_nchan;
         }
        if (ZeIndex != 0) {
@@ -5096,8 +5414,8 @@ done:
     extra ports are ignored.
  */
 
-__initfunc(int
-cy_init(void))
+int __init 
+cy_init(void)
 {
   struct cyclades_port  *info;
   struct cyclades_card *cinfo;
@@ -5217,6 +5535,7 @@ cy_init(void))
                mailbox = cy_readl(&((struct RUNTIME_9060 *)
                             cy_card[board].ctl_addr)->mail_box_0);
                nports = (mailbox == ZE_V1) ? ZE_V1_NPORTS : 8;
+               cinfo->intr_enabled = 0;
                 for (port = cinfo->first_line ;
                      port < cinfo->first_line + nports;
                      port++)
@@ -5340,15 +5659,17 @@ cy_init(void))
                 }
             }
     }
-    
-    if ( number_z_boards && !cyz_timeron){
-        cyz_timeron++;
+
+#ifndef CONFIG_CYZ_INTR
+    if (number_z_boards && !cyz_timeron){
+       cyz_timeron++;
        cyz_timerlist.expires = jiffies + 1;
        add_timer(&cyz_timerlist);
 #ifdef CY_PCI_DEBUG
        printk("Cyclades-Z polling initialized\n");
 #endif
     }
+#endif /* CONFIG_CYZ_INTR */
 
 #ifdef CY_PROC
         ent = create_proc_entry("cyclades", S_IFREG | S_IRUGO, 0);
@@ -5375,10 +5696,12 @@ cleanup_module(void)
     int e1, e2;
     unsigned long flags;
 
+#ifndef CONFIG_CYZ_INTR
     if (cyz_timeron){
        cyz_timeron = 0;
        del_timer(&cyz_timerlist);
     }
+#endif /* CONFIG_CYZ_INTR */
 
     save_flags(flags); cli();
     remove_bh(CYCLADES_BH);
@@ -5394,6 +5717,9 @@ cleanup_module(void)
 
     for (i = 0; i < NR_CARDS; i++) {
         if (cy_card[i].base_addr != 0
+#ifndef CONFIG_CYZ_INTR
+           && cy_card[i].num_chips != -1 /* not a Z card */
+#endif /* CONFIG_CYZ_INTR */
            && cy_card[i].irq)
         {
             free_irq(cy_card[i].irq, &cy_card[i]);
index 29e9f7f81f417d7d0dfdeb9be1b03b24c1fc770e..eceb50f6ce78935db75a32f4f618468f738ffc01 100644 (file)
@@ -570,7 +570,7 @@ static struct miscdevice apollo_mouse = {
         APOLLO_MOUSE_MINOR, "apollomouse", &apollo_mouse_fops
 };
 
-__initfunc(int dn_keyb_init(void)) {
+int __init dn_keyb_init(void){
 
 /*  printk("dn_keyb_init\n"); */
 
index 4d697cd448f4f201a485472ce75d3d876cc89464..4df4a1e2b5b99c09cde0d595921c63869755bbc2 100644 (file)
@@ -519,8 +519,7 @@ static struct file_operations dsp56k_fops = {
 
 
 /****** Init and module functions ******/
-
-__initfunc(int dsp56k_init(void))
+int __init dsp56k_init(void)
 {
        if(!MACH_IS_ATARI || !ATARIHW_PRESENT(DSP56K)) {
                printk("DSP56k driver: Hardware not present\n");
index e4d98cc0c00e6bc2e5c3ccb2dc9bf7df37951c67..5117946425a821a23b8fe941b2e14e2808116749 100644 (file)
@@ -2525,7 +2525,7 @@ static _INLINE_ int autoconfig(struct esp_struct * info, int *region_start)
 /*
  * The serial driver boot-time initialization code!
  */
-__initfunc(int espserial_init(void))
+int __init espserial_init(void)
 {
        int i, offset;
        int region_start;
index 28cdd5739e01a73a3fb78495bcad1345aca15eda..c589a06fff895f6f282673cfa99c98697f109e55 100644 (file)
@@ -64,7 +64,7 @@ char ft_dat[] __initdata = "$Date: 1997/11/06 00:38:08 $";
 /*  Called by modules package when installing the driver
  *  or by kernel during the initialization phase
  */
-__initfunc(int ftape_init(void))
+int __init ftape_init(void)
 {
        TRACE_FUN(ft_t_flow);
 
index 7ba77804857e8afde4822209d9e2c3e04fc104cf..edae52c3824678e44d7ce7db74203d03b097bb4e 100644 (file)
@@ -421,7 +421,7 @@ int ftape_read_proc(char *page, char **start, off_t off,
        return len;
 }
 
-__initfunc(int ftape_proc_init(void))
+int __init ftape_proc_init(void)
 {
        return FT_PROC_REGISTER(&proc_root, &proc_ftape);
 }
index 5cb89c6946265c1dbd48fa0fc35deaef5738f69e..01c231bb0c4fdf3ff98ace6cc3419567d890e790 100644 (file)
@@ -60,7 +60,7 @@ static struct param_table {
        { "mach2",     &ft_mach2,          CONFIG_FT_MACH2,          0,     1}
 };
 
-__initfunc(void ftape_setup(char *str, int *ints))
+void __init ftape_setup(char *str, int *ints)
 {
        int i;
        int param;
index 10ac9929223a1bca0c7f41987e0afbd0875b0ec0..6dbf2c9cd64e9882ee906c02da073fa9dec19a04 100644 (file)
@@ -414,7 +414,7 @@ extern int zft_compressor_init(void);
 /*  Called by modules package when installing the driver or by kernel
  *  during the initialization phase
  */
-__initfunc(int zft_init(void))
+int __init zft_init(void)
 {
        TRACE_FUN(ft_t_flow);
 
index 3d2980e4f83163dc0ad00cc59f712c3f4331b39f..a865689c13171fd5be7078dcf1445799b25eae0d 100644 (file)
@@ -159,7 +159,7 @@ static void parptt_wakeup(void *handle)
 }
 
 /* --------------------------------------------------------------------- */
-__initfunc(static int check_lpt(struct hfmodem_state *dev, unsigned int iobase))
+static int __init check_lpt(struct hfmodem_state *dev, unsigned int iobase)
 {
        struct parport *pp = parport_enumerate();
 
@@ -178,7 +178,7 @@ __initfunc(static int check_lpt(struct hfmodem_state *dev, unsigned int iobase))
 enum uart { c_uart_unknown, c_uart_8250, c_uart_16450, c_uart_16550, c_uart_16550A };
 static const char *uart_str[] __initdata = { "unknown", "8250", "16450", "16550", "16550A" };
 
-__initfunc(static enum uart check_uart(unsigned int iobase))
+static enum uart __init check_uart(unsigned int iobase)
 {
         unsigned char b1,b2,b3;
         enum uart u;
@@ -214,7 +214,7 @@ __initfunc(static enum uart check_uart(unsigned int iobase))
 
 /* --------------------------------------------------------------------- */
 
-__initfunc(static int check_midi(unsigned int iobase))
+static int __init check_midi(unsigned int iobase)
 {
         unsigned long timeout;
         unsigned long flags;
@@ -262,7 +262,7 @@ static void output_status(struct hfmodem_state *dev, int ptt)
 
 /* --------------------------------------------------------------------- */
 
-__initfunc(static void output_check(struct hfmodem_state *dev))
+static void __init output_check(struct hfmodem_state *dev)
 {
         enum uart u = c_uart_unknown;
 
@@ -624,7 +624,7 @@ MODULE_PARM_DESC(rdtsc_ok, "Set to 0 to disable the use of the rdtsc instruction
 
 #endif
 
-__initfunc(int init_module(void))
+int __init init_module(void)
 {
        int i;
 
@@ -677,7 +677,7 @@ void cleanup_module(void)
 
 static int hw = 0;
 
-__initfunc(void hfmodem_setup(char *str, int *ints))
+void __init hfmodem_setup(char *str, int *ints)
 {
         if (ints[0] < 7) {
                 printk(KERN_WARNING "%s: setup: too few parameters\n", hfmodem_drvname);
@@ -698,7 +698,7 @@ __initfunc(void hfmodem_setup(char *str, int *ints))
         hfmodem_refclock_setscale(ints[ints[0]-2], ints[ints[0]-1], ints[ints[0]]);
 }
 
-__initfunc(void hfmodem_init(void))
+void __init hfmodem_init(void)
 {
         int i;
 
index 2ca829fbf77921d39a753e91911a5971b1746a6f..20153c02b255c42f1f318422cdbd087e3c6b4fa0 100644 (file)
@@ -66,7 +66,7 @@ static int rdtsc_ok = 1;
 /* --------------------------------------------------------------------- */
 
 #ifdef __i386__
-__initfunc(static void i386_capability(void))
+static void __init i386_capability(void)
 {
        if (boot_cpu_data.x86_capability & X86_FEATURE_TSC)
                rdtsc_ok = 1;
@@ -77,7 +77,7 @@ __initfunc(static void i386_capability(void))
 
 /* --------------------------------------------------------------------- */
 
-__initfunc(void hfmodem_refclock_probe(void))
+void __init hfmodem_refclock_probe(void)
 {
 #ifdef __i386__
        if (rdtsc_ok) {
index ded35916ced647ac0ab173979f9520d8f62bffd3..7a7d73c0665a54a359e1db28cc20a64a43773a19 100644 (file)
@@ -34,6 +34,9 @@
  * 971222       Changed open/close for temperature handling
  *              Michael Meskes <meskes@debian.org>.
  * 980112       Used minor numbers from include/linux/miscdevice.h
+ * 990605      Made changes to code to support Firmware 1.22a, added
+ *             fairly useless proc entry.
+ * 990610      removed said useless proc code for the merge <alan>
  */
 
 #include <linux/module.h>
@@ -55,6 +58,7 @@
 #include <linux/mm.h>
 #include <linux/watchdog.h>
 #include <linux/init.h>
+#include <linux/proc_fs.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -67,7 +71,7 @@
  */
 static int pcwd_ioports[] = { 0x270, 0x350, 0x370, 0x000 };
 
-#define WD_VER                  "1.0 (11/18/96)"
+#define WD_VER                  "1.10 (06/05/99)"
 
 /*
  * It should be noted that PCWD_REVISION_B was removed because A and B
@@ -99,7 +103,7 @@ static int is_open, initial_status, supports_temp, mode_debug;
  * This routine checks the "current_readport" to see if the card lies there.
  * If it does, it returns accordingly.
  */
-__initfunc(static int pcwd_checkcard(void))
+static int __init pcwd_checkcard(void)
 {
        int card_dat, prev_card_dat, found = 0, count = 0, done = 0;
 
@@ -228,10 +232,9 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
        int i, cdat, rv;
        static struct watchdog_info ident=
        {
-               /* FIXME: should set A/C here */
                WDIOF_OVERHEAT|WDIOF_CARDRESET,
                1,
-               "PCWD."
+               "PCWD"
        };
 
        switch(cmd) {
@@ -408,8 +411,11 @@ static ssize_t pcwd_read(struct file *file, char *buf, size_t count,
        switch(MINOR(file->f_dentry->d_inode->i_rdev)) 
        {
                case TEMP_MINOR:
-                       /* c is in celsius, we need fahrenheit */
-                       cp = (c*9/5)+32;
+                       /*
+                        * Convert metric to Fahrenheit, since this was
+                        * the decided 'standard' for this return value.
+                        */
+                       cp = (c * 9 / 5) + 32;
                        if(copy_to_user(buf, &cp, 1))
                                return -EFAULT;
                        return 1;
@@ -450,7 +456,7 @@ static inline int get_revision(void)
        return(PCWD_REVISION_C);
 }
 
-__initfunc(static int send_command(int cmd))
+static int __init send_command(int cmd)
 {
        int i;
 
@@ -506,6 +512,38 @@ static void debug_off(void)
        mode_debug = 0;
 }
 
+static int pcwd_proc_get_info(char *buffer, char **start, off_t offset,
+       int length, int inout)
+{
+       int len;
+       off_t begin = 0;
+       
+       revision = get_revision();
+       len = sprintf(buffer, "Version = " WD_VER "\n");
+       
+       if (revision == PCWD_REVISION_A)
+               len += sprintf(buffer + len, "Revision = A\n");
+       else
+               len += sprintf(buffer + len, "Revision = C\n");
+       
+       if (supports_temp) {
+               unsigned short c = inb(current_readport);
+               
+               len += sprintf(buffer + len, "Temp = Yes\n"
+                       "Current temp = %d (Celsius)\n",
+                       c);
+       } else
+               len += sprintf(buffer + len, "Temp = No\n");
+       
+       *start = buffer + (offset);
+       len -= offset;
+
+       if (len > length)
+               len = length;
+       
+       return len;
+}
+
 static struct file_operations pcwd_fops = {
        NULL,           /* Seek */
        pcwd_read,      /* Read */
@@ -539,14 +577,14 @@ static struct miscdevice temp_miscdev = {
 #ifdef MODULE
 int init_module(void)
 #else
-__initfunc(int pcwatchdog_init(void))
+int __init pcwatchdog_init(void)
 #endif
 {
        int i, found = 0;
 
        revision = PCWD_REVISION_A;
 
-       printk("pcwd: v%s Ken Hollis (khollis@nurk.org)\n", WD_VER);
+       printk("pcwd: v%s Ken Hollis (kenji@bitgate.com)\n", WD_VER);
 
        /* Initial variables */
        is_open = 0;
@@ -589,6 +627,9 @@ __initfunc(int pcwatchdog_init(void))
                return -1;
        }
 
+       if (supports_temp)
+               printk("pcwd: Temperature Option Detected.\n");
+
        debug_off();
 
        pcwd_showprevstate();
index aa22774a5ff3cf42fc4bf1ee6770c821059b90b1..53b90d071b01130b93914823b818762b3ccf56b1 100644 (file)
@@ -2216,7 +2216,7 @@ static int qic02_tape_open_no_use_count(struct inode * inode, struct file * filp
     }
     
        /* Only one at a time from here on... */
-    if (atomic_read(&filp->f_count)>1)         /* filp->f_count==1 for the first open() */
+    if (file_count(filp)>1)    /* filp->f_count==1 for the first open() */
     {
        return -EBUSY;
     }
index dc5c2e3843b61a3319dcffb8d56f64240dd779e1..a851b5bf34d4f3d0fcdbdcd0faaa29f2db234ac3 100644 (file)
@@ -18,6 +18,7 @@
  *              Auvo Häkkinen <Auvo.Hakkinen@cs.Helsinki.FI>
  */
  
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
index 20259994877bb8d2d587e452fba788018faa5ef7..1cf2307b3f6b7a791726077bd735d1391a6a80ce 100644 (file)
@@ -747,8 +747,8 @@ amd7930_card_msg(struct IsdnCardState *cs, int mt, void *arg)
        return(0);
 }
 
-__initfunc(int
-setup_amd7930(struct IsdnCard *card))
+int __init 
+setup_amd7930(struct IsdnCard *card)
 {
        struct IsdnCardState *cs = card->cs;
        char tmp[64];
index 4990f9eb82e0de2c298e7c2942dade65e5c727d1..eeaad83f5ddcecd2301c758c13cfc74256ac17ab 100644 (file)
@@ -334,8 +334,8 @@ Asus_card_msg(struct IsdnCardState *cs, int mt, void *arg)
        return(0);
 }
 
-__initfunc(int
-setup_asuscom(struct IsdnCard *card))
+int __init 
+setup_asuscom(struct IsdnCard *card)
 {
        int bytecnt;
        struct IsdnCardState *cs = card->cs;
index 5c5f944d44c23162bd692dae407d1c76c3724820..e782708fb74472f65e5be7edb98d20460c6d78c3 100644 (file)
@@ -234,8 +234,8 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
        return(0);
 }
 
-__initfunc(int
-setup_avm_a1(struct IsdnCard *card))
+int __init 
+setup_avm_a1(struct IsdnCard *card)
 {
        u_char val;
        struct IsdnCardState *cs = card->cs;
index 7ca2de9e4051a70c86a9026581ac1de179522c87..d3bf31d90aea23c04ea400b819980c3026ce1eb3 100644 (file)
@@ -442,8 +442,8 @@ HiSax_mod_inc_use_count(void)
 #ifdef MODULE
 #define HiSax_init init_module
 #else
-__initfunc(void
-HiSax_setup(char *str, int *ints))
+void __init 
+HiSax_setup(char *str, int *ints)
 {
        int i, j, argc;
 
@@ -1236,8 +1236,8 @@ HiSax_reportcard(int cardnr)
 }
 
 
-__initfunc(int
-HiSax_init(void))
+int __init 
+HiSax_init(void)
 {
        int i;
 
index 4baf740b1dcbfa7bea1a35c2d5810c0bfaeec8cc..9774b2218b074a393aa65aa7a019b2b4e03f38f5 100644 (file)
@@ -459,8 +459,8 @@ Diva_card_msg(struct IsdnCardState *cs, int mt, void *arg)
 static         struct pci_dev *dev_diva __initdata = NULL;
 static         struct pci_dev *dev_diva_u __initdata = NULL;
 
-__initfunc(int
-setup_diva(struct IsdnCard *card))
+int __init 
+setup_diva(struct IsdnCard *card)
 {
        int bytecnt;
        u_char val;
index 701ec21563cb39844cc40e8e940ef62ae4076608..b8ffa4948682dfd518903bb8570b3f1c0a9680fc 100644 (file)
@@ -744,8 +744,8 @@ extern struct foreign_interface amd7930_foreign_interface;
 extern struct foreign_interface dbri_foreign_interface;
 #endif
 
-__initfunc(int
-setup_foreign(struct IsdnCard *card))
+int __init 
+setup_foreign(struct IsdnCard *card)
 {
        struct IsdnCardState *cs = card->cs;
        char tmp[64];
index b649c55f43c31a5a40aceb0f0d27656258681338..4e734b2c6fa12f3a9f24f83b07c16000986f6ddc 100644 (file)
@@ -1166,8 +1166,8 @@ hfc_dbusy_timer(struct IsdnCardState *cs)
 #endif
 }
 
-__initfunc(unsigned int
-*init_send_hfcd(int cnt))
+unsigned int __init 
+*init_send_hfcd(int cnt)
 {
        int i, *send;
 
@@ -1181,8 +1181,8 @@ __initfunc(unsigned int
        return(send);
 }
 
-__initfunc(void
-init2bds0(struct IsdnCardState *cs))
+void __init 
+init2bds0(struct IsdnCardState *cs)
 {
        cs->setstack_d = setstack_hfcd;
        cs->dbusytimer.function = (void *) hfc_dbusy_timer;
index 26d47b936b41d73565bf72411278fd04710d58c6..13225cb7af121354b1c9143eda9f35087948a883 100644 (file)
@@ -555,8 +555,8 @@ setstack_hfc(struct PStack *st, struct BCState *bcs)
        return (0);
 }
 
-__initfunc(void
-init_send(struct BCState *bcs))
+void __init 
+init_send(struct BCState *bcs)
 {
        int i;
 
@@ -569,8 +569,8 @@ init_send(struct BCState *bcs))
                bcs->hw.hfc.send[i] = 0x1fff;
 }
 
-__initfunc(void
-inithfc(struct IsdnCardState *cs))
+void __init 
+inithfc(struct IsdnCardState *cs)
 {
        init_send(&cs->bcs[0]);
        init_send(&cs->bcs[1]);
index 009783b6d715c63c5a417a63c310fc5de63f9bef..732e2b8a71b31064ac053ce549f27c0241eaf35c 100644 (file)
@@ -289,8 +289,8 @@ ix1_card_msg(struct IsdnCardState *cs, int mt, void *arg)
 }
 
 
-__initfunc(int
-setup_ix1micro(struct IsdnCard *card))
+int __init 
+setup_ix1micro(struct IsdnCard *card)
 {
        struct IsdnCardState *cs = card->cs;
        char tmp[64];
index ccd103feded2a94bcb9acc28ce70f9b489dd9990..4f147462487f95dd9d7a0069a4183d318483aaab 100644 (file)
@@ -231,8 +231,8 @@ mic_card_msg(struct IsdnCardState *cs, int mt, void *arg)
        return(0);
 }
 
-__initfunc(int
-setup_mic(struct IsdnCard *card))
+int __init 
+setup_mic(struct IsdnCard *card)
 {
        int bytecnt;
        struct IsdnCardState *cs = card->cs;
index 746451ba07bf6db91f706fd119818ba3d372daae..75696ad2c1ca649986c1bc7deb51a291bba712c0 100644 (file)
@@ -858,8 +858,8 @@ setstack_tiger(struct PStack *st, struct BCState *bcs)
 }
 
  
-__initfunc(void
-inittiger(struct IsdnCardState *cs))
+void __init 
+inittiger(struct IsdnCardState *cs)
 {
        if (!(cs->bcs[0].hw.tiger.send = kmalloc(NETJET_DMA_SIZE * sizeof(unsigned int),
                GFP_KERNEL | GFP_DMA))) {
@@ -1050,8 +1050,8 @@ NETjet_card_msg(struct IsdnCardState *cs, int mt, void *arg)
 
 static         struct pci_dev *dev_netjet __initdata = NULL;
 
-__initfunc(int
-setup_netjet(struct IsdnCard *card))
+int __init 
+setup_netjet(struct IsdnCard *card)
 {
        int bytecnt;
        struct IsdnCardState *cs = card->cs;
index 13717f856a6e27058fbfc0fd690336518476635e..4a4f0d7c388d6f1614200ec593ee39f59d177024 100644 (file)
@@ -263,8 +263,8 @@ niccy_card_msg(struct IsdnCardState *cs, int mt, void *arg)
 
 static         struct pci_dev *niccy_dev __initdata = NULL;
 
-__initfunc(int
-setup_niccy(struct IsdnCard *card))
+int __init 
+setup_niccy(struct IsdnCard *card)
 {
        struct IsdnCardState *cs = card->cs;
        char tmp[64];
index 85e64001a37d2e504956d710a5d290300aac607f..105c9a380725f001a38138ea695d5210ccb319a6 100644 (file)
@@ -533,8 +533,8 @@ Sedl_card_msg(struct IsdnCardState *cs, int mt, void *arg)
 static  int pci_index __initdata = 0;
 #endif
 
-__initfunc(int
-setup_sedlbauer(struct IsdnCard *card))
+int __init 
+setup_sedlbauer(struct IsdnCard *card)
 {
        int bytecnt, ver, val;
        struct IsdnCardState *cs = card->cs;
index 655abfadc534cd3be218f994826198f874e17b6e..ec2240b19b1ccddb4f1f29932874a33d74fe29e5 100644 (file)
@@ -204,8 +204,8 @@ Sportster_card_msg(struct IsdnCardState *cs, int mt, void *arg)
        return(0);
 }
 
-__initfunc(int
-get_io_range(struct IsdnCardState *cs))
+int __init 
+get_io_range(struct IsdnCardState *cs)
 {
        int i, j, adr;
        
@@ -230,8 +230,8 @@ get_io_range(struct IsdnCardState *cs))
        }
 }
 
-__initfunc(int
-setup_sportster(struct IsdnCard *card))
+int __init 
+setup_sportster(struct IsdnCard *card)
 {
        struct IsdnCardState *cs = card->cs;
        char tmp[64];
index 180eee6a1c404d3d7c5b1fbc34181294855f325b..b37aded8921e9b76607185d8b7ac800e9844638e 100644 (file)
@@ -289,8 +289,8 @@ TeleInt_card_msg(struct IsdnCardState *cs, int mt, void *arg)
        return(0);
 }
 
-__initfunc(int
-setup_TeleInt(struct IsdnCard *card))
+int __init 
+setup_TeleInt(struct IsdnCard *card)
 {
        struct IsdnCardState *cs = card->cs;
        char tmp[64];
index 3137a8b7e19cb019b2d090773f91c4e1d474ec2c..c562de877d37681a96b2cbaf51ad6d8344a7e86b 100644 (file)
@@ -302,8 +302,8 @@ Teles_card_msg(struct IsdnCardState *cs, int mt, void *arg)
        return(0);
 }
 
-__initfunc(int
-setup_teles0(struct IsdnCard *card))
+int __init 
+setup_teles0(struct IsdnCard *card)
 {
        u_char val;
        struct IsdnCardState *cs = card->cs;
index 297ccb740f969acb7b7bf9b344045fc7a414295b..addc0dbf1e93d874de8a9067f4d0d3a9381c18a1 100644 (file)
@@ -321,8 +321,8 @@ Teles_card_msg(struct IsdnCardState *cs, int mt, void *arg)
        return(0);
 }
 
-__initfunc(int
-setup_teles3(struct IsdnCard *card))
+int __init 
+setup_teles3(struct IsdnCard *card)
 {
        u_char val;
        struct IsdnCardState *cs = card->cs;
index 8ba6a311a70b9508f1f251390f21d40cf6f9ab06..1704f8267fb70f3b9d2832fbb41a55a07746c883 100644 (file)
@@ -140,8 +140,8 @@ t163c_card_msg(struct IsdnCardState *cs, int mt, void *arg)
        return(0);
 }
 
-__initfunc(int
-setup_t163c(struct IsdnCard *card))
+int __init 
+setup_t163c(struct IsdnCard *card)
 {
        struct IsdnCardState *cs = card->cs;
        char tmp[64];
index 7c4945f0656f2d2944e30fe0eb19122e45540e1a..4fbeba668c2eb7b24b442b44686094467cfa9aa0 100644 (file)
@@ -708,7 +708,36 @@ size_t parport_ieee1284_epp_write_data (struct parport *port,
                                        const void *buffer, size_t len,
                                        int flags)
 {
-       return 0; /* FIXME */
+       /* This is untested */
+       unsigned char *bp = (unsigned char *) buffer;
+       size_t ret = 0;
+
+       parport_frob_control (port,
+                             PARPORT_CONTROL_STROBE |
+                             PARPORT_CONTROL_AUTOFD |
+                             PARPORT_CONTROL_SELECT,
+                             PARPORT_CONTROL_STROBE |
+                             PARPORT_CONTROL_SELECT);
+       port->ops->data_forward (port);
+       for (; len > 0; len--, bp++) {
+               parport_write_data (port, *bp);
+
+               if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY,
+                                            PARPORT_STATUS_BUSY))
+                       break;
+
+               /* Strobe data */
+               parport_frob_control (port, PARPORT_CONTROL_AUTOFD,
+                                     PARPORT_CONTROL_AUTOFD);
+
+               if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY, 0))
+                       break;
+
+               parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
+               ret++;
+       }
+
+       return ret;
 }
 
 /* EPP mode, reverse channel, data. */
@@ -716,7 +745,34 @@ size_t parport_ieee1284_epp_read_data (struct parport *port,
                                       void *buffer, size_t len,
                                       int flags)
 {
-       return 0; /* FIXME */
+       /* This is untested. */
+       unsigned char *bp = (unsigned char *) buffer;
+       unsigned ret = 0;
+
+       parport_frob_control (port,
+                             PARPORT_CONTROL_STROBE |
+                             PARPORT_CONTROL_AUTOFD |
+                             PARPORT_CONTROL_SELECT, 0);
+       port->ops->data_reverse (port);
+       for (; len > 0; len--, bp++) {
+               if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY,
+                                            PARPORT_STATUS_BUSY))
+                       break;
+
+               parport_frob_control (port, PARPORT_CONTROL_AUTOFD,
+                                     PARPORT_CONTROL_AUTOFD);
+
+               if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY, 0))
+                       break;
+
+               *bp = parport_read_data (port);
+
+               parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
+               ret++;
+       }
+       port->ops->data_forward (port);
+
+       return ret;
 }
 
 /* EPP mode, forward channel, addresses. */
@@ -724,7 +780,36 @@ size_t parport_ieee1284_epp_write_addr (struct parport *port,
                                        const void *buffer, size_t len,
                                        int flags)
 {
-       return 0; /* FIXME */
+       /* This is untested */
+       unsigned char *bp = (unsigned char *) buffer;
+       size_t ret = 0;
+
+       parport_frob_control (port,
+                             PARPORT_CONTROL_STROBE |
+                             PARPORT_CONTROL_SELECT |
+                             PARPORT_CONTROL_AUTOFD,
+                             PARPORT_CONTROL_STROBE |
+                             PARPORT_CONTROL_SELECT);
+       port->ops->data_forward (port);
+       for (; len > 0; len--, bp++) {
+               parport_write_data (port, *bp);
+
+               if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY,
+                                            PARPORT_STATUS_BUSY))
+                       break;
+
+               /* Strobe data */
+               parport_frob_control (port, PARPORT_CONTROL_SELECT,
+                                     PARPORT_CONTROL_SELECT);
+
+               if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY, 0))
+                       break;
+
+               parport_frob_control (port, PARPORT_CONTROL_SELECT, 0);
+               ret++;
+       }
+
+       return ret;
 }
 
 /* EPP mode, reverse channel, addresses. */
@@ -732,5 +817,32 @@ size_t parport_ieee1284_epp_read_addr (struct parport *port,
                                       void *buffer, size_t len,
                                       int flags)
 {
-       return 0; /* FIXME */
+       /* This is untested. */
+       unsigned char *bp = (unsigned char *) buffer;
+       unsigned ret = 0;
+
+       parport_frob_control (port,
+                             PARPORT_CONTROL_STROBE |
+                             PARPORT_CONTROL_SELECT |
+                             PARPORT_CONTROL_AUTOFD, 0);
+       port->ops->data_reverse (port);
+       for (; len > 0; len--, bp++) {
+               if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY,
+                                            PARPORT_STATUS_BUSY))
+                       break;
+
+               parport_frob_control (port, PARPORT_CONTROL_SELECT,
+                                     PARPORT_CONTROL_SELECT);
+
+               if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY, 0))
+                       break;
+
+               *bp = parport_read_data (port);
+
+               parport_frob_control (port, PARPORT_CONTROL_SELECT, 0);
+               ret++;
+       }
+       port->ops->data_forward (port);
+
+       return ret;
 }
index 6c2a672ec3920ab7d9d3d88430999324bf77ecdd..029571460fe35c5bf1e82c3eaece57b73e0ac069 100644 (file)
@@ -210,7 +210,7 @@ struct net_local
 struct netdev_entry el1_drv = {"3c501", el1_probe1, EL1_IO_EXTENT, netcard_portlist};
 #else
 
-__initfunc(int el1_probe(struct device *dev))
+int __init el1_probe(struct device *dev)
 {
        int i;
        int base_addr = dev ? dev->base_addr : 0;
@@ -237,7 +237,7 @@ __initfunc(int el1_probe(struct device *dev))
  *     The actual probe.
  */
 
-__initfunc(static int el1_probe1(struct device *dev, int ioaddr))
+static int __init el1_probe1(struct device *dev, int ioaddr)
 {
        struct net_local *lp;
        const char *mname;              /* Vendor name */
index 9f922c43e9d0126895be15e8db5a790331140c7c..3c0ada25edb876ffbdd71c841892f58cfdd20797 100644 (file)
@@ -90,8 +90,8 @@ static void el2_get_8390_hdr(struct device *dev, struct e8390_pkt_hdr *hdr,
    If the ethercard isn't found there is an optional probe for
    ethercard jumpered to programmed-I/O mode.
    */
-__initfunc(int
-el2_probe(struct device *dev))
+int __init 
+el2_probe(struct device *dev)
 {
     int *addr, addrs[] = { 0xddffe, 0xd9ffe, 0xcdffe, 0xc9ffe, 0};
     int base_addr = dev->base_addr;
@@ -125,8 +125,8 @@ el2_probe(struct device *dev))
 #ifndef HAVE_DEVLIST
 /*  Try all of the locations that aren't obviously empty.  This touches
     a lot of locations, and is much riskier than the code above. */
-__initfunc(int
-el2_pio_probe(struct device *dev))
+int __init 
+el2_pio_probe(struct device *dev)
 {
     int i;
     int base_addr = dev ? dev->base_addr : 0;
@@ -151,8 +151,8 @@ el2_pio_probe(struct device *dev))
 /* Probe for the Etherlink II card at I/O port base IOADDR,
    returning non-zero on success.  If found, set the station
    address and memory parameters in DEVICE. */
-__initfunc(int
-el2_probe1(struct device *dev, int ioaddr))
+int __init 
+el2_probe1(struct device *dev, int ioaddr)
 {
     int i, iobase_reg, membase_reg, saved_406, wordlength;
     static unsigned version_printed = 0;
index 34edf220005ab4c69f4aca775ccbfc0155039b2d..5f587595386cbfc2a155cec868d75118a38c2b93 100644 (file)
@@ -1339,7 +1339,7 @@ static inline void elp_init(struct device *dev)
  * Called only by elp_autodetect
  ************************************************************/
 
-__initfunc(static int elp_sense(struct device *dev))
+static int __init elp_sense(struct device *dev)
 {
        int timeout;
        int addr = dev->base_addr;
@@ -1406,7 +1406,7 @@ __initfunc(static int elp_sense(struct device *dev))
  * Called only by eplus_probe
  *************************************************************/
 
-__initfunc(static int elp_autodetect(struct device *dev))
+static int __init elp_autodetect(struct device *dev)
 {
        int idx = 0;
 
@@ -1450,7 +1450,7 @@ __initfunc(static int elp_autodetect(struct device *dev))
  * work at all if it was in a weird state).
  */
 
-__initfunc(int elplus_probe(struct device *dev))
+int __init elplus_probe(struct device *dev)
 {
        elp_device *adapter;
        int i, tries, tries1, timeout, okay;
index b27fa21489eb320cde408ed34c854055c0a3fb0c..f53a17be89036e9bf5aad7d168f8987ba66f63d7 100644 (file)
@@ -305,7 +305,7 @@ struct netdev_entry netcard_drv =
        device and return success.
        */
 
-__initfunc(int el16_probe(struct device *dev))
+int __init el16_probe(struct device *dev)
 {
        int base_addr = dev ? dev->base_addr : 0;
        int i;
@@ -326,7 +326,7 @@ __initfunc(int el16_probe(struct device *dev))
        return ENODEV;
 }
 
-__initfunc(int el16_probe1(struct device *dev, int ioaddr))
+int __init el16_probe1(struct device *dev, int ioaddr)
 {
        static unsigned char init_ID_done = 0, version_printed = 0;
        int i, irq, irqval;
index 25daedb2dcbe83b30cfaa23a5f5db92542489100..958100d6678c8811aa1ba6811959adaec55c07d7 100644 (file)
@@ -319,7 +319,7 @@ static int elmc_open(struct device *dev)
  * Check to see if there's an 82586 out there.
  */
 
-__initfunc(static int check586(struct device *dev, unsigned long where, unsigned size))
+static int __init check586(struct device *dev, unsigned long where, unsigned size)
 {
        struct priv *p = (struct priv *) dev->priv;
        char *iscp_addrs[2];
@@ -422,7 +422,7 @@ static int elmc_getinfo(char *buf, int slot, void *d)
 
 /*****************************************************************/
 
-__initfunc(int elmc_probe(struct device *dev))
+int __init elmc_probe(struct device *dev)
 {
        static int slot = 0;
        int base_addr = dev ? dev->base_addr : 0;
index 947cf6d2df3a8da29945caaf68d9936642ef4867..33297b0e1c43f81b05b0dcbf55eacf5c27445331 100644 (file)
@@ -147,7 +147,7 @@ static void mc32_set_multicast_list(struct device *dev);
  * (detachable devices only).
  */
 
-__initfunc(int mc32_probe(struct device *dev))
+int __init mc32_probe(struct device *dev)
 {
        static int current_mca_slot = -1;
        int i;
@@ -183,7 +183,7 @@ __initfunc(int mc32_probe(struct device *dev))
  * probes on the ISA bus. A good device probes avoids doing writes, and
  * verifies that the correct device exists and functions.
  */
-__initfunc(static int mc32_probe1(struct device *dev, int slot))
+static int __init mc32_probe1(struct device *dev, int slot)
 {
        static unsigned version_printed = 0;
        int i;
index cd3ab6bd6a369b607af98d55f07f96018e212e04..1dcbd9f40ba6a7924abd79266da9412faa42ad1d 100644 (file)
@@ -878,7 +878,7 @@ static void print_eth(char *add)
        printk("type %2.2X%2.2X\n", (unsigned char) add[12], (unsigned char) add[13]);
 }
 
-__initfunc(int i82596_probe(struct device *dev))
+int __init i82596_probe(struct device *dev)
 {
        int i;
        struct i596_private *lp;
index aefc79a307c11d436c57be25aae3a031b7451870..af78dbe00a30279af19665cc0314a2526ab4b90b 100644 (file)
@@ -2,6 +2,9 @@
 # Network device configuration
 #
 
+mainmenu_option next_comment
+comment 'ARCnet devices'
+
 tristate 'ARCnet support' CONFIG_ARCNET
 if [ "$CONFIG_ARCNET" != "n" ]; then
   bool '  Enable arc0e (ARCnet "Ether-Encap" packet format)' CONFIG_ARCNET_ETH
@@ -12,6 +15,8 @@ if [ "$CONFIG_ARCNET" != "n" ]; then
   dep_tristate '  ARCnet COM20020 chipset driver' CONFIG_ARCNET_COM20020 $CONFIG_ARCNET
 fi
 
+endmenu
+
 tristate 'Dummy net driver support' CONFIG_DUMMY
 tristate 'EQL (serial line load balancing) support' CONFIG_EQUALIZER
 if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
@@ -22,6 +27,10 @@ fi
 #
 #      Ethernet
 #
+
+mainmenu_option next_comment
+comment 'Ethernet (10 or 100Mbit)'
+
 bool 'Ethernet (10 or 100Mbit)' CONFIG_NET_ETHERNET
 if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
   if [ "$CONFIG_ARM" = "y" ]; then
@@ -82,18 +91,15 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
       tristate 'RealTek 8129/8139 (not 8019/8029!) support' CONFIG_RTL8139
       tristate 'Packet Engines Yellowfin Gigabit-NIC support' CONFIG_YELLOWFIN
-      tristate 'Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support' CONFIG_ACENIC
   fi
   bool 'Other ISA cards' CONFIG_NET_ISA
   if [ "$CONFIG_NET_ISA" = "y" ]; then
-    tristate 'AT1700/1720 support' CONFIG_AT1700
+    tristate 'AT1700/1720 support (EXPERIMENTAL)' CONFIG_AT1700
     tristate 'Cabletron E21xx support' CONFIG_E2100
     tristate 'DEPCA, DE10x, DE200, DE201, DE202, DE422 support' CONFIG_DEPCA
     tristate 'EtherWORKS 3 (DE203, DE204, DE205) support' CONFIG_EWRK3
     tristate 'EtherExpress 16 support' CONFIG_EEXPRESS
-    if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-      tristate 'EtherExpressPro support' CONFIG_EEXPRESS_PRO
-    fi
+    tristate 'EtherExpressPro support' CONFIG_EEXPRESS_PRO
     tristate 'FMV-181/182/183/184 support' CONFIG_FMV18X
     tristate 'HP PCLAN+ (27247B and 27252A) support' CONFIG_HPLAN_PLUS
     tristate 'HP PCLAN (27245 and other 27xxx series) support' CONFIG_HPLAN
@@ -103,7 +109,7 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
     fi
     tristate 'NE2000/NE1000 support' CONFIG_NE2000
     if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-      bool 'SEEQ8005 support (EXPERIMENTAL)' CONFIG_SEEQ8005
+      tristate 'SEEQ8005 support (EXPERIMENTAL)' CONFIG_SEEQ8005
     fi
     bool 'SK_G16 support' CONFIG_SK_G16
   fi
@@ -115,6 +121,7 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
   if [ "$CONFIG_NET_EISA" = "y" ]; then
     tristate 'AMD PCnet32 (VLB and PCI) support' CONFIG_PCNET32
     if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+      tristate 'Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support' CONFIG_ACENIC
       tristate 'Ansel Communications EISA 3200 support (EXPERIMENTAL)' CONFIG_AC3200
     fi
 
@@ -145,6 +152,8 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
   fi
 fi
 
+endmenu
+
 bool 'FDDI driver support' CONFIG_FDDI
 if [ "$CONFIG_FDDI" = "y" ]; then
   bool 'Digital DEFEA and DEFPA adapter support' CONFIG_DEFXX
@@ -153,25 +162,20 @@ fi
 if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
   bool 'HIPPI driver support (EXPERIMENTAL)' CONFIG_HIPPI
   if [ "$CONFIG_HIPPI" = "y" ]; then
-    bool 'CERN HIPPI PCI adapter support' CONFIG_CERN_HIPPI
-    bool 'Essential RoadRunner HIPPI PCI adapter support' CONFIG_ROADRUNNER
+    tristate 'Essential RoadRunner HIPPI PCI adapter support' CONFIG_ROADRUNNER
     if [ "$CONFIG_ROADRUNNER" != "n" ]; then
       bool '  Use large TX/RX rings' CONFIG_ROADRUNNER_LARGE_RINGS
     fi
   fi
 fi
 
-tristate 'Frame relay DLCI support' CONFIG_DLCI
-if [ "$CONFIG_DLCI" = "y" -o "$CONFIG_DLCI" = "m" ]; then
-  int '  Max open DLCI' CONFIG_DLCI_COUNT 24
-  int '  Max DLCI per device' CONFIG_DLCI_MAX 8
-  dep_tristate '  SDLA (Sangoma S502/S508) support' CONFIG_SDLA $CONFIG_DLCI
-fi
-
 #
 # AppleTalk
 #
+
 if [ "$CONFIG_ATALK" != "n" ]; then
+  mainmenu_option next_comment
+  comment 'Appletalk devices'
   dep_tristate 'Apple/Farallon LocalTalk PC support' CONFIG_LTPC $CONFIG_ATALK
   dep_tristate 'COPS LocalTalk PC support' CONFIG_COPS $CONFIG_ATALK
   if [ "$CONFIG_COPS" != "n" ]; then
@@ -183,6 +187,7 @@ if [ "$CONFIG_ATALK" != "n" ]; then
      bool 'IP to Appletalk-IP Encapsulation support' CONFIG_IPDDP_ENCAP
      bool 'Appletalk-IP to IP Decapsulation support' CONFIG_IPDDP_DECAP
   fi
+  endmenu
 fi
 
 if [ ! "$CONFIG_PARPORT" = "n" ]; then
@@ -203,23 +208,38 @@ fi
 
 bool 'Wireless LAN (non-hamradio)' CONFIG_NET_RADIO
 if [ "$CONFIG_NET_RADIO" = "y" ]; then
-  tristate 'STRIP (Metricom starmode radio IP)' CONFIG_STRIP
+  dep_tristate 'STRIP (Metricom starmode radio IP)' CONFIG_STRIP $CONFIG_INET
   tristate 'AT&T WaveLAN & DEC RoamAbout DS support' CONFIG_WAVELAN
+  tristate 'Aironet Arlan 655 & IC2200 DS support' CONFIG_ARLAN
+
 fi
 
+mainmenu_option next_comment
+comment 'Token ring devices'
+
 bool 'Token Ring driver support' CONFIG_TR
 if [ "$CONFIG_TR" = "y" ]; then
   tristate 'IBM Tropic chipset based adaptor support' CONFIG_IBMTR
 #  tristate 'IBM Lanstreamer PCI adaptor support' CONFIG_IBMLS
+  tristate 'IBM Olympic chipset PCI adapter support' CONFIG_IBMOL
   tristate 'SysKonnect adapter support' CONFIG_SKTR
 fi
 
+endmenu
+
 if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+  tristate 'Red Creek Hardware VPN (EXPERIMENTAL)' CONFIG_RCPCI
   tristate 'Traffic Shaper (EXPERIMENTAL)' CONFIG_SHAPER
 fi
+
 #
 # WAN drivers support
 #
+
+mainmenu_option next_comment
+comment 'Wan interfaces'
+
+
 # There is no way to detect a comtrol sv11 - force it modular for now.
 #
 dep_tristate 'Comtrol Hostess SV-11 support' CONFIG_HOSTESS_SV11 m
@@ -227,8 +247,22 @@ dep_tristate 'Comtrol Hostess SV-11 support' CONFIG_HOSTESS_SV11 m
 # The COSA/SRP driver has not been tested as non-modular yet.
 #
 dep_tristate 'COSA/SRP sync serial boards support' CONFIG_COSA m
-tristate 'Red Creek Hardware VPN (EXPERIMENTAL)' CONFIG_RCPCI
 #
+# There is no way to detect a Sealevel board. Force it modular
+#
+dep_tristate 'Sealevel Systems 4021 support' CONFIG_SEALEVEL_4021 m
+
+tristate 'Frame relay DLCI support' CONFIG_DLCI
+if [ "$CONFIG_DLCI" != "n" ]; then
+  int '  Max open DLCI' CONFIG_DLCI_COUNT 24
+  int '  Max DLCI per device' CONFIG_DLCI_MAX 8
+  dep_tristate '  SDLA (Sangoma S502/S508) support' CONFIG_SDLA $CONFIG_DLCI
+fi
+
+#
+#      Wan router core.
+#
+
 if [ "$CONFIG_WAN_ROUTER" != "n" ]; then
   bool 'WAN drivers' CONFIG_WAN_DRIVERS
   if [ "$CONFIG_WAN_DRIVERS" = "y" ]; then
index 5e2a45bcec33f85be282049760ef25e63c7fe6e2..381ae5dfca4bfa52be6eaed6b51836691e312b0d 100644 (file)
@@ -67,6 +67,14 @@ else
   endif
 endif
 
+ifeq ($(CONFIG_IBMOL),y)
+L_OBJS += olympic.o
+else
+  ifeq ($(CONFIG_IBMOL),m)
+  M_OBJS += olympic.o
+  endif
+endif
+
 ifeq ($(CONFIG_SKTR),y)
 L_OBJS += sktr.o
 else
@@ -422,6 +430,14 @@ else
   endif
 endif
 
+ifeq ($(CONFIG_SUNBMAC),y)
+L_OBJS += sunbmac.o
+else
+  ifeq ($(CONFIG_SUNBMAC),m)
+  M_OBJS += sunbmac.o
+  endif
+endif
+
 ifeq ($(CONFIG_MYRI_SBUS),y)
 L_OBJS += myri_sbus.o
 else
@@ -566,6 +582,14 @@ else
   endif
 endif
 
+ifeq ($(CONFIG_ARLAN),y)
+LX_OBJS += arlan.o arlan-proc.o
+else
+  ifeq ($(CONFIG_ARLAN),m)
+  MX_OBJS += arlan.o arlan-proc.o
+  endif
+endif
+
 ifeq ($(CONFIG_TLAN),y)
 L_OBJS += tlan.o
 else
@@ -764,6 +788,19 @@ else
   endif
 endif
 
+ifeq ($(CONFIG_SEALEVEL_4021),y)
+L_OBJS += sealevel.o
+CONFIG_85230_BUILTIN = y
+CONFIG_SYNCPPP_BUILTIN = y
+else
+  ifeq ($(CONFIG_SEALEVEL_4021),m)
+  CONFIG_85230_MODULE = y
+  CONFIG_SYNCPPP_MODULE = y
+  M_OBJS += sealevel.o
+  endif
+endif
+
+
 ifeq ($(CONFIG_COSA),y)
 L_OBJS += cosa.o
 CONFIG_SYNCPPP_BUILTIN = y
@@ -1064,15 +1101,6 @@ ifeq ($(CONFIG_CYCLADES_SYNC),y)
   endif
 endif
 
-ifeq ($(CONFIG_CYCLADES_SYNC),m)
-  MX_OBJS += cycx_drv.o
-  M_OBJS += cyclomx.o
-  CYCLOMX_OBJS = cycx_main.o
-  ifeq ($(CONFIG_CYCLOMX_X25),y)
-    CYCLOMX_OBJS += cycx_x25.o
-  endif
-endif
-
 ifeq ($(CONFIG_X25_ASY),y)
 L_OBJS += x25_asy.o
 else
index ce0e467841a7c2e1b6740d7be2b039dfc1d60ffb..fd660f2ab9122d0b6f8701ad3984a9df977401ae 100644 (file)
@@ -67,6 +67,7 @@ extern int ewrk3_probe(struct device *);
 extern int de4x5_probe(struct device *);
 extern int el1_probe(struct device *);
 extern int wavelan_probe(struct device *);
+extern int arlan_probe(struct device *);
 extern int el16_probe(struct device *);
 extern int elmc_probe(struct device *);
 extern int skmca_probe(struct device *);
@@ -147,7 +148,7 @@ struct devprobe
  * autoprobe (i.e. a probe that fails to find a card when autoprobing
  * will not be asked to autoprobe again).  It exits when a card is found.
  */
-__initfunc(static int probe_list(struct device *dev, struct devprobe *plist))
+static int __init probe_list(struct device *dev, struct devprobe *plist)
 {
        struct devprobe *p = plist;
        unsigned long base_addr = dev->base_addr;
@@ -359,6 +360,9 @@ struct devprobe isa_probes[] __initdata = {
 #ifdef CONFIG_WAVELAN          /* WaveLAN */
        {wavelan_probe, 0},
 #endif
+#ifdef CONFIG_ARLAN            /* Aironet */
+       {arlan_probe, 0},
+#endif
 #ifdef CONFIG_EL16             /* 3c507 */
        {el16_probe, 0},
 #endif
@@ -474,7 +478,7 @@ struct devprobe arm_probes[] __initdata = {
  * Unified ethernet device probe, segmented per architecture and
  * per bus interface.
  */
-__initfunc(static int ethif_probe(struct device *dev))
+static int __init ethif_probe(struct device *dev)
 {
        unsigned long base_addr = dev->base_addr;
 
@@ -522,7 +526,7 @@ __initfunc(static int ethif_probe(struct device *dev))
 }
 
 #ifdef CONFIG_FDDI
-__initfunc(static int fddiif_probe(struct device *dev))
+static int __init fddiif_probe(struct device *dev)
 {
     unsigned long base_addr = dev->base_addr;
 
@@ -719,6 +723,7 @@ struct device eql_dev = {
 #ifdef CONFIG_TR
 /* Token-ring device probe */
 extern int ibmtr_probe(struct device *);
+extern int olympic_probe(struct device *);
 
 static int
 trif_probe(struct device *dev)
@@ -727,6 +732,9 @@ trif_probe(struct device *dev)
 #ifdef CONFIG_IBMTR
        && ibmtr_probe(dev)
 #endif
+#ifdef CONFIG_IBMOL
+       && olympic_probe(dev)
+#endif
 #ifdef CONFIG_SKTR
        && sktr_probe(dev)
 #endif
index 037fc8209387a7848e35ef4b822abf5a3cd1ccb8..348b2e790452d1895fa527d6b0c627ce90e364ff 100644 (file)
@@ -739,8 +739,7 @@ static void lance_set_multicast (struct device *dev)
        mark_bh(NET_BH);
 }
 
-
-__initfunc(int a2065_probe(struct device *dev))
+int __init a2065_probe(struct device *dev)
 {
        unsigned int key, is_cbm;
        const struct ConfigDev *cd;
index e5e2f572f49f2a6c5c5b73c20ef6415425941ae7..8f1246d85f4e341c43f76b1fd8a8696354ff03c6 100644 (file)
@@ -95,7 +95,7 @@ static int ac_close_card(struct device *dev);
        or the unique value in the station address PROM.
        */
 
-__initfunc(int ac3200_probe(struct device *dev))
+int __init ac3200_probe(struct device *dev)
 {
        unsigned short ioaddr = dev->base_addr;
 
@@ -117,7 +117,7 @@ __initfunc(int ac3200_probe(struct device *dev))
        return ENODEV;
 }
 
-__initfunc(static int ac_probe1(int ioaddr, struct device *dev))
+static int __init ac_probe1(int ioaddr, struct device *dev)
 {
        int i;
 
index 3cdc89475237f7735d406d7f5363862f52a6f89c..38fa4b98f54c289e91b092db2c703b1a23bcbd6b 100644 (file)
@@ -177,7 +177,7 @@ static struct device *root_dev = NULL;
 
 static int probed __initdata = 0;
 
-__initfunc(int acenic_probe (struct device *dev))
+int __init acenic_probe (struct device *dev)
 {
        int boards_found = 0;
        int version_disp;
@@ -423,7 +423,7 @@ static inline void ace_issue_cmd(struct ace_regs *regs, struct cmd *cmd)
 }
 
 
-__initfunc(static int ace_init(struct device *dev, int board_idx))
+static int __init ace_init(struct device *dev, int board_idx)
 {
        struct ace_private *ap;
        struct ace_regs *regs;
@@ -1574,7 +1574,7 @@ static struct net_device_stats *ace_get_stats(struct device *dev)
 }
 
 
-__initfunc(void ace_copy(struct ace_regs *regs, void *src, u32 dest, int size))
+void __init ace_copy(struct ace_regs *regs, void *src, u32 dest, int size)
 {
        unsigned long tdest;
        u32 *wsrc;
@@ -1609,7 +1609,7 @@ __initfunc(void ace_copy(struct ace_regs *regs, void *src, u32 dest, int size))
 }
 
 
-__initfunc(void ace_clear(struct ace_regs *regs, u32 dest, int size))
+void __init ace_clear(struct ace_regs *regs, u32 dest, int size)
 {
        unsigned long tdest;
        short tsize = 0, i;
@@ -1642,7 +1642,7 @@ __initfunc(void ace_clear(struct ace_regs *regs, u32 dest, int size))
  * This operation requires the NIC to be halted and is performed with
  * interrupts disabled and with the spinlock hold.
  */
-__initfunc(int ace_load_firmware(struct device *dev))
+int __init ace_load_firmware(struct device *dev)
 {
        struct ace_private *ap;
        struct ace_regs *regs;
index f4e682f4d473e9e6039a4b67492cc18fcbee6b0c..28ac93605072804bbf08b9dde0e51e2e254493ff 100644 (file)
@@ -121,7 +121,7 @@ static const char *version =
 
 static int apne_owned = 0;     /* signal if card already owned */
 
-__initfunc(int apne_probe(struct device *dev))
+int __init apne_probe(struct device *dev)
 {
 #ifndef MANUAL_CONFIG
        char tuple[8];
@@ -161,8 +161,7 @@ __initfunc(int apne_probe(struct device *dev))
 
 }
 
-
-__initfunc(static int apne_probe1(struct device *dev, int ioaddr))
+static int __init apne_probe1(struct device *dev, int ioaddr)
 {
     int i;
     unsigned char SA_prom[32];
index d27fbee7cb747d23a890f79d67eb07a9f4269ff8..c0c8161ae43b379820f62fa29d2f84273422d65e 100644 (file)
@@ -100,7 +100,7 @@ MODULE_PARM(irq, "i");
 MODULE_PARM(device, "s");
 MODULE_PARM (node, "i");
 #else
-__initfunc(void arcrimi_setup (char *str, int *ints));
+void __init arcrimi_setup (char *str, int *ints);
 extern struct device arcnet_devs[];
 extern char arcnet_dev_names[][10];
 extern int arcnet_num_devs;
@@ -140,7 +140,7 @@ static const char *version =
  * them.  In fact, we can't even get their node ID automatically.  So, we
  * need to be passed a specific shmem address, IRQ, and node ID.
  */
-__initfunc(int arcrimi_probe(struct device *dev))
+int __init arcrimi_probe(struct device *dev)
 {
   BUGLVL(D_NORMAL) printk(version);
   BUGMSG(D_NORMAL,"Given: node %02Xh, shmem %lXh, irq %d\n",
@@ -167,7 +167,7 @@ __initfunc(int arcrimi_probe(struct device *dev))
 /* Set up the struct device associated with this card.  Called after
  * probing succeeds.
  */
-__initfunc(int arcrimi_found(struct device *dev,int node,int airq, u_long shmem))
+int __init arcrimi_found(struct device *dev,int node,int airq, u_long shmem)
 {
   struct arcnet_local *lp;
   u_long first_mirror,last_mirror;
@@ -797,7 +797,7 @@ void cleanup_module(void)
 
 #else
 
-__initfunc(void arcrimi_setup (char *str, int *ints))
+void __init arcrimi_setup (char *str, int *ints)
 {
   struct device *dev;
 
index 491a502573765b47e3935ba3ccf92b1af553b248..5e61ca6bc8cde30647d21d04eecbc79ce9066904 100644 (file)
@@ -471,9 +471,16 @@ arcnet_open(struct device *dev)
 
 #ifdef CONFIG_ARCNET_1051
   /* Initialize the RFC1051-encap protocol driver */
-  lp->sdev=(struct device *)kmalloc(sizeof(struct device),GFP_KERNEL);
+  lp->sdev=(struct device *)kmalloc(sizeof(struct device)+10,GFP_KERNEL);
+  if(lp->sdev = NULL)
+  {
+       if(lp->edev)
+               kfree(lp->edev);
+       lp->edev=NULL;
+       return -ENOMEM;
+  }
   memcpy(lp->sdev,dev,sizeof(struct device));
-  lp->sdev->name=(char *)kmalloc(10,GFP_KERNEL);
+  lp->sdev->name=(char *)(lp+1);
   sprintf(lp->sdev->name,"%ss",dev->name);
   lp->sdev->init=arcnetS_init;
   register_netdevice(lp->sdev);
@@ -562,7 +569,6 @@ arcnet_close(struct device *dev)
   /* free the RFC1051-encap protocol device */
   lp->sdev->priv=NULL;
   unregister_netdevice(lp->sdev);
-  kfree(lp->sdev->name);
   kfree(lp->sdev);
   lp->sdev=NULL;
 #endif
@@ -1991,7 +1997,7 @@ struct device arcnet_devs[MAX_ARCNET_DEVS];
 int arcnet_num_devs=0;
 char arcnet_dev_names[MAX_ARCNET_DEVS][10];
 
-__initfunc(void arcnet_init(void))
+void __init arcnet_init(void)
 {
   int c;
 
@@ -2041,7 +2047,7 @@ __initfunc(void arcnet_init(void))
 #ifdef MODULE
 int init_module(void)
 #else
-__initfunc(static int init_module(void))
+static int __init init_module(void)
 #endif
 {
 #ifdef ALPHA_WARNING
index 8a1cd4e9db2e788fe52f592842452620e44ab393..e08455cf83f12201e46428ee1dcff9f5cc19508d 100644 (file)
@@ -146,7 +146,7 @@ static void memcpyw(u_short *dest, u_short *src, int len)
 }
 
 
-__initfunc(int ariadne_probe(struct device *dev))
+int __init ariadne_probe(struct device *dev)
 {
     unsigned int key;
     const struct ConfigDev *cd;
index c58a9093266874972e0fc0a58456981e9db4890c..fc02ecbb50cfde777b5eb99a269f936a582c9bb1 100644 (file)
@@ -81,8 +81,7 @@ static void ariadne2_block_output(struct device *dev, const int count,
                                  const unsigned char *buf,
                                  const int start_page);
 
-
-__initfunc(int ariadne2_probe(struct device *dev))
+int __init ariadne2_probe(struct device *dev)
 {
     unsigned int key;
     const struct ConfigDev *cd;
@@ -101,8 +100,8 @@ __initfunc(int ariadne2_probe(struct device *dev))
     return -ENODEV;
 }
 
-__initfunc(static int ariadne2_init(struct device *dev, unsigned int key,
-                                   unsigned long board))
+static int __init ariadne2_init(struct device *dev, unsigned int key,
+                                   unsigned long board)
 {
     int i;
     unsigned char SA_prom[32];
index 4bd4f5dc1d51edfc9414c64e0f5e1b619e8b0937..2d48479e0ca72e6adaec5cad5bc99dc67021cd29 100644 (file)
@@ -1,4 +1,4 @@
-
+#include <linux/config.h>
 #include "arlan.h"
 
 #ifdef CONFIG_PROC_FS
index fcd5fa49fb008a8d5d280cfc4c4b0fdcebe069c5..d8f9ee74fe92b31295715e3c573f06d0d17cbfd6 100644 (file)
@@ -5,7 +5,7 @@
  * This module provides support for the Arlan 655 card made by Aironet
  */
 
-
+#include <linux/config.h>
 #include "arlan.h"
 
 static const char *arlan_version = "C.Jennigs 97 & Elmer.Joandi@ut.ee  Oct'98, http://www.ylenurme.ee/~elmer/655/";
index f17950109b9c84a5e1bcbb6707344bc12e69f3e2..8fb48eeb45248a80a10d968cf5c4c0b198e735a9 100644 (file)
@@ -324,8 +324,8 @@ end:
 
 /* Check for a network adaptor of this type, and return '0' if one exists.
  */
-__initfunc(int
-bionet_probe(struct device *dev){
+int __init 
+bionet_probe(struct device *dev){
        unsigned char station_addr[6];
        static unsigned version_printed = 0;
        static int no_more_found = 0; /* avoid "Probing for..." printed 4 times */
index 269b7de15412769066e7e4e8513208dec06d370e..83cd0f665bc5f12d1a78d0abcaf01db2972fa3f6 100644 (file)
@@ -561,8 +561,8 @@ bad:
 /* Check for a network adaptor of this type, and return '0' if one exists.
  */
 
-__initfunc(extern int
-pamsnet_probe (dev))
+extern int __init 
+pamsnet_probe (dev)
        struct device *dev;
 {
        int i;
index c79fd581e0a1b4f69c6f3459a4625ad6e541c5a8..de439cb2750479b14013858879d2c978b5d85db7 100644 (file)
@@ -370,9 +370,9 @@ void *slow_memcpy( void *dst, const void *src, size_t len )
 }
 
 
-__initfunc(int atarilance_probe( struct device *dev ))
-
-{      int i;
+int __init atarilance_probe( struct device *dev )
+{      
+    int i;
        static int found = 0;
 
        if (!MACH_IS_ATARI || found)
@@ -393,9 +393,9 @@ __initfunc(int atarilance_probe( struct device *dev ))
 
 /* Derived from hwreg_present() in atari/config.c: */
 
-__initfunc(static int addr_accessible( volatile void *regp, int wordflag, int writeflag ))
-
-{      int             ret;
+static int __init addr_accessible( volatile void *regp, int wordflag, int writeflag )
+{
+       int             ret;
        long    flags;
        long    *vbr, save_berr;
 
@@ -443,10 +443,10 @@ __initfunc(static int addr_accessible( volatile void *regp, int wordflag, int wr
 }
 
 
-__initfunc(static unsigned long lance_probe1( struct device *dev,
-                                                                  struct lance_addr *init_rec ))
-
-{      volatile unsigned short *memaddr =
+static unsigned long __init lance_probe1( struct device *dev,
+                                                                  struct lance_addr *init_rec )
+{
+       volatile unsigned short *memaddr =
                (volatile unsigned short *)init_rec->memaddr;
        volatile unsigned short *ioaddr =
                (volatile unsigned short *)init_rec->ioaddr;
index 658c894b948f231dfe8a61454101e00ba1d9aa16..4cfed8d921702d0d11abe8db393e708e4d2c37f6 100644 (file)
@@ -150,8 +150,8 @@ static void set_multicast_list(struct device *dev);
    If dev->base_addr == 2, allocate space for the device and return success
    (detachable devices only).
    */
-__initfunc(int
-atp_init(struct device *dev))
+int __init 
+atp_init(struct device *dev)
 {
        int *port, ports[] = {0x378, 0x278, 0x3bc, 0};
        int base_addr = dev->base_addr;
@@ -173,7 +173,7 @@ atp_init(struct device *dev))
        return ENODEV;
 }
 
-__initfunc(static int atp_probe1(struct device *dev, short ioaddr))
+static int __init atp_probe1(struct device *dev, short ioaddr)
 {
        int saved_ctrl_reg, status;
 
@@ -259,7 +259,7 @@ __initfunc(static int atp_probe1(struct device *dev, short ioaddr))
 }
 
 /* Read the station address PROM, usually a word-wide EEPROM. */
-__initfunc(static void get_node_ID(struct device *dev))
+static void __init get_node_ID(struct device *dev)
 {
        short ioaddr = dev->base_addr;
        int sa_offset = 0;
@@ -291,7 +291,7 @@ __initfunc(static void get_node_ID(struct device *dev))
  * DO :         _________X_______X
  */
 
-__initfunc(static unsigned short eeprom_op(short ioaddr, unsigned int cmd))
+static unsigned short __init eeprom_op(short ioaddr, unsigned int cmd)
 {
        unsigned eedata_out = 0;
        int num_bits = EE_CMD_SIZE;
index 093a5acf00c8e8c4cdf529fedbc47e273e9879f0..afadea8387337ac568741a3a0ed071ed46fe7979 100644 (file)
@@ -96,7 +96,7 @@ MODULE_PARM(timeout,"i");
 MODULE_PARM(backplane,"i");
 MODULE_PARM(clock,"i");
 #else
-__initfunc(void com20020_setup (char *str, int *ints));
+void __init com20020_setup (char *str, int *ints);
 extern struct device arcnet_devs[];
 extern char arcnet_dev_names[][10];
 extern int arcnet_num_devs;
@@ -224,7 +224,7 @@ static const char *version =
  * it's where we were told it was, and even autoirq
  */
 
-__initfunc(int arc20020_probe(struct device *dev))
+int __init arc20020_probe(struct device *dev)
 {
   int ioaddr=dev->base_addr,status,delayval;
   unsigned long airqmask;
@@ -327,7 +327,7 @@ __initfunc(int arc20020_probe(struct device *dev))
 /* Set up the struct device associated with this card.  Called after
  * probing succeeds.
  */
-__initfunc(int arc20020_found(struct device *dev,int ioaddr,int airq))
+int __init arc20020_found(struct device *dev,int ioaddr,int airq)
 {
   struct arcnet_local *lp;
   
@@ -1035,7 +1035,7 @@ void cleanup_module(void)
 
 #else
 
-__initfunc(void com20020_setup (char *str, int *ints))
+void __init com20020_setup (char *str, int *ints)
 {
   struct device *dev;
 
index 3096544602b37e98720e4960055fec52a7e146b0..2e9ea0660016f68efae8f9ec987c626b6da4cbe6 100644 (file)
@@ -87,7 +87,7 @@ MODULE_PARM(io, "i");
 MODULE_PARM(irq, "i");
 MODULE_PARM(device, "s");
 #else
-__initfunc(void com90io_setup (char *str, int *ints));
+void __init com90io_setup (char *str, int *ints);
 extern struct device arcnet_devs[];
 extern char arcnet_dev_names[][10];
 extern int arcnet_num_devs;
@@ -193,7 +193,7 @@ static const char *version =
  * it's where we were told it was, and even autoirq
  */
 
-__initfunc(int arc90io_probe(struct device *dev))
+int __init arc90io_probe(struct device *dev)
 {
   int ioaddr=dev->base_addr,status,delayval;
   unsigned long airqmask;
@@ -287,7 +287,7 @@ __initfunc(int arc90io_probe(struct device *dev))
 /* Set up the struct device associated with this card.  Called after
  * probing succeeds.
  */
-__initfunc(int arc90io_found(struct device *dev,int ioaddr,int airq))
+int __init arc90io_found(struct device *dev,int ioaddr,int airq)
 {
   struct arcnet_local *lp;
 
@@ -914,7 +914,7 @@ void cleanup_module(void)
 
 #else
 
-__initfunc(void com90io_setup (char *str, int *ints))
+void __init com90io_setup (char *str, int *ints)
 {
   struct device *dev;
 
index 3ca5a5ef88f61577ea4f1725e778485d21ce7578..be4514fabd8905612b2a5fee40e802108b07ec2f 100644 (file)
@@ -117,7 +117,7 @@ MODULE_PARM(irq, "i");
 MODULE_PARM(shmem, "i");
 MODULE_PARM(device, "s");
 #else
-__initfunc(void com90xx_setup(char *str, int *ints));
+void __init com90xx_setup(char *str, int *ints);
 char __initdata com90xx_explicit = 0;
 
 extern struct device arcnet_devs[];
@@ -179,7 +179,7 @@ static u_long shmems[(0xFF800 - 0xA0000) / 2048 + 1] __initdata = {
        0
 };
 
-__initfunc(int arc90xx_probe(struct device *dev))
+int __init arc90xx_probe(struct device *dev)
 {
        static int init_once = 0;
        static int numports = sizeof(ports) / sizeof(ports[0]), numshmems = sizeof(shmems) / sizeof(shmems[0]);
@@ -399,7 +399,7 @@ __initfunc(int arc90xx_probe(struct device *dev))
                         */
                        airqmask = probe_irq_on();
                        AINTMASK(NORXflag);
-                       udelay(1);
+                       mdelay(1);
                        AINTMASK(0);
                        airq = probe_irq_off(airqmask);
 
@@ -493,7 +493,7 @@ __initfunc(int arc90xx_probe(struct device *dev))
 /* Set up the struct device associated with this card.  Called after
  * probing succeeds.
  */
-__initfunc(static int arc90xx_found(struct device *dev, int ioaddr, int airq, u_long shmem, int more))
+static int __init arc90xx_found(struct device *dev, int ioaddr, int airq, u_long shmem, int more)
 {
        struct arcnet_local *lp;
        u_long first_mirror, last_mirror;
@@ -1121,7 +1121,7 @@ void cleanup_module(void)
 
 #else
 
-__initfunc(void com90xx_setup(char *str, int *ints))
+void __init com90xx_setup(char *str, int *ints)
 {
        struct device *dev;
 
index e920debebe52fe566c766d294175222810ba7acc..0d3469204ed81fcf90c1bfb255e872aa797ab5e0 100644 (file)
@@ -218,7 +218,7 @@ static struct enet_statistics *cops_get_stats (struct device *dev);
  *      If dev->base_addr in [1..0x1ff], always return failure.
  *        otherwise go with what we pass in.
  */
-__initfunc(int cops_probe(struct device *dev))
+int __init cops_probe(struct device *dev)
 {
        int i;
         int base_addr = dev ? dev->base_addr : 0;
@@ -252,7 +252,7 @@ __initfunc(int cops_probe(struct device *dev))
  *      probes on the ISA bus. A good device probes avoids doing writes, and
  *      verifies that the correct device exists and functions.
  */
-__initfunc(static int cops_probe1(struct device *dev, int ioaddr))
+static int __init cops_probe1(struct device *dev, int ioaddr)
 {
         struct cops_local *lp;
        static unsigned version_printed = 0;
@@ -348,7 +348,7 @@ __initfunc(static int cops_probe1(struct device *dev, int ioaddr))
         return 0;
 }
 
-__initfunc(static int cops_irq (int ioaddr, int board))
+static int __init cops_irq (int ioaddr, int board)
 {       /*
          * This does not use the IRQ to determine where the IRQ is. We just
          * assume that when we get a correct status response that it's the IRQ.
index 8db7657ee0197d785ab122168fce4d14d90791f4..fdfa991b90bfc7882e79f2a101797a3c3b8a9e0d 100644 (file)
@@ -362,7 +362,7 @@ static void debug_status_out(struct cosa_data *cosa, int status);
 #ifdef MODULE
 int init_module(void)
 #else
-__initfunc(static int cosa_init(void))
+static int __init cosa_init(void)
 #endif
 {
        int i;
index b4e4a911bdd5a55c10cdf1dff5b2d1a5658001b3..3867c58d3d49caaf76aca27c69b90118cbab666d 100644 (file)
@@ -145,8 +145,8 @@ static int set_mac_address(struct device *dev, void *addr);
 struct netdev_entry netcard_drv =
 {"netcard", cs89x0_probe1, NETCARD_IO_EXTENT, netcard_portlist};
 #else
-__initfunc(int
-cs89x0_probe(struct device *dev))
+int __init 
+cs89x0_probe(struct device *dev)
 {
        int i;
        int base_addr = dev ? dev->base_addr : 0;
@@ -195,8 +195,8 @@ writeword(struct device *dev, int portno, int value)
        outw(value, dev->base_addr + portno);
 }
 
-__initfunc(static int
-wait_eeprom_ready(struct device *dev))
+static int __init 
+wait_eeprom_ready(struct device *dev)
 {
        int timeout = jiffies;
        /* check to see if the EEPROM is ready, a timeout is used -
@@ -208,8 +208,8 @@ wait_eeprom_ready(struct device *dev))
        return 0;
 }
 
-__initfunc(static int
-get_eeprom_data(struct device *dev, int off, int len, int *buffer))
+static int __init 
+get_eeprom_data(struct device *dev, int off, int len, int *buffer)
 {
        int i;
 
@@ -226,8 +226,8 @@ get_eeprom_data(struct device *dev, int off, int len, int *buffer))
         return 0;
 }
 
-__initfunc(static int
-get_eeprom_cksum(int off, int len, int *buffer))
+static int  __init 
+get_eeprom_cksum(int off, int len, int *buffer)
 {
        int i, cksum;
 
@@ -244,7 +244,7 @@ get_eeprom_cksum(int off, int len, int *buffer))
    probes on the ISA bus.  A good device probes avoids doing writes, and
    verifies that the correct device exists and functions.  */
 
-__initfunc(static int cs89x0_probe1(struct device *dev, int ioaddr))
+static int __init cs89x0_probe1(struct device *dev, int ioaddr)
 {
        struct net_local *lp;
        static unsigned version_printed = 0;
@@ -390,10 +390,8 @@ __initfunc(static int cs89x0_probe1(struct device *dev, int ioaddr))
        return 0;
 }
 
-
-\f
-__initfunc(void
-reset_chip(struct device *dev))
+void  __init 
+reset_chip(struct device *dev)
 {
        struct net_local *lp = (struct net_local *)dev->priv;
        int ioaddr = dev->base_addr;
index f0edae26161f4fd1a636e011588928b526c026f6..ccd35038e020ada057dab6dbee42731c437170e7 100644 (file)
@@ -1106,8 +1106,8 @@ static int (*dc_infoblock[])(struct device *dev, u_char, u_char *) = {
 ** Autoprobing in modules is allowed here. See the top of the file for
 ** more info.
 */
-__initfunc(int
-de4x5_probe(struct device *dev))
+int __init 
+de4x5_probe(struct device *dev)
 {
     u_long iobase = dev->base_addr;
 
@@ -1121,8 +1121,8 @@ de4x5_probe(struct device *dev))
     return (dev->priv ? 0 : -ENODEV);
 }
 
-__initfunc(static int
-de4x5_hw_init(struct device *dev, u_long iobase))
+static int __init 
+de4x5_hw_init(struct device *dev, u_long iobase)
 {
     struct bus_type *lp = &bus;
     int i, status=0;
@@ -2054,8 +2054,8 @@ SetMulticastFilter(struct device *dev)
 ** EISA bus I/O device probe. Probe from slot 1 since slot 0 is usually
 ** the motherboard. Upto 15 EISA devices are supported.
 */
-__initfunc(static void
-eisa_probe(struct device *dev, u_long ioaddr))
+static void __init 
+eisa_probe(struct device *dev, u_long ioaddr)
 {
     int i, maxSlots, status, device;
     u_char irq;
@@ -2136,8 +2136,8 @@ eisa_probe(struct device *dev, u_long ioaddr))
 */
 #define PCI_LAST_DEV  32
 
-__initfunc(static void
-pci_probe(struct device *dev, u_long ioaddr))
+static void __init 
+pci_probe(struct device *dev, u_long ioaddr)
 {
     u_char pb, pbus, dev_num, dnum, timer;
     u_short vendor, index, status;
@@ -2248,8 +2248,8 @@ pci_probe(struct device *dev, u_long ioaddr))
 ** DECchips, we can find the base SROM irrespective of the BIOS scan direction.
 ** For single port cards this is a time waster...
 */
-__initfunc(static void
-srom_search(struct pci_dev *dev))
+static void __init 
+srom_search(struct pci_dev *dev)
 {
     u_char pb;
     u_short vendor, status;
@@ -2307,8 +2307,8 @@ srom_search(struct pci_dev *dev))
     return;
 }
 
-__initfunc(static void
-link_modules(struct device *dev, struct device *tmp))
+static void __init 
+link_modules(struct device *dev, struct device *tmp)
 {
     struct device *p=dev;
 
@@ -5559,17 +5559,15 @@ de4x5_ioctl(struct device *dev, struct ifreq *rq, int cmd)
     switch(ioc->cmd) {
     case DE4X5_GET_HWADDR:           /* Get the hardware address */
        ioc->len = ETH_ALEN;
-       if (verify_area(VERIFY_WRITE, ioc->data, ioc->len)) return -EFAULT;
        for (i=0; i<ETH_ALEN; i++) {
            tmp.addr[i] = dev->dev_addr[i];
        }
-       copy_to_user(ioc->data, tmp.addr, ioc->len);
+       if (copy_to_user(ioc->data, tmp.addr, ioc->len)) return -EFAULT;
        break;
 
     case DE4X5_SET_HWADDR:           /* Set the hardware address */
        if (!capable(CAP_NET_ADMIN)) return -EPERM;
-       if (verify_area(VERIFY_READ, ioc->data, ETH_ALEN)) return -EFAULT;
-       copy_from_user(tmp.addr, ioc->data, ETH_ALEN);
+       if (copy_from_user(tmp.addr, ioc->data, ETH_ALEN)) return -EFAULT;
        for (i=0; i<ETH_ALEN; i++) {
            dev->dev_addr[i] = tmp.addr[i];
        }
@@ -5612,9 +5610,8 @@ de4x5_ioctl(struct device *dev, struct ifreq *rq, int cmd)
 
     case DE4X5_GET_STATS:            /* Get the driver statistics */
        ioc->len = sizeof(lp->pktStats);
-       if (verify_area(VERIFY_WRITE, ioc->data, ioc->len)) return -EFAULT;
        spin_lock_irqsave(&lp->lock, flags);
-       copy_to_user(ioc->data, &lp->pktStats, ioc->len)
+       if (copy_to_user(ioc->data, &lp->pktStats, ioc->len)) return -EFAULT
        spin_unlock_irqrestore(&lp->lock, flags);
        break;
 
@@ -5627,14 +5624,12 @@ de4x5_ioctl(struct device *dev, struct ifreq *rq, int cmd)
 
     case DE4X5_GET_OMR:              /* Get the OMR Register contents */
        tmp.addr[0] = inl(DE4X5_OMR);
-       if (verify_area(VERIFY_WRITE, ioc->data, 1)) return -EFAULT;
-       copy_to_user(ioc->data, tmp.addr, 1);
+       if (copy_to_user(ioc->data, tmp.addr, 1)) return -EFAULT;
        break;
 
     case DE4X5_SET_OMR:              /* Set the OMR Register contents */
        if (!capable(CAP_NET_ADMIN)) return -EPERM;
-       if (verify_area(VERIFY_READ, ioc->data, 1)) return -EFAULT;
-       copy_from_user(tmp.addr, ioc->data, 1);
+       if (copy_from_user(tmp.addr, ioc->data, 1)) return -EFAULT;
        outl(tmp.addr[0], DE4X5_OMR);
        break;
 
@@ -5649,8 +5644,7 @@ de4x5_ioctl(struct device *dev, struct ifreq *rq, int cmd)
        tmp.lval[6] = inl(DE4X5_STRR); j+=4;
        tmp.lval[7] = inl(DE4X5_SIGR); j+=4;
        ioc->len = j;
-       if (verify_area(VERIFY_WRITE, ioc->data, ioc->len)) return -EFAULT;
-       copy_to_user(ioc->data, tmp.addr, ioc->len);
+       if (copy_to_user(ioc->data, tmp.addr, ioc->len)) return -EFAULT;
        break;
        
 #define DE4X5_DUMP              0x0f /* Dump the DE4X5 Status */
@@ -5739,8 +5733,7 @@ de4x5_ioctl(struct device *dev, struct ifreq *rq, int cmd)
        tmp.addr[j++] = dev->tbusy;
        
        ioc->len = j;
-       if (verify_area(VERIFY_WRITE, ioc->data, ioc->len)) return -EFAULT;
-       copy_to_user(ioc->data, tmp.addr, ioc->len);
+       if (copy_to_user(ioc->data, tmp.addr, ioc->len)) return -EFAULT;
        break;
 
 */
@@ -5863,8 +5856,8 @@ count_adapters(void)
 ** If at end of eth device list and can't use current entry, malloc
 ** one up. If memory could not be allocated, print an error message.
 */
-__initfunc(static struct device *
-insert_device(struct device *dev, u_long iobase, int (*init)(struct device *)))
+static struct device * __init 
+insert_device(struct device *dev, u_long iobase, int (*init)(struct device *))
 {
     struct device *new;
 
index 03a3205ed8a45a84dcc60b9767dedf7b39bfe17f..5e8050300f796b149ba51f24aed3eb7c877e7cea 100644 (file)
@@ -627,8 +627,8 @@ de600_rx_intr(struct device *dev)
         */
 }
 
-__initfunc(int
-de600_probe(struct device *dev))
+int __init 
+de600_probe(struct device *dev)
 {
        int     i;
        static struct net_device_stats de600_netstats;
index 28a318637ab2b03a2947f27e1e0877c1fc1d3c3f..8ae2803a3d517f86b410a146c74b1cbc6571cfdd 100644 (file)
@@ -820,8 +820,8 @@ adapter_init(struct device *dev)
  *
  * Check if there is a DE-620 connected
  */
-__initfunc(int
-de620_probe(struct device *dev))
+int __init 
+de620_probe(struct device *dev)
 {
        static struct net_device_stats de620_netstats;
        int i;
@@ -913,8 +913,8 @@ de620_probe(struct device *dev))
  */
 #define sendit(dev,data) de620_set_register(dev, W_EIP, data | EIPRegister);
 
-__initfunc(static unsigned short
-ReadAWord(struct device *dev, int from))
+static unsigned short __init 
+ReadAWord(struct device *dev, int from)
 {
        unsigned short data;
        int nbits;
@@ -956,8 +956,8 @@ ReadAWord(struct device *dev, int from))
        return data;
 }
 
-__initfunc(static int
-read_eeprom(struct device *dev))
+static int __init 
+read_eeprom(struct device *dev)
 {
        unsigned short wrd;
 
index 3a3dd6af8e9d953465a49b60fc26f187eb2c55ce..84915977efe249e5ff0d632734eab49fa9752484 100644 (file)
@@ -446,11 +446,8 @@ static inline void dfx_port_read_long(
  *   the device structure.
  */
 
-__initfunc(int dfx_probe(
-       struct device *dev
-       ))
-
-       {
+int __init dfx_probe(struct device *dev)
+{
        int                             i;                              /* used in for loops */
        int                             version_disp;   /* was version info string already displayed? */
        int                             port_len;               /* length of port address range (in bytes) */
@@ -641,12 +638,8 @@ __initfunc(int dfx_probe(
  *   None
  */
 
-__initfunc(struct device *dfx_alloc_device(
-       struct device   *dev,
-       u16                             iobase
-       ))
-
-       {
+struct device __init *dfx_alloc_device( struct device *dev, u16 iobase)
+{
        struct device *tmp_dev;         /* pointer to a device structure */
 
        DBG_printk("In dfx_alloc_device...\n");
@@ -736,11 +729,8 @@ __initfunc(struct device *dfx_alloc_device(
  *   enabled yet.
  */
 
-__initfunc(void dfx_bus_init(
-       struct device *dev
-       ))
-
-       {
+void __init dfx_bus_init(struct device *dev)
+{
        DFX_board_t *bp = (DFX_board_t *)dev->priv;
        u8                      val;    /* used for I/O read/writes */
 
@@ -871,11 +861,8 @@ __initfunc(void dfx_bus_init(
  *   None
  */
 
-__initfunc(void dfx_bus_config_check(
-       DFX_board_t *bp
-       ))
-
-       {
+void __init dfx_bus_config_check(DFX_board_t *bp)
+{
        int     status;                         /* return code from adapter port control call */
        u32     slot_id;                        /* EISA-bus hardware id (DEC3001, DEC3002,...) */
        u32     host_data;                      /* LW data returned from port control call */
@@ -975,11 +962,8 @@ __initfunc(void dfx_bus_config_check(
  *   returning from this routine.
  */
 
-__initfunc(int dfx_driver_init(
-       struct device *dev
-       ))
-
-       {
+int __init dfx_driver_init(struct device *dev)
+{
        DFX_board_t *bp = (DFX_board_t *)dev->priv;
        int                     alloc_size;                     /* total buffer size needed */
        char            *top_v, *curr_v;        /* virtual addrs into memory block */
index 68250ade1d35c5d53c937eb56cbfbb7bd56e0695..1be3c5dda3639fbe8136f0486e774228c63b285b 100644 (file)
@@ -476,10 +476,8 @@ static char   *adapter_name = '\0';        /* If no PROM when loadable module
     outw(CSR0, DEPCA_ADDR);\
     outw(STOP, DEPCA_DATA)
 
-\f
-
-__initfunc(int
-depca_probe(struct device *dev))
+int __init 
+depca_probe(struct device *dev)
 {
   int tmp = num_depcas, status = -ENODEV;
   u_long iobase = dev->base_addr;
@@ -512,8 +510,8 @@ depca_probe(struct device *dev))
   return status;
 }
 
-__initfunc(static int
-depca_hw_init(struct device *dev, u_long ioaddr, int mca_slot))
+static int __init 
+depca_hw_init(struct device *dev, u_long ioaddr, int mca_slot)
 {
   struct depca_private *lp;
   int i, j, offset, netRAM, mem_len, status=0;
@@ -1250,8 +1248,8 @@ static void SetMulticastFilter(struct device *dev)
 /*
 ** Microchannel bus I/O device probe
 */
-__initfunc(static void
-mca_probe(struct device *dev, u_long ioaddr))
+static void __init 
+mca_probe(struct device *dev, u_long ioaddr)
 {
     unsigned char pos[2];
     unsigned char where;
@@ -1399,8 +1397,8 @@ responding.\n", dev->name, iobase);
 /*
 ** ISA bus I/O device probe
 */
-__initfunc(static void
-isa_probe(struct device *dev, u_long ioaddr))
+static void __init 
+isa_probe(struct device *dev, u_long ioaddr)
 {
   int i = num_depcas, maxSlots;
   s32 ports[] = DEPCA_IO_PORTS;
@@ -1438,8 +1436,8 @@ isa_probe(struct device *dev, u_long ioaddr))
 ** EISA bus I/O device probe. Probe from slot 1 since slot 0 is usually
 ** the motherboard. Upto 15 EISA devices are supported.
 */
-__initfunc(static void
-eisa_probe(struct device *dev, u_long ioaddr))
+static void __init 
+eisa_probe(struct device *dev, u_long ioaddr)
 {
   int i, maxSlots;
   u_long iobase;
@@ -1485,8 +1483,8 @@ eisa_probe(struct device *dev, u_long ioaddr))
 ** are not available then insert a new device structure at the end of
 ** the current list.
 */
-__initfunc(static struct device *
-alloc_device(struct device *dev, u_long iobase))
+static struct device * __init 
+alloc_device(struct device *dev, u_long iobase)
 {
     struct device *adev = NULL;
     int fixed = 0, new_dev = 0;
@@ -1530,8 +1528,8 @@ alloc_device(struct device *dev, u_long iobase))
 ** If at end of eth device list and can't use current entry, malloc
 ** one up. If memory could not be allocated, print an error message.
 */
-__initfunc(static struct device *
-insert_device(struct device *dev, u_long iobase, int (*init)(struct device *)))
+static struct device * __init 
+insert_device(struct device *dev, u_long iobase, int (*init)(struct device *))
 {
     struct device *new;
 
@@ -1556,8 +1554,8 @@ insert_device(struct device *dev, u_long iobase, int (*init)(struct device *)))
     return dev;
 }
 
-__initfunc(static int
-depca_dev_index(char *s))
+static int __init 
+depca_dev_index(char *s)
 {
     int i=0, j=0;
 
@@ -1576,8 +1574,8 @@ depca_dev_index(char *s))
 ** and Boot (readb) ROM. This will also give us a clue to the network RAM
 ** base address.
 */
-__initfunc(static void
-DepcaSignature(char *name, u_long paddr))
+static void __init 
+DepcaSignature(char *name, u_long paddr)
 {
   u_int i,j,k;
   const char *signatures[] = DEPCA_SIGNATURE;
@@ -1629,8 +1627,8 @@ DepcaSignature(char *name, u_long paddr))
 ** PROM address counter is correctly positioned at the start of the
 ** ethernet address for later read out.
 */
-__initfunc(static int
-DevicePresent(u_long ioaddr))
+static int __init 
+DevicePresent(u_long ioaddr)
 {
   union {
     struct {
@@ -1682,8 +1680,8 @@ DevicePresent(u_long ioaddr))
 ** reason: access the upper half of the PROM with x=0; access the lower half
 ** with x=1.
 */
-__initfunc(static int
-get_hw_addr(struct device *dev))
+static int __init 
+get_hw_addr(struct device *dev)
 {
   u_long ioaddr = dev->base_addr;
   int i, k, tmp, status = 0;
@@ -1771,8 +1769,8 @@ static int load_packet(struct device *dev, struct sk_buff *skb)
 /*
 ** Look for a particular board name in the EISA configuration space
 */
-__initfunc(static int
-EISA_signature(char *name, s32 eisa_id))
+static int __init 
+EISA_signature(char *name, s32 eisa_id)
 {
   u_int i;
   const char *signatures[] = DEPCA_SIGNATURE;
index 2d4e0848288cf0a40b69c730b2b0f043801e67f4..8588a8b4aacd2920bb627350ab18316ce375a835 100644 (file)
@@ -991,8 +991,8 @@ ack_intr:
 /*
  *     Download the board firmware
  */
-__initfunc(static int
-dgrs_download(struct device *dev0))
+static int __init 
+dgrs_download(struct device *dev0)
 {
        DGRS_PRIV       *priv0 = (DGRS_PRIV *) dev0->priv;
        int             is;
@@ -1150,8 +1150,8 @@ dgrs_download(struct device *dev0))
 /*
  *     Probe (init) a board
  */
-__initfunc(int
-dgrs_probe1(struct device *dev))
+int __init 
+dgrs_probe1(struct device *dev)
 {
        DGRS_PRIV       *priv = (DGRS_PRIV *) dev->priv;
        int             i;
@@ -1224,8 +1224,8 @@ dgrs_probe1(struct device *dev))
        return (0);
 }
 
-__initfunc(int
-dgrs_initclone(struct device *dev))
+int __init 
+dgrs_initclone(struct device *dev)
 {
        DGRS_PRIV       *priv = (DGRS_PRIV *) dev->priv;
        int             i;
@@ -1239,7 +1239,7 @@ dgrs_initclone(struct device *dev))
        return (0);
 }
 
-__initfunc(static int
+static int __init 
 dgrs_found_device(
        struct device   *dev,
        int             io,
@@ -1247,7 +1247,7 @@ dgrs_found_device(
        int             irq,
        ulong           plxreg,
        ulong           plxdma
-))
+)
 {
        DGRS_PRIV       *priv;
 
@@ -1360,8 +1360,8 @@ dgrs_found_device(
  */
 static int is2iv[8] __initdata = { 0, 3, 5, 7, 10, 11, 12, 15 };
 
-__initfunc(static int
-dgrs_scan(struct device *dev))
+static int __init 
+dgrs_scan(struct device *dev)
 {
        int     cards_found = 0;
        uint    io;
@@ -1614,8 +1614,8 @@ cleanup_module(void)
 
 #else
 
-__initfunc(int
-dgrs_probe(struct device *dev))
+int __init 
+dgrs_probe(struct device *dev)
 {
        int     cards_found;
 
index 6343463d0de285c7edc7944426ad491cab2a4312..9d177a0b777684ae405fca7b8aeb2af14797b738 100644 (file)
@@ -601,7 +601,7 @@ int dlci_init(struct device *dev)
        return(0);
 }
 
-__initfunc(int dlci_setup(void))
+int __init dlci_setup(void)
 {
        int i;
 
index 8d4ea3b056771fbea88beb10e26636069c9cdb8b..c27d4628c126dcd13330aa8aa90547aa3999a8e9 100644 (file)
@@ -80,7 +80,7 @@ static int dummy_accept_fastpath(struct device *dev, struct dst_entry *dst)
 }
 #endif
 
-__initfunc(int dummy_init(struct device *dev))
+int __init dummy_init(struct device *dev)
 {
        /* Initialize the device structure. */
        dev->hard_start_xmit    = dummy_xmit;
@@ -127,7 +127,7 @@ static struct net_device_stats *dummy_get_stats(struct device *dev)
 
 #ifdef MODULE
 
-__initfunc(static int dummy_probe(struct device *dev))
+static int __init dummy_probe(struct device *dev)
 {
        dummy_init(dev);
        return 0;
index 529158e816490068fc2c9b1107e85da06bbe24d8..571ff901be1a11084a9b10d91a73fddb396728a8 100644 (file)
@@ -117,7 +117,7 @@ static int e21_close(struct device *dev);
        station address).
  */
 
-__initfunc(int e2100_probe(struct device *dev))
+int  __init e2100_probe(struct device *dev)
 {
        int *port;
        int base_addr = dev->base_addr;
@@ -137,7 +137,7 @@ __initfunc(int e2100_probe(struct device *dev))
        return ENODEV;
 }
 
-__initfunc(int e21_probe1(struct device *dev, int ioaddr))
+int __init e21_probe1(struct device *dev, int ioaddr)
 {
        int i, status;
        unsigned char *station_addr = dev->dev_addr;
index 51af63aa4f2f7314b9468dc01532ad392a5acc25..f8088862ebc5f4fd928c9eb019a616be3b65aa0d 100644 (file)
@@ -325,7 +325,7 @@ static inline unsigned short int SHADOW(short int addr)
  * checks for presence of EtherExpress card
  */
 
-__initfunc(int express_probe(struct device *dev))
+int __init express_probe(struct device *dev)
 {
        unsigned short *port;
        static unsigned short ports[] = { 0x300,0x310,0x270,0x320,0x340,0 };
@@ -961,7 +961,7 @@ static void eexp_hw_tx_pio(struct device *dev, unsigned short *buf,
  * than one card in a machine.
  */
 
-__initfunc(static int eexp_hw_probe(struct device *dev, unsigned short ioaddr))
+static int __init eexp_hw_probe(struct device *dev, unsigned short ioaddr)
 {
        unsigned short hw_addr[3];
        unsigned char buswidth;
@@ -1084,8 +1084,8 @@ __initfunc(static int eexp_hw_probe(struct device *dev, unsigned short ioaddr))
  * Read a word from the EtherExpress on-board serial EEPROM.
  * The EEPROM contains 64 words of 16 bits.
  */
-__initfunc(static unsigned short eexp_hw_readeeprom(unsigned short ioaddr,
-                                                   unsigned char location))
+static unsigned short __init eexp_hw_readeeprom(unsigned short ioaddr,
+                                                   unsigned char location)
 {
        unsigned short cmd = 0x180|(location&0x7f);
        unsigned short rval = 0,wval = EC_CS|i586_RST;
index f57e76cda9180e0ad1a3549a3830dc934ab1921a..71d0631e7d80144a8d2a859535a4ace3dbf2416e 100644 (file)
@@ -124,7 +124,7 @@ static unsigned char hi_irq_map[] __initdata = {11, 12, 0, 14, 0, 0, 0, 15};
  *     PROM for a match against the Racal-Interlan assigned value.
  */
 
-__initfunc(int es_probe(struct device *dev))
+int __init es_probe(struct device *dev)
 {
        unsigned short ioaddr = dev->base_addr;
 
@@ -151,7 +151,7 @@ __initfunc(int es_probe(struct device *dev))
        return ENODEV;
 }
 
-__initfunc(int es_probe1(struct device *dev, int ioaddr))
+int __init es_probe1(struct device *dev, int ioaddr)
 {
        int i;
        unsigned long eisa_id;
index cc478fb2e9a0d2d4f91c88746d980cfab7dab0cb..d0cc26e51968c4928bca65f91417256c031d10cf 100644 (file)
@@ -65,7 +65,7 @@ struct net_local
  *     hardware it would have to check what was present.
  */
  
-__initfunc(int ethertap_probe(struct device *dev))
+int __init ethertap_probe(struct device *dev)
 {
        memcpy(dev->dev_addr, "\xFE\xFD\x00\x00\x00\x00", 6);
        if (dev->mem_start & 0xf)
index 749e1f1239c2a858eca2302cb68c1ed7d9c07a4d..0c51aa90bbbe1c3a9f8c5ea45d76b078eb005a2a 100644 (file)
@@ -132,8 +132,8 @@ static void set_multicast_list(struct device *dev);
 struct netdev_entry fmv18x_drv =
 {"fmv18x", fmv18x_probe1, FMV18X_IO_EXTENT, fmv18x_probe_list};
 #else
-__initfunc(int
-fmv18x_probe(struct device *dev))
+int __init 
+fmv18x_probe(struct device *dev)
 {
        int i;
        int base_addr = dev ? dev->base_addr : 0;
@@ -163,7 +163,7 @@ fmv18x_probe(struct device *dev))
    that can be done is checking a few bits and then diving right into MAC
    address check. */
 
-__initfunc(int fmv18x_probe1(struct device *dev, short ioaddr))
+int __init fmv18x_probe1(struct device *dev, short ioaddr)
 {
        char irqmap[4] = {3, 7, 10, 15};
        char irqmap_pnp[8] = {3, 4, 5, 7, 9, 10, 11, 15};
index 99bd59e9a54b4380a729594c5ec658aa1ec5b44f..9dda3006e84aca4ee1385a3e14ac1da0ef63c2cc 100644 (file)
@@ -726,7 +726,7 @@ static int sp_open_dev(struct device *dev)
 #ifdef MODULE
 static int sixpack_init_ctrl_dev(void)
 #else  /* !MODULE */
-__initfunc(int sixpack_init_ctrl_dev(struct device *dummy))
+int __init sixpack_init_ctrl_dev(struct device *dummy)
 #endif /* !MODULE */
 {
        int status;
index bbc29e4c165876469d1e203c4755215614ef9fdb..afaed1432b9f67f87f3069256762c95d54f0936b 100644 (file)
@@ -533,7 +533,7 @@ static int baycom_ioctl(struct device *dev, struct ifreq *ifr,
 
 /* --------------------------------------------------------------------- */
 
-__initfunc(int baycom_par_init(void))
+int __init baycom_par_init(void)
 {
        int i, j, found = 0;
        char set_hw = 1;
@@ -593,7 +593,7 @@ MODULE_DESCRIPTION("Baycom par96 and picpar amateur radio modem driver");
 
 #endif
 
-__initfunc(int init_module(void))
+int __init init_module(void)
 {
        int i;
 
@@ -633,7 +633,7 @@ void cleanup_module(void)
  * mode: par96,picpar
  */
 
-__initfunc(void baycom_par_setup(char *str, int *ints))
+void __init baycom_par_setup(char *str, int *ints)
 {
        int i;
 
index 6129b4b44759143afc1b5ddfdde2822e2c8e725a..216855a4c24e2839162c4e8a9f1d2a62e6fa5af9 100644 (file)
@@ -605,7 +605,7 @@ static int baycom_ioctl(struct device *dev, struct ifreq *ifr,
 
 /* --------------------------------------------------------------------- */
 
-__initfunc(int baycom_ser_fdx_init(void))
+int __init baycom_ser_fdx_init(void)
 {
        int i, j, found = 0;
        char set_hw = 1;
@@ -673,7 +673,7 @@ MODULE_DESCRIPTION("Baycom ser12 full duplex amateur radio modem driver");
 
 #endif
 
-__initfunc(int init_module(void))
+int __init init_module(void)
 {
        int i;
 
@@ -716,7 +716,7 @@ void cleanup_module(void)
  * * indicates sofware DCD
  */
 
-__initfunc(void baycom_ser_fdx_setup(char *str, int *ints))
+void __init baycom_ser_fdx_setup(char *str, int *ints)
 {
        int i;
 
index 088f9318e46165c21354cf9a952a546d61011c5c..20681a134c0dfa5865098d0d68c10d0b9fbe7f75 100644 (file)
@@ -643,7 +643,7 @@ static int baycom_ioctl(struct device *dev, struct ifreq *ifr,
 
 /* --------------------------------------------------------------------- */
 
-__initfunc(int baycom_ser_hdx_init(void))
+int __init baycom_ser_hdx_init(void)
 {
        int i, j, found = 0;
        char set_hw = 1;
@@ -707,7 +707,7 @@ MODULE_DESCRIPTION("Baycom ser12 half duplex amateur radio modem driver");
 
 #endif
 
-__initfunc(int init_module(void))
+int __init init_module(void)
 {
        int i;
 
@@ -749,7 +749,7 @@ void cleanup_module(void)
  * * indicates sofware DCD
  */
 
-__initfunc(void baycom_ser_hdx_setup(char *str, int *ints))
+void __init baycom_ser_hdx_setup(char *str, int *ints)
 {
        int i;
 
index 4a9c60a7d51ff0a25123c24525ee12da57fbe8ea..18a7bce2381146a8c83ff2bfe672d0609c211765 100644 (file)
@@ -621,7 +621,7 @@ static int bpq_device_event(struct notifier_block *this,unsigned long event, voi
  * Initialize driver. To be called from af_ax25 if not compiled as a
  * module
  */
-__initfunc(int bpq_init(void))
+int __init bpq_init(void)
 {
        struct device *dev;
 
index ac474d0b96d8b44e059edb4baf7923ccb8fb44af..2d393511790ea2593d4583b909b0af11f4eab551 100644 (file)
@@ -336,7 +336,7 @@ void cleanup_module(void)
 #else
 
 
-__initfunc(void dmascc_setup(char *str, int *ints))
+void __init dmascc_setup(char *str, int *ints)
 {
    int i;
 
@@ -350,7 +350,7 @@ __initfunc(void dmascc_setup(char *str, int *ints))
 
 /* Initialization functions */
 
-__initfunc(int dmascc_init(void))
+int __init dmascc_init(void)
 {
   int h, i, j, n;
   int base[MAX_NUM_DEVS], tcmd[MAX_NUM_DEVS], t0[MAX_NUM_DEVS],
@@ -453,8 +453,7 @@ __initfunc(int dmascc_init(void))
   return -EIO;
 }
 
-
-__initfunc(int setup_adapter(int io, int h, int n))
+int __init setup_adapter(int io, int h, int n)
 {
   int i, irq, chip;
   struct scc_info *info;
index 5fb420e2e3a79615d5a36dca3fa050e8532286bd..9558b9763eae7c04c6090ef5a4760fc22adb7c13 100644 (file)
@@ -935,7 +935,7 @@ MODULE_DESCRIPTION("Packet Radio network interface HDLC encoder/decoder");
 
 /* --------------------------------------------------------------------- */
 
-__initfunc(int init_module(void))
+int __init init_module(void)
 {
        printk(KERN_INFO "hdlcdrv: (C) 1996 Thomas Sailer HB9JNX/AE4WA\n");
        printk(KERN_INFO "hdlcdrv: version 0.6 compiled " __TIME__ " " __DATE__ "\n");
index ab1ecab6a637808bbd969da1e5c64390032a708a..796b019e4ae360481b859b978bcb5f474a200b97 100644 (file)
@@ -937,7 +937,7 @@ static int ax_open_dev(struct device *dev)
 }
 
 /* Initialize AX25 control device -- register AX25 line discipline */
-__initfunc(int mkiss_init_ctrl_dev(void))
+int __init mkiss_init_ctrl_dev(void)
 {
        int status;
 
@@ -1154,7 +1154,7 @@ static void mkiss_set_termios(struct tty_struct *tty, struct termios *old_termio
 /* *                   Init MKISS driver                             * */
 /* ******************************************************************** */
 
-__initfunc(static int mkiss_init(void))
+static int __init mkiss_init(void)
 {
        memset(&mkiss_driver, 0, sizeof(struct tty_driver));
 
index 8de3251756927c86369878c4e5ec84bb8303d6a5..f036c5eb8f2e900ec9b7fda068fc54781c4767c1 100644 (file)
@@ -927,7 +927,7 @@ static void b_exint(struct pi_local *lp)
 /* Probe for a PI card. */
 /* This routine also initializes the timer chip */
 
-__initfunc(static int hw_probe(int ioaddr))
+static int __init hw_probe(int ioaddr)
 {
     int time = 1000;           /* Number of milliseconds for test */
     unsigned long start_time, end_time;
@@ -1182,7 +1182,7 @@ static void chipset_init(struct device *dev)
 }
 
 
-__initfunc(int pi_init(void))
+int __init pi_init(void)
 {
     int *port;
     int ioaddr = 0;
index 86ed83d3bfb4019012fb0b89d790f45ce98d784d..4a7604e96c3fdd5cdac2a610da0d476b2576895f 100644 (file)
@@ -474,8 +474,7 @@ static void chipset_init(struct device *dev)
 } /* chipset_init() */
 
 
-
-__initfunc(int pt_init(void))
+int __init pt_init(void)
 {
     int *port;
     int ioaddr = 0;
@@ -537,7 +536,7 @@ __initfunc(int pt_init(void))
 /*
  * Probe for PT card.  Also initialises the timers
  */
-__initfunc(static int hw_probe(int ioaddr))
+static int __init hw_probe(int ioaddr)
 {
     int time = 1000;           /* Number of milliseconds to test */
     int a = 1;
index 48ef86a9bd5bbbc7906e94a45fd5b2ca67891323..0f803139a4830cb534ee22ee4004842bec94909e 100644 (file)
@@ -2193,7 +2193,7 @@ struct proc_dir_entry scc_proc_dir_entry =
 /* *                   Init SCC driver                               * */
 /* ******************************************************************** */
 
-__initfunc(int scc_init (void))
+int __init scc_init (void)
 {
        int chip, chan, k, result;
        char devname[10];
index 15b5239fdbad8167a4b1a934406e2053757c71b1..193ffeae21bee350f11d362551a3f97ab57f4123 100644 (file)
@@ -640,9 +640,9 @@ static int sm_ioctl(struct device *dev, struct ifreq *ifr,
 /* --------------------------------------------------------------------- */
 
 #ifdef MODULE
-__initfunc(static int sm_init(void))
+static int __init sm_init(void)
 #else /* MODULE */
-__initfunc(int sm_init(void))
+int __init sm_init(void)
 #endif /* MODULE */
 {
        int i, j, found = 0;
@@ -724,7 +724,7 @@ MODULE_DESCRIPTION("Soundcard amateur radio modem driver");
 
 #endif
 
-__initfunc(int init_module(void))
+int __init init_module(void)
 {
        if (mode) {
                if (iobase == -1)
@@ -778,7 +778,7 @@ void cleanup_module(void)
  * modem: afsk1200, fsk9600
  */
 
-__initfunc(void sm_setup(char *str, int *ints))
+void __init sm_setup(char *str, int *ints)
 {
        int i;
 
index bcb76242a9d6addce2c509fc269c43094eccae58..b58ba73fc44452d013d52f3f1c499cc0d9db8ef0 100644 (file)
@@ -123,7 +123,7 @@ struct netdev_entry hpplus_drv =
 {"hpplus", hpp_probe1, HP_IO_EXTENT, hpplus_portlist};
 #else
 
-__initfunc(int hp_plus_probe(struct device *dev))
+int __init hp_plus_probe(struct device *dev)
 {
        int i;
        int base_addr = dev ? dev->base_addr : 0;
@@ -146,7 +146,7 @@ __initfunc(int hp_plus_probe(struct device *dev))
 #endif
 
 /* Do the interesting part of the probe at a single address. */
-__initfunc(int hpp_probe1(struct device *dev, int ioaddr))
+int __init hpp_probe1(struct device *dev, int ioaddr)
 {
        int i;
        unsigned char checksum = 0;
index 8963b556265110354f73dbed38be702c88655637..c031cd87fc1f2f2afe0ee07a74386c91c0ed2d31 100644 (file)
@@ -84,7 +84,7 @@ struct netdev_entry netcard_drv =
 {"hp", hp_probe1, HP_IO_EXTENT, hppclan_portlist};
 #else
 
-__initfunc(int hp_probe(struct device *dev))
+int __init hp_probe(struct device *dev)
 {
        int i;
        int base_addr = dev ? dev->base_addr : 0;
@@ -106,7 +106,7 @@ __initfunc(int hp_probe(struct device *dev))
 }
 #endif
 
-__initfunc(int hp_probe1(struct device *dev, int ioaddr))
+int __init hp_probe1(struct device *dev, int ioaddr)
 {
        int i, board_id, wordmode;
        const char *name;
index 5ac9da0a3051da2a14c79cc50fae31e0a0e89d65..8535a49551c96a9a8bf682e3636cc39a3f906ae7 100644 (file)
 #include <linux/types.h>
 #include <linux/config.h>  /* for CONFIG_PCI */
 #include <linux/delay.h>
+#include <linux/init.h>
 
 #if LINUX_VERSION_CODE >= 0x020100
 #define LINUX_2_1
@@ -347,7 +348,7 @@ static void wait( void )
  *  since this could cause problems when the card is not installed.
  */
  
-__initfunc(int hp100_probe( struct device *dev ))
+int __init hp100_probe( struct device *dev )
 {
   int base_addr = dev ? dev -> base_addr : 0;
   int ioaddr = 0;
@@ -524,9 +525,9 @@ __initfunc(int hp100_probe( struct device *dev ))
 
 \f
 #ifdef LINUX_2_1
-__initfunc(static int hp100_probe1( struct device *dev, int ioaddr, u_char bus, struct pci_dev *pci_dev ))
+static int __init hp100_probe1( struct device *dev, int ioaddr, u_char bus, struct pci_dev *pci_dev )
 #else
-__initfunc(static int hp100_probe1( struct device *dev, int ioaddr, u_char bus, u_char pci_bus, u_char pci_device_fn ))
+static int __init hp100_probe1( struct device *dev, int ioaddr, u_char bus, u_char pci_bus, u_char pci_device_fn )
 #endif
 {
   int i;
index fb7f617296001484a730da68aa4b587751594fe4..b8249f1f927088e7bc8af835ae8392d78f87d815 100644 (file)
@@ -67,7 +67,7 @@ static struct hplance_private *root_hplance_dev = NULL;
 #endif
 
 /* Find all the HP Lance boards and initialise them... */
-__initfunc(int hplance_probe(struct device *dev))
+int __init hplance_probe(struct device *dev)
 {
         int cards = 0, called = 0;
 
@@ -98,7 +98,7 @@ __initfunc(int hplance_probe(struct device *dev))
 }
 
 /* Initialise a single lance board at the given select code */
-__initfunc (static int hplance_init(struct device *dev, int scode))
+static int __init hplance_init(struct device *dev, int scode)
 {
         /* const char *name = dio_scodetoname(scode); */
         static const char name[] = "HP LANCE";
index 00549b6b9d7724444b632f751e79aacc710a174a..5ced788bbacbd3a4ddbfa4c5d0b031b1c0e8cc71 100644 (file)
@@ -157,7 +157,7 @@ static void memcpyw(u16 *dest, u16 *src, int len)
 
 #endif
 
-__initfunc(int hydra_probe(struct device *dev))
+int __init hydra_probe(struct device *dev)
 {
        struct hydra_private *priv;
        u32 board;
index 81420f0446e4dab537353cff242aadb3b60e628d..947f8c75cb5460bdfa053aa60b60b76cfd0722fa 100644 (file)
@@ -171,7 +171,7 @@ const char *channel_def[] __initdata = {
        "ISA", "MCA", "ISA P&P" 
 };
 
-__initfunc(char *adapter_def(char type))
+char __init *adapter_def(char type)
 {
        switch (type) 
        {
@@ -221,7 +221,7 @@ static unsigned int ibmtr_portlist[] __initdata = {
 
 static __u32 ibmtr_mem_base = 0xd0000;
 
-__initfunc(static void PrtChanID(char *pcid, short stride) )
+static void __init PrtChanID(char *pcid, short stride) 
 {
        short i, j;
        for (i=0, j=0; i<24; i++, j+=stride)
@@ -229,7 +229,7 @@ __initfunc(static void PrtChanID(char *pcid, short stride) )
        printk("\n");
 }
 
-__initfunc(static void HWPrtChanID (__u32 pcid, short stride))
+static void __init HWPrtChanID (__u32 pcid, short stride)
 {
        short i, j;
        for (i=0, j=0; i<24; i++, j+=stride)
@@ -250,7 +250,7 @@ __initfunc(static void HWPrtChanID (__u32 pcid, short stride))
  *     which references it.
  */
  
-__initfunc(int ibmtr_probe(struct device *dev))
+int __init ibmtr_probe(struct device *dev)
 {
         int i;
         int base_addr = dev ? dev->base_addr : 0;
@@ -293,7 +293,7 @@ __initfunc(int ibmtr_probe(struct device *dev))
         return -ENODEV;
 }
 
-__initfunc(static int ibmtr_probe1(struct device *dev, int PIOaddr))
+static int __init ibmtr_probe1(struct device *dev, int PIOaddr)
 {
        unsigned char segment=0, intr=0, irq=0, i=0, j=0, cardpresent=NOTOK,temp=0;
        __u32 t_mmio=0;
@@ -748,7 +748,7 @@ __initfunc(static int ibmtr_probe1(struct device *dev, int PIOaddr))
 
 /* query the adapter for the size of shared RAM  */
 
-__initfunc(static unsigned char get_sram_size(struct tok_info *adapt_info))
+static unsigned char __init get_sram_size(struct tok_info *adapt_info)
 {
 
        unsigned char avail_sram_code;
@@ -767,7 +767,7 @@ __initfunc(static unsigned char get_sram_size(struct tok_info *adapt_info))
                return 1<<((readb(adapt_info->mmio+ ACA_OFFSET + ACA_RW + RRR_ODD)>>2)+4);
 }
 
-__initfunc(static int trdev_init(struct device *dev))
+static int __init trdev_init(struct device *dev)
 {
        struct tok_info *ti=(struct tok_info *)dev->priv;
 
index 8e86770a1153c81ef594790f7397a3cfdd94e4cb..46634c42ed3eff25a6a706c7e0dc78c9077e5857 100644 (file)
@@ -61,7 +61,7 @@ static struct dongle dongle_plus = {
        actisys_init_qos,
 };
 
-__initfunc(int actisys_init(void))
+int __init actisys_init(void)
 {
        int ret;
 
index b1f47b77540318109e1b3f7d14902316338152d4..930abe63e9983813ce6bba5ec60137ecd9307b28 100644 (file)
@@ -52,7 +52,7 @@ static struct dongle dongle = {
        esi_qos_init,
 };
 
-__initfunc(int esi_init(void))
+int __init esi_init(void)
 {
        return irda_device_register_dongle(&dongle);
 }
index 938315bc5f3ee6e3469fc5f9dc3a40aa3426de6c..a3d28dedb7c1fe62026d376d8c89f50548d645af 100644 (file)
@@ -76,7 +76,7 @@ static struct dongle dongle = {
        girbil_init_qos,
 };
 
-__initfunc(int girbil_init(void))
+int __init girbil_init(void)
 {
        return irda_device_register_dongle(&dongle);
 }
index e813fe8a4ce76583f3b5188f7236bca573682530..096027b8f62d1a36a1b944617019a7861a7d8088 100644 (file)
@@ -86,7 +86,7 @@ static int  irport_is_receiving(struct irda_device *idev);
 static void irport_set_dtr_rts(struct irda_device *idev, int dtr, int rts);
 static int  irport_raw_write(struct irda_device *idev, __u8 *buf, int len);
 
-__initfunc(int irport_init(void))
+int __init irport_init(void)
 {
        int i;
 
index 751d98ec7b05c02a944794843c1d016be3277ec1..e9e0bb6d54d6083cbd7be6a6b6dc01f259efb001 100644 (file)
@@ -64,7 +64,7 @@ static void irtty_receive_buf(struct tty_struct *, const unsigned char *,
                              char *, int);
 char *driver_name = "irtty";
 
-__initfunc(int irtty_init(void))
+int __init irtty_init(void)
 {
        int status;
        
index 84df367da08ab1c1054d37deebe11afcf684b34c..4758914dde1d655c94d947e99f0a1f4fba9ae87e 100644 (file)
@@ -60,7 +60,7 @@ static struct dongle dongle = {
        litelink_init_qos,
 };
 
-__initfunc(int litelink_init(void))
+int __init litelink_init(void)
 {
        return irda_device_register_dongle(&dongle);
 }
index 9433ec6b5db60f2038bbe022f7723caed95dc797..32220bf43e8fadbefa69d8d57eab982dc19664b7 100644 (file)
@@ -127,7 +127,7 @@ static int  pc87108_net_close(struct device *dev);
  *    Initialize chip. Just try to find out how many chips we are dealing with
  *    and where they are
  */
-__initfunc(int pc87108_init(void))
+int __init pc87108_init(void)
 {
        int i;
 
index 9a5a31a09afac13c2c1c58f189e9021ac30d1101..d1e7de8d5f214ee1efcdc191c046536232e376cb 100644 (file)
@@ -100,7 +100,7 @@ static inline void serial_out(int port, int offset, int value)
  *    Initialize chip. Just try to find out how many chips we are dealing with
  *    and where they are
  */
-__initfunc(int ircc_init(void))
+int __init ircc_init(void)
 {
        int i;
 
index 123e2bd2818caeafd568a8cdaa4a8b1ecc15f0b6..c47cf68d7c5ed992269749fbb46a3ce7cc50de74 100644 (file)
@@ -56,7 +56,7 @@ static struct dongle dongle = {
        tekram_init_qos,
 };
 
-__initfunc(int tekram_init(void))
+int __init tekram_init(void)
 {
        return irda_device_register_dongle(&dongle);
 }
index 2c7d69268a9716cb44f732580e17710fde272e9a..d5eba5fe21913977a5d621f60c994d244bb90d70 100644 (file)
@@ -88,7 +88,7 @@ static int  uircc_net_close(struct device *dev);
  *    Initialize chip. Just try to find out how many chips we are dealing with
  *    and where they are
  */
-__initfunc(int uircc_init(void))
+int __init uircc_init(void)
 {
        int i;
 
index 029d6de5168cc71b7706e91cb18d5b2d589481f6..292b97a3a38eead6d45b56096e84107a574f29f3 100644 (file)
@@ -105,7 +105,7 @@ static int  w83977af_net_close(struct device *dev);
  *    Initialize chip. Just try to find out how many chips we are dealing with
  *    and where they are
  */
-__initfunc(int w83977af_init(void))
+int __init w83977af_init(void)
 {
         int i;
 
index 65998365579e72e5770f2c238ab9cade7e51b90e..9054744fc5661e27aeae6ec30cc0acace786cb29 100644 (file)
@@ -420,7 +420,7 @@ int lance_probe(struct device *dev)
        return -ENODEV;
 }
 
-__initfunc(int lance_probe1(struct device *dev, int ioaddr, int irq, int options))
+int __init lance_probe1(struct device *dev, int ioaddr, int irq, int options)
 {
        struct lance_private *lp;
        short dma_channels;                                     /* Mark spuriously-busy DMA channels */
@@ -499,6 +499,8 @@ __initfunc(int lance_probe1(struct device *dev, int ioaddr, int irq, int options
                
        lp = (struct lance_private *)(((unsigned long)kmalloc(sizeof(*lp)+7,
                                                                                   GFP_DMA | GFP_KERNEL)+7) & ~7);
+       if(lp==NULL)
+               return -ENODEV;
        if (lance_debug > 6) printk(" (#0x%05lx)", (unsigned long)lp);
        memset(lp, 0, sizeof(*lp));
        dev->priv = lp;
index 1fa60e04d5181944afceb6f7af7bdd46fcf74e5a..b61d45e67441a6c15eccfa130540ec5dcddca4d1 100644 (file)
@@ -100,7 +100,7 @@ static unsigned int shmem_mapB[] __initdata = {0xff, 0xfe, 0x0e, 0xfff, 0xffe, 0
  *     PROM for a match against the value assigned to Mylex.
  */
 
-__initfunc(int lne390_probe(struct device *dev))
+int __init lne390_probe(struct device *dev)
 {
        unsigned short ioaddr = dev->base_addr;
 
@@ -127,7 +127,7 @@ __initfunc(int lne390_probe(struct device *dev))
        return ENODEV;
 }
 
-__initfunc(int lne390_probe1(struct device *dev, int ioaddr))
+int __init lne390_probe1(struct device *dev, int ioaddr)
 {
        int i, revision;
        unsigned long eisa_id;
index b2aa9b27bfe1bddfc257497ee5eda1028d7968e7..2f40895777dfc085b4514114b8ce4029022f66a7 100644 (file)
@@ -114,7 +114,7 @@ static int loopback_open(struct device *dev)
 }
 
 /* Initialize the rest of the LOOPBACK device. */
-__initfunc(int loopback_init(struct device *dev))
+int __init loopback_init(struct device *dev)
 {
        dev->mtu                = LOOPBACK_MTU;
        dev->tbusy              = 0;
index 1ffe0f3689eb47799c66c2fd64aa6ae68f4b9db1..6c37405858ff119c2de9648b42cd54ec8fd8afb3 100644 (file)
@@ -1018,7 +1018,7 @@ static struct net_device_stats *ltpc_get_stats(struct device *dev)
 
 /* initialization stuff */
   
-__initfunc(int ltpc_probe_dma(int base))
+int __init ltpc_probe_dma(int base)
 {
        int dma = 0;
        int timeout;
@@ -1088,7 +1088,7 @@ __initfunc(int ltpc_probe_dma(int base))
        return dma;
 }
 
-__initfunc(int ltpc_probe(struct device *dev))
+int __init ltpc_probe(struct device *dev)
 {
        int err;
        int x=0,y=0;
@@ -1250,7 +1250,7 @@ __initfunc(int ltpc_probe(struct device *dev))
 }
 
 /* handles "ltpc=io,irq,dma" kernel command lines */
-__initfunc(void ltpc_setup(char *str, int *ints))
+void __init ltpc_setup(char *str, int *ints)
 {
        if (ints[0] == 0) {
                if (str && !strncmp(str, "auto", 4)) {
index 6772139acc9f98323599bffedd351489432b51c9..58c11d17b12d6a9b3801b638d66eae62bcf2f828 100644 (file)
@@ -1074,7 +1074,7 @@ static inline int myri_ether_init(struct device *dev, struct linux_sbus_device *
        return 0;
 }
 
-__initfunc(int myri_sbus_probe(struct device *dev))
+int __init myri_sbus_probe(struct device *dev)
 {
        struct linux_sbus *bus;
        struct linux_sbus_device *sdev = 0;
index 9bbf753c5ae9d09ecc1ee0947ec2040d1501f2b5..36a841c08d49bea8b997e36009f3d72639d8be1c 100644 (file)
@@ -177,7 +177,7 @@ struct netdev_entry netcard_drv =
  * the card.
  */
 
-__initfunc(int ne_probe(struct device *dev))
+int __init ne_probe(struct device *dev)
 {
        int base_addr = dev ? dev->base_addr : 0;
 
@@ -209,7 +209,7 @@ __initfunc(int ne_probe(struct device *dev))
 #endif
 
 #ifdef CONFIG_PCI
-__initfunc(static int ne_probe_pci(struct device *dev))
+static int __init ne_probe_pci(struct device *dev)
 {
        int i;
 
@@ -243,7 +243,7 @@ __initfunc(static int ne_probe_pci(struct device *dev))
 }
 #endif  /* CONFIG_PCI */
 
-__initfunc(static int ne_probe1(struct device *dev, int ioaddr))
+static int __init ne_probe1(struct device *dev, int ioaddr)
 {
        int i;
        unsigned char SA_prom[32];
index 3fabee261bab55069efc751ad6cc36d27baf6c81..6decb8100c5c07b5434fc98d29f33afca981f41b 100644 (file)
@@ -146,7 +146,7 @@ static void ne_block_output(struct device *dev, const int count,
  * Note that at boot, this probe only picks up one card at a time.
  */
 
-__initfunc (int ne2_probe(struct device *dev))
+int __init ne2_probe(struct device *dev)
 {
        static int current_mca_slot = -1;
        int i;
@@ -198,8 +198,7 @@ static int ne2_procinfo(char *buf, int slot, struct device *dev)
        return len;
 }
 
-
-__initfunc (static int ne2_probe1(struct device *dev, int slot))
+static int __init ne2_probe1(struct device *dev, int slot)
 {
        int i, base_addr, irq;
        unsigned char POS;
index eb3098095223d9839c2e25354fdb55ac14b08525..51d11cb0c446fc71f6cdc24e11f53fc4600537a1 100644 (file)
@@ -95,7 +95,7 @@ static unsigned int shmem_map[] __initdata = {0xff0, 0xfe0, 0xfff0, 0xd8, 0xffe0
  *     PROM for a match against the value assigned to Novell.
  */
 
-__initfunc(int ne3210_probe(struct device *dev))
+int __init ne3210_probe(struct device *dev)
 {
        unsigned short ioaddr = dev->base_addr;
 
@@ -122,7 +122,7 @@ __initfunc(int ne3210_probe(struct device *dev))
        return ENODEV;
 }
 
-__initfunc(int ne3210_probe1(struct device *dev, int ioaddr))
+int __init ne3210_probe1(struct device *dev, int ioaddr)
 {
        int i;
        unsigned long eisa_id;
index 53061d39c02217b87ccf5b1b541379cf3b0bc49a..07ae7b91c0848b6e5813289441b76ff62b761627 100644 (file)
@@ -46,6 +46,7 @@
 
 #define OLYMPIC_NETWORK_MONITOR 0
 
+#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
@@ -54,7 +55,6 @@
 #include <linux/timer.h>
 #include <linux/in.h>
 #include <linux/ioport.h>
-#include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/proc_fs.h>
 #include <linux/ptrace.h>
index e175eb0e690859b4fb5065b6c92b102fdb17695a..22caf3a719f2f17a088f514d92a88c272ba601ac 100644 (file)
@@ -64,8 +64,8 @@ wv_irq_to_psa(int     irq)
 /*
  * Translate PSA irq parameter to irq number 
  */
-__initfunc(static int
-wv_psa_to_irq(u_char   irqval))
+static int __init 
+wv_psa_to_irq(u_char irqval)
 {
   int  irq;
 
@@ -2087,12 +2087,6 @@ wavelan_ioctl(struct device *    dev,    /* device on which the ioctl is applied */
        {
          struct iw_range       range;
 
-         /* Verify the user buffer. */
-         ret = verify_area(VERIFY_WRITE, wrq->u.data.pointer,
-                           sizeof(struct iw_range));
-         if(ret)
-           break;
-
          /* Set the length (useless:  it's constant). */
          wrq->u.data.length = sizeof(struct iw_range);
 
@@ -2118,8 +2112,8 @@ wavelan_ioctl(struct device *     dev,    /* device on which the ioctl is applied */
          range.max_qual.noise = MMR_SILENCE_LVL;
 
          /* Copy structure to the user buffer. */
-         copy_to_user(wrq->u.data.pointer, &range,
-                      sizeof(struct iw_range));
+         if (copy_to_user(wrq->u.data.pointer, &range, sizeof(struct iw_range)))
+               ret = -EFAULT;
        }
       break;
 
@@ -2136,18 +2130,12 @@ wavelan_ioctl(struct device *   dev,    /* device on which the ioctl is applied */
            { SIOCGIPHISTO, 0,      IW_PRIV_TYPE_INT | 16, "gethisto" },
          };
 
-         /* Verify the user buffer. */
-         ret = verify_area(VERIFY_WRITE, wrq->u.data.pointer,
-                           sizeof(priv));
-         if(ret)
-           break;
-
          /* Set the number of available ioctls. */
          wrq->u.data.length = 4;
 
          /* Copy structure to the user buffer. */
-         copy_to_user(wrq->u.data.pointer, (u_char *) priv,
-                      sizeof(priv));
+         if (copy_to_user(wrq->u.data.pointer, (u_char *) priv, sizeof(priv)))
+               ret = -EFAULT;
        }
       break;
 
@@ -2169,14 +2157,11 @@ wavelan_ioctl(struct device *   dev,    /* device on which the ioctl is applied */
          struct sockaddr       address[IW_MAX_SPY];
          int                   i;
 
-         /* Verify where the user has set his addresses. */
-         ret = verify_area(VERIFY_READ, wrq->u.data.pointer,
-                           sizeof(struct sockaddr) * lp->spy_number);
-         if(ret)
-           break;
          /* Copy addresses to the driver. */
-         copy_from_user(address, wrq->u.data.pointer,
-                        sizeof(struct sockaddr) * lp->spy_number);
+         if (copy_from_user(address, wrq->u.data.pointer, sizeof(struct sockaddr) * lp->spy_number)) {
+               ret = -EFAULT;
+               break;
+         }
 
          /* Copy addresses to the lp structure. */
          for(i = 0; i < lp->spy_number; i++)
@@ -2215,13 +2200,6 @@ wavelan_ioctl(struct device *    dev,    /* device on which the ioctl is applied */
          struct sockaddr       address[IW_MAX_SPY];
          int                   i;
 
-         /* Verify the user buffer. */
-         ret = verify_area(VERIFY_WRITE, wrq->u.data.pointer,
-                           (sizeof(iw_qual) + sizeof(struct sockaddr))
-                           * IW_MAX_SPY);
-         if(ret)
-           break;
-
          /* Copy addresses from the lp structure. */
          for(i = 0; i < lp->spy_number; i++)
            {
@@ -2231,13 +2209,18 @@ wavelan_ioctl(struct device *   dev,    /* device on which the ioctl is applied */
            }
 
          /* Copy addresses to the user buffer. */
-         copy_to_user(wrq->u.data.pointer, address,
-                      sizeof(struct sockaddr) * lp->spy_number);
-
+         if (copy_to_user(wrq->u.data.pointer, address, sizeof(struct sockaddr) * lp->spy_number)) {
+               ret = -EFAULT;
+               break;
+         }
+               
          /* Copy stats to the user buffer (just after). */
-         copy_to_user(wrq->u.data.pointer +
+         if (copy_to_user(wrq->u.data.pointer +
                       (sizeof(struct sockaddr) * lp->spy_number),
-                      lp->spy_stat, sizeof(iw_qual) * lp->spy_number);
+                      lp->spy_stat, sizeof(iw_qual) * lp->spy_number)) {
+                               ret = -EFAULT;
+                               break;
+         }
 
          /* Reset updated flags. */
          for(i = 0; i < lp->spy_number; i++)
@@ -2283,14 +2266,11 @@ wavelan_ioctl(struct device *   dev,    /* device on which the ioctl is applied */
       /* Are there addresses to copy? */
       if(lp->his_number > 0)
        {
-         /* Verify where the user has set his addresses. */
-         ret = verify_area(VERIFY_READ, wrq->u.data.pointer,
-                           sizeof(char) * lp->his_number);
-         if(ret)
-           break;
          /* Copy interval ranges to the driver */
-         copy_from_user(lp->his_range, wrq->u.data.pointer,
-                        sizeof(char) * lp->his_number);
+         if (copy_from_user(lp->his_range, wrq->u.data.pointer, sizeof(char) * lp->his_number)) {
+               ret = -EFAULT;
+               break;
+         }
 
          /* Reset structure. */
          memset(lp->his_sum, 0x00, sizeof(long) * 16);
@@ -2304,15 +2284,10 @@ wavelan_ioctl(struct device *   dev,    /* device on which the ioctl is applied */
       /* Give back the distribution statistics */
       if((lp->his_number > 0) && (wrq->u.data.pointer != (caddr_t) 0))
        {
-         /* Verify the user buffer. */
-         ret = verify_area(VERIFY_WRITE, wrq->u.data.pointer,
-                           sizeof(long) * 16);
-         if(ret)
-           break;
-
          /* Copy data to the user buffer. */
-         copy_to_user(wrq->u.data.pointer, lp->his_sum,
-                      sizeof(long) * lp->his_number);
+         if (copy_to_user(wrq->u.data.pointer, lp->his_sum, sizeof(long) * lp->his_number)) 
+                       ret = -EFAULT;
+                       
        }       /* if(pointer != NULL) */
       break;
 #endif /* HISTOGRAM */
@@ -4015,8 +3990,8 @@ wavelan_close(device *    dev)
  * device structure
  * (called by wavelan_probe() and via init_module()).
  */
-__initfunc(static int
-wavelan_config(device *        dev))
+static int __init 
+wavelan_config(device *        dev)
 {
   u_long       ioaddr = dev->base_addr;
   u_char       irq_mask;
@@ -4132,8 +4107,8 @@ wavelan_config(device *   dev))
  * We follow the example in drivers/net/ne.c.
  * (called in "Space.c")
  */
-__initfunc(int
-wavelan_probe(device * dev))
+int __init 
+wavelan_probe(device * dev)
 {
   short                base_addr;
   mac_addr     mac;            /* MAC address (check existence of WaveLAN) */
@@ -4265,6 +4240,11 @@ init_module(void)
 
          /* Create device and set basic arguments. */
          dev = kmalloc(sizeof(struct device), GFP_KERNEL);
+         if(dev==NULL)
+         {
+               ret = -ENOMEM;
+               break;
+         }
          memset(dev, 0x00, sizeof(struct device));
          dev->name = name[i];
          dev->base_addr = io[i];
index b34d74e96d74e0e6f5fbda09207216ed9e4ea940..95afed2fb4bbba778343c18804e558753261afe9 100644 (file)
@@ -308,6 +308,7 @@ struct pci_dev_info dev_info[] = {
        DEVICE( NEOMAGIC,       NEOMAGIC_MAGICGRAPH_128V, "MagicGraph 128V"),
        DEVICE( NEOMAGIC,       NEOMAGIC_MAGICGRAPH_128ZV, "MagicGraph 128ZV"),
        DEVICE( NEOMAGIC,       NEOMAGIC_MAGICGRAPH_NM2160, "MagicGraph NM2160"),
+       DEVICE( NEOMAGIC,       NEOMAGIC_MAGICGRAPH_128ZVPLUS, "MagicGraph 128ZV+"),
        DEVICE( ASP,            ASP_ABP940,     "ABP940"),
        DEVICE( ASP,            ASP_ABP940U,    "ABP940U"),
        DEVICE( ASP,            ASP_ABP940UW,   "ABP940UW"),
@@ -465,6 +466,7 @@ struct pci_dev_info dev_info[] = {
        DEVICE( SATSAGEM,       SATSAGEM_PCR2101,"PCR2101 DVB receiver"),
        DEVICE( SATSAGEM,       SATSAGEM_TELSATTURBO,"Telsat Turbo DVB"),
        DEVICE( HUGHES,         HUGHES_DIRECPC, "DirecPC"),
+       DEVICE( ENSONIQ,        ENSONIQ_ES1371, "ES1371"),
        DEVICE( ENSONIQ,        ENSONIQ_AUDIOPCI,"AudioPCI"),
        DEVICE( ALTEON,         ALTEON_ACENIC,  "AceNIC"),
        DEVICE( PICTUREL,       PICTUREL_PCIVST,"PCIVST"),
@@ -503,6 +505,7 @@ struct pci_dev_info dev_info[] = {
        DEVICE( S3,             S3_ViRGE_MXPMV, "ViRGE/MX+MV"),
        DEVICE( S3,             S3_SONICVIBES,  "SonicVibes"),
        DEVICE( DCI,            DCI_PCCOM4,     "PC COM PCI Bus 4 port serial Adapter"),
+       DEVICE( GENROCO,        GENROCO_HFP832, "TURBOstor HFP832"),
        DEVICE( INTEL,          INTEL_82375,    "82375EB"),
        DEVICE( INTEL,          INTEL_82424,    "82424ZX Saturn"),
        DEVICE( INTEL,          INTEL_82378,    "82378IB"),
@@ -541,6 +544,7 @@ struct pci_dev_info dev_info[] = {
        DEVICE( KTI,            KTI_ET32P2,     "ET32P2"),
        DEVICE( ADAPTEC,        ADAPTEC_7810,   "AIC-7810 RAID"),
        DEVICE( ADAPTEC,        ADAPTEC_7821,   "AIC-7860"),
+       DEVICE( ADAPTEC,        ADAPTEC_38602,  "AIC-7860"),
        DEVICE( ADAPTEC,        ADAPTEC_7850,   "AIC-7850"),
        DEVICE( ADAPTEC,        ADAPTEC_7855,   "AIC-7855"),
        DEVICE( ADAPTEC,        ADAPTEC_5800,   "AIC-5800"),
@@ -831,6 +835,7 @@ static const char *pci_strvendor(unsigned int vendor)
              case PCI_VENDOR_ID_NETVIN:        return "NetVin";
              case PCI_VENDOR_ID_S3:            return "S3 Inc.";
              case PCI_VENDOR_ID_DCI:           return "Decision Computer Int.";
+             case PCI_VENDOR_ID_GENROCO:       return "Genroco";
              case PCI_VENDOR_ID_INTEL:         return "Intel";
              case PCI_VENDOR_ID_KTI:           return "KTI";
              case PCI_VENDOR_ID_ADAPTEC:       return "Adaptec";
@@ -1027,7 +1032,7 @@ static struct proc_dir_entry proc_old_pci = {
        0, &proc_array_inode_operations
 };
 
-__initfunc(void proc_old_pci_init(void))
+void __init proc_old_pci_init(void)
 {
        proc_register(&proc_root, &proc_old_pci);
 }
index f43b1ead8a0dbe9eae0a8eef94dae13efdc468f1..b9f884a9e1d5543bd1e7a229dcdc8ecdb2b2f91c 100644 (file)
  **************************************************************************
 
 
+
  DESCRIPTION:
 
  This is the Linux low-level SCSI driver for Adaptec AHA-1520/1522 SCSI
 
  CONFIGURATION ARGUMENTS:
 
 IOPORT        base io address                           (0x340/0x140)
 IRQ           interrupt level                           (9-12; default 11)
 SCSI_ID       scsi id of controller                     (0-7; default 7)
 RECONNECT     allow targets to disconnect from the bus  (0/1; default 1 [on])
 PARITY        enable parity checking                    (0/1; default 1 [on])
 SYNCHRONOUS   enable synchronous transfers              (0/1; default 0 [off])
               (NOT WORKING YET)
 DELAY:        bus reset delay                           (default 100)
 EXT_TRANS:    enable extended translation               (0/1: default 0 [off])
               (see NOTES below)
+ IOPORT        base io address                           (0x340/0x140)
+ IRQ           interrupt level                           (9-12; default 11)
+ SCSI_ID       scsi id of controller                     (0-7; default 7)
+ RECONNECT     allow targets to disconnect from the bus  (0/1; default 1 [on])
+ PARITY        enable parity checking                    (0/1; default 1 [on])
+ SYNCHRONOUS   enable synchronous transfers              (0/1; default 0 [off])
+ (NOT WORKING YET)
+ DELAY:        bus reset delay                           (default 100)
+ EXT_TRANS:    enable extended translation               (0/1: default 0 [off])
+ (see NOTES below)
 
  COMPILE TIME CONFIGURATION (put into AHA152X in drivers/scsi/Makefile):
 
  -DAUTOCONF
  use configuration the controller reports (AHA-152x only)
+ use configuration the controller reports (AHA-152x only)
 
  -DSKIP_BIOSTEST
  Don't test for BIOS signature (AHA-1510 or disabled BIOS)
+ Don't test for BIOS signature (AHA-1510 or disabled BIOS)
 
  -DSETUP0="{ IOPORT, IRQ, SCSI_ID, RECONNECT, PARITY, SYNCHRONOUS, DELAY, EXT_TRANS }"
  override for the first controller 
-   
+ override for the first controller 
+
  -DSETUP1="{ IOPORT, IRQ, SCSI_ID, RECONNECT, PARITY, SYNCHRONOUS, DELAY, EXT_TRANS }"
  override for the second controller
+ override for the second controller
 
 
  LILO COMMAND LINE OPTIONS:
 
 
  SYMBOLS FOR MODULE CONFIGURATION:
-  aha152x=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS
-    configuration override of first controller
 
-  aha152x1=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS
-    configuration override of second controller
+ aha152x=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS
+ configuration override of first controller
+
+
+ aha152x1=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS
+ configuration override of second controller
 
 
  NOTES ON EXT_TRANS: 
 
  - for disks<1GB: use default translation (C/32/64)
  - for disks>1GB:
  - take current geometry from the partition table
    (using scsicam_bios_param and accept only `valid' geometries,
     ie. either (C/32/64) or (C/63/255)).  This can be extended
     translation even if it's not enabled in the driver.
  - if that fails, take extended translation if enabled by override,
    kernel or module parameter, otherwise take default translation and
    ask the user for verification.  This might on not yet partitioned
    disks or
+ - take current geometry from the partition table
+ (using scsicam_bios_param and accept only `valid' geometries,
+ ie. either (C/32/64) or (C/63/255)).  This can be extended
+ translation even if it's not enabled in the driver.
+ - if that fails, take extended translation if enabled by override,
+ kernel or module parameter, otherwise take default translation and
+ ask the user for verification.  This might on not yet partitioned
+ disks or
 
 
  REFERENCES USED:
  "Kernel Hacker's Guide", Michael K. Johnson (johnsonm@sunsite.unc.edu)
 
  "Adaptec 1520/1522 User's Guide", Adaptec Corporation.
+
  Michael K. Johnson (johnsonm@sunsite.unc.edu)
 
  Drew Eckhardt (drew@cs.colorado.edu)
 
 #include <scsi/scsicam.h>
 
-struct proc_dir_entry proc_scsi_aha152x = {
-    PROC_SCSI_AHA152X, 7, "aha152x",
-    S_IFDIR | S_IRUGO | S_IXUGO, 2
+struct proc_dir_entry proc_scsi_aha152x =
+{
+       PROC_SCSI_AHA152X, 7, "aha152x",
+       S_IFDIR | S_IRUGO | S_IXUGO, 2
 };
 
 /* DEFINES */
@@ -370,25 +371,25 @@ struct proc_dir_entry proc_scsi_aha152x = {
 
 #if defined(DEBUG_AHA152X)
 
-#undef  SKIP_PORTS              /* don't display ports */
-
-#undef  DEBUG_QUEUE             /* debug queue() */
-#undef  DEBUG_RESET             /* debug reset() */
-#undef  DEBUG_INTR              /* debug intr() */
-#undef  DEBUG_SELECTION         /* debug selection part in intr() */
-#undef  DEBUG_MSGO              /* debug message out phase in intr() */
-#undef  DEBUG_MSGI              /* debug message in phase in intr() */
-#undef  DEBUG_STATUS            /* debug status phase in intr() */
-#undef  DEBUG_CMD               /* debug command phase in intr() */
-#undef  DEBUG_DATAI             /* debug data in phase in intr() */
-#undef  DEBUG_DATAO             /* debug data out phase in intr() */
-#undef  DEBUG_ABORT             /* debug abort() */
-#undef  DEBUG_DONE              /* debug done() */
-#undef  DEBUG_BIOSPARAM         /* debug biosparam() */
-
-#undef  DEBUG_RACE              /* debug race conditions */
-#undef  DEBUG_PHASES            /* debug phases (useful to trace) */
-#undef  DEBUG_QUEUES            /* debug reselection */
+#undef  SKIP_PORTS             /* don't display ports */
+
+#undef  DEBUG_QUEUE            /* debug queue() */
+#undef  DEBUG_RESET            /* debug reset() */
+#undef  DEBUG_INTR             /* debug intr() */
+#undef  DEBUG_SELECTION                /* debug selection part in intr() */
+#undef  DEBUG_MSGO             /* debug message out phase in intr() */
+#undef  DEBUG_MSGI             /* debug message in phase in intr() */
+#undef  DEBUG_STATUS           /* debug status phase in intr() */
+#undef  DEBUG_CMD              /* debug command phase in intr() */
+#undef  DEBUG_DATAI            /* debug data in phase in intr() */
+#undef  DEBUG_DATAO            /* debug data out phase in intr() */
+#undef  DEBUG_ABORT            /* debug abort() */
+#undef  DEBUG_DONE             /* debug done() */
+#undef  DEBUG_BIOSPARAM                /* debug biosparam() */
+
+#undef  DEBUG_RACE             /* debug race conditions */
+#undef  DEBUG_PHASES           /* debug phases (useful to trace) */
+#undef  DEBUG_QUEUES           /* debug reselection */
 
 /* recently used for debugging */
 #if 0
@@ -424,46 +425,50 @@ extern long loops_per_sec;
 #define IRQS    IRQ_MAX-IRQ_MIN+1
 
 enum {
-  not_issued   = 0x0001,
-  in_selection = 0x0002,
-  disconnected = 0x0004,
-  aborted      = 0x0008,
-  sent_ident   = 0x0010,
-  in_other     = 0x0020,
-  in_sync      = 0x0040,
-  sync_ok      = 0x0080,
+       not_issued = 0x0001,
+       in_selection = 0x0002,
+       disconnected = 0x0004,
+       aborted = 0x0008,
+       sent_ident = 0x0010,
+       in_other = 0x0020,
+       in_sync = 0x0040,
+       sync_ok = 0x0080,
 };
 
 #if defined(MODULE)
 #if defined(DEBUG_AHA152X)
-int aha152x[]  = { 0, 11, 7, 1, 1, 0, DELAY_DEFAULT, 0, DEBUG_DEFAULT };
-int aha152x1[] = { 0, 11, 7, 1, 1, 0, DELAY_DEFAULT, 0, DEBUG_DEFAULT };
+int aha152x[] =
+{0, 11, 7, 1, 1, 0, DELAY_DEFAULT, 0, DEBUG_DEFAULT};
+int aha152x1[] =
+{0, 11, 7, 1, 1, 0, DELAY_DEFAULT, 0, DEBUG_DEFAULT};
 MODULE_PARM(aha152x, "1-9i");
 MODULE_PARM(aha152x1, "1-9i");
 #else
-int aha152x[]  = { 0, 11, 7, 1, 1, 0, DELAY_DEFAULT, 0 };
-int aha152x1[] = { 0, 11, 7, 1, 1, 0, DELAY_DEFAULT, 0 };
+int aha152x[] =
+{0, 11, 7, 1, 1, 0, DELAY_DEFAULT, 0};
+int aha152x1[] =
+{0, 11, 7, 1, 1, 0, DELAY_DEFAULT, 0};
 MODULE_PARM(aha152x, "1-8i");
 MODULE_PARM(aha152x1, "1-8i");
 #endif
 #endif
 
 /* set by aha152x_setup according to the command line */
-static int  setup_count=0;
-static int  registered_count=0;
+static int setup_count = 0;
+static int registered_count = 0;
 static struct aha152x_setup {
-  int io_port;
-  int irq;
-  int scsiid;
-  int reconnect;
-  int parity;
-  int synchronous;
-  int delay;
-  int ext_trans;
+       int io_port;
+       int irq;
+       int scsiid;
+       int reconnect;
+       int parity;
+       int synchronous;
+       int delay;
+       int ext_trans;
 #ifdef DEBUG_AHA152X
-  int debug;
+       int debug;
 #endif
-  char *conf;
+       char *conf;
 } setup[2];
 
 static struct Scsi_Host *aha152x_host[IRQS];
@@ -480,30 +485,30 @@ static struct Scsi_Host *aha152x_host[IRQS];
 #define ADDMSG(x)         (MSG(MSGLEN++)=x)
 
 struct aha152x_hostdata {
-  Scsi_Cmnd     *issue_SC;
-  Scsi_Cmnd     *current_SC;
-  Scsi_Cmnd     *disconnected_SC;
-  int           aborting;
-  int           abortion_complete;
-  int           abort_result;
-  int           commands;
-  
-  int           reconnect;
-  int           parity;
-  int           synchronous;
-  int           delay;
-  int           ext_trans;
-
-  int           swint;
-  int          service;
-  unsigned char syncrate[8];
-  
-  unsigned char message[256];
-  int           message_len;
+       Scsi_Cmnd *issue_SC;
+       Scsi_Cmnd *current_SC;
+       Scsi_Cmnd *disconnected_SC;
+       int aborting;
+       int abortion_complete;
+       int abort_result;
+       int commands;
+
+       int reconnect;
+       int parity;
+       int synchronous;
+       int delay;
+       int ext_trans;
+
+       int swint;
+       int service;
+
+       unsigned char syncrate[8];
+
+       unsigned char message[256];
+       int message_len;
 
 #ifdef DEBUG_AHA152X
-  int           debug;
+       int debug;
 #endif
 };
 
@@ -516,7 +521,7 @@ static void aha152x_reset_ports(struct Scsi_Host *shpnt);
 static void aha152x_panic(struct Scsi_Host *shpnt, char *msg);
 
 static void disp_ports(struct Scsi_Host *shpnt);
-static void show_command(Scsi_Cmnd *ptr);
+static void show_command(Scsi_Cmnd * ptr);
 static void show_queues(struct Scsi_Host *shpnt);
 static void disp_enintr(struct Scsi_Host *shpnt);
 
@@ -528,8 +533,8 @@ static void leave_driver(const char *);
 /* possible i/o addresses for the AIC-6260 */
 static unsigned short ports[] =
 {
-  0x340,      /* default first */
-  0x140
+       0x340,                  /* default first */
+       0x140
 };
 #define PORT_COUNT (sizeof(ports) / sizeof(unsigned short))
 
@@ -537,15 +542,15 @@ static unsigned short ports[] =
 /* possible locations for the Adaptec BIOS */
 static unsigned int addresses[] =
 {
-  0xdc000,   /* default first */
-  0xc8000,
-  0xcc000,
-  0xd0000,
-  0xd4000,
-  0xd8000,
-  0xe0000,
-  0xeb800,   /* VTech Platinum SMP */
-  0xf0000,
+       0xdc000,                /* default first */
+       0xc8000,
+       0xcc000,
+       0xd0000,
+       0xd4000,
+       0xd8000,
+       0xe0000,
+       0xeb800,                /* VTech Platinum SMP */
+       0xf0000,
 };
 #define ADDRESS_COUNT (sizeof(addresses) / sizeof(unsigned int))
 
@@ -557,80 +562,103 @@ static unsigned int addresses[] =
    needed anyway.  May be an information whether or not the BIOS supports
    extended translation could be also useful here. */
 static struct signature {
-  unsigned char *signature;
-  int  sig_offset;
-  int  sig_length;
+       unsigned char *signature;
+       int sig_offset;
+       int sig_length;
 } signatures[] =
+
 {
-  { "Adaptec AHA-1520 BIOS",      0x102e, 21 },  /* Adaptec 152x */
-  { "Adaptec AHA-1520B",            0x0b, 19 },  /* Adaptec 152x rev B */
-  { "Adaptec ASW-B626 BIOS",      0x1029, 21 },  /* on-board controller */
-  { "Adaptec BIOS: ASW-B626",       0x0f, 22 },  /* on-board controller */
-  { "Adaptec ASW-B626 S2",        0x2e6c, 19 },  /* on-board controller */
-  { "Adaptec BIOS:AIC-6360",         0xc, 21 },  /* on-board controller */
-  { "ScsiPro SP-360 BIOS",        0x2873, 19 },  /* ScsiPro-Controller  */
-  { "GA-400 LOCAL BUS SCSI BIOS", 0x102e, 26 },  /* Gigabyte Local-Bus-SCSI */
-  { "Adaptec BIOS:AVA-282X",         0xc, 21 },  /* Adaptec 282x */
-  { "Adaptec IBM Dock II SCSI",   0x2edd, 24 },  /* IBM Thinkpad Dock II */
-  { "Adaptec BIOS:AHA-1532P",       0x1c, 22 },  /* IBM Thinkpad Dock II SCSI */
-  { "DTC3520A Host Adapter BIOS", 0x318a, 26 },  /* DTC 3520A ISA SCSI */
+       {
+               "Adaptec AHA-1520 BIOS", 0x102e, 21
+       },                      /* Adaptec 152x */
+       {
+               "Adaptec AHA-1520B", 0x0b, 19
+       },                      /* Adaptec 152x rev B */
+       {
+               "Adaptec ASW-B626 BIOS", 0x1029, 21
+       },                      /* on-board controller */
+       {
+               "Adaptec BIOS: ASW-B626", 0x0f, 22
+       },                      /* on-board controller */
+       {
+               "Adaptec ASW-B626 S2", 0x2e6c, 19
+       },                      /* on-board controller */
+       {
+               "Adaptec BIOS:AIC-6360", 0xc, 21
+       },                      /* on-board controller */
+       {
+               "ScsiPro SP-360 BIOS", 0x2873, 19
+       },                      /* ScsiPro-Controller  */
+       {
+               "GA-400 LOCAL BUS SCSI BIOS", 0x102e, 26
+       },                      /* Gigabyte Local-Bus-SCSI */
+       {
+               "Adaptec BIOS:AVA-282X", 0xc, 21
+       },                      /* Adaptec 282x */
+       {
+               "Adaptec IBM Dock II SCSI", 0x2edd, 24
+       },                      /* IBM Thinkpad Dock II */
+       {
+               "Adaptec BIOS:AHA-1532P", 0x1c, 22
+       },                      /* IBM Thinkpad Dock II SCSI */
+       {
+               "DTC3520A Host Adapter BIOS", 0x318a, 26
+       },                      /* DTC 3520A ISA SCSI */
 };
+
 #define SIGNATURE_COUNT (sizeof(signatures) / sizeof(struct signature))
 #endif
 
 
-static void do_pause(unsigned amount) /* Pause for amount*10 milliseconds */
-{
-   unsigned long the_time = jiffies + amount; /* 0.01 seconds per jiffy */
+static void do_pause(unsigned amount)
+{                              /* Pause for amount*10 milliseconds */
+       unsigned long the_time = jiffies + amount;      /* 0.01 seconds per jiffy */
 
-   while (time_before(jiffies, the_time))
-     barrier();
+       while (time_before(jiffies, the_time))
+               barrier();
 }
 
 /*
  *  queue services:
  */
-static inline void append_SC(Scsi_Cmnd **SC, Scsi_Cmnd *new_SC)
+static inline void append_SC(Scsi_Cmnd ** SC, Scsi_Cmnd * new_SC)
 {
-  Scsi_Cmnd *end;
-
-  new_SC->host_scribble = (unsigned char *) NULL;
-  if(!*SC)
-    *SC=new_SC;
-  else {
-    for(end=*SC; end->host_scribble; end = (Scsi_Cmnd *) end->host_scribble)
-      ;
-    end->host_scribble = (unsigned char *) new_SC;
-  }
+       Scsi_Cmnd *end;
+
+       new_SC->host_scribble = (unsigned char *) NULL;
+       if (!*SC)
+               *SC = new_SC;
+       else {
+               for (end = *SC; end->host_scribble; end = (Scsi_Cmnd *) end->host_scribble);
+               end->host_scribble = (unsigned char *) new_SC;
+       }
 }
 
-static inline Scsi_Cmnd *remove_first_SC(Scsi_Cmnd **SC)
+static inline Scsi_Cmnd *remove_first_SC(Scsi_Cmnd ** SC)
 {
-  Scsi_Cmnd *ptr;
+       Scsi_Cmnd *ptr;
 
-  ptr=*SC;
-  if(ptr)
-    *SC= (Scsi_Cmnd *) (*SC)->host_scribble;
-  return ptr;
+       ptr = *SC;
+       if (ptr)
+               *SC = (Scsi_Cmnd *) (*SC)->host_scribble;
+       return ptr;
 }
 
-static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, int target, int lun)
+static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd ** SC, int target, int lun)
 {
-  Scsi_Cmnd *ptr, *prev;
-
-  for(ptr=*SC, prev=NULL;
-       ptr && ((ptr->target!=target) || (ptr->lun!=lun));
-      prev = ptr, ptr = (Scsi_Cmnd *) ptr->host_scribble)
-    ;
+       Scsi_Cmnd *ptr, *prev;
 
-  if(ptr){
-    if(prev)
-      prev->host_scribble = ptr->host_scribble;
-    else
-      *SC= (Scsi_Cmnd *) ptr->host_scribble;
-  }
+       for (ptr = *SC, prev = NULL;
+            ptr && ((ptr->target != target) || (ptr->lun != lun));
+            prev = ptr, ptr = (Scsi_Cmnd *) ptr->host_scribble);
 
-  return ptr;
+       if (ptr) {
+               if (prev)
+                       prev->host_scribble = ptr->host_scribble;
+               else
+                       *SC = (Scsi_Cmnd *) ptr->host_scribble;
+       }
+       return ptr;
 }
 
 /*
@@ -638,12 +666,12 @@ static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, int target, int lun)
  */
 static void make_acklow(struct Scsi_Host *shpnt)
 {
-  SETPORT(SXFRCTL0, CH1|SPIOEN);
-  GETPORT(SCSIDAT);
-  SETPORT(SXFRCTL0, CH1);
+       SETPORT(SXFRCTL0, CH1 | SPIOEN);
+       GETPORT(SCSIDAT);
+       SETPORT(SXFRCTL0, CH1);
 
-  while(TESTHI(SCSISIG, ACKI))
-    barrier();
+       while (TESTHI(SCSISIG, ACKI))
+               barrier();
 }
 
 /*
@@ -658,61 +686,61 @@ static void make_acklow(struct Scsi_Host *shpnt)
  */
 static int getphase(struct Scsi_Host *shpnt)
 {
-  int phase, sstat1;
-  
-  while(1) {
-    do {
-      while(!((sstat1 = GETPORT(SSTAT1)) & (BUSFREE|SCSIRSTI|REQINIT)))
-        barrier();
-      if(sstat1 & BUSFREE)
-        return P_BUSFREE;
-      if(sstat1 & SCSIRSTI) {
-        printk("aha152x: RESET IN\n");
-        SETPORT(SSTAT1, SCSIRSTI);
-      }
-    } while(TESTHI(SCSISIG, ACKI) || TESTLO(SSTAT1, REQINIT));
-
-    SETPORT(SSTAT1, CLRSCSIPERR);
-  
-    phase = GETPORT(SCSISIG) & P_MASK ;
-
-    if(TESTHI(SSTAT1, SCSIPERR)) {
-      if((phase & (CDO|MSGO))==0)                        /* DATA phase */
-        return P_PARITY;
-
-      make_acklow(shpnt);
-    } else
-      return phase;
-  }
+       int phase, sstat1;
+
+       while (1) {
+               do {
+                       while (!((sstat1 = GETPORT(SSTAT1)) & (BUSFREE | SCSIRSTI | REQINIT)))
+                               barrier();
+                       if (sstat1 & BUSFREE)
+                               return P_BUSFREE;
+                       if (sstat1 & SCSIRSTI) {
+                               printk("aha152x: RESET IN\n");
+                               SETPORT(SSTAT1, SCSIRSTI);
+                       }
+               } while (TESTHI(SCSISIG, ACKI) || TESTLO(SSTAT1, REQINIT));
+
+               SETPORT(SSTAT1, CLRSCSIPERR);
+
+               phase = GETPORT(SCSISIG) & P_MASK;
+
+               if (TESTHI(SSTAT1, SCSIPERR)) {
+                       if ((phase & (CDO | MSGO)) == 0)        /* DATA phase */
+                               return P_PARITY;
+
+                       make_acklow(shpnt);
+               } else
+                       return phase;
+       }
 }
 
 /* called from init/main.c */
 void aha152x_setup(char *str, int *ints)
 {
-  if(setup_count>2)
-    panic("aha152x: you can only configure up to two controllers\n");
-
-  setup[setup_count].conf        = str;
-  setup[setup_count].io_port     = ints[0] >= 1 ? ints[1] : 0x340;
-  setup[setup_count].irq         = ints[0] >= 2 ? ints[2] : 11;
-  setup[setup_count].scsiid      = ints[0] >= 3 ? ints[3] : 7;
-  setup[setup_count].reconnect   = ints[0] >= 4 ? ints[4] : 1;
-  setup[setup_count].parity      = ints[0] >= 5 ? ints[5] : 1;
-  setup[setup_count].synchronous = ints[0] >= 6 ? ints[6] : 0 /* FIXME: 1 */;
-  setup[setup_count].delay       = ints[0] >= 7 ? ints[7] : DELAY_DEFAULT;
-  setup[setup_count].ext_trans   = ints[0] >= 8 ? ints[8] : 0;
+       if (setup_count > 2)
+               panic("aha152x: you can only configure up to two controllers\n");
+
+       setup[setup_count].conf = str;
+       setup[setup_count].io_port = ints[0] >= 1 ? ints[1] : 0x340;
+       setup[setup_count].irq = ints[0] >= 2 ? ints[2] : 11;
+       setup[setup_count].scsiid = ints[0] >= 3 ? ints[3] : 7;
+       setup[setup_count].reconnect = ints[0] >= 4 ? ints[4] : 1;
+       setup[setup_count].parity = ints[0] >= 5 ? ints[5] : 1;
+       setup[setup_count].synchronous = ints[0] >= 6 ? ints[6] : 0 /* FIXME: 1 */ ;
+       setup[setup_count].delay = ints[0] >= 7 ? ints[7] : DELAY_DEFAULT;
+       setup[setup_count].ext_trans = ints[0] >= 8 ? ints[8] : 0;
 #ifdef DEBUG_AHA152X
-  setup[setup_count].debug       = ints[0] >= 9 ? ints[9] : DEBUG_DEFAULT;
-  if(ints[0]>9) { 
-    printk("aha152x: usage: aha152x=<IOBASE>[,<IRQ>[,<SCSI ID>"
-           "[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY>[,<EXT_TRANS>[,<DEBUG>]]]]]]]]\n");
+       setup[setup_count].debug = ints[0] >= 9 ? ints[9] : DEBUG_DEFAULT;
+       if (ints[0] > 9) {
+               printk("aha152x: usage: aha152x=<IOBASE>[,<IRQ>[,<SCSI ID>"
+                      "[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY>[,<EXT_TRANS>[,<DEBUG>]]]]]]]]\n");
 #else
-  if(ints[0]>8) {
-    printk("aha152x: usage: aha152x=<IOBASE>[,<IRQ>[,<SCSI ID>"
-           "[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY>[,<EXT_TRANS>]]]]]]]\n");
+       if (ints[0] > 8) {
+               printk("aha152x: usage: aha152x=<IOBASE>[,<IRQ>[,<SCSI ID>"
+                      "[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY>[,<EXT_TRANS>]]]]]]]\n");
 #endif
-  } else 
-    setup_count++;
+       } else
+               setup_count++;
 }
 
 /*
@@ -720,598 +748,589 @@ void aha152x_setup(char *str, int *ints)
  */
 static int aha152x_porttest(int io_port)
 {
-  int i;
+       int i;
 
-  if(check_region(io_port, IO_RANGE))
-    return 0;
+       if (check_region(io_port, IO_RANGE))
+               return 0;
 
-  SETPORT(io_port+O_DMACNTRL1, 0);          /* reset stack pointer */
-  for(i=0; i<16; i++)
-    SETPORT(io_port+O_STACK, i);
+       SETPORT(io_port + O_DMACNTRL1, 0);      /* reset stack pointer */
+       for (i = 0; i < 16; i++)
+               SETPORT(io_port + O_STACK, i);
 
-  SETPORT(io_port+O_DMACNTRL1, 0);          /* reset stack pointer */
-  for(i=0; i<16 && GETPORT(io_port+O_STACK)==i; i++)
-    ;
+       SETPORT(io_port + O_DMACNTRL1, 0);      /* reset stack pointer */
+       for (i = 0; i < 16 && GETPORT(io_port + O_STACK) == i; i++);
 
-  return(i==16);
+       return (i == 16);
 }
 
 int aha152x_checksetup(struct aha152x_setup *setup)
 {
-  int i;
-  
+       int i;
+
 #ifndef PCMCIA
-  for(i=0; i<PORT_COUNT && (setup->io_port != ports[i]); i++)
-    ;
-  
-  if(i==PORT_COUNT)
-    return 0;
-#endif
-  
-  if(!aha152x_porttest(setup->io_port))
-    return 0;
-  
-  if((setup->irq<IRQ_MIN) || (setup->irq>IRQ_MAX))
-    return 0;
-  
-  if((setup->scsiid < 0) || (setup->scsiid > 7))
-    return 0;
-  
-  if((setup->reconnect < 0) || (setup->reconnect > 1))
-    return 0;
-  
-  if((setup->parity < 0) || (setup->parity > 1))
-    return 0;
-  
-  if((setup->synchronous < 0) || (setup->synchronous > 1))
-    return 0;
-
-  if((setup->ext_trans < 0) || (setup->ext_trans > 1))
-    return 0;
-  
-  
-  return 1;
+       for (i = 0; i < PORT_COUNT && (setup->io_port != ports[i]); i++);
+
+       if (i == PORT_COUNT)
+               return 0;
+#endif
+
+       if (!aha152x_porttest(setup->io_port))
+               return 0;
+
+       if ((setup->irq < IRQ_MIN) || (setup->irq > IRQ_MAX))
+               return 0;
+
+       if ((setup->scsiid < 0) || (setup->scsiid > 7))
+               return 0;
+
+       if ((setup->reconnect < 0) || (setup->reconnect > 1))
+               return 0;
+
+       if ((setup->parity < 0) || (setup->parity > 1))
+               return 0;
+
+       if ((setup->synchronous < 0) || (setup->synchronous > 1))
+               return 0;
+
+       if ((setup->ext_trans < 0) || (setup->ext_trans > 1))
+               return 0;
+
+
+       return 1;
 }
 
-void aha152x_swintr(int irqno, void *dev_id, struct pt_regs * regs)
+void aha152x_swintr(int irqno, void *dev_id, struct pt_regs *regs)
 {
-  struct Scsi_Host *shpnt = aha152x_host[irqno-IRQ_MIN];
+       struct Scsi_Host *shpnt = aha152x_host[irqno - IRQ_MIN];
 
-  if(!shpnt)
-    panic("aha152x: catched software interrupt for unknown controller.\n");
+       if (!shpnt)
+               panic("aha152x: catched software interrupt for unknown controller.\n");
 
-  HOSTDATA(shpnt)->swint++;
+       HOSTDATA(shpnt)->swint++;
 }
 
 
 int aha152x_detect(Scsi_Host_Template * tpnt)
 {
-  int                 i, j, ok;
+       int i, j, ok;
 #if defined(AUTOCONF)
-  aha152x_config      conf;
-#endif
-  
-  tpnt->proc_dir = &proc_scsi_aha152x;
-
-  for(i=0; i<IRQS; i++)
-    aha152x_host[i] = (struct Scsi_Host *) NULL;
-  
-  if(setup_count) {
-    printk("aha152x: processing commandline: ");
-   
-    for(i=0; i<setup_count; i++)
-      if(!aha152x_checksetup(&setup[i])) {
-        printk("\naha152x: %s\n", setup[i].conf);
-        printk("aha152x: invalid line (controller=%d)\n", i+1);
-      }
-
-      printk("ok\n");
-  }
+       aha152x_config conf;
+#endif
+
+       tpnt->proc_dir = &proc_scsi_aha152x;
+
+       for (i = 0; i < IRQS; i++)
+               aha152x_host[i] = (struct Scsi_Host *) NULL;
+
+       if (setup_count) {
+               printk("aha152x: processing commandline: ");
+
+               for (i = 0; i < setup_count; i++)
+                       if (!aha152x_checksetup(&setup[i])) {
+                               printk("\naha152x: %s\n", setup[i].conf);
+                               printk("aha152x: invalid line (controller=%d)\n", i + 1);
+                       }
+               printk("ok\n");
+       }
 #ifdef SETUP0
-  if(setup_count<2) {
-    struct aha152x_setup override = SETUP0;
-
-    if(setup_count==0 || (override.io_port != setup[0].io_port))
-      if(!aha152x_checksetup(&override)) {
-        printk("\naha152x: invalid override SETUP0={0x%x,%d,%d,%d,%d,%d,%d,%d}\n",
-               override.io_port,
-               override.irq,
-               override.scsiid,
-               override.reconnect,
-               override.parity,
-               override.synchronous,
-               override.delay,
-               override.ext_trans);
-      } else
-        setup[setup_count++] = override;
-  }
+       if (setup_count < 2) {
+               struct aha152x_setup override = SETUP0;
+
+               if (setup_count == 0 || (override.io_port != setup[0].io_port))
+                       if (!aha152x_checksetup(&override)) {
+                               printk("\naha152x: invalid override SETUP0={0x%x,%d,%d,%d,%d,%d,%d,%d}\n",
+                                      override.io_port,
+                                      override.irq,
+                                      override.scsiid,
+                                      override.reconnect,
+                                      override.parity,
+                                      override.synchronous,
+                                      override.delay,
+                                      override.ext_trans);
+                       } else
+                               setup[setup_count++] = override;
+       }
 #endif
 
 #ifdef SETUP1
-  if(setup_count<2) {
-    struct aha152x_setup override = SETUP1;
-
-    if(setup_count==0 || (override.io_port != setup[0].io_port))
-      if(!aha152x_checksetup(&override)) {
-        printk("\naha152x: invalid override SETUP1={0x%x,%d,%d,%d,%d,%d,%d,%d}\n",
-               override.io_port,
-               override.irq,
-               override.scsiid,
-               override.reconnect,
-               override.parity,
-               override.synchronous,
-               override.delay,
-               override.ext_trans);
-      } else
-        setup[setup_count++] = override;
-  }
+       if (setup_count < 2) {
+               struct aha152x_setup override = SETUP1;
+
+               if (setup_count == 0 || (override.io_port != setup[0].io_port))
+                       if (!aha152x_checksetup(&override)) {
+                               printk("\naha152x: invalid override SETUP1={0x%x,%d,%d,%d,%d,%d,%d,%d}\n",
+                                      override.io_port,
+                                      override.irq,
+                                      override.scsiid,
+                                      override.reconnect,
+                                      override.parity,
+                                      override.synchronous,
+                                      override.delay,
+                                      override.ext_trans);
+                       } else
+                               setup[setup_count++] = override;
+       }
 #endif
 
 #if defined(MODULE)
-  if(setup_count<2 && aha152x[0]!=0) {
-    setup[setup_count].conf        = "";
-    setup[setup_count].io_port     = aha152x[0];
-    setup[setup_count].irq         = aha152x[1];
-    setup[setup_count].scsiid      = aha152x[2];
-    setup[setup_count].reconnect   = aha152x[3];
-    setup[setup_count].parity      = aha152x[4];
-    setup[setup_count].synchronous = aha152x[5];
-    setup[setup_count].delay       = aha152x[6];
-    setup[setup_count].ext_trans   = aha152x[7];
+       if (setup_count < 2 && aha152x[0] != 0) {
+               setup[setup_count].conf = "";
+               setup[setup_count].io_port = aha152x[0];
+               setup[setup_count].irq = aha152x[1];
+               setup[setup_count].scsiid = aha152x[2];
+               setup[setup_count].reconnect = aha152x[3];
+               setup[setup_count].parity = aha152x[4];
+               setup[setup_count].synchronous = aha152x[5];
+               setup[setup_count].delay = aha152x[6];
+               setup[setup_count].ext_trans = aha152x[7];
 #ifdef DEBUG_AHA152X
-    setup[setup_count].debug       = aha152x[8];
-#endif
-    if(aha152x_checksetup(&setup[setup_count]))
-      setup_count++;
-    else
-      printk("\naha152x: invalid module argument aha152x=0x%x,%d,%d,%d,%d,%d,%d,%d\n",
-             setup[setup_count].io_port,
-             setup[setup_count].irq,
-             setup[setup_count].scsiid,
-             setup[setup_count].reconnect,
-             setup[setup_count].parity,
-             setup[setup_count].synchronous,
-             setup[setup_count].delay,
-             setup[setup_count].ext_trans);
-  }
-
-  if(setup_count<2 && aha152x1[0]!=0) {
-    setup[setup_count].conf        = "";
-    setup[setup_count].io_port     = aha152x1[0];
-    setup[setup_count].irq         = aha152x1[1];
-    setup[setup_count].scsiid      = aha152x1[2];
-    setup[setup_count].reconnect   = aha152x1[3];
-    setup[setup_count].parity      = aha152x1[4];
-    setup[setup_count].synchronous = aha152x1[5];
-    setup[setup_count].delay       = aha152x1[6];
-    setup[setup_count].ext_trans   = aha152x1[7];
+               setup[setup_count].debug = aha152x[8];
+#endif
+               if (aha152x_checksetup(&setup[setup_count]))
+                       setup_count++;
+               else
+                       printk("\naha152x: invalid module argument aha152x=0x%x,%d,%d,%d,%d,%d,%d,%d\n",
+                              setup[setup_count].io_port,
+                              setup[setup_count].irq,
+                              setup[setup_count].scsiid,
+                              setup[setup_count].reconnect,
+                              setup[setup_count].parity,
+                              setup[setup_count].synchronous,
+                              setup[setup_count].delay,
+                              setup[setup_count].ext_trans);
+       }
+       if (setup_count < 2 && aha152x1[0] != 0) {
+               setup[setup_count].conf = "";
+               setup[setup_count].io_port = aha152x1[0];
+               setup[setup_count].irq = aha152x1[1];
+               setup[setup_count].scsiid = aha152x1[2];
+               setup[setup_count].reconnect = aha152x1[3];
+               setup[setup_count].parity = aha152x1[4];
+               setup[setup_count].synchronous = aha152x1[5];
+               setup[setup_count].delay = aha152x1[6];
+               setup[setup_count].ext_trans = aha152x1[7];
 #ifdef DEBUG_AHA152X
-    setup[setup_count].debug       = aha152x1[8];
-#endif
-    if(aha152x_checksetup(&setup[setup_count]))
-      setup_count++;
-    else
-      printk("\naha152x: invalid module argument aha152x1=0x%x,%d,%d,%d,%d,%d,%d,%d\n",
-             setup[setup_count].io_port,
-             setup[setup_count].irq,
-             setup[setup_count].scsiid,
-             setup[setup_count].reconnect,
-             setup[setup_count].parity,
-             setup[setup_count].synchronous,
-             setup[setup_count].delay,
-             setup[setup_count].ext_trans);
-  }
-#endif
-  
+               setup[setup_count].debug = aha152x1[8];
+#endif
+               if (aha152x_checksetup(&setup[setup_count]))
+                       setup_count++;
+               else
+                       printk("\naha152x: invalid module argument aha152x1=0x%x,%d,%d,%d,%d,%d,%d,%d\n",
+                              setup[setup_count].io_port,
+                              setup[setup_count].irq,
+                              setup[setup_count].scsiid,
+                              setup[setup_count].reconnect,
+                              setup[setup_count].parity,
+                              setup[setup_count].synchronous,
+                              setup[setup_count].delay,
+                              setup[setup_count].ext_trans);
+       }
+#endif
+
 #if defined(AUTOCONF)
-  if(setup_count<2) {
+       if (setup_count < 2) {
 #if !defined(SKIP_BIOSTEST)
-    ok=0;
-    for(i=0; i < ADDRESS_COUNT && !ok; i++)
-      for(j=0; (j < SIGNATURE_COUNT) && !ok; j++)
-       ok = check_signature(addresses[i]+signatures[j].sig_offset,
-               signatures[j].signature, signatures[j].sig_length);
+               ok = 0;
+               for (i = 0; i < ADDRESS_COUNT && !ok; i++)
+                       for (j = 0; (j < SIGNATURE_COUNT) && !ok; j++)
+                               ok = check_signature(addresses[i] + signatures[j].sig_offset,
+                                                    signatures[j].signature, signatures[j].sig_length);
 
-    if(!ok && setup_count==0)
-      return 0;
+               if (!ok && setup_count == 0)
+                       return 0;
 
-    printk("aha152x: BIOS test: passed, ");
+               printk("aha152x: BIOS test: passed, ");
 #else
-    printk("aha152x: ");
-#endif /* !SKIP_BIOSTEST */
-    ok=0;
-    for(i=0; i<PORT_COUNT && setup_count<2; i++) {
-      if((setup_count==1) && (setup[0].io_port == ports[i]))
-        continue;
-
-      if(aha152x_porttest(ports[i])) {
-        ok++;
-        setup[setup_count].io_port = ports[i];
-              
-        conf.cf_port =
-          (GETPORT(ports[i]+O_PORTA)<<8) + GETPORT(ports[i]+O_PORTB);
-              
-        setup[setup_count].irq         = IRQ_MIN + conf.cf_irq;
-        setup[setup_count].scsiid      = conf.cf_id;
-        setup[setup_count].reconnect   = conf.cf_tardisc;
-        setup[setup_count].parity      = !conf.cf_parity;
-        setup[setup_count].synchronous = 0 /* FIXME: conf.cf_syncneg */;
-        setup[setup_count].delay       = DELAY_DEFAULT;
-        setup[setup_count].ext_trans   = 0;
+               printk("aha152x: ");
+#endif                         /* !SKIP_BIOSTEST */
+
+               ok = 0;
+               for (i = 0; i < PORT_COUNT && setup_count < 2; i++) {
+                       if ((setup_count == 1) && (setup[0].io_port == ports[i]))
+                               continue;
+
+                       if (aha152x_porttest(ports[i])) {
+                               ok++;
+                               setup[setup_count].io_port = ports[i];
+
+                               conf.cf_port =
+                                   (GETPORT(ports[i] + O_PORTA) << 8) + GETPORT(ports[i] + O_PORTB);
+
+                               setup[setup_count].irq = IRQ_MIN + conf.cf_irq;
+                               setup[setup_count].scsiid = conf.cf_id;
+                               setup[setup_count].reconnect = conf.cf_tardisc;
+                               setup[setup_count].parity = !conf.cf_parity;
+                               setup[setup_count].synchronous = 0 /* FIXME: conf.cf_syncneg */ ;
+                               setup[setup_count].delay = DELAY_DEFAULT;
+                               setup[setup_count].ext_trans = 0;
 #ifdef DEBUG_AHA152X
-        setup[setup_count].debug       = DEBUG_DEFAULT;
+                               setup[setup_count].debug = DEBUG_DEFAULT;
 #endif
-        setup_count++;
-      }
-    }
+                               setup_count++;
+                       }
+               }
 
-    if(ok)
-      printk("auto configuration: ok, ");
-  }
+               if (ok)
+                       printk("auto configuration: ok, ");
+       }
 #endif
 
-  printk("detected %d controller(s)\n", setup_count);
+       printk("detected %d controller(s)\n", setup_count);
 
-  for(i=0; i<setup_count; i++) {
-    struct Scsi_Host        *shpnt;
-    unsigned long int       the_time;
+       for (i = 0; i < setup_count; i++) {
+               struct Scsi_Host *shpnt;
+               unsigned long int the_time;
 
-    shpnt = aha152x_host[setup[i].irq-IRQ_MIN] =
-      scsi_register(tpnt, sizeof(struct aha152x_hostdata));
-    registered_count++;
+               shpnt = aha152x_host[setup[i].irq - IRQ_MIN] =
+                   scsi_register(tpnt, sizeof(struct aha152x_hostdata));
+               registered_count++;
 
-    shpnt->io_port                     = setup[i].io_port;
-    shpnt->n_io_port                   = IO_RANGE;
-    shpnt->irq                         = setup[i].irq;
+               shpnt->io_port = setup[i].io_port;
+               shpnt->n_io_port = IO_RANGE;
+               shpnt->irq = setup[i].irq;
 
-    ISSUE_SC                           = (Scsi_Cmnd *) NULL;
-    CURRENT_SC                         = (Scsi_Cmnd *) NULL;
-    DISCONNECTED_SC                    = (Scsi_Cmnd *) NULL;
+               ISSUE_SC = (Scsi_Cmnd *) NULL;
+               CURRENT_SC = (Scsi_Cmnd *) NULL;
+               DISCONNECTED_SC = (Scsi_Cmnd *) NULL;
 
-    HOSTDATA(shpnt)->reconnect         = setup[i].reconnect;
-    HOSTDATA(shpnt)->parity            = setup[i].parity;
-    HOSTDATA(shpnt)->synchronous       = setup[i].synchronous;
-    HOSTDATA(shpnt)->delay             = setup[i].delay;
-    HOSTDATA(shpnt)->ext_trans         = setup[i].ext_trans;
+               HOSTDATA(shpnt)->reconnect = setup[i].reconnect;
+               HOSTDATA(shpnt)->parity = setup[i].parity;
+               HOSTDATA(shpnt)->synchronous = setup[i].synchronous;
+               HOSTDATA(shpnt)->delay = setup[i].delay;
+               HOSTDATA(shpnt)->ext_trans = setup[i].ext_trans;
 #ifdef DEBUG_AHA152X
-    HOSTDATA(shpnt)->debug             = setup[i].debug;
-#endif
-
-    HOSTDATA(shpnt)->aborting          = 0;
-    HOSTDATA(shpnt)->abortion_complete = 0;
-    HOSTDATA(shpnt)->abort_result      = 0;
-    HOSTDATA(shpnt)->commands          = 0;
-
-    HOSTDATA(shpnt)->message_len       = 0;
-
-    for(j=0; j<8; j++)
-      HOSTDATA(shpnt)->syncrate[j] = 0;
-    SETPORT(SCSIID, setup[i].scsiid << 4);
-    shpnt->this_id=setup[i].scsiid;
-  
-    if(setup[i].reconnect)
-      shpnt->can_queue=AHA152X_MAXQUEUE;
-
-    /* RESET OUT */
-    SETBITS(SCSISEQ, SCSIRSTO);
-    do_pause(30);
-    CLRBITS(SCSISEQ, SCSIRSTO);
-    do_pause(setup[i].delay);
-
-    aha152x_reset_ports(shpnt);
-      
-    printk("aha152x%d: vital data: PORTBASE=0x%03lx, IRQ=%d, SCSI ID=%d,"
-           " reconnect=%s, parity=%s, synchronous=%s, delay=%d, extended translation=%s\n",
-           i,
-           shpnt->io_port,
-           shpnt->irq,
-           shpnt->this_id,
-           HOSTDATA(shpnt)->reconnect ? "enabled" : "disabled",
-           HOSTDATA(shpnt)->parity ? "enabled" : "disabled",
-           HOSTDATA(shpnt)->synchronous ? "enabled" : "disabled",
-           HOSTDATA(shpnt)->delay,
-           HOSTDATA(shpnt)->ext_trans ? "enabled" : "disabled");
-
-    request_region(shpnt->io_port, IO_RANGE, "aha152x");  /* Register */
-  
-    /* not expecting any interrupts */
-    SETPORT(SIMODE0, 0);
-    SETPORT(SIMODE1, 0);
-
-    SETBITS(DMACNTRL0, INTEN);
-
-    ok = request_irq(shpnt->irq, aha152x_swintr, SA_INTERRUPT, "aha152x", shpnt);
-    if(ok<0) {
-      if(ok == -EINVAL)
-        printk("aha152x%d: bad IRQ %d.\n", i, shpnt->irq);
-      else if(ok == -EBUSY)
-        printk("aha152x%d: IRQ %d already in use.\n", i, shpnt->irq);
-      else
-        printk("\naha152x%d: Unexpected error code %d on requesting IRQ %d.\n",                 i, ok, shpnt->irq);
-      printk("aha152x: driver needs an IRQ.\n");
-
-      scsi_unregister(shpnt);
-      registered_count--;
-      release_region(shpnt->io_port, IO_RANGE);
-      shpnt=aha152x_host[shpnt->irq-IRQ_MIN]=0;
-      continue;
-    }
-
-    HOSTDATA(shpnt)->swint=0;
-
-    printk("aha152x: trying software interrupt, ");
-    SETBITS(DMACNTRL0, SWINT);
-
-    the_time=jiffies+100;
-    while(!HOSTDATA(shpnt)->swint && time_before(jiffies, the_time))
-      barrier();
-
-    free_irq(shpnt->irq,shpnt);
-
-    if(!HOSTDATA(shpnt)->swint) {
-      if(TESTHI(DMASTAT, INTSTAT)) {
-        printk("lost.\n");
-      } else {
-        printk("failed.\n");
-      }
-
-      printk("aha152x: IRQ %d possibly wrong.  Please verify.\n", shpnt->irq);
-
-      scsi_unregister(shpnt);
-      registered_count--;
-      release_region(shpnt->io_port, IO_RANGE);
-      shpnt=aha152x_host[shpnt->irq-IRQ_MIN]=0;
-      continue;
-    }
-
-    printk("ok.\n");
-
-    CLRBITS(DMACNTRL0, SWINT);
-
-    /* clear interrupts */
-    SETPORT(SSTAT0, 0x7f);
-    SETPORT(SSTAT1, 0xef);
-
-    if(request_irq(shpnt->irq,aha152x_intr,SA_INTERRUPT,"aha152x",shpnt)<0) {
-      printk("aha152x: failed to reassign interrupt.\n");
-    }
-  }
-  
-  return (registered_count>0);
+               HOSTDATA(shpnt)->debug = setup[i].debug;
+#endif
+
+               HOSTDATA(shpnt)->aborting = 0;
+               HOSTDATA(shpnt)->abortion_complete = 0;
+               HOSTDATA(shpnt)->abort_result = 0;
+               HOSTDATA(shpnt)->commands = 0;
+
+               HOSTDATA(shpnt)->message_len = 0;
+
+               for (j = 0; j < 8; j++)
+                       HOSTDATA(shpnt)->syncrate[j] = 0;
+
+               SETPORT(SCSIID, setup[i].scsiid << 4);
+               shpnt->this_id = setup[i].scsiid;
+
+               if (setup[i].reconnect)
+                       shpnt->can_queue = AHA152X_MAXQUEUE;
+
+               /* RESET OUT */
+               SETBITS(SCSISEQ, SCSIRSTO);
+               do_pause(30);
+               CLRBITS(SCSISEQ, SCSIRSTO);
+               do_pause(setup[i].delay);
+
+               aha152x_reset_ports(shpnt);
+
+               printk("aha152x%d: vital data: PORTBASE=0x%03lx, IRQ=%d, SCSI ID=%d,"
+                      " reconnect=%s, parity=%s, synchronous=%s, delay=%d, extended translation=%s\n",
+                      i,
+                      shpnt->io_port,
+                      shpnt->irq,
+                      shpnt->this_id,
+                    HOSTDATA(shpnt)->reconnect ? "enabled" : "disabled",
+                      HOSTDATA(shpnt)->parity ? "enabled" : "disabled",
+                  HOSTDATA(shpnt)->synchronous ? "enabled" : "disabled",
+                      HOSTDATA(shpnt)->delay,
+                   HOSTDATA(shpnt)->ext_trans ? "enabled" : "disabled");
+
+               request_region(shpnt->io_port, IO_RANGE, "aha152x");    /* Register */
+
+               /* not expecting any interrupts */
+               SETPORT(SIMODE0, 0);
+               SETPORT(SIMODE1, 0);
+
+               SETBITS(DMACNTRL0, INTEN);
+
+               ok = request_irq(shpnt->irq, aha152x_swintr, SA_INTERRUPT, "aha152x", shpnt);
+               if (ok < 0) {
+                       if (ok == -EINVAL)
+                               printk("aha152x%d: bad IRQ %d.\n", i, shpnt->irq);
+                       else if (ok == -EBUSY)
+                               printk("aha152x%d: IRQ %d already in use.\n", i, shpnt->irq);
+                       else
+                               printk("\naha152x%d: Unexpected error code %d on requesting IRQ %d.\n", i, ok, shpnt->irq);
+                       printk("aha152x: driver needs an IRQ.\n");
+
+                       scsi_unregister(shpnt);
+                       registered_count--;
+                       release_region(shpnt->io_port, IO_RANGE);
+                       shpnt = aha152x_host[shpnt->irq - IRQ_MIN] = 0;
+                       continue;
+               }
+               HOSTDATA(shpnt)->swint = 0;
+
+               printk("aha152x: trying software interrupt, ");
+               SETBITS(DMACNTRL0, SWINT);
+
+               the_time = jiffies + 100;
+               while (!HOSTDATA(shpnt)->swint && time_before(jiffies, the_time))
+                       barrier();
+
+               free_irq(shpnt->irq, shpnt);
+
+               if (!HOSTDATA(shpnt)->swint) {
+                       if (TESTHI(DMASTAT, INTSTAT)) {
+                               printk("lost.\n");
+                       } else {
+                               printk("failed.\n");
+                       }
+
+                       printk("aha152x: IRQ %d possibly wrong.  Please verify.\n", shpnt->irq);
+
+                       scsi_unregister(shpnt);
+                       registered_count--;
+                       release_region(shpnt->io_port, IO_RANGE);
+                       shpnt = aha152x_host[shpnt->irq - IRQ_MIN] = 0;
+                       continue;
+               }
+               printk("ok.\n");
+
+               CLRBITS(DMACNTRL0, SWINT);
+
+               /* clear interrupts */
+               SETPORT(SSTAT0, 0x7f);
+               SETPORT(SSTAT1, 0xef);
+
+               if (request_irq(shpnt->irq, aha152x_intr, SA_INTERRUPT, "aha152x", shpnt) < 0) {
+                       printk("aha152x: failed to reassign interrupt.\n");
+               }
+       }
+
+       return (registered_count > 0);
 }
 
 
 int aha152x_release(struct Scsi_Host *shpnt)
 {
-  if (shpnt->irq)
-    free_irq(shpnt->irq, shpnt);
-  if (shpnt->io_port)
-    release_region(shpnt->io_port, IO_RANGE);
+       if (shpnt->irq)
+               free_irq(shpnt->irq, shpnt);
+       if (shpnt->io_port)
+               release_region(shpnt->io_port, IO_RANGE);
 
-  return 0;
+       return 0;
 }
 
 /* 
  *  Queue a command and setup interrupts for a free bus.
  */
-int aha152x_queue(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))
+int aha152x_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
 {
-  struct Scsi_Host *shpnt = SCpnt->host;
-  unsigned long flags;
+       struct Scsi_Host *shpnt = SCpnt->host;
+       unsigned long flags;
 
 #if defined(DEBUG_RACE)
-  enter_driver("queue");
+       enter_driver("queue");
 #else
 #if defined(DEBUG_QUEUE)
-  if(HOSTDATA(shpnt)->debug & debug_queue)
-    printk("aha152x: queue(), ");
+       if (HOSTDATA(shpnt)->debug & debug_queue)
+               printk("aha152x: queue(), ");
 #endif
 #endif
 
 #if defined(DEBUG_QUEUE)
-  if(HOSTDATA(shpnt)->debug & debug_queue) {
-    printk("SCpnt (target = %d lun = %d cmnd = ",
-           SCpnt->target, SCpnt->lun);
-    print_command(SCpnt->cmnd);
-    printk(", cmd_len=%d, pieces = %d size = %u), ",
-           SCpnt->cmd_len, SCpnt->use_sg, SCpnt->request_bufflen);
-    disp_ports(shpnt);
-  }
-#endif
-
-  SCpnt->scsi_done =       done;
-
-  /* setup scratch area
-     SCp.ptr              : buffer pointer
-     SCp.this_residual    : buffer length
-     SCp.buffer           : next buffer
-     SCp.buffers_residual : left buffers in list
-     SCp.phase            : current state of the command */
-  SCpnt->SCp.phase = not_issued;
-  if (SCpnt->use_sg) {
-    SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer;
-    SCpnt->SCp.ptr              = SCpnt->SCp.buffer->address;
-    SCpnt->SCp.this_residual    = SCpnt->SCp.buffer->length;
-    SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;
-  } else {
-    SCpnt->SCp.ptr              = (char *)SCpnt->request_buffer;
-    SCpnt->SCp.this_residual    = SCpnt->request_bufflen;
-    SCpnt->SCp.buffer           = NULL;
-    SCpnt->SCp.buffers_residual = 0;
-  }
-          
-  SCpnt->SCp.Status              = CHECK_CONDITION;
-  SCpnt->SCp.Message             = 0;
-  SCpnt->SCp.have_data_in        = 0;
-  SCpnt->SCp.sent_command        = 0;
-
-  /* Turn led on, when this is the first command. */
-  save_flags(flags);
-  cli();
-  HOSTDATA(shpnt)->commands++;
-  if(HOSTDATA(shpnt)->commands==1)
-    SETPORT(PORTA, 1);
+       if (HOSTDATA(shpnt)->debug & debug_queue) {
+               printk("SCpnt (target = %d lun = %d cmnd = ",
+                      SCpnt->target, SCpnt->lun);
+               print_command(SCpnt->cmnd);
+               printk(", cmd_len=%d, pieces = %d size = %u), ",
+                 SCpnt->cmd_len, SCpnt->use_sg, SCpnt->request_bufflen);
+               disp_ports(shpnt);
+       }
+#endif
+
+       SCpnt->scsi_done = done;
+
+       /* setup scratch area
+          SCp.ptr              : buffer pointer
+          SCp.this_residual    : buffer length
+          SCp.buffer           : next buffer
+          SCp.buffers_residual : left buffers in list
+          SCp.phase            : current state of the command */
+       SCpnt->SCp.phase = not_issued;
+       if (SCpnt->use_sg) {
+               SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer;
+               SCpnt->SCp.ptr = SCpnt->SCp.buffer->address;
+               SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
+               SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;
+       } else {
+               SCpnt->SCp.ptr = (char *) SCpnt->request_buffer;
+               SCpnt->SCp.this_residual = SCpnt->request_bufflen;
+               SCpnt->SCp.buffer = NULL;
+               SCpnt->SCp.buffers_residual = 0;
+       }
+
+       SCpnt->SCp.Status = CHECK_CONDITION;
+       SCpnt->SCp.Message = 0;
+       SCpnt->SCp.have_data_in = 0;
+       SCpnt->SCp.sent_command = 0;
+
+       /* Turn led on, when this is the first command. */
+       save_flags(flags);
+       cli();
+       HOSTDATA(shpnt)->commands++;
+       if (HOSTDATA(shpnt)->commands == 1)
+               SETPORT(PORTA, 1);
 
 #if defined(DEBUG_QUEUES)
-  if(HOSTDATA(shpnt)->debug & debug_queues)
-    printk("i+ (%d), ", HOSTDATA(shpnt)->commands);
-#endif
-  append_SC(&ISSUE_SC, SCpnt);
-  
-  /* Enable bus free interrupt, when we aren't currently on the bus */
-  if(!CURRENT_SC) {
-    SETPORT(SIMODE0, DISCONNECTED_SC ? ENSELDI : 0);
-    SETPORT(SIMODE1, ISSUE_SC ? ENBUSFREE : 0);
-  }
-  restore_flags(flags);
+       if (HOSTDATA(shpnt)->debug & debug_queues)
+               printk("i+ (%d), ", HOSTDATA(shpnt)->commands);
+#endif
+       append_SC(&ISSUE_SC, SCpnt);
+
+       /* Enable bus free interrupt, when we aren't currently on the bus */
+       if (!CURRENT_SC) {
+               SETPORT(SIMODE0, DISCONNECTED_SC ? ENSELDI : 0);
+               SETPORT(SIMODE1, ISSUE_SC ? ENBUSFREE : 0);
+       }
+       restore_flags(flags);
 
 #if defined(DEBUG_RACE)
-  leave_driver("queue");
+       leave_driver("queue");
 #endif
 
-  return 0;
+       return 0;
 }
 
 /*
  *  We only support commands in interrupt-driven fashion
  */
-int aha152x_command(Scsi_Cmnd *SCpnt)
+int aha152x_command(Scsi_Cmnd * SCpnt)
 {
-  printk("aha152x: interrupt driven driver; use aha152x_queue()\n");
-  return -1;
+       printk("aha152x: interrupt driven driver; use aha152x_queue()\n");
+       return -1;
 }
 
 /*
  *  Abort a queued command
  *  (commands that are on the bus can't be aborted easily)
  */
-int aha152x_abort(Scsi_Cmnd *SCpnt)
+int aha152x_abort(Scsi_Cmnd * SCpnt)
 {
-  struct Scsi_Host *shpnt = SCpnt->host;
-  unsigned long flags;
-  Scsi_Cmnd *ptr, *prev;
+       struct Scsi_Host *shpnt = SCpnt->host;
+       unsigned long flags;
+       Scsi_Cmnd *ptr, *prev;
 
-  save_flags(flags);
-  cli();
+       save_flags(flags);
+       cli();
 
 #if defined(DEBUG_ABORT)
-  if(HOSTDATA(shpnt)->debug & debug_abort) { 
-    printk("aha152x: abort(), SCpnt=0x%08x, ", (unsigned int) SCpnt);
-    show_queues(shpnt);
-  }
-#endif
-
-  /* look for command in issue queue */
-  for(ptr=ISSUE_SC, prev=NULL;
-       ptr && ptr!=SCpnt;
-       prev=ptr, ptr=(Scsi_Cmnd *) ptr->host_scribble)
-    ;
-
-  if(ptr) {
-    /* dequeue */
-    if(prev)
-      prev->host_scribble = ptr->host_scribble;
-    else
-      ISSUE_SC = (Scsi_Cmnd *) ptr->host_scribble;
-
-    HOSTDATA(shpnt)->commands--; 
-
-    restore_flags(flags);
-
-    ptr->host_scribble = NULL;
-    ptr->result = DID_ABORT << 16;
-    ptr->scsi_done(ptr);
-
-    return SCSI_ABORT_SUCCESS;
-  }
-
-  /* if the bus is busy or a command is currently processed,
-     we can't do anything more */
-  if (TESTLO(SSTAT1, BUSFREE) || (CURRENT_SC && CURRENT_SC!=SCpnt)) {
-    /* fail abortion, if bus is busy */
-
-    if(!CURRENT_SC)
-      printk("bus busy w/o current command, ");
-    restore_flags(flags);
-
-    return SCSI_ABORT_BUSY;
-  }
-
-  /* bus is free */
-
-  if(CURRENT_SC) { 
-    HOSTDATA(shpnt)->commands--; 
-
-    /* target entered bus free before COMMAND COMPLETE, nothing to abort */
-    restore_flags(flags);
-    CURRENT_SC->result = DID_ERROR << 16;
-    CURRENT_SC->scsi_done(CURRENT_SC);
-    CURRENT_SC = (Scsi_Cmnd *) NULL;
-
-    return SCSI_ABORT_SUCCESS;
-  }
-
-  /* look for command in disconnected queue */
-  for(ptr=DISCONNECTED_SC, prev=NULL;
-       ptr && ptr!=SCpnt;
-       prev=ptr, ptr=(Scsi_Cmnd *) ptr->host_scribble)
-    ;
-
-  if(!ptr) {
-    /* command wasn't found */
-    printk("command not found\n");
-    restore_flags(flags);
-
-    return SCSI_ABORT_NOT_RUNNING;
-  }
-
-  if(!HOSTDATA(shpnt)->aborting) {
-    /* dequeue */
-    if(prev)
-      prev->host_scribble = ptr->host_scribble;
-    else
-      DISCONNECTED_SC = (Scsi_Cmnd *) ptr->host_scribble;
-
-    HOSTDATA(shpnt)->commands--; 
-
-    /* set command current and initiate selection,
-       let the interrupt routine take care of the abortion */
-    CURRENT_SC     = ptr;
-    ptr->SCp.phase = in_selection|aborted;
-    SETPORT(SCSIID, (shpnt->this_id << OID_) | CURRENT_SC->target);
-      
-    ADDMSG(ABORT);
-
-    /* enable interrupts for SELECTION OUT DONE and SELECTION TIME OUT */
-    SETPORT(SIMODE0, ENSELDO | (DISCONNECTED_SC ? ENSELDI : 0));
-    SETPORT(SIMODE1, ENSELTIMO);
-
-    /* Enable SELECTION OUT sequence */
-    SETBITS(SCSISEQ, ENSELO | ENAUTOATNO);
-
-    SETBITS(DMACNTRL0, INTEN);
-    HOSTDATA(shpnt)->abort_result=SCSI_ABORT_SUCCESS;
-    HOSTDATA(shpnt)->aborting++;
-    HOSTDATA(shpnt)->abortion_complete=0;
-
-    restore_flags(flags);
-
-    /* sleep until the abortion is complete */
-    while(!HOSTDATA(shpnt)->abortion_complete)
-      barrier();
-    HOSTDATA(shpnt)->aborting=0;
-
-    return HOSTDATA(shpnt)->abort_result;
-  } else {
-    /* we're already aborting a command */
-    restore_flags(flags);
+       if (HOSTDATA(shpnt)->debug & debug_abort) {
+               printk("aha152x: abort(), SCpnt=0x%08x, ", (unsigned int) SCpnt);
+               show_queues(shpnt);
+       }
+#endif
+
+       /* look for command in issue queue */
+       for (ptr = ISSUE_SC, prev = NULL;
+            ptr && ptr != SCpnt;
+            prev = ptr, ptr = (Scsi_Cmnd *) ptr->host_scribble);
+
+       if (ptr) {
+               /* dequeue */
+               if (prev)
+                       prev->host_scribble = ptr->host_scribble;
+               else
+                       ISSUE_SC = (Scsi_Cmnd *) ptr->host_scribble;
+
+               HOSTDATA(shpnt)->commands--;
+
+               restore_flags(flags);
+
+               ptr->host_scribble = NULL;
+               ptr->result = DID_ABORT << 16;
+               spin_lock_irqsave(&io_request_lock, flags);
+               ptr->scsi_done(ptr);
+               spin_unlock_irqrestore(&io_request_lock, flags);
+
+               return SCSI_ABORT_SUCCESS;
+       }
+       /* if the bus is busy or a command is currently processed,
+          we can't do anything more */
+       if (TESTLO(SSTAT1, BUSFREE) || (CURRENT_SC && CURRENT_SC != SCpnt)) {
+               /* fail abortion, if bus is busy */
+
+               if (!CURRENT_SC)
+                       printk("bus busy w/o current command, ");
 
-    return SCSI_ABORT_BUSY;
-  }
+               restore_flags(flags);
+
+               return SCSI_ABORT_BUSY;
+       }
+       /* bus is free */
+
+       if (CURRENT_SC) {
+               HOSTDATA(shpnt)->commands--;
+
+               /* target entered bus free before COMMAND COMPLETE, nothing to abort */
+               restore_flags(flags);
+               spin_lock_irqsave(&io_request_lock, flags);
+               CURRENT_SC->result = DID_ERROR << 16;
+               CURRENT_SC->scsi_done(CURRENT_SC);
+               CURRENT_SC = (Scsi_Cmnd *) NULL;
+               spin_unlock_irqrestore(&io_request_lock, flags);
+
+               return SCSI_ABORT_SUCCESS;
+       }
+       /* look for command in disconnected queue */
+       for (ptr = DISCONNECTED_SC, prev = NULL;
+            ptr && ptr != SCpnt;
+            prev = ptr, ptr = (Scsi_Cmnd *) ptr->host_scribble);
+
+       if (!ptr) {
+               /* command wasn't found */
+               printk("command not found\n");
+               restore_flags(flags);
+
+               return SCSI_ABORT_NOT_RUNNING;
+       }
+       if (!HOSTDATA(shpnt)->aborting) {
+               /* dequeue */
+               if (prev)
+                       prev->host_scribble = ptr->host_scribble;
+               else
+                       DISCONNECTED_SC = (Scsi_Cmnd *) ptr->host_scribble;
+
+               HOSTDATA(shpnt)->commands--;
+
+               /* set command current and initiate selection,
+                  let the interrupt routine take care of the abortion */
+               CURRENT_SC = ptr;
+               ptr->SCp.phase = in_selection | aborted;
+               SETPORT(SCSIID, (shpnt->this_id << OID_) | CURRENT_SC->target);
+
+               ADDMSG(ABORT);
+
+               /* enable interrupts for SELECTION OUT DONE and SELECTION TIME OUT */
+               SETPORT(SIMODE0, ENSELDO | (DISCONNECTED_SC ? ENSELDI : 0));
+               SETPORT(SIMODE1, ENSELTIMO);
+
+               /* Enable SELECTION OUT sequence */
+               SETBITS(SCSISEQ, ENSELO | ENAUTOATNO);
+
+               SETBITS(DMACNTRL0, INTEN);
+               HOSTDATA(shpnt)->abort_result = SCSI_ABORT_SUCCESS;
+               HOSTDATA(shpnt)->aborting++;
+               HOSTDATA(shpnt)->abortion_complete = 0;
+
+               restore_flags(flags);
+
+               /* sleep until the abortion is complete */
+               while (!HOSTDATA(shpnt)->abortion_complete)
+                       barrier();
+               HOSTDATA(shpnt)->aborting = 0;
+
+               return HOSTDATA(shpnt)->abort_result;
+       } else {
+               /* we're already aborting a command */
+               restore_flags(flags);
+
+               return SCSI_ABORT_BUSY;
+       }
 }
 
 /*
@@ -1319,110 +1338,113 @@ int aha152x_abort(Scsi_Cmnd *SCpnt)
  */
 static void aha152x_reset_ports(struct Scsi_Host *shpnt)
 {
-  /* disable interrupts */
-  SETPORT(DMACNTRL0, RSTFIFO);
+       /* disable interrupts */
+       SETPORT(DMACNTRL0, RSTFIFO);
 
-  SETPORT(SCSISEQ, 0);
+       SETPORT(SCSISEQ, 0);
 
-  SETPORT(SXFRCTL1, 0);
-  SETPORT(SCSISIG, 0);
-  SETPORT(SCSIRATE, 0);
+       SETPORT(SXFRCTL1, 0);
+       SETPORT(SCSISIG, 0);
+       SETPORT(SCSIRATE, 0);
 
-  /* clear all interrupt conditions */
-  SETPORT(SSTAT0, 0x7f);
-  SETPORT(SSTAT1, 0xef);
+       /* clear all interrupt conditions */
+       SETPORT(SSTAT0, 0x7f);
+       SETPORT(SSTAT1, 0xef);
 
-  SETPORT(SSTAT4, SYNCERR|FWERR|FRERR);
+       SETPORT(SSTAT4, SYNCERR | FWERR | FRERR);
 
-  SETPORT(DMACNTRL0, 0);
-  SETPORT(DMACNTRL1, 0);
+       SETPORT(DMACNTRL0, 0);
+       SETPORT(DMACNTRL1, 0);
 
-  SETPORT(BRSTCNTRL, 0xf1);
+       SETPORT(BRSTCNTRL, 0xf1);
 
-  /* clear SCSI fifo and transfer count */
-  SETPORT(SXFRCTL0, CH1|CLRCH1|CLRSTCNT);
-  SETPORT(SXFRCTL0, CH1);
+       /* clear SCSI fifo and transfer count */
+       SETPORT(SXFRCTL0, CH1 | CLRCH1 | CLRSTCNT);
+       SETPORT(SXFRCTL0, CH1);
 
-  /* enable interrupts */
-  SETPORT(SIMODE0, DISCONNECTED_SC ? ENSELDI : 0);
-  SETPORT(SIMODE1, ISSUE_SC ? ENBUSFREE : 0);
+       /* enable interrupts */
+       SETPORT(SIMODE0, DISCONNECTED_SC ? ENSELDI : 0);
+       SETPORT(SIMODE1, ISSUE_SC ? ENBUSFREE : 0);
 }
 
 /*
  *  Reset registers, reset a hanging bus and
  *  kill active and disconnected commands for target w/o soft reset
  */
-int aha152x_reset(Scsi_Cmnd *SCpnt, unsigned int unused)
+int aha152x_reset(Scsi_Cmnd * SCpnt, unsigned int unused)
 {
-  struct Scsi_Host *shpnt = SCpnt->host;
-  unsigned long flags;
-  Scsi_Cmnd *ptr, *prev, *next;
+       struct Scsi_Host *shpnt = SCpnt->host;
+       unsigned long flags;
+       Scsi_Cmnd *ptr, *prev, *next;
 
-  aha152x_reset_ports(shpnt);
+       aha152x_reset_ports(shpnt);
 
-  /* Reset, if bus hangs */
-  if(TESTLO(SSTAT1, BUSFREE)) {
-    CLRBITS(DMACNTRL0, INTEN);
+       /* Reset, if bus hangs */
+       if (TESTLO(SSTAT1, BUSFREE)) {
+               CLRBITS(DMACNTRL0, INTEN);
 
 #if defined(DEBUG_RESET)
-    if(HOSTDATA(shpnt)->debug & debug_reset) {
-      printk("aha152x: reset(), bus not free: SCSI RESET OUT\n");
-      show_queues(shpnt);
-    }
-#endif
-
-    ptr=CURRENT_SC;
-    if(ptr && !ptr->device->soft_reset) {
-      ptr->host_scribble = NULL;
-      ptr->result = DID_RESET << 16;
-      ptr->scsi_done(CURRENT_SC);
-      CURRENT_SC=NULL;
-    }
-
-    save_flags(flags);
-    cli();
-    prev=NULL; ptr=DISCONNECTED_SC;
-    while(ptr) {
-      if(!ptr->device->soft_reset) {
-        if(prev)
-          prev->host_scribble = ptr->host_scribble;
-        else
-          DISCONNECTED_SC = (Scsi_Cmnd *) ptr->host_scribble;
-
-        next = (Scsi_Cmnd *) ptr->host_scribble;
-
-        ptr->host_scribble = NULL;
-        ptr->result        = DID_RESET << 16;
-        ptr->scsi_done(ptr);
-  
-        ptr = next; 
-      } else {
-        prev=ptr;
-        ptr = (Scsi_Cmnd *) ptr->host_scribble;
-      }
-    }
-    restore_flags(flags);
+               if (HOSTDATA(shpnt)->debug & debug_reset) {
+                       printk("aha152x: reset(), bus not free: SCSI RESET OUT\n");
+                       show_queues(shpnt);
+               }
+#endif
+
+               ptr = CURRENT_SC;
+               if (ptr && !ptr->device->soft_reset) {
+                       ptr->host_scribble = NULL;
+                       ptr->result = DID_RESET << 16;
+                       spin_lock_irqsave(&io_request_lock, flags);
+                       ptr->scsi_done(CURRENT_SC);
+                       spin_unlock_irqrestore(&io_request_lock, flags);
+                       CURRENT_SC = NULL;
+               }
+               save_flags(flags);
+               cli();
+               prev = NULL;
+               ptr = DISCONNECTED_SC;
+               while (ptr) {
+                       if (!ptr->device->soft_reset) {
+                               if (prev)
+                                       prev->host_scribble = ptr->host_scribble;
+                               else
+                                       DISCONNECTED_SC = (Scsi_Cmnd *) ptr->host_scribble;
+
+                               next = (Scsi_Cmnd *) ptr->host_scribble;
+
+                               ptr->host_scribble = NULL;
+                               ptr->result = DID_RESET << 16;
+                               spin_lock_irqsave(&io_request_lock, flags);
+                               ptr->scsi_done(ptr);
+                               spin_unlock_irqrestore(&io_request_lock, flags);
+
+                               ptr = next;
+                       } else {
+                               prev = ptr;
+                               ptr = (Scsi_Cmnd *) ptr->host_scribble;
+                       }
+               }
+               restore_flags(flags);
 
 #if defined(DEBUG_RESET)
-    if(HOSTDATA(shpnt)->debug & debug_reset) {
-      printk("commands on targets w/ soft-resets:\n");
-      show_queues(shpnt);
-    }
+               if (HOSTDATA(shpnt)->debug & debug_reset) {
+                       printk("commands on targets w/ soft-resets:\n");
+                       show_queues(shpnt);
+               }
 #endif
 
-    /* RESET OUT */
-    SETPORT(SCSISEQ, SCSIRSTO);
-    do_pause(30);
-    SETPORT(SCSISEQ, 0);
-    do_pause(DELAY);
-
-    SETPORT(SIMODE0, DISCONNECTED_SC ? ENSELDI : 0);
-    SETPORT(SIMODE1, ISSUE_SC ? ENBUSFREE : 0);
+               /* RESET OUT */
+               SETPORT(SCSISEQ, SCSIRSTO);
+               do_pause(30);
+               SETPORT(SCSISEQ, 0);
+               do_pause(DELAY);
 
-    SETPORT(DMACNTRL0, INTEN);
-  }
+               SETPORT(SIMODE0, DISCONNECTED_SC ? ENSELDI : 0);
+               SETPORT(SIMODE1, ISSUE_SC ? ENBUSFREE : 0);
 
-  return SCSI_RESET_SUCCESS;
+               SETPORT(DMACNTRL0, INTEN);
+       }
+       return SCSI_RESET_SUCCESS;
 }
 
 /*
@@ -1430,59 +1452,58 @@ int aha152x_reset(Scsi_Cmnd *SCpnt, unsigned int unused)
  */
 int aha152x_biosparam(Scsi_Disk * disk, kdev_t dev, int *info_array)
 {
-  struct Scsi_Host *shpnt=disk->device->host;
+       struct Scsi_Host *shpnt = disk->device->host;
 
 #if defined(DEBUG_BIOSPARAM)
-  if(HOSTDATA(shpnt)->debug & debug_biosparam)
-    printk("aha152x_biosparam: dev=%s, size=%d, ",
-           kdevname(dev), disk->capacity);
-#endif
-  /* try default translation */
-  info_array[0]=64;
-  info_array[1]=32;
-  info_array[2]=disk->capacity / (64 * 32);
-
-  /* for disks >1GB do some guessing */
-  if(info_array[2]>=1024) {
-    int info[3];
-
-    /* try to figure out the geometry from the partition table */
-    if(scsicam_bios_param(disk, dev, info)<0 ||
-       !((info[0]==64 && info[1]==32) || (info[0]==255 && info[1]==63))) {
-      if(EXT_TRANS) {
-        printk("aha152x: unable to verify geometry for disk with >1GB.\n"
-               "         using extended translation.\n");
-        info_array[0] = 255;
-        info_array[1] = 63;
-        info_array[2] = disk->capacity / (255 * 63);
-      } else {
-        printk("aha152x: unable to verify geometry for disk with >1GB.\n"
-               "         Using default translation. Please verify yourself.\n"
-               "         Perhaps you need to enable extended translation in the driver.\n"
-               "         See /usr/src/linux/drivers/scsi/aha152x.c for details.\n");
-      }
-    } else {
-      info_array[0]=info[0];
-      info_array[1]=info[1];
-      info_array[2]=info[2];
-      
-      if(info[0]==255 && !EXT_TRANS) {
-        printk("aha152x: current partition table is using extended translation.\n"
-               "         using it also, although it's not explicty enabled.\n");
-      }
-    }
-  }
-
+       if (HOSTDATA(shpnt)->debug & debug_biosparam)
+               printk("aha152x_biosparam: dev=%s, size=%d, ",
+                      kdevname(dev), disk->capacity);
+#endif
+
+       /* try default translation */
+       info_array[0] = 64;
+       info_array[1] = 32;
+       info_array[2] = disk->capacity / (64 * 32);
+
+       /* for disks >1GB do some guessing */
+       if (info_array[2] >= 1024) {
+               int info[3];
+
+               /* try to figure out the geometry from the partition table */
+               if (scsicam_bios_param(disk, dev, info) < 0 ||
+                   !((info[0] == 64 && info[1] == 32) || (info[0] == 255 && info[1] == 63))) {
+                       if (EXT_TRANS) {
+                               printk("aha152x: unable to verify geometry for disk with >1GB.\n"
+                               "         using extended translation.\n");
+                               info_array[0] = 255;
+                               info_array[1] = 63;
+                               info_array[2] = disk->capacity / (255 * 63);
+                       } else {
+                               printk("aha152x: unable to verify geometry for disk with >1GB.\n"
+                                      "         Using default translation. Please verify yourself.\n"
+                                      "         Perhaps you need to enable extended translation in the driver.\n"
+                                      "         See /usr/src/linux/drivers/scsi/aha152x.c for details.\n");
+                       }
+               } else {
+                       info_array[0] = info[0];
+                       info_array[1] = info[1];
+                       info_array[2] = info[2];
+
+                       if (info[0] == 255 && !EXT_TRANS) {
+                               printk("aha152x: current partition table is using extended translation.\n"
+                                      "         using it also, although it's not explicty enabled.\n");
+                       }
+               }
+       }
 #if defined(DEBUG_BIOSPARAM)
-  if(HOSTDATA(shpnt)->debug & debug_biosparam) {
-    printk("bios geometry: head=%d, sec=%d, cyl=%d\n",
-           info_array[0], info_array[1], info_array[2]);
-    printk("WARNING: check, if the bios geometry is correct.\n");
-  }
+       if (HOSTDATA(shpnt)->debug & debug_biosparam) {
+               printk("bios geometry: head=%d, sec=%d, cyl=%d\n",
+                      info_array[0], info_array[1], info_array[2]);
+               printk("WARNING: check, if the bios geometry is correct.\n");
+       }
 #endif
 
-  return 0;
+       return 0;
 }
 
 /*
@@ -1490,71 +1511,73 @@ int aha152x_biosparam(Scsi_Disk * disk, kdev_t dev, int *info_array)
  */
 void aha152x_done(struct Scsi_Host *shpnt, int error)
 {
-  unsigned long flags;
-  Scsi_Cmnd *done_SC;
+       unsigned long flags;
+       Scsi_Cmnd *done_SC;
 
 #if defined(DEBUG_DONE)
-  if(HOSTDATA(shpnt)->debug & debug_done) {
-    printk("\naha152x: done(), ");
-    disp_ports(shpnt);
-  }
+       if (HOSTDATA(shpnt)->debug & debug_done) {
+               printk("\naha152x: done(), ");
+               disp_ports(shpnt);
+       }
 #endif
 
-  if(CURRENT_SC) {
+       if (CURRENT_SC) {
 #if defined(DEBUG_DONE)
-    if(HOSTDATA(shpnt)->debug & debug_done)
-      printk("done(%x), ", error);
+               if (HOSTDATA(shpnt)->debug & debug_done)
+                       printk("done(%x), ", error);
 #endif
 
-    save_flags(flags);
-    cli();
+               save_flags(flags);
+               cli();
 
-    done_SC = CURRENT_SC;
-    CURRENT_SC = NULL;
+               done_SC = CURRENT_SC;
+               CURRENT_SC = NULL;
 
-    /* turn led off, when no commands are in the driver */
-    HOSTDATA(shpnt)->commands--;
-    if(!HOSTDATA(shpnt)->commands)
-      SETPORT(PORTA, 0);                                  /* turn led off */
+               /* turn led off, when no commands are in the driver */
+               HOSTDATA(shpnt)->commands--;
+               if (!HOSTDATA(shpnt)->commands)
+                       SETPORT(PORTA, 0);      /* turn led off */
 
 #if defined(DEBUG_QUEUES)
-    if(HOSTDATA(shpnt)->debug & debug_queues) 
-      printk("ok (%d), ", HOSTDATA(shpnt)->commands);
+               if (HOSTDATA(shpnt)->debug & debug_queues)
+                       printk("ok (%d), ", HOSTDATA(shpnt)->commands);
 #endif
-    restore_flags(flags);
+               restore_flags(flags);
 
-    SETPORT(SIMODE0, DISCONNECTED_SC ? ENSELDI : 0);
-    SETPORT(SIMODE1, ISSUE_SC ? ENBUSFREE : 0);
+               SETPORT(SIMODE0, DISCONNECTED_SC ? ENSELDI : 0);
+               SETPORT(SIMODE1, ISSUE_SC ? ENBUSFREE : 0);
 
 #if 0
 /* Why poll for the BUS FREE phase, when we have setup the interrupt!? */
 #if defined(DEBUG_PHASES)
-    if(HOSTDATA(shpnt)->debug & debug_phases)
-      printk("BUS FREE loop, ");
+               if (HOSTDATA(shpnt)->debug & debug_phases)
+                       printk("BUS FREE loop, ");
 #endif
-    while(TESTLO(SSTAT1, BUSFREE))
-      barrier();
+               while (TESTLO(SSTAT1, BUSFREE))
+                       barrier();
 #if defined(DEBUG_PHASES)
-    if(HOSTDATA(shpnt)->debug & debug_phases)
-      printk("BUS FREE\n");
+               if (HOSTDATA(shpnt)->debug & debug_phases)
+                       printk("BUS FREE\n");
 #endif
 #endif
 
-    done_SC->result = error;
-    if(done_SC->scsi_done) {
+               done_SC->result = error;
+               if (done_SC->scsi_done) {
 #if defined(DEBUG_DONE)
-      if(HOSTDATA(shpnt)->debug & debug_done)
-        printk("calling scsi_done, ");
+                       if (HOSTDATA(shpnt)->debug & debug_done)
+                               printk("calling scsi_done, ");
 #endif
-      done_SC->scsi_done(done_SC);
+                       spin_lock_irqsave(&io_request_lock, flags);
+                       done_SC->scsi_done(done_SC);
+                       spin_unlock_irqrestore(&io_request_lock, flags);
 #if defined(DEBUG_DONE)
-      if(HOSTDATA(shpnt)->debug & debug_done)
-        printk("done returned, ");
+                       if (HOSTDATA(shpnt)->debug & debug_done)
+                               printk("done returned, ");
 #endif
-    } else
-       panic("aha152x: current_SC->scsi_done() == NULL");
-  } else
-    aha152x_panic(shpnt, "done() called outside of command");
+               } else
+                       panic("aha152x: current_SC->scsi_done() == NULL");
+       } else
+               aha152x_panic(shpnt, "done() called outside of command");
 }
 
 
@@ -1563,41 +1586,39 @@ static void aha152x_complete(struct Scsi_Host *);
 static struct tq_struct aha152x_tq;
 
 /*
- *     Run service completions on the card with interrupts enabled.
+ *    Run service completions on the card with interrupts enabled.
  */
+
 static void aha152x_run(void)
 {
        int i;
-       for(i=0;i<IRQS;i++)
-       {
-               struct Scsi_Host *shpnt=aha152x_host[i];
-               if(shpnt && HOSTDATA(shpnt)->service)
-               {
-                       HOSTDATA(shpnt)->service=0;
+       for (i = 0; i < IRQS; i++) {
+               struct Scsi_Host *shpnt = aha152x_host[i];
+               if (shpnt && HOSTDATA(shpnt)->service) {
+                       HOSTDATA(shpnt)->service = 0;
                        aha152x_complete(shpnt);
                }
        }
 }
 
 /*
- *     Interrupts handler (main routine of the driver)
+ *    Interrupts handler (main routine of the driver)
  */
 
-static void aha152x_intr(int irqno, void *dev_id, struct pt_regs * regs)
+static void aha152x_intr(int irqno, void *dev_id, struct pt_regs *regs)
 {
-       struct Scsi_Host *shpnt = aha152x_host[irqno-IRQ_MIN];
+       struct Scsi_Host *shpnt = aha152x_host[irqno - IRQ_MIN];
 
 #if defined(DEBUG_RACE)
        enter_driver("intr");
 #else
 #if defined(DEBUG_INTR)
-       if(HOSTDATA(shpnt)->debug & debug_intr)
+       if (HOSTDATA(shpnt)->debug & debug_intr)
                printk("\naha152x: intr(), ");
 #endif
 #endif
 
-       if(!shpnt)
+       if (!shpnt)
                panic("aha152x: catched interrupt for unknown controller.\n");
 
        /* no more interrupts from the controller, while we're busy.
@@ -1606,9 +1627,9 @@ static void aha152x_intr(int irqno, void *dev_id, struct pt_regs * regs)
        CLRBITS(DMACNTRL0, INTEN);
 
        /* Poke the BH handler */
-       
-       HOSTDATA(shpnt)->service=1;
-       aha152x_tq.routine = (void *)aha152x_run;
+
+       HOSTDATA(shpnt)->service = 1;
+       aha152x_tq.routine = (void *) aha152x_run;
        queue_task(&aha152x_tq, &tq_immediate);
        mark_bh(IMMEDIATE_BH);
 }
@@ -1616,1020 +1637,1001 @@ static void aha152x_intr(int irqno, void *dev_id, struct pt_regs * regs)
 static void aha152x_complete(struct Scsi_Host *shpnt)
 {
        unsigned int flags;
-       int done=0, phase;
+       int done = 0, phase;
 
        /* disconnected target is trying to reconnect.
           Only possible, if we have disconnected nexuses and
           nothing is occupying the bus.
         */
-        
-  if(TESTHI(SSTAT0, SELDI) &&
-      DISCONNECTED_SC &&
-      (!CURRENT_SC || (CURRENT_SC->SCp.phase & in_selection)) ) {
-    int identify_msg, target, i;
-
-    /* Avoid conflicts when a target reconnects
-       while we are trying to connect to another. */
-    if(CURRENT_SC) {
-#if defined(DEBUG_QUEUES)
-      if(HOSTDATA(shpnt)->debug & debug_queues)
-        printk("i+, ");
-#endif
-      save_flags(flags);
-      cli();
-      append_SC(&ISSUE_SC, CURRENT_SC);
-      CURRENT_SC=NULL;
-      restore_flags(flags);
-    }
 
-    /* disable sequences */
-    SETPORT(SCSISEQ, 0);
-    SETPORT(SSTAT0, CLRSELDI);
-    SETPORT(SSTAT1, CLRBUSFREE);
+       if (TESTHI(SSTAT0, SELDI) &&
+           DISCONNECTED_SC &&
+           (!CURRENT_SC || (CURRENT_SC->SCp.phase & in_selection))) {
+               int identify_msg, target, i;
+
+               /* Avoid conflicts when a target reconnects
+                  while we are trying to connect to another. */
+               if (CURRENT_SC) {
+#if defined(DEBUG_QUEUES)
+                       if (HOSTDATA(shpnt)->debug & debug_queues)
+                               printk("i+, ");
+#endif
+                       save_flags(flags);
+                       cli();
+                       append_SC(&ISSUE_SC, CURRENT_SC);
+                       CURRENT_SC = NULL;
+                       restore_flags(flags);
+               }
+               /* disable sequences */
+               SETPORT(SCSISEQ, 0);
+               SETPORT(SSTAT0, CLRSELDI);
+               SETPORT(SSTAT1, CLRBUSFREE);
 
 #if defined(DEBUG_QUEUES) || defined(DEBUG_PHASES)
-    if(HOSTDATA(shpnt)->debug & (debug_queues|debug_phases))
-      printk("reselected, ");
+               if (HOSTDATA(shpnt)->debug & (debug_queues | debug_phases))
+                       printk("reselected, ");
 #endif
 
-    i = GETPORT(SELID) & ~(1 << shpnt->this_id);
-    target=0;
+               i = GETPORT(SELID) & ~(1 << shpnt->this_id);
+               target = 0;
 
-    if(i==0)
-      aha152x_panic(shpnt, "reconnecting target unknown");
+               if (i == 0)
+                       aha152x_panic(shpnt, "reconnecting target unknown");
 
-    for(; (i & 1)==0; target++, i>>=1)
-      ;
+               for (; (i & 1) == 0; target++, i >>= 1);
 
 #if defined(DEBUG_QUEUES)
-    if(HOSTDATA(shpnt)->debug & debug_queues)
-      printk("SELID=%02x, target=%d, ", GETPORT(SELID), target);
+               if (HOSTDATA(shpnt)->debug & debug_queues)
+                       printk("SELID=%02x, target=%d, ", GETPORT(SELID), target);
 #endif
-    SETPORT(SCSIID, (shpnt->this_id << OID_) | target);
-    SETPORT(SCSISEQ, ENRESELI);
+               SETPORT(SCSIID, (shpnt->this_id << OID_) | target);
+               SETPORT(SCSISEQ, ENRESELI);
 
-    if(TESTLO(SSTAT0, SELDI))
-      aha152x_panic(shpnt, "RESELI failed");
+               if (TESTLO(SSTAT0, SELDI))
+                       aha152x_panic(shpnt, "RESELI failed");
 
-    SETPORT(SCSIRATE, HOSTDATA(shpnt)->syncrate[target]&0x7f);
+               SETPORT(SCSIRATE, HOSTDATA(shpnt)->syncrate[target] & 0x7f);
 
-    SETPORT(SCSISIG, P_MSGI);
+               SETPORT(SCSISIG, P_MSGI);
 
-    /* Get identify message */
-    if((i=getphase(shpnt))!=P_MSGI) {
-      printk("target doesn't enter MSGI to identify (phase=%02x)\n", i);
-      aha152x_panic(shpnt, "unknown lun");
-    }
-    SETPORT(SCSISEQ, 0);
-
-    SETPORT(SXFRCTL0, CH1);
-
-    identify_msg = GETPORT(SCSIBUS);
+               /* Get identify message */
+               if ((i = getphase(shpnt)) != P_MSGI) {
+                       printk("target doesn't enter MSGI to identify (phase=%02x)\n", i);
+                       aha152x_panic(shpnt, "unknown lun");
+               }
+               SETPORT(SCSISEQ, 0);
 
-    if(!(identify_msg & IDENTIFY_BASE)) {
-      printk("target=%d, inbound message (%02x) != IDENTIFY\n",
-             target, identify_msg);
-      aha152x_panic(shpnt, "unknown lun");
-    }
+               SETPORT(SXFRCTL0, CH1);
 
+               identify_msg = GETPORT(SCSIBUS);
 
+               if (!(identify_msg & IDENTIFY_BASE)) {
+                       printk("target=%d, inbound message (%02x) != IDENTIFY\n",
+                              target, identify_msg);
+                       aha152x_panic(shpnt, "unknown lun");
+               }
 #if defined(DEBUG_QUEUES)
-    if(HOSTDATA(shpnt)->debug & debug_queues)
-      printk("identify=%02x, lun=%d, ", identify_msg, identify_msg & 0x3f);
+               if (HOSTDATA(shpnt)->debug & debug_queues)
+                       printk("identify=%02x, lun=%d, ", identify_msg, identify_msg & 0x3f);
 #endif
 
-    save_flags(flags);
-    cli();
+               save_flags(flags);
+               cli();
 
 #if defined(DEBUG_QUEUES)
-    if(HOSTDATA(shpnt)->debug & debug_queues)
-      printk("d-, ");
+               if (HOSTDATA(shpnt)->debug & debug_queues)
+                       printk("d-, ");
 #endif
-    CURRENT_SC = remove_SC(&DISCONNECTED_SC, target, identify_msg & 0x3f);
-
-    if(!CURRENT_SC) {
-      printk("lun=%d, ", identify_msg & 0x3f);
-      aha152x_panic(shpnt, "no disconnected command for that lun");
-    }
+               CURRENT_SC = remove_SC(&DISCONNECTED_SC, target, identify_msg & 0x3f);
 
-    CURRENT_SC->SCp.phase &= ~disconnected;
-    restore_flags(flags);
+               if (!CURRENT_SC) {
+                       printk("lun=%d, ", identify_msg & 0x3f);
+                       aha152x_panic(shpnt, "no disconnected command for that lun");
+               }
+               CURRENT_SC->SCp.phase &= ~disconnected;
+               restore_flags(flags);
 
-    make_acklow(shpnt);
-    if(getphase(shpnt)!=P_MSGI) {
-      SETPORT(SIMODE0, 0);
-      SETPORT(SIMODE1, ENPHASEMIS|ENBUSFREE);
+               make_acklow(shpnt);
+               if (getphase(shpnt) != P_MSGI) {
+                       SETPORT(SIMODE0, 0);
+                       SETPORT(SIMODE1, ENPHASEMIS | ENBUSFREE);
 #if defined(DEBUG_RACE)
-      leave_driver("(reselected) intr");
-#endif
-      SETBITS(DMACNTRL0, INTEN);
-      return;
-    }
-  }
-  
-  /* Check, if we aren't busy with a command */
-  if(!CURRENT_SC) {
-    /* bus is free to issue a queued command */
-    if(TESTHI(SSTAT1, BUSFREE) && ISSUE_SC) {
-      save_flags(flags);
-      cli();
+                       leave_driver("(reselected) intr");
+#endif
+                       SETBITS(DMACNTRL0, INTEN);
+                       return;
+               }
+       }
+       /* Check, if we aren't busy with a command */
+       if (!CURRENT_SC) {
+               /* bus is free to issue a queued command */
+               if (TESTHI(SSTAT1, BUSFREE) && ISSUE_SC) {
+                       save_flags(flags);
+                       cli();
 #if defined(DEBUG_QUEUES)
-      if(HOSTDATA(shpnt)->debug & debug_queues)
-        printk("i-, ");
+                       if (HOSTDATA(shpnt)->debug & debug_queues)
+                               printk("i-, ");
 #endif
-      CURRENT_SC = remove_first_SC(&ISSUE_SC);
-      restore_flags(flags);
+                       CURRENT_SC = remove_first_SC(&ISSUE_SC);
+                       restore_flags(flags);
 
 #if defined(DEBUG_INTR) || defined(DEBUG_SELECTION) || defined(DEBUG_PHASES)
-      if(HOSTDATA(shpnt)->debug & (debug_intr|debug_selection|debug_phases))
-        printk("issuing command, ");
+                       if (HOSTDATA(shpnt)->debug & (debug_intr | debug_selection | debug_phases))
+                               printk("issuing command, ");
 #endif
-      CURRENT_SC->SCp.phase = in_selection;
+                       CURRENT_SC->SCp.phase = in_selection;
 
 #if defined(DEBUG_INTR) || defined(DEBUG_SELECTION) || defined(DEBUG_PHASES)
-      if(HOSTDATA(shpnt)->debug & (debug_intr|debug_selection|debug_phases))
-        printk("selecting %d, ", CURRENT_SC->target); 
-#endif
-      SETPORT(SCSIID, (shpnt->this_id << OID_) | CURRENT_SC->target);
-
-      /* Enable interrupts for SELECTION OUT DONE and SELECTION OUT INITIATED */
-      SETPORT(SXFRCTL1, HOSTDATA(shpnt)->parity ? (ENSPCHK|ENSTIMER) : ENSTIMER);
-
-      /* enable interrupts for SELECTION OUT DONE and SELECTION TIME OUT */
-      SETPORT(SIMODE0, ENSELDO | (DISCONNECTED_SC ? ENSELDI : 0));
-      SETPORT(SIMODE1, ENSELTIMO);
-
-      /* Enable SELECTION OUT sequence */
-      SETBITS(SCSISEQ, ENSELO | ENAUTOATNO);
-        
-    } else {
-      /* No command we are busy with and no new to issue */
-      printk("aha152x: ignoring spurious interrupt, nothing to do\n");
-      if(TESTHI(DMACNTRL0, SWINT)) {
-        printk("aha152x: SWINT is set!  Why?\n");
-        CLRBITS(DMACNTRL0, SWINT);
-      }
-      show_queues(shpnt);
-    }
+                       if (HOSTDATA(shpnt)->debug & (debug_intr | debug_selection | debug_phases))
+                               printk("selecting %d, ", CURRENT_SC->target);
+#endif
+                       SETPORT(SCSIID, (shpnt->this_id << OID_) | CURRENT_SC->target);
+
+                       /* Enable interrupts for SELECTION OUT DONE and SELECTION OUT INITIATED */
+                       SETPORT(SXFRCTL1, HOSTDATA(shpnt)->parity ? (ENSPCHK | ENSTIMER) : ENSTIMER);
+
+                       /* enable interrupts for SELECTION OUT DONE and SELECTION TIME OUT */
+                       SETPORT(SIMODE0, ENSELDO | (DISCONNECTED_SC ? ENSELDI : 0));
+                       SETPORT(SIMODE1, ENSELTIMO);
+
+                       /* Enable SELECTION OUT sequence */
+                       SETBITS(SCSISEQ, ENSELO | ENAUTOATNO);
+
+               } else {
+                       /* No command we are busy with and no new to issue */
+                       printk("aha152x: ignoring spurious interrupt, nothing to do\n");
+                       if (TESTHI(DMACNTRL0, SWINT)) {
+                               printk("aha152x: SWINT is set!  Why?\n");
+                               CLRBITS(DMACNTRL0, SWINT);
+                       }
+                       show_queues(shpnt);
+               }
 
 #if defined(DEBUG_RACE)
-    leave_driver("(selecting) intr");
+               leave_driver("(selecting) intr");
 #endif
-    SETBITS(DMACNTRL0, INTEN);
-          return;
-  }
-
-  /* the bus is busy with something */
+               SETBITS(DMACNTRL0, INTEN);
+               return;
+       }
+       /* the bus is busy with something */
 
 #if defined(DEBUG_INTR)
-  if(HOSTDATA(shpnt)->debug & debug_intr)
-    disp_ports(shpnt);
+       if (HOSTDATA(shpnt)->debug & debug_intr)
+               disp_ports(shpnt);
 #endif
 
-  /* we are waiting for the result of a selection attempt */
-  if(CURRENT_SC->SCp.phase & in_selection) {
-    if(TESTLO(SSTAT1, SELTO)) {
-      /* no timeout */
-      if(TESTHI(SSTAT0, SELDO)) {
-        /* clear BUS FREE interrupt */
-        SETPORT(SSTAT1, CLRBUSFREE);
+       /* we are waiting for the result of a selection attempt */
+       if (CURRENT_SC->SCp.phase & in_selection) {
+               if (TESTLO(SSTAT1, SELTO)) {
+                       /* no timeout */
+                       if (TESTHI(SSTAT0, SELDO)) {
+                               /* clear BUS FREE interrupt */
+                               SETPORT(SSTAT1, CLRBUSFREE);
 
-        /* Disable SELECTION OUT sequence */
-        CLRBITS(SCSISEQ, ENSELO|ENAUTOATNO);
+                               /* Disable SELECTION OUT sequence */
+                               CLRBITS(SCSISEQ, ENSELO | ENAUTOATNO);
 
-        /* Disable SELECTION OUT DONE interrupt */
-        CLRBITS(SIMODE0, ENSELDO);
-        CLRBITS(SIMODE1, ENSELTIMO);
+                               /* Disable SELECTION OUT DONE interrupt */
+                               CLRBITS(SIMODE0, ENSELDO);
+                               CLRBITS(SIMODE1, ENSELTIMO);
 
-        if(TESTLO(SSTAT0, SELDO)) {
-          printk("aha152x: passing bus free condition\n");
+                               if (TESTLO(SSTAT0, SELDO)) {
+                                       printk("aha152x: passing bus free condition\n");
 
 #if defined(DEBUG_RACE)
-          leave_driver("(passing bus free) intr");
+                                       leave_driver("(passing bus free) intr");
 #endif
-          SETBITS(DMACNTRL0, INTEN);
-
-          if(CURRENT_SC->SCp.phase & aborted) {
-            HOSTDATA(shpnt)->abort_result=SCSI_ABORT_ERROR;
-            HOSTDATA(shpnt)->abortion_complete++;
-          }
+                                       SETBITS(DMACNTRL0, INTEN);
 
-          aha152x_done(shpnt, DID_NO_CONNECT << 16);
+                                       if (CURRENT_SC->SCp.phase & aborted) {
+                                               HOSTDATA(shpnt)->abort_result = SCSI_ABORT_ERROR;
+                                               HOSTDATA(shpnt)->abortion_complete++;
+                                       }
+                                       aha152x_done(shpnt, DID_NO_CONNECT << 16);
 
-          return;
-        }
+                                       return;
+                               }
 #if defined(DEBUG_SELECTION) || defined(DEBUG_PHASES)
-        if(HOSTDATA(shpnt)->debug & (debug_selection|debug_phases))
-          printk("SELDO (SELID=%x), ", GETPORT(SELID));
+                               if (HOSTDATA(shpnt)->debug & (debug_selection | debug_phases))
+                                       printk("SELDO (SELID=%x), ", GETPORT(SELID));
 #endif
 
-        /* selection was done */
-        SETPORT(SSTAT0, CLRSELDO);
+                               /* selection was done */
+                               SETPORT(SSTAT0, CLRSELDO);
 
 #if defined(DEBUG_ABORT)
-        if((HOSTDATA(shpnt)->debug & debug_abort) && (CURRENT_SC->SCp.phase & aborted))
-          printk("(ABORT) target selected, ");
+                               if ((HOSTDATA(shpnt)->debug & debug_abort) && (CURRENT_SC->SCp.phase & aborted))
+                                       printk("(ABORT) target selected, ");
 #endif
 
-        CURRENT_SC->SCp.phase &= ~in_selection;
-        CURRENT_SC->SCp.phase |= in_other;
+                               CURRENT_SC->SCp.phase &= ~in_selection;
+                               CURRENT_SC->SCp.phase |= in_other;
 
-        ADDMSG(IDENTIFY(HOSTDATA(shpnt)->reconnect,CURRENT_SC->lun));
+                               ADDMSG(IDENTIFY(HOSTDATA(shpnt)->reconnect, CURRENT_SC->lun));
 
-        if(!(SYNCRATE&0x80) && HOSTDATA(shpnt)->synchronous) {
-          ADDMSG(EXTENDED_MESSAGE);
-          ADDMSG(3);
-          ADDMSG(EXTENDED_SDTR);
-          ADDMSG(50);
-          ADDMSG(8);
+                               if (!(SYNCRATE & 0x80) && HOSTDATA(shpnt)->synchronous) {
+                                       ADDMSG(EXTENDED_MESSAGE);
+                                       ADDMSG(3);
+                                       ADDMSG(EXTENDED_SDTR);
+                                       ADDMSG(50);
+                                       ADDMSG(8);
 
-          printk("outbound SDTR: ");
-          print_msg(&MSG(MSGLEN-5));
-
-          SYNCRATE=0x80;
-          CURRENT_SC->SCp.phase |= in_sync;
-        }
+                                       printk("outbound SDTR: ");
+                                       print_msg(&MSG(MSGLEN - 5));
 
+                                       SYNCRATE = 0x80;
+                                       CURRENT_SC->SCp.phase |= in_sync;
+                               }
 #if defined(DEBUG_RACE)
-        leave_driver("(SELDO) intr");
+                               leave_driver("(SELDO) intr");
 #endif
-        SETPORT(SCSIRATE, SYNCRATE&0x7f);
+                               SETPORT(SCSIRATE, SYNCRATE & 0x7f);
 
-        SETPORT(SCSISIG, P_MSGO);
+                               SETPORT(SCSISIG, P_MSGO);
 
-        SETPORT(SIMODE0, 0);
-        SETPORT(SIMODE1, ENREQINIT|ENBUSFREE);
-        SETBITS(DMACNTRL0, INTEN);
+                               SETPORT(SIMODE0, 0);
+                               SETPORT(SIMODE1, ENREQINIT | ENBUSFREE);
+                               SETBITS(DMACNTRL0, INTEN);
 
-        return;
-      } else
-        aha152x_panic(shpnt, "neither timeout nor selection\007");
-    } else {
+                               return;
+                       } else
+                               aha152x_panic(shpnt, "neither timeout nor selection\007");
+               } else {
 #if defined(DEBUG_SELECTION) || defined(DEBUG_PHASES)
-      if(HOSTDATA(shpnt)->debug & (debug_selection|debug_phases))
-        printk("SELTO, ");
+                       if (HOSTDATA(shpnt)->debug & (debug_selection | debug_phases))
+                               printk("SELTO, ");
 #endif
-      /* end selection attempt */
-      CLRBITS(SCSISEQ, ENSELO|ENAUTOATNO);
+                       /* end selection attempt */
+                       CLRBITS(SCSISEQ, ENSELO | ENAUTOATNO);
 
-      /* timeout */
-      SETPORT(SSTAT1, CLRSELTIMO);
+                       /* timeout */
+                       SETPORT(SSTAT1, CLRSELTIMO);
 
-      SETPORT(SIMODE0, DISCONNECTED_SC ? ENSELDI : 0);
-      SETPORT(SIMODE1, ISSUE_SC ? ENBUSFREE : 0);
-      SETBITS(DMACNTRL0, INTEN);
+                       SETPORT(SIMODE0, DISCONNECTED_SC ? ENSELDI : 0);
+                       SETPORT(SIMODE1, ISSUE_SC ? ENBUSFREE : 0);
+                       SETBITS(DMACNTRL0, INTEN);
 #if defined(DEBUG_RACE)
-      leave_driver("(SELTO) intr");
+                       leave_driver("(SELTO) intr");
 #endif
 
-      if(CURRENT_SC->SCp.phase & aborted) {
+                       if (CURRENT_SC->SCp.phase & aborted) {
 #if defined(DEBUG_ABORT)
-        if(HOSTDATA(shpnt)->debug & debug_abort)
-          printk("(ABORT) selection timeout, ");
-#endif
-        HOSTDATA(shpnt)->abort_result=SCSI_ABORT_ERROR;
-        HOSTDATA(shpnt)->abortion_complete++;
-      }
-
-      if(TESTLO(SSTAT0, SELINGO))
-        /* ARBITRATION not won */
-        aha152x_done(shpnt, DID_BUS_BUSY << 16);
-      else
-        /* ARBITRATION won, but SELECTION failed */
-        aha152x_done(shpnt, DID_NO_CONNECT << 16);
-
-      return;
-    }
-  }
-
-  /* enable interrupt, when target leaves current phase */
-  phase = getphase(shpnt);
-  if(!(phase & ~P_MASK))                                      /* "real" phase */
-    SETPORT(SCSISIG, phase);
-  SETPORT(SSTAT1, CLRPHASECHG);
-  CURRENT_SC->SCp.phase =
-    (CURRENT_SC->SCp.phase & ~((P_MASK|1)<<16)) | (phase << 16);
-
-  /* information transfer phase */
-  switch(phase) {
-  case P_MSGO:                                               /* MESSAGE OUT */
-    {
-      int i, identify=0, abort=0;
+                               if (HOSTDATA(shpnt)->debug & debug_abort)
+                                       printk("(ABORT) selection timeout, ");
+#endif
+                               HOSTDATA(shpnt)->abort_result = SCSI_ABORT_ERROR;
+                               HOSTDATA(shpnt)->abortion_complete++;
+                       }
+                       if (TESTLO(SSTAT0, SELINGO))
+                               /* ARBITRATION not won */
+                               aha152x_done(shpnt, DID_BUS_BUSY << 16);
+                       else
+                               /* ARBITRATION won, but SELECTION failed */
+                               aha152x_done(shpnt, DID_NO_CONNECT << 16);
+
+                       return;
+               }
+       }
+       /* enable interrupt, when target leaves current phase */
+       phase = getphase(shpnt);
+       if (!(phase & ~P_MASK)) /* "real" phase */
+               SETPORT(SCSISIG, phase);
+       SETPORT(SSTAT1, CLRPHASECHG);
+       CURRENT_SC->SCp.phase =
+           (CURRENT_SC->SCp.phase & ~((P_MASK | 1) << 16)) | (phase << 16);
+
+       /* information transfer phase */
+       switch (phase) {
+       case P_MSGO:            /* MESSAGE OUT */
+               {
+                       int i, identify = 0, abort = 0;
 
 #if defined(DEBUG_INTR) || defined(DEBUG_MSGO) || defined(DEBUG_PHASES)
-      if(HOSTDATA(shpnt)->debug & (debug_intr|debug_msgo|debug_phases))
-        printk("MESSAGE OUT, ");
+                       if (HOSTDATA(shpnt)->debug & (debug_intr | debug_msgo | debug_phases))
+                               printk("MESSAGE OUT, ");
 #endif
-      if(MSGLEN==0) {
-        ADDMSG(MESSAGE_REJECT);
+                       if (MSGLEN == 0) {
+                               ADDMSG(MESSAGE_REJECT);
 #if defined(DEBUG_MSGO)
-        if(HOSTDATA(shpnt)->debug & debug_msgo)
-          printk("unexpected MESSAGE OUT phase; rejecting, ");
-#endif
-      }
-        
-      CLRBITS(SXFRCTL0, ENDMA);
-        
-      SETPORT(SIMODE0, 0);
-      SETPORT(SIMODE1, ENPHASEMIS|ENREQINIT|ENBUSFREE);
-        
-      /* wait for data latch to become ready or a phase change */
-      while(TESTLO(DMASTAT, INTSTAT))
-        barrier();
-        
+                               if (HOSTDATA(shpnt)->debug & debug_msgo)
+                                       printk("unexpected MESSAGE OUT phase; rejecting, ");
+#endif
+                       }
+                       CLRBITS(SXFRCTL0, ENDMA);
+
+                       SETPORT(SIMODE0, 0);
+                       SETPORT(SIMODE1, ENPHASEMIS | ENREQINIT | ENBUSFREE);
+
+                       /* wait for data latch to become ready or a phase change */
+                       while (TESTLO(DMASTAT, INTSTAT))
+                               barrier();
+
 #if defined(DEBUG_MSGO)
-      if(HOSTDATA(shpnt)->debug & debug_msgo) {
-        int i;
-            
-        printk("messages (");
-        for(i=0; i<MSGLEN; i+=print_msg(&MSG(i)), printk(" "))
-          ;
-        printk("), ");
-      }
-#endif
-        
-      for(i=0; i<MSGLEN && TESTLO(SSTAT1, PHASEMIS); i++) {
+                       if (HOSTDATA(shpnt)->debug & debug_msgo) {
+                               int i;
+
+                               printk("messages (");
+                               for (i = 0; i < MSGLEN; i += print_msg(&MSG(i)), printk(" "));
+                               printk("), ");
+                       }
+#endif
+
+                       for (i = 0; i < MSGLEN && TESTLO(SSTAT1, PHASEMIS); i++) {
 #if defined(DEBUG_MSGO)
-        if(HOSTDATA(shpnt)->debug & debug_msgo)
-          printk("%x ", MSG(i));
+                               if (HOSTDATA(shpnt)->debug & debug_msgo)
+                                       printk("%x ", MSG(i));
 #endif
-        if(i==MSGLEN-1) {
-          /* Leave MESSAGE OUT after transfer */
-          SETPORT(SSTAT1, CLRATNO);
-        }
-          
-        SETPORT(SCSIDAT, MSG(i));
+                               if (i == MSGLEN - 1) {
+                                       /* Leave MESSAGE OUT after transfer */
+                                       SETPORT(SSTAT1, CLRATNO);
+                               }
+                               SETPORT(SCSIDAT, MSG(i));
 
-        make_acklow(shpnt);
-        getphase(shpnt);
+                               make_acklow(shpnt);
+                               getphase(shpnt);
 
-        if(MSG(i)==IDENTIFY(HOSTDATA(shpnt)->reconnect,CURRENT_SC->lun))
-          identify++;
+                               if (MSG(i) == IDENTIFY(HOSTDATA(shpnt)->reconnect, CURRENT_SC->lun))
+                                       identify++;
 
-        if(MSG(i)==ABORT)
-          abort++;
+                               if (MSG(i) == ABORT)
+                                       abort++;
 
-      }
+                       }
 
-      MSGLEN=0;
+                       MSGLEN = 0;
 
-      if(identify)
-        CURRENT_SC->SCp.phase |= sent_ident;
+                       if (identify)
+                               CURRENT_SC->SCp.phase |= sent_ident;
 
-      if(abort) {
-        /* revive abort(); abort() enables interrupts */
-        HOSTDATA(shpnt)->abort_result=SCSI_ABORT_SUCCESS;
-        HOSTDATA(shpnt)->abortion_complete++;
+                       if (abort) {
+                               /* revive abort(); abort() enables interrupts */
+                               HOSTDATA(shpnt)->abort_result = SCSI_ABORT_SUCCESS;
+                               HOSTDATA(shpnt)->abortion_complete++;
 
-        CURRENT_SC->SCp.phase &= ~(P_MASK<<16);
+                               CURRENT_SC->SCp.phase &= ~(P_MASK << 16);
 
-        /* exit */
-        SETBITS(DMACNTRL0, INTEN);
+                               /* exit */
+                               SETBITS(DMACNTRL0, INTEN);
 #if defined(DEBUG_RACE)
-        leave_driver("(ABORT) intr");
+                               leave_driver("(ABORT) intr");
 #endif
-        aha152x_done(shpnt, DID_ABORT<<16);
+                               aha152x_done(shpnt, DID_ABORT << 16);
 
-        return;
-      }
-    }
-    break;
+                               return;
+                       }
+               }
+               break;
 
-  case P_CMD:                                          /* COMMAND phase */
+       case P_CMD:             /* COMMAND phase */
 #if defined(DEBUG_INTR) || defined(DEBUG_CMD) || defined(DEBUG_PHASES)
-    if(HOSTDATA(shpnt)->debug & (debug_intr|debug_cmd|debug_phases))
-      printk("COMMAND, ");
-#endif
-    if(!(CURRENT_SC->SCp.sent_command)) {
-      int i;
-
-      CLRBITS(SXFRCTL0, ENDMA);
-
-      SETPORT(SIMODE0, 0);
-      SETPORT(SIMODE1, ENPHASEMIS|ENREQINIT|ENBUSFREE);
-  
-      /* wait for data latch to become ready or a phase change */
-      while(TESTLO(DMASTAT, INTSTAT))
-        barrier();
-  
-      for(i=0; i<CURRENT_SC->cmd_len && TESTLO(SSTAT1, PHASEMIS); i++) {
-        SETPORT(SCSIDAT, CURRENT_SC->cmnd[i]);
-
-        make_acklow(shpnt);
-        getphase(shpnt);
-      }
-
-      if(i<CURRENT_SC->cmd_len && TESTHI(SSTAT1, PHASEMIS))
-        aha152x_panic(shpnt, "target left COMMAND");
-
-      CURRENT_SC->SCp.sent_command++;
-    } else
-      aha152x_panic(shpnt, "Nothing to send while in COMMAND");
-      break;
-
-  case P_MSGI:                                          /* MESSAGE IN phase */
-    {
-      int start_sync=0;
-        
+               if (HOSTDATA(shpnt)->debug & (debug_intr | debug_cmd | debug_phases))
+                       printk("COMMAND, ");
+#endif
+               if (!(CURRENT_SC->SCp.sent_command)) {
+                       int i;
+
+                       CLRBITS(SXFRCTL0, ENDMA);
+
+                       SETPORT(SIMODE0, 0);
+                       SETPORT(SIMODE1, ENPHASEMIS | ENREQINIT | ENBUSFREE);
+
+                       /* wait for data latch to become ready or a phase change */
+                       while (TESTLO(DMASTAT, INTSTAT))
+                               barrier();
+
+                       for (i = 0; i < CURRENT_SC->cmd_len && TESTLO(SSTAT1, PHASEMIS); i++) {
+                               SETPORT(SCSIDAT, CURRENT_SC->cmnd[i]);
+
+                               make_acklow(shpnt);
+                               getphase(shpnt);
+                       }
+
+                       if (i < CURRENT_SC->cmd_len && TESTHI(SSTAT1, PHASEMIS))
+                               aha152x_panic(shpnt, "target left COMMAND");
+
+                       CURRENT_SC->SCp.sent_command++;
+               } else
+                       aha152x_panic(shpnt, "Nothing to send while in COMMAND");
+               break;
+
+       case P_MSGI:            /* MESSAGE IN phase */
+               {
+                       int start_sync = 0;
+
 #if defined(DEBUG_INTR) || defined(DEBUG_MSGI) || defined(DEBUG_PHASES)
-      if(HOSTDATA(shpnt)->debug & (debug_intr|debug_msgi|debug_phases))
-        printk("MESSAGE IN, ");
-#endif
-      SETPORT(SXFRCTL0, CH1);
-
-      SETPORT(SIMODE0, 0);
-      SETPORT(SIMODE1, ENBUSFREE);
-  
-      while(phase == P_MSGI) {
-        CURRENT_SC->SCp.Message = GETPORT(SCSIDAT);
-        switch(CURRENT_SC->SCp.Message) {
-        case DISCONNECT:
+                       if (HOSTDATA(shpnt)->debug & (debug_intr | debug_msgi | debug_phases))
+                               printk("MESSAGE IN, ");
+#endif
+                       SETPORT(SXFRCTL0, CH1);
+
+                       SETPORT(SIMODE0, 0);
+                       SETPORT(SIMODE1, ENBUSFREE);
+
+                       while (phase == P_MSGI) {
+                               CURRENT_SC->SCp.Message = GETPORT(SCSIDAT);
+                               switch (CURRENT_SC->SCp.Message) {
+                               case DISCONNECT:
 #if defined(DEBUG_MSGI) || defined(DEBUG_PHASES)
-          if(HOSTDATA(shpnt)->debug & (debug_msgi|debug_phases))
-            printk("target disconnected, ");
+                                       if (HOSTDATA(shpnt)->debug & (debug_msgi | debug_phases))
+                                               printk("target disconnected, ");
 #endif
-          CURRENT_SC->SCp.Message = 0;
-          CURRENT_SC->SCp.phase   |= disconnected;
-          if(!HOSTDATA(shpnt)->reconnect)
-            aha152x_panic(shpnt, "target was not allowed to disconnect");
+                                       CURRENT_SC->SCp.Message = 0;
+                                       CURRENT_SC->SCp.phase |= disconnected;
+                                       if (!HOSTDATA(shpnt)->reconnect)
+                                               aha152x_panic(shpnt, "target was not allowed to disconnect");
+
+                                       break;
 
-          break;
-        
-        case COMMAND_COMPLETE:
+                               case COMMAND_COMPLETE:
 #if defined(DEBUG_MSGI) || defined(DEBUG_PHASES)
-          if(HOSTDATA(shpnt)->debug & (debug_msgi|debug_phases))
-            printk("inbound message (COMMAND COMPLETE), ");
-#endif
-          done++;
-          break;
-
-        case MESSAGE_REJECT:
-          if(CURRENT_SC->SCp.phase & in_sync) { 
-            CURRENT_SC->SCp.phase &= ~in_sync;
-            SYNCRATE=0x80;
-            printk("synchronous rejected, ");
-          } else
-            printk("inbound message (MESSAGE REJECT), ");
+                                       if (HOSTDATA(shpnt)->debug & (debug_msgi | debug_phases))
+                                               printk("inbound message (COMMAND COMPLETE), ");
+#endif
+                                       done++;
+                                       break;
+
+                               case MESSAGE_REJECT:
+                                       if (CURRENT_SC->SCp.phase & in_sync) {
+                                               CURRENT_SC->SCp.phase &= ~in_sync;
+                                               SYNCRATE = 0x80;
+                                               printk("synchronous rejected, ");
+                                       } else
+                                               printk("inbound message (MESSAGE REJECT), ");
 #if defined(DEBUG_MSGI)
-          if(HOSTDATA(shpnt)->debug & debug_msgi)
-            printk("inbound message (MESSAGE REJECT), ");
+                                       if (HOSTDATA(shpnt)->debug & debug_msgi)
+                                               printk("inbound message (MESSAGE REJECT), ");
 #endif
-          break;
+                                       break;
 
-        case SAVE_POINTERS:
+                               case SAVE_POINTERS:
 #if defined(DEBUG_MSGI)
-          if(HOSTDATA(shpnt)->debug & debug_msgi)
-            printk("inbound message (SAVE DATA POINTERS), ");
+                                       if (HOSTDATA(shpnt)->debug & debug_msgi)
+                                               printk("inbound message (SAVE DATA POINTERS), ");
 #endif
-          break;
+                                       break;
 
-        case RESTORE_POINTERS:
+                               case RESTORE_POINTERS:
 #if defined(DEBUG_MSGI)
-          if(HOSTDATA(shpnt)->debug & debug_msgi)
-            printk("inbound message (RESTORE DATA POINTERS), ");
+                                       if (HOSTDATA(shpnt)->debug & debug_msgi)
+                                               printk("inbound message (RESTORE DATA POINTERS), ");
 #endif
-          break;
+                                       break;
 
-        case EXTENDED_MESSAGE:
-          { 
-            char buffer[16];
-            int  i;
+                               case EXTENDED_MESSAGE:
+                                       {
+                                               char buffer[16];
+                                               int i;
 
 #if defined(DEBUG_MSGI)
-            if(HOSTDATA(shpnt)->debug & debug_msgi)
-              printk("inbound message (EXTENDED MESSAGE), ");
+                                               if (HOSTDATA(shpnt)->debug & debug_msgi)
+                                                       printk("inbound message (EXTENDED MESSAGE), ");
 #endif
-            make_acklow(shpnt);
-            if(getphase(shpnt)!=P_MSGI)
-              break;
-  
-            buffer[0]=EXTENDED_MESSAGE;
-            buffer[1]=GETPORT(SCSIDAT);
+                                               make_acklow(shpnt);
+                                               if (getphase(shpnt) != P_MSGI)
+                                                       break;
 
-            for(i=0; i<buffer[1] &&
-                     (make_acklow(shpnt), getphase(shpnt)==P_MSGI); i++)
-              buffer[2+i]=GETPORT(SCSIDAT);
+                                               buffer[0] = EXTENDED_MESSAGE;
+                                               buffer[1] = GETPORT(SCSIDAT);
+
+                                               for (i = 0; i < buffer[1] &&
+                                                    (make_acklow(shpnt), getphase(shpnt) == P_MSGI); i++)
+                                                       buffer[2 + i] = GETPORT(SCSIDAT);
 
 #if defined(DEBUG_MSGI)
-            if(HOSTDATA(shpnt)->debug & debug_msgi)
-              print_msg(buffer);
-#endif
-
-            switch(buffer [2]) {
-            case EXTENDED_SDTR:
-              {
-                long ticks;
-
-                if(buffer[1]!=3)
-                  aha152x_panic(shpnt, "SDTR message length != 3");
-
-                if(!HOSTDATA(shpnt)->synchronous)
-                  break;
-
-                printk("inbound SDTR: "); print_msg(buffer);
-
-                ticks=(buffer[3]*4+49)/50;
-
-                if(CURRENT_SC->SCp.phase & in_sync) {
-                  /* we initiated SDTR */
-                  if(ticks>9 || buffer[4]<1 || buffer[4]>8)
-                    aha152x_panic(shpnt, "received SDTR invalid");
-
-                  SYNCRATE |= ((ticks-2)<<4) + buffer[4];
-                } else if(ticks<=9 && buffer[4]>=1) {
-                  if(buffer[4]>8)
-                    buffer[4]=8;
-        
-                  ADDMSG(EXTENDED_MESSAGE);
-                  ADDMSG(3);
-                  ADDMSG(EXTENDED_SDTR);
-                  if(ticks<4) {
-                    ticks=4;
-                    ADDMSG(50);
-                  } else
-                    ADDMSG(buffer[3]);
-
-                  ADDMSG(buffer[4]);
-
-                  printk("outbound SDTR: ");
-                  print_msg(&MSG(MSGLEN-5));
-
-                  CURRENT_SC->SCp.phase |= in_sync;
-                   
-                  SYNCRATE |= ((ticks-2)<<4) + buffer[4];
-
-                  start_sync++;
-                } else {
-                  /* requested SDTR is too slow, do it asynchronously */
-                  ADDMSG(MESSAGE_REJECT);
-                  SYNCRATE = 0;
-                } 
-
-                SETPORT(SCSIRATE, SYNCRATE&0x7f);
-              }
-              break;
-                      
-            case EXTENDED_MODIFY_DATA_POINTER:
-            case EXTENDED_EXTENDED_IDENTIFY:
-            case EXTENDED_WDTR:
-            default:
-              ADDMSG(MESSAGE_REJECT);
-              break;
-            }
-          }
-          break;
-       
-        default:
-          printk("unsupported inbound message %x, ", CURRENT_SC->SCp.Message);
-          break;
-
-        }
-
-        make_acklow(shpnt);
-        phase=getphase(shpnt);
-      } 
-
-      if(start_sync)
-        CURRENT_SC->SCp.phase |= in_sync;
-      else
-        CURRENT_SC->SCp.phase &= ~in_sync;
-        
-      if(MSGLEN>0)
-        SETPORT(SCSISIG, P_MSGI|ATNO);
-        
-      /* clear SCSI fifo on BUSFREE */
-      if(phase==P_BUSFREE)
-        SETPORT(SXFRCTL0, CH1|CLRCH1);
-
-      if(CURRENT_SC->SCp.phase & disconnected) {
-        save_flags(flags);
-        cli();
+                                               if (HOSTDATA(shpnt)->debug & debug_msgi)
+                                                       print_msg(buffer);
+#endif
+
+                                               switch (buffer[2]) {
+                                               case EXTENDED_SDTR:
+                                                       {
+                                                               long ticks;
+
+                                                               if (buffer[1] != 3)
+                                                                       aha152x_panic(shpnt, "SDTR message length != 3");
+
+                                                               if (!HOSTDATA(shpnt)->synchronous)
+                                                                       break;
+
+                                                               printk("inbound SDTR: ");
+                                                               print_msg(buffer);
+
+                                                               ticks = (buffer[3] * 4 + 49) / 50;
+
+                                                               if (CURRENT_SC->SCp.phase & in_sync) {
+                                                                       /* we initiated SDTR */
+                                                                       if (ticks > 9 || buffer[4] < 1 || buffer[4] > 8)
+                                                                               aha152x_panic(shpnt, "received SDTR invalid");
+
+                                                                       SYNCRATE |= ((ticks - 2) << 4) + buffer[4];
+                                                               } else if (ticks <= 9 && buffer[4] >= 1) {
+                                                                       if (buffer[4] > 8)
+                                                                               buffer[4] = 8;
+
+                                                                       ADDMSG(EXTENDED_MESSAGE);
+                                                                       ADDMSG(3);
+                                                                       ADDMSG(EXTENDED_SDTR);
+                                                                       if (ticks < 4) {
+                                                                               ticks = 4;
+                                                                               ADDMSG(50);
+                                                                       } else
+                                                                               ADDMSG(buffer[3]);
+
+                                                                       ADDMSG(buffer[4]);
+
+                                                                       printk("outbound SDTR: ");
+                                                                       print_msg(&MSG(MSGLEN - 5));
+
+                                                                       CURRENT_SC->SCp.phase |= in_sync;
+
+                                                                       SYNCRATE |= ((ticks - 2) << 4) + buffer[4];
+
+                                                                       start_sync++;
+                                                               } else {
+                                                                       /* requested SDTR is too slow, do it asynchronously */
+                                                                       ADDMSG(MESSAGE_REJECT);
+                                                                       SYNCRATE = 0;
+                                                               }
+
+                                                               SETPORT(SCSIRATE, SYNCRATE & 0x7f);
+                                                       }
+                                                       break;
+
+                                               case EXTENDED_MODIFY_DATA_POINTER:
+                                               case EXTENDED_EXTENDED_IDENTIFY:
+                                               case EXTENDED_WDTR:
+                                               default:
+                                                       ADDMSG(MESSAGE_REJECT);
+                                                       break;
+                                               }
+                                       }
+                                       break;
+
+                               default:
+                                       printk("unsupported inbound message %x, ", CURRENT_SC->SCp.Message);
+                                       break;
+
+                               }
+
+                               make_acklow(shpnt);
+                               phase = getphase(shpnt);
+                       }
+
+                       if (start_sync)
+                               CURRENT_SC->SCp.phase |= in_sync;
+                       else
+                               CURRENT_SC->SCp.phase &= ~in_sync;
+
+                       if (MSGLEN > 0)
+                               SETPORT(SCSISIG, P_MSGI | ATNO);
+
+                       /* clear SCSI fifo on BUSFREE */
+                       if (phase == P_BUSFREE)
+                               SETPORT(SXFRCTL0, CH1 | CLRCH1);
+
+                       if (CURRENT_SC->SCp.phase & disconnected) {
+                               save_flags(flags);
+                               cli();
 #if defined(DEBUG_QUEUES)
-        if(HOSTDATA(shpnt)->debug & debug_queues)
-          printk("d+, ");
+                               if (HOSTDATA(shpnt)->debug & debug_queues)
+                                       printk("d+, ");
 #endif
-        append_SC(&DISCONNECTED_SC, CURRENT_SC);
-        CURRENT_SC->SCp.phase |= 1<<16;
-        CURRENT_SC = NULL;
-        restore_flags(flags);
+                               append_SC(&DISCONNECTED_SC, CURRENT_SC);
+                               CURRENT_SC->SCp.phase |= 1 << 16;
+                               CURRENT_SC = NULL;
+                               restore_flags(flags);
 
-        SETBITS(SCSISEQ, ENRESELI);
+                               SETBITS(SCSISEQ, ENRESELI);
 
-        SETPORT(SIMODE0, DISCONNECTED_SC ? ENSELDI : 0);
-        SETPORT(SIMODE1, ISSUE_SC ? ENBUSFREE : 0);
+                               SETPORT(SIMODE0, DISCONNECTED_SC ? ENSELDI : 0);
+                               SETPORT(SIMODE1, ISSUE_SC ? ENBUSFREE : 0);
 
-        SETBITS(DMACNTRL0, INTEN);
+                               SETBITS(DMACNTRL0, INTEN);
 
-        return;
-      }
-    }
-    break;
+                               return;
+                       }
+               }
+               break;
 
-  case P_STATUS:                                         /* STATUS IN phase */
+       case P_STATUS:          /* STATUS IN phase */
 #if defined(DEBUG_STATUS) || defined(DEBUG_INTR) || defined(DEBUG_PHASES)
-    if(HOSTDATA(shpnt)->debug & (debug_status|debug_intr|debug_phases))
-      printk("STATUS, ");
+               if (HOSTDATA(shpnt)->debug & (debug_status | debug_intr | debug_phases))
+                       printk("STATUS, ");
 #endif
-    SETPORT(SXFRCTL0, CH1);
+               SETPORT(SXFRCTL0, CH1);
+
+               SETPORT(SIMODE0, 0);
+               SETPORT(SIMODE1, ENREQINIT | ENBUSFREE);
 
-    SETPORT(SIMODE0, 0);
-    SETPORT(SIMODE1, ENREQINIT|ENBUSFREE);
+               if (TESTHI(SSTAT1, PHASEMIS))
+                       printk("aha152x: passing STATUS phase");
 
-    if(TESTHI(SSTAT1, PHASEMIS))
-      printk("aha152x: passing STATUS phase");
-      
-    CURRENT_SC->SCp.Status = GETPORT(SCSIBUS);
-    make_acklow(shpnt);
-    getphase(shpnt);
+               CURRENT_SC->SCp.Status = GETPORT(SCSIBUS);
+               make_acklow(shpnt);
+               getphase(shpnt);
 
 #if defined(DEBUG_STATUS)
-    if(HOSTDATA(shpnt)->debug & debug_status) {
-      printk("inbound status ");
-      print_status(CURRENT_SC->SCp.Status);
-      printk(", ");
-    }
+               if (HOSTDATA(shpnt)->debug & debug_status) {
+                       printk("inbound status ");
+                       print_status(CURRENT_SC->SCp.Status);
+                       printk(", ");
+               }
 #endif
-    break;
+               break;
 
-  case P_DATAI:                                            /* DATA IN phase */
-    {
-      int fifodata, data_count, done;
+       case P_DATAI:           /* DATA IN phase */
+               {
+                       int fifodata, data_count, done;
 
 #if defined(DEBUG_DATAI) || defined(DEBUG_INTR) || defined(DEBUG_PHASES)
-      if(HOSTDATA(shpnt)->debug & (debug_datai|debug_intr|debug_phases))
-        printk("DATA IN, ");
+                       if (HOSTDATA(shpnt)->debug & (debug_datai | debug_intr | debug_phases))
+                               printk("DATA IN, ");
 #endif
 
 #if 0
-      if(GETPORT(FIFOSTAT) || GETPORT(SSTAT2) & (SFULL|SFCNT))
-        printk("aha152x: P_DATAI: %d(%d) bytes left in FIFO, resetting\n",
-               GETPORT(FIFOSTAT), GETPORT(SSTAT2) & (SFULL|SFCNT));
+                       if (GETPORT(FIFOSTAT) || GETPORT(SSTAT2) & (SFULL | SFCNT))
+                               printk("aha152x: P_DATAI: %d(%d) bytes left in FIFO, resetting\n",
+                                      GETPORT(FIFOSTAT), GETPORT(SSTAT2) & (SFULL | SFCNT));
 #endif
 
-      /* reset host fifo */
-      SETPORT(DMACNTRL0, RSTFIFO);
-      SETPORT(DMACNTRL0, RSTFIFO|ENDMA);
+                       /* reset host fifo */
+                       SETPORT(DMACNTRL0, RSTFIFO);
+                       SETPORT(DMACNTRL0, RSTFIFO | ENDMA);
 
-      SETPORT(SXFRCTL0, CH1|SCSIEN|DMAEN);
+                       SETPORT(SXFRCTL0, CH1 | SCSIEN | DMAEN);
 
-      SETPORT(SIMODE0, 0);
-      SETPORT(SIMODE1, ENPHASEMIS|ENBUSFREE);
+                       SETPORT(SIMODE0, 0);
+                       SETPORT(SIMODE1, ENPHASEMIS | ENBUSFREE);
 
-      /* done is set when the FIFO is empty after the target left DATA IN */
-      done=0;
-      
-      /* while the target stays in DATA to transfer data */
-      while (!done) {
+                       /* done is set when the FIFO is empty after the target left DATA IN */
+                       done = 0;
+
+                       /* while the target stays in DATA to transfer data */
+                       while (!done) {
 #if defined(DEBUG_DATAI)
-        if(HOSTDATA(shpnt)->debug & debug_datai)
-          printk("expecting data, ");
+                               if (HOSTDATA(shpnt)->debug & debug_datai)
+                                       printk("expecting data, ");
 #endif
-        /* wait for PHASEMIS or full FIFO */
-        while(TESTLO(DMASTAT, DFIFOFULL|INTSTAT))
-          barrier();
+                               /* wait for PHASEMIS or full FIFO */
+                               while (TESTLO(DMASTAT, DFIFOFULL | INTSTAT))
+                                       barrier();
 
 #if defined(DEBUG_DATAI)
-        if(HOSTDATA(shpnt)->debug & debug_datai)
-          printk("ok, ");
-#endif
-           
-        if(TESTHI(DMASTAT, DFIFOFULL))
-          fifodata=GETPORT(FIFOSTAT);
-        else {
-          /* wait for SCSI fifo to get empty */
-          while(TESTLO(SSTAT2, SEMPTY))
-            barrier();
-
-          /* rest of data in FIFO */
-          fifodata=GETPORT(FIFOSTAT);
+                               if (HOSTDATA(shpnt)->debug & debug_datai)
+                                       printk("ok, ");
+#endif
+
+                               if (TESTHI(DMASTAT, DFIFOFULL))
+                                       fifodata = GETPORT(FIFOSTAT);
+                               else {
+                                       /* wait for SCSI fifo to get empty */
+                                       while (TESTLO(SSTAT2, SEMPTY))
+                                               barrier();
+
+                                       /* rest of data in FIFO */
+                                       fifodata = GETPORT(FIFOSTAT);
 #if defined(DEBUG_DATAI)
-          if(HOSTDATA(shpnt)->debug & debug_datai)
-            printk("last transfer, ");
+                                       if (HOSTDATA(shpnt)->debug & debug_datai)
+                                               printk("last transfer, ");
 #endif
-          done=1;
-        }
-  
+                                       done = 1;
+                               }
+
 #if defined(DEBUG_DATAI)
-        if(HOSTDATA(shpnt)->debug & debug_datai)
-          printk("fifodata=%d, ", fifodata);
+                               if (HOSTDATA(shpnt)->debug & debug_datai)
+                                       printk("fifodata=%d, ", fifodata);
 #endif
 
-        while(fifodata && CURRENT_SC->SCp.this_residual) {
-          data_count=fifodata;
-  
-          /* limit data transfer to size of first sg buffer */
-          if(data_count > CURRENT_SC->SCp.this_residual)
-            data_count = CURRENT_SC->SCp.this_residual;
-  
-          fifodata -= data_count;
+                               while (fifodata && CURRENT_SC->SCp.this_residual) {
+                                       data_count = fifodata;
+
+                                       /* limit data transfer to size of first sg buffer */
+                                       if (data_count > CURRENT_SC->SCp.this_residual)
+                                               data_count = CURRENT_SC->SCp.this_residual;
+
+                                       fifodata -= data_count;
 
 #if defined(DEBUG_DATAI)
-          if(HOSTDATA(shpnt)->debug & debug_datai)
-            printk("data_count=%d, ", data_count);
-#endif
-  
-          if(data_count&1) {
-            /* get a single byte in byte mode */
-            SETBITS(DMACNTRL0, _8BIT);
-            *CURRENT_SC->SCp.ptr++ = GETPORT(DATAPORT);
-            CURRENT_SC->SCp.this_residual--;
-          }
-          if(data_count>1) {
-            CLRBITS(DMACNTRL0, _8BIT);
-            data_count >>= 1; /* Number of words */
-            insw(DATAPORT, CURRENT_SC->SCp.ptr, data_count);
+                                       if (HOSTDATA(shpnt)->debug & debug_datai)
+                                               printk("data_count=%d, ", data_count);
+#endif
+
+                                       if (data_count & 1) {
+                                               /* get a single byte in byte mode */
+                                               SETBITS(DMACNTRL0, _8BIT);
+                                               *CURRENT_SC->SCp.ptr++ = GETPORT(DATAPORT);
+                                               CURRENT_SC->SCp.this_residual--;
+                                       }
+                                       if (data_count > 1) {
+                                               CLRBITS(DMACNTRL0, _8BIT);
+                                               data_count >>= 1;       /* Number of words */
+                                               insw(DATAPORT, CURRENT_SC->SCp.ptr, data_count);
 #if defined(DEBUG_DATAI)
-            if(HOSTDATA(shpnt)->debug & debug_datai)
-              /* show what comes with the last transfer */
-              if(done) {
+                                               if (HOSTDATA(shpnt)->debug & debug_datai)
+                                                       /* show what comes with the last transfer */
+                                                       if (done) {
 #if 0
-                int           i;
-                unsigned char *data;
+                                                               int i;
+                                                               unsigned char *data;
 #endif
-  
-                printk("data on last transfer (%d bytes) ",
-                       2*data_count);
-#if 0
-                printk("data on last transfer (%d bytes: ",
-                       2*data_count);
-                data = (unsigned char *) CURRENT_SC->SCp.ptr;
-                for(i=0; i<2*data_count; i++)
-                  printk("%2x ", *data++);
-                printk("), ");
-#endif
-              }
-#endif
-            CURRENT_SC->SCp.ptr           += 2 * data_count;
-            CURRENT_SC->SCp.this_residual -= 2 * data_count;
-          }
-             
-          /* if this buffer is full and there are more buffers left */
-          if(!CURRENT_SC->SCp.this_residual &&
-             CURRENT_SC->SCp.buffers_residual) {
-            /* advance to next buffer */
-            CURRENT_SC->SCp.buffers_residual--;
-            CURRENT_SC->SCp.buffer++;
-            CURRENT_SC->SCp.ptr           = CURRENT_SC->SCp.buffer->address;
-            CURRENT_SC->SCp.this_residual = CURRENT_SC->SCp.buffer->length;
-          } 
-        }
-        /*
-         * FIFO should be empty
-         */
-        if(fifodata>0) {
-          printk("aha152x: more data than expected (%d bytes)\n",
-                 GETPORT(FIFOSTAT));
-          SETBITS(DMACNTRL0, _8BIT);
-          printk("aha152x: data (");
-          while(fifodata--)
-            printk("%2x ", GETPORT(DATAPORT));
-            printk(")\n");
-        }
 
+                                                               printk("data on last transfer (%d bytes) ",
+                                                                      2 * data_count);
+#if 0
+                                                               printk("data on last transfer (%d bytes: ",
+                                                                      2 * data_count);
+                                                               data = (unsigned char *) CURRENT_SC->SCp.ptr;
+                                                               for (i = 0; i < 2 * data_count; i++)
+                                                                       printk("%2x ", *data++);
+                                                               printk("), ");
+#endif
+                                                       }
+#endif
+                                               CURRENT_SC->SCp.ptr += 2 * data_count;
+                                               CURRENT_SC->SCp.this_residual -= 2 * data_count;
+                                       }
+                                       /* if this buffer is full and there are more buffers left */
+                                       if (!CURRENT_SC->SCp.this_residual &&
+                                           CURRENT_SC->SCp.buffers_residual) {
+                                               /* advance to next buffer */
+                                               CURRENT_SC->SCp.buffers_residual--;
+                                               CURRENT_SC->SCp.buffer++;
+                                               CURRENT_SC->SCp.ptr = CURRENT_SC->SCp.buffer->address;
+                                               CURRENT_SC->SCp.this_residual = CURRENT_SC->SCp.buffer->length;
+                                       }
+                               }
+
+                               /*
+                                * FIFO should be empty
+                                */
+                               if (fifodata > 0) {
+                                       printk("aha152x: more data than expected (%d bytes)\n",
+                                              GETPORT(FIFOSTAT));
+                                       SETBITS(DMACNTRL0, _8BIT);
+                                       printk("aha152x: data (");
+                                       while (fifodata--)
+                                               printk("%2x ", GETPORT(DATAPORT));
+                                       printk(")\n");
+                               }
 #if defined(DEBUG_DATAI)
-        if(HOSTDATA(shpnt)->debug & debug_datai)
-          if(!fifodata)
-            printk("fifo empty, ");
-          else
-           printk("something left in fifo, ");
+                               if (HOSTDATA(shpnt)->debug & debug_datai)
+                                       if (!fifodata)
+                                               printk("fifo empty, ");
+                                       else
+                                               printk("something left in fifo, ");
 #endif
-      }
+                       }
 
 #if defined(DEBUG_DATAI)
-      if((HOSTDATA(shpnt)->debug & debug_datai) &&
-         (CURRENT_SC->SCp.buffers_residual ||
-          CURRENT_SC->SCp.this_residual))
-        printk("left buffers (buffers=%d, bytes=%d), ",
-               CURRENT_SC->SCp.buffers_residual, CURRENT_SC->SCp.this_residual);
-#endif
-      /* transfer can be considered ended, when SCSIEN reads back zero */
-      CLRBITS(SXFRCTL0, SCSIEN|DMAEN);
-      while(TESTHI(SXFRCTL0, SCSIEN))
-        barrier();
-      CLRBITS(DMACNTRL0, ENDMA);
+                       if ((HOSTDATA(shpnt)->debug & debug_datai) &&
+                           (CURRENT_SC->SCp.buffers_residual ||
+                            CURRENT_SC->SCp.this_residual))
+                               printk("left buffers (buffers=%d, bytes=%d), ",
+                                      CURRENT_SC->SCp.buffers_residual, CURRENT_SC->SCp.this_residual);
+#endif
+                       /* transfer can be considered ended, when SCSIEN reads back zero */
+                       CLRBITS(SXFRCTL0, SCSIEN | DMAEN);
+                       while (TESTHI(SXFRCTL0, SCSIEN))
+                               barrier();
+                       CLRBITS(DMACNTRL0, ENDMA);
 
 #if defined(DEBUG_DATAI) || defined(DEBUG_INTR)
-      if(HOSTDATA(shpnt)->debug & (debug_datai|debug_intr))
-        printk("got %d bytes, ", GETSTCNT());
+                       if (HOSTDATA(shpnt)->debug & (debug_datai | debug_intr))
+                               printk("got %d bytes, ", GETSTCNT());
 #endif
 
-      CURRENT_SC->SCp.have_data_in++;
-    }
-    break;
+                       CURRENT_SC->SCp.have_data_in++;
+               }
+               break;
 
-  case P_DATAO:                                           /* DATA OUT phase */
-    {
-      int data_count;
+       case P_DATAO:           /* DATA OUT phase */
+               {
+                       int data_count;
 
 #if defined(DEBUG_DATAO) || defined(DEBUG_INTR) || defined(DEBUG_PHASES)
-      if(HOSTDATA(shpnt)->debug & (debug_datao|debug_intr|debug_phases))
-        printk("DATA OUT, ");
+                       if (HOSTDATA(shpnt)->debug & (debug_datao | debug_intr | debug_phases))
+                               printk("DATA OUT, ");
 #endif
 #if defined(DEBUG_DATAO)
-      if(HOSTDATA(shpnt)->debug & debug_datao)
-        printk("got data to send (bytes=%d, buffers=%d), ",
-               CURRENT_SC->SCp.this_residual,
-               CURRENT_SC->SCp.buffers_residual);
-#endif
-
-      if(GETPORT(FIFOSTAT) || GETPORT(SSTAT2) & (SFULL|SFCNT)) {
-        printk("%d(%d) left in FIFO, ",
-               GETPORT(FIFOSTAT), GETPORT(SSTAT2) & (SFULL|SFCNT));
-        aha152x_panic(shpnt, "FIFO should be empty");
-      }
-
-      SETPORT(SXFRCTL0, CH1|CLRSTCNT|CLRCH1);
-      SETPORT(SXFRCTL0, SCSIEN|DMAEN|CH1);
-        
-      SETPORT(DMACNTRL0, WRITE_READ|RSTFIFO);
-      SETPORT(DMACNTRL0, ENDMA|WRITE_READ);
-
-      SETPORT(SIMODE0, 0);
-      SETPORT(SIMODE1, ENPHASEMIS|ENBUSFREE);
-
-      /* while current buffer is not empty or
-         there are more buffers to transfer */
-      while(TESTLO(SSTAT1, PHASEMIS) &&
-            (CURRENT_SC->SCp.this_residual ||
-            CURRENT_SC->SCp.buffers_residual)) {
+                       if (HOSTDATA(shpnt)->debug & debug_datao)
+                               printk("got data to send (bytes=%d, buffers=%d), ",
+                                      CURRENT_SC->SCp.this_residual,
+                                      CURRENT_SC->SCp.buffers_residual);
+#endif
+
+                       if (GETPORT(FIFOSTAT) || GETPORT(SSTAT2) & (SFULL | SFCNT)) {
+                               printk("%d(%d) left in FIFO, ",
+                                      GETPORT(FIFOSTAT), GETPORT(SSTAT2) & (SFULL | SFCNT));
+                               aha152x_panic(shpnt, "FIFO should be empty");
+                       }
+                       SETPORT(SXFRCTL0, CH1 | CLRSTCNT | CLRCH1);
+                       SETPORT(SXFRCTL0, SCSIEN | DMAEN | CH1);
+
+                       SETPORT(DMACNTRL0, WRITE_READ | RSTFIFO);
+                       SETPORT(DMACNTRL0, ENDMA | WRITE_READ);
+
+                       SETPORT(SIMODE0, 0);
+                       SETPORT(SIMODE1, ENPHASEMIS | ENBUSFREE);
+
+                       /* while current buffer is not empty or
+                          there are more buffers to transfer */
+                       while (TESTLO(SSTAT1, PHASEMIS) &&
+                              (CURRENT_SC->SCp.this_residual ||
+                               CURRENT_SC->SCp.buffers_residual)) {
 #if defined(DEBUG_DATAO)
-        if(HOSTDATA(shpnt)->debug & debug_datao)
-          printk("sending data (left: bytes=%d, buffers=%d), waiting, ",
-                 CURRENT_SC->SCp.this_residual,
-                 CURRENT_SC->SCp.buffers_residual);
+                               if (HOSTDATA(shpnt)->debug & debug_datao)
+                                       printk("sending data (left: bytes=%d, buffers=%d), waiting, ",
+                                          CURRENT_SC->SCp.this_residual,
+                                       CURRENT_SC->SCp.buffers_residual);
 #endif
-        /* transfer rest of buffer, but max. 128 byte */
-        data_count =
-          CURRENT_SC->SCp.this_residual > 128 ?
-          128 : CURRENT_SC->SCp.this_residual ;
+                               /* transfer rest of buffer, but max. 128 byte */
+                               data_count =
+                                   CURRENT_SC->SCp.this_residual > 128 ?
+                                   128 : CURRENT_SC->SCp.this_residual;
 
 #if defined(DEBUG_DATAO)
-        if(HOSTDATA(shpnt)->debug & debug_datao)
-          printk("data_count=%d, ", data_count);
-#endif
-  
-        if(data_count&1) {
-          /* put a single byte in byte mode */
-          SETBITS(DMACNTRL0, _8BIT);
-          SETPORT(DATAPORT, *CURRENT_SC->SCp.ptr++);
-          CURRENT_SC->SCp.this_residual--;
-        }
-        if(data_count>1) {
-          CLRBITS(DMACNTRL0, _8BIT);
-          data_count >>= 1; /* number of words */
-          outsw(DATAPORT, CURRENT_SC->SCp.ptr, data_count);
-          CURRENT_SC->SCp.ptr           += 2 * data_count;
-          CURRENT_SC->SCp.this_residual -= 2 * data_count;
-        }
-
-        /* wait for FIFO to get empty */
-        while(TESTLO(DMASTAT, DFIFOEMP|INTSTAT))
-          barrier();
+                               if (HOSTDATA(shpnt)->debug & debug_datao)
+                                       printk("data_count=%d, ", data_count);
+#endif
+
+                               if (data_count & 1) {
+                                       /* put a single byte in byte mode */
+                                       SETBITS(DMACNTRL0, _8BIT);
+                                       SETPORT(DATAPORT, *CURRENT_SC->SCp.ptr++);
+                                       CURRENT_SC->SCp.this_residual--;
+                               }
+                               if (data_count > 1) {
+                                       CLRBITS(DMACNTRL0, _8BIT);
+                                       data_count >>= 1;       /* number of words */
+                                       outsw(DATAPORT, CURRENT_SC->SCp.ptr, data_count);
+                                       CURRENT_SC->SCp.ptr += 2 * data_count;
+                                       CURRENT_SC->SCp.this_residual -= 2 * data_count;
+                               }
+                               /* wait for FIFO to get empty */
+                               while (TESTLO(DMASTAT, DFIFOEMP | INTSTAT))
+                                       barrier();
 
 #if defined(DEBUG_DATAO)
-        if(HOSTDATA(shpnt)->debug & debug_datao)
-          printk("fifo (%d bytes), transfered (%d bytes), ",
-                 GETPORT(FIFOSTAT), GETSTCNT());
-#endif
-
-        /* if this buffer is empty and there are more buffers left */
-        if(TESTLO(SSTAT1, PHASEMIS) &&
-           !CURRENT_SC->SCp.this_residual &&
-           CURRENT_SC->SCp.buffers_residual) {
-          /* advance to next buffer */
-          CURRENT_SC->SCp.buffers_residual--;
-          CURRENT_SC->SCp.buffer++;
-          CURRENT_SC->SCp.ptr           = CURRENT_SC->SCp.buffer->address;
-          CURRENT_SC->SCp.this_residual = CURRENT_SC->SCp.buffer->length;
-        }
-      }
-
-      if(CURRENT_SC->SCp.this_residual || CURRENT_SC->SCp.buffers_residual) {
-        /* target leaves DATA OUT for an other phase (perhaps disconnect) */
-
-        /* data in fifos has to be resend */
-        data_count = GETPORT(SSTAT2) & (SFULL|SFCNT);
-
-        data_count += GETPORT(FIFOSTAT) ;
-        CURRENT_SC->SCp.ptr           -= data_count;
-        CURRENT_SC->SCp.this_residual += data_count;
+                               if (HOSTDATA(shpnt)->debug & debug_datao)
+                                       printk("fifo (%d bytes), transfered (%d bytes), ",
+                                         GETPORT(FIFOSTAT), GETSTCNT());
+#endif
+
+                               /* if this buffer is empty and there are more buffers left */
+                               if (TESTLO(SSTAT1, PHASEMIS) &&
+                                   !CURRENT_SC->SCp.this_residual &&
+                                   CURRENT_SC->SCp.buffers_residual) {
+                                       /* advance to next buffer */
+                                       CURRENT_SC->SCp.buffers_residual--;
+                                       CURRENT_SC->SCp.buffer++;
+                                       CURRENT_SC->SCp.ptr = CURRENT_SC->SCp.buffer->address;
+                                       CURRENT_SC->SCp.this_residual = CURRENT_SC->SCp.buffer->length;
+                               }
+                       }
+
+                       if (CURRENT_SC->SCp.this_residual || CURRENT_SC->SCp.buffers_residual) {
+                               /* target leaves DATA OUT for an other phase (perhaps disconnect) */
+
+                               /* data in fifos has to be resend */
+                               data_count = GETPORT(SSTAT2) & (SFULL | SFCNT);
+
+                               data_count += GETPORT(FIFOSTAT);
+                               CURRENT_SC->SCp.ptr -= data_count;
+                               CURRENT_SC->SCp.this_residual += data_count;
 #if defined(DEBUG_DATAO)
-        if(HOSTDATA(shpnt)->debug & debug_datao)
-          printk("left data (bytes=%d, buffers=%d), fifos (bytes=%d), "
-                 "transfer incomplete, resetting fifo, ",
-                 CURRENT_SC->SCp.this_residual,
-                 CURRENT_SC->SCp.buffers_residual,
-                 data_count);
-#endif
-        SETPORT(DMACNTRL0, WRITE_READ|RSTFIFO);
-        CLRBITS(SXFRCTL0, SCSIEN|DMAEN);
-        CLRBITS(DMACNTRL0, ENDMA);
-      } else {
+                               if (HOSTDATA(shpnt)->debug & debug_datao)
+                                       printk("left data (bytes=%d, buffers=%d), fifos (bytes=%d), "
+                                              "transfer incomplete, resetting fifo, ",
+                                          CURRENT_SC->SCp.this_residual,
+                                       CURRENT_SC->SCp.buffers_residual,
+                                              data_count);
+#endif
+                               SETPORT(DMACNTRL0, WRITE_READ | RSTFIFO);
+                               CLRBITS(SXFRCTL0, SCSIEN | DMAEN);
+                               CLRBITS(DMACNTRL0, ENDMA);
+                       } else {
 #if defined(DEBUG_DATAO)
-        if(HOSTDATA(shpnt)->debug & debug_datao)
-          printk("waiting for SCSI fifo to get empty, ");
+                               if (HOSTDATA(shpnt)->debug & debug_datao)
+                                       printk("waiting for SCSI fifo to get empty, ");
 #endif
-        /* wait for SCSI fifo to get empty */
-        while(TESTLO(SSTAT2, SEMPTY))
-          barrier();
+                               /* wait for SCSI fifo to get empty */
+                               while (TESTLO(SSTAT2, SEMPTY))
+                                       barrier();
 #if defined(DEBUG_DATAO)
-        if(HOSTDATA(shpnt)->debug & debug_datao)
-          printk("ok, left data (bytes=%d, buffers=%d) ",
-                 CURRENT_SC->SCp.this_residual,
-                 CURRENT_SC->SCp.buffers_residual);
+                               if (HOSTDATA(shpnt)->debug & debug_datao)
+                                       printk("ok, left data (bytes=%d, buffers=%d) ",
+                                          CURRENT_SC->SCp.this_residual,
+                                       CURRENT_SC->SCp.buffers_residual);
 #endif
-        CLRBITS(SXFRCTL0, SCSIEN|DMAEN);
+                               CLRBITS(SXFRCTL0, SCSIEN | DMAEN);
 
-        /* transfer can be considered ended, when SCSIEN reads back zero */
-        while(TESTHI(SXFRCTL0, SCSIEN))
-          barrier();
+                               /* transfer can be considered ended, when SCSIEN reads back zero */
+                               while (TESTHI(SXFRCTL0, SCSIEN))
+                                       barrier();
 
-        CLRBITS(DMACNTRL0, ENDMA);
-      }
+                               CLRBITS(DMACNTRL0, ENDMA);
+                       }
 
 #if defined(DEBUG_DATAO) || defined(DEBUG_INTR)
-      if(HOSTDATA(shpnt)->debug & (debug_datao|debug_intr))
-        printk("sent %d data bytes, ", GETSTCNT());
+                       if (HOSTDATA(shpnt)->debug & (debug_datao | debug_intr))
+                               printk("sent %d data bytes, ", GETSTCNT());
 #endif
-    }
-    break;
+               }
+               break;
 
-  case P_BUSFREE:                                                /* BUSFREE */
+       case P_BUSFREE: /* BUSFREE */
 #if defined(DEBUG_RACE)
-    leave_driver("(BUSFREE) intr");
+               leave_driver("(BUSFREE) intr");
 #endif
 #if defined(DEBUG_PHASES)
-    if(HOSTDATA(shpnt)->debug & debug_phases)
-      printk("unexpected BUS FREE, ");
+               if (HOSTDATA(shpnt)->debug & debug_phases)
+                       printk("unexpected BUS FREE, ");
 #endif
-    CURRENT_SC->SCp.phase &= ~(P_MASK<<16);
+               CURRENT_SC->SCp.phase &= ~(P_MASK << 16);
 
-    aha152x_done(shpnt, DID_ERROR << 16);         /* Don't know any better */
-    return;
-    break;
+               aha152x_done(shpnt, DID_ERROR << 16);   /* Don't know any better */
+               return;
+               break;
 
-  case P_PARITY:                              /* parity error in DATA phase */
+       case P_PARITY:          /* parity error in DATA phase */
 #if defined(DEBUG_RACE)
-    leave_driver("(DID_PARITY) intr");
+               leave_driver("(DID_PARITY) intr");
 #endif
-    printk("PARITY error in DATA phase, ");
+               printk("PARITY error in DATA phase, ");
 
-    CURRENT_SC->SCp.phase &= ~(P_MASK<<16);
+               CURRENT_SC->SCp.phase &= ~(P_MASK << 16);
 
-    SETBITS(DMACNTRL0, INTEN);
-    aha152x_done(shpnt, DID_PARITY << 16);
-    return;
-    break;
+               SETBITS(DMACNTRL0, INTEN);
+               aha152x_done(shpnt, DID_PARITY << 16);
+               return;
+               break;
 
-  default:
-    printk("aha152x: unexpected phase\n");
-    break;
-  }
+       default:
+               printk("aha152x: unexpected phase\n");
+               break;
+       }
 
-  if(done) {
+       if (done) {
 #if defined(DEBUG_INTR)
-    if(HOSTDATA(shpnt)->debug & debug_intr)
-      printk("command done.\n");
+               if (HOSTDATA(shpnt)->debug & debug_intr)
+                       printk("command done.\n");
 #endif
 #if defined(DEBUG_RACE)
-    leave_driver("(done) intr");
+               leave_driver("(done) intr");
 #endif
 
-    SETPORT(SIMODE0, DISCONNECTED_SC ? ENSELDI : 0);
-    SETPORT(SIMODE1, ISSUE_SC ? ENBUSFREE : 0);
-    SETPORT(SCSISEQ, DISCONNECTED_SC ? ENRESELI : 0);
-    
-    SETBITS(DMACNTRL0, INTEN);
-      
-    aha152x_done(shpnt,
-                 (CURRENT_SC->SCp.Status  & 0xff)
-                 | ((CURRENT_SC->SCp.Message & 0xff) << 8)
-                 | (DID_OK << 16));
+               SETPORT(SIMODE0, DISCONNECTED_SC ? ENSELDI : 0);
+               SETPORT(SIMODE1, ISSUE_SC ? ENBUSFREE : 0);
+               SETPORT(SCSISEQ, DISCONNECTED_SC ? ENRESELI : 0);
+
+               SETBITS(DMACNTRL0, INTEN);
+
+               aha152x_done(shpnt,
+                            (CURRENT_SC->SCp.Status & 0xff)
+                            | ((CURRENT_SC->SCp.Message & 0xff) << 8)
+                            | (DID_OK << 16));
 
 #if defined(DEBUG_RACE)
-    printk("done returned (DID_OK: Status=%x; Message=%x).\n",
-           CURRENT_SC->SCp.Status, CURRENT_SC->SCp.Message);
+               printk("done returned (DID_OK: Status=%x; Message=%x).\n",
+                      CURRENT_SC->SCp.Status, CURRENT_SC->SCp.Message);
 #endif
-    return;
-  }
-
-  if(CURRENT_SC)
-    CURRENT_SC->SCp.phase |= 1<<16;
+               return;
+       }
+       if (CURRENT_SC)
+               CURRENT_SC->SCp.phase |= 1 << 16;
 
-  SETPORT(SIMODE0, 0);
-  SETPORT(SIMODE1, ENPHASEMIS|ENBUSFREE);
+       SETPORT(SIMODE0, 0);
+       SETPORT(SIMODE1, ENPHASEMIS | ENBUSFREE);
 #if defined(DEBUG_INTR)
-  if(HOSTDATA(shpnt)->debug & debug_intr)
-    disp_enintr(shpnt);
+       if (HOSTDATA(shpnt)->debug & debug_intr)
+               disp_enintr(shpnt);
 #endif
 #if defined(DEBUG_RACE)
-  leave_driver("(PHASEEND) intr");
+       leave_driver("(PHASEEND) intr");
 #endif
 
-  SETBITS(DMACNTRL0, INTEN);
-  return;
+       SETBITS(DMACNTRL0, INTEN);
+       return;
 }
 
 /* 
@@ -2637,9 +2639,9 @@ static void aha152x_complete(struct Scsi_Host *shpnt)
  */
 static void aha152x_panic(struct Scsi_Host *shpnt, char *msg)
 {
-  printk("\naha152x: %s\n", msg);
-  show_queues(shpnt);
-  panic("aha152x panic");
+       printk("\naha152x: %s\n", msg);
+       show_queues(shpnt);
+       panic("aha152x panic");
 }
 
 /*
@@ -2648,166 +2650,231 @@ static void aha152x_panic(struct Scsi_Host *shpnt, char *msg)
 static void disp_ports(struct Scsi_Host *shpnt)
 {
 #ifdef DEBUG_AHA152X
-  int s;
+       int s;
 
 #ifdef SKIP_PORTS
-  if(HOSTDATA(shpnt)->debug & debug_skipports)
-        return;
-#endif
-
-  printk("\n%s: ", CURRENT_SC ? "on bus" : "waiting");
-
-  s=GETPORT(SCSISEQ);
-  printk("SCSISEQ (");
-  if(s & TEMODEO)     printk("TARGET MODE ");
-  if(s & ENSELO)      printk("SELO ");
-  if(s & ENSELI)      printk("SELI ");
-  if(s & ENRESELI)    printk("RESELI ");
-  if(s & ENAUTOATNO)  printk("AUTOATNO ");
-  if(s & ENAUTOATNI)  printk("AUTOATNI ");
-  if(s & ENAUTOATNP)  printk("AUTOATNP ");
-  if(s & SCSIRSTO)    printk("SCSIRSTO ");
-  printk(");");
-
-  printk(" SCSISIG (");
-  s=GETPORT(SCSISIG);
-  switch(s & P_MASK) {
-  case P_DATAO:
-    printk("DATA OUT");
-    break;
-  case P_DATAI:
-    printk("DATA IN");
-    break;
-  case P_CMD:
-    printk("COMMAND"); 
-    break;
-  case P_STATUS:
-    printk("STATUS"); 
-    break;
-  case P_MSGO:
-    printk("MESSAGE OUT");
-    break;
-  case P_MSGI:
-    printk("MESSAGE IN");
-    break;
-  default:
-    printk("*illegal*");
-    break;
-  }
-  
-  printk("); ");
-
-  printk("INTSTAT (%s); ", TESTHI(DMASTAT, INTSTAT) ? "hi" : "lo");
-
-  printk("SSTAT (");
-  s=GETPORT(SSTAT0);
-  if(s & TARGET)   printk("TARGET ");
-  if(s & SELDO)    printk("SELDO ");
-  if(s & SELDI)    printk("SELDI ");
-  if(s & SELINGO)  printk("SELINGO ");
-  if(s & SWRAP)    printk("SWRAP ");
-  if(s & SDONE)    printk("SDONE ");
-  if(s & SPIORDY)  printk("SPIORDY ");
-  if(s & DMADONE)  printk("DMADONE ");
-
-  s=GETPORT(SSTAT1);
-  if(s & SELTO)     printk("SELTO ");
-  if(s & ATNTARG)   printk("ATNTARG ");
-  if(s & SCSIRSTI)  printk("SCSIRSTI ");
-  if(s & PHASEMIS)  printk("PHASEMIS ");
-  if(s & BUSFREE)   printk("BUSFREE ");
-  if(s & SCSIPERR)  printk("SCSIPERR ");
-  if(s & PHASECHG)  printk("PHASECHG ");
-  if(s & REQINIT)   printk("REQINIT ");
-  printk("); ");
-
-
-  printk("SSTAT (");
-
-  s=GETPORT(SSTAT0) & GETPORT(SIMODE0);
-
-  if(s & TARGET)    printk("TARGET ");
-  if(s & SELDO)     printk("SELDO ");
-  if(s & SELDI)     printk("SELDI ");
-  if(s & SELINGO)   printk("SELINGO ");
-  if(s & SWRAP)     printk("SWRAP ");
-  if(s & SDONE)     printk("SDONE ");
-  if(s & SPIORDY)   printk("SPIORDY ");
-  if(s & DMADONE)   printk("DMADONE ");
-
-  s=GETPORT(SSTAT1) & GETPORT(SIMODE1);
-
-  if(s & SELTO)     printk("SELTO ");
-  if(s & ATNTARG)   printk("ATNTARG ");
-  if(s & SCSIRSTI)  printk("SCSIRSTI ");
-  if(s & PHASEMIS)  printk("PHASEMIS ");
-  if(s & BUSFREE)   printk("BUSFREE ");
-  if(s & SCSIPERR)  printk("SCSIPERR ");
-  if(s & PHASECHG)  printk("PHASECHG ");
-  if(s & REQINIT)   printk("REQINIT ");
-  printk("); ");
-
-  printk("SXFRCTL0 (");
-
-  s=GETPORT(SXFRCTL0);
-  if(s & SCSIEN)    printk("SCSIEN ");
-  if(s & DMAEN)     printk("DMAEN ");
-  if(s & CH1)       printk("CH1 ");
-  if(s & CLRSTCNT)  printk("CLRSTCNT ");
-  if(s & SPIOEN)    printk("SPIOEN ");
-  if(s & CLRCH1)    printk("CLRCH1 ");
-  printk("); ");
-
-  printk("SIGNAL (");
-
-  s=GETPORT(SCSISIG);
-  if(s & ATNI)  printk("ATNI ");
-  if(s & SELI)  printk("SELI ");
-  if(s & BSYI)  printk("BSYI ");
-  if(s & REQI)  printk("REQI ");
-  if(s & ACKI)  printk("ACKI ");
-  printk("); ");
-
-  printk("SELID (%02x), ", GETPORT(SELID));
-
-  printk("SSTAT2 (");
-
-  s=GETPORT(SSTAT2);
-  if(s & SOFFSET)  printk("SOFFSET ");
-  if(s & SEMPTY)   printk("SEMPTY ");
-  if(s & SFULL)    printk("SFULL ");
-  printk("); SFCNT (%d); ", s & (SFULL|SFCNT));
-
-  s=GETPORT(SSTAT3);
-  printk("SCSICNT (%d), OFFCNT(%d), ", (s&0xf0)>>4, s&0x0f);
-  
-  printk("SSTAT4 (");
-  s=GETPORT(SSTAT4);
-  if(s & SYNCERR)   printk("SYNCERR ");
-  if(s & FWERR)     printk("FWERR ");
-  if(s & FRERR)     printk("FRERR ");
-  printk("); ");
-
-  printk("DMACNTRL0 (");
-  s=GETPORT(DMACNTRL0);
-  printk("%s ", s & _8BIT      ? "8BIT"  : "16BIT");
-  printk("%s ", s & DMA        ? "DMA"   : "PIO"  );
-  printk("%s ", s & WRITE_READ ? "WRITE" : "READ" );
-  if(s & ENDMA)    printk("ENDMA ");
-  if(s & INTEN)    printk("INTEN ");
-  if(s & RSTFIFO)  printk("RSTFIFO ");
-  if(s & SWINT)    printk("SWINT ");
-  printk("); ");
-
-  printk("DMASTAT (");
-  s=GETPORT(DMASTAT);
-  if(s & ATDONE)     printk("ATDONE ");
-  if(s & WORDRDY)    printk("WORDRDY ");
-  if(s & DFIFOFULL)  printk("DFIFOFULL ");
-  if(s & DFIFOEMP)   printk("DFIFOEMP ");
-  printk(")");
-
-  printk("\n");
+       if (HOSTDATA(shpnt)->debug & debug_skipports)
+               return;
+#endif
+
+       printk("\n%s: ", CURRENT_SC ? "on bus" : "waiting");
+
+       s = GETPORT(SCSISEQ);
+       printk("SCSISEQ (");
+       if (s & TEMODEO)
+               printk("TARGET MODE ");
+       if (s & ENSELO)
+               printk("SELO ");
+       if (s & ENSELI)
+               printk("SELI ");
+       if (s & ENRESELI)
+               printk("RESELI ");
+       if (s & ENAUTOATNO)
+               printk("AUTOATNO ");
+       if (s & ENAUTOATNI)
+               printk("AUTOATNI ");
+       if (s & ENAUTOATNP)
+               printk("AUTOATNP ");
+       if (s & SCSIRSTO)
+               printk("SCSIRSTO ");
+       printk(");");
+
+       printk(" SCSISIG (");
+       s = GETPORT(SCSISIG);
+       switch (s & P_MASK) {
+       case P_DATAO:
+               printk("DATA OUT");
+               break;
+       case P_DATAI:
+               printk("DATA IN");
+               break;
+       case P_CMD:
+               printk("COMMAND");
+               break;
+       case P_STATUS:
+               printk("STATUS");
+               break;
+       case P_MSGO:
+               printk("MESSAGE OUT");
+               break;
+       case P_MSGI:
+               printk("MESSAGE IN");
+               break;
+       default:
+               printk("*illegal*");
+               break;
+       }
+
+       printk("); ");
+
+       printk("INTSTAT (%s); ", TESTHI(DMASTAT, INTSTAT) ? "hi" : "lo");
+
+       printk("SSTAT (");
+       s = GETPORT(SSTAT0);
+       if (s & TARGET)
+               printk("TARGET ");
+       if (s & SELDO)
+               printk("SELDO ");
+       if (s & SELDI)
+               printk("SELDI ");
+       if (s & SELINGO)
+               printk("SELINGO ");
+       if (s & SWRAP)
+               printk("SWRAP ");
+       if (s & SDONE)
+               printk("SDONE ");
+       if (s & SPIORDY)
+               printk("SPIORDY ");
+       if (s & DMADONE)
+               printk("DMADONE ");
+
+       s = GETPORT(SSTAT1);
+       if (s & SELTO)
+               printk("SELTO ");
+       if (s & ATNTARG)
+               printk("ATNTARG ");
+       if (s & SCSIRSTI)
+               printk("SCSIRSTI ");
+       if (s & PHASEMIS)
+               printk("PHASEMIS ");
+       if (s & BUSFREE)
+               printk("BUSFREE ");
+       if (s & SCSIPERR)
+               printk("SCSIPERR ");
+       if (s & PHASECHG)
+               printk("PHASECHG ");
+       if (s & REQINIT)
+               printk("REQINIT ");
+       printk("); ");
+
+
+       printk("SSTAT (");
+
+       s = GETPORT(SSTAT0) & GETPORT(SIMODE0);
+
+       if (s & TARGET)
+               printk("TARGET ");
+       if (s & SELDO)
+               printk("SELDO ");
+       if (s & SELDI)
+               printk("SELDI ");
+       if (s & SELINGO)
+               printk("SELINGO ");
+       if (s & SWRAP)
+               printk("SWRAP ");
+       if (s & SDONE)
+               printk("SDONE ");
+       if (s & SPIORDY)
+               printk("SPIORDY ");
+       if (s & DMADONE)
+               printk("DMADONE ");
+
+       s = GETPORT(SSTAT1) & GETPORT(SIMODE1);
+
+       if (s & SELTO)
+               printk("SELTO ");
+       if (s & ATNTARG)
+               printk("ATNTARG ");
+       if (s & SCSIRSTI)
+               printk("SCSIRSTI ");
+       if (s & PHASEMIS)
+               printk("PHASEMIS ");
+       if (s & BUSFREE)
+               printk("BUSFREE ");
+       if (s & SCSIPERR)
+               printk("SCSIPERR ");
+       if (s & PHASECHG)
+               printk("PHASECHG ");
+       if (s & REQINIT)
+               printk("REQINIT ");
+       printk("); ");
+
+       printk("SXFRCTL0 (");
+
+       s = GETPORT(SXFRCTL0);
+       if (s & SCSIEN)
+               printk("SCSIEN ");
+       if (s & DMAEN)
+               printk("DMAEN ");
+       if (s & CH1)
+               printk("CH1 ");
+       if (s & CLRSTCNT)
+               printk("CLRSTCNT ");
+       if (s & SPIOEN)
+               printk("SPIOEN ");
+       if (s & CLRCH1)
+               printk("CLRCH1 ");
+       printk("); ");
+
+       printk("SIGNAL (");
+
+       s = GETPORT(SCSISIG);
+       if (s & ATNI)
+               printk("ATNI ");
+       if (s & SELI)
+               printk("SELI ");
+       if (s & BSYI)
+               printk("BSYI ");
+       if (s & REQI)
+               printk("REQI ");
+       if (s & ACKI)
+               printk("ACKI ");
+       printk("); ");
+
+       printk("SELID (%02x), ", GETPORT(SELID));
+
+       printk("SSTAT2 (");
+
+       s = GETPORT(SSTAT2);
+       if (s & SOFFSET)
+               printk("SOFFSET ");
+       if (s & SEMPTY)
+               printk("SEMPTY ");
+       if (s & SFULL)
+               printk("SFULL ");
+       printk("); SFCNT (%d); ", s & (SFULL | SFCNT));
+
+       s = GETPORT(SSTAT3);
+       printk("SCSICNT (%d), OFFCNT(%d), ", (s & 0xf0) >> 4, s & 0x0f);
+
+       printk("SSTAT4 (");
+       s = GETPORT(SSTAT4);
+       if (s & SYNCERR)
+               printk("SYNCERR ");
+       if (s & FWERR)
+               printk("FWERR ");
+       if (s & FRERR)
+               printk("FRERR ");
+       printk("); ");
+
+       printk("DMACNTRL0 (");
+       s = GETPORT(DMACNTRL0);
+       printk("%s ", s & _8BIT ? "8BIT" : "16BIT");
+       printk("%s ", s & DMA ? "DMA" : "PIO");
+       printk("%s ", s & WRITE_READ ? "WRITE" : "READ");
+       if (s & ENDMA)
+               printk("ENDMA ");
+       if (s & INTEN)
+               printk("INTEN ");
+       if (s & RSTFIFO)
+               printk("RSTFIFO ");
+       if (s & SWINT)
+               printk("SWINT ");
+       printk("); ");
+
+       printk("DMASTAT (");
+       s = GETPORT(DMASTAT);
+       if (s & ATDONE)
+               printk("ATDONE ");
+       if (s & WORDRDY)
+               printk("WORDRDY ");
+       if (s & DFIFOFULL)
+               printk("DFIFOFULL ");
+       if (s & DFIFOEMP)
+               printk("DFIFOEMP ");
+       printk(")");
+
+       printk("\n");
 #endif
 }
 
@@ -2816,518 +2883,618 @@ static void disp_ports(struct Scsi_Host *shpnt)
  */
 static void disp_enintr(struct Scsi_Host *shpnt)
 {
-  int s;
-
-  printk("enabled interrupts (");
-  
-  s=GETPORT(SIMODE0);
-  if(s & ENSELDO)    printk("ENSELDO ");
-  if(s & ENSELDI)    printk("ENSELDI ");
-  if(s & ENSELINGO)  printk("ENSELINGO ");
-  if(s & ENSWRAP)    printk("ENSWRAP ");
-  if(s & ENSDONE)    printk("ENSDONE ");
-  if(s & ENSPIORDY)  printk("ENSPIORDY ");
-  if(s & ENDMADONE)  printk("ENDMADONE ");
-
-  s=GETPORT(SIMODE1);
-  if(s & ENSELTIMO)    printk("ENSELTIMO ");
-  if(s & ENATNTARG)    printk("ENATNTARG ");
-  if(s & ENPHASEMIS)   printk("ENPHASEMIS ");
-  if(s & ENBUSFREE)    printk("ENBUSFREE ");
-  if(s & ENSCSIPERR)   printk("ENSCSIPERR ");
-  if(s & ENPHASECHG)   printk("ENPHASECHG ");
-  if(s & ENREQINIT)    printk("ENREQINIT ");
-  printk(")\n");
+       int s;
+
+       printk("enabled interrupts (");
+
+       s = GETPORT(SIMODE0);
+       if (s & ENSELDO)
+               printk("ENSELDO ");
+       if (s & ENSELDI)
+               printk("ENSELDI ");
+       if (s & ENSELINGO)
+               printk("ENSELINGO ");
+       if (s & ENSWRAP)
+               printk("ENSWRAP ");
+       if (s & ENSDONE)
+               printk("ENSDONE ");
+       if (s & ENSPIORDY)
+               printk("ENSPIORDY ");
+       if (s & ENDMADONE)
+               printk("ENDMADONE ");
+
+       s = GETPORT(SIMODE1);
+       if (s & ENSELTIMO)
+               printk("ENSELTIMO ");
+       if (s & ENATNTARG)
+               printk("ENATNTARG ");
+       if (s & ENPHASEMIS)
+               printk("ENPHASEMIS ");
+       if (s & ENBUSFREE)
+               printk("ENBUSFREE ");
+       if (s & ENSCSIPERR)
+               printk("ENSCSIPERR ");
+       if (s & ENPHASECHG)
+               printk("ENPHASECHG ");
+       if (s & ENREQINIT)
+               printk("ENREQINIT ");
+       printk(")\n");
 }
 
 #if defined(DEBUG_RACE)
 
 static const char *should_leave;
-static int in_driver=0;
+static int in_driver = 0;
 
 /*
  * Only one routine can be in the driver at once.
  */
 static void enter_driver(const char *func)
 {
-  unsigned long flags;
-
-  save_flags(flags);
-  cli();
-  printk("aha152x: entering %s() (%x)\n", func, jiffies);
-  if(in_driver) {
-    printk("%s should leave first.\n", should_leave);
-    panic("aha152x: already in driver\n");
-  }
-
-  in_driver++;
-  should_leave=func;
-  restore_flags(flags);
+       unsigned long flags;
+
+       save_flags(flags);
+       cli();
+       printk("aha152x: entering %s() (%x)\n", func, jiffies);
+       if (in_driver) {
+               printk("%s should leave first.\n", should_leave);
+               panic("aha152x: already in driver\n");
+       }
+       in_driver++;
+       should_leave = func;
+       restore_flags(flags);
 }
 
 static void leave_driver(const char *func)
 {
-  unsigned long flags;
-
-  save_flags(flags);
-  cli();
-  printk("\naha152x: leaving %s() (%x)\n", func, jiffies);
-  if(!in_driver) {
-    printk("aha152x: %s already left.\n", should_leave);
-    panic("aha152x: %s already left driver.\n");
-  }
-
-  in_driver--;
-  should_leave=func;
-  restore_flags(flags);
+       unsigned long flags;
+
+       save_flags(flags);
+       cli();
+       printk("\naha152x: leaving %s() (%x)\n", func, jiffies);
+       if (!in_driver) {
+               printk("aha152x: %s already left.\n", should_leave);
+               panic("aha152x: %s already left driver.\n");
+       }
+       in_driver--;
+       should_leave = func;
+       restore_flags(flags);
 }
 #endif
 
 /*
  * Show the command data of a command
  */
-static void show_command(Scsi_Cmnd *ptr)
+static void show_command(Scsi_Cmnd * ptr)
 {
-  printk("0x%08x: target=%d; lun=%d; cmnd=(",
-         (unsigned int) ptr, ptr->target, ptr->lun);
-  
-  print_command(ptr->cmnd);
-
-  printk("); residual=%d; buffers=%d; phase |",
-         ptr->SCp.this_residual, ptr->SCp.buffers_residual);
-
-  if(ptr->SCp.phase & not_issued  )  printk("not issued|");
-  if(ptr->SCp.phase & in_selection)  printk("in selection|");
-  if(ptr->SCp.phase & disconnected)  printk("disconnected|");
-  if(ptr->SCp.phase & aborted     )  printk("aborted|");
-  if(ptr->SCp.phase & sent_ident  )  printk("send_ident|");
-  if(ptr->SCp.phase & in_other) { 
-    printk("; in other(");
-    switch((ptr->SCp.phase >> 16) & P_MASK) {
-    case P_DATAO:
-      printk("DATA OUT");
-      break;
-    case P_DATAI:
-      printk("DATA IN");
-      break;
-    case P_CMD:
-      printk("COMMAND");
-      break;
-    case P_STATUS:
-      printk("STATUS");
-      break;
-    case P_MSGO:
-      printk("MESSAGE OUT");
-      break;
-    case P_MSGI:
-      printk("MESSAGE IN");
-      break;
-    default: 
-      printk("*illegal*");
-      break;
-    }
-    printk(")");
-    if(ptr->SCp.phase & (1<<16))
-      printk("; phaseend");
-  }
-  printk("; next=0x%08x\n", (unsigned int) ptr->host_scribble);
+       printk("0x%08x: target=%d; lun=%d; cmnd=(",
+              (unsigned int) ptr, ptr->target, ptr->lun);
+
+       print_command(ptr->cmnd);
+
+       printk("); residual=%d; buffers=%d; phase |",
+              ptr->SCp.this_residual, ptr->SCp.buffers_residual);
+
+       if (ptr->SCp.phase & not_issued)
+               printk("not issued|");
+       if (ptr->SCp.phase & in_selection)
+               printk("in selection|");
+       if (ptr->SCp.phase & disconnected)
+               printk("disconnected|");
+       if (ptr->SCp.phase & aborted)
+               printk("aborted|");
+       if (ptr->SCp.phase & sent_ident)
+               printk("send_ident|");
+       if (ptr->SCp.phase & in_other) {
+               printk("; in other(");
+               switch ((ptr->SCp.phase >> 16) & P_MASK) {
+               case P_DATAO:
+                       printk("DATA OUT");
+                       break;
+               case P_DATAI:
+                       printk("DATA IN");
+                       break;
+               case P_CMD:
+                       printk("COMMAND");
+                       break;
+               case P_STATUS:
+                       printk("STATUS");
+                       break;
+               case P_MSGO:
+                       printk("MESSAGE OUT");
+                       break;
+               case P_MSGI:
+                       printk("MESSAGE IN");
+                       break;
+               default:
+                       printk("*illegal*");
+                       break;
+               }
+               printk(")");
+               if (ptr->SCp.phase & (1 << 16))
+                       printk("; phaseend");
+       }
+       printk("; next=0x%08x\n", (unsigned int) ptr->host_scribble);
 }
+
 /*
  * Dump the queued data
  */
 static void show_queues(struct Scsi_Host *shpnt)
 {
-  unsigned long flags;
-  Scsi_Cmnd *ptr;
-
-  save_flags(flags);
-  cli();
-  printk("QUEUE STATUS:\nissue_SC:\n");
-  for(ptr=ISSUE_SC; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
-    show_command(ptr);
-
-  printk("current_SC:\n");
-  if(CURRENT_SC)
-    show_command(CURRENT_SC);
-  else
-    printk("none\n");
-
-  printk("disconnected_SC:\n");
-  for(ptr=DISCONNECTED_SC; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
-    show_command(ptr);
-
-  disp_ports(shpnt);
-  disp_enintr(shpnt);
-  restore_flags(flags);
+       unsigned long flags;
+       Scsi_Cmnd *ptr;
+
+       save_flags(flags);
+       cli();
+       printk("QUEUE STATUS:\nissue_SC:\n");
+       for (ptr = ISSUE_SC; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
+               show_command(ptr);
+
+       printk("current_SC:\n");
+       if (CURRENT_SC)
+               show_command(CURRENT_SC);
+       else
+               printk("none\n");
+
+       printk("disconnected_SC:\n");
+       for (ptr = DISCONNECTED_SC; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
+               show_command(ptr);
+
+       disp_ports(shpnt);
+       disp_enintr(shpnt);
+       restore_flags(flags);
 }
 
 int aha152x_set_info(char *buffer, int length, struct Scsi_Host *shpnt)
 {
-  return(-ENOSYS);  /* Currently this is a no-op */
+       return (-ENOSYS);       /* Currently this is a no-op */
 }
 
 #undef SPRINTF
 #define SPRINTF(args...) pos += sprintf(pos, ## args)
 
-static int get_command(char *pos, Scsi_Cmnd *ptr)
+static int get_command(char *pos, Scsi_Cmnd * ptr)
 {
-  char *start = pos;
-  int i;
-  
-  SPRINTF("0x%08x: target=%d; lun=%d; cmnd=( ",
-          (unsigned int) ptr, ptr->target, ptr->lun);
-  
-  for(i=0; i<COMMAND_SIZE(ptr->cmnd[0]); i++)
-    SPRINTF("0x%02x ", ptr->cmnd[i]);
-  
-  SPRINTF("); residual=%d; buffers=%d; phase |",
-          ptr->SCp.this_residual, ptr->SCp.buffers_residual);
-  
-  if(ptr->SCp.phase & not_issued  )  SPRINTF("not issued|");
-  if(ptr->SCp.phase & in_selection)  SPRINTF("in selection|");
-  if(ptr->SCp.phase & disconnected)  SPRINTF("disconnected|");
-  if(ptr->SCp.phase & aborted     )  SPRINTF("aborted|");
-  if(ptr->SCp.phase & sent_ident  )  SPRINTF("send_ident|");
-  if(ptr->SCp.phase & in_other) { 
-    SPRINTF("; in other(");
-    switch((ptr->SCp.phase >> 16) & P_MASK) {
-    case P_DATAO:
-      SPRINTF("DATA OUT");
-      break;
-    case P_DATAI:
-      SPRINTF("DATA IN");
-      break;
-    case P_CMD:
-      SPRINTF("COMMAND");
-      break;
-    case P_STATUS:
-      SPRINTF("STATUS");
-      break;
-    case P_MSGO:
-      SPRINTF("MESSAGE OUT");
-      break;
-    case P_MSGI:
-      SPRINTF("MESSAGE IN");
-      break;
-    default: 
-      SPRINTF("*illegal*");
-      break;
-    }
-    SPRINTF(")");
-    if(ptr->SCp.phase & (1<<16))
-      SPRINTF("; phaseend");
-  }
-  SPRINTF("; next=0x%08x\n", (unsigned int) ptr->host_scribble);
-  
-  return(pos-start);
+       char *start = pos;
+       int i;
+
+       SPRINTF("0x%08x: target=%d; lun=%d; cmnd=( ",
+               (unsigned int) ptr, ptr->target, ptr->lun);
+
+       for (i = 0; i < COMMAND_SIZE(ptr->cmnd[0]); i++)
+               SPRINTF("0x%02x ", ptr->cmnd[i]);
+
+       SPRINTF("); residual=%d; buffers=%d; phase |",
+               ptr->SCp.this_residual, ptr->SCp.buffers_residual);
+
+       if (ptr->SCp.phase & not_issued)
+               SPRINTF("not issued|");
+       if (ptr->SCp.phase & in_selection)
+               SPRINTF("in selection|");
+       if (ptr->SCp.phase & disconnected)
+               SPRINTF("disconnected|");
+       if (ptr->SCp.phase & aborted)
+               SPRINTF("aborted|");
+       if (ptr->SCp.phase & sent_ident)
+               SPRINTF("send_ident|");
+       if (ptr->SCp.phase & in_other) {
+               SPRINTF("; in other(");
+               switch ((ptr->SCp.phase >> 16) & P_MASK) {
+               case P_DATAO:
+                       SPRINTF("DATA OUT");
+                       break;
+               case P_DATAI:
+                       SPRINTF("DATA IN");
+                       break;
+               case P_CMD:
+                       SPRINTF("COMMAND");
+                       break;
+               case P_STATUS:
+                       SPRINTF("STATUS");
+                       break;
+               case P_MSGO:
+                       SPRINTF("MESSAGE OUT");
+                       break;
+               case P_MSGI:
+                       SPRINTF("MESSAGE IN");
+                       break;
+               default:
+                       SPRINTF("*illegal*");
+                       break;
+               }
+               SPRINTF(")");
+               if (ptr->SCp.phase & (1 << 16))
+                       SPRINTF("; phaseend");
+       }
+       SPRINTF("; next=0x%08x\n", (unsigned int) ptr->host_scribble);
+
+       return (pos - start);
 }
 
 static int get_ports(struct Scsi_Host *shpnt, char *pos)
 {
-  char *start = pos;
-  int s;
+       char *start = pos;
+       int s;
 
 #ifdef SKIP_PORTS
-  if(HOSTDATA(shpnt)->debug & debug_skipports)
-        return;
-#endif
-
-  SPRINTF("\n%s: ", CURRENT_SC ? "on bus" : "waiting");
-
-  s=GETPORT(SCSISEQ);
-  SPRINTF("SCSISEQ (");
-  if(s & TEMODEO)     SPRINTF("TARGET MODE ");
-  if(s & ENSELO)      SPRINTF("SELO ");
-  if(s & ENSELI)      SPRINTF("SELI ");
-  if(s & ENRESELI)    SPRINTF("RESELI ");
-  if(s & ENAUTOATNO)  SPRINTF("AUTOATNO ");
-  if(s & ENAUTOATNI)  SPRINTF("AUTOATNI ");
-  if(s & ENAUTOATNP)  SPRINTF("AUTOATNP ");
-  if(s & SCSIRSTO)    SPRINTF("SCSIRSTO ");
-  SPRINTF(");");
-
-  SPRINTF(" SCSISIG (");
-  s=GETPORT(SCSISIG);
-  switch(s & P_MASK) {
-  case P_DATAO:
-    SPRINTF("DATA OUT");
-    break;
-  case P_DATAI:
-    SPRINTF("DATA IN");
-    break;
-  case P_CMD:
-    SPRINTF("COMMAND"); 
-    break;
-  case P_STATUS:
-    SPRINTF("STATUS"); 
-    break;
-  case P_MSGO:
-    SPRINTF("MESSAGE OUT");
-    break;
-  case P_MSGI:
-    SPRINTF("MESSAGE IN");
-    break;
-  default:
-    SPRINTF("*illegal*");
-    break;
-  }
-  
-  SPRINTF("); ");
-
-  SPRINTF("INTSTAT (%s); ", TESTHI(DMASTAT, INTSTAT) ? "hi" : "lo");
-
-  SPRINTF("SSTAT (");
-  s=GETPORT(SSTAT0);
-  if(s & TARGET)   SPRINTF("TARGET ");
-  if(s & SELDO)    SPRINTF("SELDO ");
-  if(s & SELDI)    SPRINTF("SELDI ");
-  if(s & SELINGO)  SPRINTF("SELINGO ");
-  if(s & SWRAP)    SPRINTF("SWRAP ");
-  if(s & SDONE)    SPRINTF("SDONE ");
-  if(s & SPIORDY)  SPRINTF("SPIORDY ");
-  if(s & DMADONE)  SPRINTF("DMADONE ");
-
-  s=GETPORT(SSTAT1);
-  if(s & SELTO)     SPRINTF("SELTO ");
-  if(s & ATNTARG)   SPRINTF("ATNTARG ");
-  if(s & SCSIRSTI)  SPRINTF("SCSIRSTI ");
-  if(s & PHASEMIS)  SPRINTF("PHASEMIS ");
-  if(s & BUSFREE)   SPRINTF("BUSFREE ");
-  if(s & SCSIPERR)  SPRINTF("SCSIPERR ");
-  if(s & PHASECHG)  SPRINTF("PHASECHG ");
-  if(s & REQINIT)   SPRINTF("REQINIT ");
-  SPRINTF("); ");
-
-
-  SPRINTF("SSTAT (");
-
-  s=GETPORT(SSTAT0) & GETPORT(SIMODE0);
-
-  if(s & TARGET)    SPRINTF("TARGET ");
-  if(s & SELDO)     SPRINTF("SELDO ");
-  if(s & SELDI)     SPRINTF("SELDI ");
-  if(s & SELINGO)   SPRINTF("SELINGO ");
-  if(s & SWRAP)     SPRINTF("SWRAP ");
-  if(s & SDONE)     SPRINTF("SDONE ");
-  if(s & SPIORDY)   SPRINTF("SPIORDY ");
-  if(s & DMADONE)   SPRINTF("DMADONE ");
-
-  s=GETPORT(SSTAT1) & GETPORT(SIMODE1);
-
-  if(s & SELTO)     SPRINTF("SELTO ");
-  if(s & ATNTARG)   SPRINTF("ATNTARG ");
-  if(s & SCSIRSTI)  SPRINTF("SCSIRSTI ");
-  if(s & PHASEMIS)  SPRINTF("PHASEMIS ");
-  if(s & BUSFREE)   SPRINTF("BUSFREE ");
-  if(s & SCSIPERR)  SPRINTF("SCSIPERR ");
-  if(s & PHASECHG)  SPRINTF("PHASECHG ");
-  if(s & REQINIT)   SPRINTF("REQINIT ");
-  SPRINTF("); ");
-
-  SPRINTF("SXFRCTL0 (");
-
-  s=GETPORT(SXFRCTL0);
-  if(s & SCSIEN)    SPRINTF("SCSIEN ");
-  if(s & DMAEN)     SPRINTF("DMAEN ");
-  if(s & CH1)       SPRINTF("CH1 ");
-  if(s & CLRSTCNT)  SPRINTF("CLRSTCNT ");
-  if(s & SPIOEN)    SPRINTF("SPIOEN ");
-  if(s & CLRCH1)    SPRINTF("CLRCH1 ");
-  SPRINTF("); ");
-
-  SPRINTF("SIGNAL (");
-
-  s=GETPORT(SCSISIG);
-  if(s & ATNI)  SPRINTF("ATNI ");
-  if(s & SELI)  SPRINTF("SELI ");
-  if(s & BSYI)  SPRINTF("BSYI ");
-  if(s & REQI)  SPRINTF("REQI ");
-  if(s & ACKI)  SPRINTF("ACKI ");
-  SPRINTF("); ");
-
-  SPRINTF("SELID (%02x), ", GETPORT(SELID));
-
-  SPRINTF("SSTAT2 (");
-
-  s=GETPORT(SSTAT2);
-  if(s & SOFFSET)  SPRINTF("SOFFSET ");
-  if(s & SEMPTY)   SPRINTF("SEMPTY ");
-  if(s & SFULL)    SPRINTF("SFULL ");
-  SPRINTF("); SFCNT (%d); ", s & (SFULL|SFCNT));
-
-  s=GETPORT(SSTAT3);
-  SPRINTF("SCSICNT (%d), OFFCNT(%d), ", (s&0xf0)>>4, s&0x0f);
-  
-  SPRINTF("SSTAT4 (");
-  s=GETPORT(SSTAT4);
-  if(s & SYNCERR)   SPRINTF("SYNCERR ");
-  if(s & FWERR)     SPRINTF("FWERR ");
-  if(s & FRERR)     SPRINTF("FRERR ");
-  SPRINTF("); ");
-
-  SPRINTF("DMACNTRL0 (");
-  s=GETPORT(DMACNTRL0);
-  SPRINTF("%s ", s & _8BIT      ? "8BIT"  : "16BIT");
-  SPRINTF("%s ", s & DMA        ? "DMA"   : "PIO"  );
-  SPRINTF("%s ", s & WRITE_READ ? "WRITE" : "READ" );
-  if(s & ENDMA)    SPRINTF("ENDMA ");
-  if(s & INTEN)    SPRINTF("INTEN ");
-  if(s & RSTFIFO)  SPRINTF("RSTFIFO ");
-  if(s & SWINT)    SPRINTF("SWINT ");
-  SPRINTF("); ");
-
-  SPRINTF("DMASTAT (");
-  s=GETPORT(DMASTAT);
-  if(s & ATDONE)     SPRINTF("ATDONE ");
-  if(s & WORDRDY)    SPRINTF("WORDRDY ");
-  if(s & DFIFOFULL)  SPRINTF("DFIFOFULL ");
-  if(s & DFIFOEMP)   SPRINTF("DFIFOEMP ");
-  SPRINTF(")\n\n");
-
-  SPRINTF("enabled interrupts (");
-  
-  s=GETPORT(SIMODE0);
-  if(s & ENSELDO)    SPRINTF("ENSELDO ");
-  if(s & ENSELDI)    SPRINTF("ENSELDI ");
-  if(s & ENSELINGO)  SPRINTF("ENSELINGO ");
-  if(s & ENSWRAP)    SPRINTF("ENSWRAP ");
-  if(s & ENSDONE)    SPRINTF("ENSDONE ");
-  if(s & ENSPIORDY)  SPRINTF("ENSPIORDY ");
-  if(s & ENDMADONE)  SPRINTF("ENDMADONE ");
-
-  s=GETPORT(SIMODE1);
-  if(s & ENSELTIMO)    SPRINTF("ENSELTIMO ");
-  if(s & ENATNTARG)    SPRINTF("ENATNTARG ");
-  if(s & ENPHASEMIS)   SPRINTF("ENPHASEMIS ");
-  if(s & ENBUSFREE)    SPRINTF("ENBUSFREE ");
-  if(s & ENSCSIPERR)   SPRINTF("ENSCSIPERR ");
-  if(s & ENPHASECHG)   SPRINTF("ENPHASECHG ");
-  if(s & ENREQINIT)    SPRINTF("ENREQINIT ");
-  SPRINTF(")\n");
-  
-  return (pos-start);
+       if (HOSTDATA(shpnt)->debug & debug_skipports)
+               return;
+#endif
+
+       SPRINTF("\n%s: ", CURRENT_SC ? "on bus" : "waiting");
+
+       s = GETPORT(SCSISEQ);
+       SPRINTF("SCSISEQ (");
+       if (s & TEMODEO)
+               SPRINTF("TARGET MODE ");
+       if (s & ENSELO)
+               SPRINTF("SELO ");
+       if (s & ENSELI)
+               SPRINTF("SELI ");
+       if (s & ENRESELI)
+               SPRINTF("RESELI ");
+       if (s & ENAUTOATNO)
+               SPRINTF("AUTOATNO ");
+       if (s & ENAUTOATNI)
+               SPRINTF("AUTOATNI ");
+       if (s & ENAUTOATNP)
+               SPRINTF("AUTOATNP ");
+       if (s & SCSIRSTO)
+               SPRINTF("SCSIRSTO ");
+       SPRINTF(");");
+
+       SPRINTF(" SCSISIG (");
+       s = GETPORT(SCSISIG);
+       switch (s & P_MASK) {
+       case P_DATAO:
+               SPRINTF("DATA OUT");
+               break;
+       case P_DATAI:
+               SPRINTF("DATA IN");
+               break;
+       case P_CMD:
+               SPRINTF("COMMAND");
+               break;
+       case P_STATUS:
+               SPRINTF("STATUS");
+               break;
+       case P_MSGO:
+               SPRINTF("MESSAGE OUT");
+               break;
+       case P_MSGI:
+               SPRINTF("MESSAGE IN");
+               break;
+       default:
+               SPRINTF("*illegal*");
+               break;
+       }
+
+       SPRINTF("); ");
+
+       SPRINTF("INTSTAT (%s); ", TESTHI(DMASTAT, INTSTAT) ? "hi" : "lo");
+
+       SPRINTF("SSTAT (");
+       s = GETPORT(SSTAT0);
+       if (s & TARGET)
+               SPRINTF("TARGET ");
+       if (s & SELDO)
+               SPRINTF("SELDO ");
+       if (s & SELDI)
+               SPRINTF("SELDI ");
+       if (s & SELINGO)
+               SPRINTF("SELINGO ");
+       if (s & SWRAP)
+               SPRINTF("SWRAP ");
+       if (s & SDONE)
+               SPRINTF("SDONE ");
+       if (s & SPIORDY)
+               SPRINTF("SPIORDY ");
+       if (s & DMADONE)
+               SPRINTF("DMADONE ");
+
+       s = GETPORT(SSTAT1);
+       if (s & SELTO)
+               SPRINTF("SELTO ");
+       if (s & ATNTARG)
+               SPRINTF("ATNTARG ");
+       if (s & SCSIRSTI)
+               SPRINTF("SCSIRSTI ");
+       if (s & PHASEMIS)
+               SPRINTF("PHASEMIS ");
+       if (s & BUSFREE)
+               SPRINTF("BUSFREE ");
+       if (s & SCSIPERR)
+               SPRINTF("SCSIPERR ");
+       if (s & PHASECHG)
+               SPRINTF("PHASECHG ");
+       if (s & REQINIT)
+               SPRINTF("REQINIT ");
+       SPRINTF("); ");
+
+
+       SPRINTF("SSTAT (");
+
+       s = GETPORT(SSTAT0) & GETPORT(SIMODE0);
+
+       if (s & TARGET)
+               SPRINTF("TARGET ");
+       if (s & SELDO)
+               SPRINTF("SELDO ");
+       if (s & SELDI)
+               SPRINTF("SELDI ");
+       if (s & SELINGO)
+               SPRINTF("SELINGO ");
+       if (s & SWRAP)
+               SPRINTF("SWRAP ");
+       if (s & SDONE)
+               SPRINTF("SDONE ");
+       if (s & SPIORDY)
+               SPRINTF("SPIORDY ");
+       if (s & DMADONE)
+               SPRINTF("DMADONE ");
+
+       s = GETPORT(SSTAT1) & GETPORT(SIMODE1);
+
+       if (s & SELTO)
+               SPRINTF("SELTO ");
+       if (s & ATNTARG)
+               SPRINTF("ATNTARG ");
+       if (s & SCSIRSTI)
+               SPRINTF("SCSIRSTI ");
+       if (s & PHASEMIS)
+               SPRINTF("PHASEMIS ");
+       if (s & BUSFREE)
+               SPRINTF("BUSFREE ");
+       if (s & SCSIPERR)
+               SPRINTF("SCSIPERR ");
+       if (s & PHASECHG)
+               SPRINTF("PHASECHG ");
+       if (s & REQINIT)
+               SPRINTF("REQINIT ");
+       SPRINTF("); ");
+
+       SPRINTF("SXFRCTL0 (");
+
+       s = GETPORT(SXFRCTL0);
+       if (s & SCSIEN)
+               SPRINTF("SCSIEN ");
+       if (s & DMAEN)
+               SPRINTF("DMAEN ");
+       if (s & CH1)
+               SPRINTF("CH1 ");
+       if (s & CLRSTCNT)
+               SPRINTF("CLRSTCNT ");
+       if (s & SPIOEN)
+               SPRINTF("SPIOEN ");
+       if (s & CLRCH1)
+               SPRINTF("CLRCH1 ");
+       SPRINTF("); ");
+
+       SPRINTF("SIGNAL (");
+
+       s = GETPORT(SCSISIG);
+       if (s & ATNI)
+               SPRINTF("ATNI ");
+       if (s & SELI)
+               SPRINTF("SELI ");
+       if (s & BSYI)
+               SPRINTF("BSYI ");
+       if (s & REQI)
+               SPRINTF("REQI ");
+       if (s & ACKI)
+               SPRINTF("ACKI ");
+       SPRINTF("); ");
+
+       SPRINTF("SELID (%02x), ", GETPORT(SELID));
+
+       SPRINTF("SSTAT2 (");
+
+       s = GETPORT(SSTAT2);
+       if (s & SOFFSET)
+               SPRINTF("SOFFSET ");
+       if (s & SEMPTY)
+               SPRINTF("SEMPTY ");
+       if (s & SFULL)
+               SPRINTF("SFULL ");
+       SPRINTF("); SFCNT (%d); ", s & (SFULL | SFCNT));
+
+       s = GETPORT(SSTAT3);
+       SPRINTF("SCSICNT (%d), OFFCNT(%d), ", (s & 0xf0) >> 4, s & 0x0f);
+
+       SPRINTF("SSTAT4 (");
+       s = GETPORT(SSTAT4);
+       if (s & SYNCERR)
+               SPRINTF("SYNCERR ");
+       if (s & FWERR)
+               SPRINTF("FWERR ");
+       if (s & FRERR)
+               SPRINTF("FRERR ");
+       SPRINTF("); ");
+
+       SPRINTF("DMACNTRL0 (");
+       s = GETPORT(DMACNTRL0);
+       SPRINTF("%s ", s & _8BIT ? "8BIT" : "16BIT");
+       SPRINTF("%s ", s & DMA ? "DMA" : "PIO");
+       SPRINTF("%s ", s & WRITE_READ ? "WRITE" : "READ");
+       if (s & ENDMA)
+               SPRINTF("ENDMA ");
+       if (s & INTEN)
+               SPRINTF("INTEN ");
+       if (s & RSTFIFO)
+               SPRINTF("RSTFIFO ");
+       if (s & SWINT)
+               SPRINTF("SWINT ");
+       SPRINTF("); ");
+
+       SPRINTF("DMASTAT (");
+       s = GETPORT(DMASTAT);
+       if (s & ATDONE)
+               SPRINTF("ATDONE ");
+       if (s & WORDRDY)
+               SPRINTF("WORDRDY ");
+       if (s & DFIFOFULL)
+               SPRINTF("DFIFOFULL ");
+       if (s & DFIFOEMP)
+               SPRINTF("DFIFOEMP ");
+       SPRINTF(")\n\n");
+
+       SPRINTF("enabled interrupts (");
+
+       s = GETPORT(SIMODE0);
+       if (s & ENSELDO)
+               SPRINTF("ENSELDO ");
+       if (s & ENSELDI)
+               SPRINTF("ENSELDI ");
+       if (s & ENSELINGO)
+               SPRINTF("ENSELINGO ");
+       if (s & ENSWRAP)
+               SPRINTF("ENSWRAP ");
+       if (s & ENSDONE)
+               SPRINTF("ENSDONE ");
+       if (s & ENSPIORDY)
+               SPRINTF("ENSPIORDY ");
+       if (s & ENDMADONE)
+               SPRINTF("ENDMADONE ");
+
+       s = GETPORT(SIMODE1);
+       if (s & ENSELTIMO)
+               SPRINTF("ENSELTIMO ");
+       if (s & ENATNTARG)
+               SPRINTF("ENATNTARG ");
+       if (s & ENPHASEMIS)
+               SPRINTF("ENPHASEMIS ");
+       if (s & ENBUSFREE)
+               SPRINTF("ENBUSFREE ");
+       if (s & ENSCSIPERR)
+               SPRINTF("ENSCSIPERR ");
+       if (s & ENPHASECHG)
+               SPRINTF("ENPHASECHG ");
+       if (s & ENREQINIT)
+               SPRINTF("ENREQINIT ");
+       SPRINTF(")\n");
+
+       return (pos - start);
 }
 
 #undef SPRINTF
 #define SPRINTF(args...) do { if(pos < buffer + length) pos += sprintf(pos, ## args); } while(0)
 
 int aha152x_proc_info(char *buffer, char **start,
-                      off_t offset, int length, int hostno, int inout)
+                     off_t offset, int length, int hostno, int inout)
 {
-  int i;
-  char *pos = buffer;
-  struct Scsi_Host *shpnt;
-  unsigned long flags;
-  Scsi_Cmnd *ptr;
-  
-  for(i=0, shpnt= (struct Scsi_Host *) NULL; i<IRQS; i++)
-    if(aha152x_host[i] && aha152x_host[i]->host_no == hostno)
-      shpnt=aha152x_host[i];
-  
-  if(!shpnt)
-    return(-ESRCH);
-  
-  if(inout) /* Has data been written to the file ? */ 
-    return(aha152x_set_info(buffer, length, shpnt));
-  
-  SPRINTF(AHA152X_REVID "\n");
-  
-  save_flags(flags);
-  cli();
-  
-  SPRINTF("ioports 0x%04lx to 0x%04lx\n",
-          shpnt->io_port, shpnt->io_port+shpnt->n_io_port-1);
-  SPRINTF("interrupt 0x%02x\n", shpnt->irq);
-  SPRINTF("disconnection/reconnection %s\n", 
-          HOSTDATA(shpnt)->reconnect ? "enabled" : "disabled");
-  SPRINTF("parity checking %s\n", 
-          HOSTDATA(shpnt)->parity ? "enabled" : "disabled");
-  SPRINTF("synchronous transfers %s\n", 
-          HOSTDATA(shpnt)->synchronous ? "enabled" : "disabled");
-  SPRINTF("%d commands currently queued\n", HOSTDATA(shpnt)->commands);
-  
-  if(HOSTDATA(shpnt)->synchronous) {
+       int i;
+       char *pos = buffer;
+       struct Scsi_Host *shpnt;
+       unsigned long flags;
+       Scsi_Cmnd *ptr;
+
+       for (i = 0, shpnt = (struct Scsi_Host *) NULL; i < IRQS; i++)
+               if (aha152x_host[i] && aha152x_host[i]->host_no == hostno)
+                       shpnt = aha152x_host[i];
+
+       if (!shpnt)
+               return (-ESRCH);
+
+       if (inout)              /* Has data been written to the file ? */
+               return (aha152x_set_info(buffer, length, shpnt));
+
+       SPRINTF(AHA152X_REVID "\n");
+
+       save_flags(flags);
+       cli();
+
+       SPRINTF("ioports 0x%04lx to 0x%04lx\n",
+               shpnt->io_port, shpnt->io_port + shpnt->n_io_port - 1);
+       SPRINTF("interrupt 0x%02x\n", shpnt->irq);
+       SPRINTF("disconnection/reconnection %s\n",
+               HOSTDATA(shpnt)->reconnect ? "enabled" : "disabled");
+       SPRINTF("parity checking %s\n",
+               HOSTDATA(shpnt)->parity ? "enabled" : "disabled");
+       SPRINTF("synchronous transfers %s\n",
+               HOSTDATA(shpnt)->synchronous ? "enabled" : "disabled");
+       SPRINTF("%d commands currently queued\n", HOSTDATA(shpnt)->commands);
+
+       if (HOSTDATA(shpnt)->synchronous) {
 #if 0
-    SPRINTF("synchronously operating targets (tick=%ld ns):\n",
-            250000000/loops_per_sec);
-    for(i=0; i<8; i++)
-      if(HOSTDATA(shpnt)->syncrate[i]&0x7f)
-        SPRINTF("target %d: period %dT/%ldns; req/ack offset %d\n",
-                i,
-                (((HOSTDATA(shpnt)->syncrate[i]&0x70)>>4)+2),
-                         (((HOSTDATA(shpnt)->syncrate[i]&0x70)>>4)+2)*
-                         250000000/loops_per_sec,
-                           HOSTDATA(shpnt)->syncrate[i]&0x0f);
+               SPRINTF("synchronously operating targets (tick=%ld ns):\n",
+                       250000000 / loops_per_sec);
+               for (i = 0; i < 8; i++)
+                       if (HOSTDATA(shpnt)->syncrate[i] & 0x7f)
+                               SPRINTF("target %d: period %dT/%ldns; req/ack offset %d\n",
+                                       i,
+                                       (((HOSTDATA(shpnt)->syncrate[i] & 0x70) >> 4) + 2),
+                                       (((HOSTDATA(shpnt)->syncrate[i] & 0x70) >> 4) + 2) *
+                                       250000000 / loops_per_sec,
+                                   HOSTDATA(shpnt)->syncrate[i] & 0x0f);
 #else
-    SPRINTF("synchronously operating targets (tick=50 ns):\n");
-    for(i=0; i<8; i++)
-      if(HOSTDATA(shpnt)->syncrate[i]&0x7f)
-        SPRINTF("target %d: period %dT/%dns; req/ack offset %d\n",
-                i,
-                (((HOSTDATA(shpnt)->syncrate[i]&0x70)>>4)+2),
-                (((HOSTDATA(shpnt)->syncrate[i]&0x70)>>4)+2)*50,
-                HOSTDATA(shpnt)->syncrate[i]&0x0f);
-#endif
-  }
-  
+               SPRINTF("synchronously operating targets (tick=50 ns):\n");
+               for (i = 0; i < 8; i++)
+                       if (HOSTDATA(shpnt)->syncrate[i] & 0x7f)
+                               SPRINTF("target %d: period %dT/%dns; req/ack offset %d\n",
+                                       i,
+                                       (((HOSTDATA(shpnt)->syncrate[i] & 0x70) >> 4) + 2),
+                                       (((HOSTDATA(shpnt)->syncrate[i] & 0x70) >> 4) + 2) * 50,
+                                   HOSTDATA(shpnt)->syncrate[i] & 0x0f);
+#endif
+       }
 #ifdef DEBUG_AHA152X
 #define PDEBUG(flags,txt) if(HOSTDATA(shpnt)->debug & flags) SPRINTF("(%s) ", txt);
-  
-  SPRINTF("enabled debugging options: ");
-  
-  PDEBUG(debug_skipports, "skip ports");
-  PDEBUG(debug_queue, "queue");
-  PDEBUG(debug_intr, "interrupt");
-  PDEBUG(debug_selection, "selection");
-  PDEBUG(debug_msgo, "message out");
-  PDEBUG(debug_msgi, "message in");
-  PDEBUG(debug_status, "status");
-  PDEBUG(debug_cmd, "command");
-  PDEBUG(debug_datai, "data in");
-  PDEBUG(debug_datao, "data out");
-  PDEBUG(debug_abort, "abort");
-  PDEBUG(debug_done, "done");
-  PDEBUG(debug_biosparam, "bios parameters");
-  PDEBUG(debug_phases, "phases");
-  PDEBUG(debug_queues, "queues");
-  PDEBUG(debug_reset, "reset");
-  
-  SPRINTF("\n");
-#endif
-  
-  SPRINTF("\nqueue status:\n");
-  if(ISSUE_SC) {
-    SPRINTF("not yet issued commands:\n");
-    for(ptr=ISSUE_SC; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
-      pos += get_command(pos, ptr);
-  } else 
-    SPRINTF("no not yet issued commands\n");
-  
-  if(CURRENT_SC) {
-    SPRINTF("current command:\n");
-    pos += get_command(pos, CURRENT_SC);
-  } else
-    SPRINTF("no current command\n");
-  
-  if(DISCONNECTED_SC) {
-    SPRINTF("disconnected commands:\n");
-    for(ptr=DISCONNECTED_SC; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
-      pos += get_command(pos, ptr);
-  } else
-    SPRINTF("no disconnected commands\n");
-  
-  restore_flags(flags);
-
-  pos += get_ports(shpnt, pos);
-  
-  *start=buffer+offset;
-  if (pos - buffer < offset)
-    return 0;
-  else if (pos - buffer - offset < length)
-    return pos - buffer - offset;
-  else
-    return length;
+
+       SPRINTF("enabled debugging options: ");
+
+       PDEBUG(debug_skipports, "skip ports");
+       PDEBUG(debug_queue, "queue");
+       PDEBUG(debug_intr, "interrupt");
+       PDEBUG(debug_selection, "selection");
+       PDEBUG(debug_msgo, "message out");
+       PDEBUG(debug_msgi, "message in");
+       PDEBUG(debug_status, "status");
+       PDEBUG(debug_cmd, "command");
+       PDEBUG(debug_datai, "data in");
+       PDEBUG(debug_datao, "data out");
+       PDEBUG(debug_abort, "abort");
+       PDEBUG(debug_done, "done");
+       PDEBUG(debug_biosparam, "bios parameters");
+       PDEBUG(debug_phases, "phases");
+       PDEBUG(debug_queues, "queues");
+       PDEBUG(debug_reset, "reset");
+
+       SPRINTF("\n");
+#endif
+
+       SPRINTF("\nqueue status:\n");
+       if (ISSUE_SC) {
+               SPRINTF("not yet issued commands:\n");
+               for (ptr = ISSUE_SC; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
+                       pos += get_command(pos, ptr);
+       } else
+               SPRINTF("no not yet issued commands\n");
+
+       if (CURRENT_SC) {
+               SPRINTF("current command:\n");
+               pos += get_command(pos, CURRENT_SC);
+       } else
+               SPRINTF("no current command\n");
+
+       if (DISCONNECTED_SC) {
+               SPRINTF("disconnected commands:\n");
+               for (ptr = DISCONNECTED_SC; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
+                       pos += get_command(pos, ptr);
+       } else
+               SPRINTF("no disconnected commands\n");
+
+       restore_flags(flags);
+
+       pos += get_ports(shpnt, pos);
+
+       *start = buffer + offset;
+       if (pos - buffer < offset)
+               return 0;
+       else if (pos - buffer - offset < length)
+               return pos - buffer - offset;
+       else
+               return length;
 }
 
 #ifdef MODULE
index a7b151a6e1b2895a40b767607746aab48f136949..45b79a567c0d4a8eae0d6e996b3c5fde870652be 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * linux/drivers/scsi/ide-scsi.c       Version 0.6             Jan  27, 1998
+ * linux/drivers/scsi/ide-scsi.c       Version 0.9             Jul   4, 1999
  *
- * Copyright (C) 1996 - 1998 Gadi Oxman <gadio@netvision.net.il>
+ * Copyright (C) 1996 - 1999 Gadi Oxman <gadio@netvision.net.il>
  */
 
 /*
  *                       Fix MODE_SENSE_6/MODE_SELECT_6/INQUIRY translation.
  * Ver 0.7   Dec 04 98   Ignore commands where lun != 0 to avoid multiple
  *                        detection of devices with CONFIG_SCSI_MULTI_LUN
- * Ver 0.8   Feb 05 99   Optical media need translation too. 
+ * Ver 0.8   Feb 05 99   Optical media need translation too. Reverse 0.7.
+ * Ver 0.9   Jul 04 99   Fix a bug in SG_SET_TRANSFORM.
  */
 
-#define IDESCSI_VERSION "0.6"
+#define IDESCSI_VERSION "0.9"
 
 #include <linux/module.h>
 #include <linux/types.h>
@@ -631,9 +632,13 @@ int idescsi_ioctl (Scsi_Device *dev, int cmd, void *arg)
 {
        ide_drive_t *drive = idescsi_drives[dev->id];
        idescsi_scsi_t *scsi = drive->driver_data;
+       int enable = (int) arg;
 
        if (cmd == SG_SET_TRANSFORM) {
-               set_bit(IDESCSI_SG_TRANSFORM, &scsi->transform);
+               if (enable)
+                       set_bit(IDESCSI_SG_TRANSFORM, &scsi->transform);
+               else
+                       clear_bit(IDESCSI_SG_TRANSFORM, &scsi->transform);
                return 0;
        } else if (cmd == SG_GET_TRANSFORM)
                return put_user(test_bit(IDESCSI_SG_TRANSFORM, &scsi->transform), (int *) arg);
index 22ab35f633bd668270cfb47771a95e9badfcad8a..0a83f14b20f77ed8e3f427f083e718dfccf9b326 100644 (file)
@@ -1050,6 +1050,7 @@ static void requeue_sd_request (Scsi_Cmnd * SCpnt)
 
     SCpnt->transfersize = rscsi_disks[dev].sector_size;
     SCpnt->underflow = this_count << 9;
+    SCpnt->cmd_len = 0;
     scsi_do_cmd (SCpnt, (void *) cmd, buff,
                 this_count * rscsi_disks[dev].sector_size,
                 rw_intr,
index 723e88aa108b49227c0934ce5b7334ad2aca20dc..c43ebf13071b6d33de9e6e04841610f242e9ed83 100644 (file)
  * ES1946      yes             This is a PCI chip; not handled by this driver
  */
 
-#include <linux/config.h>
 #include <linux/delay.h>
 
 #include "sound_config.h"
index 1c3b11199703bbef7b4afb7ec21f5cf811726b65..d3412e52c4558ac0ed8a50077ae96f42af72fd2b 100644 (file)
@@ -326,8 +326,8 @@ void coda_flag_inode_children(struct inode *inode, int flag)
        while ( alias != &inode->i_dentry ) {
                alias_de = list_entry(alias, struct dentry, d_alias);
                coda_flag_children(alias_de, flag);
-               shrink_dcache_parent(alias_de);
                alias = alias->next;
+               shrink_dcache_parent(alias_de);
        }
 
 }
index dd1e03f5feda3f9f8439ad04ef674b6c987cff6a..ffae7746ff44284f91a42b91d3d80657b891f805 100644 (file)
 extern int coda_debug;
 extern int coda_print_entry;
 
+inline int coda_fideq(ViceFid *fid1, ViceFid *fid2)
+{
+       if (fid1->Vnode != fid2->Vnode)
+               return 0;
+       if (fid1->Volume != fid2->Volume)
+               return 0;
+       if (fid1->Unique != fid2->Unique)
+               return 0;
+       return 1;
+}
+
 /* cnode.c */
 static void coda_fill_inode(struct inode *inode, struct coda_vattr *attr)
 {
@@ -71,8 +82,14 @@ int coda_cnode_make(struct inode **inode, ViceFid *fid, struct super_block *sb)
         }
 
        cnp = ITOC(*inode);
-       if  ( cnp->c_magic != 0 ) {
-               printk("coda_cnode make on initialized inode %ld, old %s new
+       /* see if we've got it already */
+       if  ( cnp->c_magic != 0 && coda_fideq(fid, &cnp->c_fid)) {
+               return 0;
+       }
+
+       /* not fresh: collision */
+       if  ( cnp->c_magic != 0 ) {
+               printk("coda_cnode_make on initialized inode %ld, old %s new
 %s!\n",
                       (*inode)->i_ino, coda_f2s(&cnp->c_fid), coda_f2s2(fid));
                iput(*inode);
@@ -106,14 +123,6 @@ int coda_cnode_make(struct inode **inode, ViceFid *fid, struct super_block *sb)
         return 0;
 }
 
-inline int coda_fideq(ViceFid *fid1, ViceFid *fid2)
-{
-       int eq;
-       eq =   ( (fid1->Vnode == fid2->Vnode) &&
-                (fid1->Volume == fid2->Volume) &&
-                (fid1->Unique == fid2->Unique) );
-       return eq;
-}
 
 void coda_replace_fid(struct inode *inode, struct ViceFid *oldfid, 
                      struct ViceFid *newfid)
index f684f3a78ca563f3fd114ea4c369b28a3d49cd6c..5f2f3c4674cee379599b799823c0d64e7f222fd9 100644 (file)
@@ -215,6 +215,8 @@ void coda_vattr_to_iattr(struct inode *inode, struct coda_vattr *attr)
         if (attr->va_ctime.tv_sec != -1)
                inode->i_ctime = attr->va_ctime.tv_sec;
 }
+
+
 /* 
  * BSD sets attributes that need not be modified to -1. 
  * Linux uses the valid field to indicate what should be
index 4313edb692c8cfed2e38f8e32e8f3dd0840dd4e6..10b1cb171d6656152e3f77a1c232e0ae908bff5b 100644 (file)
@@ -800,6 +800,10 @@ static int coda_dentry_revalidate(struct dentry *de, int flags)
 
        shrink_dcache_parent(de);
 
+       /* propagate for a flush */
+       if (cii->c_flags & C_FLUSH) 
+               coda_flag_inode_children(inode, C_FLUSH);
+
        if (de->d_count > 1) {
                /* pretend it's valid, but don't change the flags */
                CDEBUG(D_DOWNCALL, "BOOM for: ino %ld, %s\n",
@@ -807,10 +811,6 @@ static int coda_dentry_revalidate(struct dentry *de, int flags)
                return 1;
        }
 
-       /* propagate for a flush */
-       if (cii->c_flags & C_FLUSH) 
-               coda_flag_inode_children(inode, C_FLUSH);
-
        /* clear the flags. */
        cii->c_flags &= ~(C_VATTR | C_PURGE | C_FLUSH);
 
index bbcf8a85feffaeeab47e48d9a8c2f17b0c95a092..604e906a234ee4fe49f3e4a200961e9e9cf9f37c 100644 (file)
@@ -73,6 +73,9 @@ static struct super_block * coda_read_super(struct super_block *sb,
 
         if ( sbi->sbi_sb ) {
                printk("Already mounted\n");
+               unlock_super(sb);
+               EXIT;  
+               MOD_DEC_USE_COUNT;
                return NULL;
        }
 
@@ -96,7 +99,6 @@ static struct super_block * coda_read_super(struct super_block *sb,
                printk("coda_read_super: coda_get_rootfid failed with %d\n",
                       error);
                sb->s_dev = 0;
-               unlock_super(sb);
                goto error;
        }         
        printk("coda_read_super: rootfid is %s\n", coda_f2s(&fid));
@@ -106,7 +108,6 @@ static struct super_block * coda_read_super(struct super_block *sb,
         if ( error || !root ) {
            printk("Failure of coda_cnode_make for root: error %d\n", error);
            sb->s_dev = 0;
-           unlock_super(sb);
            goto error;
        } 
 
@@ -119,6 +120,7 @@ static struct super_block * coda_read_super(struct super_block *sb,
         return sb;
 
  error:
+       unlock_super(sb);
        EXIT;  
        MOD_DEC_USE_COUNT;
        if (sbi) {
@@ -143,7 +145,6 @@ static void coda_put_super(struct super_block *sb)
         sb->s_dev = 0;
        coda_cache_clear_all(sb);
        sb_info = coda_sbp(sb);
-/*     sb_info->sbi_vcomm->vc_inuse = 0; You can not do this: psdev_release would see usagecount == 0 and would refuse to decrease MOD_USE_COUNT --pavel */ 
        coda_super_info.sbi_sb = NULL;
        printk("Coda: Bye bye.\n");
        memset(sb_info, 0, sizeof(* sb_info));
@@ -207,7 +208,7 @@ static void coda_delete_inode(struct inode *inode)
        EXIT;
 }
 
-static int  coda_notify_change(struct dentry *de, struct iattr *iattr)
+static int coda_notify_change(struct dentry *de, struct iattr *iattr)
 {
        struct inode *inode = de->d_inode;
         struct coda_inode_info *cii;
@@ -236,21 +237,32 @@ static int  coda_notify_change(struct dentry *de, struct iattr *iattr)
         return error;
 }
 
-/*  we need _something_ for this routine. Let's mimic AFS */
 static int coda_statfs(struct super_block *sb, struct statfs *buf, 
                       int bufsiz)
 {
        struct statfs tmp;
+       int error;
+
+       memset(&tmp, 0, sizeof(struct statfs));
 
+       error = venus_statfs(sb, &tmp);
+
+       if (error) {
+               /* fake something like AFS does */
+               tmp.f_blocks = 9000000;
+               tmp.f_bfree  = 9000000;
+               tmp.f_bavail = 9000000;
+               tmp.f_files  = 9000000;
+               tmp.f_ffree  = 9000000;
+       }
+
+       /* and fill in the rest */
        tmp.f_type = CODA_SUPER_MAGIC;
        tmp.f_bsize = 1024;
-       tmp.f_blocks = 9000000;
-       tmp.f_bfree = 9000000;
-       tmp.f_bavail = 9000000 ;
-       tmp.f_files = 9000000;
-       tmp.f_ffree = 9000000;
-       tmp.f_namelen = 0;
+       tmp.f_namelen = CODA_MAXNAMLEN;
+
        copy_to_user(buf, &tmp, bufsiz);
+
        return 0; 
 }
 
index 79a4c7ebbdb673ccff110b0e5fe02f1dfa1261ce..e35174e5c160630c0ad0492232ff661d097c4f27 100644 (file)
@@ -71,6 +71,7 @@ struct coda_permission_stats  coda_permission_stat;
 struct coda_cache_inv_stats    coda_cache_inv_stat;
 struct coda_upcall_stats_entry  coda_upcall_stat[CODA_NCALLS];
 struct coda_upcallstats         coda_callstats;
+int                             coda_upcall_timestamping = 0;
 
 /* keep this in sync with coda.h! */
 char *coda_upcall_names[] = {
@@ -103,9 +104,12 @@ char *coda_upcall_names[] = {
        "purgeuser   ",   /* 26 */
        "zapfile     ",   /* 27 */
        "zapdir      ",   /* 28 */
-       "zapvnode    ",   /* 28 */
+       "noop2       ",   /* 29 */
        "purgefid    ",   /* 30 */
-       "open_by_path"    /* 31 */
+       "open_by_path",   /* 31 */
+       "resolve     ",   /* 32 */
+       "reintegrate ",   /* 33 */
+       "statfs      "    /* 34 */
 };
 
 
@@ -133,8 +137,7 @@ void reset_coda_cache_inv_stats( void )
 void do_time_stats( struct coda_upcall_stats_entry * pentry, 
                    unsigned long runtime )
 {
-       
-       unsigned long time = runtime * 1000 /HZ;        /* time in ms */
+       unsigned long time = runtime;   /* time in us */
        CDEBUG(D_SPECIAL, "time: %ld\n", time);
 
        if ( pentry->count == 0 ) {
@@ -221,9 +224,12 @@ int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
 {
        if ( write ) {
                reset_coda_vfs_stats();
+
+               filp->f_pos += *lenp;
+       } else {
+               *lenp = 0;
        }
-  
-       *lenp = 0;
+
        return 0;
 }
 
@@ -232,10 +238,19 @@ int do_reset_coda_upcall_stats( ctl_table * table, int write,
                                size_t * lenp )
 {
        if ( write ) {
+               if (*lenp > 0) {
+                       char c;
+                       if (get_user(c, (char *)buffer))
+                               return -EFAULT;
+                        coda_upcall_timestamping = (c == '1');
+                }
                reset_coda_upcall_stats();
+
+               filp->f_pos += *lenp;
+       } else {
+               *lenp = 0;
        }
-  
-       *lenp = 0;
+
        return 0;
 }
 
@@ -245,9 +260,12 @@ int do_reset_coda_permission_stats( ctl_table * table, int write,
 {
        if ( write ) {
                reset_coda_permission_stats();
+
+               filp->f_pos += *lenp;
+       } else {
+               *lenp = 0;
        }
-  
-       *lenp = 0;
+
        return 0;
 }
 
@@ -257,9 +275,12 @@ int do_reset_coda_cache_inv_stats( ctl_table * table, int write,
 {
        if ( write ) {
                reset_coda_cache_inv_stats();
+
+               filp->f_pos += *lenp;
+       } else {
+               *lenp = 0;
        }
   
-       *lenp = 0;
        return 0;
 }
 
@@ -347,12 +368,12 @@ int coda_upcall_stats_get_info( char * buffer, char ** start, off_t offset,
        if ( offset < 160) 
                len += sprintf( buffer + len,"%-79s\n", "======================");
        if ( offset < 240) 
-               len += sprintf( buffer + len,"%-79s\n", "upcall\t\t    count\tavg time(ms)\tstd deviation(ms)");
+               len += sprintf( buffer + len,"%-79s\n", "upcall              count       avg time(us)    std deviation(us)");
        if ( offset < 320) 
-               len += sprintf( buffer + len,"%-79s\n", "------\t\t    -----\t------------\t-----------------");
+               len += sprintf( buffer + len,"%-79s\n", "------              -----       ------------    -----------------");
        pos = 320; 
        for ( i = 0 ; i < CODA_NCALLS ; i++ ) {
-               tmplen += sprintf(tmpbuf,"%s\t%9d\t%10ld\t%10ld", 
+               tmplen += sprintf(tmpbuf,"%s    %9d       %10ld      %10ld", 
                                  coda_upcall_names[i],
                                  coda_upcall_stat[i].count, 
                                  get_time_average(&coda_upcall_stat[i]),
@@ -499,6 +520,7 @@ static void coda_proc_modcount(struct inode *inode, int fill)
                MOD_INC_USE_COUNT;
        else
                MOD_DEC_USE_COUNT;
+                       
 }
 
 #endif
index a0c1092b28758bcbfd30d1c424234af7f0f244d0..62fd62e352ab50622d1b6f02cb5e6614f409663d 100644 (file)
@@ -580,6 +580,33 @@ int venus_pioctl(struct super_block *sb, struct ViceFid *fid,
        return error;
 }
 
+int venus_statfs(struct super_block *sb, struct statfs *sfs) 
+{ 
+        union inputArgs *inp;
+        union outputArgs *outp;
+        int insize, outsize, error;
+        
+       insize = max(INSIZE(statfs), OUTSIZE(statfs));
+       UPARG(CODA_STATFS);
+
+        error =  coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+       
+        if (!error) {
+               sfs->f_blocks = outp->coda_statfs.stat.f_blocks;
+               sfs->f_bfree  = outp->coda_statfs.stat.f_bfree;
+               sfs->f_bavail = outp->coda_statfs.stat.f_bavail;
+               sfs->f_files  = outp->coda_statfs.stat.f_files;
+               sfs->f_ffree  = outp->coda_statfs.stat.f_ffree;
+       } else {
+               printk("coda_statfs: Venus returns: %d\n", error);
+       }
+
+        if (inp) CODA_FREE(inp, insize);
+        CDEBUG(D_INODE, " result %d\n",error);
+        EXIT;
+        return error;
+}
+
 /*
  * coda_upcall and coda_downcall routines.
  * 
@@ -588,10 +615,12 @@ int venus_pioctl(struct super_block *sb, struct ViceFid *fid,
 static inline unsigned long coda_waitfor_upcall(struct upc_req *vmp)
 {
        DECLARE_WAITQUEUE(wait, current);
-       unsigned long posttime;
+       struct timeval begin = { 0, 0 }, end = { 0, 0 };
 
        vmp->uc_posttime = jiffies;
-       posttime = jiffies;
+
+       if (coda_upcall_timestamping)
+               do_gettimeofday(&begin);
 
        add_wait_queue(&vmp->uc_sleep, &wait);
        for (;;) {
@@ -620,9 +649,20 @@ static inline unsigned long coda_waitfor_upcall(struct upc_req *vmp)
        remove_wait_queue(&vmp->uc_sleep, &wait);
        current->state = TASK_RUNNING;
 
-       CDEBUG(D_SPECIAL, "posttime: %ld, returned: %ld\n", posttime, jiffies-posttime);
-       return  (jiffies - posttime);
+       if (coda_upcall_timestamping && begin.tv_sec != 0) {
+               do_gettimeofday(&end);
+
+               if (end.tv_usec < begin.tv_usec) {
+                       end.tv_usec += 1000000; end.tv_sec--;
+               }
+               end.tv_sec  -= begin.tv_sec;
+               end.tv_usec -= begin.tv_usec;
+       }
+
+       CDEBUG(D_SPECIAL, "begin: %ld.%06ld, elapsed: %ld.%06ld\n",
+               begin.tv_sec, begin.tv_usec, end.tv_sec, end.tv_usec);
 
+       return  ((end.tv_sec * 1000000) + end.tv_usec);
 }
 
 
index 594baa0e2dc77bbd8d3734757573ed640f37123b..82d29a0dfd5c88a9ca3841d3fdeecb214ab4d0d5 100644 (file)
@@ -295,6 +295,8 @@ static int fat_readdirx(
        char bufname[14];
        char *ptname = bufname;
        int dotoffset = 0;
+       unsigned long *furrfu = &lpos;
+       unsigned long dummy;
 
        cpos = filp->f_pos;
 /* Fake . and .. for the root directory. */
@@ -305,8 +307,11 @@ static int fat_readdirx(
                        cpos++;
                        filp->f_pos++;
                }
-               if (cpos == 2)
+               if (cpos == 2) {
+                       dummy = 2;
+                       furrfu = &dummy;
                        cpos = 0;
+               }
        }
        if (cpos & (sizeof(struct msdos_dir_entry)-1))
                return -ENOENT;
@@ -440,7 +445,7 @@ ParseLong:
        if (!long_slots||shortnames) {
                if (both)
                        bufname[i] = '\0';
-               if (filldir(dirent, bufname, i, lpos, inum) < 0)
+               if (filldir(dirent, bufname, i, *furrfu, inum) < 0)
                        goto FillFailed;
        } else {
                char longname[275];
@@ -451,11 +456,12 @@ ParseLong:
                        memcpy(&longname[long_len+1], bufname, i);
                        long_len += i;
                }
-               if (filldir(dirent, longname, long_len, lpos, inum) < 0)
+               if (filldir(dirent, longname, long_len, *furrfu, inum) < 0)
                        goto FillFailed;
        }
 
 RecEnd:
+       furrfu = &lpos;
        filp->f_pos = cpos;
        goto GetNew;
 EODir:
index 6683c393cc6487abc9ece8bac4cd7fbb6fe33a90..9eab1fb176c73293f8c23fc06e5746664cfe8309 100644 (file)
@@ -24,7 +24,6 @@
 #define MAX(a,b) (((a)>(b))?(a):(b))
 
 #include <linux/fs.h>
-#include <linux/minix_fs.h>
 
 /*
  * Write to a file (through the page cache).
index 843f6b23eae8bbab223ab1e851ad9e6df6b8e151..899b62c8219307782fa17d34ce08fb1ccc95a173 100644 (file)
@@ -90,8 +90,9 @@ nfs_readpage_sync(struct dentry *dentry, struct inode *inode, struct page *page)
 
                /* Set up arguments and perform rpc call */
                nfs_readreq_setup(&rqst, NFS_FH(dentry), offset, buffer, rsize);
-               result = rpc_call(NFS_CLIENT(inode), NFSPROC_READ,
-                                       &rqst.ra_args, &rqst.ra_res, flags);
+               lock_kernel();
+               result = rpc_call(NFS_CLIENT(inode), NFSPROC_READ, &rqst.ra_args, &rqst.ra_res, flags);
+               unlock_kernel();
 
                /*
                 * Even if we had a partial success we can't mark the page
index b7c955c79d690d2b85efedca86a86fc2dc316f3e..2303ca32849897cd7fcdcf0f0266e5d1788195a2 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -27,7 +27,7 @@
 /* Florian Coosmann (FGC)                                ^ current = 1       */
 /* Additionally, we now use locking technique. This prevents race condition  */
 /* in case of paging and multiple read/write on the same pipe. (FGC)         */
-
+/* Reads with count = 0 should always return 0. Julian Bradfield 1999-06-07. */
 
 static ssize_t do_pipe_read(struct file * filp, char * buf, size_t count)
 {
@@ -144,9 +144,12 @@ static ssize_t pipe_read(struct file * filp, char * buf, size_t count, loff_t *p
 {
        ssize_t retval;
 
+
        if (ppos != &filp->f_pos)
                return -ESPIPE;
 
+       if ( !count ) return 0;
+
        lock_kernel();
        retval = do_pipe_read(filp, buf, count);
        unlock_kernel();
index ac3301c8a1cc6e74179ace3fd3f170b1ad6d517f..8cb3ff46b25b2d76fd5353188fdf4e0f788b9823 100644 (file)
@@ -100,22 +100,35 @@ typedef unsigned long long u_quad_t;
 
 #if defined(__linux__)
 #define cdev_t u_quad_t
+#ifndef __KERNEL__
 #if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
 #define _UQUAD_T_ 1
 typedef unsigned long long u_quad_t;
 #endif
+#else /*__KERNEL__ */
+typedef unsigned long long u_quad_t;
+#endif /* __KERNEL__ */
 #else
 #define cdev_t dev_t
 #endif
 
 #ifdef __CYGWIN32__
-typedef unsigned char u_int8_t;
 struct timespec {
         time_t  tv_sec;         /* seconds */
         long    tv_nsec;        /* nanoseconds */
 };
 #endif
 
+#ifndef __BIT_TYPES_DEFINED__
+#define __BIT_TYPES_DEFINED__
+typedef signed char          int8_t;
+typedef unsigned char      u_int8_t;
+typedef short               int16_t;
+typedef unsigned short    u_int16_t;
+typedef int                 int32_t;
+typedef unsigned int      u_int32_t;
+#endif
+
 
 /*
  * Cfs constants
@@ -151,8 +164,8 @@ struct timespec {
 struct venus_dirent {
         unsigned long  d_fileno;               /* file number of entry */
         unsigned short d_reclen;               /* length of this record */
-        char           d_type;                 /* file type, see below */
-        char           d_namlen;               /* length of string in d_name */
+        unsigned char  d_type;                 /* file type, see below */
+        unsigned char  d_namlen;               /* length of string in d_name */
         char           d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
 };
 #undef DIRSIZ
@@ -215,11 +228,6 @@ static __inline__ ino_t  coda_f2i(struct ViceFid *fid)
 #endif
 
 
-#ifndef __BIT_TYPES_DEFINED__
-#define u_int32_t unsigned int
-#endif
-
-
 #ifndef _VUID_T_
 #define _VUID_T_
 typedef u_int32_t vuid_t;
@@ -229,12 +237,8 @@ typedef u_int32_t vgid_t;
 #ifndef _CODACRED_T_
 #define _CODACRED_T_
 struct coda_cred {
-       vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid;
-       vgid_t cr_groupid,     cr_egid, cr_sgid, cr_fsgid;
-#if   defined(CODA_SUPPORTS_SUPPLEMENTARY_GROUPS)
-       int    cr_nsupgps;
-       vgid_t cr_supgps[NGROUPS];
-#endif        /* defined(CODA_SUPPORTS_SUPPLEMENTARY_GROUPS) */
+    vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, efftve, set, fs uid*/
+    vgid_t cr_groupid,     cr_egid, cr_sgid, cr_fsgid; /* same for groups */
 };
 #endif 
 
@@ -246,7 +250,7 @@ struct coda_cred {
 enum coda_vtype        { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
 
 struct coda_vattr {
-       int             va_type;        /* vnode type (for create) */
+       long            va_type;        /* vnode type (for create) */
        u_short         va_mode;        /* files access mode and type */
        short           va_nlink;       /* number of references to file */
        vuid_t          va_uid;         /* owner user id */
@@ -266,6 +270,15 @@ struct coda_vattr {
 
 #endif 
 
+/* structure used by CODA_STATFS for getting cache information from venus */
+struct coda_statfs {
+    int32_t f_blocks;
+    int32_t f_bfree;
+    int32_t f_bavail;
+    int32_t f_files;
+    int32_t f_ffree;
+};
+
 /*
  * Kernel <--> Venus communications.
  */
@@ -301,7 +314,8 @@ struct coda_vattr {
 #define CODA_OPEN_BY_PATH 31
 #define CODA_RESOLVE     32
 #define CODA_REINTEGRATE 33
-#define CODA_NCALLS 34
+#define CODA_STATFS     34
+#define CODA_NCALLS 35
 
 #define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
 
@@ -675,6 +689,16 @@ struct coda_open_by_path_out {
        int path;
 };
 
+/* coda_statfs: NO_IN */
+struct coda_statfs_in {
+    struct coda_in_hdr in;
+};
+
+struct coda_statfs_out {
+    struct coda_out_hdr oh;
+    struct coda_statfs stat;
+};
+
 /* 
  * Occasionally, we don't cache the fid returned by CODA_LOOKUP. 
  * For instance, if the fid is inconsistent. 
@@ -704,7 +728,8 @@ union inputArgs {
     struct coda_inactive_in coda_inactive;
     struct coda_vget_in coda_vget;
     struct coda_rdwr_in coda_rdwr;
-       struct coda_open_by_path_in coda_open_by_path;
+    struct coda_open_by_path_in coda_open_by_path;
+    struct coda_statfs_in coda_statfs;
 };
 
 union outputArgs {
@@ -726,7 +751,8 @@ union outputArgs {
     struct coda_purgefid_out coda_purgefid;
     struct coda_rdwr_out coda_rdwr;
     struct coda_replace_out coda_replace;
-       struct coda_open_by_path_out coda_open_by_path;
+    struct coda_open_by_path_out coda_open_by_path;
+    struct coda_statfs_out coda_statfs;
 };    
 
 union coda_downcalls {
@@ -752,20 +778,11 @@ struct ViceIoctl {
         short out_size;         /* Maximum size of output buffer, <= 2K */
 };
 
-#if defined(__CYGWIN32__) || defined(DJGPP)
 struct PioctlData {
-       unsigned long cmd;
         const char *path;
         int follow;
         struct ViceIoctl vi;
 };
-#else
-struct PioctlData {
-        const char *path;
-        int follow;
-        struct ViceIoctl vi;
-};
-#endif
 
 #define        CODA_CONTROL            ".CONTROL"
 #define CODA_CONTROLLEN           8
index c86a588edcd431f8b0f337aa53da8272a8747428..7c4ca8a0468803d6dbe740458a8c7fb63b8bd1a1 100644 (file)
@@ -98,6 +98,7 @@ struct coda_cache_inv_stats
 extern struct coda_vfs_stats           coda_vfs_stat;
 extern struct coda_permission_stats    coda_permission_stat;
 extern struct coda_cache_inv_stats     coda_cache_inv_stat;
+extern int                             coda_upcall_timestamping;
 
 /* reset statistics to 0 */
 void reset_coda_vfs_stats( void );
index 77d2c4ebe37f943d871cc5715fcff04119749fd5..f23a8e9b9c82fdcdda3ee5b3ed6d763bb9d5dffd 100644 (file)
@@ -80,6 +80,7 @@ int venus_pioctl(struct super_block *sb, struct ViceFid *fid,
                 unsigned int cmd, struct PioctlData *data);
 int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
 int venus_fsync(struct super_block *sb, struct ViceFid *fid);
+int venus_statfs(struct super_block *sb, struct statfs *sfs);
 
 
 /* messages between coda filesystem in kernel and Venus */
index 2c127526cd35a517576bc18bd17db64041437dba..c1c79c96e73d8c217420f56aaf1f8134b9780201 100644 (file)
@@ -517,7 +517,7 @@ struct cyclades_card {
     int num_chips;     /* 0 if card absent, -1 if Z/PCI, else Y */
     int first_line;    /* minor number of first channel on card */
     int bus_index;     /* address shift - 0 for ISA, 1 for PCI */
-    int        inact_ctrl;     /* FW Inactivity control - 0 disabled, 1 enabled */
+    int        intr_enabled;   /* FW Interrupt flag - 0 disabled, 1 enabled */
 };
 
 struct cyclades_chip {
diff --git a/include/linux/isdn_timru.h b/include/linux/isdn_timru.h
deleted file mode 100644 (file)
index 361dbbe..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/* isdn_timru.h
- *
- * Linux ISDN subsystem, timeout-rules for network interfaces.
- *
- * Copyright 1997       by Christian Lademann <cal@zls.de>
- * 
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- */
-
-/*
-02.06.97:cal:ISDN_TIMRU_PACKET_NONE def., ISDN_TIMRU_PACKET_* inkr.
-*/
-
-#ifndef __isdn_timru_h__
-#define __isdn_timru_h__
-
-#define        ISDN_TIMRU_PACKET_NONE          0
-#define        ISDN_TIMRU_PACKET_SKB           1
-#define        ISDN_TIMRU_PACKET_PPP           2
-#define        ISDN_TIMRU_PACKET_PPP_NO_HEADER 3
-
-#define        ISDN_TIMRU_BRINGUP              0
-#define        ISDN_TIMRU_KEEPUP_IN            1
-#define        ISDN_TIMRU_KEEPUP_OUT           2
-#define        ISDN_TIMRU_BRINGDOWN            3
-#define        ISDN_TIMRU_NUM_CHECK            4
-
-#define        ISDN_TIMRU_PROTFAM_WILDCARD     0
-#define        ISDN_TIMRU_PROTFAM_IP           1
-#define        ISDN_TIMRU_PROTFAM_PPP          2
-#define        ISDN_TIMRU_PROTFAM_IPX          3
-#define        ISDN_TIMRU_NUM_PROTFAM          4
-
-#define        ISDN_TIMRU_IP_WILDCARD          0
-#define        ISDN_TIMRU_IP_ICMP              1
-#define        ISDN_TIMRU_IP_TCP               2
-#define        ISDN_TIMRU_IP_UDP               3
-
-#define        ISDN_TIMRU_PPP_WILDCARD         0
-#define        ISDN_TIMRU_PPP_IPCP             1
-#define        ISDN_TIMRU_PPP_IPXCP            2
-#define        ISDN_TIMRU_PPP_CCP              3
-#define        ISDN_TIMRU_PPP_LCP              4
-#define        ISDN_TIMRU_PPP_PAP              5
-#define        ISDN_TIMRU_PPP_LQR              6
-#define        ISDN_TIMRU_PPP_CHAP             7
-
-typedef struct {
-       struct in_addr  saddr,          /* Source Address */
-                       smask,          /* Source Subnetmask */
-                       daddr,          /* Dest. Address */
-                       dmask;          /* Dest. Subnetmask */
-       ushort          protocol;       /* TCP, UDP, ... */
-       union {
-               struct {
-                       __u16   s_from, /* Source Port */
-                               s_to,
-                               d_from,
-                               d_to;
-               }               port;
-               struct {
-                       __u8    from,   /* ICMP-Type */
-                               to;
-               }               type;
-       }               pt;
-}      isdn_timeout_rule_ip;
-
-
-typedef struct {
-       ushort          protocol;       /* IPCP, LCP, ... */
-}      isdn_timeout_rule_ppp;
-
-
-typedef struct isdn_timeout_rule_s {
-       struct isdn_timeout_rule_s      *next,          /* Pointer to next rule */
-                                       *prev;          /* Pointer to previous rule */
-       ushort                          type,           /* BRINGUP, KEEPUP_*, ... */
-                                       neg;
-       int                             timeout;        /* Timeout value */
-       ushort                          protfam;        /* IP, IPX, PPP, ... */
-       union {
-               isdn_timeout_rule_ip    ip;     /* IP-Rule */
-               isdn_timeout_rule_ppp   ppp;    /* PPP-Rule */
-       }                               rule;   /* Prot.-specific rule */
-}      isdn_timeout_rule;
-
-
-typedef struct {
-       char                    name [9];       /* Interface */
-       int                     where,          /* 0/1: add to start/end of list, -1: handle default */
-                               type,
-                               protfam,
-                               index,
-                               defval;
-       isdn_timeout_rule       rule;           /* Rule */
-}      isdn_ioctl_timeout_rule;
-
-#ifdef __KERNEL__
-extern int     isdn_net_recalc_timeout(int, int, struct device *, void *, ulong);
-extern int     isdn_timru_alloc_timeout_rules(struct device *);
-extern int     isdn_timru_ioctl_add_rule(isdn_ioctl_timeout_rule *);
-extern int     isdn_timru_ioctl_del_rule(isdn_ioctl_timeout_rule *);
-extern int     isdn_timru_ioctl_get_rule(isdn_ioctl_timeout_rule *);
-#endif /* __KERNEL__ */
-
-#endif /* __isdn_timru_h__ */
index 7e7ccb266cb60d3f0aec7b33fa7de8d30463ba8d..423119f0911d13d5f6fa1a9221515292876e538f 100644 (file)
@@ -21,7 +21,7 @@ struct quota_mount_options
        struct file *files[MAXQUOTAS];          /* fp's to quotafiles */
        time_t inode_expire[MAXQUOTAS];         /* expiretime for inode-quota */
        time_t block_expire[MAXQUOTAS];         /* expiretime for block-quota */
-       char rsquash[MAXQUOTAS];                /* for quotas threath root as any other user */
+       char rsquash[MAXQUOTAS];                /* for quotas treat root as any other user */
 };
 
 struct vfsmount
index 2a99321481299c602c06e7ae7bd1655629f8fb43..25700218c2672e4feb29c0741964d91c813b889f 100644 (file)
 #define PCI_CLASS_SERIAL_USB           0x0c03
 #define PCI_CLASS_SERIAL_FIBER         0x0c04
 
+#define PCI_BASE_CLASS_INTELLIGENT     0x0e
+#define PCI_CLASS_INTELLIGENT_I2O      0x0e00
+
 #define PCI_CLASS_HOT_SWAP_CONTROLLER  0xff00
 
 #define PCI_CLASS_OTHERS               0xff
 #define PCI_DEVICE_ID_NCR_53C895       0x000c
 #define PCI_DEVICE_ID_NCR_53C885       0x000d
 #define PCI_DEVICE_ID_NCR_53C875       0x000f
+#define PCI_DEVICE_ID_NCR_53C1510      0x0010
 #define PCI_DEVICE_ID_NCR_53C875J      0x008f
 
 #define PCI_VENDOR_ID_ATI              0x1002
 #define PCI_DEVICE_ID_DEC_21152                0x0024
 #define PCI_DEVICE_ID_DEC_21153                0x0025
 #define PCI_DEVICE_ID_DEC_21154                0x0026
+#define PCI_DEVICE_ID_COMPAQ_42XX      0x0046
 
 #define PCI_VENDOR_ID_CIRRUS           0x1013
 #define PCI_DEVICE_ID_CIRRUS_7548      0x0038
 
 #define PCI_VENDOR_ID_AMD              0x1022
 #define PCI_DEVICE_ID_AMD_LANCE                0x2000
+#define PCI_DEVICE_ID_AMD_LANCE_HOME   0x2001
 #define PCI_DEVICE_ID_AMD_SCSI         0x2020
 
 #define PCI_VENDOR_ID_TRIDENT          0x1023
 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128V 0x0002
 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZV 0x0003
 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2160 0x0004
+#define PCI_DEVICE_ID_NEOMAGIC_MAGICMEDIA_256AV       0x0005
+#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZVPLUS   0x0083
 
 #define PCI_VENDOR_ID_ASP              0x10cd
 #define PCI_DEVICE_ID_ASP_ABP940       0x1200
 #define PCI_VENDOR_ID_GALILEO          0x11ab
 #define PCI_DEVICE_ID_GALILEO_GT64011  0x4146
 
+#define PCI_VENDOR_ID_GALILEO          0x11ab
+#define PCI_DEVICE_ID_GALILEO_GT64011  0x4146
+
 #define PCI_VENDOR_ID_LITEON           0x11ad
 #define PCI_DEVICE_ID_LITEON_LNE100TX  0x0002
 
 
 #define PCI_VENDOR_ID_ENSONIQ          0x1274
 #define PCI_DEVICE_ID_ENSONIQ_AUDIOPCI 0x5000
+#define PCI_DEVICE_ID_ENSONIQ_ES1371    0x1371
 
 #define PCI_VENDOR_ID_ALTEON           0x12ae
 #define PCI_DEVICE_ID_ALTEON_ACENIC    0x0001
 #define PCI_DEVICE_ID_GENROCO_HFP832   0x0003
 
 #define PCI_VENDOR_ID_INTEL            0x8086
+#define PCI_DEVICE_ID_INTEL_21145      0x0039
 #define PCI_DEVICE_ID_INTEL_82375      0x0482
 #define PCI_DEVICE_ID_INTEL_82424      0x0483
 #define PCI_DEVICE_ID_INTEL_82378      0x0484
 #define PCI_VENDOR_ID_ADAPTEC          0x9004
 #define PCI_DEVICE_ID_ADAPTEC_7810     0x1078
 #define PCI_DEVICE_ID_ADAPTEC_7821     0x2178
+#define PCI_DEVICE_ID_ADAPTEC_38602    0x3860
 #define PCI_DEVICE_ID_ADAPTEC_7850     0x5078
 #define PCI_DEVICE_ID_ADAPTEC_7855     0x5578
 #define PCI_DEVICE_ID_ADAPTEC_5800     0x5800
index 7ce68148766784bd3e7c2412789ceb9c0b49486b..668c6c99ffb37b4a27f48af989986211f837c832 100644 (file)
@@ -1475,7 +1475,7 @@ static int filemap_write_page(struct vm_area_struct * vma,
         * If a task terminates while we're swapping the page, the vma and
         * and file could be released ... increment the count to be safe.
         */
-       atomic_inc(&file->f_count);
+       get_file(file);
        result = do_write_page(inode, file, (const char *) page, offset);
        fput(file);
        return result;
index ce9c722c406e8b857ecce92718da11db0baaa102..b65da93acb4724a0e6501601e261aff986ff1825 100644 (file)
@@ -322,7 +322,7 @@ static inline void forget_pte(pte_t page)
        }
 }
 
-static inline int zap_pte_range(pmd_t * pmd, unsigned long address, unsigned long size)
+static inline int zap_pte_range(struct mm_struct *mm, pmd_t * pmd, unsigned long address, unsigned long size)
 {
        pte_t * pte;
        int freed;
@@ -344,18 +344,20 @@ static inline int zap_pte_range(pmd_t * pmd, unsigned long address, unsigned lon
                pte_t page;
                if (!size)
                        break;
+               spin_lock(&mm->page_table_lock);
                page = *pte;
                pte++;
                size--;
+               pte_clear(pte-1);
+               spin_unlock(&mm->page_table_lock);
                if (pte_none(page))
                        continue;
-               pte_clear(pte-1);
                freed += free_pte(page);
        }
        return freed;
 }
 
-static inline int zap_pmd_range(pgd_t * dir, unsigned long address, unsigned long size)
+static inline int zap_pmd_range(struct mm_struct *mm, pgd_t * dir, unsigned long address, unsigned long size)
 {
        pmd_t * pmd;
        unsigned long end;
@@ -375,7 +377,7 @@ static inline int zap_pmd_range(pgd_t * dir, unsigned long address, unsigned lon
                end = PGDIR_SIZE;
        freed = 0;
        do {
-               freed += zap_pte_range(pmd, address, end - address);
+               freed += zap_pte_range(mm, pmd, address, end - address);
                address = (address + PMD_SIZE) & PMD_MASK; 
                pmd++;
        } while (address < end);
@@ -393,7 +395,7 @@ void zap_page_range(struct mm_struct *mm, unsigned long address, unsigned long s
 
        dir = pgd_offset(mm, address);
        while (address < end) {
-               freed += zap_pmd_range(dir, address, end - address);
+               freed += zap_pmd_range(mm, dir, address, end - address);
                address = (address + PGDIR_SIZE) & PGDIR_MASK;
                dir++;
        }
index 7947031af1a6f50cacc175c93c16cbd8e830f3c3..d6b19cfb1a963a0ae886739c4119e980ae5e4f2a 100644 (file)
@@ -31,7 +31,7 @@ static inline int mlock_fixup_start(struct vm_area_struct * vma,
        vma->vm_offset += vma->vm_start - n->vm_start;
        n->vm_flags = newflags;
        if (n->vm_file)
-               atomic_inc(&n->vm_file->f_count);
+               get_file(n->vm_file);
        if (n->vm_ops && n->vm_ops->open)
                n->vm_ops->open(n);
        insert_vm_struct(current->mm, n);
@@ -52,7 +52,7 @@ static inline int mlock_fixup_end(struct vm_area_struct * vma,
        n->vm_offset += n->vm_start - vma->vm_start;
        n->vm_flags = newflags;
        if (n->vm_file)
-               atomic_inc(&n->vm_file->f_count);
+               get_file(n->vm_file);
        if (n->vm_ops && n->vm_ops->open)
                n->vm_ops->open(n);
        insert_vm_struct(current->mm, n);
@@ -179,7 +179,6 @@ asmlinkage int sys_mlock(unsigned long start, size_t len)
        int error = -ENOMEM;
 
        down(&current->mm->mmap_sem);
-       lock_kernel();
        len = (len + (start & ~PAGE_MASK) + ~PAGE_MASK) & PAGE_MASK;
        start &= PAGE_MASK;
 
@@ -200,7 +199,6 @@ asmlinkage int sys_mlock(unsigned long start, size_t len)
 
        error = do_mlock(start, len, 1);
 out:
-       unlock_kernel();
        up(&current->mm->mmap_sem);
        return error;
 }
@@ -210,11 +208,9 @@ asmlinkage int sys_munlock(unsigned long start, size_t len)
        int ret;
 
        down(&current->mm->mmap_sem);
-       lock_kernel();
        len = (len + (start & ~PAGE_MASK) + ~PAGE_MASK) & PAGE_MASK;
        start &= PAGE_MASK;
        ret = do_mlock(start, len, 0);
-       unlock_kernel();
        up(&current->mm->mmap_sem);
        return ret;
 }
@@ -254,7 +250,6 @@ asmlinkage int sys_mlockall(int flags)
        int ret = -EINVAL;
 
        down(&current->mm->mmap_sem);
-       lock_kernel();
        if (!flags || (flags & ~(MCL_CURRENT | MCL_FUTURE)))
                goto out;
 
@@ -272,7 +267,6 @@ asmlinkage int sys_mlockall(int flags)
 
        ret = do_mlockall(flags);
 out:
-       unlock_kernel();
        up(&current->mm->mmap_sem);
        return ret;
 }
@@ -282,9 +276,7 @@ asmlinkage int sys_munlockall(void)
        int ret;
 
        down(&current->mm->mmap_sem);
-       lock_kernel();
        ret = do_mlockall(0);
-       unlock_kernel();
        up(&current->mm->mmap_sem);
        return ret;
 }
index 84a9140970785a45f8a77e84882d53fbc8ca2b11..61826cfa222e845ebfae9cc6c93df26e8f10890b 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -315,7 +315,7 @@ unsigned long do_mmap(struct file * file, unsigned long addr, unsigned long len,
                if (error)
                        goto unmap_and_free_vma;
                vma->vm_file = file;
-               atomic_inc(&file->f_count);
+               get_file(file);
        }
 
        /*
@@ -549,7 +549,7 @@ static struct vm_area_struct * unmap_fixup(struct vm_area_struct *area,
                mpnt->vm_file = area->vm_file;
                mpnt->vm_pte = area->vm_pte;
                if (mpnt->vm_file)
-                       atomic_inc(&mpnt->vm_file->f_count);
+                       get_file(mpnt->vm_file);
                if (mpnt->vm_ops && mpnt->vm_ops->open)
                        mpnt->vm_ops->open(mpnt);
                area->vm_end = addr;    /* Truncate area */
@@ -680,9 +680,9 @@ int do_munmap(unsigned long addr, size_t len)
                size = end - st;
 
                lock_kernel();
-
                if (mpnt->vm_ops && mpnt->vm_ops->unmap)
                        mpnt->vm_ops->unmap(mpnt, st, size);
+               unlock_kernel();
 
                remove_shared_vm_struct(mpnt);
                mm->map_count--;
@@ -695,8 +695,6 @@ int do_munmap(unsigned long addr, size_t len)
                 * Fix the mapping, and free the old area if it wasn't reused.
                 */
                extra = unmap_fixup(mpnt, st, size, extra);
-
-               unlock_kernel();
        }
 
        /* Release the extra vma struct if it wasn't used */
@@ -789,10 +787,8 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
        flags = vma->vm_flags;
        addr = vma->vm_start;
 
-       lock_kernel();          /* kswapd, ugh */
        insert_vm_struct(mm, vma);
        merge_segments(mm, vma->vm_start, vma->vm_end);
-       unlock_kernel();
        
        mm->total_vm += len >> PAGE_SHIFT;
        if (flags & VM_LOCKED) {
index 14073c0faa9a3666e2d00f08eb2499b569b1b257..b1504af83dec66b403b24a8a445421d2785fc3be 100644 (file)
@@ -103,7 +103,7 @@ static inline int mprotect_fixup_start(struct vm_area_struct * vma,
        n->vm_flags = newflags;
        n->vm_page_prot = prot;
        if (n->vm_file)
-               atomic_inc(&n->vm_file->f_count);
+               get_file(n->vm_file);
        if (n->vm_ops && n->vm_ops->open)
                n->vm_ops->open(n);
        insert_vm_struct(current->mm, n);
@@ -126,7 +126,7 @@ static inline int mprotect_fixup_end(struct vm_area_struct * vma,
        n->vm_flags = newflags;
        n->vm_page_prot = prot;
        if (n->vm_file)
-               atomic_inc(&n->vm_file->f_count);
+               get_file(n->vm_file);
        if (n->vm_ops && n->vm_ops->open)
                n->vm_ops->open(n);
        insert_vm_struct(current->mm, n);
@@ -212,7 +212,6 @@ asmlinkage int sys_mprotect(unsigned long start, size_t len, unsigned long prot)
                return 0;
 
        down(&current->mm->mmap_sem);
-       lock_kernel();
 
        vma = find_vma(current->mm, start);
        error = -EFAULT;
@@ -249,7 +248,6 @@ asmlinkage int sys_mprotect(unsigned long start, size_t len, unsigned long prot)
        }
        merge_segments(current->mm, start, end);
 out:
-       unlock_kernel();
        up(&current->mm->mmap_sem);
        return error;
 }
index 48d3e9f94e9c7bf2f370fec1b4eeea69b8fe2032..2852f9b0611c7ac6c5f33f17cb0d9ed3906a8621 100644 (file)
@@ -57,11 +57,13 @@ static inline pte_t *alloc_one_pte(struct mm_struct *mm, unsigned long addr)
        return pte;
 }
 
-static inline int copy_one_pte(pte_t * src, pte_t * dst)
+static inline int copy_one_pte(struct mm_struct *mm, pte_t * src, pte_t * dst)
 {
        int error = 0;
-       pte_t pte = *src;
+       pte_t pte;
 
+       spin_lock(&mm->page_table_lock);
+       pte = *src;
        if (!pte_none(pte)) {
                error++;
                if (dst) {
@@ -70,6 +72,7 @@ static inline int copy_one_pte(pte_t * src, pte_t * dst)
                        error--;
                }
        }
+       spin_unlock(&mm->page_table_lock);
        return error;
 }
 
@@ -80,7 +83,7 @@ static int move_one_page(struct mm_struct *mm, unsigned long old_addr, unsigned
 
        src = get_one_pte(mm, old_addr);
        if (src)
-               error = copy_one_pte(src, alloc_one_pte(mm, new_addr));
+               error = copy_one_pte(mm, src, alloc_one_pte(mm, new_addr));
        return error;
 }
 
@@ -134,14 +137,12 @@ static inline unsigned long move_vma(struct vm_area_struct * vma,
                        new_vma->vm_start = new_addr;
                        new_vma->vm_end = new_addr+new_len;
                        new_vma->vm_offset = vma->vm_offset + (addr - vma->vm_start);
-                       lock_kernel();
                        if (new_vma->vm_file)
-                               atomic_inc(&new_vma->vm_file->f_count);
+                               get_file(new_vma->vm_file);
                        if (new_vma->vm_ops && new_vma->vm_ops->open)
                                new_vma->vm_ops->open(new_vma);
                        insert_vm_struct(current->mm, new_vma);
                        merge_segments(current->mm, new_vma->vm_start, new_vma->vm_end);
-                       unlock_kernel();
                        do_munmap(addr, old_len);
                        current->mm->total_vm += new_len >> PAGE_SHIFT;
                        if (new_vma->vm_flags & VM_LOCKED) {
index fa5a21fe1f76a5c09249f8d44f721b41873f4b6c..ef24fec95d7de9306f4df606b870514f99482c1c 100644 (file)
@@ -199,7 +199,7 @@ void unix_gc(void)
                 *      in flight we are in use.
                 */
                if(s->socket && s->socket->file &&
-                  atomic_read(&s->socket->file->f_count) > s->protinfo.af_unix.inflight)
+                  file_count(s->socket->file) > s->protinfo.af_unix.inflight)
                        maybe_unmark_and_push(s);
        }