]> git.neil.brown.name Git - history.git/commitdiff
- pre6: 2.4.0-test11pre6
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:40:06 +0000 (15:40 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:40:06 +0000 (15:40 -0500)
    - Intel: start to add Pentium IV specific stuff (128-byte cacheline
      etc)
    - David Miller: search-and-destroy places that forget to mark us
      running after removing us from a wait-queue.
    - Linus: NFS client write-back ref-counting SMP instability.
    - Linus: fix up non-exclusive waiters
    - Trond Myklebust: Be more careful about SMP in NFS and RPC code
    - Trond Myklebust: inode attribute update race fix
    - Charles White: don't do unaligned accesses in cpqarray driver.
    - Jeff Garzik: continued driver cleanup and fixes
    - Peter Anvin: integrate more of the Intel patches.
    - Robert Love: add i815 signature to the intel AGP support
    - Rik Faith: DRM update to make it easier to sync up 2.2.x
    - David Woodhouse: make old 16-bit pcmcia controllers work
      again (ie i82365 and TCIC)

144 files changed:
CREDITS
Documentation/Configure.help
Documentation/networking/sis900.txt
MAINTAINERS
Makefile
arch/alpha/config.in
arch/arm/config.in
arch/i386/Makefile
arch/i386/config.in
arch/i386/defconfig
arch/i386/kernel/apm.c
arch/i386/kernel/mpparse.c
arch/i386/kernel/setup.c
arch/i386/kernel/smpboot.c
arch/ia64/config.in
arch/m68k/config.in
arch/mips/config.in
arch/mips64/config.in
arch/ppc/config.in
arch/s390/config.in
arch/sh/config.in
arch/sparc/config.in
arch/sparc64/config.in
drivers/atm/atmtcp.c
drivers/block/cpqarray.c
drivers/block/ll_rw_blk.c
drivers/char/Config.in
drivers/char/agp/agpgart_be.c
drivers/char/cyclades.c
drivers/char/drm/agpsupport.c
drivers/char/drm/dma.c
drivers/char/drm/drmP.h
drivers/char/drm/i810_drv.c
drivers/char/drm/memory.c
drivers/char/drm/mga_drv.c
drivers/char/drm/mga_state.c
drivers/char/drm/r128_drm.h
drivers/char/drm/r128_drv.c
drivers/char/drm/tdfx_drv.c
drivers/char/generic_serial.c
drivers/char/joystick/ns558.c
drivers/char/rio/rio_linux.c
drivers/char/sx.c
drivers/isdn/hisax/nj_s.c
drivers/isdn/hisax/nj_u.c
drivers/mtd/cfi_cmdset_0001.c
drivers/mtd/cfi_cmdset_0002.c
drivers/net/Config.in
drivers/net/Space.c
drivers/net/a2065.c
drivers/net/aironet4500_core.c
drivers/net/am79c961a.c
drivers/net/apne.c
drivers/net/ariadne2.c
drivers/net/arlan.c
drivers/net/at1700.c
drivers/net/atari_bionet.c
drivers/net/atari_pamsnet.c
drivers/net/atarilance.c
drivers/net/atp.c
drivers/net/bagetlance.c
drivers/net/bmac.c
drivers/net/de600.c
drivers/net/de620.c
drivers/net/hamradio/baycom_epp.c
drivers/net/hamradio/soundmodem/sm.h
drivers/net/lance.c
drivers/net/rrunner.c
drivers/net/wan/comx.c
drivers/pci/pci.c
drivers/pcmcia/Config.in
drivers/pcmcia/i82365.c
drivers/pcmcia/pci_socket.c
drivers/pcmcia/pci_socket.h
drivers/pcmcia/tcic.c
drivers/pcmcia/yenta.c
drivers/s390/char/con3215.c
drivers/sbus/char/sab82532.c
drivers/sbus/char/su.c
drivers/scsi/gdth.c
drivers/scsi/scsi_ioctl.c
drivers/sound/aci.c
drivers/sound/ad1816.c
drivers/sound/awe_wave.c
drivers/sound/cmpci.c
drivers/sound/cs4281.c
drivers/sound/es1370.c
drivers/sound/esssolo1.c
drivers/sound/sonicvibes.c
drivers/sound/vwsnd.c
drivers/telephony/ixj.c
drivers/usb/net1080.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/storage/transport.c
drivers/usb/storage/usb.c
drivers/usb/usb-ohci.c
drivers/usb/usb.c
drivers/video/vgacon.c
fs/adfs/inode.c
fs/affs/inode.c
fs/autofs4/inode.c
fs/bfs/dir.c
fs/cramfs/inode.c
fs/devfs/base.c
fs/devpts/inode.c
fs/ext2/ialloc.c
fs/fat/inode.c
fs/fcntl.c
fs/isofs/dir.c
fs/jffs/inode-v23.c
fs/minix/bitmap.c
fs/ncpfs/inode.c
fs/nfs/inode.c
fs/nfs/write.c
fs/ntfs/fs.c
fs/pipe.c
fs/proc/base.c
fs/ramfs/inode.c
fs/select.c
fs/smbfs/inode.c
fs/sysv/ialloc.c
fs/udf/ialloc.c
fs/ufs/ialloc.c
include/asm-i386/processor.h
include/linux/agp_backend.h
include/linux/fs.h
include/linux/nfs_page.h
include/linux/sched.h
include/linux/sunrpc/sched.h
include/linux/wait.h
init/main.c
kernel/Makefile
kernel/context.c [new file with mode: 0644]
kernel/fork.c
kernel/kmod.c
kernel/ksyms.c
kernel/sched.c
net/atm/signaling.c
net/atm/svc.c
net/core/dev.c
net/khttpd/README
net/khttpd/main.c
net/socket.c
net/sunrpc/sched.c

diff --git a/CREDITS b/CREDITS
index 73025b2fb90fbb60b3ed0fc2dc1d4d358af77d25..fd299379efb8fdcd45d488d7497fa02b3dca5f49 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -1600,7 +1600,8 @@ N: Robert M. Love
 E: rml@tech9.net
 E: rml@ufl.edu
 D: misc. kernel hacking and debugging
-S: FL, USA
+S: Gainesville, Florida 32608
+S: USA
 
 N: Martin von Löwis
 E: loewis@informatik.hu-berlin.de
index f0da27c5be2f656c9c5d00e2d274e6d707f1e394..d89d228a0266118bd37b8226833fa3032d11838f 100644 (file)
@@ -2355,7 +2355,7 @@ CONFIG_AGP
 Intel 440LX/BX/GX support
 CONFIG_AGP_INTEL
   This option gives you AGP support for the GLX component of the
-  XFree86 4.x on Intel 440LX/BX/GX chipsets.
+  XFree86 4.x on Intel 440LX/BX/GX, 815, and 840 chipsets.
 
   For the moment, you should probably say N, unless you want to test
   the GLX component for XFree86 3.3.6, which can be downloaded from
@@ -2363,9 +2363,9 @@ CONFIG_AGP_INTEL
 
 Intel I810/I810 DC100/I810e support
 CONFIG_AGP_I810
-  This option gives you AGP support for the Xserver for the Intel
-  810 chipset boards. This is required to do any useful video
-  modes.
+  This option gives you AGP support for the Xserver on the Intel 810
+  and 815 chipset boards for their on-board integrated graphics. This
+  is required to do any useful video modes with these boards.
 
 VIA chipset support
 CONFIG_AGP_VIA
@@ -2482,6 +2482,20 @@ CONFIG_MCA
   Documentation/mca.txt (and especially the web page given there)
   before attempting to build an MCA bus kernel.
 
+EISA support
+CONFIG_EISA
+  The Extended Industry Standard Architecture (EISA) bus was
+  developed as an open alternative to the IBM MicroChannel bus.
+
+  The EISA bus provided some of the features of the IBM MicroChannel
+  bus while maintaining backward compatibility with cards made for
+  the older ISA bus. The EISA bus saw limited use between 1988 and 1995
+  when it was made obsolete by the PCI bus.
+
+  Say Y here if you are building a kernel for an EISA-based machine.
+
+  Otherwise, say N.
+
 SGI Visual Workstation support
 CONFIG_VISWS
   The SGI Visual Workstation series is an IA32-based workstation
@@ -2855,6 +2869,7 @@ CONFIG_M386
    - "Pentium-MMX" for the Intel Pentium MMX.
    - "Pentium-Pro" for the Intel Pentium Pro/Celeron/Pentium II.
    - "Pentium-III" for the Intel Pentium III.
+   - "Pentium-4" for the Intel Pentium 4
    - "K6" for the AMD K6, K6-II and K6-III (aka K6-3D).
    - "Athlon" for the AMD Athlon (K7).
    - "Crusoe" for the Transmeta Crusoe series.
@@ -14045,8 +14060,7 @@ CONFIG_TRIX_BOOT_FILE
 Support for OPTi MAD16 and/or Mozart based cards
 CONFIG_SOUND_MAD16
   Answer Y if your card has a Mozart (OAK OTI-601) or MAD16 (OPTi
-  82C928 or 82C929 or 82C931) audio interface chip. For the 82C931,
-  please read drivers/sound/README.C931. These chips are currently
+  82C928 or 82C929 or 82C931) audio interface chip. These chips are 
   quite common so it's possible that many no-name cards have one of
   them. In addition the MAD16 chip is used in some cards made by known
   manufacturers such as Turtle Beach (Tropez), Reveal (some models)
index 6c26c9927728eeeae113af8fb20fde13cacdbb91..b6de27947bf2f99313cdecd5689994f1f0f63f50 100644 (file)
-  SiS 900/7016 Fast Ethernet Device Driver
-  by Ollie Lho (ollie@sis.com.tw)
-  November 4, 1999. Document Revision: 0.2
-
-  This document gives some information on installation and usage of SiS
-  900/7016 device driver under Linux.
-  ______________________________________________________________________
-
-  Table of Contents
-
-
-  1. Introduction
-
-  2. License
-
-  3. Changes
-
-  4. Tested Environment
-
-  5. Files in This Package
-
-  6. Installation
-
-     6.1 Kernel version later than 2.2.11 and 2.3.15
-        6.1.1 Building the driver as loadable module
-        6.1.2 Building the driver into kernel
-     6.2 Earlier Kernel Version in 2.2.x and 2.3.x Series
-
-  7. Known Problems and Bugs
-
-  8. Revision History
-
-  9. Acknowledgements
-
-
-
-  ______________________________________________________________________
-
-  1.  Introduction
-
-  This document describes the revision 1.06 of SiS 900/7016 Fast
-  Ethernet device driver under Linux. The driver is developed by Silicon
-  Integrated System Corp. and distributed freely under the GNU General
-  Public License (GPL). The driver can be compiled as a loadable module
-  and used under Linux kernel version 2.2.x. With minimal changes, the
-  driver can also be used under 2.3.x kernel, please see section
-  ``Installation''. If you are intended to use the driver for earlier
-  kernels, you are on your own.
-
-  The driver is tested with usual TCP/IP applications including FTP,
-  Telnet, Netscape etc. and is used constantly by the developers.
-
-  Please send all comments/fixes/questions to Ollie Lho.
-
-
-  2.  License
-
-
-
-
-
-
-
-
-
-
-          Copyright (C) 1999 Silicon Integrated System Corp.
-
-          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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-
-
-
-  3.  Changes
-
-  Changes made in Revision 1.06
-
-  1. Separation of sis900.c and sis900.h in order to move most constant
-     definition to sis900.h (many of those constants were corrected)
-
-  2. Clean up PCI detection, the pci-scan from Donald Becker were not
-     used, just simple pci_find_*.
-
-  3. MII detection is modified to support multiple mii transceiver.
-
-  4. Bugs in read_eeprom, mdio_* were removed.
-
-  5. Lot of sis900 irrelevant comments were removed/changed and more
-     comments were added to reflect the real situation.
-
-  6. Clean up of physical/virtual address space mess in buffer
-     descriptors.
-
-  7. Better transmit/receive error handling.
-
-  8. The driver now uses zero-copy single buffer management scheme to
-     improve performance.
-
-  9. Names of variables were changed to be more consistent.
-
-  10.
-     Clean up of auo-negotiation and timer code.
-
-  11.
-     Automatic detection and change of PHY on the fly.
-
-
-  4.  Tested Environment
-
-  This driver is developed on the following hardware
-
-  o  Intel Celeron 336 with SiS 620 (rev 02) chipset
-
-  o  SiS 900 (rev 01) and SiS 7016/7014 Fast Ethernet Card
-
-     and tested with these software environments
-
-  o  Red Hat Linux version 6.0
-
-  o  Linux kernel version 2.2.13
-
-  o  Netscape version 4.6
-
-  o  NcFTP 3.0.0 beta 18
-
-  o  Samba version 2.0.3
-
-
-  5.  Files in This Package
-
-  In the package you can find these files:
-
-
-     sis900-2.2.x.c
-        Driver source for kernel 2.2.x
-
-     sis900-2.3.x.c
-        Driver source for kernel 2.3.x
-
-     sis900.h
-        Header file for both 2.2.x and 2.3.x kernel
-
-     sis900.sgml
-        Linux-Doc SGML source of the document
-
-
-  6.  Installation
-
-  Silicon Integrated System Corp. is cooperating closely with core Linux
-  Kernel developers. The revisions of SiS 900 driver are distributed by
-  the usual channels for kernel tar files and patches. Those kernel tar
-  files for official kernel and patches for kernel pre-release can be
-  download at official kernel ftp site
-  <http://ftp.kernel.org/pub/linux/kernel/> and its mirrors.  The 1.06
-  revision can be found in kernel version later than 2.3.15 and
-  pre-2.2.14.  If you have no prior experience in networking under
-  Linux, please read Ethernet HOWTO and Networking HOWTO available from
-  Linux Documentation Project (LDP).
-
-  The installation procedure are different according to your kernel
-  versions.
-
-
-  6.1.  Kernel version later than 2.2.11 and 2.3.15
-
-  The driver is bundled in release later than 2.2.11 and 2.3.15 so this
-  is the most easy case.  Be sure you have the appropriate packages for
-  compiling kernel source.  Those packages are listed in
-  Document/Changes in kernel source distribution. There are two
-  alternative ways to install the driver
-
-
-  6.1.1.  Building the driver as loadable module
-
-  To build the driver as a loadable kernel module you have to
-  reconfigure the kernel to activate network support by
-
-
-
-       make config
-
-
-
-
-  Choose "Network Device Support" to "Y" and "Ethernet Support" to "Y".
-  Then you have to choose "SiS 900 Fast Ethernet Adapter Support" to
-  "M".
-
-  After reconfiguring the kernel, you can make the driver module by
-
-
-       make modules
-
-
-
-
-  The driver should be compiled with no errors. After compiling the
-  driver, the driver can be installed to proper place by
-
-
-
-       make modules_install
-
-
-
-
-  Load the driver into kernel by
-
-
-
-       insmod sis900
-
-
-
-
-  When loading the driver into memory, some information message can be
-  view by
-
-
-
-       dmesg
-
-
-
-
-  or
-
-
-       cat /var/log/message
-
-
-
-
-  If the driver is loaded properly you will have messages similar to
-  this:
-
-
-
-       sis900.c: v1.06  11/04/99
-       eth0: SiS 900 PCI Fast Ethernet at 0xd000, IRQ 10, 00:00:e8:83:7f:a4.
-       eth0: SiS 900 Internal MII PHY transceiver found at address 1.
-       eth0: Using SiS 900 Internal MII PHY as default
-
-
-
-
-  showing the version of the driver and the results of probing routine.
-
-  Once the driver is loaded, network can be brought up by
-
-
-
-       /sbin/ifconfig eth0 IPADDR broadcast BROADCAST netmask NETMASK
-
-
-
-
-
-  where IPADDR, BROADCAST, NETMASK are your IP address, broadcast
-  address and netmask respectively. For more information on how to
-  configure network interface, please refer to Networking HOWTO.
-
-  The link status is also shown by kernel messages. For example, after
-  the network interface is activated, you may have the message:
-
-
-
-       eth0: Media Link On 100mbps full-duplex
-
-
-
-
-  If you try to unplug the twist pair (TP) cable you will get
-
-
-
-       eth0: Media Link Off
-
-
-
-
-  indicating that the link is failed.
-
-
-  6.1.2.  Building the driver into kernel
-
-  If you want to make the driver into kernel, choose "Y" rather than "M"
-  on "SiS 900 Fast Ethernet Adapter Support" when configuring the
-  kernel.  Build the kernel image in the usual way
-
-
-
-       make dep
-
-       make clean
-
-       make bzlilo
-
-
-
-
-  Next time the system reboot, you have the driver in memory.
-
-
-  6.2.  Earlier Kernel Version in 2.2.x and 2.3.x Series
-
-  Installing the driver for earlier kernels in 2.2.x and 2.3.x series
-  requires a little bit more work. First you have to copy sis900-2.x.x.c
-  to /usr/src/linux/drivers/net/ and you have to modify some files
-  manually (sorry !! no patch available !!)
-
-  in Space.c, add
-
-
-       extern int sis900_probe(struct device *dev);
-
-       ...
-
-       #ifdef CONFIG_SIS900
-               {sis900_probe,0},
-       #endif
-
-
-  in Config.in add
-
-
-       if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-               ... //other adapter drivers
-               tristate 'SiS 900 PCI Fast Ethernet Adapter Support' CONFIG_SIS900
-               ... //other adapter drivers
-       fi
-
-
-
-
-  in Makefile add
-
-
-       ifeq ($(CONFIG_SIS900),y)
-               L_OBJS += sis900.o
-       else
-               ifeq ($(CONFIG_SIS900),m)
-                       M_OBJS += sis900.o
-               endif
-       endif
-
-
-
-
-  After modifying these files, the driver can be build as described in
-  the previous section.
-
-
-  7.  Known Problems and Bugs
-
-  There are some known problems and bugs. If you find any other bugs
-  please mail to ollie@sis.com.tw
-
-  1. AM79C901 HomePNA PHY is not thoroughly tested, there may be some
-     bugs in the "on the fly" change of transceiver.
-
-  2. A bug is hidden somewhere in the receive buffer management code,
-     the bug causes NULL pointer reference in the kernel. This fault is
-     caught before bad things happen and reported with the message:
-
-
-       eth0: NULL pointer encountered in Rx ring, skipping
-
-
-
-
-  which can be viewed with dmesg or cat /var/log/message.
-
-
-  8.  Revision History
-
-
-  o  November 4, 1999, Revision 1.06, Second release, lots of clean up
-     and optimization.
-
-  o  August 8, 1999, Revision 1.05, Initial Public Release
-
-
-  9.  Acknowledgements
-
-  This driver was originally derived form Donald Becker's pci-skeleton
-  and rtl8139 drivers. Donald also provided various suggestion regarded
-  with improvements made in revision 1.06.
-
-  The 1.05 revision was created by Jim Huang, AMD 79c901 support was
-  added by Chin-Shan Li.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
+SiS 900/7016 Fast Ethernet Device Driver
+
+Ollie Lho
+
+Lei Chun Chang
+
+   November 16, 2000. Document Revision: 0.3
+   
+   This document gives some information on installation and usage of SiS
+   900/7016 device driver under Linux.
+     _________________________________________________________________
+     _________________________________________________________________
+   
+Introduction
+
+   This document describes the revision 1.06 and 1.07 of SiS 900/7016
+   Fast Ethernet device driver under Linux. The driver is developed by
+   Silicon Integrated System Corp. and distributed freely under the GNU
+   General Public License (GPL). The driver can be compiled as a loadable
+   module and used under Linux kernel version 2.2.x. (rev. 1.06) With
+   minimal changes, the driver can also be used under 2.3.x and 2.4.x
+   kernel (rev. 1.07), please see the section called Installation. If you
+   are intended to use the driver for earlier kernels, you are on your
+   own.
+   
+   The driver is tested with usual TCP/IP applications including FTP,
+   Telnet, Netscape etc. and is used constantly by the developers.
+   
+   Please send all comments/fixes/questions to Lei-Chun Chang.
+     _________________________________________________________________
+   
+License
+
+        Copyright (C) 1999 Silicon Integrated System Corp.
+
+        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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  U
+SA
+     _________________________________________________________________
+   
+Changes
+
+   Changes made in Revision 1.07
+   
+    1. Separation of sis900.c and sis900.h in order to move most constant
+       definition to sis900.h (many of those constants were corrected)
+    2. Clean up PCI detection, the pci-scan from Donald Becker were not
+       used, just simple pci_find_*.
+    3. MII detection is modified to support multiple mii transceiver.
+    4. Bugs in read_eeprom, mdio_* were removed.
+    5. Lot of sis900 irrelevant comments were removed/changed and more
+       comments were added to reflect the real situation.
+    6. Clean up of physical/virtual address space mess in buffer
+       descriptors.
+    7. Better transmit/receive error handling.
+    8. The driver now uses zero-copy single buffer management scheme to
+       improve performance.
+    9. Names of variables were changed to be more consistent.
+   10. Clean up of auo-negotiation and timer code.
+   11. Automatic detection and change of PHY on the fly.
+   12. Bug in mac probing fixed.
+   13. Fix 630E equalier problem by modifying the equalizer workaround
+       rule.
+   14. Support for ICS1893 10/100 Interated PHYceiver.
+   15. Support for media select by ifconfig.
+     _________________________________________________________________
+   
+Tested Environment
+
+   This driver is developed on the following hardware
+   
+     * Intel Celeron 500 with SiS 630 (rev 02) chipset
+     * SiS 900 (rev 01) and SiS 7016/7014 Fast Ethernet Card
+       
+   and tested with these software environments
+   
+     * Red Hat Linux version 6.2
+     * Linux kernel version 2.4.0
+     * Netscape version 4.6
+     * NcFTP 3.0.0 beta 18
+     * Samba version 2.0.3
+     _________________________________________________________________
+   
+Files in This Package
+
+   In the package you can find these files:
+   
+   sis900.c
+          Driver source file in C
+          
+   sis900.h
+          Header file for sis900.c
+          
+   sis900.sgml
+          DocBook SGML source of the document
+          
+   sis900.txt
+          Driver document in plain text
+     _________________________________________________________________
+   
+Installation
+
+   Silicon Integrated System Corp. is cooperating closely with core Linux
+   Kernel developers. The revisions of SiS 900 driver are distributed by
+   the usuall channels for kernel tar files and patches. Those kernel tar
+   files for official kernel and patches for kernel pre-release can be
+   download at official kernel ftp site and its mirrors. The 1.06
+   revision can be found in kernel version later than 2.3.15 and
+   pre-2.2.14, and 1.07 revision can be found in kernel version 2.4.0. If
+   you have no prior experience in networking under Linux, please read
+   Ethernet HOWTO and Networking HOWTO available from Linux Documentation
+   Project (LDP).
+   
+   The driver is bundled in release later than 2.2.11 and 2.3.15 so this
+   is the most easy case. Be sure you have the appropriate packages for
+   compiling kernel source. Those packages are listed in Document/Changes
+   in kernel source distribution. If you have to install the driver other
+   than those bundled in kernel release, you should have your driver file
+   sis900.c and sis900.h copied into /usr/src/linux/drivers/net/ first.
+   There are two alternative ways to install the driver
+     _________________________________________________________________
+   
+Building the driver as loadable module
+
+   To build the driver as a loadable kernel module you have to
+   reconfigure the kernel to activate network support by
+   
+make menuconfig
+
+   Choose "Loadable module support --->", then select "Enable loadable
+   module support".
+   
+   Choose "Network Device Support --->", select "Ethernet (10 or
+   100Mbit)". Then select "EISA, VLB, PCI and on board controllers", and
+   choose "SiS 900/7016 PCI Fast Ethernet Adapter support" to "M".
+   
+   After reconfiguring the kernel, you can make the driver module by
+   
+make modules
+
+   The driver should be compiled with no errors. After compiling the
+   driver, the driver can be installed to proper place by
+   
+make modules_install
+
+   Load the driver into kernel by
+   
+insmod sis900
+
+   When loading the driver into memory, some information message can be
+   view by
+   
+dmesg
+
+   or
+cat /var/log/message
+
+   If the driver is loaded properly you will have messages similar to
+   this:
+   
+sis900.c: v1.07.06  11/07/2000
+eth0: SiS 900 PCI Fast Ethernet at 0xd000, IRQ 10, 00:00:e8:83:7f:a4.
+eth0: SiS 900 Internal MII PHY transceiver found at address 1.
+eth0: Using SiS 900 Internal MII PHY as default
+
+   showing the version of the driver and the results of probing routine.
+   
+   Once the driver is loaded, network can be brought up by
+   
+/sbin/ifconfig eth0 IPADDR broadcast BROADCAST netmask NETMASK
+
+   where IPADDR, BROADCAST, NETMASK are your IP address, broadcast
+   address and netmask respectively. For more information on how to
+   configure network interface, please refer to Networking HOWTO.
+   
+   The link status is also shown by kernel messages. For example, after
+   the network interface is activated, you may have the message:
+   
+eth0: Media Link On 100mbps full-duplex
+
+   If you try to unplug the twist pair (TP) cable you will get
+   
+eth0: Media Link Off
+
+   indicating that the link is failed.
+     _________________________________________________________________
+   
+Building the driver into kernel
+
+   If you want to make the driver into kernel, choose "Y" rather than "M"
+   on "SiS 900/7016 PCI Fast Ethernet Adapter support" when configuring
+   the kernel. Build the kernel image in the usual way
+   
+make dep
+
+make clean
+
+make bzlilo
+
+   Next time the system reboot, you have the driver in memory.
+     _________________________________________________________________
+   
+Known Problems and Bugs
+
+   There are some known problems and bugs. If you find any other bugs
+   please mail to lcchang@sis.com.tw
+   
+    1. AM79C901 HomePNA PHY is not thoroughly tested, there may be some
+       bugs in the "on the fly" change of transceiver.
+    2. A bug is hidden somewhere in the receive buffer management code,
+       the bug causes NULL pointer reference in the kernel. This fault is
+       caught before bad things happen and reported with the message:
+       eth0: NULL pointer encountered in Rx ring, skipping which can be
+       viewed with dmesg or cat /var/log/message.
+     _________________________________________________________________
+   
+Revision History
+
+     * November 13, 2000, Revision 1.07, seventh release, 630E problem
+       fixed and furthur clean up.
+     * November 4, 1999, Revision 1.06, Second release, lots of clean up
+       and optimization.
+     * August 8, 1999, Revision 1.05, Initial Public Release
+     _________________________________________________________________
+   
+Acknowledgements
+
+   This driver was originally derived form Donald Becker's pci-skeleton
+   and rtl8139 drivers. Donald also provided various suggestion regarded
+   with improvements made in revision 1.06.
+   
+   The 1.05 revision was created by Jim Huang, AMD 79c901 support was
+   added by Chin-Shan Li.
index 0a19a7dbe302231405f3699b4b85fda6f8f5a65e..24f6a6cf1b80907c8a689f041ddd9d10347d6ded 100644 (file)
@@ -1245,8 +1245,9 @@ W:        http://www.kernel.dk
 S:     Maintained
 
 USB SUBSYSTEM
