summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/Configure.help213
-rw-r--r--Documentation/usb/ov511.txt6
-rw-r--r--MAINTAINERS24
-rw-r--r--Makefile2
-rw-r--r--arch/alpha/kernel/sys_nautilus.c5
-rw-r--r--arch/alpha/kernel/time.c8
-rw-r--r--arch/i386/Makefile2
-rw-r--r--arch/i386/config.in1
-rw-r--r--arch/i386/kernel/apm.c83
-rw-r--r--arch/i386/kernel/i386_ksyms.c2
-rw-r--r--arch/mips/kernel/mips_ksyms.c1
-rw-r--r--arch/mips64/kernel/mips64_ksyms.c1
-rw-r--r--arch/ppc/amiga/chipram.c1
-rw-r--r--arch/ppc/kernel/idle.c2
-rw-r--r--arch/s390/config.in3
-rw-r--r--arch/sparc/kernel/process.c5
-rw-r--r--arch/sparc/kernel/smp.c64
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c3
-rw-r--r--arch/sparc/kernel/sun4d_smp.c6
-rw-r--r--arch/sparc/kernel/sun4m_smp.c6
-rw-r--r--arch/sparc/kernel/sys_sparc.c2
-rw-r--r--arch/sparc/kernel/sys_sunos.c2
-rw-r--r--arch/sparc/mm/init.c6
-rw-r--r--arch/sparc/mm/srmmu.c8
-rw-r--r--arch/sparc/mm/sun4c.c5
-rw-r--r--arch/sparc64/config.in2
-rw-r--r--arch/sparc64/kernel/process.c2
-rw-r--r--arch/sparc64/kernel/sys_sparc.c2
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c2
-rw-r--r--arch/sparc64/kernel/sys_sunos32.c2
-rw-r--r--arch/sparc64/lib/Makefile2
-rw-r--r--arch/sparc64/lib/dec_and_lock.S2
-rw-r--r--arch/sparc64/mm/ultra.S2
-rw-r--r--arch/sparc64/solaris/fs.c2
-rw-r--r--drivers/acorn/net/ether1.c6
-rw-r--r--drivers/acorn/net/ether1.h2
-rw-r--r--drivers/acorn/net/ether3.c8
-rw-r--r--drivers/acorn/net/ether3.h2
-rw-r--r--drivers/block/md.c8
-rw-r--r--drivers/char/synclink.c893
-rw-r--r--drivers/isdn/isdn_net.c2
-rw-r--r--drivers/macintosh/via-pmu.c24
-rw-r--r--drivers/mtd/Config.in36
-rw-r--r--drivers/mtd/physmap.c7
-rw-r--r--drivers/net/3c509.c6
-rw-r--r--drivers/net/3c515.c6
-rw-r--r--drivers/net/aironet4500.h4
-rw-r--r--drivers/net/aironet4500_core.c2
-rw-r--r--drivers/net/am79c961a.c2
-rw-r--r--drivers/net/am79c961a.h2
-rw-r--r--drivers/net/appletalk/ipddp.c4
-rw-r--r--drivers/net/arlan.c4
-rw-r--r--drivers/net/arlan.h4
-rw-r--r--drivers/net/at1700.c6
-rw-r--r--drivers/net/dmfe.c6
-rw-r--r--drivers/net/eepro.c6
-rw-r--r--drivers/net/eepro100.c6
-rw-r--r--drivers/net/ibmlana.c4
-rw-r--r--drivers/net/ibmlana.h2
-rw-r--r--drivers/net/pcmcia/netwave_cs.c8
-rw-r--r--drivers/net/pcmcia/ray_cs.c6
-rw-r--r--drivers/net/pcmcia/ray_cs.h2
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c6
-rw-r--r--drivers/net/ptifddi.c2
-rw-r--r--drivers/net/rcpci45.c8
-rw-r--r--drivers/net/rtl8129.c8
-rw-r--r--drivers/net/sb1000.c4
-rw-r--r--drivers/net/sgiseeq.c4
-rw-r--r--drivers/net/sis900.c4
-rw-r--r--drivers/net/sk_mca.c4
-rw-r--r--drivers/net/sk_mca.h2
-rw-r--r--drivers/net/skfp/skfddi.c6
-rw-r--r--drivers/net/sonic.c2
-rw-r--r--drivers/net/sonic.h4
-rw-r--r--drivers/net/strip.c6
-rw-r--r--drivers/net/sunbmac.c4
-rw-r--r--drivers/net/sunbmac.h2
-rw-r--r--drivers/net/tokenring/smctr.c6
-rw-r--r--drivers/net/tokenring/tms380tr.c6
-rw-r--r--drivers/net/tulip/tulip_core.c2
-rw-r--r--drivers/net/wan/Config.in2
-rw-r--r--drivers/net/wan/Makefile8
-rw-r--r--drivers/net/wan/hostess_sv11.c2
-rw-r--r--drivers/net/wan/lmc/lmc_main.c6
-rw-r--r--drivers/net/wan/lmc/lmc_var.h2
-rw-r--r--drivers/net/wan/sbni.c4
-rw-r--r--drivers/net/wan/sbni.h2
-rw-r--r--drivers/net/wan/sdla_chdlc.c6
-rw-r--r--drivers/net/wan/sdla_fr.c4
-rw-r--r--drivers/net/wan/sealevel.c2
-rw-r--r--drivers/parport/ChangeLog10
-rw-r--r--drivers/parport/parport_pc.c83
-rw-r--r--drivers/sound/Makefile2
-rw-r--r--drivers/usb/bluetooth.c1
-rw-r--r--drivers/usb/hub.c2
-rw-r--r--drivers/usb/ov511.c336
-rw-r--r--drivers/usb/ov511.h16
-rw-r--r--fs/buffer.c3
-rw-r--r--fs/partitions/Makefile53
-rw-r--r--fs/select.c111
-rw-r--r--include/asm-i386/pgtable.h2
-rw-r--r--include/asm-sparc/asm_offsets.h40
-rw-r--r--include/asm-sparc/bitops.h28
-rw-r--r--include/asm-sparc/pgalloc.h6
-rw-r--r--include/asm-sparc/pgtable.h9
-rw-r--r--include/asm-sparc/smp.h6
-rw-r--r--include/asm-sparc64/asm_offsets.h60
-rw-r--r--include/linux/arcdevice.h2
-rw-r--r--include/linux/hdlcdrv.h4
-rw-r--r--include/linux/if_eql.h2
-rw-r--r--include/linux/if_ether.h8
-rw-r--r--include/linux/if_frad.h4
-rw-r--r--include/linux/if_pppvar.h2
-rw-r--r--include/linux/isdn.h2
-rw-r--r--include/linux/mm.h3
-rw-r--r--include/linux/poll.h11
-rw-r--r--include/linux/types.h3
-rw-r--r--include/linux/wait.h2
-rw-r--r--include/linux/wanrouter.h4
-rw-r--r--include/net/irda/irlan_common.h2
-rw-r--r--include/net/irda/irlan_eth.h2
-rw-r--r--mm/page_alloc.c17
-rw-r--r--mm/vmscan.c13
-rw-r--r--net/ipv6/reassembly.c1
-rw-r--r--net/irda/irlan/irlan_eth.c2
125 files changed, 1531 insertions, 986 deletions
diff --git a/Documentation/Configure.help b/Documentation/Configure.help
index 7378f7002..8e10720f9 100644
--- a/Documentation/Configure.help
+++ b/Documentation/Configure.help
@@ -7218,6 +7218,14 @@ CONFIG_SEALEVEL_4021
If you want to do that, say M here. The module will be called
sealevel.o.
+SyncLink HDLC/SYNCPPP support
+CONFIG_SYNCLINK_SYNCPPP
+ Enables HDLC/SYNCPPP support for the SyncLink WAN driver.
+ Normally the SyncLink WAN driver works with the main PPP
+ driver (ppp.c) and pppd program. HDLC/SYNCPPP support allows use
+ of the Cisco HDLC/PPP driver (syncppp.c).
+ The SyncLink WAN driver (in character devices) must also be enabled.
+
Frame Relay (DLCI) support
CONFIG_DLCI
This is support for the frame relay protocol; frame relay is a fast
@@ -8458,7 +8466,7 @@ CONFIG_ARCNET_RIM_I
This is yet another chipset driver for the COM90xx cards, but this
time only using memory-mapped mode, and no IO ports at all. This
driver is completely untested, so if you have one of these cards,
- please mail David.Woodhouse@mvhi.com, especially if it works!
+ please mail dwmw2@infradead.org, especially if it works!
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you
@@ -9551,6 +9559,182 @@ CONFIG_QUOTA
http://www.linuxdoc.org/docs.html#howto . Probably the quota
support is only useful for multi user systems. If unsure, say N.
+Memory Technology Device (MTD) support
+CONFIG_MTD
+ Memory Technology Devices are flash, RAM and similar chips, often
+ used for solid state filesystems on embedded devices. This option
+ will provide the generic support for MTD drivers to register
+ themselves with the kernel and for potential users of MTD devices
+ to enumerate the devices which are present and obtain a handle on
+ them. It will also allow you to select individual drivers for
+ particular hardware and users of MTD device. If unsure, say N.
+
+M-Systems Disk-On-Chip 1000 support
+CONFIG_MTD_DOC1000
+ This provides an MTD device driver for the M-Systems DiskOnChip
+ 1000 devices, which are obsolete so you probably want to say 'N'.
+
+M-Systems Disk-On-Chip 2000 support
+CONFIG_MTD_DOC2000
+ This provides an MTD device driver for the M-Systems DiskOnChip
+ 2000 devices. If you use this, you probably also want the NFTL
+ 'NAND Flash Translation Layer' below, which is used to emulate
+ a block device by using a kind of filesystem on the flash chips.
+
+M-Systems Disk-On-Chip Millennium support
+CONFIG_MTD_DOC2001
+ This provides an MTD device driver for the M-Systems DiskOnChip
+ Millennium devices. If you use this, you probably also want the
+ NFTL 'NAND Flash Translation Layer' below, which is used to emulate
+ a block device by using a kind of filesystem on the flash chips.
+
+Use extra onboard system memory as MTD device
+CONFIG_MTD_SLRAM
+ If your CPU cannot cache all of the physical memory in your machine,
+ you can still use it for storage or swap by using this driver to
+ present it to the system as a Memory Technology Device.
+
+Ramix PMC551 PCI Mezzanine ram card support
+CONFIG_MTD_PMC551
+ This provides an MTD device driver for the Ramix PMC551 RAM card.
+ If you have one, you probably want to enable this.
+
+PMC551 256M DRAM Bugfix.
+CONFIG_MTD_PMC551_BUGFIX
+ Some PMC551 boards hacve invalid column and row mux values. This
+ option will fix them, but will break other memory configurations.
+
+Debugging RAM test driver
+CONFIG_MTD_MTDRAM
+ This enables a test MTD device driver which uses vmalloc() to
+ provide storage. You probably want to say 'N' unless you're
+ testing stuff, or unless you want to use it in place of a ramdisk
+ when I've eventually got round to making the CONFIG_BLK_DEV option
+ and you've turned it off.
+
+Common Flash Interface (CFI) support
+CONFIG_MTD_CFI
+ Intel's Common Flash Interface specification provides a universal
+ method for probing the capabilities of flash devices. If you wish
+ to support any device which uses CFI-compliant devices, you need
+ to enable this option.
+
+CFI support for Intel/Sharp Extended Command Set chips
+CONFIG_MTD_CFI_INTELEXT
+ The Common Flash Interface defines a number of different command
+ sets which a CFI-compliant chip may claim to implement. This code
+ provides support for one of those command sets, used on Intel
+ Strataflash and other parts.
+
+Flash chip mapping in physical memory
+CONFIG_MTD_PHYSMAP
+ This provides a 'mapping' driver which allows the CFI probe and
+ command set driver code to communicate with flash chips which
+ are mapped physically into the CPU's memory. You will need to
+ configure the physical address and size of the flash chips on
+ your particular board.
+
+Physical start location of flash chip mapping
+CONFIG_MTD_PHYSMAP_START
+ This is the physical memory location at which the flash chips
+ are mapped on your particular target board. Refer to the
+ memory map which should hopefully be in the documentation for
+ your board.
+
+Physical length of flash chip mapping
+CONFIG_MTD_PHYSMAP_LEN
+ This is the total length of the mapping of the flash chips on
+ your particular board. If there is space, or aliases, in the
+ physical memory map between the chips, this could be larger
+ than the total amount of flash present. Refer to the memory
+ map which should hopefully be in the documentation for your
+ board.
+
+Flash chip mapping on Mixcom piggyback card
+CONFIG_MTD_MIXMEM
+ This supports the paging arrangement for access to flash chips
+ on the Mixcom piggyback card, allowing the flash chip drivers
+ to get on with their job of driving the flash chips without
+ having to know about the paging. If you have one of these boards,
+ you probably want to enable this mapping driver.
+
+Flash chip mapping on Nora
+CONFIG_MTD_NORA
+ If you had to ask, you don't have one. Say 'N'.
+
+Flash chip mapping on Octagon 5066 SBC
+CONFIG_MTD_OCTAGON
+ This provides a 'mapping' driver which supports the way in which
+ the flash chips are connected in the Octagon-5066 Single Board
+ Computer. You will also need to complete and enable the driver
+ for JEDEC flash chips.
+
+Flash chip mapping on RPXlite PPC board
+CONFIG_MTD_RPXLITE
+ The RPXLite PowerPC board has CFI-compliant chips mapped in
+ a strange sparse mapping. This 'mapping' driver supports that
+ arrangement, allowing the CFI probe and command set driver code
+ to communicate with the chips on the RPXLite board.
+
+Flash chip mapping on Tempustech VMAX SBC301
+CONFIG_MTD_VMAX
+ This provides a 'mapping' driver which supports the way in which
+ the flash chips are connected in the Tempustech VMAX SBC301 Single
+ Board Computer. You will also need to complete and enable the driver
+ for JEDEC flash chips.
+
+Direct chardevice access to MTD devices
+CONFIG_MTD_CHAR
+ This provides a character device for each MTD device present in
+ the system, allowing the user to read and write directly to the
+ memory chips, and also use ioctl() to obtain information about
+ the device, or to erase parts of it.
+
+Pseudo-blockdevice access to MTD devices
+CONFIG_MTD_BLOCK
+ Although flash chips have an erase size too large to useful as
+ block devices, it is possible to use MTD devices which are based
+ on RAM chips in this manner. This blockdevice user of MTD devices
+ performs that function. At the moment, it is also required for
+ the Journalling Flash File System to obtain a handle on the MTD
+ device when it's mounted - although the JFFS doesn't actually use
+ any of the functions of the mtdblock device.
+
+ Later, it may be extended to perform read/erase/modify/write cycles
+ on flash chips to emulate a smaller block size. Needless to say,
+ this is very unsafe, but could be useful for filesystems which are
+ almost never written to.
+
+FTL (Flash Translation Layer) support
+CONFIG_FTL
+ This provides support for the original Flash Translation Layer which
+ is part of the PCMCIA specification. It uses a kind of pseudo-
+ filesystem on a flash device to emulate a block device with 512-byte
+ sectors, on top of which you put a 'normal' filesystem. You may find
+ that the algorithms used in this code are patented unless you live
+ in the Free World where software patents aren't legal - in the USA
+ you are only permitted to use this on PCMCIA hardware, although
+ under the terms of the GPL you're obviously permitted to copy,
+ modify and distribute the code as you wish. Just not use it.
+
+NFTL (NAND Flash Translation Layer) support
+CONFIG_NFTL
+ This provides support for the NAND Flash Translation Layer which is
+ used on M-Systems' DiskOnChip devices. It uses a kind of pseudo-
+ filesystem on a flash device to emulate a block device with 512-byte
+ sectors, on top of which you put a 'normal' filesystem. You may find
+ that the algorithms used in this code are patented unless you live
+ in the Free World where software patents aren't legal - in the USA
+ you are only permitted to use this on DiskOnChip hardware, although
+ under the terms of the GPL you're obviously permitted to copy,
+ modify and distribute the code as you wish. Just not use it.
+
+Write support for NFTL (EXPERIMENTAL)
+CONFIG_NFTL_RW
+ If you're lucky, this will actually work. Don't whinge if it doesn't.
+ Contact dwmw2@infradead.org if you want to help to make it more
+ reliable.
+
Support for USB
CONFIG_USB
Universal Serial Bus (USB) is a specification for a serial bus
@@ -10781,6 +10965,22 @@ CONFIG_EFS_FS
whenever you want), say M here and read Documentation/modules.txt.
The module will be called efs.o.
+Journalling Flash File System (JFFS) support (EXPERIMENTAL)
+CONFIG_JFFS_FS
+ JFFS is a new file system designed for use on flash memory devices
+ rather than on block devices. It was developed on the 2.0 kernel
+ by Axis Communications AB for use on their Linux-based products,
+ and released under GPL, then 'borrowed' and ported to work with
+ the 2.4 kernel and the new Memory Technology Device system.
+
+ The 2.4 port is experimental and not yet supported by Axis. Basically,
+ the good bits are probably theirs, and if it's broken in 2.4 it's
+ probably our fault. See http://www.developer.axis.com/software/jffs/
+ for more information about JFFS.
+
+ Any potential patches or queries should be sent to Axis' mailing
+ list for JFFS: <jffs-dev@axis.com>
+
UFS file system support (read-only)
CONFIG_UFS_FS
BSD and derivate versions of Unix (such as SunOS, FreeBSD, NetBSD,
@@ -12433,7 +12633,7 @@ CONFIG_APPLICOM
fieldbus cards made by Applicom International. More information
about these cards can be found on the WWW at the address
http://www.applicom-int.com/ , or by email from David Woodhouse
- <dwmw2@mvhi.com>.
+ <dwmw2@infradead.org>.
To compile this driver as a module ( = code which can be inserted in
and removed from the running kernel whenever you want), say M here
@@ -12615,15 +12815,6 @@ CONFIG_APM_DISPLAY_BLANK
backlight at all, or it might print a lot of errors to the console,
especially if you are using gpm.
-Ignore multiple suspend/resume cycles
-CONFIG_APM_IGNORE_SUSPEND_BOUNCE
- This option is necessary on the Dell Inspiron 3200 and others, but
- should be safe for all other laptops. When enabled, a system suspend
- event that occurs within three seconds of a resume is ignored.
- Without this the Inspiron will shut itself off a few seconds after
- you open the lid, requiring you to press the power button to resume
- it a second time. Say Y.
-
RTC stores time in GMT
CONFIG_APM_RTC_IS_GMT
Say Y here if your RTC (Real Time Clock a.k.a. hardware clock)
diff --git a/Documentation/usb/ov511.txt b/Documentation/usb/ov511.txt
index e5634fd7f..4380ed791 100644
--- a/Documentation/usb/ov511.txt
+++ b/Documentation/usb/ov511.txt
@@ -6,7 +6,9 @@ Author: Mark McClelland
Homepage: http://alpha.dyndns.org/ov511
NEW IN THIS VERSION:
- o Preliminary support for YUV422 and YUV422P V4L modes
+ o Sensor detection fixes
+ o More efficient/reliable buffer allocation
+ o Many minor fixes
INTRODUCTION:
@@ -176,7 +178,7 @@ MODULE PARAMETERS:
WORKING FEATURES:
o Color streaming/capture at 640x480, 448x336, 384x288, 352x288, and 320x240
- o YUV420 color
+ o YUV420 and YUV422P color
o Monochrome
o Setting/getting of saturation, contrast and brightness (no hue yet; only
works with OV7610, not the OV7620 or OV7620AE)
diff --git a/MAINTAINERS b/MAINTAINERS
index 7fcfdae09..a2140268a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -600,6 +600,13 @@ L: isdn4linux@listserv.isdn4linux.de
W: http://www.melware.de
S: Maintained
+JOURNALLING FLASH FILE SYSTEM (JFFS)
+P: Axis Communications AB
+M: jffs-dev@axis.com
+L: jffs-dev@axis.com
+W: http://www.developer.axis.com/software/jffs/
+S: Maintained
+
JOYSTICK DRIVER
P: Vojtech Pavlik
M: vojtech@suse.cz
@@ -645,11 +652,6 @@ W: http://www.linuxppc.org/
L: linuxppc-dev@lists.linuxppc.org
S: Maintained
-MAESTRO PCI SOUND DRIVER
-P: Zach Brown
-M: zab@zabbo.net
-S: Odd Fixes
-
M68K
P: Jes Sorensen
M: Jes.Sorensen@cern.ch
@@ -670,6 +672,18 @@ M: philb@gnu.org
W: http://www.tazenda.demon.co.uk/phil/linux-hp
S: Maintained
+MAESTRO PCI SOUND DRIVER
+P: Zach Brown
+M: zab@zabbo.net
+S: Odd Fixes
+
+MEMORY TECHNOLOGY DEVICES
+P: David Woodhouse
+M: dwmw2@redhat.com
+W: http://www.linux-mtd.infradead.org/
+L: mtd@infradead.org
+S: Maintained
+
MIPS
P: Ralf Baechle
M: ralf@gnu.ai.mit.edu
diff --git a/Makefile b/Makefile
index 68b86814e..eda5ba490 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 0
-EXTRAVERSION = -test3
+EXTRAVERSION = -test4
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c
index 32653e3a7..2115b8d2c 100644
--- a/arch/alpha/kernel/sys_nautilus.c
+++ b/arch/alpha/kernel/sys_nautilus.c
@@ -53,6 +53,11 @@
static void __init
nautilus_init_irq(void)
{
+ if (alpha_using_srm) {
+ alpha_mv.device_interrupt = srm_device_interrupt;
+ alpha_mv.kill_arch = NULL;
+ }
+
init_i8259a_irqs();
common_init_isa_dma();
}
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index 8cac7f240..d4ad98651 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -45,7 +45,7 @@
#include "irq_impl.h"
extern rwlock_t xtime_lock;
-extern volatile unsigned long lost_ticks; /* kernel/sched.c */
+extern unsigned long wall_jiffies; /* kernel/timer.c */
static int set_rtc_mmss(unsigned long);
@@ -312,7 +312,7 @@ do_gettimeofday(struct timeval *tv)
sec = xtime.tv_sec;
usec = xtime.tv_usec;
partial_tick = state.partial_tick;
- lost = lost_ticks;
+ lost = jiffies - wall_jiffies;
read_unlock_irqrestore(&xtime_lock, flags);
@@ -363,12 +363,12 @@ do_settimeofday(struct timeval *tv)
time. Without this, a full-tick error is possible. */
#ifdef CONFIG_SMP
- delta_usec = lost_ticks * (1000000 / HZ);
+ delta_usec = (jiffies - wall_jiffies) * (1000000 / HZ);
#else
delta_usec = rpcc() - state.last_time;
delta_usec = (delta_usec * state.scaled_ticks_per_cycle
+ state.partial_tick
- + (lost_ticks << FIX_SHIFT)) * 15625;
+ + ((jiffies - wall_jiffies) << FIX_SHIFT)) * 15625;
delta_usec = ((delta_usec / ((1UL << (FIX_SHIFT-6-1)) * HZ)) + 1) / 2;
#endif
diff --git a/arch/i386/Makefile b/arch/i386/Makefile
index 3c418f4ef..b63dcb89e 100644
--- a/arch/i386/Makefile
+++ b/arch/i386/Makefile
@@ -114,6 +114,8 @@ compressed: zImage
zlilo: vmlinux
@$(MAKEBOOT) BOOTIMAGE=zImage zlilo
+tmp:
+ @$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
bzlilo: vmlinux
@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
diff --git a/arch/i386/config.in b/arch/i386/config.in
index a2252d7af..6557d822d 100644
--- a/arch/i386/config.in
+++ b/arch/i386/config.in
@@ -225,7 +225,6 @@ if [ "$CONFIG_APM" != "n" ]; then
bool ' Enable PM at boot time' CONFIG_APM_DO_ENABLE
bool ' Make CPU Idle calls when idle' CONFIG_APM_CPU_IDLE
bool ' Enable console blanking using APM' CONFIG_APM_DISPLAY_BLANK
- bool ' Ignore multiple suspend/resume cycles' CONFIG_APM_IGNORE_SUSPEND_BOUNCE
bool ' RTC stores time in GMT' CONFIG_APM_RTC_IS_GMT
bool ' Allow interrupts during APM BIOS calls' CONFIG_APM_ALLOW_INTS
bool ' Use real mode APM BIOS call to power off' CONFIG_APM_REAL_MODE_POWER_OFF
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index 6a4eedf72..a915181a9 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -142,6 +142,8 @@
* <andy_henroid@yahoo.com> fixed by sfr).
* Make power off work on SMP again (Tony Hoyle
* <tmh@magenta-logic.com> and <zlatko@iskon.hr>) modified by sfr.
+ * Remove CONFIG_APM_SUSPEND_BOUNCE. The bounce ignore
+ * interval is now configurable.
*
* APM 1.1 Reference:
*
@@ -178,6 +180,7 @@
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/pm.h>
+#include <linux/kernel.h>
#include <asm/system.h>
#include <asm/uaccess.h>
@@ -267,10 +270,9 @@ extern int (*console_blank_hook)(int);
#define APM_CHECK_TIMEOUT (HZ)
/*
- * If CONFIG_APM_IGNORE_SUSPEND_BOUNCE is defined then
- * ignore suspend events for this amount of time after a resume
+ * Ignore suspend events for this amount of time after a resume
*/
-#define BOUNCE_INTERVAL (3 * HZ)
+#define DEFAULT_BOUNCE_INTERVAL (3 * HZ)
/*
* Save a segment register away
@@ -314,28 +316,30 @@ static struct {
unsigned short segment;
} apm_bios_entry;
#ifdef CONFIG_APM_CPU_IDLE
-static int clock_slowed = 0;
+static int clock_slowed;
#endif
-static int suspends_pending = 0;
-static int standbys_pending = 0;
-static int waiting_for_resume = 0;
+static int suspends_pending;
+static int standbys_pending;
+static int waiting_for_resume;
+static int ignore_normal_resume;
+static int bounce_interval = DEFAULT_BOUNCE_INTERVAL;
#ifdef CONFIG_APM_RTC_IS_GMT
# define clock_cmos_diff 0
# define got_clock_diff 1
#else
static long clock_cmos_diff;
-static int got_clock_diff = 0;
+static int got_clock_diff;
#endif
-static int debug = 0;
-static int apm_disabled = 0;
+static int debug;
+static int apm_disabled;
#ifdef CONFIG_SMP
-static int power_off = 0;
+static int power_off;
#else
static int power_off = 1;
#endif
-static int exit_kapmd = 0;
-static int kapmd_running = 0;
+static int exit_kapmd;
+static int kapmd_running;
static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
@@ -912,16 +916,16 @@ static int suspend(void)
set_time();
if (err == APM_NO_ERROR)
err = APM_SUCCESS;
- if (err != APM_SUCCESS) {
+ if (err != APM_SUCCESS)
apm_error("suspend", err);
- send_event(APM_NORMAL_RESUME);
- sti();
- queue_event(APM_NORMAL_RESUME, NULL);
- }
+ send_event(APM_NORMAL_RESUME);
+ sti();
+ queue_event(APM_NORMAL_RESUME, NULL);
for (as = user_list; as != NULL; as = as->next) {
as->suspend_wait = 0;
as->suspend_result = ((err == APM_SUCCESS) ? 0 : -EIO);
}
+ ignore_normal_resume = 1;
wake_up_interruptible(&apm_suspend_waitqueue);
return err;
}
@@ -942,7 +946,7 @@ static apm_event_t get_event(void)
apm_event_t event;
apm_eventinfo_t info;
- static int notified = 0;
+ static int notified;
/* we don't use the eventinfo */
error = apm_get_event(&event, &info);
@@ -958,10 +962,8 @@ static apm_event_t get_event(void)
static void check_events(void)
{
apm_event_t event;
-#ifdef CONFIG_APM_IGNORE_SUSPEND_BOUNCE
- static unsigned long last_resume = 0;
- static int ignore_bounce = 0;
-#endif
+ static unsigned long last_resume;
+ static int ignore_bounce;
while ((event = get_event()) != 0) {
if (debug) {
@@ -972,11 +974,12 @@ static void check_events(void)
printk(KERN_DEBUG "apm: received unknown "
"event 0x%02x\n", event);
}
-#ifdef CONFIG_APM_IGNORE_SUSPEND_BOUNCE
if (ignore_bounce
- && ((jiffies - last_resume) > BOUNCE_INTERVAL))
+ && ((jiffies - last_resume) > bounce_interval))
ignore_bounce = 0;
-#endif
+ if (ignore_normal_resume && (event != APM_NORMAL_RESUME))
+ ignore_normal_resume = 0;
+
switch (event) {
case APM_SYS_STANDBY:
case APM_USER_STANDBY:
@@ -994,10 +997,11 @@ static void check_events(void)
break;
#endif
case APM_SYS_SUSPEND:
-#ifdef CONFIG_APM_IGNORE_SUSPEND_BOUNCE
- if (ignore_bounce)
+ if (ignore_bounce) {
+ if (apm_bios_info.version > 0x100)
+ apm_set_power_state(APM_STATE_REJECT);
break;
-#endif
+ }
/*
* If we are already processing a SUSPEND,
* then further SUSPEND events from the BIOS
@@ -1020,14 +1024,14 @@ static void check_events(void)
case APM_CRITICAL_RESUME:
case APM_STANDBY_RESUME:
waiting_for_resume = 0;
-#ifdef CONFIG_APM_IGNORE_SUSPEND_BOUNCE
last_resume = jiffies;
ignore_bounce = 1;
-#endif
- set_time();
- send_event(event);
- sti();
- queue_event(event, NULL);
+ if ((event != APM_NORMAL_RESUME)
+ || (ignore_normal_resume == 0)) {
+ set_time();
+ send_event(event);
+ queue_event(event, NULL);
+ }
break;
case APM_CAPABILITY_CHANGE:
@@ -1519,6 +1523,7 @@ static int apm(void *unused)
return 0;
}
+#ifndef MODULE
static int __init apm_setup(char *str)
{
int invert;
@@ -1536,6 +1541,9 @@ static int __init apm_setup(char *str)
if ((strncmp(str, "power-off", 9) == 0) ||
(strncmp(str, "power_off", 9) == 0))
power_off = !invert;
+ if ((strncmp(str, "bounce-interval=", 16) == 0) ||
+ (strncmp(str, "bounce_interval=", 16) == 0))
+ bounce_interval = simple_strtol(str + 16, NULL, 0);
str = strchr(str, ',');
if (str != NULL)
str += strspn(str, ", \t");
@@ -1544,6 +1552,7 @@ static int __init apm_setup(char *str)
}
__setup("apm=", apm_setup);
+#endif
static struct file_operations apm_bios_fops = {
owner: THIS_MODULE,
@@ -1702,5 +1711,9 @@ MODULE_AUTHOR("Stephen Rothwell");
MODULE_DESCRIPTION("Advanced Power Management");
MODULE_PARM(debug, "i");
MODULE_PARM_DESC(debug, "Enable debug mode");
+MODULE_PARM(power_off, "i");
+MODULE_PARM_DESC(power_off, "Enable power off");
+MODULE_PARM(bounce_interval, "i");
+MODULE_PARM_DESC(bounce_interval, "Set the number of ticks to ignore suspend bounces");
EXPORT_NO_SYMBOLS;
diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c
index 824dd7938..380ac4996 100644
--- a/arch/i386/kernel/i386_ksyms.c
+++ b/arch/i386/kernel/i386_ksyms.c
@@ -11,6 +11,7 @@
#include <linux/pm.h>
#include <linux/pci.h>
#include <linux/apm_bios.h>
+#include <linux/kernel.h>
#include <asm/semaphore.h>
#include <asm/processor.h>
@@ -89,6 +90,7 @@ EXPORT_SYMBOL_NOVERS(__put_user_4);
EXPORT_SYMBOL(strtok);
EXPORT_SYMBOL(strpbrk);
+EXPORT_SYMBOL(simple_strtol);
EXPORT_SYMBOL(strncpy_from_user);
EXPORT_SYMBOL(__strncpy_from_user);
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
index 1948a67c2..b58272f46 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -49,6 +49,7 @@ EXPORT_SYMBOL_NOVERS(memcmp);
EXPORT_SYMBOL_NOVERS(memset);
EXPORT_SYMBOL_NOVERS(memcpy);
EXPORT_SYMBOL_NOVERS(memmove);
+EXPORT_SYMBOL(simple_strtol);
EXPORT_SYMBOL_NOVERS(strcat);
EXPORT_SYMBOL_NOVERS(strchr);
EXPORT_SYMBOL_NOVERS(strlen);
diff --git a/arch/mips64/kernel/mips64_ksyms.c b/arch/mips64/kernel/mips64_ksyms.c
index c65f05865..284e831b4 100644
--- a/arch/mips64/kernel/mips64_ksyms.c
+++ b/arch/mips64/kernel/mips64_ksyms.c
@@ -46,6 +46,7 @@ EXPORT_SYMBOL_NOVERS(memcmp);
EXPORT_SYMBOL_NOVERS(memset);
EXPORT_SYMBOL_NOVERS(memcpy);
EXPORT_SYMBOL_NOVERS(memmove);
+EXPORT_SYMBOL(simple_strtol);
EXPORT_SYMBOL_NOVERS(strcat);
EXPORT_SYMBOL_NOVERS(strchr);
EXPORT_SYMBOL_NOVERS(strlen);
diff --git a/arch/ppc/amiga/chipram.c b/arch/ppc/amiga/chipram.c
index 259522584..c7952c368 100644
--- a/arch/ppc/amiga/chipram.c
+++ b/arch/ppc/amiga/chipram.c
@@ -5,6 +5,7 @@
** - 64-bit aligned allocations for full AGA compatibility
*/
+#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
diff --git a/arch/ppc/kernel/idle.c b/arch/ppc/kernel/idle.c
index 1d3dfd299..a81156102 100644
--- a/arch/ppc/kernel/idle.c
+++ b/arch/ppc/kernel/idle.c
@@ -48,7 +48,7 @@ atomic_t zeropage_calls; /* # zero'd pages request that've been made */
int idled(void)
{
/* endless loop with no priority at all */
- current->priority = 0;
+ current->nice = 20;
current->counter = -100;
init_idle();
for (;;)
diff --git a/arch/s390/config.in b/arch/s390/config.in
index 96686af33..9e946365f 100644
--- a/arch/s390/config.in
+++ b/arch/s390/config.in
@@ -57,9 +57,6 @@ fi
source fs/Config.in
-# Not sure about this one. dwmw2
-# source drivers/mtd/Config.in
-
# source drivers/char/Config.in
mainmenu_option next_comment
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
index ae76ef0e0..dd5d636b9 100644
--- a/arch/sparc/kernel/process.c
+++ b/arch/sparc/kernel/process.c
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.147 2000/05/09 17:40:13 davem Exp $
+/* $Id: process.c,v 1.148 2000/07/10 23:22:32 anton Exp $
* linux/arch/sparc/kernel/process.c
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -109,7 +109,7 @@ out:
int cpu_idle(void)
{
/* endless idle loop with no priority at all */
- current->priority = 0;
+ current->nice = 20;
current->counter = -100;
init_idle();
@@ -233,6 +233,7 @@ void show_backtrace(void)
void smp_show_backtrace_all_cpus(void)
{
xc0((smpfunc_t) show_backtrace);
+ show_backtrace();
}
#endif
diff --git a/arch/sparc/kernel/smp.c b/arch/sparc/kernel/smp.c
index 6153eb99e..677b2c811 100644
--- a/arch/sparc/kernel/smp.c
+++ b/arch/sparc/kernel/smp.c
@@ -143,31 +143,37 @@ void __init smp_boot_cpus(void)
}
void smp_flush_cache_all(void)
-{ xc0((smpfunc_t) BTFIXUP_CALL(local_flush_cache_all)); }
+{
+ xc0((smpfunc_t) BTFIXUP_CALL(local_flush_cache_all));
+ local_flush_cache_all();
+}
void smp_flush_tlb_all(void)
-{ xc0((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_all)); }
+{
+ xc0((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_all));
+ local_flush_tlb_all();
+}
void smp_flush_cache_mm(struct mm_struct *mm)
-{
+{
if(mm->context != NO_CONTEXT) {
- if(mm->cpu_vm_mask == (1 << smp_processor_id()))
- local_flush_cache_mm(mm);
- else
+ if(mm->cpu_vm_mask != (1 << smp_processor_id()))
xc1((smpfunc_t) BTFIXUP_CALL(local_flush_cache_mm), (unsigned long) mm);
+
+ local_flush_cache_mm(mm);
}
}
void smp_flush_tlb_mm(struct mm_struct *mm)
{
if(mm->context != NO_CONTEXT) {
- if(mm->cpu_vm_mask == (1 << smp_processor_id())) {
- local_flush_tlb_mm(mm);
- } else {
+ if(mm->cpu_vm_mask != (1 << smp_processor_id())) {
xc1((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_mm), (unsigned long) mm);
if(atomic_read(&mm->mm_users) == 1 && current->active_mm == mm)
mm->cpu_vm_mask = (1 << smp_processor_id());
}
+
+ local_flush_tlb_mm(mm);
}
}
@@ -175,11 +181,10 @@ void smp_flush_cache_range(struct mm_struct *mm, unsigned long start,
unsigned long end)
{
if(mm->context != NO_CONTEXT) {
- if(mm->cpu_vm_mask == (1 << smp_processor_id()))
- local_flush_cache_range(mm, start, end);
- else
- xc3((smpfunc_t) BTFIXUP_CALL(local_flush_cache_range), (unsigned long) mm,
- start, end);
+ if(mm->cpu_vm_mask != (1 << smp_processor_id()))
+ xc3((smpfunc_t) BTFIXUP_CALL(local_flush_cache_range), (unsigned long) mm, start, end);
+
+ local_flush_cache_range(mm, start, end);
}
}
@@ -187,11 +192,10 @@ void smp_flush_tlb_range(struct mm_struct *mm, unsigned long start,
unsigned long end)
{
if(mm->context != NO_CONTEXT) {
- if(mm->cpu_vm_mask == (1 << smp_processor_id()))
- local_flush_tlb_range(mm, start, end);
- else
- xc3((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_range), (unsigned long) mm,
- start, end);
+ if(mm->cpu_vm_mask != (1 << smp_processor_id()))
+ xc3((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_range), (unsigned long) mm, start, end);
+
+ local_flush_tlb_range(mm, start, end);
}
}
@@ -200,11 +204,10 @@ void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page)
struct mm_struct *mm = vma->vm_mm;
if(mm->context != NO_CONTEXT) {
- if(mm->cpu_vm_mask == (1 << smp_processor_id()))
- local_flush_cache_page(vma, page);
- else
- xc2((smpfunc_t) BTFIXUP_CALL(local_flush_cache_page),
- (unsigned long) vma, page);
+ if(mm->cpu_vm_mask != (1 << smp_processor_id()))
+ xc2((smpfunc_t) BTFIXUP_CALL(local_flush_cache_page), (unsigned long) vma, page);
+
+ local_flush_cache_page(vma, page);
}
}
@@ -213,10 +216,10 @@ void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
struct mm_struct *mm = vma->vm_mm;
if(mm->context != NO_CONTEXT) {
- if(mm->cpu_vm_mask == (1 << smp_processor_id()))
- local_flush_tlb_page(vma, page);
- else
+ if(mm->cpu_vm_mask != (1 << smp_processor_id()))
xc2((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_page), (unsigned long) vma, page);
+
+ local_flush_tlb_page(vma, page);
}
}
@@ -230,6 +233,7 @@ void smp_flush_page_to_ram(unsigned long page)
*/
#if 1
xc1((smpfunc_t) BTFIXUP_CALL(local_flush_page_to_ram), page);
+ local_flush_page_to_ram(page);
#else
local_flush_page_to_ram(page);
#endif
@@ -237,10 +241,10 @@ void smp_flush_page_to_ram(unsigned long page)
void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr)
{
- if(mm->cpu_vm_mask == (1 << smp_processor_id()))
- local_flush_sig_insns(mm, insn_addr);
- else
+ if(mm->cpu_vm_mask != (1 << smp_processor_id()))
xc2((smpfunc_t) BTFIXUP_CALL(local_flush_sig_insns), (unsigned long) mm, insn_addr);
+
+ local_flush_sig_insns(mm, insn_addr);
}
/* Reschedule call back. */
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index db524c814..4d1a8db1c 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -1,4 +1,4 @@
-/* $Id: sparc_ksyms.c,v 1.99 2000/06/30 10:18:38 davem Exp $
+/* $Id: sparc_ksyms.c,v 1.100 2000/07/07 07:49:08 anton Exp $
* arch/sparc/kernel/ksyms.c: Sparc specific ksyms support.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -254,6 +254,7 @@ EXPORT_SYMBOL(strrchr);
EXPORT_SYMBOL(strpbrk);
EXPORT_SYMBOL(strtok);
EXPORT_SYMBOL(strstr);
+EXPORT_SYMBOL(page_kernel);
/* Special internal versions of library functions. */
EXPORT_SYMBOL(__copy_1page);
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c
index 79ea6061e..fe9885025 100644
--- a/arch/sparc/kernel/sun4d_smp.c
+++ b/arch/sparc/kernel/sun4d_smp.c
@@ -376,9 +376,6 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
}
}
- /* First, run local copy. */
- func(arg1, arg2, arg3, arg4, arg5);
-
{
register int i;
@@ -396,8 +393,7 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
}
spin_unlock_irqrestore(&cross_call_lock, flags);
- } else
- func(arg1, arg2, arg3, arg4, arg5); /* Just need to run local copy. */
+ }
}
/* Running cross calls. */
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c
index 289d746bd..3475a8df5 100644
--- a/arch/sparc/kernel/sun4m_smp.c
+++ b/arch/sparc/kernel/sun4m_smp.c
@@ -405,9 +405,6 @@ void smp4m_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
}
}
- /* First, run local copy. */
- func(arg1, arg2, arg3, arg4, arg5);
-
{
register int i;
@@ -425,8 +422,7 @@ void smp4m_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
}
spin_unlock_irqrestore(&cross_call_lock, flags);
- } else
- func(arg1, arg2, arg3, arg4, arg5); /* Just need to run local copy. */
+ }
}
/* Running cross calls. */
diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c
index 848dba72e..dd011c143 100644
--- a/arch/sparc/kernel/sys_sparc.c
+++ b/arch/sparc/kernel/sys_sparc.c
@@ -1,4 +1,4 @@
-/* $Id: sys_sparc.c,v 1.65 2000/07/06 01:41:29 davem Exp $
+/* $Id: sys_sparc.c,v 1.66 2000/07/10 20:57:35 davem Exp $
* linux/arch/sparc/kernel/sys_sparc.c
*
* This file contains various random system calls that
diff --git a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c
index 73cb4580c..8e95ce0ed 100644
--- a/arch/sparc/kernel/sys_sunos.c
+++ b/arch/sparc/kernel/sys_sunos.c
@@ -1,4 +1,4 @@
-/* $Id: sys_sunos.c,v 1.128 2000/07/06 01:41:29 davem Exp $
+/* $Id: sys_sunos.c,v 1.129 2000/07/10 20:57:35 davem Exp $
* sys_sunos.c: SunOS specific syscall compatibility support.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c
index 2847bd443..5ac1845a3 100644
--- a/arch/sparc/mm/init.c
+++ b/arch/sparc/mm/init.c
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.86 2000/06/04 06:23:52 anton Exp $
+/* $Id: init.c,v 1.88 2000/07/10 20:56:53 anton Exp $
* linux/arch/sparc/mm/init.c
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -37,10 +37,12 @@ unsigned long *sparc_valid_addr_bitmap;
unsigned long phys_base;
+unsigned long page_kernel;
+
struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];
unsigned long sparc_unmapped_base;
-struct pgtable_cache_struct pgt_quicklists = { 0, 0, 0, 0, SPIN_LOCK_UNLOCKED, SPIN_LOCK_UNLOCKED };
+struct pgtable_cache_struct pgt_quicklists = { 0, 0, 0, 0 };
/* References to section boundaries */
extern char __init_begin, __init_end, _start, _end, etext , edata;
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index d1431a5c0..612436b47 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -1,4 +1,4 @@
-/* $Id: srmmu.c,v 1.215 2000/06/30 13:25:28 anton Exp $
+/* $Id: srmmu.c,v 1.218 2000/07/10 23:22:32 anton Exp $
* srmmu.c: SRMMU specific routines for memory management.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -57,6 +57,8 @@ extern struct resource sparc_iomap;
extern unsigned long last_valid_pfn;
+extern unsigned long page_kernel;
+
pgd_t *srmmu_swapper_pg_dir;
#ifdef CONFIG_SMP
@@ -442,7 +444,6 @@ static pte_t *srmmu_pte_alloc(pmd_t * pmd, unsigned long address)
if(srmmu_pmd_none(*pmd)) {
pte_t *page = (pte_t *)srmmu_get_nocache(SRMMU_PTE_TABLE_SIZE, SRMMU_PTE_TABLE_SIZE);
if(page) {
- spin_unlock(&pte_spinlock);
srmmu_pmd_set(pmd, page);
return page + address;
}
@@ -467,7 +468,6 @@ static pmd_t *srmmu_pmd_alloc(pgd_t * pgd, unsigned long address)
if(srmmu_pgd_none(*pgd)) {
pmd_t *page = (pmd_t *)srmmu_get_nocache(SRMMU_PMD_TABLE_SIZE, SRMMU_PMD_TABLE_SIZE);
if(page) {
- spin_unlock(&pte_spinlock);
srmmu_pgd_set(pgd, page);
return page + address;
}
@@ -2101,6 +2101,7 @@ static void __init patch_window_trap_handlers(void)
static void smp_flush_page_for_dma(unsigned long page)
{
xc1((smpfunc_t) BTFIXUP_CALL(local_flush_page_for_dma), page);
+ local_flush_page_for_dma(page);
}
#endif
@@ -2129,6 +2130,7 @@ void __init ld_mmu_srmmu(void)
BTFIXUPSET_INT(page_copy, pgprot_val(SRMMU_PAGE_COPY));
BTFIXUPSET_INT(page_readonly, pgprot_val(SRMMU_PAGE_RDONLY));
BTFIXUPSET_INT(page_kernel, pgprot_val(SRMMU_PAGE_KERNEL));
+ page_kernel = pgprot_val(SRMMU_PAGE_KERNEL);
pg_iobits = SRMMU_VALID | SRMMU_WRITE | SRMMU_REF;
/* Functions */
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c
index af82be871..55551c561 100644
--- a/arch/sparc/mm/sun4c.c
+++ b/arch/sparc/mm/sun4c.c
@@ -1,4 +1,4 @@
-/* $Id: sun4c.c,v 1.195 2000/06/30 13:25:28 anton Exp $
+/* $Id: sun4c.c,v 1.196 2000/07/07 07:33:11 anton Exp $
* sun4c.c: Doing in software what should be done in hardware.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -45,6 +45,8 @@
extern int num_segmaps, num_contexts;
+extern unsigned long page_kernel;
+
#ifdef CONFIG_SUN4
#define SUN4C_VAC_SIZE sun4c_vacinfo.num_bytes
#else
@@ -2604,6 +2606,7 @@ void __init ld_mmu_sun4c(void)
BTFIXUPSET_INT(page_copy, pgprot_val(SUN4C_PAGE_COPY));
BTFIXUPSET_INT(page_readonly, pgprot_val(SUN4C_PAGE_READONLY));
BTFIXUPSET_INT(page_kernel, pgprot_val(SUN4C_PAGE_KERNEL));
+ page_kernel = pgprot_val(SUN4C_PAGE_KERNEL);
pg_iobits = _SUN4C_PAGE_PRESENT | _SUN4C_READABLE | _SUN4C_WRITEABLE |
_SUN4C_PAGE_IO | _SUN4C_PAGE_NOCACHE;
diff --git a/arch/sparc64/config.in b/arch/sparc64/config.in
index eede4683d..95c148eee 100644
--- a/arch/sparc64/config.in
+++ b/arch/sparc64/config.in
@@ -1,4 +1,4 @@
-# $Id: config.in,v 1.116 2000/07/06 01:41:29 davem Exp $
+# $Id: config.in,v 1.117 2000/07/10 20:57:35 davem Exp $
# For a description of the syntax of this configuration file,
# see the Configure script.
#
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 732c6975b..a09288215 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -80,7 +80,7 @@ int cpu_idle(void)
#define unidle_me() (cpu_data[current->processor].idle_volume = 0)
int cpu_idle(void)
{
- current->priority = 0;
+ current->nice = 20;
current->counter = -100;
init_idle();
diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
index ec3042398..859d0c7ea 100644
--- a/arch/sparc64/kernel/sys_sparc.c
+++ b/arch/sparc64/kernel/sys_sparc.c
@@ -1,4 +1,4 @@
-/* $Id: sys_sparc.c,v 1.43 2000/07/06 01:41:29 davem Exp $
+/* $Id: sys_sparc.c,v 1.44 2000/07/10 20:57:35 davem Exp $
* linux/arch/sparc64/kernel/sys_sparc.c
*
* This file contains various random system calls that
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index 5d2dd2985..7cadb3da5 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -1,4 +1,4 @@
-/* $Id: sys_sparc32.c,v 1.154 2000/07/06 01:41:29 davem Exp $
+/* $Id: sys_sparc32.c,v 1.155 2000/07/10 20:57:35 davem Exp $
* sys_sparc32.c: Conversion between 32bit and 64bit native syscalls.
*
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c
index 624a6b971..3f43e99dc 100644
--- a/arch/sparc64/kernel/sys_sunos32.c
+++ b/arch/sparc64/kernel/sys_sunos32.c
@@ -1,4 +1,4 @@
-/* $Id: sys_sunos32.c,v 1.51 2000/07/06 01:41:29 davem Exp $
+/* $Id: sys_sunos32.c,v 1.52 2000/07/10 20:57:35 davem Exp $
* sys_sunos32.c: SunOS binary compatability layer on sparc64.
*
* Copyright (C) 1995, 1996, 1997 David S. Miller (davem@caip.rutgers.edu)
diff --git a/arch/sparc64/lib/Makefile b/arch/sparc64/lib/Makefile
index 6c2d54e04..fa057936a 100644
--- a/arch/sparc64/lib/Makefile
+++ b/arch/sparc64/lib/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.22 2000/03/31 04:06:23 davem Exp $
+# $Id: Makefile,v 1.23 2000/07/10 20:57:34 davem Exp $
# Makefile for Sparc64 library files..
#
diff --git a/arch/sparc64/lib/dec_and_lock.S b/arch/sparc64/lib/dec_and_lock.S
index dca825a7f..75dfdbfcf 100644
--- a/arch/sparc64/lib/dec_and_lock.S
+++ b/arch/sparc64/lib/dec_and_lock.S
@@ -1,4 +1,4 @@
-/* $Id$
+/* $Id: dec_and_lock.S,v 1.1 2000/07/10 20:57:34 davem Exp $
* dec_and_lock.S: Sparc64 version of "atomic_dec_and_lock()"
* using cas and ldstub instructions.
*
diff --git a/arch/sparc64/mm/ultra.S b/arch/sparc64/mm/ultra.S
index e954b24c8..85e62ad25 100644
--- a/arch/sparc64/mm/ultra.S
+++ b/arch/sparc64/mm/ultra.S
@@ -1,4 +1,4 @@
-/* $Id: ultra.S,v 1.43 2000/05/09 17:40:14 davem Exp $
+/* $Id: ultra.S,v 1.44 2000/07/10 20:57:35 davem Exp $
* ultra.S: Don't expand these all over the place...
*
* Copyright (C) 1997, 2000 David S. Miller (davem@redhat.com)
diff --git a/arch/sparc64/solaris/fs.c b/arch/sparc64/solaris/fs.c
index 8200c831f..090eb96a1 100644
--- a/arch/sparc64/solaris/fs.c
+++ b/arch/sparc64/solaris/fs.c
@@ -1,4 +1,4 @@
-/* $Id: fs.c,v 1.20 2000/07/06 01:41:30 davem Exp $
+/* $Id: fs.c,v 1.21 2000/07/10 20:57:35 davem Exp $
* fs.c: fs related syscall emulation for Solaris
*
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
diff --git a/drivers/acorn/net/ether1.c b/drivers/acorn/net/ether1.c
index d2a5ca052..b112330d3 100644
--- a/drivers/acorn/net/ether1.c
+++ b/drivers/acorn/net/ether1.c
@@ -70,7 +70,7 @@ static int ether1_open(struct net_device *dev);
static int ether1_sendpacket(struct sk_buff *skb, struct net_device *dev);
static void ether1_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static int ether1_close(struct net_device *dev);
-static struct enet_statistics *ether1_getstats(struct net_device *dev);
+static struct net_device_stats *ether1_getstats(struct net_device *dev);
static void ether1_setmulticastlist(struct net_device *dev);
static void ether1_timeout(struct net_device *dev);
@@ -661,7 +661,7 @@ ether1_open (struct net_device *dev)
return -EAGAIN;
}
- memset (&priv->stats, 0, sizeof (struct enet_statistics));
+ memset (&priv->stats, 0, sizeof (struct net_device_stats));
if (ether1_init_for_open (dev)) {
free_irq (dev->irq, dev);
@@ -978,7 +978,7 @@ ether1_close (struct net_device *dev)
return 0;
}
-static struct enet_statistics *
+static struct net_device_stats *
ether1_getstats (struct net_device *dev)
{
struct ether1_priv *priv = (struct ether1_priv *)dev->priv;
diff --git a/drivers/acorn/net/ether1.h b/drivers/acorn/net/ether1.h
index db64114f1..db6ba7d49 100644
--- a/drivers/acorn/net/ether1.h
+++ b/drivers/acorn/net/ether1.h
@@ -31,7 +31,7 @@
#define IDPROM_ADDRESS (dev->base_addr + 0x09)
struct ether1_priv {
- struct enet_statistics stats;
+ struct net_device_stats stats;
unsigned int tx_link;
unsigned int tx_head;
volatile unsigned int tx_tail;
diff --git a/drivers/acorn/net/ether3.c b/drivers/acorn/net/ether3.c
index 11e382481..a73209a47 100644
--- a/drivers/acorn/net/ether3.c
+++ b/drivers/acorn/net/ether3.c
@@ -83,7 +83,7 @@ static int ether3_open (struct net_device *dev);
static int ether3_sendpacket (struct sk_buff *skb, struct net_device *dev);
static void ether3_interrupt (int irq, void *dev_id, struct pt_regs *regs);
static int ether3_close (struct net_device *dev);
-static struct enet_statistics *ether3_getstats (struct net_device *dev);
+static struct net_device_stats *ether3_getstats (struct net_device *dev);
static void ether3_setmulticastlist (struct net_device *dev);
static void ether3_timeout(struct net_device *dev);
@@ -338,7 +338,7 @@ ether3_init_for_open(struct net_device *dev)
struct dev_priv *priv = (struct dev_priv *)dev->priv;
int i;
- memset(&priv->stats, 0, sizeof(struct enet_statistics));
+ memset(&priv->stats, 0, sizeof(struct net_device_stats));
/* Reset the chip */
ether3_outw(CFG2_RESET, REG_CONFIG2);
@@ -459,7 +459,7 @@ ether3_close(struct net_device *dev)
* Get the current statistics. This may be called with the card open or
* closed.
*/
-static struct enet_statistics *ether3_getstats(struct net_device *dev)
+static struct net_device_stats *ether3_getstats(struct net_device *dev)
{
struct dev_priv *priv = (struct dev_priv *)dev->priv;
return &priv->stats;
@@ -690,7 +690,7 @@ if (next_ptr < RX_START || next_ptr >= RX_END) {
} else
goto dropping;
} else {
- struct enet_statistics *stats = &priv->stats;
+ struct net_device_stats *stats = &priv->stats;
ether3_outw(next_ptr >> 8, REG_RECVEND);
if (status & RXSTAT_OVERSIZE) stats->rx_over_errors ++;
if (status & RXSTAT_CRCERROR) stats->rx_crc_errors ++;
diff --git a/drivers/acorn/net/ether3.h b/drivers/acorn/net/ether3.h
index 45dfd82a1..e7f5baf1b 100644
--- a/drivers/acorn/net/ether3.h
+++ b/drivers/acorn/net/ether3.h
@@ -154,7 +154,7 @@ struct dev_priv {
unsigned char tx_head; /* buffer nr to insert next packet */
unsigned char tx_tail; /* buffer nr of transmitting packet */
unsigned int rx_head; /* address to fetch next packet from */
- struct enet_statistics stats;
+ struct net_device_stats stats;
struct timer_list timer;
int broken; /* 0 = ok, 1 = something went wrong */
};
diff --git a/drivers/block/md.c b/drivers/block/md.c
index 058c001c7..651c3dd6d 100644
--- a/drivers/block/md.c
+++ b/drivers/block/md.c
@@ -2908,7 +2908,7 @@ int md_thread(void * arg)
* many dirty RAID5 blocks.
*/
current->policy = SCHED_OTHER;
- current->priority = 40;
+ current->nice = -20;
// md_unlock_kernel();
up(thread->sem);
@@ -3336,7 +3336,7 @@ recheck:
/*
* Resync has low priority.
*/
- current->priority = 1;
+ current->nice = 19;
is_mddev_idle(mddev); /* this also initializes IO event counters */
for (m = 0; m < SYNC_MARKS; m++) {
@@ -3412,7 +3412,7 @@ repeat:
currspeed = (j-mddev->resync_mark_cnt)/((jiffies-mddev->resync_mark)/HZ +1) +1;
if (currspeed > sysctl_speed_limit_min) {
- current->priority = 1;
+ current->priority = 19;
if ((currspeed > sysctl_speed_limit_max) ||
!is_mddev_idle(mddev)) {
@@ -3422,7 +3422,7 @@ repeat:
goto repeat;
}
} else
- current->priority = 40;
+ current->priority = -20;
}
fsync_dev(read_disk);
printk(KERN_INFO "md: md%d: sync done.\n",mdidx(mddev));
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index 665514727..4435a517b 100644
--- a/drivers/char/synclink.c
+++ b/drivers/char/synclink.c
@@ -1,7 +1,7 @@
/*
* linux/drivers/char/synclink.c
*
- * ==FILEDATE 19991217==
+ * ==FILEDATE 20000707==
*
* Device driver for Microgate SyncLink ISA and PCI
* high speed multiprotocol serial adapters.
@@ -33,6 +33,13 @@
* This driver has been tested with a slightly modified ppp.c driver
* for synchronous PPP.
*
+ * 2000/02/16
+ * Added interface for syncppp.c driver (an alternate synchronous PPP
+ * implementation that also supports Cisco HDLC). Each device instance
+ * registers as a tty device AND a network device (if dosyncppp option
+ * is set for the device). The functionality is determined by which
+ * device interface is opened.
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -73,6 +80,8 @@
#include <linux/mm.h>
#include <linux/malloc.h>
+#include <linux/netdevice.h>
+
#if LINUX_VERSION_CODE >= VERSION(2,1,0)
#include <linux/vmalloc.h>
#include <linux/init.h>
@@ -101,6 +110,23 @@ typedef struct wait_queue *wait_queue_head_t;
#define set_current_state(a) current->state = (a)
#endif
+#ifdef CONFIG_SYNCLINK_SYNCPPP_MODULE
+#define CONFIG_SYNCLINK_SYNCPPP 1
+#endif
+
+#ifdef CONFIG_SYNCLINK_SYNCPPP
+#if LINUX_VERSION_CODE < VERSION(2,3,43)
+#include "../net/syncppp.h"
+#define net_device device
+#define netif_stop_queue(a) (a)->tbusy = 1
+#define netif_start_queue(a) (a)->tbusy = 0
+#define netif_wake_queue(a) (a)->tbusy = 0; mark_bh(NET_BH)
+#define netif_queue_stopped(a) ((a)->tbusy)
+#else
+#include "../net/wan/syncppp.h"
+#endif
+#endif
+
#if LINUX_VERSION_CODE >= VERSION(2,1,4)
#include <asm/segment.h>
#define GET_USER(error,value,addr) error = get_user(value,addr)
@@ -208,22 +234,11 @@ typedef struct _DMABUFFERENTRY
/* The queue of BH actions to be performed */
-#define BH_TYPE_RECEIVE_DATA 1
-#define BH_TYPE_RECEIVE_STATUS 2
-#define BH_TYPE_RECEIVE_DMA 3
-#define BH_TYPE_TRANSMIT_DATA 4
-#define BH_TYPE_TRANSMIT_STATUS 5
-#define BH_TYPE_STATUS 6
-
-typedef struct _BH_EVENT {
- unsigned char type; /* Set by interrupt routines to reqst */
- u16 status;
- struct _BH_EVENT *link;
-
-} BH_EVENT, *BH_QUEUE; /* Queue of BH actions to be done. */
+#define BH_RECEIVE 1
+#define BH_TRANSMIT 2
+#define BH_STATUS 4
-#define MAX_BH_QUEUE_ENTRIES 200
-#define IO_PIN_SHUTDOWN_LIMIT (MAX_BH_QUEUE_ENTRIES/4)
+#define IO_PIN_SHUTDOWN_LIMIT 100
#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
@@ -243,6 +258,7 @@ struct _input_signal_events {
*/
struct mgsl_struct {
+ void *if_ptr; /* General purpose pointer (used by SPPP) */
int magic;
int flags;
int count; /* count of opens */
@@ -284,12 +300,8 @@ struct mgsl_struct {
u32 max_frame_size; /* as set by device config */
- BH_EVENT bh_queue[MAX_BH_QUEUE_ENTRIES]; /* Pointer to alloc'ed block */
- BH_QUEUE bh_queue_head; /* Queue of BH actions */
- BH_QUEUE bh_queue_tail; /* Tail of above for perf. */
- BH_QUEUE free_bh_queue_head; /* Queue of Free BH */
- BH_QUEUE free_bh_queue_tail; /* Tail of above for perf. */
- BH_QUEUE bh_action; /* Action for BH */
+ u32 pending_bh;
+
int bh_running; /* Protection from multiple */
int isr_overflow;
int bh_requested;
@@ -324,7 +336,8 @@ struct mgsl_struct {
char device_name[25]; /* device instance name */
unsigned int bus_type; /* expansion bus type (ISA,EISA,PCI) */
- struct pci_dev *pdev; /* pointer to PCI device info */
+ unsigned char bus; /* expansion bus number (zero based) */
+ unsigned char function; /* PCI device number */
unsigned int io_base; /* base I/O address of adapter */
unsigned int io_addr_size; /* size of the I/O address range */
@@ -366,6 +379,20 @@ struct mgsl_struct {
BOOLEAN loopmode_send_done_requested;
struct _input_signal_events input_signal_events;
+
+ /* SPPP/Cisco HDLC device parts */
+ int netcount;
+ int dosyncppp;
+ spinlock_t netlock;
+#ifdef CONFIG_SYNCLINK_SYNCPPP
+ struct ppp_device pppdev;
+ char netname[10];
+ struct net_device *netdev;
+ struct net_device_stats netstats;
+#if LINUX_VERSION_CODE >= VERSION(2,2,16)
+ struct net_device netdevice;
+#endif
+#endif
};
#define MGSL_MAGIC 0x5401
@@ -373,8 +400,9 @@ struct mgsl_struct {
/*
* The size of the serial xmit buffer is 1 page, or 4096 bytes
*/
-/* #define SERIAL_XMIT_SIZE 4096 */ /* defined in include/linux/serial.h */
-
+#ifndef SERIAL_XMIT_SIZE
+#define SERIAL_XMIT_SIZE 4096
+#endif
/*
* These macros define the offsets used in calculating the
@@ -767,6 +795,22 @@ int usc_loopmode_active( struct mgsl_struct * info);
void usc_loopmode_send_done( struct mgsl_struct * info );
int usc_loopmode_send_active( struct mgsl_struct * info );
+int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigned long arg);
+
+#ifdef CONFIG_SYNCLINK_SYNCPPP
+/* SPPP/HDLC stuff */
+void mgsl_sppp_init(struct mgsl_struct *info);
+void mgsl_sppp_delete(struct mgsl_struct *info);
+int mgsl_sppp_open(struct net_device *d);
+int mgsl_sppp_close(struct net_device *d);
+void mgsl_sppp_tx_timeout(struct net_device *d);
+int mgsl_sppp_tx(struct sk_buff *skb, struct net_device *d);
+void mgsl_sppp_rx_done(struct mgsl_struct *info, char *buf, int size);
+void mgsl_sppp_tx_done(struct mgsl_struct *info);
+int mgsl_sppp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
+struct net_device_stats *mgsl_net_stats(struct net_device *dev);
+#endif
+
/*
* Defines a BUS descriptor value for the PCI adapter
* local bus address ranges.
@@ -828,14 +872,9 @@ void mgsl_free_intermediate_rxbuffer_memory(struct mgsl_struct *info);
* Bottom half interrupt handlers
*/
void mgsl_bh_handler(void* Context);
-void mgsl_bh_receive_dma( struct mgsl_struct *info, unsigned short status );
-void mgsl_bh_transmit_data( struct mgsl_struct *info, unsigned short Datacount );
-void mgsl_bh_status_handler( struct mgsl_struct *info, unsigned short status );
-
-void mgsl_format_bh_queue( struct mgsl_struct *info );
-void mgsl_bh_queue_put( struct mgsl_struct *info, unsigned char type, unsigned short status );
-int mgsl_bh_queue_get( struct mgsl_struct *info );
-
+void mgsl_bh_receive(struct mgsl_struct *info);
+void mgsl_bh_transmit(struct mgsl_struct *info);
+void mgsl_bh_status(struct mgsl_struct *info);
/*
* Interrupt handler routines and dispatch table.
@@ -911,7 +950,7 @@ static int irq[MAX_ISA_DEVICES] = {0,};
static int dma[MAX_ISA_DEVICES] = {0,};
static int debug_level = 0;
static int maxframe[MAX_TOTAL_DEVICES] = {0,};
-
+static int dosyncppp[MAX_TOTAL_DEVICES] = {0,};
#if LINUX_VERSION_CODE >= VERSION(2,1,0)
MODULE_PARM(break_on_load,"i");
@@ -922,10 +961,11 @@ MODULE_PARM(irq,"1-" __MODULE_STRING(MAX_ISA_DEVICES) "i");
MODULE_PARM(dma,"1-" __MODULE_STRING(MAX_ISA_DEVICES) "i");
MODULE_PARM(debug_level,"i");
MODULE_PARM(maxframe,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i");
+MODULE_PARM(dosyncppp,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i");
#endif
static char *driver_name = "SyncLink serial driver";
-static char *driver_version = "1.16";
+static char *driver_version = "1.21";
static struct tty_driver serial_driver, callout_driver;
static int serial_refcount;
@@ -1037,152 +1077,46 @@ static void mgsl_start(struct tty_struct *tty)
* Bottom half work queue access functions
*/
-/* mgsl_format_bh_queue()
- *
- * Initialize the bottom half processing queue
- *
- * Arguments: info pointer to device instance data
- * Return Value: None
- */
-void mgsl_format_bh_queue( struct mgsl_struct *info )
-{
- BH_QUEUE bh_queue = info->bh_queue;
- int i;
-
- /* go through sequentially tacking the little bits together */
-
- for ( i=0; i < MAX_BH_QUEUE_ENTRIES; i++ ) {
- if ( info->free_bh_queue_tail == NULL )
- info->free_bh_queue_head = bh_queue;
- else
- info->free_bh_queue_tail->link = bh_queue;
- info->free_bh_queue_tail = bh_queue++;
- }
-
- /* As a safety measure, mark the end of the chain with a NULL */
- info->free_bh_queue_tail->link = NULL;
- info->isr_overflow=0;
-
-} /* end of mgsl_format_bh_queue() */
-
-/* mgsl_bh_queue_put()
- *
- * Add a BH event to the BH queue
- *
- * Arguments: info pointer to device instance data
- * type BH event type
- * status BH event status
- *
- * Return Value: None
+/* mgsl_bh_action() Return next bottom half action to perform.
+ * Return Value: BH action code or 0 if nothing to do.
*/
-void mgsl_bh_queue_put( struct mgsl_struct *info, unsigned char type, unsigned short status )
-{
- BH_EVENT *event = info->free_bh_queue_head;
-
- if ( event != NULL ) {
- /* remove free element from head of free list */
- info->free_bh_queue_head = event->link;
- event->link = NULL;
-
- /* file out new BH event */
- event->type = type;
- event->status = status;
-
- /* add element to tail of pending list */
- if ( info->bh_queue_head != NULL ){
- /* BH queue is not empty, add current element to tail */
- info->bh_queue_tail->link = event;
- } else {
- /* the BH queue is empty so this element becomes the head of queue */
- info->bh_queue_head = event;
- }
-
- /* the new element becomes tail of queue */
- info->bh_queue_tail = event;
- } else {
- /* No more free BH action elements in queue. */
- /* This happens when too many interrupts are occuring */
- /* for the mgsl_bh_handler to process so set a flag. */
-
- info->isr_overflow = 1;
- }
-
-} /* end of mgsl_bh_queue_put() */
-
-/* mgsl_bh_queue_get()
- *
- * Free the current work item (if any) and get the
- * next work item from the head of the pending work item queue.
- *
- * Effects:
- *
- * If a BH action element is available on the BH action queue
- * then the head of the queue is removed and bh_action
- * is set to point to the removed element.
- *
- * Arguments: info pointer to device instance data
- * Return Value: 1 if BH action removed from queue
- */
-int mgsl_bh_queue_get( struct mgsl_struct *info )
+int mgsl_bh_action(struct mgsl_struct *info)
{
unsigned long flags;
+ int rc = 0;
spin_lock_irqsave(&info->irq_spinlock,flags);
- if ( info->bh_action ) {
- /* free the current work item */
- if ( info->free_bh_queue_head != NULL ){
- /* free queue is not empty, add current element to tail */
- info->free_bh_queue_tail->link = info->bh_action;
- } else {
- /* free queue is empty so this element becomes the head of queue */
- info->free_bh_queue_head = info->bh_action;
- }
-
- /* add element to tail of free queue */
- info->free_bh_queue_tail = info->bh_action;
- info->free_bh_queue_tail->link = NULL;
+ if (info->pending_bh & BH_RECEIVE) {
+ info->pending_bh &= ~BH_RECEIVE;
+ rc = BH_RECEIVE;
+ } else if (info->pending_bh & BH_TRANSMIT) {
+ info->pending_bh &= ~BH_TRANSMIT;
+ rc = BH_TRANSMIT;
+ } else if (info->pending_bh & BH_STATUS) {
+ info->pending_bh &= ~BH_STATUS;
+ rc = BH_STATUS;
}
-
- /* attempt to remove element from head of queue */
- info->bh_action = info->bh_queue_head;
- if ( info->bh_action != NULL ){
- /* BH queue is not empty, remove element from queue head */
- info->bh_queue_head = info->bh_action->link;
- spin_unlock_irqrestore(&info->irq_spinlock,flags);
- return 1;
- }
-
- if ( info->isr_overflow ) {
- if (debug_level >= DEBUG_LEVEL_BH)
- printk("ISR overflow cleared.\n");
- info->isr_overflow=0;
- usc_EnableMasterIrqBit(info);
- usc_EnableDmaInterrupts(info,DICR_MASTER);
+ if (!rc) {
+ /* Mark BH routine as complete */
+ info->bh_running = 0;
+ info->bh_requested = 0;
}
-
- /* Mark BH routine as complete */
- info->bh_running = 0;
- info->bh_requested = 0;
spin_unlock_irqrestore(&info->irq_spinlock,flags);
- return 0;
-
-} /* end of mgsl_bh_queue_get() */
+ return rc;
+}
-/* mgsl_bh_handler()
- *
+/*
* Perform bottom half processing of work items queued by ISR.
- *
- * Arguments: Context pointer to device instance data
- * Return Value: None
*/
void mgsl_bh_handler(void* Context)
{
struct mgsl_struct *info = (struct mgsl_struct*)Context;
-
+ int action;
+
if (!info)
return;
@@ -1192,34 +1126,27 @@ void mgsl_bh_handler(void* Context)
info->bh_running = 1;
- /* Attempt to clear out the BH queue */
-
- while( mgsl_bh_queue_get(info) ) {
+ while((action = mgsl_bh_action(info)) != 0) {
/* Process work item */
if ( debug_level >= DEBUG_LEVEL_BH )
printk( "%s(%d):mgsl_bh_handler() work item action=%d\n",
- __FILE__,__LINE__,info->bh_action->type);
+ __FILE__,__LINE__,action);
- switch ( info->bh_action->type ) {
+ switch (action) {
- case BH_TYPE_RECEIVE_DMA:
- mgsl_bh_receive_dma( info, info->bh_action->status );
+ case BH_RECEIVE:
+ mgsl_bh_receive(info);
break;
-
- case BH_TYPE_TRANSMIT_STATUS:
- case BH_TYPE_TRANSMIT_DATA:
- mgsl_bh_transmit_data( info, info->bh_action->status );
+ case BH_TRANSMIT:
+ mgsl_bh_transmit(info);
break;
-
- case BH_TYPE_STATUS:
- mgsl_bh_status_handler( info, info->bh_action->status );
+ case BH_STATUS:
+ mgsl_bh_status(info);
break;
-
default:
/* unknown work item ID */
- printk("Unknown work item ID=%08X!\n",
- info->bh_action->type );
+ printk("Unknown work item ID=%08X!\n", action);
break;
}
}
@@ -1227,51 +1154,27 @@ void mgsl_bh_handler(void* Context)
if ( debug_level >= DEBUG_LEVEL_BH )
printk( "%s(%d):mgsl_bh_handler(%s) exit\n",
__FILE__,__LINE__,info->device_name);
-
-} /* end of mgsl_bh_handler() */
+}
-/* mgsl_bh_receive_dma()
- *
- * Perform bottom half processing for a receive DMA interrupt
- * This occurs in HDLC mode after a DMA buffer has terminated
- * or the DMA buffers have been exhausted.
- *
- * Arguments:
- *
- * info pointer to device instance data
- * status status word
- *
- * Return Value: None
- */
-void mgsl_bh_receive_dma( struct mgsl_struct *info, unsigned short status )
+void mgsl_bh_receive(struct mgsl_struct *info)
{
if ( debug_level >= DEBUG_LEVEL_BH )
- printk( "%s(%d):mgsl_bh_receive_dma(%s)\n",
+ printk( "%s(%d):mgsl_bh_receive(%s)\n",
__FILE__,__LINE__,info->device_name);
while( mgsl_get_rx_frame(info) );
+}
-} /* end of mgsl_bh_receive_dma() */
-
-/* mgsl_bh_transmit_data()
- *
- * Process a transmit data interrupt event
- * This occurs in asynchronous communications mode.
- *
- * Arguments: info pointer to device instance data
- * Return Value: None
- */
-void mgsl_bh_transmit_data( struct mgsl_struct *info, unsigned short Datacount )
+void mgsl_bh_transmit(struct mgsl_struct *info)
{
struct tty_struct *tty = info->tty;
unsigned long flags;
if ( debug_level >= DEBUG_LEVEL_BH )
- printk( "%s(%d):mgsl_bh_transmit_data() entry on %s\n",
+ printk( "%s(%d):mgsl_bh_transmit() entry on %s\n",
__FILE__,__LINE__,info->device_name);
-
- /* wakeup any waiting write requests */
- if (tty) {
+
+ if (tty) {
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup) {
if ( debug_level >= DEBUG_LEVEL_BH )
@@ -1289,49 +1192,19 @@ void mgsl_bh_transmit_data( struct mgsl_struct *info, unsigned short Datacount )
if ( !info->tx_active && info->loopmode_send_done_requested )
usc_loopmode_send_done( info );
spin_unlock_irqrestore(&info->irq_spinlock,flags);
+}
-} /* End Of mgsl_bh_transmit_data() */
-
-/* mgsl_bh_status_handler()
- *
- * Peform bottom half processing for a status interrupt
- *
- * This event is generated when a I/O pin (serial signal)
- * has a transition. If there is a pending WaitEvent call
- * and the status transition is identified in the EventMast
- * of the pending call then complete the pending call.
- *
- * Arguments:
- *
- * info pointer to device instance data
- * status status word
- *
- * Return Value: None
- */
-void mgsl_bh_status_handler( struct mgsl_struct *info, unsigned short status )
+void mgsl_bh_status(struct mgsl_struct *info)
{
if ( debug_level >= DEBUG_LEVEL_BH )
- printk( "%s(%d):mgsl_bh_status_handler() entry on %s\n",
+ printk( "%s(%d):mgsl_bh_status() entry on %s\n",
__FILE__,__LINE__,info->device_name);
- if (status & MISCSTATUS_RI_LATCHED) {
- if (info->ri_chkcount)
- (info->ri_chkcount)--;
- }
- if (status & MISCSTATUS_DSR_LATCHED) {
- if (info->dsr_chkcount)
- (info->dsr_chkcount)--;
- }
- if (status & MISCSTATUS_DCD_LATCHED) {
- if (info->dcd_chkcount)
- (info->dcd_chkcount)--;
- }
- if (status & MISCSTATUS_CTS_LATCHED) {
- if (info->cts_chkcount)
- (info->cts_chkcount)--;
- }
-
-} /* End Of mgsl_bh_status_handler() */
+ info->ri_chkcount = 0;
+ info->dsr_chkcount = 0;
+ info->dcd_chkcount = 0;
+ info->cts_chkcount = 0;
+}
/* mgsl_isr_receive_status()
*
@@ -1375,12 +1248,6 @@ void mgsl_isr_receive_status( struct mgsl_struct *info )
}
if (status & RXSTATUS_OVERRUN){
-// /* Purge receive FIFO to allow DMA buffer completion
-// * with overrun status stored in the receive status block.
-// */
-// usc_RCmd( info, RCmd_EnterHuntmode );
-// usc_RTCmd( info, RTCmd_PurgeRxFifo );
-
info->icount.rxover++;
usc_process_rxoverrun_sync( info );
}
@@ -1443,13 +1310,19 @@ void mgsl_isr_transmit_status( struct mgsl_struct *info )
}
info->drop_rts_on_tx_done = 0;
}
-
- if (info->tty->stopped || info->tty->hw_stopped) {
- usc_stop_transmitter(info);
- return;
+
+#ifdef CONFIG_SYNCLINK_SYNCPPP
+ if (info->netcount)
+ mgsl_sppp_tx_done(info);
+ else
+#endif
+ {
+ if (info->tty->stopped || info->tty->hw_stopped) {
+ usc_stop_transmitter(info);
+ return;
+ }
+ info->pending_bh |= BH_TRANSMIT;
}
-
- mgsl_bh_queue_put(info, BH_TYPE_TRANSMIT_STATUS, status);
} /* end of mgsl_isr_transmit_status() */
@@ -1499,9 +1372,13 @@ void mgsl_isr_io_pin( struct mgsl_struct *info )
if ((info->dcd_chkcount)++ >= IO_PIN_SHUTDOWN_LIMIT)
usc_DisablestatusIrqs(info,SICR_DCD);
icount->dcd++;
- if ( status & MISCSTATUS_DCD )
+ if (status & MISCSTATUS_DCD) {
info->input_signal_events.dcd_up++;
- else
+#ifdef CONFIG_SYNCLINK_SYNCPPP
+ if (info->netcount)
+ sppp_reopen(info->netdev);
+#endif
+ } else
info->input_signal_events.dcd_down++;
#ifdef CONFIG_HARD_PPS
if ((info->flags & ASYNC_HARDPPS_CD) &&
@@ -1544,23 +1421,25 @@ void mgsl_isr_io_pin( struct mgsl_struct *info )
if (status & MISCSTATUS_CTS) {
if ( debug_level >= DEBUG_LEVEL_ISR )
printk("CTS tx start...");
- info->tty->hw_stopped = 0;
+ if (info->tty)
+ info->tty->hw_stopped = 0;
usc_start_transmitter(info);
- mgsl_bh_queue_put( info, BH_TYPE_TRANSMIT_DATA, status );
+ info->pending_bh |= BH_TRANSMIT;
return;
}
} else {
if (!(status & MISCSTATUS_CTS)) {
if ( debug_level >= DEBUG_LEVEL_ISR )
printk("CTS tx stop...");
- info->tty->hw_stopped = 1;
+ if (info->tty)
+ info->tty->hw_stopped = 1;
usc_stop_transmitter(info);
}
}
}
}
- mgsl_bh_queue_put(info, BH_TYPE_STATUS, status);
+ info->pending_bh |= BH_STATUS;
/* for diagnostics set IRQ flag */
if ( status & MISCSTATUS_TXC_LATCHED ){
@@ -1598,7 +1477,7 @@ void mgsl_isr_transmit_data( struct mgsl_struct *info )
info->tx_active = 0;
if (info->xmit_cnt < WAKEUP_CHARS)
- mgsl_bh_queue_put(info, BH_TYPE_TRANSMIT_DATA, (unsigned short)(info->xmit_cnt));
+ info->pending_bh |= BH_TRANSMIT;
} /* end of mgsl_isr_transmit_data() */
@@ -1790,8 +1669,7 @@ void mgsl_isr_receive_dma( struct mgsl_struct *info )
printk("%s(%d):mgsl_isr_receive_dma(%s) status=%04X\n",
__FILE__,__LINE__,info->device_name,status);
- /* Post a receive event for BH processing. */
- mgsl_bh_queue_put( info, BH_TYPE_RECEIVE_DMA, status );
+ info->pending_bh |= BH_RECEIVE;
if ( status & BIT3 ) {
info->rx_overflow = 1;
@@ -1859,7 +1737,7 @@ static void mgsl_interrupt(int irq, void *dev_id, struct pt_regs * regs)
* for it to do and the bh is not already running
*/
- if ( info->bh_queue_head && !info->bh_running && !info->bh_requested ) {
+ if ( info->pending_bh && !info->bh_running && !info->bh_requested ) {
if ( debug_level >= DEBUG_LEVEL_ISR )
printk("%s(%d):%s queueing bh task.\n",
__FILE__,__LINE__,info->device_name);
@@ -1903,7 +1781,7 @@ static int startup(struct mgsl_struct * info)
}
}
- mgsl_format_bh_queue(info);
+ info->pending_bh = 0;
init_timer(&info->tx_timer);
info->tx_timer.data = (unsigned long)info;
@@ -1962,6 +1840,8 @@ static void shutdown(struct mgsl_struct * info)
wake_up_interruptible(&info->status_event_wait_q);
wake_up_interruptible(&info->event_wait_q);
+ del_timer(&info->tx_timer);
+
if (info->xmit_buf) {
free_page((unsigned long) info->xmit_buf);
info->xmit_buf = 0;
@@ -2001,17 +1881,43 @@ static void shutdown(struct mgsl_struct * info)
} /* end of shutdown() */
-/* mgsl_change_params()
- *
- * Reconfigure adapter based on new parameters
- *
- * Arguments: info pointer to device instance data
- * Return Value: None
+static void mgsl_program_hw(struct mgsl_struct *info)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&info->irq_spinlock,flags);
+
+ usc_stop_receiver(info);
+ usc_stop_transmitter(info);
+ info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
+
+ if (info->params.mode == MGSL_MODE_HDLC || info->netcount)
+ usc_set_sync_mode(info);
+ else
+ usc_set_async_mode(info);
+
+ usc_set_serial_signals(info);
+
+ info->dcd_chkcount = 0;
+ info->cts_chkcount = 0;
+ info->ri_chkcount = 0;
+ info->dsr_chkcount = 0;
+
+ usc_EnableStatusIrqs(info,SICR_CTS+SICR_DSR+SICR_DCD+SICR_RI);
+ usc_EnableInterrupts(info, IO_PIN);
+ usc_get_serial_signals(info);
+
+ if (info->netcount || info->tty->termios->c_cflag & CREAD)
+ usc_start_receiver(info);
+
+ spin_unlock_irqrestore(&info->irq_spinlock,flags);
+}
+
+/* Reconfigure adapter based on new parameters
*/
static void mgsl_change_params(struct mgsl_struct *info)
{
unsigned cflag;
- unsigned long flags;
int bits_per_char;
if (!info->tty || !info->tty->termios)
@@ -2119,35 +2025,7 @@ static void mgsl_change_params(struct mgsl_struct *info)
info->ignore_status_mask |= RXSTATUS_OVERRUN;
}
- /* reprogram the hardware */
-
- spin_lock_irqsave(&info->irq_spinlock,flags);
-
- usc_stop_receiver(info);
- usc_stop_transmitter(info);
- info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
-
- if ( info->params.mode == MGSL_MODE_HDLC )
- usc_set_sync_mode(info);
- else
- usc_set_async_mode(info);
-
- usc_set_serial_signals(info);
-
- info->dcd_chkcount = 0;
- info->cts_chkcount = 0;
- info->ri_chkcount = 0;
- info->dsr_chkcount = 0;
-
- /* enable modem signal IRQs and read initial signal states */
- usc_EnableStatusIrqs(info,SICR_CTS+SICR_DSR+SICR_DCD+SICR_RI);
- usc_EnableInterrupts(info, IO_PIN);
- usc_get_serial_signals(info);
-
- if ( cflag & CREAD )
- usc_start_receiver(info);
-
- spin_unlock_irqrestore(&info->irq_spinlock,flags);
+ mgsl_program_hw(info);
} /* end of mgsl_change_params() */
@@ -3115,11 +2993,7 @@ static void mgsl_break(struct tty_struct *tty, int break_state)
static int mgsl_ioctl(struct tty_struct *tty, struct file * file,
unsigned int cmd, unsigned long arg)
{
- int error;
struct mgsl_struct * info = (struct mgsl_struct *)tty->driver_data;
- struct mgsl_icount cprev, cnow; /* kernel counter temps */
- struct serial_icounter_struct *p_cuser; /* user space */
- unsigned long flags;
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):mgsl_ioctl %s cmd=%08X\n", __FILE__,__LINE__,
@@ -3133,6 +3007,16 @@ static int mgsl_ioctl(struct tty_struct *tty, struct file * file,
if (tty->flags & (1 << TTY_IO_ERROR))
return -EIO;
}
+
+ return mgsl_ioctl_common(info, cmd, arg);
+}
+
+int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigned long arg)
+{
+ int error;
+ struct mgsl_icount cprev, cnow; /* kernel counter temps */
+ struct serial_icounter_struct *p_cuser; /* user space */
+ unsigned long flags;
switch (cmd) {
case TIOCMGET:
@@ -3233,10 +3117,9 @@ static int mgsl_ioctl(struct tty_struct *tty, struct file * file,
if (error) return error;
#endif
return 0;
-
default:
return -ENOIOCTLCMD;
- }
+ }
return 0;
}
@@ -3662,6 +3545,7 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
struct mgsl_struct *info;
int retval, line;
unsigned long page;
+ unsigned long flags;
/* verify range of specified line number */
line = MINOR(tty->device) - tty->driver.minor_start;
@@ -3717,7 +3601,15 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
#endif
+ spin_lock_irqsave(&info->netlock, flags);
+ if (info->netcount) {
+ retval = -EBUSY;
+ spin_unlock_irqrestore(&info->netlock, flags);
+ goto cleanup;
+ }
info->count++;
+ spin_unlock_irqrestore(&info->netlock, flags);
+
if (info->count == 1) {
/* 1st open on this device, init hardware */
retval = startup(info);
@@ -3833,9 +3725,9 @@ static inline int line_info(char *buf, struct mgsl_struct *info)
/* Append serial signal status to end */
ret += sprintf(buf+ret, " %s\n", stat_buf+1);
- ret += sprintf(buf+ret, "txactive=%d bh_req=%d bh_run=%d bh_q=%p\n",
+ ret += sprintf(buf+ret, "txactive=%d bh_req=%d bh_run=%d pending_bh=%x\n",
info->tx_active,info->bh_requested,info->bh_running,
- info->bh_queue_head);
+ info->pending_bh);
spin_lock_irqsave(&info->irq_spinlock,flags);
{
@@ -4398,6 +4290,12 @@ void mgsl_add_device( struct mgsl_struct *info )
info->line = mgsl_device_count;
sprintf(info->device_name,"ttySL%d",info->line);
+ if (info->line < MAX_TOTAL_DEVICES) {
+ if (maxframe[info->line])
+ info->max_frame_size = maxframe[info->line];
+ info->dosyncppp = dosyncppp[info->line];
+ }
+
mgsl_device_count++;
if ( !mgsl_device_list )
@@ -4424,7 +4322,11 @@ void mgsl_add_device( struct mgsl_struct *info )
info->device_name, info->io_base, info->irq_level, info->dma_level,
info->max_frame_size );
}
-
+
+#ifdef CONFIG_SYNCLINK_SYNCPPP
+ if (info->dosyncppp)
+ mgsl_sppp_init(info);
+#endif
} /* end of mgsl_add_device() */
/* mgsl_allocate_device()
@@ -4457,6 +4359,7 @@ struct mgsl_struct* mgsl_allocate_device()
init_waitqueue_head(&info->status_event_wait_q);
init_waitqueue_head(&info->event_wait_q);
spin_lock_init(&info->irq_spinlock);
+ spin_lock_init(&info->netlock);
memcpy(&info->params,&default_params,sizeof(MGSL_PARAMS));
info->idle_mode = HDLC_TXIDLE_FLAGS;
}
@@ -4477,7 +4380,6 @@ int mgsl_enumerate_devices()
{
struct mgsl_struct *info;
int i;
- int num_devices = 0;
/* Check for user specified ISA devices */
@@ -4508,39 +4410,57 @@ int mgsl_enumerate_devices()
info->io_addr_size = 16;
info->irq_flags = 0;
- /* override default max frame size if arg available */
- if ( num_devices < MAX_TOTAL_DEVICES &&
- maxframe[num_devices] )
- info->max_frame_size = maxframe[num_devices];
-
- /* add new device to device list */
mgsl_add_device( info );
-
- ++num_devices;
}
#ifdef CONFIG_PCI
/* Auto detect PCI adapters */
- {
+ if ( pcibios_present() ) {
+ unsigned char bus;
+ unsigned char func;
unsigned int shared_mem_base;
unsigned int lcr_mem_base;
unsigned int io_base;
unsigned char irq_line;
- struct pci_dev *pdev = NULL;
- while ((pdev = pci_find_device(
- MICROGATE_VENDOR_ID, SYNCLINK_DEVICE_ID, pdev))) {
+ for(i=0;;i++){
+ if ( PCIBIOS_SUCCESSFUL == pcibios_find_device(
+ MICROGATE_VENDOR_ID, SYNCLINK_DEVICE_ID, i, &bus, &func) ) {
+#if LINUX_VERSION_CODE >= VERSION(2,1,0)
+ struct pci_dev *pdev = pci_find_slot(bus,func);
irq_line = pdev->irq;
+#else
+ if (pcibios_read_config_byte(bus,func,
+ PCI_INTERRUPT_LINE,&irq_line) ) {
+ printk( "%s(%d):USC I/O addr not set.\n",
+ __FILE__,__LINE__);
+ continue;
+ }
+#endif
- shared_mem_base = pci_resource_start (pdev, 3);
- lcr_mem_base = pci_resource_start (pdev, 0);
- io_base = pci_resource_start (pdev, 2);
-
- if (pci_enable_device (pdev))
+ if (pcibios_read_config_dword(bus,func,
+ PCI_BASE_ADDRESS_3,&shared_mem_base) ) {
+ printk( "%s(%d):Shared mem addr not set.\n",
+ __FILE__,__LINE__);
+ continue;
+ }
+
+ if (pcibios_read_config_dword(bus,func,
+ PCI_BASE_ADDRESS_0,&lcr_mem_base) ) {
+ printk( "%s(%d):LCR mem addr not set.\n",
+ __FILE__,__LINE__);
+ continue;
+ }
+
+ if (pcibios_read_config_dword(bus,func,
+ PCI_BASE_ADDRESS_2,&io_base) ) {
+ printk( "%s(%d):USC I/O addr not set.\n",
+ __FILE__,__LINE__);
continue;
+ }
info = mgsl_allocate_device();
if ( !info ) {
@@ -4552,29 +4472,30 @@ int mgsl_enumerate_devices()
/* Copy user configuration info to device instance data */
- info->io_base = io_base;
+ info->io_base = io_base & PCI_BASE_ADDRESS_IO_MASK;
info->irq_level = (unsigned int)irq_line;
+#if LINUX_VERSION_CODE >= VERSION(2,1,0)
info->irq_level = irq_cannonicalize(info->irq_level);
- info->phys_memory_base = shared_mem_base;
+#else
+ if (info->irq_level == 2)
+ info->irq_level = 9;
+#endif
+ info->phys_memory_base = shared_mem_base & PCI_BASE_ADDRESS_MEM_MASK;
/* Because veremap only works on page boundaries we must map
* a larger area than is actually implemented for the LCR
* memory range. We map a full page starting at the page boundary.
*/
- info->phys_lcr_base = lcr_mem_base;
+ info->phys_lcr_base = lcr_mem_base & PCI_BASE_ADDRESS_MEM_MASK;
info->lcr_offset = info->phys_lcr_base & (PAGE_SIZE-1);
info->phys_lcr_base &= ~(PAGE_SIZE-1);
info->bus_type = MGSL_BUS_TYPE_PCI;
info->io_addr_size = 8;
info->irq_flags = SA_SHIRQ;
- info->pdev = pdev;
+ info->bus = bus;
+ info->function = func;
- /* override default max frame size if arg available */
- if ( num_devices < MAX_TOTAL_DEVICES &&
- maxframe[num_devices] )
- info->max_frame_size = maxframe[num_devices];
-
/* Store the PCI9050 misc control register value because a flaw
* in the PCI9050 prevents LCR registers from being read if
* BIOS assigns an LCR base address with bit 7 set.
@@ -4588,6 +4509,9 @@ int mgsl_enumerate_devices()
/* add new device to device list */
mgsl_add_device( info );
+ } else {
+ break;
+ }
}
}
#endif
@@ -4757,6 +4681,10 @@ void cleanup_module(void)
info = mgsl_device_list;
while(info) {
+#ifdef CONFIG_SYNCLINK_SYNCPPP
+ if (info->dosyncppp)
+ mgsl_sppp_delete(info);
+#endif
mgsl_release_resources(info);
info = info->next_device;
}
@@ -6036,12 +5964,12 @@ void usc_reset( struct mgsl_struct *info )
{
if ( info->bus_type == MGSL_BUS_TYPE_PCI ) {
int i;
- volatile u32 readval;
+ u32 readval;
/* Set BIT30 of Misc Control Register */
/* (Local Control Register 0x50) to force reset of USC. */
- u32 *MiscCtrl = (u32 *)(info->lcr_base + 0x50);
+ volatile u32 *MiscCtrl = (u32 *)(info->lcr_base + 0x50);
u32 *LCR0BRDR = (u32 *)(info->lcr_base + 0x28);
info->misc_ctrl_value |= BIT30;
@@ -6769,6 +6697,10 @@ int mgsl_get_rx_frame(struct mgsl_struct *info)
else
info->icount.rxcrc++;
framesize = 0;
+#ifdef CONFIG_SYNCLINK_SYNCPPP
+ info->netstats.rx_errors++;
+ info->netstats.rx_frame_errors++;
+#endif
} else {
/* receive frame has no errors, get frame size.
* The frame size is the starting value of the RCC (which was
@@ -6797,19 +6729,14 @@ int mgsl_get_rx_frame(struct mgsl_struct *info)
if (framesize > info->max_frame_size)
info->icount.rxlong++;
else {
-#if 1
- /*
- * copy contents of dma frame buffer(s) to intermediate
- * rxbuffer for presentation to line discipline
- */
+ /* copy dma buffer(s) to contiguous intermediate buffer */
int copy_count = framesize;
int index = StartIndex;
unsigned char *ptmp = info->intermediate_rxbuffer;
info->icount.rxok++;
- while( copy_count )
- {
+ while(copy_count) {
int partial_count;
if ( copy_count > DMABUFFERSIZE )
partial_count = DMABUFFERSIZE;
@@ -6823,17 +6750,19 @@ int mgsl_get_rx_frame(struct mgsl_struct *info)
if ( ++index == info->rx_buffer_count )
index = 0;
-
}
-
- /* Call the line discipline receive callback directly. */
- tty->ldisc.receive_buf(tty, info->intermediate_rxbuffer, info->flag_buf, framesize);
-#else
- info->icount.rxok++;
- pBufEntry = &(info->rx_buffer_list[StartIndex]);
- /* Call the line discipline receive callback directly. */
- tty->ldisc.receive_buf(tty, pBufEntry->virt_addr, info->flag_buf, framesize);
+
+#ifdef CONFIG_SYNCLINK_SYNCPPP
+ if (info->netcount) {
+ /* pass frame to syncppp device */
+ mgsl_sppp_rx_done(info,info->intermediate_rxbuffer,framesize);
+ }
+ else
#endif
+ {
+ /* Call the line discipline receive callback directly. */
+ tty->ldisc.receive_buf(tty, info->intermediate_rxbuffer, info->flag_buf, framesize);
+ }
}
}
/* Free the buffers used by this frame. */
@@ -7056,8 +6985,8 @@ BOOLEAN mgsl_dma_test( struct mgsl_struct *info )
unsigned int i;
char *TmpPtr;
BOOLEAN rc = TRUE;
- volatile unsigned short status;
- volatile unsigned long EndTime;
+ unsigned short status;
+ unsigned long EndTime;
unsigned long flags;
MGSL_PARAMS tmp_params;
@@ -7467,12 +7396,7 @@ BOOLEAN mgsl_memory_test( struct mgsl_struct *info )
void mgsl_load_pci_memory( char* TargetPtr, const char* SourcePtr,
unsigned short count )
{
- /*******************************************************/
- /* A load interval of 16 allows for 4 32-bit writes at */
- /* 60ns each for a maximum latency of 240ns on the */
- /* local bus. */
- /*******************************************************/
-
+ /* 16 32-bit writes @ 60ns each = 960ns max latency on local bus */
#define PCI_LOAD_INTERVAL 64
unsigned short Intervalcount = count / PCI_LOAD_INTERVAL;
@@ -7551,7 +7475,12 @@ void mgsl_tx_timeout(unsigned long context)
spin_unlock_irqrestore(&info->irq_spinlock,flags);
- mgsl_bh_transmit_data(info,0);
+#ifdef CONFIG_SYNCLINK_SYNCPPP
+ if (info->netcount)
+ mgsl_sppp_tx_done(info);
+ else
+#endif
+ mgsl_bh_transmit(info);
} /* end of mgsl_tx_timeout() */
@@ -7629,3 +7558,223 @@ int usc_loopmode_send_active( struct mgsl_struct * info )
return usc_InReg( info, CCSR ) & BIT6 ? 1 : 0 ;
}
+#ifdef CONFIG_SYNCLINK_SYNCPPP
+/* syncppp net device routines
+ */
+
+void mgsl_sppp_init(struct mgsl_struct *info)
+{
+ struct net_device *d;
+
+ sprintf(info->netname,"mgsl%d",info->line);
+
+#if LINUX_VERSION_CODE < VERSION(2,2,16)
+ info->netdev = &info->pppdev.dev;
+#else
+ info->if_ptr = &info->pppdev;
+ info->netdev = info->pppdev.dev = &info->netdevice;
+#endif
+ sppp_attach(&info->pppdev);
+
+ d = info->netdev;
+ strcpy(d->name, info->netname);
+ d->base_addr = info->io_base;
+ d->irq = info->irq_level;
+ d->dma = info->dma_level;
+ d->priv = info;
+ d->init = NULL;
+ d->open = mgsl_sppp_open;
+ d->stop = mgsl_sppp_close;
+ d->hard_start_xmit = mgsl_sppp_tx;
+ d->do_ioctl = mgsl_sppp_ioctl;
+ d->get_stats = mgsl_net_stats;
+#if LINUX_VERSION_CODE >= VERSION(2,3,43)
+ d->tx_timeout = mgsl_sppp_tx_timeout;
+ d->watchdog_timeo = 10*HZ;
+#endif
+ dev_init_buffers(d);
+
+ if (register_netdev(d) == -1) {
+ printk(KERN_WARNING "%s: register_netdev failed.\n", d->name);
+ sppp_detach(info->netdev);
+ return;
+ }
+
+ if (debug_level >= DEBUG_LEVEL_INFO)
+ printk("mgsl_sppp_init()\n");
+}
+
+void mgsl_sppp_delete(struct mgsl_struct *info)
+{
+ if (debug_level >= DEBUG_LEVEL_INFO)
+ printk("mgsl_sppp_delete(%s)\n",info->netname);
+ sppp_detach(info->netdev);
+ unregister_netdev(info->netdev);
+}
+
+int mgsl_sppp_open(struct net_device *d)
+{
+ struct mgsl_struct *info = d->priv;
+ int err, flags;
+
+ if (debug_level >= DEBUG_LEVEL_INFO)
+ printk("mgsl_sppp_open(%s)\n",info->netname);
+
+ spin_lock_irqsave(&info->netlock, flags);
+ if (info->count != 0 || info->netcount != 0) {
+ printk(KERN_WARNING "%s: sppp_open returning busy\n", info->netname);
+ spin_unlock_irqrestore(&info->netlock, flags);
+ return -EBUSY;
+ }
+ info->netcount=1;
+ MOD_INC_USE_COUNT;
+ spin_unlock_irqrestore(&info->netlock, flags);
+
+ /* claim resources and init adapter */
+ if ((err = startup(info)) != 0)
+ goto open_fail;
+
+ /* allow syncppp module to do open processing */
+ if ((err = sppp_open(d)) != 0) {
+ shutdown(info);
+ goto open_fail;
+ }
+
+ info->serial_signals |= SerialSignal_RTS + SerialSignal_DTR;
+ mgsl_program_hw(info);
+
+ d->trans_start = jiffies;
+ netif_start_queue(d);
+ return 0;
+
+open_fail:
+ spin_lock_irqsave(&info->netlock, flags);
+ info->netcount=0;
+ MOD_DEC_USE_COUNT;
+ spin_unlock_irqrestore(&info->netlock, flags);
+ return err;
+}
+
+void mgsl_sppp_tx_timeout(struct net_device *dev)
+{
+ struct mgsl_struct *info = dev->priv;
+ int flags;
+
+ if (debug_level >= DEBUG_LEVEL_INFO)
+ printk("mgsl_sppp_tx_timeout(%s)\n",info->netname);
+
+ info->netstats.tx_errors++;
+ info->netstats.tx_aborted_errors++;
+
+ spin_lock_irqsave(&info->irq_spinlock,flags);
+ usc_stop_transmitter(info);
+ spin_unlock_irqrestore(&info->irq_spinlock,flags);
+
+ netif_wake_queue(dev);
+}
+
+int mgsl_sppp_tx(struct sk_buff *skb, struct net_device *dev)
+{
+ struct mgsl_struct *info = dev->priv;
+ unsigned long flags;
+
+ if (debug_level >= DEBUG_LEVEL_INFO)
+ printk("mgsl_sppp_tx(%s)\n",info->netname);
+
+#if LINUX_VERSION_CODE < VERSION(2,3,43)
+ if (dev->tbusy) {
+ if (time_before(jiffies, dev->trans_start+10*HZ))
+ return -EBUSY; /* 10 seconds timeout */
+ mgsl_sppp_tx_timeout(dev);
+ }
+ if (test_and_set_bit(0, (void*)&dev->tbusy) != 0)
+ return -EBUSY;
+#else
+ netif_stop_queue(dev);
+#endif
+
+ info->xmit_cnt = skb->len;
+ mgsl_load_tx_dma_buffer(info, skb->data, skb->len);
+ info->netstats.tx_packets++;
+ info->netstats.tx_bytes += skb->len;
+ dev_kfree_skb(skb);
+
+ dev->trans_start = jiffies;
+
+ spin_lock_irqsave(&info->irq_spinlock,flags);
+ if (!info->tx_active)
+ usc_start_transmitter(info);
+ spin_unlock_irqrestore(&info->irq_spinlock,flags);
+
+ return 0;
+}
+
+int mgsl_sppp_close(struct net_device *d)
+{
+ struct mgsl_struct *info = d->priv;
+ unsigned long flags;
+
+ if (debug_level >= DEBUG_LEVEL_INFO)
+ printk("mgsl_sppp_close(%s)\n",info->netname);
+
+ /* shutdown adapter and release resources */
+ shutdown(info);
+
+ /* allow syncppp to do close processing */
+ sppp_close(d);
+ netif_stop_queue(d);
+
+ spin_lock_irqsave(&info->netlock, flags);
+ info->netcount=0;
+ MOD_DEC_USE_COUNT;
+ spin_unlock_irqrestore(&info->netlock, flags);
+ return 0;
+}
+
+void mgsl_sppp_rx_done(struct mgsl_struct *info, char *buf, int size)
+{
+ struct sk_buff *skb = dev_alloc_skb(size);
+ if (debug_level >= DEBUG_LEVEL_INFO)
+ printk("mgsl_sppp_rx_done(%s)\n",info->netname);
+ if (skb == NULL) {
+ printk(KERN_NOTICE "%s: cant alloc skb, dropping packet\n",
+ info->netname);
+ info->netstats.rx_dropped++;
+ return;
+ }
+
+ memcpy(skb_put(skb, size),buf,size);
+
+ skb->protocol = htons(ETH_P_WAN_PPP);
+ skb->dev = info->netdev;
+ skb->mac.raw = skb->data;
+ info->netstats.rx_packets++;
+ info->netstats.rx_bytes += size;
+ netif_rx(skb);
+ info->netdev->trans_start = jiffies;
+}
+
+void mgsl_sppp_tx_done(struct mgsl_struct *info)
+{
+ if (netif_queue_stopped(info->netdev))
+ netif_wake_queue(info->netdev);
+}
+
+struct net_device_stats *mgsl_net_stats(struct net_device *dev)
+{
+ struct mgsl_struct *info = dev->priv;
+ if (debug_level >= DEBUG_LEVEL_INFO)
+ printk("mgsl_net_stats(%s)\n",info->netname);
+ return &info->netstats;
+}
+
+int mgsl_sppp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+{
+ struct mgsl_struct *info = (struct mgsl_struct *)dev->priv;
+ if (debug_level >= DEBUG_LEVEL_INFO)
+ printk("%s(%d):mgsl_ioctl %s cmd=%08X\n", __FILE__,__LINE__,
+ info->netname, cmd );
+ return sppp_do_ioctl(dev, ifr, cmd);
+}
+
+#endif /* ifdef CONFIG_SYNCLINK_SYNCPPP */
diff --git a/drivers/isdn/isdn_net.c b/drivers/isdn/isdn_net.c
index 016302ab2..07279cd7b 100644
--- a/drivers/isdn/isdn_net.c
+++ b/drivers/isdn/isdn_net.c
@@ -1820,7 +1820,7 @@ isdn_net_close(struct net_device *dev)
/*
* Get statistics
*/
-static struct enet_statistics *
+static struct net_device_stats *
isdn_net_get_stats(struct net_device *dev)
{
isdn_net_local *lp = (isdn_net_local *) dev->priv;
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index a3d6dfe6a..9ca4a9ae8 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -1031,12 +1031,12 @@ int
pmu_register_sleep_notifier(struct pmu_sleep_notifier *n)
{
struct list_head *list;
- struct pmu_sleep_notifier *current;
+ struct pmu_sleep_notifier *notifier;
for (list = sleep_notifiers.next; list != &sleep_notifiers;
list = list->next) {
- current = list_entry(list, struct pmu_sleep_notifier, list);
- if (n->priority > current->priority)
+ notifier = list_entry(list, struct pmu_sleep_notifier, list);
+ if (n->priority > notifier->priority)
break;
}
__list_add(&n->list, list->prev, list);
@@ -1059,18 +1059,18 @@ broadcast_sleep(int when, int fallback)
{
int ret = PBOOK_SLEEP_OK;
struct list_head *list;
- struct pmu_sleep_notifier *current;
+ struct pmu_sleep_notifier *notifier;
for (list = sleep_notifiers.prev; list != &sleep_notifiers;
list = list->prev) {
- current = list_entry(list, struct pmu_sleep_notifier, list);
- ret = current->notifier_call(current, when);
+ notifier = list_entry(list, struct pmu_sleep_notifier, list);
+ ret = notifier->notifier_call(notifier, when);
if (ret != PBOOK_SLEEP_OK) {
printk(KERN_DEBUG "sleep %d rejected by %p (%p)\n",
- when, current, current->notifier_call);
+ when, notifier, notifier->notifier_call);
for (; list != &sleep_notifiers; list = list->next) {
- current = list_entry(list, struct pmu_sleep_notifier, list);
- current->notifier_call(current, fallback);
+ notifier = list_entry(list, struct pmu_sleep_notifier, list);
+ notifier->notifier_call(notifier, fallback);
}
return ret;
}
@@ -1084,12 +1084,12 @@ broadcast_wake(void)
{
int ret = PBOOK_SLEEP_OK;
struct list_head *list;
- struct pmu_sleep_notifier *current;
+ struct pmu_sleep_notifier *notifier;
for (list = sleep_notifiers.next; list != &sleep_notifiers;
list = list->next) {
- current = list_entry(list, struct pmu_sleep_notifier, list);
- current->notifier_call(current, PBOOK_WAKE);
+ notifier = list_entry(list, struct pmu_sleep_notifier, list);
+ notifier->notifier_call(notifier, PBOOK_WAKE);
}
return ret;
}
diff --git a/drivers/mtd/Config.in b/drivers/mtd/Config.in
index 26fcfe517..e2af3489a 100644
--- a/drivers/mtd/Config.in
+++ b/drivers/mtd/Config.in
@@ -4,11 +4,6 @@ comment 'Memory Technology Devices (MTD)'
tristate 'Memory Technology Device (MTD) support' CONFIG_MTD
if [ "$CONFIG_MTD" != "n" ]; then
- dep_tristate 'Common Flash Interface (CFI) support' CONFIG_MTD_CFI $CONFIG_MTD
- dep_tristate 'CFI support for Intel/Sharp Extended Command Set chips' CONFIG_MTD_CFI_INTELEXT $CONFIG_CFI
- dep_tristate 'CFI chips in virtual memory map' CONFIG_MTD_NORA $CONFIG_MTD_CFI
- dep_tristate 'CFI chips in physical memory map' CONFIG_MTD_PHYSMAP $CONFIG_MTD_CFI
- dep_tristate 'CFI chips on RPXLite PPC board' CONFIG_MTD_RPXLITE $CONFIG_MTD_CFI
dep_tristate 'M-Systems Disk-On-Chip 1000 support' CONFIG_MTD_DOC1000 $CONFIG_MTD
dep_tristate 'M-Systems Disk-On-Chip 2000' CONFIG_MTD_DOC2000 $CONFIG_MTD
dep_tristate 'M-Systems Disk-On-Chip Millennium' CONFIG_MTD_DOC2001 $CONFIG_MTD
@@ -22,22 +17,43 @@ if [ "$CONFIG_MTD" != "n" ]; then
fi
fi
dep_tristate 'Use extra onboard system memory as MTD device' CONFIG_MTD_SLRAM $CONFIG_MTD
- dep_tristate 'Octagon 5066 SBC onboard flash support' CONFIG_MTD_OCTAGON $CONFIG_MTD
- dep_tristate 'Tempustech VMAX SBC301 onboard flash support' CONFIG_MTD_VMAX $CONFIG_MTD
- dep_tristate 'Mixcom piggyback flash card support' CONFIG_MTD_MIXMEM $CONFIG_MTD
dep_tristate 'Ramix PMC551 PCI Mezzanine ram card support' CONFIG_MTD_PMC551 $CONFIG_MTD
if [ "$CONFIG_MTD_PMC551" != "n" ]; then
bool 'PMC551 256M DRAM Bugfix' CONFIG_MTD_PMC551_BUGFIX
fi
dep_tristate 'Debugging RAM test driver' CONFIG_MTD_MTDRAM $CONFIG_MTD
+mainmenu_option next_comment
+comment 'MTD drivers for mapped chips'
+
+ dep_tristate 'Common Flash Interface (CFI) support' CONFIG_MTD_CFI $CONFIG_MTD
+ dep_tristate 'CFI support for Intel/Sharp Extended Command Set chips' CONFIG_MTD_CFI_INTELEXT $CONFIG_CFI
+ define_bool CONFIG_MTD_JEDEC n
+ define_bool CONFIG_MTD_RAM n
+ define_bool CONFIG_MTD_ROM n
+mainmenu_option next_comment
+comment 'Drivers for chip mappings'
+
+ dep_tristate 'Flash chip mapping in physical memory' CONFIG_MTD_PHYSMAP $CONFIG_MTD_CFI
+ if [ "$CONFIG_MTD_PHYSMAP" != "n" ]; then
+ hex ' Physical start location of flash chip mapping (0x8000000)' CONFIG_MTD_PHYSMAP_START 0x8000000
+ hex ' Physical length of flash chip mapping (0x4000000)' CONFIG_MTD_PHYSMAP_LEN 0x4000000
+ fi
+ dep_tristate 'Flash chip mapping on Mixcom piggyback card' CONFIG_MTD_MIXMEM $CONFIG_MTD_JEDEC
+ dep_tristate 'Flash chip mapping on Nora' CONFIG_MTD_NORA $CONFIG_MTD_CFI
+ dep_tristate 'Flash chip mapping on Octagon 5066 SBC' CONFIG_MTD_OCTAGON $CONFIG_MTD_JEDEC
+ dep_tristate 'Flash chip mapping on RPXLite PPC board' CONFIG_MTD_RPXLITE $CONFIG_MTD_CFI
+ dep_tristate 'Flash chip mapping on Tempustech VMAX SBC301' CONFIG_MTD_VMAX $CONFIG_MTD_JEDEC
+
+mainmenu_option next_comment
+comment 'User modules and translation layers for MTD devices'
+ dep_tristate 'Direct chardevice access to MTD devices' CONFIG_MTD_CHAR $CONFIG_MTD
+ dep_tristate 'Pseudo-blockdevice access to MTD devices' CONFIG_MTD_BLOCK $CONFIG_MTD
dep_tristate 'FTL (Flash Translation Layer) support' CONFIG_FTL $CONFIG_MTD
dep_tristate 'NFTL (NAND Flash Translation Layer) support' CONFIG_NFTL $CONFIG_MTD
if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_NFTL" != "n" ]; then
bool 'Write support for NFTL (EXPERIMENTAL)' CONFIG_NFTL_RW
fi
- dep_tristate 'Direct blockdevice access to MTD devices' CONFIG_MTD_BLOCK $CONFIG_MTD
- dep_tristate 'Direct chardevice access to MTD devices' CONFIG_MTD_CHAR $CONFIG_MTD
fi
endmenu
diff --git a/drivers/mtd/physmap.c b/drivers/mtd/physmap.c
index e470a6c97..658b8bf47 100644
--- a/drivers/mtd/physmap.c
+++ b/drivers/mtd/physmap.c
@@ -1,5 +1,5 @@
/*
- * $Id: physmap.c,v 1.1 2000/07/04 08:58:10 dwmw2 Exp $
+ * $Id: physmap.c,v 1.2 2000/07/11 09:42:32 dwmw2 Exp $
*
* Normal mappings of chips in physical memory
*/
@@ -10,10 +10,11 @@
#include <asm/io.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
+#include <linux/config.h>
-#define WINDOW_ADDR 0x8000000
-#define WINDOW_SIZE 0x4000000
+#define WINDOW_ADDR CONFIG_MTD_PHYSMAP_START
+#define WINDOW_SIZE CONFIG_MTD_PHYSMAP_LEN
static struct mtd_info *mymtd;
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index cea0739b0..819c49050 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -129,7 +129,7 @@ enum RxFilter {
#define SKB_QUEUE_SIZE 64
struct el3_private {
- struct enet_statistics stats;
+ struct net_device_stats stats;
struct net_device *next_dev;
spinlock_t lock;
/* skb send-queue */
@@ -146,7 +146,7 @@ static int el3_open(struct net_device *dev);
static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev);
static void el3_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static void update_stats(struct net_device *dev);
-static struct enet_statistics *el3_get_stats(struct net_device *dev);
+static struct net_device_stats *el3_get_stats(struct net_device *dev);
static int el3_rx(struct net_device *dev);
static int el3_close(struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
@@ -789,7 +789,7 @@ el3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
}
-static struct enet_statistics *
+static struct net_device_stats *
el3_get_stats(struct net_device *dev)
{
struct el3_private *lp = (struct el3_private *)dev->priv;
diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c
index 80021d00a..32e15dd44 100644
--- a/drivers/net/3c515.c
+++ b/drivers/net/3c515.c
@@ -310,7 +310,7 @@ struct corkscrew_private {
struct sk_buff *tx_skbuff[TX_RING_SIZE];
unsigned int cur_rx, cur_tx; /* The next free ring entry */
unsigned int dirty_rx, dirty_tx;/* The ring entries to be free()ed. */
- struct enet_statistics stats;
+ struct net_device_stats stats;
struct sk_buff *tx_skb; /* Packet being eaten by bus master ctrl. */
struct timer_list timer; /* Media selection timer. */
int capabilities ; /* Adapter capabilities word. */
@@ -384,7 +384,7 @@ static void corkscrew_interrupt(int irq, void *dev_id,
struct pt_regs *regs);
static int corkscrew_close(struct net_device *dev);
static void update_stats(int addr, struct net_device *dev);
-static struct enet_statistics *corkscrew_get_stats(struct net_device *dev);
+static struct net_device_stats *corkscrew_get_stats(struct net_device *dev);
static void set_rx_mode(struct net_device *dev);
@@ -1505,7 +1505,7 @@ static int corkscrew_close(struct net_device *dev)
return 0;
}
-static struct enet_statistics *corkscrew_get_stats(struct net_device *dev)
+static struct net_device_stats *corkscrew_get_stats(struct net_device *dev)
{
struct corkscrew_private *vp =
(struct corkscrew_private *) dev->priv;
diff --git a/drivers/net/aironet4500.h b/drivers/net/aironet4500.h
index 844f0ba03..92f2dd4c1 100644
--- a/drivers/net/aironet4500.h
+++ b/drivers/net/aironet4500.h
@@ -1522,7 +1522,7 @@ struct awc_private {
int full_stats;
int debug;
- struct enet_statistics stats;
+ struct net_device_stats stats;
struct ctl_table * proc_table;
@@ -1537,7 +1537,7 @@ extern int awc_open(struct net_device *dev);
extern void awc_tx_timeout(struct net_device *dev);
extern int awc_start_xmit(struct sk_buff *, struct net_device *);
extern void awc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-extern struct enet_statistics * awc_get_stats(struct net_device *dev);
+extern struct net_device_stats * awc_get_stats(struct net_device *dev);
extern int awc_rx(struct net_device *dev, struct awc_fid * rx_fid);
extern void awc_set_multicast_list(struct net_device *dev);
extern int awc_change_mtu(struct net_device *dev, int new_mtu);
diff --git a/drivers/net/aironet4500_core.c b/drivers/net/aironet4500_core.c
index 8c818d46a..321893b4b 100644
--- a/drivers/net/aironet4500_core.c
+++ b/drivers/net/aironet4500_core.c
@@ -3118,7 +3118,7 @@ inline int awc_rx(struct net_device *dev, struct awc_fid * rx_fid) {
- struct enet_statistics *awc_get_stats(struct net_device *dev)
+ struct net_device_stats *awc_get_stats(struct net_device *dev)
{
struct awc_private *priv = (struct awc_private *)dev->priv;
// unsigned long flags;
diff --git a/drivers/net/am79c961a.c b/drivers/net/am79c961a.c
index 91f6313d1..5a5016f8e 100644
--- a/drivers/net/am79c961a.c
+++ b/drivers/net/am79c961a.c
@@ -322,7 +322,7 @@ am79c961_close(struct net_device *dev)
* Get the current statistics. This may be called with the card open or
* closed.
*/
-static struct enet_statistics *am79c961_getstats (struct net_device *dev)
+static struct net_device_stats *am79c961_getstats (struct net_device *dev)
{
struct dev_priv *priv = (struct dev_priv *)dev->priv;
return &priv->stats;
diff --git a/drivers/net/am79c961a.h b/drivers/net/am79c961a.h
index b2c549334..76c812dab 100644
--- a/drivers/net/am79c961a.h
+++ b/drivers/net/am79c961a.h
@@ -109,7 +109,7 @@
#define TST_BUFF 0x8000
struct dev_priv {
- struct enet_statistics stats;
+ struct net_device_stats stats;
unsigned long rxbuffer[RX_BUFFERS];
unsigned long txbuffer[TX_BUFFERS];
unsigned char txhead;
diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c
index a089ed9e2..d334df665 100644
--- a/drivers/net/appletalk/ipddp.c
+++ b/drivers/net/appletalk/ipddp.c
@@ -122,10 +122,10 @@ int ipddp_init(struct net_device *dev)
/* Initalize the device structure. */
dev->hard_start_xmit = ipddp_xmit;
- dev->priv = kmalloc(sizeof(struct enet_statistics), GFP_KERNEL);
+ dev->priv = kmalloc(sizeof(struct net_device_stats), GFP_KERNEL);
if(!dev->priv)
return -ENOMEM;
- memset(dev->priv,0,sizeof(struct enet_statistics));
+ memset(dev->priv,0,sizeof(struct net_device_stats));
dev->open = ipddp_open;
dev->stop = ipddp_close;
diff --git a/drivers/net/arlan.c b/drivers/net/arlan.c
index 8636bfa11..b1a4549de 100644
--- a/drivers/net/arlan.c
+++ b/drivers/net/arlan.c
@@ -94,7 +94,7 @@ static int arlan_open(struct net_device *dev);
static int arlan_tx(struct sk_buff *skb, struct net_device *dev);
static void arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static int arlan_close(struct net_device *dev);
-static struct enet_statistics *
+static struct net_device_stats *
arlan_statistics (struct net_device *dev);
static void arlan_set_multicast (struct net_device *dev);
static int arlan_hw_tx (struct net_device* dev, char *buf, int length );
@@ -1907,7 +1907,7 @@ static long alignLong(volatile u_char * ptr)
* This may be called with the card open or closed.
*/
-static struct enet_statistics *arlan_statistics(struct net_device *dev)
+static struct net_device_stats *arlan_statistics(struct net_device *dev)
{
struct arlan_private *priv = (struct arlan_private *) dev->priv;
volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card;
diff --git a/drivers/net/arlan.h b/drivers/net/arlan.h
index 83208e4e3..e28982bdb 100644
--- a/drivers/net/arlan.h
+++ b/drivers/net/arlan.h
@@ -343,7 +343,7 @@ struct TxRingPoint {
#define TX_RING_SIZE 2
/* Information that need to be kept for each board. */
struct arlan_private {
- struct enet_statistics stats;
+ struct net_device_stats stats;
long open_time; /* Useless example local info. */
struct arlan_shmem * card;
struct arlan_shmem * conf;
@@ -574,4 +574,4 @@ struct arlan_private {
#define ARLAN_DEBUG_INTERRUPT 0x00080
#define ARLAN_DEBUG_STARTUP 0x00100
#define ARLAN_DEBUG_SHUTDOWN 0x00200
- \ No newline at end of file
+
diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c
index 67f8dbd3f..d1a6be95c 100644
--- a/drivers/net/at1700.c
+++ b/drivers/net/at1700.c
@@ -110,7 +110,7 @@ typedef unsigned char uchar;
/* Information that need to be kept for each board. */
struct net_local {
- struct enet_statistics stats;
+ struct net_device_stats stats;
spinlock_t lock;
unsigned char mc_filter[8];
uint jumpered:1; /* Set iff the board has jumper config. */
@@ -164,7 +164,7 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev);
static void net_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static void net_rx(struct net_device *dev);
static int net_close(struct net_device *dev);
-static struct enet_statistics *net_get_stats(struct net_device *dev);
+static struct net_device_stats *net_get_stats(struct net_device *dev);
static void set_rx_mode(struct net_device *dev);
static void net_tx_timeout (struct net_device *dev);
@@ -796,7 +796,7 @@ static int net_close(struct net_device *dev)
This may be called with the card open or closed.
There are no on-chip counters, so this function is trivial.
*/
-static struct enet_statistics *
+static struct net_device_stats *
net_get_stats(struct net_device *dev)
{
struct net_local *lp = (struct net_local *)dev->priv;
diff --git a/drivers/net/dmfe.c b/drivers/net/dmfe.c
index b425513b0..c34472200 100644
--- a/drivers/net/dmfe.c
+++ b/drivers/net/dmfe.c
@@ -214,7 +214,7 @@ struct dmfe_board_info {
u8 rx_error_cnt; /* recievd abnormal case count */
u8 dm910x_chk_mode; /* Operating mode check */
struct timer_list timer;
- struct enet_statistics stats; /* statistic counter */
+ struct net_device_stats stats; /* statistic counter */
unsigned char srom[128];
};
@@ -313,7 +313,7 @@ static unsigned long CrcTable[256] =
static int dmfe_open(struct net_device *);
static int dmfe_start_xmit(struct sk_buff *, struct net_device *);
static int dmfe_stop(struct net_device *);
-static struct enet_statistics *dmfe_get_stats(struct net_device *);
+static struct net_device_stats *dmfe_get_stats(struct net_device *);
static void dmfe_set_filter_mode(struct net_device *);
static int dmfe_do_ioctl(struct net_device *, struct ifreq *, int);
static u16 read_srom_word(long, int);
@@ -849,7 +849,7 @@ static void dmfe_rx_packet(struct net_device *dev, struct dmfe_board_info *db)
/*
Get statistics from driver.
*/
-static struct enet_statistics *dmfe_get_stats(struct net_device *dev)
+static struct net_device_stats *dmfe_get_stats(struct net_device *dev)
{
struct dmfe_board_info *db = (struct dmfe_board_info *) dev->priv;
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c
index 324cf3934..2a5488a81 100644
--- a/drivers/net/eepro.c
+++ b/drivers/net/eepro.c
@@ -181,7 +181,7 @@ static unsigned int net_debug = NET_DEBUG;
/* Information that need to be kept for each board. */
struct eepro_local {
- struct enet_statistics stats;
+ struct net_device_stats stats;
unsigned rx_start;
unsigned tx_start; /* start of the transmit chain */
int tx_last; /* pointer to last packet in the transmit chain */
@@ -293,7 +293,7 @@ static void eepro_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static void eepro_rx(struct net_device *dev);
static void eepro_transmit_interrupt(struct net_device *dev);
static int eepro_close(struct net_device *dev);
-static struct enet_statistics *eepro_get_stats(struct net_device *dev);
+static struct net_device_stats *eepro_get_stats(struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
static void eepro_tx_timeout (struct net_device *dev);
@@ -1247,7 +1247,7 @@ static int eepro_close(struct net_device *dev)
/* Get the current statistics. This may be called with the card open or
closed. */
-static struct enet_statistics *
+static struct net_device_stats *
eepro_get_stats(struct net_device *dev)
{
struct eepro_local *lp = (struct eepro_local *)dev->priv;
diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index 27a6b188c..db89a18f6 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -518,7 +518,7 @@ struct speedo_private {
unsigned int cur_rx, dirty_rx; /* The next free ring entry */
long last_rx_time; /* Last Rx, in jiffies, to handle Rx hang. */
const char *product_name;
- struct enet_statistics stats;
+ struct net_device_stats stats;
struct speedo_stats *lstats;
dma_addr_t lstats_dma;
int chip_id;
@@ -585,7 +585,7 @@ static int speedo_rx(struct net_device *dev);
static void speedo_tx_buffer_gc(struct net_device *dev);
static void speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
static int speedo_close(struct net_device *dev);
-static struct enet_statistics *speedo_get_stats(struct net_device *dev);
+static struct net_device_stats *speedo_get_stats(struct net_device *dev);
static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static void set_rx_mode(struct net_device *dev);
static void speedo_show_state(struct net_device *dev);
@@ -1905,7 +1905,7 @@ speedo_close(struct net_device *dev)
Oh, and incoming frames are dropped while executing dump-stats!
*/
-static struct enet_statistics *
+static struct net_device_stats *
speedo_get_stats(struct net_device *dev)
{
struct speedo_private *sp = (struct speedo_private *)dev->priv;
diff --git a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c
index 9db2fca69..7be66ce89 100644
--- a/drivers/net/ibmlana.c
+++ b/drivers/net/ibmlana.c
@@ -1001,7 +1001,7 @@ static int ibmlana_tx(struct sk_buff *skb, struct IBMLANA_NETDEV *dev)
/* return pointer to Ethernet statistics */
-static struct enet_statistics *ibmlana_stats(struct IBMLANA_NETDEV *dev)
+static struct net_device_stats *ibmlana_stats(struct IBMLANA_NETDEV *dev)
{
ibmlana_priv *priv = (ibmlana_priv *) dev->priv;
@@ -1131,7 +1131,7 @@ int ibmlana_probe(struct IBMLANA_NETDEV *dev)
priv->slot = slot;
priv->realirq = irq;
priv->medium = medium;
- memset(&(priv->stat), 0, sizeof(struct enet_statistics));
+ memset(&(priv->stat), 0, sizeof(struct net_device_stats));
/* set base + irq for this device (irq not allocated so far) */
diff --git a/drivers/net/ibmlana.h b/drivers/net/ibmlana.h
index e8e477d2a..58429842a 100644
--- a/drivers/net/ibmlana.h
+++ b/drivers/net/ibmlana.h
@@ -41,7 +41,7 @@ typedef enum { Media_10BaseT, Media_10Base5,
typedef struct {
unsigned int slot; /* MCA-Slot-# */
- struct enet_statistics stat; /* packet statistics */
+ struct net_device_stats stat; /* packet statistics */
int realirq; /* memorizes actual IRQ, even when
currently not allocated */
ibmlana_medium medium; /* physical cannector */
diff --git a/drivers/net/pcmcia/netwave_cs.c b/drivers/net/pcmcia/netwave_cs.c
index 8cfbb96b5..a17ac13ae 100644
--- a/drivers/net/pcmcia/netwave_cs.c
+++ b/drivers/net/pcmcia/netwave_cs.c
@@ -235,7 +235,7 @@ static void netwave_watchdog(u_long); /* Transmission watchdog */
/* Statistics */
static void update_stats(struct net_device *dev);
-static struct enet_statistics *netwave_get_stats(struct net_device *dev);
+static struct net_device_stats *netwave_get_stats(struct net_device *dev);
/* Wireless extensions */
#ifdef WIRELESS_EXT
@@ -312,14 +312,14 @@ typedef struct netwave_private {
spinlock_t lock;
struct timer_list watchdog; /* To avoid blocking state */
struct site_survey nss;
- struct enet_statistics stats;
+ struct net_device_stats stats;
#ifdef WIRELESS_EXT
struct iw_statistics iw_stats; /* Wireless stats */
#endif
} netwave_private;
#ifdef NETWAVE_STATS
-static struct enet_statistics *netwave_get_stats(struct net_device *dev);
+static struct net_device_stats *netwave_get_stats(struct net_device *dev);
#endif
/*
@@ -1434,7 +1434,7 @@ static void netwave_watchdog(u_long a) {
} /* netwave_watchdog */
-static struct enet_statistics *netwave_get_stats(struct net_device *dev) {
+static struct net_device_stats *netwave_get_stats(struct net_device *dev) {
netwave_private *priv = (netwave_private*)dev->priv;
update_stats(dev);
diff --git a/drivers/net/pcmcia/ray_cs.c b/drivers/net/pcmcia/ray_cs.c
index 452b9e7ed..0408612e6 100644
--- a/drivers/net/pcmcia/ray_cs.c
+++ b/drivers/net/pcmcia/ray_cs.c
@@ -94,7 +94,7 @@ static void ray_detach(dev_link_t *);
/***** Prototypes indicated by device structure ******************************/
static int ray_dev_close(struct net_device *dev);
static int ray_dev_config(struct net_device *dev, struct ifmap *map);
-static struct enet_statistics *ray_get_stats(struct net_device *dev);
+static struct net_device_stats *ray_get_stats(struct net_device *dev);
static int ray_dev_init(struct net_device *dev);
static int ray_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
static int ray_open(struct net_device *dev);
@@ -1679,13 +1679,13 @@ static int parse_addr(char *in_str, UCHAR *out)
return status;
}
/*===========================================================================*/
-static struct enet_statistics *ray_get_stats(struct net_device *dev)
+static struct net_device_stats *ray_get_stats(struct net_device *dev)
{
ray_dev_t *local = (ray_dev_t *)dev->priv;
dev_link_t *link = local->finder;
struct status *p = (struct status *)(local->sram + STATUS_BASE);
if (!(link->state & DEV_PRESENT)) {
- DEBUG(2,"ray_cs enet_statistics - device not present\n");
+ DEBUG(2,"ray_cs net_device_stats - device not present\n");
return &local->stats;
}
if (readb(&p->mrx_overflow_for_host))
diff --git a/drivers/net/pcmcia/ray_cs.h b/drivers/net/pcmcia/ray_cs.h
index 6f6f8e6ca..830dd2268 100644
--- a/drivers/net/pcmcia/ray_cs.h
+++ b/drivers/net/pcmcia/ray_cs.h
@@ -50,7 +50,7 @@ typedef struct ray_dev_t {
UCHAR auth_id[6];
UCHAR net_default_tx_rate;
UCHAR encryption;
- struct enet_statistics stats;
+ struct net_device_stats stats;
UCHAR net_type;
UCHAR sta_type;
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index 0ed5b4317..289d1bccc 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -398,7 +398,7 @@ typedef struct local_info_t {
dev_link_t link;
struct net_device dev;
dev_node_t node;
- struct enet_statistics stats;
+ struct net_device_stats stats;
int card_type;
int probe_port;
int silicon; /* silicon revision. 0=old CE2, 1=Scipper, 4=Mohawk */
@@ -416,7 +416,7 @@ typedef struct local_info_t {
*/
static int do_start_xmit(struct sk_buff *skb, struct net_device *dev);
static void do_tx_timeout(struct net_device *dev);
-static struct enet_statistics *do_get_stats(struct net_device *dev);
+static struct net_device_stats *do_get_stats(struct net_device *dev);
static void set_addresses(struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
static int set_card_type(dev_link_t *link, const void *s);
@@ -1648,7 +1648,7 @@ do_start_xmit(struct sk_buff *skb, struct net_device *dev)
return 0;
}
-static struct enet_statistics *
+static struct net_device_stats *
do_get_stats(struct net_device *dev)
{
local_info_t *lp = dev->priv;
diff --git a/drivers/net/ptifddi.c b/drivers/net/ptifddi.c
index ec0dcd23b..e559928f5 100644
--- a/drivers/net/ptifddi.c
+++ b/drivers/net/ptifddi.c
@@ -142,7 +142,7 @@ static int pti_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct ptifddi *pp = (struct ptifddi *) dev->priv;
}
-static struct enet_statistics *pti_get_stats(struct net_device *dev)
+static struct net_device_stats *pti_get_stats(struct net_device *dev)
{ return &(((struct ptifddi *)dev->priv)->enet_stats); }
static void pti_set_multicast(struct net_device *dev)
diff --git a/drivers/net/rcpci45.c b/drivers/net/rcpci45.c
index 767d0a434..7a020278f 100644
--- a/drivers/net/rcpci45.c
+++ b/drivers/net/rcpci45.c
@@ -122,7 +122,7 @@ typedef struct
U32 bus;
U32 function;
struct timer_list timer; /* timer */
- struct enet_statistics stats; /* the statistics structure */
+ struct net_device_stats stats; /* the statistics structure */
struct net_device *next; /* points to the next RC adapter */
unsigned long numOutRcvBuffers;/* number of outstanding receive buffers*/
unsigned char shutdown;
@@ -152,7 +152,7 @@ static int RCopen(struct net_device *);
static int RC_xmit_packet(struct sk_buff *, struct net_device *);
static void RCinterrupt(int, void *, struct pt_regs *);
static int RCclose(struct net_device *dev);
-static struct enet_statistics *RCget_stats(struct net_device *);
+static struct net_device_stats *RCget_stats(struct net_device *);
static int RCioctl(struct net_device *, struct ifreq *, int);
static int RCconfig(struct net_device *, struct ifmap *);
static void RCxmit_callback(U32, U16, PU32, U16);
@@ -936,7 +936,7 @@ RCclose(struct net_device *dev)
return 0;
}
-static struct enet_statistics *
+static struct net_device_stats *
RCget_stats(struct net_device *dev)
{
RCLINKSTATS RCstats;
@@ -1019,7 +1019,7 @@ RCget_stats(struct net_device *dev)
pDpa->stats.tx_heartbeat_errors = 0;
pDpa->stats.tx_window_errors = 0;
- return ((struct enet_statistics *)&(pDpa->stats));
+ return ((struct net_device_stats *)&(pDpa->stats));
}
return 0;
}
diff --git a/drivers/net/rtl8129.c b/drivers/net/rtl8129.c
index d72b811b0..e3fedb0c9 100644
--- a/drivers/net/rtl8129.c
+++ b/drivers/net/rtl8129.c
@@ -260,11 +260,7 @@ struct rtl8129_private {
int chip_id;
int chip_revision;
unsigned char pci_bus, pci_devfn;
-#if LINUX_VERSION_CODE > 0x20139
struct net_device_stats stats;
-#else
- struct enet_statistics stats;
-#endif
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;
@@ -306,7 +302,7 @@ 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 enet_statistics *rtl8129_get_stats(struct net_device *dev);
+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);
@@ -1365,7 +1361,7 @@ static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
}
}
-static struct enet_statistics *
+static struct net_device_stats *
rtl8129_get_stats(struct net_device *dev)
{
struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv;
diff --git a/drivers/net/sb1000.c b/drivers/net/sb1000.c
index a34deb630..97dfb6bd4 100644
--- a/drivers/net/sb1000.c
+++ b/drivers/net/sb1000.c
@@ -92,7 +92,7 @@ static int sb1000_open(struct net_device *dev);
static int sb1000_dev_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd);
static int sb1000_start_xmit(struct sk_buff *skb, struct net_device *dev);
static void sb1000_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-static struct enet_statistics *sb1000_stats(struct net_device *dev);
+static struct net_device_stats *sb1000_stats(struct net_device *dev);
static int sb1000_close(struct net_device *dev);
@@ -760,7 +760,7 @@ sb1000_rx(struct net_device *dev)
unsigned int skbsize;
struct sk_buff *skb;
struct sb1000_private *lp = (struct sb1000_private *)dev->priv;
- struct enet_statistics *stats = &lp->stats;
+ struct net_device_stats *stats = &lp->stats;
/* SB1000 frame constants */
const int FrameSize = FRAMESIZE;
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c
index 1cea70fb7..53a223151 100644
--- a/drivers/net/sgiseeq.c
+++ b/drivers/net/sgiseeq.c
@@ -107,7 +107,7 @@ struct sgiseeq_private {
unsigned char control;
unsigned char mode;
- struct enet_statistics stats;
+ struct net_device_stats stats;
};
static inline void hpc3_eth_reset(volatile struct hpc3_ethregs *hregs)
@@ -552,7 +552,7 @@ static void timeout(struct net_device *dev)
netif_wake_queue(dev);
}
-static struct enet_statistics *sgiseeq_get_stats(struct net_device *dev)
+static struct net_device_stats *sgiseeq_get_stats(struct net_device *dev)
{
struct sgiseeq_private *sp = (struct sgiseeq_private *) dev->priv;
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
index ddc98a3d5..d709ac2ca 100644
--- a/drivers/net/sis900.c
+++ b/drivers/net/sis900.c
@@ -161,7 +161,7 @@ static void sis900_finish_xmit (struct net_device *net_dev);
static void sis900_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
static int sis900_close(struct net_device *net_dev);
static int mii_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd);
-static struct enet_statistics *sis900_get_stats(struct net_device *net_dev);
+static struct net_device_stats *sis900_get_stats(struct net_device *net_dev);
static u16 sis900_compute_hashtable_index(u8 *addr);
static void set_rx_mode(struct net_device *net_dev);
static void sis900_reset(struct net_device *net_dev);
@@ -1140,7 +1140,7 @@ static int mii_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd)
}
}
-static struct enet_statistics *
+static struct net_device_stats *
sis900_get_stats(struct net_device *net_dev)
{
struct sis900_private *sis_priv = (struct sis900_private *)net_dev->priv;
diff --git a/drivers/net/sk_mca.c b/drivers/net/sk_mca.c
index 1b8e48e0f..a98da4115 100644
--- a/drivers/net/sk_mca.c
+++ b/drivers/net/sk_mca.c
@@ -1016,7 +1016,7 @@ static int skmca_tx(struct sk_buff *skb, struct SKMCA_NETDEV *dev)
/* return pointer to Ethernet statistics */
-static struct enet_statistics *skmca_stats(struct SKMCA_NETDEV *dev)
+static struct net_device_stats *skmca_stats(struct SKMCA_NETDEV *dev)
{
skmca_priv *priv = (skmca_priv *) dev->priv;
@@ -1164,7 +1164,7 @@ int skmca_probe(struct SKMCA_NETDEV *dev)
priv->ctrladdr = base + 0x3ff2;
priv->cmdaddr = base + 0x3ff3;
priv->medium = medium;
- memset(&(priv->stat), 0, sizeof(struct enet_statistics));
+ memset(&(priv->stat), 0, sizeof(struct net_device_stats));
/* set base + irq for this device (irq not allocated so far) */
dev->irq = 0;
diff --git a/drivers/net/sk_mca.h b/drivers/net/sk_mca.h
index b107ecfb8..8a379b0e7 100644
--- a/drivers/net/sk_mca.h
+++ b/drivers/net/sk_mca.h
@@ -49,7 +49,7 @@ typedef struct {
int nexttxdone; /* index of next TX descriptor to
be finished */
int txbusy; /* # of busy TX descriptors */
- struct enet_statistics stat; /* packet statistics */
+ struct net_device_stats stat; /* packet statistics */
int realirq; /* memorizes actual IRQ, even when
currently not allocated */
skmca_medium medium; /* physical cannector */
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
index 0d67bbb01..d845bd2ea 100644
--- a/drivers/net/skfp/skfddi.c
+++ b/drivers/net/skfp/skfddi.c
@@ -121,7 +121,7 @@ static int skfp_driver_init(struct net_device *dev);
static int skfp_open(struct net_device *dev);
static int skfp_close(struct net_device *dev);
static void skfp_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-static struct enet_statistics *skfp_ctl_get_stats(struct net_device *dev);
+static struct net_device_stats *skfp_ctl_get_stats(struct net_device *dev);
static void skfp_ctl_set_multicast_list(struct net_device *dev);
static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev);
static int skfp_ctl_set_mac_address(struct net_device *dev, void *addr);
@@ -967,7 +967,7 @@ void skfp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
* independent.
*
*/
-struct enet_statistics *skfp_ctl_get_stats(struct net_device *dev)
+struct net_device_stats *skfp_ctl_get_stats(struct net_device *dev)
{
struct s_smc *bp = (struct s_smc *) dev->priv;
@@ -1090,7 +1090,7 @@ struct enet_statistics *skfp_ctl_get_stats(struct net_device *dev)
bp->stats.port_lem_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[1].ls;
#endif
- return ((struct enet_statistics *) &bp->os.MacStat);
+ return ((struct net_device_stats *) &bp->os.MacStat);
} // ctl_get_stat
diff --git a/drivers/net/sonic.c b/drivers/net/sonic.c
index b0c6d6615..5480ec0ff 100644
--- a/drivers/net/sonic.c
+++ b/drivers/net/sonic.c
@@ -377,7 +377,7 @@ sonic_rx(struct net_device *dev)
* Get the current statistics.
* This may be called with the device open or closed.
*/
-static struct enet_statistics *
+static struct net_device_stats *
sonic_get_stats(struct net_device *dev)
{
struct sonic_local *lp = (struct sonic_local *)dev->priv;
diff --git a/drivers/net/sonic.h b/drivers/net/sonic.h
index 4c18dbe70..d070f06e3 100644
--- a/drivers/net/sonic.h
+++ b/drivers/net/sonic.h
@@ -460,7 +460,7 @@ struct sonic_local {
unsigned int cur_tx;
unsigned int dirty_tx; /* last unacked transmit packet */
char tx_full;
- struct enet_statistics stats;
+ struct net_device_stats stats;
};
/* Index to functions, as function prototypes. */
@@ -470,7 +470,7 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev);
static void sonic_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static void sonic_rx(struct net_device *dev);
static int sonic_close(struct net_device *dev);
-static struct enet_statistics *sonic_get_stats(struct net_device *dev);
+static struct net_device_stats *sonic_get_stats(struct net_device *dev);
static void sonic_multicast_list(struct net_device *dev);
static int sonic_init(struct net_device *dev);
diff --git a/drivers/net/strip.c b/drivers/net/strip.c
index 3f3bd8a4a..b63c47cb8 100644
--- a/drivers/net/strip.c
+++ b/drivers/net/strip.c
@@ -2430,12 +2430,12 @@ static int dev_set_mac_address(struct net_device *dev, void *addr)
return 0;
}
-static struct enet_statistics *strip_get_stats(struct net_device *dev)
+static struct net_device_stats *strip_get_stats(struct net_device *dev)
{
- static struct enet_statistics stats;
+ static struct net_device_stats stats;
struct strip *strip_info = (struct strip *)(dev->priv);
- memset(&stats, 0, sizeof(struct enet_statistics));
+ memset(&stats, 0, sizeof(struct net_device_stats));
stats.rx_packets = strip_info->rx_packets;
stats.tx_packets = strip_info->tx_packets;
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c
index 3b7f76700..b7fe862d0 100644
--- a/drivers/net/sunbmac.c
+++ b/drivers/net/sunbmac.c
@@ -164,7 +164,7 @@ static void bigmac_stop(struct bigmac *bp)
static void bigmac_get_counters(struct bigmac *bp, unsigned long bregs)
{
- struct enet_statistics *stats = &bp->enet_stats;
+ struct net_device_stats *stats = &bp->enet_stats;
stats->rx_crc_errors += sbus_readl(bregs + BMAC_RCRCECTR);
sbus_writel(0, bregs + BMAC_RCRCECTR);
@@ -974,7 +974,7 @@ static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
return 0;
}
-static struct enet_statistics *bigmac_get_stats(struct net_device *dev)
+static struct net_device_stats *bigmac_get_stats(struct net_device *dev)
{
struct bigmac *bp = (struct bigmac *) dev->priv;
diff --git a/drivers/net/sunbmac.h b/drivers/net/sunbmac.h
index f1d878c66..6a668a9c5 100644
--- a/drivers/net/sunbmac.h
+++ b/drivers/net/sunbmac.h
@@ -328,7 +328,7 @@ struct bigmac {
enum bigmac_timer_state timer_state;
unsigned int timer_ticks;
- struct enet_statistics enet_stats;
+ struct net_device_stats enet_stats;
struct sbus_dev *qec_sdev;
struct sbus_dev *bigmac_sdev;
struct net_device *dev;
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
index 0fefb11ed..e9481039d 100644
--- a/drivers/net/tokenring/smctr.c
+++ b/drivers/net/tokenring/smctr.c
@@ -124,7 +124,7 @@ static unsigned int smctr_get_num_rx_bdbs(struct net_device *dev);
static int smctr_get_physical_drop_number(struct net_device *dev);
static __u8 *smctr_get_rx_pointer(struct net_device *dev, short queue);
static int smctr_get_station_id(struct net_device *dev);
-static struct enet_statistics *smctr_get_stats(struct net_device *dev);
+static struct net_device_stats *smctr_get_stats(struct net_device *dev);
static FCBlock *smctr_get_tx_fcb(struct net_device *dev, __u16 queue,
__u16 bytes_count);
static int smctr_get_upstream_neighbor_addr(struct net_device *dev);
@@ -1402,11 +1402,11 @@ static int smctr_get_station_id(struct net_device *dev)
* Get the current statistics. This may be called with the card open
* or closed.
*/
-static struct enet_statistics *smctr_get_stats(struct net_device *dev)
+static struct net_device_stats *smctr_get_stats(struct net_device *dev)
{
struct net_local *tp = (struct net_local *)dev->priv;
- return ((struct enet_statistics *)&tp->MacStat);
+ return ((struct net_device_stats *)&tp->MacStat);
}
static FCBlock *smctr_get_tx_fcb(struct net_device *dev, __u16 queue,
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index f5a6d3587..e6dcbf2d8 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -143,7 +143,7 @@ static void tms380tr_exec_cmd(struct net_device *dev, unsigned short Command);
static void tms380tr_exec_sifcmd(struct net_device *dev, unsigned int WriteValue);
/* "F" */
/* "G" */
-static struct enet_statistics *tms380tr_get_stats(struct net_device *dev);
+static struct net_device_stats *tms380tr_get_stats(struct net_device *dev);
/* "H" */
static void tms380tr_hardware_send_packet(struct net_device *dev,
struct net_local* tp);
@@ -1166,11 +1166,11 @@ int tms380tr_close(struct net_device *dev)
* Get the current statistics. This may be called with the card open
* or closed.
*/
-static struct enet_statistics *tms380tr_get_stats(struct net_device *dev)
+static struct net_device_stats *tms380tr_get_stats(struct net_device *dev)
{
struct net_local *tp = (struct net_local *)dev->priv;
- return ((struct enet_statistics *)&tp->MacStat);
+ return ((struct net_device_stats *)&tp->MacStat);
}
/*
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index 6b0c7dd15..9079f8113 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -717,7 +717,7 @@ static int tulip_close (struct net_device *dev)
return 0;
}
-static struct enet_statistics *tulip_get_stats(struct net_device *dev)
+static struct net_device_stats *tulip_get_stats(struct net_device *dev)
{
struct tulip_private *tp = (struct tulip_private *)dev->priv;
long ioaddr = dev->base_addr;
diff --git a/drivers/net/wan/Config.in b/drivers/net/wan/Config.in
index 890fe7104..4621d3981 100644
--- a/drivers/net/wan/Config.in
+++ b/drivers/net/wan/Config.in
@@ -45,6 +45,8 @@ if [ "$CONFIG_WAN" = "y" ]; then
dep_tristate 'Sealevel Systems 4021 support' CONFIG_SEALEVEL_4021 m
+ dep_tristate 'SyncLink HDLC/SYNCPPP support' CONFIG_SYNCLINK_SYNCPPP m
+
tristate 'Frame relay DLCI support' CONFIG_DLCI
if [ "$CONFIG_DLCI" != "n" ]; then
int 'Max open DLCI' CONFIG_DLCI_COUNT 24
diff --git a/drivers/net/wan/Makefile b/drivers/net/wan/Makefile
index 3904c76a6..d45f0ccfd 100644
--- a/drivers/net/wan/Makefile
+++ b/drivers/net/wan/Makefile
@@ -49,6 +49,14 @@ else
endif
endif
+ifeq ($(CONFIG_SYNCLINK_SYNCPPP),y)
+CONFIG_SYNCPPP_BUILTIN = y
+else
+ ifeq ($(CONFIG_SYNCLINK_SYNCPPP),m)
+ CONFIG_SYNCPPP_MODULE = y
+ endif
+endif
+
ifeq ($(CONFIG_COMX),y)
LX_OBJS += comx.o
else
diff --git a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c
index b28fdafc1..09d6c9556 100644
--- a/drivers/net/wan/hostess_sv11.c
+++ b/drivers/net/wan/hostess_sv11.c
@@ -166,7 +166,7 @@ static int hostess_ioctl(struct net_device *d, struct ifreq *ifr, int cmd)
return sppp_do_ioctl(d, ifr,cmd);
}
-static struct enet_statistics *hostess_get_stats(struct net_device *d)
+static struct net_device_stats *hostess_get_stats(struct net_device *d)
{
struct sv11_device *sv11=d->priv;
if(sv11)
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index c0b17f79f..30ec7ab8e 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -127,7 +127,7 @@ static int lmc_start_xmit(struct sk_buff *skb, struct net_device *dev);
static int lmc_rx (struct net_device *dev);
static int lmc_open(struct net_device *dev);
static int lmc_close(struct net_device *dev);
-static struct enet_statistics *lmc_get_stats(struct net_device *dev);
+static struct net_device_stats *lmc_get_stats(struct net_device *dev);
static void lmc_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
static int lmc_set_config(struct net_device *dev, struct ifmap *map);
static void lmc_initcsrs(lmc_softc_t * const sc, lmc_csrptr_t csr_base, size_t csr_size);
@@ -1961,7 +1961,7 @@ skip_out_of_mem:
return 0;
}
-static struct enet_statistics *lmc_get_stats (struct net_device *dev) /*fold00*/
+static struct net_device_stats *lmc_get_stats (struct net_device *dev) /*fold00*/
{
lmc_softc_t *sc;
LMC_SPIN_FLAGS;
@@ -1978,7 +1978,7 @@ static struct enet_statistics *lmc_get_stats (struct net_device *dev) /*fold00*/
lmc_trace(dev, "lmc_get_stats out");
- return (struct enet_statistics *) &sc->stats;
+ return (struct net_device_stats *) &sc->stats;
}
#ifdef MODULE
diff --git a/drivers/net/wan/lmc/lmc_var.h b/drivers/net/wan/lmc/lmc_var.h
index 67215b93b..9f50aada0 100644
--- a/drivers/net/wan/lmc/lmc_var.h
+++ b/drivers/net/wan/lmc/lmc_var.h
@@ -248,7 +248,7 @@ struct lmc___media {
#define STATCHECK 0xBEEFCAFE
/* Included in this structure are first
- * - standard enet_statistics
+ * - standard net_device_stats
* - some other counters used for debug and driver performance
* evaluation -baz
*/
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 69a32c48d..37ef27487 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -100,7 +100,7 @@ static int sbni_start_xmit(struct sk_buff *skb, struct net_device *dev);
static void sbni_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static int sbni_close(struct net_device *dev);
static void sbni_drop_tx_queue(struct net_device *dev);
-static struct enet_statistics *sbni_get_stats(struct net_device *dev);
+static struct net_device_stats *sbni_get_stats(struct net_device *dev);
static void card_start(struct net_device *dev);
static inline unsigned short sbni_recv(struct net_device *dev);
void change_level(struct net_device *dev);
@@ -952,7 +952,7 @@ static void sbni_interrupt(int irq, void *dev_id, struct pt_regs *regs)
spin_unlock(&lp->lock);
}
-static struct enet_statistics *sbni_get_stats(struct net_device *dev)
+static struct net_device_stats *sbni_get_stats(struct net_device *dev)
{
struct net_local *lp = (struct net_local *)dev->priv;
return &lp->stats;
diff --git a/drivers/net/wan/sbni.h b/drivers/net/wan/sbni.h
index 56550d8f2..ce44bea46 100644
--- a/drivers/net/wan/sbni.h
+++ b/drivers/net/wan/sbni.h
@@ -106,7 +106,7 @@ struct sbni_in_stats {
* Board-specific info in dev->priv.
*/
struct net_local {
- struct enet_statistics stats;
+ struct net_device_stats stats;
struct timer_list watchdog;
unsigned int realframelen; /* the current size of the SB-frame */
diff --git a/drivers/net/wan/sdla_chdlc.c b/drivers/net/wan/sdla_chdlc.c
index 5989cdc47..efdf2069d 100644
--- a/drivers/net/wan/sdla_chdlc.c
+++ b/drivers/net/wan/sdla_chdlc.c
@@ -143,7 +143,7 @@ static int if_rebuild_hdr (void* hdr, struct net_device* dev, unsigned long radd
struct sk_buff* skb);
#endif
static int if_send (struct sk_buff* skb, struct net_device* dev);
-static struct enet_statistics* if_stats (struct net_device* dev);
+static struct net_device_stats* if_stats (struct net_device* dev);
/* CHDLC Firmware interface functions */
static int chdlc_configure (sdla_t* card, void* data);
@@ -1169,7 +1169,7 @@ unsigned short calc_checksum (char *data, int len)
/*============================================================================
* Get ethernet-style interface statistics.
- * Return a pointer to struct enet_statistics.
+ * Return a pointer to struct net_device_stats.
*/
#ifdef LINUX_2_1
static struct net_device_stats* if_stats (struct net_device* dev)
@@ -1181,7 +1181,7 @@ static struct net_device_stats* if_stats (struct net_device* dev)
return &my_card->wandev.stats;
}
#else
-static struct enet_statistics* if_stats (struct net_device* dev)
+static struct net_device_stats* if_stats (struct net_device* dev)
{
sdla_t *my_card;
chdlc_private_area_t* chdlc_priv_area = dev->priv;
diff --git a/drivers/net/wan/sdla_fr.c b/drivers/net/wan/sdla_fr.c
index ab88a8bb3..69054c9f2 100644
--- a/drivers/net/wan/sdla_fr.c
+++ b/drivers/net/wan/sdla_fr.c
@@ -1588,9 +1588,9 @@ static void switch_net_numbers(unsigned char *sendpacket, unsigned long network_
/*============================================================================
* Get ethernet-style interface statistics.
- * Return a pointer to struct enet_statistics.
+ * Return a pointer to struct net_device_stats.
*/
-static struct enet_statistics* if_stats (struct net_device* dev)
+static struct net_device_stats* if_stats (struct net_device* dev)
{
fr_channel_t* chan = dev->priv;
diff --git a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c
index 68b318688..f1a895e36 100644
--- a/drivers/net/wan/sealevel.c
+++ b/drivers/net/wan/sealevel.c
@@ -164,7 +164,7 @@ static int sealevel_ioctl(struct net_device *d, struct ifreq *ifr, int cmd)
return sppp_do_ioctl(d, ifr,cmd);
}
-static struct enet_statistics *sealevel_get_stats(struct net_device *d)
+static struct net_device_stats *sealevel_get_stats(struct net_device *d)
{
struct slvl_device *slvl=d->priv;
if(slvl)
diff --git a/drivers/parport/ChangeLog b/drivers/parport/ChangeLog
index f22c69b2a..d408c8796 100644
--- a/drivers/parport/ChangeLog
+++ b/drivers/parport/ChangeLog
@@ -1,3 +1,13 @@
+2000-06-30 Gunther Mayer <gunther.mayer@braunschweig.okersurf.de>
+
+ * parport_pc.c: Support for the full range of Timedia cards.
+
+2000-07-08 Tim Waugh <twaugh@redhat.com>
+
+ * daisy.c: License block comments as part of parportbook.
+ * ieee1284.c: Likewise.
+ * share.c: Likewise.
+
2000-06-30 Petr Vandrovec <vandrove@vc.cvut.cz>
* procfs.c (do_hardware_modes): Generated string can be up to 34
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 12b56f585..709228dc6 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2307,8 +2307,31 @@ enum parport_pc_pci_cards {
boca_ioppar,
plx_9050,
afavlab_tk9902,
- timedia_1889,
+ timedia_4078a,
+ timedia_4079h,
+ timedia_4085h,
+ timedia_4088a,
+ timedia_4089a,
+ timedia_4095a,
+ timedia_4096a,
+ timedia_4078u,
+ timedia_4079a,
+ timedia_4085u,
+ timedia_4079r,
+ timedia_4079s,
+ timedia_4079d,
+ timedia_4079e,
+ timedia_4079f,
+ timedia_9079a,
+ timedia_9079b,
+ timedia_9079c,
+ timedia_4006a,
+ timedia_4014,
+ timedia_4008a,
+ timedia_4018,
+ timedia_9018a,
syba_2p_epp,
+ syba_1p_ecp,
};
@@ -2348,10 +2371,33 @@ static struct parport_pc_pci {
/* boca_ioppar */ { 1, { { 0, -1 }, } },
/* plx_9050 */ { 2, { { 4, -1 }, { 5, -1 }, } },
/* afavlab_tk9902 */ { 1, { { 0, 1 }, } },
- /* timedia_1889 */ { 1, { { 2, -1 }, } },
+ /* timedia_4078a */ { 1, { { 2, -1 }, } },
+ /* timedia_4079h */ { 1, { { 2, 3 }, } },
+ /* timedia_4085h */ { 2, { { 2, -1 }, { 4, -1 }, } },
+ /* timedia_4088a */ { 2, { { 2, 3 }, { 4, 5 }, } },
+ /* timedia_4089a */ { 2, { { 2, 3 }, { 4, 5 }, } },
+ /* timedia_4095a */ { 2, { { 2, 3 }, { 4, 5 }, } },
+ /* timedia_4096a */ { 2, { { 2, 3 }, { 4, 5 }, } },
+ /* timedia_4078u */ { 1, { { 2, -1 }, } },
+ /* timedia_4079a */ { 1, { { 2, 3 }, } },
+ /* timedia_4085u */ { 2, { { 2, -1 }, { 4, -1 }, } },
+ /* timedia_4079r */ { 1, { { 2, 3 }, } },
+ /* timedia_4079s */ { 1, { { 2, 3 }, } },
+ /* timedia_4079d */ { 1, { { 2, 3 }, } },
+ /* timedia_4079e */ { 1, { { 2, 3 }, } },
+ /* timedia_4079f */ { 1, { { 2, 3 }, } },
+ /* timedia_9079a */ { 1, { { 2, 3 }, } },
+ /* timedia_9079b */ { 1, { { 2, 3 }, } },
+ /* timedia_9079c */ { 1, { { 2, 3 }, } },
+ /* timedia_4006a */ { 1, { { 0, -1 }, } },
+ /* timedia_4014 */ { 2, { { 0, -1 }, { 2, -1 }, } },
+ /* timedia_4008a */ { 1, { { 0, 1 }, } },
+ /* timedia_4018 */ { 2, { { 0, 1 }, { 2, 3 }, } },
+ /* timedia_9018a */ { 2, { { 0, 1 }, { 2, 3 }, } },
/* SYBA uses fixed offsets in
a 1K io window */
- /* syba_2p_epp */ { 2, { { 0, 0x078 }, { 0, 0x178 }, } },
+ /* syba_2p_epp AP138B */ { 2, { { 0, 0x078 }, { 0, 0x178 }, } },
+ /* syba_1p_ecp W83787 */ { 1, { { 0, 0x078 }, } },
};
static struct pci_device_id parport_pc_pci_tbl[] __devinitdata = {
@@ -2409,9 +2455,34 @@ static struct pci_device_id parport_pc_pci_tbl[] __devinitdata = {
PCI_SUBVENDOR_ID_EXSYS, PCI_SUBDEVICE_ID_EXSYS_4014, 0,0, plx_9050 },
{ PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_TK9902,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, afavlab_tk9902 },
- { PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, timedia_1889 },
- { 0x1592, 0x0782, PCI_ANY_ID, PCI_ANY_ID, 0, 0, syba_2p_epp },
+ /* PCI_VENDOR_ID_TIMEDIA/SUNIX has many differing cards ...*/
+ { 0x1409, 0x7168, 0x1409, 0x4078, 0, 0, timedia_4078a },
+ { 0x1409, 0x7168, 0x1409, 0x4079, 0, 0, timedia_4079h },
+ { 0x1409, 0x7168, 0x1409, 0x4085, 0, 0, timedia_4085h },
+ { 0x1409, 0x7168, 0x1409, 0x4088, 0, 0, timedia_4088a },
+ { 0x1409, 0x7168, 0x1409, 0x4089, 0, 0, timedia_4089a },
+ { 0x1409, 0x7168, 0x1409, 0x4095, 0, 0, timedia_4095a },
+ { 0x1409, 0x7168, 0x1409, 0x4096, 0, 0, timedia_4096a },
+ { 0x1409, 0x7168, 0x1409, 0x5078, 0, 0, timedia_4078u },
+ { 0x1409, 0x7168, 0x1409, 0x5079, 0, 0, timedia_4079a },
+ { 0x1409, 0x7168, 0x1409, 0x5085, 0, 0, timedia_4085u },
+ { 0x1409, 0x7168, 0x1409, 0x6079, 0, 0, timedia_4079r },
+ { 0x1409, 0x7168, 0x1409, 0x7079, 0, 0, timedia_4079s },
+ { 0x1409, 0x7168, 0x1409, 0x8079, 0, 0, timedia_4079d },
+ { 0x1409, 0x7168, 0x1409, 0x9079, 0, 0, timedia_4079e },
+ { 0x1409, 0x7168, 0x1409, 0xa079, 0, 0, timedia_4079f },
+ { 0x1409, 0x7168, 0x1409, 0xb079, 0, 0, timedia_9079a },
+ { 0x1409, 0x7168, 0x1409, 0xc079, 0, 0, timedia_9079b },
+ { 0x1409, 0x7168, 0x1409, 0xd079, 0, 0, timedia_9079c },
+ { 0x1409, 0x7268, 0x1409, 0x0101, 0, 0, timedia_4006a },
+ { 0x1409, 0x7268, 0x1409, 0x0102, 0, 0, timedia_4014 },
+ { 0x1409, 0x7268, 0x1409, 0x0103, 0, 0, timedia_4008a },
+ { 0x1409, 0x7268, 0x1409, 0x0104, 0, 0, timedia_4018 },
+ { 0x1409, 0x7268, 0x1409, 0x9018, 0, 0, timedia_9018a },
+ { PCI_VENDOR_ID_SYBA, PCI_DEVICE_ID_SYBA_2P_EPP,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, syba_2p_epp },
+ { PCI_VENDOR_ID_SYBA, PCI_DEVICE_ID_SYBA_1P_ECP,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, syba_1p_ecp },
{ 0, } /* terminate list */
};
MODULE_DEVICE_TABLE(pci,parport_pc_pci_tbl);
diff --git a/drivers/sound/Makefile b/drivers/sound/Makefile
index 10fbd5871..399148c74 100644
--- a/drivers/sound/Makefile
+++ b/drivers/sound/Makefile
@@ -47,7 +47,7 @@ obj-$(CONFIG_SOUND_SOFTOSS) += softoss2.o
obj-$(CONFIG_SOUND_SSCAPE) += sscape.o ad1848.o mpu401.o
obj-$(CONFIG_SOUND_MAD16) += mad16.o ad1848.o sb_lib.o uart401.o
obj-$(CONFIG_SOUND_CS4232) += cs4232.o uart401.o
-obj-$(CONFIG_SOUND_OPL3SA2) += opl3sa2.o ad1848.o uart401.o mpu401.o
+obj-$(CONFIG_SOUND_OPL3SA2) += opl3sa2.o ad1848.o mpu401.o
obj-$(CONFIG_SOUND_MSS) += ad1848.o
obj-$(CONFIG_SOUND_PAS) += pas2.o sb_lib.o uart401.o
obj-$(CONFIG_SOUND_SB) += sb.o sb_lib.o uart401.o
diff --git a/drivers/usb/bluetooth.c b/drivers/usb/bluetooth.c
index dc3b54ed1..aaea67a4c 100644
--- a/drivers/usb/bluetooth.c
+++ b/drivers/usb/bluetooth.c
@@ -33,7 +33,6 @@
*/
-#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/signal.h>
diff --git a/drivers/usb/hub.c b/drivers/usb/hub.c
index 75794f3ca..71d6aabb9 100644
--- a/drivers/usb/hub.c
+++ b/drivers/usb/hub.c
@@ -588,6 +588,8 @@ static int usb_hub_thread(void *__hub)
* so get rid of all our resources
*/
exit_files(current); /* daemonize doesn't do exit_files */
+ current->files = init_task.files;
+ atomic_inc(&current->files->count);
daemonize();
/* Setup a nice name */
diff --git a/drivers/usb/ov511.c b/drivers/usb/ov511.c
index 66f73d3c1..1862415fa 100644
--- a/drivers/usb/ov511.c
+++ b/drivers/usb/ov511.c
@@ -30,7 +30,7 @@
* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-static const char version[] = "1.18";
+static const char version[] = "1.19";
#define __NO_VERSION__
@@ -98,6 +98,9 @@ static int aperture = -1;
* programs that expect RGB data (e.g. gqcam) to work with this driver. */
static int force_rgb = 0;
+/* Number of seconds before inactive buffers are deallocated */
+static int buf_timeout = 5;
+
MODULE_PARM(autoadjust, "i");
MODULE_PARM(debug, "i");
MODULE_PARM(fix_rgb_offset, "i");
@@ -106,6 +109,7 @@ MODULE_PARM(sensor, "i");
MODULE_PARM(i2c_detect_tries, "i");
MODULE_PARM(aperture, "i");
MODULE_PARM(force_rgb, "i");
+MODULE_PARM(buf_timeout, "i");
MODULE_AUTHOR("Mark McClelland <mmcclelland@delphi.com> & Bret Wallach & Orion Sky Lawlor <olawlor@acm.org> & Kevin Moore & Charl P. Botha <cpbotha@ieee.org> & Claudio Matsuoka <claudio@conectiva.com>");
MODULE_DESCRIPTION("OV511 USB Camera Driver");
@@ -132,6 +136,7 @@ static struct cam_list clist[] = {
{ -1, NULL }
};
+#if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS)
static struct palette_list plist[] = {
{ VIDEO_PALETTE_GREY, "GREY" },
{ VIDEO_PALETTE_HI240, "HI240" },
@@ -151,6 +156,7 @@ static struct palette_list plist[] = {
{ VIDEO_PALETTE_YUV410P,"YUV410P" },
{ -1, NULL }
};
+#endif
/**********************************************************************
*
@@ -432,7 +438,7 @@ static int ov511_reg_write(struct usb_device *dev,
PDEBUG(5, "reg write: 0x%02X:0x%02X, 0x%x", reg, value, rc);
if (rc < 0)
- err("ov511_reg_write: error %d", rc);
+ err("reg write: error %d", rc);
return rc;
}
@@ -452,7 +458,7 @@ static int ov511_reg_read(struct usb_device *dev, unsigned char reg)
PDEBUG(5, "reg read: 0x%02X:0x%02X", reg, buffer[0]);
if (rc < 0) {
- err("ov511_reg_read: error %d", rc);
+ err("reg read: error %d", rc);
return rc;
} else {
return buffer[0];
@@ -501,7 +507,7 @@ static int ov511_i2c_write(struct usb_device *dev,
return 0;
error:
- err("ov511_i2c_write: error %d", rc);
+ err("i2c write: error %d", rc);
return rc;
}
@@ -573,7 +579,7 @@ static int ov511_i2c_read(struct usb_device *dev, unsigned char reg)
return value;
error:
- err("ov511_i2c_read: error %d", rc);
+ err("i2c read: error %d", rc);
return rc;
}
@@ -601,7 +607,7 @@ static int ov511_write_regvals(struct usb_device *dev,
return 0;
error:
- err("ov511_write_regvals: error %d", rc);
+ err("write regvals: error %d", rc);
return rc;
}
@@ -699,11 +705,8 @@ static int ov511_set_packet_size(struct usb_ov511 *ov511, int size)
if (ov511->bridge == BRG_OV511) {
if (size == 0) alt = OV511_ALT_SIZE_0;
else if (size == 257) alt = OV511_ALT_SIZE_257;
-// else if (size == 512) alt = OV511_ALT_SIZE_512;
else if (size == 513) alt = OV511_ALT_SIZE_513;
-// else if (size == 768) alt = OV511_ALT_SIZE_768;
else if (size == 769) alt = OV511_ALT_SIZE_769;
-// else if (size == 992) alt = OV511_ALT_SIZE_992;
else if (size == 993) alt = OV511_ALT_SIZE_993;
else {
err("Set packet size: invalid size (%d)", size);
@@ -1673,7 +1676,7 @@ static void ov511_isoc_irq(struct urb *urb)
static int ov511_init_isoc(struct usb_ov511 *ov511)
{
urb_t *urb;
- int fx, err;
+ int fx, err, n;
PDEBUG(3, "*** Initializing capture ***");
@@ -1689,55 +1692,37 @@ static int ov511_init_isoc(struct usb_ov511 *ov511)
else
err("invalid bridge type");
- /* We double buffer the Iso lists */
- urb = usb_alloc_urb(FRAMES_PER_DESC);
+ for (n = 0; n < OV511_NUMSBUF; n++) {
+ urb = usb_alloc_urb(FRAMES_PER_DESC);
- if (!urb) {
- err("ov511_init_isoc: usb_alloc_urb ret. NULL");
- return -ENOMEM;
- }
- ov511->sbuf[0].urb = urb;
- urb->dev = ov511->dev;
- urb->context = ov511;
- urb->pipe = usb_rcvisocpipe(ov511->dev, OV511_ENDPOINT_ADDRESS);
- urb->transfer_flags = USB_ISO_ASAP;
- urb->transfer_buffer = ov511->sbuf[0].data;
- urb->complete = ov511_isoc_irq;
- urb->number_of_packets = FRAMES_PER_DESC;
- urb->transfer_buffer_length = ov511->packet_size * FRAMES_PER_DESC;
- for (fx = 0; fx < FRAMES_PER_DESC; fx++) {
- urb->iso_frame_desc[fx].offset = ov511->packet_size * fx;
- urb->iso_frame_desc[fx].length = ov511->packet_size;
- }
-
- urb = usb_alloc_urb(FRAMES_PER_DESC);
- if (!urb) {
- err("ov511_init_isoc: usb_alloc_urb ret. NULL");
- return -ENOMEM;
- }
- ov511->sbuf[1].urb = urb;
- urb->dev = ov511->dev;
- urb->context = ov511;
- urb->pipe = usb_rcvisocpipe(ov511->dev, OV511_ENDPOINT_ADDRESS);
- urb->transfer_flags = USB_ISO_ASAP;
- urb->transfer_buffer = ov511->sbuf[1].data;
- urb->complete = ov511_isoc_irq;
- urb->number_of_packets = FRAMES_PER_DESC;
- urb->transfer_buffer_length = ov511->packet_size * FRAMES_PER_DESC;
- for (fx = 0; fx < FRAMES_PER_DESC; fx++) {
- urb->iso_frame_desc[fx].offset = ov511->packet_size * fx;
- urb->iso_frame_desc[fx].length = ov511->packet_size;
+ if (!urb) {
+ err("init isoc: usb_alloc_urb ret. NULL");
+ return -ENOMEM;
+ }
+ ov511->sbuf[n].urb = urb;
+ urb->dev = ov511->dev;
+ urb->context = ov511;
+ urb->pipe = usb_rcvisocpipe(ov511->dev, OV511_ENDPOINT_ADDRESS);
+ urb->transfer_flags = USB_ISO_ASAP;
+ urb->transfer_buffer = ov511->sbuf[n].data;
+ urb->complete = ov511_isoc_irq;
+ urb->number_of_packets = FRAMES_PER_DESC;
+ urb->transfer_buffer_length = ov511->packet_size * FRAMES_PER_DESC;
+ for (fx = 0; fx < FRAMES_PER_DESC; fx++) {
+ urb->iso_frame_desc[fx].offset = ov511->packet_size * fx;
+ urb->iso_frame_desc[fx].length = ov511->packet_size;
+ }
}
- ov511->sbuf[1].urb->next = ov511->sbuf[0].urb;
- ov511->sbuf[0].urb->next = ov511->sbuf[1].urb;
+ ov511->sbuf[OV511_NUMSBUF - 1].urb->next = ov511->sbuf[0].urb;
+ for (n = 0; n < OV511_NUMSBUF - 1; n++)
+ ov511->sbuf[n].urb->next = ov511->sbuf[n+1].urb;
- err = usb_submit_urb(ov511->sbuf[0].urb);
- if (err)
- err("ov511_init_isoc: usb_submit_urb(0) ret %d", err);
- err = usb_submit_urb(ov511->sbuf[1].urb);
- if (err)
- err("ov511_init_isoc: usb_submit_urb(1) ret %d", err);
+ for (n = 0; n < OV511_NUMSBUF; n++) {
+ err = usb_submit_urb(ov511->sbuf[n].urb);
+ if (err)
+ err("init isoc: usb_submit_urb(%d) ret %d", n, err);
+ }
ov511->streaming = 1;
@@ -1746,6 +1731,8 @@ static int ov511_init_isoc(struct usb_ov511 *ov511)
static void ov511_stop_isoc(struct usb_ov511 *ov511)
{
+ int n;
+
if (!ov511->streaming || !ov511->dev)
return;
@@ -1756,17 +1743,13 @@ static void ov511_stop_isoc(struct usb_ov511 *ov511)
ov511->streaming = 0;
/* Unschedule all of the iso td's */
- if (ov511->sbuf[1].urb) {
- ov511->sbuf[1].urb->next = NULL;
- usb_unlink_urb(ov511->sbuf[1].urb);
- usb_free_urb(ov511->sbuf[1].urb);
- ov511->sbuf[1].urb = NULL;
- }
- if (ov511->sbuf[0].urb) {
- ov511->sbuf[0].urb->next = NULL;
- usb_unlink_urb(ov511->sbuf[0].urb);
- usb_free_urb(ov511->sbuf[0].urb);
- ov511->sbuf[0].urb = NULL;
+ for (n = OV511_NUMSBUF - 1; n >= 0; n--) {
+ if (ov511->sbuf[n].urb) {
+ ov511->sbuf[n].urb->next = NULL;
+ usb_unlink_urb(ov511->sbuf[n].urb);
+ usb_free_urb(ov511->sbuf[n].urb);
+ ov511->sbuf[n].urb = NULL;
+ }
}
}
@@ -1818,6 +1801,127 @@ static int ov511_new_frame(struct usb_ov511 *ov511, int framenum)
/****************************************************************************
*
+ * Buffer management
+ *
+ ***************************************************************************/
+static int ov511_alloc(struct usb_ov511 *ov511)
+{
+ int i;
+
+ PDEBUG(4, "entered");
+ down(&ov511->buf_lock);
+
+ if (ov511->buf_state == BUF_PEND_DEALLOC) {
+ ov511->buf_state = BUF_ALLOCATED;
+ del_timer(&ov511->buf_timer);
+ }
+
+ if (ov511->buf_state == BUF_ALLOCATED)
+ goto out;
+
+ ov511->fbuf = rvmalloc(OV511_NUMFRAMES * MAX_DATA_SIZE);
+ if (!ov511->fbuf)
+ goto error;
+
+ for (i = 0; i < OV511_NUMFRAMES; i++) {
+ ov511->frame[i].grabstate = FRAME_UNUSED;
+ ov511->frame[i].data = ov511->fbuf + i * MAX_DATA_SIZE;
+ PDEBUG(4, "frame[%d] @ %p", i, ov511->frame[i].data);
+
+ ov511->sbuf[i].data = kmalloc(FRAMES_PER_DESC *
+ MAX_FRAME_SIZE_PER_DESC, GFP_KERNEL);
+ if (!ov511->sbuf[i].data) {
+ while (--i) {
+ kfree(ov511->sbuf[i].data);
+ ov511->sbuf[i].data = NULL;
+ }
+ rvfree(ov511->fbuf, OV511_NUMFRAMES * MAX_DATA_SIZE);
+ ov511->fbuf = NULL;
+ goto error;
+ }
+ PDEBUG(4, "sbuf[%d] @ %p", i, ov511->sbuf[i].data);
+ }
+ ov511->buf_state = BUF_ALLOCATED;
+out:
+ up(&ov511->buf_lock);
+ PDEBUG(4, "leaving");
+ return 0;
+error:
+ ov511->buf_state = BUF_NOT_ALLOCATED;
+ up(&ov511->buf_lock);
+ PDEBUG(4, "errored");
+ return -ENOMEM;
+}
+
+/*
+ * - You must acquire buf_lock before entering this function.
+ * - Because this code will free any non-null pointer, you must be sure to null
+ * them if you explicitly free them somewhere else!
+ */
+static void ov511_do_dealloc(struct usb_ov511 *ov511)
+{
+ int i;
+ PDEBUG(4, "entered");
+
+ if (ov511->fbuf) {
+ rvfree(ov511->fbuf, OV511_NUMFRAMES * MAX_DATA_SIZE);
+ ov511->fbuf = NULL;
+ }
+
+ for (i = 0; i < OV511_NUMFRAMES; i++) {
+ if (ov511->sbuf[i].data) {
+ kfree(ov511->sbuf[i].data);
+ ov511->sbuf[i].data = NULL;
+ }
+ }
+
+ PDEBUG(4, "buffer memory deallocated");
+ ov511->buf_state = BUF_NOT_ALLOCATED;
+ PDEBUG(4, "leaving");
+}
+
+static void ov511_buf_callback(unsigned long data)
+{
+ struct usb_ov511 *ov511 = (struct usb_ov511 *)data;
+ PDEBUG(4, "entered");
+ down(&ov511->buf_lock);
+
+ if (ov511->buf_state == BUF_PEND_DEALLOC)
+ ov511_do_dealloc(ov511);
+
+ up(&ov511->buf_lock);
+ PDEBUG(4, "leaving");
+}
+
+static void ov511_dealloc(struct usb_ov511 *ov511, int now)
+{
+ struct timer_list *bt = &(ov511->buf_timer);
+ PDEBUG(4, "entered");
+ down(&ov511->buf_lock);
+
+ PDEBUG(4, "deallocating buffer memory %s", now ? "now" : "later");
+
+ if (ov511->buf_state == BUF_PEND_DEALLOC) {
+ ov511->buf_state = BUF_ALLOCATED;
+ del_timer(bt);
+ }
+
+ if (now)
+ ov511_do_dealloc(ov511);
+ else {
+ ov511->buf_state = BUF_PEND_DEALLOC;
+ init_timer(bt);
+ bt->function = ov511_buf_callback;
+ bt->data = (unsigned long)ov511;
+ bt->expires = jiffies + buf_timeout * HZ;
+ add_timer(bt);
+ }
+ up(&ov511->buf_lock);
+ PDEBUG(4, "leaving");
+}
+
+/****************************************************************************
+ *
* V4L API
*
***************************************************************************/
@@ -1825,7 +1929,7 @@ static int ov511_new_frame(struct usb_ov511 *ov511, int framenum)
static int ov511_open(struct video_device *dev, int flags)
{
struct usb_ov511 *ov511 = (struct usb_ov511 *)dev;
- int i, err = 0;
+ int err = 0;
MOD_INC_USE_COUNT;
PDEBUG(4, "opening");
@@ -1836,33 +1940,16 @@ static int ov511_open(struct video_device *dev, int flags)
goto out;
err = -ENOMEM;
-
- /* Allocate memory for the frame buffers */
- ov511->fbuf = rvmalloc(OV511_NUMFRAMES * MAX_DATA_SIZE);
- if (!ov511->fbuf)
+ if (ov511_alloc(ov511))
goto out;
ov511->sub_flag = 0;
- for (i = 0; i < OV511_NUMFRAMES; i++) {
- ov511->frame[i].grabstate = FRAME_UNUSED;
- ov511->frame[i].data = ov511->fbuf + i * MAX_DATA_SIZE;
- PDEBUG(4, "frame [%d] @ %p", i, ov511->frame[0].data);
-
- ov511->sbuf[i].data = kmalloc(FRAMES_PER_DESC *
- MAX_FRAME_SIZE_PER_DESC, GFP_KERNEL);
- if (!ov511->sbuf[i].data) {
-open_free_ret:
- while (--i) kfree(ov511->sbuf[i].data);
- rvfree(ov511->fbuf, 2 * MAX_DATA_SIZE);
- goto out;
- }
- PDEBUG(4, "sbuf[%d] @ %p", i, ov511->sbuf[i].data);
- }
-
err = ov511_init_isoc(ov511);
- if (err)
- goto open_free_ret;
+ if (err) {
+ ov511_dealloc(ov511, 0);
+ goto out;
+ }
ov511->user++;
@@ -1878,7 +1965,6 @@ out:
static void ov511_close(struct video_device *dev)
{
struct usb_ov511 *ov511 = (struct usb_ov511 *)dev;
- int i;
PDEBUG(4, "ov511_close");
@@ -1887,15 +1973,13 @@ static void ov511_close(struct video_device *dev)
ov511_stop_isoc(ov511);
- rvfree(ov511->fbuf, OV511_NUMFRAMES * MAX_DATA_SIZE);
- for (i = 0; i < OV511_NUMFRAMES; i++)
- kfree(ov511->sbuf[i].data);
-
+ ov511_dealloc(ov511, 0);
up(&ov511->lock);
if (!ov511->dev) {
video_unregister_device(&ov511->vdev);
kfree(ov511);
+ ov511 = NULL;
}
MOD_DEC_USE_COUNT;
@@ -2118,8 +2202,8 @@ static int ov511_ioctl(struct video_device *vdev, unsigned int cmd, void *arg)
struct video_mbuf vm;
memset(&vm, 0, sizeof(vm));
- vm.size = 2 * MAX_DATA_SIZE;
- vm.frames = 2;
+ vm.size = OV511_NUMFRAMES * MAX_DATA_SIZE;
+ vm.frames = OV511_NUMFRAMES;
vm.offsets[0] = 0;
vm.offsets[1] = MAX_FRAME_SIZE + sizeof (struct timeval);
@@ -2329,7 +2413,7 @@ restart:
frame->bytes_read = 0;
err("** ick! ** Errored frame %d", ov511->curframe);
if (ov511_new_frame(ov511, frmx))
- err("ov511_read: ov511_new_frame error");
+ err("read: ov511_new_frame error");
goto restart;
}
@@ -2531,15 +2615,24 @@ static int ov76xx_configure(struct usb_ov511 *ov511)
/* Reset the 76xx */
if (ov511_i2c_write(dev, 0x12, 0x80) < 0) return -1;
+#if 1 /* Maybe this will fix detection problems? MM */
+ /* Wait for it to initialize */
+ schedule_timeout (1 + 150 * HZ / 1000);
+#endif
+
for (i = 0, success = 0; i < i2c_detect_tries && !success; i++) {
if ((ov511_i2c_read(dev, OV7610_REG_ID_HIGH) == 0x7F) &&
- (ov511_i2c_read(dev, OV7610_REG_ID_LOW) == 0xA2))
+ (ov511_i2c_read(dev, OV7610_REG_ID_LOW) == 0xA2)) {
success = 1;
+ continue;
+ }
- /* Dummy read to sync I2C */
- if (ov511_i2c_read(dev, 0x00) < 0) return -1;
+ /* Reset the 76xx */
+ if (ov511_i2c_write(dev, 0x12, 0x80) < 0) return -1;
/* Wait for it to initialize */
schedule_timeout (1 + 150 * HZ / 1000);
+ /* Dummy read to sync I2C */
+ if (ov511_i2c_read(dev, 0x00) < 0) return -1;
}
if (success) {
@@ -2647,8 +2740,9 @@ static int ov511_configure(struct usb_ov511 *ov511)
memcpy(&ov511->vdev, &ov511_template, sizeof(ov511_template));
- init_waitqueue_head(&ov511->frame[0].wq);
- init_waitqueue_head(&ov511->frame[1].wq);
+ for (i = 0; i < OV511_NUMFRAMES; i++)
+ init_waitqueue_head(&ov511->frame[i].wq);
+
init_waitqueue_head(&ov511->wq);
if (video_register_device(&ov511->vdev, VFL_TYPE_GRABBER) == -1) {
@@ -2790,6 +2884,8 @@ static void* ov511_probe(struct usb_device *dev, unsigned int ifnum)
if (!ov511_configure(ov511)) {
ov511->user = 0;
init_MUTEX(&ov511->lock); /* to 1 == available */
+ init_MUTEX(&ov511->buf_lock);
+ ov511->buf_state = BUF_NOT_ALLOCATED;
} else {
err("Failed to configure camera");
goto error;
@@ -2812,6 +2908,7 @@ error:
static void ov511_disconnect(struct usb_device *dev, void *ptr)
{
struct usb_ov511 *ov511 = (struct usb_ov511 *) ptr;
+ int n;
MOD_INC_USE_COUNT;
@@ -2823,38 +2920,37 @@ static void ov511_disconnect(struct usb_device *dev, void *ptr)
&ov511->dev->actconfig->interface[ov511->iface]);
ov511->dev = NULL;
- ov511->frame[0].grabstate = FRAME_ERROR;
- ov511->frame[1].grabstate = FRAME_ERROR;
+ for (n = 0; n < OV511_NUMFRAMES; n++)
+ ov511->frame[n].grabstate = FRAME_ERROR;
+
ov511->curframe = -1;
/* This will cause the process to request another frame */
- if (waitqueue_active(&ov511->frame[0].wq))
- wake_up_interruptible(&ov511->frame[0].wq);
- if (waitqueue_active(&ov511->frame[1].wq))
- wake_up_interruptible(&ov511->frame[1].wq);
+ for (n = 0; n < OV511_NUMFRAMES; n++)
+ if (waitqueue_active(&ov511->frame[n].wq))
+ wake_up_interruptible(&ov511->frame[n].wq);
if (waitqueue_active(&ov511->wq))
wake_up_interruptible(&ov511->wq);
ov511->streaming = 0;
/* Unschedule all of the iso td's */
- if (ov511->sbuf[1].urb) {
- ov511->sbuf[1].urb->next = NULL;
- usb_unlink_urb(ov511->sbuf[1].urb);
- usb_free_urb(ov511->sbuf[1].urb);
- ov511->sbuf[1].urb = NULL;
- }
- if (ov511->sbuf[0].urb) {
- ov511->sbuf[0].urb->next = NULL;
- usb_unlink_urb(ov511->sbuf[0].urb);
- usb_free_urb(ov511->sbuf[0].urb);
- ov511->sbuf[0].urb = NULL;
+ for (n = OV511_NUMSBUF - 1; n >= 0; n--) {
+ if (ov511->sbuf[n].urb) {
+ ov511->sbuf[n].urb->next = NULL;
+ usb_unlink_urb(ov511->sbuf[n].urb);
+ usb_free_urb(ov511->sbuf[n].urb);
+ ov511->sbuf[n].urb = NULL;
+ }
}
#if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS)
destroy_proc_ov511_cam(ov511);
#endif
+ /* FIXME - is this correct/safe? Should we acquire ov511->lock? */
+ ov511_dealloc(ov511, 1);
+
/* Free the memory */
if (ov511 && !ov511->user) {
kfree(ov511);
@@ -2895,7 +2991,7 @@ static int __init usb_ov511_init(void)
static void __exit usb_ov511_exit(void)
{
usb_deregister(&ov511_driver);
- info("ov511 driver deregistered");
+ info("driver deregistered");
#if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS)
proc_ov511_destroy();
diff --git a/drivers/usb/ov511.h b/drivers/usb/ov511.h
index 92827afb3..f4499b2be 100644
--- a/drivers/usb/ov511.h
+++ b/drivers/usb/ov511.h
@@ -171,9 +171,7 @@ if (debug >= level) info("[" __PRETTY_FUNCTION__ ":%d] " fmt, __LINE__ , ## args
#define OV7610_REG_COM_K 0x38 /* misc registers */
-#define STREAM_BUF_SIZE (PAGE_SIZE * 4)
-
-#define SCRATCH_BUF_SIZE 384
+#define SCRATCH_BUF_SIZE 512
#define FRAMES_PER_DESC 10 /* FIXME - What should this be? */
#define FRAME_SIZE_PER_DESC 993 /* FIXME - Deprecated */
@@ -213,6 +211,13 @@ enum {
STATE_LINES, /* Parsing lines */
};
+/* Buffer states */
+enum {
+ BUF_NOT_ALLOCATED,
+ BUF_ALLOCATED,
+ BUF_PEND_DEALLOC, /* ov511->buf_timer is set */
+};
+
struct usb_device;
struct ov511_sbuf {
@@ -324,6 +329,11 @@ struct usb_ov511 {
/* proc interface */
struct semaphore param_lock; /* params lock for this camera */
struct proc_dir_entry *proc_entry; /* /proc/ov511/videoX */
+
+ /* Framebuffer/sbuf management */
+ int buf_state;
+ struct semaphore buf_lock;
+ struct timer_list buf_timer;
};
struct cam_list {
diff --git a/fs/buffer.c b/fs/buffer.c
index b1e1c33b7..ba02c8be1 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1759,9 +1759,6 @@ static int do_kio(int rw, int nr, struct buffer_head *bh[], int size)
int i;
struct buffer_head *tmp;
- struct task_struct *tsk = current;
- DECLARE_WAITQUEUE(wait, tsk);
-
if (rw == WRITE)
rw = WRITERAW;
ll_rw_block(rw, nr, bh);
diff --git a/fs/partitions/Makefile b/fs/partitions/Makefile
index 4b41d2a75..224af1eba 100644
--- a/fs/partitions/Makefile
+++ b/fs/partitions/Makefile
@@ -8,47 +8,24 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := partitions.o
-O_OBJS := check.o
-
-ifeq ($(CONFIG_ACORN_PARTITION),y)
-O_OBJS += acorn.o
-endif
-
-ifeq ($(CONFIG_AMIGA_PARTITION),y)
-O_OBJS += amiga.o
-endif
-
-ifeq ($(CONFIG_ATARI_PARTITION),y)
-O_OBJS += atari.o
-endif
-
+OX_OBJS := check.o
+
+obj-$(CONFIG_ACORN_PARTITION) += acorn.o
+obj-$(CONFIG_AMIGA_PARTITION) += amiga.o
+obj-$(CONFIG_ATARI_PARTITION) += atari.o
+obj-$(CONFIG_MAC_PARTITION) += mac.o
+obj-$(CONFIG_MSDOS_PARTITION) += msdos.o
+obj-$(CONFIG_OSF_PARTITION) += osf.o
+obj-$(CONFIG_SGI_PARTITION) += sgi.o
+obj-$(CONFIG_SUN_PARTITION) += sun.o
+obj-$(CONFIG_ULTRIX_PARTITION) += ultrix.o
+
+O_OBJS += $(obj-y)
+M_OBJS += $(obj-m)
ifeq ($(CONFIG_IBM_PARTITION),y)
O_OBJS += ibm.o
endif
-ifeq ($(CONFIG_MAC_PARTITION),y)
-O_OBJS += mac.o
-endif
-
-ifeq ($(CONFIG_MSDOS_PARTITION),y)
-O_OBJS += msdos.o
-endif
-
-ifeq ($(CONFIG_OSF_PARTITION),y)
-O_OBJS += osf.o
-endif
-
-ifeq ($(CONFIG_SGI_PARTITION),y)
-O_OBJS += sgi.o
-endif
-
-ifeq ($(CONFIG_SUN_PARTITION),y)
-O_OBJS += sun.o
-endif
-
-ifeq ($(CONFIG_ULTRIX_PARTITION),y)
-O_OBJS += ultrix.o
-endif
-
include $(TOPDIR)/Rules.make
+
diff --git a/fs/select.c b/fs/select.c
index 86c2793d7..a9fd61953 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -37,51 +37,12 @@
* poll table.
*/
-/*
- * I rewrote this again to make the poll_table size variable, take some
- * more shortcuts, improve responsiveness, and remove another race that
- * Linus noticed. -- jrs
- */
-
-static poll_table* alloc_wait(int nfds)
+static void free_wait(struct poll_table_page * p)
{
- poll_table* out;
- poll_table* walk;
-
- out = (poll_table *) __get_free_page(GFP_KERNEL);
- if(out==NULL)
- return NULL;
- out->nr = 0;
- out->entry = (struct poll_table_entry *)(out + 1);
- out->next = NULL;
- nfds -=__MAX_POLL_TABLE_ENTRIES;
- walk = out;
- while(nfds > 0) {
- poll_table *tmp = (poll_table *) __get_free_page(GFP_KERNEL);
- if (!tmp) {
- while(out != NULL) {
- tmp = out->next;
- free_page((unsigned long)out);
- out = tmp;
- }
- return NULL;
- }
- tmp->nr = 0;
- tmp->entry = (struct poll_table_entry *)(tmp + 1);
- tmp->next = NULL;
- walk->next = tmp;
- walk = tmp;
- nfds -=__MAX_POLL_TABLE_ENTRIES;
- }
- return out;
-}
-
-static void free_wait(poll_table * p)
-{
- struct poll_table_entry * entry;
- poll_table *old;
-
while (p) {
+ struct poll_table_entry * entry;
+ struct poll_table_page *old;
+
entry = p->entry + p->nr;
while (p->nr > 0) {
p->nr--;
@@ -97,19 +58,33 @@ static void free_wait(poll_table * p)
void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)
{
- for (;;) {
- if (p->nr < __MAX_POLL_TABLE_ENTRIES) {
- struct poll_table_entry * entry;
- entry = p->entry + p->nr;
- get_file(filp);
- entry->filp = filp;
- entry->wait_address = wait_address;
- init_waitqueue_entry(&entry->wait, current);
- add_wait_queue(wait_address,&entry->wait);
- p->nr++;
+ struct poll_table_page *table = p->table;
+
+ if (!table || table->nr >= __MAX_POLL_TABLE_ENTRIES) {
+ struct poll_table_page *new_table;
+
+ new_table = (struct poll_table_page *) __get_free_page(GFP_KERNEL);
+ if (!new_table) {
+ p->error = -ENOMEM;
return;
}
- p = p->next;
+ new_table->nr = 0;
+ new_table->entry = (struct poll_table_entry *)(new_table + 1);
+ new_table->next = table;
+ p->table = new_table;
+ table = new_table;
+ }
+
+ /* Add a new entry */
+ {
+ struct poll_table_entry * entry;
+ entry = table->entry + table->nr;
+ table->nr++;
+ get_file(filp);
+ entry->filp = filp;
+ entry->wait_address = wait_address;
+ init_waitqueue_entry(&entry->wait, current);
+ add_wait_queue(wait_address,&entry->wait);
}
}
@@ -173,12 +148,10 @@ get_max:
int do_select(int n, fd_set_bits *fds, long *timeout)
{
- poll_table *wait, *orig_wait;
+ poll_table table, *wait;
int retval, i, off;
long __timeout = *timeout;
- orig_wait = wait = NULL;
-
read_lock(&current->files->file_lock);
retval = max_select_fd(n, fds);
read_unlock(&current->files->file_lock);
@@ -186,11 +159,10 @@ int do_select(int n, fd_set_bits *fds, long *timeout)
if (retval < 0)
return retval;
n = retval;
- if (__timeout) {
- orig_wait = wait = alloc_wait(n);
- if (!wait)
- return -ENOMEM;
- }
+
+ table.error = 0;
+ table.table = NULL;
+ wait = &table;
retval = 0;
for (;;) {
set_current_state(TASK_INTERRUPTIBLE);
@@ -233,7 +205,7 @@ int do_select(int n, fd_set_bits *fds, long *timeout)
}
current->state = TASK_RUNNING;
- free_wait(orig_wait);
+ free_wait(table.table);
/*
* Up-to-date the caller timeout.
@@ -404,7 +376,7 @@ asmlinkage long sys_poll(struct pollfd * ufds, unsigned int nfds, long timeout)
{
int i, j, fdcount, err;
struct pollfd **fds;
- poll_table *wait = NULL;
+ poll_table table;
int nchunks, nleft;
/* Do a sanity check on nfds ... */
@@ -419,11 +391,8 @@ asmlinkage long sys_poll(struct pollfd * ufds, unsigned int nfds, long timeout)
timeout = MAX_SCHEDULE_TIMEOUT;
}
- if (timeout) {
- wait = alloc_wait(nfds);
- if (!wait)
- return -ENOMEM;
- }
+ table.error = 0;
+ table.table = NULL;
err = -ENOMEM;
fds = NULL;
@@ -460,7 +429,7 @@ asmlinkage long sys_poll(struct pollfd * ufds, unsigned int nfds, long timeout)
goto out_fds1;
}
- fdcount = do_poll(nfds, nchunks, nleft, fds, wait, timeout);
+ fdcount = do_poll(nfds, nchunks, nleft, fds, &table, timeout);
/* OK, now copy the revents fields back to user space. */
for(i=0; i < nchunks; i++)
@@ -483,6 +452,6 @@ out_fds:
if (nfds != 0)
kfree(fds);
out:
- free_wait(wait);
+ free_wait(table.table);
return err;
}
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index cadb5cbf7..cfa011108 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -244,7 +244,7 @@ extern void __handle_bad_pmd_kernel(pmd_t * pmd);
* Permanent address of a page. Obviously must never be
* called on a highmem page.
*/
-#define page_address(page) ({ if (!(page)->virtual) BUG(); (page)->virtual; })
+#define page_address(page) ((page)->virtual)
#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
#define pte_page(x) (mem_map+pte_pagenr(x))
diff --git a/include/asm-sparc/asm_offsets.h b/include/asm-sparc/asm_offsets.h
index 3447973a0..44d4c371e 100644
--- a/include/asm-sparc/asm_offsets.h
+++ b/include/asm-sparc/asm_offsets.h
@@ -18,24 +18,24 @@
#define ASIZ_task_exec_domain 0x00000004
#define AOFF_task_need_resched 0x00000014
#define ASIZ_task_need_resched 0x00000004
-#define AOFF_task_avg_slice 0x00000018
-#define ASIZ_task_avg_slice 0x00000004
-#define AOFF_task_lock_depth 0x0000001c
+#define AOFF_task_lock_depth 0x00000018
#define ASIZ_task_lock_depth 0x00000004
-#define AOFF_task_counter 0x00000020
+#define AOFF_task_counter 0x0000001c
#define ASIZ_task_counter 0x00000004
-#define AOFF_task_priority 0x00000024
+#define AOFF_task_priority 0x00000020
#define ASIZ_task_priority 0x00000004
-#define AOFF_task_policy 0x00000028
+#define AOFF_task_policy 0x00000024
#define ASIZ_task_policy 0x00000004
-#define AOFF_task_mm 0x0000002c
+#define AOFF_task_mm 0x00000028
#define ASIZ_task_mm 0x00000004
-#define AOFF_task_active_mm 0x00000030
+#define AOFF_task_active_mm 0x0000002c
#define ASIZ_task_active_mm 0x00000004
-#define AOFF_task_has_cpu 0x00000034
+#define AOFF_task_has_cpu 0x00000030
#define ASIZ_task_has_cpu 0x00000004
-#define AOFF_task_processor 0x00000038
+#define AOFF_task_processor 0x00000034
#define ASIZ_task_processor 0x00000004
+#define AOFF_task_cpus_allowed 0x00000038
+#define ASIZ_task_cpus_allowed 0x00000004
#define AOFF_task_ptrace 0x0000003c
#define ASIZ_task_ptrace 0x00000004
#define AOFF_task_run_list 0x00000040
@@ -301,24 +301,24 @@
#define ASIZ_task_exec_domain 0x00000004
#define AOFF_task_need_resched 0x00000014
#define ASIZ_task_need_resched 0x00000004
-#define AOFF_task_avg_slice 0x00000018
-#define ASIZ_task_avg_slice 0x00000004
-#define AOFF_task_lock_depth 0x0000001c
+#define AOFF_task_lock_depth 0x00000018
#define ASIZ_task_lock_depth 0x00000004
-#define AOFF_task_counter 0x00000020
+#define AOFF_task_counter 0x0000001c
#define ASIZ_task_counter 0x00000004
-#define AOFF_task_priority 0x00000024
+#define AOFF_task_priority 0x00000020
#define ASIZ_task_priority 0x00000004
-#define AOFF_task_policy 0x00000028
+#define AOFF_task_policy 0x00000024
#define ASIZ_task_policy 0x00000004
-#define AOFF_task_mm 0x0000002c
+#define AOFF_task_mm 0x00000028
#define ASIZ_task_mm 0x00000004
-#define AOFF_task_active_mm 0x00000030
+#define AOFF_task_active_mm 0x0000002c
#define ASIZ_task_active_mm 0x00000004
-#define AOFF_task_has_cpu 0x00000034
+#define AOFF_task_has_cpu 0x00000030
#define ASIZ_task_has_cpu 0x00000004
-#define AOFF_task_processor 0x00000038
+#define AOFF_task_processor 0x00000034
#define ASIZ_task_processor 0x00000004
+#define AOFF_task_cpus_allowed 0x00000038
+#define ASIZ_task_cpus_allowed 0x00000004
#define AOFF_task_ptrace 0x0000003c
#define ASIZ_task_ptrace 0x00000004
#define AOFF_task_run_list 0x00000040
diff --git a/include/asm-sparc/bitops.h b/include/asm-sparc/bitops.h
index eb9710eb1..af8d4a2d4 100644
--- a/include/asm-sparc/bitops.h
+++ b/include/asm-sparc/bitops.h
@@ -1,4 +1,4 @@
-/* $Id: bitops.h,v 1.57 2000/06/30 10:18:39 davem Exp $
+/* $Id: bitops.h,v 1.58 2000/07/07 07:29:30 anton Exp $
* bitops.h: Bit string operations on the Sparc.
*
* Copyright 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -19,8 +19,6 @@
* themself.
*/
-#define __SMPVOL
-
extern __inline__ unsigned long set_bit(unsigned long nr, void *addr)
{
int mask;
@@ -83,19 +81,13 @@ extern __inline__ void change_bit(unsigned long nr, void *addr)
#include <asm/system.h>
-#ifdef CONFIG_SMP
-#define __SMPVOL volatile
-#else
-#define __SMPVOL
-#endif
-
/* Set bit 'nr' in 32-bit quantity at address 'addr' where bit '0'
* is in the highest of the four bytes and bit '31' is the high bit
* within the first byte. Sparc is BIG-Endian. Unless noted otherwise
* all bit-ops return 0 if bit was previously clear and != 0 otherwise.
*/
-extern __inline__ int test_and_set_bit(unsigned long nr, __SMPVOL void *addr)
+extern __inline__ int test_and_set_bit(unsigned long nr, volatile void *addr)
{
register unsigned long mask asm("g2");
register unsigned long *ADDR asm("g1");
@@ -112,12 +104,12 @@ extern __inline__ int test_and_set_bit(unsigned long nr, __SMPVOL void *addr)
return mask != 0;
}
-extern __inline__ void set_bit(unsigned long nr, __SMPVOL void *addr)
+extern __inline__ void set_bit(unsigned long nr, volatile void *addr)
{
(void) test_and_set_bit(nr, addr);
}
-extern __inline__ int test_and_clear_bit(unsigned long nr, __SMPVOL void *addr)
+extern __inline__ int test_and_clear_bit(unsigned long nr, volatile void *addr)
{
register unsigned long mask asm("g2");
register unsigned long *ADDR asm("g1");
@@ -135,12 +127,12 @@ extern __inline__ int test_and_clear_bit(unsigned long nr, __SMPVOL void *addr)
return mask != 0;
}
-extern __inline__ void clear_bit(unsigned long nr, __SMPVOL void *addr)
+extern __inline__ void clear_bit(unsigned long nr, volatile void *addr)
{
(void) test_and_clear_bit(nr, addr);
}
-extern __inline__ int test_and_change_bit(unsigned long nr, __SMPVOL void *addr)
+extern __inline__ int test_and_change_bit(unsigned long nr, volatile void *addr)
{
register unsigned long mask asm("g2");
register unsigned long *ADDR asm("g1");
@@ -158,7 +150,7 @@ extern __inline__ int test_and_change_bit(unsigned long nr, __SMPVOL void *addr)
return mask != 0;
}
-extern __inline__ void change_bit(unsigned long nr, __SMPVOL void *addr)
+extern __inline__ void change_bit(unsigned long nr, volatile void *addr)
{
(void) test_and_change_bit(nr, addr);
}
@@ -166,7 +158,7 @@ extern __inline__ void change_bit(unsigned long nr, __SMPVOL void *addr)
#endif /* __KERNEL__ */
/* The following routine need not be atomic. */
-extern __inline__ int test_bit(int nr, __const__ __SMPVOL void *addr)
+extern __inline__ int test_bit(int nr, __const__ void *addr)
{
return (1 & (((__const__ unsigned int *) addr)[nr >> 5] >> (nr & 31))) != 0;
}
@@ -298,7 +290,7 @@ extern __inline__ int clear_le_bit(int nr, void *addr)
/* Now for the ext2 filesystem bit operations and helper routines. */
-extern __inline__ int set_le_bit(int nr,void * addr)
+extern __inline__ int set_le_bit(int nr, volatile void * addr)
{
register int mask asm("g2");
register unsigned char *ADDR asm("g1");
@@ -316,7 +308,7 @@ extern __inline__ int set_le_bit(int nr,void * addr)
return mask;
}
-extern __inline__ int clear_le_bit(int nr, void * addr)
+extern __inline__ int clear_le_bit(int nr, volatile void * addr)
{
register int mask asm("g2");
register unsigned char *ADDR asm("g1");
diff --git a/include/asm-sparc/pgalloc.h b/include/asm-sparc/pgalloc.h
index 71a03dc02..20e9d805e 100644
--- a/include/asm-sparc/pgalloc.h
+++ b/include/asm-sparc/pgalloc.h
@@ -1,4 +1,4 @@
-/* $Id: pgalloc.h,v 1.5 2000/06/04 06:23:53 anton Exp $ */
+/* $Id: pgalloc.h,v 1.6 2000/07/10 20:56:53 anton Exp $ */
#ifndef _SPARC_PGALLOC_H
#define _SPARC_PGALLOC_H
@@ -92,14 +92,10 @@ extern struct pgtable_cache_struct {
unsigned long *pte_cache;
unsigned long pgtable_cache_sz;
unsigned long pgd_cache_sz;
- spinlock_t pgd_spinlock;
- spinlock_t pte_spinlock;
} pgt_quicklists;
#define pgd_quicklist (pgt_quicklists.pgd_cache)
#define pmd_quicklist ((unsigned long *)0)
#define pte_quicklist (pgt_quicklists.pte_cache)
-#define pgd_spinlock (pgt_quicklists.pgd_spinlock)
-#define pte_spinlock (pgt_quicklists.pte_spinlock)
#define pgtable_cache_size (pgt_quicklists.pgtable_cache_sz)
#define pgd_cache_size (pgt_quicklists.pgd_cache_sz)
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h
index a4a1ef3ce..53039cc9c 100644
--- a/include/asm-sparc/pgtable.h
+++ b/include/asm-sparc/pgtable.h
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.96 2000/06/05 06:08:46 anton Exp $ */
+/* $Id: pgtable.h,v 1.97 2000/07/07 07:33:11 anton Exp $ */
#ifndef _SPARC_PGTABLE_H
#define _SPARC_PGTABLE_H
@@ -125,7 +125,14 @@ BTFIXUPDEF_INT(page_kernel)
#define PAGE_SHARED __pgprot(BTFIXUP_INT(page_shared))
#define PAGE_COPY __pgprot(BTFIXUP_INT(page_copy))
#define PAGE_READONLY __pgprot(BTFIXUP_INT(page_readonly))
+
+extern unsigned long page_kernel;
+
+#ifdef MODULE
+#define PAGE_KERNEL page_kernel
+#else
#define PAGE_KERNEL __pgprot(BTFIXUP_INT(page_kernel))
+#endif
/* Top-level page directory */
extern pgd_t swapper_pg_dir[1024];
diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h
index 5f7040345..f6504165d 100644
--- a/include/asm-sparc/smp.h
+++ b/include/asm-sparc/smp.h
@@ -93,6 +93,12 @@ extern __inline__ void xc5(smpfunc_t func, unsigned long arg1, unsigned long arg
unsigned long arg3, unsigned long arg4, unsigned long arg5)
{ smp_cross_call(func, arg1, arg2, arg3, arg4, arg5); }
+extern __inline__ int smp_call_function(void (*func)(void *info), void *info, int nonatomic, int wait)
+{
+ xc1((smpfunc_t)func, (unsigned long)info);
+ return 0;
+}
+
extern __volatile__ int __cpu_number_map[NR_CPUS];
extern __volatile__ int __cpu_logical_map[NR_CPUS];
extern unsigned long smp_proc_in_lock[NR_CPUS];
diff --git a/include/asm-sparc64/asm_offsets.h b/include/asm-sparc64/asm_offsets.h
index 832e22fa3..ca5f0b626 100644
--- a/include/asm-sparc64/asm_offsets.h
+++ b/include/asm-sparc64/asm_offsets.h
@@ -24,24 +24,24 @@
#define ASIZ_task_exec_domain 0x00000008
#define AOFF_task_need_resched 0x00000020
#define ASIZ_task_need_resched 0x00000008
-#define AOFF_task_avg_slice 0x00000028
-#define ASIZ_task_avg_slice 0x00000008
-#define AOFF_task_lock_depth 0x00000030
+#define AOFF_task_lock_depth 0x00000028
#define ASIZ_task_lock_depth 0x00000004
-#define AOFF_task_counter 0x00000038
+#define AOFF_task_counter 0x00000030
#define ASIZ_task_counter 0x00000008
-#define AOFF_task_priority 0x00000040
+#define AOFF_task_priority 0x00000038
#define ASIZ_task_priority 0x00000008
-#define AOFF_task_policy 0x00000048
+#define AOFF_task_policy 0x00000040
#define ASIZ_task_policy 0x00000008
-#define AOFF_task_mm 0x00000050
+#define AOFF_task_mm 0x00000048
#define ASIZ_task_mm 0x00000008
-#define AOFF_task_active_mm 0x00000058
+#define AOFF_task_active_mm 0x00000050
#define ASIZ_task_active_mm 0x00000008
-#define AOFF_task_has_cpu 0x00000060
+#define AOFF_task_has_cpu 0x00000058
#define ASIZ_task_has_cpu 0x00000004
-#define AOFF_task_processor 0x00000064
+#define AOFF_task_processor 0x0000005c
#define ASIZ_task_processor 0x00000004
+#define AOFF_task_cpus_allowed 0x00000060
+#define ASIZ_task_cpus_allowed 0x00000008
#define AOFF_task_ptrace 0x00000068
#define ASIZ_task_ptrace 0x00000008
#define AOFF_task_run_list 0x00000070
@@ -320,24 +320,24 @@
#define ASIZ_task_exec_domain 0x00000008
#define AOFF_task_need_resched 0x00000020
#define ASIZ_task_need_resched 0x00000008
-#define AOFF_task_avg_slice 0x00000028
-#define ASIZ_task_avg_slice 0x00000008
-#define AOFF_task_lock_depth 0x00000030
+#define AOFF_task_lock_depth 0x00000028
#define ASIZ_task_lock_depth 0x00000004
-#define AOFF_task_counter 0x00000038
+#define AOFF_task_counter 0x00000030
#define ASIZ_task_counter 0x00000008
-#define AOFF_task_priority 0x00000040
+#define AOFF_task_priority 0x00000038
#define ASIZ_task_priority 0x00000008
-#define AOFF_task_policy 0x00000048
+#define AOFF_task_policy 0x00000040
#define ASIZ_task_policy 0x00000008
-#define AOFF_task_mm 0x00000050
+#define AOFF_task_mm 0x00000048
#define ASIZ_task_mm 0x00000008
-#define AOFF_task_active_mm 0x00000058
+#define AOFF_task_active_mm 0x00000050
#define ASIZ_task_active_mm 0x00000008
-#define AOFF_task_has_cpu 0x00000060
+#define AOFF_task_has_cpu 0x00000058
#define ASIZ_task_has_cpu 0x00000004
-#define AOFF_task_processor 0x00000064
+#define AOFF_task_processor 0x0000005c
#define ASIZ_task_processor 0x00000004
+#define AOFF_task_cpus_allowed 0x00000060
+#define ASIZ_task_cpus_allowed 0x00000008
#define AOFF_task_ptrace 0x00000068
#define ASIZ_task_ptrace 0x00000008
#define AOFF_task_run_list 0x00000070
@@ -614,24 +614,24 @@
#define ASIZ_task_exec_domain 0x00000008
#define AOFF_task_need_resched 0x00000020
#define ASIZ_task_need_resched 0x00000008
-#define AOFF_task_avg_slice 0x00000028
-#define ASIZ_task_avg_slice 0x00000008
-#define AOFF_task_lock_depth 0x00000030
+#define AOFF_task_lock_depth 0x00000028
#define ASIZ_task_lock_depth 0x00000004
-#define AOFF_task_counter 0x00000038
+#define AOFF_task_counter 0x00000030
#define ASIZ_task_counter 0x00000008
-#define AOFF_task_priority 0x00000040
+#define AOFF_task_priority 0x00000038
#define ASIZ_task_priority 0x00000008
-#define AOFF_task_policy 0x00000048
+#define AOFF_task_policy 0x00000040
#define ASIZ_task_policy 0x00000008
-#define AOFF_task_mm 0x00000050
+#define AOFF_task_mm 0x00000048
#define ASIZ_task_mm 0x00000008
-#define AOFF_task_active_mm 0x00000058
+#define AOFF_task_active_mm 0x00000050
#define ASIZ_task_active_mm 0x00000008
-#define AOFF_task_has_cpu 0x00000060
+#define AOFF_task_has_cpu 0x00000058
#define ASIZ_task_has_cpu 0x00000004
-#define AOFF_task_processor 0x00000064
+#define AOFF_task_processor 0x0000005c
#define ASIZ_task_processor 0x00000004
+#define AOFF_task_cpus_allowed 0x00000060
+#define ASIZ_task_cpus_allowed 0x00000008
#define AOFF_task_ptrace 0x00000068
#define ASIZ_task_ptrace 0x00000008
#define AOFF_task_run_list 0x00000070
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h
index d2334ba95..63edac9d6 100644
--- a/include/linux/arcdevice.h
+++ b/include/linux/arcdevice.h
@@ -95,7 +95,7 @@ extern int arcnet_debug;
/* see how long a function call takes to run, expressed in CPU cycles */
#define TIME(name, bytes, call) BUGLVL(D_TIMING) { \
- cycles_t _x, _y; \
+ unsigned long _x, _y; \
_x = get_cycles(); \
call; \
_y = get_cycles(); \
diff --git a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h
index a882aaea5..10f3f71ee 100644
--- a/include/linux/hdlcdrv.h
+++ b/include/linux/hdlcdrv.h
@@ -240,11 +240,7 @@ struct hdlcdrv_state {
struct hdlcdrv_bitbuffer bitbuf_hdlc;
#endif /* HDLCDRV_DEBUG */
-#if LINUX_VERSION_CODE < 0x20119
- struct enet_statistics stats;
-#else
struct net_device_stats stats;
-#endif
int ptt_keyed;
/* queued skb for transmission */
diff --git a/include/linux/if_eql.h b/include/linux/if_eql.h
index 03c80ef58..8cc5867e2 100644
--- a/include/linux/if_eql.h
+++ b/include/linux/if_eql.h
@@ -56,7 +56,7 @@ typedef struct equalizer {
slave_queue_t *queue;
int min_slaves;
int max_slaves;
- struct enet_statistics *stats;
+ struct net_device_stats *stats;
struct timer_list timer;
char timer_on;
} equalizer_t;
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 67ded69e1..61e5f5c6b 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -90,12 +90,4 @@ struct ethhdr
unsigned short h_proto; /* packet type ID field */
};
-/*
- * We Have changed the ethernet statistics collection data. This
- * is just for partial compatibility for now.
- */
-
-
-#define enet_statistics net_device_stats
-
#endif /* _LINUX_IF_ETHER_H */
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h
index 7a2fe04e3..3765c740f 100644
--- a/include/linux/if_frad.h
+++ b/include/linux/if_frad.h
@@ -154,7 +154,7 @@ struct frhdr
struct dlci_local
{
- struct enet_statistics stats;
+ struct net_device_stats stats;
struct net_device *slave;
struct dlci_conf config;
int configured;
@@ -165,7 +165,7 @@ struct dlci_local
struct frad_local
{
- struct enet_statistics stats;
+ struct net_device_stats stats;
/* devices which this FRAD is slaved to */
struct net_device *master[CONFIG_DLCI_MAX];
diff --git a/include/linux/if_pppvar.h b/include/linux/if_pppvar.h
index 7603d29cd..e79239fd3 100644
--- a/include/linux/if_pppvar.h
+++ b/include/linux/if_pppvar.h
@@ -128,7 +128,7 @@ struct ppp {
int sc_xfer; /* PID of reserved PPP table */
char name[16]; /* space for unit name */
struct net_device dev; /* net device structure */
- struct enet_statistics estats; /* more detailed stats */
+ struct net_device_stats estats; /* more detailed stats */
/* tty output buffer */
unsigned char obuf[OBUFSIZE]; /* buffer for characters to send */
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index c916a8fa0..909ce0683 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -681,7 +681,7 @@ typedef struct {
typedef struct isdn_net_local_s {
ulong magic;
char name[10]; /* Name of device */
- struct enet_statistics stats; /* Ethernet Statistics */
+ struct net_device_stats stats; /* Ethernet Statistics */
int isdn_device; /* Index to isdn-device */
int isdn_channel; /* Index to isdn-channel */
int ppp_slot; /* PPPD device slot number */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index e6325a298..f418100a9 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -316,9 +316,6 @@ extern struct page * alloc_pages_node(int nid, int gfp_mask, unsigned long order
#ifndef CONFIG_DISCONTIGMEM
static inline struct page * alloc_pages(int gfp_mask, unsigned long order)
{
- /* temporary check. */
- if (contig_page_data.node_zonelists[gfp_mask].gfp_mask != (gfp_mask))
- BUG();
/*
* Gets optimized away by the compiler.
*/
diff --git a/include/linux/poll.h b/include/linux/poll.h
index b56cdcf4c..bc0fcde22 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -17,13 +17,18 @@ struct poll_table_entry {
wait_queue_head_t * wait_address;
};
-typedef struct poll_table_struct {
- struct poll_table_struct * next;
+struct poll_table_page {
+ struct poll_table_page * next;
unsigned int nr;
struct poll_table_entry * entry;
+};
+
+typedef struct poll_table_struct {
+ int error;
+ struct poll_table_page * table;
} poll_table;
-#define __MAX_POLL_TABLE_ENTRIES ((PAGE_SIZE - sizeof (poll_table)) / sizeof (struct poll_table_entry))
+#define __MAX_POLL_TABLE_ENTRIES ((PAGE_SIZE - sizeof (struct poll_table_page)) / sizeof (struct poll_table_entry))
extern void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p);
diff --git a/include/linux/types.h b/include/linux/types.h
index 196c5f4e0..df4808fcd 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -1,7 +1,10 @@
#ifndef _LINUX_TYPES_H
#define _LINUX_TYPES_H
+#ifdef __KERNEL__
#include <linux/config.h>
+#endif
+
#include <linux/posix_types.h>
#include <asm/types.h>
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 6ac1f0e88..222923aca 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -21,7 +21,7 @@
* Temporary debugging help until all code is converted to the new
* waitqueue usage.
*/
-#define WAITQUEUE_DEBUG 1
+#define WAITQUEUE_DEBUG 0
#if WAITQUEUE_DEBUG
extern int printk(const char *fmt, ...);
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index 7efa6a9c1..736493d1d 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -440,11 +440,7 @@ typedef struct wan_device
/****** status and statistics *******/
char state; /* device state */
char api_status; /* device api status */
-#ifdef LINUX_2_1
struct net_device_stats stats; /* interface statistics */
-#else
- struct enet_statistics stats; /* interface statistics */
-#endif
unsigned reserved[16]; /* reserved for future use */
unsigned critical; /* critical section flag */
/****** device management methods ***/
diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h
index af897c754..9ed6a9c36 100644
--- a/include/net/irda/irlan_common.h
+++ b/include/net/irda/irlan_common.h
@@ -165,7 +165,7 @@ struct irlan_cb {
int magic;
struct net_device dev; /* Ethernet device structure*/
- struct enet_statistics stats;
+ struct net_device_stats stats;
__u32 saddr; /* Source device address */
__u32 daddr; /* Destination device address */
diff --git a/include/net/irda/irlan_eth.h b/include/net/irda/irlan_eth.h
index 8f0ca03ac..53c6ae82b 100644
--- a/include/net/irda/irlan_eth.h
+++ b/include/net/irda/irlan_eth.h
@@ -35,6 +35,6 @@ void irlan_eth_flow_indication( void *instance, void *sap, LOCAL_FLOW flow);
void irlan_eth_send_gratuitous_arp(struct net_device *dev);
void irlan_eth_set_multicast_list( struct net_device *dev);
-struct enet_statistics *irlan_eth_get_stats(struct net_device *dev);
+struct net_device_stats *irlan_eth_get_stats(struct net_device *dev);
#endif
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 18a60fdbd..2567aa2df 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -227,6 +227,23 @@ struct page * __alloc_pages(zonelist_t *zonelist, unsigned long order)
* We are falling back to lower-level zones if allocation
* in a higher zone fails.
*/
+
+ for (;;) {
+ zone_t *z = *(zone++);
+ if (!z)
+ break;
+ if (!z->size)
+ BUG();
+
+ /* If there are zones with a lot of free memory allocate from them */
+ if (z->free_pages > z->pages_high) {
+ struct page *page = rmqueue(z, order);
+ if (page)
+ return page;
+ }
+ }
+
+ zone = zonelist->zones;
for (;;) {
zone_t *z = *(zone++);
if (!z)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index be600ec49..f19721ee5 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -440,7 +440,7 @@ static inline int memory_pressure(void)
}
/*
- * Check if there is any memory pressure (free_pages < pages_low)
+ * Check if there recently has been memory pressure (zone_wake_kswapd)
*/
static inline int keep_kswapd_awake(void)
{
@@ -541,16 +541,16 @@ static int do_try_to_free_pages(unsigned int gfp_mask)
if (--swap_count < 0)
break;
- priority--;
- } while (priority >= 0);
+ } while (--priority >= 0);
- /* Always end on a shrink_mmap.. */
+ /* Always end on a shrink_mmap.., may sleep... */
while (shrink_mmap(0, gfp_mask)) {
if (!--count)
goto done;
}
- /* We return 1 if we are freed some page */
- return (count != FREE_COUNT);
+ /* We return 1 if we are freed some page, or
+ * there are no memory pressure remaining */
+ return (count != FREE_COUNT || !memory_pressure());
done:
return 1;
@@ -626,6 +626,7 @@ int try_to_free_pages(unsigned int gfp_mask)
int retval = 1;
if (gfp_mask & __GFP_WAIT) {
+ current->state = TASK_RUNNING;
current->flags |= PF_MEMALLOC;
retval = do_try_to_free_pages(gfp_mask);
current->flags &= ~PF_MEMALLOC;
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index abdcdc713..190551d79 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -23,6 +23,7 @@
* Horst von Brand Add missing #include <linux/string.h>
* Alexey Kuznetsov SMP races, threading, cleanup.
*/
+#include <linux/config.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/string.h>
diff --git a/net/irda/irlan/irlan_eth.c b/net/irda/irlan/irlan_eth.c
index c0d9878f1..1b46ab5b8 100644
--- a/net/irda/irlan/irlan_eth.c
+++ b/net/irda/irlan/irlan_eth.c
@@ -409,7 +409,7 @@ void irlan_eth_set_multicast_list(struct net_device *dev)
* Get the current statistics for this device
*
*/
-struct enet_statistics *irlan_eth_get_stats(struct net_device *dev)
+struct net_device_stats *irlan_eth_get_stats(struct net_device *dev)
{
struct irlan_cb *self = (struct irlan_cb *) dev->priv;