]> git.neil.brown.name Git - history.git/commitdiff
v2.4.2 -> v2.4.2.1
authorLinus Torvalds <torvalds@athlon.transmeta.com>
Tue, 5 Feb 2002 02:00:07 +0000 (18:00 -0800)
committerLinus Torvalds <torvalds@athlon.transmeta.com>
Tue, 5 Feb 2002 02:00:07 +0000 (18:00 -0800)
  - Chris Mason: reiserfs, another null bytes bug
  - Andrea Arkangeli: make SMP Athlon build
  - Alexander Zarochentcev: reiserfs directory fsync SMP locking fix
  - Jeff Garzik: PCI network driver updates
  - Alan Cox: continue merging
  - Ingo Molnar: fix RAID AUTORUN ioctl, scheduling improvements

362 files changed:
CREDITS
Documentation/arm/SA1100/Brutus
Documentation/isdn/INTERFACE
Documentation/isdn/README.eicon
Documentation/isdn/README.hysdn
Documentation/kernel-parameters.txt
Documentation/networking/8139too.txt
Documentation/networking/tulip.txt
Documentation/s390/cds.txt
Makefile
arch/alpha/kernel/alpha_ksyms.c
arch/alpha/kernel/console.c
arch/alpha/kernel/core_apecs.c
arch/alpha/kernel/core_cia.c
arch/alpha/kernel/core_irongate.c
arch/alpha/kernel/core_lca.c
arch/alpha/kernel/core_mcpcia.c
arch/alpha/kernel/core_polaris.c
arch/alpha/kernel/core_t2.c
arch/alpha/kernel/core_titan.c
arch/alpha/kernel/core_tsunami.c
arch/alpha/kernel/core_wildfire.c
arch/alpha/kernel/pci-noop.c
arch/alpha/kernel/pci.c
arch/alpha/kernel/pci_impl.h
arch/alpha/kernel/pci_iommu.c
arch/alpha/kernel/proto.h
arch/alpha/kernel/setup.c
arch/alpha/kernel/sys_dp264.c
arch/alpha/kernel/sys_eiger.c
arch/alpha/kernel/sys_jensen.c
arch/alpha/kernel/sys_rawhide.c
arch/alpha/kernel/sys_titan.c
arch/alpha/kernel/sys_wildfire.c
arch/arm/mach-sa1100/arch.c
arch/arm/mm/mm-sa1100.c
arch/i386/boot/Makefile
arch/i386/defconfig
arch/i386/kernel/i386_ksyms.c
arch/i386/kernel/i387.c
arch/i386/kernel/traps.c
arch/i386/lib/mmx.c
arch/i386/mm/extable.c
arch/mips/kernel/mips_ksyms.c
arch/mips64/kernel/mips64_ksyms.c
arch/s390/kernel/entry.S
arch/s390/tools/dasdfmt/dasdfmt.c
arch/s390x/kernel/entry.S
arch/s390x/tools/dasdfmt/dasdfmt.c
arch/sh/kernel/sh_ksyms.c
drivers/char/i810_rng.c
drivers/char/istallion.c
drivers/char/mxser.c
drivers/char/stallion.c
drivers/ieee1394/csr.c
drivers/ieee1394/csr.h
drivers/ieee1394/guid.c
drivers/ieee1394/guid.h
drivers/ieee1394/ieee1394_core.c
drivers/isdn/Config.in
drivers/isdn/Makefile
drivers/isdn/act2000/act2000.h
drivers/isdn/act2000/capi.c
drivers/isdn/act2000/capi.h
drivers/isdn/act2000/module.c
drivers/isdn/avmb1/avm_cs.c
drivers/isdn/avmb1/b1.c
drivers/isdn/avmb1/b1dma.c
drivers/isdn/avmb1/b1isa.c
drivers/isdn/avmb1/b1pcmcia.c
drivers/isdn/avmb1/c4.c
drivers/isdn/avmb1/capi.c
drivers/isdn/avmb1/capidrv.c
drivers/isdn/avmb1/capifs.c
drivers/isdn/avmb1/capiutil.c
drivers/isdn/avmb1/kcapi.c
drivers/isdn/avmb1/t1isa.c
drivers/isdn/avmb1/t1pci.c
drivers/isdn/divert/divert_init.c
drivers/isdn/divert/isdn_divert.c
drivers/isdn/eicon/Divas_mod.c
drivers/isdn/eicon/Makefile
drivers/isdn/eicon/adapter.h
drivers/isdn/eicon/bri.c
drivers/isdn/eicon/common.c
drivers/isdn/eicon/constant.h
drivers/isdn/eicon/divalog.h
drivers/isdn/eicon/divas.h
drivers/isdn/eicon/dsp_defs.h
drivers/isdn/eicon/dspdids.h
drivers/isdn/eicon/eicon.h
drivers/isdn/eicon/eicon_idi.c
drivers/isdn/eicon/eicon_io.c
drivers/isdn/eicon/eicon_mod.c
drivers/isdn/eicon/eicon_pci.c
drivers/isdn/eicon/fcheck.c [deleted file]
drivers/isdn/eicon/fourbri.c
drivers/isdn/eicon/fpga.c
drivers/isdn/eicon/idi.c
drivers/isdn/eicon/idi.h
drivers/isdn/eicon/kprintf.c
drivers/isdn/eicon/lincfg.c
drivers/isdn/eicon/linchr.c
drivers/isdn/eicon/linio.c
drivers/isdn/eicon/linsys.c
drivers/isdn/eicon/log.c
drivers/isdn/eicon/md5sums.asc [deleted file]
drivers/isdn/eicon/pc.h
drivers/isdn/eicon/pc_maint.h
drivers/isdn/eicon/pr_pc.h
drivers/isdn/eicon/pri.c
drivers/isdn/eicon/sys.h
drivers/isdn/eicon/uxio.h
drivers/isdn/eicon/xlog.c
drivers/isdn/hisax/Makefile
drivers/isdn/hisax/amd7930.c
drivers/isdn/hisax/arcofi.c
drivers/isdn/hisax/arcofi.h
drivers/isdn/hisax/asuscom.c
drivers/isdn/hisax/avm_a1.c
drivers/isdn/hisax/avm_a1p.c
drivers/isdn/hisax/avm_pci.c
drivers/isdn/hisax/bkm_a4t.c
drivers/isdn/hisax/bkm_a8.c
drivers/isdn/hisax/callc.c
drivers/isdn/hisax/cert.c
drivers/isdn/hisax/config.c
drivers/isdn/hisax/diva.c
drivers/isdn/hisax/elsa.c
drivers/isdn/hisax/elsa_ser.c
drivers/isdn/hisax/fsm.c
drivers/isdn/hisax/gazel.c
drivers/isdn/hisax/hfc_2bds0.c
drivers/isdn/hisax/hfc_2bds0.h
drivers/isdn/hisax/hfc_2bs0.c
drivers/isdn/hisax/hfc_2bs0.h
drivers/isdn/hisax/hfc_pci.c
drivers/isdn/hisax/hfcscard.c
drivers/isdn/hisax/hisax.h
drivers/isdn/hisax/hscx.c
drivers/isdn/hisax/hscx.h
drivers/isdn/hisax/hscx_irq.c
drivers/isdn/hisax/icc.c
drivers/isdn/hisax/icc.h
drivers/isdn/hisax/ipac.h
drivers/isdn/hisax/isac.c
drivers/isdn/hisax/isac.h
drivers/isdn/hisax/isar.c
drivers/isdn/hisax/isar.h
drivers/isdn/hisax/isdnl1.c
drivers/isdn/hisax/isdnl1.h
drivers/isdn/hisax/isdnl2.c
drivers/isdn/hisax/isdnl2.h
drivers/isdn/hisax/isdnl3.c
drivers/isdn/hisax/isdnl3.h
drivers/isdn/hisax/isurf.c
drivers/isdn/hisax/ix1_micro.c
drivers/isdn/hisax/jade.c
drivers/isdn/hisax/jade.h
drivers/isdn/hisax/jade_irq.c
drivers/isdn/hisax/l3_1tr6.c
drivers/isdn/hisax/l3_1tr6.h
drivers/isdn/hisax/l3dss1.c
drivers/isdn/hisax/l3dss1.h
drivers/isdn/hisax/l3ni1.c
drivers/isdn/hisax/l3ni1.h
drivers/isdn/hisax/lmgr.c
drivers/isdn/hisax/mic.c
drivers/isdn/hisax/netjet.c
drivers/isdn/hisax/netjet.h
drivers/isdn/hisax/niccy.c
drivers/isdn/hisax/nj_s.c
drivers/isdn/hisax/nj_u.c
drivers/isdn/hisax/q931.c
drivers/isdn/hisax/rawhdlc.c
drivers/isdn/hisax/rawhdlc.h
drivers/isdn/hisax/s0box.c
drivers/isdn/hisax/saphir.c
drivers/isdn/hisax/sedlbauer.c
drivers/isdn/hisax/sedlbauer_cs.c [new file with mode: 0644]
drivers/isdn/hisax/sportster.c
drivers/isdn/hisax/tei.c
drivers/isdn/hisax/teleint.c
drivers/isdn/hisax/teles0.c
drivers/isdn/hisax/teles3.c
drivers/isdn/hisax/telespci.c
drivers/isdn/hisax/w6692.c
drivers/isdn/hisax/w6692.h
drivers/isdn/hysdn/boardergo.c
drivers/isdn/hysdn/hycapi.c
drivers/isdn/hysdn/hysdn_boot.c
drivers/isdn/hysdn/hysdn_init.c
drivers/isdn/hysdn/hysdn_net.c
drivers/isdn/hysdn/hysdn_procconf.c
drivers/isdn/hysdn/hysdn_procfs.c
drivers/isdn/hysdn/hysdn_sched.c
drivers/isdn/icn/icn.c
drivers/isdn/icn/icn.h
drivers/isdn/isdn_bsdcomp.c
drivers/isdn/isdn_cards.c [deleted file]
drivers/isdn/isdn_cards.h [deleted file]
drivers/isdn/isdn_common.c
drivers/isdn/isdn_tty.c
drivers/isdn/isdn_v110.c
drivers/isdn/isdnloop/isdnloop.c
drivers/isdn/isdnloop/isdnloop.h
drivers/isdn/pcbit/callbacks.c
drivers/isdn/pcbit/callbacks.h
drivers/isdn/pcbit/capi.c
drivers/isdn/pcbit/capi.h
drivers/isdn/pcbit/drv.c
drivers/isdn/pcbit/edss1.c
drivers/isdn/pcbit/edss1.h
drivers/isdn/pcbit/layer2.c
drivers/isdn/pcbit/layer2.h
drivers/isdn/pcbit/module.c
drivers/isdn/pcbit/pcbit.h
drivers/isdn/sc/init.c
drivers/isdn/sc/interrupt.c
drivers/md/md.c
drivers/media/radio/Config.in
drivers/media/radio/Makefile
drivers/media/radio/radio-aimslab.c
drivers/media/radio/radio-aztech.c
drivers/media/radio/radio-cadet.c
drivers/media/radio/radio-gemtek.c
drivers/media/radio/radio-maestro.c
drivers/media/radio/radio-maxiradio.c [new file with mode: 0644]
drivers/media/radio/radio-miropcm20.c
drivers/media/radio/radio-rtrack2.c
drivers/media/radio/radio-sf16fmi.c
drivers/media/radio/radio-terratec.c
drivers/media/radio/radio-trust.c
drivers/media/radio/radio-typhoon.c
drivers/media/radio/radio-zoltrix.c
drivers/media/video/bttv-driver.c
drivers/media/video/bw-qcam.c
drivers/media/video/c-qcam.c
drivers/media/video/cpia.c
drivers/media/video/cpia.h
drivers/media/video/cpia_pp.c
drivers/media/video/planb.c
drivers/media/video/pms.c
drivers/media/video/stradis.c
drivers/media/video/videodev.c
drivers/media/video/vino.c
drivers/media/video/zr36120.c
drivers/net/8139too.c
drivers/net/Config.in
drivers/net/Makefile
drivers/net/defxx.c
drivers/net/epic100.c
drivers/net/net_init.c
drivers/net/pcmcia/3c574_cs.c
drivers/net/pcmcia/3c589_cs.c
drivers/net/pcmcia/fmvj18x_cs.c
drivers/net/pcmcia/i82593.h
drivers/net/pcmcia/netwave_cs.c
drivers/net/pcmcia/nmclan_cs.c
drivers/net/pcmcia/pcnet_cs.c
drivers/net/pcmcia/ray_cs.c
drivers/net/pcmcia/smc91c92_cs.c
drivers/net/pcmcia/wavelan.h
drivers/net/pcmcia/wavelan_cs.c
drivers/net/pcmcia/wavelan_cs.h
drivers/net/pcmcia/xirc2ps_cs.c
drivers/net/rcpci45.c
drivers/net/rtl8129.c [deleted file]
drivers/net/sis900.c
drivers/net/sundance.c
drivers/net/tulip/ChangeLog
drivers/net/tulip/interrupt.c
drivers/net/tulip/media.c
drivers/net/tulip/pnic.c
drivers/net/tulip/tulip.h
drivers/net/tulip/tulip_core.c
drivers/net/via-rhine.c
drivers/net/yellowfin.c
drivers/pci/pci.c
drivers/s390/char/tape34xx.c
drivers/s390/net/ctc.c
drivers/s390/s390mach.c
drivers/scsi/3w-xxxx.c
drivers/scsi/3w-xxxx.h
drivers/scsi/NCR53c406a.c
drivers/scsi/dmx3191d.c
drivers/sound/awe_wave.c
drivers/sound/maestro.c
drivers/sound/via82cxxx_audio.c
drivers/sound/wavfront.c
drivers/sound/ymfpci.c
fs/adfs/super.c
fs/affs/super.c
fs/bfs/inode.c
fs/coda/inode.c
fs/cramfs/inode.c
fs/efs/super.c
fs/hfs/super.c
fs/hpfs/super.c
fs/isofs/inode.c
fs/jffs/inode-v23.c
fs/minix/inode.c
fs/ncpfs/inode.c
fs/nfs/inode.c
fs/proc/inode.c
fs/qnx4/inode.c
fs/reiserfs/dir.c
fs/reiserfs/inode.c
fs/reiserfs/stree.c
fs/reiserfs/super.c
fs/reiserfs/tail_conversion.c
fs/romfs/inode.c
fs/smbfs/inode.c
fs/sysv/inode.c
fs/udf/super.c
fs/ufs/super.c
include/asm-alpha/io.h
include/asm-alpha/machvec.h
include/asm-alpha/pci.h
include/asm-alpha/semaphore.h
include/asm-alpha/smp.h
include/asm-arm/arch-sa1100/irq.h
include/asm-i386/string-486.h
include/asm-i386/string.h
include/asm-mips64/smp.h
include/asm-s390/ccwcache.h
include/asm-s390/lowcore.h
include/asm-s390x/ccwcache.h
include/asm-s390x/dasd.h
include/asm-s390x/lowcore.h
include/asm-s390x/socket.h
include/asm-s390x/unistd.h
include/asm-sparc/smp.h
include/asm-sparc64/smp.h
include/linux/fs.h
include/linux/genhd.h
include/linux/netdevice.h
include/linux/pci.h
include/linux/videodev.h
include/pcmcia/ciscode.h
kernel/sched.c
mm/slab.c
net/core/dev.c
net/ethernet/eth.c
net/irda/af_irda.c
net/irda/ircomm/ircomm_core.c
net/irda/ircomm/ircomm_event.c
net/irda/ircomm/ircomm_lmp.c
net/irda/ircomm/ircomm_ttp.c
net/irda/ircomm/ircomm_tty.c
net/irda/irias_object.c
net/irda/irlan/irlan_provider.c
net/irda/irlap.c
net/irda/irlap_comp.c
net/irda/irlap_event.c
net/irda/irlmp.c
net/irda/irlmp_frame.c
net/irda/irnet/Config.in
net/irda/irnet/irnet.h
net/irda/irnet/irnet_irda.c
scripts/mkdep.c
scripts/ver_linux

diff --git a/CREDITS b/CREDITS
index cec38aa95fa1fedf8b559d4bbfe92da24791f220..418f653ee7e17187f55eb8c7f606951cbb391892 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -316,8 +316,8 @@ S: Marrickville NSW 2204
 S: Australia
 
 N: Hugh Blemings
-E: hugh@linuxcare.com
-W: http://www.linuxcare.com.au/hugh/
+E: hugh@misc.nu
+W: http://misc.nu/hugh/
 D: Author and maintainer of the Keyspan USB to Serial drivers
 S: Po Box 234
 S: Belconnen ACT 2616
index d5dc916e38257dbf5da0668b5cfe1fe70f5be615..98373152fc511223dab99e712a3c3767f996c131 100644 (file)
@@ -3,7 +3,7 @@ For more details, see:
 
 http://developer.intel.com/design/strong/applnots/sa1100lx/getstart.htm
 
-To compile for Brutus, you must issue the following comands:
+To compile for Brutus, you must issue the following commands:
 
        make brutus_config
        make config
index a82ffcc1cb7f8bdeb6042bea71b92b7ed6515592..06d50a9d5afa0d2420d764755d3392799ca91a36 100644 (file)
@@ -1,4 +1,4 @@
-$Id: INTERFACE,v 1.15 1999/08/25 20:02:13 werner Exp $
+$Id: INTERFACE,v 1.15.8.1 2001/02/16 16:43:22 kai Exp $
 
 Description of the Interface between Linklevel and Hardwarelevel
   of isdn4linux:
index 16dd09eb9e1c8d7d2c868e369c0607d3c57937f2..2e36d442b3d3705ee263e99ca82844bb254d3961 100644 (file)
@@ -100,17 +100,6 @@ Just use "eiconctrl isdnlog on" and the driver will generate
 the necessary D-Channel traces for isdnlog.
 
 
-FILECHECK:
-A part of the eicon driver source code files are provided
-by Eicon Technology. In order to get the best support from Eicon,
-these files are tested with a checksum, just to know if the files
-were modified. This does *not* mean, you are not allowed to modify the
-driver. If you want to improve the driver or you fix a bug, please do
-so and let me (or Eicon) know, about the necessary changes. So
-every user knows, if the driver he uses is modified or checked with
-Eicon files. When the driver has been loaded, in the syslog you will
-find something like "verified" or "modified" right after the version.
-
 
 Thanks to 
        Deutsche Mailbox Saar-Lor-Lux GmbH
index f8ce775d6f6158a1c108c784ae23daa16538ed55..94e9f902b999118b4b4831f826a766f4e4b3accd 100644 (file)
@@ -1,4 +1,4 @@
-$Id: README.hysdn,v 1.3 2000/08/06 09:22:51 armin Exp $
+$Id: README.hysdn,v 1.3.6.1 2001/02/10 14:41:19 kai Exp $
 The hysdn driver has been written by
 by Werner Cornelius (werner@isdn4linux.de or werner@titro.de) 
 for Hypercope GmbH Aachen Germany. Hypercope agreed to publish this driver
index e1f608b84aa4e70e8fb39126b7c3cbad2393c575..63b0cf96a150bcd037987bdbfd303e5804bc93c4 100644 (file)
@@ -188,8 +188,10 @@ running once the system is up.
 
        es1371=         [HW,SOUND]
  
-       ether=          [HW,NET] Ethernet cards parameters (iomem, irq,
-                       dev_name).
+       ether=          [HW,NET] Ethernet cards parameters (irq,
+                       base_io_addr, mem_start, mem_end, name.
+                       (mem_start is often overloaded to mean something
+                       different and driver-specific).
 
        fd_mcs=         [HW,SCSI]
 
@@ -328,7 +330,11 @@ running once the system is up.
 
        ncr53c8xx=      [HW,SCSI]
 
-       netdev=         [NET]
+       netdev=         [NET] Ethernet cards parameters (irq,
+                       base_io_addr, mem_start, mem_end, name.
+                       (mem_start is often overloaded to mean something
+                       different and driver-specific).
+                       (cf: ether=)
  
        nfsaddrs=       [NFS]
 
index 4a045bc480fb08a91e1ee97bfa456382fa56c01a..bf5c17736342942bac461f140addb0ee8474ff41 100644 (file)
@@ -180,6 +180,52 @@ suggestions welcome)  (WIP)
 Change History
 --------------
 
+Version 0.9.15 - February 20, 2001
+
+* Call pci_enable_device to wake up/assign resource to device,
+  before actually using it.
+* Support wacky clone PCI ids (report from Norival Toniato Junior)
+* Text spelling corrections
+* Make sure tp->phys[] is signed
+* Always wake queue after hw restart, in tx_timeout
+* Record time of last received packet
+
+
+Version 0.9.14 - January 11, 2001
+
+* Merge some changes from Becker version 1.13:
+       * Add DFE 538TX PCI id
+       * MII read/write functions updated
+       * Cfg93[45]6 lock/unlock fix
+       * RTL-8129 (MII) support
+* Clean up spinlocking
+
+
+Version 0.9.13 - December, 2000
+
+* Clear blocked signals, avoid buffer overrun setting current->comm
+* Remove bogus PCI BAR length assertions
+* Remove unused 'debug' module parameter
+
+
+Version 0.9.12 - November 23, 2000
+
+* Kill major Tx stop/wake queue race
+* Use SET_MODULE_OWNER and fix module unload race
+* Fix cable length ("Twister") tuning
+* Proper media[] array length checking
+* Replace timer with kernel thread for twister tuning state machine
+  and media checking.  Fixes mdio_xxx locking, now mdio_xxx is always
+  protected by rtnl_lock semaphore.
+* Correct some sledgehammer a.k.a. overzealous spin-locks
+* Performance: Eliminate atomic_t for Tx counters, we don't need it
+* Performance: Don't copy Tx buffer if the rare case occurs where it
+  is aligned perfectly for us.
+* Eliminate needless casting of dev->priv
+* PIO mode selection and Twister tuning are now CONFIG_xxx options
+  (though purposefully not in net/Config.in... yet)
+
+
 Version 0.9.11 - October 28, 2000
 
 * Do not fail when PIO and MMIO region lengths do not match.
index bd104e11d840ceb0432b69c46229931c622a347e..39c51e92e956328132fc2f5053faecb8d169dd54 100644 (file)
@@ -148,6 +148,17 @@ tulip_core.c       - Driver core (a.k.a. where "everything else" goes)
 
 Version history
 ===============
+0.9.14 (February 20, 2000):
+* Fix PNIC problems (Manfred Spraul)
+* Add new PCI id for Accton comet
+* Support Davicom tulips
+* Fix oops in eeprom parsing
+* Enable workarounds for early PCI chipsets
+* IA64, hppa csr0 support
+* Support media types 5, 6
+* Interpret a bit more of the 21142 SROM extended media type 3
+* Add missing delay in eeprom reading
+
 0.9.11 (November 3, 2000):
 * Eliminate extra bus accesses when sharing interrupts (prumpf)
 * Barrier following ownership descriptor bit flip (prumpf)
index 746f36dd0cbc0d1771800ad7f82d879602cf869c..c5261a7748900de35a2673e29310af2ef285f98a 100644 (file)
@@ -241,7 +241,7 @@ The device driver may use these commands as appropriate.
 
 The get_dev_info_by_irq() / get_dev_info_by_devno() functions return:
 
-      0 - sucessful completion
+      0 - successful completion
 -ENODEV - irq or devno don't specify a known subchannel or device
           number.
 -EINVAL - invalid devinfo value.
@@ -317,7 +317,7 @@ The read_dev_chars() function returns :
       0 - successful completion
 -ENODEV - irq doesn't specify a valid subchannel number
 -EINVAL - an invalid parameter was detected
--EBUSY  - an irrecoverable I/O error occured or the device is not
+-EBUSY  - an irrecoverable I/O error occurred or the device is not
           operational.
 
 Usage Notes :
@@ -568,7 +568,7 @@ CCW_FLAG_SUSPEND   - suspend
 
 The do_IO() function returns :
 
-      0 - successful completion or request successfuly initiated
+      0 - successful completion or request successfully initiated
 -EBUSY  - the do_io() function was caled out of sequence. The
           device is currently processing a previous I/O request
 -ENODEV - irq doesn't specify a valid subchannel, the device is
@@ -777,7 +777,7 @@ flag    : 0 (zero) or DOIO_WAIT_FOR_INTERRUPT
 
 The halt_IO() function returns :
 
-      0 - successful completion or request successfuly initiated
+      0 - successful completion or request successfully initiated
 -EBUSY  - the device is currently performing a synchronous I/O
           operation : do_IO() with flag DOIO_WAIT_FOR_INTERRUPT
           or an error was encountered and the device is currently
index d602af7a5409967c74e4aad9da4f72d7fbe3e515..4b1bc8cf49fa38e96969fee3565bc6ede2304093 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
-SUBLEVEL = 2
-EXTRAVERSION =
+SUBLEVEL = 3
+EXTRAVERSION =-pre1
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
index d7bf13ec35847dad1ffdba186f651cb0c8790d51..997cc772ddc0c372e49d1e16622d0cdd7c72e502 100644 (file)
@@ -235,3 +235,4 @@ EXPORT_SYMBOL_NOVERS(memcpy);
 EXPORT_SYMBOL_NOVERS(memset);
 
 EXPORT_SYMBOL(get_wchan);
+EXPORT_SYMBOL(flush_tlb_page);
index b946ce0ed4aadc86bc09256a0a4ad30c4706bab2..254ab65d355cc81fc03d3248cecb39de4b556570 100644 (file)
@@ -21,8 +21,8 @@
 unsigned long __vga_hose_io_base = 0;  /* base for default hose */
 unsigned long __vga_hose_mem_base = 0; /* base for default hose */
 
-static struct pci_controler * __init 
-default_vga_hose_select(struct pci_controler *h1, struct pci_controler *h2)
+static struct pci_controller * __init 
+default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2)
 {
        if (h2->index < h1->index)
                return h2;
@@ -31,7 +31,7 @@ default_vga_hose_select(struct pci_controler *h1, struct pci_controler *h2)
 }
 
 void __init 
-set_vga_hose(struct pci_controler *hose)
+set_vga_hose(struct pci_controller *hose)
 {
        if (hose) {
                __vga_hose_io_base = hose->io_space->start;
@@ -42,7 +42,7 @@ set_vga_hose(struct pci_controler *hose)
 void __init 
 locate_and_init_vga(void *(*sel_func)(void *, void *))
 {
-       struct pci_controler *hose = NULL;
+       struct pci_controller *hose = NULL;
        struct pci_dev *dev = NULL;
 
        if (!sel_func) sel_func = (void *)default_vga_hose_select;
index 41143ff992ff91cc904786ff06325f09312da7fb..a44d941c0e3f4ca5355edd543e9d24a543359fbb 100644 (file)
@@ -357,7 +357,7 @@ struct pci_ops apecs_pci_ops =
 };
 \f
 void
-apecs_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end)
+apecs_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end)
 {
        wmb();
        *(vip)APECS_IOC_TBIA = 0;
@@ -367,13 +367,13 @@ apecs_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end)
 void __init
 apecs_init_arch(void)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
 
        /*
         * Create our single hose.
         */
 
-       pci_isa_hose = hose = alloc_pci_controler();
+       pci_isa_hose = hose = alloc_pci_controller();
        hose->io_space = &ioport_resource;
        hose->mem_space = &iomem_resource;
        hose->index = 0;
index 6203b02476803664d1fa676a9355aa1268e23928..e2d957c981a19a327683f9ec44fcb6af7e438427 100644 (file)
@@ -299,7 +299,7 @@ struct pci_ops cia_pci_ops =
  */
 
 void
-cia_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end)
+cia_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end)
 {
        wmb();
        *(vip)CIA_IOC_PCI_TBIA = 3;     /* Flush all locked and unlocked.  */
@@ -314,7 +314,7 @@ cia_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end)
  */
 
 static void
-cia_pci_tbi_try1(struct pci_controler *hose,
+cia_pci_tbi_try1(struct pci_controller *hose,
                 dma_addr_t start, dma_addr_t end)
 {
        wmb();
@@ -359,7 +359,7 @@ cia_enable_broken_tbi_try2(void)
 }
 
 static void
-cia_pci_tbi_try2(struct pci_controler *hose,
+cia_pci_tbi_try2(struct pci_controller *hose,
                 dma_addr_t start, dma_addr_t end)
 {
        unsigned long flags;
@@ -595,7 +595,7 @@ failed:
 static void __init
 do_init_arch(int is_pyxis)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
        int temp;
        int cia_rev;
 
@@ -628,7 +628,7 @@ do_init_arch(int is_pyxis)
        *(vip)CIA_IOC_HAE_IO = 0;
 
        /* For PYXIS, we always use BWX bus and i/o accesses.  To that end,
-          make sure they're enabled on the controler.  */
+          make sure they're enabled on the controller.  */
        if (is_pyxis) {
                temp = *(vip)CIA_IOC_CIA_CNFG;
                temp |= CIA_CNFG_IOA_BWEN;
@@ -643,7 +643,7 @@ do_init_arch(int is_pyxis)
         * Create our single hose.
         */
 
-       pci_isa_hose = hose = alloc_pci_controler();
+       pci_isa_hose = hose = alloc_pci_controller();
        hose->io_space = &ioport_resource;
        hose->mem_space = &iomem_resource;
        hose->index = 0;
index 03034874782f93a12e5fece8ea820d4183fad994..709e8bab2fefd0c54bfd64cc305c218fae5dc31b 100644 (file)
@@ -367,7 +367,7 @@ again:
 void __init
 irongate_init_arch(void)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
 
        IRONGATE0->stat_cmd = IRONGATE0->stat_cmd & ~0x100;
        irongate_pci_clr_err();
@@ -377,7 +377,7 @@ irongate_init_arch(void)
         * Create our single hose.
         */
 
-       pci_isa_hose = hose = alloc_pci_controler();
+       pci_isa_hose = hose = alloc_pci_controller();
        hose->io_space = &ioport_resource;
        hose->mem_space = &iomem_resource;
        hose->index = 0;
index 5329acfacae23fd53f4db6cae9f114bfabd8ea4d..28d743dd5bb6c72a15d4f7751063d663daeb3f85 100644 (file)
@@ -279,7 +279,7 @@ struct pci_ops lca_pci_ops =
 };
 \f
 void
-lca_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end)
+lca_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end)
 {
        wmb();
        *(vip)LCA_IOC_TBIA = 0;
@@ -289,13 +289,13 @@ lca_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end)
 void __init
 lca_init_arch(void)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
 
        /*
         * Create our single hose.
         */
 
-       pci_isa_hose = hose = alloc_pci_controler();
+       pci_isa_hose = hose = alloc_pci_controller();
        hose->io_space = &ioport_resource;
        hose->mem_space = &iomem_resource;
        hose->index = 0;
index f114ab24fee9408b31e9aef8d652813e66b0f47d..94eec6988225e0dce90c113f543bec102e3bc2d4 100644 (file)
@@ -89,7 +89,7 @@
 
 static unsigned int
 conf_read(unsigned long addr, unsigned char type1,
-         struct pci_controler *hose)
+         struct pci_controller *hose)
 {
        unsigned long flags;
        unsigned long mid = MCPCIA_HOSE2MID(hose->index);
@@ -137,7 +137,7 @@ conf_read(unsigned long addr, unsigned char type1,
 
 static void
 conf_write(unsigned long addr, unsigned int value, unsigned char type1,
-          struct pci_controler *hose)
+          struct pci_controller *hose)
 {
        unsigned long flags;
        unsigned long mid = MCPCIA_HOSE2MID(hose->index);
@@ -171,7 +171,7 @@ conf_write(unsigned long addr, unsigned int value, unsigned char type1,
 }
 
 static int
-mk_conf_addr(struct pci_dev *dev, int where, struct pci_controler *hose,
+mk_conf_addr(struct pci_dev *dev, int where, struct pci_controller *hose,
             unsigned long *pci_addr, unsigned char *type1)
 {
        u8 bus = dev->bus->number;
@@ -199,7 +199,7 @@ mk_conf_addr(struct pci_dev *dev, int where, struct pci_controler *hose,
 static int
 mcpcia_read_config_byte(struct pci_dev *dev, int where, u8 *value)
 {
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        unsigned long addr, w;
        unsigned char type1;
 
@@ -215,7 +215,7 @@ mcpcia_read_config_byte(struct pci_dev *dev, int where, u8 *value)
 static int
 mcpcia_read_config_word(struct pci_dev *dev, int where, u16 *value)
 {
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        unsigned long addr, w;
        unsigned char type1;
 
@@ -231,7 +231,7 @@ mcpcia_read_config_word(struct pci_dev *dev, int where, u16 *value)
 static int
 mcpcia_read_config_dword(struct pci_dev *dev, int where, u32 *value)
 {
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        unsigned long addr;
        unsigned char type1;
 
@@ -246,7 +246,7 @@ mcpcia_read_config_dword(struct pci_dev *dev, int where, u32 *value)
 static int
 mcpcia_write_config(struct pci_dev *dev, int where, u32 value, long mask)
 {
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        unsigned long addr;
        unsigned char type1;
 
@@ -288,7 +288,7 @@ struct pci_ops mcpcia_pci_ops =
 };
 \f
 void
-mcpcia_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end)
+mcpcia_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end)
 {
        wmb();
        *(vuip)MCPCIA_SG_TBIA(MCPCIA_HOSE2MID(hose->index)) = 0;
@@ -333,11 +333,11 @@ mcpcia_probe_hose(int h)
 static void __init
 mcpcia_new_hose(int h)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
        struct resource *io, *mem, *hae_mem;
        int mid = MCPCIA_HOSE2MID(h);
 
-       hose = alloc_pci_controler();
+       hose = alloc_pci_controller();
        if (h == 0)
                pci_isa_hose = hose;
        io = alloc_resource();
@@ -386,7 +386,7 @@ mcpcia_pci_clr_err(int mid)
 }
 
 static void __init
-mcpcia_startup_hose(struct pci_controler *hose)
+mcpcia_startup_hose(struct pci_controller *hose)
 {
        int mid = MCPCIA_HOSE2MID(hose->index);
        unsigned int tmp;
@@ -464,7 +464,7 @@ mcpcia_init_arch(void)
 void __init
 mcpcia_init_hoses(void)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
        int hose_count;
        int h;
 
@@ -561,7 +561,7 @@ static void
 mcpcia_print_system_area(unsigned long la_ptr)
 {
        struct el_common *frame;
-       struct pci_controler *hose;
+       struct pci_controller *hose;
 
        struct IOD_subpacket {
          unsigned long base;
@@ -638,7 +638,7 @@ mcpcia_machine_check(unsigned long vector, unsigned long la_ptr,
            {
                /* FIXME: how do we figure out which hose the
                   error was on?  */    
-               struct pci_controler *hose;
+               struct pci_controller *hose;
                for (hose = hose_head; hose; hose = hose->next)
                        mcpcia_pci_clr_err(MCPCIA_HOSE2MID(hose->index));
                break;
index 56601c4c5d3d4d6e859105a4c5bd434823189604..2eb147c543dd598d30fc311dc4505946ce20bcef 100644 (file)
@@ -178,7 +178,7 @@ struct pci_ops polaris_pci_ops =
 void __init
 polaris_init_arch(void)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
 
        /* May need to initialize error reporting (see PCICTL0/1), but
         * for now assume that the firmware has done the right thing
@@ -192,7 +192,7 @@ polaris_init_arch(void)
         * Create our single hose.
         */
 
-       pci_isa_hose = hose = alloc_pci_controler();
+       pci_isa_hose = hose = alloc_pci_controller();
        hose->io_space = &ioport_resource;
        hose->mem_space = &iomem_resource;
        hose->index = 0;
index 26aac4a384b8be79752808d3f62a605e57d8e78c..1fd7d126673ec388d7f13a6efd7088355abbd62d 100644 (file)
@@ -324,7 +324,7 @@ struct pci_ops t2_pci_ops =
 void __init
 t2_init_arch(void)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
        unsigned int i;
 
        for (i = 0; i < NR_CPUS; i++) {
@@ -384,7 +384,7 @@ t2_init_arch(void)
         * Create our single hose.
         */
 
-       pci_isa_hose = hose = alloc_pci_controler();
+       pci_isa_hose = hose = alloc_pci_controller();
        hose->io_space = &ioport_resource;
        hose->mem_space = &iomem_resource;
        hose->index = 0;
index 5e53d091ca37a29d2df3f5db83216f8e8e54812f..350b106b3c782df3b8e2b8ff6c14988b5db572e2 100644 (file)
@@ -83,7 +83,7 @@ static int
 mk_conf_addr(struct pci_dev *dev, int where, unsigned long *pci_addr,
             unsigned char *type1)
 {
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        unsigned long addr;
        u8 bus = dev->bus->number;
        u8 device_fn = dev->devfn;
@@ -200,7 +200,7 @@ struct pci_ops titan_pci_ops =
 
 \f
 void
-titan_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end)
+titan_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end)
 {
        titan_pachip *pachip = 
          (hose->index & 1) ? TITAN_pachip1 : TITAN_pachip0;
@@ -243,7 +243,7 @@ titan_query_agp(titan_pachip_port *port)
 
 }
 static void __init
-titan_init_agp(titan_pachip_port *port, struct pci_controler *hose)
+titan_init_agp(titan_pachip_port *port, struct pci_controller *hose)
 {
        union TPAchipPCTL pctl;
 
@@ -276,9 +276,9 @@ titan_init_agp(titan_pachip_port *port, struct pci_controler *hose)
 static void __init
 titan_init_one_pachip_port(titan_pachip_port *port, int index)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
 
-       hose = alloc_pci_controler();
+       hose = alloc_pci_controller();
        if (index == 0)
                pci_isa_hose = hose;
        hose->io_space = alloc_resource();
index 45ff9bb12bba0583ece4b3e05fbbc59b8e3c3c10..282eb0347a17f890acd6be9bb0243dc4a3e9f207 100644 (file)
@@ -90,7 +90,7 @@ static int
 mk_conf_addr(struct pci_dev *dev, int where, unsigned long *pci_addr,
             unsigned char *type1)
 {
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        unsigned long addr;
        u8 bus = dev->bus->number;
        u8 device_fn = dev->devfn;
@@ -206,7 +206,7 @@ struct pci_ops tsunami_pci_ops =
 };
 \f
 void
-tsunami_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end)
+tsunami_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end)
 {
        tsunami_pchip *pchip = hose->index ? TSUNAMI_pchip1 : TSUNAMI_pchip0;
        volatile unsigned long *csr;
@@ -280,12 +280,12 @@ tsunami_probe_write(volatile unsigned long *vaddr)
 static void __init
 tsunami_init_one_pchip(tsunami_pchip *pchip, int index)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
 
        if (tsunami_probe_read(&pchip->pctl.csr) == 0)
                return;
 
-       hose = alloc_pci_controler();
+       hose = alloc_pci_controller();
        if (index == 0)
                pci_isa_hose = hose;
        hose->io_space = alloc_resource();
index 9b4f28c109870c2ed6bcf55a9e30e49f6e616e3f..cf27355f98ef819b11ef7ab37764b171d4c79942 100644 (file)
@@ -64,10 +64,10 @@ unsigned long wildfire_mem_mask;
 void __init
 wildfire_init_hose(int qbbno, int hoseno)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
        wildfire_pci *pci;
 
-       hose = alloc_pci_controler();
+       hose = alloc_pci_controller();
        hose->io_space = alloc_resource();
        hose->mem_space = alloc_resource();
 
@@ -346,7 +346,7 @@ wildfire_kill_arch(int mode)
 }
 
 void
-wildfire_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end)
+wildfire_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end)
 {
        int qbbno = hose->index >> 3;
        int hoseno = hose->index & 7;
@@ -360,7 +360,7 @@ static int
 mk_conf_addr(struct pci_dev *dev, int where, unsigned long *pci_addr,
             unsigned char *type1)
 {
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        unsigned long addr;
        u8 bus = dev->bus->number;
        u8 device_fn = dev->devfn;
index d530ebb824b0146be5f615181bd4500120678444..7beed3ab148888fd97893e9edabb781cf5f8c8bb 100644 (file)
 
 
 /*
- * The PCI controler list.
+ * The PCI controller list.
  */
 
-struct pci_controler *hose_head, **hose_tail = &hose_head;
-struct pci_controler *pci_isa_hose;
+struct pci_controller *hose_head, **hose_tail = &hose_head;
+struct pci_controller *pci_isa_hose;
 
 
-struct pci_controler * __init
-alloc_pci_controler(void)
+struct pci_controller * __init
+alloc_pci_controller(void)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
 
        hose = alloc_bootmem(sizeof(*hose));
 
@@ -47,7 +47,7 @@ alloc_resource(void)
 asmlinkage long
 sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
        struct pci_dev *dev;
 
        /* from hose or from bus.devfn */
index ddf3d9755ca19474a2b7d7330c4b65d6aa0cb6c1..e473d21a23da32db5393ae040309c800645f354e 100644 (file)
@@ -43,11 +43,11 @@ const char pci_hae0_name[] = "HAE0";
 
 
 /*
- * The PCI controler list.
+ * The PCI controller list.
  */
 
-struct pci_controler *hose_head, **hose_tail = &hose_head;
-struct pci_controler *pci_isa_hose;
+struct pci_controller *hose_head, **hose_tail = &hose_head;
+struct pci_controller *pci_isa_hose;
 
 /*
  * Quirks.
@@ -136,7 +136,7 @@ void
 pcibios_align_resource(void *data, struct resource *res, unsigned long size)
 {
        struct pci_dev *dev = data;
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        unsigned long alignto;
        unsigned long start = res->start;
 
@@ -224,7 +224,7 @@ void __init
 pcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus)
 {
        /* Update device resources.  */
-       struct pci_controler *hose = (struct pci_controler *)bus->sysdata;
+       struct pci_controller *hose = (struct pci_controller *)bus->sysdata;
        int i;
 
        for (i = 0; i < PCI_NUM_RESOURCES; i++) {
@@ -244,7 +244,7 @@ pcibios_fixup_bus(struct pci_bus *bus)
 {
        /* Propogate hose info into the subordinate devices.  */
 
-       struct pci_controler *hose = bus->sysdata;
+       struct pci_controller *hose = bus->sysdata;
        struct list_head *ln;
        struct pci_dev *dev = bus->self;
 
@@ -284,7 +284,7 @@ void
 pcibios_update_resource(struct pci_dev *dev, struct resource *root,
                        struct resource *res, int resource)
 {
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        int where;
        u32 reg;
 
@@ -328,7 +328,7 @@ pcibios_update_irq(struct pci_dev *dev, int irq)
 u8 __init
 common_swizzle(struct pci_dev *dev, u8 *pinp)
 {
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
 
        if (dev->bus->number != hose->first_busno) {
                u8 pin = *pinp;
@@ -349,7 +349,7 @@ void __init
 pcibios_fixup_pbus_ranges(struct pci_bus * bus,
                          struct pbus_set_ranges_data * ranges)
 {
-       struct pci_controler *hose = (struct pci_controler *)bus->sysdata;
+       struct pci_controller *hose = (struct pci_controller *)bus->sysdata;
 
        ranges->io_start -= hose->io_space->start;
        ranges->io_end -= hose->io_space->start;
@@ -383,11 +383,11 @@ pcibios_set_master(struct pci_dev *dev)
 void __init
 common_init_pci(void)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
        struct pci_bus *bus;
        int next_busno;
 
-       /* Scan all of the recorded PCI controlers.  */
+       /* Scan all of the recorded PCI controllers.  */
        for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {
                hose->first_busno = next_busno;
                hose->last_busno = 0xff;
@@ -402,10 +402,10 @@ common_init_pci(void)
 }
 
 
-struct pci_controler * __init
-alloc_pci_controler(void)
+struct pci_controller * __init
+alloc_pci_controller(void)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
 
        hose = alloc_bootmem(sizeof(*hose));
 
@@ -432,7 +432,7 @@ alloc_resource(void)
 asmlinkage long
 sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
        struct pci_dev *dev;
 
        /* from hose or from bus.devfn */
index f434b329dbdd2460d8b65c91de9015614e2df9a2..3a16f748660a88fc67052ccbd417a3244edcea3d 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 struct pci_dev;
-struct pci_controler;
+struct pci_controller;
 struct pci_iommu_arena;
 
 /*
@@ -133,7 +133,7 @@ static inline u8 bridge_swizzle(u8 pin, u8 slot)
 struct pci_iommu_arena
 {
        spinlock_t lock;
-       struct pci_controler *hose;
+       struct pci_controller *hose;
        unsigned long *ptes;
        dma_addr_t dma_base;
        unsigned int size;
@@ -143,15 +143,15 @@ struct pci_iommu_arena
 
 
 /* The hose list.  */
-extern struct pci_controler *hose_head, **hose_tail;
-extern struct pci_controler *pci_isa_hose;
+extern struct pci_controller *hose_head, **hose_tail;
+extern struct pci_controller *pci_isa_hose;
 
 extern void common_init_pci(void);
 extern u8 common_swizzle(struct pci_dev *, u8 *);
-extern struct pci_controler *alloc_pci_controler(void);
+extern struct pci_controller *alloc_pci_controller(void);
 extern struct resource *alloc_resource(void);
 
-extern struct pci_iommu_arena *iommu_arena_new(struct pci_controler *,
+extern struct pci_iommu_arena *iommu_arena_new(struct pci_controller *,
                                               dma_addr_t, unsigned long,
                                               unsigned long);
 extern long iommu_arena_alloc(struct pci_iommu_arena *arena, long n);
index d4eb6a5d9876fbae2607d39cab0bc26ac52222da..13e2eab4e667516201e61930aefc8602f910893a 100644 (file)
@@ -43,7 +43,7 @@ calc_npages(long bytes)
 }
 \f
 struct pci_iommu_arena *
-iommu_arena_new(struct pci_controler *hose, dma_addr_t base,
+iommu_arena_new(struct pci_controller *hose, dma_addr_t base,
                unsigned long window_size, unsigned long align)
 {
        unsigned long mem_size;
@@ -147,7 +147,7 @@ iommu_arena_free(struct pci_iommu_arena *arena, long ofs, long n)
 dma_addr_t
 pci_map_single(struct pci_dev *pdev, void *cpu_addr, long size, int direction)
 {
-       struct pci_controler *hose = pdev ? pdev->sysdata : pci_isa_hose;
+       struct pci_controller *hose = pdev ? pdev->sysdata : pci_isa_hose;
        dma_addr_t max_dma = pdev ? pdev->dma_mask : 0x00ffffff;
        struct pci_iommu_arena *arena;
        long npages, dma_ofs, i;
@@ -215,7 +215,7 @@ void
 pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, long size,
                 int direction)
 {
-       struct pci_controler *hose = pdev ? pdev->sysdata : pci_isa_hose;
+       struct pci_controller *hose = pdev ? pdev->sysdata : pci_isa_hose;
        struct pci_iommu_arena *arena;
        long dma_ofs, npages;
 
@@ -454,7 +454,7 @@ pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
           int direction)
 {
        struct scatterlist *start, *end, *out;
-       struct pci_controler *hose;
+       struct pci_controller *hose;
        struct pci_iommu_arena *arena;
        dma_addr_t max_dma;
 
@@ -528,7 +528,7 @@ void
 pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
             int direction)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
        struct pci_iommu_arena *arena;
        struct scatterlist *end;
        dma_addr_t max_dma;
@@ -596,7 +596,7 @@ pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
 int
 pci_dma_supported(struct pci_dev *pdev, dma_addr_t mask)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
        struct pci_iommu_arena *arena;
 
 #if !DEBUG_NODIRECT
index 5463c9fecd8a18cd57094e8b1f6a1d38e6b0b28e..7be5f6dc81ee38ed57c8a736a4a83b8990e21a29 100644 (file)
 struct pt_regs;
 struct task_struct;
 struct pci_dev;
-struct pci_controler;
+struct pci_controller;
 
 /* core_apecs.c */
 extern struct pci_ops apecs_pci_ops;
 extern void apecs_init_arch(void);
 extern void apecs_pci_clr_err(void);
 extern void apecs_machine_check(u64, u64, struct pt_regs *);
-extern void apecs_pci_tbi(struct pci_controler *, dma_addr_t, dma_addr_t);
+extern void apecs_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
 
 /* core_cia.c */
 extern struct pci_ops cia_pci_ops;
@@ -25,7 +25,7 @@ extern void cia_init_pci(void);
 extern void cia_init_arch(void);
 extern void pyxis_init_arch(void);
 extern void cia_machine_check(u64, u64, struct pt_regs *);
-extern void cia_pci_tbi(struct pci_controler *, dma_addr_t, dma_addr_t);
+extern void cia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
 
 /* core_irongate.c */
 extern struct pci_ops irongate_pci_ops;
@@ -38,14 +38,14 @@ extern void irongate_machine_check(u64, u64, struct pt_regs *);
 extern struct pci_ops lca_pci_ops;
 extern void lca_init_arch(void);
 extern void lca_machine_check(u64, u64, struct pt_regs *);
-extern void lca_pci_tbi(struct pci_controler *, dma_addr_t, dma_addr_t);
+extern void lca_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
 
 /* core_mcpcia.c */
 extern struct pci_ops mcpcia_pci_ops;
 extern void mcpcia_init_arch(void);
 extern void mcpcia_init_hoses(void);
 extern void mcpcia_machine_check(u64, u64, struct pt_regs *);
-extern void mcpcia_pci_tbi(struct pci_controler *, dma_addr_t, dma_addr_t);
+extern void mcpcia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
 
 /* core_polaris.c */
 extern struct pci_ops polaris_pci_ops;
@@ -66,21 +66,21 @@ extern struct pci_ops titan_pci_ops;
 extern void titan_init_arch(void);
 extern void titan_kill_arch(int);
 extern void titan_machine_check(u64, u64, struct pt_regs *);
-extern void titan_pci_tbi(struct pci_controler *, dma_addr_t, dma_addr_t);
+extern void titan_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
 
 /* core_tsunami.c */
 extern struct pci_ops tsunami_pci_ops;
 extern void tsunami_init_arch(void);
 extern void tsunami_kill_arch(int);
 extern void tsunami_machine_check(u64, u64, struct pt_regs *);
-extern void tsunami_pci_tbi(struct pci_controler *, dma_addr_t, dma_addr_t);
+extern void tsunami_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
 
 /* core_wildfire.c */
 extern struct pci_ops wildfire_pci_ops;
 extern void wildfire_init_arch(void);
 extern void wildfire_kill_arch(int);
 extern void wildfire_machine_check(u64, u64, struct pt_regs *);
-extern void wildfire_pci_tbi(struct pci_controler *, dma_addr_t, dma_addr_t);
+extern void wildfire_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
 
 /* setup.c */
 extern unsigned long srm_hae;
index a6443da535ee753682f39a997d8e84ced2b389a2..cf5f62deefe540b8a2b8ac7193e6d89d22d660f8 100644 (file)
@@ -201,7 +201,7 @@ reserve_std_resources(void)
        long i;
 
        if (hose_head) {
-               struct pci_controler *hose;
+               struct pci_controller *hose;
                for (hose = hose_head; hose; hose = hose->next)
                        if (hose->index == 0) {
                                io = hose->io_space;
index 6197a6a147a95158c028c6b34f17df6647947d5c..c41daf689316ae68b3447f0ba19fe7dce053923b 100644 (file)
@@ -404,13 +404,13 @@ dp264_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
        };
        const long min_idsel = 5, max_idsel = 10, irqs_per_slot = 5;
 
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        int irq = COMMON_TABLE_LOOKUP;
 
        if (irq > 0) {
                irq += 16 * hose->index;
        } else {
-               /* ??? The Contaq IDE controler on the ISA bridge uses
+               /* ??? The Contaq IDE controller on the ISA bridge uses
                   "legacy" interrupts 14 and 15.  I don't know if anything
                   can wind up at the same slot+pin on hose1, so we'll
                   just have to trust whatever value the console might
@@ -455,7 +455,7 @@ monet_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 static u8 __init
 monet_swizzle(struct pci_dev *dev, u8 *pinp)
 {
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        int slot, pin = *pinp;
 
        if (hose->first_busno == dev->bus->number) {
@@ -521,7 +521,7 @@ clipper_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
        };
        const long min_idsel = 1, max_idsel = 7, irqs_per_slot = 5;
 
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        int irq = COMMON_TABLE_LOOKUP;
 
        if (irq > 0)
index 4545ff0e278879ac4f446facbcd37c0d91bb7692..06ad658d483ad6e3856ecf44eb9abd5f73e9e676 100644 (file)
@@ -177,7 +177,7 @@ eiger_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 static u8 __init
 eiger_swizzle(struct pci_dev *dev, u8 *pinp)
 {
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        int slot, pin = *pinp;
        int bridge_count = 0;
 
index ae09ecbd14a3a1d188c4e4a385616db9b50d1197..ea7a104db9af7c2ee011f4ab46bfb07fd197a5b5 100644 (file)
@@ -124,12 +124,12 @@ jensen_init_irq(void)
 static void __init
 jensen_init_arch(void)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
 
        /* Create a hose so that we can report i/o base addresses to
           userland.  */
 
-       pci_isa_hose = hose = alloc_pci_controler();
+       pci_isa_hose = hose = alloc_pci_controller();
        hose->io_space = &ioport_resource;
        hose->mem_space = &iomem_resource;
        hose->index = 0;
index b18c148d1bbd7bae7ba341d2ddc8d14b0da0f2c8..681c76ea632796be60c71ea5ac8f79d5d8064578 100644 (file)
@@ -139,7 +139,7 @@ rawhide_srm_device_interrupt(unsigned long vector, struct pt_regs * regs)
 static void __init
 rawhide_init_irq(void)
 {
-       struct pci_controler *hose;
+       struct pci_controller *hose;
        long i;
 
        mcpcia_init_hoses();
@@ -204,7 +204,7 @@ rawhide_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
        };
        const long min_idsel = 1, max_idsel = 5, irqs_per_slot = 5;
 
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        int irq = COMMON_TABLE_LOOKUP;
        if (irq >= 0)
                irq += 24 * hose->index;
index 190b76bd9e74369068289269cb5908acc2881424..9024644c15b9d211c76f6a8d4b6568cc13bd6ced 100644 (file)
@@ -321,10 +321,10 @@ privateer_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 }
 
 #ifdef CONFIG_VGA_HOSE
-static struct pci_controler * __init
-privateer_vga_hose_select(struct pci_controler *h1, struct pci_controler *h2)
+static struct pci_controller * __init
+privateer_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2)
 {
-       struct pci_controler *hose = h1;
+       struct pci_controller *hose = h1;
        int agp1, agp2;
 
        /* which hose(s) are agp? */
index 8a7ad55c499749887bdc47a53832592cf728e786..dbc4bee484c6929314daaa0bf2659ccc08e78728 100644 (file)
@@ -315,7 +315,7 @@ wildfire_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
        };
        const long min_idsel = 0, max_idsel = 7, irqs_per_slot = 5;
 
-       struct pci_controler *hose = dev->sysdata;
+       struct pci_controller *hose = dev->sysdata;
        int irq = COMMON_TABLE_LOOKUP;
 
        if (irq > 0) {
index 32ac723795303c8377ffdc448fc5951dc736f184..89123d122ff64d0ce57872907d7e50b80036f173 100644 (file)
@@ -54,7 +54,7 @@ fixup_sa1100(struct machine_desc *desc, struct param_struct *params,
        if (machine_is_assabet()) {
                /* 
                 * On Assabet, we must probe for the Neponset board *before*
-                * paging_init() has occured to actually determine the amount
+                * paging_init() has occurred to actually determine the amount
                 * of RAM available.
                 */
                extern void map_sa1100_gpio_regs(void);
index 54fe435c605b89bc5d8989f7a3b9bcfbc4e72100..01e3725c897b8ee7030adee02775a5098348e74b 100644 (file)
@@ -199,7 +199,7 @@ pg_data_t sa1100_node_data[4] =
   
 /*
  * On Assabet, we must probe for the Neponset board *before* paging_init() 
- * has occured to actually determine the amount of RAM available.  To do so, 
+ * has occurred to actually determine the amount of RAM available.  To do so, 
  * we map the appropriate IO section in the page table here in order to 
  * access GPIO registers.
  */
index e75eb2fdff4d9b629656e000e95ef2743e0ad150..f238d05c5b1944a6c94993bbb128429abf938ea1 100644 (file)
@@ -43,7 +43,7 @@ tools/build: tools/build.c
        $(HOSTCC) $(HOSTCFLAGS) -o $@ $< -I$(TOPDIR)/include
 
 bootsect: bootsect.o
-       $(LD) -Ttext 0x0 -s -oformat binary -o $@ $<
+       $(LD) -Ttext 0x0 -s --oformat binary -o $@ $<
 
 bootsect.o: bootsect.s
        $(AS) -o $@ $<
@@ -52,7 +52,7 @@ bootsect.s: bootsect.S Makefile $(BOOT_INCL)
        $(CPP) $(CPPFLAGS) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
 
 bbootsect: bbootsect.o
-       $(LD) -Ttext 0x0 -s -oformat binary $< -o $@
+       $(LD) -Ttext 0x0 -s --oformat binary $< -o $@
 
 bbootsect.o: bbootsect.s
        $(AS) -o $@ $<
@@ -61,7 +61,7 @@ bbootsect.s: bootsect.S Makefile $(BOOT_INCL)
        $(CPP) $(CPPFLAGS) -D__BIG_KERNEL__ -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
 
 setup: setup.o
-       $(LD) -Ttext 0x0 -s -oformat binary -e begtext -o $@ $<
+       $(LD) -Ttext 0x0 -s --oformat binary -e begtext -o $@ $<
 
 setup.o: setup.s
        $(AS) -o $@ $<
@@ -70,7 +70,7 @@ setup.s: setup.S video.S Makefile $(BOOT_INCL) $(TOPDIR)/include/linux/version.h
        $(CPP) $(CPPFLAGS) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
 
 bsetup: bsetup.o
-       $(LD) -Ttext 0x0 -s -oformat binary -e begtext -o $@ $<
+       $(LD) -Ttext 0x0 -s --oformat binary -e begtext -o $@ $<
 
 bsetup.o: bsetup.s
        $(AS) -o $@ $<
index 875a84bf9f6bb7916163b8fe4aab74ac2d476146..0c817961400e7216b17ec107c90419a13272f628 100644 (file)
@@ -382,7 +382,6 @@ CONFIG_EEPRO100=y
 # CONFIG_NE3210 is not set
 # CONFIG_ES3210 is not set
 # CONFIG_8139TOO is not set
-# CONFIG_RTL8129 is not set
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
index 20bc14fc657bc3de0d58e10fef3cc587432d4a09..52eb1c79a02616d660005753db3f7881b19e83e3 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/mmx.h>
 #include <asm/desc.h>
 #include <asm/pgtable.h>
+#include <asm/pgalloc.h>
 
 extern void dump_thread(struct pt_regs *, struct user *);
 extern spinlock_t rtc_lock;
@@ -134,6 +135,9 @@ EXPORT_SYMBOL(__global_sti);
 EXPORT_SYMBOL(__global_save_flags);
 EXPORT_SYMBOL(__global_restore_flags);
 EXPORT_SYMBOL(smp_call_function);
+
+/* TLB flushing */
+EXPORT_SYMBOL(flush_tlb_page);
 #endif
 
 #ifdef CONFIG_MCA
index ba97ca4bc7876daee6e14ce145311556266dd28a..0a2973cfa285e5a85c63167fa44ccf1a92af6420 100644 (file)
@@ -179,7 +179,7 @@ unsigned short get_fpu_twd( struct task_struct *tsk )
 
 unsigned short get_fpu_mxcsr( struct task_struct *tsk )
 {
-       if ( cpu_has_fxsr ) {
+       if ( cpu_has_xmm ) {
                return tsk->thread.i387.fxsave.mxcsr;
        } else {
                return 0x1f80;
index 6fa43476a5ae973e45c5779da4e8b8fcb98690e6..b8cc4fad4fde3138e3f77d7d0894966f11adca8a 100644 (file)
@@ -388,7 +388,7 @@ static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
 
 #if CONFIG_X86_IO_APIC
 
-int nmi_watchdog = 1;
+int nmi_watchdog = 0;
 
 static int __init setup_nmi_watchdog(char *str)
 {
index dfbf7ba8e7cadea753a385007bc4ee44ea4e379a..d9301040b6001e40e96c7e5eb76714a71d982889 100644 (file)
@@ -3,6 +3,7 @@
 #include <linux/sched.h>
 
 #include <asm/i387.h>
+#include <asm/hardirq.h> 
 
 /*
  *     MMX 3DNow! library helper functions
  
 void *_mmx_memcpy(void *to, const void *from, size_t len)
 {
-       void *p=to;
-       int i= len >> 6;        /* len/64 */
+       void *p;
+       int i;
+
+       if (in_interrupt())
+               return __memcpy(to, from, len);
+
+       p = to;
+       i = len >> 6; /* len/64 */
 
        kernel_fpu_begin();
 
index 2eb7ca6aadb699bfd351ec52a30e8e9ebe73f8b4..223d05af4e0dec69c720bd8c9fc2af2c24374038 100644 (file)
@@ -49,7 +49,7 @@ search_exception_table(unsigned long addr)
 
        spin_lock_irqsave(&modlist_lock, flags);
        for (mp = module_list; mp != NULL; mp = mp->next) {
-               if (mp->ex_table_start == NULL)
+               if (mp->ex_table_start == NULL || !(mp->flags&(MOD_RUNNING|MOD_INITIALIZING)))
                        continue;
                ret = search_one_table(mp->ex_table_start,
                                       mp->ex_table_end - 1, addr);
index 3b3c4311144c69b5b150e56e20d007e9a3790c18..73d962476abc275f050ec560fae6f8d0d95817f0 100644 (file)
@@ -140,3 +140,4 @@ EXPORT_SYMBOL(ide_ops);
 #endif
 
 EXPORT_SYMBOL(get_wchan);
+EXPORT_SYMBOL(flush_tlb_page);
index b384db2af63a1c597f2e9e0129be04322d7d35f2..ff74fb7ca6133668d6e1bc1d70596cd5f85b6d75 100644 (file)
@@ -121,3 +121,4 @@ EXPORT_SYMBOL(screen_info);
 #endif
 
 EXPORT_SYMBOL(get_wchan);
+EXPORT_SYMBOL(flush_tlb_page);
index a1125e933370191261bafb0219e31555905ef789..de40410b0ff96fdfe420290ef0d1674542bd45ba 100644 (file)
@@ -687,7 +687,7 @@ pgm_no_sv:
         lr      %r3,%r8
         la      %r0,0x7f
         nr      %r3,%r0           # clear per-event-bit
-        be      BASED(pgm_dn)     # none of Martins exceptions occured bypass
+        be      BASED(pgm_dn)     # none of Martins exceptions occurred bypass
         l       %r9,BASED(.Ljump_table)
         sll     %r3,2
         l       %r9,0(%r3,%r9)    # load address of handler routine
index 2820fc91dd2c8d4f2b621a778dfb16ca90b59897..560feff6b72f9870456125a628be87b362e9971a 100644 (file)
@@ -477,7 +477,7 @@ do_format_dasd(char *dev_name,format_data_t format_params,int testmode,
 
        rc=stat(dev_name,&stat_buf);
        if (rc) {
-               ERRMSG_EXIT(EXIT_FAILURE,"%s: error occured during stat: " \
+               ERRMSG_EXIT(EXIT_FAILURE,"%s: error occurred during stat: " \
                        "%s\n",prog_name,strerror(errno));
        } else {
                if (!S_ISBLK(stat_buf.st_mode))
index c5fbdd61f42453ff55d82caa21e8908d2baa0076..0dddf63c70c9d8a2226b16d0fe7a8c3ef6315092 100644 (file)
@@ -724,7 +724,7 @@ pgm_no_sv:
         stosm   48(%r15),0x03     # reenable interrupts
        lghi    %r3,0x7f
         nr      %r3,%r8           # clear per-event-bit & move to r3
-        je      pgm_dn            # none of Martins exceptions occured bypass
+        je      pgm_dn            # none of Martins exceptions occurred bypass
         sll     %r3,3
         larl    %r9,pgm_check_table
         lg      %r9,0(%r3,%r9)    # load address of handler routine
index 2820fc91dd2c8d4f2b621a778dfb16ca90b59897..560feff6b72f9870456125a628be87b362e9971a 100644 (file)
@@ -477,7 +477,7 @@ do_format_dasd(char *dev_name,format_data_t format_params,int testmode,
 
        rc=stat(dev_name,&stat_buf);
        if (rc) {
-               ERRMSG_EXIT(EXIT_FAILURE,"%s: error occured during stat: " \
+               ERRMSG_EXIT(EXIT_FAILURE,"%s: error occurred during stat: " \
                        "%s\n",prog_name,strerror(errno));
        } else {
                if (!S_ISBLK(stat_buf.st_mode))
index 2bdcd75ea8cb017ac4a48b806158370fb0577b7b..e3a27f414cec54d75f75978c70bd1bc7455b6a83 100644 (file)
@@ -77,3 +77,4 @@ DECLARE_EXPORT(__ashldi3);
 /* needed by some modules */
 EXPORT_SYMBOL(flush_dcache_page);
 #endif
+EXPORT_SYMBOL(flush_tlb_page);
index 79dc5d56d8290485cd9ec7eb31ff5c9d04184244..ac00c99df90b266d59e438639f2a522b553cb6b7 100644 (file)
        Minimum interval is 1 jiffy, maximum interval is 24 hours.
 
        * In order to unload the i810_rng module, you must first
-       disable the hardware via sysctl i810_hw_enabled, as shown above,
+       disable the hardware via sysctl i810_rng_timer, as shown above,
        and make sure all users of the character device have closed
 
        * The timer and the character device may be used simultaneously,
        if desired.
 
-       * FIXME: support poll()
-
-       * FIXME: should we be crazy and support mmap()?
+       * FIXME: support poll(2)
 
        * FIXME: It is possible for the timer function to read,
        and shove into the kernel entropy pool, 2499 bytes of data
        * FIXME: module unload is racy.  To fix this, struct ctl_table
        needs an owner member a la struct file_operations.
 
+       * FIXME: Timer interval should not be in jiffies, but in a more
+       user-understandable value like milliseconds.
+
        * Since the RNG is accessed from a timer as well as normal
        kernel code, but not from interrupts, we use spin_lock_bh
        in regular code, and spin_lock in the timer function, to
        Version 0.9.2:
        * Simplify open blocking logic
 
+       Version 0.9.3:
+       * Clean up rng_read a bit.
+       * Update i810_rng driver Web site URL.
+       * Increase default timer interval to 4 samples per second.
+       * Abort if mem region is not available.
+       * BSS zero-initialization cleanup.
+       * Call misc_register() from rng_init_one.
+       * Fix O_NONBLOCK to occur before we schedule.
+
  */
 
 
 /*
  * core module and version information
  */
-#define RNG_VERSION "0.9.2"
+#define RNG_VERSION "0.9.3"
 #define RNG_MODULE_NAME "i810_rng"
 #define RNG_DRIVER_NAME   RNG_MODULE_NAME " hardware driver " RNG_VERSION
 #define PFX RNG_MODULE_NAME ": "
@@ -249,6 +259,9 @@ static void rng_run_fips_test (void);
 #define                RNG_DATA_PRESENT        0x01
 #define RNG_DATA                       2
 
+/*
+ * Magic address at which Intel PCI bridges locate the RNG
+ */
 #define RNG_ADDR                       0xFFBC015F
 #define RNG_ADDR_LEN                   3
 
@@ -259,9 +272,9 @@ static void rng_run_fips_test (void);
 
 /*
  * Frequency that data is added to kernel entropy pool
- * HZ>>1 == every half-second
+ * HZ>>1 == every quarter-second
  */
-#define RNG_DEF_TIMER_LEN              (HZ >> 1)
+#define RNG_DEF_TIMER_LEN              (HZ >> 2)
 
 
 /*
@@ -283,7 +296,6 @@ static int rng_enabled_sysctl;              /* sysctl for enabling/disabling RNG */
 static unsigned int rng_entropy = 8;   /* number of entropy bits we submit to /dev/random */
 static unsigned int rng_entropy_sysctl;        /* sysctl for changing entropy bits */
 static unsigned int rng_interval_sysctl; /* sysctl for changing timer interval */
-static int rng_have_mem_region;                /* did we grab RNG region via request_mem_region? */
 static unsigned int rng_fips_counter;  /* size of internal FIPS test data pool */
 static unsigned int rng_timer_len = RNG_DEF_TIMER_LEN; /* timer interval, in jiffies */
 static void *rng_mem;                  /* token to our ioremap'd RNG register area */
@@ -622,12 +634,10 @@ static void rng_sysctl (int add)
 
 static int rng_dev_open (struct inode *inode, struct file *filp)
 {
-       int rc = -EINVAL;
-
        if ((filp->f_mode & FMODE_READ) == 0)
-               return rc;
+               return -EINVAL;
        if (filp->f_mode & FMODE_WRITE)
-               return rc;
+               return -EINVAL;
 
        /* wait for device to become free */
        if (filp->f_flags & O_NONBLOCK) {
@@ -639,15 +649,11 @@ static int rng_dev_open (struct inode *inode, struct file *filp)
        }
 
        if (rng_enable (1)) {
-               rc = -EIO;
-               goto err_out;
+               up (&rng_open_sem);
+               return -EIO;
        }
 
        return 0;
-
-err_out:
-       up (&rng_open_sem);
-       return rc;
 }
 
 
@@ -686,20 +692,35 @@ static ssize_t rng_dev_read (struct file *filp, char *buf, size_t size,
                        ret++;
                }
 
+               if (filp->f_flags & O_NONBLOCK)
+                       return ret ? : -EAGAIN;
+
                if (current->need_resched)
                        schedule ();
 
                if (signal_pending (current))
                        return ret ? : -ERESTARTSYS;
-
-               if (filp->f_flags & O_NONBLOCK)
-                       return ret ? : -EAGAIN;
        }
 
        return ret;
 }
 
 
+static struct file_operations rng_chrdev_ops = {
+       owner:          THIS_MODULE,
+       open:           rng_dev_open,
+       release:        rng_dev_release,
+       read:           rng_dev_read,
+};
+
+
+static struct miscdevice rng_miscdev = {
+       RNG_MISCDEV_MINOR,
+       RNG_MODULE_NAME,
+       &rng_chrdev_ops,
+};
+
+
 /*
  * rng_init_one - look for and attempt to init a single RNG
  */
@@ -713,16 +734,25 @@ static int __init rng_init_one (struct pci_dev *dev)
        if (pci_enable_device (dev))
                return -EIO;
 
-       /* XXX currently fails, investigate who has our mem region */
-       if (request_mem_region (RNG_ADDR, RNG_ADDR_LEN, RNG_MODULE_NAME))
-               rng_have_mem_region = 1;
+       if (!request_mem_region (RNG_ADDR, RNG_ADDR_LEN, RNG_MODULE_NAME)) {
+               printk (KERN_ERR PFX "cannot reserve RNG region\n");
+               DPRINTK ("EXIT, returning -EBUSY\n");
+               return -EBUSY;
+       }
+
+       rc = misc_register (&rng_miscdev);
+       if (rc) {
+               printk (KERN_ERR PFX "cannot register misc device\n");
+               DPRINTK ("EXIT, returning %d\n", rc);
+               goto err_out_free_res;
+       }
 
        rng_mem = ioremap (RNG_ADDR, RNG_ADDR_LEN);
        if (rng_mem == NULL) {
                printk (KERN_ERR PFX "cannot ioremap RNG Memory\n");
                DPRINTK ("EXIT, returning -EBUSY\n");
                rc = -EBUSY;
-               goto err_out_free_res;
+               goto err_out_free_miscdev;
        }
 
        /* Check for Intel 82802 */
@@ -756,9 +786,10 @@ static int __init rng_init_one (struct pci_dev *dev)
 
 err_out_free_map:
        iounmap (rng_mem);
+err_out_free_miscdev:
+       misc_deregister (&rng_miscdev);
 err_out_free_res:
-       if (rng_have_mem_region)
-               release_mem_region (RNG_ADDR, RNG_ADDR_LEN);
+       release_mem_region (RNG_ADDR, RNG_ADDR_LEN);
        return rc;
 }
 
@@ -786,21 +817,6 @@ MODULE_PARM(rng_entropy, "1i");
 MODULE_PARM_DESC(rng_entropy, "Bits of entropy to add to random pool per RNG byte (range: 0-8, default 8)");
 
 
-static struct file_operations rng_chrdev_ops = {
-       owner:          THIS_MODULE,
-       open:           rng_dev_open,
-       release:        rng_dev_release,
-       read:           rng_dev_read,
-};
-
-
-static struct miscdevice rng_miscdev = {
-       RNG_MISCDEV_MINOR,
-       RNG_MODULE_NAME,
-       &rng_chrdev_ops,
-};
-
-
 /*
  * rng_init - initialize RNG module
  */
@@ -826,15 +842,6 @@ match:
        if (rc)
                return rc;
 
-       rc = misc_register (&rng_miscdev);
-       if (rc) {
-               iounmap (rng_mem);
-               if (rng_have_mem_region)
-                       release_mem_region (RNG_ADDR, RNG_ADDR_LEN);
-               DPRINTK ("EXIT, returning %d\n", rc);
-               return rc;
-       }
-
        printk (KERN_INFO RNG_DRIVER_NAME " loaded\n");
 
        rng_pdev = pdev;
@@ -859,8 +866,9 @@ static void __exit rng_cleanup (void)
        rng_sysctl (0);
 
        iounmap (rng_mem);
-       if (rng_have_mem_region)
-               release_mem_region (RNG_ADDR, RNG_ADDR_LEN);
+       release_mem_region (RNG_ADDR, RNG_ADDR_LEN);
+
+       rng_pdev = NULL;
 
        DPRINTK ("EXIT\n");
 }
@@ -892,8 +900,8 @@ module_exit (rng_cleanup);
 *  random as random :)
 */
 
-static int poker[16] = { 0, }, runs[12] = { 0, };
-static int ones = 0, rlength = -1, current_bit = 0, rng_test = 0;
+static int poker[16], runs[12];
+static int ones, rlength = -1, current_bit, rng_test;
 
 
 /*
index ea4686691ec51ade52f596964b5d75b3836251b4..884ca6637ed6363db2b638e4396c1fe7b10d010b 100644 (file)
@@ -213,12 +213,8 @@ static struct tty_struct   *stli_txcooktty;
  *     at 9600 baud, 8 data bits, no parity, 1 stop bit.
  */
 static struct termios          stli_deftermios = {
-       0,
-       0,
-       (B9600 | CS8 | CREAD | HUPCL | CLOCAL),
-       0,
-       0,
-       INIT_C_CC
+       c_cflag:        (B9600 | CS8 | CREAD | HUPCL | CLOCAL),
+       c_cc:           INIT_C_CC,
 };
 
 /*
index c0eeab2f098ef80c567c6ddf4f52d46e1556c5f0..e0cb1c74e4e3f9a3dd6d2dfa75030662f55e4e35 100644 (file)
 #define CI104J_ASIC_ID  5
 
 enum {
-       MXSER_BOARD_C168_ISA = 0,
+       MXSER_BOARD_C168_ISA = 1,
        MXSER_BOARD_C104_ISA,
        MXSER_BOARD_CI104J,
        MXSER_BOARD_C168_PCI,
@@ -617,16 +617,18 @@ int mxser_init(void)
                        pdev = pci_find_device(mxser_pcibrds[b].vendor_id,
                                               mxser_pcibrds[b].device_id, pdev);
                        if (!pdev)
-                               break;
+                       {
+                               b++;
+                               continue;
+                       }
                        if (pci_enable_device(pdev))
                                continue;
-                       b++;
                        hwconf.pdev = pdev;
                        printk("Found MOXA %s board(BusNo=%d,DevNo=%d)\n",
                                mxser_brdname[mxser_pcibrds[b].board_type - 1],
                                pdev->bus->number, PCI_SLOT(pdev->devfn >> 3));
                        if (m >= MXSER_BOARDS) {
-                               printk("Too many Smartio family boards find (maximum %d),board not configured\n", MXSER_BOARDS);
+                               printk("Too many Smartio family boards found (maximum %d),board not configured\n", MXSER_BOARDS);
                        } else {
                                retval = mxser_get_PCI_conf(pdev,
                                   mxser_pcibrds[b].board_type, &hwconf);
@@ -1457,7 +1459,9 @@ static inline void mxser_transmit_chars(struct mxser_struct *info)
 
        if (info->xmit_cnt < WAKEUP_CHARS) {
                set_bit(MXSER_EVENT_TXLOW, &info->event);
-               schedule_task(&info->tqueue);
+               MOD_INC_USE_COUNT;
+               if (schedule_task(&info->tqueue) == 0)
+                   MOD_DEC_USE_COUNT;
        }
        if (info->xmit_cnt <= 0) {
                info->IER &= ~UART_IER_THRI;
@@ -1486,8 +1490,9 @@ static inline void mxser_check_modem_status(struct mxser_struct *info,
                else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) &&
                           (info->flags & ASYNC_CALLOUT_NOHUP)))
                        set_bit(MXSER_EVENT_HANGUP, &info->event);
-               schedule_task(&info->tqueue);
-
+               MOD_INC_USE_COUNT;
+               if (schedule_task(&info->tqueue) == 0)
+                   MOD_DEC_USE_COUNT;
        }
        if (info->flags & ASYNC_CTS_FLOW) {
                if (info->tty->hw_stopped) {
@@ -1671,7 +1676,7 @@ static int mxser_startup(struct mxser_struct *info)
         */
        if (inb(info->base + UART_LSR) == 0xff) {
                restore_flags(flags);
-               if (suser()) {
+               if (capable(CAP_SYS_ADMIN)) {
                        if (info->tty)
                                set_bit(TTY_IO_ERROR, &info->tty->flags);
                        return (0);
@@ -2188,8 +2193,7 @@ static int mxser_get_lsr_info(struct mxser_struct *info, unsigned int *value)
        status = inb(info->base + UART_LSR);
        restore_flags(flags);
        result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0);
-       put_user(result, value);
-       return (0);
+       return put_user(result, value);
 }
 
 /*
@@ -2229,8 +2233,7 @@ static int mxser_get_modem_info(struct mxser_struct *info,
            ((status & UART_MSR_RI) ? TIOCM_RNG : 0) |
            ((status & UART_MSR_DSR) ? TIOCM_DSR : 0) |
            ((status & UART_MSR_CTS) ? TIOCM_CTS : 0);
-       put_user(result, value);
-       return (0);
+       return put_user(result, value);
 }
 
 static int mxser_set_modem_info(struct mxser_struct *info, unsigned int cmd,
index 6628f9d053197a94b0a463d22ea2319b1f656960..021559dd4b4cace63d2bfb06d4cad7aad62f248d 100644 (file)
@@ -165,12 +165,8 @@ static DECLARE_MUTEX(stl_tmpwritesem);
  *     at 9600, 8 data bits, 1 stop bit.
  */
 static struct termios          stl_deftermios = {
-       0,
-       0,
-       (B9600 | CS8 | CREAD | HUPCL | CLOCAL),
-       0,
-       0,
-       INIT_C_CC
+       c_cflag:        (B9600 | CS8 | CREAD | HUPCL | CLOCAL),
+       c_cc:           INIT_C_CC,
 };
 
 /*
index 6f18d1428f269693af9990f68122bb76d041d3fa..6e73dfe2adbedd2a1d1412bb247c6259841469cb 100644 (file)
@@ -403,31 +403,30 @@ static int write_fcp(struct hpsb_host *host, int nodeid, quadlet_t *data,
 }
 
 
-struct hpsb_highlevel_ops csr_ops = {
+static struct hpsb_highlevel_ops csr_ops = {
         add_host: add_host,
         host_reset: host_reset,
 };
 
 
-struct hpsb_address_ops map_ops = {
+static struct hpsb_address_ops map_ops = {
         read: read_maps,
 };
 
-struct hpsb_address_ops fcp_ops = {
+static struct hpsb_address_ops fcp_ops = {
         write: write_fcp,
 };
 
-struct hpsb_address_ops reg_ops = {
+static struct hpsb_address_ops reg_ops = {
         read: read_regs,
         write: write_regs,
         lock: lock_regs,
 };
 
+static struct hpsb_highlevel *hl;
 
 void init_csr(void)
 {
-        struct hpsb_highlevel *hl;
-
         hl = hpsb_register_highlevel("standard registers", &csr_ops);
         if (hl == NULL) {
                 HPSB_ERR("out of memory during ieee1394 initialization");
@@ -449,3 +448,8 @@ void init_csr(void)
                                 CSR_REGISTER_BASE + CSR_SPEED_MAP,
                                 CSR_REGISTER_BASE + CSR_SPEED_MAP_END);
 }
+
+void cleanup_csr(void)
+{
+        hpsb_unregister_highlevel(hl);
+}
index 7bc97f549d6684bc7e1c1a1c716efd29de971103..3b2ea80bacfa977a5267b072767caeaad434c2c1 100644 (file)
@@ -50,5 +50,6 @@ struct csr_control {
 
 
 void init_csr(void);
+void cleanup_csr(void);
 
 #endif /* _IEEE1394_CSR_H */
index b7e1d2a274145986702f23e7224b54ae74d2dc5c..02539351e4d0d49d63eee578aff21d8d1e3fcc63 100644 (file)
@@ -219,11 +219,19 @@ static struct hpsb_highlevel_ops guid_ops = {
         host_reset:  host_reset,
 };
 
+static struct hpsb_highlevel *hl;
+
 void init_ieee1394_guid(void)
 {
         atomic_set(&outstanding_requests, 0);
 
-        if (!hpsb_register_highlevel("GUID manager", &guid_ops)) {
+        hl = hpsb_register_highlevel("GUID manager", &guid_ops);
+        if (!hl) {
                 HPSB_ERR("out of memory during ieee1394 initialization");
         }
 }
+
+void cleanup_ieee1394_guid(void)
+{
+        hpsb_unregister_highlevel(hl);
+}
index e3a87dda931d3ef116f2d3c32308753769887e56..0ea8a842c79c459f7c1d0454a58e474fbdacc92d 100644 (file)
@@ -49,6 +49,6 @@ int hpsb_guid_fill_packet(hpsb_guid_t handle, struct hpsb_packet *pkt);
 
 
 void init_ieee1394_guid(void);
-
+void cleanup_ieee1394_guid(void);
 
 #endif /* _IEEE1394_GUID_H */
index 15abcbd913d18c8b5df73ccb5aab529984ee8637..5a5d337d76976c4522fcea0278ac1e26242c1b03 100644 (file)
@@ -269,7 +269,7 @@ static void build_speed_map(struct hpsb_host *host, int nodecount)
         }
 
         /* set self mapping */
-        for (i = nodecount - 1; i; i--) {
+        for (i = 0; i < nodecount; i++) {
                 map[64*i + i] = speedcap[i];
         }
 
@@ -804,4 +804,10 @@ int init_module(void)
         return 0;
 }
 
+void cleanup_module(void)
+{
+        cleanup_ieee1394_guid();
+        cleanup_csr();
+}
+
 #endif
index f4272a6ae8d378d9b234d93caaa1adc92d8b2905..3008ccdc91819c7cfc1e6b1c75bc9a5657ca8044 100644 (file)
@@ -9,7 +9,7 @@ if [ "$CONFIG_INET" != "n" ]; then
    if [ "$CONFIG_ISDN_PPP" != "n" ]; then
       bool         '    Use VJ-compression with synchronous PPP' CONFIG_ISDN_PPP_VJ
       bool         '    Support generic MP (RFC 1717)' CONFIG_ISDN_MPP
-      dep_tristate '    Support BSD compression (module only)' CONFIG_ISDN_PPP_BSDCOMP m
+      dep_tristate '    Support BSD compression' CONFIG_ISDN_PPP_BSDCOMP $CONFIG_ISDN
    fi
 fi
 bool '  Support audio via ISDN' CONFIG_ISDN_AUDIO
@@ -23,7 +23,7 @@ fi
 mainmenu_option next_comment
 comment 'ISDN feature submodules'
    dep_tristate 'isdnloop support' CONFIG_ISDN_DRV_LOOP $CONFIG_ISDN
-   dep_tristate 'Support isdn diversion services' CONFIG_ISDN_DIVERSION $CONFIG_ISDN m
+   dep_tristate 'Support isdn diversion services' CONFIG_ISDN_DIVERSION $CONFIG_ISDN
 endmenu
 
 comment 'low-level hardware drivers'
@@ -77,6 +77,9 @@ if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ]; then
       fi
    fi
 fi
+
+dep_tristate 'Sedlbauer PCMCIA cards' CONFIG_HISAX_SEDLBAUER_CS $CONFIG_PCMCIA
+
 endmenu
 
 ### Active ISDN cards
@@ -92,7 +95,7 @@ dep_tristate       'IBM Active 2000 support' CONFIG_ISDN_DRV_ACT2000 $CONFIG_ISD
 bool               'Eicon active card support' CONFIG_ISDN_DRV_EICON
 if [ "$CONFIG_ISDN_DRV_EICON" != "n" ]; then
    if [ "$CONFIG_ISDN_DRV_EICON_OLD" != "y" ]; then
-      dep_tristate '  Build Eicon driver type standalone' CONFIG_ISDN_DRV_EICON_DIVAS $CONFIG_ISDN
+      dep_tristate '  Build Eicon driver type standalone' CONFIG_ISDN_DRV_EICON_DIVAS $CONFIG_ISDN $CONFIG_PCI
    fi
    if [ "$CONFIG_ISDN_DRV_EICON_DIVAS" != "y" ]; then
       dep_tristate '  Legacy Eicon driver' CONFIG_ISDN_DRV_EICON_OLD $CONFIG_ISDN
index d1ab6cd7bf7f31df3eedc9d303159f79b500a06a..fc08d752a4aa349eab68dd21121f747ecc2ee40e 100644 (file)
@@ -11,8 +11,7 @@ export-objs   := isdn_common.o
 # Multipart objects.
 
 list-multi     := isdn.o
-isdn-objs      := isdn_net.o isdn_tty.o isdn_cards.o isdn_v110.o \
-                  isdn_common.o
+isdn-objs      := isdn_net.o isdn_tty.o isdn_v110.o isdn_common.o
 
 # Optional parts of multipart objects.
 
index db19bf24564b5032094651937e41d6ae386c5a88..adffe94b188894405b18a4eedb0b7613d34db17e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: act2000.h,v 1.8 2000/11/12 16:32:06 kai Exp $
+/* $Id: act2000.h,v 1.8.6.2 2001/02/16 16:43:23 kai Exp $
  *
  * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
  *
index ad2471a171b772e5e3313895e063259312df16f5..ee126cb2cc5e34e7466002b1617f8bb06591c51a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: capi.c,v 1.9 2000/11/12 16:32:06 kai Exp $
+/* $Id: capi.c,v 1.9.6.1 2001/02/16 16:43:23 kai Exp $
  *
  * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
  *        CAPI encoder/decoder
@@ -124,7 +124,7 @@ actcapi_chkhdr(act2000_card * card, actcapi_msghdr *hdr)
                m->hdr.cmd.cmd = c; \
                m->hdr.cmd.subcmd = s; \
                m->hdr.msgnum = actcapi_nextsmsg(card); \
-       } \
+       } else m = NULL;\
 }
 
 #define ACTCAPI_CHKSKB if (!skb) { \
index 88e9b1aabf24c64599c4d283c0b8f8239c85a8d8..fb64fa877c9f11c90a78fb564d7806b4b9808158 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: capi.h,v 1.6 2000/11/12 16:32:06 kai Exp $
+/* $Id: capi.h,v 1.6.6.1 2001/02/16 16:43:23 kai Exp $
  *
  * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
  *
@@ -44,7 +44,7 @@ typedef struct actcapi_msgdsc {
        char *description;
 } actcapi_msgdsc;
 
-/* CAPI Adress */
+/* CAPI Address */
 typedef struct actcapi_addr {
        __u8 len;                            /* Length of element            */
        __u8 tnp;                            /* Type/Numbering Plan          */
index c602d945f27e0d3e220396ba94f7c5e79f30f02a..44e3db27a7df302e25738599e8e30120d35b2a0d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: module.c,v 1.14 2000/11/12 16:32:06 kai Exp $
+/* $Id: module.c,v 1.14.6.2 2000/12/18 22:14:10 kai Exp $
  *
  * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
  *
@@ -24,6 +24,7 @@
 #include "act2000.h"
 #include "act2000_isa.h"
 #include "capi.h"
+#include <linux/init.h>
 
 static unsigned short act2000_isa_ports[] =
 {
@@ -820,12 +821,7 @@ act2000_addcard(int bus, int port, int irq, char *id)
 
 #define DRIVERNAME "IBM Active 2000 ISDN driver"
 
-#ifdef MODULE
-#define act2000_init init_module
-#endif
-
-int
-act2000_init(void)
+static int __init act2000_init(void)
 {
         printk(KERN_INFO "%s\n", DRIVERNAME);
         if (!cards)
@@ -837,9 +833,7 @@ act2000_init(void)
         return 0;
 }
 
-#ifdef MODULE
-void
-cleanup_module(void)
+static void __exit act2000_exit(void)
 {
         act2000_card *card = cards;
         act2000_card *last;
@@ -858,34 +852,5 @@ cleanup_module(void)
         printk(KERN_INFO "%s unloaded\n", DRIVERNAME);
 }
 
-#else
-void
-act2000_setup(char *str, int *ints)
-{
-        int i, j, argc, port, irq, bus;
-       
-        argc = ints[0];
-        i = 1;
-        if (argc)
-                while (argc) {
-                        port = irq = -1;
-                       bus = 0;
-                        if (argc) {
-                                bus = ints[i];
-                                i++;
-                                argc--;
-                        }
-                        if (argc) {
-                                port = ints[i];
-                                i++;
-                                argc--;
-                        }
-                        if (argc) {
-                                irq = ints[i];
-                                i++;
-                                argc--;
-                        }
-                       act2000_addcard(bus, port, irq, act_id);
-               }
-}
-#endif
+module_init(act2000_init);
+module_exit(act2000_exit);
index 7ad7360d9598adc85c476c07648876c7dd94f86f..b3b74b2b08b7450a4e4a1eaa3b9d349940942c8d 100644 (file)
@@ -138,6 +138,8 @@ static dev_link_t *avmcs_attach(void)
     
     /* Initialize the dev_link_t structure */
     link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
+    if (!link)
+       return NULL;
     memset(link, 0, sizeof(struct dev_link_t));
     link->release.function = &avmcs_release;
     link->release.data = (u_long)link;
@@ -169,6 +171,8 @@ static dev_link_t *avmcs_attach(void)
 
     /* Allocate space for private device-specific data */
     local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
+    if (!local)
+       return NULL;
     memset(local, 0, sizeof(local_info_t));
     link->priv = local;
     
index 3feb65ce9fc03ab9cfbc1d0a5c863d4cf313b052..a925b5b8227bd4e77131df53c531b56749772b41 100644 (file)
@@ -1,11 +1,14 @@
 /*
- * $Id: b1.c,v 1.20 2000/11/23 20:45:14 kai Exp $
+ * $Id: b1.c,v 1.20.6.1 2001/02/13 11:43:29 kai Exp $
  * 
  * Common module for AVM B1 cards.
  * 
  * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
  * 
  * $Log: b1.c,v $
+ * Revision 1.20.6.1  2001/02/13 11:43:29  kai
+ * more compatility changes for 2.2.19
+ *
  * Revision 1.20  2000/11/23 20:45:14  kai
  * fixed module_init/exit stuff
  * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
 #include "capicmd.h"
 #include "capiutil.h"
 
-static char *revision = "$Revision: 1.20 $";
+static char *revision = "$Revision: 1.20.6.1 $";
 
 /* ------------------------------------------------------------- */
 
index 78cec8c9a30d54c5f8843d76d99fa74c04347427..c1e14602d603541615d0e452deef7e2a1608ed2c 100644 (file)
@@ -1,11 +1,14 @@
 /*
- * $Id: b1dma.c,v 1.11 2000/11/19 17:02:47 kai Exp $
+ * $Id: b1dma.c,v 1.11.6.1 2001/02/13 11:43:29 kai Exp $
  * 
  * Common module for AVM B1 cards that support dma with AMCC
  * 
  * (c) Copyright 2000 by Carsten Paeth (calle@calle.in-berlin.de)
  * 
  * $Log: b1dma.c,v $
+ * Revision 1.11.6.1  2001/02/13 11:43:29  kai
+ * more compatility changes for 2.2.19
+ *
  * Revision 1.11  2000/11/19 17:02:47  kai
  * compatibility cleanup - part 3
  *
@@ -62,7 +65,7 @@
 #include "capicmd.h"
 #include "capiutil.h"
 
-static char *revision = "$Revision: 1.11 $";
+static char *revision = "$Revision: 1.11.6.1 $";
 
 /* ------------------------------------------------------------- */
 
index 76e1faed3b74250f1a0c41263f77d4f33ed04de2..3036831f5ad57dd9499701257a7cf53ad79852ac 100644 (file)
@@ -1,11 +1,17 @@
 /*
- * $Id: b1isa.c,v 1.10 2000/11/23 20:45:14 kai Exp $
+ * $Id: b1isa.c,v 1.10.6.2 2001/02/16 16:43:23 kai Exp $
  * 
  * Module for AVM B1 ISA-card.
  * 
  * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
  * 
  * $Log: b1isa.c,v $
+ * Revision 1.10.6.2  2001/02/16 16:43:23  kai
+ * Changes from -ac16, little bug fixes, typos and the like
+ *
+ * Revision 1.10.6.1  2001/02/13 11:43:29  kai
+ * more compatility changes for 2.2.19
+ *
  * Revision 1.10  2000/11/23 20:45:14  kai
  * fixed module_init/exit stuff
  * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
@@ -24,7 +30,7 @@
  * - fixed problem with memory mapping if address is not aligned
  *
  * Revision 1.6  2000/01/25 14:37:39  calle
- * new message after successfull detection including card revision and
+ * new message after successful detection including card revision and
  * used resources.
  *
  * Revision 1.5  1999/11/05 16:38:01  calle
@@ -83,7 +89,7 @@
 #include "capilli.h"
 #include "avmcard.h"
 
-static char *revision = "$Revision: 1.10 $";
+static char *revision = "$Revision: 1.10.6.2 $";
 
 /* ------------------------------------------------------------- */
 
index bc4a27bd22ddab32fd208c784f3741a44f7ca365..e7552c30610734d83caf003db062402e586a576e 100644 (file)
@@ -1,11 +1,17 @@
 /*
- * $Id: b1pcmcia.c,v 1.12 2000/11/23 20:45:14 kai Exp $
+ * $Id: b1pcmcia.c,v 1.12.6.2 2001/02/16 16:43:23 kai Exp $
  * 
  * Module for AVM B1/M1/M2 PCMCIA-card.
  * 
  * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
  * 
  * $Log: b1pcmcia.c,v $
+ * Revision 1.12.6.2  2001/02/16 16:43:23  kai
+ * Changes from -ac16, little bug fixes, typos and the like
+ *
+ * Revision 1.12.6.1  2001/02/13 11:43:29  kai
+ * more compatility changes for 2.2.19
+ *
  * Revision 1.12  2000/11/23 20:45:14  kai
  * fixed module_init/exit stuff
  * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
@@ -33,7 +39,7 @@
  * - fixed problem with memory mapping if address is not aligned
  *
  * Revision 1.6  2000/01/25 14:37:39  calle
- * new message after successfull detection including card revision and
+ * new message after successful detection including card revision and
  * used resources.
  *
  * Revision 1.5  1999/11/05 16:38:01  calle
@@ -93,7 +99,7 @@
 #include "capilli.h"
 #include "avmcard.h"
 
-static char *revision = "$Revision: 1.12 $";
+static char *revision = "$Revision: 1.12.6.2 $";
 
 /* ------------------------------------------------------------- */
 
index 4c0b5f0eb27ba4510f72dae4efb99bd522d4315d..99e3c33a7ecd4e70384482d88f14df7a1952ac6d 100644 (file)
@@ -1,11 +1,17 @@
 /*
- * $Id: c4.c,v 1.20.6.1 2000/11/28 12:02:45 kai Exp $
+ * $Id: c4.c,v 1.20.6.3 2001/02/16 16:43:23 kai Exp $
  * 
  * Module for AVM C4 card.
  * 
  * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
  * 
  * $Log: c4.c,v $
+ * Revision 1.20.6.3  2001/02/16 16:43:23  kai
+ * Changes from -ac16, little bug fixes, typos and the like
+ *
+ * Revision 1.20.6.2  2001/02/13 11:43:29  kai
+ * more compatility changes for 2.2.19
+ *
  * Revision 1.20.6.1  2000/11/28 12:02:45  kai
  * MODULE_DEVICE_TABLE for 2.4
  *
@@ -75,7 +81,7 @@
  * - fixed problem with memory mapping if address is not aligned
  *
  * Revision 1.3  2000/01/25 14:37:39  calle
- * new message after successfull detection including card revision and
+ * new message after successful detection including card revision and
  * used resources.
  *
  * Revision 1.2  2000/01/21 20:52:58  keil
 #include "capilli.h"
 #include "avmcard.h"
 
-static char *revision = "$Revision: 1.20.6.1 $";
+static char *revision = "$Revision: 1.20.6.3 $";
 
 #undef CONFIG_C4_DEBUG
 #undef CONFIG_C4_POLLDEBUG
@@ -1331,7 +1337,6 @@ static struct capi_driver c4_driver = {
     add_card: 0, /* no add_card function */
 };
 
-
 static int ncards = 0;
 
 static int __init c4_init(void)
index 88f87ba2fb893eaec6f3852e982ed79949f683e5..49458c68ad87045ceb5d31aa8c1d09a47c5142a2 100644 (file)
@@ -1,11 +1,17 @@
 /*
- * $Id: capi.c,v 1.44.6.3 2000/12/17 22:45:08 kai Exp $
+ * $Id: capi.c,v 1.44.6.5 2001/02/13 11:43:29 kai Exp $
  *
  * CAPI 2.0 Interface for Linux
  *
  * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
  *
  * $Log: capi.c,v $
+ * Revision 1.44.6.5  2001/02/13 11:43:29  kai
+ * more compatility changes for 2.2.19
+ *
+ * Revision 1.44.6.4  2001/02/10 14:41:20  kai
+ * Changes from kernel tree
+ *
  * Revision 1.44.6.3  2000/12/17 22:45:08  kai
  * That's hopefully it for test13-4
  *
 #include "capifs.h"
 #endif
 
-static char *revision = "$Revision: 1.44.6.3 $";
+static char *revision = "$Revision: 1.44.6.5 $";
 
 MODULE_AUTHOR("Carsten Paeth (calle@calle.in-berlin.de)");
 
@@ -1317,7 +1323,6 @@ capinc_raw_open(struct inode *inode, struct file *file)
 #ifdef _DEBUG_REFCOUNT
        printk(KERN_DEBUG "capi_raw_open %d\n", GET_USE_COUNT(THIS_MODULE));
 #endif
-
        mp->datahandle = 0;
        mp->file = file;
        file->private_data = (void *)mp;
index b4bb90130b660f6348790ea6daaa8332dae64a4b..3a935bcf952515c5a293280c8a0101f7ca95a6c4 100644 (file)
@@ -1,11 +1,17 @@
 /*
- * $Id: capidrv.c,v 1.39 2000/11/23 20:45:14 kai Exp $
+ * $Id: capidrv.c,v 1.39.6.2 2001/02/13 11:43:29 kai Exp $
  *
  * ISDN4Linux Driver, using capi20 interface (kernelcapi)
  *
  * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
  *
  * $Log: capidrv.c,v $
+ * Revision 1.39.6.2  2001/02/13 11:43:29  kai
+ * more compatility changes for 2.2.19
+ *
+ * Revision 1.39.6.1  2001/02/10 14:41:20  kai
+ * Changes from kernel tree
+ *
  * Revision 1.39  2000/11/23 20:45:14  kai
  * fixed module_init/exit stuff
  * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
 #include "capicmd.h"
 #include "capidrv.h"
 
-static char *revision = "$Revision: 1.39 $";
+static char *revision = "$Revision: 1.39.6.2 $";
 static int debugmode = 0;
 
 MODULE_AUTHOR("Carsten Paeth <calle@calle.in-berlin.de>");
@@ -488,7 +494,7 @@ static inline __u8 cip2si2(__u16 cipval)
 }
 
 
-/* -------- controller managment ------------------------------------- */
+/* -------- controller management ------------------------------------- */
 
 static inline capidrv_contr *findcontrbydriverid(int driverid)
 {
index e40ef0bb1e4a54d02efa5e7fd5e3c38e61971344..8efacce5263995d373872ad544ce84b323988ccf 100644 (file)
@@ -1,11 +1,17 @@
 /*
- * $Id: capifs.c,v 1.14.6.1 2000/11/28 12:02:45 kai Exp $
+ * $Id: capifs.c,v 1.14.6.3 2001/02/13 11:43:29 kai Exp $
  * 
  * (c) Copyright 2000 by Carsten Paeth (calle@calle.de)
  *
  * Heavily based on devpts filesystem from H. Peter Anvin
  * 
  * $Log: capifs.c,v $
+ * Revision 1.14.6.3  2001/02/13 11:43:29  kai
+ * more compatility changes for 2.2.19
+ *
+ * Revision 1.14.6.2  2001/02/10 14:41:20  kai
+ * Changes from kernel tree
+ *
  * Revision 1.14.6.1  2000/11/28 12:02:45  kai
  * MODULE_DEVICE_TABLE for 2.4
  *
@@ -93,7 +99,7 @@
 
 MODULE_AUTHOR("Carsten Paeth <calle@calle.de>");
 
-static char *revision = "$Revision: 1.14.6.1 $";
+static char *revision = "$Revision: 1.14.6.3 $";
 
 struct capifs_ncci {
        struct inode *inode;
index 321212ecc6a5d96fd728623f4d23f5dee82b7ade..b4b55fb2ebb71ae001894603320c38024c216870 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: capiutil.c,v 1.13 2000/11/23 20:45:14 kai Exp $
+ * $Id: capiutil.c,v 1.13.6.1 2001/02/13 11:43:29 kai Exp $
  *
  * CAPI 2.0 convert capi message to capi message struct
  *
@@ -7,6 +7,9 @@
  * Rewritten for Linux 1996 by Carsten Paeth (calle@calle.in-berlin.de)
  *
  * $Log: capiutil.c,v $
+ * Revision 1.13.6.1  2001/02/13 11:43:29  kai
+ * more compatility changes for 2.2.19
+ *
  * Revision 1.13  2000/11/23 20:45:14  kai
  * fixed module_init/exit stuff
  * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
index 6f7bd4fd0609f13e4d9d5b05d823c7e36e42505c..e7f780080d3e932f5ee360e3baa894d30ede26ab 100644 (file)
@@ -1,11 +1,14 @@
 /*
- * $Id: kcapi.c,v 1.21.6.1 2000/12/10 23:39:19 kai Exp $
+ * $Id: kcapi.c,v 1.21.6.2 2001/02/13 11:43:29 kai Exp $
  * 
  * Kernel CAPI 2.0 Module
  * 
  * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
  * 
  * $Log: kcapi.c,v $
+ * Revision 1.21.6.2  2001/02/13 11:43:29  kai
+ * more compatility changes for 2.2.19
+ *
  * Revision 1.21.6.1  2000/12/10 23:39:19  kai
  * in 2.4 we don't have tq_scheduler anymore.
  * also add one supported card to hfc_pci.c
 #include <linux/b1lli.h>
 #endif
 
-static char *revision = "$Revision: 1.21.6.1 $";
+static char *revision = "$Revision: 1.21.6.2 $";
 
 /* ------------------------------------------------------------- */
 
@@ -814,7 +817,7 @@ static void controllercb_appl_released(struct capi_ctr * card, __u16 appl)
        }
 }
 /*
- * ncci managment
+ * ncci management
  */
 
 static void controllercb_new_ncci(struct capi_ctr * card,
index 5676dc9114b0c91f7be4f9aa15e3383d26cb9388..c17655b7e4ec770aaa1fe7ee01fbd2dcd416e7da 100644 (file)
@@ -1,11 +1,17 @@
 /*
- * $Id: t1isa.c,v 1.16 2000/11/23 20:45:14 kai Exp $
+ * $Id: t1isa.c,v 1.16.6.2 2001/02/16 16:43:24 kai Exp $
  * 
  * Module for AVM T1 HEMA-card.
  * 
  * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
  * 
  * $Log: t1isa.c,v $
+ * Revision 1.16.6.2  2001/02/16 16:43:24  kai
+ * Changes from -ac16, little bug fixes, typos and the like
+ *
+ * Revision 1.16.6.1  2001/02/13 11:43:29  kai
+ * more compatility changes for 2.2.19
+ *
  * Revision 1.16  2000/11/23 20:45:14  kai
  * fixed module_init/exit stuff
  * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
@@ -33,7 +39,7 @@
  * - fixed problem with memory mapping if address is not aligned
  *
  * Revision 1.9  2000/01/25 14:37:39  calle
- * new message after successfull detection including card revision and
+ * new message after successful detection including card revision and
  * used resources.
  *
  * Revision 1.8  1999/11/05 16:38:01  calle
 #include "capilli.h"
 #include "avmcard.h"
 
-static char *revision = "$Revision: 1.16 $";
+static char *revision = "$Revision: 1.16.6.2 $";
 
 /* ------------------------------------------------------------- */
 
index ac2f93994b05baf43281fcaccf87a5a1aed52a6a..93a45118d29af11bf23a4519ac84a43370831aed 100644 (file)
@@ -1,11 +1,14 @@
 /*
- * $Id: t1pci.c,v 1.13.6.1 2000/11/28 12:02:45 kai Exp $
+ * $Id: t1pci.c,v 1.13.6.2 2001/02/13 11:43:29 kai Exp $
  * 
  * Module for AVM T1 PCI-card.
  * 
  * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
  * 
  * $Log: t1pci.c,v $
+ * Revision 1.13.6.2  2001/02/13 11:43:29  kai
+ * more compatility changes for 2.2.19
+ *
  * Revision 1.13.6.1  2000/11/28 12:02:45  kai
  * MODULE_DEVICE_TABLE for 2.4
  *
@@ -88,7 +91,7 @@
 #include "capilli.h"
 #include "avmcard.h"
 
-static char *revision = "$Revision: 1.13.6.1 $";
+static char *revision = "$Revision: 1.13.6.2 $";
 
 #undef CONFIG_T1PCI_DEBUG
 #undef CONFIG_T1PCI_POLLDEBUG
index 0e0c439641dcafd5d829de3add0ac3317403a72b..c8a30954cd819fbd76ccca0cacd21bec07da5339 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: divert_init.c,v 1.5 2000/11/13 22:51:47 kai Exp $
+ * $Id: divert_init.c,v 1.5.6.2 2001/01/24 22:18:17 kai Exp $
  *
  * Module init for DSS1 diversion services for i4l.
  *
@@ -23,6 +23,7 @@
 
 #include <linux/module.h>
 #include <linux/version.h>
+#include <linux/init.h>
 #include "isdn_divert.h"
 
 /********************/
@@ -46,7 +47,7 @@ isdn_divert_if divert_if =
 /* Module interface code */
 /* no cmd line parms     */
 /*************************/
-int init_module(void)
+static int __init divert_init(void)
 { int i;
 
   if (divert_dev_init())
@@ -63,12 +64,12 @@ int init_module(void)
 #endif
   printk(KERN_INFO "dss1_divert module successfully installed\n");
   return(0);
-} /* init_module */
+}
 
 /**********************/
 /* Module deinit code */
 /**********************/
-void cleanup_module(void)
+static void __exit divert_exit(void)
 { int flags;
   int i;
 
@@ -89,6 +90,8 @@ void cleanup_module(void)
   deleterule(-1); /* delete all rules and free mem */
   deleteprocs();
   printk(KERN_INFO "dss1_divert module successfully removed \n");
-} /* cleanup_module */
+}
 
+module_init(divert_init);
+module_exit(divert_exit);
 
index 1970652637f386f0604ed857a6460f0f42daed83..47a27977525218e21edf90daac08b25ba599ccbc 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: isdn_divert.c,v 1.6.6.1 2001/02/07 11:31:31 kai Exp $
+ * $Id: isdn_divert.c,v 1.6.6.2 2001/02/16 16:43:25 kai Exp $
  *
  * DSS1 main diversion supplementary handling for i4l.
  *
@@ -290,7 +290,7 @@ int deflect_extern_action(u_char cmd, ulong callid, char *to_nr)
 /* insert a new rule before idx */
 /********************************/
 int insertrule(int idx, divert_rule *newrule)
-{ struct deflect_struc *ds,*ds1;
+{ struct deflect_struc *ds,*ds1=NULL;
   int flags;
 
   if (!(ds = (struct deflect_struc *) kmalloc(sizeof(struct deflect_struc), 
index d3b572c2de0fb8353f59336207fac397022dce42..799f721bf92e25d10bd6c2b381ea9c469e53ce13 100644 (file)
@@ -1,12 +1,5 @@
 
 /*
- *
- * Copyright (C) Eicon Technology Corporation, 2000.
- *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
- * Eicon File Revision :    1.15  
  *
  * 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
@@ -26,6 +19,7 @@
 
 
 #include <linux/config.h>
+#include <linux/init.h>
 #include <linux/fs.h>
 #undef N_DATA
 
 #include "adapter.h"
 #include "uxio.h"
 
+
 #ifdef MODULE
 #include "idi.h"
 void DIVA_DIDD_Write(DESCRIPTOR *, int);
 EXPORT_SYMBOL_NOVERS(DIVA_DIDD_Read);
 EXPORT_SYMBOL_NOVERS(DIVA_DIDD_Write);
 EXPORT_SYMBOL_NOVERS(DivasPrintf);
-#define Divas_init init_module
-#else
-#define Divas_init eicon_init
 #endif
 
-extern char *file_check(void);
-
 int DivasCardsDiscover(void);
 
-int
-Divas_init(void)
+static int __init
+divas_init(void)
 {
        printk(KERN_DEBUG "DIVA Server Driver - initialising\n");
        
-       printk(KERN_DEBUG "DIVA Server Driver - Version 2.0.15 (%s)\n",file_check());
+       printk(KERN_DEBUG "DIVA Server Driver - Version 2.0.16\n");
 
 
 #if !defined(CONFIG_PCI)
@@ -85,9 +75,8 @@ Divas_init(void)
     return 0;
 }
 
-#ifdef MODULE
-void
-cleanup_module(void)
+static void __exit
+divas_exit(void)
 {
        card_t *pCard;
        word wCardIndex;
@@ -156,15 +145,6 @@ cleanup_module(void)
        unregister_chrdev(Divas_major, "Divas");
 }
 
-void mod_inc_use_count(void)
-{
-       MOD_INC_USE_COUNT;
-}
-
-void mod_dec_use_count(void)
-{
-       MOD_DEC_USE_COUNT;
-}
-
-#endif
+module_init(divas_init);
+module_exit(divas_exit);
 
index 35f59701d8d4c9998e21371334b39eed96cda310..eb303c5f7f31876dc14f20eaf8bdd685243027e4 100644 (file)
@@ -12,10 +12,9 @@ export-objs  := Divas_mod.o eicon_mod.o
 
 list-multi     := eicon.o divas.o
 eicon-objs     := eicon_mod.o eicon_isa.o eicon_pci.o eicon_idi.o \
-                  eicon_io.o fcheck.o
+                  eicon_io.o
 divas-objs     := common.o idi.o bri.o pri.o log.o xlog.o kprintf.o fpga.o \
-                  fourbri.o lincfg.o linchr.o linsys.o linio.o fcheck.o \
-                  Divas_mod.o
+                  fourbri.o lincfg.o linchr.o linsys.o linio.o Divas_mod.o
 
 # Optional parts of multipart objects.
 
index cabba68beaceec95900b4233317ca329d818dfd9..e8a37498c32dad563fc119d32114d62e94dea9e0 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.7  
  *
  * This program is free software; you can redistribute it and/or modify
index 5a8afc11d2b79ae67120f56aa55b7ecac35f6dec..3d2ed85c364947da2b01b536a3f4f0bdcb51d07d 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.8  
  *
  * This program is free software; you can redistribute it and/or modify
@@ -63,6 +60,7 @@ void io_out_buffer(ADAPTER *a, void *adr, void *P, word length);
 void io_inc(ADAPTER *a, void *adr);
 
 static int diva_server_bri_test_int(card_t *card);
+static int bri_ISR (card_t* card);
 
 #define PLX_IOBASE             0
 #define        DIVAS_IOBASE    1
@@ -80,7 +78,6 @@ void UxCardPortIoOut(ux_diva_card_t *card, byte *base, int offset, byte);
 void UxCardPortIoOutW(ux_diva_card_t *card, byte *base, int offset, word);
 
 int DivasBRIInitPCI(card_t *card, dia_card_t *cfg);
-int bri_ISR (card_t* card);
 
 static
 int    diva_server_bri_reset(card_t *card)
@@ -361,7 +358,7 @@ int diva_server_bri_config(card_t *card, dia_config_t *config)
        UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->nt2);
 
        UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 10);
-       UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, 0);
+       UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->sig_flags);
 
        UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 11);
        UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->watchdog);
index 1f9ae145ebb3564651b68a1f1ad6aba703d94003..a5a35f3c8b293f8b8473d453f885b94bcb17f0ee 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.15  
  *
  * This program is free software; you can redistribute it and/or modify
@@ -101,7 +98,6 @@ void    DIVA_DIDD_Read( DESCRIPTOR *table, int tablelength )
        return;
 }
 
-static
 void   DIVA_DIDD_Write(DESCRIPTOR *table, int tablelength)
 {
         if (tablelength > sizeof(DIDD_Table))
index ea92f05adcb311887e5ef1386cdb827e8ec129bc..f039fd52a7e2ea5b5e4eca365dc41aeb83dff052 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.0  
  *
  * This program is free software; you can redistribute it and/or modify
index 93bd56ae98f3793709ce2eea85b69180e176a2a7..48c0596b944bb417eb6cacef4b197c7d3c35da79 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.0  
  *
  * This program is free software; you can redistribute it and/or modify
index 2fcd8349bc5c27c1b653884b9e42616da5d3db64..3ea401edcd6e5391b2aab1445e9bb7c401a27e47 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.5  
  *
  * This program is free software; you can redistribute it and/or modify
index ee7c1429e3d13773fa4440a25e90570445ef9fa4..35ab16e67284295a5021fcf867d3b48f7d527bd0 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.0  
  *
  * This program is free software; you can redistribute it and/or modify
index 1ac6a9bc6eb7e1e35e77dd59ca3f0d25f07c3229..618fda717c88454dc61ee8e85ff9b0b4cbae6a14 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.0  
  *
  * This program is free software; you can redistribute it and/or modify
index eefd379a5ff83f48eb94dd5d7e2d5cd8d66a979f..33ca39a56bbae13354210976c7aa3024f947d146 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: eicon.h,v 1.23 2000/06/21 11:28:42 armin Exp $
+/* $Id: eicon.h,v 1.23.6.2 2001/02/13 11:43:30 kai Exp $
  *
  * ISDN low-level module for Eicon active ISDN-Cards.
  *
@@ -151,7 +151,6 @@ typedef struct {
 #include <linux/isdn.h>
 #include <linux/isdnif.h>
 
-
 typedef struct {
   __u16 length __attribute__ ((packed)); /* length of data/parameter field */
   __u8  P[1];                          /* data/parameter field */
index 5b63311da145c72cc55d6bd7ff221178263b9825..9972d535b2ebf2e616b1012f05084a3442fdce54 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: eicon_idi.c,v 1.41 2000/08/12 18:00:47 armin Exp $
+/* $Id: eicon_idi.c,v 1.41.6.1 2001/02/10 14:44:09 kai Exp $
  *
  * ISDN lowlevel-module for Eicon active cards.
  *        IDI interface 
@@ -36,7 +36,7 @@
 
 #undef EICON_FULL_SERVICE_OKTETT
 
-char *eicon_idi_revision = "$Revision: 1.41 $";
+char *eicon_idi_revision = "$Revision: 1.41.6.1 $";
 
 eicon_manifbuf *manbuf;
 
@@ -2506,7 +2506,7 @@ idi_handle_ind(eicon_card *ccard, struct sk_buff *skb)
                                                case ISDN_PROTO_L2_TRANS:
                                                        idi_do_req(ccard, chan, N_CONNECT, 1);
                                                        break;
-                                               default:
+                                               default:;
                                                        /* On most incoming calls we use automatic connect */
                                                        /* idi_do_req(ccard, chan, N_CONNECT, 1); */
                                        }
index 6f294e8b77c12399561bb4b8b334d6b313ccc462..f21a045c247e431d454c59ecb341e75538512d7c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: eicon_io.c,v 1.13 2000/05/07 08:51:04 armin Exp $
+/* $Id: eicon_io.c,v 1.13.6.1 2001/02/16 09:09:50 armin Exp $
  *
  * ISDN low-level module for Eicon active ISDN-Cards.
  * Code for communicating with hardware.
@@ -6,7 +6,7 @@
  * Copyright 1999,2000  by Armin Schindler (mac@melware.de)
  * Copyright 1999,2000  Cytronics & Melware (info@melware.de)
  *
- * Thanks to   Eicon Technology GmbH & Co. oHG for 
+ * Thanks to   Eicon Networks for 
  *             documents, informations and hardware. 
  *
  * This program is free software; you can redistribute it and/or modify
index bd3d33e0ae0f25557080cac387e326f86001ab47..9bbdf68a3c4d6b3e113a47740ad2475929ae6c13 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: eicon_mod.c,v 1.37 2000/09/02 11:16:47 armin Exp $
+/* $Id: eicon_mod.c,v 1.37.6.4 2001/02/16 09:09:50 armin Exp $
  *
  * ISDN lowlevel-module for Eicon active cards.
  * 
@@ -6,7 +6,7 @@
  * Copyright 1998-2000 by Armin Schindler (mac@melware.de) 
  * Copyright 1999,2000 Cytronics & Melware (info@melware.de)
  * 
- * Thanks to    Eicon Technology GmbH & Co. oHG for
+ * Thanks to    Eicon Networks for
  *              documents, informations and hardware.
  *
  *             Deutsche Mailbox Saar-Lor-Lux GmbH
@@ -32,7 +32,7 @@
 
 #define DRIVERNAME "Eicon active ISDN driver"
 #define DRIVERRELEASE "2.0"
-#define DRIVERPATCH ".15"
+#define DRIVERPATCH ".16"
 
 
 #include <linux/config.h>
@@ -55,7 +55,7 @@
 static eicon_card *cards = (eicon_card *) NULL;   /* glob. var , contains
                                                      start of card-list   */
 
-static char *eicon_revision = "$Revision: 1.37 $";
+static char *eicon_revision = "$Revision: 1.37.6.4 $";
 
 extern char *eicon_pci_revision;
 extern char *eicon_isa_revision;
@@ -64,9 +64,6 @@ extern char *eicon_idi_revision;
 extern int do_ioctl(struct inode *pDivasInode, struct file *pDivasFile,
                        unsigned int command, unsigned long arg);
 extern void eicon_pci_init_conf(eicon_card *card);
-void mod_inc_use_count(void);
-void mod_dec_use_count(void);
-extern char *file_check(void);
 
 #ifdef MODULE
 #define MOD_USE_COUNT (GET_USE_COUNT (&__this_module))
@@ -377,7 +374,7 @@ eicon_command(eicon_card * card, isdn_ctrl * c)
 #ifdef MODULE
                                case EICON_IOCTL_FREEIT:
                                        while (MOD_USE_COUNT > 0) MOD_DEC_USE_COUNT;
-                                       mod_inc_use_count();
+                                       MOD_INC_USE_COUNT;
                                        return 0;
 #endif
                                case EICON_IOCTL_LOADPCI:
@@ -573,14 +570,10 @@ eicon_command(eicon_card * card, isdn_ctrl * c)
                        eicon_log(card, 1, "eicon CMD_GETSIL not implemented\n");
                        return 0;
                case ISDN_CMD_LOCK:
-#ifdef MODULE
-                       mod_inc_use_count();
-#endif
+                       MOD_INC_USE_COUNT;
                        return 0;
                case ISDN_CMD_UNLOCK:
-#ifdef MODULE
-                       mod_dec_use_count();
-#endif
+                       MOD_DEC_USE_COUNT;
                        return 0;
 #ifdef CONFIG_ISDN_TTY_FAX
                case ISDN_CMD_FAXCMD:
@@ -1177,8 +1170,7 @@ eicon_registercard(eicon_card * card)
         return 0;
 }
 
-#ifdef MODULE
-static void
+static void __exit
 unregister_card(eicon_card * card)
 {
         isdn_ctrl cmd;
@@ -1204,7 +1196,6 @@ unregister_card(eicon_card * card)
                        break;
         }
 }
-#endif /* MODULE */
 
 static void
 eicon_freecard(eicon_card *card) {
@@ -1311,11 +1302,7 @@ eicon_addcard(int Type, int membase, int irq, char *id, int card_id)
 }
 
 
-#ifdef MODULE
-#define eicon_init init_module
-#endif
-
-int
+static int __init
 eicon_init(void)
 {
        int card_count = 0;
@@ -1341,8 +1328,8 @@ eicon_init(void)
 #endif
        strcpy(tmprev, eicon_idi_revision);
        printk("%s\n", eicon_getrev(tmprev));
-        printk(KERN_INFO "%s Release: %s%s (%s)\n", DRIVERNAME,
-               DRIVERRELEASE, DRIVERPATCH, file_check());
+        printk(KERN_INFO "%s Release: %s%s\n", DRIVERNAME,
+               DRIVERRELEASE, DRIVERPATCH);
 
 #ifdef CONFIG_ISDN_DRV_EICON_ISA
 #ifdef CONFIG_MCA
@@ -1391,19 +1378,6 @@ eicon_init(void)
         return 0;
 }
 
-
-#ifdef MODULE
-
-void mod_inc_use_count(void)
-{
-        MOD_INC_USE_COUNT;
-}
-
-void mod_dec_use_count(void)
-{
-        MOD_DEC_USE_COUNT;
-}
-
 #ifdef CONFIG_ISDN_DRV_EICON_PCI
 void DIVA_DIDD_Write(DESCRIPTOR *, int);
 EXPORT_SYMBOL_NOVERS(DIVA_DIDD_Read);
@@ -1414,8 +1388,8 @@ int DivasCardNext;
 card_t DivasCards[1];
 #endif
 
-void
-cleanup_module(void)
+static void __exit
+eicon_exit(void)
 {
 #if CONFIG_PCI 
 #ifdef CONFIG_ISDN_DRV_EICON_PCI
@@ -1499,7 +1473,7 @@ cleanup_module(void)
         printk(KERN_INFO "%s unloaded\n", DRIVERNAME);
 }
 
-#else /* no module */
+#ifndef MODULE
 
 static int __init
 eicon_setup(char *line)
@@ -1712,3 +1686,5 @@ int eicon_mca_probe(int slot,  /* slot-nr where the card was detected         */
 #endif /* CONFIG_MCA */
 #endif /* CONFIG_ISDN_DRV_EICON_ISA */
 
+module_init(eicon_init);
+module_exit(eicon_exit);
index 6cb3bca6dccf421b07541cea29f25bc192d14a89..8d5b60f98b78ddad13b6715194934a2a6652d9aa 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: eicon_pci.c,v 1.15 2000/06/12 12:44:02 armin Exp $
+/* $Id: eicon_pci.c,v 1.15.6.2 2001/02/16 09:09:50 armin Exp $
  *
  * ISDN low-level module for Eicon active ISDN-Cards.
  * Hardware-specific code for PCI cards.
@@ -6,7 +6,7 @@
  * Copyright 1998-2000 by Armin Schindler (mac@melware.de)
  * Copyright 1999,2000 Cytronics & Melware (info@melware.de)
  *
- * Thanks to   Eicon Technology GmbH & Co. oHG for 
+ * Thanks to   Eicon Networks for 
  *             documents, informations and hardware. 
  *
  * This program is free software; you can redistribute it and/or modify
@@ -35,7 +35,7 @@
 #include "adapter.h"
 #include "uxio.h"
 
-char *eicon_pci_revision = "$Revision: 1.15 $";
+char *eicon_pci_revision = "$Revision: 1.15.6.2 $";
 
 #if CONFIG_PCI          /* intire stuff is only for PCI */
 #ifdef CONFIG_ISDN_DRV_EICON_PCI
@@ -86,7 +86,7 @@ int eicon_pci_find_card(char *ID)
                                printk(KERN_INFO "%s: DriverID='%s' CardID=%d\n",
                                        eicon_ctype_name[ctype], did, card_id);
                        }
-err:
+err:;
                }
                pCard++;
        }
diff --git a/drivers/isdn/eicon/fcheck.c b/drivers/isdn/eicon/fcheck.c
deleted file mode 100644 (file)
index c86f7d3..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* $Id: fcheck.c,v 1.3 2000/06/12 12:44:02 armin Exp $
- * 
- * (c) 2000 Cytronics & Melware
- *
- *  This file is (c) under GNU PUBLIC LICENSE
- *  For changes and modifications please read
- *  ../../../Documentation/isdn/README.eicon
- *
- *
- */
-#include <linux/kernel.h>
-
-char *
-file_check(void) {
-
-#ifdef FILECHECK
-#if FILECHECK == 0
-       return("verified");
-#endif
-#if FILECHECK == 1 
-       return("modified");
-#endif
-#if FILECHECK == 127 
-       return("verification failed");
-#endif
-#else
-       return("not verified");
-#endif
-}
-
index 5fe9817e0bca1bb929467a631ca89cd4b312a4fa..0efb16fed1d46bfd042b53885b192f1a720be3cc 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.7  
  *
  * This program is free software; you can redistribute it and/or modify
@@ -67,7 +64,7 @@ void mem_out_buffer(ADAPTER *a, void *adr, void *P, word length);
 void mem_inc(ADAPTER *a, void *adr);
 
 int Divas4BRIInitPCI(card_t *card, dia_card_t *cfg);
-int fourbri_ISR (card_t* card);
+static int fourbri_ISR (card_t* card);
 
 int FPGA_Download(word, dword, byte *, byte *, int);
 extern byte FPGA_Bytes[];
@@ -113,7 +110,7 @@ static int diva_server_4bri_config(card_t *card, dia_config_t *config)
 
        UxCardMemOut(card->hw, &shared[ 8], config->tei);
        UxCardMemOut(card->hw, &shared[ 9], config->nt2);
-       UxCardMemOut(card->hw, &shared[10], 0);
+       UxCardMemOut(card->hw, &shared[10], config->sig_flags);
        UxCardMemOut(card->hw, &shared[11], config->watchdog);
        UxCardMemOut(card->hw, &shared[12], config->permanent);
        UxCardMemOut(card->hw, &shared[13], config->x_interface);
@@ -561,23 +558,16 @@ int memcm(byte *dst, byte *src, dword dwLen)
 }*/
 
 
-int fourbri_ISR (card_t* card) 
+static int fourbri_ISR (card_t* card) 
 {
-       int served = 0;
        byte *ctl;
-       byte *reg = UxCardMemAttach(card->hw, DIVAS_REG_MEMORY);
 
-       if (UxCardPortIoIn(card->hw, reg, PLX9054_INTCSR) & 0x80) 
-       {
-               served = 1;
-               card->int_pend  += 1;
-               DivasDpcSchedule(); /* ISR DPC */
+       card->int_pend  += 1;
+       DivasDpcSchedule(); /* ISR DPC */
 
-               ctl = UxCardMemAttach(card->hw, DIVAS_CTL_MEMORY);
-               UxCardMemOut(card->hw, &ctl[MQ_BREG_IRQ_TEST], MQ_IRQ_REQ_OFF);
-               UxCardMemDetach(card->hw, ctl);
-       }
+       ctl = UxCardMemAttach(card->hw, DIVAS_CTL_MEMORY);
+       UxCardMemOut(card->hw, &ctl[MQ_BREG_IRQ_TEST], MQ_IRQ_REQ_OFF);
+       UxCardMemDetach(card->hw, ctl);
 
-       UxCardMemDetach(card->hw, reg);
-       return (served != 0);
+       return (1);
 }
index b5f21678e32a608df5d23a4f06db850961f8ebca..dda2f1ae07eb9d83eee5e57c14b15bd1bf69fa58 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.2  
  *
  * This program is free software; you can redistribute it and/or modify
index f9b8a0ee3de0c8d2f85248a9e943fdb8888b64dc..1bb57a77924a5363e6588ba2c4c5deb3ee81beec 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.8  
  *
  * This program is free software; you can redistribute it and/or modify
@@ -248,7 +245,6 @@ void        next_req(ADAPTER * a)
 /*
  * IDI request function for active cards
  */
-
 static
 void   request(card_t *card, ENTITY *e)
 {
@@ -256,6 +252,7 @@ void        request(card_t *card, ENTITY *e)
        int             i;
        int             ipl;
 
+
        if (card->log_types & DIVAS_LOG_IDI)
        {
                DivasLogIdi(card, e, TRUE);
index 5988cb8ed3282bd142736fc7e49b74fe8e07f426..eda433110984c5f5301230c13312d9d74fc068b0 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.0  
  *
  * This program is free software; you can redistribute it and/or modify
@@ -65,7 +62,7 @@ struct get_serial_s {
 struct postcall_s {
   word        command;         /* command = 0x0300 */
   word        dummy;           /* not used */
-  IDI_CALL    callback;        /* routine adress to call back */
+  IDI_CALL    callback;        /* routine address to call back */
   ENTITY      *contxt;         /* ptr to entity to use */
 };
 
index 3282b7fc5034059e618c2d08da5c7f50a24e8e28..f549a039c92e37a2b18742ef1c118186a6d20361 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.3  
  *
  * This program is free software; you can redistribute it and/or modify
index 3d2a8bfb11f43c0ad11f081b8869769217bd4055..8092da21a0b1a469cc0fc56f8de8b772b62db3b2 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.9  
  *
  * This program is free software; you can redistribute it and/or modify
index 9a3ccdac6ada35d42fce40051b0df4025b9896ca..a35979ac25b22d3464dd87b666f64ec06c4a53e0 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.12  
  *
  * This program is free software; you can redistribute it and/or modify
@@ -24,6 +21,8 @@
  *
  */
 
+#define __NO_VERSION__
+#include <linux/module.h>
 
 #include <linux/kernel.h>
 #include <linux/poll.h>
@@ -240,14 +239,12 @@ ssize_t do_read(struct file *pFile, char *pUserBuffer, size_t BufferSize, loff_t
 
        return 0;
 }
-int private_usage_count;
-extern void mod_inc_use_count(void);
-extern void mod_dec_use_count(void);
+static int private_usage_count;
 
 int do_open(struct inode *pInode, struct file *pFile)
 {
-#if defined(MODULE)
-       mod_inc_use_count();
+       MOD_INC_USE_COUNT;
+#ifdef MODULE
        private_usage_count++;
 #endif
        return 0;
@@ -255,8 +252,8 @@ int do_open(struct inode *pInode, struct file *pFile)
 
 int do_release(struct inode *pInode, struct file *pFile)
 {
-#if defined(MODULE)
-       mod_dec_use_count();
+       MOD_DEC_USE_COUNT;
+#ifdef MODULE
        private_usage_count--;
 #endif
        return 0;
@@ -267,8 +264,6 @@ void UnlockDivas(void)
        while (private_usage_count > 0)
        {
                private_usage_count--;
-#if defined(MODULE)
-               mod_dec_use_count();
-#endif
+               MOD_DEC_USE_COUNT;
        }
 }
index 0412eb6ba8ecfa01234e93a2aefbad159a622720..3d970abce38260643bba3633d434ac98a0df3934 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.16  
  *
  * This program is free software; you can redistribute it and/or modify
index 3f167ed7bbf64915003c5af76aadb5fd953d4e63..30de1cc6d9a9fac039d202748199940ade879bfb 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.10  
  *
  * This program is free software; you can redistribute it and/or modify
index 1d847f0a8ec44776db044297d7e5c70103d76f9e..30018d13d614d8acb536056c03039aa6e81b5aa5 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.5  
  *
  * This program is free software; you can redistribute it and/or modify
diff --git a/drivers/isdn/eicon/md5sums.asc b/drivers/isdn/eicon/md5sums.asc
deleted file mode 100644 (file)
index e7ae38c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# These are valid md5sums to detect modifications
-# in eicon driver files provided by Eicon Technology.
-# For changes and modifications in these files please
-# read ../../../Documentation/isdn/README.eicon
-# 
-34bfe8d08d337a97c699ac8326f1d9b6  common.c
-dbb92cba52db31ff8325a252b3f595c3  idi.c
-15687687ef82f099966ed42772001cd3  bri.c
-c3e3b720c3351b66635bd548195e29e8  pri.c
-b0a6d2ab49bcfcfd1825860f178a84b4  log.c
-673746176316b72271a09c0a27287a01  xlog.c
-07e1bbabdb4d69880db196ef31bfb241  kprintf.c
-b60b40ad630f26b7923369df95b4d1b9  fpga.c
-5013ecca0a38a8fcc4a61642754f2076  fourbri.c
-1501ae468a0c5eaab1e60720fa723a67  fcheck.c
-# end of md5sums
index 412a61faae2b6cb1955406332a8b1af88b95026a..0ba821ad2600335e427e6ba45982b2dc7c3a0ad9 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.2  
  *
  * This program is free software; you can redistribute it and/or modify
index e6e902f00159b74c5a43a324fdba5b992e6f51a4..f6fa6733dc04bae559c704cc17691750d3b74768 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.0  
  *
  * This program is free software; you can redistribute it and/or modify
index f01ad44990185e36aa6b577ccc7facf7d7ca241f..7634c7b7da943249d28cca3e837a85e8d3d43f93 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.0  
  *
  * This program is free software; you can redistribute it and/or modify
index a6a63945e0c7dc4e64500de073d454b540e6e3b7..ee15449742ac5e855e8f28780002b7d5c1811115 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.5  
  *
  * This program is free software; you can redistribute it and/or modify
@@ -82,7 +79,7 @@ void mem_out_buffer(ADAPTER *a, void *adr, void *P, word length);
 void mem_inc(ADAPTER *a, void *adr);
 
 int DivasPRIInitPCI(card_t *card, dia_card_t *cfg);
-int pri_ISR (card_t* card);
+static int pri_ISR (card_t* card);
 
 static int diva_server_reset(card_t *card)
 {
@@ -156,7 +153,7 @@ static int diva_server_config(card_t *card, dia_config_t *config)
 
        UxCardMemOut(card->hw, &shared[ 8], config->tei);
        UxCardMemOut(card->hw, &shared[ 9], config->nt2);
-       UxCardMemOut(card->hw, &shared[10], 0);
+       UxCardMemOut(card->hw, &shared[10], config->sig_flags);
        UxCardMemOut(card->hw, &shared[11], config->watchdog);
        UxCardMemOut(card->hw, &shared[12], config->permanent);
        UxCardMemOut(card->hw, &shared[13], config->x_interface);
@@ -509,7 +506,7 @@ int DivasPriInit(card_t *card, dia_card_t *cfg)
 }
 
 
-int pri_ISR (card_t* card) 
+static int pri_ISR (card_t* card) 
 {
        int served = 0;
        byte* cfg = UxCardMemAttach(card->hw, DIVAS_CFG_MEMORY);
index 0e636c547b058dea0ef9b57a56867371920a3fd5..e5141b856b0445e73bb06cf7c34136916ea806de 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.2  
  *
  * This program is free software; you can redistribute it and/or modify
index c15d93f96471e91c795e4411b87b1b170bc25ded..e3302830b7d509bbfa064f73142cc799eee84916 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.6  
  *
  * This program is free software; you can redistribute it and/or modify
index 282662cfca339a0343b7c2fd02d25a336e5af2bd..b9786601dc41234d5bd5e5d21a90a9b1236157e6 100644 (file)
@@ -3,9 +3,6 @@
  *
  * Copyright (C) Eicon Technology Corporation, 2000.
  *
- * This source file is supplied for the exclusive use with Eicon
- * Technology Corporation's range of DIVA Server Adapters.
- *
  * Eicon File Revision :    1.2  
  *
  * This program is free software; you can redistribute it and/or modify
index 72d990134401b4c491a46107801d67b8d5bc2aa0..ea4b41c91e5e7e95926341ab6f6ac0d499ddce2d 100644 (file)
@@ -34,6 +34,7 @@ hisax-objs-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o
 hisax-objs-$(CONFIG_HISAX_ASUSCOM) += asuscom.o isac.o arcofi.o hscx.o
 hisax-objs-$(CONFIG_HISAX_TELEINT) += teleint.o isac.o arcofi.o hfc_2bs0.o
 hisax-objs-$(CONFIG_HISAX_SEDLBAUER) += sedlbauer.o isac.o arcofi.o hscx.o isar.o
+hisax-objs-$(CONFIG_HISAX_SEDLBAUER_CS) += sedlbauer_cs.o
 hisax-objs-$(CONFIG_HISAX_SPORTSTER) += sportster.o isac.o arcofi.o hscx.o
 hisax-objs-$(CONFIG_HISAX_MIC) += mic.o isac.o arcofi.o hscx.o
 hisax-objs-$(CONFIG_HISAX_NETJET) += nj_s.o netjet.o isac.o arcofi.o
index 1a8c75ace33e6882b98326478cb644b71174edcd..95b2111e36683211905c15cf376316f96355cc4c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: amd7930.c,v 1.5 2000/11/24 17:05:37 kai Exp $
+/* $Id: amd7930.c,v 1.5.6.1 2001/02/16 16:43:25 kai Exp $
  *
  * HiSax ISDN driver - chip specific routines for AMD 7930
  *
@@ -14,7 +14,7 @@
  *
  * The code is unreliable enough to be consider alpha
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  * Advanced Micro Devices' Am79C30A is an ISDN/audio chip used in the
  * SparcStation 1+.  The chip provides microphone and speaker interfaces
@@ -94,7 +94,7 @@
 #include "rawhdlc.h"
 #include <linux/interrupt.h>
 
-static const char *amd7930_revision = "$Revision: 1.5 $";
+static const char *amd7930_revision = "$Revision: 1.5.6.1 $";
 
 #define RCV_BUFSIZE    1024    /* Size of raw receive buffer in bytes */
 #define RCV_BUFBLKS    4       /* Number of blocks to divide buffer into
index 4ff4d7a4fd9538c0e0383d8ad0fc3d0433ca2c1b..11154150db85aa873c161b1e30873f2db96efc78 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: arcofi.c,v 1.12 2000/11/25 17:01:00 kai Exp $
+/* $Id: arcofi.c,v 1.12.6.1 2001/02/16 16:43:25 kai Exp $
  *
  * arcofi.c   Ansteuerung ARCOFI 2165
  *
  * Author     Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
  
index d801571460543ab3afb1aefe6836f4882c7653e3..badf9f01000fe6e9e05bdbbe51fc748a72e9ff03 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: arcofi.h,v 1.6 2000/06/26 08:59:12 keil Exp $
+/* $Id: arcofi.h,v 1.6.6.1 2001/02/16 16:43:25 kai Exp $
  *
  * arcofi.h   Ansteuerung ARCOFI 2165
  *
  * Author     Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
  
index 01b668d8ef307e909f6d42f66ce743299d95bdc2..c14bc94009fb16adf691d6bf2789c43a20bfa0cd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: asuscom.c,v 1.11 2000/11/24 17:05:37 kai Exp $
+/* $Id: asuscom.c,v 1.11.6.1 2001/02/16 16:43:25 kai Exp $
  *
  * asuscom.c     low level stuff for ASUSCOM NETWORK INC. ISDNLink cards
  *
@@ -6,7 +6,7 @@
  *
  * Thanks to  ASUSCOM NETWORK INC. Taiwan and  Dynalink NL for informations
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
@@ -20,7 +20,7 @@
 
 extern const char *CardType[];
 
-const char *Asuscom_revision = "$Revision: 1.11 $";
+const char *Asuscom_revision = "$Revision: 1.11.6.1 $";
 
 #define byteout(addr,val) outb(val,addr)
 #define bytein(addr) inb(addr)
index e2765970ec63bb79d8e04147ccf65d62937185ba..66126727f50b92aa00a8a61114b189f168d287de 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: avm_a1.c,v 2.13 2000/11/24 17:05:37 kai Exp $
+/* $Id: avm_a1.c,v 2.13.6.1 2001/02/16 16:43:25 kai Exp $
  *
  * avm_a1.c     low level stuff for AVM A1 (Fritz) isdn cards
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #define __NO_VERSION__
@@ -15,7 +15,7 @@
 #include "isdnl1.h"
 
 extern const char *CardType[];
-static const char *avm_revision = "$Revision: 2.13 $";
+static const char *avm_revision = "$Revision: 2.13.6.1 $";
 
 #define         AVM_A1_STAT_ISAC       0x01
 #define         AVM_A1_STAT_HSCX       0x02
index 2f813402f5ba3f91e839722b46b64d86b6c4ccc3..f726af6366270dbc2fb07d36c6fd6f380bae3ba9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: avm_a1p.c,v 2.7 2000/11/24 17:05:37 kai Exp $
+/* $Id: avm_a1p.c,v 2.7.6.1 2001/02/16 16:43:25 kai Exp $
  *
  * avm_a1p.c    low level stuff for the following AVM cards:
  *              A1 PCMCIA
@@ -7,7 +7,7 @@
  *
  * Author       Carsten Paeth (calle@calle.in-berlin.de)
  *
- *  This file is (c) under GNU PUBLIC LICENSE
+ *  This file is (c) under GNU General Public License
  */
 #define __NO_VERSION__
 #include <linux/init.h>
@@ -53,7 +53,7 @@
 #define byteout(addr,val) outb(val,addr)
 #define bytein(addr) inb(addr)
 
-static const char *avm_revision = "$Revision: 2.7 $";
+static const char *avm_revision = "$Revision: 2.7.6.1 $";
 
 static inline u_char
 ReadISAC(struct IsdnCardState *cs, u_char offset)
index 79f96fe188233d591a979cb58365e3841037e05b..b895778db315821f73b9ef2d09831cbe663bf8db 100644 (file)
@@ -1,11 +1,11 @@
-/* $Id: avm_pci.c,v 1.22.6.2 2000/11/29 16:00:14 kai Exp $
+/* $Id: avm_pci.c,v 1.22.6.4 2001/02/16 16:43:25 kai Exp $
  *
  * avm_pci.c    low level stuff for AVM Fritz!PCI and ISA PnP isdn cards
  *              Thanks to AVM, Berlin for informations
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #define __NO_VERSION__
@@ -18,7 +18,7 @@
 #include <linux/interrupt.h>
 
 extern const char *CardType[];
-static const char *avm_pci_rev = "$Revision: 1.22.6.2 $";
+static const char *avm_pci_rev = "$Revision: 1.22.6.4 $";
 
 #define  AVM_FRITZ_PCI         1
 #define  AVM_FRITZ_PNP         2
index c8a4896a9f0272a2e0245e020773ee82e36ae530..39087f27ed0a036cfc1a29f3b237e244a923f7aa 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bkm_a4t.c,v 1.13.6.2 2000/11/29 16:00:14 kai Exp $
+/* $Id: bkm_a4t.c,v 1.13.6.4 2001/02/16 16:43:25 kai Exp $
  * bkm_a4t.c    low level stuff for T-Berkom A4T
  *              derived from the original file sedlbauer.c
  *              derived from the original file niccy.c
@@ -6,7 +6,7 @@
  *
  * Author       Roland Klabunde (R.Klabunde@Berkom.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
@@ -24,7 +24,7 @@
 
 extern const char *CardType[];
 
-const char *bkm_a4t_revision = "$Revision: 1.13.6.2 $";
+const char *bkm_a4t_revision = "$Revision: 1.13.6.4 $";
 
 
 static inline u_char
index 45011d356a7fc3f17b2ad35f3952ea4e301a72f0..20fdd2175f75e5d1ae468c121ce11404d014ab7d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bkm_a8.c,v 1.14.6.2 2000/11/29 16:00:14 kai Exp $
+/* $Id: bkm_a8.c,v 1.14.6.4 2001/02/16 16:43:25 kai Exp $
  * bkm_a8.c     low level stuff for Scitel Quadro (4*S0, passive)
  *              derived from the original file sedlbauer.c
  *              derived from the original file niccy.c
@@ -6,7 +6,7 @@
  *
  * Author       Roland Klabunde (R.Klabunde@Berkom.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #define __NO_VERSION__
@@ -27,7 +27,7 @@
 
 extern const char *CardType[];
 
-const char sct_quadro_revision[] = "$Revision: 1.14.6.2 $";
+const char sct_quadro_revision[] = "$Revision: 1.14.6.4 $";
 
 static const char *sct_quadro_subtypes[] =
 {
index ced19e429a28da77c52d71e28406dc832a0238fa..fe0b46f1f0ca8302c5294b858cd4516344f46d87 100644 (file)
@@ -1,9 +1,9 @@
-/* $Id: callc.c,v 2.51 2000/11/24 17:05:37 kai Exp $
+/* $Id: callc.c,v 2.51.6.1 2001/02/16 16:43:25 kai Exp $
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *              based on the teles driver from Jan den Ouden
  *
- *             This file is (c) under GNU PUBLIC LICENSE
+ *             This file is (c) under GNU General Public License
  *             For changes and modifications please read
  *             ../../../Documentation/isdn/HiSax.cert
  *
@@ -20,7 +20,7 @@
 #define MOD_USE_COUNT ( GET_USE_COUNT (&__this_module))
 #endif /* MODULE */
 
-const char *lli_revision = "$Revision: 2.51 $";
+const char *lli_revision = "$Revision: 2.51.6.1 $";
 
 extern struct IsdnCard cards[];
 extern int nrcards;
@@ -337,7 +337,7 @@ lli_go_active(struct FsmInst *fi, int event, void *arg)
  * RESUME
  */
 
-/* incomming call */
+/* incoming call */
 
 static void
 lli_deliver_call(struct FsmInst *fi, int event, void *arg)
@@ -1026,9 +1026,11 @@ dummy_pstack(struct PStack *st, int pr, void *arg) {
        printk(KERN_WARNING"call to dummy_pstack pr=%04x arg %lx\n", pr, (long)arg);
 }
 
-static void
+static int
 init_PStack(struct PStack **stp) {
        *stp = kmalloc(sizeof(struct PStack), GFP_ATOMIC);
+       if (!*stp)
+               return -ENOMEM;
        (*stp)->next = NULL;
        (*stp)->l1.l1l2 = dummy_pstack;
        (*stp)->l1.l1hw = dummy_pstack;
@@ -1041,16 +1043,20 @@ init_PStack(struct PStack **stp) {
        (*stp)->l3.l3l4 = dummy_pstack;
        (*stp)->lli.l4l3 = dummy_pstack;
        (*stp)->ma.layer = dummy_pstack;
+       return 0;
 }
 
-static void
+static int
 init_d_st(struct Channel *chanp)
 {
        struct PStack *st;
        struct IsdnCardState *cs = chanp->cs;
        char tmp[16];
+       int err;
 
-       init_PStack(&chanp->d_st);
+       err = init_PStack(&chanp->d_st);
+       if (err)
+               return err;
        st = chanp->d_st;
        st->next = NULL;
        HiSax_addlist(cs, st);
@@ -1075,6 +1081,8 @@ init_d_st(struct Channel *chanp)
        st->lli.userdata = chanp;
        st->lli.l2writewakeup = NULL;
        st->l3.l3l4 = dchan_l3l4;
+
+       return 0;
 }
 
 static void
@@ -1090,10 +1098,11 @@ callc_debug(struct FsmInst *fi, char *fmt, ...)
        va_end(args);
 }
 
-static void
+static int
 init_chan(int chan, struct IsdnCardState *csta)
 {
        struct Channel *chanp = csta->channel + chan;
+       int err;
 
        chanp->cs = csta;
        chanp->bcs = csta->bcs + chan;
@@ -1102,7 +1111,9 @@ init_chan(int chan, struct IsdnCardState *csta)
        chanp->debug = 0;
        chanp->Flags = 0;
        chanp->leased = 0;
-       init_PStack(&chanp->b_st);
+       err = init_PStack(&chanp->b_st);
+       if (err)
+               return err;
        chanp->b_st->l1.delay = DEFAULT_B_DELAY;
        chanp->fi.fsm = &callcfsm;
        chanp->fi.state = ST_NULL;
@@ -1112,31 +1123,41 @@ init_chan(int chan, struct IsdnCardState *csta)
        FsmInitTimer(&chanp->fi, &chanp->dial_timer);
        FsmInitTimer(&chanp->fi, &chanp->drel_timer);
        if (!chan || (test_bit(FLG_TWO_DCHAN, &csta->HW_Flags) && chan < 2)) {
-               init_d_st(chanp);
+               err = init_d_st(chanp);
+               if (err)
+                       return err;
        } else {
                chanp->d_st = csta->channel->d_st;
        }
        chanp->data_open = 0;
+       return 0;
 }
 
 int
 CallcNewChan(struct IsdnCardState *csta) {
-       int i;
+       int i, err;
 
        chancount += 2;
-       init_chan(0, csta);
-       init_chan(1, csta);
+       err = init_chan(0, csta);
+       if (err)
+               return err;
+       err = init_chan(1, csta);
+       if (err)
+               return err;
        printk(KERN_INFO "HiSax: 2 channels added\n");
 
-       for (i = 0; i < MAX_WAITING_CALLS; i++) 
-               init_chan(i+2,csta);
+       for (i = 0; i < MAX_WAITING_CALLS; i++) { 
+               err = init_chan(i+2,csta);
+               if (err)
+                       return err;
+       }
        printk(KERN_INFO "HiSax: MAX_WAITING_CALLS added\n");
        if (test_bit(FLG_PTP, &csta->channel->d_st->l2.flag)) {
                printk(KERN_INFO "LAYER2 WATCHING ESTABLISH\n");
                csta->channel->d_st->lli.l4l3(csta->channel->d_st,
                        DL_ESTABLISH | REQUEST, NULL);
        }
-       return (2);
+       return (0);
 }
 
 static void
index 64f3bccc8c577946c6e0b7a3cb1ee9337b24adff..a372362c43a5510cfdacc92db91fac53e520f2dc 100644 (file)
@@ -1,8 +1,8 @@
-/* $Id: cert.c,v 2.3 2000/06/26 08:59:12 keil Exp $
+/* $Id: cert.c,v 2.3.6.1 2001/02/16 16:43:25 kai Exp $
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- *             This file is (c) under GNU PUBLIC LICENSE
+ *             This file is (c) under GNU General Public License
  *             For changes and modifications please read
  *             ../../../Documentation/isdn/HiSax.cert
  *
index 6d0366cf268d5b4b61d3a4208609df656a2f7d4a..fc7b6ccafdbf84d802f616a41961c2d7eae0d585 100644 (file)
@@ -1,9 +1,9 @@
-/* $Id: config.c,v 2.57.6.6 2000/12/10 23:39:19 kai Exp $
+/* $Id: config.c,v 2.57.6.10 2001/02/16 16:43:25 kai Exp $
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *              based on the teles driver from Jan den Ouden
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #include <linux/types.h>
@@ -11,7 +11,6 @@
 #include <linux/timer.h>
 #include <linux/config.h>
 #include <linux/init.h>
-#include <linux/pci.h>
 #include "hisax.h"
 #include <linux/module.h>
 #include <linux/kernel_stat.h>
@@ -1195,7 +1194,12 @@ checkcard(int cardnr, char *id, int *busy_flag)
                return (0);
        }
        init_tei(cs, cs->protocol);
-       CallcNewChan(cs);
+       ret = CallcNewChan(cs);
+       if (ret) {
+               closecard(cardnr);
+               restore_flags(flags);
+               return 0;
+       }
        /* ISAR needs firmware download first */
        if (!test_bit(HW_ISAR, &cs->HW_Flags))
                ll_run(cs, 0);
@@ -1326,8 +1330,7 @@ HiSax_reportcard(int cardnr, int sel)
 #endif
 }
 
-int __init
-HiSax_init(void)
+static int __init HiSax_init(void)
 {
        int i,j;
        int nzproto = 0;
@@ -1497,11 +1500,7 @@ HiSax_init(void)
        }
 }
 
-#ifdef MODULE
-int init_module(void) { return HiSax_init(); }
-
-void
-cleanup_module(void)
+static void __exit HiSax_exit(void)
 {
        int cardnr = nrcards -1;
        long flags;
@@ -1518,7 +1517,6 @@ cleanup_module(void)
        restore_flags(flags);
        printk(KERN_INFO "HiSax module removed\n");
 }
-#endif
 
 #ifdef CONFIG_HISAX_ELSA
 int elsa_init_pcmcia(void *pcm_iob, int pcm_irq, int *busy_flag, int prot)
@@ -1707,6 +1705,8 @@ int __devinit hisax_init_pcmcia(void *pcm_iob, int *busy_flag, struct IsdnCard *
        return (ret);
 }
 
+#include <linux/pci.h>
+
 static struct pci_device_id hisax_pci_tbl[] __initdata = {
 #ifdef CONFIG_HISAX_FRITZPCI
        {PCI_VENDOR_ID_AVM,      PCI_DEVICE_ID_AVM_A1,          PCI_ANY_ID, PCI_ANY_ID},
@@ -1770,3 +1770,6 @@ static struct pci_device_id hisax_pci_tbl[] __initdata = {
 };
 
 MODULE_DEVICE_TABLE(pci, hisax_pci_tbl);
+
+module_init(HiSax_init);
+module_exit(HiSax_exit);
index 8967accde77660b455e554daca0b5b1037be8a35..0089c40fab78689d7729390a579ac0f72ab7e374 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: diva.c,v 1.25.6.2 2000/11/29 16:00:14 kai Exp $
+/* $Id: diva.c,v 1.25.6.4 2001/02/16 16:43:25 kai Exp $
  *
  * diva.c     low level stuff for Eicon.Diehl Diva Family ISDN cards
  *
  * Author     Karsten Keil (keil@isdn4linux.de)
  *
- *             This file is (c) under GNU PUBLIC LICENSE
+ *             This file is (c) under GNU General Public License
  *             For changes and modifications please read
  *             ../../../Documentation/isdn/HiSax.cert
  *
@@ -24,7 +24,7 @@
 
 extern const char *CardType[];
 
-const char *Diva_revision = "$Revision: 1.25.6.2 $";
+const char *Diva_revision = "$Revision: 1.25.6.4 $";
 
 #define byteout(addr,val) outb(val,addr)
 #define bytein(addr) inb(addr)
index ff20606dfb19672945581b7bf47c37b23d28dd2c..8f0a7f673f8c375cd1b5607493bda22679e32f0b 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: elsa.c,v 2.26.6.1 2000/11/28 12:02:46 kai Exp $
+/* $Id: elsa.c,v 2.26.6.3 2001/02/16 16:43:25 kai Exp $
  *
  * elsa.c     low level stuff for Elsa isdn cards
  *
  * Author     Karsten Keil (keil@isdn4linux.de)
  *
- *             This file is (c) under GNU PUBLIC LICENSE
+ *             This file is (c) under GNU General Public License
  *             For changes and modifications please read
  *             ../../../Documentation/isdn/HiSax.cert
  *
@@ -30,7 +30,7 @@
 
 extern const char *CardType[];
 
-const char *Elsa_revision = "$Revision: 2.26.6.1 $";
+const char *Elsa_revision = "$Revision: 2.26.6.3 $";
 const char *Elsa_Types[] =
 {"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro",
  "PCMCIA", "QS 1000", "QS 3000", "Microlink PCI", "QS 3000 PCI", 
index 74bedf8f6f1488813017a5594bdfffafcca8135f..0440e427870bbe78ace5f7d40a769c679a34d440 100644 (file)
@@ -1,8 +1,8 @@
-/* $Id: elsa_ser.c,v 2.10 2000/11/19 17:02:47 kai Exp $
+/* $Id: elsa_ser.c,v 2.10.6.1 2001/02/16 16:43:26 kai Exp $
  *
  * stuff for the serial modem on ELSA cards
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #include <linux/config.h>
index 28a7592309acb2393086bd872cde99a8ce8bb1b9..7b830ff72f5914ed9908af62ec667c5176395dad 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: fsm.c,v 1.14 2000/11/24 17:05:37 kai Exp $
+/* $Id: fsm.c,v 1.14.6.1 2001/02/16 16:43:26 kai Exp $
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *              based on the teles driver from Jan den Ouden
@@ -6,7 +6,7 @@
  * Thanks to    Jan den Ouden
  *              Fritz Elfert
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #define __NO_VERSION__
index 11db6b9eedf4130c7fce6ffc44f7f09bf9c3512b..72b28e666dc765642b2e0a5cfd9b657192d18ad5 100644 (file)
@@ -1,11 +1,11 @@
-/* $Id: gazel.c,v 2.11.6.2 2000/11/29 16:00:14 kai Exp $
+/* $Id: gazel.c,v 2.11.6.4 2001/02/16 16:43:26 kai Exp $
  *
  * gazel.c     low level stuff for Gazel isdn cards
  *
  * Author       BeWan Systems
  *              based on source code from Karsten Keil
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #include <linux/config.h>
@@ -19,7 +19,7 @@
 #include <linux/pci.h>
 
 extern const char *CardType[];
-const char *gazel_revision = "$Revision: 2.11.6.2 $";
+const char *gazel_revision = "$Revision: 2.11.6.4 $";
 
 #define R647      1
 #define R685      2
index 73c6fb448bd42c67ba37d0fe87867266d88fa515..5472c301c9618f7e733ca84324dbdd582622bd6d 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: hfc_2bds0.c,v 1.15 2000/11/24 17:05:37 kai Exp $
+/* $Id: hfc_2bds0.c,v 1.15.6.1 2001/02/16 16:43:26 kai Exp $
  *
  *  specific routines for CCD's HFC 2BDS0
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #define __NO_VERSION__
index 66cf0b11aa87163ffbf81c0da78d452a91058254..7bb8f4dee2096faf7e243672c0a6d1e0af68349f 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: hfc_2bds0.h,v 1.4 2000/06/26 08:59:12 keil Exp $
+/* $Id: hfc_2bds0.h,v 1.4.6.1 2001/02/16 16:43:27 kai Exp $
  *
  *  specific defines for CCD's HFC 2BDS0
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index 22e94c074f9fbf25948e9c79004377b036b45b04..7bb82c77ed95b6a9cc3da8136c7f63dc311bd37a 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: hfc_2bs0.c,v 1.17 2000/11/24 17:05:37 kai Exp $
+/* $Id: hfc_2bs0.c,v 1.17.6.1 2001/02/16 16:43:27 kai Exp $
  *
  *  specific routines for CCD's HFC 2BS0
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index dd978e781aa0373c23a5b892a9e462f2cf118f4b..f8f6391f328529c286f5d6ed0950191975303704 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: hfc_2bs0.h,v 1.3 2000/06/26 08:59:13 keil Exp $
+/* $Id: hfc_2bs0.h,v 1.3.6.1 2001/02/16 16:43:27 kai Exp $
  *
  *  specific defines for CCD's HFC 2BS0
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index 053dd90249567461ea3d744d187dc318107f5042..f1f50e536c7b6d83aed00adb839ec0b75e3af862 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hfc_pci.c,v 1.34.6.3 2000/12/10 23:39:19 kai Exp $
+/* $Id: hfc_pci.c,v 1.34.6.4 2001/02/13 10:33:58 kai Exp $
 
  * hfc_pci.c     low level driver for CCD´s hfc-pci based cards
  *
@@ -35,7 +35,7 @@
 
 extern const char *CardType[];
 
-static const char *hfcpci_revision = "$Revision: 1.34.6.3 $";
+static const char *hfcpci_revision = "$Revision: 1.34.6.4 $";
 
 /* table entry in the PCI devices list */
 typedef struct {
index 6c06186ae74a296aa05560a0a3f1249e52f35d34..e98557cc4502d7b2b008ab761a7ca141ae9e2406 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: hfcscard.c,v 1.8 2000/11/24 17:05:37 kai Exp $
+/* $Id: hfcscard.c,v 1.8.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * hfcscard.c     low level stuff for hfcs based cards (Teles3c, ACER P10)
  *
  * Author     Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
@@ -16,7 +16,7 @@
 
 extern const char *CardType[];
 
-static const char *hfcs_revision = "$Revision: 1.8 $";
+static const char *hfcs_revision = "$Revision: 1.8.6.1 $";
 
 static void
 hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs)
index 63c115d78126934d4031c4319a2641783d98e259..99026327a036163304343e60eb0f15585a1464cd 100644 (file)
@@ -1,8 +1,8 @@
-/* $Id: hisax.h,v 2.52.6.1 2000/12/06 16:59:19 kai Exp $
+/* $Id: hisax.h,v 2.52.6.3 2001/02/16 16:43:27 kai Exp $
  *
  *   Basic declarations, defines and prototypes
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #include <linux/config.h>
   #define l3dss1_process
   #include "l3dss1.h" 
   #undef  l3dss1_process
-#endif CONFIG_HISAX_EURO
+#endif /* CONFIG_HISAX_EURO */
 
 #ifdef CONFIG_HISAX_NI1
   #define l3ni1_process
   #include "l3ni1.h" 
   #undef  l3ni1_process
-#endif CONFIG_HISAX_NI1
+#endif /* CONFIG_HISAX_NI1 */
 
 #define MAX_DFRAME_LEN 260
 #define MAX_DFRAME_LEN_L1      300
@@ -318,10 +318,10 @@ struct PStack {
         { u_char uuuu; /* only as dummy */
 #ifdef CONFIG_HISAX_EURO
            dss1_stk_priv dss1; /* private dss1 data */
-#endif CONFIG_HISAX_EURO              
+#endif /* CONFIG_HISAX_EURO */              
 #ifdef CONFIG_HISAX_NI1
            ni1_stk_priv ni1; /* private ni1 data */
-#endif CONFIG_HISAX_NI1              
+#endif /* CONFIG_HISAX_NI1 */             
         } prot;
 };
 
@@ -342,10 +342,10 @@ struct l3_process {
         { u_char uuuu; /* only when euro not defined, avoiding empty union */
 #ifdef CONFIG_HISAX_EURO 
            dss1_proc_priv dss1; /* private dss1 data */
-#endif CONFIG_HISAX_EURO            
+#endif /* CONFIG_HISAX_EURO */            
 #ifdef CONFIG_HISAX_NI1
            ni1_proc_priv ni1; /* private ni1 data */
-#endif CONFIG_HISAX_NI1              
+#endif /* CONFIG_HISAX_NI1 */             
         } prot;
 };
 
index d8338bc26d8d0d538d6d58f3658a1ebf50cefa1c..a39e1321e894380033e3e29e89486c379188adb4 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: hscx.c,v 1.21 2000/11/24 17:05:37 kai Exp $
+/* $Id: hscx.c,v 1.21.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * hscx.c   HSCX specific routines
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index 32fc2708d1a97aa4464520eac82929737289d0db..bb1fd004d4757d063123e74e930184b14b698d42 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: hscx.h,v 1.6 2000/06/26 08:59:13 keil Exp $
+/* $Id: hscx.h,v 1.6.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * hscx.h   HSCX specific defines
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index c28f070e2e082ff96a35a182c1c103f0ed52a5a7..3824f4337c2adaf4fdba541e77e4b6e19b9df639 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hscx_irq.c,v 1.16 2000/11/19 17:02:47 kai Exp $
+/* $Id: hscx_irq.c,v 1.16.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * hscx_irq.c     low level b-channel stuff for Siemens HSCX
  *
@@ -6,7 +6,7 @@
  *
  * This is an include file for fast inline IRQ stuff
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index fb449592af0b8ab804608746bd7e2e5ca5dc06d4..f7179bb75aa5e50d192e0bffd737f5b7740cd258 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: icc.c,v 1.5 2000/11/24 17:05:37 kai Exp $
+// $Id: icc.c,v 1.5.6.1 2001/02/16 16:43:27 kai Exp $
 //-----------------------------------------------------------------------------
 //
 // ICC specific routines
@@ -7,10 +7,10 @@
 //              www.traverse.com.au
 //
 // 1999.6.25 Initial implementation of routines for Siemens ISDN
-// Communication Controler PEB 2070 based on the ISAC routines
+// Communication Controller PEB 2070 based on the ISAC routines
 // written by Karsten Keil.
 //
-// This file is (c) under GNU PUBLIC LICENSE
+// This file is (c) under GNU General Public License
 //
 //-----------------------------------------------------------------------------
 
index b3ecbdcf821182958ef7b7e2d604d42b5e0057fc..a28d8ef407df2283a226d3969cb8807f90e2ffa9 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: icc.h,v 1.2 2000/06/26 08:59:13 keil Exp $
+// $Id: icc.h,v 1.2.6.1 2001/02/16 16:43:27 kai Exp $
 //-----------------------------------------------------------------------------
 //
 // ICC specific routines
@@ -7,10 +7,10 @@
 //              www.traverse.com.au
 //
 // 1999.7.14 Initial implementation of routines for Siemens ISDN 
-// Communication Controler PEB 2070 based on the ISAC routines 
+// Communication Controller PEB 2070 based on the ISAC routines 
 // written by Karsten Keil.
 //
-// This file is (c) under GNU PUBLIC LICENSE
+// This file is (c) under GNU General Public License
 //
 //-----------------------------------------------------------------------------
 
index eff327f9e4fba9b456656c1323fd9947dd6c15f8..a46840be6677fdb86118daf336d93ca9ec22c9d1 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: ipac.h,v 1.5 2000/06/26 08:59:13 keil Exp $
+/* $Id: ipac.h,v 1.5.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * ipac.h   IPAC specific defines
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index ae68aea1b8b211cbd50bbe7d9f7ac33e9a6ba44d..3e6c9525a705de592920f19c7dcab05684bdb2c3 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: isac.c,v 1.28 2000/11/24 17:05:37 kai Exp $
+/* $Id: isac.c,v 1.28.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * isac.c   ISAC specific routines
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- *             This file is (c) under GNU PUBLIC LICENSE
+ *             This file is (c) under GNU General Public License
  *             For changes and modifications please read
  *             ../../../Documentation/isdn/HiSax.cert
  */
@@ -445,7 +445,7 @@ isac_interrupt(struct IsdnCardState *cs, u_char val)
                                if (cs->debug & L1_DEB_MONITOR)
                                        debugl1(cs, "ISAC %02x -> MOX1", cs->dc.isac.mon_tx[cs->dc.isac.mon_txp -1]);
                        }
-                     AfterMOX1:
+                     AfterMOX1:;
 #endif
                }
        }
index 751e8de1d59ebfec394145ac4bedb367aeafa7d4..928439f815ea050a67e82451f4765e06f109e48f 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: isac.h,v 1.7 2000/06/26 08:59:13 keil Exp $
+/* $Id: isac.h,v 1.7.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * isac.h   ISAC specific defines
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index 27987e2c1eb0b40677730bd1013be619d299d753..d906519013ef1937f2207d52a0711203cb97ff87 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: isar.c,v 1.17 2000/11/24 17:05:37 kai Exp $
+/* $Id: isar.c,v 1.17.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * isar.c   ISAR (Siemens PSB 7110) specific routines
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index d3462183402d630959cf74649b7075932ae24598..509652784df074b9b2de4f041b096085861909ba 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: isar.h,v 1.9 2000/06/26 08:59:13 keil Exp $
+/* $Id: isar.h,v 1.9.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * isar.h   ISAR (Siemens PSB 7110) specific defines
  *
  * Author Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
  
index 5506b956f8acdf97a2bcb144c0f094bfd46bfa39..3d02ba76c42b27671e56d23033901fb5e617dda0 100644 (file)
@@ -1,11 +1,11 @@
-/* $Id: isdnl1.c,v 2.41.6.1 2000/12/10 22:01:04 kai Exp $
+/* $Id: isdnl1.c,v 2.41.6.2 2001/02/16 16:43:27 kai Exp $
  *
  * isdnl1.c     common low level stuff for Siemens Chipsetbased isdn cards
  *              based on the teles driver from Jan den Ouden
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- *             This file is (c) under GNU PUBLIC LICENSE
+ *             This file is (c) under GNU General Public License
  *             For changes and modifications please read
  *             ../../../Documentation/isdn/HiSax.cert
  *
@@ -15,7 +15,7 @@
  *
  */
 
-const char *l1_revision = "$Revision: 2.41.6.1 $";
+const char *l1_revision = "$Revision: 2.41.6.2 $";
 
 #define __NO_VERSION__
 #include <linux/init.h>
index 040a95aa5d36383ee3f3911e663ea4f2504b90c2..435638de1e7635a06e9cdebcb0b5f923b8fee9af 100644 (file)
@@ -1,8 +1,8 @@
-/* $Id: isdnl1.h,v 2.9 2000/06/26 08:59:13 keil Exp $
+/* $Id: isdnl1.h,v 2.9.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * Layer 1 defines
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index 59d461c0b16c85c0404cce1a49720453a0504c9b..a586b3b4eee4f8a1f8a290a50698859d151b51ce 100644 (file)
@@ -1,9 +1,9 @@
-/* $Id: isdnl2.c,v 2.25 2000/11/24 17:05:38 kai Exp $
+/* $Id: isdnl2.c,v 2.25.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *              based on the teles driver from Jan den Ouden
  *
- *             This file is (c) under GNU PUBLIC LICENSE
+ *             This file is (c) under GNU General Public License
  *             For changes and modifications please read
  *             ../../../Documentation/isdn/HiSax.cert
  *
@@ -16,7 +16,7 @@
 #include "hisax.h"
 #include "isdnl2.h"
 
-const char *l2_revision = "$Revision: 2.25 $";
+const char *l2_revision = "$Revision: 2.25.6.1 $";
 
 static void l2m_debug(struct FsmInst *fi, char *fmt, ...);
 
index 28e753c8c3741144fc62c70e0c9a869bc1e52423..6a73943f65dfe153a2a5218857c171419116dc47 100644 (file)
@@ -1,8 +1,8 @@
-/* $Id: isdnl2.h,v 1.3 2000/06/26 08:59:13 keil Exp $
+/* $Id: isdnl2.h,v 1.3.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * Layer 2 defines
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index 1c2ab1042d4b909e89a5b2982139fdc37378c1ef..d3e5f7965b111c1c074351d7eb2bf00dfe1f5e54 100644 (file)
@@ -1,9 +1,9 @@
-/* $Id: isdnl3.c,v 2.17 2000/11/24 17:05:38 kai Exp $
+/* $Id: isdnl3.c,v 2.17.6.2 2001/02/16 16:43:27 kai Exp $
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *              based on the teles driver from Jan den Ouden
  *
- *             This file is (c) under GNU PUBLIC LICENSE
+ *             This file is (c) under GNU General Public License
  *             For changes and modifications please read
  *             ../../../Documentation/isdn/HiSax.cert
  *
@@ -18,7 +18,7 @@
 #include "isdnl3.h"
 #include <linux/config.h>
 
-const char *l3_revision = "$Revision: 2.17 $";
+const char *l3_revision = "$Revision: 2.17.6.2 $";
 
 static struct Fsm l3fsm;
 
index 6027e1822efad866ec01d0b817839ef7971c4f95..be25d32ba80922d48c9a971d38ce50da0ec705aa 100644 (file)
@@ -1,6 +1,6 @@
-/* $Id: isdnl3.h,v 2.6 2000/06/26 08:59:13 keil Exp $
+/* $Id: isdnl3.h,v 2.6.6.1 2001/02/16 16:43:27 kai Exp $
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index e703ecf662ddae16296517eaa4f9f1c737a9713c..1b986d0b37e5e37d536b9d9c977ccef3603a4314 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: isurf.c,v 1.10 2000/11/24 17:05:38 kai Exp $
+/* $Id: isurf.c,v 1.10.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * isurf.c  low level stuff for Siemens I-Surf/I-Talk cards
  *
  * Author     Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
@@ -17,7 +17,7 @@
 
 extern const char *CardType[];
 
-static const char *ISurf_revision = "$Revision: 1.10 $";
+static const char *ISurf_revision = "$Revision: 1.10.6.1 $";
 
 #define byteout(addr,val) outb(val,addr)
 #define bytein(addr) inb(addr)
index 11e5bd316cbb10f4bb33647ef313d7f3f63af4b1..770b94268522cdb733a9d180d6133a8ecd404d43 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ix1_micro.c,v 2.10 2000/11/24 17:05:38 kai Exp $
+/* $Id: ix1_micro.c,v 2.10.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * ix1_micro.c  low level stuff for ITK ix1-micro Rev.2 isdn cards
  *              derived from the original file teles3.c from Karsten Keil
@@ -14,7 +14,7 @@
 
 /*
    For the modification done by the author the following terms and conditions
-   apply (GNU PUBLIC LICENSE)
+   apply (GNU General Public License)
 
 
    This program is free software; you can redistribute it and/or modify
@@ -50,7 +50,7 @@
 #include "isdnl1.h"
 
 extern const char *CardType[];
-const char *ix1_revision = "$Revision: 2.10 $";
+const char *ix1_revision = "$Revision: 2.10.6.1 $";
 
 #define byteout(addr,val) outb(val,addr)
 #define bytein(addr) inb(addr)
index fc96b6e2e2128739b93baba85f232852706cce60..706b0855cb34f9c89e47d6c21575eb23fecfb57e 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: jade.c,v 1.6 2000/11/24 17:05:38 kai Exp $
+/* $Id: jade.c,v 1.6.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * jade.c   JADE stuff (derived from original hscx.c)
  *
  * Author   Roland Klabunde (R.Klabunde@Berkom.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index b94b968e42bb3d5c5d23b7eee9639a71cba82f22..81eb8ddf258274ad3183ad6f904acf597d5b07ac 100644 (file)
@@ -1,9 +1,9 @@
-/* $Id: jade.h,v 1.3 2000/06/26 08:59:14 keil Exp $
+/* $Id: jade.h,v 1.3.6.1 2001/02/16 16:43:27 kai Exp $
  * jade.h   JADE specific defines
  *
  * Author   Roland Klabunde (R.Klabunde@Berkom.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index d9d289886fc17ffb64fbdc1739d8f99a06481cb0..4969669b92b83c1a92a652df37e0cb6d4dbb7a89 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: jade_irq.c,v 1.5 2000/11/19 17:02:48 kai Exp $
+/* $Id: jade_irq.c,v 1.5.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * jade_irq.c   Low level JADE IRQ stuff (derived from original hscx_irq.c)
  *
  * Author   Roland Klabunde (R.Klabunde@Berkom.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index fcb34f415b1df89036735278b649f0c4b7e73651..6e05b5a60bc9b1d5982415f2541108b3de9d7603 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: l3_1tr6.c,v 2.13 2000/11/19 17:02:48 kai Exp $
+/* $Id: l3_1tr6.c,v 2.13.6.1 2001/02/16 16:43:27 kai Exp $
  *
  *  German 1TR6 D-channel protocol
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
- *             This file is (c) under GNU PUBLIC LICENSE
+ *             This file is (c) under GNU General Public License
  *             For changes and modifications please read
  *             ../../../Documentation/isdn/HiSax.cert
  *
@@ -17,7 +17,7 @@
 #include <linux/ctype.h>
 
 extern char *HiSax_getrev(const char *revision);
-const char *l3_1tr6_revision = "$Revision: 2.13 $";
+const char *l3_1tr6_revision = "$Revision: 2.13.6.1 $";
 
 #define MsgHead(ptr, cref, mty, dis) \
        *ptr++ = dis; \
index f9d46f659e625ca36c761a7b79ef97d15de7642c..cfb6d7326d9dc7a0ad77fc81646169b11d658e94 100644 (file)
@@ -1,8 +1,8 @@
-/* $Id: l3_1tr6.h,v 2.2 2000/06/26 08:59:14 keil Exp $
+/* $Id: l3_1tr6.h,v 2.2.6.1 2001/02/16 16:43:27 kai Exp $
  *
  *  German 1TR6 D-channel protocol defines
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #ifndef l3_1tr6
index cc714ce3dbc865a5b8afb7d94a9dee1c59092063..2ab9ed940e95eaa67796bfe98acaf5f115e53a69 100644 (file)
@@ -1,11 +1,11 @@
-/* $Id: l3dss1.c,v 2.30 2000/11/19 17:02:48 kai Exp $
+/* $Id: l3dss1.c,v 2.30.6.1 2001/02/16 16:43:27 kai Exp $
  *
  * EURO/DSS1 D-channel protocol
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *              based on the teles driver from Jan den Ouden
  *
- *             This file is (c) under GNU PUBLIC LICENSE
+ *             This file is (c) under GNU General Public License
  *             For changes and modifications please read
  *             ../../../Documentation/isdn/HiSax.cert
  *
@@ -22,7 +22,7 @@
 #include <linux/config.h>
 
 extern char *HiSax_getrev(const char *revision);
-const char *dss1_revision = "$Revision: 2.30 $";
+const char *dss1_revision = "$Revision: 2.30.6.1 $";
 
 #define EXT_BEARER_CAPS 1
 
@@ -426,9 +426,9 @@ l3dss1_parse_facility(struct PStack *st, struct l3_process *pc,
 #undef FOO1
 
                        }
-#else  not HISAX_DE_AOC
+#else  /* not HISAX_DE_AOC */
                         l3_debug(st, "invoke break");
-#endif not HISAX_DE_AOC 
+#endif /* not HISAX_DE_AOC */
                        break;
                case 2: /* return result */
                         /* if no process available handle separately */ 
@@ -438,12 +438,12 @@ l3dss1_parse_facility(struct PStack *st, struct l3_process *pc,
                            return; 
                          }   
                         if ((pc->prot.dss1.invoke_id) && (pc->prot.dss1.invoke_id == id))
-                          { /* Diversion successfull */
+                          { /* Diversion successful */
                             free_invoke_id(st,pc->prot.dss1.invoke_id);
                             pc->prot.dss1.remote_result = 0; /* success */     
                             pc->prot.dss1.invoke_id = 0;
                             pc->redir_result = pc->prot.dss1.remote_result; 
-                            st->l3.l3l4(st, CC_REDIR | INDICATION, pc);                                  } /* Diversion successfull */
+                            st->l3.l3l4(st, CC_REDIR | INDICATION, pc);                                  } /* Diversion successful */
                         else
                           l3_debug(st,"return error unknown identifier");
                        break;
@@ -2112,7 +2112,7 @@ static void l3dss1_redir_req(struct l3_process *pc, u_char pr, void *arg)
         MsgHead(p, pc->callref, MT_FACILITY);
 
         for (subp = pc->chan->setup.phone; (*subp) && (*subp != '.'); subp++) len_phone++; /* len of phone number */
-        if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subadress element */ 
+        if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subaddress element */ 
 
        *p++ = 0x1c;   /* Facility info element */
         *p++ = len_phone + len_sub + 2 + 2 + 8 + 3 + 3; /* length of element */
@@ -2138,7 +2138,7 @@ static void l3dss1_redir_req(struct l3_process *pc, u_char pr, void *arg)
         *p++ = pc->chan->setup.phone[l];
 
         if (len_sub)
-         { *p++ = 0x04; /* called party subadress */
+         { *p++ = 0x04; /* called party subaddress */
             *p++ = len_sub - 2;
             while (*subp) *p++ = *subp++;
           }
index 4913f17bd46ed04755a824bca0f53c1597e6ff70..76207660c0102bc0117436235ffa2b7a06d4f856 100644 (file)
@@ -1,8 +1,8 @@
-/* $Id: l3dss1.h,v 1.10 2000/06/26 08:59:14 keil Exp $
+/* $Id: l3dss1.h,v 1.10.6.1 2001/02/16 16:43:28 kai Exp $
  *
  *  DSS1 (Euro) D-channel protocol defines
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index 4440f44e7bd71822f3da795fe661e88c1caad7e7..86245b474d086d06cab3221a59c318f783f980cb 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: l3ni1.c,v 2.5.6.1 2000/12/06 16:59:19 kai Exp $
+// $Id: l3ni1.c,v 2.5.6.2 2001/02/16 16:43:28 kai Exp $
 //
 //-----------------------------------------------------------------------------
 //
@@ -16,7 +16,7 @@
 // Will Scales - beta tester extraordinaire
 // Brett Whittacre - beta tester and remote devel system in Vegas
 //
-// This file is (c) under GNU PUBLIC LICENSE
+// This file is (c) under GNU General Public License
 //
 //-----------------------------------------------------------------------------
 #define __NO_VERSION__
@@ -26,7 +26,7 @@
 #include <linux/ctype.h>
 
 extern char *HiSax_getrev(const char *revision);
-const char *ni1_revision = "$Revision: 2.5.6.1 $";
+const char *ni1_revision = "$Revision: 2.5.6.2 $";
 
 #define EXT_BEARER_CAPS 1
 
@@ -372,12 +372,12 @@ l3ni1_parse_facility(struct PStack *st, struct l3_process *pc,
                            return; 
                          }   
                         if ((pc->prot.ni1.invoke_id) && (pc->prot.ni1.invoke_id == id))
-                          { /* Diversion successfull */
+                          { /* Diversion successful */
                             free_invoke_id(st,pc->prot.ni1.invoke_id);
                             pc->prot.ni1.remote_result = 0; /* success */     
                             pc->prot.ni1.invoke_id = 0;
                             pc->redir_result = pc->prot.ni1.remote_result; 
-                            st->l3.l3l4(st, CC_REDIR | INDICATION, pc);                                  } /* Diversion successfull */
+                            st->l3.l3l4(st, CC_REDIR | INDICATION, pc);                                  } /* Diversion successful */
                         else
                           l3_debug(st,"return error unknown identifier");
                        break;
@@ -1973,7 +1973,7 @@ static void l3ni1_redir_req(struct l3_process *pc, u_char pr, void *arg)
         MsgHead(p, pc->callref, MT_FACILITY);
 
         for (subp = pc->chan->setup.phone; (*subp) && (*subp != '.'); subp++) len_phone++; /* len of phone number */
-        if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subadress element */ 
+        if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subaddress element */ 
 
        *p++ = 0x1c;   /* Facility info element */
         *p++ = len_phone + len_sub + 2 + 2 + 8 + 3 + 3; /* length of element */
@@ -1999,7 +1999,7 @@ static void l3ni1_redir_req(struct l3_process *pc, u_char pr, void *arg)
         *p++ = pc->chan->setup.phone[l];
 
         if (len_sub)
-         { *p++ = 0x04; /* called party subadress */
+         { *p++ = 0x04; /* called party subaddress */
             *p++ = len_sub - 2;
             while (*subp) *p++ = *subp++;
           }
index 9fd7ce86a1b4625f3ea2ff5d8b10111bd5ab80b3..57410c1514a54e98abc0745ddd99c87e94b6a816 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: l3ni1.h,v 2.3 2000/11/16 13:50:43 keil Exp $
+// $Id: l3ni1.h,v 2.3.6.1 2001/02/16 16:43:28 kai Exp $
 //-----------------------------------------------------------------------------
 //
 // NI1 D-channel protocol
@@ -12,7 +12,7 @@
 // code provided by Ragnar Paulson.
 //
 //
-// This file is (c) under GNU PUBLIC LICENSE
+// This file is (c) under GNU General Public License
 //
 //-----------------------------------------------------------------------------
 
index 99afed2e6ba63fc6b66ef09978c356479829fbeb..c261ba6cdffef75f46d7a2f16bfc7d85a520ca0c 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: lmgr.c,v 1.7 2000/06/26 08:59:14 keil Exp $
+/* $Id: lmgr.c,v 1.7.6.1 2001/02/16 16:43:28 kai Exp $
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *
  *  Layermanagement module
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index abb544866d45b22d9a2d5f37bfa55a14df030106..b38235d4116877e1fe2ea0308a748240596940e7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mic.c,v 1.10 2000/11/24 17:05:38 kai Exp $
+/* $Id: mic.c,v 1.10.6.1 2001/02/16 16:43:28 kai Exp $
  *
  * mic.c  low level stuff for mic cards
  *
@@ -6,7 +6,7 @@
  *
  * Author  Stephan von Krawczynski <skraw@ithnet.com>
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
@@ -19,7 +19,7 @@
 
 extern const char *CardType[];
 
-const char *mic_revision = "$Revision: 1.10 $";
+const char *mic_revision = "$Revision: 1.10.6.1 $";
 
 #define byteout(addr,val) outb(val,addr)
 #define bytein(addr) inb(addr)
index 4c4d94af762937edb0eeed6bdee5b1518fdb7b35..23ebd3c9b29618c50d1f5642bf431ce94849a771 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: netjet.c,v 1.24.6.2 2000/12/17 22:45:11 kai Exp $
+/* $Id: netjet.c,v 1.24.6.4 2001/02/16 16:43:28 kai Exp $
  *
  * netjet.c     low level stuff for Traverse Technologie NETJet ISDN cards
  *
@@ -6,7 +6,7 @@
  *
  * Thanks to Traverse Technologie Australia for documents and informations
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
@@ -22,7 +22,7 @@
 #include <asm/io.h>
 #include "netjet.h"
 
-const char *NETjet_revision = "$Revision: 1.24.6.2 $";
+const char *NETjet_revision = "$Revision: 1.24.6.4 $";
 
 /* Interface functions */
 
index 120a98d27edd920b4fa4daaa0f2ae2c4c18f586a..f24f6992bf2197af85ebcaacfaf14ba9a4b01b61 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: netjet.h,v 2.5.6.1 2000/11/28 12:02:46 kai Exp $
+// $Id: netjet.h,v 2.5.6.2 2001/02/16 16:43:28 kai Exp $
 //-----------------------------------------------------------------------------
 //
 // NETjet common header file
@@ -6,7 +6,7 @@
 // Author       Kerstern Keil repackaged by
 //              Matt Henderson - Traverse Technologies P/L www.traverse.com.au
 //
-// This file is (c) under GNU PUBLIC LICENSE
+// This file is (c) under GNU General Public License
 //
 //-----------------------------------------------------------------------------
 
index b22ed23e73ab0c812fe4c6433d8c80bf820ae52c..dba2a6d86f1113f874806908786cef2c43a875ee 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: niccy.c,v 1.15.6.2 2000/11/29 16:00:14 kai Exp $
+/* $Id: niccy.c,v 1.15.6.4 2001/02/16 16:43:28 kai Exp $
  *
  * niccy.c  low level stuff for Dr. Neuhaus NICCY PnP and NICCY PCI and
  *          compatible (SAGEM cybermodem)
@@ -7,7 +7,7 @@
  * 
  * Thanks to Dr. Neuhaus and SAGEM for informations
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
@@ -22,7 +22,7 @@
 #include <linux/pci.h>
 
 extern const char *CardType[];
-const char *niccy_revision = "$Revision: 1.15.6.2 $";
+const char *niccy_revision = "$Revision: 1.15.6.4 $";
 
 #define byteout(addr,val) outb(val,addr)
 #define bytein(addr) inb(addr)
index 02a76d7dfb54534af774de9e85ab176376e0cd35..850a4dab42d9d05ec1933eba217563ff6db63656 100644 (file)
@@ -1,6 +1,6 @@
-// $Id: nj_s.c,v 2.7.6.2 2001/02/07 11:31:31 kai Exp $
+// $Id: nj_s.c,v 2.7.6.4 2001/02/16 16:43:28 kai Exp $
 //
-// This file is (c) under GNU PUBLIC LICENSE
+// This file is (c) under GNU General Public License
 //
 
 #define __NO_VERSION__
@@ -14,7 +14,7 @@
 #include <linux/ppp_defs.h>
 #include "netjet.h"
 
-const char *NETjet_S_revision = "$Revision: 2.7.6.2 $";
+const char *NETjet_S_revision = "$Revision: 2.7.6.4 $";
 
 static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off)
 {
index f0bdd33263a2ef887de8cd4ce5779ae929ce83bc..766604fc54bf4b2d8e195be4836770ed841032d6 100644 (file)
@@ -1,6 +1,6 @@
-/* $Id: nj_u.c,v 2.8.6.2 2001/02/07 11:31:31 kai Exp $ 
+/* $Id: nj_u.c,v 2.8.6.4 2001/02/16 16:43:28 kai Exp $ 
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
@@ -15,7 +15,7 @@
 #include <linux/ppp_defs.h>
 #include "netjet.h"
 
-const char *NETjet_U_revision = "$Revision: 2.8.6.2 $";
+const char *NETjet_U_revision = "$Revision: 2.8.6.4 $";
 
 static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off)
 {
index 3f461883d00c7f5f427b30bdc5f2a189bd56f23e..278ba176423d3a994d5e9e4603b6c674d2a7f9e1 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: q931.c,v 1.10 2000/06/26 08:59:14 keil Exp $
+/* $Id: q931.c,v 1.10.6.1 2001/02/16 16:43:28 kai Exp $
  *
  * q931.c       code to decode ITU Q.931 call control messages
  *
  * Author       Jan den Ouden
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  * Changelog
  *
@@ -1228,7 +1228,7 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir)
                                finish = 1;
                        }
                } else if (sapi == TEI_SAPI) {
-                       dp += sprintf(dp, "tei managment\n");
+                       dp += sprintf(dp, "tei management\n");
                        finish = 1;
                } else {
                        dp += sprintf(dp, "unknown sapi %d broadcast\n", sapi);
index 1f4dc443628f0fa7bf8ee6f6ffd6ff7c0d7e45bc..09e05f67718c80a52a9ae2d6d72e884d6d62367f 100644 (file)
@@ -1,11 +1,11 @@
-/* $Id: rawhdlc.c,v 1.5 2000/06/26 08:59:14 keil Exp $
+/* $Id: rawhdlc.c,v 1.5.6.1 2001/02/16 16:43:28 kai Exp $
  *
  * rawhdlc.c     support routines for cards that don't support HDLC
  *
  * Author     Karsten Keil (keil@isdn4linux.de)
  *            Brent Baccala <baccala@FreeSoft.org>
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  * Some passive ISDN cards, such as the Traverse NETJet and the AMD 7930,
  * don't perform HDLC encapsulation over the B channel.  Drivers for
index 12ca6ab8c2cb201cc80b50ceb44dd8b895799d2e..1ba38a51f52733eb8b1fb8b8d922a039415293fb 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: rawhdlc.h,v 1.3 2000/06/26 08:59:14 keil Exp $
+/* $Id: rawhdlc.h,v 1.3.6.1 2001/02/16 16:43:29 kai Exp $
  *
  * rawhdlc.h     support routines for cards that don't support HDLC
  *
  * Author     Brent Baccala <baccala@FreeSoft.org>
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index c29e765e6fa993d46068a4c84bac910a3f3e6a73..fa965fe87c50e3aa5af24deb20527e5db10af252 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: s0box.c,v 2.4 2000/11/24 17:05:38 kai Exp $
+/* $Id: s0box.c,v 2.4.6.1 2001/02/16 16:43:29 kai Exp $
  *
  * s0box.c      low level stuff for Creatix S0BOX
  *
  * Author       S0BOX specific stuff: Enrik Berkhan (enrik@starfleet.inka.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #define __NO_VERSION__
@@ -15,7 +15,7 @@
 #include "isdnl1.h"
 
 extern const char *CardType[];
-const char *s0box_revision = "$Revision: 2.4 $";
+const char *s0box_revision = "$Revision: 2.4.6.1 $";
 
 static inline void
 writereg(unsigned int padr, signed int addr, u_char off, u_char val) {
index 8f4b7c4736142b51e9e40cac80a74717dc894178..c243cef3b11b9df5397385eaef7d5aefd65bf66d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: saphir.c,v 1.8 2000/11/24 17:05:38 kai Exp $
+/* $Id: saphir.c,v 1.8.6.1 2001/02/16 16:43:29 kai Exp $
  *
  * saphir.c low level stuff for HST Saphir 1
  *
@@ -6,7 +6,7 @@
  *
  * Thanks to    HST High Soft Tech GmbH
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
@@ -19,7 +19,7 @@
 #include "isdnl1.h"
 
 extern const char *CardType[];
-static char *saphir_rev = "$Revision: 1.8 $";
+static char *saphir_rev = "$Revision: 1.8.6.1 $";
 
 #define byteout(addr,val) outb(val,addr)
 #define bytein(addr) inb(addr)
index abe4d21986be71c4c607154d946c7641177567cc..300213f56edf3f9e532a22e3e903c23512303ea7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sedlbauer.c,v 1.25.6.2 2000/11/29 17:48:59 kai Exp $
+/* $Id: sedlbauer.c,v 1.25.6.4 2001/02/16 16:43:29 kai Exp $
  *
  * sedlbauer.c  low level stuff for Sedlbauer cards
  *              includes support for the Sedlbauer speed star (speed star II),
@@ -16,7 +16,7 @@
  *            Sedlbauer AG for informations
  *            Edgar Toernig
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
@@ -52,7 +52,7 @@
 
 extern const char *CardType[];
 
-const char *Sedlbauer_revision = "$Revision: 1.25.6.2 $";
+const char *Sedlbauer_revision = "$Revision: 1.25.6.4 $";
 
 const char *Sedlbauer_Types[] =
        {"None", "speed card/win", "speed star", "speed fax+", 
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
new file mode 100644 (file)
index 0000000..a6a993f
--- /dev/null
@@ -0,0 +1,682 @@
+/*======================================================================
+
+    A Sedlbauer PCMCIA client driver
+
+    This driver is for the Sedlbauer Speed Star and Speed Star II, 
+    which are ISDN PCMCIA Cards.
+    
+    sedlbauer_cs.c 1.1a 2001/01/28 15:04:04
+
+    The contents of this file are subject to the Mozilla Public
+    License Version 1.1 (the "License"); you may not use this file
+    except in compliance with the License. You may obtain a copy of
+    the License at http://www.mozilla.org/MPL/
+
+    Software distributed under the License is distributed on an "AS
+    IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+    implied. See the License for the specific language governing
+    rights and limitations under the License.
+
+    The initial developer of the original code is David A. Hinds
+    <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
+    are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+
+    Modifications from dummy_cs.c are Copyright (C) 1999-2001 Marcus Niemann
+    <maniemann@users.sourceforge.net>. All Rights Reserved.
+
+    Alternatively, the contents of this file may be used under the
+    terms of the GNU Public License version 2 (the "GPL"), in which
+    case the provisions of the GPL are applicable instead of the
+    above.  If you wish to allow the use of your version of this file
+    only under the terms of the GPL and not to allow others to use
+    your version of this file under the MPL, indicate your decision
+    by deleting the provisions above and replace them with the notice
+    and other provisions required by the GPL.  If you do not delete
+    the provisions above, a recipient may use your version of this
+    file under either the MPL or the GPL.
+    
+======================================================================*/
+
+#include <pcmcia/config.h>
+#include <pcmcia/k_compat.h>
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/ptrace.h>
+#include <linux/malloc.h>
+#include <linux/string.h>
+#include <linux/timer.h>
+#include <linux/ioport.h>
+#include <asm/io.h>
+#include <asm/system.h>
+
+#include <pcmcia/version.h>
+#include <pcmcia/cs_types.h>
+#include <pcmcia/cs.h>
+#include <pcmcia/cistpl.h>
+#include <pcmcia/cisreg.h>
+#include <pcmcia/ds.h>
+#include <pcmcia/bus_ops.h>
+
+/*
+   All the PCMCIA modules use PCMCIA_DEBUG to control debugging.  If
+   you do not define PCMCIA_DEBUG at all, all the debug code will be
+   left out.  If you compile with PCMCIA_DEBUG=0, the debug code will
+   be present but disabled -- but it can then be enabled for specific
+   modules at load time with a 'pc_debug=#' option to insmod.
+*/
+
+#ifdef PCMCIA_DEBUG
+static int pc_debug = PCMCIA_DEBUG;
+MODULE_PARM(pc_debug, "i");
+#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args); 
+static char *version =
+"sedlbauer_cs.c 1.1a 2001/01/28 15:04:04 (M.Niemann)";
+#else
+#define DEBUG(n, args...)
+#endif
+
+
+/*====================================================================*/
+
+/* Parameters that can be set with 'insmod' */
+
+/* The old way: bit map of interrupts to choose from */
+/* This means pick from 15, 14, 12, 11, 10, 9, 7, 5, 4, and 3 */
+static u_int irq_mask = 0xdeb8;
+/* Newer, simpler way of listing specific interrupts */
+static int irq_list[4] = { -1 };
+
+MODULE_PARM(irq_mask, "i");
+MODULE_PARM(irq_list, "1-4i");
+
+static int protocol = 2;        /* EURO-ISDN Default */
+MODULE_PARM(protocol, "i");
+
+extern int sedl_init_pcmcia(int, int, int*, int);
+
+/*====================================================================*/
+
+/*
+   The event() function is this driver's Card Services event handler.
+   It will be called by Card Services when an appropriate card status
+   event is received.  The config() and release() entry points are
+   used to configure or release a socket, in response to card
+   insertion and ejection events.  They are invoked from the sedlbauer
+   event handler. 
+*/
+
+static void sedlbauer_config(dev_link_t *link);
+static void sedlbauer_release(u_long arg);
+static int sedlbauer_event(event_t event, int priority,
+                      event_callback_args_t *args);
+
+/*
+   The attach() and detach() entry points are used to create and destroy
+   "instances" of the driver, where each instance represents everything
+   needed to manage one actual PCMCIA card.
+*/
+
+static dev_link_t *sedlbauer_attach(void);
+static void sedlbauer_detach(dev_link_t *);
+
+/*
+   You'll also need to prototype all the functions that will actually
+   be used to talk to your device.  See 'memory_cs' for a good example
+   of a fully self-sufficient driver; the other drivers rely more or
+   less on other parts of the kernel.
+*/
+
+/*
+   The dev_info variable is the "key" that is used to match up this
+   device driver with appropriate cards, through the card configuration
+   database.
+*/
+
+static dev_info_t dev_info = "sedlbauer_cs";
+
+/*
+   A linked list of "instances" of the sedlbauer device.  Each actual
+   PCMCIA card corresponds to one device instance, and is described
+   by one dev_link_t structure (defined in ds.h).
+
+   You may not want to use a linked list for this -- for example, the
+   memory card driver uses an array of dev_link_t pointers, where minor
+   device numbers are used to derive the corresponding array index.
+*/
+
+static dev_link_t *dev_list = NULL;
+
+/*
+   A dev_link_t structure has fields for most things that are needed
+   to keep track of a socket, but there will usually be some device
+   specific information that also needs to be kept track of.  The
+   'priv' pointer in a dev_link_t structure can be used to point to
+   a device-specific private data structure, like this.
+
+   To simplify the data structure handling, we actually include the
+   dev_link_t structure in the device's private data structure.
+
+   A driver needs to provide a dev_node_t structure for each device
+   on a card.  In some cases, there is only one device per card (for
+   example, ethernet cards, modems).  In other cases, there may be
+   many actual or logical devices (SCSI adapters, memory cards with
+   multiple partitions).  The dev_node_t structures need to be kept
+   in a linked list starting at the 'dev' field of a dev_link_t
+   structure.  We allocate them in the card's private data structure,
+   because they generally shouldn't be allocated dynamically.
+
+   In this case, we also provide a flag to indicate if a device is
+   "stopped" due to a power management event, or card ejection.  The
+   device IO routines can use a flag like this to throttle IO to a
+   card that is not ready to accept it.
+
+   The bus_operations pointer is used on platforms for which we need
+   to use special socket-specific versions of normal IO primitives
+   (inb, outb, readb, writeb, etc) for card IO.
+*/
+   
+typedef struct local_info_t {
+    dev_link_t         link;
+    dev_node_t         node;
+    int                        stop;
+    struct bus_operations *bus;
+} local_info_t;
+
+/*====================================================================*/
+
+static void cs_error(client_handle_t handle, int func, int ret)
+{
+    error_info_t err = { func, ret };
+    CardServices(ReportError, handle, &err);
+}
+
+/*======================================================================
+
+    sedlbauer_attach() creates an "instance" of the driver, allocating
+    local data structures for one device.  The device is registered
+    with Card Services.
+
+    The dev_link structure is initialized, but we don't actually
+    configure the card at this point -- we wait until we receive a
+    card insertion event.
+    
+======================================================================*/
+
+static dev_link_t *sedlbauer_attach(void)
+{
+    local_info_t *local;
+    dev_link_t *link;
+    client_reg_t client_reg;
+    int ret, i;
+    
+    DEBUG(0, "sedlbauer_attach()\n");
+
+    /* Allocate space for private device-specific data */
+    local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
+    if (!local) return NULL;
+    memset(local, 0, sizeof(local_info_t));
+    link = &local->link; link->priv = local;
+    
+    /* Initialize the dev_link_t structure */
+    link->release.function = &sedlbauer_release;
+    link->release.data = (u_long)link;
+
+    /* Interrupt setup */
+    link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
+    link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
+    if (irq_list[0] == -1)
+       link->irq.IRQInfo2 = irq_mask;
+    else
+       for (i = 0; i < 4; i++)
+           link->irq.IRQInfo2 |= 1 << irq_list[i];
+    link->irq.Handler = NULL;
+    
+    /*
+      General socket configuration defaults can go here.  In this
+      client, we assume very little, and rely on the CIS for almost
+      everything.  In most clients, many details (i.e., number, sizes,
+      and attributes of IO windows) are fixed by the nature of the
+      device, and can be hard-wired here.
+    */
+
+    /* from old sedl_cs 
+    */
+    /* The io structure describes IO port mapping */
+    link->io.NumPorts1 = 8;
+    link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
+    link->io.IOAddrLines = 3;
+
+
+    link->conf.Attributes = 0;
+    link->conf.Vcc = 50;
+    link->conf.IntType = INT_MEMORY_AND_IO;
+
+    /* Register with Card Services */
+    link->next = dev_list;
+    dev_list = link;
+    client_reg.dev_info = &dev_info;
+    client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
+    client_reg.EventMask =
+       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
+       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
+       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
+    client_reg.event_handler = &sedlbauer_event;
+    client_reg.Version = 0x0210;
+    client_reg.event_callback_args.client_data = link;
+    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    if (ret != CS_SUCCESS) {
+       cs_error(link->handle, RegisterClient, ret);
+       sedlbauer_detach(link);
+       return NULL;
+    }
+
+    return link;
+} /* sedlbauer_attach */
+
+/*======================================================================
+
+    This deletes a driver "instance".  The device is de-registered
+    with Card Services.  If it has been released, all local data
+    structures are freed.  Otherwise, the structures will be freed
+    when the device is released.
+
+======================================================================*/
+
+static void sedlbauer_detach(dev_link_t *link)
+{
+    dev_link_t **linkp;
+
+    DEBUG(0, "sedlbauer_detach(0x%p)\n", link);
+    
+    /* Locate device structure */
+    for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
+       if (*linkp == link) break;
+    if (*linkp == NULL)
+       return;
+
+    /*
+       If the device is currently configured and active, we won't
+       actually delete it yet.  Instead, it is marked so that when
+       the release() function is called, that will trigger a proper
+       detach().
+    */
+    if (link->state & DEV_CONFIG) {
+#ifdef PCMCIA_DEBUG
+       printk(KERN_DEBUG "sedlbauer_cs: detach postponed, '%s' "
+              "still locked\n", link->dev->dev_name);
+#endif
+       link->state |= DEV_STALE_LINK;
+       return;
+    }
+
+    /* Break the link with Card Services */
+    if (link->handle)
+       CardServices(DeregisterClient, link->handle);
+    
+    /* Unlink device structure, and free it */
+    *linkp = link->next;
+    /* This points to the parent local_info_t struct */
+    kfree(link->priv);
+} /* sedlbauer_detach */
+
+/*======================================================================
+
+    sedlbauer_config() is scheduled to run after a CARD_INSERTION event
+    is received, to configure the PCMCIA socket, and to make the
+    device available to the system.
+    
+======================================================================*/
+
+#define CS_CHECK(fn, args...) \
+while ((last_ret=CardServices(last_fn=(fn),args))!=0) goto cs_failed
+
+#define CFG_CHECK(fn, args...) \
+if (CardServices(fn, args) != 0) goto next_entry
+
+static void sedlbauer_config(dev_link_t *link)
+{
+    client_handle_t handle = link->handle;
+    local_info_t *dev = link->priv;
+    tuple_t tuple;
+    cisparse_t parse;
+    int last_fn, last_ret;
+    u_char buf[64];
+    config_info_t conf;
+    win_req_t req;
+    memreq_t map;
+    
+
+    DEBUG(0, "sedlbauer_config(0x%p)\n", link);
+
+    /*
+       This reads the card's CONFIG tuple to find its configuration
+       registers.
+    */
+    tuple.DesiredTuple = CISTPL_CONFIG;
+    tuple.Attributes = 0;
+    tuple.TupleData = buf;
+    tuple.TupleDataMax = sizeof(buf);
+    tuple.TupleOffset = 0;
+    CS_CHECK(GetFirstTuple, handle, &tuple);
+    CS_CHECK(GetTupleData, handle, &tuple);
+    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    link->conf.ConfigBase = parse.config.base;
+    link->conf.Present = parse.config.rmask[0];
+    
+    /* Configure card */
+    link->state |= DEV_CONFIG;
+
+    /* Look up the current Vcc */
+    CS_CHECK(GetConfigurationInfo, handle, &conf);
+    link->conf.Vcc = conf.Vcc;
+
+    /*
+      In this loop, we scan the CIS for configuration table entries,
+      each of which describes a valid card configuration, including
+      voltage, IO window, memory window, and interrupt settings.
+
+      We make no assumptions about the card to be configured: we use
+      just the information available in the CIS.  In an ideal world,
+      this would work for any PCMCIA card, but it requires a complete
+      and accurate CIS.  In practice, a driver usually "knows" most of
+      these things without consulting the CIS, and most client drivers
+      will only use the CIS to fill in implementation-defined details.
+    */
+    tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
+    CS_CHECK(GetFirstTuple, handle, &tuple);
+    while (1) {
+       cistpl_cftable_entry_t dflt = { 0 };
+       cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
+       CFG_CHECK(GetTupleData, handle, &tuple);
+       CFG_CHECK(ParseTuple, handle, &tuple, &parse);
+
+       if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;
+       if (cfg->index == 0) goto next_entry;
+       link->conf.ConfigIndex = cfg->index;
+       
+       /* Does this card need audio output? */
+       if (cfg->flags & CISTPL_CFTABLE_AUDIO) {
+           link->conf.Attributes |= CONF_ENABLE_SPKR;
+           link->conf.Status = CCSR_AUDIO_ENA;
+       }
+       
+       /* Use power settings for Vcc and Vpp if present */
+       /*  Note that the CIS values need to be rescaled */
+       if (cfg->vcc.present & (1<<CISTPL_POWER_VNOM)) {
+           if (conf.Vcc != cfg->vcc.param[CISTPL_POWER_VNOM]/10000)
+               goto next_entry;
+       } else if (dflt.vcc.present & (1<<CISTPL_POWER_VNOM)) {
+           if (conf.Vcc != dflt.vcc.param[CISTPL_POWER_VNOM]/10000)
+               goto next_entry;
+       }
+           
+       if (cfg->vpp1.present & (1<<CISTPL_POWER_VNOM))
+           link->conf.Vpp1 = link->conf.Vpp2 =
+               cfg->vpp1.param[CISTPL_POWER_VNOM]/10000;
+       else if (dflt.vpp1.present & (1<<CISTPL_POWER_VNOM))
+           link->conf.Vpp1 = link->conf.Vpp2 =
+               dflt.vpp1.param[CISTPL_POWER_VNOM]/10000;
+       
+       /* Do we need to allocate an interrupt? */
+       if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
+           link->conf.Attributes |= CONF_ENABLE_IRQ;
+       
+       /* IO window settings */
+       link->io.NumPorts1 = link->io.NumPorts2 = 0;
+       if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
+           cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
+           link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
+           if (!(io->flags & CISTPL_IO_8BIT))
+               link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
+           if (!(io->flags & CISTPL_IO_16BIT))
+               link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
+/* new in dummy.cs 2001/01/28 MN 
+            link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
+*/
+           link->io.BasePort1 = io->win[0].base;
+           link->io.NumPorts1 = io->win[0].len;
+           if (io->nwin > 1) {
+               link->io.Attributes2 = link->io.Attributes1;
+               link->io.BasePort2 = io->win[1].base;
+               link->io.NumPorts2 = io->win[1].len;
+           }
+           /* This reserves IO space but doesn't actually enable it */
+           CFG_CHECK(RequestIO, link->handle, &link->io);
+       }
+
+       /*
+         Now set up a common memory window, if needed.  There is room
+         in the dev_link_t structure for one memory window handle,
+         but if the base addresses need to be saved, or if multiple
+         windows are needed, the info should go in the private data
+         structure for this device.
+
+         Note that the memory window base is a physical address, and
+         needs to be mapped to virtual space with ioremap() before it
+         is used.
+       */
+       if ((cfg->mem.nwin > 0) || (dflt.mem.nwin > 0)) {
+           cistpl_mem_t *mem =
+               (cfg->mem.nwin) ? &cfg->mem : &dflt.mem;
+           req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
+           req.Attributes |= WIN_ENABLE;
+           req.Base = mem->win[0].host_addr;
+           req.Size = mem->win[0].len;
+/* new in dummy.cs 2001/01/28 MN 
+            if (req.Size < 0x1000)
+                req.Size = 0x1000;
+*/
+           req.AccessSpeed = 0;
+           link->win = (window_handle_t)link->handle;
+           CFG_CHECK(RequestWindow, &link->win, &req);
+           map.Page = 0; map.CardOffset = mem->win[0].card_addr;
+           CFG_CHECK(MapMemPage, link->win, &map);
+       }
+       /* If we got this far, we're cool! */
+       break;
+       
+    next_entry:
+/* new in dummy.cs 2001/01/28 MN 
+        if (link->io.NumPorts1)
+           CardServices(ReleaseIO, link->handle, &link->io);
+*/
+       CS_CHECK(GetNextTuple, handle, &tuple);
+    }
+    
+    /*
+       Allocate an interrupt line.  Note that this does not assign a
+       handler to the interrupt, unless the 'Handler' member of the
+       irq structure is initialized.
+    */
+    if (link->conf.Attributes & CONF_ENABLE_IRQ)
+       CS_CHECK(RequestIRQ, link->handle, &link->irq);
+       
+    /*
+       This actually configures the PCMCIA socket -- setting up
+       the I/O windows and the interrupt mapping, and putting the
+       card and host interface into "Memory and IO" mode.
+    */
+    CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+
+    /*
+      At this point, the dev_node_t structure(s) need to be
+      initialized and arranged in a linked list at link->dev.
+    */
+    sprintf(dev->node.dev_name, "sedlbauer");
+    dev->node.major = dev->node.minor = 0;
+    link->dev = &dev->node;
+
+    /* Finally, report what we've done */
+    printk(KERN_INFO "%s: index 0x%02x: Vcc %d.%d",
+          dev->node.dev_name, link->conf.ConfigIndex,
+          link->conf.Vcc/10, link->conf.Vcc%10);
+    if (link->conf.Vpp1)
+       printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10);
+    if (link->conf.Attributes & CONF_ENABLE_IRQ)
+       printk(", irq %d", link->irq.AssignedIRQ);
+    if (link->io.NumPorts1)
+       printk(", io 0x%04x-0x%04x", link->io.BasePort1,
+              link->io.BasePort1+link->io.NumPorts1-1);
+    if (link->io.NumPorts2)
+       printk(" & 0x%04x-0x%04x", link->io.BasePort2,
+              link->io.BasePort2+link->io.NumPorts2-1);
+    if (link->win)
+       printk(", mem 0x%06lx-0x%06lx", req.Base,
+              req.Base+req.Size-1);
+    printk("\n");
+    
+    link->state &= ~DEV_CONFIG_PENDING;
+    sedl_init_pcmcia(link->io.BasePort1, link->irq.AssignedIRQ,
+                     &(((local_info_t*)link->priv)->stop),
+                     protocol);
+
+    return;
+
+cs_failed:
+    cs_error(link->handle, last_fn, last_ret);
+    sedlbauer_release((u_long)link);
+
+} /* sedlbauer_config */
+
+/*======================================================================
+
+    After a card is removed, sedlbauer_release() will unregister the
+    device, and release the PCMCIA configuration.  If the device is
+    still open, this will be postponed until it is closed.
+    
+======================================================================*/
+
+static void sedlbauer_release(u_long arg)
+{
+    dev_link_t *link = (dev_link_t *)arg;
+
+    DEBUG(0, "sedlbauer_release(0x%p)\n", link);
+
+    /*
+       If the device is currently in use, we won't release until it
+       is actually closed, because until then, we can't be sure that
+       no one will try to access the device or its data structures.
+    */
+    if (link->open) {
+       DEBUG(1, "sedlbauer_cs: release postponed, '%s' still open\n",
+             link->dev->dev_name);
+       link->state |= DEV_STALE_CONFIG;
+       return;
+    }
+
+    /* Unlink the device chain */
+    link->dev = NULL;
+
+    /*
+      In a normal driver, additional code may be needed to release
+      other kernel data structures associated with this device. 
+    */
+    
+    /* Don't bother checking to see if these succeed or not */
+    if (link->win)
+       CardServices(ReleaseWindow, link->win);
+    CardServices(ReleaseConfiguration, link->handle);
+    if (link->io.NumPorts1)
+       CardServices(ReleaseIO, link->handle, &link->io);
+    if (link->irq.AssignedIRQ)
+       CardServices(ReleaseIRQ, link->handle, &link->irq);
+    link->state &= ~DEV_CONFIG;
+    
+    if (link->state & DEV_STALE_LINK)
+       sedlbauer_detach(link);
+    
+} /* sedlbauer_release */
+
+/*======================================================================
+
+    The card status event handler.  Mostly, this schedules other
+    stuff to run after an event is received.
+
+    When a CARD_REMOVAL event is received, we immediately set a
+    private flag to block future accesses to this device.  All the
+    functions that actually access the device should check this flag
+    to make sure the card is still present.
+    
+======================================================================*/
+
+static int sedlbauer_event(event_t event, int priority,
+                      event_callback_args_t *args)
+{
+    dev_link_t *link = args->client_data;
+    local_info_t *dev = link->priv;
+    
+    DEBUG(1, "sedlbauer_event(0x%06x)\n", event);
+    
+    switch (event) {
+    case CS_EVENT_CARD_REMOVAL:
+       link->state &= ~DEV_PRESENT;
+       if (link->state & DEV_CONFIG) {
+           ((local_info_t *)link->priv)->stop = 1;
+           mod_timer(&link->release, jiffies + HZ/20);
+       }
+       break;
+    case CS_EVENT_CARD_INSERTION:
+       link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
+       dev->bus = args->bus;
+       sedlbauer_config(link);
+       break;
+    case CS_EVENT_PM_SUSPEND:
+       link->state |= DEV_SUSPEND;
+       /* Fall through... */
+    case CS_EVENT_RESET_PHYSICAL:
+       /* Mark the device as stopped, to block IO until later */
+       dev->stop = 1;
+       if (link->state & DEV_CONFIG)
+           CardServices(ReleaseConfiguration, link->handle);
+       break;
+    case CS_EVENT_PM_RESUME:
+       link->state &= ~DEV_SUSPEND;
+       /* Fall through... */
+    case CS_EVENT_CARD_RESET:
+       if (link->state & DEV_CONFIG)
+           CardServices(RequestConfiguration, link->handle, &link->conf);
+       dev->stop = 0;
+       /*
+         In a normal driver, additional code may go here to restore
+         the device state and restart IO. 
+       */
+       break;
+    }
+    return 0;
+} /* sedlbauer_event */
+
+/*====================================================================*/
+
+static int __init init_sedlbauer_cs(void)
+{
+    servinfo_t serv;
+    DEBUG(0, "%s\n", version);
+    CardServices(GetCardServicesInfo, &serv);
+    if (serv.Revision != CS_RELEASE_CODE) {
+       printk(KERN_NOTICE "sedlbauer_cs: Card Services release "
+              "does not match!\n");
+       return -1;
+    }
+    register_pccard_driver(&dev_info, &sedlbauer_attach, &sedlbauer_detach);
+    return 0;
+}
+
+static void __exit exit_sedlbauer_cs(void)
+{
+    DEBUG(0, "sedlbauer_cs: unloading\n");
+    unregister_pccard_driver(&dev_info);
+    while (dev_list != NULL) {
+       del_timer(&dev_list->release);
+       if (dev_list->state & DEV_CONFIG)
+           sedlbauer_release((u_long)dev_list);
+       sedlbauer_detach(dev_list);
+    }
+}
+
+module_init(init_sedlbauer_cs);
+module_exit(exit_sedlbauer_cs);
+
index b72ff032c6bd46acc86fbbbe4b6905b4f5070dfd..01877caa3c734828ae5425eca2fd080cbbf0d342 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sportster.c,v 1.14 2000/11/24 17:05:38 kai Exp $
+/* $Id: sportster.c,v 1.14.6.1 2001/02/16 16:43:29 kai Exp $
  *
  * sportster.c     low level stuff for USR Sportster internal TA
  *
@@ -6,7 +6,7 @@
  *
  * Thanks to Christian "naddy" Weisgerber (3Com, US Robotics) for documentation
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #define __NO_VERSION__
@@ -17,7 +17,7 @@
 #include "isdnl1.h"
 
 extern const char *CardType[];
-const char *sportster_revision = "$Revision: 1.14 $";
+const char *sportster_revision = "$Revision: 1.14.6.1 $";
 
 #define byteout(addr,val) outb(val,addr)
 #define bytein(addr) inb(addr)
index 41a7446b75211e326c80a904c3b2ed25cd5723f2..d4bab23fe94b5945cd2d1b72704b8d1731a39735 100644 (file)
@@ -1,9 +1,9 @@
-/* $Id: tei.c,v 2.17 2000/11/24 17:05:38 kai Exp $
+/* $Id: tei.c,v 2.17.6.1 2001/02/16 16:43:29 kai Exp $
  *
  * Author       Karsten Keil (keil@isdn4linux.de)
  *              based on the teles driver from Jan den Ouden
  *
- *             This file is (c) under GNU PUBLIC LICENSE
+ *             This file is (c) under GNU General Public License
  *             For changes and modifications please read
  *             ../../../Documentation/isdn/HiSax.cert
  *
@@ -17,7 +17,7 @@
 #include <linux/init.h>
 #include <linux/random.h>
 
-const char *tei_revision = "$Revision: 2.17 $";
+const char *tei_revision = "$Revision: 2.17.6.1 $";
 
 #define ID_REQUEST     1
 #define ID_ASSIGNED    2
index eb65d3c8512c7bc6cc6bc98d2e97bf1f995f380e..dc42b6d5c17503b4b31cbc7a6e5ea13ef52456de 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: teleint.c,v 1.14 2000/11/24 17:05:38 kai Exp $
+/* $Id: teleint.c,v 1.14.6.1 2001/02/16 16:43:29 kai Exp $
  *
  * teleint.c     low level stuff for TeleInt isdn cards
  *
  * Author     Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
@@ -17,7 +17,7 @@
 
 extern const char *CardType[];
 
-const char *TeleInt_revision = "$Revision: 1.14 $";
+const char *TeleInt_revision = "$Revision: 1.14.6.1 $";
 
 #define byteout(addr,val) outb(val,addr)
 #define bytein(addr) inb(addr)
index efbd1526654da8514efa795e6328ddc8323d1896..643790e7a2ead99e772fb2de13f34ded58ea8f05 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: teles0.c,v 2.13 2000/11/24 17:05:38 kai Exp $
+/* $Id: teles0.c,v 2.13.6.1 2001/02/16 16:43:29 kai Exp $
  *
  * teles0.c     low level stuff for Teles Memory IO isdn cards
  *              based on the teles driver from Jan den Ouden
@@ -9,7 +9,7 @@
  *              Fritz Elfert
  *              Beat Doebeli
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #define __NO_VERSION__
@@ -21,7 +21,7 @@
 
 extern const char *CardType[];
 
-const char *teles0_revision = "$Revision: 2.13 $";
+const char *teles0_revision = "$Revision: 2.13.6.1 $";
 
 #define TELES_IOMEM_SIZE       0x400
 #define byteout(addr,val) outb(val,addr)
index 3fdcfb04d6442046a2f2caa950a146c1559f37da..6686f493b1930ea46246d3e1f1d8f6a845c540cf 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: teles3.c,v 2.17 2000/11/24 17:05:38 kai Exp $
+/* $Id: teles3.c,v 2.17.6.1 2001/02/16 16:43:29 kai Exp $
  *
  * teles3.c     low level stuff for Teles 16.3 & PNP isdn cards
  *
@@ -10,7 +10,7 @@
  *              Fritz Elfert
  *              Beat Doebeli
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #define __NO_VERSION__
@@ -21,7 +21,7 @@
 #include "isdnl1.h"
 
 extern const char *CardType[];
-const char *teles3_revision = "$Revision: 2.17 $";
+const char *teles3_revision = "$Revision: 2.17.6.1 $";
 
 #define byteout(addr,val) outb(val,addr)
 #define bytein(addr) inb(addr)
index 83b640f8fe2a20f407e0b45a6c79218933bf8e49..36c165c5f8b1ee6269be540f0d67b1dc5230174d 100644 (file)
@@ -1,11 +1,11 @@
-/* $Id: telespci.c,v 2.16.6.2 2000/11/29 16:00:14 kai Exp $
+/* $Id: telespci.c,v 2.16.6.4 2001/02/16 16:43:29 kai Exp $
  *
  * telespci.c     low level stuff for Teles PCI isdn cards
  *
  * Author       Ton van Rosmalen 
  *              Karsten Keil (keil@isdn4linux.de)
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 #define __NO_VERSION__
@@ -18,7 +18,7 @@
 #include <linux/pci.h>
 
 extern const char *CardType[];
-const char *telespci_revision = "$Revision: 2.16.6.2 $";
+const char *telespci_revision = "$Revision: 2.16.6.4 $";
 
 #define ZORAN_PO_RQ_PEN        0x02000000
 #define ZORAN_PO_WR    0x00800000
index 9afb73f90f5f90a02fbf2187c94c797d6b17c851..9629efb5fe19c280d140e03c1108ff5c8c6bf4d9 100644 (file)
@@ -1,11 +1,11 @@
-/* $Id: w6692.c,v 1.12.6.2 2000/11/29 16:00:14 kai Exp $
+/* $Id: w6692.c,v 1.12.6.4 2001/02/16 16:43:29 kai Exp $
  *
  * w6692.c   Winbond W6692 specific routines
  *
  * Author       Petr Novak <petr.novak@i.cz>
  *              (based on HiSax driver by Karsten Keil)
  *
- *              This file is (c) under GNU PUBLIC LICENSE
+ *              This file is (c) under GNU General Public License
  *
  */
 
@@ -35,7 +35,7 @@ static const PCI_ENTRY id_list[] =
 
 extern const char *CardType[];
 
-const char *w6692_revision = "$Revision: 1.12.6.2 $";
+const char *w6692_revision = "$Revision: 1.12.6.4 $";
 
 #define DBUSY_TIMER_VALUE 80
 
index 5c28d3bac0fa2aa2363057a8ec1ebd4c5d4b2edd..977ae341d2d90a2ef0edaa1c9412e99939871fd6 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: w6692.h,v 1.2 2000/06/26 08:59:15 keil Exp $
+/* $Id: w6692.h,v 1.2.6.1 2001/02/16 16:43:29 kai Exp $
  *
  * w6692.h   Winbond W6692 specific defines
  *
  * Author       Petr Novak <petr.novak@i.cz>
  *
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
  *
  */
 
index 92e96ec9b40e4e3234e9155beb972f73249f8635..bf141bad7d5a35a1153c48c41842e69ce5315241 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: boardergo.c,v 1.5.6.1 2000/12/10 22:01:04 kai Exp $
+/* $Id: boardergo.c,v 1.5.6.2 2001/02/16 16:43:30 kai Exp $
 
  * Linux driver for HYSDN cards, specific routines for ergo type boards.
  *
@@ -270,7 +270,7 @@ ergo_writebootimg(struct HYSDN_CARD *card, uchar * buf, ulong offs)
                        return (-ERR_BOOTIMG_FAIL);
                }
        }                       /* start_boot_img */
-       return (0);             /* successfull */
+       return (0);             /* successful */
 }                              /* ergo_writebootimg */
 
 /********************************************************************************/
@@ -337,7 +337,7 @@ ergo_writebootseq(struct HYSDN_CARD *card, uchar * buf, int len)
 
 /***********************************************************************************/
 /* ergo_waitpofready waits for a maximum of 10 seconds for the completition of the */
-/* boot process. If the process has been successfull 0 is returned otherwise a     */
+/* boot process. If the process has been successful 0 is returned otherwise a     */
 /* negative error code is returned.                                                */
 /***********************************************************************************/
 static int
@@ -361,7 +361,7 @@ ergo_waitpofready(struct HYSDN_CARD *card)
                            (dpr->ToPcSize < MIN_RDY_MSG_SIZE) ||
                            (dpr->ToPcSize > MAX_RDY_MSG_SIZE) ||
                            ((*(ulong *) dpr->ToPcBuf) != RDY_MAGIC))
-                               break;  /* an error occured */
+                               break;  /* an error occurred */
 
                        /* Check for additional data delivered during SysReady */
                        msg_size = dpr->ToPcSize - RDY_MAGIC_SIZE;
index ddc00823f0d5efa057636befe172d5c980b82758..9ac8e8fe3b925920fd5d172328bdbef0e38f93e9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hycapi.c,v 1.8 2000/11/22 17:13:13 kai Exp $
+/* $Id: hycapi.c,v 1.8.6.1 2001/02/16 16:43:30 kai Exp $
  *
  * Linux driver for HYSDN cards, CAPI2.0-Interface.
  * written by Ulrich Albrecht (u.albrecht@hypercope.de) for Hypercope GmbH
@@ -41,7 +41,7 @@
 #include "hysdn_defs.h"
 #include <linux/kernelcapi.h>
 
-static char hycapi_revision[]="$Revision: 1.8 $";
+static char hycapi_revision[]="$Revision: 1.8.6.1 $";
 
 typedef struct _hycapi_appl {
        unsigned int ctrl_mask;
@@ -522,7 +522,7 @@ char *hycapi_procinfo(struct capi_ctr *ctrl)
 /******************************************************************
 hycapi_rx_capipkt
 
-Recieve a capi-message.
+Receive a capi-message.
 
 All B3_DATA_IND are converted to 64K-extension compatible format.
 New nccis are created if neccessary.
index 2218cc982b365d5a4ae965aa3638681102416aa7..cec795aac47d381a3af39baab3596e457c329bff 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hysdn_boot.c,v 1.4 2000/11/13 22:51:47 kai Exp $
+/* $Id: hysdn_boot.c,v 1.4.6.2 2001/02/16 16:43:30 kai Exp $
 
  * Linux driver for HYSDN cards, specific routines for booting and pof handling.
  *
@@ -49,7 +49,7 @@ struct boot_data {
        uchar pof_state;        /* actual state of read handler */
        uchar is_crypted;       /* card data is crypted */
        int BufSize;            /* actual number of bytes bufferd */
-       int last_error;         /* last occured error */
+       int last_error;         /* last occurred error */
        word pof_recid;         /* actual pof recid */
        ulong pof_reclen;       /* total length of pof record data */
        ulong pof_recoffset;    /* actual offset inside pof record */
@@ -62,7 +62,7 @@ struct boot_data {
 };
 
 /*****************************************************/
-/*  start decryption of sucessive POF file chuncks.  */
+/*  start decryption of successive POF file chuncks.  */
 /*                                                   */
 /*  to be called at start of POF file reading,       */
 /*  before starting any decryption on any POF record. */
@@ -93,7 +93,7 @@ DecryptBuf(struct boot_data *boot, int cnt)
 
 /********************************************************************************/
 /* pof_handle_data executes the required actions dependant on the active record */
-/* id. If successfull 0 is returned, a negative value shows an error.           */
+/* id. If successful 0 is returned, a negative value shows an error.           */
 /********************************************************************************/
 static int
 pof_handle_data(hysdn_card * card, int datlen)
@@ -182,7 +182,7 @@ pof_handle_data(hysdn_card * card, int datlen)
 /* number of data bytes. The number delivered is additionally supplied for    */
 /* verification. The functions handles the data and returns the needed number */
 /* of bytes for the next action. If the returned value is 0 or less an error  */
-/* occured and booting must be aborted.                                       */
+/* occurred and booting must be aborted.                                       */
 /******************************************************************************/
 int
 pof_write_buffer(hysdn_card * card, int datlen)
@@ -253,7 +253,7 @@ pof_write_buffer(hysdn_card * card, int datlen)
                                break;
                        }
                        if ((boot->last_error = pof_handle_data(card, datlen)) < 0)
-                               return (boot->last_error);      /* an error occured */
+                               return (boot->last_error);      /* an error occurred */
                        boot->pof_recoffset += datlen;
                        if (boot->pof_recoffset >= boot->pof_reclen) {
                                boot->pof_state = POF_READ_TAG_HEAD;    /* now start with single tags */
@@ -346,7 +346,7 @@ pof_write_close(hysdn_card * card)
 
 /*********************************************************************************/
 /* EvalSysrTokData checks additional records delivered with the Sysready Message */
-/* when POF has been booted. A return value of 0 is used if no error occured.    */
+/* when POF has been booted. A return value of 0 is used if no error occurred.    */
 /*********************************************************************************/
 int
 EvalSysrTokData(hysdn_card * card, uchar * cp, int len)
index 06282b96fe59f05fcb8e5361fb9aeaaf415eeaf5..a676bfdd3e4d848c243030b3c35f40ec373fc052 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hysdn_init.c,v 1.6.6.1 2000/11/28 12:02:47 kai Exp $
+/* $Id: hysdn_init.c,v 1.6.6.5 2001/02/16 16:43:30 kai Exp $
 
  * Linux driver for HYSDN cards, init functions.
  * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH
@@ -32,7 +32,7 @@
 
 #include "hysdn_defs.h"
 
-static char *hysdn_init_revision = "$Revision: 1.6.6.1 $";
+static char *hysdn_init_revision = "$Revision: 1.6.6.5 $";
 int cardmax;                   /* number of found cards */
 hysdn_card *card_root = NULL;  /* pointer to first card */
 
@@ -89,6 +89,7 @@ search_cards(void)
                                             akt_pcidev)) != NULL) {
                if (pci_enable_device(akt_pcidev))
                        continue;
+
                if (!(card = kmalloc(sizeof(hysdn_card), GFP_KERNEL))) {
                        printk(KERN_ERR "HYSDN: unable to alloc device mem \n");
                        return;
@@ -173,7 +174,6 @@ stop_cards(void)
 /* image becomes smaller and the driver code is only loaded when needed.    */
 /* Additionally newer versions may be activated without rebooting.          */
 /****************************************************************************/
-#ifdef CONFIG_MODULES
 
 /******************************************************/
 /* extract revision number from string for log output */
@@ -197,12 +197,12 @@ hysdn_getrev(const char *revision)
 /****************************************************************************/
 /* init_module is called once when the module is loaded to do all necessary */
 /* things like autodetect...                                                */
-/* If the return value of this function is 0 the init has been successfull  */
+/* If the return value of this function is 0 the init has been successful   */
 /* and the module is added to the list in /proc/modules, otherwise an error */
 /* is assumed and the module will not be kept in memory.                    */
 /****************************************************************************/
-int
-init_module(void)
+static int __init
+hysdn_init(void)
 {
        char tmp[50];
 
@@ -235,14 +235,14 @@ init_module(void)
 
 /***********************************************************************/
 /* cleanup_module is called when the module is released by the kernel. */
-/* The routine is only called if init_module has been successfull and  */
+/* The routine is only called if init_module has been successful and   */
 /* the module counter has a value of 0. Otherwise this function will   */
 /* not be called. This function must release all resources still allo- */
 /* cated as after the return from this function the module code will   */
 /* be removed from memory.                                             */
 /***********************************************************************/
-void
-cleanup_module(void)
+static void __exit
+hysdn_exit(void)
 {
 #ifdef CONFIG_HYSDN_CAPI
        hysdn_card *card;
@@ -261,4 +261,5 @@ cleanup_module(void)
        printk(KERN_NOTICE "HYSDN: module unloaded\n");
 }                              /* cleanup_module */
 
-#endif                         /* CONFIG_MODULES */
+module_init(hysdn_init);
+module_exit(hysdn_exit);
index cf250e48d9240ff42ab22f3a6e7f224b9ff3e3c7..f634075384ff472af29ea39e673011b2d976f6bf 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hysdn_net.c,v 1.8 2000/11/13 22:51:47 kai Exp $
+/* $Id: hysdn_net.c,v 1.8.6.1 2001/02/16 16:43:30 kai Exp $
 
  * Linux driver for HYSDN cards, net (ethernet type) handling routines.
  *
@@ -38,7 +38,7 @@
 #include "hysdn_defs.h"
 
 /* store the actual version for log reporting */
-char *hysdn_net_revision = "$Revision: 1.8 $";
+char *hysdn_net_revision = "$Revision: 1.8.6.1 $";
 
 #define MAX_SKB_BUFFERS 20     /* number of buffers for keeping TX-data */
 
@@ -350,7 +350,7 @@ hysdn_net_release(hysdn_card * card)
        if (card->debug_flags & LOG_NET_INIT)
                hysdn_addlog(card, "network device deleted");
 
-       return (0);             /* always successfull */
+       return (0);             /* always successful */
 }                              /* hysdn_net_release */
 
 /*****************************************************************************/
index 2200f990671172305f291156fd481669939528a2..8bc3cf1d0f971a6b49cccc629ad77f5e7d041ebf 100644 (file)
@@ -56,7 +56,7 @@ struct conf_writedata {
 /***********************************************************************/
 /* process_line parses one config line and transfers it to the card if */
 /* necessary.                                                          */
-/* if the return value is negative an error occured.                   */
+/* if the return value is negative an error occurred.                   */
 /***********************************************************************/
 static int
 process_line(struct conf_writedata *cnf)
@@ -130,7 +130,7 @@ hysdn_conf_write(struct file *file, const char *buf, size_t count, loff_t * off)
                if (ch == 0x1A) {
                        /* we detected a pof file */
                        if ((cnf->needed_size = pof_write_open(cnf->card, &cnf->pof_buffer)) <= 0)
-                               return (cnf->needed_size);      /* an error occured -> exit */
+                               return (cnf->needed_size);      /* an error occurred -> exit */
                        cnf->buf_size = 0;      /* buffer is empty */
                        cnf->state = CONF_STATE_POF;    /* new state */
                } else {
@@ -158,7 +158,7 @@ hysdn_conf_write(struct file *file, const char *buf, size_t count, loff_t * off)
                        cnf->needed_size = pof_write_buffer(cnf->card, cnf->buf_size);  /* write data */
                        if (cnf->needed_size <= 0) {
                                cnf->card->state = CARD_STATE_BOOTERR;  /* show boot error */
-                               return (cnf->needed_size);      /* an error occured */
+                               return (cnf->needed_size);      /* an error occurred */
                        }
                        cnf->buf_size = 0;      /* buffer is empty again */
                }
index 8649356258a2d4d6033a1d058de7f0519ed0be01..6375a6537a31c82786660c30ab3cad45e4fa782d 100644 (file)
@@ -139,7 +139,7 @@ hysdn_log_write(struct file *file, const char *buf, size_t count, loff_t * off)
                return (-ESPIPE);
 
        if ((retval = pof_boot_write(card, buf, count)) < 0)
-               retval = -EFAULT;       /* an error occured */
+               retval = -EFAULT;       /* an error occurred */
 
        return (retval);
 }                              /* hysdn_log_write */
index 276f44d24db27a610a07973198105d1d1ec9e7cd..8f24017255189a8d51b04f8bd474ec2a6ddda755 100644 (file)
@@ -141,7 +141,7 @@ hysdn_sched_tx(hysdn_card * card, uchar * buf, word volatile *len, word volatile
 
 
 /*****************************************************************************/
-/* send one config line to the card and return 0 if successfull, otherwise a */
+/* send one config line to the card and return 0 if successful, otherwise a */
 /* negative error code.                                                      */
 /* The function works with timeouts perhaps not giving the greatest speed    */
 /* sending the line, but this should be meaningless beacuse only some lines  */
index 180b3711a4e54cbbd7bf23c82986b7a9181e59be..af055e2ba661450ce2c464285ece5dc8a3feb06c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: icn.c,v 1.65 2000/11/13 22:51:48 kai Exp $
+/* $Id: icn.c,v 1.65.6.3 2001/02/16 16:43:31 kai Exp $
 
  * ISDN low-level module for the ICN active ISDN-Card.
  *
@@ -21,6 +21,7 @@
  */
 
 #include "icn.h"
+#include <linux/init.h>
 
 /*
  * Verbose bootcode- and protocol-downloading.
@@ -33,7 +34,7 @@
 #undef MAP_DEBUG
 
 static char
-*revision = "$Revision: 1.65 $";
+*revision = "$Revision: 1.65.6.3 $";
 
 static int icn_addcard(int, char *, char *);
 
@@ -867,7 +868,7 @@ icn_loadboot(u_char * buffer, icn_card * card)
        SLEEP(1);
        memcpy_toio(dev.shmem, codebuf, ICN_CODE_STAGE1);       /* Copy code        */
 #ifdef BOOT_DEBUG
-       printk(KERN_DEBUG "Bootloader transfered\n");
+       printk(KERN_DEBUG "Bootloader transferred\n");
 #endif
        if (card->doubleS0) {
                SLEEP(1);
@@ -883,7 +884,7 @@ icn_loadboot(u_char * buffer, icn_card * card)
                SLEEP(1);
                memcpy_toio(dev.shmem, codebuf, ICN_CODE_STAGE1);       /* Copy code        */
 #ifdef BOOT_DEBUG
-               printk(KERN_DEBUG "Bootloader transfered\n");
+               printk(KERN_DEBUG "Bootloader transferred\n");
 #endif
        }
        kfree(codebuf);
@@ -1638,10 +1639,7 @@ icn_addcard(int port, char *id1, char *id2)
        return 0;
 }
 
-#ifdef MODULE
-#define icn_init init_module
-#else
-#include <linux/init.h>
+#ifndef MODULE
 static int __init
 icn_setup(char *line)
 {
@@ -1667,10 +1665,9 @@ icn_setup(char *line)
        return(1);
 }
 __setup("icn=", icn_setup);
-#endif /* MODULES */
+#endif /* MODULE */
 
-int
-icn_init(void)
+static int __init icn_init(void)
 {
        char *p;
        char rev[10];
@@ -1681,9 +1678,6 @@ icn_init(void)
        dev.mcard = NULL;
        dev.firstload = 1;
 
-       /* No symbols to export, hide all symbols */
-       EXPORT_NO_SYMBOLS;
-
        if ((p = strchr(revision, ':'))) {
                strcpy(rev, p + 1);
                p = strchr(rev, '$');
@@ -1695,9 +1689,7 @@ icn_init(void)
        return (icn_addcard(portbase, icn_id, icn_id2));
 }
 
-#ifdef MODULE
-void
-cleanup_module(void)
+static void __exit icn_exit(void)
 {
        isdn_ctrl cmd;
        icn_card *card = cards;
@@ -1731,4 +1723,6 @@ cleanup_module(void)
                release_shmem((ulong) dev.shmem, 0x4000);
        printk(KERN_NOTICE "ICN-ISDN-driver unloaded\n");
 }
-#endif
+
+module_init(icn_init);
+module_exit(icn_exit);
index fca9dc45d99677255f1b9a6ff906c37faa9df436..0e5c4d81eee75906701bdcf318cd99599223100d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: icn.h,v 1.30 2000/11/13 22:51:48 kai Exp $
+/* $Id: icn.h,v 1.30.6.2 2001/02/16 16:43:31 kai Exp $
 
  * ISDN lowlevel-module for the ICN active ISDN-Card.
  *
@@ -217,9 +217,9 @@ static char *icn_id2 = "\0";
 #ifdef MODULE
 MODULE_AUTHOR("Fritz Elfert");
 MODULE_PARM(portbase, "i");
-MODULE_PARM_DESC(portbase, "Port adress of first card");
+MODULE_PARM_DESC(portbase, "Port address of first card");
 MODULE_PARM(membase, "i");
-MODULE_PARM_DESC(membase, "Shared memory adress of all cards");
+MODULE_PARM_DESC(membase, "Shared memory address of all cards");
 MODULE_PARM(icn_id, "s");
 MODULE_PARM_DESC(icn_id, "ID-String of first card");
 MODULE_PARM(icn_id2, "s");
index 57d99e8833a60a8fad83dd533cb567c574be5011..22ec8bdecf771e3916b019e6b3804f3f65e125ac 100644 (file)
  * SUCH DAMAGE.
  */
 
-#ifndef MODULE
-#error This file must be compiled as a module.
-#endif
-
 #include <linux/module.h>
-
+#include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/types.h>
@@ -919,7 +915,7 @@ static struct isdn_ppp_compressor ippp_bsd_compress = {
  * Module support routines
  *************************************************************/
 
-int init_module(void)
+static int __init isdn_bsdcomp_init(void)
 {
        int answer = isdn_ppp_register_compressor (&ippp_bsd_compress);
        if (answer == 0)
@@ -927,7 +923,10 @@ int init_module(void)
        return answer;
 }
 
-void cleanup_module(void)
+static void __exit isdn_bsdcomp_exit(void)
 {
        isdn_ppp_unregister_compressor (&ippp_bsd_compress);
 }
+
+module_init(isdn_bsdcomp_init);
+module_exit(isdn_bsdcomp_exit);
diff --git a/drivers/isdn/isdn_cards.c b/drivers/isdn/isdn_cards.c
deleted file mode 100644 (file)
index 2687111..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/* $Id: isdn_cards.c,v 1.14 2000/11/23 20:45:14 kai Exp $
-
- * Linux ISDN subsystem, initialization for non-modularized drivers.
- *
- * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <linux/config.h>
-
-#ifdef CONFIG_ISDN_DRV_ICN
-extern void icn_init(void);
-#endif
-
-#ifdef CONFIG_ISDN_DRV_HISAX
-extern void HiSax_init(void);
-#endif
-
-#ifdef CONFIG_ISDN_DRV_PCBIT
-extern void pcbit_init(void);
-#endif
-
-#if defined(CONFIG_ISDN_DRV_EICON_OLD) || defined(CONFIG_ISDN_DRV_EICON_DIVAS)
-extern void eicon_init(void);
-#endif
-
-#if CONFIG_ISDN_DRV_ACT2000
-extern void act2000_init(void);
-#endif
-
-void
-isdn_cards_init(void)
-{
-#if CONFIG_ISDN_DRV_ICN
-       icn_init();
-#endif
-#ifdef CONFIG_ISDN_DRV_HISAX
-       HiSax_init();
-#endif
-#if CONFIG_ISDN_DRV_PCBIT
-       pcbit_init();
-#endif
-#if CONFIG_ISDN_DRV_ACT2000
-       act2000_init();
-#endif
-#if defined(CONFIG_ISDN_DRV_EICON_OLD) || defined(CONFIG_ISDN_DRV_EICON_DIVAS)
-       eicon_init();
-#endif
-}
diff --git a/drivers/isdn/isdn_cards.h b/drivers/isdn/isdn_cards.h
deleted file mode 100644 (file)
index 6122ac8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* $Id: isdn_cards.h,v 1.4 2000/05/11 22:29:20 kai Exp $
-
- * Linux ISDN subsystem, initialization for non-modularized drivers.
- *
- * Copyright 1994-1999 by Fritz Elfert (fritz@isdn4linux.de)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-extern void isdn_cards_init(void);
index 21d789a82005fb6849bf2062ef2d147f0a755ffe..e8bd98c5d3551ac0a6587fef112dbe16a68ba997 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: isdn_common.c,v 1.114.6.6 2001/02/07 11:31:30 kai Exp $
+/* $Id: isdn_common.c,v 1.114.6.8 2001/02/16 16:43:22 kai Exp $
 
  * Linux ISDN subsystem, common used functions (linklevel).
  *
@@ -42,9 +42,8 @@
 #endif
 #ifdef CONFIG_ISDN_DIVERSION
 #include <linux/isdn_divertif.h>
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
 #include "isdn_v110.h"
-#include "isdn_cards.h"
 #include <linux/devfs_fs_kernel.h>
 
 /* Debugflags */
@@ -52,7 +51,7 @@
 
 isdn_dev *dev;
 
-static char *isdn_revision = "$Revision: 1.114.6.6 $";
+static char *isdn_revision = "$Revision: 1.114.6.8 $";
 
 extern char *isdn_net_revision;
 extern char *isdn_tty_revision;
@@ -70,7 +69,7 @@ extern char *isdn_v110_revision;
 
 #ifdef CONFIG_ISDN_DIVERSION
 static isdn_divert_if *divert_if; /* = NULL */
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
 
 
 static int isdn_writebuf_stub(int, int, const u_char *, int, int);
@@ -520,7 +519,7 @@ isdn_status_callback(isdn_ctrl * c)
                                          if (divert_if)
                                          if ((retval = divert_if->stat_callback(c))) 
                                            return(retval); /* processed */
-#endif CONFIG_ISDN_DIVERSION                        
+#endif /* CONFIG_ISDN_DIVERSION */                       
                                        if ((!retval) && (dev->drv[di]->flags & DRV_FLAG_REJBUS)) {
                                                /* No tty responding */
                                                cmd.driver = di;
@@ -593,7 +592,7 @@ isdn_status_callback(isdn_ctrl * c)
 #ifdef CONFIG_ISDN_DIVERSION
                         if (divert_if)
                          divert_if->stat_callback(c); 
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
                        break;
                case ISDN_STAT_DISPLAY:
 #ifdef ISDN_DEBUG_STATCALLB
@@ -603,7 +602,7 @@ isdn_status_callback(isdn_ctrl * c)
 #ifdef CONFIG_ISDN_DIVERSION
                         if (divert_if)
                          divert_if->stat_callback(c); 
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
                        break;
                case ISDN_STAT_DCONN:
                        if (i < 0)
@@ -645,7 +644,7 @@ isdn_status_callback(isdn_ctrl * c)
 #ifdef CONFIG_ISDN_DIVERSION
                         if (divert_if)
                          divert_if->stat_callback(c); 
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
                        break;
                        break;
                case ISDN_STAT_BCONN:
@@ -774,7 +773,7 @@ isdn_status_callback(isdn_ctrl * c)
                case ISDN_STAT_REDIR:
                         if (divert_if)
                           return(divert_if->stat_callback(c));
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
                default:
                        return -1;
        }
@@ -2160,7 +2159,7 @@ int DIVERT_REG_NAME(isdn_divert_if *i_div)
 
 EXPORT_SYMBOL(DIVERT_REG_NAME);
 
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
 
 
 EXPORT_SYMBOL(register_isdn);
@@ -2409,7 +2408,6 @@ static int __init isdn_init(void)
        printk(" loaded\n");
 #else
        printk("\n");
-       isdn_cards_init();
 #endif
        isdn_info_update();
        return 0;
index ccf9ecf351e3d8b1b67a692be5435faeb86ad81d..5dba67d1427c6e78b184f8abe7bdcacfd1dbdfd9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: isdn_tty.c,v 1.94 2000/11/25 17:00:59 kai Exp $
+/* $Id: isdn_tty.c,v 1.94.6.1 2001/02/16 16:43:22 kai Exp $
 
  * Linux ISDN subsystem, tty functions and AT-command emulator (linklevel).
  *
@@ -66,7 +66,7 @@ static int bit2si[8] =
 static int si2bit[8] =
 {4, 1, 4, 4, 4, 4, 4, 4};
 
-char *isdn_tty_revision = "$Revision: 1.94 $";
+char *isdn_tty_revision = "$Revision: 1.94.6.1 $";
 
 
 /* isdn_tty_try_read() is called from within isdn_tty_rcv_skb()
@@ -3773,7 +3773,7 @@ isdn_tty_parse_at(modem_info * info)
                                                 sprintf(ds, "\r\n%d", info->emu.charge);
                                                 isdn_tty_at_cout(ds, info);
                                                 break;
-                                       default:
+                                       default:;
                                }
                                break;
 #ifdef DUMMY_HAYES_AT
index 74bf8562615e1b8329d03de3692e84f056efff66..bb897f8c08999a64ca6d5c5596af55c289742642 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: isdn_v110.c,v 1.5.6.1 2001/01/23 17:45:02 kai Exp $
+/* $Id: isdn_v110.c,v 1.5.6.3 2001/02/16 16:43:23 kai Exp $
 
  * Linux ISDN subsystem, V.110 related functions (linklevel).
  *
@@ -30,7 +30,7 @@
 
 #undef ISDN_V110_DEBUG
 
-char *isdn_v110_revision = "$Revision: 1.5.6.1 $";
+char *isdn_v110_revision = "$Revision: 1.5.6.3 $";
 
 #define V110_38400 255
 #define V110_19200  15
@@ -70,7 +70,7 @@ static unsigned char V110_OffMatrix_38400[] =
  * FlipBits reorders sequences of keylen bits in one byte.
  * E.g. source order 7654321 will be converted to 45670123 when keylen = 4,
  * and to 67452301 when keylen = 2. This is necessary because ordering on
- * the isdn line is the the other way.
+ * the isdn line is the other way.
  */
 static __inline unsigned char
 FlipBits(unsigned char c, int keylen)
@@ -600,7 +600,7 @@ isdn_v110_stat_callback(int idx, isdn_ctrl * c)
                                        case ISDN_PROTO_L2_V11038:
                                                dev->v110[idx] = isdn_v110_open(V110_38400, hdrlen, maxsize);
                                                break;
-                                       default:
+                                       default:;
                                }
                                if ((v = dev->v110[idx])) {
                                        while (v->SyncInit) {
index f91723bbe0785c8a598422436b98adc316b028be..3fb82bfa8d99e6a1286954d8e981e70c381025c2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: isdnloop.c,v 1.11 2000/11/13 22:51:50 kai Exp $
+/* $Id: isdnloop.c,v 1.11.6.2 2001/02/16 16:43:32 kai Exp $
 
  * ISDN low-level module implementing a dummy loop driver.
  *
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
+#include <linux/init.h>
 #include "isdnloop.h"
 
 static char
-*revision = "$Revision: 1.11 $";
+*revision = "$Revision: 1.11.6.2 $";
 
 static int isdnloop_addcard(char *);
 
@@ -975,7 +977,7 @@ isdnloop_parse_cmd(isdnloop_card * card)
  *   user = flag: 1 = called form userlevel, 0 called from kernel.
  *   card = pointer to card struct.
  * Return:
- *   number of bytes transfered (currently always equals len).
+ *   number of bytes transferred (currently always equals len).
  */
 static int
 isdnloop_writecmd(const u_char * buf, int len, int user, isdnloop_card * card)
@@ -1534,22 +1536,7 @@ isdnloop_addcard(char *id1)
        return 0;
 }
 
-#ifdef MODULE
-#define isdnloop_init init_module
-#else
-void
-isdnloop_setup(char *str, int *ints)
-{
-       static char sid[20];
-
-       if (strlen(str)) {
-               strcpy(sid, str);
-               isdnloop_id = sid;
-       }
-}
-#endif
-
-int
+static int __init
 isdnloop_init(void)
 {
        char *p;
@@ -1568,9 +1555,8 @@ isdnloop_init(void)
        return (isdnloop_addcard(isdnloop_id));
 }
 
-#ifdef MODULE
-void
-cleanup_module(void)
+static void __exit
+isdnloop_exit(void)
 {
        isdn_ctrl cmd;
        isdnloop_card *card = cards;
@@ -1598,4 +1584,6 @@ cleanup_module(void)
        }
        printk(KERN_NOTICE "isdnloop-ISDN-driver unloaded\n");
 }
-#endif
+
+module_init(isdnloop_init);
+module_exit(isdnloop_exit);
index c2b005404e790a9287b993b840777e7a93a50b06..fe8a501104fff16b1e567c7d7334bf8ff5cb0f3a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: isdnloop.h,v 1.5 2000/11/13 22:51:50 kai Exp $
+/* $Id: isdnloop.h,v 1.5.6.1 2001/02/10 14:41:23 kai Exp $
 
  * Loopback lowlevel module for testing of linklevel.
  *
index ed2ba29d9814f601ed19c55be1e57c99e87931c1..ab67ae3f22535867c86a69b890cc39e03147a8a6 100644 (file)
@@ -4,7 +4,7 @@
  * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
  *
  * This software may be used and distributed according to the terms of 
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
  */
 
 /*        
index 62e296deeca36a874a0b5ca1546998a9475c6bcb..559b812e093b971ee42e04df867ea3a081d1be93 100644 (file)
@@ -4,7 +4,7 @@
  * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
  *
  * This software may be used and distributed according to the terms of 
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
  */
 
 /*
index 57b23498fe540f25b4706b41d6b1974bc6443acb..60057c9bdb9be26272e24d1498b62b7a541872b5 100644 (file)
@@ -4,7 +4,7 @@
  * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
  *
  * This software may be used and distributed according to the terms of 
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
  */
 
 /*        
index 10bb6bf9104e5ba3de214bb738b092718042f36e..0d960f83a16c4889efda3f3978b13642ceecd310 100644 (file)
@@ -4,7 +4,7 @@
  * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
  *
  * This software may be used and distributed according to the terms of 
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
  */
 
 /*        
index 841a1dd8e1ebfada2d136633c418e3cd09c5bf21..4c35028507796b9421955d9e8dcc4d25e3954966 100644 (file)
@@ -4,7 +4,7 @@
  * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
  *
  * This software may be used and distributed according to the terms of 
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
  */
 
 /*        
index 991f430e66d80070bd9a249c5f6d35c525633c51..e005341fc3dfadd4b1ae3796269b51eb69fd6812 100644 (file)
@@ -4,7 +4,7 @@
  * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
  *
  * This software may be used and distributed according to the terms of 
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
  */
 
 /*        
index 1bf554dd5c4f24549fc0cba15c7e608e4454df9b..22befde381a0b4d07eddff108a3b762de9a106e8 100644 (file)
@@ -4,7 +4,7 @@
  * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
  *
  * This software may be used and distributed according to the terms of 
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
  */
 
 /*        
index e80b12fafc21d8a61aed6da2cbe01d061b445892..e6e8108af79d2ebd2534871365330b03fc67c395 100644 (file)
@@ -4,7 +4,7 @@
  * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
  *
  * This software may be used and distributed according to the terms of
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
  */
 
 /*
index f8984f990e92937963d366215547cf16cc30655b..6d3e6cb3c8db3387f8695a2848979f0e80808f3b 100644 (file)
@@ -4,7 +4,7 @@
  * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
  *
  * This software may be used and distributed according to the terms of 
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
  */
 
 /*
index c85f686883983425de412dc63ca12e7ec44ec0eb..88226f954f3e34216231adc2dd41eb2dce258ef2 100644 (file)
@@ -4,7 +4,7 @@
  * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
  *
  * This software may be used and distributed according to the terms of 
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
  */
 
 /*        
@@ -12,7 +12,7 @@
  */
 
 #include <linux/module.h>
-
+#include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
@@ -26,21 +26,12 @@ static int mem[MAX_PCBIT_CARDS] = {0, };
 static int irq[MAX_PCBIT_CARDS] = {0, };
 
 static int num_boards;
-struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS] = {0, 0, 0, 0};
-
-int init_module(void);
-void cleanup_module(void);
+struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS] = {0, };
 
 extern void pcbit_terminate(int board);
 extern int pcbit_init_dev(int board, int mem_base, int irq);
 
-#ifdef MODULE
-MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i");
-MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i");
-#define pcbit_init init_module
-#endif
-
-int pcbit_init(void)
+static int __init pcbit_init(void)
 {
        int board;
 
@@ -83,15 +74,10 @@ int pcbit_init(void)
                else
                        return -EIO;
        }
-
-       /* No symbols to export, hide all symbols */
-       EXPORT_NO_SYMBOLS;
-
        return 0;
 }
 
-#ifdef MODULE
-void cleanup_module(void)
+static void __exit pcbit_exit(void)
 {
        int board;
 
@@ -101,9 +87,8 @@ void cleanup_module(void)
               "PCBIT-D module unloaded\n");
 }
 
-#else
+#ifndef MODULE
 #define MAX_PARA       (MAX_PCBIT_CARDS * 2)
-#include <linux/init.h>
 static int __init pcbit_setup(char *line)
 {
        int i, j, argc;
@@ -134,5 +119,9 @@ static int __init pcbit_setup(char *line)
 __setup("pcbit=", pcbit_setup);
 #endif
 
+MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i");
+MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i");
 
+module_init(pcbit_init);
+module_exit(pcbit_exit);
 
index 99aab08ccfee903e979f791b64c07331a267df7c..8ce921f07730de9c6c41ea7443e465d19307c136 100644 (file)
@@ -4,7 +4,7 @@
  * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
  *
  * This software may be used and distributed according to the terms of 
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
  */
 
 /*        
index e379ae44255d5192ccb78deed94975a03dff23a0..df77564350619505f252f9dff8972c22b65bacf2 100644 (file)
@@ -1,3 +1,5 @@
+#include <linux/module.h>
+#include <linux/init.h>
 #include "includes.h"
 #include "hardware.h"
 #include "card.h"
@@ -37,23 +39,12 @@ int irq_supported(int irq_x)
        return 0;
 }
 
-#ifdef MODULE
 MODULE_PARM(io, "1-4i");
 MODULE_PARM(irq, "1-4i");
 MODULE_PARM(ram, "1-4i");
 MODULE_PARM(do_reset, "i");
-#define init_sc init_module
-#else
-/*
-Initialization code for non-module version to be included
 
-void sc_setup(char *str, int *ints)
-{
-}
-*/
-#endif
-
-int init_sc(void)
+static int __init sc_init(void)
 {
        int b = -1;
        int i, j;
@@ -410,8 +401,7 @@ int init_sc(void)
        return status;
 }
 
-#ifdef MODULE
-void cleanup_module(void)
+static void __exit sc_exit(void)
 {
        int i, j;
 
@@ -463,7 +453,6 @@ void cleanup_module(void)
        }
        pr_info("SpellCaster ISA ISDN Adapter Driver Unloaded.\n");
 }
-#endif
 
 int identify_board(unsigned long rambase, unsigned int iobase) 
 {
@@ -579,3 +568,6 @@ int identify_board(unsigned long rambase, unsigned int iobase)
                
        return -1;
 }
+
+module_init(sc_init);
+module_exit(sc_exit);
index 25964752ba6956b07a1aa8df292f503e9e8b3793..c38c47383a7e32f13197e3ddfbef8c3b9ce1fa16 100644 (file)
@@ -141,7 +141,7 @@ void interrupt_handler(int interrupt, void * cardptr, struct pt_regs *regs ) {
                        }
                        else if(callid>=0x0000 && callid<=0x7FFF)
                        {
-                               pr_debug("%s: Got Incomming Call\n", adapter[card]->devicename);        
+                               pr_debug("%s: Got Incoming Call\n", adapter[card]->devicename); 
                                strcpy(setup.phone,&(rcvmsg.msg_data.byte_array[4]));
                                strcpy(setup.eazmsn,adapter[card]->channel[rcvmsg.phy_link_no-1].dn);
                                setup.si1 = 7;
index b2ed89dcca29876158f5be443eac95eae218fa13..a4102738a861dace71d219342a66374cedc0db5a 100644 (file)
@@ -682,6 +682,8 @@ static void unlock_rdev (mdk_rdev_t *rdev)
        rdev->bdev = NULL;
 }
 
+void md_autodetect_dev (kdev_t dev);
+
 static void export_rdev (mdk_rdev_t * rdev)
 {
        printk("export_rdev(%s)\n",partition_name(rdev->dev));
@@ -696,6 +698,7 @@ static void export_rdev (mdk_rdev_t * rdev)
                md_list_del(&rdev->pending);
                MD_INIT_LIST_HEAD(&rdev->pending);
        }
+       md_autodetect_dev(rdev->dev);
        rdev->dev = 0;
        rdev->faulty = 0;
        kfree(rdev);
@@ -3584,7 +3587,7 @@ struct {
 static int detected_devices[128] md__initdata;
 static int dev_cnt;
 
-void md_autodetect_dev(kdev_t dev)
+void md_autodetect_dev (kdev_t dev)
 {
        if (dev_cnt >= 0 && dev_cnt < 127)
                detected_devices[dev_cnt++] = dev;
@@ -3598,7 +3601,7 @@ static void autostart_arrays (void)
 
        printk(KERN_INFO "autodetecting RAID arrays\n");
 
-       for (i=0; i<dev_cnt; i++) {
+       for (i = 0; i < dev_cnt; i++) {
                kdev_t dev = detected_devices[i];
 
                if (md_import_device(dev,1)) {
@@ -3620,6 +3623,7 @@ static void autostart_arrays (void)
                }
                md_list_add(&rdev->pending, &pending_raid_disks);
        }
+       dev_cnt = 0;
 
        autorun_devices(-1);
 }
@@ -3656,7 +3660,7 @@ static int md__init md_setup(char *str)
        kdev_t device;
        char *devnames, *pername = "";
 
-       if(get_option(&str, &minor) != 2) {     /* MD Number */
+       if (get_option(&str, &minor) != 2) {    /* MD Number */
                printk("md: Too few arguments supplied to md=.\n");
                return 0;
        }
@@ -3667,7 +3671,7 @@ static int md__init md_setup(char *str)
                printk ("md: Warning - md=%d,... has been specified twice;\n"
                        "    will discard the first definition.\n", minor);
        }
-       switch(get_option(&str, &level)) {      /* RAID Personality */
+       switch (get_option(&str, &level)) {     /* RAID Personality */
        case 2: /* could be 0 or -1.. */
                if (level == 0 || level == -1) {
                        if (get_option(&str, &factor) != 2 ||   /* Chunk Size */
@@ -3820,7 +3824,6 @@ int md__init md_run_setup(void)
                printk(KERN_INFO "skipping autodetection of RAID arrays\n");
        else
                autostart_arrays();
-       dev_cnt = -1; /* make sure further calls to md_autodetect_dev are ignored */
        md_setup_drive();
        return 0;
 }
index 7d681854374b691ef155fdcf5a31e31f49d95935..072c7e5202c1f437f59d6754e78e1b4ddb05cb13 100644 (file)
@@ -21,6 +21,7 @@ dep_tristate '  GemTek Radio Card support' CONFIG_RADIO_GEMTEK $CONFIG_VIDEO_DEV
 if [ "$CONFIG_RADIO_GEMTEK" = "y" ]; then
    hex '    GemTek i/o port (0x20c, 0x30c, 0x24c or 0x34c)' CONFIG_RADIO_GEMTEK_PORT 34c
 fi
+dep_tristate '  Guillemot MAXI Radio FM 2000 radio' CONFIG_RADIO_MAXIRADIO $CONFIG_VIDEO_DEV
 dep_tristate '  Maestro on board radio' CONFIG_RADIO_MAESTRO $CONFIG_VIDEO_DEV
 dep_tristate '  Miro PCM20 Radio' CONFIG_RADIO_MIROPCM20 $CONFIG_VIDEO_DEV
 dep_tristate '  SF16FMI Radio' CONFIG_RADIO_SF16FMI $CONFIG_VIDEO_DEV
index c7a621228511a2404e86a113fae227b27c5b1a7d..a6dbc3fc5095fa8098a4b0ec106f0f5a4bcde3ab 100644 (file)
@@ -31,6 +31,7 @@ obj-$(CONFIG_RADIO_SF16FMI) += radio-sf16fmi.o
 obj-$(CONFIG_RADIO_CADET) += radio-cadet.o
 obj-$(CONFIG_RADIO_TYPHOON) += radio-typhoon.o
 obj-$(CONFIG_RADIO_TERRATEC) += radio-terratec.o
+obj-$(CONFIG_RADIO_MAXIRADIO) += radio-maxiradio.o
 obj-$(CONFIG_RADIO_RTRACK) += radio-aimslab.o
 obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o
 obj-$(CONFIG_RADIO_MIROPCM20) += radio-miropcm20.o
index 2ee8c926668e40c04f4ea44e98475b0ebe537fdb..e9b08291095b098550b25505f5d32ac519682fd9 100644 (file)
@@ -308,20 +308,19 @@ static int rt_open(struct video_device *dev, int flags)
        if(users)
                return -EBUSY;
        users++;
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
 static void rt_close(struct video_device *dev)
 {
        users--;
-       MOD_DEC_USE_COUNT;
 }
 
 static struct rt_device rtrack_unit;
 
 static struct video_device rtrack_radio=
 {
+       owner:          THIS_MODULE,
        name:           "RadioTrack radio",
        type:           VID_TYPE_TUNER,
        hardware:       VID_HARDWARE_RTRACK,
index 5c31a7b24f03de7bfef7d404fed55d00339f0d03..d2ff088f0eb27d676895f2ec83e0ea7fd54bd432 100644 (file)
@@ -259,20 +259,19 @@ static int az_open(struct video_device *dev, int flags)
        if(users)
                return -EBUSY;
        users++;
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
 static void az_close(struct video_device *dev)
 {
        users--;
-       MOD_DEC_USE_COUNT;
 }
 
 static struct az_device aztech_unit;
 
 static struct video_device aztech_radio=
 {
+       owner:          THIS_MODULE,
        name:           "Aztech radio",
        type:           VID_TYPE_TUNER,
        hardware:       VID_HARDWARE_AZTECH,
index 8ffe83a88f655492ddb44abac137c8f95818cb7a..5a7295cb2bf6bef4ee5fb1459c598b03cf9ef8c2 100644 (file)
  * 2000-04-29  Russell Kroll <rkroll@exploits.org>
  *             Added ISAPnP detection for Linux 2.3/2.4
  *
+ * 2001-01-10  Russell Kroll <rkroll@exploits.org>
+ *             Removed dead CONFIG_RADIO_CADET_PORT code
+ *             PnP detection on load is now default (no args necessary)
+ *
 */
 
 #include <linux/module.h>      /* Modules                      */
 #include <asm/io.h>            /* outb, outb_p                 */
 #include <asm/uaccess.h>       /* copy to/from user            */
 #include <linux/videodev.h>    /* kernel radio structs         */
-#include <linux/config.h>      /* CONFIG_RADIO_CADET_PORT      */
 #include <linux/param.h>
 #include <linux/isapnp.h>
 
-#ifndef CONFIG_RADIO_CADET_PORT
-#define CONFIG_RADIO_CADET_PORT 0x330
-#endif
 #define RDS_BUFFER 256
 
-static int io=CONFIG_RADIO_CADET_PORT; 
+static int io=-1;              /* default to isapnp activation */
 static int users=0;
 static int curtuner=0;
 static int tunestat=0;
@@ -518,7 +518,6 @@ static int cadet_open(struct video_device *dev, int flags)
        if(users)
                return -EBUSY;
        users++;
-       MOD_INC_USE_COUNT;
        init_waitqueue_head(&readq);
        return 0;
 }
@@ -530,12 +529,12 @@ static void cadet_close(struct video_device *dev)
                rdsstat=0;
        }
        users--;
-       MOD_DEC_USE_COUNT;
 }
 
 
 static struct video_device cadet_radio=
 {
+       owner:          THIS_MODULE,
        name:           "Cadet radio",
        type:           VID_TYPE_TUNER,
        hardware:       VID_HARDWARE_CADET,
@@ -587,6 +586,11 @@ static int cadet_probe(void)
        return -1;
 }
 
+       /* 
+        * io should only be set if the user has used something like
+        * isapnp (the userspace program) to initialize this card for us
+        */
+
 static int __init cadet_init(void)
 {
        /*
@@ -627,6 +631,14 @@ MODULE_DESCRIPTION("A driver for the ADS Cadet AM/FM/RDS radio card.");
 MODULE_PARM(io, "i");
 MODULE_PARM_DESC(io, "I/O address of Cadet card (0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e)");
 
+static struct isapnp_device_id id_table[] __devinitdata = {
+       {       ISAPNP_ANY_ID, ISAPNP_ANY_ID,
+               ISAPNP_VENDOR('M','S','M'), ISAPNP_FUNCTION(0x0c24), 0 },
+       {0}
+};
+
+MODULE_DEVICE_TABLE(isapnp, id_table);
+
 EXPORT_NO_SYMBOLS;
 
 static void __exit cadet_cleanup_module(void)
index 9e140d1144660d31fa13dea556c3d159f0983153..adc296d4dbfb6b55c5ca9a4a1806db4c6d740250 100644 (file)
@@ -235,20 +235,19 @@ static int gemtek_open(struct video_device *dev, int flags)
        if(users)
                return -EBUSY;
        users++;
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
 static void gemtek_close(struct video_device *dev)
 {
        users--;
-       MOD_DEC_USE_COUNT;
 }
 
 static struct gemtek_device gemtek_unit;
 
 static struct video_device gemtek_radio=
 {
+       owner:          THIS_MODULE,
        name:           "GemTek radio",
        type:           VID_TYPE_TUNER,
        hardware:       VID_HARDWARE_GEMTEK,
index 8040afd902797b4b123f159506aae46f48e23412..7b3ae6c7ed7d709474d23d7642c34bfe5f1db905 100644 (file)
@@ -69,6 +69,7 @@ static void radio_close(struct video_device *);
 
 static struct video_device maestro_radio=
 {
+       owner:          THIS_MODULE,
        name:           "Maestro radio",
        type:           VID_TYPE_TUNER,
        hardware:       VID_HARDWARE_SF16MI,
@@ -282,14 +283,12 @@ static int radio_open(struct video_device *dev, int flags)
        if(users)
                return -EBUSY;
        users++;
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
 static void radio_close(struct video_device *dev)
 {
        users--;
-       MOD_DEC_USE_COUNT;
 }
 
 
diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c
new file mode 100644 (file)
index 0000000..8fe0f9a
--- /dev/null
@@ -0,0 +1,388 @@
+/* 
+ * Guillemot Maxi Radio FM 2000 PCI radio card driver for Linux 
+ * (C) 2001 Dimitromanolakis Apostolos <apdim@grecian.net>
+ *
+ * Based in the radio Maestro PCI driver. Actually it uses the same chip
+ * for radio but different pci controller.
+ *
+ * I didn't have any specs I reversed engineered the protocol from
+ * the windows driver (radio.dll). 
+ *
+ * The card uses the TEA5757 chip that includes a search function but it
+ * is useless as I haven't found any way to read back the frequency. If 
+ * anybody does please mail me.
+ *
+ * For the pdf file see:
+ * http://www.semiconductors.philips.com/pip/TEA5757H/V1
+ *
+ *
+ * CHANGES:
+ *   0.75b
+ *     - better pci interface thanks to Francois Romieu <romieu@cogenit.fr>
+ *
+ *   0.75
+ *     - tiding up
+ *     - removed support for multiple devices as it didn't work anyway
+ *
+ * BUGS: 
+ *   - card unmutes if you change frequency
+ *
+ */
+
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/delay.h>
+#include <linux/sched.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/semaphore.h>
+#include <linux/pci.h>
+#include <linux/videodev.h>
+
+/* version 0.75      Sun Feb  4 22:51:27 EET 2001 */
+#define DRIVER_VERSION "0.75"
+
+#ifndef PCI_VENDOR_ID_GUILLEMOT
+#define PCI_VENDOR_ID_GUILLEMOT 0x5046
+#endif
+
+#ifndef PCI_DEVICE_ID_GUILLEMOT
+#define PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO 0x1001
+#endif
+
+
+/* TEA5757 pin mappings */
+const int clk = 1, data = 2, wren = 4, mo_st = 8, power = 16 ;
+
+
+#define FREQ_LO                 50*16000
+#define FREQ_HI                150*16000
+
+#define FREQ_IF         171200 /* 10.7*16000   */
+#define FREQ_STEP       200    /* 12.5*16      */
+
+#define FREQ2BITS(x)   ((( (unsigned int)(x)+FREQ_IF+(FREQ_STEP<<1))\
+                       /(FREQ_STEP<<2))<<2) /* (x==fmhz*16*1000) -> bits */
+
+#define BITS2FREQ(x)   ((x) * FREQ_STEP - FREQ_IF)
+
+
+static int radio_open(struct video_device *, int);
+static int radio_ioctl(struct video_device *, unsigned int, void *);
+static void radio_close(struct video_device *);
+
+static struct video_device maxiradio_radio=
+{
+       owner:          THIS_MODULE,
+       name:           "Maxi Radio FM2000 radio",
+       type:           VID_TYPE_TUNER,
+       hardware:       VID_HARDWARE_SF16MI,
+       open:           radio_open,
+       close:          radio_close,
+       ioctl:          radio_ioctl,
+};
+
+static struct radio_device
+{
+       __u16   io,     /* base of radio io */
+               muted,  /* VIDEO_AUDIO_MUTE */
+               stereo, /* VIDEO_TUNER_STEREO_ON */     
+               tuned;  /* signal strength (0 or 0xffff) */
+               
+       unsigned long freq;
+       
+       struct  semaphore lock;
+} radio_unit = {0, 0, 0, 0, };
+
+
+static void sleep_125ms(void)
+{
+       current->state = TASK_INTERRUPTIBLE;
+       schedule_timeout(HZ >> 3);
+}
+
+
+static void outbit(unsigned long bit, __u16 io)
+{
+       if(bit != 0)
+               {
+                       outb(  power|wren|data     ,io); udelay(4);
+                       outb(  power|wren|data|clk ,io); udelay(4);
+                       outb(  power|wren|data     ,io); udelay(4);
+               }
+       else    
+               {
+                       outb(  power|wren          ,io); udelay(4);
+                       outb(  power|wren|clk      ,io); udelay(4);
+                       outb(  power|wren          ,io); udelay(4);
+               }
+}
+
+static void turn_power(__u16 io, int p)
+{
+       if(p != 0) outb(power, io); else outb(0,io);
+}
+
+
+static void set_freq(__u16 io, __u32 data)
+{
+       unsigned long int si;
+       int bl;
+       
+       /* TEA5757 shift register bits (see pdf) */
+
+       outbit(0,io); // 24  search 
+       outbit(1,io); // 23  search up/down
+       
+       outbit(0,io); // 22  stereo/mono
+
+       outbit(0,io); // 21  band
+       outbit(0,io); // 20  band (only 00=FM works I think)
+
+       outbit(0,io); // 19  port ?
+       outbit(0,io); // 18  port ?
+       
+       outbit(0,io); // 17  search level
+       outbit(0,io); // 16  search level
+       si = 0x8000;
+       for(bl = 1; bl <= 16 ; bl++) { outbit(data & si,io); si >>=1; }
+       
+       outb(power,io);
+}
+
+static int get_stereo(__u16 io)
+{      
+       outb(power,io); udelay(4);
+       return !(inb(io) & mo_st);
+}
+
+static int get_tune(__u16 io)
+{      
+       outb(power+clk,io); udelay(4);
+       return !(inb(io) & mo_st);
+}
+
+
+inline static int radio_function(struct video_device *dev, 
+                                unsigned int cmd, void *arg)
+{
+       struct radio_device *card=dev->priv;
+       switch(cmd) {
+               case VIDIOCGCAP: {
+                       struct video_capability v;
+                       
+                       strcpy(v.name, "Maxi Radio FM2000 radio");
+                       v.type=VID_TYPE_TUNER;
+                       v.channels=v.audios=1;
+                       v.maxwidth=v.maxheight=v.minwidth=v.minheight=0;
+                       
+                       if(copy_to_user(arg,&v,sizeof(v)))
+                               return -EFAULT;
+                               
+                       return 0;
+               }
+               case VIDIOCGTUNER: {
+                       struct video_tuner v;
+                       
+                       if(copy_from_user(&v, arg,sizeof(v))!=0)
+                               return -EFAULT;
+                               
+                       if(v.tuner)
+                               return -EINVAL;
+                               
+                       card->stereo = 0xffff * get_stereo(card->io);
+                       card->tuned = 0xffff * get_tune(card->io);
+                       
+                       v.flags = VIDEO_TUNER_LOW | card->stereo;
+                       v.signal = card->tuned;
+                       
+                       strcpy(v.name, "FM");
+                       
+                       v.rangelow = FREQ_LO;
+                       v.rangehigh = FREQ_HI;
+                       v.mode = VIDEO_MODE_AUTO;
+                       
+                       if(copy_to_user(arg,&v, sizeof(v)))
+                               return -EFAULT;
+                               
+                 return 0;
+               }
+               case VIDIOCSTUNER: {
+                       struct video_tuner v;
+                       
+                       if(copy_from_user(&v, arg, sizeof(v)))
+                               return -EFAULT;
+                               
+                       if(v.tuner!=0)
+                               return -EINVAL;
+                               
+                       return 0;
+               }
+               case VIDIOCGFREQ: {
+                       unsigned long tmp=card->freq;
+                       
+                       if(copy_to_user(arg, &tmp, sizeof(tmp)))
+                               return -EFAULT;
+                               
+                       return 0;
+               }
+               
+               case VIDIOCSFREQ: {
+                       unsigned long tmp;
+                       
+                       if(copy_from_user(&tmp, arg, sizeof(tmp)))
+                               return -EFAULT;
+                               
+                       if ( tmp<FREQ_LO || tmp>FREQ_HI )
+                               return -EINVAL;
+                               
+                       card->freq = tmp;
+                       
+                       set_freq(card->io, FREQ2BITS(card->freq));
+                       sleep_125ms();
+
+                       return 0;
+               }
+               case VIDIOCGAUDIO: {    
+                       struct video_audio v;
+                       strcpy(v.name, "Radio");
+                       v.audio=v.volume=v.bass=v.treble=v.balance=v.step=0;
+                       v.flags=VIDEO_AUDIO_MUTABLE | card->muted;
+                       v.mode=VIDEO_SOUND_STEREO;
+                       if(copy_to_user(arg,&v, sizeof(v)))
+                               return -EFAULT;
+                       return 0;               
+               }
+               
+               case VIDIOCSAUDIO: {
+                       struct video_audio v;
+                       
+                       if(copy_from_user(&v, arg, sizeof(v)))
+                               return -EFAULT;
+                               
+                       if(v.audio)
+                               return -EINVAL;
+                               
+                       
+                       card->muted = v.flags & VIDEO_AUDIO_MUTE;
+                               
+                       if(card->muted)
+                               turn_power(card->io, 0);
+                       else
+                               set_freq(card->io, FREQ2BITS(card->freq));
+                               
+                       return 0;
+               }
+               
+               case VIDIOCGUNIT: {
+                       struct video_unit v;
+                       v.video=VIDEO_NO_UNIT;
+                       v.vbi=VIDEO_NO_UNIT;
+                       v.radio=dev->minor;
+                       v.audio=0;
+                       v.teletext=VIDEO_NO_UNIT;
+                       if(copy_to_user(arg, &v, sizeof(v)))
+                               return -EFAULT;
+                       return 0;               
+               }
+               default: return -ENOIOCTLCMD;
+       }
+}
+
+static int radio_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
+{
+       struct radio_device *card=dev->priv;
+       int ret;
+       down(&card->lock);
+       ret = radio_function(dev, cmd, arg);
+       up(&card->lock);
+       return ret;
+}
+
+static int radio_open(struct video_device *dev, int flags)
+{
+       return 0;
+}
+
+static void radio_close(struct video_device *dev)
+{
+}
+
+MODULE_AUTHOR("Dimitromanolakis Apostolos, apdim@grecian.net");
+MODULE_DESCRIPTION("Radio driver for the Guillemot Maxi Radio FM2000 radio.");
+
+EXPORT_NO_SYMBOLS;
+
+static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+{
+       if(!request_region(pci_resource_start(pdev, 0),
+                          pci_resource_len(pdev, 0), "Maxi Radio FM 2000")) {
+               printk(KERN_ERR "radio-maxiradio: can't reserve I/O ports\n");
+               goto err_out;
+       }
+
+       if (pci_enable_device(pdev))
+               goto err_out_free_region;
+
+       radio_unit.io = pci_resource_start(pdev, 0);
+       init_MUTEX(&radio_unit.lock);
+       maxiradio_radio.priv = &radio_unit;
+
+       if(video_register_device(&maxiradio_radio, VFL_TYPE_RADIO)==-1) {
+               printk("radio-maxiradio: can't register device!");
+               goto err_out_free_region;
+       }
+
+       printk(KERN_INFO "radio-maxiradio: version "
+              DRIVER_VERSION
+              " time "
+              __TIME__ "  "
+              __DATE__
+              "\n");
+
+       printk(KERN_INFO "radio-maxiradio: found Guillemot MAXI Radio device (io = 0x%x)\n",
+              radio_unit.io);
+       return 0;
+
+err_out_free_region:
+       release_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
+err_out:
+       return -ENODEV;
+}
+
+static void __devexit maxiradio_remove_one(struct pci_dev *pdev)
+{
+       video_unregister_device(&maxiradio_radio);
+       release_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
+}
+
+static struct pci_device_id maxiradio_pci_tbl[] __devinitdata = {
+       { PCI_VENDOR_ID_GUILLEMOT, PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO,
+               PCI_ANY_ID, PCI_ANY_ID, },
+       { 0,}
+};
+
+MODULE_DEVICE_TABLE(pci, maxiradio_pci_tbl);
+
+static struct pci_driver maxiradio_driver = {
+       name:           "radio-maxiradio",
+       id_table:       maxiradio_pci_tbl,
+       probe:          maxiradio_init_one,
+       remove:         maxiradio_remove_one,
+};
+
+int __init maxiradio_radio_init(void)
+{
+       return pci_module_init(&maxiradio_driver);
+}
+
+void __exit maxiradio_radio_exit(void)
+{
+       pci_unregister_driver(&maxiradio_driver);
+}
+
+module_init(maxiradio_radio_init);
+module_exit(maxiradio_radio_exit);
index 036ca6f51ba9fef7c649e16653b046551dd5761d..171995e5ac8db13503b1d9ce332a15df48c7566c 100644 (file)
@@ -178,20 +178,19 @@ static int pcm20_open(struct video_device *dev, int flags)
        if(users)
                return -EBUSY;
        users++;
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
 static void pcm20_close(struct video_device *dev)
 {
        users--;
-       MOD_DEC_USE_COUNT;
 }
 
 static struct pcm20_device pcm20_unit;
 
 static struct video_device pcm20_radio=
 {
+       owner:          THIS_MODULE,
        name:           "Miro PCM 20 radio",
        type:           VID_TYPE_TUNER,
        hardware:       VID_HARDWARE_RTRACK,
index e101dd44b794ed7d9540769f50f04c3db6443ccd..693b7349831ceb86037845722828c3483e197eaf 100644 (file)
@@ -201,20 +201,19 @@ static int rt_open(struct video_device *dev, int flags)
        if(users)
                return -EBUSY;
        users++;
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
 static void rt_close(struct video_device *dev)
 {
        users--;
-       MOD_DEC_USE_COUNT;
 }
 
 static struct rt_device rtrack2_unit;
 
 static struct video_device rtrack2_radio=
 {
+       owner:          THIS_MODULE,
        name:           "RadioTrack II radio",
        type:           VID_TYPE_TUNER,
        hardware:       VID_HARDWARE_RTRACK2,
index b8a975e0da3d130e591061e79f890a1ba1e8ce3f..809890e41d2cf914a307f49ebcc8ce1b4a5c1270 100644 (file)
@@ -41,7 +41,7 @@ static int users = 0;
 static struct semaphore lock;
 
 /* freq is in 1/16 kHz to internal number, hw precision is 50 kHz */
-/* It is only usefull to give freq in intervall of 800 (=0.05Mhz),
+/* It is only useful to give freq in intervall of 800 (=0.05Mhz),
  * other bits will be truncated, e.g 92.7400016 -> 92.7, but 
  * 92.7400017 -> 92.75
  */
@@ -262,20 +262,19 @@ static int fmi_open(struct video_device *dev, int flags)
        if(users)
                return -EBUSY;
        users++;
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
 static void fmi_close(struct video_device *dev)
 {
        users--;
-       MOD_DEC_USE_COUNT;
 }
 
 static struct fmi_device fmi_unit;
 
 static struct video_device fmi_radio=
 {
+       owner:          THIS_MODULE,
        name:           "SF16FMx radio",
        type:           VID_TYPE_TUNER,
        hardware:       VID_HARDWARE_SF16MI,
index b97cb9872315bb9a30fe02d0641689f31c82ea45..af26a57422f2206a88c8a6213c7677d4a281fa64 100644 (file)
@@ -280,20 +280,19 @@ static int tt_open(struct video_device *dev, int flags)
        if(users)
                return -EBUSY;
        users++;
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
 static void tt_close(struct video_device *dev)
 {
        users--;
-       MOD_DEC_USE_COUNT;
 }
 
 static struct tt_device terratec_unit;
 
 static struct video_device terratec_radio=
 {
+       owner:          THIS_MODULE,
        name:           "TerraTec ActiveRadio",
        type:           VID_TYPE_TUNER,
        hardware:       VID_HARDWARE_TERRATEC,
index 5e9802dec690d0b8a8be8833adf2c58b5e552bfd..b67ae93e1dfb4784af456a2c61b4d239ffd8f146 100644 (file)
@@ -274,18 +274,17 @@ static int tr_open(struct video_device *dev, int flags)
        if(users)
                return -EBUSY;
        users++;
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
 static void tr_close(struct video_device *dev)
 {
        users--;
-       MOD_DEC_USE_COUNT;
 }
 
 static struct video_device trust_radio=
 {
+       owner:          THIS_MODULE,
        name:           "Trust FM Radio",
        type:           VID_TYPE_TUNER,
        hardware:       VID_HARDWARE_TRUST,
index 5b37656fddcb028d3a9575ef146d97a1c0578cae..23a6b09133d0a106b628bdb39491d513ff031e90 100644 (file)
@@ -260,7 +260,6 @@ static int typhoon_open(struct video_device *dev, int flags)
        if (typhoon->users)
                return -EBUSY;
        typhoon->users++;
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
@@ -268,7 +267,6 @@ static void typhoon_close(struct video_device *dev)
 {
        struct typhoon_device *typhoon = dev->priv;
        typhoon->users--;
-       MOD_DEC_USE_COUNT;
 }
 
 static struct typhoon_device typhoon_unit =
@@ -280,6 +278,7 @@ static struct typhoon_device typhoon_unit =
 
 static struct video_device typhoon_radio =
 {
+       owner:          THIS_MODULE,
        name:           "Typhoon Radio",
        type:           VID_TYPE_TUNER,
        hardware:       VID_HARDWARE_TYPHOON,
index 075db363c90930f43283db47ad9ae21d8581fe03..a9f4ee4ac36d8c4fc7021f7c5dafe6f75d1a8791 100644 (file)
@@ -327,20 +327,19 @@ static int zol_open(struct video_device *dev, int flags)
        if (users)
                return -EBUSY;
        users++;
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
 static void zol_close(struct video_device *dev)
 {
        users--;
-       MOD_DEC_USE_COUNT;
 }
 
 static struct zol_device zoltrix_unit;
 
 static struct video_device zoltrix_radio =
 {
+       owner:          THIS_MODULE,
        name:           "Zoltrix Radio Plus",
        type:           VID_TYPE_TUNER,
        hardware:       VID_HARDWARE_ZOLTRIX,
index 9809a7345cad4760f008e562229d653ff2bbefaf..d39ecf03697f39c7db751ea8be10d7e08170a8af 100644 (file)
@@ -1352,7 +1352,6 @@ static int bttv_open(struct video_device *dev, int flags)
        if (bttv_debug)
                printk("bttv%d: open called\n",btv->nr);
 
-       MOD_INC_USE_COUNT;
        down(&btv->lock);
        if (btv->user)
                goto out_unlock;
@@ -1378,7 +1377,6 @@ static int bttv_open(struct video_device *dev, int flags)
 
  out_unlock:
        up(&btv->lock);
-       MOD_DEC_USE_COUNT;
        return ret;
 }
 
@@ -1423,7 +1421,6 @@ static void bttv_close(struct video_device *dev)
                rvfree((void *) btv->fbuffer, gbuffers*gbufsize);
        btv->fbuffer=0;
        up(&btv->lock);
-       MOD_DEC_USE_COUNT;  
 }
 
 
@@ -2053,6 +2050,7 @@ static int bttv_mmap(struct video_device *dev, const char *adr, unsigned long si
 
 static struct video_device bttv_template=
 {
+       owner:          THIS_MODULE,
        name:           "UNSET",
        type:           VID_TYPE_TUNER|VID_TYPE_CAPTURE|VID_TYPE_OVERLAY|VID_TYPE_TELETEXT,
        hardware:       VID_HARDWARE_BT848,
@@ -2140,7 +2138,6 @@ static int vbi_open(struct video_device *dev, int flags)
        struct bttv *btv=(struct bttv *)(dev-2);
        unsigned long irq_flags;
 
-       MOD_INC_USE_COUNT;
         down(&btv->lock);
        if (btv->needs_restart)
                bt848_restart(btv);
@@ -2164,7 +2161,6 @@ static void vbi_close(struct video_device *dev)
        btv->vbi_on = 0;
        bt848_set_risc_jmps(btv,-1);
        spin_unlock_irqrestore(&btv->s_lock, irq_flags);
-       MOD_DEC_USE_COUNT;  
 }
 
 static int vbi_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
@@ -2202,6 +2198,7 @@ static int vbi_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
 
 static struct video_device vbi_template=
 {
+       owner:          THIS_MODULE,
        name:           "bttv vbi",
        type:           VID_TYPE_CAPTURE|VID_TYPE_TELETEXT,
        hardware:       VID_HARDWARE_BT848,
@@ -2220,7 +2217,6 @@ static int radio_open(struct video_device *dev, int flags)
        struct bttv *btv = (struct bttv *)(dev-1);
        unsigned long v;
 
-       MOD_INC_USE_COUNT;
         down(&btv->lock);
        if (btv->user)
                goto busy_unlock;
@@ -2237,7 +2233,6 @@ static int radio_open(struct video_device *dev, int flags)
 
  busy_unlock:
        up(&btv->lock);
-       MOD_DEC_USE_COUNT;
        return -EBUSY;
 }
 
@@ -2249,7 +2244,6 @@ static void radio_close(struct video_device *dev)
        btv->user--;
        btv->radio = 0;
        up(&btv->lock);
-       MOD_DEC_USE_COUNT;  
 }
 
 static long radio_read(struct video_device *v, char *buf, unsigned long count, int nonblock)
@@ -2320,6 +2314,7 @@ static int radio_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
 
 static struct video_device radio_template=
 {
+       owner:          THIS_MODULE,
        name:           "bttv radio",
        type:           VID_TYPE_TUNER,
        hardware:       VID_HARDWARE_BT848,
index 1003edc543df70093ccfb6449f4132c7eeb55bbe..f34a2e5f8308ec79eaa3e7b36b778deedb797fbf 100644 (file)
@@ -696,13 +696,11 @@ long qc_capture(struct qcam_device * q, char *buf, unsigned long len)
 
 static int qcam_open(struct video_device *dev, int flags)
 {
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
 static void qcam_close(struct video_device *dev)
 {
-       MOD_DEC_USE_COUNT;
 }
 
 static long qcam_write(struct video_device *v, const char *buf, unsigned long count, int noblock)
@@ -918,6 +916,7 @@ static long qcam_read(struct video_device *v, char *buf, unsigned long count,  i
  
 static struct video_device qcam_template=
 {
+       owner:          THIS_MODULE,
        name:           "Connectix Quickcam",
        type:           VID_TYPE_CAPTURE,
        hardware:       VID_HARDWARE_QCAM_BW,
index c8487d69c6b434a5a4abb02b2631ba473299a33b..6ea7818ff06578feaaca7226a6672f5d5c741885 100644 (file)
@@ -500,13 +500,11 @@ static long qc_capture(struct qcam_device *q, char *buf, unsigned long len)
 
 static int qcam_open(struct video_device *dev, int flags)
 {
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
 static void qcam_close(struct video_device *dev)
 {
-       MOD_DEC_USE_COUNT;
 }
 
 static long qcam_write(struct video_device *v, const char *buf, unsigned long count, int noblock)
@@ -725,6 +723,7 @@ static long qcam_read(struct video_device *v, char *buf, unsigned long count,  i
 /* video device template */
 static struct video_device qcam_template=
 {
+       owner:          THIS_MODULE,
        name:           "Colour QuickCam",
        type:           VID_TYPE_CAPTURE,
        hardware:       VID_HARDWARE_QCAM_C,
index 0241b55ab454897a1eed9154c80b9db91cbb7858..333c6b2171c4dd8235a8f0e70c1256427ccc7fcf 100644 (file)
@@ -2499,9 +2499,6 @@ static int cpia_open(struct video_device *dev, int flags)
        cam->mmap_kludge = 0;
        
        ++cam->open_count;
-#ifdef MODULE
-       MOD_INC_USE_COUNT;
-#endif
        return 0;
 }
 
@@ -2554,9 +2551,6 @@ static void cpia_close(struct video_device *dev)
        }
        
 
-#ifdef MODULE
-       MOD_DEC_USE_COUNT;
-#endif
        return;
 }
 
@@ -3031,6 +3025,7 @@ int cpia_video_init(struct video_device *vdev)
 }
 
 static struct video_device cpia_template = {
+       owner:          THIS_MODULE,
        name:           "CPiA Camera",
        type:           VID_TYPE_CAPTURE,
        hardware:       VID_HARDWARE_CPIA,      /* FIXME */
index 579b5e153f557f133ef6ea21254aa37bc84e387a..f163de1cd0a2746f3403a07be01d9d5bddc72d17 100644 (file)
@@ -62,7 +62,7 @@ struct cpia_camera_ops
        /* transferCmd sends commands to the camera.  command MUST point to
         * an  8 byte buffer in kernel space. data can be NULL if no extra
         * data is needed.  The size of the data is given by the last 2
-        * bytes of comand.  data must also point to memory in kernel space.
+        * bytes of command.  data must also point to memory in kernel space.
         * Returns negative value on error, otherwise 0.
         */
        int (*transferCmd)(void *privdata, u8 *command, u8 *data);
index 7d4be2744c69a5b1add0da603345673d2f9d5d9d..78715f4787800b94542ac12e915ffe06b8be02ca 100644 (file)
@@ -34,9 +34,7 @@
 #include <linux/delay.h>
 #include <linux/smp_lock.h>
 
-#ifdef CONFIG_KMOD
 #include <linux/kmod.h>
-#endif
 
 /* #define _CPIA_DEBUG_                define for verbose debug output */
 #include "cpia.h"
@@ -502,9 +500,6 @@ static int cpia_pp_open(void *privdata)
        
        ++cam->open_count;
        
-#ifdef MODULE
-       MOD_INC_USE_COUNT;
-#endif
        return 0;
 }
 
@@ -535,9 +530,6 @@ static int cpia_pp_registerCallback(void *privdata, void (*cb)(void *cbdata), vo
 static int cpia_pp_close(void *privdata)
 {
        struct pp_cam_entry *cam = privdata;
-#ifdef MODULE
-       MOD_DEC_USE_COUNT;
-#endif
        if (--cam->open_count == 0) {
                parport_release(cam->pdev);
        }
index 9030e163ae08fde31c6bc82825dfdcab257949f4..bcf591a7f9adb9f423b3d08c20116a2fe047b311 100644 (file)
@@ -2037,6 +2037,7 @@ static int planb_mmap(struct video_device *dev, const char *adr, unsigned long s
 
 static struct video_device planb_template=
 {
+       owner:          THIS_MODULE,
        name:           PLANB_DEVICE_NAME,
        type:           VID_TYPE_OVERLAY,
        hardware:       VID_HARDWARE_PLANB,
index b2d8181c9c734247f88c9f1d8049b2462c5e88ff..ec9e537c1c6bf5da6fe9e4e1f47b58c5514c4dc3 100644 (file)
@@ -672,13 +672,11 @@ static int pms_capture(struct pms_device *dev, char *buf, int rgb555, int count)
 
 static int pms_open(struct video_device *dev, int flags)
 {
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
 static void pms_close(struct video_device *dev)
 {
-       MOD_DEC_USE_COUNT;
 }
 
 static long pms_write(struct video_device *v, const char *buf, unsigned long count, int noblock)
@@ -902,6 +900,7 @@ static long pms_read(struct video_device *v, char *buf, unsigned long count,  in
  
 struct video_device pms_template=
 {
+       owner:          THIS_MODULE,
        name:           "Mediavision PMS",
        type:           VID_TYPE_CAPTURE,
        hardware:       VID_HARDWARE_PMS,
@@ -935,14 +934,15 @@ static int init_mediavision(void)
                0xE4
        };
        
-       if(check_region(0x9A01,1))
+       if (!request_region(0x9A01, 1, "Mediavision PMS config"))
        {
                printk(KERN_WARNING "mediavision: unable to detect: 0x9A01 in use.\n");
                return -EBUSY;
        }
-       if(check_region(io_port,3))
+       if (!request_region(io_port, 3, "Mediavision PMS"))
        {
                printk(KERN_WARNING "mediavision: I/O port %d in use.\n", io_port);
+               release_region(0x9A01, 1);
                return -EBUSY;
        }
        outb(0xB8, 0x9A01);             /* Unlock */
@@ -961,16 +961,16 @@ static int init_mediavision(void)
        else 
                idec=0;
 
-       printk(KERN_INFO "PMS type is %d\n", idec);             
-       if(idec==0)
-               return -ENODEV; 
+       printk(KERN_INFO "PMS type is %d\n", idec);
+       if(idec == 0) {
+               release_region(io_port, 3);
+               release_region(0x9A01, 1);
+               return -ENODEV;
+       }
 
        /*
         *      Ok we have a PMS of some sort
         */
-        
-       request_region(io_port,3, "Mediavision PMS");
-       request_region(0x9A01, 1, "Mediavision PMS config");
        
        mvv_write(0x04, mem_base>>12);  /* Set the memory area */
        
index d087d7a97e7e6f2d4dd281c6172efe6fd7c47b59..c1bbba936d6f338790d4c51152de9915c8a4e600 100644 (file)
@@ -672,7 +672,7 @@ static void initialize_cs4341(struct saa7146 *saa)
                /* auto mute off, power on, no de-emphasis */
                /* I2S data up to 24-bit 64xFs internal SCLK */
                I2CWrite(&(saa->i2c), 0x22, 0x01, 0x11, 2);
-               /* ATAPI mixer setings */
+               /* ATAPI mixer settings */
                I2CWrite(&(saa->i2c), 0x22, 0x02, 0x49, 2);
                /* attenuation left 3db */
                I2CWrite(&(saa->i2c), 0x22, 0x03, 0x00, 2);
@@ -1988,6 +1988,7 @@ static void saa_close(struct video_device *dev)
 /* template for video_device-structure */
 static struct video_device saa_template =
 {
+       owner:          THIS_MODULE,
        name:           "SAA7146A",
        type:           VID_TYPE_CAPTURE | VID_TYPE_OVERLAY,
        hardware:       VID_HARDWARE_SAA7146,
index d1f7435da5d57bdf779e6973fd72b5fe4a910031..7d757ff95cea627938a99b06226043d254aad055 100644 (file)
@@ -166,6 +166,9 @@ static int video_open(struct inode *inode, struct file *file)
                goto error_out;
        }
        vfl->busy=1;            /* In case vfl->open sleeps */
+       
+       if(vfl->owner)
+               __MOD_INC_USE_COUNT(vfl->owner);
        unlock_kernel();
        
        if(vfl->open)
@@ -174,6 +177,9 @@ static int video_open(struct inode *inode, struct file *file)
                if(err)
                {
                        vfl->busy=0;
+                       if(vfl->owner)
+                               __MOD_DEC_USE_COUNT(vfl->owner);
+                       
                        return err;
                }
        }
@@ -195,6 +201,8 @@ static int video_release(struct inode *inode, struct file *file)
        if(vfl->close)
                vfl->close(vfl);
        vfl->busy=0;
+       if(vfl->owner)
+               __MOD_DEC_USE_COUNT(vfl->owner);
        unlock_kernel();
        return 0;
 }
index b24591de44b53208b72563b44d5cbd36b934d397..c64efb7794eeefbbf675f66ea0883b85bc58b463 100644 (file)
@@ -203,13 +203,11 @@ static void vino_setup(struct vino_device *v)
 
 static int vino_open(struct video_device *dev, int flags)
 {
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
 static void vino_close(struct video_device *dev)
 {
-       MOD_DEC_USE_COUNT;
 }
 
 static int vino_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
@@ -224,6 +222,7 @@ static int vino_mmap(struct video_device *dev, const char *adr,
 }
 
 static struct video_device vino_dev = {
+       owner:          THIS_MODULE,
        name:           "Vino IndyCam/TV",
        type:           VID_TYPE_CAPTURE,
        hardware:       VID_HARDWARE_VINO,
index 331ac4d3ffa1ffee88238b552b1815e4769049ea..bb0f08437b7bbc17a6781cb721885ea9d460cd44 100644 (file)
@@ -788,7 +788,6 @@ static int zoran_open(struct video_device *dev, int flags)
        /* do the common part of all open's */
        zoran_common_open(ztv, flags);
 
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
@@ -820,7 +819,6 @@ void zoran_close(struct video_device* dev)
                kfree( ztv->overinfo.overlay );
        ztv->overinfo.overlay = 0;
 
-       MOD_DEC_USE_COUNT;
 }
 
 /*
@@ -1482,6 +1480,7 @@ int zoran_mmap(struct video_device* dev, const char* adr, unsigned long size)
 
 static struct video_device zr36120_template=
 {
+       owner:          THIS_MODULE,
        name:           "UNSET",
        type:           VID_TYPE_TUNER|VID_TYPE_CAPTURE|VID_TYPE_OVERLAY,
        hardware:       VID_HARDWARE_ZR36120,
@@ -1541,7 +1540,6 @@ int vbi_open(struct video_device *dev, int flags)
        /* start read-ahead */
        zoran_cap(ztv, 1);
 
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
@@ -1573,7 +1571,6 @@ void vbi_close(struct video_device *dev)
                item->memadr = 0;
        }
 
-       MOD_DEC_USE_COUNT;
 }
 
 /*
@@ -1819,6 +1816,7 @@ int vbi_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
 
 static struct video_device vbi_template=
 {
+       owner:          THIS_MODULE,
        name:           "UNSET",
        type:           VID_TYPE_CAPTURE|VID_TYPE_TELETEXT,
        hardware:       VID_HARDWARE_ZR36120,
index c7c678ece6b2f7104b09e63095e318617ea104de..a383c2695e1ec9f8e392e430a012e49497229102 100644 (file)
@@ -3,14 +3,15 @@
        8139too.c: A RealTek RTL-8139 Fast Ethernet driver for Linux.
 
        Maintained by Jeff Garzik <jgarzik@mandrakesoft.com>
+       Copyright 2000,2001 Jeff Garzik
 
        Much code comes from Donald Becker's rtl8139.c driver,
-       versions 1.11 and older.  This driver was originally based
-       on rtl8139.c version 1.07.  Header of rtl8139.c version 1.11:
+       versions 1.13 and older.  This driver was originally based
+       on rtl8139.c version 1.07.  Header of rtl8139.c version 1.13:
 
        -----<snip>-----
 
-               Written 1997-2000 by Donald Becker.
+               Written 1997-2001 by Donald Becker.
                This software may be used and distributed according to the
                terms of the GNU General Public License (GPL), incorporated
                herein by reference.  Drivers based on or derived from this
@@ -74,7 +75,7 @@
                
                Tobias Ringström - Rx interrupt status checking suggestion
 
-               Andrew Morton - (v0.9.13): clear blocked signals, avoid
+               Andrew Morton - Clear blocked signals, avoid
                buffer overrun setting current->comm.
 
        Submitting bug reports:
@@ -150,7 +151,7 @@ an MMIO register read.
 #include <asm/io.h>
 
 
-#define RTL8139_VERSION "0.9.13"
+#define RTL8139_VERSION "0.9.15"
 #define MODNAME "8139too"
 #define RTL8139_DRIVER_NAME   MODNAME " Fast Ethernet driver " RTL8139_VERSION
 #define PFX MODNAME ": "
@@ -188,7 +189,9 @@ an MMIO register read.
 
 /* A few user-configurable values. */
 /* media options */
-static int media[] = {-1, -1, -1, -1, -1, -1, -1, -1};
+#define MAX_UNITS 8
+static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
+static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
 /* Maximum events (Rx packets, etc.) to handle at each interrupt. */
 static int max_interrupt_work = 20;
@@ -230,6 +233,7 @@ static int multicast_filter_limit = 32;
 
 
 enum {
+       HAS_MII_XCVR = 0x010000,
        HAS_CHIP_XCVR = 0x020000,
        HAS_LNK_CHNG = 0x040000,
 };
@@ -237,6 +241,7 @@ enum {
 #define RTL_MIN_IO_SIZE 0x80
 #define RTL8139B_IO_SIZE 256
 
+#define RTL8129_CAPS   HAS_MII_XCVR
 #define RTL8139_CAPS   HAS_CHIP_XCVR|HAS_LNK_CHNG
 
 typedef enum {
@@ -246,19 +251,24 @@ typedef enum {
        /*MPX5030,*/
        DELTA8139,
        ADDTRON8139,
+       DFE538TX,
+       RTL8129,
 } board_t;
 
 
 /* indexed by board_t, above */
 static struct {
        const char *name;
+       u32 hw_flags;
 } board_info[] __devinitdata = {
-       { "RealTek RTL8139 Fast Ethernet" },
-       { "RealTek RTL8139B PCI/CardBus" },
-       { "SMC1211TX EZCard 10/100 (RealTek RTL8139)" },
-/*     { MPX5030, "Accton MPX5030 (RealTek RTL8139)" },*/
-       { "Delta Electronics 8139 10/100BaseTX" },
-       { "Addtron Technolgy 8139 10/100BaseTX" },
+       { "RealTek RTL8139 Fast Ethernet", RTL8139_CAPS },
+       { "RealTek RTL8139B PCI/CardBus", RTL8139_CAPS },
+       { "SMC1211TX EZCard 10/100 (RealTek RTL8139)", RTL8139_CAPS },
+/*     { MPX5030, "Accton MPX5030 (RealTek RTL8139)", RTL8139_CAPS },*/
+       { "Delta Electronics 8139 10/100BaseTX", RTL8139_CAPS },
+       { "Addtron Technolgy 8139 10/100BaseTX", RTL8139_CAPS },
+       { "D-Link DFE-538TX (RealTek RTL8139)", RTL8139_CAPS },
+       { "RealTek RTL8129", RTL8129_CAPS },
 };
 
 
@@ -269,6 +279,15 @@ static struct pci_device_id rtl8139_pci_tbl[] __devinitdata = {
 /*     {0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MPX5030 },*/
        {0x1500, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DELTA8139 },
        {0x4033, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ADDTRON8139 },
+       {0x1186, 0x1300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DFE538TX },
+       {0x10ec, 0x8129, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8129 },
+
+       /* some crazy cards report invalid vendor ids like
+        * 0x0001 here.  The other ids are valid and constant,
+        * so we simply don't match on the main vendor id.
+        */
+       {PCI_ANY_ID, 0x8139, 0x10ec, 0x8139, 0, 0, RTL8139 },
+
        {0,}
 };
 MODULE_DEVICE_TABLE (pci, rtl8139_pci_tbl);
@@ -504,7 +523,6 @@ const static struct {
 
 
 struct rtl8139_private {
-       board_t board;
        void *mmio_addr;
        int drv_flags;
        struct pci_dev *pci_dev;
@@ -512,15 +530,16 @@ struct rtl8139_private {
        unsigned char *rx_ring;
        unsigned int cur_rx;    /* Index into the Rx buffer of next Rx pkt. */
        unsigned int tx_flag;
-       unsigned int cur_tx;
-       unsigned int dirty_tx;
+       unsigned long cur_tx;
+       unsigned long dirty_tx;
        /* The saved address of a sent-in-place packet/buffer, for skfree(). */
        struct ring_info tx_info[NUM_TX_DESC];
        unsigned char *tx_buf[NUM_TX_DESC];     /* Tx bounce buffers */
        unsigned char *tx_bufs; /* Tx bounce buffer region. */
        dma_addr_t rx_ring_dma;
        dma_addr_t tx_bufs_dma;
-       char phys[4];           /* MII device addresses. */
+       signed char phys[4];            /* MII device addresses. */
+       u16 advertising;                /* NWay media advertisement */
        char twistie, twist_row, twist_col;     /* Twister tune state. */
        unsigned int full_duplex:1;     /* Full-duplex operation requested. */
        unsigned int duplex_lock:1;
@@ -539,7 +558,8 @@ MODULE_AUTHOR ("Jeff Garzik <jgarzik@mandrakesoft.com>");
 MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver");
 MODULE_PARM (multicast_filter_limit, "i");
 MODULE_PARM (max_interrupt_work, "i");
-MODULE_PARM (media, "1-" __MODULE_STRING(8) "i");
+MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i");
+MODULE_PARM (full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i");
 
 static int read_eeprom (void *ioaddr, int location, int addr_len);
 static int rtl8139_open (struct net_device *dev);
@@ -658,6 +678,11 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
        SET_MODULE_OWNER(dev);
        tp = dev->priv;
 
+       /* enable device (incl. PCI PM wakeup and hotplug setup) */
+       rc = pci_enable_device (pdev);
+       if (rc)
+               goto err_out;
+
        pio_start = pci_resource_start (pdev, 0);
        pio_end = pci_resource_end (pdev, 0);
        pio_flags = pci_resource_flags (pdev, 0);
@@ -697,25 +722,11 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
                goto err_out;
        }
 
-       /* make sure our PIO region in PCI space is available */
-       if (!request_region (pio_start, pio_len, dev->name)) {
-               printk (KERN_ERR PFX "no I/O resource available, aborting\n");
-               rc = -EBUSY;
-               goto err_out;
-       }
-
-       /* make sure our MMIO region in PCI space is available */
-       if (!request_mem_region (mmio_start, mmio_len, dev->name)) {
-               printk (KERN_ERR PFX "no mem resource available, aborting\n");
-               rc = -EBUSY;
-               goto err_out_free_pio;
-       }
-
-       /* enable device (incl. PCI PM wakeup), and bus-mastering */
-       rc = pci_enable_device (pdev);
+       rc = pci_request_regions (pdev, dev->name);
        if (rc)
-               goto err_out_free_mmio;
+               goto err_out;
 
+       /* enable PCI bus-mastering */
        pci_set_master (pdev);
 
 #ifdef USE_IO_OPS
@@ -726,7 +737,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
        if (ioaddr == NULL) {
                printk (KERN_ERR PFX "cannot remap MMIO, aborting\n");
                rc = -EIO;
-               goto err_out_free_mmio;
+               goto err_out_free_res;
        }
 #endif /* USE_IO_OPS */
 
@@ -792,11 +803,9 @@ err_out_iounmap:
        assert (ioaddr > 0);
 #ifndef USE_IO_OPS
        iounmap (ioaddr);
+err_out_free_res:
 #endif /* !USE_IO_OPS */
-err_out_free_mmio:
-       release_mem_region (mmio_start, mmio_len);
-err_out_free_pio:
-       release_region (pio_start, pio_len);
+       pci_release_regions (pdev);
 err_out:
        unregister_netdev (dev);
        kfree (dev);
@@ -813,7 +822,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
        int i, addr_len, option;
        void *ioaddr = NULL;
        static int board_idx = -1;
-       static int printed_version = 0;
+       static int printed_version;
        u8 tmp;
 
        DPRINTK ("ENTER\n");
@@ -862,10 +871,8 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
        tp = dev->priv;
 
        /* note: tp->chipset set in rtl8139_init_board */
-       tp->drv_flags = PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
-                       PCI_COMMAND_MASTER | RTL8139_CAPS;
+       tp->drv_flags = board_info[ent->driver_data].hw_flags;
        tp->pci_dev = pdev;
-       tp->board = ent->driver_data;
        tp->mmio_addr = ioaddr;
        spin_lock_init (&tp->lock);
        init_waitqueue_head (&tp->thr_wait);
@@ -873,8 +880,6 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
 
        pdev->driver_data = dev;
 
-       tp->phys[0] = 32;
-
        printk (KERN_INFO "%s: %s at 0x%lx, "
                "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, "
                "IRQ %d\n",
@@ -889,6 +894,30 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
        printk (KERN_DEBUG "%s:  Identified 8139 chip type '%s'\n",
                dev->name, rtl_chip_info[tp->chipset].name);
 
+       /* Find the connected MII xcvrs.
+          Doing this in open() would allow detecting external xcvrs later, but
+          takes too much time. */
+       if (tp->drv_flags & HAS_MII_XCVR) {
+               int phy, phy_idx = 0;
+               for (phy = 0; phy < 32 && phy_idx < sizeof(tp->phys); phy++) {
+                       int mii_status = mdio_read(dev, phy, 1);
+                       if (mii_status != 0xffff  &&  mii_status != 0x0000) {
+                               tp->phys[phy_idx++] = phy;
+                               tp->advertising = mdio_read(dev, phy, 4);
+                               printk(KERN_INFO "%s: MII transceiver %d status 0x%4.4x "
+                                          "advertising %4.4x.\n",
+                                          dev->name, phy, mii_status, tp->advertising);
+                       }
+               }
+               if (phy_idx == 0) {
+                       printk(KERN_INFO "%s: No MII transceivers found!  Assuming SYM "
+                                  "transceiver.\n",
+                                  dev->name);
+                       tp->phys[0] = 32;
+               }
+       } else
+               tp->phys[0] = 32;
+
        /* Put the chip into low-power mode. */
        RTL_W8_F (Cfg9346, Cfg9346_Unlock);
 
@@ -899,21 +928,29 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
        RTL_W8_F (HltClk, 'H'); /* 'R' would leave the clock running. */
 
        /* The lower four bits are the media type. */
-       option = (board_idx >= ARRAY_SIZE(media)) ? 0 : media[board_idx];
+       option = (board_idx >= MAX_UNITS) ? 0 : media[board_idx];
        if (option > 0) {
-               tp->full_duplex = (option & 0x200) ? 1 : 0;
-               tp->default_port = option & 15;
+               tp->full_duplex = (option & 0x210) ? 1 : 0;
+               tp->default_port = option & 0xFF;
                if (tp->default_port)
                        tp->medialock = 1;
        }
-
+       if (board_idx < MAX_UNITS  &&  full_duplex[board_idx] > 0)
+               tp->full_duplex = full_duplex[board_idx];
        if (tp->full_duplex) {
-               printk (KERN_INFO
-                       "%s: Media type forced to Full Duplex.\n",
-                       dev->name);
-               mdio_write (dev, tp->phys[0], 4, 0x141);
+               printk(KERN_INFO "%s: Media type forced to Full Duplex.\n", dev->name);
+               /* Changing the MII-advertised media because might prevent
+                  re-connection. */
                tp->duplex_lock = 1;
        }
+       if (tp->default_port) {
+               printk(KERN_INFO "  Forcing %dMbs %s-duplex operation.\n",
+                          (option & 0x20 ? 100 : 10),
+                          (option & 0x10 ? "full" : "half"));
+               mdio_write(dev, tp->phys[0], 0,
+                                  ((option & 0x20) ? 0x2000 : 0) |     /* 100mbps? */
+                                  ((option & 0x10) ? 0x0100 : 0)); /* Full duplex? */
+       }
 
        DPRINTK ("EXIT - returning 0\n");
        return 0;
@@ -938,10 +975,7 @@ static void __devexit rtl8139_remove_one (struct pci_dev *pdev)
        iounmap (np->mmio_addr);
 #endif /* !USE_IO_OPS */
 
-       release_region (pci_resource_start (pdev, 0),
-                       pci_resource_len (pdev, 0));
-       release_mem_region (pci_resource_start (pdev, 1),
-                           pci_resource_len (pdev, 1));
+       pci_release_regions (pdev);
 
 #ifndef RTL8139_NDEBUG
        /* poison memory before freeing */
@@ -1035,7 +1069,7 @@ static int __devinit read_eeprom (void *ioaddr, int location, int addr_len)
 #define MDIO_WRITE0 (MDIO_DIR)
 #define MDIO_WRITE1 (MDIO_DIR | MDIO_DATA_OUT)
 
-#define mdio_delay(  readb(mdio_addr)
+#define mdio_delay(mdio_addr)  readb(mdio_addr)
 
 
 static char mii_2_8139_map[8] = {
@@ -1059,9 +1093,9 @@ static void mdio_sync (void *mdio_addr)
 
        for (i = 32; i >= 0; i--) {
                writeb (MDIO_WRITE1, mdio_addr);
-               mdio_delay ();
+               mdio_delay (mdio_addr);
                writeb (MDIO_WRITE1 | MDIO_CLK, mdio_addr);
-               mdio_delay ();
+               mdio_delay (mdio_addr);
        }
 
        DPRINTK ("EXIT\n");
@@ -1089,20 +1123,18 @@ static int mdio_read (struct net_device *dev, int phy_id, int location)
                int dataval = (mii_cmd & (1 << i)) ? MDIO_DATA_OUT : 0;
 
                writeb (MDIO_DIR | dataval, mdio_addr);
-               mdio_delay ();
+               mdio_delay (mdio_addr);
                writeb (MDIO_DIR | dataval | MDIO_CLK, mdio_addr);
-               mdio_delay ();
+               mdio_delay (mdio_addr);
        }
 
        /* Read the two transition, 16 data, and wire-idle bits. */
        for (i = 19; i > 0; i--) {
                writeb (0, mdio_addr);
-               mdio_delay ();
-               retval =
-                   (retval << 1) | ((readb (mdio_addr) & MDIO_DATA_IN) ? 1
-                                    : 0);
+               mdio_delay (mdio_addr);
+               retval = (retval << 1) | ((readb (mdio_addr) & MDIO_DATA_IN) ? 1 : 0);
                writeb (MDIO_CLK, mdio_addr);
-               mdio_delay ();
+               mdio_delay (mdio_addr);
        }
 
        DPRINTK ("EXIT, returning %d\n", (retval >> 1) & 0xffff);
@@ -1115,19 +1147,19 @@ static void mdio_write (struct net_device *dev, int phy_id, int location,
 {
        struct rtl8139_private *tp = dev->priv;
        void *mdio_addr = tp->mmio_addr + Config4;
-       int mii_cmd =
-           (0x5002 << 16) | (phy_id << 23) | (location << 18) | value;
+       int mii_cmd = (0x5002 << 16) | (phy_id << 23) | (location << 18) | value;
        int i;
 
        DPRINTK ("ENTER\n");
 
        if (phy_id > 31) {      /* Really a 8139.  Use internal registers. */
-               if (location < 8 && mii_2_8139_map[location]) {
-                       writew (value,
-                               tp->mmio_addr + mii_2_8139_map[location]);
-                       readw (tp->mmio_addr + mii_2_8139_map[location]);
-               }
-               DPRINTK ("EXIT after directly using 8139 internal regs\n");
+               void *ioaddr = tp->mmio_addr;
+               if (location == 0) {
+                       RTL_W8_F (Cfg9346, Cfg9346_Unlock);
+                       RTL_W16_F (BasicModeCtrl, value);
+                       RTL_W8_F (Cfg9346, Cfg9346_Lock);
+               } else if (location < 8 && mii_2_8139_map[location])
+                       RTL_W16_F (mii_2_8139_map[location], value);
                return;
        }
        mdio_sync (mdio_addr);
@@ -1137,20 +1169,18 @@ static void mdio_write (struct net_device *dev, int phy_id, int location,
                int dataval =
                    (mii_cmd & (1 << i)) ? MDIO_WRITE1 : MDIO_WRITE0;
                writeb (dataval, mdio_addr);
-               mdio_delay ();
+               mdio_delay (mdio_addr);
                writeb (dataval | MDIO_CLK, mdio_addr);
-               mdio_delay ();
+               mdio_delay (mdio_addr);
        }
-
        /* Clear out extra bits. */
        for (i = 2; i > 0; i--) {
                writeb (0, mdio_addr);
-               mdio_delay ();
+               mdio_delay (mdio_addr);
                writeb (MDIO_CLK, mdio_addr);
-               mdio_delay ();
+               mdio_delay (mdio_addr);
        }
-
-       DPRINTK ("EXIT\n");
+       return;
 }
 
 
@@ -1231,6 +1261,8 @@ static void rtl8139_hw_start (struct net_device *dev)
                if ((RTL_R8 (ChipCmd) & CmdReset) == 0)
                        break;
 
+       /* unlock Config[01234] and BMCR register writes */
+       RTL_W8_F (Cfg9346, Cfg9346_Unlock);
        /* Restore our idea of the MAC address. */
        RTL_W32_F (MAC0 + 0, cpu_to_le32 (*(u32 *) (dev->dev_addr + 0)));
        RTL_W32_F (MAC0 + 4, cpu_to_le32 (*(u32 *) (dev->dev_addr + 4)));
@@ -1246,12 +1278,23 @@ static void rtl8139_hw_start (struct net_device *dev)
        /* Check this value: the documentation for IFG contradicts ifself. */
        RTL_W32 (TxConfig, (TX_DMA_BURST << TxDMAShift));
 
-       /* unlock Config[01234] and BMCR register writes */
-       RTL_W8_F (Cfg9346, Cfg9346_Unlock);
-       udelay (10);
-
        tp->cur_rx = 0;
 
+       /* This is check_duplex() */
+       if (tp->phys[0] >= 0  ||  (tp->drv_flags & HAS_MII_XCVR)) {
+               u16 mii_reg5 = mdio_read(dev, tp->phys[0], 5);
+               if (mii_reg5 == 0xffff)
+                       ;                                       /* Not there */
+               else if ((mii_reg5 & 0x0100) == 0x0100
+                                || (mii_reg5 & 0x00C0) == 0x0040)
+                       tp->full_duplex = 1;
+               printk(KERN_INFO"%s: Setting %s%s-duplex based on"
+                          " auto-negotiated partner ability %4.4x.\n", dev->name,
+                          mii_reg5 == 0 ? "" :
+                          (mii_reg5 & 0x0180) ? "100mbps " : "10mbps ",
+                          tp->full_duplex ? "full" : "half", mii_reg5);
+       }
+
        if (tp->chipset >= CH_8139A) {
                tmp = RTL_R8 (Config1) & Config1Clear;
                tmp |= Cfg1_Driver_Load;
@@ -1544,7 +1587,7 @@ static void rtl8139_tx_timeout (struct net_device *dev)
        RTL_W16 (IntrMask, 0x0000);
 
        /* Emit info to figure out what went wrong. */
-       printk (KERN_DEBUG "%s: Tx queue start entry %d  dirty entry %d.\n",
+       printk (KERN_DEBUG "%s: Tx queue start entry %ld  dirty entry %ld.\n",
                dev->name, tp->cur_tx, tp->dirty_tx);
        for (i = 0; i < NUM_TX_DESC; i++)
                printk (KERN_DEBUG "%s:  Tx descriptor %d is %8.8lx.%s\n",
@@ -1559,6 +1602,8 @@ static void rtl8139_tx_timeout (struct net_device *dev)
 
        /* ...and finally, reset everything */
        rtl8139_hw_start (dev);
+
+       netif_wake_queue (dev);
 }
 
 
@@ -1593,11 +1638,15 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
                 tp->tx_flag | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN));
 
        dev->trans_start = jiffies;
+
+       spin_lock_irq (&tp->lock);
+
        tp->cur_tx++;
-       mb();
        if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx)
                netif_stop_queue (dev);
 
+       spin_unlock_irq (&tp->lock);
+
        DPRINTK ("%s: Queued Tx packet at %p size %u to slot %d.\n",
                 dev->name, skb->data, skb->len, entry);
 
@@ -1609,7 +1658,7 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
                                  struct rtl8139_private *tp,
                                  void *ioaddr)
 {
-       unsigned int dirty_tx, tx_left;
+       unsigned long dirty_tx, tx_left;
 
        assert (dev != NULL);
        assert (tp != NULL);
@@ -1673,9 +1722,8 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
 
 #ifndef RTL8139_NDEBUG
        if (tp->cur_tx - dirty_tx > NUM_TX_DESC) {
-               printk (KERN_ERR
-                 "%s: Out-of-sync dirty pointer, %d vs. %d.\n",
-                    dev->name, dirty_tx, tp->cur_tx);
+               printk (KERN_ERR "%s: Out-of-sync dirty pointer, %ld vs. %ld.\n",
+                       dev->name, dirty_tx, tp->cur_tx);
                dirty_tx += NUM_TX_DESC;
        }
 #endif /* RTL8139_NDEBUG */
@@ -1683,7 +1731,6 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
        /* only wake the queue if we did work, and the queue is stopped */
        if (tp->dirty_tx != dirty_tx) {
                tp->dirty_tx = dirty_tx;
-               mb();
                if (netif_queue_stopped (dev))
                        netif_wake_queue (dev);
        }
@@ -1917,8 +1964,6 @@ static void rtl8139_interrupt (int irq, void *dev_instance,
        void *ioaddr = tp->mmio_addr;
        int status = 0, link_changed = 0; /* avoid bogus "uninit" warning */
 
-       spin_lock (&tp->lock);
-
        do {
                status = RTL_R16 (IntrStatus);
 
@@ -1949,7 +1994,7 @@ static void rtl8139_interrupt (int irq, void *dev_instance,
                   RxFIFOOver error (I got the feeling this depends on the
                   CPU speed, lower CPU speed --> more errors).
                   After clearing the RxOverflow bit the transfer of the
-                  packet was repeated and all data are error free transfered */
+                  packet was repeated and all data are error free transferred */
                RTL_W16_F (IntrStatus, (status & RxFIFOOver) ? (status | RxOverflow) : status);
 
                DPRINTK ("%s: interrupt  status=%#4.4x new intstat=%#4.4x.\n",
@@ -1970,8 +2015,11 @@ static void rtl8139_interrupt (int irq, void *dev_instance,
                if (status & (RxOK | RxUnderrun | RxOverflow | RxFIFOOver))     /* Rx interrupt */
                        rtl8139_rx_interrupt (dev, tp, ioaddr);
 
-               if (status & (TxOK | TxErr))
+               if (status & (TxOK | TxErr)) {
+                       spin_lock (&tp->lock);
                        rtl8139_tx_interrupt (dev, tp, ioaddr);
+                       spin_unlock (&tp->lock);
+               }
 
                boguscnt--;
        } while (boguscnt > 0);
@@ -1986,8 +2034,6 @@ static void rtl8139_interrupt (int irq, void *dev_instance,
                RTL_W16 (IntrStatus, 0xffff);
        }
 
-       spin_unlock (&tp->lock);
-
        DPRINTK ("%s: exiting interrupt, intr_status=%#4.4x.\n",
                 dev->name, RTL_R16 (IntrStatus));
 }
@@ -2074,7 +2120,19 @@ static int mii_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
                        break;
                }
 
-               mdio_write (dev, data[0], data[1] & 0x1f, data[2]);
+               if (data[0] == tp->phys[0]) {
+                       u16 value = data[2];
+                       switch (data[1]) {
+                       case 0:
+                               /* Check for autonegotiation on or reset. */
+                               tp->medialock = (value & 0x9000) ? 0 : 1;
+                               if (tp->medialock)
+                                       tp->full_duplex = (value & 0x0100) ? 1 : 0;
+                               break;
+                       case 4: tp->advertising = value; break;
+                       }
+               }
+               mdio_write(dev, data[0], data[1] & 0x1f, data[2]);
                break;
 
        default:
@@ -2095,8 +2153,10 @@ static struct net_device_stats *rtl8139_get_stats (struct net_device *dev)
        DPRINTK ("ENTER\n");
 
        if (netif_running(dev)) {
+               spin_lock_irq (&tp->lock);
                tp->stats.rx_missed_errors += RTL_R32 (RxMissed);
                RTL_W32 (RxMissed, 0);
+               spin_unlock_irq (&tp->lock);
        }
 
        DPRINTK ("EXIT\n");
@@ -2117,12 +2177,11 @@ static inline u32 ether_crc (int length, unsigned char *data)
                unsigned char current_octet = *data++;
                int bit;
                for (bit = 0; bit < 8; bit++, current_octet >>= 1)
-                       crc = (crc << 1) ^
-                           ((crc < 0) ^ (current_octet & 1) ?
+                       crc = (crc << 1) ^ ((crc < 0) ^ (current_octet & 1) ?
                             ethernet_polynomial : 0);
        }
 
-       DPRINTK ("EXIT\n");
+       DPRINTK ("EXIT, returning %u\n", crc);
        return crc;
 }
 
@@ -2131,6 +2190,7 @@ static void rtl8139_set_rx_mode (struct net_device *dev)
 {
        struct rtl8139_private *tp = dev->priv;
        void *ioaddr = tp->mmio_addr;
+       unsigned long flags;
        u32 mc_filter[2];       /* Multicast hash filter */
        int i, rx_mode;
        u32 tmp;
@@ -2164,9 +2224,7 @@ static void rtl8139_set_rx_mode (struct net_device *dev)
                                 mc_filter);
        }
 
-       /* if called from irq handler, lock already acquired */
-       if (!in_irq ())
-               spin_lock_irq (&tp->lock);
+       spin_lock_irqsave (&tp->lock, flags);
 
        /* We can safely update without stopping the chip. */
        tmp = rtl8139_rx_config | rx_mode |
@@ -2175,8 +2233,7 @@ static void rtl8139_set_rx_mode (struct net_device *dev)
        RTL_W32_F (MAR0 + 0, mc_filter[0]);
        RTL_W32_F (MAR0 + 4, mc_filter[1]);
 
-       if (!in_irq ())
-               spin_unlock_irq (&tp->lock);
+       spin_unlock_irqrestore (&tp->lock, flags);
 
        DPRINTK ("EXIT\n");
 }
index 8b633141de2f46d9fdcb0b561c4ad82a9b92cf69..528eb4ec312f35e50b8e9fae47861e8f3a9cca3d 100644 (file)
@@ -142,12 +142,11 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
       dep_tristate '    EtherExpressPro/100 support' CONFIG_EEPRO100 $CONFIG_PCI
       dep_mbool '      Enable Power Management (EXPERIMENTAL)' CONFIG_EEPRO100_PM $CONFIG_EEPRO100 $CONFIG_EXPERIMENTAL
       dep_tristate '    Mylex EISA LNE390A/B support (EXPERIMENTAL)' CONFIG_LNE390 $CONFIG_EISA $CONFIG_EXPERIMENTAL
-      dep_tristate '    National Semiconductor DP83810 series PCI Ethernet support' CONFIG_NATSEMI $CONFIG_PCI
+      dep_tristate '    National Semiconductor DP8381x series PCI Ethernet support' CONFIG_NATSEMI $CONFIG_PCI
       dep_tristate '    PCI NE2000 and clones support (see help)' CONFIG_NE2K_PCI $CONFIG_PCI
       dep_tristate '    Novell/Eagle/Microdyne NE3210 EISA support (EXPERIMENTAL)' CONFIG_NE3210 $CONFIG_EISA $CONFIG_EXPERIMENTAL
       dep_tristate '    Racal-Interlan EISA ES3210 support (EXPERIMENTAL)' CONFIG_ES3210 $CONFIG_EISA $CONFIG_EXPERIMENTAL
       dep_tristate '    RealTek RTL-8139 PCI Fast Ethernet Adapter support' CONFIG_8139TOO $CONFIG_PCI
-      dep_tristate '    RealTek 8129 (not 8019/8029/8139!) support (EXPERIMENTAL)' CONFIG_RTL8129 $CONFIG_PCI $CONFIG_EXPERIMENTAL
       dep_tristate '    SiS 900/7016 PCI Fast Ethernet Adapter support' CONFIG_SIS900 $CONFIG_PCI
       dep_tristate '    SMC EtherPower II' CONFIG_EPIC100 $CONFIG_PCI
       dep_tristate '    Sundance Alta support' CONFIG_SUNDANCE $CONFIG_PCI
index ce072a43fa43b8ea5585bbd596d78b0183ddb091..7644235d9b9274a2fd5b7b11b9ce6452a4d642d4 100644 (file)
@@ -163,7 +163,6 @@ obj-$(CONFIG_EL3) += 3c509.o
 obj-$(CONFIG_3C515) += 3c515.o
 obj-$(CONFIG_EEXPRESS) += eexpress.o
 obj-$(CONFIG_EEXPRESS_PRO) += eepro.o
-obj-$(CONFIG_RTL8129) += rtl8129.o
 obj-$(CONFIG_8139TOO) += 8139too.o
 obj-$(CONFIG_WAVELAN) += wavelan.o
 obj-$(CONFIG_ARLAN) += arlan.o arlan-proc.o
index 6915d7a1f818ccdb2b9c825b2c640bf48e60fdf5..8a90d2c6a6b4abc9c2b2e605911b4c398f539666 100644 (file)
  *             Jun 2000        jgarzik         PCI and resource alloc cleanups
  *             Jul 2000        tjeerd          Much cleanup and some bug fixes
  *             Sep 2000        tjeerd          Fix leak on unload, cosmetic code cleanup
+ *             Feb 2001                        Skb allocation fixes
+ *             Feb 2001        davej           PCI enable cleanups.
  */
 
 /* Include files */
 /* Version information string - should be updated prior to each new release!!! */
 
 static char version[] __devinitdata =
-       "defxx.c:v1.05d 2000/09/05  Lawrence V. Stefani and others\n";
+       "defxx.c:v1.05e 2001/02/03  Lawrence V. Stefani and others\n";
 
 #define DYNAMIC_BUFFERS 1
 
@@ -242,7 +244,7 @@ static void         dfx_bus_init(struct net_device *dev);
 static void            dfx_bus_config_check(DFX_board_t *bp);
 
 static int             dfx_driver_init(struct net_device *dev);
-static int             dfx_adap_init(DFX_board_t *bp);
+static int             dfx_adap_init(DFX_board_t *bp, int get_buffers);
 
 static int             dfx_open(struct net_device *dev);
 static int             dfx_close(struct net_device *dev);
@@ -264,8 +266,9 @@ static void         dfx_hw_adap_reset(DFX_board_t *bp, PI_UINT32 type);
 static int             dfx_hw_adap_state_rd(DFX_board_t *bp);
 static int             dfx_hw_dma_uninit(DFX_board_t *bp, PI_UINT32 type);
 
-static void            dfx_rcv_init(DFX_board_t *bp);
+static int             dfx_rcv_init(DFX_board_t *bp, int get_buffers);
 static void            dfx_rcv_queue_process(DFX_board_t *bp);
+static void            dfx_rcv_flush(DFX_board_t *bp);
 
 static int             dfx_xmt_queue_pkt(struct sk_buff *skb, struct net_device *dev);
 static int             dfx_xmt_done(DFX_board_t *bp);
@@ -339,7 +342,6 @@ static inline void dfx_port_write_byte(
        u16 port = bp->base_addr + offset;
 
        outb(data, port);
-       return;
        }
 
 static inline void dfx_port_read_byte(
@@ -352,7 +354,6 @@ static inline void dfx_port_read_byte(
        u16 port = bp->base_addr + offset;
 
        *data = inb(port);
-       return;
        }
 
 static inline void dfx_port_write_long(
@@ -365,7 +366,6 @@ static inline void dfx_port_write_long(
        u16 port = bp->base_addr + offset;
 
        outl(data, port);
-       return;
        }
 
 static inline void dfx_port_read_long(
@@ -378,7 +378,6 @@ static inline void dfx_port_read_long(
        u16 port = bp->base_addr + offset;
 
        *data = inl(port);
-       return;
        }
 
 \f
@@ -395,6 +394,7 @@ static inline void dfx_port_read_long(
  *       
  * Arguments:
  *   pdev - pointer to pci device information (NULL for EISA)
+ *   ioaddr - pointer to port (NULL for PCI)
  *
  * Functional Description:
  *
@@ -415,6 +415,7 @@ static int __devinit dfx_init_one_pci_or_eisa(struct pci_dev *pdev, long ioaddr)
        struct net_device *dev;
        DFX_board_t       *bp;                  /* board pointer */
        static int version_disp;
+       int err;
 
        if (!version_disp)                                      /* display version info if adapter is found */
        {
@@ -426,18 +427,27 @@ static int __devinit dfx_init_one_pci_or_eisa(struct pci_dev *pdev, long ioaddr)
         * init_fddidev() allocates a device structure with private data, clears the device structure and private data,
         * and  calls fddi_setup() and register_netdev(). Not much left to do for us here.
         */
-       dev = init_fddidev( NULL, sizeof(*bp));
-
+       dev = init_fddidev(NULL, sizeof(*bp));
        if (!dev) {
                printk (KERN_ERR "defxx: unable to allocate fddidev, aborting\n");
                return -ENOMEM;
        }
 
-       bp = (DFX_board_t*)dev->priv;
+       /* Enable PCI device. */
+       if (pdev != NULL) {
+               err = pci_enable_device (pdev);
+               if (err) goto err_out;
+               ioaddr = pci_resource_start (pdev, 1);
+       }
+
+       SET_MODULE_OWNER(dev);
+
+       bp = dev->priv;
 
        if (!request_region (ioaddr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN, dev->name)) {
                printk (KERN_ERR "%s: Cannot reserve I/O resource 0x%x @ 0x%lx, aborting\n",
                        dev->name, PFI_K_CSR_IO_LEN, ioaddr);
+               err = -EBUSY;
                goto err_out;
        }
 
@@ -462,13 +472,13 @@ static int __devinit dfx_init_one_pci_or_eisa(struct pci_dev *pdev, long ioaddr)
                bp->bus_type = DFX_BUS_TYPE_PCI;
                bp->pci_dev = pdev;
                pdev->driver_data = dev;
-               if (pci_enable_device (pdev))
-                       goto err_out_region;
                pci_set_master (pdev);
        }
 
-       if (dfx_driver_init(dev) != DFX_K_SUCCESS)
+       if (dfx_driver_init(dev) != DFX_K_SUCCESS) {
+               err = -ENODEV;
                goto err_out_region;
+       }
 
        return 0;
 
@@ -477,12 +487,12 @@ err_out_region:
 err_out:
        unregister_netdev(dev);
        kfree(dev);
-       return -ENODEV;
+       return err;
 }
 
 static int __devinit dfx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-       return  dfx_init_one_pci_or_eisa(pdev, pci_resource_start (pdev, 1));
+       return dfx_init_one_pci_or_eisa(pdev, 0);
 }
 
 static int __init dfx_eisa_init(void)
@@ -642,7 +652,6 @@ static void __devinit dfx_bus_init(struct net_device *dev)
 
                dfx_port_write_long(bp, PFI_K_REG_MODE_CTRL, (PFI_MODE_M_PDQ_INT_ENB | PFI_MODE_M_DMA_ENB));
                }
-       return;
        }
 
 \f
@@ -737,7 +746,6 @@ static void __devinit dfx_bus_config_check(DFX_board_t *bp)
                                }
                        }
                }
-       return;
        }
 
 \f
@@ -977,6 +985,7 @@ static int __devinit dfx_driver_init(struct net_device *dev)
  *       
  * Arguments:
  *   bp - pointer to board information
+ *   get_buffers - non-zero if buffers to be allocated
  *
  * Functional Description:
  *   Issues the low-level firmware/hardware calls necessary to bring
@@ -996,7 +1005,7 @@ static int __devinit dfx_driver_init(struct net_device *dev)
  *   upon a successful return of this routine.
  */
 
-static int dfx_adap_init(DFX_board_t *bp)
+static int dfx_adap_init(DFX_board_t *bp, int get_buffers)
        {
        DBG_printk("In dfx_adap_init...\n");
 
@@ -1131,9 +1140,23 @@ static int dfx_adap_init(DFX_board_t *bp)
                return(DFX_K_FAILURE);
                }
 
+       /*
+        * Remove any existing dynamic buffers (i.e. if the adapter is being
+        * reinitialized)
+        */
+
+       if (get_buffers)
+               dfx_rcv_flush(bp);
+
        /* Initialize receive descriptor block and produce buffers */
 
-       dfx_rcv_init(bp);
+       if (dfx_rcv_init(bp, get_buffers))
+               {
+               printk("%s: Receive buffer allocation failed\n", bp->dev->name);
+               if (get_buffers)
+                       dfx_rcv_flush(bp);
+               return(DFX_K_FAILURE);
+               }
 
        /* Issue START command and bring adapter to LINK_(UN)AVAILABLE state */
 
@@ -1141,6 +1164,8 @@ static int dfx_adap_init(DFX_board_t *bp)
        if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS)
                {
                printk("%s: Start command failed\n", bp->dev->name);
+               if (get_buffers)
+                       dfx_rcv_flush(bp);
                return(DFX_K_FAILURE);
                }
 
@@ -1183,19 +1208,17 @@ static int dfx_adap_init(DFX_board_t *bp)
 
 static int dfx_open(struct net_device *dev)
 {
+       int ret;
        DFX_board_t     *bp = (DFX_board_t *)dev->priv;
 
        DBG_printk("In dfx_open...\n");
        
-       MOD_INC_USE_COUNT;
-
        /* Register IRQ - support shared interrupts by passing device ptr */
 
-       if (request_irq(dev->irq, (void *)dfx_interrupt, SA_SHIRQ, dev->name, dev))
-       {
+       ret = request_irq(dev->irq, (void *)dfx_interrupt, SA_SHIRQ, dev->name, dev);
+       if (ret) {
                printk(KERN_ERR "%s: Requested IRQ %d is busy\n", dev->name, dev->irq);
-               MOD_DEC_USE_COUNT;
-               return -EAGAIN;
+               return ret;
        }
 
        /*
@@ -1228,11 +1251,10 @@ static int dfx_open(struct net_device *dev)
        /* Reset and initialize adapter */
 
        bp->reset_type = PI_PDATA_A_RESET_M_SKIP_ST;    /* skip self-test */
-       if (dfx_adap_init(bp) != DFX_K_SUCCESS)
+       if (dfx_adap_init(bp, 1) != DFX_K_SUCCESS)
        {
                printk(KERN_ERR "%s: Adapter open failed!\n", dev->name);
                free_irq(dev->irq, dev);
-               MOD_DEC_USE_COUNT;
                return -EAGAIN;
        }
 
@@ -1318,6 +1340,10 @@ static int dfx_close(struct net_device *dev)
 
        memset(bp->cons_block_virt, 0, sizeof(PI_CONSUMER_BLOCK));
 
+       /* Release all dynamically allocate skb in the receive ring. */
+
+       dfx_rcv_flush(bp);
+
        /* Clear device structure flags */
 
        netif_stop_queue(dev);
@@ -1326,7 +1352,6 @@ static int dfx_close(struct net_device *dev)
 
        free_irq(dev->irq, dev);
        
-       MOD_DEC_USE_COUNT;
        return(0);
 }
 
@@ -1412,7 +1437,6 @@ static void dfx_int_pr_halt_id(DFX_board_t        *bp)
                        printk("%s: Halt ID: Unknown (code = %X)\n", bp->dev->name, halt_id);
                        break;
                }
-       return;
        }
 
 \f
@@ -1504,7 +1528,7 @@ static void dfx_int_type_0_process(DFX_board_t    *bp)
                bp->link_available = PI_K_FALSE;        /* link is no longer available */
                bp->reset_type = 0;                                     /* rerun on-board diagnostics */
                printk("%s: Resetting adapter...\n", bp->dev->name);
-               if (dfx_adap_init(bp) != DFX_K_SUCCESS)
+               if (dfx_adap_init(bp, 0) != DFX_K_SUCCESS)
                        {
                        printk("%s: Adapter reset failed!  Disabling adapter interrupts.\n", bp->dev->name);
                        dfx_port_write_long(bp, PI_PDQ_K_REG_HOST_INT_ENB, PI_HOST_INT_K_DISABLE_ALL_INTS);
@@ -1552,7 +1576,7 @@ static void dfx_int_type_0_process(DFX_board_t    *bp)
                        bp->link_available = PI_K_FALSE;        /* link is no longer available */
                        bp->reset_type = 0;                                     /* rerun on-board diagnostics */
                        printk("%s: Resetting adapter...\n", bp->dev->name);
-                       if (dfx_adap_init(bp) != DFX_K_SUCCESS)
+                       if (dfx_adap_init(bp, 0) != DFX_K_SUCCESS)
                                {
                                printk("%s: Adapter reset failed!  Disabling adapter interrupts.\n", bp->dev->name);
                                dfx_port_write_long(bp, PI_PDQ_K_REG_HOST_INT_ENB, PI_HOST_INT_K_DISABLE_ALL_INTS);
@@ -1565,7 +1589,6 @@ static void dfx_int_type_0_process(DFX_board_t    *bp)
                        bp->link_available = PI_K_TRUE;         /* set link available flag */
                        }
                }
-       return;
        }
 
 \f
@@ -1640,7 +1663,6 @@ static void dfx_int_common(struct net_device *dev)
 
        if (port_status & PI_PSTATUS_M_TYPE_0_PENDING)
                dfx_int_type_0_process(bp);     /* process Type 0 interrupts */
-       return;
        }
 
 \f
@@ -1732,7 +1754,6 @@ static void dfx_interrupt(int irq, void *dev_id, struct pt_regs   *regs)
                }
 
        spin_unlock(&bp->lock);
-       return;
        }
 
 \f
@@ -2039,7 +2060,6 @@ static void dfx_ctl_set_multicast_list(struct net_device *dev)
                {
                DBG_printk("%s: Adapter filters updated!\n", dev->name);
                }
-       return;
        }
 
 \f
@@ -2540,7 +2560,6 @@ static void dfx_hw_adap_reset(
        /* Deassert reset */
 
        dfx_port_write_long(bp, PI_PDQ_K_REG_PORT_RESET, 0);
-       return;
        }
 
 \f
@@ -2631,7 +2650,28 @@ static int dfx_hw_dma_uninit(DFX_board_t *bp, PI_UINT32 type)
                return(DFX_K_HW_TIMEOUT);
        return(DFX_K_SUCCESS);
        }
+\f
+/*
+ * =================
+ * = dfx_alloc_skb =
+ * =================
+ *
+ * Overview:
+ *   Allocate an skbuff for sending.
+ *
+ * Functional Description:
+ *  Same as dev_alloc_skb(), but it may sleep.
+ */
 
+static inline struct sk_buff *dfx_alloc_skb(unsigned int length)
+{
+       struct sk_buff *skb;
+
+       skb = alloc_skb(length + 16, GFP_BUFFER);
+       if (skb)
+               skb_reserve(skb, 16);
+       return skb;
+}
 
 /*
  *     Align an sk_buff to a boundary power of 2
@@ -2662,6 +2702,7 @@ static void my_skb_align(struct sk_buff *skb, int n)
  *       
  * Arguments:
  *   bp - pointer to board information
+ *   get_buffers - non-zero if buffers to be allocated
  *
  * Functional Description:
  *   This routine can be called during dfx_adap_init() or during an adapter
@@ -2669,7 +2710,10 @@ static void my_skb_align(struct sk_buff *skb, int n)
  *   LLC Host queue receive buffers.
  *
  * Return Codes:
- *   None
+ *   Return 0 on success or -ENOMEM if buffer allocation failed (when using
+ *   dynamic buffer allocation). If the buffer allocation failed, the
+ *   already allocated buffers will not be released and the caller should do
+ *   this.
  *
  * Assumptions:
  *   The PDQ has been reset and the adapter and driver maintained Type 2
@@ -2680,7 +2724,7 @@ static void my_skb_align(struct sk_buff *skb, int n)
  *   is notified.
  */
 
-static void dfx_rcv_init(DFX_board_t *bp)
+static int dfx_rcv_init(DFX_board_t *bp, int get_buffers)
        {
        int     i, j;                                   /* used in for loop */
 
@@ -2702,14 +2746,16 @@ static void dfx_rcv_init(DFX_board_t *bp)
         *              driver initialization when we allocated memory for the receive buffers.
         */
 
+       if (get_buffers) {
 #ifdef DYNAMIC_BUFFERS
        for (i = 0; i < (int)(bp->rcv_bufs_to_post); i++)
                for (j = 0; (i + j) < (int)PI_RCV_DATA_K_NUM_ENTRIES; j += bp->rcv_bufs_to_post)
                {
-                       struct sk_buff *newskb;
+                       struct sk_buff *newskb = dfx_alloc_skb(NEW_SKB_SIZE);
+                       if (!newskb)
+                               return -ENOMEM;
                        bp->descr_block_virt->rcv_data[i+j].long_0 = (u32) (PI_RCV_DESCR_M_SOP |
                                ((PI_RCV_DATA_K_SIZE_MAX / PI_ALIGN_K_RCV_DATA_BUFF) << PI_RCV_DESCR_V_SEG_LEN));
-                       newskb = dev_alloc_skb(NEW_SKB_SIZE);
                        /*
                         * align to 128 bytes for compatibility with
                         * the old EISA boards.
@@ -2733,12 +2779,13 @@ static void dfx_rcv_init(DFX_board_t *bp)
                        bp->p_rcv_buff_va[i+j] = (char *) (bp->rcv_block_virt + (i * PI_RCV_DATA_K_SIZE_MAX));
                        }
 #endif
+       }
 
        /* Update receive producer and Type 2 register */
 
        bp->rcv_xmt_reg.index.rcv_prod = bp->rcv_bufs_to_post;
        dfx_port_write_long(bp, PI_PDQ_K_REG_TYPE_2_PROD, bp->rcv_xmt_reg.lword);
-       return;
+       return 0;
        }
 
 \f
@@ -2833,7 +2880,7 @@ static void dfx_rcv_queue_process(
                                                bp->p_rcv_buff_va[entry] = (char *)newskb;
                                                bp->descr_block_virt->rcv_data[entry].long_1 = virt_to_bus(newskb->data);
                                        } else
-                                               skb = 0;
+                                               skb = NULL;
                                } else
 #endif
                                        skb = dev_alloc_skb(pkt_len+3); /* alloc new buffer to pass up, add room for PRH */
@@ -2858,6 +2905,7 @@ static void dfx_rcv_queue_process(
                                        skb->dev = bp->dev;             /* pass up device pointer */
 
                                        skb->protocol = fddi_type_trans(skb, bp->dev);
+                                       bp->rcv_total_bytes += skb->len;
                                        netif_rx(skb);
 
                                        /* Update the rcv counters */
@@ -2865,8 +2913,6 @@ static void dfx_rcv_queue_process(
                                        bp->rcv_total_frames++;
                                        if (*(p_buff + RCV_BUFF_K_DA) & 0x01)
                                                bp->rcv_multicast_frames++;
-                                
-                                       bp->rcv_total_bytes += skb->len;
                                }
                        }
                        }
@@ -2882,7 +2928,6 @@ static void dfx_rcv_queue_process(
                bp->rcv_xmt_reg.index.rcv_prod += 1;
                bp->rcv_xmt_reg.index.rcv_comp += 1;
                }
-       return;
        }
 
 \f
@@ -3181,6 +3226,54 @@ static int dfx_xmt_done(DFX_board_t *bp)
        }
 
 \f
+/*
+ * =================
+ * = dfx_rcv_flush =
+ * =================
+ *   
+ * Overview:
+ *   Remove all skb's in the receive ring.
+ *  
+ * Returns:
+ *   None
+ *       
+ * Arguments:
+ *   bp - pointer to board information
+ *
+ * Functional Description:
+ *   Free's all the dynamically allocated skb's that are
+ *   currently attached to the device receive ring. This
+ *   function is typically only used when the device is
+ *   initialized or reinitialized.
+ *
+ * Return Codes:
+ *   None
+ *
+ * Side Effects:
+ *   None
+ */
+#ifdef DYNAMIC_BUFFERS
+static void dfx_rcv_flush( DFX_board_t *bp )
+       {
+       int i, j;
+
+       for (i = 0; i < (int)(bp->rcv_bufs_to_post); i++)
+               for (j = 0; (i + j) < (int)PI_RCV_DATA_K_NUM_ENTRIES; j += bp->rcv_bufs_to_post)
+               {
+                       struct sk_buff *skb;
+                       skb = (struct sk_buff *)bp->p_rcv_buff_va[i+j];
+                       if (skb)
+                               dev_kfree_skb(skb);
+                       bp->p_rcv_buff_va[i+j] = NULL;
+               }
+
+       }
+#else
+static inline void dfx_rcv_flush( DFX_board_t *bp )
+{
+}
+#endif /* DYNAMIC_BUFFERS */
+
 /*
  * =================
  * = dfx_xmt_flush =
@@ -3257,7 +3350,6 @@ static void dfx_xmt_flush( DFX_board_t *bp )
        prod_cons = (u32)(bp->cons_block_virt->xmt_rcv_data & ~PI_CONS_M_XMT_INDEX);
        prod_cons |= (u32)(bp->rcv_xmt_reg.index.xmt_prod << PI_CONS_V_XMT_INDEX);
        bp->cons_block_virt->xmt_rcv_data = prod_cons;
-       return;
        }
 
 static void __devexit dfx_remove_one_pci_or_eisa(struct pci_dev *pdev, struct net_device *dev)
index 557cc4029722ec6d2d3555e92f92b72ce39f4430..562c5d68a2a1e3373c5002274f65036e1cb3d2b1 100644 (file)
@@ -1,6 +1,6 @@
 /* epic100.c: A SMC 83c170 EPIC/100 Fast Ethernet driver for Linux. */
 /*
-       Written/copyright 1997-2000 by Donald Becker.
+       Written/copyright 1997-2001 by Donald Becker.
 
        This software may be used and distributed according to the terms of
        the GNU General Public License (GPL), incorporated herein by reference.
        * Fix locking (jgarzik)
        * Limit 83c175 probe to ethernet-class PCI devices (rgooch)
 
+       LK1.1.6:
+       * Merge becker version 1.11
+       * Move pci_enable_device before any PCI BAR len checks
+
 */
 
 /* These identify the driver base version and may not be removed. */
 static const char version[] =
-"epic100.c:v1.09 5/29/2000 Written by Donald Becker <becker@scyld.com>\n";
+"epic100.c:v1.11 1/7/2001 Written by Donald Becker <becker@scyld.com>\n";
 static const char version2[] =
 "  http://www.scyld.com/network/epic100.html\n";
 static const char version3[] =
-" (unofficial 2.4.x kernel port, version 1.1.5, September 7, 2000)\n";
+" (unofficial 2.4.x kernel port, version 1.1.6, January 11, 2001)\n";
 
 /* The user-configurable values.
    These may be modified when a driver module is loaded.*/
@@ -61,7 +65,7 @@ static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
 /* Set the copy breakpoint for the copy-only-tiny-frames scheme.
    Setting to > 1518 effectively disables this feature. */
-static int rx_copybreak = 0;
+static int rx_copybreak;
 
 /* Operational parameters that are set at compile time. */
 
@@ -73,6 +77,8 @@ static int rx_copybreak = 0;
 #define TX_RING_SIZE   16
 #define TX_QUEUE_LEN   10              /* Limit ring entries actually used.  */
 #define RX_RING_SIZE   32
+#define TX_TOTAL_SIZE  TX_RING_SIZE*sizeof(struct epic_tx_desc)
+#define RX_TOTAL_SIZE  RX_RING_SIZE*sizeof(struct epic_rx_desc)
 
 /* Operational parameters that usually are not changed. */
 /* Time in jiffies before concluding the transmitter is hung. */
@@ -161,14 +167,13 @@ enum pci_id_flags_bits {
 enum chip_capability_flags { MII_PWRDWN=1, TYPE2_INTR=2, NO_MII=4 };
 
 #define EPIC_TOTAL_SIZE 0x100
+#define USE_IO_OPS 1
 #ifdef USE_IO_OPS
 #define EPIC_IOTYPE PCI_USES_MASTER|PCI_USES_IO|PCI_ADDR0
 #else
 #define EPIC_IOTYPE PCI_USES_MASTER|PCI_USES_MEM|PCI_ADDR1
 #endif
 
-#define virt_to_le32desc(addr)  cpu_to_le32(virt_to_bus(addr))
-
 typedef enum {
        SMSC_83C170_0,
        SMSC_83C170,
@@ -185,7 +190,7 @@ struct epic_chip_info {
 
 
 /* indexed by chip_t */
-static struct epic_chip_info epic_chip_info[] __devinitdata = {
+static struct epic_chip_info pci_id_tbl[] = {
        { "SMSC EPIC/100 83c170",
         EPIC_IOTYPE, EPIC_TOTAL_SIZE, TYPE2_INTR | NO_MII | MII_PWRDWN },
        { "SMSC EPIC/100 83c170",
@@ -269,16 +274,18 @@ enum desc_status_bits {
        DescOwn=0x8000,
 };
 
-
+#define PRIV_ALIGN     15      /* Required alignment mask */
 struct epic_private {
-       /* Tx and Rx rings first so that they remain paragraph aligned. */
-       struct epic_rx_desc rx_ring[RX_RING_SIZE];
-       struct epic_tx_desc tx_ring[TX_RING_SIZE];
+       struct epic_rx_desc *rx_ring;
+       struct epic_tx_desc *tx_ring;
        /* The saved address of a sent-in-place packet/buffer, for skfree(). */
        struct sk_buff* tx_skbuff[TX_RING_SIZE];
        /* The addresses of receive-in-place skbuffs. */
        struct sk_buff* rx_skbuff[RX_RING_SIZE];
 
+       dma_addr_t tx_ring_dma;
+       dma_addr_t rx_ring_dma;
+
        /* Ring pointers. */
        spinlock_t lock;                                /* Group with Tx control cache line. */
        unsigned int cur_tx, dirty_tx;
@@ -290,7 +297,7 @@ struct epic_private {
        long last_rx_time;                                      /* Last Rx, in jiffies. */
 
        struct pci_dev *pci_dev;                        /* PCI bus location. */
-       int chip_flags;
+       int chip_id, chip_flags;
 
        struct net_device_stats stats;
        struct timer_list timer;                        /* Media selection timer. */
@@ -301,7 +308,7 @@ struct epic_private {
        int mii_phy_cnt;
        unsigned int tx_full:1;                         /* The Tx queue is full. */
        unsigned int full_duplex:1;                     /* Current duplex setting. */
-       unsigned int force_fd:1;                        /* Full-duplex operation requested. */
+       unsigned int duplex_lock:1;                     /* Duplex forced by the user. */
        unsigned int default_port:4;            /* Last dev->if_port value. */
        unsigned int media2:4;                          /* Secondary monitored media port. */
        unsigned int medialock:1;                       /* Don't sense media type. */
@@ -310,8 +317,8 @@ struct epic_private {
 
 static int epic_open(struct net_device *dev);
 static int read_eeprom(long ioaddr, int location);
-static int mdio_read(long ioaddr, int phy_id, int location);
-static void mdio_write(long ioaddr, int phy_id, int location, int value);
+static int mdio_read(struct net_device *dev, int phy_id, int location);
+static void mdio_write(struct net_device *dev, int phy_id, int loc, int val);
 static void epic_restart(struct net_device *dev);
 static void epic_timer(unsigned long data);
 static void epic_tx_timeout(struct net_device *dev);
@@ -330,13 +337,15 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
                                    const struct pci_device_id *ent)
 {
        static int card_idx = -1;
-       static int printed_version = 0;
+       static int printed_version;
+       long ioaddr;
+       int chip_idx = (int) ent->driver_data;
+       int irq;
        struct net_device *dev;
        struct epic_private *ep;
        int i, option = 0, duplex = 0;
-       struct epic_chip_info *ci = &epic_chip_info[ent->driver_data];
-       long ioaddr;
-       int chip_idx = (int) ent->driver_data;
+       void *ring_space;
+       dma_addr_t ring_dma;
 
        card_idx++;
        
@@ -344,16 +353,16 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
                printk (KERN_INFO "%s" KERN_INFO "%s" KERN_INFO "%s",
                        version, version2, version3);
        
-       if ((pci_resource_len(pdev, 0) < ci->io_size) ||
-           (pci_resource_len(pdev, 1) < ci->io_size)) {
+       i = pci_enable_device(pdev);
+       if (i)
+               return i;
+       irq = pdev->irq;
+
+       if (pci_resource_len(pdev, 0) < pci_id_tbl[chip_idx].io_size) {
                printk (KERN_ERR "card %d: no PCI region space\n", card_idx);
                return -ENODEV;
        }
        
-       i = pci_enable_device(pdev);
-       if (i)
-               return i;
-               
        pci_set_master(pdev);
 
        dev = init_etherdev(NULL, sizeof (*ep));
@@ -361,20 +370,10 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
                printk (KERN_ERR "card %d: no memory for eth device\n", card_idx);
                return -ENOMEM;
        }
+       SET_MODULE_OWNER(dev);
 
-       /* request 100% of both regions 0 and 1, just to make
-        * sure noone else steals our regions while we are talking
-        * to them */
-       if (!request_region (pci_resource_start (pdev, 0),
-                            pci_resource_len (pdev, 0), dev->name)) {
-               printk (KERN_ERR "epic100 %d: I/O region busy\n", card_idx);
+       if (pci_request_regions(pdev, dev->name))
                goto err_out_free_netdev;
-       }
-       if (!request_mem_region (pci_resource_start (pdev, 1),
-                                pci_resource_len (pdev, 1), dev->name)) {
-               printk (KERN_ERR "epic100 %d: I/O region busy\n", card_idx);
-               goto err_out_free_pio;
-       }
 
 #ifdef USE_IO_OPS
        ioaddr = pci_resource_start (pdev, 0);
@@ -383,11 +382,26 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
        ioaddr = (long) ioremap (ioaddr, pci_resource_len (pdev, 1));
        if (!ioaddr) {
                printk (KERN_ERR "epic100 %d: ioremap failed\n", card_idx);
-               goto err_out_free_mmio;
+               goto err_out_free_res;
        }
 #endif
 
-       if (dev->mem_start) {
+       pci_set_drvdata(pdev, dev);
+       ep = dev->priv;
+
+       ring_space = pci_alloc_consistent(pdev, TX_TOTAL_SIZE, &ring_dma);
+       if (!ring_space)
+               goto err_out_iounmap;
+       ep->tx_ring = (struct epic_tx_desc *)ring_space;
+       ep->tx_ring_dma = ring_dma;
+
+       ring_space = pci_alloc_consistent(pdev, RX_TOTAL_SIZE, &ring_dma);
+       if (!ring_space)
+               goto err_out_unmap_tx;
+       ep->rx_ring = (struct epic_rx_desc *)ring_space;
+       ep->rx_ring_dma = ring_dma;
+
+       if (dev->mem_start && dev->mem_start != ~0) {
                option = dev->mem_start;
                duplex = (dev->mem_start & 16) ? 1 : 0;
        } else if (card_idx >= 0  &&  card_idx < MAX_UNITS) {
@@ -397,18 +411,13 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
                        duplex = full_duplex[card_idx];
        }
 
-       pdev->driver_data = dev;
-
        dev->base_addr = ioaddr;
-       dev->irq = pdev->irq;
+       dev->irq = irq;
 
-       ep = dev->priv;
-       ep->pci_dev = pdev;
-       ep->chip_flags = ci->drv_flags;
        spin_lock_init (&ep->lock);
 
        printk(KERN_INFO "%s: %s at %#lx, IRQ %d, ",
-                  dev->name, ci->name, ioaddr, dev->irq);
+                  dev->name, pci_id_tbl[chip_idx].name, ioaddr, dev->irq);
 
        /* Bring the chip out of low-power mode. */
        outl(0x4200, ioaddr + GENCTL);
@@ -421,7 +430,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
                outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL);
        outl(0x0200, ioaddr + GENCTL);
 
-       /* This could also be read from the EEPROM. */
+       /* Note: the '175 does not have a serial EEPROM. */
        for (i = 0; i < 3; i++)
                ((u16 *)dev->dev_addr)[i] = le16_to_cpu(inw(ioaddr + LAN0 + i*4));
 
@@ -436,27 +445,31 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
                                   i % 16 == 15 ? "\n" : "");
        }
 
+       ep->pci_dev = pdev;
+       ep->chip_id = chip_idx;
+       ep->chip_flags = pci_id_tbl[chip_idx].drv_flags;
+
        /* Find the connected MII xcvrs.
           Doing this in open() would allow detecting external xcvrs later, but
           takes much time and no cards have external MII. */
        {
                int phy, phy_idx = 0;
                for (phy = 1; phy < 32 && phy_idx < sizeof(ep->phys); phy++) {
-                       int mii_status = mdio_read(ioaddr, phy, 1);
+                       int mii_status = mdio_read(dev, phy, 1);
                        if (mii_status != 0xffff  &&  mii_status != 0x0000) {
                                ep->phys[phy_idx++] = phy;
                                printk(KERN_INFO "%s: MII transceiver #%d control "
                                           "%4.4x status %4.4x.\n",
-                                          dev->name, phy, mdio_read(ioaddr, phy, 0), mii_status);
+                                          dev->name, phy, mdio_read(dev, phy, 0), mii_status);
                        }
                }
                ep->mii_phy_cnt = phy_idx;
                if (phy_idx != 0) {
                        phy = ep->phys[0];
-                       ep->advertising = mdio_read(ioaddr, phy, 4);
-                       printk( KERN_INFO "%s: Autonegotiation advertising %4.4x link "
-                                       "partner %4.4x.\n",
-                                       dev->name, ep->advertising, mdio_read(ioaddr, phy, 5));
+                       ep->advertising = mdio_read(dev, phy, 4);
+                       printk(KERN_INFO "%s: Autonegotiation advertising %4.4x link "
+                                  "partner %4.4x.\n",
+                                  dev->name, ep->advertising, mdio_read(dev, phy, 5));
                } else if ( ! (ep->chip_flags & NO_MII)) {
                        printk(KERN_WARNING "%s: ***WARNING***: No MII transceiver found!\n",
                                   dev->name);
@@ -471,7 +484,11 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
        outl(0x0008, ioaddr + GENCTL);
 
        /* The lower four bits are the media type. */
-       ep->force_fd = duplex;
+       if (duplex) {
+               ep->duplex_lock = ep->full_duplex = 1;
+               printk(KERN_INFO "%s:  Forced full duplex operation requested.\n",
+                          dev->name);
+       }
        dev->if_port = ep->default_port = option;
        if (ep->default_port)
                ep->medialock = 1;
@@ -488,14 +505,14 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
 
        return 0;
 
+err_out_unmap_tx:
+       pci_free_consistent(pdev, TX_TOTAL_SIZE, ep->tx_ring, ep->tx_ring_dma);
+err_out_iounmap:
 #ifndef USE_IO_OPS
-err_out_free_mmio:
-       release_mem_region (pci_resource_start (pdev, 1),
-                           pci_resource_len (pdev, 1));
+       iounmap(ioaddr);
+err_out_free_res:
 #endif
-err_out_free_pio:
-       release_region (pci_resource_start (pdev, 0),
-                       pci_resource_len (pdev, 0));
+       pci_release_regions(pdev);
 err_out_free_netdev:
        unregister_netdev(dev);
        kfree(dev);
@@ -514,7 +531,7 @@ err_out_free_netdev:
 #define EE_ENB                 (0x0001 | EE_CS)
 
 /* Delay between EEPROM clock transitions.
-   No extra delay is needed with 33Mhz PCI, but 66Mhz is untested.
+   This serves to flush the operation to the PCI bus.
  */
 
 #define eeprom_delay() inl(ee_addr)
@@ -561,24 +578,34 @@ static int read_eeprom(long ioaddr, int location)
 
 #define MII_READOP             1
 #define MII_WRITEOP            2
-static int mdio_read(long ioaddr, int phy_id, int location)
+static int mdio_read(struct net_device *dev, int phy_id, int location)
 {
+       long ioaddr = dev->base_addr;
+       int read_cmd = (phy_id << 9) | (location << 4) | MII_READOP;
        int i;
 
-       outl((phy_id << 9) | (location << 4) | MII_READOP, ioaddr + MIICtrl);
-       /* Typical operation takes < 50 ticks. */
-       for (i = 4000; i > 0; i--)
-               if ((inl(ioaddr + MIICtrl) & MII_READOP) == 0)
+       outl(read_cmd, ioaddr + MIICtrl);
+       /* Typical operation takes 25 loops. */
+       for (i = 400; i > 0; i--)
+               if ((inl(ioaddr + MIICtrl) & MII_READOP) == 0) {
+                       /* Work around read failure bug. */
+                       if (phy_id == 1 && location < 6
+                               && inw(ioaddr + MIIData) == 0xffff) {
+                               outl(read_cmd, ioaddr + MIICtrl);
+                               continue;
+                       }
                        return inw(ioaddr + MIIData);
+               }
        return 0xffff;
 }
 
-static void mdio_write(long ioaddr, int phy_id, int location, int value)
+static void mdio_write(struct net_device *dev, int phy_id, int loc, int value)
 {
+       long ioaddr = dev->base_addr;
        int i;
 
        outw(value, ioaddr + MIIData);
-       outl((phy_id << 9) | (location << 4) | MII_WRITEOP, ioaddr + MIICtrl);
+       outl((phy_id << 9) | (loc << 4) | MII_WRITEOP, ioaddr + MIICtrl);
        for (i = 10000; i > 0; i--) {
                if ((inl(ioaddr + MIICtrl) & MII_WRITEOP) == 0)
                        break;
@@ -589,27 +616,21 @@ static void mdio_write(long ioaddr, int phy_id, int location, int value)
 \f
 static int epic_open(struct net_device *dev)
 {
-       struct epic_private *ep = (struct epic_private *)dev->priv;
+       struct epic_private *ep = dev->priv;
        long ioaddr = dev->base_addr;
        int i;
        int retval;
 
-       ep->full_duplex = ep->force_fd;
-
        /* Soft reset the chip. */
        outl(0x4001, ioaddr + GENCTL);
 
-       MOD_INC_USE_COUNT;
-
-       if ((retval = request_irq(dev->irq, &epic_interrupt, SA_SHIRQ, dev->name, dev))) {
-               MOD_DEC_USE_COUNT;
+       if ((retval = request_irq(dev->irq, &epic_interrupt, SA_SHIRQ, dev->name, dev)))
                return retval;
-       }
 
        epic_init_ring(dev);
 
        outl(0x4000, ioaddr + GENCTL);
-       /* This next magic! line by Ken Yamaguchi.. ?? */
+       /* This magic is documented in SMSC app note 7.15 */
        outl(0x0008, ioaddr + TEST1);
 
        /* Pull the chip out of low-power mode, enable interrupts, and set for
@@ -639,21 +660,21 @@ static int epic_open(struct net_device *dev)
 
        if (media2miictl[dev->if_port & 15]) {
                if (ep->mii_phy_cnt)
-                       mdio_write(ioaddr, ep->phys[0], 0, media2miictl[dev->if_port&15]);
+                       mdio_write(dev, ep->phys[0], 0, media2miictl[dev->if_port&15]);
                if (dev->if_port == 1) {
                        if (debug > 1)
                                printk(KERN_INFO "%s: Using the 10base2 transceiver, MII "
                                           "status %4.4x.\n",
-                                          dev->name, mdio_read(ioaddr, ep->phys[0], 1));
+                                          dev->name, mdio_read(dev, ep->phys[0], 1));
                        outl(0x13, ioaddr + MIICfg);
                }
        } else {
-               int mii_reg5 = mdio_read(ioaddr, ep->phys[0], 5);
+               int mii_reg5 = mdio_read(dev, ep->phys[0], 5);
                if (mii_reg5 != 0xffff) {
                        if ((mii_reg5 & 0x0100) || (mii_reg5 & 0x01C0) == 0x0040)
                                ep->full_duplex = 1;
                        else if (! (mii_reg5 & 0x4000))
-                               mdio_write(ioaddr, ep->phys[0], 0, 0x1200);
+                               mdio_write(dev, ep->phys[0], 0, 0x1200);
                        if (debug > 1)
                                printk(KERN_INFO "%s: Setting %s-duplex based on MII xcvr %d"
                                           " register read of %4.4x.\n", dev->name,
@@ -663,8 +684,8 @@ static int epic_open(struct net_device *dev)
        }
 
        outl(ep->full_duplex ? 0x7F : 0x79, ioaddr + TxCtrl);
-       outl(virt_to_bus(ep->rx_ring), ioaddr + PRxCDAR);
-       outl(virt_to_bus(ep->tx_ring), ioaddr + PTxCDAR);
+       outl(ep->rx_ring_dma, ioaddr + PRxCDAR);
+       outl(ep->tx_ring_dma, ioaddr + PTxCDAR);
 
        /* Start the chip's Rx process. */
        set_rx_mode(dev);
@@ -700,7 +721,7 @@ static int epic_open(struct net_device *dev)
 static void epic_pause(struct net_device *dev)
 {
        long ioaddr = dev->base_addr;
-       struct epic_private *ep = (struct epic_private *)dev->priv;
+       struct epic_private *ep = dev->priv;
 
        netif_stop_queue (dev);
        
@@ -723,17 +744,19 @@ static void epic_pause(struct net_device *dev)
 static void epic_restart(struct net_device *dev)
 {
        long ioaddr = dev->base_addr;
-       struct epic_private *ep = (struct epic_private *)dev->priv;
+       struct epic_private *ep = dev->priv;
        int i;
 
-       printk(KERN_DEBUG "%s: Restarting the EPIC chip, Rx %d/%d Tx %d/%d.\n",
-                  dev->name, ep->cur_rx, ep->dirty_rx, ep->dirty_tx, ep->cur_tx);
        /* Soft reset the chip. */
-       outl(0x0001, ioaddr + GENCTL);
+       outl(0x4001, ioaddr + GENCTL);
 
+       printk(KERN_DEBUG "%s: Restarting the EPIC chip, Rx %d/%d Tx %d/%d.\n",
+                  dev->name, ep->cur_rx, ep->dirty_rx, ep->dirty_tx, ep->cur_tx);
        udelay(1);
-       /* Duplicate code from epic_open(). */
-       outl(0x0008, ioaddr + TEST1);
+
+       /* This magic is documented in SMSC app note 7.15 */
+       for (i = 16; i > 0; i--)
+               outl(0x0008, ioaddr + TEST1);
 
 #if defined(__powerpc__) || defined(__sparc__)         /* Big endian */
        outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
@@ -750,9 +773,10 @@ static void epic_restart(struct net_device *dev)
        ep->tx_threshold = TX_FIFO_THRESH;
        outl(ep->tx_threshold, ioaddr + TxThresh);
        outl(ep->full_duplex ? 0x7F : 0x79, ioaddr + TxCtrl);
-       outl(virt_to_bus(&ep->rx_ring[ep->cur_rx%RX_RING_SIZE]), ioaddr + PRxCDAR);
-       outl(virt_to_bus(&ep->tx_ring[ep->dirty_tx%TX_RING_SIZE]),
-                ioaddr + PTxCDAR);
+       outl(ep->rx_ring_dma + (ep->cur_rx%RX_RING_SIZE)*
+               sizeof(struct epic_rx_desc), ioaddr + PRxCDAR);
+       outl(ep->tx_ring_dma + (ep->dirty_tx%TX_RING_SIZE)*
+                sizeof(struct epic_tx_desc), ioaddr + PTxCDAR);
 
        /* Start the chip's Rx process. */
        set_rx_mode(dev);
@@ -770,16 +794,34 @@ static void epic_restart(struct net_device *dev)
        return;
 }
 
-static void epic_timer(unsigned long data)
+static void check_media(struct net_device *dev)
 {
-       struct net_device *dev = (struct net_device *)data;
-       struct epic_private *ep = (struct epic_private *)dev->priv;
+       struct epic_private *ep = dev->priv;
        long ioaddr = dev->base_addr;
-       int next_tick = 60*HZ;
-       int mii_reg5 = ep->mii_phy_cnt ? mdio_read(ioaddr, ep->phys[0], 5) : 0;
+       int mii_reg5 = ep->mii_phy_cnt ? mdio_read(dev, ep->phys[0], 5) : 0;
        int negotiated = mii_reg5 & ep->advertising;
        int duplex = (negotiated & 0x0100) || (negotiated & 0x01C0) == 0x0040;
 
+       if (ep->duplex_lock)
+               return;
+       if (mii_reg5 == 0xffff)         /* Bogus read */
+               return;
+       if (ep->full_duplex != duplex) {
+               ep->full_duplex = duplex;
+               printk(KERN_INFO "%s: Setting %s-duplex based on MII #%d link"
+                          " partner capability of %4.4x.\n", dev->name,
+                          ep->full_duplex ? "full" : "half", ep->phys[0], mii_reg5);
+               outl(ep->full_duplex ? 0x7F : 0x79, ioaddr + TxCtrl);
+       }
+}
+
+static void epic_timer(unsigned long data)
+{
+       struct net_device *dev = (struct net_device *)data;
+       struct epic_private *ep = dev->priv;
+       long ioaddr = dev->base_addr;
+       int next_tick = 5*HZ;
+
        if (debug > 3) {
                printk(KERN_DEBUG "%s: Media monitor tick, Tx status %8.8x.\n",
                           dev->name, (int)inl(ioaddr + TxSTAT));
@@ -789,15 +831,7 @@ static void epic_timer(unsigned long data)
                           (int)inl(ioaddr + INTSTAT), (int)inl(ioaddr + RxSTAT));
        }
 
-       if (! ep->force_fd) {
-               if (ep->full_duplex != duplex) {
-                       ep->full_duplex = duplex;
-                       printk(KERN_INFO "%s: Setting %s-duplex based on MII #%d link"
-                                  " partner capability of %4.4x.\n", dev->name,
-                                  ep->full_duplex ? "full" : "half", ep->phys[0], mii_reg5);
-                       outl(ep->full_duplex ? 0x7F : 0x79, ioaddr + TxCtrl);
-               }
-       }
+       check_media(dev);
 
        ep->timer.expires = jiffies + next_tick;
        add_timer(&ep->timer);
@@ -805,7 +839,7 @@ static void epic_timer(unsigned long data)
 
 static void epic_tx_timeout(struct net_device *dev)
 {
-       struct epic_private *ep = (struct epic_private *)dev->priv;
+       struct epic_private *ep = dev->priv;
        long ioaddr = dev->base_addr;
 
        if (debug > 0) {
@@ -827,13 +861,14 @@ static void epic_tx_timeout(struct net_device *dev)
 
        dev->trans_start = jiffies;
        ep->stats.tx_errors++;
-       return;
+       if (!ep->tx_full)
+               netif_wake_queue(dev);
 }
 
 /* Initialize the Rx and Tx rings, along with various 'dev' bits. */
 static void epic_init_ring(struct net_device *dev)
 {
-       struct epic_private *ep = (struct epic_private *)dev->priv;
+       struct epic_private *ep = dev->priv;
        int i;
 
        ep->tx_full = 0;
@@ -847,11 +882,12 @@ static void epic_init_ring(struct net_device *dev)
        for (i = 0; i < RX_RING_SIZE; i++) {
                ep->rx_ring[i].rxstatus = 0;
                ep->rx_ring[i].buflength = cpu_to_le32(ep->rx_buf_sz);
-               ep->rx_ring[i].next = virt_to_le32desc(&ep->rx_ring[i+1]);
+               ep->rx_ring[i].next = ep->rx_ring_dma + 
+                                     (i+1)*sizeof(struct epic_rx_desc);
                ep->rx_skbuff[i] = 0;
        }
        /* Mark the last entry as wrapping the ring. */
-       ep->rx_ring[i-1].next = virt_to_le32desc(&ep->rx_ring[0]);
+       ep->rx_ring[i-1].next = ep->rx_ring_dma;
 
        /* Fill in the Rx buffers.  Handle allocation failure gracefully. */
        for (i = 0; i < RX_RING_SIZE; i++) {
@@ -861,7 +897,8 @@ static void epic_init_ring(struct net_device *dev)
                        break;
                skb->dev = dev;                 /* Mark as being used by this device. */
                skb_reserve(skb, 2);    /* 16 byte align the IP header. */
-               ep->rx_ring[i].bufaddr = virt_to_le32desc(skb->tail);
+               ep->rx_ring[i].bufaddr = pci_map_single(ep->pci_dev, 
+                       skb->tail, ep->rx_buf_sz, PCI_DMA_FROMDEVICE);
                ep->rx_ring[i].rxstatus = cpu_to_le32(DescOwn);
        }
        ep->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
@@ -871,29 +908,31 @@ static void epic_init_ring(struct net_device *dev)
        for (i = 0; i < TX_RING_SIZE; i++) {
                ep->tx_skbuff[i] = 0;
                ep->tx_ring[i].txstatus = 0x0000;
-               ep->tx_ring[i].next = virt_to_le32desc(&ep->tx_ring[i+1]);
+               ep->tx_ring[i].next = ep->tx_ring_dma + 
+                       (i+1)*sizeof(struct epic_tx_desc);
        }
-       ep->tx_ring[i-1].next = virt_to_le32desc(&ep->tx_ring[0]);
+       ep->tx_ring[i-1].next = ep->tx_ring_dma;
        return;
 }
 
 static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-       struct epic_private *ep = (struct epic_private *)dev->priv;
+       struct epic_private *ep = dev->priv;
        int entry, free_count;
        u32 ctrl_word;
+       long flags;
 
        /* Caution: the write order is important here, set the field with the
           "ownership" bit last. */
-       spin_lock_irq(&ep->lock);
 
        /* Calculate the next Tx descriptor entry. */
+       spin_lock_irqsave(&ep->lock, flags);
        free_count = ep->cur_tx - ep->dirty_tx;
        entry = ep->cur_tx % TX_RING_SIZE;
 
        ep->tx_skbuff[entry] = skb;
-       ep->tx_ring[entry].bufaddr = virt_to_le32desc(skb->data);
-
+       ep->tx_ring[entry].bufaddr = pci_map_single(ep->pci_dev, skb->data, 
+                                                   skb->len, PCI_DMA_TODEVICE);
        if (free_count < TX_QUEUE_LEN/2) {/* Typical path */
                ctrl_word = cpu_to_le32(0x100000); /* No interrupt */
        } else if (free_count == TX_QUEUE_LEN/2) {
@@ -914,8 +953,7 @@ static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev)
        if (ep->tx_full)
                netif_stop_queue(dev);
 
-       spin_unlock_irq(&ep->lock);
-
+       spin_unlock_irqrestore(&ep->lock, flags);
        /* Trigger an immediate transmit demand. */
        outl(TxQueued, dev->base_addr + COMMAND);
 
@@ -934,12 +972,10 @@ static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev)
 static void epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
        struct net_device *dev = (struct net_device *)dev_instance;
-       struct epic_private *ep = (struct epic_private *)dev->priv;
+       struct epic_private *ep = dev->priv;
        long ioaddr = dev->base_addr;
        int status, boguscnt = max_interrupt_work;
 
-       spin_lock(&ep->lock);
-
        do {
                status = inl(ioaddr + INTSTAT);
                /* Acknowledge all of the current interrupt sources ASAP. */
@@ -962,9 +998,11 @@ static void epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
                        /* Note: if this lock becomes a problem we can narrow the locked
                           region at the cost of occasionally grabbing the lock more
                           times. */
+                       spin_lock(&ep->lock);
                        cur_tx = ep->cur_tx;
                        dirty_tx = ep->dirty_tx;
                        for (; cur_tx - dirty_tx > 0; dirty_tx++) {
+                               struct sk_buff *skb;
                                int entry = dirty_tx % TX_RING_SIZE;
                                int txstatus = le32_to_cpu(ep->tx_ring[entry].txstatus);
 
@@ -975,7 +1013,7 @@ static void epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
                                        /* There was an major error, log it. */
 #ifndef final_version
                                        if (debug > 1)
-                                               printk("%s: Transmit error, Tx status %8.8x.\n",
+                                               printk(KERN_DEBUG "%s: Transmit error, Tx status %8.8x.\n",
                                                           dev->name, txstatus);
 #endif
                                        ep->stats.tx_errors++;
@@ -996,13 +1034,16 @@ static void epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
                                }
 
                                /* Free the original skb. */
-                               dev_kfree_skb_irq(ep->tx_skbuff[entry]);
+                               skb = ep->tx_skbuff[entry];
+                               pci_unmap_single(ep->pci_dev, ep->tx_ring[entry].bufaddr, 
+                                                skb->len, PCI_DMA_TODEVICE);
+                               dev_kfree_skb_irq(skb);
                                ep->tx_skbuff[entry] = 0;
                        }
 
 #ifndef final_version
                        if (cur_tx - dirty_tx > TX_RING_SIZE) {
-                               printk("%s: Out-of-sync dirty pointer, %d vs. %d, full=%d.\n",
+                               printk(KERN_WARNING "%s: Out-of-sync dirty pointer, %d vs. %d, full=%d.\n",
                                           dev->name, dirty_tx, cur_tx, ep->tx_full);
                                dirty_tx += TX_RING_SIZE;
                        }
@@ -1010,10 +1051,12 @@ static void epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
                        ep->dirty_tx = dirty_tx;
                        if (ep->tx_full
                                && cur_tx - dirty_tx < TX_QUEUE_LEN - 4) {
-                               /* The ring is no longer full, clear tbusy. */
+                               /* The ring is no longer full, allow new TX entries. */
                                ep->tx_full = 0;
+                               spin_unlock(&ep->lock);
                                netif_wake_queue(dev);
-                       }
+                       } else
+                               spin_unlock(&ep->lock);
                }
 
                /* Check uncommon events all at once. */
@@ -1060,12 +1103,12 @@ static void epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
                printk(KERN_DEBUG "%s: exiting interrupt, intr_status=%#4.4x.\n",
                           dev->name, status);
 
-       spin_unlock(&ep->lock);
+       return;
 }
 
 static int epic_rx(struct net_device *dev)
 {
-       struct epic_private *ep = (struct epic_private *)dev->priv;
+       struct epic_private *ep = dev->priv;
        int entry = ep->cur_rx % RX_RING_SIZE;
        int rx_work_limit = ep->dirty_rx + RX_RING_SIZE - ep->cur_rx;
        int work_done = 0;
@@ -1074,7 +1117,7 @@ static int epic_rx(struct net_device *dev)
                printk(KERN_DEBUG " In epic_rx(), entry %d %8.8x.\n", entry,
                           ep->rx_ring[entry].rxstatus);
        /* If we own the next entry, it's a new packet. Send it up. */
-       while (!(le32_to_cpu(ep->rx_ring[entry].rxstatus) & DescOwn)) { 
+       while ((ep->rx_ring[entry].rxstatus & cpu_to_le32(DescOwn)) == 0) {
                int status = le32_to_cpu(ep->rx_ring[entry].rxstatus);
 
                if (debug > 4)
@@ -1098,6 +1141,10 @@ static int epic_rx(struct net_device *dev)
                        short pkt_len = (status >> 16) - 4;
                        struct sk_buff *skb;
 
+                       pci_dma_sync_single(ep->pci_dev, ep->rx_ring[entry].bufaddr, 
+                                           ep->rx_buf_sz, PCI_DMA_FROMDEVICE);
+                       pci_unmap_single(ep->pci_dev, ep->rx_ring[entry].bufaddr, 
+                                        ep->rx_buf_sz, PCI_DMA_FROMDEVICE);
                        if (pkt_len > PKT_BUF_SZ - 4) {
                                printk(KERN_ERR "%s: Oversized Ethernet frame, status %x "
                                           "%d bytes.\n",
@@ -1141,7 +1188,8 @@ static int epic_rx(struct net_device *dev)
                                break;
                        skb->dev = dev;                 /* Mark as being used by this device. */
                        skb_reserve(skb, 2);    /* Align IP on 16 byte boundaries */
-                       ep->rx_ring[entry].bufaddr = virt_to_le32desc(skb->tail);
+                       ep->rx_ring[entry].bufaddr = pci_map_single(ep->pci_dev, 
+                               skb->tail, ep->rx_buf_sz, PCI_DMA_FROMDEVICE);
                        work_done++;
                }
                ep->rx_ring[entry].rxstatus = cpu_to_le32(DescOwn);
@@ -1152,7 +1200,8 @@ static int epic_rx(struct net_device *dev)
 static int epic_close(struct net_device *dev)
 {
        long ioaddr = dev->base_addr;
-       struct epic_private *ep = (struct epic_private *)dev->priv;
+       struct epic_private *ep = dev->priv;
+       struct sk_buff *skb;
        int i;
 
        netif_stop_queue(dev);
@@ -1167,31 +1216,36 @@ static int epic_close(struct net_device *dev)
 
        /* Free all the skbuffs in the Rx queue. */
        for (i = 0; i < RX_RING_SIZE; i++) {
-               struct sk_buff *skb = ep->rx_skbuff[i];
+               skb = ep->rx_skbuff[i];
                ep->rx_skbuff[i] = 0;
                ep->rx_ring[i].rxstatus = 0;            /* Not owned by Epic chip. */
                ep->rx_ring[i].buflength = 0;
-               ep->rx_ring[i].bufaddr = 0xBADF00D0; /* An invalid address. */
                if (skb) {
+                       pci_unmap_single(ep->pci_dev, ep->rx_ring[i].bufaddr, 
+                                        ep->rx_buf_sz, PCI_DMA_FROMDEVICE);
                        dev_kfree_skb(skb);
                }
+               ep->rx_ring[i].bufaddr = 0xBADF00D0; /* An invalid address. */
        }
        for (i = 0; i < TX_RING_SIZE; i++) {
-               if (ep->tx_skbuff[i])
-                       dev_kfree_skb(ep->tx_skbuff[i]);
+               skb = ep->tx_skbuff[i];
                ep->tx_skbuff[i] = 0;
+               if (!skb)
+                       continue;
+               pci_unmap_single(ep->pci_dev, ep->tx_ring[i].bufaddr, 
+                                skb->len, PCI_DMA_TODEVICE);
+               dev_kfree_skb(skb);
        }
 
        /* Green! Leave the chip in low-power mode. */
        outl(0x0008, ioaddr + GENCTL);
 
-       MOD_DEC_USE_COUNT;
        return 0;
 }
 
 static struct net_device_stats *epic_get_stats(struct net_device *dev)
 {
-       struct epic_private *ep = (struct epic_private *)dev->priv;
+       struct epic_private *ep = dev->priv;
        long ioaddr = dev->base_addr;
 
        if (netif_running(dev)) {
@@ -1233,7 +1287,7 @@ static inline unsigned ether_crc_le(int length, unsigned char *data)
 static void set_rx_mode(struct net_device *dev)
 {
        long ioaddr = dev->base_addr;
-       struct epic_private *ep = (struct epic_private *)dev->priv;
+       struct epic_private *ep = dev->priv;
        unsigned char mc_filter[8];              /* Multicast hash filter */
        int i;
 
@@ -1271,25 +1325,26 @@ static void set_rx_mode(struct net_device *dev)
 
 static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
+       struct epic_private *ep = (void *)dev->priv;
        long ioaddr = dev->base_addr;
        u16 *data = (u16 *)&rq->ifr_data;
 
        switch(cmd) {
        case SIOCDEVPRIVATE:            /* Get the address of the PHY in use. */
-               data[0] = ((struct epic_private *)dev->priv)->phys[0] & 0x1f;
+               data[0] = ep->phys[0] & 0x1f;
                /* Fall Through */
        case SIOCDEVPRIVATE+1:          /* Read the specified MII register. */
                if (! netif_running(dev)) {
                        outl(0x0200, ioaddr + GENCTL);
                        outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL);
                }
-               data[3] = mdio_read(ioaddr, data[0] & 0x1f, data[1] & 0x1f);
+               data[3] = mdio_read(dev, data[0] & 0x1f, data[1] & 0x1f);
+#if 0                                  /* Just leave on if the ioctl() is ever used. */
                if (! netif_running(dev)) {
-#ifdef notdef                                  /* Leave on if the ioctl() is used. */
                        outl(0x0008, ioaddr + GENCTL);
                        outl((inl(ioaddr + NVCTL) & ~0x483C) | 0x0000, ioaddr + NVCTL);
-#endif
                }
+#endif
                return 0;
        case SIOCDEVPRIVATE+2:          /* Write the specified MII register */
                if (!capable(CAP_NET_ADMIN))
@@ -1298,13 +1353,26 @@ static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
                        outl(0x0200, ioaddr + GENCTL);
                        outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL);
                }
-               mdio_write(ioaddr, data[0] & 0x1f, data[1] & 0x1f, data[2]);
+               if (data[0] == ep->phys[0]) {
+                       u16 value = data[2];
+                       switch (data[1]) {
+                       case 0:
+                               /* Check for autonegotiation on or reset. */
+                               ep->duplex_lock = (value & 0x9000) ? 0 : 1;
+                               if (ep->duplex_lock)
+                                       ep->full_duplex = (value & 0x0100) ? 1 : 0;
+                               break;
+                       case 4: ep->advertising = value; break;
+                       }
+                       /* Perhaps check_duplex(dev), depending on chip semantics. */
+               }
+               mdio_write(dev, data[0] & 0x1f, data[1] & 0x1f, data[2]);
+#if 0                                  /* Leave on if the ioctl() is used. */
                if (! netif_running(dev)) {
-#ifdef notdef                                  /* Leave on if the ioctl() is used. */
                        outl(0x0008, ioaddr + GENCTL);
                        outl((inl(ioaddr + NVCTL) & ~0x483C) | 0x0000, ioaddr + NVCTL);
-#endif
                }
+#endif
                return 0;
        default:
                return -EOPNOTSUPP;
@@ -1314,36 +1382,40 @@ static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 
 static void __devexit epic_remove_one (struct pci_dev *pdev)
 {
-       struct net_device *dev = pdev->driver_data;
+       struct net_device *dev = pci_get_drvdata(pdev);
+       struct epic_private *ep = dev->priv;
        
+       pci_free_consistent(pdev, TX_TOTAL_SIZE, ep->tx_ring, ep->tx_ring_dma);
+       pci_free_consistent(pdev, RX_TOTAL_SIZE, ep->rx_ring, ep->rx_ring_dma);
        unregister_netdev(dev);
 #ifndef USE_IO_OPS
-       iounmap ((void*) dev->base_addr);
+       iounmap((void*) dev->base_addr);
 #endif
-       release_mem_region (pci_resource_start (pdev, 1),
-                           pci_resource_len (pdev, 1));
-       release_region (pci_resource_start (pdev, 0),
-                       pci_resource_len (pdev, 0));
+       pci_release_regions(pdev);
        kfree(dev);
+       pci_set_drvdata(pdev, NULL);
+       /* pci_power_off(pdev, -1); */
 }
 
 
 static void epic_suspend (struct pci_dev *pdev)
 {
-       struct net_device *dev = pdev->driver_data;
+       struct net_device *dev = pci_get_drvdata(pdev);
        long ioaddr = dev->base_addr;
 
        epic_pause(dev);
        /* Put the chip into low-power mode. */
        outl(0x0008, ioaddr + GENCTL);
+       /* pci_power_off(pdev, -1); */
 }
 
 
 static void epic_resume (struct pci_dev *pdev)
 {
-       struct net_device *dev = pdev->driver_data;
+       struct net_device *dev = pci_get_drvdata(pdev);
 
-       epic_restart (dev);
+       epic_restart(dev);
+       /* pci_power_on(pdev); */
 }
 
 
index b95403544116d3e7b518d10c26e27e39919617e0..8bc98840e9f4dbbd43c5f27fcedec313103e621d 100644 (file)
@@ -390,23 +390,6 @@ void ltalk_setup(struct net_device *dev)
 
 #endif /* CONFIG_ATALK || CONFIG_ATALK_MODULE */
 
-int ether_config(struct net_device *dev, struct ifmap *map)
-{
-       if (map->mem_start != (u_long)(-1))
-               dev->mem_start = map->mem_start;
-       if (map->mem_end != (u_long)(-1))
-               dev->mem_end = map->mem_end;
-       if (map->base_addr != (u_short)(-1))
-               dev->base_addr = map->base_addr;
-       if (map->irq != (u_char)(-1))
-               dev->irq = map->irq;
-       if (map->dma != (u_char)(-1))
-               dev->dma = map->dma;
-       if (map->port != (u_char)(-1))
-               dev->if_port = map->port;
-       return 0;
-}
-
 int register_netdev(struct net_device *dev)
 {
        int err;
index 08cab2b59c339f08a1cc0c43e8e2a796e611a487..b82741f43181e6dab9f0170a153a5aa6e91de79e 100644 (file)
@@ -1166,7 +1166,9 @@ static int el3_rx(struct net_device *dev, int worklimit)
 
                                skb->protocol = eth_type_trans(skb, dev);
                                netif_rx(skb);
+                               dev->last_rx = jiffies;
                                lp->stats.rx_packets++;
+                               lp->stats.rx_bytes += pkt_len;
                        } else {
                                DEBUG(1, "%s: couldn't allocate a sk_buff of"
                                          " size %d.\n", dev->name, pkt_len);
index 5efb5907add074329d099bfc12ccc2688039961b..c8e024446026e957857fbee906a86d613d4d9373 100644 (file)
@@ -4,7 +4,7 @@
     
     Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net
 
-    3c589_cs.c 1.154 2000/09/30 17:39:04
+    3c589_cs.c 1.156 2001/02/07 00:19:41
 
     The network driver code is based on Donald Becker's 3c589 code:
     
@@ -117,7 +117,7 @@ static int pc_debug = PCMCIA_DEBUG;
 MODULE_PARM(pc_debug, "i");
 #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
 static char *version =
-"3c589_cs.c 1.154 2000/09/30 17:39:04 (David Hinds)";
+"3c589_cs.c 1.156 2001/02/07 00:19:41 (David Hinds)";
 #else
 #define DEBUG(n, args...)
 #endif
@@ -993,8 +993,9 @@ static int el3_rx(struct net_device *dev)
                skb->protocol = eth_type_trans(skb, dev);
                
                netif_rx(skb);
+               dev->last_rx = jiffies;
                lp->stats.rx_packets++;
-               lp->stats.rx_bytes += skb->len;
+               lp->stats.rx_bytes += pkt_len;
            } else {
                DEBUG(1, "%s: couldn't allocate a sk_buff of"
                      " size %d.\n", dev->name, pkt_len);
index 8cdc3dbe61df5be268e9a97e4f696da11466ffba..4836a5577878f7173308f04d513b4cff8f9a4801 100644 (file)
@@ -1,5 +1,5 @@
 /*======================================================================
-    fmvj18x_cs.c,v 2.0 2000/10/01  03:13:53 root Exp
+    fmvj18x_cs.c 2.2 2001/01/07
 
     A fmvj18x (and its compatibles) PCMCIA client driver
 
@@ -19,7 +19,7 @@
     Director, National Security Agency.
     
     This software may be used and distributed according to the terms
-    of the GNU Public License, incorporated herein by reference.
+    of the GNU General Public License, incorporated herein by reference.
     
     The author may be reached as becker@CESDIS.gsfc.nasa.gov, or C/O
     Center of Excellence in Space Data and Information Sciences
@@ -87,8 +87,7 @@ MODULE_PARM(sram_config, "i");
    driver version infomation 
  */
 #ifdef PCMCIA_DEBUG
-static char *version =
- "fmvj18x_cs.c,v 2.0 2000/10/01 03:13:53 root Exp";
+static char *version = "fmvj18x_cs.c 2.2 2001/01/07";
 #endif
 
 /*====================================================================*/
@@ -96,6 +95,7 @@ static char *version =
     PCMCIA event handlers
  */
 static void fmvj18x_config(dev_link_t *link);
+static int fmvj18x_get_hwinfo(dev_link_t *link, u_char *node_id);
 static void fmvj18x_release(u_long arg);
 static int fmvj18x_event(event_t event, int priority,
                          event_callback_args_t *args);
@@ -103,7 +103,7 @@ static dev_link_t *fmvj18x_attach(void);
 static void fmvj18x_detach(dev_link_t *);
 
 /*
-    LAN controler(MBH86960A) specific routines
+    LAN controller(MBH86960A) specific routines
  */
 static int fjn_config(struct net_device *dev, struct ifmap *map);
 static int fjn_open(struct net_device *dev);
@@ -122,7 +122,9 @@ static dev_link_t *dev_list = NULL;
 /*
     card type
  */
-typedef enum { MBH10302, MBH10304, TDK, CONTEC, LA501, UNGERMANN } cardtype_t;
+typedef enum { MBH10302, MBH10304, TDK, CONTEC, LA501, UNGERMANN, 
+              XXX10304
+} cardtype_t;
 
 #define MANFID_UNGERMANN 0x02c0
 
@@ -223,8 +225,8 @@ typedef struct local_info_t {
 #define RECV_ALL             0x03 /* (RX_MODE) */
 #define CONFIG0_DFL          0x5a /* 16bit bus, 4K x 2 Tx queues */
 #define CONFIG0_DFL_1        0x5e /* 16bit bus, 8K x 2 Tx queues */
-#define CONFIG0_RST          0xda /* Data Link Controler off (CONFIG_0) */
-#define CONFIG0_RST_1        0xde /* Data Link Controler off (CONFIG_0) */
+#define CONFIG0_RST          0xda /* Data Link Controller off (CONFIG_0) */
+#define CONFIG0_RST_1        0xde /* Data Link Controller off (CONFIG_0) */
 #define BANK_0               0xa0 /* bank 0 (CONFIG_1) */
 #define BANK_1               0xa4 /* bank 1 (CONFIG_1) */
 #define BANK_2               0xa8 /* bank 2 (CONFIG_1) */
@@ -235,8 +237,8 @@ typedef struct local_info_t {
 #define MANU_MODE            0x03 /* Stop and skip packet on 16 col */
 #define TDK_AUTO_MODE        0x47 /* Auto skip packet on 16 col detected */
 #define TDK_MANU_MODE        0x43 /* Stop and skip packet on 16 col */
-#define INTR_OFF             0x0d /* LAN controler ignores interrupts */
-#define INTR_ON              0x1d /* LAN controler will catch interrupts */
+#define INTR_OFF             0x0d /* LAN controller ignores interrupts */
+#define INTR_ON              0x1d /* LAN controller will catch interrupts */
 
 #define TX_TIMEOUT             ((400*HZ)/1000)
 
@@ -321,8 +323,10 @@ static dev_link_t *fmvj18x_attach(void)
     ether_setup(dev);
     dev->open = &fjn_open;
     dev->stop = &fjn_close;
+#ifdef HAVE_TX_TIMEOUT
     dev->tx_timeout = fjn_tx_timeout;
     dev->watchdog_timeo = TX_TIMEOUT;
+#endif
     
     /* Register with Card Services */
     link->next = dev_list;
@@ -438,6 +442,12 @@ static void fmvj18x_config(dev_link_t *link)
        switch (le16_to_cpu(buf[0])) {
        case MANFID_TDK:
            cardtype = TDK;
+           if (le16_to_cpu(buf[1]) == PRODID_TDK_CF010) {
+               cs_status_t status;
+               CardServices(GetStatus, handle, &status);
+               if (status.CardState & CS_EVENT_3VCARD)
+                   link->conf.Vcc = 33; /* inserted in 3.3V slot */
+           }
            break;
        case MANFID_CONTEC:
            cardtype = CONTEC;
@@ -461,6 +471,15 @@ static void fmvj18x_config(dev_link_t *link)
        else
            buf[0] = 0xffff;
        switch (le16_to_cpu(buf[0])) {
+       case MANFID_FUJITSU:
+           if (le16_to_cpu(buf[1]) == PRODID_FUJITSU_MBH10304) {
+               cardtype = XXX10304;    /* MBH10304 with buggy CIS */
+               link->conf.ConfigIndex = 0x20;
+           } else {
+               cardtype = MBH10302;
+               link->conf.ConfigIndex = 1;
+           }
+           break;
        case MANFID_UNGERMANN:
            cardtype = UNGERMANN;
            /*
@@ -505,7 +524,7 @@ req_irq:
     else
        outb(BANK_0, ioaddr + CONFIG_1);
 
-    /* Reset controler */
+    /* Reset controller */
     if( sram_config == 0 ) 
        outb(CONFIG0_RST, ioaddr + CONFIG_0);
     else
@@ -550,6 +569,19 @@ req_irq:
            dev->dev_addr[i] = inb(ioaddr + UNGERMANN_MAC_ID + i);
        card_name = "Access/CARD";
        break;
+    case XXX10304:
+       /* Read MACID from Buggy CIS */
+       if (fmvj18x_get_hwinfo(link, tuple.TupleData) == -1) {
+           printk(KERN_NOTICE "fmvj18x_cs: unable to read hardware net 
+               address.");
+           unregister_netdev(dev);
+           goto failed;
+       }
+       for (i = 0 ; i < 6; i++) {
+           dev->dev_addr[i] = tuple.TupleData[i];
+       }
+       card_name = "FMV-J182";
+       break;
     case MBH10302:
     default:
        /* Read MACID from register */
@@ -580,7 +612,60 @@ failed:
     fmvj18x_release((u_long)link);
 
 } /* fmvj18x_config */
+/*====================================================================*/
+
+static int fmvj18x_get_hwinfo(dev_link_t *link, u_char *node_id)
+{
+    win_req_t req;
+    memreq_t mem;
+    u_char *base;
+    int i, j;
+
+    /* Allocate a small memory window */
+    req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
+    req.Base = 0; req.Size = 0;
+    req.AccessSpeed = 0;
+    link->win = (window_handle_t)link->handle;
+    i = CardServices(RequestWindow, &link->win, &req);
+    if (i != CS_SUCCESS) {
+       cs_error(link->handle, RequestWindow, i);
+       return -1;
+    }
+
+    base = ioremap(req.Base, req.Size);
+    mem.Page = 0;
+    mem.CardOffset = 0;
+    CardServices(MapMemPage, link->win, &mem);
+
+    /*
+     *  MBH10304 CISTPL_FUNCE_LAN_NODE_ID format
+     *  22 0d xx xx xx 04 06 yy yy yy yy yy yy ff
+     *  'xx' is garbage.
+     *  'yy' is MAC address.
+    */ 
+    for (i = 0; i < 0x200; i++) {
+       if (readb(base+i*2) == 0x22) {  
+           if (readb(base+(i-1)*2) == 0xff
+            && readb(base+(i+5)*2) == 0x04
+            && readb(base+(i+6)*2) == 0x06
+            && readb(base+(i+13)*2) == 0xff) 
+               break;
+       }
+    }
+
+    if (i != 0x200) {
+       for (j = 0 ; j < 6; j++,i++) {
+           node_id[j] = readb(base+(i+7)*2);
+       }
+    }
+
+    iounmap(base);
+    j = CardServices(ReleaseWindow, link->win);
+    if (j != CS_SUCCESS)
+       cs_error(link->handle, ReleaseWindow, j);
+    return (i != 0x200) ? 0 : -1;
+
+} /* fmvj18x_get_hwinfo */
 /*====================================================================*/
 
 static void fmvj18x_release(u_long arg)
@@ -775,7 +860,7 @@ static void fjn_tx_timeout(struct net_device *dev)
     lp->sent = 0;
     lp->open_time = jiffies;
     sti();
-    netif_start_queue(dev);
+    netif_wake_queue(dev);
 }
 
 static int fjn_start_xmit(struct sk_buff *skb, struct net_device *dev)
@@ -923,7 +1008,7 @@ static void fjn_reset(struct net_device *dev)
     outb(D_TX_INTR, ioaddr + TX_INTR);
     outb(D_RX_INTR, ioaddr + RX_INTR);
 
-    /* Turn on interrupts from LAN card controler */
+    /* Turn on interrupts from LAN card controller */
     if( lp->cardtype != TDK ) 
                outb(INTR_ON, ioaddr + LAN_CTRL);
 } /* fjn_reset */
@@ -995,8 +1080,9 @@ static void fjn_rx(struct net_device *dev)
 #endif
 
            netif_rx(skb);
+           dev->last_rx = jiffies;
            lp->stats.rx_packets++;
-           lp->stats.rx_bytes += skb->len;
+           lp->stats.rx_bytes += pkt_len;
        }
        if (--boguscount <= 0)
            break;
index 6d66baf6de05ce467a0b4c187263a6eb2485df70..33acb8add4d6242a0d39ff8fdfeb1aa7fd84ca2d 100644 (file)
@@ -221,4 +221,4 @@ struct i82593_conf_block {
 
 #define I82593_MAX_MULTICAST_ADDRESSES 128     /* Hardware hashed filter */
 
-#endif _I82593_H
+#endif /* _I82593_H */
index a5bef517b1bade718962fdf791953a4a29c3630f..d393e6f95bee9e8d57a8664036c32d3d8f8478c7 100644 (file)
@@ -1463,16 +1463,16 @@ static int netwave_rx(struct net_device *dev) {
        skb->protocol = eth_type_trans(skb,dev);
        /* Queue packet for network layer */
        netif_rx(skb);
-               
+
+       dev->last_rx = jiffies;
+       priv->stats.rx_packets++;
+       priv->stats.rx_bytes += rcvLen;
+
        /* Got the packet, tell the adapter to skip it */
        wait_WOC(iobase);
        writeb(NETWAVE_CMD_SRP, ramBase + NETWAVE_EREG_CB + 0);
        writeb(NETWAVE_CMD_EOC, ramBase + NETWAVE_EREG_CB + 1);
        DEBUG(3, "Packet reception ok\n");
-               
-       priv->stats.rx_packets++;
-
-       priv->stats.rx_bytes += skb->len;
     }
     return 0;
 }
index 9b7f8f048d1940ddbaf12f42d39f09f833f89855..331cda65e643130cee9c27f1676e7959138f0a64 100644 (file)
@@ -1288,9 +1288,9 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt)
        skb->protocol = eth_type_trans(skb, dev);
        
        netif_rx(skb); /* Send the packet to the upper (protocol) layers. */
-
+       dev->last_rx = jiffies;
        lp->linux_stats.rx_packets++;
-       lp->linux_stats.rx_bytes += skb->len;
+       lp->linux_stats.rx_bytes += pkt_len;
        outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */
        continue;
       } else {
index 9befdebfcba8f269f826d96767e14bb86a121852..8a5c5f33a549ed62e87820bc7bf4790e7f81d19f 100644 (file)
@@ -11,7 +11,7 @@
 
     Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net
 
-    pcnet_cs.c 1.126 2000/10/02 20:38:23
+    pcnet_cs.c 1.132 2001/02/09 03:13:29
     
     The network driver code is based on Donald Becker's NE2000 code:
 
@@ -72,7 +72,7 @@ static int pc_debug = PCMCIA_DEBUG;
 MODULE_PARM(pc_debug, "i");
 #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
 static char *version =
-"pcnet_cs.c 1.126 2000/10/02 20:38:23 (David Hinds)";
+"pcnet_cs.c 1.132 2001/02/09 03:13:29 (David Hinds)";
 #else
 #define DEBUG(n, args...)
 #endif
@@ -137,7 +137,7 @@ typedef struct hw_info_t {
 #define HAS_IBM_MISC   0x08
 #define IS_DL10019     0x10
 #define IS_DL10022     0x20
-#define IS_AX88190     0x40
+#define HAS_MII                0x40
 #define USE_SHMEM      0x80    /* autodetected */
 
 static hw_info_t hw_info[] = {
@@ -204,8 +204,8 @@ static hw_info_t hw_info[] = {
 #define NR_INFO                (sizeof(hw_info)/sizeof(hw_info_t))
 
 static hw_info_t default_info = { 0, 0, 0, 0, 0 };
-static hw_info_t dl10019_info = { 0, 0, 0, 0, IS_DL10019 };
-static hw_info_t dl10022_info = { 0, 0, 0, 0, IS_DL10019|IS_DL10022 };
+static hw_info_t dl10019_info = { 0, 0, 0, 0, IS_DL10019|HAS_MII };
+static hw_info_t dl10022_info = { 0, 0, 0, 0, IS_DL10022|HAS_MII };
 
 typedef struct pcnet_dev_t {
     struct net_device  dev;    /* so &dev == &pcnet_dev_t */
@@ -507,10 +507,10 @@ static hw_info_t *get_ax88190(dev_link_t *link)
     if (link->conf.ConfigBase != 0x03c0)
        return NULL;
 
-    outb_p(0x01, EN0_DCFG);    /* Set word-wide access. */
-    outb_p(0x00, EN0_RSARLO);  /* DMA starting at 0x0400. */
-    outb_p(0x04, EN0_RSARHI);
-    outb_p(E8390_RREAD+E8390_START, E8390_CMD);
+    outb_p(0x01, ioaddr + EN0_DCFG);   /* Set word-wide access. */
+    outb_p(0x00, ioaddr + EN0_RSARLO); /* DMA starting at 0x0400. */
+    outb_p(0x04, ioaddr + EN0_RSARHI);
+    outb_p(E8390_RREAD+E8390_START, ioaddr + E8390_CMD);
 
     for (i = 0; i < 6; i += 2) {
        j = inw(ioaddr + PCNET_DATAPORT);
@@ -718,6 +718,7 @@ static void pcnet_config(dev_link_t *link)
     info->flags |= (delay_output) ? DELAY_OUTPUT : 0;
     if ((manfid == MANFID_SOCKET) &&
        ((prodid == PRODID_SOCKET_LPE) ||
+        (prodid == PRODID_SOCKET_LPE_CF) ||
         (prodid == PRODID_SOCKET_EIO)))
        info->flags &= ~USE_BIG_BUF;
     if (!use_big_buf)
@@ -746,13 +747,11 @@ static void pcnet_config(dev_link_t *link)
     link->dev = &info->node;
     link->state &= ~DEV_CONFIG_PENDING;
 
-    if (info->flags & IS_DL10019) {
+    if (info->flags & (IS_DL10019|IS_DL10022)) {
        dev->do_ioctl = &do_ioctl;
        printk(KERN_INFO "%s: NE2000 (DL100%d rev %02x): ",
               dev->name, ((info->flags & IS_DL10022) ? 22 : 19),
               inb(dev->base_addr + 0x1a));
-    } else if (info->flags & IS_AX88190) {
-       printk(KERN_INFO "%s: NE2000 (AX88190): ", dev->name);
     } else
        printk(KERN_INFO "%s: NE2000 Compatible: ", dev->name);
     printk("io %#3lx, irq %d,", dev->base_addr, dev->irq);
@@ -1024,6 +1023,8 @@ static void pcnet_reset_8390(struct net_device *dev)
 
     ei_status.txing = ei_status.dmaing = 0;
 
+    outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, nic_base + E8390_CMD);
+
     outb(inb(nic_base + PCNET_RESET), nic_base + PCNET_RESET);
 
     for (i = 0; i < 100; i++) {
@@ -1092,10 +1093,17 @@ static void ei_watchdog(u_long arg)
        return;
     }
 
-    if (!(info->flags & IS_DL10019))
+    if (!(info->flags & HAS_MII))
+       goto reschedule;
+
+    link = mdio_read(dev->base_addr + DLINK_GPIO, 0, 1);
+    if (!link || (link == 0xffff)) {
+       printk(KERN_INFO "%s: MII is missing!\n", dev->name);
+       info->flags &= ~HAS_MII;
        goto reschedule;
+    }
 
-    link = mdio_read(dev->base_addr + DLINK_GPIO, 0, 1) & 0x0004;
+    link &= 0x0004;
     if (link != info->link_status) {
        u_short p = mdio_read(dev->base_addr + DLINK_GPIO, 0, 5);
        printk(KERN_INFO "%s: %s link beat\n", dev->name,
index 90d62149a5c71665e9776ecd14fb4aed473b6ef6..d51d7aaab6f618d2188def06c1028efd8f38851d 100644 (file)
@@ -2219,9 +2219,9 @@ static void rx_data(struct net_device *dev, struct rcs *prcs, unsigned int pkt_a
 
     skb->protocol = eth_type_trans(skb,dev);
     netif_rx(skb);
-
+    dev->last_rx = jiffies;
     local->stats.rx_packets++;
-    local->stats.rx_bytes += skb->len;
+    local->stats.rx_bytes += total_len;
 
     /* Gather signal strength per address */
 #ifdef WIRELESS_SPY
index fe49974d0119636889befea1146f5ad885825e70..478a4d1eb450739c8a90d2eeabbacaa9204b2be4 100644 (file)
@@ -8,7 +8,7 @@
 
     Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net
 
-    smc91c92_cs.c 1.104 2000/08/31 21:25:13
+    smc91c92_cs.c 1.106 2001/02/07 00:19:58
     
     This driver contains code written by Donald Becker
     (becker@cesdis.gsfc.nasa.gov), Rowan Hughes (x-csrdh@jcu.edu.au),
@@ -231,7 +231,7 @@ enum RxCfg { RxAllMulti = 0x0004, RxPromisc = 0x0002,
             RxEnable = 0x0100, RxStripCRC = 0x0200};
 #define  RCR_SOFTRESET 0x8000  /* resets the chip */
 #define         RCR_STRIP_CRC  0x200   /* strips CRC */
-#define  RCR_ENABLE    0x100   /* IFF this is set, we can recieve packets */
+#define  RCR_ENABLE    0x100   /* IFF this is set, we can receive packets */
 #define  RCR_ALMUL     0x4     /* receive all multicast packets */
 #define         RCR_PROMISC    0x2     /* enable promiscuous mode */
 
@@ -1617,8 +1617,9 @@ static void smc_rx(struct net_device *dev)
        
        skb->dev = dev;
        netif_rx(skb);
+       dev->last_rx = jiffies;
        smc->stats.rx_packets++;
-       smc->stats.rx_bytes += skb->len;
+       smc->stats.rx_bytes += packet_length;
        if (rx_status & RS_MULTICAST)
            smc->stats.multicast++;
     } else {
index 0e1ee227de51525c6cf81d47a6957262e39a9fb1..2d03b182c6fadff4322bd738d74b09e494c7be01 100644 (file)
@@ -7,11 +7,11 @@
  * Original copyright follow. See wavelan_cs.h for details.
  *
  * This file contain the declarations of the Wavelan hardware. Note that
- * the Pcmcia Wavelan include a i82593 controler (see definitions in
+ * the Pcmcia Wavelan include a i82593 controller (see definitions in
  * file i82593.h).
  *
  * The main difference between the pcmcia hardware and the ISA one is
- * the Ethernet Controler (i82593 instead of i82586). The i82593 allow
+ * the Ethernet Controller (i82593 instead of i82586). The i82593 allow
  * only one send buffer. The PSA (Parameter Storage Area : EEprom for
  * permanent storage of various info) is memory mapped, but not the
  * MMI (Modem Management Interface).
index f435466a028add5c2859d443982f55c2b8fff8d9..ebb8c1b54899a4c17847f60ac17a4f386e0f24b2 100644 (file)
  * Apr 2 '98  made changes to bring the i82593 control/int handling in line
  *             with offical specs...
  *
+ * Changes:
+ * Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 08/08/2000
+ * - reorganize kmallocs in wavelan_attach, checking all for failure
+ *   and releasing the previous allocations if one fails
+ *
+ *
  ****************************************************************************
  *   Copyright 1995
  *   Anthony D. Joseph
@@ -512,7 +518,7 @@ void wv_roam_init(struct net_device *dev)
   /* Do not remove this unless you have a good reason */
   printk(KERN_NOTICE "%s: Warning, you have enabled roaming on"
         " device %s !\n", dev->name, dev->name);
-  printk(KERN_NOTICE "Roaming is currently an experimental unsuported feature"
+  printk(KERN_NOTICE "Roaming is currently an experimental unsupported feature"
         " of the Wavelan driver.\n");
   printk(KERN_NOTICE "It may work, but may also make the driver behave in"
         " erratic ways or crash.\n");
@@ -820,7 +826,7 @@ static inline int WAVELAN_BEACON(unsigned char *data)
 
 /************************ I82593 SUBROUTINES *************************/
 /*
- * Usefull subroutines to manage the Ethernet controler
+ * Useful subroutines to manage the Ethernet controller
  */
 
 /*------------------------------------------------------------------*/
@@ -853,7 +859,7 @@ wv_82593_cmd(device *       dev,
   /* We are waiting for command completion */
   wv_wait_completed = TRUE;
 
-  /* Issue the command to the controler */
+  /* Issue the command to the controller */
   outb(cmd, LCCR(base));
 
   /* If we don't have to check the result of the command */
@@ -1774,7 +1780,7 @@ wv_frequency_list(u_long  base,   /* i/o port of the card */
 #if WIRELESS_EXT > 7
   const int    BAND_NUM = 10;  /* Number of bands */
   int          c = 0;          /* Channel number */
-#endif WIRELESS_EXT
+#endif /* WIRELESS_EXT */
 
   /* Read the frequency table */
   fee_read(base, 0x71 /* frequency table */,
@@ -1792,7 +1798,7 @@ wv_frequency_list(u_long  base,   /* i/o port of the card */
              (c < BAND_NUM))
          c++;
        list[i].i = c;  /* Set the list index */
-#endif WIRELESS_EXT
+#endif /* WIRELESS_EXT */
 
        /* put in the list */
        list[i].m = (((freq + 24) * 5) + 24000L) * 10000;
@@ -2727,8 +2733,9 @@ wv_packet_read(device *           dev,
   netif_rx(skb);
 
   /* Keep stats up to date */
+  dev->last_rx = jiffies;
   lp->stats.rx_packets++;
-  lp->stats.rx_bytes += skb->len;
+  lp->stats.rx_bytes += sksize;
 
 #ifdef DEBUG_RX_TRACE
   printk(KERN_DEBUG "%s: <-wv_packet_read()\n", dev->name);
@@ -2949,7 +2956,7 @@ wv_packet_write(device *  dev,
 /*------------------------------------------------------------------*/
 /*
  * This routine is called when we want to send a packet (NET3 callback)
- * In this routine, we check if the the harware is ready to accept
+ * In this routine, we check if the hardware is ready to accept
  * the packet. We also prevent reentrance. Then, we call the function
  * to send the packet...
  */
@@ -2974,7 +2981,7 @@ static int wavelan_packet_xmit (struct sk_buff *skb,
         * In other words, prevent reentering this routine.
         */
        if (1) {
-               /* If somebody has asked to reconfigure the controler, we can do it now */
+               /* If somebody has asked to reconfigure the controller, we can do it now */
                if (lp->reconfig_82593) {
                        lp->reconfig_82593 = FALSE;
                        wv_82593_config (dev);
@@ -3332,7 +3339,7 @@ wv_ru_start(device *      dev)
 
 /*------------------------------------------------------------------*/
 /*
- * This routine does a standard config of the WaveLAN controler (i82593).
+ * This routine does a standard config of the WaveLAN controller (i82593).
  * In the ISA driver, this is integrated in wavelan_hardware_reset()
  * (called by wv_hw_config(), wv_82593_reconfig() & wavelan_packet_xmit())
  */
@@ -3596,7 +3603,7 @@ wv_hw_config(device *     dev)
   hacr_write_slow(base, HACR_RESET);
   hacr_write(base, HACR_DEFAULT);
 
-  /* Check if the the module has been powered up... */
+  /* Check if the module has been powered up... */
   if(hasr_read(base) & HASR_NO_CLK)
     {
 #ifdef DEBUG_CONFIG_ERRORS
@@ -3614,7 +3621,7 @@ wv_hw_config(device *     dev)
   outb(OP0_RESET, LCCR(base));
   mdelay(1);   /* A bit crude ! */
 
-  /* Initialize the LAN controler */
+  /* Initialize the LAN controller */
   if((wv_82593_config(dev) == FALSE) ||
      (wv_diag(dev) == FALSE))
     {
@@ -3918,7 +3925,7 @@ wv_flush_stale_links(void)
  * This function is the interrupt handler for the WaveLAN card. This
  * routine will be called whenever: 
  *     1. A packet is received.
- *     2. A packet has successfully been transfered and the unit is
+ *     2. A packet has successfully been transferred and the unit is
  *        ready to transmit another packet.
  *     3. A command has completed execution.
  */
@@ -4285,7 +4292,7 @@ wavelan_open(device *     dev)
       /* Power up (power up time is 250us) */
       hacr_write(base, HACR_DEFAULT);
 
-      /* Check if the the module has been powered up... */
+      /* Check if the module has been powered up... */
       if(hasr_read(base) & HASR_NO_CLK)
        {
 #ifdef DEBUG_CONFIG_ERRORS
@@ -4424,7 +4431,24 @@ wavelan_attach(void)
 
   /* Initialize the dev_link_t structure */
   link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
+  if (!link)
+         return NULL;
+  
+  /* Allocate the generic data structure */
+  dev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
+  if (!dev)
+         goto fail_alloc_dev;
+  
+  /* Allocate the wavelan-specific data structure. */
+  lp = (net_local *) kmalloc(sizeof(net_local), GFP_KERNEL);
+  if (!lp)
+         goto fail_alloc_dev_priv;
+  
+  memset(lp, 0, sizeof(net_local));
   memset(link, 0, sizeof(struct dev_link_t));
+  memset(dev, 0, sizeof(struct net_device));
+
+  dev->priv = lp;
 
   /* Unused for the Wavelan */
   link->release.function = &wv_pcmcia_release;
@@ -4454,15 +4478,8 @@ wavelan_attach(void)
   link->next = dev_list;
   dev_list = link;
 
-  /* Allocate the generic data structure */
-  dev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
-  memset(dev, 0x00, sizeof(struct net_device));
   link->priv = link->irq.Instance = dev;
 
-  /* Allocate the wavelan-specific data structure. */
-  dev->priv = lp = (net_local *) kmalloc(sizeof(net_local), GFP_KERNEL);
-  memset(lp, 0x00, sizeof(net_local));
-
   /* Init specific data */
   wv_wait_completed = 0;
   lp->status = FALSE;
@@ -4531,6 +4548,12 @@ wavelan_attach(void)
 #endif
 
   return link;
+
+fail_alloc_dev_priv:
+  kfree(dev);
+fail_alloc_dev:
+  kfree(link);
+  return NULL;
 }
 
 /*------------------------------------------------------------------*/
index 68b2f5fc1cbb49022fce66803983a52f95af399f..1cf51dc77cf57fd0580a6dbf28f3524b0f3b780e 100644 (file)
@@ -96,7 +96,7 @@
  *
  * wavelan.h :         Description of the hardware interface & structs
  *
- * i82593.h :          Description if the Ethernet controler
+ * i82593.h :          Description if the Ethernet controller
  */
 
 /* --------------------------- HISTORY --------------------------- */
  *     - wavelan_set_multicast_list : avoid reset
  *     - add wireless extensions (ioctl & get_wireless_stats)
  *       get/set nwid/frequency on fly, info for /proc/net/wireless
- *     - Supress useless stuff from lp (net_local), but add link
+ *     - Suppress useless stuff from lp (net_local), but add link
  *     - More inlines
  *     - Lot of others minor details & cleanups
  *
  *             o Rename wavelan_release to wv_pcmcia_release & move up
  *             o move unregister_netdev to wavelan_detach()
  *             o wavelan_release() no longer call wavelan_detach()
- *             o Supress "release" timer
+ *             o Suppress "release" timer
  *             o Other cleanups & fixes
  *     - New MAC address in the probe
  *     - Reorg PSA_CRC code (endian neutral & cleaner)
 #undef DEBUG_CONFIG_INFO       /* What's going on... */
 #define DEBUG_CONFIG_ERRORS    /* Errors on configuration */
 #undef DEBUG_TX_TRACE          /* Transmission calls */
-#undef DEBUG_TX_INFO           /* Header of the transmited packet */
+#undef DEBUG_TX_INFO           /* Header of the transmitted packet */
 #undef DEBUG_TX_FAIL           /* Normal failure conditions */
 #define DEBUG_TX_ERROR         /* Unexpected conditions */
 #undef DEBUG_RX_TRACE          /* Transmission calls */
-#undef DEBUG_RX_INFO           /* Header of the transmited packet */
+#undef DEBUG_RX_INFO           /* Header of the transmitted packet */
 #undef DEBUG_RX_FAIL           /* Normal failure conditions */
 #define DEBUG_RX_ERROR         /* Unexpected conditions */
-#undef DEBUG_PACKET_DUMP       32      /* Dump packet on the screen */
+#undef DEBUG_PACKET_DUMP       /* Dump packet on the screen */
 #undef DEBUG_IOCTL_TRACE       /* Misc call by Linux */
 #undef DEBUG_IOCTL_INFO                /* Various debug info */
 #define DEBUG_IOCTL_ERROR      /* What's going wrong */
@@ -557,7 +557,7 @@ struct net_local
   en_stats     stats;          /* Ethernet interface statistics */
   int          nresets;        /* Number of hw resets */
   u_char       configured;     /* If it is configured */
-  u_char       reconfig_82593; /* Need to reconfigure the controler */
+  u_char       reconfig_82593; /* Need to reconfigure the controller */
   u_char       promiscuous;    /* Promiscuous mode */
   u_char       allmulticast;   /* All Multicast mode */
   int          mc_count;       /* Number of multicast addresses */
@@ -669,7 +669,7 @@ static int
                     char *,
                     int);
 static inline void
-       wv_82593_reconfig(device *);    /* Reconfigure the controler */
+       wv_82593_reconfig(device *);    /* Reconfigure the controller */
 /* ------------------- DEBUG & INFO SUBROUTINES ------------------- */
 static inline void
        wv_init_info(device *); /* display startup info */
index abe0e1e37a31b3354d50f2a5a05512ef9728e94d..5416223089293cb2c56e1c310c62ce82a4a73ba1 100644 (file)
@@ -125,7 +125,7 @@ enum xirc_esr {
 enum xirc_isr {
     TxBufOvr = 0x01,   /* TX Buffer Overflow */
     PktTxed  = 0x02,   /* Packet Transmitted */
-    MACIntr  = 0x04,   /* MAC Interrupt occured */
+    MACIntr  = 0x04,   /* MAC Interrupt occurred */
     TxResGrant = 0x08, /* Tx Reservation Granted */
     RxFullPkt = 0x20,  /* Rx Full Packet */
     RxPktRej  = 0x40,  /* Rx Packet Rejected */
@@ -382,6 +382,7 @@ static int init_mii(struct net_device *dev);
 static void do_powerdown(struct net_device *dev);
 static int do_stop(struct net_device *dev);
 
+
 /*=============== Helper functions =========================*/
 static void
 flush_stale_links(void)
@@ -1350,7 +1351,6 @@ xirc2ps_interrupt(int irq, void *dev_id, struct pt_regs *regs)
             * packets */
            lp->stats.rx_dropped++;
            DEBUG(2, "%s: RX drop, too much done\n", dev->name);
-           PutWord(XIRCREG0_DO, 0x8000); /* issue cmd: skip_rx_packet */
        } else if (rsr & PktRxOk) {
            struct sk_buff *skb;
 
@@ -1420,13 +1420,13 @@ xirc2ps_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                skb->protocol = eth_type_trans(skb, dev);
                skb->dev = dev;
                netif_rx(skb);
+               dev->last_rx = jiffies;
                lp->stats.rx_packets++;
                lp->stats.rx_bytes += pktlen;
                if (!(rsr & PhyPkt))
                    lp->stats.multicast++;
            }
-           PutWord(XIRCREG0_DO, 0x8000); /* issue cmd: skip_rx_packet */
-       } else {
+       } else { /* bad packet */
            DEBUG(5, "rsr=%#02x\n", rsr);
        }
        if (rsr & PktTooLong) {
@@ -1441,6 +1441,9 @@ xirc2ps_interrupt(int irq, void *dev_id, struct pt_regs *regs)
            lp->stats.rx_fifo_errors++; /* okay ? */
            DEBUG(3, "%s: Alignment error\n", dev->name);
        }
+       
+       /* clear the received/dropped/error packet */
+       PutWord(XIRCREG0_DO, 0x8000); /* issue cmd: skip_rx_packet */
 
        /* get the new ethernet status */
        eth_status = GetByte(XIRCREG_ESR);
index 1e92de817fd4da7e3b17861df1f4e275dde2d50c..4e711e6867b9793eeac2a9bbf411a53bfc482f4c 100644 (file)
@@ -134,6 +134,7 @@ static void __exit rcpci45_remove_one(struct pci_dev *pdev)
        unregister_netdev(dev);
        free_irq(dev->irq, dev); 
        iounmap((void *)dev->base_addr);
+       pci_release_regions(pdev);
        kfree(pDpa->PLanApiPA);
        kfree(pDpa->pPab);
        kfree(pDpa);
@@ -156,12 +157,10 @@ static int rcpci45_init_one(struct pci_dev *pdev,
 {
     unsigned long *vaddr;
     PDPA pDpa;
-    int error = -ENOMEM;
+    int error;
     static int card_idx = -1;
     struct net_device *dev;
-    unsigned long pci_start = pci_resource_start(pdev,0);
-    unsigned long pci_len = pci_resource_len(pdev,0);
-    
+    unsigned long pci_start, pci_len;
 
     card_idx++;
 
@@ -177,8 +176,18 @@ static int rcpci45_init_one(struct pci_dev *pdev,
     dev = init_etherdev(NULL, sizeof(*pDpa));
     if (!dev) {
        printk(KERN_ERR "(rcpci45 driver:) unable to allocate in init_etherdev\n");
+        error = -ENOMEM;
+       goto err_out;
+    }
+
+    error = pci_enable_device(pdev);
+    if (error) {
+        printk(KERN_ERR "(rcpci45 driver:) %d: unable to enable pci device, aborting\n",card_idx);
        goto err_out;
     }
+    error = -ENOMEM;
+    pci_start = pci_resource_start(pdev,0);
+    pci_len = pci_resource_len(pdev,0);
 
     pdev->driver_data = dev;
     
@@ -188,6 +197,7 @@ static int rcpci45_init_one(struct pci_dev *pdev,
 
     if (!pci_start || !(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
        printk(KERN_ERR "(rcpci45 driver:) No PCI memory resources! Aborting.\n");
+       error = -EBUSY;
        goto err_out_free_dev;
     }    
 
@@ -214,20 +224,14 @@ static int rcpci45_init_one(struct pci_dev *pdev,
      * I/O read/write.  Thus, we need to map it to some virtual address
      * area in order to access the registers as normal memory.
      */
-    if (request_mem_region(pci_start, pci_len, dev->name) == NULL) {
-        printk(KERN_ERR "(rcpci45 driver:) %d: resource 0x%lx @ 0x%lx busy, aborting\n",card_idx, pci_start, pci_len);
-       goto err_out_free_msgbuf;
-    }
-
-    if (pci_enable_device(pdev)) {
-        printk(KERN_ERR "(rcpci45 driver:) %d: unable to enable pci device, aborting\n",card_idx);
-       goto err_out_free_msgbuf;
-    }
+    error = pci_request_regions(pdev, dev->name);
+    if (error)
+       goto err_out_free_msgbuf;
 
     vaddr = (ulong *) ioremap (pci_start, pci_len); 
     if (!vaddr) {
         printk(KERN_ERR "(rcpci45 driver:) Unable to remap address range from %lu to %lu\n", pci_start, pci_start+pci_len);
-       goto err_out_free_msgbuf;
+       goto err_out_free_region;
     }
 
     dprintk("rcpci45_init_one: 0x%x, priv = 0x%x, vaddr = 0x%x\n", 
@@ -239,13 +243,14 @@ static int rcpci45_init_one(struct pci_dev *pdev,
 
     return 0; /* success */
 
-
+ err_out_free_region:
+    pci_release_regions(pdev);
  err_out_free_msgbuf:
     kfree(pDpa->msgbuf);
  err_out_free_dev:
+    unregister_netdev(dev);
     kfree(dev);
  err_out:
-    unregister_netdev(dev);
     card_idx--;
     return error;
 }
@@ -384,7 +389,7 @@ RC_xmit_packet(struct sk_buff *skb, struct net_device *dev)
 
     /* 
      * we'll get the context when the adapter interrupts us to tell us that
-     * the transmision is done. At that time, we can free skb.
+     * the transmission is done. At that time, we can free skb.
      */
     ptcb->b.context = (U32)skb;    
     ptcb->b.scount = 1;
diff --git a/drivers/net/rtl8129.c b/drivers/net/rtl8129.c
deleted file mode 100644 (file)
index 028044b..0000000
+++ /dev/null
@@ -1,1483 +0,0 @@
-/* rtl8129.c: A RealTek RTL8129 Fast Ethernet driver for Linux. */
-/*
-       Written 1997-1999 by Donald Becker.
-
-       This software may be used and distributed according to the terms
-       of the GNU Public License, incorporated herein by reference.
-    All other rights reserved.
-
-       This driver is for boards based on the RTL8129 PCI ethernet chip.
-
-       The author may be reached as becker@CESDIS.gsfc.nasa.gov, or C/O
-       Center of Excellence in Space Data and Information Sciences
-          Code 930.5, Goddard Space Flight Center, Greenbelt MD 20771
-
-       Support and updates available at
-       http://cesdis.gsfc.nasa.gov/linux/drivers/rtl8139.html
-
-       Twister-tuning table provided by Kinston <shangh@realtek.com.tw>.
-*/
-
-static const char *version =
-"rtl8129.c:v1.07 5/6/99 Donald Becker http://cesdis.gsfc.nasa.gov/linux/drivers/rtl8139.html\n";
-
-/* A few user-configurable values. */
-/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
-static int max_interrupt_work = 20;
-#define rtl8129_debug debug
-static int rtl8129_debug = 1;
-
-/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
-   The RTL chips use a 64 element hash table based on the Ethernet CRC.  */
-static int multicast_filter_limit = 32;
-
-/* Used to pass the full-duplex flag, etc. */
-#define MAX_UNITS 8            /* More are supported, limit only on options */
-static int options[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
-static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
-
-/* Size of the in-memory receive ring. */
-#define RX_BUF_LEN_IDX 3                       /* 0==8K, 1==16K, 2==32K, 3==64K */
-#define RX_BUF_LEN (8192 << RX_BUF_LEN_IDX)
-/* Size of the Tx bounce buffers -- must be at least (dev->mtu+14+4). */
-#define TX_BUF_SIZE    1536
-
-/* PCI Tuning Parameters
-   Threshold is bytes transferred to chip before transmission starts. */
-#define TX_FIFO_THRESH 256     /* In bytes, rounded down to 32 byte units. */
-
-/* The following settings are log_2(bytes)-4:  0 == 16 bytes .. 6==1024. */
-#define RX_FIFO_THRESH 4               /* Rx buffer level before first PCI xfer.  */
-#define RX_DMA_BURST   4               /* Maximum PCI burst, '4' is 256 bytes */
-#define TX_DMA_BURST   4               /* Calculate as 16<<val. */
-
-/* Operational parameters that usually are not changed. */
-/* Time in jiffies before concluding the transmitter is hung. */
-#define TX_TIMEOUT  (4*HZ)
-
-#include <linux/module.h>
-#include <linux/version.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/string.h>
-#include <linux/timer.h>
-#include <linux/errno.h>
-#include <linux/ioport.h>
-#include <linux/malloc.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
-#include <asm/processor.h>             /* Processor type for cache alignment. */
-#include <asm/bitops.h>
-#include <asm/io.h>
-
-/* Kernel compatibility defines, some common to David Hind's PCMCIA package.
-   This is only in the support-all-kernels source code. */
-
-#define RUN_AT(x) (jiffies + (x))
-
-#include <linux/delay.h>
-
-#if LINUX_VERSION_CODE < 0x20123
-#define test_and_set_bit(val, addr) set_bit(val, addr)
-#endif
-#if LINUX_VERSION_CODE <= 0x20139
-#define        net_device_stats enet_statistics
-#else
-#define NETSTATS_VER2
-#endif
-#if LINUX_VERSION_CODE < 0x20155  ||  defined(CARDBUS)
-/* Grrrr, the PCI code changed, but did not consider CardBus... */
-#include <linux/bios32.h>
-#define PCI_SUPPORT_VER1
-#else
-#define PCI_SUPPORT_VER2
-#endif
-
-/* The I/O extent. */
-#define RTL8129_TOTAL_SIZE 0x80
-
-/*
-                               Theory of Operation
-
-I. Board Compatibility
-
-This device driver is designed for the RealTek RTL8129, the RealTek Fast
-Ethernet controllers for PCI.  This chip is used on a few clone boards.
-
-
-II. Board-specific settings
-
-PCI bus devices are configured by the system at boot time, so no jumpers
-need to be set on the board.  The system BIOS will assign the
-PCI INTA signal to a (preferably otherwise unused) system IRQ line.
-Note: Kernel versions earlier than 1.3.73 do not support shared PCI
-interrupt lines.
-
-III. Driver operation
-
-IIIa. Rx Ring buffers
-
-The receive unit uses a single linear ring buffer rather than the more
-common (and more efficient) descriptor-based architecture.  Incoming frames
-are sequentially stored into the Rx region, and the host copies them into
-skbuffs.
-
-Comment: While it is theoretically possible to process many frames in place,
-any delay in Rx processing would cause us to drop frames.  More importantly,
-the Linux protocol stack is not designed to operate in this manner.
-
-IIIb. Tx operation
-
-The RTL8129 uses a fixed set of four Tx descriptors in register space.
-In a stunningly bad design choice, Tx frames must be 32 bit aligned.  Linux
-aligns the IP header on word boundaries, and 14 byte ethernet header means
-that almost all frames will need to be copied to an alignment buffer.
-
-IVb. References
-
-http://www.realtek.com.tw/cn/cn.html
-http://cesdis.gsfc.nasa.gov/linux/misc/NWay.html
-
-IVc. Errata
-
-*/
-\f
-
-/* This table drives the PCI probe routines.  It's mostly boilerplate in all
-   of the drivers, and will likely be provided by some future kernel.
-   Note the matching code -- the first table entry matchs all 56** cards but
-   second only the 1234 card.
-*/
-enum pci_flags_bit {
-       PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4,
-       PCI_ADDR0=0x10<<0, PCI_ADDR1=0x10<<1, PCI_ADDR2=0x10<<2, PCI_ADDR3=0x10<<3,
-};
-struct pci_id_info {
-       const char *name;
-       u16     vendor_id, device_id, device_id_mask, flags;
-       int io_size;
-       struct net_device *(*probe1)(struct pci_dev *pdev, int pci_bus, int pci_devfn, long ioaddr, int irq, int chip_idx, int fnd_cnt);
-};
-
-static struct net_device * rtl8129_probe1(struct pci_dev *pdev, int pci_bus,
-                                                                                 int pci_devfn, long ioaddr,
-                                                                                 int irq, int chp_idx, int fnd_cnt);
-
-static struct pci_id_info pci_tbl[] =
-{{ "RealTek RTL8129 Fast Ethernet",
-   0x10ec, 0x8129, 0xffff, PCI_USES_IO|PCI_USES_MASTER, 0x80, rtl8129_probe1},
-#ifdef USE_8139_SUPPORT_ALSO
- { "RealTek RTL8139 Fast Ethernet",
-   0x10ec, 0x8139, 0xffff, PCI_USES_IO|PCI_USES_MASTER, 0x80, rtl8129_probe1},
- { "SMC1211TX EZCard 10/100 (RealTek RTL8139)",
-   0x1113, 0x1211, 0xffff, PCI_USES_IO|PCI_USES_MASTER, 0x80, rtl8129_probe1},
- { "Accton MPX5030 (RealTek RTL8139)",
-   0x1113, 0x1211, 0xffff, PCI_USES_IO|PCI_USES_MASTER, 0x80, rtl8129_probe1},
-#endif
- {0,},                                         /* 0 terminated list. */
-};
-
-/* The capability table matches the chip table above. */
-enum {HAS_MII_XCVR=0x01, HAS_CHIP_XCVR=0x02, HAS_LNK_CHNG=0x04};
-static int rtl_cap_tbl[] = {
-       HAS_MII_XCVR, HAS_CHIP_XCVR|HAS_LNK_CHNG, HAS_CHIP_XCVR|HAS_LNK_CHNG,
-};
-
-
-/* The rest of these values should never change. */
-#define NUM_TX_DESC    4                       /* Number of Tx descriptor registers. */
-
-/* Symbolic offsets to registers. */
-enum RTL8129_registers {
-       MAC0=0,                                         /* Ethernet hardware address. */
-       MAR0=8,                                         /* Multicast filter. */
-       TxStatus0=0x10,                         /* Transmit status (Four 32bit registers). */
-       TxAddr0=0x20,                           /* Tx descriptors (also four 32bit). */
-       RxBuf=0x30, RxEarlyCnt=0x34, RxEarlyStatus=0x36,
-       ChipCmd=0x37, RxBufPtr=0x38, RxBufAddr=0x3A,
-       IntrMask=0x3C, IntrStatus=0x3E,
-       TxConfig=0x40, RxConfig=0x44,
-       Timer=0x48,                                     /* A general-purpose counter. */
-       RxMissed=0x4C,                          /* 24 bits valid, write clears. */
-       Cfg9346=0x50, Config0=0x51, Config1=0x52,
-       FlashReg=0x54, GPPinData=0x58, GPPinDir=0x59, MII_SMI=0x5A, HltClk=0x5B,
-       MultiIntr=0x5C, TxSummary=0x60,
-       MII_BMCR=0x62, MII_BMSR=0x64, NWayAdvert=0x66, NWayLPAR=0x68,
-       NWayExpansion=0x6A,
-       /* Undocumented registers, but required for proper operation. */
-       FIFOTMS=0x70,   /* FIFO Test Mode Select */
-       CSCR=0x74,      /* Chip Status and Configuration Register. */
-       PARA78=0x78, PARA7c=0x7c,       /* Magic transceiver parameter register. */
-};
-
-enum ChipCmdBits {
-       CmdReset=0x10, CmdRxEnb=0x08, CmdTxEnb=0x04, RxBufEmpty=0x01, };
-
-/* Interrupt register bits, using my own meaningful names. */
-enum IntrStatusBits {
-       PCIErr=0x8000, PCSTimeout=0x4000,
-       RxFIFOOver=0x40, RxUnderrun=0x20, RxOverflow=0x10,
-       TxErr=0x08, TxOK=0x04, RxErr=0x02, RxOK=0x01,
-};
-enum TxStatusBits {
-       TxHostOwns=0x2000, TxUnderrun=0x4000, TxStatOK=0x8000,
-       TxOutOfWindow=0x20000000, TxAborted=0x40000000, TxCarrierLost=0x80000000,
-};
-enum RxStatusBits {
-       RxMulticast=0x8000, RxPhysical=0x4000, RxBroadcast=0x2000,
-       RxBadSymbol=0x0020, RxRunt=0x0010, RxTooLong=0x0008, RxCRCErr=0x0004,
-       RxBadAlign=0x0002, RxStatusOK=0x0001,
-};
-
-/* Twister tuning parameters from RealTek.
-   Completely undocumented, but required to tune bad links. */
-enum CSCRBits {
-       CSCR_LinkOKBit=0x0400, CSCR_LinkChangeBit=0x0800,
-       CSCR_LinkStatusBits=0x0f000, CSCR_LinkDownOffCmd=0x003c0,
-       CSCR_LinkDownCmd=0x0f3c0,
-};
-static const unsigned long param[4][4]={
-       {0x0cb39de43,0x0cb39ce43,0x0fb38de03,0x0cb38de43},
-       {0x0cb39de43,0x0cb39ce43,0x0cb39ce83,0x0cb39ce83},
-       {0x0cb39de43,0x0cb39ce43,0x0cb39ce83,0x0cb39ce83},
-       {0x0bb39de43,0x0bb39ce43,0x0bb39ce83,0x0bb39ce83}
-};
-
-struct ring_info {
-       struct sk_buff *skb;
-       dma_addr_t mapping;
-};
-
-struct rtl8129_private {
-       char devname[8];                        /* Used only for kernel debugging. */
-       const char *product_name;
-       struct net_device *next_module;
-       struct pci_dev *pdev;
-       int chip_id;
-       int chip_revision;
-       unsigned char pci_bus, pci_devfn;
-       struct net_device_stats stats;
-       struct timer_list timer;        /* Media selection timer. */
-       unsigned int cur_rx;            /* Index into the Rx buffer of next Rx pkt. */
-       unsigned int cur_tx, dirty_tx, tx_flag;
-       /* The saved address of a sent-in-place packet/buffer, for skfree(). */
-       struct ring_info tx_info[NUM_TX_DESC];
-       unsigned char *tx_buf[NUM_TX_DESC];     /* Tx bounce buffers */
-       unsigned char *rx_ring;
-       unsigned char *tx_bufs;                         /* Tx bounce buffer region. */
-       dma_addr_t rx_ring_dma;
-       dma_addr_t tx_bufs_dma;
-       char phys[4];                                           /* MII device addresses. */
-       char twistie, twist_cnt;                        /* Twister tune state. */
-       unsigned int tx_full:1;                         /* The Tx queue is full. */
-       unsigned int full_duplex:1;                     /* Full-duplex operation requested. */
-       unsigned int duplex_lock:1;
-       unsigned int default_port:4;            /* Last dev->if_port value. */
-       unsigned int media2:4;                          /* Secondary monitored media port. */
-       unsigned int medialock:1;                       /* Don't sense media type. */
-       unsigned int mediasense:1;                      /* Media sensing in progress. */
-};
-
-MODULE_AUTHOR("Donald Becker <becker@cesdis.gsfc.nasa.gov>");
-MODULE_DESCRIPTION("RealTek RTL8129 Fast Ethernet driver");
-MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i");
-MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i");
-MODULE_PARM(multicast_filter_limit, "i");
-MODULE_PARM(max_interrupt_work, "i");
-MODULE_PARM(debug, "i");
-
-static int rtl8129_open(struct net_device *dev);
-static int read_eeprom(long ioaddr, int location);
-static int mdio_read(struct net_device *dev, int phy_id, int location);
-static void mdio_write(struct net_device *dev, int phy_id, int location, int val);
-static void rtl8129_timer(unsigned long data);
-static void rtl8129_tx_timeout(struct net_device *dev);
-static void rtl8129_init_ring(struct net_device *dev);
-static int rtl8129_start_xmit(struct sk_buff *skb, struct net_device *dev);
-static int rtl8129_rx(struct net_device *dev);
-static void rtl8129_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
-static int rtl8129_close(struct net_device *dev);
-static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
-static struct net_device_stats *rtl8129_get_stats(struct net_device *dev);
-static inline u32 ether_crc(int length, unsigned char *data);
-static void set_rx_mode(struct net_device *dev);
-\f
-
-/* A list of all installed RTL8129 devices, for removing the driver module. */
-static struct net_device *root_rtl8129_dev = NULL;
-
-/* Ideally we would detect all network cards in slot order.  That would
-   be best done a central PCI probe dispatch, which wouldn't work
-   well when dynamically adding drivers.  So instead we detect just the
-   Rtl81*9 cards in slot order. */
-
-static int __init rtl8129_probe(void)
-{
-       int cards_found = 0;
-       int pci_index = 0;
-       unsigned char pci_bus, pci_device_fn;
-       struct net_device *dev;
-
-       if ( ! pcibios_present())
-               return -ENODEV;
-
-       for (; pci_index < 0xff; pci_index++) {
-               struct pci_dev *pdev;
-               u16 vendor, device, pci_command, new_command;
-               int chip_idx, irq;
-               long ioaddr;
-
-               if (pcibios_find_class (PCI_CLASS_NETWORK_ETHERNET << 8, pci_index,
-                                                               &pci_bus, &pci_device_fn)
-                       != PCIBIOS_SUCCESSFUL)
-                       break;
-               pcibios_read_config_word(pci_bus, pci_device_fn,
-                                                                PCI_VENDOR_ID, &vendor);
-               pcibios_read_config_word(pci_bus, pci_device_fn,
-                                                                PCI_DEVICE_ID, &device);
-
-               for (chip_idx = 0; pci_tbl[chip_idx].vendor_id; chip_idx++)
-                       if (vendor == pci_tbl[chip_idx].vendor_id
-                               && (device & pci_tbl[chip_idx].device_id_mask) ==
-                               pci_tbl[chip_idx].device_id)
-                               break;
-               if (pci_tbl[chip_idx].vendor_id == 0)           /* Compiled out! */
-                       continue;
-
-               pdev = pci_find_slot(pci_bus, pci_device_fn);
-
-               ioaddr = pci_resource_start(pdev, 0);
-               irq = pdev->irq;
-
-               if (pci_enable_device(pdev))
-                       continue;
-
-               if ((pci_tbl[chip_idx].flags & PCI_USES_IO) &&
-                       check_region(ioaddr, pci_tbl[chip_idx].io_size))
-                       continue;
-
-               /* Activate the card: fix for brain-damaged Win98 BIOSes. */
-               pcibios_read_config_word(pci_bus, pci_device_fn,
-                                                                PCI_COMMAND, &pci_command);
-               new_command = pci_command | (pci_tbl[chip_idx].flags & 7);
-               if (pci_command != new_command) {
-                       printk(KERN_INFO "  The PCI BIOS has not enabled the"
-                                  " device at %d/%d!  Updating PCI command %4.4x->%4.4x.\n",
-                                  pci_bus, pci_device_fn, pci_command, new_command);
-                       pcibios_write_config_word(pci_bus, pci_device_fn,
-                                                                         PCI_COMMAND, new_command);
-               }
-
-               dev = pci_tbl[chip_idx].probe1(pdev, pci_bus, pci_device_fn, ioaddr, irq, chip_idx, cards_found);
-
-               if (dev  && (pci_tbl[chip_idx].flags & PCI_COMMAND_MASTER)) {
-                       u8 pci_latency;
-                       pcibios_read_config_byte(pci_bus, pci_device_fn,
-                                                                        PCI_LATENCY_TIMER, &pci_latency);
-                       if (pci_latency < 32) {
-                               printk(KERN_NOTICE "  PCI latency timer (CFLT) is "
-                                          "unreasonably low at %d.  Setting to 64 clocks.\n",
-                                          pci_latency);
-                               pcibios_write_config_byte(pci_bus, pci_device_fn,
-                                                                                 PCI_LATENCY_TIMER, 64);
-                       }
-               }
-               dev = 0;
-               cards_found++;
-       }
-
-       return cards_found ? 0 : -ENODEV;
-}
-
-static struct net_device *rtl8129_probe1(struct pci_dev *pdev, int pci_bus,
-                                                                                int pci_devfn, long ioaddr,
-                                                                                int irq, int chip_idx, int found_cnt)
-{
-       static int did_version = 0;                     /* Already printed version info. */
-       struct rtl8129_private *tp;
-       int i, option = found_cnt < MAX_UNITS ? options[found_cnt] : 0;
-       struct net_device *dev;
-
-       if (rtl8129_debug > 0  &&  did_version++ == 0)
-               printk(KERN_INFO "%s", version);
-
-       dev = init_etherdev(NULL, 0);
-       if (dev == NULL)
-               goto out;
-
-       printk(KERN_INFO "%s: %s at %#lx, IRQ %d, ",
-                  dev->name, pci_tbl[chip_idx].name, ioaddr, irq);
-
-       /* Bring the chip out of low-power mode. */
-       outb(0x00, ioaddr + Config1);
-
-       if (read_eeprom(ioaddr, 0) != 0xffff) {
-               for (i = 0; i < 3; i++) {
-                       ((u16 *)(dev->dev_addr))[i] =
-                               le16_to_cpu(read_eeprom(ioaddr, i + 7));
-               }
-       } else {
-               for (i = 0; i < 6; i++)
-                       dev->dev_addr[i] = inb(ioaddr + MAC0 + i);
-       }
-       for (i = 0; i < 5; i++)
-               printk("%2.2x:", dev->dev_addr[i]);
-       printk("%2.2x.\n", dev->dev_addr[i]);
-
-       /* We do a request_region() to register /proc/ioports info. */
-       if (!request_region(ioaddr, pci_tbl[chip_idx].io_size, dev->name))
-               goto out_free_dev;
-
-       dev->base_addr = ioaddr;
-       dev->irq = irq;
-
-       /* Some data structures must be quadword aligned. */
-       tp = kmalloc(sizeof(*tp), GFP_KERNEL | GFP_DMA);
-       if (tp == NULL)
-               goto out_release_region;
-
-       memset(tp, 0, sizeof(*tp));
-       dev->priv = tp;
-
-       tp->next_module = root_rtl8129_dev;
-       root_rtl8129_dev = dev;
-
-       tp->pdev = pdev;
-       tp->chip_id = chip_idx;
-       tp->pci_bus = pci_bus;
-       tp->pci_devfn = pci_devfn;
-
-       /* Find the connected MII xcvrs.
-          Doing this in open() would allow detecting external xcvrs later, but
-          takes too much time. */
-       if (rtl_cap_tbl[chip_idx] & HAS_MII_XCVR) {
-               int phy, phy_idx;
-               for (phy = 0, phy_idx = 0; phy < 32 && phy_idx < sizeof(tp->phys);
-                        phy++) {
-                       int mii_status = mdio_read(dev, phy, 1);
-                       if (mii_status != 0xffff  && mii_status != 0x0000) {
-                               tp->phys[phy_idx++] = phy;
-                               printk(KERN_INFO "%s: MII transceiver found at address %d.\n",
-                                          dev->name, phy);
-                       }
-               }
-               if (phy_idx == 0) {
-                       printk(KERN_INFO "%s: No MII transceivers found!  Assuming SYM "
-                                  "transceiver.\n",
-                                  dev->name);
-                       tp->phys[0] = -1;
-               }
-       } else
-               tp->phys[0] = 32;
-
-       /* Put the chip into low-power mode. */
-       outb(0xC0, ioaddr + Cfg9346);
-       outb(0x03, ioaddr + Config1);
-       outb('H', ioaddr + HltClk);             /* 'R' would leave the clock running. */
-
-       /* The lower four bits are the media type. */
-       if (option > 0) {
-               tp->full_duplex = (option & 0x200) ? 1 : 0;
-               tp->default_port = option & 15;
-               if (tp->default_port)
-                       tp->medialock = 1;
-       }
-
-       if (found_cnt < MAX_UNITS  &&  full_duplex[found_cnt] > 0)
-               tp->full_duplex = full_duplex[found_cnt];
-
-       if (tp->full_duplex) {
-               printk(KERN_INFO "%s: Media type forced to Full Duplex.\n", dev->name);
-               mdio_write(dev, tp->phys[0], 4, 0x141);
-               tp->duplex_lock = 1;
-       }
-
-       /* The Rtl8129-specific entries in the device structure. */
-       dev->open = &rtl8129_open;
-       dev->hard_start_xmit = &rtl8129_start_xmit;
-       dev->tx_timeout = &rtl8129_tx_timeout;
-       dev->watchdog_timeo = TX_TIMEOUT;
-       dev->stop = &rtl8129_close;
-       dev->get_stats = &rtl8129_get_stats;
-       dev->set_multicast_list = &set_rx_mode;
-       dev->do_ioctl = &mii_ioctl;
-       return dev;
-
-out_release_region:
-       release_region(ioaddr, pci_tbl[chip_idx].io_size);
-out_free_dev:
-       unregister_netdev(dev);
-       kfree(dev);
-out:
-       return NULL;
-}
-\f
-/* Serial EEPROM section. */
-
-/*  EEPROM_Ctrl bits. */
-#define EE_SHIFT_CLK   0x04    /* EEPROM shift clock. */
-#define EE_CS                  0x08    /* EEPROM chip select. */
-#define EE_DATA_WRITE  0x02    /* EEPROM chip data in. */
-#define EE_WRITE_0             0x00
-#define EE_WRITE_1             0x02
-#define EE_DATA_READ   0x01    /* EEPROM chip data out. */
-#define EE_ENB                 (0x80 | EE_CS)
-
-/* Delay between EEPROM clock transitions.
-   No extra delay is needed with 33Mhz PCI, but 66Mhz may change this.
- */
-
-#define eeprom_delay() inl(ee_addr)
-
-/* The EEPROM commands include the alway-set leading bit. */
-#define EE_WRITE_CMD   (5 << 6)
-#define EE_READ_CMD            (6 << 6)
-#define EE_ERASE_CMD   (7 << 6)
-
-static int read_eeprom(long ioaddr, int location)
-{
-       int i;
-       unsigned retval = 0;
-       long ee_addr = ioaddr + Cfg9346;
-       int read_cmd = location | EE_READ_CMD;
-
-       outb(EE_ENB & ~EE_CS, ee_addr);
-       outb(EE_ENB, ee_addr);
-
-       /* Shift the read command bits out. */
-       for (i = 10; i >= 0; i--) {
-               int dataval = (read_cmd & (1 << i)) ? EE_DATA_WRITE : 0;
-               outb(EE_ENB | dataval, ee_addr);
-               eeprom_delay();
-               outb(EE_ENB | dataval | EE_SHIFT_CLK, ee_addr);
-               eeprom_delay();
-       }
-       outb(EE_ENB, ee_addr);
-       eeprom_delay();
-
-       for (i = 16; i > 0; i--) {
-               outb(EE_ENB | EE_SHIFT_CLK, ee_addr);
-               eeprom_delay();
-               retval = (retval << 1) | ((inb(ee_addr) & EE_DATA_READ) ? 1 : 0);
-               outb(EE_ENB, ee_addr);
-               eeprom_delay();
-       }
-
-       /* Terminate the EEPROM access. */
-       outb(~EE_CS, ee_addr);
-       return retval;
-}
-
-/* MII serial management: mostly bogus for now. */
-/* Read and write the MII management registers using software-generated
-   serial MDIO protocol.
-   The maximum data clock rate is 2.5 Mhz.  The minimum timing is usually
-   met by back-to-back PCI I/O cycles, but we insert a delay to avoid
-   "overclocking" issues. */
-#define MDIO_DIR               0x80
-#define MDIO_DATA_OUT  0x04
-#define MDIO_DATA_IN   0x02
-#define MDIO_CLK               0x01
-#define MDIO_WRITE0 (MDIO_DIR)
-#define MDIO_WRITE1 (MDIO_DIR | MDIO_DATA_OUT)
-
-#define mdio_delay()   inb(mdio_addr)
-
-static char mii_2_8139_map[8] = {MII_BMCR, MII_BMSR, 0, 0, NWayAdvert,
-                                                                NWayLPAR, NWayExpansion, 0 };
-
-/* Syncronize the MII management interface by shifting 32 one bits out. */
-static void mdio_sync(long mdio_addr)
-{
-       int i;
-
-       for (i = 32; i >= 0; i--) {
-               outb(MDIO_WRITE1, mdio_addr);
-               mdio_delay();
-               outb(MDIO_WRITE1 | MDIO_CLK, mdio_addr);
-               mdio_delay();
-       }
-       return;
-}
-static int mdio_read(struct net_device *dev, int phy_id, int location)
-{
-       long mdio_addr = dev->base_addr + MII_SMI;
-       int mii_cmd = (0xf6 << 10) | (phy_id << 5) | location;
-       int retval = 0;
-       int i;
-
-       if (phy_id > 31) {      /* Really a 8139.  Use internal registers. */
-               return location < 8 && mii_2_8139_map[location] ?
-                       inw(dev->base_addr + mii_2_8139_map[location]) : 0;
-       }
-       mdio_sync(mdio_addr);
-       /* Shift the read command bits out. */
-       for (i = 15; i >= 0; i--) {
-               int dataval = (mii_cmd & (1 << i)) ? MDIO_DATA_OUT : 0;
-
-               outb(MDIO_DIR | dataval, mdio_addr);
-               mdio_delay();
-               outb(MDIO_DIR | dataval | MDIO_CLK, mdio_addr);
-               mdio_delay();
-       }
-
-       /* Read the two transition, 16 data, and wire-idle bits. */
-       for (i = 19; i > 0; i--) {
-               outb(0, mdio_addr);
-               mdio_delay();
-               retval = (retval << 1) | ((inb(mdio_addr) & MDIO_DATA_IN) ? 1 : 0);
-               outb(MDIO_CLK, mdio_addr);
-               mdio_delay();
-       }
-       return (retval>>1) & 0xffff;
-}
-
-static void mdio_write(struct net_device *dev, int phy_id, int location, int value)
-{
-       long mdio_addr = dev->base_addr + MII_SMI;
-       int mii_cmd = (0x5002 << 16) | (phy_id << 23) | (location<<18) | value;
-       int i;
-
-       if (phy_id > 31) {      /* Really a 8139.  Use internal registers. */
-               if (location < 8  &&  mii_2_8139_map[location])
-                       outw(value, dev->base_addr + mii_2_8139_map[location]);
-               return;
-       }
-       mdio_sync(mdio_addr);
-
-       /* Shift the command bits out. */
-       for (i = 31; i >= 0; i--) {
-               int dataval = (mii_cmd & (1 << i)) ? MDIO_WRITE1 : MDIO_WRITE0;
-               outb(dataval, mdio_addr);
-               mdio_delay();
-               outb(dataval | MDIO_CLK, mdio_addr);
-               mdio_delay();
-       }
-       /* Clear out extra bits. */
-       for (i = 2; i > 0; i--) {
-               outb(0, mdio_addr);
-               mdio_delay();
-               outb(MDIO_CLK, mdio_addr);
-               mdio_delay();
-       }
-       return;
-}
-
-\f
-static int
-rtl8129_open(struct net_device *dev)
-{
-       struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv;
-       long ioaddr = dev->base_addr;
-       int i, retval;
-
-       MOD_INC_USE_COUNT;
-
-       /* Soft reset the chip. */
-       outb(CmdReset, ioaddr + ChipCmd);
-
-       if ((retval = request_irq(dev->irq, &rtl8129_interrupt, SA_SHIRQ, dev->name, dev))) {
-               MOD_DEC_USE_COUNT;
-               return retval;
-       }
-
-       tp->tx_bufs = pci_alloc_consistent(tp->pdev,
-                                                                          TX_BUF_SIZE * NUM_TX_DESC,
-                                                                          &tp->tx_bufs_dma);
-       tp->rx_ring = pci_alloc_consistent(tp->pdev,
-                                                                          RX_BUF_LEN + 16,
-                                                                          &tp->rx_ring_dma);
-       if (tp->tx_bufs == NULL ||  tp->rx_ring == NULL) {
-               free_irq(dev->irq, dev);
-               if (tp->tx_bufs)
-                       pci_free_consistent(tp->pdev,
-                                                               TX_BUF_SIZE * NUM_TX_DESC,
-                                                               tp->tx_bufs, tp->tx_bufs_dma);
-               if (tp->rx_ring)
-                       pci_free_consistent(tp->pdev,
-                                                               RX_BUF_LEN + 16,
-                                                               tp->rx_ring, tp->rx_ring_dma);
-               if (rtl8129_debug > 0)
-                       printk(KERN_ERR "%s: Couldn't allocate a %d byte receive ring.\n",
-                                  dev->name, RX_BUF_LEN);
-               MOD_DEC_USE_COUNT;
-               return -ENOMEM;
-       }
-       rtl8129_init_ring(dev);
-
-       /* Check that the chip has finished the reset. */
-       for (i = 1000; i > 0; i--)
-               if ((inb(ioaddr + ChipCmd) & CmdReset) == 0)
-                       break;
-
-       for (i = 0; i < 6; i++)
-               outb(dev->dev_addr[i], ioaddr + MAC0 + i);
-
-       /* Must enable Tx/Rx before setting transfer thresholds! */
-       outb(CmdRxEnb | CmdTxEnb, ioaddr + ChipCmd);
-       outl((RX_FIFO_THRESH << 13) | (RX_BUF_LEN_IDX << 11) | (RX_DMA_BURST<<8),
-                ioaddr + RxConfig);
-       outl((TX_DMA_BURST<<8)|0x03000000, ioaddr + TxConfig);
-       tp->tx_flag = (TX_FIFO_THRESH<<11) & 0x003f0000;
-
-       tp->full_duplex = tp->duplex_lock;
-       if (tp->phys[0] >= 0  ||  (rtl_cap_tbl[tp->chip_id] & HAS_MII_XCVR)) {
-               u16 mii_reg5 = mdio_read(dev, tp->phys[0], 5);
-               if (mii_reg5 == 0xffff)
-                       ;                                       /* Not there */
-               else if ((mii_reg5 & 0x0100) == 0x0100
-                                || (mii_reg5 & 0x00C0) == 0x0040)
-                       tp->full_duplex = 1;
-               if (rtl8129_debug > 1)
-                       printk(KERN_INFO"%s: Setting %s%s-duplex based on"
-                                  " auto-negotiated partner ability %4.4x.\n", dev->name,
-                                  mii_reg5 == 0 ? "" :
-                                  (mii_reg5 & 0x0180) ? "100mbps " : "10mbps ",
-                                  tp->full_duplex ? "full" : "half", mii_reg5);
-       }
-
-       outb(0xC0, ioaddr + Cfg9346);
-       outb(tp->full_duplex ? 0x60 : 0x20, ioaddr + Config1);
-       outb(0x00, ioaddr + Cfg9346);
-
-       outl(tp->rx_ring_dma, ioaddr + RxBuf);
-
-       /* Start the chip's Tx and Rx process. */
-       outl(0, ioaddr + RxMissed);
-       set_rx_mode(dev);
-
-       outb(CmdRxEnb | CmdTxEnb, ioaddr + ChipCmd);
-
-       /* Enable all known interrupts by setting the interrupt mask. */
-       outw(PCIErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver
-                | TxErr | TxOK | RxErr | RxOK, ioaddr + IntrMask);
-
-       if (rtl8129_debug > 1)
-               printk(KERN_DEBUG"%s: rtl8129_open() ioaddr %#lx IRQ %d"
-                          " GP Pins %2.2x %s-duplex.\n",
-                          dev->name, ioaddr, dev->irq, inb(ioaddr + GPPinData),
-                          tp->full_duplex ? "full" : "half");
-
-       /* Set the timer to switch to check for link beat and perhaps switch
-          to an alternate media type. */
-       init_timer(&tp->timer);
-       tp->timer.expires = RUN_AT((24*HZ)/10);                 /* 2.4 sec. */
-       tp->timer.data = (unsigned long)dev;
-       tp->timer.function = &rtl8129_timer;
-       add_timer(&tp->timer);
-
-       return 0;
-}
-
-static void rtl8129_timer(unsigned long data)
-{
-       struct net_device *dev = (struct net_device *)data;
-       struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv;
-       long ioaddr = dev->base_addr;
-       int next_tick = 60*HZ;
-       int mii_reg5 = mdio_read(dev, tp->phys[0], 5);
-
-       if (! tp->duplex_lock  &&  mii_reg5 != 0xffff) {
-               int duplex = (mii_reg5&0x0100) || (mii_reg5 & 0x01C0) == 0x0040;
-               if (tp->full_duplex != duplex) {
-                       tp->full_duplex = duplex;
-                       printk(KERN_INFO "%s: Setting %s-duplex based on MII #%d link"
-                                  " partner ability of %4.4x.\n", dev->name,
-                                  tp->full_duplex ? "full" : "half", tp->phys[0], mii_reg5);
-                       outb(0xC0, ioaddr + Cfg9346);
-                       outb(tp->full_duplex ? 0x60 : 0x20, ioaddr + Config1);
-                       outb(0x00, ioaddr + Cfg9346);
-               }
-       }
-       /* Check for bogusness. */
-       if (inw(ioaddr + IntrStatus) & (TxOK | RxOK)) {
-               int status = inw(ioaddr + IntrStatus);
-               if (status & (TxOK | RxOK)) {   /* Double check */
-                       printk(KERN_ERR "%s: RTL8129 Interrupt line blocked, status %x.\n",
-                                  dev->name, status);
-                       rtl8129_interrupt(dev->irq, dev, 0);
-               }
-       }
-       if (netif_queue_stopped(dev) &&
-               (jiffies - dev->trans_start) >= 2*TX_TIMEOUT)
-               rtl8129_tx_timeout(dev);
-
-#if 0
-       if (tp->twistie) {
-               unsigned int CSCRval = inw(ioaddr + CSCR);              /* Read link status. */
-               if (tp->twistie == 1) {
-                       if (CSCRval & CSCR_LinkOKBit) {
-                               outw(CSCR_LinkDownOffCmd, ioaddr + CSCR);
-                               tp->twistie = 2;
-                               next_tick = HZ/10;
-                       } else {
-                               outw(CSCR_LinkDownCmd, ioaddr + CSCR);
-                               outl(FIFOTMS_default,ioaddr + FIFOTMS);
-                               outl(PARA78_default ,ioaddr + PARA78);
-                               outl(PARA7c_default ,ioaddr + PARA7c);
-                               tp->twistie = 0;
-                       }
-               } else if (tp->twistie == 2) {
-                       int linkcase = (CSCRval & CSCR_LinkStatusBits) >> 12;
-                       int row;
-                       if (linkcase >= 0x7000) row = 3;
-                       else if (linkcase >= 0x3000) row = 2;
-                       else if (linkcase >= 0x1000) row = 1;
-                       else row = 0;
-                       tp->twistie == row + 3;
-                       outw(0,ioaddr+FIFOTMS);
-                       outl(param[row][0], ioaddr+PARA7c);
-                       tp->twist_cnt = 1;
-               } else {
-                       outl(param[tp->twistie-3][tp->twist_cnt], ioaddr+PARA7c);
-                       if (++tp->twist_cnt < 4) {
-                               next_tick = HZ/10;
-                       } else if (tp->twistie-3 == 3) {
-                               if ((CSCRval & CSCR_LinkStatusBits) != 0x7000) {
-                                       outl(PARA7c_xxx, ioaddr+PARA7c);
-                                       next_tick = HZ/10;              /* 100ms. */
-                                       outl(FIFOTMS_default, ioaddr+FIFOTMS);
-                                       outl(PARA78_default,  ioaddr+PARA78);
-                                       outl(PARA7c_default,  ioaddr+PARA7c);
-                                       tp->twistie == 3 + 3;
-                                       outw(0,ioaddr+FIFOTMS);
-                                       outl(param[3][0], ioaddr+PARA7c);
-                                       tp->twist_cnt = 1;
-                               }
-                       }
-               }
-       }
-#endif
-
-       if (rtl8129_debug > 2) {
-               if (rtl_cap_tbl[tp->chip_id] & HAS_MII_XCVR)
-                       printk(KERN_DEBUG"%s: Media selection tick, GP pins %2.2x.\n",
-                                  dev->name, inb(ioaddr + GPPinData));
-               else
-                       printk(KERN_DEBUG"%s: Media selection tick, Link partner %4.4x.\n",
-                                  dev->name, inw(ioaddr + NWayLPAR));
-               printk(KERN_DEBUG"%s:  Other registers are IntMask %4.4x IntStatus %4.4x"
-                          " RxStatus %4.4x.\n",
-                          dev->name, inw(ioaddr + IntrMask), inw(ioaddr + IntrStatus),
-                          inl(ioaddr + RxEarlyStatus));
-               printk(KERN_DEBUG"%s:  Chip config %2.2x %2.2x.\n",
-                          dev->name, inb(ioaddr + Config0), inb(ioaddr + Config1));
-       }
-
-       tp->timer.expires = RUN_AT(next_tick);
-       add_timer(&tp->timer);
-}
-
-static void rtl8129_tx_timeout(struct net_device *dev)
-{
-       struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv;
-       long ioaddr = dev->base_addr;
-       int mii_reg, i;
-
-       if (rtl8129_debug > 0)
-               printk(KERN_WARNING "%s: Transmit timeout, status %2.2x %4.4x "
-                          "media %2.2x.\n",
-                          dev->name, inb(ioaddr + ChipCmd), inw(ioaddr + IntrStatus),
-                          inb(ioaddr + GPPinData));
-
-       /* Disable interrupts by clearing the interrupt mask. */
-       outw(0x0000, ioaddr + IntrMask);
-       /* Emit info to figure out what went wrong. */
-       printk("%s: Tx queue start entry %d  dirty entry %d.\n",
-                  dev->name, tp->cur_tx, tp->dirty_tx);
-       for (i = 0; i < NUM_TX_DESC; i++)
-               printk(KERN_DEBUG"%s:  Tx descriptor %d is %8.8x.%s\n",
-                          dev->name, i, inl(ioaddr + TxStatus0 + i*4),
-                          i == tp->dirty_tx % NUM_TX_DESC ? " (queue head)" : "");
-       printk(KERN_DEBUG"%s: MII #%d registers are:", dev->name, tp->phys[0]);
-       for (mii_reg = 0; mii_reg < 8; mii_reg++)
-               printk(" %4.4x", mdio_read(dev, tp->phys[0], mii_reg));
-       printk(".\n");
-
-       /* Soft reset the chip. */
-       outb(CmdReset, ioaddr + ChipCmd);
-       /* Check that the chip has finished the reset. */
-       for (i = 1000; i > 0; i--)
-               if ((inb(ioaddr + ChipCmd) & CmdReset) == 0)
-                       break;
-       for (i = 0; i < 6; i++)
-               outb(dev->dev_addr[i], ioaddr + MAC0 + i);
-
-       outb(0x00, ioaddr + Cfg9346);
-       tp->cur_rx = 0;
-       /* Must enable Tx/Rx before setting transfer thresholds! */
-       outb(CmdRxEnb | CmdTxEnb, ioaddr + ChipCmd);
-       outl((RX_FIFO_THRESH << 13) | (RX_BUF_LEN_IDX << 11) | (RX_DMA_BURST<<8),
-                ioaddr + RxConfig);
-       outl((TX_DMA_BURST<<8), ioaddr + TxConfig);
-       set_rx_mode(dev);
-       {                                                       /* Save the unsent Tx packets. */
-               struct sk_buff *saved_skb[NUM_TX_DESC], *skb;
-               int j;
-               for (j = 0; tp->cur_tx - tp->dirty_tx > 0 ; j++, tp->dirty_tx++) {
-                       struct ring_info *rp = &tp->tx_info[tp->dirty_tx % NUM_TX_DESC];
-
-                       saved_skb[j] = rp->skb;
-                       if (rp->mapping != 0) {
-                               pci_unmap_single(tp->pdev, rp->mapping, rp->skb->len, PCI_DMA_TODEVICE);
-                               rp->mapping = 0;
-                       }
-               }
-               tp->dirty_tx = tp->cur_tx = 0;
-
-               for (i = 0; i < j; i++) {
-                       skb = tp->tx_info[i].skb = saved_skb[i];
-                       if ((long)skb->data & 3) {              /* Must use alignment buffer. */
-                               memcpy(tp->tx_buf[i], skb->data, skb->len);
-                               outl(tp->tx_bufs_dma + (tp->tx_buf[i] - tp->tx_bufs),
-                                        ioaddr + TxAddr0 + i*4);
-                       } else {
-                               tp->tx_info[i].mapping =
-                                       pci_map_single(tp->pdev, skb->data, skb->len, PCI_DMA_TODEVICE);
-                               outl(tp->tx_info[i].mapping, ioaddr + TxAddr0 + i*4);
-                       }
-                       /* Note: the chip doesn't have auto-pad! */
-                       outl(tp->tx_flag | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN),
-                                ioaddr + TxStatus0 + i*4);
-               }
-               tp->cur_tx = i;
-               while (i < NUM_TX_DESC) {
-                       tp->tx_info[i].skb = NULL;
-                       tp->tx_info[i].mapping = 0;
-                       i++;
-               }
-               if (tp->cur_tx - tp->dirty_tx < NUM_TX_DESC) {/* Typical path */
-                       netif_wake_queue(dev);
-                       tp->tx_full = 0;
-               } else {
-                       tp->tx_full = 1;
-                       netif_stop_queue(dev);
-               }
-       }
-
-       dev->trans_start = jiffies;
-       tp->stats.tx_errors++;
-       /* Enable all known interrupts by setting the interrupt mask. */
-       outw(PCIErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver
-                | TxErr | TxOK | RxErr | RxOK, ioaddr + IntrMask);
-       return;
-}
-
-
-/* Initialize the Rx and Tx rings, along with various 'dev' bits. */
-static void
-rtl8129_init_ring(struct net_device *dev)
-{
-       struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv;
-       int i;
-
-       tp->tx_full = 0;
-       tp->cur_rx = 0;
-       tp->dirty_tx = tp->cur_tx = 0;
-
-       for (i = 0; i < NUM_TX_DESC; i++) {
-               tp->tx_buf[i] = &tp->tx_bufs[i*TX_BUF_SIZE];
-               tp->tx_info[i].skb = NULL;
-               tp->tx_info[i].mapping = 0;
-       }
-}
-
-static int
-rtl8129_start_xmit(struct sk_buff *skb, struct net_device *dev)
-{
-       struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv;
-       long ioaddr = dev->base_addr;
-       int entry;
-
-       netif_stop_queue(dev);
-
-       /* Calculate the next Tx descriptor entry. */
-       entry = tp->cur_tx % NUM_TX_DESC;
-
-       tp->tx_info[entry].skb = skb;
-       if ((long)skb->data & 3) {                      /* Must use alignment buffer. */
-               tp->tx_info[entry].mapping = 0;
-               memcpy(tp->tx_buf[entry], skb->data, skb->len);
-               outl(tp->tx_bufs_dma + (tp->tx_buf[entry] - tp->tx_bufs),
-                        ioaddr + TxAddr0 + entry*4);
-       } else {
-               tp->tx_info[entry].mapping =
-                       pci_map_single(tp->pdev, skb->data, skb->len, PCI_DMA_TODEVICE);
-               outl(tp->tx_info[entry].mapping, ioaddr + TxAddr0 + entry*4);
-       }
-       /* Note: the chip doesn't have auto-pad! */
-       outl(tp->tx_flag | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN),
-                ioaddr + TxStatus0 + entry*4);
-
-       if (++tp->cur_tx - tp->dirty_tx < NUM_TX_DESC) {        /* Typical path */
-               netif_start_queue(dev);
-       } else {
-               tp->tx_full = 1;
-       }
-
-       dev->trans_start = jiffies;
-       if (rtl8129_debug > 4)
-               printk(KERN_DEBUG"%s: Queued Tx packet at %p size %d to slot %d.\n",
-                          dev->name, skb->data, (int)skb->len, entry);
-
-       return 0;
-}
-
-/* The interrupt handler does all of the Rx thread work and cleans up
-   after the Tx thread. */
-static void rtl8129_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
-{
-       struct net_device *dev = (struct net_device *)dev_instance;
-       struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv;
-       int boguscnt = max_interrupt_work;
-       int status, link_changed = 0;
-       long ioaddr = dev->base_addr;
-
-       do {
-               status = inw(ioaddr + IntrStatus);
-               /* Acknowledge all of the current interrupt sources ASAP, but
-                  an first get an additional status bit from CSCR. */
-               if ((status & RxUnderrun)  &&  inw(ioaddr+CSCR) & CSCR_LinkChangeBit)
-                       link_changed = 1;
-               outw(status, ioaddr + IntrStatus);
-
-               if (rtl8129_debug > 4)
-                       printk(KERN_DEBUG"%s: interrupt  status=%#4.4x new intstat=%#4.4x.\n",
-                                  dev->name, status, inw(ioaddr + IntrStatus));
-
-               if ((status & (PCIErr|PCSTimeout|RxUnderrun|RxOverflow|RxFIFOOver
-                                          |TxErr|TxOK|RxErr|RxOK)) == 0)
-                       break;
-
-               if (status & (RxOK|RxUnderrun|RxOverflow|RxFIFOOver))/* Rx interrupt */
-                       rtl8129_rx(dev);
-
-               if (status & (TxOK | TxErr)) {
-                       unsigned int dirty_tx = tp->dirty_tx;
-
-                       while (tp->cur_tx - dirty_tx > 0) {
-                               int entry = dirty_tx % NUM_TX_DESC;
-                               int txstatus = inl(ioaddr + TxStatus0 + entry*4);
-
-                               if ( ! (txstatus & (TxStatOK | TxUnderrun | TxAborted)))
-                                       break;                  /* It still hasn't been Txed */
-
-                               /* Note: TxCarrierLost is always asserted at 100mbps. */
-                               if (txstatus & (TxOutOfWindow | TxAborted)) {
-                                       /* There was an major error, log it. */
-                                       if (rtl8129_debug > 1)
-                                               printk(KERN_NOTICE"%s: Transmit error, Tx status %8.8x.\n",
-                                                          dev->name, txstatus);
-                                       tp->stats.tx_errors++;
-                                       if (txstatus&TxAborted) {
-                                               tp->stats.tx_aborted_errors++;
-                                               outl((TX_DMA_BURST<<8)|0x03000001, ioaddr + TxConfig);
-                                       }
-                                       if (txstatus&TxCarrierLost) tp->stats.tx_carrier_errors++;
-                                       if (txstatus&TxOutOfWindow) tp->stats.tx_window_errors++;
-#ifdef ETHER_STATS
-                                       if ((txstatus & 0x0f000000) == 0x0f000000)
-                                               tp->stats.collisions16++;
-#endif
-                               } else {
-                                       if (txstatus & TxUnderrun) {
-                                               /* Add 64 to the Tx FIFO threshold. */
-                                               if (tp->tx_flag <  0x00300000)
-                                                       tp->tx_flag += 0x00020000;
-                                               tp->stats.tx_fifo_errors++;
-                                       }
-                                       tp->stats.collisions += (txstatus >> 24) & 15;
-#if LINUX_VERSION_CODE > 0x20119
-                                       tp->stats.tx_bytes += txstatus & 0x7ff;
-#endif
-                                       tp->stats.tx_packets++;
-                               }
-
-                               if (tp->tx_info[entry].mapping != 0) {
-                                       pci_unmap_single(tp->pdev,
-                                                                        tp->tx_info[entry].mapping,
-                                                                        tp->tx_info[entry].skb->len,
-                                                                        PCI_DMA_TODEVICE);
-                                       tp->tx_info[entry].mapping = 0;
-                               }
-
-                               /* Free the original skb. */
-                               dev_kfree_skb_irq(tp->tx_info[entry].skb);
-                               tp->tx_info[entry].skb = NULL;
-                               if (tp->tx_full) {
-                                       /* The ring is no longer full, wake the queue. */
-                                       tp->tx_full = 0;
-                                       netif_wake_queue(dev);
-                               }
-                               dirty_tx++;
-                       }
-
-#ifndef final_version
-                       if (tp->cur_tx - dirty_tx > NUM_TX_DESC) {
-                               printk(KERN_ERR"%s: Out-of-sync dirty pointer, %d vs. %d, full=%d.\n",
-                                          dev->name, dirty_tx, tp->cur_tx, tp->tx_full);
-                               dirty_tx += NUM_TX_DESC;
-                       }
-#endif
-                       tp->dirty_tx = dirty_tx;
-               }
-
-               /* Check uncommon events with one test. */
-               if (status & (PCIErr|PCSTimeout |RxUnderrun|RxOverflow|RxFIFOOver
-                                         |TxErr|RxErr)) {
-                       if (rtl8129_debug > 2)
-                               printk(KERN_NOTICE"%s: Abnormal interrupt, status %8.8x.\n",
-                                          dev->name, status);
-
-                       if (status == 0xffffffff)
-                               break;
-                       /* Update the error count. */
-                       tp->stats.rx_missed_errors += inl(ioaddr + RxMissed);
-                       outl(0, ioaddr + RxMissed);
-
-                       if ((status & RxUnderrun)  &&  link_changed  &&
-                               (rtl_cap_tbl[tp->chip_id] & HAS_LNK_CHNG)) {
-                               /* Really link-change on new chips. */
-                               int lpar = inw(ioaddr + NWayLPAR);
-                               int duplex = (lpar&0x0100)||(lpar & 0x01C0) == 0x0040; 
-                               if (tp->full_duplex != duplex) {
-                                       tp->full_duplex = duplex;
-                                       outb(0xC0, ioaddr + Cfg9346);
-                                       outb(tp->full_duplex ? 0x60 : 0x20, ioaddr + Config1);
-                                       outb(0x00, ioaddr + Cfg9346);
-                               }
-                               status &= ~RxUnderrun;
-                       }
-                       if (status & (RxUnderrun | RxOverflow | RxErr | RxFIFOOver))
-                               tp->stats.rx_errors++;
-
-                       if (status & (PCSTimeout)) tp->stats.rx_length_errors++;
-                       if (status & (RxUnderrun|RxFIFOOver)) tp->stats.rx_fifo_errors++;
-                       if (status & RxOverflow) {
-                               tp->stats.rx_over_errors++;
-                               tp->cur_rx = inw(ioaddr + RxBufAddr) % RX_BUF_LEN;
-                               outw(tp->cur_rx - 16, ioaddr + RxBufPtr);
-                       }
-                       if (status & PCIErr) {
-                               u32 pci_cmd_status;
-                               pcibios_read_config_dword(tp->pci_bus, tp->pci_devfn,
-                                                                                 PCI_COMMAND, &pci_cmd_status);
-
-                               printk(KERN_ERR "%s: PCI Bus error %4.4x.\n",
-                                          dev->name, pci_cmd_status);
-                       }
-               }
-               if (--boguscnt < 0) {
-                       printk(KERN_WARNING"%s: Too much work at interrupt, "
-                                  "IntrStatus=0x%4.4x.\n",
-                                  dev->name, status);
-                       /* Clear all interrupt sources. */
-                       outw(0xffff, ioaddr + IntrStatus);
-                       break;
-               }
-       } while (1);
-
-       if (rtl8129_debug > 3)
-               printk(KERN_DEBUG"%s: exiting interrupt, intr_status=%#4.4x.\n",
-                          dev->name, inl(ioaddr + IntrStatus));
-       return;
-}
-
-/* The data sheet doesn't describe the Rx ring at all, so I'm guessing at the
-   field alignments and semantics. */
-static int rtl8129_rx(struct net_device *dev)
-{
-       struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv;
-       long ioaddr = dev->base_addr;
-       unsigned char *rx_ring = tp->rx_ring;
-       u16 cur_rx = tp->cur_rx;
-
-       if (rtl8129_debug > 4)
-               printk(KERN_DEBUG"%s: In rtl8129_rx(), current %4.4x BufAddr %4.4x,"
-                          " free to %4.4x, Cmd %2.2x.\n",
-                          dev->name, cur_rx, inw(ioaddr + RxBufAddr),
-                          inw(ioaddr + RxBufPtr), inb(ioaddr + ChipCmd));
-
-       while ((inb(ioaddr + ChipCmd) & 1) == 0) {
-               int ring_offset = cur_rx % RX_BUF_LEN;
-               u32 rx_status = le32_to_cpu(*(u32*)(rx_ring + ring_offset));
-               int rx_size = rx_status >> 16;
-
-               if (rtl8129_debug > 4) {
-                       int i;
-                       printk(KERN_DEBUG"%s:  rtl8129_rx() status %4.4x, size %4.4x, cur %4.4x.\n",
-                                  dev->name, rx_status, rx_size, cur_rx);
-                       printk(KERN_DEBUG"%s: Frame contents ", dev->name);
-                       for (i = 0; i < 70; i++)
-                               printk(" %2.2x", le32_to_cpu(rx_ring[ring_offset + i]));
-                       printk(".\n");
-               }
-               if (rx_status & RxTooLong) {
-                       if (rtl8129_debug > 0)
-                               printk(KERN_NOTICE"%s: Oversized Ethernet frame, status %4.4x!\n",
-                                          dev->name, rx_status);
-                       tp->stats.rx_length_errors++;
-               } else if (rx_status &
-                                  (RxBadSymbol|RxRunt|RxTooLong|RxCRCErr|RxBadAlign)) {
-                       if (rtl8129_debug > 1)
-                               printk(KERN_DEBUG"%s: Ethernet frame had errors,"
-                                          " status %4.4x.\n", dev->name, rx_status);
-                       tp->stats.rx_errors++;
-                       if (rx_status & (RxBadSymbol|RxBadAlign))
-                               tp->stats.rx_frame_errors++;
-                       if (rx_status & (RxRunt|RxTooLong)) tp->stats.rx_length_errors++;
-                       if (rx_status & RxCRCErr) tp->stats.rx_crc_errors++;
-                       /* Reset the receiver, based on RealTek recommendation. (Bug?) */
-                       tp->cur_rx = 0;
-                       outb(CmdTxEnb, ioaddr + ChipCmd);
-                       outb(CmdRxEnb | CmdTxEnb, ioaddr + ChipCmd);
-                       outl((RX_FIFO_THRESH << 13) | (RX_BUF_LEN_IDX << 11) |
-                                (RX_DMA_BURST<<8), ioaddr + RxConfig);
-               } else {
-                       /* Malloc up new buffer, compatible with net-2e. */
-                       /* Omit the four octet CRC from the length. */
-                       struct sk_buff *skb;
-                       int pkt_size = rx_size - 4;
-
-                       skb = dev_alloc_skb(pkt_size + 2);
-                       if (skb == NULL) {
-                               printk(KERN_WARNING"%s: Memory squeeze, deferring packet.\n",
-                                          dev->name);
-                               /* We should check that some rx space is free.
-                                  If not, free one and mark stats->rx_dropped++. */
-                               tp->stats.rx_dropped++;
-                               break;
-                       }
-                       skb->dev = dev;
-                       skb_reserve(skb, 2);    /* 16 byte align the IP fields. */
-                       if (ring_offset+rx_size > RX_BUF_LEN) {
-                               int semi_count = RX_BUF_LEN - ring_offset - 4;
-                               memcpy(skb_put(skb, semi_count), &rx_ring[ring_offset + 4],
-                                          semi_count);
-                               memcpy(skb_put(skb, pkt_size-semi_count), rx_ring,
-                                          pkt_size-semi_count);
-                               if (rtl8129_debug > 4) {
-                                       int i;
-                                       printk(KERN_DEBUG"%s:  Frame wrap @%d",
-                                                  dev->name, semi_count);
-                                       for (i = 0; i < 16; i++)
-                                               printk(" %2.2x", le32_to_cpu(rx_ring[i]));
-                                       printk(".\n");
-                                       memset(rx_ring, 0xcc, 16);
-                               }
-                       } else {
-#if 1  /* USE_IP_COPYSUM */
-                               eth_copy_and_sum(skb, &rx_ring[ring_offset + 4],
-                                                                pkt_size, 0);
-                               skb_put(skb, pkt_size);
-#else
-                               memcpy(skb_put(skb, pkt_size), &rx_ring[ring_offset + 4],
-                                          pkt_size);
-#endif
-                       }
-                       skb->protocol = eth_type_trans(skb, dev);
-                       netif_rx(skb);
-#if LINUX_VERSION_CODE > 0x20119
-                       tp->stats.rx_bytes += pkt_size;
-#endif
-                       tp->stats.rx_packets++;
-               }
-
-               cur_rx = (cur_rx + rx_size + 4 + 3) & ~3;
-               outw(cur_rx - 16, ioaddr + RxBufPtr);
-       }
-       if (rtl8129_debug > 4)
-               printk(KERN_DEBUG"%s: Done rtl8129_rx(), current %4.4x BufAddr %4.4x,"
-                          " free to %4.4x, Cmd %2.2x.\n",
-                          dev->name, cur_rx, inw(ioaddr + RxBufAddr),
-                          inw(ioaddr + RxBufPtr), inb(ioaddr + ChipCmd));
-       tp->cur_rx = cur_rx;
-       return 0;
-}
-
-static int
-rtl8129_close(struct net_device *dev)
-{
-       long ioaddr = dev->base_addr;
-       struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv;
-       int i;
-
-       netif_stop_queue(dev);
-
-       del_timer_sync(&tp->timer);
-
-       if (rtl8129_debug > 1)
-               printk(KERN_DEBUG"%s: Shutting down ethercard, status was 0x%4.4x.\n",
-                          dev->name, inw(ioaddr + IntrStatus));
-
-       /* Disable interrupts by clearing the interrupt mask. */
-       outw(0x0000, ioaddr + IntrMask);
-
-       /* Stop the chip's Tx and Rx DMA processes. */
-       outb(0x00, ioaddr + ChipCmd);
-
-       /* Update the error counts. */
-       tp->stats.rx_missed_errors += inl(ioaddr + RxMissed);
-       outl(0, ioaddr + RxMissed);
-
-       free_irq(dev->irq, dev);
-
-       for (i = 0; i < NUM_TX_DESC; i++) {
-               struct sk_buff *skb = tp->tx_info[i].skb;
-               dma_addr_t mapping = tp->tx_info[i].mapping;
-
-               if (skb) {
-                       if (mapping)
-                               pci_unmap_single(tp->pdev, mapping, skb->len, PCI_DMA_TODEVICE);
-                       dev_kfree_skb(skb);
-               }
-               tp->tx_info[i].skb = NULL;
-               tp->tx_info[i].mapping = 0;
-       }
-       pci_free_consistent(tp->pdev, RX_BUF_LEN + 16,
-                                               tp->rx_ring, tp->rx_ring_dma);
-       pci_free_consistent(tp->pdev, TX_BUF_SIZE * NUM_TX_DESC,
-                                               tp->tx_bufs, tp->tx_bufs_dma);
-       tp->rx_ring = NULL;
-       tp->tx_bufs = NULL;
-
-       /* Green! Put the chip in low-power mode. */
-       outb(0xC0, ioaddr + Cfg9346);
-       outb(0x03, ioaddr + Config1);
-       outb('H', ioaddr + HltClk);             /* 'R' would leave the clock running. */
-
-       MOD_DEC_USE_COUNT;
-
-       return 0;
-}
-
-static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
-{
-       struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv;
-       u16 *data = (u16 *)&rq->ifr_data;
-
-       switch(cmd) {
-       case SIOCDEVPRIVATE:            /* Get the address of the PHY in use. */
-               data[0] = tp->phys[0] & 0x3f;
-               /* Fall Through */
-       case SIOCDEVPRIVATE+1:          /* Read the specified MII register. */
-               data[3] = mdio_read(dev, data[0], data[1] & 0x1f);
-               return 0;
-       case SIOCDEVPRIVATE+2:          /* Write the specified MII register */
-               if (!capable(CAP_NET_ADMIN))
-                       return -EPERM;
-               mdio_write(dev, data[0], data[1] & 0x1f, data[2]);
-               return 0;
-       default:
-               return -EOPNOTSUPP;
-       }
-}
-
-static struct net_device_stats *
-rtl8129_get_stats(struct net_device *dev)
-{
-       struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv;
-       long ioaddr = dev->base_addr;
-
-       if (netif_running(dev)) {
-               tp->stats.rx_missed_errors += inl(ioaddr + RxMissed);
-               outl(0, ioaddr + RxMissed);
-       }
-
-       return &tp->stats;
-}
-
-/* Set or clear the multicast filter for this adaptor.
-   This routine is not state sensitive and need not be SMP locked. */
-
-static unsigned const ethernet_polynomial = 0x04c11db7U;
-static inline u32 ether_crc(int length, unsigned char *data)
-{
-    int crc = -1;
-
-    while (--length >= 0) {
-               unsigned char current_octet = *data++;
-               int bit;
-               for (bit = 0; bit < 8; bit++, current_octet >>= 1)
-                       crc = (crc << 1) ^
-                               ((crc < 0) ^ (current_octet & 1) ? ethernet_polynomial : 0);
-    }
-    return crc;
-}
-
-/* Bits in RxConfig. */
-enum rx_mode_bits {
-       AcceptErr=0x20, AcceptRunt=0x10, AcceptBroadcast=0x08,
-       AcceptMulticast=0x04, AcceptMyPhys=0x02, AcceptAllPhys=0x01,
-};
-
-static void set_rx_mode(struct net_device *dev)
-{
-       long ioaddr = dev->base_addr;
-       u32 mc_filter[2];                /* Multicast hash filter */
-       int i, rx_mode;
-
-       if (rtl8129_debug > 3)
-               printk(KERN_DEBUG"%s:   set_rx_mode(%4.4x) done -- Rx config %8.8x.\n",
-                          dev->name, dev->flags, inl(ioaddr + RxConfig));
-
-       /* Note: do not reorder, GCC is clever about common statements. */
-       if (dev->flags & IFF_PROMISC) {
-               /* Unconditionally log net taps. */
-               printk(KERN_NOTICE"%s: Promiscuous mode enabled.\n", dev->name);
-               rx_mode = AcceptBroadcast|AcceptMulticast|AcceptMyPhys|AcceptAllPhys;
-               mc_filter[1] = mc_filter[0] = 0xffffffff;
-       } else if ((dev->mc_count > multicast_filter_limit)
-                          ||  (dev->flags & IFF_ALLMULTI)) {
-               /* Too many to filter perfectly -- accept all multicasts. */
-               rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
-               mc_filter[1] = mc_filter[0] = 0xffffffff;
-       } else {
-               struct dev_mc_list *mclist;
-               rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
-               mc_filter[1] = mc_filter[0] = 0;
-               for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
-                        i++, mclist = mclist->next)
-                       set_bit(ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26, mc_filter);
-       }
-       /* We can safely update without stopping the chip. */
-       outb(rx_mode, ioaddr + RxConfig);
-       outl(mc_filter[0], ioaddr + MAR0 + 0);
-       outl(mc_filter[1], ioaddr + MAR0 + 4);
-       return;
-}
-\f
-
-static void __exit rtl8129_cleanup (void)
-{
-       struct net_device *next_dev;
-
-       /* No need to check MOD_IN_USE, as sys_delete_module() checks. */
-       while (root_rtl8129_dev) {
-               struct rtl8129_private *tp =
-                       (struct rtl8129_private *)root_rtl8129_dev->priv;
-               next_dev = tp->next_module;
-               unregister_netdev(root_rtl8129_dev);
-               release_region(root_rtl8129_dev->base_addr,
-                                          pci_tbl[tp->chip_id].io_size);
-               kfree(tp);
-               kfree(root_rtl8129_dev);
-               root_rtl8129_dev = next_dev;
-       }
-}
-
-module_init(rtl8129_probe);
-module_exit(rtl8129_cleanup);
-
-/*
- * Local variables:
- *  compile-command: "gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c rtl8129.c `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`"
- *  c-indent-level: 4
- *  c-basic-offset: 4
- *  tab-width: 4
- * End:
- */
index f96666e62a53265c3e7b473ced55b6b813f72dba..282813b08b821d6120ead01359ef24137db1bfc3 100644 (file)
@@ -18,6 +18,7 @@
    preliminary Rev. 1.0 Jan. 18, 1998
    http://www.sis.com.tw/support/databook.htm
 
+   Rev 1.07.09 Feb.  9 2001 Dave Jones <davej@suse.de> PCI enable cleanup
    Rev 1.07.08 Jan.  8 2001 Lei-Chun Chang added RTL8201 PHY support
    Rev 1.07.07 Nov. 29 2000 Lei-Chun Chang added kernel-doc extractable documentation and 630 workaround fix
    Rev 1.07.06 Nov.  7 2000 Jeff Garzik <jgarzik@mandrakesoft.com> some bug fix and cleaning
@@ -60,7 +61,7 @@
 #include "sis900.h"
 
 static const char *version =
-"sis900.c: v1.07.08  1/8/2001\n";
+"sis900.c: v1.07.09  2/9/2001\n";
 
 static int max_interrupt_work = 20;
 static int multicast_filter_limit = 128;
@@ -252,10 +253,10 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev, struct net_d
 static int __devinit sis900_probe (struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
 {
        struct sis900_private *sis_priv;
-       long ioaddr = pci_resource_start(pci_dev, 0);
+       long ioaddr;
        struct net_device *net_dev;
-       int irq = pci_dev->irq;
-       int i, ret = 0;
+       int irq;
+       int i, ret;
        u8 revision;
        char *card_name = card_names[pci_id->driver_data];
 
@@ -266,10 +267,14 @@ static int __devinit sis900_probe (struct pci_dev *pci_dev, const struct pci_dev
        }
 
        /* setup various bits in PCI command register */
-       if (pci_enable_device (pci_dev))
-               return -ENODEV;
+       ret = pci_enable_device (pci_dev);
+       if (ret) return ret;
+
        pci_set_master(pci_dev);
 
+       irq = pci_dev->irq;
+       ioaddr = pci_resource_start(pci_dev, 0);
+
        net_dev = init_etherdev(NULL, sizeof(struct sis900_private));
        if (!net_dev)
                return -ENOMEM;
@@ -1469,14 +1474,14 @@ static void sis900_finish_xmit (struct net_device *net_dev)
                tx_status = sis_priv->tx_ring[entry].cmdsts;
 
                if (tx_status & OWN) {
-                       /* The packet is not transmited yet (owned by hardware) !
+                       /* The packet is not transmitted yet (owned by hardware) !
                           Note: the interrupt is generated only when Tx Machine
                           is idle, so this is an almost impossible case */
                        break;
                }
 
                if (tx_status & (ABORT | UNDERRUN | OWCOLL)) {
-                       /* packet unsuccessfully transmited */
+                       /* packet unsuccessfully transmitted */
                        if (sis900_debug > 3)
                                printk(KERN_INFO "%s: Transmit "
                                       "error, Tx status %8.8x.\n",
@@ -1491,7 +1496,7 @@ static void sis900_finish_xmit (struct net_device *net_dev)
                        if (tx_status & OWCOLL)
                                sis_priv->stats.tx_window_errors++;
                } else {
-                       /* packet successfully transmited */
+                       /* packet successfully transmitted */
                        sis_priv->stats.collisions += (tx_status & COLCNT) >> 16;
                        sis_priv->stats.tx_bytes += tx_status & DSIZE;
                        sis_priv->stats.tx_packets++;
index c3b7a456750b90eea8759806df151b72e0ba3f16..f8a95d4c67234fa76c6f36044e3c7ce66fed7e8c 100644 (file)
@@ -314,6 +314,7 @@ enum desc_status_bits {
 #define PRIV_ALIGN     15      /* Required alignment mask */
 /* Use  __attribute__((aligned (L1_CACHE_BYTES)))  to maintain alignment
    within the structure. */
+#define MII_CNT                4
 struct netdev_private {
        /* Descriptor rings first for alignment. */
        struct netdev_desc rx_ring[RX_RING_SIZE];
@@ -346,7 +347,7 @@ struct netdev_private {
        /* MII transceiver section. */
        int mii_cnt;                                            /* MII device addresses. */
        u16 advertising;                                        /* NWay media advertisement */
-       unsigned char phys[2];                          /* MII device addresses. */
+       unsigned char phys[MII_CNT];            /* MII device addresses, only first one used. */
 };
 
 /* The station address location in the EEPROM. */
@@ -379,7 +380,7 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
        struct netdev_private *np;
        static int card_idx;
        int chip_idx = ent->driver_data;
-       int irq = pdev->irq;
+       int irq;
        int i, option = card_idx < MAX_UNITS ? options[card_idx] : 0;
        long ioaddr;
 
@@ -387,19 +388,20 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
                return -EIO;
        pci_set_master(pdev);
 
+       irq = pdev->irq;
+
        dev = init_etherdev(NULL, sizeof(*np));
        if (!dev)
                return -ENOMEM;
        SET_MODULE_OWNER(dev);
 
+       if (pci_request_regions(pdev, dev->name))
+               goto err_out_netdev;
+
 #ifdef USE_IO_OPS
        ioaddr = pci_resource_start(pdev, 0);
-       if (!request_region(ioaddr, pci_id_tbl[chip_idx].io_size, dev->name))
-               goto err_out_netdev;
 #else
        ioaddr = pci_resource_start(pdev, 1);
-       if (!request_mem_region(ioaddr, pci_id_tbl[chip_idx].io_size, dev->name))
-               goto err_out_netdev;
        ioaddr = (long) ioremap (ioaddr, pci_id_tbl[chip_idx].io_size);
        if (!ioaddr)
                goto err_out_iomem;
@@ -456,7 +458,7 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
        if (1) {
                int phy, phy_idx = 0;
                np->phys[0] = 1;                /* Default setting */
-               for (phy = 0; phy < 32 && phy_idx < 4; phy++) {
+               for (phy = 0; phy < 32 && phy_idx < MII_CNT; phy++) {
                        int mii_status = mdio_read(dev, phy, 1);
                        if (mii_status != 0xffff  &&  mii_status != 0x0000) {
                                np->phys[phy_idx++] = phy;
@@ -485,8 +487,7 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
 
 #ifndef USE_IO_OPS
 err_out_iomem:
-       release_mem_region(pci_resource_start(pdev, 1),
-                          pci_id_tbl[chip_idx].io_size);
+       pci_release_regions(pdev);
 #endif
 err_out_netdev:
        unregister_netdev (dev);
@@ -735,7 +736,9 @@ static void tx_timeout(struct net_device *dev)
 
        dev->trans_start = jiffies;
        np->stats.tx_errors++;
-       return;
+
+       if (!np->tx_full)
+               netif_wake_queue(dev);
 }
 
 
@@ -1233,11 +1236,8 @@ static void __devexit sundance_remove1 (struct pci_dev *pdev)
        while (dev) {
                struct netdev_private *np = (void *)(dev->priv);
                unregister_netdev(dev);
-#ifdef USE_IO_OPS
-               release_region(dev->base_addr, pci_id_tbl[np->chip_id].io_size);
-#else
-               release_mem_region(pci_resource_start(pdev, 1),
-                                  pci_id_tbl[np->chip_id].io_size);
+               pci_release_regions(pdev);
+#ifndef USE_IO_OPS
                iounmap((char *)(dev->base_addr));
 #endif
                kfree(dev);
index bb5b70f019d5f4c81e175256ece7bceb4e904b06..345c4d200378a36d729f8ba825fa93b0a71e19e1 100644 (file)
@@ -1,3 +1,54 @@
+2001-02-20  Jeff Garzik  <jgarzik@mandrakesoft.com>
+
+       * media.c (tulip_select_media): No need to initialize
+       new_csr6, all cases initialize it properly.
+
+2001-02-18  Manfred Spraul  <manfred@colorfullife.com>
+
+       * interrupt.c (tulip_refill_rx): Make public.
+       If PNIC chip stops due to lack of Rx buffers, restart it.
+       (tulip_interrupt): PNIC doesn't have a h/w timer, emulate
+       with software timers.
+       * pnic.c (pnic_check_duplex): New function, PNIC-specific
+       version of tulip_check_duplex.
+       (pnic_lnk_change): Call pnic_check_duplex.  If we use an
+       external MII, then we mustn't use the internal negotiation.
+       (pnic_timer): Support Rx refilling on work overflow in
+       interrupt handler, as PNIC doesn't support a h/w timer.
+       * tulip_core.c (tulip_tbl[]): Modify default csr6
+
+2001-02-11  Jeff Garzik  <jgarzik@mandrakesoft.com>
+
+       * tulip_core.c (tulip_init_one): Call pci_enable_device
+       to ensure wakeup/resource assignment before checking those
+       values.
+       (tulip_init_one): Replace PCI ids with constants from pci_id.h.
+       (tulip_suspend, tulip_resume, tulip_remove_one): Call
+       pci_power_on/off (commented out for now).
+
+2001-02-10  Jeff Garzik  <jgarzik@mandrakesoft.com>
+
+       * tulip.h: Add CFDD_xxx bits for Tulip power management
+       * tulip_core.c (tulip_set_power_state): New function,
+       manipulating Tulip chip power state where supported.
+       (tulip_up, tulip_down, tulip_init_one): Use it.
+
+2001-02-10  Jeff Garzik  <jgarzik@mandrakesoft.com>
+
+       * tulip_core.c (tulip_tx_timeout): Call netif_wake_queue
+       to ensure the next Tx is always sent to us.
+
+2001-01-27  Jeff Garzik  <jgarzik@mandrakesoft.com>
+
+       * tulip_core.c (tulip_remove_one): Fix mem leak by freeing
+       tp->media_tbl.  Add check for !dev, reformat code appropriately.
+
+2001-01-27  Jeff Garzik  <jgarzik@mandrakesoft.com>
+
+       * tulip_tbl[]: Comment all entries to make order and chip_id
+       relationship more clear.
+       * tulip_pci_tbl[]: Add new Accton PCI id (COMET chipset).
+
 2001-01-16  Jeff Garzik  <jgarzik@mandrakesoft.com>
 
        * tulip_core.c: static vars no longer explicitly
index 6cb0d7ab7808bd8cc465ce36d3c14cd4c7fa5c55..61ec933378a1e188fde4a76c93375bca465ba1a0 100644 (file)
@@ -23,7 +23,7 @@ unsigned int tulip_max_interrupt_work;
 
 
 
-static int tulip_refill_rx(struct net_device *dev)
+int tulip_refill_rx(struct net_device *dev)
 {
        struct tulip_private *tp = (struct tulip_private *)dev->priv;
        int entry;
@@ -50,6 +50,14 @@ static int tulip_refill_rx(struct net_device *dev)
                }
                tp->rx_ring[entry].status = cpu_to_le32(DescOwned);
        }
+       if(tp->chip_id == LC82C168) {
+               if(((inl(dev->base_addr + CSR5)>>17)&0x07) == 4) {
+                       /* Rx stopped due to out of buffers,
+                        * restart it
+                        */
+                       outl(0x01, dev->base_addr + CSR2);
+               }
+       }
        return refilled;
 }
 
@@ -332,7 +340,11 @@ void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
                      /* Josip Loncaric at ICASE did extensive experimentation
                        to develop a good interrupt mitigation setting.*/
                                 outl(0x8b240000, ioaddr + CSR11);
-                        } else {
+                        } else if (tp->chip_id == LC82C168) {
+                               /* the LC82C168 doesn't have a hw timer.*/
+                               outl(0x00, ioaddr + CSR7);
+                               mod_timer(&tp->timer, RUN_AT(HZ/50));
+                       } else {
                           /* Mask all interrupting sources, set timer to
                                re-enable. */
                                 outl(((~csr5) & 0x0001ebef) | AbnormalIntr | TimerInt, ioaddr + CSR7);
@@ -355,14 +367,19 @@ void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
        if (tp->rx_buffers[entry].skb == NULL) {
                if (tulip_debug > 1)
                        printk(KERN_WARNING "%s: in rx suspend mode: (%lu) (tp->cur_rx = %u, ttimer = %d, rx = %d) go/stay in suspend mode\n", dev->name, tp->nir, tp->cur_rx, tp->ttimer, rx);
-               if (tp->ttimer == 0 || (inl(ioaddr + CSR11) & 0xffff) == 0) {
-                       if (tulip_debug > 1)
-                               printk(KERN_WARNING "%s: in rx suspend mode: (%lu) set timer\n", dev->name, tp->nir);
-                       outl(tulip_tbl[tp->chip_id].valid_intrs | TimerInt,
-                               ioaddr + CSR7);
-                       outl(TimerInt, ioaddr + CSR5);
-                       outl(12, ioaddr + CSR11);
-                       tp->ttimer = 1;
+               if (tp->chip_id == LC82C168) {
+                       outl(0x00, ioaddr + CSR7);
+                       mod_timer(&tp->timer, RUN_AT(HZ/50));
+               } else {
+                       if (tp->ttimer == 0 || (inl(ioaddr + CSR11) & 0xffff) == 0) {
+                               if (tulip_debug > 1)
+                                       printk(KERN_WARNING "%s: in rx suspend mode: (%lu) set timer\n", dev->name, tp->nir);
+                               outl(tulip_tbl[tp->chip_id].valid_intrs | TimerInt,
+                                       ioaddr + CSR7);
+                               outl(TimerInt, ioaddr + CSR5);
+                               outl(12, ioaddr + CSR11);
+                               tp->ttimer = 1;
+                       }
                }
        }
 
index 18e0de2c1b45635d11ef5abc8e42058a88ddcc03..d61a2a15fd8a810e91f2ee88f39ff9de7ce6cdb5 100644 (file)
@@ -148,7 +148,7 @@ void tulip_select_media(struct net_device *dev, int startup)
        long ioaddr = dev->base_addr;
        struct tulip_private *tp = (struct tulip_private *)dev->priv;
        struct mediatable *mtable = tp->mtable;
-       u32 new_csr6=0;
+       u32 new_csr6;
        int i;
 
        if (mtable) {
index d5de39be55346574020343b8c7dc26811054fc65..c21e3991c9b254cb30f607a3916fe81149caf6b0 100644 (file)
@@ -50,6 +50,61 @@ void pnic_do_nway(struct net_device *dev)
        }
 }
 
+/* Modified version of tulip_check_duplex:
+ * Always update the 100mbps bit, even if the
+ * full duplex bit didn't change.
+ *     Manfred Spraul <manfred@colorfullife.com>
+ */
+int pnic_check_duplex(struct net_device *dev)
+{
+       struct tulip_private *tp = (struct tulip_private *)dev->priv;
+       int mii_reg1, mii_reg5, negotiated, duplex;
+       int new_csr6;
+
+       mii_reg1 = tulip_mdio_read(dev, tp->phys[0], 1);
+       mii_reg5 = tulip_mdio_read(dev, tp->phys[0], 5);
+       if (tulip_debug > 1)
+               printk(KERN_INFO "%s: MII status %4.4x, Link partner report "
+                          "%4.4x.\n", dev->name, mii_reg1, mii_reg5);
+       if (mii_reg1 == 0xffff)
+               return -2;
+       if ((mii_reg1 & 0x0004) == 0) {
+               int new_reg1 = tulip_mdio_read(dev, tp->phys[0], 1);
+               if ((new_reg1 & 0x0004) == 0) {
+                       if (tulip_debug  > 1)
+                               printk(KERN_INFO "%s: No link beat on the MII interface,"
+                                          " status %4.4x.\n", dev->name, new_reg1);
+                       return -1;
+               }
+       }
+       negotiated = mii_reg5 & tp->advertising[0];
+       /* 100baseTx-FD  or  10T-FD, but not 100-HD */
+       duplex = ((negotiated & 0x0300) == 0x0100
+                         || (negotiated & 0x00C0) == 0x0040) ||
+               tp->full_duplex_lock;
+
+       new_csr6 = tp->csr6;
+       if (negotiated & 0x0380)        /* 100mbps. */
+               new_csr6 &= ~0x00400000;
+        else
+               new_csr6 |= 0x00400000;
+       if (duplex)
+               new_csr6 |= 0x0200;
+        else   
+               new_csr6 &= ~0x0200;
+       if (new_csr6 != tp->csr6) {
+               tp->full_duplex = duplex;
+               tp->csr6 = new_csr6;
+               if (tulip_debug > 0)
+                       printk(KERN_INFO "%s: Setting %s-duplex based on MII"
+                                  "#%d link partner capability of %4.4x.\n",
+                                  dev->name, tp->full_duplex ? "full" : "half",
+                                  tp->phys[0], mii_reg5);
+               tulip_restart_rxtx(tp, tp->csr6);
+               return 1;
+       }
+       return 0;
+}
 
 void pnic_lnk_change(struct net_device *dev, int csr5)
 {
@@ -62,6 +117,11 @@ void pnic_lnk_change(struct net_device *dev, int csr5)
                           dev->name, phy_reg, csr5);
        if (inl(ioaddr + CSR5) & TPLnkFail) {
                outl((inl(ioaddr + CSR7) & ~TPLnkFail) | TPLnkPass, ioaddr + CSR7);
+               /* If we use an external MII, then we mustn't use the 
+                * internal negotiation.
+                */
+               if (tulip_media_cap[dev->if_port] & MediaIsMII)
+                       return;
                if (! tp->nwayset  ||  jiffies - dev->trans_start > 1*HZ) {
                        tp->csr6 = 0x00420000 | (tp->csr6 & 0x0000fdff);
                        tulip_outl_csr(tp, tp->csr6, CSR6);
@@ -70,11 +130,18 @@ void pnic_lnk_change(struct net_device *dev, int csr5)
                        dev->trans_start = jiffies;
                }
        } else if (inl(ioaddr + CSR5) & TPLnkPass) {
-               pnic_do_nway(dev);
+               if (tulip_media_cap[dev->if_port] & MediaIsMII) {
+                       spin_lock(&tp->lock);
+                       pnic_check_duplex(dev);
+                       spin_unlock(&tp->lock);
+               } else {
+                       pnic_do_nway(dev);
+               }
                outl((inl(ioaddr + CSR7) & ~TPLnkPass) | TPLnkFail, ioaddr + CSR7);
        }
 }
 
+int tulip_refill_rx(struct net_device *dev);
 
 void pnic_timer(unsigned long data)
 {
@@ -82,10 +149,21 @@ void pnic_timer(unsigned long data)
        struct tulip_private *tp = (struct tulip_private *)dev->priv;
        long ioaddr = dev->base_addr;
        int next_tick = 60*HZ;
+       
+       if(!inl(ioaddr + CSR7)) {
+               /* the timer was called due to a work overflow
+                * in the interrupt handler. Skip the connection
+                * checks, the nic is definitively speaking with
+                * his link partner.
+                */
+               goto too_good_connection;
+       }
 
        if (tulip_media_cap[dev->if_port] & MediaIsMII) {
-               if (tulip_check_duplex(dev) > 0)
+               spin_lock_irq(&tp->lock);
+               if (pnic_check_duplex(dev) > 0)
                        next_tick = 3*HZ;
+               spin_unlock_irq(&tp->lock);
        } else {
                int csr12 = inl(ioaddr + CSR12);
                int new_csr6 = tp->csr6 & ~0x40C40200;
@@ -137,7 +215,14 @@ void pnic_timer(unsigned long data)
                        }
                }
        }
-       tp->timer.expires = RUN_AT(next_tick);
-       add_timer(&tp->timer);
+too_good_connection:
+       mod_timer(&tp->timer, RUN_AT(next_tick));
+       if(!inl(ioaddr + CSR7)) {
+               if (tulip_debug > 1)
+                       printk(KERN_INFO "%s: sw timer wakeup.\n", dev->name);
+               disable_irq(dev->irq);
+               tulip_refill_rx(dev);
+               enable_irq(dev->irq);
+               outl(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR7);
+       }
 }
-
index 1f2343820e9488cfbeed1e577a0d1164b652511c..3065ebe97174bacc575a25942cd72801963144aa 100644 (file)
@@ -107,7 +107,14 @@ enum tulip_offsets {
        CSR12 = 0x60,
        CSR13 = 0x68,
        CSR14 = 0x70,
-       CSR15 = 0x78
+       CSR15 = 0x78,
+};
+
+/* register offset and bits for CFDD PCI config reg */
+enum pci_cfg_driver_reg {      
+       CFDD = 0x40,
+       CFDD_Sleep = (1 << 31),
+       CFDD_Snooze = (1 << 30),
 };
 
 
index 06bdaf43ce2fa19df9442b0fa2d5257aa9daafff..25d60845f06835505b51fb2bf1f01031d89ab27f 100644 (file)
@@ -28,7 +28,7 @@
 #include <asm/unaligned.h>
 
 static char version[] __devinitdata =
-       "Linux Tulip driver version 0.9.13a (January 20, 2001)\n";
+       "Linux Tulip driver version 0.9.14 (February 20, 2001)\n";
 
 
 /* A few user-configurable values. */
@@ -120,37 +120,63 @@ int tulip_debug = 1;
  */
 
 struct tulip_chip_table tulip_tbl[] = {
+  /* DC21040 */
   { "Digital DC21040 Tulip", 128, 0x0001ebef, 0, tulip_timer },
+
+  /* DC21041 */
   { "Digital DC21041 Tulip", 128, 0x0001ebef,
        HAS_MEDIA_TABLE | HAS_NWAY, tulip_timer },
+
+  /* DC21140 */
   { "Digital DS21140 Tulip", 128, 0x0001ebef,
        HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM, tulip_timer },
+
+  /* DC21142, DC21143 */
   { "Digital DS21143 Tulip", 128, 0x0801fbff,
        HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII | HAS_ACPI | HAS_NWAY
        | HAS_INTR_MITIGATION, t21142_timer },
-  { "Lite-On 82c168 PNIC", 256, 0x0001ebef,
+
+  /* LC82C168 */
+  { "Lite-On 82c168 PNIC", 256, 0x0001fbef,
        HAS_MII | HAS_PNICNWAY, pnic_timer },
+
+  /* MX98713 */
   { "Macronix 98713 PMAC", 128, 0x0001ebef,
        HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM, mxic_timer },
+
+  /* MX98715 */
   { "Macronix 98715 PMAC", 256, 0x0001ebef,
        HAS_MEDIA_TABLE, mxic_timer },
+
+  /* MX98725 */
   { "Macronix 98725 PMAC", 256, 0x0001ebef,
        HAS_MEDIA_TABLE, mxic_timer },
+
+  /* AX88140 */
   { "ASIX AX88140", 128, 0x0001fbff,
        HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | MC_HASH_ONLY | IS_ASIX, tulip_timer },
+
+  /* PNIC2 */
   { "Lite-On PNIC-II", 256, 0x0801fbff,
        HAS_MII | HAS_NWAY | HAS_8023X, t21142_timer },
+
+  /* COMET */
   { "ADMtek Comet", 256, 0x0001abef,
        MC_HASH_ONLY, comet_timer },
+
+  /* COMPEX9881 */
   { "Compex 9881 PMAC", 128, 0x0001ebef,
        HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM, mxic_timer },
+
+  /* I21145 */
   { "Intel DS21145 Tulip", 128, 0x0801fbff,
        HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII | HAS_ACPI | HAS_NWAY,
        t21142_timer },
+
+  /* DM910X */
   { "Davicom DM9102/DM9102A", 128, 0x0001ebef,
        HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_ACPI,
        tulip_timer },
-  {0},
 };
 
 
@@ -176,6 +202,7 @@ static struct pci_device_id tulip_pci_tbl[] __devinitdata = {
        { 0x8086, 0x0039, PCI_ANY_ID, PCI_ANY_ID, 0, 0, I21145 },
        { 0x1282, 0x9100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X },
        { 0x1282, 0x9102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X },
+       { 0x1113, 0x1216, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
        { 0x1113, 0x1217, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MX98715 },
        {0, }
 };
@@ -212,6 +239,24 @@ static void set_rx_mode(struct net_device *dev);
 
 
 
+static void tulip_set_power_state (struct tulip_private *tp,
+                                  int sleep, int snooze)
+{
+       if (tp->flags & HAS_ACPI) {
+               u32 tmp, newtmp;
+               pci_read_config_dword (tp->pdev, CFDD, &tmp);
+               newtmp = tmp & ~(CFDD_Sleep | CFDD_Snooze);
+               if (sleep)
+                       newtmp |= CFDD_Sleep;
+               else if (snooze)
+                       newtmp |= CFDD_Snooze;
+               if (tmp != newtmp)
+                       pci_write_config_dword (tp->pdev, CFDD, newtmp);
+       }
+       
+}
+
+
 static void tulip_up(struct net_device *dev)
 {
        struct tulip_private *tp = (struct tulip_private *)dev->priv;
@@ -222,8 +267,7 @@ static void tulip_up(struct net_device *dev)
        DPRINTK("ENTER\n");
 
        /* Wake the chip from sleep/snooze mode. */
-       if (tp->flags & HAS_ACPI)
-               pci_write_config_dword(tp->pdev, 0x40, 0);
+       tulip_set_power_state (tp, 0, 0);
 
        /* On some chip revs we must set the MII/SYM port before the reset!? */
        if (tp->mii_cnt  ||  (tp->mtable  &&  tp->mtable->has_mii))
@@ -532,8 +576,9 @@ static void tulip_tx_timeout(struct net_device *dev)
        tp->stats.tx_errors++;
 
 out:
-       dev->trans_start = jiffies;
        spin_unlock_irqrestore (&tp->lock, flags);
+       dev->trans_start = jiffies;
+       netif_wake_queue (dev);
 }
 
 
@@ -670,8 +715,7 @@ static void tulip_down (struct net_device *dev)
        dev->if_port = tp->saved_if_port;
 
        /* Leave the driver in snooze, not sleep, mode. */
-       if (tp->flags & HAS_ACPI)
-               pci_write_config_dword (tp->pdev, 0x40, 0x40000000);
+       tulip_set_power_state (tp, 0, 1);
 }
 
 
@@ -1049,7 +1093,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
         *      different driver (lmc driver)
         */
         
-        if( pdev->subsystem_vendor == 0x1376 ){
+        if (pdev->subsystem_vendor == PCI_VENDOR_ID_LMC) {
                printk (KERN_ERR PFX "skipping LMC card.\n");
                return -ENODEV;
        }
@@ -1080,16 +1124,24 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
           thankfully its an old 486 chipset.
        */
        
-       if (pci_find_device(PCI_VENDOR_ID_INTEL, 0x0483, NULL))
+       if (pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82424, NULL))
                csr0 = 0x00A04800;
        /* The dreaded SiS496 486 chipset. Same workaround as above. */
-       if (pci_find_device(PCI_VENDOR_ID_SI, 0x0496, NULL))
+       if (pci_find_device(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496, NULL))
                csr0 = 0x00A04800;
                
        /*
         *      And back to business
         */
  
+       i = pci_enable_device(pdev);
+       if (i) {
+               printk (KERN_ERR PFX
+                       "Cannot enable tulip board #%d, aborting\n",
+                       board_idx);
+               return i;
+       }
+
        ioaddr = pci_resource_start (pdev, 0);
        irq = pdev->irq;
 
@@ -1126,12 +1178,6 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
                goto err_out_free_pio_res;
        }
 
-       if (pci_enable_device(pdev)) {
-               printk (KERN_ERR PFX "%s: Cannot enable PCI device, aborting\n",
-                       dev->name);
-               goto err_out_free_mmio_res;
-       }
-
        pci_set_master(pdev);
 
        pci_read_config_byte (pdev, PCI_REVISION_ID, &chip_rev);
@@ -1443,8 +1489,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
        }
 
        /* put the chip in snooze mode until opened */
-       if (tulip_tbl[chip_idx].flags & HAS_ACPI)
-               pci_write_config_dword(pdev, 0x40, 0x40000000);
+       tulip_set_power_state (tp, 0, 1);
 
        return 0;
 
@@ -1468,8 +1513,8 @@ static void tulip_suspend (struct pci_dev *pdev)
        if (dev && netif_device_present (dev)) {
                netif_device_detach (dev);
                tulip_down (dev);
+               /* pci_power_off(pdev, -1); */
        }
-//     pci_set_power_state(pdev, 3);
 }
 
 
@@ -1477,8 +1522,11 @@ static void tulip_resume(struct pci_dev *pdev)
 {
        struct net_device *dev = pci_get_drvdata(pdev);
 
-       pci_enable_device(pdev);
+#if 1
+       pci_enable_device (pdev);
+#endif
        if (dev && !netif_device_present (dev)) {
+               /* pci_power_on(pdev); */
                tulip_up (dev);
                netif_device_attach (dev);
        }
@@ -1487,24 +1535,29 @@ static void tulip_resume(struct pci_dev *pdev)
 
 static void __devexit tulip_remove_one (struct pci_dev *pdev)
 {
-       struct net_device *dev = pci_get_drvdata(pdev);
+       struct net_device *dev = pci_get_drvdata (pdev);
+       struct tulip_private *tp;
 
-       if (dev) {
-               struct tulip_private *tp = (struct tulip_private *)dev->priv;
-               pci_free_consistent(pdev,
-                                   sizeof(struct tulip_rx_desc) * RX_RING_SIZE +
-                                   sizeof(struct tulip_tx_desc) * TX_RING_SIZE,
-                                   tp->rx_ring,
-                                   tp->rx_ring_dma);
-               unregister_netdev(dev);
-               release_mem_region (pci_resource_start (pdev, 1),
-                                   pci_resource_len (pdev, 1));
-               release_region (pci_resource_start (pdev, 0),
-                               pci_resource_len (pdev, 0));
-               kfree(dev);
-
-               pci_set_drvdata(pdev, NULL);
-       }
+       if (!dev)
+               return;
+
+       tp = dev->priv;
+       pci_free_consistent (pdev,
+                            sizeof (struct tulip_rx_desc) * RX_RING_SIZE +
+                            sizeof (struct tulip_tx_desc) * TX_RING_SIZE,
+                            tp->rx_ring, tp->rx_ring_dma);
+       unregister_netdev (dev);
+       release_mem_region (pci_resource_start (pdev, 1),
+                           pci_resource_len (pdev, 1));
+       release_region (pci_resource_start (pdev, 0),
+                       pci_resource_len (pdev, 0));
+       if (tp->mtable)
+               kfree (tp->mtable);
+       kfree (dev);
+
+       pci_set_drvdata (pdev, NULL);
+
+       /* pci_power_off (pdev, -1); */
 }
 
 
index a1d4629af1783523e371c88174e120ce3eee8dfe..ad5a0a227acdb490f7803816446211a616f49047 100644 (file)
@@ -55,6 +55,9 @@
        LK1.1.6:
        - Urban Widmark: merges from Beckers 1.08b version (VT6102 + mdio)
                         set netif_running_on/off on startup, del_timer_sync
+       
+       LK1.1.7:
+       - Manfred Spraul: added reset into tx_timeout
 */
 
 
@@ -114,20 +117,21 @@ static const int multicast_filter_limit = 32;
 #include <linux/timer.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 #include <linux/init.h>
+#include <linux/delay.h>
 #include <asm/processor.h>             /* Processor type for cache alignment. */
 #include <asm/bitops.h>
 #include <asm/io.h>
 
 /* These identify the driver base version and may not be removed. */
 static char version1[] __devinitdata =
-"via-rhine.c:v1.08b-LK1.1.6  8/9/2000  Written by Donald Becker\n";
+"via-rhine.c:v1.08b-LK1.1.7  8/9/2000  Written by Donald Becker\n";
 static char version2[] __devinitdata =
 "  http://www.scyld.com/network/via-rhine.html\n";
 
@@ -213,7 +217,7 @@ a combined copy/checksum routine.  Copying also preloads the cache, which is
 most useful with small frames.
 
 Since the VIA chips are only able to transfer data to buffers on 32 bit
-boundaries, the the IP header at offset 14 in an ethernet frame isn't
+boundaries, the IP header at offset 14 in an ethernet frame isn't
 longword aligned for further processing.  Copying these unaligned buffers
 has the beneficial effect of 16-byte aligning the IP header.
 
@@ -380,6 +384,7 @@ enum chip_cmd_bits {
        CmdNoTxPoll=0x0800, CmdReset=0x8000,
 };
 
+#define MAX_MII_CNT    4
 struct netdev_private {
        /* Descriptor rings */
        struct rx_desc *rx_ring;
@@ -421,7 +426,8 @@ struct netdev_private {
 
        /* MII transceiver section. */
        u16 advertising;                                        /* NWay media advertisement */
-       unsigned char phys[2];                          /* MII device addresses. */
+       unsigned char phys[MAX_MII_CNT];                        /* MII device addresses. */
+       unsigned int mii_cnt;                   /* number of MIIs found, but only the first one is used */
        u16 mii_status;                                         /* last read MII status */
 };
 
@@ -431,7 +437,6 @@ static int  via_rhine_open(struct net_device *dev);
 static void via_rhine_check_duplex(struct net_device *dev);
 static void via_rhine_timer(unsigned long data);
 static void via_rhine_tx_timeout(struct net_device *dev);
-static void via_rhine_init_ring(struct net_device *dev);
 static int  via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev);
 static void via_rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
 static void via_rhine_tx(struct net_device *dev);
@@ -443,6 +448,25 @@ static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 static int  via_rhine_close(struct net_device *dev);
 static inline void clear_tally_counters(long ioaddr);
 
+static void wait_for_reset(struct net_device *dev)
+{
+       long ioaddr = dev->base_addr;
+       int i;
+
+       i = 0;
+       do {
+               udelay(5);
+               i++;
+               if(i > 2000) {
+                       printk(KERN_ERR "%s: reset did not complete in 10 ms.\n",
+                                       dev->name);
+                       break;
+               }
+       } while(readw(ioaddr + ChipCmd) & CmdReset);
+       if (debug > 1)
+               printk(KERN_INFO "%s: reset finished after %d microseconds.\n",
+                               dev->name, 5*i);
+}
 
 static int __devinit via_rhine_init_one (struct pci_dev *pdev,
                                         const struct pci_device_id *ent)
@@ -451,14 +475,11 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
        struct netdev_private *np;
        int i, option;
        int chip_id = (int) ent->driver_data;
-       int irq = pdev->irq;
        static int card_idx = -1;
        static int did_version = 0;
        long ioaddr;
        int io_size;
        int pci_flags;
-       void *ring;
-       dma_addr_t ring_dma;
        
        /* print version once and once only */
        if (! did_version++) {
@@ -471,6 +492,9 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
        io_size = via_rhine_chip_info[chip_id].io_size;
        pci_flags = via_rhine_chip_info[chip_id].pci_flags;
 
+       if (pci_enable_device (pdev))
+               goto err_out;
+
        /* this should always be supported */
        if (!pci_dma_supported(pdev, 0xffffffff)) {
                printk(KERN_ERR "32-bit PCI DMA addresses not supported by the card!?\n");
@@ -484,20 +508,7 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
                goto err_out;
        }
 
-       /* allocate pci dma space for rx and tx descriptor rings */
-       ring = pci_alloc_consistent(pdev, 
-                                   RX_RING_SIZE * sizeof(struct rx_desc) +
-                                   TX_RING_SIZE * sizeof(struct tx_desc),
-                                   &ring_dma);
-       if (!ring) {
-               printk(KERN_ERR "Could not allocate DMA memory.\n");
-               goto err_out;
-       }
-
        ioaddr = pci_resource_start (pdev, pci_flags & PCI_ADDR0 ? 0 : 1);
-
-       if (pci_enable_device (pdev))
-               goto err_out_free_dma;
        
        if (pci_flags & PCI_USES_MASTER)
                pci_set_master (pdev);
@@ -506,26 +517,12 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
        if (dev == NULL) {
                printk (KERN_ERR "init_ethernet failed for card #%d\n",
                        card_idx);
-               goto err_out_free_dma;
+               goto err_out;
        }
        SET_MODULE_OWNER(dev);
        
-       /* request all PIO and MMIO regions just to make sure
-        * noone else attempts to use any portion of our I/O space */
-       if (!request_region (pci_resource_start (pdev, 0),
-                            pci_resource_len (pdev, 0), dev->name)) {
-               printk (KERN_ERR "request_region failed for device %s, region 0x%X @ 0x%lX\n",
-                       dev->name, io_size,
-                       pci_resource_start (pdev, 0));
+       if (pci_request_regions(pdev, dev->name))
                goto err_out_free_netdev;
-       }
-       if (!request_mem_region (pci_resource_start (pdev, 1),
-                                pci_resource_len (pdev, 1), dev->name)) {
-               printk (KERN_ERR "request_mem_region failed for device %s, region 0x%X @ 0x%lX\n",
-                       dev->name, io_size,
-                       pci_resource_start (pdev, 1));
-               goto err_out_free_pio;
-       }
 
 #ifndef USE_IO
        ioaddr = (long) ioremap (ioaddr, io_size);
@@ -533,7 +530,7 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
                printk (KERN_ERR "ioremap failed for device %s, region 0x%X @ 0x%X\n",
                        dev->name, io_size,
                        pci_resource_start (pdev, 1));
-               goto err_out_free_mmio;
+               goto err_out_free_res;
        }
 #endif
 
@@ -545,25 +542,22 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
                dev->dev_addr[i] = readb(ioaddr + StationAddr + i);
        for (i = 0; i < 5; i++)
                        printk("%2.2x:", dev->dev_addr[i]);
-       printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq);
+       printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], pdev->irq);
 
        /* Reset the chip to erase previous misconfiguration. */
        writew(CmdReset, ioaddr + ChipCmd);
+       wait_for_reset(dev);
 
        dev->base_addr = ioaddr;
-       dev->irq = irq;
+       dev->irq = pdev->irq;
 
        np = dev->priv;
        spin_lock_init (&np->lock);
        np->chip_id = chip_id;
        np->drv_flags = via_rhine_chip_info[chip_id].drv_flags;
        np->pdev = pdev;
-       np->rx_ring = ring;
-       np->tx_ring = ring + RX_RING_SIZE * sizeof(struct rx_desc);
-       np->rx_ring_dma = ring_dma;
-       np->tx_ring_dma = ring_dma + RX_RING_SIZE * sizeof(struct rx_desc);
 
-       if (dev->mem_start)
+       if (dev->mem_start && dev->mem_start != ~0)
                option = dev->mem_start;
 
        /* The lower four bits are the media type. */
@@ -593,7 +587,7 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
        if (np->drv_flags & CanHaveMII) {
                int phy, phy_idx = 0;
                np->phys[0] = 1;                /* Standard for this chip. */
-               for (phy = 1; phy < 32 && phy_idx < 4; phy++) {
+               for (phy = 1; phy < 32 && phy_idx < MAX_MII_CNT; phy++) {
                        int mii_status = mdio_read(dev, phy, 1);
                        if (mii_status != 0xffff  &&  mii_status != 0x0000) {
                                np->phys[phy_idx++] = phy;
@@ -610,6 +604,7 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
                                        netif_carrier_off(dev);
                        }
                }
+               np->mii_cnt = phy_idx;
        }
 
        return 0;
@@ -617,27 +612,209 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
 #ifndef USE_IO
 /* note this is ifdef'd because the ioremap is ifdef'd...
  * so additional exit conditions above this must move
- * release_mem_region outside of the ifdef */
-err_out_free_mmio:
-       release_mem_region(pci_resource_start (pdev, 1),
-                          pci_resource_len (pdev, 1));
+ * pci_release_regions outside of the ifdef */
+err_out_free_res:
+       pci_release_regions(pdev);
 #endif
-err_out_free_pio:
-       release_region(pci_resource_start (pdev, 0),
-                      pci_resource_len (pdev, 0));
 err_out_free_netdev:
        unregister_netdev (dev);
        kfree (dev);
-err_out_free_dma:
-       pci_free_consistent(pdev, 
+err_out:
+       return -ENODEV;
+}
+
+static int alloc_ring(struct net_device* dev)
+{
+       struct netdev_private *np = dev->priv;
+       void *ring;
+       dma_addr_t ring_dma;
+
+       ring = pci_alloc_consistent(np->pdev, 
+                                   RX_RING_SIZE * sizeof(struct rx_desc) +
+                                   TX_RING_SIZE * sizeof(struct tx_desc),
+                                   &ring_dma);
+       if (!ring) {
+               printk(KERN_ERR "Could not allocate DMA memory.\n");
+               return -ENOMEM;
+       }
+       np->tx_bufs = pci_alloc_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE,
+                                                                  &np->tx_bufs_dma);
+       if (np->tx_bufs == NULL) {
+               pci_free_consistent(np->pdev, 
                            RX_RING_SIZE * sizeof(struct rx_desc) +
                            TX_RING_SIZE * sizeof(struct tx_desc),
                            ring, ring_dma);
-err_out:
-       return -ENODEV;
+               return -ENOMEM;
+       }
+
+       np->rx_ring = ring;
+       np->tx_ring = ring + RX_RING_SIZE * sizeof(struct rx_desc);
+       np->rx_ring_dma = ring_dma;
+       np->tx_ring_dma = ring_dma + RX_RING_SIZE * sizeof(struct rx_desc);
+
+
+       return 0;
+}
+
+void free_ring(struct net_device* dev)
+{
+       struct netdev_private *np = dev->priv;
+
+       pci_free_consistent(np->pdev, 
+                           RX_RING_SIZE * sizeof(struct rx_desc) +
+                           TX_RING_SIZE * sizeof(struct tx_desc),
+                           np->rx_ring, np->rx_ring_dma);
+
+       pci_free_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE,
+                                               np->tx_bufs, np->tx_bufs_dma);
+
+}
+
+static void alloc_rbufs(struct net_device *dev)
+{
+       struct netdev_private *np = dev->priv;
+       dma_addr_t next;
+       int i;
+
+       np->dirty_rx = np->cur_rx = 0;
+
+       np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32);
+       np->rx_head_desc = &np->rx_ring[0];
+       next = np->rx_ring_dma;
+       
+       /* Init the ring entries */
+       for (i = 0; i < RX_RING_SIZE; i++) {
+               np->rx_ring[i].rx_status = 0;
+               np->rx_ring[i].desc_length = cpu_to_le32(np->rx_buf_sz);
+               next += sizeof(struct rx_desc);
+               np->rx_ring[i].next_desc = cpu_to_le32(next);
+               np->rx_skbuff[i] = 0;
+       }
+       /* Mark the last entry as wrapping the ring. */
+       np->rx_ring[i-1].next_desc = cpu_to_le32(np->rx_ring_dma);
+
+       /* Fill in the Rx buffers.  Handle allocation failure gracefully. */
+       for (i = 0; i < RX_RING_SIZE; i++) {
+               struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz);
+               np->rx_skbuff[i] = skb;
+               if (skb == NULL)
+                       break;
+               skb->dev = dev;                 /* Mark as being used by this device. */
+
+               np->rx_skbuff_dma[i] =
+                       pci_map_single(np->pdev, skb->tail, np->rx_buf_sz,
+                                                  PCI_DMA_FROMDEVICE);
+
+               np->rx_ring[i].addr = cpu_to_le32(np->rx_skbuff_dma[i]);
+               np->rx_ring[i].rx_status = cpu_to_le32(DescOwn);
+       }
+       np->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
+}
+
+static void free_rbufs(struct net_device* dev)
+{
+       struct netdev_private *np = dev->priv;
+       int i;
+
+       /* Free all the skbuffs in the Rx queue. */
+       for (i = 0; i < RX_RING_SIZE; i++) {
+               np->rx_ring[i].rx_status = 0;
+               np->rx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */
+               if (np->rx_skbuff[i]) {
+                       pci_unmap_single(np->pdev,
+                                                        np->rx_skbuff_dma[i],
+                                                        np->rx_buf_sz, PCI_DMA_FROMDEVICE);
+                       dev_kfree_skb(np->rx_skbuff[i]);
+               }
+               np->rx_skbuff[i] = 0;
+       }
 }
 
+static void alloc_tbufs(struct net_device* dev)
+{
+       struct netdev_private *np = dev->priv;
+       dma_addr_t next;
+       int i;
 
+       np->dirty_tx = np->cur_tx = 0;
+       next = np->tx_ring_dma;
+       for (i = 0; i < TX_RING_SIZE; i++) {
+               np->tx_skbuff[i] = 0;
+               np->tx_ring[i].tx_status = 0;
+               np->tx_ring[i].desc_length = cpu_to_le32(0x00e08000);
+               next += sizeof(struct tx_desc);
+               np->tx_ring[i].next_desc = cpu_to_le32(next);
+               np->tx_buf[i] = &np->tx_bufs[i * PKT_BUF_SZ];
+       }
+       np->tx_ring[i-1].next_desc = cpu_to_le32(np->tx_ring_dma);
+
+}
+
+static void free_tbufs(struct net_device* dev)
+{
+       struct netdev_private *np = dev->priv;
+       int i;
+
+       for (i = 0; i < TX_RING_SIZE; i++) {
+               np->tx_ring[i].tx_status = 0;
+               np->tx_ring[i].desc_length = cpu_to_le32(0x00e08000);
+               np->tx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */
+               if (np->tx_skbuff[i]) {
+                       if (np->tx_skbuff_dma[i]) {
+                               pci_unmap_single(np->pdev,
+                                                                np->tx_skbuff_dma[i],
+                                                                np->tx_skbuff[i]->len, PCI_DMA_TODEVICE);
+                       }
+                       dev_kfree_skb(np->tx_skbuff[i]);
+               }
+               np->tx_skbuff[i] = 0;
+               np->tx_buf[i] = 0;
+       }
+}
+
+static void init_registers(struct net_device *dev)
+{
+       struct netdev_private *np = dev->priv;
+       long ioaddr = dev->base_addr;
+       int i;
+
+       for (i = 0; i < 6; i++)
+               writeb(dev->dev_addr[i], ioaddr + StationAddr + i);
+
+       /* Initialize other registers. */
+       writew(0x0006, ioaddr + PCIBusConfig);  /* Tune configuration??? */
+       /* Configure the FIFO thresholds. */
+       writeb(0x20, ioaddr + TxConfig);        /* Initial threshold 32 bytes */
+       np->tx_thresh = 0x20;
+       np->rx_thresh = 0x60;                   /* Written in via_rhine_set_rx_mode(). */
+
+       if (dev->if_port == 0)
+               dev->if_port = np->default_port;
+
+       writel(np->rx_ring_dma, ioaddr + RxRingPtr);
+       writel(np->tx_ring_dma, ioaddr + TxRingPtr);
+
+       via_rhine_set_rx_mode(dev);
+
+       /* Enable interrupts by setting the interrupt mask. */
+       writew(IntrRxDone | IntrRxErr | IntrRxEmpty| IntrRxOverflow| IntrRxDropped|
+                  IntrTxDone | IntrTxAbort | IntrTxUnderrun |
+                  IntrPCIErr | IntrStatsMax | IntrLinkChange | IntrMIIChange,
+                  ioaddr + IntrEnable);
+
+       np->chip_cmd = CmdStart|CmdTxOn|CmdRxOn|CmdNoTxPoll;
+       if (np->duplex_lock)
+               np->chip_cmd |= CmdFDuplex;
+       writew(np->chip_cmd, ioaddr + ChipCmd);
+
+       via_rhine_check_duplex(dev);
+
+       /* The LED outputs of various MII xcvrs should be configured.  */
+       /* For NS or Mison phys, turn on bit 1 in register 0x17 */
+       /* For ESI phys, turn on bit 7 in register 0x17. */
+       mdio_write(dev, np->phys[0], 0x17, mdio_read(dev, np->phys[0], 0x17) |
+                          (np->drv_flags & HasESIPhy) ? 0x0080 : 0x0001);
+}
 /* Read and write over the MII Management Data I/O (MDIO) interface. */
 
 static int mdio_read(struct net_device *dev, int phy_id, int regnum)
@@ -660,7 +837,7 @@ static int mdio_read(struct net_device *dev, int phy_id, int regnum)
 
 static void mdio_write(struct net_device *dev, int phy_id, int regnum, int value)
 {
-       struct netdev_private *np = (struct netdev_private *)dev->priv;
+       struct netdev_private *np = dev->priv;
        long ioaddr = dev->base_addr;
        int boguscnt = 1024;
 
@@ -691,75 +868,36 @@ static void mdio_write(struct net_device *dev, int phy_id, int regnum, int value
 
 static int via_rhine_open(struct net_device *dev)
 {
-       struct netdev_private *np = (struct netdev_private *)dev->priv;
+       struct netdev_private *np = dev->priv;
        long ioaddr = dev->base_addr;
        int i;
 
        /* Reset the chip. */
        writew(CmdReset, ioaddr + ChipCmd);
 
-       i = request_irq(dev->irq, &via_rhine_interrupt, SA_SHIRQ, dev->name, dev);
+       i = request_irq(np->pdev->irq, &via_rhine_interrupt, SA_SHIRQ, dev->name, dev);
        if (i)
                return i;
 
        if (debug > 1)
                printk(KERN_DEBUG "%s: via_rhine_open() irq %d.\n",
-                          dev->name, dev->irq);
-
-       np->tx_bufs = pci_alloc_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE,
-                                                                          &np->tx_bufs_dma);
-       if (np->tx_bufs == NULL) {
-               free_irq(dev->irq, dev);
-               return -ENOMEM;
-       }
-
-       via_rhine_init_ring(dev);
-
-       writel(np->rx_ring_dma, ioaddr + RxRingPtr);
-       writel(np->tx_ring_dma, ioaddr + TxRingPtr);
-
-       for (i = 0; i < 6; i++)
-               writeb(dev->dev_addr[i], ioaddr + StationAddr + i);
-
-       /* Initialize other registers. */
-       writew(0x0006, ioaddr + PCIBusConfig);  /* Tune configuration??? */
-       /* Configure the FIFO thresholds. */
-       writeb(0x20, ioaddr + TxConfig);        /* Initial threshold 32 bytes */
-       np->tx_thresh = 0x20;
-       np->rx_thresh = 0x60;                   /* Written in via_rhine_set_rx_mode(). */
-
-       if (dev->if_port == 0)
-               dev->if_port = np->default_port;
-
-       netif_start_queue(dev);
-
-       via_rhine_set_rx_mode(dev);
-
-       /* Enable interrupts by setting the interrupt mask. */
-       writew(IntrRxDone | IntrRxErr | IntrRxEmpty| IntrRxOverflow| IntrRxDropped|
-                  IntrTxDone | IntrTxAbort | IntrTxUnderrun |
-                  IntrPCIErr | IntrStatsMax | IntrLinkChange | IntrMIIChange,
-                  ioaddr + IntrEnable);
-
-       np->chip_cmd = CmdStart|CmdTxOn|CmdRxOn|CmdNoTxPoll;
-       if (np->duplex_lock)
-               np->chip_cmd |= CmdFDuplex;
-       writew(np->chip_cmd, ioaddr + ChipCmd);
-
-       via_rhine_check_duplex(dev);
-
-       /* The LED outputs of various MII xcvrs should be configured.  */
-       /* For NS or Mison phys, turn on bit 1 in register 0x17 */
-       /* For ESI phys, turn on bit 7 in register 0x17. */
-       mdio_write(dev, np->phys[0], 0x17, mdio_read(dev, np->phys[0], 0x17) |
-                          (np->drv_flags & HasESIPhy) ? 0x0080 : 0x0001);
-
+                          dev->name, np->pdev->irq);
+       
+       i = alloc_ring(dev);
+       if (i)
+               return i;
+       alloc_rbufs(dev);
+       alloc_tbufs(dev);
+       wait_for_reset(dev);
+       init_registers(dev);
        if (debug > 2)
                printk(KERN_DEBUG "%s: Done via_rhine_open(), status %4.4x "
                           "MII status: %4.4x.\n",
                           dev->name, readw(ioaddr + ChipCmd),
                           mdio_read(dev, np->phys[0], 1));
 
+       netif_start_queue(dev);
+
        /* Set the timer to check for link beat. */
        init_timer(&np->timer);
        np->timer.expires = jiffies + 2;
@@ -772,7 +910,7 @@ static int via_rhine_open(struct net_device *dev)
 
 static void via_rhine_check_duplex(struct net_device *dev)
 {
-       struct netdev_private *np = (struct netdev_private *)dev->priv;
+       struct netdev_private *np = dev->priv;
        long ioaddr = dev->base_addr;
        int mii_reg5 = mdio_read(dev, np->phys[0], 5);
        int negotiated = mii_reg5 & np->advertising;
@@ -799,7 +937,7 @@ static void via_rhine_check_duplex(struct net_device *dev)
 static void via_rhine_timer(unsigned long data)
 {
        struct net_device *dev = (struct net_device *)data;
-       struct netdev_private *np = (struct netdev_private *)dev->priv;
+       struct netdev_private *np = dev->priv;
        long ioaddr = dev->base_addr;
        int next_tick = 10*HZ;
        int mii_status;
@@ -835,89 +973,42 @@ static void via_rhine_tx_timeout (struct net_device *dev)
        struct netdev_private *np = (struct netdev_private *) dev->priv;
        long ioaddr = dev->base_addr;
 
-       /* Lock to protect mdio_read and access to stats. A friendly
-       advice to the implementor of the XXXs in this function is to be
-       sure not to spin too long (whatever that means :) */
-       spin_lock_irq (&np->lock);
-
        printk (KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status "
                "%4.4x, resetting...\n",
                dev->name, readw (ioaddr + IntrStatus),
                mdio_read (dev, np->phys[0], 1));
 
-       /* XXX Perhaps we should reinitialize the hardware here. */
        dev->if_port = 0;
 
-       /* Stop and restart the chip's Tx processes . */
-       /* XXX to do */
+       /* protect against concurrent rx interrupts */
+       disable_irq(np->pdev->irq);
 
-       /* Trigger an immediate transmit demand. */
-       /* XXX to do */
+       spin_lock(&np->lock);
 
-       dev->trans_start = jiffies;
-       np->stats.tx_errors++;
-
-       spin_unlock_irq (&np->lock);
-}
-
-
-/* Initialize the Rx and Tx rings, along with various 'dev' bits. */
-static void via_rhine_init_ring(struct net_device *dev)
-{
-       struct netdev_private *np = (struct netdev_private *)dev->priv;
-       int i;
-       dma_addr_t next = np->rx_ring_dma;
-
-       np->cur_rx = np->cur_tx = 0;
-       np->dirty_rx = np->dirty_tx = 0;
-
-       np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32);
-       np->rx_head_desc = &np->rx_ring[0];
-
-       for (i = 0; i < RX_RING_SIZE; i++) {
-               np->rx_ring[i].rx_status = 0;
-               np->rx_ring[i].desc_length = cpu_to_le32(np->rx_buf_sz);
-               next += sizeof(struct rx_desc);
-               np->rx_ring[i].next_desc = cpu_to_le32(next);
-               np->rx_skbuff[i] = 0;
-       }
-       /* Mark the last entry as wrapping the ring. */
-       np->rx_ring[i-1].next_desc = cpu_to_le32(np->rx_ring_dma);
-
-       /* Fill in the Rx buffers.  Handle allocation failure gracefully. */
-       for (i = 0; i < RX_RING_SIZE; i++) {
-               struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz);
-               np->rx_skbuff[i] = skb;
-               if (skb == NULL)
-                       break;
-               skb->dev = dev;                 /* Mark as being used by this device. */
+       /* Reset the chip. */
+       writew(CmdReset, ioaddr + ChipCmd);
 
-               np->rx_skbuff_dma[i] =
-                       pci_map_single(np->pdev, skb->tail, np->rx_buf_sz,
-                                                  PCI_DMA_FROMDEVICE);
+       /* clear all descriptors */
+       free_tbufs(dev);
+       free_rbufs(dev);
+       alloc_tbufs(dev);
+       alloc_rbufs(dev);
 
-               np->rx_ring[i].addr = cpu_to_le32(np->rx_skbuff_dma[i]);
-               np->rx_ring[i].rx_status = cpu_to_le32(DescOwn);
-       }
-       np->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
-
-       next = np->tx_ring_dma;
-       for (i = 0; i < TX_RING_SIZE; i++) {
-               np->tx_skbuff[i] = 0;
-               np->tx_ring[i].tx_status = 0;
-               np->tx_ring[i].desc_length = cpu_to_le32(0x00e08000);
-               next += sizeof(struct tx_desc);
-               np->tx_ring[i].next_desc = cpu_to_le32(next);
-               np->tx_buf[i] = &np->tx_bufs[i * PKT_BUF_SZ];
-       }
-       np->tx_ring[i-1].next_desc = cpu_to_le32(np->tx_ring_dma);
+       /* Reinitialize the hardware. */
+       wait_for_reset(dev);
+       init_registers(dev);
+       
+       spin_unlock(&np->lock);
+       enable_irq(np->pdev->irq);
 
-       return;
+       dev->trans_start = jiffies;
+       np->stats.tx_errors++;
+       netif_wake_queue(dev);
 }
 
 static int via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev)
 {
-       struct netdev_private *np = (struct netdev_private *)dev->priv;
+       struct netdev_private *np = dev->priv;
        unsigned entry;
 
        /* Caution: the write order is important here, set the field
@@ -1017,7 +1108,7 @@ static void via_rhine_interrupt(int irq, void *dev_instance, struct pt_regs *rgs
    for clarity. */
 static void via_rhine_tx(struct net_device *dev)
 {
-       struct netdev_private *np = (struct netdev_private *)dev->priv;
+       struct netdev_private *np = dev->priv;
        int txstatus = 0, entry = np->dirty_tx % TX_RING_SIZE;
 
        spin_lock (&np->lock);
@@ -1066,7 +1157,7 @@ static void via_rhine_tx(struct net_device *dev)
    for clarity and better register allocation. */
 static void via_rhine_rx(struct net_device *dev)
 {
-       struct netdev_private *np = (struct netdev_private *)dev->priv;
+       struct netdev_private *np = dev->priv;
        int entry = np->cur_rx % RX_RING_SIZE;
        int boguscnt = np->dirty_rx + RX_RING_SIZE - np->cur_rx;
 
@@ -1149,7 +1240,7 @@ static void via_rhine_rx(struct net_device *dev)
                        skb->protocol = eth_type_trans(skb, dev);
                        netif_rx(skb);
                        dev->last_rx = jiffies;
-                       np->stats.rx_bytes += skb->len;
+                       np->stats.rx_bytes += pkt_len;
                        np->stats.rx_packets++;
                }
                entry = (++np->cur_rx) % RX_RING_SIZE;
@@ -1180,7 +1271,7 @@ static void via_rhine_rx(struct net_device *dev)
 
 static void via_rhine_error(struct net_device *dev, int intr_status)
 {
-       struct netdev_private *np = (struct netdev_private *)dev->priv;
+       struct netdev_private *np = dev->priv;
        long ioaddr = dev->base_addr;
 
        spin_lock (&np->lock);
@@ -1215,8 +1306,9 @@ static void via_rhine_error(struct net_device *dev, int intr_status)
                                   "threshold setting to %2.2x.\n", dev->name, np->tx_thresh);
        }
        if ((intr_status & ~( IntrLinkChange | IntrStatsMax |
-                                                 IntrTxAbort | IntrTxAborted)) && debug > 1) {
-               printk(KERN_ERR "%s: Something Wicked happened! %4.4x.\n",
+                                                 IntrTxAbort | IntrTxAborted))) {
+               if (debug > 1)
+                       printk(KERN_ERR "%s: Something Wicked happened! %4.4x.\n",
                           dev->name, intr_status);
                /* Recovery for other fault sources not known. */
                writew(CmdTxDemand | np->chip_cmd, dev->base_addr + ChipCmd);
@@ -1227,7 +1319,7 @@ static void via_rhine_error(struct net_device *dev, int intr_status)
 
 static struct net_device_stats *via_rhine_get_stats(struct net_device *dev)
 {
-       struct netdev_private *np = (struct netdev_private *)dev->priv;
+       struct netdev_private *np = dev->priv;
        long ioaddr = dev->base_addr;
        unsigned long flags;
 
@@ -1273,7 +1365,7 @@ static inline u32 ether_crc(int length, unsigned char *data)
 
 static void via_rhine_set_rx_mode(struct net_device *dev)
 {
-       struct netdev_private *np = (struct netdev_private *)dev->priv;
+       struct netdev_private *np = dev->priv;
        long ioaddr = dev->base_addr;
        u32 mc_filter[2];                       /* Multicast hash filter */
        u8 rx_mode;                                     /* Note: 0x02=accept runt, 0x01=accept errs */
@@ -1305,7 +1397,7 @@ static void via_rhine_set_rx_mode(struct net_device *dev)
 
 static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
-       struct netdev_private *np = (struct netdev_private *)dev->priv;
+       struct netdev_private *np = dev->priv;
        u16 *data = (u16 *)&rq->ifr_data;
        unsigned long flags;
        int retval;
@@ -1338,13 +1430,11 @@ static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 static int via_rhine_close(struct net_device *dev)
 {
        long ioaddr = dev->base_addr;
-       struct netdev_private *np = (struct netdev_private *)dev->priv;
-       int i;
-       unsigned long flags;
+       struct netdev_private *np = dev->priv;
 
        del_timer_sync(&np->timer);
 
-       spin_lock_irqsave(&np->lock, flags);
+       spin_lock_irq(&np->lock);
 
        netif_stop_queue(dev);
 
@@ -1361,44 +1451,12 @@ static int via_rhine_close(struct net_device *dev)
        /* Stop the chip's Tx and Rx processes. */
        writew(CmdStop, ioaddr + ChipCmd);
 
-       spin_unlock_irqrestore(&np->lock, flags);
-
-       /* Make sure there is no irq-handler running on a different CPU. */
-       synchronize_irq();
-
-       free_irq(dev->irq, dev);
+       spin_unlock_irq(&np->lock);
 
-       /* Free all the skbuffs in the Rx queue. */
-       for (i = 0; i < RX_RING_SIZE; i++) {
-               np->rx_ring[i].rx_status = 0;
-               np->rx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */
-               if (np->rx_skbuff[i]) {
-                       pci_unmap_single(np->pdev,
-                                                        np->rx_skbuff_dma[i],
-                                                        np->rx_buf_sz, PCI_DMA_FROMDEVICE);
-                       dev_kfree_skb(np->rx_skbuff[i]);
-               }
-               np->rx_skbuff[i] = 0;
-       }
-
-       /* Free all the skbuffs in the Tx queue, and also any bounce buffers. */
-       for (i = 0; i < TX_RING_SIZE; i++) {
-               np->tx_ring[i].tx_status = 0;
-               np->tx_ring[i].desc_length = cpu_to_le32(0x00e08000);
-               np->tx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */
-               if (np->tx_skbuff[i]) {
-                       if (np->tx_skbuff_dma[i]) {
-                               pci_unmap_single(np->pdev,
-                                                                np->tx_skbuff_dma[i],
-                                                                np->tx_skbuff[i]->len, PCI_DMA_TODEVICE);
-                       }
-                       dev_kfree_skb(np->tx_skbuff[i]);
-               }
-               np->tx_skbuff[i] = 0;
-               np->tx_buf[i] = 0;
-       }
-       pci_free_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE,
-                                               np->tx_bufs, np->tx_bufs_dma);
+       free_irq(np->pdev->irq, dev);
+       free_rbufs(dev);
+       free_tbufs(dev);
+       free_ring(dev);
 
        return 0;
 }
@@ -1411,10 +1469,7 @@ static void __devexit via_rhine_remove_one (struct pci_dev *pdev)
        
        unregister_netdev(dev);
 
-       release_region(pci_resource_start (pdev, 0),
-                      pci_resource_len (pdev, 0));
-       release_mem_region(pci_resource_start (pdev, 1),
-                          pci_resource_len (pdev, 1));
+       pci_release_regions(pdev);
 
 #ifndef USE_IO
        iounmap((char *)(dev->base_addr));
index 9cda23333a6fdf8dde8213b546e9d18028b6b6ed..87e131146adc7344a54db5c3c933a6e4d6f182db 100644 (file)
@@ -1,33 +1,54 @@
 /* yellowfin.c: A Packet Engines G-NIC ethernet driver for linux. */
 /*
-       Written 1997-1999 by Donald Becker.
+       Written 1997-2001 by Donald Becker.
 
-       This software may be used and distributed according to the terms
-       of the GNU Public License, incorporated herein by reference.
+       This software may be used and distributed according to the terms of
+       the GNU General Public License (GPL), incorporated herein by reference.
+       Drivers based on or derived from this code fall under the GPL and must
+       retain the authorship, copyright and license notice.  This file is not
+       a complete program and may only be used when the entire operating
+       system is licensed under the GPL.
 
        This driver is for the Packet Engines G-NIC PCI Gigabit Ethernet adapter.
        It also supports the Symbios Logic version of the same chip core.
 
-       The author may be reached as becker@CESDIS.gsfc.nasa.gov, or C/O
-       Center of Excellence in Space Data and Information Sciences
-          Code 930.5, Goddard Space Flight Center, Greenbelt MD 20771
+       The author may be reached as becker@scyld.com, or C/O
+       Scyld Computing Corporation
+       410 Severn Ave., Suite 210
+       Annapolis MD 21403
 
        Support and updates available at
-       http://cesdis.gsfc.nasa.gov/linux/drivers/yellowfin.html
+       http://www.scyld.com/network/yellowfin.html
+
+
+       Linux kernel changelog:
+       -----------------------
+
+       LK1.1.1 (jgarzik): Port to 2.4 kernel
+
+       LK1.1.2 (jgarzik):
+       * Merge in becker version 1.05
+
 */
 
-static const char *version =
-"yellowfin.c:v1.03a 7/30/99  Written by Donald Becker, becker@cesdis.edu\n"
-" http://cesdis.gsfc.nasa.gov/linux/drivers/yellowfin.html\n";
+/* These identify the driver base version and may not be removed. */
+static const char version1[] =
+"yellowfin.c:v1.05  1/09/2001  Written by Donald Becker <becker@scyld.com>\n";
+static const char version2[] =
+"  http://www.scyld.com/network/yellowfin.html\n";
+static const char version3[] =
+"  (unofficial 2.4.x port, LK1.1.2, January 11, 2001)\n";
 
-/* A few user-configurable values. */
+/* The user-configurable values.
+   These may be modified when a driver module is loaded.*/
 
-static int debug = 1;
+static int debug = 1;                  /* 1 normal messages, 0 quiet .. 7 verbose. */
+/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
 static int max_interrupt_work = 20;
-static int mtu = 0;
+static int mtu;
 #ifdef YF_PROTOTYPE                    /* Support for prototype hardware errata. */
 /* System-wide count of bogus-rx frames. */
-static int bogus_rx = 0;
+static int bogus_rx;
 static int dma_ctrl = 0x004A0263;                      /* Constrained by errata */
 static int fifo_cfg = 0x0020;                          /* Bypass external Tx FIFO. */
 #elif YF_NEW                                   /* A future perfect board :->.  */
@@ -40,7 +61,7 @@ static int fifo_cfg = 0x0020;                         /* Bypass external Tx FIFO. */
 
 /* Set the copy breakpoint for the copy-only-tiny-frames scheme.
    Setting to > 1514 effectively disables this feature. */
-static int rx_copybreak = 0;
+static int rx_copybreak;
 
 /* Used to pass the media type, etc.
    No media types are currently defined.  These exist for driver
@@ -51,12 +72,12 @@ static int options[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
 /* Do ugly workaround for GX server chipset errata. */
-static int gx_fix = 0;
+static int gx_fix;
 
 /* Operational parameters that are set at compile time. */
 
 /* Keep the ring sizes a power of two for efficiency.
-   Making the Tx queue too long decreases the effectiveness of channel
+   Making the Tx ring too long decreases the effectiveness of channel
    bonding and packet priority.
    There are no ill effects from too-large receive rings. */
 #define TX_RING_SIZE   16
@@ -66,57 +87,61 @@ static int gx_fix = 0;
 /* Operational parameters that usually are not changed. */
 /* Time in jiffies before concluding the transmitter is hung. */
 #define TX_TIMEOUT  (2*HZ)
+#define PKT_BUF_SZ             1536                    /* Size of each temporary Rx buffer.*/
 
 #define yellowfin_debug debug
 
-#if !defined(__OPTIMIZE__)  ||  !defined(__KERNEL__)
+#if !defined(__OPTIMIZE__)
 #warning  You must compile this file with the correct options!
 #warning  See the last lines of the source file.
 #error You must compile this driver with "-O".
 #endif
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
 #include <asm/processor.h>             /* Processor type for cache alignment. */
 #include <asm/unaligned.h>
 #include <asm/bitops.h>
 #include <asm/io.h>
 
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
-
-/* Condensed operations for readability.
-   Compatibility defines are now in drv_compat.h */
-
+/* Condensed operations for readability. */
 #define virt_to_le32desc(addr)  cpu_to_le32(virt_to_bus(addr))
 #define le32desc_to_virt(addr)  bus_to_virt(le32_to_cpu(addr))
 
-
-#ifdef USE_IO_OPS
-#define YF_INB inb
-#define YF_INW inw
-#define YF_INL inl
-#define YF_OUTB        outb
-#define YF_OUTW        outw
-#define YF_OUTL        outl
-#else
-#define YF_INB readb
-#define YF_INW readw
-#define YF_INL readl
-#define YF_OUTB        writeb
-#define YF_OUTW        writew
-#define YF_OUTL        writel
-#endif
+#ifndef USE_IO_OPS
+#undef inb
+#undef inw
+#undef inl
+#undef outb
+#undef outw
+#undef outl
+#define inb readb
+#define inw readw
+#define inl readl
+#define outb writeb
+#define outw writew
+#define outl writel
+#endif /* !USE_IO_OPS */
+MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
+MODULE_DESCRIPTION("Packet Engines Yellowfin G-NIC Gigabit Ethernet driver");
+MODULE_PARM(max_interrupt_work, "i");
+MODULE_PARM(mtu, "i");
+MODULE_PARM(debug, "i");
+MODULE_PARM(rx_copybreak, "i");
+MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i");
+MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i");
+MODULE_PARM(gx_fix, "i");
 
 /*
                                Theory of Operation
@@ -193,50 +218,53 @@ http://cesdis.gsfc.nasa.gov/linux/misc/100mbps.html
 IVc. Errata
 
 See Packet Engines confidential appendix (prototype chips only).
-
 */
-\f
-/* A few values that may be tweaked. */
-#define PKT_BUF_SZ             1536                    /* Size of each temporary Rx buffer.*/
 
-/* The rest of these values should never change. */
+\f
 
+enum pci_id_flags_bits {
+       /* Set PCI command register bits before calling probe1(). */
+       PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4,
+       /* Read and map the single following PCI BAR. */
+       PCI_ADDR0=0<<4, PCI_ADDR1=1<<4, PCI_ADDR2=2<<4, PCI_ADDR3=3<<4,
+       PCI_ADDR_64BITS=0x100, PCI_NO_ACPI_WAKE=0x200, PCI_NO_MIN_LATENCY=0x400,
+       PCI_UNUSED_IRQ=0x800,
+};
 enum capability_flags {
        HasMII=1, FullTxStatus=2, IsGigabit=4, HasMulticastBug=8, FullRxStatus=16,
-       HasMACAddrBug=32,                       /* Really only on early revs.  */
+       HasMACAddrBug=32,                       /* Only on early revs.  */
 };
-
-
 /* The PCI I/O space extent. */
 #define YELLOWFIN_SIZE 0x100
+#ifdef USE_IO_OPS
+#define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_IO  | PCI_ADDR0)
+#else
+#define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_MEM | PCI_ADDR1)
+#endif
 
-#define YELLOWFIN_MODULE_NAME "yellowfin"
-#define PFX YELLOWFIN_MODULE_NAME ": "
-
-
-typedef enum {
-       YELLOWFIN_GNIC,
-       SYM83C885,
-} chip_t;
-
-
-struct chip_info {
-       const char *name;
-       int flags;
+struct pci_id_info {
+        const char *name;
+        struct match_info {
+                int     pci, pci_mask, subsystem, subsystem_mask;
+                int revision, revision_mask;                            /* Only 8 bits. */
+        } id;
+        enum pci_id_flags_bits pci_flags;
+        int io_size;                            /* Needed for I/O region check or ioremap(). */
+        int drv_flags;                          /* Driver use, intended as capability flags. */
 };
 
-
-/* index by chip_t */
-static struct chip_info chip_info[] = {
-       {"Yellowfin G-NIC Gigabit Ethernet",
+static struct pci_id_info pci_id_tbl[] = {
+       {"Yellowfin G-NIC Gigabit Ethernet", { 0x07021000, 0xffffffff},
+        PCI_IOTYPE, YELLOWFIN_SIZE,
         FullTxStatus | IsGigabit | HasMulticastBug | HasMACAddrBug},
-       {"Symbios SYM83C885", HasMII },
+       {"Symbios SYM83C885", { 0x07011000, 0xffffffff},
+        PCI_IOTYPE, YELLOWFIN_SIZE, HasMII },
+       {0,},
 };
 
-
 static struct pci_device_id yellowfin_pci_tbl[] __devinitdata = {
-       { 0x1000, 0x0702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, YELLOWFIN_GNIC },
-       { 0x1000, 0x0701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SYM83C885 },
+       { 0x1000, 0x0702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0x1000, 0x0701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
        { 0, }
 };
 MODULE_DEVICE_TABLE (pci, yellowfin_pci_tbl);
@@ -300,21 +328,22 @@ enum intr_status_bits {
        IntrEarlyRx=0x100, IntrWakeup=0x200, };
 
 #define PRIV_ALIGN     31      /* Required alignment mask */
+#define MII_CNT                4
 struct yellowfin_private {
-       /* Descriptor rings first for alignment.  Tx requires a second descriptor
-          for status. */
+       /* Descriptor rings first for alignment.
+          Tx requires a second descriptor for status. */
        struct yellowfin_desc rx_ring[RX_RING_SIZE];
        struct yellowfin_desc tx_ring[TX_RING_SIZE*2];
        /* The addresses of receive-in-place skbuffs. */
        struct sk_buff* rx_skbuff[RX_RING_SIZE];
-       /* The saved address of a sent-in-place packet/buffer, for skfree(). */
+       /* The saved address of a sent-in-place packet/buffer, for later free(). */
        struct sk_buff* tx_skbuff[TX_RING_SIZE];
        struct tx_status_words tx_status[TX_RING_SIZE];
        struct timer_list timer;        /* Media selection timer. */
        struct net_device_stats stats;
        /* Frequently used and paired value: keep adjacent for cache effect. */
+       int chip_id, drv_flags;
        struct pci_dev *pci_dev;
-       int chip_id, flags;
        struct yellowfin_desc *rx_head_desc;
        unsigned int cur_rx, dirty_rx;          /* Producer/consumer ring indices */
        unsigned int rx_buf_sz;                         /* Based on MTU+slack. */
@@ -329,29 +358,14 @@ struct yellowfin_private {
        /* MII transceiver section. */
        int mii_cnt;                                            /* MII device addresses. */
        u16 advertising;                                        /* NWay media advertisement */
-       unsigned char phys[2];                          /* MII device addresses. */
-       u32 pad[4];                                                     /* Used for 32-byte alignment */
+       unsigned char phys[MII_CNT];            /* MII device addresses, only first one used */
        spinlock_t lock;
 };
 
-
-MODULE_AUTHOR("Donald Becker <becker@cesdis.gsfc.nasa.gov>");
-MODULE_DESCRIPTION("Packet Engines Yellowfin G-NIC Gigabit Ethernet driver");
-MODULE_PARM(max_interrupt_work, "i");
-MODULE_PARM(mtu, "i");
-MODULE_PARM(debug, "i");
-MODULE_PARM(rx_copybreak, "i");
-MODULE_PARM(gx_fix, "i");
-MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i");
-MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i");
-
-
 static int read_eeprom(long ioaddr, int location);
 static int mdio_read(long ioaddr, int phy_id, int location);
 static void mdio_write(long ioaddr, int phy_id, int location, int value);
-#ifdef HAVE_PRIVATE_IOCTL
 static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
-#endif
 static int yellowfin_open(struct net_device *dev);
 static void yellowfin_timer(unsigned long data);
 static void yellowfin_tx_timeout(struct net_device *dev);
@@ -365,15 +379,141 @@ static struct net_device_stats *yellowfin_get_stats(struct net_device *dev);
 static void set_rx_mode(struct net_device *dev);
 
 
+static int __devinit yellowfin_init_one(struct pci_dev *pdev,
+                                       const struct pci_device_id *ent)
+{
+       struct net_device *dev;
+       struct yellowfin_private *np;
+       int irq;
+       int chip_idx = ent->driver_data;
+       static int find_cnt = 0;
+       long ioaddr, real_ioaddr;
+       int i, option = find_cnt < MAX_UNITS ? options[find_cnt] : 0;
+       int drv_flags = pci_id_tbl[chip_idx].drv_flags;
+       
+       i = pci_enable_device(pdev);
+       if (i) return i;
+
+       dev = init_etherdev(NULL, sizeof(*np));
+       if (!dev) {
+               printk (KERN_ERR "yellowfin: cannot allocate ethernet device\n");
+               return -ENOMEM;
+       }
+       SET_MODULE_OWNER(dev);
+
+       np = dev->priv;
+
+       if (pci_request_regions(pdev, dev->name))
+               goto err_out_free_netdev;
+
+       pci_set_master (pdev);
+
+#ifdef USE_IO_OPS
+       real_ioaddr = ioaddr = pci_resource_start (pdev, 0);
+#else
+       real_ioaddr = ioaddr = pci_resource_start (pdev, 1);
+       ioaddr = (long) ioremap(ioaddr, YELLOWFIN_SIZE);
+       if (!ioaddr)
+               goto err_out_free_res;
+#endif
+       irq = pdev->irq;
+
+       printk(KERN_INFO "%s: %s type %8x at 0x%lx, ",
+                  dev->name, pci_id_tbl[chip_idx].name, inl(ioaddr + ChipRev), ioaddr);
+
+       if (drv_flags & IsGigabit)
+               for (i = 0; i < 6; i++)
+                       dev->dev_addr[i] = inb(ioaddr + StnAddr + i);
+       else {
+               int ee_offset = (read_eeprom(ioaddr, 6) == 0xff ? 0x100 : 0);
+               for (i = 0; i < 6; i++)
+                       dev->dev_addr[i] = read_eeprom(ioaddr, ee_offset + i);
+       }
+       for (i = 0; i < 5; i++)
+                       printk("%2.2x:", dev->dev_addr[i]);
+       printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq);
+
+       /* Reset the chip. */
+       outl(0x80000000, ioaddr + DMACtrl);
+
+       dev->base_addr = ioaddr;
+       dev->irq = irq;
+
+       pci_set_drvdata(pdev, dev);
+       np->lock = SPIN_LOCK_UNLOCKED;
+
+       np->pci_dev = pdev;
+       np->chip_id = chip_idx;
+       np->drv_flags = drv_flags;
+
+       if (dev->mem_start && dev->mem_start != ~0)
+               option = dev->mem_start;
+
+       /* The lower four bits are the media type. */
+       if (option > 0) {
+               if (option & 0x200)
+                       np->full_duplex = 1;
+               np->default_port = option & 15;
+               if (np->default_port)
+                       np->medialock = 1;
+       }
+       if (find_cnt < MAX_UNITS  &&  full_duplex[find_cnt] > 0)
+               np->full_duplex = 1;
+
+       if (np->full_duplex)
+               np->duplex_lock = 1;
+
+       /* The Yellowfin-specific entries in the device structure. */
+       dev->open = &yellowfin_open;
+       dev->hard_start_xmit = &yellowfin_start_xmit;
+       dev->stop = &yellowfin_close;
+       dev->get_stats = &yellowfin_get_stats;
+       dev->set_multicast_list = &set_rx_mode;
+       dev->do_ioctl = &mii_ioctl;
+       dev->tx_timeout = yellowfin_tx_timeout;
+       dev->watchdog_timeo = TX_TIMEOUT;
+
+       if (mtu)
+               dev->mtu = mtu;
+
+       if (np->drv_flags & HasMII) {
+               int phy, phy_idx = 0;
+               for (phy = 0; phy < 32 && phy_idx < MII_CNT; phy++) {
+                       int mii_status = mdio_read(ioaddr, phy, 1);
+                       if (mii_status != 0xffff  &&  mii_status != 0x0000) {
+                               np->phys[phy_idx++] = phy;
+                               np->advertising = mdio_read(ioaddr, phy, 4);
+                               printk(KERN_INFO "%s: MII PHY found at address %d, status "
+                                          "0x%4.4x advertising %4.4x.\n",
+                                          dev->name, phy, mii_status, np->advertising);
+                       }
+               }
+               np->mii_cnt = phy_idx;
+       }
+
+       find_cnt++;
+       
+       return 0;
+
+#ifndef USE_IO_OPS
+err_out_free_res:
+       pci_release_regions(pdev);
+#endif
+err_out_free_netdev:
+       unregister_netdev (dev);
+       kfree (dev);
+       return -ENODEV;
+}
+
 static int __devinit read_eeprom(long ioaddr, int location)
 {
        int bogus_cnt = 10000;          /* Typical 33Mhz: 1050 ticks */
 
-       YF_OUTB(location, ioaddr + EEAddr);
-       YF_OUTB(0x30 | ((location >> 8) & 7), ioaddr + EECtrl);
-       while ((YF_INB(ioaddr + EEStatus) & 0x80)  &&  --bogus_cnt > 0)
+       outb(location, ioaddr + EEAddr);
+       outb(0x30 | ((location >> 8) & 7), ioaddr + EECtrl);
+       while ((inb(ioaddr + EEStatus) & 0x80)  &&  --bogus_cnt > 0)
                ;
-       return YF_INB(ioaddr + EERead);
+       return inb(ioaddr + EERead);
 }
 
 /* MII Managemen Data I/O accesses.
@@ -384,24 +524,24 @@ static int mdio_read(long ioaddr, int phy_id, int location)
 {
        int i;
 
-       YF_OUTW((phy_id<<8) + location, ioaddr + MII_Addr);
-       YF_OUTW(1, ioaddr + MII_Cmd);
+       outw((phy_id<<8) + location, ioaddr + MII_Addr);
+       outw(1, ioaddr + MII_Cmd);
        for (i = 10000; i >= 0; i--)
-               if ((YF_INW(ioaddr + MII_Status) & 1) == 0)
+               if ((inw(ioaddr + MII_Status) & 1) == 0)
                        break;
-       return YF_INW(ioaddr + MII_Rd_Data);
+       return inw(ioaddr + MII_Rd_Data);
 }
 
 static void mdio_write(long ioaddr, int phy_id, int location, int value)
 {
        int i;
 
-       YF_OUTW((phy_id<<8) + location, ioaddr + MII_Addr);
-       YF_OUTW(value, ioaddr + MII_Wr_Data);
+       outw((phy_id<<8) + location, ioaddr + MII_Addr);
+       outw(value, ioaddr + MII_Wr_Data);
 
        /* Wait for the command to finish. */
        for (i = 10000; i >= 0; i--)
-               if ((YF_INW(ioaddr + MII_Status) & 1) == 0)
+               if ((inw(ioaddr + MII_Status) & 1) == 0)
                        break;
        return;
 }
@@ -414,10 +554,10 @@ static int yellowfin_open(struct net_device *dev)
        int i;
 
        /* Reset the chip. */
-       YF_OUTL(0x80000000, ioaddr + DMACtrl);
+       outl(0x80000000, ioaddr + DMACtrl);
 
-       if (request_irq(dev->irq, &yellowfin_interrupt, SA_SHIRQ, dev->name, dev))
-               return -EAGAIN;
+       i = request_irq(dev->irq, &yellowfin_interrupt, SA_SHIRQ, dev->name, dev);
+       if (i) return i;
 
        if (yellowfin_debug > 1)
                printk(KERN_DEBUG "%s: yellowfin_open() irq %d.\n",
@@ -425,58 +565,59 @@ static int yellowfin_open(struct net_device *dev)
 
        yellowfin_init_ring(dev);
 
-       YF_OUTL(virt_to_bus(yp->rx_ring), ioaddr + RxPtr);
-       YF_OUTL(virt_to_bus(yp->tx_ring), ioaddr + TxPtr);
+       outl(virt_to_bus(yp->rx_ring), ioaddr + RxPtr);
+       outl(virt_to_bus(yp->tx_ring), ioaddr + TxPtr);
 
        for (i = 0; i < 6; i++)
-               YF_OUTB(dev->dev_addr[i], ioaddr + StnAddr + i);
+               outb(dev->dev_addr[i], ioaddr + StnAddr + i);
 
        /* Set up various condition 'select' registers.
           There are no options here. */
-       YF_OUTL(0x00800080, ioaddr + TxIntrSel);        /* Interrupt on Tx abort */
-       YF_OUTL(0x00800080, ioaddr + TxBranchSel);      /* Branch on Tx abort */
-       YF_OUTL(0x00400040, ioaddr + TxWaitSel);        /* Wait on Tx status */
-       YF_OUTL(0x00400040, ioaddr + RxIntrSel);        /* Interrupt on Rx done */
-       YF_OUTL(0x00400040, ioaddr + RxBranchSel);      /* Branch on Rx error */
-       YF_OUTL(0x00400040, ioaddr + RxWaitSel);        /* Wait on Rx done */
+       outl(0x00800080, ioaddr + TxIntrSel);   /* Interrupt on Tx abort */
+       outl(0x00800080, ioaddr + TxBranchSel); /* Branch on Tx abort */
+       outl(0x00400040, ioaddr + TxWaitSel);   /* Wait on Tx status */
+       outl(0x00400040, ioaddr + RxIntrSel);   /* Interrupt on Rx done */
+       outl(0x00400040, ioaddr + RxBranchSel); /* Branch on Rx error */
+       outl(0x00400040, ioaddr + RxWaitSel);   /* Wait on Rx done */
 
        /* Initialize other registers: with so many this eventually this will
           converted to an offset/value list. */
-       YF_OUTL(dma_ctrl, ioaddr + DMACtrl);
-       YF_OUTW(fifo_cfg, ioaddr + FIFOcfg);
+       outl(dma_ctrl, ioaddr + DMACtrl);
+       outw(fifo_cfg, ioaddr + FIFOcfg);
        /* Enable automatic generation of flow control frames, period 0xffff. */
-       YF_OUTL(0x0030FFFF, ioaddr + FlowCtrl);
+       outl(0x0030FFFF, ioaddr + FlowCtrl);
 
        yp->tx_threshold = 32;
-       YF_OUTL(yp->tx_threshold, ioaddr + TxThreshold);
+       outl(yp->tx_threshold, ioaddr + TxThreshold);
 
        if (dev->if_port == 0)
                dev->if_port = yp->default_port;
 
-       netif_start_queue (dev);
+       netif_start_queue(dev);
 
        /* Setting the Rx mode will start the Rx process. */
-       if (yp->flags & IsGigabit) {
+       if (yp->drv_flags & IsGigabit) {
                /* We are always in full-duplex mode with gigabit! */
                yp->full_duplex = 1;
-               YF_OUTW(0x01CF, ioaddr + Cnfg);
+               outw(0x01CF, ioaddr + Cnfg);
        } else {
-               YF_OUTW(0x0018, ioaddr + FrameGap0); /* 0060/4060 for non-MII 10baseT */
-               YF_OUTW(0x1018, ioaddr + FrameGap1);
-               YF_OUTW(0x101C | (yp->full_duplex ? 2 : 0), ioaddr + Cnfg);
+               outw(0x0018, ioaddr + FrameGap0); /* 0060/4060 for non-MII 10baseT */
+               outw(0x1018, ioaddr + FrameGap1);
+               outw(0x101C | (yp->full_duplex ? 2 : 0), ioaddr + Cnfg);
        }
        set_rx_mode(dev);
 
        /* Enable interrupts by setting the interrupt mask. */
-       YF_OUTW(0x81ff, ioaddr + IntrEnb);                      /* See enum intr_status_bits */
-       YF_OUTW(0x0000, ioaddr + EventStatus);          /* Clear non-interrupting events */
-       YF_OUTL(0x80008000, ioaddr + RxCtrl);           /* Start Rx and Tx channels. */
-       YF_OUTL(0x80008000, ioaddr + TxCtrl);
+       outw(0x81ff, ioaddr + IntrEnb);                 /* See enum intr_status_bits */
+       outw(0x0000, ioaddr + EventStatus);             /* Clear non-interrupting events */
+       outl(0x80008000, ioaddr + RxCtrl);              /* Start Rx and Tx channels. */
+       outl(0x80008000, ioaddr + TxCtrl);
 
        if (yellowfin_debug > 2) {
                printk(KERN_DEBUG "%s: Done yellowfin_open().\n",
                           dev->name);
        }
+
        /* Set the timer to check for link beat. */
        init_timer(&yp->timer);
        yp->timer.expires = jiffies + 3*HZ;
@@ -496,7 +637,7 @@ static void yellowfin_timer(unsigned long data)
 
        if (yellowfin_debug > 3) {
                printk(KERN_DEBUG "%s: Yellowfin timer tick, status %8.8x.\n",
-                          dev->name, YF_INW(ioaddr + IntrStatus));
+                          dev->name, inw(ioaddr + IntrStatus));
        }
 
        if (yp->mii_cnt) {
@@ -513,7 +654,7 @@ static void yellowfin_timer(unsigned long data)
                          || (negotiated & 0x00C0) == 0x0040)) {
                        yp->full_duplex = 1;
                }
-               YF_OUTW(0x101C | (yp->full_duplex ? 2 : 0), ioaddr + Cnfg);
+               outw(0x101C | (yp->full_duplex ? 2 : 0), ioaddr + Cnfg);
 
                if (mii_reg1 & 0x0004)
                        next_tick = 60*HZ;
@@ -533,7 +674,7 @@ static void yellowfin_tx_timeout(struct net_device *dev)
        printk(KERN_WARNING "%s: Yellowfin transmit timed out at %d/%d Tx "
                   "status %4.4x, Rx status %4.4x, resetting...\n",
                   dev->name, yp->cur_tx, yp->dirty_tx,
-                  YF_INL(ioaddr + TxStatus), YF_INL(ioaddr + RxStatus));
+                  inl(ioaddr + TxStatus), inl(ioaddr + RxStatus));
 
        /* Note: these should be KERN_DEBUG. */
        if (yellowfin_debug) {
@@ -553,13 +694,12 @@ static void yellowfin_tx_timeout(struct net_device *dev)
        dev->if_port = 0;
 
        /* Wake the potentially-idle transmit channel. */
-       YF_OUTL(0x10001000, dev->base_addr + TxCtrl);
+       outl(0x10001000, dev->base_addr + TxCtrl);
        if (yp->cur_tx - yp->dirty_tx < TX_QUEUE_SIZE)
                netif_wake_queue (dev);         /* Typical path */
 
        dev->trans_start = jiffies;
        yp->stats.tx_errors++;
-       return;
 }
 
 /* Initialize the Rx and Tx rings, along with various 'dev' bits. */
@@ -642,8 +782,8 @@ static int yellowfin_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        netif_stop_queue (dev);
 
-       /* Caution: the write order is important here, set the base address
-          with the "ownership" bits last. */
+       /* Note: Ordering is important here, set the field with the
+          "ownership" bit last, and only then increment cur_tx. */
 
        /* Calculate the next Tx descriptor entry. */
        entry = yp->cur_tx % TX_RING_SIZE;
@@ -691,7 +831,7 @@ static int yellowfin_start_xmit(struct sk_buff *skb, struct net_device *dev)
        /* Non-x86 Todo: explicitly flush cache lines here. */
 
        /* Wake the potentially-idle transmit channel. */
-       YF_OUTL(0x10001000, dev->base_addr + TxCtrl);
+       outl(0x10001000, dev->base_addr + TxCtrl);
 
        if (yp->cur_tx - yp->dirty_tx < TX_QUEUE_SIZE)
                netif_start_queue (dev);                /* Typical path */
@@ -712,7 +852,8 @@ static void yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *reg
 {
        struct net_device *dev = (struct net_device *)dev_instance;
        struct yellowfin_private *yp;
-       long ioaddr, boguscnt = max_interrupt_work;
+       long ioaddr;
+       int boguscnt = max_interrupt_work;
 
 #ifndef final_version                  /* Can never occur. */
        if (dev == NULL) {
@@ -727,7 +868,7 @@ static void yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *reg
        spin_lock (&yp->lock);
 
        do {
-               u16 intr_status = YF_INW(ioaddr + IntrClear);
+               u16 intr_status = inw(ioaddr + IntrClear);
 
                if (yellowfin_debug > 4)
                        printk(KERN_DEBUG "%s: Yellowfin interrupt, status %4.4x.\n",
@@ -738,7 +879,7 @@ static void yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *reg
 
                if (intr_status & (IntrRxDone | IntrEarlyRx)) {
                        yellowfin_rx(dev);
-                       YF_OUTL(0x10001000, ioaddr + RxCtrl);           /* Wake Rx engine. */
+                       outl(0x10001000, ioaddr + RxCtrl);              /* Wake Rx engine. */
                }
 
 #ifdef NO_TXSTATS
@@ -746,8 +887,8 @@ static void yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *reg
                        int entry = yp->dirty_tx % TX_RING_SIZE;
                        if (yp->tx_ring[entry].result_status == 0)
                                break;
-                       yp->stats.tx_bytes += yp->tx_skbuff[entry]->len;
                        yp->stats.tx_packets++;
+                       yp->stats.tx_bytes += yp->tx_skbuff[entry]->len;
                        /* Free the original skb. */
                        dev_kfree_skb_irq(yp->tx_skbuff[entry]);
                        yp->tx_skbuff[entry] = 0;
@@ -756,11 +897,8 @@ static void yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *reg
                        && yp->cur_tx - yp->dirty_tx < TX_QUEUE_SIZE - 4) {
                        /* The ring is no longer full, clear tbusy. */
                        yp->tx_full = 0;
-               }
-               if (yp->tx_full)
-                       netif_stop_queue(dev);
-               else
                        netif_wake_queue(dev);
+               }
 #else
                if (intr_status & IntrTxDone
                        || yp->tx_tail_desc->tx_errs) {
@@ -831,11 +969,8 @@ static void yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *reg
                                && yp->cur_tx - dirty_tx < TX_QUEUE_SIZE - 2) {
                                /* The ring is no longer full, clear tbusy. */
                                yp->tx_full = 0;
-                       }
-                       if (yp->tx_full)
-                               netif_stop_queue(dev);
-                       else
                                netif_wake_queue(dev);
+                       }
 
                        yp->dirty_tx = dirty_tx;
                        yp->tx_tail_desc = &yp->tx_status[dirty_tx % TX_RING_SIZE];
@@ -847,7 +982,8 @@ static void yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *reg
                        yellowfin_error(dev, intr_status);
 
                if (--boguscnt < 0) {
-                       printk(KERN_WARNING "%s: Too much work at interrupt, status=0x%4.4x.\n",
+                       printk(KERN_WARNING "%s: Too much work at interrupt, "
+                                  "status=0x%4.4x.\n",
                                   dev->name, intr_status);
                        break;
                }
@@ -855,19 +991,10 @@ static void yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *reg
 
        if (yellowfin_debug > 3)
                printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x.\n",
-                          dev->name, YF_INW(ioaddr + IntrStatus));
-
-       /* Code that should never be run!  Perhaps remove after testing.. */
-       {
-               static int stopit = 10;
-               if ((!(netif_running(dev)))  &&  --stopit < 0) {
-                       printk(KERN_ERR "%s: Emergency stop, looping startup interrupt.\n",
-                                  dev->name);
-                       free_irq(irq, dev);
-               }
-       }
+                          dev->name, inw(ioaddr + IntrStatus));
 
        spin_unlock (&yp->lock);
+       return;
 }
 
 /* This routine is logically part of the interrupt handler, but separated
@@ -876,7 +1003,7 @@ static int yellowfin_rx(struct net_device *dev)
 {
        struct yellowfin_private *yp = (struct yellowfin_private *)dev->priv;
        int entry = yp->cur_rx % RX_RING_SIZE;
-       int boguscnt = 20;
+       int boguscnt = yp->dirty_rx + RX_RING_SIZE - yp->cur_rx;
 
        if (yellowfin_debug > 4) {
                printk(KERN_DEBUG " In yellowfin_rx(), entry %d status %8.8x.\n",
@@ -905,7 +1032,7 @@ static int yellowfin_rx(struct net_device *dev)
                        printk(KERN_WARNING "%s: Oversized Ethernet frame spanned multiple buffers,"
                                   " status %4.4x!\n", dev->name, desc_status);
                        yp->stats.rx_length_errors++;
-               } else if ((yp->flags & IsGigabit)  &&  (frame_status & 0x0038)) {
+               } else if ((yp->drv_flags & IsGigabit)  &&  (frame_status & 0x0038)) {
                        /* There was a error. */
                        if (yellowfin_debug > 3)
                                printk(KERN_DEBUG "  yellowfin_rx() Rx error was %4.4x.\n",
@@ -915,7 +1042,7 @@ static int yellowfin_rx(struct net_device *dev)
                        if (frame_status & 0x0008) yp->stats.rx_frame_errors++;
                        if (frame_status & 0x0010) yp->stats.rx_crc_errors++;
                        if (frame_status < 0) yp->stats.rx_dropped++;
-               } else if ( !(yp->flags & IsGigabit)  &&
+               } else if ( !(yp->drv_flags & IsGigabit)  &&
                                   ((buf_addr[data_size-1] & 0x85) || buf_addr[data_size-2] & 0xC0)) {
                        u8 status1 = buf_addr[data_size-2];
                        u8 status2 = buf_addr[data_size-1];
@@ -952,21 +1079,22 @@ static int yellowfin_rx(struct net_device *dev)
                           without copying to a properly sized skbuff. */
                        if (pkt_len > rx_copybreak) {
                                char *temp = skb_put(skb = yp->rx_skbuff[entry], pkt_len);
-#ifndef final_verison                          /* Remove after testing. */
+                               yp->rx_skbuff[entry] = NULL;
+#ifndef final_version                          /* Remove after testing. */
                                if (le32desc_to_virt(yp->rx_ring[entry].addr) != temp)
-                                       printk(KERN_WARNING "%s: Warning -- the skbuff addresses "
+                                       printk(KERN_ERR "%s: Internal fault: The skbuff addresses "
                                                   "do not match in yellowfin_rx: %p vs. %p / %p.\n",
-                                                  dev->name, le32desc_to_virt(yp->rx_ring[entry].addr),
+                                                  dev->name,
+                                                  le32desc_to_virt(yp->rx_ring[entry].addr),
                                                   skb->head, temp);
 #endif
-                               yp->rx_skbuff[entry] = NULL;
                        } else {
                                skb = dev_alloc_skb(pkt_len + 2);
                                if (skb == NULL)
                                        break;
                                skb->dev = dev;
-                               skb_reserve(skb, 2);    /* 16 byte align the data fields */
-#if 1 || USE_IP_CSUM
+                               skb_reserve(skb, 2);    /* 16 byte align the IP header */
+#if HAS_IP_COPYSUM
                                eth_copy_and_sum(skb, yp->rx_skbuff[entry]->tail, pkt_len, 0);
                                skb_put(skb, pkt_len);
 #else
@@ -989,9 +1117,9 @@ static int yellowfin_rx(struct net_device *dev)
                entry = yp->dirty_rx % RX_RING_SIZE;
                if (yp->rx_skbuff[entry] == NULL) {
                        struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz);
-                       if (skb == NULL)
-                               break;                  /* Better luck next round. */
                        yp->rx_skbuff[entry] = skb;
+                       if (skb == NULL)
+                               break;                          /* Better luck next round. */
                        skb->dev = dev;                 /* Mark as being used by this device. */
                        skb_reserve(skb, 2);    /* Align IP on 16 byte boundaries */
                        yp->rx_ring[entry].addr = virt_to_le32desc(skb->tail);
@@ -1032,29 +1160,30 @@ static int yellowfin_close(struct net_device *dev)
        netif_stop_queue (dev);
 
        if (yellowfin_debug > 1) {
-               printk(KERN_DEBUG "%s: Shutting down ethercard, status was Tx %4.4x Rx %4.4x Int %2.2x.\n",
-                          dev->name, YF_INW(ioaddr + TxStatus),
-                          YF_INW(ioaddr + RxStatus),
-                          YF_INW(ioaddr + IntrStatus));
+               printk(KERN_DEBUG "%s: Shutting down ethercard, status was Tx %4.4x "
+                          "Rx %4.4x Int %2.2x.\n",
+                          dev->name, inw(ioaddr + TxStatus),
+                          inw(ioaddr + RxStatus), inw(ioaddr + IntrStatus));
                printk(KERN_DEBUG "%s: Queue pointers were Tx %d / %d,  Rx %d / %d.\n",
                           dev->name, yp->cur_tx, yp->dirty_tx, yp->cur_rx, yp->dirty_rx);
        }
 
        /* Disable interrupts by clearing the interrupt mask. */
-       YF_OUTW(0x0000, ioaddr + IntrEnb);
+       outw(0x0000, ioaddr + IntrEnb);
 
        /* Stop the chip's Tx and Rx processes. */
-       YF_OUTL(0x80000000, ioaddr + RxCtrl);
-       YF_OUTL(0x80000000, ioaddr + TxCtrl);
+       outl(0x80000000, ioaddr + RxCtrl);
+       outl(0x80000000, ioaddr + TxCtrl);
 
        del_timer(&yp->timer);
 
-#if !defined(final_version) && defined(__i386__)
+#if defined(__i386__)
        if (yellowfin_debug > 2) {
-               printk("\n"KERN_DEBUG"  Tx ring at %8.8x:\n", (int)virt_to_bus(yp->tx_ring));
+               printk("\n"KERN_DEBUG"  Tx ring at %8.8x:\n",
+                          (int)virt_to_bus(yp->tx_ring));
                for (i = 0; i < TX_RING_SIZE*2; i++)
                        printk(" %c #%d desc. %8.8x %8.8x %8.8x %8.8x.\n",
-                                  YF_INL(ioaddr + TxPtr) == (long)&yp->tx_ring[i] ? '>' : ' ',
+                                  inl(ioaddr + TxPtr) == (long)&yp->tx_ring[i] ? '>' : ' ',
                                   i, yp->tx_ring[i].dbdma_cmd, yp->tx_ring[i].addr,
                                   yp->tx_ring[i].branch_addr, yp->tx_ring[i].result_status);
                printk(KERN_DEBUG "  Tx status %p:\n", yp->tx_status);
@@ -1063,10 +1192,11 @@ static int yellowfin_close(struct net_device *dev)
                                   i, yp->tx_status[i].tx_cnt, yp->tx_status[i].tx_errs,
                                   yp->tx_status[i].total_tx_cnt, yp->tx_status[i].paused);
 
-               printk("\n"KERN_DEBUG "  Rx ring %8.8x:\n", (int)virt_to_bus(yp->rx_ring));
+               printk("\n"KERN_DEBUG "  Rx ring %8.8x:\n",
+                          (int)virt_to_bus(yp->rx_ring));
                for (i = 0; i < RX_RING_SIZE; i++) {
                        printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x\n",
-                                  YF_INL(ioaddr + RxPtr) == (long)&yp->rx_ring[i] ? '>' : ' ',
+                                  inl(ioaddr + RxPtr) == (long)&yp->rx_ring[i] ? '>' : ' ',
                                   i, yp->rx_ring[i].dbdma_cmd, yp->rx_ring[i].addr,
                                   yp->rx_ring[i].result_status);
                        if (yellowfin_debug > 6) {
@@ -1105,6 +1235,7 @@ static int yellowfin_close(struct net_device *dev)
                           dev->name, bogus_rx);
        }
 #endif
+
        return 0;
 }
 
@@ -1143,17 +1274,17 @@ static void set_rx_mode(struct net_device *dev)
 {
        struct yellowfin_private *yp = (struct yellowfin_private *)dev->priv;
        long ioaddr = dev->base_addr;
-       u16 cfg_value = YF_INW(ioaddr + Cnfg);
+       u16 cfg_value = inw(ioaddr + Cnfg);
 
        /* Stop the Rx process to change any value. */
-       YF_OUTW(cfg_value & ~0x1000, ioaddr + Cnfg);
+       outw(cfg_value & ~0x1000, ioaddr + Cnfg);
        if (dev->flags & IFF_PROMISC) {                 /* Set promiscuous. */
                /* Unconditionally log net taps. */
                printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name);
-               YF_OUTW(0x000F, ioaddr + AddrMode);
+               outw(0x000F, ioaddr + AddrMode);
        } else if ((dev->mc_count > 64)  ||  (dev->flags & IFF_ALLMULTI)) {
                /* Too many to filter well, or accept all multicasts. */
-               YF_OUTW(0x000B, ioaddr + AddrMode);
+               outw(0x000B, ioaddr + AddrMode);
        } else if (dev->mc_count > 0) { /* Must use the multicast hash table. */
                struct dev_mc_list *mclist;
                u16 hash_table[4];
@@ -1163,7 +1294,7 @@ static void set_rx_mode(struct net_device *dev)
                         i++, mclist = mclist->next) {
                        /* Due to a bug in the early chip versions, multiple filter
                           slots must be set for each address. */
-                       if (yp->flags & HasMulticastBug) {
+                       if (yp->drv_flags & HasMulticastBug) {
                                set_bit((ether_crc_le(3, mclist->dmi_addr) >> 3) & 0x3f,
                                                hash_table);
                                set_bit((ether_crc_le(4, mclist->dmi_addr) >> 3) & 0x3f,
@@ -1176,24 +1307,24 @@ static void set_rx_mode(struct net_device *dev)
                }
                /* Copy the hash table to the chip. */
                for (i = 0; i < 4; i++)
-                       YF_OUTW(hash_table[i], ioaddr + HashTbl + i*2);
-               YF_OUTW(0x0003, ioaddr + AddrMode);
+                       outw(hash_table[i], ioaddr + HashTbl + i*2);
+               outw(0x0003, ioaddr + AddrMode);
        } else {                                        /* Normal, unicast/broadcast-only mode. */
-               YF_OUTW(0x0001, ioaddr + AddrMode);
+               outw(0x0001, ioaddr + AddrMode);
        }
        /* Restart the Rx process. */
-       YF_OUTW(cfg_value | 0x1000, ioaddr + Cnfg);
+       outw(cfg_value | 0x1000, ioaddr + Cnfg);
 }
 
-#ifdef HAVE_PRIVATE_IOCTL
 static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
+       struct yellowfin_private *np = (void *)dev->priv;
        long ioaddr = dev->base_addr;
        u16 *data = (u16 *)&rq->ifr_data;
 
        switch(cmd) {
        case SIOCDEVPRIVATE:            /* Get the address of the PHY in use. */
-               data[0] = ((struct yellowfin_private *)dev->priv)->phys[0] & 0x1f;
+               data[0] = np->phys[0] & 0x1f;
                /* Fall Through */
        case SIOCDEVPRIVATE+1:          /* Read the specified MII register. */
                data[3] = mdio_read(ioaddr, data[0] & 0x1f, data[1] & 0x1f);
@@ -1201,155 +1332,30 @@ static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
        case SIOCDEVPRIVATE+2:          /* Write the specified MII register */
                if (!capable(CAP_NET_ADMIN))
                        return -EPERM;
+               if (data[0] == np->phys[0]) {
+                       u16 value = data[2];
+                       switch (data[1]) {
+                       case 0:
+                               /* Check for autonegotiation on or reset. */
+                               np->medialock = (value & 0x9000) ? 0 : 1;
+                               if (np->medialock)
+                                       np->full_duplex = (value & 0x0100) ? 1 : 0;
+                               break;
+                       case 4: np->advertising = value; break;
+                       }
+                       /* Perhaps check_duplex(dev), depending on chip semantics. */
+               }
                mdio_write(ioaddr, data[0] & 0x1f, data[1] & 0x1f, data[2]);
                return 0;
        default:
                return -EOPNOTSUPP;
        }
 }
-#endif  /* HAVE_PRIVATE_IOCTL */
-
-
-static int __devinit yellowfin_init_one(struct pci_dev *pdev,
-                                       const struct pci_device_id *ent)
-{
-       struct net_device *dev;
-       struct yellowfin_private *yp;
-       int option, i, irq;
-       int flags, chip_idx;
-       static int find_cnt = 0;
-       long ioaddr, real_ioaddr;
-       
-       chip_idx = ent->driver_data;
-       flags = chip_info[chip_idx].flags;
-
-       dev = init_etherdev(NULL, sizeof(*yp));
-       if (!dev) {
-               printk (KERN_ERR PFX "cannot allocate ethernet device\n");
-               return -ENOMEM;
-       }
-       SET_MODULE_OWNER(dev);
-
-       yp = dev->priv;
-
-       if (!request_region (pci_resource_start (pdev, 0),
-                            YELLOWFIN_SIZE, YELLOWFIN_MODULE_NAME)) {
-               printk (KERN_ERR PFX "cannot obtain I/O port region\n");
-               goto err_out_free_netdev;
-       }
-       if (!request_mem_region (pci_resource_start (pdev, 1),
-                                YELLOWFIN_SIZE, YELLOWFIN_MODULE_NAME)) {
-               printk (KERN_ERR PFX "cannot obtain MMIO region\n");
-               goto err_out_free_pio_region;
-       }
-       
-       if (pci_enable_device (pdev))
-               goto err_out_free_mmio_region;
-       pci_set_master (pdev);
-
-#ifdef USE_IO_OPS
-       real_ioaddr = ioaddr = pci_resource_start (pdev, 0);
-#else
-       real_ioaddr = ioaddr = pci_resource_start (pdev, 1);
-       ioaddr = (long) ioremap(ioaddr, YELLOWFIN_SIZE);
-       if (!ioaddr)
-               goto err_out_free_mmio_region;
-#endif
-       irq = pdev->irq;
 
-       printk(KERN_INFO "%s: %s type %8x at 0x%lx, ",
-              dev->name, chip_info[chip_idx].name,
-              YF_INL(ioaddr + ChipRev), real_ioaddr);
-
-       if (flags & IsGigabit)
-               for (i = 0; i < 6; i++)
-                       dev->dev_addr[i] = YF_INB(ioaddr + StnAddr + i);
-       else {
-               int ee_offset = (read_eeprom(ioaddr, 6) == 0xff ? 0x100 : 0);
-               for (i = 0; i < 6; i++)
-                       dev->dev_addr[i] = read_eeprom(ioaddr, ee_offset + i);
-       }
-       for (i = 0; i < 5; i++)
-                       printk("%2.2x:", dev->dev_addr[i]);
-       printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq);
-
-       /* Reset the chip. */
-       YF_OUTL(0x80000000, ioaddr + DMACtrl);
-
-       dev->base_addr = ioaddr;
-       dev->irq = irq;
-
-       pdev->driver_data = dev;
-       yp->chip_id = chip_idx;
-       yp->flags = flags;
-       yp->lock = SPIN_LOCK_UNLOCKED;
-
-       option = find_cnt < MAX_UNITS ? options[find_cnt] : 0;
-       if (dev->mem_start)
-               option = dev->mem_start;
-
-       /* The lower four bits are the media type. */
-       if (option > 0) {
-               if (option & 0x200)
-                       yp->full_duplex = 1;
-               yp->default_port = option & 15;
-               if (yp->default_port)
-                       yp->medialock = 1;
-       }
-       if (find_cnt < MAX_UNITS  &&  full_duplex[find_cnt] > 0)
-               yp->full_duplex = 1;
-
-       if (yp->full_duplex)
-               yp->duplex_lock = 1;
-
-       /* The Yellowfin-specific entries in the device structure. */
-       dev->open = &yellowfin_open;
-       dev->hard_start_xmit = &yellowfin_start_xmit;
-       dev->stop = &yellowfin_close;
-       dev->get_stats = &yellowfin_get_stats;
-       dev->set_multicast_list = &set_rx_mode;
-#ifdef HAVE_PRIVATE_IOCTL
-       dev->do_ioctl = &mii_ioctl;
-#endif
-       dev->tx_timeout = yellowfin_tx_timeout;
-       dev->watchdog_timeo = TX_TIMEOUT;
-
-       if (mtu)
-               dev->mtu = mtu;
-
-       if (yp->flags & HasMII) {
-               int phy, phy_idx = 0;
-               for (phy = 0; phy < 32 && phy_idx < 4; phy++) {
-                       int mii_status = mdio_read(ioaddr, phy, 1);
-                       if (mii_status != 0xffff  &&
-                               mii_status != 0x0000) {
-                               yp->phys[phy_idx++] = phy;
-                               yp->advertising = mdio_read(ioaddr, phy, 4);
-                               printk(KERN_INFO "%s: MII PHY found at address %d, status "
-                                          "0x%4.4x advertising %4.4x.\n",
-                                          dev->name, phy, mii_status, yp->advertising);
-                       }
-               }
-               yp->mii_cnt = phy_idx;
-       }
-
-       find_cnt++;
-       
-       return 0;
-
-err_out_free_mmio_region:
-       release_mem_region (pci_resource_start (pdev, 1), YELLOWFIN_SIZE);
-err_out_free_pio_region:
-       release_region (pci_resource_start (pdev, 0), YELLOWFIN_SIZE);
-err_out_free_netdev:
-       unregister_netdev (dev);
-       kfree (dev);
-       return -ENODEV;
-}
 
 static void __devexit yellowfin_remove_one (struct pci_dev *pdev)
 {
-       struct net_device *dev = pdev->driver_data;
+       struct net_device *dev = pci_get_drvdata(pdev);
        struct yellowfin_private *np;
 
        if (!dev)
@@ -1358,19 +1364,19 @@ static void __devexit yellowfin_remove_one (struct pci_dev *pdev)
 
        unregister_netdev (dev);
 
-       release_region (dev->base_addr, YELLOWFIN_SIZE);
-       release_mem_region (dev->base_addr, YELLOWFIN_SIZE);
+       pci_release_regions (pdev);
 
 #ifndef USE_IO_OPS
        iounmap ((void *) dev->base_addr);
 #endif
 
        kfree (dev);
+       pci_set_drvdata(pdev, NULL);
 }
 
 
 static struct pci_driver yellowfin_driver = {
-       name:           YELLOWFIN_MODULE_NAME,
+       name:           "yellowfin",
        id_table:       yellowfin_pci_tbl,
        probe:          yellowfin_init_one,
        remove:         yellowfin_remove_one,
@@ -1380,7 +1386,8 @@ static struct pci_driver yellowfin_driver = {
 static int __init yellowfin_init (void)
 {
        if (debug)                                      /* Emit version even if no cards detected. */
-               printk(KERN_INFO "%s", version);
+               printk(KERN_INFO "%s" KERN_INFO "%s" KERN_INFO "%s",
+                      version1, version2, version3);
 
        return pci_module_init (&yellowfin_driver);
 }
@@ -1394,12 +1401,12 @@ static void __exit yellowfin_cleanup (void)
 
 module_init(yellowfin_init);
 module_exit(yellowfin_cleanup);
-
-
+\f
 /*
  * Local variables:
- *  compile-command: "gcc -DMODULE -D__KERNEL__  -Wall -Wstrict-prototypes -O6 -c yellowfin.c `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`"
- *  compile-command-alphaLX: "gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O2 -c yellowfin.c `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`  -fomit-frame-pointer -fno-strength-reduce -mno-fp-regs -Wa,-m21164a -DBWX_USABLE -DBWIO_ENABLED"
+ *  compile-command: "gcc -DMODULE -Wall -Wstrict-prototypes -O6 -c yellowfin.c"
+ *  compile-command-alphaLX: "gcc -DMODULE -Wall -Wstrict-prototypes -O2 -c yellowfin.c -fomit-frame-pointer -fno-strength-reduce -mno-fp-regs -Wa,-m21164a -DBWX_USABLE -DBWIO_ENABLED"
+ *  simple-compile-command: "gcc -DMODULE -O6 -c yellowfin.c"
  *  c-indent-level: 4
  *  c-basic-offset: 4
  *  tab-width: 4
index f473c25b4762bc9fe3600482740afdecdb727188..36c9f790b2b594d7034df3ec5217d6db6381cabf 100644 (file)
@@ -39,10 +39,12 @@ LIST_HEAD(pci_devices);
 /**
  * pci_find_slot - locate PCI device from a given PCI slot
  * @bus: number of PCI bus on which desired PCI device resides
- * @devfn:  number of PCI slot in which desired PCI device resides
+ * @devfn: encodes number of PCI slot in which the desired PCI 
+ * device resides and the logical device number within that slot 
+ * in case of multi-function devices.
  *
- * Given a PCI bus and slot number, the desired PCI device is
- * located in system global list of PCI devices.  If the device
+ * Given a PCI bus and slot/function number, the desired PCI device 
+ * is located in system global list of PCI devices.  If the device
  * is found, a pointer to its data structure is returned.  If no 
  * device is found, %NULL is returned.
  */
@@ -58,7 +60,20 @@ pci_find_slot(unsigned int bus, unsigned int devfn)
        return NULL;
 }
 
-
+/**
+ * pci_find_subsys - begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id
+ * @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids
+ * @device: PCI device id to match, or %PCI_ANY_ID to match all vendor ids
+ * @ss_vendor: PCI subsystem vendor id to match, or %PCI_ANY_ID to match all vendor ids
+ * @ss_device: PCI subsystem device id to match, or %PCI_ANY_ID to match all vendor ids
+ * @from: Previous PCI device found in search, or %NULL for new search.
+ *
+ * Iterates through the list of known PCI devices.  If a PCI device is
+ * found with a matching @vendor, @device, @ss_vendor and @ss_device, a pointer to its
+ * device structure is returned.  Otherwise, %NULL is returned.
+ * A new search is initiated by passing %NULL to the @from argument.
+ * Otherwise if @from is not %NULL, searches continue from next device on the global list.
+ */
 struct pci_dev *
 pci_find_subsys(unsigned int vendor, unsigned int device,
                unsigned int ss_vendor, unsigned int ss_device,
@@ -88,9 +103,8 @@ pci_find_subsys(unsigned int vendor, unsigned int device,
  * Iterates through the list of known PCI devices.  If a PCI device is
  * found with a matching @vendor and @device, a pointer to its device structure is
  * returned.  Otherwise, %NULL is returned.
- *
  * A new search is initiated by passing %NULL to the @from argument.
- * Otherwise if @from is not null, searches continue from that point.
+ * Otherwise if @from is not %NULL, searches continue from next device on the global list.
  */
 struct pci_dev *
 pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev *from)
@@ -107,9 +121,8 @@ pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev *
  * Iterates through the list of known PCI devices.  If a PCI device is
  * found with a matching @class, a pointer to its device structure is
  * returned.  Otherwise, %NULL is returned.
- *
  * A new search is initiated by passing %NULL to the @from argument.
- * Otherwise if @from is not null, searches continue from that point.
+ * Otherwise if @from is not %NULL, searches continue from next device on the global list.
  */
 struct pci_dev *
 pci_find_class(unsigned int class, const struct pci_dev *from)
@@ -125,7 +138,28 @@ pci_find_class(unsigned int class, const struct pci_dev *from)
        return NULL;
 }
 
-
+/**
+ * pci_find_capability - query for devices' capabilities 
+ * @dev: PCI device to query
+ * @cap: capability code
+ *
+ * Tell if a device supports a given PCI capability.
+ * Returns the address of the requested capability structure within the device's PCI 
+ * configuration space or 0 in case the device does not support it.
+ * Possible values for @flags:
+ *
+ *  %PCI_CAP_ID_PM           Power Management 
+ *
+ *  %PCI_CAP_ID_AGP          Accelerated Graphics Port 
+ *
+ *  %PCI_CAP_ID_VPD          Vital Product Data 
+ *
+ *  %PCI_CAP_ID_SLOTID       Slot Identification 
+ *
+ *  %PCI_CAP_ID_MSI          Message Signalled Interrupts
+ *
+ *  %PCI_CAP_ID_CHSWP        CompactPCI HotSwap 
+ */
 int
 pci_find_capability(struct pci_dev *dev, int cap)
 {
@@ -274,12 +308,93 @@ pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge)
        return pin;
 }
 
+/**
+ *     pci_release_regions - Release reserved PCI I/O and memory resources
+ *     @pdev: PCI device whose resources were previously reserved by pci_request_regions
+ *
+ *     Releases all PCI I/O and memory resources previously reserved by a
+ *     successful call to pci_request_regions.  Call this function only
+ *     after all use of the PCI regions has ceased.
+ */
+void pci_release_regions(struct pci_dev *pdev)
+{
+       int i;
+       
+       for (i = 0; i < 6; i++) {
+               if (pci_resource_len(pdev, i) == 0)
+                       continue;
+
+               if (pci_resource_flags(pdev, i) & IORESOURCE_IO)
+                       release_region(pci_resource_start(pdev, i),
+                                      pci_resource_len(pdev, i));
+
+               else if (pci_resource_flags(pdev, i) & IORESOURCE_MEM)
+                       release_mem_region(pci_resource_start(pdev, i),
+                                          pci_resource_len(pdev, i));
+       }
+}
+
+/**
+ *     pci_request_regions - Reserved PCI I/O and memory resources
+ *     @pdev: PCI device whose resources are to be reserved
+ *
+ *     Mark all PCI regions associated with PCI device @pdev as
+ *     being reserved by owner @res_name.  Do not access any
+ *     address inside the PCI regions unless this call returns
+ *     successfully.
+ *
+ *     Returns 0 on success, or %EBUSY on error.  A warning
+ *     message is also printed on failure.
+ */
+int pci_request_regions(struct pci_dev *pdev, char *res_name)
+{
+       int i;
+       
+       for (i = 0; i < 6; i++) {
+               if (pci_resource_len(pdev, i) == 0)
+                       continue;
+
+               if (pci_resource_flags(pdev, i) & IORESOURCE_IO) {
+                       if (!request_region(pci_resource_start(pdev, i),
+                                           pci_resource_len(pdev, i), res_name))
+                               goto err_out;
+               }
+               
+               else if (pci_resource_flags(pdev, i) & IORESOURCE_MEM) {
+                       if (!request_mem_region(pci_resource_start(pdev, i),
+                                               pci_resource_len(pdev, i), res_name))
+                               goto err_out;
+               }
+       }
+       
+       return 0;
+
+err_out:
+       printk (KERN_WARNING "PCI: Unable to reserve %s region #%d:%lx@%lx for device %s\n",
+               pci_resource_flags(pdev, i) & IORESOURCE_IO ? "I/O" : "mem",
+               i + 1, /* PCI BAR # */
+               pci_resource_len(pdev, i), pci_resource_start(pdev, i),
+               pdev->slot_name);
+       pci_release_regions(pdev);
+       return -EBUSY;
+}
+
+
 /*
  *  Registration of PCI drivers and handling of hot-pluggable devices.
  */
 
 static LIST_HEAD(pci_drivers);
 
+/**
+ * pci_match_device - Tell if a PCI device structure has a matching PCI device
+ * @ids: array of PCI device id structures to search in
+ * @dev: the PCI device structure to match against
+ *
+ * Used by a driver to check whether a PCI device present in the
+ * system is in its list of supported devices.Returns the matching
+ * pci_device_id structure or %NULL if there is no match.
+ */
 const struct pci_device_id *
 pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev)
 {
@@ -320,6 +435,14 @@ out:
        return ret;
 }
 
+/**
+ * pci_register_driver - register a new pci driver
+ * @drv: the driver structure to register
+ * 
+ * Adds the driver structure to the list of registered drivers
+ * Returns the number of pci devices which were claimed by the driver
+ * during registration.
+ */
 int
 pci_register_driver(struct pci_driver *drv)
 {
@@ -334,6 +457,15 @@ pci_register_driver(struct pci_driver *drv)
        return count;
 }
 
+/**
+ * pci_unregister_driver - unregister a pci driver
+ * @drv: the driver structure to unregister
+ * 
+ * Deletes the driver structure from the list of registered PCI drivers,
+ * gives it a chance to clean up and marks the devices for which it
+ * was responsible as driverless.
+ */
+
 void
 pci_unregister_driver(struct pci_driver *drv)
 {
@@ -395,6 +527,13 @@ run_sbin_hotplug(struct pci_dev *pdev, int insert)
        call_usermodehelper (argv [0], argv, envp);
 }
 
+/**
+ * pci_insert_device - insert a hotplug device
+ * @dev: the device to insert
+ * @bus: where to insert it
+ *
+ * Add a new device to the device lists and notify userspace (/sbin/hotplug).
+ */
 void
 pci_insert_device(struct pci_dev *dev, struct pci_bus *bus)
 {
@@ -427,6 +566,13 @@ pci_free_resources(struct pci_dev *dev)
        }
 }
 
+/**
+ * pci_remove_device - remove a hotplug device
+ * @dev: the device to remove
+ *
+ * Delete the device structure from the device lists and 
+ * notify userspace (/sbin/hotplug).
+ */
 void
 pci_remove_device(struct pci_dev *dev)
 {
@@ -452,6 +598,13 @@ static struct pci_driver pci_compat_driver = {
        name: "compat"
 };
 
+/**
+ * pci_dev_driver - get the pci_driver of a device
+ * @dev: the device to query
+ *
+ * Returns the appropriate pci_driver structure or %NULL if there is no 
+ * registered driver for the device.
+ */
 struct pci_driver *
 pci_dev_driver(const struct pci_dev *dev)
 {
@@ -503,7 +656,13 @@ PCI_OP(write, byte, u8)
 PCI_OP(write, word, u16)
 PCI_OP(write, dword, u32)
 
-
+/**
+ * pci_set_master - enables bus-mastering for device dev
+ * @dev: the PCI device to enable
+ *
+ * Enables bus-mastering on the device and calls pcibios_set_master()
+ * to do the needed arch specific settings.
+ */
 void
 pci_set_master(struct pci_dev *dev)
 {
@@ -837,8 +996,15 @@ static void pci_read_irq(struct pci_dev *dev)
        dev->irq = irq;
 }
 
-/*
- * Fill in class and map information of a device
+/**
+ * pci_setup_device - fill in class and map information of a device
+ * @dev: the device structure to fill
+ *
+ * Initialize the device structure with information about the device's 
+ * vendor,class,memory and IO-space addresses,IRQ lines etc.
+ * Called at initialisation of the PCI subsystem and by CardBus services.
+ * Returns 0 on success and -1 if unknown type of device (not normal, bridge
+ * or CardBus).
  */
 int pci_setup_device(struct pci_dev * dev)
 {
index 24dc79b7e6e00b4e9c12d6c0f14c2ce88e3d8b8f..bcf21734f33c55a37fd2b74ba368c5bfea6364a9 100644 (file)
@@ -1437,7 +1437,7 @@ tape34xx_default_handler (tape_info_t * tape)
     debug_text_event (tape_debug_area,6,"xdefhandle");
 #endif /* TAPE_DEBUG */
        tapestate_set (tape, TS_FAILED);
-       PRINT_ERR ("TAPE34XX: An unexpected Unit Check occured.\n");
+       PRINT_ERR ("TAPE34XX: An unexpected Unit Check occurred.\n");
        PRINT_ERR ("TAPE34XX: Please read Documentation/s390/TAPE and report it!\n");
        PRINT_ERR ("TAPE34XX: Current state is: %s",
                   (((tapestate_get (tape) < TS_SIZE) && (tapestate_get (tape) >= 0)) ?
@@ -1804,7 +1804,7 @@ tape34xx_rew_release_init_error (tape_info_t * tape)
                tape->wanna_wakeup=1;
                wake_up (&tape->wq);
        } else {
-               PRINT_ERR ("TAPE34XX: An unexpected Unit Check occured.\n");
+               PRINT_ERR ("TAPE34XX: An unexpected Unit Check occurred.\n");
                PRINT_ERR ("TAPE34XX: Please send the following 20 lines of output to cotte@de.ibm.com\n");
                PRINT_ERR ("TAPE34XX: Current state is: %s",
                           (((tapestate_get (tape) < TS_SIZE) && (tapestate_get (tape) >= 0)) ?
index 0debc87280e151a68c5156fa0ae2dba87bf0df94..f84fd2c4792647d7666cd4bdb6e331c008cf92e9 100644 (file)
@@ -884,7 +884,7 @@ static void inline ccw_check_unit_check (net_device *dev, char sense)
                 if (sense & 0x01) 
                         printk(KERN_DEBUG "%s: Interface disconnect or Selective reset occurred (remote side)\n", dev->name);
                 else 
-                        printk(KERN_DEBUG "%s: System reset occured (remote side)\n", dev->name);
+                        printk(KERN_DEBUG "%s: System reset occurred (remote side)\n", dev->name);
 #endif
         } else if (sense & 0x20) {
                 if (sense & 0x04)
index 33ee8a550ff8982ac65f117faa6cdee00fc3f576..b9f5eb9b5eb6a474b2781c0f7f5b4c1b00fede88 100644 (file)
@@ -139,7 +139,7 @@ void s390_do_machine_check( void )
 #endif
 
        memcpy( &mcic,
-               &S390_lowcore.mcck_interuption_code,
+               &S390_lowcore.mcck_interruption_code,
                sizeof(__u64));
                
        if ( mcic.mcc.mcd.cp )  // CRW pending ?
index 0a3db13f82b213bd63a3ae4d1d766371dc2a559c..61fea7c76b234596b45f905147d0da30a1a26bfe 100644 (file)
@@ -1573,6 +1573,8 @@ int tw_scsi_biosparam(Disk *disk, kdev_t dev, int geom[])
 /* This function will find and initialize any cards */
 int tw_scsi_detect(Scsi_Host_Template *tw_host)
 {
+       int ret;
+       
        dprintk(KERN_NOTICE "3w-xxxx: tw_scsi_detect()\n");
 
        /* Check if the kernel has PCI interface compiled in */
@@ -1581,7 +1583,11 @@ int tw_scsi_detect(Scsi_Host_Template *tw_host)
                return 0;
        }
 
-       return(tw_findcards(tw_host));
+       spin_unlock_irq(&io_request_lock);
+       ret = tw_findcards(tw_host);
+       spin_lock_irq(&io_request_lock);
+       
+       return ret;
 } /* End tw_scsi_detect() */
 
 /* This is the new scsi eh abort function */
index 2c781a709932c028690e0874dff8a6160e0fb0f1..dd3139793e3e774b46a8ad6162c66a9a8512c220 100644 (file)
@@ -289,7 +289,7 @@ typedef struct TAG_TW_Device_Extension {
        unsigned short          aen_queue[TW_Q_LENGTH];
        unsigned char           aen_head;
        unsigned char           aen_tail;
-       u32                     flags;
+       long                    flags; /* long req'd for set_bit --RR */
 } TW_Device_Extension;
 
 /* Function prototypes */
index 5069c33cb74b2d33986155e3740cde3d54deceb1..58bbb70949c8c83caa6e7ffd8707821a19db21d7 100644 (file)
@@ -184,13 +184,13 @@ static  int  irq_probe(void);
 /* ================================================================= */
 
 #if USE_BIOS
-static void *bios_base = (void *)0;
+static void *bios_base;
 #endif
 
 #if PORT_BASE
 static int   port_base = PORT_BASE;
 #else
-static int   port_base = 0;
+static int   port_base;
 #endif
 
 #if IRQ_LEV
@@ -200,16 +200,16 @@ static int   irq_level = -1; /* 0 is 'no irq', so use -1 for 'uninitialized'*/
 #endif
 
 #if USE_DMA
-static int   dma_chan = 0;
+static int   dma_chan;
 #endif
 
 #if USE_PIO
 static int   fast_pio = USE_FAST_PIO;
 #endif
 
-static Scsi_Cmnd         *current_SC       = NULL;
-static volatile int internal_done_flag = 0;
-static volatile int internal_done_errcode = 0;
+static Scsi_Cmnd         *current_SC;
+static volatile int internal_done_flag;
+static volatile int internal_done_errcode;
 static char info_msg[256];
 
 /* ================================================================= */
@@ -484,17 +484,17 @@ NCR53c406a_detect(Scsi_Host_Template * tpnt){
 #endif USE_BIOS
     
 #ifdef PORT_BASE
-    if (check_region(port_base, 0x10)) /* ports already snatched */
+    if (!request_region(port_base, 0x10, "NCR53c406a")) /* ports already snatched */
         port_base = 0;
     
 #else  /* autodetect */
     if (port_base) {           /* LILO override */
-        if (check_region(port_base, 0x10))
+        if (!request_region(port_base, 0x10, "NCR53c406a"))
             port_base = 0;
     }
     else {
         for(i=0;  i<PORT_COUNT && !port_base; i++){
-            if(check_region(ports[i], 0x10)){
+            if(!request_region(ports[i], 0x10, "NCR53c406a")){
                 DEB(printk("NCR53c406a: port %x in use\n", ports[i]));
             }
             else {
@@ -503,9 +503,10 @@ NCR53c406a_detect(Scsi_Host_Template * tpnt){
                 if(   (inb(ports[i] + 0x0e) ^ inb(ports[i] + 0x0e)) == 7
                    && (inb(ports[i] + 0x0e) ^ inb(ports[i] + 0x0e)) == 7
                    && (inb(ports[i] + 0x0e) & 0xf8) == 0x58 ) {
+                    port_base = ports[i];
                     VDEB(printk("NCR53c406a: Sig register valid\n"));
                     VDEB(printk("port_base=%x\n", port_base));
-                    port_base = ports[i];
+                    break;
                 }
             }
         }
@@ -527,18 +528,17 @@ NCR53c406a_detect(Scsi_Host_Template * tpnt){
         irq_level=irq_probe();
         if (irq_level < 0) {           /* Trouble */
             printk("NCR53c406a: IRQ problem, irq_level=%d, giving up\n", irq_level);
-            return 0;
+            goto err_release;
         }
     }
 #endif
     
     DEB(printk("NCR53c406a: using port_base %x\n", port_base));
-    request_region(port_base, 0x10, "NCR53c406a");
     
     if(irq_level > 0) {
         if(request_irq(irq_level, do_NCR53c406a_intr, 0, "NCR53c406a", NULL)){
             printk("NCR53c406a: unable to allocate IRQ %d\n", irq_level);
-            return 0;
+            goto err_release;
         }
         tpnt->can_queue = 1;
         DEB(printk("NCR53c406a: allocated IRQ %d\n", irq_level));
@@ -548,19 +548,19 @@ NCR53c406a_detect(Scsi_Host_Template * tpnt){
         DEB(printk("NCR53c406a: No interrupts detected\n"));
 #if USE_DMA
         printk("NCR53c406a: No interrupts found and DMA mode defined. Giving up.\n");
-        return 0;
+        goto err_release;
 #endif USE_DMA
     }
     else {
         DEB(printk("NCR53c406a: Shouldn't get here!\n"));
-        return 0;
+        goto err_free_irq;
     }
     
 #if USE_DMA
     dma_chan = DMA_CHAN;
     if(request_dma(dma_chan, "NCR53c406a") != 0){
         printk("NCR53c406a: unable to allocate DMA channel %d\n", dma_chan);
-        return 0;
+        goto err_release;
     }
     
     DEB(printk("Allocated DMA channel %d\n", dma_chan));
@@ -570,6 +570,10 @@ NCR53c406a_detect(Scsi_Host_Template * tpnt){
     tpnt->proc_name = "NCR53c406a";
     
     shpnt = scsi_register(tpnt, 0);
+    if (!shpnt) {
+            printk("NCR53c406a: Unable to register host, giving up.\n");
+            goto err_free_dma;
+    }
     shpnt->irq = irq_level;
     shpnt->io_port = port_base;
     shpnt->n_io_port = 0x10;
@@ -586,6 +590,17 @@ NCR53c406a_detect(Scsi_Host_Template * tpnt){
 #endif
     
     return (tpnt->present);
+
+
+ err_free_dma:
+#if USE_DMA
+    free_dma(dma_chan);
+#endif
+ err_free_irq:
+    free_irq(irq_level, do_NCR53c406a_intr);
+ err_release:
+    release_region(port_base, 0x10);
+    return 0;
 }
 
 /* called from init/main.c */
index b369c0618b1beb624460e3fe2b8e3505f597ed42..0d30d1f315741da224253f79c940205557abe097 100644 (file)
@@ -68,19 +68,18 @@ int __init dmx3191d_detect(Scsi_Host_Template *tmpl) {
        while ((pdev = pci_find_device(PCI_VENDOR_ID_DOMEX,
                        PCI_DEVICE_ID_DOMEX_DMX3191D, pdev))) {
 
-               unsigned long port = pci_resource_start (pdev, 0);
-
+               unsigned long port;
                if (pci_enable_device(pdev))
                        continue;
 
-               if (check_region(port, DMX3191D_REGION)) {
+               port = pci_resource_start (pdev, 0);
+               
+               if (!request_region(port, DMX3191D_REGION, DMX3191D_DRIVER_NAME)) {
                        dmx3191d_printk("region 0x%lx-0x%lx already reserved\n",
                                port, port + DMX3191D_REGION);
                        continue;
                }
 
-               request_region(port, DMX3191D_REGION, DMX3191D_DRIVER_NAME);
-
                instance = scsi_register(tmpl, sizeof(struct NCR5380_hostdata));
                if(instance == NULL)
                {
index 7e2258624fe2816baef3fbff76faca13d1203d71..5f99eb41c5f2152ab7e774fce82ce35c572813b6 100644 (file)
@@ -206,7 +206,7 @@ static awe_chan_info channels[AWE_MAX_CHANNELS];
 int io = AWE_DEFAULT_BASE_ADDR; /* Emu8000 base address */
 int memsize = AWE_DEFAULT_MEM_SIZE; /* memory size in Kbytes */
 #if defined CONFIG_ISAPNP || defined CONFIG_ISAPNP_MODULE
-static int isapnp = 1;
+static int isapnp = -1;
 #else
 static int isapnp = 0;
 #endif
@@ -4843,10 +4843,12 @@ awe_detect(void)
        if (isapnp) {
                if (awe_probe_isapnp(&io) < 0) {
                        printk(KERN_ERR "AWE32: No ISAPnP cards found\n");
-                       return 0;
+                       if (isapnp != -1)
+                         return 0;
+               } else {
+                       setup_ports(io, 0, 0);
+                       return 1;
                }
-               setup_ports(io, 0, 0);
-               return 1;
        }
 #endif /* isapnp */
 
index 32d55cb7661a17f3aff4baecc3efbcef7b3c1c7a..5552d5f803149099821e723ce4251ec53010fa67 100644 (file)
@@ -1427,7 +1427,7 @@ ess_play_setup(struct ess_state *ess, int mode, u32 rate, void *buffer, int size
                        apu_set_register(ess, channel, 10, 0x8F08);
        }
        
-       /* clear WP interupts */
+       /* clear WP interrupts */
        outw(1, ess->card->iobase+0x04);
        /* enable WP ints */
        outw(inw(ess->card->iobase+0x18)|4, ess->card->iobase+0x18);
@@ -1559,7 +1559,7 @@ ess_rec_setup(struct ess_state *ess, int mode, u32 rate, void *buffer, int size)
                apu_set_register(ess, channel, 11, route);
        }
        
-       /* clear WP interupts */
+       /* clear WP interrupts */
        outw(1, ess->card->iobase+0x04);
        /* enable WP ints */
        outw(inw(ess->card->iobase+0x18)|4, ess->card->iobase+0x18);
@@ -3446,10 +3446,10 @@ maestro_install(struct pci_dev *pcidev, int card_type)
                printk(KERN_INFO "maestro: not attempting power management.\n");
        else {
                if(!parse_power(card,pcidev)) 
-                       printk(KERN_INFO "maestro: no PCI power managment interface found.\n");
+                       printk(KERN_INFO "maestro: no PCI power management interface found.\n");
                else {
                        pci_read_config_dword(pcidev, card->power_regs, &n);
-                       printk(KERN_INFO "maestro: PCI power managment capability: 0x%x\n",n>>16);
+                       printk(KERN_INFO "maestro: PCI power management capability: 0x%x\n",n>>16);
                }       
        }
 
index 5a644ddc56fabe8a43fad4b1f015004f31bf5037..f66d08b1b262c6ad1dae23a4b2e0c65cb1cb0b06 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 
-#define VIA_VERSION    "1.1.14a"
+#define VIA_VERSION    "1.1.14b"
 
 
 #include <linux/config.h>
@@ -282,6 +282,8 @@ struct via_info {
 
        unsigned rev_h : 1;
 
+       int locked_rate : 1;
+
        struct semaphore syscall_sem;
        struct semaphore open_sem;
 
@@ -508,10 +510,16 @@ static void via_stop_everything (struct via_info *card)
 static int via_set_rate (struct ac97_codec *ac97,
                         struct via_channel *chan, unsigned rate)
 {
+       struct via_info *card = ac97->private_data;
        int rate_reg;
 
        DPRINTK ("ENTER, rate = %d\n", rate);
 
+       if (card->locked_rate) {
+               chan->rate = 48000;
+               goto out;
+       }
+
        if (rate > 48000)               rate = 48000;
        if (rate < 4000)                rate = 4000;
 
@@ -535,6 +543,13 @@ static int via_set_rate (struct ac97_codec *ac97,
         */
        chan->rate = via_ac97_read_reg (ac97, rate_reg);
 
+       if (chan->rate == 0) {
+               card->locked_rate = 1;
+               chan->rate = 48000;
+               printk (KERN_WARNING PFX "Codec rate locked at 48Khz\n");
+       }
+
+out:
        DPRINTK ("EXIT, returning rate %d Hz\n", chan->rate);
        return chan->rate;
 }
@@ -1421,15 +1436,19 @@ static int __init via_ac97_reset (struct via_info *card)
        /* WARNING: this line is magic.  Remove this
         * and things break. */
        /* enable variable rate, variable rate MIC ADC */
-       tmp16 = via_ac97_read_reg (&card->ac97, 0x2A);
-       via_ac97_write_reg (&card->ac97, 0x2A, tmp16 | (1<<0));
-
-       pci_read_config_byte (pdev, VIA_ACLINK_CTRL, &tmp8);
-       if ((tmp8 & (VIA_CR41_AC97_ENABLE | VIA_CR41_AC97_RESET)) == 0) {
-               printk (KERN_ERR PFX "cannot enable AC97 controller, aborting\n");
-               DPRINTK ("EXIT, tmp8=%X, returning -ENODEV\n", tmp8);
-               return -ENODEV;
-       }
+       /*
+        * If we cannot enable VRA, we have a locked-rate codec.
+        * We try again to enable VRA before assuming so, however.
+        */
+       tmp16 = via_ac97_read_reg (&card->ac97, AC97_EXTENDED_STATUS);
+       if ((tmp16 & 1) == 0) {
+               via_ac97_write_reg (&card->ac97, AC97_EXTENDED_STATUS, tmp16 | 1);
+               tmp16 = via_ac97_read_reg (&card->ac97, AC97_EXTENDED_STATUS);
+               if ((tmp16 & 1) == 0) {
+                       card->locked_rate = 1;
+                       printk (KERN_WARNING PFX "Codec rate locked at 48Khz\n");
+               }
+       }
 
        DPRINTK ("EXIT, returning 0\n");
        return 0;
@@ -1478,8 +1497,8 @@ static int __init via_ac97_init (struct via_info *card)
        }
 
        /* enable variable rate, variable rate MIC ADC */
-       tmp16 = via_ac97_read_reg (&card->ac97, 0x2A);
-       via_ac97_write_reg (&card->ac97, 0x2A, tmp16 | (1<<0));
+       tmp16 = via_ac97_read_reg (&card->ac97, AC97_EXTENDED_STATUS);
+       via_ac97_write_reg (&card->ac97, AC97_EXTENDED_STATUS, tmp16 | 1);
 
        DPRINTK ("EXIT, returning 0\n");
        return 0;
index accc16ccf1fe49421bb464160a020f3127fb42c3..f0d9676b5835c0ac2ab9e68af30b448415d92f4c 100644 (file)
@@ -94,7 +94,7 @@
 #ifdef CONFIG_SMP
 #define LOOPS_PER_TICK cpu_data[smp_processor_id()].loops_per_jiffy
 #else
-#define LOOPS_PER_TICK loops_per_sec
+#define LOOPS_PER_TICK loops_per_jiffy
 #endif
 #endif
 
@@ -693,7 +693,7 @@ wavefront_cmd (int cmd, unsigned char *rbuf, unsigned char *wbuf)
 /***********************************************************************
 WaveFront: data munging   
 
-Things here are wierd. All data written to the board cannot 
+Things here are weird. All data written to the board cannot 
 have its most significant bit set. Any data item with values 
 potentially > 0x7F (127) must be split across multiple bytes.
 
@@ -702,7 +702,7 @@ the x86 side as 8-32 bit values. Sometimes, we need to munge data
 that is represented on the x86 side as an array of bytes. The most
 efficient approach to handling both cases seems to be to use 2
 different functions for munging and 2 for de-munging. This avoids
-wierd casting and worrying about bit-level offsets.
+weird casting and worrying about bit-level offsets.
 
 **********************************************************************/
 
@@ -1213,7 +1213,7 @@ wavefront_send_sample (wavefront_patch_info *header,
        shptr = munge_int32 (*((UINT32 *) &header->hdr.s.sampleEndOffset),
                             shptr, 4);
        
-       /* This one is truly wierd. What kind of wierdo decided that in
+       /* This one is truly weird. What kind of weirdo decided that in
           a system dominated by 16 and 32 bit integers, they would use
           a just 12 bits ?
        */
@@ -3069,7 +3069,7 @@ wffx_ioctl (wavefront_fx_info *r)
    This code was developed using DOSEMU. The Turtle Beach SETUPSND
    utility was run with I/O tracing in DOSEMU enabled, and a reconstruction
    of the port I/O done, using the Yamaha faxback document as a guide
-   to add more logic to the code. Its really pretty wierd.
+   to add more logic to the code. Its really pretty weird.
 
    There was an alternative approach of just dumping the whole I/O
    sequence as a series of port/value pairs and a simple loop
index 07b7d186c78461b6e9c2d5e02979d31bd0f96ec9..fab5c9712d26b9e0ac3a28d3ea3c15955700f3cf 100644 (file)
@@ -94,34 +94,6 @@ static struct pci_device_id ymf_id_tbl[] __devinitdata = {
 };
 MODULE_DEVICE_TABLE(pci, ymf_id_tbl);
 
-/*
- * Mindlessly copied from cs46xx XXX
- */
-static inline unsigned ld2(unsigned int x)
-{
-       unsigned r = 0;
-       
-       if (x >= 0x10000) {
-               x >>= 16;
-               r += 16;
-       }
-       if (x >= 0x100) {
-               x >>= 8;
-               r += 8;
-       }
-       if (x >= 0x10) {
-               x >>= 4;
-               r += 4;
-       }
-       if (x >= 4) {
-               x >>= 2;
-               r += 2;
-       }
-       if (x >= 2)
-               r++;
-       return r;
-}
-
 /*
  *  common I/O routines
  */
@@ -347,7 +319,6 @@ static int prog_dmabuf(struct ymf_state *state, int rec)
 {
        struct ymf_dmabuf *dmabuf;
        int w_16;
-       unsigned bytepersec;
        unsigned bufsize;
        unsigned long flags;
        int redzone;
@@ -367,20 +338,16 @@ static int prog_dmabuf(struct ymf_state *state, int rec)
                if ((ret = alloc_dmabuf(dmabuf)))
                        return ret;
 
-       bytepersec = state->format.rate << state->format.shift;
-
        /*
         * Create fake fragment sizes and numbers for OSS ioctls.
+        * Import what Doom might have set with SNDCTL_DSP_SETFRAGMENT.
         */
        bufsize = PAGE_SIZE << dmabuf->buforder;
-       if (dmabuf->ossfragshift) {
-               if ((1000 << dmabuf->ossfragshift) < bytepersec)
-                       dmabuf->fragshift = ld2(bytepersec/1000);
-               else
-                       dmabuf->fragshift = dmabuf->ossfragshift;
-       } else {
-               /* lets hand out reasonable big ass buffers by default */
-               dmabuf->fragshift = (dmabuf->buforder + PAGE_SHIFT -2);
+       /* lets hand out reasonable big ass buffers by default */
+       dmabuf->fragshift = (dmabuf->buforder + PAGE_SHIFT -2);
+       if (dmabuf->ossfragshift > 3 &&
+           dmabuf->ossfragshift < dmabuf->fragshift) {
+               dmabuf->fragshift = dmabuf->ossfragshift;
        }
        dmabuf->numfrag = bufsize >> dmabuf->fragshift;
        while (dmabuf->numfrag < 4 && dmabuf->fragshift > 3) {
@@ -390,9 +357,6 @@ static int prog_dmabuf(struct ymf_state *state, int rec)
        dmabuf->fragsize = 1 << dmabuf->fragshift;
        dmabuf->dmasize = dmabuf->numfrag << dmabuf->fragshift;
 
-       /*
-        * Import what Doom might have set with SNDCTL_DSD_SETFRAGMENT.
-        */
        if (dmabuf->ossmaxfrags >= 2 && dmabuf->ossmaxfrags < dmabuf->numfrag) {
                dmabuf->numfrag = dmabuf->ossmaxfrags;
                dmabuf->dmasize = dmabuf->numfrag << dmabuf->fragshift;
@@ -1726,8 +1690,6 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
                        dmabuf->ossfragshift = 4;
                if (dmabuf->ossfragshift > 15)
                        dmabuf->ossfragshift = 15;
-               if (dmabuf->ossmaxfrags < 4)
-                       dmabuf->ossmaxfrags = 4;
                return 0;
 
        case SNDCTL_DSP_GETOSPACE:
@@ -2370,9 +2332,9 @@ static int __devinit ymf_probe_one(struct pci_dev *pcidev, const struct pci_devi
 
        int err;
 
-       if (pci_enable_device(pcidev) < 0) {
+       if ((err = pci_enable_device(pcidev)) != 0) {
                printk(KERN_ERR "ymfpci: pci_enable_device failed\n");
-               return -ENODEV;
+               return err;
        }
 
        if ((codec = kmalloc(sizeof(ymfpci_t), GFP_KERNEL)) == NULL) {
index 83ba97166647b2c16656148384b02e42032edae9..ff11b6e9b31eb20f5a5a09c35ec1f437d7fb2f14 100644 (file)
@@ -385,6 +385,12 @@ struct super_block *adfs_read_super(struct super_block *sb, void *data, int sile
        sb->u.adfs_sb.s_size     = adfs_discsize(dr, sb->s_blocksize_bits);
        sb->u.adfs_sb.s_version  = dr->format_version;
        sb->u.adfs_sb.s_log2sharesize = dr->log2sharesize;
+       
+       /*
+        * Max file size is 2Gb
+        */
+        
+       sb->s_maxbytes = MAX_NON_LFS;
 
        sb->u.adfs_sb.s_map = adfs_read_map(sb, dr);
        if (!sb->u.adfs_sb.s_map)
index c77c3410ca381ae41bb4903e25fe776d3f64ea38..78aa9837291330ffe5bab5ac330d6988f8efa40e 100644 (file)
@@ -415,6 +415,12 @@ got_root:
 
        s->s_flags |= MS_NODEV | MS_NOSUID;
 
+       /*
+        * Max file size is 2Gb
+        */
+        
+       s->s_maxbytes = MAX_NON_LFS;
+
        /* Keep super block in cache */
        bb = affs_bread(dev,root_block,s->s_blocksize);
        if (!bb)
index 8e33b4ab2a023edb322cff3c7e916f4aa7e438a7..ce6e778ebf3522f0d9901a54ba82faf27f0eeefb 100644 (file)
@@ -250,6 +250,7 @@ static struct super_block * bfs_read_super(struct super_block * s,
        set_blocksize(dev, BFS_BSIZE);
        s->s_blocksize = BFS_BSIZE;
        s->s_blocksize_bits = BFS_BSIZE_BITS;
+       s->s_maxbytes = MAX_NON_LFS;
 
        bh = bread(dev, 0, BFS_BSIZE);
        if(!bh)
index 3cf258a2359c948daf349f577be80682d53a56ed..4897e4ad1f62b90e69ca4bbc62aaea5075437931 100644 (file)
@@ -141,6 +141,7 @@ static struct super_block * coda_read_super(struct super_block *sb,
         sb->s_magic = CODA_SUPER_MAGIC;
         sb->s_dev = dev;
         sb->s_op = &coda_super_operations;
+       sb->s_maxbytes = MAX_NON_LFS;
 
        /* get root fid from Venus: this needs the root inode */
        error = venus_rootfid(sb, &fid);
index 3ce1b2e01453303c92f910db2245cb6b987ac7f4..6c937c81378aa60180405ce001eaaa6dabbee23c 100644 (file)
@@ -194,9 +194,9 @@ static struct super_block * cramfs_read_super(struct super_block *sb, void *data
 
        /* Set it all up.. */
        sb->s_op        = &cramfs_ops;
-       sb->s_root = d_alloc_root(get_cramfs_inode(sb, &super.root));
+       sb->s_root      = d_alloc_root(get_cramfs_inode(sb, &super.root));
+       sb->s_maxbytes = MAX_NON_LFS;
        retval = sb;
-
 out:
        return retval;
 }
index 04b5fe91d3c295ad283c361a92eb9b71c8625b8b..07398d6bb63ed6d3978c7a1bc771e26de08691c8 100644 (file)
@@ -178,6 +178,8 @@ struct super_block *efs_read_super(struct super_block *s, void *d, int silent) {
        s->s_magic              = EFS_SUPER_MAGIC;
        s->s_blocksize          = EFS_BLOCKSIZE;
        s->s_blocksize_bits     = EFS_BLOCKSIZE_BITS;
+       s->s_maxbytes           = MAX_NON_LFS;
+
        if (!(s->s_flags & MS_RDONLY)) {
 #ifdef DEBUG
                printk(KERN_INFO "EFS: forcing read-only mode\n");
index a39710f098f7248cf2f221ef3cfaa79e5556c1c3..a88a705a5073364c8c92b644bf45535dcdb85532 100644 (file)
@@ -436,6 +436,7 @@ struct super_block *hfs_read_super(struct super_block *s, void *data,
                goto bail1;
        }
 
+       s->s_maxbytes = MAX_NON_LFS;
        s->s_magic = HFS_SUPER_MAGIC;
        s->s_blocksize_bits = HFS_SECTOR_SIZE_BITS;
        s->s_blocksize = HFS_SECTOR_SIZE;
index a5db0acd3132d9a3b704a5e46f37ede5874f0240..08ac667726878c9c441405f8367b7fdbf1e6860d 100644 (file)
@@ -427,6 +427,7 @@ struct super_block *hpfs_read_super(struct super_block *s, void *options,
        s->s_blocksize = 512;
        s->s_blocksize_bits = 9;
        s->s_op = &hpfs_sops;
+       s->s_maxbytes = MAX_NON_LFS;
 
        s->s_hpfs_root = superblock->root;
        s->s_hpfs_fs_size = superblock->n_sectors;
index 90f511bdadb6550a264e8cf05087fda200f7f8d9..68741046a35f72425f94f0e01ab844bc57c8aab6 100644 (file)
@@ -616,7 +616,7 @@ root_found:
 #ifndef IGNORE_WRONG_MULTI_VOLUME_SPECS
          if (isonum_723 (h_pri->volume_set_size) != 1)
                goto out_no_support;
-#endif IGNORE_WRONG_MULTI_VOLUME_SPECS
+#endif /* IGNORE_WRONG_MULTI_VOLUME_SPECS */
          s->u.isofs_sb.s_nzones = isonum_733 (h_pri->volume_space_size);
          s->u.isofs_sb.s_log_zone_size = isonum_723 (h_pri->logical_block_size);
          s->u.isofs_sb.s_max_size = isonum_733(h_pri->volume_space_size);
@@ -625,7 +625,7 @@ root_found:
 #ifndef IGNORE_WRONG_MULTI_VOLUME_SPECS
          if (isonum_723 (pri->volume_set_size) != 1)
                goto out_no_support;
-#endif IGNORE_WRONG_MULTI_VOLUME_SPECS
+#endif /* IGNORE_WRONG_MULTI_VOLUME_SPECS */
          s->u.isofs_sb.s_nzones = isonum_733 (pri->volume_space_size);
          s->u.isofs_sb.s_log_zone_size = isonum_723 (pri->logical_block_size);
          s->u.isofs_sb.s_max_size = isonum_733(pri->volume_space_size);
@@ -663,6 +663,11 @@ root_found:
 
        s->s_flags |= MS_RDONLY /* | MS_NODEV | MS_NOSUID */;
 
+       /* Set this for reference. Its not currently used except on write
+          which we don't have .. */
+          
+       s->s_maxbytes = MAX_NON_LFS;
+
        /* RDE: data zone now byte offset! */
 
        first_data_zone = ((isonum_733 (rootp->extent) +
index d044ef3a377aee2720761a4ceba1ec610dff854d..f80193e7da80d5208ae5c0852a1b07e6aa9703ef 100644 (file)
@@ -10,8 +10,8 @@
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * $Id: inode-v23.c,v 1.43 2000/08/22 08:00:22 dwmw2 Exp $
- *
+ * $Id: inode-v23.c,v 1.43.2.6 2001/01/09 00:32:48 dwmw2 Exp $
+ * + sb_maxbytes / generic_file_open() fixes for 2.4.0-ac4
  *
  * Ported to Linux 2.3.x and MTD:
  * Copyright (C) 2000  Alexander Larsson (alex@cendio.se), Cendio Systems AB
@@ -84,6 +84,7 @@ jffs_read_super(struct super_block *sb, void *data, int silent)
        sb->s_blocksize = PAGE_CACHE_SIZE;
        sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
        sb->u.generic_sbp = (void *) 0;
+       sb->s_maxbytes = 0xFFFFFFFF;
 
        /* Build the file system.  */
        if (jffs_build_fs(sb) < 0) {
index d3069982636873e536431aba25f5e32440e41909..db6168073f173e3ccb8c34f0afb20603a779e2ed 100644 (file)
@@ -259,6 +259,9 @@ static struct super_block *minix_read_super(struct super_block *s, void *data,
 
        minix_set_bit(0,s->u.minix_sb.s_imap[0]->b_data);
        minix_set_bit(0,s->u.minix_sb.s_zmap[0]->b_data);
+
+       s->s_maxbytes = MAX_NON_LFS;
+
        /* set up enough so that it can read an inode */
        s->s_op = &minix_sops;
        root_inode = iget(s, MINIX_ROOT_INO);
index 6cb6e863f2e193df150137a83d5bc1ce5646ad0d..d839cbf0d062a6c9f0a5c887fc018ea9b24b2e01 100644 (file)
@@ -327,6 +327,7 @@ ncp_read_super(struct super_block *sb, void *raw_data, int silent)
        else
                default_bufsize = 1024;
 
+       sb->s_maxbytes = MAX_NON_LFS;
        sb->s_blocksize = 1024; /* Eh...  Is this correct? */
        sb->s_blocksize_bits = 10;
        sb->s_magic = NCP_SUPER_MAGIC;
index a48e711f55eb42402e067bcc24fcf4769adbd317..abd08eebc0e7997e1a07d4f2d0a69e10131b8ffe 100644 (file)
@@ -434,6 +434,11 @@ nfs_read_super(struct super_block *sb, void *raw_data, int silent)
         if (server->namelen == 0 || server->namelen > maxlen)
                 server->namelen = maxlen;
 
+       if(version == 2)
+               sb->s_maxbytes = MAX_NON_LFS;
+       else
+               sb->s_maxbytes = ~0ULL; /* Unlimited on NFSv3 */
+
        /* Fire up the writeback cache */
        if (nfs_reqlist_alloc(server) < 0) {
                printk(KERN_NOTICE "NFS: cannot initialize writeback cache.\n");
index 3453bf88b7d270365244b9e627803e63810277f5..2e99938b1da3e6a85880e04d978a3159c7175ac7 100644 (file)
@@ -188,6 +188,8 @@ struct super_block *proc_read_super(struct super_block *s,void *data,
        s->s_blocksize_bits = 10;
        s->s_magic = PROC_SUPER_MAGIC;
        s->s_op = &proc_sops;
+       s->s_maxbytes = MAX_NON_LFS;
+       
        root_inode = proc_get_inode(s, PROC_ROOT_INO, &proc_root);
        if (!root_inode)
                goto out_no_root;
index 490c3d047ed0473eb2b62e351193ed3bdef00b7f..b1e90e8497c0d57ad9e05b9c79ec7fe2e4829736 100644 (file)
@@ -369,6 +369,7 @@ static struct super_block *qnx4_read_super(struct super_block *s,
        }
        s->s_op = &qnx4_sops;
        s->s_magic = QNX4_SUPER_MAGIC;
+       s->s_maxbytes = MAX_NON_LFS;
 #ifndef CONFIG_QNX4FS_RW
        s->s_flags |= MS_RDONLY;        /* Yup, read-only yet */
 #endif
index 48ca45c0cdfb91cb0125b9c4927bd279c85fc48a..ad184a145e7d4dc761acf3def252b1b0866f1916 100644 (file)
@@ -51,6 +51,8 @@ int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry, int datasync) {
   int windex ;
   struct reiserfs_transaction_handle th ;
 
+  lock_kernel();
+
   journal_begin(&th, dentry->d_inode->i_sb, 1) ;
   windex = push_journal_writer("dir_fsync") ;
   reiserfs_prepare_for_journal(th.t_super, SB_BUFFER_WITH_SB(th.t_super), 1) ;
@@ -58,6 +60,8 @@ int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry, int datasync) {
   pop_journal_writer(windex) ;
   journal_end_sync(&th, dentry->d_inode->i_sb, 1) ;
 
+  unlock_kernel();
+
   return ret ;
 }
 
index 12ab138947a36b97e6c9aea5b740b54bfe02a1ea..ac95c6ad6000c8ebb22761d389bb47ebfd2d007e 100644 (file)
@@ -771,6 +771,7 @@ int reiserfs_get_block (struct inode * inode, long block,
            ** flush unbh before the transaction commits
            */
            reiserfs_add_page_to_flush_list(&th, inode, unbh) ;
+           mark_buffer_dirty(unbh) ;
                  
            //inode->i_blocks += inode->i_sb->s_blocksize / 512;
            //mark_tail_converted (inode);
index f4b24b59098def2e7e11293c509a4aaaab1bef84..13ca1d0cf77bc0587206527460020c8cfe11b967 100644 (file)
@@ -1438,7 +1438,6 @@ int reiserfs_delete_item (struct reiserfs_transaction_handle *th,
 
     if ( p_s_un_bh )  {
        int off;
-        int block_off ;
         char *data ;
 
        /* We are in direct2indirect conversion, so move tail contents
@@ -1452,7 +1451,8 @@ int reiserfs_delete_item (struct reiserfs_transaction_handle *th,
        ** the unformatted node, which might schedule, meaning we'd have to
        ** loop all the way back up to the start of the while loop.
        **
-       ** The unformatted node is prepared and logged after the do_balance.
+       ** The unformatted node must be dirtied later on.  We can't be
+       ** sure here if the entire tail has been deleted yet.
         **
         ** p_s_un_bh is from the page cache (all unformatted nodes are
         ** from the page cache) and might be a highmem page.  So, we
@@ -1463,25 +1463,13 @@ int reiserfs_delete_item (struct reiserfs_transaction_handle *th,
 
         data = page_address(p_s_un_bh->b_page) ;
        off = ((le_ih_k_offset (&s_ih) - 1) & (PAGE_CACHE_SIZE - 1));
-        block_off = off & (p_s_un_bh->b_size - 1) ;
        memcpy(data + off,
               B_I_PITEM(PATH_PLAST_BUFFER(p_s_path), &s_ih), n_ret_value);
-
-       /* clear out the rest of the block past the end of the file. */
-       if (block_off + n_ret_value < p_s_un_bh->b_size) {
-           memset(data + off + n_ret_value, 0, 
-                  p_s_un_bh->b_size - block_off - n_ret_value) ;
-       }
     }
 
     /* Perform balancing after all resources have been collected at once. */ 
     do_balance(&s_del_balance, NULL, NULL, M_DELETE);
 
-    /* see comment above for why this is after the do_balance */
-    if (p_s_un_bh) {
-        mark_buffer_dirty(p_s_un_bh) ;
-    }
-
     /* Return deleted body length */
     return n_ret_value;
 }
index 9838a1dcd2a7c74189dbbc6f4981d1dade3b3f7c..2d35ffe4f6ef76d054b090fa297288c003b82e48 100644 (file)
@@ -1,5 +1,14 @@
 /*
  * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
+ *
+ * Trivial changes by Alan Cox to add the LFS fixes
+ *
+ * Trivial Changes:
+ * Rights granted to Hans Reiser to redistribute under other terms providing
+ * he accepts all liability including but not limited to patent, fitness
+ * for purpose, and direct or indirect claims arising from failure to perform.
+ *
+ * NO WARRANTY
  */
 
 #ifdef __KERNEL__
@@ -483,6 +492,7 @@ static int read_super_block (struct super_block * s, int size)
     SB_BUFFER_WITH_SB (s) = bh;
     SB_DISK_SUPER_BLOCK (s) = rs;
     s->s_op = &reiserfs_sops;
+    s->s_maxbytes = 0xFFFFFFFF;        /* 4Gig */
     return 0;
 }
 
index f8153be3b86622bf4d21768d4ca530f75156d466..6493bd8005c7c8292cfab65475e88f9bf05872ba 100644 (file)
@@ -32,6 +32,7 @@ int direct2indirect (struct reiserfs_transaction_handle *th, struct inode * inod
     struct super_block * sb = inode->i_sb;
     struct buffer_head *up_to_date_bh ;
     struct item_head * p_le_ih = PATH_PITEM_HEAD (path);
+    unsigned long total_tail = 0 ;
     struct cpu_key end_key;  /* Key to search for the last byte of the
                                converted item. */
     struct item_head ind_ih; /* new indirect item to be inserted or
@@ -121,11 +122,20 @@ int direct2indirect (struct reiserfs_transaction_handle *th, struct inode * inod
        n_retval = reiserfs_delete_item (th, path, &end_key, inode, 
                                         up_to_date_bh) ;
 
+       total_tail += n_retval ;
        if (tail_size == n_retval)
            // done: file does not have direct items anymore
            break;
 
     }
+    /* if we've copied bytes from disk into the page, we need to zero
+    ** out the unused part of the block (it was not up to date before)
+    ** the page is still kmapped (by whoever called reiserfs_get_block)
+    */
+    if (up_to_date_bh) {
+        unsigned pgoff = (tail_offset + total_tail - 1) & (PAGE_CACHE_SIZE - 1);
+       memset(page_address(unbh->b_page) + pgoff, 0, n_blk_size - total_tail) ;
+    }
 
     inode->u.reiserfs_i.i_first_direct_byte = U32_MAX;
 
index 7edadf2aca245f62ba40fd7bda8b2a86505a91fd..c9cdea9721ce67314a204f5b82285a0bfda17daf 100644 (file)
@@ -110,6 +110,9 @@ romfs_read_super(struct super_block *s, void *data, int silent)
        set_blocksize(dev, ROMBSIZE);
        s->s_blocksize = ROMBSIZE;
        s->s_blocksize_bits = ROMBSBITS;
+       s->u.generic_sbp = (void *) 0;
+       s->s_maxbytes = 0xFFFFFFFF;
+
        bh = bread(dev, 0, ROMBSIZE);
        if (!bh) {
                /* XXX merge with other printk? */
index 40ee12566c881832b4abf35508141a3137745fc2..2fcfb93986e490f0b3ab5af95d410de3c5294b07 100644 (file)
@@ -399,6 +399,7 @@ smb_read_super(struct super_block *sb, void *raw_data, int silent)
        sb->s_magic = SMB_SUPER_MAGIC;
        sb->s_flags = 0;
        sb->s_op = &smb_sops;
+       sb->s_maxbytes = MAX_NON_LFS;   /* client support missing */
 
        sb->u.smbfs_sb.mnt = NULL;
        sb->u.smbfs_sb.sock_file = NULL;
index 1fb7beaa8e2d07808a12068d7b238e82acfddfa5..0f3618512645c93cfdc1e93a7729f61032356bff 100644 (file)
@@ -365,6 +365,7 @@ static struct super_block *sysv_read_super(struct super_block *sb,
                panic("sysv fs: bad i-node size");
        set_blocksize(dev,BLOCK_SIZE);
        sb->sv_block_base = 0;
+       sb->s_maxbytes = MAX_NON_LFS;
 
        /* Try to read Xenix superblock */
        if ((bh = bread(dev, 1, BLOCK_SIZE)) != NULL) {
index 1e089c0b1271bc87c1750cd5e7ee0ab492ef4188..a231594274c987bd29e61a9db897d739e5eceff4 100644 (file)
@@ -1415,7 +1415,7 @@ udf_read_super(struct super_block *sb, void *options, int silent)
                iput(inode);
                goto error_out;
        }
-
+       sb->s_maxbytes = ~0ULL;
        return sb;
 
 error_out:
index 3602915135d32928e073615c119590324eb7b62c..091a5cd6c747ff3ac5779fd9f5639785c029e728 100644 (file)
@@ -489,6 +489,12 @@ struct super_block * ufs_read_super (struct super_block * sb, void * data,
        if (!uspi)
                goto failed;
 
+       /* Set a 2Gig file limit. Some UFS variants need to override 
+          this but as I don't know which I'll let those in the know loosen
+          the rules */
+          
+       sb->s_maxbytes = MAX_NON_LFS;
+
        switch (sb->u.ufs_sb.s_mount_opt & UFS_MOUNT_UFSTYPE) {
        case UFS_MOUNT_UFSTYPE_44BSD:
                UFSD(("ufstype=44bsd\n"))
index ddbdedfa2380163d24640c941e678a1bae10c213..3d2b51596c64c8ec61aea77d2037a84110bfeb5d 100644 (file)
@@ -455,6 +455,23 @@ out:
 #define isa_memcpy_fromio(a,b,c)       memcpy_fromio((a),__ioremap(b),(c))
 #define isa_memcpy_toio(a,b,c)         memcpy_toio(__ioremap(a),(b),(c))
 
+static inline int
+isa_check_signature(unsigned long io_addr, const unsigned char *signature,
+               int length)
+{
+       int retval = 0;
+       do {
+               if (isa_readb(io_addr) != *signature)
+                       goto out;
+               io_addr++;
+               signature++;
+               length--;
+       } while (length);
+       retval = 1;
+out:
+       return retval;
+}
+
 
 /*
  * The Alpha Jensen hardware for some rather strange reason puts
index 0aad196684882cd2532a4edcbce818c38ee3744c..ed340a2473bf4519b72cc0dacb975d4e2dc23419 100644 (file)
@@ -21,7 +21,7 @@ struct vm_area_struct;
 struct linux_hose_info;
 struct pci_dev;
 struct pci_ops;
-struct pci_controler;
+struct pci_controller;
 
 struct alpha_machine_vector
 {
@@ -40,7 +40,7 @@ struct alpha_machine_vector
        unsigned long min_io_address;
        unsigned long min_mem_address;
 
-       void (*mv_pci_tbi)(struct pci_controler *hose,
+       void (*mv_pci_tbi)(struct pci_controller *hose,
                           dma_addr_t start, dma_addr_t end);
 
        unsigned int (*mv_inb)(unsigned long);
index 85923e999eaa85c1708cc14f4d7caed635642fb3..781a4882bc2ee22bd30f964b795f92eb106e52e9 100644 (file)
@@ -16,10 +16,10 @@ struct pci_bus;
 struct resource;
 struct pci_iommu_arena;
 
-/* A controler.  Used to manage multiple PCI busses.  */
+/* A controller.  Used to manage multiple PCI busses.  */
 
-struct pci_controler {
-       struct pci_controler *next;
+struct pci_controller {
+       struct pci_controller *next;
         struct pci_bus *bus;
        struct resource *io_space;
        struct resource *mem_space;
index 0e4a1e3a678f7681375250f7dd40eddebb8e5145..c2a511ea41cc6f6faff3d28e3ddab665a7e66da9 100644 (file)
@@ -12,6 +12,7 @@
 #include <asm/system.h>
 #include <asm/atomic.h>
 #include <asm/compiler.h>      /* __builtin_expect */
+#include <linux/wait.h>
 
 #define DEBUG_SEMAPHORE 0
 #define DEBUG_RW_SEMAPHORE 0
index f11e254f6719b36a1924f4e474d33f130f3d8920..2cc52a7e0578ee4085b60e629547adc652b8469c 100644 (file)
@@ -57,6 +57,7 @@ extern int __cpu_logical_map[NR_CPUS];
 #define smp_processor_id()     (current->processor)
 
 extern unsigned long cpu_present_mask;
+#define cpu_online_map cpu_present_mask
 
 #endif /* CONFIG_SMP */
 
index 91bca91d8564e07c24d4eb530685403d79a1cc12..8c3105066f312fbe5727c043bb6d561839c940a3 100644 (file)
@@ -134,7 +134,7 @@ static void sa1100_unmask_GPIO11_27_irq(unsigned int irq)
        int mask = (1 << GPIO_11_27_IRQ(irq));
        if (GPIO_11_27_spurious & mask) {
                /* 
-                * We don't want to miss an interrupt that would have occured
+                * We don't want to miss an interrupt that would have occurred
                 * while it was masked.  Simulate it if it is the case.
                 */
                int state = GPLR;
index 06022132cb508a3619346ff449386507bd341e10..51bfd051bc003e75c4281c8b602b3516e3878525 100644 (file)
@@ -352,11 +352,6 @@ return (to);
 
 #ifdef CONFIG_X86_USE_3DNOW
 
-#include <linux/spinlock.h>
-#include <asm/system.h>
-#include <asm/ptrace.h>
-#include <linux/smp.h>
-#include <linux/interrupt.h>
 #include <asm/mmx.h>
 
 /*
@@ -365,14 +360,14 @@ return (to);
 
 static inline void * __constant_memcpy3d(void * to, const void * from, size_t len)
 {
-       if(len<512 || in_interrupt())
+       if (len < 512)
                return __memcpy_c(to, from, len);
        return _mmx_memcpy(to, from, len);
 }
 
 static inline void *__memcpy3d(void *to, const void *from, size_t len)
 {
-       if(len<512 || in_interrupt())
+       if(len < 512)
                return __memcpy_g(to, from, len);
        return _mmx_memcpy(to, from, len);
 }
index 62bf7916c1e64b5ce651beb5ec2f4c0ddc4b2071..6c55845439ded844d463d62726b2158561847c21 100644 (file)
@@ -287,13 +287,6 @@ __asm__ __volatile__( \
 
 #ifdef CONFIG_X86_USE_3DNOW
 
-/* All this just for in_interrupt() ... */
-
-#include <asm/system.h>
-#include <asm/ptrace.h>
-#include <linux/smp.h>
-#include <linux/spinlock.h>
-#include <linux/interrupt.h>
 #include <asm/mmx.h>
 
 /*
@@ -302,14 +295,14 @@ __asm__ __volatile__( \
 
 static inline void * __constant_memcpy3d(void * to, const void * from, size_t len)
 {
-       if(len<512 || in_interrupt())
+       if (len < 512)
                return __constant_memcpy(to, from, len);
        return _mmx_memcpy(to, from, len);
 }
 
 extern __inline__ void *__memcpy3d(void *to, const void *from, size_t len)
 {
-       if(len<512 || in_interrupt())
+       if (len < 512)
                return __memcpy(to, from, len);
        return _mmx_memcpy(to, from, len);
 }
index b8a8f8d754a99f0a844669a4e8742897bb3c3f57..5007317081889e765ccbe6327273bcea6bd48eeb 100644 (file)
@@ -40,6 +40,7 @@ extern int __cpu_logical_map[NR_CPUS];
 
 /* Good enough for toy^Wupto 64 CPU Origins.  */
 extern unsigned long cpu_present_mask;
+#define cpu_online_map cpu_present_mask
 
 #endif
 
index cfbb03bf29746e496e5c1d13ca3105b0eeccefc7..fd5efa10d1122b94a37b1c4827af051167b785da 100644 (file)
@@ -59,7 +59,7 @@ typedef struct ccw_req_t {
 #define CQR_STATUS_FILLED   0x01       /* request is ready to be preocessed */
 #define CQR_STATUS_QUEUED   0x02       /* request is queued to be processed */
 #define CQR_STATUS_IN_IO    0x03       /* request is currently in IO */
-#define CQR_STATUS_DONE     0x04       /* request is completed sucessfully */
+#define CQR_STATUS_DONE     0x04       /* request is completed successfully */
 #define CQR_STATUS_ERROR    0x05       /* request is completed with error */
 #define CQR_STATUS_FAILED   0x06       /* request is finally failed */
 
index cdfa00fa244b5b67080c66ee6d2f9f6374c33a63..59dfe5698f1578be61bce38290e90fb5a8b64255 100644 (file)
@@ -124,7 +124,7 @@ struct _lowcore
         __u8         pad3[0xD8-0xC4];          /* 0x0c4 */
        __u32        cpu_timer_save_area[2];   /* 0x0d8 */
        __u32        clock_comp_save_area[2];  /* 0x0e0 */
-       __u32        mcck_interuption_code[2]; /* 0x0e8 */
+       __u32        mcck_interruption_code[2]; /* 0x0e8 */
        __u8         pad4[0xf4-0xf0];          /* 0x0f0 */
        __u32        external_damage_code;     /* 0x0f4 */
        __u32        failing_storage_address;  /* 0x0f8 */
index cfbb03bf29746e496e5c1d13ca3105b0eeccefc7..fd5efa10d1122b94a37b1c4827af051167b785da 100644 (file)
@@ -59,7 +59,7 @@ typedef struct ccw_req_t {
 #define CQR_STATUS_FILLED   0x01       /* request is ready to be preocessed */
 #define CQR_STATUS_QUEUED   0x02       /* request is queued to be processed */
 #define CQR_STATUS_IN_IO    0x03       /* request is currently in IO */
-#define CQR_STATUS_DONE     0x04       /* request is completed sucessfully */
+#define CQR_STATUS_DONE     0x04       /* request is completed successfully */
 #define CQR_STATUS_ERROR    0x05       /* request is completed with error */
 #define CQR_STATUS_FAILED   0x06       /* request is finally failed */
 
index d9e4a836396d1bb8fd8fb98809ab26f0dc846633..ea5e43eae256af5ee8df5e19326cbca13ea1b9b0 100644 (file)
@@ -203,7 +203,7 @@ struct request;
 typedef ccw_req_t *(*dasd_erp_action_fn_t) (ccw_req_t * cqr);
 typedef ccw_req_t *(*dasd_erp_postaction_fn_t) (ccw_req_t * cqr);
 
-typedef int (*dasd_ck_id_fn_t) (dev_info_t *);
+typedef int (*dasd_ck_id_fn_t) (s390_dev_info_t *);
 typedef int (*dasd_ck_characteristics_fn_t) (struct dasd_device_t *);
 typedef int (*dasd_fill_geometry_fn_t) (struct dasd_device_t *, struct hd_geometry *);
 typedef ccw_req_t *(*dasd_format_fn_t) (struct dasd_device_t *, struct format_data_t *);
@@ -269,7 +269,7 @@ typedef struct dasd_profile_info_t {
 } dasd_profile_info_t;
 
 typedef struct dasd_device_t {
-       dev_info_t devinfo;
+       s390_dev_info_t devinfo;
        dasd_discipline_t *discipline;
        int level;
         int open_count;
index 215b8b8e076726ec65c76d0a8ef3e66e2d9772d1..fe03e63516f454f3da31dd4f4fe78e9557dd8435 100644 (file)
@@ -116,7 +116,7 @@ struct _lowcore
        __u8         pad3[0xc8-0xc4];          /* 0x0c4 */
        __u32        stfl_fac_list;            /* 0x0c8 */
        __u8         pad4[0xe8-0xcc];          /* 0x0cc */
-       __u32        mcck_interuption_code[2]; /* 0x0e8 */
+       __u32        mcck_interruption_code[2]; /* 0x0e8 */
        __u8         pad5[0xf4-0xf0];          /* 0x0f0 */
        __u32        external_damage_code;     /* 0x0f4 */
        addr_t       failing_storage_address;  /* 0x0f8 */
index 0d00c3b549493f52786215c1bede43537ae004c9..e78379203e34de0935e9a08c4b2b39815ded2f81 100644 (file)
@@ -50,6 +50,7 @@
 #define SO_PEERNAME            28
 #define SO_TIMESTAMP           29
 #define SCM_TIMESTAMP          SO_TIMESTAMP
+#define SO_ACCEPTCONN                  30
 
 /* Nast libc5 fixup - bletch */
 #if defined(__KERNEL__)
index 1ac8474ee5aca121ead66fbde4692db5a15fe22f..090fe68de56d0b2473779b7640a60b6845508fdc 100644 (file)
@@ -330,7 +330,6 @@ static inline _syscall1(int,_exit,int,exitcode)
 static inline _syscall1(int,delete_module,const char *,name)
 static inline _syscall2(long,stat,char *,filename,struct stat *,statbuf)
 
-extern int sys_wait4(int, int *, int, struct rusage *);
 static inline pid_t waitpid(int pid, int * wait_stat, int flags)
 {
         return sys_wait4(pid, wait_stat, flags, NULL);
index f6504165d03ff4610d73b3dd145d14462d58548e..31507b7bc624c7aa52de0014337a1818f5c4ffcb 100644 (file)
@@ -51,6 +51,7 @@ extern unsigned long cpu_offset[NR_CPUS];
 extern int smp_found_cpus;
 extern unsigned char boot_cpu_id;
 extern unsigned long cpu_present_map;
+#define cpu_online_map cpu_present_map
 
 typedef void (*smpfunc_t)(unsigned long, unsigned long, unsigned long,
                       unsigned long, unsigned long);
index 3898efdd2e9fe03e38a26bde6033fea42cecdc6e..3fb3886b0cd88da936dd88a2a630a9cde86dcbca 100644 (file)
@@ -60,6 +60,7 @@ extern struct cpuinfo_sparc cpu_data[NR_CPUS];
  
 extern unsigned char boot_cpu_id;
 extern unsigned long cpu_present_map;
+#define cpu_online_map cpu_present_map
 
 /*
  *     General functions that each host system must provide.
index a5f4cddafaafb90077b22a88c8150879f90870ef..2a51264b34fcd479acd29c288cb524c654b296d8 100644 (file)
@@ -244,7 +244,7 @@ struct buffer_head {
        struct buffer_head *b_reqnext;  /* request queue */
 
        struct buffer_head **b_pprev;   /* doubly linked list of hash-queue */
-       char * b_data;                  /* pointer to data block (512 byte) */
+       char * b_data;                  /* pointer to data block */
        struct page *b_page;            /* the page this bh is mapped to */
        void (*b_end_io)(struct buffer_head *bh, int uptodate); /* I/O completion */
        void *b_private;                /* reserved for b_end_io */
@@ -504,6 +504,8 @@ extern spinlock_t files_lock;
 
 extern int init_private_file(struct file *, struct dentry *, int);
 
+#define        MAX_NON_LFS     ((1UL<<31) - 1)
+
 #define FL_POSIX       1
 #define FL_FLOCK       2
 #define FL_BROKEN      4       /* broken flock() emulation */
@@ -651,6 +653,7 @@ struct super_block {
        unsigned char           s_blocksize_bits;
        unsigned char           s_lock;
        unsigned char           s_dirt;
+       unsigned long long      s_maxbytes;     /* Max file size */
        struct file_system_type *s_type;
        struct super_operations *s_op;
        struct dquot_operations *dq_op;
index 6cfe0bbb78c5e0242f8e0eae033d788a59ee9e7f..eaa63807af94026d0949de4e4fc6bb2538247d47 100644 (file)
@@ -223,6 +223,11 @@ struct unixware_disklabel {
 
 #endif /* CONFIG_UNIXWARE_DISKLABEL */
 
+#ifdef CONFIG_MINIX_SUBPARTITION
+#   define MINIX_PARTITION         0x81  /* Minix Partition ID */
+#   define MINIX_NR_SUBPARTITIONS  4
+#endif /* CONFIG_MINIX_SUBPARTITION */
+
 #ifdef __KERNEL__
 extern struct gendisk *gendisk_head;   /* linked list of disks */
 
index 46209167406562f2ccac7058abdbe3da6182cf79..420ea0cc51f35a3c6a0b10dc9b65f96b6aaf7ec4 100644 (file)
@@ -630,7 +630,6 @@ extern void         fddi_setup(struct net_device *dev);
 extern void            tr_setup(struct net_device *dev);
 extern void            fc_setup(struct net_device *dev);
 extern void            fc_freedev(struct net_device *dev);
-extern int             ether_config(struct net_device *dev, struct ifmap *map);
 /* Support for loadable net-drivers */
 extern int             register_netdev(struct net_device *dev);
 extern void            unregister_netdev(struct net_device *dev);
index 205abe61e428671accbc6373191115f511b7ae8f..715113f26d662564bda66aafc36bb6f3ec6e0f95 100644 (file)
@@ -539,6 +539,9 @@ void pdev_sort_resources(struct pci_dev *, struct resource_list *, u32);
 unsigned long pci_bridge_check_io(struct pci_dev *);
 void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
                    int (*)(struct pci_dev *, u8, u8));
+#define HAVE_PCI_REQ_REGIONS 1
+int pci_request_regions(struct pci_dev *, char *);
+void pci_release_regions(struct pci_dev *);
 
 /* New-style probing supporting hot-pluggable devices */
 int pci_register_driver(struct pci_driver *);
index 7a73db598fa6f7464db6c88a055609b24e15b3e8..d10f7a5c03822685f4745183f670887063178f4c 100644 (file)
@@ -6,13 +6,12 @@
 
 #ifdef __KERNEL__
 
-#if LINUX_VERSION_CODE >= 0x020100
 #include <linux/poll.h>
-#endif
 #include <linux/devfs_fs_kernel.h>
 
 struct video_device
 {
+       struct module *owner;
        char name[32];
        int type;
        int hardware;
index 7fd7da26d0351a052eabaebf71456a1dbf047bc4..2e0a838f17cee31c2ce6328e38dcd322e475ab06 100644 (file)
 #define PRODID_SOCKET_DUAL_RS232       0x0006
 #define PRODID_SOCKET_EIO              0x000a
 #define PRODID_SOCKET_LPE              0x000d
+#define PRODID_SOCKET_LPE_CF           0x0075
 
 #define MANFID_SUNDISK                 0x0045
 
 #define MANFID_TDK                     0x0105
+#define PRODID_TDK_CF010               0x0900
 
 #define MANFID_TOSHIBA                 0x0098
 
index b6f6c879a1a4e05d432de2c7bdcfae2cb9a73011..33ec2ec771785223b60a6b3d6fa613a4d43ec761 100644 (file)
@@ -339,7 +339,7 @@ static inline int try_to_wake_up(struct task_struct * p, int synchronous)
        if (task_on_runqueue(p))
                goto out;
        add_to_runqueue(p);
-       if (!synchronous)
+       if (!synchronous || !(p->cpus_allowed & (1 << smp_processor_id())))
                reschedule_idle(p);
        success = 1;
 out:
@@ -473,7 +473,7 @@ needs_resched:
                        goto out_unlock;
 
                spin_lock_irqsave(&runqueue_lock, flags);
-               if (prev->state == TASK_RUNNING)
+               if ((prev->state == TASK_RUNNING) && !prev->has_cpu)
                        reschedule_idle(prev);
                spin_unlock_irqrestore(&runqueue_lock, flags);
                goto out_unlock;
index f6f8be1dbf41b2f8033fd7661f5fa1042b717a7b..578faedce2632f57205a6b17ad178cc7ddacb2a8 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -814,28 +814,6 @@ opps:
        return cachep;
 }
 
-/*
- * This check if the kmem_cache_t pointer is chained in the cache_cache
- * list. -arca
- */
-static int is_chained_kmem_cache(kmem_cache_t * cachep)
-{
-       struct list_head *p;
-       int ret = 0;
-
-       /* Find the cache in the chain of caches. */
-       down(&cache_chain_sem);
-       list_for_each(p, &cache_chain) {
-               if (p == &cachep->next) {
-                       ret = 1;
-                       break;
-               }
-       }
-       up(&cache_chain_sem);
-
-       return ret;
-}
-
 #ifdef CONFIG_SMP
 /*
  * Waits for all CPUs to execute func().
@@ -938,7 +916,7 @@ static int __kmem_cache_shrink(kmem_cache_t *cachep)
  */
 int kmem_cache_shrink(kmem_cache_t *cachep)
 {
-       if (!cachep || in_interrupt() || !is_chained_kmem_cache(cachep))
+       if (!cachep || in_interrupt())
                BUG();
 
        return __kmem_cache_shrink(cachep);
index cf4dcf8cd0225b0053a559a3c45ccd7b55c5f87c..3276ee10efa6c39a523d04346b715750fc0e8ddf 100644 (file)
@@ -349,7 +349,7 @@ int netdev_boot_setup_check(struct net_device *dev)
 /*
  * Saves at boot time configured settings for any netdevice.
  */
-static int __init netdev_boot_setup(char *str)
+int __init netdev_boot_setup(char *str)
 {
        int ints[5];
        struct ifmap map;
@@ -359,7 +359,7 @@ static int __init netdev_boot_setup(char *str)
                return 0;
 
        /* Save settings */
-       memset(&map, -1, sizeof(map));
+       memset(&map, 0, sizeof(map));
        if (ints[0] > 0)
                map.irq = ints[1];
        if (ints[0] > 1)
index b26c97e4e3ff84b008702cda08b32c9774f0bacc..81735d961fbc468bc7c76a231fd1a700582bbd53 100644 (file)
@@ -30,6 +30,7 @@
  *             Alan Cox        : Protect against forwarding explosions with
  *                               older network drivers and IFF_ALLMULTI.
  *     Christer Weinigel       : Better rebuild header message.
+ *             Andrew Morton    : 26Feb01: kill ether_setup() - use netdev_boot_setup().
  *
  *             This program is free software; you can redistribute it and/or
  *             modify it under the terms of the GNU General Public License
 #include <asm/system.h>
 #include <asm/checksum.h>
 
-static int __init eth_setup(char *str)
-{
-       int ints[5];
-       struct ifmap map;
-
-       str = get_options(str, ARRAY_SIZE(ints), ints);
-       if (!str || !*str)
-               return 0;
-
-       /* Save settings */
-       memset(&map, -1, sizeof(map));
-       if (ints[0] > 0)
-               map.irq = ints[1];
-       if (ints[0] > 1)
-               map.base_addr = ints[2];
-       if (ints[0] > 2)
-               map.mem_start = ints[3];
-       if (ints[0] > 3)
-               map.mem_end = ints[4];
-
-       /* Add new entry to the list */
-       return netdev_boot_setup_add(str, &map);
-}
+extern int __init netdev_boot_setup(char *str);
 
-__setup("ether=", eth_setup);
+__setup("ether=", netdev_boot_setup);
 
 /*
  *      Create the Ethernet MAC header for an arbitrary protocol layer 
index 250b22ae9a96ed704fafc5305591c3b0384e944d..cad22b2772f8daf1c36e3d85b5a2df512aa2e26f 100644 (file)
@@ -146,7 +146,7 @@ static void irda_disconnect_indication(void *instance, void *sap,
 
        /* Close our TSAP.
         * If we leave it open, IrLMP put it back into the list of
-        * unconnected LSAPs. The problem is that any incomming request
+        * unconnected LSAPs. The problem is that any incoming request
         * can then be matched to this socket (and it will be, because
         * it is at the head of the list). This would prevent any
         * listening socket waiting on the same TSAP to get those requests.
@@ -229,7 +229,7 @@ static void irda_connect_confirm(void *instance, void *sap,
 /*
  * Function irda_connect_indication(instance, sap, qos, max_sdu_size, userdata)
  *
- *    Incomming connection
+ *    Incoming connection
  *
  */
 static void irda_connect_indication(void *instance, void *sap, 
@@ -285,7 +285,7 @@ static void irda_connect_indication(void *instance, void *sap,
 /*
  * Function irda_connect_response (handle)
  *
- *    Accept incomming connection
+ *    Accept incoming connection
  *
  */
 void irda_connect_response(struct irda_sock *self)
@@ -836,7 +836,7 @@ static int irda_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 /*
  * Function irda_accept (sock, newsock, flags)
  *
- *    Wait for incomming connection
+ *    Wait for incoming connection
  *
  */
 static int irda_accept(struct socket *sock, struct socket *newsock, int flags)
@@ -1995,6 +1995,9 @@ static int irda_getsockopt(struct socket *sock, int level, int optname,
        if (get_user(len, optlen))
                return -EFAULT;
 
+       if(optlen < 0)
+               return -EINVAL;
+               
        switch (optname) {
        case IRLMP_ENUMDEVICES:
                /* Ask lmp for the current discovery log */
index 7ae03b0a623e55b59190f02101f0b32767ae60c4..bc791de5fbfda487a2c0272b9b092cdbf1934f8e 100644 (file)
@@ -220,7 +220,7 @@ int ircomm_connect_request(struct ircomm_cb *self, __u8 dlsap_sel,
 /*
  * Function ircomm_connect_indication (self, qos, skb)
  *
- *    Notify user layer about the incomming connection
+ *    Notify user layer about the incoming connection
  *
  */
 void ircomm_connect_indication(struct ircomm_cb *self, struct sk_buff *skb,
index 5b43be8584d396b13133156e1195bb4bd6caedfe..ea80c78740376e0ba7d1603f2b95969be8d53557 100644 (file)
@@ -151,7 +151,7 @@ static int ircomm_state_waiti(struct ircomm_cb *self, IRCOMM_EVENT event,
 /*
  * Function ircomm_state_waitr (self, event, skb)
  *
- *    IrCOMM has received an incomming connection request and is awaiting
+ *    IrCOMM has received an incoming connection request and is awaiting
  *    response from the user
  */
 static int ircomm_state_waitr(struct ircomm_cb *self, IRCOMM_EVENT event, 
index ca45262609718c95e24f221cd7ea91299512dafd..5ddd3e1de753e925827e1dfcec1121e3fa5291b6 100644 (file)
@@ -219,7 +219,7 @@ int ircomm_lmp_data_request(struct ircomm_cb *self, struct sk_buff *skb,
 /*
  * Function ircomm_lmp_data_indication (instance, sap, skb)
  *
- *    Incomming data which we must deliver to the state machine, to check
+ *    Incoming data which we must deliver to the state machine, to check
  *    we are still connected.
  */
 int ircomm_lmp_data_indication(void *instance, void *sap,
index 642b8416afeeb7e01488755c69728d6d74ad47f4..d17a5b5441e245290ba975548f2cb556dc0ccb68 100644 (file)
@@ -156,7 +156,7 @@ int ircomm_ttp_data_request(struct ircomm_cb *self, struct sk_buff *skb,
 /*
  * Function ircomm_ttp_data_indication (instance, sap, skb)
  *
- *    Incomming data
+ *    Incoming data
  *
  */
 int ircomm_ttp_data_indication(void *instance, void *sap,
index b88cc3d53b5935c7ff721722a53df9b7dd8593d1..c7d931b98429dd304f7b5585d6558b5115db90cb 100644 (file)
@@ -1106,7 +1106,7 @@ void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self)
 /*
  * Function ircomm_tty_data_indication (instance, sap, skb)
  *
- *    Handle incomming data, and deliver it to the line discipline
+ *    Handle incoming data, and deliver it to the line discipline
  *
  */
 static int ircomm_tty_data_indication(void *instance, void *sap,
@@ -1155,7 +1155,7 @@ static int ircomm_tty_data_indication(void *instance, void *sap,
 /*
  * Function ircomm_tty_control_indication (instance, sap, skb)
  *
- *    Parse all incomming parameters (easy!)
+ *    Parse all incoming parameters (easy!)
  *
  */
 static int ircomm_tty_control_indication(void *instance, void *sap,
index 65d1e440997e29a9784b318186d1988b5a07218d..f6a4c1c8dc9a0f2e44003f77937c7bcf6ada9623 100644 (file)
@@ -162,7 +162,7 @@ int irias_delete_attrib(struct ias_object *obj, struct ias_attrib *attrib)
        ASSERT(obj->magic == IAS_OBJECT_MAGIC, return -1;);
        ASSERT(attrib != NULL, return -1;);
 
-       /* Remove atribute from object */
+       /* Remove attribute from object */
        node = hashbin_remove(obj->attribs, 0, attrib->name);
        if (!node)
                return 0; /* Already removed or non-existent */
index e06807bd9667eeba350beff49dbd792d84024d76..6df8e97f5c7d2895302b2f99e79aaee2c1e2656d 100644 (file)
@@ -162,7 +162,7 @@ static void irlan_provider_connect_indication(void *instance, void *sap,
 /*
  * Function irlan_provider_connect_response (handle)
  *
- *    Accept incomming connection
+ *    Accept incoming connection
  *
  */
 void irlan_provider_connect_response(struct irlan_cb *self,
@@ -371,7 +371,7 @@ void irlan_provider_send_reply(struct irlan_cb *self, int command,
 /*
  * Function irlan_provider_register(void)
  *
- *    Register provider support so we can accept incomming connections.
+ *    Register provider support so we can accept incoming connections.
  * 
  */
 int irlan_provider_open_ctrl_tsap(struct irlan_cb *self)
index b815f9f3a0cb5375c2d5c205c06675847c7b5fd7..c8bbecb8cd75779128e6303fecc51aea78b9f0a2 100644 (file)
@@ -51,6 +51,7 @@
 hashbin_t *irlap = NULL;
 int sysctl_slot_timeout = SLOT_TIMEOUT * 1000 / HZ;
 
+extern void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb);
 static void __irlap_close(struct irlap_cb *self);
 
 static char *lap_reasons[] = {
@@ -241,7 +242,7 @@ void irlap_connect_indication(struct irlap_cb *self, struct sk_buff *skb)
 /*
  * Function irlap_connect_response (self, skb)
  *
- *    Service user has accepted incomming connection
+ *    Service user has accepted incoming connection
  *
  */
 void irlap_connect_response(struct irlap_cb *self, struct sk_buff *skb) 
index e81fc7e4a6d290ebeec3829d9380d58ba2b27005..37d6a6fbfddfcd59a72924a0e1d157e8cb337ba8 100644 (file)
@@ -92,7 +92,7 @@ void irda_unregister_compressor ( struct compressor *cp)
 /*
  * Function irda_set_compression (self, proto)
  *
- *    The the compression protocol to be used by this session
+ *    The compression protocol to be used by this session
  *
  */
 int irda_set_compression( struct irlap_cb *self, int proto)
index 10a942584d7573a00903e42bcde1fbd32b370690..6a2d34f6176b0fa1d4f248ed76d6fd5f57db28b8 100644 (file)
@@ -546,7 +546,7 @@ static int irlap_state_query(struct irlap_cb *self, IRLAP_EVENT event,
                break;
        case SLOT_TIMER_EXPIRED:
                /*
-                * Wait a little longer if we detect an incomming frame. This
+                * Wait a little longer if we detect an incoming frame. This
                 * is not mentioned in the spec, but is a good thing to do, 
                 * since we want to work even with devices that violate the
                 * timing requirements.
index 29debb1bd840538833689c79869ce9c197d707fa..19b41e788e3519f19645619ae7ba239e746b58e6 100644 (file)
@@ -450,7 +450,7 @@ int irlmp_connect_request(struct lsap_cb *self, __u8 dlsap_sel,
 /*
  * Function irlmp_connect_indication (self)
  *
- *    Incomming connection
+ *    Incoming connection
  *
  */
 void irlmp_connect_indication(struct lsap_cb *self, struct sk_buff *skb) 
index 56287afbbe861c33915bc167b97b4b3de91e0608..803e598ffe31f970720205fe2c0310cb4944367e 100644 (file)
@@ -470,7 +470,7 @@ static struct lsap_cb *irlmp_find_lsap(struct lap_cb *self, __u8 dlsap_sel,
        lsap = (struct lsap_cb *) hashbin_get_first(queue);
        while (lsap != NULL) {
                /* 
-                *  If this is an incomming connection, then the destination 
+                *  If this is an incoming connection, then the destination 
                 *  LSAP selector may have been specified as LM_ANY so that 
                 *  any client can connect. In that case we only need to check
                 *  if the source LSAP (in our view!) match!
index d578593f1961077ac22910128e9bad550b3ce741..ac6f9c4333afd45043ba384b769a06ccf2049b1c 100644 (file)
@@ -1 +1,4 @@
-dep_tristate '  IrNET protocol' CONFIG_IRNET $CONFIG_IRDA
+if [ "$CONFIG_NETDEVICES" != "n" ]; then
+   dep_tristate '  IrNET protocol' CONFIG_IRNET $CONFIG_IRDA $CONFIG_PPP
+fi
+
index 6c9df66b3a6d16fd1b508a6bd0437555ff247eb7..e9f936737e953eb1d6bba3582445b5f923748a95 100644 (file)
@@ -9,7 +9,7 @@
  * what's in there...
  *
  * Note : as most part of the Linux kernel, this module is available
- * under the GNU Public License (GPL).
+ * under the GNU General Public License (GPL).
  */
 
 #ifndef IRNET_H
  *     o multipoint operation (limited by IrLAP specification)
  *     o information in /proc/net/irda/irnet
  *     o IrNET events on /dev/irnet (for user space daemon)
- *     o IrNET deamon (irnetd) to automatically handle incomming requests
+ *     o IrNET deamon (irnetd) to automatically handle incoming requests
  *     o Windows 2000 compatibility (tested, but need more work)
  * Currently missing :
  *     o Lot's of testing (that's your job)
  *     o Connection retries (may be too hard to do)
  *     o Check pppd persist mode
- *     o User space deamon (to automatically handle incomming requests)
- *     o A registered device number (comming, waiting from an answer) 
+ *     o User space deamon (to automatically handle incoming requests)
+ *     o A registered device number (coming, waiting from an answer) 
  *     o Final integration in Linux-IrDA (up to Dag) 
  *
  * The setup is not currently the most easy, but this should get much
  * and allow to offer the event channel, useful for other stuff like debug.
  *
  * On the other hand, this require a loose coordination between the
- * present module and irnetd. One critical area is how incomming request
+ * present module and irnetd. One critical area is how incoming request
  * are handled.
- * When irnet receive an incomming request, it send an event to irnetd and
- * drop the incomming IrNET socket.
+ * When irnet receive an incoming request, it send an event to irnetd and
+ * drop the incoming IrNET socket.
  * irnetd start a pppd instance, which create a new IrNET socket. This new
  * socket is then connected in the originating node to the pppd instance.
  * At this point, in the originating node, the first socket is closed.
  *
  * I admit, this is a bit messy and waste some ressources. The alternative
- * is caching incomming socket, and that's also quite messy and waste
+ * is caching incoming socket, and that's also quite messy and waste
  * ressources.
  * We also make connection time slower. For example, on a 115 kb/s link it
  * adds 60ms to the connection time (770 ms). However, this is slower than
index ead7ef6782b9341ce9679eeea2a611009f22c454..0a1200484e604527098afd1305af4bbb64fdf81b 100644 (file)
@@ -523,7 +523,7 @@ irda_irnet_destroy(irnet_socket *   self)
 /*
  * The IrNET service is composed of one server socket and a variable
  * number of regular IrNET sockets. The server socket is supposed to
- * handle incomming connections and redirect them to one IrNET sockets.
+ * handle incoming connections and redirect them to one IrNET sockets.
  * It's a superset of the regular IrNET socket, but has a very distinct
  * behaviour...
  */
@@ -662,7 +662,7 @@ irnet_find_socket(irnet_socket *    self)
 /*
  * Function irda_connect_socket (self)
  *
- *    Connect an incomming connection to the socket
+ *    Connect an incoming connection to the socket
  *
  */
 static inline int
@@ -721,7 +721,7 @@ irnet_connect_socket(irnet_socket * self,
 /*
  * Function irda_disconnect_server (self)
  *
- *    Cleanup the server socket when the incomming connection abort
+ *    Cleanup the server socket when the incoming connection abort
  *
  */
 static inline void
@@ -1097,7 +1097,7 @@ irnet_status_indication(void *    instance,
 /*
  * Function irnet_connect_indication(instance, sap, qos, max_sdu_size, userdata)
  *
- *    Incomming connection
+ *    Incoming connection
  *
  * In theory, this function is called only on the server socket.
  * Some other node is attempting to connect to the IrNET service, and has
index 4c0e7521d42e9efe9ea572aa37a549d009bdeacd..9593fe88b7b11d0f1f5dcf932b954b33163fa2f0 100644 (file)
@@ -2,7 +2,7 @@
  * Originally by Linus Torvalds.
  * Smart CONFIG_* processing by Werner Almesberger, Michael Chastain.
  *
- * Usage: mkdep file ...
+ * Usage: mkdep cflags -- file ...
  * 
  * Read source files and output makefile dependency lines for them.
  * I make simple dependency lines for #include <*.h> and #include "*.h".
  * 2.3.99-pre1, Andrew Morton <andrewm@uow.edu.au>
  * - Changed so that 'filename.o' depends upon 'filename.[cS]'.  This is so that
  *   missing source files are noticed, rather than silently ignored.
+ *
+ * 2.4.2-pre3, Keith Owens <kaos@ocs.com.au>
+ * - Accept cflags followed by '--' followed by filenames.  mkdep extracts -I
+ *   options from cflags and looks in the specified directories as well as the
+ *   defaults.   Only -I is supported, no attempt is made to handle -idirafter,
+ *   -isystem, -I- etc.
  */
 
 #include <ctype.h>
 #include <fcntl.h>
+#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -44,11 +51,10 @@ int hasdep;
 
 struct path_struct {
        int len;
-       char buffer[256-sizeof(int)];
-} path_array[2] = {
-       {  0, "" },
-       {  0, "" }
+       char *buffer;
 };
+struct path_struct *path_array;
+int paths;
 
 
 /* Current input file */
@@ -181,9 +187,10 @@ void define_precious(const char * filename)
 /*
  * Handle an #include line.
  */
-void handle_include(int type, const char * name, int len)
+void handle_include(int start, const char * name, int len)
 {
-       struct path_struct *path = path_array+type;
+       struct path_struct *path;
+       int i;
 
        if (len == 14 && !memcmp(name, "linux/config.h", len))
                return;
@@ -191,13 +198,58 @@ void handle_include(int type, const char * name, int len)
        if (len >= 7 && !memcmp(name, "config/", 7))
                define_config(name+7, len-7-2);
 
-       memcpy(path->buffer+path->len, name, len);
-       path->buffer[path->len+len] = '\0';
-       if (access(path->buffer, F_OK) != 0)
-               return;
+       for (i = start, path = path_array+start; i < paths; ++i, ++path) {
+               memcpy(path->buffer+path->len, name, len);
+               path->buffer[path->len+len] = '\0';
+               if (access(path->buffer, F_OK) == 0) {
+                       do_depname();
+                       printf(" \\\n   %s", path->buffer);
+                       return;
+               }
+       }
 
-       do_depname();
-       printf(" \\\n   %s", path->buffer);
+}
+
+
+
+/*
+ * Add a path to the list of include paths.
+ */
+void add_path(const char * name)
+{
+       struct path_struct *path;
+       char resolved_path[PATH_MAX+1];
+       const char *name2;
+
+       if (strcmp(name, ".")) {
+               name2 = realpath(name, resolved_path);
+               if (!name2) {
+                       fprintf(stderr, "realpath(%s) failed, %m\n", name);
+                       exit(1);
+               }
+       }
+       else {
+               name2 = "";
+       }
+
+       path_array = realloc(path_array, (++paths)*sizeof(*path_array));
+       if (!path_array) {
+               fprintf(stderr, "cannot expand path_arry\n");
+               exit(1);
+       }
+
+       path = path_array+paths-1;
+       path->len = strlen(name2);
+       path->buffer = malloc(path->len+1+256+1);
+       if (!path->buffer) {
+               fprintf(stderr, "cannot allocate path buffer\n");
+               exit(1);
+       }
+       strcpy(path->buffer, name2);
+       if (path->len && *(path->buffer+path->len-1) != '/') {
+               *(path->buffer+path->len) = '/';
+               *(path->buffer+(++(path->len))) = '\0';
+       }
 }
 
 
@@ -210,7 +262,7 @@ void use_config(const char * name, int len)
        char *pc;
        int i;
 
-       pc = path_array[0].buffer + path_array[0].len;
+       pc = path_array[paths-1].buffer + path_array[paths-1].len;
        memcpy(pc, "config/", 7);
        pc += 7;
 
@@ -228,7 +280,7 @@ void use_config(const char * name, int len)
        define_config(pc, len);
 
        do_depname();
-       printf(" \\\n   $(wildcard %s.h)", path_array[0].buffer);
+       printf(" \\\n   $(wildcard %s.h)", path_array[paths-1].buffer);
 }
 
 
@@ -387,7 +439,7 @@ pound_include_dquote:
        GETNEXT
        CASE('\n', start);
        NOTCASE('"', pound_include_dquote);
-       handle_include(1, map_dot, next - map_dot - 1);
+       handle_include(0, map_dot, next - map_dot - 1);
        goto start;
 
 /* #\s*include\s*<(.*)> */
@@ -395,7 +447,7 @@ pound_include_langle:
        GETNEXT
        CASE('\n', start);
        NOTCASE('>', pound_include_langle);
-       handle_include(0, map_dot, next - map_dot - 1);
+       handle_include(1, map_dot, next - map_dot - 1);
        goto start;
 
 /* #\s*d */
@@ -524,7 +576,7 @@ void do_depend(const char * filename, const char * command)
 int main(int argc, char **argv)
 {
        int len;
-       char *hpath;
+       const char *hpath;
 
        hpath = getenv("HPATH");
        if (!hpath) {
@@ -532,12 +584,26 @@ int main(int argc, char **argv)
                      "Don't bypass the top level Makefile.\n", stderr);
                return 1;
        }
-       len = strlen(hpath);
-       memcpy(path_array[0].buffer, hpath, len);
-       if (len && hpath[len-1] != '/')
-               path_array[0].buffer[len++] = '/';
-       path_array[0].buffer[len] = '\0';
-       path_array[0].len = len;
+
+       add_path(".");          /* for #include "..." */
+
+       while (++argv, --argc > 0) {
+               if (strncmp(*argv, "-I", 2) == 0) {
+                       if (*((*argv)+2)) {
+                               add_path((*argv)+2);
+                       }
+                       else {
+                               ++argv;
+                               --argc;
+                               add_path(*argv);
+                       }
+               }
+               else if (strcmp(*argv, "--") == 0) {
+                       break;
+               }
+       }
+
+       add_path(hpath);        /* must be last entry, for config files */
 
        while (--argc > 0) {
                const char * filename = *++argv;
index 4682d0c7eb50e2e145cfd93a7ba41e2cf93e5129..c3f510e1556f6a774a264cada6a41016c74c2cd7 100644 (file)
@@ -5,30 +5,64 @@
 # differ on your system.
 #
 PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
-echo '-- Versions installed: (if some fields are empty or look'
-echo '-- unusual then possibly you have very old versions)'
+echo 'If some fields are empty or look unusual you may have an old version.'
+echo 'Compare to the current minimal requirements in Documentation/Changes.'
+echo ' '
+
 uname -a
-insmod -V  2>&1 | awk 'NR==1 {print "Kernel modules        ",$NF}'
+echo ' '
+
 echo "Gnu C                 " `gcc --version`
+
 make --version 2>&1 | awk -F, '{print $1}' | awk \
-      '/GNU Make/{print "Gnu Make              ",$NF}'
+      '/GNU Make/{print "Gnu make              ",$NF}'
+
 ld -v 2>&1 | awk -F\) '{print $1}' | awk \
-      '/BFD/{print "Binutils              ",$NF}'
-ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed -e 's/\.so$//' \
-  | awk -F'[.-]'   '{print "Linux C Library        " $(NF-2)"."$(NF-1)"."$NF}'
-echo -n "Dynamic linker         "
-ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -1
+      '/BFD/{print "binutils              ",$NF}'
+
+mount --version | awk -F\- '{print "util-linux            ", $NF}'
+
+insmod -V  2>&1 | awk 'NR==1 {print "modutils              ",$NF}'
+
+tune2fs 2>&1 | grep tune2fs | sed 's/,//' |  awk \
+'NR==1 {print "e2fsprogs             ", $2}'
+
+reiserfsck 2>&1 | grep reiserfsprogs | awk \
+'NR==1{print "reiserfsprogs         ", $NF}'
+
+cardmgr -V 2>&1| grep version | awk \
+'NR==1{print "pcmcia-cs             ", $3}'
+
+pppd --version 2>&1| grep version | awk \
+'NR==1{print "PPP                   ", $3}'
+
+isdnctrl 2>&1 | grep version | awk \
+'NR==1{print "isdn4k-utils          ", $NF}'
+
+ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \
+-e 's/\.so$//' | awk -F'[.-]'   '{print "Linux C Library        " \
+$(NF-2)"."$(NF-1)"."$NF}'
+
+ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -1 | awk \
+'NR==1{print "Dynamic linker (ldd)  ", $NF}'
+
 ls -l /usr/lib/lib{g,stdc}++.so  2>/dev/null | awk -F. \
        '{print "Linux C++ Library      " $4"."$5"."$6}'
+
 ps --version 2>&1 | awk 'NR==1{print "Procps                ", $NF}'
-mount --version | awk -F\- '{print "Mount                 ", $NF}'
-hostname -V 2>&1 | awk 'NR==1{print "Net-tools             ", $NF}'
+
+ifconfig --version 2>&1 | grep tools | awk \
+'NR==1{print "Net-tools             ", $NF}'
+
 # Kbd needs 'loadkeys -h',
 loadkeys -h 2>&1 | awk \
 '(NR==1 && ($3 !~ /option/)) {print "Kbd                   ", $3}'
+
 # while console-tools needs 'loadkeys -V'.
 loadkeys -V 2>&1 | awk \
 '(NR==1 && ($2 ~ /console-tools/)) {print "Console-tools         ", $3}'
+
 expr --v 2>&1 | awk 'NR==1{print "Sh-utils              ", $NF}'
+
 X=`cat /proc/modules | sed -e "s/ .*$//"`
 echo "Modules Loaded         "$X