-P:     Randy Dunlap
-M:     randy.dunlap@intel.com
+P:     Johannes Erdfelt
+M:     jerdfelt@valinux.com
+M:     johannes@erdfelt.com
 L:     linux-usb-users@lists.sourceforge.net
 L:     linux-usb-devel@lists.sourceforge.net
 W:     http://www.linux-usb.org
index e87bfc0cc0651c88340993fb693623964b7a22fa..25940fe6e24160e916bbf4455aacc5c6fb2cbc18 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -497,4 +497,4 @@ scripts/mkdep: scripts/mkdep.c
        $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
 
 scripts/split-include: scripts/split-include.c
-       $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
+       $(HOSTCC) $(HOSTCFLAGS) -I$(HPATH) -o scripts/split-include scripts/split-include.c
index e01e0c0416e9e1803ae3cec5a654438c5af7ff77..da5c361c9a7a4b9f5484db4e4ca5d4ad2ff28822 100644 (file)
@@ -69,6 +69,7 @@ unset CONFIG_ALPHA_BROKEN_IRQ_MASK
 define_bool CONFIG_ISA y
 define_bool CONFIG_EISA y
 define_bool CONFIG_SBUS n
+define_bool CONFIG_MCA n
 
 if [ "$CONFIG_ALPHA_JENSEN" = "y" ]
 then
index c59fab74ad681f3824cb69e1218b830acd5946ff..561cf3bf3f06dbd34545663ca8b150f2eaa59c35 100644 (file)
@@ -7,6 +7,7 @@ mainmenu_name "Linux Kernel Configuration"
 define_bool CONFIG_ARM y
 define_bool CONFIG_EISA n
 define_bool CONFIG_SBUS n
+define_bool CONFIG_MCA n
 define_bool CONFIG_UID16 y
 
 
index 0a2d802a34fc545fc977a96cc55444839fc4ada8..7ef6959816747cb44ec21a0a47c524e21ca7609c 100644 (file)
@@ -54,6 +54,10 @@ ifdef CONFIG_M686FXSR
 CFLAGS += -march=i686
 endif
 
+ifdef CONFIG_MPENTIUM4
+CFLAGS += -march=i686
+endif
+
 ifdef CONFIG_MK6
 CFLAGS += $(shell if $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6"; else echo "-march=i586"; fi)
 endif
index dc1fd202d3355e87cafec304e92c9d367aedfa84..d6c63a8b83e7eb0a0c5b02a21804525e3fbceb9f 100644 (file)
@@ -34,6 +34,7 @@ choice 'Processor family' \
         Pentium-MMX                    CONFIG_M586MMX \
         Pentium-Pro/Celeron/Pentium-II CONFIG_M686 \
         Pentium-III                    CONFIG_M686FXSR \
+        Pentium-4                      CONFIG_MPENTIUM4 \
         K6/K6-II/K6-III                CONFIG_MK6 \
         Athlon/K7                      CONFIG_MK7 \
         Crusoe                         CONFIG_MCRUSOE \
@@ -92,6 +93,15 @@ if [ "$CONFIG_M686FXSR" = "y" ]; then
    define_bool CONFIG_X86_FXSR y
    define_bool CONFIG_X86_XMM y
 fi
+if [ "$CONFIG_MPENTIUM4" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 7
+   define_bool CONFIG_X86_TSC y
+   define_bool CONFIG_X86_GOOD_APIC y
+   define_bool CONFIG_X86_PGE y
+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+   define_bool CONFIG_X86_FXSR y
+   define_bool CONFIG_X86_XMM y
+fi
 if [ "$CONFIG_MK6" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 5
    define_bool CONFIG_X86_ALIGNMENT_16 y
@@ -158,6 +168,7 @@ if [ "$CONFIG_SMP" != "y" ]; then
        define_bool CONFIG_X86_LOCAL_APIC y
     fi
 fi
+
 if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then
     define_bool CONFIG_HAVE_DEC_LOCK y
 fi
@@ -198,6 +209,8 @@ bool 'EISA support' CONFIG_EISA
 
 if [ "$CONFIG_VISWS" != "y" ]; then
    bool 'MCA support' CONFIG_MCA
+else
+   define_bool CONFIG_MCA n
 fi
 
 bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG
index 2971c8908e3e0e2f3036cf84e2c88e7c958e1883..9f8625c6eb267d5911582ef72b910522f5bb6d46 100644 (file)
@@ -28,6 +28,7 @@ CONFIG_KMOD=y
 # CONFIG_M586MMX is not set
 # CONFIG_M686 is not set
 CONFIG_M686FXSR=y
+# CONFIG_MPENTIUM4 is not set
 # CONFIG_MK6 is not set
 # CONFIG_MK7 is not set
 # CONFIG_MCRUSOE is not set
@@ -80,6 +81,8 @@ CONFIG_HOTPLUG=y
 #
 CONFIG_PCMCIA=y
 CONFIG_CARDBUS=y
+# CONFIG_I82365 is not set
+# CONFIG_TCIC is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
index b7abf6af4c7e6ff8444365555130bbea6e583b29..dc47528cd1c763a07e8119b2145c7bb689f22fba 100644 (file)
@@ -1126,6 +1126,7 @@ static void apm_mainloop(void)
                }
 #endif
        }
+       remove_wait_queue(&apm_waitqueue, &wait);
 }
 
 static int check_apm_user(struct apm_user *as, const char *func)
index 86f154da8b3a9e4cb34f0dcbe37e14740d30b24f..5dfbde5239cabba24ae425448ebd32b22cbaf20f 100644 (file)
@@ -97,6 +97,8 @@ static char __init *mpc_family(int family,int model)
                        return("Pentium(tm) Pro");
 
                case 0x0F:
+                       if (model == 0x00)
+                               return("Pentium 4(tm)");
                        if (model == 0x0F)
                                return("Special controller");
        }
@@ -125,6 +127,44 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
                Dprintk("    64 bit compare & exchange supported.\n");
        if (m->mpc_featureflag&(1<<9))
                Dprintk("    Internal APIC present.\n");
+       if (m->mpc_featureflag&(1<<11))
+               Dprintk("    SEP present.\n");
+       if (m->mpc_featureflag&(1<<12))
+               Dprintk("    MTRR  present.\n");
+       if (m->mpc_featureflag&(1<<13))
+               Dprintk("    PGE  present.\n");
+       if (m->mpc_featureflag&(1<<14))
+               Dprintk("    MCA  present.\n");
+       if (m->mpc_featureflag&(1<<15))
+               Dprintk("    CMOV  present.\n");
+       if (m->mpc_featureflag&(1<<16))
+               Dprintk("    PAT  present.\n");
+       if (m->mpc_featureflag&(1<<17))
+               Dprintk("    PSE  present.\n");
+       if (m->mpc_featureflag&(1<<18))
+               Dprintk("    PSN  present.\n");
+       if (m->mpc_featureflag&(1<<19))
+               Dprintk("    Cache Line Flush Instruction present.\n");
+       /* 20 Reserved */
+       if (m->mpc_featureflag&(1<<21))
+               Dprintk("    Debug Trace and EMON Store present.\n");
+       if (m->mpc_featureflag&(1<<22))
+               Dprintk("    ACPI Thermal Throttle Registers  present.\n");
+       if (m->mpc_featureflag&(1<<23))
+               Dprintk("    MMX  present.\n");
+       if (m->mpc_featureflag&(1<<24))
+               Dprintk("    FXSR  present.\n");
+       if (m->mpc_featureflag&(1<<25))
+               Dprintk("    XMM  present.\n");
+       if (m->mpc_featureflag&(1<<26))
+               Dprintk("    Willamette New Instructions  present.\n");
+       if (m->mpc_featureflag&(1<<27))
+               Dprintk("    Self Snoop  present.\n");
+       /* 28 Reserved */
+       if (m->mpc_featureflag&(1<<29))
+               Dprintk("    Thermal Monitor present.\n");
+       /* 30, 31 Reserved */
+
 
        if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
                Dprintk("    Bootup CPU\n");
index 4bee9fc12f0868287451c61a49b31928a0519b4d..2ed13ff5f278312b47a80b8c5d0b3fdcdeade955 100644 (file)
@@ -1485,6 +1485,7 @@ static void __init init_intel(struct cpuinfo_x86 *c)
 #endif
        extern void mcheck_init(struct cpuinfo_x86 *c);
        char *p = NULL;
+       unsigned int l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
 
 #ifndef CONFIG_M686
        /*
@@ -1506,43 +1507,80 @@ static void __init init_intel(struct cpuinfo_x86 *c)
 
        if (c->cpuid_level > 1) {
                /* supports eax=2  call */
-               int edx = cpuid_edx(2);
+               int i, j, n;
+               int regs[4];
+               unsigned char *dp = (unsigned char *)regs;
 
-               /* We need only the LSB */
-               edx &= 0xff;
+               /* Number of times to iterate */
+               n = cpuid_eax(2) & 0xFF;
 
-               switch (edx) {
-               case 0x40:
-                       c->x86_cache_size = 0;
-                       break;
-                       
-               case 0x41: /* 4-way 128 */
-                       c->x86_cache_size = 128;
-                       break;
-                       
-               case 0x42: /* 4-way 256 */
-               case 0x82: /* 8-way 256 */
-                       c->x86_cache_size = 256;
-                       break;
-                       
-               case 0x43: /* 4-way 512 */
-                       c->x86_cache_size = 512;
-                       break;
+               for ( i = 0 ; i < n ; i++ ) {
+                       cpuid(2, &regs[0], &regs[1], &regs[2], &regs[3]);
                        
-               case 0x44: /* 4-way 1024 */
-               case 0x84: /* 8-way 1024 */
-                       c->x86_cache_size = 1024;
-                       break;
-                       
-               case 0x45: /* 4-way 2048 */
-               case 0x85: /* 8-way 2048 */
-                       c->x86_cache_size = 2048;
-                       break;
-                       
-               default:
-                       c->x86_cache_size = 0;
-                       break;
+                       /* If bit 31 is set, this is an unknown format */
+                       for ( j = 0 ; j < 3 ; j++ ) {
+                               if ( regs[j] < 0 ) regs[j] = 0;
+                       }
+
+                       /* Byte 0 is level count, not a descriptor */
+                       for ( j = 1 ; j < 16 ; j++ ) {
+                               unsigned char des = dp[j];
+                               unsigned char dl, dh;
+                               unsigned int cs;
+
+                               dh = des >> 4;
+                               dl = des & 0x0F;
+
+                               switch ( dh )
+                               {
+                               case 2:
+                                       if ( dl ) {
+                                               /* L3 cache */
+                                               cs = (dl-1) << 9;
+                                               l3 += cs;
+                                       }
+                                       break;
+                               case 4:
+                               case 8:
+                                       if ( dl ) {
+                                               /* L2 cache */
+                                               cs = 128 << (dl-1);
+                                               l2 += cs;
+                                       }
+                                       break;
+                               case 6:
+                                       if (dl > 5) {
+                                               /* L1 D cache */
+                                               cs = 8<<(dl-6);
+                                               l1d += cs;
+                                       }
+                                       break;
+                               case 7:
+                                       /* L1 I cache */
+                                       cs = dl ? (16 << (dl-1)) : 12;
+                                       l1i += cs;
+                                       break;
+                               default:
+                                       /* TLB, or something else we don't know about */
+                                       break;
+                               }
+                       }
                }
+               if ( l1i || l1d )
+                       printk("CPU: L1 I cache: %dK, L1 D cache: %dK\n",
+                              l1i, l1d);
+               if ( l2 )
+                       printk("CPU: L2 cache: %dK\n", l2);
+               if ( l3 )
+                       printk("CPU: L3 cache: %dK\n", l3);
+
+               /*
+                * This assumes the L3 cache is shared; it typically lives in
+                * the northbridge.  The L1 caches are included by the L2
+                * cache, and so should not be included for the purpose of
+                * SMP switching weights.
+                */
+               c->x86_cache_size = l2 ? l2 : (l1i+l1d);
        }
 
        /* SEP CPUID bug: Pentium Pro reports SEP but doesn't have it */
@@ -1555,19 +1593,19 @@ static void __init init_intel(struct cpuinfo_x86 *c)
        if (c->x86 == 6) {
                switch (c->x86_model) {
                case 5:
-                       if (c->x86_cache_size == 0)
+                       if (l2 == 0)
                                p = "Celeron (Covington)";
-                       if (c->x86_cache_size == 256)
+                       if (l2 == 256)
                                p = "Mobile Pentium II (Dixon)";
                        break;
                        
                case 6:
-                       if (c->x86_cache_size == 128)
+                       if (l2 == 128)
                                p = "Celeron (Mendocino)";
                        break;
                        
                case 8:
-                       if (c->x86_cache_size == 128)
+                       if (l2 == 128)
                                p = "Celeron (Coppermine)";
                        break;
                }
@@ -2028,7 +2066,7 @@ int get_cpuinfo(char * buffer)
                /* Intel-defined */
                "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
                "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
-               "pat", "pse36", "pn", "clflsh", NULL, "dtes", NULL, "mmx",
+               "pat", "pse36", "pn", "clflsh", NULL, "dtes", "acpi", "mmx",
                "fxsr", "sse", "sse2", "selfsnoop", NULL, "acc", "ia64", NULL,
 
                /* AMD-defined */
index 6092aec3b3dc31060ca0c7a2c21bf42d2e6cd9ce..57a07765ec49e410ee2cdc42efb059da8f3ce109 100644 (file)
@@ -455,7 +455,7 @@ int __init start_secondary(void *unused)
        cpu_init();
        smp_callin();
        while (!atomic_read(&smp_commenced))
-               /* nothing */ ;
+               rep_nop();
        /*
         * low-memory mappings have been cleared, flush them from
         * the local TLBs too.
index 356977116ab6dbf1b9e8ae502f7c672098846b06..8defec849dfe0f9037e76f824989c2b6325859d6 100644 (file)
@@ -22,6 +22,7 @@ define_bool CONFIG_SWIOTLB y  # for now...
 
 define_bool CONFIG_ISA n
 define_bool CONFIG_EISA n
+define_bool CONFIG_MCA n
 define_bool CONFIG_SBUS n
 
 choice 'IA-64 system type'                                     \
index afa5eae2d85f9c8152653a635f605f986d4049b7..b287daca8cc01fc649cda7d898bea36eb141925a 100644 (file)
@@ -26,6 +26,7 @@ comment 'Platform dependent setup'
 
 define_bool CONFIG_ISA n
 define_bool CONFIG_EISA n
+define_bool CONFIG_MCA n
 define_bool CONFIG_PCMCIA n
 
 bool 'Amiga support' CONFIG_AMIGA
index 48828238b0a34d28e17bee6a884a5a27895b4449..6eabec319d0fc908a2dfe779391bf84286e71e4d 100644 (file)
@@ -39,6 +39,7 @@ unset CONFIG_MIPS_JAZZ
 unset CONFIG_VIDEO_G364
 unset CONFIG_PC_KEYB
 
+define_bool CONFIG_MCA n
 define_bool CONFIG_SBUS n
 
 if [ "$CONFIG_ALGOR_P4032" = "y" ]; then
index 44960c112d7ae879075b4f6b8a8b22d4035e60c8..0d3e87a61e48a3f13384ec5b3872bde6ceefac16 100644 (file)
@@ -66,6 +66,7 @@ if [ "$CONFIG_PCI" != "y" ]; then
    define_bool CONFIG_PCI n
 fi
 
+define_bool CONFIG_MCA n
 define_bool CONFIG_SBUS n
 
 mainmenu_option next_comment
index 210c5ddf4c9630741632703f0c9d8556efe84e4c..34606f99a33b8e7671425c9c79a3818a24e98641 100644 (file)
@@ -101,6 +101,9 @@ define_bool CONFIG_ISA n
 define_bool CONFIG_EISA n
 define_bool CONFIG_SBUS n
 
+# Yes MCA RS/6000s exist but Linux-PPC does not currently support any
+define_bool CONFIG_MCA n
+
 if [ "$CONFIG_APUS" = "y" -o "$CONFIG_4xx" = "y" -o \
      "$CONFIG_8260" = "y" ]; then
    define_bool CONFIG_PCI n
index 2f6096b3ff642af75176e1a7b828542764e84b8c..4415799ff3cf14561c26aa7e3bebd3f0d204c6a3 100644 (file)
@@ -5,6 +5,7 @@
 
 define_bool CONFIG_ISA n
 define_bool CONFIG_EISA n
+define_bool CONFIG_MCA n
 define_bool CONFIG_UID16 y
 
 mainmenu_name "Linux Kernel Configuration"
index 1aba71a6229a2fd207d16aeb619ec75b75c34f72..0bd1cf4bbd82810126af554c9cfc01b93547e97c 100644 (file)
@@ -67,6 +67,7 @@ comment 'General setup'
 
 define_bool CONFIG_ISA n
 define_bool CONFIG_EISA n
+define_bool CONFIG_MCA n
 define_bool CONFIG_SBUS n
 
 bool 'Networking support' CONFIG_NET
index 86485ab334260cf76d1541bd081b053287eb861c..1a75cdf179055a45ac58a0c02a6abf21a92bc3e3 100644 (file)
@@ -32,6 +32,7 @@ bool 'Symmetric multi-processing support (does not work on sun4/sun4c)' CONFIG_S
 # Global things across all Sun machines.
 define_bool CONFIG_ISA n
 define_bool CONFIG_EISA n
+define_bool CONFIG_MCA n
 define_bool CONFIG_PCMCIA n
 define_bool CONFIG_SBUS y
 define_bool CONFIG_SBUSCHAR y
index ea05d1388ed3876ceae478b5b069e6f22e40c503..19b05e28ff4ea54f2d191a8d517f1be05f380f75 100644 (file)
@@ -30,6 +30,7 @@ bool 'Symmetric multi-processing support' CONFIG_SMP
 define_bool CONFIG_HAVE_DEC_LOCK y
 define_bool CONFIG_ISA n
 define_bool CONFIG_EISA n
+define_bool CONFIG_MCA n
 define_bool CONFIG_PCMCIA n
 define_bool CONFIG_SBUS y
 define_bool CONFIG_SBUSCHAR y
index 5e96bf9c95fb211d2b38f299d1a576cd39b0c495..9c4f2e7f3c987f280c2e0b908ef7024e62040603 100644 (file)
@@ -77,6 +77,7 @@ static int atmtcp_send_control(struct atm_vcc *vcc,int type,
                set_current_state(TASK_UNINTERRUPTIBLE);
                schedule();
        }
+       current->state = TASK_RUNNING;
        remove_wait_queue(&vcc->sleep,&wait);
        return error;
 }
index 0bfa895b70e91187aee8194d4f7631da3f028920..afbf60ddccc9f7b3157c9474f30c5d84a18fe794 100644 (file)
@@ -44,8 +44,8 @@
 
 #define SMART2_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
 
-#define DRIVER_NAME "Compaq SMART2 Driver (v 2.4.0)"
-#define DRIVER_VERSION SMART2_DRIVER_VERSION(2,4,0)
+#define DRIVER_NAME "Compaq SMART2 Driver (v 2.4.1)"
+#define DRIVER_VERSION SMART2_DRIVER_VERSION(2,4,1)
 
 /* Embedded module documentation macros - see modules.h */
 /* Original author Chris Frantz - Compaq Computer Corporation */
@@ -1664,6 +1664,7 @@ static void getgeometry(int ctlr)
        int ret_code, size;
        drv_info_t *drv;
        ctlr_info_t *info_p = hba[ctlr];
+       int i;
 
        info_p->log_drv_map = 0;        
        
@@ -1729,7 +1730,8 @@ static void getgeometry(int ctlr)
         }
 
        info_p->log_drives = id_ctlr_buf->nr_drvs;;
-       *(__u32*)(info_p->firm_rev) = *(__u32*)(id_ctlr_buf->firm_rev);
+       for(i=0;i<4;i++)
+               info_p->firm_rev[i] = id_ctlr_buf->firm_rev[i];
        info_p->ctlr_sig = id_ctlr_buf->cfg_sig;
 
        printk(" (%s)\n", info_p->product_name);
