aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-04-27 04:53:34 -0400
committerJeff Garzik <jeff@garzik.org>2006-04-27 04:53:34 -0400
commitacc696d93dcf993dec123d69d599979e1456ffec (patch)
treeb860b80bb96bb5e3ea1f0347b92fbb1e8b15af36
parentbf2af2a2027e52b653882fbca840620e896ae081 (diff)
parent2be4d50295e2b6f62c07b614e1b103e280dddb84 (diff)
Merge branch 'master' into upstream
-rw-r--r--Documentation/filesystems/sysfs.txt5
-rw-r--r--MAINTAINERS12
-rw-r--r--Makefile2
-rw-r--r--arch/alpha/lib/strncpy.S8
-rw-r--r--arch/arm/Makefile2
-rw-r--r--arch/arm/configs/ep93xx_defconfig79
-rw-r--r--arch/arm/configs/ixp2000_defconfig59
-rw-r--r--arch/arm/configs/ixp23xx_defconfig58
-rw-r--r--arch/arm/kernel/Makefile2
-rw-r--r--arch/arm/kernel/head-nommu.S4
-rw-r--r--arch/arm/kernel/setup.c8
-rw-r--r--arch/arm/mach-ixp4xx/common.c2
-rw-r--r--arch/arm/vfp/vfpdouble.c2
-rw-r--r--arch/arm/vfp/vfpmodule.c2
-rw-r--r--arch/arm/vfp/vfpsingle.c2
-rw-r--r--arch/i386/kernel/cpu/intel_cacheinfo.c2
-rw-r--r--arch/ia64/kernel/entry.S1
-rw-r--r--arch/ia64/kernel/palinfo.c2
-rw-r--r--arch/ia64/kernel/salinfo.c2
-rw-r--r--arch/ia64/kernel/topology.c2
-rw-r--r--arch/mips/kernel/linux32.c64
-rw-r--r--arch/parisc/Kconfig31
-rw-r--r--arch/parisc/defconfig494
-rw-r--r--arch/parisc/kernel/asm-offsets.c3
-rw-r--r--arch/parisc/kernel/cache.c4
-rw-r--r--arch/parisc/kernel/entry.S36
-rw-r--r--arch/parisc/kernel/head.S15
-rw-r--r--arch/parisc/kernel/init_task.c10
-rw-r--r--arch/parisc/kernel/pacache.S25
-rw-r--r--arch/parisc/kernel/sys_parisc.c8
-rw-r--r--arch/parisc/kernel/syscall.S10
-rw-r--r--arch/parisc/kernel/syscall_table.S8
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S54
-rw-r--r--arch/parisc/mm/fault.c2
-rw-r--r--arch/parisc/mm/init.c28
-rw-r--r--arch/parisc/mm/ioremap.c3
-rw-r--r--arch/powerpc/configs/g5_defconfig58
-rw-r--r--arch/powerpc/configs/iseries_defconfig43
-rw-r--r--arch/powerpc/configs/pseries_defconfig54
-rw-r--r--arch/powerpc/kernel/iommu.c36
-rw-r--r--arch/powerpc/kernel/pci_iommu.c40
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c1
-rw-r--r--arch/powerpc/kernel/prom.c2
-rw-r--r--arch/powerpc/kernel/sysfs.c4
-rw-r--r--arch/powerpc/kernel/systbl.S6
-rw-r--r--arch/powerpc/kernel/vio.c6
-rw-r--r--arch/powerpc/platforms/cell/spu_callbacks.c6
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c78
-rw-r--r--arch/powerpc/sysdev/dart_iommu.c12
-rw-r--r--arch/ppc/kernel/asm-offsets.c1
-rw-r--r--arch/ppc/kernel/entry.S33
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c1
-rw-r--r--arch/s390/appldata/appldata_base.c2
-rw-r--r--arch/x86_64/ia32/Makefile4
-rw-r--r--arch/x86_64/kernel/mce.c2
-rw-r--r--arch/x86_64/kernel/mce_amd.c2
-rw-r--r--arch/x86_64/kernel/pci-gart.c4
-rw-r--r--arch/x86_64/mm/numa.c2
-rw-r--r--block/ll_rw_blk.c2
-rw-r--r--drivers/base/topology.c2
-rw-r--r--drivers/char/drm/drmP.h1
-rw-r--r--drivers/char/drm/drm_agpsupport.c2
-rw-r--r--drivers/char/drm/drm_bufs.c5
-rw-r--r--drivers/char/drm/drm_stub.c2
-rw-r--r--drivers/char/drm/r300_cmdbuf.c2
-rw-r--r--drivers/char/mem.c14
-rw-r--r--drivers/char/snsc.c3
-rw-r--r--drivers/char/tpm/Kconfig11
-rw-r--r--drivers/char/tpm/Makefile1
-rw-r--r--drivers/char/tpm/tpm.c786
-rw-r--r--drivers/char/tpm/tpm.h37
-rw-r--r--drivers/char/tpm/tpm_atmel.c58
-rw-r--r--drivers/char/tpm/tpm_atmel.h25
-rw-r--r--drivers/char/tpm/tpm_bios.c52
-rw-r--r--drivers/char/tpm/tpm_infineon.c61
-rw-r--r--drivers/char/tpm/tpm_nsc.c49
-rw-r--r--drivers/char/tpm/tpm_tis.c669
-rw-r--r--drivers/cpufreq/cpufreq.c2
-rw-r--r--drivers/input/keyboard/hil_kbd.c2
-rw-r--r--drivers/isdn/gigaset/bas-gigaset.c597
-rw-r--r--drivers/isdn/gigaset/common.c3
-rw-r--r--drivers/isdn/gigaset/ev-layer.c3
-rw-r--r--drivers/isdn/gigaset/gigaset.h7
-rw-r--r--drivers/isdn/gigaset/i4l.c2
-rw-r--r--drivers/isdn/gigaset/isocdata.c10
-rw-r--r--drivers/macintosh/therm_adt746x.c4
-rw-r--r--drivers/mmc/pxamci.c10
-rw-r--r--drivers/net/e1000/e1000_main.c1
-rw-r--r--drivers/net/forcedeth.c79
-rw-r--r--drivers/net/gianfar.c56
-rw-r--r--drivers/net/gianfar.h67
-rw-r--r--drivers/net/gianfar_ethtool.c20
-rw-r--r--drivers/net/gianfar_sysfs.c24
-rw-r--r--drivers/net/ne.c2
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c1
-rw-r--r--drivers/net/sky2.c52
-rw-r--r--drivers/net/sky2.h2
-rw-r--r--drivers/net/sungem_phy.c11
-rw-r--r--drivers/net/wireless/Kconfig2
-rw-r--r--drivers/net/wireless/airo.c46
-rw-r--r--drivers/net/wireless/atmel.c11
-rw-r--r--drivers/net/wireless/bcm43xx/Kconfig3
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx.h17
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c8
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_dma.c13
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_dma.h8
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_main.c2
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_phy.c1
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_pio.c92
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_pio.h16
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_power.c115
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_power.h9
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c115
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_sysfs.h16
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_wx.c8
-rw-r--r--drivers/net/wireless/hostap/hostap_ioctl.c4
-rw-r--r--drivers/net/wireless/orinoco.c2
-rw-r--r--drivers/parisc/pdc_stable.c2
-rw-r--r--drivers/parisc/sba_iommu.c45
-rw-r--r--drivers/parisc/superio.c4
-rw-r--r--drivers/pcmcia/Kconfig2
-rw-r--r--drivers/pcmcia/ds.c16
-rw-r--r--drivers/pcmcia/pcmcia_resource.c18
-rw-r--r--drivers/usb/gadget/inode.c1
-rw-r--r--fs/cifs/CHANGES6
-rw-r--r--fs/cifs/README8
-rw-r--r--fs/cifs/cifsfs.c99
-rw-r--r--fs/cifs/cifssmb.c2
-rw-r--r--fs/cifs/connect.c6
-rw-r--r--fs/cifs/dir.c18
-rw-r--r--fs/cifs/fcntl.c2
-rw-r--r--fs/cifs/file.c34
-rw-r--r--fs/cifs/inode.c6
-rw-r--r--fs/cifs/link.c6
-rw-r--r--fs/cifs/ntlmssp.c14
-rw-r--r--fs/cifs/readdir.c45
-rw-r--r--fs/cifs/xattr.c8
-rw-r--r--fs/compat.c4
-rw-r--r--fs/ext3/ioctl.c18
-rw-r--r--fs/ext3/resize.c2
-rw-r--r--fs/fuse/dev.c35
-rw-r--r--fs/fuse/fuse_i.h12
-rw-r--r--fs/fuse/inode.c40
-rw-r--r--fs/reiserfs/xattr_acl.c5
-rw-r--r--fs/splice.c355
-rw-r--r--include/asm-i386/unistd.h3
-rw-r--r--include/asm-ia64/unistd.h3
-rw-r--r--include/asm-parisc/io.h17
-rw-r--r--include/asm-parisc/page.h25
-rw-r--r--include/asm-parisc/pgtable.h63
-rw-r--r--include/asm-parisc/unistd.h8
-rw-r--r--include/asm-powerpc/iommu.h7
-rw-r--r--include/asm-powerpc/machdep.h6
-rw-r--r--include/asm-powerpc/unistd.h3
-rw-r--r--include/asm-sparc/unistd.h2
-rw-r--r--include/asm-sparc64/unistd.h2
-rw-r--r--include/asm-x86_64/unistd.h4
-rw-r--r--include/linux/netdevice.h18
-rw-r--r--include/linux/netfilter/x_tables.h4
-rw-r--r--include/linux/pipe_fs_i.h17
-rw-r--r--include/linux/skbuff.h7
-rw-r--r--include/linux/syscalls.h3
-rw-r--r--include/net/ieee80211softmac.h8
-rw-r--r--include/net/sock.h1
-rw-r--r--kernel/hrtimer.c4
-rw-r--r--kernel/profile.c2
-rw-r--r--kernel/rcupdate.c4
-rw-r--r--kernel/sched.c2
-rw-r--r--kernel/softirq.c4
-rw-r--r--kernel/softlockup.c4
-rw-r--r--kernel/timer.c4
-rw-r--r--kernel/workqueue.c2
-rw-r--r--mm/page_alloc.c2
-rw-r--r--mm/shmem.c3
-rw-r--r--mm/slab.c2
-rw-r--r--mm/vmscan.c2
-rw-r--r--net/bridge/br_forward.c8
-rw-r--r--net/bridge/netfilter/ebtables.c20
-rw-r--r--net/core/dev.c3
-rw-r--r--net/core/skbuff.c8
-rw-r--r--net/core/stream.c1
-rw-r--r--net/core/wireless.c8
-rw-r--r--net/ieee80211/softmac/Kconfig1
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_assoc.c25
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_event.c40
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_io.c18
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_module.c2
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_scan.c2
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_wx.c37
-rw-r--r--net/ipv4/netfilter/Kconfig2
-rw-r--r--net/ipv4/tcp_output.c10
-rw-r--r--net/ipv6/netfilter/ip6_tables.c13
-rw-r--r--net/llc/llc_input.c3
-rw-r--r--net/netfilter/nf_conntrack_core.c15
-rw-r--r--net/netfilter/nf_conntrack_l3proto_generic.c1
-rw-r--r--net/netfilter/x_tables.c2
-rw-r--r--net/sched/act_ipt.c5
-rw-r--r--net/socket.c1
-rw-r--r--sound/oss/ad1889.c198
-rw-r--r--sound/oss/ad1889.h101
-rw-r--r--sound/oss/dmasound/tas_common.c4
-rw-r--r--sound/ppc/daca.c2
-rw-r--r--sound/ppc/tumbler.c2
203 files changed, 4294 insertions, 1960 deletions
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index c8bce82ddcac..89b1d196ca80 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -246,6 +246,7 @@ class/
246devices/ 246devices/
247firmware/ 247firmware/
248net/ 248net/
249fs/
249 250
250devices/ contains a filesystem representation of the device tree. It maps 251devices/ contains a filesystem representation of the device tree. It maps
251directly to the internal kernel device tree, which is a hierarchy of 252directly to the internal kernel device tree, which is a hierarchy of
@@ -264,6 +265,10 @@ drivers/ contains a directory for each device driver that is loaded
264for devices on that particular bus (this assumes that drivers do not 265for devices on that particular bus (this assumes that drivers do not
265span multiple bus types). 266span multiple bus types).
266 267
268fs/ contains a directory for some filesystems. Currently each
269filesystem wanting to export attributes must create its own hierarchy
270below fs/ (see ./fuse.txt for an example).
271
267 272
268More information can driver-model specific features can be found in 273More information can driver-model specific features can be found in
269Documentation/driver-model/. 274Documentation/driver-model/.
diff --git a/MAINTAINERS b/MAINTAINERS
index 61060e82fb0e..d6a8e5b434ec 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -421,6 +421,14 @@ L: linux-hams@vger.kernel.org
421W: http://www.baycom.org/~tom/ham/ham.html 421W: http://www.baycom.org/~tom/ham/ham.html
422S: Maintained 422S: Maintained
423 423
424BCM43XX WIRELESS DRIVER
425P: Michael Buesch
426M: mb@bu3sch.de
427P: Stefano Brivio
428M: st3@riseup.net
429W: http://bcm43xx.berlios.de/
430S: Maintained
431
424BEFS FILE SYSTEM 432BEFS FILE SYSTEM
425P: Sergey S. Kostyliov 433P: Sergey S. Kostyliov
426M: rathamahata@php4.ru 434M: rathamahata@php4.ru
@@ -2065,8 +2073,12 @@ P: Matthew Wilcox
2065M: matthew@wil.cx 2073M: matthew@wil.cx
2066P: Grant Grundler 2074P: Grant Grundler
2067M: grundler@parisc-linux.org 2075M: grundler@parisc-linux.org
2076P: Kyle McMartin
2077M: kyle@parisc-linux.org
2068L: parisc-linux@parisc-linux.org 2078L: parisc-linux@parisc-linux.org
2069W: http://www.parisc-linux.org/ 2079W: http://www.parisc-linux.org/
2080T: git kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6.git
2081T: cvs cvs.parisc-linux.org:/var/cvs/linux-2.6
2070S: Maintained 2082S: Maintained
2071 2083
2072PCI ERROR RECOVERY 2084PCI ERROR RECOVERY
diff --git a/Makefile b/Makefile
index a940eaefe1c4..6bf99624bd4c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 17 3SUBLEVEL = 17
4EXTRAVERSION =-rc2 4EXTRAVERSION =-rc3
5NAME=Sliding Snow Leopard 5NAME=Sliding Snow Leopard
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
diff --git a/arch/alpha/lib/strncpy.S b/arch/alpha/lib/strncpy.S
index 338551c7113c..bbdef1be5f95 100644
--- a/arch/alpha/lib/strncpy.S
+++ b/arch/alpha/lib/strncpy.S
@@ -43,8 +43,8 @@ strncpy:
43 43
44 .align 4 44 .align 4
45$multiword: 45$multiword:
46 subq $24, 1, $2 # clear the final bits in the prev word 46 subq $27, 1, $2 # clear the final bits in the prev word
47 or $2, $24, $2 47 or $2, $27, $2
48 zapnot $1, $2, $1 48 zapnot $1, $2, $1
49 subq $18, 1, $18 49 subq $18, 1, $18
50 50
@@ -70,8 +70,8 @@ $multiword:
70 bne $18, 0b 70 bne $18, 0b
71 71
721: ldq_u $1, 0($16) # clear the leading bits in the final word 721: ldq_u $1, 0($16) # clear the leading bits in the final word
73 subq $27, 1, $2 73 subq $24, 1, $2
74 or $2, $27, $2 74 or $2, $24, $2
75 75
76 zap $1, $2, $1 76 zap $1, $2, $1
77 stq_u $1, 0($16) 77 stq_u $1, 0($16)
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 95a96275f88a..6f8e84c1c1f2 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -66,7 +66,7 @@ tune-$(CONFIG_CPU_XSC3) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -
66tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) 66tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
67 67
68ifeq ($(CONFIG_AEABI),y) 68ifeq ($(CONFIG_AEABI),y)
69CFLAGS_ABI :=-mabi=aapcs -mno-thumb-interwork 69CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork
70else 70else
71CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,) 71CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,)
72endif 72endif
diff --git a/arch/arm/configs/ep93xx_defconfig b/arch/arm/configs/ep93xx_defconfig
index 8dcc8e8ec813..b69e88bbc909 100644
--- a/arch/arm/configs/ep93xx_defconfig
+++ b/arch/arm/configs/ep93xx_defconfig
@@ -1,12 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16 3# Linux kernel version: 2.6.17-rc2
4# Mon Mar 20 14:54:51 2006 4# Wed Apr 19 21:21:01 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y 8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_HWEIGHT=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y 10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_VECTORS_BASE=0xffff0000
10 12
11# 13#
12# Code maturity level options 14# Code maturity level options
@@ -28,6 +30,7 @@ CONFIG_SYSCTL=y
28# CONFIG_AUDIT is not set 30# CONFIG_AUDIT is not set
29CONFIG_IKCONFIG=y 31CONFIG_IKCONFIG=y
30CONFIG_IKCONFIG_PROC=y 32CONFIG_IKCONFIG_PROC=y
33# CONFIG_RELAY is not set
31CONFIG_INITRAMFS_SOURCE="" 34CONFIG_INITRAMFS_SOURCE=""
32CONFIG_UID16=y 35CONFIG_UID16=y
33CONFIG_CC_OPTIMIZE_FOR_SIZE=y 36CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -43,10 +46,6 @@ CONFIG_BASE_FULL=y
43CONFIG_FUTEX=y 46CONFIG_FUTEX=y
44CONFIG_EPOLL=y 47CONFIG_EPOLL=y
45CONFIG_SHMEM=y 48CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0
50CONFIG_SLAB=y 49CONFIG_SLAB=y
51# CONFIG_TINY_SHMEM is not set 50# CONFIG_TINY_SHMEM is not set
52CONFIG_BASE_SMALL=0 51CONFIG_BASE_SMALL=0
@@ -59,7 +58,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
59CONFIG_MODULES=y 58CONFIG_MODULES=y
60CONFIG_MODULE_UNLOAD=y 59CONFIG_MODULE_UNLOAD=y
61CONFIG_MODULE_FORCE_UNLOAD=y 60CONFIG_MODULE_FORCE_UNLOAD=y
62CONFIG_OBSOLETE_MODPARM=y
63# CONFIG_MODVERSIONS is not set 61# CONFIG_MODVERSIONS is not set
64# CONFIG_MODULE_SRCVERSION_ALL is not set 62# CONFIG_MODULE_SRCVERSION_ALL is not set
65CONFIG_KMOD=y 63CONFIG_KMOD=y
@@ -67,6 +65,7 @@ CONFIG_KMOD=y
67# 65#
68# Block layer 66# Block layer
69# 67#
68# CONFIG_BLK_DEV_IO_TRACE is not set
70 69
71# 70#
72# IO Schedulers 71# IO Schedulers
@@ -94,6 +93,7 @@ CONFIG_ARCH_EP93XX=y
94# CONFIG_ARCH_IOP3XX is not set 93# CONFIG_ARCH_IOP3XX is not set
95# CONFIG_ARCH_IXP4XX is not set 94# CONFIG_ARCH_IXP4XX is not set
96# CONFIG_ARCH_IXP2000 is not set 95# CONFIG_ARCH_IXP2000 is not set
96# CONFIG_ARCH_IXP23XX is not set
97# CONFIG_ARCH_L7200 is not set 97# CONFIG_ARCH_L7200 is not set
98# CONFIG_ARCH_PXA is not set 98# CONFIG_ARCH_PXA is not set
99# CONFIG_ARCH_RPC is not set 99# CONFIG_ARCH_RPC is not set
@@ -112,7 +112,6 @@ CONFIG_ARCH_EP93XX=y
112# 112#
113# Cirrus EP93xx Implementation Options 113# Cirrus EP93xx Implementation Options
114# 114#
115CONFIG_CRUNCH=y
116 115
117# 116#
118# EP93xx Platforms 117# EP93xx Platforms
@@ -232,12 +231,15 @@ CONFIG_SYN_COOKIES=y
232# CONFIG_INET_AH is not set 231# CONFIG_INET_AH is not set
233# CONFIG_INET_ESP is not set 232# CONFIG_INET_ESP is not set
234# CONFIG_INET_IPCOMP is not set 233# CONFIG_INET_IPCOMP is not set
234# CONFIG_INET_XFRM_TUNNEL is not set
235# CONFIG_INET_TUNNEL is not set 235# CONFIG_INET_TUNNEL is not set
236CONFIG_INET_DIAG=y 236CONFIG_INET_DIAG=y
237CONFIG_INET_TCP_DIAG=y 237CONFIG_INET_TCP_DIAG=y
238# CONFIG_TCP_CONG_ADVANCED is not set 238# CONFIG_TCP_CONG_ADVANCED is not set
239CONFIG_TCP_CONG_BIC=y 239CONFIG_TCP_CONG_BIC=y
240# CONFIG_IPV6 is not set 240# CONFIG_IPV6 is not set
241# CONFIG_INET6_XFRM_TUNNEL is not set
242# CONFIG_INET6_TUNNEL is not set
241# CONFIG_NETFILTER is not set 243# CONFIG_NETFILTER is not set
242 244
243# 245#
@@ -346,7 +348,6 @@ CONFIG_MTD_CFI_I2=y
346# CONFIG_MTD_OTP is not set 348# CONFIG_MTD_OTP is not set
347CONFIG_MTD_CFI_INTELEXT=y 349CONFIG_MTD_CFI_INTELEXT=y
348CONFIG_MTD_CFI_AMDSTD=y 350CONFIG_MTD_CFI_AMDSTD=y
349CONFIG_MTD_CFI_AMDSTD_RETRY=0
350CONFIG_MTD_CFI_STAA=y 351CONFIG_MTD_CFI_STAA=y
351CONFIG_MTD_CFI_UTIL=y 352CONFIG_MTD_CFI_UTIL=y
352# CONFIG_MTD_RAM is not set 353# CONFIG_MTD_RAM is not set
@@ -371,7 +372,6 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=1
371# CONFIG_MTD_SLRAM is not set 372# CONFIG_MTD_SLRAM is not set
372# CONFIG_MTD_PHRAM is not set 373# CONFIG_MTD_PHRAM is not set
373# CONFIG_MTD_MTDRAM is not set 374# CONFIG_MTD_MTDRAM is not set
374# CONFIG_MTD_BLKMTD is not set
375# CONFIG_MTD_BLOCK2MTD is not set 375# CONFIG_MTD_BLOCK2MTD is not set
376 376
377# 377#
@@ -412,7 +412,7 @@ CONFIG_MTD_NAND_IDS=y
412# CONFIG_BLK_DEV_NBD is not set 412# CONFIG_BLK_DEV_NBD is not set
413# CONFIG_BLK_DEV_UB is not set 413# CONFIG_BLK_DEV_UB is not set
414# CONFIG_BLK_DEV_RAM is not set 414# CONFIG_BLK_DEV_RAM is not set
415CONFIG_BLK_DEV_RAM_COUNT=16 415# CONFIG_BLK_DEV_INITRD is not set
416# CONFIG_CDROM_PKTCDVD is not set 416# CONFIG_CDROM_PKTCDVD is not set
417# CONFIG_ATA_OVER_ETH is not set 417# CONFIG_ATA_OVER_ETH is not set
418 418
@@ -576,13 +576,13 @@ CONFIG_WATCHDOG=y
576# Watchdog Device Drivers 576# Watchdog Device Drivers
577# 577#
578# CONFIG_SOFT_WATCHDOG is not set 578# CONFIG_SOFT_WATCHDOG is not set
579CONFIG_EP93XX_WATCHDOG=y
579 580
580# 581#
581# USB-based Watchdog Cards 582# USB-based Watchdog Cards
582# 583#
583# CONFIG_USBPCWATCHDOG is not set 584# CONFIG_USBPCWATCHDOG is not set
584# CONFIG_NVRAM is not set 585# CONFIG_NVRAM is not set
585# CONFIG_RTC is not set
586# CONFIG_DTLK is not set 586# CONFIG_DTLK is not set
587# CONFIG_R3964 is not set 587# CONFIG_R3964 is not set
588 588
@@ -626,9 +626,7 @@ CONFIG_I2C_ALGOBIT=y
626# CONFIG_SENSORS_PCF8574 is not set 626# CONFIG_SENSORS_PCF8574 is not set
627# CONFIG_SENSORS_PCA9539 is not set 627# CONFIG_SENSORS_PCA9539 is not set
628# CONFIG_SENSORS_PCF8591 is not set 628# CONFIG_SENSORS_PCF8591 is not set
629# CONFIG_SENSORS_RTC8564 is not set
630# CONFIG_SENSORS_MAX6875 is not set 629# CONFIG_SENSORS_MAX6875 is not set
631# CONFIG_RTC_X1205_I2C is not set
632CONFIG_I2C_DEBUG_CORE=y 630CONFIG_I2C_DEBUG_CORE=y
633CONFIG_I2C_DEBUG_ALGO=y 631CONFIG_I2C_DEBUG_ALGO=y
634CONFIG_I2C_DEBUG_BUS=y 632CONFIG_I2C_DEBUG_BUS=y
@@ -690,7 +688,16 @@ CONFIG_HWMON=y
690# 688#
691 689
692# 690#
693# Multimedia Capabilities Port drivers 691# LED devices
692#
693# CONFIG_NEW_LEDS is not set
694
695#
696# LED drivers
697#
698
699#
700# LED Triggers
694# 701#
695 702
696# 703#
@@ -702,6 +709,7 @@ CONFIG_HWMON=y
702# Digital Video Broadcasting Devices 709# Digital Video Broadcasting Devices
703# 710#
704# CONFIG_DVB is not set 711# CONFIG_DVB is not set
712# CONFIG_USB_DABUSB is not set
705 713
706# 714#
707# Graphics support 715# Graphics support
@@ -718,6 +726,7 @@ CONFIG_HWMON=y
718# 726#
719CONFIG_USB_ARCH_HAS_HCD=y 727CONFIG_USB_ARCH_HAS_HCD=y
720# CONFIG_USB_ARCH_HAS_OHCI is not set 728# CONFIG_USB_ARCH_HAS_OHCI is not set
729# CONFIG_USB_ARCH_HAS_EHCI is not set
721CONFIG_USB=y 730CONFIG_USB=y
722CONFIG_USB_DEBUG=y 731CONFIG_USB_DEBUG=y
723 732
@@ -776,15 +785,6 @@ CONFIG_USB_STORAGE=y
776# CONFIG_USB_MICROTEK is not set 785# CONFIG_USB_MICROTEK is not set
777 786
778# 787#
779# USB Multimedia devices
780#
781# CONFIG_USB_DABUSB is not set
782
783#
784# Video4Linux support is needed for USB Multimedia device support
785#
786
787#
788# USB Network Adapters 788# USB Network Adapters
789# 789#
790# CONFIG_USB_CATC is not set 790# CONFIG_USB_CATC is not set
@@ -813,6 +813,7 @@ CONFIG_USB_SERIAL_CONSOLE=y
813# CONFIG_USB_SERIAL_CYPRESS_M8 is not set 813# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
814# CONFIG_USB_SERIAL_EMPEG is not set 814# CONFIG_USB_SERIAL_EMPEG is not set
815# CONFIG_USB_SERIAL_FTDI_SIO is not set 815# CONFIG_USB_SERIAL_FTDI_SIO is not set
816# CONFIG_USB_SERIAL_FUNSOFT is not set
816# CONFIG_USB_SERIAL_VISOR is not set 817# CONFIG_USB_SERIAL_VISOR is not set
817# CONFIG_USB_SERIAL_IPAQ is not set 818# CONFIG_USB_SERIAL_IPAQ is not set
818# CONFIG_USB_SERIAL_IR is not set 819# CONFIG_USB_SERIAL_IR is not set
@@ -825,6 +826,7 @@ CONFIG_USB_SERIAL_CONSOLE=y
825# CONFIG_USB_SERIAL_KLSI is not set 826# CONFIG_USB_SERIAL_KLSI is not set
826# CONFIG_USB_SERIAL_KOBIL_SCT is not set 827# CONFIG_USB_SERIAL_KOBIL_SCT is not set
827# CONFIG_USB_SERIAL_MCT_U232 is not set 828# CONFIG_USB_SERIAL_MCT_U232 is not set
829# CONFIG_USB_SERIAL_NAVMAN is not set
828CONFIG_USB_SERIAL_PL2303=y 830CONFIG_USB_SERIAL_PL2303=y
829# CONFIG_USB_SERIAL_HP4X is not set 831# CONFIG_USB_SERIAL_HP4X is not set
830# CONFIG_USB_SERIAL_SAFE is not set 832# CONFIG_USB_SERIAL_SAFE is not set
@@ -865,6 +867,32 @@ CONFIG_USB_SERIAL_PL2303=y
865# CONFIG_MMC is not set 867# CONFIG_MMC is not set
866 868
867# 869#
870# Real Time Clock
871#
872CONFIG_RTC_LIB=y
873CONFIG_RTC_CLASS=y
874CONFIG_RTC_HCTOSYS=y
875CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
876
877#
878# RTC interfaces
879#
880CONFIG_RTC_INTF_SYSFS=y
881CONFIG_RTC_INTF_PROC=y
882CONFIG_RTC_INTF_DEV=y
883
884#
885# RTC drivers
886#
887# CONFIG_RTC_DRV_X1205 is not set
888# CONFIG_RTC_DRV_DS1672 is not set
889# CONFIG_RTC_DRV_PCF8563 is not set
890# CONFIG_RTC_DRV_RS5C372 is not set
891CONFIG_RTC_DRV_M48T86=y
892CONFIG_RTC_DRV_EP93XX=y
893# CONFIG_RTC_DRV_TEST is not set
894
895#
868# File systems 896# File systems
869# 897#
870CONFIG_EXT2_FS=y 898CONFIG_EXT2_FS=y
@@ -912,7 +940,6 @@ CONFIG_SYSFS=y
912CONFIG_TMPFS=y 940CONFIG_TMPFS=y
913# CONFIG_HUGETLB_PAGE is not set 941# CONFIG_HUGETLB_PAGE is not set
914CONFIG_RAMFS=y 942CONFIG_RAMFS=y
915# CONFIG_RELAYFS_FS is not set
916# CONFIG_CONFIGFS_FS is not set 943# CONFIG_CONFIGFS_FS is not set
917 944
918# 945#
@@ -1044,6 +1071,7 @@ CONFIG_LOG_BUF_SHIFT=14
1044CONFIG_DETECT_SOFTLOCKUP=y 1071CONFIG_DETECT_SOFTLOCKUP=y
1045# CONFIG_SCHEDSTATS is not set 1072# CONFIG_SCHEDSTATS is not set
1046CONFIG_DEBUG_SLAB=y 1073CONFIG_DEBUG_SLAB=y
1074# CONFIG_DEBUG_SLAB_LEAK is not set
1047CONFIG_DEBUG_MUTEXES=y 1075CONFIG_DEBUG_MUTEXES=y
1048CONFIG_DEBUG_SPINLOCK=y 1076CONFIG_DEBUG_SPINLOCK=y
1049# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1077# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
@@ -1053,6 +1081,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
1053# CONFIG_DEBUG_FS is not set 1081# CONFIG_DEBUG_FS is not set
1054# CONFIG_DEBUG_VM is not set 1082# CONFIG_DEBUG_VM is not set
1055CONFIG_FRAME_POINTER=y 1083CONFIG_FRAME_POINTER=y
1084# CONFIG_UNWIND_INFO is not set
1056CONFIG_FORCED_INLINING=y 1085CONFIG_FORCED_INLINING=y
1057# CONFIG_RCU_TORTURE_TEST is not set 1086# CONFIG_RCU_TORTURE_TEST is not set
1058CONFIG_DEBUG_USER=y 1087CONFIG_DEBUG_USER=y
diff --git a/arch/arm/configs/ixp2000_defconfig b/arch/arm/configs/ixp2000_defconfig
index 7b02ca04c3ee..e6f3e4873d6c 100644
--- a/arch/arm/configs/ixp2000_defconfig
+++ b/arch/arm/configs/ixp2000_defconfig
@@ -1,18 +1,19 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc2 3# Linux kernel version: 2.6.17-rc2
4# Wed Feb 8 04:49:11 2006 4# Wed Apr 19 21:12:49 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y 8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_HWEIGHT=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y 10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_VECTORS_BASE=0xffff0000
10 12
11# 13#
12# Code maturity level options 14# Code maturity level options
13# 15#
14CONFIG_EXPERIMENTAL=y 16CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 17CONFIG_BROKEN_ON_SMP=y
17CONFIG_INIT_ENV_ARG_LIMIT=32 18CONFIG_INIT_ENV_ARG_LIMIT=32
18 19
@@ -29,6 +30,7 @@ CONFIG_BSD_PROCESS_ACCT=y
29CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
31# CONFIG_IKCONFIG is not set 32# CONFIG_IKCONFIG is not set
33# CONFIG_RELAY is not set
32CONFIG_INITRAMFS_SOURCE="" 34CONFIG_INITRAMFS_SOURCE=""
33CONFIG_UID16=y 35CONFIG_UID16=y
34CONFIG_CC_OPTIMIZE_FOR_SIZE=y 36CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -44,10 +46,6 @@ CONFIG_BASE_FULL=y
44CONFIG_FUTEX=y 46CONFIG_FUTEX=y
45CONFIG_EPOLL=y 47CONFIG_EPOLL=y
46CONFIG_SHMEM=y 48CONFIG_SHMEM=y
47CONFIG_CC_ALIGN_FUNCTIONS=0
48CONFIG_CC_ALIGN_LABELS=0
49CONFIG_CC_ALIGN_LOOPS=0
50CONFIG_CC_ALIGN_JUMPS=0
51CONFIG_SLAB=y 49CONFIG_SLAB=y
52# CONFIG_TINY_SHMEM is not set 50# CONFIG_TINY_SHMEM is not set
53CONFIG_BASE_SMALL=0 51CONFIG_BASE_SMALL=0
@@ -60,7 +58,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
60CONFIG_MODULES=y 58CONFIG_MODULES=y
61CONFIG_MODULE_UNLOAD=y 59CONFIG_MODULE_UNLOAD=y
62# CONFIG_MODULE_FORCE_UNLOAD is not set 60# CONFIG_MODULE_FORCE_UNLOAD is not set
63CONFIG_OBSOLETE_MODPARM=y
64# CONFIG_MODVERSIONS is not set 61# CONFIG_MODVERSIONS is not set
65# CONFIG_MODULE_SRCVERSION_ALL is not set 62# CONFIG_MODULE_SRCVERSION_ALL is not set
66CONFIG_KMOD=y 63CONFIG_KMOD=y
@@ -68,6 +65,7 @@ CONFIG_KMOD=y
68# 65#
69# Block layer 66# Block layer
70# 67#
68# CONFIG_BLK_DEV_IO_TRACE is not set
71 69
72# 70#
73# IO Schedulers 71# IO Schedulers
@@ -89,11 +87,13 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
89# CONFIG_ARCH_CLPS711X is not set 87# CONFIG_ARCH_CLPS711X is not set
90# CONFIG_ARCH_CO285 is not set 88# CONFIG_ARCH_CO285 is not set
91# CONFIG_ARCH_EBSA110 is not set 89# CONFIG_ARCH_EBSA110 is not set
90# CONFIG_ARCH_EP93XX is not set
92# CONFIG_ARCH_FOOTBRIDGE is not set 91# CONFIG_ARCH_FOOTBRIDGE is not set
93# CONFIG_ARCH_INTEGRATOR is not set 92# CONFIG_ARCH_INTEGRATOR is not set
94# CONFIG_ARCH_IOP3XX is not set 93# CONFIG_ARCH_IOP3XX is not set
95# CONFIG_ARCH_IXP4XX is not set 94# CONFIG_ARCH_IXP4XX is not set
96CONFIG_ARCH_IXP2000=y 95CONFIG_ARCH_IXP2000=y
96# CONFIG_ARCH_IXP23XX is not set
97# CONFIG_ARCH_L7200 is not set 97# CONFIG_ARCH_L7200 is not set
98# CONFIG_ARCH_PXA is not set 98# CONFIG_ARCH_PXA is not set
99# CONFIG_ARCH_RPC is not set 99# CONFIG_ARCH_RPC is not set
@@ -123,6 +123,7 @@ CONFIG_ARCH_IXDP2800=y
123CONFIG_ARCH_IXDP2X00=y 123CONFIG_ARCH_IXDP2X00=y
124CONFIG_ARCH_IXDP2401=y 124CONFIG_ARCH_IXDP2401=y
125CONFIG_ARCH_IXDP2801=y 125CONFIG_ARCH_IXDP2801=y
126CONFIG_MACH_IXDP28X5=y
126CONFIG_ARCH_IXDP2X01=y 127CONFIG_ARCH_IXDP2X01=y
127# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set 128# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set
128 129
@@ -147,7 +148,6 @@ CONFIG_XSCALE_PMU=y
147# Bus support 148# Bus support
148# 149#
149CONFIG_PCI=y 150CONFIG_PCI=y
150CONFIG_PCI_LEGACY_PROC=y
151# CONFIG_PCI_DEBUG is not set 151# CONFIG_PCI_DEBUG is not set
152 152
153# 153#
@@ -160,6 +160,7 @@ CONFIG_PCI_LEGACY_PROC=y
160# 160#
161# CONFIG_PREEMPT is not set 161# CONFIG_PREEMPT is not set
162# CONFIG_NO_IDLE_HZ is not set 162# CONFIG_NO_IDLE_HZ is not set
163CONFIG_HZ=100
163# CONFIG_AEABI is not set 164# CONFIG_AEABI is not set
164# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 165# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
165CONFIG_SELECT_MEMORY_MODEL=y 166CONFIG_SELECT_MEMORY_MODEL=y
@@ -213,6 +214,7 @@ CONFIG_NET=y
213# 214#
214# Networking options 215# Networking options
215# 216#
217# CONFIG_NETDEBUG is not set
216CONFIG_PACKET=y 218CONFIG_PACKET=y
217CONFIG_PACKET_MMAP=y 219CONFIG_PACKET_MMAP=y
218CONFIG_UNIX=y 220CONFIG_UNIX=y
@@ -232,12 +234,15 @@ CONFIG_SYN_COOKIES=y
232# CONFIG_INET_AH is not set 234# CONFIG_INET_AH is not set
233# CONFIG_INET_ESP is not set 235# CONFIG_INET_ESP is not set
234# CONFIG_INET_IPCOMP is not set 236# CONFIG_INET_IPCOMP is not set
237# CONFIG_INET_XFRM_TUNNEL is not set
235# CONFIG_INET_TUNNEL is not set 238# CONFIG_INET_TUNNEL is not set
236CONFIG_INET_DIAG=y 239CONFIG_INET_DIAG=y
237CONFIG_INET_TCP_DIAG=y 240CONFIG_INET_TCP_DIAG=y
238# CONFIG_TCP_CONG_ADVANCED is not set 241# CONFIG_TCP_CONG_ADVANCED is not set
239CONFIG_TCP_CONG_BIC=y 242CONFIG_TCP_CONG_BIC=y
240# CONFIG_IPV6 is not set 243# CONFIG_IPV6 is not set
244# CONFIG_INET6_XFRM_TUNNEL is not set
245# CONFIG_INET6_TUNNEL is not set
241# CONFIG_NETFILTER is not set 246# CONFIG_NETFILTER is not set
242 247
243# 248#
@@ -347,7 +352,6 @@ CONFIG_MTD_CFI_UTIL=y
347# CONFIG_MTD_ROM is not set 352# CONFIG_MTD_ROM is not set
348# CONFIG_MTD_ABSENT is not set 353# CONFIG_MTD_ABSENT is not set
349# CONFIG_MTD_OBSOLETE_CHIPS is not set 354# CONFIG_MTD_OBSOLETE_CHIPS is not set
350# CONFIG_MTD_XIP is not set
351 355
352# 356#
353# Mapping drivers for chip access 357# Mapping drivers for chip access
@@ -366,7 +370,6 @@ CONFIG_MTD_IXP2000=y
366# CONFIG_MTD_SLRAM is not set 370# CONFIG_MTD_SLRAM is not set
367# CONFIG_MTD_PHRAM is not set 371# CONFIG_MTD_PHRAM is not set
368# CONFIG_MTD_MTDRAM is not set 372# CONFIG_MTD_MTDRAM is not set
369# CONFIG_MTD_BLKMTD is not set
370# CONFIG_MTD_BLOCK2MTD is not set 373# CONFIG_MTD_BLOCK2MTD is not set
371 374
372# 375#
@@ -614,8 +617,9 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
614# 617#
615CONFIG_SERIAL_8250=y 618CONFIG_SERIAL_8250=y
616CONFIG_SERIAL_8250_CONSOLE=y 619CONFIG_SERIAL_8250_CONSOLE=y
620CONFIG_SERIAL_8250_PCI=y
617CONFIG_SERIAL_8250_NR_UARTS=3 621CONFIG_SERIAL_8250_NR_UARTS=3
618CONFIG_SERIAL_8250_RUNTIME_UARTS=4 622CONFIG_SERIAL_8250_RUNTIME_UARTS=3
619# CONFIG_SERIAL_8250_EXTENDED is not set 623# CONFIG_SERIAL_8250_EXTENDED is not set
620 624
621# 625#
@@ -623,6 +627,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
623# 627#
624CONFIG_SERIAL_CORE=y 628CONFIG_SERIAL_CORE=y
625CONFIG_SERIAL_CORE_CONSOLE=y 629CONFIG_SERIAL_CORE_CONSOLE=y
630# CONFIG_SERIAL_JSM is not set
626CONFIG_UNIX98_PTYS=y 631CONFIG_UNIX98_PTYS=y
627CONFIG_LEGACY_PTYS=y 632CONFIG_LEGACY_PTYS=y
628CONFIG_LEGACY_PTY_COUNT=256 633CONFIG_LEGACY_PTY_COUNT=256
@@ -650,7 +655,6 @@ CONFIG_IXP2000_WATCHDOG=y
650# CONFIG_PCIPCWATCHDOG is not set 655# CONFIG_PCIPCWATCHDOG is not set
651# CONFIG_WDTPCI is not set 656# CONFIG_WDTPCI is not set
652# CONFIG_NVRAM is not set 657# CONFIG_NVRAM is not set
653# CONFIG_RTC is not set
654# CONFIG_DTLK is not set 658# CONFIG_DTLK is not set
655# CONFIG_R3964 is not set 659# CONFIG_R3964 is not set
656# CONFIG_APPLICOM is not set 660# CONFIG_APPLICOM is not set
@@ -696,7 +700,6 @@ CONFIG_I2C_IXP2000=y
696# CONFIG_I2C_PARPORT_LIGHT is not set 700# CONFIG_I2C_PARPORT_LIGHT is not set
697# CONFIG_I2C_PROSAVAGE is not set 701# CONFIG_I2C_PROSAVAGE is not set
698# CONFIG_I2C_SAVAGE4 is not set 702# CONFIG_I2C_SAVAGE4 is not set
699# CONFIG_SCx200_ACB is not set
700# CONFIG_I2C_SIS5595 is not set 703# CONFIG_I2C_SIS5595 is not set
701# CONFIG_I2C_SIS630 is not set 704# CONFIG_I2C_SIS630 is not set
702# CONFIG_I2C_SIS96X is not set 705# CONFIG_I2C_SIS96X is not set
@@ -715,9 +718,7 @@ CONFIG_SENSORS_EEPROM=y
715# CONFIG_SENSORS_PCF8574 is not set 718# CONFIG_SENSORS_PCF8574 is not set
716# CONFIG_SENSORS_PCA9539 is not set 719# CONFIG_SENSORS_PCA9539 is not set
717# CONFIG_SENSORS_PCF8591 is not set 720# CONFIG_SENSORS_PCF8591 is not set
718# CONFIG_SENSORS_RTC8564 is not set
719# CONFIG_SENSORS_MAX6875 is not set 721# CONFIG_SENSORS_MAX6875 is not set
720# CONFIG_RTC_X1205_I2C is not set
721# CONFIG_I2C_DEBUG_CORE is not set 722# CONFIG_I2C_DEBUG_CORE is not set
722# CONFIG_I2C_DEBUG_ALGO is not set 723# CONFIG_I2C_DEBUG_ALGO is not set
723# CONFIG_I2C_DEBUG_BUS is not set 724# CONFIG_I2C_DEBUG_BUS is not set
@@ -730,6 +731,11 @@ CONFIG_SENSORS_EEPROM=y
730# CONFIG_SPI_MASTER is not set 731# CONFIG_SPI_MASTER is not set
731 732
732# 733#
734# Dallas's 1-wire bus
735#
736# CONFIG_W1 is not set
737
738#
733# Hardware Monitoring support 739# Hardware Monitoring support
734# 740#
735CONFIG_HWMON=y 741CONFIG_HWMON=y
@@ -742,6 +748,7 @@ CONFIG_HWMON=y
742# CONFIG_SENSORS_ASB100 is not set 748# CONFIG_SENSORS_ASB100 is not set
743# CONFIG_SENSORS_ATXP1 is not set 749# CONFIG_SENSORS_ATXP1 is not set
744# CONFIG_SENSORS_DS1621 is not set 750# CONFIG_SENSORS_DS1621 is not set
751# CONFIG_SENSORS_F71805F is not set
745# CONFIG_SENSORS_FSCHER is not set 752# CONFIG_SENSORS_FSCHER is not set
746# CONFIG_SENSORS_FSCPOS is not set 753# CONFIG_SENSORS_FSCPOS is not set
747# CONFIG_SENSORS_GL518SM is not set 754# CONFIG_SENSORS_GL518SM is not set
@@ -776,7 +783,16 @@ CONFIG_HWMON=y
776# 783#
777 784
778# 785#
779# Multimedia Capabilities Port drivers 786# LED devices
787#
788# CONFIG_NEW_LEDS is not set
789
790#
791# LED drivers
792#
793
794#
795# LED Triggers
780# 796#
781 797
782# 798#
@@ -804,6 +820,7 @@ CONFIG_HWMON=y
804# 820#
805CONFIG_USB_ARCH_HAS_HCD=y 821CONFIG_USB_ARCH_HAS_HCD=y
806CONFIG_USB_ARCH_HAS_OHCI=y 822CONFIG_USB_ARCH_HAS_OHCI=y
823CONFIG_USB_ARCH_HAS_EHCI=y
807# CONFIG_USB is not set 824# CONFIG_USB is not set
808 825
809# 826#
@@ -821,6 +838,12 @@ CONFIG_USB_ARCH_HAS_OHCI=y
821# CONFIG_MMC is not set 838# CONFIG_MMC is not set
822 839
823# 840#
841# Real Time Clock
842#
843CONFIG_RTC_LIB=y
844# CONFIG_RTC_CLASS is not set
845
846#
824# File systems 847# File systems
825# 848#
826CONFIG_EXT2_FS=y 849CONFIG_EXT2_FS=y
@@ -870,7 +893,6 @@ CONFIG_SYSFS=y
870CONFIG_TMPFS=y 893CONFIG_TMPFS=y
871# CONFIG_HUGETLB_PAGE is not set 894# CONFIG_HUGETLB_PAGE is not set
872CONFIG_RAMFS=y 895CONFIG_RAMFS=y
873# CONFIG_RELAYFS_FS is not set
874# CONFIG_CONFIGFS_FS is not set 896# CONFIG_CONFIGFS_FS is not set
875 897
876# 898#
@@ -972,6 +994,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
972# CONFIG_DEBUG_FS is not set 994# CONFIG_DEBUG_FS is not set
973# CONFIG_DEBUG_VM is not set 995# CONFIG_DEBUG_VM is not set
974CONFIG_FRAME_POINTER=y 996CONFIG_FRAME_POINTER=y
997# CONFIG_UNWIND_INFO is not set
975CONFIG_FORCED_INLINING=y 998CONFIG_FORCED_INLINING=y
976# CONFIG_RCU_TORTURE_TEST is not set 999# CONFIG_RCU_TORTURE_TEST is not set
977CONFIG_DEBUG_USER=y 1000CONFIG_DEBUG_USER=y
diff --git a/arch/arm/configs/ixp23xx_defconfig b/arch/arm/configs/ixp23xx_defconfig
index 1a2751e9ab05..9ce898a6cf87 100644
--- a/arch/arm/configs/ixp23xx_defconfig
+++ b/arch/arm/configs/ixp23xx_defconfig
@@ -1,12 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16 3# Linux kernel version: 2.6.17-rc2
4# Tue Mar 21 03:27:20 2006 4# Wed Apr 19 21:13:50 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y 8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_HWEIGHT=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y 10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_VECTORS_BASE=0xffff0000
10 12
11# 13#
12# Code maturity level options 14# Code maturity level options
@@ -28,6 +30,7 @@ CONFIG_BSD_PROCESS_ACCT=y
28CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
30# CONFIG_IKCONFIG is not set 32# CONFIG_IKCONFIG is not set
33# CONFIG_RELAY is not set
31CONFIG_INITRAMFS_SOURCE="" 34CONFIG_INITRAMFS_SOURCE=""
32CONFIG_UID16=y 35CONFIG_UID16=y
33CONFIG_CC_OPTIMIZE_FOR_SIZE=y 36CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -43,10 +46,6 @@ CONFIG_BASE_FULL=y
43CONFIG_FUTEX=y 46CONFIG_FUTEX=y
44CONFIG_EPOLL=y 47CONFIG_EPOLL=y
45CONFIG_SHMEM=y 48CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0
50CONFIG_SLAB=y 49CONFIG_SLAB=y
51# CONFIG_TINY_SHMEM is not set 50# CONFIG_TINY_SHMEM is not set
52CONFIG_BASE_SMALL=0 51CONFIG_BASE_SMALL=0
@@ -59,7 +58,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
59CONFIG_MODULES=y 58CONFIG_MODULES=y
60CONFIG_MODULE_UNLOAD=y 59CONFIG_MODULE_UNLOAD=y
61# CONFIG_MODULE_FORCE_UNLOAD is not set 60# CONFIG_MODULE_FORCE_UNLOAD is not set
62CONFIG_OBSOLETE_MODPARM=y
63# CONFIG_MODVERSIONS is not set 61# CONFIG_MODVERSIONS is not set
64# CONFIG_MODULE_SRCVERSION_ALL is not set 62# CONFIG_MODULE_SRCVERSION_ALL is not set
65CONFIG_KMOD=y 63CONFIG_KMOD=y
@@ -67,6 +65,7 @@ CONFIG_KMOD=y
67# 65#
68# Block layer 66# Block layer
69# 67#
68# CONFIG_BLK_DEV_IO_TRACE is not set
70 69
71# 70#
72# IO Schedulers 71# IO Schedulers
@@ -143,7 +142,6 @@ CONFIG_CPU_BIG_ENDIAN=y
143# Bus support 142# Bus support
144# 143#
145CONFIG_PCI=y 144CONFIG_PCI=y
146CONFIG_PCI_LEGACY_PROC=y
147# CONFIG_PCI_DEBUG is not set 145# CONFIG_PCI_DEBUG is not set
148 146
149# 147#
@@ -230,12 +228,15 @@ CONFIG_SYN_COOKIES=y
230# CONFIG_INET_AH is not set 228# CONFIG_INET_AH is not set
231# CONFIG_INET_ESP is not set 229# CONFIG_INET_ESP is not set
232# CONFIG_INET_IPCOMP is not set 230# CONFIG_INET_IPCOMP is not set
231# CONFIG_INET_XFRM_TUNNEL is not set
233# CONFIG_INET_TUNNEL is not set 232# CONFIG_INET_TUNNEL is not set
234CONFIG_INET_DIAG=y 233CONFIG_INET_DIAG=y
235CONFIG_INET_TCP_DIAG=y 234CONFIG_INET_TCP_DIAG=y
236# CONFIG_TCP_CONG_ADVANCED is not set 235# CONFIG_TCP_CONG_ADVANCED is not set
237CONFIG_TCP_CONG_BIC=y 236CONFIG_TCP_CONG_BIC=y
238# CONFIG_IPV6 is not set 237# CONFIG_IPV6 is not set
238# CONFIG_INET6_XFRM_TUNNEL is not set
239# CONFIG_INET6_TUNNEL is not set
239# CONFIG_NETFILTER is not set 240# CONFIG_NETFILTER is not set
240 241
241# 242#
@@ -365,7 +366,6 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=1
365# CONFIG_MTD_SLRAM is not set 366# CONFIG_MTD_SLRAM is not set
366# CONFIG_MTD_PHRAM is not set 367# CONFIG_MTD_PHRAM is not set
367# CONFIG_MTD_MTDRAM is not set 368# CONFIG_MTD_MTDRAM is not set
368# CONFIG_MTD_BLKMTD is not set
369# CONFIG_MTD_BLOCK2MTD is not set 369# CONFIG_MTD_BLOCK2MTD is not set
370 370
371# 371#
@@ -527,7 +527,6 @@ CONFIG_BLK_DEV_SD=y
527# CONFIG_SCSI_INIA100 is not set 527# CONFIG_SCSI_INIA100 is not set
528# CONFIG_SCSI_SYM53C8XX_2 is not set 528# CONFIG_SCSI_SYM53C8XX_2 is not set
529# CONFIG_SCSI_IPR is not set 529# CONFIG_SCSI_IPR is not set
530# CONFIG_SCSI_QLOGIC_FC is not set
531# CONFIG_SCSI_QLOGIC_1280 is not set 530# CONFIG_SCSI_QLOGIC_1280 is not set
532# CONFIG_SCSI_QLA_FC is not set 531# CONFIG_SCSI_QLA_FC is not set
533# CONFIG_SCSI_LPFC is not set 532# CONFIG_SCSI_LPFC is not set
@@ -735,6 +734,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
735# 734#
736CONFIG_SERIAL_8250=y 735CONFIG_SERIAL_8250=y
737CONFIG_SERIAL_8250_CONSOLE=y 736CONFIG_SERIAL_8250_CONSOLE=y
737CONFIG_SERIAL_8250_PCI=y
738CONFIG_SERIAL_8250_NR_UARTS=4 738CONFIG_SERIAL_8250_NR_UARTS=4
739CONFIG_SERIAL_8250_RUNTIME_UARTS=4 739CONFIG_SERIAL_8250_RUNTIME_UARTS=4
740# CONFIG_SERIAL_8250_EXTENDED is not set 740# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -776,7 +776,6 @@ CONFIG_WATCHDOG=y
776# 776#
777# CONFIG_USBPCWATCHDOG is not set 777# CONFIG_USBPCWATCHDOG is not set
778# CONFIG_NVRAM is not set 778# CONFIG_NVRAM is not set
779# CONFIG_RTC is not set
780# CONFIG_DTLK is not set 779# CONFIG_DTLK is not set
781# CONFIG_R3964 is not set 780# CONFIG_R3964 is not set
782# CONFIG_APPLICOM is not set 781# CONFIG_APPLICOM is not set
@@ -821,7 +820,6 @@ CONFIG_I2C_ALGOBIT=y
821# CONFIG_I2C_PARPORT_LIGHT is not set 820# CONFIG_I2C_PARPORT_LIGHT is not set
822# CONFIG_I2C_PROSAVAGE is not set 821# CONFIG_I2C_PROSAVAGE is not set
823# CONFIG_I2C_SAVAGE4 is not set 822# CONFIG_I2C_SAVAGE4 is not set
824# CONFIG_SCx200_ACB is not set
825# CONFIG_I2C_SIS5595 is not set 823# CONFIG_I2C_SIS5595 is not set
826# CONFIG_I2C_SIS630 is not set 824# CONFIG_I2C_SIS630 is not set
827# CONFIG_I2C_SIS96X is not set 825# CONFIG_I2C_SIS96X is not set
@@ -840,9 +838,7 @@ CONFIG_SENSORS_EEPROM=y
840# CONFIG_SENSORS_PCF8574 is not set 838# CONFIG_SENSORS_PCF8574 is not set
841# CONFIG_SENSORS_PCA9539 is not set 839# CONFIG_SENSORS_PCA9539 is not set
842# CONFIG_SENSORS_PCF8591 is not set 840# CONFIG_SENSORS_PCF8591 is not set
843# CONFIG_SENSORS_RTC8564 is not set
844# CONFIG_SENSORS_MAX6875 is not set 841# CONFIG_SENSORS_MAX6875 is not set
845# CONFIG_RTC_X1205_I2C is not set
846# CONFIG_I2C_DEBUG_CORE is not set 842# CONFIG_I2C_DEBUG_CORE is not set
847# CONFIG_I2C_DEBUG_ALGO is not set 843# CONFIG_I2C_DEBUG_ALGO is not set
848# CONFIG_I2C_DEBUG_BUS is not set 844# CONFIG_I2C_DEBUG_BUS is not set
@@ -907,7 +903,16 @@ CONFIG_HWMON=y
907# 903#
908 904
909# 905#
910# Multimedia Capabilities Port drivers 906# LED devices
907#
908# CONFIG_NEW_LEDS is not set
909
910#
911# LED drivers
912#
913
914#
915# LED Triggers
911# 916#
912 917
913# 918#
@@ -919,6 +924,7 @@ CONFIG_HWMON=y
919# Digital Video Broadcasting Devices 924# Digital Video Broadcasting Devices
920# 925#
921# CONFIG_DVB is not set 926# CONFIG_DVB is not set
927# CONFIG_USB_DABUSB is not set
922 928
923# 929#
924# Graphics support 930# Graphics support
@@ -935,6 +941,7 @@ CONFIG_HWMON=y
935# 941#
936CONFIG_USB_ARCH_HAS_HCD=y 942CONFIG_USB_ARCH_HAS_HCD=y
937CONFIG_USB_ARCH_HAS_OHCI=y 943CONFIG_USB_ARCH_HAS_OHCI=y
944CONFIG_USB_ARCH_HAS_EHCI=y
938CONFIG_USB=y 945CONFIG_USB=y
939# CONFIG_USB_DEBUG is not set 946# CONFIG_USB_DEBUG is not set
940 947
@@ -1000,9 +1007,7 @@ CONFIG_USB_STORAGE=y
1000# CONFIG_USB_ACECAD is not set 1007# CONFIG_USB_ACECAD is not set
1001# CONFIG_USB_KBTAB is not set 1008# CONFIG_USB_KBTAB is not set
1002# CONFIG_USB_POWERMATE is not set 1009# CONFIG_USB_POWERMATE is not set
1003# CONFIG_USB_MTOUCH is not set 1010# CONFIG_USB_TOUCHSCREEN is not set
1004# CONFIG_USB_ITMTOUCH is not set
1005# CONFIG_USB_EGALAX is not set
1006# CONFIG_USB_YEALINK is not set 1011# CONFIG_USB_YEALINK is not set
1007# CONFIG_USB_XPAD is not set 1012# CONFIG_USB_XPAD is not set
1008# CONFIG_USB_ATI_REMOTE is not set 1013# CONFIG_USB_ATI_REMOTE is not set
@@ -1017,15 +1022,6 @@ CONFIG_USB_STORAGE=y
1017# CONFIG_USB_MICROTEK is not set 1022# CONFIG_USB_MICROTEK is not set
1018 1023
1019# 1024#
1020# USB Multimedia devices
1021#
1022# CONFIG_USB_DABUSB is not set
1023
1024#
1025# Video4Linux support is needed for USB Multimedia device support
1026#
1027
1028#
1029# USB Network Adapters 1025# USB Network Adapters
1030# 1026#
1031# CONFIG_USB_CATC is not set 1027# CONFIG_USB_CATC is not set
@@ -1076,6 +1072,12 @@ CONFIG_USB_MON=y
1076# CONFIG_MMC is not set 1072# CONFIG_MMC is not set
1077 1073
1078# 1074#
1075# Real Time Clock
1076#
1077CONFIG_RTC_LIB=y
1078# CONFIG_RTC_CLASS is not set
1079
1080#
1079# File systems 1081# File systems
1080# 1082#
1081CONFIG_EXT2_FS=y 1083CONFIG_EXT2_FS=y
@@ -1127,7 +1129,6 @@ CONFIG_SYSFS=y
1127CONFIG_TMPFS=y 1129CONFIG_TMPFS=y
1128# CONFIG_HUGETLB_PAGE is not set 1130# CONFIG_HUGETLB_PAGE is not set
1129CONFIG_RAMFS=y 1131CONFIG_RAMFS=y
1130# CONFIG_RELAYFS_FS is not set
1131# CONFIG_CONFIGFS_FS is not set 1132# CONFIG_CONFIGFS_FS is not set
1132 1133
1133# 1134#
@@ -1268,6 +1269,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
1268# CONFIG_DEBUG_FS is not set 1269# CONFIG_DEBUG_FS is not set
1269# CONFIG_DEBUG_VM is not set 1270# CONFIG_DEBUG_VM is not set
1270CONFIG_FRAME_POINTER=y 1271CONFIG_FRAME_POINTER=y
1272# CONFIG_UNWIND_INFO is not set
1271CONFIG_FORCED_INLINING=y 1273CONFIG_FORCED_INLINING=y
1272# CONFIG_RCU_TORTURE_TEST is not set 1274# CONFIG_RCU_TORTURE_TEST is not set
1273CONFIG_DEBUG_USER=y 1275CONFIG_DEBUG_USER=y
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 2ce0e3a27a45..a601b8b55f35 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -29,7 +29,7 @@ ifneq ($(CONFIG_ARCH_EBSA110),y)
29 obj-y += io.o 29 obj-y += io.o
30endif 30endif
31 31
32head-y := head.o 32head-y := head$(MMUEXT).o
33obj-$(CONFIG_DEBUG_LL) += debug.o 33obj-$(CONFIG_DEBUG_LL) += debug.o
34 34
35extra-y := $(head-y) init_task.o vmlinux.lds 35extra-y := $(head-y) init_task.o vmlinux.lds
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index b093ab8738b5..0bea65864051 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -20,10 +20,11 @@
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21#include <asm/procinfo.h> 21#include <asm/procinfo.h>
22#include <asm/ptrace.h> 22#include <asm/ptrace.h>
23#include <asm/constants.h> 23#include <asm/thread_info.h>
24#include <asm/system.h> 24#include <asm/system.h>
25 25
26#define PROCINFO_INITFUNC 12 26#define PROCINFO_INITFUNC 12
27#define MACHINFO_TYPE 0
27 28
28/* 29/*
29 * Kernel startup entry point. 30 * Kernel startup entry point.
@@ -79,5 +80,6 @@ __after_proc_init:
79 80
80 mov pc, r13 @ clear the BSS and jump 81 mov pc, r13 @ clear the BSS and jump
81 @ to start_kernel 82 @ to start_kernel
83 .ltorg
82 84
83#include "head-common.S" 85#include "head-common.S"
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 8cff73e668b3..9fc9af88c60c 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -407,7 +407,7 @@ static void __init early_initrd(char **p)
407} 407}
408__early_param("initrd=", early_initrd); 408__early_param("initrd=", early_initrd);
409 409
410static void __init add_memory(unsigned long start, unsigned long size) 410static void __init arm_add_memory(unsigned long start, unsigned long size)
411{ 411{
412 /* 412 /*
413 * Ensure that start/size are aligned to a page boundary. 413 * Ensure that start/size are aligned to a page boundary.
@@ -445,7 +445,7 @@ static void __init early_mem(char **p)
445 if (**p == '@') 445 if (**p == '@')
446 start = memparse(*p + 1, p); 446 start = memparse(*p + 1, p);
447 447
448 add_memory(start, size); 448 arm_add_memory(start, size);
449} 449}
450__early_param("mem=", early_mem); 450__early_param("mem=", early_mem);
451 451
@@ -587,7 +587,7 @@ static int __init parse_tag_mem32(const struct tag *tag)
587 tag->u.mem.start, tag->u.mem.size / 1024); 587 tag->u.mem.start, tag->u.mem.size / 1024);
588 return -EINVAL; 588 return -EINVAL;
589 } 589 }
590 add_memory(tag->u.mem.start, tag->u.mem.size); 590 arm_add_memory(tag->u.mem.start, tag->u.mem.size);
591 return 0; 591 return 0;
592} 592}
593 593
@@ -807,7 +807,7 @@ static int __init topology_init(void)
807{ 807{
808 int cpu; 808 int cpu;
809 809
810 for_each_cpu(cpu) 810 for_each_possible_cpu(cpu)
811 register_cpu(&per_cpu(cpu_data, cpu).cpu, cpu, NULL); 811 register_cpu(&per_cpu(cpu_data, cpu).cpu, cpu, NULL);
812 812
813 return 0; 813 return 0;
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index a0888e160e3b..00b761ff0f9c 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -91,7 +91,7 @@ static void ixp4xx_config_irq(unsigned irq, enum ixp4xx_irq_type type);
91/* 91/*
92 * IRQ -> GPIO mapping table 92 * IRQ -> GPIO mapping table
93 */ 93 */
94static char irq2gpio[32] = { 94static signed char irq2gpio[32] = {
95 -1, -1, -1, -1, -1, -1, 0, 1, 95 -1, -1, -1, -1, -1, -1, 0, 1,
96 -1, -1, -1, -1, -1, -1, -1, -1, 96 -1, -1, -1, -1, -1, -1, -1, -1,
97 -1, -1, -1, 2, 3, 4, 5, 6, 97 -1, -1, -1, 2, 3, 4, 5, 6,
diff --git a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c
index febd115dba28..009038c8113e 100644
--- a/arch/arm/vfp/vfpdouble.c
+++ b/arch/arm/vfp/vfpdouble.c
@@ -197,7 +197,7 @@ u32 vfp_double_normaliseround(int dd, struct vfp_double *vd, u32 fpscr, u32 exce
197 dd, d, exceptions); 197 dd, d, exceptions);
198 vfp_put_double(dd, d); 198 vfp_put_double(dd, d);
199 } 199 }
200 return exceptions & ~VFP_NAN_FLAG; 200 return exceptions;
201} 201}
202 202
203/* 203/*
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 22f3da4e0829..37ff8145b5b5 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -180,7 +180,7 @@ static u32 vfp_emulate_instruction(u32 inst, u32 fpscr, struct pt_regs *regs)
180 * emulate it. 180 * emulate it.
181 */ 181 */
182 } 182 }
183 return exceptions; 183 return exceptions & ~VFP_NAN_FLAG;
184} 184}
185 185
186/* 186/*
diff --git a/arch/arm/vfp/vfpsingle.c b/arch/arm/vfp/vfpsingle.c
index 4ac27f193934..dae2c2f46052 100644
--- a/arch/arm/vfp/vfpsingle.c
+++ b/arch/arm/vfp/vfpsingle.c
@@ -203,7 +203,7 @@ u32 vfp_single_normaliseround(int sd, struct vfp_single *vs, u32 fpscr, u32 exce
203 vfp_put_float(sd, d); 203 vfp_put_float(sd, d);
204 } 204 }
205 205
206 return exceptions & ~VFP_NAN_FLAG; 206 return exceptions;
207} 207}
208 208
209/* 209/*
diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/i386/kernel/cpu/intel_cacheinfo.c
index 9df87b03612c..c8547a6fa7e6 100644
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -642,7 +642,7 @@ static void __cpuexit cache_remove_dev(struct sys_device * sys_dev)
642 return; 642 return;
643} 643}
644 644
645static int __cpuinit cacheinfo_cpu_callback(struct notifier_block *nfb, 645static int cacheinfo_cpu_callback(struct notifier_block *nfb,
646 unsigned long action, void *hcpu) 646 unsigned long action, void *hcpu)
647{ 647{
648 unsigned int cpu = (unsigned long)hcpu; 648 unsigned int cpu = (unsigned long)hcpu;
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index e30798811216..bcb80ca5cf40 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -1610,5 +1610,6 @@ sys_call_table:
1610 data8 sys_get_robust_list 1610 data8 sys_get_robust_list
1611 data8 sys_sync_file_range // 1300 1611 data8 sys_sync_file_range // 1300
1612 data8 sys_tee 1612 data8 sys_tee
1613 data8 sys_vmsplice
1613 1614
1614 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls 1615 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
index 6386f63c413e..859fb37ff49b 100644
--- a/arch/ia64/kernel/palinfo.c
+++ b/arch/ia64/kernel/palinfo.c
@@ -959,7 +959,7 @@ remove_palinfo_proc_entries(unsigned int hcpu)
959 } 959 }
960} 960}
961 961
962static int __devinit palinfo_cpu_callback(struct notifier_block *nfb, 962static int palinfo_cpu_callback(struct notifier_block *nfb,
963 unsigned long action, 963 unsigned long action,
964 void *hcpu) 964 void *hcpu)
965{ 965{
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
index 9d5a823479a3..663a186ad194 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@ -572,7 +572,7 @@ static struct file_operations salinfo_data_fops = {
572}; 572};
573 573
574#ifdef CONFIG_HOTPLUG_CPU 574#ifdef CONFIG_HOTPLUG_CPU
575static int __devinit 575static int
576salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) 576salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)
577{ 577{
578 unsigned int i, cpu = (unsigned long)hcpu; 578 unsigned int i, cpu = (unsigned long)hcpu;
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index b47476d655f1..7da4739f536e 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -429,7 +429,7 @@ static int __cpuinit cache_remove_dev(struct sys_device * sys_dev)
429 * When a cpu is hot-plugged, do a check and initiate 429 * When a cpu is hot-plugged, do a check and initiate
430 * cache kobject if necessary 430 * cache kobject if necessary
431 */ 431 */
432static int __cpuinit cache_cpu_callback(struct notifier_block *nfb, 432static int cache_cpu_callback(struct notifier_block *nfb,
433 unsigned long action, void *hcpu) 433 unsigned long action, void *hcpu)
434{ 434{
435 unsigned int cpu = (unsigned long)hcpu; 435 unsigned int cpu = (unsigned long)hcpu;
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 7c953bcc5f6a..a7d2bb3cf835 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -356,73 +356,13 @@ asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high,
356asmlinkage ssize_t sys32_pread(unsigned int fd, char __user * buf, 356asmlinkage ssize_t sys32_pread(unsigned int fd, char __user * buf,
357 size_t count, u32 unused, u64 a4, u64 a5) 357 size_t count, u32 unused, u64 a4, u64 a5)
358{ 358{
359 ssize_t ret; 359 return sys_pread64(fd, buf, count, merge_64(a4, a5));
360 struct file * file;
361 ssize_t (*read)(struct file *, char __user *, size_t, loff_t *);
362 loff_t pos;
363
364 ret = -EBADF;
365 file = fget(fd);
366 if (!file)
367 goto bad_file;
368 if (!(file->f_mode & FMODE_READ))
369 goto out;
370 pos = merge_64(a4, a5);
371 ret = rw_verify_area(READ, file, &pos, count);
372 if (ret < 0)
373 goto out;
374 ret = -EINVAL;
375 if (!file->f_op || !(read = file->f_op->read))
376 goto out;
377 if (pos < 0)
378 goto out;
379 ret = -ESPIPE;
380 if (!(file->f_mode & FMODE_PREAD))
381 goto out;
382 ret = read(file, buf, count, &pos);
383 if (ret > 0)
384 dnotify_parent(file->f_dentry, DN_ACCESS);
385out:
386 fput(file);
387bad_file:
388 return ret;
389} 360}
390 361
391asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char __user * buf, 362asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char __user * buf,
392 size_t count, u32 unused, u64 a4, u64 a5) 363 size_t count, u32 unused, u64 a4, u64 a5)
393{ 364{
394 ssize_t ret; 365 return sys_pwrite64(fd, buf, count, merge_64(a4, a5));
395 struct file * file;
396 ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *);
397 loff_t pos;
398
399 ret = -EBADF;
400 file = fget(fd);
401 if (!file)
402 goto bad_file;
403 if (!(file->f_mode & FMODE_WRITE))
404 goto out;
405 pos = merge_64(a4, a5);
406 ret = rw_verify_area(WRITE, file, &pos, count);
407 if (ret < 0)
408 goto out;
409 ret = -EINVAL;
410 if (!file->f_op || !(write = file->f_op->write))
411 goto out;
412 if (pos < 0)
413 goto out;
414
415 ret = -ESPIPE;
416 if (!(file->f_mode & FMODE_PWRITE))
417 goto out;
418
419 ret = write(file, buf, count, &pos);
420 if (ret > 0)
421 dnotify_parent(file->f_dentry, DN_MODIFY);
422out:
423 fput(file);
424bad_file:
425 return ret;
426} 366}
427 367
428asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, 368asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 19f911c5dd58..910fb3afc0b5 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -138,6 +138,37 @@ config 64BIT
138 enable this option otherwise. The 64bit kernel is significantly bigger 138 enable this option otherwise. The 64bit kernel is significantly bigger
139 and slower than the 32bit one. 139 and slower than the 32bit one.
140 140
141choice
142 prompt "Kernel page size"
143 default PARISC_PAGE_SIZE_4KB if !64BIT
144 default PARISC_PAGE_SIZE_4KB if 64BIT
145# default PARISC_PAGE_SIZE_16KB if 64BIT
146
147config PARISC_PAGE_SIZE_4KB
148 bool "4KB"
149 help
150 This lets you select the page size of the kernel. For best
151 performance, a page size of 16KB is recommended. For best
152 compatibility with 32bit applications, a page size of 4KB should be
153 selected (the vast majority of 32bit binaries work perfectly fine
154 with a larger page size).
155
156 4KB For best 32bit compatibility
157 16KB For best performance
158 64KB For best performance, might give more overhead.
159
160 If you don't know what to do, choose 4KB.
161
162config PARISC_PAGE_SIZE_16KB
163 bool "16KB (EXPERIMENTAL)"
164 depends on PA8X00 && EXPERIMENTAL
165
166config PARISC_PAGE_SIZE_64KB
167 bool "64KB (EXPERIMENTAL)"
168 depends on PA8X00 && EXPERIMENTAL
169
170endchoice
171
141config SMP 172config SMP
142 bool "Symmetric multi-processing support" 173 bool "Symmetric multi-processing support"
143 ---help--- 174 ---help---
diff --git a/arch/parisc/defconfig b/arch/parisc/defconfig
index 59f7bc38e72e..b38b58eb9dc2 100644
--- a/arch/parisc/defconfig
+++ b/arch/parisc/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-pa6 3# Linux kernel version: 2.6.16-pa10
4# Sun Mar 26 19:50:07 2006 4# Sun Apr 2 15:26:38 2006
5# 5#
6CONFIG_PARISC=y 6CONFIG_PARISC=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -25,7 +25,7 @@ CONFIG_LOCALVERSION=""
25# CONFIG_LOCALVERSION_AUTO is not set 25# CONFIG_LOCALVERSION_AUTO is not set
26CONFIG_SWAP=y 26CONFIG_SWAP=y
27CONFIG_SYSVIPC=y 27CONFIG_SYSVIPC=y
28# CONFIG_POSIX_MQUEUE is not set 28CONFIG_POSIX_MQUEUE=y
29# CONFIG_BSD_PROCESS_ACCT is not set 29# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
@@ -35,7 +35,7 @@ CONFIG_INITRAMFS_SOURCE=""
35CONFIG_CC_OPTIMIZE_FOR_SIZE=y 35CONFIG_CC_OPTIMIZE_FOR_SIZE=y
36# CONFIG_EMBEDDED is not set 36# CONFIG_EMBEDDED is not set
37CONFIG_KALLSYMS=y 37CONFIG_KALLSYMS=y
38# CONFIG_KALLSYMS_ALL is not set 38CONFIG_KALLSYMS_ALL=y
39# CONFIG_KALLSYMS_EXTRA_PASS is not set 39# CONFIG_KALLSYMS_EXTRA_PASS is not set
40CONFIG_HOTPLUG=y 40CONFIG_HOTPLUG=y
41CONFIG_PRINTK=y 41CONFIG_PRINTK=y
@@ -57,7 +57,13 @@ CONFIG_BASE_SMALL=0
57# 57#
58# Loadable module support 58# Loadable module support
59# 59#
60# CONFIG_MODULES is not set 60CONFIG_MODULES=y
61CONFIG_MODULE_UNLOAD=y
62CONFIG_MODULE_FORCE_UNLOAD=y
63CONFIG_OBSOLETE_MODPARM=y
64# CONFIG_MODVERSIONS is not set
65# CONFIG_MODULE_SRCVERSION_ALL is not set
66CONFIG_KMOD=y
61 67
62# 68#
63# Block layer 69# Block layer
@@ -79,16 +85,19 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
79# 85#
80# Processor type and features 86# Processor type and features
81# 87#
82CONFIG_PA7000=y 88# CONFIG_PA7000 is not set
83# CONFIG_PA7100LC is not set 89CONFIG_PA7100LC=y
84# CONFIG_PA7200 is not set 90# CONFIG_PA7200 is not set
85# CONFIG_PA7300LC is not set 91# CONFIG_PA7300LC is not set
86# CONFIG_PA8X00 is not set 92# CONFIG_PA8X00 is not set
87CONFIG_PA11=y 93CONFIG_PA11=y
94CONFIG_PARISC_PAGE_SIZE_4KB=y
95# CONFIG_PARISC_PAGE_SIZE_16KB is not set
96# CONFIG_PARISC_PAGE_SIZE_64KB is not set
88# CONFIG_SMP is not set 97# CONFIG_SMP is not set
89CONFIG_ARCH_FLATMEM_ENABLE=y 98CONFIG_ARCH_FLATMEM_ENABLE=y
90CONFIG_PREEMPT_NONE=y 99# CONFIG_PREEMPT_NONE is not set
91# CONFIG_PREEMPT_VOLUNTARY is not set 100CONFIG_PREEMPT_VOLUNTARY=y
92# CONFIG_PREEMPT is not set 101# CONFIG_PREEMPT is not set
93# CONFIG_HZ_100 is not set 102# CONFIG_HZ_100 is not set
94CONFIG_HZ_250=y 103CONFIG_HZ_250=y
@@ -108,7 +117,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4096
108# Bus options (PCI, PCMCIA, EISA, GSC, ISA) 117# Bus options (PCI, PCMCIA, EISA, GSC, ISA)
109# 118#
110CONFIG_GSC=y 119CONFIG_GSC=y
111CONFIG_HPPB=y 120# CONFIG_HPPB is not set
112CONFIG_IOMMU_CCIO=y 121CONFIG_IOMMU_CCIO=y
113CONFIG_GSC_LASI=y 122CONFIG_GSC_LASI=y
114CONFIG_GSC_WAX=y 123CONFIG_GSC_WAX=y
@@ -126,7 +135,25 @@ CONFIG_IOMMU_SBA=y
126# 135#
127# PCCARD (PCMCIA/CardBus) support 136# PCCARD (PCMCIA/CardBus) support
128# 137#
129# CONFIG_PCCARD is not set 138CONFIG_PCCARD=y
139# CONFIG_PCMCIA_DEBUG is not set
140CONFIG_PCMCIA=y
141CONFIG_PCMCIA_LOAD_CIS=y
142CONFIG_PCMCIA_IOCTL=y
143CONFIG_CARDBUS=y
144
145#
146# PC-card bridges
147#
148CONFIG_YENTA=y
149CONFIG_YENTA_O2=y
150CONFIG_YENTA_RICOH=y
151CONFIG_YENTA_TI=y
152CONFIG_YENTA_ENE_TUNE=y
153CONFIG_YENTA_TOSHIBA=y
154CONFIG_PD6729=y
155CONFIG_I82092=y
156CONFIG_PCCARD_NONSTATIC=y
130 157
131# 158#
132# PCI Hotplug Support 159# PCI Hotplug Support
@@ -145,7 +172,7 @@ CONFIG_PDC_STABLE=y
145# Executable file formats 172# Executable file formats
146# 173#
147CONFIG_BINFMT_ELF=y 174CONFIG_BINFMT_ELF=y
148# CONFIG_BINFMT_MISC is not set 175CONFIG_BINFMT_MISC=m
149 176
150# 177#
151# Networking 178# Networking
@@ -159,13 +186,15 @@ CONFIG_NET=y
159CONFIG_PACKET=y 186CONFIG_PACKET=y
160CONFIG_PACKET_MMAP=y 187CONFIG_PACKET_MMAP=y
161CONFIG_UNIX=y 188CONFIG_UNIX=y
162# CONFIG_NET_KEY is not set 189CONFIG_XFRM=y
190CONFIG_XFRM_USER=m
191CONFIG_NET_KEY=m
163CONFIG_INET=y 192CONFIG_INET=y
164CONFIG_IP_MULTICAST=y 193CONFIG_IP_MULTICAST=y
165# CONFIG_IP_ADVANCED_ROUTER is not set 194# CONFIG_IP_ADVANCED_ROUTER is not set
166CONFIG_IP_FIB_HASH=y 195CONFIG_IP_FIB_HASH=y
167CONFIG_IP_PNP=y 196CONFIG_IP_PNP=y
168# CONFIG_IP_PNP_DHCP is not set 197CONFIG_IP_PNP_DHCP=y
169CONFIG_IP_PNP_BOOTP=y 198CONFIG_IP_PNP_BOOTP=y
170# CONFIG_IP_PNP_RARP is not set 199# CONFIG_IP_PNP_RARP is not set
171# CONFIG_NET_IPIP is not set 200# CONFIG_NET_IPIP is not set
@@ -173,19 +202,20 @@ CONFIG_IP_PNP_BOOTP=y
173# CONFIG_IP_MROUTE is not set 202# CONFIG_IP_MROUTE is not set
174# CONFIG_ARPD is not set 203# CONFIG_ARPD is not set
175# CONFIG_SYN_COOKIES is not set 204# CONFIG_SYN_COOKIES is not set
176# CONFIG_INET_AH is not set 205CONFIG_INET_AH=m
177# CONFIG_INET_ESP is not set 206CONFIG_INET_ESP=m
178# CONFIG_INET_IPCOMP is not set 207# CONFIG_INET_IPCOMP is not set
179# CONFIG_INET_TUNNEL is not set 208CONFIG_INET_TUNNEL=m
180# CONFIG_INET_DIAG is not set 209CONFIG_INET_DIAG=m
210CONFIG_INET_TCP_DIAG=m
181# CONFIG_TCP_CONG_ADVANCED is not set 211# CONFIG_TCP_CONG_ADVANCED is not set
182CONFIG_TCP_CONG_BIC=y 212CONFIG_TCP_CONG_BIC=y
183CONFIG_IPV6=y 213CONFIG_IPV6=y
184# CONFIG_IPV6_PRIVACY is not set 214# CONFIG_IPV6_PRIVACY is not set
185# CONFIG_INET6_AH is not set 215CONFIG_INET6_AH=y
186# CONFIG_INET6_ESP is not set 216CONFIG_INET6_ESP=y
187# CONFIG_INET6_IPCOMP is not set 217CONFIG_INET6_IPCOMP=y
188# CONFIG_INET6_TUNNEL is not set 218CONFIG_INET6_TUNNEL=y
189# CONFIG_IPV6_TUNNEL is not set 219# CONFIG_IPV6_TUNNEL is not set
190# CONFIG_NETFILTER is not set 220# CONFIG_NETFILTER is not set
191 221
@@ -207,7 +237,8 @@ CONFIG_IPV6=y
207# CONFIG_BRIDGE is not set 237# CONFIG_BRIDGE is not set
208# CONFIG_VLAN_8021Q is not set 238# CONFIG_VLAN_8021Q is not set
209# CONFIG_DECNET is not set 239# CONFIG_DECNET is not set
210# CONFIG_LLC2 is not set 240CONFIG_LLC=m
241CONFIG_LLC2=m
211# CONFIG_IPX is not set 242# CONFIG_IPX is not set
212# CONFIG_ATALK is not set 243# CONFIG_ATALK is not set
213# CONFIG_X25 is not set 244# CONFIG_X25 is not set
@@ -237,9 +268,9 @@ CONFIG_IPV6=y
237# 268#
238# Generic Driver Options 269# Generic Driver Options
239# 270#
240CONFIG_STANDALONE=y 271# CONFIG_STANDALONE is not set
241CONFIG_PREVENT_FIRMWARE_BUILD=y 272# CONFIG_PREVENT_FIRMWARE_BUILD is not set
242# CONFIG_FW_LOADER is not set 273CONFIG_FW_LOADER=y
243# CONFIG_DEBUG_DRIVER is not set 274# CONFIG_DEBUG_DRIVER is not set
244 275
245# 276#
@@ -256,13 +287,14 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
256# Parallel port support 287# Parallel port support
257# 288#
258CONFIG_PARPORT=y 289CONFIG_PARPORT=y
259CONFIG_PARPORT_PC=y 290CONFIG_PARPORT_PC=m
260# CONFIG_PARPORT_SERIAL is not set 291# CONFIG_PARPORT_SERIAL is not set
261# CONFIG_PARPORT_PC_FIFO is not set 292# CONFIG_PARPORT_PC_FIFO is not set
262# CONFIG_PARPORT_PC_SUPERIO is not set 293# CONFIG_PARPORT_PC_SUPERIO is not set
294CONFIG_PARPORT_PC_PCMCIA=m
263CONFIG_PARPORT_NOT_PC=y 295CONFIG_PARPORT_NOT_PC=y
264CONFIG_PARPORT_GSC=y 296CONFIG_PARPORT_GSC=y
265# CONFIG_PARPORT_1284 is not set 297CONFIG_PARPORT_1284=y
266 298
267# 299#
268# Plug and Play support 300# Plug and Play support
@@ -284,7 +316,7 @@ CONFIG_BLK_DEV_CRYPTOLOOP=y
284# CONFIG_BLK_DEV_UB is not set 316# CONFIG_BLK_DEV_UB is not set
285CONFIG_BLK_DEV_RAM=y 317CONFIG_BLK_DEV_RAM=y
286CONFIG_BLK_DEV_RAM_COUNT=16 318CONFIG_BLK_DEV_RAM_COUNT=16
287CONFIG_BLK_DEV_RAM_SIZE=4096 319CONFIG_BLK_DEV_RAM_SIZE=6144
288CONFIG_BLK_DEV_INITRD=y 320CONFIG_BLK_DEV_INITRD=y
289# CONFIG_CDROM_PKTCDVD is not set 321# CONFIG_CDROM_PKTCDVD is not set
290# CONFIG_ATA_OVER_ETH is not set 322# CONFIG_ATA_OVER_ETH is not set
@@ -292,7 +324,60 @@ CONFIG_BLK_DEV_INITRD=y
292# 324#
293# ATA/ATAPI/MFM/RLL support 325# ATA/ATAPI/MFM/RLL support
294# 326#
295# CONFIG_IDE is not set 327CONFIG_IDE=y
328CONFIG_BLK_DEV_IDE=y
329
330#
331# Please see Documentation/ide.txt for help/info on IDE drives
332#
333# CONFIG_BLK_DEV_IDE_SATA is not set
334CONFIG_BLK_DEV_IDEDISK=y
335CONFIG_IDEDISK_MULTI_MODE=y
336CONFIG_BLK_DEV_IDECS=y
337CONFIG_BLK_DEV_IDECD=y
338# CONFIG_BLK_DEV_IDETAPE is not set
339# CONFIG_BLK_DEV_IDEFLOPPY is not set
340CONFIG_BLK_DEV_IDESCSI=y
341# CONFIG_IDE_TASK_IOCTL is not set
342
343#
344# IDE chipset support/bugfixes
345#
346CONFIG_IDE_GENERIC=y
347CONFIG_BLK_DEV_IDEPCI=y
348CONFIG_IDEPCI_SHARE_IRQ=y
349# CONFIG_BLK_DEV_OFFBOARD is not set
350CONFIG_BLK_DEV_GENERIC=y
351# CONFIG_BLK_DEV_OPTI621 is not set
352CONFIG_BLK_DEV_IDEDMA_PCI=y
353# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
354# CONFIG_IDEDMA_PCI_AUTO is not set
355# CONFIG_BLK_DEV_AEC62XX is not set
356# CONFIG_BLK_DEV_ALI15X3 is not set
357# CONFIG_BLK_DEV_AMD74XX is not set
358# CONFIG_BLK_DEV_CMD64X is not set
359# CONFIG_BLK_DEV_TRIFLEX is not set
360# CONFIG_BLK_DEV_CY82C693 is not set
361# CONFIG_BLK_DEV_CS5520 is not set
362# CONFIG_BLK_DEV_CS5530 is not set
363# CONFIG_BLK_DEV_HPT34X is not set
364# CONFIG_BLK_DEV_HPT366 is not set
365# CONFIG_BLK_DEV_SC1200 is not set
366# CONFIG_BLK_DEV_PIIX is not set
367# CONFIG_BLK_DEV_IT821X is not set
368CONFIG_BLK_DEV_NS87415=y
369# CONFIG_BLK_DEV_PDC202XX_OLD is not set
370# CONFIG_BLK_DEV_PDC202XX_NEW is not set
371# CONFIG_BLK_DEV_SVWKS is not set
372# CONFIG_BLK_DEV_SIIMAGE is not set
373# CONFIG_BLK_DEV_SLC90E66 is not set
374# CONFIG_BLK_DEV_TRM290 is not set
375# CONFIG_BLK_DEV_VIA82CXXX is not set
376# CONFIG_IDE_ARM is not set
377CONFIG_BLK_DEV_IDEDMA=y
378# CONFIG_IDEDMA_IVB is not set
379# CONFIG_IDEDMA_AUTO is not set
380# CONFIG_BLK_DEV_HD is not set
296 381
297# 382#
298# SCSI device support 383# SCSI device support
@@ -375,6 +460,15 @@ CONFIG_SCSI_NCR53C8XX_SYNC=20
375# CONFIG_SCSI_DEBUG is not set 460# CONFIG_SCSI_DEBUG is not set
376 461
377# 462#
463# PCMCIA SCSI adapter support
464#
465# CONFIG_PCMCIA_AHA152X is not set
466# CONFIG_PCMCIA_FDOMAIN is not set
467# CONFIG_PCMCIA_NINJA_SCSI is not set
468# CONFIG_PCMCIA_QLOGIC is not set
469# CONFIG_PCMCIA_SYM53C500 is not set
470
471#
378# Multi-device support (RAID and LVM) 472# Multi-device support (RAID and LVM)
379# 473#
380CONFIG_MD=y 474CONFIG_MD=y
@@ -382,12 +476,17 @@ CONFIG_BLK_DEV_MD=y
382CONFIG_MD_LINEAR=y 476CONFIG_MD_LINEAR=y
383CONFIG_MD_RAID0=y 477CONFIG_MD_RAID0=y
384CONFIG_MD_RAID1=y 478CONFIG_MD_RAID1=y
385# CONFIG_MD_RAID10 is not set 479CONFIG_MD_RAID10=y
386CONFIG_MD_RAID5=y 480CONFIG_MD_RAID5=y
387# CONFIG_MD_RAID6 is not set 481CONFIG_MD_RAID6=y
388# CONFIG_MD_MULTIPATH is not set 482# CONFIG_MD_MULTIPATH is not set
389# CONFIG_MD_FAULTY is not set 483# CONFIG_MD_FAULTY is not set
390# CONFIG_BLK_DEV_DM is not set 484CONFIG_BLK_DEV_DM=y
485# CONFIG_DM_CRYPT is not set
486# CONFIG_DM_SNAPSHOT is not set
487# CONFIG_DM_MIRROR is not set
488# CONFIG_DM_ZERO is not set
489# CONFIG_DM_MULTIPATH is not set
391 490
392# 491#
393# Fusion MPT device support 492# Fusion MPT device support
@@ -411,10 +510,10 @@ CONFIG_MD_RAID5=y
411# Network device support 510# Network device support
412# 511#
413CONFIG_NETDEVICES=y 512CONFIG_NETDEVICES=y
414# CONFIG_DUMMY is not set 513CONFIG_DUMMY=m
415# CONFIG_BONDING is not set 514CONFIG_BONDING=m
416# CONFIG_EQUALIZER is not set 515# CONFIG_EQUALIZER is not set
417# CONFIG_TUN is not set 516CONFIG_TUN=m
418 517
419# 518#
420# ARCnet devices 519# ARCnet devices
@@ -430,7 +529,7 @@ CONFIG_NETDEVICES=y
430# Ethernet (10 or 100Mbit) 529# Ethernet (10 or 100Mbit)
431# 530#
432CONFIG_NET_ETHERNET=y 531CONFIG_NET_ETHERNET=y
433# CONFIG_MII is not set 532CONFIG_MII=m
434CONFIG_LASI_82596=y 533CONFIG_LASI_82596=y
435# CONFIG_HAPPYMEAL is not set 534# CONFIG_HAPPYMEAL is not set
436# CONFIG_SUNGEM is not set 535# CONFIG_SUNGEM is not set
@@ -451,6 +550,8 @@ CONFIG_TULIP=y
451# CONFIG_WINBOND_840 is not set 550# CONFIG_WINBOND_840 is not set
452# CONFIG_DM9102 is not set 551# CONFIG_DM9102 is not set
453# CONFIG_ULI526X is not set 552# CONFIG_ULI526X is not set
553# CONFIG_PCMCIA_XIRCOM is not set
554# CONFIG_PCMCIA_XIRTULIP is not set
454# CONFIG_DEPCA is not set 555# CONFIG_DEPCA is not set
455# CONFIG_HP100 is not set 556# CONFIG_HP100 is not set
456CONFIG_NET_PCI=y 557CONFIG_NET_PCI=y
@@ -518,14 +619,33 @@ CONFIG_NET_RADIO=y
518# Obsolete Wireless cards support (pre-802.11) 619# Obsolete Wireless cards support (pre-802.11)
519# 620#
520# CONFIG_STRIP is not set 621# CONFIG_STRIP is not set
622# CONFIG_PCMCIA_WAVELAN is not set
623# CONFIG_PCMCIA_NETWAVE is not set
624
625#
626# Wireless 802.11 Frequency Hopping cards support
627#
628# CONFIG_PCMCIA_RAYCS is not set
521 629
522# 630#
523# Wireless 802.11b ISA/PCI cards support 631# Wireless 802.11b ISA/PCI cards support
524# 632#
525# CONFIG_HERMES is not set 633CONFIG_HERMES=y
634# CONFIG_PLX_HERMES is not set
635# CONFIG_TMD_HERMES is not set
636# CONFIG_NORTEL_HERMES is not set
637# CONFIG_PCI_HERMES is not set
526# CONFIG_ATMEL is not set 638# CONFIG_ATMEL is not set
527 639
528# 640#
641# Wireless 802.11b Pcmcia/Cardbus cards support
642#
643CONFIG_PCMCIA_HERMES=y
644CONFIG_PCMCIA_SPECTRUM=y
645# CONFIG_AIRO_CS is not set
646# CONFIG_PCMCIA_WL3501 is not set
647
648#
529# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support 649# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
530# 650#
531# CONFIG_PRISM54 is not set 651# CONFIG_PRISM54 is not set
@@ -533,13 +653,34 @@ CONFIG_NET_RADIO=y
533CONFIG_NET_WIRELESS=y 653CONFIG_NET_WIRELESS=y
534 654
535# 655#
656# PCMCIA network device support
657#
658CONFIG_NET_PCMCIA=y
659# CONFIG_PCMCIA_3C589 is not set
660# CONFIG_PCMCIA_3C574 is not set
661# CONFIG_PCMCIA_FMVJ18X is not set
662# CONFIG_PCMCIA_PCNET is not set
663# CONFIG_PCMCIA_NMCLAN is not set
664# CONFIG_PCMCIA_SMC91C92 is not set
665# CONFIG_PCMCIA_XIRC2PS is not set
666# CONFIG_PCMCIA_AXNET is not set
667
668#
536# Wan interfaces 669# Wan interfaces
537# 670#
538# CONFIG_WAN is not set 671# CONFIG_WAN is not set
539# CONFIG_FDDI is not set 672# CONFIG_FDDI is not set
540# CONFIG_HIPPI is not set 673# CONFIG_HIPPI is not set
541# CONFIG_PLIP is not set 674# CONFIG_PLIP is not set
542# CONFIG_PPP is not set 675CONFIG_PPP=m
676# CONFIG_PPP_MULTILINK is not set
677# CONFIG_PPP_FILTER is not set
678CONFIG_PPP_ASYNC=m
679CONFIG_PPP_SYNC_TTY=m
680CONFIG_PPP_DEFLATE=m
681CONFIG_PPP_BSDCOMP=m
682# CONFIG_PPP_MPPE is not set
683CONFIG_PPPOE=m
543# CONFIG_SLIP is not set 684# CONFIG_SLIP is not set
544# CONFIG_NET_FC is not set 685# CONFIG_NET_FC is not set
545# CONFIG_SHAPER is not set 686# CONFIG_SHAPER is not set
@@ -571,14 +712,16 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
571CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 712CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
572# CONFIG_INPUT_JOYDEV is not set 713# CONFIG_INPUT_JOYDEV is not set
573# CONFIG_INPUT_TSDEV is not set 714# CONFIG_INPUT_TSDEV is not set
574CONFIG_INPUT_EVDEV=y 715# CONFIG_INPUT_EVDEV is not set
575# CONFIG_INPUT_EVBUG is not set 716# CONFIG_INPUT_EVBUG is not set
576 717
577# 718#
578# Input Device Drivers 719# Input Device Drivers
579# 720#
580CONFIG_INPUT_KEYBOARD=y 721CONFIG_INPUT_KEYBOARD=y
581# CONFIG_KEYBOARD_ATKBD is not set 722CONFIG_KEYBOARD_ATKBD=y
723CONFIG_KEYBOARD_ATKBD_HP_KEYCODES=y
724# CONFIG_KEYBOARD_ATKBD_RDI_KEYCODES is not set
582# CONFIG_KEYBOARD_SUNKBD is not set 725# CONFIG_KEYBOARD_SUNKBD is not set
583# CONFIG_KEYBOARD_LKKBD is not set 726# CONFIG_KEYBOARD_LKKBD is not set
584# CONFIG_KEYBOARD_XTKBD is not set 727# CONFIG_KEYBOARD_XTKBD is not set
@@ -586,52 +729,25 @@ CONFIG_INPUT_KEYBOARD=y
586# CONFIG_KEYBOARD_HIL_OLD is not set 729# CONFIG_KEYBOARD_HIL_OLD is not set
587CONFIG_KEYBOARD_HIL=y 730CONFIG_KEYBOARD_HIL=y
588CONFIG_INPUT_MOUSE=y 731CONFIG_INPUT_MOUSE=y
589# CONFIG_MOUSE_PS2 is not set 732CONFIG_MOUSE_PS2=y
590# CONFIG_MOUSE_SERIAL is not set 733CONFIG_MOUSE_SERIAL=y
591# CONFIG_MOUSE_VSXXXAA is not set 734# CONFIG_MOUSE_VSXXXAA is not set
592CONFIG_MOUSE_HIL=y 735CONFIG_MOUSE_HIL=y
593CONFIG_INPUT_JOYSTICK=y 736# CONFIG_INPUT_JOYSTICK is not set
594# CONFIG_JOYSTICK_ANALOG is not set 737# CONFIG_INPUT_TOUCHSCREEN is not set
595# CONFIG_JOYSTICK_A3D is not set 738# CONFIG_INPUT_MISC is not set
596# CONFIG_JOYSTICK_ADI is not set
597# CONFIG_JOYSTICK_COBRA is not set
598# CONFIG_JOYSTICK_GF2K is not set
599# CONFIG_JOYSTICK_GRIP is not set
600# CONFIG_JOYSTICK_GRIP_MP is not set
601# CONFIG_JOYSTICK_GUILLEMOT is not set
602# CONFIG_JOYSTICK_INTERACT is not set
603# CONFIG_JOYSTICK_SIDEWINDER is not set
604# CONFIG_JOYSTICK_TMDC is not set
605# CONFIG_JOYSTICK_IFORCE is not set
606# CONFIG_JOYSTICK_WARRIOR is not set
607# CONFIG_JOYSTICK_MAGELLAN is not set
608# CONFIG_JOYSTICK_SPACEORB is not set
609# CONFIG_JOYSTICK_SPACEBALL is not set
610# CONFIG_JOYSTICK_STINGER is not set
611# CONFIG_JOYSTICK_TWIDJOY is not set
612# CONFIG_JOYSTICK_DB9 is not set
613# CONFIG_JOYSTICK_GAMECON is not set
614# CONFIG_JOYSTICK_TURBOGRAFX is not set
615# CONFIG_JOYSTICK_JOYDUMP is not set
616CONFIG_INPUT_TOUCHSCREEN=y
617# CONFIG_TOUCHSCREEN_GUNZE is not set
618# CONFIG_TOUCHSCREEN_ELO is not set
619# CONFIG_TOUCHSCREEN_MTOUCH is not set
620# CONFIG_TOUCHSCREEN_MK712 is not set
621CONFIG_INPUT_MISC=y
622# CONFIG_INPUT_UINPUT is not set
623CONFIG_HP_SDC_RTC=y
624 739
625# 740#
626# Hardware I/O ports 741# Hardware I/O ports
627# 742#
628CONFIG_SERIO=y 743CONFIG_SERIO=y
629# CONFIG_SERIO_SERPORT is not set 744CONFIG_SERIO_SERPORT=y
630# CONFIG_SERIO_PARKBD is not set 745# CONFIG_SERIO_PARKBD is not set
631CONFIG_SERIO_GSCPS2=y 746CONFIG_SERIO_GSCPS2=y
632CONFIG_HP_SDC=y 747CONFIG_HP_SDC=y
633CONFIG_HIL_MLC=y 748CONFIG_HIL_MLC=y
634# CONFIG_SERIO_PCIPS2 is not set 749# CONFIG_SERIO_PCIPS2 is not set
750CONFIG_SERIO_LIBPS2=y
635# CONFIG_SERIO_RAW is not set 751# CONFIG_SERIO_RAW is not set
636# CONFIG_GAMEPORT is not set 752# CONFIG_GAMEPORT is not set
637 753
@@ -648,7 +764,8 @@ CONFIG_HW_CONSOLE=y
648# 764#
649CONFIG_SERIAL_8250=y 765CONFIG_SERIAL_8250=y
650CONFIG_SERIAL_8250_CONSOLE=y 766CONFIG_SERIAL_8250_CONSOLE=y
651CONFIG_SERIAL_8250_NR_UARTS=13 767CONFIG_SERIAL_8250_CS=y
768CONFIG_SERIAL_8250_NR_UARTS=17
652CONFIG_SERIAL_8250_RUNTIME_UARTS=4 769CONFIG_SERIAL_8250_RUNTIME_UARTS=4
653CONFIG_SERIAL_8250_EXTENDED=y 770CONFIG_SERIAL_8250_EXTENDED=y
654CONFIG_SERIAL_8250_MANY_PORTS=y 771CONFIG_SERIAL_8250_MANY_PORTS=y
@@ -666,10 +783,10 @@ CONFIG_SERIAL_CORE_CONSOLE=y
666# CONFIG_SERIAL_JSM is not set 783# CONFIG_SERIAL_JSM is not set
667CONFIG_UNIX98_PTYS=y 784CONFIG_UNIX98_PTYS=y
668CONFIG_LEGACY_PTYS=y 785CONFIG_LEGACY_PTYS=y
669CONFIG_LEGACY_PTY_COUNT=256 786CONFIG_LEGACY_PTY_COUNT=64
670CONFIG_PRINTER=y 787CONFIG_PRINTER=m
671# CONFIG_LP_CONSOLE is not set 788# CONFIG_LP_CONSOLE is not set
672# CONFIG_PPDEV is not set 789CONFIG_PPDEV=m
673# CONFIG_TIPAR is not set 790# CONFIG_TIPAR is not set
674 791
675# 792#
@@ -682,7 +799,7 @@ CONFIG_PRINTER=y
682# 799#
683# CONFIG_WATCHDOG is not set 800# CONFIG_WATCHDOG is not set
684CONFIG_GEN_RTC=y 801CONFIG_GEN_RTC=y
685# CONFIG_GEN_RTC_X is not set 802CONFIG_GEN_RTC_X=y
686# CONFIG_DTLK is not set 803# CONFIG_DTLK is not set
687# CONFIG_R3964 is not set 804# CONFIG_R3964 is not set
688# CONFIG_APPLICOM is not set 805# CONFIG_APPLICOM is not set
@@ -691,6 +808,13 @@ CONFIG_GEN_RTC=y
691# Ftape, the floppy tape device driver 808# Ftape, the floppy tape device driver
692# 809#
693# CONFIG_DRM is not set 810# CONFIG_DRM is not set
811
812#
813# PCMCIA character devices
814#
815# CONFIG_SYNCLINK_CS is not set
816# CONFIG_CARDMAN_4000 is not set
817# CONFIG_CARDMAN_4040 is not set
694# CONFIG_RAW_DRIVER is not set 818# CONFIG_RAW_DRIVER is not set
695 819
696# 820#
@@ -718,10 +842,8 @@ CONFIG_GEN_RTC=y
718# 842#
719# Hardware Monitoring support 843# Hardware Monitoring support
720# 844#
721CONFIG_HWMON=y 845# CONFIG_HWMON is not set
722# CONFIG_HWMON_VID is not set 846# CONFIG_HWMON_VID is not set
723# CONFIG_SENSORS_F71805F is not set
724# CONFIG_HWMON_DEBUG_CHIP is not set
725 847
726# 848#
727# Misc devices 849# Misc devices
@@ -749,8 +871,8 @@ CONFIG_FB_CFB_FILLRECT=y
749CONFIG_FB_CFB_COPYAREA=y 871CONFIG_FB_CFB_COPYAREA=y
750CONFIG_FB_CFB_IMAGEBLIT=y 872CONFIG_FB_CFB_IMAGEBLIT=y
751# CONFIG_FB_MACMODES is not set 873# CONFIG_FB_MACMODES is not set
752# CONFIG_FB_MODE_HELPERS is not set 874CONFIG_FB_MODE_HELPERS=y
753# CONFIG_FB_TILEBLITTING is not set 875CONFIG_FB_TILEBLITTING=y
754# CONFIG_FB_CIRRUS is not set 876# CONFIG_FB_CIRRUS is not set
755# CONFIG_FB_PM2 is not set 877# CONFIG_FB_PM2 is not set
756# CONFIG_FB_CYBER2000 is not set 878# CONFIG_FB_CYBER2000 is not set
@@ -778,8 +900,8 @@ CONFIG_FB_STI=y
778# Console display driver support 900# Console display driver support
779# 901#
780CONFIG_DUMMY_CONSOLE=y 902CONFIG_DUMMY_CONSOLE=y
781CONFIG_DUMMY_CONSOLE_COLUMNS=160 903CONFIG_DUMMY_CONSOLE_COLUMNS=128
782CONFIG_DUMMY_CONSOLE_ROWS=64 904CONFIG_DUMMY_CONSOLE_ROWS=48
783CONFIG_FRAMEBUFFER_CONSOLE=y 905CONFIG_FRAMEBUFFER_CONSOLE=y
784# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set 906# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
785CONFIG_STI_CONSOLE=y 907CONFIG_STI_CONSOLE=y
@@ -816,13 +938,14 @@ CONFIG_SOUND=y
816CONFIG_SND=y 938CONFIG_SND=y
817CONFIG_SND_TIMER=y 939CONFIG_SND_TIMER=y
818CONFIG_SND_PCM=y 940CONFIG_SND_PCM=y
941CONFIG_SND_HWDEP=y
819CONFIG_SND_SEQUENCER=y 942CONFIG_SND_SEQUENCER=y
820# CONFIG_SND_SEQ_DUMMY is not set 943# CONFIG_SND_SEQ_DUMMY is not set
821CONFIG_SND_OSSEMUL=y 944CONFIG_SND_OSSEMUL=y
822CONFIG_SND_MIXER_OSS=y 945CONFIG_SND_MIXER_OSS=y
823CONFIG_SND_PCM_OSS=y 946CONFIG_SND_PCM_OSS=y
824CONFIG_SND_SEQUENCER_OSS=y 947CONFIG_SND_SEQUENCER_OSS=y
825# CONFIG_SND_DYNAMIC_MINORS is not set 948CONFIG_SND_DYNAMIC_MINORS=y
826CONFIG_SND_SUPPORT_OLD_API=y 949CONFIG_SND_SUPPORT_OLD_API=y
827# CONFIG_SND_VERBOSE_PRINTK is not set 950# CONFIG_SND_VERBOSE_PRINTK is not set
828# CONFIG_SND_DEBUG is not set 951# CONFIG_SND_DEBUG is not set
@@ -830,6 +953,7 @@ CONFIG_SND_SUPPORT_OLD_API=y
830# 953#
831# Generic devices 954# Generic devices
832# 955#
956CONFIG_SND_OPL3_LIB=y
833CONFIG_SND_AC97_CODEC=y 957CONFIG_SND_AC97_CODEC=y
834CONFIG_SND_AC97_BUS=y 958CONFIG_SND_AC97_BUS=y
835# CONFIG_SND_DUMMY is not set 959# CONFIG_SND_DUMMY is not set
@@ -842,7 +966,7 @@ CONFIG_SND_AC97_BUS=y
842# PCI devices 966# PCI devices
843# 967#
844CONFIG_SND_AD1889=y 968CONFIG_SND_AD1889=y
845# CONFIG_SND_AD1889_OPL3 is not set 969CONFIG_SND_AD1889_OPL3=y
846# CONFIG_SND_ALI5451 is not set 970# CONFIG_SND_ALI5451 is not set
847# CONFIG_SND_ATIIXP is not set 971# CONFIG_SND_ATIIXP is not set
848# CONFIG_SND_ATIIXP_MODEM is not set 972# CONFIG_SND_ATIIXP_MODEM is not set
@@ -890,6 +1014,10 @@ CONFIG_SND_AD1889=y
890# CONFIG_SND_USB_AUDIO is not set 1014# CONFIG_SND_USB_AUDIO is not set
891 1015
892# 1016#
1017# PCMCIA devices
1018#
1019
1020#
893# GSC devices 1021# GSC devices
894# 1022#
895CONFIG_SND_HARMONY=y 1023CONFIG_SND_HARMONY=y
@@ -905,12 +1033,12 @@ CONFIG_SND_HARMONY=y
905CONFIG_USB_ARCH_HAS_HCD=y 1033CONFIG_USB_ARCH_HAS_HCD=y
906CONFIG_USB_ARCH_HAS_OHCI=y 1034CONFIG_USB_ARCH_HAS_OHCI=y
907CONFIG_USB=y 1035CONFIG_USB=y
908CONFIG_USB_DEBUG=y 1036# CONFIG_USB_DEBUG is not set
909 1037
910# 1038#
911# Miscellaneous USB options 1039# Miscellaneous USB options
912# 1040#
913# CONFIG_USB_DEVICEFS is not set 1041CONFIG_USB_DEVICEFS=y
914# CONFIG_USB_BANDWIDTH is not set 1042# CONFIG_USB_BANDWIDTH is not set
915# CONFIG_USB_DYNAMIC_MINORS is not set 1043# CONFIG_USB_DYNAMIC_MINORS is not set
916# CONFIG_USB_OTG is not set 1044# CONFIG_USB_OTG is not set
@@ -918,14 +1046,12 @@ CONFIG_USB_DEBUG=y
918# 1046#
919# USB Host Controller Drivers 1047# USB Host Controller Drivers
920# 1048#
921CONFIG_USB_EHCI_HCD=y 1049# CONFIG_USB_EHCI_HCD is not set
922# CONFIG_USB_EHCI_SPLIT_ISO is not set
923# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
924# CONFIG_USB_ISP116X_HCD is not set 1050# CONFIG_USB_ISP116X_HCD is not set
925CONFIG_USB_OHCI_HCD=y 1051CONFIG_USB_OHCI_HCD=y
926# CONFIG_USB_OHCI_BIG_ENDIAN is not set 1052# CONFIG_USB_OHCI_BIG_ENDIAN is not set
927CONFIG_USB_OHCI_LITTLE_ENDIAN=y 1053CONFIG_USB_OHCI_LITTLE_ENDIAN=y
928# CONFIG_USB_UHCI_HCD is not set 1054CONFIG_USB_UHCI_HCD=y
929# CONFIG_USB_SL811_HCD is not set 1055# CONFIG_USB_SL811_HCD is not set
930 1056
931# 1057#
@@ -948,13 +1074,11 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
948# 1074#
949# USB Input Devices 1075# USB Input Devices
950# 1076#
951# CONFIG_USB_HID is not set 1077CONFIG_USB_HID=y
952 1078CONFIG_USB_HIDINPUT=y
953# 1079# CONFIG_USB_HIDINPUT_POWERBOOK is not set
954# USB HID Boot Protocol drivers 1080# CONFIG_HID_FF is not set
955# 1081# CONFIG_USB_HIDDEV is not set
956# CONFIG_USB_KBD is not set
957# CONFIG_USB_MOUSE is not set
958# CONFIG_USB_AIPTEK is not set 1082# CONFIG_USB_AIPTEK is not set
959# CONFIG_USB_WACOM is not set 1083# CONFIG_USB_WACOM is not set
960# CONFIG_USB_ACECAD is not set 1084# CONFIG_USB_ACECAD is not set
@@ -1020,8 +1144,8 @@ CONFIG_USB_MON=y
1020# CONFIG_USB_PHIDGETKIT is not set 1144# CONFIG_USB_PHIDGETKIT is not set
1021# CONFIG_USB_PHIDGETSERVO is not set 1145# CONFIG_USB_PHIDGETSERVO is not set
1022# CONFIG_USB_IDMOUSE is not set 1146# CONFIG_USB_IDMOUSE is not set
1023# CONFIG_USB_SISUSBVGA is not set
1024# CONFIG_USB_LD is not set 1147# CONFIG_USB_LD is not set
1148# CONFIG_USB_TEST is not set
1025 1149
1026# 1150#
1027# USB DSL modem support 1151# USB DSL modem support
@@ -1058,7 +1182,7 @@ CONFIG_JBD=y
1058# CONFIG_JBD_DEBUG is not set 1182# CONFIG_JBD_DEBUG is not set
1059# CONFIG_REISERFS_FS is not set 1183# CONFIG_REISERFS_FS is not set
1060# CONFIG_JFS_FS is not set 1184# CONFIG_JFS_FS is not set
1061# CONFIG_FS_POSIX_ACL is not set 1185CONFIG_FS_POSIX_ACL=y
1062# CONFIG_XFS_FS is not set 1186# CONFIG_XFS_FS is not set
1063# CONFIG_OCFS2_FS is not set 1187# CONFIG_OCFS2_FS is not set
1064# CONFIG_MINIX_FS is not set 1188# CONFIG_MINIX_FS is not set
@@ -1066,7 +1190,7 @@ CONFIG_JBD=y
1066CONFIG_INOTIFY=y 1190CONFIG_INOTIFY=y
1067# CONFIG_QUOTA is not set 1191# CONFIG_QUOTA is not set
1068CONFIG_DNOTIFY=y 1192CONFIG_DNOTIFY=y
1069# CONFIG_AUTOFS_FS is not set 1193CONFIG_AUTOFS_FS=y
1070# CONFIG_AUTOFS4_FS is not set 1194# CONFIG_AUTOFS4_FS is not set
1071# CONFIG_FUSE_FS is not set 1195# CONFIG_FUSE_FS is not set
1072 1196
@@ -1081,8 +1205,11 @@ CONFIG_JOLIET=y
1081# 1205#
1082# DOS/FAT/NT Filesystems 1206# DOS/FAT/NT Filesystems
1083# 1207#
1208CONFIG_FAT_FS=y
1084# CONFIG_MSDOS_FS is not set 1209# CONFIG_MSDOS_FS is not set
1085# CONFIG_VFAT_FS is not set 1210CONFIG_VFAT_FS=y
1211CONFIG_FAT_DEFAULT_CODEPAGE=437
1212CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1086# CONFIG_NTFS_FS is not set 1213# CONFIG_NTFS_FS is not set
1087 1214
1088# 1215#
@@ -1125,7 +1252,7 @@ CONFIG_NFS_V3=y
1125CONFIG_NFSD=y 1252CONFIG_NFSD=y
1126CONFIG_NFSD_V3=y 1253CONFIG_NFSD_V3=y
1127# CONFIG_NFSD_V3_ACL is not set 1254# CONFIG_NFSD_V3_ACL is not set
1128# CONFIG_NFSD_V4 is not set 1255CONFIG_NFSD_V4=y
1129CONFIG_NFSD_TCP=y 1256CONFIG_NFSD_TCP=y
1130CONFIG_ROOT_NFS=y 1257CONFIG_ROOT_NFS=y
1131CONFIG_LOCKD=y 1258CONFIG_LOCKD=y
@@ -1133,10 +1260,16 @@ CONFIG_LOCKD_V4=y
1133CONFIG_EXPORTFS=y 1260CONFIG_EXPORTFS=y
1134CONFIG_NFS_COMMON=y 1261CONFIG_NFS_COMMON=y
1135CONFIG_SUNRPC=y 1262CONFIG_SUNRPC=y
1136# CONFIG_RPCSEC_GSS_KRB5 is not set 1263CONFIG_SUNRPC_GSS=y
1137# CONFIG_RPCSEC_GSS_SPKM3 is not set 1264CONFIG_RPCSEC_GSS_KRB5=y
1138# CONFIG_SMB_FS is not set 1265CONFIG_RPCSEC_GSS_SPKM3=m
1139# CONFIG_CIFS is not set 1266CONFIG_SMB_FS=m
1267CONFIG_SMB_NLS_DEFAULT=y
1268CONFIG_SMB_NLS_REMOTE="cp437"
1269CONFIG_CIFS=m
1270# CONFIG_CIFS_STATS is not set
1271# CONFIG_CIFS_XATTR is not set
1272# CONFIG_CIFS_EXPERIMENTAL is not set
1140# CONFIG_NCP_FS is not set 1273# CONFIG_NCP_FS is not set
1141# CONFIG_CODA_FS is not set 1274# CONFIG_CODA_FS is not set
1142# CONFIG_AFS_FS is not set 1275# CONFIG_AFS_FS is not set
@@ -1153,50 +1286,50 @@ CONFIG_MSDOS_PARTITION=y
1153# 1286#
1154CONFIG_NLS=y 1287CONFIG_NLS=y
1155CONFIG_NLS_DEFAULT="iso8859-1" 1288CONFIG_NLS_DEFAULT="iso8859-1"
1156# CONFIG_NLS_CODEPAGE_437 is not set 1289CONFIG_NLS_CODEPAGE_437=y
1157# CONFIG_NLS_CODEPAGE_737 is not set 1290CONFIG_NLS_CODEPAGE_737=m
1158# CONFIG_NLS_CODEPAGE_775 is not set 1291CONFIG_NLS_CODEPAGE_775=m
1159# CONFIG_NLS_CODEPAGE_850 is not set 1292CONFIG_NLS_CODEPAGE_850=m
1160# CONFIG_NLS_CODEPAGE_852 is not set 1293CONFIG_NLS_CODEPAGE_852=m
1161# CONFIG_NLS_CODEPAGE_855 is not set 1294CONFIG_NLS_CODEPAGE_855=m
1162# CONFIG_NLS_CODEPAGE_857 is not set 1295CONFIG_NLS_CODEPAGE_857=m
1163# CONFIG_NLS_CODEPAGE_860 is not set 1296CONFIG_NLS_CODEPAGE_860=m
1164# CONFIG_NLS_CODEPAGE_861 is not set 1297CONFIG_NLS_CODEPAGE_861=m
1165# CONFIG_NLS_CODEPAGE_862 is not set 1298CONFIG_NLS_CODEPAGE_862=m
1166# CONFIG_NLS_CODEPAGE_863 is not set 1299CONFIG_NLS_CODEPAGE_863=m
1167# CONFIG_NLS_CODEPAGE_864 is not set 1300CONFIG_NLS_CODEPAGE_864=m
1168# CONFIG_NLS_CODEPAGE_865 is not set 1301CONFIG_NLS_CODEPAGE_865=m
1169# CONFIG_NLS_CODEPAGE_866 is not set 1302CONFIG_NLS_CODEPAGE_866=m
1170# CONFIG_NLS_CODEPAGE_869 is not set 1303CONFIG_NLS_CODEPAGE_869=m
1171# CONFIG_NLS_CODEPAGE_936 is not set 1304CONFIG_NLS_CODEPAGE_936=m
1172# CONFIG_NLS_CODEPAGE_950 is not set 1305CONFIG_NLS_CODEPAGE_950=m
1173# CONFIG_NLS_CODEPAGE_932 is not set 1306CONFIG_NLS_CODEPAGE_932=m
1174# CONFIG_NLS_CODEPAGE_949 is not set 1307CONFIG_NLS_CODEPAGE_949=m
1175# CONFIG_NLS_CODEPAGE_874 is not set 1308CONFIG_NLS_CODEPAGE_874=m
1176# CONFIG_NLS_ISO8859_8 is not set 1309CONFIG_NLS_ISO8859_8=m
1177# CONFIG_NLS_CODEPAGE_1250 is not set 1310CONFIG_NLS_CODEPAGE_1250=y
1178# CONFIG_NLS_CODEPAGE_1251 is not set 1311CONFIG_NLS_CODEPAGE_1251=m
1179# CONFIG_NLS_ASCII is not set 1312CONFIG_NLS_ASCII=m
1180# CONFIG_NLS_ISO8859_1 is not set 1313CONFIG_NLS_ISO8859_1=y
1181# CONFIG_NLS_ISO8859_2 is not set 1314CONFIG_NLS_ISO8859_2=m
1182# CONFIG_NLS_ISO8859_3 is not set 1315CONFIG_NLS_ISO8859_3=m
1183# CONFIG_NLS_ISO8859_4 is not set 1316CONFIG_NLS_ISO8859_4=m
1184# CONFIG_NLS_ISO8859_5 is not set 1317CONFIG_NLS_ISO8859_5=m
1185# CONFIG_NLS_ISO8859_6 is not set 1318CONFIG_NLS_ISO8859_6=m
1186# CONFIG_NLS_ISO8859_7 is not set 1319CONFIG_NLS_ISO8859_7=m
1187# CONFIG_NLS_ISO8859_9 is not set 1320CONFIG_NLS_ISO8859_9=m
1188# CONFIG_NLS_ISO8859_13 is not set 1321CONFIG_NLS_ISO8859_13=m
1189# CONFIG_NLS_ISO8859_14 is not set 1322CONFIG_NLS_ISO8859_14=m
1190# CONFIG_NLS_ISO8859_15 is not set 1323CONFIG_NLS_ISO8859_15=m
1191# CONFIG_NLS_KOI8_R is not set 1324CONFIG_NLS_KOI8_R=m
1192# CONFIG_NLS_KOI8_U is not set 1325CONFIG_NLS_KOI8_U=m
1193# CONFIG_NLS_UTF8 is not set 1326CONFIG_NLS_UTF8=y
1194 1327
1195# 1328#
1196# Profiling support 1329# Profiling support
1197# 1330#
1198CONFIG_PROFILING=y 1331CONFIG_PROFILING=y
1199CONFIG_OPROFILE=y 1332CONFIG_OPROFILE=m
1200 1333
1201# 1334#
1202# Kernel hacking 1335# Kernel hacking
@@ -1204,7 +1337,7 @@ CONFIG_OPROFILE=y
1204# CONFIG_PRINTK_TIME is not set 1337# CONFIG_PRINTK_TIME is not set
1205CONFIG_MAGIC_SYSRQ=y 1338CONFIG_MAGIC_SYSRQ=y
1206CONFIG_DEBUG_KERNEL=y 1339CONFIG_DEBUG_KERNEL=y
1207CONFIG_LOG_BUF_SHIFT=15 1340CONFIG_LOG_BUF_SHIFT=16
1208CONFIG_DETECT_SOFTLOCKUP=y 1341CONFIG_DETECT_SOFTLOCKUP=y
1209# CONFIG_SCHEDSTATS is not set 1342# CONFIG_SCHEDSTATS is not set
1210# CONFIG_DEBUG_SLAB is not set 1343# CONFIG_DEBUG_SLAB is not set
@@ -1217,42 +1350,43 @@ CONFIG_DEBUG_MUTEXES=y
1217# CONFIG_DEBUG_VM is not set 1350# CONFIG_DEBUG_VM is not set
1218CONFIG_FORCED_INLINING=y 1351CONFIG_FORCED_INLINING=y
1219# CONFIG_RCU_TORTURE_TEST is not set 1352# CONFIG_RCU_TORTURE_TEST is not set
1220CONFIG_DEBUG_RODATA=y 1353# CONFIG_DEBUG_RODATA is not set
1221 1354
1222# 1355#
1223# Security options 1356# Security options
1224# 1357#
1225# CONFIG_KEYS is not set 1358CONFIG_KEYS=y
1359CONFIG_KEYS_DEBUG_PROC_KEYS=y
1226# CONFIG_SECURITY is not set 1360# CONFIG_SECURITY is not set
1227 1361
1228# 1362#
1229# Cryptographic options 1363# Cryptographic options
1230# 1364#
1231CONFIG_CRYPTO=y 1365CONFIG_CRYPTO=y
1232# CONFIG_CRYPTO_HMAC is not set 1366CONFIG_CRYPTO_HMAC=y
1233# CONFIG_CRYPTO_NULL is not set 1367CONFIG_CRYPTO_NULL=m
1234# CONFIG_CRYPTO_MD4 is not set 1368CONFIG_CRYPTO_MD4=m
1235# CONFIG_CRYPTO_MD5 is not set 1369CONFIG_CRYPTO_MD5=y
1236# CONFIG_CRYPTO_SHA1 is not set 1370CONFIG_CRYPTO_SHA1=y
1237# CONFIG_CRYPTO_SHA256 is not set 1371CONFIG_CRYPTO_SHA256=m
1238# CONFIG_CRYPTO_SHA512 is not set 1372CONFIG_CRYPTO_SHA512=m
1239# CONFIG_CRYPTO_WP512 is not set 1373CONFIG_CRYPTO_WP512=m
1240# CONFIG_CRYPTO_TGR192 is not set 1374CONFIG_CRYPTO_TGR192=m
1241# CONFIG_CRYPTO_DES is not set 1375CONFIG_CRYPTO_DES=y
1242# CONFIG_CRYPTO_BLOWFISH is not set 1376CONFIG_CRYPTO_BLOWFISH=m
1243# CONFIG_CRYPTO_TWOFISH is not set 1377CONFIG_CRYPTO_TWOFISH=m
1244# CONFIG_CRYPTO_SERPENT is not set 1378CONFIG_CRYPTO_SERPENT=m
1245# CONFIG_CRYPTO_AES is not set 1379CONFIG_CRYPTO_AES=m
1246# CONFIG_CRYPTO_CAST5 is not set 1380CONFIG_CRYPTO_CAST5=m
1247# CONFIG_CRYPTO_CAST6 is not set 1381CONFIG_CRYPTO_CAST6=m
1248# CONFIG_CRYPTO_TEA is not set 1382CONFIG_CRYPTO_TEA=m
1249# CONFIG_CRYPTO_ARC4 is not set 1383CONFIG_CRYPTO_ARC4=m
1250# CONFIG_CRYPTO_KHAZAD is not set 1384CONFIG_CRYPTO_KHAZAD=m
1251# CONFIG_CRYPTO_ANUBIS is not set 1385CONFIG_CRYPTO_ANUBIS=m
1252# CONFIG_CRYPTO_DEFLATE is not set 1386CONFIG_CRYPTO_DEFLATE=y
1253# CONFIG_CRYPTO_MICHAEL_MIC is not set 1387CONFIG_CRYPTO_MICHAEL_MIC=m
1254# CONFIG_CRYPTO_CRC32C is not set 1388CONFIG_CRYPTO_CRC32C=m
1255# CONFIG_CRYPTO_TEST is not set 1389CONFIG_CRYPTO_TEST=m
1256 1390
1257# 1391#
1258# Hardware crypto devices 1392# Hardware crypto devices
@@ -1261,7 +1395,9 @@ CONFIG_CRYPTO=y
1261# 1395#
1262# Library routines 1396# Library routines
1263# 1397#
1264# CONFIG_CRC_CCITT is not set 1398CONFIG_CRC_CCITT=m
1265# CONFIG_CRC16 is not set 1399# CONFIG_CRC16 is not set
1266CONFIG_CRC32=y 1400CONFIG_CRC32=y
1267# CONFIG_LIBCRC32C is not set 1401CONFIG_LIBCRC32C=m
1402CONFIG_ZLIB_INFLATE=y
1403CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c
index e23c4e1e3a25..c11a5bc7c067 100644
--- a/arch/parisc/kernel/asm-offsets.c
+++ b/arch/parisc/kernel/asm-offsets.c
@@ -288,8 +288,11 @@ int main(void)
288 DEFINE(ASM_PGD_ENTRY_SIZE, PGD_ENTRY_SIZE); 288 DEFINE(ASM_PGD_ENTRY_SIZE, PGD_ENTRY_SIZE);
289 DEFINE(ASM_PMD_ENTRY_SIZE, PMD_ENTRY_SIZE); 289 DEFINE(ASM_PMD_ENTRY_SIZE, PMD_ENTRY_SIZE);
290 DEFINE(ASM_PTE_ENTRY_SIZE, PTE_ENTRY_SIZE); 290 DEFINE(ASM_PTE_ENTRY_SIZE, PTE_ENTRY_SIZE);
291 DEFINE(ASM_PFN_PTE_SHIFT, PFN_PTE_SHIFT);
291 DEFINE(ASM_PT_INITIAL, PT_INITIAL); 292 DEFINE(ASM_PT_INITIAL, PT_INITIAL);
292 DEFINE(ASM_PAGE_SIZE, PAGE_SIZE); 293 DEFINE(ASM_PAGE_SIZE, PAGE_SIZE);
294 DEFINE(ASM_PAGE_SIZE_DIV64, PAGE_SIZE/64);
295 DEFINE(ASM_PAGE_SIZE_DIV128, PAGE_SIZE/128);
293 BLANK(); 296 BLANK();
294 DEFINE(EXCDATA_IP, offsetof(struct exception_data, fault_ip)); 297 DEFINE(EXCDATA_IP, offsetof(struct exception_data, fault_ip));
295 DEFINE(EXCDATA_SPACE, offsetof(struct exception_data, fault_space)); 298 DEFINE(EXCDATA_SPACE, offsetof(struct exception_data, fault_space));
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index 360b7391cb8c..c057ad7605ba 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -4,7 +4,7 @@
4 * License. See the file "COPYING" in the main directory of this archive 4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details. 5 * for more details.
6 * 6 *
7 * Copyright (C) 1999 Helge Deller (07-13-1999) 7 * Copyright (C) 1999-2006 Helge Deller <deller@gmx.de> (07-13-1999)
8 * Copyright (C) 1999 SuSE GmbH Nuernberg 8 * Copyright (C) 1999 SuSE GmbH Nuernberg
9 * Copyright (C) 2000 Philipp Rumpf (prumpf@tux.org) 9 * Copyright (C) 2000 Philipp Rumpf (prumpf@tux.org)
10 * 10 *
@@ -358,5 +358,5 @@ void parisc_setup_cache_timing(void)
358 if (!parisc_cache_flush_threshold) 358 if (!parisc_cache_flush_threshold)
359 parisc_cache_flush_threshold = FLUSH_THRESHOLD; 359 parisc_cache_flush_threshold = FLUSH_THRESHOLD;
360 360
361 printk("Setting cache flush threshold to %x (%d CPUs online)\n", parisc_cache_flush_threshold, num_online_cpus()); 361 printk(KERN_INFO "Setting cache flush threshold to %x (%d CPUs online)\n", parisc_cache_flush_threshold, num_online_cpus());
362} 362}
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index 7c95d7663c29..d9e53cf0372b 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -502,18 +502,20 @@
502 * all ILP32 processes and all the kernel for machines with 502 * all ILP32 processes and all the kernel for machines with
503 * under 4GB of memory) */ 503 * under 4GB of memory) */
504 .macro L3_ptep pgd,pte,index,va,fault 504 .macro L3_ptep pgd,pte,index,va,fault
505#if PT_NLEVELS == 3 /* we might have a 2-Level scheme, e.g. with 16kb page size */
505 extrd,u \va,63-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index 506 extrd,u \va,63-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index
506 copy %r0,\pte 507 copy %r0,\pte
507 extrd,u,*= \va,31,32,%r0 508 extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0
508 ldw,s \index(\pgd),\pgd 509 ldw,s \index(\pgd),\pgd
509 extrd,u,*= \va,31,32,%r0 510 extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0
510 bb,>=,n \pgd,_PxD_PRESENT_BIT,\fault 511 bb,>=,n \pgd,_PxD_PRESENT_BIT,\fault
511 extrd,u,*= \va,31,32,%r0 512 extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0
512 shld \pgd,PxD_VALUE_SHIFT,\index 513 shld \pgd,PxD_VALUE_SHIFT,\index
513 extrd,u,*= \va,31,32,%r0 514 extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0
514 copy \index,\pgd 515 copy \index,\pgd
515 extrd,u,*<> \va,31,32,%r0 516 extrd,u,*<> \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0
516 ldo ASM_PGD_PMD_OFFSET(\pgd),\pgd 517 ldo ASM_PGD_PMD_OFFSET(\pgd),\pgd
518#endif
517 L2_ptep \pgd,\pte,\index,\va,\fault 519 L2_ptep \pgd,\pte,\index,\va,\fault
518 .endm 520 .endm
519 521
@@ -563,10 +565,18 @@
563 extrd,u,*= \pte,_PAGE_GATEWAY_BIT+32,1,%r0 565 extrd,u,*= \pte,_PAGE_GATEWAY_BIT+32,1,%r0
564 depd %r0,11,2,\prot /* If Gateway, Set PL2 to 0 */ 566 depd %r0,11,2,\prot /* If Gateway, Set PL2 to 0 */
565 567
566 /* Get rid of prot bits and convert to page addr for iitlbt and idtlbt */ 568 /* Enforce uncacheable pages.
569 * This should ONLY be use for MMIO on PA 2.0 machines.
570 * Memory/DMA is cache coherent on all PA2.0 machines we support
571 * (that means T-class is NOT supported) and the memory controllers
572 * on most of those machines only handles cache transactions.
573 */
574 extrd,u,*= \pte,_PAGE_NO_CACHE_BIT+32,1,%r0
575 depi 1,12,1,\prot
567 576
568 depd %r0,63,PAGE_SHIFT,\pte 577 /* Drop prot bits and convert to page addr for iitlbt and idtlbt */
569 extrd,s \pte,(63-PAGE_SHIFT)+(63-58),64-PAGE_SHIFT,\pte 578 extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58),64-PAGE_SHIFT,\pte
579 depdi _PAGE_SIZE_ENCODING_DEFAULT,63,63-58,\pte
570 .endm 580 .endm
571 581
572 /* Identical macro to make_insert_tlb above, except it 582 /* Identical macro to make_insert_tlb above, except it
@@ -584,9 +594,8 @@
584 594
585 /* Get rid of prot bits and convert to page addr for iitlba */ 595 /* Get rid of prot bits and convert to page addr for iitlba */
586 596
587 depi 0,31,PAGE_SHIFT,\pte 597 depi _PAGE_SIZE_ENCODING_DEFAULT,31,ASM_PFN_PTE_SHIFT,\pte
588 extru \pte,24,25,\pte 598 extru \pte,24,25,\pte
589
590 .endm 599 .endm
591 600
592 /* This is for ILP32 PA2.0 only. The TLB insertion needs 601 /* This is for ILP32 PA2.0 only. The TLB insertion needs
@@ -1201,10 +1210,9 @@ intr_save:
1201 */ 1210 */
1202 1211
1203 /* adjust isr/ior. */ 1212 /* adjust isr/ior. */
1204 1213 extrd,u %r16,63,SPACEID_SHIFT,%r1 /* get high bits from isr for ior */
1205 extrd,u %r16,63,7,%r1 /* get high bits from isr for ior */ 1214 depd %r1,31,SPACEID_SHIFT,%r17 /* deposit them into ior */
1206 depd %r1,31,7,%r17 /* deposit them into ior */ 1215 depdi 0,63,SPACEID_SHIFT,%r16 /* clear them from isr */
1207 depdi 0,63,7,%r16 /* clear them from isr */
1208#endif 1216#endif
1209 STREG %r16, PT_ISR(%r29) 1217 STREG %r16, PT_ISR(%r29)
1210 STREG %r17, PT_IOR(%r29) 1218 STREG %r17, PT_IOR(%r29)
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S
index 0b47afc20690..3e79e62f7b0b 100644
--- a/arch/parisc/kernel/head.S
+++ b/arch/parisc/kernel/head.S
@@ -76,16 +76,16 @@ $bss_loop:
76 mtctl %r4,%cr24 /* Initialize kernel root pointer */ 76 mtctl %r4,%cr24 /* Initialize kernel root pointer */
77 mtctl %r4,%cr25 /* Initialize user root pointer */ 77 mtctl %r4,%cr25 /* Initialize user root pointer */
78 78
79#ifdef CONFIG_64BIT 79#if PT_NLEVELS == 3
80 /* Set pmd in pgd */ 80 /* Set pmd in pgd */
81 load32 PA(pmd0),%r5 81 load32 PA(pmd0),%r5
82 shrd %r5,PxD_VALUE_SHIFT,%r3 82 shrd %r5,PxD_VALUE_SHIFT,%r3
83 ldo (PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3 83 ldo (PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3
84 stw %r3,ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4) 84 stw %r3,ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4)
85 ldo ASM_PMD_ENTRY*ASM_PMD_ENTRY_SIZE(%r5),%r4 85 ldo ASM_PMD_ENTRY*ASM_PMD_ENTRY_SIZE(%r5),%r4
86#else 86#else
87 /* 2-level page table, so pmd == pgd */ 87 /* 2-level page table, so pmd == pgd */
88 ldo ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4),%r4 88 ldo ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4),%r4
89#endif 89#endif
90 90
91 /* Fill in pmd with enough pte directories */ 91 /* Fill in pmd with enough pte directories */
@@ -99,7 +99,7 @@ $bss_loop:
99 stw %r3,0(%r4) 99 stw %r3,0(%r4)
100 ldo (ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3 100 ldo (ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3
101 addib,> -1,%r1,1b 101 addib,> -1,%r1,1b
102#ifdef CONFIG_64BIT 102#if PT_NLEVELS == 3
103 ldo ASM_PMD_ENTRY_SIZE(%r4),%r4 103 ldo ASM_PMD_ENTRY_SIZE(%r4),%r4
104#else 104#else
105 ldo ASM_PGD_ENTRY_SIZE(%r4),%r4 105 ldo ASM_PGD_ENTRY_SIZE(%r4),%r4
@@ -107,13 +107,14 @@ $bss_loop:
107 107
108 108
109 /* Now initialize the PTEs themselves */ 109 /* Now initialize the PTEs themselves */
110 ldo _PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */ 110 ldo 0+_PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */
111 ldi (1<<(KERNEL_INITIAL_ORDER-PAGE_SHIFT)),%r11 /* PFN count */
111 load32 PA(pg0),%r1 112 load32 PA(pg0),%r1
112 113
113$pgt_fill_loop: 114$pgt_fill_loop:
114 STREGM %r3,ASM_PTE_ENTRY_SIZE(%r1) 115 STREGM %r3,ASM_PTE_ENTRY_SIZE(%r1)
115 ldo ASM_PAGE_SIZE(%r3),%r3 116 ldo (1<<PFN_PTE_SHIFT)(%r3),%r3 /* add one PFN */
116 bb,>= %r3,31-KERNEL_INITIAL_ORDER,$pgt_fill_loop 117 addib,> -1,%r11,$pgt_fill_loop
117 nop 118 nop
118 119
119 /* Load the return address...er...crash 'n burn */ 120 /* Load the return address...er...crash 'n burn */
diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c
index 7e898fd64415..8384bf9cecd2 100644
--- a/arch/parisc/kernel/init_task.c
+++ b/arch/parisc/kernel/init_task.c
@@ -53,17 +53,17 @@ union thread_union init_thread_union
53 __attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) = 53 __attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) =
54 { INIT_THREAD_INFO(init_task) }; 54 { INIT_THREAD_INFO(init_task) };
55 55
56#ifdef __LP64__ 56#if PT_NLEVELS == 3
57/* NOTE: This layout exactly conforms to the hybrid L2/L3 page table layout 57/* NOTE: This layout exactly conforms to the hybrid L2/L3 page table layout
58 * with the first pmd adjacent to the pgd and below it. gcc doesn't actually 58 * with the first pmd adjacent to the pgd and below it. gcc doesn't actually
59 * guarantee that global objects will be laid out in memory in the same order 59 * guarantee that global objects will be laid out in memory in the same order
60 * as the order of declaration, so put these in different sections and use 60 * as the order of declaration, so put these in different sections and use
61 * the linker script to order them. */ 61 * the linker script to order them. */
62pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((aligned(PAGE_SIZE))) __attribute__ ((__section__ (".data.vm0.pmd"))) = { {0}, }; 62pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((__section__ (".data.vm0.pmd"), aligned(PAGE_SIZE)));
63
64#endif 63#endif
65pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((aligned(PAGE_SIZE))) __attribute__ ((__section__ (".data.vm0.pgd"))) = { {0}, }; 64
66pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((aligned(PAGE_SIZE))) __attribute__ ((__section__ (".data.vm0.pte"))) = { {0}, }; 65pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((__section__ (".data.vm0.pgd"), aligned(PAGE_SIZE)));
66pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ (".data.vm0.pte"), aligned(PAGE_SIZE)));
67 67
68/* 68/*
69 * Initial task structure. 69 * Initial task structure.
diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S
index 7a4f07e8d3c3..f600556414d1 100644
--- a/arch/parisc/kernel/pacache.S
+++ b/arch/parisc/kernel/pacache.S
@@ -65,7 +65,7 @@ flush_tlb_all_local:
65 */ 65 */
66 66
67 /* pcxt_ssm_bug - relied upon translation! PA 2.0 Arch. F-4 and F-5 */ 67 /* pcxt_ssm_bug - relied upon translation! PA 2.0 Arch. F-4 and F-5 */
68 rsm PSW_SM_I, %r19 /* save I-bit state */ 68 rsm PSW_SM_I, %r19 /* save I-bit state */
69 load32 PA(1f), %r1 69 load32 PA(1f), %r1
70 nop 70 nop
71 nop 71 nop
@@ -84,8 +84,7 @@ flush_tlb_all_local:
84 rfi 84 rfi
85 nop 85 nop
86 86
871: ldil L%PA(cache_info), %r1 871: load32 PA(cache_info), %r1
88 ldo R%PA(cache_info)(%r1), %r1
89 88
90 /* Flush Instruction Tlb */ 89 /* Flush Instruction Tlb */
91 90
@@ -212,8 +211,7 @@ flush_instruction_cache_local:
212 .entry 211 .entry
213 212
214 mtsp %r0, %sr1 213 mtsp %r0, %sr1
215 ldil L%cache_info, %r1 214 load32 cache_info, %r1
216 ldo R%cache_info(%r1), %r1
217 215
218 /* Flush Instruction Cache */ 216 /* Flush Instruction Cache */
219 217
@@ -254,8 +252,7 @@ flush_data_cache_local:
254 .entry 252 .entry
255 253
256 mtsp %r0, %sr1 254 mtsp %r0, %sr1
257 ldil L%cache_info, %r1 255 load32 cache_info, %r1
258 ldo R%cache_info(%r1), %r1
259 256
260 /* Flush Data Cache */ 257 /* Flush Data Cache */
261 258
@@ -303,7 +300,8 @@ copy_user_page_asm:
303 */ 300 */
304 301
305 ldd 0(%r25), %r19 302 ldd 0(%r25), %r19
306 ldi 32, %r1 /* PAGE_SIZE/128 == 32 */ 303 ldi ASM_PAGE_SIZE_DIV128, %r1
304
307 ldw 64(%r25), %r0 /* prefetch 1 cacheline ahead */ 305 ldw 64(%r25), %r0 /* prefetch 1 cacheline ahead */
308 ldw 128(%r25), %r0 /* prefetch 2 */ 306 ldw 128(%r25), %r0 /* prefetch 2 */
309 307
@@ -368,7 +366,7 @@ copy_user_page_asm:
368 * use ldd/std on a 32 bit kernel. 366 * use ldd/std on a 32 bit kernel.
369 */ 367 */
370 ldw 0(%r25), %r19 368 ldw 0(%r25), %r19
371 ldi 64, %r1 /* PAGE_SIZE/64 == 64 */ 369 ldi ASM_PAGE_SIZE_DIV64, %r1
372 370
3731: 3711:
374 ldw 4(%r25), %r20 372 ldw 4(%r25), %r20
@@ -461,6 +459,7 @@ copy_user_page_asm:
461 sub %r25, %r1, %r23 /* move physical addr into non shadowed reg */ 459 sub %r25, %r1, %r23 /* move physical addr into non shadowed reg */
462 460
463 ldil L%(TMPALIAS_MAP_START), %r28 461 ldil L%(TMPALIAS_MAP_START), %r28
462 /* FIXME for different page sizes != 4k */
464#ifdef CONFIG_64BIT 463#ifdef CONFIG_64BIT
465 extrd,u %r26,56,32, %r26 /* convert phys addr to tlb insert format */ 464 extrd,u %r26,56,32, %r26 /* convert phys addr to tlb insert format */
466 extrd,u %r23,56,32, %r23 /* convert phys addr to tlb insert format */ 465 extrd,u %r23,56,32, %r23 /* convert phys addr to tlb insert format */
@@ -551,6 +550,7 @@ __clear_user_page_asm:
551#ifdef CONFIG_64BIT 550#ifdef CONFIG_64BIT
552#if (TMPALIAS_MAP_START >= 0x80000000) 551#if (TMPALIAS_MAP_START >= 0x80000000)
553 depdi 0, 31,32, %r28 /* clear any sign extension */ 552 depdi 0, 31,32, %r28 /* clear any sign extension */
553 /* FIXME: page size dependend */
554#endif 554#endif
555 extrd,u %r26, 56,32, %r26 /* convert phys addr to tlb insert format */ 555 extrd,u %r26, 56,32, %r26 /* convert phys addr to tlb insert format */
556 depd %r25, 63,22, %r28 /* Form aliased virtual address 'to' */ 556 depd %r25, 63,22, %r28 /* Form aliased virtual address 'to' */
@@ -566,10 +566,10 @@ __clear_user_page_asm:
566 pdtlb 0(%r28) 566 pdtlb 0(%r28)
567 567
568#ifdef CONFIG_64BIT 568#ifdef CONFIG_64BIT
569 ldi 32, %r1 /* PAGE_SIZE/128 == 32 */ 569 ldi ASM_PAGE_SIZE_DIV128, %r1
570 570
571 /* PREFETCH (Write) has not (yet) been proven to help here */ 571 /* PREFETCH (Write) has not (yet) been proven to help here */
572/* #define PREFETCHW_OP ldd 256(%0), %r0 */ 572 /* #define PREFETCHW_OP ldd 256(%0), %r0 */
573 573
5741: std %r0, 0(%r28) 5741: std %r0, 0(%r28)
575 std %r0, 8(%r28) 575 std %r0, 8(%r28)
@@ -591,8 +591,7 @@ __clear_user_page_asm:
591 ldo 128(%r28), %r28 591 ldo 128(%r28), %r28
592 592
593#else /* ! CONFIG_64BIT */ 593#else /* ! CONFIG_64BIT */
594 594 ldi ASM_PAGE_SIZE_DIV64, %r1
595 ldi 64, %r1 /* PAGE_SIZE/64 == 64 */
596 595
5971: 5961:
598 stw %r0, 0(%r28) 597 stw %r0, 0(%r28)
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
index d15a1d53e101..8b5df98e2b31 100644
--- a/arch/parisc/kernel/sys_parisc.c
+++ b/arch/parisc/kernel/sys_parisc.c
@@ -231,6 +231,14 @@ asmlinkage long parisc_fadvise64_64(int fd,
231 (loff_t)high_len << 32 | low_len, advice); 231 (loff_t)high_len << 32 | low_len, advice);
232} 232}
233 233
234asmlinkage long parisc_sync_file_range(int fd,
235 u32 hi_off, u32 lo_off, u32 hi_nbytes, u32 lo_nbytes,
236 unsigned int flags)
237{
238 return sys_sync_file_range(fd, (loff_t)hi_off << 32 | lo_off,
239 (loff_t)hi_nbytes << 32 | lo_nbytes, flags);
240}
241
234asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr, unsigned long len, int prot, int flag) 242asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr, unsigned long len, int prot, int flag)
235{ 243{
236 return -ENOMEM; 244 return -ENOMEM;
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index af88afef41bd..479d9a017cd1 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -55,7 +55,7 @@
55 * pointers. 55 * pointers.
56 */ 56 */
57 57
58 .align 4096 58 .align ASM_PAGE_SIZE
59linux_gateway_page: 59linux_gateway_page:
60 60
61 /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */ 61 /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */
@@ -632,7 +632,7 @@ cas_action:
632end_compare_and_swap: 632end_compare_and_swap:
633 633
634 /* Make sure nothing else is placed on this page */ 634 /* Make sure nothing else is placed on this page */
635 .align 4096 635 .align ASM_PAGE_SIZE
636 .export end_linux_gateway_page 636 .export end_linux_gateway_page
637end_linux_gateway_page: 637end_linux_gateway_page:
638 638
@@ -652,7 +652,7 @@ end_linux_gateway_page:
652 652
653 .section .rodata,"a" 653 .section .rodata,"a"
654 654
655 .align 4096 655 .align ASM_PAGE_SIZE
656 /* Light-weight-syscall table */ 656 /* Light-weight-syscall table */
657 /* Start of lws table. */ 657 /* Start of lws table. */
658 .export lws_table 658 .export lws_table
@@ -662,14 +662,14 @@ lws_table:
662 LWS_ENTRY(compare_and_swap64) /* 1 - ELF64 Atomic compare and swap */ 662 LWS_ENTRY(compare_and_swap64) /* 1 - ELF64 Atomic compare and swap */
663 /* End of lws table */ 663 /* End of lws table */
664 664
665 .align 4096 665 .align ASM_PAGE_SIZE
666 .export sys_call_table 666 .export sys_call_table
667.Lsys_call_table: 667.Lsys_call_table:
668sys_call_table: 668sys_call_table:
669#include "syscall_table.S" 669#include "syscall_table.S"
670 670
671#ifdef CONFIG_64BIT 671#ifdef CONFIG_64BIT
672 .align 4096 672 .align ASM_PAGE_SIZE
673 .export sys_call_table64 673 .export sys_call_table64
674.Lsys_call_table64: 674.Lsys_call_table64:
675sys_call_table64: 675sys_call_table64:
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index bbeeb614cfab..e27b432f90a8 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -13,7 +13,7 @@
13 * Copyright (C) 2001 Helge Deller <deller at parisc-linux.org> 13 * Copyright (C) 2001 Helge Deller <deller at parisc-linux.org>
14 * Copyright (C) 2000-2001 Thomas Bogendoerfer <tsbogend at parisc-linux.org> 14 * Copyright (C) 2000-2001 Thomas Bogendoerfer <tsbogend at parisc-linux.org>
15 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org> 15 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
16 * 16 * Copyright (C) 2005-2006 Kyle McMartin <kyle at parisc-linux.org>
17 * 17 *
18 * This program is free software; you can redistribute it and/or modify 18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by 19 * it under the terms of the GNU General Public License as published by
@@ -393,5 +393,11 @@
393 ENTRY_SAME(readlinkat) /* 285 */ 393 ENTRY_SAME(readlinkat) /* 285 */
394 ENTRY_SAME(fchmodat) 394 ENTRY_SAME(fchmodat)
395 ENTRY_SAME(faccessat) 395 ENTRY_SAME(faccessat)
396 ENTRY_SAME(unshare)
397 ENTRY_COMP(set_robust_list)
398 ENTRY_COMP(get_robust_list) /* 290 */
399 ENTRY_SAME(splice)
400 ENTRY_OURS(sync_file_range)
401 ENTRY_SAME(tee)
396 /* Nothing yet */ 402 /* Nothing yet */
397 403
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index 6d6436a6b624..94dcc03a28ed 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -6,6 +6,7 @@
6 * Copyright (C) 2000 Michael Ang <mang with subcarrier.org> 6 * Copyright (C) 2000 Michael Ang <mang with subcarrier.org>
7 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org> 7 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
8 * Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org> 8 * Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org>
9 * Copyright (C) 2006 Helge Deller <deller@gmx.de>
9 * 10 *
10 * 11 *
11 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
@@ -27,6 +28,7 @@
27/* needed for the processor specific cache alignment size */ 28/* needed for the processor specific cache alignment size */
28#include <asm/cache.h> 29#include <asm/cache.h>
29#include <asm/page.h> 30#include <asm/page.h>
31#include <asm/asm-offsets.h>
30 32
31/* ld script to make hppa Linux kernel */ 33/* ld script to make hppa Linux kernel */
32#ifndef CONFIG_64BIT 34#ifndef CONFIG_64BIT
@@ -68,7 +70,7 @@ SECTIONS
68 RODATA 70 RODATA
69 71
70 /* writeable */ 72 /* writeable */
71 . = ALIGN(4096); /* Make sure this is page aligned so 73 . = ALIGN(ASM_PAGE_SIZE); /* Make sure this is page aligned so
72 that we can properly leave these 74 that we can properly leave these
73 as writable */ 75 as writable */
74 data_start = .; 76 data_start = .;
@@ -81,23 +83,17 @@ SECTIONS
81 __start___unwind = .; /* unwind info */ 83 __start___unwind = .; /* unwind info */
82 .PARISC.unwind : { *(.PARISC.unwind) } 84 .PARISC.unwind : { *(.PARISC.unwind) }
83 __stop___unwind = .; 85 __stop___unwind = .;
84 86
87 /* rarely changed data like cpu maps */
88 . = ALIGN(16);
89 .data.read_mostly : { *(.data.read_mostly) }
90
91 . = ALIGN(L1_CACHE_BYTES);
85 .data : { /* Data */ 92 .data : { /* Data */
86 *(.data) 93 *(.data)
87 *(.data.vm0.pmd)
88 *(.data.vm0.pgd)
89 *(.data.vm0.pte)
90 CONSTRUCTORS 94 CONSTRUCTORS
91 } 95 }
92 96
93 . = ALIGN(4096);
94 /* nosave data is really only used for software suspend...it's here
95 * just in case we ever implement it */
96 __nosave_begin = .;
97 .data_nosave : { *(.data.nosave) }
98 . = ALIGN(4096);
99 __nosave_end = .;
100
101 . = ALIGN(L1_CACHE_BYTES); 97 . = ALIGN(L1_CACHE_BYTES);
102 .data.cacheline_aligned : { *(.data.cacheline_aligned) } 98 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
103 99
@@ -105,12 +101,29 @@ SECTIONS
105 . = ALIGN(16); 101 . = ALIGN(16);
106 .data.lock_aligned : { *(.data.lock_aligned) } 102 .data.lock_aligned : { *(.data.lock_aligned) }
107 103
108 /* rarely changed data like cpu maps */ 104 . = ALIGN(ASM_PAGE_SIZE);
109 . = ALIGN(16); 105 /* nosave data is really only used for software suspend...it's here
110 .data.read_mostly : { *(.data.read_mostly) } 106 * just in case we ever implement it */
107 __nosave_begin = .;
108 .data_nosave : { *(.data.nosave) }
109 . = ALIGN(ASM_PAGE_SIZE);
110 __nosave_end = .;
111 111
112 _edata = .; /* End of data section */ 112 _edata = .; /* End of data section */
113 113
114 __bss_start = .; /* BSS */
115 /* page table entries need to be PAGE_SIZE aligned */
116 . = ALIGN(ASM_PAGE_SIZE);
117 .data.vmpages : {
118 *(.data.vm0.pmd)
119 *(.data.vm0.pgd)
120 *(.data.vm0.pte)
121 }
122 .bss : { *(.bss) *(COMMON) }
123 __bss_stop = .;
124
125
126 /* assembler code expects init_task to be 16k aligned */
114 . = ALIGN(16384); /* init_task */ 127 . = ALIGN(16384); /* init_task */
115 .data.init_task : { *(.data.init_task) } 128 .data.init_task : { *(.data.init_task) }
116 129
@@ -126,6 +139,7 @@ SECTIONS
126 .dlt : { *(.dlt) } 139 .dlt : { *(.dlt) }
127#endif 140#endif
128 141
142 /* reserve space for interrupt stack by aligning __init* to 16k */
129 . = ALIGN(16384); 143 . = ALIGN(16384);
130 __init_begin = .; 144 __init_begin = .;
131 .init.text : { 145 .init.text : {
@@ -166,7 +180,7 @@ SECTIONS
166 from .altinstructions and .eh_frame */ 180 from .altinstructions and .eh_frame */
167 .exit.text : { *(.exit.text) } 181 .exit.text : { *(.exit.text) }
168 .exit.data : { *(.exit.data) } 182 .exit.data : { *(.exit.data) }
169 . = ALIGN(4096); 183 . = ALIGN(ASM_PAGE_SIZE);
170 __initramfs_start = .; 184 __initramfs_start = .;
171 .init.ramfs : { *(.init.ramfs) } 185 .init.ramfs : { *(.init.ramfs) }
172 __initramfs_end = .; 186 __initramfs_end = .;
@@ -174,14 +188,10 @@ SECTIONS
174 __per_cpu_start = .; 188 __per_cpu_start = .;
175 .data.percpu : { *(.data.percpu) } 189 .data.percpu : { *(.data.percpu) }
176 __per_cpu_end = .; 190 __per_cpu_end = .;
177 . = ALIGN(4096); 191 . = ALIGN(ASM_PAGE_SIZE);
178 __init_end = .; 192 __init_end = .;
179 /* freed after init ends here */ 193 /* freed after init ends here */
180 194
181 __bss_start = .; /* BSS */
182 .bss : { *(.bss) *(COMMON) }
183 __bss_stop = .;
184
185 _end = . ; 195 _end = . ;
186 196
187 /* Sections to be discarded */ 197 /* Sections to be discarded */
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index 0ad945d4c0a4..64785e46f93b 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -186,7 +186,7 @@ good_area:
186 break; 186 break;
187 case VM_FAULT_SIGBUS: 187 case VM_FAULT_SIGBUS:
188 /* 188 /*
189 * We hit a hared mapping outside of the file, or some 189 * We hit a shared mapping outside of the file, or some
190 * other thing happened to us that made us unable to 190 * other thing happened to us that made us unable to
191 * handle the page fault gracefully. 191 * handle the page fault gracefully.
192 */ 192 */
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 3796be67cd53..631712562656 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -6,6 +6,7 @@
6 * changed by Philipp Rumpf 6 * changed by Philipp Rumpf
7 * Copyright 1999 Philipp Rumpf (prumpf@tux.org) 7 * Copyright 1999 Philipp Rumpf (prumpf@tux.org)
8 * Copyright 2004 Randolph Chung (tausq@debian.org) 8 * Copyright 2004 Randolph Chung (tausq@debian.org)
9 * Copyright 2006 Helge Deller (deller@gmx.de)
9 * 10 *
10 */ 11 */
11 12
@@ -371,8 +372,8 @@ static void __init setup_bootmem(void)
371 372
372void free_initmem(void) 373void free_initmem(void)
373{ 374{
374 unsigned long addr; 375 unsigned long addr, init_begin, init_end;
375 376
376 printk(KERN_INFO "Freeing unused kernel memory: "); 377 printk(KERN_INFO "Freeing unused kernel memory: ");
377 378
378#ifdef CONFIG_DEBUG_KERNEL 379#ifdef CONFIG_DEBUG_KERNEL
@@ -395,8 +396,11 @@ void free_initmem(void)
395 local_irq_enable(); 396 local_irq_enable();
396#endif 397#endif
397 398
398 addr = (unsigned long)(&__init_begin); 399 /* align __init_begin and __init_end to page size,
399 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { 400 ignoring linker script where we might have tried to save RAM */
401 init_begin = PAGE_ALIGN((unsigned long)(&__init_begin));
402 init_end = PAGE_ALIGN((unsigned long)(&__init_end));
403 for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) {
400 ClearPageReserved(virt_to_page(addr)); 404 ClearPageReserved(virt_to_page(addr));
401 init_page_count(virt_to_page(addr)); 405 init_page_count(virt_to_page(addr));
402 free_page(addr); 406 free_page(addr);
@@ -407,7 +411,7 @@ void free_initmem(void)
407 /* set up a new led state on systems shipped LED State panel */ 411 /* set up a new led state on systems shipped LED State panel */
408 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE); 412 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE);
409 413
410 printk("%luk freed\n", (unsigned long)(&__init_end - &__init_begin) >> 10); 414 printk("%luk freed\n", (init_end - init_begin) >> 10);
411} 415}
412 416
413 417
@@ -639,11 +643,13 @@ static void __init map_pages(unsigned long start_vaddr, unsigned long start_padd
639 * Map the fault vector writable so we can 643 * Map the fault vector writable so we can
640 * write the HPMC checksum. 644 * write the HPMC checksum.
641 */ 645 */
646#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)
642 if (address >= ro_start && address < ro_end 647 if (address >= ro_start && address < ro_end
643 && address != fv_addr 648 && address != fv_addr
644 && address != gw_addr) 649 && address != gw_addr)
645 pte = __mk_pte(address, PAGE_KERNEL_RO); 650 pte = __mk_pte(address, PAGE_KERNEL_RO);
646 else 651 else
652#endif
647 pte = __mk_pte(address, pgprot); 653 pte = __mk_pte(address, pgprot);
648 654
649 if (address >= end_paddr) 655 if (address >= end_paddr)
@@ -874,8 +880,7 @@ unsigned long alloc_sid(void)
874 flush_tlb_all(); /* flush_tlb_all() calls recycle_sids() */ 880 flush_tlb_all(); /* flush_tlb_all() calls recycle_sids() */
875 spin_lock(&sid_lock); 881 spin_lock(&sid_lock);
876 } 882 }
877 if (free_space_ids == 0) 883 BUG_ON(free_space_ids == 0);
878 BUG();
879 } 884 }
880 885
881 free_space_ids--; 886 free_space_ids--;
@@ -899,8 +904,7 @@ void free_sid(unsigned long spaceid)
899 904
900 spin_lock(&sid_lock); 905 spin_lock(&sid_lock);
901 906
902 if (*dirty_space_offset & (1L << index)) 907 BUG_ON(*dirty_space_offset & (1L << index)); /* attempt to free space id twice */
903 BUG(); /* attempt to free space id twice */
904 908
905 *dirty_space_offset |= (1L << index); 909 *dirty_space_offset |= (1L << index);
906 dirty_space_ids++; 910 dirty_space_ids++;
@@ -975,7 +979,7 @@ static void recycle_sids(void)
975 979
976static unsigned long recycle_ndirty; 980static unsigned long recycle_ndirty;
977static unsigned long recycle_dirty_array[SID_ARRAY_SIZE]; 981static unsigned long recycle_dirty_array[SID_ARRAY_SIZE];
978static unsigned int recycle_inuse = 0; 982static unsigned int recycle_inuse;
979 983
980void flush_tlb_all(void) 984void flush_tlb_all(void)
981{ 985{
@@ -984,9 +988,7 @@ void flush_tlb_all(void)
984 do_recycle = 0; 988 do_recycle = 0;
985 spin_lock(&sid_lock); 989 spin_lock(&sid_lock);
986 if (dirty_space_ids > RECYCLE_THRESHOLD) { 990 if (dirty_space_ids > RECYCLE_THRESHOLD) {
987 if (recycle_inuse) { 991 BUG_ON(recycle_inuse); /* FIXME: Use a semaphore/wait queue here */
988 BUG(); /* FIXME: Use a semaphore/wait queue here */
989 }
990 get_dirty_sids(&recycle_ndirty,recycle_dirty_array); 992 get_dirty_sids(&recycle_ndirty,recycle_dirty_array);
991 recycle_inuse++; 993 recycle_inuse++;
992 do_recycle++; 994 do_recycle++;
diff --git a/arch/parisc/mm/ioremap.c b/arch/parisc/mm/ioremap.c
index 0db12818d7bc..27384567a1d0 100644
--- a/arch/parisc/mm/ioremap.c
+++ b/arch/parisc/mm/ioremap.c
@@ -2,7 +2,7 @@
2 * arch/parisc/mm/ioremap.c 2 * arch/parisc/mm/ioremap.c
3 * 3 *
4 * (C) Copyright 1995 1996 Linus Torvalds 4 * (C) Copyright 1995 1996 Linus Torvalds
5 * (C) Copyright 2001 Helge Deller <deller@gmx.de> 5 * (C) Copyright 2001-2006 Helge Deller <deller@gmx.de>
6 * (C) Copyright 2005 Kyle McMartin <kyle@parisc-linux.org> 6 * (C) Copyright 2005 Kyle McMartin <kyle@parisc-linux.org>
7 */ 7 */
8 8
@@ -138,6 +138,7 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l
138 if ((phys_addr >= 0x00080000 && end < 0x000fffff) || 138 if ((phys_addr >= 0x00080000 && end < 0x000fffff) ||
139 (phys_addr >= 0x00500000 && end < 0x03bfffff)) { 139 (phys_addr >= 0x00500000 && end < 0x03bfffff)) {
140 phys_addr |= F_EXTEND(0xfc000000); 140 phys_addr |= F_EXTEND(0xfc000000);
141 flags |= _PAGE_NO_CACHE;
141 } 142 }
142#endif 143#endif
143 144
diff --git a/arch/powerpc/configs/g5_defconfig b/arch/powerpc/configs/g5_defconfig
index 2c3fd2007676..a45627547d03 100644
--- a/arch/powerpc/configs/g5_defconfig
+++ b/arch/powerpc/configs/g5_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc2 3# Linux kernel version: 2.6.17-rc1
4# Fri Feb 10 17:33:08 2006 4# Wed Apr 19 13:24:37 2006
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -9,6 +9,7 @@ CONFIG_PPC_MERGE=y
9CONFIG_MMU=y 9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y 10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_RWSEM_XCHGADD_ALGORITHM=y 11CONFIG_RWSEM_XCHGADD_ALGORITHM=y
12CONFIG_GENERIC_HWEIGHT=y
12CONFIG_GENERIC_CALIBRATE_DELAY=y 13CONFIG_GENERIC_CALIBRATE_DELAY=y
13CONFIG_PPC=y 14CONFIG_PPC=y
14CONFIG_EARLY_PRINTK=y 15CONFIG_EARLY_PRINTK=y
@@ -29,6 +30,7 @@ CONFIG_POWER4=y
29CONFIG_PPC_FPU=y 30CONFIG_PPC_FPU=y
30CONFIG_ALTIVEC=y 31CONFIG_ALTIVEC=y
31CONFIG_PPC_STD_MMU=y 32CONFIG_PPC_STD_MMU=y
33CONFIG_VIRT_CPU_ACCOUNTING=y
32CONFIG_SMP=y 34CONFIG_SMP=y
33CONFIG_NR_CPUS=4 35CONFIG_NR_CPUS=4
34 36
@@ -53,6 +55,7 @@ CONFIG_SYSCTL=y
53CONFIG_IKCONFIG=y 55CONFIG_IKCONFIG=y
54CONFIG_IKCONFIG_PROC=y 56CONFIG_IKCONFIG_PROC=y
55# CONFIG_CPUSETS is not set 57# CONFIG_CPUSETS is not set
58# CONFIG_RELAY is not set
56CONFIG_INITRAMFS_SOURCE="" 59CONFIG_INITRAMFS_SOURCE=""
57CONFIG_CC_OPTIMIZE_FOR_SIZE=y 60CONFIG_CC_OPTIMIZE_FOR_SIZE=y
58# CONFIG_EMBEDDED is not set 61# CONFIG_EMBEDDED is not set
@@ -67,10 +70,6 @@ CONFIG_BASE_FULL=y
67CONFIG_FUTEX=y 70CONFIG_FUTEX=y
68CONFIG_EPOLL=y 71CONFIG_EPOLL=y
69CONFIG_SHMEM=y 72CONFIG_SHMEM=y
70CONFIG_CC_ALIGN_FUNCTIONS=0
71CONFIG_CC_ALIGN_LABELS=0
72CONFIG_CC_ALIGN_LOOPS=0
73CONFIG_CC_ALIGN_JUMPS=0
74CONFIG_SLAB=y 73CONFIG_SLAB=y
75# CONFIG_TINY_SHMEM is not set 74# CONFIG_TINY_SHMEM is not set
76CONFIG_BASE_SMALL=0 75CONFIG_BASE_SMALL=0
@@ -82,7 +81,6 @@ CONFIG_BASE_SMALL=0
82CONFIG_MODULES=y 81CONFIG_MODULES=y
83CONFIG_MODULE_UNLOAD=y 82CONFIG_MODULE_UNLOAD=y
84# CONFIG_MODULE_FORCE_UNLOAD is not set 83# CONFIG_MODULE_FORCE_UNLOAD is not set
85CONFIG_OBSOLETE_MODPARM=y
86CONFIG_MODVERSIONS=y 84CONFIG_MODVERSIONS=y
87CONFIG_MODULE_SRCVERSION_ALL=y 85CONFIG_MODULE_SRCVERSION_ALL=y
88CONFIG_KMOD=y 86CONFIG_KMOD=y
@@ -91,6 +89,7 @@ CONFIG_STOP_MACHINE=y
91# 89#
92# Block layer 90# Block layer
93# 91#
92# CONFIG_BLK_DEV_IO_TRACE is not set
94 93
95# 94#
96# IO Schedulers 95# IO Schedulers
@@ -185,7 +184,6 @@ CONFIG_GENERIC_ISA_DMA=y
185# CONFIG_PPC_INDIRECT_PCI is not set 184# CONFIG_PPC_INDIRECT_PCI is not set
186CONFIG_PCI=y 185CONFIG_PCI=y
187CONFIG_PCI_DOMAINS=y 186CONFIG_PCI_DOMAINS=y
188CONFIG_PCI_LEGACY_PROC=y
189# CONFIG_PCI_DEBUG is not set 187# CONFIG_PCI_DEBUG is not set
190 188
191# 189#
@@ -227,6 +225,7 @@ CONFIG_SYN_COOKIES=y
227CONFIG_INET_AH=m 225CONFIG_INET_AH=m
228CONFIG_INET_ESP=m 226CONFIG_INET_ESP=m
229CONFIG_INET_IPCOMP=m 227CONFIG_INET_IPCOMP=m
228CONFIG_INET_XFRM_TUNNEL=m
230CONFIG_INET_TUNNEL=y 229CONFIG_INET_TUNNEL=y
231CONFIG_INET_DIAG=y 230CONFIG_INET_DIAG=y
232CONFIG_INET_TCP_DIAG=y 231CONFIG_INET_TCP_DIAG=y
@@ -238,6 +237,8 @@ CONFIG_TCP_CONG_BIC=y
238# 237#
239# CONFIG_IP_VS is not set 238# CONFIG_IP_VS is not set
240# CONFIG_IPV6 is not set 239# CONFIG_IPV6 is not set
240# CONFIG_INET6_XFRM_TUNNEL is not set
241# CONFIG_INET6_TUNNEL is not set
241CONFIG_NETFILTER=y 242CONFIG_NETFILTER=y
242# CONFIG_NETFILTER_DEBUG is not set 243# CONFIG_NETFILTER_DEBUG is not set
243 244
@@ -261,6 +262,7 @@ CONFIG_IP_NF_IRC=m
261CONFIG_IP_NF_TFTP=m 262CONFIG_IP_NF_TFTP=m
262CONFIG_IP_NF_AMANDA=m 263CONFIG_IP_NF_AMANDA=m
263# CONFIG_IP_NF_PPTP is not set 264# CONFIG_IP_NF_PPTP is not set
265# CONFIG_IP_NF_H323 is not set
264CONFIG_IP_NF_QUEUE=m 266CONFIG_IP_NF_QUEUE=m
265 267
266# 268#
@@ -513,6 +515,7 @@ CONFIG_MD_RAID0=y
513CONFIG_MD_RAID1=y 515CONFIG_MD_RAID1=y
514CONFIG_MD_RAID10=m 516CONFIG_MD_RAID10=m
515CONFIG_MD_RAID5=y 517CONFIG_MD_RAID5=y
518# CONFIG_MD_RAID5_RESHAPE is not set
516CONFIG_MD_RAID6=m 519CONFIG_MD_RAID6=m
517CONFIG_MD_MULTIPATH=m 520CONFIG_MD_MULTIPATH=m
518CONFIG_MD_FAULTY=m 521CONFIG_MD_FAULTY=m
@@ -761,7 +764,6 @@ CONFIG_LEGACY_PTY_COUNT=256
761# Watchdog Cards 764# Watchdog Cards
762# 765#
763# CONFIG_WATCHDOG is not set 766# CONFIG_WATCHDOG is not set
764# CONFIG_RTC is not set
765CONFIG_GEN_RTC=y 767CONFIG_GEN_RTC=y
766# CONFIG_GEN_RTC_X is not set 768# CONFIG_GEN_RTC_X is not set
767# CONFIG_DTLK is not set 769# CONFIG_DTLK is not set
@@ -772,6 +774,7 @@ CONFIG_GEN_RTC=y
772# Ftape, the floppy tape device driver 774# Ftape, the floppy tape device driver
773# 775#
774CONFIG_AGP=m 776CONFIG_AGP=m
777# CONFIG_AGP_VIA is not set
775CONFIG_AGP_UNINORTH=m 778CONFIG_AGP_UNINORTH=m
776# CONFIG_DRM is not set 779# CONFIG_DRM is not set
777CONFIG_RAW_DRIVER=y 780CONFIG_RAW_DRIVER=y
@@ -813,7 +816,6 @@ CONFIG_I2C_POWERMAC=y
813# CONFIG_I2C_PARPORT_LIGHT is not set 816# CONFIG_I2C_PARPORT_LIGHT is not set
814# CONFIG_I2C_PROSAVAGE is not set 817# CONFIG_I2C_PROSAVAGE is not set
815# CONFIG_I2C_SAVAGE4 is not set 818# CONFIG_I2C_SAVAGE4 is not set
816# CONFIG_SCx200_ACB is not set
817# CONFIG_I2C_SIS5595 is not set 819# CONFIG_I2C_SIS5595 is not set
818# CONFIG_I2C_SIS630 is not set 820# CONFIG_I2C_SIS630 is not set
819# CONFIG_I2C_SIS96X is not set 821# CONFIG_I2C_SIS96X is not set
@@ -832,9 +834,7 @@ CONFIG_I2C_POWERMAC=y
832# CONFIG_SENSORS_PCF8574 is not set 834# CONFIG_SENSORS_PCF8574 is not set
833# CONFIG_SENSORS_PCA9539 is not set 835# CONFIG_SENSORS_PCA9539 is not set
834# CONFIG_SENSORS_PCF8591 is not set 836# CONFIG_SENSORS_PCF8591 is not set
835# CONFIG_SENSORS_RTC8564 is not set
836# CONFIG_SENSORS_MAX6875 is not set 837# CONFIG_SENSORS_MAX6875 is not set
837# CONFIG_RTC_X1205_I2C is not set
838# CONFIG_I2C_DEBUG_CORE is not set 838# CONFIG_I2C_DEBUG_CORE is not set
839# CONFIG_I2C_DEBUG_ALGO is not set 839# CONFIG_I2C_DEBUG_ALGO is not set
840# CONFIG_I2C_DEBUG_BUS is not set 840# CONFIG_I2C_DEBUG_BUS is not set
@@ -862,10 +862,6 @@ CONFIG_I2C_POWERMAC=y
862# 862#
863 863
864# 864#
865# Multimedia Capabilities Port drivers
866#
867
868#
869# Multimedia devices 865# Multimedia devices
870# 866#
871# CONFIG_VIDEO_DEV is not set 867# CONFIG_VIDEO_DEV is not set
@@ -874,6 +870,7 @@ CONFIG_I2C_POWERMAC=y
874# Digital Video Broadcasting Devices 870# Digital Video Broadcasting Devices
875# 871#
876# CONFIG_DVB is not set 872# CONFIG_DVB is not set
873# CONFIG_USB_DABUSB is not set
877 874
878# 875#
879# Graphics support 876# Graphics support
@@ -883,6 +880,7 @@ CONFIG_FB_CFB_FILLRECT=y
883CONFIG_FB_CFB_COPYAREA=y 880CONFIG_FB_CFB_COPYAREA=y
884CONFIG_FB_CFB_IMAGEBLIT=y 881CONFIG_FB_CFB_IMAGEBLIT=y
885CONFIG_FB_MACMODES=y 882CONFIG_FB_MACMODES=y
883CONFIG_FB_FIRMWARE_EDID=y
886CONFIG_FB_MODE_HELPERS=y 884CONFIG_FB_MODE_HELPERS=y
887CONFIG_FB_TILEBLITTING=y 885CONFIG_FB_TILEBLITTING=y
888# CONFIG_FB_CIRRUS is not set 886# CONFIG_FB_CIRRUS is not set
@@ -901,7 +899,6 @@ CONFIG_FB_NVIDIA=y
901CONFIG_FB_NVIDIA_I2C=y 899CONFIG_FB_NVIDIA_I2C=y
902# CONFIG_FB_RIVA is not set 900# CONFIG_FB_RIVA is not set
903# CONFIG_FB_MATROX is not set 901# CONFIG_FB_MATROX is not set
904# CONFIG_FB_RADEON_OLD is not set
905CONFIG_FB_RADEON=y 902CONFIG_FB_RADEON=y
906CONFIG_FB_RADEON_I2C=y 903CONFIG_FB_RADEON_I2C=y
907# CONFIG_FB_RADEON_DEBUG is not set 904# CONFIG_FB_RADEON_DEBUG is not set
@@ -958,9 +955,11 @@ CONFIG_SND_SEQUENCER=m
958CONFIG_SND_OSSEMUL=y 955CONFIG_SND_OSSEMUL=y
959CONFIG_SND_MIXER_OSS=m 956CONFIG_SND_MIXER_OSS=m
960CONFIG_SND_PCM_OSS=m 957CONFIG_SND_PCM_OSS=m
958CONFIG_SND_PCM_OSS_PLUGINS=y
961CONFIG_SND_SEQUENCER_OSS=y 959CONFIG_SND_SEQUENCER_OSS=y
962# CONFIG_SND_DYNAMIC_MINORS is not set 960# CONFIG_SND_DYNAMIC_MINORS is not set
963CONFIG_SND_SUPPORT_OLD_API=y 961CONFIG_SND_SUPPORT_OLD_API=y
962CONFIG_SND_VERBOSE_PROCFS=y
964# CONFIG_SND_VERBOSE_PRINTK is not set 963# CONFIG_SND_VERBOSE_PRINTK is not set
965# CONFIG_SND_DEBUG is not set 964# CONFIG_SND_DEBUG is not set
966 965
@@ -977,6 +976,7 @@ CONFIG_SND_SUPPORT_OLD_API=y
977# PCI devices 976# PCI devices
978# 977#
979# CONFIG_SND_AD1889 is not set 978# CONFIG_SND_AD1889 is not set
979# CONFIG_SND_ALS300 is not set
980# CONFIG_SND_ALS4000 is not set 980# CONFIG_SND_ALS4000 is not set
981# CONFIG_SND_ALI5451 is not set 981# CONFIG_SND_ALI5451 is not set
982# CONFIG_SND_ATIIXP is not set 982# CONFIG_SND_ATIIXP is not set
@@ -1009,6 +1009,7 @@ CONFIG_SND_SUPPORT_OLD_API=y
1009# CONFIG_SND_MIXART is not set 1009# CONFIG_SND_MIXART is not set
1010# CONFIG_SND_NM256 is not set 1010# CONFIG_SND_NM256 is not set
1011# CONFIG_SND_PCXHR is not set 1011# CONFIG_SND_PCXHR is not set
1012# CONFIG_SND_RIPTIDE is not set
1012# CONFIG_SND_RME32 is not set 1013# CONFIG_SND_RME32 is not set
1013# CONFIG_SND_RME96 is not set 1014# CONFIG_SND_RME96 is not set
1014# CONFIG_SND_RME9652 is not set 1015# CONFIG_SND_RME9652 is not set
@@ -1041,6 +1042,7 @@ CONFIG_SND_USB_AUDIO=m
1041# 1042#
1042CONFIG_USB_ARCH_HAS_HCD=y 1043CONFIG_USB_ARCH_HAS_HCD=y
1043CONFIG_USB_ARCH_HAS_OHCI=y 1044CONFIG_USB_ARCH_HAS_OHCI=y
1045CONFIG_USB_ARCH_HAS_EHCI=y
1044CONFIG_USB=y 1046CONFIG_USB=y
1045# CONFIG_USB_DEBUG is not set 1047# CONFIG_USB_DEBUG is not set
1046 1048
@@ -1068,7 +1070,6 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1068# 1070#
1069# USB Device Class drivers 1071# USB Device Class drivers
1070# 1072#
1071# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
1072CONFIG_USB_ACM=m 1073CONFIG_USB_ACM=m
1073CONFIG_USB_PRINTER=y 1074CONFIG_USB_PRINTER=y
1074 1075
@@ -1126,15 +1127,6 @@ CONFIG_USB_HIDDEV=y
1126# CONFIG_USB_MICROTEK is not set 1127# CONFIG_USB_MICROTEK is not set
1127 1128
1128# 1129#
1129# USB Multimedia devices
1130#
1131# CONFIG_USB_DABUSB is not set
1132
1133#
1134# Video4Linux support is needed for USB Multimedia device support
1135#
1136
1137#
1138# USB Network Adapters 1130# USB Network Adapters
1139# 1131#
1140CONFIG_USB_CATC=m 1132CONFIG_USB_CATC=m
@@ -1194,6 +1186,7 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
1194CONFIG_USB_SERIAL_KLSI=m 1186CONFIG_USB_SERIAL_KLSI=m
1195CONFIG_USB_SERIAL_KOBIL_SCT=m 1187CONFIG_USB_SERIAL_KOBIL_SCT=m
1196CONFIG_USB_SERIAL_MCT_U232=m 1188CONFIG_USB_SERIAL_MCT_U232=m
1189# CONFIG_USB_SERIAL_NAVMAN is not set
1197CONFIG_USB_SERIAL_PL2303=m 1190CONFIG_USB_SERIAL_PL2303=m
1198# CONFIG_USB_SERIAL_HP4X is not set 1191# CONFIG_USB_SERIAL_HP4X is not set
1199CONFIG_USB_SERIAL_SAFE=m 1192CONFIG_USB_SERIAL_SAFE=m
@@ -1237,17 +1230,23 @@ CONFIG_USB_EZUSB=y
1237# CONFIG_MMC is not set 1230# CONFIG_MMC is not set
1238 1231
1239# 1232#
1233# LED devices
1234#
1235# CONFIG_NEW_LEDS is not set
1236
1237#
1240# InfiniBand support 1238# InfiniBand support
1241# 1239#
1242# CONFIG_INFINIBAND is not set 1240# CONFIG_INFINIBAND is not set
1243 1241
1244# 1242#
1245# SN Devices 1243# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1246# 1244#
1247 1245
1248# 1246#
1249# EDAC - error detection and reporting (RAS) 1247# Real Time Clock
1250# 1248#
1249# CONFIG_RTC_CLASS is not set
1251 1250
1252# 1251#
1253# File systems 1252# File systems
@@ -1319,7 +1318,6 @@ CONFIG_TMPFS=y
1319CONFIG_HUGETLBFS=y 1318CONFIG_HUGETLBFS=y
1320CONFIG_HUGETLB_PAGE=y 1319CONFIG_HUGETLB_PAGE=y
1321CONFIG_RAMFS=y 1320CONFIG_RAMFS=y
1322# CONFIG_RELAYFS_FS is not set
1323# CONFIG_CONFIGFS_FS is not set 1321# CONFIG_CONFIGFS_FS is not set
1324 1322
1325# 1323#
diff --git a/arch/powerpc/configs/iseries_defconfig b/arch/powerpc/configs/iseries_defconfig
index 1816a46742f6..a95e455a1944 100644
--- a/arch/powerpc/configs/iseries_defconfig
+++ b/arch/powerpc/configs/iseries_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc6 3# Linux kernel version: 2.6.17-rc1
4# Wed Mar 15 16:19:52 2006 4# Wed Apr 19 11:46:44 2006
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -9,6 +9,7 @@ CONFIG_PPC_MERGE=y
9CONFIG_MMU=y 9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y 10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_RWSEM_XCHGADD_ALGORITHM=y 11CONFIG_RWSEM_XCHGADD_ALGORITHM=y
12CONFIG_GENERIC_HWEIGHT=y
12CONFIG_GENERIC_CALIBRATE_DELAY=y 13CONFIG_GENERIC_CALIBRATE_DELAY=y
13CONFIG_PPC=y 14CONFIG_PPC=y
14CONFIG_EARLY_PRINTK=y 15CONFIG_EARLY_PRINTK=y
@@ -30,6 +31,7 @@ CONFIG_POWER4=y
30CONFIG_PPC_FPU=y 31CONFIG_PPC_FPU=y
31# CONFIG_ALTIVEC is not set 32# CONFIG_ALTIVEC is not set
32CONFIG_PPC_STD_MMU=y 33CONFIG_PPC_STD_MMU=y
34CONFIG_VIRT_CPU_ACCOUNTING=y
33CONFIG_SMP=y 35CONFIG_SMP=y
34CONFIG_NR_CPUS=32 36CONFIG_NR_CPUS=32
35 37
@@ -55,6 +57,7 @@ CONFIG_AUDITSYSCALL=y
55CONFIG_IKCONFIG=y 57CONFIG_IKCONFIG=y
56CONFIG_IKCONFIG_PROC=y 58CONFIG_IKCONFIG_PROC=y
57# CONFIG_CPUSETS is not set 59# CONFIG_CPUSETS is not set
60# CONFIG_RELAY is not set
58CONFIG_INITRAMFS_SOURCE="" 61CONFIG_INITRAMFS_SOURCE=""
59CONFIG_CC_OPTIMIZE_FOR_SIZE=y 62CONFIG_CC_OPTIMIZE_FOR_SIZE=y
60# CONFIG_EMBEDDED is not set 63# CONFIG_EMBEDDED is not set
@@ -69,10 +72,6 @@ CONFIG_BASE_FULL=y
69CONFIG_FUTEX=y 72CONFIG_FUTEX=y
70CONFIG_EPOLL=y 73CONFIG_EPOLL=y
71CONFIG_SHMEM=y 74CONFIG_SHMEM=y
72CONFIG_CC_ALIGN_FUNCTIONS=0
73CONFIG_CC_ALIGN_LABELS=0
74CONFIG_CC_ALIGN_LOOPS=0
75CONFIG_CC_ALIGN_JUMPS=0
76CONFIG_SLAB=y 75CONFIG_SLAB=y
77# CONFIG_TINY_SHMEM is not set 76# CONFIG_TINY_SHMEM is not set
78CONFIG_BASE_SMALL=0 77CONFIG_BASE_SMALL=0
@@ -84,7 +83,6 @@ CONFIG_BASE_SMALL=0
84CONFIG_MODULES=y 83CONFIG_MODULES=y
85CONFIG_MODULE_UNLOAD=y 84CONFIG_MODULE_UNLOAD=y
86# CONFIG_MODULE_FORCE_UNLOAD is not set 85# CONFIG_MODULE_FORCE_UNLOAD is not set
87CONFIG_OBSOLETE_MODPARM=y
88CONFIG_MODVERSIONS=y 86CONFIG_MODVERSIONS=y
89CONFIG_MODULE_SRCVERSION_ALL=y 87CONFIG_MODULE_SRCVERSION_ALL=y
90CONFIG_KMOD=y 88CONFIG_KMOD=y
@@ -93,6 +91,7 @@ CONFIG_STOP_MACHINE=y
93# 91#
94# Block layer 92# Block layer
95# 93#
94# CONFIG_BLK_DEV_IO_TRACE is not set
96 95
97# 96#
98# IO Schedulers 97# IO Schedulers
@@ -165,7 +164,6 @@ CONFIG_GENERIC_ISA_DMA=y
165# CONFIG_PPC_INDIRECT_PCI is not set 164# CONFIG_PPC_INDIRECT_PCI is not set
166CONFIG_PCI=y 165CONFIG_PCI=y
167CONFIG_PCI_DOMAINS=y 166CONFIG_PCI_DOMAINS=y
168CONFIG_PCI_LEGACY_PROC=y
169# CONFIG_PCI_DEBUG is not set 167# CONFIG_PCI_DEBUG is not set
170 168
171# 169#
@@ -207,6 +205,7 @@ CONFIG_SYN_COOKIES=y
207CONFIG_INET_AH=m 205CONFIG_INET_AH=m
208CONFIG_INET_ESP=m 206CONFIG_INET_ESP=m
209CONFIG_INET_IPCOMP=m 207CONFIG_INET_IPCOMP=m
208CONFIG_INET_XFRM_TUNNEL=m
210CONFIG_INET_TUNNEL=y 209CONFIG_INET_TUNNEL=y
211CONFIG_INET_DIAG=y 210CONFIG_INET_DIAG=y
212CONFIG_INET_TCP_DIAG=y 211CONFIG_INET_TCP_DIAG=y
@@ -218,6 +217,8 @@ CONFIG_TCP_CONG_BIC=y
218# 217#
219# CONFIG_IP_VS is not set 218# CONFIG_IP_VS is not set
220# CONFIG_IPV6 is not set 219# CONFIG_IPV6 is not set
220# CONFIG_INET6_XFRM_TUNNEL is not set
221# CONFIG_INET6_TUNNEL is not set
221CONFIG_NETFILTER=y 222CONFIG_NETFILTER=y
222# CONFIG_NETFILTER_DEBUG is not set 223# CONFIG_NETFILTER_DEBUG is not set
223 224
@@ -236,11 +237,14 @@ CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
236CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 237CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
237CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m 238CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
238# CONFIG_NETFILTER_XT_MATCH_DCCP is not set 239# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
240# CONFIG_NETFILTER_XT_MATCH_ESP is not set
239CONFIG_NETFILTER_XT_MATCH_HELPER=m 241CONFIG_NETFILTER_XT_MATCH_HELPER=m
240CONFIG_NETFILTER_XT_MATCH_LENGTH=m 242CONFIG_NETFILTER_XT_MATCH_LENGTH=m
241CONFIG_NETFILTER_XT_MATCH_LIMIT=m 243CONFIG_NETFILTER_XT_MATCH_LIMIT=m
242CONFIG_NETFILTER_XT_MATCH_MAC=m 244CONFIG_NETFILTER_XT_MATCH_MAC=m
243CONFIG_NETFILTER_XT_MATCH_MARK=m 245CONFIG_NETFILTER_XT_MATCH_MARK=m
246# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
247# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
244CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 248CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
245CONFIG_NETFILTER_XT_MATCH_REALM=m 249CONFIG_NETFILTER_XT_MATCH_REALM=m
246CONFIG_NETFILTER_XT_MATCH_SCTP=m 250CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -262,20 +266,19 @@ CONFIG_IP_NF_IRC=m
262CONFIG_IP_NF_TFTP=m 266CONFIG_IP_NF_TFTP=m
263CONFIG_IP_NF_AMANDA=m 267CONFIG_IP_NF_AMANDA=m
264# CONFIG_IP_NF_PPTP is not set 268# CONFIG_IP_NF_PPTP is not set
269# CONFIG_IP_NF_H323 is not set
265CONFIG_IP_NF_QUEUE=m 270CONFIG_IP_NF_QUEUE=m
266CONFIG_IP_NF_IPTABLES=m 271CONFIG_IP_NF_IPTABLES=m
267CONFIG_IP_NF_MATCH_IPRANGE=m 272CONFIG_IP_NF_MATCH_IPRANGE=m
268CONFIG_IP_NF_MATCH_MULTIPORT=m
269CONFIG_IP_NF_MATCH_TOS=m 273CONFIG_IP_NF_MATCH_TOS=m
270CONFIG_IP_NF_MATCH_RECENT=m 274CONFIG_IP_NF_MATCH_RECENT=m
271CONFIG_IP_NF_MATCH_ECN=m 275CONFIG_IP_NF_MATCH_ECN=m
272CONFIG_IP_NF_MATCH_DSCP=m 276CONFIG_IP_NF_MATCH_DSCP=m
273CONFIG_IP_NF_MATCH_AH_ESP=m 277# CONFIG_IP_NF_MATCH_AH is not set
274CONFIG_IP_NF_MATCH_TTL=m 278CONFIG_IP_NF_MATCH_TTL=m
275CONFIG_IP_NF_MATCH_OWNER=m 279CONFIG_IP_NF_MATCH_OWNER=m
276CONFIG_IP_NF_MATCH_ADDRTYPE=m 280CONFIG_IP_NF_MATCH_ADDRTYPE=m
277CONFIG_IP_NF_MATCH_HASHLIMIT=m 281CONFIG_IP_NF_MATCH_HASHLIMIT=m
278CONFIG_IP_NF_MATCH_POLICY=m
279CONFIG_IP_NF_FILTER=m 282CONFIG_IP_NF_FILTER=m
280CONFIG_IP_NF_TARGET_REJECT=m 283CONFIG_IP_NF_TARGET_REJECT=m
281CONFIG_IP_NF_TARGET_LOG=m 284CONFIG_IP_NF_TARGET_LOG=m
@@ -479,6 +482,7 @@ CONFIG_MD_RAID0=y
479CONFIG_MD_RAID1=y 482CONFIG_MD_RAID1=y
480CONFIG_MD_RAID10=m 483CONFIG_MD_RAID10=m
481CONFIG_MD_RAID5=y 484CONFIG_MD_RAID5=y
485# CONFIG_MD_RAID5_RESHAPE is not set
482CONFIG_MD_RAID6=m 486CONFIG_MD_RAID6=m
483CONFIG_MD_MULTIPATH=m 487CONFIG_MD_MULTIPATH=m
484CONFIG_MD_FAULTY=m 488CONFIG_MD_FAULTY=m
@@ -702,7 +706,6 @@ CONFIG_LEGACY_PTY_COUNT=256
702# Watchdog Cards 706# Watchdog Cards
703# 707#
704# CONFIG_WATCHDOG is not set 708# CONFIG_WATCHDOG is not set
705# CONFIG_RTC is not set
706CONFIG_GEN_RTC=y 709CONFIG_GEN_RTC=y
707# CONFIG_GEN_RTC_X is not set 710# CONFIG_GEN_RTC_X is not set
708# CONFIG_DTLK is not set 711# CONFIG_DTLK is not set
@@ -751,10 +754,6 @@ CONFIG_MAX_RAW_DEVS=256
751# 754#
752 755
753# 756#
754# Multimedia Capabilities Port drivers
755#
756
757#
758# Multimedia devices 757# Multimedia devices
759# 758#
760# CONFIG_VIDEO_DEV is not set 759# CONFIG_VIDEO_DEV is not set
@@ -779,6 +778,7 @@ CONFIG_MAX_RAW_DEVS=256
779# 778#
780CONFIG_USB_ARCH_HAS_HCD=y 779CONFIG_USB_ARCH_HAS_HCD=y
781CONFIG_USB_ARCH_HAS_OHCI=y 780CONFIG_USB_ARCH_HAS_OHCI=y
781CONFIG_USB_ARCH_HAS_EHCI=y
782# CONFIG_USB is not set 782# CONFIG_USB is not set
783 783
784# 784#
@@ -796,6 +796,11 @@ CONFIG_USB_ARCH_HAS_OHCI=y
796# CONFIG_MMC is not set 796# CONFIG_MMC is not set
797 797
798# 798#
799# LED devices
800#
801# CONFIG_NEW_LEDS is not set
802
803#
799# InfiniBand support 804# InfiniBand support
800# 805#
801# CONFIG_INFINIBAND is not set 806# CONFIG_INFINIBAND is not set
@@ -805,6 +810,11 @@ CONFIG_USB_ARCH_HAS_OHCI=y
805# 810#
806 811
807# 812#
813# Real Time Clock
814#
815# CONFIG_RTC_CLASS is not set
816
817#
808# File systems 818# File systems
809# 819#
810CONFIG_EXT2_FS=y 820CONFIG_EXT2_FS=y
@@ -878,7 +888,6 @@ CONFIG_TMPFS=y
878# CONFIG_HUGETLBFS is not set 888# CONFIG_HUGETLBFS is not set
879# CONFIG_HUGETLB_PAGE is not set 889# CONFIG_HUGETLB_PAGE is not set
880CONFIG_RAMFS=y 890CONFIG_RAMFS=y
881# CONFIG_RELAYFS_FS is not set
882# CONFIG_CONFIGFS_FS is not set 891# CONFIG_CONFIGFS_FS is not set
883 892
884# 893#
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
index daaf038a1faa..58e68ce09b0f 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc2 3# Linux kernel version: 2.6.17-rc1
4# Fri Feb 10 17:33:32 2006 4# Wed Apr 19 11:48:00 2006
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -9,6 +9,7 @@ CONFIG_PPC_MERGE=y
9CONFIG_MMU=y 9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y 10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_RWSEM_XCHGADD_ALGORITHM=y 11CONFIG_RWSEM_XCHGADD_ALGORITHM=y
12CONFIG_GENERIC_HWEIGHT=y
12CONFIG_GENERIC_CALIBRATE_DELAY=y 13CONFIG_GENERIC_CALIBRATE_DELAY=y
13CONFIG_PPC=y 14CONFIG_PPC=y
14CONFIG_EARLY_PRINTK=y 15CONFIG_EARLY_PRINTK=y
@@ -30,6 +31,7 @@ CONFIG_POWER4=y
30CONFIG_PPC_FPU=y 31CONFIG_PPC_FPU=y
31CONFIG_ALTIVEC=y 32CONFIG_ALTIVEC=y
32CONFIG_PPC_STD_MMU=y 33CONFIG_PPC_STD_MMU=y
34CONFIG_VIRT_CPU_ACCOUNTING=y
33CONFIG_SMP=y 35CONFIG_SMP=y
34CONFIG_NR_CPUS=128 36CONFIG_NR_CPUS=128
35 37
@@ -55,6 +57,7 @@ CONFIG_AUDITSYSCALL=y
55CONFIG_IKCONFIG=y 57CONFIG_IKCONFIG=y
56CONFIG_IKCONFIG_PROC=y 58CONFIG_IKCONFIG_PROC=y
57CONFIG_CPUSETS=y 59CONFIG_CPUSETS=y
60# CONFIG_RELAY is not set
58CONFIG_INITRAMFS_SOURCE="" 61CONFIG_INITRAMFS_SOURCE=""
59CONFIG_CC_OPTIMIZE_FOR_SIZE=y 62CONFIG_CC_OPTIMIZE_FOR_SIZE=y
60# CONFIG_EMBEDDED is not set 63# CONFIG_EMBEDDED is not set
@@ -69,10 +72,6 @@ CONFIG_BASE_FULL=y
69CONFIG_FUTEX=y 72CONFIG_FUTEX=y
70CONFIG_EPOLL=y 73CONFIG_EPOLL=y
71CONFIG_SHMEM=y 74CONFIG_SHMEM=y
72CONFIG_CC_ALIGN_FUNCTIONS=0
73CONFIG_CC_ALIGN_LABELS=0
74CONFIG_CC_ALIGN_LOOPS=0
75CONFIG_CC_ALIGN_JUMPS=0
76CONFIG_SLAB=y 75CONFIG_SLAB=y
77# CONFIG_TINY_SHMEM is not set 76# CONFIG_TINY_SHMEM is not set
78CONFIG_BASE_SMALL=0 77CONFIG_BASE_SMALL=0
@@ -84,7 +83,6 @@ CONFIG_BASE_SMALL=0
84CONFIG_MODULES=y 83CONFIG_MODULES=y
85CONFIG_MODULE_UNLOAD=y 84CONFIG_MODULE_UNLOAD=y
86# CONFIG_MODULE_FORCE_UNLOAD is not set 85# CONFIG_MODULE_FORCE_UNLOAD is not set
87CONFIG_OBSOLETE_MODPARM=y
88CONFIG_MODVERSIONS=y 86CONFIG_MODVERSIONS=y
89CONFIG_MODULE_SRCVERSION_ALL=y 87CONFIG_MODULE_SRCVERSION_ALL=y
90CONFIG_KMOD=y 88CONFIG_KMOD=y
@@ -93,6 +91,7 @@ CONFIG_STOP_MACHINE=y
93# 91#
94# Block layer 92# Block layer
95# 93#
94# CONFIG_BLK_DEV_IO_TRACE is not set
96 95
97# 96#
98# IO Schedulers 97# IO Schedulers
@@ -188,7 +187,6 @@ CONFIG_PPC_I8259=y
188# CONFIG_PPC_INDIRECT_PCI is not set 187# CONFIG_PPC_INDIRECT_PCI is not set
189CONFIG_PCI=y 188CONFIG_PCI=y
190CONFIG_PCI_DOMAINS=y 189CONFIG_PCI_DOMAINS=y
191CONFIG_PCI_LEGACY_PROC=y
192# CONFIG_PCI_DEBUG is not set 190# CONFIG_PCI_DEBUG is not set
193 191
194# 192#
@@ -235,6 +233,7 @@ CONFIG_SYN_COOKIES=y
235CONFIG_INET_AH=m 233CONFIG_INET_AH=m
236CONFIG_INET_ESP=m 234CONFIG_INET_ESP=m
237CONFIG_INET_IPCOMP=m 235CONFIG_INET_IPCOMP=m
236CONFIG_INET_XFRM_TUNNEL=m
238CONFIG_INET_TUNNEL=y 237CONFIG_INET_TUNNEL=y
239CONFIG_INET_DIAG=y 238CONFIG_INET_DIAG=y
240CONFIG_INET_TCP_DIAG=y 239CONFIG_INET_TCP_DIAG=y
@@ -246,6 +245,8 @@ CONFIG_TCP_CONG_BIC=y
246# 245#
247# CONFIG_IP_VS is not set 246# CONFIG_IP_VS is not set
248# CONFIG_IPV6 is not set 247# CONFIG_IPV6 is not set
248# CONFIG_INET6_XFRM_TUNNEL is not set
249# CONFIG_INET6_TUNNEL is not set
249CONFIG_NETFILTER=y 250CONFIG_NETFILTER=y
250# CONFIG_NETFILTER_DEBUG is not set 251# CONFIG_NETFILTER_DEBUG is not set
251 252
@@ -272,6 +273,7 @@ CONFIG_IP_NF_IRC=m
272CONFIG_IP_NF_TFTP=m 273CONFIG_IP_NF_TFTP=m
273CONFIG_IP_NF_AMANDA=m 274CONFIG_IP_NF_AMANDA=m
274# CONFIG_IP_NF_PPTP is not set 275# CONFIG_IP_NF_PPTP is not set
276# CONFIG_IP_NF_H323 is not set
275CONFIG_IP_NF_QUEUE=m 277CONFIG_IP_NF_QUEUE=m
276 278
277# 279#
@@ -519,6 +521,7 @@ CONFIG_MD_RAID0=y
519CONFIG_MD_RAID1=y 521CONFIG_MD_RAID1=y
520CONFIG_MD_RAID10=m 522CONFIG_MD_RAID10=m
521CONFIG_MD_RAID5=y 523CONFIG_MD_RAID5=y
524# CONFIG_MD_RAID5_RESHAPE is not set
522CONFIG_MD_RAID6=m 525CONFIG_MD_RAID6=m
523CONFIG_MD_MULTIPATH=m 526CONFIG_MD_MULTIPATH=m
524CONFIG_MD_FAULTY=m 527CONFIG_MD_FAULTY=m
@@ -750,6 +753,7 @@ CONFIG_HW_CONSOLE=y
750# 753#
751CONFIG_SERIAL_8250=y 754CONFIG_SERIAL_8250=y
752CONFIG_SERIAL_8250_CONSOLE=y 755CONFIG_SERIAL_8250_CONSOLE=y
756CONFIG_SERIAL_8250_PCI=y
753CONFIG_SERIAL_8250_NR_UARTS=4 757CONFIG_SERIAL_8250_NR_UARTS=4
754CONFIG_SERIAL_8250_RUNTIME_UARTS=4 758CONFIG_SERIAL_8250_RUNTIME_UARTS=4
755# CONFIG_SERIAL_8250_EXTENDED is not set 759# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -767,7 +771,9 @@ CONFIG_LEGACY_PTY_COUNT=256
767# CONFIG_PRINTER is not set 771# CONFIG_PRINTER is not set
768# CONFIG_PPDEV is not set 772# CONFIG_PPDEV is not set
769# CONFIG_TIPAR is not set 773# CONFIG_TIPAR is not set
774CONFIG_HVC_DRIVER=y
770CONFIG_HVC_CONSOLE=y 775CONFIG_HVC_CONSOLE=y
776# CONFIG_HVC_RTAS is not set
771CONFIG_HVCS=m 777CONFIG_HVCS=m
772 778
773# 779#
@@ -779,7 +785,6 @@ CONFIG_HVCS=m
779# Watchdog Cards 785# Watchdog Cards
780# 786#
781# CONFIG_WATCHDOG is not set 787# CONFIG_WATCHDOG is not set
782# CONFIG_RTC is not set
783CONFIG_GEN_RTC=y 788CONFIG_GEN_RTC=y
784# CONFIG_GEN_RTC_X is not set 789# CONFIG_GEN_RTC_X is not set
785# CONFIG_DTLK is not set 790# CONFIG_DTLK is not set
@@ -830,7 +835,6 @@ CONFIG_I2C_ALGOBIT=y
830# CONFIG_I2C_PARPORT_LIGHT is not set 835# CONFIG_I2C_PARPORT_LIGHT is not set
831# CONFIG_I2C_PROSAVAGE is not set 836# CONFIG_I2C_PROSAVAGE is not set
832# CONFIG_I2C_SAVAGE4 is not set 837# CONFIG_I2C_SAVAGE4 is not set
833# CONFIG_SCx200_ACB is not set
834# CONFIG_I2C_SIS5595 is not set 838# CONFIG_I2C_SIS5595 is not set
835# CONFIG_I2C_SIS630 is not set 839# CONFIG_I2C_SIS630 is not set
836# CONFIG_I2C_SIS96X is not set 840# CONFIG_I2C_SIS96X is not set
@@ -849,9 +853,7 @@ CONFIG_I2C_ALGOBIT=y
849# CONFIG_SENSORS_PCF8574 is not set 853# CONFIG_SENSORS_PCF8574 is not set
850# CONFIG_SENSORS_PCA9539 is not set 854# CONFIG_SENSORS_PCA9539 is not set
851# CONFIG_SENSORS_PCF8591 is not set 855# CONFIG_SENSORS_PCF8591 is not set
852# CONFIG_SENSORS_RTC8564 is not set
853# CONFIG_SENSORS_MAX6875 is not set 856# CONFIG_SENSORS_MAX6875 is not set
854# CONFIG_RTC_X1205_I2C is not set
855# CONFIG_I2C_DEBUG_CORE is not set 857# CONFIG_I2C_DEBUG_CORE is not set
856# CONFIG_I2C_DEBUG_ALGO is not set 858# CONFIG_I2C_DEBUG_ALGO is not set
857# CONFIG_I2C_DEBUG_BUS is not set 859# CONFIG_I2C_DEBUG_BUS is not set
@@ -879,10 +881,6 @@ CONFIG_I2C_ALGOBIT=y
879# 881#
880 882
881# 883#
882# Multimedia Capabilities Port drivers
883#
884
885#
886# Multimedia devices 884# Multimedia devices
887# 885#
888# CONFIG_VIDEO_DEV is not set 886# CONFIG_VIDEO_DEV is not set
@@ -891,6 +889,7 @@ CONFIG_I2C_ALGOBIT=y
891# Digital Video Broadcasting Devices 889# Digital Video Broadcasting Devices
892# 890#
893# CONFIG_DVB is not set 891# CONFIG_DVB is not set
892# CONFIG_USB_DABUSB is not set
894 893
895# 894#
896# Graphics support 895# Graphics support
@@ -900,6 +899,7 @@ CONFIG_FB_CFB_FILLRECT=y
900CONFIG_FB_CFB_COPYAREA=y 899CONFIG_FB_CFB_COPYAREA=y
901CONFIG_FB_CFB_IMAGEBLIT=y 900CONFIG_FB_CFB_IMAGEBLIT=y
902CONFIG_FB_MACMODES=y 901CONFIG_FB_MACMODES=y
902CONFIG_FB_FIRMWARE_EDID=y
903CONFIG_FB_MODE_HELPERS=y 903CONFIG_FB_MODE_HELPERS=y
904CONFIG_FB_TILEBLITTING=y 904CONFIG_FB_TILEBLITTING=y
905# CONFIG_FB_CIRRUS is not set 905# CONFIG_FB_CIRRUS is not set
@@ -919,7 +919,6 @@ CONFIG_FB_MATROX_MYSTIQUE=y
919CONFIG_FB_MATROX_G=y 919CONFIG_FB_MATROX_G=y
920# CONFIG_FB_MATROX_I2C is not set 920# CONFIG_FB_MATROX_I2C is not set
921CONFIG_FB_MATROX_MULTIHEAD=y 921CONFIG_FB_MATROX_MULTIHEAD=y
922# CONFIG_FB_RADEON_OLD is not set
923CONFIG_FB_RADEON=y 922CONFIG_FB_RADEON=y
924CONFIG_FB_RADEON_I2C=y 923CONFIG_FB_RADEON_I2C=y
925# CONFIG_FB_RADEON_DEBUG is not set 924# CONFIG_FB_RADEON_DEBUG is not set
@@ -968,6 +967,7 @@ CONFIG_LCD_DEVICE=y
968# 967#
969CONFIG_USB_ARCH_HAS_HCD=y 968CONFIG_USB_ARCH_HAS_HCD=y
970CONFIG_USB_ARCH_HAS_OHCI=y 969CONFIG_USB_ARCH_HAS_OHCI=y
970CONFIG_USB_ARCH_HAS_EHCI=y
971CONFIG_USB=y 971CONFIG_USB=y
972# CONFIG_USB_DEBUG is not set 972# CONFIG_USB_DEBUG is not set
973 973
@@ -1048,15 +1048,6 @@ CONFIG_USB_HIDDEV=y
1048# CONFIG_USB_MICROTEK is not set 1048# CONFIG_USB_MICROTEK is not set
1049 1049
1050# 1050#
1051# USB Multimedia devices
1052#
1053# CONFIG_USB_DABUSB is not set
1054
1055#
1056# Video4Linux support is needed for USB Multimedia device support
1057#
1058
1059#
1060# USB Network Adapters 1051# USB Network Adapters
1061# 1052#
1062# CONFIG_USB_CATC is not set 1053# CONFIG_USB_CATC is not set
@@ -1109,6 +1100,11 @@ CONFIG_USB_MON=y
1109# CONFIG_MMC is not set 1100# CONFIG_MMC is not set
1110 1101
1111# 1102#
1103# LED devices
1104#
1105# CONFIG_NEW_LEDS is not set
1106
1107#
1112# InfiniBand support 1108# InfiniBand support
1113# 1109#
1114CONFIG_INFINIBAND=m 1110CONFIG_INFINIBAND=m
@@ -1121,12 +1117,13 @@ CONFIG_INFINIBAND_IPOIB=m
1121# CONFIG_INFINIBAND_SRP is not set 1117# CONFIG_INFINIBAND_SRP is not set
1122 1118
1123# 1119#
1124# SN Devices 1120# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1125# 1121#
1126 1122
1127# 1123#
1128# EDAC - error detection and reporting (RAS) 1124# Real Time Clock
1129# 1125#
1126# CONFIG_RTC_CLASS is not set
1130 1127
1131# 1128#
1132# File systems 1129# File systems
@@ -1202,7 +1199,6 @@ CONFIG_TMPFS=y
1202CONFIG_HUGETLBFS=y 1199CONFIG_HUGETLBFS=y
1203CONFIG_HUGETLB_PAGE=y 1200CONFIG_HUGETLB_PAGE=y
1204CONFIG_RAMFS=y 1201CONFIG_RAMFS=y
1205# CONFIG_RELAYFS_FS is not set
1206# CONFIG_CONFIGFS_FS is not set 1202# CONFIG_CONFIGFS_FS is not set
1207 1203
1208# 1204#
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index d9a7fdef59b9..4eba60a32890 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -61,6 +61,7 @@ __setup("iommu=", setup_iommu);
61static unsigned long iommu_range_alloc(struct iommu_table *tbl, 61static unsigned long iommu_range_alloc(struct iommu_table *tbl,
62 unsigned long npages, 62 unsigned long npages,
63 unsigned long *handle, 63 unsigned long *handle,
64 unsigned long mask,
64 unsigned int align_order) 65 unsigned int align_order)
65{ 66{
66 unsigned long n, end, i, start; 67 unsigned long n, end, i, start;
@@ -97,9 +98,21 @@ static unsigned long iommu_range_alloc(struct iommu_table *tbl,
97 */ 98 */
98 if (start >= limit) 99 if (start >= limit)
99 start = largealloc ? tbl->it_largehint : tbl->it_hint; 100 start = largealloc ? tbl->it_largehint : tbl->it_hint;
100 101
101 again: 102 again:
102 103
104 if (limit + tbl->it_offset > mask) {
105 limit = mask - tbl->it_offset + 1;
106 /* If we're constrained on address range, first try
107 * at the masked hint to avoid O(n) search complexity,
108 * but on second pass, start at 0.
109 */
110 if ((start & mask) >= limit || pass > 0)
111 start = 0;
112 else
113 start &= mask;
114 }
115
103 n = find_next_zero_bit(tbl->it_map, limit, start); 116 n = find_next_zero_bit(tbl->it_map, limit, start);
104 117
105 /* Align allocation */ 118 /* Align allocation */
@@ -150,14 +163,14 @@ static unsigned long iommu_range_alloc(struct iommu_table *tbl,
150 163
151static dma_addr_t iommu_alloc(struct iommu_table *tbl, void *page, 164static dma_addr_t iommu_alloc(struct iommu_table *tbl, void *page,
152 unsigned int npages, enum dma_data_direction direction, 165 unsigned int npages, enum dma_data_direction direction,
153 unsigned int align_order) 166 unsigned long mask, unsigned int align_order)
154{ 167{
155 unsigned long entry, flags; 168 unsigned long entry, flags;
156 dma_addr_t ret = DMA_ERROR_CODE; 169 dma_addr_t ret = DMA_ERROR_CODE;
157 170
158 spin_lock_irqsave(&(tbl->it_lock), flags); 171 spin_lock_irqsave(&(tbl->it_lock), flags);
159 172
160 entry = iommu_range_alloc(tbl, npages, NULL, align_order); 173 entry = iommu_range_alloc(tbl, npages, NULL, mask, align_order);
161 174
162 if (unlikely(entry == DMA_ERROR_CODE)) { 175 if (unlikely(entry == DMA_ERROR_CODE)) {
163 spin_unlock_irqrestore(&(tbl->it_lock), flags); 176 spin_unlock_irqrestore(&(tbl->it_lock), flags);
@@ -236,7 +249,7 @@ static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
236 249
237int iommu_map_sg(struct device *dev, struct iommu_table *tbl, 250int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
238 struct scatterlist *sglist, int nelems, 251 struct scatterlist *sglist, int nelems,
239 enum dma_data_direction direction) 252 unsigned long mask, enum dma_data_direction direction)
240{ 253{
241 dma_addr_t dma_next = 0, dma_addr; 254 dma_addr_t dma_next = 0, dma_addr;
242 unsigned long flags; 255 unsigned long flags;
@@ -274,7 +287,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
274 vaddr = (unsigned long)page_address(s->page) + s->offset; 287 vaddr = (unsigned long)page_address(s->page) + s->offset;
275 npages = PAGE_ALIGN(vaddr + slen) - (vaddr & PAGE_MASK); 288 npages = PAGE_ALIGN(vaddr + slen) - (vaddr & PAGE_MASK);
276 npages >>= PAGE_SHIFT; 289 npages >>= PAGE_SHIFT;
277 entry = iommu_range_alloc(tbl, npages, &handle, 0); 290 entry = iommu_range_alloc(tbl, npages, &handle, mask >> PAGE_SHIFT, 0);
278 291
279 DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen); 292 DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen);
280 293
@@ -479,7 +492,8 @@ void iommu_free_table(struct device_node *dn)
479 * byte within the page as vaddr. 492 * byte within the page as vaddr.
480 */ 493 */
481dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, 494dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
482 size_t size, enum dma_data_direction direction) 495 size_t size, unsigned long mask,
496 enum dma_data_direction direction)
483{ 497{
484 dma_addr_t dma_handle = DMA_ERROR_CODE; 498 dma_addr_t dma_handle = DMA_ERROR_CODE;
485 unsigned long uaddr; 499 unsigned long uaddr;
@@ -492,7 +506,8 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
492 npages >>= PAGE_SHIFT; 506 npages >>= PAGE_SHIFT;
493 507
494 if (tbl) { 508 if (tbl) {
495 dma_handle = iommu_alloc(tbl, vaddr, npages, direction, 0); 509 dma_handle = iommu_alloc(tbl, vaddr, npages, direction,
510 mask >> PAGE_SHIFT, 0);
496 if (dma_handle == DMA_ERROR_CODE) { 511 if (dma_handle == DMA_ERROR_CODE) {
497 if (printk_ratelimit()) { 512 if (printk_ratelimit()) {
498 printk(KERN_INFO "iommu_alloc failed, " 513 printk(KERN_INFO "iommu_alloc failed, "
@@ -521,7 +536,7 @@ void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
521 * to the dma address (mapping) of the first page. 536 * to the dma address (mapping) of the first page.
522 */ 537 */
523void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, 538void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
524 dma_addr_t *dma_handle, gfp_t flag) 539 dma_addr_t *dma_handle, unsigned long mask, gfp_t flag)
525{ 540{
526 void *ret = NULL; 541 void *ret = NULL;
527 dma_addr_t mapping; 542 dma_addr_t mapping;
@@ -551,7 +566,8 @@ void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
551 memset(ret, 0, size); 566 memset(ret, 0, size);
552 567
553 /* Set up tces to cover the allocated range */ 568 /* Set up tces to cover the allocated range */
554 mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL, order); 569 mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL,
570 mask >> PAGE_SHIFT, order);
555 if (mapping == DMA_ERROR_CODE) { 571 if (mapping == DMA_ERROR_CODE) {
556 free_pages((unsigned long)ret, order); 572 free_pages((unsigned long)ret, order);
557 ret = NULL; 573 ret = NULL;
diff --git a/arch/powerpc/kernel/pci_iommu.c b/arch/powerpc/kernel/pci_iommu.c
index c336f3e31cff..c1d95e14bbed 100644
--- a/arch/powerpc/kernel/pci_iommu.c
+++ b/arch/powerpc/kernel/pci_iommu.c
@@ -59,6 +59,25 @@ static inline struct iommu_table *devnode_table(struct device *dev)
59} 59}
60 60
61 61
62static inline unsigned long device_to_mask(struct device *hwdev)
63{
64 struct pci_dev *pdev;
65
66 if (!hwdev) {
67 pdev = ppc64_isabridge_dev;
68 if (!pdev) /* This is the best guess we can do */
69 return 0xfffffffful;
70 } else
71 pdev = to_pci_dev(hwdev);
72
73 if (pdev->dma_mask)
74 return pdev->dma_mask;
75
76 /* Assume devices without mask can take 32 bit addresses */
77 return 0xfffffffful;
78}
79
80
62/* Allocates a contiguous real buffer and creates mappings over it. 81/* Allocates a contiguous real buffer and creates mappings over it.
63 * Returns the virtual address of the buffer and sets dma_handle 82 * Returns the virtual address of the buffer and sets dma_handle
64 * to the dma address (mapping) of the first page. 83 * to the dma address (mapping) of the first page.
@@ -67,7 +86,7 @@ static void *pci_iommu_alloc_coherent(struct device *hwdev, size_t size,
67 dma_addr_t *dma_handle, gfp_t flag) 86 dma_addr_t *dma_handle, gfp_t flag)
68{ 87{
69 return iommu_alloc_coherent(devnode_table(hwdev), size, dma_handle, 88 return iommu_alloc_coherent(devnode_table(hwdev), size, dma_handle,
70 flag); 89 device_to_mask(hwdev), flag);
71} 90}
72 91
73static void pci_iommu_free_coherent(struct device *hwdev, size_t size, 92static void pci_iommu_free_coherent(struct device *hwdev, size_t size,
@@ -85,7 +104,8 @@ static void pci_iommu_free_coherent(struct device *hwdev, size_t size,
85static dma_addr_t pci_iommu_map_single(struct device *hwdev, void *vaddr, 104static dma_addr_t pci_iommu_map_single(struct device *hwdev, void *vaddr,
86 size_t size, enum dma_data_direction direction) 105 size_t size, enum dma_data_direction direction)
87{ 106{
88 return iommu_map_single(devnode_table(hwdev), vaddr, size, direction); 107 return iommu_map_single(devnode_table(hwdev), vaddr, size,
108 device_to_mask(hwdev), direction);
89} 109}
90 110
91 111
@@ -100,7 +120,7 @@ static int pci_iommu_map_sg(struct device *pdev, struct scatterlist *sglist,
100 int nelems, enum dma_data_direction direction) 120 int nelems, enum dma_data_direction direction)
101{ 121{
102 return iommu_map_sg(pdev, devnode_table(pdev), sglist, 122 return iommu_map_sg(pdev, devnode_table(pdev), sglist,
103 nelems, direction); 123 nelems, device_to_mask(pdev), direction);
104} 124}
105 125
106static void pci_iommu_unmap_sg(struct device *pdev, struct scatterlist *sglist, 126static void pci_iommu_unmap_sg(struct device *pdev, struct scatterlist *sglist,
@@ -112,7 +132,19 @@ static void pci_iommu_unmap_sg(struct device *pdev, struct scatterlist *sglist,
112/* We support DMA to/from any memory page via the iommu */ 132/* We support DMA to/from any memory page via the iommu */
113static int pci_iommu_dma_supported(struct device *dev, u64 mask) 133static int pci_iommu_dma_supported(struct device *dev, u64 mask)
114{ 134{
115 return 1; 135 struct iommu_table *tbl = devnode_table(dev);
136
137 if (!tbl || tbl->it_offset > mask) {
138 printk(KERN_INFO "Warning: IOMMU table offset too big for device mask\n");
139 if (tbl)
140 printk(KERN_INFO "mask: 0x%08lx, table offset: 0x%08lx\n",
141 mask, tbl->it_offset);
142 else
143 printk(KERN_INFO "mask: 0x%08lx, table unavailable\n",
144 mask);
145 return 0;
146 } else
147 return 1;
116} 148}
117 149
118void pci_iommu_init(void) 150void pci_iommu_init(void)
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index dfa5398ab3c8..4b052ae5dc34 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -81,6 +81,7 @@ EXPORT_SYMBOL(strcat);
81EXPORT_SYMBOL(strlen); 81EXPORT_SYMBOL(strlen);
82EXPORT_SYMBOL(strcmp); 82EXPORT_SYMBOL(strcmp);
83EXPORT_SYMBOL(strcasecmp); 83EXPORT_SYMBOL(strcasecmp);
84EXPORT_SYMBOL(strncasecmp);
84 85
85EXPORT_SYMBOL(csum_partial); 86EXPORT_SYMBOL(csum_partial);
86EXPORT_SYMBOL(csum_partial_copy_generic); 87EXPORT_SYMBOL(csum_partial_copy_generic);
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 4336390bcf34..1cb69e8fb0b1 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -62,7 +62,7 @@ static int __initdata dt_root_addr_cells;
62static int __initdata dt_root_size_cells; 62static int __initdata dt_root_size_cells;
63 63
64#ifdef CONFIG_PPC64 64#ifdef CONFIG_PPC64
65static int __initdata iommu_is_off; 65int __initdata iommu_is_off;
66int __initdata iommu_force_on; 66int __initdata iommu_force_on;
67unsigned long tce_alloc_start, tce_alloc_end; 67unsigned long tce_alloc_start, tce_alloc_end;
68#endif 68#endif
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 73560ef6f802..ed737cacf92d 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -279,7 +279,7 @@ static void unregister_cpu_online(unsigned int cpu)
279} 279}
280#endif /* CONFIG_HOTPLUG_CPU */ 280#endif /* CONFIG_HOTPLUG_CPU */
281 281
282static int __devinit sysfs_cpu_notify(struct notifier_block *self, 282static int sysfs_cpu_notify(struct notifier_block *self,
283 unsigned long action, void *hcpu) 283 unsigned long action, void *hcpu)
284{ 284{
285 unsigned int cpu = (unsigned int)(long)hcpu; 285 unsigned int cpu = (unsigned int)(long)hcpu;
@@ -297,7 +297,7 @@ static int __devinit sysfs_cpu_notify(struct notifier_block *self,
297 return NOTIFY_OK; 297 return NOTIFY_OK;
298} 298}
299 299
300static struct notifier_block __devinitdata sysfs_cpu_nb = { 300static struct notifier_block sysfs_cpu_nb = {
301 .notifier_call = sysfs_cpu_notify, 301 .notifier_call = sysfs_cpu_notify,
302}; 302};
303 303
diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S
index a14c96403840..0b98eea73c5e 100644
--- a/arch/powerpc/kernel/systbl.S
+++ b/arch/powerpc/kernel/systbl.S
@@ -324,3 +324,9 @@ COMPAT_SYS(ppoll)
324SYSCALL(unshare) 324SYSCALL(unshare)
325SYSCALL(splice) 325SYSCALL(splice)
326SYSCALL(tee) 326SYSCALL(tee)
327SYSCALL(vmsplice)
328
329/*
330 * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c
331 * as well when appropriate.
332 */
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 13c655ba2841..971020cf3f7d 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -202,7 +202,7 @@ static dma_addr_t vio_map_single(struct device *dev, void *vaddr,
202 size_t size, enum dma_data_direction direction) 202 size_t size, enum dma_data_direction direction)
203{ 203{
204 return iommu_map_single(to_vio_dev(dev)->iommu_table, vaddr, size, 204 return iommu_map_single(to_vio_dev(dev)->iommu_table, vaddr, size,
205 direction); 205 ~0ul, direction);
206} 206}
207 207
208static void vio_unmap_single(struct device *dev, dma_addr_t dma_handle, 208static void vio_unmap_single(struct device *dev, dma_addr_t dma_handle,
@@ -216,7 +216,7 @@ static int vio_map_sg(struct device *dev, struct scatterlist *sglist,
216 int nelems, enum dma_data_direction direction) 216 int nelems, enum dma_data_direction direction)
217{ 217{
218 return iommu_map_sg(dev, to_vio_dev(dev)->iommu_table, sglist, 218 return iommu_map_sg(dev, to_vio_dev(dev)->iommu_table, sglist,
219 nelems, direction); 219 nelems, ~0ul, direction);
220} 220}
221 221
222static void vio_unmap_sg(struct device *dev, struct scatterlist *sglist, 222static void vio_unmap_sg(struct device *dev, struct scatterlist *sglist,
@@ -229,7 +229,7 @@ static void *vio_alloc_coherent(struct device *dev, size_t size,
229 dma_addr_t *dma_handle, gfp_t flag) 229 dma_addr_t *dma_handle, gfp_t flag)
230{ 230{
231 return iommu_alloc_coherent(to_vio_dev(dev)->iommu_table, size, 231 return iommu_alloc_coherent(to_vio_dev(dev)->iommu_table, size,
232 dma_handle, flag); 232 dma_handle, ~0ul, flag);
233} 233}
234 234
235static void vio_free_coherent(struct device *dev, size_t size, 235static void vio_free_coherent(struct device *dev, size_t size,
diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c
index 6594bec73882..b283380a2a18 100644
--- a/arch/powerpc/platforms/cell/spu_callbacks.c
+++ b/arch/powerpc/platforms/cell/spu_callbacks.c
@@ -317,17 +317,17 @@ void *spu_syscall_table[] = {
317 [__NR_ppoll] sys_ni_syscall, /* sys_ppoll */ 317 [__NR_ppoll] sys_ni_syscall, /* sys_ppoll */
318 [__NR_unshare] sys_unshare, 318 [__NR_unshare] sys_unshare,
319 [__NR_splice] sys_splice, 319 [__NR_splice] sys_splice,
320 [__NR_tee] sys_tee,
321 [__NR_vmsplice] sys_vmsplice,
320}; 322};
321 323
322long spu_sys_callback(struct spu_syscall_block *s) 324long spu_sys_callback(struct spu_syscall_block *s)
323{ 325{
324 long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); 326 long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
325 327
326 BUILD_BUG_ON(ARRAY_SIZE(spu_syscall_table) != __NR_syscalls);
327
328 syscall = spu_syscall_table[s->nr_ret]; 328 syscall = spu_syscall_table[s->nr_ret];
329 329
330 if (s->nr_ret >= __NR_syscalls) { 330 if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {
331 pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret); 331 pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret);
332 return -ENOSYS; 332 return -ENOSYS;
333 } 333 }
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index e14f9ac55cf4..df2343e1956b 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -231,6 +231,14 @@ static u8 kw_i2c_wait_interrupt(struct pmac_i2c_host_kw *host)
231 return isr; 231 return isr;
232} 232}
233 233
234static void kw_i2c_do_stop(struct pmac_i2c_host_kw *host, int result)
235{
236 kw_write_reg(reg_control, KW_I2C_CTL_STOP);
237 host->state = state_stop;
238 host->result = result;
239}
240
241
234static void kw_i2c_handle_interrupt(struct pmac_i2c_host_kw *host, u8 isr) 242static void kw_i2c_handle_interrupt(struct pmac_i2c_host_kw *host, u8 isr)
235{ 243{
236 u8 ack; 244 u8 ack;
@@ -246,42 +254,36 @@ static void kw_i2c_handle_interrupt(struct pmac_i2c_host_kw *host, u8 isr)
246 } 254 }
247 255
248 if (isr == 0) { 256 if (isr == 0) {
257 printk(KERN_WARNING "low_i2c: Timeout in i2c transfer"
258 " on keywest !\n");
249 if (host->state != state_stop) { 259 if (host->state != state_stop) {
250 DBG_LOW("KW: Timeout !\n"); 260 kw_i2c_do_stop(host, -EIO);
251 host->result = -EIO; 261 return;
252 goto stop;
253 }
254 if (host->state == state_stop) {
255 ack = kw_read_reg(reg_status);
256 if (ack & KW_I2C_STAT_BUSY)
257 kw_write_reg(reg_status, 0);
258 host->state = state_idle;
259 kw_write_reg(reg_ier, 0x00);
260 if (!host->polled)
261 complete(&host->complete);
262 } 262 }
263 ack = kw_read_reg(reg_status);
264 if (ack & KW_I2C_STAT_BUSY)
265 kw_write_reg(reg_status, 0);
266 host->state = state_idle;
267 kw_write_reg(reg_ier, 0x00);
268 if (!host->polled)
269 complete(&host->complete);
263 return; 270 return;
264 } 271 }
265 272
266 if (isr & KW_I2C_IRQ_ADDR) { 273 if (isr & KW_I2C_IRQ_ADDR) {
267 ack = kw_read_reg(reg_status); 274 ack = kw_read_reg(reg_status);
268 if (host->state != state_addr) { 275 if (host->state != state_addr) {
269 kw_write_reg(reg_isr, KW_I2C_IRQ_ADDR);
270 WRONG_STATE("KW_I2C_IRQ_ADDR"); 276 WRONG_STATE("KW_I2C_IRQ_ADDR");
271 host->result = -EIO; 277 kw_i2c_do_stop(host, -EIO);
272 goto stop;
273 } 278 }
274 if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { 279 if ((ack & KW_I2C_STAT_LAST_AAK) == 0) {
275 host->result = -ENODEV; 280 host->result = -ENXIO;
276 DBG_LOW("KW: NAK on address\n");
277 host->state = state_stop; 281 host->state = state_stop;
278 return; 282 DBG_LOW("KW: NAK on address\n");
279 } else { 283 } else {
280 if (host->len == 0) { 284 if (host->len == 0)
281 kw_write_reg(reg_isr, KW_I2C_IRQ_ADDR); 285 kw_i2c_do_stop(host, 0);
282 goto stop; 286 else if (host->rw) {
283 }
284 if (host->rw) {
285 host->state = state_read; 287 host->state = state_read;
286 if (host->len > 1) 288 if (host->len > 1)
287 kw_write_reg(reg_control, 289 kw_write_reg(reg_control,
@@ -308,25 +310,19 @@ static void kw_i2c_handle_interrupt(struct pmac_i2c_host_kw *host, u8 isr)
308 ack = kw_read_reg(reg_status); 310 ack = kw_read_reg(reg_status);
309 if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { 311 if ((ack & KW_I2C_STAT_LAST_AAK) == 0) {
310 DBG_LOW("KW: nack on data write\n"); 312 DBG_LOW("KW: nack on data write\n");
311 host->result = -EIO; 313 host->result = -EFBIG;
312 goto stop; 314 host->state = state_stop;
313 } else if (host->len) { 315 } else if (host->len) {
314 kw_write_reg(reg_data, *(host->data++)); 316 kw_write_reg(reg_data, *(host->data++));
315 host->len--; 317 host->len--;
316 } else { 318 } else
317 kw_write_reg(reg_control, KW_I2C_CTL_STOP); 319 kw_i2c_do_stop(host, 0);
318 host->state = state_stop;
319 host->result = 0;
320 }
321 kw_write_reg(reg_isr, KW_I2C_IRQ_DATA);
322 } else { 320 } else {
323 kw_write_reg(reg_isr, KW_I2C_IRQ_DATA);
324 WRONG_STATE("KW_I2C_IRQ_DATA"); 321 WRONG_STATE("KW_I2C_IRQ_DATA");
325 if (host->state != state_stop) { 322 if (host->state != state_stop)
326 host->result = -EIO; 323 kw_i2c_do_stop(host, -EIO);
327 goto stop;
328 }
329 } 324 }
325 kw_write_reg(reg_isr, KW_I2C_IRQ_DATA);
330 } 326 }
331 327
332 if (isr & KW_I2C_IRQ_STOP) { 328 if (isr & KW_I2C_IRQ_STOP) {
@@ -340,14 +336,10 @@ static void kw_i2c_handle_interrupt(struct pmac_i2c_host_kw *host, u8 isr)
340 complete(&host->complete); 336 complete(&host->complete);
341 } 337 }
342 338
339 /* Below should only happen in manual mode which we don't use ... */
343 if (isr & KW_I2C_IRQ_START) 340 if (isr & KW_I2C_IRQ_START)
344 kw_write_reg(reg_isr, KW_I2C_IRQ_START); 341 kw_write_reg(reg_isr, KW_I2C_IRQ_START);
345 342
346 return;
347 stop:
348 kw_write_reg(reg_control, KW_I2C_CTL_STOP);
349 host->state = state_stop;
350 return;
351} 343}
352 344
353/* Interrupt handler */ 345/* Interrupt handler */
@@ -544,11 +536,11 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
544 return NULL; 536 return NULL;
545 } 537 }
546 538
547 /* Make sure IRA is disabled */ 539 /* Make sure IRQ is disabled */
548 kw_write_reg(reg_ier, 0); 540 kw_write_reg(reg_ier, 0);
549 541
550 /* Request chip interrupt */ 542 /* Request chip interrupt */
551 if (request_irq(host->irq, kw_i2c_irq, SA_SHIRQ, "keywest i2c", host)) 543 if (request_irq(host->irq, kw_i2c_irq, 0, "keywest i2c", host))
552 host->irq = NO_IRQ; 544 host->irq = NO_IRQ;
553 545
554 printk(KERN_INFO "KeyWest i2c @0x%08x irq %d %s\n", 546 printk(KERN_INFO "KeyWest i2c @0x%08x irq %d %s\n",
diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c
index 61d317428610..38087bd6e3cf 100644
--- a/arch/powerpc/sysdev/dart_iommu.c
+++ b/arch/powerpc/sysdev/dart_iommu.c
@@ -49,6 +49,7 @@
49 49
50#include "dart.h" 50#include "dart.h"
51 51
52extern int iommu_is_off;
52extern int iommu_force_on; 53extern int iommu_force_on;
53 54
54/* Physical base address and size of the DART table */ 55/* Physical base address and size of the DART table */
@@ -329,10 +330,17 @@ void iommu_init_early_dart(void)
329 330
330void __init alloc_dart_table(void) 331void __init alloc_dart_table(void)
331{ 332{
332 /* Only reserve DART space if machine has more than 2GB of RAM 333 /* Only reserve DART space if machine has more than 1GB of RAM
333 * or if requested with iommu=on on cmdline. 334 * or if requested with iommu=on on cmdline.
335 *
336 * 1GB of RAM is picked as limit because some default devices
337 * (i.e. Airport Extreme) have 30 bit address range limits.
334 */ 338 */
335 if (lmb_end_of_DRAM() <= 0x80000000ull && !iommu_force_on) 339
340 if (iommu_is_off)
341 return;
342
343 if (!iommu_force_on && lmb_end_of_DRAM() <= 0x40000000ull)
336 return; 344 return;
337 345
338 /* 512 pages (2MB) is max DART tablesize. */ 346 /* 512 pages (2MB) is max DART tablesize. */
diff --git a/arch/ppc/kernel/asm-offsets.c b/arch/ppc/kernel/asm-offsets.c
index 77e4dc780f8c..cc7c4aea9397 100644
--- a/arch/ppc/kernel/asm-offsets.c
+++ b/arch/ppc/kernel/asm-offsets.c
@@ -134,6 +134,7 @@ main(void)
134 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 134 DEFINE(TI_TASK, offsetof(struct thread_info, task));
135 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); 135 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
136 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 136 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
137 DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, flags));
137 DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); 138 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
138 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); 139 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
139 140
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index 5891ecbdc703..1adc9145516f 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -128,29 +128,26 @@ transfer_to_handler:
128 stw r12,4(r11) 128 stw r12,4(r11)
129#endif 129#endif
130 b 3f 130 b 3f
131
1312: /* if from kernel, check interrupted DOZE/NAP mode and 1322: /* if from kernel, check interrupted DOZE/NAP mode and
132 * check for stack overflow 133 * check for stack overflow
133 */ 134 */
135 lwz r9,THREAD_INFO-THREAD(r12)
136 cmplw r1,r9 /* if r1 <= current->thread_info */
137 ble- stack_ovf /* then the kernel stack overflowed */
1385:
134#ifdef CONFIG_6xx 139#ifdef CONFIG_6xx
135 mfspr r11,SPRN_HID0 140 tophys(r9,r9) /* check local flags */
136 mtcr r11 141 lwz r12,TI_LOCAL_FLAGS(r9)
137BEGIN_FTR_SECTION 142 mtcrf 0x01,r12
138 bt- 8,4f /* Check DOZE */ 143 bt- 31-TLF_NAPPING,4f
139END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE)
140BEGIN_FTR_SECTION
141 bt- 9,4f /* Check NAP */
142END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
143#endif /* CONFIG_6xx */ 144#endif /* CONFIG_6xx */
144 .globl transfer_to_handler_cont 145 .globl transfer_to_handler_cont
145transfer_to_handler_cont: 146transfer_to_handler_cont:
146 lwz r11,THREAD_INFO-THREAD(r12)
147 cmplw r1,r11 /* if r1 <= current->thread_info */
148 ble- stack_ovf /* then the kernel stack overflowed */
1493: 1473:
150 mflr r9 148 mflr r9
151 lwz r11,0(r9) /* virtual address of handler */ 149 lwz r11,0(r9) /* virtual address of handler */
152 lwz r9,4(r9) /* where to go when done */ 150 lwz r9,4(r9) /* where to go when done */
153 FIX_SRR1(r10,r12)
154 mtspr SPRN_SRR0,r11 151 mtspr SPRN_SRR0,r11
155 mtspr SPRN_SRR1,r10 152 mtspr SPRN_SRR1,r10
156 mtlr r9 153 mtlr r9
@@ -158,7 +155,9 @@ transfer_to_handler_cont:
158 RFI /* jump to handler, enable MMU */ 155 RFI /* jump to handler, enable MMU */
159 156
160#ifdef CONFIG_6xx 157#ifdef CONFIG_6xx
1614: b power_save_6xx_restore 1584: rlwinm r12,r12,0,~_TLF_NAPPING
159 stw r12,TI_LOCAL_FLAGS(r9)
160 b power_save_6xx_restore
162#endif 161#endif
163 162
164/* 163/*
@@ -167,10 +166,10 @@ transfer_to_handler_cont:
167 */ 166 */
168stack_ovf: 167stack_ovf:
169 /* sometimes we use a statically-allocated stack, which is OK. */ 168 /* sometimes we use a statically-allocated stack, which is OK. */
170 lis r11,_end@h 169 lis r12,_end@h
171 ori r11,r11,_end@l 170 ori r12,r12,_end@l
172 cmplw r1,r11 171 cmplw r1,r12
173 ble 3b /* r1 <= &_end is OK */ 172 ble 5b /* r1 <= &_end is OK */
174 SAVE_NVGPRS(r11) 173 SAVE_NVGPRS(r11)
175 addi r3,r1,STACK_FRAME_OVERHEAD 174 addi r3,r1,STACK_FRAME_OVERHEAD
176 lis r1,init_thread_union@ha 175 lis r1,init_thread_union@ha
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 865ba74991a9..b250b1b539b6 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -94,6 +94,7 @@ EXPORT_SYMBOL(strcat);
94EXPORT_SYMBOL(strlen); 94EXPORT_SYMBOL(strlen);
95EXPORT_SYMBOL(strcmp); 95EXPORT_SYMBOL(strcmp);
96EXPORT_SYMBOL(strcasecmp); 96EXPORT_SYMBOL(strcasecmp);
97EXPORT_SYMBOL(strncasecmp);
97EXPORT_SYMBOL(__div64_32); 98EXPORT_SYMBOL(__div64_32);
98 99
99EXPORT_SYMBOL(csum_partial); 100EXPORT_SYMBOL(csum_partial);
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 54d35c130907..9a22434a580c 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -652,7 +652,7 @@ appldata_cpu_notify(struct notifier_block *self,
652 return NOTIFY_OK; 652 return NOTIFY_OK;
653} 653}
654 654
655static struct notifier_block __devinitdata appldata_nb = { 655static struct notifier_block appldata_nb = {
656 .notifier_call = appldata_cpu_notify, 656 .notifier_call = appldata_cpu_notify,
657}; 657};
658 658
diff --git a/arch/x86_64/ia32/Makefile b/arch/x86_64/ia32/Makefile
index 929e6b0771f8..e9263b4975e0 100644
--- a/arch/x86_64/ia32/Makefile
+++ b/arch/x86_64/ia32/Makefile
@@ -27,5 +27,5 @@ $(obj)/vsyscall-sysenter.so $(obj)/vsyscall-syscall.so: \
27$(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE 27$(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
28 $(call if_changed,syscall) 28 $(call if_changed,syscall)
29 29
30AFLAGS_vsyscall-sysenter.o = -m32 30AFLAGS_vsyscall-sysenter.o = -m32 -Wa,-32
31AFLAGS_vsyscall-syscall.o = -m32 31AFLAGS_vsyscall-syscall.o = -m32 -Wa,-32
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index 6f0790e8b6d3..c69fc43cee7b 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -629,7 +629,7 @@ static __cpuinit void mce_remove_device(unsigned int cpu)
629#endif 629#endif
630 630
631/* Get notified when a cpu comes on/off. Be hotplug friendly. */ 631/* Get notified when a cpu comes on/off. Be hotplug friendly. */
632static __cpuinit int 632static int
633mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) 633mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
634{ 634{
635 unsigned int cpu = (unsigned long)hcpu; 635 unsigned int cpu = (unsigned long)hcpu;
diff --git a/arch/x86_64/kernel/mce_amd.c b/arch/x86_64/kernel/mce_amd.c
index d3ad7d81266d..d13b241ad094 100644
--- a/arch/x86_64/kernel/mce_amd.c
+++ b/arch/x86_64/kernel/mce_amd.c
@@ -482,7 +482,7 @@ static void threshold_remove_device(unsigned int cpu)
482#endif 482#endif
483 483
484/* get notified when a cpu comes on/off */ 484/* get notified when a cpu comes on/off */
485static __cpuinit int threshold_cpu_callback(struct notifier_block *nfb, 485static int threshold_cpu_callback(struct notifier_block *nfb,
486 unsigned long action, void *hcpu) 486 unsigned long action, void *hcpu)
487{ 487{
488 /* cpu was unsigned int to begin with */ 488 /* cpu was unsigned int to begin with */
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
index a6c01e121266..9d3d76c85ae7 100644
--- a/arch/x86_64/kernel/pci-gart.c
+++ b/arch/x86_64/kernel/pci-gart.c
@@ -112,10 +112,6 @@ static unsigned long alloc_iommu(int size)
112static void free_iommu(unsigned long offset, int size) 112static void free_iommu(unsigned long offset, int size)
113{ 113{
114 unsigned long flags; 114 unsigned long flags;
115 if (size == 1) {
116 clear_bit(offset, iommu_gart_bitmap);
117 return;
118 }
119 spin_lock_irqsave(&iommu_bitmap_lock, flags); 115 spin_lock_irqsave(&iommu_bitmap_lock, flags);
120 __clear_bit_string(iommu_gart_bitmap, offset, size); 116 __clear_bit_string(iommu_gart_bitmap, offset, size);
121 spin_unlock_irqrestore(&iommu_bitmap_lock, flags); 117 spin_unlock_irqrestore(&iommu_bitmap_lock, flags);
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c
index cc02573a3271..b2fac14baac0 100644
--- a/arch/x86_64/mm/numa.c
+++ b/arch/x86_64/mm/numa.c
@@ -188,11 +188,13 @@ void __init setup_node_zones(int nodeid)
188 memory. */ 188 memory. */
189 memmapsize = sizeof(struct page) * (end_pfn-start_pfn); 189 memmapsize = sizeof(struct page) * (end_pfn-start_pfn);
190 limit = end_pfn << PAGE_SHIFT; 190 limit = end_pfn << PAGE_SHIFT;
191#ifdef CONFIG_FLAT_NODE_MEM_MAP
191 NODE_DATA(nodeid)->node_mem_map = 192 NODE_DATA(nodeid)->node_mem_map =
192 __alloc_bootmem_core(NODE_DATA(nodeid)->bdata, 193 __alloc_bootmem_core(NODE_DATA(nodeid)->bdata,
193 memmapsize, SMP_CACHE_BYTES, 194 memmapsize, SMP_CACHE_BYTES,
194 round_down(limit - memmapsize, PAGE_SIZE), 195 round_down(limit - memmapsize, PAGE_SIZE),
195 limit); 196 limit);
197#endif
196 198
197 size_zones(zones, holes, start_pfn, end_pfn); 199 size_zones(zones, holes, start_pfn, end_pfn);
198 free_area_init_node(nodeid, NODE_DATA(nodeid), zones, 200 free_area_init_node(nodeid, NODE_DATA(nodeid), zones,
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 1755c053fd68..e5041a02e21f 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -3385,7 +3385,7 @@ static int blk_cpu_notify(struct notifier_block *self, unsigned long action,
3385} 3385}
3386 3386
3387 3387
3388static struct notifier_block __devinitdata blk_cpu_notifier = { 3388static struct notifier_block blk_cpu_notifier = {
3389 .notifier_call = blk_cpu_notify, 3389 .notifier_call = blk_cpu_notify,
3390}; 3390};
3391 3391
diff --git a/drivers/base/topology.c b/drivers/base/topology.c
index 915810f6237e..8c52421cbc54 100644
--- a/drivers/base/topology.c
+++ b/drivers/base/topology.c
@@ -107,7 +107,7 @@ static int __cpuinit topology_remove_dev(struct sys_device * sys_dev)
107 return 0; 107 return 0;
108} 108}
109 109
110static int __cpuinit topology_cpu_callback(struct notifier_block *nfb, 110static int topology_cpu_callback(struct notifier_block *nfb,
111 unsigned long action, void *hcpu) 111 unsigned long action, void *hcpu)
112{ 112{
113 unsigned int cpu = (unsigned long)hcpu; 113 unsigned int cpu = (unsigned long)hcpu;
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index e1aadae00623..cb76e5ca9a23 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -889,7 +889,6 @@ extern int drm_lock_free(drm_device_t * dev,
889 /* Buffer management support (drm_bufs.h) */ 889 /* Buffer management support (drm_bufs.h) */
890extern int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request); 890extern int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request);
891extern int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request); 891extern int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request);
892extern int drm_addbufs_fb(drm_device_t *dev, drm_buf_desc_t *request);
893extern int drm_addmap(drm_device_t * dev, unsigned int offset, 892extern int drm_addmap(drm_device_t * dev, unsigned int offset,
894 unsigned int size, drm_map_type_t type, 893 unsigned int size, drm_map_type_t type,
895 drm_map_flags_t flags, drm_local_map_t ** map_ptr); 894 drm_map_flags_t flags, drm_local_map_t ** map_ptr);
diff --git a/drivers/char/drm/drm_agpsupport.c b/drivers/char/drm/drm_agpsupport.c
index fabc930c67a2..40bfd9b01e39 100644
--- a/drivers/char/drm/drm_agpsupport.c
+++ b/drivers/char/drm/drm_agpsupport.c
@@ -503,8 +503,6 @@ int drm_agp_bind_memory(DRM_AGP_MEM * handle, off_t start)
503 return agp_bind_memory(handle, start); 503 return agp_bind_memory(handle, start);
504} 504}
505 505
506EXPORT_SYMBOL(drm_agp_bind_memory);
507
508/** Calls agp_unbind_memory() */ 506/** Calls agp_unbind_memory() */
509int drm_agp_unbind_memory(DRM_AGP_MEM * handle) 507int drm_agp_unbind_memory(DRM_AGP_MEM * handle)
510{ 508{
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c
index 8a9cf12e6183..006b06d29727 100644
--- a/drivers/char/drm/drm_bufs.c
+++ b/drivers/char/drm/drm_bufs.c
@@ -386,7 +386,6 @@ int drm_rmmap_locked(drm_device_t *dev, drm_local_map_t *map)
386 386
387 return 0; 387 return 0;
388} 388}
389EXPORT_SYMBOL(drm_rmmap_locked);
390 389
391int drm_rmmap(drm_device_t *dev, drm_local_map_t *map) 390int drm_rmmap(drm_device_t *dev, drm_local_map_t *map)
392{ 391{
@@ -398,7 +397,6 @@ int drm_rmmap(drm_device_t *dev, drm_local_map_t *map)
398 397
399 return ret; 398 return ret;
400} 399}
401EXPORT_SYMBOL(drm_rmmap);
402 400
403/* The rmmap ioctl appears to be unnecessary. All mappings are torn down on 401/* The rmmap ioctl appears to be unnecessary. All mappings are torn down on
404 * the last close of the device, and this is necessary for cleanup when things 402 * the last close of the device, and this is necessary for cleanup when things
@@ -1053,7 +1051,7 @@ static int drm_addbufs_sg(drm_device_t * dev, drm_buf_desc_t * request)
1053 return 0; 1051 return 0;
1054} 1052}
1055 1053
1056int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request) 1054static int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request)
1057{ 1055{
1058 drm_device_dma_t *dma = dev->dma; 1056 drm_device_dma_t *dma = dev->dma;
1059 drm_buf_entry_t *entry; 1057 drm_buf_entry_t *entry;
@@ -1212,7 +1210,6 @@ int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request)
1212 atomic_dec(&dev->buf_alloc); 1210 atomic_dec(&dev->buf_alloc);
1213 return 0; 1211 return 0;
1214} 1212}
1215EXPORT_SYMBOL(drm_addbufs_fb);
1216 1213
1217 1214
1218/** 1215/**
diff --git a/drivers/char/drm/drm_stub.c b/drivers/char/drm/drm_stub.c
index 68073e14fdec..9a842a36bb27 100644
--- a/drivers/char/drm/drm_stub.c
+++ b/drivers/char/drm/drm_stub.c
@@ -229,8 +229,6 @@ int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
229 return ret; 229 return ret;
230} 230}
231 231
232EXPORT_SYMBOL(drm_get_dev);
233
234/** 232/**
235 * Put a device minor number. 233 * Put a device minor number.
236 * 234 *
diff --git a/drivers/char/drm/r300_cmdbuf.c b/drivers/char/drm/r300_cmdbuf.c
index b108c7f913b2..26bdf2ca59d7 100644
--- a/drivers/char/drm/r300_cmdbuf.c
+++ b/drivers/char/drm/r300_cmdbuf.c
@@ -723,7 +723,7 @@ static int r300_scratch(drm_radeon_private_t *dev_priv,
723 723
724 dev_priv->scratch_ages[header.scratch.reg]++; 724 dev_priv->scratch_ages[header.scratch.reg]++;
725 725
726 ref_age_base = *(u32 **)cmdbuf->buf; 726 ref_age_base = (u32 *)(unsigned long)*((uint64_t *)cmdbuf->buf);
727 727
728 cmdbuf->buf += sizeof(u64); 728 cmdbuf->buf += sizeof(u64);
729 cmdbuf->bufsz -= sizeof(u64); 729 cmdbuf->bufsz -= sizeof(u64);
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 66719f9d294c..1fa9fa157c12 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -27,6 +27,7 @@
27#include <linux/crash_dump.h> 27#include <linux/crash_dump.h>
28#include <linux/backing-dev.h> 28#include <linux/backing-dev.h>
29#include <linux/bootmem.h> 29#include <linux/bootmem.h>
30#include <linux/pipe_fs_i.h>
30 31
31#include <asm/uaccess.h> 32#include <asm/uaccess.h>
32#include <asm/io.h> 33#include <asm/io.h>
@@ -578,6 +579,18 @@ static ssize_t write_null(struct file * file, const char __user * buf,
578 return count; 579 return count;
579} 580}
580 581
582static int pipe_to_null(struct pipe_inode_info *info, struct pipe_buffer *buf,
583 struct splice_desc *sd)
584{
585 return sd->len;
586}
587
588static ssize_t splice_write_null(struct pipe_inode_info *pipe,struct file *out,
589 loff_t *ppos, size_t len, unsigned int flags)
590{
591 return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_null);
592}
593
581#ifdef CONFIG_MMU 594#ifdef CONFIG_MMU
582/* 595/*
583 * For fun, we are using the MMU for this. 596 * For fun, we are using the MMU for this.
@@ -785,6 +798,7 @@ static struct file_operations null_fops = {
785 .llseek = null_lseek, 798 .llseek = null_lseek,
786 .read = read_null, 799 .read = read_null,
787 .write = write_null, 800 .write = write_null,
801 .splice_write = splice_write_null,
788}; 802};
789 803
790#if defined(CONFIG_ISA) || !defined(__mc68000__) 804#if defined(CONFIG_ISA) || !defined(__mc68000__)
diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c
index b543821d8cb4..56c8243cdb73 100644
--- a/drivers/char/snsc.c
+++ b/drivers/char/snsc.c
@@ -390,7 +390,8 @@ scdrv_init(void)
390 format_module_id(devnamep, geo_module(geoid), 390 format_module_id(devnamep, geo_module(geoid),
391 MODULE_FORMAT_BRIEF); 391 MODULE_FORMAT_BRIEF);
392 devnamep = devname + strlen(devname); 392 devnamep = devname + strlen(devname);
393 sprintf(devnamep, "#%d", geo_slab(geoid)); 393 sprintf(devnamep, "^%d#%d", geo_slot(geoid),
394 geo_slab(geoid));
394 395
395 /* allocate sysctl device data */ 396 /* allocate sysctl device data */
396 scd = kzalloc(sizeof (struct sysctl_data_s), 397 scd = kzalloc(sizeof (struct sysctl_data_s),
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
index a6873bf89ffa..1efde3b27619 100644
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
@@ -20,9 +20,18 @@ config TCG_TPM
20 Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI 20 Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI
21 and CONFIG_PNPACPI. 21 and CONFIG_PNPACPI.
22 22
23config TCG_TIS
24 tristate "TPM Interface Specification 1.2 Interface"
25 depends on TCG_TPM
26 ---help---
27 If you have a TPM security chip that is compliant with the
28 TCG TIS 1.2 TPM specification say Yes and it will be accessible
29 from within Linux. To compile this driver as a module, choose
30 M here; the module will be called tpm_tis.
31
23config TCG_NSC 32config TCG_NSC
24 tristate "National Semiconductor TPM Interface" 33 tristate "National Semiconductor TPM Interface"
25 depends on TCG_TPM 34 depends on TCG_TPM && PNPACPI
26 ---help--- 35 ---help---
27 If you have a TPM security chip from National Semicondutor 36 If you have a TPM security chip from National Semicondutor
28 say Yes and it will be accessible from within Linux. To 37 say Yes and it will be accessible from within Linux. To
diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
index ba4582d160fd..ea3a1e02a824 100644
--- a/drivers/char/tpm/Makefile
+++ b/drivers/char/tpm/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_TCG_TPM) += tpm.o
5ifdef CONFIG_ACPI 5ifdef CONFIG_ACPI
6 obj-$(CONFIG_TCG_TPM) += tpm_bios.o 6 obj-$(CONFIG_TCG_TPM) += tpm_bios.o
7endif 7endif
8obj-$(CONFIG_TCG_TIS) += tpm_tis.o
8obj-$(CONFIG_TCG_NSC) += tpm_nsc.o 9obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
9obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o 10obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
10obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o 11obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 5a3870477ef1..6889e7db3aff 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -32,12 +32,291 @@ enum tpm_const {
32 TPM_MINOR = 224, /* officially assigned */ 32 TPM_MINOR = 224, /* officially assigned */
33 TPM_BUFSIZE = 2048, 33 TPM_BUFSIZE = 2048,
34 TPM_NUM_DEVICES = 256, 34 TPM_NUM_DEVICES = 256,
35 TPM_NUM_MASK_ENTRIES = TPM_NUM_DEVICES / (8 * sizeof(int))
36}; 35};
37 36
37enum tpm_duration {
38 TPM_SHORT = 0,
39 TPM_MEDIUM = 1,
40 TPM_LONG = 2,
41 TPM_UNDEFINED,
42};
43
44#define TPM_MAX_ORDINAL 243
45#define TPM_MAX_PROTECTED_ORDINAL 12
46#define TPM_PROTECTED_ORDINAL_MASK 0xFF
47
38static LIST_HEAD(tpm_chip_list); 48static LIST_HEAD(tpm_chip_list);
39static DEFINE_SPINLOCK(driver_lock); 49static DEFINE_SPINLOCK(driver_lock);
40static int dev_mask[TPM_NUM_MASK_ENTRIES]; 50static DECLARE_BITMAP(dev_mask, TPM_NUM_DEVICES);
51
52/*
53 * Array with one entry per ordinal defining the maximum amount
54 * of time the chip could take to return the result. The ordinal
55 * designation of short, medium or long is defined in a table in
56 * TCG Specification TPM Main Part 2 TPM Structures Section 17. The
57 * values of the SHORT, MEDIUM, and LONG durations are retrieved
58 * from the chip during initialization with a call to tpm_get_timeouts.
59 */
60static const u8 tpm_protected_ordinal_duration[TPM_MAX_PROTECTED_ORDINAL] = {
61 TPM_UNDEFINED, /* 0 */
62 TPM_UNDEFINED,
63 TPM_UNDEFINED,
64 TPM_UNDEFINED,
65 TPM_UNDEFINED,
66 TPM_UNDEFINED, /* 5 */
67 TPM_UNDEFINED,
68 TPM_UNDEFINED,
69 TPM_UNDEFINED,
70 TPM_UNDEFINED,
71 TPM_SHORT, /* 10 */
72 TPM_SHORT,
73};
74
75static const u8 tpm_ordinal_duration[TPM_MAX_ORDINAL] = {
76 TPM_UNDEFINED, /* 0 */
77 TPM_UNDEFINED,
78 TPM_UNDEFINED,
79 TPM_UNDEFINED,
80 TPM_UNDEFINED,
81 TPM_UNDEFINED, /* 5 */
82 TPM_UNDEFINED,
83 TPM_UNDEFINED,
84 TPM_UNDEFINED,
85 TPM_UNDEFINED,
86 TPM_SHORT, /* 10 */
87 TPM_SHORT,
88 TPM_MEDIUM,
89 TPM_LONG,
90 TPM_LONG,
91 TPM_MEDIUM, /* 15 */
92 TPM_SHORT,
93 TPM_SHORT,
94 TPM_MEDIUM,
95 TPM_LONG,
96 TPM_SHORT, /* 20 */
97 TPM_SHORT,
98 TPM_MEDIUM,
99 TPM_MEDIUM,
100 TPM_MEDIUM,
101 TPM_SHORT, /* 25 */
102 TPM_SHORT,
103 TPM_MEDIUM,
104 TPM_SHORT,
105 TPM_SHORT,
106 TPM_MEDIUM, /* 30 */
107 TPM_LONG,
108 TPM_MEDIUM,
109 TPM_SHORT,
110 TPM_SHORT,
111 TPM_SHORT, /* 35 */
112 TPM_MEDIUM,
113 TPM_MEDIUM,
114 TPM_UNDEFINED,
115 TPM_UNDEFINED,
116 TPM_MEDIUM, /* 40 */
117 TPM_LONG,
118 TPM_MEDIUM,
119 TPM_SHORT,
120 TPM_SHORT,
121 TPM_SHORT, /* 45 */
122 TPM_SHORT,
123 TPM_SHORT,
124 TPM_SHORT,
125 TPM_LONG,
126 TPM_MEDIUM, /* 50 */
127 TPM_MEDIUM,
128 TPM_UNDEFINED,
129 TPM_UNDEFINED,
130 TPM_UNDEFINED,
131 TPM_UNDEFINED, /* 55 */
132 TPM_UNDEFINED,
133 TPM_UNDEFINED,
134 TPM_UNDEFINED,
135 TPM_UNDEFINED,
136 TPM_MEDIUM, /* 60 */
137 TPM_MEDIUM,
138 TPM_MEDIUM,
139 TPM_SHORT,
140 TPM_SHORT,
141 TPM_MEDIUM, /* 65 */
142 TPM_UNDEFINED,
143 TPM_UNDEFINED,
144 TPM_UNDEFINED,
145 TPM_UNDEFINED,
146 TPM_SHORT, /* 70 */
147 TPM_SHORT,
148 TPM_UNDEFINED,
149 TPM_UNDEFINED,
150 TPM_UNDEFINED,
151 TPM_UNDEFINED, /* 75 */
152 TPM_UNDEFINED,
153 TPM_UNDEFINED,
154 TPM_UNDEFINED,
155 TPM_UNDEFINED,
156 TPM_LONG, /* 80 */
157 TPM_UNDEFINED,
158 TPM_MEDIUM,
159 TPM_LONG,
160 TPM_SHORT,
161 TPM_UNDEFINED, /* 85 */
162 TPM_UNDEFINED,
163 TPM_UNDEFINED,
164 TPM_UNDEFINED,
165 TPM_UNDEFINED,
166 TPM_SHORT, /* 90 */
167 TPM_SHORT,
168 TPM_SHORT,
169 TPM_SHORT,
170 TPM_SHORT,
171 TPM_UNDEFINED, /* 95 */
172 TPM_UNDEFINED,
173 TPM_UNDEFINED,
174 TPM_UNDEFINED,
175 TPM_UNDEFINED,
176 TPM_MEDIUM, /* 100 */
177 TPM_SHORT,
178 TPM_SHORT,
179 TPM_UNDEFINED,
180 TPM_UNDEFINED,
181 TPM_UNDEFINED, /* 105 */
182 TPM_UNDEFINED,
183 TPM_UNDEFINED,
184 TPM_UNDEFINED,
185 TPM_UNDEFINED,
186 TPM_SHORT, /* 110 */
187 TPM_SHORT,
188 TPM_SHORT,
189 TPM_SHORT,
190 TPM_SHORT,
191 TPM_SHORT, /* 115 */
192 TPM_SHORT,
193 TPM_SHORT,
194 TPM_UNDEFINED,
195 TPM_UNDEFINED,
196 TPM_LONG, /* 120 */
197 TPM_LONG,
198 TPM_MEDIUM,
199 TPM_UNDEFINED,
200 TPM_SHORT,
201 TPM_SHORT, /* 125 */
202 TPM_SHORT,
203 TPM_LONG,
204 TPM_SHORT,
205 TPM_SHORT,
206 TPM_SHORT, /* 130 */
207 TPM_MEDIUM,
208 TPM_UNDEFINED,
209 TPM_SHORT,
210 TPM_MEDIUM,
211 TPM_UNDEFINED, /* 135 */
212 TPM_UNDEFINED,
213 TPM_UNDEFINED,
214 TPM_UNDEFINED,
215 TPM_UNDEFINED,
216 TPM_SHORT, /* 140 */
217 TPM_SHORT,
218 TPM_UNDEFINED,
219 TPM_UNDEFINED,
220 TPM_UNDEFINED,
221 TPM_UNDEFINED, /* 145 */
222 TPM_UNDEFINED,
223 TPM_UNDEFINED,
224 TPM_UNDEFINED,
225 TPM_UNDEFINED,
226 TPM_SHORT, /* 150 */
227 TPM_MEDIUM,
228 TPM_MEDIUM,
229 TPM_SHORT,
230 TPM_SHORT,
231 TPM_UNDEFINED, /* 155 */
232 TPM_UNDEFINED,
233 TPM_UNDEFINED,
234 TPM_UNDEFINED,
235 TPM_UNDEFINED,
236 TPM_SHORT, /* 160 */
237 TPM_SHORT,
238 TPM_SHORT,
239 TPM_SHORT,
240 TPM_UNDEFINED,
241 TPM_UNDEFINED, /* 165 */
242 TPM_UNDEFINED,
243 TPM_UNDEFINED,
244 TPM_UNDEFINED,
245 TPM_UNDEFINED,
246 TPM_LONG, /* 170 */
247 TPM_UNDEFINED,
248 TPM_UNDEFINED,
249 TPM_UNDEFINED,
250 TPM_UNDEFINED,
251 TPM_UNDEFINED, /* 175 */
252 TPM_UNDEFINED,
253 TPM_UNDEFINED,
254 TPM_UNDEFINED,
255 TPM_UNDEFINED,
256 TPM_MEDIUM, /* 180 */
257 TPM_SHORT,
258 TPM_MEDIUM,
259 TPM_MEDIUM,
260 TPM_MEDIUM,
261 TPM_MEDIUM, /* 185 */
262 TPM_SHORT,
263 TPM_UNDEFINED,
264 TPM_UNDEFINED,
265 TPM_UNDEFINED,
266 TPM_UNDEFINED, /* 190 */
267 TPM_UNDEFINED,
268 TPM_UNDEFINED,
269 TPM_UNDEFINED,
270 TPM_UNDEFINED,
271 TPM_UNDEFINED, /* 195 */
272 TPM_UNDEFINED,
273 TPM_UNDEFINED,
274 TPM_UNDEFINED,
275 TPM_UNDEFINED,
276 TPM_SHORT, /* 200 */
277 TPM_UNDEFINED,
278 TPM_UNDEFINED,
279 TPM_UNDEFINED,
280 TPM_SHORT,
281 TPM_SHORT, /* 205 */
282 TPM_SHORT,
283 TPM_SHORT,
284 TPM_SHORT,
285 TPM_SHORT,
286 TPM_MEDIUM, /* 210 */
287 TPM_UNDEFINED,
288 TPM_MEDIUM,
289 TPM_MEDIUM,
290 TPM_MEDIUM,
291 TPM_UNDEFINED, /* 215 */
292 TPM_MEDIUM,
293 TPM_UNDEFINED,
294 TPM_UNDEFINED,
295 TPM_SHORT,
296 TPM_SHORT, /* 220 */
297 TPM_SHORT,
298 TPM_SHORT,
299 TPM_SHORT,
300 TPM_SHORT,
301 TPM_UNDEFINED, /* 225 */
302 TPM_UNDEFINED,
303 TPM_UNDEFINED,
304 TPM_UNDEFINED,
305 TPM_UNDEFINED,
306 TPM_SHORT, /* 230 */
307 TPM_LONG,
308 TPM_MEDIUM,
309 TPM_UNDEFINED,
310 TPM_UNDEFINED,
311 TPM_UNDEFINED, /* 235 */
312 TPM_UNDEFINED,
313 TPM_UNDEFINED,
314 TPM_UNDEFINED,
315 TPM_UNDEFINED,
316 TPM_SHORT, /* 240 */
317 TPM_UNDEFINED,
318 TPM_MEDIUM,
319};
41 320
42static void user_reader_timeout(unsigned long ptr) 321static void user_reader_timeout(unsigned long ptr)
43{ 322{
@@ -46,7 +325,7 @@ static void user_reader_timeout(unsigned long ptr)
46 schedule_work(&chip->work); 325 schedule_work(&chip->work);
47} 326}
48 327
49static void timeout_work(void * ptr) 328static void timeout_work(void *ptr)
50{ 329{
51 struct tpm_chip *chip = ptr; 330 struct tpm_chip *chip = ptr;
52 331
@@ -57,17 +336,43 @@ static void timeout_work(void * ptr)
57} 336}
58 337
59/* 338/*
339 * Returns max number of jiffies to wait
340 */
341unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip,
342 u32 ordinal)
343{
344 int duration_idx = TPM_UNDEFINED;
345 int duration = 0;
346
347 if (ordinal < TPM_MAX_ORDINAL)
348 duration_idx = tpm_ordinal_duration[ordinal];
349 else if ((ordinal & TPM_PROTECTED_ORDINAL_MASK) <
350 TPM_MAX_PROTECTED_ORDINAL)
351 duration_idx =
352 tpm_protected_ordinal_duration[ordinal &
353 TPM_PROTECTED_ORDINAL_MASK];
354
355 if (duration_idx != TPM_UNDEFINED)
356 duration = chip->vendor.duration[duration_idx];
357 if (duration <= 0)
358 return 2 * 60 * HZ;
359 else
360 return duration;
361}
362EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration);
363
364/*
60 * Internal kernel interface to transmit TPM commands 365 * Internal kernel interface to transmit TPM commands
61 */ 366 */
62static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf, 367static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
63 size_t bufsiz) 368 size_t bufsiz)
64{ 369{
65 ssize_t rc; 370 ssize_t rc;
66 u32 count; 371 u32 count, ordinal;
67 unsigned long stop; 372 unsigned long stop;
68 373
69 count = be32_to_cpu(*((__be32 *) (buf + 2))); 374 count = be32_to_cpu(*((__be32 *) (buf + 2)));
70 375 ordinal = be32_to_cpu(*((__be32 *) (buf + 6)));
71 if (count == 0) 376 if (count == 0)
72 return -ENODATA; 377 return -ENODATA;
73 if (count > bufsiz) { 378 if (count > bufsiz) {
@@ -78,21 +383,23 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
78 383
79 down(&chip->tpm_mutex); 384 down(&chip->tpm_mutex);
80 385
81 if ((rc = chip->vendor->send(chip, (u8 *) buf, count)) < 0) { 386 if ((rc = chip->vendor.send(chip, (u8 *) buf, count)) < 0) {
82 dev_err(chip->dev, 387 dev_err(chip->dev,
83 "tpm_transmit: tpm_send: error %zd\n", rc); 388 "tpm_transmit: tpm_send: error %zd\n", rc);
84 goto out; 389 goto out;
85 } 390 }
86 391
87 stop = jiffies + 2 * 60 * HZ; 392 if (chip->vendor.irq)
393 goto out_recv;
394
395 stop = jiffies + tpm_calc_ordinal_duration(chip, ordinal);
88 do { 396 do {
89 u8 status = chip->vendor->status(chip); 397 u8 status = chip->vendor.status(chip);
90 if ((status & chip->vendor->req_complete_mask) == 398 if ((status & chip->vendor.req_complete_mask) ==
91 chip->vendor->req_complete_val) { 399 chip->vendor.req_complete_val)
92 goto out_recv; 400 goto out_recv;
93 }
94 401
95 if ((status == chip->vendor->req_canceled)) { 402 if ((status == chip->vendor.req_canceled)) {
96 dev_err(chip->dev, "Operation Canceled\n"); 403 dev_err(chip->dev, "Operation Canceled\n");
97 rc = -ECANCELED; 404 rc = -ECANCELED;
98 goto out; 405 goto out;
@@ -102,14 +409,13 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
102 rmb(); 409 rmb();
103 } while (time_before(jiffies, stop)); 410 } while (time_before(jiffies, stop));
104 411
105 412 chip->vendor.cancel(chip);
106 chip->vendor->cancel(chip);
107 dev_err(chip->dev, "Operation Timed out\n"); 413 dev_err(chip->dev, "Operation Timed out\n");
108 rc = -ETIME; 414 rc = -ETIME;
109 goto out; 415 goto out;
110 416
111out_recv: 417out_recv:
112 rc = chip->vendor->recv(chip, (u8 *) buf, bufsiz); 418 rc = chip->vendor.recv(chip, (u8 *) buf, bufsiz);
113 if (rc < 0) 419 if (rc < 0)
114 dev_err(chip->dev, 420 dev_err(chip->dev,
115 "tpm_transmit: tpm_recv: error %zd\n", rc); 421 "tpm_transmit: tpm_recv: error %zd\n", rc);
@@ -119,17 +425,247 @@ out:
119} 425}
120 426
121#define TPM_DIGEST_SIZE 20 427#define TPM_DIGEST_SIZE 20
122#define CAP_PCR_RESULT_SIZE 18 428#define TPM_ERROR_SIZE 10
123static const u8 cap_pcr[] = { 429#define TPM_RET_CODE_IDX 6
430#define TPM_GET_CAP_RET_SIZE_IDX 10
431#define TPM_GET_CAP_RET_UINT32_1_IDX 14
432#define TPM_GET_CAP_RET_UINT32_2_IDX 18
433#define TPM_GET_CAP_RET_UINT32_3_IDX 22
434#define TPM_GET_CAP_RET_UINT32_4_IDX 26
435#define TPM_GET_CAP_PERM_DISABLE_IDX 16
436#define TPM_GET_CAP_PERM_INACTIVE_IDX 18
437#define TPM_GET_CAP_RET_BOOL_1_IDX 14
438#define TPM_GET_CAP_TEMP_INACTIVE_IDX 16
439
440#define TPM_CAP_IDX 13
441#define TPM_CAP_SUBCAP_IDX 21
442
443enum tpm_capabilities {
444 TPM_CAP_FLAG = 4,
445 TPM_CAP_PROP = 5,
446};
447
448enum tpm_sub_capabilities {
449 TPM_CAP_PROP_PCR = 0x1,
450 TPM_CAP_PROP_MANUFACTURER = 0x3,
451 TPM_CAP_FLAG_PERM = 0x8,
452 TPM_CAP_FLAG_VOL = 0x9,
453 TPM_CAP_PROP_OWNER = 0x11,
454 TPM_CAP_PROP_TIS_TIMEOUT = 0x15,
455 TPM_CAP_PROP_TIS_DURATION = 0x20,
456};
457
458/*
459 * This is a semi generic GetCapability command for use
460 * with the capability type TPM_CAP_PROP or TPM_CAP_FLAG
461 * and their associated sub_capabilities.
462 */
463
464static const u8 tpm_cap[] = {
124 0, 193, /* TPM_TAG_RQU_COMMAND */ 465 0, 193, /* TPM_TAG_RQU_COMMAND */
125 0, 0, 0, 22, /* length */ 466 0, 0, 0, 22, /* length */
126 0, 0, 0, 101, /* TPM_ORD_GetCapability */ 467 0, 0, 0, 101, /* TPM_ORD_GetCapability */
127 0, 0, 0, 5, 468 0, 0, 0, 0, /* TPM_CAP_<TYPE> */
128 0, 0, 0, 4, 469 0, 0, 0, 4, /* TPM_CAP_SUB_<TYPE> size */
129 0, 0, 1, 1 470 0, 0, 1, 0 /* TPM_CAP_SUB_<TYPE> */
130}; 471};
131 472
132#define READ_PCR_RESULT_SIZE 30 473static ssize_t transmit_cmd(struct tpm_chip *chip, u8 *data, int len,
474 char *desc)
475{
476 int err;
477
478 len = tpm_transmit(chip, data, len);
479 if (len < 0)
480 return len;
481 if (len == TPM_ERROR_SIZE) {
482 err = be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX)));
483 dev_dbg(chip->dev, "A TPM error (%d) occurred %s\n", err, desc);
484 return err;
485 }
486 return 0;
487}
488
489void tpm_gen_interrupt(struct tpm_chip *chip)
490{
491 u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 30)];
492 ssize_t rc;
493
494 memcpy(data, tpm_cap, sizeof(tpm_cap));
495 data[TPM_CAP_IDX] = TPM_CAP_PROP;
496 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_TIS_TIMEOUT;
497
498 rc = transmit_cmd(chip, data, sizeof(data),
499 "attempting to determine the timeouts");
500}
501EXPORT_SYMBOL_GPL(tpm_gen_interrupt);
502
503void tpm_get_timeouts(struct tpm_chip *chip)
504{
505 u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 30)];
506 ssize_t rc;
507 u32 timeout;
508
509 memcpy(data, tpm_cap, sizeof(tpm_cap));
510 data[TPM_CAP_IDX] = TPM_CAP_PROP;
511 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_TIS_TIMEOUT;
512
513 rc = transmit_cmd(chip, data, sizeof(data),
514 "attempting to determine the timeouts");
515 if (rc)
516 goto duration;
517
518 if (be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_SIZE_IDX)))
519 != 4 * sizeof(u32))
520 goto duration;
521
522 /* Don't overwrite default if value is 0 */
523 timeout =
524 be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_1_IDX)));
525 if (timeout)
526 chip->vendor.timeout_a = msecs_to_jiffies(timeout);
527 timeout =
528 be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_2_IDX)));
529 if (timeout)
530 chip->vendor.timeout_b = msecs_to_jiffies(timeout);
531 timeout =
532 be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_3_IDX)));
533 if (timeout)
534 chip->vendor.timeout_c = msecs_to_jiffies(timeout);
535 timeout =
536 be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_4_IDX)));
537 if (timeout)
538 chip->vendor.timeout_d = msecs_to_jiffies(timeout);
539
540duration:
541 memcpy(data, tpm_cap, sizeof(tpm_cap));
542 data[TPM_CAP_IDX] = TPM_CAP_PROP;
543 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_TIS_DURATION;
544
545 rc = transmit_cmd(chip, data, sizeof(data),
546 "attempting to determine the durations");
547 if (rc)
548 return;
549
550 if (be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_SIZE_IDX)))
551 != 3 * sizeof(u32))
552 return;
553
554 chip->vendor.duration[TPM_SHORT] =
555 msecs_to_jiffies(be32_to_cpu
556 (*((__be32 *) (data +
557 TPM_GET_CAP_RET_UINT32_1_IDX))));
558 chip->vendor.duration[TPM_MEDIUM] =
559 msecs_to_jiffies(be32_to_cpu
560 (*((__be32 *) (data +
561 TPM_GET_CAP_RET_UINT32_2_IDX))));
562 chip->vendor.duration[TPM_LONG] =
563 msecs_to_jiffies(be32_to_cpu
564 (*((__be32 *) (data +
565 TPM_GET_CAP_RET_UINT32_3_IDX))));
566}
567EXPORT_SYMBOL_GPL(tpm_get_timeouts);
568
569void tpm_continue_selftest(struct tpm_chip *chip)
570{
571 u8 data[] = {
572 0, 193, /* TPM_TAG_RQU_COMMAND */
573 0, 0, 0, 10, /* length */
574 0, 0, 0, 83, /* TPM_ORD_GetCapability */
575 };
576
577 tpm_transmit(chip, data, sizeof(data));
578}
579EXPORT_SYMBOL_GPL(tpm_continue_selftest);
580
581ssize_t tpm_show_enabled(struct device * dev, struct device_attribute * attr,
582 char *buf)
583{
584 u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 35)];
585 ssize_t rc;
586
587 struct tpm_chip *chip = dev_get_drvdata(dev);
588 if (chip == NULL)
589 return -ENODEV;
590
591 memcpy(data, tpm_cap, sizeof(tpm_cap));
592 data[TPM_CAP_IDX] = TPM_CAP_FLAG;
593 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_PERM;
594
595 rc = transmit_cmd(chip, data, sizeof(data),
596 "attemtping to determine the permanent state");
597 if (rc)
598 return 0;
599 return sprintf(buf, "%d\n", !data[TPM_GET_CAP_PERM_DISABLE_IDX]);
600}
601EXPORT_SYMBOL_GPL(tpm_show_enabled);
602
603ssize_t tpm_show_active(struct device * dev, struct device_attribute * attr,
604 char *buf)
605{
606 u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 35)];
607 ssize_t rc;
608
609 struct tpm_chip *chip = dev_get_drvdata(dev);
610 if (chip == NULL)
611 return -ENODEV;
612
613 memcpy(data, tpm_cap, sizeof(tpm_cap));
614 data[TPM_CAP_IDX] = TPM_CAP_FLAG;
615 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_PERM;
616
617 rc = transmit_cmd(chip, data, sizeof(data),
618 "attemtping to determine the permanent state");
619 if (rc)
620 return 0;
621 return sprintf(buf, "%d\n", !data[TPM_GET_CAP_PERM_INACTIVE_IDX]);
622}
623EXPORT_SYMBOL_GPL(tpm_show_active);
624
625ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr,
626 char *buf)
627{
628 u8 data[sizeof(tpm_cap)];
629 ssize_t rc;
630
631 struct tpm_chip *chip = dev_get_drvdata(dev);
632 if (chip == NULL)
633 return -ENODEV;
634
635 memcpy(data, tpm_cap, sizeof(tpm_cap));
636 data[TPM_CAP_IDX] = TPM_CAP_PROP;
637 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_OWNER;
638
639 rc = transmit_cmd(chip, data, sizeof(data),
640 "attempting to determine the owner state");
641 if (rc)
642 return 0;
643 return sprintf(buf, "%d\n", data[TPM_GET_CAP_RET_BOOL_1_IDX]);
644}
645EXPORT_SYMBOL_GPL(tpm_show_owned);
646
647ssize_t tpm_show_temp_deactivated(struct device * dev,
648 struct device_attribute * attr, char *buf)
649{
650 u8 data[sizeof(tpm_cap)];
651 ssize_t rc;
652
653 struct tpm_chip *chip = dev_get_drvdata(dev);
654 if (chip == NULL)
655 return -ENODEV;
656
657 memcpy(data, tpm_cap, sizeof(tpm_cap));
658 data[TPM_CAP_IDX] = TPM_CAP_FLAG;
659 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_VOL;
660
661 rc = transmit_cmd(chip, data, sizeof(data),
662 "attempting to determine the temporary state");
663 if (rc)
664 return 0;
665 return sprintf(buf, "%d\n", data[TPM_GET_CAP_TEMP_INACTIVE_IDX]);
666}
667EXPORT_SYMBOL_GPL(tpm_show_temp_deactivated);
668
133static const u8 pcrread[] = { 669static const u8 pcrread[] = {
134 0, 193, /* TPM_TAG_RQU_COMMAND */ 670 0, 193, /* TPM_TAG_RQU_COMMAND */
135 0, 0, 0, 14, /* length */ 671 0, 0, 0, 14, /* length */
@@ -140,8 +676,8 @@ static const u8 pcrread[] = {
140ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr, 676ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr,
141 char *buf) 677 char *buf)
142{ 678{
143 u8 data[READ_PCR_RESULT_SIZE]; 679 u8 data[max_t(int, max(ARRAY_SIZE(tpm_cap), ARRAY_SIZE(pcrread)), 30)];
144 ssize_t len; 680 ssize_t rc;
145 int i, j, num_pcrs; 681 int i, j, num_pcrs;
146 __be32 index; 682 __be32 index;
147 char *str = buf; 683 char *str = buf;
@@ -150,29 +686,24 @@ ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr,
150 if (chip == NULL) 686 if (chip == NULL)
151 return -ENODEV; 687 return -ENODEV;
152 688
153 memcpy(data, cap_pcr, sizeof(cap_pcr)); 689 memcpy(data, tpm_cap, sizeof(tpm_cap));
154 if ((len = tpm_transmit(chip, data, sizeof(data))) 690 data[TPM_CAP_IDX] = TPM_CAP_PROP;
155 < CAP_PCR_RESULT_SIZE) { 691 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_PCR;
156 dev_dbg(chip->dev, "A TPM error (%d) occurred " 692
157 "attempting to determine the number of PCRS\n", 693 rc = transmit_cmd(chip, data, sizeof(data),
158 be32_to_cpu(*((__be32 *) (data + 6)))); 694 "attempting to determine the number of PCRS");
695 if (rc)
159 return 0; 696 return 0;
160 }
161 697
162 num_pcrs = be32_to_cpu(*((__be32 *) (data + 14))); 698 num_pcrs = be32_to_cpu(*((__be32 *) (data + 14)));
163
164 for (i = 0; i < num_pcrs; i++) { 699 for (i = 0; i < num_pcrs; i++) {
165 memcpy(data, pcrread, sizeof(pcrread)); 700 memcpy(data, pcrread, sizeof(pcrread));
166 index = cpu_to_be32(i); 701 index = cpu_to_be32(i);
167 memcpy(data + 10, &index, 4); 702 memcpy(data + 10, &index, 4);
168 if ((len = tpm_transmit(chip, data, sizeof(data))) 703 rc = transmit_cmd(chip, data, sizeof(data),
169 < READ_PCR_RESULT_SIZE){ 704 "attempting to read a PCR");
170 dev_dbg(chip->dev, "A TPM error (%d) occurred" 705 if (rc)
171 " attempting to read PCR %d of %d\n",
172 be32_to_cpu(*((__be32 *) (data + 6))),
173 i, num_pcrs);
174 goto out; 706 goto out;
175 }
176 str += sprintf(str, "PCR-%02d: ", i); 707 str += sprintf(str, "PCR-%02d: ", i);
177 for (j = 0; j < TPM_DIGEST_SIZE; j++) 708 for (j = 0; j < TPM_DIGEST_SIZE; j++)
178 str += sprintf(str, "%02X ", *(data + 10 + j)); 709 str += sprintf(str, "%02X ", *(data + 10 + j));
@@ -194,7 +725,7 @@ ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr,
194 char *buf) 725 char *buf)
195{ 726{
196 u8 *data; 727 u8 *data;
197 ssize_t len; 728 ssize_t err;
198 int i, rc; 729 int i, rc;
199 char *str = buf; 730 char *str = buf;
200 731
@@ -208,14 +739,10 @@ ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr,
208 739
209 memcpy(data, readpubek, sizeof(readpubek)); 740 memcpy(data, readpubek, sizeof(readpubek));
210 741
211 if ((len = tpm_transmit(chip, data, READ_PUBEK_RESULT_SIZE)) < 742 err = transmit_cmd(chip, data, READ_PUBEK_RESULT_SIZE,
212 READ_PUBEK_RESULT_SIZE) { 743 "attempting to read the PUBEK");
213 dev_dbg(chip->dev, "A TPM error (%d) occurred " 744 if (err)
214 "attempting to read the PUBEK\n",
215 be32_to_cpu(*((__be32 *) (data + 6))));
216 rc = 0;
217 goto out; 745 goto out;
218 }
219 746
220 /* 747 /*
221 ignore header 10 bytes 748 ignore header 10 bytes
@@ -245,67 +772,110 @@ ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr,
245 if ((i + 1) % 16 == 0) 772 if ((i + 1) % 16 == 0)
246 str += sprintf(str, "\n"); 773 str += sprintf(str, "\n");
247 } 774 }
248 rc = str - buf;
249out: 775out:
776 rc = str - buf;
250 kfree(data); 777 kfree(data);
251 return rc; 778 return rc;
252} 779}
253EXPORT_SYMBOL_GPL(tpm_show_pubek); 780EXPORT_SYMBOL_GPL(tpm_show_pubek);
254 781
255#define CAP_VER_RESULT_SIZE 18 782#define CAP_VERSION_1_1 6
783#define CAP_VERSION_1_2 0x1A
784#define CAP_VERSION_IDX 13
256static const u8 cap_version[] = { 785static const u8 cap_version[] = {
257 0, 193, /* TPM_TAG_RQU_COMMAND */ 786 0, 193, /* TPM_TAG_RQU_COMMAND */
258 0, 0, 0, 18, /* length */ 787 0, 0, 0, 18, /* length */
259 0, 0, 0, 101, /* TPM_ORD_GetCapability */ 788 0, 0, 0, 101, /* TPM_ORD_GetCapability */
260 0, 0, 0, 6, 789 0, 0, 0, 0,
261 0, 0, 0, 0 790 0, 0, 0, 0
262}; 791};
263 792
264#define CAP_MANUFACTURER_RESULT_SIZE 18
265static const u8 cap_manufacturer[] = {
266 0, 193, /* TPM_TAG_RQU_COMMAND */
267 0, 0, 0, 22, /* length */
268 0, 0, 0, 101, /* TPM_ORD_GetCapability */
269 0, 0, 0, 5,
270 0, 0, 0, 4,
271 0, 0, 1, 3
272};
273
274ssize_t tpm_show_caps(struct device *dev, struct device_attribute *attr, 793ssize_t tpm_show_caps(struct device *dev, struct device_attribute *attr,
275 char *buf) 794 char *buf)
276{ 795{
277 u8 data[sizeof(cap_manufacturer)]; 796 u8 data[max_t(int, max(ARRAY_SIZE(tpm_cap), ARRAY_SIZE(cap_version)), 30)];
278 ssize_t len; 797 ssize_t rc;
279 char *str = buf; 798 char *str = buf;
280 799
281 struct tpm_chip *chip = dev_get_drvdata(dev); 800 struct tpm_chip *chip = dev_get_drvdata(dev);
282 if (chip == NULL) 801 if (chip == NULL)
283 return -ENODEV; 802 return -ENODEV;
284 803
285 memcpy(data, cap_manufacturer, sizeof(cap_manufacturer)); 804 memcpy(data, tpm_cap, sizeof(tpm_cap));
805 data[TPM_CAP_IDX] = TPM_CAP_PROP;
806 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_MANUFACTURER;
286 807
287 if ((len = tpm_transmit(chip, data, sizeof(data))) < 808 rc = transmit_cmd(chip, data, sizeof(data),
288 CAP_MANUFACTURER_RESULT_SIZE) 809 "attempting to determine the manufacturer");
289 return len; 810 if (rc)
811 return 0;
290 812
291 str += sprintf(str, "Manufacturer: 0x%x\n", 813 str += sprintf(str, "Manufacturer: 0x%x\n",
292 be32_to_cpu(*((__be32 *) (data + 14)))); 814 be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_1_IDX))));
293 815
294 memcpy(data, cap_version, sizeof(cap_version)); 816 memcpy(data, cap_version, sizeof(cap_version));
817 data[CAP_VERSION_IDX] = CAP_VERSION_1_1;
818 rc = transmit_cmd(chip, data, sizeof(data),
819 "attempting to determine the 1.1 version");
820 if (rc)
821 goto out;
295 822
296 if ((len = tpm_transmit(chip, data, sizeof(data))) < 823 str += sprintf(str,
297 CAP_VER_RESULT_SIZE) 824 "TCG version: %d.%d\nFirmware version: %d.%d\n",
298 return len; 825 (int) data[14], (int) data[15], (int) data[16],
299 826 (int) data[17]);
300 str +=
301 sprintf(str, "TCG version: %d.%d\nFirmware version: %d.%d\n",
302 (int) data[14], (int) data[15], (int) data[16],
303 (int) data[17]);
304 827
828out:
305 return str - buf; 829 return str - buf;
306} 830}
307EXPORT_SYMBOL_GPL(tpm_show_caps); 831EXPORT_SYMBOL_GPL(tpm_show_caps);
308 832
833ssize_t tpm_show_caps_1_2(struct device * dev,
834 struct device_attribute * attr, char *buf)
835{
836 u8 data[max_t(int, max(ARRAY_SIZE(tpm_cap), ARRAY_SIZE(cap_version)), 30)];
837 ssize_t len;
838 char *str = buf;
839
840 struct tpm_chip *chip = dev_get_drvdata(dev);
841 if (chip == NULL)
842 return -ENODEV;
843
844 memcpy(data, tpm_cap, sizeof(tpm_cap));
845 data[TPM_CAP_IDX] = TPM_CAP_PROP;
846 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_MANUFACTURER;
847
848 if ((len = tpm_transmit(chip, data, sizeof(data))) <=
849 TPM_ERROR_SIZE) {
850 dev_dbg(chip->dev, "A TPM error (%d) occurred "
851 "attempting to determine the manufacturer\n",
852 be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX))));
853 return 0;
854 }
855
856 str += sprintf(str, "Manufacturer: 0x%x\n",
857 be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_1_IDX))));
858
859 memcpy(data, cap_version, sizeof(cap_version));
860 data[CAP_VERSION_IDX] = CAP_VERSION_1_2;
861
862 if ((len = tpm_transmit(chip, data, sizeof(data))) <=
863 TPM_ERROR_SIZE) {
864 dev_err(chip->dev, "A TPM error (%d) occurred "
865 "attempting to determine the 1.2 version\n",
866 be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX))));
867 goto out;
868 }
869 str += sprintf(str,
870 "TCG version: %d.%d\nFirmware version: %d.%d\n",
871 (int) data[16], (int) data[17], (int) data[18],
872 (int) data[19]);
873
874out:
875 return str - buf;
876}
877EXPORT_SYMBOL_GPL(tpm_show_caps_1_2);
878
309ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr, 879ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr,
310 const char *buf, size_t count) 880 const char *buf, size_t count)
311{ 881{
@@ -313,7 +883,7 @@ ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr,
313 if (chip == NULL) 883 if (chip == NULL)
314 return 0; 884 return 0;
315 885
316 chip->vendor->cancel(chip); 886 chip->vendor.cancel(chip);
317 return count; 887 return count;
318} 888}
319EXPORT_SYMBOL_GPL(tpm_store_cancel); 889EXPORT_SYMBOL_GPL(tpm_store_cancel);
@@ -329,7 +899,7 @@ int tpm_open(struct inode *inode, struct file *file)
329 spin_lock(&driver_lock); 899 spin_lock(&driver_lock);
330 900
331 list_for_each_entry(pos, &tpm_chip_list, list) { 901 list_for_each_entry(pos, &tpm_chip_list, list) {
332 if (pos->vendor->miscdev.minor == minor) { 902 if (pos->vendor.miscdev.minor == minor) {
333 chip = pos; 903 chip = pos;
334 break; 904 break;
335 } 905 }
@@ -387,7 +957,7 @@ int tpm_release(struct inode *inode, struct file *file)
387EXPORT_SYMBOL_GPL(tpm_release); 957EXPORT_SYMBOL_GPL(tpm_release);
388 958
389ssize_t tpm_write(struct file *file, const char __user *buf, 959ssize_t tpm_write(struct file *file, const char __user *buf,
390 size_t size, loff_t * off) 960 size_t size, loff_t *off)
391{ 961{
392 struct tpm_chip *chip = file->private_data; 962 struct tpm_chip *chip = file->private_data;
393 int in_size = size, out_size; 963 int in_size = size, out_size;
@@ -419,11 +989,10 @@ ssize_t tpm_write(struct file *file, const char __user *buf,
419 989
420 return in_size; 990 return in_size;
421} 991}
422
423EXPORT_SYMBOL_GPL(tpm_write); 992EXPORT_SYMBOL_GPL(tpm_write);
424 993
425ssize_t tpm_read(struct file * file, char __user *buf, 994ssize_t tpm_read(struct file *file, char __user *buf,
426 size_t size, loff_t * off) 995 size_t size, loff_t *off)
427{ 996{
428 struct tpm_chip *chip = file->private_data; 997 struct tpm_chip *chip = file->private_data;
429 int ret_size; 998 int ret_size;
@@ -462,14 +1031,13 @@ void tpm_remove_hardware(struct device *dev)
462 spin_unlock(&driver_lock); 1031 spin_unlock(&driver_lock);
463 1032
464 dev_set_drvdata(dev, NULL); 1033 dev_set_drvdata(dev, NULL);
465 misc_deregister(&chip->vendor->miscdev); 1034 misc_deregister(&chip->vendor.miscdev);
466 kfree(chip->vendor->miscdev.name); 1035 kfree(chip->vendor.miscdev.name);
467 1036
468 sysfs_remove_group(&dev->kobj, chip->vendor->attr_group); 1037 sysfs_remove_group(&dev->kobj, chip->vendor.attr_group);
469 tpm_bios_log_teardown(chip->bios_dir); 1038 tpm_bios_log_teardown(chip->bios_dir);
470 1039
471 dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= 1040 clear_bit(chip->dev_num, dev_mask);
472 ~(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES));
473 1041
474 kfree(chip); 1042 kfree(chip);
475 1043
@@ -520,18 +1088,18 @@ EXPORT_SYMBOL_GPL(tpm_pm_resume);
520 * upon errant exit from this function specific probe function should call 1088 * upon errant exit from this function specific probe function should call
521 * pci_disable_device 1089 * pci_disable_device
522 */ 1090 */
523int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry) 1091struct tpm_chip *tpm_register_hardware(struct device *dev, const struct tpm_vendor_specific
1092 *entry)
524{ 1093{
525#define DEVNAME_SIZE 7 1094#define DEVNAME_SIZE 7
526 1095
527 char *devname; 1096 char *devname;
528 struct tpm_chip *chip; 1097 struct tpm_chip *chip;
529 int i, j;
530 1098
531 /* Driver specific per-device data */ 1099 /* Driver specific per-device data */
532 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 1100 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
533 if (chip == NULL) 1101 if (chip == NULL)
534 return -ENOMEM; 1102 return NULL;
535 1103
536 init_MUTEX(&chip->buffer_mutex); 1104 init_MUTEX(&chip->buffer_mutex);
537 init_MUTEX(&chip->tpm_mutex); 1105 init_MUTEX(&chip->tpm_mutex);
@@ -543,45 +1111,37 @@ int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry)
543 chip->user_read_timer.function = user_reader_timeout; 1111 chip->user_read_timer.function = user_reader_timeout;
544 chip->user_read_timer.data = (unsigned long) chip; 1112 chip->user_read_timer.data = (unsigned long) chip;
545 1113
546 chip->vendor = entry; 1114 memcpy(&chip->vendor, entry, sizeof(struct tpm_vendor_specific));
547
548 chip->dev_num = -1;
549 1115
550 for (i = 0; i < TPM_NUM_MASK_ENTRIES; i++) 1116 chip->dev_num = find_first_zero_bit(dev_mask, TPM_NUM_DEVICES);
551 for (j = 0; j < 8 * sizeof(int); j++)
552 if ((dev_mask[i] & (1 << j)) == 0) {
553 chip->dev_num =
554 i * TPM_NUM_MASK_ENTRIES + j;
555 dev_mask[i] |= 1 << j;
556 goto dev_num_search_complete;
557 }
558 1117
559dev_num_search_complete: 1118 if (chip->dev_num >= TPM_NUM_DEVICES) {
560 if (chip->dev_num < 0) {
561 dev_err(dev, "No available tpm device numbers\n"); 1119 dev_err(dev, "No available tpm device numbers\n");
562 kfree(chip); 1120 kfree(chip);
563 return -ENODEV; 1121 return NULL;
564 } else if (chip->dev_num == 0) 1122 } else if (chip->dev_num == 0)
565 chip->vendor->miscdev.minor = TPM_MINOR; 1123 chip->vendor.miscdev.minor = TPM_MINOR;
566 else 1124 else
567 chip->vendor->miscdev.minor = MISC_DYNAMIC_MINOR; 1125 chip->vendor.miscdev.minor = MISC_DYNAMIC_MINOR;
1126
1127 set_bit(chip->dev_num, dev_mask);
568 1128
569 devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL); 1129 devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL);
570 scnprintf(devname, DEVNAME_SIZE, "%s%d", "tpm", chip->dev_num); 1130 scnprintf(devname, DEVNAME_SIZE, "%s%d", "tpm", chip->dev_num);
571 chip->vendor->miscdev.name = devname; 1131 chip->vendor.miscdev.name = devname;
572 1132
573 chip->vendor->miscdev.dev = dev; 1133 chip->vendor.miscdev.dev = dev;
574 chip->dev = get_device(dev); 1134 chip->dev = get_device(dev);
575 1135
576 if (misc_register(&chip->vendor->miscdev)) { 1136 if (misc_register(&chip->vendor.miscdev)) {
577 dev_err(chip->dev, 1137 dev_err(chip->dev,
578 "unable to misc_register %s, minor %d\n", 1138 "unable to misc_register %s, minor %d\n",
579 chip->vendor->miscdev.name, 1139 chip->vendor.miscdev.name,
580 chip->vendor->miscdev.minor); 1140 chip->vendor.miscdev.minor);
581 put_device(dev); 1141 put_device(dev);
1142 clear_bit(chip->dev_num, dev_mask);
582 kfree(chip); 1143 kfree(chip);
583 dev_mask[i] &= !(1 << j); 1144 return NULL;
584 return -ENODEV;
585 } 1145 }
586 1146
587 spin_lock(&driver_lock); 1147 spin_lock(&driver_lock);
@@ -592,11 +1152,11 @@ dev_num_search_complete:
592 1152
593 spin_unlock(&driver_lock); 1153 spin_unlock(&driver_lock);
594 1154
595 sysfs_create_group(&dev->kobj, chip->vendor->attr_group); 1155 sysfs_create_group(&dev->kobj, chip->vendor.attr_group);
596 1156
597 chip->bios_dir = tpm_bios_log_setup(devname); 1157 chip->bios_dir = tpm_bios_log_setup(devname);
598 1158
599 return 0; 1159 return chip;
600} 1160}
601EXPORT_SYMBOL_GPL(tpm_register_hardware); 1161EXPORT_SYMBOL_GPL(tpm_register_hardware);
602 1162
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index dec0224b4478..54a4c804e25f 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -42,18 +42,30 @@ extern ssize_t tpm_show_pcrs(struct device *, struct device_attribute *attr,
42 char *); 42 char *);
43extern ssize_t tpm_show_caps(struct device *, struct device_attribute *attr, 43extern ssize_t tpm_show_caps(struct device *, struct device_attribute *attr,
44 char *); 44 char *);
45extern ssize_t tpm_show_caps_1_2(struct device *, struct device_attribute *attr,
46 char *);
45extern ssize_t tpm_store_cancel(struct device *, struct device_attribute *attr, 47extern ssize_t tpm_store_cancel(struct device *, struct device_attribute *attr,
46 const char *, size_t); 48 const char *, size_t);
49extern ssize_t tpm_show_enabled(struct device *, struct device_attribute *attr,
50 char *);
51extern ssize_t tpm_show_active(struct device *, struct device_attribute *attr,
52 char *);
53extern ssize_t tpm_show_owned(struct device *, struct device_attribute *attr,
54 char *);
55extern ssize_t tpm_show_temp_deactivated(struct device *,
56 struct device_attribute *attr, char *);
47 57
48struct tpm_chip; 58struct tpm_chip;
49 59
50struct tpm_vendor_specific { 60struct tpm_vendor_specific {
51 u8 req_complete_mask; 61 const u8 req_complete_mask;
52 u8 req_complete_val; 62 const u8 req_complete_val;
53 u8 req_canceled; 63 const u8 req_canceled;
54 void __iomem *iobase; /* ioremapped address */ 64 void __iomem *iobase; /* ioremapped address */
55 unsigned long base; /* TPM base address */ 65 unsigned long base; /* TPM base address */
56 66
67 int irq;
68
57 int region_size; 69 int region_size;
58 int have_region; 70 int have_region;
59 71
@@ -63,6 +75,13 @@ struct tpm_vendor_specific {
63 u8 (*status) (struct tpm_chip *); 75 u8 (*status) (struct tpm_chip *);
64 struct miscdevice miscdev; 76 struct miscdevice miscdev;
65 struct attribute_group *attr_group; 77 struct attribute_group *attr_group;
78 struct list_head list;
79 int locality;
80 unsigned long timeout_a, timeout_b, timeout_c, timeout_d; /* jiffies */
81 unsigned long duration[3]; /* jiffies */
82
83 wait_queue_head_t read_queue;
84 wait_queue_head_t int_queue;
66}; 85};
67 86
68struct tpm_chip { 87struct tpm_chip {
@@ -81,13 +100,15 @@ struct tpm_chip {
81 struct work_struct work; 100 struct work_struct work;
82 struct semaphore tpm_mutex; /* tpm is processing */ 101 struct semaphore tpm_mutex; /* tpm is processing */
83 102
84 struct tpm_vendor_specific *vendor; 103 struct tpm_vendor_specific vendor;
85 104
86 struct dentry **bios_dir; 105 struct dentry **bios_dir;
87 106
88 struct list_head list; 107 struct list_head list;
89}; 108};
90 109
110#define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
111
91static inline int tpm_read_index(int base, int index) 112static inline int tpm_read_index(int base, int index)
92{ 113{
93 outb(index, base); 114 outb(index, base);
@@ -100,8 +121,12 @@ static inline void tpm_write_index(int base, int index, int value)
100 outb(value & 0xFF, base+1); 121 outb(value & 0xFF, base+1);
101} 122}
102 123
103extern int tpm_register_hardware(struct device *, 124extern void tpm_get_timeouts(struct tpm_chip *);
104 struct tpm_vendor_specific *); 125extern void tpm_gen_interrupt(struct tpm_chip *);
126extern void tpm_continue_selftest(struct tpm_chip *);
127extern unsigned long tpm_calc_ordinal_duration(struct tpm_chip *, u32);
128extern struct tpm_chip* tpm_register_hardware(struct device *,
129 const struct tpm_vendor_specific *);
105extern int tpm_open(struct inode *, struct file *); 130extern int tpm_open(struct inode *, struct file *);
106extern int tpm_release(struct inode *, struct file *); 131extern int tpm_release(struct inode *, struct file *);
107extern ssize_t tpm_write(struct file *, const char __user *, size_t, 132extern ssize_t tpm_write(struct file *, const char __user *, size_t,
diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c
index ff3654964fe3..58a258cec153 100644
--- a/drivers/char/tpm/tpm_atmel.c
+++ b/drivers/char/tpm/tpm_atmel.c
@@ -47,12 +47,12 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
47 return -EIO; 47 return -EIO;
48 48
49 for (i = 0; i < 6; i++) { 49 for (i = 0; i < 6; i++) {
50 status = ioread8(chip->vendor->iobase + 1); 50 status = ioread8(chip->vendor.iobase + 1);
51 if ((status & ATML_STATUS_DATA_AVAIL) == 0) { 51 if ((status & ATML_STATUS_DATA_AVAIL) == 0) {
52 dev_err(chip->dev, "error reading header\n"); 52 dev_err(chip->dev, "error reading header\n");
53 return -EIO; 53 return -EIO;
54 } 54 }
55 *buf++ = ioread8(chip->vendor->iobase); 55 *buf++ = ioread8(chip->vendor.iobase);
56 } 56 }
57 57
58 /* size of the data received */ 58 /* size of the data received */
@@ -63,7 +63,7 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
63 dev_err(chip->dev, 63 dev_err(chip->dev,
64 "Recv size(%d) less than available space\n", size); 64 "Recv size(%d) less than available space\n", size);
65 for (; i < size; i++) { /* clear the waiting data anyway */ 65 for (; i < size; i++) { /* clear the waiting data anyway */
66 status = ioread8(chip->vendor->iobase + 1); 66 status = ioread8(chip->vendor.iobase + 1);
67 if ((status & ATML_STATUS_DATA_AVAIL) == 0) { 67 if ((status & ATML_STATUS_DATA_AVAIL) == 0) {
68 dev_err(chip->dev, "error reading data\n"); 68 dev_err(chip->dev, "error reading data\n");
69 return -EIO; 69 return -EIO;
@@ -74,16 +74,16 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
74 74
75 /* read all the data available */ 75 /* read all the data available */
76 for (; i < size; i++) { 76 for (; i < size; i++) {
77 status = ioread8(chip->vendor->iobase + 1); 77 status = ioread8(chip->vendor.iobase + 1);
78 if ((status & ATML_STATUS_DATA_AVAIL) == 0) { 78 if ((status & ATML_STATUS_DATA_AVAIL) == 0) {
79 dev_err(chip->dev, "error reading data\n"); 79 dev_err(chip->dev, "error reading data\n");
80 return -EIO; 80 return -EIO;
81 } 81 }
82 *buf++ = ioread8(chip->vendor->iobase); 82 *buf++ = ioread8(chip->vendor.iobase);
83 } 83 }
84 84
85 /* make sure data available is gone */ 85 /* make sure data available is gone */
86 status = ioread8(chip->vendor->iobase + 1); 86 status = ioread8(chip->vendor.iobase + 1);
87 87
88 if (status & ATML_STATUS_DATA_AVAIL) { 88 if (status & ATML_STATUS_DATA_AVAIL) {
89 dev_err(chip->dev, "data available is stuck\n"); 89 dev_err(chip->dev, "data available is stuck\n");
@@ -100,7 +100,7 @@ static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
100 dev_dbg(chip->dev, "tpm_atml_send:\n"); 100 dev_dbg(chip->dev, "tpm_atml_send:\n");
101 for (i = 0; i < count; i++) { 101 for (i = 0; i < count; i++) {
102 dev_dbg(chip->dev, "%d 0x%x(%d)\n", i, buf[i], buf[i]); 102 dev_dbg(chip->dev, "%d 0x%x(%d)\n", i, buf[i], buf[i]);
103 iowrite8(buf[i], chip->vendor->iobase); 103 iowrite8(buf[i], chip->vendor.iobase);
104 } 104 }
105 105
106 return count; 106 return count;
@@ -108,12 +108,12 @@ static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
108 108
109static void tpm_atml_cancel(struct tpm_chip *chip) 109static void tpm_atml_cancel(struct tpm_chip *chip)
110{ 110{
111 iowrite8(ATML_STATUS_ABORT, chip->vendor->iobase + 1); 111 iowrite8(ATML_STATUS_ABORT, chip->vendor.iobase + 1);
112} 112}
113 113
114static u8 tpm_atml_status(struct tpm_chip *chip) 114static u8 tpm_atml_status(struct tpm_chip *chip)
115{ 115{
116 return ioread8(chip->vendor->iobase + 1); 116 return ioread8(chip->vendor.iobase + 1);
117} 117}
118 118
119static struct file_operations atmel_ops = { 119static struct file_operations atmel_ops = {
@@ -140,7 +140,7 @@ static struct attribute* atmel_attrs[] = {
140 140
141static struct attribute_group atmel_attr_grp = { .attrs = atmel_attrs }; 141static struct attribute_group atmel_attr_grp = { .attrs = atmel_attrs };
142 142
143static struct tpm_vendor_specific tpm_atmel = { 143static const struct tpm_vendor_specific tpm_atmel = {
144 .recv = tpm_atml_recv, 144 .recv = tpm_atml_recv,
145 .send = tpm_atml_send, 145 .send = tpm_atml_send,
146 .cancel = tpm_atml_cancel, 146 .cancel = tpm_atml_cancel,
@@ -159,10 +159,10 @@ static void atml_plat_remove(void)
159 struct tpm_chip *chip = dev_get_drvdata(&pdev->dev); 159 struct tpm_chip *chip = dev_get_drvdata(&pdev->dev);
160 160
161 if (chip) { 161 if (chip) {
162 if (chip->vendor->have_region) 162 if (chip->vendor.have_region)
163 atmel_release_region(chip->vendor->base, 163 atmel_release_region(chip->vendor.base,
164 chip->vendor->region_size); 164 chip->vendor.region_size);
165 atmel_put_base_addr(chip->vendor); 165 atmel_put_base_addr(chip->vendor.iobase);
166 tpm_remove_hardware(chip->dev); 166 tpm_remove_hardware(chip->dev);
167 platform_device_unregister(pdev); 167 platform_device_unregister(pdev);
168 } 168 }
@@ -179,18 +179,22 @@ static struct device_driver atml_drv = {
179static int __init init_atmel(void) 179static int __init init_atmel(void)
180{ 180{
181 int rc = 0; 181 int rc = 0;
182 void __iomem *iobase = NULL;
183 int have_region, region_size;
184 unsigned long base;
185 struct tpm_chip *chip;
182 186
183 driver_register(&atml_drv); 187 driver_register(&atml_drv);
184 188
185 if ((tpm_atmel.iobase = atmel_get_base_addr(&tpm_atmel)) == NULL) { 189 if ((iobase = atmel_get_base_addr(&base, &region_size)) == NULL) {
186 rc = -ENODEV; 190 rc = -ENODEV;
187 goto err_unreg_drv; 191 goto err_unreg_drv;
188 } 192 }
189 193
190 tpm_atmel.have_region = 194 have_region =
191 (atmel_request_region 195 (atmel_request_region
192 (tpm_atmel.base, tpm_atmel.region_size, 196 (tpm_atmel.base, region_size, "tpm_atmel0") == NULL) ? 0 : 1;
193 "tpm_atmel0") == NULL) ? 0 : 1; 197
194 198
195 if (IS_ERR 199 if (IS_ERR
196 (pdev = 200 (pdev =
@@ -199,17 +203,25 @@ static int __init init_atmel(void)
199 goto err_rel_reg; 203 goto err_rel_reg;
200 } 204 }
201 205
202 if ((rc = tpm_register_hardware(&pdev->dev, &tpm_atmel)) < 0) 206 if (!(chip = tpm_register_hardware(&pdev->dev, &tpm_atmel))) {
207 rc = -ENODEV;
203 goto err_unreg_dev; 208 goto err_unreg_dev;
209 }
210
211 chip->vendor.iobase = iobase;
212 chip->vendor.base = base;
213 chip->vendor.have_region = have_region;
214 chip->vendor.region_size = region_size;
215
204 return 0; 216 return 0;
205 217
206err_unreg_dev: 218err_unreg_dev:
207 platform_device_unregister(pdev); 219 platform_device_unregister(pdev);
208err_rel_reg: 220err_rel_reg:
209 atmel_put_base_addr(&tpm_atmel); 221 atmel_put_base_addr(iobase);
210 if (tpm_atmel.have_region) 222 if (have_region)
211 atmel_release_region(tpm_atmel.base, 223 atmel_release_region(base,
212 tpm_atmel.region_size); 224 region_size);
213err_unreg_drv: 225err_unreg_drv:
214 driver_unregister(&atml_drv); 226 driver_unregister(&atml_drv);
215 return rc; 227 return rc;
diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h
index d3478aaadd77..2e68eeb8a2cd 100644
--- a/drivers/char/tpm/tpm_atmel.h
+++ b/drivers/char/tpm/tpm_atmel.h
@@ -28,13 +28,12 @@
28#define atmel_request_region request_mem_region 28#define atmel_request_region request_mem_region
29#define atmel_release_region release_mem_region 29#define atmel_release_region release_mem_region
30 30
31static inline void atmel_put_base_addr(struct tpm_vendor_specific 31static inline void atmel_put_base_addr(void __iomem *iobase)
32 *vendor)
33{ 32{
34 iounmap(vendor->iobase); 33 iounmap(iobase);
35} 34}
36 35
37static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific *vendor) 36static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size)
38{ 37{
39 struct device_node *dn; 38 struct device_node *dn;
40 unsigned long address, size; 39 unsigned long address, size;
@@ -71,9 +70,9 @@ static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific *vendor)
71 else 70 else
72 size = reg[naddrc]; 71 size = reg[naddrc];
73 72
74 vendor->base = address; 73 *base = address;
75 vendor->region_size = size; 74 *region_size = size;
76 return ioremap(vendor->base, vendor->region_size); 75 return ioremap(*base, *region_size);
77} 76}
78#else 77#else
79#define atmel_getb(chip, offset) inb(chip->vendor->base + offset) 78#define atmel_getb(chip, offset) inb(chip->vendor->base + offset)
@@ -106,14 +105,12 @@ static int atmel_verify_tpm11(void)
106 return 0; 105 return 0;
107} 106}
108 107
109static inline void atmel_put_base_addr(struct tpm_vendor_specific 108static inline void atmel_put_base_addr(void __iomem *iobase)
110 *vendor)
111{ 109{
112} 110}
113 111
114/* Determine where to talk to device */ 112/* Determine where to talk to device */
115static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific 113static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size)
116 *vendor)
117{ 114{
118 int lo, hi; 115 int lo, hi;
119 116
@@ -123,9 +120,9 @@ static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific
123 lo = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_LO); 120 lo = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_LO);
124 hi = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_HI); 121 hi = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_HI);
125 122
126 vendor->base = (hi << 8) | lo; 123 *base = (hi << 8) | lo;
127 vendor->region_size = 2; 124 *region_size = 2;
128 125
129 return ioport_map(vendor->base, vendor->region_size); 126 return ioport_map(*base, *region_size);
130} 127}
131#endif 128#endif
diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c
index 537aa45d8c67..e45f0d3d12de 100644
--- a/drivers/char/tpm/tpm_bios.c
+++ b/drivers/char/tpm/tpm_bios.c
@@ -29,6 +29,11 @@
29#define MAX_TEXT_EVENT 1000 /* Max event string length */ 29#define MAX_TEXT_EVENT 1000 /* Max event string length */
30#define ACPI_TCPA_SIG "TCPA" /* 0x41504354 /'TCPA' */ 30#define ACPI_TCPA_SIG "TCPA" /* 0x41504354 /'TCPA' */
31 31
32enum bios_platform_class {
33 BIOS_CLIENT = 0x00,
34 BIOS_SERVER = 0x01,
35};
36
32struct tpm_bios_log { 37struct tpm_bios_log {
33 void *bios_event_log; 38 void *bios_event_log;
34 void *bios_event_log_end; 39 void *bios_event_log_end;
@@ -36,9 +41,18 @@ struct tpm_bios_log {
36 41
37struct acpi_tcpa { 42struct acpi_tcpa {
38 struct acpi_table_header hdr; 43 struct acpi_table_header hdr;
39 u16 reserved; 44 u16 platform_class;
40 u32 log_max_len __attribute__ ((packed)); 45 union {
41 u32 log_start_addr __attribute__ ((packed)); 46 struct client_hdr {
47 u32 log_max_len __attribute__ ((packed));
48 u64 log_start_addr __attribute__ ((packed));
49 } client;
50 struct server_hdr {
51 u16 reserved;
52 u64 log_max_len __attribute__ ((packed));
53 u64 log_start_addr __attribute__ ((packed));
54 } server;
55 };
42}; 56};
43 57
44struct tcpa_event { 58struct tcpa_event {
@@ -120,6 +134,7 @@ static const char* tcpa_pc_event_id_strings[] = {
120 "S-CRTM Version", 134 "S-CRTM Version",
121 "S-CRTM Contents", 135 "S-CRTM Contents",
122 "S-CRTM POST Contents", 136 "S-CRTM POST Contents",
137 "POST Contents",
123}; 138};
124 139
125/* returns pointer to start of pos. entry of tcg log */ 140/* returns pointer to start of pos. entry of tcg log */
@@ -306,6 +321,7 @@ static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v)
306 /* 5th: delimiter */ 321 /* 5th: delimiter */
307 seq_putc(m, '\0'); 322 seq_putc(m, '\0');
308 323
324 kfree(eventname);
309 return 0; 325 return 0;
310} 326}
311 327
@@ -353,6 +369,7 @@ static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v)
353 /* 4th: eventname <= max + \'0' delimiter */ 369 /* 4th: eventname <= max + \'0' delimiter */
354 seq_printf(m, " %s\n", eventname); 370 seq_printf(m, " %s\n", eventname);
355 371
372 kfree(eventname);
356 return 0; 373 return 0;
357} 374}
358 375
@@ -376,6 +393,7 @@ static int read_log(struct tpm_bios_log *log)
376 struct acpi_tcpa *buff; 393 struct acpi_tcpa *buff;
377 acpi_status status; 394 acpi_status status;
378 struct acpi_table_header *virt; 395 struct acpi_table_header *virt;
396 u64 len, start;
379 397
380 if (log->bios_event_log != NULL) { 398 if (log->bios_event_log != NULL) {
381 printk(KERN_ERR 399 printk(KERN_ERR
@@ -396,27 +414,37 @@ static int read_log(struct tpm_bios_log *log)
396 return -EIO; 414 return -EIO;
397 } 415 }
398 416
399 if (buff->log_max_len == 0) { 417 switch(buff->platform_class) {
418 case BIOS_SERVER:
419 len = buff->server.log_max_len;
420 start = buff->server.log_start_addr;
421 break;
422 case BIOS_CLIENT:
423 default:
424 len = buff->client.log_max_len;
425 start = buff->client.log_start_addr;
426 break;
427 }
428 if (!len) {
400 printk(KERN_ERR "%s: ERROR - TCPA log area empty\n", __func__); 429 printk(KERN_ERR "%s: ERROR - TCPA log area empty\n", __func__);
401 return -EIO; 430 return -EIO;
402 } 431 }
403 432
404 /* malloc EventLog space */ 433 /* malloc EventLog space */
405 log->bios_event_log = kmalloc(buff->log_max_len, GFP_KERNEL); 434 log->bios_event_log = kmalloc(len, GFP_KERNEL);
406 if (!log->bios_event_log) { 435 if (!log->bios_event_log) {
407 printk 436 printk("%s: ERROR - Not enough Memory for BIOS measurements\n",
408 ("%s: ERROR - Not enough Memory for BIOS measurements\n", 437 __func__);
409 __func__);
410 return -ENOMEM; 438 return -ENOMEM;
411 } 439 }
412 440
413 log->bios_event_log_end = log->bios_event_log + buff->log_max_len; 441 log->bios_event_log_end = log->bios_event_log + len;
414 442
415 acpi_os_map_memory(buff->log_start_addr, buff->log_max_len, (void *) &virt); 443 acpi_os_map_memory(start, len, (void *) &virt);
416 444
417 memcpy(log->bios_event_log, virt, buff->log_max_len); 445 memcpy(log->bios_event_log, virt, len);
418 446
419 acpi_os_unmap_memory(virt, buff->log_max_len); 447 acpi_os_unmap_memory(virt, len);
420 return 0; 448 return 0;
421} 449}
422 450
diff --git a/drivers/char/tpm/tpm_infineon.c b/drivers/char/tpm/tpm_infineon.c
index 24095f6ee6da..adfff21beb21 100644
--- a/drivers/char/tpm/tpm_infineon.c
+++ b/drivers/char/tpm/tpm_infineon.c
@@ -15,6 +15,7 @@
15 * License. 15 * License.
16 */ 16 */
17 17
18#include <linux/init.h>
18#include <linux/pnp.h> 19#include <linux/pnp.h>
19#include "tpm.h" 20#include "tpm.h"
20 21
@@ -104,7 +105,7 @@ static int empty_fifo(struct tpm_chip *chip, int clear_wrfifo)
104 105
105 if (clear_wrfifo) { 106 if (clear_wrfifo) {
106 for (i = 0; i < 4096; i++) { 107 for (i = 0; i < 4096; i++) {
107 status = inb(chip->vendor->base + WRFIFO); 108 status = inb(chip->vendor.base + WRFIFO);
108 if (status == 0xff) { 109 if (status == 0xff) {
109 if (check == 5) 110 if (check == 5)
110 break; 111 break;
@@ -124,8 +125,8 @@ static int empty_fifo(struct tpm_chip *chip, int clear_wrfifo)
124 */ 125 */
125 i = 0; 126 i = 0;
126 do { 127 do {
127 status = inb(chip->vendor->base + RDFIFO); 128 status = inb(chip->vendor.base + RDFIFO);
128 status = inb(chip->vendor->base + STAT); 129 status = inb(chip->vendor.base + STAT);
129 i++; 130 i++;
130 if (i == TPM_MAX_TRIES) 131 if (i == TPM_MAX_TRIES)
131 return -EIO; 132 return -EIO;
@@ -138,7 +139,7 @@ static int wait(struct tpm_chip *chip, int wait_for_bit)
138 int status; 139 int status;
139 int i; 140 int i;
140 for (i = 0; i < TPM_MAX_TRIES; i++) { 141 for (i = 0; i < TPM_MAX_TRIES; i++) {
141 status = inb(chip->vendor->base + STAT); 142 status = inb(chip->vendor.base + STAT);
142 /* check the status-register if wait_for_bit is set */ 143 /* check the status-register if wait_for_bit is set */
143 if (status & 1 << wait_for_bit) 144 if (status & 1 << wait_for_bit)
144 break; 145 break;
@@ -157,7 +158,7 @@ static int wait(struct tpm_chip *chip, int wait_for_bit)
157static void wait_and_send(struct tpm_chip *chip, u8 sendbyte) 158static void wait_and_send(struct tpm_chip *chip, u8 sendbyte)
158{ 159{
159 wait(chip, STAT_XFE); 160 wait(chip, STAT_XFE);
160 outb(sendbyte, chip->vendor->base + WRFIFO); 161 outb(sendbyte, chip->vendor.base + WRFIFO);
161} 162}
162 163
163 /* Note: WTX means Waiting-Time-Extension. Whenever the TPM needs more 164 /* Note: WTX means Waiting-Time-Extension. Whenever the TPM needs more
@@ -204,7 +205,7 @@ recv_begin:
204 ret = wait(chip, STAT_RDA); 205 ret = wait(chip, STAT_RDA);
205 if (ret) 206 if (ret)
206 return -EIO; 207 return -EIO;
207 buf[i] = inb(chip->vendor->base + RDFIFO); 208 buf[i] = inb(chip->vendor.base + RDFIFO);
208 } 209 }
209 210
210 if (buf[0] != TPM_VL_VER) { 211 if (buf[0] != TPM_VL_VER) {
@@ -219,7 +220,7 @@ recv_begin:
219 220
220 for (i = 0; i < size; i++) { 221 for (i = 0; i < size; i++) {
221 wait(chip, STAT_RDA); 222 wait(chip, STAT_RDA);
222 buf[i] = inb(chip->vendor->base + RDFIFO); 223 buf[i] = inb(chip->vendor.base + RDFIFO);
223 } 224 }
224 225
225 if ((size == 0x6D00) && (buf[1] == 0x80)) { 226 if ((size == 0x6D00) && (buf[1] == 0x80)) {
@@ -268,7 +269,7 @@ static int tpm_inf_send(struct tpm_chip *chip, u8 * buf, size_t count)
268 u8 count_high, count_low, count_4, count_3, count_2, count_1; 269 u8 count_high, count_low, count_4, count_3, count_2, count_1;
269 270
270 /* Disabling Reset, LP and IRQC */ 271 /* Disabling Reset, LP and IRQC */
271 outb(RESET_LP_IRQC_DISABLE, chip->vendor->base + CMD); 272 outb(RESET_LP_IRQC_DISABLE, chip->vendor.base + CMD);
272 273
273 ret = empty_fifo(chip, 1); 274 ret = empty_fifo(chip, 1);
274 if (ret) { 275 if (ret) {
@@ -319,7 +320,7 @@ static void tpm_inf_cancel(struct tpm_chip *chip)
319 320
320static u8 tpm_inf_status(struct tpm_chip *chip) 321static u8 tpm_inf_status(struct tpm_chip *chip)
321{ 322{
322 return inb(chip->vendor->base + STAT); 323 return inb(chip->vendor.base + STAT);
323} 324}
324 325
325static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL); 326static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
@@ -346,7 +347,7 @@ static struct file_operations inf_ops = {
346 .release = tpm_release, 347 .release = tpm_release,
347}; 348};
348 349
349static struct tpm_vendor_specific tpm_inf = { 350static const struct tpm_vendor_specific tpm_inf = {
350 .recv = tpm_inf_recv, 351 .recv = tpm_inf_recv,
351 .send = tpm_inf_send, 352 .send = tpm_inf_send,
352 .cancel = tpm_inf_cancel, 353 .cancel = tpm_inf_cancel,
@@ -375,6 +376,7 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
375 int version[2]; 376 int version[2];
376 int productid[2]; 377 int productid[2];
377 char chipname[20]; 378 char chipname[20];
379 struct tpm_chip *chip;
378 380
379 /* read IO-ports through PnP */ 381 /* read IO-ports through PnP */
380 if (pnp_port_valid(dev, 0) && pnp_port_valid(dev, 1) && 382 if (pnp_port_valid(dev, 0) && pnp_port_valid(dev, 1) &&
@@ -395,14 +397,13 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
395 goto err_last; 397 goto err_last;
396 } 398 }
397 /* publish my base address and request region */ 399 /* publish my base address and request region */
398 tpm_inf.base = TPM_INF_BASE;
399 if (request_region 400 if (request_region
400 (tpm_inf.base, TPM_INF_PORT_LEN, "tpm_infineon0") == NULL) { 401 (TPM_INF_BASE, TPM_INF_PORT_LEN, "tpm_infineon0") == NULL) {
401 rc = -EINVAL; 402 rc = -EINVAL;
402 goto err_last; 403 goto err_last;
403 } 404 }
404 if (request_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN, 405 if (request_region
405 "tpm_infineon0") == NULL) { 406 (TPM_INF_ADDR, TPM_INF_ADDR_LEN, "tpm_infineon0") == NULL) {
406 rc = -EINVAL; 407 rc = -EINVAL;
407 goto err_last; 408 goto err_last;
408 } 409 }
@@ -442,9 +443,9 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
442 443
443 /* configure TPM with IO-ports */ 444 /* configure TPM with IO-ports */
444 outb(IOLIMH, TPM_INF_ADDR); 445 outb(IOLIMH, TPM_INF_ADDR);
445 outb(((tpm_inf.base >> 8) & 0xff), TPM_INF_DATA); 446 outb(((TPM_INF_BASE >> 8) & 0xff), TPM_INF_DATA);
446 outb(IOLIML, TPM_INF_ADDR); 447 outb(IOLIML, TPM_INF_ADDR);
447 outb((tpm_inf.base & 0xff), TPM_INF_DATA); 448 outb((TPM_INF_BASE & 0xff), TPM_INF_DATA);
448 449
449 /* control if IO-ports are set correctly */ 450 /* control if IO-ports are set correctly */
450 outb(IOLIMH, TPM_INF_ADDR); 451 outb(IOLIMH, TPM_INF_ADDR);
@@ -452,10 +453,10 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
452 outb(IOLIML, TPM_INF_ADDR); 453 outb(IOLIML, TPM_INF_ADDR);
453 iol = inb(TPM_INF_DATA); 454 iol = inb(TPM_INF_DATA);
454 455
455 if ((ioh << 8 | iol) != tpm_inf.base) { 456 if ((ioh << 8 | iol) != TPM_INF_BASE) {
456 dev_err(&dev->dev, 457 dev_err(&dev->dev,
457 "Could not set IO-ports to 0x%lx\n", 458 "Could not set IO-ports to 0x%x\n",
458 tpm_inf.base); 459 TPM_INF_BASE);
459 rc = -EIO; 460 rc = -EIO;
460 goto err_release_region; 461 goto err_release_region;
461 } 462 }
@@ -466,15 +467,15 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
466 outb(DISABLE_REGISTER_PAIR, TPM_INF_ADDR); 467 outb(DISABLE_REGISTER_PAIR, TPM_INF_ADDR);
467 468
468 /* disable RESET, LP and IRQC */ 469 /* disable RESET, LP and IRQC */
469 outb(RESET_LP_IRQC_DISABLE, tpm_inf.base + CMD); 470 outb(RESET_LP_IRQC_DISABLE, TPM_INF_BASE + CMD);
470 471
471 /* Finally, we're done, print some infos */ 472 /* Finally, we're done, print some infos */
472 dev_info(&dev->dev, "TPM found: " 473 dev_info(&dev->dev, "TPM found: "
473 "config base 0x%x, " 474 "config base 0x%x, "
474 "io base 0x%x, " 475 "io base 0x%x, "
475 "chip version %02x%02x, " 476 "chip version 0x%02x%02x, "
476 "vendor id %x%x (Infineon), " 477 "vendor id 0x%x%x (Infineon), "
477 "product id %02x%02x" 478 "product id 0x%02x%02x"
478 "%s\n", 479 "%s\n",
479 TPM_INF_ADDR, 480 TPM_INF_ADDR,
480 TPM_INF_BASE, 481 TPM_INF_BASE,
@@ -482,11 +483,10 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
482 vendorid[0], vendorid[1], 483 vendorid[0], vendorid[1],
483 productid[0], productid[1], chipname); 484 productid[0], productid[1], chipname);
484 485
485 rc = tpm_register_hardware(&dev->dev, &tpm_inf); 486 if (!(chip = tpm_register_hardware(&dev->dev, &tpm_inf))) {
486 if (rc < 0) {
487 rc = -ENODEV;
488 goto err_release_region; 487 goto err_release_region;
489 } 488 }
489 chip->vendor.base = TPM_INF_BASE;
490 return 0; 490 return 0;
491 } else { 491 } else {
492 rc = -ENODEV; 492 rc = -ENODEV;
@@ -494,7 +494,7 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
494 } 494 }
495 495
496err_release_region: 496err_release_region:
497 release_region(tpm_inf.base, TPM_INF_PORT_LEN); 497 release_region(TPM_INF_BASE, TPM_INF_PORT_LEN);
498 release_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN); 498 release_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN);
499 499
500err_last: 500err_last:
@@ -506,7 +506,8 @@ static __devexit void tpm_inf_pnp_remove(struct pnp_dev *dev)
506 struct tpm_chip *chip = pnp_get_drvdata(dev); 506 struct tpm_chip *chip = pnp_get_drvdata(dev);
507 507
508 if (chip) { 508 if (chip) {
509 release_region(chip->vendor->base, TPM_INF_PORT_LEN); 509 release_region(TPM_INF_BASE, TPM_INF_PORT_LEN);
510 release_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN);
510 tpm_remove_hardware(chip->dev); 511 tpm_remove_hardware(chip->dev);
511 } 512 }
512} 513}
@@ -520,7 +521,7 @@ static struct pnp_driver tpm_inf_pnp = {
520 }, 521 },
521 .id_table = tpm_pnp_tbl, 522 .id_table = tpm_pnp_tbl,
522 .probe = tpm_inf_pnp_probe, 523 .probe = tpm_inf_pnp_probe,
523 .remove = tpm_inf_pnp_remove, 524 .remove = __devexit_p(tpm_inf_pnp_remove),
524}; 525};
525 526
526static int __init init_inf(void) 527static int __init init_inf(void)
@@ -538,5 +539,5 @@ module_exit(cleanup_inf);
538 539
539MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>"); 540MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>");
540MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2"); 541MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2");
541MODULE_VERSION("1.7"); 542MODULE_VERSION("1.8");
542MODULE_LICENSE("GPL"); 543MODULE_LICENSE("GPL");
diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c
index 680a8e331887..4c8bc06c7d95 100644
--- a/drivers/char/tpm/tpm_nsc.c
+++ b/drivers/char/tpm/tpm_nsc.c
@@ -71,7 +71,7 @@ static int wait_for_stat(struct tpm_chip *chip, u8 mask, u8 val, u8 * data)
71 unsigned long stop; 71 unsigned long stop;
72 72
73 /* status immediately available check */ 73 /* status immediately available check */
74 *data = inb(chip->vendor->base + NSC_STATUS); 74 *data = inb(chip->vendor.base + NSC_STATUS);
75 if ((*data & mask) == val) 75 if ((*data & mask) == val)
76 return 0; 76 return 0;
77 77
@@ -79,7 +79,7 @@ static int wait_for_stat(struct tpm_chip *chip, u8 mask, u8 val, u8 * data)
79 stop = jiffies + 10 * HZ; 79 stop = jiffies + 10 * HZ;
80 do { 80 do {
81 msleep(TPM_TIMEOUT); 81 msleep(TPM_TIMEOUT);
82 *data = inb(chip->vendor->base + 1); 82 *data = inb(chip->vendor.base + 1);
83 if ((*data & mask) == val) 83 if ((*data & mask) == val)
84 return 0; 84 return 0;
85 } 85 }
@@ -94,9 +94,9 @@ static int nsc_wait_for_ready(struct tpm_chip *chip)
94 unsigned long stop; 94 unsigned long stop;
95 95
96 /* status immediately available check */ 96 /* status immediately available check */
97 status = inb(chip->vendor->base + NSC_STATUS); 97 status = inb(chip->vendor.base + NSC_STATUS);
98 if (status & NSC_STATUS_OBF) 98 if (status & NSC_STATUS_OBF)
99 status = inb(chip->vendor->base + NSC_DATA); 99 status = inb(chip->vendor.base + NSC_DATA);
100 if (status & NSC_STATUS_RDY) 100 if (status & NSC_STATUS_RDY)
101 return 0; 101 return 0;
102 102
@@ -104,9 +104,9 @@ static int nsc_wait_for_ready(struct tpm_chip *chip)
104 stop = jiffies + 100; 104 stop = jiffies + 100;
105 do { 105 do {
106 msleep(TPM_TIMEOUT); 106 msleep(TPM_TIMEOUT);
107 status = inb(chip->vendor->base + NSC_STATUS); 107 status = inb(chip->vendor.base + NSC_STATUS);
108 if (status & NSC_STATUS_OBF) 108 if (status & NSC_STATUS_OBF)
109 status = inb(chip->vendor->base + NSC_DATA); 109 status = inb(chip->vendor.base + NSC_DATA);
110 if (status & NSC_STATUS_RDY) 110 if (status & NSC_STATUS_RDY)
111 return 0; 111 return 0;
112 } 112 }
@@ -132,7 +132,7 @@ static int tpm_nsc_recv(struct tpm_chip *chip, u8 * buf, size_t count)
132 return -EIO; 132 return -EIO;
133 } 133 }
134 if ((data = 134 if ((data =
135 inb(chip->vendor->base + NSC_DATA)) != NSC_COMMAND_NORMAL) { 135 inb(chip->vendor.base + NSC_DATA)) != NSC_COMMAND_NORMAL) {
136 dev_err(chip->dev, "not in normal mode (0x%x)\n", 136 dev_err(chip->dev, "not in normal mode (0x%x)\n",
137 data); 137 data);
138 return -EIO; 138 return -EIO;
@@ -148,7 +148,7 @@ static int tpm_nsc_recv(struct tpm_chip *chip, u8 * buf, size_t count)
148 } 148 }
149 if (data & NSC_STATUS_F0) 149 if (data & NSC_STATUS_F0)
150 break; 150 break;
151 *p = inb(chip->vendor->base + NSC_DATA); 151 *p = inb(chip->vendor.base + NSC_DATA);
152 } 152 }
153 153
154 if ((data & NSC_STATUS_F0) == 0 && 154 if ((data & NSC_STATUS_F0) == 0 &&
@@ -156,7 +156,7 @@ static int tpm_nsc_recv(struct tpm_chip *chip, u8 * buf, size_t count)
156 dev_err(chip->dev, "F0 not set\n"); 156 dev_err(chip->dev, "F0 not set\n");
157 return -EIO; 157 return -EIO;
158 } 158 }
159 if ((data = inb(chip->vendor->base + NSC_DATA)) != NSC_COMMAND_EOC) { 159 if ((data = inb(chip->vendor.base + NSC_DATA)) != NSC_COMMAND_EOC) {
160 dev_err(chip->dev, 160 dev_err(chip->dev,
161 "expected end of command(0x%x)\n", data); 161 "expected end of command(0x%x)\n", data);
162 return -EIO; 162 return -EIO;
@@ -182,7 +182,7 @@ static int tpm_nsc_send(struct tpm_chip *chip, u8 * buf, size_t count)
182 * fix it. Not sure why this is needed, we followed the flow 182 * fix it. Not sure why this is needed, we followed the flow
183 * chart in the manual to the letter. 183 * chart in the manual to the letter.
184 */ 184 */
185 outb(NSC_COMMAND_CANCEL, chip->vendor->base + NSC_COMMAND); 185 outb(NSC_COMMAND_CANCEL, chip->vendor.base + NSC_COMMAND);
186 186
187 if (nsc_wait_for_ready(chip) != 0) 187 if (nsc_wait_for_ready(chip) != 0)
188 return -EIO; 188 return -EIO;
@@ -192,7 +192,7 @@ static int tpm_nsc_send(struct tpm_chip *chip, u8 * buf, size_t count)
192 return -EIO; 192 return -EIO;
193 } 193 }
194 194
195 outb(NSC_COMMAND_NORMAL, chip->vendor->base + NSC_COMMAND); 195 outb(NSC_COMMAND_NORMAL, chip->vendor.base + NSC_COMMAND);
196 if (wait_for_stat(chip, NSC_STATUS_IBR, NSC_STATUS_IBR, &data) < 0) { 196 if (wait_for_stat(chip, NSC_STATUS_IBR, NSC_STATUS_IBR, &data) < 0) {
197 dev_err(chip->dev, "IBR timeout\n"); 197 dev_err(chip->dev, "IBR timeout\n");
198 return -EIO; 198 return -EIO;
@@ -204,26 +204,26 @@ static int tpm_nsc_send(struct tpm_chip *chip, u8 * buf, size_t count)
204 "IBF timeout (while writing data)\n"); 204 "IBF timeout (while writing data)\n");
205 return -EIO; 205 return -EIO;
206 } 206 }
207 outb(buf[i], chip->vendor->base + NSC_DATA); 207 outb(buf[i], chip->vendor.base + NSC_DATA);
208 } 208 }
209 209
210 if (wait_for_stat(chip, NSC_STATUS_IBF, 0, &data) < 0) { 210 if (wait_for_stat(chip, NSC_STATUS_IBF, 0, &data) < 0) {
211 dev_err(chip->dev, "IBF timeout\n"); 211 dev_err(chip->dev, "IBF timeout\n");
212 return -EIO; 212 return -EIO;
213 } 213 }
214 outb(NSC_COMMAND_EOC, chip->vendor->base + NSC_COMMAND); 214 outb(NSC_COMMAND_EOC, chip->vendor.base + NSC_COMMAND);
215 215
216 return count; 216 return count;
217} 217}
218 218
219static void tpm_nsc_cancel(struct tpm_chip *chip) 219static void tpm_nsc_cancel(struct tpm_chip *chip)
220{ 220{
221 outb(NSC_COMMAND_CANCEL, chip->vendor->base + NSC_COMMAND); 221 outb(NSC_COMMAND_CANCEL, chip->vendor.base + NSC_COMMAND);
222} 222}
223 223
224static u8 tpm_nsc_status(struct tpm_chip *chip) 224static u8 tpm_nsc_status(struct tpm_chip *chip)
225{ 225{
226 return inb(chip->vendor->base + NSC_STATUS); 226 return inb(chip->vendor.base + NSC_STATUS);
227} 227}
228 228
229static struct file_operations nsc_ops = { 229static struct file_operations nsc_ops = {
@@ -250,7 +250,7 @@ static struct attribute * nsc_attrs[] = {
250 250
251static struct attribute_group nsc_attr_grp = { .attrs = nsc_attrs }; 251static struct attribute_group nsc_attr_grp = { .attrs = nsc_attrs };
252 252
253static struct tpm_vendor_specific tpm_nsc = { 253static const struct tpm_vendor_specific tpm_nsc = {
254 .recv = tpm_nsc_recv, 254 .recv = tpm_nsc_recv,
255 .send = tpm_nsc_send, 255 .send = tpm_nsc_send,
256 .cancel = tpm_nsc_cancel, 256 .cancel = tpm_nsc_cancel,
@@ -268,7 +268,7 @@ static void __devexit tpm_nsc_remove(struct device *dev)
268{ 268{
269 struct tpm_chip *chip = dev_get_drvdata(dev); 269 struct tpm_chip *chip = dev_get_drvdata(dev);
270 if ( chip ) { 270 if ( chip ) {
271 release_region(chip->vendor->base, 2); 271 release_region(chip->vendor.base, 2);
272 tpm_remove_hardware(chip->dev); 272 tpm_remove_hardware(chip->dev);
273 } 273 }
274} 274}
@@ -286,7 +286,8 @@ static int __init init_nsc(void)
286 int rc = 0; 286 int rc = 0;
287 int lo, hi; 287 int lo, hi;
288 int nscAddrBase = TPM_ADDR; 288 int nscAddrBase = TPM_ADDR;
289 289 struct tpm_chip *chip;
290 unsigned long base;
290 291
291 /* verify that it is a National part (SID) */ 292 /* verify that it is a National part (SID) */
292 if (tpm_read_index(TPM_ADDR, NSC_SID_INDEX) != 0xEF) { 293 if (tpm_read_index(TPM_ADDR, NSC_SID_INDEX) != 0xEF) {
@@ -300,7 +301,7 @@ static int __init init_nsc(void)
300 301
301 hi = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_HI); 302 hi = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_HI);
302 lo = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_LO); 303 lo = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_LO);
303 tpm_nsc.base = (hi<<8) | lo; 304 base = (hi<<8) | lo;
304 305
305 /* enable the DPM module */ 306 /* enable the DPM module */
306 tpm_write_index(nscAddrBase, NSC_LDC_INDEX, 0x01); 307 tpm_write_index(nscAddrBase, NSC_LDC_INDEX, 0x01);
@@ -320,13 +321,15 @@ static int __init init_nsc(void)
320 if ((rc = platform_device_register(pdev)) < 0) 321 if ((rc = platform_device_register(pdev)) < 0)
321 goto err_free_dev; 322 goto err_free_dev;
322 323
323 if (request_region(tpm_nsc.base, 2, "tpm_nsc0") == NULL ) { 324 if (request_region(base, 2, "tpm_nsc0") == NULL ) {
324 rc = -EBUSY; 325 rc = -EBUSY;
325 goto err_unreg_dev; 326 goto err_unreg_dev;
326 } 327 }
327 328
328 if ((rc = tpm_register_hardware(&pdev->dev, &tpm_nsc)) < 0) 329 if (!(chip = tpm_register_hardware(&pdev->dev, &tpm_nsc))) {
330 rc = -ENODEV;
329 goto err_rel_reg; 331 goto err_rel_reg;
332 }
330 333
331 dev_dbg(&pdev->dev, "NSC TPM detected\n"); 334 dev_dbg(&pdev->dev, "NSC TPM detected\n");
332 dev_dbg(&pdev->dev, 335 dev_dbg(&pdev->dev,
@@ -361,10 +364,12 @@ static int __init init_nsc(void)
361 "NSC TPM revision %d\n", 364 "NSC TPM revision %d\n",
362 tpm_read_index(nscAddrBase, 0x27) & 0x1F); 365 tpm_read_index(nscAddrBase, 0x27) & 0x1F);
363 366
367 chip->vendor.base = base;
368
364 return 0; 369 return 0;
365 370
366err_rel_reg: 371err_rel_reg:
367 release_region(tpm_nsc.base, 2); 372 release_region(base, 2);
368err_unreg_dev: 373err_unreg_dev:
369 platform_device_unregister(pdev); 374 platform_device_unregister(pdev);
370err_free_dev: 375err_free_dev:
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
new file mode 100644
index 000000000000..b9cae9a238bb
--- /dev/null
+++ b/drivers/char/tpm/tpm_tis.c
@@ -0,0 +1,669 @@
1/*
2 * Copyright (C) 2005, 2006 IBM Corporation
3 *
4 * Authors:
5 * Leendert van Doorn <leendert@watson.ibm.com>
6 * Kylene Hall <kjhall@us.ibm.com>
7 *
8 * Device driver for TCG/TCPA TPM (trusted platform module).
9 * Specifications at www.trustedcomputinggroup.org
10 *
11 * This device driver implements the TPM interface as defined in
12 * the TCG TPM Interface Spec version 1.2, revision 1.0.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation, version 2 of the
17 * License.
18 */
19#include <linux/init.h>
20#include <linux/module.h>
21#include <linux/moduleparam.h>
22#include <linux/pnp.h>
23#include <linux/interrupt.h>
24#include <linux/wait.h>
25#include "tpm.h"
26
27#define TPM_HEADER_SIZE 10
28
29enum tis_access {
30 TPM_ACCESS_VALID = 0x80,
31 TPM_ACCESS_ACTIVE_LOCALITY = 0x20,
32 TPM_ACCESS_REQUEST_PENDING = 0x04,
33 TPM_ACCESS_REQUEST_USE = 0x02,
34};
35
36enum tis_status {
37 TPM_STS_VALID = 0x80,
38 TPM_STS_COMMAND_READY = 0x40,
39 TPM_STS_GO = 0x20,
40 TPM_STS_DATA_AVAIL = 0x10,
41 TPM_STS_DATA_EXPECT = 0x08,
42};
43
44enum tis_int_flags {
45 TPM_GLOBAL_INT_ENABLE = 0x80000000,
46 TPM_INTF_BURST_COUNT_STATIC = 0x100,
47 TPM_INTF_CMD_READY_INT = 0x080,
48 TPM_INTF_INT_EDGE_FALLING = 0x040,
49 TPM_INTF_INT_EDGE_RISING = 0x020,
50 TPM_INTF_INT_LEVEL_LOW = 0x010,
51 TPM_INTF_INT_LEVEL_HIGH = 0x008,
52 TPM_INTF_LOCALITY_CHANGE_INT = 0x004,
53 TPM_INTF_STS_VALID_INT = 0x002,
54 TPM_INTF_DATA_AVAIL_INT = 0x001,
55};
56
57enum tis_defaults {
58 TIS_MEM_BASE = 0xFED4000,
59 TIS_MEM_LEN = 0x5000,
60 TIS_SHORT_TIMEOUT = 750, /* ms */
61 TIS_LONG_TIMEOUT = 2000, /* 2 sec */
62};
63
64#define TPM_ACCESS(l) (0x0000 | ((l) << 12))
65#define TPM_INT_ENABLE(l) (0x0008 | ((l) << 12))
66#define TPM_INT_VECTOR(l) (0x000C | ((l) << 12))
67#define TPM_INT_STATUS(l) (0x0010 | ((l) << 12))
68#define TPM_INTF_CAPS(l) (0x0014 | ((l) << 12))
69#define TPM_STS(l) (0x0018 | ((l) << 12))
70#define TPM_DATA_FIFO(l) (0x0024 | ((l) << 12))
71
72#define TPM_DID_VID(l) (0x0F00 | ((l) << 12))
73#define TPM_RID(l) (0x0F04 | ((l) << 12))
74
75static LIST_HEAD(tis_chips);
76static DEFINE_SPINLOCK(tis_lock);
77
78static int check_locality(struct tpm_chip *chip, int l)
79{
80 if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
81 (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) ==
82 (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID))
83 return chip->vendor.locality = l;
84
85 return -1;
86}
87
88static void release_locality(struct tpm_chip *chip, int l, int force)
89{
90 if (force || (ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
91 (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID)) ==
92 (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID))
93 iowrite8(TPM_ACCESS_ACTIVE_LOCALITY,
94 chip->vendor.iobase + TPM_ACCESS(l));
95}
96
97static int request_locality(struct tpm_chip *chip, int l)
98{
99 unsigned long stop;
100 long rc;
101
102 if (check_locality(chip, l) >= 0)
103 return l;
104
105 iowrite8(TPM_ACCESS_REQUEST_USE,
106 chip->vendor.iobase + TPM_ACCESS(l));
107
108 if (chip->vendor.irq) {
109 rc = wait_event_interruptible_timeout(chip->vendor.int_queue,
110 (check_locality
111 (chip, l) >= 0),
112 chip->vendor.timeout_a);
113 if (rc > 0)
114 return l;
115
116 } else {
117 /* wait for burstcount */
118 stop = jiffies + chip->vendor.timeout_a;
119 do {
120 if (check_locality(chip, l) >= 0)
121 return l;
122 msleep(TPM_TIMEOUT);
123 }
124 while (time_before(jiffies, stop));
125 }
126 return -1;
127}
128
129static u8 tpm_tis_status(struct tpm_chip *chip)
130{
131 return ioread8(chip->vendor.iobase +
132 TPM_STS(chip->vendor.locality));
133}
134
135static void tpm_tis_ready(struct tpm_chip *chip)
136{
137 /* this causes the current command to be aborted */
138 iowrite8(TPM_STS_COMMAND_READY,
139 chip->vendor.iobase + TPM_STS(chip->vendor.locality));
140}
141
142static int get_burstcount(struct tpm_chip *chip)
143{
144 unsigned long stop;
145 int burstcnt;
146
147 /* wait for burstcount */
148 /* which timeout value, spec has 2 answers (c & d) */
149 stop = jiffies + chip->vendor.timeout_d;
150 do {
151 burstcnt = ioread8(chip->vendor.iobase +
152 TPM_STS(chip->vendor.locality) + 1);
153 burstcnt += ioread8(chip->vendor.iobase +
154 TPM_STS(chip->vendor.locality) +
155 2) << 8;
156 if (burstcnt)
157 return burstcnt;
158 msleep(TPM_TIMEOUT);
159 } while (time_before(jiffies, stop));
160 return -EBUSY;
161}
162
163static int wait_for_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
164 wait_queue_head_t *queue)
165{
166 unsigned long stop;
167 long rc;
168 u8 status;
169
170 /* check current status */
171 status = tpm_tis_status(chip);
172 if ((status & mask) == mask)
173 return 0;
174
175 if (chip->vendor.irq) {
176 rc = wait_event_interruptible_timeout(*queue,
177 ((tpm_tis_status
178 (chip) & mask) ==
179 mask), timeout);
180 if (rc > 0)
181 return 0;
182 } else {
183 stop = jiffies + timeout;
184 do {
185 msleep(TPM_TIMEOUT);
186 status = tpm_tis_status(chip);
187 if ((status & mask) == mask)
188 return 0;
189 } while (time_before(jiffies, stop));
190 }
191 return -ETIME;
192}
193
194static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
195{
196 int size = 0, burstcnt;
197 while (size < count &&
198 wait_for_stat(chip,
199 TPM_STS_DATA_AVAIL | TPM_STS_VALID,
200 chip->vendor.timeout_c,
201 &chip->vendor.read_queue)
202 == 0) {
203 burstcnt = get_burstcount(chip);
204 for (; burstcnt > 0 && size < count; burstcnt--)
205 buf[size++] = ioread8(chip->vendor.iobase +
206 TPM_DATA_FIFO(chip->vendor.
207 locality));
208 }
209 return size;
210}
211
212static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count)
213{
214 int size = 0;
215 int expected, status;
216
217 if (count < TPM_HEADER_SIZE) {
218 size = -EIO;
219 goto out;
220 }
221
222 /* read first 10 bytes, including tag, paramsize, and result */
223 if ((size =
224 recv_data(chip, buf, TPM_HEADER_SIZE)) < TPM_HEADER_SIZE) {
225 dev_err(chip->dev, "Unable to read header\n");
226 goto out;
227 }
228
229 expected = be32_to_cpu(*(__be32 *) (buf + 2));
230 if (expected > count) {
231 size = -EIO;
232 goto out;
233 }
234
235 if ((size +=
236 recv_data(chip, &buf[TPM_HEADER_SIZE],
237 expected - TPM_HEADER_SIZE)) < expected) {
238 dev_err(chip->dev, "Unable to read remainder of result\n");
239 size = -ETIME;
240 goto out;
241 }
242
243 wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
244 &chip->vendor.int_queue);
245 status = tpm_tis_status(chip);
246 if (status & TPM_STS_DATA_AVAIL) { /* retry? */
247 dev_err(chip->dev, "Error left over data\n");
248 size = -EIO;
249 goto out;
250 }
251
252out:
253 tpm_tis_ready(chip);
254 release_locality(chip, chip->vendor.locality, 0);
255 return size;
256}
257
258/*
259 * If interrupts are used (signaled by an irq set in the vendor structure)
260 * tpm.c can skip polling for the data to be available as the interrupt is
261 * waited for here
262 */
263static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len)
264{
265 int rc, status, burstcnt;
266 size_t count = 0;
267 u32 ordinal;
268
269 if (request_locality(chip, 0) < 0)
270 return -EBUSY;
271
272 status = tpm_tis_status(chip);
273 if ((status & TPM_STS_COMMAND_READY) == 0) {
274 tpm_tis_ready(chip);
275 if (wait_for_stat
276 (chip, TPM_STS_COMMAND_READY, chip->vendor.timeout_b,
277 &chip->vendor.int_queue) < 0) {
278 rc = -ETIME;
279 goto out_err;
280 }
281 }
282
283 while (count < len - 1) {
284 burstcnt = get_burstcount(chip);
285 for (; burstcnt > 0 && count < len - 1; burstcnt--) {
286 iowrite8(buf[count], chip->vendor.iobase +
287 TPM_DATA_FIFO(chip->vendor.locality));
288 count++;
289 }
290
291 wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
292 &chip->vendor.int_queue);
293 status = tpm_tis_status(chip);
294 if ((status & TPM_STS_DATA_EXPECT) == 0) {
295 rc = -EIO;
296 goto out_err;
297 }
298 }
299
300 /* write last byte */
301 iowrite8(buf[count],
302 chip->vendor.iobase +
303 TPM_DATA_FIFO(chip->vendor.locality));
304 wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
305 &chip->vendor.int_queue);
306 status = tpm_tis_status(chip);
307 if ((status & TPM_STS_DATA_EXPECT) != 0) {
308 rc = -EIO;
309 goto out_err;
310 }
311
312 /* go and do it */
313 iowrite8(TPM_STS_GO,
314 chip->vendor.iobase + TPM_STS(chip->vendor.locality));
315
316 if (chip->vendor.irq) {
317 ordinal = be32_to_cpu(*((__be32 *) (buf + 6)));
318 if (wait_for_stat
319 (chip, TPM_STS_DATA_AVAIL | TPM_STS_VALID,
320 tpm_calc_ordinal_duration(chip, ordinal),
321 &chip->vendor.read_queue) < 0) {
322 rc = -ETIME;
323 goto out_err;
324 }
325 }
326 return len;
327out_err:
328 tpm_tis_ready(chip);
329 release_locality(chip, chip->vendor.locality, 0);
330 return rc;
331}
332
333static struct file_operations tis_ops = {
334 .owner = THIS_MODULE,
335 .llseek = no_llseek,
336 .open = tpm_open,
337 .read = tpm_read,
338 .write = tpm_write,
339 .release = tpm_release,
340};
341
342static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
343static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
344static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
345static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
346static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
347static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
348 NULL);
349static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL);
350static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
351
352static struct attribute *tis_attrs[] = {
353 &dev_attr_pubek.attr,
354 &dev_attr_pcrs.attr,
355 &dev_attr_enabled.attr,
356 &dev_attr_active.attr,
357 &dev_attr_owned.attr,
358 &dev_attr_temp_deactivated.attr,
359 &dev_attr_caps.attr,
360 &dev_attr_cancel.attr, NULL,
361};
362
363static struct attribute_group tis_attr_grp = {
364 .attrs = tis_attrs
365};
366
367static struct tpm_vendor_specific tpm_tis = {
368 .status = tpm_tis_status,
369 .recv = tpm_tis_recv,
370 .send = tpm_tis_send,
371 .cancel = tpm_tis_ready,
372 .req_complete_mask = TPM_STS_DATA_AVAIL | TPM_STS_VALID,
373 .req_complete_val = TPM_STS_DATA_AVAIL | TPM_STS_VALID,
374 .req_canceled = TPM_STS_COMMAND_READY,
375 .attr_group = &tis_attr_grp,
376 .miscdev = {
377 .fops = &tis_ops,},
378};
379
380static irqreturn_t tis_int_probe(int irq, void *dev_id, struct pt_regs *regs)
381{
382 struct tpm_chip *chip = (struct tpm_chip *) dev_id;
383 u32 interrupt;
384
385 interrupt = ioread32(chip->vendor.iobase +
386 TPM_INT_STATUS(chip->vendor.locality));
387
388 if (interrupt == 0)
389 return IRQ_NONE;
390
391 chip->vendor.irq = irq;
392
393 /* Clear interrupts handled with TPM_EOI */
394 iowrite32(interrupt,
395 chip->vendor.iobase +
396 TPM_INT_STATUS(chip->vendor.locality));
397 return IRQ_HANDLED;
398}
399
400static irqreturn_t tis_int_handler(int irq, void *dev_id, struct pt_regs *regs)
401{
402 struct tpm_chip *chip = (struct tpm_chip *) dev_id;
403 u32 interrupt;
404 int i;
405
406 interrupt = ioread32(chip->vendor.iobase +
407 TPM_INT_STATUS(chip->vendor.locality));
408
409 if (interrupt == 0)
410 return IRQ_NONE;
411
412 if (interrupt & TPM_INTF_DATA_AVAIL_INT)
413 wake_up_interruptible(&chip->vendor.read_queue);
414 if (interrupt & TPM_INTF_LOCALITY_CHANGE_INT)
415 for (i = 0; i < 5; i++)
416 if (check_locality(chip, i) >= 0)
417 break;
418 if (interrupt &
419 (TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_STS_VALID_INT |
420 TPM_INTF_CMD_READY_INT))
421 wake_up_interruptible(&chip->vendor.int_queue);
422
423 /* Clear interrupts handled with TPM_EOI */
424 iowrite32(interrupt,
425 chip->vendor.iobase +
426 TPM_INT_STATUS(chip->vendor.locality));
427 return IRQ_HANDLED;
428}
429
430static int interrupts = 1;
431module_param(interrupts, bool, 0444);
432MODULE_PARM_DESC(interrupts, "Enable interrupts");
433
434static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
435 const struct pnp_device_id *pnp_id)
436{
437 u32 vendor, intfcaps, intmask;
438 int rc, i;
439 unsigned long start, len;
440 struct tpm_chip *chip;
441
442 start = pnp_mem_start(pnp_dev, 0);
443 len = pnp_mem_len(pnp_dev, 0);
444
445 if (!start)
446 start = TIS_MEM_BASE;
447 if (!len)
448 len = TIS_MEM_LEN;
449
450 if (!(chip = tpm_register_hardware(&pnp_dev->dev, &tpm_tis)))
451 return -ENODEV;
452
453 chip->vendor.iobase = ioremap(start, len);
454 if (!chip->vendor.iobase) {
455 rc = -EIO;
456 goto out_err;
457 }
458
459 vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0));
460 if ((vendor & 0xFFFF) == 0xFFFF) {
461 rc = -ENODEV;
462 goto out_err;
463 }
464
465 /* Default timeouts */
466 chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
467 chip->vendor.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT);
468 chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
469 chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
470
471 dev_info(&pnp_dev->dev,
472 "1.2 TPM (device-id 0x%X, rev-id %d)\n",
473 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
474
475 /* Figure out the capabilities */
476 intfcaps =
477 ioread32(chip->vendor.iobase +
478 TPM_INTF_CAPS(chip->vendor.locality));
479 dev_dbg(&pnp_dev->dev, "TPM interface capabilities (0x%x):\n",
480 intfcaps);
481 if (intfcaps & TPM_INTF_BURST_COUNT_STATIC)
482 dev_dbg(&pnp_dev->dev, "\tBurst Count Static\n");
483 if (intfcaps & TPM_INTF_CMD_READY_INT)
484 dev_dbg(&pnp_dev->dev, "\tCommand Ready Int Support\n");
485 if (intfcaps & TPM_INTF_INT_EDGE_FALLING)
486 dev_dbg(&pnp_dev->dev, "\tInterrupt Edge Falling\n");
487 if (intfcaps & TPM_INTF_INT_EDGE_RISING)
488 dev_dbg(&pnp_dev->dev, "\tInterrupt Edge Rising\n");
489 if (intfcaps & TPM_INTF_INT_LEVEL_LOW)
490 dev_dbg(&pnp_dev->dev, "\tInterrupt Level Low\n");
491 if (intfcaps & TPM_INTF_INT_LEVEL_HIGH)
492 dev_dbg(&pnp_dev->dev, "\tInterrupt Level High\n");
493 if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT)
494 dev_dbg(&pnp_dev->dev, "\tLocality Change Int Support\n");
495 if (intfcaps & TPM_INTF_STS_VALID_INT)
496 dev_dbg(&pnp_dev->dev, "\tSts Valid Int Support\n");
497 if (intfcaps & TPM_INTF_DATA_AVAIL_INT)
498 dev_dbg(&pnp_dev->dev, "\tData Avail Int Support\n");
499
500 if (request_locality(chip, 0) != 0) {
501 rc = -ENODEV;
502 goto out_err;
503 }
504
505 /* INTERRUPT Setup */
506 init_waitqueue_head(&chip->vendor.read_queue);
507 init_waitqueue_head(&chip->vendor.int_queue);
508
509 intmask =
510 ioread32(chip->vendor.iobase +
511 TPM_INT_ENABLE(chip->vendor.locality));
512
513 intmask |= TPM_INTF_CMD_READY_INT
514 | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT
515 | TPM_INTF_STS_VALID_INT;
516
517 iowrite32(intmask,
518 chip->vendor.iobase +
519 TPM_INT_ENABLE(chip->vendor.locality));
520 if (interrupts) {
521 chip->vendor.irq =
522 ioread8(chip->vendor.iobase +
523 TPM_INT_VECTOR(chip->vendor.locality));
524
525 for (i = 3; i < 16 && chip->vendor.irq == 0; i++) {
526 iowrite8(i, chip->vendor.iobase +
527 TPM_INT_VECTOR(chip->vendor.locality));
528 if (request_irq
529 (i, tis_int_probe, SA_SHIRQ,
530 chip->vendor.miscdev.name, chip) != 0) {
531 dev_info(chip->dev,
532 "Unable to request irq: %d for probe\n",
533 i);
534 continue;
535 }
536
537 /* Clear all existing */
538 iowrite32(ioread32
539 (chip->vendor.iobase +
540 TPM_INT_STATUS(chip->vendor.locality)),
541 chip->vendor.iobase +
542 TPM_INT_STATUS(chip->vendor.locality));
543
544 /* Turn on */
545 iowrite32(intmask | TPM_GLOBAL_INT_ENABLE,
546 chip->vendor.iobase +
547 TPM_INT_ENABLE(chip->vendor.locality));
548
549 /* Generate Interrupts */
550 tpm_gen_interrupt(chip);
551
552 /* Turn off */
553 iowrite32(intmask,
554 chip->vendor.iobase +
555 TPM_INT_ENABLE(chip->vendor.locality));
556 free_irq(i, chip);
557 }
558 }
559 if (chip->vendor.irq) {
560 iowrite8(chip->vendor.irq,
561 chip->vendor.iobase +
562 TPM_INT_VECTOR(chip->vendor.locality));
563 if (request_irq
564 (chip->vendor.irq, tis_int_handler, SA_SHIRQ,
565 chip->vendor.miscdev.name, chip) != 0) {
566 dev_info(chip->dev,
567 "Unable to request irq: %d for use\n",
568 chip->vendor.irq);
569 chip->vendor.irq = 0;
570 } else {
571 /* Clear all existing */
572 iowrite32(ioread32
573 (chip->vendor.iobase +
574 TPM_INT_STATUS(chip->vendor.locality)),
575 chip->vendor.iobase +
576 TPM_INT_STATUS(chip->vendor.locality));
577
578 /* Turn on */
579 iowrite32(intmask | TPM_GLOBAL_INT_ENABLE,
580 chip->vendor.iobase +
581 TPM_INT_ENABLE(chip->vendor.locality));
582 }
583 }
584
585 INIT_LIST_HEAD(&chip->vendor.list);
586 spin_lock(&tis_lock);
587 list_add(&chip->vendor.list, &tis_chips);
588 spin_unlock(&tis_lock);
589
590 tpm_get_timeouts(chip);
591 tpm_continue_selftest(chip);
592
593 return 0;
594out_err:
595 if (chip->vendor.iobase)
596 iounmap(chip->vendor.iobase);
597 tpm_remove_hardware(chip->dev);
598 return rc;
599}
600
601static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg)
602{
603 return tpm_pm_suspend(&dev->dev, msg);
604}
605
606static int tpm_tis_pnp_resume(struct pnp_dev *dev)
607{
608 return tpm_pm_resume(&dev->dev);
609}
610
611static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = {
612 {"PNP0C31", 0}, /* TPM */
613 {"ATM1200", 0}, /* Atmel */
614 {"IFX0102", 0}, /* Infineon */
615 {"BCM0101", 0}, /* Broadcom */
616 {"NSC1200", 0}, /* National */
617 /* Add new here */
618 {"", 0}, /* User Specified */
619 {"", 0} /* Terminator */
620};
621
622static struct pnp_driver tis_pnp_driver = {
623 .name = "tpm_tis",
624 .id_table = tpm_pnp_tbl,
625 .probe = tpm_tis_pnp_init,
626 .suspend = tpm_tis_pnp_suspend,
627 .resume = tpm_tis_pnp_resume,
628};
629
630#define TIS_HID_USR_IDX sizeof(tpm_pnp_tbl)/sizeof(struct pnp_device_id) -2
631module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id,
632 sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444);
633MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe");
634
635static int __init init_tis(void)
636{
637 return pnp_register_driver(&tis_pnp_driver);
638}
639
640static void __exit cleanup_tis(void)
641{
642 struct tpm_vendor_specific *i, *j;
643 struct tpm_chip *chip;
644 spin_lock(&tis_lock);
645 list_for_each_entry_safe(i, j, &tis_chips, list) {
646 chip = to_tpm_chip(i);
647 iowrite32(~TPM_GLOBAL_INT_ENABLE &
648 ioread32(chip->vendor.iobase +
649 TPM_INT_ENABLE(chip->vendor.
650 locality)),
651 chip->vendor.iobase +
652 TPM_INT_ENABLE(chip->vendor.locality));
653 release_locality(chip, chip->vendor.locality, 1);
654 if (chip->vendor.irq)
655 free_irq(chip->vendor.irq, chip);
656 iounmap(i->iobase);
657 list_del(&i->list);
658 tpm_remove_hardware(chip->dev);
659 }
660 spin_unlock(&tis_lock);
661 pnp_unregister_driver(&tis_pnp_driver);
662}
663
664module_init(init_tis);
665module_exit(cleanup_tis);
666MODULE_AUTHOR("Leendert van Doorn (leendert@watson.ibm.com)");
667MODULE_DESCRIPTION("TPM Driver");
668MODULE_VERSION("2.0");
669MODULE_LICENSE("GPL");
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 9759d05b1972..29b2fa5534ae 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1497,7 +1497,7 @@ int cpufreq_update_policy(unsigned int cpu)
1497} 1497}
1498EXPORT_SYMBOL(cpufreq_update_policy); 1498EXPORT_SYMBOL(cpufreq_update_policy);
1499 1499
1500static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb, 1500static int cpufreq_cpu_callback(struct notifier_block *nfb,
1501 unsigned long action, void *hcpu) 1501 unsigned long action, void *hcpu)
1502{ 1502{
1503 unsigned int cpu = (unsigned long)hcpu; 1503 unsigned int cpu = (unsigned long)hcpu;
diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c
index 1dca3cf42a54..2e4abdc26367 100644
--- a/drivers/input/keyboard/hil_kbd.c
+++ b/drivers/input/keyboard/hil_kbd.c
@@ -350,11 +350,11 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv)
350 return 0; 350 return 0;
351 bail2: 351 bail2:
352 serio_close(serio); 352 serio_close(serio);
353 serio_set_drvdata(serio, NULL);
353 bail1: 354 bail1:
354 input_free_device(kbd->dev); 355 input_free_device(kbd->dev);
355 bail0: 356 bail0:
356 kfree(kbd); 357 kfree(kbd);
357 serio_set_drvdata(serio, NULL);
358 return -EIO; 358 return -EIO;
359} 359}
360 360
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
index f86ed6af3aa2..eb41aba3ddef 100644
--- a/drivers/isdn/gigaset/bas-gigaset.c
+++ b/drivers/isdn/gigaset/bas-gigaset.c
@@ -5,8 +5,6 @@
5 * Tilman Schmidt <tilman@imap.cc>, 5 * Tilman Schmidt <tilman@imap.cc>,
6 * Stefan Eilers. 6 * Stefan Eilers.
7 * 7 *
8 * Based on usb-gigaset.c.
9 *
10 * ===================================================================== 8 * =====================================================================
11 * This program is free software; you can redistribute it and/or 9 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as 10 * modify it under the terms of the GNU General Public License as
@@ -46,19 +44,20 @@ MODULE_PARM_DESC(cidmode, "Call-ID mode");
46#define GIGASET_DEVFSNAME "gig/bas/" 44#define GIGASET_DEVFSNAME "gig/bas/"
47#define GIGASET_DEVNAME "ttyGB" 45#define GIGASET_DEVNAME "ttyGB"
48 46
49#define IF_WRITEBUF 256 //FIXME 47/* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */
48#define IF_WRITEBUF 264
50 49
51/* Values for the Gigaset 307x */ 50/* Values for the Gigaset 307x */
52#define USB_GIGA_VENDOR_ID 0x0681 51#define USB_GIGA_VENDOR_ID 0x0681
53#define USB_GIGA_PRODUCT_ID 0x0001 52#define USB_3070_PRODUCT_ID 0x0001
54#define USB_4175_PRODUCT_ID 0x0002 53#define USB_3075_PRODUCT_ID 0x0002
55#define USB_SX303_PRODUCT_ID 0x0021 54#define USB_SX303_PRODUCT_ID 0x0021
56#define USB_SX353_PRODUCT_ID 0x0022 55#define USB_SX353_PRODUCT_ID 0x0022
57 56
58/* table of devices that work with this driver */ 57/* table of devices that work with this driver */
59static struct usb_device_id gigaset_table [] = { 58static struct usb_device_id gigaset_table [] = {
60 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_GIGA_PRODUCT_ID) }, 59 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_3070_PRODUCT_ID) },
61 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_4175_PRODUCT_ID) }, 60 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_3075_PRODUCT_ID) },
62 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_SX303_PRODUCT_ID) }, 61 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_SX303_PRODUCT_ID) },
63 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_SX353_PRODUCT_ID) }, 62 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_SX353_PRODUCT_ID) },
64 { } /* Terminating entry */ 63 { } /* Terminating entry */
@@ -77,6 +76,10 @@ static int gigaset_probe(struct usb_interface *interface,
77/* Function will be called if the device is unplugged */ 76/* Function will be called if the device is unplugged */
78static void gigaset_disconnect(struct usb_interface *interface); 77static void gigaset_disconnect(struct usb_interface *interface);
79 78
79static void read_ctrl_callback(struct urb *, struct pt_regs *);
80static void stopurbs(struct bas_bc_state *);
81static int atwrite_submit(struct cardstate *, unsigned char *, int);
82static int start_cbsend(struct cardstate *);
80 83
81/*==============================================================================*/ 84/*==============================================================================*/
82 85
@@ -111,12 +114,14 @@ struct bas_cardstate {
111}; 114};
112 115
113/* status of direct USB connection to 307x base (bits in basstate) */ 116/* status of direct USB connection to 307x base (bits in basstate) */
114#define BS_ATOPEN 0x001 117#define BS_ATOPEN 0x001 /* AT channel open */
115#define BS_B1OPEN 0x002 118#define BS_B1OPEN 0x002 /* B channel 1 open */
116#define BS_B2OPEN 0x004 119#define BS_B2OPEN 0x004 /* B channel 2 open */
117#define BS_ATREADY 0x008 120#define BS_ATREADY 0x008 /* base ready for AT command */
118#define BS_INIT 0x010 121#define BS_INIT 0x010 /* base has signalled INIT_OK */
119#define BS_ATTIMER 0x020 122#define BS_ATTIMER 0x020 /* waiting for HD_READY_SEND_ATDATA */
123#define BS_ATRDPEND 0x040 /* urb_cmd_in in use */
124#define BS_ATWRPEND 0x080 /* urb_cmd_out in use */
120 125
121 126
122static struct gigaset_driver *driver = NULL; 127static struct gigaset_driver *driver = NULL;
@@ -130,6 +135,47 @@ static struct usb_driver gigaset_usb_driver = {
130 .id_table = gigaset_table, 135 .id_table = gigaset_table,
131}; 136};
132 137
138/* get message text for usb_submit_urb return code
139 */
140static char *get_usb_rcmsg(int rc)
141{
142 static char unkmsg[28];
143
144 switch (rc) {
145 case 0:
146 return "success";
147 case -ENOMEM:
148 return "out of memory";
149 case -ENODEV:
150 return "device not present";
151 case -ENOENT:
152 return "endpoint not present";
153 case -ENXIO:
154 return "URB type not supported";
155 case -EINVAL:
156 return "invalid argument";
157 case -EAGAIN:
158 return "start frame too early or too much scheduled";
159 case -EFBIG:
160 return "too many isochronous frames requested";
161 case -EPIPE:
162 return "endpoint stalled";
163 case -EMSGSIZE:
164 return "invalid packet size";
165 case -ENOSPC:
166 return "would overcommit USB bandwidth";
167 case -ESHUTDOWN:
168 return "device shut down";
169 case -EPERM:
170 return "reject flag set";
171 case -EHOSTUNREACH:
172 return "device suspended";
173 default:
174 snprintf(unkmsg, sizeof(unkmsg), "unknown error %d", rc);
175 return unkmsg;
176 }
177}
178
133/* get message text for USB status code 179/* get message text for USB status code
134 */ 180 */
135static char *get_usb_statmsg(int status) 181static char *get_usb_statmsg(int status)
@@ -140,43 +186,37 @@ static char *get_usb_statmsg(int status)
140 case 0: 186 case 0:
141 return "success"; 187 return "success";
142 case -ENOENT: 188 case -ENOENT:
143 return "canceled"; 189 return "unlinked (sync)";
144 case -ECONNRESET:
145 return "canceled (async)";
146 case -EINPROGRESS: 190 case -EINPROGRESS:
147 return "pending"; 191 return "pending";
148 case -EPROTO: 192 case -EPROTO:
149 return "bit stuffing or unknown USB error"; 193 return "bit stuffing error, timeout, or unknown USB error";
150 case -EILSEQ: 194 case -EILSEQ:
151 return "Illegal byte sequence (CRC mismatch)"; 195 return "CRC mismatch, timeout, or unknown USB error";
152 case -EPIPE:
153 return "babble detect or endpoint stalled";
154 case -ENOSR:
155 return "buffer error";
156 case -ETIMEDOUT: 196 case -ETIMEDOUT:
157 return "timed out"; 197 return "timed out";
158 case -ENODEV: 198 case -EPIPE:
159 return "device not present"; 199 return "endpoint stalled";
200 case -ECOMM:
201 return "IN buffer overrun";
202 case -ENOSR:
203 return "OUT buffer underrun";
204 case -EOVERFLOW:
205 return "too much data";
160 case -EREMOTEIO: 206 case -EREMOTEIO:
161 return "short packet detected"; 207 return "short packet detected";
208 case -ENODEV:
209 return "device removed";
162 case -EXDEV: 210 case -EXDEV:
163 return "partial isochronous transfer"; 211 return "partial isochronous transfer";
164 case -EINVAL: 212 case -EINVAL:
165 return "invalid argument"; 213 return "invalid argument";
166 case -ENXIO: 214 case -ECONNRESET:
167 return "URB already queued"; 215 return "unlinked (async)";
168 case -EAGAIN:
169 return "isochronous start frame too early or too much scheduled";
170 case -EFBIG:
171 return "too many isochronous frames requested";
172 case -EMSGSIZE:
173 return "endpoint message size zero";
174 case -ESHUTDOWN: 216 case -ESHUTDOWN:
175 return "endpoint shutdown"; 217 return "device shut down";
176 case -EBUSY:
177 return "another request pending";
178 default: 218 default:
179 snprintf(unkmsg, sizeof(unkmsg), "unknown error %d", status); 219 snprintf(unkmsg, sizeof(unkmsg), "unknown status %d", status);
180 return unkmsg; 220 return unkmsg;
181 } 221 }
182} 222}
@@ -277,18 +317,17 @@ static inline void error_hangup(struct bc_state *bcs)
277 gig_dbg(DEBUG_ANY, "%s: scheduling HUP for channel %d", 317 gig_dbg(DEBUG_ANY, "%s: scheduling HUP for channel %d",
278 __func__, bcs->channel); 318 __func__, bcs->channel);
279 319
280 if (!gigaset_add_event(cs, &bcs->at_state, EV_HUP, NULL, 0, NULL)) { 320 if (!gigaset_add_event(cs, &bcs->at_state, EV_HUP, NULL, 0, NULL))
281 //FIXME what should we do? 321 dev_err(cs->dev, "event queue full\n");
282 return;
283 }
284 322
285 gigaset_schedule_event(cs); 323 gigaset_schedule_event(cs);
286} 324}
287 325
288/* error_reset 326/* error_reset
289 * reset Gigaset device because of an unrecoverable error 327 * reset Gigaset device because of an unrecoverable error
290 * This function may be called from any context and takes care of scheduling 328 * This function may be called from any context, and should take care of
291 * the necessary actions for execution outside of interrupt context. 329 * scheduling the necessary actions for execution outside of interrupt context.
330 * Right now, it just generates a kernel message calling for help.
292 * argument: 331 * argument:
293 * controller state structure 332 * controller state structure
294 */ 333 */
@@ -364,36 +403,38 @@ static void cmd_in_timeout(unsigned long data)
364{ 403{
365 struct cardstate *cs = (struct cardstate *) data; 404 struct cardstate *cs = (struct cardstate *) data;
366 struct bas_cardstate *ucs = cs->hw.bas; 405 struct bas_cardstate *ucs = cs->hw.bas;
367 unsigned long flags;
368 406
369 spin_lock_irqsave(&cs->lock, flags);
370 if (unlikely(!cs->connected)) {
371 gig_dbg(DEBUG_USBREQ, "%s: disconnected", __func__);
372 spin_unlock_irqrestore(&cs->lock, flags);
373 return;
374 }
375 if (!ucs->rcvbuf_size) { 407 if (!ucs->rcvbuf_size) {
376 gig_dbg(DEBUG_USBREQ, "%s: no receive in progress", __func__); 408 gig_dbg(DEBUG_USBREQ, "%s: no receive in progress", __func__);
377 spin_unlock_irqrestore(&cs->lock, flags);
378 return; 409 return;
379 } 410 }
380 spin_unlock_irqrestore(&cs->lock, flags);
381 411
382 dev_err(cs->dev, "timeout reading AT response\n"); 412 dev_err(cs->dev, "timeout reading AT response\n");
383 error_reset(cs); //FIXME retry? 413 error_reset(cs); //FIXME retry?
384} 414}
385 415
416/* set/clear bits in base connection state, return previous state
417 */
418inline static int update_basstate(struct bas_cardstate *ucs,
419 int set, int clear)
420{
421 unsigned long flags;
422 int state;
386 423
387static void read_ctrl_callback(struct urb *urb, struct pt_regs *regs); 424 spin_lock_irqsave(&ucs->lock, flags);
425 state = atomic_read(&ucs->basstate);
426 atomic_set(&ucs->basstate, (state & ~clear) | set);
427 spin_unlock_irqrestore(&ucs->lock, flags);
428 return state;
429}
388 430
389/* atread_submit 431/* atread_submit
390 * submit an HD_READ_ATMESSAGE command URB 432 * submit an HD_READ_ATMESSAGE command URB and optionally start a timeout
391 * parameters: 433 * parameters:
392 * cs controller state structure 434 * cs controller state structure
393 * timeout timeout in 1/10 sec., 0: none 435 * timeout timeout in 1/10 sec., 0: none
394 * return value: 436 * return value:
395 * 0 on success 437 * 0 on success
396 * -EINVAL if a NULL pointer is encountered somewhere
397 * -EBUSY if another request is pending 438 * -EBUSY if another request is pending
398 * any URB submission error code 439 * any URB submission error code
399 */ 440 */
@@ -405,7 +446,7 @@ static int atread_submit(struct cardstate *cs, int timeout)
405 gig_dbg(DEBUG_USBREQ, "-------> HD_READ_ATMESSAGE (%d)", 446 gig_dbg(DEBUG_USBREQ, "-------> HD_READ_ATMESSAGE (%d)",
406 ucs->rcvbuf_size); 447 ucs->rcvbuf_size);
407 448
408 if (ucs->urb_cmd_in->status == -EINPROGRESS) { 449 if (update_basstate(ucs, BS_ATRDPEND, 0) & BS_ATRDPEND) {
409 dev_err(cs->dev, 450 dev_err(cs->dev,
410 "could not submit HD_READ_ATMESSAGE: URB busy\n"); 451 "could not submit HD_READ_ATMESSAGE: URB busy\n");
411 return -EBUSY; 452 return -EBUSY;
@@ -423,6 +464,7 @@ static int atread_submit(struct cardstate *cs, int timeout)
423 read_ctrl_callback, cs->inbuf); 464 read_ctrl_callback, cs->inbuf);
424 465
425 if ((ret = usb_submit_urb(ucs->urb_cmd_in, SLAB_ATOMIC)) != 0) { 466 if ((ret = usb_submit_urb(ucs->urb_cmd_in, SLAB_ATOMIC)) != 0) {
467 update_basstate(ucs, 0, BS_ATRDPEND);
426 dev_err(cs->dev, "could not submit HD_READ_ATMESSAGE: %s\n", 468 dev_err(cs->dev, "could not submit HD_READ_ATMESSAGE: %s\n",
427 get_usb_statmsg(ret)); 469 get_usb_statmsg(ret));
428 return ret; 470 return ret;
@@ -438,26 +480,6 @@ static int atread_submit(struct cardstate *cs, int timeout)
438 return 0; 480 return 0;
439} 481}
440 482
441static void stopurbs(struct bas_bc_state *);
442static int start_cbsend(struct cardstate *);
443
444/* set/clear bits in base connection state
445 */
446inline static void update_basstate(struct bas_cardstate *ucs,
447 int set, int clear)
448{
449 unsigned long flags;
450 int state;
451
452 spin_lock_irqsave(&ucs->lock, flags);
453 state = atomic_read(&ucs->basstate);
454 state &= ~clear;
455 state |= set;
456 atomic_set(&ucs->basstate, state);
457 spin_unlock_irqrestore(&ucs->lock, flags);
458}
459
460
461/* read_int_callback 483/* read_int_callback
462 * USB completion handler for interrupt pipe input 484 * USB completion handler for interrupt pipe input
463 * called by the USB subsystem in interrupt context 485 * called by the USB subsystem in interrupt context
@@ -471,20 +493,25 @@ static void read_int_callback(struct urb *urb, struct pt_regs *regs)
471 struct bas_cardstate *ucs = cs->hw.bas; 493 struct bas_cardstate *ucs = cs->hw.bas;
472 struct bc_state *bcs; 494 struct bc_state *bcs;
473 unsigned long flags; 495 unsigned long flags;
474 int status; 496 int rc;
475 unsigned l; 497 unsigned l;
476 int channel; 498 int channel;
477 499
478 switch (urb->status) { 500 switch (urb->status) {
479 case 0: /* success */ 501 case 0: /* success */
480 break; 502 break;
481 case -ENOENT: /* canceled */ 503 case -ENOENT: /* cancelled */
482 case -ECONNRESET: /* canceled (async) */ 504 case -ECONNRESET: /* cancelled (async) */
483 case -EINPROGRESS: /* pending */ 505 case -EINPROGRESS: /* pending */
484 /* ignore silently */ 506 /* ignore silently */
485 gig_dbg(DEBUG_USBREQ, "%s: %s", 507 gig_dbg(DEBUG_USBREQ, "%s: %s",
486 __func__, get_usb_statmsg(urb->status)); 508 __func__, get_usb_statmsg(urb->status));
487 return; 509 return;
510 case -ENODEV: /* device removed */
511 case -ESHUTDOWN: /* device shut down */
512 //FIXME use this as disconnect indicator?
513 gig_dbg(DEBUG_USBREQ, "%s: device disconnected", __func__);
514 return;
488 default: /* severe trouble */ 515 default: /* severe trouble */
489 dev_warn(cs->dev, "interrupt read: %s\n", 516 dev_warn(cs->dev, "interrupt read: %s\n",
490 get_usb_statmsg(urb->status)); 517 get_usb_statmsg(urb->status));
@@ -492,6 +519,13 @@ static void read_int_callback(struct urb *urb, struct pt_regs *regs)
492 goto resubmit; 519 goto resubmit;
493 } 520 }
494 521
522 /* drop incomplete packets even if the missing bytes wouldn't matter */
523 if (unlikely(urb->actual_length < 3)) {
524 dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n",
525 urb->actual_length);
526 goto resubmit;
527 }
528
495 l = (unsigned) ucs->int_in_buf[1] + 529 l = (unsigned) ucs->int_in_buf[1] +
496 (((unsigned) ucs->int_in_buf[2]) << 8); 530 (((unsigned) ucs->int_in_buf[2]) << 8);
497 531
@@ -558,25 +592,28 @@ static void read_int_callback(struct urb *urb, struct pt_regs *regs)
558 } 592 }
559 spin_lock_irqsave(&cs->lock, flags); 593 spin_lock_irqsave(&cs->lock, flags);
560 if (ucs->rcvbuf_size) { 594 if (ucs->rcvbuf_size) {
561 spin_unlock_irqrestore(&cs->lock, flags); 595 /* throw away previous buffer - we have no queue */
562 dev_err(cs->dev, 596 dev_err(cs->dev,
563 "receive AT data overrun, %d bytes lost\n", l); 597 "receive AT data overrun, %d bytes lost\n",
564 error_reset(cs); //FIXME reschedule 598 ucs->rcvbuf_size);
565 break; 599 kfree(ucs->rcvbuf);
600 ucs->rcvbuf_size = 0;
566 } 601 }
567 if ((ucs->rcvbuf = kmalloc(l, GFP_ATOMIC)) == NULL) { 602 if ((ucs->rcvbuf = kmalloc(l, GFP_ATOMIC)) == NULL) {
568 spin_unlock_irqrestore(&cs->lock, flags); 603 spin_unlock_irqrestore(&cs->lock, flags);
569 dev_err(cs->dev, "out of memory, %d bytes lost\n", l); 604 dev_err(cs->dev, "out of memory receiving AT data\n");
570 error_reset(cs); //FIXME reschedule 605 error_reset(cs);
571 break; 606 break;
572 } 607 }
573 ucs->rcvbuf_size = l; 608 ucs->rcvbuf_size = l;
574 ucs->retry_cmd_in = 0; 609 ucs->retry_cmd_in = 0;
575 if ((status = atread_submit(cs, BAS_TIMEOUT)) < 0) { 610 if ((rc = atread_submit(cs, BAS_TIMEOUT)) < 0) {
576 kfree(ucs->rcvbuf); 611 kfree(ucs->rcvbuf);
577 ucs->rcvbuf = NULL; 612 ucs->rcvbuf = NULL;
578 ucs->rcvbuf_size = 0; 613 ucs->rcvbuf_size = 0;
579 error_reset(cs); //FIXME reschedule 614 if (rc != -ENODEV)
615 //FIXME corrective action?
616 error_reset(cs);
580 } 617 }
581 spin_unlock_irqrestore(&cs->lock, flags); 618 spin_unlock_irqrestore(&cs->lock, flags);
582 break; 619 break;
@@ -598,12 +635,10 @@ static void read_int_callback(struct urb *urb, struct pt_regs *regs)
598 check_pending(ucs); 635 check_pending(ucs);
599 636
600resubmit: 637resubmit:
601 spin_lock_irqsave(&cs->lock, flags); 638 rc = usb_submit_urb(urb, SLAB_ATOMIC);
602 status = cs->connected ? usb_submit_urb(urb, SLAB_ATOMIC) : -ENODEV; 639 if (unlikely(rc != 0 && rc != -ENODEV)) {
603 spin_unlock_irqrestore(&cs->lock, flags);
604 if (unlikely(status)) {
605 dev_err(cs->dev, "could not resubmit interrupt URB: %s\n", 640 dev_err(cs->dev, "could not resubmit interrupt URB: %s\n",
606 get_usb_statmsg(status)); 641 get_usb_rcmsg(rc));
607 error_reset(cs); 642 error_reset(cs);
608 } 643 }
609} 644}
@@ -622,18 +657,12 @@ static void read_ctrl_callback(struct urb *urb, struct pt_regs *regs)
622 struct bas_cardstate *ucs = cs->hw.bas; 657 struct bas_cardstate *ucs = cs->hw.bas;
623 int have_data = 0; 658 int have_data = 0;
624 unsigned numbytes; 659 unsigned numbytes;
625 unsigned long flags; 660 int rc;
626 661
627 spin_lock_irqsave(&cs->lock, flags); 662 update_basstate(ucs, 0, BS_ATRDPEND);
628 if (unlikely(!cs->connected)) {
629 warn("%s: disconnected", __func__);
630 spin_unlock_irqrestore(&cs->lock, flags);
631 return;
632 }
633 663
634 if (!ucs->rcvbuf_size) { 664 if (!ucs->rcvbuf_size) {
635 dev_warn(cs->dev, "%s: no receive in progress\n", __func__); 665 dev_warn(cs->dev, "%s: no receive in progress\n", __func__);
636 spin_unlock_irqrestore(&cs->lock, flags);
637 return; 666 return;
638 } 667 }
639 668
@@ -666,9 +695,11 @@ static void read_ctrl_callback(struct urb *urb, struct pt_regs *regs)
666 } 695 }
667 break; 696 break;
668 697
669 case -ENOENT: /* canceled */ 698 case -ENOENT: /* cancelled */
670 case -ECONNRESET: /* canceled (async) */ 699 case -ECONNRESET: /* cancelled (async) */
671 case -EINPROGRESS: /* pending */ 700 case -EINPROGRESS: /* pending */
701 case -ENODEV: /* device removed */
702 case -ESHUTDOWN: /* device shut down */
672 /* no action necessary */ 703 /* no action necessary */
673 gig_dbg(DEBUG_USBREQ, "%s: %s", 704 gig_dbg(DEBUG_USBREQ, "%s: %s",
674 __func__, get_usb_statmsg(urb->status)); 705 __func__, get_usb_statmsg(urb->status));
@@ -681,11 +712,11 @@ static void read_ctrl_callback(struct urb *urb, struct pt_regs *regs)
681 if (ucs->retry_cmd_in++ < BAS_RETRY) { 712 if (ucs->retry_cmd_in++ < BAS_RETRY) {
682 dev_notice(cs->dev, "control read: retry %d\n", 713 dev_notice(cs->dev, "control read: retry %d\n",
683 ucs->retry_cmd_in); 714 ucs->retry_cmd_in);
684 if (atread_submit(cs, BAS_TIMEOUT) >= 0) { 715 rc = atread_submit(cs, BAS_TIMEOUT);
685 /* resubmitted - bypass regular exit block */ 716 if (rc >= 0 || rc == -ENODEV)
686 spin_unlock_irqrestore(&cs->lock, flags); 717 /* resubmitted or disconnected */
718 /* - bypass regular exit block */
687 return; 719 return;
688 }
689 } else { 720 } else {
690 dev_err(cs->dev, 721 dev_err(cs->dev,
691 "control read: giving up after %d tries\n", 722 "control read: giving up after %d tries\n",
@@ -697,7 +728,6 @@ static void read_ctrl_callback(struct urb *urb, struct pt_regs *regs)
697 kfree(ucs->rcvbuf); 728 kfree(ucs->rcvbuf);
698 ucs->rcvbuf = NULL; 729 ucs->rcvbuf = NULL;
699 ucs->rcvbuf_size = 0; 730 ucs->rcvbuf_size = 0;
700 spin_unlock_irqrestore(&cs->lock, flags);
701 if (have_data) { 731 if (have_data) {
702 gig_dbg(DEBUG_INTR, "%s-->BH", __func__); 732 gig_dbg(DEBUG_INTR, "%s-->BH", __func__);
703 gigaset_schedule_event(cs); 733 gigaset_schedule_event(cs);
@@ -719,8 +749,11 @@ static void read_iso_callback(struct urb *urb, struct pt_regs *regs)
719 int i, rc; 749 int i, rc;
720 750
721 /* status codes not worth bothering the tasklet with */ 751 /* status codes not worth bothering the tasklet with */
722 if (unlikely(urb->status == -ENOENT || urb->status == -ECONNRESET || 752 if (unlikely(urb->status == -ENOENT ||
723 urb->status == -EINPROGRESS)) { 753 urb->status == -ECONNRESET ||
754 urb->status == -EINPROGRESS ||
755 urb->status == -ENODEV ||
756 urb->status == -ESHUTDOWN)) {
724 gig_dbg(DEBUG_ISO, "%s: %s", 757 gig_dbg(DEBUG_ISO, "%s: %s",
725 __func__, get_usb_statmsg(urb->status)); 758 __func__, get_usb_statmsg(urb->status));
726 return; 759 return;
@@ -740,9 +773,9 @@ static void read_iso_callback(struct urb *urb, struct pt_regs *regs)
740 for (i = 0; i < BAS_NUMFRAMES; i++) { 773 for (i = 0; i < BAS_NUMFRAMES; i++) {
741 ubc->isoinlost += urb->iso_frame_desc[i].actual_length; 774 ubc->isoinlost += urb->iso_frame_desc[i].actual_length;
742 if (unlikely(urb->iso_frame_desc[i].status != 0 && 775 if (unlikely(urb->iso_frame_desc[i].status != 0 &&
743 urb->iso_frame_desc[i].status != -EINPROGRESS)) { 776 urb->iso_frame_desc[i].status !=
777 -EINPROGRESS))
744 ubc->loststatus = urb->iso_frame_desc[i].status; 778 ubc->loststatus = urb->iso_frame_desc[i].status;
745 }
746 urb->iso_frame_desc[i].status = 0; 779 urb->iso_frame_desc[i].status = 0;
747 urb->iso_frame_desc[i].actual_length = 0; 780 urb->iso_frame_desc[i].actual_length = 0;
748 } 781 }
@@ -754,10 +787,10 @@ static void read_iso_callback(struct urb *urb, struct pt_regs *regs)
754 gig_dbg(DEBUG_ISO, "%s: isoc read overrun/resubmit", 787 gig_dbg(DEBUG_ISO, "%s: isoc read overrun/resubmit",
755 __func__); 788 __func__);
756 rc = usb_submit_urb(urb, SLAB_ATOMIC); 789 rc = usb_submit_urb(urb, SLAB_ATOMIC);
757 if (unlikely(rc != 0)) { 790 if (unlikely(rc != 0 && rc != -ENODEV)) {
758 dev_err(bcs->cs->dev, 791 dev_err(bcs->cs->dev,
759 "could not resubmit isochronous read " 792 "could not resubmit isochronous read "
760 "URB: %s\n", get_usb_statmsg(rc)); 793 "URB: %s\n", get_usb_rcmsg(rc));
761 dump_urb(DEBUG_ISO, "isoc read", urb); 794 dump_urb(DEBUG_ISO, "isoc read", urb);
762 error_hangup(bcs); 795 error_hangup(bcs);
763 } 796 }
@@ -780,8 +813,11 @@ static void write_iso_callback(struct urb *urb, struct pt_regs *regs)
780 unsigned long flags; 813 unsigned long flags;
781 814
782 /* status codes not worth bothering the tasklet with */ 815 /* status codes not worth bothering the tasklet with */
783 if (unlikely(urb->status == -ENOENT || urb->status == -ECONNRESET || 816 if (unlikely(urb->status == -ENOENT ||
784 urb->status == -EINPROGRESS)) { 817 urb->status == -ECONNRESET ||
818 urb->status == -EINPROGRESS ||
819 urb->status == -ENODEV ||
820 urb->status == -ESHUTDOWN)) {
785 gig_dbg(DEBUG_ISO, "%s: %s", 821 gig_dbg(DEBUG_ISO, "%s: %s",
786 __func__, get_usb_statmsg(urb->status)); 822 __func__, get_usb_statmsg(urb->status));
787 return; 823 return;
@@ -822,7 +858,6 @@ static int starturbs(struct bc_state *bcs)
822 for (k = 0; k < BAS_INURBS; k++) { 858 for (k = 0; k < BAS_INURBS; k++) {
823 urb = ubc->isoinurbs[k]; 859 urb = ubc->isoinurbs[k];
824 if (!urb) { 860 if (!urb) {
825 dev_err(bcs->cs->dev, "isoinurbs[%d]==NULL\n", k);
826 rc = -EFAULT; 861 rc = -EFAULT;
827 goto error; 862 goto error;
828 } 863 }
@@ -844,12 +879,8 @@ static int starturbs(struct bc_state *bcs)
844 } 879 }
845 880
846 dump_urb(DEBUG_ISO, "Initial isoc read", urb); 881 dump_urb(DEBUG_ISO, "Initial isoc read", urb);
847 if ((rc = usb_submit_urb(urb, SLAB_ATOMIC)) != 0) { 882 if ((rc = usb_submit_urb(urb, SLAB_ATOMIC)) != 0)
848 dev_err(bcs->cs->dev,
849 "could not submit isochronous read URB %d: %s\n",
850 k, get_usb_statmsg(rc));
851 goto error; 883 goto error;
852 }
853 } 884 }
854 885
855 /* initialize L2 transmission */ 886 /* initialize L2 transmission */
@@ -859,7 +890,6 @@ static int starturbs(struct bc_state *bcs)
859 for (k = 0; k < BAS_OUTURBS; ++k) { 890 for (k = 0; k < BAS_OUTURBS; ++k) {
860 urb = ubc->isoouturbs[k].urb; 891 urb = ubc->isoouturbs[k].urb;
861 if (!urb) { 892 if (!urb) {
862 dev_err(bcs->cs->dev, "isoouturbs[%d].urb==NULL\n", k);
863 rc = -EFAULT; 893 rc = -EFAULT;
864 goto error; 894 goto error;
865 } 895 }
@@ -885,12 +915,8 @@ static int starturbs(struct bc_state *bcs)
885 for (k = 0; k < 2; ++k) { 915 for (k = 0; k < 2; ++k) {
886 dump_urb(DEBUG_ISO, "Initial isoc write", urb); 916 dump_urb(DEBUG_ISO, "Initial isoc write", urb);
887 rc = usb_submit_urb(ubc->isoouturbs[k].urb, SLAB_ATOMIC); 917 rc = usb_submit_urb(ubc->isoouturbs[k].urb, SLAB_ATOMIC);
888 if (rc != 0) { 918 if (rc != 0)
889 dev_err(bcs->cs->dev,
890 "could not submit isochronous write URB %d: %s\n",
891 k, get_usb_statmsg(rc));
892 goto error; 919 goto error;
893 }
894 } 920 }
895 dump_urb(DEBUG_ISO, "Initial isoc write (free)", urb); 921 dump_urb(DEBUG_ISO, "Initial isoc write (free)", urb);
896 ubc->isooutfree = &ubc->isoouturbs[2]; 922 ubc->isooutfree = &ubc->isoouturbs[2];
@@ -916,15 +942,15 @@ static void stopurbs(struct bas_bc_state *ubc)
916 for (k = 0; k < BAS_INURBS; ++k) { 942 for (k = 0; k < BAS_INURBS; ++k) {
917 rc = usb_unlink_urb(ubc->isoinurbs[k]); 943 rc = usb_unlink_urb(ubc->isoinurbs[k]);
918 gig_dbg(DEBUG_ISO, 944 gig_dbg(DEBUG_ISO,
919 "%s: isoc input URB %d unlinked, result = %d", 945 "%s: isoc input URB %d unlinked, result = %s",
920 __func__, k, rc); 946 __func__, k, get_usb_rcmsg(rc));
921 } 947 }
922 948
923 for (k = 0; k < BAS_OUTURBS; ++k) { 949 for (k = 0; k < BAS_OUTURBS; ++k) {
924 rc = usb_unlink_urb(ubc->isoouturbs[k].urb); 950 rc = usb_unlink_urb(ubc->isoouturbs[k].urb);
925 gig_dbg(DEBUG_ISO, 951 gig_dbg(DEBUG_ISO,
926 "%s: isoc output URB %d unlinked, result = %d", 952 "%s: isoc output URB %d unlinked, result = %s",
927 __func__, k, rc); 953 __func__, k, get_usb_rcmsg(rc));
928 } 954 }
929} 955}
930 956
@@ -934,7 +960,7 @@ static void stopurbs(struct bas_bc_state *ubc)
934/* submit_iso_write_urb 960/* submit_iso_write_urb
935 * fill and submit the next isochronous write URB 961 * fill and submit the next isochronous write URB
936 * parameters: 962 * parameters:
937 * bcs B channel state structure 963 * ucx context structure containing URB
938 * return value: 964 * return value:
939 * number of frames submitted in URB 965 * number of frames submitted in URB
940 * 0 if URB not submitted because no data available (isooutbuf busy) 966 * 0 if URB not submitted because no data available (isooutbuf busy)
@@ -946,7 +972,6 @@ static int submit_iso_write_urb(struct isow_urbctx_t *ucx)
946 struct bas_bc_state *ubc = ucx->bcs->hw.bas; 972 struct bas_bc_state *ubc = ucx->bcs->hw.bas;
947 struct usb_iso_packet_descriptor *ifd; 973 struct usb_iso_packet_descriptor *ifd;
948 int corrbytes, nframe, rc; 974 int corrbytes, nframe, rc;
949 unsigned long flags;
950 975
951 /* urb->dev is clobbered by USB subsystem */ 976 /* urb->dev is clobbered by USB subsystem */
952 urb->dev = ucx->bcs->cs->hw.bas->udev; 977 urb->dev = ucx->bcs->cs->hw.bas->udev;
@@ -992,20 +1017,22 @@ static int submit_iso_write_urb(struct isow_urbctx_t *ucx)
992 ifd->status = 0; 1017 ifd->status = 0;
993 ifd->actual_length = 0; 1018 ifd->actual_length = 0;
994 } 1019 }
995 if ((urb->number_of_packets = nframe) > 0) { 1020 if (unlikely(nframe == 0))
996 spin_lock_irqsave(&ucx->bcs->cs->lock, flags); 1021 return 0; /* no data to send */
997 rc = ucx->bcs->cs->connected ? usb_submit_urb(urb, SLAB_ATOMIC) : -ENODEV; 1022 urb->number_of_packets = nframe;
998 spin_unlock_irqrestore(&ucx->bcs->cs->lock, flags);
999 1023
1000 if (rc) { 1024 rc = usb_submit_urb(urb, SLAB_ATOMIC);
1025 if (unlikely(rc)) {
1026 if (rc == -ENODEV)
1027 /* device removed - give up silently */
1028 gig_dbg(DEBUG_ISO, "%s: disconnected", __func__);
1029 else
1001 dev_err(ucx->bcs->cs->dev, 1030 dev_err(ucx->bcs->cs->dev,
1002 "could not submit isochronous write URB: %s\n", 1031 "could not submit isochronous write URB: %s\n",
1003 get_usb_statmsg(rc)); 1032 get_usb_rcmsg(rc));
1004 dump_urb(DEBUG_ISO, "isoc write", urb); 1033 return rc;
1005 return rc;
1006 }
1007 ++ubc->numsub;
1008 } 1034 }
1035 ++ubc->numsub;
1009 return nframe; 1036 return nframe;
1010} 1037}
1011 1038
@@ -1028,6 +1055,7 @@ static void write_iso_tasklet(unsigned long data)
1028 int i; 1055 int i;
1029 struct sk_buff *skb; 1056 struct sk_buff *skb;
1030 int len; 1057 int len;
1058 int rc;
1031 1059
1032 /* loop while completed URBs arrive in time */ 1060 /* loop while completed URBs arrive in time */
1033 for (;;) { 1061 for (;;) {
@@ -1057,7 +1085,8 @@ static void write_iso_tasklet(unsigned long data)
1057 ubc->isooutfree = NULL; 1085 ubc->isooutfree = NULL;
1058 spin_unlock_irqrestore(&ubc->isooutlock, flags); 1086 spin_unlock_irqrestore(&ubc->isooutlock, flags);
1059 if (next) { 1087 if (next) {
1060 if (submit_iso_write_urb(next) <= 0) { 1088 rc = submit_iso_write_urb(next);
1089 if (unlikely(rc <= 0 && rc != -ENODEV)) {
1061 /* could not submit URB, put it back */ 1090 /* could not submit URB, put it back */
1062 spin_lock_irqsave(&ubc->isooutlock, flags); 1091 spin_lock_irqsave(&ubc->isooutlock, flags);
1063 if (ubc->isooutfree == NULL) { 1092 if (ubc->isooutfree == NULL) {
@@ -1077,17 +1106,18 @@ static void write_iso_tasklet(unsigned long data)
1077 /* process completed URB */ 1106 /* process completed URB */
1078 urb = done->urb; 1107 urb = done->urb;
1079 switch (urb->status) { 1108 switch (urb->status) {
1109 case -EXDEV: /* partial completion */
1110 gig_dbg(DEBUG_ISO, "%s: URB partially completed",
1111 __func__);
1112 /* fall through - what's the difference anyway? */
1080 case 0: /* normal completion */ 1113 case 0: /* normal completion */
1081 break; 1114 /* inspect individual frames
1082 case -EXDEV: /* inspect individual frames */ 1115 * assumptions (for lack of documentation):
1083 /* assumptions (for lack of documentation): 1116 * - actual_length bytes of first frame in error are
1084 * - actual_length bytes of the frame in error are
1085 * successfully sent 1117 * successfully sent
1086 * - all following frames are not sent at all 1118 * - all following frames are not sent at all
1087 */ 1119 */
1088 gig_dbg(DEBUG_ISO, "%s: URB partially completed", 1120 offset = done->limit; /* default (no error) */
1089 __func__);
1090 offset = done->limit; /* just in case */
1091 for (i = 0; i < BAS_NUMFRAMES; i++) { 1121 for (i = 0; i < BAS_NUMFRAMES; i++) {
1092 ifd = &urb->iso_frame_desc[i]; 1122 ifd = &urb->iso_frame_desc[i];
1093 if (ifd->status || 1123 if (ifd->status ||
@@ -1122,7 +1152,7 @@ static void write_iso_tasklet(unsigned long data)
1122 } 1152 }
1123#endif 1153#endif
1124 break; 1154 break;
1125 case -EPIPE: //FIXME is this the code for "underrun"? 1155 case -EPIPE: /* stall - probably underrun */
1126 dev_err(cs->dev, "isochronous write stalled\n"); 1156 dev_err(cs->dev, "isochronous write stalled\n");
1127 error_hangup(bcs); 1157 error_hangup(bcs);
1128 break; 1158 break;
@@ -1142,7 +1172,8 @@ static void write_iso_tasklet(unsigned long data)
1142 spin_unlock_irqrestore(&ubc->isooutlock, flags); 1172 spin_unlock_irqrestore(&ubc->isooutlock, flags);
1143 if (next) { 1173 if (next) {
1144 /* only one URB still active - resubmit one */ 1174 /* only one URB still active - resubmit one */
1145 if (submit_iso_write_urb(next) <= 0) { 1175 rc = submit_iso_write_urb(next);
1176 if (unlikely(rc <= 0 && rc != -ENODEV)) {
1146 /* couldn't submit */ 1177 /* couldn't submit */
1147 error_hangup(bcs); 1178 error_hangup(bcs);
1148 } 1179 }
@@ -1222,10 +1253,9 @@ static void read_iso_tasklet(unsigned long data)
1222 break; 1253 break;
1223 case -ENOENT: 1254 case -ENOENT:
1224 case -ECONNRESET: 1255 case -ECONNRESET:
1225 gig_dbg(DEBUG_ISO, "%s: URB canceled", __func__); 1256 case -EINPROGRESS:
1226 continue; /* -> skip */ 1257 gig_dbg(DEBUG_ISO, "%s: %s",
1227 case -EINPROGRESS: /* huh? */ 1258 __func__, get_usb_statmsg(urb->status));
1228 gig_dbg(DEBUG_ISO, "%s: URB still pending", __func__);
1229 continue; /* -> skip */ 1259 continue; /* -> skip */
1230 case -EPIPE: 1260 case -EPIPE:
1231 dev_err(cs->dev, "isochronous read stalled\n"); 1261 dev_err(cs->dev, "isochronous read stalled\n");
@@ -1290,13 +1320,11 @@ static void read_iso_tasklet(unsigned long data)
1290 urb->dev = bcs->cs->hw.bas->udev; 1320 urb->dev = bcs->cs->hw.bas->udev;
1291 urb->transfer_flags = URB_ISO_ASAP; 1321 urb->transfer_flags = URB_ISO_ASAP;
1292 urb->number_of_packets = BAS_NUMFRAMES; 1322 urb->number_of_packets = BAS_NUMFRAMES;
1293 spin_lock_irqsave(&cs->lock, flags); 1323 rc = usb_submit_urb(urb, SLAB_ATOMIC);
1294 rc = cs->connected ? usb_submit_urb(urb, SLAB_ATOMIC) : -ENODEV; 1324 if (unlikely(rc != 0 && rc != -ENODEV)) {
1295 spin_unlock_irqrestore(&cs->lock, flags);
1296 if (rc) {
1297 dev_err(cs->dev, 1325 dev_err(cs->dev,
1298 "could not resubmit isochronous read URB: %s\n", 1326 "could not resubmit isochronous read URB: %s\n",
1299 get_usb_statmsg(rc)); 1327 get_usb_rcmsg(rc));
1300 dump_urb(DEBUG_ISO, "resubmit iso read", urb); 1328 dump_urb(DEBUG_ISO, "resubmit iso read", urb);
1301 error_hangup(bcs); 1329 error_hangup(bcs);
1302 } 1330 }
@@ -1397,7 +1425,6 @@ static void write_ctrl_callback(struct urb *urb, struct pt_regs *regs)
1397 * timeout timeout in seconds (0: no timeout) 1425 * timeout timeout in seconds (0: no timeout)
1398 * return value: 1426 * return value:
1399 * 0 on success 1427 * 0 on success
1400 * -EINVAL if a NULL pointer is encountered somewhere
1401 * -EBUSY if another request is pending 1428 * -EBUSY if another request is pending
1402 * any URB submission error code 1429 * any URB submission error code
1403 */ 1430 */
@@ -1418,12 +1445,6 @@ static int req_submit(struct bc_state *bcs, int req, int val, int timeout)
1418 req, ucs->pending); 1445 req, ucs->pending);
1419 return -EBUSY; 1446 return -EBUSY;
1420 } 1447 }
1421 if (ucs->urb_ctrl->status == -EINPROGRESS) {
1422 spin_unlock_irqrestore(&ucs->lock, flags);
1423 dev_err(bcs->cs->dev,
1424 "could not submit request 0x%02x: URB busy\n", req);
1425 return -EBUSY;
1426 }
1427 1448
1428 ucs->dr_ctrl.bRequestType = OUT_VENDOR_REQ; 1449 ucs->dr_ctrl.bRequestType = OUT_VENDOR_REQ;
1429 ucs->dr_ctrl.bRequest = req; 1450 ucs->dr_ctrl.bRequest = req;
@@ -1465,22 +1486,36 @@ static int req_submit(struct bc_state *bcs, int req, int val, int timeout)
1465static int gigaset_init_bchannel(struct bc_state *bcs) 1486static int gigaset_init_bchannel(struct bc_state *bcs)
1466{ 1487{
1467 int req, ret; 1488 int req, ret;
1489 unsigned long flags;
1490
1491 spin_lock_irqsave(&bcs->cs->lock, flags);
1492 if (unlikely(!bcs->cs->connected)) {
1493 gig_dbg(DEBUG_USBREQ, "%s: not connected", __func__);
1494 spin_unlock_irqrestore(&bcs->cs->lock, flags);
1495 return -ENODEV;
1496 }
1468 1497
1469 if ((ret = starturbs(bcs)) < 0) { 1498 if ((ret = starturbs(bcs)) < 0) {
1470 dev_err(bcs->cs->dev, 1499 dev_err(bcs->cs->dev,
1471 "could not start isochronous I/O for channel %d\n", 1500 "could not start isochronous I/O for channel B%d: %s\n",
1472 bcs->channel + 1); 1501 bcs->channel + 1,
1473 error_hangup(bcs); 1502 ret == -EFAULT ? "null URB" : get_usb_rcmsg(ret));
1503 if (ret != -ENODEV)
1504 error_hangup(bcs);
1505 spin_unlock_irqrestore(&bcs->cs->lock, flags);
1474 return ret; 1506 return ret;
1475 } 1507 }
1476 1508
1477 req = bcs->channel ? HD_OPEN_B2CHANNEL : HD_OPEN_B1CHANNEL; 1509 req = bcs->channel ? HD_OPEN_B2CHANNEL : HD_OPEN_B1CHANNEL;
1478 if ((ret = req_submit(bcs, req, 0, BAS_TIMEOUT)) < 0) { 1510 if ((ret = req_submit(bcs, req, 0, BAS_TIMEOUT)) < 0) {
1479 dev_err(bcs->cs->dev, "could not open channel %d: %s\n", 1511 dev_err(bcs->cs->dev, "could not open channel B%d\n",
1480 bcs->channel + 1, get_usb_statmsg(ret)); 1512 bcs->channel + 1);
1481 stopurbs(bcs->hw.bas); 1513 stopurbs(bcs->hw.bas);
1482 error_hangup(bcs); 1514 if (ret != -ENODEV)
1515 error_hangup(bcs);
1483 } 1516 }
1517
1518 spin_unlock_irqrestore(&bcs->cs->lock, flags);
1484 return ret; 1519 return ret;
1485} 1520}
1486 1521
@@ -1497,19 +1532,30 @@ static int gigaset_init_bchannel(struct bc_state *bcs)
1497static int gigaset_close_bchannel(struct bc_state *bcs) 1532static int gigaset_close_bchannel(struct bc_state *bcs)
1498{ 1533{
1499 int req, ret; 1534 int req, ret;
1535 unsigned long flags;
1536
1537 spin_lock_irqsave(&bcs->cs->lock, flags);
1538 if (unlikely(!bcs->cs->connected)) {
1539 spin_unlock_irqrestore(&bcs->cs->lock, flags);
1540 gig_dbg(DEBUG_USBREQ, "%s: not connected", __func__);
1541 return -ENODEV;
1542 }
1500 1543
1501 if (!(atomic_read(&bcs->cs->hw.bas->basstate) & 1544 if (!(atomic_read(&bcs->cs->hw.bas->basstate) &
1502 (bcs->channel ? BS_B2OPEN : BS_B1OPEN))) { 1545 (bcs->channel ? BS_B2OPEN : BS_B1OPEN))) {
1503 /* channel not running: just signal common.c */ 1546 /* channel not running: just signal common.c */
1547 spin_unlock_irqrestore(&bcs->cs->lock, flags);
1504 gigaset_bchannel_down(bcs); 1548 gigaset_bchannel_down(bcs);
1505 return 0; 1549 return 0;
1506 } 1550 }
1507 1551
1552 /* channel running: tell device to close it */
1508 req = bcs->channel ? HD_CLOSE_B2CHANNEL : HD_CLOSE_B1CHANNEL; 1553 req = bcs->channel ? HD_CLOSE_B2CHANNEL : HD_CLOSE_B1CHANNEL;
1509 if ((ret = req_submit(bcs, req, 0, BAS_TIMEOUT)) < 0) 1554 if ((ret = req_submit(bcs, req, 0, BAS_TIMEOUT)) < 0)
1510 dev_err(bcs->cs->dev, 1555 dev_err(bcs->cs->dev, "closing channel B%d failed\n",
1511 "could not submit HD_CLOSE_BxCHANNEL request: %s\n", 1556 bcs->channel + 1);
1512 get_usb_statmsg(ret)); 1557
1558 spin_unlock_irqrestore(&bcs->cs->lock, flags);
1513 return ret; 1559 return ret;
1514} 1560}
1515 1561
@@ -1545,8 +1591,6 @@ static void complete_cb(struct cardstate *cs)
1545 kfree(cb); 1591 kfree(cb);
1546} 1592}
1547 1593
1548static int atwrite_submit(struct cardstate *cs, unsigned char *buf, int len);
1549
1550/* write_command_callback 1594/* write_command_callback
1551 * USB completion handler for AT command transmission 1595 * USB completion handler for AT command transmission
1552 * called by the USB subsystem in interrupt context 1596 * called by the USB subsystem in interrupt context
@@ -1560,13 +1604,17 @@ static void write_command_callback(struct urb *urb, struct pt_regs *regs)
1560 struct bas_cardstate *ucs = cs->hw.bas; 1604 struct bas_cardstate *ucs = cs->hw.bas;
1561 unsigned long flags; 1605 unsigned long flags;
1562 1606
1607 update_basstate(ucs, 0, BS_ATWRPEND);
1608
1563 /* check status */ 1609 /* check status */
1564 switch (urb->status) { 1610 switch (urb->status) {
1565 case 0: /* normal completion */ 1611 case 0: /* normal completion */
1566 break; 1612 break;
1567 case -ENOENT: /* canceled */ 1613 case -ENOENT: /* cancelled */
1568 case -ECONNRESET: /* canceled (async) */ 1614 case -ECONNRESET: /* cancelled (async) */
1569 case -EINPROGRESS: /* pending */ 1615 case -EINPROGRESS: /* pending */
1616 case -ENODEV: /* device removed */
1617 case -ESHUTDOWN: /* device shut down */
1570 /* ignore silently */ 1618 /* ignore silently */
1571 gig_dbg(DEBUG_USBREQ, "%s: %s", 1619 gig_dbg(DEBUG_USBREQ, "%s: %s",
1572 __func__, get_usb_statmsg(urb->status)); 1620 __func__, get_usb_statmsg(urb->status));
@@ -1627,19 +1675,17 @@ static void atrdy_timeout(unsigned long data)
1627 * len length of command to send 1675 * len length of command to send
1628 * return value: 1676 * return value:
1629 * 0 on success 1677 * 0 on success
1630 * -EFAULT if a NULL pointer is encountered somewhere
1631 * -EBUSY if another request is pending 1678 * -EBUSY if another request is pending
1632 * any URB submission error code 1679 * any URB submission error code
1633 */ 1680 */
1634static int atwrite_submit(struct cardstate *cs, unsigned char *buf, int len) 1681static int atwrite_submit(struct cardstate *cs, unsigned char *buf, int len)
1635{ 1682{
1636 struct bas_cardstate *ucs = cs->hw.bas; 1683 struct bas_cardstate *ucs = cs->hw.bas;
1637 unsigned long flags; 1684 int rc;
1638 int ret;
1639 1685
1640 gig_dbg(DEBUG_USBREQ, "-------> HD_WRITE_ATMESSAGE (%d)", len); 1686 gig_dbg(DEBUG_USBREQ, "-------> HD_WRITE_ATMESSAGE (%d)", len);
1641 1687
1642 if (ucs->urb_cmd_out->status == -EINPROGRESS) { 1688 if (update_basstate(ucs, BS_ATWRPEND, 0) & BS_ATWRPEND) {
1643 dev_err(cs->dev, 1689 dev_err(cs->dev,
1644 "could not submit HD_WRITE_ATMESSAGE: URB busy\n"); 1690 "could not submit HD_WRITE_ATMESSAGE: URB busy\n");
1645 return -EBUSY; 1691 return -EBUSY;
@@ -1654,29 +1700,22 @@ static int atwrite_submit(struct cardstate *cs, unsigned char *buf, int len)
1654 usb_sndctrlpipe(ucs->udev, 0), 1700 usb_sndctrlpipe(ucs->udev, 0),
1655 (unsigned char*) &ucs->dr_cmd_out, buf, len, 1701 (unsigned char*) &ucs->dr_cmd_out, buf, len,
1656 write_command_callback, cs); 1702 write_command_callback, cs);
1657 1703 rc = usb_submit_urb(ucs->urb_cmd_out, SLAB_ATOMIC);
1658 spin_lock_irqsave(&cs->lock, flags); 1704 if (unlikely(rc)) {
1659 ret = cs->connected ? usb_submit_urb(ucs->urb_cmd_out, SLAB_ATOMIC) : -ENODEV; 1705 update_basstate(ucs, 0, BS_ATWRPEND);
1660 spin_unlock_irqrestore(&cs->lock, flags);
1661
1662 if (ret) {
1663 dev_err(cs->dev, "could not submit HD_WRITE_ATMESSAGE: %s\n", 1706 dev_err(cs->dev, "could not submit HD_WRITE_ATMESSAGE: %s\n",
1664 get_usb_statmsg(ret)); 1707 get_usb_rcmsg(rc));
1665 return ret; 1708 return rc;
1666 } 1709 }
1667 1710
1668 /* submitted successfully */ 1711 /* submitted successfully, start timeout if necessary */
1669 update_basstate(ucs, 0, BS_ATREADY); 1712 if (!(update_basstate(ucs, BS_ATTIMER, BS_ATREADY) & BS_ATTIMER)) {
1670
1671 /* start timeout if necessary */
1672 if (!(atomic_read(&ucs->basstate) & BS_ATTIMER)) {
1673 gig_dbg(DEBUG_OUTPUT, "setting ATREADY timeout of %d/10 secs", 1713 gig_dbg(DEBUG_OUTPUT, "setting ATREADY timeout of %d/10 secs",
1674 ATRDY_TIMEOUT); 1714 ATRDY_TIMEOUT);
1675 ucs->timer_atrdy.expires = jiffies + ATRDY_TIMEOUT * HZ / 10; 1715 ucs->timer_atrdy.expires = jiffies + ATRDY_TIMEOUT * HZ / 10;
1676 ucs->timer_atrdy.data = (unsigned long) cs; 1716 ucs->timer_atrdy.data = (unsigned long) cs;
1677 ucs->timer_atrdy.function = atrdy_timeout; 1717 ucs->timer_atrdy.function = atrdy_timeout;
1678 add_timer(&ucs->timer_atrdy); 1718 add_timer(&ucs->timer_atrdy);
1679 update_basstate(ucs, BS_ATTIMER, 0);
1680 } 1719 }
1681 return 0; 1720 return 0;
1682} 1721}
@@ -1702,7 +1741,6 @@ static int start_cbsend(struct cardstate *cs)
1702 gig_dbg(DEBUG_TRANSCMD|DEBUG_LOCKCMD, "AT channel not open"); 1741 gig_dbg(DEBUG_TRANSCMD|DEBUG_LOCKCMD, "AT channel not open");
1703 rc = req_submit(cs->bcs, HD_OPEN_ATCHANNEL, 0, BAS_TIMEOUT); 1742 rc = req_submit(cs->bcs, HD_OPEN_ATCHANNEL, 0, BAS_TIMEOUT);
1704 if (rc < 0) { 1743 if (rc < 0) {
1705 dev_err(cs->dev, "could not open AT channel\n");
1706 /* flush command queue */ 1744 /* flush command queue */
1707 spin_lock_irqsave(&cs->cmdlock, flags); 1745 spin_lock_irqsave(&cs->cmdlock, flags);
1708 while (cs->cmdbuf != NULL) 1746 while (cs->cmdbuf != NULL)
@@ -1786,8 +1824,14 @@ static int gigaset_write_cmd(struct cardstate *cs,
1786 cs->lastcmdbuf = cb; 1824 cs->lastcmdbuf = cb;
1787 spin_unlock_irqrestore(&cs->cmdlock, flags); 1825 spin_unlock_irqrestore(&cs->cmdlock, flags);
1788 1826
1827 spin_lock_irqsave(&cs->lock, flags);
1828 if (unlikely(!cs->connected)) {
1829 spin_unlock_irqrestore(&cs->lock, flags);
1830 gig_dbg(DEBUG_USBREQ, "%s: not connected", __func__);
1831 return -ENODEV;
1832 }
1789 status = start_cbsend(cs); 1833 status = start_cbsend(cs);
1790 1834 spin_unlock_irqrestore(&cs->lock, flags);
1791 return status < 0 ? status : len; 1835 return status < 0 ? status : len;
1792} 1836}
1793 1837
@@ -1849,12 +1893,32 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6])
1849 */ 1893 */
1850static int gigaset_freebcshw(struct bc_state *bcs) 1894static int gigaset_freebcshw(struct bc_state *bcs)
1851{ 1895{
1852 if (!bcs->hw.bas) 1896 struct bas_bc_state *ubc = bcs->hw.bas;
1897 int i;
1898
1899 if (!ubc)
1853 return 0; 1900 return 0;
1854 1901
1855 if (bcs->hw.bas->isooutbuf) 1902 /* kill URBs and tasklets before freeing - better safe than sorry */
1856 kfree(bcs->hw.bas->isooutbuf); 1903 atomic_set(&ubc->running, 0);
1857 kfree(bcs->hw.bas); 1904 for (i = 0; i < BAS_OUTURBS; ++i)
1905 if (ubc->isoouturbs[i].urb) {
1906 gig_dbg(DEBUG_INIT, "%s: killing iso out URB %d",
1907 __func__, i);
1908 usb_kill_urb(ubc->isoouturbs[i].urb);
1909 usb_free_urb(ubc->isoouturbs[i].urb);
1910 }
1911 for (i = 0; i < BAS_INURBS; ++i)
1912 if (ubc->isoinurbs[i]) {
1913 gig_dbg(DEBUG_INIT, "%s: killing iso in URB %d",
1914 __func__, i);
1915 usb_kill_urb(ubc->isoinurbs[i]);
1916 usb_free_urb(ubc->isoinurbs[i]);
1917 }
1918 tasklet_kill(&ubc->sent_tasklet);
1919 tasklet_kill(&ubc->rcvd_tasklet);
1920 kfree(ubc->isooutbuf);
1921 kfree(ubc);
1858 bcs->hw.bas = NULL; 1922 bcs->hw.bas = NULL;
1859 return 1; 1923 return 1;
1860} 1924}
@@ -1931,13 +1995,9 @@ static void gigaset_reinitbcshw(struct bc_state *bcs)
1931 1995
1932static void gigaset_freecshw(struct cardstate *cs) 1996static void gigaset_freecshw(struct cardstate *cs)
1933{ 1997{
1934 struct bas_cardstate *ucs = cs->hw.bas; 1998 /* timers, URBs and rcvbuf are disposed of in disconnect */
1935
1936 del_timer(&ucs->timer_ctrl);
1937 del_timer(&ucs->timer_atrdy);
1938 del_timer(&ucs->timer_cmd_in);
1939
1940 kfree(cs->hw.bas); 1999 kfree(cs->hw.bas);
2000 cs->hw.bas = NULL;
1941} 2001}
1942 2002
1943static int gigaset_initcshw(struct cardstate *cs) 2003static int gigaset_initcshw(struct cardstate *cs)
@@ -2041,23 +2101,13 @@ static int gigaset_probe(struct usb_interface *interface,
2041 struct bas_bc_state *ubc; 2101 struct bas_bc_state *ubc;
2042 struct usb_endpoint_descriptor *endpoint; 2102 struct usb_endpoint_descriptor *endpoint;
2043 int i, j; 2103 int i, j;
2044 int ret; 2104 int rc;
2045 2105
2046 gig_dbg(DEBUG_ANY, 2106 gig_dbg(DEBUG_ANY,
2047 "%s: Check if device matches .. (Vendor: 0x%x, Product: 0x%x)", 2107 "%s: Check if device matches .. (Vendor: 0x%x, Product: 0x%x)",
2048 __func__, le16_to_cpu(udev->descriptor.idVendor), 2108 __func__, le16_to_cpu(udev->descriptor.idVendor),
2049 le16_to_cpu(udev->descriptor.idProduct)); 2109 le16_to_cpu(udev->descriptor.idProduct));
2050 2110
2051 /* See if the device offered us matches what we can accept */
2052 if ((le16_to_cpu(udev->descriptor.idVendor) != USB_GIGA_VENDOR_ID) ||
2053 (le16_to_cpu(udev->descriptor.idProduct) != USB_GIGA_PRODUCT_ID &&
2054 le16_to_cpu(udev->descriptor.idProduct) != USB_4175_PRODUCT_ID &&
2055 le16_to_cpu(udev->descriptor.idProduct) != USB_SX303_PRODUCT_ID &&
2056 le16_to_cpu(udev->descriptor.idProduct) != USB_SX353_PRODUCT_ID)) {
2057 gig_dbg(DEBUG_ANY, "%s: unmatched ID - exiting", __func__);
2058 return -ENODEV;
2059 }
2060
2061 /* set required alternate setting */ 2111 /* set required alternate setting */
2062 hostif = interface->cur_altsetting; 2112 hostif = interface->cur_altsetting;
2063 if (hostif->desc.bAlternateSetting != 3) { 2113 if (hostif->desc.bAlternateSetting != 3) {
@@ -2105,45 +2155,22 @@ static int gigaset_probe(struct usb_interface *interface,
2105 * - three for the different uses of the default control pipe 2155 * - three for the different uses of the default control pipe
2106 * - three for each isochronous pipe 2156 * - three for each isochronous pipe
2107 */ 2157 */
2108 ucs->urb_int_in = usb_alloc_urb(0, SLAB_KERNEL); 2158 if (!(ucs->urb_int_in = usb_alloc_urb(0, SLAB_KERNEL)) ||
2109 if (!ucs->urb_int_in) { 2159 !(ucs->urb_cmd_in = usb_alloc_urb(0, SLAB_KERNEL)) ||
2110 dev_err(cs->dev, "no free urbs available\n"); 2160 !(ucs->urb_cmd_out = usb_alloc_urb(0, SLAB_KERNEL)) ||
2111 goto error; 2161 !(ucs->urb_ctrl = usb_alloc_urb(0, SLAB_KERNEL)))
2112 } 2162 goto allocerr;
2113 ucs->urb_cmd_in = usb_alloc_urb(0, SLAB_KERNEL);
2114 if (!ucs->urb_cmd_in) {
2115 dev_err(cs->dev, "no free urbs available\n");
2116 goto error;
2117 }
2118 ucs->urb_cmd_out = usb_alloc_urb(0, SLAB_KERNEL);
2119 if (!ucs->urb_cmd_out) {
2120 dev_err(cs->dev, "no free urbs available\n");
2121 goto error;
2122 }
2123 ucs->urb_ctrl = usb_alloc_urb(0, SLAB_KERNEL);
2124 if (!ucs->urb_ctrl) {
2125 dev_err(cs->dev, "no free urbs available\n");
2126 goto error;
2127 }
2128 2163
2129 for (j = 0; j < 2; ++j) { 2164 for (j = 0; j < 2; ++j) {
2130 ubc = cs->bcs[j].hw.bas; 2165 ubc = cs->bcs[j].hw.bas;
2131 for (i = 0; i < BAS_OUTURBS; ++i) { 2166 for (i = 0; i < BAS_OUTURBS; ++i)
2132 ubc->isoouturbs[i].urb = 2167 if (!(ubc->isoouturbs[i].urb =
2133 usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL); 2168 usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL)))
2134 if (!ubc->isoouturbs[i].urb) { 2169 goto allocerr;
2135 dev_err(cs->dev, "no free urbs available\n"); 2170 for (i = 0; i < BAS_INURBS; ++i)
2136 goto error; 2171 if (!(ubc->isoinurbs[i] =
2137 } 2172 usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL)))
2138 } 2173 goto allocerr;
2139 for (i = 0; i < BAS_INURBS; ++i) {
2140 ubc->isoinurbs[i] =
2141 usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL);
2142 if (!ubc->isoinurbs[i]) {
2143 dev_err(cs->dev, "no free urbs available\n");
2144 goto error;
2145 }
2146 }
2147 } 2174 }
2148 2175
2149 ucs->rcvbuf = NULL; 2176 ucs->rcvbuf = NULL;
@@ -2156,15 +2183,14 @@ static int gigaset_probe(struct usb_interface *interface,
2156 (endpoint->bEndpointAddress) & 0x0f), 2183 (endpoint->bEndpointAddress) & 0x0f),
2157 ucs->int_in_buf, 3, read_int_callback, cs, 2184 ucs->int_in_buf, 3, read_int_callback, cs,
2158 endpoint->bInterval); 2185 endpoint->bInterval);
2159 ret = usb_submit_urb(ucs->urb_int_in, SLAB_KERNEL); 2186 if ((rc = usb_submit_urb(ucs->urb_int_in, SLAB_KERNEL)) != 0) {
2160 if (ret) {
2161 dev_err(cs->dev, "could not submit interrupt URB: %s\n", 2187 dev_err(cs->dev, "could not submit interrupt URB: %s\n",
2162 get_usb_statmsg(ret)); 2188 get_usb_rcmsg(rc));
2163 goto error; 2189 goto error;
2164 } 2190 }
2165 2191
2166 /* tell the device that the driver is ready */ 2192 /* tell the device that the driver is ready */
2167 if ((ret = req_submit(cs->bcs, HD_DEVICE_INIT_ACK, 0, 0)) != 0) 2193 if ((rc = req_submit(cs->bcs, HD_DEVICE_INIT_ACK, 0, 0)) != 0)
2168 goto error; 2194 goto error;
2169 2195
2170 /* tell common part that the device is ready */ 2196 /* tell common part that the device is ready */
@@ -2179,6 +2205,8 @@ static int gigaset_probe(struct usb_interface *interface,
2179 2205
2180 return 0; 2206 return 0;
2181 2207
2208allocerr:
2209 dev_err(cs->dev, "could not allocate URBs\n");
2182error: 2210error:
2183 freeurbs(cs); 2211 freeurbs(cs);
2184 usb_set_intfdata(interface, NULL); 2212 usb_set_intfdata(interface, NULL);
@@ -2193,19 +2221,34 @@ static void gigaset_disconnect(struct usb_interface *interface)
2193{ 2221{
2194 struct cardstate *cs; 2222 struct cardstate *cs;
2195 struct bas_cardstate *ucs; 2223 struct bas_cardstate *ucs;
2224 int j;
2196 2225
2197 cs = usb_get_intfdata(interface); 2226 cs = usb_get_intfdata(interface);
2198 2227
2199 ucs = cs->hw.bas; 2228 ucs = cs->hw.bas;
2200 2229
2201 dev_info(cs->dev, "disconnecting Gigaset base\n"); 2230 dev_info(cs->dev, "disconnecting Gigaset base\n");
2231
2232 /* mark base as not ready, all channels disconnected */
2233 atomic_set(&ucs->basstate, 0);
2234
2235 /* tell LL all channels are down */
2236 //FIXME shouldn't gigaset_stop() do this?
2237 for (j = 0; j < 2; ++j)
2238 gigaset_bchannel_down(cs->bcs + j);
2239
2240 /* stop driver (common part) */
2202 gigaset_stop(cs); 2241 gigaset_stop(cs);
2242
2243 /* stop timers and URBs, free ressources */
2244 del_timer_sync(&ucs->timer_ctrl);
2245 del_timer_sync(&ucs->timer_atrdy);
2246 del_timer_sync(&ucs->timer_cmd_in);
2203 freeurbs(cs); 2247 freeurbs(cs);
2204 usb_set_intfdata(interface, NULL); 2248 usb_set_intfdata(interface, NULL);
2205 kfree(ucs->rcvbuf); 2249 kfree(ucs->rcvbuf);
2206 ucs->rcvbuf = NULL; 2250 ucs->rcvbuf = NULL;
2207 ucs->rcvbuf_size = 0; 2251 ucs->rcvbuf_size = 0;
2208 atomic_set(&ucs->basstate, 0);
2209 usb_put_dev(ucs->udev); 2252 usb_put_dev(ucs->udev);
2210 ucs->interface = NULL; 2253 ucs->interface = NULL;
2211 ucs->udev = NULL; 2254 ucs->udev = NULL;
@@ -2277,6 +2320,8 @@ error: if (cardstate)
2277 */ 2320 */
2278static void __exit bas_gigaset_exit(void) 2321static void __exit bas_gigaset_exit(void)
2279{ 2322{
2323 struct bas_cardstate *ucs = cardstate->hw.bas;
2324
2280 gigaset_blockdriver(driver); /* => probe will fail 2325 gigaset_blockdriver(driver); /* => probe will fail
2281 * => no gigaset_start any more 2326 * => no gigaset_start any more
2282 */ 2327 */
@@ -2284,14 +2329,26 @@ static void __exit bas_gigaset_exit(void)
2284 gigaset_shutdown(cardstate); 2329 gigaset_shutdown(cardstate);
2285 /* from now on, no isdn callback should be possible */ 2330 /* from now on, no isdn callback should be possible */
2286 2331
2287 if (atomic_read(&cardstate->hw.bas->basstate) & BS_ATOPEN) { 2332 /* close all still open channels */
2288 gig_dbg(DEBUG_ANY, "closing AT channel"); 2333 if (atomic_read(&ucs->basstate) & BS_B1OPEN) {
2289 if (req_submit(cardstate->bcs, 2334 gig_dbg(DEBUG_INIT, "closing B1 channel");
2290 HD_CLOSE_ATCHANNEL, 0, BAS_TIMEOUT) >= 0) { 2335 usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0),
2291 /* successfully submitted */ 2336 HD_CLOSE_B1CHANNEL, OUT_VENDOR_REQ, 0, 0,
2292 //FIXME wait for completion? 2337 NULL, 0, BAS_TIMEOUT);
2293 } 2338 }
2339 if (atomic_read(&ucs->basstate) & BS_B2OPEN) {
2340 gig_dbg(DEBUG_INIT, "closing B2 channel");
2341 usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0),
2342 HD_CLOSE_B2CHANNEL, OUT_VENDOR_REQ, 0, 0,
2343 NULL, 0, BAS_TIMEOUT);
2344 }
2345 if (atomic_read(&ucs->basstate) & BS_ATOPEN) {
2346 gig_dbg(DEBUG_INIT, "closing AT channel");
2347 usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0),
2348 HD_CLOSE_ATCHANNEL, OUT_VENDOR_REQ, 0, 0,
2349 NULL, 0, BAS_TIMEOUT);
2294 } 2350 }
2351 atomic_set(&ucs->basstate, 0);
2295 2352
2296 /* deregister this driver with the USB subsystem */ 2353 /* deregister this driver with the USB subsystem */
2297 usb_deregister(&gigaset_usb_driver); 2354 usb_deregister(&gigaset_usb_driver);
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 749b3da1236e..e55767b2ccd3 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -781,8 +781,7 @@ error: if (cs)
781} 781}
782EXPORT_SYMBOL_GPL(gigaset_initcs); 782EXPORT_SYMBOL_GPL(gigaset_initcs);
783 783
784/* ReInitialize the b-channel structure */ 784/* ReInitialize the b-channel structure on hangup */
785/* e.g. called on hangup, disconnect */
786void gigaset_bcs_reinit(struct bc_state *bcs) 785void gigaset_bcs_reinit(struct bc_state *bcs)
787{ 786{
788 struct sk_buff *skb; 787 struct sk_buff *skb;
diff --git a/drivers/isdn/gigaset/ev-layer.c b/drivers/isdn/gigaset/ev-layer.c
index 1ba3424a286b..18e05c09b71c 100644
--- a/drivers/isdn/gigaset/ev-layer.c
+++ b/drivers/isdn/gigaset/ev-layer.c
@@ -373,6 +373,9 @@ struct reply_t gigaset_tab_cid_m10x[] = /* for M10x */
373 373
374 {EV_TIMEOUT, 750,750, -1, 0, 0, {ACT_CONNTIMEOUT}}, 374 {EV_TIMEOUT, 750,750, -1, 0, 0, {ACT_CONNTIMEOUT}},
375 375
376 /* B channel closed (general case) */
377 {EV_BC_CLOSED, -1, -1, -1, -1,-1, {ACT_NOTIFY_BC_DOWN}}, //FIXME
378
376 /* misc. */ 379 /* misc. */
377 {EV_PROTO_L2, -1, -1, -1, -1,-1, {ACT_PROTO_L2}}, //FIXME 380 {EV_PROTO_L2, -1, -1, -1, -1,-1, {ACT_PROTO_L2}}, //FIXME
378 381
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h
index 9d21ba8757b0..22b9693f7c0a 100644
--- a/drivers/isdn/gigaset/gigaset.h
+++ b/drivers/isdn/gigaset/gigaset.h
@@ -75,7 +75,7 @@ extern int gigaset_debuglevel; /* "needs" cast to (enum debuglevel) */
75 * e.g. 'insmod usb_gigaset.o debug=0x2c' will set DEBUG_OPEN, DEBUG_CMD and 75 * e.g. 'insmod usb_gigaset.o debug=0x2c' will set DEBUG_OPEN, DEBUG_CMD and
76 * DEBUG_INTR. 76 * DEBUG_INTR.
77 */ 77 */
78enum debuglevel { /* up to 24 bits (atomic_t) */ 78enum debuglevel {
79 DEBUG_REG = 0x0002, /* serial port I/O register operations */ 79 DEBUG_REG = 0x0002, /* serial port I/O register operations */
80 DEBUG_OPEN = 0x0004, /* open/close serial port */ 80 DEBUG_OPEN = 0x0004, /* open/close serial port */
81 DEBUG_INTR = 0x0008, /* interrupt processing */ 81 DEBUG_INTR = 0x0008, /* interrupt processing */
@@ -141,7 +141,7 @@ enum debuglevel { /* up to 24 bits (atomic_t) */
141 printk(KERN_DEBUG KBUILD_MODNAME ": " format "\n", \ 141 printk(KERN_DEBUG KBUILD_MODNAME ": " format "\n", \
142 ## arg); \ 142 ## arg); \
143 } while (0) 143 } while (0)
144#define DEBUG_DEFAULT (DEBUG_INIT | DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ) 144#define DEBUG_DEFAULT (DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ)
145 145
146#else 146#else
147 147
@@ -627,8 +627,7 @@ struct gigaset_ops {
627 /* Called by gigaset_freecs() for freeing bcs->hw.xxx */ 627 /* Called by gigaset_freecs() for freeing bcs->hw.xxx */
628 int (*freebcshw)(struct bc_state *bcs); 628 int (*freebcshw)(struct bc_state *bcs);
629 629
630 /* Called by gigaset_stop() or gigaset_bchannel_down() for resetting 630 /* Called by gigaset_bchannel_down() for resetting bcs->hw.xxx */
631 bcs->hw.xxx */
632 void (*reinitbcshw)(struct bc_state *bcs); 631 void (*reinitbcshw)(struct bc_state *bcs);
633 632
634 /* Called by gigaset_initcs() for setting up cs->hw.xxx */ 633 /* Called by gigaset_initcs() for setting up cs->hw.xxx */
diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c
index 0815dbfb8291..1654fa413575 100644
--- a/drivers/isdn/gigaset/i4l.c
+++ b/drivers/isdn/gigaset/i4l.c
@@ -73,7 +73,7 @@ static int writebuf_from_LL(int driverID, int channel, int ack,
73 len, skblen, (unsigned) skb->head[0], (unsigned) skb->head[1]); 73 len, skblen, (unsigned) skb->head[0], (unsigned) skb->head[1]);
74 74
75 /* pass to device-specific module */ 75 /* pass to device-specific module */
76 return cs->ops->send_skb(bcs, skb); //FIXME cs->ops->send_skb() must handle !cs->connected correctly 76 return cs->ops->send_skb(bcs, skb);
77} 77}
78 78
79void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb) 79void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb)
diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c
index 45f017ed6e8c..8667daaa1a82 100644
--- a/drivers/isdn/gigaset/isocdata.c
+++ b/drivers/isdn/gigaset/isocdata.c
@@ -992,14 +992,18 @@ int gigaset_isoc_send_skb(struct bc_state *bcs, struct sk_buff *skb)
992 int len = skb->len; 992 int len = skb->len;
993 unsigned long flags; 993 unsigned long flags;
994 994
995 spin_lock_irqsave(&bcs->cs->lock, flags);
996 if (!bcs->cs->connected) {
997 spin_unlock_irqrestore(&bcs->cs->lock, flags);
998 return -ENODEV;
999 }
1000
995 skb_queue_tail(&bcs->squeue, skb); 1001 skb_queue_tail(&bcs->squeue, skb);
996 gig_dbg(DEBUG_ISO, "%s: skb queued, qlen=%d", 1002 gig_dbg(DEBUG_ISO, "%s: skb queued, qlen=%d",
997 __func__, skb_queue_len(&bcs->squeue)); 1003 __func__, skb_queue_len(&bcs->squeue));
998 1004
999 /* tasklet submits URB if necessary */ 1005 /* tasklet submits URB if necessary */
1000 spin_lock_irqsave(&bcs->cs->lock, flags); 1006 tasklet_schedule(&bcs->hw.bas->sent_tasklet);
1001 if (bcs->cs->connected)
1002 tasklet_schedule(&bcs->hw.bas->sent_tasklet);
1003 spin_unlock_irqrestore(&bcs->cs->lock, flags); 1007 spin_unlock_irqrestore(&bcs->cs->lock, flags);
1004 1008
1005 return len; /* ok so far */ 1009 return len; /* ok so far */
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index 5ebfd1d138da..5282fec17075 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -627,8 +627,8 @@ thermostat_init(void)
627 if(therm_type == ADT7460) 627 if(therm_type == ADT7460)
628 device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed); 628 device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed);
629 629
630#ifndef CONFIG_I2C_KEYWEST 630#ifndef CONFIG_I2C_POWERMAC
631 request_module("i2c-keywest"); 631 request_module("i2c-powermac");
632#endif 632#endif
633 633
634 return i2c_add_driver(&thermostat_driver); 634 return i2c_add_driver(&thermostat_driver);
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c
index eb9a8826e9b5..eb42cb349420 100644
--- a/drivers/mmc/pxamci.c
+++ b/drivers/mmc/pxamci.c
@@ -65,11 +65,6 @@ struct pxamci_host {
65 unsigned int dma_dir; 65 unsigned int dma_dir;
66}; 66};
67 67
68static inline unsigned int ns_to_clocks(unsigned int ns)
69{
70 return (ns * (CLOCKRATE / 1000000) + 999) / 1000;
71}
72
73static void pxamci_stop_clock(struct pxamci_host *host) 68static void pxamci_stop_clock(struct pxamci_host *host)
74{ 69{
75 if (readl(host->base + MMC_STAT) & STAT_CLK_EN) { 70 if (readl(host->base + MMC_STAT) & STAT_CLK_EN) {
@@ -113,6 +108,7 @@ static void pxamci_disable_irq(struct pxamci_host *host, unsigned int mask)
113static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data) 108static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
114{ 109{
115 unsigned int nob = data->blocks; 110 unsigned int nob = data->blocks;
111 unsigned long long clks;
116 unsigned int timeout; 112 unsigned int timeout;
117 u32 dcmd; 113 u32 dcmd;
118 int i; 114 int i;
@@ -125,7 +121,9 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
125 writel(nob, host->base + MMC_NOB); 121 writel(nob, host->base + MMC_NOB);
126 writel(1 << data->blksz_bits, host->base + MMC_BLKLEN); 122 writel(1 << data->blksz_bits, host->base + MMC_BLKLEN);
127 123
128 timeout = ns_to_clocks(data->timeout_ns) + data->timeout_clks; 124 clks = (unsigned long long)data->timeout_ns * CLOCKRATE;
125 do_div(clks, 1000000000UL);
126 timeout = (unsigned int)clks + (data->timeout_clks << host->clkrt);
129 writel((timeout + 255) / 256, host->base + MMC_RDTO); 127 writel((timeout + 255) / 256, host->base + MMC_RDTO);
130 128
131 if (data->flags & MMC_DATA_READ) { 129 if (data->flags & MMC_DATA_READ) {
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index add8dc4aa7b0..c99e87838f92 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3768,6 +3768,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3768 ps_page->ps_page[j] = NULL; 3768 ps_page->ps_page[j] = NULL;
3769 skb->len += length; 3769 skb->len += length;
3770 skb->data_len += length; 3770 skb->data_len += length;
3771 skb->truesize += length;
3771 } 3772 }
3772 3773
3773copydone: 3774copydone:
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 7627a75f4f7c..9788b1ef2e7d 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -105,6 +105,7 @@
105 * 0.50: 20 Jan 2006: Add 8021pq tagging support. 105 * 0.50: 20 Jan 2006: Add 8021pq tagging support.
106 * 0.51: 20 Jan 2006: Add 64bit consistent memory allocation for rings. 106 * 0.51: 20 Jan 2006: Add 64bit consistent memory allocation for rings.
107 * 0.52: 20 Jan 2006: Add MSI/MSIX support. 107 * 0.52: 20 Jan 2006: Add MSI/MSIX support.
108 * 0.53: 19 Mar 2006: Fix init from low power mode and add hw reset.
108 * 109 *
109 * Known bugs: 110 * Known bugs:
110 * We suspect that on some hardware no TX done interrupts are generated. 111 * We suspect that on some hardware no TX done interrupts are generated.
@@ -116,7 +117,7 @@
116 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few 117 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
117 * superfluous timer interrupts from the nic. 118 * superfluous timer interrupts from the nic.
118 */ 119 */
119#define FORCEDETH_VERSION "0.52" 120#define FORCEDETH_VERSION "0.53"
120#define DRV_NAME "forcedeth" 121#define DRV_NAME "forcedeth"
121 122
122#include <linux/module.h> 123#include <linux/module.h>
@@ -160,6 +161,7 @@
160#define DEV_HAS_VLAN 0x0020 /* device supports vlan tagging and striping */ 161#define DEV_HAS_VLAN 0x0020 /* device supports vlan tagging and striping */
161#define DEV_HAS_MSI 0x0040 /* device supports MSI */ 162#define DEV_HAS_MSI 0x0040 /* device supports MSI */
162#define DEV_HAS_MSI_X 0x0080 /* device supports MSI-X */ 163#define DEV_HAS_MSI_X 0x0080 /* device supports MSI-X */
164#define DEV_HAS_POWER_CNTRL 0x0100 /* device supports power savings */
163 165
164enum { 166enum {
165 NvRegIrqStatus = 0x000, 167 NvRegIrqStatus = 0x000,
@@ -203,6 +205,8 @@ enum {
203#define NVREG_MISC1_HD 0x02 205#define NVREG_MISC1_HD 0x02
204#define NVREG_MISC1_FORCE 0x3b0f3c 206#define NVREG_MISC1_FORCE 0x3b0f3c
205 207
208 NvRegMacReset = 0x3c,
209#define NVREG_MAC_RESET_ASSERT 0x0F3
206 NvRegTransmitterControl = 0x084, 210 NvRegTransmitterControl = 0x084,
207#define NVREG_XMITCTL_START 0x01 211#define NVREG_XMITCTL_START 0x01
208 NvRegTransmitterStatus = 0x088, 212 NvRegTransmitterStatus = 0x088,
@@ -326,6 +330,10 @@ enum {
326 NvRegMSIXMap0 = 0x3e0, 330 NvRegMSIXMap0 = 0x3e0,
327 NvRegMSIXMap1 = 0x3e4, 331 NvRegMSIXMap1 = 0x3e4,
328 NvRegMSIXIrqStatus = 0x3f0, 332 NvRegMSIXIrqStatus = 0x3f0,
333
334 NvRegPowerState2 = 0x600,
335#define NVREG_POWERSTATE2_POWERUP_MASK 0x0F11
336#define NVREG_POWERSTATE2_POWERUP_REV_A3 0x0001
329}; 337};
330 338
331/* Big endian: should work, but is untested */ 339/* Big endian: should work, but is untested */
@@ -414,7 +422,8 @@ typedef union _ring_type {
414#define NV_RX3_VLAN_TAG_MASK (0x0000FFFF) 422#define NV_RX3_VLAN_TAG_MASK (0x0000FFFF)
415 423
416/* Miscelaneous hardware related defines: */ 424/* Miscelaneous hardware related defines: */
417#define NV_PCI_REGSZ 0x270 425#define NV_PCI_REGSZ_VER1 0x270
426#define NV_PCI_REGSZ_VER2 0x604
418 427
419/* various timeout delays: all in usec */ 428/* various timeout delays: all in usec */
420#define NV_TXRX_RESET_DELAY 4 429#define NV_TXRX_RESET_DELAY 4
@@ -431,6 +440,7 @@ typedef union _ring_type {
431#define NV_MIIBUSY_DELAY 50 440#define NV_MIIBUSY_DELAY 50
432#define NV_MIIPHY_DELAY 10 441#define NV_MIIPHY_DELAY 10
433#define NV_MIIPHY_DELAYMAX 10000 442#define NV_MIIPHY_DELAYMAX 10000
443#define NV_MAC_RESET_DELAY 64
434 444
435#define NV_WAKEUPPATTERNS 5 445#define NV_WAKEUPPATTERNS 5
436#define NV_WAKEUPMASKENTRIES 4 446#define NV_WAKEUPMASKENTRIES 4
@@ -552,6 +562,8 @@ struct fe_priv {
552 u32 desc_ver; 562 u32 desc_ver;
553 u32 txrxctl_bits; 563 u32 txrxctl_bits;
554 u32 vlanctl_bits; 564 u32 vlanctl_bits;
565 u32 driver_data;
566 u32 register_size;
555 567
556 void __iomem *base; 568 void __iomem *base;
557 569
@@ -919,6 +931,24 @@ static void nv_txrx_reset(struct net_device *dev)
919 pci_push(base); 931 pci_push(base);
920} 932}
921 933
934static void nv_mac_reset(struct net_device *dev)
935{
936 struct fe_priv *np = netdev_priv(dev);
937 u8 __iomem *base = get_hwbase(dev);
938
939 dprintk(KERN_DEBUG "%s: nv_mac_reset\n", dev->name);
940 writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl);
941 pci_push(base);
942 writel(NVREG_MAC_RESET_ASSERT, base + NvRegMacReset);
943 pci_push(base);
944 udelay(NV_MAC_RESET_DELAY);
945 writel(0, base + NvRegMacReset);
946 pci_push(base);
947 udelay(NV_MAC_RESET_DELAY);
948 writel(NVREG_TXRXCTL_BIT2 | np->txrxctl_bits, base + NvRegTxRxControl);
949 pci_push(base);
950}
951
922/* 952/*
923 * nv_get_stats: dev->get_stats function 953 * nv_get_stats: dev->get_stats function
924 * Get latest stats value from the nic. 954 * Get latest stats value from the nic.
@@ -1331,7 +1361,7 @@ static void nv_tx_timeout(struct net_device *dev)
1331 dev->name, (unsigned long)np->ring_addr, 1361 dev->name, (unsigned long)np->ring_addr,
1332 np->next_tx, np->nic_tx); 1362 np->next_tx, np->nic_tx);
1333 printk(KERN_INFO "%s: Dumping tx registers\n", dev->name); 1363 printk(KERN_INFO "%s: Dumping tx registers\n", dev->name);
1334 for (i=0;i<0x400;i+= 32) { 1364 for (i=0;i<=np->register_size;i+= 32) {
1335 printk(KERN_INFO "%3x: %08x %08x %08x %08x %08x %08x %08x %08x\n", 1365 printk(KERN_INFO "%3x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
1336 i, 1366 i,
1337 readl(base + i + 0), readl(base + i + 4), 1367 readl(base + i + 0), readl(base + i + 4),
@@ -2488,11 +2518,11 @@ static int nv_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
2488} 2518}
2489 2519
2490#define FORCEDETH_REGS_VER 1 2520#define FORCEDETH_REGS_VER 1
2491#define FORCEDETH_REGS_SIZE 0x400 /* 256 32-bit registers */
2492 2521
2493static int nv_get_regs_len(struct net_device *dev) 2522static int nv_get_regs_len(struct net_device *dev)
2494{ 2523{
2495 return FORCEDETH_REGS_SIZE; 2524 struct fe_priv *np = netdev_priv(dev);
2525 return np->register_size;
2496} 2526}
2497 2527
2498static void nv_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *buf) 2528static void nv_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *buf)
@@ -2504,7 +2534,7 @@ static void nv_get_regs(struct net_device *dev, struct ethtool_regs *regs, void
2504 2534
2505 regs->version = FORCEDETH_REGS_VER; 2535 regs->version = FORCEDETH_REGS_VER;
2506 spin_lock_irq(&np->lock); 2536 spin_lock_irq(&np->lock);
2507 for (i=0;i<FORCEDETH_REGS_SIZE/sizeof(u32);i++) 2537 for (i = 0;i <= np->register_size/sizeof(u32); i++)
2508 rbuf[i] = readl(base + i*sizeof(u32)); 2538 rbuf[i] = readl(base + i*sizeof(u32));
2509 spin_unlock_irq(&np->lock); 2539 spin_unlock_irq(&np->lock);
2510} 2540}
@@ -2608,6 +2638,8 @@ static int nv_open(struct net_device *dev)
2608 dprintk(KERN_DEBUG "nv_open: begin\n"); 2638 dprintk(KERN_DEBUG "nv_open: begin\n");
2609 2639
2610 /* 1) erase previous misconfiguration */ 2640 /* 1) erase previous misconfiguration */
2641 if (np->driver_data & DEV_HAS_POWER_CNTRL)
2642 nv_mac_reset(dev);
2611 /* 4.1-1: stop adapter: ignored, 4.3 seems to be overkill */ 2643 /* 4.1-1: stop adapter: ignored, 4.3 seems to be overkill */
2612 writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA); 2644 writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA);
2613 writel(0, base + NvRegMulticastAddrB); 2645 writel(0, base + NvRegMulticastAddrB);
@@ -2878,6 +2910,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2878 unsigned long addr; 2910 unsigned long addr;
2879 u8 __iomem *base; 2911 u8 __iomem *base;
2880 int err, i; 2912 int err, i;
2913 u32 powerstate;
2881 2914
2882 dev = alloc_etherdev(sizeof(struct fe_priv)); 2915 dev = alloc_etherdev(sizeof(struct fe_priv));
2883 err = -ENOMEM; 2916 err = -ENOMEM;
@@ -2910,6 +2943,11 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2910 if (err < 0) 2943 if (err < 0)
2911 goto out_disable; 2944 goto out_disable;
2912 2945
2946 if (id->driver_data & (DEV_HAS_VLAN|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL))
2947 np->register_size = NV_PCI_REGSZ_VER2;
2948 else
2949 np->register_size = NV_PCI_REGSZ_VER1;
2950
2913 err = -EINVAL; 2951 err = -EINVAL;
2914 addr = 0; 2952 addr = 0;
2915 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { 2953 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
@@ -2918,7 +2956,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2918 pci_resource_len(pci_dev, i), 2956 pci_resource_len(pci_dev, i),
2919 pci_resource_flags(pci_dev, i)); 2957 pci_resource_flags(pci_dev, i));
2920 if (pci_resource_flags(pci_dev, i) & IORESOURCE_MEM && 2958 if (pci_resource_flags(pci_dev, i) & IORESOURCE_MEM &&
2921 pci_resource_len(pci_dev, i) >= NV_PCI_REGSZ) { 2959 pci_resource_len(pci_dev, i) >= np->register_size) {
2922 addr = pci_resource_start(pci_dev, i); 2960 addr = pci_resource_start(pci_dev, i);
2923 break; 2961 break;
2924 } 2962 }
@@ -2929,6 +2967,9 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2929 goto out_relreg; 2967 goto out_relreg;
2930 } 2968 }
2931 2969
2970 /* copy of driver data */
2971 np->driver_data = id->driver_data;
2972
2932 /* handle different descriptor versions */ 2973 /* handle different descriptor versions */
2933 if (id->driver_data & DEV_HAS_HIGH_DMA) { 2974 if (id->driver_data & DEV_HAS_HIGH_DMA) {
2934 /* packet format 3: supports 40-bit addressing */ 2975 /* packet format 3: supports 40-bit addressing */
@@ -2986,7 +3027,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2986 } 3027 }
2987 3028
2988 err = -ENOMEM; 3029 err = -ENOMEM;
2989 np->base = ioremap(addr, NV_PCI_REGSZ); 3030 np->base = ioremap(addr, np->register_size);
2990 if (!np->base) 3031 if (!np->base)
2991 goto out_relreg; 3032 goto out_relreg;
2992 dev->base_addr = (unsigned long)np->base; 3033 dev->base_addr = (unsigned long)np->base;
@@ -3062,6 +3103,20 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
3062 writel(0, base + NvRegWakeUpFlags); 3103 writel(0, base + NvRegWakeUpFlags);
3063 np->wolenabled = 0; 3104 np->wolenabled = 0;
3064 3105
3106 if (id->driver_data & DEV_HAS_POWER_CNTRL) {
3107 u8 revision_id;
3108 pci_read_config_byte(pci_dev, PCI_REVISION_ID, &revision_id);
3109
3110 /* take phy and nic out of low power mode */
3111 powerstate = readl(base + NvRegPowerState2);
3112 powerstate &= ~NVREG_POWERSTATE2_POWERUP_MASK;
3113 if ((id->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 ||
3114 id->device == PCI_DEVICE_ID_NVIDIA_NVENET_13) &&
3115 revision_id >= 0xA3)
3116 powerstate |= NVREG_POWERSTATE2_POWERUP_REV_A3;
3117 writel(powerstate, base + NvRegPowerState2);
3118 }
3119
3065 if (np->desc_ver == DESC_VER_1) { 3120 if (np->desc_ver == DESC_VER_1) {
3066 np->tx_flags = NV_TX_VALID; 3121 np->tx_flags = NV_TX_VALID;
3067 } else { 3122 } else {
@@ -3223,19 +3278,19 @@ static struct pci_device_id pci_tbl[] = {
3223 }, 3278 },
3224 { /* MCP51 Ethernet Controller */ 3279 { /* MCP51 Ethernet Controller */
3225 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_12), 3280 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_12),
3226 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA, 3281 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL,
3227 }, 3282 },
3228 { /* MCP51 Ethernet Controller */ 3283 { /* MCP51 Ethernet Controller */
3229 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_13), 3284 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_13),
3230 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA, 3285 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL,
3231 }, 3286 },
3232 { /* MCP55 Ethernet Controller */ 3287 { /* MCP55 Ethernet Controller */
3233 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_14), 3288 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_14),
3234 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X, 3289 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL,
3235 }, 3290 },
3236 { /* MCP55 Ethernet Controller */ 3291 { /* MCP55 Ethernet Controller */
3237 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_15), 3292 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_15),
3238 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X, 3293 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL,
3239 }, 3294 },
3240 {0,}, 3295 {0,},
3241}; 3296};
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 771e25d8c417..218d31764c52 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -210,7 +210,8 @@ static int gfar_probe(struct platform_device *pdev)
210 goto regs_fail; 210 goto regs_fail;
211 } 211 }
212 212
213 spin_lock_init(&priv->lock); 213 spin_lock_init(&priv->txlock);
214 spin_lock_init(&priv->rxlock);
214 215
215 platform_set_drvdata(pdev, dev); 216 platform_set_drvdata(pdev, dev);
216 217
@@ -515,11 +516,13 @@ void stop_gfar(struct net_device *dev)
515 phy_stop(priv->phydev); 516 phy_stop(priv->phydev);
516 517
517 /* Lock it down */ 518 /* Lock it down */
518 spin_lock_irqsave(&priv->lock, flags); 519 spin_lock_irqsave(&priv->txlock, flags);
520 spin_lock(&priv->rxlock);
519 521
520 gfar_halt(dev); 522 gfar_halt(dev);
521 523
522 spin_unlock_irqrestore(&priv->lock, flags); 524 spin_unlock(&priv->rxlock);
525 spin_unlock_irqrestore(&priv->txlock, flags);
523 526
524 /* Free the IRQs */ 527 /* Free the IRQs */
525 if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) { 528 if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) {
@@ -605,14 +608,15 @@ void gfar_start(struct net_device *dev)
605 tempval |= DMACTRL_INIT_SETTINGS; 608 tempval |= DMACTRL_INIT_SETTINGS;
606 gfar_write(&priv->regs->dmactrl, tempval); 609 gfar_write(&priv->regs->dmactrl, tempval);
607 610
608 /* Clear THLT, so that the DMA starts polling now */
609 gfar_write(&regs->tstat, TSTAT_CLEAR_THALT);
610
611 /* Make sure we aren't stopped */ 611 /* Make sure we aren't stopped */
612 tempval = gfar_read(&priv->regs->dmactrl); 612 tempval = gfar_read(&priv->regs->dmactrl);
613 tempval &= ~(DMACTRL_GRS | DMACTRL_GTS); 613 tempval &= ~(DMACTRL_GRS | DMACTRL_GTS);
614 gfar_write(&priv->regs->dmactrl, tempval); 614 gfar_write(&priv->regs->dmactrl, tempval);
615 615
616 /* Clear THLT/RHLT, so that the DMA starts polling now */
617 gfar_write(&regs->tstat, TSTAT_CLEAR_THALT);
618 gfar_write(&regs->rstat, RSTAT_CLEAR_RHALT);
619
616 /* Unmask the interrupts we look for */ 620 /* Unmask the interrupts we look for */
617 gfar_write(&regs->imask, IMASK_DEFAULT); 621 gfar_write(&regs->imask, IMASK_DEFAULT);
618} 622}
@@ -928,12 +932,13 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
928 struct txfcb *fcb = NULL; 932 struct txfcb *fcb = NULL;
929 struct txbd8 *txbdp; 933 struct txbd8 *txbdp;
930 u16 status; 934 u16 status;
935 unsigned long flags;
931 936
932 /* Update transmit stats */ 937 /* Update transmit stats */
933 priv->stats.tx_bytes += skb->len; 938 priv->stats.tx_bytes += skb->len;
934 939
935 /* Lock priv now */ 940 /* Lock priv now */
936 spin_lock_irq(&priv->lock); 941 spin_lock_irqsave(&priv->txlock, flags);
937 942
938 /* Point at the first free tx descriptor */ 943 /* Point at the first free tx descriptor */
939 txbdp = priv->cur_tx; 944 txbdp = priv->cur_tx;
@@ -1004,7 +1009,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
1004 gfar_write(&priv->regs->tstat, TSTAT_CLEAR_THALT); 1009 gfar_write(&priv->regs->tstat, TSTAT_CLEAR_THALT);
1005 1010
1006 /* Unlock priv */ 1011 /* Unlock priv */
1007 spin_unlock_irq(&priv->lock); 1012 spin_unlock_irqrestore(&priv->txlock, flags);
1008 1013
1009 return 0; 1014 return 0;
1010} 1015}
@@ -1049,7 +1054,7 @@ static void gfar_vlan_rx_register(struct net_device *dev,
1049 unsigned long flags; 1054 unsigned long flags;
1050 u32 tempval; 1055 u32 tempval;
1051 1056
1052 spin_lock_irqsave(&priv->lock, flags); 1057 spin_lock_irqsave(&priv->rxlock, flags);
1053 1058
1054 priv->vlgrp = grp; 1059 priv->vlgrp = grp;
1055 1060
@@ -1076,7 +1081,7 @@ static void gfar_vlan_rx_register(struct net_device *dev,
1076 gfar_write(&priv->regs->rctrl, tempval); 1081 gfar_write(&priv->regs->rctrl, tempval);
1077 } 1082 }
1078 1083
1079 spin_unlock_irqrestore(&priv->lock, flags); 1084 spin_unlock_irqrestore(&priv->rxlock, flags);
1080} 1085}
1081 1086
1082 1087
@@ -1085,12 +1090,12 @@ static void gfar_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid)
1085 struct gfar_private *priv = netdev_priv(dev); 1090 struct gfar_private *priv = netdev_priv(dev);
1086 unsigned long flags; 1091 unsigned long flags;
1087 1092
1088 spin_lock_irqsave(&priv->lock, flags); 1093 spin_lock_irqsave(&priv->rxlock, flags);
1089 1094
1090 if (priv->vlgrp) 1095 if (priv->vlgrp)
1091 priv->vlgrp->vlan_devices[vid] = NULL; 1096 priv->vlgrp->vlan_devices[vid] = NULL;
1092 1097
1093 spin_unlock_irqrestore(&priv->lock, flags); 1098 spin_unlock_irqrestore(&priv->rxlock, flags);
1094} 1099}
1095 1100
1096 1101
@@ -1179,7 +1184,7 @@ static irqreturn_t gfar_transmit(int irq, void *dev_id, struct pt_regs *regs)
1179 gfar_write(&priv->regs->ievent, IEVENT_TX_MASK); 1184 gfar_write(&priv->regs->ievent, IEVENT_TX_MASK);
1180 1185
1181 /* Lock priv */ 1186 /* Lock priv */
1182 spin_lock(&priv->lock); 1187 spin_lock(&priv->txlock);
1183 bdp = priv->dirty_tx; 1188 bdp = priv->dirty_tx;
1184 while ((bdp->status & TXBD_READY) == 0) { 1189 while ((bdp->status & TXBD_READY) == 0) {
1185 /* If dirty_tx and cur_tx are the same, then either the */ 1190 /* If dirty_tx and cur_tx are the same, then either the */
@@ -1224,7 +1229,7 @@ static irqreturn_t gfar_transmit(int irq, void *dev_id, struct pt_regs *regs)
1224 else 1229 else
1225 gfar_write(&priv->regs->txic, 0); 1230 gfar_write(&priv->regs->txic, 0);
1226 1231
1227 spin_unlock(&priv->lock); 1232 spin_unlock(&priv->txlock);
1228 1233
1229 return IRQ_HANDLED; 1234 return IRQ_HANDLED;
1230} 1235}
@@ -1305,9 +1310,10 @@ irqreturn_t gfar_receive(int irq, void *dev_id, struct pt_regs *regs)
1305{ 1310{
1306 struct net_device *dev = (struct net_device *) dev_id; 1311 struct net_device *dev = (struct net_device *) dev_id;
1307 struct gfar_private *priv = netdev_priv(dev); 1312 struct gfar_private *priv = netdev_priv(dev);
1308
1309#ifdef CONFIG_GFAR_NAPI 1313#ifdef CONFIG_GFAR_NAPI
1310 u32 tempval; 1314 u32 tempval;
1315#else
1316 unsigned long flags;
1311#endif 1317#endif
1312 1318
1313 /* Clear IEVENT, so rx interrupt isn't called again 1319 /* Clear IEVENT, so rx interrupt isn't called again
@@ -1330,7 +1336,7 @@ irqreturn_t gfar_receive(int irq, void *dev_id, struct pt_regs *regs)
1330 } 1336 }
1331#else 1337#else
1332 1338
1333 spin_lock(&priv->lock); 1339 spin_lock_irqsave(&priv->rxlock, flags);
1334 gfar_clean_rx_ring(dev, priv->rx_ring_size); 1340 gfar_clean_rx_ring(dev, priv->rx_ring_size);
1335 1341
1336 /* If we are coalescing interrupts, update the timer */ 1342 /* If we are coalescing interrupts, update the timer */
@@ -1341,7 +1347,7 @@ irqreturn_t gfar_receive(int irq, void *dev_id, struct pt_regs *regs)
1341 else 1347 else
1342 gfar_write(&priv->regs->rxic, 0); 1348 gfar_write(&priv->regs->rxic, 0);
1343 1349
1344 spin_unlock(&priv->lock); 1350 spin_unlock_irqrestore(&priv->rxlock, flags);
1345#endif 1351#endif
1346 1352
1347 return IRQ_HANDLED; 1353 return IRQ_HANDLED;
@@ -1490,13 +1496,6 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)
1490 /* Update the current rxbd pointer to be the next one */ 1496 /* Update the current rxbd pointer to be the next one */
1491 priv->cur_rx = bdp; 1497 priv->cur_rx = bdp;
1492 1498
1493 /* If no packets have arrived since the
1494 * last one we processed, clear the IEVENT RX and
1495 * BSY bits so that another interrupt won't be
1496 * generated when we set IMASK */
1497 if (bdp->status & RXBD_EMPTY)
1498 gfar_write(&priv->regs->ievent, IEVENT_RX_MASK);
1499
1500 return howmany; 1499 return howmany;
1501} 1500}
1502 1501
@@ -1516,7 +1515,7 @@ static int gfar_poll(struct net_device *dev, int *budget)
1516 rx_work_limit -= howmany; 1515 rx_work_limit -= howmany;
1517 *budget -= howmany; 1516 *budget -= howmany;
1518 1517
1519 if (rx_work_limit >= 0) { 1518 if (rx_work_limit > 0) {
1520 netif_rx_complete(dev); 1519 netif_rx_complete(dev);
1521 1520
1522 /* Clear the halt bit in RSTAT */ 1521 /* Clear the halt bit in RSTAT */
@@ -1533,7 +1532,8 @@ static int gfar_poll(struct net_device *dev, int *budget)
1533 gfar_write(&priv->regs->rxic, 0); 1532 gfar_write(&priv->regs->rxic, 0);
1534 } 1533 }
1535 1534
1536 return (rx_work_limit < 0) ? 1 : 0; 1535 /* Return 1 if there's more work to do */
1536 return (rx_work_limit > 0) ? 0 : 1;
1537} 1537}
1538#endif 1538#endif
1539 1539
@@ -1629,7 +1629,7 @@ static void adjust_link(struct net_device *dev)
1629 struct phy_device *phydev = priv->phydev; 1629 struct phy_device *phydev = priv->phydev;
1630 int new_state = 0; 1630 int new_state = 0;
1631 1631
1632 spin_lock_irqsave(&priv->lock, flags); 1632 spin_lock_irqsave(&priv->txlock, flags);
1633 if (phydev->link) { 1633 if (phydev->link) {
1634 u32 tempval = gfar_read(&regs->maccfg2); 1634 u32 tempval = gfar_read(&regs->maccfg2);
1635 u32 ecntrl = gfar_read(&regs->ecntrl); 1635 u32 ecntrl = gfar_read(&regs->ecntrl);
@@ -1694,7 +1694,7 @@ static void adjust_link(struct net_device *dev)
1694 if (new_state && netif_msg_link(priv)) 1694 if (new_state && netif_msg_link(priv))
1695 phy_print_status(phydev); 1695 phy_print_status(phydev);
1696 1696
1697 spin_unlock_irqrestore(&priv->lock, flags); 1697 spin_unlock_irqrestore(&priv->txlock, flags);
1698} 1698}
1699 1699
1700/* Update the hash table based on the current list of multicast 1700/* Update the hash table based on the current list of multicast
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index d37d5401be6e..127c98cf3336 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -656,43 +656,62 @@ struct gfar {
656 * the buffer descriptor determines the actual condition. 656 * the buffer descriptor determines the actual condition.
657 */ 657 */
658struct gfar_private { 658struct gfar_private {
659 /* pointers to arrays of skbuffs for tx and rx */ 659 /* Fields controlled by TX lock */
660 spinlock_t txlock;
661
662 /* Pointer to the array of skbuffs */
660 struct sk_buff ** tx_skbuff; 663 struct sk_buff ** tx_skbuff;
661 struct sk_buff ** rx_skbuff;
662 664
663 /* indices pointing to the next free sbk in skb arrays */ 665 /* next free skb in the array */
664 u16 skb_curtx; 666 u16 skb_curtx;
665 u16 skb_currx;
666 667
667 /* index of the first skb which hasn't been transmitted 668 /* First skb in line to be transmitted */
668 * yet. */
669 u16 skb_dirtytx; 669 u16 skb_dirtytx;
670 670
671 /* Configuration info for the coalescing features */ 671 /* Configuration info for the coalescing features */
672 unsigned char txcoalescing; 672 unsigned char txcoalescing;
673 unsigned short txcount; 673 unsigned short txcount;
674 unsigned short txtime; 674 unsigned short txtime;
675
676 /* Buffer descriptor pointers */
677 struct txbd8 *tx_bd_base; /* First tx buffer descriptor */
678 struct txbd8 *cur_tx; /* Next free ring entry */
679 struct txbd8 *dirty_tx; /* First buffer in line
680 to be transmitted */
681 unsigned int tx_ring_size;
682
683 /* RX Locked fields */
684 spinlock_t rxlock;
685
686 /* skb array and index */
687 struct sk_buff ** rx_skbuff;
688 u16 skb_currx;
689
690 /* RX Coalescing values */
675 unsigned char rxcoalescing; 691 unsigned char rxcoalescing;
676 unsigned short rxcount; 692 unsigned short rxcount;
677 unsigned short rxtime; 693 unsigned short rxtime;
678 694
679 /* GFAR addresses */ 695 struct rxbd8 *rx_bd_base; /* First Rx buffers */
680 struct rxbd8 *rx_bd_base; /* Base addresses of Rx and Tx Buffers */
681 struct txbd8 *tx_bd_base;
682 struct rxbd8 *cur_rx; /* Next free rx ring entry */ 696 struct rxbd8 *cur_rx; /* Next free rx ring entry */
683 struct txbd8 *cur_tx; /* Next free ring entry */ 697
684 struct txbd8 *dirty_tx; /* The Ring entry to be freed. */ 698 /* RX parameters */
685 struct gfar __iomem *regs; /* Pointer to the GFAR memory mapped Registers */ 699 unsigned int rx_ring_size;
686 u32 __iomem *hash_regs[16];
687 int hash_width;
688 struct net_device_stats stats; /* linux network statistics */
689 struct gfar_extra_stats extra_stats;
690 spinlock_t lock;
691 unsigned int rx_buffer_size; 700 unsigned int rx_buffer_size;
692 unsigned int rx_stash_size; 701 unsigned int rx_stash_size;
693 unsigned int rx_stash_index; 702 unsigned int rx_stash_index;
694 unsigned int tx_ring_size; 703
695 unsigned int rx_ring_size; 704 struct vlan_group *vlgrp;
705
706 /* Unprotected fields */
707 /* Pointer to the GFAR memory mapped Registers */
708 struct gfar __iomem *regs;
709
710 /* Hash registers and their width */
711 u32 __iomem *hash_regs[16];
712 int hash_width;
713
714 /* global parameters */
696 unsigned int fifo_threshold; 715 unsigned int fifo_threshold;
697 unsigned int fifo_starve; 716 unsigned int fifo_starve;
698 unsigned int fifo_starve_off; 717 unsigned int fifo_starve_off;
@@ -702,13 +721,15 @@ struct gfar_private {
702 extended_hash:1, 721 extended_hash:1,
703 bd_stash_en:1; 722 bd_stash_en:1;
704 unsigned short padding; 723 unsigned short padding;
705 struct vlan_group *vlgrp; 724
706 /* Info structure initialized by board setup code */
707 unsigned int interruptTransmit; 725 unsigned int interruptTransmit;
708 unsigned int interruptReceive; 726 unsigned int interruptReceive;
709 unsigned int interruptError; 727 unsigned int interruptError;
728
729 /* info structure initialized by platform code */
710 struct gianfar_platform_data *einfo; 730 struct gianfar_platform_data *einfo;
711 731
732 /* PHY stuff */
712 struct phy_device *phydev; 733 struct phy_device *phydev;
713 struct mii_bus *mii_bus; 734 struct mii_bus *mii_bus;
714 int oldspeed; 735 int oldspeed;
@@ -716,6 +737,10 @@ struct gfar_private {
716 int oldlink; 737 int oldlink;
717 738
718 uint32_t msg_enable; 739 uint32_t msg_enable;
740
741 /* Network Statistics */
742 struct net_device_stats stats;
743 struct gfar_extra_stats extra_stats;
719}; 744};
720 745
721static inline u32 gfar_read(volatile unsigned __iomem *addr) 746static inline u32 gfar_read(volatile unsigned __iomem *addr)
diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c
index 5de7b2e259dc..d69698c695ef 100644
--- a/drivers/net/gianfar_ethtool.c
+++ b/drivers/net/gianfar_ethtool.c
@@ -455,10 +455,14 @@ static int gfar_sringparam(struct net_device *dev, struct ethtool_ringparam *rva
455 455
456 /* Halt TX and RX, and process the frames which 456 /* Halt TX and RX, and process the frames which
457 * have already been received */ 457 * have already been received */
458 spin_lock_irqsave(&priv->lock, flags); 458 spin_lock_irqsave(&priv->txlock, flags);
459 spin_lock(&priv->rxlock);
460
459 gfar_halt(dev); 461 gfar_halt(dev);
460 gfar_clean_rx_ring(dev, priv->rx_ring_size); 462 gfar_clean_rx_ring(dev, priv->rx_ring_size);
461 spin_unlock_irqrestore(&priv->lock, flags); 463
464 spin_unlock(&priv->rxlock);
465 spin_unlock_irqrestore(&priv->txlock, flags);
462 466
463 /* Now we take down the rings to rebuild them */ 467 /* Now we take down the rings to rebuild them */
464 stop_gfar(dev); 468 stop_gfar(dev);
@@ -488,10 +492,14 @@ static int gfar_set_rx_csum(struct net_device *dev, uint32_t data)
488 492
489 /* Halt TX and RX, and process the frames which 493 /* Halt TX and RX, and process the frames which
490 * have already been received */ 494 * have already been received */
491 spin_lock_irqsave(&priv->lock, flags); 495 spin_lock_irqsave(&priv->txlock, flags);
496 spin_lock(&priv->rxlock);
497
492 gfar_halt(dev); 498 gfar_halt(dev);
493 gfar_clean_rx_ring(dev, priv->rx_ring_size); 499 gfar_clean_rx_ring(dev, priv->rx_ring_size);
494 spin_unlock_irqrestore(&priv->lock, flags); 500
501 spin_unlock(&priv->rxlock);
502 spin_unlock_irqrestore(&priv->txlock, flags);
495 503
496 /* Now we take down the rings to rebuild them */ 504 /* Now we take down the rings to rebuild them */
497 stop_gfar(dev); 505 stop_gfar(dev);
@@ -523,7 +531,7 @@ static int gfar_set_tx_csum(struct net_device *dev, uint32_t data)
523 if (!(priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_CSUM)) 531 if (!(priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_CSUM))
524 return -EOPNOTSUPP; 532 return -EOPNOTSUPP;
525 533
526 spin_lock_irqsave(&priv->lock, flags); 534 spin_lock_irqsave(&priv->txlock, flags);
527 gfar_halt(dev); 535 gfar_halt(dev);
528 536
529 if (data) 537 if (data)
@@ -532,7 +540,7 @@ static int gfar_set_tx_csum(struct net_device *dev, uint32_t data)
532 dev->features &= ~NETIF_F_IP_CSUM; 540 dev->features &= ~NETIF_F_IP_CSUM;
533 541
534 gfar_start(dev); 542 gfar_start(dev);
535 spin_unlock_irqrestore(&priv->lock, flags); 543 spin_unlock_irqrestore(&priv->txlock, flags);
536 544
537 return 0; 545 return 0;
538} 546}
diff --git a/drivers/net/gianfar_sysfs.c b/drivers/net/gianfar_sysfs.c
index 51ef181b1368..a6d5c43199cb 100644
--- a/drivers/net/gianfar_sysfs.c
+++ b/drivers/net/gianfar_sysfs.c
@@ -82,7 +82,7 @@ static ssize_t gfar_set_bd_stash(struct class_device *cdev,
82 else 82 else
83 return count; 83 return count;
84 84
85 spin_lock_irqsave(&priv->lock, flags); 85 spin_lock_irqsave(&priv->rxlock, flags);
86 86
87 /* Set the new stashing value */ 87 /* Set the new stashing value */
88 priv->bd_stash_en = new_setting; 88 priv->bd_stash_en = new_setting;
@@ -96,7 +96,7 @@ static ssize_t gfar_set_bd_stash(struct class_device *cdev,
96 96
97 gfar_write(&priv->regs->attr, temp); 97 gfar_write(&priv->regs->attr, temp);
98 98
99 spin_unlock_irqrestore(&priv->lock, flags); 99 spin_unlock_irqrestore(&priv->rxlock, flags);
100 100
101 return count; 101 return count;
102} 102}
@@ -118,7 +118,7 @@ static ssize_t gfar_set_rx_stash_size(struct class_device *cdev,
118 u32 temp; 118 u32 temp;
119 unsigned long flags; 119 unsigned long flags;
120 120
121 spin_lock_irqsave(&priv->lock, flags); 121 spin_lock_irqsave(&priv->rxlock, flags);
122 if (length > priv->rx_buffer_size) 122 if (length > priv->rx_buffer_size)
123 return count; 123 return count;
124 124
@@ -142,7 +142,7 @@ static ssize_t gfar_set_rx_stash_size(struct class_device *cdev,
142 142
143 gfar_write(&priv->regs->attr, temp); 143 gfar_write(&priv->regs->attr, temp);
144 144
145 spin_unlock_irqrestore(&priv->lock, flags); 145 spin_unlock_irqrestore(&priv->rxlock, flags);
146 146
147 return count; 147 return count;
148} 148}
@@ -166,7 +166,7 @@ static ssize_t gfar_set_rx_stash_index(struct class_device *cdev,
166 u32 temp; 166 u32 temp;
167 unsigned long flags; 167 unsigned long flags;
168 168
169 spin_lock_irqsave(&priv->lock, flags); 169 spin_lock_irqsave(&priv->rxlock, flags);
170 if (index > priv->rx_stash_size) 170 if (index > priv->rx_stash_size)
171 return count; 171 return count;
172 172
@@ -180,7 +180,7 @@ static ssize_t gfar_set_rx_stash_index(struct class_device *cdev,
180 temp |= ATTRELI_EI(index); 180 temp |= ATTRELI_EI(index);
181 gfar_write(&priv->regs->attreli, flags); 181 gfar_write(&priv->regs->attreli, flags);
182 182
183 spin_unlock_irqrestore(&priv->lock, flags); 183 spin_unlock_irqrestore(&priv->rxlock, flags);
184 184
185 return count; 185 return count;
186} 186}
@@ -205,7 +205,7 @@ static ssize_t gfar_set_fifo_threshold(struct class_device *cdev,
205 if (length > GFAR_MAX_FIFO_THRESHOLD) 205 if (length > GFAR_MAX_FIFO_THRESHOLD)
206 return count; 206 return count;
207 207
208 spin_lock_irqsave(&priv->lock, flags); 208 spin_lock_irqsave(&priv->txlock, flags);
209 209
210 priv->fifo_threshold = length; 210 priv->fifo_threshold = length;
211 211
@@ -214,7 +214,7 @@ static ssize_t gfar_set_fifo_threshold(struct class_device *cdev,
214 temp |= length; 214 temp |= length;
215 gfar_write(&priv->regs->fifo_tx_thr, temp); 215 gfar_write(&priv->regs->fifo_tx_thr, temp);
216 216
217 spin_unlock_irqrestore(&priv->lock, flags); 217 spin_unlock_irqrestore(&priv->txlock, flags);
218 218
219 return count; 219 return count;
220} 220}
@@ -240,7 +240,7 @@ static ssize_t gfar_set_fifo_starve(struct class_device *cdev,
240 if (num > GFAR_MAX_FIFO_STARVE) 240 if (num > GFAR_MAX_FIFO_STARVE)
241 return count; 241 return count;
242 242
243 spin_lock_irqsave(&priv->lock, flags); 243 spin_lock_irqsave(&priv->txlock, flags);
244 244
245 priv->fifo_starve = num; 245 priv->fifo_starve = num;
246 246
@@ -249,7 +249,7 @@ static ssize_t gfar_set_fifo_starve(struct class_device *cdev,
249 temp |= num; 249 temp |= num;
250 gfar_write(&priv->regs->fifo_tx_starve, temp); 250 gfar_write(&priv->regs->fifo_tx_starve, temp);
251 251
252 spin_unlock_irqrestore(&priv->lock, flags); 252 spin_unlock_irqrestore(&priv->txlock, flags);
253 253
254 return count; 254 return count;
255} 255}
@@ -274,7 +274,7 @@ static ssize_t gfar_set_fifo_starve_off(struct class_device *cdev,
274 if (num > GFAR_MAX_FIFO_STARVE_OFF) 274 if (num > GFAR_MAX_FIFO_STARVE_OFF)
275 return count; 275 return count;
276 276
277 spin_lock_irqsave(&priv->lock, flags); 277 spin_lock_irqsave(&priv->txlock, flags);
278 278
279 priv->fifo_starve_off = num; 279 priv->fifo_starve_off = num;
280 280
@@ -283,7 +283,7 @@ static ssize_t gfar_set_fifo_starve_off(struct class_device *cdev,
283 temp |= num; 283 temp |= num;
284 gfar_write(&priv->regs->fifo_tx_starve_shutoff, temp); 284 gfar_write(&priv->regs->fifo_tx_starve_shutoff, temp);
285 285
286 spin_unlock_irqrestore(&priv->lock, flags); 286 spin_unlock_irqrestore(&priv->txlock, flags);
287 287
288 return count; 288 return count;
289} 289}
diff --git a/drivers/net/ne.c b/drivers/net/ne.c
index 08b218c5bfbc..93c494bcd18d 100644
--- a/drivers/net/ne.c
+++ b/drivers/net/ne.c
@@ -226,7 +226,7 @@ struct net_device * __init ne_probe(int unit)
226 netdev_boot_setup_check(dev); 226 netdev_boot_setup_check(dev);
227 227
228#ifdef CONFIG_TOSHIBA_RBTX4938 228#ifdef CONFIG_TOSHIBA_RBTX4938
229 dev->base_addr = 0x07f20280; 229 dev->base_addr = RBTX4938_RTL_8019_BASE;
230 dev->irq = RBTX4938_RTL_8019_IRQ; 230 dev->irq = RBTX4938_RTL_8019_IRQ;
231#endif 231#endif
232 err = do_ne_probe(dev); 232 err = do_ne_probe(dev);
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 506e777c5f06..d090df413049 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -1639,6 +1639,7 @@ static struct pcmcia_device_id pcnet_ids[] = {
1639 PCMCIA_DEVICE_PROD_ID12("CONTEC", "C-NET(PC)C-10L", 0x21cab552, 0xf6f90722), 1639 PCMCIA_DEVICE_PROD_ID12("CONTEC", "C-NET(PC)C-10L", 0x21cab552, 0xf6f90722),
1640 PCMCIA_DEVICE_PROD_ID12("corega", "FEther PCC-TXF", 0x0a21501a, 0xa51564a2), 1640 PCMCIA_DEVICE_PROD_ID12("corega", "FEther PCC-TXF", 0x0a21501a, 0xa51564a2),
1641 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-T", 0x5261440f, 0xfa9d85bd), 1641 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-T", 0x5261440f, 0xfa9d85bd),
1642 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-TD", 0x5261440f, 0xc49bd73d),
1642 PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d), 1643 PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d),
1643 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-T", 0x5261440f, 0x6705fcaa), 1644 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-T", 0x5261440f, 0x6705fcaa),
1644 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9), 1645 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9),
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 67b0eab16589..227df9876a2c 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -51,7 +51,7 @@
51#include "sky2.h" 51#include "sky2.h"
52 52
53#define DRV_NAME "sky2" 53#define DRV_NAME "sky2"
54#define DRV_VERSION "1.1" 54#define DRV_VERSION "1.2"
55#define PFX DRV_NAME " " 55#define PFX DRV_NAME " "
56 56
57/* 57/*
@@ -925,8 +925,7 @@ static inline struct sk_buff *sky2_alloc_skb(unsigned int size, gfp_t gfp_mask)
925 skb = alloc_skb(size + RX_SKB_ALIGN, gfp_mask); 925 skb = alloc_skb(size + RX_SKB_ALIGN, gfp_mask);
926 if (likely(skb)) { 926 if (likely(skb)) {
927 unsigned long p = (unsigned long) skb->data; 927 unsigned long p = (unsigned long) skb->data;
928 skb_reserve(skb, 928 skb_reserve(skb, ALIGN(p, RX_SKB_ALIGN) - p);
929 ((p + RX_SKB_ALIGN - 1) & ~(RX_SKB_ALIGN - 1)) - p);
930 } 929 }
931 930
932 return skb; 931 return skb;
@@ -1686,13 +1685,12 @@ static void sky2_tx_timeout(struct net_device *dev)
1686} 1685}
1687 1686
1688 1687
1689#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
1690/* Want receive buffer size to be multiple of 64 bits 1688/* Want receive buffer size to be multiple of 64 bits
1691 * and incl room for vlan and truncation 1689 * and incl room for vlan and truncation
1692 */ 1690 */
1693static inline unsigned sky2_buf_size(int mtu) 1691static inline unsigned sky2_buf_size(int mtu)
1694{ 1692{
1695 return roundup(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8; 1693 return ALIGN(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8;
1696} 1694}
1697 1695
1698static int sky2_change_mtu(struct net_device *dev, int new_mtu) 1696static int sky2_change_mtu(struct net_device *dev, int new_mtu)
@@ -2086,6 +2084,20 @@ static void sky2_descriptor_error(struct sky2_hw *hw, unsigned port,
2086 } 2084 }
2087} 2085}
2088 2086
2087/* If idle then force a fake soft NAPI poll once a second
2088 * to work around cases where sharing an edge triggered interrupt.
2089 */
2090static void sky2_idle(unsigned long arg)
2091{
2092 struct net_device *dev = (struct net_device *) arg;
2093
2094 local_irq_disable();
2095 if (__netif_rx_schedule_prep(dev))
2096 __netif_rx_schedule(dev);
2097 local_irq_enable();
2098}
2099
2100
2089static int sky2_poll(struct net_device *dev0, int *budget) 2101static int sky2_poll(struct net_device *dev0, int *budget)
2090{ 2102{
2091 struct sky2_hw *hw = ((struct sky2_port *) netdev_priv(dev0))->hw; 2103 struct sky2_hw *hw = ((struct sky2_port *) netdev_priv(dev0))->hw;
@@ -2093,6 +2105,7 @@ static int sky2_poll(struct net_device *dev0, int *budget)
2093 int work_done = 0; 2105 int work_done = 0;
2094 u32 status = sky2_read32(hw, B0_Y2_SP_EISR); 2106 u32 status = sky2_read32(hw, B0_Y2_SP_EISR);
2095 2107
2108 restart_poll:
2096 if (unlikely(status & ~Y2_IS_STAT_BMU)) { 2109 if (unlikely(status & ~Y2_IS_STAT_BMU)) {
2097 if (status & Y2_IS_HW_ERR) 2110 if (status & Y2_IS_HW_ERR)
2098 sky2_hw_intr(hw); 2111 sky2_hw_intr(hw);
@@ -2123,7 +2136,7 @@ static int sky2_poll(struct net_device *dev0, int *budget)
2123 } 2136 }
2124 2137
2125 if (status & Y2_IS_STAT_BMU) { 2138 if (status & Y2_IS_STAT_BMU) {
2126 work_done = sky2_status_intr(hw, work_limit); 2139 work_done += sky2_status_intr(hw, work_limit - work_done);
2127 *budget -= work_done; 2140 *budget -= work_done;
2128 dev0->quota -= work_done; 2141 dev0->quota -= work_done;
2129 2142
@@ -2133,9 +2146,24 @@ static int sky2_poll(struct net_device *dev0, int *budget)
2133 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ); 2146 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
2134 } 2147 }
2135 2148
2136 netif_rx_complete(dev0); 2149 mod_timer(&hw->idle_timer, jiffies + HZ);
2150
2151 local_irq_disable();
2152 __netif_rx_complete(dev0);
2137 2153
2138 status = sky2_read32(hw, B0_Y2_SP_LISR); 2154 status = sky2_read32(hw, B0_Y2_SP_LISR);
2155
2156 if (unlikely(status)) {
2157 /* More work pending, try and keep going */
2158 if (__netif_rx_schedule_prep(dev0)) {
2159 __netif_rx_reschedule(dev0, work_done);
2160 status = sky2_read32(hw, B0_Y2_SP_EISR);
2161 local_irq_enable();
2162 goto restart_poll;
2163 }
2164 }
2165
2166 local_irq_enable();
2139 return 0; 2167 return 0;
2140} 2168}
2141 2169
@@ -2153,8 +2181,6 @@ static irqreturn_t sky2_intr(int irq, void *dev_id, struct pt_regs *regs)
2153 prefetch(&hw->st_le[hw->st_idx]); 2181 prefetch(&hw->st_le[hw->st_idx]);
2154 if (likely(__netif_rx_schedule_prep(dev0))) 2182 if (likely(__netif_rx_schedule_prep(dev0)))
2155 __netif_rx_schedule(dev0); 2183 __netif_rx_schedule(dev0);
2156 else
2157 printk(KERN_DEBUG PFX "irq race detected\n");
2158 2184
2159 return IRQ_HANDLED; 2185 return IRQ_HANDLED;
2160} 2186}
@@ -2193,7 +2219,7 @@ static inline u32 sky2_clk2us(const struct sky2_hw *hw, u32 clk)
2193} 2219}
2194 2220
2195 2221
2196static int sky2_reset(struct sky2_hw *hw) 2222static int __devinit sky2_reset(struct sky2_hw *hw)
2197{ 2223{
2198 u16 status; 2224 u16 status;
2199 u8 t8, pmd_type; 2225 u8 t8, pmd_type;
@@ -3276,6 +3302,8 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
3276 3302
3277 sky2_write32(hw, B0_IMSK, Y2_IS_BASE); 3303 sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
3278 3304
3305 setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) dev);
3306
3279 pci_set_drvdata(pdev, hw); 3307 pci_set_drvdata(pdev, hw);
3280 3308
3281 return 0; 3309 return 0;
@@ -3311,13 +3339,15 @@ static void __devexit sky2_remove(struct pci_dev *pdev)
3311 if (!hw) 3339 if (!hw)
3312 return; 3340 return;
3313 3341
3342 del_timer_sync(&hw->idle_timer);
3343
3344 sky2_write32(hw, B0_IMSK, 0);
3314 dev0 = hw->dev[0]; 3345 dev0 = hw->dev[0];
3315 dev1 = hw->dev[1]; 3346 dev1 = hw->dev[1];
3316 if (dev1) 3347 if (dev1)
3317 unregister_netdev(dev1); 3348 unregister_netdev(dev1);
3318 unregister_netdev(dev0); 3349 unregister_netdev(dev0);
3319 3350
3320 sky2_write32(hw, B0_IMSK, 0);
3321 sky2_set_power_state(hw, PCI_D3hot); 3351 sky2_set_power_state(hw, PCI_D3hot);
3322 sky2_write16(hw, B0_Y2LED, LED_STAT_OFF); 3352 sky2_write16(hw, B0_Y2LED, LED_STAT_OFF);
3323 sky2_write8(hw, B0_CTST, CS_RST_SET); 3353 sky2_write8(hw, B0_CTST, CS_RST_SET);
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 89dd18cd12f0..b026f5653f04 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -1880,6 +1880,8 @@ struct sky2_hw {
1880 struct sky2_status_le *st_le; 1880 struct sky2_status_le *st_le;
1881 u32 st_idx; 1881 u32 st_idx;
1882 dma_addr_t st_dma; 1882 dma_addr_t st_dma;
1883
1884 struct timer_list idle_timer;
1883 int msi_detected; 1885 int msi_detected;
1884 wait_queue_head_t msi_wait; 1886 wait_queue_head_t msi_wait;
1885}; 1887};
diff --git a/drivers/net/sungem_phy.c b/drivers/net/sungem_phy.c
index cb0aba95d4e3..046371ee5bbe 100644
--- a/drivers/net/sungem_phy.c
+++ b/drivers/net/sungem_phy.c
@@ -275,7 +275,7 @@ static int bcm5411_init(struct mii_phy* phy)
275 return 0; 275 return 0;
276} 276}
277 277
278static int bcm5411_suspend(struct mii_phy* phy) 278static int generic_suspend(struct mii_phy* phy)
279{ 279{
280 phy_write(phy, MII_BMCR, BMCR_PDOWN); 280 phy_write(phy, MII_BMCR, BMCR_PDOWN);
281 281
@@ -738,7 +738,7 @@ static struct mii_phy_def bcm5401_phy_def = {
738/* Broadcom BCM 5411 */ 738/* Broadcom BCM 5411 */
739static struct mii_phy_ops bcm5411_phy_ops = { 739static struct mii_phy_ops bcm5411_phy_ops = {
740 .init = bcm5411_init, 740 .init = bcm5411_init,
741 .suspend = bcm5411_suspend, 741 .suspend = generic_suspend,
742 .setup_aneg = bcm54xx_setup_aneg, 742 .setup_aneg = bcm54xx_setup_aneg,
743 .setup_forced = bcm54xx_setup_forced, 743 .setup_forced = bcm54xx_setup_forced,
744 .poll_link = genmii_poll_link, 744 .poll_link = genmii_poll_link,
@@ -757,7 +757,7 @@ static struct mii_phy_def bcm5411_phy_def = {
757/* Broadcom BCM 5421 */ 757/* Broadcom BCM 5421 */
758static struct mii_phy_ops bcm5421_phy_ops = { 758static struct mii_phy_ops bcm5421_phy_ops = {
759 .init = bcm5421_init, 759 .init = bcm5421_init,
760 .suspend = bcm5411_suspend, 760 .suspend = generic_suspend,
761 .setup_aneg = bcm54xx_setup_aneg, 761 .setup_aneg = bcm54xx_setup_aneg,
762 .setup_forced = bcm54xx_setup_forced, 762 .setup_forced = bcm54xx_setup_forced,
763 .poll_link = genmii_poll_link, 763 .poll_link = genmii_poll_link,
@@ -776,7 +776,7 @@ static struct mii_phy_def bcm5421_phy_def = {
776/* Broadcom BCM 5421 built-in K2 */ 776/* Broadcom BCM 5421 built-in K2 */
777static struct mii_phy_ops bcm5421k2_phy_ops = { 777static struct mii_phy_ops bcm5421k2_phy_ops = {
778 .init = bcm5421_init, 778 .init = bcm5421_init,
779 .suspend = bcm5411_suspend, 779 .suspend = generic_suspend,
780 .setup_aneg = bcm54xx_setup_aneg, 780 .setup_aneg = bcm54xx_setup_aneg,
781 .setup_forced = bcm54xx_setup_forced, 781 .setup_forced = bcm54xx_setup_forced,
782 .poll_link = genmii_poll_link, 782 .poll_link = genmii_poll_link,
@@ -795,7 +795,7 @@ static struct mii_phy_def bcm5421k2_phy_def = {
795/* Broadcom BCM 5462 built-in Vesta */ 795/* Broadcom BCM 5462 built-in Vesta */
796static struct mii_phy_ops bcm5462V_phy_ops = { 796static struct mii_phy_ops bcm5462V_phy_ops = {
797 .init = bcm5421_init, 797 .init = bcm5421_init,
798 .suspend = bcm5411_suspend, 798 .suspend = generic_suspend,
799 .setup_aneg = bcm54xx_setup_aneg, 799 .setup_aneg = bcm54xx_setup_aneg,
800 .setup_forced = bcm54xx_setup_forced, 800 .setup_forced = bcm54xx_setup_forced,
801 .poll_link = genmii_poll_link, 801 .poll_link = genmii_poll_link,
@@ -816,6 +816,7 @@ static struct mii_phy_def bcm5462V_phy_def = {
816 * would be useful here) --BenH. 816 * would be useful here) --BenH.
817 */ 817 */
818static struct mii_phy_ops marvell_phy_ops = { 818static struct mii_phy_ops marvell_phy_ops = {
819 .suspend = generic_suspend,
819 .setup_aneg = marvell_setup_aneg, 820 .setup_aneg = marvell_setup_aneg,
820 .setup_forced = marvell_setup_forced, 821 .setup_forced = marvell_setup_forced,
821 .poll_link = genmii_poll_link, 822 .poll_link = genmii_poll_link,
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index bad09ebdb50b..e0874cbfefea 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -6,7 +6,7 @@ menu "Wireless LAN (non-hamradio)"
6 depends on NETDEVICES 6 depends on NETDEVICES
7 7
8config NET_RADIO 8config NET_RADIO
9 bool "Wireless LAN drivers (non-hamradio)" 9 bool "Wireless LAN drivers (non-hamradio) & Wireless Extensions"
10 select WIRELESS_EXT 10 select WIRELESS_EXT
11 ---help--- 11 ---help---
12 Support for wireless LANs and everything having to do with radio, 12 Support for wireless LANs and everything having to do with radio,
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 108d9fed8f07..00764ddd74d8 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -3139,6 +3139,7 @@ static irqreturn_t airo_interrupt ( int irq, void* dev_id, struct pt_regs *regs)
3139 } 3139 }
3140 if ( status & EV_LINK ) { 3140 if ( status & EV_LINK ) {
3141 union iwreq_data wrqu; 3141 union iwreq_data wrqu;
3142 int scan_forceloss = 0;
3142 /* The link status has changed, if you want to put a 3143 /* The link status has changed, if you want to put a
3143 monitor hook in, do it here. (Remember that 3144 monitor hook in, do it here. (Remember that
3144 interrupts are still disabled!) 3145 interrupts are still disabled!)
@@ -3157,7 +3158,8 @@ static irqreturn_t airo_interrupt ( int irq, void* dev_id, struct pt_regs *regs)
3157 code) */ 3158 code) */
3158#define AUTHFAIL 0x0300 /* Authentication failure (low byte is reason 3159#define AUTHFAIL 0x0300 /* Authentication failure (low byte is reason
3159 code) */ 3160 code) */
3160#define ASSOCIATED 0x0400 /* Assocatied */ 3161#define ASSOCIATED 0x0400 /* Associated */
3162#define REASSOCIATED 0x0600 /* Reassociated? Only on firmware >= 5.30.17 */
3161#define RC_RESERVED 0 /* Reserved return code */ 3163#define RC_RESERVED 0 /* Reserved return code */
3162#define RC_NOREASON 1 /* Unspecified reason */ 3164#define RC_NOREASON 1 /* Unspecified reason */
3163#define RC_AUTHINV 2 /* Previous authentication invalid */ 3165#define RC_AUTHINV 2 /* Previous authentication invalid */
@@ -3174,44 +3176,30 @@ static irqreturn_t airo_interrupt ( int irq, void* dev_id, struct pt_regs *regs)
3174 leaving BSS */ 3176 leaving BSS */
3175#define RC_NOAUTH 9 /* Station requesting (Re)Association is not 3177#define RC_NOAUTH 9 /* Station requesting (Re)Association is not
3176 Authenticated with the responding station */ 3178 Authenticated with the responding station */
3177 if (newStatus != ASSOCIATED) { 3179 if (newStatus == FORCELOSS && apriv->scan_timeout > 0)
3178 if (auto_wep && !apriv->expires) { 3180 scan_forceloss = 1;
3179 apriv->expires = RUN_AT(3*HZ); 3181 if(newStatus == ASSOCIATED || newStatus == REASSOCIATED) {
3180 wake_up_interruptible(&apriv->thr_wait);
3181 }
3182 } else {
3183 struct task_struct *task = apriv->task;
3184 if (auto_wep) 3182 if (auto_wep)
3185 apriv->expires = 0; 3183 apriv->expires = 0;
3186 if (task) 3184 if (apriv->task)
3187 wake_up_process (task); 3185 wake_up_process (apriv->task);
3188 set_bit(FLAG_UPDATE_UNI, &apriv->flags); 3186 set_bit(FLAG_UPDATE_UNI, &apriv->flags);
3189 set_bit(FLAG_UPDATE_MULTI, &apriv->flags); 3187 set_bit(FLAG_UPDATE_MULTI, &apriv->flags);
3190 } 3188
3191 /* Question : is ASSOCIATED the only status
3192 * that is valid ? We want to catch handover
3193 * and reassociations as valid status
3194 * Jean II */
3195 if(newStatus == ASSOCIATED) {
3196#if 0
3197 /* FIXME: Grabbing scan results here
3198 * seems to be too early??? Just wait for
3199 * timeout instead. */
3200 if (apriv->scan_timeout > 0) {
3201 set_bit(JOB_SCAN_RESULTS, &apriv->flags);
3202 wake_up_interruptible(&apriv->thr_wait);
3203 }
3204#endif
3205 if (down_trylock(&apriv->sem) != 0) { 3189 if (down_trylock(&apriv->sem) != 0) {
3206 set_bit(JOB_EVENT, &apriv->flags); 3190 set_bit(JOB_EVENT, &apriv->flags);
3207 wake_up_interruptible(&apriv->thr_wait); 3191 wake_up_interruptible(&apriv->thr_wait);
3208 } else 3192 } else
3209 airo_send_event(dev); 3193 airo_send_event(dev);
3210 } else { 3194 } else if (!scan_forceloss) {
3211 memset(wrqu.ap_addr.sa_data, '\0', ETH_ALEN); 3195 if (auto_wep && !apriv->expires) {
3212 wrqu.ap_addr.sa_family = ARPHRD_ETHER; 3196 apriv->expires = RUN_AT(3*HZ);
3197 wake_up_interruptible(&apriv->thr_wait);
3198 }
3213 3199
3214 /* Send event to user space */ 3200 /* Send event to user space */
3201 memset(wrqu.ap_addr.sa_data, '\0', ETH_ALEN);
3202 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
3215 wireless_send_event(dev, SIOCGIWAP, &wrqu,NULL); 3203 wireless_send_event(dev, SIOCGIWAP, &wrqu,NULL);
3216 } 3204 }
3217 } 3205 }
@@ -7136,10 +7124,10 @@ static int airo_set_scan(struct net_device *dev,
7136 goto out; 7124 goto out;
7137 7125
7138 /* Initiate a scan command */ 7126 /* Initiate a scan command */
7127 ai->scan_timeout = RUN_AT(3*HZ);
7139 memset(&cmd, 0, sizeof(cmd)); 7128 memset(&cmd, 0, sizeof(cmd));
7140 cmd.cmd=CMD_LISTBSS; 7129 cmd.cmd=CMD_LISTBSS;
7141 issuecommand(ai, &cmd, &rsp); 7130 issuecommand(ai, &cmd, &rsp);
7142 ai->scan_timeout = RUN_AT(3*HZ);
7143 wake = 1; 7131 wake = 1;
7144 7132
7145out: 7133out:
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index 87afa6878f26..8606c88886fc 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -3463,6 +3463,7 @@ static void atmel_command_irq(struct atmel_private *priv)
3463 u8 status = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_STATUS_OFFSET)); 3463 u8 status = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_STATUS_OFFSET));
3464 u8 command = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_COMMAND_OFFSET)); 3464 u8 command = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_COMMAND_OFFSET));
3465 int fast_scan; 3465 int fast_scan;
3466 union iwreq_data wrqu;
3466 3467
3467 if (status == CMD_STATUS_IDLE || 3468 if (status == CMD_STATUS_IDLE ||
3468 status == CMD_STATUS_IN_PROGRESS) 3469 status == CMD_STATUS_IN_PROGRESS)
@@ -3487,6 +3488,7 @@ static void atmel_command_irq(struct atmel_private *priv)
3487 atmel_scan(priv, 1); 3488 atmel_scan(priv, 1);
3488 } else { 3489 } else {
3489 int bss_index = retrieve_bss(priv); 3490 int bss_index = retrieve_bss(priv);
3491 int notify_scan_complete = 1;
3490 if (bss_index != -1) { 3492 if (bss_index != -1) {
3491 atmel_join_bss(priv, bss_index); 3493 atmel_join_bss(priv, bss_index);
3492 } else if (priv->operating_mode == IW_MODE_ADHOC && 3494 } else if (priv->operating_mode == IW_MODE_ADHOC &&
@@ -3495,8 +3497,14 @@ static void atmel_command_irq(struct atmel_private *priv)
3495 } else { 3497 } else {
3496 priv->fast_scan = !fast_scan; 3498 priv->fast_scan = !fast_scan;
3497 atmel_scan(priv, 1); 3499 atmel_scan(priv, 1);
3500 notify_scan_complete = 0;
3498 } 3501 }
3499 priv->site_survey_state = SITE_SURVEY_COMPLETED; 3502 priv->site_survey_state = SITE_SURVEY_COMPLETED;
3503 if (notify_scan_complete) {
3504 wrqu.data.length = 0;
3505 wrqu.data.flags = 0;
3506 wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL);
3507 }
3500 } 3508 }
3501 break; 3509 break;
3502 3510
@@ -3509,6 +3517,9 @@ static void atmel_command_irq(struct atmel_private *priv)
3509 priv->site_survey_state = SITE_SURVEY_COMPLETED; 3517 priv->site_survey_state = SITE_SURVEY_COMPLETED;
3510 if (priv->station_is_associated) { 3518 if (priv->station_is_associated) {
3511 atmel_enter_state(priv, STATION_STATE_READY); 3519 atmel_enter_state(priv, STATION_STATE_READY);
3520 wrqu.data.length = 0;
3521 wrqu.data.flags = 0;
3522 wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL);
3512 } else { 3523 } else {
3513 atmel_scan(priv, 1); 3524 atmel_scan(priv, 1);
3514 } 3525 }
diff --git a/drivers/net/wireless/bcm43xx/Kconfig b/drivers/net/wireless/bcm43xx/Kconfig
index 418465600a77..25ea4748f0b9 100644
--- a/drivers/net/wireless/bcm43xx/Kconfig
+++ b/drivers/net/wireless/bcm43xx/Kconfig
@@ -17,8 +17,11 @@ config BCM43XX_DEBUG
17 17
18config BCM43XX_DMA 18config BCM43XX_DMA
19 bool 19 bool
20 depends on BCM43XX
21
20config BCM43XX_PIO 22config BCM43XX_PIO
21 bool 23 bool
24 depends on BCM43XX
22 25
23choice 26choice
24 prompt "BCM43xx data transfer mode" 27 prompt "BCM43xx data transfer mode"
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx.h b/drivers/net/wireless/bcm43xx/bcm43xx.h
index dcadd295de4f..2e83083935e1 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx.h
@@ -15,7 +15,6 @@
15 15
16#include "bcm43xx_debugfs.h" 16#include "bcm43xx_debugfs.h"
17#include "bcm43xx_leds.h" 17#include "bcm43xx_leds.h"
18#include "bcm43xx_sysfs.h"
19 18
20 19
21#define PFX KBUILD_MODNAME ": " 20#define PFX KBUILD_MODNAME ": "
@@ -638,8 +637,6 @@ struct bcm43xx_key {
638}; 637};
639 638
640struct bcm43xx_private { 639struct bcm43xx_private {
641 struct bcm43xx_sysfs sysfs;
642
643 struct ieee80211_device *ieee; 640 struct ieee80211_device *ieee;
644 struct ieee80211softmac_device *softmac; 641 struct ieee80211softmac_device *softmac;
645 642
@@ -772,6 +769,20 @@ struct bcm43xx_private * bcm43xx_priv(struct net_device *dev)
772 return ieee80211softmac_priv(dev); 769 return ieee80211softmac_priv(dev);
773} 770}
774 771
772struct device;
773
774static inline
775struct bcm43xx_private * dev_to_bcm(struct device *dev)
776{
777 struct net_device *net_dev;
778 struct bcm43xx_private *bcm;
779
780 net_dev = dev_get_drvdata(dev);
781 bcm = bcm43xx_priv(net_dev);
782
783 return bcm;
784}
785
775 786
776/* Helper function, which returns a boolean. 787/* Helper function, which returns a boolean.
777 * TRUE, if PIO is used; FALSE, if DMA is used. 788 * TRUE, if PIO is used; FALSE, if DMA is used.
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c b/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
index d2c3401e9b70..35a4fcb6d923 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
@@ -452,12 +452,12 @@ void bcm43xx_printk_dump(const char *data,
452 size_t i; 452 size_t i;
453 char c; 453 char c;
454 454
455 printk(KERN_INFO PFX "Data dump (%s, %u bytes):", 455 printk(KERN_INFO PFX "Data dump (%s, %zd bytes):",
456 description, size); 456 description, size);
457 for (i = 0; i < size; i++) { 457 for (i = 0; i < size; i++) {
458 c = data[i]; 458 c = data[i];
459 if (i % 8 == 0) 459 if (i % 8 == 0)
460 printk("\n" KERN_INFO PFX "0x%08x: 0x%02x, ", i, c & 0xff); 460 printk("\n" KERN_INFO PFX "0x%08zx: 0x%02x, ", i, c & 0xff);
461 else 461 else
462 printk("0x%02x, ", c & 0xff); 462 printk("0x%02x, ", c & 0xff);
463 } 463 }
@@ -472,12 +472,12 @@ void bcm43xx_printk_bitdump(const unsigned char *data,
472 int j; 472 int j;
473 const unsigned char *d; 473 const unsigned char *d;
474 474
475 printk(KERN_INFO PFX "*** Bitdump (%s, %u bytes, %s) ***", 475 printk(KERN_INFO PFX "*** Bitdump (%s, %zd bytes, %s) ***",
476 description, bytes, msb_to_lsb ? "MSB to LSB" : "LSB to MSB"); 476 description, bytes, msb_to_lsb ? "MSB to LSB" : "LSB to MSB");
477 for (i = 0; i < bytes; i++) { 477 for (i = 0; i < bytes; i++) {
478 d = data + i; 478 d = data + i;
479 if (i % 8 == 0) 479 if (i % 8 == 0)
480 printk("\n" KERN_INFO PFX "0x%08x: ", i); 480 printk("\n" KERN_INFO PFX "0x%08zx: ", i);
481 if (msb_to_lsb) { 481 if (msb_to_lsb) {
482 for (j = 7; j >= 0; j--) { 482 for (j = 7; j >= 0; j--) {
483 if (*d & (1 << j)) 483 if (*d & (1 << j))
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
index c3681b8f09b4..bbecba02e697 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
@@ -196,8 +196,9 @@ static int alloc_ringmemory(struct bcm43xx_dmaring *ring)
196 } 196 }
197 if (ring->dmabase + BCM43xx_DMA_RINGMEMSIZE > BCM43xx_DMA_BUSADDRMAX) { 197 if (ring->dmabase + BCM43xx_DMA_RINGMEMSIZE > BCM43xx_DMA_BUSADDRMAX) {
198 printk(KERN_ERR PFX ">>>FATAL ERROR<<< DMA RINGMEMORY >1G " 198 printk(KERN_ERR PFX ">>>FATAL ERROR<<< DMA RINGMEMORY >1G "
199 "(0x%08x, len: %lu)\n", 199 "(0x%llx, len: %lu)\n",
200 ring->dmabase, BCM43xx_DMA_RINGMEMSIZE); 200 (unsigned long long)ring->dmabase,
201 BCM43xx_DMA_RINGMEMSIZE);
201 dma_free_coherent(dev, BCM43xx_DMA_RINGMEMSIZE, 202 dma_free_coherent(dev, BCM43xx_DMA_RINGMEMSIZE,
202 ring->vbase, ring->dmabase); 203 ring->vbase, ring->dmabase);
203 return -ENOMEM; 204 return -ENOMEM;
@@ -307,8 +308,8 @@ static int setup_rx_descbuffer(struct bcm43xx_dmaring *ring,
307 unmap_descbuffer(ring, dmaaddr, ring->rx_buffersize, 0); 308 unmap_descbuffer(ring, dmaaddr, ring->rx_buffersize, 0);
308 dev_kfree_skb_any(skb); 309 dev_kfree_skb_any(skb);
309 printk(KERN_ERR PFX ">>>FATAL ERROR<<< DMA RX SKB >1G " 310 printk(KERN_ERR PFX ">>>FATAL ERROR<<< DMA RX SKB >1G "
310 "(0x%08x, len: %u)\n", 311 "(0x%llx, len: %u)\n",
311 dmaaddr, ring->rx_buffersize); 312 (unsigned long long)dmaaddr, ring->rx_buffersize);
312 return -ENOMEM; 313 return -ENOMEM;
313 } 314 }
314 meta->skb = skb; 315 meta->skb = skb;
@@ -729,8 +730,8 @@ static int dma_tx_fragment(struct bcm43xx_dmaring *ring,
729 if (unlikely(meta->dmaaddr + skb->len > BCM43xx_DMA_BUSADDRMAX)) { 730 if (unlikely(meta->dmaaddr + skb->len > BCM43xx_DMA_BUSADDRMAX)) {
730 return_slot(ring, slot); 731 return_slot(ring, slot);
731 printk(KERN_ERR PFX ">>>FATAL ERROR<<< DMA TX SKB >1G " 732 printk(KERN_ERR PFX ">>>FATAL ERROR<<< DMA TX SKB >1G "
732 "(0x%08x, len: %u)\n", 733 "(0x%llx, len: %u)\n",
733 meta->dmaaddr, skb->len); 734 (unsigned long long)meta->dmaaddr, skb->len);
734 return -ENOMEM; 735 return -ENOMEM;
735 } 736 }
736 737
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_dma.h b/drivers/net/wireless/bcm43xx/bcm43xx_dma.h
index 2d520e4b0276..b7d77638ba8c 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_dma.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_dma.h
@@ -213,6 +213,14 @@ static inline
213void bcm43xx_dma_rx(struct bcm43xx_dmaring *ring) 213void bcm43xx_dma_rx(struct bcm43xx_dmaring *ring)
214{ 214{
215} 215}
216static inline
217void bcm43xx_dma_tx_suspend(struct bcm43xx_dmaring *ring)
218{
219}
220static inline
221void bcm43xx_dma_tx_resume(struct bcm43xx_dmaring *ring)
222{
223}
216 224
217#endif /* CONFIG_BCM43XX_DMA */ 225#endif /* CONFIG_BCM43XX_DMA */
218#endif /* BCM43xx_DMA_H_ */ 226#endif /* BCM43xx_DMA_H_ */
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
index c37371fc9e01..9a06e61df0a2 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -52,6 +52,7 @@
52#include "bcm43xx_wx.h" 52#include "bcm43xx_wx.h"
53#include "bcm43xx_ethtool.h" 53#include "bcm43xx_ethtool.h"
54#include "bcm43xx_xmit.h" 54#include "bcm43xx_xmit.h"
55#include "bcm43xx_sysfs.h"
55 56
56 57
57MODULE_DESCRIPTION("Broadcom BCM43xx wireless driver"); 58MODULE_DESCRIPTION("Broadcom BCM43xx wireless driver");
@@ -3522,6 +3523,7 @@ static inline int bcm43xx_tx(struct bcm43xx_private *bcm,
3522 err = bcm43xx_pio_tx(bcm, txb); 3523 err = bcm43xx_pio_tx(bcm, txb);
3523 else 3524 else
3524 err = bcm43xx_dma_tx(bcm, txb); 3525 err = bcm43xx_dma_tx(bcm, txb);
3526 bcm->net_dev->trans_start = jiffies;
3525 3527
3526 return err; 3528 return err;
3527} 3529}
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
index 0a66f43ca0c0..33137165727f 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
@@ -2151,6 +2151,7 @@ int bcm43xx_phy_init_tssi2dbm_table(struct bcm43xx_private *bcm)
2151 phy->tssi2dbm = NULL; 2151 phy->tssi2dbm = NULL;
2152 printk(KERN_ERR PFX "Could not generate " 2152 printk(KERN_ERR PFX "Could not generate "
2153 "tssi2dBm table\n"); 2153 "tssi2dBm table\n");
2154 kfree(dyn_tssi2dbm);
2154 return -ENODEV; 2155 return -ENODEV;
2155 } 2156 }
2156 phy->tssi2dbm = dyn_tssi2dbm; 2157 phy->tssi2dbm = dyn_tssi2dbm;
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_pio.c b/drivers/net/wireless/bcm43xx/bcm43xx_pio.c
index c59ddd40680d..0aa1bd269a25 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_pio.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_pio.c
@@ -27,6 +27,7 @@
27#include "bcm43xx_pio.h" 27#include "bcm43xx_pio.h"
28#include "bcm43xx_main.h" 28#include "bcm43xx_main.h"
29#include "bcm43xx_xmit.h" 29#include "bcm43xx_xmit.h"
30#include "bcm43xx_power.h"
30 31
31#include <linux/delay.h> 32#include <linux/delay.h>
32 33
@@ -44,10 +45,10 @@ static void tx_octet(struct bcm43xx_pioqueue *queue,
44 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA, 45 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA,
45 octet); 46 octet);
46 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL, 47 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL,
47 BCM43xx_PIO_TXCTL_WRITEHI); 48 BCM43xx_PIO_TXCTL_WRITELO);
48 } else { 49 } else {
49 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL, 50 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL,
50 BCM43xx_PIO_TXCTL_WRITEHI); 51 BCM43xx_PIO_TXCTL_WRITELO);
51 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA, 52 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA,
52 octet); 53 octet);
53 } 54 }
@@ -103,7 +104,7 @@ static void tx_complete(struct bcm43xx_pioqueue *queue,
103 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA, 104 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA,
104 skb->data[skb->len - 1]); 105 skb->data[skb->len - 1]);
105 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL, 106 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL,
106 BCM43xx_PIO_TXCTL_WRITEHI | 107 BCM43xx_PIO_TXCTL_WRITELO |
107 BCM43xx_PIO_TXCTL_COMPLETE); 108 BCM43xx_PIO_TXCTL_COMPLETE);
108 } else { 109 } else {
109 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL, 110 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL,
@@ -112,9 +113,10 @@ static void tx_complete(struct bcm43xx_pioqueue *queue,
112} 113}
113 114
114static u16 generate_cookie(struct bcm43xx_pioqueue *queue, 115static u16 generate_cookie(struct bcm43xx_pioqueue *queue,
115 int packetindex) 116 struct bcm43xx_pio_txpacket *packet)
116{ 117{
117 u16 cookie = 0x0000; 118 u16 cookie = 0x0000;
119 int packetindex;
118 120
119 /* We use the upper 4 bits for the PIO 121 /* We use the upper 4 bits for the PIO
120 * controller ID and the lower 12 bits 122 * controller ID and the lower 12 bits
@@ -135,6 +137,7 @@ static u16 generate_cookie(struct bcm43xx_pioqueue *queue,
135 default: 137 default:
136 assert(0); 138 assert(0);
137 } 139 }
140 packetindex = pio_txpacket_getindex(packet);
138 assert(((u16)packetindex & 0xF000) == 0x0000); 141 assert(((u16)packetindex & 0xF000) == 0x0000);
139 cookie |= (u16)packetindex; 142 cookie |= (u16)packetindex;
140 143
@@ -184,7 +187,7 @@ static void pio_tx_write_fragment(struct bcm43xx_pioqueue *queue,
184 bcm43xx_generate_txhdr(queue->bcm, 187 bcm43xx_generate_txhdr(queue->bcm,
185 &txhdr, skb->data, skb->len, 188 &txhdr, skb->data, skb->len,
186 (packet->xmitted_frags == 0), 189 (packet->xmitted_frags == 0),
187 generate_cookie(queue, pio_txpacket_getindex(packet))); 190 generate_cookie(queue, packet));
188 191
189 tx_start(queue); 192 tx_start(queue);
190 octets = skb->len + sizeof(txhdr); 193 octets = skb->len + sizeof(txhdr);
@@ -241,7 +244,7 @@ static int pio_tx_packet(struct bcm43xx_pio_txpacket *packet)
241 queue->tx_devq_packets++; 244 queue->tx_devq_packets++;
242 queue->tx_devq_used += octets; 245 queue->tx_devq_used += octets;
243 246
244 assert(packet->xmitted_frags <= packet->txb->nr_frags); 247 assert(packet->xmitted_frags < packet->txb->nr_frags);
245 packet->xmitted_frags++; 248 packet->xmitted_frags++;
246 packet->xmitted_octets += octets; 249 packet->xmitted_octets += octets;
247 } 250 }
@@ -257,8 +260,14 @@ static void tx_tasklet(unsigned long d)
257 unsigned long flags; 260 unsigned long flags;
258 struct bcm43xx_pio_txpacket *packet, *tmp_packet; 261 struct bcm43xx_pio_txpacket *packet, *tmp_packet;
259 int err; 262 int err;
263 u16 txctl;
260 264
261 bcm43xx_lock_mmio(bcm, flags); 265 bcm43xx_lock_mmio(bcm, flags);
266
267 txctl = bcm43xx_pio_read(queue, BCM43xx_PIO_TXCTL);
268 if (txctl & BCM43xx_PIO_TXCTL_SUSPEND)
269 goto out_unlock;
270
262 list_for_each_entry_safe(packet, tmp_packet, &queue->txqueue, list) { 271 list_for_each_entry_safe(packet, tmp_packet, &queue->txqueue, list) {
263 assert(packet->xmitted_frags < packet->txb->nr_frags); 272 assert(packet->xmitted_frags < packet->txb->nr_frags);
264 if (packet->xmitted_frags == 0) { 273 if (packet->xmitted_frags == 0) {
@@ -288,6 +297,7 @@ static void tx_tasklet(unsigned long d)
288 next_packet: 297 next_packet:
289 continue; 298 continue;
290 } 299 }
300out_unlock:
291 bcm43xx_unlock_mmio(bcm, flags); 301 bcm43xx_unlock_mmio(bcm, flags);
292} 302}
293 303
@@ -330,12 +340,19 @@ struct bcm43xx_pioqueue * bcm43xx_setup_pioqueue(struct bcm43xx_private *bcm,
330 (unsigned long)queue); 340 (unsigned long)queue);
331 341
332 value = bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD); 342 value = bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD);
333 value |= BCM43xx_SBF_XFER_REG_BYTESWAP; 343 value &= ~BCM43xx_SBF_XFER_REG_BYTESWAP;
334 bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, value); 344 bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, value);
335 345
336 qsize = bcm43xx_read16(bcm, queue->mmio_base + BCM43xx_PIO_TXQBUFSIZE); 346 qsize = bcm43xx_read16(bcm, queue->mmio_base + BCM43xx_PIO_TXQBUFSIZE);
347 if (qsize == 0) {
348 printk(KERN_ERR PFX "ERROR: This card does not support PIO "
349 "operation mode. Please use DMA mode "
350 "(module parameter pio=0).\n");
351 goto err_freequeue;
352 }
337 if (qsize <= BCM43xx_PIO_TXQADJUST) { 353 if (qsize <= BCM43xx_PIO_TXQADJUST) {
338 printk(KERN_ERR PFX "PIO tx device-queue too small (%u)\n", qsize); 354 printk(KERN_ERR PFX "PIO tx device-queue too small (%u)\n",
355 qsize);
339 goto err_freequeue; 356 goto err_freequeue;
340 } 357 }
341 qsize -= BCM43xx_PIO_TXQADJUST; 358 qsize -= BCM43xx_PIO_TXQADJUST;
@@ -444,15 +461,10 @@ int bcm43xx_pio_tx(struct bcm43xx_private *bcm,
444{ 461{
445 struct bcm43xx_pioqueue *queue = bcm43xx_current_pio(bcm)->queue1; 462 struct bcm43xx_pioqueue *queue = bcm43xx_current_pio(bcm)->queue1;
446 struct bcm43xx_pio_txpacket *packet; 463 struct bcm43xx_pio_txpacket *packet;
447 u16 tmp;
448 464
449 assert(!queue->tx_suspended); 465 assert(!queue->tx_suspended);
450 assert(!list_empty(&queue->txfree)); 466 assert(!list_empty(&queue->txfree));
451 467
452 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_TXCTL);
453 if (tmp & BCM43xx_PIO_TXCTL_SUSPEND)
454 return -EBUSY;
455
456 packet = list_entry(queue->txfree.next, struct bcm43xx_pio_txpacket, list); 468 packet = list_entry(queue->txfree.next, struct bcm43xx_pio_txpacket, list);
457 packet->txb = txb; 469 packet->txb = txb;
458 packet->xmitted_frags = 0; 470 packet->xmitted_frags = 0;
@@ -462,7 +474,7 @@ int bcm43xx_pio_tx(struct bcm43xx_private *bcm,
462 assert(queue->nr_txfree < BCM43xx_PIO_MAXTXPACKETS); 474 assert(queue->nr_txfree < BCM43xx_PIO_MAXTXPACKETS);
463 475
464 /* Suspend TX, if we are out of packets in the "free" queue. */ 476 /* Suspend TX, if we are out of packets in the "free" queue. */
465 if (unlikely(list_empty(&queue->txfree))) { 477 if (list_empty(&queue->txfree)) {
466 netif_stop_queue(queue->bcm->net_dev); 478 netif_stop_queue(queue->bcm->net_dev);
467 queue->tx_suspended = 1; 479 queue->tx_suspended = 1;
468 } 480 }
@@ -480,15 +492,15 @@ void bcm43xx_pio_handle_xmitstatus(struct bcm43xx_private *bcm,
480 492
481 queue = parse_cookie(bcm, status->cookie, &packet); 493 queue = parse_cookie(bcm, status->cookie, &packet);
482 assert(queue); 494 assert(queue);
483//TODO 495
484if (!queue)
485return;
486 free_txpacket(packet, 1); 496 free_txpacket(packet, 1);
487 if (unlikely(queue->tx_suspended)) { 497 if (queue->tx_suspended) {
488 queue->tx_suspended = 0; 498 queue->tx_suspended = 0;
489 netif_wake_queue(queue->bcm->net_dev); 499 netif_wake_queue(queue->bcm->net_dev);
490 } 500 }
491 /* If there are packets on the txqueue, poke the tasklet. */ 501 /* If there are packets on the txqueue, poke the tasklet
502 * to transmit them.
503 */
492 if (!list_empty(&queue->txqueue)) 504 if (!list_empty(&queue->txqueue))
493 tasklet_schedule(&queue->txtask); 505 tasklet_schedule(&queue->txtask);
494} 506}
@@ -519,12 +531,9 @@ void bcm43xx_pio_rx(struct bcm43xx_pioqueue *queue)
519 int i, preamble_readwords; 531 int i, preamble_readwords;
520 struct sk_buff *skb; 532 struct sk_buff *skb;
521 533
522return;
523 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXCTL); 534 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXCTL);
524 if (!(tmp & BCM43xx_PIO_RXCTL_DATAAVAILABLE)) { 535 if (!(tmp & BCM43xx_PIO_RXCTL_DATAAVAILABLE))
525 dprintkl(KERN_ERR PFX "PIO RX: No data available\n");//TODO: remove this printk.
526 return; 536 return;
527 }
528 bcm43xx_pio_write(queue, BCM43xx_PIO_RXCTL, 537 bcm43xx_pio_write(queue, BCM43xx_PIO_RXCTL,
529 BCM43xx_PIO_RXCTL_DATAAVAILABLE); 538 BCM43xx_PIO_RXCTL_DATAAVAILABLE);
530 539
@@ -538,8 +547,7 @@ return;
538 return; 547 return;
539data_ready: 548data_ready:
540 549
541//FIXME: endianess in this function. 550 len = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA);
542 len = le16_to_cpu(bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA));
543 if (unlikely(len > 0x700)) { 551 if (unlikely(len > 0x700)) {
544 pio_rx_error(queue, 0, "len > 0x700"); 552 pio_rx_error(queue, 0, "len > 0x700");
545 return; 553 return;
@@ -555,7 +563,7 @@ data_ready:
555 preamble_readwords = 18 / sizeof(u16); 563 preamble_readwords = 18 / sizeof(u16);
556 for (i = 0; i < preamble_readwords; i++) { 564 for (i = 0; i < preamble_readwords; i++) {
557 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA); 565 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA);
558 preamble[i + 1] = cpu_to_be16(tmp);//FIXME? 566 preamble[i + 1] = cpu_to_le16(tmp);
559 } 567 }
560 rxhdr = (struct bcm43xx_rxhdr *)preamble; 568 rxhdr = (struct bcm43xx_rxhdr *)preamble;
561 rxflags2 = le16_to_cpu(rxhdr->flags2); 569 rxflags2 = le16_to_cpu(rxhdr->flags2);
@@ -591,16 +599,40 @@ data_ready:
591 } 599 }
592 skb_put(skb, len); 600 skb_put(skb, len);
593 for (i = 0; i < len - 1; i += 2) { 601 for (i = 0; i < len - 1; i += 2) {
594 tmp = cpu_to_be16(bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA)); 602 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA);
595 *((u16 *)(skb->data + i)) = tmp; 603 *((u16 *)(skb->data + i)) = cpu_to_le16(tmp);
596 } 604 }
597 if (len % 2) { 605 if (len % 2) {
598 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA); 606 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA);
599 skb->data[len - 1] = (tmp & 0x00FF); 607 skb->data[len - 1] = (tmp & 0x00FF);
608/* The specs say the following is required, but
609 * it is wrong and corrupts the PLCP. If we don't do
610 * this, the PLCP seems to be correct. So ifdef it out for now.
611 */
612#if 0
600 if (rxflags2 & BCM43xx_RXHDR_FLAGS2_TYPE2FRAME) 613 if (rxflags2 & BCM43xx_RXHDR_FLAGS2_TYPE2FRAME)
601 skb->data[0x20] = (tmp & 0xFF00) >> 8; 614 skb->data[2] = (tmp & 0xFF00) >> 8;
602 else 615 else
603 skb->data[0x1E] = (tmp & 0xFF00) >> 8; 616 skb->data[0] = (tmp & 0xFF00) >> 8;
617#endif
604 } 618 }
619 skb_trim(skb, len - IEEE80211_FCS_LEN);
605 bcm43xx_rx(queue->bcm, skb, rxhdr); 620 bcm43xx_rx(queue->bcm, skb, rxhdr);
606} 621}
622
623void bcm43xx_pio_tx_suspend(struct bcm43xx_pioqueue *queue)
624{
625 bcm43xx_power_saving_ctl_bits(queue->bcm, -1, 1);
626 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL,
627 bcm43xx_pio_read(queue, BCM43xx_PIO_TXCTL)
628 | BCM43xx_PIO_TXCTL_SUSPEND);
629}
630
631void bcm43xx_pio_tx_resume(struct bcm43xx_pioqueue *queue)
632{
633 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL,
634 bcm43xx_pio_read(queue, BCM43xx_PIO_TXCTL)
635 & ~BCM43xx_PIO_TXCTL_SUSPEND);
636 bcm43xx_power_saving_ctl_bits(queue->bcm, -1, -1);
637 tasklet_schedule(&queue->txtask);
638}
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_pio.h b/drivers/net/wireless/bcm43xx/bcm43xx_pio.h
index 970627bc1769..dfc78209e3a3 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_pio.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_pio.h
@@ -14,8 +14,8 @@
14#define BCM43xx_PIO_RXCTL 0x08 14#define BCM43xx_PIO_RXCTL 0x08
15#define BCM43xx_PIO_RXDATA 0x0A 15#define BCM43xx_PIO_RXDATA 0x0A
16 16
17#define BCM43xx_PIO_TXCTL_WRITEHI (1 << 0) 17#define BCM43xx_PIO_TXCTL_WRITELO (1 << 0)
18#define BCM43xx_PIO_TXCTL_WRITELO (1 << 1) 18#define BCM43xx_PIO_TXCTL_WRITEHI (1 << 1)
19#define BCM43xx_PIO_TXCTL_COMPLETE (1 << 2) 19#define BCM43xx_PIO_TXCTL_COMPLETE (1 << 2)
20#define BCM43xx_PIO_TXCTL_INIT (1 << 3) 20#define BCM43xx_PIO_TXCTL_INIT (1 << 3)
21#define BCM43xx_PIO_TXCTL_SUSPEND (1 << 7) 21#define BCM43xx_PIO_TXCTL_SUSPEND (1 << 7)
@@ -95,6 +95,7 @@ void bcm43xx_pio_write(struct bcm43xx_pioqueue *queue,
95 u16 offset, u16 value) 95 u16 offset, u16 value)
96{ 96{
97 bcm43xx_write16(queue->bcm, queue->mmio_base + offset, value); 97 bcm43xx_write16(queue->bcm, queue->mmio_base + offset, value);
98 mmiowb();
98} 99}
99 100
100 101
@@ -107,6 +108,9 @@ void bcm43xx_pio_handle_xmitstatus(struct bcm43xx_private *bcm,
107 struct bcm43xx_xmitstatus *status); 108 struct bcm43xx_xmitstatus *status);
108void bcm43xx_pio_rx(struct bcm43xx_pioqueue *queue); 109void bcm43xx_pio_rx(struct bcm43xx_pioqueue *queue);
109 110
111void bcm43xx_pio_tx_suspend(struct bcm43xx_pioqueue *queue);
112void bcm43xx_pio_tx_resume(struct bcm43xx_pioqueue *queue);
113
110#else /* CONFIG_BCM43XX_PIO */ 114#else /* CONFIG_BCM43XX_PIO */
111 115
112static inline 116static inline
@@ -133,6 +137,14 @@ static inline
133void bcm43xx_pio_rx(struct bcm43xx_pioqueue *queue) 137void bcm43xx_pio_rx(struct bcm43xx_pioqueue *queue)
134{ 138{
135} 139}
140static inline
141void bcm43xx_pio_tx_suspend(struct bcm43xx_pioqueue *queue)
142{
143}
144static inline
145void bcm43xx_pio_tx_resume(struct bcm43xx_pioqueue *queue)
146{
147}
136 148
137#endif /* CONFIG_BCM43XX_PIO */ 149#endif /* CONFIG_BCM43XX_PIO */
138#endif /* BCM43xx_PIO_H_ */ 150#endif /* BCM43xx_PIO_H_ */
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_power.c b/drivers/net/wireless/bcm43xx/bcm43xx_power.c
index 3c92b62807c5..6569da3a7a39 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_power.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_power.c
@@ -35,77 +35,101 @@
35#include "bcm43xx_main.h" 35#include "bcm43xx_main.h"
36 36
37 37
38/* Get the Slow Clock Source */
39static int bcm43xx_pctl_get_slowclksrc(struct bcm43xx_private *bcm)
40{
41 u32 tmp;
42 int err;
43
44 assert(bcm->current_core == &bcm->core_chipcommon);
45 if (bcm->current_core->rev < 6) {
46 if (bcm->bustype == BCM43xx_BUSTYPE_PCMCIA ||
47 bcm->bustype == BCM43xx_BUSTYPE_SB)
48 return BCM43xx_PCTL_CLKSRC_XTALOS;
49 if (bcm->bustype == BCM43xx_BUSTYPE_PCI) {
50 err = bcm43xx_pci_read_config32(bcm, BCM43xx_PCTL_OUT, &tmp);
51 assert(!err);
52 if (tmp & 0x10)
53 return BCM43xx_PCTL_CLKSRC_PCI;
54 return BCM43xx_PCTL_CLKSRC_XTALOS;
55 }
56 }
57 if (bcm->current_core->rev < 10) {
58 tmp = bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SLOWCLKCTL);
59 tmp &= 0x7;
60 if (tmp == 0)
61 return BCM43xx_PCTL_CLKSRC_LOPWROS;
62 if (tmp == 1)
63 return BCM43xx_PCTL_CLKSRC_XTALOS;
64 if (tmp == 2)
65 return BCM43xx_PCTL_CLKSRC_PCI;
66 }
67
68 return BCM43xx_PCTL_CLKSRC_XTALOS;
69}
70
38/* Get max/min slowclock frequency 71/* Get max/min slowclock frequency
39 * as described in http://bcm-specs.sipsolutions.net/PowerControl 72 * as described in http://bcm-specs.sipsolutions.net/PowerControl
40 */ 73 */
41static int bcm43xx_pctl_clockfreqlimit(struct bcm43xx_private *bcm, 74static int bcm43xx_pctl_clockfreqlimit(struct bcm43xx_private *bcm,
42 int get_max) 75 int get_max)
43{ 76{
44 int limit = 0; 77 int limit;
78 int clocksrc;
45 int divisor; 79 int divisor;
46 int selection;
47 int err;
48 u32 tmp; 80 u32 tmp;
49 struct bcm43xx_coreinfo *old_core;
50 81
51 if (!(bcm->chipcommon_capabilities & BCM43xx_CAPABILITIES_PCTL)) 82 assert(bcm->chipcommon_capabilities & BCM43xx_CAPABILITIES_PCTL);
52 goto out; 83 assert(bcm->current_core == &bcm->core_chipcommon);
53 old_core = bcm->current_core;
54 err = bcm43xx_switch_core(bcm, &bcm->core_chipcommon);
55 if (err)
56 goto out;
57 84
85 clocksrc = bcm43xx_pctl_get_slowclksrc(bcm);
58 if (bcm->current_core->rev < 6) { 86 if (bcm->current_core->rev < 6) {
59 if ((bcm->bustype == BCM43xx_BUSTYPE_PCMCIA) || 87 switch (clocksrc) {
60 (bcm->bustype == BCM43xx_BUSTYPE_SB)) { 88 case BCM43xx_PCTL_CLKSRC_PCI:
61 selection = 1; 89 divisor = 64;
90 break;
91 case BCM43xx_PCTL_CLKSRC_XTALOS:
62 divisor = 32; 92 divisor = 32;
63 } else { 93 break;
64 err = bcm43xx_pci_read_config32(bcm, BCM43xx_PCTL_OUT, &tmp); 94 default:
65 if (err) { 95 assert(0);
66 printk(KERN_ERR PFX "clockfreqlimit pcicfg read failure\n"); 96 divisor = 1;
67 goto out_switchback;
68 }
69 if (tmp & 0x10) {
70 /* PCI */
71 selection = 2;
72 divisor = 64;
73 } else {
74 /* XTAL */
75 selection = 1;
76 divisor = 32;
77 }
78 } 97 }
79 } else if (bcm->current_core->rev < 10) { 98 } else if (bcm->current_core->rev < 10) {
80 selection = (tmp & 0x07); 99 switch (clocksrc) {
81 if (selection) { 100 case BCM43xx_PCTL_CLKSRC_LOPWROS:
101 divisor = 1;
102 break;
103 case BCM43xx_PCTL_CLKSRC_XTALOS:
104 case BCM43xx_PCTL_CLKSRC_PCI:
82 tmp = bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SLOWCLKCTL); 105 tmp = bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SLOWCLKCTL);
83 divisor = 4 * (1 + ((tmp & 0xFFFF0000) >> 16)); 106 divisor = ((tmp & 0xFFFF0000) >> 16) + 1;
84 } else 107 divisor *= 4;
108 break;
109 default:
110 assert(0);
85 divisor = 1; 111 divisor = 1;
112 }
86 } else { 113 } else {
87 tmp = bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SYSCLKCTL); 114 tmp = bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SYSCLKCTL);
88 divisor = 4 * (1 + ((tmp & 0xFFFF0000) >> 16)); 115 divisor = ((tmp & 0xFFFF0000) >> 16) + 1;
89 selection = 1; 116 divisor *= 4;
90 } 117 }
91 118
92 switch (selection) { 119 switch (clocksrc) {
93 case 0: 120 case BCM43xx_PCTL_CLKSRC_LOPWROS:
94 /* LPO */
95 if (get_max) 121 if (get_max)
96 limit = 43000; 122 limit = 43000;
97 else 123 else
98 limit = 25000; 124 limit = 25000;
99 break; 125 break;
100 case 1: 126 case BCM43xx_PCTL_CLKSRC_XTALOS:
101 /* XTAL */
102 if (get_max) 127 if (get_max)
103 limit = 20200000; 128 limit = 20200000;
104 else 129 else
105 limit = 19800000; 130 limit = 19800000;
106 break; 131 break;
107 case 2: 132 case BCM43xx_PCTL_CLKSRC_PCI:
108 /* PCI */
109 if (get_max) 133 if (get_max)
110 limit = 34000000; 134 limit = 34000000;
111 else 135 else
@@ -113,17 +137,14 @@ static int bcm43xx_pctl_clockfreqlimit(struct bcm43xx_private *bcm,
113 break; 137 break;
114 default: 138 default:
115 assert(0); 139 assert(0);
140 limit = 0;
116 } 141 }
117 limit /= divisor; 142 limit /= divisor;
118 143
119out_switchback:
120 err = bcm43xx_switch_core(bcm, old_core);
121 assert(err == 0);
122
123out:
124 return limit; 144 return limit;
125} 145}
126 146
147
127/* init power control 148/* init power control
128 * as described in http://bcm-specs.sipsolutions.net/PowerControl 149 * as described in http://bcm-specs.sipsolutions.net/PowerControl
129 */ 150 */
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_power.h b/drivers/net/wireless/bcm43xx/bcm43xx_power.h
index 5f63640810bd..c966ab3a5a8c 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_power.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_power.h
@@ -33,6 +33,15 @@
33 33
34#include <linux/types.h> 34#include <linux/types.h>
35 35
36/* Clock sources */
37enum {
38 /* PCI clock */
39 BCM43xx_PCTL_CLKSRC_PCI,
40 /* Crystal slow clock oscillator */
41 BCM43xx_PCTL_CLKSRC_XTALOS,
42 /* Low power oscillator */
43 BCM43xx_PCTL_CLKSRC_LOPWROS,
44};
36 45
37struct bcm43xx_private; 46struct bcm43xx_private;
38 47
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c b/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c
index c44d890b949b..b438f48e891d 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c
@@ -71,14 +71,46 @@ static int get_boolean(const char *buf, size_t count)
71 return -EINVAL; 71 return -EINVAL;
72} 72}
73 73
74static int sprom2hex(const u16 *sprom, char *buf, size_t buf_len)
75{
76 int i, pos = 0;
77
78 for (i = 0; i < BCM43xx_SPROM_SIZE; i++) {
79 pos += snprintf(buf + pos, buf_len - pos - 1,
80 "%04X", swab16(sprom[i]) & 0xFFFF);
81 }
82 pos += snprintf(buf + pos, buf_len - pos - 1, "\n");
83
84 return pos + 1;
85}
86
87static int hex2sprom(u16 *sprom, const char *dump, size_t len)
88{
89 char tmp[5] = { 0 };
90 int cnt = 0;
91 unsigned long parsed;
92
93 if (len < BCM43xx_SPROM_SIZE * sizeof(u16) * 2)
94 return -EINVAL;
95
96 while (cnt < BCM43xx_SPROM_SIZE) {
97 memcpy(tmp, dump, 4);
98 dump += 4;
99 parsed = simple_strtoul(tmp, NULL, 16);
100 sprom[cnt++] = swab16((u16)parsed);
101 }
102
103 return 0;
104}
105
74static ssize_t bcm43xx_attr_sprom_show(struct device *dev, 106static ssize_t bcm43xx_attr_sprom_show(struct device *dev,
75 struct device_attribute *attr, 107 struct device_attribute *attr,
76 char *buf) 108 char *buf)
77{ 109{
78 struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_sprom); 110 struct bcm43xx_private *bcm = dev_to_bcm(dev);
79 u16 *sprom; 111 u16 *sprom;
80 unsigned long flags; 112 unsigned long flags;
81 int i, err; 113 int err;
82 114
83 if (!capable(CAP_NET_ADMIN)) 115 if (!capable(CAP_NET_ADMIN))
84 return -EPERM; 116 return -EPERM;
@@ -91,55 +123,53 @@ static ssize_t bcm43xx_attr_sprom_show(struct device *dev,
91 bcm43xx_lock_mmio(bcm, flags); 123 bcm43xx_lock_mmio(bcm, flags);
92 assert(bcm->initialized); 124 assert(bcm->initialized);
93 err = bcm43xx_sprom_read(bcm, sprom); 125 err = bcm43xx_sprom_read(bcm, sprom);
94 if (!err) { 126 if (!err)
95 for (i = 0; i < BCM43xx_SPROM_SIZE; i++) { 127 err = sprom2hex(sprom, buf, PAGE_SIZE);
96 buf[i * 2] = sprom[i] & 0x00FF;
97 buf[i * 2 + 1] = (sprom[i] & 0xFF00) >> 8;
98 }
99 }
100 bcm43xx_unlock_mmio(bcm, flags); 128 bcm43xx_unlock_mmio(bcm, flags);
101 kfree(sprom); 129 kfree(sprom);
102 130
103 return err ? err : BCM43xx_SPROM_SIZE * sizeof(u16); 131 return err;
104} 132}
105 133
106static ssize_t bcm43xx_attr_sprom_store(struct device *dev, 134static ssize_t bcm43xx_attr_sprom_store(struct device *dev,
107 struct device_attribute *attr, 135 struct device_attribute *attr,
108 const char *buf, size_t count) 136 const char *buf, size_t count)
109{ 137{
110 struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_sprom); 138 struct bcm43xx_private *bcm = dev_to_bcm(dev);
111 u16 *sprom; 139 u16 *sprom;
112 unsigned long flags; 140 unsigned long flags;
113 int i, err; 141 int err;
114 142
115 if (!capable(CAP_NET_ADMIN)) 143 if (!capable(CAP_NET_ADMIN))
116 return -EPERM; 144 return -EPERM;
117 145
118 if (count != BCM43xx_SPROM_SIZE * sizeof(u16))
119 return -EINVAL;
120 sprom = kmalloc(BCM43xx_SPROM_SIZE * sizeof(*sprom), 146 sprom = kmalloc(BCM43xx_SPROM_SIZE * sizeof(*sprom),
121 GFP_KERNEL); 147 GFP_KERNEL);
122 if (!sprom) 148 if (!sprom)
123 return -ENOMEM; 149 return -ENOMEM;
124 for (i = 0; i < BCM43xx_SPROM_SIZE; i++) { 150 err = hex2sprom(sprom, buf, count);
125 sprom[i] = buf[i * 2] & 0xFF; 151 if (err)
126 sprom[i] |= ((u16)(buf[i * 2 + 1] & 0xFF)) << 8; 152 goto out_kfree;
127 }
128 bcm43xx_lock_mmio(bcm, flags); 153 bcm43xx_lock_mmio(bcm, flags);
129 assert(bcm->initialized); 154 assert(bcm->initialized);
130 err = bcm43xx_sprom_write(bcm, sprom); 155 err = bcm43xx_sprom_write(bcm, sprom);
131 bcm43xx_unlock_mmio(bcm, flags); 156 bcm43xx_unlock_mmio(bcm, flags);
157out_kfree:
132 kfree(sprom); 158 kfree(sprom);
133 159
134 return err ? err : count; 160 return err ? err : count;
135 161
136} 162}
137 163
164static DEVICE_ATTR(sprom, 0600,
165 bcm43xx_attr_sprom_show,
166 bcm43xx_attr_sprom_store);
167
138static ssize_t bcm43xx_attr_interfmode_show(struct device *dev, 168static ssize_t bcm43xx_attr_interfmode_show(struct device *dev,
139 struct device_attribute *attr, 169 struct device_attribute *attr,
140 char *buf) 170 char *buf)
141{ 171{
142 struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_interfmode); 172 struct bcm43xx_private *bcm = dev_to_bcm(dev);
143 unsigned long flags; 173 unsigned long flags;
144 int err; 174 int err;
145 ssize_t count = 0; 175 ssize_t count = 0;
@@ -175,7 +205,7 @@ static ssize_t bcm43xx_attr_interfmode_store(struct device *dev,
175 struct device_attribute *attr, 205 struct device_attribute *attr,
176 const char *buf, size_t count) 206 const char *buf, size_t count)
177{ 207{
178 struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_interfmode); 208 struct bcm43xx_private *bcm = dev_to_bcm(dev);
179 unsigned long flags; 209 unsigned long flags;
180 int err; 210 int err;
181 int mode; 211 int mode;
@@ -215,11 +245,15 @@ static ssize_t bcm43xx_attr_interfmode_store(struct device *dev,
215 return err ? err : count; 245 return err ? err : count;
216} 246}
217 247
248static DEVICE_ATTR(interference, 0644,
249 bcm43xx_attr_interfmode_show,
250 bcm43xx_attr_interfmode_store);
251
218static ssize_t bcm43xx_attr_preamble_show(struct device *dev, 252static ssize_t bcm43xx_attr_preamble_show(struct device *dev,
219 struct device_attribute *attr, 253 struct device_attribute *attr,
220 char *buf) 254 char *buf)
221{ 255{
222 struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_preamble); 256 struct bcm43xx_private *bcm = dev_to_bcm(dev);
223 unsigned long flags; 257 unsigned long flags;
224 int err; 258 int err;
225 ssize_t count; 259 ssize_t count;
@@ -245,7 +279,7 @@ static ssize_t bcm43xx_attr_preamble_store(struct device *dev,
245 struct device_attribute *attr, 279 struct device_attribute *attr,
246 const char *buf, size_t count) 280 const char *buf, size_t count)
247{ 281{
248 struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_preamble); 282 struct bcm43xx_private *bcm = dev_to_bcm(dev);
249 unsigned long flags; 283 unsigned long flags;
250 int err; 284 int err;
251 int value; 285 int value;
@@ -267,56 +301,41 @@ static ssize_t bcm43xx_attr_preamble_store(struct device *dev,
267 return err ? err : count; 301 return err ? err : count;
268} 302}
269 303
304static DEVICE_ATTR(shortpreamble, 0644,
305 bcm43xx_attr_preamble_show,
306 bcm43xx_attr_preamble_store);
307
270int bcm43xx_sysfs_register(struct bcm43xx_private *bcm) 308int bcm43xx_sysfs_register(struct bcm43xx_private *bcm)
271{ 309{
272 struct device *dev = &bcm->pci_dev->dev; 310 struct device *dev = &bcm->pci_dev->dev;
273 struct bcm43xx_sysfs *sysfs = &bcm->sysfs;
274 int err; 311 int err;
275 312
276 assert(bcm->initialized); 313 assert(bcm->initialized);
277 314
278 sysfs->attr_sprom.attr.name = "sprom"; 315 err = device_create_file(dev, &dev_attr_sprom);
279 sysfs->attr_sprom.attr.owner = THIS_MODULE;
280 sysfs->attr_sprom.attr.mode = 0600;
281 sysfs->attr_sprom.show = bcm43xx_attr_sprom_show;
282 sysfs->attr_sprom.store = bcm43xx_attr_sprom_store;
283 err = device_create_file(dev, &sysfs->attr_sprom);
284 if (err) 316 if (err)
285 goto out; 317 goto out;
286 318 err = device_create_file(dev, &dev_attr_interference);
287 sysfs->attr_interfmode.attr.name = "interference";
288 sysfs->attr_interfmode.attr.owner = THIS_MODULE;
289 sysfs->attr_interfmode.attr.mode = 0600;
290 sysfs->attr_interfmode.show = bcm43xx_attr_interfmode_show;
291 sysfs->attr_interfmode.store = bcm43xx_attr_interfmode_store;
292 err = device_create_file(dev, &sysfs->attr_interfmode);
293 if (err) 319 if (err)
294 goto err_remove_sprom; 320 goto err_remove_sprom;
295 321 err = device_create_file(dev, &dev_attr_shortpreamble);
296 sysfs->attr_preamble.attr.name = "shortpreamble";
297 sysfs->attr_preamble.attr.owner = THIS_MODULE;
298 sysfs->attr_preamble.attr.mode = 0600;
299 sysfs->attr_preamble.show = bcm43xx_attr_preamble_show;
300 sysfs->attr_preamble.store = bcm43xx_attr_preamble_store;
301 err = device_create_file(dev, &sysfs->attr_preamble);
302 if (err) 322 if (err)
303 goto err_remove_interfmode; 323 goto err_remove_interfmode;
304 324
305out: 325out:
306 return err; 326 return err;
307err_remove_interfmode: 327err_remove_interfmode:
308 device_remove_file(dev, &sysfs->attr_interfmode); 328 device_remove_file(dev, &dev_attr_interference);
309err_remove_sprom: 329err_remove_sprom:
310 device_remove_file(dev, &sysfs->attr_sprom); 330 device_remove_file(dev, &dev_attr_sprom);
311 goto out; 331 goto out;
312} 332}
313 333
314void bcm43xx_sysfs_unregister(struct bcm43xx_private *bcm) 334void bcm43xx_sysfs_unregister(struct bcm43xx_private *bcm)
315{ 335{
316 struct device *dev = &bcm->pci_dev->dev; 336 struct device *dev = &bcm->pci_dev->dev;
317 struct bcm43xx_sysfs *sysfs = &bcm->sysfs;
318 337
319 device_remove_file(dev, &sysfs->attr_preamble); 338 device_remove_file(dev, &dev_attr_shortpreamble);
320 device_remove_file(dev, &sysfs->attr_interfmode); 339 device_remove_file(dev, &dev_attr_interference);
321 device_remove_file(dev, &sysfs->attr_sprom); 340 device_remove_file(dev, &dev_attr_sprom);
322} 341}
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.h b/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.h
index 57f14514e3e0..cc701df71e2a 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.h
@@ -1,22 +1,6 @@
1#ifndef BCM43xx_SYSFS_H_ 1#ifndef BCM43xx_SYSFS_H_
2#define BCM43xx_SYSFS_H_ 2#define BCM43xx_SYSFS_H_
3 3
4#include <linux/device.h>
5
6
7struct bcm43xx_sysfs {
8 struct device_attribute attr_sprom;
9 struct device_attribute attr_interfmode;
10 struct device_attribute attr_preamble;
11};
12
13#define devattr_to_bcm(attr, attr_name) ({ \
14 struct bcm43xx_sysfs *__s; struct bcm43xx_private *__p; \
15 __s = container_of((attr), struct bcm43xx_sysfs, attr_name); \
16 __p = container_of(__s, struct bcm43xx_private, sysfs); \
17 __p; \
18 })
19
20struct bcm43xx_private; 4struct bcm43xx_private;
21 5
22int bcm43xx_sysfs_register(struct bcm43xx_private *bcm); 6int bcm43xx_sysfs_register(struct bcm43xx_private *bcm);
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
index 3daee828ef4b..3edbb481a0a0 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
@@ -962,22 +962,22 @@ static const struct iw_priv_args bcm43xx_priv_wx_args[] = {
962 { 962 {
963 .cmd = PRIV_WX_SET_SHORTPREAMBLE, 963 .cmd = PRIV_WX_SET_SHORTPREAMBLE,
964 .set_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 964 .set_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
965 .name = "set_shortpreambl", 965 .name = "set_shortpreamb",
966 }, 966 },
967 { 967 {
968 .cmd = PRIV_WX_GET_SHORTPREAMBLE, 968 .cmd = PRIV_WX_GET_SHORTPREAMBLE,
969 .get_args = IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | MAX_WX_STRING, 969 .get_args = IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | MAX_WX_STRING,
970 .name = "get_shortpreambl", 970 .name = "get_shortpreamb",
971 }, 971 },
972 { 972 {
973 .cmd = PRIV_WX_SET_SWENCRYPTION, 973 .cmd = PRIV_WX_SET_SWENCRYPTION,
974 .set_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 974 .set_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
975 .name = "set_swencryption", 975 .name = "set_swencrypt",
976 }, 976 },
977 { 977 {
978 .cmd = PRIV_WX_GET_SWENCRYPTION, 978 .cmd = PRIV_WX_GET_SWENCRYPTION,
979 .get_args = IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | MAX_WX_STRING, 979 .get_args = IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | MAX_WX_STRING,
980 .name = "get_swencryption", 980 .name = "get_swencrypt",
981 }, 981 },
982 { 982 {
983 .cmd = PRIV_WX_SPROM_WRITE, 983 .cmd = PRIV_WX_SPROM_WRITE,
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index 8b37e824dfcb..8399de581893 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -1860,7 +1860,7 @@ static char * __prism2_translate_scan(local_info_t *local,
1860 memset(&iwe, 0, sizeof(iwe)); 1860 memset(&iwe, 0, sizeof(iwe));
1861 iwe.cmd = SIOCGIWFREQ; 1861 iwe.cmd = SIOCGIWFREQ;
1862 if (scan) { 1862 if (scan) {
1863 chan = scan->chid; 1863 chan = le16_to_cpu(scan->chid);
1864 } else if (bss) { 1864 } else if (bss) {
1865 chan = bss->chan; 1865 chan = bss->chan;
1866 } else { 1866 } else {
@@ -1868,7 +1868,7 @@ static char * __prism2_translate_scan(local_info_t *local,
1868 } 1868 }
1869 1869
1870 if (chan > 0) { 1870 if (chan > 0) {
1871 iwe.u.freq.m = freq_list[le16_to_cpu(chan - 1)] * 100000; 1871 iwe.u.freq.m = freq_list[chan - 1] * 100000;
1872 iwe.u.freq.e = 1; 1872 iwe.u.freq.e = 1;
1873 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, 1873 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
1874 IW_EV_FREQ_LEN); 1874 IW_EV_FREQ_LEN);
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 8dfdfbd5966c..06523e2a8471 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -390,7 +390,7 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev)
390 } 390 }
391 } else { 391 } else {
392 struct { 392 struct {
393 __le16 qual, signal, noise; 393 __le16 qual, signal, noise, unused;
394 } __attribute__ ((packed)) cq; 394 } __attribute__ ((packed)) cq;
395 395
396 err = HERMES_READ_RECORD(hw, USER_BAP, 396 err = HERMES_READ_RECORD(hw, USER_BAP,
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c
index 4e53be9c03ab..bbeabe3fc4c6 100644
--- a/drivers/parisc/pdc_stable.c
+++ b/drivers/parisc/pdc_stable.c
@@ -535,7 +535,7 @@ pdcs_auto_read(struct subsystem *entry, char *buf, int knob)
535{ 535{
536 char *out = buf; 536 char *out = buf;
537 struct pdcspath_entry *pathentry; 537 struct pdcspath_entry *pathentry;
538 538
539 if (!entry || !buf) 539 if (!entry || !buf)
540 return -EINVAL; 540 return -EINVAL;
541 541
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index 42b32ff2fca6..278f325021ee 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -178,6 +178,11 @@ extern struct proc_dir_entry * proc_mckinley_root;
178#define ROPE6_CTL 0x230 178#define ROPE6_CTL 0x230
179#define ROPE7_CTL 0x238 179#define ROPE7_CTL 0x238
180 180
181#define IOC_ROPE0_CFG 0x500 /* pluto only */
182#define IOC_ROPE_AO 0x10 /* Allow "Relaxed Ordering" */
183
184
185
181#define HF_ENABLE 0x40 186#define HF_ENABLE 0x40
182 187
183 188
@@ -1759,19 +1764,33 @@ printk("sba_hw_init(): mem_boot 0x%x 0x%x 0x%x 0x%x\n", PAGE0->mem_boot.hpa,
1759 1764
1760 sba_dev->num_ioc = num_ioc; 1765 sba_dev->num_ioc = num_ioc;
1761 for (i = 0; i < num_ioc; i++) { 1766 for (i = 0; i < num_ioc; i++) {
1762 /* 1767 unsigned long ioc_hpa = sba_dev->ioc[i].ioc_hpa;
1763 ** Make sure the box crashes if we get any errors on a rope. 1768 unsigned int j;
1764 */ 1769
1765 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE0_CTL); 1770 for (j=0; j < sizeof(u64) * ROPES_PER_IOC; j+=sizeof(u64)) {
1766 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE1_CTL); 1771
1767 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE2_CTL); 1772 /*
1768 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE3_CTL); 1773 * Clear ROPE(N)_CONFIG AO bit.
1769 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE4_CTL); 1774 * Disables "NT Ordering" (~= !"Relaxed Ordering")
1770 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE5_CTL); 1775 * Overrides bit 1 in DMA Hint Sets.
1771 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE6_CTL); 1776 * Improves netperf UDP_STREAM by ~10% for bcm5701.
1772 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE7_CTL); 1777 */
1773 1778 if (IS_PLUTO(sba_dev->iodc)) {
1774 /* flush out the writes */ 1779 unsigned long rope_cfg, cfg_val;
1780
1781 rope_cfg = ioc_hpa + IOC_ROPE0_CFG + j;
1782 cfg_val = READ_REG(rope_cfg);
1783 cfg_val &= ~IOC_ROPE_AO;
1784 WRITE_REG(cfg_val, rope_cfg);
1785 }
1786
1787 /*
1788 ** Make sure the box crashes on rope errors.
1789 */
1790 WRITE_REG(HF_ENABLE, ioc_hpa + ROPE0_CTL + j);
1791 }
1792
1793 /* flush out the last writes */
1775 READ_REG(sba_dev->ioc[i].ioc_hpa + ROPE7_CTL); 1794 READ_REG(sba_dev->ioc[i].ioc_hpa + ROPE7_CTL);
1776 1795
1777 DBG_INIT(" ioc[%d] ROPE_CFG 0x%Lx ROPE_DBG 0x%Lx\n", 1796 DBG_INIT(" ioc[%d] ROPE_CFG 0x%Lx ROPE_DBG 0x%Lx\n",
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c
index 719b863bc20e..828eb45062de 100644
--- a/drivers/parisc/superio.c
+++ b/drivers/parisc/superio.c
@@ -155,7 +155,7 @@ superio_init(struct pci_dev *pcidev)
155 struct pci_dev *pdev = sio->lio_pdev; 155 struct pci_dev *pdev = sio->lio_pdev;
156 u16 word; 156 u16 word;
157 157
158 if (sio->suckyio_irq_enabled) 158 if (sio->suckyio_irq_enabled)
159 return; 159 return;
160 160
161 BUG_ON(!pdev); 161 BUG_ON(!pdev);
@@ -194,7 +194,7 @@ superio_init(struct pci_dev *pcidev)
194 request_region (sio->acpi_base, 0x1f, "acpi"); 194 request_region (sio->acpi_base, 0x1f, "acpi");
195 195
196 /* Enable the legacy I/O function */ 196 /* Enable the legacy I/O function */
197 pci_read_config_word (pdev, PCI_COMMAND, &word); 197 pci_read_config_word (pdev, PCI_COMMAND, &word);
198 word |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_IO; 198 word |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_IO;
199 pci_write_config_word (pdev, PCI_COMMAND, word); 199 pci_write_config_word (pdev, PCI_COMMAND, word);
200 200
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index cba6c9eef28e..61cb4b29f55c 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -250,7 +250,7 @@ config M32R_CFC_NUM
250 250
251config PCMCIA_VRC4171 251config PCMCIA_VRC4171
252 tristate "NEC VRC4171 Card Controllers support" 252 tristate "NEC VRC4171 Card Controllers support"
253 depends on VRC4171 && PCMCIA 253 depends on CPU_VR41XX && ISA && PCMCIA
254 254
255config PCMCIA_VRC4173 255config PCMCIA_VRC4173
256 tristate "NEC VRC4173 CARDU support" 256 tristate "NEC VRC4173 CARDU support"
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index ae10d1eed65e..48d3b3d30c21 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -236,11 +236,11 @@ static void pcmcia_check_driver(struct pcmcia_driver *p_drv)
236/** 236/**
237 * pcmcia_load_firmware - load CIS from userspace if device-provided is broken 237 * pcmcia_load_firmware - load CIS from userspace if device-provided is broken
238 * @dev - the pcmcia device which needs a CIS override 238 * @dev - the pcmcia device which needs a CIS override
239 * @filename - requested filename in /lib/firmware/cis/ 239 * @filename - requested filename in /lib/firmware/
240 * 240 *
241 * This uses the in-kernel firmware loading mechanism to use a "fake CIS" if 241 * This uses the in-kernel firmware loading mechanism to use a "fake CIS" if
242 * the one provided by the card is broken. The firmware files reside in 242 * the one provided by the card is broken. The firmware files reside in
243 * /lib/firmware/cis/ in userspace. 243 * /lib/firmware/ in userspace.
244 */ 244 */
245static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename) 245static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
246{ 246{
@@ -298,9 +298,6 @@ static inline int pcmcia_load_firmware(struct pcmcia_device *dev, char * filenam
298 * 298 *
299 * Registers a PCMCIA driver with the PCMCIA bus core. 299 * Registers a PCMCIA driver with the PCMCIA bus core.
300 */ 300 */
301static int pcmcia_device_probe(struct device *dev);
302static int pcmcia_device_remove(struct device * dev);
303
304int pcmcia_register_driver(struct pcmcia_driver *driver) 301int pcmcia_register_driver(struct pcmcia_driver *driver)
305{ 302{
306 if (!driver) 303 if (!driver)
@@ -400,7 +397,7 @@ static int pcmcia_device_probe(struct device * dev)
400 * call which will then check whether there are two 397 * call which will then check whether there are two
401 * pseudo devices, and if not, add the second one. 398 * pseudo devices, and if not, add the second one.
402 */ 399 */
403 did = (struct pcmcia_device_id *) p_dev->dev.driver_data; 400 did = p_dev->dev.driver_data;
404 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && 401 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&
405 (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) 402 (p_dev->socket->device_count == 1) && (p_dev->device_no == 0))
406 pcmcia_add_pseudo_device(p_dev->socket); 403 pcmcia_add_pseudo_device(p_dev->socket);
@@ -448,7 +445,6 @@ static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *le
448 return; 445 return;
449} 446}
450 447
451
452static int pcmcia_device_remove(struct device * dev) 448static int pcmcia_device_remove(struct device * dev)
453{ 449{
454 struct pcmcia_device *p_dev; 450 struct pcmcia_device *p_dev;
@@ -463,7 +459,7 @@ static int pcmcia_device_remove(struct device * dev)
463 * pseudo multi-function card, we need to unbind 459 * pseudo multi-function card, we need to unbind
464 * all devices 460 * all devices
465 */ 461 */
466 did = (struct pcmcia_device_id *) p_dev->dev.driver_data; 462 did = p_dev->dev.driver_data;
467 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && 463 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&
468 (p_dev->socket->device_count != 0) && 464 (p_dev->socket->device_count != 0) &&
469 (p_dev->device_no == 0)) 465 (p_dev->device_no == 0))
@@ -476,6 +472,8 @@ static int pcmcia_device_remove(struct device * dev)
476 if (p_drv->remove) 472 if (p_drv->remove)
477 p_drv->remove(p_dev); 473 p_drv->remove(p_dev);
478 474
475 p_dev->dev_node = NULL;
476
479 /* check for proper unloading */ 477 /* check for proper unloading */
480 if (p_dev->_irq || p_dev->_io || p_dev->_locked) 478 if (p_dev->_irq || p_dev->_io || p_dev->_locked)
481 printk(KERN_INFO "pcmcia: driver %s did not release config properly\n", 479 printk(KERN_INFO "pcmcia: driver %s did not release config properly\n",
@@ -628,7 +626,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
628 } 626 }
629 627
630 /* Add to the list in pcmcia_bus_socket */ 628 /* Add to the list in pcmcia_bus_socket */
631 list_add_tail(&p_dev->socket_device_list, &s->devices_list); 629 list_add(&p_dev->socket_device_list, &s->devices_list);
632 630
633 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); 631 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
634 632
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 45063b4e5b78..3131bb0a0095 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -88,7 +88,6 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base,
88 } 88 }
89 if ((s->features & SS_CAP_STATIC_MAP) && s->io_offset) { 89 if ((s->features & SS_CAP_STATIC_MAP) && s->io_offset) {
90 *base = s->io_offset | (*base & 0x0fff); 90 *base = s->io_offset | (*base & 0x0fff);
91 s->io[0].res->flags = (s->io[0].res->flags & ~IORESOURCE_BITS) | (attr & IORESOURCE_BITS);
92 return 0; 91 return 0;
93 } 92 }
94 /* Check for an already-allocated window that must conflict with 93 /* Check for an already-allocated window that must conflict with
@@ -209,7 +208,6 @@ int pccard_get_configuration_info(struct pcmcia_socket *s,
209 if (!(s->state & SOCKET_PRESENT)) 208 if (!(s->state & SOCKET_PRESENT))
210 return CS_NO_CARD; 209 return CS_NO_CARD;
211 210
212 config->Function = p_dev->func;
213 211
214#ifdef CONFIG_CARDBUS 212#ifdef CONFIG_CARDBUS
215 if (s->state & SOCKET_CARDBUS) { 213 if (s->state & SOCKET_CARDBUS) {
@@ -223,14 +221,22 @@ int pccard_get_configuration_info(struct pcmcia_socket *s,
223 config->AssignedIRQ = s->irq.AssignedIRQ; 221 config->AssignedIRQ = s->irq.AssignedIRQ;
224 if (config->AssignedIRQ) 222 if (config->AssignedIRQ)
225 config->Attributes |= CONF_ENABLE_IRQ; 223 config->Attributes |= CONF_ENABLE_IRQ;
226 config->BasePort1 = s->io[0].res->start; 224 if (s->io[0].res) {
227 config->NumPorts1 = s->io[0].res->end - config->BasePort1 + 1; 225 config->BasePort1 = s->io[0].res->start;
226 config->NumPorts1 = s->io[0].res->end - config->BasePort1 + 1;
227 }
228 } 228 }
229 return CS_SUCCESS; 229 return CS_SUCCESS;
230 } 230 }
231#endif 231#endif
232 232
233 c = (p_dev) ? p_dev->function_config : NULL; 233 if (p_dev) {
234 c = p_dev->function_config;
235 config->Function = p_dev->func;
236 } else {
237 c = NULL;
238 config->Function = 0;
239 }
234 240
235 if ((c == NULL) || !(c->state & CONFIG_LOCKED)) { 241 if ((c == NULL) || !(c->state & CONFIG_LOCKED)) {
236 config->Attributes = 0; 242 config->Attributes = 0;
@@ -947,7 +953,5 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev) {
947 pcmcia_release_irq(p_dev, &p_dev->irq); 953 pcmcia_release_irq(p_dev, &p_dev->irq);
948 if (&p_dev->win) 954 if (&p_dev->win)
949 pcmcia_release_window(p_dev->win); 955 pcmcia_release_window(p_dev->win);
950
951 p_dev->dev_node = NULL;
952} 956}
953EXPORT_SYMBOL(pcmcia_disable_device); 957EXPORT_SYMBOL(pcmcia_disable_device);
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 42b457030b03..0eb010a3f5bc 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1614,6 +1614,7 @@ static int activate_ep_files (struct dev_data *dev)
1614 data, &ep_config_operations, 1614 data, &ep_config_operations,
1615 &data->dentry); 1615 &data->dentry);
1616 if (!data->inode) { 1616 if (!data->inode) {
1617 usb_ep_free_request(ep, data->req);
1617 kfree (data); 1618 kfree (data);
1618 goto enomem; 1619 goto enomem;
1619 } 1620 }
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 8a2de038882e..1a27ecb46c9a 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -1,7 +1,11 @@
1Version 1.42 1Version 1.42
2------------ 2------------
3Fix slow oplock break when mounted to different servers at the same time and 3Fix slow oplock break when mounted to different servers at the same time and
4the tids match and we try to find matching fid on wrong server. 4the tids match and we try to find matching fid on wrong server. Fix read
5looping when signing required by server (2.6.16 kernel only). Fix readdir
6vs. rename race which could cause each to hang. Return . and .. even
7if server does not. Allow searches to skip first three entries and
8begin at any location. Fix oops in find_writeable_file.
5 9
6Version 1.41 10Version 1.41
7------------ 11------------
diff --git a/fs/cifs/README b/fs/cifs/README
index b2b4d0803761..0355003f4f0a 100644
--- a/fs/cifs/README
+++ b/fs/cifs/README
@@ -511,6 +511,14 @@ LinuxExtensionsEnabled If set to one then the client will attempt to
511 support and want to map the uid and gid fields 511 support and want to map the uid and gid fields
512 to values supplied at mount (rather than the 512 to values supplied at mount (rather than the
513 actual values, then set this to zero. (default 1) 513 actual values, then set this to zero. (default 1)
514Experimental When set to 1 used to enable certain experimental
515 features (currently enables multipage writes
516 when signing is enabled, the multipage write
517 performance enhancement was disabled when
518 signing turned on in case buffer was modified
519 just before it was sent, also this flag will
520 be used to use the new experimental sessionsetup
521 code).
514 522
515These experimental features and tracing can be enabled by changing flags in 523These experimental features and tracing can be enabled by changing flags in
516/proc/fs/cifs (after the cifs module has been installed or built into the 524/proc/fs/cifs (after the cifs module has been installed or built into the
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index d4b713e5affb..c262d8874ce9 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -33,6 +33,7 @@
33#include <linux/vfs.h> 33#include <linux/vfs.h>
34#include <linux/mempool.h> 34#include <linux/mempool.h>
35#include <linux/delay.h> 35#include <linux/delay.h>
36#include <linux/kthread.h>
36#include "cifsfs.h" 37#include "cifsfs.h"
37#include "cifspdu.h" 38#include "cifspdu.h"
38#define DECLARE_GLOBALS_HERE 39#define DECLARE_GLOBALS_HERE
@@ -75,9 +76,6 @@ unsigned int cifs_max_pending = CIFS_MAX_REQ;
75module_param(cifs_max_pending, int, 0); 76module_param(cifs_max_pending, int, 0);
76MODULE_PARM_DESC(cifs_max_pending,"Simultaneous requests to server. Default: 50 Range: 2 to 256"); 77MODULE_PARM_DESC(cifs_max_pending,"Simultaneous requests to server. Default: 50 Range: 2 to 256");
77 78
78static DECLARE_COMPLETION(cifs_oplock_exited);
79static DECLARE_COMPLETION(cifs_dnotify_exited);
80
81extern mempool_t *cifs_sm_req_poolp; 79extern mempool_t *cifs_sm_req_poolp;
82extern mempool_t *cifs_req_poolp; 80extern mempool_t *cifs_req_poolp;
83extern mempool_t *cifs_mid_poolp; 81extern mempool_t *cifs_mid_poolp;
@@ -841,10 +839,6 @@ static int cifs_oplock_thread(void * dummyarg)
841 __u16 netfid; 839 __u16 netfid;
842 int rc; 840 int rc;
843 841
844 daemonize("cifsoplockd");
845 allow_signal(SIGTERM);
846
847 oplockThread = current;
848 do { 842 do {
849 if (try_to_freeze()) 843 if (try_to_freeze())
850 continue; 844 continue;
@@ -900,9 +894,9 @@ static int cifs_oplock_thread(void * dummyarg)
900 set_current_state(TASK_INTERRUPTIBLE); 894 set_current_state(TASK_INTERRUPTIBLE);
901 schedule_timeout(1); /* yield in case q were corrupt */ 895 schedule_timeout(1); /* yield in case q were corrupt */
902 } 896 }
903 } while(!signal_pending(current)); 897 } while (!kthread_should_stop());
904 oplockThread = NULL; 898
905 complete_and_exit (&cifs_oplock_exited, 0); 899 return 0;
906} 900}
907 901
908static int cifs_dnotify_thread(void * dummyarg) 902static int cifs_dnotify_thread(void * dummyarg)
@@ -910,10 +904,6 @@ static int cifs_dnotify_thread(void * dummyarg)
910 struct list_head *tmp; 904 struct list_head *tmp;
911 struct cifsSesInfo *ses; 905 struct cifsSesInfo *ses;
912 906
913 daemonize("cifsdnotifyd");
914 allow_signal(SIGTERM);
915
916 dnotifyThread = current;
917 do { 907 do {
918 if(try_to_freeze()) 908 if(try_to_freeze())
919 continue; 909 continue;
@@ -931,8 +921,9 @@ static int cifs_dnotify_thread(void * dummyarg)
931 wake_up_all(&ses->server->response_q); 921 wake_up_all(&ses->server->response_q);
932 } 922 }
933 read_unlock(&GlobalSMBSeslock); 923 read_unlock(&GlobalSMBSeslock);
934 } while(!signal_pending(current)); 924 } while (!kthread_should_stop());
935 complete_and_exit (&cifs_dnotify_exited, 0); 925
926 return 0;
936} 927}
937 928
938static int __init 929static int __init
@@ -982,32 +973,48 @@ init_cifs(void)
982 } 973 }
983 974
984 rc = cifs_init_inodecache(); 975 rc = cifs_init_inodecache();
985 if (!rc) { 976 if (rc)
986 rc = cifs_init_mids(); 977 goto out_clean_proc;
987 if (!rc) { 978
988 rc = cifs_init_request_bufs(); 979 rc = cifs_init_mids();
989 if (!rc) { 980 if (rc)
990 rc = register_filesystem(&cifs_fs_type); 981 goto out_destroy_inodecache;
991 if (!rc) { 982
992 rc = (int)kernel_thread(cifs_oplock_thread, NULL, 983 rc = cifs_init_request_bufs();
993 CLONE_FS | CLONE_FILES | CLONE_VM); 984 if (rc)
994 if(rc > 0) { 985 goto out_destroy_mids;
995 rc = (int)kernel_thread(cifs_dnotify_thread, NULL, 986
996 CLONE_FS | CLONE_FILES | CLONE_VM); 987 rc = register_filesystem(&cifs_fs_type);
997 if(rc > 0) 988 if (rc)
998 return 0; 989 goto out_destroy_request_bufs;
999 else 990
1000 cERROR(1,("error %d create dnotify thread", rc)); 991 oplockThread = kthread_run(cifs_oplock_thread, NULL, "cifsoplockd");
1001 } else { 992 if (IS_ERR(oplockThread)) {
1002 cERROR(1,("error %d create oplock thread",rc)); 993 rc = PTR_ERR(oplockThread);
1003 } 994 cERROR(1,("error %d create oplock thread", rc));
1004 } 995 goto out_unregister_filesystem;
1005 cifs_destroy_request_bufs();
1006 }
1007 cifs_destroy_mids();
1008 }
1009 cifs_destroy_inodecache();
1010 } 996 }
997
998 dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd");
999 if (IS_ERR(dnotifyThread)) {
1000 rc = PTR_ERR(dnotifyThread);
1001 cERROR(1,("error %d create dnotify thread", rc));
1002 goto out_stop_oplock_thread;
1003 }
1004
1005 return 0;
1006
1007 out_stop_oplock_thread:
1008 kthread_stop(oplockThread);
1009 out_unregister_filesystem:
1010 unregister_filesystem(&cifs_fs_type);
1011 out_destroy_request_bufs:
1012 cifs_destroy_request_bufs();
1013 out_destroy_mids:
1014 cifs_destroy_mids();
1015 out_destroy_inodecache:
1016 cifs_destroy_inodecache();
1017 out_clean_proc:
1011#ifdef CONFIG_PROC_FS 1018#ifdef CONFIG_PROC_FS
1012 cifs_proc_clean(); 1019 cifs_proc_clean();
1013#endif 1020#endif
@@ -1025,14 +1032,8 @@ exit_cifs(void)
1025 cifs_destroy_inodecache(); 1032 cifs_destroy_inodecache();
1026 cifs_destroy_mids(); 1033 cifs_destroy_mids();
1027 cifs_destroy_request_bufs(); 1034 cifs_destroy_request_bufs();
1028 if(oplockThread) { 1035 kthread_stop(oplockThread);
1029 send_sig(SIGTERM, oplockThread, 1); 1036 kthread_stop(dnotifyThread);
1030 wait_for_completion(&cifs_oplock_exited);
1031 }
1032 if(dnotifyThread) {
1033 send_sig(SIGTERM, dnotifyThread, 1);
1034 wait_for_completion(&cifs_dnotify_exited);
1035 }
1036} 1037}
1037 1038
1038MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>"); 1039MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>");
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index d705500aa283..fd36892eda55 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -3119,7 +3119,7 @@ findFirstRetry:
3119 psrch_inf->endOfSearch = FALSE; 3119 psrch_inf->endOfSearch = FALSE;
3120 3120
3121 psrch_inf->entries_in_buffer = le16_to_cpu(parms->SearchCount); 3121 psrch_inf->entries_in_buffer = le16_to_cpu(parms->SearchCount);
3122 psrch_inf->index_of_last_entry = 3122 psrch_inf->index_of_last_entry = 2 /* skip . and .. */ +
3123 psrch_inf->entries_in_buffer; 3123 psrch_inf->entries_in_buffer;
3124 *pnetfid = parms->SearchHandle; 3124 *pnetfid = parms->SearchHandle;
3125 } else { 3125 } else {
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 0b86d5ca9014..d2ec806a4f32 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3447,6 +3447,12 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
3447 pSesInfo->server->secMode, 3447 pSesInfo->server->secMode,
3448 pSesInfo->server->capabilities, 3448 pSesInfo->server->capabilities,
3449 pSesInfo->server->timeZone)); 3449 pSesInfo->server->timeZone));
3450#ifdef CONFIG_CIFS_EXPERIMENTAL
3451 if(experimEnabled > 1)
3452 rc = CIFS_SessSetup(xid, pSesInfo, CIFS_NTLM /* type */,
3453 &ntlmv2_flag, nls_info);
3454 else
3455#endif
3450 if (extended_security 3456 if (extended_security
3451 && (pSesInfo->capabilities & CAP_EXTENDED_SECURITY) 3457 && (pSesInfo->capabilities & CAP_EXTENDED_SECURITY)
3452 && (pSesInfo->server->secType == NTLMSSP)) { 3458 && (pSesInfo->server->secType == NTLMSSP)) {
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 1d0ca3eaaca5..82315edc77d7 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -139,9 +139,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
139 cifs_sb = CIFS_SB(inode->i_sb); 139 cifs_sb = CIFS_SB(inode->i_sb);
140 pTcon = cifs_sb->tcon; 140 pTcon = cifs_sb->tcon;
141 141
142 mutex_lock(&direntry->d_sb->s_vfs_rename_mutex);
143 full_path = build_path_from_dentry(direntry); 142 full_path = build_path_from_dentry(direntry);
144 mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex);
145 if(full_path == NULL) { 143 if(full_path == NULL) {
146 FreeXid(xid); 144 FreeXid(xid);
147 return -ENOMEM; 145 return -ENOMEM;
@@ -316,9 +314,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
316 cifs_sb = CIFS_SB(inode->i_sb); 314 cifs_sb = CIFS_SB(inode->i_sb);
317 pTcon = cifs_sb->tcon; 315 pTcon = cifs_sb->tcon;
318 316
319 mutex_lock(&direntry->d_sb->s_vfs_rename_mutex);
320 full_path = build_path_from_dentry(direntry); 317 full_path = build_path_from_dentry(direntry);
321 mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex);
322 if(full_path == NULL) 318 if(full_path == NULL)
323 rc = -ENOMEM; 319 rc = -ENOMEM;
324 else if (pTcon->ses->capabilities & CAP_UNIX) { 320 else if (pTcon->ses->capabilities & CAP_UNIX) {
@@ -440,6 +436,20 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name
440 cifs_sb = CIFS_SB(parent_dir_inode->i_sb); 436 cifs_sb = CIFS_SB(parent_dir_inode->i_sb);
441 pTcon = cifs_sb->tcon; 437 pTcon = cifs_sb->tcon;
442 438
439 /*
440 * Don't allow the separator character in a path component.
441 * The VFS will not allow "/", but "\" is allowed by posix.
442 */
443 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) {
444 int i;
445 for (i = 0; i < direntry->d_name.len; i++)
446 if (direntry->d_name.name[i] == '\\') {
447 cFYI(1, ("Invalid file name"));
448 FreeXid(xid);
449 return ERR_PTR(-EINVAL);
450 }
451 }
452
443 /* can not grab the rename sem here since it would 453 /* can not grab the rename sem here since it would
444 deadlock in the cases (beginning of sys_rename itself) 454 deadlock in the cases (beginning of sys_rename itself)
445 in which we already have the sb rename sem */ 455 in which we already have the sb rename sem */
diff --git a/fs/cifs/fcntl.c b/fs/cifs/fcntl.c
index ec4dfe9bf5ef..633a93811328 100644
--- a/fs/cifs/fcntl.c
+++ b/fs/cifs/fcntl.c
@@ -86,9 +86,7 @@ int cifs_dir_notify(struct file * file, unsigned long arg)
86 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 86 cifs_sb = CIFS_SB(file->f_dentry->d_sb);
87 pTcon = cifs_sb->tcon; 87 pTcon = cifs_sb->tcon;
88 88
89 mutex_lock(&file->f_dentry->d_sb->s_vfs_rename_mutex);
90 full_path = build_path_from_dentry(file->f_dentry); 89 full_path = build_path_from_dentry(file->f_dentry);
91 mutex_unlock(&file->f_dentry->d_sb->s_vfs_rename_mutex);
92 90
93 if(full_path == NULL) { 91 if(full_path == NULL) {
94 rc = -ENOMEM; 92 rc = -ENOMEM;
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 5c497c529772..e152bf6afa60 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -203,9 +203,7 @@ int cifs_open(struct inode *inode, struct file *file)
203 } 203 }
204 } 204 }
205 205
206 mutex_lock(&inode->i_sb->s_vfs_rename_mutex);
207 full_path = build_path_from_dentry(file->f_dentry); 206 full_path = build_path_from_dentry(file->f_dentry);
208 mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);
209 if (full_path == NULL) { 207 if (full_path == NULL) {
210 FreeXid(xid); 208 FreeXid(xid);
211 return -ENOMEM; 209 return -ENOMEM;
@@ -906,8 +904,7 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
906 if (rc != 0) 904 if (rc != 0)
907 break; 905 break;
908 } 906 }
909 /* BB FIXME We can not sign across two buffers yet */ 907 if(experimEnabled || (pTcon->ses->server->secMode &
910 if((pTcon->ses->server->secMode &
911 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0) { 908 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0) {
912 struct kvec iov[2]; 909 struct kvec iov[2];
913 unsigned int len; 910 unsigned int len;
@@ -923,13 +920,13 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
923 *poffset, &bytes_written, 920 *poffset, &bytes_written,
924 iov, 1, long_op); 921 iov, 1, long_op);
925 } else 922 } else
926 /* BB FIXME fixup indentation of line below */ 923 rc = CIFSSMBWrite(xid, pTcon,
927 rc = CIFSSMBWrite(xid, pTcon, 924 open_file->netfid,
928 open_file->netfid, 925 min_t(const int, cifs_sb->wsize,
929 min_t(const int, cifs_sb->wsize, 926 write_size - total_written),
930 write_size - total_written), 927 *poffset, &bytes_written,
931 *poffset, &bytes_written, 928 write_data + total_written,
932 write_data + total_written, NULL, long_op); 929 NULL, long_op);
933 } 930 }
934 if (rc || (bytes_written == 0)) { 931 if (rc || (bytes_written == 0)) {
935 if (total_written) 932 if (total_written)
@@ -968,6 +965,16 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode)
968 struct cifsFileInfo *open_file; 965 struct cifsFileInfo *open_file;
969 int rc; 966 int rc;
970 967
968 /* Having a null inode here (because mapping->host was set to zero by
969 the VFS or MM) should not happen but we had reports of on oops (due to
970 it being zero) during stress testcases so we need to check for it */
971
972 if(cifs_inode == NULL) {
973 cERROR(1,("Null inode passed to cifs_writeable_file"));
974 dump_stack();
975 return NULL;
976 }
977
971 read_lock(&GlobalSMBSeslock); 978 read_lock(&GlobalSMBSeslock);
972 list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { 979 list_for_each_entry(open_file, &cifs_inode->openFileList, flist) {
973 if (open_file->closePend) 980 if (open_file->closePend)
@@ -1093,12 +1100,11 @@ static int cifs_writepages(struct address_space *mapping,
1093 if (cifs_sb->wsize < PAGE_CACHE_SIZE) 1100 if (cifs_sb->wsize < PAGE_CACHE_SIZE)
1094 return generic_writepages(mapping, wbc); 1101 return generic_writepages(mapping, wbc);
1095 1102
1096 /* BB FIXME we do not have code to sign across multiple buffers yet,
1097 so go to older writepage style write which we can sign if needed */
1098 if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server)) 1103 if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server))
1099 if(cifs_sb->tcon->ses->server->secMode & 1104 if(cifs_sb->tcon->ses->server->secMode &
1100 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) 1105 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED))
1101 return generic_writepages(mapping, wbc); 1106 if(!experimEnabled)
1107 return generic_writepages(mapping, wbc);
1102 1108
1103 /* 1109 /*
1104 * BB: Is this meaningful for a non-block-device file system? 1110 * BB: Is this meaningful for a non-block-device file system?
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 957ddd1571c6..4093764ef461 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -722,9 +722,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
722 cifs_sb = CIFS_SB(inode->i_sb); 722 cifs_sb = CIFS_SB(inode->i_sb);
723 pTcon = cifs_sb->tcon; 723 pTcon = cifs_sb->tcon;
724 724
725 mutex_lock(&inode->i_sb->s_vfs_rename_mutex);
726 full_path = build_path_from_dentry(direntry); 725 full_path = build_path_from_dentry(direntry);
727 mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);
728 if (full_path == NULL) { 726 if (full_path == NULL) {
729 FreeXid(xid); 727 FreeXid(xid);
730 return -ENOMEM; 728 return -ENOMEM;
@@ -807,9 +805,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
807 cifs_sb = CIFS_SB(inode->i_sb); 805 cifs_sb = CIFS_SB(inode->i_sb);
808 pTcon = cifs_sb->tcon; 806 pTcon = cifs_sb->tcon;
809 807
810 mutex_lock(&inode->i_sb->s_vfs_rename_mutex);
811 full_path = build_path_from_dentry(direntry); 808 full_path = build_path_from_dentry(direntry);
812 mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);
813 if (full_path == NULL) { 809 if (full_path == NULL) {
814 FreeXid(xid); 810 FreeXid(xid);
815 return -ENOMEM; 811 return -ENOMEM;
@@ -1141,9 +1137,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1141 rc = 0; 1137 rc = 0;
1142 } 1138 }
1143 1139
1144 mutex_lock(&direntry->d_sb->s_vfs_rename_mutex);
1145 full_path = build_path_from_dentry(direntry); 1140 full_path = build_path_from_dentry(direntry);
1146 mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex);
1147 if (full_path == NULL) { 1141 if (full_path == NULL) {
1148 FreeXid(xid); 1142 FreeXid(xid);
1149 return -ENOMEM; 1143 return -ENOMEM;
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 9562f5bba65c..2ec99f833142 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -48,10 +48,8 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
48/* No need to check for cross device links since server will do that 48/* No need to check for cross device links since server will do that
49 BB note DFS case in future though (when we may have to check) */ 49 BB note DFS case in future though (when we may have to check) */
50 50
51 mutex_lock(&inode->i_sb->s_vfs_rename_mutex);
52 fromName = build_path_from_dentry(old_file); 51 fromName = build_path_from_dentry(old_file);
53 toName = build_path_from_dentry(direntry); 52 toName = build_path_from_dentry(direntry);
54 mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);
55 if((fromName == NULL) || (toName == NULL)) { 53 if((fromName == NULL) || (toName == NULL)) {
56 rc = -ENOMEM; 54 rc = -ENOMEM;
57 goto cifs_hl_exit; 55 goto cifs_hl_exit;
@@ -103,9 +101,7 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
103 101
104 xid = GetXid(); 102 xid = GetXid();
105 103
106 mutex_lock(&direntry->d_sb->s_vfs_rename_mutex);
107 full_path = build_path_from_dentry(direntry); 104 full_path = build_path_from_dentry(direntry);
108 mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex);
109 105
110 if (!full_path) 106 if (!full_path)
111 goto out_no_free; 107 goto out_no_free;
@@ -164,9 +160,7 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
164 cifs_sb = CIFS_SB(inode->i_sb); 160 cifs_sb = CIFS_SB(inode->i_sb);
165 pTcon = cifs_sb->tcon; 161 pTcon = cifs_sb->tcon;
166 162
167 mutex_lock(&inode->i_sb->s_vfs_rename_mutex);
168 full_path = build_path_from_dentry(direntry); 163 full_path = build_path_from_dentry(direntry);
169 mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);
170 164
171 if(full_path == NULL) { 165 if(full_path == NULL) {
172 FreeXid(xid); 166 FreeXid(xid);
diff --git a/fs/cifs/ntlmssp.c b/fs/cifs/ntlmssp.c
index 78866f925747..115359cc7a32 100644
--- a/fs/cifs/ntlmssp.c
+++ b/fs/cifs/ntlmssp.c
@@ -121,6 +121,20 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, const int type,
121 } 121 }
122 122
123 123
124 /* copy session key */
125
126 /* if Unicode, align strings to two byte boundary */
127
128 /* copy user name */ /* BB Do we need to special case null user name? */
129
130 /* copy domain name */
131
132 /* copy Linux version */
133
134 /* copy network operating system name */
135
136 /* update bcc and smb buffer length */
137
124/* rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buf_type, 0); */ 138/* rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buf_type, 0); */
125 /* SMB request buf freed in SendReceive2 */ 139 /* SMB request buf freed in SendReceive2 */
126 140
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 2f6e2825571e..b689c5035124 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -404,9 +404,7 @@ static int initiate_cifs_search(const int xid, struct file *file)
404 if(pTcon == NULL) 404 if(pTcon == NULL)
405 return -EINVAL; 405 return -EINVAL;
406 406
407 mutex_lock(&file->f_dentry->d_sb->s_vfs_rename_mutex);
408 full_path = build_path_from_dentry(file->f_dentry); 407 full_path = build_path_from_dentry(file->f_dentry);
409 mutex_unlock(&file->f_dentry->d_sb->s_vfs_rename_mutex);
410 408
411 if(full_path == NULL) { 409 if(full_path == NULL) {
412 return -ENOMEM; 410 return -ENOMEM;
@@ -592,6 +590,13 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
592 first_entry_in_buffer = 590 first_entry_in_buffer =
593 cifsFile->srch_inf.index_of_last_entry - 591 cifsFile->srch_inf.index_of_last_entry -
594 cifsFile->srch_inf.entries_in_buffer; 592 cifsFile->srch_inf.entries_in_buffer;
593
594 /* if first entry in buf is zero then is first buffer
595 in search response data which means it is likely . and ..
596 will be in this buffer, although some servers do not return
597 . and .. for the root of a drive and for those we need
598 to start two entries earlier */
599
595/* dump_cifs_file_struct(file, "In fce ");*/ 600/* dump_cifs_file_struct(file, "In fce ");*/
596 if(((index_to_find < cifsFile->srch_inf.index_of_last_entry) && 601 if(((index_to_find < cifsFile->srch_inf.index_of_last_entry) &&
597 is_dir_changed(file)) || 602 is_dir_changed(file)) ||
@@ -634,23 +639,14 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
634 char * end_of_smb = cifsFile->srch_inf.ntwrk_buf_start + 639 char * end_of_smb = cifsFile->srch_inf.ntwrk_buf_start +
635 smbCalcSize((struct smb_hdr *) 640 smbCalcSize((struct smb_hdr *)
636 cifsFile->srch_inf.ntwrk_buf_start); 641 cifsFile->srch_inf.ntwrk_buf_start);
642
643 current_entry = cifsFile->srch_inf.srch_entries_start;
637 first_entry_in_buffer = cifsFile->srch_inf.index_of_last_entry 644 first_entry_in_buffer = cifsFile->srch_inf.index_of_last_entry
638 - cifsFile->srch_inf.entries_in_buffer; 645 - cifsFile->srch_inf.entries_in_buffer;
639 pos_in_buf = index_to_find - first_entry_in_buffer; 646 pos_in_buf = index_to_find - first_entry_in_buffer;
640 cFYI(1,("found entry - pos_in_buf %d",pos_in_buf)); 647 cFYI(1,("found entry - pos_in_buf %d",pos_in_buf));
641 current_entry = cifsFile->srch_inf.srch_entries_start;
642 for(i=0;(i<(pos_in_buf)) && (current_entry != NULL);i++) { 648 for(i=0;(i<(pos_in_buf)) && (current_entry != NULL);i++) {
643 /* go entry by entry figuring out which is first */ 649 /* go entry by entry figuring out which is first */
644 /* if( . or ..)
645 skip */
646 rc = cifs_entry_is_dot(current_entry,cifsFile);
647 if(rc == 1) /* is . or .. so skip */ {
648 cFYI(1,("Entry is .")); /* BB removeme BB */
649 /* continue; */
650 } else if (rc == 2 ) {
651 cFYI(1,("Entry is ..")); /* BB removeme BB */
652 /* continue; */
653 }
654 current_entry = nxt_dir_entry(current_entry,end_of_smb); 650 current_entry = nxt_dir_entry(current_entry,end_of_smb);
655 } 651 }
656 if((current_entry == NULL) && (i < pos_in_buf)) { 652 if((current_entry == NULL) && (i < pos_in_buf)) {
@@ -770,6 +766,11 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
770 if(file->f_dentry == NULL) 766 if(file->f_dentry == NULL)
771 return -ENOENT; 767 return -ENOENT;
772 768
769 rc = cifs_entry_is_dot(pfindEntry,pCifsF);
770 /* skip . and .. since we added them first */
771 if(rc != 0)
772 return 0;
773
773 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 774 cifs_sb = CIFS_SB(file->f_dentry->d_sb);
774 775
775 qstring.name = scratch_buf; 776 qstring.name = scratch_buf;
@@ -898,22 +899,22 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
898 899
899 switch ((int) file->f_pos) { 900 switch ((int) file->f_pos) {
900 case 0: 901 case 0:
901 /*if (filldir(direntry, ".", 1, file->f_pos, 902 if (filldir(direntry, ".", 1, file->f_pos,
902 file->f_dentry->d_inode->i_ino, DT_DIR) < 0) { 903 file->f_dentry->d_inode->i_ino, DT_DIR) < 0) {
903 cERROR(1, ("Filldir for current dir failed ")); 904 cERROR(1, ("Filldir for current dir failed"));
904 rc = -ENOMEM; 905 rc = -ENOMEM;
905 break; 906 break;
906 } 907 }
907 file->f_pos++; */ 908 file->f_pos++;
908 case 1: 909 case 1:
909 /* if (filldir(direntry, "..", 2, file->f_pos, 910 if (filldir(direntry, "..", 2, file->f_pos,
910 file->f_dentry->d_parent->d_inode->i_ino, DT_DIR) < 0) { 911 file->f_dentry->d_parent->d_inode->i_ino, DT_DIR) < 0) {
911 cERROR(1, ("Filldir for parent dir failed ")); 912 cERROR(1, ("Filldir for parent dir failed "));
912 rc = -ENOMEM; 913 rc = -ENOMEM;
913 break; 914 break;
914 } 915 }
915 file->f_pos++; */ 916 file->f_pos++;
916 case 2: 917 default:
917 /* 1) If search is active, 918 /* 1) If search is active,
918 is in current search buffer? 919 is in current search buffer?
919 if it before then restart search 920 if it before then restart search
@@ -927,7 +928,6 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
927 return rc; 928 return rc;
928 } 929 }
929 } 930 }
930 default:
931 if(file->private_data == NULL) { 931 if(file->private_data == NULL) {
932 rc = -EINVAL; 932 rc = -EINVAL;
933 FreeXid(xid); 933 FreeXid(xid);
@@ -947,8 +947,6 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
947 kfree(cifsFile->search_resume_name); 947 kfree(cifsFile->search_resume_name);
948 cifsFile->search_resume_name = NULL; */ 948 cifsFile->search_resume_name = NULL; */
949 949
950 /* BB account for . and .. in f_pos as special case */
951
952 rc = find_cifs_entry(xid,pTcon, file, 950 rc = find_cifs_entry(xid,pTcon, file,
953 &current_entry,&num_to_fill); 951 &current_entry,&num_to_fill);
954 if(rc) { 952 if(rc) {
@@ -977,7 +975,8 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
977 num_to_fill, i)); 975 num_to_fill, i));
978 break; 976 break;
979 } 977 }
980 978 /* if buggy server returns . and .. late do
979 we want to check for that here? */
981 rc = cifs_filldir(current_entry, file, 980 rc = cifs_filldir(current_entry, file,
982 filldir, direntry,tmp_buf); 981 filldir, direntry,tmp_buf);
983 file->f_pos++; 982 file->f_pos++;
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
index 3938444d87b2..7754d641775e 100644
--- a/fs/cifs/xattr.c
+++ b/fs/cifs/xattr.c
@@ -62,9 +62,7 @@ int cifs_removexattr(struct dentry * direntry, const char * ea_name)
62 cifs_sb = CIFS_SB(sb); 62 cifs_sb = CIFS_SB(sb);
63 pTcon = cifs_sb->tcon; 63 pTcon = cifs_sb->tcon;
64 64
65 mutex_lock(&sb->s_vfs_rename_mutex);
66 full_path = build_path_from_dentry(direntry); 65 full_path = build_path_from_dentry(direntry);
67 mutex_unlock(&sb->s_vfs_rename_mutex);
68 if(full_path == NULL) { 66 if(full_path == NULL) {
69 FreeXid(xid); 67 FreeXid(xid);
70 return -ENOMEM; 68 return -ENOMEM;
@@ -116,9 +114,7 @@ int cifs_setxattr(struct dentry * direntry, const char * ea_name,
116 cifs_sb = CIFS_SB(sb); 114 cifs_sb = CIFS_SB(sb);
117 pTcon = cifs_sb->tcon; 115 pTcon = cifs_sb->tcon;
118 116
119 mutex_lock(&sb->s_vfs_rename_mutex);
120 full_path = build_path_from_dentry(direntry); 117 full_path = build_path_from_dentry(direntry);
121 mutex_unlock(&sb->s_vfs_rename_mutex);
122 if(full_path == NULL) { 118 if(full_path == NULL) {
123 FreeXid(xid); 119 FreeXid(xid);
124 return -ENOMEM; 120 return -ENOMEM;
@@ -223,9 +219,7 @@ ssize_t cifs_getxattr(struct dentry * direntry, const char * ea_name,
223 cifs_sb = CIFS_SB(sb); 219 cifs_sb = CIFS_SB(sb);
224 pTcon = cifs_sb->tcon; 220 pTcon = cifs_sb->tcon;
225 221
226 mutex_lock(&sb->s_vfs_rename_mutex);
227 full_path = build_path_from_dentry(direntry); 222 full_path = build_path_from_dentry(direntry);
228 mutex_unlock(&sb->s_vfs_rename_mutex);
229 if(full_path == NULL) { 223 if(full_path == NULL) {
230 FreeXid(xid); 224 FreeXid(xid);
231 return -ENOMEM; 225 return -ENOMEM;
@@ -341,9 +335,7 @@ ssize_t cifs_listxattr(struct dentry * direntry, char * data, size_t buf_size)
341 cifs_sb = CIFS_SB(sb); 335 cifs_sb = CIFS_SB(sb);
342 pTcon = cifs_sb->tcon; 336 pTcon = cifs_sb->tcon;
343 337
344 mutex_lock(&sb->s_vfs_rename_mutex);
345 full_path = build_path_from_dentry(direntry); 338 full_path = build_path_from_dentry(direntry);
346 mutex_unlock(&sb->s_vfs_rename_mutex);
347 if(full_path == NULL) { 339 if(full_path == NULL) {
348 FreeXid(xid); 340 FreeXid(xid);
349 return -ENOMEM; 341 return -ENOMEM;
diff --git a/fs/compat.c b/fs/compat.c
index 7f8e26ea427c..2e32bd340474 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1217,6 +1217,10 @@ static ssize_t compat_do_readv_writev(int type, struct file *file,
1217 if (ret < 0) 1217 if (ret < 0)
1218 goto out; 1218 goto out;
1219 1219
1220 ret = security_file_permission(file, type == READ ? MAY_READ:MAY_WRITE);
1221 if (ret)
1222 goto out;
1223
1220 fnv = NULL; 1224 fnv = NULL;
1221 if (type == READ) { 1225 if (type == READ) {
1222 fn = file->f_op->read; 1226 fn = file->f_op->read;
diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c
index aaf1da17b6d4..8c22aa9a7fbb 100644
--- a/fs/ext3/ioctl.c
+++ b/fs/ext3/ioctl.c
@@ -48,6 +48,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
48 if (!S_ISDIR(inode->i_mode)) 48 if (!S_ISDIR(inode->i_mode))
49 flags &= ~EXT3_DIRSYNC_FL; 49 flags &= ~EXT3_DIRSYNC_FL;
50 50
51 mutex_lock(&inode->i_mutex);
51 oldflags = ei->i_flags; 52 oldflags = ei->i_flags;
52 53
53 /* The JOURNAL_DATA flag is modifiable only by root */ 54 /* The JOURNAL_DATA flag is modifiable only by root */
@@ -60,8 +61,10 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
60 * This test looks nicer. Thanks to Pauline Middelink 61 * This test looks nicer. Thanks to Pauline Middelink
61 */ 62 */
62 if ((flags ^ oldflags) & (EXT3_APPEND_FL | EXT3_IMMUTABLE_FL)) { 63 if ((flags ^ oldflags) & (EXT3_APPEND_FL | EXT3_IMMUTABLE_FL)) {
63 if (!capable(CAP_LINUX_IMMUTABLE)) 64 if (!capable(CAP_LINUX_IMMUTABLE)) {
65 mutex_unlock(&inode->i_mutex);
64 return -EPERM; 66 return -EPERM;
67 }
65 } 68 }
66 69
67 /* 70 /*
@@ -69,14 +72,18 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
69 * the relevant capability. 72 * the relevant capability.
70 */ 73 */
71 if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL)) { 74 if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL)) {
72 if (!capable(CAP_SYS_RESOURCE)) 75 if (!capable(CAP_SYS_RESOURCE)) {
76 mutex_unlock(&inode->i_mutex);
73 return -EPERM; 77 return -EPERM;
78 }
74 } 79 }
75 80
76 81
77 handle = ext3_journal_start(inode, 1); 82 handle = ext3_journal_start(inode, 1);
78 if (IS_ERR(handle)) 83 if (IS_ERR(handle)) {
84 mutex_unlock(&inode->i_mutex);
79 return PTR_ERR(handle); 85 return PTR_ERR(handle);
86 }
80 if (IS_SYNC(inode)) 87 if (IS_SYNC(inode))
81 handle->h_sync = 1; 88 handle->h_sync = 1;
82 err = ext3_reserve_inode_write(handle, inode, &iloc); 89 err = ext3_reserve_inode_write(handle, inode, &iloc);
@@ -93,11 +100,14 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
93 err = ext3_mark_iloc_dirty(handle, inode, &iloc); 100 err = ext3_mark_iloc_dirty(handle, inode, &iloc);
94flags_err: 101flags_err:
95 ext3_journal_stop(handle); 102 ext3_journal_stop(handle);
96 if (err) 103 if (err) {
104 mutex_unlock(&inode->i_mutex);
97 return err; 105 return err;
106 }
98 107
99 if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL)) 108 if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL))
100 err = ext3_change_inode_journal_flag(inode, jflag); 109 err = ext3_change_inode_journal_flag(inode, jflag);
110 mutex_unlock(&inode->i_mutex);
101 return err; 111 return err;
102 } 112 }
103 case EXT3_IOC_GETVERSION: 113 case EXT3_IOC_GETVERSION:
diff --git a/fs/ext3/resize.c b/fs/ext3/resize.c
index c5ffa8523968..8aac5334680d 100644
--- a/fs/ext3/resize.c
+++ b/fs/ext3/resize.c
@@ -213,7 +213,7 @@ static int setup_new_group_blocks(struct super_block *sb,
213 goto exit_bh; 213 goto exit_bh;
214 } 214 }
215 lock_buffer(bh); 215 lock_buffer(bh);
216 memcpy(gdb->b_data, sbi->s_group_desc[i], bh->b_size); 216 memcpy(gdb->b_data, sbi->s_group_desc[i]->b_data, bh->b_size);
217 set_buffer_uptodate(gdb); 217 set_buffer_uptodate(gdb);
218 unlock_buffer(bh); 218 unlock_buffer(bh);
219 ext3_journal_dirty_metadata(handle, gdb); 219 ext3_journal_dirty_metadata(handle, gdb);
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index cc750c68fe70..104a62dadb94 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -128,14 +128,24 @@ void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req)
128 } 128 }
129} 129}
130 130
131void fuse_remove_background(struct fuse_conn *fc, struct fuse_req *req) 131/*
132 * Called with sbput_sem held for read (request_end) or write
133 * (fuse_put_super). By the time fuse_put_super() is finished, all
134 * inodes belonging to background requests must be released, so the
135 * iputs have to be done within the locked region.
136 */
137void fuse_release_background(struct fuse_conn *fc, struct fuse_req *req)
132{ 138{
133 list_del_init(&req->bg_entry); 139 iput(req->inode);
140 iput(req->inode2);
141 spin_lock(&fc->lock);
142 list_del(&req->bg_entry);
134 if (fc->num_background == FUSE_MAX_BACKGROUND) { 143 if (fc->num_background == FUSE_MAX_BACKGROUND) {
135 fc->blocked = 0; 144 fc->blocked = 0;
136 wake_up_all(&fc->blocked_waitq); 145 wake_up_all(&fc->blocked_waitq);
137 } 146 }
138 fc->num_background--; 147 fc->num_background--;
148 spin_unlock(&fc->lock);
139} 149}
140 150
141/* 151/*
@@ -165,27 +175,22 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
165 wake_up(&req->waitq); 175 wake_up(&req->waitq);
166 fuse_put_request(fc, req); 176 fuse_put_request(fc, req);
167 } else { 177 } else {
168 struct inode *inode = req->inode;
169 struct inode *inode2 = req->inode2;
170 struct file *file = req->file;
171 void (*end) (struct fuse_conn *, struct fuse_req *) = req->end; 178 void (*end) (struct fuse_conn *, struct fuse_req *) = req->end;
172 req->end = NULL; 179 req->end = NULL;
173 req->inode = NULL;
174 req->inode2 = NULL;
175 req->file = NULL;
176 if (!list_empty(&req->bg_entry))
177 fuse_remove_background(fc, req);
178 spin_unlock(&fc->lock); 180 spin_unlock(&fc->lock);
181 down_read(&fc->sbput_sem);
182 if (fc->mounted)
183 fuse_release_background(fc, req);
184 up_read(&fc->sbput_sem);
185
186 /* fput must go outside sbput_sem, otherwise it can deadlock */
187 if (req->file)
188 fput(req->file);
179 189
180 if (end) 190 if (end)
181 end(fc, req); 191 end(fc, req);
182 else 192 else
183 fuse_put_request(fc, req); 193 fuse_put_request(fc, req);
184
185 if (file)
186 fput(file);
187 iput(inode);
188 iput(inode2);
189 } 194 }
190} 195}
191 196
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 59661c481d9d..0474202cb5dc 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -258,9 +258,15 @@ struct fuse_conn {
258 /** waitq for blocked connection */ 258 /** waitq for blocked connection */
259 wait_queue_head_t blocked_waitq; 259 wait_queue_head_t blocked_waitq;
260 260
261 /** RW semaphore for exclusion with fuse_put_super() */
262 struct rw_semaphore sbput_sem;
263
261 /** The next unique request id */ 264 /** The next unique request id */
262 u64 reqctr; 265 u64 reqctr;
263 266
267 /** Mount is active */
268 unsigned mounted;
269
264 /** Connection established, cleared on umount, connection 270 /** Connection established, cleared on umount, connection
265 abort and device release */ 271 abort and device release */
266 unsigned connected; 272 unsigned connected;
@@ -471,11 +477,11 @@ void request_send_noreply(struct fuse_conn *fc, struct fuse_req *req);
471void request_send_background(struct fuse_conn *fc, struct fuse_req *req); 477void request_send_background(struct fuse_conn *fc, struct fuse_req *req);
472 478
473/** 479/**
474 * Remove request from the the background list 480 * Release inodes and file associated with background request
475 */ 481 */
476void fuse_remove_background(struct fuse_conn *fc, struct fuse_req *req); 482void fuse_release_background(struct fuse_conn *fc, struct fuse_req *req);
477 483
478/** Abort all requests */ 484/* Abort all requests */
479void fuse_abort_conn(struct fuse_conn *fc); 485void fuse_abort_conn(struct fuse_conn *fc);
480 486
481/** 487/**
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 43a6fc0db8a7..7627022446b2 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -204,26 +204,17 @@ static void fuse_put_super(struct super_block *sb)
204{ 204{
205 struct fuse_conn *fc = get_fuse_conn_super(sb); 205 struct fuse_conn *fc = get_fuse_conn_super(sb);
206 206
207 down_write(&fc->sbput_sem);
208 while (!list_empty(&fc->background))
209 fuse_release_background(fc,
210 list_entry(fc->background.next,
211 struct fuse_req, bg_entry));
212
207 spin_lock(&fc->lock); 213 spin_lock(&fc->lock);
214 fc->mounted = 0;
208 fc->connected = 0; 215 fc->connected = 0;
209 while (!list_empty(&fc->background)) {
210 struct fuse_req *req = list_entry(fc->background.next,
211 struct fuse_req, bg_entry);
212 struct inode *inode = req->inode;
213 struct inode *inode2 = req->inode2;
214
215 /* File would hold a reference to vfsmount */
216 BUG_ON(req->file);
217 req->inode = NULL;
218 req->inode2 = NULL;
219 fuse_remove_background(fc, req);
220
221 spin_unlock(&fc->lock);
222 iput(inode);
223 iput(inode2);
224 spin_lock(&fc->lock);
225 }
226 spin_unlock(&fc->lock); 216 spin_unlock(&fc->lock);
217 up_write(&fc->sbput_sem);
227 /* Flush all readers on this fs */ 218 /* Flush all readers on this fs */
228 kill_fasync(&fc->fasync, SIGIO, POLL_IN); 219 kill_fasync(&fc->fasync, SIGIO, POLL_IN);
229 wake_up_all(&fc->waitq); 220 wake_up_all(&fc->waitq);
@@ -395,6 +386,7 @@ static struct fuse_conn *new_conn(void)
395 INIT_LIST_HEAD(&fc->processing); 386 INIT_LIST_HEAD(&fc->processing);
396 INIT_LIST_HEAD(&fc->io); 387 INIT_LIST_HEAD(&fc->io);
397 INIT_LIST_HEAD(&fc->background); 388 INIT_LIST_HEAD(&fc->background);
389 init_rwsem(&fc->sbput_sem);
398 kobj_set_kset_s(fc, connections_subsys); 390 kobj_set_kset_s(fc, connections_subsys);
399 kobject_init(&fc->kobj); 391 kobject_init(&fc->kobj);
400 atomic_set(&fc->num_waiting, 0); 392 atomic_set(&fc->num_waiting, 0);
@@ -508,11 +500,6 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
508 if (file->f_op != &fuse_dev_operations) 500 if (file->f_op != &fuse_dev_operations)
509 return -EINVAL; 501 return -EINVAL;
510 502
511 /* Setting file->private_data can't race with other mount()
512 instances, since BKL is held for ->get_sb() */
513 if (file->private_data)
514 return -EINVAL;
515
516 fc = new_conn(); 503 fc = new_conn();
517 if (!fc) 504 if (!fc)
518 return -ENOMEM; 505 return -ENOMEM;
@@ -548,7 +535,14 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
548 if (err) 535 if (err)
549 goto err_free_req; 536 goto err_free_req;
550 537
538 /* Setting file->private_data can't race with other mount()
539 instances, since BKL is held for ->get_sb() */
540 err = -EINVAL;
541 if (file->private_data)
542 goto err_kobject_del;
543
551 sb->s_root = root_dentry; 544 sb->s_root = root_dentry;
545 fc->mounted = 1;
552 fc->connected = 1; 546 fc->connected = 1;
553 kobject_get(&fc->kobj); 547 kobject_get(&fc->kobj);
554 file->private_data = fc; 548 file->private_data = fc;
@@ -563,6 +557,8 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
563 557
564 return 0; 558 return 0;
565 559
560 err_kobject_del:
561 kobject_del(&fc->kobj);
566 err_free_req: 562 err_free_req:
567 fuse_request_free(init_req); 563 fuse_request_free(init_req);
568 err_put_root: 564 err_put_root:
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c
index 58c418fbca2c..97ae1b92bc47 100644
--- a/fs/reiserfs/xattr_acl.c
+++ b/fs/reiserfs/xattr_acl.c
@@ -408,8 +408,9 @@ int reiserfs_cache_default_acl(struct inode *inode)
408 acl = reiserfs_get_acl(inode, ACL_TYPE_DEFAULT); 408 acl = reiserfs_get_acl(inode, ACL_TYPE_DEFAULT);
409 reiserfs_read_unlock_xattrs(inode->i_sb); 409 reiserfs_read_unlock_xattrs(inode->i_sb);
410 reiserfs_read_unlock_xattr_i(inode); 410 reiserfs_read_unlock_xattr_i(inode);
411 ret = acl ? 1 : 0; 411 ret = (acl && !IS_ERR(acl));
412 posix_acl_release(acl); 412 if (ret)
413 posix_acl_release(acl);
413 } 414 }
414 415
415 return ret; 416 return ret;
diff --git a/fs/splice.c b/fs/splice.c
index 0559e7577a04..447ebc0a37f3 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -27,15 +27,22 @@
27#include <linux/buffer_head.h> 27#include <linux/buffer_head.h>
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/syscalls.h> 29#include <linux/syscalls.h>
30#include <linux/uio.h>
31
32struct partial_page {
33 unsigned int offset;
34 unsigned int len;
35};
30 36
31/* 37/*
32 * Passed to the actors 38 * Passed to splice_to_pipe
33 */ 39 */
34struct splice_desc { 40struct splice_pipe_desc {
35 unsigned int len, total_len; /* current and remaining length */ 41 struct page **pages; /* page map */
42 struct partial_page *partial; /* pages[] may not be contig */
43 int nr_pages; /* number of pages in map */
36 unsigned int flags; /* splice flags */ 44 unsigned int flags; /* splice flags */
37 struct file *file; /* file to read/write */ 45 struct pipe_buf_operations *ops;/* ops associated with output pipe */
38 loff_t pos; /* file position */
39}; 46};
40 47
41/* 48/*
@@ -128,6 +135,19 @@ static void page_cache_pipe_buf_unmap(struct pipe_inode_info *info,
128 kunmap(buf->page); 135 kunmap(buf->page);
129} 136}
130 137
138static void *user_page_pipe_buf_map(struct file *file,
139 struct pipe_inode_info *pipe,
140 struct pipe_buffer *buf)
141{
142 return kmap(buf->page);
143}
144
145static void user_page_pipe_buf_unmap(struct pipe_inode_info *pipe,
146 struct pipe_buffer *buf)
147{
148 kunmap(buf->page);
149}
150
131static void page_cache_pipe_buf_get(struct pipe_inode_info *info, 151static void page_cache_pipe_buf_get(struct pipe_inode_info *info,
132 struct pipe_buffer *buf) 152 struct pipe_buffer *buf)
133{ 153{
@@ -143,19 +163,33 @@ static struct pipe_buf_operations page_cache_pipe_buf_ops = {
143 .get = page_cache_pipe_buf_get, 163 .get = page_cache_pipe_buf_get,
144}; 164};
145 165
166static int user_page_pipe_buf_steal(struct pipe_inode_info *pipe,
167 struct pipe_buffer *buf)
168{
169 return 1;
170}
171
172static struct pipe_buf_operations user_page_pipe_buf_ops = {
173 .can_merge = 0,
174 .map = user_page_pipe_buf_map,
175 .unmap = user_page_pipe_buf_unmap,
176 .release = page_cache_pipe_buf_release,
177 .steal = user_page_pipe_buf_steal,
178 .get = page_cache_pipe_buf_get,
179};
180
146/* 181/*
147 * Pipe output worker. This sets up our pipe format with the page cache 182 * Pipe output worker. This sets up our pipe format with the page cache
148 * pipe buffer operations. Otherwise very similar to the regular pipe_writev(). 183 * pipe buffer operations. Otherwise very similar to the regular pipe_writev().
149 */ 184 */
150static ssize_t move_to_pipe(struct pipe_inode_info *pipe, struct page **pages, 185static ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
151 int nr_pages, unsigned long len, 186 struct splice_pipe_desc *spd)
152 unsigned int offset, unsigned int flags)
153{ 187{
154 int ret, do_wakeup, i; 188 int ret, do_wakeup, page_nr;
155 189
156 ret = 0; 190 ret = 0;
157 do_wakeup = 0; 191 do_wakeup = 0;
158 i = 0; 192 page_nr = 0;
159 193
160 if (pipe->inode) 194 if (pipe->inode)
161 mutex_lock(&pipe->inode->i_mutex); 195 mutex_lock(&pipe->inode->i_mutex);
@@ -171,27 +205,19 @@ static ssize_t move_to_pipe(struct pipe_inode_info *pipe, struct page **pages,
171 if (pipe->nrbufs < PIPE_BUFFERS) { 205 if (pipe->nrbufs < PIPE_BUFFERS) {
172 int newbuf = (pipe->curbuf + pipe->nrbufs) & (PIPE_BUFFERS - 1); 206 int newbuf = (pipe->curbuf + pipe->nrbufs) & (PIPE_BUFFERS - 1);
173 struct pipe_buffer *buf = pipe->bufs + newbuf; 207 struct pipe_buffer *buf = pipe->bufs + newbuf;
174 struct page *page = pages[i++];
175 unsigned long this_len;
176 208
177 this_len = PAGE_CACHE_SIZE - offset; 209 buf->page = spd->pages[page_nr];
178 if (this_len > len) 210 buf->offset = spd->partial[page_nr].offset;
179 this_len = len; 211 buf->len = spd->partial[page_nr].len;
180 212 buf->ops = spd->ops;
181 buf->page = page;
182 buf->offset = offset;
183 buf->len = this_len;
184 buf->ops = &page_cache_pipe_buf_ops;
185 pipe->nrbufs++; 213 pipe->nrbufs++;
214 page_nr++;
215 ret += buf->len;
216
186 if (pipe->inode) 217 if (pipe->inode)
187 do_wakeup = 1; 218 do_wakeup = 1;
188 219
189 ret += this_len; 220 if (!--spd->nr_pages)
190 len -= this_len;
191 offset = 0;
192 if (!--nr_pages)
193 break;
194 if (!len)
195 break; 221 break;
196 if (pipe->nrbufs < PIPE_BUFFERS) 222 if (pipe->nrbufs < PIPE_BUFFERS)
197 continue; 223 continue;
@@ -199,7 +225,7 @@ static ssize_t move_to_pipe(struct pipe_inode_info *pipe, struct page **pages,
199 break; 225 break;
200 } 226 }
201 227
202 if (flags & SPLICE_F_NONBLOCK) { 228 if (spd->flags & SPLICE_F_NONBLOCK) {
203 if (!ret) 229 if (!ret)
204 ret = -EAGAIN; 230 ret = -EAGAIN;
205 break; 231 break;
@@ -234,8 +260,8 @@ static ssize_t move_to_pipe(struct pipe_inode_info *pipe, struct page **pages,
234 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); 260 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
235 } 261 }
236 262
237 while (i < nr_pages) 263 while (page_nr < spd->nr_pages)
238 page_cache_release(pages[i++]); 264 page_cache_release(spd->pages[page_nr++]);
239 265
240 return ret; 266 return ret;
241} 267}
@@ -246,17 +272,24 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
246 unsigned int flags) 272 unsigned int flags)
247{ 273{
248 struct address_space *mapping = in->f_mapping; 274 struct address_space *mapping = in->f_mapping;
249 unsigned int loff, offset, nr_pages; 275 unsigned int loff, nr_pages;
250 struct page *pages[PIPE_BUFFERS]; 276 struct page *pages[PIPE_BUFFERS];
277 struct partial_page partial[PIPE_BUFFERS];
251 struct page *page; 278 struct page *page;
252 pgoff_t index, end_index; 279 pgoff_t index, end_index;
253 loff_t isize; 280 loff_t isize;
254 size_t bytes; 281 size_t total_len;
255 int i, error; 282 int error;
283 struct splice_pipe_desc spd = {
284 .pages = pages,
285 .partial = partial,
286 .flags = flags,
287 .ops = &page_cache_pipe_buf_ops,
288 };
256 289
257 index = *ppos >> PAGE_CACHE_SHIFT; 290 index = *ppos >> PAGE_CACHE_SHIFT;
258 loff = offset = *ppos & ~PAGE_CACHE_MASK; 291 loff = *ppos & ~PAGE_CACHE_MASK;
259 nr_pages = (len + offset + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; 292 nr_pages = (len + loff + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
260 293
261 if (nr_pages > PIPE_BUFFERS) 294 if (nr_pages > PIPE_BUFFERS)
262 nr_pages = PIPE_BUFFERS; 295 nr_pages = PIPE_BUFFERS;
@@ -266,15 +299,15 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
266 * read-ahead if this is a non-zero offset (we are likely doing small 299 * read-ahead if this is a non-zero offset (we are likely doing small
267 * chunk splice and the page is already there) for a single page. 300 * chunk splice and the page is already there) for a single page.
268 */ 301 */
269 if (!offset || nr_pages > 1) 302 if (!loff || spd.nr_pages > 1)
270 do_page_cache_readahead(mapping, in, index, nr_pages); 303 do_page_cache_readahead(mapping, in, index, spd.nr_pages);
271 304
272 /* 305 /*
273 * Now fill in the holes: 306 * Now fill in the holes:
274 */ 307 */
275 error = 0; 308 error = 0;
276 bytes = 0; 309 total_len = 0;
277 for (i = 0; i < nr_pages; i++, index++) { 310 for (spd.nr_pages = 0; spd.nr_pages < nr_pages; spd.nr_pages++, index++) {
278 unsigned int this_len; 311 unsigned int this_len;
279 312
280 if (!len) 313 if (!len)
@@ -283,7 +316,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
283 /* 316 /*
284 * this_len is the max we'll use from this page 317 * this_len is the max we'll use from this page
285 */ 318 */
286 this_len = min(len, PAGE_CACHE_SIZE - loff); 319 this_len = min_t(unsigned long, len, PAGE_CACHE_SIZE - loff);
287find_page: 320find_page:
288 /* 321 /*
289 * lookup the page for this index 322 * lookup the page for this index
@@ -367,26 +400,29 @@ readpage:
367 */ 400 */
368 if (end_index == index) { 401 if (end_index == index) {
369 loff = PAGE_CACHE_SIZE - (isize & ~PAGE_CACHE_MASK); 402 loff = PAGE_CACHE_SIZE - (isize & ~PAGE_CACHE_MASK);
370 if (bytes + loff > isize) { 403 if (total_len + loff > isize) {
371 page_cache_release(page); 404 page_cache_release(page);
372 break; 405 break;
373 } 406 }
374 /* 407 /*
375 * force quit after adding this page 408 * force quit after adding this page
376 */ 409 */
377 nr_pages = i; 410 nr_pages = spd.nr_pages;
378 this_len = min(this_len, loff); 411 this_len = min(this_len, loff);
412 loff = 0;
379 } 413 }
380 } 414 }
381fill_it: 415fill_it:
382 pages[i] = page; 416 pages[spd.nr_pages] = page;
383 bytes += this_len; 417 partial[spd.nr_pages].offset = loff;
418 partial[spd.nr_pages].len = this_len;
384 len -= this_len; 419 len -= this_len;
420 total_len += this_len;
385 loff = 0; 421 loff = 0;
386 } 422 }
387 423
388 if (i) 424 if (spd.nr_pages)
389 return move_to_pipe(pipe, pages, i, bytes, offset, flags); 425 return splice_to_pipe(pipe, &spd);
390 426
391 return error; 427 return error;
392} 428}
@@ -439,14 +475,13 @@ EXPORT_SYMBOL(generic_file_splice_read);
439 475
440/* 476/*
441 * Send 'sd->len' bytes to socket from 'sd->file' at position 'sd->pos' 477 * Send 'sd->len' bytes to socket from 'sd->file' at position 'sd->pos'
442 * using sendpage(). 478 * using sendpage(). Return the number of bytes sent.
443 */ 479 */
444static int pipe_to_sendpage(struct pipe_inode_info *info, 480static int pipe_to_sendpage(struct pipe_inode_info *info,
445 struct pipe_buffer *buf, struct splice_desc *sd) 481 struct pipe_buffer *buf, struct splice_desc *sd)
446{ 482{
447 struct file *file = sd->file; 483 struct file *file = sd->file;
448 loff_t pos = sd->pos; 484 loff_t pos = sd->pos;
449 unsigned int offset;
450 ssize_t ret; 485 ssize_t ret;
451 void *ptr; 486 void *ptr;
452 int more; 487 int more;
@@ -461,16 +496,13 @@ static int pipe_to_sendpage(struct pipe_inode_info *info,
461 if (IS_ERR(ptr)) 496 if (IS_ERR(ptr))
462 return PTR_ERR(ptr); 497 return PTR_ERR(ptr);
463 498
464 offset = pos & ~PAGE_CACHE_MASK;
465 more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len; 499 more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len;
466 500
467 ret = file->f_op->sendpage(file, buf->page, offset, sd->len, &pos,more); 501 ret = file->f_op->sendpage(file, buf->page, buf->offset, sd->len,
502 &pos, more);
468 503
469 buf->ops->unmap(info, buf); 504 buf->ops->unmap(info, buf);
470 if (ret == sd->len) 505 return ret;
471 return 0;
472
473 return -EIO;
474} 506}
475 507
476/* 508/*
@@ -499,7 +531,7 @@ static int pipe_to_file(struct pipe_inode_info *info, struct pipe_buffer *buf,
499 struct file *file = sd->file; 531 struct file *file = sd->file;
500 struct address_space *mapping = file->f_mapping; 532 struct address_space *mapping = file->f_mapping;
501 gfp_t gfp_mask = mapping_gfp_mask(mapping); 533 gfp_t gfp_mask = mapping_gfp_mask(mapping);
502 unsigned int offset; 534 unsigned int offset, this_len;
503 struct page *page; 535 struct page *page;
504 pgoff_t index; 536 pgoff_t index;
505 char *src; 537 char *src;
@@ -515,6 +547,10 @@ static int pipe_to_file(struct pipe_inode_info *info, struct pipe_buffer *buf,
515 index = sd->pos >> PAGE_CACHE_SHIFT; 547 index = sd->pos >> PAGE_CACHE_SHIFT;
516 offset = sd->pos & ~PAGE_CACHE_MASK; 548 offset = sd->pos & ~PAGE_CACHE_MASK;
517 549
550 this_len = sd->len;
551 if (this_len + offset > PAGE_CACHE_SIZE)
552 this_len = PAGE_CACHE_SIZE - offset;
553
518 /* 554 /*
519 * Reuse buf page, if SPLICE_F_MOVE is set. 555 * Reuse buf page, if SPLICE_F_MOVE is set.
520 */ 556 */
@@ -558,7 +594,7 @@ find_page:
558 * the full page. 594 * the full page.
559 */ 595 */
560 if (!PageUptodate(page)) { 596 if (!PageUptodate(page)) {
561 if (sd->len < PAGE_CACHE_SIZE) { 597 if (this_len < PAGE_CACHE_SIZE) {
562 ret = mapping->a_ops->readpage(file, page); 598 ret = mapping->a_ops->readpage(file, page);
563 if (unlikely(ret)) 599 if (unlikely(ret))
564 goto out; 600 goto out;
@@ -582,7 +618,7 @@ find_page:
582 } 618 }
583 } 619 }
584 620
585 ret = mapping->a_ops->prepare_write(file, page, 0, sd->len); 621 ret = mapping->a_ops->prepare_write(file, page, offset, offset+this_len);
586 if (ret == AOP_TRUNCATED_PAGE) { 622 if (ret == AOP_TRUNCATED_PAGE) {
587 page_cache_release(page); 623 page_cache_release(page);
588 goto find_page; 624 goto find_page;
@@ -592,18 +628,22 @@ find_page:
592 if (!(buf->flags & PIPE_BUF_FLAG_STOLEN)) { 628 if (!(buf->flags & PIPE_BUF_FLAG_STOLEN)) {
593 char *dst = kmap_atomic(page, KM_USER0); 629 char *dst = kmap_atomic(page, KM_USER0);
594 630
595 memcpy(dst + offset, src + buf->offset, sd->len); 631 memcpy(dst + offset, src + buf->offset, this_len);
596 flush_dcache_page(page); 632 flush_dcache_page(page);
597 kunmap_atomic(dst, KM_USER0); 633 kunmap_atomic(dst, KM_USER0);
598 } 634 }
599 635
600 ret = mapping->a_ops->commit_write(file, page, 0, sd->len); 636 ret = mapping->a_ops->commit_write(file, page, offset, offset+this_len);
601 if (ret == AOP_TRUNCATED_PAGE) { 637 if (ret == AOP_TRUNCATED_PAGE) {
602 page_cache_release(page); 638 page_cache_release(page);
603 goto find_page; 639 goto find_page;
604 } else if (ret) 640 } else if (ret)
605 goto out; 641 goto out;
606 642
643 /*
644 * Return the number of bytes written.
645 */
646 ret = this_len;
607 mark_page_accessed(page); 647 mark_page_accessed(page);
608 balance_dirty_pages_ratelimited(mapping); 648 balance_dirty_pages_ratelimited(mapping);
609out: 649out:
@@ -616,17 +656,14 @@ out_nomem:
616 return ret; 656 return ret;
617} 657}
618 658
619typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *,
620 struct splice_desc *);
621
622/* 659/*
623 * Pipe input worker. Most of this logic works like a regular pipe, the 660 * Pipe input worker. Most of this logic works like a regular pipe, the
624 * key here is the 'actor' worker passed in that actually moves the data 661 * key here is the 'actor' worker passed in that actually moves the data
625 * to the wanted destination. See pipe_to_file/pipe_to_sendpage above. 662 * to the wanted destination. See pipe_to_file/pipe_to_sendpage above.
626 */ 663 */
627static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out, 664ssize_t splice_from_pipe(struct pipe_inode_info *pipe, struct file *out,
628 loff_t *ppos, size_t len, unsigned int flags, 665 loff_t *ppos, size_t len, unsigned int flags,
629 splice_actor *actor) 666 splice_actor *actor)
630{ 667{
631 int ret, do_wakeup, err; 668 int ret, do_wakeup, err;
632 struct splice_desc sd; 669 struct splice_desc sd;
@@ -652,16 +689,22 @@ static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out,
652 sd.len = sd.total_len; 689 sd.len = sd.total_len;
653 690
654 err = actor(pipe, buf, &sd); 691 err = actor(pipe, buf, &sd);
655 if (err) { 692 if (err <= 0) {
656 if (!ret && err != -ENODATA) 693 if (!ret && err != -ENODATA)
657 ret = err; 694 ret = err;
658 695
659 break; 696 break;
660 } 697 }
661 698
662 ret += sd.len; 699 ret += err;
663 buf->offset += sd.len; 700 buf->offset += err;
664 buf->len -= sd.len; 701 buf->len -= err;
702
703 sd.len -= err;
704 sd.pos += err;
705 sd.total_len -= err;
706 if (sd.len)
707 continue;
665 708
666 if (!buf->len) { 709 if (!buf->len) {
667 buf->ops = NULL; 710 buf->ops = NULL;
@@ -672,8 +715,6 @@ static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out,
672 do_wakeup = 1; 715 do_wakeup = 1;
673 } 716 }
674 717
675 sd.pos += sd.len;
676 sd.total_len -= sd.len;
677 if (!sd.total_len) 718 if (!sd.total_len)
678 break; 719 break;
679 } 720 }
@@ -741,7 +782,7 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
741 struct address_space *mapping = out->f_mapping; 782 struct address_space *mapping = out->f_mapping;
742 ssize_t ret; 783 ssize_t ret;
743 784
744 ret = move_from_pipe(pipe, out, ppos, len, flags, pipe_to_file); 785 ret = splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file);
745 if (ret > 0) { 786 if (ret > 0) {
746 struct inode *inode = mapping->host; 787 struct inode *inode = mapping->host;
747 788
@@ -783,7 +824,7 @@ EXPORT_SYMBOL(generic_file_splice_write);
783ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, struct file *out, 824ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, struct file *out,
784 loff_t *ppos, size_t len, unsigned int flags) 825 loff_t *ppos, size_t len, unsigned int flags)
785{ 826{
786 return move_from_pipe(pipe, out, ppos, len, flags, pipe_to_sendpage); 827 return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_sendpage);
787} 828}
788 829
789EXPORT_SYMBOL(generic_splice_sendpage); 830EXPORT_SYMBOL(generic_splice_sendpage);
@@ -870,7 +911,7 @@ long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
870 911
871 /* 912 /*
872 * We don't have an immediate reader, but we'll read the stuff 913 * We don't have an immediate reader, but we'll read the stuff
873 * out of the pipe right after the move_to_pipe(). So set 914 * out of the pipe right after the splice_to_pipe(). So set
874 * PIPE_READERS appropriately. 915 * PIPE_READERS appropriately.
875 */ 916 */
876 pipe->readers = 1; 917 pipe->readers = 1;
@@ -1010,6 +1051,174 @@ static long do_splice(struct file *in, loff_t __user *off_in,
1010 return -EINVAL; 1051 return -EINVAL;
1011} 1052}
1012 1053
1054/*
1055 * Map an iov into an array of pages and offset/length tupples. With the
1056 * partial_page structure, we can map several non-contiguous ranges into
1057 * our ones pages[] map instead of splitting that operation into pieces.
1058 * Could easily be exported as a generic helper for other users, in which
1059 * case one would probably want to add a 'max_nr_pages' parameter as well.
1060 */
1061static int get_iovec_page_array(const struct iovec __user *iov,
1062 unsigned int nr_vecs, struct page **pages,
1063 struct partial_page *partial)
1064{
1065 int buffers = 0, error = 0;
1066
1067 /*
1068 * It's ok to take the mmap_sem for reading, even
1069 * across a "get_user()".
1070 */
1071 down_read(&current->mm->mmap_sem);
1072
1073 while (nr_vecs) {
1074 unsigned long off, npages;
1075 void __user *base;
1076 size_t len;
1077 int i;
1078
1079 /*
1080 * Get user address base and length for this iovec.
1081 */
1082 error = get_user(base, &iov->iov_base);
1083 if (unlikely(error))
1084 break;
1085 error = get_user(len, &iov->iov_len);
1086 if (unlikely(error))
1087 break;
1088
1089 /*
1090 * Sanity check this iovec. 0 read succeeds.
1091 */
1092 if (unlikely(!len))
1093 break;
1094 error = -EFAULT;
1095 if (unlikely(!base))
1096 break;
1097
1098 /*
1099 * Get this base offset and number of pages, then map
1100 * in the user pages.
1101 */
1102 off = (unsigned long) base & ~PAGE_MASK;
1103 npages = (off + len + PAGE_SIZE - 1) >> PAGE_SHIFT;
1104 if (npages > PIPE_BUFFERS - buffers)
1105 npages = PIPE_BUFFERS - buffers;
1106
1107 error = get_user_pages(current, current->mm,
1108 (unsigned long) base, npages, 0, 0,
1109 &pages[buffers], NULL);
1110
1111 if (unlikely(error <= 0))
1112 break;
1113
1114 /*
1115 * Fill this contiguous range into the partial page map.
1116 */
1117 for (i = 0; i < error; i++) {
1118 const int plen = min_t(size_t, len, PAGE_SIZE) - off;
1119
1120 partial[buffers].offset = off;
1121 partial[buffers].len = plen;
1122
1123 off = 0;
1124 len -= plen;
1125 buffers++;
1126 }
1127
1128 /*
1129 * We didn't complete this iov, stop here since it probably
1130 * means we have to move some of this into a pipe to
1131 * be able to continue.
1132 */
1133 if (len)
1134 break;
1135
1136 /*
1137 * Don't continue if we mapped fewer pages than we asked for,
1138 * or if we mapped the max number of pages that we have
1139 * room for.
1140 */
1141 if (error < npages || buffers == PIPE_BUFFERS)
1142 break;
1143
1144 nr_vecs--;
1145 iov++;
1146 }
1147
1148 up_read(&current->mm->mmap_sem);
1149
1150 if (buffers)
1151 return buffers;
1152
1153 return error;
1154}
1155
1156/*
1157 * vmsplice splices a user address range into a pipe. It can be thought of
1158 * as splice-from-memory, where the regular splice is splice-from-file (or
1159 * to file). In both cases the output is a pipe, naturally.
1160 *
1161 * Note that vmsplice only supports splicing _from_ user memory to a pipe,
1162 * not the other way around. Splicing from user memory is a simple operation
1163 * that can be supported without any funky alignment restrictions or nasty
1164 * vm tricks. We simply map in the user memory and fill them into a pipe.
1165 * The reverse isn't quite as easy, though. There are two possible solutions
1166 * for that:
1167 *
1168 * - memcpy() the data internally, at which point we might as well just
1169 * do a regular read() on the buffer anyway.
1170 * - Lots of nasty vm tricks, that are neither fast nor flexible (it
1171 * has restriction limitations on both ends of the pipe).
1172 *
1173 * Alas, it isn't here.
1174 *
1175 */
1176static long do_vmsplice(struct file *file, const struct iovec __user *iov,
1177 unsigned long nr_segs, unsigned int flags)
1178{
1179 struct pipe_inode_info *pipe = file->f_dentry->d_inode->i_pipe;
1180 struct page *pages[PIPE_BUFFERS];
1181 struct partial_page partial[PIPE_BUFFERS];
1182 struct splice_pipe_desc spd = {
1183 .pages = pages,
1184 .partial = partial,
1185 .flags = flags,
1186 .ops = &user_page_pipe_buf_ops,
1187 };
1188
1189 if (unlikely(!pipe))
1190 return -EBADF;
1191 if (unlikely(nr_segs > UIO_MAXIOV))
1192 return -EINVAL;
1193 else if (unlikely(!nr_segs))
1194 return 0;
1195
1196 spd.nr_pages = get_iovec_page_array(iov, nr_segs, pages, partial);
1197 if (spd.nr_pages <= 0)
1198 return spd.nr_pages;
1199
1200 return splice_to_pipe(pipe, &spd);
1201}
1202
1203asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov,
1204 unsigned long nr_segs, unsigned int flags)
1205{
1206 struct file *file;
1207 long error;
1208 int fput;
1209
1210 error = -EBADF;
1211 file = fget_light(fd, &fput);
1212 if (file) {
1213 if (file->f_mode & FMODE_WRITE)
1214 error = do_vmsplice(file, iov, nr_segs, flags);
1215
1216 fput_light(file, fput);
1217 }
1218
1219 return error;
1220}
1221
1013asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, 1222asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
1014 int fd_out, loff_t __user *off_out, 1223 int fd_out, loff_t __user *off_out,
1015 size_t len, unsigned int flags) 1224 size_t len, unsigned int flags)
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index d81d6cfc1bb4..eb4b152c82fc 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -321,8 +321,9 @@
321#define __NR_splice 313 321#define __NR_splice 313
322#define __NR_sync_file_range 314 322#define __NR_sync_file_range 314
323#define __NR_tee 315 323#define __NR_tee 315
324#define __NR_vmsplice 316
324 325
325#define NR_syscalls 316 326#define NR_syscalls 317
326 327
327/* 328/*
328 * user-visible error numbers are in the range -1 - -128: see 329 * user-visible error numbers are in the range -1 - -128: see
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index a40ebec6aeeb..7107763168bf 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -290,12 +290,13 @@
290#define __NR_get_robust_list 1299 290#define __NR_get_robust_list 1299
291#define __NR_sync_file_range 1300 291#define __NR_sync_file_range 1300
292#define __NR_tee 1301 292#define __NR_tee 1301
293#define __NR_vmsplice 1302
293 294
294#ifdef __KERNEL__ 295#ifdef __KERNEL__
295 296
296#include <linux/config.h> 297#include <linux/config.h>
297 298
298#define NR_syscalls 278 /* length of syscall table */ 299#define NR_syscalls 279 /* length of syscall table */
299 300
300#define __ARCH_WANT_SYS_RT_SIGACTION 301#define __ARCH_WANT_SYS_RT_SIGACTION
301 302
diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h
index 29da31194b91..244f6b8883f4 100644
--- a/include/asm-parisc/io.h
+++ b/include/asm-parisc/io.h
@@ -126,24 +126,17 @@ static inline void gsc_writeq(unsigned long long val, unsigned long addr)
126 126
127extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags); 127extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
128 128
129extern inline void __iomem * ioremap(unsigned long offset, unsigned long size) 129/* Most machines react poorly to I/O-space being cacheable... Instead let's
130{ 130 * define ioremap() in terms of ioremap_nocache().
131 return __ioremap(offset, size, 0);
132}
133
134/*
135 * This one maps high address device memory and turns off caching for that area.
136 * it's useful if some control registers are in such an area and write combining
137 * or read caching is not desirable:
138 */ 131 */
139extern inline void * ioremap_nocache(unsigned long offset, unsigned long size) 132extern inline void __iomem * ioremap(unsigned long offset, unsigned long size)
140{ 133{
141 return __ioremap(offset, size, _PAGE_NO_CACHE /* _PAGE_PCD */); 134 return __ioremap(offset, size, _PAGE_NO_CACHE);
142} 135}
136#define ioremap_nocache(off, sz) ioremap((off), (sz))
143 137
144extern void iounmap(void __iomem *addr); 138extern void iounmap(void __iomem *addr);
145 139
146
147static inline unsigned char __raw_readb(const volatile void __iomem *addr) 140static inline unsigned char __raw_readb(const volatile void __iomem *addr)
148{ 141{
149 return (*(volatile unsigned char __force *) (addr)); 142 return (*(volatile unsigned char __force *) (addr));
diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h
index 45e02aa5bf4b..c0dd461fb8f1 100644
--- a/include/asm-parisc/page.h
+++ b/include/asm-parisc/page.h
@@ -1,13 +1,30 @@
1#ifndef _PARISC_PAGE_H 1#ifndef _PARISC_PAGE_H
2#define _PARISC_PAGE_H 2#define _PARISC_PAGE_H
3 3
4/* PAGE_SHIFT determines the page size */ 4#if !defined(__KERNEL__)
5#define PAGE_SHIFT 12 5/* this is for userspace applications (4k page size) */
6#define PAGE_SIZE (1UL << PAGE_SHIFT) 6# define PAGE_SHIFT 12 /* 4k */
7#define PAGE_MASK (~(PAGE_SIZE-1)) 7# define PAGE_SIZE (1UL << PAGE_SHIFT)
8# define PAGE_MASK (~(PAGE_SIZE-1))
9#endif
10
8 11
9#ifdef __KERNEL__ 12#ifdef __KERNEL__
10#include <linux/config.h> 13#include <linux/config.h>
14
15#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)
16# define PAGE_SHIFT 12 /* 4k */
17#elif defined(CONFIG_PARISC_PAGE_SIZE_16KB)
18# define PAGE_SHIFT 14 /* 16k */
19#elif defined(CONFIG_PARISC_PAGE_SIZE_64KB)
20# define PAGE_SHIFT 16 /* 64k */
21#else
22# error "unknown default kernel page size"
23#endif
24#define PAGE_SIZE (1UL << PAGE_SHIFT)
25#define PAGE_MASK (~(PAGE_SIZE-1))
26
27
11#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
12 29
13#include <asm/types.h> 30#include <asm/types.h>
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
index 4e34c6b44059..aec089eb8b85 100644
--- a/include/asm-parisc/pgtable.h
+++ b/include/asm-parisc/pgtable.h
@@ -59,16 +59,15 @@
59#define ISTACK_SIZE 32768 /* Interrupt Stack Size */ 59#define ISTACK_SIZE 32768 /* Interrupt Stack Size */
60#define ISTACK_ORDER 3 60#define ISTACK_ORDER 3
61 61
62/* This is the size of the initially mapped kernel memory (i.e. currently 62/* This is the size of the initially mapped kernel memory */
63 * 0 to 1<<23 == 8MB */
64#ifdef CONFIG_64BIT 63#ifdef CONFIG_64BIT
65#define KERNEL_INITIAL_ORDER 24 64#define KERNEL_INITIAL_ORDER 24 /* 0 to 1<<24 = 16MB */
66#else 65#else
67#define KERNEL_INITIAL_ORDER 23 66#define KERNEL_INITIAL_ORDER 23 /* 0 to 1<<23 = 8MB */
68#endif 67#endif
69#define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER) 68#define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER)
70 69
71#ifdef CONFIG_64BIT 70#if defined(CONFIG_64BIT) && defined(CONFIG_PARISC_PAGE_SIZE_4KB)
72#define PT_NLEVELS 3 71#define PT_NLEVELS 3
73#define PGD_ORDER 1 /* Number of pages per pgd */ 72#define PGD_ORDER 1 /* Number of pages per pgd */
74#define PMD_ORDER 1 /* Number of pages per pmd */ 73#define PMD_ORDER 1 /* Number of pages per pmd */
@@ -111,11 +110,15 @@
111#define MAX_ADDRBITS (PGDIR_SHIFT + BITS_PER_PGD) 110#define MAX_ADDRBITS (PGDIR_SHIFT + BITS_PER_PGD)
112#define MAX_ADDRESS (1UL << MAX_ADDRBITS) 111#define MAX_ADDRESS (1UL << MAX_ADDRBITS)
113 112
114#define SPACEID_SHIFT (MAX_ADDRBITS - 32) 113#define SPACEID_SHIFT (MAX_ADDRBITS - 32)
115 114
116/* This calculates the number of initial pages we need for the initial 115/* This calculates the number of initial pages we need for the initial
117 * page tables */ 116 * page tables */
118#define PT_INITIAL (1 << (KERNEL_INITIAL_ORDER - PMD_SHIFT)) 117#if (KERNEL_INITIAL_ORDER) >= (PMD_SHIFT)
118# define PT_INITIAL (1 << (KERNEL_INITIAL_ORDER - PMD_SHIFT))
119#else
120# define PT_INITIAL (1) /* all initial PTEs fit into one page */
121#endif
119 122
120/* 123/*
121 * pgd entries used up by user/kernel: 124 * pgd entries used up by user/kernel:
@@ -160,6 +163,10 @@ extern void *vmalloc_start;
160 * to zero */ 163 * to zero */
161#define PTE_SHIFT xlate_pabit(_PAGE_USER_BIT) 164#define PTE_SHIFT xlate_pabit(_PAGE_USER_BIT)
162 165
166/* PFN_PTE_SHIFT defines the shift of a PTE value to access the PFN field */
167#define PFN_PTE_SHIFT 12
168
169
163/* this is how many bits may be used by the file functions */ 170/* this is how many bits may be used by the file functions */
164#define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_SHIFT) 171#define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_SHIFT)
165 172
@@ -188,7 +195,8 @@ extern void *vmalloc_start;
188/* The pgd/pmd contains a ptr (in phys addr space); since all pgds/pmds 195/* The pgd/pmd contains a ptr (in phys addr space); since all pgds/pmds
189 * are page-aligned, we don't care about the PAGE_OFFSET bits, except 196 * are page-aligned, we don't care about the PAGE_OFFSET bits, except
190 * for a few meta-information bits, so we shift the address to be 197 * for a few meta-information bits, so we shift the address to be
191 * able to effectively address 40-bits of physical address space. */ 198 * able to effectively address 40/42/44-bits of physical address space
199 * depending on 4k/16k/64k PAGE_SIZE */
192#define _PxD_PRESENT_BIT 31 200#define _PxD_PRESENT_BIT 31
193#define _PxD_ATTACHED_BIT 30 201#define _PxD_ATTACHED_BIT 30
194#define _PxD_VALID_BIT 29 202#define _PxD_VALID_BIT 29
@@ -198,7 +206,7 @@ extern void *vmalloc_start;
198#define PxD_FLAG_VALID (1 << xlate_pabit(_PxD_VALID_BIT)) 206#define PxD_FLAG_VALID (1 << xlate_pabit(_PxD_VALID_BIT))
199#define PxD_FLAG_MASK (0xf) 207#define PxD_FLAG_MASK (0xf)
200#define PxD_FLAG_SHIFT (4) 208#define PxD_FLAG_SHIFT (4)
201#define PxD_VALUE_SHIFT (8) 209#define PxD_VALUE_SHIFT (8) /* (PAGE_SHIFT-PxD_FLAG_SHIFT) */
202 210
203#ifndef __ASSEMBLY__ 211#ifndef __ASSEMBLY__
204 212
@@ -246,6 +254,7 @@ extern void *vmalloc_start;
246#define __S110 PAGE_RWX 254#define __S110 PAGE_RWX
247#define __S111 PAGE_RWX 255#define __S111 PAGE_RWX
248 256
257
249extern pgd_t swapper_pg_dir[]; /* declared in init_task.c */ 258extern pgd_t swapper_pg_dir[]; /* declared in init_task.c */
250 259
251/* initial page tables for 0-8MB for kernel */ 260/* initial page tables for 0-8MB for kernel */
@@ -272,7 +281,7 @@ extern unsigned long *empty_zero_page;
272#define pgd_flag(x) (pgd_val(x) & PxD_FLAG_MASK) 281#define pgd_flag(x) (pgd_val(x) & PxD_FLAG_MASK)
273#define pgd_address(x) ((unsigned long)(pgd_val(x) &~ PxD_FLAG_MASK) << PxD_VALUE_SHIFT) 282#define pgd_address(x) ((unsigned long)(pgd_val(x) &~ PxD_FLAG_MASK) << PxD_VALUE_SHIFT)
274 283
275#ifdef CONFIG_64BIT 284#if PT_NLEVELS == 3
276/* The first entry of the permanent pmd is not there if it contains 285/* The first entry of the permanent pmd is not there if it contains
277 * the gateway marker */ 286 * the gateway marker */
278#define pmd_none(x) (!pmd_val(x) || pmd_flag(x) == PxD_FLAG_ATTACHED) 287#define pmd_none(x) (!pmd_val(x) || pmd_flag(x) == PxD_FLAG_ATTACHED)
@@ -282,7 +291,7 @@ extern unsigned long *empty_zero_page;
282#define pmd_bad(x) (!(pmd_flag(x) & PxD_FLAG_VALID)) 291#define pmd_bad(x) (!(pmd_flag(x) & PxD_FLAG_VALID))
283#define pmd_present(x) (pmd_flag(x) & PxD_FLAG_PRESENT) 292#define pmd_present(x) (pmd_flag(x) & PxD_FLAG_PRESENT)
284static inline void pmd_clear(pmd_t *pmd) { 293static inline void pmd_clear(pmd_t *pmd) {
285#ifdef CONFIG_64BIT 294#if PT_NLEVELS == 3
286 if (pmd_flag(*pmd) & PxD_FLAG_ATTACHED) 295 if (pmd_flag(*pmd) & PxD_FLAG_ATTACHED)
287 /* This is the entry pointing to the permanent pmd 296 /* This is the entry pointing to the permanent pmd
288 * attached to the pgd; cannot clear it */ 297 * attached to the pgd; cannot clear it */
@@ -303,7 +312,7 @@ static inline void pmd_clear(pmd_t *pmd) {
303#define pgd_bad(x) (!(pgd_flag(x) & PxD_FLAG_VALID)) 312#define pgd_bad(x) (!(pgd_flag(x) & PxD_FLAG_VALID))
304#define pgd_present(x) (pgd_flag(x) & PxD_FLAG_PRESENT) 313#define pgd_present(x) (pgd_flag(x) & PxD_FLAG_PRESENT)
305static inline void pgd_clear(pgd_t *pgd) { 314static inline void pgd_clear(pgd_t *pgd) {
306#ifdef CONFIG_64BIT 315#if PT_NLEVELS == 3
307 if(pgd_flag(*pgd) & PxD_FLAG_ATTACHED) 316 if(pgd_flag(*pgd) & PxD_FLAG_ATTACHED)
308 /* This is the permanent pmd attached to the pgd; cannot 317 /* This is the permanent pmd attached to the pgd; cannot
309 * free it */ 318 * free it */
@@ -351,7 +360,7 @@ extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_WRITE; return
351({ \ 360({ \
352 pte_t __pte; \ 361 pte_t __pte; \
353 \ 362 \
354 pte_val(__pte) = ((addr)+pgprot_val(pgprot)); \ 363 pte_val(__pte) = ((((addr)>>PAGE_SHIFT)<<PFN_PTE_SHIFT) + pgprot_val(pgprot)); \
355 \ 364 \
356 __pte; \ 365 __pte; \
357}) 366})
@@ -361,20 +370,16 @@ extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_WRITE; return
361static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) 370static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
362{ 371{
363 pte_t pte; 372 pte_t pte;
364 pte_val(pte) = (pfn << PAGE_SHIFT) | pgprot_val(pgprot); 373 pte_val(pte) = (pfn << PFN_PTE_SHIFT) | pgprot_val(pgprot);
365 return pte; 374 return pte;
366} 375}
367 376
368/* This takes a physical page address that is used by the remapping functions */
369#define mk_pte_phys(physpage, pgprot) \
370({ pte_t __pte; pte_val(__pte) = physpage + pgprot_val(pgprot); __pte; })
371
372extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 377extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
373{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; } 378{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; }
374 379
375/* Permanent address of a page. On parisc we don't have highmem. */ 380/* Permanent address of a page. On parisc we don't have highmem. */
376 381
377#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) 382#define pte_pfn(x) (pte_val(x) >> PFN_PTE_SHIFT)
378 383
379#define pte_page(pte) (pfn_to_page(pte_pfn(pte))) 384#define pte_page(pte) (pfn_to_page(pte_pfn(pte)))
380 385
@@ -499,6 +504,26 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
499 504
500#endif /* !__ASSEMBLY__ */ 505#endif /* !__ASSEMBLY__ */
501 506
507
508/* TLB page size encoding - see table 3-1 in parisc20.pdf */
509#define _PAGE_SIZE_ENCODING_4K 0
510#define _PAGE_SIZE_ENCODING_16K 1
511#define _PAGE_SIZE_ENCODING_64K 2
512#define _PAGE_SIZE_ENCODING_256K 3
513#define _PAGE_SIZE_ENCODING_1M 4
514#define _PAGE_SIZE_ENCODING_4M 5
515#define _PAGE_SIZE_ENCODING_16M 6
516#define _PAGE_SIZE_ENCODING_64M 7
517
518#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)
519# define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_4K
520#elif defined(CONFIG_PARISC_PAGE_SIZE_16KB)
521# define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_16K
522#elif defined(CONFIG_PARISC_PAGE_SIZE_64KB)
523# define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_64K
524#endif
525
526
502#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 527#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
503 remap_pfn_range(vma, vaddr, pfn, size, prot) 528 remap_pfn_range(vma, vaddr, pfn, size, prot)
504 529
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index c56fccbf34ad..0e1a30be2e30 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -780,8 +780,14 @@
780#define __NR_readlinkat (__NR_Linux + 285) 780#define __NR_readlinkat (__NR_Linux + 285)
781#define __NR_fchmodat (__NR_Linux + 286) 781#define __NR_fchmodat (__NR_Linux + 286)
782#define __NR_faccessat (__NR_Linux + 287) 782#define __NR_faccessat (__NR_Linux + 287)
783#define __NR_unshare (__NR_Linux + 288)
784#define __NR_set_robust_list (__NR_Linux + 289)
785#define __NR_get_robust_list (__NR_Linux + 290)
786#define __NR_splice (__NR_Linux + 291)
787#define __NR_sync_file_range (__NR_Linux + 292)
788#define __NR_tee (__NR_Linux + 293)
783 789
784#define __NR_Linux_syscalls 288 790#define __NR_Linux_syscalls 294
785 791
786#define HPUX_GATEWAY_ADDR 0xC0000004 792#define HPUX_GATEWAY_ADDR 0xC0000004
787#define LINUX_GATEWAY_ADDR 0x100 793#define LINUX_GATEWAY_ADDR 0x100
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h
index d5677cbec200..18ca29e9105a 100644
--- a/include/asm-powerpc/iommu.h
+++ b/include/asm-powerpc/iommu.h
@@ -70,17 +70,18 @@ extern void iommu_free_table(struct device_node *dn);
70extern struct iommu_table *iommu_init_table(struct iommu_table * tbl); 70extern struct iommu_table *iommu_init_table(struct iommu_table * tbl);
71 71
72extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl, 72extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
73 struct scatterlist *sglist, int nelems, 73 struct scatterlist *sglist, int nelems, unsigned long mask,
74 enum dma_data_direction direction); 74 enum dma_data_direction direction);
75extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, 75extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,
76 int nelems, enum dma_data_direction direction); 76 int nelems, enum dma_data_direction direction);
77 77
78extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, 78extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
79 dma_addr_t *dma_handle, gfp_t flag); 79 dma_addr_t *dma_handle, unsigned long mask, gfp_t flag);
80extern void iommu_free_coherent(struct iommu_table *tbl, size_t size, 80extern void iommu_free_coherent(struct iommu_table *tbl, size_t size,
81 void *vaddr, dma_addr_t dma_handle); 81 void *vaddr, dma_addr_t dma_handle);
82extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, 82extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
83 size_t size, enum dma_data_direction direction); 83 size_t size, unsigned long mask,
84 enum dma_data_direction direction);
84extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle, 85extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
85 size_t size, enum dma_data_direction direction); 86 size_t size, enum dma_data_direction direction);
86 87
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 5ed847680754..0f9254c18914 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -253,7 +253,11 @@ extern struct machdep_calls *machine_id;
253 253
254#define __machine_desc __attribute__ ((__section__ (".machine.desc"))) 254#define __machine_desc __attribute__ ((__section__ (".machine.desc")))
255 255
256#define define_machine(name) struct machdep_calls mach_##name __machine_desc = 256#define define_machine(name) \
257 extern struct machdep_calls mach_##name; \
258 EXPORT_SYMBOL(mach_##name); \
259 struct machdep_calls mach_##name __machine_desc =
260
257#define machine_is(name) \ 261#define machine_is(name) \
258 ({ \ 262 ({ \
259 extern struct machdep_calls mach_##name \ 263 extern struct machdep_calls mach_##name \
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index c612f1a62772..34325e292596 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -303,8 +303,9 @@
303#define __NR_unshare 282 303#define __NR_unshare 282
304#define __NR_splice 283 304#define __NR_splice 283
305#define __NR_tee 284 305#define __NR_tee 284
306#define __NR_vmsplice 285
306 307
307#define __NR_syscalls 285 308#define __NR_syscalls 286
308 309
309#ifdef __KERNEL__ 310#ifdef __KERNEL__
310#define __NR__exit __NR_exit 311#define __NR__exit __NR_exit
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 45feff893b8e..32a48f623e2b 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -271,7 +271,7 @@
271#define __NR_getsid 252 271#define __NR_getsid 252
272#define __NR_fdatasync 253 272#define __NR_fdatasync 253
273#define __NR_nfsservctl 254 273#define __NR_nfsservctl 254
274#define __NR_sys_sync_file_range 255 274#define __NR_sync_file_range 255
275#define __NR_clock_settime 256 275#define __NR_clock_settime 256
276#define __NR_clock_gettime 257 276#define __NR_clock_gettime 257
277#define __NR_clock_getres 258 277#define __NR_clock_getres 258
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index 597f6923a46e..ca80e8aca128 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -273,7 +273,7 @@
273#define __NR_getsid 252 273#define __NR_getsid 252
274#define __NR_fdatasync 253 274#define __NR_fdatasync 253
275#define __NR_nfsservctl 254 275#define __NR_nfsservctl 254
276#define __NR_sys_sync_file_range 255 276#define __NR_sync_file_range 255
277#define __NR_clock_settime 256 277#define __NR_clock_settime 256
278#define __NR_clock_gettime 257 278#define __NR_clock_gettime 257
279#define __NR_clock_getres 258 279#define __NR_clock_getres 258
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index 98c36eae567c..feb77cb8c044 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -615,8 +615,10 @@ __SYSCALL(__NR_splice, sys_splice)
615__SYSCALL(__NR_tee, sys_tee) 615__SYSCALL(__NR_tee, sys_tee)
616#define __NR_sync_file_range 277 616#define __NR_sync_file_range 277
617__SYSCALL(__NR_sync_file_range, sys_sync_file_range) 617__SYSCALL(__NR_sync_file_range, sys_sync_file_range)
618#define __NR_vmsplice 278
619__SYSCALL(__NR_vmsplice, sys_vmsplice)
618 620
619#define __NR_syscall_max __NR_sync_file_range 621#define __NR_syscall_max __NR_vmsplice
620 622
621#ifndef __NO_STUBS 623#ifndef __NO_STUBS
622 624
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 40ccf8cc4239..01db7b88a2b1 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -829,19 +829,21 @@ static inline void netif_rx_schedule(struct net_device *dev)
829 __netif_rx_schedule(dev); 829 __netif_rx_schedule(dev);
830} 830}
831 831
832/* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). 832
833 * Do not inline this? 833static inline void __netif_rx_reschedule(struct net_device *dev, int undo)
834 */ 834{
835 dev->quota += undo;
836 list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list);
837 __raise_softirq_irqoff(NET_RX_SOFTIRQ);
838}
839
840/* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). */
835static inline int netif_rx_reschedule(struct net_device *dev, int undo) 841static inline int netif_rx_reschedule(struct net_device *dev, int undo)
836{ 842{
837 if (netif_rx_schedule_prep(dev)) { 843 if (netif_rx_schedule_prep(dev)) {
838 unsigned long flags; 844 unsigned long flags;
839
840 dev->quota += undo;
841
842 local_irq_save(flags); 845 local_irq_save(flags);
843 list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list); 846 __netif_rx_reschedule(dev, undo);
844 __raise_softirq_irqoff(NET_RX_SOFTIRQ);
845 local_irq_restore(flags); 847 local_irq_restore(flags);
846 return 1; 848 return 1;
847 } 849 }
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index f6bdef82a322..38701454e197 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -361,7 +361,11 @@ struct compat_xt_entry_target
361 361
362struct compat_xt_counters 362struct compat_xt_counters
363{ 363{
364#if defined(CONFIG_X86_64) || defined(CONFIG_IA64)
364 u_int32_t cnt[4]; 365 u_int32_t cnt[4];
366#else
367 u_int64_t cnt[2];
368#endif
365}; 369};
366 370
367struct compat_xt_counters_info 371struct compat_xt_counters_info
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index ef7f33c0be19..0008d4bd4059 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -61,4 +61,21 @@ void __free_pipe_info(struct pipe_inode_info *);
61 /* from/to, of course */ 61 /* from/to, of course */
62#define SPLICE_F_MORE (0x04) /* expect more data */ 62#define SPLICE_F_MORE (0x04) /* expect more data */
63 63
64/*
65 * Passed to the actors
66 */
67struct splice_desc {
68 unsigned int len, total_len; /* current and remaining length */
69 unsigned int flags; /* splice flags */
70 struct file *file; /* file to read/write */
71 loff_t pos; /* file position */
72};
73
74typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *,
75 struct splice_desc *);
76
77extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *,
78 loff_t *, size_t, unsigned int,
79 splice_actor *);
80
64#endif 81#endif
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index c4619a428d9b..f8f234708b98 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -344,6 +344,13 @@ extern void skb_over_panic(struct sk_buff *skb, int len,
344 void *here); 344 void *here);
345extern void skb_under_panic(struct sk_buff *skb, int len, 345extern void skb_under_panic(struct sk_buff *skb, int len,
346 void *here); 346 void *here);
347extern void skb_truesize_bug(struct sk_buff *skb);
348
349static inline void skb_truesize_check(struct sk_buff *skb)
350{
351 if (unlikely((int)skb->truesize < sizeof(struct sk_buff) + skb->len))
352 skb_truesize_bug(skb);
353}
347 354
348extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, 355extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
349 int getfrag(void *from, char *to, int offset, 356 int getfrag(void *from, char *to, int offset,
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index d3ebc0e68b2b..3996960fc565 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -574,6 +574,9 @@ asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
574 int fd_out, loff_t __user *off_out, 574 int fd_out, loff_t __user *off_out,
575 size_t len, unsigned int flags); 575 size_t len, unsigned int flags);
576 576
577asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov,
578 unsigned long nr_segs, unsigned int flags);
579
577asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags); 580asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags);
578 581
579asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, 582asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h
index b971d8c82bdd..b1ebfbae397f 100644
--- a/include/net/ieee80211softmac.h
+++ b/include/net/ieee80211softmac.h
@@ -96,10 +96,13 @@ struct ieee80211softmac_assoc_info {
96 * 96 *
97 * bssvalid is true if we found a matching network 97 * bssvalid is true if we found a matching network
98 * and saved it's BSSID into the bssid above. 98 * and saved it's BSSID into the bssid above.
99 *
100 * bssfixed is used for SIOCSIWAP.
99 */ 101 */
100 u8 static_essid:1, 102 u8 static_essid:1,
101 associating:1, 103 associating:1,
102 bssvalid:1; 104 bssvalid:1,
105 bssfixed:1;
103 106
104 /* Scan retries remaining */ 107 /* Scan retries remaining */
105 int scan_retry; 108 int scan_retry;
@@ -267,8 +270,9 @@ extern void ieee80211softmac_stop(struct net_device *dev);
267#define IEEE80211SOFTMAC_EVENT_AUTH_FAILED 5 270#define IEEE80211SOFTMAC_EVENT_AUTH_FAILED 5
268#define IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT 6 271#define IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT 6
269#define IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND 7 272#define IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND 7
273#define IEEE80211SOFTMAC_EVENT_DISASSOCIATED 8
270/* keep this updated! */ 274/* keep this updated! */
271#define IEEE80211SOFTMAC_EVENT_LAST 7 275#define IEEE80211SOFTMAC_EVENT_LAST 8
272/* 276/*
273 * If you want to be notified of certain events, you can call 277 * If you want to be notified of certain events, you can call
274 * ieee80211softmac_notify[_atomic] with 278 * ieee80211softmac_notify[_atomic] with
diff --git a/include/net/sock.h b/include/net/sock.h
index af2b0544586e..ff8b0dad7b0f 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -454,6 +454,7 @@ static inline void sk_stream_set_owner_r(struct sk_buff *skb, struct sock *sk)
454 454
455static inline void sk_stream_free_skb(struct sock *sk, struct sk_buff *skb) 455static inline void sk_stream_free_skb(struct sock *sk, struct sk_buff *skb)
456{ 456{
457 skb_truesize_check(skb);
457 sock_set_flag(sk, SOCK_QUEUE_SHRUNK); 458 sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
458 sk->sk_wmem_queued -= skb->truesize; 459 sk->sk_wmem_queued -= skb->truesize;
459 sk->sk_forward_alloc += skb->truesize; 460 sk->sk_forward_alloc += skb->truesize;
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index d2a7296c8251..b7f0388bd71c 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -836,7 +836,7 @@ static void migrate_hrtimers(int cpu)
836} 836}
837#endif /* CONFIG_HOTPLUG_CPU */ 837#endif /* CONFIG_HOTPLUG_CPU */
838 838
839static int __devinit hrtimer_cpu_notify(struct notifier_block *self, 839static int hrtimer_cpu_notify(struct notifier_block *self,
840 unsigned long action, void *hcpu) 840 unsigned long action, void *hcpu)
841{ 841{
842 long cpu = (long)hcpu; 842 long cpu = (long)hcpu;
@@ -860,7 +860,7 @@ static int __devinit hrtimer_cpu_notify(struct notifier_block *self,
860 return NOTIFY_OK; 860 return NOTIFY_OK;
861} 861}
862 862
863static struct notifier_block __devinitdata hrtimers_nb = { 863static struct notifier_block hrtimers_nb = {
864 .notifier_call = hrtimer_cpu_notify, 864 .notifier_call = hrtimer_cpu_notify,
865}; 865};
866 866
diff --git a/kernel/profile.c b/kernel/profile.c
index 5a730fdb1a2c..68afe121e507 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -299,7 +299,7 @@ out:
299} 299}
300 300
301#ifdef CONFIG_HOTPLUG_CPU 301#ifdef CONFIG_HOTPLUG_CPU
302static int __devinit profile_cpu_callback(struct notifier_block *info, 302static int profile_cpu_callback(struct notifier_block *info,
303 unsigned long action, void *__cpu) 303 unsigned long action, void *__cpu)
304{ 304{
305 int node, cpu = (unsigned long)__cpu; 305 int node, cpu = (unsigned long)__cpu;
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index 13458bbaa1be..6d32ff26f948 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -520,7 +520,7 @@ static void __devinit rcu_online_cpu(int cpu)
520 tasklet_init(&per_cpu(rcu_tasklet, cpu), rcu_process_callbacks, 0UL); 520 tasklet_init(&per_cpu(rcu_tasklet, cpu), rcu_process_callbacks, 0UL);
521} 521}
522 522
523static int __devinit rcu_cpu_notify(struct notifier_block *self, 523static int rcu_cpu_notify(struct notifier_block *self,
524 unsigned long action, void *hcpu) 524 unsigned long action, void *hcpu)
525{ 525{
526 long cpu = (long)hcpu; 526 long cpu = (long)hcpu;
@@ -537,7 +537,7 @@ static int __devinit rcu_cpu_notify(struct notifier_block *self,
537 return NOTIFY_OK; 537 return NOTIFY_OK;
538} 538}
539 539
540static struct notifier_block __devinitdata rcu_nb = { 540static struct notifier_block rcu_nb = {
541 .notifier_call = rcu_cpu_notify, 541 .notifier_call = rcu_cpu_notify,
542}; 542};
543 543
diff --git a/kernel/sched.c b/kernel/sched.c
index 365f0b90b4de..4c64f85698ae 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4814,7 +4814,7 @@ static int migration_call(struct notifier_block *nfb, unsigned long action,
4814/* Register at highest priority so that task migration (migrate_all_tasks) 4814/* Register at highest priority so that task migration (migrate_all_tasks)
4815 * happens before everything else. 4815 * happens before everything else.
4816 */ 4816 */
4817static struct notifier_block __devinitdata migration_notifier = { 4817static struct notifier_block migration_notifier = {
4818 .notifier_call = migration_call, 4818 .notifier_call = migration_call,
4819 .priority = 10 4819 .priority = 10
4820}; 4820};
diff --git a/kernel/softirq.c b/kernel/softirq.c
index ec8fed42a86f..336f92d64e2e 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -446,7 +446,7 @@ static void takeover_tasklets(unsigned int cpu)
446} 446}
447#endif /* CONFIG_HOTPLUG_CPU */ 447#endif /* CONFIG_HOTPLUG_CPU */
448 448
449static int __devinit cpu_callback(struct notifier_block *nfb, 449static int cpu_callback(struct notifier_block *nfb,
450 unsigned long action, 450 unsigned long action,
451 void *hcpu) 451 void *hcpu)
452{ 452{
@@ -484,7 +484,7 @@ static int __devinit cpu_callback(struct notifier_block *nfb,
484 return NOTIFY_OK; 484 return NOTIFY_OK;
485} 485}
486 486
487static struct notifier_block __devinitdata cpu_nfb = { 487static struct notifier_block cpu_nfb = {
488 .notifier_call = cpu_callback 488 .notifier_call = cpu_callback
489}; 489};
490 490
diff --git a/kernel/softlockup.c b/kernel/softlockup.c
index ced91e1ff564..14c7faf02909 100644
--- a/kernel/softlockup.c
+++ b/kernel/softlockup.c
@@ -104,7 +104,7 @@ static int watchdog(void * __bind_cpu)
104/* 104/*
105 * Create/destroy watchdog threads as CPUs come and go: 105 * Create/destroy watchdog threads as CPUs come and go:
106 */ 106 */
107static int __devinit 107static int
108cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) 108cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
109{ 109{
110 int hotcpu = (unsigned long)hcpu; 110 int hotcpu = (unsigned long)hcpu;
@@ -140,7 +140,7 @@ cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
140 return NOTIFY_OK; 140 return NOTIFY_OK;
141} 141}
142 142
143static struct notifier_block __devinitdata cpu_nfb = { 143static struct notifier_block cpu_nfb = {
144 .notifier_call = cpu_callback 144 .notifier_call = cpu_callback
145}; 145};
146 146
diff --git a/kernel/timer.c b/kernel/timer.c
index 883773788836..67eaf0f54096 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1314,7 +1314,7 @@ static void __devinit migrate_timers(int cpu)
1314} 1314}
1315#endif /* CONFIG_HOTPLUG_CPU */ 1315#endif /* CONFIG_HOTPLUG_CPU */
1316 1316
1317static int __devinit timer_cpu_notify(struct notifier_block *self, 1317static int timer_cpu_notify(struct notifier_block *self,
1318 unsigned long action, void *hcpu) 1318 unsigned long action, void *hcpu)
1319{ 1319{
1320 long cpu = (long)hcpu; 1320 long cpu = (long)hcpu;
@@ -1334,7 +1334,7 @@ static int __devinit timer_cpu_notify(struct notifier_block *self,
1334 return NOTIFY_OK; 1334 return NOTIFY_OK;
1335} 1335}
1336 1336
1337static struct notifier_block __devinitdata timers_nb = { 1337static struct notifier_block timers_nb = {
1338 .notifier_call = timer_cpu_notify, 1338 .notifier_call = timer_cpu_notify,
1339}; 1339};
1340 1340
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index e9e464a90376..880fb415a8f6 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -547,7 +547,7 @@ static void take_over_work(struct workqueue_struct *wq, unsigned int cpu)
547} 547}
548 548
549/* We're holding the cpucontrol mutex here */ 549/* We're holding the cpucontrol mutex here */
550static int __devinit workqueue_cpu_callback(struct notifier_block *nfb, 550static int workqueue_cpu_callback(struct notifier_block *nfb,
551 unsigned long action, 551 unsigned long action,
552 void *hcpu) 552 void *hcpu)
553{ 553{
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 123c60586740..ea77c999047e 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1962,7 +1962,7 @@ static inline void free_zone_pagesets(int cpu)
1962 } 1962 }
1963} 1963}
1964 1964
1965static int __cpuinit pageset_cpuup_callback(struct notifier_block *nfb, 1965static int pageset_cpuup_callback(struct notifier_block *nfb,
1966 unsigned long action, 1966 unsigned long action,
1967 void *hcpu) 1967 void *hcpu)
1968{ 1968{
diff --git a/mm/shmem.c b/mm/shmem.c
index 37eaf42ed2c6..4c5e68e4e9ae 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -46,6 +46,8 @@
46#include <linux/mempolicy.h> 46#include <linux/mempolicy.h>
47#include <linux/namei.h> 47#include <linux/namei.h>
48#include <linux/ctype.h> 48#include <linux/ctype.h>
49#include <linux/migrate.h>
50
49#include <asm/uaccess.h> 51#include <asm/uaccess.h>
50#include <asm/div64.h> 52#include <asm/div64.h>
51#include <asm/pgtable.h> 53#include <asm/pgtable.h>
@@ -2173,6 +2175,7 @@ static struct address_space_operations shmem_aops = {
2173 .prepare_write = shmem_prepare_write, 2175 .prepare_write = shmem_prepare_write,
2174 .commit_write = simple_commit_write, 2176 .commit_write = simple_commit_write,
2175#endif 2177#endif
2178 .migratepage = migrate_page,
2176}; 2179};
2177 2180
2178static struct file_operations shmem_file_operations = { 2181static struct file_operations shmem_file_operations = {
diff --git a/mm/slab.c b/mm/slab.c
index e6ef9bd52335..af5c5237e11a 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1036,7 +1036,7 @@ static inline void free_alien_cache(struct array_cache **ac_ptr)
1036 1036
1037#endif 1037#endif
1038 1038
1039static int __devinit cpuup_callback(struct notifier_block *nfb, 1039static int cpuup_callback(struct notifier_block *nfb,
1040 unsigned long action, void *hcpu) 1040 unsigned long action, void *hcpu)
1041{ 1041{
1042 long cpu = (long)hcpu; 1042 long cpu = (long)hcpu;
diff --git a/mm/vmscan.c b/mm/vmscan.c
index acdf001d6941..4649a63a8cb6 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1328,7 +1328,7 @@ repeat:
1328 not required for correctness. So if the last cpu in a node goes 1328 not required for correctness. So if the last cpu in a node goes
1329 away, we get changed to run anywhere: as the first one comes back, 1329 away, we get changed to run anywhere: as the first one comes back,
1330 restore their cpu bindings. */ 1330 restore their cpu bindings. */
1331static int __devinit cpu_callback(struct notifier_block *nfb, 1331static int cpu_callback(struct notifier_block *nfb,
1332 unsigned long action, void *hcpu) 1332 unsigned long action, void *hcpu)
1333{ 1333{
1334 pg_data_t *pgdat; 1334 pg_data_t *pgdat;
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index 2d24fb400e0c..56f3aa47e758 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -16,6 +16,7 @@
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/netdevice.h> 17#include <linux/netdevice.h>
18#include <linux/skbuff.h> 18#include <linux/skbuff.h>
19#include <linux/if_vlan.h>
19#include <linux/netfilter_bridge.h> 20#include <linux/netfilter_bridge.h>
20#include "br_private.h" 21#include "br_private.h"
21 22
@@ -29,10 +30,15 @@ static inline int should_deliver(const struct net_bridge_port *p,
29 return 1; 30 return 1;
30} 31}
31 32
33static inline unsigned packet_length(const struct sk_buff *skb)
34{
35 return skb->len - (skb->protocol == htons(ETH_P_8021Q) ? VLAN_HLEN : 0);
36}
37
32int br_dev_queue_push_xmit(struct sk_buff *skb) 38int br_dev_queue_push_xmit(struct sk_buff *skb)
33{ 39{
34 /* drop mtu oversized packets except tso */ 40 /* drop mtu oversized packets except tso */
35 if (skb->len > skb->dev->mtu && !skb_shinfo(skb)->tso_size) 41 if (packet_length(skb) > skb->dev->mtu && !skb_shinfo(skb)->tso_size)
36 kfree_skb(skb); 42 kfree_skb(skb);
37 else { 43 else {
38#ifdef CONFIG_BRIDGE_NETFILTER 44#ifdef CONFIG_BRIDGE_NETFILTER
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 84b9af76f0a2..3a13ed643459 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -831,7 +831,7 @@ static int translate_table(struct ebt_replace *repl,
831 return -ENOMEM; 831 return -ENOMEM;
832 for_each_possible_cpu(i) { 832 for_each_possible_cpu(i) {
833 newinfo->chainstack[i] = 833 newinfo->chainstack[i] =
834 vmalloc(udc_cnt * sizeof(struct ebt_chainstack)); 834 vmalloc(udc_cnt * sizeof(*(newinfo->chainstack[0])));
835 if (!newinfo->chainstack[i]) { 835 if (!newinfo->chainstack[i]) {
836 while (i) 836 while (i)
837 vfree(newinfo->chainstack[--i]); 837 vfree(newinfo->chainstack[--i]);
@@ -841,8 +841,7 @@ static int translate_table(struct ebt_replace *repl,
841 } 841 }
842 } 842 }
843 843
844 cl_s = (struct ebt_cl_stack *) 844 cl_s = vmalloc(udc_cnt * sizeof(*cl_s));
845 vmalloc(udc_cnt * sizeof(struct ebt_cl_stack));
846 if (!cl_s) 845 if (!cl_s)
847 return -ENOMEM; 846 return -ENOMEM;
848 i = 0; /* the i'th udc */ 847 i = 0; /* the i'th udc */
@@ -944,8 +943,7 @@ static int do_replace(void __user *user, unsigned int len)
944 943
945 countersize = COUNTER_OFFSET(tmp.nentries) * 944 countersize = COUNTER_OFFSET(tmp.nentries) *
946 (highest_possible_processor_id()+1); 945 (highest_possible_processor_id()+1);
947 newinfo = (struct ebt_table_info *) 946 newinfo = vmalloc(sizeof(*newinfo) + countersize);
948 vmalloc(sizeof(struct ebt_table_info) + countersize);
949 if (!newinfo) 947 if (!newinfo)
950 return -ENOMEM; 948 return -ENOMEM;
951 949
@@ -967,8 +965,7 @@ static int do_replace(void __user *user, unsigned int len)
967 /* the user wants counters back 965 /* the user wants counters back
968 the check on the size is done later, when we have the lock */ 966 the check on the size is done later, when we have the lock */
969 if (tmp.num_counters) { 967 if (tmp.num_counters) {
970 counterstmp = (struct ebt_counter *) 968 counterstmp = vmalloc(tmp.num_counters * sizeof(*counterstmp));
971 vmalloc(tmp.num_counters * sizeof(struct ebt_counter));
972 if (!counterstmp) { 969 if (!counterstmp) {
973 ret = -ENOMEM; 970 ret = -ENOMEM;
974 goto free_entries; 971 goto free_entries;
@@ -1148,8 +1145,7 @@ int ebt_register_table(struct ebt_table *table)
1148 1145
1149 countersize = COUNTER_OFFSET(table->table->nentries) * 1146 countersize = COUNTER_OFFSET(table->table->nentries) *
1150 (highest_possible_processor_id()+1); 1147 (highest_possible_processor_id()+1);
1151 newinfo = (struct ebt_table_info *) 1148 newinfo = vmalloc(sizeof(*newinfo) + countersize);
1152 vmalloc(sizeof(struct ebt_table_info) + countersize);
1153 ret = -ENOMEM; 1149 ret = -ENOMEM;
1154 if (!newinfo) 1150 if (!newinfo)
1155 return -ENOMEM; 1151 return -ENOMEM;
@@ -1247,8 +1243,7 @@ static int update_counters(void __user *user, unsigned int len)
1247 if (hlp.num_counters == 0) 1243 if (hlp.num_counters == 0)
1248 return -EINVAL; 1244 return -EINVAL;
1249 1245
1250 if ( !(tmp = (struct ebt_counter *) 1246 if (!(tmp = vmalloc(hlp.num_counters * sizeof(*tmp)))) {
1251 vmalloc(hlp.num_counters * sizeof(struct ebt_counter))) ){
1252 MEMPRINT("Update_counters && nomemory\n"); 1247 MEMPRINT("Update_counters && nomemory\n");
1253 return -ENOMEM; 1248 return -ENOMEM;
1254 } 1249 }
@@ -1377,8 +1372,7 @@ static int copy_everything_to_user(struct ebt_table *t, void __user *user,
1377 BUGPRINT("Num_counters wrong\n"); 1372 BUGPRINT("Num_counters wrong\n");
1378 return -EINVAL; 1373 return -EINVAL;
1379 } 1374 }
1380 counterstmp = (struct ebt_counter *) 1375 counterstmp = vmalloc(nentries * sizeof(*counterstmp));
1381 vmalloc(nentries * sizeof(struct ebt_counter));
1382 if (!counterstmp) { 1376 if (!counterstmp) {
1383 MEMPRINT("Couldn't copy counters, out of memory\n"); 1377 MEMPRINT("Couldn't copy counters, out of memory\n");
1384 return -ENOMEM; 1378 return -ENOMEM;
diff --git a/net/core/dev.c b/net/core/dev.c
index 83231a27ae02..3bad1afc89fa 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2698,7 +2698,8 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
2698 /* If command is `set a parameter', or 2698 /* If command is `set a parameter', or
2699 * `get the encoding parameters', check if 2699 * `get the encoding parameters', check if
2700 * the user has the right to do it */ 2700 * the user has the right to do it */
2701 if (IW_IS_SET(cmd) || cmd == SIOCGIWENCODE) { 2701 if (IW_IS_SET(cmd) || cmd == SIOCGIWENCODE
2702 || cmd == SIOCGIWENCODEEXT) {
2702 if (!capable(CAP_NET_ADMIN)) 2703 if (!capable(CAP_NET_ADMIN))
2703 return -EPERM; 2704 return -EPERM;
2704 } 2705 }
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 09464fa8d72f..fb3770f9c094 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -112,6 +112,14 @@ void skb_under_panic(struct sk_buff *skb, int sz, void *here)
112 BUG(); 112 BUG();
113} 113}
114 114
115void skb_truesize_bug(struct sk_buff *skb)
116{
117 printk(KERN_ERR "SKB BUG: Invalid truesize (%u) "
118 "len=%u, sizeof(sk_buff)=%Zd\n",
119 skb->truesize, skb->len, sizeof(struct sk_buff));
120}
121EXPORT_SYMBOL(skb_truesize_bug);
122
115/* Allocate a new skbuff. We do this ourselves so we can fill in a few 123/* Allocate a new skbuff. We do this ourselves so we can fill in a few
116 * 'private' fields and also do memory statistics to find all the 124 * 'private' fields and also do memory statistics to find all the
117 * [BEEP] leaks. 125 * [BEEP] leaks.
diff --git a/net/core/stream.c b/net/core/stream.c
index 35e25259fd95..e9489696f694 100644
--- a/net/core/stream.c
+++ b/net/core/stream.c
@@ -176,6 +176,7 @@ void sk_stream_rfree(struct sk_buff *skb)
176{ 176{
177 struct sock *sk = skb->sk; 177 struct sock *sk = skb->sk;
178 178
179 skb_truesize_check(skb);
179 atomic_sub(skb->truesize, &sk->sk_rmem_alloc); 180 atomic_sub(skb->truesize, &sk->sk_rmem_alloc);
180 sk->sk_forward_alloc += skb->truesize; 181 sk->sk_forward_alloc += skb->truesize;
181} 182}
diff --git a/net/core/wireless.c b/net/core/wireless.c
index 81d6995fcfdb..d2bc72d318f7 100644
--- a/net/core/wireless.c
+++ b/net/core/wireless.c
@@ -1726,6 +1726,14 @@ int wireless_rtnetlink_get(struct net_device * dev,
1726 if(!IW_IS_GET(request->cmd)) 1726 if(!IW_IS_GET(request->cmd))
1727 return -EOPNOTSUPP; 1727 return -EOPNOTSUPP;
1728 1728
1729 /* If command is `get the encoding parameters', check if
1730 * the user has the right to do it */
1731 if (request->cmd == SIOCGIWENCODE ||
1732 request->cmd == SIOCGIWENCODEEXT) {
1733 if (!capable(CAP_NET_ADMIN))
1734 return -EPERM;
1735 }
1736
1729 /* Special cases */ 1737 /* Special cases */
1730 if(request->cmd == SIOCGIWSTATS) 1738 if(request->cmd == SIOCGIWSTATS)
1731 /* Get Wireless Stats */ 1739 /* Get Wireless Stats */
diff --git a/net/ieee80211/softmac/Kconfig b/net/ieee80211/softmac/Kconfig
index 6cd9f3427be6..f2a27cc6ecb1 100644
--- a/net/ieee80211/softmac/Kconfig
+++ b/net/ieee80211/softmac/Kconfig
@@ -1,6 +1,7 @@
1config IEEE80211_SOFTMAC 1config IEEE80211_SOFTMAC
2 tristate "Software MAC add-on to the IEEE 802.11 networking stack" 2 tristate "Software MAC add-on to the IEEE 802.11 networking stack"
3 depends on IEEE80211 && EXPERIMENTAL 3 depends on IEEE80211 && EXPERIMENTAL
4 select WIRELESS_EXT
4 ---help--- 5 ---help---
5 This option enables the hardware independent software MAC addon 6 This option enables the hardware independent software MAC addon
6 for the IEEE 802.11 networking stack. 7 for the IEEE 802.11 networking stack.
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c
index be61de78dfa4..fb79ce7d6439 100644
--- a/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -101,6 +101,7 @@ ieee80211softmac_disassoc(struct ieee80211softmac_device *mac, u16 reason)
101 /* Do NOT clear bssvalid as that will break ieee80211softmac_assoc_work! */ 101 /* Do NOT clear bssvalid as that will break ieee80211softmac_assoc_work! */
102 mac->associated = 0; 102 mac->associated = 0;
103 mac->associnfo.associating = 0; 103 mac->associnfo.associating = 0;
104 ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_DISASSOCIATED, NULL);
104 spin_unlock_irqrestore(&mac->lock, flags); 105 spin_unlock_irqrestore(&mac->lock, flags);
105} 106}
106 107
@@ -143,6 +144,12 @@ network_matches_request(struct ieee80211softmac_device *mac, struct ieee80211_ne
143 if (!we_support_all_basic_rates(mac, net->rates_ex, net->rates_ex_len)) 144 if (!we_support_all_basic_rates(mac, net->rates_ex, net->rates_ex_len))
144 return 0; 145 return 0;
145 146
147 /* assume that users know what they're doing ...
148 * (note we don't let them select a net we're incompatible with) */
149 if (mac->associnfo.bssfixed) {
150 return !memcmp(mac->associnfo.bssid, net->bssid, ETH_ALEN);
151 }
152
146 /* if 'ANY' network requested, take any that doesn't have privacy enabled */ 153 /* if 'ANY' network requested, take any that doesn't have privacy enabled */
147 if (mac->associnfo.req_essid.len == 0 154 if (mac->associnfo.req_essid.len == 0
148 && !(net->capability & WLAN_CAPABILITY_PRIVACY)) 155 && !(net->capability & WLAN_CAPABILITY_PRIVACY))
@@ -175,7 +182,7 @@ ieee80211softmac_assoc_work(void *d)
175 ieee80211softmac_disassoc(mac, WLAN_REASON_DISASSOC_STA_HAS_LEFT); 182 ieee80211softmac_disassoc(mac, WLAN_REASON_DISASSOC_STA_HAS_LEFT);
176 183
177 /* try to find the requested network in our list, if we found one already */ 184 /* try to find the requested network in our list, if we found one already */
178 if (mac->associnfo.bssvalid) 185 if (mac->associnfo.bssvalid || mac->associnfo.bssfixed)
179 found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid); 186 found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid);
180 187
181 /* Search the ieee80211 networks for this network if we didn't find it by bssid, 188 /* Search the ieee80211 networks for this network if we didn't find it by bssid,
@@ -240,19 +247,25 @@ ieee80211softmac_assoc_work(void *d)
240 if (ieee80211softmac_start_scan(mac)) 247 if (ieee80211softmac_start_scan(mac))
241 dprintk(KERN_INFO PFX "Associate: failed to initiate scan. Is device up?\n"); 248 dprintk(KERN_INFO PFX "Associate: failed to initiate scan. Is device up?\n");
242 return; 249 return;
243 } 250 } else {
244 else {
245 spin_lock_irqsave(&mac->lock, flags); 251 spin_lock_irqsave(&mac->lock, flags);
246 mac->associnfo.associating = 0; 252 mac->associnfo.associating = 0;
247 mac->associated = 0; 253 mac->associated = 0;
248 spin_unlock_irqrestore(&mac->lock, flags); 254 spin_unlock_irqrestore(&mac->lock, flags);
249 255
250 dprintk(KERN_INFO PFX "Unable to find matching network after scan!\n"); 256 dprintk(KERN_INFO PFX "Unable to find matching network after scan!\n");
257 /* reset the retry counter for the next user request since we
258 * break out and don't reschedule ourselves after this point. */
259 mac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;
251 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND, NULL); 260 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND, NULL);
252 return; 261 return;
253 } 262 }
254 } 263 }
255 264
265 /* reset the retry counter for the next user request since we
266 * now found a net and will try to associate to it, but not
267 * schedule this function again. */
268 mac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;
256 mac->associnfo.bssvalid = 1; 269 mac->associnfo.bssvalid = 1;
257 memcpy(mac->associnfo.bssid, found->bssid, ETH_ALEN); 270 memcpy(mac->associnfo.bssid, found->bssid, ETH_ALEN);
258 /* copy the ESSID for displaying it */ 271 /* copy the ESSID for displaying it */
@@ -373,6 +386,7 @@ ieee80211softmac_handle_disassoc(struct net_device * dev,
373 spin_lock_irqsave(&mac->lock, flags); 386 spin_lock_irqsave(&mac->lock, flags);
374 mac->associnfo.bssvalid = 0; 387 mac->associnfo.bssvalid = 0;
375 mac->associated = 0; 388 mac->associated = 0;
389 ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_DISASSOCIATED, NULL);
376 schedule_work(&mac->associnfo.work); 390 schedule_work(&mac->associnfo.work);
377 spin_unlock_irqrestore(&mac->lock, flags); 391 spin_unlock_irqrestore(&mac->lock, flags);
378 392
@@ -391,6 +405,7 @@ ieee80211softmac_handle_reassoc_req(struct net_device * dev,
391 dprintkl(KERN_INFO PFX "reassoc request from unknown network\n"); 405 dprintkl(KERN_INFO PFX "reassoc request from unknown network\n");
392 return 0; 406 return 0;
393 } 407 }
394 ieee80211softmac_assoc(mac, network); 408 schedule_work(&mac->associnfo.work);
409
395 return 0; 410 return 0;
396} 411}
diff --git a/net/ieee80211/softmac/ieee80211softmac_event.c b/net/ieee80211/softmac/ieee80211softmac_event.c
index 0a52bbda1e4c..8cc8f3f0f8e7 100644
--- a/net/ieee80211/softmac/ieee80211softmac_event.c
+++ b/net/ieee80211/softmac/ieee80211softmac_event.c
@@ -67,6 +67,7 @@ static char *event_descriptions[IEEE80211SOFTMAC_EVENT_LAST+1] = {
67 "authenticating failed", 67 "authenticating failed",
68 "authenticating timed out", 68 "authenticating timed out",
69 "associating failed because no suitable network was found", 69 "associating failed because no suitable network was found",
70 "disassociated",
70}; 71};
71 72
72 73
@@ -128,13 +129,42 @@ void
128ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int event, void *event_ctx) 129ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int event, void *event_ctx)
129{ 130{
130 struct ieee80211softmac_event *eventptr, *tmp; 131 struct ieee80211softmac_event *eventptr, *tmp;
131 union iwreq_data wrqu; 132 struct ieee80211softmac_network *network;
132 char *msg;
133 133
134 if (event >= 0) { 134 if (event >= 0) {
135 msg = event_descriptions[event]; 135 union iwreq_data wrqu;
136 wrqu.data.length = strlen(msg); 136 int we_event;
137 wireless_send_event(mac->dev, IWEVCUSTOM, &wrqu, msg); 137 char *msg = NULL;
138
139 switch(event) {
140 case IEEE80211SOFTMAC_EVENT_ASSOCIATED:
141 network = (struct ieee80211softmac_network *)event_ctx;
142 wrqu.data.length = 0;
143 wrqu.data.flags = 0;
144 memcpy(wrqu.ap_addr.sa_data, &network->bssid[0], ETH_ALEN);
145 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
146 we_event = SIOCGIWAP;
147 break;
148 case IEEE80211SOFTMAC_EVENT_DISASSOCIATED:
149 wrqu.data.length = 0;
150 wrqu.data.flags = 0;
151 memset(&wrqu, '\0', sizeof (union iwreq_data));
152 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
153 we_event = SIOCGIWAP;
154 break;
155 case IEEE80211SOFTMAC_EVENT_SCAN_FINISHED:
156 wrqu.data.length = 0;
157 wrqu.data.flags = 0;
158 memset(&wrqu, '\0', sizeof (union iwreq_data));
159 we_event = SIOCGIWSCAN;
160 break;
161 default:
162 msg = event_descriptions[event];
163 wrqu.data.length = strlen(msg);
164 we_event = IWEVCUSTOM;
165 break;
166 }
167 wireless_send_event(mac->dev, we_event, &wrqu, msg);
138 } 168 }
139 169
140 if (!list_empty(&mac->events)) 170 if (!list_empty(&mac->events))
diff --git a/net/ieee80211/softmac/ieee80211softmac_io.c b/net/ieee80211/softmac/ieee80211softmac_io.c
index febc51dbb412..cc6cd56c85b1 100644
--- a/net/ieee80211/softmac/ieee80211softmac_io.c
+++ b/net/ieee80211/softmac/ieee80211softmac_io.c
@@ -180,9 +180,21 @@ ieee80211softmac_assoc_req(struct ieee80211_assoc_request **pkt,
180 ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_ASSOC_REQ, net->bssid, net->bssid); 180 ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_ASSOC_REQ, net->bssid, net->bssid);
181 181
182 /* Fill in capability Info */ 182 /* Fill in capability Info */
183 (*pkt)->capability = (mac->ieee->iw_mode == IW_MODE_MASTER) || (mac->ieee->iw_mode == IW_MODE_INFRA) ? 183 switch (mac->ieee->iw_mode) {
184 cpu_to_le16(WLAN_CAPABILITY_ESS) : 184 case IW_MODE_INFRA:
185 cpu_to_le16(WLAN_CAPABILITY_IBSS); 185 (*pkt)->capability = cpu_to_le16(WLAN_CAPABILITY_ESS);
186 break;
187 case IW_MODE_ADHOC:
188 (*pkt)->capability = cpu_to_le16(WLAN_CAPABILITY_IBSS);
189 break;
190 case IW_MODE_AUTO:
191 (*pkt)->capability = net->capabilities & (WLAN_CAPABILITY_ESS|WLAN_CAPABILITY_IBSS);
192 break;
193 default:
194 /* bleh. we don't ever go to these modes */
195 printk(KERN_ERR PFX "invalid iw_mode!\n");
196 break;
197 }
186 /* Need to add this 198 /* Need to add this
187 (*pkt)->capability |= mac->ieee->short_slot ? 199 (*pkt)->capability |= mac->ieee->short_slot ?
188 cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME) : 0; 200 cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME) : 0;
diff --git a/net/ieee80211/softmac/ieee80211softmac_module.c b/net/ieee80211/softmac/ieee80211softmac_module.c
index 60f06a31f0d1..be83bdc1644a 100644
--- a/net/ieee80211/softmac/ieee80211softmac_module.c
+++ b/net/ieee80211/softmac/ieee80211softmac_module.c
@@ -45,6 +45,8 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv)
45 softmac->ieee->handle_disassoc = ieee80211softmac_handle_disassoc; 45 softmac->ieee->handle_disassoc = ieee80211softmac_handle_disassoc;
46 softmac->scaninfo = NULL; 46 softmac->scaninfo = NULL;
47 47
48 softmac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;
49
48 /* TODO: initialise all the other callbacks in the ieee struct 50 /* TODO: initialise all the other callbacks in the ieee struct
49 * (once they're written) 51 * (once they're written)
50 */ 52 */
diff --git a/net/ieee80211/softmac/ieee80211softmac_scan.c b/net/ieee80211/softmac/ieee80211softmac_scan.c
index bb9ab8b45d09..2b9e7edfa3ce 100644
--- a/net/ieee80211/softmac/ieee80211softmac_scan.c
+++ b/net/ieee80211/softmac/ieee80211softmac_scan.c
@@ -47,6 +47,7 @@ ieee80211softmac_start_scan(struct ieee80211softmac_device *sm)
47 sm->scanning = 1; 47 sm->scanning = 1;
48 spin_unlock_irqrestore(&sm->lock, flags); 48 spin_unlock_irqrestore(&sm->lock, flags);
49 49
50 netif_tx_disable(sm->ieee->dev);
50 ret = sm->start_scan(sm->dev); 51 ret = sm->start_scan(sm->dev);
51 if (ret) { 52 if (ret) {
52 spin_lock_irqsave(&sm->lock, flags); 53 spin_lock_irqsave(&sm->lock, flags);
@@ -239,6 +240,7 @@ void ieee80211softmac_scan_finished(struct ieee80211softmac_device *sm)
239 if (net) 240 if (net)
240 sm->set_channel(sm->dev, net->channel); 241 sm->set_channel(sm->dev, net->channel);
241 } 242 }
243 netif_wake_queue(sm->ieee->dev);
242 ieee80211softmac_call_events(sm, IEEE80211SOFTMAC_EVENT_SCAN_FINISHED, NULL); 244 ieee80211softmac_call_events(sm, IEEE80211SOFTMAC_EVENT_SCAN_FINISHED, NULL);
243} 245}
244EXPORT_SYMBOL_GPL(ieee80211softmac_scan_finished); 246EXPORT_SYMBOL_GPL(ieee80211softmac_scan_finished);
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
index b559aa9b5507..27edb2b5581a 100644
--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -27,7 +27,8 @@
27#include "ieee80211softmac_priv.h" 27#include "ieee80211softmac_priv.h"
28 28
29#include <net/iw_handler.h> 29#include <net/iw_handler.h>
30 30/* for is_broadcast_ether_addr and is_zero_ether_addr */
31#include <linux/etherdevice.h>
31 32
32int 33int
33ieee80211softmac_wx_trigger_scan(struct net_device *net_dev, 34ieee80211softmac_wx_trigger_scan(struct net_device *net_dev,
@@ -41,13 +42,23 @@ ieee80211softmac_wx_trigger_scan(struct net_device *net_dev,
41EXPORT_SYMBOL_GPL(ieee80211softmac_wx_trigger_scan); 42EXPORT_SYMBOL_GPL(ieee80211softmac_wx_trigger_scan);
42 43
43 44
45/* if we're still scanning, return -EAGAIN so that userspace tools
46 * can get the complete scan results, otherwise return 0. */
44int 47int
45ieee80211softmac_wx_get_scan_results(struct net_device *net_dev, 48ieee80211softmac_wx_get_scan_results(struct net_device *net_dev,
46 struct iw_request_info *info, 49 struct iw_request_info *info,
47 union iwreq_data *data, 50 union iwreq_data *data,
48 char *extra) 51 char *extra)
49{ 52{
53 unsigned long flags;
50 struct ieee80211softmac_device *sm = ieee80211_priv(net_dev); 54 struct ieee80211softmac_device *sm = ieee80211_priv(net_dev);
55
56 spin_lock_irqsave(&sm->lock, flags);
57 if (sm->scanning) {
58 spin_unlock_irqrestore(&sm->lock, flags);
59 return -EAGAIN;
60 }
61 spin_unlock_irqrestore(&sm->lock, flags);
51 return ieee80211_wx_get_scan(sm->ieee, info, data, extra); 62 return ieee80211_wx_get_scan(sm->ieee, info, data, extra);
52} 63}
53EXPORT_SYMBOL_GPL(ieee80211softmac_wx_get_scan_results); 64EXPORT_SYMBOL_GPL(ieee80211softmac_wx_get_scan_results);
@@ -73,7 +84,6 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
73 sm->associnfo.static_essid = 1; 84 sm->associnfo.static_essid = 1;
74 } 85 }
75 } 86 }
76 sm->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;
77 87
78 /* set our requested ESSID length. 88 /* set our requested ESSID length.
79 * If applicable, we have already copied the data in */ 89 * If applicable, we have already copied the data in */
@@ -300,8 +310,6 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
300 char *extra) 310 char *extra)
301{ 311{
302 struct ieee80211softmac_device *mac = ieee80211_priv(net_dev); 312 struct ieee80211softmac_device *mac = ieee80211_priv(net_dev);
303 static const unsigned char any[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
304 static const unsigned char off[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
305 unsigned long flags; 313 unsigned long flags;
306 314
307 /* sanity check */ 315 /* sanity check */
@@ -310,10 +318,17 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
310 } 318 }
311 319
312 spin_lock_irqsave(&mac->lock, flags); 320 spin_lock_irqsave(&mac->lock, flags);
313 if (!memcmp(any, data->ap_addr.sa_data, ETH_ALEN) || 321 if (is_broadcast_ether_addr(data->ap_addr.sa_data)) {
314 !memcmp(off, data->ap_addr.sa_data, ETH_ALEN)) { 322 /* the bssid we have is not to be fixed any longer,
315 schedule_work(&mac->associnfo.work); 323 * and we should reassociate to the best AP. */
316 goto out; 324 mac->associnfo.bssfixed = 0;
325 /* force reassociation */
326 mac->associnfo.bssvalid = 0;
327 if (mac->associated)
328 schedule_work(&mac->associnfo.work);
329 } else if (is_zero_ether_addr(data->ap_addr.sa_data)) {
330 /* the bssid we have is no longer fixed */
331 mac->associnfo.bssfixed = 0;
317 } else { 332 } else {
318 if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) { 333 if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) {
319 if (mac->associnfo.associating || mac->associated) { 334 if (mac->associnfo.associating || mac->associated) {
@@ -323,12 +338,14 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
323 } else { 338 } else {
324 /* copy new value in data->ap_addr.sa_data to bssid */ 339 /* copy new value in data->ap_addr.sa_data to bssid */
325 memcpy(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN); 340 memcpy(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN);
326 } 341 }
342 /* tell the other code that this bssid should be used no matter what */
343 mac->associnfo.bssfixed = 1;
327 /* queue associate if new bssid or (old one again and not associated) */ 344 /* queue associate if new bssid or (old one again and not associated) */
328 schedule_work(&mac->associnfo.work); 345 schedule_work(&mac->associnfo.work);
329 } 346 }
330 347
331out: 348 out:
332 spin_unlock_irqrestore(&mac->lock, flags); 349 spin_unlock_irqrestore(&mac->lock, flags);
333 return 0; 350 return 0;
334} 351}
diff --git a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig
index c60fd5c4ea1e..3d560dec63ab 100644
--- a/net/ipv4/netfilter/Kconfig
+++ b/net/ipv4/netfilter/Kconfig
@@ -345,7 +345,7 @@ config IP_NF_TARGET_LOG
345 To compile it as a module, choose M here. If unsure, say N. 345 To compile it as a module, choose M here. If unsure, say N.
346 346
347config IP_NF_TARGET_ULOG 347config IP_NF_TARGET_ULOG
348 tristate "ULOG target support (OBSOLETE)" 348 tristate "ULOG target support"
349 depends on IP_NF_IPTABLES 349 depends on IP_NF_IPTABLES
350 ---help--- 350 ---help---
351 351
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 44df1db726a3..a28ae593b976 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -533,6 +533,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
533 struct tcp_sock *tp = tcp_sk(sk); 533 struct tcp_sock *tp = tcp_sk(sk);
534 struct sk_buff *buff; 534 struct sk_buff *buff;
535 int nsize, old_factor; 535 int nsize, old_factor;
536 int nlen;
536 u16 flags; 537 u16 flags;
537 538
538 BUG_ON(len > skb->len); 539 BUG_ON(len > skb->len);
@@ -552,8 +553,10 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
552 if (buff == NULL) 553 if (buff == NULL)
553 return -ENOMEM; /* We'll just try again later. */ 554 return -ENOMEM; /* We'll just try again later. */
554 555
555 buff->truesize = skb->len - len; 556 sk_charge_skb(sk, buff);
556 skb->truesize -= buff->truesize; 557 nlen = skb->len - len - nsize;
558 buff->truesize += nlen;
559 skb->truesize -= nlen;
557 560
558 /* Correct the sequence numbers. */ 561 /* Correct the sequence numbers. */
559 TCP_SKB_CB(buff)->seq = TCP_SKB_CB(skb)->seq + len; 562 TCP_SKB_CB(buff)->seq = TCP_SKB_CB(skb)->seq + len;
@@ -1039,7 +1042,8 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len,
1039 if (unlikely(buff == NULL)) 1042 if (unlikely(buff == NULL))
1040 return -ENOMEM; 1043 return -ENOMEM;
1041 1044
1042 buff->truesize = nlen; 1045 sk_charge_skb(sk, buff);
1046 buff->truesize += nlen;
1043 skb->truesize -= nlen; 1047 skb->truesize -= nlen;
1044 1048
1045 /* Correct the sequence numbers. */ 1049 /* Correct the sequence numbers. */
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 642b4b11464f..0a673038344f 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -288,19 +288,6 @@ ip6t_do_table(struct sk_buff **pskb,
288 table_base = (void *)private->entries[smp_processor_id()]; 288 table_base = (void *)private->entries[smp_processor_id()];
289 e = get_entry(table_base, private->hook_entry[hook]); 289 e = get_entry(table_base, private->hook_entry[hook]);
290 290
291#ifdef CONFIG_NETFILTER_DEBUG
292 /* Check noone else using our table */
293 if (((struct ip6t_entry *)table_base)->comefrom != 0xdead57ac
294 && ((struct ip6t_entry *)table_base)->comefrom != 0xeeeeeeec) {
295 printk("ASSERT: CPU #%u, %s comefrom(%p) = %X\n",
296 smp_processor_id(),
297 table->name,
298 &((struct ip6t_entry *)table_base)->comefrom,
299 ((struct ip6t_entry *)table_base)->comefrom);
300 }
301 ((struct ip6t_entry *)table_base)->comefrom = 0x57acc001;
302#endif
303
304 /* For return from builtin chain */ 291 /* For return from builtin chain */
305 back = get_entry(table_base, private->underflow[hook]); 292 back = get_entry(table_base, private->underflow[hook]);
306 293
diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c
index 8f3addf0724c..d62e0f9b9da3 100644
--- a/net/llc/llc_input.c
+++ b/net/llc/llc_input.c
@@ -118,7 +118,8 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
118 u16 pdulen = eth_hdr(skb)->h_proto, 118 u16 pdulen = eth_hdr(skb)->h_proto,
119 data_size = ntohs(pdulen) - llc_len; 119 data_size = ntohs(pdulen) - llc_len;
120 120
121 skb_trim(skb, data_size); 121 if (unlikely(pskb_trim_rcsum(skb, data_size)))
122 return 0;
122 } 123 }
123 return 1; 124 return 1;
124} 125}
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index e581190fb6c3..f9b83f91371a 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -178,9 +178,6 @@ static struct {
178 /* allocated slab cache + modules which uses this slab cache */ 178 /* allocated slab cache + modules which uses this slab cache */
179 int use; 179 int use;
180 180
181 /* Initialization */
182 int (*init_conntrack)(struct nf_conn *, u_int32_t);
183
184} nf_ct_cache[NF_CT_F_NUM]; 181} nf_ct_cache[NF_CT_F_NUM];
185 182
186/* protect members of nf_ct_cache except of "use" */ 183/* protect members of nf_ct_cache except of "use" */
@@ -208,10 +205,8 @@ nf_ct_proto_find_get(u_int16_t l3proto, u_int8_t protocol)
208 205
209 preempt_disable(); 206 preempt_disable();
210 p = __nf_ct_proto_find(l3proto, protocol); 207 p = __nf_ct_proto_find(l3proto, protocol);
211 if (p) { 208 if (!try_module_get(p->me))
212 if (!try_module_get(p->me)) 209 p = &nf_conntrack_generic_protocol;
213 p = &nf_conntrack_generic_protocol;
214 }
215 preempt_enable(); 210 preempt_enable();
216 211
217 return p; 212 return p;
@@ -229,10 +224,8 @@ nf_ct_l3proto_find_get(u_int16_t l3proto)
229 224
230 preempt_disable(); 225 preempt_disable();
231 p = __nf_ct_l3proto_find(l3proto); 226 p = __nf_ct_l3proto_find(l3proto);
232 if (p) { 227 if (!try_module_get(p->me))
233 if (!try_module_get(p->me)) 228 p = &nf_conntrack_generic_l3proto;
234 p = &nf_conntrack_generic_l3proto;
235 }
236 preempt_enable(); 229 preempt_enable();
237 230
238 return p; 231 return p;
diff --git a/net/netfilter/nf_conntrack_l3proto_generic.c b/net/netfilter/nf_conntrack_l3proto_generic.c
index 7de4f06c63c5..3fc58e454d4e 100644
--- a/net/netfilter/nf_conntrack_l3proto_generic.c
+++ b/net/netfilter/nf_conntrack_l3proto_generic.c
@@ -94,5 +94,4 @@ struct nf_conntrack_l3proto nf_conntrack_generic_l3proto = {
94 .print_conntrack = generic_print_conntrack, 94 .print_conntrack = generic_print_conntrack,
95 .prepare = generic_prepare, 95 .prepare = generic_prepare,
96 .get_features = generic_get_features, 96 .get_features = generic_get_features,
97 .me = THIS_MODULE,
98}; 97};
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 00cf0a4f4d92..17abf60f9570 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -529,6 +529,7 @@ int xt_register_table(struct xt_table *table,
529 529
530 /* Simplifies replace_table code. */ 530 /* Simplifies replace_table code. */
531 table->private = bootstrap; 531 table->private = bootstrap;
532 rwlock_init(&table->lock);
532 if (!xt_replace_table(table, 0, newinfo, &ret)) 533 if (!xt_replace_table(table, 0, newinfo, &ret))
533 goto unlock; 534 goto unlock;
534 535
@@ -538,7 +539,6 @@ int xt_register_table(struct xt_table *table,
538 /* save number of initial entries */ 539 /* save number of initial entries */
539 private->initial_entries = private->number; 540 private->initial_entries = private->number;
540 541
541 rwlock_init(&table->lock);
542 list_prepend(&xt[table->af].tables, table); 542 list_prepend(&xt[table->af].tables, table);
543 543
544 ret = 0; 544 ret = 0;
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 6056d20ef429..37640c6fc014 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -69,6 +69,11 @@ ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int hook)
69 DPRINTK("ipt_init_target: found %s\n", target->name); 69 DPRINTK("ipt_init_target: found %s\n", target->name);
70 t->u.kernel.target = target; 70 t->u.kernel.target = target;
71 71
72 ret = xt_check_target(target, AF_INET, t->u.target_size - sizeof(*t),
73 table, hook, 0, 0);
74 if (ret)
75 return ret;
76
72 if (t->u.kernel.target->checkentry 77 if (t->u.kernel.target->checkentry
73 && !t->u.kernel.target->checkentry(table, NULL, 78 && !t->u.kernel.target->checkentry(table, NULL,
74 t->u.kernel.target, t->data, 79 t->u.kernel.target, t->data,
diff --git a/net/socket.c b/net/socket.c
index 23898f45f713..0ce12dfc7a71 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -490,6 +490,7 @@ static struct socket *sockfd_lookup_light(int fd, int *err, int *fput_needed)
490 struct file *file; 490 struct file *file;
491 struct socket *sock; 491 struct socket *sock;
492 492
493 *err = -EBADF;
493 file = fget_light(fd, fput_needed); 494 file = fget_light(fd, fput_needed);
494 if (file) { 495 if (file) {
495 sock = sock_from_file(file, err); 496 sock = sock_from_file(file, err);
diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c
index 54dabf862802..a4ca7569e700 100644
--- a/sound/oss/ad1889.c
+++ b/sound/oss/ad1889.c
@@ -75,7 +75,7 @@ static inline void ad1889_set_wav_rate(ad1889_dev_t *dev, int rate)
75 75
76 DBG("Setting WAV rate to %d\n", rate); 76 DBG("Setting WAV rate to %d\n", rate);
77 dev->state[AD_WAV_STATE].dmabuf.rate = rate; 77 dev->state[AD_WAV_STATE].dmabuf.rate = rate;
78 AD1889_WRITEW(dev, AD_DSWAS, rate); 78 AD1889_WRITEW(dev, AD_DS_WAS, rate);
79 79
80 /* Cycle the DAC to enable the new rate */ 80 /* Cycle the DAC to enable the new rate */
81 ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0x0200); 81 ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0x0200);
@@ -89,14 +89,14 @@ static inline void ad1889_set_wav_fmt(ad1889_dev_t *dev, int fmt)
89 89
90 DBG("Setting WAV format to 0x%x\n", fmt); 90 DBG("Setting WAV format to 0x%x\n", fmt);
91 91
92 tmp = AD1889_READW(ad1889_dev, AD_DSWSMC); 92 tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
93 if (fmt & AFMT_S16_LE) { 93 if (fmt & AFMT_S16_LE) {
94 //tmp |= 0x0100; /* set WA16 */ 94 //tmp |= 0x0100; /* set WA16 */
95 tmp |= 0x0300; /* set WA16 stereo */ 95 tmp |= 0x0300; /* set WA16 stereo */
96 } else if (fmt & AFMT_U8) { 96 } else if (fmt & AFMT_U8) {
97 tmp &= ~0x0100; /* clear WA16 */ 97 tmp &= ~0x0100; /* clear WA16 */
98 } 98 }
99 AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp); 99 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
100} 100}
101 101
102static inline void ad1889_set_adc_fmt(ad1889_dev_t *dev, int fmt) 102static inline void ad1889_set_adc_fmt(ad1889_dev_t *dev, int fmt)
@@ -105,13 +105,13 @@ static inline void ad1889_set_adc_fmt(ad1889_dev_t *dev, int fmt)
105 105
106 DBG("Setting ADC format to 0x%x\n", fmt); 106 DBG("Setting ADC format to 0x%x\n", fmt);
107 107
108 tmp = AD1889_READW(ad1889_dev, AD_DSRAMC); 108 tmp = AD1889_READW(ad1889_dev, AD_DS_RAMC);
109 if (fmt & AFMT_S16_LE) { 109 if (fmt & AFMT_S16_LE) {
110 tmp |= 0x0100; /* set WA16 */ 110 tmp |= 0x0100; /* set WA16 */
111 } else if (fmt & AFMT_U8) { 111 } else if (fmt & AFMT_U8) {
112 tmp &= ~0x0100; /* clear WA16 */ 112 tmp &= ~0x0100; /* clear WA16 */
113 } 113 }
114 AD1889_WRITEW(ad1889_dev, AD_DSRAMC, tmp); 114 AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, tmp);
115} 115}
116 116
117static void ad1889_start_wav(ad1889_state_t *state) 117static void ad1889_start_wav(ad1889_state_t *state)
@@ -145,21 +145,21 @@ static void ad1889_start_wav(ad1889_state_t *state)
145 dmabuf->rd_ptr, dmabuf->dma_len); 145 dmabuf->rd_ptr, dmabuf->dma_len);
146 146
147 /* load up the current register set */ 147 /* load up the current register set */
148 AD1889_WRITEL(ad1889_dev, AD_DMAWAVCC, cnt); 148 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVCC, cnt);
149 AD1889_WRITEL(ad1889_dev, AD_DMAWAVICC, cnt); 149 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVICC, cnt);
150 AD1889_WRITEL(ad1889_dev, AD_DMAWAVCA, dmabuf->dma_handle); 150 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVCA, dmabuf->dma_handle);
151 151
152 /* TODO: for now we load the base registers with the same thing */ 152 /* TODO: for now we load the base registers with the same thing */
153 AD1889_WRITEL(ad1889_dev, AD_DMAWAVBC, cnt); 153 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVBC, cnt);
154 AD1889_WRITEL(ad1889_dev, AD_DMAWAVIBC, cnt); 154 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVIBC, cnt);
155 AD1889_WRITEL(ad1889_dev, AD_DMAWAVBA, dmabuf->dma_handle); 155 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVBA, dmabuf->dma_handle);
156 156
157 /* and we're off to the races... */ 157 /* and we're off to the races... */
158 AD1889_WRITEL(ad1889_dev, AD_DMACHSS, 0x8); 158 AD1889_WRITEL(ad1889_dev, AD_DMA_CHSS, 0x8);
159 tmp = AD1889_READW(ad1889_dev, AD_DSWSMC); 159 tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
160 tmp |= 0x0400; /* set WAEN */ 160 tmp |= 0x0400; /* set WAEN */
161 AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp); 161 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
162 (void) AD1889_READW(ad1889_dev, AD_DSWSMC); /* flush posted PCI write */ 162 (void) AD1889_READW(ad1889_dev, AD_DS_WSMC); /* flush posted PCI write */
163 163
164 dmabuf->enable |= DAC_RUNNING; 164 dmabuf->enable |= DAC_RUNNING;
165 165
@@ -179,10 +179,10 @@ static void ad1889_stop_wav(ad1889_state_t *state)
179 u16 tmp; 179 u16 tmp;
180 unsigned long cnt = dmabuf->dma_len; 180 unsigned long cnt = dmabuf->dma_len;
181 181
182 tmp = AD1889_READW(ad1889_dev, AD_DSWSMC); 182 tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
183 tmp &= ~0x0400; /* clear WAEN */ 183 tmp &= ~0x0400; /* clear WAEN */
184 AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp); 184 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
185 (void) AD1889_READW(ad1889_dev, AD_DSWSMC); /* flush posted PCI write */ 185 (void) AD1889_READW(ad1889_dev, AD_DS_WSMC); /* flush posted PCI write */
186 pci_unmap_single(ad1889_dev->pci, dmabuf->dma_handle, 186 pci_unmap_single(ad1889_dev->pci, dmabuf->dma_handle,
187 cnt, PCI_DMA_TODEVICE); 187 cnt, PCI_DMA_TODEVICE);
188 188
@@ -211,7 +211,7 @@ static void ad1889_startstop_adc(ad1889_state_t *state, int start)
211 211
212 spin_lock_irqsave(&state->card->lock, flags); 212 spin_lock_irqsave(&state->card->lock, flags);
213 213
214 tmp = AD1889_READW(ad1889_dev, AD_DSRAMC); 214 tmp = AD1889_READW(ad1889_dev, AD_DS_RAMC);
215 if (start) { 215 if (start) {
216 state->dmabuf.enable |= ADC_RUNNING; 216 state->dmabuf.enable |= ADC_RUNNING;
217 tmp |= 0x0004; /* set ADEN */ 217 tmp |= 0x0004; /* set ADEN */
@@ -219,7 +219,7 @@ static void ad1889_startstop_adc(ad1889_state_t *state, int start)
219 state->dmabuf.enable &= ~ADC_RUNNING; 219 state->dmabuf.enable &= ~ADC_RUNNING;
220 tmp &= ~0x0004; /* clear ADEN */ 220 tmp &= ~0x0004; /* clear ADEN */
221 } 221 }
222 AD1889_WRITEW(ad1889_dev, AD_DSRAMC, tmp); 222 AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, tmp);
223 223
224 spin_unlock_irqrestore(&state->card->lock, flags); 224 spin_unlock_irqrestore(&state->card->lock, flags);
225} 225}
@@ -301,53 +301,53 @@ static int ad1889_read_proc (char *page, char **start, off_t off,
301 int len, i; 301 int len, i;
302 ad1889_dev_t *dev = data; 302 ad1889_dev_t *dev = data;
303 ad1889_reg_t regs[] = { 303 ad1889_reg_t regs[] = {
304 { "WSMC", AD_DSWSMC, 16 }, 304 { "WSMC", AD_DS_WSMC, 16 },
305 { "RAMC", AD_DSRAMC, 16 }, 305 { "RAMC", AD_DS_RAMC, 16 },
306 { "WADA", AD_DSWADA, 16 }, 306 { "WADA", AD_DS_WADA, 16 },
307 { "SYDA", AD_DSSYDA, 16 }, 307 { "SYDA", AD_DS_SYDA, 16 },
308 { "WAS", AD_DSWAS, 16 }, 308 { "WAS", AD_DS_WAS, 16 },
309 { "RES", AD_DSRES, 16 }, 309 { "RES", AD_DS_RES, 16 },
310 { "CCS", AD_DSCCS, 16 }, 310 { "CCS", AD_DS_CCS, 16 },
311 { "ADCBA", AD_DMAADCBA, 32 }, 311 { "ADCBA", AD_DMA_ADCBA, 32 },
312 { "ADCCA", AD_DMAADCCA, 32 }, 312 { "ADCCA", AD_DMA_ADCCA, 32 },
313 { "ADCBC", AD_DMAADCBC, 32 }, 313 { "ADCBC", AD_DMA_ADCBC, 32 },
314 { "ADCCC", AD_DMAADCCC, 32 }, 314 { "ADCCC", AD_DMA_ADCCC, 32 },
315 { "ADCIBC", AD_DMAADCIBC, 32 }, 315 { "ADCIBC", AD_DMA_ADCIBC, 32 },
316 { "ADCICC", AD_DMAADCICC, 32 }, 316 { "ADCICC", AD_DMA_ADCICC, 32 },
317 { "ADCCTRL", AD_DMAADCCTRL, 16 }, 317 { "ADCCTRL", AD_DMA_ADCCTRL, 16 },
318 { "WAVBA", AD_DMAWAVBA, 32 }, 318 { "WAVBA", AD_DMA_WAVBA, 32 },
319 { "WAVCA", AD_DMAWAVCA, 32 }, 319 { "WAVCA", AD_DMA_WAVCA, 32 },
320 { "WAVBC", AD_DMAWAVBC, 32 }, 320 { "WAVBC", AD_DMA_WAVBC, 32 },
321 { "WAVCC", AD_DMAWAVCC, 32 }, 321 { "WAVCC", AD_DMA_WAVCC, 32 },
322 { "WAVIBC", AD_DMAWAVIBC, 32 }, 322 { "WAVIBC", AD_DMA_WAVIBC, 32 },
323 { "WAVICC", AD_DMAWAVICC, 32 }, 323 { "WAVICC", AD_DMA_WAVICC, 32 },
324 { "WAVCTRL", AD_DMAWAVCTRL, 16 }, 324 { "WAVCTRL", AD_DMA_WAVCTRL, 16 },
325 { "DISR", AD_DMADISR, 32 }, 325 { "DISR", AD_DMA_DISR, 32 },
326 { "CHSS", AD_DMACHSS, 32 }, 326 { "CHSS", AD_DMA_CHSS, 32 },
327 { "IPC", AD_GPIOIPC, 16 }, 327 { "IPC", AD_GPIO_IPC, 16 },
328 { "OP", AD_GPIOOP, 16 }, 328 { "OP", AD_GPIO_OP, 16 },
329 { "IP", AD_GPIOIP, 16 }, 329 { "IP", AD_GPIO_IP, 16 },
330 { "ACIC", AD_ACIC, 16 }, 330 { "ACIC", AD_AC97_ACIC, 16 },
331 { "AC97_RESET", 0x100 + AC97_RESET, 16 }, 331 { "AC97_RESET", AD_AC97_BASE + AC97_RESET, 16 },
332 { "AC97_MASTER_VOL_STEREO", 0x100 + AC97_MASTER_VOL_STEREO, 16 }, 332 { "AC97_MASTER_VOL_STEREO", AD_AC97_BASE + AC97_MASTER_VOL_STEREO, 16 },
333 { "AC97_HEADPHONE_VOL", 0x100 + AC97_HEADPHONE_VOL, 16 }, 333 { "AC97_HEADPHONE_VOL", AD_AC97_BASE + AC97_HEADPHONE_VOL, 16 },
334 { "AC97_MASTER_VOL_MONO", 0x100 + AC97_MASTER_VOL_MONO, 16 }, 334 { "AC97_MASTER_VOL_MONO", AD_AC97_BASE + AC97_MASTER_VOL_MONO, 16 },
335 { "AC97_MASTER_TONE", 0x100 + AC97_MASTER_TONE, 16 }, 335 { "AC97_MASTER_TONE", AD_AC97_BASE + AC97_MASTER_TONE, 16 },
336 { "AC97_PCBEEP_VOL", 0x100 + AC97_PCBEEP_VOL, 16 }, 336 { "AC97_PCBEEP_VOL", AD_AC97_BASE + AC97_PCBEEP_VOL, 16 },
337 { "AC97_PHONE_VOL", 0x100 + AC97_PHONE_VOL, 16 }, 337 { "AC97_PHONE_VOL", AD_AC97_BASE + AC97_PHONE_VOL, 16 },
338 { "AC97_MIC_VOL", 0x100 + AC97_MIC_VOL, 16 }, 338 { "AC97_MIC_VOL", AD_AC97_BASE + AC97_MIC_VOL, 16 },
339 { "AC97_LINEIN_VOL", 0x100 + AC97_LINEIN_VOL, 16 }, 339 { "AC97_LINEIN_VOL", AD_AC97_BASE + AC97_LINEIN_VOL, 16 },
340 { "AC97_CD_VOL", 0x100 + AC97_CD_VOL, 16 }, 340 { "AC97_CD_VOL", AD_AC97_BASE + AC97_CD_VOL, 16 },
341 { "AC97_VIDEO_VOL", 0x100 + AC97_VIDEO_VOL, 16 }, 341 { "AC97_VIDEO_VOL", AD_AC97_BASE + AC97_VIDEO_VOL, 16 },
342 { "AC97_AUX_VOL", 0x100 + AC97_AUX_VOL, 16 }, 342 { "AC97_AUX_VOL", AD_AC97_BASE + AC97_AUX_VOL, 16 },
343 { "AC97_PCMOUT_VOL", 0x100 + AC97_PCMOUT_VOL, 16 }, 343 { "AC97_PCMOUT_VOL", AD_AC97_BASE + AC97_PCMOUT_VOL, 16 },
344 { "AC97_RECORD_SELECT", 0x100 + AC97_RECORD_SELECT, 16 }, 344 { "AC97_RECORD_SELECT", AD_AC97_BASE + AC97_RECORD_SELECT, 16 },
345 { "AC97_RECORD_GAIN", 0x100 + AC97_RECORD_GAIN, 16 }, 345 { "AC97_RECORD_GAIN", AD_AC97_BASE + AC97_RECORD_GAIN, 16 },
346 { "AC97_RECORD_GAIN_MIC", 0x100 + AC97_RECORD_GAIN_MIC, 16 }, 346 { "AC97_RECORD_GAIN_MIC", AD_AC97_BASE + AC97_RECORD_GAIN_MIC, 16 },
347 { "AC97_GENERAL_PURPOSE", 0x100 + AC97_GENERAL_PURPOSE, 16 }, 347 { "AC97_GENERAL_PURPOSE", AD_AC97_BASE + AC97_GENERAL_PURPOSE, 16 },
348 { "AC97_3D_CONTROL", 0x100 + AC97_3D_CONTROL, 16 }, 348 { "AC97_3D_CONTROL", AD_AC97_BASE + AC97_3D_CONTROL, 16 },
349 { "AC97_MODEM_RATE", 0x100 + AC97_MODEM_RATE, 16 }, 349 { "AC97_MODEM_RATE", AD_AC97_BASE + AC97_MODEM_RATE, 16 },
350 { "AC97_POWER_CONTROL", 0x100 + AC97_POWER_CONTROL, 16 }, 350 { "AC97_POWER_CONTROL", AD_AC97_BASE + AC97_POWER_CONTROL, 16 },
351 { NULL } 351 { NULL }
352 }; 352 };
353 353
@@ -400,9 +400,9 @@ static inline unsigned long ad1889_get_dma_addr(ad1889_state_t *state)
400 } 400 }
401 401
402 if (dmabuf->enable & DAC_RUNNING) 402 if (dmabuf->enable & DAC_RUNNING)
403 offset = le32_to_cpu(AD1889_READL(state->card, AD_DMAWAVBA)); 403 offset = le32_to_cpu(AD1889_READL(state->card, AD_DMA_WAVBA));
404 else 404 else
405 offset = le32_to_cpu(AD1889_READL(state->card, AD_DMAADCBA)); 405 offset = le32_to_cpu(AD1889_READL(state->card, AD_DMA_ADCBA));
406 406
407 return (unsigned long)bus_to_virt((unsigned long)offset) - (unsigned long)dmabuf->rawbuf; 407 return (unsigned long)bus_to_virt((unsigned long)offset) - (unsigned long)dmabuf->rawbuf;
408} 408}
@@ -639,9 +639,9 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
639 if (val > 5400 && val < 48000) 639 if (val > 5400 && val < 48000)
640 { 640 {
641 if (file->f_mode & FMODE_WRITE) 641 if (file->f_mode & FMODE_WRITE)
642 AD1889_WRITEW(ad1889_dev, AD_DSWAS, val); 642 AD1889_WRITEW(ad1889_dev, AD_DS_WAS, val);
643 if (file->f_mode & FMODE_READ) 643 if (file->f_mode & FMODE_READ)
644 AD1889_WRITEW(ad1889_dev, AD_DSRES, val); 644 AD1889_WRITEW(ad1889_dev, AD_DS_RES, val);
645 } 645 }
646 return 0; 646 return 0;
647 647
@@ -649,22 +649,22 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
649 if (get_user(val, p)) 649 if (get_user(val, p))
650 return -EFAULT; 650 return -EFAULT;
651 if (file->f_mode & FMODE_READ) { 651 if (file->f_mode & FMODE_READ) {
652 val = AD1889_READW(ad1889_dev, AD_DSWSMC); 652 val = AD1889_READW(ad1889_dev, AD_DS_WSMC);
653 if (val) { 653 if (val) {
654 val |= 0x0200; /* set WAST */ 654 val |= 0x0200; /* set WAST */
655 } else { 655 } else {
656 val &= ~0x0200; /* clear WAST */ 656 val &= ~0x0200; /* clear WAST */
657 } 657 }
658 AD1889_WRITEW(ad1889_dev, AD_DSWSMC, val); 658 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, val);
659 } 659 }
660 if (file->f_mode & FMODE_WRITE) { 660 if (file->f_mode & FMODE_WRITE) {
661 val = AD1889_READW(ad1889_dev, AD_DSRAMC); 661 val = AD1889_READW(ad1889_dev, AD_DS_RAMC);
662 if (val) { 662 if (val) {
663 val |= 0x0002; /* set ADST */ 663 val |= 0x0002; /* set ADST */
664 } else { 664 } else {
665 val &= ~0x0002; /* clear ADST */ 665 val &= ~0x0002; /* clear ADST */
666 } 666 }
667 AD1889_WRITEW(ad1889_dev, AD_DSRAMC, val); 667 AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, val);
668 } 668 }
669 669
670 return 0; 670 return 0;
@@ -739,7 +739,7 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
739 break; 739 break;
740 740
741 case SOUND_PCM_READ_RATE: 741 case SOUND_PCM_READ_RATE:
742 return put_user(AD1889_READW(ad1889_dev, AD_DSWAS), p); 742 return put_user(AD1889_READW(ad1889_dev, AD_DS_WAS), p);
743 743
744 case SOUND_PCM_READ_CHANNELS: 744 case SOUND_PCM_READ_CHANNELS:
745 case SOUND_PCM_READ_BITS: 745 case SOUND_PCM_READ_BITS:
@@ -769,7 +769,7 @@ static int ad1889_open(struct inode *inode, struct file *file)
769 769
770 ad1889_set_wav_rate(ad1889_dev, 48000); 770 ad1889_set_wav_rate(ad1889_dev, 48000);
771 ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE); 771 ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE);
772 AD1889_WRITEW(ad1889_dev, AD_DSWADA, 0x0404); /* attenuation */ 772 AD1889_WRITEW(ad1889_dev, AD_DS_WADA, 0x0404); /* attenuation */
773 return nonseekable_open(inode, file); 773 return nonseekable_open(inode, file);
774} 774}
775 775
@@ -826,15 +826,15 @@ static void ad1889_codec_write(struct ac97_codec *ac97, u8 reg, u16 val)
826{ 826{
827 ad1889_dev_t *dev = ac97->private_data; 827 ad1889_dev_t *dev = ac97->private_data;
828 828
829 //DBG("Writing 0x%x to 0x%lx\n", val, dev->regbase + 0x100 + reg); 829 //DBG("Writing 0x%x to 0x%lx\n", val, dev->regbase + AD_AC97_BASE + reg);
830 AD1889_WRITEW(dev, 0x100 + reg, val); 830 AD1889_WRITEW(dev, AD_AC97_BASE + reg, val);
831} 831}
832 832
833static u16 ad1889_codec_read(struct ac97_codec *ac97, u8 reg) 833static u16 ad1889_codec_read(struct ac97_codec *ac97, u8 reg)
834{ 834{
835 ad1889_dev_t *dev = ac97->private_data; 835 ad1889_dev_t *dev = ac97->private_data;
836 //DBG("Reading from 0x%lx\n", dev->regbase + 0x100 + reg); 836 //DBG("Reading from 0x%lx\n", dev->regbase + AD_AC97_BASE + reg);
837 return AD1889_READW(dev, 0x100 + reg); 837 return AD1889_READW(dev, AD_AC97_BASE + reg);
838} 838}
839 839
840static int ad1889_ac97_init(ad1889_dev_t *dev, int id) 840static int ad1889_ac97_init(ad1889_dev_t *dev, int id)
@@ -883,24 +883,24 @@ static int ad1889_aclink_reset(struct pci_dev * pcidev)
883 int retry = 200; 883 int retry = 200;
884 ad1889_dev_t *dev = pci_get_drvdata(pcidev); 884 ad1889_dev_t *dev = pci_get_drvdata(pcidev);
885 885
886 AD1889_WRITEW(dev, AD_DSCCS, 0x8000); /* turn on clock */ 886 AD1889_WRITEW(dev, AD_DS_CCS, 0x8000); /* turn on clock */
887 AD1889_READW(dev, AD_DSCCS); 887 AD1889_READW(dev, AD_DS_CCS);
888 888
889 WAIT_10MS(); 889 WAIT_10MS();
890 890
891 stat = AD1889_READW(dev, AD_ACIC); 891 stat = AD1889_READW(dev, AD_AC97_ACIC);
892 stat |= 0x0002; /* Reset Disable */ 892 stat |= 0x0002; /* Reset Disable */
893 AD1889_WRITEW(dev, AD_ACIC, stat); 893 AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
894 (void) AD1889_READW(dev, AD_ACIC); /* flush posted write */ 894 (void) AD1889_READW(dev, AD_AC97_ACIC); /* flush posted write */
895 895
896 udelay(10); 896 udelay(10);
897 897
898 stat = AD1889_READW(dev, AD_ACIC); 898 stat = AD1889_READW(dev, AD_AC97_ACIC);
899 stat |= 0x0001; /* Interface Enable */ 899 stat |= 0x0001; /* Interface Enable */
900 AD1889_WRITEW(dev, AD_ACIC, stat); 900 AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
901 901
902 do { 902 do {
903 if (AD1889_READW(dev, AD_ACIC) & 0x8000) /* Ready */ 903 if (AD1889_READW(dev, AD_AC97_ACIC) & 0x8000) /* Ready */
904 break; 904 break;
905 WAIT_10MS(); 905 WAIT_10MS();
906 retry--; 906 retry--;
@@ -908,16 +908,16 @@ static int ad1889_aclink_reset(struct pci_dev * pcidev)
908 908
909 if (!retry) { 909 if (!retry) {
910 printk(KERN_ERR "ad1889_aclink_reset: codec is not ready [0x%x]\n", 910 printk(KERN_ERR "ad1889_aclink_reset: codec is not ready [0x%x]\n",
911 AD1889_READW(dev, AD_ACIC)); 911 AD1889_READW(dev, AD_AC97_ACIC));
912 return -EBUSY; 912 return -EBUSY;
913 } 913 }
914 914
915 /* TODO reset AC97 codec */ 915 /* TODO reset AC97 codec */
916 /* TODO set wave/adc pci ctrl status */ 916 /* TODO set wave/adc pci ctrl status */
917 917
918 stat = AD1889_READW(dev, AD_ACIC); 918 stat = AD1889_READW(dev, AD_AC97_ACIC);
919 stat |= 0x0004; /* Audio Stream Output Enable */ 919 stat |= 0x0004; /* Audio Stream Output Enable */
920 AD1889_WRITEW(dev, AD_ACIC, stat); 920 AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
921 return 0; 921 return 0;
922} 922}
923 923
@@ -935,10 +935,10 @@ static irqreturn_t ad1889_interrupt(int irq, void *dev_id, struct pt_regs *regs)
935 u32 stat; 935 u32 stat;
936 ad1889_dev_t *dev = (ad1889_dev_t *)dev_id; 936 ad1889_dev_t *dev = (ad1889_dev_t *)dev_id;
937 937
938 stat = AD1889_READL(dev, AD_DMADISR); 938 stat = AD1889_READL(dev, AD_DMA_DISR);
939 939
940 /* clear ISR */ 940 /* clear ISR */
941 AD1889_WRITEL(dev, AD_DMADISR, stat); 941 AD1889_WRITEL(dev, AD_DMA_DISR, stat);
942 942
943 if (stat & 0x8) { /* WAVI */ 943 if (stat & 0x8) { /* WAVI */
944 DBG("WAV interrupt\n"); 944 DBG("WAV interrupt\n");
@@ -964,15 +964,15 @@ static void ad1889_initcfg(ad1889_dev_t *dev)
964 u32 tmp32; 964 u32 tmp32;
965 965
966 /* make sure the interrupt bits are setup the way we want */ 966 /* make sure the interrupt bits are setup the way we want */
967 tmp32 = AD1889_READL(dev, AD_DMAWAVCTRL); 967 tmp32 = AD1889_READL(dev, AD_DMA_WAVCTRL);
968 tmp32 &= ~0xff; /* flat dma, no sg, mask out the intr bits */ 968 tmp32 &= ~0xff; /* flat dma, no sg, mask out the intr bits */
969 tmp32 |= 0x6; /* intr on count, loop */ 969 tmp32 |= 0x6; /* intr on count, loop */
970 AD1889_WRITEL(dev, AD_DMAWAVCTRL, tmp32); 970 AD1889_WRITEL(dev, AD_DMA_WAVCTRL, tmp32);
971 971
972 /* unmute... */ 972 /* unmute... */
973 tmp16 = AD1889_READW(dev, AD_DSWADA); 973 tmp16 = AD1889_READW(dev, AD_DS_WADA);
974 tmp16 &= ~0x8080; 974 tmp16 &= ~0x8080;
975 AD1889_WRITEW(dev, AD_DSWADA, tmp16); 975 AD1889_WRITEW(dev, AD_DS_WADA, tmp16);
976} 976}
977 977
978static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) 978static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
@@ -1005,7 +1005,7 @@ static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_devic
1005 goto out1; 1005 goto out1;
1006 } 1006 }
1007 1007
1008 dev->regbase = ioremap_nocache(bar, AD_DSIOMEMSIZE); 1008 dev->regbase = ioremap_nocache(bar, AD_DS_IOMEMSIZE);
1009 if (!dev->regbase) { 1009 if (!dev->regbase) {
1010 printk(KERN_ERR DEVNAME ": unable to remap iomem\n"); 1010 printk(KERN_ERR DEVNAME ": unable to remap iomem\n");
1011 goto out2; 1011 goto out2;
diff --git a/sound/oss/ad1889.h b/sound/oss/ad1889.h
index 861b3213f30b..09913765967a 100644
--- a/sound/oss/ad1889.h
+++ b/sound/oss/ad1889.h
@@ -1,57 +1,58 @@
1#ifndef _AD1889_H_ 1#ifndef _AD1889_H_
2#define _AD1889_H_ 2#define _AD1889_H_
3 3
4#define AD_DSWSMC 0x00 /* DMA input wave/syn mixer control */ 4#define AD_DS_WSMC 0x00 /* DMA input wave/syn mixer control */
5#define AD_DSRAMC 0x02 /* DMA output resamp/ADC mixer control */ 5#define AD_DS_RAMC 0x02 /* DMA output resamp/ADC mixer control */
6#define AD_DSWADA 0x04 /* DMA input wave attenuation */ 6#define AD_DS_WADA 0x04 /* DMA input wave attenuation */
7#define AD_DSSYDA 0x06 /* DMA input syn attentuation */ 7#define AD_DS_SYDA 0x06 /* DMA input syn attentuation */
8#define AD_DSWAS 0x08 /* wave input sample rate */ 8#define AD_DS_WAS 0x08 /* wave input sample rate */
9#define AD_DSRES 0x0a /* resampler output sample rate */ 9#define AD_DS_RES 0x0a /* resampler output sample rate */
10#define AD_DSCCS 0x0c /* chip control/status */ 10#define AD_DS_CCS 0x0c /* chip control/status */
11 11
12#define AD_DMARESBA 0x40 /* RES base addr */ 12#define AD_DMA_RESBA 0x40 /* RES base addr */
13#define AD_DMARESCA 0x44 /* RES current addr */ 13#define AD_DMA_RESCA 0x44 /* RES current addr */
14#define AD_DMARESBC 0x48 /* RES base cnt */ 14#define AD_DMA_RESBC 0x48 /* RES base cnt */
15#define AD_DMARESCC 0x4c /* RES current count */ 15#define AD_DMA_RESCC 0x4c /* RES current count */
16#define AD_DMAADCBA 0x50 /* ADC */ 16#define AD_DMA_ADCBA 0x50 /* ADC */
17#define AD_DMAADCCA 0x54 17#define AD_DMA_ADCCA 0x54
18#define AD_DMAADCBC 0x58 18#define AD_DMA_ADCBC 0x58
19#define AD_DMAADCCC 0x5c 19#define AD_DMA_ADCCC 0x5c
20#define AD_DMASYNBA 0x60 /* SYN */ 20#define AD_DMA_SYNBA 0x60 /* SYN */
21#define AD_DMASYNCA 0x64 21#define AD_DMA_SYNCA 0x64
22#define AD_DMASYNBC 0x68 22#define AD_DMA_SYNBC 0x68
23#define AD_DMASYNCC 0x6c 23#define AD_DMA_SYNCC 0x6c
24#define AD_DMAWAVBA 0x70 /* WAV */ 24#define AD_DMA_WAVBA 0x70 /* WAV */
25#define AD_DMAWAVCA 0x74 25#define AD_DMA_WAVCA 0x74
26#define AD_DMAWAVBC 0x78 26#define AD_DMA_WAVBC 0x78
27#define AD_DMAWAVCC 0x7c 27#define AD_DMA_WAVCC 0x7c
28#define AD_DMARESICC 0x80 /* RES interrupt current count */ 28#define AD_DMA_RESICC 0x80 /* RES interrupt current count */
29#define AD_DMARESIBC 0x84 /* RES interrupt base count */ 29#define AD_DMA_RESIBC 0x84 /* RES interrupt base count */
30#define AD_DMAADCICC 0x88 /* ADC interrupt current count */ 30#define AD_DMA_ADCICC 0x88 /* ADC interrupt current count */
31#define AD_DMAADCIBC 0x8c /* ADC interrupt base count */ 31#define AD_DMA_ADCIBC 0x8c /* ADC interrupt base count */
32#define AD_DMASYNICC 0x90 /* SYN interrupt current count */ 32#define AD_DMA_SYNICC 0x90 /* SYN interrupt current count */
33#define AD_DMASYNIBC 0x94 /* SYN interrupt base count */ 33#define AD_DMA_SYNIBC 0x94 /* SYN interrupt base count */
34#define AD_DMAWAVICC 0x98 /* WAV interrupt current count */ 34#define AD_DMA_WAVICC 0x98 /* WAV interrupt current count */
35#define AD_DMAWAVIBC 0x9c /* WAV interrupt base count */ 35#define AD_DMA_WAVIBC 0x9c /* WAV interrupt base count */
36#define AD_DMARESCTRL 0xa0 /* RES PCI control/status */ 36#define AD_DMA_RESCTRL 0xa0 /* RES PCI control/status */
37#define AD_DMAADCCTRL 0xa8 /* ADC PCI control/status */ 37#define AD_DMA_ADCCTRL 0xa8 /* ADC PCI control/status */
38#define AD_DMASYNCTRL 0xb0 /* SYN PCI control/status */ 38#define AD_DMA_SYNCTRL 0xb0 /* SYN PCI control/status */
39#define AD_DMAWAVCTRL 0xb8 /* WAV PCI control/status */ 39#define AD_DMA_WAVCTRL 0xb8 /* WAV PCI control/status */
40#define AD_DMADISR 0xc0 /* PCI DMA intr status */ 40#define AD_DMA_DISR 0xc0 /* PCI DMA intr status */
41#define AD_DMACHSS 0xc4 /* PCI DMA channel stop status */ 41#define AD_DMA_CHSS 0xc4 /* PCI DMA channel stop status */
42 42
43#define AD_GPIOIPC 0xc8 /* IO port ctrl */ 43#define AD_GPIO_IPC 0xc8 /* IO port ctrl */
44#define AD_GPIOOP 0xca /* IO output status */ 44#define AD_GPIO_OP 0xca /* IO output status */
45#define AD_GPIOIP 0xcc /* IO input status */ 45#define AD_GPIO_IP 0xcc /* IO input status */
46 46
47/* AC97 registers, 0x100 - 0x17f; see ac97.h */ 47/* AC97 registers, 0x100 - 0x17f; see ac97.h */
48#define AD_ACIC 0x180 /* AC Link interface ctrl */ 48#define AD_AC97_BASE 0x100 /* ac97 base register */
49#define AD_AC97_ACIC 0x180 /* AC Link interface ctrl */
49 50
50/* OPL3; BAR1 */ 51/* OPL3; BAR1 */
51#define AD_OPLM0AS 0x00 /* Music0 address/status */ 52#define AD_OPL_M0AS 0x00 /* Music0 address/status */
52#define AD_OPLM0DATA 0x01 /* Music0 data */ 53#define AD_OPL_M0DATA 0x01 /* Music0 data */
53#define AD_OPLM1A 0x02 /* Music1 address */ 54#define AD_OPL_M1A 0x02 /* Music1 address */
54#define AD_OPLM1DATA 0x03 /* Music1 data */ 55#define AD_OPL_M1DATA 0x03 /* Music1 data */
55/* 0x04-0x0f reserved */ 56/* 0x04-0x0f reserved */
56 57
57/* MIDI; BAR2 */ 58/* MIDI; BAR2 */
@@ -59,9 +60,9 @@
59#define AD_MISC 0x01 /* MIDI status/cmd */ 60#define AD_MISC 0x01 /* MIDI status/cmd */
60/* 0x02-0xff reserved */ 61/* 0x02-0xff reserved */
61 62
62#define AD_DSIOMEMSIZE 512 63#define AD_DS_IOMEMSIZE 512
63#define AD_OPLMEMSIZE 16 64#define AD_OPL_MEMSIZE 16
64#define AD_MIDIMEMSIZE 16 65#define AD_MIDI_MEMSIZE 16
65 66
66#define AD_WAV_STATE 0 67#define AD_WAV_STATE 0
67#define AD_ADC_STATE 1 68#define AD_ADC_STATE 1
diff --git a/sound/oss/dmasound/tas_common.c b/sound/oss/dmasound/tas_common.c
index 81315996c0f1..882ae98a41b1 100644
--- a/sound/oss/dmasound/tas_common.c
+++ b/sound/oss/dmasound/tas_common.c
@@ -195,8 +195,8 @@ tas_init(int driver_id, const char *driver_name)
195 195
196 printk(KERN_INFO "tas driver [%s])\n", driver_name); 196 printk(KERN_INFO "tas driver [%s])\n", driver_name);
197 197
198#ifndef CONFIG_I2C_KEYWEST 198#ifndef CONFIG_I2C_POWERMAC
199 request_module("i2c-keywest"); 199 request_module("i2c-powermac");
200#endif 200#endif
201 tas_node = find_devices("deq"); 201 tas_node = find_devices("deq");
202 if (tas_node == NULL) 202 if (tas_node == NULL)
diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c
index aa09ebd9ffb8..46eebf5610e3 100644
--- a/sound/ppc/daca.c
+++ b/sound/ppc/daca.c
@@ -255,7 +255,7 @@ int __init snd_pmac_daca_init(struct snd_pmac *chip)
255 255
256#ifdef CONFIG_KMOD 256#ifdef CONFIG_KMOD
257 if (current->fs->root) 257 if (current->fs->root)
258 request_module("i2c-keywest"); 258 request_module("i2c-powermac");
259#endif /* CONFIG_KMOD */ 259#endif /* CONFIG_KMOD */
260 260
261 mix = kmalloc(sizeof(*mix), GFP_KERNEL); 261 mix = kmalloc(sizeof(*mix), GFP_KERNEL);
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index 1146dd882bb1..70e4ebc70260 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -1313,7 +1313,7 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
1313 1313
1314#ifdef CONFIG_KMOD 1314#ifdef CONFIG_KMOD
1315 if (current->fs->root) 1315 if (current->fs->root)
1316 request_module("i2c-keywest"); 1316 request_module("i2c-powermac");
1317#endif /* CONFIG_KMOD */ 1317#endif /* CONFIG_KMOD */
1318 1318
1319 mix = kmalloc(sizeof(*mix), GFP_KERNEL); 1319 mix = kmalloc(sizeof(*mix), GFP_KERNEL);