index fbfde6329561a886da78b5a40f969c8fe2c92f16..ad370bcb7df731a971d572b882641c76d6bd959e 100644 (file)
@@ -347,10 +347,9 @@ static void generic_plug_device(request_queue_t *q, kdev_t dev)
  */
 static inline void __generic_unplug_device(request_queue_t *q)
 {
-       if (q->plugged) {
+       if (!list_empty(&q->queue_head)) {
                q->plugged = 0;
-               if (!list_empty(&q->queue_head))
-                       q->request_fn(q);
+               q->request_fn(q);
        }
 }
 
index 4e3066ba86a0aba3a742f0dd8f5212db4032fbee..e2e57cc9076361efa49cf9c5a01bcb99ff8205d8 100644 (file)
@@ -178,8 +178,8 @@ endmenu
 
 tristate '/dev/agpgart (AGP Support)' CONFIG_AGP $CONFIG_DRM_AGP
 if [ "$CONFIG_AGP" != "n" ]; then
-   bool '  Intel 440LX/BX/GX 840 support' CONFIG_AGP_INTEL
-   bool '  Intel I810/I815 support' CONFIG_AGP_I810
+   bool '  Intel 440LX/BX/GX and I815/I840 support' CONFIG_AGP_INTEL
+   bool '  Intel I810/I815 (on-board) support' CONFIG_AGP_I810
    bool '  VIA chipset support' CONFIG_AGP_VIA
    bool '  AMD Irongate support' CONFIG_AGP_AMD
    bool '  Generic SiS support' CONFIG_AGP_SIS
index f114ab3cf4b231d59a4171c2ab598b10bdbcff85..5d2b3de619a2a800a3b2ae1acc8ef53bb31c9c58 100644 (file)
@@ -2057,6 +2057,13 @@ static struct {
                "Intel",
                "440GX",
                intel_generic_setup },
+       /* could we add support for PCI_DEVICE_ID_INTEL_815_1 too ? */
+       { PCI_DEVICE_ID_INTEL_815_0,
+               PCI_VENDOR_ID_INTEL,
+               INTEL_I815,
+               "Intel",
+               "i815",
+               intel_generic_setup },
        { PCI_DEVICE_ID_INTEL_840_0,
                PCI_VENDOR_ID_INTEL,
                INTEL_I840,
index e5bdb6ccff8366d436fe96efa18415e0ba01cd8d..35b23d944edfcea6e422227616cb56f16bef7e7d 100644 (file)
@@ -2517,6 +2517,8 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
        firm_id = (struct FIRM_ID *)
                        (base_addr + ID_ADDRESS);
         if (!ISZLOADED(*cinfo)){
+            current->state = TASK_RUNNING;
+           remove_wait_queue(&info->open_wait, &wait);
            return -EINVAL;
        }
 
index ef7e252b584e61da88ec08b73ca0e1b54ed7b342..c996df8f4dc8c672f50aec788b6b6dac4b6bd7a2 100644 (file)
 #define __NO_VERSION__
 #include "drmP.h"
 #include <linux/module.h>
+#if LINUX_VERSION_CODE < 0x020400
+#include "agpsupport-pre24.h"
+#else
+#define DRM_AGP_GET (drm_agp_t *)inter_module_get("drm_agp")
+#define DRM_AGP_PUT inter_module_put("drm_agp")
+#endif
 
-const drm_agp_t *drm_agp_p;
+static const drm_agp_t *drm_agp = NULL;
 
 int drm_agp_info(struct inode *inode, struct file *filp, unsigned int cmd,
                 unsigned long arg)
@@ -42,7 +48,7 @@ int drm_agp_info(struct inode *inode, struct file *filp, unsigned int cmd,
        agp_kern_info    *kern;
        drm_agp_info_t   info;
 
-       if (!dev->agp->acquired || !(drm_agp_p->copy_info)) return -EINVAL;
+       if (!dev->agp->acquired || !drm_agp->copy_info) return -EINVAL;
 
        kern                   = &dev->agp->agp_info;
        info.agp_version_major = kern->version.major;
@@ -67,8 +73,8 @@ int drm_agp_acquire(struct inode *inode, struct file *filp, unsigned int cmd,
        drm_device_t     *dev    = priv->dev;
        int              retcode;
 
-       if (dev->agp->acquired || !(drm_agp_p->acquire)) return -EINVAL;
-       if ((retcode = (*(drm_agp_p->acquire))())) return retcode;
+       if (dev->agp->acquired || !drm_agp->acquire) return -EINVAL;
+       if ((retcode = drm_agp->acquire())) return retcode;
        dev->agp->acquired = 1;
        return 0;
 }
@@ -79,13 +85,18 @@ int drm_agp_release(struct inode *inode, struct file *filp, unsigned int cmd,
        drm_file_t       *priv   = filp->private_data;
        drm_device_t     *dev    = priv->dev;
 
-       if (!dev->agp->acquired || !(drm_agp_p->release)) return -EINVAL;
-       (*(drm_agp_p->release))();
+       if (!dev->agp->acquired || !drm_agp->release) return -EINVAL;
+       drm_agp->release();
        dev->agp->acquired = 0;
        return 0;
        
 }
 
+void _drm_agp_release(void)
+{
+       if (drm_agp->release) drm_agp->release();
+}
+
 int drm_agp_enable(struct inode *inode, struct file *filp, unsigned int cmd,
                   unsigned long arg)
 {
@@ -93,13 +104,13 @@ int drm_agp_enable(struct inode *inode, struct file *filp, unsigned int cmd,
        drm_device_t     *dev    = priv->dev;
        drm_agp_mode_t   mode;
 
-       if (!dev->agp->acquired || !(drm_agp_p->enable)) return -EINVAL;
+       if (!dev->agp->acquired || !drm_agp->enable) return -EINVAL;
 
        if (copy_from_user(&mode, (drm_agp_mode_t *)arg, sizeof(mode)))
                return -EFAULT;
        
        dev->agp->mode    = mode.mode;
-       (*(drm_agp_p->enable))(mode.mode);
+       drm_agp->enable(mode.mode);
        dev->agp->base    = dev->agp->agp_info.aper_base;
        dev->agp->enabled = 1;
        return 0;
@@ -191,7 +202,7 @@ int drm_agp_bind(struct inode *inode, struct file *filp, unsigned int cmd,
        int               retcode;
        int               page;
        
-       if (!dev->agp->acquired || !(drm_agp_p->bind_memory)) return -EINVAL;
+       if (!dev->agp->acquired || !drm_agp->bind_memory) return -EINVAL;
        if (copy_from_user(&request, (drm_agp_binding_t *)arg, sizeof(request)))
                return -EFAULT;
        if (!(entry = drm_agp_lookup_entry(dev, request.handle)))
@@ -232,14 +243,12 @@ drm_agp_head_t *drm_agp_init(void)
 {
        drm_agp_head_t *head         = NULL;
 
-       drm_agp_p = (drm_agp_t *)inter_module_get("drm_agp");
-       DRM_DEBUG("drm_agp_p = %p\n", drm_agp_p);
-
-       if (drm_agp_p) {
+       drm_agp = DRM_AGP_GET;
+       if (drm_agp) {
                if (!(head = drm_alloc(sizeof(*head), DRM_MEM_AGPLISTS)))
                        return NULL;
                memset((void *)head, 0, sizeof(*head));
-               (*(drm_agp_p->copy_info))(&head->agp_info);
+               drm_agp->copy_info(&head->agp_info);
                if (head->agp_info.chipset == NOT_SUPPORTED) {
                        drm_free(head, sizeof(*head), DRM_MEM_AGPLISTS);
                        return NULL;
@@ -289,5 +298,31 @@ drm_agp_head_t *drm_agp_init(void)
 
 void drm_agp_uninit(void)
 {
-       inter_module_put("drm_agp");
+       DRM_AGP_PUT;
+       drm_agp = NULL;
+}
+
+agp_memory *drm_agp_allocate_memory(size_t pages, u32 type)
+{
+       if (!drm_agp->allocate_memory) return NULL;
+       return drm_agp->allocate_memory(pages, type);
+}
+
+int drm_agp_free_memory(agp_memory *handle)
+{
+       if (!handle || !drm_agp->free_memory) return 0;
+       drm_agp->free_memory(handle);
+       return 1;
+}
+
+int drm_agp_bind_memory(agp_memory *handle, off_t start)
+{
+       if (!handle || !drm_agp->bind_memory) return -EINVAL;
+       return drm_agp->bind_memory(handle, start);
+}
+
+int drm_agp_unbind_memory(agp_memory *handle)
+{
+       if (!handle || !drm_agp->unbind_memory) return -EINVAL;
+       return drm_agp->unbind_memory(handle);
 }
index 5cc3ec36973d6fdda0637cd37bcf6439d0a0475d..56dd2441efe8c4ed059f29bc42bb117b757e3285 100644 (file)
@@ -405,6 +405,7 @@ int drm_dma_enqueue(drm_device_t *dev, drm_dma_t *d)
                        schedule();
                        if (signal_pending(current)) {
                                atomic_dec(&q->use_count);
+                               remove_wait_queue(&q->write_queue, &entry);
                                return -EINTR;
                        }
                }
index 28001c3814e5ba3f83eb933116171873554aa6f9..affeae705ce55796063535e03a51e6f99c61611e 100644 (file)
@@ -510,7 +510,6 @@ typedef struct drm_agp_head {
        unsigned long      base;
        int                agp_mtrr;
 } drm_agp_head_t;
-
 #endif
 
 typedef struct drm_sigdata {
@@ -812,6 +811,7 @@ extern drm_agp_head_t *drm_agp_init(void);
 extern void           drm_agp_uninit(void);
 extern int            drm_agp_acquire(struct inode *inode, struct file *filp,
                                      unsigned int cmd, unsigned long arg);
+extern void           _drm_agp_release(void);
 extern int            drm_agp_release(struct inode *inode, struct file *filp,
                                      unsigned int cmd, unsigned long arg);
 extern int            drm_agp_enable(struct inode *inode, struct file *filp,
@@ -826,6 +826,10 @@ extern int            drm_agp_unbind(struct inode *inode, struct file *filp,
                                     unsigned int cmd, unsigned long arg);
 extern int            drm_agp_bind(struct inode *inode, struct file *filp,
                                   unsigned int cmd, unsigned long arg);
+extern agp_memory     *drm_agp_allocate_memory(size_t pages, u32 type);
+extern int            drm_agp_free_memory(agp_memory *handle);
+extern int            drm_agp_bind_memory(agp_memory *handle, off_t start);
+extern int            drm_agp_unbind_memory(agp_memory *handle);
 #endif
 #endif
 #endif
index c02a93ee30883b9ca831d98db830cb778b5bfe1e..7152eac3a5eb113b8e33a97bc1b99f8156241b74 100644 (file)
@@ -255,8 +255,7 @@ static int i810_takedown(drm_device_t *dev)
                }
                dev->agp->memory = NULL;
 
-               if (dev->agp->acquired && drm_agp_p->release)
-                       (*(drm_agp_p->release))();
+               if (dev->agp->acquired) _drm_agp_release();
 
                dev->agp->acquired = 0;
                dev->agp->enabled  = 0;
index 4a8cb8b5c738ba7da339a7645bf96cb96da6076f..261fb34a3205d7d323fd6332e747aded75ef0f89 100644 (file)
@@ -352,16 +352,13 @@ agp_memory *drm_alloc_agp(int pages, u32 type)
                return NULL;
        }
        
-       if (drm_agp_p->allocate_memory) {
-               if ((handle = (*(drm_agp_p->allocate_memory))(pages,
-                                                        type))) {
-                       spin_lock(&drm_mem_lock);
-                       ++drm_mem_stats[DRM_MEM_TOTALAGP].succeed_count;
-                       drm_mem_stats[DRM_MEM_TOTALAGP].bytes_allocated
-                               += pages << PAGE_SHIFT;
-                       spin_unlock(&drm_mem_lock);
-                       return handle;
-               }
+       if ((handle = drm_agp_allocate_memory(pages, type))) {
+               spin_lock(&drm_mem_lock);
+               ++drm_mem_stats[DRM_MEM_TOTALAGP].succeed_count;
+               drm_mem_stats[DRM_MEM_TOTALAGP].bytes_allocated
+                       += pages << PAGE_SHIFT;
+               spin_unlock(&drm_mem_lock);
+               return handle;
        }
        spin_lock(&drm_mem_lock);
        ++drm_mem_stats[DRM_MEM_TOTALAGP].fail_count;
@@ -381,8 +378,7 @@ int drm_free_agp(agp_memory *handle, int pages)
                return retval;;
        }
        
-       if (drm_agp_p->free_memory) {
-               (*(drm_agp_p->free_memory))(handle);
+       if (drm_agp_free_memory(handle)) {
                spin_lock(&drm_mem_lock);
                free_count  = ++drm_mem_stats[DRM_MEM_TOTALAGP].free_count;
                alloc_count =   drm_mem_stats[DRM_MEM_TOTALAGP].succeed_count;
@@ -403,24 +399,19 @@ int drm_bind_agp(agp_memory *handle, unsigned int start)
 {
        int retcode = -EINVAL;
 
-   DRM_DEBUG("drm_bind_agp called\n");
        if (!handle) {
                DRM_MEM_ERROR(DRM_MEM_BOUNDAGP,
                              "Attempt to bind NULL AGP handle\n");
                return retcode;
        }
 
-   DRM_DEBUG("drm_agp_p->bind_memory : %p\n", drm_agp_p->bind_memory);
-       if (drm_agp_p->bind_memory) {
-               if (!(retcode = (*(drm_agp_p->bind_memory))(handle, start))) {
-                       spin_lock(&drm_mem_lock);
-                       ++drm_mem_stats[DRM_MEM_BOUNDAGP].succeed_count;
-                       drm_mem_stats[DRM_MEM_BOUNDAGP].bytes_allocated
-                               += handle->page_count << PAGE_SHIFT;
-                       spin_unlock(&drm_mem_lock);
-                  DRM_DEBUG("drm_agp_p->bind_memory: retcode %d\n", retcode);
-                       return retcode;
-               }
+       if (!(retcode = drm_agp_bind_memory(handle, start))) {
+               spin_lock(&drm_mem_lock);
+               ++drm_mem_stats[DRM_MEM_BOUNDAGP].succeed_count;
+               drm_mem_stats[DRM_MEM_BOUNDAGP].bytes_allocated
+                       += handle->page_count << PAGE_SHIFT;
+               spin_unlock(&drm_mem_lock);
+               return retcode;
        }
        spin_lock(&drm_mem_lock);
        ++drm_mem_stats[DRM_MEM_BOUNDAGP].fail_count;
@@ -440,20 +431,17 @@ int drm_unbind_agp(agp_memory *handle)
                return retcode;
        }
 
-       if (drm_agp_p->unbind_memory) {
-               int c = handle->page_count;
-               if ((retcode = (*(drm_agp_p->unbind_memory))(handle)))
-                       return retcode;
-               spin_lock(&drm_mem_lock);
-               free_count  = ++drm_mem_stats[DRM_MEM_BOUNDAGP].free_count;
-               alloc_count = drm_mem_stats[DRM_MEM_BOUNDAGP].succeed_count;
-               drm_mem_stats[DRM_MEM_BOUNDAGP].bytes_freed += c << PAGE_SHIFT;
-               spin_unlock(&drm_mem_lock);
-               if (free_count > alloc_count) {
-                       DRM_MEM_ERROR(DRM_MEM_BOUNDAGP,
-                                     "Excess frees: %d frees, %d allocs\n",
-                                     free_count, alloc_count);
-               }
+       if ((retcode = drm_agp_unbind_memory(handle))) return retcode;
+       spin_lock(&drm_mem_lock);
+       free_count  = ++drm_mem_stats[DRM_MEM_BOUNDAGP].free_count;
+       alloc_count = drm_mem_stats[DRM_MEM_BOUNDAGP].succeed_count;
+       drm_mem_stats[DRM_MEM_BOUNDAGP].bytes_freed
+               += handle->page_count << PAGE_SHIFT;
+       spin_unlock(&drm_mem_lock);
+       if (free_count > alloc_count) {
+               DRM_MEM_ERROR(DRM_MEM_BOUNDAGP,
+                             "Excess frees: %d frees, %d allocs\n",
+                             free_count, alloc_count);
        }
        return retcode;
 }
index 0f1b87b8be4f1c87efd1c6d47a24f0246f5dddff..883eb75ca0311125cfc5ef14a4850d78007946a3 100644 (file)
@@ -255,8 +255,7 @@ static int mga_takedown(drm_device_t *dev)
                }
                dev->agp->memory = NULL;
 
-               if (dev->agp->acquired && drm_agp_p->release)
-                       (*(drm_agp_p->release))();
+               if (dev->agp->acquired) _drm_agp_release();
 
                dev->agp->acquired = 0;
                dev->agp->enabled  = 0;
index 9bbd254c1bea42ad4f3da765e0ad8382e70582a1..6ac3d6059c6edecfb18f7aeb151e0912d343cc84 100644 (file)
@@ -287,7 +287,7 @@ static void mgaG400EmitPipe(drm_mga_private_t * dev_priv)
 
                        PRIMOUTREG(MGAREG_TEXCTL2, 0x80 | 0x00008000);
                        PRIMOUTREG(MGAREG_LEN + MGAREG_MGA_EXEC, 0);
-                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_TEXCTL2, 0x00008000);
                        PRIMOUTREG(MGAREG_DMAPAD, 0);
                }
 
index ac6f73bcde0c64a319a34c08816b7e912ff0e00f..8a4842cf346cd997fa2a7cb2841f67107cc2715f 100644 (file)
@@ -57,9 +57,9 @@ typedef struct drm_r128_init {
 } drm_r128_init_t;
 
 typedef struct drm_r128_packet {
-       unsigned long *buffer;
-       int            count;
-       int            flags;
+       unsigned int *buffer;
+       int          count;
+       int          flags;
 } drm_r128_packet_t;
 
 typedef enum drm_r128_prim {
index 70d17f43d3d0bd86d5effc5d847a72b565d6fc40..969ada93f58244079e1b38f953d8f299cfbdf703 100644 (file)
@@ -252,8 +252,7 @@ static int r128_takedown(drm_device_t *dev)
                }
                dev->agp->memory = NULL;
 
-               if (dev->agp->acquired && drm_agp_p->release)
-                       (*(drm_agp_p->release))();
+               if (dev->agp->acquired) _drm_agp_release();
 
                dev->agp->acquired = 0;
                dev->agp->enabled  = 0;
index 26e0f60194a0a5964c872aa4b5084d0a4186a92b..7d79a013b7bb75674d7a32fa1e8bc72794f3c6fa 100644 (file)
@@ -235,7 +235,7 @@ static int tdfx_takedown(drm_device_t *dev)
                        drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
                        temp = temp_next;
                }
-               if (dev->agp->acquired) (*(drm_agp_p->release))();
+               if (dev->agp->acquired) _drm_agp_release();
        }
 #endif
                                /* Clear vma list (only built for debugging) */
index e41b4e5622c2d3e285496bca26fdeb446fb0cfb7..3e8c404df067d3ef78f7b09d4aef3c589a22a437 100644 (file)
@@ -1077,4 +1077,3 @@ EXPORT_SYMBOL(gs_init_port);
 EXPORT_SYMBOL(gs_setserial);
 EXPORT_SYMBOL(gs_getserial);
 
-EXPORT_SYMBOL(gs_debug);
index 573eac51b2368d5af74e85bedd7cf8593ad75281..838deb09c0ee229bb7caaa8841e0a9f1e5eee44d 100644 (file)
@@ -58,7 +58,6 @@ struct ns558 {
 };
        
 static struct ns558 *ns558;
-static int have_pci_devices;
 
 /*
  * ns558_isa_probe() tries to find an isa gameport at the
@@ -316,9 +315,8 @@ int __init ns558_init(void)
  * it is the least-invasive probe.
  */
 
-       i = pci_module_init(&ns558_pci_driver);
-       if (i == 0)
-               have_pci_devices = 1;
+       i = pci_register_driver(&ns558_pci_driver);
+       if (i < 0) return i;
 
 /*
  * Probe for ISA ports.
@@ -339,7 +337,7 @@ int __init ns558_init(void)
        }
 #endif
 
-       return ns558 ? 0 : -ENODEV;
+       return 0;
 }
 
 void __exit ns558_exit(void)
@@ -368,8 +366,7 @@ void __exit ns558_exit(void)
                port = port->next;
        }
 
-       if (have_pci_devices)
-               pci_unregister_driver(&ns558_pci_driver);
+       pci_unregister_driver(&ns558_pci_driver);
 }
 
 module_init(ns558_init);
index 7ff56f84f15ee0d19490aba06c21ab9693c5fb11..6b0e3d298adc0c2816ea29400a8d12af41816041 100644 (file)
@@ -1103,8 +1103,6 @@ void fix_rio_pci (PDEV)
 #define rio_init init_module
 #endif
 
-extern int gs_debug;
-
 int rio_init(void) 
 {
   int found = 0;
@@ -1129,7 +1127,6 @@ int rio_init(void)
   func_enter();
   rio_dprintk (RIO_DEBUG_INIT, "Initing rio module... (rio_debug=%d)\n", 
               rio_debug);
-  gs_debug = rio_debug >> 24;
 
   if (abs ((long) (&rio_debug) - rio_debug) < 0x10000) {
     printk (KERN_WARNING "rio: rio_debug is an address, instead of a value. "
index 3dd5811d96b044eb1bee49cdb68e6cac4987366a..9026421513ed0e8d1020bf1335487f02a55f95f4 100644 (file)
@@ -1756,16 +1756,12 @@ static int sx_fw_ioctl (struct inode *inode, struct file *filp,
                        sx_initialized++;
                break;
        case SXIO_SETDEBUG:
+       case SXIO_SETGSDEBUG:
                sx_debug = arg;
                break;
        case SXIO_GETDEBUG:
-               rc = sx_debug;
-               break;
-       case SXIO_SETGSDEBUG:
-               gs_debug = arg;
-               break;
        case SXIO_GETGSDEBUG:
-               rc = gs_debug;
+               rc = sx_debug;
                break;
        case SXIO_GETNPORTS:
                rc = sx_nports;
index 2acb1a6de08cf8ef319626862c762442bd49d56a..1ff42d3b70da2f439dc69e8046661f31c32ecc02 100644 (file)
@@ -148,11 +148,10 @@ setup_netjet_s(struct IsdnCard *card))
                return(0);
        test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags);
 
-       for ( ;; )
-       {
-
 #if CONFIG_PCI
 
+       for ( ;; )
+       {
                if (!pci_present()) {
                        printk(KERN_ERR "Netjet: no PCI bus present\n");
                        return(0);
index 5ad977128717c9199c5faebc9dac0316a9881806..57de4b44b64c5d93799e26168408be8153dde346 100644 (file)
@@ -150,11 +150,10 @@ setup_netjet_u(struct IsdnCard *card))
                return(0);
        test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags);
 
-       for ( ;; )
-       {
-
 #if CONFIG_PCI
 
+       for ( ;; )
+       {
                if (!pci_present()) {
                        printk(KERN_ERR "NETspider-U: no PCI bus present\n");
                        return(0);
index c2662fbb06daef341623cc22e9dd66012b5dd24a..e765d91fcbe8b2e25bbbaaaf0c88df991ad5cc4f 100644 (file)
@@ -770,6 +770,8 @@ static void cfi_intelext_sync (struct mtd_info *mtd)
                        spin_unlock_bh(chip->mutex);
                        schedule();
                        
+                       remove_wait_queue(&chip->wq, &wait);
+
                        goto retry;
                }
        }
index 176bcbcc0aca86c9bbe75e3a551470ef50b520d7..d6cce6474775066eb56e06aa146950d920adc4f4 100644 (file)
@@ -501,8 +501,11 @@ printk("sync\n");
                        add_wait_queue(&chip->wq, &wait);
                        
                        spin_unlock_bh(chip->mutex);
+
                        schedule();
                        
+                       remove_wait_queue(&chip->wq, &wait);
+
                        goto retry;
                }
        }
index ddc4b9ac5f118077bcdea48413c67c57d0ba66b6..e578ca3f8c271c58b0be76557bf39ae8c304f61d 100644 (file)
@@ -100,7 +100,7 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
    if [ "$CONFIG_ISA" = "y" -o "$CONFIG_EISA" = "y" -o "$CONFIG_PCI" = "y" ]; then
       tristate '  HP 10/100VG PCLAN (ISA, EISA, PCI) support' CONFIG_HP100
    fi
-   bool '  Other ISA cards' CONFIG_NET_ISA
+   dep_bool '  Other ISA cards' CONFIG_NET_ISA $CONFIG_ISA
    if [ "$CONFIG_NET_ISA" = "y" ]; then
       tristate '    Cabletron E21xx support' CONFIG_E2100
       if [ "$CONFIG_OBSOLETE" = "y" ]; then
index 1edf7383392a9dc8f0682af3f2fd80d6ab54620c..ebdcd30e8e8f4f7d5e2c15936ca5293a15452bd6 100644 (file)
@@ -459,14 +459,6 @@ static int __init fddiif_probe(struct net_device *dev)
 #endif
 
 
-/* Pad device name to IFNAMSIZ=16. F.e. __PAD6 is string of 9 zeros. */
-#define __PAD6 "\0\0\0\0\0\0\0\0\0"
-#define __PAD5 __PAD6 "\0"
-#define __PAD4 __PAD5 "\0"
-#define __PAD3 __PAD4 "\0"
-#define __PAD2 __PAD3 "\0"
-
-
 #ifdef CONFIG_NET_FC
 static int fcif_probe(struct net_device *dev)
 {
@@ -486,14 +478,14 @@ static int fcif_probe(struct net_device *dev)
 
 
 #ifdef CONFIG_ETHERTAP
-    static struct net_device tap0_dev = { "tap0" __PAD4, 0, 0, 0, 0, NETLINK_TAPBASE, 0, 0, 0, 0, NEXT_DEV, ethertap_probe, };
+    static struct net_device tap0_dev = { "tap0", 0, 0, 0, 0, NETLINK_TAPBASE, 0, 0, 0, 0, NEXT_DEV, ethertap_probe, };
 #   undef NEXT_DEV
 #   define NEXT_DEV    (&tap0_dev)
 #endif
 
 #ifdef CONFIG_SDLA
     extern int sdla_init(struct net_device *);
-    static struct net_device sdla0_dev = { "sdla0" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, sdla_init, };
+    static struct net_device sdla0_dev = { "sdla0", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, sdla_init, };
 
 #   undef NEXT_DEV
 #   define NEXT_DEV    (&sdla0_dev)
@@ -502,7 +494,7 @@ static int fcif_probe(struct net_device *dev)
 #if defined(CONFIG_LTPC)
     extern int ltpc_probe(struct net_device *);
     static struct net_device dev_ltpc = {
-        "lt0" __PAD3,
+        "lt0",
                 0, 0, 0, 0,
                 0x0, 0,
                 0, 0, 0, NEXT_DEV, ltpc_probe };
@@ -512,9 +504,9 @@ static int fcif_probe(struct net_device *dev)
 
 #if defined(CONFIG_COPS)
     extern int cops_probe(struct net_device *);
-    static struct net_device cops2_dev = { "lt2" __PAD3, 0, 0, 0, 0, 0x0, 0, 0, 0, 0, NEXT_DEV, cops_probe };
-    static struct net_device cops1_dev = { "lt1" __PAD3, 0, 0, 0, 0, 0x0, 0, 0, 0, 0, &cops2_dev, cops_probe };
-    static struct net_device cops0_dev = { "lt0" __PAD3, 0, 0, 0, 0, 0x0, 0, 0, 0, 0, &cops1_dev, cops_probe };
+    static struct net_device cops2_dev = { "lt2", 0, 0, 0, 0, 0x0, 0, 0, 0, 0, NEXT_DEV, cops_probe };
+    static struct net_device cops1_dev = { "lt1", 0, 0, 0, 0, 0x0, 0, 0, 0, 0, &cops2_dev, cops_probe };
+    static struct net_device cops0_dev = { "lt0", 0, 0, 0, 0, 0x0, 0, 0, 0, 0, &cops1_dev, cops_probe };
 #   undef NEXT_DEV
 #   define NEXT_DEV     (&cops0_dev)
 #endif  /* COPS */
@@ -535,22 +527,22 @@ static int fcif_probe(struct net_device *dev)
 #define ETH_NOPROBE_ADDR 0xffe0
 
 static struct net_device eth7_dev = {
-    "eth%d" __PAD5, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, NEXT_DEV, ethif_probe };
+    "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, NEXT_DEV, ethif_probe };
 static struct net_device eth6_dev = {
-    "eth%d" __PAD5, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth7_dev, ethif_probe };
+    "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth7_dev, ethif_probe };
 static struct net_device eth5_dev = {
-    "eth%d" __PAD5, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth6_dev, ethif_probe };
+    "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth6_dev, ethif_probe };
 static struct net_device eth4_dev = {
-    "eth%d" __PAD5, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth5_dev, ethif_probe };
+    "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth5_dev, ethif_probe };
 static struct net_device eth3_dev = {
-    "eth%d" __PAD5, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth4_dev, ethif_probe };
+    "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth4_dev, ethif_probe };
 static struct net_device eth2_dev = {
-    "eth%d" __PAD5, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth3_dev, ethif_probe };
+    "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth3_dev, ethif_probe };
 static struct net_device eth1_dev = {
-    "eth%d" __PAD5, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth2_dev, ethif_probe };
+    "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth2_dev, ethif_probe };
 
 static struct net_device eth0_dev = {
-    "eth%d" __PAD5, 0, 0, 0, 0, ETH0_ADDR, ETH0_IRQ, 0, 0, 0, &eth1_dev, ethif_probe };
+    "eth%d", 0, 0, 0, 0, ETH0_ADDR, ETH0_IRQ, 0, 0, 0, &eth1_dev, ethif_probe };
 
 #   undef NEXT_DEV
 #   define NEXT_DEV    (&eth0_dev)
@@ -582,21 +574,21 @@ trif_probe(struct net_device *dev)
     return 0;
 }
 static struct net_device tr7_dev = {
-    "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, NEXT_DEV, trif_probe };
+    "tr%d",0,0,0,0,0,0,0,0,0, NEXT_DEV, trif_probe };
 static struct net_device tr6_dev = {
-    "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, &tr7_dev, trif_probe };
+    "tr%d",0,0,0,0,0,0,0,0,0, &tr7_dev, trif_probe };
 static struct net_device tr5_dev = {
-    "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, &tr6_dev, trif_probe };
+    "tr%d",0,0,0,0,0,0,0,0,0, &tr6_dev, trif_probe };
 static struct net_device tr4_dev = {
-    "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, &tr5_dev, trif_probe };
+    "tr%d",0,0,0,0,0,0,0,0,0, &tr5_dev, trif_probe };
 static struct net_device tr3_dev = {
-    "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, &tr4_dev, trif_probe };
+    "tr%d",0,0,0,0,0,0,0,0,0, &tr4_dev, trif_probe };
 static struct net_device tr2_dev = {
-    "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, &tr3_dev, trif_probe };
+    "tr%d",0,0,0,0,0,0,0,0,0, &tr3_dev, trif_probe };
 static struct net_device tr1_dev = {
-    "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, &tr2_dev, trif_probe };
+    "tr%d",0,0,0,0,0,0,0,0,0, &tr2_dev, trif_probe };
 static struct net_device tr0_dev = {
-    "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, &tr1_dev, trif_probe };
+    "tr%d",0,0,0,0,0,0,0,0,0, &tr1_dev, trif_probe };
 #   undef       NEXT_DEV
 #   define      NEXT_DEV        (&tr0_dev)
 
@@ -604,21 +596,21 @@ static struct net_device tr0_dev = {
 
 #ifdef CONFIG_FDDI
        static struct net_device fddi7_dev =
-               {"fddi7" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, fddiif_probe};
+               {"fddi7", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, fddiif_probe};
        static struct net_device fddi6_dev =
-               {"fddi6" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi7_dev, fddiif_probe};
+               {"fddi6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi7_dev, fddiif_probe};
        static struct net_device fddi5_dev =
-               {"fddi5" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi6_dev, fddiif_probe};
+               {"fddi5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi6_dev, fddiif_probe};
        static struct net_device fddi4_dev =
-               {"fddi4" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi5_dev, fddiif_probe};
+               {"fddi4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi5_dev, fddiif_probe};
        static struct net_device fddi3_dev =
-               {"fddi3" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi4_dev, fddiif_probe};
+               {"fddi3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi4_dev, fddiif_probe};
        static struct net_device fddi2_dev =
-               {"fddi2" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi3_dev, fddiif_probe};
+               {"fddi2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi3_dev, fddiif_probe};
        static struct net_device fddi1_dev =
-               {"fddi1" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi2_dev, fddiif_probe};
+               {"fddi1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi2_dev, fddiif_probe};
        static struct net_device fddi0_dev =
-               {"fddi0" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi1_dev, fddiif_probe};
+               {"fddi0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi1_dev, fddiif_probe};
 #undef NEXT_DEV
 #define        NEXT_DEV        (&fddi0_dev)
 #endif 
index 2a3ae2aa867678f8a7dc58d663003dc3214ec48b..af42b44416cce09f7a13631120fe5fe60e0147d6 100644 (file)
@@ -490,17 +490,12 @@ static int lance_open (struct net_device *dev)
        volatile struct lance_regs *ll = lp->ll;
        int ret;
 
-       MOD_INC_USE_COUNT;
-
        last_dev = dev;
 
        /* Install the Interrupt handler */
        ret = request_irq(IRQ_AMIGA_PORTS, lance_interrupt, SA_SHIRQ,
                          dev->name, dev);
-       if (ret) {
-               MOD_DEC_USE_COUNT;
-               return ret;
-       }
+       if (ret) return ret;
 
        /* Stop the Lance */
        ll->rap = LE_CSR0;
@@ -527,9 +522,6 @@ static int lance_close (struct net_device *dev)
        ll->rdp = LE_C0_STOP;
 
        free_irq(IRQ_AMIGA_PORTS, dev);
-
-       MOD_DEC_USE_COUNT;
-
        return 0;
 }
 
@@ -759,7 +751,8 @@ static int __init a2065_probe(void)
                        release_resource(r2);
                        return -ENOMEM;
                }
-               priv = (struct lance_private *)dev->priv;
+               SET_MODULE_OWNER(dev);
+               priv = dev->priv;
 
                r1->name = dev->name;
                r2->name = dev->name;
index c5def9e399ff2e18a8be1464db658e56a77486e0..7d5e67b5c6436cdb727754813a95d28227c71b46 100644 (file)
@@ -2574,7 +2574,7 @@ MODULE_PARM(awc_simple_bridge,"i");
 MODULE_PARM(max_mtu,"i");
 MODULE_PARM(large_buff_mem,"i");
 MODULE_PARM(small_buff_no,"i");
-MODULE_PARM(SSID,"1-4c31");
+MODULE_PARM(SSID,"c33");
 #endif
 
 /*EXPORT_SYMBOL(tx_queue_len);
index beea30afb7799fe92e68af7e83682e4af9b0623e..c23158807f04e037ee873722645f20fb80ece661 100644 (file)
@@ -287,15 +287,11 @@ am79c961_open(struct net_device *dev)
        struct dev_priv *priv = (struct dev_priv *)dev->priv;
        int ret;
 
-       MOD_INC_USE_COUNT;
-
        memset (&priv->stats, 0, sizeof (priv->stats));
 
        ret = request_irq(dev->irq, am79c961_interrupt, 0, dev->name, dev);
-       if (ret) {
-               MOD_DEC_USE_COUNT;
+       if (ret)
                return ret;
-       }
 
        am79c961_init_for_open(dev);
 
@@ -322,7 +318,6 @@ am79c961_close(struct net_device *dev)
 
        free_irq (dev->irq, dev);
 
-       MOD_DEC_USE_COUNT;
        return 0;
 }
 
@@ -659,7 +654,8 @@ static int __init am79c961_init(void)
        if (!dev)
                goto out;
 
-       priv = (struct dev_priv *) dev->priv;
+       SET_MODULE_OWNER(dev);
+       priv = dev->priv;
 
        /*
         * Fixed address and IRQ lines here.
index 15ef3cc4818b2e95b3aca8ce31da14e473e5fc99..fe24effde169ca9b065d9a2e0512c621c31cc688 100644 (file)
@@ -129,7 +129,9 @@ int __init apne_probe(struct net_device *dev)
 
        if (apne_owned)
                return -ENODEV;
-        
+
+       SET_MODULE_OWNER(dev);
+
        if ( !(AMIGAHW_PRESENT(PCMCIA)) )
                return (-ENODEV);
                                 
@@ -329,7 +331,6 @@ static int
 apne_open(struct net_device *dev)
 {
     ei_open(dev);
-    MOD_INC_USE_COUNT;
     return 0;
 }
 
@@ -339,7 +340,6 @@ apne_close(struct net_device *dev)
     if (ei_debug > 1)
        printk("%s: Shutting down ethercard.\n", dev->name);
     ei_close(dev);
-    MOD_DEC_USE_COUNT;
     return 0;
 }
 
@@ -547,12 +547,13 @@ static void apne_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 }
 
 #ifdef MODULE
-static struct net_device apne_dev = { init: apne_probe };
+static struct net_device apne_dev;
 
 int init_module(void)
 {
        int err;
 
+       apne_dev.init = apne_probe;
        if ((err = register_netdev(&apne_dev))) {
                if (err == -EIO)
                        printk("No PCMCIA NEx000 ethernet card found.\n");
index fb4dcf5e81999c3ac6655507141ebcac95866f73..0283ff3b93e91ab0e78dc3286eb4a7cd43a45b29 100644 (file)
@@ -86,6 +86,8 @@ int __init ariadne2_probe(struct net_device *dev)
     unsigned long board, ioaddr;
     int err;
 
+    SET_MODULE_OWNER(dev);
+
     while ((z = zorro_find_device(ZORRO_PROD_VILLAGE_TRONIC_ARIADNE2, z))) {
        board = z->resource.start;
        ioaddr = board+ARIADNE2_BASE*2;
@@ -212,7 +214,6 @@ static int __init ariadne2_init(struct net_device *dev, unsigned long board)
 static int ariadne2_open(struct net_device *dev)
 {
     ei_open(dev);
-    MOD_INC_USE_COUNT;
     return 0;
 }
 
@@ -221,7 +222,6 @@ static int ariadne2_close(struct net_device *dev)
     if (ei_debug > 1)
        printk("%s: Shutting down ethercard.\n", dev->name);
     ei_close(dev);
-    MOD_DEC_USE_COUNT;
     return 0;
 }
 
@@ -380,15 +380,15 @@ static void ariadne2_block_output(struct net_device *dev, int count,
 }
 
 #ifdef MODULE
-static struct net_device ariadne2_dev = { init: ariadne2_probe };
+static struct net_device ariadne2_dev;
 
 int init_module(void)
 {
     int err;
 
+    ariadne2_dev.init = ariadne2_probe;
     if ((err = register_netdev(&ariadne2_dev))) {
-       if (err == -EIO)
-           printk("No AriadNE2 ethernet card found.\n");
+       printk(KERN_WARNING "No AriadNE2 ethernet card found.\n");
        return err;
     }
     return 0;
index 5271b5be4d81dd0702be7cacd3b3b226a57f55ff..cec860fe0a52714dd08c78575a43feb10ad4f1e9 100644 (file)
@@ -1069,6 +1069,8 @@ int __init arlan_probe_everywhere(struct net_device *dev)
        int probed = 0;
        int found = 0;
 
+       SET_MODULE_OWNER(dev);
+
        ARLAN_DEBUG_ENTRY("arlan_probe_everywhere");
        if (mem != 0 && numDevices == 1)        /* Check a single specified location. */
        {
@@ -1324,7 +1326,6 @@ static int arlan_open(struct net_device *dev)
        udelay(200000);
        add_timer(&priv->timer);
 
-       MOD_INC_USE_COUNT;
 #ifdef CONFIG_PROC_FS
 #ifndef MODULE
        if (arlan_device[0])
@@ -1888,7 +1889,6 @@ static int arlan_close(struct net_device *dev)
        priv->open_time = 0;
        netif_stop_queue(dev);
        free_irq(dev->irq, dev);
-       MOD_DEC_USE_COUNT;
 
        ARLAN_DEBUG_EXIT("arlan_close");
        return 0;
index b33e8157808fdff24b430e4ccca2425817d3a9db..96689c38454bba88a55c948c2550798d93d5185b 100644 (file)
@@ -190,10 +190,12 @@ struct at1720_mca_adapters_struct at1720_mca_adapters[] = {
    (detachable devices only).
    */
 
-int at1700_probe(struct net_device *dev)
+int __init at1700_probe(struct net_device *dev)
 {
        int i;
-       int base_addr = dev ? dev->base_addr : 0;
+       int base_addr = dev->base_addr;
+
+       SET_MODULE_OWNER(dev);
 
        if (base_addr > 0x1ff)          /* Check a single specified location. */
                return at1700_probe1(dev, base_addr);
@@ -532,9 +534,6 @@ static int net_open(struct net_device *dev)
        }
 
        netif_start_queue(dev);
-
-       MOD_INC_USE_COUNT;
-
        return 0;
 }
 
@@ -784,9 +783,6 @@ static int net_close(struct net_device *dev)
 
        /* Power-down the chip.  Green, green, green! */
        outb(0x00, ioaddr + CONFIG_1);
-
-       MOD_DEC_USE_COUNT;
-
        return 0;
 }
 
index 275ef3296bf6c68a6e956c916e3f5d4f495f659d..215198090cee258305a2df85bdb92eb616d8e776 100644 (file)
@@ -353,9 +353,8 @@ bionet_probe(struct net_device *dev){
                return -ENODEV;
        }
 
+       SET_MODULE_OWNER(dev);
 
-       if (dev == NULL)
-               return -ENODEV;
        if (bionet_debug > 0 && version_printed++ == 0)
                printk(version);
 
@@ -425,7 +424,6 @@ bionet_open(struct net_device *dev) {
        bionet_timer.data = (long)dev;
        bionet_timer.expires = jiffies + lp->poll_time;
        add_timer(&bionet_timer);
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
@@ -629,7 +627,6 @@ bionet_close(struct net_device *dev) {
        dev->start = 0;
 
        stdma_release();
-       MOD_DEC_USE_COUNT;
        return 0;
 }
 
@@ -645,19 +642,13 @@ static struct net_device_stats *net_get_stats(struct net_device *dev)
 
 #ifdef MODULE
 
-static char bio_name[16];
-static struct net_device bio_dev =
-       {
-               bio_name,       /* filled in by register_netdev() */
-               0, 0, 0, 0,     /* memory */
-               0, 0,           /* base, irq */
-               0, 0, 0, NULL, bionet_probe,
-       };
+static struct net_device bio_dev;
 
 int
 init_module(void) {
        int err;
 
+       bio_dev.init = bionet_probe;
        if ((err = register_netdev(&bio_dev))) {
                if (err == -EEXIST)  {
                        printk("BIONET: devices already present. Module not loaded.\n");
index 6aeb737d5d864e72f9170d827a41fffc8968273d..a9b016519db4923b8bdd8cddaa4c0c3260633989 100644 (file)
@@ -561,7 +561,7 @@ bad:
 /* Check for a network adaptor of this type, and return '0' if one exists.
  */
 
-extern int __init 
+int __init 
 pamsnet_probe (dev)
        struct net_device *dev;
 {
@@ -576,6 +576,8 @@ pamsnet_probe (dev)
        if (no_more_found)
                return -ENODEV;
 
+       SET_MODULE_OWNER(dev);
+
        no_more_found = 1;
 
        printk("Probing for PAM's Net/GK Adapter...\n");
@@ -686,7 +688,6 @@ pamsnet_open(struct net_device *dev) {
        pamsnet_timer.data = (long)dev;
        pamsnet_timer.expires = jiffies + lp->poll_time;
        add_timer(&pamsnet_timer);
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
@@ -848,7 +849,6 @@ pamsnet_close(struct net_device *dev) {
 
        ENABLE_IRQ();
        stdma_release();
-       MOD_DEC_USE_COUNT;
        return 0;
 }
 
@@ -864,19 +864,13 @@ static struct net_device_stats *net_get_stats(struct net_device *dev)
 
 #ifdef MODULE
 
-static char devicename[9] = { 0, };
-static struct net_device pam_dev =
-       {
-               devicename,     /* filled in by register_netdev() */
-               0, 0, 0, 0,     /* memory */
-               0, 0,           /* base, irq */
-               0, 0, 0, NULL, pamsnet_probe,
-       };
+static struct net_device pam_dev;
 
 int
 init_module(void) {
        int err;
 
+       pam_dev.init = pamsnet_probe;
        if ((err = register_netdev(&pam_dev))) {
                if (err == -EEXIST)  {
                        printk("PAM's Net/GK: devices already present. Module not loaded.\n");
index fa41fd3b711b878946b3418baa1b3fc7d137dc43..4eb4b58ef9e5269231fe1a57f1dbc94d4a23e7ed 100644 (file)
@@ -357,7 +357,7 @@ static int lance_set_mac_address( struct net_device *dev, void *addr );
 
 \f
 
-void *slow_memcpy( void *dst, const void *src, size_t len )
+static void *slow_memcpy( void *dst, const void *src, size_t len )
 
 {      char *cto = dst;
        const char *cfrom = src;
@@ -375,6 +375,8 @@ int __init atarilance_probe( struct net_device *dev )
     int i;
        static int found = 0;
 
+       SET_MODULE_OWNER(dev);
+
        if (!MACH_IS_ATARI || found)
                /* Assume there's only one board possible... That seems true, since
                 * the Riebl/PAM board's address cannot be changed. */
@@ -659,7 +661,6 @@ static int lance_open( struct net_device *dev )
        dev->start = 1;
 
        DPRINTK( 2, ( "%s: LANCE is open, csr0 %04x\n", dev->name, DREG ));
-       MOD_INC_USE_COUNT;
 
        return( 0 );
 }
@@ -1062,7 +1063,6 @@ static int lance_close( struct net_device *dev )
           memory if we don't. */
        DREG = CSR0_STOP;
 
-       MOD_DEC_USE_COUNT;
        return 0;
 }
 
@@ -1152,20 +1152,13 @@ static int lance_set_mac_address( struct net_device *dev, void *addr )
 
 \f
 #ifdef MODULE
-static char devicename[9] = { 0, };
-
-static struct net_device atarilance_dev =
-{
-       devicename,     /* filled in by register_netdev() */
-       0, 0, 0, 0,     /* memory */
-       0, 0,           /* base, irq */
-       0, 0, 0, NULL, atarilance_probe,
-};
+static struct net_device atarilance_dev;
 
 int init_module(void)
 
 {      int err;
 
+       atarilance_dev.init = atarilance_probe;
        if ((err = register_netdev( &atarilance_dev ))) {
                if (err == -EIO)  {
                        printk( "No Atari Lance board found. Module not loaded.\n");
index 976bcc9f36dcda582188263612974a04cc791b52..21bdbab5d1ee7342c89b63df31a9259bd67a261a 100644 (file)
@@ -292,6 +292,7 @@ static int __init atp_probe1(struct net_device *dev, long ioaddr)
        dev = init_etherdev(dev, sizeof(struct net_local));
        if (!dev)
                return -ENOMEM;
+       SET_MODULE_OWNER(dev);
 
        /* Find the IRQ used by triggering an interrupt. */
        write_reg_byte(ioaddr, CMR2, 0x01);                     /* No accept mode, IRQ out. */
@@ -427,16 +428,12 @@ static int net_open(struct net_device *dev)
        struct net_local *lp = (struct net_local *)dev->priv;
        int ret;
 
-       MOD_INC_USE_COUNT;
-
        /* The interrupt line is turned off (tri-stated) when the device isn't in
           use.  That's especially important for "attached" interfaces where the
           port or interrupt may be shared. */
        ret = request_irq(dev->irq, &atp_interrupt, 0, dev->name, dev);
-       if (ret) {
-               MOD_DEC_USE_COUNT;
+       if (ret)
                return ret;
-       }
 
        hardware_init(dev);
 
@@ -837,10 +834,7 @@ net_close(struct net_device *dev)
        free_irq(dev->irq, dev);
 
        /* Reset the ethernet hardware and activate the printer pass-through. */
-    write_reg_high(ioaddr, CMR1, CMR1h_RESET | CMR1h_MUX);
-
-       MOD_DEC_USE_COUNT;
-
+       write_reg_high(ioaddr, CMR1, CMR1h_RESET | CMR1h_MUX);
        return 0;
 }
 
index 1de81882358ee016d5c7c8394702b6675cc7e5b8..9df9a4b1a6bf22bd34583d35f187b4629d810508 100644 (file)
@@ -329,8 +329,7 @@ struct lance_addr {
 
 static int addr_accessible( volatile void *regp, int wordflag, int
                             writeflag );
-static unsigned long lance_probe1( struct net_device *dev, struct lance_addr
-                                   *init_rec );
+static int lance_probe1( struct net_device *dev, struct lance_addr *init_rec );
 static int lance_open( struct net_device *dev );
 static void lance_init_ring( struct net_device *dev );
 static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev );
@@ -474,6 +473,8 @@ int __init bagetlance_probe( struct net_device *dev )
 {      int i;
        static int found = 0;
 
+       SET_MODULE_OWNER(dev);
+
        if (found)
                /* Assume there's only one board possible... That seems true, since
                 * the Riebl/PAM board's address cannot be changed. */
@@ -508,8 +509,8 @@ static int __init addr_accessible( volatile void *regp,
 #define IRQ_TYPE_PRIO SA_INTERRUPT
 #define IRQ_SOURCE_TO_VECTOR(x) (x)
 
-static unsigned long __init lance_probe1( struct net_device *dev,
-                                          struct lance_addr *init_rec )
+static int __init lance_probe1( struct net_device *dev,
+                               struct lance_addr *init_rec )
 
 {      volatile unsigned short *memaddr =
                (volatile unsigned short *)init_rec->memaddr;
@@ -759,8 +760,6 @@ static int lance_open( struct net_device *dev )
        dev->start = 1;
 
        DPRINTK( 2, ( "%s: LANCE is open, csr0 %04x\n", dev->name, DREG ));
-       MOD_INC_USE_COUNT;
-
        return( 0 );
 }
 
@@ -1222,7 +1221,6 @@ static int lance_close( struct net_device *dev )
           memory if we don't. */
        DREG = CSR0_STOP;
 
-       MOD_DEC_USE_COUNT;
        return 0;
 }
 
@@ -1324,20 +1322,13 @@ static int lance_set_mac_address( struct net_device *dev, void *addr )
 
 
 #ifdef MODULE
-static char devicename[9] = { 0, };
-
-static struct net_device bagetlance_dev =
-{
-       devicename,     /* filled in by register_netdev() */
-       0, 0, 0, 0,     /* memory */
-       0, 0,           /* base, irq */
-       0, 0, 0, NULL, bagetlance_probe,
-};
+static struct net_device bagetlance_dev;
 
 int init_module(void)
 
 {      int err;
 
+       bagetlance_dev.init = bagetlance_probe;
        if ((err = register_netdev( &bagetlance_dev ))) {
                if (err == -EIO)  {
                        printk( "No Vme Lance board found. Module not loaded.\n");
index 2b9b71d885b0b4926c89b61fe9542107b24c60cf..b9ff76f28780742e2f2a32355f4f47457ac78ebe 100644 (file)
@@ -1296,6 +1296,7 @@ static void __init bmac_probe1(struct device_node *bmac, int is_bmac_plus)
                       bmac->full_name);
                return;
        }
+       SET_MODULE_OWNER(dev);
 
        dev->base_addr = (unsigned long)
                ioremap(bmac->addrs[0].address, bmac->addrs[0].size);
@@ -1393,8 +1394,6 @@ static int bmac_open(struct net_device *dev)
                return -ENOMEM;
 
        dev->flags |= IFF_RUNNING;
-
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
@@ -1440,8 +1439,6 @@ static int bmac_close(struct net_device *dev)
        bp->reset_and_enabled = 0;
        XXDEBUG(("bmac: all bufs freed\n"));
 
-       MOD_DEC_USE_COUNT;
-
        return 0;
 }
 
index b81074ee06fb2a62a057fd0b7b494c3743ab6306..4549d2c5e4864d358f07cefef04f4e1d8d91e5a5 100644 (file)
@@ -342,15 +342,14 @@ de600_read_byte(unsigned char type, struct net_device *dev) { /* dev used by mac
 static int
 de600_open(struct net_device *dev)
 {
-       if (request_irq(DE600_IRQ, de600_interrupt, 0, "de600", dev)) {
+       int ret = request_irq(DE600_IRQ, de600_interrupt, 0, dev->name, dev);
+       if (ret) {
                printk ("%s: unable to get IRQ %d\n", dev->name, DE600_IRQ);
-               return 1;
+               return ret;
        }
 
-       MOD_INC_USE_COUNT;
-       if (adapter_init(dev)) {
-               return 1;
-       }
+       if (adapter_init(dev))
+               return -EIO;
 
        return 0;
 }
@@ -370,7 +369,6 @@ de600_close(struct net_device *dev)
 
        if (netif_running(dev)) { /* perhaps not needed? */
                free_irq(DE600_IRQ, dev);
-               MOD_DEC_USE_COUNT;
        }
        return 0;
 }
@@ -637,6 +635,8 @@ de600_probe(struct net_device *dev)
        static struct net_device_stats de600_netstats;
        /*dev->priv = kmalloc(sizeof(struct net_device_stats), GFP_KERNEL);*/
 
+       SET_MODULE_OWNER(dev);
+
        printk("%s: D-Link DE-600 pocket adapter", dev->name);
        /* Alpha testers must have the version number to report bugs. */
        if (de600_debug > 1)
@@ -819,12 +819,12 @@ de600_rspace(struct sock *sk)
 #endif
 \f
 #ifdef MODULE
-static struct net_device de600_dev = {
-       "", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, de600_probe };
+static struct net_device de600_dev;
 
 int
 init_module(void)
 {
+       de600_dev.init = de600_probe;
        if (register_netdev(&de600_dev) != 0)
                return -EIO;
        return 0;
index 22a41cd042441911d19bfdee495903ec13f6a4c5..ecc71eb003121386716f116433a1856f977555ee 100644 (file)
@@ -437,15 +437,15 @@ de620_get_register(struct net_device *dev, byte reg)
  */
 static int de620_open(struct net_device *dev)
 {
-       if (request_irq(dev->irq, de620_interrupt, 0, "de620", dev)) {
+       int ret = request_irq(dev->irq, de620_interrupt, 0, dev->name, dev);
+       if (ret) {
                printk (KERN_ERR "%s: unable to get IRQ %d\n", dev->name, dev->irq);
-               return 1;
+               return ret;
        }
 
        if (adapter_init(dev))
-               return 1;
+               return -EIO;
 
-       MOD_INC_USE_COUNT;
        netif_start_queue(dev);
        return 0;
 }
@@ -462,7 +462,6 @@ static int de620_close(struct net_device *dev)
        /* disable recv */
        de620_set_register(dev, W_TCR, RXOFF);
        free_irq(dev->irq, dev);
-       MOD_DEC_USE_COUNT;
        return 0;
 }
 
@@ -812,6 +811,8 @@ int __init de620_probe(struct net_device *dev)
        int i;
        byte checkbyte = 0xa5;
 
+       SET_MODULE_OWNER(dev);
+
        /*
         * This is where the base_addr and irq gets set.
         * Tunable at compile-time and insmod-time
@@ -985,11 +986,11 @@ static int __init read_eeprom(struct net_device *dev)
  *
  */
 #ifdef MODULE
-static struct net_device de620_dev = {
-       "", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, de620_probe };
+static struct net_device de620_dev;
 
 int init_module(void)
 {
+       de620_dev.init = de620_probe;
        if (register_netdev(&de620_dev) != 0)
                return -EIO;
        return 0;
index 4e1bb8bf023e2ce980e428a9c9eb1c0dec47050d..263ae384e083254f5a5664833aa0ec207d224f5e 100644 (file)
@@ -814,7 +814,7 @@ static int receive(struct net_device *dev, int cnt)
 #ifdef __i386__
 #define GETTICK(x)                                                \
 ({                                                                \
-       if (current_cpu_data.x86_capability & X86_FEATURE_TSC)    \
+       if (cpu_has_tsc)                                          \
                __asm__ __volatile__("rdtsc" : "=a" (x) : : "dx");\
 })
 #else /* __i386__ */
index 4608b36504ec63d085e07ed1bc85e338ee852494..24a586740c32e54deda63ae757323a1e15cfd1e4 100644 (file)
@@ -299,8 +299,6 @@ extern inline unsigned int lcm(unsigned int x, unsigned int y)
 
 #ifdef __i386__
 
-#define HAS_RDTSC (current_cpu_data.x86_capability & X86_FEATURE_TSC)
-
 /*
  * only do 32bit cycle counter arithmetic; we hope we won't overflow.
  * in fact, overflowing modems would require over 2THz CPU clock speeds :-)
@@ -308,7 +306,7 @@ extern inline unsigned int lcm(unsigned int x, unsigned int y)
 
 #define time_exec(var,cmd)                                              \
 ({                                                                      \
-       if (HAS_RDTSC) {                                                \
+       if (cpu_has_tsc) {                                              \
                unsigned int cnt1, cnt2, cnt3;                          \
                __asm__(".byte 0x0f,0x31" : "=a" (cnt1), "=d" (cnt3));  \
                cmd;                                                    \
index c6b11ecf5a423d2cbf772a7907927a1dd8ac855d..6a67457046b49f89f8903564bba7537bfdd2786d 100644 (file)
@@ -224,7 +224,6 @@ struct lance_private {
        int dma;
        struct net_device_stats stats;
        unsigned char chip_version;     /* See lance_chip_type. */
-       char tx_full;
        spinlock_t devlock;
 };
 
@@ -268,8 +267,6 @@ static struct lance_chip_type {
 
 enum {OLD_LANCE = 0, PCNET_ISA=1, PCNET_ISAP=2, PCNET_PCI=3, PCNET_VLB=4, PCNET_PCI_II=5, LANCE_UNKNOWN=6};
 
-/* Non-zero only if the current card is a PCI with BIOS-set IRQ. */
-static unsigned int pci_irq_line = 0;
 
 /* Non-zero if lance_probe1() needs to allocate low-memory bounce buffers.
    Assume yes until we know the memory size. */
@@ -360,29 +357,6 @@ int lance_probe(struct net_device *dev)
        if (high_memory <= phys_to_virt(16*1024*1024))
                lance_need_isa_bounce_buffers = 0;
 
-#if defined(CONFIG_PCI)
-       {
-               struct pci_dev *pdev = NULL;
-               if (lance_debug > 1)
-                       printk("lance.c: PCI bios is present, checking for devices...\n");
-
-               while ((pdev = pci_find_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE, pdev))) {
-                       unsigned int pci_ioaddr;
-
-                       if (pci_enable_device(pdev))
-                               continue;
-                       pci_set_master(pdev);
-                       pci_irq_line = pdev->irq;
-                       pci_ioaddr = pci_resource_start (pdev, 0);
-                       printk("Found PCnet/PCI at %#x, irq %d.\n",
-                                  pci_ioaddr, pci_irq_line);
-                       result = lance_probe1(dev, pci_ioaddr, pci_irq_line, 0);
-                       pci_irq_line = 0;
-                       if (!result) return 0;
-               }
-       }
-#endif  /* defined(CONFIG_PCI) */
-
        for (port = lance_portlist; *port; port++) {
                int ioaddr = *port;
 
@@ -671,7 +645,7 @@ lance_open_fail(struct net_device *dev)
 static int
 lance_open(struct net_device *dev)
 {
-       struct lance_private *lp = (struct lance_private *)dev->priv;
+       struct lance_private *lp = dev->priv;
        int ioaddr = dev->base_addr;
        int i;
 
@@ -761,7 +735,7 @@ lance_open(struct net_device *dev)
 static void 
 lance_purge_ring(struct net_device *dev)
 {
-       struct lance_private *lp = (struct lance_private *)dev->priv;
+       struct lance_private *lp = dev->priv;
        int i;
 
        /* Free all the skbuffs in the Rx and Tx queues. */
@@ -770,11 +744,11 @@ lance_purge_ring(struct net_device *dev)
                lp->rx_skbuff[i] = 0;
                lp->rx_ring[i].base = 0;                /* Not owned by LANCE chip. */
                if (skb)
-                       dev_kfree_skb(skb);
+                       dev_kfree_skb_any(skb);
        }
        for (i = 0; i < TX_RING_SIZE; i++) {
                if (lp->tx_skbuff[i]) {
-                       dev_kfree_skb(lp->tx_skbuff[i]);
+                       dev_kfree_skb_any(lp->tx_skbuff[i]);
                        lp->tx_skbuff[i] = NULL;
                }
        }
@@ -785,10 +759,9 @@ lance_purge_ring(struct net_device *dev)
 static void
 lance_init_ring(struct net_device *dev, int gfp)
 {
-       struct lance_private *lp = (struct lance_private *)dev->priv;
+       struct lance_private *lp = dev->priv;
        int i;
 
-       lp->tx_full = 0;
        lp->cur_rx = lp->cur_tx = 0;
        lp->dirty_rx = lp->dirty_tx = 0;
 
@@ -828,7 +801,7 @@ lance_init_ring(struct net_device *dev, int gfp)
 static void
 lance_restart(struct net_device *dev, unsigned int csr0_bits, int must_reinit)
 {
-       struct lance_private *lp = (struct lance_private *)dev->priv;
+       struct lance_private *lp = dev->priv;
 
        if (must_reinit ||
                (chip_table[lp->chip_version].flags & LANCE_MUST_REINIT_RING)) {
@@ -854,7 +827,7 @@ static void lance_tx_timeout (struct net_device *dev)
        if (lance_debug > 3) {
                int i;
                printk (" Ring data dump: dirty_tx %d cur_tx %d%s cur_rx %d.",
-                 lp->dirty_tx, lp->cur_tx, lp->tx_full ? " (full)" : "",
+                 lp->dirty_tx, lp->cur_tx, netif_queue_stopped(dev) ? " (full)" : "",
                        lp->cur_rx);
                for (i = 0; i < RX_RING_SIZE; i++)
                        printk ("%s %08x %04x %04x", i & 0x3 ? "" : "\n ",
@@ -876,10 +849,13 @@ static void lance_tx_timeout (struct net_device *dev)
 
 static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-       struct lance_private *lp = (struct lance_private *)dev->priv;
+       struct lance_private *lp = dev->priv;
        int ioaddr = dev->base_addr;
        int entry;
        unsigned long flags;
+
+       spin_lock_irqsave(&lp->devlock, flags);
+
        if (lance_debug > 3) {
                outw(0x0000, ioaddr+LANCE_ADDR);
                printk("%s: lance_start_xmit() called, csr0 %4.4x.\n", dev->name,
@@ -887,8 +863,6 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
                outw(0x0000, ioaddr+LANCE_DATA);
        }
 
-       netif_stop_queue (dev);
-       
        /* Fill in a Tx ring entry */
 
        /* Mask to ring buffer boundary. */
@@ -929,13 +903,10 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        dev->trans_start = jiffies;
 
-       spin_lock_irqsave (&lp->devlock, flags);
-       if (lp->tx_ring[(entry+1) & TX_RING_MOD_MASK].base == 0)
-               netif_start_queue (dev);
-       else
-               lp->tx_full = 1;
-       spin_unlock_irqrestore (&lp->devlock, flags);
+       if ((lp->cur_tx - lp->dirty_tx) >= TX_RING_SIZE)
+               netif_stop_queue(dev);
 
+       spin_unlock_irqrestore(&lp->devlock, flags);
        return 0;
 }
 
@@ -954,7 +925,7 @@ lance_interrupt(int irq, void *dev_id, struct pt_regs * regs)
        }
 
        ioaddr = dev->base_addr;
-       lp = (struct lance_private *)dev->priv;
+       lp = dev->priv;
        
        spin_lock (&lp->devlock);
 
@@ -1018,19 +989,17 @@ lance_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 
 #ifndef final_version
                        if (lp->cur_tx - dirty_tx >= TX_RING_SIZE) {
-                               printk("out-of-sync dirty pointer, %d vs. %d, full=%d.\n",
-                                          dirty_tx, lp->cur_tx, lp->tx_full);
+                               printk("out-of-sync dirty pointer, %d vs. %d, full=%s.\n",
+                                          dirty_tx, lp->cur_tx,
+                                          netif_queue_stopped(dev) ? "yes" : "no");
                                dirty_tx += TX_RING_SIZE;
                        }
 #endif
 
-                       if (lp->tx_full &&
-                           (netif_queue_stopped(dev)) &&
-                           dirty_tx > lp->cur_tx - TX_RING_SIZE + 2) {
-                               /* The ring is no longer full, clear tbusy. */
-                               lp->tx_full = 0;
+                       /* if the ring is no longer full, accept more packets */
+                       if (netif_queue_stopped(dev) &&
+                           dirty_tx > lp->cur_tx - TX_RING_SIZE + 2)
                                netif_wake_queue (dev);
-                       }
 
                        lp->dirty_tx = dirty_tx;
                }
@@ -1068,7 +1037,7 @@ lance_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 static int
 lance_rx(struct net_device *dev)
 {
-       struct lance_private *lp = (struct lance_private *)dev->priv;
+       struct lance_private *lp = dev->priv;
        int entry = lp->cur_rx & RX_RING_MOD_MASK;
        int i;
                
@@ -1147,7 +1116,7 @@ static int
 lance_close(struct net_device *dev)
 {
        int ioaddr = dev->base_addr;
-       struct lance_private *lp = (struct lance_private *)dev->priv;
+       struct lance_private *lp = dev->priv;
 
        netif_stop_queue (dev);
 
@@ -1181,19 +1150,19 @@ lance_close(struct net_device *dev)
 
 static struct net_device_stats *lance_get_stats(struct net_device *dev)
 {
-       struct lance_private *lp = (struct lance_private *)dev->priv;
-       short ioaddr = dev->base_addr;
-       short saved_addr;
-       unsigned long flags;
+       struct lance_private *lp = dev->priv;
 
        if (chip_table[lp->chip_version].flags & LANCE_HAS_MISSED_FRAME) {
-               save_flags(flags);
-               cli();
+               short ioaddr = dev->base_addr;
+               short saved_addr;
+               unsigned long flags;
+
+               spin_lock_irqsave(&lp->devlock, flags);
                saved_addr = inw(ioaddr+LANCE_ADDR);
                outw(112, ioaddr+LANCE_ADDR);
                lp->stats.rx_missed_errors = inw(ioaddr+LANCE_DATA);
                outw(saved_addr, ioaddr+LANCE_ADDR);
-               restore_flags(flags);
+               spin_unlock_irqrestore(&lp->devlock, flags);
        }
 
        return &lp->stats;
index 6e69b12b2578a1bbff67f4529c8b6020457fea39..0305b45746fbf7f1f74d5574a1ac94c72440773a 100644 (file)
@@ -1548,12 +1548,13 @@ static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
        unsigned int i;
        int error = -EOPNOTSUPP;
 
-       rrpriv = (struct rr_private *)dev->priv;
+       rrpriv = dev->priv;
 
        switch(cmd){
        case SIOCRRGFW:
-               if (!capable(CAP_SYS_RAWIO))
+               if (!capable(CAP_SYS_RAWIO)){
                        return -EPERM;
+               }
 
                image = kmalloc(EEPROM_WORDS * sizeof(u32), GFP_KERNEL);
                if (!image){
@@ -1584,8 +1585,9 @@ static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
                return error;
                
        case SIOCRRPFW:
-               if (!capable(CAP_SYS_RAWIO))
+               if (!capable(CAP_SYS_RAWIO)){
                        return -EPERM;
+               }
 
                image = kmalloc(EEPROM_WORDS * sizeof(u32), GFP_KERNEL);
                if (!image){
index 515807e0768d479371a53e2f78eb33cbc7cf8800..47ba5cc748e90625366f3fb0f7ac62d5569a9e1e 100644 (file)
@@ -855,7 +855,7 @@ cleanup_filename_protocol:
 cleanup_filename_hardware:
        remove_proc_entry(FILENAME_HARDWARE, new_dir);
 cleanup_new_dir:
-       remove_proc_entry(dentry->d_name.name, &comx_root_dir);
+       remove_proc_entry(dentry->d_name.name, comx_root_dir);
 cleanup_dev:
        kfree(dev);
        return ret;
index ea13f254d249390b150bc12ae1da40790e3a5b42..f90c2352011774e5934397409eb669a0ffd6c1e9 100644 (file)
@@ -20,6 +20,8 @@
 #include <linux/ioport.h>
 #include <linux/spinlock.h>
 #include <linux/pm.h>
+#include <linux/slab.h>
+#include <linux/kmod.h>                /* for hotplug_path */
 
 #include <asm/page.h>
 #include <asm/dma.h>   /* isa_dma_bridge_buggy */
@@ -343,6 +345,49 @@ pci_unregister_driver(struct pci_driver *drv)
 
 #ifdef CONFIG_HOTPLUG
 
+#ifndef FALSE
+#define FALSE  (0)
+#define TRUE   (!FALSE)
+#endif
+
+static void
+run_sbin_hotplug(struct pci_dev *pdev, int insert)
+{
+       int i;
+       char *argv[3], *envp[7];
+       char id[20], sub_id[24], bus_id[64], class_id[20];
+
+       if (!hotplug_path[0])
+               return;
+
+       sprintf(class_id, "PCI_CLASS=%X", pdev->class >> 8);
+       sprintf(id, "PCI_ID=%X/%X", pdev->vendor, pdev->device);
+       sprintf(sub_id, "PCI_SUBSYS_ID=%X/%X", pdev->subsystem_vendor, pdev->subsystem_device);
+       sprintf(bus_id, "PCI_BUS_ID=%s", pdev->slot_name);
+
+       i = 0;
+       argv[i++] = hotplug_path;
+       argv[i++] = "pci";
+       argv[i] = 0;
+
+       i = 0;
+       /* minimal command environment */
+       envp[i++] = "HOME=/";
+       envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
+       
+       /* other stuff we want to pass to /sbin/hotplug */
+       envp[i++] = id;
+       envp[i++] = sub_id;
+       envp[i++] = bus_id;
+       if (insert)
+               envp[i++] = "ACTION=add";
+       else
+               envp[i++] = "ACTION=remove";
+       envp[i] = 0;
+
+       call_usermodehelper (argv [0], argv, envp);
+}
+
 void
 pci_insert_device(struct pci_dev *dev, struct pci_bus *bus)
 {
@@ -358,9 +403,13 @@ pci_insert_device(struct pci_dev *dev, struct pci_bus *bus)
                if (drv->remove && pci_announce_device(drv, dev))
                        break;
        }
+
+       /* notify userspace of new hotplug device */
+       run_sbin_hotplug(dev, TRUE);
 }
 
-static void pci_free_resources(struct pci_dev *dev)
+static void
+pci_free_resources(struct pci_dev *dev)
 {
        int i;
 
@@ -385,6 +434,9 @@ pci_remove_device(struct pci_dev *dev)
 #ifdef CONFIG_PROC_FS
        pci_proc_detach_device(dev);
 #endif
+
+       /* notify userspace of hotplug device removal */
+       run_sbin_hotplug(dev, FALSE);
 }
 
 #endif
index 52f9a325b39407af7446fd45896196f512ae1d6b..a90be801f1435c579ebb8ea5c8d426253d1b6bf3 100644 (file)
@@ -7,18 +7,18 @@
 mainmenu_option next_comment
 comment 'PCMCIA/CardBus support'
 
-dep_tristate 'CardBus support' CONFIG_PCMCIA $CONFIG_PCI
-if [ "$CONFIG_PCMCIA" != "n" ]; then
-  define_bool CONFIG_CARDBUS y
-fi
-
-#tristate 'PCMCIA/CardBus support' CONFIG_PCMCIA
+#dep_tristate 'CardBus support' CONFIG_PCMCIA $CONFIG_PCI
 #if [ "$CONFIG_PCMCIA" != "n" ]; then
-#   if [ "$CONFIG_PCI" != "n" ]; then
-#      bool '  CardBus support' CONFIG_CARDBUS
-#   fi
-#   bool '  i82365 compatible bridge support' CONFIG_I82365
-#   bool '  Databook TCIC host bridge support' CONFIG_TCIC
+#  define_bool CONFIG_CARDBUS y
 #fi
 
+tristate 'PCMCIA/CardBus support' CONFIG_PCMCIA
+if [ "$CONFIG_PCMCIA" != "n" ]; then
+   if [ "$CONFIG_PCI" != "n" ]; then
+      bool '  CardBus support' CONFIG_CARDBUS
+   fi
+   bool '  i82365 compatible bridge support' CONFIG_I82365
+   bool '  Databook TCIC host bridge support' CONFIG_TCIC
+fi
+
 endmenu
index 578cbfcd0afcd3670a365a27f4a249fd49e2fb96..b09e1182fff3dd30967aed16b567c1e34fe88ce1 100644 (file)
@@ -859,6 +859,28 @@ static void __init isa_probe(void)
 
 /*====================================================================*/
 
+static u_int pending_events[8];
+static spinlock_t pending_event_lock = SPIN_LOCK_UNLOCKED;
+
+static void pcic_bh(void *dummy)
+{
+       u_int events;
+       int i;
+
+       for (i=0; i < sockets; i++) {
+               spin_lock_irq(&pending_event_lock);
+               events = pending_events[i];
+               pending_events[i] = 0;
+               spin_unlock_irq(&pending_event_lock);
+               if (socket[i].handler)
+                       socket[i].handler(socket[i].info, events);
+       }
+}
+
+static struct tq_struct pcic_task = {
+       routine:        pcic_bh
+};
+
 static void pcic_interrupt(int irq, void *dev,
                                    struct pt_regs *regs)
 {
@@ -893,8 +915,13 @@ static void pcic_interrupt(int irq, void *dev,
            }
            ISA_UNLOCK(i, flags);
            DEBUG(2, "i82365: socket %d event 0x%02x\n", i, events);
-           if (events)
-               socket[i].handler(socket[i].info, events);
+
+           if (events) {
+                   spin_lock(&pending_event_lock);
+                   pending_events[i] |= events;
+                   spin_unlock(&pending_event_lock);
+                   schedule_task(&pcic_task);
+           }
            active |= events;
        }
        if (!active) break;
index 7f21f827e6e52f50c4f51b61b5504914be6670ee..03a026f1758e534a5a1dd9d24c3b5fcb40249b5c 100644 (file)
@@ -177,7 +177,7 @@ static int __devinit add_pci_socket(int nr, struct pci_dev *dev, struct pci_sock
        socket->dev = dev;
        socket->op = ops;
        dev->driver_data = socket;
-       init_waitqueue_head(&socket->wait);
+       spin_lock_init(&socket->event_lock);
        return socket->op->open(socket);
 }
 
index 6893fb1c288405bcd89072c43031221be10b1a88..50bc5702f4b10c61b160e849e31d0cdd1fe31e22 100644 (file)
@@ -18,9 +18,11 @@ typedef struct pci_socket {
        void *info;
        struct pci_socket_ops *op;
        socket_cap_t cap;
-       wait_queue_head_t wait;
+       spinlock_t event_lock;
        unsigned int events;
        struct socket_info_t *pcmcia_socket;
+       struct tq_struct tq_task;
+       struct timer_list poll_timer;
 
        /* A few words of private data for the low-level driver.. */
        unsigned int private[8];
index 67abc32e6bb305b5854884090d1cafd0da5751fa..a4d43e168543c48ad57277dd53398c9a158d9267 100644 (file)
@@ -530,6 +530,28 @@ static void __exit exit_tcic(void)
 
 /*====================================================================*/
 
+static u_int pending_events[2];
+static spinlock_t pending_event_lock = SPIN_LOCK_UNLOCKED;
+
+static void tcic_bh(void *dummy)
+{
+       u_int events;
+       int i;
+
+       for (i=0; i < sockets; i++) {
+               spin_lock_irq(&pending_event_lock);
+               events = pending_events[i];
+               pending_events[i] = 0;
+               spin_unlock_irq(&pending_event_lock);
+               if (socket_table[i].handler)
+                       socket_table[i].handler(socket_table[i].info, events);
+       }
+}
+
+static struct tq_struct tcic_task = {
+       routine:        tcic_bh
+};
+
 static void tcic_interrupt(int irq, void *dev, struct pt_regs *regs)
 {
     int i, quick = 0;
@@ -568,8 +590,12 @@ static void tcic_interrupt(int irq, void *dev, struct pt_regs *regs)
            events |= (latch & TCIC_SSTAT_LBAT1) ? SS_BATDEAD : 0;
            events |= (latch & TCIC_SSTAT_LBAT2) ? SS_BATWARN : 0;
        }
-       if (events)
-           socket_table[i].handler(socket_table[i].info, events);
+       if (events) {
+               spin_lock(&pending_event_lock);
+               pending_events[i] |= events;
+               spin_unlock(&pending_event_lock);
+               schedule_task(&tcic_task);
+       }
     }
 
     /* Schedule next poll, if needed */
index 8cee76d3b0abc2fde41356cde6c3f9c37d4617cd..1bbf2c376b4550ea60e341154696a4d18fd0c648 100644 (file)
 #include <linux/delay.h>
 #include <linux/module.h>
 
+#include <pcmcia/version.h>
+#include <pcmcia/cs_types.h>
 #include <pcmcia/ss.h>
+#include <pcmcia/cs.h>
 
 #include <asm/io.h>
 
@@ -464,6 +467,20 @@ static unsigned int yenta_events(pci_socket_t *socket)
        return events;
 }
 
+
+static void yenta_bh(void *data)
+{
+       pci_socket_t *socket = data;
+       unsigned int events;
+
+       spin_lock_irq(&socket->event_lock);
+       events = socket->events;
+       socket->events = 0;
+       spin_unlock_irq(&socket->event_lock);
+       if (socket->handler)
+               socket->handler(socket->info, events);
+}
+
 static void yenta_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
        unsigned int events;
@@ -471,11 +488,22 @@ static void yenta_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
        events = yenta_events(socket);
        if (events) {
+               spin_lock(&socket->event_lock);
                socket->events |= events;
-               wake_up_interruptible(&socket->wait);
+               spin_unlock(&socket->event_lock);
+               schedule_task(&socket->tq_task);
        }
 }
 
+static void yenta_interrupt_wrapper(unsigned long data)
+{
+       pci_socket_t *socket = (pci_socket_t *) data;
+
+       yenta_interrupt(0, (void *)socket, NULL);
+       socket->poll_timer.expires = jiffies + HZ;
+       add_timer(&socket->poll_timer);
+}
+
 /*
  * Only probe "regular" interrupts, don't
  * touch dangerous spots like the mouse irq,
@@ -546,23 +574,23 @@ static void yenta_get_socket_capabilities(pci_socket_t *socket, u32 isa_irq_mask
 extern void cardbus_register(pci_socket_t *socket);
 
 /*
- * Watch a socket every second (and possibly in a
- * more timely manner if the state change interrupt
- * works..)
+ * 'Bottom half' for the yenta_open routine. Allocate the interrupt line
+ *  and register the socket with the upper layers.
  */
-static int yenta_socket_thread(void * data)
+static void yenta_open_bh(void * data)
 {
        pci_socket_t * socket = (pci_socket_t *) data;
-       DECLARE_WAITQUEUE(wait, current);
 
-       MOD_INC_USE_COUNT;
-       daemonize();
-       strcpy(current->comm, "CardBus Watcher");
+       /* It's OK to overwrite this now */
+       socket->tq_task.routine = yenta_bh;
 
-       if (socket->cb_irq && request_irq(socket->cb_irq, yenta_interrupt, SA_SHIRQ, socket->dev->name, socket)) {
-               printk ("Yenta: unable to register irq %d\n", socket->cb_irq);
-               MOD_DEC_USE_COUNT;
-               return (1);
+       if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, SA_SHIRQ, socket->dev->name, socket)) {
+               /* No IRQ or request_irq failed. Poll */
+               socket->cb_irq = 0; /* But zero is a valid IRQ number. */
+               socket->poll_timer.function = yenta_interrupt_wrapper;
+               socket->poll_timer.data = (unsigned long)socket;
+               socket->poll_timer.expires = jiffies + HZ;
+               add_timer(&socket->poll_timer);
        }
 
        /* Figure out what the dang thing can do for the PCMCIA layer... */
@@ -572,23 +600,7 @@ static int yenta_socket_thread(void * data)
        /* Register it with the pcmcia layer.. */
        cardbus_register(socket);
 
-       do {
-               unsigned int events = socket->events | yenta_events(socket);
-
-               if (events) {
-                       socket->events = 0;
-                       if (socket->handler)
-                               socket->handler(socket->info, events);
-               }
-
-               current->state = TASK_INTERRUPTIBLE;
-               add_wait_queue(&socket->wait, &wait);
-               if (!socket->events)
-                       schedule_timeout(HZ);
-               remove_wait_queue(&socket->wait, &wait);
-       } while (!signal_pending(current));
        MOD_DEC_USE_COUNT;
-       return 0;
 }
 
 static void yenta_clear_maps(pci_socket_t *socket)
@@ -745,6 +757,9 @@ static void yenta_close(pci_socket_t *sock)
 {
        if (sock->cb_irq)
                free_irq(sock->cb_irq, sock);
+       else
+               del_timer_sync(&sock->poll_timer);
+
        if (sock->base)
                iounmap(sock->base);
 }
@@ -836,7 +851,16 @@ static int yenta_open(pci_socket_t *socket)
                }
        }
 
-       kernel_thread(yenta_socket_thread, socket, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+       /* Get the PCMCIA kernel thread to complete the
+          initialisation later. We can't do this here,
+          because, er, because Linus says so :)
+       */
+       socket->tq_task.routine = yenta_open_bh;
+       socket->tq_task.data = socket;
+
+       MOD_INC_USE_COUNT;
+       schedule_task(&socket->tq_task);
+
        return 0;
 }
 
index 624d7dfd7f0463f4df84b04d5df547e4fd861f32..10a43856c2139f097ff7eedff07fbe614a9d1bfa 100644 (file)
@@ -696,6 +696,7 @@ static void raw3215_shutdown(raw3215_info *raw)
                 s390irq_spin_unlock_irqrestore(raw->irq, flags);
                schedule();
                s390irq_spin_lock_irqsave(raw->irq, flags);
+               remove_wait_queue(&raw->empty_wait, &wait);
                 current->state = TASK_RUNNING;
                raw->flags &= ~(RAW3215_ACTIVE | RAW3215_CLOSING);
        }
index ae7ba7ac18589401b5c5726f75661f104e4f0092..fa5f383c305f4ff3c4734558db584495030e2b2a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sab82532.c,v 1.52 2000/10/14 10:09:04 davem Exp $
+/* $Id: sab82532.c,v 1.53 2000/11/15 07:28:09 davem Exp $
  * sab82532.c: ASYNC Driver for the SIEMENS SAB82532 DUSCC.
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -1833,6 +1833,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 #endif
                schedule();
        }
+       current->state = TASK_RUNNING;
        remove_wait_queue(&info->open_wait, &wait);
        if (!tty_hung_up_p(filp))
                info->count++;
@@ -2133,7 +2134,7 @@ static void __init sab82532_kgdb_hook(int line)
 
 static inline void __init show_serial_version(void)
 {
-       char *revision = "$Revision: 1.52 $";
+       char *revision = "$Revision: 1.53 $";
        char *version, *p;
 
        version = strchr(revision, ' ');
index 1fd2d6fbf5e387a08cc46e5ed9664b51c9616941..bb256e46ed3b9b4e6a94d60b9fd1d620a9ac2d61 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: su.c,v 1.42 2000/10/14 10:09:04 davem Exp $
+/* $Id: su.c,v 1.43 2000/11/15 07:28:09 davem Exp $
  * su.c: Small serial driver for keyboard/mouse interface on sparc32/PCI
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -2001,6 +2001,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
 #endif
                schedule();
        }
+       current->state = TASK_RUNNING;
        remove_wait_queue(&info->open_wait, &wait);
        if (extra_count)
                info->count++;
@@ -2219,7 +2220,7 @@ done:
  */
 static __inline__ void __init show_su_version(void)
 {
-       char *revision = "$Revision: 1.42 $";
+       char *revision = "$Revision: 1.43 $";
        char *version, *p;
 
        version = strchr(revision, ' ');
index b28cba5a68dfa021e12c4f7a266abc6fe7f8f910..ec5814c7fce304e337811ee88187e744cb977785 100644 (file)
@@ -3577,11 +3577,12 @@ static void gdth_flush(int hanum)
     ha = HADATA(gdth_ctr_tab[hanum]);
 
     sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
-    if(sdev)
-       scp  = scsi_allocate_device(sdev, 1, FALSE);
-    
-    if(sdev!= NULL && scp != NULL)
-    {
+    if (!sdev)
+       return;
+
+    scp  = scsi_allocate_device(sdev, 1, FALSE);
+
+    if (scp) {
         scp->cmd_len = 12;
         scp->use_sg = 0;
 
@@ -3597,11 +3598,9 @@ static void gdth_flush(int hanum)
                  gdth_do_cmd(scp, &gdtcmd, 30);
             }
         }
-    }
-    if(scp!=NULL)
        scsi_release_command(scp);
-    if(sdev!=NULL)
-        scsi_free_host_dev(sdev);
+    }
+    scsi_free_host_dev(sdev);
 }
 
 /* shutdown routine */
index 4bb3981d5f0cbab5155095b318abf0e338872931..8b25ca5b36809b1a0037e17d7359569eb7e973dd 100644 (file)
@@ -1,3 +1,9 @@
+/*
+ * Changes:
+ * Arnaldo Carvalho de Melo <acme@conectiva.com.br> 08/23/2000
+ * - get rid of some verify_areas and use __copy*user and __get/put_user
+ *   for the ones that remain
+ */
 #define __NO_VERSION__
 #include <linux/module.h>
 
 
 static int ioctl_probe(struct Scsi_Host *host, void *buffer)
 {
-       int temp, result;
        unsigned int len, slen;
        const char *string;
+       int temp = host->hostt->present;
 
-       if ((temp = host->hostt->present) && buffer) {
-               result = verify_area(VERIFY_READ, buffer, sizeof(long));
-               if (result)
-                       return result;
+       if (temp && buffer) {
+               if (get_user(len, (unsigned int *) buffer))
+                       return -EFAULT;
 
-               get_user(len, (unsigned int *) buffer);
                if (host->hostt->info)
                        string = host->hostt->info(host);
                else
@@ -57,11 +61,8 @@ static int ioctl_probe(struct Scsi_Host *host, void *buffer)
                        slen = strlen(string);
                        if (len > slen)
                                len = slen + 1;
-                       result = verify_area(VERIFY_WRITE, buffer, len);
-                       if (result)
-                               return result;
-
-                       copy_to_user(buffer, string, len);
+                       if (copy_to_user(buffer, string, len))
+                               return -EFAULT;
                }
        }
        return temp;
@@ -202,12 +203,11 @@ int scsi_ioctl_send_command(Scsi_Device * dev, Scsi_Ioctl_Command * sic)
        /*
         * Verify that we can read at least this much.
         */
-       result = verify_area(VERIFY_READ, sic, sizeof(Scsi_Ioctl_Command));
-       if (result)
-               return result;
+       if (verify_area(VERIFY_READ, sic, sizeof(Scsi_Ioctl_Command)))
+               return -EFAULT;
 
-       get_user(inlen, &sic->inlen);
-       get_user(outlen, &sic->outlen);
+       __get_user(inlen, &sic->inlen);
+       __get_user(outlen, &sic->outlen);
 
        /*
         * We do not transfer more than MAX_BUF with this interface.
@@ -220,7 +220,7 @@ int scsi_ioctl_send_command(Scsi_Device * dev, Scsi_Ioctl_Command * sic)
                return -EINVAL;
 
        cmd_in = sic->data;
-       get_user(opcode, cmd_in);
+       __get_user(opcode, cmd_in);
 
        needed = buf_needed = (inlen > outlen ? inlen : outlen);
        if (buf_needed) {
@@ -252,16 +252,15 @@ int scsi_ioctl_send_command(Scsi_Device * dev, Scsi_Ioctl_Command * sic)
         */
        cmdlen = COMMAND_SIZE(opcode);
 
-       result = verify_area(VERIFY_READ, cmd_in, cmdlen + inlen);
-       if (result)
-               return result;
+       if (verify_area(VERIFY_READ, cmd_in, cmdlen + inlen))
+               return -EFAULT;
 
-       copy_from_user(cmd, cmd_in, cmdlen);
+       __copy_from_user(cmd, cmd_in, cmdlen);
 
        /*
         * Obtain the data to be sent to the device (if any).
         */
-       copy_from_user(buf, cmd_in + cmdlen, inlen);
+       __copy_from_user(buf, cmd_in + cmdlen, inlen);
 
        /*
         * Set the lun field to the correct value.
@@ -314,18 +313,13 @@ int scsi_ioctl_send_command(Scsi_Device * dev, Scsi_Ioctl_Command * sic)
                int sb_len = sizeof(SRpnt->sr_sense_buffer);
 
                sb_len = (sb_len > OMAX_SB_LEN) ? OMAX_SB_LEN : sb_len;
-               result = verify_area(VERIFY_WRITE, cmd_in, sb_len);
-               if (result)
-                       return result;
-               copy_to_user(cmd_in, SRpnt->sr_sense_buffer, sb_len);
-       } else {
-               result = verify_area(VERIFY_WRITE, cmd_in, outlen);
-               if (result)
-                       return result;
-               copy_to_user(cmd_in, buf, outlen);
-       }
-       result = SRpnt->sr_result;
+               if (copy_to_user(cmd_in, SRpnt->sr_sense_buffer, sb_len))
+                       return -EFAULT;
+       } else
+               if (copy_to_user(cmd_in, buf, outlen))
+                       return -EFAULT;
 
+       result = SRpnt->sr_result;
 
        SDpnt = SRpnt->sr_device;
        scsi_release_request(SRpnt);
@@ -361,7 +355,6 @@ int scsi_ioctl_send_command(Scsi_Device * dev, Scsi_Ioctl_Command * sic)
  */
 int scsi_ioctl(Scsi_Device * dev, int cmd, void *arg)
 {
-       int result;
        char scsi_cmd[MAX_COMMAND_SIZE];
 
        /* No idea how this happens.... */
@@ -379,23 +372,18 @@ int scsi_ioctl(Scsi_Device * dev, int cmd, void *arg)
        }
        switch (cmd) {
        case SCSI_IOCTL_GET_IDLUN:
-               result = verify_area(VERIFY_WRITE, arg, sizeof(Scsi_Idlun));
-               if (result)
-                       return result;
+               if (verify_area(VERIFY_WRITE, arg, sizeof(Scsi_Idlun)))
+                       return -EFAULT;
 
-               put_user(dev->id
+               __put_user(dev->id
                         + (dev->lun << 8)
                         + (dev->channel << 16)
                         + ((dev->host->host_no & 0xff) << 24),
                         &((Scsi_Idlun *) arg)->dev_id);
-               put_user(dev->host->unique_id, &((Scsi_Idlun *) arg)->host_unique_id);
+               __put_user(dev->host->unique_id, &((Scsi_Idlun *) arg)->host_unique_id);
                return 0;
        case SCSI_IOCTL_GET_BUS_NUMBER:
-               result = verify_area(VERIFY_WRITE, (void *) arg, sizeof(int));
-               if (result)
-                       return result;
-               put_user(dev->host->host_no, (int *) arg);
-               return 0;
+               return put_user(dev->host->host_no, (int *) arg);
        case SCSI_IOCTL_TAGGED_ENABLE:
                if (!capable(CAP_SYS_ADMIN))
                        return -EACCES;
index 5c3045f2a8017196b338dbb69d209b5e06cbf42b..73361978a8b72b96793ce6870b1386d06a6abe46 100644 (file)
@@ -441,7 +441,7 @@ aci_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
        }
        
        if (((cmd >> 8) & 0xff) == 'M') {
-               if (cmd & IOC_IN)
+               if (cmd & SIOC_IN)
                        /* read and write */
                        switch (cmd & 0xff) {
                                case SOUND_MIXER_VOLUME:
index 311cdab9bfb57a8ce235ae30aa7c81c8a79aa34d..be1aec5a583e5cb9722d37dec3575ef8a33bdaf6 100644 (file)
@@ -916,7 +916,7 @@ ad1816_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
        if (((cmd >> 8) & 0xff) == 'M') { 
                
                /* set ioctl */
-               if (_IOC_DIR (cmd) & _IOC_WRITE) { 
+               if (_SIOC_DIR (cmd) & _SIOC_WRITE) { 
                        switch (cmd & 0xff){
                        case SOUND_MIXER_RECSRC:
                                
index a87c10ce3457b58e0427fd31fec0ddd292f70c3f..0b0720881afa85fec82747e90c236d4ea80bd123 100644 (file)
@@ -4321,7 +4321,7 @@ awe_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
        level = ((level & 0xff) + (level >> 8)) / 2;
        DEBUG(0,printk("AWEMix: cmd=%x val=%d\n", cmd & 0xff, level));
 
-       if (_SIOC_DIR(cmd) & _IOC_WRITE) {
+       if (_SIOC_DIR(cmd) & _SIOC_WRITE) {
                switch (cmd & 0xff) {
                case SOUND_MIXER_BASS:
                        value = level * 12 / 100;
index 78c19298ee34c1e699db2030d8a8b64281856e9e..38ac2abf45a2aea9158ce3e8484cc31454cdfa74 100644 (file)
@@ -983,9 +983,9 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg)
        }
        if (cmd == OSS_GETVERSION)
                return put_user(SOUND_VERSION, (int *)arg);
-       if (_IOC_TYPE(cmd) != 'M' || _IOC_SIZE(cmd) != sizeof(int))
+       if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
                 return -EINVAL;
-        if (_IOC_DIR(cmd) == _IOC_READ) {
+        if (_SIOC_DIR(cmd) == _SIOC_READ) {
                 switch (_IOC_NR(cmd)) {
                 case SOUND_MIXER_RECSRC: /* Arg contains a bit for each recording source */
                        return put_user(mixer_recmask(s), (int *)arg);
@@ -1033,7 +1033,7 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg)
 #endif /* OSS_DOCUMENTED_MIXER_SEMANTICS */
                }
        }
-        if (_IOC_DIR(cmd) != (_IOC_READ|_IOC_WRITE)) 
+        if (_SIOC_DIR(cmd) != (_SIOC_READ|_SIOC_WRITE)) 
                return -EINVAL;
        s->mix.modcnt++;
        switch (_IOC_NR(cmd)) {
@@ -1197,9 +1197,9 @@ static int drain_dac(struct cm_state *s, int nonblock)
 
        if (s->dma_dac.mapped || !s->dma_dac.ready)
                return 0;
-        current->state = TASK_INTERRUPTIBLE;
         add_wait_queue(&s->dma_dac.wait, &wait);
         for (;;) {
+               set_current_state(TASK_INTERRUPTIBLE);
                 spin_lock_irqsave(&s->lock, flags);
                count = s->dma_dac.count;
                 spin_unlock_irqrestore(&s->lock, flags);
@@ -1839,6 +1839,7 @@ static ssize_t cm_midi_read(struct file *file, char *buffer, size_t count, loff_
        ret = 0;
        add_wait_queue(&s->midi.iwait, &wait);
        while (count > 0) {
+               set_current_state(TASK_INTERRUPTIBLE);
                spin_lock_irqsave(&s->lock, flags);
                ptr = s->midi.ird;
                cnt = MIDIINBUF - ptr;
@@ -1854,7 +1855,6 @@ static ssize_t cm_midi_read(struct file *file, char *buffer, size_t count, loff_
                                        ret = -EAGAIN;
                                break;
                        }
-                       __set_current_state(TASK_INTERRUPTIBLE);
                        schedule();
                        if (signal_pending(current)) 
                        {
@@ -1903,6 +1903,7 @@ static ssize_t cm_midi_write(struct file *file, const char *buffer, size_t count
        ret = 0;
        add_wait_queue(&s->midi.owait, &wait);
        while (count > 0) {
+               set_current_state(TASK_INTERRUPTIBLE);
                spin_lock_irqsave(&s->lock, flags);
                ptr = s->midi.owr;
                cnt = MIDIOUTBUF - ptr;
@@ -1919,7 +1920,6 @@ static ssize_t cm_midi_write(struct file *file, const char *buffer, size_t count
                                        ret = -EAGAIN;
                                break;
                        }
-                       __set_current_state(TASK_INTERRUPTIBLE);
                        schedule();
                        if (signal_pending(current)) {
                                if (!ret)
@@ -2041,9 +2041,9 @@ static int cm_midi_release(struct inode *inode, struct file *file)
 
        lock_kernel();
        if (file->f_mode & FMODE_WRITE) {
-               __set_current_state(TASK_INTERRUPTIBLE);
                add_wait_queue(&s->midi.owait, &wait);
                for (;;) {
+                       set_current_state(TASK_INTERRUPTIBLE);
                        spin_lock_irqsave(&s->lock, flags);
                        count = s->midi.ocnt;
                        spin_unlock_irqrestore(&s->lock, flags);
index 6c3663a976b3bf1760ae805a7a3470e09310bacb..3fcb068d1c31715ea67400bec3de42db7de7ea09 100644 (file)
@@ -1697,12 +1697,12 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
        if (cmd == OSS_GETVERSION)
                return put_user(SOUND_VERSION, (int *) arg);
 
-       if (_IOC_TYPE(cmd) != 'M' || _IOC_SIZE(cmd) != sizeof(int))
+       if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
                return -EINVAL;
 
-       // If ioctl has only the IOC_READ bit(bit 31)
+       // If ioctl has only the SIOC_READ bit(bit 31)
        // on, process the only-read commands. 
-       if (_IOC_DIR(cmd) == _IOC_READ) {
+       if (_SIOC_DIR(cmd) == _SIOC_READ) {
                switch (_IOC_NR(cmd)) {
                case SOUND_MIXER_RECSRC:        // Arg contains a bit for each recording source 
                        cs4281_read_ac97(s, BA0_AC97_RECORD_SELECT,
@@ -1740,9 +1740,9 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
                        return put_user(s->mix.vol[vidx - 1], (int *) arg);
                }
        }
-       // If ioctl doesn't have both the IOC_READ and 
-       // the IOC_WRITE bit set, return invalid.
-       if (_IOC_DIR(cmd) != (_IOC_READ | _IOC_WRITE))
+       // If ioctl doesn't have both the SIOC_READ and 
+       // the SIOC_WRITE bit set, return invalid.
+       if (_SIOC_DIR(cmd) != (_SIOC_READ | _SIOC_WRITE))
                return -EINVAL;
 
        // Increment the count of volume writes.
@@ -2038,9 +2038,9 @@ static int drain_adc(struct cs4281_state *s, int nonblock)
 
        if (s->dma_adc.mapped)
                return 0;
-       current->state = TASK_INTERRUPTIBLE;
        add_wait_queue(&s->dma_adc.wait, &wait);
        for (;;) {
+               set_current_state(TASK_INTERRUPTIBLE);
                spin_lock_irqsave(&s->lock, flags);
                count = s->dma_adc.count;
                CS_DBGOUT(CS_FUNCTION, 2,
@@ -2086,9 +2086,9 @@ static int drain_dac(struct cs4281_state *s, int nonblock)
 
        if (s->dma_dac.mapped)
                return 0;
-       current->state = TASK_INTERRUPTIBLE;
        add_wait_queue(&s->dma_dac.wait, &wait);
        for (;;) {
+               set_current_state(TASK_INTERRUPTIBLE);
                spin_lock_irqsave(&s->lock, flags);
                count = s->dma_dac.count;
                spin_unlock_irqrestore(&s->lock, flags);
@@ -3478,9 +3478,9 @@ static int cs4281_midi_release(struct inode *inode, struct file *file)
        VALIDATE_STATE(s);
 
        if (file->f_mode & FMODE_WRITE) {
-               current->state = TASK_INTERRUPTIBLE;
                add_wait_queue(&s->midi.owait, &wait);
                for (;;) {
+                       set_current_state(TASK_INTERRUPTIBLE);
                        spin_lock_irqsave(&s->lock, flags);
                        count = s->midi.ocnt;
                        spin_unlock_irqrestore(&s->lock, flags);
index f7ce193f0feb479f430e44f469100e8656ecf685..699e7967762ff4f35d3ad1f9536737dbece984dd 100644 (file)
@@ -898,9 +898,9 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a
        }
        if (cmd == OSS_GETVERSION)
                return put_user(SOUND_VERSION, (int *)arg);
-       if (_IOC_TYPE(cmd) != 'M' || _IOC_SIZE(cmd) != sizeof(int))
+       if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
                 return -EINVAL;
-        if (_IOC_DIR(cmd) == _IOC_READ) {
+        if (_SIOC_DIR(cmd) == _SIOC_READ) {
                 switch (_IOC_NR(cmd)) {
                 case SOUND_MIXER_RECSRC: /* Arg contains a bit for each recording source */
                        return put_user(s->mix.recsrc, (int *)arg);
@@ -937,7 +937,7 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a
                        return put_user(s->mix.vol[mixtable[i].volidx], (int *)arg);
                }
        }
-        if (_IOC_DIR(cmd) != (_IOC_READ|_IOC_WRITE)) 
+        if (_SIOC_DIR(cmd) != (_SIOC_READ|_SIOC_WRITE)) 
                return -EINVAL;
        s->mix.modcnt++;
        switch (_IOC_NR(cmd)) {
index 08a892bc362579fdbe9363d366522f0c7881f79e..548ee0949687bcadec26ca53e170cd2dcade652a 100644 (file)
@@ -725,9 +725,9 @@ static int mixer_ioctl(struct solo1_state *s, unsigned int cmd, unsigned long ar
        }
        if (cmd == OSS_GETVERSION)
                return put_user(SOUND_VERSION, (int *)arg);
-       if (_IOC_TYPE(cmd) != 'M' || _IOC_SIZE(cmd) != sizeof(int))
+       if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
                 return -EINVAL;
-        if (_IOC_DIR(cmd) == _IOC_READ) {
+        if (_SIOC_DIR(cmd) == _SIOC_READ) {
                 switch (_IOC_NR(cmd)) {
                 case SOUND_MIXER_RECSRC: /* Arg contains a bit for each recording source */
                        return put_user(mixer_src[read_mixer(s, 0x1c) & 7], (int *)arg);
@@ -756,7 +756,7 @@ static int mixer_ioctl(struct solo1_state *s, unsigned int cmd, unsigned long ar
                        return put_user(s->mix.vol[vidx-1], (int *)arg);
                }
        }
-        if (_IOC_DIR(cmd) != (_IOC_READ|_IOC_WRITE)) 
+        if (_SIOC_DIR(cmd) != (_SIOC_READ|_SIOC_WRITE)) 
                return -EINVAL;
        s->mix.modcnt++;
        switch (_IOC_NR(cmd)) {
index 0aef3da2981d9521a6eb6c36406227db596bb3e8..8727e2a88df02430ba619a5734e728d179a8ba33 100644 (file)
@@ -1073,9 +1073,9 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg)
                        return put_user(0, (int *)arg);
                return put_user(((4 - (l & 7)) << 2) | ((4 - (r & 7)) << 5) | 2, (int *)arg);
        }
-       if (_IOC_TYPE(cmd) != 'M' || _IOC_SIZE(cmd) != sizeof(int))
+       if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
                 return -EINVAL;
-        if (_IOC_DIR(cmd) == _IOC_READ) {
+        if (_SIOC_DIR(cmd) == _SIOC_READ) {
                 switch (_IOC_NR(cmd)) {
                 case SOUND_MIXER_RECSRC: /* Arg contains a bit for each recording source */
                        return put_user(mixer_recmask(s), (int *)arg);
@@ -1114,7 +1114,7 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg)
 #endif /* OSS_DOCUMENTED_MIXER_SEMANTICS */
                }
        }
-        if (_IOC_DIR(cmd) != (_IOC_READ|_IOC_WRITE)) 
+        if (_SIOC_DIR(cmd) != (_SIOC_READ|_SIOC_WRITE)) 
                return -EINVAL;
        s->mix.modcnt++;
        switch (_IOC_NR(cmd)) {
index 3143d7b64e61bb037dc28c182122cc314b8bffc7..b79ce2b328171fee3825c4b9aaec2d1c06743654 100644 (file)
@@ -1826,8 +1826,8 @@ static void pcm_shutdown_port(vwsnd_dev_t *devc,
 
        aport->swstate = SW_INITIAL;
        add_wait_queue(&aport->queue, &wait);
-       current->state = TASK_UNINTERRUPTIBLE;
        while (1) {
+               set_current_state(TASK_UNINTERRUPTIBLE);
                spin_lock_irqsave(&aport->lock, flags);
                {
                        hwstate = aport->hwstate;
@@ -2196,8 +2196,8 @@ static void pcm_write_sync(vwsnd_dev_t *devc)
 
        DBGEV("(devc=0x%p)\n", devc);
        add_wait_queue(&wport->queue, &wait);
-       current->state = TASK_UNINTERRUPTIBLE;
        while (1) {
+               set_current_state(TASK_UNINTERRUPTIBLE);
                spin_lock_irqsave(&wport->lock, flags);
                {
                        hwstate = wport->hwstate;
@@ -2284,9 +2284,9 @@ static ssize_t vwsnd_audio_do_read(struct file *file,
        while (count) {
                DECLARE_WAITQUEUE(wait, current);
                add_wait_queue(&rport->queue, &wait);
-               current->state = TASK_INTERRUPTIBLE;
                while ((nb = swb_inc_u(rport, 0)) == 0) {
                        DBGPV("blocking\n");
+                       set_current_state(TASK_INTERRUPTIBLE);
                        if (rport->flags & DISABLED ||
                            file->f_flags & O_NONBLOCK) {
                                current->state = TASK_RUNNING;
@@ -2360,8 +2360,8 @@ static ssize_t vwsnd_audio_do_write(struct file *file,
        while (count) {
                DECLARE_WAITQUEUE(wait, current);
                add_wait_queue(&wport->queue, &wait);
-               current->state = TASK_INTERRUPTIBLE;
                while ((nb = swb_inc_u(wport, 0)) == 0) {
+                       set_current_state(TASK_INTERRUPTIBLE);
                        if (wport->flags & DISABLED ||
                            file->f_flags & O_NONBLOCK) {
                                current->state = TASK_RUNNING;
index 584b3615c8e334a5e94f3fecf915058c4045d701..a3be533e600dfd7afbbff430d5f5fec9e55ca177 100644 (file)
@@ -1812,6 +1812,8 @@ ssize_t ixj_read(struct file * file_p, char *buf, size_t length, loff_t * ppos)
        while (!j->read_buffer_ready || (j->dtmf_state && j->flags.dtmf_oob)) {
                ++j->read_wait;
                if(j->tone_state) {
+                       set_current_state(TASK_RUNNING);
+                       remove_wait_queue(&j->read_q, &wait);
                        j->flags.inread = 0;
                        return -EAGAIN;
                }
@@ -1894,6 +1896,8 @@ ssize_t ixj_write(struct file *file_p, const char *buf, size_t count, loff_t * p
        while (!j->write_buffers_empty) {
                ++j->write_wait;
                if(j->tone_state) {
+                       set_current_state(TASK_RUNNING);
+                       remove_wait_queue(&j->write_q, &wait);
                        j->flags.inwrite = 0;
                        return -EAGAIN;
                }
index 2ce91d059a628743f688cc9347b32d9791bc2ad0..eae365d4705cecacc24d2d688834988789df1545 100644 (file)
@@ -653,6 +653,7 @@ static int net1080_stop (struct net_device *net)
                dbg ("waited for %d urb completions", temp);
        }
        dev->wait = 0;
+       current->state = TASK_RUNNING;
        remove_wait_queue (&unlink_wakeup, &wait); 
 
        mutex_unlock (&dev->mutex);
index 57915b46a67110384b5a367e324e3f517348dc9e..fcdf71e841ea01b9879299c419a1497a671ba198 100644 (file)
@@ -316,6 +316,8 @@ static int ftdi_sio_write (struct usb_serial_port *port, int from_user,
                while (port->write_urb->status == -EINPROGRESS) {
                        dbg(__FUNCTION__ " write in progress - retrying");
                        if (0 /* file->f_flags & O_NONBLOCK */) {
+                               remove_wait_queue(&port->write_wait, &wait);
+                               set_current_state(TASK_RUNNING);
                                rc = -EAGAIN;
                                goto err;
                        }
@@ -326,6 +328,7 @@ static int ftdi_sio_write (struct usb_serial_port *port, int from_user,
                                goto err;
                        }
                        schedule();
+                       set_current_state (TASK_INTERRUPTIBLE);
                }               
                remove_wait_queue(&port->write_wait, &wait);
                set_current_state(TASK_RUNNING);
index 648db0bc3ce5fc2841aedcc094b63b385fe64cbd..dd72f334ce63c3403371d4cd4cfd57c3b161054c 100644 (file)
@@ -423,6 +423,7 @@ int usb_stor_control_msg(struct us_data *us, unsigned int pipe,
        if (status) {
                /* something went wrong */
                up(&(us->current_urb_sem));
+               current->state = TASK_RUNNING;
                remove_wait_queue(&wqh, &wait);
                kfree(dr);
                return status;
@@ -480,6 +481,7 @@ int usb_stor_bulk_msg(struct us_data *us, void *data, int pipe,
        if (status) {
                /* something went wrong */
                up(&(us->current_urb_sem));
+               current->state = TASK_RUNNING;
                remove_wait_queue(&wqh, &wait);
                return status;
        }
index b63f4359cb6e78224570c347ccae6ce57be02035..a7129ba25efedfb4d30a7938a4b53c0ac30c670b 100644 (file)
@@ -312,11 +312,15 @@ static int usb_stor_control_thread(void * __us)
                        US_DEBUGP("-- US_ACT_EXIT command recieved\n");
                        break;
                }
+
+               set_current_state(TASK_INTERRUPTIBLE);
        } /* for (;;) */
 
        /* notify the exit routine that we're actually exiting now */
        up(&(us->notify));
 
+       remove_wait_queue(&(us->wqh), &wait);
+
        return 0;
 }      
 
index 2105cb5953176347df3daf0a5a19643a996815db..9d424a61af7fbedfe5b621475657cfa2d92d834d 100644 (file)
@@ -654,6 +654,7 @@ static int sohci_unlink_urb (urb_t * urb)
                                set_current_state(TASK_UNINTERRUPTIBLE);
                                while (timeout && (urb->status == USB_ST_URB_PENDING))
                                        timeout = schedule_timeout (timeout);
+                               current->state = TASK_RUNNING;
                                remove_wait_queue (&unlink_wakeup, &wait); 
                                if (urb->status == USB_ST_URB_PENDING) {
                                        err ("unlink URB timeout");
@@ -765,6 +766,7 @@ static int sohci_free_dev (struct usb_device * usb_dev)
                                set_current_state(TASK_UNINTERRUPTIBLE);
                                while (timeout && dev->ed_cnt)
                                        timeout = schedule_timeout (timeout);
+                               current->state = TASK_RUNNING;
                                remove_wait_queue (&freedev_wakeup, &wait);
                                if (dev->ed_cnt) {
                                        err ("free device %d timeout", usb_dev->devnum);
index f294a0ea587386963918454c914739b9d742e4d2..5b1b76003c5827ff204ed1ea59ff478a3031fd13 100644 (file)
@@ -951,6 +951,7 @@ static int usb_start_wait_urb(urb_t *urb, int timeout, int* actual_length)
        if (status) {
                // something went wrong
                usb_free_urb(urb);
+               current->state = TASK_RUNNING;
                remove_wait_queue(&wqh, &wait);
                return status;
        }
@@ -961,6 +962,7 @@ static int usb_start_wait_urb(urb_t *urb, int timeout, int* actual_length)
        } else
                status = 1;
 
+       current->state = TASK_RUNNING;
        remove_wait_queue(&wqh, &wait);
 
        if (!status) {
index 468f02e6607b5f409b82db551835be435cc68401..e48c0f4589e9d35fb6cc535010fa1b777f0d8139 100644 (file)
@@ -870,7 +870,7 @@ vgacon_adjust_height(unsigned fontheight)
        ovr = inb_p(vga_video_port_val);
        outb_p( 0x09, vga_video_port_reg );             /* Font size register */
        fsr = inb_p(vga_video_port_val);
-       spin_lock_irq(&vga_lock);
+       spin_unlock_irq(&vga_lock);
 
        vde = maxscan & 0xff;                   /* Vertical display end reg */
        ovr = (ovr & 0xbd) +                    /* Overflow register */
index c1c6211796a63c8168e23ea3f907f7ec4f1c9648..42f19e2922acfe57f77e4aef6148394f951262e1 100644 (file)
@@ -245,13 +245,11 @@ adfs_iget(struct super_block *sb, struct object_info *obj)
 {
        struct inode *inode;
 
-       inode = get_empty_inode();
+       inode = new_inode(sb);
        if (!inode)
                goto out;
 
        inode->i_version = ++event;
-       inode->i_sb      = sb;
-       inode->i_dev     = sb->s_dev;
        inode->i_uid     = sb->u.adfs_sb.s_uid;
        inode->i_gid     = sb->u.adfs_sb.s_gid;
        inode->i_ino     = obj->file_id;
index 2f8c36aa572ecd7f933088b797c36d3c5eb1f5c0..fcb7e103a56f3a919b72a93626f2858d4300732c 100644 (file)
@@ -306,18 +306,19 @@ affs_new_inode(const struct inode *dir)
        struct super_block      *sb;
        s32                      block;
 
-       if (!dir || !(inode = get_empty_inode()))
+       if (!dir)
                return NULL;
 
        sb = dir->i_sb;
-       inode->i_sb    = sb;
+       inode = new_inode(sb);
+       if (!inode)
+               return NULL;
 
        if (!(block = affs_new_header((struct inode *)dir))) {
                iput(inode);
                return NULL;
        }
 
-       inode->i_dev     = sb->s_dev;
        inode->i_uid     = current->fsuid;
        inode->i_gid     = current->fsgid;
        inode->i_ino     = block;
index 077df4c2b9908706b26882d898c6b53a8bfb43df..dd7dd07acc5e0d9df9838509dec339a45efb3202 100644 (file)
@@ -292,14 +292,12 @@ static int autofs4_statfs(struct super_block *sb, struct statfs *buf)
 struct inode *autofs4_get_inode(struct super_block *sb,
                                struct autofs_info *inf)
 {
-       struct inode *inode = get_empty_inode();
+       struct inode *inode = new_inode(sb);
 
        if (inode == NULL)
                return NULL;
 
        inf->inode = inode;
-       inode->i_sb = sb;
-       inode->i_dev = sb->s_dev;
        inode->i_mode = inf->mode;
        if (sb->s_root) {
                inode->i_uid = sb->s_root->d_inode->i_uid;
@@ -308,13 +306,9 @@ struct inode *autofs4_get_inode(struct super_block *sb,
                inode->i_uid = 0;
                inode->i_gid = 0;
        }
-       inode->i_size = 0;
        inode->i_blksize = PAGE_CACHE_SIZE;
        inode->i_blocks = 0;
        inode->i_rdev = 0;
-       inode->i_nlink = 1;
-       inode->i_op = NULL;
-       inode->i_fop = NULL;
        inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
 
        if (S_ISDIR(inf->mode)) {
index 1a053242065fb55ad626a8bc28c88c03c7125816..5caf04a7b8d163dfc9e50f1f05a20eb584208514 100644 (file)
@@ -80,10 +80,9 @@ static int bfs_create(struct inode * dir, struct dentry * dentry, int mode)
        struct super_block * s = dir->i_sb;
        unsigned long ino;
 
-       inode = get_empty_inode();
+       inode = new_inode(s);
        if (!inode)
                return -ENOSPC;
-       inode->i_sb = s;
        ino = find_first_zero_bit(s->su_imap, s->su_lasti);
        if (ino > s->su_lasti) {
                iput(inode);
@@ -91,7 +90,6 @@ static int bfs_create(struct inode * dir, struct dentry * dentry, int mode)
        }
        set_bit(ino, s->su_imap);       
        s->su_freei--;
-       inode->i_dev = s->s_dev;
        inode->i_uid = current->fsuid;
        inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->fsgid;
        inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
index 4b34da094634b9a46e5c8e6ecce3af4f55c4b3d1..51eff1caae27a89536801e52c8145c36380f1ecc 100644 (file)
@@ -34,7 +34,7 @@ static struct address_space_operations cramfs_aops;
 
 static struct inode *get_cramfs_inode(struct super_block *sb, struct cramfs_inode * cramfs_inode)
 {
-       struct inode * inode = get_empty_inode();
+       struct inode * inode = new_inode(sb);
 
        if (inode) {
                inode->i_mode = cramfs_inode->mode;
@@ -42,14 +42,10 @@ static struct inode *get_cramfs_inode(struct super_block *sb, struct cramfs_inod
                inode->i_size = cramfs_inode->size;
                inode->i_gid = cramfs_inode->gid;
                inode->i_ino = CRAMINO(cramfs_inode);
-               inode->i_sb = sb;
-               inode->i_dev = sb->s_dev;
-               inode->i_nlink = 1; /* arguably wrong for directories,
-                                      but it's the best we can do
-                                      without reading the directory
-                                      contents.  1 yields the right
-                                      result in GNU find, even
-                                      without -noleaf option. */
+               /* inode->i_nlink is left 1 - arguably wrong for directories,
+                  but it's the best we can do without reading the directory
+                  contents.  1 yields the right result in GNU find, even
+                  without -noleaf option. */
                insert_inode_hash(inode);
                if (S_ISREG(inode->i_mode)) {
                        inode->i_fop = &generic_ro_fops;
index 264992d3ff54e8a0a5802f7438dfd103171e0efd..67962d5dcc5b66170b14dfc199791e902b062f82 100644 (file)
@@ -3185,6 +3185,7 @@ static ssize_t devfsd_read (struct file *file, char *buf, size_t len,
            current->state = TASK_RUNNING;
            return -EINTR;
        }
+       set_current_state(TASK_INTERRUPTIBLE);
     }
     remove_wait_queue (&fs_info->devfsd_wait_queue, &wait);
     current->state = TASK_RUNNING;
index c3667b2086e22e283a11fd62df72a28c561198b7..0bb8826d8eff520e2a7564ba3a7cbfecf55dda25 100644 (file)
@@ -140,14 +140,11 @@ struct super_block *devpts_read_super(struct super_block *s, void *data,
                goto fail_free;
        }
 
-       inode = get_empty_inode();
+       inode = new_inode(s);
        if (!inode)
                goto fail_free;
-       inode->i_sb = s;
-       inode->i_dev = s->s_dev;
        inode->i_ino = 1;
        inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
-       inode->i_size = 0;
        inode->i_blocks = 0;
        inode->i_blksize = 1024;
        inode->i_uid = inode->i_gid = 0;
@@ -192,11 +189,9 @@ void devpts_pty_new(int number, kdev_t device)
        if ( sbi->inodes[number] )
                return; /* Already registered, this does happen */
                
-       inode = get_empty_inode();
+       inode = new_inode(sb);
        if (!inode)
                return;
-       inode->i_sb = sb;
-       inode->i_dev = sb->s_dev;
        inode->i_ino = number+2;
        inode->i_blocks = 0;
        inode->i_blksize = 1024;
index adaab9c74e4d3e0bb1af2ead1ad8f75b6e9c7abd..cf8fa51543b0ffe8a2171db199fe9bb8ba125d41 100644 (file)
@@ -274,15 +274,13 @@ struct inode * ext2_new_inode (const struct inode * dir, int mode, int * err)
                return NULL;
        }
 
-       inode = get_empty_inode ();
+       sb = dir->i_sb;
+       inode = new_inode(sb);
        if (!inode) {
                *err = -ENOMEM;
                return NULL;
        }
 
-       sb = dir->i_sb;
-       inode->i_sb = sb;
-       inode->i_flags = 0;
        lock_super (sb);
        es = sb->u.ext2_sb.s_es;
 repeat:
@@ -430,9 +428,6 @@ repeat:
        mark_buffer_dirty(sb->u.ext2_sb.s_sbh);
        sb->s_dirt = 1;
        inode->i_mode = mode;
-       inode->i_sb = sb;
-       inode->i_nlink = 1;
-       inode->i_dev = sb->s_dev;
        inode->i_uid = current->fsuid;
        if (test_opt (sb, GRPID))
                inode->i_gid = dir->i_gid;
index d1e8557f7aa710f2cc5084522798946bda1684b2..aed45096d6bdb956adb47e3fa946e91da9856340 100644 (file)
@@ -138,13 +138,11 @@ struct inode *fat_build_inode(struct super_block *sb,
        inode = fat_iget(sb, ino);
        if (inode)
                goto out;
-       inode = get_empty_inode();
+       inode = new_inode(sb);
        *res = -ENOMEM;
        if (!inode)
                goto out;
        *res = 0;
-       inode->i_sb = sb;
-       inode->i_dev = sb->s_dev;
        inode->i_ino = iunique(sb, MSDOS_ROOT_INO);
        fat_fill_inode(inode, de);
        fat_attach(inode, ino);
@@ -658,11 +656,9 @@ fat_read_super(struct super_block *sb, void *data, int silent,
        if (! sbi->nls_io)
                sbi->nls_io = load_nls_default();
 
-       root_inode=get_empty_inode();
+       root_inode=new_inode(sb);
        if (!root_inode)
                goto out_unload_nls;
-       root_inode->i_sb = sb;
-       root_inode->i_dev = sb->s_dev;
        root_inode->i_ino = MSDOS_ROOT_INO;
        fat_read_root(root_inode);
        insert_inode_hash(root_inode);
index d075c5c4e0c7b5f2ce4efae1dd66a0634edea447..9c9fcafbc9cd13fa773fa601ebaf9f027b23b7a8 100644 (file)
@@ -391,13 +391,13 @@ static void send_sigio_to_task(struct task_struct *p,
                           back to SIGIO in that case. --sct */
                        si.si_signo = fown->signum;
                        si.si_errno = 0;
-                       si.si_code  = reason;
+                       si.si_code  = reason & ~__SI_MASK;
                        /* Make sure we are called with one of the POLL_*
                           reasons, otherwise we could leak kernel stack into
                           userspace.  */
                        if ((reason & __SI_MASK) != __SI_POLL)
                                BUG();
-                       if (reason - POLL_IN > NSIGPOLL)
+                       if (reason - POLL_IN >= NSIGPOLL)
                                si.si_band  = ~0L;
                        else
                                si.si_band = band_table[reason - POLL_IN];
index 41b20176712115ada61f234ba531a73179a3d088..8d77ed2f7483f017db2d085b0ddc5de73d6ca6d9 100644 (file)
@@ -94,6 +94,14 @@ int get_acorn_filename(struct iso_directory_record * de,
        return retnamlen;
 }
 
+static struct buffer_head *isofs_bread(struct inode *inode, unsigned int bufsize, unsigned int block)
+{
+       unsigned int blknr = isofs_bmap(inode, block);
+       if (!blknr)
+               return NULL;
+       return bread(inode->i_dev, blknr, bufsize);
+}
+
 /*
  * This should _really_ be cleaned up some day..
  */
@@ -105,7 +113,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
        unsigned char bufbits = ISOFS_BUFFER_BITS(inode);
        unsigned int block, offset;
        int inode_number = 0;   /* Quiet GCC */
-       struct buffer_head *bh;
+       struct buffer_head *bh = NULL;
        int len;
        int map;
        int high_sierra;
@@ -117,46 +125,25 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
                return 0;
  
        offset = filp->f_pos & (bufsize - 1);
-       block = isofs_bmap(inode, filp->f_pos >> bufbits);
+       block = filp->f_pos >> bufbits;
        high_sierra = inode->i_sb->u.isofs_sb.s_high_sierra;
 
-       if (!block)
-               return 0;
-
-       if (!(bh = breada(inode->i_dev, block, bufsize, filp->f_pos, inode->i_size)))
-               return 0;
-
        while (filp->f_pos < inode->i_size) {
                int de_len;
-#ifdef DEBUG
-               printk("Block, offset, f_pos: %x %x %x\n",
-                      block, offset, filp->f_pos);
-               printk("inode->i_size = %x\n",inode->i_size);
-#endif
-               /* Next directory_record on next CDROM sector */
-               if (offset >= bufsize) {
-#ifdef DEBUG
-                       printk("offset >= bufsize\n");
-#endif
-                       brelse(bh);
-                       offset = 0;
-                       block = isofs_bmap(inode, (filp->f_pos) >> bufbits);
-                       if (!block)
-                               return 0;
-                       bh = breada(inode->i_dev, block, bufsize, filp->f_pos, inode->i_size);
+
+               if (!bh) {
+                       bh = isofs_bread(inode, bufsize, block);
                        if (!bh)
                                return 0;
-                       continue;
                }
 
                de = (struct iso_directory_record *) (bh->b_data + offset);
-               if(first_de) inode_number = (block << bufbits) + (offset & (bufsize - 1));
+               if (first_de) inode_number = (bh->b_blocknr << bufbits) + (offset & (bufsize - 1));
 
                de_len = *(unsigned char *) de;
 #ifdef DEBUG
                printk("de_len = %d\n", de_len);
-#endif
-           
+#endif     
 
                /* If the length byte is zero, we should move on to the next
                   CDROM sector.  If we are at the end of the directory, we
@@ -164,36 +151,36 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
 
                if (de_len == 0) {
                        brelse(bh);
-                       filp->f_pos = ((filp->f_pos & ~(ISOFS_BLOCK_SIZE - 1))
-                                      + ISOFS_BLOCK_SIZE);
+                       bh = NULL;
+                       filp->f_pos = ((filp->f_pos & ~(ISOFS_BLOCK_SIZE - 1)) + ISOFS_BLOCK_SIZE);
+                       block = filp->f_pos >> bufbits;
                        offset = 0;
-
-                       if (filp->f_pos >= inode->i_size)
-                               return 0;
-
-                       block = isofs_bmap(inode, (filp->f_pos) >> bufbits);
-                       if (!block)
-                               return 0;
-                       bh = breada(inode->i_dev, block, bufsize, filp->f_pos, inode->i_size);
-                       if (!bh)
-                               return 0;
                        continue;
                }
 
-               offset +=  de_len;
+               offset += de_len;
+               if (offset == bufsize) {
+                       offset = 0;
+                       block++;
+                       brelse(bh);
+                       bh = NULL;
+               }
+
+               /* Make sure we have a full directory entry */
                if (offset > bufsize) {
-                       /*
-                        * This would only normally happen if we had
-                        * a buggy cdrom image.  All directory
-                        * entries should terminate with a null size
-                        * or end exactly at the end of the sector.
-                        */
-                       printk("next_offset (%x) > bufsize (%lx)\n",
-                              offset,bufsize);
-                       break;
+                       int slop = bufsize - offset + de_len;
+                       memcpy(tmpde, de, slop);
+                       offset &= bufsize - 1;
+                       block++;
+                       brelse(bh);
+                       bh = isofs_bread(inode, bufsize, block);
+                       if (!bh)
+                               return 0;
+                       memcpy((void *) tmpde + slop, bh->b_data, de_len - slop);
+                       de = tmpde;
                }
 
-               if(de->flags[-high_sierra] & 0x80) {
+               if (de->flags[-high_sierra] & 0x80) {
                        first_de = 0;
                        filp->f_pos += de_len;
                        continue;
index 3ac27df920a3de648fddfa8c9ce544fcf97ff85d..9ea3cafdb1cc6a96783e82ad145630f6b6fe8e26 100644 (file)
@@ -327,17 +327,15 @@ jffs_new_inode(const struct inode * dir, struct jffs_raw_inode *raw_inode,
        struct inode * inode;
        struct jffs_control *c;
 
-       inode = get_empty_inode();
+       sb = dir->i_sb;
+       inode = new_inode(sb);
        if (!inode) {
                *err = -ENOMEM;
                return NULL;
        }
 
-       sb = dir->i_sb;
        c = (struct jffs_control *)sb->u.generic_sbp;
 
-       inode->i_sb = sb;
-       inode->i_dev = sb->s_dev;
        inode->i_ino = raw_inode->ino;
        inode->i_mode = raw_inode->mode;
        inode->i_nlink = raw_inode->nlink;
index dce2687ee1021af81f7b4fd7b2bd3407206e77c5..49f757e809a93555e6cf017e6e120b50b6c7457f 100644 (file)
@@ -224,14 +224,12 @@ struct inode * minix_new_inode(const struct inode * dir, int * error)
        struct buffer_head * bh;
        int i,j;
 
-       inode = get_empty_inode();
+       sb = dir->i_sb;
+       inode = new_inode(sb);
        if (!inode) {
                *error = -ENOMEM;
                return NULL;
        }
-       sb = dir->i_sb;
-       inode->i_sb = sb;
-       inode->i_flags = 0;
        j = 8192;
        bh = NULL;
        *error = -ENOSPC;
@@ -259,8 +257,6 @@ struct inode * minix_new_inode(const struct inode * dir, int * error)
                unlock_super(sb);
                return NULL;
        }
-       inode->i_nlink = 1;
-       inode->i_dev = sb->s_dev;
        inode->i_uid = current->fsuid;
        inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->fsgid;
        inode->i_ino = j;
index ff0c1fd03b60710778a73652e00531b7f5c1bff2..badfc78174309211f3e274914d1632b87f055610 100644 (file)
@@ -214,13 +214,11 @@ ncp_iget(struct super_block *sb, struct ncp_entry_info *info)
                return NULL;
        }
 
-       inode = get_empty_inode();
+       inode = new_inode(sb);
        if (inode) {
                init_MUTEX(&NCP_FINFO(inode)->open_sem);
                atomic_set(&NCP_FINFO(inode)->opened, info->opened);
 
-               inode->i_sb = sb;
-               inode->i_dev = sb->s_dev;
                inode->i_ino = info->ino;
                ncp_set_attr(inode, info);
                if (S_ISREG(inode->i_mode)) {
index b21592528f09c29e82a1c0517a70366ed04407a4..fee191bd7612617a6e79806eac359f007d707ced 100644 (file)
@@ -720,11 +720,9 @@ nfs_fhget(struct dentry *dentry, struct nfs_fh *fhandle,
        if ((dentry->d_parent->d_inode->u.nfs_i.flags & NFS_IS_SNAPSHOT) ||
            (dentry->d_name.len == 9 &&
             memcmp(dentry->d_name.name, ".snapshot", 9) == 0)) {
-               struct inode *inode = get_empty_inode();
+               struct inode *inode = new_inode(sb);
                if (!inode)
-                       goto out;       
-               inode->i_sb = sb;
-               inode->i_dev = sb->s_dev;
+                       goto out;
                inode->i_flags = 0;
                inode->i_ino = nfs_fattr_to_ino_t(fattr);
                nfs_read_inode(inode);
index 55c915ee367d76862c204c26490200e7a74245ed..2309549931abf9cc0e921f0e9d2267fb242ebaa9 100644 (file)
@@ -601,14 +601,10 @@ nfs_wait_on_request(struct nfs_page *req)
 {
        struct inode    *inode = req->wb_dentry->d_inode;
         struct rpc_clnt        *clnt = NFS_CLIENT(inode);
-        int retval;
 
        if (!NFS_WBACK_BUSY(req))
                return 0;
-       req->wb_count++;
-       retval = nfs_wait_event(clnt, req->wb_wait, !NFS_WBACK_BUSY(req));
-       nfs_release_request(req);
-        return retval;
+       return nfs_wait_event(clnt, req->wb_wait, !NFS_WBACK_BUSY(req));
 }
 
 /*
@@ -1239,6 +1235,13 @@ nfs_writeback_done(struct rpc_task *task)
        }
 #endif
 
+       /*
+        * Update attributes as result of writeback.
+        * FIXME: There is an inherent race with invalidate_inode_pages and
+        *        writebacks since the page->count is kept > 1 for as long
+        *        as the page has a write request pending.
+        */
+       nfs_write_attributes(inode, resp->fattr);
        while (!list_empty(&data->pages)) {
                req = nfs_list_entry(data->pages.next);
                nfs_list_remove_request(req);
@@ -1278,9 +1281,6 @@ nfs_writeback_done(struct rpc_task *task)
        next:
                nfs_unlock_request(req);
        }
-       /* Update attributes as result of writeback. */
-       nfs_write_attributes(inode, resp->fattr);
-
 }
 
 
@@ -1395,6 +1395,7 @@ nfs_commit_done(struct rpc_task *task)
         dprintk("NFS: %4d nfs_commit_done (status %d)\n",
                                 task->tk_pid, task->tk_status);
 
+       nfs_write_attributes(inode, resp->fattr);
        while (!list_empty(&data->pages)) {
                req = nfs_list_entry(data->pages.next);
                nfs_list_remove_request(req);
@@ -1426,8 +1427,6 @@ nfs_commit_done(struct rpc_task *task)
        next:
                nfs_unlock_request(req);
        }
-
-       nfs_write_attributes(inode, resp->fattr);
 }
 #endif
 
index f9ffb0a406fbf77f4db457f3f3671798da3ff726..49d2160a62c2fddef4c5b979fe6b2cb821a00624 100644 (file)
@@ -428,7 +428,7 @@ ntfs_create(struct inode* dir,struct dentry *d,int mode)
        int error=0;
        ntfs_attribute *si;
 
-       r=get_empty_inode();
+       r=new_inode(dir->i_sb);
        if(!r){
                error=ENOMEM;
                goto fail;
@@ -456,8 +456,6 @@ ntfs_create(struct inode* dir,struct dentry *d,int mode)
 
        r->i_uid=vol->uid;
        r->i_gid=vol->gid;
-       r->i_nlink=1;
-       r->i_sb=dir->i_sb;
        /* FIXME: dirty? dev? */
        /* get the file modification times from the standard information */
        si=ntfs_find_attr(ino,vol->at_standard_information,NULL);
@@ -502,7 +500,7 @@ _linux_ntfs_mkdir(struct inode *dir, struct dentry* d, int mode)
                goto out;
 
        error = EIO;
-       r = get_empty_inode();
+       r = new_inode(dir->i_sb);
        if (!r)
                goto out;
        
@@ -522,8 +520,6 @@ _linux_ntfs_mkdir(struct inode *dir, struct dentry* d, int mode)
                goto out;
        r->i_uid = vol->uid;
        r->i_gid = vol->gid;
-       r->i_nlink = 1;
-       r->i_sb = dir->i_sb;
        si = ntfs_find_attr(ino,vol->at_standard_information,NULL);
        if(si){
                char *attr = si->d.data;
index 1856d54d35434b66ed12b8bbf2a13951d4ab50c7..c7f27a520a2f664ae267ea3a8e3499fd38784fae 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -608,14 +608,12 @@ static struct super_operations pipefs_ops = {
 
 static struct super_block * pipefs_read_super(struct super_block *sb, void *data, int silent)
 {
-       struct inode *root = get_empty_inode();
+       struct inode *root = new_inode(sb);
        if (!root)
                return NULL;
        root->i_mode = S_IFDIR | S_IRUSR | S_IWUSR;
        root->i_uid = root->i_gid = 0;
        root->i_atime = root->i_mtime = root->i_ctime = CURRENT_TIME;
-       root->i_sb = sb;
-       root->i_dev = sb->s_dev;
        sb->s_blocksize = 1024;
        sb->s_blocksize_bits = 10;
        sb->s_magic = PIPEFS_MAGIC;
index 25fa7bdbc4d2b6bc04d0035247325f9c6b19a93e..c1a960c5db2ca3b45a2af0f42f265078866d1a9b 100644 (file)
@@ -626,14 +626,12 @@ static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_st
 
        /* We need a new inode */
        
-       inode = get_empty_inode();
+       inode = new_inode(sb);
        if (!inode)
                goto out;
 
        /* Common stuff */
 
-       inode->i_sb = sb;
-       inode->i_dev = sb->s_dev;
        inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
        inode->i_ino = fake_ino(task->pid, ino);
 
@@ -918,11 +916,9 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry)
        name = dentry->d_name.name;
        len = dentry->d_name.len;
        if (len == 4 && !memcmp(name, "self", 4)) {
-               inode = get_empty_inode();
+               inode = new_inode(dir->i_sb);
                if (!inode)
                        return ERR_PTR(-ENOMEM);
-               inode->i_sb = dir->i_sb;
-               inode->i_dev = dir->i_sb->s_dev;
                inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
                inode->i_ino = fake_ino(0, PROC_PID_INO);
                inode->u.proc_i.file = NULL;
index 7d53485b8d1510929579481b8ac91f4034723a2e..31461669c923cdcebb5384c32e8730428ef4c604 100644 (file)
@@ -109,21 +109,15 @@ static int ramfs_commit_write(struct file *file, struct page *page, unsigned off
 
 struct inode *ramfs_get_inode(struct super_block *sb, int mode, int dev)
 {
-       struct inode * inode = get_empty_inode();
+       struct inode * inode = new_inode(sb);
 
        if (inode) {
-               inode->i_sb = sb;
-               inode->i_dev = sb->s_dev;
                inode->i_mode = mode;
                inode->i_uid = current->fsuid;
                inode->i_gid = current->fsgid;
-               inode->i_size = 0;
                inode->i_blksize = PAGE_CACHE_SIZE;
                inode->i_blocks = 0;
                inode->i_rdev = to_kdev_t(dev);
-               inode->i_nlink = 1;
-               inode->i_op = NULL;
-               inode->i_fop = NULL;
                inode->i_mapping->a_ops = &ramfs_aops;
                inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
                switch (mode & S_IFMT) {
index a49213ecbaa327cca057b1957613b8e4cc4d069d..975013e7f8097dfe3cfc8c99320b6721306935be 100644 (file)
@@ -382,13 +382,14 @@ static void do_pollfd(unsigned int num, struct pollfd * fdpage,
 static int do_poll(unsigned int nfds, unsigned int nchunks, unsigned int nleft, 
        struct pollfd *fds[], poll_table *wait, long timeout)
 {
-       int count = 0;
+       int count;
        poll_table* pt = wait;
 
        for (;;) {
                unsigned int i;
 
                set_current_state(TASK_INTERRUPTIBLE);
+               count = 0;
                for (i=0; i < nchunks; i++)
                        do_pollfd(POLLFD_PER_PAGE, fds[i], &pt, &count);
                if (nleft)
@@ -396,9 +397,9 @@ static int do_poll(unsigned int nfds, unsigned int nchunks, unsigned int nleft,
                pt = NULL;
                if (count || !timeout || signal_pending(current))
                        break;
-               if(wait->error) {
-                       return wait->error;
-               }
+               count = wait->error;
+               if (count)
+                       break;
                timeout = schedule_timeout(timeout);
        }
        current->state = TASK_RUNNING;
index 0406f72cb88ee9f7e0d7f93d255c349a98721b8a..bcc900626c46c1a4e2c5feb42803e17d12fe201d 100644 (file)
@@ -78,11 +78,9 @@ smb_iget(struct super_block *sb, struct smb_fattr *fattr)
 
        DEBUG1("smb_iget: %p\n", fattr);
 
-       result = get_empty_inode();
+       result = new_inode(sb);
        if (!result)
                return result;
-       result->i_sb = sb;
-       result->i_dev = sb->s_dev;
        result->i_ino = fattr->f_ino;
        memset(&(result->u.smbfs_i), 0, sizeof(result->u.smbfs_i));
        smb_set_inode_attr(result, fattr);
index 8469366cfd82c71e4e61aea0696a4dc08fe3cbe4..d45304cfae58b0c9f0039467ef169e7048c83d27 100644 (file)
@@ -91,10 +91,12 @@ struct inode * sysv_new_inode(const struct inode * dir)
        struct sysv_inode * raw_inode;
        int i,j,ino,block;
 
-       if (!dir || !(inode = get_empty_inode()))
+       if (!dir)
                return NULL;
        sb = dir->i_sb;
-       inode->i_sb = sb;
+       inode = new_inode(sb);
+       if (!inode)
+               return NULL;
        lock_super(sb);         /* protect against task switches */
        if ((*sb->sv_sb_fic_count == 0)
            || (*sv_sb_fic_inode(sb,(*sb->sv_sb_fic_count)-1) == 0) /* Applies only to SystemV2 FS */
@@ -131,7 +133,6 @@ struct inode * sysv_new_inode(const struct inode * dir)
        mark_buffer_dirty(sb->sv_bh1); /* super-block has been modified */
        if (sb->sv_bh1 != sb->sv_bh2) mark_buffer_dirty(sb->sv_bh2);
        sb->s_dirt = 1; /* and needs time stamp */
-       inode->i_dev = sb->s_dev;
        inode->i_uid = current->fsuid;
        inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->fsgid;
        inode->i_ino = ino;
index 5377773ce70678dc3edbdd0b2507553f9d4311bb..9bffe61fdc4e527af0c3a00a0cef367e18099e85 100644 (file)
@@ -77,14 +77,13 @@ struct inode * udf_new_inode (const struct inode *dir, int mode, int * err)
        int block;
        Uint32 start = UDF_I_LOCATION(dir).logicalBlockNum;
 
-       inode = get_empty_inode();
+       sb = dir->i_sb;
+       inode = new_inode(sb);
        if (!inode)
        {
                *err = -ENOMEM;
                return NULL;
        }
-       sb = dir->i_sb;
-       inode->i_sb = sb;
        inode->i_flags = 0;
        *err = -ENOSPC;
 
@@ -115,9 +114,6 @@ struct inode * udf_new_inode (const struct inode *dir, int mode, int * err)
                mark_buffer_dirty(UDF_SB_LVIDBH(sb));
        }
        inode->i_mode = mode;
-       inode->i_sb = sb;
-       inode->i_nlink = 1;
-       inode->i_dev = sb->s_dev;
        inode->i_uid = current->fsuid;
        if (dir->i_mode & S_ISGID) {
                inode->i_gid = dir->i_gid;
index 1a97daf7cc526aafad1be4db658f2fbe26e9e377..d7fef19cdb732c9aa283eccdd0433baeacc35497 100644 (file)
@@ -161,19 +161,16 @@ struct inode * ufs_new_inode (const struct inode * dir,   int mode, int * err )
                *err = -EPERM;
                return NULL;
        }
-       inode = get_empty_inode ();
+       sb = dir->i_sb;
+       inode = new_inode(sb);
        if (!inode) {
                *err = -ENOMEM;
                return NULL;
        }
-       sb = dir->i_sb;
        swab = sb->u.ufs_sb.s_swab;
        uspi = sb->u.ufs_sb.s_uspi;
        usb1 = ubh_get_usb_first(USPI_UBH);
 
-       inode->i_sb = sb;
-       inode->i_flags = 0;
-       
        lock_super (sb);
 
        *err = -ENOSPC;
@@ -261,9 +258,6 @@ cg_found:
        sb->s_dirt = 1;
 
        inode->i_mode = mode;
-       inode->i_sb = sb;
-       inode->i_nlink = 1;
-       inode->i_dev = sb->s_dev;
        inode->i_uid = current->fsuid;
        if (dir->i_mode & S_ISGID) {
                inode->i_gid = dir->i_gid;
index 5b52abdfe07c2553f461e4648b89dc213141214b..769a7cf36e89ce393dd6474005ad7a0ace0afb95 100644 (file)
@@ -79,22 +79,14 @@ extern struct cpuinfo_x86 cpu_data[];
 #define current_cpu_data boot_cpu_data
 #endif
 
-#define cpu_has_pge \
-               (test_bit(X86_FEATURE_PGE,  &boot_cpu_data.x86_capability))
-#define cpu_has_pse \
-               (test_bit(X86_FEATURE_PSE,  &boot_cpu_data.x86_capability))
-#define cpu_has_pae \
-               (test_bit(X86_FEATURE_PAE,  &boot_cpu_data.x86_capability))
-#define cpu_has_tsc \
-               (test_bit(X86_FEATURE_TSC,  &boot_cpu_data.x86_capability))
-#define cpu_has_de \
-               (test_bit(X86_FEATURE_DE,   &boot_cpu_data.x86_capability))
-#define cpu_has_vme \
-               (test_bit(X86_FEATURE_VME,  &boot_cpu_data.x86_capability))
-#define cpu_has_fxsr \
-               (test_bit(X86_FEATURE_FXSR, &boot_cpu_data.x86_capability))
-#define cpu_has_xmm \
-               (test_bit(X86_FEATURE_XMM,  &boot_cpu_data.x86_capability))
+#define cpu_has_pge    (test_bit(X86_FEATURE_PGE,  boot_cpu_data.x86_capability))
+#define cpu_has_pse    (test_bit(X86_FEATURE_PSE,  boot_cpu_data.x86_capability))
+#define cpu_has_pae    (test_bit(X86_FEATURE_PAE,  boot_cpu_data.x86_capability))
+#define cpu_has_tsc    (test_bit(X86_FEATURE_TSC,  boot_cpu_data.x86_capability))
+#define cpu_has_de     (test_bit(X86_FEATURE_DE,   boot_cpu_data.x86_capability))
+#define cpu_has_vme    (test_bit(X86_FEATURE_VME,  boot_cpu_data.x86_capability))
+#define cpu_has_fxsr   (test_bit(X86_FEATURE_FXSR, boot_cpu_data.x86_capability))
+#define cpu_has_xmm    (test_bit(X86_FEATURE_XMM,  boot_cpu_data.x86_capability))
 
 extern char ignore_irq13;
 
@@ -473,4 +465,10 @@ struct microcode {
 
 #define MICROCODE_IOCFREE      _IO('6',0) /* because it is for P6 */
 
+/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
+extern inline void rep_nop(void)
+{
+       __asm__ __volatile__("rep;nop");
+}
+
 #endif /* __ASM_I386_PROCESSOR_H */
index 0452a749a3ba96560550bff1d1f9db38f952656f..99df46b37a29e4e2f25a9c2671b98ccf485dac2d 100644 (file)
@@ -45,6 +45,7 @@ enum chipset_type {
        INTEL_BX,
        INTEL_GX,
        INTEL_I810,
+       INTEL_I815,
        INTEL_I840,
        VIA_GENERIC,
        VIA_VP3,
index 6e31a8cd2cf981fca9413baf588078946d68976c..4701868040c745525326a605d39ffe799f4801b3 100644 (file)
@@ -1149,6 +1149,15 @@ static inline struct inode *iget(struct super_block *sb, unsigned long ino)
 
 extern void clear_inode(struct inode *);
 extern struct inode * get_empty_inode(void);
+static inline struct inode * new_inode(struct super_block *sb)
+{
+       struct inode *inode = get_empty_inode();
+       if (inode) {
+               inode->i_sb = sb;
+               inode->i_dev = sb->s_dev;
+       }
+       return inode;
+}
 
 extern void insert_inode_hash(struct inode *);
 extern void remove_inode_hash(struct inode *);
index 5f6572b22216638539d9152feb4620a7dd4da386..f6c35dc01d2f8acea7fc43ab81a93ba87711d235 100644 (file)
@@ -19,7 +19,7 @@
 /*
  * Valid flags for a dirty buffer
  */
-#define PG_BUSY                        0x0001
+#define PG_BUSY                        0
 
 struct nfs_page {
        struct list_head        wb_hash,        /* Inode */
@@ -38,7 +38,7 @@ struct nfs_page {
        struct nfs_writeverf    wb_verf;        /* Commit cookie */
 };
 
-#define NFS_WBACK_BUSY(req)    ((req)->wb_flags & PG_BUSY)
+#define NFS_WBACK_BUSY(req)    (test_bit(PG_BUSY,&(req)->wb_flags))
 
 extern struct nfs_page *nfs_create_request(struct file *file,
                                            struct page *page,
@@ -68,10 +68,9 @@ extern       spinlock_t nfs_wreq_lock;
 static __inline__ int
 nfs_lock_request(struct nfs_page *req)
 {
-       if (NFS_WBACK_BUSY(req))
+       if (test_and_set_bit(PG_BUSY, &req->wb_flags))
                return 0;
        req->wb_count++;
-       req->wb_flags |= PG_BUSY;
        return 1;
 }
 
@@ -80,10 +79,13 @@ nfs_unlock_request(struct nfs_page *req)
 {
        if (!NFS_WBACK_BUSY(req)) {
                printk(KERN_ERR "NFS: Invalid unlock attempted\n");
-               return;
+               BUG();
        }
-       req->wb_flags &= ~PG_BUSY;
-       wake_up(&req->wb_wait);
+       smp_mb__before_clear_bit();
+       clear_bit(PG_BUSY, &req->wb_flags);
+       smp_mb__after_clear_bit();
+       if (waitqueue_active(&req->wb_wait))
+               wake_up(&req->wb_wait);
        nfs_release_request(req);
 }
 
index 471a5325bde530a2a42cbe5009a73d325edc98c9..a24292180b64b320cafafe89626f464db6cbb1ff 100644 (file)
@@ -149,6 +149,8 @@ extern void update_one_process(struct task_struct *p, unsigned long user,
 extern signed long FASTCALL(schedule_timeout(signed long timeout));
 asmlinkage void schedule(void);
 
+extern void schedule_task(struct tq_struct *task);
+
 /*
  * The default fd array needs to be at least BITS_PER_LONG,
  * as this is the granularity returned by copy_fdset().
index 8b559703ab06c0e55b21bbc82763deda6e1fd59f..f3e9ad2be57cbeaf3aececce102e297c43ec5e19 100644 (file)
@@ -80,8 +80,7 @@ struct rpc_task {
        unsigned short          tk_lock;        /* Task lock counter */
        unsigned char           tk_active   : 1,/* Task has been activated */
                                tk_wakeup   : 1;/* Task waiting to wake up */
-       volatile unsigned char  tk_running  : 1,/* Task is running */
-                               tk_sleeping : 1;/* Task is truly asleep */
+       unsigned int            tk_runstate;    /* Task run status */
 #ifdef RPC_DEBUG
        unsigned short          tk_pid;         /* debugging aid */
 #endif
@@ -110,11 +109,26 @@ typedef void                      (*rpc_action)(struct rpc_task *);
 #define RPC_IS_SWAPPER(t)      ((t)->tk_flags & RPC_TASK_SWAPPER)
 #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS)
 #define RPC_ASSASSINATED(t)    ((t)->tk_flags & RPC_TASK_KILLED)
-#define RPC_IS_RUNNING(t)      ((t)->tk_running)
-#define RPC_IS_SLEEPING(t)     ((t)->tk_sleeping)
 #define RPC_IS_ACTIVATED(t)    ((t)->tk_active)
 #define RPC_DO_CALLBACK(t)     ((t)->tk_callback != NULL)
 
+#define RPC_TASK_SLEEPING      0
+#define RPC_TASK_RUNNING       1
+#define RPC_IS_SLEEPING(t)     (test_bit(RPC_TASK_SLEEPING, &(t)->tk_runstate))
+#define RPC_IS_RUNNING(t)      (test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate))
+
+#define rpc_set_running(t)     (set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate))
+#define rpc_clear_running(t)   (clear_bit(RPC_TASK_RUNNING, &(t)->tk_runstate))
+
+#define rpc_set_sleeping(t)    (set_bit(RPC_TASK_SLEEPING, &(t)->tk_runstate))
+
+#define rpc_clear_sleeping(t) \
+       do { \
+               smp_mb__before_clear_bit(); \
+               clear_bit(RPC_TASK_SLEEPING, &(t)->tk_runstate); \
+               smp_mb__after_clear_bit(); \
+       } while(0)
+
 /*
  * RPC synchronization objects
  */
index 25414d14466a634eb700f6a9119699c13dea7565..6b281ccad3f47be9ff167df45732d81b099f98a8 100644 (file)
@@ -142,6 +142,7 @@ static inline void init_waitqueue_entry(wait_queue_t *q,
        if (!q || !p)
                WQ_BUG();
 #endif
+       q->flags = 0;
        q->task = p;
 #if WAITQUEUE_DEBUG
        q->__magic = (long)&q->__magic;
index 6a9fd0494dd7bb971fc72f895ffc4bc4ccc993a4..3ed437693cf2533f31b25ef16d635fc1ac925b8f 100644 (file)
@@ -95,6 +95,7 @@ extern void sysctl_init(void);
 extern void signals_init(void);
 extern void bdev_init(void);
 extern int init_pcmcia_ds(void);
+extern void net_notifier_init(void);
 
 extern void free_initmem(void);
 extern void filesystem_setup(void);
@@ -710,6 +711,13 @@ static void __init do_basic_setup(void)
 #ifdef CONFIG_PCMCIA
        init_pcmcia_ds();               /* Do this last */
 #endif
+
+       /* do this after other 'do this last' stuff, because we want
+        * to minimize spurious executions of /sbin/hotplug
+        * during boot-up
+        */
+       net_notifier_init();
+
        /* Mount the root filesystem.. */
        mount_root();
 
index 08f07324377073209b76967624e7d8cb45f9cc02..8f4c218f332e47b7a1c95ed3085dd7a1ac342a38 100644 (file)
@@ -12,7 +12,7 @@ O_OBJS    = sched.o dma.o fork.o exec_domain.o panic.o printk.o \
            module.o exit.o itimer.o info.o time.o softirq.o resource.o \
            sysctl.o acct.o capability.o ptrace.o timer.o user.o
 
-OX_OBJS  += signal.o sys.o kmod.o
+OX_OBJS  += signal.o sys.o kmod.o context.o
 
 ifeq ($(CONFIG_UID16),y)
 O_OBJS += uid16.o
diff --git a/kernel/context.c b/kernel/context.c
new file mode 100644 (file)
index 0000000..b521978
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * linux/kernel/context.c
+ *
+ * Mechanism for running arbitrary tasks in process context
+ *
+ * dwmw2@redhat.com
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/init.h>
+
+static DECLARE_TASK_QUEUE(tq_context);
+static DECLARE_WAIT_QUEUE_HEAD(context_task_wq);
+
+void schedule_task(struct tq_struct *task)
+{
+       queue_task(task, &tq_context);
+       wake_up(&context_task_wq);
+}
+
+EXPORT_SYMBOL(schedule_task);
+
+static int context_thread(void *dummy)
+{
+       DECLARE_WAITQUEUE(wait, current);
+
+       daemonize();
+       strcpy(current->comm, "eventd");
+
+        spin_lock_irq(&current->sigmask_lock);
+        sigfillset(&current->blocked);
+        recalc_sigpending(current);
+        spin_unlock_irq(&current->sigmask_lock);
+
+       for (;;) {
+               current->state = TASK_INTERRUPTIBLE;
+               add_wait_queue(&context_task_wq, &wait);
+
+               /*
+                * Careful: we depend on the wait-queue modifications
+                * to also act as memory barriers.
+                */
+               if (!tq_context)
+                       schedule();
+
+               remove_wait_queue(&context_task_wq, &wait);
+               current->state = TASK_RUNNING;
+               run_task_queue(&tq_context);
+       }
+}
+
+static int __init start_context_thread(void)
+{
+       kernel_thread(context_thread, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+       return 0;
+}
+
+module_init(start_context_thread);
index 13519c5f06b5b0880633b33ca52ab0996985eb3d..d85c3494a810ad5dd01e83c1bb9ab5c5cfbc803a 100644 (file)
@@ -39,6 +39,7 @@ void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
        unsigned long flags;
 
        wq_write_lock_irqsave(&q->lock, flags);
+       wait->flags = 0;
        __add_wait_queue(q, wait);
        wq_write_unlock_irqrestore(&q->lock, flags);
 }
@@ -48,7 +49,7 @@ void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait)
        unsigned long flags;
 
        wq_write_lock_irqsave(&q->lock, flags);
-       wait->flags |= WQ_FLAG_EXCLUSIVE;
+       wait->flags = WQ_FLAG_EXCLUSIVE;
        __add_wait_queue_tail(q, wait);
        wq_write_unlock_irqrestore(&q->lock, flags);
 }
index 77dce464acf408ea7edde26b6968c1011eecb6a8..7655f4ddadfe51e731e2900d220e8225c69bf795 100644 (file)
@@ -136,7 +136,7 @@ char modprobe_path[256] = "/sbin/modprobe";
 static int exec_modprobe(void * module_name)
 {
        static char * envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
-       char *argv[] = { modprobe_path, "-s", "-k", (char*)module_name, NULL };
+       char *argv[] = { modprobe_path, "-s", "-k", "--", (char*)module_name, NULL };
        int ret;
 
        ret = exec_usermodehelper(modprobe_path, argv, envp);
index c5db140c8d0245cdba90de760079ddd111912381..07bebb3592aa4729baa9c82f0ac1e2f72bde903e 100644 (file)
@@ -116,6 +116,7 @@ EXPORT_SYMBOL(vmtruncate);
 EXPORT_SYMBOL(find_vma);
 EXPORT_SYMBOL(get_unmapped_area);
 EXPORT_SYMBOL(init_mm);
+EXPORT_SYMBOL(deactivate_page);
 #ifdef CONFIG_HIGHMEM
 EXPORT_SYMBOL(kmap_high);
 EXPORT_SYMBOL(kunmap_high);
index 25d5162b140b051354a4ae03b42045745c3be979..119edeb8134bf1d3d32226b815b37808003d6e97 100644 (file)
@@ -707,7 +707,7 @@ static inline void __wake_up_common (wait_queue_head_t *q, unsigned int mode,
        unsigned long flags;
        int best_cpu, irq;
 
-       if (!q || !waitqueue_active(q))
+       if (!q)
                goto out;
 
        best_cpu = smp_processor_id();
index dc7998fd1d6e012e1bda17e4404b2a22c126d4c5..0b3d64941196721ba29f9fcd61f628aa6bf51c8b 100644 (file)
@@ -50,6 +50,7 @@ static void sigd_put_skb(struct sk_buff *skb)
                }
                schedule();
        }
+       current->state = TASK_RUNNING;
        remove_wait_queue(&sigd_sleep,&wait);
 #else
        if (!sigd) {
index 7984cb22ab9b9f0bf103293d02a9c037be7e9f0c..e53826b98e501e8a0486d1bcaafb08abbe2e2763 100644 (file)
@@ -205,7 +205,6 @@ static int svc_connect(struct socket *sock,struct sockaddr *sockaddr,
                                        set_current_state(TASK_UNINTERRUPTIBLE);
                                        schedule();
                                }
-                       remove_wait_queue(&vcc->sleep,&wait);
                        clear_bit(ATM_VF_REGIS,&vcc->flags);
                        clear_bit(ATM_VF_RELEASED,&vcc->flags);
                        clear_bit(ATM_VF_CLOSE,&vcc->flags);
index 9c3066003d11fde6d15980d4524b41c30b52fd63..673638998c134023b2063bf850a11804486e83df 100644 (file)
@@ -2703,3 +2703,65 @@ int __init net_dev_init(void)
 
        return 0;
 }
+
+
+/* Notify userspace when a netdevice event occurs,
+ * by running '/sbin/hotplug net' with certain
+ * environment variables set.
+ *
+ * Currently reported events are listed in netdev_event_names[].
+ */
+
+/* /sbin/hotplug ONLY executes for events named here */
+static char *netdev_event_names[] = {
+       [NETDEV_REGISTER]       = "register",
+       [NETDEV_UNREGISTER]     = "unregister",
+};
+
+static int run_sbin_hotplug(struct notifier_block *this,
+                           unsigned long event, void *ptr)
+{
+       struct net_device *dev = (struct net_device *) ptr;
+       char *argv[3], *envp[5], ifname[12 + IFNAMSIZ], action[32];
+       int i;
+
+       if ((event >= ARRAY_SIZE(netdev_event_names)) ||
+           !netdev_event_names[event])
+               return NOTIFY_DONE;
+
+       sprintf(ifname, "INTERFACE=%s", dev->name);
+       sprintf(action, "ACTION=%s", netdev_event_names[event]);
+
+        i = 0;
+        argv[i++] = hotplug_path;
+        argv[i++] = "net";
+        argv[i] = 0;
+
+       i = 0;
+       /* minimal command environment */
+       envp [i++] = "HOME=/";
+       envp [i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
+       envp [i++] = ifname;
+       envp [i++] = action;
+       envp [i] = 0;
+       
+       call_usermodehelper (argv [0], argv, envp);
+
+       return NOTIFY_DONE;
+}
+
+static struct notifier_block sbin_hotplug = {
+       notifier_call: run_sbin_hotplug,
+};
+
+/*
+ * called from init/main.c, -after- all the initcalls are complete.
+ * Registers a hook that calls /sbin/hotplug on every netdev
+ * addition and removal.
+ */
+void __init net_notifier_init (void)
+{
+       if (register_netdevice_notifier(&sbin_hotplug))
+               printk (KERN_WARNING "unable to register netdev notifier\n"
+                       KERN_WARNING "/sbin/hotplug will not be run.\n");
+}
index 57d974051fabc69e874e18a2549225aa456cd8be..84ccd6575823ee928f223c89507af09e44e40a42 100644 (file)
@@ -117,17 +117,6 @@ echo 1 > /proc/sys/net/khttpd/start
 
    Port 8080
 
-   in /etc/apache/httpd.conf. For security-reasons, you can also change 
-   
-   BindAddress *
-
-   to
-
-   BindAddress 127.0.0.1
-
-   (in the same file) to prevent outside users from accessing Apache 
-   directly. 
-
 
    
    Stopping kHTTPd
index 45909a0cd0d1d0769d6822f473d03ee1ba0cc605..ae44b3a6e95a672cc03140bc7f1c611150bf0f80 100644 (file)
@@ -106,8 +106,7 @@ static int MainDaemon(void *cpu_pointer)
        CPUNR=(int)*(int*)cpu_pointer;
 
        sprintf(current->comm,"khttpd - %i",CPUNR);
-       lock_kernel();   /* This seems to be required for exit_mm */
-       exit_mm(current);
+       daemonize();
        
        init_waitqueue_head(&(DummyWQ[CPUNR]));
        
@@ -198,8 +197,7 @@ static int ManagementDaemon(void *unused)
        
        
        sprintf(current->comm,"khttpd manager");
-       lock_kernel();   /* This seems to be required for exit_mm */
-       exit_mm(current);
+       daemonize();
        
 
        /* Block all signals except SIGKILL and SIGSTOP */
index 58df6d92e60c47f4ab2ad8387e12db8235a40c82..8c33a03c41c9a4bd83273e3ad2baa7c97338aff0 100644 (file)
@@ -277,14 +277,12 @@ static struct super_operations sockfs_ops = {
 
 static struct super_block * sockfs_read_super(struct super_block *sb, void *data, int silent)
 {
-       struct inode *root = get_empty_inode();
+       struct inode *root = new_inode(sb);
        if (!root)
                return NULL;
        root->i_mode = S_IFDIR | S_IRUSR | S_IWUSR;
        root->i_uid = root->i_gid = 0;
        root->i_atime = root->i_mtime = root->i_ctime = CURRENT_TIME;
-       root->i_sb = sb;
-       root->i_dev = sb->s_dev;
        sb->s_blocksize = 1024;
        sb->s_blocksize_bits = 10;
        sb->s_magic = SOCKFS_MAGIC;
index de359d2f53c86329e6215db092f4aeb09aa0a605..9eee6afe219692ae6dfd4efcebe2516bc81397a9 100644 (file)
@@ -257,7 +257,7 @@ rpc_make_runnable(struct rpc_task *task)
                printk(KERN_ERR "RPC: task w/ running timer in rpc_make_runnable!!\n");
                return;
        }
-       task->tk_running = 1;
+       rpc_set_running(task);
        if (RPC_IS_ASYNC(task)) {
                if (RPC_IS_SLEEPING(task)) {
                        int status;
@@ -265,13 +265,14 @@ rpc_make_runnable(struct rpc_task *task)
                        if (status < 0) {
                                printk(KERN_WARNING "RPC: failed to add task to queue: error: %d!\n", status);
                                task->tk_status = status;
-                       } else
-                               task->tk_sleeping = 0;
+                               return;
+                       }
+                       rpc_clear_sleeping(task);
+                       if (waitqueue_active(&rpciod_idle))
+                               wake_up(&rpciod_idle);
                }
-               if (waitqueue_active(&rpciod_idle))
-                       wake_up(&rpciod_idle);
        } else {
-               task->tk_sleeping = 0;
+               rpc_clear_sleeping(task);
                if (waitqueue_active(&task->tk_wait))
                        wake_up(&task->tk_wait);
        }
@@ -287,7 +288,7 @@ rpc_schedule_run(struct rpc_task *task)
        if (RPC_IS_ACTIVATED(task))
                return;
        task->tk_active = 1;
-       task->tk_sleeping = 1;
+       rpc_set_sleeping(task);
        rpc_make_runnable(task);
 }
 
@@ -326,7 +327,7 @@ __rpc_sleep_on(struct rpc_wait_queue *q, struct rpc_task *task,
        /* Mark the task as being activated if so needed */
        if (!RPC_IS_ACTIVATED(task)) {
                task->tk_active = 1;
-               task->tk_sleeping = 1;
+               rpc_set_sleeping(task);
        }
 
        status = __rpc_add_wait_queue(q, task);
@@ -334,7 +335,7 @@ __rpc_sleep_on(struct rpc_wait_queue *q, struct rpc_task *task,
                printk(KERN_WARNING "RPC: failed to add task to queue: error: %d!\n", status);
                task->tk_status = status;
        } else {
-               task->tk_running = 0;
+               rpc_clear_running(task);
                if (task->tk_callback) {
                        dprintk(KERN_ERR "RPC: %4d overwrites an active callback\n", task->tk_pid);
                        BUG();
@@ -590,21 +591,15 @@ __rpc_execute(struct rpc_task *task)
 
                /*
                 * Check whether task is sleeping.
-                * Note that if the task goes to sleep in tk_action,
-                * and the RPC reply arrives before we get here, it will
-                * have state RUNNING, but will still be on schedq.
-                * 27/9/99: The above has been attempted fixed by
-                *          introduction of task->tk_sleeping.
                 */
                spin_lock_bh(&rpc_queue_lock);
                if (!RPC_IS_RUNNING(task)) {
-                       task->tk_sleeping = 1;
+                       rpc_set_sleeping(task);
                        if (RPC_IS_ASYNC(task)) {
                                spin_unlock_bh(&rpc_queue_lock);
                                return 0;
                        }
-               } else
-                       task->tk_sleeping = 0;
+               }
                spin_unlock_bh(&rpc_queue_lock);
 
                while (RPC_IS_SLEEPING(task)) {
@@ -684,7 +679,7 @@ rpc_execute(struct rpc_task *task)
        }
 
        task->tk_active = 1;
-       task->tk_running = 1;
+       rpc_set_running(task);
        return __rpc_execute(task);
  out_release:
        rpc_release_task(task);