]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
authorLinus Torvalds <torvalds@g5.osdl.org>
Thu, 1 Dec 2005 23:52:12 +0000 (15:52 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 1 Dec 2005 23:52:12 +0000 (15:52 -0800)
254 files changed:
Documentation/usb/error-codes.txt
MAINTAINERS
Makefile
arch/arm/configs/corgi_defconfig
arch/arm/configs/poodle_defconfig [deleted file]
arch/arm/configs/spitz_defconfig
arch/arm/kernel/head.S
arch/arm/mach-pxa/Kconfig
arch/arm/mach-realview/core.c
arch/arm/mm/consistent.c
arch/arm/tools/mach-types
arch/frv/kernel/semaphore.c
arch/frv/mb93090-mb00/pci-irq.c
arch/frv/mm/init.c
arch/frv/mm/pgalloc.c
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/io_apic.c
arch/i386/kernel/reboot.c
arch/ia64/kernel/ia64_ksyms.c
arch/ia64/kernel/kprobes.c
arch/ia64/kernel/traps.c
arch/m32r/kernel/io_mappi3.c
arch/m32r/kernel/setup_mappi3.c
arch/m32r/kernel/sys_m32r.c
arch/powerpc/kernel/ppc_ksyms.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/prom_init.c
arch/powerpc/kernel/vdso.c
arch/ppc/boot/simple/Makefile
arch/ppc/kernel/ppc_ksyms.c
arch/ppc/kernel/process.c
arch/ppc/syslib/m82xx_pci.c
arch/sparc/mm/generic.c
arch/sparc64/mm/generic.c
drivers/acpi/Kconfig
drivers/acpi/Makefile
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/processor_thermal.c
drivers/acpi/scan.c
drivers/acpi/thermal.c
drivers/acpi/video.c
drivers/atm/Kconfig
drivers/atm/Makefile
drivers/atm/adummy.c [new file with mode: 0644]
drivers/atm/atmdev_init.c [deleted file]
drivers/atm/atmtcp.c
drivers/atm/lanai.c
drivers/char/drm/drm_context.c
drivers/char/mem.c
drivers/cpufreq/cpufreq.c
drivers/hwmon/w83792d.c
drivers/md/md.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c
drivers/md/raid6main.c
drivers/media/dvb/b2c2/flexcop-hw-filter.c
drivers/media/dvb/dvb-core/dvb_ca_en50221.c
drivers/media/dvb/dvb-core/dvb_net.c
drivers/media/dvb/dvb-usb/a800.c
drivers/media/dvb/dvb-usb/dibusb-common.c
drivers/media/dvb/dvb-usb/digitv.c
drivers/media/dvb/dvb-usb/dvb-usb-init.c
drivers/media/dvb/frontends/cx22702.c
drivers/media/dvb/frontends/cx22702.h
drivers/media/dvb/frontends/nxt200x.c
drivers/media/dvb/frontends/ves1820.c
drivers/media/dvb/ttpci/Kconfig
drivers/media/dvb/ttpci/av7110_ca.c
drivers/media/dvb/ttpci/budget-av.c
drivers/media/dvb/ttpci/budget-ci.c
drivers/media/dvb/ttpci/budget.c
drivers/media/dvb/ttpci/ttpci-eeprom.c
drivers/media/video/Kconfig
drivers/media/video/bttv-cards.c
drivers/media/video/bttv-driver.c
drivers/media/video/cx25840/cx25840-core.c
drivers/media/video/cx25840/cx25840.h
drivers/media/video/cx88/Kconfig
drivers/media/video/cx88/Makefile
drivers/media/video/cx88/cx88-cards.c
drivers/media/video/cx88/cx88-core.c
drivers/media/video/cx88/cx88-tvaudio.c
drivers/media/video/cx88/cx88.h
drivers/media/video/em28xx/em28xx-core.c
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/ir-kbd-i2c.c
drivers/media/video/saa7115.c
drivers/media/video/saa711x.c
drivers/media/video/saa7127.c
drivers/media/video/saa7134/Kconfig
drivers/media/video/saa7134/Makefile
drivers/media/video/saa7134/saa7134-alsa.c
drivers/media/video/saa7134/saa7134-core.c
drivers/media/video/saa7134/saa7134-oss.c
drivers/media/video/saa7134/saa7134.h
drivers/media/video/tveeprom.c
drivers/media/video/video-buf.c
drivers/media/video/videodev.c
drivers/message/fusion/mptbase.c
drivers/message/fusion/mptbase.h
drivers/mmc/mmc.c
drivers/mtd/chips/cfi_cmdset_0001.c
drivers/mtd/chips/cfi_probe.c
drivers/mtd/chips/sharp.c
drivers/mtd/devices/block2mtd.c
drivers/mtd/devices/ms02-nv.c
drivers/mtd/ftl.c
drivers/mtd/maps/Kconfig
drivers/mtd/maps/Makefile
drivers/mtd/maps/ixp4xx.c
drivers/mtd/maps/nettel.c
drivers/mtd/maps/pci.c
drivers/mtd/maps/physmap.c
drivers/mtd/maps/sc520cdp.c
drivers/mtd/nand/nandsim.c
drivers/mtd/rfd_ftl.c
drivers/net/b44.c
drivers/net/e1000/e1000_main.c
drivers/net/ibm_emac/ibm_emac_core.c
drivers/net/ibm_emac/ibm_emac_core.h
drivers/net/jazzsonic.c
drivers/net/mipsnet.h
drivers/net/pcmcia/fmvj18x_cs.c
drivers/net/sk98lin/Makefile
drivers/net/sk98lin/h/skdrv2nd.h
drivers/net/sk98lin/skcsum.c [deleted file]
drivers/net/sk98lin/skethtool.c
drivers/net/sk98lin/skge.c
drivers/net/skge.c
drivers/net/wireless/airo.c
drivers/net/wireless/orinoco.c
drivers/pcmcia/m32r_cfc.c
drivers/scsi/megaraid.c
drivers/serial/8250.c
drivers/serial/8250_pci.c
drivers/serial/serial_core.c
drivers/serial/serial_cs.c
drivers/usb/atm/cxacru.c
drivers/usb/atm/usbatm.c
drivers/usb/core/hcd-pci.c
drivers/usb/core/hcd.c
drivers/usb/core/hcd.h
drivers/usb/host/ehci-pci.c
drivers/usb/host/ehci-q.c
drivers/usb/host/ehci-sched.c
drivers/usb/host/ohci-hcd.c
drivers/usb/host/ohci-hub.c
drivers/usb/host/ohci-pci.c
drivers/usb/host/uhci-hcd.c
drivers/video/Kconfig
drivers/video/cirrusfb.c
drivers/video/console/fbcon_ccw.c
drivers/video/console/fbcon_rotate.h
fs/9p/vfs_inode.c
fs/cifs/CHANGES
fs/cifs/README
fs/cifs/TODO
fs/cifs/cifsfs.c
fs/cifs/cifssmb.c
fs/cifs/dir.c
fs/cifs/inode.c
fs/cifs/misc.c
fs/cifs/netmisc.c
fs/cifs/transport.c
fs/dquot.c
fs/exec.c
fs/ext3/resize.c
fs/fuse/dir.c
fs/hfsplus/hfsplus_fs.h
fs/hfsplus/hfsplus_raw.h
fs/hfsplus/options.c
fs/hfsplus/super.c
fs/jffs2/fs.c
fs/jffs2/super.c
fs/proc/task_mmu.c
fs/reiserfs/inode.c
fs/reiserfs/journal.c
include/asm-arm/arch-s3c2410/regs-gpio.h
include/asm-arm/arch-sa1100/io.h
include/asm-frv/hardirq.h
include/asm-frv/ide.h
include/asm-frv/page.h
include/asm-frv/semaphore.h
include/asm-frv/thread_info.h
include/asm-ia64/page.h
include/asm-m32r/atomic.h
include/asm-m32r/ide.h
include/asm-m32r/mappi3/mappi3_pld.h
include/asm-m32r/system.h
include/asm-sparc64/pgtable.h
include/linux/atmdev.h
include/linux/cn_proc.h
include/linux/cpu.h
include/linux/i2c-id.h
include/linux/memory.h
include/linux/mm.h
include/linux/mmc/protocol.h
include/linux/mtd/cfi.h
include/linux/rmap.h
include/linux/sched.h
include/linux/serial_core.h
include/linux/swap.h
include/media/tveeprom.h
kernel/cpu.c
kernel/fork.c
kernel/posix-cpu-timers.c
kernel/power/main.c
kernel/ptrace.c
kernel/workqueue.c
lib/genalloc.c
mm/fremap.c
mm/madvise.c
mm/memory.c
mm/mempolicy.c
mm/msync.c
mm/nommu.c
mm/page_alloc.c
mm/rmap.c
mm/thrash.c
mm/vmscan.c
net/atm/atm_misc.c
net/atm/common.c
net/atm/common.h
net/atm/resources.c
net/atm/resources.h
net/ipv4/fib_hash.c
net/ipv4/fib_semantics.c
net/ipv4/icmp.c
net/ipv4/ip_gre.c
net/ipv4/ip_output.c
net/ipv4/ipvs/ip_vs_conn.c
net/ipv4/ipvs/ip_vs_ctl.c
net/ipv4/ipvs/ip_vs_proto_tcp.c
net/ipv4/netfilter/ip_conntrack_amanda.c
net/ipv4/netfilter/ip_conntrack_core.c
net/ipv4/netfilter/ip_conntrack_ftp.c
net/ipv4/netfilter/ip_conntrack_irc.c
net/ipv4/netfilter/ip_conntrack_proto_icmp.c
net/ipv4/netfilter/ip_conntrack_proto_sctp.c
net/ipv4/netfilter/ip_conntrack_proto_tcp.c
net/ipv4/netfilter/ip_nat_core.c
net/ipv4/netfilter/ip_tables.c
net/ipv4/netfilter/ipt_LOG.c
net/ipv4/proc.c
net/ipv4/route.c
net/ipv4/tcp.c
net/ipv6/addrconf.c
net/ipv6/icmp.c
net/ipv6/ip6_output.c
net/ipv6/ipv6_sockglue.c
net/ipv6/netfilter/ip6_tables.c
security/keys/keyring.c

index 1e36f1661cd0a6409a00defea1407162a9bdfa61..867f4c38f3564ae8fcfa8aa92df2b8eb41cfa31a 100644 (file)
@@ -46,8 +46,9 @@ USB-specific:
 
 -EMSGSIZE      (a) endpoint maxpacket size is zero; it is not usable
                    in the current interface altsetting.
-               (b) ISO packet is biger than endpoint maxpacket
-               (c) requested data transfer size is invalid (negative)
+               (b) ISO packet is larger than the endpoint maxpacket.
+               (c) requested data transfer length is invalid: negative
+                   or too large for the host controller.
 
 -ENOSPC                This request would overcommit the usb bandwidth reserved
                for periodic transfers (interrupt, isochronous).
index a74a0c72613452460f0c8cdcbf232d7db207f084..1fc80ec4999bcc6deff5035ef84a433beeb8b9ce 100644 (file)
@@ -536,6 +536,7 @@ P:  Mauro Carvalho Chehab
 M:     mchehab@brturbo.com.br
 L:     video4linux-list@redhat.com
 W:     http://linuxtv.org
+T:     quilt http://www.linuxtv.org/download/quilt/
 S:     Maintained
 
 BUSLOGIC SCSI DRIVER
@@ -833,6 +834,7 @@ P:  LinuxTV.org Project
 M:     linux-dvb-maintainer@linuxtv.org
 L:     linux-dvb@linuxtv.org (subscription required)
 W:     http://linuxtv.org/
+T:     quilt http://www.linuxtv.org/download/quilt/
 S:     Supported
 
 EATA-DMA SCSI DRIVER
@@ -2885,6 +2887,7 @@ P:        Mauro Carvalho Chehab
 M:     mchehab@brturbo.com.br
 L:     video4linux-list@redhat.com
 W:     http://linuxtv.org
+T:     quilt http://www.linuxtv.org/download/quilt/
 S:     Maintained
 
 W1 DALLAS'S 1-WIRE BUS
index e7a0443c867c4c750f829bbceb6bb99889dda78b..4643d579fc87d864e511cbcc84751e0046a3be48 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 15
-EXTRAVERSION =-rc2
+EXTRAVERSION =-rc4
 NAME=Affluent Albatross
 
 # *DOCUMENTATION*
index 24987c89609ae29530f806d322caa003e7dfc157..06229026f78bf7b450bfe2f7b6122f3d0aa59b33 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.14-rc3
-# Sun Oct  9 15:46:42 2005
+# Linux kernel version: 2.6.15-rc2
+# Mon Nov 28 10:30:09 2005
 #
 CONFIG_ARM=y
 CONFIG_MMU=y
@@ -63,6 +63,23 @@ CONFIG_OBSOLETE_MODPARM=y
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
 
+#
+# Block layer
+#
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
 #
 # System Type
 #
@@ -85,6 +102,7 @@ CONFIG_ARCH_PXA=y
 # CONFIG_ARCH_LH7A40X is not set
 # CONFIG_ARCH_OMAP is not set
 # CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_REALVIEW is not set
 # CONFIG_ARCH_IMX is not set
 # CONFIG_ARCH_H720X is not set
 # CONFIG_ARCH_AAEC2000 is not set
@@ -98,12 +116,14 @@ CONFIG_ARCH_PXA=y
 CONFIG_PXA_SHARPSL=y
 CONFIG_PXA_SHARPSL_25x=y
 # CONFIG_PXA_SHARPSL_27x is not set
-# CONFIG_MACH_POODLE is not set
+CONFIG_MACH_POODLE=y
 CONFIG_MACH_CORGI=y
 CONFIG_MACH_SHEPHERD=y
 CONFIG_MACH_HUSKY=y
+CONFIG_MACH_TOSA=y
 CONFIG_PXA25x=y
 CONFIG_PXA_SHARP_C7xx=y
+CONFIG_PXA_SSP=y
 
 #
 # Processor Type
@@ -155,6 +175,7 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
 CONFIG_ALIGNMENT_TRAP=y
 
 #
@@ -235,6 +256,10 @@ CONFIG_INET6_TUNNEL=m
 CONFIG_IPV6_TUNNEL=m
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
+
+#
+# Core Netfilter Configuration
+#
 # CONFIG_NETFILTER_NETLINK is not set
 
 #
@@ -356,6 +381,10 @@ CONFIG_IP6_NF_RAW=m
 # CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
 # CONFIG_NET_SCHED is not set
 CONFIG_NET_CLS_ROUTE=y
 
@@ -413,6 +442,7 @@ CONFIG_IRCOMM=m
 # CONFIG_SMC_IRCC_FIR is not set
 # CONFIG_ALI_FIR is not set
 # CONFIG_VIA_FIR is not set
+CONFIG_PXA_FICP=m
 CONFIG_BT=m
 CONFIG_BT_L2CAP=m
 CONFIG_BT_SCO=m
@@ -431,7 +461,6 @@ CONFIG_BT_HCIUSB=m
 CONFIG_BT_HCIUART=m
 CONFIG_BT_HCIUART_H4=y
 CONFIG_BT_HCIUART_BCSP=y
-CONFIG_BT_HCIUART_BCSP_TXCRC=y
 CONFIG_BT_HCIBCM203X=m
 CONFIG_BT_HCIBPA10X=m
 CONFIG_BT_HCIBFUSB=m
@@ -458,6 +487,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 # CONFIG_DEBUG_DRIVER is not set
 
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
 #
 # Memory Technology Devices (MTD)
 #
@@ -477,6 +511,7 @@ CONFIG_MTD_BLOCK=y
 # CONFIG_FTL is not set
 # CONFIG_NFTL is not set
 # CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -531,6 +566,11 @@ CONFIG_MTD_NAND_IDS=y
 CONFIG_MTD_NAND_SHARPSL=y
 # CONFIG_MTD_NAND_NANDSIM is not set
 
+#
+# OneNAND Flash Device Drivers
+#
+# CONFIG_MTD_ONENAND is not set
+
 #
 # Parallel port support
 #
@@ -551,14 +591,6 @@ CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_RAM is not set
 CONFIG_BLK_DEV_RAM_COUNT=16
 # CONFIG_CDROM_PKTCDVD is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
 # CONFIG_ATA_OVER_ETH is not set
 
 #
@@ -625,6 +657,7 @@ CONFIG_SCSI_MULTI_LUN=y
 #
 # SCSI low-level drivers
 #
+# CONFIG_ISCSI_TCP is not set
 # CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_DEBUG is not set
 
@@ -748,6 +781,7 @@ CONFIG_PPP_ASYNC=m
 # CONFIG_PPP_SYNC_TTY is not set
 # CONFIG_PPP_DEFLATE is not set
 CONFIG_PPP_BSDCOMP=m
+# CONFIG_PPP_MPPE is not set
 # CONFIG_PPPOE is not set
 # CONFIG_SLIP is not set
 # CONFIG_SHAPER is not set
@@ -850,11 +884,15 @@ CONFIG_UNIX98_PTYS=y
 # PCMCIA character devices
 #
 # CONFIG_SYNCLINK_CS is not set
+# CONFIG_CARDMAN_4000 is not set
+# CONFIG_CARDMAN_4040 is not set
 # CONFIG_RAW_DRIVER is not set
 
 #
 # TPM devices
 #
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
 
 #
 # I2C support
@@ -889,6 +927,7 @@ CONFIG_I2C_PXA=y
 # CONFIG_SENSORS_PCF8591 is not set
 # CONFIG_SENSORS_RTC8564 is not set
 # CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_RTC_X1205_I2C is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
@@ -957,7 +996,10 @@ CONFIG_VIDEO_DEV=m
 # CONFIG_VIDEO_SAA5246A is not set
 # CONFIG_VIDEO_SAA5249 is not set
 # CONFIG_TUNER_3036 is not set
+# CONFIG_VIDEO_EM28XX is not set
 # CONFIG_VIDEO_OVCAMCHIP is not set
+# CONFIG_VIDEO_AUDIO_DECODER is not set
+# CONFIG_VIDEO_DECODER is not set
 
 #
 # Radio Adapters
@@ -976,13 +1018,12 @@ CONFIG_FB=y
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
-CONFIG_FB_SOFT_CURSOR=y
 # CONFIG_FB_MACMODES is not set
 # CONFIG_FB_MODE_HELPERS is not set
 # CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_PXA is not set
 CONFIG_FB_W100=y
-# CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
 
 #
@@ -991,6 +1032,7 @@ CONFIG_FB_W100=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
 CONFIG_FONTS=y
 CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
@@ -1087,15 +1129,15 @@ CONFIG_USB_SL811_CS=m
 # USB Device Class drivers
 #
 # CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
 
 #
-# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
-CONFIG_USB_ACM=m
-CONFIG_USB_PRINTER=m
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
+# may also be needed; see USB_STORAGE Help for more information
 #
 CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_DEBUG is not set
@@ -1107,7 +1149,6 @@ CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_SDDR09 is not set
 # CONFIG_USB_STORAGE_SDDR55 is not set
 # CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_STORAGE_ONETOUCH is not set
 
 #
 # USB Input Devices
@@ -1185,6 +1226,7 @@ CONFIG_USB_MON=y
 CONFIG_USB_SERIAL=m
 CONFIG_USB_SERIAL_GENERIC=y
 # CONFIG_USB_SERIAL_AIRPRIME is not set
+# CONFIG_USB_SERIAL_ANYDATA is not set
 CONFIG_USB_SERIAL_BELKIN=m
 # CONFIG_USB_SERIAL_WHITEHEAT is not set
 CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
@@ -1340,6 +1382,7 @@ CONFIG_RAMFS=y
 CONFIG_JFFS2_FS=y
 CONFIG_JFFS2_FS_DEBUG=0
 CONFIG_JFFS2_FS_WRITEBUFFER=y
+CONFIG_JFFS2_SUMMARY=y
 CONFIG_JFFS2_COMPRESSION_OPTIONS=y
 CONFIG_JFFS2_ZLIB=y
 CONFIG_JFFS2_RTIME=y
@@ -1466,7 +1509,9 @@ CONFIG_DETECT_SOFTLOCKUP=y
 CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_VM is not set
 CONFIG_FRAME_POINTER=y
+# CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_DEBUG_USER is not set
 # CONFIG_DEBUG_WAITQ is not set
 CONFIG_DEBUG_ERRORS=y
diff --git a/arch/arm/configs/poodle_defconfig b/arch/arm/configs/poodle_defconfig
deleted file mode 100644 (file)
index 7282290..0000000
+++ /dev/null
@@ -1,1015 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.14-rc3
-# Sun Oct  9 17:04:29 2005
-#
-CONFIG_ARM=y
-CONFIG_MMU=y
-CONFIG_UID16=y
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-CONFIG_GENERIC_CALIBRATE_DELAY=y
-
-#
-# Code maturity level options
-#
-CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
-CONFIG_BROKEN_ON_SMP=y
-CONFIG_LOCK_KERNEL=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
-CONFIG_LOCALVERSION=""
-CONFIG_LOCALVERSION_AUTO=y
-CONFIG_SWAP=y
-CONFIG_SYSVIPC=y
-# CONFIG_POSIX_MQUEUE is not set
-CONFIG_BSD_PROCESS_ACCT=y
-# CONFIG_BSD_PROCESS_ACCT_V3 is not set
-CONFIG_SYSCTL=y
-# CONFIG_AUDIT is not set
-CONFIG_HOTPLUG=y
-CONFIG_KOBJECT_UEVENT=y
-# CONFIG_IKCONFIG is not set
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_EMBEDDED=y
-CONFIG_KALLSYMS=y
-# CONFIG_KALLSYMS_ALL is not set
-# CONFIG_KALLSYMS_EXTRA_PASS is not set
-CONFIG_PRINTK=y
-CONFIG_BUG=y
-CONFIG_BASE_FULL=y
-CONFIG_FUTEX=y
-CONFIG_EPOLL=y
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_SHMEM=y
-CONFIG_CC_ALIGN_FUNCTIONS=0
-CONFIG_CC_ALIGN_LABELS=0
-CONFIG_CC_ALIGN_LOOPS=0
-CONFIG_CC_ALIGN_JUMPS=0
-# CONFIG_TINY_SHMEM is not set
-CONFIG_BASE_SMALL=0
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_OBSOLETE_MODPARM=y
-CONFIG_MODVERSIONS=y
-# CONFIG_MODULE_SRCVERSION_ALL is not set
-CONFIG_KMOD=y
-
-#
-# System Type
-#
-# CONFIG_ARCH_CLPS7500 is not set
-# CONFIG_ARCH_CLPS711X is not set
-# CONFIG_ARCH_CO285 is not set
-# CONFIG_ARCH_EBSA110 is not set
-# CONFIG_ARCH_CAMELOT is not set
-# CONFIG_ARCH_FOOTBRIDGE is not set
-# CONFIG_ARCH_INTEGRATOR is not set
-# CONFIG_ARCH_IOP3XX is not set
-# CONFIG_ARCH_IXP4XX is not set
-# CONFIG_ARCH_IXP2000 is not set
-# CONFIG_ARCH_L7200 is not set
-CONFIG_ARCH_PXA=y
-# CONFIG_ARCH_RPC is not set
-# CONFIG_ARCH_SA1100 is not set
-# CONFIG_ARCH_S3C2410 is not set
-# CONFIG_ARCH_SHARK is not set
-# CONFIG_ARCH_LH7A40X is not set
-# CONFIG_ARCH_OMAP is not set
-# CONFIG_ARCH_VERSATILE is not set
-# CONFIG_ARCH_IMX is not set
-# CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_AAEC2000 is not set
-
-#
-# Intel PXA2xx Implementations
-#
-# CONFIG_ARCH_LUBBOCK is not set
-# CONFIG_MACH_MAINSTONE is not set
-# CONFIG_ARCH_PXA_IDP is not set
-CONFIG_PXA_SHARPSL=y
-CONFIG_PXA_SHARPSL_25x=y
-# CONFIG_PXA_SHARPSL_27x is not set
-CONFIG_MACH_POODLE=y
-# CONFIG_MACH_CORGI is not set
-# CONFIG_MACH_SHEPHERD is not set
-# CONFIG_MACH_HUSKY is not set
-CONFIG_PXA25x=y
-
-#
-# Processor Type
-#
-CONFIG_CPU_32=y
-CONFIG_CPU_XSCALE=y
-CONFIG_CPU_32v5=y
-CONFIG_CPU_ABRT_EV5T=y
-CONFIG_CPU_CACHE_VIVT=y
-CONFIG_CPU_TLB_V4WBI=y
-
-#
-# Processor Features
-#
-CONFIG_ARM_THUMB=y
-CONFIG_XSCALE_PMU=y
-CONFIG_SHARP_LOCOMO=y
-CONFIG_SHARP_PARAM=y
-CONFIG_SHARP_SCOOP=y
-
-#
-# Bus support
-#
-CONFIG_ISA_DMA_API=y
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
-CONFIG_PCCARD=y
-# CONFIG_PCMCIA_DEBUG is not set
-CONFIG_PCMCIA=y
-CONFIG_PCMCIA_LOAD_CIS=y
-CONFIG_PCMCIA_IOCTL=y
-
-#
-# PC-card bridges
-#
-CONFIG_PCMCIA_PXA2XX=y
-
-#
-# Kernel Features
-#
-CONFIG_PREEMPT=y
-# CONFIG_NO_IDLE_HZ is not set
-# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
-CONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
-# CONFIG_DISCONTIGMEM_MANUAL is not set
-# CONFIG_SPARSEMEM_MANUAL is not set
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
-# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_ALIGNMENT_TRAP=y
-
-#
-# Boot options
-#
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty1 noinitrd root=/dev/mtdblock2 rootfstype=jffs2   debug"
-# CONFIG_XIP_KERNEL is not set
-
-#
-# Floating point emulation
-#
-
-#
-# At least one emulation must be selected
-#
-CONFIG_FPE_NWFPE=y
-# CONFIG_FPE_NWFPE_XP is not set
-# CONFIG_FPE_FASTFPE is not set
-
-#
-# Userspace binary formats
-#
-CONFIG_BINFMT_ELF=y
-CONFIG_BINFMT_AOUT=m
-CONFIG_BINFMT_MISC=m
-# CONFIG_ARTHUR is not set
-
-#
-# Power management options
-#
-CONFIG_PM=y
-CONFIG_APM=y
-
-#
-# Networking
-#
-CONFIG_NET=y
-
-#
-# Networking options
-#
-CONFIG_PACKET=y
-CONFIG_PACKET_MMAP=y
-CONFIG_UNIX=y
-# CONFIG_NET_KEY is not set
-CONFIG_INET=y
-# CONFIG_IP_MULTICAST is not set
-# CONFIG_IP_ADVANCED_ROUTER is not set
-CONFIG_IP_FIB_HASH=y
-# CONFIG_IP_PNP is not set
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE is not set
-# CONFIG_ARPD is not set
-CONFIG_SYN_COOKIES=y
-# CONFIG_INET_AH is not set
-# CONFIG_INET_ESP is not set
-# CONFIG_INET_IPCOMP is not set
-# CONFIG_INET_TUNNEL is not set
-CONFIG_INET_DIAG=y
-CONFIG_INET_TCP_DIAG=y
-# CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_BIC=y
-# CONFIG_IPV6 is not set
-# CONFIG_NETFILTER is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
-# CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
-# CONFIG_IP_SCTP is not set
-# CONFIG_ATM is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_VLAN_8021Q is not set
-# CONFIG_DECNET is not set
-# CONFIG_LLC2 is not set
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_NET_DIVERT is not set
-# CONFIG_ECONET is not set
-# CONFIG_WAN_ROUTER is not set
-# CONFIG_NET_SCHED is not set
-# CONFIG_NET_CLS_ROUTE is not set
-
-#
-# Network testing
-#
-# CONFIG_NET_PKTGEN is not set
-# CONFIG_HAMRADIO is not set
-# CONFIG_IRDA is not set
-# CONFIG_BT is not set
-# CONFIG_IEEE80211 is not set
-
-#
-# Device Drivers
-#
-
-#
-# Generic Driver Options
-#
-CONFIG_STANDALONE=y
-CONFIG_PREVENT_FIRMWARE_BUILD=y
-CONFIG_FW_LOADER=y
-# CONFIG_DEBUG_DRIVER is not set
-
-#
-# Memory Technology Devices (MTD)
-#
-CONFIG_MTD=y
-# CONFIG_MTD_DEBUG is not set
-# CONFIG_MTD_CONCAT is not set
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_CMDLINE_PARTS is not set
-# CONFIG_MTD_AFS_PARTS is not set
-
-#
-# User Modules And Translation Layers
-#
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
-# CONFIG_INFTL is not set
-
-#
-# RAM/ROM/Flash chip drivers
-#
-# CONFIG_MTD_CFI is not set
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_ABSENT is not set
-
-#
-# Mapping drivers for chip access
-#
-CONFIG_MTD_COMPLEX_MAPPINGS=y
-CONFIG_MTD_SHARP_SL=y
-# CONFIG_MTD_PLATRAM is not set
-
-#
-# Self-contained MTD device drivers
-#
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_PHRAM is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLKMTD is not set
-# CONFIG_MTD_BLOCK2MTD is not set
-
-#
-# Disk-On-Chip Device Drivers
-#
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-
-#
-# NAND Flash Device Drivers
-#
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
-# CONFIG_MTD_NAND_H1900 is not set
-CONFIG_MTD_NAND_IDS=y
-# CONFIG_MTD_NAND_DISKONCHIP is not set
-CONFIG_MTD_NAND_SHARPSL=y
-# CONFIG_MTD_NAND_NANDSIM is not set
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-
-#
-# Block devices
-#
-# CONFIG_BLK_DEV_COW_COMMON is not set
-CONFIG_BLK_DEV_LOOP=y
-# CONFIG_BLK_DEV_CRYPTOLOOP is not set
-# CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_RAM is not set
-CONFIG_BLK_DEV_RAM_COUNT=16
-# CONFIG_CDROM_PKTCDVD is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
-# CONFIG_ATA_OVER_ETH is not set
-
-#
-# ATA/ATAPI/MFM/RLL support
-#
-CONFIG_IDE=y
-CONFIG_BLK_DEV_IDE=y
-
-#
-# Please see Documentation/ide.txt for help/info on IDE drives
-#
-# CONFIG_BLK_DEV_IDE_SATA is not set
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
-CONFIG_BLK_DEV_IDECS=y
-# CONFIG_BLK_DEV_IDECD is not set
-# CONFIG_BLK_DEV_IDETAPE is not set
-# CONFIG_BLK_DEV_IDEFLOPPY is not set
-# CONFIG_IDE_TASK_IOCTL is not set
-
-#
-# IDE chipset support/bugfixes
-#
-CONFIG_IDE_GENERIC=y
-# CONFIG_IDE_ARM is not set
-# CONFIG_BLK_DEV_IDEDMA is not set
-# CONFIG_IDEDMA_AUTO is not set
-# CONFIG_BLK_DEV_HD is not set
-
-#
-# SCSI device support
-#
-# CONFIG_RAID_ATTRS is not set
-# CONFIG_SCSI is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
-# CONFIG_FUSION is not set
-
-#
-# IEEE 1394 (FireWire) support
-#
-
-#
-# I2O device support
-#
-
-#
-# Network device support
-#
-CONFIG_NETDEVICES=y
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
-
-#
-# PHY device support
-#
-# CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
-CONFIG_NET_ETHERNET=y
-# CONFIG_MII is not set
-# CONFIG_SMC91X is not set
-# CONFIG_DM9000 is not set
-
-#
-# Ethernet (1000 Mbit)
-#
-
-#
-# Ethernet (10000 Mbit)
-#
-
-#
-# Token Ring devices
-#
-
-#
-# Wireless LAN (non-hamradio)
-#
-CONFIG_NET_RADIO=y
-
-#
-# Obsolete Wireless cards support (pre-802.11)
-#
-# CONFIG_STRIP is not set
-# CONFIG_PCMCIA_WAVELAN is not set
-# CONFIG_PCMCIA_NETWAVE is not set
-
-#
-# Wireless 802.11 Frequency Hopping cards support
-#
-# CONFIG_PCMCIA_RAYCS is not set
-
-#
-# Wireless 802.11b ISA/PCI cards support
-#
-# CONFIG_HERMES is not set
-# CONFIG_ATMEL is not set
-
-#
-# Wireless 802.11b Pcmcia/Cardbus cards support
-#
-# CONFIG_AIRO_CS is not set
-# CONFIG_PCMCIA_WL3501 is not set
-# CONFIG_HOSTAP is not set
-CONFIG_NET_WIRELESS=y
-
-#
-# PCMCIA network device support
-#
-CONFIG_NET_PCMCIA=y
-# CONFIG_PCMCIA_3C589 is not set
-# CONFIG_PCMCIA_3C574 is not set
-# CONFIG_PCMCIA_FMVJ18X is not set
-CONFIG_PCMCIA_PCNET=y
-# CONFIG_PCMCIA_NMCLAN is not set
-# CONFIG_PCMCIA_SMC91C92 is not set
-# CONFIG_PCMCIA_XIRC2PS is not set
-# CONFIG_PCMCIA_AXNET is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-CONFIG_PPP=m
-# CONFIG_PPP_MULTILINK is not set
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-# CONFIG_PPP_DEFLATE is not set
-CONFIG_PPP_BSDCOMP=m
-# CONFIG_PPPOE is not set
-# CONFIG_SLIP is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
-# CONFIG_ISDN is not set
-
-#
-# Input device support
-#
-CONFIG_INPUT=y
-
-#
-# Userland interfaces
-#
-# CONFIG_INPUT_MOUSEDEV is not set
-# CONFIG_INPUT_JOYDEV is not set
-CONFIG_INPUT_TSDEV=y
-CONFIG_INPUT_TSDEV_SCREEN_X=240
-CONFIG_INPUT_TSDEV_SCREEN_Y=320
-CONFIG_INPUT_EVDEV=y
-CONFIG_INPUT_EVBUG=y
-
-#
-# Input Device Drivers
-#
-CONFIG_INPUT_KEYBOARD=y
-# CONFIG_KEYBOARD_ATKBD is not set
-# CONFIG_KEYBOARD_SUNKBD is not set
-# CONFIG_KEYBOARD_LKKBD is not set
-CONFIG_KEYBOARD_LOCOMO=y
-# CONFIG_KEYBOARD_XTKBD is not set
-# CONFIG_KEYBOARD_NEWTON is not set
-# CONFIG_KEYBOARD_CORGI is not set
-CONFIG_KEYBOARD_SPITZ=y
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
-# CONFIG_INPUT_MISC is not set
-
-#
-# Hardware I/O ports
-#
-# CONFIG_SERIO is not set
-# CONFIG_GAMEPORT is not set
-
-#
-# Character devices
-#
-CONFIG_VT=y
-CONFIG_VT_CONSOLE=y
-CONFIG_HW_CONSOLE=y
-# CONFIG_SERIAL_NONSTANDARD is not set
-
-#
-# Serial drivers
-#
-# CONFIG_SERIAL_8250 is not set
-
-#
-# Non-8250 serial port support
-#
-CONFIG_SERIAL_PXA=y
-CONFIG_SERIAL_PXA_CONSOLE=y
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-CONFIG_UNIX98_PTYS=y
-# CONFIG_LEGACY_PTYS is not set
-
-#
-# IPMI
-#
-# CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
-# CONFIG_NVRAM is not set
-# CONFIG_RTC is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-
-#
-# Ftape, the floppy tape device driver
-#
-
-#
-# PCMCIA character devices
-#
-# CONFIG_SYNCLINK_CS is not set
-# CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
-
-#
-# I2C support
-#
-CONFIG_I2C=y
-# CONFIG_I2C_CHARDEV is not set
-
-#
-# I2C Algorithms
-#
-CONFIG_I2C_ALGOBIT=y
-# CONFIG_I2C_ALGOPCF is not set
-# CONFIG_I2C_ALGOPCA is not set
-
-#
-# I2C Hardware Bus support
-#
-# CONFIG_I2C_PXA is not set
-# CONFIG_I2C_PARPORT_LIGHT is not set
-# CONFIG_I2C_STUB is not set
-# CONFIG_I2C_PCA_ISA is not set
-
-#
-# Miscellaneous I2C Chip support
-#
-# CONFIG_SENSORS_DS1337 is not set
-# CONFIG_SENSORS_DS1374 is not set
-# CONFIG_SENSORS_EEPROM is not set
-# CONFIG_SENSORS_PCF8574 is not set
-# CONFIG_SENSORS_PCA9539 is not set
-# CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_SENSORS_RTC8564 is not set
-# CONFIG_SENSORS_MAX6875 is not set
-CONFIG_I2C_DEBUG_CORE=y
-CONFIG_I2C_DEBUG_ALGO=y
-CONFIG_I2C_DEBUG_BUS=y
-# CONFIG_I2C_DEBUG_CHIP is not set
-
-#
-# Hardware Monitoring support
-#
-CONFIG_HWMON=y
-# CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_ADM1025 is not set
-# CONFIG_SENSORS_ADM1026 is not set
-# CONFIG_SENSORS_ADM1031 is not set
-# CONFIG_SENSORS_ADM9240 is not set
-# CONFIG_SENSORS_ASB100 is not set
-# CONFIG_SENSORS_ATXP1 is not set
-# CONFIG_SENSORS_DS1621 is not set
-# CONFIG_SENSORS_FSCHER is not set
-# CONFIG_SENSORS_FSCPOS is not set
-# CONFIG_SENSORS_GL518SM is not set
-# CONFIG_SENSORS_GL520SM is not set
-# CONFIG_SENSORS_IT87 is not set
-# CONFIG_SENSORS_LM63 is not set
-# CONFIG_SENSORS_LM75 is not set
-# CONFIG_SENSORS_LM77 is not set
-# CONFIG_SENSORS_LM78 is not set
-# CONFIG_SENSORS_LM80 is not set
-# CONFIG_SENSORS_LM83 is not set
-# CONFIG_SENSORS_LM85 is not set
-# CONFIG_SENSORS_LM87 is not set
-# CONFIG_SENSORS_LM90 is not set
-# CONFIG_SENSORS_LM92 is not set
-# CONFIG_SENSORS_MAX1619 is not set
-# CONFIG_SENSORS_PC87360 is not set
-# CONFIG_SENSORS_SMSC47M1 is not set
-# CONFIG_SENSORS_SMSC47B397 is not set
-# CONFIG_SENSORS_W83781D is not set
-# CONFIG_SENSORS_W83792D is not set
-# CONFIG_SENSORS_W83L785TS is not set
-# CONFIG_SENSORS_W83627HF is not set
-# CONFIG_SENSORS_W83627EHF is not set
-# CONFIG_HWMON_DEBUG_CHIP is not set
-
-#
-# Misc devices
-#
-
-#
-# Multimedia Capabilities Port drivers
-#
-
-#
-# Multimedia devices
-#
-CONFIG_VIDEO_DEV=m
-
-#
-# Video For Linux
-#
-
-#
-# Video Adapters
-#
-# CONFIG_VIDEO_CPIA is not set
-# CONFIG_VIDEO_SAA5246A is not set
-# CONFIG_VIDEO_SAA5249 is not set
-# CONFIG_TUNER_3036 is not set
-# CONFIG_VIDEO_OVCAMCHIP is not set
-
-#
-# Radio Adapters
-#
-# CONFIG_RADIO_MAESTRO is not set
-
-#
-# Digital Video Broadcasting Devices
-#
-# CONFIG_DVB is not set
-
-#
-# Graphics support
-#
-CONFIG_FB=y
-CONFIG_FB_CFB_FILLRECT=y
-CONFIG_FB_CFB_COPYAREA=y
-CONFIG_FB_CFB_IMAGEBLIT=y
-CONFIG_FB_SOFT_CURSOR=y
-# CONFIG_FB_MACMODES is not set
-CONFIG_FB_MODE_HELPERS=y
-# CONFIG_FB_TILEBLITTING is not set
-CONFIG_FB_PXA=y
-# CONFIG_FB_W100 is not set
-# CONFIG_FB_PXA_PARAMETERS is not set
-# CONFIG_FB_S1D13XXX is not set
-# CONFIG_FB_VIRTUAL is not set
-
-#
-# Console display driver support
-#
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x8=y
-# CONFIG_FONT_8x16 is not set
-# CONFIG_FONT_6x11 is not set
-# CONFIG_FONT_7x14 is not set
-# CONFIG_FONT_PEARL_8x8 is not set
-# CONFIG_FONT_ACORN_8x8 is not set
-# CONFIG_FONT_MINI_4x6 is not set
-# CONFIG_FONT_SUN8x16 is not set
-# CONFIG_FONT_SUN12x22 is not set
-# CONFIG_FONT_10x18 is not set
-
-#
-# Logo configuration
-#
-# CONFIG_LOGO is not set
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-
-#
-# Sound
-#
-# CONFIG_SOUND is not set
-
-#
-# USB support
-#
-CONFIG_USB_ARCH_HAS_HCD=y
-# CONFIG_USB_ARCH_HAS_OHCI is not set
-# CONFIG_USB is not set
-
-#
-# USB Gadget Support
-#
-CONFIG_USB_GADGET=y
-# CONFIG_USB_GADGET_DEBUG_FILES is not set
-CONFIG_USB_GADGET_SELECTED=y
-# CONFIG_USB_GADGET_NET2280 is not set
-CONFIG_USB_GADGET_PXA2XX=y
-CONFIG_USB_PXA2XX=y
-# CONFIG_USB_PXA2XX_SMALL is not set
-# CONFIG_USB_GADGET_GOKU is not set
-# CONFIG_USB_GADGET_LH7A40X is not set
-# CONFIG_USB_GADGET_OMAP is not set
-# CONFIG_USB_GADGET_DUMMY_HCD is not set
-# CONFIG_USB_GADGET_DUALSPEED is not set
-# CONFIG_USB_ZERO is not set
-CONFIG_USB_ETH=y
-CONFIG_USB_ETH_RNDIS=y
-# CONFIG_USB_GADGETFS is not set
-# CONFIG_USB_FILE_STORAGE is not set
-# CONFIG_USB_G_SERIAL is not set
-
-#
-# MMC/SD Card support
-#
-CONFIG_MMC=y
-CONFIG_MMC_DEBUG=y
-CONFIG_MMC_BLOCK=y
-CONFIG_MMC_PXA=y
-# CONFIG_MMC_WBSD is not set
-
-#
-# File systems
-#
-CONFIG_EXT2_FS=y
-CONFIG_EXT2_FS_XATTR=y
-CONFIG_EXT2_FS_POSIX_ACL=y
-CONFIG_EXT2_FS_SECURITY=y
-# CONFIG_EXT2_FS_XIP is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
-CONFIG_FS_MBCACHE=y
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-CONFIG_FS_POSIX_ACL=y
-# CONFIG_XFS_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
-CONFIG_INOTIFY=y
-# CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_FUSE_FS is not set
-
-#
-# CD-ROM/DVD Filesystems
-#
-# CONFIG_ISO9660_FS is not set
-# CONFIG_UDF_FS is not set
-
-#
-# DOS/FAT/NT Filesystems
-#
-CONFIG_FAT_FS=y
-CONFIG_MSDOS_FS=y
-CONFIG_VFAT_FS=y
-CONFIG_FAT_DEFAULT_CODEPAGE=437
-CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
-# CONFIG_NTFS_FS is not set
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-CONFIG_SYSFS=y
-CONFIG_TMPFS=y
-# CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
-# CONFIG_RELAYFS_FS is not set
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_HFSPLUS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_FS_DEBUG=0
-CONFIG_JFFS2_FS_WRITEBUFFER=y
-CONFIG_JFFS2_COMPRESSION_OPTIONS=y
-CONFIG_JFFS2_ZLIB=y
-CONFIG_JFFS2_RTIME=y
-CONFIG_JFFS2_RUBIN=y
-# CONFIG_JFFS2_CMODE_NONE is not set
-CONFIG_JFFS2_CMODE_PRIORITY=y
-# CONFIG_JFFS2_CMODE_SIZE is not set
-CONFIG_CRAMFS=m
-# CONFIG_VXFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
-# CONFIG_NFS_FS is not set
-# CONFIG_NFSD is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
-
-#
-# Partition Types
-#
-CONFIG_PARTITION_ADVANCED=y
-# CONFIG_ACORN_PARTITION is not set
-# CONFIG_OSF_PARTITION is not set
-# CONFIG_AMIGA_PARTITION is not set
-# CONFIG_ATARI_PARTITION is not set
-# CONFIG_MAC_PARTITION is not set
-CONFIG_MSDOS_PARTITION=y
-# CONFIG_BSD_DISKLABEL is not set
-# CONFIG_MINIX_SUBPARTITION is not set
-# CONFIG_SOLARIS_X86_PARTITION is not set
-# CONFIG_UNIXWARE_DISKLABEL is not set
-# CONFIG_LDM_PARTITION is not set
-# CONFIG_SGI_PARTITION is not set
-# CONFIG_ULTRIX_PARTITION is not set
-# CONFIG_SUN_PARTITION is not set
-# CONFIG_EFI_PARTITION is not set
-
-#
-# Native Language Support
-#
-CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="cp437"
-CONFIG_NLS_CODEPAGE_437=y
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=y
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-CONFIG_NLS_UTF8=y
-
-#
-# Profiling support
-#
-# CONFIG_PROFILING is not set
-
-#
-# Kernel hacking
-#
-# CONFIG_PRINTK_TIME is not set
-CONFIG_DEBUG_KERNEL=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_LOG_BUF_SHIFT=14
-CONFIG_DETECT_SOFTLOCKUP=y
-# CONFIG_SCHEDSTATS is not set
-# CONFIG_DEBUG_SLAB is not set
-CONFIG_DEBUG_PREEMPT=y
-# CONFIG_DEBUG_SPINLOCK is not set
-# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
-# CONFIG_DEBUG_KOBJECT is not set
-# CONFIG_DEBUG_BUGVERBOSE is not set
-# CONFIG_DEBUG_INFO is not set
-# CONFIG_DEBUG_FS is not set
-CONFIG_FRAME_POINTER=y
-# CONFIG_DEBUG_USER is not set
-# CONFIG_DEBUG_WAITQ is not set
-CONFIG_DEBUG_ERRORS=y
-# CONFIG_DEBUG_LL is not set
-
-#
-# Security options
-#
-# CONFIG_KEYS is not set
-# CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
-# CONFIG_CRYPTO is not set
-
-#
-# Hardware crypto devices
-#
-
-#
-# Library routines
-#
-CONFIG_CRC_CCITT=y
-# CONFIG_CRC16 is not set
-CONFIG_CRC32=y
-# CONFIG_LIBCRC32C is not set
-CONFIG_ZLIB_INFLATE=y
-CONFIG_ZLIB_DEFLATE=y
index 900e04f8e38c909226851ffed3638ff33a2cf27a..18e9beaec4652aa4e2f8517a4b24e627cc355cc0 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.14-rc3
-# Sun Oct  9 17:11:19 2005
+# Linux kernel version: 2.6.15-rc2
+# Mon Nov 28 10:26:52 2005
 #
 CONFIG_ARM=y
 CONFIG_MMU=y
@@ -63,6 +63,23 @@ CONFIG_OBSOLETE_MODPARM=y
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
 
+#
+# Block layer
+#
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
 #
 # System Type
 #
@@ -85,6 +102,7 @@ CONFIG_ARCH_PXA=y
 # CONFIG_ARCH_LH7A40X is not set
 # CONFIG_ARCH_OMAP is not set
 # CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_REALVIEW is not set
 # CONFIG_ARCH_IMX is not set
 # CONFIG_ARCH_H720X is not set
 # CONFIG_ARCH_AAEC2000 is not set
@@ -98,10 +116,13 @@ CONFIG_ARCH_PXA=y
 CONFIG_PXA_SHARPSL=y
 # CONFIG_PXA_SHARPSL_25x is not set
 CONFIG_PXA_SHARPSL_27x=y
+CONFIG_MACH_AKITA=y
 CONFIG_MACH_SPITZ=y
 CONFIG_MACH_BORZOI=y
 CONFIG_PXA27x=y
+CONFIG_IWMMXT=y
 CONFIG_PXA_SHARP_Cxx00=y
+CONFIG_PXA_SSP=y
 
 #
 # Processor Type
@@ -153,6 +174,7 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
 CONFIG_ALIGNMENT_TRAP=y
 
 #
@@ -233,6 +255,10 @@ CONFIG_INET6_TUNNEL=m
 CONFIG_IPV6_TUNNEL=m
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
+
+#
+# Core Netfilter Configuration
+#
 # CONFIG_NETFILTER_NETLINK is not set
 
 #
@@ -354,6 +380,10 @@ CONFIG_IP6_NF_RAW=m
 # CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
 # CONFIG_NET_SCHED is not set
 CONFIG_NET_CLS_ROUTE=y
 
@@ -411,6 +441,7 @@ CONFIG_IRCOMM=m
 # CONFIG_SMC_IRCC_FIR is not set
 # CONFIG_ALI_FIR is not set
 # CONFIG_VIA_FIR is not set
+CONFIG_PXA_FICP=m
 CONFIG_BT=m
 CONFIG_BT_L2CAP=m
 CONFIG_BT_SCO=m
@@ -429,7 +460,6 @@ CONFIG_BT_HCIUSB=m
 CONFIG_BT_HCIUART=m
 CONFIG_BT_HCIUART_H4=y
 CONFIG_BT_HCIUART_BCSP=y
-CONFIG_BT_HCIUART_BCSP_TXCRC=y
 CONFIG_BT_HCIBCM203X=m
 CONFIG_BT_HCIBPA10X=m
 CONFIG_BT_HCIBFUSB=m
@@ -456,6 +486,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 # CONFIG_DEBUG_DRIVER is not set
 
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
 #
 # Memory Technology Devices (MTD)
 #
@@ -475,6 +510,7 @@ CONFIG_MTD_BLOCK=y
 # CONFIG_FTL is not set
 # CONFIG_NFTL is not set
 # CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -529,6 +565,11 @@ CONFIG_MTD_NAND_IDS=y
 CONFIG_MTD_NAND_SHARPSL=y
 # CONFIG_MTD_NAND_NANDSIM is not set
 
+#
+# OneNAND Flash Device Drivers
+#
+# CONFIG_MTD_ONENAND is not set
+
 #
 # Parallel port support
 #
@@ -549,14 +590,6 @@ CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_RAM is not set
 CONFIG_BLK_DEV_RAM_COUNT=16
 # CONFIG_CDROM_PKTCDVD is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
 # CONFIG_ATA_OVER_ETH is not set
 
 #
@@ -623,6 +656,7 @@ CONFIG_SCSI_MULTI_LUN=y
 #
 # SCSI low-level drivers
 #
+# CONFIG_ISCSI_TCP is not set
 # CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_DEBUG is not set
 
@@ -746,6 +780,7 @@ CONFIG_PPP_ASYNC=m
 # CONFIG_PPP_SYNC_TTY is not set
 # CONFIG_PPP_DEFLATE is not set
 CONFIG_PPP_BSDCOMP=m
+# CONFIG_PPP_MPPE is not set
 # CONFIG_PPPOE is not set
 # CONFIG_SLIP is not set
 # CONFIG_SHAPER is not set
@@ -771,6 +806,7 @@ CONFIG_INPUT=y
 # CONFIG_INPUT_TSDEV is not set
 CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_EVBUG is not set
+# CONFIG_INPUT_POWER is not set
 
 #
 # Input Device Drivers
@@ -848,11 +884,15 @@ CONFIG_UNIX98_PTYS=y
 # PCMCIA character devices
 #
 # CONFIG_SYNCLINK_CS is not set
+# CONFIG_CARDMAN_4000 is not set
+# CONFIG_CARDMAN_4040 is not set
 # CONFIG_RAW_DRIVER is not set
 
 #
 # TPM devices
 #
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
 
 #
 # I2C support
@@ -891,14 +931,13 @@ CONFIG_FB=y
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
-CONFIG_FB_SOFT_CURSOR=y
 # CONFIG_FB_MACMODES is not set
 # CONFIG_FB_MODE_HELPERS is not set
 # CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_S1D13XXX is not set
 CONFIG_FB_PXA=y
-# CONFIG_FB_W100 is not set
 # CONFIG_FB_PXA_PARAMETERS is not set
-# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_W100 is not set
 # CONFIG_FB_VIRTUAL is not set
 
 #
@@ -907,6 +946,7 @@ CONFIG_FB_PXA=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
 CONFIG_FONTS=y
 CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
@@ -965,15 +1005,15 @@ CONFIG_USB_SL811_CS=m
 #
 # USB Device Class drivers
 #
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
 
 #
-# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
-CONFIG_USB_ACM=m
-CONFIG_USB_PRINTER=m
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
+# may also be needed; see USB_STORAGE Help for more information
 #
 CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_DEBUG is not set
@@ -985,7 +1025,6 @@ CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_SDDR09 is not set
 # CONFIG_USB_STORAGE_SDDR55 is not set
 # CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_STORAGE_ONETOUCH is not set
 
 #
 # USB Input Devices
@@ -1058,6 +1097,7 @@ CONFIG_USB_MON=y
 CONFIG_USB_SERIAL=m
 CONFIG_USB_SERIAL_GENERIC=y
 # CONFIG_USB_SERIAL_AIRPRIME is not set
+# CONFIG_USB_SERIAL_ANYDATA is not set
 CONFIG_USB_SERIAL_BELKIN=m
 # CONFIG_USB_SERIAL_WHITEHEAT is not set
 CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
@@ -1218,6 +1258,7 @@ CONFIG_RAMFS=y
 CONFIG_JFFS2_FS=y
 CONFIG_JFFS2_FS_DEBUG=0
 CONFIG_JFFS2_FS_WRITEBUFFER=y
+CONFIG_JFFS2_SUMMARY=y
 CONFIG_JFFS2_COMPRESSION_OPTIONS=y
 CONFIG_JFFS2_ZLIB=y
 CONFIG_JFFS2_RTIME=y
@@ -1344,7 +1385,9 @@ CONFIG_DETECT_SOFTLOCKUP=y
 CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_VM is not set
 CONFIG_FRAME_POINTER=y
+# CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_DEBUG_USER is not set
 # CONFIG_DEBUG_WAITQ is not set
 CONFIG_DEBUG_ERRORS=y
index 8d8748407cbe0073026ecb54b92cccfc9485a793..d7d69fd7039f342fd458bf6577dbc2cd55372ad0 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <asm/assembler.h>
 #include <asm/domain.h>
-#include <asm/mach-types.h>
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
 #include <asm/asm-offsets.h>
@@ -83,7 +82,7 @@ ENTRY(stext)
                                                @ and irqs disabled
        bl      __lookup_processor_type         @ r5=procinfo r9=cpuid
        movs    r10, r5                         @ invalid processor (r5=0)?
-       beq     __error_p                               @ yes, error 'p'
+       beq     __error_p                       @ yes, error 'p'
        bl      __lookup_machine_type           @ r5=machinfo
        movs    r8, r5                          @ invalid machine (r5=0)?
        beq     __error_a                       @ yes, error 'a'
@@ -343,16 +342,12 @@ __create_page_tables:
        bne     1b
 #if defined(CONFIG_ARCH_NETWINDER) || defined(CONFIG_ARCH_CATS)
        /*
-        * If we're using the NetWinder, we need to map in
-        * the 16550-type serial port for the debug messages
+        * If we're using the NetWinder or CATS, we also need to map
+        * in the 16550-type serial port for the debug messages
         */
-       teq     r1, #MACH_TYPE_NETWINDER
-       teqne   r1, #MACH_TYPE_CATS
-       bne     1f
        add     r0, r4, #0xff000000 >> 18
        orr     r3, r7, #0x7c000000
        str     r3, [r0]
-1:
 #endif
 #ifdef CONFIG_ARCH_RPC
        /*
index cd506646801a4d576dad1de3f4f08b613534843c..526acbc32067e98115e857ddb66e1aa8ecd5e3ac 100644 (file)
@@ -44,6 +44,7 @@ config PXA_SHARPSL_25x
 config PXA_SHARPSL_27x
        bool "Sharp PXA270 models (SL-Cxx00)"
        select PXA27x
+       select IWMMXT
 
 endchoice
 
@@ -60,7 +61,6 @@ config MACH_CORGI
        bool "Enable Sharp SL-C700 (Corgi) Support"
        depends PXA_SHARPSL_25x
        select PXA_SHARP_C7xx
-       select PXA_SSP
 
 config MACH_SHEPHERD
        bool "Enable Sharp SL-C750 (Shepherd) Support"
@@ -90,7 +90,7 @@ config MACH_BORZOI
 
 config MACH_TOSA
        bool "Enable Sharp SL-6000x (Tosa) Support"
-       depends PXA_SHARPSL
+       depends PXA_SHARPSL_25x
 
 config PXA25x
        bool
index e2c6fa23d3cd5815b1480660099db8e48bba8a1e..af6580f1ceb8e583404218ad65afcbb8d396f9d0 100644 (file)
@@ -30,7 +30,6 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/leds.h>
-#include <asm/mach-types.h>
 #include <asm/hardware/amba.h>
 #include <asm/hardware/amba_clcd.h>
 #include <asm/hardware/arm_timer.h>
index 47b0b767f080ef78a2ca50da6d432525eb406360..dbfe9e891f015a87f3efb5b31349d8c1baca20c8 100644 (file)
@@ -66,6 +66,7 @@ struct vm_region {
        unsigned long           vm_start;
        unsigned long           vm_end;
        struct page             *vm_pages;
+       int                     vm_active;
 };
 
 static struct vm_region consistent_head = {
@@ -104,6 +105,7 @@ vm_region_alloc(struct vm_region *head, size_t size, gfp_t gfp)
        list_add_tail(&new->vm_list, &c->vm_list);
        new->vm_start = addr;
        new->vm_end = addr + size;
+       new->vm_active = 1;
 
        spin_unlock_irqrestore(&consistent_lock, flags);
        return new;
@@ -120,7 +122,7 @@ static struct vm_region *vm_region_find(struct vm_region *head, unsigned long ad
        struct vm_region *c;
        
        list_for_each_entry(c, &head->vm_list, vm_list) {
-               if (c->vm_start == addr)
+               if (c->vm_active && c->vm_start == addr)
                        goto out;
        }
        c = NULL;
@@ -319,6 +321,7 @@ EXPORT_SYMBOL(dma_mmap_writecombine);
 
 /*
  * free a page as defined by the above mapping.
+ * Must not be called with IRQs disabled.
  */
 void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle)
 {
@@ -326,14 +329,18 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr
        unsigned long flags, addr;
        pte_t *ptep;
 
+       WARN_ON(irqs_disabled());
+
        size = PAGE_ALIGN(size);
 
        spin_lock_irqsave(&consistent_lock, flags);
-
        c = vm_region_find(&consistent_head, (unsigned long)cpu_addr);
        if (!c)
                goto no_area;
 
+       c->vm_active = 0;
+       spin_unlock_irqrestore(&consistent_lock, flags);
+
        if ((c->vm_end - c->vm_start) != size) {
                printk(KERN_ERR "%s: freeing wrong coherent size (%ld != %d)\n",
                       __func__, c->vm_end - c->vm_start, size);
@@ -372,8 +379,8 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr
 
        flush_tlb_kernel_range(c->vm_start, c->vm_end);
 
+       spin_lock_irqsave(&consistent_lock, flags);
        list_del(&c->vm_list);
-
        spin_unlock_irqrestore(&consistent_lock, flags);
 
        kfree(c);
index 048c9c19aa4fa508bb7e9f12831845a0202c205a..465487470d0e2494025f32edd9a41eee92a4ad84 100644 (file)
@@ -12,7 +12,7 @@
 #
 #   http://www.arm.linux.org.uk/developer/machines/?action=new
 #
-# Last update: Fri Nov 11 21:55:04 2005
+# Last update: Fri Nov 25 14:43:04 2005
 #
 # machine_is_xxx       CONFIG_xxxx             MACH_TYPE_xxx           number
 #
@@ -857,12 +857,12 @@ osiris                    MACH_OSIRIS             OSIRIS                  842
 maestro                        MACH_MAESTRO            MAESTRO                 843
 tunge2                 MACH_TUNGE2             TUNGE2                  844
 ixbbm                  MACH_IXBBM              IXBBM                   845
-mx27                   MACH_MX27               MX27                    846
+mx27ads                        MACH_MX27               MX27                    846
 ax8004                 MACH_AX8004             AX8004                  847
 at91sam9261ek          MACH_AT91SAM9261EK      AT91SAM9261EK           848
 loft                   MACH_LOFT               LOFT                    849
 magpie                 MACH_MAGPIE             MAGPIE                  850
-mx21                   MACH_MX21               MX21                    851
+mx21ads                        MACH_MX21               MX21                    851
 mb87m3400              MACH_MB87M3400          MB87M3400               852
 mguard_delta           MACH_MGUARD_DELTA       MGUARD_DELTA            853
 davinci_dvdp           MACH_DAVINCI_DVDP       DAVINCI_DVDP            854
@@ -897,10 +897,16 @@ omi_board         MACH_OMI_BOARD          OMI_BOARD               882
 mx21civ                        MACH_MX21CIV            MX21CIV                 883
 mahi_cdac              MACH_MAHI_CDAC          MAHI_CDAC               884
 xscale_palmtx          MACH_XSCALE_PALMTX      XSCALE_PALMTX           885
-arch_s3c2413           MACH_ARCH_S3C2413       ARCH_S3C2413            886
 s3c2413                        MACH_S3C2413            S3C2413                 887
 samsys_ep0             MACH_SAMSYS_EP0         SAMSYS_EP0              888
 wg302v1                        MACH_WG302V1            WG302V1                 889
 wg302v2                        MACH_WG302V2            WG302V2                 890
 eb42x                  MACH_EB42X              EB42X                   891
 iq331es                        MACH_IQ331ES            IQ331ES                 892
+cosydsp                        MACH_COSYDSP            COSYDSP                 893
+uplat7d                        MACH_UPLAT7D            UPLAT7D                 894
+ptdavinci              MACH_PTDAVINCI          PTDAVINCI               895
+mbus                   MACH_MBUS               MBUS                    896
+nadia2vb               MACH_NADIA2VB           NADIA2VB                897
+r1000                  MACH_R1000              R1000                   898
+hw90250                        MACH_HW90250            HW90250                 899
index 5cba9c1f2b3dcf2c01579528f878f44ce88fbc90..7971d680ae298bbe6ef5cacf09de735527633109 100644 (file)
@@ -20,7 +20,7 @@ struct sem_waiter {
        struct task_struct      *task;
 };
 
-#if SEM_DEBUG
+#if SEMAPHORE_DEBUG
 void semtrace(struct semaphore *sem, const char *str)
 {
        if (sem->debug)
index af981bda015cb719db418a71410236c45871f42d..24622d89b1ca4d01c6257943eea7e9a877c22708 100644 (file)
@@ -60,7 +60,7 @@ void __init pcibios_fixup_irqs(void)
        }
 }
 
-void __init pcibios_penalize_isa_irq(int irq, int active)
+void __init pcibios_penalize_isa_irq(int irq)
 {
 }
 
index 79433159b5f05a7bbb3022c5a89b6555247f3090..765088ea8a505844649258d9f2dd7cb60904e047 100644 (file)
@@ -108,7 +108,7 @@ void __init paging_init(void)
 
        memset((void *) empty_zero_page, 0, PAGE_SIZE);
 
-#if CONFIG_HIGHMEM
+#ifdef CONFIG_HIGHMEM
        if (num_physpages - num_mappedpages) {
                pgd_t *pge;
                pud_t *pue;
index 2c67dfe5a6b366d6e16e4569d86028593c17ff24..f76dd03ddd99a3505ba250b2b5d55c15b24c0372 100644 (file)
@@ -85,7 +85,7 @@ static inline void pgd_list_add(pgd_t *pgd)
        struct page *page = virt_to_page(pgd);
        page->index = (unsigned long) pgd_list;
        if (pgd_list)
-               pgd_list->private = (unsigned long) &page->index;
+               set_page_private(pgd_list, (unsigned long) &page->index);
        pgd_list = page;
        set_page_private(page, (unsigned long)&pgd_list);
 }
@@ -94,10 +94,10 @@ static inline void pgd_list_del(pgd_t *pgd)
 {
        struct page *next, **pprev, *page = virt_to_page(pgd);
        next = (struct page *) page->index;
-       pprev = (struct page **)page_private(page);
+       pprev = (struct page **) page_private(page);
        *pprev = next;
        if (next)
-               next->private = (unsigned long) pprev;
+               set_page_private(next, (unsigned long) pprev);
 }
 
 void pgd_ctor(void *pgd, kmem_cache_t *cache, unsigned long unused)
index 76b1135d401a6eb3b4851fe344fe6f052f70300f..447fa9e33ffbeaaca7bbee58621900cbf0ba2b1e 100644 (file)
@@ -638,6 +638,13 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
                        return 0;
 
                pmtmr_ioport = fadt->xpm_tmr_blk.address;
+               /*
+                * "X" fields are optional extensions to the original V1.0
+                * fields, so we must selectively expand V1.0 fields if the
+                * corresponding X field is zero.
+                */
+               if (!pmtmr_ioport)
+                       pmtmr_ioport = fadt->V1_pm_tmr_blk;
        } else {
                /* FADT rev. 1 */
                pmtmr_ioport = fadt->V1_pm_tmr_blk;
index cc5d7ac5b2e7dfa5a157bb0dffe57971bc037ed4..22c8675c79f4e5391dc1d72a3f1df1e0b7df974e 100644 (file)
@@ -2009,7 +2009,7 @@ static void ack_edge_ioapic_vector(unsigned int vector)
 {
        int irq = vector_to_irq(vector);
 
-       move_irq(vector);
+       move_native_irq(vector);
        ack_edge_ioapic_irq(irq);
 }
 
@@ -2024,7 +2024,7 @@ static void end_level_ioapic_vector (unsigned int vector)
 {
        int irq = vector_to_irq(vector);
 
-       move_irq(vector);
+       move_native_irq(vector);
        end_level_ioapic_irq(irq);
 }
 
index 350ea6680f63782dcfb237480f83c42b9229005a..2afe0f8d555adf4b67130421e1750449f7f1c92a 100644 (file)
@@ -111,6 +111,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
                },
        },
+       {       /* Handle problems with rebooting on HP nc6120 */
+               .callback = set_bios_reboot,
+               .ident = "HP Compaq nc6120",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nc6120"),
+               },
+       },
        { }
 };
 
index 01572814abe42bfefff13b134c58bfe3ebd38e07..5db9d3bcbbcbe262b85352e3c8fb3be7d1ff8597 100644 (file)
@@ -42,6 +42,7 @@ EXPORT_SYMBOL(clear_page);
 
 #ifdef CONFIG_VIRTUAL_MEM_MAP
 #include <linux/bootmem.h>
+EXPORT_SYMBOL(min_low_pfn);    /* defined by bootmem.c, but not exported by generic code */
 EXPORT_SYMBOL(max_low_pfn);    /* defined by bootmem.c, but not exported by generic code */
 #endif
 
index 801eeaeaf3de6c760905361ec61b9ad7eb8ebaf5..2895d6e6062f72df56f7f064fe8057077496c9d1 100644 (file)
@@ -740,7 +740,7 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
        switch(val) {
        case DIE_BREAK:
                /* err is break number from ia64_bad_break() */
-               if (args->err == 0x80200 || args->err == 0x80300)
+               if (args->err == 0x80200 || args->err == 0x80300 || args->err == 0)
                        if (pre_kprobes_handler(args))
                                ret = NOTIFY_STOP;
                break;
index fba5fdd1f9689351dda3adf028e864ff8c05c0bf..d3e0ecb56d627c0a0514f9bfdefefd1467df0a59 100644 (file)
@@ -132,24 +132,6 @@ __kprobes ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
        siginfo_t siginfo;
        int sig, code;
 
-       /* break.b always sets cr.iim to 0, which causes problems for
-        * debuggers.  Get the real break number from the original instruction,
-        * but only for kernel code.  User space break.b is left alone, to
-        * preserve the existing behaviour.  All break codings have the same
-        * format, so there is no need to check the slot type.
-        */
-       if (break_num == 0 && !user_mode(regs)) {
-               struct ia64_psr *ipsr = ia64_psr(regs);
-               unsigned long *bundle = (unsigned long *)regs->cr_iip;
-               unsigned long slot;
-               switch (ipsr->ri) {
-                     case 0:  slot = (bundle[0] >>  5); break;
-                     case 1:  slot = (bundle[0] >> 46) | (bundle[1] << 18); break;
-                     default: slot = (bundle[1] >> 23); break;
-               }
-               break_num = ((slot >> 36 & 1) << 20) | (slot >> 6 & 0xfffff);
-       }
-
        /* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */
        siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
        siginfo.si_imm = break_num;
index 6716ffea769a17b9d4423acfd79ccbea81c060ca..f80321a58764c71b882c50e5f509259314bdacdf 100644 (file)
@@ -36,12 +36,13 @@ static inline void *_port2addr(unsigned long port)
        return (void *)(port + NONCACHE_OFFSET);
 }
 
-#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
+#if defined(CONFIG_IDE)
 static inline void *__port2addr_ata(unsigned long port)
 {
        static int      dummy_reg;
 
        switch (port) {
+         /* IDE0 CF */
        case 0x1f0:     return (void *)0xb4002000;
        case 0x1f1:     return (void *)0xb4012800;
        case 0x1f2:     return (void *)0xb4012002;
@@ -51,6 +52,17 @@ static inline void *__port2addr_ata(unsigned long port)
        case 0x1f6:     return (void *)0xb4012006;
        case 0x1f7:     return (void *)0xb4012806;
        case 0x3f6:     return (void *)0xb401200e;
+         /* IDE1 IDE */
+       case 0x170:     return (void *)0xb4810000;  /* Data 16bit */
+       case 0x171:     return (void *)0xb4810002;  /* Features / Error */
+       case 0x172:     return (void *)0xb4810004;  /* Sector count */
+       case 0x173:     return (void *)0xb4810006;  /* Sector number */
+       case 0x174:     return (void *)0xb4810008;  /* Cylinder low */
+       case 0x175:     return (void *)0xb481000a;  /* Cylinder high */
+       case 0x176:     return (void *)0xb481000c;  /* Device head */
+       case 0x177:     return (void *)0xb481000e;  /* Command     */
+       case 0x376:     return (void *)0xb480800c;  /* Device control / Alt status */
+
        default:        return (void *)&dummy_reg;
        }
 }
@@ -108,8 +120,9 @@ unsigned char _inb(unsigned long port)
 {
        if (port >= LAN_IOSTART && port < LAN_IOEND)
                return _ne_inb(PORT2ADDR_NE(port));
-#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
-       else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
+#if defined(CONFIG_IDE)
+       else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) ||
+                 ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){
                return *(volatile unsigned char *)__port2addr_ata(port);
        }
 #endif
@@ -127,8 +140,9 @@ unsigned short _inw(unsigned long port)
 {
        if (port >= LAN_IOSTART && port < LAN_IOEND)
                return _ne_inw(PORT2ADDR_NE(port));
-#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
-       else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
+#if defined(CONFIG_IDE)
+       else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) ||
+                 ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){
                return *(volatile unsigned short *)__port2addr_ata(port);
        }
 #endif
@@ -185,8 +199,9 @@ void _outb(unsigned char b, unsigned long port)
        if (port >= LAN_IOSTART && port < LAN_IOEND)
                _ne_outb(b, PORT2ADDR_NE(port));
        else
-#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
-       if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
+#if defined(CONFIG_IDE)
+       if ( ((port >= 0x170 && port <=0x177) || port == 0x376) ||
+                 ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){
                *(volatile unsigned char *)__port2addr_ata(port) = b;
        } else
 #endif
@@ -203,8 +218,9 @@ void _outw(unsigned short w, unsigned long port)
        if (port >= LAN_IOSTART && port < LAN_IOEND)
                _ne_outw(w, PORT2ADDR_NE(port));
        else
-#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
-       if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
+#if defined(CONFIG_IDE)
+       if ( ((port >= 0x170 && port <=0x177) || port == 0x376) ||
+                 ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){
                *(volatile unsigned short *)__port2addr_ata(port) = w;
        } else
 #endif
@@ -253,8 +269,9 @@ void _insb(unsigned int port, void * addr, unsigned long count)
 {
        if (port >= LAN_IOSTART && port < LAN_IOEND)
                _ne_insb(PORT2ADDR_NE(port), addr, count);
-#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
-       else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
+#if defined(CONFIG_IDE)
+       else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) ||
+                 ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){
                unsigned char *buf = addr;
                unsigned char *portp = __port2addr_ata(port);
                while (count--)
@@ -289,8 +306,9 @@ void _insw(unsigned int port, void * addr, unsigned long count)
                pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short),
                                count, 1);
 #endif
-#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
-       } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
+#if defined(CONFIG_IDE)
+       } else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) ||
+                 ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){
                portp = __port2addr_ata(port);
                while (count--)
                        *buf++ = *(volatile unsigned short *)portp;
@@ -321,8 +339,9 @@ void _outsb(unsigned int port, const void * addr, unsigned long count)
                portp = PORT2ADDR_NE(port);
                while (count--)
                        _ne_outb(*buf++, portp);
-#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
-       } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
+#if defined(CONFIG_IDE)
+       } else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) ||
+                 ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){
                portp = __port2addr_ata(port);
                while (count--)
                        *(volatile unsigned char *)portp = *buf++;
@@ -348,8 +367,9 @@ void _outsw(unsigned int port, const void * addr, unsigned long count)
                portp = PORT2ADDR_NE(port);
                while (count--)
                        *(volatile unsigned short *)portp = *buf++;
-#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
-       } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
+#if defined(CONFIG_IDE)
+       } else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) ||
+                 ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){
                portp = __port2addr_ata(port);
                while (count--)
                        *(volatile unsigned short *)portp = *buf++;
index 9c79341a7b455711c165da735893f61cad8cef37..f6ecdf7f555ceb4ba2e04805398db3cb0e5e67a5 100644 (file)
@@ -151,7 +151,7 @@ void __init init_IRQ(void)
        disable_mappi3_irq(M32R_IRQ_INT1);
 #endif /* CONFIG_USB */
 
-       /* ICUCR40: CFC IREQ */
+       /* CFC IREQ */
        irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED;
        irq_desc[PLD_IRQ_CFIREQ].handler = &mappi3_irq_type;
        irq_desc[PLD_IRQ_CFIREQ].action = 0;
@@ -160,7 +160,7 @@ void __init init_IRQ(void)
        disable_mappi3_irq(PLD_IRQ_CFIREQ);
 
 #if defined(CONFIG_M32R_CFC)
-       /* ICUCR41: CFC Insert */
+       /* ICUCR41: CFC Insert & eject */
        irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED;
        irq_desc[PLD_IRQ_CFC_INSERT].handler = &mappi3_irq_type;
        irq_desc[PLD_IRQ_CFC_INSERT].action = 0;
@@ -168,14 +168,16 @@ void __init init_IRQ(void)
        icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00;
        disable_mappi3_irq(PLD_IRQ_CFC_INSERT);
 
-       /* ICUCR42: CFC Eject */
-       irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_CFC_EJECT].handler = &mappi3_irq_type;
-       irq_desc[PLD_IRQ_CFC_EJECT].action = 0;
-       irq_desc[PLD_IRQ_CFC_EJECT].depth = 1;  /* disable nested irq */
-       icu_data[PLD_IRQ_CFC_EJECT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
-       disable_mappi3_irq(PLD_IRQ_CFC_EJECT);
 #endif /* CONFIG_M32R_CFC */
+
+       /* IDE IREQ */
+       irq_desc[PLD_IRQ_IDEIREQ].status = IRQ_DISABLED;
+       irq_desc[PLD_IRQ_IDEIREQ].handler = &mappi3_irq_type;
+       irq_desc[PLD_IRQ_IDEIREQ].action = 0;
+       irq_desc[PLD_IRQ_IDEIREQ].depth = 1;    /* disable nested irq */
+       icu_data[PLD_IRQ_IDEIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
+       disable_mappi3_irq(PLD_IRQ_IDEIREQ);
+
 }
 
 #if defined(CONFIG_SMC91X)
index e0500e12c5fbbb934c7debc9dc84dd1d7d1300dc..fe55b28d3725b48ed48e5fcdab52902592aa2d4e 100644 (file)
@@ -41,7 +41,8 @@ asmlinkage int sys_tas(int *addr)
                return -EFAULT;
        local_irq_save(flags);
        oldval = *addr;
-       *addr = 1;
+       if (!oldval)
+               *addr = 1;
        local_irq_restore(flags);
        return oldval;
 }
@@ -59,7 +60,8 @@ asmlinkage int sys_tas(int *addr)
 
        _raw_spin_lock(&tas_lock);
        oldval = *addr;
-       *addr = 1;
+       if (!oldval)
+               *addr = 1;
        _raw_spin_unlock(&tas_lock);
 
        return oldval;
index af4d1bc9a2eb5dc78f3fa1b6503902d32716ce7f..94db25708456857995cbe42c1a41a1936442617f 100644 (file)
@@ -163,15 +163,13 @@ EXPORT_SYMBOL(giveup_altivec);
 EXPORT_SYMBOL(giveup_spe);
 #endif /* CONFIG_SPE */
 
-#ifdef CONFIG_PPC64
-EXPORT_SYMBOL(__flush_icache_range);
-#else
+#ifndef CONFIG_PPC64
 EXPORT_SYMBOL(flush_instruction_cache);
-EXPORT_SYMBOL(flush_icache_range);
 EXPORT_SYMBOL(flush_tlb_kernel_range);
 EXPORT_SYMBOL(flush_tlb_page);
 EXPORT_SYMBOL(_tlbie);
 #endif
+EXPORT_SYMBOL(__flush_icache_range);
 EXPORT_SYMBOL(flush_dcache_range);
 
 #ifdef CONFIG_SMP
index a5a7542a8ff348c27442ba3638a30740cc035e29..105d5609ff572dc63c2919808fffd2c89f019dbc 100644 (file)
@@ -201,6 +201,28 @@ int dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs)
 }
 #endif /* CONFIG_SPE */
 
+/*
+ * If we are doing lazy switching of CPU state (FP, altivec or SPE),
+ * and the current task has some state, discard it.
+ */
+static inline void discard_lazy_cpu_state(void)
+{
+#ifndef CONFIG_SMP
+       preempt_disable();
+       if (last_task_used_math == current)
+               last_task_used_math = NULL;
+#ifdef CONFIG_ALTIVEC
+       if (last_task_used_altivec == current)
+               last_task_used_altivec = NULL;
+#endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_SPE
+       if (last_task_used_spe == current)
+               last_task_used_spe = NULL;
+#endif
+       preempt_enable();
+#endif /* CONFIG_SMP */
+}
+
 int set_dabr(unsigned long dabr)
 {
        if (ppc_md.set_dabr)
@@ -434,19 +456,7 @@ void show_regs(struct pt_regs * regs)
 void exit_thread(void)
 {
        kprobe_flush_task(current);
-
-#ifndef CONFIG_SMP
-       if (last_task_used_math == current)
-               last_task_used_math = NULL;
-#ifdef CONFIG_ALTIVEC
-       if (last_task_used_altivec == current)
-               last_task_used_altivec = NULL;
-#endif /* CONFIG_ALTIVEC */
-#ifdef CONFIG_SPE
-       if (last_task_used_spe == current)
-               last_task_used_spe = NULL;
-#endif
-#endif /* CONFIG_SMP */
+       discard_lazy_cpu_state();
 }
 
 void flush_thread(void)
@@ -458,18 +468,7 @@ void flush_thread(void)
                t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT);
 #endif
 
-#ifndef CONFIG_SMP
-       if (last_task_used_math == current)
-               last_task_used_math = NULL;
-#ifdef CONFIG_ALTIVEC
-       if (last_task_used_altivec == current)
-               last_task_used_altivec = NULL;
-#endif /* CONFIG_ALTIVEC */
-#ifdef CONFIG_SPE
-       if (last_task_used_spe == current)
-               last_task_used_spe = NULL;
-#endif
-#endif /* CONFIG_SMP */
+       discard_lazy_cpu_state();
 
 #ifdef CONFIG_PPC64    /* for now */
        if (current->thread.dabr) {
@@ -635,18 +634,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
        }
 #endif
 
-#ifndef CONFIG_SMP
-       if (last_task_used_math == current)
-               last_task_used_math = NULL;
-#ifdef CONFIG_ALTIVEC
-       if (last_task_used_altivec == current)
-               last_task_used_altivec = NULL;
-#endif
-#ifdef CONFIG_SPE
-       if (last_task_used_spe == current)
-               last_task_used_spe = NULL;
-#endif
-#endif /* CONFIG_SMP */
+       discard_lazy_cpu_state();
        memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
        current->thread.fpscr.val = 0;
 #ifdef CONFIG_ALTIVEC
index 4ce0105c308ea04b7be7fd88524b4c8b25fdef73..bcdc209dca8525b5337678a1fdb80ac09f58871f 100644 (file)
@@ -265,7 +265,7 @@ static int __init call_prom_ret(const char *service, int nargs, int nret,
        va_end(list);
 
        for (i = 0; i < nret; i++)
-               rets[nargs+i] = 0;
+               args.args[nargs+i] = 0;
 
        if (enter_prom(&args, RELOC(prom_entry)) < 0)
                return PROM_ERROR;
index b44b36e0c29325281daa939d7eeacf8df8d3eb84..f0c47dab09030266d799bbf2544e94a6a2c0e872 100644 (file)
@@ -145,8 +145,7 @@ static void dump_vdso_pages(struct vm_area_struct * vma)
                        struct page *pg = virt_to_page(vdso32_kbase +
                                                       i*PAGE_SIZE);
                        struct page *upg = (vma && vma->vm_mm) ?
-                               follow_page(vma->vm_mm, vma->vm_start +
-                                           i*PAGE_SIZE, 0)
+                               follow_page(vma, vma->vm_start + i*PAGE_SIZE, 0)
                                : NULL;
                        dump_one_vdso_page(pg, upg);
                }
@@ -157,8 +156,7 @@ static void dump_vdso_pages(struct vm_area_struct * vma)
                        struct page *pg = virt_to_page(vdso64_kbase +
                                                       i*PAGE_SIZE);
                        struct page *upg = (vma && vma->vm_mm) ?
-                               follow_page(vma->vm_mm, vma->vm_start +
-                                           i*PAGE_SIZE, 0)
+                               follow_page(vma, vma->vm_start + i*PAGE_SIZE, 0)
                                : NULL;
                        dump_one_vdso_page(pg, upg);
                }
index 82df88b01bbe5a7e4c9c6679328674e5f418628e..f3e9c534aa823156e6208e61fc0da14c3d858697 100644 (file)
@@ -262,11 +262,11 @@ $(images)/zImage.initrd-STRIPELF: $(obj)/zvmlinux.initrd
                skip=64 bs=1k
 
 $(images)/zImage-TREE: $(obj)/zvmlinux $(MKTREE)
-       $(MKTREE) $(obj)/zvmlinux $(images)/zImage.$(end-y) $(ENTRYPOINT)
+       $(MKTREE) $(obj)/zvmlinux $(images)/zImage.$(end-y) $(entrypoint-y)
 
 $(images)/zImage.initrd-TREE: $(obj)/zvmlinux.initrd $(MKTREE)
        $(MKTREE) $(obj)/zvmlinux.initrd $(images)/zImage.initrd.$(end-y) \
-               $(ENTRYPOINT)
+               $(entrypoint-y)
 
 $(images)/zImage-PPLUS: $(obj)/zvmlinux $(MKPREP) $(MKBUGBOOT)
        $(MKPREP) -pbp $(obj)/zvmlinux $(images)/zImage.$(end-y)
index 66073f775193d2084ef7b629cf130f9e744c3bd3..bb6a5c6a64bee18e1a94ec0968aada425bbd7aa1 100644 (file)
@@ -184,7 +184,7 @@ EXPORT_SYMBOL(kernel_thread);
 
 EXPORT_SYMBOL(flush_instruction_cache);
 EXPORT_SYMBOL(giveup_fpu);
-EXPORT_SYMBOL(flush_icache_range);
+EXPORT_SYMBOL(__flush_icache_range);
 EXPORT_SYMBOL(flush_dcache_range);
 EXPORT_SYMBOL(flush_icache_user_range);
 EXPORT_SYMBOL(flush_dcache_page);
index cb1c7b92f8c60111e7c3b86607082372e4bd03c3..25cbdc8d2941a9ccd7c2e315889cabf4d2a8c0bd 100644 (file)
@@ -417,6 +417,7 @@ void show_regs(struct pt_regs * regs)
 
 void exit_thread(void)
 {
+       preempt_disable();
        if (last_task_used_math == current)
                last_task_used_math = NULL;
        if (last_task_used_altivec == current)
@@ -425,10 +426,12 @@ void exit_thread(void)
        if (last_task_used_spe == current)
                last_task_used_spe = NULL;
 #endif
+       preempt_enable();
 }
 
 void flush_thread(void)
 {
+       preempt_disable();
        if (last_task_used_math == current)
                last_task_used_math = NULL;
        if (last_task_used_altivec == current)
@@ -437,6 +440,7 @@ void flush_thread(void)
        if (last_task_used_spe == current)
                last_task_used_spe = NULL;
 #endif
+       preempt_enable();
 }
 
 void
@@ -535,6 +539,7 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp)
        regs->nip = nip;
        regs->gpr[1] = sp;
        regs->msr = MSR_USER;
+       preempt_disable();
        if (last_task_used_math == current)
                last_task_used_math = NULL;
        if (last_task_used_altivec == current)
@@ -543,6 +548,7 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp)
        if (last_task_used_spe == current)
                last_task_used_spe = NULL;
 #endif
+       preempt_enable();
        memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
        current->thread.fpscr.val = 0;
 #ifdef CONFIG_ALTIVEC
index 1d1c3956c1ae2d4eec586db59e13feba0ed01ed2..1941a8c7ca9a3dbd851b619c6e55ea7b39bc5dcf 100644 (file)
@@ -248,7 +248,8 @@ pq2ads_setup_pci(struct pci_controller *hose)
        pci_div = ( (sccr & SCCR_PCI_MODCK) ? 2 : 1) *
                        ( ( (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT) + 1);
        freq = (uint)((2*binfo->bi_cpmfreq)/(pci_div));
-       time = (int)666666/freq;
+       time = (int)66666666/freq;
+
        /* due to PCI Local Bus spec, some devices needs to wait such a long
        time after RST  deassertion. More specifically, 0.508s for 66MHz & twice more for 33 */
        printk("%s: The PCI bus is %d Mhz.\nWaiting %s after deasserting RST...\n",__FILE__,freq,
index 0410bae681f869c6335ab3f8bffd45c14f204920..2cb0728cee052012c7856b017f7499fa5638ce82 100644 (file)
@@ -32,9 +32,7 @@ static inline void io_remap_pte_range(struct mm_struct *mm, pte_t * pte, unsigne
        if (end > PMD_SIZE)
                end = PMD_SIZE;
        do {
-               pte_t oldpage = *pte;
-               pte_clear(mm, address, pte);
-               set_pte(pte, mk_pte_io(offset, prot, space));
+               set_pte_at(mm, address, pte, mk_pte_io(offset, prot, space));
                address += PAGE_SIZE;
                offset += PAGE_SIZE;
                pte++;
@@ -63,7 +61,7 @@ static inline int io_remap_pmd_range(struct mm_struct *mm, pmd_t * pmd, unsigned
 }
 
 int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
-                       unsigned long pfn, unsigned long size, pgprot_t prot)
+                      unsigned long pfn, unsigned long size, pgprot_t prot)
 {
        int error = 0;
        pgd_t * dir;
@@ -74,7 +72,9 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
        unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT;
 
        /* See comment in mm/memory.c remap_pfn_range */
-       vma->vm_flags |= VM_IO | VM_RESERVED | VM_UNPAGED;
+       vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
+       vma->vm_pgoff = (offset >> PAGE_SHIFT) |
+               ((unsigned long)space << 28UL);
 
        prot = __pgprot(pg_iobits);
        offset -= from;
index 8fd4cb1f050a19e394068abce75e8ff08fbd57e7..580b63da836bcee565fb435b6f833ac6f1eb9b70 100644 (file)
 #include <asm/page.h>
 #include <asm/tlbflush.h>
 
+static inline pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space)
+{
+       pte_t pte;
+       pte_val(pte) = (((page) | pgprot_val(prot) | _PAGE_E) &
+                       ~(unsigned long)_PAGE_CACHE);
+       pte_val(pte) |= (((unsigned long)space) << 32);
+       return pte;
+}
+
 /* Remap IO memory, the same way as remap_pfn_range(), but use
  * the obio memory space.
  *
@@ -68,6 +77,7 @@ static inline void io_remap_pte_range(struct mm_struct *mm, pte_t * pte,
                        BUG_ON(!pte_none(*pte));
                        set_pte_at(mm, address, pte, entry);
                        address += PAGE_SIZE;
+                       pte_val(entry) += PAGE_SIZE;
                        pte++;
                } while (address < curend);
        } while (address < end);
@@ -126,9 +136,13 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
        struct mm_struct *mm = vma->vm_mm;
        int space = GET_IOSPACE(pfn);
        unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT;
+       unsigned long phys_base;
+
+       phys_base = offset | (((unsigned long) space) << 32UL);
 
        /* See comment in mm/memory.c remap_pfn_range */
-       vma->vm_flags |= VM_IO | VM_RESERVED | VM_UNPAGED;
+       vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
+       vma->vm_pgoff = phys_base >> PAGE_SHIFT;
 
        prot = __pgprot(pg_iobits);
        offset -= from;
index fe1e8126fbae836d72ba045744ae5894cbd6d3a3..fce21c257523b729c68d29d201b41a7a762b5e31 100644 (file)
@@ -197,7 +197,6 @@ config ACPI_ASUS
 config ACPI_IBM
        tristate "IBM ThinkPad Laptop Extras"
        depends on X86
-       default y
        ---help---
          This is a Linux ACPI driver for the IBM ThinkPad laptops. It adds
          support for Fn-Fx key combinations, Bluetooth control, video
index a18243488c666cad223183fbe54726f9ba26fbed..5984b4f6715a95064e72d53938a4f8681bbb5714 100644 (file)
@@ -16,7 +16,7 @@ EXTRA_CFLAGS  += $(ACPI_CFLAGS)
 # ACPI Boot-Time Table Parsing
 #
 obj-y                          += tables.o
-obj-y                          += blacklist.o
+obj-$(CONFIG_X86)              += blacklist.o
 
 #
 # ACPI Core Subsystem (Interpreter)
index 4217925626423db1f39cc76880e95f700fb5d279..0c561c571f29a40f09dce5e96e9af29f79376fe4 100644 (file)
@@ -543,6 +543,8 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
        return_VALUE(0);
 }
 
+static void *processor_device_array[NR_CPUS];
+
 static int acpi_processor_start(struct acpi_device *device)
 {
        int result = 0;
@@ -561,6 +563,19 @@ static int acpi_processor_start(struct acpi_device *device)
 
        BUG_ON((pr->id >= NR_CPUS) || (pr->id < 0));
 
+       /*
+        * Buggy BIOS check
+        * ACPI id of processors can be reported wrongly by the BIOS.
+        * Don't trust it blindly
+        */
+       if (processor_device_array[pr->id] != NULL &&
+           processor_device_array[pr->id] != (void *)device) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "BIOS reporting wrong ACPI id"
+                       "for the processor\n"));
+               return_VALUE(-ENODEV);
+       }
+       processor_device_array[pr->id] = (void *)device;
+
        processors[pr->id] = pr;
 
        result = acpi_processor_add_fs(device);
index 70d8a6ec0920f1589525395a1550360a26cbd54f..83fd1b6c10c41e7ddb62c271661523ef3affafc9 100644 (file)
@@ -280,6 +280,16 @@ static void acpi_processor_idle(void)
 
        cx->usage++;
 
+#ifdef CONFIG_HOTPLUG_CPU
+       /*
+        * Check for P_LVL2_UP flag before entering C2 and above on
+        * an SMP system. We do it here instead of doing it at _CST/P_LVL
+        * detection phase, to work cleanly with logical CPU hotplug.
+        */
+       if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && 
+           !pr->flags.has_cst && acpi_fadt.plvl2_up)
+               cx->type = ACPI_STATE_C1;
+#endif
        /*
         * Sleep:
         * ------
@@ -534,6 +544,15 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
        pr->power.states[ACPI_STATE_C0].valid = 1;
        pr->power.states[ACPI_STATE_C1].valid = 1;
 
+#ifndef CONFIG_HOTPLUG_CPU
+       /*
+        * Check for P_LVL2_UP flag before entering C2 and above on
+        * an SMP system. 
+        */
+       if ((num_online_cpus() > 1) && acpi_fadt.plvl2_up)
+               return_VALUE(-ENODEV);
+#endif
+
        /* determine C2 and C3 address from pblk */
        pr->power.states[ACPI_STATE_C2].address = pr->pblk + 4;
        pr->power.states[ACPI_STATE_C3].address = pr->pblk + 5;
@@ -690,7 +709,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
 
        /* Validate number of power states discovered */
        if (pr->power.count < 2)
-               status = -ENODEV;
+               status = -EFAULT;
 
       end:
        acpi_os_free(buffer.pointer);
@@ -841,11 +860,11 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr)
         * this function */
 
        result = acpi_processor_get_power_info_cst(pr);
-       if ((result) || (acpi_processor_power_verify(pr) < 2)) {
+       if (result == -ENODEV)
                result = acpi_processor_get_power_info_fadt(pr);
-               if ((result) || (acpi_processor_power_verify(pr) < 2))
-                       result = acpi_processor_get_power_info_default_c1(pr);
-       }
+
+       if ((result) || (acpi_processor_power_verify(pr) < 2))
+               result = acpi_processor_get_power_info_default_c1(pr);
 
        /*
         * Set Default Policy
index 37528c3b64b02baeb0aafbae96f2775495177453..f37584015324ac54b3471351dc4964170c467204 100644 (file)
@@ -101,9 +101,7 @@ static unsigned int acpi_thermal_cpufreq_is_init = 0;
 static int cpu_has_cpufreq(unsigned int cpu)
 {
        struct cpufreq_policy policy;
-       if (!acpi_thermal_cpufreq_is_init)
-               return -ENODEV;
-       if (!cpufreq_get_policy(&policy, cpu))
+       if (!acpi_thermal_cpufreq_is_init || cpufreq_get_policy(&policy, cpu))
                return -ENODEV;
        return 0;
 }
@@ -127,13 +125,13 @@ static int acpi_thermal_cpufreq_decrease(unsigned int cpu)
        if (!cpu_has_cpufreq(cpu))
                return -ENODEV;
 
-       if (cpufreq_thermal_reduction_pctg[cpu] >= 20) {
+       if (cpufreq_thermal_reduction_pctg[cpu] > 20)
                cpufreq_thermal_reduction_pctg[cpu] -= 20;
-               cpufreq_update_policy(cpu);
-               return 0;
-       }
-
-       return -ERANGE;
+       else
+               cpufreq_thermal_reduction_pctg[cpu] = 0;
+       cpufreq_update_policy(cpu);
+       /* We reached max freq again and can leave passive mode */
+       return !cpufreq_thermal_reduction_pctg[cpu];
 }
 
 static int acpi_thermal_cpufreq_notifier(struct notifier_block *nb,
@@ -200,7 +198,7 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type)
        int result = 0;
        struct acpi_processor *pr = NULL;
        struct acpi_device *device = NULL;
-       int tx = 0;
+       int tx = 0, max_tx_px = 0;
 
        ACPI_FUNCTION_TRACE("acpi_processor_set_thermal_limit");
 
@@ -259,19 +257,27 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type)
                /* if going down: T-states first, P-states later */
 
                if (pr->flags.throttling) {
-                       if (tx == 0)
+                       if (tx == 0) {
+                               max_tx_px = 1;
                                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                                  "At minimum throttling state\n"));
-                       else {
+                       else {
                                tx--;
                                goto end;
                        }
                }
 
                result = acpi_thermal_cpufreq_decrease(pr->id);
-               if (result == -ERANGE)
+               if (result) {
+                       /*
+                        * We only could get -ERANGE, 1 or 0.
+                        * In the first two cases we reached max freq again.
+                        */
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                          "At minimum performance state\n"));
+                       max_tx_px = 1;
+               } else
+                       max_tx_px = 0;
 
                break;
        }
@@ -290,8 +296,10 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type)
                                  pr->limit.thermal.px, pr->limit.thermal.tx));
        } else
                result = 0;
-
-       return_VALUE(result);
+       if (max_tx_px)
+               return_VALUE(1);
+       else
+               return_VALUE(result);
 }
 
 int acpi_processor_get_limit_info(struct acpi_processor *pr)
index 23e2c6968a1164f9f54aa6f9a5493c619965019a..31218e1d2a18313a8ea9410c3bbab5934bb7b396 100644 (file)
@@ -1110,7 +1110,7 @@ acpi_add_single_object(struct acpi_device **child,
         *
         * TBD: Assumes LDM provides driver hot-plug capability.
         */
-       result = acpi_bus_find_driver(device);
+       acpi_bus_find_driver(device);
 
       end:
        if (!result)
index a24847c08f7f43d47cc28b33440e5d8d1bd04268..19f3ea48475e369ec9ba1b39405e5d14da9a2e6f 100644 (file)
@@ -72,7 +72,7 @@
 #define _COMPONENT             ACPI_THERMAL_COMPONENT
 ACPI_MODULE_NAME("acpi_thermal")
 
-    MODULE_AUTHOR("Paul Diefenbaugh");
+MODULE_AUTHOR("Paul Diefenbaugh");
 MODULE_DESCRIPTION(ACPI_THERMAL_DRIVER_NAME);
 MODULE_LICENSE("GPL");
 
@@ -517,9 +517,9 @@ static int acpi_thermal_hot(struct acpi_thermal *tz)
        return_VALUE(0);
 }
 
-static int acpi_thermal_passive(struct acpi_thermal *tz)
+static void acpi_thermal_passive(struct acpi_thermal *tz)
 {
-       int result = 0;
+       int result = 1;
        struct acpi_thermal_passive *passive = NULL;
        int trend = 0;
        int i = 0;
@@ -527,7 +527,7 @@ static int acpi_thermal_passive(struct acpi_thermal *tz)
        ACPI_FUNCTION_TRACE("acpi_thermal_passive");
 
        if (!tz || !tz->trips.passive.flags.valid)
-               return_VALUE(-EINVAL);
+               return;
 
        passive = &(tz->trips.passive);
 
@@ -547,7 +547,7 @@ static int acpi_thermal_passive(struct acpi_thermal *tz)
                                  trend, passive->tc1, tz->temperature,
                                  tz->last_temperature, passive->tc2,
                                  tz->temperature, passive->temperature));
-               tz->trips.passive.flags.enabled = 1;
+               passive->flags.enabled = 1;
                /* Heating up? */
                if (trend > 0)
                        for (i = 0; i < passive->devices.count; i++)
@@ -556,12 +556,32 @@ static int acpi_thermal_passive(struct acpi_thermal *tz)
                                                                 handles[i],
                                                                 ACPI_PROCESSOR_LIMIT_INCREMENT);
                /* Cooling off? */
-               else if (trend < 0)
+               else if (trend < 0) {
                        for (i = 0; i < passive->devices.count; i++)
-                               acpi_processor_set_thermal_limit(passive->
-                                                                devices.
-                                                                handles[i],
-                                                                ACPI_PROCESSOR_LIMIT_DECREMENT);
+                               /*
+                                * assume that we are on highest
+                                * freq/lowest thrott and can leave
+                                * passive mode, even in error case
+                                */
+                               if (!acpi_processor_set_thermal_limit
+                                   (passive->devices.handles[i],
+                                    ACPI_PROCESSOR_LIMIT_DECREMENT))
+                                       result = 0;
+                       /*
+                        * Leave cooling mode, even if the temp might
+                        * higher than trip point This is because some
+                        * machines might have long thermal polling
+                        * frequencies (tsp) defined. We will fall back
+                        * into passive mode in next cycle (probably quicker)
+                        */
+                       if (result) {
+                               passive->flags.enabled = 0;
+                               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                                 "Disabling passive cooling, still above threshold,"
+                                                 " but we are cooling down\n"));
+                       }
+               }
+               return;
        }
 
        /*
@@ -571,23 +591,21 @@ static int acpi_thermal_passive(struct acpi_thermal *tz)
         * and avoid thrashing around the passive trip point.  Note that we
         * assume symmetry.
         */
-       else if (tz->trips.passive.flags.enabled) {
-               for (i = 0; i < passive->devices.count; i++)
-                       result =
-                           acpi_processor_set_thermal_limit(passive->devices.
-                                                            handles[i],
-                                                            ACPI_PROCESSOR_LIMIT_DECREMENT);
-               if (result == 1) {
-                       tz->trips.passive.flags.enabled = 0;
-                       ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                                         "Disabling passive cooling (zone is cool)\n"));
-               }
+       if (!passive->flags.enabled)
+               return;
+       for (i = 0; i < passive->devices.count; i++)
+               if (!acpi_processor_set_thermal_limit
+                   (passive->devices.handles[i],
+                    ACPI_PROCESSOR_LIMIT_DECREMENT))
+                       result = 0;
+       if (result) {
+               passive->flags.enabled = 0;
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                 "Disabling passive cooling (zone is cool)\n"));
        }
-
-       return_VALUE(0);
 }
 
-static int acpi_thermal_active(struct acpi_thermal *tz)
+static void acpi_thermal_active(struct acpi_thermal *tz)
 {
        int result = 0;
        struct acpi_thermal_active *active = NULL;
@@ -598,74 +616,66 @@ static int acpi_thermal_active(struct acpi_thermal *tz)
        ACPI_FUNCTION_TRACE("acpi_thermal_active");
 
        if (!tz)
-               return_VALUE(-EINVAL);
+               return;
 
        for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
-
                active = &(tz->trips.active[i]);
                if (!active || !active->flags.valid)
                        break;
-
-               /*
-                * Above Threshold?
-                * ----------------
-                * If not already enabled, turn ON all cooling devices
-                * associated with this active threshold.
-                */
                if (tz->temperature >= active->temperature) {
+                       /*
+                        * Above Threshold?
+                        * ----------------
+                        * If not already enabled, turn ON all cooling devices
+                        * associated with this active threshold.
+                        */
                        if (active->temperature > maxtemp)
-                               tz->state.active_index = i, maxtemp =
-                                   active->temperature;
-                       if (!active->flags.enabled) {
-                               for (j = 0; j < active->devices.count; j++) {
-                                       result =
-                                           acpi_bus_set_power(active->devices.
-                                                              handles[j],
-                                                              ACPI_STATE_D0);
-                                       if (result) {
-                                               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                                                 "Unable to turn cooling device [%p] 'on'\n",
-                                                                 active->
-                                                                 devices.
-                                                                 handles[j]));
-                                               continue;
-                                       }
-                                       active->flags.enabled = 1;
-                                       ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                                                         "Cooling device [%p] now 'on'\n",
-                                                         active->devices.
-                                                         handles[j]));
-                               }
-                       }
-               }
-               /*
-                * Below Threshold?
-                * ----------------
-                * Turn OFF all cooling devices associated with this
-                * threshold.
-                */
-               else if (active->flags.enabled) {
+                               tz->state.active_index = i;
+                       maxtemp = active->temperature;
+                       if (active->flags.enabled)
+                               continue;
                        for (j = 0; j < active->devices.count; j++) {
                                result =
                                    acpi_bus_set_power(active->devices.
                                                       handles[j],
-                                                      ACPI_STATE_D3);
+                                                      ACPI_STATE_D0);
                                if (result) {
                                        ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                                         "Unable to turn cooling device [%p] 'off'\n",
+                                                         "Unable to turn cooling device [%p] 'on'\n",
                                                          active->devices.
                                                          handles[j]));
                                        continue;
                                }
-                               active->flags.enabled = 0;
+                               active->flags.enabled = 1;
                                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                                                 "Cooling device [%p] now 'off'\n",
+                                                 "Cooling device [%p] now 'on'\n",
                                                  active->devices.handles[j]));
                        }
+                       continue;
+               }
+               if (!active->flags.enabled)
+                       continue;
+               /*
+                * Below Threshold?
+                * ----------------
+                * Turn OFF all cooling devices associated with this
+                * threshold.
+                */
+               for (j = 0; j < active->devices.count; j++) {
+                       result = acpi_bus_set_power(active->devices.handles[j],
+                                                   ACPI_STATE_D3);
+                       if (result) {
+                               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
+                                                 "Unable to turn cooling device [%p] 'off'\n",
+                                                 active->devices.handles[j]));
+                               continue;
+                       }
+                       active->flags.enabled = 0;
+                       ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                         "Cooling device [%p] now 'off'\n",
+                                         active->devices.handles[j]));
                }
        }
-
-       return_VALUE(0);
 }
 
 static void acpi_thermal_check(void *context);
@@ -744,15 +754,12 @@ static void acpi_thermal_check(void *data)
         * Again, separated from the above two to allow independent policy
         * decisions.
         */
-       if (tz->trips.critical.flags.enabled)
-               tz->state.critical = 1;
-       if (tz->trips.hot.flags.enabled)
-               tz->state.hot = 1;
-       if (tz->trips.passive.flags.enabled)
-               tz->state.passive = 1;
+       tz->state.critical = tz->trips.critical.flags.enabled;
+       tz->state.hot = tz->trips.hot.flags.enabled;
+       tz->state.passive = tz->trips.passive.flags.enabled;
+       tz->state.active = 0;
        for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++)
-               if (tz->trips.active[i].flags.enabled)
-                       tz->state.active = 1;
+               tz->state.active |= tz->trips.active[i].flags.enabled;
 
        /*
         * Calculate Sleep Time
index f051b151580d7de14647213f6c4497a75a4eff57..d10668f146997d07c53630b722d15fad2054ed98 100644 (file)
@@ -812,7 +812,7 @@ acpi_video_device_write_brightness(struct file *file,
 
        ACPI_FUNCTION_TRACE("acpi_video_device_write_brightness");
 
-       if (!dev || count + 1 > sizeof str)
+       if (!dev || !dev->brightness || count + 1 > sizeof str)
                return_VALUE(-EINVAL);
 
        if (copy_from_user(str, buffer, count))
index 489de81ea6090814ade9c6746de975fe209ad073..01a9f1cb77438eeff822a5ac3a825179a72e8028 100644 (file)
@@ -5,6 +5,13 @@
 menu "ATM drivers"
        depends on NETDEVICES && ATM
 
+config ATM_DUMMY
+       tristate "Dummy ATM driver"
+       depends on ATM
+       help
+         Dummy ATM driver. Useful for proxy signalling, testing,
+         and development.  If unsure, say N.
+
 config ATM_TCP
        tristate "ATM over TCP"
        depends on INET && ATM
index 5b77188527a9ad91f8d3f70691ba9c2d4393f4a1..b5077ce8cb4007b901716c89208e6b94f5012bd5 100644 (file)
@@ -31,6 +31,7 @@ ifeq ($(CONFIG_ATM_IDT77252_USE_SUNI),y)
   obj-$(CONFIG_ATM_IDT77252)   += suni.o
 endif
 
+obj-$(CONFIG_ATM_DUMMY)                += adummy.o
 obj-$(CONFIG_ATM_TCP)          += atmtcp.o
 obj-$(CONFIG_ATM_FIRESTREAM)   += firestream.o
 obj-$(CONFIG_ATM_LANAI)                += lanai.o
diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c
new file mode 100644 (file)
index 0000000..d15c194
--- /dev/null
@@ -0,0 +1,168 @@
+/*
+ * adummy.c: a dummy ATM driver
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/version.h>
+#include <linux/kernel.h>
+#include <linux/skbuff.h>
+#include <linux/pci.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/timer.h>
+#include <linux/interrupt.h>
+#include <asm/io.h>
+#include <asm/byteorder.h>
+#include <asm/uaccess.h>
+
+#include <linux/atmdev.h>
+#include <linux/atm.h>
+#include <linux/sonet.h>
+
+/* version definition */
+
+#define DRV_VERSION "1.0"
+
+#define DEV_LABEL "adummy"
+
+#define ADUMMY_DEV(dev) ((struct adummy_dev *) (dev)->dev_data)
+
+struct adummy_dev {
+       struct atm_dev *atm_dev;
+
+       struct list_head entry;
+};
+
+/* globals */
+
+static LIST_HEAD(adummy_devs);
+
+static int __init
+adummy_start(struct atm_dev *dev)
+{
+       dev->ci_range.vpi_bits = 4;
+       dev->ci_range.vci_bits = 12;
+
+       return 0;
+}
+
+static int
+adummy_open(struct atm_vcc *vcc)
+{
+       short vpi = vcc->vpi;
+       int vci = vcc->vci;
+
+       if (vci == ATM_VCI_UNSPEC || vpi == ATM_VPI_UNSPEC)
+               return 0;
+
+       set_bit(ATM_VF_ADDR, &vcc->flags);
+       set_bit(ATM_VF_READY, &vcc->flags);
+
+       return 0;
+}
+
+static void
+adummy_close(struct atm_vcc *vcc)
+{
+       clear_bit(ATM_VF_READY, &vcc->flags);
+       clear_bit(ATM_VF_ADDR, &vcc->flags);
+}
+
+static int
+adummy_send(struct atm_vcc *vcc, struct sk_buff *skb)
+{
+       if (vcc->pop)
+               vcc->pop(vcc, skb);
+       else
+               dev_kfree_skb_any(skb);
+       atomic_inc(&vcc->stats->tx);
+
+       return 0;
+}
+
+static int
+adummy_proc_read(struct atm_dev *dev, loff_t *pos, char *page)
+{
+       int left = *pos;
+
+       if (!left--)
+               return sprintf(page, "version %s\n", DRV_VERSION);
+
+       return 0;
+}
+
+static struct atmdev_ops adummy_ops =
+{
+       .open =         adummy_open,
+       .close =        adummy_close,   
+       .send =         adummy_send,
+       .proc_read =    adummy_proc_read,
+       .owner =        THIS_MODULE
+};
+
+static int __init adummy_init(void)
+{
+       struct atm_dev *atm_dev;
+       struct adummy_dev *adummy_dev;
+       int err = 0;
+
+       printk(KERN_ERR "adummy: version %s\n", DRV_VERSION);
+
+       adummy_dev = (struct adummy_dev *) kmalloc(sizeof(struct adummy_dev),
+                                                  GFP_KERNEL);
+       if (!adummy_dev) {
+               printk(KERN_ERR DEV_LABEL ": kmalloc() failed\n");
+               err = -ENOMEM;
+               goto out;
+       }
+       memset(adummy_dev, 0, sizeof(struct adummy_dev));
+
+       atm_dev = atm_dev_register(DEV_LABEL, &adummy_ops, -1, 0);
+       if (!atm_dev) {
+               printk(KERN_ERR DEV_LABEL ": atm_dev_register() failed\n");
+               err = -ENODEV;
+               goto out_kfree;
+       }
+
+       adummy_dev->atm_dev = atm_dev;
+       atm_dev->dev_data = adummy_dev;
+
+       if (adummy_start(atm_dev)) {
+               printk(KERN_ERR DEV_LABEL ": adummy_start() failed\n");
+               err = -ENODEV;
+               goto out_unregister;
+       }
+
+       list_add(&adummy_dev->entry, &adummy_devs);
+out:
+       return err;
+
+out_unregister:
+       atm_dev_deregister(atm_dev);
+out_kfree:
+       kfree(adummy_dev);
+       goto out;
+}
+
+static void __exit adummy_cleanup(void)
+{
+       struct adummy_dev *adummy_dev, *next;
+
+       list_for_each_entry_safe(adummy_dev, next, &adummy_devs, entry) {
+               atm_dev_deregister(adummy_dev->atm_dev);
+               kfree(adummy_dev);
+       }
+}
+
+module_init(adummy_init);
+module_exit(adummy_cleanup);
+
+MODULE_AUTHOR("chas williams <chas@cmf.nrl.navy.mil>");
+MODULE_DESCRIPTION("dummy ATM driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/atm/atmdev_init.c b/drivers/atm/atmdev_init.c
deleted file mode 100644 (file)
index 0e09e5c..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/* drivers/atm/atmdev_init.c - ATM device driver initialization */
-/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
-
-#include <linux/config.h>
-#include <linux/init.h>
-
-
-#ifdef CONFIG_ATM_ZATM
-extern int zatm_detect(void);
-#endif
-#ifdef CONFIG_ATM_AMBASSADOR
-extern int amb_detect(void);
-#endif
-#ifdef CONFIG_ATM_HORIZON
-extern int hrz_detect(void);
-#endif
-#ifdef CONFIG_ATM_FORE200E
-extern int fore200e_detect(void);
-#endif
-#ifdef CONFIG_ATM_LANAI
-extern int lanai_detect(void);
-#endif
-
-
-/*
- * For historical reasons, atmdev_init returns the number of devices found.
- * Note that some detections may not go via atmdev_init (e.g. eni.c), so this
- * number is meaningless.
- */
-
-int __init atmdev_init(void)
-{
-       int devs;
-
-       devs = 0;
-#ifdef CONFIG_ATM_ZATM
-       devs += zatm_detect();
-#endif
-#ifdef CONFIG_ATM_AMBASSADOR
-       devs += amb_detect();
-#endif
-#ifdef CONFIG_ATM_HORIZON
-       devs += hrz_detect();
-#endif
-#ifdef CONFIG_ATM_FORE200E
-       devs += fore200e_detect();
-#endif
-#ifdef CONFIG_ATM_LANAI
-       devs += lanai_detect();
-#endif
-       return devs;
-}
index 57f1810fdccd74df8f755d1aa1f935ccf68b482e..fc518d85543db88a83ba0dc31b95ae1c9af61d55 100644 (file)
@@ -246,10 +246,6 @@ static void atmtcp_c_close(struct atm_vcc *vcc)
 {
        struct atm_dev *atmtcp_dev;
        struct atmtcp_dev_data *dev_data;
-       struct sock *s;
-       struct hlist_node *node;
-       struct atm_vcc *walk;
-       int i;
 
        atmtcp_dev = (struct atm_dev *) vcc->dev_data;
        dev_data = PRIV(atmtcp_dev);
@@ -257,20 +253,8 @@ static void atmtcp_c_close(struct atm_vcc *vcc)
        if (dev_data->persist) return;
        atmtcp_dev->dev_data = NULL;
        kfree(dev_data);
-       shutdown_atm_dev(atmtcp_dev);
+       atm_dev_deregister(atmtcp_dev);
        vcc->dev_data = NULL;
-       read_lock(&vcc_sklist_lock);
-       for(i = 0; i < VCC_HTABLE_SIZE; ++i) {
-               struct hlist_head *head = &vcc_hash[i];
-
-               sk_for_each(s, node, head) {
-                       walk = atm_sk(s);
-                       if (walk->dev != atmtcp_dev)
-                               continue;
-                       wake_up(s->sk_sleep);
-               }
-       }
-       read_unlock(&vcc_sklist_lock);
        module_put(THIS_MODULE);
 }
 
@@ -450,7 +434,7 @@ static int atmtcp_remove_persistent(int itf)
        if (PRIV(dev)->vcc) return 0;
        kfree(dev_data);
        atm_dev_put(dev);
-       shutdown_atm_dev(dev);
+       atm_dev_deregister(dev);
        return 0;
 }
 
index 51ec147872934e902cb8c6ce4c99c6480cd2e0d5..69f4c7ce9a633b04dea5611402a06159c118daba 100644 (file)
@@ -39,7 +39,7 @@
  * o  lanai_change_qos() isn't written yet
  *
  * o  There aren't any ioctl's yet -- I'd like to eventually support
- *    setting loopback and LED modes that way.  (see lanai_ioctl)
+ *    setting loopback and LED modes that way.
  *
  * o  If the segmentation engine or DMA gets shut down we should restart
  *    card as per section 17.0i.  (see lanai_reset)
@@ -305,7 +305,7 @@ struct lanai_dev {
  * vci with their bit set
  */
 static void vci_bitfield_iterate(struct lanai_dev *lanai,
-       /*const*/ unsigned long *lp,
+       const unsigned long *lp,
        void (*func)(struct lanai_dev *,vci_t vci))
 {
        vci_t vci = find_first_bit(lp, NUM_VCI);
@@ -951,7 +951,7 @@ static int __devinit eeprom_read(struct lanai_dev *lanai)
 /* read a big-endian 4-byte value out of eeprom */
 static inline u32 eeprom_be4(const struct lanai_dev *lanai, int address)
 {
-       return be32_to_cpup((u32 *) (&lanai->eeprom[address]));
+       return be32_to_cpup((const u32 *) &lanai->eeprom[address]);
 }
 
 /* Checksum/validate EEPROM contents */
@@ -1160,7 +1160,7 @@ static inline int vcc_tx_space(const struct lanai_vcc *lvcc, int endptr)
 }
 
 /* test if VCC is currently backlogged */
-static inline int vcc_is_backlogged(/*const*/ struct lanai_vcc *lvcc)
+static inline int vcc_is_backlogged(const struct lanai_vcc *lvcc)
 {
        return !skb_queue_empty(&lvcc->tx.backlog);
 }
@@ -1395,7 +1395,8 @@ static void vcc_rx_aal5(struct lanai_vcc *lvcc, int endptr)
 {
        int size;
        struct sk_buff *skb;
-       /*const*/ u32 *x, *end = &lvcc->rx.buf.start[endptr * 4];
+       const u32 *x;
+       u32 *end = &lvcc->rx.buf.start[endptr * 4];
        int n = ((unsigned long) end) - ((unsigned long) lvcc->rx.buf.ptr);
        if (n < 0)
                n += lanai_buf_size(&lvcc->rx.buf);
@@ -2111,7 +2112,7 @@ static int lanai_normalize_ci(struct lanai_dev *lanai,
  * shifted by that much as we compute
  *
  */
-static int pcr_to_cbricg(/*const*/ struct atm_qos *qos)
+static int pcr_to_cbricg(const struct atm_qos *qos)
 {
        int rounddown = 0;      /* 1 = Round PCR down, i.e. round ICG _up_ */
        int x, icg, pcr = atm_pcr_goal(&qos->txtp);
@@ -2434,93 +2435,6 @@ static int lanai_open(struct atm_vcc *atmvcc)
        return result;
 }
 
-#if 0
-/* ioctl operations for card */
-/* NOTE: these are all DEBUGGING ONLY currently */
-static int lanai_ioctl(struct atm_dev *atmdev, unsigned int cmd, void __user *arg)
-{
-       int result = 0;
-       struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data;
-       switch(cmd) {
-               case 2106275:
-                       shutdown_atm_dev(atmdev);
-                       return 0;
-               case 2200000: {
-                       unsigned long flags;
-                       spin_lock_irqsave(&lanai->servicelock, flags);
-                       run_service(lanai);
-                       spin_unlock_irqrestore(&lanai->servicelock, flags);
-                       return 0; }
-               case 2200002:
-                       get_statistics(lanai);
-                       return 0;
-               case 2200003: {
-                       unsigned int i;
-                       for (i = 0; i <= 0x5C ; i += 4) {
-                               if (i==0x48) /* Write-only butt reg */
-                                       continue;
-                               printk(KERN_CRIT DEV_LABEL "  0x%02X: "
-                                   "0x%08X\n", i,
-                                   (unsigned int) readl(lanai->base + i));
-                               barrier(); mb();
-                               pcistatus_check(lanai, 0);
-                               barrier(); mb();
-                       }
-                       return 0; }
-               case 2200004: {
-                       u8 b;
-                       u16 w;
-                       u32 dw;
-                       struct pci_dev *pci = lanai->pci;
-                       (void) pci_read_config_word(pci, PCI_VENDOR_ID, &w);
-                       DPRINTK("vendor = 0x%X\n", (unsigned int) w);
-                       (void) pci_read_config_word(pci, PCI_DEVICE_ID, &w);
-                       DPRINTK("device = 0x%X\n", (unsigned int) w);
-                       (void) pci_read_config_word(pci, PCI_COMMAND, &w);
-                       DPRINTK("command = 0x%X\n", (unsigned int) w);
-                       (void) pci_read_config_word(pci, PCI_STATUS, &w);
-                       DPRINTK("status = 0x%X\n", (unsigned int) w);
-                       (void) pci_read_config_dword(pci,
-                           PCI_CLASS_REVISION, &dw);
-                       DPRINTK("class/revision = 0x%X\n", (unsigned int) dw);
-                       (void) pci_read_config_byte(pci,
-                           PCI_CACHE_LINE_SIZE, &b);
-                       DPRINTK("cache line size = 0x%X\n", (unsigned int) b);
-                       (void) pci_read_config_byte(pci, PCI_LATENCY_TIMER, &b);
-                       DPRINTK("latency = %d (0x%X)\n",
-                           (int) b, (unsigned int) b);
-                       (void) pci_read_config_byte(pci, PCI_HEADER_TYPE, &b);
-                       DPRINTK("header type = 0x%X\n", (unsigned int) b);
-                       (void) pci_read_config_byte(pci, PCI_BIST, &b);
-                       DPRINTK("bist = 0x%X\n", (unsigned int) b);
-                       /* skipping a few here */
-                       (void) pci_read_config_byte(pci,
-                           PCI_INTERRUPT_LINE, &b);
-                       DPRINTK("pci_int_line = 0x%X\n", (unsigned int) b);
-                       (void) pci_read_config_byte(pci,
-                           PCI_INTERRUPT_PIN, &b);
-                       DPRINTK("pci_int_pin = 0x%X\n", (unsigned int) b);
-                       (void) pci_read_config_byte(pci, PCI_MIN_GNT, &b);
-                       DPRINTK("min_gnt = 0x%X\n", (unsigned int) b);
-                       (void) pci_read_config_byte(pci, PCI_MAX_LAT, &b);
-                       DPRINTK("max_lat = 0x%X\n", (unsigned int) b); }
-                       return 0;
-#ifdef USE_POWERDOWN
-               case 2200005:
-                       DPRINTK("Coming out of powerdown\n");
-                       lanai->conf1 &= ~CONFIG1_POWERDOWN;
-                       conf1_write(lanai);
-                       return 0;
-#endif
-               default:
-                       result = -ENOIOCTLCMD;
-       }
-       return result;
-}
-#else /* !0 */
-#define lanai_ioctl NULL
-#endif /* 0 */
-
 static int lanai_send(struct atm_vcc *atmvcc, struct sk_buff *skb)
 {
        struct lanai_vcc *lvcc = (struct lanai_vcc *) atmvcc->dev_data;
@@ -2678,7 +2592,6 @@ static const struct atmdev_ops ops = {
        .dev_close      = lanai_dev_close,
        .open           = lanai_open,
        .close          = lanai_close,
-       .ioctl          = lanai_ioctl,
        .getsockopt     = NULL,
        .setsockopt     = NULL,
        .send           = lanai_send,
@@ -2760,6 +2673,7 @@ static void __exit lanai_module_exit(void)
         * gone, so there isn't much to do
         */
        DPRINTK("cleanup_module()\n");
+       pci_unregister_driver(&lanai_driver);
 }
 
 module_init(lanai_module_init);
index bdd168d88f49b0ab6a0103f6c32b20e4fde46105..bd958d69a2ac2aeccb166739c83de1cb674fa4cc 100644 (file)
@@ -432,7 +432,10 @@ int drm_addctx(struct inode *inode, struct file *filp,
 
        if (ctx.handle != DRM_KERNEL_CONTEXT) {
                if (dev->driver->context_ctor)
-                       dev->driver->context_ctor(dev, ctx.handle);
+                       if (!dev->driver->context_ctor(dev, ctx.handle)) {
+                               DRM_DEBUG( "Running out of ctxs or memory.\n");
+                               return -ENOMEM;
+                       }
        }
 
        ctx_entry = drm_alloc(sizeof(*ctx_entry), DRM_MEM_CTXLIST);
index 29c3b631445af851e9e90c93f7a25dbdef08ad7a..91dd669273e0018aeeb95b02e18b4549e074a661 100644 (file)
@@ -591,7 +591,7 @@ static inline size_t read_zero_pagealigned(char __user * buf, size_t size)
 
                if (vma->vm_start > addr || (vma->vm_flags & VM_WRITE) == 0)
                        goto out_up;
-               if (vma->vm_flags & (VM_SHARED | VM_HUGETLB | VM_UNPAGED))
+               if (vma->vm_flags & (VM_SHARED | VM_HUGETLB))
                        break;
                count = vma->vm_end - addr;
                if (count > size)
index 1c0f62d0f938af7568312ea0f6649c5d5d80a36d..815902c2c856bd08df4da65daaf996f78f07e419 100644 (file)
@@ -1113,21 +1113,13 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
 {
        int retval = -EINVAL;
 
-       /*
-        * If we are already in context of hotplug thread, we dont need to
-        * acquire the hotplug lock. Otherwise acquire cpucontrol to prevent
-        * hotplug from removing this cpu that we are working on.
-        */
-       if (!current_in_cpu_hotplug())
-               lock_cpu_hotplug();
-
+       lock_cpu_hotplug();
        dprintk("target for CPU %u: %u kHz, relation %u\n", policy->cpu,
                target_freq, relation);
        if (cpu_online(policy->cpu) && cpufreq_driver->target)
                retval = cpufreq_driver->target(policy, target_freq, relation);
 
-       if (!current_in_cpu_hotplug())
-               unlock_cpu_hotplug();
+       unlock_cpu_hotplug();
 
        return retval;
 }
index 4be59dbb78c472467c507587e9cb47279a557572..1ba072630361959678ef87def072a43755464345 100644 (file)
@@ -193,6 +193,7 @@ static const u8 W83792D_REG_LEVELS[3][4] = {
          0xE2 }        /* (bit3-0) SmartFanII: Fan3 Level 3 */
 };
 
+#define W83792D_REG_GPIO_EN            0x1A
 #define W83792D_REG_CONFIG             0x40
 #define W83792D_REG_VID_FANDIV         0x47
 #define W83792D_REG_CHIPID             0x49
@@ -257,7 +258,7 @@ DIV_TO_REG(long val)
 {
        int i;
        val = SENSORS_LIMIT(val, 1, 128) >> 1;
-       for (i = 0; i < 6; i++) {
+       for (i = 0; i < 7; i++) {
                if (val == 0)
                        break;
                val >>= 1;
@@ -1282,8 +1283,8 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
        w83792d_init_client(new_client);
 
        /* A few vars need to be filled upon startup */
-       for (i = 1; i <= 7; i++) {
-               data->fan_min[i - 1] = w83792d_read_value(new_client,
+       for (i = 0; i < 7; i++) {
+               data->fan_min[i] = w83792d_read_value(new_client,
                                        W83792D_REG_FAN_MIN[i]);
        }
 
@@ -1306,10 +1307,20 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
        device_create_file_fan(new_client, 1);
        device_create_file_fan(new_client, 2);
        device_create_file_fan(new_client, 3);
-       device_create_file_fan(new_client, 4);
-       device_create_file_fan(new_client, 5);
-       device_create_file_fan(new_client, 6);
-       device_create_file_fan(new_client, 7);
+
+       /* Read GPIO enable register to check if pins for fan 4,5 are used as
+          GPIO */
+       val1 = w83792d_read_value(new_client, W83792D_REG_GPIO_EN);
+       if (!(val1 & 0x40))
+               device_create_file_fan(new_client, 4);
+       if (!(val1 & 0x20))
+               device_create_file_fan(new_client, 5);
+
+       val1 = w83792d_read_value(new_client, W83792D_REG_PIN);
+       if (val1 & 0x40)
+               device_create_file_fan(new_client, 6);
+       if (val1 & 0x04)
+               device_create_file_fan(new_client, 7);
 
        device_create_file_temp1(new_client);           /* Temp1 */
        device_create_file_temp_add(new_client, 2);     /* Temp2 */
index 78c7418478d63e86f55127026d227bfae18e94a3..cd12fca73b0d89fa0ee83e711f97c7d08e9cf63d 100644 (file)
@@ -1028,7 +1028,6 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
                mddev->size = le64_to_cpu(sb->size)/2;
                mddev->events = le64_to_cpu(sb->events);
                mddev->bitmap_offset = 0;
-               mddev->default_bitmap_offset = 0;
                mddev->default_bitmap_offset = 1024;
                
                mddev->recovery_cp = le64_to_cpu(sb->resync_offset);
@@ -2932,6 +2931,9 @@ static int set_array_info(mddev_t * mddev, mdu_array_info_t *info)
 
        mddev->sb_dirty      = 1;
 
+       mddev->default_bitmap_offset = MD_SB_BYTES >> 9;
+       mddev->bitmap_offset = 0;
+
        /*
         * Generate a 128 bit UUID
         */
index 2da9d3ba902dd1337ff2d724e46838f9d604f148..3066c587b5391202dda91f8e4a9bdc977a4b335a 100644 (file)
@@ -953,9 +953,6 @@ static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
        int mirror = 0;
        mirror_info_t *p;
 
-       if (rdev->saved_raid_disk >= 0 &&
-           conf->mirrors[rdev->saved_raid_disk].rdev == NULL)
-               mirror = rdev->saved_raid_disk;
        for (mirror=0; mirror < mddev->raid_disks; mirror++)
                if ( !(p=conf->mirrors+mirror)->rdev) {
 
@@ -972,7 +969,10 @@ static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
                        p->head_position = 0;
                        rdev->raid_disk = mirror;
                        found = 1;
-                       if (rdev->saved_raid_disk != mirror)
+                       /* As all devices are equivalent, we don't need a full recovery
+                        * if this was recently any drive of the array
+                        */
+                       if (rdev->saved_raid_disk < 0)
                                conf->fullsync = 1;
                        rcu_assign_pointer(p->rdev, rdev);
                        break;
index 867f06ae33d944e8ef7178d28fc3fa8905d963b3..713dc9c2c73093a67348e473f2bfc47f888d6e3c 100644 (file)
@@ -552,7 +552,11 @@ static int read_balance(conf_t *conf, r10bio_t *r10_bio)
                    !test_bit(In_sync, &rdev->flags))
                        continue;
 
-               if (!atomic_read(&rdev->nr_pending)) {
+               /* This optimisation is debatable, and completely destroys
+                * sequential read speed for 'far copies' arrays.  So only
+                * keep it for 'near' arrays, and review those later.
+                */
+               if (conf->near_copies > 1 && !atomic_read(&rdev->nr_pending)) {
                        disk = ndisk;
                        slot = nslot;
                        break;
index e2a40283e323b46335beedb18face0aad67eae00..36d5f8ac82650bfb4eda7ddce550b44af2f80ac1 100644 (file)
@@ -1704,7 +1704,9 @@ static void raid5d (mddev_t *mddev)
 
                if (conf->seq_flush - conf->seq_write > 0) {
                        int seq = conf->seq_flush;
+                       spin_unlock_irq(&conf->device_lock);
                        bitmap_unplug(mddev->bitmap);
+                       spin_lock_irq(&conf->device_lock);
                        conf->seq_write = seq;
                        activate_bit_delay(conf);
                }
index eae5a35629c59101372d31518ecba9daa4e77814..0000d162d198a60d558ab4be3f54f608ff8b7473 100644 (file)
@@ -1702,6 +1702,8 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
        int data_disks = raid_disks - 2;
        sector_t max_sector = mddev->size << 1;
        int sync_blocks;
+       int still_degraded = 0;
+       int i;
 
        if (sector_nr >= max_sector) {
                /* just being told to finish up .. nothing much to do */
@@ -1710,7 +1712,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
                if (mddev->curr_resync < max_sector) /* aborted */
                        bitmap_end_sync(mddev->bitmap, mddev->curr_resync,
                                        &sync_blocks, 1);
-               else /* compelted sync */
+               else /* completed sync */
                        conf->fullsync = 0;
                bitmap_close_sync(mddev->bitmap);
 
@@ -1748,7 +1750,16 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
                 */
                schedule_timeout_uninterruptible(1);
        }
-       bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 0);
+       /* Need to check if array will still be degraded after recovery/resync
+        * We don't need to check the 'failed' flag as when that gets set,
+        * recovery aborts.
+        */
+       for (i=0; i<mddev->raid_disks; i++)
+               if (conf->disks[i].rdev == NULL)
+                       still_degraded = 1;
+
+       bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, still_degraded);
+
        spin_lock(&sh->lock);
        set_bit(STRIPE_SYNCING, &sh->state);
        clear_bit(STRIPE_INSYNC, &sh->state);
@@ -1784,7 +1795,9 @@ static void raid6d (mddev_t *mddev)
 
                if (conf->seq_flush - conf->seq_write > 0) {
                        int seq = conf->seq_flush;
+                       spin_unlock_irq(&conf->device_lock);
                        bitmap_unplug(mddev->bitmap);
+                       spin_lock_irq(&conf->device_lock);
                        conf->seq_write = seq;
                        activate_bit_delay(conf);
                }
@@ -2145,9 +2158,15 @@ static int raid6_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
                /* no point adding a device */
                return 0;
        /*
-        * find the disk ...
+        * find the disk ... but prefer rdev->saved_raid_disk
+        * if possible.
         */
-       for (disk=0; disk < mddev->raid_disks; disk++)
+       if (rdev->saved_raid_disk >= 0 &&
+           conf->disks[rdev->saved_raid_disk].rdev == NULL)
+               disk = rdev->saved_raid_disk;
+       else
+               disk = 0;
+       for ( ; disk < mddev->raid_disks; disk++)
                if ((p=conf->disks + disk)->rdev == NULL) {
                        clear_bit(In_sync, &rdev->flags);
                        rdev->raid_disk = disk;
index 75cf237196eb85203a9b8306cebd38850290d643..b386cc66c6b31e3b89a2b982e5ad8efede9fdead 100644 (file)
@@ -19,7 +19,7 @@ void flexcop_smc_ctrl(struct flexcop_device *fc, int onoff)
        flexcop_set_ibi_value(ctrl_208,SMC_Enable_sig,onoff);
 }
 
-void flexcop_null_filter_ctrl(struct flexcop_device *fc, int onoff)
+static void flexcop_null_filter_ctrl(struct flexcop_device *fc, int onoff)
 {
        flexcop_set_ibi_value(ctrl_208,Null_filter_sig,onoff);
 }
index 2aa767f9bd7dd88f797c8b9d48d485289661cb8a..cb2e7d6ba2836c5ca2549b020dbae71770edc3a4 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/moduleparam.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
-#include <linux/rwsem.h>
+#include <linux/spinlock.h>
 #include <linux/sched.h>
 
 #include "dvb_ca_en50221.h"
@@ -111,9 +111,6 @@ struct dvb_ca_slot {
        /* size of the buffer to use when talking to the CAM */
        int link_buf_size;
 
-       /* semaphore for syncing access to slot structure */
-       struct rw_semaphore sem;
-
        /* buffer for incoming packets */
        struct dvb_ringbuffer rx_buffer;
 
@@ -602,14 +599,11 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb
        if (ebuf == NULL) {
                int buf_free;
 
-               down_read(&ca->slot_info[slot].sem);
                if (ca->slot_info[slot].rx_buffer.data == NULL) {
-                       up_read(&ca->slot_info[slot].sem);
                        status = -EIO;
                        goto exit;
                }
                buf_free = dvb_ringbuffer_free(&ca->slot_info[slot].rx_buffer);
-               up_read(&ca->slot_info[slot].sem);
 
                if (buf_free < (ca->slot_info[slot].link_buf_size + DVB_RINGBUFFER_PKTHDRSIZE)) {
                        status = -EAGAIN;
@@ -680,14 +674,11 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb
 
        /* OK, add it to the receive buffer, or copy into external buffer if supplied */
        if (ebuf == NULL) {
-               down_read(&ca->slot_info[slot].sem);
                if (ca->slot_info[slot].rx_buffer.data == NULL) {
-                       up_read(&ca->slot_info[slot].sem);
                        status = -EIO;
                        goto exit;
                }
                dvb_ringbuffer_pkt_write(&ca->slot_info[slot].rx_buffer, buf, bytes_read);
-               up_read(&ca->slot_info[slot].sem);
        } else {
                memcpy(ebuf, buf, bytes_read);
        }
@@ -802,12 +793,8 @@ static int dvb_ca_en50221_slot_shutdown(struct dvb_ca_private *ca, int slot)
 {
        dprintk("%s\n", __FUNCTION__);
 
-       down_write(&ca->slot_info[slot].sem);
        ca->pub->slot_shutdown(ca->pub, slot);
        ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE;
-       vfree(ca->slot_info[slot].rx_buffer.data);
-       ca->slot_info[slot].rx_buffer.data = NULL;
-       up_write(&ca->slot_info[slot].sem);
 
        /* need to wake up all processes to check if they're now
           trying to write to a defunct CAM */
@@ -893,7 +880,7 @@ void dvb_ca_en50221_frda_irq(struct dvb_ca_en50221 *pubca, int slot)
 
        case DVB_CA_SLOTSTATE_RUNNING:
                if (ca->open)
-                       dvb_ca_en50221_read_data(ca, slot, NULL, 0);
+                       dvb_ca_en50221_thread_wakeup(ca);
                break;
        }
 }
@@ -1127,16 +1114,16 @@ static int dvb_ca_en50221_thread(void *data)
                                        break;
                                }
 
-                               rxbuf = vmalloc(RX_BUFFER_SIZE);
-                               if (rxbuf == NULL) {
-                                       printk("dvb_ca adapter %d: Unable to allocate CAM rx buffer :(\n", ca->dvbdev->adapter->num);
-                                       ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID;
-                                       dvb_ca_en50221_thread_update_delay(ca);
-                                       break;
+                               if (ca->slot_info[slot].rx_buffer.data == NULL) {
+                                       rxbuf = vmalloc(RX_BUFFER_SIZE);
+                                       if (rxbuf == NULL) {
+                                               printk("dvb_ca adapter %d: Unable to allocate CAM rx buffer :(\n", ca->dvbdev->adapter->num);
+                                               ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID;
+                                               dvb_ca_en50221_thread_update_delay(ca);
+                                               break;
+                                       }
+                                       dvb_ringbuffer_init(&ca->slot_info[slot].rx_buffer, rxbuf, RX_BUFFER_SIZE);
                                }
-                               down_write(&ca->slot_info[slot].sem);
-                               dvb_ringbuffer_init(&ca->slot_info[slot].rx_buffer, rxbuf, RX_BUFFER_SIZE);
-                               up_write(&ca->slot_info[slot].sem);
 
                                ca->pub->slot_ts_enable(ca->pub, slot);
                                ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_RUNNING;
@@ -1148,11 +1135,7 @@ static int dvb_ca_en50221_thread(void *data)
                                if (!ca->open)
                                        continue;
 
-                               // no need to poll if the CAM supports IRQs
-                               if (ca->slot_info[slot].da_irq_supported)
-                                       break;
-
-                               // poll mode
+                               // poll slots for data
                                pktcount = 0;
                                while ((status = dvb_ca_en50221_read_data(ca, slot, NULL, 0)) > 0) {
                                        if (!ca->open)
@@ -1367,12 +1350,13 @@ exit:
 /**
  * Condition for waking up in dvb_ca_en50221_io_read_condition
  */
-static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, int *result, int *_slot)
+static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca,
+                                           int *result, int *_slot)
 {
        int slot;
        int slot_count = 0;
        int idx;
-       int fraglen;
+       size_t fraglen;
        int connection_id = -1;
        int found = 0;
        u8 hdr[2];
@@ -1382,10 +1366,7 @@ static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, int *resu
                if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_RUNNING)
                        goto nextslot;
 
-               down_read(&ca->slot_info[slot].sem);
-
                if (ca->slot_info[slot].rx_buffer.data == NULL) {
-                       up_read(&ca->slot_info[slot].sem);
                        return 0;
                }
 
@@ -1403,10 +1384,7 @@ static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, int *resu
                        idx = dvb_ringbuffer_pkt_next(&ca->slot_info[slot].rx_buffer, idx, &fraglen);
                }
 
-               if (!found)
-                       up_read(&ca->slot_info[slot].sem);
-
-             nextslot:
+nextslot:
                slot = (slot + 1) % ca->slot_count;
                slot_count++;
        }
@@ -1511,8 +1489,7 @@ static ssize_t dvb_ca_en50221_io_read(struct file *file, char __user * buf,
                goto exit;
        status = pktlen;
 
-      exit:
-       up_read(&ca->slot_info[slot].sem);
+exit:
        return status;
 }
 
@@ -1544,11 +1521,11 @@ static int dvb_ca_en50221_io_open(struct inode *inode, struct file *file)
        for (i = 0; i < ca->slot_count; i++) {
 
                if (ca->slot_info[i].slot_state == DVB_CA_SLOTSTATE_RUNNING) {
-                       down_write(&ca->slot_info[i].sem);
                        if (ca->slot_info[i].rx_buffer.data != NULL) {
+                               /* it is safe to call this here without locks because
+                                * ca->open == 0. Data is not read in this case */
                                dvb_ringbuffer_flush(&ca->slot_info[i].rx_buffer);
                        }
-                       up_write(&ca->slot_info[i].sem);
                }
        }
 
@@ -1607,7 +1584,6 @@ static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table * wait)
        dprintk("%s\n", __FUNCTION__);
 
        if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) {
-               up_read(&ca->slot_info[slot].sem);
                mask |= POLLIN;
        }
 
@@ -1619,7 +1595,6 @@ static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table * wait)
        poll_wait(file, &ca->wait_queue, wait);
 
        if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) {
-               up_read(&ca->slot_info[slot].sem);
                mask |= POLLIN;
        }
 
@@ -1709,7 +1684,6 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter,
                ca->slot_info[i].slot_state = DVB_CA_SLOTSTATE_NONE;
                atomic_set(&ca->slot_info[i].camchange_count, 0);
                ca->slot_info[i].camchange_type = DVB_CA_EN50221_CAMCHANGE_REMOVED;
-               init_rwsem(&ca->slot_info[i].sem);
        }
 
        if (signal_pending(current)) {
@@ -1729,7 +1703,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter,
        ca->thread_pid = ret;
        return 0;
 
-      error:
+error:
        if (ca != NULL) {
                if (ca->dvbdev != NULL)
                        dvb_unregister_device(ca->dvbdev);
@@ -1771,6 +1745,9 @@ void dvb_ca_en50221_release(struct dvb_ca_en50221 *pubca)
 
        for (i = 0; i < ca->slot_count; i++) {
                dvb_ca_en50221_slot_shutdown(ca, i);
+               if (ca->slot_info[i].rx_buffer.data != NULL) {
+                       vfree(ca->slot_info[i].rx_buffer.data);
+               }
        }
        kfree(ca->slot_info);
        dvb_unregister_device(ca->dvbdev);
index 87935490bfb2f1e4deb34c0bea36ff5de3cf4c7c..df536bd2e103b85690645511753fd0b83a29aab8 100644 (file)
@@ -151,6 +151,8 @@ struct dvb_net_priv {
        unsigned char ule_bridged;              /* Whether the ULE_BRIDGED extension header was found. */
        int ule_sndu_remain;                    /* Nr. of bytes still required for current ULE SNDU. */
        unsigned long ts_count;                 /* Current ts cell counter. */
+
+       struct semaphore mutex;
 };
 
 
@@ -881,12 +883,13 @@ static int dvb_net_filter_sec_set(struct net_device *dev,
 
 static int dvb_net_feed_start(struct net_device *dev)
 {
-       int ret, i;
+       int ret = 0, i;
        struct dvb_net_priv *priv = dev->priv;
         struct dmx_demux *demux = priv->demux;
         unsigned char *mac = (unsigned char *) dev->dev_addr;
 
        dprintk("%s: rx_mode %i\n", __FUNCTION__, priv->rx_mode);
+       down(&priv->mutex);
        if (priv->tsfeed || priv->secfeed || priv->secfilter || priv->multi_secfilter[0])
                printk("%s: BUG %d\n", __FUNCTION__, __LINE__);
 
@@ -900,7 +903,7 @@ static int dvb_net_feed_start(struct net_device *dev)
                                         dvb_net_sec_callback);
                if (ret<0) {
                        printk("%s: could not allocate section feed\n", dev->name);
-                       return ret;
+                       goto error;
                }
 
                ret = priv->secfeed->set(priv->secfeed, priv->pid, 32768, 1);
@@ -909,7 +912,7 @@ static int dvb_net_feed_start(struct net_device *dev)
                        printk("%s: could not set section feed\n", dev->name);
                        priv->demux->release_section_feed(priv->demux, priv->secfeed);
                        priv->secfeed=NULL;
-                       return ret;
+                       goto error;
                }
 
                if (priv->rx_mode != RX_MODE_PROMISC) {
@@ -948,7 +951,7 @@ static int dvb_net_feed_start(struct net_device *dev)
                ret = demux->allocate_ts_feed(demux, &priv->tsfeed, dvb_net_ts_callback);
                if (ret < 0) {
                        printk("%s: could not allocate ts feed\n", dev->name);
-                       return ret;
+                       goto error;
                }
 
                /* Set netdevice pointer for ts decaps callback. */
@@ -962,23 +965,26 @@ static int dvb_net_feed_start(struct net_device *dev)
                        printk("%s: could not set ts feed\n", dev->name);
                        priv->demux->release_ts_feed(priv->demux, priv->tsfeed);
                        priv->tsfeed = NULL;
-                       return ret;
+                       goto error;
                }
 
                dprintk("%s: start filtering\n", __FUNCTION__);
                priv->tsfeed->start_filtering(priv->tsfeed);
        } else
-               return -EINVAL;
+               ret = -EINVAL;
 
-       return 0;
+error:
+       up(&priv->mutex);
+       return ret;
 }
 
 static int dvb_net_feed_stop(struct net_device *dev)
 {
        struct dvb_net_priv *priv = dev->priv;
-       int i;
+       int i, ret = 0;
 
        dprintk("%s\n", __FUNCTION__);
+       down(&priv->mutex);
        if (priv->feedtype == DVB_NET_FEEDTYPE_MPE) {
                if (priv->secfeed) {
                        if (priv->secfeed->is_filtering) {
@@ -1019,8 +1025,9 @@ static int dvb_net_feed_stop(struct net_device *dev)
                else
                        printk("%s: no ts feed to stop\n", dev->name);
        } else
-               return -EINVAL;
-       return 0;
+               ret = -EINVAL;
+       up(&priv->mutex);
+       return ret;
 }
 
 
@@ -1044,8 +1051,8 @@ static void wq_set_multicast_list (void *data)
        struct dvb_net_priv *priv = dev->priv;
 
        dvb_net_feed_stop(dev);
-
        priv->rx_mode = RX_MODE_UNI;
+       spin_lock_bh(&dev->xmit_lock);
 
        if (dev->flags & IFF_PROMISC) {
                dprintk("%s: promiscuous mode\n", dev->name);
@@ -1070,6 +1077,7 @@ static void wq_set_multicast_list (void *data)
                }
        }
 
+       spin_unlock_bh(&dev->xmit_lock);
        dvb_net_feed_start(dev);
 }
 
@@ -1200,6 +1208,7 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype)
 
        INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list, net);
        INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed, net);
+       init_MUTEX(&priv->mutex);
 
        net->base_addr = pid;
 
index 49f541d9a042bd6448c77dfff3bfc11a627dabd5..8c7beffb045fd1335bdd23f2c7e6a47e0c538daa 100644 (file)
@@ -65,7 +65,7 @@ static struct dvb_usb_rc_key a800_rc_keys[] = {
 
 };
 
-int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
+static int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
 {
        u8 key[5];
        if (usb_control_msg(d->udev,usb_rcvctrlpipe(d->udev,0),
index 00b946419b408fb1128bd52088f2d5fd034f4811..269d899da488336024e70286a8773b48cff65c77 100644 (file)
@@ -21,9 +21,9 @@ MODULE_LICENSE("GPL");
 int dibusb_streaming_ctrl(struct dvb_usb_device *d, int onoff)
 {
        if (d->priv != NULL) {
-               struct dib_fe_xfer_ops *ops = d->priv;
-               if (ops->fifo_ctrl != NULL)
-                       if (ops->fifo_ctrl(d->fe,onoff)) {
+               struct dibusb_state *st = d->priv;
+               if (st->ops.fifo_ctrl != NULL)
+                       if (st->ops.fifo_ctrl(d->fe,onoff)) {
                                err("error while controlling the fifo of the demod.");
                                return -ENODEV;
                        }
@@ -35,9 +35,9 @@ EXPORT_SYMBOL(dibusb_streaming_ctrl);
 int dibusb_pid_filter(struct dvb_usb_device *d, int index, u16 pid, int onoff)
 {
        if (d->priv != NULL) {
-               struct dib_fe_xfer_ops *ops = d->priv;
-               if (d->pid_filtering && ops->pid_ctrl != NULL)
-                       ops->pid_ctrl(d->fe,index,pid,onoff);
+               struct dibusb_state *st = d->priv;
+               if (st->ops.pid_ctrl != NULL)
+                       st->ops.pid_ctrl(d->fe,index,pid,onoff);
        }
        return 0;
 }
@@ -46,9 +46,9 @@ EXPORT_SYMBOL(dibusb_pid_filter);
 int dibusb_pid_filter_ctrl(struct dvb_usb_device *d, int onoff)
 {
        if (d->priv != NULL) {
-               struct dib_fe_xfer_ops *ops = d->priv;
-               if (ops->pid_parse != NULL)
-                       if (ops->pid_parse(d->fe,onoff) < 0)
+               struct dibusb_state *st = d->priv;
+               if (st->ops.pid_parse != NULL)
+                       if (st->ops.pid_parse(d->fe,onoff) < 0)
                                err("could not handle pid_parser");
        }
        return 0;
index 74545f82eff1d2df2aca6e02f2577e8c9372827a..f98e306a5759ed6d78fa927212706157ff4d2654 100644 (file)
@@ -148,7 +148,7 @@ static struct dvb_usb_rc_key digitv_rc_keys[] = {
 };
 
 /* TODO is it really the NEC protocol ? */
-int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
+static int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
 {
        u8 key[5];
 
index a902059812a2fdc7baf6a8a1de6bc9888fb7253f..dd8e0b94edbab6ae619c1a0d91abc667071b5ffc 100644 (file)
@@ -23,7 +23,7 @@ module_param_named(disable_rc_polling, dvb_usb_disable_rc_polling, int, 0644);
 MODULE_PARM_DESC(disable_rc_polling, "disable remote control polling (default: 0).");
 
 /* general initialization functions */
-int dvb_usb_exit(struct dvb_usb_device *d)
+static int dvb_usb_exit(struct dvb_usb_device *d)
 {
        deb_info("state before exiting everything: %x\n",d->state);
        dvb_usb_remote_exit(d);
index 9f639297a9f2d7f4ccb50f2af145dfb93b148495..d9a8ede14b45151a019ac43ba51a4465d704d725 100644 (file)
@@ -7,7 +7,7 @@
     Copyright (C) 2001-2002 Convergence Integrated Media GmbH
          Holger Waechtler <holger@convergence.de>
 
-    Copyright (C) 2004 Steven Toth <steve@toth.demon.co.uk>
+    Copyright (C) 2004 Steven Toth <stoth@hauppauge.com>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index 11f86806756ef76fe48b33890cca8d6b23e589ed..1f250885d2ce40da97fdcb40630d2b7e0f427b23 100644 (file)
@@ -7,7 +7,7 @@
     Copyright (C) 2001-2002 Convergence Integrated Media GmbH
          Holger Waechtler <holger@convergence.de>
 
-    Copyright (C) 2004 Steven Toth <steve@toth.demon.co.uk>
+    Copyright (C) 2004 Steven Toth <stoth@hauppauge.com>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index bad0933eb7146663124339b366c53e47295bd4a8..84b62881cea7f81b459924b5b1646d2c07b246a0 100644 (file)
@@ -44,6 +44,8 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
+#include <linux/slab.h>
+#include <linux/string.h>
 
 #include "dvb_frontend.h"
 #include "dvb-pll.h"
index c6d276618e86fab9bdbbc9da7d9d5a71386772ae..ad8647a3c85e69c6caa321e2d2a334afa6e54526 100644 (file)
@@ -140,25 +140,25 @@ static int ves1820_set_symbolrate(struct ves1820_state *state, u32 symbolrate)
        /* yeuch! */
        fpxin = state->config->xin * 10;
        fptmp = fpxin; do_div(fptmp, 123);
-       if (symbolrate < fptmp);
+       if (symbolrate < fptmp)
                SFIL = 1;
        fptmp = fpxin; do_div(fptmp, 160);
-       if (symbolrate < fptmp);
+       if (symbolrate < fptmp)
                SFIL = 0;
        fptmp = fpxin; do_div(fptmp, 246);
-       if (symbolrate < fptmp);
+       if (symbolrate < fptmp)
                SFIL = 1;
        fptmp = fpxin; do_div(fptmp, 320);
-       if (symbolrate < fptmp);
+       if (symbolrate < fptmp)
                SFIL = 0;
        fptmp = fpxin; do_div(fptmp, 492);
-       if (symbolrate < fptmp);
+       if (symbolrate < fptmp)
                SFIL = 1;
        fptmp = fpxin; do_div(fptmp, 640);
-       if (symbolrate < fptmp);
+       if (symbolrate < fptmp)
                SFIL = 0;
        fptmp = fpxin; do_div(fptmp, 984);
-       if (symbolrate < fptmp);
+       if (symbolrate < fptmp)
                SFIL = 1;
 
        fin = state->config->xin >> 4;
index d8bf65877897bd6a0e1650c19e825584ead7ea9c..fa5034a9ecf588ae955b751818b955814fc6eeb3 100644 (file)
@@ -81,6 +81,7 @@ config DVB_BUDGET_CI
        tristate "Budget cards with onboard CI connector"
        depends on DVB_CORE && PCI
        select VIDEO_SAA7146
+       select DVB_STV0297
        select DVB_STV0299
        select DVB_TDA1004X
        help
index c3801e328fe912d2caf810e775b8129fd4d78d33..6079e8865d5b99d3f3ca4185e20b44014227df9f 100644 (file)
@@ -40,6 +40,7 @@
 
 #include "av7110.h"
 #include "av7110_hw.h"
+#include "av7110_ca.h"
 
 
 void CI_handle(struct av7110 *av7110, u8 *data, u16 len)
index aa75dc03a0b3ae082179ff5c01a4ad2aa52b84bf..9f51bae7194c26430d98dc0ed86b2478f1a935d6 100644 (file)
@@ -1020,6 +1020,8 @@ MODULE_DEVICE_TABLE(pci, pci_tbl);
 
 static struct saa7146_extension budget_extension = {
        .name = "budget_av",
+       .flags = SAA7146_I2C_SHORT_DELAY,
+
        .pci_tbl = pci_tbl,
 
        .module = THIS_MODULE,
index 75fb92d60998128ff1ad9f08e56fe1cb153be8f6..b9b3cd9c0369c16c5521d40d97be29dbc0df39d6 100644 (file)
@@ -1166,7 +1166,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl);
 
 static struct saa7146_extension budget_extension = {
        .name = "budget_ci dvb\0",
-       .flags = 0,
+       .flags = SAA7146_I2C_SHORT_DELAY,
 
        .module = THIS_MODULE,
        .pci_tbl = &pci_tbl[0],
index 4fd8bbc47037e7e8effa17ee5a2a4d80aef14bbc..bc4ce7559cbe93ee301b3fcd006a264357c46a68 100644 (file)
@@ -738,7 +738,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl);
 
 static struct saa7146_extension budget_extension = {
        .name           = "budget dvb\0",
-       .flags          = 0,
+       .flags          = SAA7146_I2C_SHORT_DELAY,
 
        .module         = THIS_MODULE,
        .pci_tbl        = pci_tbl,
index e9a8457b072791081836b177361063461384a354..ac79ef178c0555452dfdb78b5fb818e6ab636e7f 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/string.h>
 #include <linux/i2c.h>
 
+#include "ttpci-eeprom.h"
 
 #if 1
 #define dprintk(x...) do { printk(x); } while (0)
index 1a3b3c7e5e99699815245de164016959b549c6ed..cc4a723e24db25970fa29f75c07a2235d84881a2 100644 (file)
@@ -26,15 +26,12 @@ config VIDEO_BT848
          module will be called bttv.
 
 config VIDEO_BT848_DVB
-       tristate "DVB/ATSC Support for bt878 based TV cards"
+       bool "DVB/ATSC Support for bt878 based TV cards"
        depends on VIDEO_BT848 && DVB_CORE
        select DVB_BT8XX
        ---help---
          This adds support for DVB/ATSC cards based on the BT878 chip.
 
-         To compile this driver as a module, choose M here: the
-         module will be called dvb-bt8xx.
-
 config VIDEO_SAA6588
        tristate "SAA6588 Radio Chip RDS decoder support on BT848 cards"
        depends on VIDEO_DEV && I2C && VIDEO_BT848
index e31ebb11c4684e552adfd161234ccde8817539e3..012be639aa1861577dc2a5a4d98d6bbdab839068 100644 (file)
@@ -2904,7 +2904,7 @@ void __devinit bttv_idcard(struct bttv *btv)
  */
 
 /* Some Modular Technology cards have an eeprom, but no subsystem ID */
-void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
+static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
 {
        int type = -1;
 
@@ -3879,7 +3879,7 @@ static void __devinit init_PXC200(struct bttv *btv)
  *                error. ERROR_CPLD_Check_Failed.
  */
 /* ----------------------------------------------------------------------- */
-void
+static void
 init_RTV24 (struct bttv *btv)
 {
        uint32_t dataRead = 0;
@@ -4103,7 +4103,7 @@ void tea5757_set_freq(struct bttv *btv, unsigned short freq)
 /* ----------------------------------------------------------------------- */
 /* winview                                                                 */
 
-void winview_audio(struct bttv *btv, struct video_audio *v, int set)
+static void winview_audio(struct bttv *btv, struct video_audio *v, int set)
 {
        /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
        int bits_out, loops, vol, data;
index 709099f03bd20e5903a80e0f113f188824363330..3c58a2a68906003498703f9e3eac1cae92643799 100644 (file)
@@ -1720,7 +1720,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
                memset(i,0,sizeof(*i));
                i->index    = n;
                i->type     = V4L2_INPUT_TYPE_CAMERA;
-               i->audioset = 1;
+               i->audioset = 0;
                if (i->index == bttv_tvcards[btv->c.type].tuner) {
                        sprintf(i->name, "Television");
                        i->type  = V4L2_INPUT_TYPE_TUNER;
@@ -1771,11 +1771,19 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
                memset(t,0,sizeof(*t));
                strcpy(t->name, "Television");
                t->type       = V4L2_TUNER_ANALOG_TV;
-               t->rangehigh  = 0xffffffffUL;
                t->capability = V4L2_TUNER_CAP_NORM;
                t->rxsubchans = V4L2_TUNER_SUB_MONO;
                if (btread(BT848_DSTATUS)&BT848_DSTATUS_HLOC)
                        t->signal = 0xffff;
+               {
+                       struct video_tuner tuner;
+
+                       memset(&tuner, 0, sizeof (tuner));
+                       tuner.rangehigh = 0xffffffffUL;
+                       bttv_call_i2c_clients(btv, VIDIOCGTUNER, &tuner);
+                       t->rangelow = tuner.rangelow;
+                       t->rangehigh = tuner.rangehigh;
+               }
                {
                        /* Hmmm ... */
                        struct video_audio va;
@@ -1853,7 +1861,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
        }
        case VIDIOC_LOG_STATUS:
        {
-               bttv_call_i2c_clients(btv, VIDIOC_LOG_STATUS, 0);
+               bttv_call_i2c_clients(btv, VIDIOC_LOG_STATUS, NULL);
                return 0;
        }
 
@@ -2029,19 +2037,33 @@ static int bttv_switch_type(struct bttv_fh *fh, enum v4l2_buf_type type)
        return 0;
 }
 
+static void
+pix_format_set_size     (struct v4l2_pix_format *       f,
+                        const struct bttv_format *     fmt,
+                        unsigned int                   width,
+                        unsigned int                   height)
+{
+       f->width = width;
+       f->height = height;
+
+       if (fmt->flags & FORMAT_FLAGS_PLANAR) {
+               f->bytesperline = width; /* Y plane */
+               f->sizeimage = (width * height * fmt->depth) >> 3;
+       } else {
+               f->bytesperline = (width * fmt->depth) >> 3;
+               f->sizeimage = height * f->bytesperline;
+       }
+}
+
 static int bttv_g_fmt(struct bttv_fh *fh, struct v4l2_format *f)
 {
        switch (f->type) {
        case V4L2_BUF_TYPE_VIDEO_CAPTURE:
                memset(&f->fmt.pix,0,sizeof(struct v4l2_pix_format));
-               f->fmt.pix.width        = fh->width;
-               f->fmt.pix.height       = fh->height;
+               pix_format_set_size (&f->fmt.pix, fh->fmt,
+                                    fh->width, fh->height);
                f->fmt.pix.field        = fh->cap.field;
                f->fmt.pix.pixelformat  = fh->fmt->fourcc;
-               f->fmt.pix.bytesperline =
-                       (f->fmt.pix.width * fh->fmt->depth) >> 3;
-               f->fmt.pix.sizeimage =
-                       f->fmt.pix.height * f->fmt.pix.bytesperline;
                return 0;
        case V4L2_BUF_TYPE_VIDEO_OVERLAY:
                memset(&f->fmt.win,0,sizeof(struct v4l2_window));
@@ -2106,11 +2128,9 @@ static int bttv_try_fmt(struct bttv_fh *fh, struct bttv *btv,
                        f->fmt.pix.width = maxw;
                if (f->fmt.pix.height > maxh)
                        f->fmt.pix.height = maxh;
-               f->fmt.pix.width &= ~0x03;
-               f->fmt.pix.bytesperline =
-                       (f->fmt.pix.width * fmt->depth) >> 3;
-               f->fmt.pix.sizeimage =
-                       f->fmt.pix.height * f->fmt.pix.bytesperline;
+               pix_format_set_size (&f->fmt.pix, fmt,
+                                    f->fmt.pix.width & ~3,
+                                    f->fmt.pix.height);
 
                return 0;
        }
@@ -2278,6 +2298,15 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
                        retval = -EINVAL;
                        goto fh_unlock_and_return;
                }
+               if (fmt->flags & FORMAT_FLAGS_RAW) {
+                       /* VIDIOCMCAPTURE uses gbufsize, not RAW_BPL *
+                          RAW_LINES * 2. F1 is stored at offset 0, F2
+                          at buffer size / 2. */
+                       fh->width = RAW_BPL;
+                       fh->height = gbufsize / RAW_BPL;
+                       btv->init.width  = RAW_BPL;
+                       btv->init.height = gbufsize / RAW_BPL;
+               }
                fh->ovfmt   = fmt;
                fh->fmt     = fmt;
                btv->init.ovfmt   = fmt;
@@ -2589,9 +2618,11 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
 
                if (0 == v4l2)
                        return -EINVAL;
-               strcpy(cap->driver,"bttv");
-               strlcpy(cap->card,btv->video_dev->name,sizeof(cap->card));
-               sprintf(cap->bus_info,"PCI:%s",pci_name(btv->c.pci));
+               memset(cap, 0, sizeof (*cap));
+               strlcpy(cap->driver, "bttv", sizeof (cap->driver));
+               strlcpy(cap->card, btv->video_dev->name, sizeof (cap->card));
+               snprintf(cap->bus_info, sizeof (cap->bus_info),
+                        "PCI:%s", pci_name(btv->c.pci));
                cap->version = BTTV_VERSION_CODE;
                cap->capabilities =
                        V4L2_CAP_VIDEO_CAPTURE |
@@ -2952,6 +2983,8 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait)
                        fh->cap.read_buf->memory = V4L2_MEMORY_USERPTR;
                        field = videobuf_next_field(&fh->cap);
                        if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,field)) {
+                               kfree (fh->cap.read_buf);
+                               fh->cap.read_buf = NULL;
                                up(&fh->cap.lock);
                                return POLLERR;
                        }
index f6afeec499c509b1a692df5cf3d7353215945bb2..aea3f038cff6a1b5a8ce5aa8743893e8da6beb97 100644 (file)
@@ -208,8 +208,11 @@ static void cx25840_initialize(struct i2c_client *client, int loadfw)
 
 static void input_change(struct i2c_client *client)
 {
+       struct cx25840_state *state = i2c_get_clientdata(client);
        v4l2_std_id std = cx25840_get_v4lstd(client);
 
+       /* Note: perhaps V4L2_STD_PAL_M should be handled as V4L2_STD_NTSC
+          instead of V4L2_STD_PAL. Someone needs to test this. */
        if (std & V4L2_STD_PAL) {
                /* Follow tuner change procedure for PAL */
                cx25840_write(client, 0x808, 0xff);
@@ -220,7 +223,32 @@ static void input_change(struct i2c_client *client)
                cx25840_write(client, 0x80b, 0x10);
        } else if (std & V4L2_STD_NTSC) {
                /* NTSC */
-               cx25840_write(client, 0x808, 0xf6);
+               if (state->cardtype == CARDTYPE_PVR150_WORKAROUND) {
+                       /* Certain Hauppauge PVR150 models have a hardware bug
+                          that causes audio to drop out. For these models the
+                          audio standard must be set explicitly.
+                          To be precise: it affects cards with tuner models
+                          85, 99 and 112 (model numbers from tveeprom). */
+                       if (std == V4L2_STD_NTSC_M_JP) {
+                               /* Japan uses EIAJ audio standard */
+                               cx25840_write(client, 0x808, 0x2f);
+                       } else {
+                               /* Others use the BTSC audio standard */
+                               cx25840_write(client, 0x808, 0x1f);
+                       }
+                       /* South Korea uses the A2-M (aka Zweiton M) audio
+                          standard, and should set 0x808 to 0x3f, but I don't
+                          know how to detect this. */
+               } else if (std == V4L2_STD_NTSC_M_JP) {
+                       /* Japan uses EIAJ audio standard */
+                       cx25840_write(client, 0x808, 0xf7);
+               } else {
+                       /* Others use the BTSC audio standard */
+                       cx25840_write(client, 0x808, 0xf6);
+               }
+               /* South Korea uses the A2-M (aka Zweiton M) audio standard,
+                  and should set 0x808 to 0xf8, but I don't know how to
+                  detect this. */
                cx25840_write(client, 0x80b, 0x00);
        }
 
@@ -241,7 +269,8 @@ static int set_input(struct i2c_client *client, enum cx25840_input input)
        case CX25840_TUNER:
                cx25840_dbg("now setting Tuner input\n");
 
-               if (state->cardtype == CARDTYPE_PVR150) {
+               if (state->cardtype == CARDTYPE_PVR150 ||
+                   state->cardtype == CARDTYPE_PVR150_WORKAROUND) {
                        /* CH_SEL_ADC2=1 */
                        cx25840_and_or(client, 0x102, ~0x2, 0x02);
                }
@@ -363,6 +392,7 @@ static int set_v4lctrl(struct i2c_client *client, struct v4l2_control *ctrl)
        case CX25840_CID_CARDTYPE:
                switch (ctrl->value) {
                case CARDTYPE_PVR150:
+               case CARDTYPE_PVR150_WORKAROUND:
                case CARDTYPE_PG600:
                        state->cardtype = ctrl->value;
                        break;
@@ -714,7 +744,7 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
 
 /* ----------------------------------------------------------------------- */
 
-struct i2c_driver i2c_driver_cx25840;
+static struct i2c_driver i2c_driver_cx25840;
 
 static int cx25840_detect_client(struct i2c_adapter *adapter, int address,
                                 int kind)
@@ -807,7 +837,7 @@ static int cx25840_detach_client(struct i2c_client *client)
 
 /* ----------------------------------------------------------------------- */
 
-struct i2c_driver i2c_driver_cx25840 = {
+static struct i2c_driver i2c_driver_cx25840 = {
        .name = "cx25840",
 
        .id = I2C_DRIVERID_CX25840,
index 5c3f0639fb779a4da987a9d6632cc7c5d59e0f62..4932ed1c9b199bcd74fe381d0c48dee2366e3817 100644 (file)
@@ -40,9 +40,16 @@ extern int cx25840_debug;
 
 #define CX25840_CID_CARDTYPE (V4L2_CID_PRIVATE_BASE+0)
 
+/* The CARDTYPE_PVR150_WORKAROUND cardtype activates a workaround for a
+   hardware bug that is present in PVR150 (and possible PVR500) cards that
+   have certain NTSC tuners (tveeprom model numbers 85, 99 and 112). The
+   audio autodetect fails on some channels for these models and the workaround
+   is to select the audio standard explicitly. Many thanks to Hauppauge for
+   providing this information. */
 enum cx25840_cardtype {
        CARDTYPE_PVR150,
-       CARDTYPE_PG600
+       CARDTYPE_PG600,
+       CARDTYPE_PVR150_WORKAROUND,
 };
 
 enum cx25840_input {
index 41818b6205b3b9cc02efafab549426307570d29f..85ba4106dc79456621e090da7aba453808b9f0d5 100644 (file)
@@ -46,8 +46,8 @@ config VIDEO_CX88_DVB_ALL_FRONTENDS
          If you are unsure, choose Y.
 
 config VIDEO_CX88_DVB_MT352
-       tristate "Zarlink MT352 DVB-T Support"
-       default m
+       bool "Zarlink MT352 DVB-T Support"
+       default y
        depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS
        select DVB_MT352
        ---help---
@@ -55,8 +55,8 @@ config VIDEO_CX88_DVB_MT352
          Connexant 2388x chip and the MT352 demodulator.
 
 config VIDEO_CX88_DVB_OR51132
-       tristate "OR51132 ATSC Support"
-       default m
+       bool "OR51132 ATSC Support"
+       default y
        depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS
        select DVB_OR51132
        ---help---
@@ -64,8 +64,8 @@ config VIDEO_CX88_DVB_OR51132
          Connexant 2388x chip and the OR51132 demodulator.
 
 config VIDEO_CX88_DVB_CX22702
-       tristate "Conexant CX22702 DVB-T Support"
-       default m
+       bool "Conexant CX22702 DVB-T Support"
+       default y
        depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS
        select DVB_CX22702
        ---help---
@@ -73,8 +73,8 @@ config VIDEO_CX88_DVB_CX22702
          Connexant 2388x chip and the CX22702 demodulator.
 
 config VIDEO_CX88_DVB_LGDT330X
-       tristate "LG Electronics DT3302/DT3303 ATSC Support"
-       default m
+       bool "LG Electronics DT3302/DT3303 ATSC Support"
+       default y
        depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS
        select DVB_LGDT330X
        ---help---
@@ -82,8 +82,8 @@ config VIDEO_CX88_DVB_LGDT330X
          Connexant 2388x chip and the LGDT3302/LGDT3303 demodulator.
 
 config VIDEO_CX88_DVB_NXT200X
-       tristate "NXT2002/NXT2004 ATSC Support"
-       default m
+       bool "NXT2002/NXT2004 ATSC Support"
+       default y
        depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS
        select DVB_NXT200X
        ---help---
index 0df40b7734548e99fccf79454bba870868a23680..54401b02b7ce75c13dfc24df48c3b85c8d9196a7 100644 (file)
@@ -9,21 +9,12 @@ obj-$(CONFIG_VIDEO_CX88_DVB) += cx88-dvb.o
 EXTRA_CFLAGS += -I$(src)/..
 EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core
 EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/frontends
-ifneq ($(CONFIG_VIDEO_BUF_DVB),n)
- EXTRA_CFLAGS += -DHAVE_VIDEO_BUF_DVB=1
-endif
-ifneq ($(CONFIG_DVB_CX22702),n)
- EXTRA_CFLAGS += -DHAVE_CX22702=1
-endif
-ifneq ($(CONFIG_DVB_OR51132),n)
- EXTRA_CFLAGS += -DHAVE_OR51132=1
-endif
-ifneq ($(CONFIG_DVB_LGDT330X),n)
- EXTRA_CFLAGS += -DHAVE_LGDT330X=1
-endif
-ifneq ($(CONFIG_DVB_MT352),n)
- EXTRA_CFLAGS += -DHAVE_MT352=1
-endif
-ifneq ($(CONFIG_DVB_NXT200X),n)
- EXTRA_CFLAGS += -DHAVE_NXT200X=1
-endif
+
+extra-cflags-$(CONFIG_VIDEO_BUF_DVB) += -DHAVE_VIDEO_BUF_DVB=1
+extra-cflags-$(CONFIG_DVB_CX22702)   += -DHAVE_CX22702=1
+extra-cflags-$(CONFIG_DVB_OR51132)   += -DHAVE_OR51132=1
+extra-cflags-$(CONFIG_DVB_LGDT330X)  += -DHAVE_LGDT330X=1
+extra-cflags-$(CONFIG_DVB_MT352)     += -DHAVE_MT352=1
+extra-cflags-$(CONFIG_DVB_NXT200X)   += -DHAVE_NXT200X=1
+
+EXTRA_CFLAGS += $(extra-cflags-y) $(extra-cflags-m)
index f2268631b7c01246546cbfb26e53eb28031d9bbe..24651661630abe64f9bc990a5c535774f047302c 100644 (file)
@@ -1083,41 +1083,28 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
        tveeprom_hauppauge_analog(&core->i2c_client, &tv, eeprom_data);
        core->tuner_type = tv.tuner_type;
        core->has_radio  = tv.has_radio;
-}
-
-static int hauppauge_eeprom_dvb(struct cx88_core *core, u8 *ee)
-{
-       int model;
-       int tuner;
 
        /* Make sure we support the board model */
-       model = ee[0x1f] << 24 | ee[0x1e] << 16 | ee[0x1d] << 8 | ee[0x1c];
-       switch(model) {
-       case 90002:
-       case 90500:
-       case 90501:
+       switch (tv.model)
+       {
+       case 90002: /* Nova-T-PCI (9002) */
+       case 92001: /* Nova-S-Plus (Video and IR) */
+       case 92002: /* Nova-S-Plus (Video and IR) */
+       case 90003: /* Nova-T-PCI (9002 No RF out) */
+       case 90500: /* Nova-T-PCI (oem) */
+       case 90501: /* Nova-T-PCI (oem/IR) */
+       case 92000: /* Nova-SE2 (OEM, No Video or IR) */
+
                /* known */
                break;
        default:
                printk("%s: warning: unknown hauppauge model #%d\n",
-                      core->name, model);
+                      core->name, tv.model);
                break;
        }
 
-       /* Make sure we support the tuner */
-       tuner = ee[0x2d];
-       switch(tuner) {
-       case 0x4B: /* dtt 7595 */
-       case 0x4C: /* dtt 7592 */
-               break;
-       default:
-               printk("%s: error: unknown hauppauge tuner 0x%02x\n",
-                      core->name, tuner);
-               return -ENODEV;
-       }
-       printk(KERN_INFO "%s: hauppauge eeprom: model=%d, tuner=%d\n",
-              core->name, model, tuner);
-       return 0;
+       printk(KERN_INFO "%s: hauppauge eeprom: model=%d\n",
+                       core->name, tv.model);
 }
 
 /* ----------------------------------------------------------------------- */
@@ -1201,7 +1188,7 @@ void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
 
 void cx88_card_setup(struct cx88_core *core)
 {
-       static u8 eeprom[128];
+       static u8 eeprom[256];
 
        if (0 == core->i2c_rc) {
                core->i2c_client.addr = 0xa0 >> 1;
@@ -1224,7 +1211,7 @@ void cx88_card_setup(struct cx88_core *core)
                break;
        case CX88_BOARD_HAUPPAUGE_DVB_T1:
                if (0 == core->i2c_rc)
-                       hauppauge_eeprom_dvb(core,eeprom);
+                       hauppauge_eeprom(core,eeprom);
                break;
        case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
        case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
index eb806af17182ad9c9489ff6008be4f8123f58021..bb6eb54e19ceddcb4726ee9dfc5117baa8c73ef1 100644 (file)
@@ -837,6 +837,29 @@ static int set_pll(struct cx88_core *core, int prescale, u32 ofreq)
        return -1;
 }
 
+int cx88_start_audio_dma(struct cx88_core *core)
+{
+       /* setup fifo + format */
+       cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], 128, 0);
+       cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], 128, 0);
+
+       cx_write(MO_AUDD_LNGTH,    128); /* fifo bpl size */
+       cx_write(MO_AUDR_LNGTH,    128); /* fifo bpl size */
+
+       /* start dma */
+       cx_write(MO_AUD_DMACNTRL, 0x0003); /* Up and Down fifo enable */
+
+       return 0;
+}
+
+int cx88_stop_audio_dma(struct cx88_core *core)
+{
+       /* stop dma */
+       cx_write(MO_AUD_DMACNTRL, 0x0000);
+
+       return 0;
+}
+
 static int set_tvaudio(struct cx88_core *core)
 {
        struct cx88_tvnorm *norm = core->tvnorm;
@@ -877,12 +900,16 @@ static int set_tvaudio(struct cx88_core *core)
        cx88_set_tvaudio(core);
        /* cx88_set_stereo(dev,V4L2_TUNER_MODE_STEREO); */
 
-       cx_write(MO_AUDD_LNGTH,    128); /* fifo size */
-       cx_write(MO_AUDR_LNGTH,    128); /* fifo size */
-       cx_write(MO_AUD_DMACNTRL, 0x03); /* need audio fifo */
+/*
+   This should be needed only on cx88-alsa. It seems that some cx88 chips have
+   bugs and does require DMA enabled for it to work.
+ */
+       cx88_start_audio_dma(core);
        return 0;
 }
 
+
+
 int cx88_set_tvnorm(struct cx88_core *core, struct cx88_tvnorm *norm)
 {
        u32 fsc8;
@@ -1204,6 +1231,8 @@ EXPORT_SYMBOL(cx88_set_scale);
 EXPORT_SYMBOL(cx88_vdev_init);
 EXPORT_SYMBOL(cx88_core_get);
 EXPORT_SYMBOL(cx88_core_put);
+EXPORT_SYMBOL(cx88_start_audio_dma);
+EXPORT_SYMBOL(cx88_stop_audio_dma);
 
 /*
  * Local variables:
index 6d9bec1c583b0ecfb03f28ae70af9c94fb01a238..a1b120c8a9b51f9adc4188f49c420b3b4dc44f8f 100644 (file)
@@ -119,13 +119,10 @@ static void set_audio_registers(struct cx88_core *core, const struct rlist *l)
 
 static void set_audio_start(struct cx88_core *core, u32 mode)
 {
-       // mute
+       /* mute */
        cx_write(AUD_VOL_CTL, (1 << 6));
 
-       // start programming
-       cx_write(MO_AUD_DMACNTRL, 0x0000);
-       msleep(100);
-       //cx_write(AUD_CTL, 0x0000);
+       /* start programming */
        cx_write(AUD_INIT, mode);
        cx_write(AUD_INIT_LD, 0x0001);
        cx_write(AUD_SOFT_RESET, 0x0001);
@@ -135,17 +132,21 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl)
 {
        u32 volume;
 
+       /* restart dma; This avoids buzz in NICAM and is good in others  */
+       cx88_stop_audio_dma(core);
+       cx_write(AUD_RATE_THRES_DMD, 0x000000C0);
+       cx88_start_audio_dma(core);
+
        if (cx88_boards[core->board].blackbird) {
-               // sets sound input from external adc
+               /* sets sound input from external adc */
                cx_set(AUD_CTL, EN_I2SIN_ENABLE);
-               //cx_write(AUD_I2SINPUTCNTL, 0);
                cx_write(AUD_I2SINPUTCNTL, 4);
                cx_write(AUD_BAUDRATE, 1);
-               // 'pass-thru mode': this enables the i2s output to the mpeg encoder
+               /* 'pass-thru mode': this enables the i2s output to the mpeg encoder */
                cx_set(AUD_CTL, EN_I2SOUT_ENABLE);
                cx_write(AUD_I2SOUTPUTCNTL, 1);
                cx_write(AUD_I2SCNTL, 0);
-               //cx_write(AUD_APB_IN_RATE_ADJ, 0);
+               /* cx_write(AUD_APB_IN_RATE_ADJ, 0); */
        } else {
                ctl |= EN_DAC_ENABLE;
                cx_write(AUD_CTL, ctl);
@@ -153,7 +154,6 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl)
 
        /* finish programming */
        cx_write(AUD_SOFT_RESET, 0x0000);
-       cx_write(MO_AUD_DMACNTRL, 0x0003);
 
        /* unmute */
        volume = cx_sread(SHADOW_AUD_VOL_CTL);
@@ -313,7 +313,6 @@ static void set_audio_standard_NICAM(struct cx88_core *core, u32 mode)
                {AUD_RATE_ADJ3, 0x00000100},
                {AUD_RATE_ADJ4, 0x00000400},
                {AUD_RATE_ADJ5, 0x00001000},
-               //{ AUD_DMD_RA_DDS,        0x00c0d5ce },
                {AUD_ERRLOGPERIOD_R, 0x00000fff},
                {AUD_ERRINTRPTTHSHLD1_R, 0x000003ff},
                {AUD_ERRINTRPTTHSHLD2_R, 0x000000ff},
@@ -351,12 +350,12 @@ static void set_audio_standard_NICAM(struct cx88_core *core, u32 mode)
                set_audio_registers(core, nicam_l);
                break;
        case WW_I:
-               dprintk("%s PAL-I NICAM (status: devel)\n", __FUNCTION__);
+               dprintk("%s PAL-I NICAM (status: known-good)\n", __FUNCTION__);
                set_audio_registers(core, nicam_bgdki_common);
                set_audio_registers(core, nicam_i);
                break;
        default:
-               dprintk("%s PAL-BGDK NICAM (status: unknown)\n", __FUNCTION__);
+               dprintk("%s PAL-BGDK NICAM (status: known-good)\n", __FUNCTION__);
                set_audio_registers(core, nicam_bgdki_common);
                set_audio_registers(core, nicam_default);
                break;
@@ -715,8 +714,7 @@ int cx88_detect_nicam(struct cx88_core *core)
                /* if bit1=1 then nicam is detected */
                j += ((cx_read(AUD_NICAM_STATUS2) & 0x02) >> 1);
 
-               /* 3x detected: absolutly sure now */
-               if (j == 3) {
+               if (j == 1) {
                        dprintk("nicam is detected.\n");
                        return 1;
                }
index b19d3a9e22981889dd6bc05aaa77faed5f1e6ab2..27fb080fd7aaa61a999e3ed1a485a5979b8046d4 100644 (file)
@@ -491,6 +491,10 @@ extern struct cx88_core* cx88_core_get(struct pci_dev *pci);
 extern void cx88_core_put(struct cx88_core *core,
                          struct pci_dev *pci);
 
+extern int cx88_start_audio_dma(struct cx88_core *core);
+extern int cx88_stop_audio_dma(struct cx88_core *core);
+
+
 /* ----------------------------------------------------------- */
 /* cx88-vbi.c                                                  */
 
index d54bc0127484547f4908bd3695da352e35b5b947..9f6e5e5355a11bb5b58dbfbea5f3801516533d84 100644 (file)
@@ -32,7 +32,7 @@
 
 /* #define ENABLE_DEBUG_ISOC_FRAMES */
 
-unsigned int core_debug;
+static unsigned int core_debug;
 module_param(core_debug,int,0644);
 MODULE_PARM_DESC(core_debug,"enable debug messages [core]");
 
@@ -41,7 +41,7 @@ MODULE_PARM_DESC(core_debug,"enable debug messages [core]");
                printk(KERN_INFO "%s %s :"fmt, \
                         dev->name, __FUNCTION__ , ##arg); } while (0)
 
-unsigned int reg_debug;
+static unsigned int reg_debug;
 module_param(reg_debug,int,0644);
 MODULE_PARM_DESC(reg_debug,"enable debug messages [URB reg]");
 
@@ -50,7 +50,7 @@ MODULE_PARM_DESC(reg_debug,"enable debug messages [URB reg]");
                printk(KERN_INFO "%s %s :"fmt, \
                         dev->name, __FUNCTION__ , ##arg); } while (0)
 
-unsigned int isoc_debug;
+static unsigned int isoc_debug;
 module_param(isoc_debug,int,0644);
 MODULE_PARM_DESC(isoc_debug,"enable debug messages [isoc transfers]");
 
index 57c1826b928ef2b35c6379f149cba7c194c4e4ff..abec32c175aa0007839f43d60c10926c7949fc4c 100644 (file)
@@ -226,7 +226,7 @@ static int em28xx_config(struct em28xx *dev)
  * em28xx_config_i2c()
  * configure i2c attached devices
  */
-void em28xx_config_i2c(struct em28xx *dev)
+static void em28xx_config_i2c(struct em28xx *dev)
 {
        struct v4l2_frequency f;
        struct video_decoder_init em28xx_vdi = {.data = NULL };
index 801c736e9328a5c1368db10b7bd4318d4b738525..124c502ea1f3ee5f51e73a6446358679a80fa541 100644 (file)
@@ -278,7 +278,7 @@ static int ir_probe(struct i2c_adapter *adap);
 
 static struct i2c_driver driver = {
        .name           = "ir remote kbd driver",
-       .id             = I2C_DRIVERID_EXP3, /* FIXME */
+       .id             = I2C_DRIVERID_I2C_IR,
        .flags          = I2C_DF_NOTIFY,
        .attach_adapter = ir_probe,
        .detach_client  = ir_detach,
index 0235cef07b310a59f1cd0d482daeaed3c56d33f6..e717e30d8187e5cc5927534c147f598589ea1b48 100644 (file)
@@ -771,17 +771,19 @@ static v4l2_std_id saa7115_get_v4lstd(struct i2c_client *client)
 
 static void saa7115_log_status(struct i2c_client *client)
 {
-       static const char * const audclk_freq_strs[] = {
-               "44.1 kHz",
-               "48 kHz",
-               "32 kHz"
-       };
        struct saa7115_state *state = i2c_get_clientdata(client);
+       char *audfreq = "undefined";
        int reg1e, reg1f;
        int signalOk;
        int vcr;
 
-       saa7115_info("Audio frequency: %s\n", audclk_freq_strs[state->audclk_freq]);
+       switch (state->audclk_freq) {
+               case V4L2_AUDCLK_32_KHZ:  audfreq = "32 kHz"; break;
+               case V4L2_AUDCLK_441_KHZ: audfreq = "44.1 kHz"; break;
+               case V4L2_AUDCLK_48_KHZ:  audfreq = "48 kHz"; break;
+       }
+
+       saa7115_info("Audio frequency: %s\n", audfreq);
        if (client->name[6] == '4') {
                /* status for the saa7114 */
                reg1f = saa7115_read(client, 0x1f);
index 25b30f352d84103564e661dca26d6580e5a2afe3..59e13fdea7804381cd9fc35cef3aa4229aa7db8d 100644 (file)
@@ -323,7 +323,7 @@ saa711x_command (struct i2c_client *client,
 
                case VIDEO_MODE_SECAM:
                        saa711x_write(client, 0x08,
-                                     (decoder->reg[0x0e] & 0x3f) | 0x00);
+                                     (decoder->reg[0x08] & 0x3f) | 0x00);
                        saa711x_write(client, 0x0e,
                                      (decoder->reg[0x0e] & 0x8f) | 0x50);
                        break;
index 843431f10e3bf8d1fcdf20c8d0638d0df7b733b7..3428e1ed00329f53a48c7b9620a13205178159e1 100644 (file)
@@ -223,7 +223,7 @@ static const struct i2c_reg_value saa7127_init_config_60hz[] = {
 };
 
 #define SAA7127_50HZ_DAC_CONTROL 0x02
-struct i2c_reg_value saa7127_init_config_50hz[] = {
+static struct i2c_reg_value saa7127_init_config_50hz[] = {
        { SAA7127_REG_BURST_START,                      0x21 },
        /* BURST_END is also used as a chip ID in saa7127_detect_client */
        { SAA7127_REG_BURST_END,                        0x1d },
@@ -696,7 +696,7 @@ static int saa7127_command(struct i2c_client *client,
 
 /* ----------------------------------------------------------------------- */
 
-struct i2c_driver i2c_driver_saa7127;
+static struct i2c_driver i2c_driver_saa7127;
 
 /* ----------------------------------------------------------------------- */
 
@@ -818,7 +818,7 @@ static int saa7127_detach(struct i2c_client *client)
 
 /* ----------------------------------------------------------------------- */
 
-struct i2c_driver i2c_driver_saa7127 = {
+static struct i2c_driver i2c_driver_saa7127 = {
        .name = "saa7127",
        .id = I2C_DRIVERID_SAA7127,
        .flags = I2C_DF_NOTIFY,
index 7bdeabe638cacef344f30fc933fbb9b1fe6c95c7..c512c4411b38319b513b9bc9bfb7ac80bfda2c59 100644 (file)
@@ -42,8 +42,8 @@ config VIDEO_SAA7134_DVB_ALL_FRONTENDS
          If you are unsure, choose Y.
 
 config VIDEO_SAA7134_DVB_MT352
-       tristate "Zarlink MT352 DVB-T Support"
-       default m
+       bool "Zarlink MT352 DVB-T Support"
+       default y
        depends on VIDEO_SAA7134_DVB && !VIDEO_SAA7134_DVB_ALL_FRONTENDS
        select DVB_MT352
        ---help---
@@ -51,8 +51,8 @@ config VIDEO_SAA7134_DVB_MT352
          Philips saa7134 chip and the MT352 demodulator.
 
 config VIDEO_SAA7134_DVB_TDA1004X
-       tristate "Phillips TDA10045H/TDA10046H DVB-T Support"
-       default m
+       bool "Phillips TDA10045H/TDA10046H DVB-T Support"
+       default y
        depends on VIDEO_SAA7134_DVB && !VIDEO_SAA7134_DVB_ALL_FRONTENDS
        select DVB_TDA1004X
        ---help---
@@ -60,8 +60,8 @@ config VIDEO_SAA7134_DVB_TDA1004X
          Philips saa7134 chip and the TDA10045H/TDA10046H demodulator.
 
 config VIDEO_SAA7134_DVB_NXT200X
-       tristate "NXT2002/NXT2004 ATSC Support"
-       default m
+       bool "NXT2002/NXT2004 ATSC Support"
+       default y
        depends on VIDEO_SAA7134_DVB && !VIDEO_SAA7134_DVB_ALL_FRONTENDS
        select DVB_NXT200X
        ---help---
index 4226b61cc613a60d5a67ebdb5851aac26ee06619..134f83a962188f7d8da5b0d45db4c5cb380455a3 100644 (file)
@@ -11,15 +11,10 @@ obj-$(CONFIG_VIDEO_SAA7134_DVB) += saa7134-dvb.o
 EXTRA_CFLAGS += -I$(src)/..
 EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core
 EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/frontends
-ifneq ($(CONFIG_VIDEO_BUF_DVB),n)
- EXTRA_CFLAGS += -DHAVE_VIDEO_BUF_DVB=1
-endif
-ifneq ($(CONFIG_DVB_MT352),n)
- EXTRA_CFLAGS += -DHAVE_MT352=1
-endif
-ifneq ($(CONFIG_DVB_TDA1004X),n)
- EXTRA_CFLAGS += -DHAVE_TDA1004X=1
-endif
-ifneq ($(CONFIG_DVB_NXT200X),n)
- EXTRA_CFLAGS += -DHAVE_NXT200X=1
-endif
+
+extra-cflags-$(CONFIG_VIDEO_BUF_DVB) += -DHAVE_VIDEO_BUF_DVB=1
+extra-cflags-$(CONFIG_DVB_MT352)     += -DHAVE_MT352=1
+extra-cflags-$(CONFIG_DVB_TDA1004X)  += -DHAVE_TDA1004X=1
+extra-cflags-$(CONFIG_DVB_NXT200X)   += -DHAVE_NXT200X=1
+
+EXTRA_CFLAGS += $(extra-cflags-y) $(extra-cflags-m)
index 5707c666660b724c592ea170cdea7a03186d0e81..263c6e2e3e8ec16a63e9ad571b8104d9128517e3 100644 (file)
@@ -58,8 +58,6 @@ static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
 module_param_array(index, int, NULL, 0444);
 MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s).");
 
-int position;
-
 #define dprintk(fmt, arg...)    if (debug) \
         printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ## arg)
 
@@ -140,7 +138,8 @@ static void saa7134_dma_start(struct saa7134_dev *dev)
  *
  */
 
-void saa7134_irq_alsa_done(struct saa7134_dev *dev, unsigned long status)
+static void saa7134_irq_alsa_done(struct saa7134_dev *dev,
+                                 unsigned long status)
 {
        int next_blk, reg = 0;
 
@@ -881,7 +880,7 @@ static void snd_saa7134_free(snd_card_t * card)
  *
  */
 
-int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)
+static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)
 {
 
        snd_card_t *card;
@@ -945,6 +944,8 @@ int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)
        sprintf(card->longname, "%s at 0x%lx irq %d",
                chip->dev->name, chip->iobase, chip->irq);
 
+       printk(KERN_INFO "%s/alsa: %s registered as card %d\n",dev->name,card->longname,index[devnum]);
+
        if ((err = snd_card_register(card)) == 0) {
                snd_saa7134_cards[devnum] = card;
                return 0;
@@ -955,6 +956,22 @@ __nodev:
        return err;
 }
 
+
+static int alsa_device_init(struct saa7134_dev *dev)
+{
+       dev->dmasound.priv_data = dev;
+       alsa_card_saa7134_create(dev,dev->nr);
+       return 1;
+}
+
+static int alsa_device_exit(struct saa7134_dev *dev)
+{
+
+       snd_card_free(snd_saa7134_cards[dev->nr]);
+       snd_saa7134_cards[dev->nr] = NULL;
+       return 1;
+}
+
 /*
  * Module initializer
  *
@@ -968,22 +985,21 @@ static int saa7134_alsa_init(void)
        struct saa7134_dev *dev = NULL;
        struct list_head *list;
 
-       position = 0;
-
         printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n");
 
        list_for_each(list,&saa7134_devlist) {
                dev = list_entry(list, struct saa7134_dev, devlist);
                if (dev->dmasound.priv_data == NULL) {
-                       dev->dmasound.priv_data = dev;
-                       alsa_card_saa7134_create(dev,position);
-                       position++;
+                       alsa_device_init(dev);
                } else {
                        printk(KERN_ERR "saa7134 ALSA: DMA sound is being handled by OSS. ignoring %s\n",dev->name);
                        return -EBUSY;
                }
        }
 
+       dmasound_init = alsa_device_init;
+       dmasound_exit = alsa_device_exit;
+
        if (dev == NULL)
                printk(KERN_INFO "saa7134 ALSA: no saa7134 cards found\n");
 
@@ -994,7 +1010,7 @@ static int saa7134_alsa_init(void)
  * Module destructor
  */
 
-void saa7134_alsa_exit(void)
+static void saa7134_alsa_exit(void)
 {
        int idx;
 
index 4275d2ddb8640af1e02e83b803ba917b5eda0cb1..1a093bf176f325869d607e02b993e09ff1fc6df7 100644 (file)
@@ -88,6 +88,9 @@ LIST_HEAD(saa7134_devlist);
 static LIST_HEAD(mops_list);
 static unsigned int saa7134_devcount;
 
+int (*dmasound_init)(struct saa7134_dev *dev);
+int (*dmasound_exit)(struct saa7134_dev *dev);
+
 #define dprintk(fmt, arg...)   if (core_debug) \
        printk(KERN_DEBUG "%s/core: " fmt, dev->name , ## arg)
 
@@ -184,8 +187,7 @@ void saa7134_track_gpio(struct saa7134_dev *dev, char *msg)
 /* ----------------------------------------------------------- */
 /* delayed request_module                                      */
 
-#ifdef CONFIG_MODULES
-
+#if defined(CONFIG_MODULES) && defined(MODULE)
 static int need_empress;
 static int need_dvb;
 static int need_alsa;
@@ -234,9 +236,7 @@ static void request_module_depend(char *name, int *flag)
 }
 
 #else
-
 #define request_module_depend(name,flag)
-
 #endif /* CONFIG_MODULES */
 
 /* ------------------------------------------------------------------ */
@@ -1017,6 +1017,10 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
        /* check for signal */
        saa7134_irq_video_intl(dev);
 
+       if (dmasound_init && !dev->dmasound.priv_data) {
+               dmasound_init(dev);
+       }
+
        return 0;
 
  fail4:
@@ -1040,6 +1044,11 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev)
        struct list_head *item;
        struct saa7134_mpeg_ops *mops;
 
+       /* Release DMA sound modules if present */
+       if (dmasound_exit && dev->dmasound.priv_data) {
+               dmasound_exit(dev);
+       }
+
        /* debugging ... */
        if (irq_debug) {
                u32 report = saa_readl(SAA7134_IRQ_REPORT);
@@ -1071,6 +1080,7 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev)
        saa7134_i2c_unregister(dev);
        saa7134_unregister_video(dev);
 
+
        /* the DMA sound modules should be unloaded before reaching
           this, but just in case they are still present... */
        if (dev->dmasound.priv_data != NULL) {
@@ -1078,6 +1088,7 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev)
                dev->dmasound.priv_data = NULL;
        }
 
+
        /* release resources */
        free_irq(pci_dev->irq, dev);
        iounmap(dev->lmmio);
@@ -1149,10 +1160,10 @@ static int saa7134_init(void)
 
 static void saa7134_fini(void)
 {
-#ifdef CONFIG_MODULES
+#if defined(CONFIG_MODULES) && defined(MODULE)
        if (pending_registered)
                unregister_module_notifier(&pending_notifier);
-#endif
+#endif /* CONFIG_MODULES */
        pci_unregister_driver(&saa7134_pci_driver);
 }
 
@@ -1168,6 +1179,8 @@ EXPORT_SYMBOL(saa7134_boards);
 
 /* ----------------- for the DMA sound modules --------------- */
 
+EXPORT_SYMBOL(dmasound_init);
+EXPORT_SYMBOL(dmasound_exit);
 EXPORT_SYMBOL(saa7134_pgtable_free);
 EXPORT_SYMBOL(saa7134_pgtable_build);
 EXPORT_SYMBOL(saa7134_pgtable_alloc);
index fd9ed11ab1e29c844649803003ce8dc01e8b3794..5a579194e455af8677ebc0a4b8aa16794d19cf46 100644 (file)
@@ -899,26 +899,26 @@ void saa7134_irq_oss_done(struct saa7134_dev *dev, unsigned long status)
        spin_unlock(&dev->slock);
 }
 
-int saa7134_dsp_create(struct saa7134_dev *dev)
+static int saa7134_dsp_create(struct saa7134_dev *dev)
 {
        int err;
 
-                        err = dev->dmasound.minor_dsp =
-                                register_sound_dsp(&saa7134_dsp_fops,
-                                                   dsp_nr[dev->nr]);
-                        if (err < 0) {
-                                goto fail;
-                        }
-                        printk(KERN_INFO "%s: registered device dsp%d\n",
-                               dev->name,dev->dmasound.minor_dsp >> 4);
-
-                        err = dev->dmasound.minor_mixer =
-                                register_sound_mixer(&saa7134_mixer_fops,
-                                                     mixer_nr[dev->nr]);
-                        if (err < 0)
-                                goto fail;
-                        printk(KERN_INFO "%s: registered device mixer%d\n",
-                               dev->name,dev->dmasound.minor_mixer >> 4);
+       err = dev->dmasound.minor_dsp =
+               register_sound_dsp(&saa7134_dsp_fops,
+                                       dsp_nr[dev->nr]);
+       if (err < 0) {
+               goto fail;
+       }
+       printk(KERN_INFO "%s: registered device dsp%d\n",
+               dev->name,dev->dmasound.minor_dsp >> 4);
+
+       err = dev->dmasound.minor_mixer =
+               register_sound_mixer(&saa7134_mixer_fops,
+                                       mixer_nr[dev->nr]);
+       if (err < 0)
+               goto fail;
+       printk(KERN_INFO "%s: registered device mixer%d\n",
+               dev->name,dev->dmasound.minor_mixer >> 4);
 
        return 0;
 
@@ -929,6 +929,31 @@ fail:
 
 }
 
+static int oss_device_init(struct saa7134_dev *dev)
+{
+       dev->dmasound.priv_data = dev;
+       saa7134_oss_init1(dev);
+       saa7134_dsp_create(dev);
+       return 1;
+}
+
+static int oss_device_exit(struct saa7134_dev *dev)
+{
+
+       unregister_sound_mixer(dev->dmasound.minor_mixer);
+       unregister_sound_dsp(dev->dmasound.minor_dsp);
+
+       saa7134_oss_fini(dev);
+
+       if (dev->pci->irq > 0) {
+               synchronize_irq(dev->pci->irq);
+               free_irq(dev->pci->irq,&dev->dmasound);
+       }
+
+       dev->dmasound.priv_data = NULL;
+       return 1;
+}
+
 static int saa7134_oss_init(void)
 {
         struct saa7134_dev *dev = NULL;
@@ -939,9 +964,7 @@ static int saa7134_oss_init(void)
         list_for_each(list,&saa7134_devlist) {
                 dev = list_entry(list, struct saa7134_dev, devlist);
                if (dev->dmasound.priv_data == NULL) {
-                       dev->dmasound.priv_data = dev;
-                       saa7134_oss_init1(dev);
-                       saa7134_dsp_create(dev);
+                       oss_device_init(dev);
                } else {
                        printk(KERN_ERR "saa7134 OSS: DMA sound is being handled by ALSA, ignoring %s\n",dev->name);
                        return -EBUSY;
@@ -951,11 +974,14 @@ static int saa7134_oss_init(void)
         if (dev == NULL)
                 printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n");
 
+       dmasound_init = oss_device_init;
+       dmasound_exit = oss_device_exit;
+
         return 0;
 
 }
 
-void saa7134_oss_exit(void)
+static void saa7134_oss_exit(void)
 {
         struct saa7134_dev *dev = NULL;
         struct list_head *list;
@@ -967,18 +993,7 @@ void saa7134_oss_exit(void)
                if (!dev->dmasound.minor_dsp)
                        continue;
 
-                unregister_sound_mixer(dev->dmasound.minor_mixer);
-                unregister_sound_dsp(dev->dmasound.minor_dsp);
-
-               saa7134_oss_fini(dev);
-
-               if (dev->pci->irq > 0) {
-                       synchronize_irq(dev->pci->irq);
-                       free_irq(dev->pci->irq,&dev->dmasound);
-               }
-
-               dev->dmasound.priv_data = NULL;
-
+               oss_device_exit(dev);
         }
 
         printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n");
index 244e1973081cc2e8ca64de7638ec218423f504c0..add49db1ad41130d9d39408cdcd8975ff0f9c869 100644 (file)
@@ -571,6 +571,10 @@ void saa7134_dma_free(struct saa7134_dev *dev,struct saa7134_buf *buf);
 
 int saa7134_set_dmabits(struct saa7134_dev *dev);
 
+extern int (*dmasound_init)(struct saa7134_dev *dev);
+extern int (*dmasound_exit)(struct saa7134_dev *dev);
+
+
 /* ----------------------------------------------------------- */
 /* saa7134-cards.c                                             */
 
index 72e8741e8b595e2d4817b056ff1c87c21ab7c158..d95aecebbda318b14278056d5e56478093428928 100644 (file)
@@ -81,7 +81,7 @@ hauppauge_tuner_fmt[] =
        { 0x00000010, " PAL(I)" },
        { 0x00400000, " SECAM(L/L')" },
        { 0x00000e00, " PAL(D/K)" },
-       { 0x03000000, " ATSC Digital" },
+       { 0x03000000, " ATSC/DVB Digital" },
 };
 
 /* This is the full list of possible tuners. Many thanks to Hauppauge for
@@ -209,13 +209,27 @@ hauppauge_tuner[] =
        { TUNER_ABSENT,        "Philips FMD1216ME"},
        { TUNER_TEA5767,       "Philips TEA5768HL FM Radio"},
        { TUNER_ABSENT,        "Panasonic ENV57H12D5"},
-       { TUNER_ABSENT,        "TCL MFNM05-4"},
+       { TUNER_PHILIPS_FM1236_MK3, "TCL MFNM05-4"},
        { TUNER_ABSENT,        "TCL MNM05-4"},
        { TUNER_PHILIPS_FM1216ME_MK3, "TCL MPE05-2"},
        { TUNER_ABSENT,        "TCL MQNM05-4"},
        { TUNER_ABSENT,        "LG TAPC-W701D"},
        { TUNER_ABSENT,        "TCL 9886P-WM"},
        { TUNER_ABSENT,        "TCL 1676NM-WM"},
+       /* 110-119 */
+       { TUNER_ABSENT,        "Thompson DTT75105"},
+       { TUNER_ABSENT,        "Conexant_CX24109"},
+       { TUNER_ABSENT,        "TCL M2523_5N_E"},
+       { TUNER_ABSENT,        "TCL M2523_3DB_E"},
+       { TUNER_ABSENT,        "Philips 8275A"},
+       { TUNER_ABSENT,        "Microtune MT2060"},
+       { TUNER_ABSENT,        "Philips FM1236 MK5"},
+       { TUNER_ABSENT,        "Philips FM1216ME MK5"},
+       { TUNER_ABSENT,        "TCL M2523_3DI_E"},
+       { TUNER_ABSENT,        "Samsung THPD5222FG30A"},
+       /* 120-129 */
+       { TUNER_ABSENT,        "Xceive XC3028"},
+       { TUNER_ABSENT,        "Philips FQ1216LME MK5"},
 };
 
 static struct HAUPPAUGE_AUDIOIC
@@ -325,6 +339,7 @@ static int hasRadioTuner(int tunerType)
                case 78: //PNPEnv_TUNER_TDA8275C1_8290_FM:
                case 89: //PNPEnv_TUNER_TCL_MFPE05_2:
                case 92: //PNPEnv_TUNER_PHILIPS_FQ1236A_MK4:
+               case 105:
                return 1;
        }
        return 0;
@@ -368,10 +383,15 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
        memset(tvee, 0, sizeof(*tvee));
        done = len = beenhere = 0;
 
-       /* Hack for processing eeprom for em28xx */
-       if ((eeprom_data[0]==0x1a)&&(eeprom_data[1]==0xeb)&&
-                               (eeprom_data[2]==0x67)&&(eeprom_data[3]==0x95))
-               start=0xa0;
+       /* Hack for processing eeprom for em28xx and cx 2388x*/
+       if ((eeprom_data[0] == 0x1a) && (eeprom_data[1] == 0xeb) &&
+                       (eeprom_data[2] == 0x67) && (eeprom_data[3] == 0x95))
+               start=0xa0; /* Generic em28xx offset */
+       else if (((eeprom_data[0] & 0xf0) == 0x10) &&
+                                       (eeprom_data[1] == 0x00) &&
+                                       (eeprom_data[2] == 0x00) &&
+                                       (eeprom_data[8] == 0x84))
+               start=8; /* Generic cx2388x offset */
        else
                start=0;
 
@@ -448,6 +468,17 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
                                eeprom_data[i+5] +
                                (eeprom_data[i+6] << 8) +
                                (eeprom_data[i+7] << 16);
+
+                               if ( (eeprom_data[i + 8] && 0xf0) &&
+                                       (tvee->serial_number < 0xffffff) ) {
+                                       tvee->MAC_address[0] = 0x00;
+                                       tvee->MAC_address[1] = 0x0D;
+                                       tvee->MAC_address[2] = 0xFE;
+                                       tvee->MAC_address[3] = eeprom_data[i + 7];
+                                       tvee->MAC_address[4] = eeprom_data[i + 6];
+                                       tvee->MAC_address[5] = eeprom_data[i + 5];
+                                       tvee->has_MAC_address = 1;
+                               }
                        break;
 
                case 0x05:
@@ -466,11 +497,14 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
                case 0x06:
                        /* tag 'ModelRev' */
                        tvee->model =
-                               eeprom_data[i+1] +
-                               (eeprom_data[i+2] << 8);
-                       tvee->revision = eeprom_data[i+5] +
-                               (eeprom_data[i+6] << 8) +
-                               (eeprom_data[i+7] << 16);
+                               eeprom_data[i + 1] +
+                               (eeprom_data[i + 2] << 8) +
+                               (eeprom_data[i + 3] << 16) +
+                               (eeprom_data[i + 4] << 24);
+                       tvee->revision =
+                               eeprom_data[i +5 ] +
+                               (eeprom_data[i + 6] << 8) +
+                               (eeprom_data[i + 7] << 16);
                        break;
 
                case 0x07:
@@ -563,6 +597,8 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
                t_name2 = "unknown";
        }
 
+       tvee->tuner_hauppauge_model = tuner1;
+       tvee->tuner2_hauppauge_model = tuner2;
        tvee->tuner_formats = 0;
        tvee->tuner2_formats = 0;
        for (i = j = 0; i < 8; i++) {
@@ -578,6 +614,12 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
 
        tveeprom_info("Hauppauge model %d, rev %s, serial# %d\n",
                tvee->model, tvee->rev_str, tvee->serial_number);
+       if (tvee->has_MAC_address == 1) {
+               tveeprom_info("MAC address is %02X-%02X-%02X-%02X-%02X-%02X\n",
+                       tvee->MAC_address[0], tvee->MAC_address[1],
+                       tvee->MAC_address[2], tvee->MAC_address[3],
+                       tvee->MAC_address[4], tvee->MAC_address[5]);
+       }
        tveeprom_info("tuner model is %s (idx %d, type %d)\n",
                t_name1, tuner1, tvee->tuner_type);
        tveeprom_info("TV standards%s%s%s%s%s%s%s%s (eeprom 0x%02x)\n",
index acfd3a103f35ccdfa6cf31c44877d1f217262679..9a6bf287e26ae629497aa0e9c3c206281e817a41 100644 (file)
@@ -753,10 +753,9 @@ videobuf_read_zerocopy(struct videobuf_queue *q, char __user *data,
        int retval;
 
        /* setup stuff */
-       retval = -ENOMEM;
        q->read_buf = videobuf_alloc(q->msize);
        if (NULL == q->read_buf)
-               goto done;
+               return -ENOMEM;
 
        q->read_buf->memory = V4L2_MEMORY_USERPTR;
        q->read_buf->baddr  = (unsigned long)data;
@@ -817,10 +816,14 @@ ssize_t videobuf_read_one(struct videobuf_queue *q,
                if (NULL == q->read_buf)
                        goto done;
                q->read_buf->memory = V4L2_MEMORY_USERPTR;
+               q->read_buf->bsize = count; /* preferred size */
                field = videobuf_next_field(q);
                retval = q->ops->buf_prepare(q,q->read_buf,field);
-               if (0 != retval)
+               if (0 != retval) {
+                       kfree (q->read_buf);
+                       q->read_buf = NULL;
                        goto done;
+               }
                spin_lock_irqsave(q->irqlock,flags);
                q->ops->buf_queue(q,q->read_buf);
                spin_unlock_irqrestore(q->irqlock,flags);
index 83c49f9610d0b0bff75209c556eed46062f01d70..6de5b0094b8253bd4a0b1dafc4822f43a1d1f982 100644 (file)
@@ -76,14 +76,14 @@ static void video_release(struct class_device *cd)
 }
 
 static struct class video_class = {
-        .name    = VIDEO_NAME,
+       .name    = VIDEO_NAME,
        .release = video_release,
 };
 
 /*
- *     Active devices 
+ *     Active devices
  */
+
 static struct video_device *video_device[VIDEO_NUM_DEVICES];
 static DECLARE_MUTEX(videodev_lock);
 
@@ -101,7 +101,7 @@ static int video_open(struct inode *inode, struct file *file)
        int err = 0;
        struct video_device *vfl;
        struct file_operations *old_fops;
-       
+
        if(minor>=VIDEO_NUM_DEVICES)
                return -ENODEV;
        down(&videodev_lock);
@@ -189,7 +189,7 @@ video_usercopy(struct inode *inode, struct file *file,
                                return -ENOMEM;
                        parg = mbuf;
                }
-               
+
                err = -EFAULT;
                if (_IOC_DIR(cmd) & _IOC_WRITE)
                        if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd)))
@@ -240,7 +240,7 @@ int video_exclusive_open(struct inode *inode, struct file *file)
 int video_exclusive_release(struct inode *inode, struct file *file)
 {
        struct  video_device *vfl = video_devdata(file);
-       
+
        vfl->users--;
        return 0;
 }
@@ -253,7 +253,7 @@ static struct file_operations video_fops;
  *     @type: type of device to register
  *     @nr:   which device number (0 == /dev/video0, 1 == /dev/video1, ...
  *             -1 == first free)
- *     
+ *
  *     The registration code assigns minor numbers based on the type
  *     requested. -ENFILE is returned in all the device slots for this
  *     category are full. If not then the minor field is set and the
@@ -269,7 +269,7 @@ static struct file_operations video_fops;
  *
  *     %VFL_TYPE_VBI - Vertical blank data (undecoded)
  *
- *     %VFL_TYPE_RADIO - A radio card  
+ *     %VFL_TYPE_RADIO - A radio card
  */
 
 int video_register_device(struct video_device *vfd, int type, int nr)
@@ -278,7 +278,7 @@ int video_register_device(struct video_device *vfd, int type, int nr)
        int base;
        int end;
        char *name_base;
-       
+
        switch(type)
        {
                case VFL_TYPE_GRABBER:
@@ -293,7 +293,7 @@ int video_register_device(struct video_device *vfd, int type, int nr)
                        break;
                case VFL_TYPE_VBI:
                        base=224;
-                       end=240;
+                       end=256;
                        name_base = "vbi";
                        break;
                case VFL_TYPE_RADIO:
@@ -334,7 +334,7 @@ int video_register_device(struct video_device *vfd, int type, int nr)
        init_MUTEX(&vfd->lock);
 
        /* sysfs class */
-        memset(&vfd->class_dev, 0x00, sizeof(vfd->class_dev));
+       memset(&vfd->class_dev, 0x00, sizeof(vfd->class_dev));
        if (vfd->dev)
                vfd->class_dev.dev = vfd->dev;
        vfd->class_dev.class       = &video_class;
@@ -360,7 +360,7 @@ int video_register_device(struct video_device *vfd, int type, int nr)
  *     This unregisters the passed device and deassigns the minor
  *     number. Future open calls will be met with errors.
  */
+
 void video_unregister_device(struct video_device *vfd)
 {
        down(&videodev_lock);
@@ -384,7 +384,7 @@ static struct file_operations video_fops=
 /*
  *     Initialise video for linux
  */
+
 static int __init videodev_init(void)
 {
        int ret;
index 74022316fc63403392c7783ac13fc8226e098ceb..65c2ec5c421bfb98048925ef1330b6f147113b9b 100644 (file)
@@ -91,9 +91,9 @@ static int mfcounter = 0;
  *  Public data...
  */
 int mpt_lan_index = -1;
-static int mpt_stm_index = -1;
+int mpt_stm_index = -1;
 
-static struct proc_dir_entry *mpt_proc_root_dir;
+struct proc_dir_entry *mpt_proc_root_dir;
 
 #define WHOINIT_UNKNOWN                0xAA
 
@@ -6271,6 +6271,7 @@ EXPORT_SYMBOL(mpt_resume);
 EXPORT_SYMBOL(mpt_suspend);
 #endif
 EXPORT_SYMBOL(ioc_list);
+EXPORT_SYMBOL(mpt_proc_root_dir);
 EXPORT_SYMBOL(mpt_register);
 EXPORT_SYMBOL(mpt_deregister);
 EXPORT_SYMBOL(mpt_event_register);
@@ -6288,6 +6289,7 @@ EXPORT_SYMBOL(mpt_verify_adapter);
 EXPORT_SYMBOL(mpt_GetIocState);
 EXPORT_SYMBOL(mpt_print_ioc_summary);
 EXPORT_SYMBOL(mpt_lan_index);
+EXPORT_SYMBOL(mpt_stm_index);
 EXPORT_SYMBOL(mpt_HardResetHandler);
 EXPORT_SYMBOL(mpt_config);
 EXPORT_SYMBOL(mpt_toolbox);
index 8ad277a9afa16a37906045a522a7b9ca4e21a7f4..5f5b3fb5b4d7cac8f5ec55d58644e7f98d361645 100644 (file)
@@ -1006,8 +1006,10 @@ extern int        mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode);
  *  Public data decl's...
  */
 extern struct list_head          ioc_list;
+extern struct proc_dir_entry   *mpt_proc_root_dir;
 
 extern int               mpt_lan_index;        /* needed by mptlan.c */
+extern int               mpt_stm_index;        /* needed by mptstm.c */
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 #endif         /* } __KERNEL__ */
index da528390acf87293292237abddf2bf5cf66b600c..d336a1d65dc7ec0ec165a62218840640207fdaf0 100644 (file)
@@ -816,7 +816,7 @@ static void mmc_discover_cards(struct mmc_host *host)
 
                        cmd.opcode = SD_SEND_RELATIVE_ADDR;
                        cmd.arg = 0;
-                       cmd.flags = MMC_RSP_R1;
+                       cmd.flags = MMC_RSP_R6;
 
                        err = mmc_wait_for_cmd(host, &cmd, CMD_RETRIES);
                        if (err != MMC_ERR_NONE)
index 143f01a4c1705343a2406c53f1aff0f71b4feb28..69c04945591f935e72a6416dc55a3d09201c6b0a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * (C) 2000 Red Hat. GPL'd
  *
- * $Id: cfi_cmdset_0001.c,v 1.185 2005/11/07 11:14:22 gleixner Exp $
+ * $Id: cfi_cmdset_0001.c,v 1.186 2005/11/23 22:07:52 nico Exp $
  *
  *
  * 10/10/2000  Nicolas Pitre <nico@cam.org>
@@ -644,9 +644,8 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
                 *
                 * - contension arbitration is handled in the owner's context.
                 *
-                * The 'shared' struct can be read when its lock is taken.
-                * However any writes to it can only be made when the current
-                * owner's lock is also held.
+                * The 'shared' struct can be read and/or written only when
+                * its lock is taken.
                 */
                struct flchip_shared *shared = chip->priv;
                struct flchip *contender;
@@ -675,14 +674,13 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
                        }
                        timeo = jiffies + HZ;
                        spin_lock(&shared->lock);
+                       spin_unlock(contender->mutex);
                }
 
                /* We now own it */
                shared->writing = chip;
                if (mode == FL_ERASING)
                        shared->erasing = chip;
-               if (contender && contender != chip)
-                       spin_unlock(contender->mutex);
                spin_unlock(&shared->lock);
        }
 
index 90eb30e06b7c9322fd4e71b81a794976d5f95c4a..e636aa86bc24825dca9278511e5c38e82a00f4fb 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Common Flash Interface probe code.
    (C) 2000 Red Hat. GPL'd.
-   $Id: cfi_probe.c,v 1.84 2005/11/07 11:14:23 gleixner Exp $
+   $Id: cfi_probe.c,v 1.86 2005/11/29 14:48:31 gleixner Exp $
 */
 
 #include <linux/config.h>
@@ -230,8 +230,8 @@ static int __xipram cfi_chip_setup(struct map_info *map,
        cfi_send_gen_cmd(0xaa, 0x555, base, map, cfi, cfi->device_type, NULL);
        cfi_send_gen_cmd(0x55, 0x2aa, base, map, cfi, cfi->device_type, NULL);
        cfi_send_gen_cmd(0x90, 0x555, base, map, cfi, cfi->device_type, NULL);
-       cfi->mfr = cfi_read_query(map, base);
-       cfi->id = cfi_read_query(map, base + ofs_factor);
+       cfi->mfr = cfi_read_query16(map, base);
+       cfi->id = cfi_read_query16(map, base + ofs_factor);
 
        /* Put it back into Read Mode */
        cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
@@ -426,7 +426,7 @@ static struct mtd_chip_driver cfi_chipdrv = {
        .module         = THIS_MODULE
 };
 
-int __init cfi_probe_init(void)
+static int __init cfi_probe_init(void)
 {
        register_mtd_chip_driver(&cfi_chipdrv);
        return 0;
index 2d26bdef82d5c9fe4fe64ad4406719edcb5b12c0..36f61a6a766e64b1421cb5d0c11a660a2924d33c 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright 2000,2001 David A. Schleef <ds@schleef.org>
  *           2000,2001 Lineo, Inc.
  *
- * $Id: sharp.c,v 1.16 2005/11/07 11:14:23 gleixner Exp $
+ * $Id: sharp.c,v 1.17 2005/11/29 14:28:28 gleixner Exp $
  *
  * Devices supported:
  *   LH28F016SCT Symmetrical block flash memory, 2Mx8
@@ -160,22 +160,28 @@ struct mtd_info *sharp_probe(struct map_info *map)
        return mtd;
 }
 
+static inline void sharp_send_cmd(struct map_info *map, unsigned long cmd, unsigned long adr)
+{
+       map_word map_cmd;
+       map_cmd.x[0] = cmd;
+       map_write(map, map_cmd, adr);
+}
+
 static int sharp_probe_map(struct map_info *map,struct mtd_info *mtd)
 {
-       unsigned long tmp;
+       map_word tmp, read0, read4;
        unsigned long base = 0;
-       u32 read0, read4;
        int width = 4;
 
-       tmp = map_read32(map, base+0);
+       tmp = map_read(map, base+0);
 
-       map_write32(map, CMD_READ_ID, base+0);
+       sharp_send_cmd(map, CMD_READ_ID, base+0);
 
-       read0=map_read32(map, base+0);
-       read4=map_read32(map, base+4);
-       if(read0 == 0x89898989){
+       read0 = map_read(map, base+0);
+       read4 = map_read(map, base+4);
+       if(read0.x[0] == 0x89898989){
                printk("Looks like sharp flash\n");
-               switch(read4){
+               switch(read4.x[0]){
                case 0xaaaaaaaa:
                case 0xa0a0a0a0:
                        /* aa - LH28F016SCT-L95 2Mx8, 32 64k blocks*/
@@ -197,16 +203,16 @@ static int sharp_probe_map(struct map_info *map,struct mtd_info *mtd)
                        return width;
 #endif
                default:
-                       printk("Sort-of looks like sharp flash, 0x%08x 0x%08x\n",
-                               read0,read4);
+                       printk("Sort-of looks like sharp flash, 0x%08lx 0x%08lx\n",
+                               read0.x[0], read4.x[0]);
                }
-       }else if((map_read32(map, base+0) == CMD_READ_ID)){
+       }else if((map_read(map, base+0).x[0] == CMD_READ_ID)){
                /* RAM, probably */
                printk("Looks like RAM\n");
-               map_write32(map, tmp, base+0);
+               map_write(map, tmp, base+0);
        }else{
-               printk("Doesn't look like sharp flash, 0x%08x 0x%08x\n",
-                       read0,read4);
+               printk("Doesn't look like sharp flash, 0x%08lx 0x%08lx\n",
+                       read0.x[0], read4.x[0]);
        }
 
        return 0;
@@ -215,7 +221,8 @@ static int sharp_probe_map(struct map_info *map,struct mtd_info *mtd)
 /* This function returns with the chip->mutex lock held. */
 static int sharp_wait(struct map_info *map, struct flchip *chip)
 {
-       int status, i;
+       int i;
+       map_word status;
        unsigned long timeo = jiffies + HZ;
        DECLARE_WAITQUEUE(wait, current);
        int adr = 0;
@@ -225,12 +232,12 @@ retry:
 
        switch(chip->state){
        case FL_READY:
-               map_write32(map,CMD_READ_STATUS,adr);
+               sharp_send_cmd(map, CMD_READ_STATUS, adr);
                chip->state = FL_STATUS;
        case FL_STATUS:
                for(i=0;i<100;i++){
-                       status = map_read32(map,adr);
-                       if((status & SR_READY)==SR_READY)
+                       status = map_read(map, adr);
+                       if((status.x[0] & SR_READY)==SR_READY)
                                break;
                        udelay(1);
                }
@@ -254,7 +261,7 @@ retry:
                goto retry;
        }
 
-       map_write32(map,CMD_RESET, adr);
+       sharp_send_cmd(map, CMD_RESET, adr);
 
        chip->state = FL_READY;
 
@@ -351,37 +358,39 @@ static int sharp_write_oneword(struct map_info *map, struct flchip *chip,
        int timeo;
        int try;
        int i;
-       int status = 0;
+       map_word data, status;
 
+       status.x[0] = 0;
        ret = sharp_wait(map,chip);
 
        for(try=0;try<10;try++){
-               map_write32(map,CMD_BYTE_WRITE,adr);
+               sharp_send_cmd(map, CMD_BYTE_WRITE, adr);
                /* cpu_to_le32 -> hack to fix the writel be->le conversion */
-               map_write32(map,cpu_to_le32(datum),adr);
+               data.x[0] = cpu_to_le32(datum);
+               map_write(map, data, adr);
 
                chip->state = FL_WRITING;
 
                timeo = jiffies + (HZ/2);
 
-               map_write32(map,CMD_READ_STATUS,adr);
+               sharp_send_cmd(map, CMD_READ_STATUS, adr);
                for(i=0;i<100;i++){
-                       status = map_read32(map,adr);
-                       if((status & SR_READY)==SR_READY)
+                       status = map_read(map, adr);
+                       if((status.x[0] & SR_READY) == SR_READY)
                                break;
                }
                if(i==100){
                        printk("sharp: timed out writing\n");
                }
 
-               if(!(status&SR_ERRORS))
+               if(!(status.x[0] & SR_ERRORS))
                        break;
 
-               printk("sharp: error writing byte at addr=%08lx status=%08x\n",adr,status);
+               printk("sharp: error writing byte at addr=%08lx status=%08lx\n", adr, status.x[0]);
 
-               map_write32(map,CMD_CLEAR_STATUS,adr);
+               sharp_send_cmd(map, CMD_CLEAR_STATUS, adr);
        }
-       map_write32(map,CMD_RESET,adr);
+       sharp_send_cmd(map, CMD_RESET, adr);
        chip->state = FL_READY;
 
        wake_up(&chip->wq);
@@ -434,18 +443,18 @@ static int sharp_do_wait_for_ready(struct map_info *map, struct flchip *chip,
 {
        int ret;
        unsigned long timeo;
-       int status;
+       map_word status;
        DECLARE_WAITQUEUE(wait, current);
 
-       map_write32(map,CMD_READ_STATUS,adr);
-       status = map_read32(map,adr);
+       sharp_send_cmd(map, CMD_READ_STATUS, adr);
+       status = map_read(map, adr);
 
        timeo = jiffies + HZ;
 
        while(time_before(jiffies, timeo)){
-               map_write32(map,CMD_READ_STATUS,adr);
-               status = map_read32(map,adr);
-               if((status & SR_READY)==SR_READY){
+               sharp_send_cmd(map, CMD_READ_STATUS, adr);
+               status = map_read(map, adr);
+               if((status.x[0] & SR_READY)==SR_READY){
                        ret = 0;
                        goto out;
                }
@@ -476,7 +485,7 @@ static int sharp_erase_oneblock(struct map_info *map, struct flchip *chip,
 {
        int ret;
        //int timeo;
-       int status;
+       map_word status;
        //int i;
 
 //printk("sharp_erase_oneblock()\n");
@@ -486,26 +495,26 @@ static int sharp_erase_oneblock(struct map_info *map, struct flchip *chip,
        sharp_unlock_oneblock(map,chip,adr);
 #endif
 
-       map_write32(map,CMD_BLOCK_ERASE_1,adr);
-       map_write32(map,CMD_BLOCK_ERASE_2,adr);
+       sharp_send_cmd(map, CMD_BLOCK_ERASE_1, adr);
+       sharp_send_cmd(map, CMD_BLOCK_ERASE_2, adr);
 
        chip->state = FL_ERASING;
 
        ret = sharp_do_wait_for_ready(map,chip,adr);
        if(ret<0)return ret;
 
-       map_write32(map,CMD_READ_STATUS,adr);
-       status = map_read32(map,adr);
+       sharp_send_cmd(map, CMD_READ_STATUS, adr);
+       status = map_read(map, adr);
 
-       if(!(status&SR_ERRORS)){
-               map_write32(map,CMD_RESET,adr);
+       if(!(status.x[0] & SR_ERRORS)){
+               sharp_send_cmd(map, CMD_RESET, adr);
                chip->state = FL_READY;
                //spin_unlock_bh(chip->mutex);
                return 0;
        }
 
-       printk("sharp: error erasing block at addr=%08lx status=%08x\n",adr,status);
-       map_write32(map,CMD_CLEAR_STATUS,adr);
+       printk("sharp: error erasing block at addr=%08lx status=%08lx\n", adr, status.x[0]);
+       sharp_send_cmd(map, CMD_CLEAR_STATUS, adr);
 
        //spin_unlock_bh(chip->mutex);
 
@@ -517,20 +526,20 @@ static void sharp_unlock_oneblock(struct map_info *map, struct flchip *chip,
        unsigned long adr)
 {
        int i;
-       int status;
+       map_word status;
 
-       map_write32(map,CMD_CLEAR_BLOCK_LOCKS_1,adr);
-       map_write32(map,CMD_CLEAR_BLOCK_LOCKS_2,adr);
+       sharp_send_cmd(map, CMD_CLEAR_BLOCK_LOCKS_1, adr);
+       sharp_send_cmd(map, CMD_CLEAR_BLOCK_LOCKS_2, adr);
 
        udelay(100);
 
-       status = map_read32(map,adr);
-       printk("status=%08x\n",status);
+       status = map_read(map, adr);
+       printk("status=%08lx\n", status.x[0]);
 
        for(i=0;i<1000;i++){
-               //map_write32(map,CMD_READ_STATUS,adr);
-               status = map_read32(map,adr);
-               if((status & SR_READY)==SR_READY)
+               //sharp_send_cmd(map, CMD_READ_STATUS, adr);
+               status = map_read(map, adr);
+               if((status.x[0] & SR_READY) == SR_READY)
                        break;
                udelay(100);
        }
@@ -538,14 +547,14 @@ static void sharp_unlock_oneblock(struct map_info *map, struct flchip *chip,
                printk("sharp: timed out unlocking block\n");
        }
 
-       if(!(status&SR_ERRORS)){
-               map_write32(map,CMD_RESET,adr);
+       if(!(status.x[0] & SR_ERRORS)){
+               sharp_send_cmd(map, CMD_RESET, adr);
                chip->state = FL_READY;
                return;
        }
 
-       printk("sharp: error unlocking block at addr=%08lx status=%08x\n",adr,status);
-       map_write32(map,CMD_CLEAR_STATUS,adr);
+       printk("sharp: error unlocking block at addr=%08lx status=%08lx\n", adr, status.x[0]);
+       sharp_send_cmd(map, CMD_CLEAR_STATUS, adr);
 }
 #endif
 
index 0aaa0ced9aba0acd7d5105d16a4fe90b4323be73..7ff403b2a0a056588ff97c3963211cc708ff0e98 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: block2mtd.c,v 1.29 2005/11/07 11:14:24 gleixner Exp $
+ * $Id: block2mtd.c,v 1.30 2005/11/29 14:48:32 gleixner Exp $
  *
  * block2mtd.c - create an mtd from a block device
  *
@@ -19,7 +19,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/buffer_head.h>
 
-#define VERSION "$Revision: 1.29 $"
+#define VERSION "$Revision: 1.30 $"
 
 
 #define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args)
@@ -40,7 +40,7 @@ static LIST_HEAD(blkmtd_device_list);
 
 
 #define PAGE_READAHEAD 64
-void cache_readahead(struct address_space *mapping, int index)
+static void cache_readahead(struct address_space *mapping, int index)
 {
        filler_t *filler = (filler_t*)mapping->a_ops->readpage;
        int i, pagei;
index f5026cee087fa22925365d0b662267ba1b73f8e9..0ff2e4378244c0603a39a03bd40664d207ec7c7a 100644 (file)
@@ -6,7 +6,7 @@
  *     as published by the Free Software Foundation; either version
  *     2 of the License, or (at your option) any later version.
  *
- *     $Id: ms02-nv.c,v 1.10 2005/06/20 12:24:41 macro Exp $
+ *     $Id: ms02-nv.c,v 1.11 2005/11/14 13:41:47 macro Exp $
  */
 
 #include <linux/init.h>
@@ -293,13 +293,13 @@ static int __init ms02nv_init(void)
 
        switch (mips_machtype) {
        case MACH_DS5000_200:
-               csr = (volatile u32 *)KN02_CSR_BASE;
+               csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CSR);
                if (*csr & KN02_CSR_BNK32M)
                        stride = 2;
                break;
        case MACH_DS5000_2X0:
        case MACH_DS5900:
-               csr = (volatile u32 *)KN03_MCR_BASE;
+               csr = (volatile u32 *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_MCR);
                if (*csr & KN03_MCR_BNK32M)
                        stride = 2;
                break;
index de7e231d6d180deb3528caeb62593555ba09f363..8a878b34eca0b34c090f2ec41f6c72d41d4f307c 100644 (file)
@@ -1,5 +1,5 @@
 /* This version ported to the Linux-MTD system by dwmw2@infradead.org
- * $Id: ftl.c,v 1.58 2005/11/07 11:14:19 gleixner Exp $
+ * $Id: ftl.c,v 1.59 2005/11/29 14:48:31 gleixner Exp $
  *
  * Fixes: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  * - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups
@@ -1084,9 +1084,9 @@ struct mtd_blktrans_ops ftl_tr = {
        .owner          = THIS_MODULE,
 };
 
-int init_ftl(void)
+static int init_ftl(void)
 {
-       DEBUG(0, "$Id: ftl.c,v 1.58 2005/11/07 11:14:19 gleixner Exp $\n");
+       DEBUG(0, "$Id: ftl.c,v 1.59 2005/11/29 14:48:31 gleixner Exp $\n");
 
        return register_mtd_blktrans(&ftl_tr);
 }
index 846a533323a8ee845da72d8299b6425f6a47ffcd..452ccd5037c3638e4f6d6fcc5ed21ba09b8b9b4f 100644 (file)
@@ -538,12 +538,6 @@ config MTD_MPC1211
          This enables access to the flash chips on the Interface MPC-1211(CTP/PCI/MPC-SH02).
          If you have such a board, say 'Y'.
 
-config MTD_PQ2FADS
-       tristate "JEDEC flash SIMM mapped on PQ2FADS and 8272ADS boards"
-       depends on (ADS8272 || PQ2FADS) && MTD_PARTITIONS && MTD_JEDECPROBE && MTD_PHYSMAP && MTD_CFI_GEOMETRY && MTD_CFI_INTELEXT
-       help
-        This enables access to flash SIMM on PQ2FADS-like boards
-
 config MTD_OMAP_NOR
        tristate "TI OMAP board mappings"
        depends on MTD_CFI && ARCH_OMAP
index 7d9e940a1dcd7e5ddc20621bcae3ece4f5f0739e..2f7e254912f0f21126df4703e55b9d8d0b612618 100644 (file)
@@ -70,6 +70,5 @@ obj-$(CONFIG_MTD_DMV182)      += dmv182.o
 obj-$(CONFIG_MTD_SHARP_SL)     += sharpsl-flash.o
 obj-$(CONFIG_MTD_PLATRAM)      += plat-ram.o
 obj-$(CONFIG_MTD_OMAP_NOR)     += omap_nor.o
-obj-$(CONFIG_MTD_PQ2FADS)      += pq2fads.o
 obj-$(CONFIG_MTD_MTX1)         += mtx-1_flash.o
 obj-$(CONFIG_MTD_TQM834x)      += tqm834x.o
index a59f8027903c5d632975bbb28e23ad91f369b35f..986c586283907b517ec236cd13b7d6fd0225c3cb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ixp4xx.c,v 1.12 2005/11/07 11:14:27 gleixner Exp $
+ * $Id: ixp4xx.c,v 1.13 2005/11/16 16:23:21 dvrabel Exp $
  *
  * drivers/mtd/maps/ixp4xx.c
  *
 
 #include <linux/reboot.h>
 
+/*
+ * Read/write a 16 bit word from flash address 'addr'.
+ *
+ * When the cpu is in little-endian mode it swizzles the address lines
+ * ('address coherency') so we need to undo the swizzling to ensure commands
+ * and the like end up on the correct flash address.
+ *
+ * To further complicate matters, due to the way the expansion bus controller
+ * handles 32 bit reads, the byte stream ABCD is stored on the flash as:
+ *     D15    D0
+ *     +---+---+
+ *     | A | B | 0
+ *     +---+---+
+ *     | C | D | 2
+ *     +---+---+
+ * This means that on LE systems each 16 bit word must be swapped. Note that
+ * this requires CONFIG_MTD_CFI_BE_BYTE_SWAP to be enabled to 'unswap' the CFI
+ * data and other flash commands which are always in D7-D0.
+ */
 #ifndef __ARMEB__
+#ifndef CONFIG_MTD_CFI_BE_BYTE_SWAP
+#  error CONFIG_MTD_CFI_BE_BYTE_SWAP required
+#endif
+
+static inline u16 flash_read16(void __iomem *addr)
+{
+       return be16_to_cpu(__raw_readw((void __iomem *)((unsigned long)addr ^ 0x2)));
+}
+
+static inline void flash_write16(u16 d, void __iomem *addr)
+{
+       __raw_writew(cpu_to_be16(d), (void __iomem *)((unsigned long)addr ^ 0x2));
+}
+
 #define        BYTE0(h)        ((h) & 0xFF)
 #define        BYTE1(h)        (((h) >> 8) & 0xFF)
+
 #else
+
+static inline u16 flash_read16(const void __iomem *addr)
+{
+       return __raw_readw(addr);
+}
+
+static inline void flash_write16(u16 d, void __iomem *addr)
+{
+       __raw_writew(d, addr);
+}
+
 #define        BYTE0(h)        (((h) >> 8) & 0xFF)
 #define        BYTE1(h)        ((h) & 0xFF)
 #endif
@@ -45,7 +90,7 @@
 static map_word ixp4xx_read16(struct map_info *map, unsigned long ofs)
 {
        map_word val;
-       val.x[0] = le16_to_cpu(readw(map->virt + ofs));
+       val.x[0] = flash_read16(map->virt + ofs);
        return val;
 }
 
@@ -57,19 +102,28 @@ static map_word ixp4xx_read16(struct map_info *map, unsigned long ofs)
 static void ixp4xx_copy_from(struct map_info *map, void *to,
                             unsigned long from, ssize_t len)
 {
-       int i;
        u8 *dest = (u8 *) to;
        void __iomem *src = map->virt + from;
-       u16 data;
 
-       for (i = 0; i < (len / 2); i++) {
-               data = le16_to_cpu(readw(src + 2*i));
-               dest[i * 2] = BYTE0(data);
-               dest[i * 2 + 1] = BYTE1(data);
+       if (len <= 0)
+               return;
+
+       if (from & 1) {
+               *dest++ = BYTE1(flash_read16(src));
+                src++;
+               --len;
        }
 
-       if (len & 1)
-               dest[len - 1] = BYTE0(le16_to_cpu(readw(src + 2*i)));
+       while (len >= 2) {
+               u16 data = flash_read16(src);
+               *dest++ = BYTE0(data);
+               *dest++ = BYTE1(data);
+               src += 2;
+               len -= 2;
+        }
+
+       if (len > 0)
+               *dest++ = BYTE0(flash_read16(src));
 }
 
 /*
@@ -79,7 +133,7 @@ static void ixp4xx_copy_from(struct map_info *map, void *to,
 static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long adr)
 {
        if (!(adr & 1))
-               writew(cpu_to_le16(d.x[0]), map->virt + adr);
+               flash_write16(d.x[0], map->virt + adr);
 }
 
 /*
@@ -87,7 +141,7 @@ static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long
  */
 static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr)
 {
-       writew(cpu_to_le16(d.x[0]), map->virt + adr);
+       flash_write16(d.x[0], map->virt + adr);
 }
 
 struct ixp4xx_flash_info {
index f00ee7e54dba7dbdaa17a30d3e2ff013d3f3eb6d..632eb2aa968f476b9686bd46cea03157ed5cb376 100644 (file)
@@ -6,7 +6,7 @@
  *      (C) Copyright 2000-2001, Greg Ungerer (gerg@snapgear.com)
  *      (C) Copyright 2001-2002, SnapGear (www.snapgear.com)
  *
- *     $Id: nettel.c,v 1.11 2005/11/07 11:14:27 gleixner Exp $
+ *     $Id: nettel.c,v 1.12 2005/11/29 14:30:00 gleixner Exp $
  */
 
 /****************************************************************************/
@@ -479,7 +479,7 @@ void __exit nettel_cleanup(void)
        }
        if (nettel_intel_map.virt) {
                iounmap(nettel_intel_map.virt);
-               nettel_intel_map.virt = 0;
+               nettel_intel_map.virt = NULL;
        }
 #endif
 }
index 8b3570b090954bd27f8034d69620d0dc9baf2fd3..21822c2edbe40126198990635473c902c06e7dc0 100644 (file)
@@ -7,7 +7,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  *
- *  $Id: pci.c,v 1.13 2005/11/07 11:14:27 gleixner Exp $
+ *  $Id: pci.c,v 1.14 2005/11/17 08:20:27 dwmw2 Exp $
  *
  * Generic PCI memory map driver.  We support the following boards:
  *  - Intel IQ80310 ATU.
@@ -102,7 +102,7 @@ static void mtd_pci_copyto(struct map_info *_map, unsigned long to, const void *
        memcpy_toio(map->base + map->translate(map, to), from, len);
 }
 
-static struct map_info mtd_pci_map = {
+static const struct map_info mtd_pci_map = {
        .phys =         NO_XIP,
        .copy_from =    mtd_pci_copyfrom,
        .copy_to =      mtd_pci_copyto,
index 9ee760f97bc6ae58da80183fe3de17cdc77e80d4..f49ebc3c4606c89dbc60605cbbf31dd33a6bf93f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: physmap.c,v 1.38 2005/11/07 11:14:28 gleixner Exp $
+ * $Id: physmap.c,v 1.39 2005/11/29 14:49:36 gleixner Exp $
  *
  * Normal mappings of chips in physical memory
  *
@@ -19,6 +19,7 @@
 #include <linux/mtd/map.h>
 #include <linux/config.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 
 static struct mtd_info *mymtd;
 
index 6fb9f3c57aabe1fc9fc443675d0bd82c5dd741ff..ed92afadd8a91b4e13183c314b62ea8b88085406 100644 (file)
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *
- * $Id: sc520cdp.c,v 1.22 2005/11/07 11:14:28 gleixner Exp $
+ * $Id: sc520cdp.c,v 1.23 2005/11/17 08:20:27 dwmw2 Exp $
  *
  *
  * The SC520CDP is an evaluation board for the Elan SC520 processor available
@@ -164,7 +164,7 @@ struct sc520_par_table
        unsigned long default_address;
 };
 
-static struct sc520_par_table par_table[NUM_FLASH_BANKS] =
+static const struct sc520_par_table par_table[NUM_FLASH_BANKS] =
 {
        {       /* Flash Bank #0: selected by ROMCS0 */
                SC520_PAR_ROMCS0,
index de4500395300065d99e3489e4d445947c64b1fed..a0af92cc7efd787624f6848d93d618eca898ce84 100644 (file)
@@ -1486,7 +1486,7 @@ ns_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
 /*
  * Module initialization function
  */
-int __init ns_init_module(void)
+static int __init ns_init_module(void)
 {
        struct nand_chip *chip;
        struct nandsim *nand;
index 0ab8d29caeea07ecaf4e0434cfa7b2fd512496e7..20ce212638fcc33178c4ff939cd505bf05d21060 100644 (file)
@@ -30,11 +30,9 @@ MODULE_PARM_DESC(block_size, "Block size to use by RFD, defaults to erase unit s
 
 #define PREFIX "rfd_ftl: "
 
-/* Major device # for FTL device */
-
-/* A request for this major has been sent to device@lanana.org */
+/* This major has been assigned by device@lanana.org */
 #ifndef RFD_FTL_MAJOR
-#define RFD_FTL_MAJOR          95
+#define RFD_FTL_MAJOR          256
 #endif
 
 /* Maximum number of partitions in an FTL region */
index c53848f787ebb600632d4f8b05964de4b7b919dd..7aa49b974dc5510cb17a46099186ea43335ab22b 100644 (file)
@@ -28,8 +28,8 @@
 
 #define DRV_MODULE_NAME                "b44"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "0.96"
-#define DRV_MODULE_RELDATE     "Nov 8, 2005"
+#define DRV_MODULE_VERSION     "0.97"
+#define DRV_MODULE_RELDATE     "Nov 30, 2005"
 
 #define B44_DEF_MSG_ENABLE       \
        (NETIF_MSG_DRV          | \
@@ -1417,6 +1417,7 @@ static int b44_open(struct net_device *dev)
        add_timer(&bp->timer);
 
        b44_enable_ints(bp);
+       netif_start_queue(dev);
 out:
        return err;
 }
@@ -1837,12 +1838,15 @@ static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
        struct mii_ioctl_data *data = if_mii(ifr);
        struct b44 *bp = netdev_priv(dev);
-       int err;
+       int err = -EINVAL;
+
+       if (!netif_running(dev))
+               goto out;
 
        spin_lock_irq(&bp->lock);
        err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL);
        spin_unlock_irq(&bp->lock);
-
+out:
        return err;
 }
 
@@ -2113,6 +2117,7 @@ static int b44_resume(struct pci_dev *pdev)
        add_timer(&bp->timer);
 
        b44_enable_ints(bp);
+       netif_wake_queue(dev);
        return 0;
 }
 
index 8b207f0e139e04fb9894ec771195f0866ea8210b..e0ae248b4313084337e07ff85279d4ed8d2de116 100644 (file)
@@ -2621,19 +2621,7 @@ e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb)
                          E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT)) )
                        return 0;
        }
-       if(htons(ETH_P_IP) == skb->protocol) {
-               const struct iphdr *ip = skb->nh.iph;
-               if(IPPROTO_UDP == ip->protocol) {
-                       struct udphdr *udp = (struct udphdr *)(skb->h.uh);
-                       if(ntohs(udp->dest) == 67) {
-                               offset = (uint8_t *)udp + 8 - skb->data;
-                               length = skb->len - offset;
-
-                               return e1000_mng_write_dhcp_info(hw,
-                                               (uint8_t *)udp + 8, length);
-                       }
-               }
-       } else if((skb->len > MINIMUM_DHCP_PACKET_SIZE) && (!skb->protocol)) {
+       if ((skb->len > MINIMUM_DHCP_PACKET_SIZE) && (!skb->protocol)) {
                struct ethhdr *eth = (struct ethhdr *) skb->data;
                if((htons(ETH_P_IP) == eth->h_proto)) {
                        const struct iphdr *ip = 
index eb7d6947871555812408a40aa7e0c6fba697275e..1da8a66f91e115cf913f6c0492c3c2187cd6be75 100644 (file)
@@ -65,7 +65,7 @@
  */
 
 #define DRV_NAME        "emac"
-#define DRV_VERSION     "3.53"
+#define DRV_VERSION     "3.54"
 #define DRV_DESC        "PPC 4xx OCP EMAC driver"
 
 MODULE_DESCRIPTION(DRV_DESC);
@@ -158,6 +158,14 @@ static inline void emac_report_timeout_error(struct ocp_enet_private *dev,
 #define PHY_POLL_LINK_ON       HZ
 #define PHY_POLL_LINK_OFF      (HZ / 5)
 
+/* Graceful stop timeouts in us. 
+ * We should allow up to 1 frame time (full-duplex, ignoring collisions) 
+ */
+#define STOP_TIMEOUT_10                1230    
+#define STOP_TIMEOUT_100       124
+#define STOP_TIMEOUT_1000      13
+#define STOP_TIMEOUT_1000_JUMBO        73
+
 /* Please, keep in sync with struct ibm_emac_stats/ibm_emac_error_stats */
 static const char emac_stats_keys[EMAC_ETHTOOL_STATS_COUNT][ETH_GSTRING_LEN] = {
        "rx_packets", "rx_bytes", "tx_packets", "tx_bytes", "rx_packets_csum",
@@ -222,10 +230,12 @@ static void emac_tx_disable(struct ocp_enet_private *dev)
 
        r = in_be32(&p->mr0);
        if (r & EMAC_MR0_TXE) {
-               int n = 300;
+               int n = dev->stop_timeout;
                out_be32(&p->mr0, r & ~EMAC_MR0_TXE);
-               while (!(in_be32(&p->mr0) & EMAC_MR0_TXI) && n)
+               while (!(in_be32(&p->mr0) & EMAC_MR0_TXI) && n) {
+                       udelay(1);
                        --n;
+               }       
                if (unlikely(!n))
                        emac_report_timeout_error(dev, "TX disable timeout");
        }
@@ -248,9 +258,11 @@ static void emac_rx_enable(struct ocp_enet_private *dev)
        if (!(r & EMAC_MR0_RXE)) {
                if (unlikely(!(r & EMAC_MR0_RXI))) {
                        /* Wait if previous async disable is still in progress */
-                       int n = 100;
-                       while (!(r = in_be32(&p->mr0) & EMAC_MR0_RXI) && n)
+                       int n = dev->stop_timeout;
+                       while (!(r = in_be32(&p->mr0) & EMAC_MR0_RXI) && n) {
+                               udelay(1);
                                --n;
+                       }       
                        if (unlikely(!n))
                                emac_report_timeout_error(dev,
                                                          "RX disable timeout");
@@ -273,10 +285,12 @@ static void emac_rx_disable(struct ocp_enet_private *dev)
 
        r = in_be32(&p->mr0);
        if (r & EMAC_MR0_RXE) {
-               int n = 300;
+               int n = dev->stop_timeout;
                out_be32(&p->mr0, r & ~EMAC_MR0_RXE);
-               while (!(in_be32(&p->mr0) & EMAC_MR0_RXI) && n)
+               while (!(in_be32(&p->mr0) & EMAC_MR0_RXI) && n) {
+                       udelay(1);
                        --n;
+               }       
                if (unlikely(!n))
                        emac_report_timeout_error(dev, "RX disable timeout");
        }
@@ -395,6 +409,7 @@ static int emac_configure(struct ocp_enet_private *dev)
        r = EMAC_MR1_BASE(emac_opb_mhz()) | EMAC_MR1_VLE | EMAC_MR1_IST;
        if (dev->phy.duplex == DUPLEX_FULL)
                r |= EMAC_MR1_FDE;
+       dev->stop_timeout = STOP_TIMEOUT_10;
        switch (dev->phy.speed) {
        case SPEED_1000:
                if (emac_phy_gpcs(dev->phy.mode)) {
@@ -409,12 +424,16 @@ static int emac_configure(struct ocp_enet_private *dev)
                        r |= EMAC_MR1_MF_1000;
                r |= EMAC_MR1_RFS_16K;
                gige = 1;
-               
-               if (dev->ndev->mtu > ETH_DATA_LEN)
+
+               if (dev->ndev->mtu > ETH_DATA_LEN) {
                        r |= EMAC_MR1_JPSM;
+                       dev->stop_timeout = STOP_TIMEOUT_1000_JUMBO;
+               } else
+                       dev->stop_timeout = STOP_TIMEOUT_1000;
                break;
        case SPEED_100:
                r |= EMAC_MR1_MF_100;
+               dev->stop_timeout = STOP_TIMEOUT_100;
                /* Fall through */
        default:
                r |= EMAC_MR1_RFS_4K;
@@ -2048,6 +2067,7 @@ static int __init emac_probe(struct ocp_device *ocpdev)
        dev->phy.duplex = DUPLEX_FULL;
        dev->phy.autoneg = AUTONEG_DISABLE;
        dev->phy.pause = dev->phy.asym_pause = 0;
+       dev->stop_timeout = STOP_TIMEOUT_100;
        init_timer(&dev->link_timer);
        dev->link_timer.function = emac_link_timer;
        dev->link_timer.data = (unsigned long)dev;
index e9b44d030ac339ee0a3c4682ae0ed45ba077250d..911abbaf471b509187b0b187905a18216ba05b0c 100644 (file)
@@ -189,6 +189,8 @@ struct ocp_enet_private {
        struct timer_list               link_timer;
        int                             reset_failed;
 
+       int                             stop_timeout;   /* in us */
+
        struct ibm_emac_error_stats     estats;
        struct net_device_stats         nstats;
 
index b039bd89ceb953ee88c5150ae1329b1913c12cd2..272d331d29cd5a6a6363861ca0b1f91cba5ca33a 100644 (file)
@@ -296,7 +296,7 @@ static int __init jazz_sonic_init_module(void)
        }
 
        jazz_sonic_device = platform_device_alloc(jazz_sonic_string, 0);
-       if (!jazz_sonnic_device)
+       if (!jazz_sonic_device)
                goto out_unregister;
 
        if (platform_device_add(jazz_sonic_device)) {
@@ -307,7 +307,7 @@ static int __init jazz_sonic_init_module(void)
        return 0;
 
 out_unregister:
-       driver_unregister(&jazz_sonic_driver);
+       platform_driver_unregister(&jazz_sonic_driver);
 
        return -ENOMEM;
 }
index 878535953cb13d8b0f24077839f5ce7a65034e9b..026c732024c99e8dd7708f6291732682af34976c 100644 (file)
@@ -1,28 +1,8 @@
-//
-// <COPYRIGHT CLASS="1B" YEAR="2005">
-// Unpublished work (c) MIPS Technologies, Inc.  All rights reserved.
-// Unpublished rights reserved under the copyright laws of the U.S.A. and
-//  other countries.
-//
-// PROPRIETARY / SECRET CONFIDENTIAL INFORMATION OF MIPS TECHNOLOGIES, INC.
-// FOR INTERNAL USE ONLY.
-//
-// Under no circumstances (contract or otherwise) may this information be
-// disclosed to, or copied, modified or used by anyone other than employees
-// or contractors of MIPS Technologies having a need to know.
-// </COPYRIGHT>
-//
-//++
-// File: MIPS_Net.h
-//
-// Description:
-//   The definition of the emulated MIPSNET device's interface.
-//
-// Notes: This include file needs to work from a Linux device drivers.
-//
-//--
-//
-
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
 #ifndef __MIPSNET_H
 #define __MIPSNET_H
 
index 384a736a0d2f820f5c6a7fcce3306d8e6ff04264..356f509092221de4b610f5be6aaf52227df975a6 100644 (file)
@@ -131,10 +131,9 @@ typedef struct local_info_t {
     u_short tx_queue_len;
     cardtype_t cardtype;
     u_short sent;
-    u_char mc_filter[8];
 } local_info_t;
 
-#define MC_FILTERBREAK 8
+#define MC_FILTERBREAK 64
 
 /*====================================================================*/
 /* 
@@ -1005,15 +1004,8 @@ static void fjn_reset(struct net_device *dev)
     for (i = 0; i < 6; i++) 
         outb(dev->dev_addr[i], ioaddr + NODE_ID + i);
 
-    /* Switch to bank 1 */
-    if (lp->cardtype == MBH10302)
-       outb(BANK_1, ioaddr + CONFIG_1);
-    else
-       outb(BANK_1U, ioaddr + CONFIG_1);
-
-    /* set the multicast table to accept none. */
-    for (i = 0; i < 8; i++) 
-        outb(0x00, ioaddr + MAR_ADR + i);
+    /* (re)initialize the multicast table */
+    set_rx_mode(dev);
 
     /* Switch to bank 2 (runtime mode) */
     if (lp->cardtype == MBH10302)
@@ -1264,11 +1256,11 @@ static struct net_device_stats *fjn_get_stats(struct net_device *dev)
 static void set_rx_mode(struct net_device *dev)
 {
     kio_addr_t ioaddr = dev->base_addr;
-    struct local_info_t *lp = netdev_priv(dev);
     u_char mc_filter[8];                /* Multicast hash filter */
     u_long flags;
     int i;
     
+    int saved_bank;
     int saved_config_0 = inb(ioaddr + CONFIG_0);
      
     local_irq_save(flags); 
@@ -1306,15 +1298,13 @@ static void set_rx_mode(struct net_device *dev)
        outb(2, ioaddr + RX_MODE);      /* Use normal mode. */
     }
 
-    if (memcmp(mc_filter, lp->mc_filter, sizeof(mc_filter))) {
-       int saved_bank = inb(ioaddr + CONFIG_1);
-       /* Switch to bank 1 and set the multicast table. */
-       outb(0xe4, ioaddr + CONFIG_1);
-       for (i = 0; i < 8; i++)
-           outb(mc_filter[i], ioaddr + MAR_ADR + i);
-       memcpy(lp->mc_filter, mc_filter, sizeof(mc_filter));
-       outb(saved_bank, ioaddr + CONFIG_1);
-    }
+    /* Switch to bank 1 and set the multicast table. */
+    saved_bank = inb(ioaddr + CONFIG_1);
+    outb(0xe4, ioaddr + CONFIG_1);
+
+    for (i = 0; i < 8; i++)
+       outb(mc_filter[i], ioaddr + MAR_ADR + i);
+    outb(saved_bank, ioaddr + CONFIG_1);
 
     outb(saved_config_0, ioaddr + CONFIG_0);
 
index 6783039ffb757123b079151cfbe69d6c0ca608f4..7653d6e33aa28dc0b0e71f5c9b4cd321eda1c5cd 100644 (file)
@@ -27,8 +27,7 @@ sk98lin-objs    :=    \
                sktimer.o       \
                skvpd.o         \
                skxmac2.o       \
-               skproc.o        \
-               skcsum.o
+               skproc.o
 
 # DBGDEF =  \
 # -DDEBUG
@@ -77,7 +76,7 @@ endif
 # SK_DBGCAT_DRV_INT_SRC         0x04000000      interrupts sources
 # SK_DBGCAT_DRV_EVENT           0x08000000      driver events
 
-EXTRA_CFLAGS += -Idrivers/net/sk98lin -DSK_DIAG_SUPPORT -DSK_USE_CSUM -DGENESIS -DYUKON $(DBGDEF) $(SKPARAM)
+EXTRA_CFLAGS += -Idrivers/net/sk98lin -DSK_DIAG_SUPPORT -DGENESIS -DYUKON $(DBGDEF) $(SKPARAM)
 
 clean:
        rm -f core *.o *.a *.s
index 542cec57f86a30b129adc3f62b710670c2424972..2dc5728e3ef67ab2937387744ab627224c0e69f3 100644 (file)
@@ -425,10 +425,6 @@ struct s_AC  {
        TX_PORT         TxPort[SK_MAX_MACS][2];
        RX_PORT         RxPort[SK_MAX_MACS];
 
-       unsigned int    CsOfs1;         /* for checksum calculation */
-       unsigned int    CsOfs2;         /* for checksum calculation */
-       SK_U32          CsOfs;          /* for checksum calculation */
-
        SK_BOOL         CheckQueue;     /* check event queue soon */
        SK_TIMER        DrvCleanupTimer;/* to check for pending descriptors */
        DIM_INFO        DynIrqModInfo;  /* all data related to DIM */
diff --git a/drivers/net/sk98lin/skcsum.c b/drivers/net/sk98lin/skcsum.c
deleted file mode 100644 (file)
index 38a6e7a..0000000
+++ /dev/null
@@ -1,871 +0,0 @@
-/******************************************************************************
- *
- * Name:       skcsum.c
- * Project:    GEnesis, PCI Gigabit Ethernet Adapter
- * Version:    $Revision: 1.12 $
- * Date:       $Date: 2003/08/20 13:55:53 $
- * Purpose:    Store/verify Internet checksum in send/receive packets.
- *
- ******************************************************************************/
-
-/******************************************************************************
- *
- *     (C)Copyright 1998-2003 SysKonnect GmbH.
- *
- *     This program is free software; you can redistribute it and/or modify
- *     it under the terms of the GNU General Public License as published by
- *     the Free Software Foundation; either version 2 of the License, or
- *     (at your option) any later version.
- *
- *     The information in this file is provided "AS IS" without warranty.
- *
- ******************************************************************************/
-
-#ifdef SK_USE_CSUM     /* Check if CSUM is to be used. */
-
-#ifndef lint
-static const char SysKonnectFileId[] =
-       "@(#) $Id: skcsum.c,v 1.12 2003/08/20 13:55:53 mschmid Exp $ (C) SysKonnect.";
-#endif /* !lint */
-
-/******************************************************************************
- *
- * Description:
- *
- * This is the "GEnesis" common module "CSUM".
- *
- * This module contains the code necessary to calculate, store, and verify the
- * Internet Checksum of IP, TCP, and UDP frames.
- *
- * "GEnesis" is an abbreviation of "Gigabit Ethernet Network System in Silicon"
- * and is the code name of this SysKonnect project.
- *
- * Compilation Options:
- *
- *     SK_USE_CSUM - Define if CSUM is to be used. Otherwise, CSUM will be an
- *     empty module.
- *
- *     SKCS_OVERWRITE_PROTO - Define to overwrite the default protocol id
- *     definitions. In this case, all SKCS_PROTO_xxx definitions must be made
- *     external.
- *
- *     SKCS_OVERWRITE_STATUS - Define to overwrite the default return status
- *     definitions. In this case, all SKCS_STATUS_xxx definitions must be made
- *     external.
- *
- * Include File Hierarchy:
- *
- *     "h/skdrv1st.h"
- *     "h/skcsum.h"
- *     "h/sktypes.h"
- *     "h/skqueue.h"
- *     "h/skdrv2nd.h"
- *
- ******************************************************************************/
-
-#include "h/skdrv1st.h"
-#include "h/skcsum.h"
-#include "h/skdrv2nd.h"
-
-/* defines ********************************************************************/
-
-/* The size of an Ethernet MAC header. */
-#define SKCS_ETHERNET_MAC_HEADER_SIZE                  (6+6+2)
-
-/* The size of the used topology's MAC header. */
-#define        SKCS_MAC_HEADER_SIZE    SKCS_ETHERNET_MAC_HEADER_SIZE
-
-/* The size of the IP header without any option fields. */
-#define SKCS_IP_HEADER_SIZE                                            20
-
-/*
- * Field offsets within the IP header.
- */
-
-/* "Internet Header Version" and "Length". */
-#define SKCS_OFS_IP_HEADER_VERSION_AND_LENGTH  0
-
-/* "Total Length". */
-#define SKCS_OFS_IP_TOTAL_LENGTH                               2
-
-/* "Flags" "Fragment Offset". */
-#define SKCS_OFS_IP_FLAGS_AND_FRAGMENT_OFFSET  6
-
-/* "Next Level Protocol" identifier. */
-#define SKCS_OFS_IP_NEXT_LEVEL_PROTOCOL                        9
-
-/* Source IP address. */
-#define SKCS_OFS_IP_SOURCE_ADDRESS                             12
-
-/* Destination IP address. */
-#define SKCS_OFS_IP_DESTINATION_ADDRESS                        16
-
-
-/*
- * Field offsets within the UDP header.
- */
-
-/* UDP checksum. */
-#define SKCS_OFS_UDP_CHECKSUM                                  6
-
-/* IP "Next Level Protocol" identifiers (see RFC 790). */
-#define SKCS_PROTO_ID_TCP              6       /* Transport Control Protocol */
-#define SKCS_PROTO_ID_UDP              17      /* User Datagram Protocol */
-
-/* IP "Don't Fragment" bit. */
-#define SKCS_IP_DONT_FRAGMENT  SKCS_HTON16(0x4000)
-
-/* Add a byte offset to a pointer. */
-#define SKCS_IDX(pPtr, Ofs)    ((void *) ((char *) (pPtr) + (Ofs)))
-
-/*
- * Macros that convert host to network representation and vice versa, i.e.
- * little/big endian conversion on little endian machines only.
- */
-#ifdef SK_LITTLE_ENDIAN
-#define SKCS_HTON16(Val16)     (((unsigned) (Val16) >> 8) | (((Val16) & 0xff) << 8))
-#endif /* SK_LITTLE_ENDIAN */
-#ifdef SK_BIG_ENDIAN
-#define SKCS_HTON16(Val16)     (Val16)
-#endif /* SK_BIG_ENDIAN */
-#define SKCS_NTOH16(Val16)     SKCS_HTON16(Val16)
-
-/* typedefs *******************************************************************/
-
-/* function prototypes ********************************************************/
-
-/******************************************************************************
- *
- *     SkCsGetSendInfo - get checksum information for a send packet
- *
- * Description:
- *     Get all checksum information necessary to send a TCP or UDP packet. The
- *     function checks the IP header passed to it. If the high-level protocol
- *     is either TCP or UDP the pseudo header checksum is calculated and
- *     returned.
- *
- *     The function returns the total length of the IP header (including any
- *     IP option fields), which is the same as the start offset of the IP data
- *     which in turn is the start offset of the TCP or UDP header.
- *
- *     The function also returns the TCP or UDP pseudo header checksum, which
- *     should be used as the start value for the hardware checksum calculation.
- *     (Note that any actual pseudo header checksum can never calculate to
- *     zero.)
- *
- * Note:
- *     There is a bug in the GENESIS ASIC which may lead to wrong checksums.
- *
- * Arguments:
- *     pAc - A pointer to the adapter context struct.
- *
- *     pIpHeader - Pointer to IP header. Must be at least the IP header *not*
- *     including any option fields, i.e. at least 20 bytes.
- *
- *     Note: This pointer will be used to address 8-, 16-, and 32-bit
- *     variables with the respective alignment offsets relative to the pointer.
- *     Thus, the pointer should point to a 32-bit aligned address. If the
- *     target system cannot address 32-bit variables on non 32-bit aligned
- *     addresses, then the pointer *must* point to a 32-bit aligned address.
- *
- *     pPacketInfo - A pointer to the packet information structure for this
- *     packet. Before calling this SkCsGetSendInfo(), the following field must
- *     be initialized:
- *
- *             ProtocolFlags - Initialize with any combination of
- *             SKCS_PROTO_XXX bit flags. SkCsGetSendInfo() will only work on
- *             the protocols specified here. Any protocol(s) not specified
- *             here will be ignored.
- *
- *             Note: Only one checksum can be calculated in hardware. Thus, if
- *             SKCS_PROTO_IP is specified in the 'ProtocolFlags',
- *             SkCsGetSendInfo() must calculate the IP header checksum in
- *             software. It might be a better idea to have the calling
- *             protocol stack calculate the IP header checksum.
- *
- * Returns: N/A
- *     On return, the following fields in 'pPacketInfo' may or may not have
- *     been filled with information, depending on the protocol(s) found in the
- *     packet:
- *
- *     ProtocolFlags - Returns the SKCS_PROTO_XXX bit flags of the protocol(s)
- *     that were both requested by the caller and actually found in the packet.
- *     Protocol(s) not specified by the caller and/or not found in the packet
- *     will have their respective SKCS_PROTO_XXX bit flags reset.
- *
- *     Note: For IP fragments, TCP and UDP packet information is ignored.
- *
- *     IpHeaderLength - The total length in bytes of the complete IP header
- *     including any option fields is returned here. This is the start offset
- *     of the IP data, i.e. the TCP or UDP header if present.
- *
- *     IpHeaderChecksum - If IP has been specified in the 'ProtocolFlags', the
- *     16-bit Internet Checksum of the IP header is returned here. This value
- *     is to be stored into the packet's 'IP Header Checksum' field.
- *
- *     PseudoHeaderChecksum - If this is a TCP or UDP packet and if TCP or UDP
- *     has been specified in the 'ProtocolFlags', the 16-bit Internet Checksum
- *     of the TCP or UDP pseudo header is returned here.
- */
-void SkCsGetSendInfo(
-SK_AC                          *pAc,                   /* Adapter context struct. */
-void                           *pIpHeader,             /* IP header. */
-SKCS_PACKET_INFO       *pPacketInfo,   /* Packet information struct. */
-int                                    NetNumber)              /* Net number */
-{
-       /* Internet Header Version found in IP header. */
-       unsigned InternetHeaderVersion;
-
-       /* Length of the IP header as found in IP header. */
-       unsigned IpHeaderLength;
-
-       /* Bit field specifiying the desired/found protocols. */
-       unsigned ProtocolFlags;
-
-       /* Next level protocol identifier found in IP header. */
-       unsigned NextLevelProtocol;
-
-       /* Length of IP data portion. */
-       unsigned IpDataLength;
-
-       /* TCP/UDP pseudo header checksum. */
-       unsigned long PseudoHeaderChecksum;
-
-       /* Pointer to next level protocol statistics structure. */
-       SKCS_PROTO_STATS *NextLevelProtoStats;
-
-       /* Temporary variable. */
-       unsigned Tmp;
-
-       Tmp = *(SK_U8 *)
-               SKCS_IDX(pIpHeader, SKCS_OFS_IP_HEADER_VERSION_AND_LENGTH);
-
-       /* Get the Internet Header Version (IHV). */
-       /* Note: The IHV is stored in the upper four bits. */
-
-       InternetHeaderVersion = Tmp >> 4;
-
-       /* Check the Internet Header Version. */
-       /* Note: We currently only support IP version 4. */
-
-       if (InternetHeaderVersion != 4) {       /* IPv4? */
-               SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_TX,
-                       ("Tx: Unknown Internet Header Version %u.\n",
-                       InternetHeaderVersion));
-               pPacketInfo->ProtocolFlags = 0;
-               pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].TxUnableCts++;
-               return;
-       }
-
-       /* Get the IP header length (IHL). */
-       /*
-        * Note: The IHL is stored in the lower four bits as the number of
-        * 4-byte words.
-        */
-
-       IpHeaderLength = (Tmp & 0xf) * 4;
-       pPacketInfo->IpHeaderLength = IpHeaderLength;
-
-       /* Check the IP header length. */
-
-       /* 04-Aug-1998 sw - Really check the IHL? Necessary? */
-
-       if (IpHeaderLength < 5*4) {
-               SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_TX,
-                       ("Tx: Invalid IP Header Length %u.\n", IpHeaderLength));
-               pPacketInfo->ProtocolFlags = 0;
-               pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].TxUnableCts++;
-               return;
-       }
-
-       /* This is an IPv4 frame with a header of valid length. */
-
-       pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].TxOkCts++;
-
-       /* Check if we should calculate the IP header checksum. */
-
-       ProtocolFlags = pPacketInfo->ProtocolFlags;
-
-       if (ProtocolFlags & SKCS_PROTO_IP) {
-               pPacketInfo->IpHeaderChecksum =
-                       SkCsCalculateChecksum(pIpHeader, IpHeaderLength);
-       }
-
-       /* Get the next level protocol identifier. */
-
-       NextLevelProtocol =
-               *(SK_U8 *) SKCS_IDX(pIpHeader, SKCS_OFS_IP_NEXT_LEVEL_PROTOCOL);
-
-       /*
-        * Check if this is a TCP or UDP frame and if we should calculate the
-        * TCP/UDP pseudo header checksum.
-        *
-        * Also clear all protocol bit flags of protocols not present in the
-        * frame.
-        */
-
-       if ((ProtocolFlags & SKCS_PROTO_TCP) != 0 &&
-               NextLevelProtocol == SKCS_PROTO_ID_TCP) {
-               /* TCP/IP frame. */
-               ProtocolFlags &= SKCS_PROTO_TCP | SKCS_PROTO_IP;
-               NextLevelProtoStats =
-                       &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_TCP];
-       }
-       else if ((ProtocolFlags & SKCS_PROTO_UDP) != 0 &&
-               NextLevelProtocol == SKCS_PROTO_ID_UDP) {
-               /* UDP/IP frame. */
-               ProtocolFlags &= SKCS_PROTO_UDP | SKCS_PROTO_IP;
-               NextLevelProtoStats =
-                       &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_UDP];
-       }
-       else {
-               /*
-                * Either not a TCP or UDP frame and/or TCP/UDP processing not
-                * specified.
-                */
-               pPacketInfo->ProtocolFlags = ProtocolFlags & SKCS_PROTO_IP;
-               return;
-       }
-
-       /* Check if this is an IP fragment. */
-
-       /*
-        * Note: An IP fragment has a non-zero "Fragment Offset" field and/or
-        * the "More Fragments" bit set. Thus, if both the "Fragment Offset"
-        * and the "More Fragments" are zero, it is *not* a fragment. We can
-        * easily check both at the same time since they are in the same 16-bit
-        * word.
-        */
-
-       if ((*(SK_U16 *)
-               SKCS_IDX(pIpHeader, SKCS_OFS_IP_FLAGS_AND_FRAGMENT_OFFSET) &
-               ~SKCS_IP_DONT_FRAGMENT) != 0) {
-               /* IP fragment; ignore all other protocols. */
-               pPacketInfo->ProtocolFlags = ProtocolFlags & SKCS_PROTO_IP;
-               NextLevelProtoStats->TxUnableCts++;
-               return;
-       }
-
-       /*
-        * Calculate the TCP/UDP pseudo header checksum.
-        */
-
-       /* Get total length of IP header and data. */
-
-       IpDataLength =
-               *(SK_U16 *) SKCS_IDX(pIpHeader, SKCS_OFS_IP_TOTAL_LENGTH);
-
-       /* Get length of IP data portion. */
-
-       IpDataLength = SKCS_NTOH16(IpDataLength) - IpHeaderLength;
-
-       /* Calculate the sum of all pseudo header fields (16-bit). */
-
-       PseudoHeaderChecksum =
-               (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader,
-                       SKCS_OFS_IP_SOURCE_ADDRESS + 0) +
-               (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader,
-                       SKCS_OFS_IP_SOURCE_ADDRESS + 2) +
-               (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader,
-                       SKCS_OFS_IP_DESTINATION_ADDRESS + 0) +
-               (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader,
-                       SKCS_OFS_IP_DESTINATION_ADDRESS + 2) +
-               (unsigned long) SKCS_HTON16(NextLevelProtocol) +
-               (unsigned long) SKCS_HTON16(IpDataLength);
-       
-       /* Add-in any carries. */
-
-       SKCS_OC_ADD(PseudoHeaderChecksum, PseudoHeaderChecksum, 0);
-
-       /* Add-in any new carry. */
-
-       SKCS_OC_ADD(pPacketInfo->PseudoHeaderChecksum, PseudoHeaderChecksum, 0);
-
-       pPacketInfo->ProtocolFlags = ProtocolFlags;
-       NextLevelProtoStats->TxOkCts++; /* Success. */
-}      /* SkCsGetSendInfo */
-
-
-/******************************************************************************
- *
- *     SkCsGetReceiveInfo - verify checksum information for a received packet
- *
- * Description:
- *     Verify a received frame's checksum. The function returns a status code
- *     reflecting the result of the verification.
- *
- * Note:
- *     Before calling this function you have to verify that the frame is
- *     not padded and Checksum1 and Checksum2 are bigger than 1.
- *
- * Arguments:
- *     pAc - Pointer to adapter context struct.
- *
- *     pIpHeader - Pointer to IP header. Must be at least the length in bytes
- *     of the received IP header including any option fields. For UDP packets,
- *     8 additional bytes are needed to access the UDP checksum.
- *
- *     Note: The actual length of the IP header is stored in the lower four
- *     bits of the first octet of the IP header as the number of 4-byte words,
- *     so it must be multiplied by four to get the length in bytes. Thus, the
- *     maximum IP header length is 15 * 4 = 60 bytes.
- *
- *     Checksum1 - The first 16-bit Internet Checksum calculated by the
- *     hardware starting at the offset returned by SkCsSetReceiveFlags().
- *
- *     Checksum2 - The second 16-bit Internet Checksum calculated by the
- *     hardware starting at the offset returned by SkCsSetReceiveFlags().
- *
- * Returns:
- *     SKCS_STATUS_UNKNOWN_IP_VERSION - Not an IP v4 frame.
- *     SKCS_STATUS_IP_CSUM_ERROR - IP checksum error.
- *     SKCS_STATUS_IP_CSUM_ERROR_TCP - IP checksum error in TCP frame.
- *     SKCS_STATUS_IP_CSUM_ERROR_UDP - IP checksum error in UDP frame
- *     SKCS_STATUS_IP_FRAGMENT - IP fragment (IP checksum ok).
- *     SKCS_STATUS_IP_CSUM_OK - IP checksum ok (not a TCP or UDP frame).
- *     SKCS_STATUS_TCP_CSUM_ERROR - TCP checksum error (IP checksum ok).
- *     SKCS_STATUS_UDP_CSUM_ERROR - UDP checksum error (IP checksum ok).
- *     SKCS_STATUS_TCP_CSUM_OK - IP and TCP checksum ok.
- *     SKCS_STATUS_UDP_CSUM_OK - IP and UDP checksum ok.
- *     SKCS_STATUS_IP_CSUM_OK_NO_UDP - IP checksum OK and no UDP checksum.
- *
- *     Note: If SKCS_OVERWRITE_STATUS is defined, the SKCS_STATUS_XXX values
- *     returned here can be defined in some header file by the module using CSUM.
- *     In this way, the calling module can assign return values for its own needs,
- *     e.g. by assigning bit flags to the individual protocols.
- */
-SKCS_STATUS SkCsGetReceiveInfo(
-SK_AC          *pAc,           /* Adapter context struct. */
-void           *pIpHeader,     /* IP header. */
-unsigned       Checksum1,      /* Hardware checksum 1. */
-unsigned       Checksum2,      /* Hardware checksum 2. */
-int                    NetNumber)      /* Net number */
-{
-       /* Internet Header Version found in IP header. */
-       unsigned InternetHeaderVersion;
-
-       /* Length of the IP header as found in IP header. */
-       unsigned IpHeaderLength;
-
-       /* Length of IP data portion. */
-       unsigned IpDataLength;
-
-       /* IP header checksum. */
-       unsigned IpHeaderChecksum;
-
-       /* IP header options checksum, if any. */
-       unsigned IpOptionsChecksum;
-
-       /* IP data checksum, i.e. TCP/UDP checksum. */
-       unsigned IpDataChecksum;
-
-       /* Next level protocol identifier found in IP header. */
-       unsigned NextLevelProtocol;
-
-       /* The checksum of the "next level protocol", i.e. TCP or UDP. */
-       unsigned long NextLevelProtocolChecksum;
-
-       /* Pointer to next level protocol statistics structure. */
-       SKCS_PROTO_STATS *NextLevelProtoStats;
-
-       /* Temporary variable. */
-       unsigned Tmp;
-
-       Tmp = *(SK_U8 *)
-               SKCS_IDX(pIpHeader, SKCS_OFS_IP_HEADER_VERSION_AND_LENGTH);
-
-       /* Get the Internet Header Version (IHV). */
-       /* Note: The IHV is stored in the upper four bits. */
-
-       InternetHeaderVersion = Tmp >> 4;
-
-       /* Check the Internet Header Version. */
-       /* Note: We currently only support IP version 4. */
-
-       if (InternetHeaderVersion != 4) {       /* IPv4? */
-               SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_RX,
-                       ("Rx: Unknown Internet Header Version %u.\n",
-                       InternetHeaderVersion));
-               pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxUnableCts++;
-               return (SKCS_STATUS_UNKNOWN_IP_VERSION);
-       }
-
-       /* Get the IP header length (IHL). */
-       /*
-        * Note: The IHL is stored in the lower four bits as the number of
-        * 4-byte words.
-        */
-
-       IpHeaderLength = (Tmp & 0xf) * 4;
-
-       /* Check the IP header length. */
-
-       /* 04-Aug-1998 sw - Really check the IHL? Necessary? */
-
-       if (IpHeaderLength < 5*4) {
-               SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_RX,
-                       ("Rx: Invalid IP Header Length %u.\n", IpHeaderLength));
-               pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxErrCts++;
-               return (SKCS_STATUS_IP_CSUM_ERROR);
-       }
-
-       /* This is an IPv4 frame with a header of valid length. */
-
-       /* Get the IP header and data checksum. */
-
-       IpDataChecksum = Checksum2;
-
-       /*
-        * The IP header checksum is calculated as follows:
-        *
-        *      IpHeaderChecksum = Checksum1 - Checksum2
-        */
-
-       SKCS_OC_SUB(IpHeaderChecksum, Checksum1, Checksum2);
-
-       /* Check if any IP header options. */
-
-       if (IpHeaderLength > SKCS_IP_HEADER_SIZE) {
-
-               /* Get the IP options checksum. */
-
-               IpOptionsChecksum = SkCsCalculateChecksum(
-                       SKCS_IDX(pIpHeader, SKCS_IP_HEADER_SIZE),
-                       IpHeaderLength - SKCS_IP_HEADER_SIZE);
-
-               /* Adjust the IP header and IP data checksums. */
-
-               SKCS_OC_ADD(IpHeaderChecksum, IpHeaderChecksum, IpOptionsChecksum);
-
-               SKCS_OC_SUB(IpDataChecksum, IpDataChecksum, IpOptionsChecksum);
-       }
-
-       /*
-        * Check if the IP header checksum is ok.
-        *
-        * NOTE: We must check the IP header checksum even if the caller just wants
-        * us to check upper-layer checksums, because we cannot do any further
-        * processing of the packet without a valid IP checksum.
-        */
-       
-       /* Get the next level protocol identifier. */
-       
-       NextLevelProtocol = *(SK_U8 *)
-               SKCS_IDX(pIpHeader, SKCS_OFS_IP_NEXT_LEVEL_PROTOCOL);
-
-       if (IpHeaderChecksum != 0xffff) {
-               pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxErrCts++;
-               /* the NDIS tester wants to know the upper level protocol too */
-               if (NextLevelProtocol == SKCS_PROTO_ID_TCP) {
-                       return(SKCS_STATUS_IP_CSUM_ERROR_TCP);
-               }
-               else if (NextLevelProtocol == SKCS_PROTO_ID_UDP) {
-                       return(SKCS_STATUS_IP_CSUM_ERROR_UDP);
-               }
-               return (SKCS_STATUS_IP_CSUM_ERROR);
-       }
-
-       /*
-        * Check if this is a TCP or UDP frame and if we should calculate the
-        * TCP/UDP pseudo header checksum.
-        *
-        * Also clear all protocol bit flags of protocols not present in the
-        * frame.
-        */
-
-       if ((pAc->Csum.ReceiveFlags[NetNumber] & SKCS_PROTO_TCP) != 0 &&
-               NextLevelProtocol == SKCS_PROTO_ID_TCP) {
-               /* TCP/IP frame. */
-               NextLevelProtoStats =
-                       &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_TCP];
-       }
-       else if ((pAc->Csum.ReceiveFlags[NetNumber] & SKCS_PROTO_UDP) != 0 &&
-               NextLevelProtocol == SKCS_PROTO_ID_UDP) {
-               /* UDP/IP frame. */
-               NextLevelProtoStats =
-                       &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_UDP];
-       }
-       else {
-               /*
-                * Either not a TCP or UDP frame and/or TCP/UDP processing not
-                * specified.
-                */
-               return (SKCS_STATUS_IP_CSUM_OK);
-       }
-
-       /* Check if this is an IP fragment. */
-
-       /*
-        * Note: An IP fragment has a non-zero "Fragment Offset" field and/or
-        * the "More Fragments" bit set. Thus, if both the "Fragment Offset"
-        * and the "More Fragments" are zero, it is *not* a fragment. We can
-        * easily check both at the same time since they are in the same 16-bit
-        * word.
-        */
-
-       if ((*(SK_U16 *)
-               SKCS_IDX(pIpHeader, SKCS_OFS_IP_FLAGS_AND_FRAGMENT_OFFSET) &
-               ~SKCS_IP_DONT_FRAGMENT) != 0) {
-               /* IP fragment; ignore all other protocols. */
-               NextLevelProtoStats->RxUnableCts++;
-               return (SKCS_STATUS_IP_FRAGMENT);
-       }
-
-       /*
-        * 08-May-2000 ra
-        *
-        * From RFC 768 (UDP)
-        * If the computed checksum is zero, it is transmitted as all ones (the
-        * equivalent in one's complement arithmetic).  An all zero transmitted
-        * checksum value means that the transmitter generated no checksum (for
-        * debugging or for higher level protocols that don't care).
-        */
-
-       if (NextLevelProtocol == SKCS_PROTO_ID_UDP &&
-               *(SK_U16*)SKCS_IDX(pIpHeader, IpHeaderLength + 6) == 0x0000) {
-
-               NextLevelProtoStats->RxOkCts++;
-               
-               return (SKCS_STATUS_IP_CSUM_OK_NO_UDP);
-       }
-
-       /*
-        * Calculate the TCP/UDP checksum.
-        */
-
-       /* Get total length of IP header and data. */
-
-       IpDataLength =
-               *(SK_U16 *) SKCS_IDX(pIpHeader, SKCS_OFS_IP_TOTAL_LENGTH);
-
-       /* Get length of IP data portion. */
-
-       IpDataLength = SKCS_NTOH16(IpDataLength) - IpHeaderLength;
-
-       NextLevelProtocolChecksum =
-
-               /* Calculate the pseudo header checksum. */
-
-               (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader,
-                       SKCS_OFS_IP_SOURCE_ADDRESS + 0) +
-               (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader,
-                       SKCS_OFS_IP_SOURCE_ADDRESS + 2) +
-               (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader,
-                       SKCS_OFS_IP_DESTINATION_ADDRESS + 0) +
-               (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader,
-                       SKCS_OFS_IP_DESTINATION_ADDRESS + 2) +
-               (unsigned long) SKCS_HTON16(NextLevelProtocol) +
-               (unsigned long) SKCS_HTON16(IpDataLength) +
-
-               /* Add the TCP/UDP header checksum. */
-
-               (unsigned long) IpDataChecksum;
-
-       /* Add-in any carries. */
-
-       SKCS_OC_ADD(NextLevelProtocolChecksum, NextLevelProtocolChecksum, 0);
-
-       /* Add-in any new carry. */
-
-       SKCS_OC_ADD(NextLevelProtocolChecksum, NextLevelProtocolChecksum, 0);
-
-       /* Check if the TCP/UDP checksum is ok. */
-
-       if ((unsigned) NextLevelProtocolChecksum == 0xffff) {
-
-               /* TCP/UDP checksum ok. */
-
-               NextLevelProtoStats->RxOkCts++;
-
-               return (NextLevelProtocol == SKCS_PROTO_ID_TCP ?
-                       SKCS_STATUS_TCP_CSUM_OK : SKCS_STATUS_UDP_CSUM_OK);
-       }
-       
-       /* TCP/UDP checksum error. */
-
-       NextLevelProtoStats->RxErrCts++;
-
-       return (NextLevelProtocol == SKCS_PROTO_ID_TCP ?
-               SKCS_STATUS_TCP_CSUM_ERROR : SKCS_STATUS_UDP_CSUM_ERROR);
-}      /* SkCsGetReceiveInfo */
-
-
-/******************************************************************************
- *
- *     SkCsSetReceiveFlags - set checksum receive flags
- *
- * Description:
- *     Use this function to set the various receive flags. According to the
- *     protocol flags set by the caller, the start offsets within received
- *     packets of the two hardware checksums are returned. These offsets must
- *     be stored in all receive descriptors.
- *
- * Arguments:
- *     pAc - Pointer to adapter context struct.
- *
- *     ReceiveFlags - Any combination of SK_PROTO_XXX flags of the protocols
- *     for which the caller wants checksum information on received frames.
- *
- *     pChecksum1Offset - The start offset of the first receive descriptor
- *     hardware checksum to be calculated for received frames is returned
- *     here.
- *
- *     pChecksum2Offset - The start offset of the second receive descriptor
- *     hardware checksum to be calculated for received frames is returned
- *     here.
- *
- * Returns: N/A
- *     Returns the two hardware checksum start offsets.
- */
-void SkCsSetReceiveFlags(
-SK_AC          *pAc,                           /* Adapter context struct. */
-unsigned       ReceiveFlags,           /* New receive flags. */
-unsigned       *pChecksum1Offset,      /* Offset for hardware checksum 1. */
-unsigned       *pChecksum2Offset,      /* Offset for hardware checksum 2. */
-int                    NetNumber)
-{
-       /* Save the receive flags. */
-
-       pAc->Csum.ReceiveFlags[NetNumber] = ReceiveFlags;
-
-       /* First checksum start offset is the IP header. */
-       *pChecksum1Offset = SKCS_MAC_HEADER_SIZE;
-
-       /*
-        * Second checksum start offset is the IP data. Note that this may vary
-        * if there are any IP header options in the actual packet.
-        */
-       *pChecksum2Offset = SKCS_MAC_HEADER_SIZE + SKCS_IP_HEADER_SIZE;
-}      /* SkCsSetReceiveFlags */
-
-#ifndef SK_CS_CALCULATE_CHECKSUM
-
-/******************************************************************************
- *
- *     SkCsCalculateChecksum - calculate checksum for specified data
- *
- * Description:
- *     Calculate and return the 16-bit Internet Checksum for the specified
- *     data.
- *
- * Arguments:
- *     pData - Pointer to data for which the checksum shall be calculated.
- *     Note: The pointer should be aligned on a 16-bit boundary.
- *
- *     Length - Length in bytes of data to checksum.
- *
- * Returns:
- *     The 16-bit Internet Checksum for the specified data.
- *
- *     Note: The checksum is calculated in the machine's natural byte order,
- *     i.e. little vs. big endian. Thus, the resulting checksum is different
- *     for the same input data on little and big endian machines.
- *
- *     However, when written back to the network packet, the byte order is
- *     always in correct network order.
- */
-unsigned SkCsCalculateChecksum(
-void           *pData,         /* Data to checksum. */
-unsigned       Length)         /* Length of data. */
-{
-       SK_U16 *pU16;           /* Pointer to the data as 16-bit words. */
-       unsigned long Checksum; /* Checksum; must be at least 32 bits. */
-
-       /* Sum up all 16-bit words. */
-
-       pU16 = (SK_U16 *) pData;
-       for (Checksum = 0; Length > 1; Length -= 2) {
-               Checksum += *pU16++;
-       }
-
-       /* If this is an odd number of bytes, add-in the last byte. */
-
-       if (Length > 0) {
-#ifdef SK_BIG_ENDIAN
-               /* Add the last byte as the high byte. */
-               Checksum += ((unsigned) *(SK_U8 *) pU16) << 8;
-#else  /* !SK_BIG_ENDIAN */
-               /* Add the last byte as the low byte. */
-               Checksum += *(SK_U8 *) pU16;
-#endif /* !SK_BIG_ENDIAN */
-       }
-
-       /* Add-in any carries. */
-
-       SKCS_OC_ADD(Checksum, Checksum, 0);
-
-       /* Add-in any new carry. */
-
-       SKCS_OC_ADD(Checksum, Checksum, 0);
-
-       /* Note: All bits beyond the 16-bit limit are now zero. */
-
-       return ((unsigned) Checksum);
-}      /* SkCsCalculateChecksum */
-
-#endif /* SK_CS_CALCULATE_CHECKSUM */
-
-/******************************************************************************
- *
- *     SkCsEvent - the CSUM event dispatcher
- *
- * Description:
- *     This is the event handler for the CSUM module.
- *
- * Arguments:
- *     pAc - Pointer to adapter context.
- *
- *     Ioc - I/O context.
- *
- *     Event -  Event id.
- *
- *     Param - Event dependent parameter.
- *
- * Returns:
- *     The 16-bit Internet Checksum for the specified data.
- *
- *     Note: The checksum is calculated in the machine's natural byte order,
- *     i.e. little vs. big endian. Thus, the resulting checksum is different
- *     for the same input data on little and big endian machines.
- *
- *     However, when written back to the network packet, the byte order is
- *     always in correct network order.
- */
-int SkCsEvent(
-SK_AC          *pAc,   /* Pointer to adapter context. */
-SK_IOC         Ioc,    /* I/O context. */
-SK_U32         Event,  /* Event id. */
-SK_EVPARA      Param)  /* Event dependent parameter. */
-{
-       int ProtoIndex;
-       int     NetNumber;
-
-       switch (Event) {
-       /*
-        * Clear protocol statistics.
-        *
-        * Param - Protocol index, or -1 for all protocols.
-        *               - Net number.
-        */
-       case SK_CSUM_EVENT_CLEAR_PROTO_STATS:
-
-               ProtoIndex = (int)Param.Para32[1];
-               NetNumber = (int)Param.Para32[0];
-               if (ProtoIndex < 0) {   /* Clear for all protocols. */
-                       if (NetNumber >= 0) {
-                               SK_MEMSET(&pAc->Csum.ProtoStats[NetNumber][0], 0,
-                                       sizeof(pAc->Csum.ProtoStats[NetNumber]));
-                       }
-               }
-               else {                                  /* Clear for individual protocol. */
-                       SK_MEMSET(&pAc->Csum.ProtoStats[NetNumber][ProtoIndex], 0,
-                               sizeof(pAc->Csum.ProtoStats[NetNumber][ProtoIndex]));
-               }
-               break;
-       default:
-               break;
-       }
-       return (0);     /* Success. */
-}      /* SkCsEvent */
-
-#endif /* SK_USE_CSUM */
index fb639959292b3656d375a04c68cc6bee4d3e8fe1..b71769ae4603ac3a0f89c07aefd626f63795438e 100644 (file)
@@ -549,4 +549,6 @@ struct ethtool_ops SkGeEthtoolOps = {
        .phys_id                = locateDevice,
        .get_pauseparam         = getPauseParams,
        .set_pauseparam         = setPauseParams,
+       .get_link               = ethtool_op_get_link,
+       .get_perm_addr          = ethtool_op_get_perm_addr,
 };
index b18c92cb629e8a34ee95888f0ecd8498eacddf6a..00c5d7f04c68547acfde46204d5b4041098db6bf 100644 (file)
  *             "h/skgeinit.h"
  *             "h/skaddr.h"
  *             "h/skgesirq.h"
- *             "h/skcsum.h"
  *             "h/skrlmt.h"
  *
  ******************************************************************************/
 #include       <linux/init.h>
 #include       <linux/proc_fs.h>
 #include       <linux/dma-mapping.h>
+#include       <linux/ip.h>
 
 #include       "h/skdrv1st.h"
 #include       "h/skdrv2nd.h"
@@ -601,11 +601,6 @@ SK_BOOL    DualNet;
                        return(-EAGAIN);
        }
 
-       SkCsSetReceiveFlags(pAC,
-               SKCS_PROTO_IP | SKCS_PROTO_TCP | SKCS_PROTO_UDP,
-               &pAC->CsOfs1, &pAC->CsOfs2, 0);
-       pAC->CsOfs = (pAC->CsOfs2 << 16) | pAC->CsOfs1;
-
        BoardInitMem(pAC);
        /* tschilling: New common function with minimum size check. */
        DualNet = SK_FALSE;
@@ -823,7 +818,7 @@ uintptr_t VNextDescr;       /* the virtual bus address of the next descriptor */
                /* set the pointers right */
                pDescr->VNextRxd = VNextDescr & 0xffffffffULL;
                pDescr->pNextRxd = pNextDescr;
-               pDescr->TcpSumStarts = pAC->CsOfs;
+               pDescr->TcpSumStarts = 0;
 
                /* advance one step */
                pPrevDescr = pDescr;
@@ -1505,8 +1500,6 @@ struct sk_buff    *pMessage)      /* pointer to send-message              */
        TXD             *pOldTxd;
        unsigned long    Flags;
        SK_U64           PhysAddr;
-       int              Protocol;
-       int              IpHeaderLength;
        int              BytesSend = pMessage->len;
 
        SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_TX_PROGRESS, ("X"));
@@ -1579,8 +1572,10 @@ struct sk_buff   *pMessage)      /* pointer to send-message              */
        pTxd->pMBuf     = pMessage;
 
        if (pMessage->ip_summed == CHECKSUM_HW) {
-               Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xff);
-               if ((Protocol == C_PROTO_ID_UDP) && 
+               u16 hdrlen = pMessage->h.raw - pMessage->data;
+               u16 offset = hdrlen + pMessage->csum;
+
+               if ((pMessage->h.ipiph->protocol == IPPROTO_UDP ) &&
                        (pAC->GIni.GIChipRev == 0) &&
                        (pAC->GIni.GIChipId == CHIP_ID_YUKON)) {
                        pTxd->TBControl = BMU_TCP_CHECK;
@@ -1588,14 +1583,9 @@ struct sk_buff   *pMessage)      /* pointer to send-message              */
                        pTxd->TBControl = BMU_UDP_CHECK;
                }
 
-               IpHeaderLength  = (SK_U8)pMessage->data[C_OFFSET_IPHEADER];
-               IpHeaderLength  = (IpHeaderLength & 0xf) * 4;
-               pTxd->TcpSumOfs = 0; /* PH-Checksum already calculated */
-               pTxd->TcpSumSt  = C_LEN_ETHERMAC_HEADER + IpHeaderLength + 
-                                                       (Protocol == C_PROTO_ID_UDP ?
-                                                       C_OFFSET_UDPHEADER_UDPCS : 
-                                                       C_OFFSET_TCPHEADER_TCPCS);
-               pTxd->TcpSumWr  = C_LEN_ETHERMAC_HEADER + IpHeaderLength;
+               pTxd->TcpSumOfs = 0;
+               pTxd->TcpSumSt  = hdrlen;
+               pTxd->TcpSumWr  = offset;
 
                pTxd->TBControl |= BMU_OWN | BMU_STF | 
                                   BMU_SW  | BMU_EOF |
@@ -1658,11 +1648,10 @@ struct sk_buff  *pMessage)      /* pointer to send-message              */
        TXD             *pTxdLst;
        int              CurrFrag;
        int              BytesSend;
-       int              IpHeaderLength; 
-       int              Protocol;
        skb_frag_t      *sk_frag;
        SK_U64           PhysAddr;
        unsigned long    Flags;
+       SK_U32           Control;
 
        spin_lock_irqsave(&pTxPort->TxDesRingLock, Flags);
 #ifndef USE_TX_COMPLETE
@@ -1685,7 +1674,6 @@ struct sk_buff    *pMessage)      /* pointer to send-message              */
        pTxdFst   = pTxd;
        pTxdLst   = pTxd;
        BytesSend = 0;
-       Protocol  = 0;
 
        /* 
        ** Map the first fragment (header) into the DMA-space
@@ -1703,32 +1691,31 @@ struct sk_buff  *pMessage)      /* pointer to send-message              */
        ** Does the HW need to evaluate checksum for TCP or UDP packets? 
        */
        if (pMessage->ip_summed == CHECKSUM_HW) {
-               pTxd->TBControl = BMU_STF | BMU_STFWD | skb_headlen(pMessage);
+               u16 hdrlen = pMessage->h.raw - pMessage->data;
+               u16 offset = hdrlen + pMessage->csum;
+
+               Control = BMU_STFWD;
+
                /* 
                ** We have to use the opcode for tcp here,  because the
                ** opcode for udp is not working in the hardware yet 
                ** (Revision 2.0)
                */
-               Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xff);
-               if ((Protocol == C_PROTO_ID_UDP) && 
+               if ((pMessage->h.ipiph->protocol == IPPROTO_UDP ) &&
                        (pAC->GIni.GIChipRev == 0) &&
                        (pAC->GIni.GIChipId == CHIP_ID_YUKON)) {
-                       pTxd->TBControl |= BMU_TCP_CHECK;
+                       Control |= BMU_TCP_CHECK;
                } else {
-                       pTxd->TBControl |= BMU_UDP_CHECK;
+                       Control |= BMU_UDP_CHECK;
                }
 
-               IpHeaderLength  = ((SK_U8)pMessage->data[C_OFFSET_IPHEADER] & 0xf)*4;
-               pTxd->TcpSumOfs = 0; /* PH-Checksum already claculated */
-               pTxd->TcpSumSt  = C_LEN_ETHERMAC_HEADER + IpHeaderLength +
-                                               (Protocol == C_PROTO_ID_UDP ?
-                                               C_OFFSET_UDPHEADER_UDPCS :
-                                               C_OFFSET_TCPHEADER_TCPCS);
-               pTxd->TcpSumWr  = C_LEN_ETHERMAC_HEADER + IpHeaderLength;
-       } else {
-               pTxd->TBControl = BMU_CHECK | BMU_SW | BMU_STF |
-                                       skb_headlen(pMessage);
-       }
+               pTxd->TcpSumOfs = 0;
+               pTxd->TcpSumSt  = hdrlen;
+               pTxd->TcpSumWr  = offset;
+       } else
+               Control = BMU_CHECK | BMU_SW;
+
+       pTxd->TBControl = BMU_STF | Control | skb_headlen(pMessage);
 
        pTxd = pTxd->pNextTxd;
        pTxPort->TxdRingFree--;
@@ -1752,40 +1739,18 @@ struct sk_buff  *pMessage)      /* pointer to send-message              */
                pTxd->VDataHigh = (SK_U32) (PhysAddr >> 32);
                pTxd->pMBuf     = pMessage;
                
-               /* 
-               ** Does the HW need to evaluate checksum for TCP or UDP packets? 
-               */
-               if (pMessage->ip_summed == CHECKSUM_HW) {
-                       pTxd->TBControl = BMU_OWN | BMU_SW | BMU_STFWD;
-                       /* 
-                       ** We have to use the opcode for tcp here because the 
-                       ** opcode for udp is not working in the hardware yet 
-                       ** (revision 2.0)
-                       */
-                       if ((Protocol == C_PROTO_ID_UDP) && 
-                               (pAC->GIni.GIChipRev == 0) &&
-                               (pAC->GIni.GIChipId == CHIP_ID_YUKON)) {
-                               pTxd->TBControl |= BMU_TCP_CHECK;
-                       } else {
-                               pTxd->TBControl |= BMU_UDP_CHECK;
-                       }
-               } else {
-                       pTxd->TBControl = BMU_CHECK | BMU_SW | BMU_OWN;
-               }
+               pTxd->TBControl = Control | BMU_OWN | sk_frag->size;;
 
                /* 
                ** Do we have the last fragment? 
                */
                if( (CurrFrag+1) == skb_shinfo(pMessage)->nr_frags )  {
 #ifdef USE_TX_COMPLETE
-                       pTxd->TBControl |= BMU_EOF | BMU_IRQ_EOF | sk_frag->size;
+                       pTxd->TBControl |= BMU_EOF | BMU_IRQ_EOF;
 #else
-                       pTxd->TBControl |= BMU_EOF | sk_frag->size;
+                       pTxd->TBControl |= BMU_EOF;
 #endif
                        pTxdFst->TBControl |= BMU_OWN | BMU_SW;
-
-               } else {
-                       pTxd->TBControl |= sk_frag->size;
                }
                pTxdLst = pTxd;
                pTxd    = pTxd->pNextTxd;
@@ -2032,7 +1997,6 @@ SK_U32                    Control;                /* control field of descriptor */
 struct sk_buff *pMsg;                  /* pointer to message holding frame */
 struct sk_buff *pNewMsg;               /* pointer to a new message for copying frame */
 int                            FrameLength;    /* total length of received frame */
-int                            IpFrameLength;
 SK_MBUF                        *pRlmtMbuf;             /* ptr to a buffer for giving a frame to rlmt */
 SK_EVPARA              EvPara;                 /* an event parameter union */  
 unsigned long  Flags;                  /* for spin lock */
@@ -2045,10 +2009,6 @@ SK_BOOL                  IsMc;
 SK_BOOL  IsBadFrame;                   /* Bad frame */
 
 SK_U32                 FrameStat;
-unsigned short Csum1;
-unsigned short Csum2;
-unsigned short Type;
-int                            Result;
 SK_U64                 PhysAddr;
 
 rx_start:      
@@ -2177,8 +2137,8 @@ rx_start:
                                                    (dma_addr_t) PhysAddr,
                                                    FrameLength,
                                                    PCI_DMA_FROMDEVICE);
-                       eth_copy_and_sum(pNewMsg, pMsg->data,
-                               FrameLength, 0);
+                       memcpy(pNewMsg->data, pMsg, FrameLength);
+
                        pci_dma_sync_single_for_device(pAC->PciDev,
                                                       (dma_addr_t) PhysAddr,
                                                       FrameLength,
@@ -2206,69 +2166,16 @@ rx_start:
 
                        /* set length in message */
                        skb_put(pMsg, FrameLength);
-                       /* hardware checksum */
-                       Type = ntohs(*((short*)&pMsg->data[12]));
+               } /* frame > SK_COPY_TRESHOLD */
 
 #ifdef USE_SK_RX_CHECKSUM
-                       if (Type == 0x800) {
-                               Csum1=le16_to_cpu(pRxd->TcpSums & 0xffff);
-                               Csum2=le16_to_cpu((pRxd->TcpSums >> 16) & 0xffff);
-                               IpFrameLength = (int) ntohs((unsigned short)
-                                                               ((unsigned short *) pMsg->data)[8]);
-
-                               /*
-                                * Test: If frame is padded, a check is not possible!
-                                * Frame not padded? Length difference must be 14 (0xe)!
-                                */
-                               if ((FrameLength - IpFrameLength) != 0xe) {
-                               /* Frame padded => TCP offload not possible! */
-                                       pMsg->ip_summed = CHECKSUM_NONE;
-                               } else {
-                               /* Frame not padded => TCP offload! */
-                                       if ((((Csum1 & 0xfffe) && (Csum2 & 0xfffe)) &&
-                                               (pAC->GIni.GIChipId == CHIP_ID_GENESIS)) ||
-                                               (pAC->ChipsetType)) {
-                                               Result = SkCsGetReceiveInfo(pAC,
-                                                       &pMsg->data[14],
-                                                       Csum1, Csum2, pRxPort->PortIndex);
-                                               if (Result ==
-                                                       SKCS_STATUS_IP_FRAGMENT ||
-                                                       Result ==
-                                                       SKCS_STATUS_IP_CSUM_OK ||
-                                                       Result ==
-                                                       SKCS_STATUS_TCP_CSUM_OK ||
-                                                       Result ==
-                                                       SKCS_STATUS_UDP_CSUM_OK) {
-                                                               pMsg->ip_summed =
-                                                               CHECKSUM_UNNECESSARY;
-                                               }
-                                               else if (Result ==
-                                                       SKCS_STATUS_TCP_CSUM_ERROR ||
-                                                       Result ==
-                                                       SKCS_STATUS_UDP_CSUM_ERROR ||
-                                                       Result ==
-                                                       SKCS_STATUS_IP_CSUM_ERROR_UDP ||
-                                                       Result ==
-                                                       SKCS_STATUS_IP_CSUM_ERROR_TCP ||
-                                                       Result ==
-                                                       SKCS_STATUS_IP_CSUM_ERROR ) {
-                                                       /* HW Checksum error */
-                                                       SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
-                                                       SK_DBGCAT_DRV_RX_PROGRESS,
-                                                       ("skge: CRC error. Frame dropped!\n"));
-                                                       goto rx_failed;
-                                               } else {
-                                                               pMsg->ip_summed =
-                                                               CHECKSUM_NONE;
-                                               }
-                                       }/* checksumControl calculation valid */
-                               } /* Frame length check */
-                       } /* IP frame */
+               pMsg->csum = pRxd->TcpSums;
+               pMsg->ip_summed = CHECKSUM_HW;
 #else
-                       pMsg->ip_summed = CHECKSUM_NONE;        
+               pMsg->ip_summed = CHECKSUM_NONE;
 #endif
-               } /* frame > SK_COPY_TRESHOLD */
-               
+
+
                SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("V"));
                ForRlmt = SK_RLMT_RX_PROTOCOL;
 #if 0
@@ -4946,7 +4853,7 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
        dev->irq = pdev->irq;
        error = SkGeInitPCI(pAC);
        if (error) {
-               printk("SKGE: PCI setup failed: %i\n", error);
+               printk(KERN_ERR "sk98lin: PCI setup failed: %i\n", error);
                goto out_free_netdev;
        }
 
@@ -4982,7 +4889,7 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
 
        /* Register net device */
        if (register_netdev(dev)) {
-               printk(KERN_ERR "SKGE: Could not register device.\n");
+               printk(KERN_ERR "sk98lin: Could not register device.\n");
                goto out_free_resources;
        }
 
@@ -5001,8 +4908,8 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
 
        SkGeYellowLED(pAC, pAC->IoBase, 1);
 
-
        memcpy(&dev->dev_addr, &pAC->Addr.Net[0].CurrentMacAddress, 6);
+       memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
 
        SkGeProcCreate(dev);
 
@@ -5048,13 +4955,14 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
 #endif
 
                if (register_netdev(dev)) {
-                       printk(KERN_ERR "SKGE: Could not register device.\n");
+                       printk(KERN_ERR "sk98lin: Could not register device for seconf port.\n");
                        free_netdev(dev);
                        pAC->dev[1] = pAC->dev[0];
                } else {
                        SkGeProcCreate(dev);
                        memcpy(&dev->dev_addr,
                                        &pAC->Addr.Net[1].CurrentMacAddress, 6);
+                       memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
        
                        printk("%s: %s\n", dev->name, pAC->DeviceStr);
                        printk("      PrefPort:B  RlmtMode:Dual Check Link State\n");
index 596c93b12daad126b18e9ae305bd2c1c8f695687..716467879b9c5e24b254219fc6916d09888dfa05 100644 (file)
@@ -2300,14 +2300,12 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev)
        td->dma_hi = map >> 32;
 
        if (skb->ip_summed == CHECKSUM_HW) {
-               const struct iphdr *ip
-                       = (const struct iphdr *) (skb->data + ETH_HLEN);
                int offset = skb->h.raw - skb->data;
 
                /* This seems backwards, but it is what the sk98lin
                 * does.  Looks like hardware is wrong?
                 */
-               if (ip->protocol == IPPROTO_UDP
+               if (skb->h.ipiph->protocol == IPPROTO_UDP
                    && hw->chip_rev == 0 && hw->chip_id == CHIP_ID_YUKON)
                        control = BMU_TCP_CHECK;
                else
index 340ab4ee4b67a1157a699f6f7b25778014af1116..7a92b1cbd6aadf80f8aaef65df9e930df82da984 100644 (file)
@@ -2755,8 +2755,8 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
        SET_NETDEV_DEV(dev, dmdev);
 
 
-       if (test_bit(FLAG_MPI,&ai->flags))
-               reset_card (dev, 1);
+       reset_card (dev, 1);
+       msleep(400);
 
        rc = request_irq( dev->irq, airo_interrupt, SA_SHIRQ, dev->name, dev );
        if (rc) {
index 488ab06fb79f46e81061f75d72c872121f286ee5..6fd0bf736830f4c7a0694005d32b50613f05818b 100644 (file)
@@ -3512,9 +3512,8 @@ static int orinoco_ioctl_setpower(struct net_device *dev,
                        break;
                default:
                        err = -EINVAL;
-               }
-               if (err)
                        goto out;
+               }
                
                if (prq->flags & IW_POWER_TIMEOUT) {
                        priv->pm_on = 1;
index 2c22b4b3619d58f6c1c1a5c107597eb724b2a7e5..078579ae635905477212d8894414b6e0be86c204 100644 (file)
@@ -355,9 +355,10 @@ static void add_pcc_socket(ulong base, int irq, ulong mapaddr, kio_addr_t ioaddr
 #ifndef CONFIG_PLAT_USRV
        /* insert interrupt */
        request_irq(irq, pcc_interrupt, 0, "m32r_cfc", pcc_interrupt);
+#ifndef CONFIG_PLAT_MAPPI3
        /* eject interrupt */
        request_irq(irq+1, pcc_interrupt, 0, "m32r_cfc", pcc_interrupt);
-
+#endif
        debug(3, "m32r_cfc: enable CFMSK, RDYSEL\n");
        pcc_set(pcc_sockets, (unsigned int)PLD_CFIMASK, 0x01);
 #endif /* CONFIG_PLAT_USRV */
index dfea346b00a559975cc83853bafbf4f59dbcebd9..f9792528e33fb473d7e03314d5318b4aa0863ef9 100644 (file)
@@ -380,23 +380,23 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))
 
        spin_lock_irqsave(&adapter->lock, flags);
        scb = mega_build_cmd(adapter, scmd, &busy);
+       if (!scb)
+               goto out;
 
-       if(scb) {
-               scb->state |= SCB_PENDQ;
-               list_add_tail(&scb->list, &adapter->pending_list);
+       scb->state |= SCB_PENDQ;
+       list_add_tail(&scb->list, &adapter->pending_list);
 
-               /*
-                * Check if the HBA is in quiescent state, e.g., during a
-                * delete logical drive opertion. If it is, don't run
-                * the pending_list.
-                */
-               if(atomic_read(&adapter->quiescent) == 0) {
-                       mega_runpendq(adapter);
-               }
-               return 0;
-       }
-       spin_unlock_irqrestore(&adapter->lock, flags);
+       /*
+        * Check if the HBA is in quiescent state, e.g., during a
+        * delete logical drive opertion. If it is, don't run
+        * the pending_list.
+        */
+       if (atomic_read(&adapter->quiescent) == 0)
+               mega_runpendq(adapter);
 
+       busy = 0;
+ out:
+       spin_unlock_irqrestore(&adapter->lock, flags);
        return busy;
 }
 
@@ -4677,7 +4677,6 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 
        adapter->flag = flag;
        spin_lock_init(&adapter->lock);
-       scsi_assign_lock(host, &adapter->lock);
 
        host->cmd_per_lun = max_cmd_per_lun;
        host->max_sectors = max_sectors_per_io;
index e08510d09ff6fa6ef26ec6832781b6dd90ef9b2a..d2bcd1f87cd61b10349d715c1795d2d5cf5761e5 100644 (file)
@@ -102,7 +102,7 @@ static unsigned int share_irqs = SERIAL8250_SHARE_IRQS;
 #define SERIAL_PORT_DFNS
 #endif
 
-static struct old_serial_port old_serial_port[] = {
+static const struct old_serial_port old_serial_port[] = {
        SERIAL_PORT_DFNS /* defined in asm/serial.h */
 };
 
index 5c3c03932d6d45663bb39e790d565f9c6623f934..8d92adfbb8bd70316253a1e444b4ad8a96497de7 100644 (file)
@@ -468,7 +468,7 @@ static unsigned short timedia_eight_port[] = {
        0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
 };
 
-static struct timedia_struct {
+static const struct timedia_struct {
        int num;
        unsigned short *ids;
 } timedia_data[] = {
index 2331296e1e17b068db98d8097bd85e1c80341898..c17d680e3f04ddfe954b02e763a390aef2cd7478 100644 (file)
@@ -1779,7 +1779,7 @@ struct baud_rates {
        unsigned int cflag;
 };
 
-static struct baud_rates baud_rates[] = {
+static const struct baud_rates baud_rates[] = {
        { 921600, B921600 },
        { 460800, B460800 },
        { 230400, B230400 },
index 2c7d3ef76e8e8d627eca5c77f2c561b5d7bedc8c..7ce0c7e66d3704b6664adb42e342599f8248cabd 100644 (file)
@@ -85,7 +85,7 @@ struct multi_id {
        int multi;              /* 1 = multifunction, > 1 = # ports */
 };
 
-static struct multi_id multi_id[] = {
+static const struct multi_id multi_id[] = {
        { MANFID_OMEGA,   PRODID_OMEGA_QSP_100,         4 },
        { MANFID_QUATECH, PRODID_QUATECH_DUAL_RS232,    2 },
        { MANFID_QUATECH, PRODID_QUATECH_DUAL_RS232_D1, 2 },
@@ -354,8 +354,8 @@ next_tuple(client_handle_t handle, tuple_t * tuple, cisparse_t * parse)
 
 static int simple_config(dev_link_t *link)
 {
-       static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
-       static int size_table[2] = { 8, 16 };
+       static const kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
+       static const int size_table[2] = { 8, 16 };
        client_handle_t handle = link->handle;
        struct serial_info *info = link->priv;
        struct serial_cfg_mem *cfg_mem;
index 79861ee12a29c44c9837ea72f2feaf8312428848..9d59dc62e6d2271c61773651c5163559bdb64a7b 100644 (file)
@@ -787,6 +787,9 @@ static const struct usb_device_id cxacru_usb_ids[] = {
        { /* V = Conexant                       P = ADSL modem (Hasbani project)        */
                USB_DEVICE(0x0572, 0xcb00),     .driver_info = (unsigned long) &cxacru_cb00
        },
+       { /* V = Conexant             P = ADSL modem (Well PTI-800 */
+               USB_DEVICE(0x0572, 0xcb02),     .driver_info = (unsigned long) &cxacru_cb00
+       },
        { /* V = Conexant                       P = ADSL modem                          */
                USB_DEVICE(0x0572, 0xcb01),     .driver_info = (unsigned long) &cxacru_cb00
        },
index c466739428b2c501eb99c809f02226f55c7c9a76..2e6593e6c1bd66223ef57293a013ae8be5962395 100644 (file)
@@ -879,7 +879,7 @@ static int usbatm_atm_init(struct usbatm_data *instance)
 
  fail:
        instance->atm_dev = NULL;
-       shutdown_atm_dev(atm_dev); /* usbatm_atm_dev_close will eventually be called */
+       atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */
        return ret;
 }
 
@@ -1164,7 +1164,7 @@ void usbatm_usb_disconnect(struct usb_interface *intf)
 
        /* ATM finalize */
        if (instance->atm_dev)
-               shutdown_atm_dev(instance->atm_dev);
+               atm_dev_deregister(instance->atm_dev);
 
        usbatm_put_instance(instance);  /* taken in usbatm_usb_probe */
 }
index 5131d88e8c5bd7c5b39b0e9b1f27d3a2c5a85eda..29b5b2a6e183e11aab66d4615d502869bfeb9812 100644 (file)
@@ -219,6 +219,7 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t message)
                        goto done;
                }
        }
+       synchronize_irq(dev->irq);
 
        /* FIXME until the generic PM interfaces change a lot more, this
         * can't use PCI D1 and D2 states.  For example, the confusion
@@ -392,7 +393,7 @@ int usb_hcd_pci_resume (struct pci_dev *dev)
 
        dev->dev.power.power_state = PMSG_ON;
 
-       hcd->saw_irq = 0;
+       clear_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
 
        if (hcd->driver->resume) {
                retval = hcd->driver->resume(hcd);
index 5e5f65a475ab95c2d50b372d70d4f5533ad98f6e..da24c31ee00d97138d5db16d8e575b013a5056ff 100644 (file)
@@ -1315,11 +1315,12 @@ static int hcd_unlink_urb (struct urb *urb, int status)
         * finish unlinking the initial failed usb_set_address()
         * or device descriptor fetch.
         */
-       if (!hcd->saw_irq && hcd->self.root_hub != urb->dev) {
+       if (!test_bit(HCD_FLAG_SAW_IRQ, &hcd->flags)
+           && hcd->self.root_hub != urb->dev) {
                dev_warn (hcd->self.controller, "Unlink after no-IRQ?  "
                        "Controller is probably using the wrong IRQ."
                        "\n");
-               hcd->saw_irq = 1;
+               set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
        }
 
        urb->status = status;
@@ -1649,13 +1650,15 @@ irqreturn_t usb_hcd_irq (int irq, void *__hcd, struct pt_regs * r)
        struct usb_hcd          *hcd = __hcd;
        int                     start = hcd->state;
 
-       if (start == HC_STATE_HALT)
+       if (unlikely(start == HC_STATE_HALT ||
+           !test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
                return IRQ_NONE;
        if (hcd->driver->irq (hcd, r) == IRQ_NONE)
                return IRQ_NONE;
 
-       hcd->saw_irq = 1;
-       if (hcd->state == HC_STATE_HALT)
+       set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
+
+       if (unlikely(hcd->state == HC_STATE_HALT))
                usb_hc_died (hcd);
        return IRQ_HANDLED;
 }
@@ -1768,6 +1771,8 @@ int usb_add_hcd(struct usb_hcd *hcd,
 
        dev_info(hcd->self.controller, "%s\n", hcd->product_desc);
 
+       set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+
        /* till now HC has been in an indeterminate state ... */
        if (hcd->driver->reset && (retval = hcd->driver->reset(hcd)) < 0) {
                dev_err(hcd->self.controller, "can't reset\n");
index 24a62a2ff86dd38b11dd3494069b99a8bd9882b2..c8a1b350e2cf045ee71585d1b12a5ff8fe396186 100644 (file)
@@ -72,7 +72,12 @@ struct usb_hcd {     /* usb_bus.hcpriv points to this */
         * hardware info/state
         */
        const struct hc_driver  *driver;        /* hw-specific hooks */
-       unsigned                saw_irq : 1;
+
+       /* Flags that need to be manipulated atomically */
+       unsigned long           flags;
+#define HCD_FLAG_HW_ACCESSIBLE 0x00000001
+#define HCD_FLAG_SAW_IRQ       0x00000002
+
        unsigned                can_wakeup:1;   /* hw supports wakeup? */
        unsigned                remote_wakeup:1;/* sw should use wakeup? */
        unsigned                rh_registered:1;/* is root hub registered? */
index 441c26064b44b3266ac055e4c708548f465183ce..13f73a836e455033c002c49d6efea2219262ac3d 100644 (file)
@@ -121,8 +121,8 @@ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev)
        return 0;
 }
 
-/* called by khubd or root hub (re)init threads; leaves HC in halt state */
-static int ehci_pci_reset(struct usb_hcd *hcd)
+/* called during probe() after chip reset completes */
+static int ehci_pci_setup(struct usb_hcd *hcd)
 {
        struct ehci_hcd         *ehci = hcd_to_ehci(hcd);
        struct pci_dev          *pdev = to_pci_dev(hcd->self.controller);
@@ -141,6 +141,11 @@ static int ehci_pci_reset(struct usb_hcd *hcd)
        if (retval)
                return retval;
 
+       /* data structure init */
+       retval = ehci_init(hcd);
+       if (retval)
+               return retval;
+
        /* NOTE:  only the parts below this line are PCI-specific */
 
        switch (pdev->vendor) {
@@ -154,7 +159,8 @@ static int ehci_pci_reset(struct usb_hcd *hcd)
                /* AMD8111 EHCI doesn't work, according to AMD errata */
                if (pdev->device == 0x7463) {
                        ehci_info(ehci, "ignoring AMD8111 (errata)\n");
-                       return -EIO;
+                       retval = -EIO;
+                       goto done;
                }
                break;
        case PCI_VENDOR_ID_NVIDIA:
@@ -207,9 +213,8 @@ static int ehci_pci_reset(struct usb_hcd *hcd)
        /* REVISIT:  per-port wake capability (PCI 0x62) currently unused */
 
        retval = ehci_pci_reinit(ehci, pdev);
-
-       /* finish init */
-       return ehci_init(hcd);
+done:
+       return retval;
 }
 
 /*-------------------------------------------------------------------------*/
@@ -228,14 +233,36 @@ static int ehci_pci_reset(struct usb_hcd *hcd)
 static int ehci_pci_suspend(struct usb_hcd *hcd, pm_message_t message)
 {
        struct ehci_hcd         *ehci = hcd_to_ehci(hcd);
+       unsigned long           flags;
+       int                     rc = 0;
 
        if (time_before(jiffies, ehci->next_statechange))
                msleep(10);
 
+       /* Root hub was already suspended. Disable irq emission and
+        * mark HW unaccessible, bail out if RH has been resumed. Use
+        * the spinlock to properly synchronize with possible pending
+        * RH suspend or resume activity.
+        *
+        * This is still racy as hcd->state is manipulated outside of
+        * any locks =P But that will be a different fix.
+        */
+       spin_lock_irqsave (&ehci->lock, flags);
+       if (hcd->state != HC_STATE_SUSPENDED) {
+               rc = -EINVAL;
+               goto bail;
+       }
+       writel (0, &ehci->regs->intr_enable);
+       (void)readl(&ehci->regs->intr_enable);
+
+       clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+ bail:
+       spin_unlock_irqrestore (&ehci->lock, flags);
+
        // could save FLADJ in case of Vaux power loss
        // ... we'd only use it to handle clock skew
 
-       return 0;
+       return rc;
 }
 
 static int ehci_pci_resume(struct usb_hcd *hcd)
@@ -251,6 +278,9 @@ static int ehci_pci_resume(struct usb_hcd *hcd)
        if (time_before(jiffies, ehci->next_statechange))
                msleep(100);
 
+       /* Mark hardware accessible again as we are out of D3 state by now */
+       set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+
        /* If CF is clear, we lost PCI Vaux power and need to restart.  */
        if (readl(&ehci->regs->configured_flag) != FLAG_CF)
                goto restart;
@@ -319,7 +349,7 @@ static const struct hc_driver ehci_pci_hc_driver = {
        /*
         * basic lifecycle operations
         */
-       .reset =                ehci_pci_reset,
+       .reset =                ehci_pci_setup,
        .start =                ehci_run,
 #ifdef CONFIG_PM
        .suspend =              ehci_pci_suspend,
index 5bb872c3496d70c3767d1b4f40a8fdd2979ba354..bf03ec0d8ee2222038ee0d928ef61feac9ea94fd 100644 (file)
@@ -912,6 +912,7 @@ submit_async (
        int                     epnum;
        unsigned long           flags;
        struct ehci_qh          *qh = NULL;
+       int                     rc = 0;
 
        qtd = list_entry (qtd_list->next, struct ehci_qtd, qtd_list);
        epnum = ep->desc.bEndpointAddress;
@@ -926,21 +927,28 @@ submit_async (
 #endif
 
        spin_lock_irqsave (&ehci->lock, flags);
+       if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
+                              &ehci_to_hcd(ehci)->flags))) {
+               rc = -ESHUTDOWN;
+               goto done;
+       }
+
        qh = qh_append_tds (ehci, urb, qtd_list, epnum, &ep->hcpriv);
+       if (unlikely(qh == NULL)) {
+               rc = -ENOMEM;
+               goto done;
+       }
 
        /* Control/bulk operations through TTs don't need scheduling,
         * the HC and TT handle it when the TT has a buffer ready.
         */
-       if (likely (qh != NULL)) {
-               if (likely (qh->qh_state == QH_STATE_IDLE))
-                       qh_link_async (ehci, qh_get (qh));
-       }
+       if (likely (qh->qh_state == QH_STATE_IDLE))
+               qh_link_async (ehci, qh_get (qh));
+ done:
        spin_unlock_irqrestore (&ehci->lock, flags);
-       if (unlikely (qh == NULL)) {
+       if (unlikely (qh == NULL))
                qtd_list_free (ehci, urb, qtd_list);
-               return -ENOMEM;
-       }
-       return 0;
+       return rc;
 }
 
 /*-------------------------------------------------------------------------*/
index f0c8aa1ccd5dc016aa8c61ea3b84944c99a25c1c..57e77374d228dd083053b78a26d331a44c4e20cd 100644 (file)
@@ -602,6 +602,12 @@ static int intr_submit (
 
        spin_lock_irqsave (&ehci->lock, flags);
 
+       if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
+                              &ehci_to_hcd(ehci)->flags))) {
+               status = -ESHUTDOWN;
+               goto done;
+       }
+
        /* get qh and force any scheduling errors */
        INIT_LIST_HEAD (&empty);
        qh = qh_append_tds (ehci, urb, &empty, epnum, &ep->hcpriv);
@@ -1456,7 +1462,11 @@ static int itd_submit (struct ehci_hcd *ehci, struct urb *urb,
 
        /* schedule ... need to lock */
        spin_lock_irqsave (&ehci->lock, flags);
-       status = iso_stream_schedule (ehci, urb, stream);
+       if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
+                              &ehci_to_hcd(ehci)->flags)))
+               status = -ESHUTDOWN;
+       else
+               status = iso_stream_schedule (ehci, urb, stream);
        if (likely (status == 0))
                itd_link_urb (ehci, urb, ehci->periodic_size << 3, stream);
        spin_unlock_irqrestore (&ehci->lock, flags);
@@ -1815,7 +1825,11 @@ static int sitd_submit (struct ehci_hcd *ehci, struct urb *urb,
 
        /* schedule ... need to lock */
        spin_lock_irqsave (&ehci->lock, flags);
-       status = iso_stream_schedule (ehci, urb, stream);
+       if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
+                              &ehci_to_hcd(ehci)->flags)))
+               status = -ESHUTDOWN;
+       else
+               status = iso_stream_schedule (ehci, urb, stream);
        if (status == 0)
                sitd_link_urb (ehci, urb, ehci->periodic_size << 3, stream);
        spin_unlock_irqrestore (&ehci->lock, flags);
index 5c0c6c8a7a82a65da4ce6b2a3f70ecef0c1f4746..bf1d9abc07ac37a87d18a3422aaeb23980e880e5 100644 (file)
 
 /*-------------------------------------------------------------------------*/
 
-// #define OHCI_VERBOSE_DEBUG  /* not always helpful */
+#undef OHCI_VERBOSE_DEBUG      /* not always helpful */
 
 /* For initializing controller (mask in an HCFS mode too) */
 #define        OHCI_CONTROL_INIT       OHCI_CTRL_CBSR
@@ -253,6 +253,10 @@ static int ohci_urb_enqueue (
        spin_lock_irqsave (&ohci->lock, flags);
 
        /* don't submit to a dead HC */
+       if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
+               retval = -ENODEV;
+               goto fail;
+       }
        if (!HC_IS_RUNNING(hcd->state)) {
                retval = -ENODEV;
                goto fail;
index e01e77bc324b190bdaf845a7606bed0b5e338c5f..72e3b12a19268c937434b933245d6ad7d014c518 100644 (file)
@@ -53,6 +53,11 @@ static int ohci_bus_suspend (struct usb_hcd *hcd)
 
        spin_lock_irqsave (&ohci->lock, flags);
 
+       if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) {
+               spin_unlock_irqrestore (&ohci->lock, flags);
+               return -ESHUTDOWN;
+       }
+
        ohci->hc_control = ohci_readl (ohci, &ohci->regs->control);
        switch (ohci->hc_control & OHCI_CTRL_HCFS) {
        case OHCI_USB_RESUME:
@@ -140,11 +145,19 @@ static int ohci_bus_resume (struct usb_hcd *hcd)
        struct ohci_hcd         *ohci = hcd_to_ohci (hcd);
        u32                     temp, enables;
        int                     status = -EINPROGRESS;
+       unsigned long           flags;
 
        if (time_before (jiffies, ohci->next_statechange))
                msleep(5);
 
-       spin_lock_irq (&ohci->lock);
+       spin_lock_irqsave (&ohci->lock, flags);
+
+       if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) {
+               spin_unlock_irqrestore (&ohci->lock, flags);
+               return -ESHUTDOWN;
+       }
+
+
        ohci->hc_control = ohci_readl (ohci, &ohci->regs->control);
 
        if (ohci->hc_control & (OHCI_CTRL_IR | OHCI_SCHED_ENABLES)) {
@@ -179,7 +192,7 @@ static int ohci_bus_resume (struct usb_hcd *hcd)
                ohci_dbg (ohci, "lost power\n");
                status = -EBUSY;
        }
-       spin_unlock_irq (&ohci->lock);
+       spin_unlock_irqrestore (&ohci->lock, flags);
        if (status == -EBUSY) {
                (void) ohci_init (ohci);
                return ohci_restart (ohci);
@@ -297,8 +310,8 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf)
        /* handle autosuspended root:  finish resuming before
         * letting khubd or root hub timer see state changes.
         */
-       if ((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER
-                       || !HC_IS_RUNNING(hcd->state)) {
+       if (unlikely((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER
+                    || !HC_IS_RUNNING(hcd->state))) {
                can_suspend = 0;
                goto done;
        }
@@ -508,6 +521,9 @@ static int ohci_hub_control (
        u32             temp;
        int             retval = 0;
 
+       if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
+               return -ESHUTDOWN;
+
        switch (typeReq) {
        case ClearHubFeature:
                switch (wValue) {
index 5f22e6590cd12b82141fe2724c21d9acaf15465a..1b09dde068e11085e08830edc0a38f29c733eeab 100644 (file)
@@ -105,13 +105,36 @@ ohci_pci_start (struct usb_hcd *hcd)
 
 static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message)
 {
-       /* root hub was already suspended */
-       return 0;
+       struct ohci_hcd *ohci = hcd_to_ohci (hcd);
+       unsigned long   flags;
+       int             rc = 0;
+
+       /* Root hub was already suspended. Disable irq emission and
+        * mark HW unaccessible, bail out if RH has been resumed. Use
+        * the spinlock to properly synchronize with possible pending
+        * RH suspend or resume activity.
+        *
+        * This is still racy as hcd->state is manipulated outside of
+        * any locks =P But that will be a different fix.
+        */
+       spin_lock_irqsave (&ohci->lock, flags);
+       if (hcd->state != HC_STATE_SUSPENDED) {
+               rc = -EINVAL;
+               goto bail;
+       }
+       ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
+       (void)ohci_readl(ohci, &ohci->regs->intrdisable);
+       clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+ bail:
+       spin_unlock_irqrestore (&ohci->lock, flags);
+
+       return rc;
 }
 
 
 static int ohci_pci_resume (struct usb_hcd *hcd)
 {
+       set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
        usb_hcd_resume_root_hub(hcd);
        return 0;
 }
index d33ce3982a5f0e08f249ebb00697f3de22907fdc..ed550132db0b1aedfac49a6f8fb7d8c10c98073c 100644 (file)
@@ -717,6 +717,7 @@ static int uhci_suspend(struct usb_hcd *hcd, pm_message_t message)
         * at the source, so we must turn off PIRQ.
         */
        pci_write_config_word(to_pci_dev(uhci_dev(uhci)), USBLEGSUP, 0);
+       clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
        uhci->hc_inaccessible = 1;
        hcd->poll_rh = 0;
 
@@ -733,6 +734,11 @@ static int uhci_resume(struct usb_hcd *hcd)
 
        dev_dbg(uhci_dev(uhci), "%s\n", __FUNCTION__);
 
+       /* We aren't in D3 state anymore, we do that even if dead as I
+        * really don't want to keep a stale HCD_FLAG_HW_ACCESSIBLE=0
+        */
+       set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+
        if (uhci->rh_state == UHCI_RH_RESET)    /* Dead */
                return 0;
        spin_lock_irq(&uhci->lock);
index 25b6ca6ad081a17d4c69ffe11cd388595a530291..3e470c8b4193a56564ce39d3dc11ec919afc7260 100644 (file)
@@ -534,6 +534,12 @@ config FB_SUN3
        bool "Sun3 framebuffer support"
        depends on (FB = y) && (SUN3 || SUN3X) && BROKEN
 
+config FB_SBUS
+       bool "SBUS and UPA framebuffers"
+       depends on (FB = y) && (SPARC32 || SPARC64)
+       help
+         Say Y if you want support for SBUS or UPA based frame buffer device.
+
 config FB_BW2
        bool "BWtwo support"
        depends on (FB = y) && ((SPARC32 || SPARC64) && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3)
@@ -546,6 +552,7 @@ config FB_BW2
 config FB_CG3
        bool "CGthree support"
        depends on (FB = y) && ((SPARC32 || SPARC64) && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3)
+       select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
        help
@@ -1210,12 +1217,6 @@ config FB_AU1100
 
 source "drivers/video/geode/Kconfig"
 
-config FB_SBUS
-       bool "SBUS and UPA framebuffers"
-       depends on (FB = y) && (SPARC32 || SPARC64)
-       help
-         Say Y if you want support for SBUS or UPA based frame buffer device.
-
 config FB_FFB
        bool "Creator/Creator3D/Elite3D support"
        depends on FB_SBUS && SPARC64
index 2858c5c8ba3c2fbca07c0cc4979f024d0853cd5a..e0dbdfc0c8b4289178d5dff1419992acd325cb78 100644 (file)
@@ -404,7 +404,7 @@ struct cirrusfb_info {
        struct cirrusfb_regs currentmode;
        int blank_mode;
 
-       u32     pseudo_palette[17];
+       u32     pseudo_palette[16];
        struct { u8 red, green, blue, pad; } palette[256];
 
 #ifdef CONFIG_ZORRO
@@ -1603,14 +1603,14 @@ static int cirrusfb_setcolreg (unsigned regno, unsigned red, unsigned green,
 
                switch (info->var.bits_per_pixel) {
                        case 8:
-                               ((u8*)(info->pseudo_palette))[regno] = v;
+                               cinfo->pseudo_palette[regno] = v;
                                break;
                        case 16:
-                               ((u16*)(info->pseudo_palette))[regno] = v;
+                               cinfo->pseudo_palette[regno] = v;
                                break;
                        case 24:
                        case 32:
-                               ((u32*)(info->pseudo_palette))[regno] = v;
+                               cinfo->pseudo_palette[regno] = v;
                                break;
                }
                return 0;
@@ -2020,18 +2020,21 @@ static void cirrusfb_prim_fillrect(struct cirrusfb_info *cinfo,
                                   const struct fb_fillrect *region)
 {
        int m; /* bytes per pixel */
+       u32 color = (cinfo->info->fix.visual == FB_VISUAL_TRUECOLOR) ?
+               cinfo->pseudo_palette[region->color] : region->color;
+
        if(cinfo->info->var.bits_per_pixel == 1) {
                cirrusfb_RectFill(cinfo->regbase, cinfo->info->var.bits_per_pixel,
                                  region->dx / 8, region->dy,
                                  region->width / 8, region->height,
-                                 region->color,
+                                 color,
                                  cinfo->currentmode.line_length);
        } else {
                m = ( cinfo->info->var.bits_per_pixel + 7 ) / 8;
                cirrusfb_RectFill(cinfo->regbase, cinfo->info->var.bits_per_pixel,
                                  region->dx * m, region->dy,
                                  region->width * m, region->height,
-                                 region->color,
+                                 color,
                                  cinfo->currentmode.line_length);
        }
        return;
index 3afd1eeb1adebc38b5432a36ecaca220a88eba88..4952b66ae2062996d13ce6efcbb0b7df29c68470 100644 (file)
@@ -34,7 +34,7 @@ static inline void ccw_update_attr(u8 *dst, u8 *src, int attribute,
                msk <<= (8 - mod);
 
        if (offset > mod)
-               set_bit(FBCON_BIT(7), (void *)&msk1);
+               msk1 |= 0x01;
 
        for (i = 0; i < vc->vc_font.width; i++) {
                for (j = 0; j < width; j++) {
index e504fbf5c6045bedb1319d76f968b0c4e425007f..1b8f92fdc6a82f3c02b8c02096832d053ba6e1d9 100644 (file)
         (s == SCROLL_REDRAW || s == SCROLL_MOVE || !(i)->fix.xpanstep) ? \
         (i)->var.xres : (i)->var.xres_virtual; })
 
-/*
- * The bitmap is always big endian
- */
-#if defined(__LITTLE_ENDIAN)
-#define FBCON_BIT(b) (7 - (b))
-#else
-#define FBCON_BIT(b) (b)
-#endif
 
 static inline int pattern_test_bit(u32 x, u32 y, u32 pitch, const char *pat)
 {
        u32 tmp = (y * pitch) + x, index = tmp / 8,  bit = tmp % 8;
 
        pat +=index;
-       return (test_bit(FBCON_BIT(bit), (void *)pat));
+       return (*pat) & (0x80 >> bit);
 }
 
 static inline void pattern_set_bit(u32 x, u32 y, u32 pitch, char *pat)
@@ -43,7 +35,8 @@ static inline void pattern_set_bit(u32 x, u32 y, u32 pitch, char *pat)
        u32 tmp = (y * pitch) + x, index = tmp / 8, bit = tmp % 8;
 
        pat += index;
-       set_bit(FBCON_BIT(bit), (void *)pat);
+
+       (*pat) |= 0x80 >> bit;
 }
 
 static inline void rotate_ud(const char *in, char *out, u32 width, u32 height)
index be7288184fa9de0a580f7ec64d86f29fec5d3ce3..0ea965c3bb7d0d7233e320a8957be96aaefb33ad 100644 (file)
@@ -427,6 +427,8 @@ v9fs_create(struct inode *dir,
 
        v9fs_mistat2inode(fcall->params.rstat.stat, file_inode, sb);
        kfree(fcall);
+       fcall = NULL;
+       file_dentry->d_op = &v9fs_dentry_operations;
        d_instantiate(file_dentry, file_inode);
 
        if (perm & V9FS_DMDIR) {
index 6bded10c0d507c01ece3e758d162882398beafd7..943ef9b82244ef9b71a3211e24bb1a1899f51409 100644 (file)
@@ -1,10 +1,12 @@
 Version 1.39
 ------------
-Defer close of a file handle slightly if pending writes depend on that file handle
+Defer close of a file handle slightly if pending writes depend on that handle
 (this reduces the EBADF bad file handle errors that can be logged under heavy
 stress on writes). Modify cifs Kconfig options to expose CONFIG_CIFS_STATS2 
-Fix SFU style symlinks and mknod needed for servers which do not support the CIFS
-Unix Extensions.  Fix setfacl/getfacl on bigendian. 
+Fix SFU style symlinks and mknod needed for servers which do not support the
+CIFS Unix Extensions.  Fix setfacl/getfacl on bigendian. Timeout negative
+dentries so files that the client sees as deleted but that later get created
+on the server will be recognized.  Add client side permission check on setattr.
 
 Version 1.38
 ------------
index bb90941826adb4e60d662d930aa293055c42cd2b..e5d09a2fc7a5eccf7a7b8f15b56de07173a5d535 100644 (file)
@@ -278,7 +278,9 @@ A partial list of the supported mount options follows:
                (such as Windows), permissions can also be checked at the
                client, and a crude form of client side permission checking 
                can be enabled by specifying file_mode and dir_mode on 
-               the client
+               the client.  Note that the mount.cifs helper must be
+               at version 1.10 or higher to support specifying the uid
+               (or gid) in non-numberic form.
   gid          If CIFS Unix extensions are not supported by the server
                this overrides the default gid for inodes.
   file_mode     If CIFS Unix extensions are not supported by the server
@@ -345,7 +347,10 @@ A partial list of the supported mount options follows:
                client system. It is typically only needed when the server
                supports the CIFS Unix Extensions but the UIDs/GIDs on the
                client and server system do not match closely enough to allow
-               access by the user doing the mount.
+               access by the user doing the mount, but it may be useful with
+               non CIFS Unix Extension mounts for cases in which the default
+               mode is specified on the mount but is not to be enforced on the
+               client (e.g. perhaps when MultiUserMount is enabled)
                Note that this does not affect the normal ACL check on the
                target machine done by the server software (of the server
                ACL against the user name provided at mount time).
@@ -368,15 +373,21 @@ A partial list of the supported mount options follows:
   setuids       If the CIFS Unix extensions are negotiated with the server
                the client will attempt to set the effective uid and gid of
                the local process on newly created files, directories, and
-               devices (create, mkdir, mknod).
+               devices (create, mkdir, mknod).  If the CIFS Unix Extensions
+               are not negotiated, for newly created files and directories
+               instead of using the default uid and gid specified on the
+               the mount, cache the new file's uid and gid locally which means
+               that the uid for the file can change when the inode is
+               reloaded (or the user remounts the share).
   nosetuids     The client will not attempt to set the uid and gid on
                on newly created files, directories, and devices (create, 
                mkdir, mknod) which will result in the server setting the
                uid and gid to the default (usually the server uid of the
                user who mounted the share).  Letting the server (rather than
-               the client) set the uid and gid is the default. This
-               parameter has no effect if the CIFS Unix Extensions are not
-               negotiated.
+               the client) set the uid and gid is the default. If the CIFS
+               Unix Extensions are not negotiated then the uid and gid for
+               new files will appear to be the uid (gid) of the mounter or the
+               uid (gid) parameter specified on the mount.
   netbiosname   When mounting to servers via port 139, specifies the RFC1001
                source name to use to represent the client netbios machine 
                name when doing the RFC1001 netbios session initialize.
@@ -418,6 +429,13 @@ A partial list of the supported mount options follows:
                byte range locks).
  remount        remount the share (often used to change from ro to rw mounts
                or vice versa)
+ sfu            When the CIFS Unix Extensions are not negotiated, attempt to
+               create device files and fifos in a format compatible with
+               Services for Unix (SFU).  In addition retrieve bits 10-12
+               of the mode via the SETFILEBITS extended attribute (as
+               SFU does).  In the future the bottom 9 bits of the mode
+               mode also will be emulated using queries of the security
+               descriptor (ACL).
                
 The mount.cifs mount helper also accepts a few mount options before -o
 including:
index c909298d11ed60deba5809a8e3346130019e63bf..fc34c74ec4bef91ed0c686ebe451b8787db26375 100644 (file)
@@ -1,4 +1,4 @@
-version 1.37 October 9, 2005
+Version 1.39 November 30, 2005
 
 A Partial List of Missing Features
 ==================================
@@ -58,7 +58,7 @@ o) Improve performance of readpages by sending more than one read
 at a time when 8 pages or more are requested. In conjuntion
 add support for async_cifs_readpages.
 
-p) Add support for storing symlink and fifo info to Windows servers 
+p) Add support for storing symlink info to Windows servers 
 in the Extended Attribute format their SFU clients would recognize.
 
 q) Finish fcntl D_NOTIFY support so kde and gnome file list windows
index 51548ed2e9cce885869c1c66bd074c119c5abdf6..2a13a2bac8f18f9d957ac289c703d3e2e2904fe7 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/seq_file.h>
 #include <linux/vfs.h>
 #include <linux/mempool.h>
+#include <linux/delay.h>
 #include "cifsfs.h"
 #include "cifspdu.h"
 #define DECLARE_GLOBALS_HERE
@@ -429,6 +430,11 @@ static void cifs_umount_begin(struct super_block * sblock)
        {
                cFYI(1,("wake up tasks now - umount begin not complete"));
                wake_up_all(&tcon->ses->server->request_q);
+               wake_up_all(&tcon->ses->server->response_q);
+               msleep(1); /* yield */
+               /* we have to kick the requests once more */
+               wake_up_all(&tcon->ses->server->response_q);
+               msleep(1);
        }
 /* BB FIXME - finish add checks for tidStatus BB */
 
@@ -895,6 +901,9 @@ static int cifs_oplock_thread(void * dummyarg)
 
 static int cifs_dnotify_thread(void * dummyarg)
 {
+       struct list_head *tmp;
+       struct cifsSesInfo *ses;
+
        daemonize("cifsdnotifyd");
        allow_signal(SIGTERM);
 
@@ -903,7 +912,19 @@ static int cifs_dnotify_thread(void * dummyarg)
                if(try_to_freeze())
                        continue;
                set_current_state(TASK_INTERRUPTIBLE);
-               schedule_timeout(39*HZ);
+               schedule_timeout(15*HZ);
+               read_lock(&GlobalSMBSeslock);
+               /* check if any stuck requests that need
+                  to be woken up and wakeq so the
+                  thread can wake up and error out */
+               list_for_each(tmp, &GlobalSMBSessionList) {
+                       ses = list_entry(tmp, struct cifsSesInfo, 
+                               cifsSessionList);
+                       if(ses && ses->server && 
+                            atomic_read(&ses->server->inFlight))
+                               wake_up_all(&ses->server->response_q);
+               }
+               read_unlock(&GlobalSMBSeslock);
        } while(!signal_pending(current));
        complete_and_exit (&cifs_dnotify_exited, 0);
 }
index d179b0c3eee45e4bc01bd4c6e3242b38f5559a81..6867e556d37e51485a4e9d35fb7ea332fc971b6d 100644 (file)
@@ -90,6 +90,18 @@ small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
           check for tcp and smb session status done differently
           for those three - in the calling routine */
        if(tcon) {
+               if(tcon->tidStatus == CifsExiting) {
+                       /* only tree disconnect, open, and write,
+                       (and ulogoff which does not have tcon)
+                       are allowed as we start force umount */
+                       if((smb_command != SMB_COM_WRITE_ANDX) && 
+                          (smb_command != SMB_COM_OPEN_ANDX) && 
+                          (smb_command != SMB_COM_TREE_DISCONNECT)) {
+                               cFYI(1,("can not send cmd %d while umounting",
+                                       smb_command));
+                               return -ENODEV;
+                       }
+               }
                if((tcon->ses) && (tcon->ses->status != CifsExiting) &&
                                  (tcon->ses->server)){
                        struct nls_table *nls_codepage;
@@ -187,6 +199,19 @@ smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
           check for tcp and smb session status done differently
           for those three - in the calling routine */
        if(tcon) {
+               if(tcon->tidStatus == CifsExiting) {
+                       /* only tree disconnect, open, and write,
+                         (and ulogoff which does not have tcon)
+                         are allowed as we start force umount */
+                       if((smb_command != SMB_COM_WRITE_ANDX) &&
+                          (smb_command != SMB_COM_OPEN_ANDX) &&
+                          (smb_command != SMB_COM_TREE_DISCONNECT)) {
+                               cFYI(1,("can not send cmd %d while umounting",
+                                       smb_command));
+                               return -ENODEV;
+                       }
+               }
+
                if((tcon->ses) && (tcon->ses->status != CifsExiting) && 
                                  (tcon->ses->server)){
                        struct nls_table *nls_codepage;
index 16b21522e8fe1bbd06a97a7da2297e38cc8056d3..32cc96cafa3eb050d19871f85cf4e089c68b7562 100644 (file)
@@ -228,8 +228,15 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
                else {
                        rc = cifs_get_inode_info(&newinode, full_path,
                                                 buf, inode->i_sb,xid);
-                       if(newinode)
+                       if(newinode) {
                                newinode->i_mode = mode;
+                               if((oplock & CIFS_CREATE_ACTION) &&
+                                 (cifs_sb->mnt_cifs_flags & 
+                                    CIFS_MOUNT_SET_UID)) {
+                                       newinode->i_uid = current->fsuid;
+                                       newinode->i_gid = current->fsgid;
+                               }
+                       }
                }
 
                if (rc != 0) {
@@ -465,12 +472,20 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name
                        direntry->d_op = &cifs_dentry_ops;
                d_add(direntry, newInode);
 
-               /* since paths are not looked up by component - the parent directories are presumed to be good here */
+               /* since paths are not looked up by component - the parent 
+                  directories are presumed to be good here */
                renew_parental_timestamps(direntry);
 
        } else if (rc == -ENOENT) {
                rc = 0;
+               direntry->d_time = jiffies;
+               if (pTcon->nocase)
+                       direntry->d_op = &cifs_ci_dentry_ops;
+               else
+                       direntry->d_op = &cifs_dentry_ops;
                d_add(direntry, NULL);
+       /*      if it was once a directory (but how can we tell?) we could do  
+                       shrink_dcache_parent(direntry); */
        } else {
                cERROR(1,("Error 0x%x on cifs_get_inode_info in lookup of %s",
                           rc,full_path));
@@ -489,21 +504,20 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
 {
        int isValid = 1;
 
-/*     lock_kernel(); *//* surely we do not want to lock the kernel for a whole network round trip which could take seconds */
-
        if (direntry->d_inode) {
                if (cifs_revalidate(direntry)) {
-                       /* unlock_kernel(); */
                        return 0;
                }
        } else {
-               cFYI(1,
-                    ("In cifs_d_revalidate with no inode but name = %s and dentry 0x%p",
-                     direntry->d_name.name, direntry));
+               cFYI(1, ("neg dentry 0x%p name = %s",
+                        direntry, direntry->d_name.name));
+               if(time_after(jiffies, direntry->d_time + HZ) || 
+                       !lookupCacheEnabled) {
+                       d_drop(direntry);
+                       isValid = 0;
+               } 
        }
 
-/*    unlock_kernel(); */
-
        return isValid;
 }
 
index 05b525812adb5ba238a8f2bc1138eac7f108a43c..411c1f7f84da6074efd483e27df1221db4647df1 100644 (file)
@@ -710,7 +710,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
        char *full_path = NULL;
        struct inode *newinode = NULL;
 
-       cFYI(1, ("In cifs_mkdir, mode = 0x%x inode = 0x%p ", mode, inode));
+       cFYI(1, ("In cifs_mkdir, mode = 0x%x inode = 0x%p", mode, inode));
 
        xid = GetXid();
 
@@ -768,6 +768,17 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
                        /* BB to be implemented via Windows secrty descriptors
                           eg CIFSSMBWinSetPerms(xid, pTcon, full_path, mode,
                                                 -1, -1, local_nls); */
+                       if(direntry->d_inode) {
+                               direntry->d_inode->i_mode = mode;
+                               direntry->d_inode->i_mode |= S_IFDIR;
+                               if(cifs_sb->mnt_cifs_flags & 
+                                    CIFS_MOUNT_SET_UID) {
+                                       direntry->d_inode->i_uid = 
+                                               current->fsuid;
+                                       direntry->d_inode->i_gid = 
+                                               current->fsgid;
+                               }
+                       }
                }
        }
        kfree(full_path);
@@ -1039,14 +1050,20 @@ int cifs_revalidate(struct dentry *direntry)
                filemap_fdatawrite(direntry->d_inode->i_mapping);
        }
        if (invalidate_inode) {
-               if (direntry->d_inode->i_mapping)
-                       filemap_fdatawait(direntry->d_inode->i_mapping);
-               /* may eventually have to do this for open files too */
-               if (list_empty(&(cifsInode->openFileList))) {
-                       /* Has changed on server - flush read ahead pages */
-                       cFYI(1, ("Invalidating read ahead data on "
-                                "closed file"));
-                       invalidate_remote_inode(direntry->d_inode);
+       /* shrink_dcache not necessary now that cifs dentry ops
+       are exported for negative dentries */
+/*             if(S_ISDIR(direntry->d_inode->i_mode)) 
+                       shrink_dcache_parent(direntry); */
+               if (S_ISREG(direntry->d_inode->i_mode)) {
+                       if (direntry->d_inode->i_mapping)
+                               filemap_fdatawait(direntry->d_inode->i_mapping);
+                       /* may eventually have to do this for open files too */
+                       if (list_empty(&(cifsInode->openFileList))) {
+                               /* changed on server - flush read ahead pages */
+                               cFYI(1, ("Invalidating read ahead data on "
+                                        "closed file"));
+                               invalidate_remote_inode(direntry->d_inode);
+                       }
                }
        }
 /*     up(&direntry->d_inode->i_sem); */
@@ -1105,9 +1122,20 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
 
        cFYI(1, ("In cifs_setattr, name = %s attrs->iavalid 0x%x ",
                 direntry->d_name.name, attrs->ia_valid));
+
        cifs_sb = CIFS_SB(direntry->d_inode->i_sb);
        pTcon = cifs_sb->tcon;
 
+       if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) == 0) {
+               /* check if we have permission to change attrs */
+               rc = inode_change_ok(direntry->d_inode, attrs);
+               if(rc < 0) {
+                       FreeXid(xid);
+                       return rc;
+               } else
+                       rc = 0;
+       }
+               
        down(&direntry->d_sb->s_vfs_rename_sem);
        full_path = build_path_from_dentry(direntry);
        up(&direntry->d_sb->s_vfs_rename_sem);
@@ -1147,7 +1175,9 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
                                                  1 /* 45 seconds */);
                                cFYI(1,("Wrt seteof rc %d", rc));
                        }
-               }
+               } else 
+                       rc = -EINVAL;
+
                if (rc != 0) {
                        /* Set file size by pathname rather than by handle
                           either because no valid, writeable file handle for
index ca27a82c54cdb60f4083b21ba427aa004c43ceb7..94baf6c8ecbda85946984cd2e4d524034cc94644 100644 (file)
@@ -397,12 +397,12 @@ checkSMBhdr(struct smb_hdr *smb, __u16 mid)
                        if(smb->Command == SMB_COM_LOCKING_ANDX)
                                return 0;
                        else
-                               cERROR(1, ("Rcvd Request not response "));         
+                               cERROR(1, ("Rcvd Request not response"));         
                }
        } else { /* bad signature or mid */
                if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff))
                        cERROR(1,
-                              ("Bad protocol string signature header %x ",
+                              ("Bad protocol string signature header %x",
                                *(unsigned int *) smb->Protocol));
                if (mid != smb->Mid)
                        cERROR(1, ("Mids do not match"));
@@ -417,7 +417,7 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length)
        __u32 len = smb->smb_buf_length;
        __u32 clc_len;  /* calculated length */
        cFYI(0,
-            ("Entering checkSMB with Length: %x, smb_buf_length: %x ",
+            ("Entering checkSMB with Length: %x, smb_buf_length: %x",
              length, len));
        if (((unsigned int)length < 2 + sizeof (struct smb_hdr)) ||
            (len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4)) {
@@ -451,9 +451,16 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length)
                cERROR(1, ("bad smb size detected for Mid=%d", smb->Mid));
                /* Windows XP can return a few bytes too much, presumably
                an illegal pad, at the end of byte range lock responses 
-               so we allow for up to eight byte pad, as long as actual
+               so we allow for that three byte pad, as long as actual
                received length is as long or longer than calculated length */
-               if((4+len > clc_len) && (len <= clc_len + 3))
+               /* We have now had to extend this more, since there is a 
+               case in which it needs to be bigger still to handle a
+               malformed response to transact2 findfirst from WinXP when
+               access denied is returned and thus bcc and wct are zero
+               but server says length is 0x21 bytes too long as if the server
+               forget to reset the smb rfc1001 length when it reset the
+               wct and bcc to minimum size and drop the t2 parms and data */
+               if((4+len > clc_len) && (len <= clc_len + 512))
                        return 0;
                else
                        return 1;
index f7814689844b2f4440b374024f92d7899349b29b..5de74d216fdd75533f23e89ef465823ea63d5ffc 100644 (file)
@@ -330,7 +330,7 @@ static const struct {
        ERRHRD, ERRgeneral, NT_STATUS_ACCOUNT_RESTRICTION}, {
        ERRSRV, 2241, NT_STATUS_INVALID_LOGON_HOURS}, {
        ERRSRV, 2240, NT_STATUS_INVALID_WORKSTATION}, {
-       ERRSRV, 2242, NT_STATUS_PASSWORD_EXPIRED}, {
+       ERRSRV, ERRpasswordExpired, NT_STATUS_PASSWORD_EXPIRED}, {
        ERRSRV, 2239, NT_STATUS_ACCOUNT_DISABLED}, {
        ERRHRD, ERRgeneral, NT_STATUS_NONE_MAPPED}, {
        ERRHRD, ERRgeneral, NT_STATUS_TOO_MANY_LUIDS_REQUESTED}, {
@@ -676,7 +676,7 @@ static const struct {
        ERRDOS, 193, NT_STATUS_IMAGE_CHECKSUM_MISMATCH}, {
        ERRHRD, ERRgeneral, NT_STATUS_LOST_WRITEBEHIND_DATA}, {
        ERRHRD, ERRgeneral, NT_STATUS_CLIENT_SERVER_PARAMETERS_INVALID}, {
-       ERRSRV, 2242, NT_STATUS_PASSWORD_MUST_CHANGE}, {
+       ERRSRV, ERRpasswordExpired, NT_STATUS_PASSWORD_MUST_CHANGE}, {
        ERRHRD, ERRgeneral, NT_STATUS_NOT_FOUND}, {
        ERRHRD, ERRgeneral, NT_STATUS_NOT_TINY_STREAM}, {
        ERRHRD, ERRgeneral, NT_STATUS_RECOVERY_FAILURE}, {
index 41a9659c16bc691552374bc1c83ea8d0fcd8209f..f8871196098c9abe371a64a1df5d269cb407f503 100644 (file)
@@ -515,6 +515,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
                        *pbytes_returned = in_buf->smb_buf_length;
 
                        /* BB special case reconnect tid and uid here? */
+                       /* BB special case Errbadpassword and pwdexpired here */
                        rc = map_smb_to_linux_error(in_buf);
 
                        /* convert ByteCount if necessary */
index 05b60283c9c2710d65fa96ccfe20d47f1da13f64..2a62b3dc20ec00a76c665a8f1e9dda9808e715b6 100644 (file)
@@ -1513,10 +1513,16 @@ int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
        if (IS_ERR(dentry))
                return PTR_ERR(dentry);
 
+       if (!dentry->d_inode) {
+               error = -ENOENT;
+               goto out;
+       }
+
        error = security_quota_on(dentry);
        if (!error)
                error = vfs_quota_on_inode(dentry->d_inode, type, format_id);
 
+out:
        dput(dentry);
        return error;
 }
index 1f8a9fd2c9ed1de1cb8d8413bcfdc197024ab7fe..22533cce061165023d43cfedac7310c2e4d414b7 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -306,9 +306,6 @@ void install_arg_page(struct vm_area_struct *vma,
                        struct page *page, unsigned long address)
 {
        struct mm_struct *mm = vma->vm_mm;
-       pgd_t * pgd;
-       pud_t * pud;
-       pmd_t * pmd;
        pte_t * pte;
        spinlock_t *ptl;
 
@@ -316,14 +313,7 @@ void install_arg_page(struct vm_area_struct *vma,
                goto out;
 
        flush_dcache_page(page);
-       pgd = pgd_offset(mm, address);
-       pud = pud_alloc(mm, pgd, address);
-       if (!pud)
-               goto out;
-       pmd = pmd_alloc(mm, pud, address);
-       if (!pmd)
-               goto out;
-       pte = pte_alloc_map_lock(mm, pmd, address, &ptl);
+       pte = get_locked_pte(mm, address, &ptl);
        if (!pte)
                goto out;
        if (!pte_none(*pte)) {
index 1be78b4b4de956f7bb9e831a7f3e1c1c489b997b..6104ad3105077ec7a14e5da4f24a261d116035a0 100644 (file)
@@ -767,6 +767,7 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input)
        if (input->group != EXT3_SB(sb)->s_groups_count) {
                ext3_warning(sb, __FUNCTION__,
                             "multiple resizers run on filesystem!\n");
+               err = -EBUSY;
                goto exit_journal;
        }
 
index c045cc70c74931864e01763c3573eeae19c2d1e8..51f5da6527719c31ab3a7316c0ba99812e85809b 100644 (file)
@@ -74,6 +74,24 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
        return 1;
 }
 
+static int dir_alias(struct inode *inode)
+{
+       if (S_ISDIR(inode->i_mode)) {
+               /* Don't allow creating an alias to a directory  */
+               struct dentry *alias = d_find_alias(inode);
+               if (alias) {
+                       dput(alias);
+                       return 1;
+               }
+       }
+       return 0;
+}
+
+static inline int invalid_nodeid(u64 nodeid)
+{
+       return !nodeid || nodeid == FUSE_ROOT_ID;
+}
+
 static struct dentry_operations fuse_dentry_operations = {
        .d_revalidate   = fuse_dentry_revalidate,
 };
@@ -97,7 +115,7 @@ static int fuse_lookup_iget(struct inode *dir, struct dentry *entry,
        fuse_lookup_init(req, dir, entry, &outarg);
        request_send(fc, req);
        err = req->out.h.error;
-       if (!err && (!outarg.nodeid || outarg.nodeid == FUSE_ROOT_ID))
+       if (!err && invalid_nodeid(outarg.nodeid))
                err = -EIO;
        if (!err) {
                inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation,
@@ -193,7 +211,7 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode,
        }
 
        err = -EIO;
-       if (!S_ISREG(outentry.attr.mode))
+       if (!S_ISREG(outentry.attr.mode) || invalid_nodeid(outentry.nodeid))
                goto out_free_ff;
 
        inode = fuse_iget(dir->i_sb, outentry.nodeid, outentry.generation,
@@ -250,7 +268,7 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req,
                fuse_put_request(fc, req);
                return err;
        }
-       if (!outarg.nodeid || outarg.nodeid == FUSE_ROOT_ID) {
+       if (invalid_nodeid(outarg.nodeid)) {
                fuse_put_request(fc, req);
                return -EIO;
        }
@@ -263,7 +281,7 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req,
        fuse_put_request(fc, req);
 
        /* Don't allow userspace to do really stupid things... */
-       if ((inode->i_mode ^ mode) & S_IFMT) {
+       if (((inode->i_mode ^ mode) & S_IFMT) || dir_alias(inode)) {
                iput(inode);
                return -EIO;
        }
@@ -874,14 +892,9 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
        err = fuse_lookup_iget(dir, entry, &inode);
        if (err)
                return ERR_PTR(err);
-       if (inode && S_ISDIR(inode->i_mode)) {
-               /* Don't allow creating an alias to a directory  */
-               struct dentry *alias = d_find_alias(inode);
-               if (alias) {
-                       dput(alias);
-                       iput(inode);
-                       return ERR_PTR(-EIO);
-               }
+       if (inode && dir_alias(inode)) {
+               iput(inode);
+               return ERR_PTR(-EIO);
        }
        d_add(entry, inode);
        return NULL;
index c60e5635498dd8936a2e6f43ba0a8b2557360f28..df16fcbff3fbd00a6ff8876187b651c085f9679c 100644 (file)
@@ -151,6 +151,7 @@ struct hfsplus_sb_info {
 
 #define HFSPLUS_SB_WRITEBACKUP 0x0001
 #define HFSPLUS_SB_NODECOMPOSE 0x0002
+#define HFSPLUS_SB_FORCE       0x0004
 
 
 struct hfsplus_inode_info {
index 5bad37cfdb29f41ce91825585560d0e724f85763..b4fbed63321944dac1ff47676845e808512d0efb 100644 (file)
@@ -123,11 +123,13 @@ struct hfsplus_vh {
 } __packed;
 
 /* HFS+ volume attributes */
-#define HFSPLUS_VOL_UNMNT     (1 << 8)
-#define HFSPLUS_VOL_SPARE_BLK (1 << 9)
-#define HFSPLUS_VOL_NOCACHE   (1 << 10)
-#define HFSPLUS_VOL_INCNSTNT  (1 << 11)
-#define HFSPLUS_VOL_SOFTLOCK  (1 << 15)
+#define HFSPLUS_VOL_UNMNT              (1 << 8)
+#define HFSPLUS_VOL_SPARE_BLK          (1 << 9)
+#define HFSPLUS_VOL_NOCACHE            (1 << 10)
+#define HFSPLUS_VOL_INCNSTNT           (1 << 11)
+#define HFSPLUS_VOL_NODEID_REUSED      (1 << 12)
+#define HFSPLUS_VOL_JOURNALED          (1 << 13)
+#define HFSPLUS_VOL_SOFTLOCK           (1 << 15)
 
 /* HFS+ BTree node descriptor */
 struct hfs_bnode_desc {
index cca0818aa4ca3dbd18fe842e802e38b558fa4d90..935dafba007855aadc16b42b0a5e0831a987afb8 100644 (file)
@@ -22,7 +22,7 @@ enum {
        opt_umask, opt_uid, opt_gid,
        opt_part, opt_session, opt_nls,
        opt_nodecompose, opt_decompose,
-       opt_err
+       opt_force, opt_err
 };
 
 static match_table_t tokens = {
@@ -36,6 +36,7 @@ static match_table_t tokens = {
        { opt_nls, "nls=%s" },
        { opt_decompose, "decompose" },
        { opt_nodecompose, "nodecompose" },
+       { opt_force, "force" },
        { opt_err, NULL }
 };
 
@@ -145,6 +146,9 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi)
                case opt_nodecompose:
                        sbi->flags |= HFSPLUS_SB_NODECOMPOSE;
                        break;
+               case opt_force:
+                       sbi->flags |= HFSPLUS_SB_FORCE;
+                       break;
                default:
                        return 0;
                }
index 0ce1c455ae555f2d8f73262be6089063608e9ffd..8093351bd7c3b0a9cefcb73ce1879a0527655c6e 100644 (file)
@@ -251,16 +251,28 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data)
                return 0;
        if (!(*flags & MS_RDONLY)) {
                struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr;
+               struct hfsplus_sb_info sbi;
+
+               memset(&sbi, 0, sizeof(struct hfsplus_sb_info));
+               sbi.nls = HFSPLUS_SB(sb).nls;
+               if (!hfsplus_parse_options(data, &sbi))
+                       return -EINVAL;
 
                if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
                        printk("HFS+-fs warning: Filesystem was not cleanly unmounted, "
                               "running fsck.hfsplus is recommended.  leaving read-only.\n");
                        sb->s_flags |= MS_RDONLY;
                        *flags |= MS_RDONLY;
+               } else if (sbi.flags & HFSPLUS_SB_FORCE) {
+                       /* nothing */
                } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
                        printk("HFS+-fs: Filesystem is marked locked, leaving read-only.\n");
                        sb->s_flags |= MS_RDONLY;
                        *flags |= MS_RDONLY;
+               } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
+                       printk("HFS+-fs: Filesystem is marked journaled, leaving read-only.\n");
+                       sb->s_flags |= MS_RDONLY;
+                       *flags |= MS_RDONLY;
                }
        }
        return 0;
@@ -352,11 +364,19 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
                        printk("HFS+-fs warning: Filesystem was not cleanly unmounted, "
                               "running fsck.hfsplus is recommended.  mounting read-only.\n");
                sb->s_flags |= MS_RDONLY;
+       } else if (sbi->flags & HFSPLUS_SB_FORCE) {
+               /* nothing */
        } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
                if (!silent)
                        printk("HFS+-fs: Filesystem is marked locked, mounting read-only.\n");
                sb->s_flags |= MS_RDONLY;
+       } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
+               if (!silent)
+                       printk("HFS+-fs: write access to a jounaled filesystem is not supported, "
+                              "use the force option at your own risk, mounting read-only.\n");
+               sb->s_flags |= MS_RDONLY;
        }
+       sbi->flags &= ~HFSPLUS_SB_FORCE;
 
        /* Load metadata objects (B*Trees) */
        HFSPLUS_SB(sb).ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID);
index 543420665c5be2f641eacc6fa52062b15b4bcd0f..d0fcc5f3497ed1e757f6b420b78d3ba7193c3c3d 100644 (file)
@@ -234,6 +234,7 @@ void jffs2_read_inode (struct inode *inode)
        c = JFFS2_SB_INFO(inode->i_sb);
 
        jffs2_init_inode_info(f);
+       down(&f->sem);
 
        ret = jffs2_do_read_inode(c, f, inode->i_ino, &latest_node);
 
@@ -400,6 +401,7 @@ struct inode *jffs2_new_inode (struct inode *dir_i, int mode, struct jffs2_raw_i
 
        f = JFFS2_INODE_INFO(inode);
        jffs2_init_inode_info(f);
+       down(&f->sem);
 
        memset(ri, 0, sizeof(*ri));
        /* Set OS-specific defaults for new inodes */
index 9e0b5458d9c072bc76e4fa6825e2b02163e4e0c4..93883817cbd0332df2d2e2652c7781baece90cde 100644 (file)
@@ -51,7 +51,7 @@ static void jffs2_i_init_once(void * foo, kmem_cache_t * cachep, unsigned long f
 
        if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
            SLAB_CTOR_CONSTRUCTOR) {
-               init_MUTEX_LOCKED(&ei->sem);
+               init_MUTEX(&ei->sem);
                inode_init_once(&ei->vfs_inode);
        }
 }
index 9ab97cef0daa001dded3c6d667e95ea4134fc0a7..50bd5a8f0446d902cc6161032fde8ac5fcadd7a6 100644 (file)
@@ -402,12 +402,11 @@ struct numa_maps {
 /*
  * Calculate numa node maps for a vma
  */
-static struct numa_maps *get_numa_maps(const struct vm_area_struct *vma)
+static struct numa_maps *get_numa_maps(struct vm_area_struct *vma)
 {
+       int i;
        struct page *page;
        unsigned long vaddr;
-       struct mm_struct *mm = vma->vm_mm;
-       int i;
        struct numa_maps *md = kmalloc(sizeof(struct numa_maps), GFP_KERNEL);
 
        if (!md)
@@ -420,7 +419,7 @@ static struct numa_maps *get_numa_maps(const struct vm_area_struct *vma)
                md->node[i] =0;
 
        for (vaddr = vma->vm_start; vaddr < vma->vm_end; vaddr += PAGE_SIZE) {
-               page = follow_page(mm, vaddr, 0);
+               page = follow_page(vma, vaddr, 0);
                if (page) {
                        int count = page_mapcount(page);
 
index 5f82352b97e179c263366e550ab8f7564ebf1d16..0a044ad98885e1af810d1ba3907d6338a2321b00 100644 (file)
@@ -2194,7 +2194,7 @@ static int map_block_for_writepage(struct inode *inode,
        INITIALIZE_PATH(path);
        int pos_in_item;
        int jbegin_count = JOURNAL_PER_BALANCE_CNT;
-       loff_t byte_offset = (block << inode->i_sb->s_blocksize_bits) + 1;
+       loff_t byte_offset = ((loff_t)block << inode->i_sb->s_blocksize_bits)+1;
        int retval;
        int use_get_block = 0;
        int bytes_copied = 0;
index 4b15761434bc7fac7c494703267995a9b49a6ff2..68b7b78638ff0e1bf050000f1c3e201a24584dd6 100644 (file)
@@ -2757,6 +2757,15 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
        journal->j_cnode_used = 0;
        journal->j_must_wait = 0;
 
+       if (journal->j_cnode_free == 0) {
+               reiserfs_warning(p_s_sb, "journal-2004: Journal cnode memory "
+                                "allocation failed (%ld bytes). Journal is "
+                                "too large for available memory. Usually "
+                                "this is due to a journal that is too large.",
+                                sizeof (struct reiserfs_journal_cnode) * num_cnodes);
+               goto free_and_return;
+       }
+
        init_journal_hash(p_s_sb);
        jl = journal->j_current_jl;
        jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl);
index cb33d57c146c09fab2268f0daf9aae493098a09a..7f1be48ad67e033d5de562d4ed8670fa0d3cfdf8 100644 (file)
@@ -21,6 +21,7 @@
  *    10-Mar-2005    LCVR    Changed S3C2410_VA to S3C24XX_VA
  *    28-Mar-2005    LCVR    Fixed definition of GPB10
  *    26-Oct-2005    BJD     Added generic configuration types
+ *    27-Nov-2005    LCVR    Added definitions to S3C2400 registers
 */
 
 
 
 #define S3C2410_GPIOREG(x) ((x) + S3C24XX_VA_GPIO)
 
-/* port A - 22bits, zero in bit X makes pin X output
+/* port A - S3C2410: 22bits, zero in bit X makes pin X output
+ *          S3C2400: 18bits, zero in bit X makes pin X output
  * 1 makes port special function, this is default
 */
 #define S3C2410_GPACON    S3C2410_GPIOREG(0x00)
 #define S3C2410_GPADAT    S3C2410_GPIOREG(0x04)
 
+#define S3C2400_GPACON    S3C2410_GPIOREG(0x00)
+#define S3C2400_GPADAT    S3C2410_GPIOREG(0x04)
+
 #define S3C2410_GPA0         S3C2410_GPIONO(S3C2410_GPIO_BANKA, 0)
 #define S3C2410_GPA0_OUT     (0<<0)
 #define S3C2410_GPA0_ADDR0   (1<<0)
 #define S3C2410_GPA10        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 10)
 #define S3C2410_GPA10_OUT    (0<<10)
 #define S3C2410_GPA10_ADDR25 (1<<10)
+#define S3C2400_GPA10_SCKE   (1<<10)
 
 #define S3C2410_GPA11        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 11)
 #define S3C2410_GPA11_OUT    (0<<11)
 #define S3C2410_GPA11_ADDR26 (1<<11)
+#define S3C2400_GPA11_nCAS0  (1<<11)
 
 #define S3C2410_GPA12        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 12)
 #define S3C2410_GPA12_OUT    (0<<12)
 #define S3C2410_GPA12_nGCS1  (1<<12)
+#define S3C2400_GPA12_nCAS1  (1<<12)
 
 #define S3C2410_GPA13        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 13)
 #define S3C2410_GPA13_OUT    (0<<13)
 #define S3C2410_GPA13_nGCS2  (1<<13)
+#define S3C2400_GPA13_nGCS1  (1<<13)
 
 #define S3C2410_GPA14        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 14)
 #define S3C2410_GPA14_OUT    (0<<14)
 #define S3C2410_GPA14_nGCS3  (1<<14)
+#define S3C2400_GPA14_nGCS2  (1<<14)
 
 #define S3C2410_GPA15        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 15)
 #define S3C2410_GPA15_OUT    (0<<15)
 #define S3C2410_GPA15_nGCS4  (1<<15)
+#define S3C2400_GPA15_nGCS3  (1<<15)
 
 #define S3C2410_GPA16        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 16)
 #define S3C2410_GPA16_OUT    (0<<16)
 #define S3C2410_GPA16_nGCS5  (1<<16)
+#define S3C2400_GPA16_nGCS4  (1<<16)
 
 #define S3C2410_GPA17        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 17)
 #define S3C2410_GPA17_OUT    (0<<17)
 #define S3C2410_GPA17_CLE    (1<<17)
+#define S3C2400_GPA17_nGCS5  (1<<17)
 
 #define S3C2410_GPA18        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 18)
 #define S3C2410_GPA18_OUT    (0<<18)
 #define S3C2410_GPA22_OUT    (0<<22)
 #define S3C2410_GPA22_nFCE   (1<<22)
 
-/* 0x08 and 0x0c are reserved */
+/* 0x08 and 0x0c are reserved on S3C2410 */
 
-/* GPB is 10 IO pins, each configured by 2 bits each in GPBCON.
+/* S3C2410:
+ * GPB is 10 IO pins, each configured by 2 bits each in GPBCON.
  *   00 = input, 01 = output, 10=special function, 11=reserved
+
+ * S3C2400:
+ * GPB is 16 IO pins, each configured by 2 bits each in GPBCON.
+ *   00 = input, 01 = output, 10=data, 11=special function
+
  * bit 0,1 = pin 0, 2,3= pin 1...
  *
  * CPBUP = pull up resistor control, 1=disabled, 0=enabled
 #define S3C2410_GPBDAT    S3C2410_GPIOREG(0x14)
 #define S3C2410_GPBUP     S3C2410_GPIOREG(0x18)
 
+#define S3C2400_GPBCON    S3C2410_GPIOREG(0x08)
+#define S3C2400_GPBDAT    S3C2410_GPIOREG(0x0C)
+#define S3C2400_GPBUP     S3C2410_GPIOREG(0x10)
+
 /* no i/o pin in port b can have value 3! */
 
 #define S3C2410_GPB0         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 0)
 #define S3C2410_GPB0_INP     (0x00 << 0)
 #define S3C2410_GPB0_OUTP    (0x01 << 0)
 #define S3C2410_GPB0_TOUT0   (0x02 << 0)
+#define S3C2400_GPB0_DATA16  (0x02 << 0)
 
 #define S3C2410_GPB1         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 1)
 #define S3C2410_GPB1_INP     (0x00 << 2)
 #define S3C2410_GPB1_OUTP    (0x01 << 2)
 #define S3C2410_GPB1_TOUT1   (0x02 << 2)
+#define S3C2400_GPB1_DATA17  (0x02 << 2)
 
 #define S3C2410_GPB2         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 2)
 #define S3C2410_GPB2_INP     (0x00 << 4)
 #define S3C2410_GPB2_OUTP    (0x01 << 4)
 #define S3C2410_GPB2_TOUT2   (0x02 << 4)
+#define S3C2400_GPB2_DATA18  (0x02 << 4)
+#define S3C2400_GPB2_TCLK1   (0x03 << 4)
 
 #define S3C2410_GPB3         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 3)
 #define S3C2410_GPB3_INP     (0x00 << 6)
 #define S3C2410_GPB3_OUTP    (0x01 << 6)
 #define S3C2410_GPB3_TOUT3   (0x02 << 6)
+#define S3C2400_GPB3_DATA19  (0x02 << 6)
+#define S3C2400_GPB3_TXD1    (0x03 << 6)
 
 #define S3C2410_GPB4         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 4)
 #define S3C2410_GPB4_INP     (0x00 << 8)
 #define S3C2410_GPB4_OUTP    (0x01 << 8)
 #define S3C2410_GPB4_TCLK0   (0x02 << 8)
+#define S3C2400_GPB4_DATA20  (0x02 << 8)
 #define S3C2410_GPB4_MASK    (0x03 << 8)
+#define S3C2400_GPB4_RXD1    (0x03 << 8)
+#define S3C2400_GPB4_MASK    (0x03 << 8)
 
 #define S3C2410_GPB5         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 5)
 #define S3C2410_GPB5_INP     (0x00 << 10)
 #define S3C2410_GPB5_OUTP    (0x01 << 10)
 #define S3C2410_GPB5_nXBACK  (0x02 << 10)
+#define S3C2400_GPB5_DATA21  (0x02 << 10)
+#define S3C2400_GPB5_nCTS1   (0x03 << 10)
 
 #define S3C2410_GPB6         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 6)
 #define S3C2410_GPB6_INP     (0x00 << 12)
 #define S3C2410_GPB6_OUTP    (0x01 << 12)
 #define S3C2410_GPB6_nXBREQ  (0x02 << 12)
+#define S3C2400_GPB6_DATA22  (0x02 << 12)
+#define S3C2400_GPB6_nRTS1   (0x03 << 12)
 
 #define S3C2410_GPB7         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 7)
 #define S3C2410_GPB7_INP     (0x00 << 14)
 #define S3C2410_GPB7_OUTP    (0x01 << 14)
 #define S3C2410_GPB7_nXDACK1 (0x02 << 14)
+#define S3C2400_GPB7_DATA23  (0x02 << 14)
 
 #define S3C2410_GPB8         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 8)
 #define S3C2410_GPB8_INP     (0x00 << 16)
 #define S3C2410_GPB8_OUTP    (0x01 << 16)
 #define S3C2410_GPB8_nXDREQ1 (0x02 << 16)
+#define S3C2400_GPB8_DATA24  (0x02 << 16)
 
 #define S3C2410_GPB9         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 9)
 #define S3C2410_GPB9_INP     (0x00 << 18)
 #define S3C2410_GPB9_OUTP    (0x01 << 18)
 #define S3C2410_GPB9_nXDACK0 (0x02 << 18)
+#define S3C2400_GPB9_DATA25  (0x02 << 18)
+#define S3C2400_GPB9_I2SSDI  (0x03 << 18)
 
 #define S3C2410_GPB10        S3C2410_GPIONO(S3C2410_GPIO_BANKB, 10)
 #define S3C2410_GPB10_INP    (0x00 << 20)
 #define S3C2410_GPB10_OUTP   (0x01 << 20)
 #define S3C2410_GPB10_nXDRE0 (0x02 << 20)
+#define S3C2400_GPB10_DATA26 (0x02 << 20)
+#define S3C2400_GPB10_nSS    (0x03 << 20)
+
+#define S3C2400_GPB11        S3C2410_GPIONO(S3C2410_GPIO_BANKB, 11)
+#define S3C2400_GPB11_INP    (0x00 << 22)
+#define S3C2400_GPB11_OUTP   (0x01 << 22)
+#define S3C2400_GPB11_DATA27 (0x02 << 22)
+
+#define S3C2400_GPB12        S3C2410_GPIONO(S3C2410_GPIO_BANKB, 12)
+#define S3C2400_GPB12_INP    (0x00 << 24)
+#define S3C2400_GPB12_OUTP   (0x01 << 24)
+#define S3C2400_GPB12_DATA28 (0x02 << 24)
+
+#define S3C2400_GPB13        S3C2410_GPIONO(S3C2410_GPIO_BANKB, 13)
+#define S3C2400_GPB13_INP    (0x00 << 26)
+#define S3C2400_GPB13_OUTP   (0x01 << 26)
+#define S3C2400_GPB13_DATA29 (0x02 << 26)
+
+#define S3C2400_GPB14        S3C2410_GPIONO(S3C2410_GPIO_BANKB, 14)
+#define S3C2400_GPB14_INP    (0x00 << 28)
+#define S3C2400_GPB14_OUTP   (0x01 << 28)
+#define S3C2400_GPB14_DATA30 (0x02 << 28)
+
+#define S3C2400_GPB15        S3C2410_GPIONO(S3C2410_GPIO_BANKB, 15)
+#define S3C2400_GPB15_INP    (0x00 << 30)
+#define S3C2400_GPB15_OUTP   (0x01 << 30)
+#define S3C2400_GPB15_DATA31 (0x02 << 30)
+
+#define S3C2410_GPB_PUPDIS(x)  (1<<(x))
 
 /* Port C consits of 16 GPIO/Special function
  *
 #define S3C2410_GPCDAT    S3C2410_GPIOREG(0x24)
 #define S3C2410_GPCUP     S3C2410_GPIOREG(0x28)
 
+#define S3C2400_GPCCON    S3C2410_GPIOREG(0x14)
+#define S3C2400_GPCDAT    S3C2410_GPIOREG(0x18)
+#define S3C2400_GPCUP     S3C2410_GPIOREG(0x1C)
+
 #define S3C2410_GPC0            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 0)
 #define S3C2410_GPC0_INP       (0x00 << 0)
 #define S3C2410_GPC0_OUTP      (0x01 << 0)
 #define S3C2410_GPC0_LEND      (0x02 << 0)
+#define S3C2400_GPC0_VD0       (0x02 << 0)
 
 #define S3C2410_GPC1            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 1)
 #define S3C2410_GPC1_INP       (0x00 << 2)
 #define S3C2410_GPC1_OUTP      (0x01 << 2)
 #define S3C2410_GPC1_VCLK      (0x02 << 2)
+#define S3C2400_GPC1_VD1       (0x02 << 2)
 
 #define S3C2410_GPC2            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 2)
 #define S3C2410_GPC2_INP       (0x00 << 4)
 #define S3C2410_GPC2_OUTP      (0x01 << 4)
 #define S3C2410_GPC2_VLINE     (0x02 << 4)
+#define S3C2400_GPC2_VD2       (0x02 << 4)
 
 #define S3C2410_GPC3            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 3)
 #define S3C2410_GPC3_INP       (0x00 << 6)
 #define S3C2410_GPC3_OUTP      (0x01 << 6)
 #define S3C2410_GPC3_VFRAME    (0x02 << 6)
+#define S3C2400_GPC3_VD3       (0x02 << 6)
 
 #define S3C2410_GPC4            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 4)
 #define S3C2410_GPC4_INP       (0x00 << 8)
 #define S3C2410_GPC4_OUTP      (0x01 << 8)
 #define S3C2410_GPC4_VM                (0x02 << 8)
+#define S3C2400_GPC4_VD4       (0x02 << 8)
 
 #define S3C2410_GPC5            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 5)
 #define S3C2410_GPC5_INP       (0x00 << 10)
 #define S3C2410_GPC5_OUTP      (0x01 << 10)
 #define S3C2410_GPC5_LCDVF0    (0x02 << 10)
+#define S3C2400_GPC5_VD5       (0x02 << 10)
 
 #define S3C2410_GPC6            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 6)
 #define S3C2410_GPC6_INP       (0x00 << 12)
 #define S3C2410_GPC6_OUTP      (0x01 << 12)
 #define S3C2410_GPC6_LCDVF1    (0x02 << 12)
+#define S3C2400_GPC6_VD6       (0x02 << 12)
 
 #define S3C2410_GPC7            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 7)
 #define S3C2410_GPC7_INP       (0x00 << 14)
 #define S3C2410_GPC7_OUTP      (0x01 << 14)
 #define S3C2410_GPC7_LCDVF2    (0x02 << 14)
+#define S3C2400_GPC7_VD7       (0x02 << 14)
 
 #define S3C2410_GPC8            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 8)
 #define S3C2410_GPC8_INP       (0x00 << 16)
 #define S3C2410_GPC8_OUTP      (0x01 << 16)
 #define S3C2410_GPC8_VD0       (0x02 << 16)
+#define S3C2400_GPC8_VD8       (0x02 << 16)
 
 #define S3C2410_GPC9            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 9)
 #define S3C2410_GPC9_INP       (0x00 << 18)
 #define S3C2410_GPC9_OUTP      (0x01 << 18)
 #define S3C2410_GPC9_VD1       (0x02 << 18)
+#define S3C2400_GPC9_VD9       (0x02 << 18)
 
 #define S3C2410_GPC10           S3C2410_GPIONO(S3C2410_GPIO_BANKC, 10)
 #define S3C2410_GPC10_INP      (0x00 << 20)
 #define S3C2410_GPC10_OUTP     (0x01 << 20)
 #define S3C2410_GPC10_VD2      (0x02 << 20)
+#define S3C2400_GPC10_VD10     (0x02 << 20)
 
 #define S3C2410_GPC11           S3C2410_GPIONO(S3C2410_GPIO_BANKC, 11)
 #define S3C2410_GPC11_INP      (0x00 << 22)
 #define S3C2410_GPC11_OUTP     (0x01 << 22)
 #define S3C2410_GPC11_VD3      (0x02 << 22)
+#define S3C2400_GPC11_VD11     (0x02 << 22)
 
 #define S3C2410_GPC12           S3C2410_GPIONO(S3C2410_GPIO_BANKC, 12)
 #define S3C2410_GPC12_INP      (0x00 << 24)
 #define S3C2410_GPC12_OUTP     (0x01 << 24)
 #define S3C2410_GPC12_VD4      (0x02 << 24)
+#define S3C2400_GPC12_VD12     (0x02 << 24)
 
 #define S3C2410_GPC13           S3C2410_GPIONO(S3C2410_GPIO_BANKC, 13)
 #define S3C2410_GPC13_INP      (0x00 << 26)
 #define S3C2410_GPC13_OUTP     (0x01 << 26)
 #define S3C2410_GPC13_VD5      (0x02 << 26)
+#define S3C2400_GPC13_VD13     (0x02 << 26)
 
 #define S3C2410_GPC14           S3C2410_GPIONO(S3C2410_GPIO_BANKC, 14)
 #define S3C2410_GPC14_INP      (0x00 << 28)
 #define S3C2410_GPC14_OUTP     (0x01 << 28)
 #define S3C2410_GPC14_VD6      (0x02 << 28)
+#define S3C2400_GPC14_VD14     (0x02 << 28)
 
 #define S3C2410_GPC15           S3C2410_GPIONO(S3C2410_GPIO_BANKC, 15)
 #define S3C2410_GPC15_INP      (0x00 << 30)
 #define S3C2410_GPC15_OUTP     (0x01 << 30)
 #define S3C2410_GPC15_VD7      (0x02 << 30)
+#define S3C2400_GPC15_VD15     (0x02 << 30)
+
+#define S3C2410_GPC_PUPDIS(x)  (1<<(x))
 
-/* Port D consists of 16 GPIO/Special function
+/*
+ * S3C2410: Port D consists of 16 GPIO/Special function
  *
  * almost identical setup to port b, but the special functions are mostly
  * to do with the video system's data.
+ *
+ * S3C2400: Port D consists of 11 GPIO/Special function
+ *
+ * almost identical setup to port c
 */
 
 #define S3C2410_GPDCON    S3C2410_GPIOREG(0x30)
 #define S3C2410_GPDDAT    S3C2410_GPIOREG(0x34)
 #define S3C2410_GPDUP     S3C2410_GPIOREG(0x38)
 
+#define S3C2400_GPDCON    S3C2410_GPIOREG(0x20)
+#define S3C2400_GPDDAT    S3C2410_GPIOREG(0x24)
+#define S3C2400_GPDUP     S3C2410_GPIOREG(0x28)
+
 #define S3C2410_GPD0            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 0)
 #define S3C2410_GPD0_INP       (0x00 << 0)
 #define S3C2410_GPD0_OUTP      (0x01 << 0)
 #define S3C2410_GPD0_VD8       (0x02 << 0)
+#define S3C2400_GPD0_VFRAME    (0x02 << 0)
 
 #define S3C2410_GPD1            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 1)
 #define S3C2410_GPD1_INP       (0x00 << 2)
 #define S3C2410_GPD1_OUTP      (0x01 << 2)
 #define S3C2410_GPD1_VD9       (0x02 << 2)
+#define S3C2400_GPD1_VM                (0x02 << 2)
 
 #define S3C2410_GPD2            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 2)
 #define S3C2410_GPD2_INP       (0x00 << 4)
 #define S3C2410_GPD2_OUTP      (0x01 << 4)
 #define S3C2410_GPD2_VD10      (0x02 << 4)
+#define S3C2400_GPD2_VLINE     (0x02 << 4)
 
 #define S3C2410_GPD3            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 3)
 #define S3C2410_GPD3_INP       (0x00 << 6)
 #define S3C2410_GPD3_OUTP      (0x01 << 6)
 #define S3C2410_GPD3_VD11      (0x02 << 6)
+#define S3C2400_GPD3_VCLK      (0x02 << 6)
 
 #define S3C2410_GPD4            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 4)
 #define S3C2410_GPD4_INP       (0x00 << 8)
 #define S3C2410_GPD4_OUTP      (0x01 << 8)
 #define S3C2410_GPD4_VD12      (0x02 << 8)
+#define S3C2400_GPD4_LEND      (0x02 << 8)
 
 #define S3C2410_GPD5            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 5)
 #define S3C2410_GPD5_INP       (0x00 << 10)
 #define S3C2410_GPD5_OUTP      (0x01 << 10)
 #define S3C2410_GPD5_VD13      (0x02 << 10)
+#define S3C2400_GPD5_TOUT0     (0x02 << 10)
 
 #define S3C2410_GPD6            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 6)
 #define S3C2410_GPD6_INP       (0x00 << 12)
 #define S3C2410_GPD6_OUTP      (0x01 << 12)
 #define S3C2410_GPD6_VD14      (0x02 << 12)
+#define S3C2400_GPD6_TOUT1     (0x02 << 12)
 
 #define S3C2410_GPD7            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 7)
 #define S3C2410_GPD7_INP       (0x00 << 14)
 #define S3C2410_GPD7_OUTP      (0x01 << 14)
 #define S3C2410_GPD7_VD15      (0x02 << 14)
+#define S3C2400_GPD7_TOUT2     (0x02 << 14)
 
 #define S3C2410_GPD8            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 8)
 #define S3C2410_GPD8_INP       (0x00 << 16)
 #define S3C2410_GPD8_OUTP      (0x01 << 16)
 #define S3C2410_GPD8_VD16      (0x02 << 16)
+#define S3C2400_GPD8_TOUT3     (0x02 << 16)
 
 #define S3C2410_GPD9            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 9)
 #define S3C2410_GPD9_INP       (0x00 << 18)
 #define S3C2410_GPD9_OUTP      (0x01 << 18)
 #define S3C2410_GPD9_VD17      (0x02 << 18)
+#define S3C2400_GPD9_TCLK0     (0x02 << 18)
+#define S3C2410_GPD9_MASK       (0x03 << 18)
 
 #define S3C2410_GPD10           S3C2410_GPIONO(S3C2410_GPIO_BANKD, 10)
 #define S3C2410_GPD10_INP      (0x00 << 20)
 #define S3C2410_GPD10_OUTP     (0x01 << 20)
 #define S3C2410_GPD10_VD18     (0x02 << 20)
+#define S3C2400_GPD10_nWAIT    (0x02 << 20)
 
 #define S3C2410_GPD11           S3C2410_GPIONO(S3C2410_GPIO_BANKD, 11)
 #define S3C2410_GPD11_INP      (0x00 << 22)
 #define S3C2410_GPD15_OUTP     (0x01 << 30)
 #define S3C2410_GPD15_VD23     (0x02 << 30)
 
-/* Port E consists of 16 GPIO/Special function
+#define S3C2410_GPD_PUPDIS(x)  (1<<(x))
+
+/* S3C2410:
+ * Port E consists of 16 GPIO/Special function
  *
  * again, the same as port B, but dealing with I2S, SDI, and
  * more miscellaneous functions
+ *
+ * S3C2400:
+ * Port E consists of 12 GPIO/Special function
+ *
+ * GPIO / interrupt inputs
 */
 
 #define S3C2410_GPECON    S3C2410_GPIOREG(0x40)
 #define S3C2410_GPEDAT    S3C2410_GPIOREG(0x44)
 #define S3C2410_GPEUP     S3C2410_GPIOREG(0x48)
 
+#define S3C2400_GPECON    S3C2410_GPIOREG(0x2C)
+#define S3C2400_GPEDAT    S3C2410_GPIOREG(0x30)
+#define S3C2400_GPEUP     S3C2410_GPIOREG(0x34)
+
 #define S3C2410_GPE0           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 0)
 #define S3C2410_GPE0_INP       (0x00 << 0)
 #define S3C2410_GPE0_OUTP      (0x01 << 0)
 #define S3C2410_GPE0_I2SLRCK   (0x02 << 0)
+#define S3C2400_GPE0_EINT0     (0x02 << 0)
 #define S3C2410_GPE0_MASK      (0x03 << 0)
 
 #define S3C2410_GPE1           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 1)
 #define S3C2410_GPE1_INP       (0x00 << 2)
 #define S3C2410_GPE1_OUTP      (0x01 << 2)
 #define S3C2410_GPE1_I2SSCLK   (0x02 << 2)
+#define S3C2400_GPE1_EINT1     (0x02 << 2)
+#define S3C2400_GPE1_nSS       (0x03 << 2)
 #define S3C2410_GPE1_MASK      (0x03 << 2)
 
 #define S3C2410_GPE2           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 2)
 #define S3C2410_GPE2_INP       (0x00 << 4)
 #define S3C2410_GPE2_OUTP      (0x01 << 4)
 #define S3C2410_GPE2_CDCLK     (0x02 << 4)
+#define S3C2400_GPE2_EINT2     (0x02 << 4)
+#define S3C2400_GPE2_I2SSDI    (0x03 << 4)
 
 #define S3C2410_GPE3           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 3)
 #define S3C2410_GPE3_INP       (0x00 << 6)
 #define S3C2410_GPE3_OUTP      (0x01 << 6)
 #define S3C2410_GPE3_I2SSDI    (0x02 << 6)
+#define S3C2400_GPE3_EINT3     (0x02 << 6)
+#define S3C2400_GPE3_nCTS1     (0x03 << 6)
 #define S3C2410_GPE3_nSS0      (0x03 << 6)
 #define S3C2410_GPE3_MASK      (0x03 << 6)
 
 #define S3C2410_GPE4_INP       (0x00 << 8)
 #define S3C2410_GPE4_OUTP      (0x01 << 8)
 #define S3C2410_GPE4_I2SSDO    (0x02 << 8)
+#define S3C2400_GPE4_EINT4     (0x02 << 8)
+#define S3C2400_GPE4_nRTS1     (0x03 << 8)
 #define S3C2410_GPE4_I2SSDI    (0x03 << 8)
 #define S3C2410_GPE4_MASK      (0x03 << 8)
 
 #define S3C2410_GPE5_INP       (0x00 << 10)
 #define S3C2410_GPE5_OUTP      (0x01 << 10)
 #define S3C2410_GPE5_SDCLK     (0x02 << 10)
+#define S3C2400_GPE5_EINT5     (0x02 << 10)
+#define S3C2400_GPE5_TCLK1     (0x03 << 10)
 
 #define S3C2410_GPE6           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 6)
 #define S3C2410_GPE6_INP       (0x00 << 12)
 #define S3C2410_GPE6_OUTP      (0x01 << 12)
 #define S3C2410_GPE6_SDCMD     (0x02 << 12)
+#define S3C2400_GPE6_EINT6     (0x02 << 12)
 
 #define S3C2410_GPE7           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 7)
 #define S3C2410_GPE7_INP       (0x00 << 14)
 #define S3C2410_GPE7_OUTP      (0x01 << 14)
 #define S3C2410_GPE7_SDDAT0    (0x02 << 14)
+#define S3C2400_GPE7_EINT7     (0x02 << 14)
 
 #define S3C2410_GPE8           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 8)
 #define S3C2410_GPE8_INP       (0x00 << 16)
 #define S3C2410_GPE8_OUTP      (0x01 << 16)
 #define S3C2410_GPE8_SDDAT1    (0x02 << 16)
+#define S3C2400_GPE8_nXDACK0   (0x02 << 16)
 
 #define S3C2410_GPE9           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 9)
 #define S3C2410_GPE9_INP       (0x00 << 18)
 #define S3C2410_GPE9_OUTP      (0x01 << 18)
 #define S3C2410_GPE9_SDDAT2    (0x02 << 18)
+#define S3C2400_GPE9_nXDACK1   (0x02 << 18)
+#define S3C2400_GPE9_nXBACK    (0x03 << 18)
 
 #define S3C2410_GPE10          S3C2410_GPIONO(S3C2410_GPIO_BANKE, 10)
 #define S3C2410_GPE10_INP      (0x00 << 20)
 #define S3C2410_GPE10_OUTP     (0x01 << 20)
 #define S3C2410_GPE10_SDDAT3   (0x02 << 20)
+#define S3C2400_GPE10_nXDREQ0  (0x02 << 20)
 
 #define S3C2410_GPE11          S3C2410_GPIONO(S3C2410_GPIO_BANKE, 11)
 #define S3C2410_GPE11_INP      (0x00 << 22)
 #define S3C2410_GPE11_OUTP     (0x01 << 22)
 #define S3C2410_GPE11_SPIMISO0 (0x02 << 22)
+#define S3C2400_GPE11_nXDREQ1  (0x02 << 22)
+#define S3C2400_GPE11_nXBREQ   (0x03 << 22)
 
 #define S3C2410_GPE12          S3C2410_GPIONO(S3C2410_GPIO_BANKE, 12)
 #define S3C2410_GPE12_INP      (0x00 << 24)
 
 #define S3C2410_GPE_PUPDIS(x)  (1<<(x))
 
-/* Port F consists of 8 GPIO/Special function
+/* S3C2410:
+ * Port F consists of 8 GPIO/Special function
  *
  * GPIO / interrupt inputs
  *
  *   00 = 0 input, 1 output, 2 interrupt (EINT0..7), 3 undefined
  *
  * pull up works like all other ports.
+ *
+ * S3C2400:
+ * Port F consists of 7 GPIO/Special function
+ *
+ * GPIO/serial/misc pins
 */
 
 #define S3C2410_GPFCON    S3C2410_GPIOREG(0x50)
 #define S3C2410_GPFDAT    S3C2410_GPIOREG(0x54)
 #define S3C2410_GPFUP     S3C2410_GPIOREG(0x58)
 
+#define S3C2400_GPFCON    S3C2410_GPIOREG(0x38)
+#define S3C2400_GPFDAT    S3C2410_GPIOREG(0x3C)
+#define S3C2400_GPFUP     S3C2410_GPIOREG(0x40)
+
 #define S3C2410_GPF0        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 0)
 #define S3C2410_GPF0_INP    (0x00 << 0)
 #define S3C2410_GPF0_OUTP   (0x01 << 0)
 #define S3C2410_GPF0_EINT0  (0x02 << 0)
+#define S3C2400_GPF0_RXD0   (0x02 << 0)
 
 #define S3C2410_GPF1        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 1)
 #define S3C2410_GPF1_INP    (0x00 << 2)
 #define S3C2410_GPF1_OUTP   (0x01 << 2)
 #define S3C2410_GPF1_EINT1  (0x02 << 2)
+#define S3C2400_GPF1_RXD1   (0x02 << 2)
+#define S3C2400_GPF1_IICSDA (0x03 << 2)
 
 #define S3C2410_GPF2        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 2)
 #define S3C2410_GPF2_INP    (0x00 << 4)
 #define S3C2410_GPF2_OUTP   (0x01 << 4)
 #define S3C2410_GPF2_EINT2  (0x02 << 4)
+#define S3C2400_GPF2_TXD0   (0x02 << 4)
 
 #define S3C2410_GPF3        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 3)
 #define S3C2410_GPF3_INP    (0x00 << 6)
 #define S3C2410_GPF3_OUTP   (0x01 << 6)
 #define S3C2410_GPF3_EINT3  (0x02 << 6)
+#define S3C2400_GPF3_TXD1   (0x02 << 6)
+#define S3C2400_GPF3_IICSCL (0x03 << 6)
 
 #define S3C2410_GPF4        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 4)
 #define S3C2410_GPF4_INP    (0x00 << 8)
 #define S3C2410_GPF4_OUTP   (0x01 << 8)
 #define S3C2410_GPF4_EINT4  (0x02 << 8)
+#define S3C2400_GPF4_nRTS0  (0x02 << 8)
+#define S3C2400_GPF4_nXBACK (0x03 << 8)
 
 #define S3C2410_GPF5        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 5)
 #define S3C2410_GPF5_INP    (0x00 << 10)
 #define S3C2410_GPF5_OUTP   (0x01 << 10)
 #define S3C2410_GPF5_EINT5  (0x02 << 10)
+#define S3C2400_GPF5_nCTS0  (0x02 << 10)
+#define S3C2400_GPF5_nXBREQ (0x03 << 10)
 
 #define S3C2410_GPF6        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 6)
 #define S3C2410_GPF6_INP    (0x00 << 12)
 #define S3C2410_GPF6_OUTP   (0x01 << 12)
 #define S3C2410_GPF6_EINT6  (0x02 << 12)
+#define S3C2400_GPF6_CLKOUT (0x02 << 12)
 
 #define S3C2410_GPF7        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 7)
 #define S3C2410_GPF7_INP    (0x00 << 14)
 #define S3C2410_GPF7_OUTP   (0x01 << 14)
 #define S3C2410_GPF7_EINT7  (0x02 << 14)
 
-/* Port G consists of 8 GPIO/IRQ/Special function
+#define S3C2410_GPF_PUPDIS(x)  (1<<(x))
+
+/* S3C2410:
+ * Port G consists of 8 GPIO/IRQ/Special function
  *
  * GPGCON has 2 bits for each of the input pins on port F
  *   00 = 0 input, 1 output, 2 interrupt (EINT0..7), 3 special func
  *
  * pull up works like all other ports.
+ *
+ * S3C2400:
+ * Port G consists of 10 GPIO/Special function
 */
 
 #define S3C2410_GPGCON    S3C2410_GPIOREG(0x60)
 #define S3C2410_GPGDAT    S3C2410_GPIOREG(0x64)
 #define S3C2410_GPGUP     S3C2410_GPIOREG(0x68)
 
+#define S3C2400_GPGCON    S3C2410_GPIOREG(0x44)
+#define S3C2400_GPGDAT    S3C2410_GPIOREG(0x48)
+#define S3C2400_GPGUP     S3C2410_GPIOREG(0x4C)
+
 #define S3C2410_GPG0          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 0)
 #define S3C2410_GPG0_INP      (0x00 << 0)
 #define S3C2410_GPG0_OUTP     (0x01 << 0)
 #define S3C2410_GPG0_EINT8    (0x02 << 0)
+#define S3C2400_GPG0_I2SLRCK  (0x02 << 0)
 
 #define S3C2410_GPG1          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 1)
 #define S3C2410_GPG1_INP      (0x00 << 2)
 #define S3C2410_GPG1_OUTP     (0x01 << 2)
 #define S3C2410_GPG1_EINT9    (0x02 << 2)
+#define S3C2400_GPG1_I2SSCLK  (0x02 << 2)
 
 #define S3C2410_GPG2          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 2)
 #define S3C2410_GPG2_INP      (0x00 << 4)
 #define S3C2410_GPG2_OUTP     (0x01 << 4)
 #define S3C2410_GPG2_EINT10   (0x02 << 4)
+#define S3C2400_GPG2_CDCLK    (0x02 << 4)
 
 #define S3C2410_GPG3          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 3)
 #define S3C2410_GPG3_INP      (0x00 << 6)
 #define S3C2410_GPG3_OUTP     (0x01 << 6)
 #define S3C2410_GPG3_EINT11   (0x02 << 6)
+#define S3C2400_GPG3_I2SSDO   (0x02 << 6)
+#define S3C2400_GPG3_I2SSDI   (0x03 << 6)
 
 #define S3C2410_GPG4          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 4)
 #define S3C2410_GPG4_INP      (0x00 << 8)
 #define S3C2410_GPG4_OUTP     (0x01 << 8)
 #define S3C2410_GPG4_EINT12   (0x02 << 8)
+#define S3C2400_GPG4_MMCCLK   (0x02 << 8)
+#define S3C2400_GPG4_I2SSDI   (0x03 << 8)
 #define S3C2410_GPG4_LCDPWREN (0x03 << 8)
 
 #define S3C2410_GPG5          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 5)
 #define S3C2410_GPG5_INP      (0x00 << 10)
 #define S3C2410_GPG5_OUTP     (0x01 << 10)
 #define S3C2410_GPG5_EINT13   (0x02 << 10)
+#define S3C2400_GPG5_MMCCMD   (0x02 << 10)
+#define S3C2400_GPG5_IICSDA   (0x03 << 10)
 #define S3C2410_GPG5_SPIMISO1 (0x03 << 10)
 
 #define S3C2410_GPG6          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 6)
 #define S3C2410_GPG6_INP      (0x00 << 12)
 #define S3C2410_GPG6_OUTP     (0x01 << 12)
 #define S3C2410_GPG6_EINT14   (0x02 << 12)
+#define S3C2400_GPG6_MMCDAT   (0x02 << 12)
+#define S3C2400_GPG6_IICSCL   (0x03 << 12)
 #define S3C2410_GPG6_SPIMOSI1 (0x03 << 12)
 
 #define S3C2410_GPG7          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 7)
 #define S3C2410_GPG7_OUTP     (0x01 << 14)
 #define S3C2410_GPG7_EINT15   (0x02 << 14)
 #define S3C2410_GPG7_SPICLK1  (0x03 << 14)
+#define S3C2400_GPG7_SPIMISO  (0x02 << 14)
+#define S3C2400_GPG7_IICSDA   (0x03 << 14)
 
 #define S3C2410_GPG8          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 8)
 #define S3C2410_GPG8_INP      (0x00 << 16)
 #define S3C2410_GPG8_OUTP     (0x01 << 16)
 #define S3C2410_GPG8_EINT16   (0x02 << 16)
+#define S3C2400_GPG8_SPIMOSI  (0x02 << 16)
+#define S3C2400_GPG8_IICSCL   (0x03 << 16)
 
 #define S3C2410_GPG9          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 9)
 #define S3C2410_GPG9_INP      (0x00 << 18)
 #define S3C2410_GPG9_OUTP     (0x01 << 18)
 #define S3C2410_GPG9_EINT17   (0x02 << 18)
+#define S3C2400_GPG9_SPICLK   (0x02 << 18)
+#define S3C2400_GPG9_MMCCLK   (0x03 << 18)
 
 #define S3C2410_GPG10         S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10)
 #define S3C2410_GPG10_INP     (0x00 << 20)
 #define S3C2410_GPH10_CLKOUT1 (0x02 << 20)
 
 /* miscellaneous control */
-
+#define S3C2400_MISCCR    S3C2410_GPIOREG(0x54)
 #define S3C2410_MISCCR    S3C2410_GPIOREG(0x80)
 #define S3C2410_DCLKCON           S3C2410_GPIOREG(0x84)
 
 /* see clock.h for dclk definitions */
 
 /* pullup control on databus */
-#define S3C2410_MISCCR_SPUCR_HEN    (0)
+#define S3C2410_MISCCR_SPUCR_HEN    (0<<0)
 #define S3C2410_MISCCR_SPUCR_HDIS   (1<<0)
-#define S3C2410_MISCCR_SPUCR_LEN    (0)
+#define S3C2410_MISCCR_SPUCR_LEN    (0<<1)
 #define S3C2410_MISCCR_SPUCR_LDIS   (1<<1)
 
-#define S3C2410_MISCCR_USBDEV      (0)
+#define S3C2400_MISCCR_SPUCR_LEN    (0<<0)
+#define S3C2400_MISCCR_SPUCR_LDIS   (1<<0)
+#define S3C2400_MISCCR_SPUCR_HEN    (0<<1)
+#define S3C2400_MISCCR_SPUCR_HDIS   (1<<1)
+
+#define S3C2400_MISCCR_HZ_STOPEN    (0<<2)
+#define S3C2400_MISCCR_HZ_STOPPREV  (1<<2)
+
+#define S3C2410_MISCCR_USBDEV      (0<<3)
 #define S3C2410_MISCCR_USBHOST     (1<<3)
 
 #define S3C2410_MISCCR_CLK0_MPLL    (0<<4)
  *
  * Samsung datasheet p9-25
 */
-
+#define S3C2400_EXTINT0    S3C2410_GPIOREG(0x58)
 #define S3C2410_EXTINT0           S3C2410_GPIOREG(0x88)
 #define S3C2410_EXTINT1           S3C2410_GPIOREG(0x8C)
 #define S3C2410_EXTINT2           S3C2410_GPIOREG(0x90)
 #define S3C2410_GSTATUS2_OFFRESET  (1<<1)
 #define S3C2410_GSTATUS2_PONRESET  (1<<0)
 
+/* open drain control register */
+#define S3C2400_OPENCR     S3C2410_GPIOREG(0x50)
+
+#define S3C2400_OPENCR_OPC_RXD1DIS  (0<<0)
+#define S3C2400_OPENCR_OPC_RXD1EN   (1<<0)
+#define S3C2400_OPENCR_OPC_TXD1DIS  (0<<1)
+#define S3C2400_OPENCR_OPC_TXD1EN   (1<<1)
+#define S3C2400_OPENCR_OPC_CMDDIS   (0<<2)
+#define S3C2400_OPENCR_OPC_CMDEN    (1<<2)
+#define S3C2400_OPENCR_OPC_DATDIS   (0<<3)
+#define S3C2400_OPENCR_OPC_DATEN    (1<<3)
+#define S3C2400_OPENCR_OPC_MISODIS  (0<<4)
+#define S3C2400_OPENCR_OPC_MISOEN   (1<<4)
+#define S3C2400_OPENCR_OPC_MOSIDIS  (0<<5)
+#define S3C2400_OPENCR_OPC_MOSIEN   (1<<5)
+
 #endif /* __ASM_ARCH_REGS_GPIO_H */
 
index 9d4fe6cf205b1fb9e272e19091c8a902b59aa8ec..040ccde7a11ec8f0bafa8a7481944660fd02014c 100644 (file)
@@ -10,8 +10,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#include <asm/hardware.h>
-
 #define IO_SPACE_LIMIT 0xffffffff
 
 /*
index 5248ca054909e4c8a1314077b6303f0f7f021d48..685123981e8b291d9ab1865220ba221722e14bb0 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <linux/config.h>
 #include <linux/threads.h>
+#include <linux/irq.h>
 
 typedef struct {
        unsigned int __softirq_pending;
index f9caecf7e3c0dd7f5b821336d2101a7647d841ed..ae031eaa3dd2a05705fca170524ec3cedad996c5 100644 (file)
 /*
  * some bits needed for parts of the IDE subsystem to compile
  */
-#define __ide_mm_insw(port, addr, n)   insw(port, addr, n)
-#define __ide_mm_insl(port, addr, n)   insl(port, addr, n)
-#define __ide_mm_outsw(port, addr, n)  outsw(port, addr, n)
-#define __ide_mm_outsl(port, addr, n)  outsl(port, addr, n)
+#define __ide_mm_insw(port, addr, n)   insw((unsigned long) (port), addr, n)
+#define __ide_mm_insl(port, addr, n)   insl((unsigned long) (port), addr, n)
+#define __ide_mm_outsw(port, addr, n)  outsw((unsigned long) (port), addr, n)
+#define __ide_mm_outsl(port, addr, n)  outsl((unsigned long) (port), addr, n)
 
 
 #endif /* __KERNEL__ */
index 4feba567e7fd7bd47601f3199285ba15e7ed9815..b8221b611b5c3cad5c1f54d004d410f1e4dc2e90 100644 (file)
@@ -47,8 +47,8 @@ typedef struct { unsigned long        pgprot; } pgprot_t;
 
 #define devmem_is_allowed(pfn) 1
 
-#define __pa(vaddr)            virt_to_phys((void *) vaddr)
-#define __va(paddr)            phys_to_virt((unsigned long) paddr)
+#define __pa(vaddr)            virt_to_phys((void *) (unsigned long) (vaddr))
+#define __va(paddr)            phys_to_virt((unsigned long) (paddr))
 
 #define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)
 
index b18396288df1a0475fe7d28d09189076e2fcf7e4..907c5c3643cced5eb8e3ecef3b33dd8a6607a213 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/spinlock.h>
 #include <linux/rwsem.h>
 
-#define SEMAPHORE_DEBUG                WAITQUEUE_DEBUG
+#define SEMAPHORE_DEBUG                0
 
 /*
  * the semaphore definition
index c8cba7836f0d2d2b79171235fd522cf7b21ae588..60f6b2aee76d7dc94666b4fc6e5bd24ef6a0e6e7 100644 (file)
@@ -58,7 +58,7 @@ struct thread_info {
 
 #endif
 
-#define PREEMPT_ACTIVE         0x4000000
+#define PREEMPT_ACTIVE         0x10000000
 
 /*
  * macros/functions for gaining access to the thread information structure
index 9dd9da10527849add26749970dc31a963237854a..5e6362a786b72b2b5b9ce98a51db94d1b74f27d2 100644 (file)
@@ -110,8 +110,9 @@ extern int ia64_pfn_valid (unsigned long pfn);
 # define pfn_to_page(pfn)      (mem_map + (pfn))
 #elif defined(CONFIG_DISCONTIGMEM)
 extern struct page *vmem_map;
+extern unsigned long min_low_pfn;
 extern unsigned long max_low_pfn;
-# define pfn_valid(pfn)                (((pfn) < max_low_pfn) && ia64_pfn_valid(pfn))
+# define pfn_valid(pfn)                (((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn) && ia64_pfn_valid(pfn))
 # define page_to_pfn(page)     ((unsigned long) (page - vmem_map))
 # define pfn_to_page(pfn)      (vmem_map + (pfn))
 #endif
index bfff69a49936abdaae3b3d07dea3a8843cf6e39f..ef1fb8ea4726b0c7b3aea02db8d0fc40d4ee6cdf 100644 (file)
@@ -242,6 +242,27 @@ static __inline__ int atomic_dec_return(atomic_t *v)
  */
 #define atomic_add_negative(i,v) (atomic_add_return((i), (v)) < 0)
 
+#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
+
+/**
+ * atomic_add_unless - add unless the number is a given value
+ * @v: pointer of type atomic_t
+ * @a: the amount to add to v...
+ * @u: ...unless v is equal to u.
+ *
+ * Atomically adds @a to @v, so long as it was not @u.
+ * Returns non-zero if @v was not @u, and zero otherwise.
+ */
+#define atomic_add_unless(v, a, u)                             \
+({                                                             \
+       int c, old;                                             \
+       c = atomic_read(v);                                     \
+       while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
+               c = old;                                        \
+       c != (u);                                               \
+})
+#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
+
 static __inline__ void atomic_clear_mask(unsigned long  mask, atomic_t *addr)
 {
        unsigned long flags;
index 194393bd8beb8f07eee63a375211c34350efc603..f7aa96970d180c7389a272ea0b8b583ca1ca8325 100644 (file)
 # endif
 #endif
 
-#if defined(CONFIG_PLAT_M32700UT)
-#include <asm/irq.h>
-#include <asm/m32700ut/m32700ut_pld.h>
-#endif
+#include <asm/m32r.h>
+
 
 #define IDE_ARCH_OBSOLETE_DEFAULTS
 
 static __inline__ int ide_default_irq(unsigned long base)
 {
        switch (base) {
-#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) || defined(CONFIG_PLAT_MAPPI3)
+#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2)
+               case 0x1f0: return PLD_IRQ_CFIREQ;
+               default:
+                       return 0;
+#elif defined(CONFIG_PLAT_MAPPI3)
                case 0x1f0: return PLD_IRQ_CFIREQ;
+               case 0x170: return PLD_IRQ_IDEIREQ;
                default:
                        return 0;
 #else
index 3f1551f7f01f16835d82f7cd85dca06dcdb154ac..1d3c25d61bcb2399e6f4def20b7ac16b2a911fd0 100644 (file)
@@ -59,7 +59,7 @@
 #define  M32R_IRQ_I2C          (28)  /* I2C-BUS     */
 #define  PLD_IRQ_CFIREQ       (6)  /* INT5 CFC Card Interrupt */
 #define  PLD_IRQ_CFC_INSERT   (7)  /* INT6 CFC Card Insert */
-#define  PLD_IRQ_CFC_EJECT    (8)  /* INT7 CFC Card Eject */
+#define  PLD_IRQ_IDEIREQ      (8)  /* INT7 IDE Interrupt   */
 #define  PLD_IRQ_MMCCARD      (43)  /* MMC Card Insert */
 #define  PLD_IRQ_MMCIRQ       (44)  /* MMC Transfer Done */
 
index 73348c3f858b673b73513e97d913cb4e265e38c6..5eee832b73a03e56beb8ce574c75f1ca74499eb4 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include <linux/config.h>
+#include <asm/assembler.h>
 
 #ifdef __KERNEL__
 
@@ -132,8 +133,6 @@ static inline void local_irq_disable(void)
                !(flags & 0x40);                        \
        })
 
-#endif  /* __KERNEL__ */
-
 #define nop()  __asm__ __volatile__ ("nop" : : )
 
 #define xchg(ptr,x) \
@@ -213,6 +212,67 @@ static __inline__ unsigned long __xchg(unsigned long x, volatile void * ptr,
        return (tmp);
 }
 
+#define __HAVE_ARCH_CMPXCHG    1
+
+static __inline__ unsigned long
+__cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new)
+{
+       unsigned long flags;
+       unsigned int retval;
+
+       local_irq_save(flags);
+       __asm__ __volatile__ (
+                       DCACHE_CLEAR("%0", "r4", "%1")
+                       M32R_LOCK" %0, @%1;     \n"
+               "       bne     %0, %2, 1f;     \n"
+                       M32R_UNLOCK" %3, @%1;   \n"
+               "       bra     2f;             \n"
+                "       .fillinsn              \n"
+               "1:"
+                       M32R_UNLOCK" %2, @%1;   \n"
+                "       .fillinsn              \n"
+               "2:"
+                       : "=&r" (retval)
+                       : "r" (p), "r" (old), "r" (new)
+                       : "cbit", "memory"
+#ifdef CONFIG_CHIP_M32700_TS1
+                       , "r4"
+#endif  /* CONFIG_CHIP_M32700_TS1 */
+               );
+       local_irq_restore(flags);
+
+       return retval;
+}
+
+/* This function doesn't exist, so you'll get a linker error
+   if something tries to do an invalid cmpxchg().  */
+extern void __cmpxchg_called_with_bad_pointer(void);
+
+static __inline__ unsigned long
+__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
+{
+       switch (size) {
+       case 4:
+               return __cmpxchg_u32(ptr, old, new);
+#if 0  /* we don't have __cmpxchg_u64 */
+       case 8:
+               return __cmpxchg_u64(ptr, old, new);
+#endif /* 0 */
+       }
+       __cmpxchg_called_with_bad_pointer();
+       return old;
+}
+
+#define cmpxchg(ptr,o,n)                                                \
+  ({                                                                    \
+     __typeof__(*(ptr)) _o_ = (o);                                      \
+     __typeof__(*(ptr)) _n_ = (n);                                      \
+     (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,          \
+                                   (unsigned long)_n_, sizeof(*(ptr))); \
+  })
+
+#endif  /* __KERNEL__ */
+
 /*
  * Memory barrier.
  *
index 9a02879b235db410cb6d3e465b080eee1daaba5d..f0a9b44d3eb5068c1c70b14520d25c4f5226974b 100644 (file)
@@ -348,16 +348,6 @@ extern unsigned long find_ecache_flush_span(unsigned long size);
 struct vm_area_struct;
 extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t);
 
-/* Make a non-present pseudo-TTE. */
-static inline pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space)
-{
-       pte_t pte;
-       pte_val(pte) = (((page) | pgprot_val(prot) | _PAGE_E) &
-                       ~(unsigned long)_PAGE_CACHE);
-       pte_val(pte) |= (((unsigned long)space) << 32);
-       return pte;
-}
-
 /* Encode and de-code a swap entry */
 #define __swp_type(entry)      (((entry).val >> PAGE_SHIFT) & 0xffUL)
 #define __swp_offset(entry)    ((entry).val >> (PAGE_SHIFT + 8UL))
index e7d0593bb5766c908c906aa9528541512187b266..b203ea82a0a8b8db8e13613d15eca2d764b900bf 100644 (file)
@@ -7,7 +7,6 @@
 #define LINUX_ATMDEV_H
 
 
-#include <linux/config.h>
 #include <linux/atmapi.h>
 #include <linux/atm.h>
 #include <linux/atmioc.h>
@@ -210,6 +209,7 @@ struct atm_cirange {
 
 #ifdef __KERNEL__
 
+#include <linux/config.h>
 #include <linux/wait.h> /* wait_queue_head_t */
 #include <linux/time.h> /* struct timeval */
 #include <linux/net.h>
@@ -274,7 +274,7 @@ enum {
 
 
 enum {
-       ATM_DF_CLOSE,           /* close device when last VCC is closed */
+       ATM_DF_REMOVED,         /* device was removed from atm_devs list */
 };
 
 
@@ -415,7 +415,6 @@ struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops,
     int number,unsigned long *flags); /* number == -1: pick first available */
 struct atm_dev *atm_dev_lookup(int number);
 void atm_dev_deregister(struct atm_dev *dev);
-void shutdown_atm_dev(struct atm_dev *dev);
 void vcc_insert_socket(struct sock *sk);
 
 
@@ -457,18 +456,19 @@ static inline void atm_dev_hold(struct atm_dev *dev)
 
 static inline void atm_dev_put(struct atm_dev *dev)
 {
-       atomic_dec(&dev->refcnt);
-
-       if ((atomic_read(&dev->refcnt) == 1) &&
-           test_bit(ATM_DF_CLOSE,&dev->flags))
-               shutdown_atm_dev(dev);
+       if (atomic_dec_and_test(&dev->refcnt)) {
+               BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags));
+               if (dev->ops->dev_close)
+                       dev->ops->dev_close(dev);
+               kfree(dev);
+       }
 }
 
 
 int atm_charge(struct atm_vcc *vcc,int truesize);
 struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size,
     gfp_t gfp_flags);
-int atm_pcr_goal(struct atm_trafprm *tp);
+int atm_pcr_goal(const struct atm_trafprm *tp);
 
 void vcc_release_async(struct atm_vcc *vcc, int reply);
 
index 70ab5631738084935a1ef5cad40a2131f4d776c0..c948f678e04efd548c92c3eaa8b3a6412effd26a 100644 (file)
@@ -86,12 +86,12 @@ struct proc_event {
                        pid_t process_pid;
                        pid_t process_tgid;
                        union {
-                               uid_t ruid; /* current->uid */
-                               gid_t rgid; /* current->gid */
+                               __u32 ruid; /* task uid */
+                               __u32 rgid; /* task gid */
                        } r;
                        union {
-                               uid_t euid;
-                               gid_t egid;
+                               __u32 euid;
+                               __u32 egid;
                        } e;
                } id;
 
index 43c44530ef9dc02297c6a27e8478c80e7cbf5c79..0ed1d4853c69814530920c14b9c2bb6cee445b92 100644 (file)
@@ -65,10 +65,9 @@ extern struct sysdev_class cpu_sysdev_class;
 
 #ifdef CONFIG_HOTPLUG_CPU
 /* Stop CPUs going up and down. */
-extern struct semaphore cpucontrol;
-#define lock_cpu_hotplug()     down(&cpucontrol)
-#define unlock_cpu_hotplug()   up(&cpucontrol)
-#define lock_cpu_hotplug_interruptible() down_interruptible(&cpucontrol)
+extern void lock_cpu_hotplug(void);
+extern void unlock_cpu_hotplug(void);
+extern int lock_cpu_hotplug_interruptible(void);
 #define hotcpu_notifier(fn, pri) {                             \
        static struct notifier_block fn##_nb =                  \
                { .notifier_call = fn, .priority = pri };       \
index 1543daaa9c5ed962ca5e43b3df6add58cacd38d9..ef3b5632e63a2d835e46e09520326c96dbb974b3 100644 (file)
 #define I2C_DRIVERID_SAA7127   72      /* saa7124 video encoder        */
 #define I2C_DRIVERID_SAA711X   73      /* saa711x video encoders       */
 #define I2C_DRIVERID_AKITAIOEXP        74      /* IO Expander on Sharp SL-C1000 */
+#define I2C_DRIVERID_I2C_IR    75      /* I2C InfraRed on Video boards */
 
 #define I2C_DRIVERID_EXP0      0xF0    /* experimental use id's        */
 #define I2C_DRIVERID_EXP1      0xF1
index 9a424383e6c60064fdb76ae8b0c7895351da69a0..dc4081b6f161e3f697c3280bbf9547aed9bfbea1 100644 (file)
@@ -85,7 +85,6 @@ struct notifier_block;
 extern int register_memory_notifier(struct notifier_block *nb);
 extern void unregister_memory_notifier(struct notifier_block *nb);
 
-extern struct sysdev_class memory_sysdev_class;
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
 #define hotplug_memory_notifier(fn, pri) {                     \
index f0cdfd18db55b7edfe3af313dbf4cd9bcca22f70..29f02d8513f649fc74c3fcd3be1ade57fd4cf466 100644 (file)
@@ -145,7 +145,7 @@ extern unsigned int kobjsize(const void *objp);
 #define VM_GROWSDOWN   0x00000100      /* general info on the segment */
 #define VM_GROWSUP     0x00000200
 #define VM_SHM         0x00000000      /* Means nothing: delete it later */
-#define VM_UNPAGED     0x00000400      /* Pages managed without map count */
+#define VM_PFNMAP      0x00000400      /* Page-ranges managed without "struct page", just pure PFN */
 #define VM_DENYWRITE   0x00000800      /* ETXTBSY on write attempts.. */
 
 #define VM_EXECUTABLE  0x00001000
@@ -163,6 +163,7 @@ extern unsigned int kobjsize(const void *objp);
 #define VM_HUGETLB     0x00400000      /* Huge TLB Page VM */
 #define VM_NONLINEAR   0x00800000      /* Is non-linear (remap_file_pages) */
 #define VM_MAPPED_COPY 0x01000000      /* T if mapped copy of data (nommu mmap) */
+#define VM_INCOMPLETE  0x02000000      /* Strange partial PFN mapping marker */
 
 #ifndef VM_STACK_DEFAULT_FLAGS         /* arch can override this */
 #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
@@ -664,6 +665,7 @@ struct zap_details {
        unsigned long truncate_count;           /* Compare vm_truncate_count */
 };
 
+struct page *vm_normal_page(struct vm_area_struct *, unsigned long, pte_t);
 unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address,
                unsigned long size, struct zap_details *);
 unsigned long unmap_vmas(struct mmu_gather **tlb,
@@ -740,6 +742,8 @@ struct shrinker;
 extern struct shrinker *set_shrinker(int, shrinker_t);
 extern void remove_shrinker(struct shrinker *shrinker);
 
+extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl));
+
 int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address);
 int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address);
 int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address);
@@ -952,8 +956,9 @@ struct page *vmalloc_to_page(void *addr);
 unsigned long vmalloc_to_pfn(void *addr);
 int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
                        unsigned long pfn, unsigned long size, pgprot_t);
+int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *);
 
-struct page *follow_page(struct mm_struct *, unsigned long address,
+struct page *follow_page(struct vm_area_struct *, unsigned long address,
                        unsigned int foll_flags);
 #define FOLL_WRITE     0x01    /* check pte is writable */
 #define FOLL_TOUCH     0x02    /* mark page accessed */
index f819cae92266aa2fdd889d7bbe9b6480828d9680..a14dc306545b86f2f353d4ab2022523264109a51 100644 (file)
@@ -63,7 +63,7 @@
   /* class 5 */
 #define MMC_ERASE_GROUP_START    35   /* ac   [31:0] data addr   R1  */
 #define MMC_ERASE_GROUP_END      36   /* ac   [31:0] data addr   R1  */
-#define MMC_ERASE                37   /* ac                      R1b */
+#define MMC_ERASE                38   /* ac                      R1b */
 
   /* class 9 */
 #define MMC_FAST_IO              39   /* ac   <Complex>          R4  */
@@ -74,7 +74,7 @@
 
   /* class 8 */
 #define MMC_APP_CMD              55   /* ac   [31:16] RCA        R1  */
-#define MMC_GEN_CMD              56   /* adtc [0] RD/WR          R1b */
+#define MMC_GEN_CMD              56   /* adtc [0] RD/WR          R1  */
 
 /* SD commands                           type  argument     response */
   /* class 8 */
index 3c9ea4b7adda50b85c52dd335cd56191ac5b541c..23a5689103417141c34d505d2f40b4083b6bbf5a 100644 (file)
@@ -1,7 +1,7 @@
 
 /* Common Flash Interface structures
  * See http://support.intel.com/design/flash/technote/index.htm
- * $Id: cfi.h,v 1.56 2005/11/07 11:14:54 gleixner Exp $
+ * $Id: cfi.h,v 1.57 2005/11/15 23:28:17 tpoynor Exp $
  */
 
 #ifndef __MTD_CFI_H__
@@ -426,6 +426,22 @@ static inline uint8_t cfi_read_query(struct map_info *map, uint32_t addr)
        }
 }
 
+static inline uint16_t cfi_read_query16(struct map_info *map, uint32_t addr)
+{
+       map_word val = map_read(map, addr);
+
+       if (map_bankwidth_is_1(map)) {
+               return val.x[0] & 0xff;
+       } else if (map_bankwidth_is_2(map)) {
+               return cfi16_to_cpu(val.x[0]);
+       } else {
+               /* No point in a 64-bit byteswap since that would just be
+                  swapping the responses from different chips, and we are
+                  only interested in one chip (a representative sample) */
+               return cfi32_to_cpu(val.x[0]);
+       }
+}
+
 static inline void cfi_udelay(int us)
 {
        if (us >= 1000) {
index 35b30e6c8cf8c7b0b4fb4bd09c11b154a45c6ba6..33261f1d22395fba7d9a54a45efcaff12493336d 100644 (file)
@@ -89,7 +89,7 @@ static inline void page_dup_rmap(struct page *page)
 /*
  * Called from mm/vmscan.c to handle paging out
  */
-int page_referenced(struct page *, int is_locked, int ignore_token);
+int page_referenced(struct page *, int is_locked);
 int try_to_unmap(struct page *);
 
 /*
@@ -109,7 +109,7 @@ unsigned long page_address_in_vma(struct page *, struct vm_area_struct *);
 #define anon_vma_prepare(vma)  (0)
 #define anon_vma_link(vma)     do {} while (0)
 
-#define page_referenced(page,l,i) TestClearPageReferenced(page)
+#define page_referenced(page,l) TestClearPageReferenced(page)
 #define try_to_unmap(page)     SWAP_FAIL
 
 #endif /* CONFIG_MMU */
index 2038bd27b0413c74bcb66290adc3cfe33b5c0fd3..b0ad6f30679eac4cd128f924bd8b1010b4c75be1 100644 (file)
@@ -908,7 +908,6 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)
 #define PF_SYNCWRITE   0x00200000      /* I am doing a sync write */
 #define PF_BORROWED_MM 0x00400000      /* I am a kthread doing use_mm */
 #define PF_RANDOMIZE   0x00800000      /* randomize virtual address space */
-#define PF_HOTPLUG_CPU 0x01000000      /* Currently performing CPU hotplug */
 
 /*
  * Only the _current_ task can read/write to tsk->flags, but other
index a3ac92b19acac8267ff5ec922e1bdfccd2b9ca06..e3710d7e260aa6d31b6d5f46f811ca49f3c65b86 100644 (file)
 
 #define PORT_IP3106    70
 
+/* Hilscher netx */
+#define PORT_NETX      71
+
 #ifdef __KERNEL__
 
 #include <linux/config.h>
index 20c975642cab4c7f17e1cd9c8b2a6b9a2938aa03..508668f840b6a072998ce931bfc492a68c83f473 100644 (file)
@@ -239,6 +239,11 @@ static inline void put_swap_token(struct mm_struct *mm)
                __put_swap_token(mm);
 }
 
+static inline void disable_swap_token(void)
+{
+       put_swap_token(swap_token_mm);
+}
+
 #else /* CONFIG_SWAP */
 
 #define total_swap_pages                       0
@@ -283,6 +288,7 @@ static inline swp_entry_t get_swap_page(void)
 #define put_swap_token(x) do { } while(0)
 #define grab_swap_token()  do { } while(0)
 #define has_swap_token(x) 0
+#define disable_swap_token() do { } while(0)
 
 #endif /* CONFIG_SWAP */
 #endif /* __KERNEL__*/
index e2035c7da09480551a93555ab8cd36524a8982d7..e9fc1a7854970aaccf6eb8252cbd3914c41bdfd9 100644 (file)
@@ -4,12 +4,15 @@
 struct tveeprom {
        u32 has_radio;
        u32 has_ir;     /* 0: no IR, 1: IR present, 2: unknown */
+       u32 has_MAC_address; /* 0: no MAC, 1: MAC present, 2: unknown */
 
        u32 tuner_type;
        u32 tuner_formats;
+       u32 tuner_hauppauge_model;
 
        u32 tuner2_type;
        u32 tuner2_formats;
+       u32 tuner2_hauppauge_model;
 
        u32 digitizer;
        u32 digitizer_formats;
@@ -21,6 +24,7 @@ struct tveeprom {
        u32 revision;
        u32 serial_number;
        char rev_str[5];
+       u8 MAC_address[6];
 };
 
 void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
index d61ba88f34e57b90edae90342ed1db59ebfbb59c..e882c6babf414854a53b615229e49005d3cc4d75 100644 (file)
 #include <asm/semaphore.h>
 
 /* This protects CPUs going up and down... */
-DECLARE_MUTEX(cpucontrol);
-EXPORT_SYMBOL_GPL(cpucontrol);
+static DECLARE_MUTEX(cpucontrol);
 
 static struct notifier_block *cpu_chain;
 
-/*
- * Used to check by callers if they need to acquire the cpucontrol
- * or not to protect a cpu from being removed. Its sometimes required to
- * call these functions both for normal operations, and in response to
- * a cpu being added/removed. If the context of the call is in the same
- * thread context as a CPU hotplug thread, we dont need to take the lock
- * since its already protected
- * check drivers/cpufreq/cpufreq.c for its usage - Ashok Raj
- */
+#ifdef CONFIG_HOTPLUG_CPU
+static struct task_struct *lock_cpu_hotplug_owner;
+static int lock_cpu_hotplug_depth;
 
-int current_in_cpu_hotplug(void)
+static int __lock_cpu_hotplug(int interruptible)
 {
-       return (current->flags & PF_HOTPLUG_CPU);
+       int ret = 0;
+
+       if (lock_cpu_hotplug_owner != current) {
+               if (interruptible)
+                       ret = down_interruptible(&cpucontrol);
+               else
+                       down(&cpucontrol);
+       }
+
+       /*
+        * Set only if we succeed in locking
+        */
+       if (!ret) {
+               lock_cpu_hotplug_depth++;
+               lock_cpu_hotplug_owner = current;
+       }
+
+       return ret;
 }
 
-EXPORT_SYMBOL_GPL(current_in_cpu_hotplug);
+void lock_cpu_hotplug(void)
+{
+       __lock_cpu_hotplug(0);
+}
+EXPORT_SYMBOL_GPL(lock_cpu_hotplug);
 
+void unlock_cpu_hotplug(void)
+{
+       if (--lock_cpu_hotplug_depth == 0) {
+               lock_cpu_hotplug_owner = NULL;
+               up(&cpucontrol);
+       }
+}
+EXPORT_SYMBOL_GPL(unlock_cpu_hotplug);
+
+int lock_cpu_hotplug_interruptible(void)
+{
+       return __lock_cpu_hotplug(1);
+}
+EXPORT_SYMBOL_GPL(lock_cpu_hotplug_interruptible);
+#endif /* CONFIG_HOTPLUG_CPU */
 
 /* Need to know about CPUs going up/down? */
 int register_cpu_notifier(struct notifier_block *nb)
 {
        int ret;
 
-       if ((ret = down_interruptible(&cpucontrol)) != 0)
+       if ((ret = lock_cpu_hotplug_interruptible()) != 0)
                return ret;
        ret = notifier_chain_register(&cpu_chain, nb);
-       up(&cpucontrol);
+       unlock_cpu_hotplug();
        return ret;
 }
 EXPORT_SYMBOL(register_cpu_notifier);
 
 void unregister_cpu_notifier(struct notifier_block *nb)
 {
-       down(&cpucontrol);
+       lock_cpu_hotplug();
        notifier_chain_unregister(&cpu_chain, nb);
-       up(&cpucontrol);
+       unlock_cpu_hotplug();
 }
 EXPORT_SYMBOL(unregister_cpu_notifier);
 
@@ -112,13 +141,6 @@ int cpu_down(unsigned int cpu)
                goto out;
        }
 
-       /*
-        * Leave a trace in current->flags indicating we are already in
-        * process of performing CPU hotplug. Callers can check if cpucontrol
-        * is already acquired by current thread, and if so not cause
-        * a dead lock by not acquiring the lock
-        */
-       current->flags |= PF_HOTPLUG_CPU;
        err = notifier_call_chain(&cpu_chain, CPU_DOWN_PREPARE,
                                                (void *)(long)cpu);
        if (err == NOTIFY_BAD) {
@@ -171,7 +193,6 @@ out_thread:
 out_allowed:
        set_cpus_allowed(current, old_allowed);
 out:
-       current->flags &= ~PF_HOTPLUG_CPU;
        unlock_cpu_hotplug();
        return err;
 }
@@ -182,7 +203,7 @@ int __devinit cpu_up(unsigned int cpu)
        int ret;
        void *hcpu = (void *)(long)cpu;
 
-       if ((ret = down_interruptible(&cpucontrol)) != 0)
+       if ((ret = lock_cpu_hotplug_interruptible()) != 0)
                return ret;
 
        if (cpu_online(cpu) || !cpu_present(cpu)) {
@@ -190,11 +211,6 @@ int __devinit cpu_up(unsigned int cpu)
                goto out;
        }
 
-       /*
-        * Leave a trace in current->flags indicating we are already in
-        * process of performing CPU hotplug.
-        */
-       current->flags |= PF_HOTPLUG_CPU;
        ret = notifier_call_chain(&cpu_chain, CPU_UP_PREPARE, hcpu);
        if (ret == NOTIFY_BAD) {
                printk("%s: attempt to bring up CPU %u failed\n",
@@ -217,7 +233,6 @@ out_notify:
        if (ret != 0)
                notifier_call_chain(&cpu_chain, CPU_UP_CANCELED, hcpu);
 out:
-       current->flags &= ~PF_HOTPLUG_CPU;
-       up(&cpucontrol);
+       unlock_cpu_hotplug();
        return ret;
 }
index 1c1cf8dc396be6ddebca4c663a9eb234d56cb0cc..fb8572a4229743baef22241dbab6ae8356f633c7 100644 (file)
@@ -1124,8 +1124,6 @@ static task_t *copy_process(unsigned long clone_flags,
        if (unlikely(p->ptrace & PT_PTRACED))
                __ptrace_link(p, current->parent);
 
-       cpuset_fork(p);
-
        attach_pid(p, PIDTYPE_PID, p->pid);
        attach_pid(p, PIDTYPE_TGID, p->tgid);
        if (thread_group_leader(p)) {
@@ -1135,13 +1133,14 @@ static task_t *copy_process(unsigned long clone_flags,
                        __get_cpu_var(process_counts)++;
        }
 
-       proc_fork_connector(p);
        if (!current->signal->tty && p->signal->tty)
                p->signal->tty = NULL;
 
        nr_threads++;
        total_forks++;
        write_unlock_irq(&tasklist_lock);
+       proc_fork_connector(p);
+       cpuset_fork(p);
        retval = 0;
 
 fork_out:
index 84af54c39e1b0c31ff32854b45cbb15a512a4ba5..cae4f572899714369bcd8d5d18dad16f84d690a4 100644 (file)
@@ -36,7 +36,7 @@ timespec_to_sample(clockid_t which_clock, const struct timespec *tp)
        union cpu_time_count ret;
        ret.sched = 0;          /* high half always zero when .cpu used */
        if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) {
-               ret.sched = tp->tv_sec * NSEC_PER_SEC + tp->tv_nsec;
+               ret.sched = (unsigned long long)tp->tv_sec * NSEC_PER_SEC + tp->tv_nsec;
        } else {
                ret.cpu = timespec_to_cputime(tp);
        }
index 6ee2cad530e8971f4ad69da2f94d96455039fc5e..d253f3ae2fa5743d9c003c38468f1c4c823193e0 100644 (file)
@@ -24,7 +24,7 @@
 
 DECLARE_MUTEX(pm_sem);
 
-struct pm_ops * pm_ops = NULL;
+struct pm_ops *pm_ops;
 suspend_disk_method_t pm_disk_mode = PM_DISK_SHUTDOWN;
 
 /**
@@ -151,6 +151,18 @@ static char *pm_states[PM_SUSPEND_MAX] = {
 #endif
 };
 
+static inline int valid_state(suspend_state_t state)
+{
+       /* Suspend-to-disk does not really need low-level support.
+        * It can work with reboot if needed. */
+       if (state == PM_SUSPEND_DISK)
+               return 1;
+
+       if (pm_ops && pm_ops->valid && !pm_ops->valid(state))
+               return 0;
+       return 1;
+}
+
 
 /**
  *     enter_state - Do common work of entering low-power state.
@@ -167,7 +179,7 @@ static int enter_state(suspend_state_t state)
 {
        int error;
 
-       if (pm_ops && pm_ops->valid && !pm_ops->valid(state))
+       if (!valid_state(state))
                return -ENODEV;
        if (down_trylock(&pm_sem))
                return -EBUSY;
@@ -238,9 +250,8 @@ static ssize_t state_show(struct subsystem * subsys, char * buf)
        char * s = buf;
 
        for (i = 0; i < PM_SUSPEND_MAX; i++) {
-               if (pm_states[i] && pm_ops && (!pm_ops->valid
-                       ||(pm_ops->valid && pm_ops->valid(i))))
-                       s += sprintf(s,"%s ",pm_states[i]);
+               if (pm_states[i] && valid_state(i))
+                       s += sprintf(s,"%s ", pm_states[i]);
        }
        s += sprintf(s,"\n");
        return (s - buf);
index 17ee7e5a34516f7485250b7a7ef94546907f9b39..656476eedb1bfe9a4de0286d7dd35aad8023c8d1 100644 (file)
@@ -241,7 +241,8 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
                if (write) {
                        copy_to_user_page(vma, page, addr,
                                          maddr + offset, buf, bytes);
-                       set_page_dirty_lock(page);
+                       if (!PageCompound(page))
+                               set_page_dirty_lock(page);
                } else {
                        copy_from_user_page(vma, page, addr,
                                            buf, maddr + offset, bytes);
index 42df83d7fad21d7176efdfef13282ef693f3c6ba..2bd5aee1c7369af14c8f8ba71a9715ad6f03346b 100644 (file)
@@ -102,7 +102,7 @@ int fastcall queue_work(struct workqueue_struct *wq, struct work_struct *work)
 
        if (!test_and_set_bit(0, &work->pending)) {
                if (unlikely(is_single_threaded(wq)))
-                       cpu = 0;
+                       cpu = any_online_cpu(cpu_online_map);
                BUG_ON(!list_empty(&work->entry));
                __queue_work(per_cpu_ptr(wq->cpu_wq, cpu), work);
                ret = 1;
@@ -118,7 +118,7 @@ static void delayed_work_timer_fn(unsigned long __data)
        int cpu = smp_processor_id();
 
        if (unlikely(is_single_threaded(wq)))
-               cpu = 0;
+               cpu = any_online_cpu(cpu_online_map);
 
        __queue_work(per_cpu_ptr(wq->cpu_wq, cpu), work);
 }
@@ -266,8 +266,8 @@ void fastcall flush_workqueue(struct workqueue_struct *wq)
        might_sleep();
 
        if (is_single_threaded(wq)) {
-               /* Always use cpu 0's area. */
-               flush_cpu_workqueue(per_cpu_ptr(wq->cpu_wq, 0));
+               /* Always use first cpu's area. */
+               flush_cpu_workqueue(per_cpu_ptr(wq->cpu_wq, any_online_cpu(cpu_online_map)));
        } else {
                int cpu;
 
@@ -320,7 +320,7 @@ struct workqueue_struct *__create_workqueue(const char *name,
        lock_cpu_hotplug();
        if (singlethread) {
                INIT_LIST_HEAD(&wq->list);
-               p = create_workqueue_thread(wq, 0);
+               p = create_workqueue_thread(wq, any_online_cpu(cpu_online_map));
                if (!p)
                        destroy = 1;
                else
@@ -374,7 +374,7 @@ void destroy_workqueue(struct workqueue_struct *wq)
        /* We don't need the distraction of CPUs appearing and vanishing. */
        lock_cpu_hotplug();
        if (is_single_threaded(wq))
-               cleanup_workqueue_thread(wq, 0);
+               cleanup_workqueue_thread(wq, any_online_cpu(cpu_online_map));
        else {
                for_each_online_cpu(cpu)
                        cleanup_workqueue_thread(wq, cpu);
index d6d30d2e71664629304bc4795b533fbb89914e11..9ce0a6a3b85ac49d2f160dda9c732ec65698f078 100644 (file)
@@ -95,12 +95,10 @@ unsigned long gen_pool_alloc(struct gen_pool *poolp, int size)
        if (size > max_chunk_size)
                return 0;
 
-       i = 0;
-
        size = max(size, 1 << ALLOC_MIN_SHIFT);
-       s = roundup_pow_of_two(size);
-
-       j = i;
+       i = fls(size - 1);
+       s = 1 << i;
+       j = i -= ALLOC_MIN_SHIFT;
 
        spin_lock_irqsave(&poolp->lock, flags);
        while (!h[j].next) {
@@ -153,10 +151,10 @@ void gen_pool_free(struct gen_pool *poolp, unsigned long ptr, int size)
        if (size > max_chunk_size)
                return;
 
-       i = 0;
-
        size = max(size, 1 << ALLOC_MIN_SHIFT);
-       s = roundup_pow_of_two(size);
+       i = fls(size - 1);
+       s = 1 << i;
+       i -= ALLOC_MIN_SHIFT;
 
        a = ptr;
 
index 007cbad9331e208f37713148707843aeae105079..9f381e58bf4471faf6ba14bad1d93a118f12ffbc 100644 (file)
@@ -27,24 +27,20 @@ static int zap_pte(struct mm_struct *mm, struct vm_area_struct *vma,
        struct page *page = NULL;
 
        if (pte_present(pte)) {
-               unsigned long pfn = pte_pfn(pte);
-               flush_cache_page(vma, addr, pfn);
+               flush_cache_page(vma, addr, pte_pfn(pte));
                pte = ptep_clear_flush(vma, addr, ptep);
-               if (unlikely(!pfn_valid(pfn))) {
-                       print_bad_pte(vma, pte, addr);
-                       goto out;
+               page = vm_normal_page(vma, addr, pte);
+               if (page) {
+                       if (pte_dirty(pte))
+                               set_page_dirty(page);
+                       page_remove_rmap(page);
+                       page_cache_release(page);
                }
-               page = pfn_to_page(pfn);
-               if (pte_dirty(pte))
-                       set_page_dirty(page);
-               page_remove_rmap(page);
-               page_cache_release(page);
        } else {
                if (!pte_file(pte))
                        free_swap_and_cache(pte_to_swp_entry(pte));
                pte_clear(mm, addr, ptep);
        }
-out:
        return !!page;
 }
 
@@ -59,22 +55,10 @@ int install_page(struct mm_struct *mm, struct vm_area_struct *vma,
        pgoff_t size;
        int err = -ENOMEM;
        pte_t *pte;
-       pmd_t *pmd;
-       pud_t *pud;
-       pgd_t *pgd;
        pte_t pte_val;
        spinlock_t *ptl;
 
-       BUG_ON(vma->vm_flags & VM_UNPAGED);
-
-       pgd = pgd_offset(mm, addr);
-       pud = pud_alloc(mm, pgd, addr);
-       if (!pud)
-               goto out;
-       pmd = pmd_alloc(mm, pud, addr);
-       if (!pmd)
-               goto out;
-       pte = pte_alloc_map_lock(mm, pmd, addr, &ptl);
+       pte = get_locked_pte(mm, addr, &ptl);
        if (!pte)
                goto out;
 
@@ -116,22 +100,10 @@ int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma,
 {
        int err = -ENOMEM;
        pte_t *pte;
-       pmd_t *pmd;
-       pud_t *pud;
-       pgd_t *pgd;
        pte_t pte_val;
        spinlock_t *ptl;
 
-       BUG_ON(vma->vm_flags & VM_UNPAGED);
-
-       pgd = pgd_offset(mm, addr);
-       pud = pud_alloc(mm, pgd, addr);
-       if (!pud)
-               goto out;
-       pmd = pmd_alloc(mm, pud, addr);
-       if (!pmd)
-               goto out;
-       pte = pte_alloc_map_lock(mm, pmd, addr, &ptl);
+       pte = get_locked_pte(mm, addr, &ptl);
        if (!pte)
                goto out;
 
index 328a3bcce5271ee969e231962354159227da9eba..2b7cf0400a217cd453641eaf097d1291125e1431 100644 (file)
@@ -126,7 +126,7 @@ static long madvise_dontneed(struct vm_area_struct * vma,
                             unsigned long start, unsigned long end)
 {
        *prev = vma;
-       if (vma->vm_flags & (VM_LOCKED|VM_HUGETLB|VM_UNPAGED))
+       if (vma->vm_flags & (VM_LOCKED|VM_HUGETLB|VM_PFNMAP))
                return -EINVAL;
 
        if (unlikely(vma->vm_flags & VM_NONLINEAR)) {
index d1f46f4e4c8a8594ffa649f15dd03d6cd6eda944..4b4fc3a7ea4858a1bba7e2aa60f1ace8fdbd4e0c 100644 (file)
@@ -333,9 +333,9 @@ static inline void add_mm_rss(struct mm_struct *mm, int file_rss, int anon_rss)
 }
 
 /*
- * This function is called to print an error when a pte in a
- * !VM_UNPAGED region is found pointing to an invalid pfn (which
- * is an error.
+ * This function is called to print an error when a bad pte
+ * is found. For example, we might have a PFN-mapped pte in
+ * a region that doesn't allow it.
  *
  * The calling function must still handle the error.
  */
@@ -350,19 +350,56 @@ void print_bad_pte(struct vm_area_struct *vma, pte_t pte, unsigned long vaddr)
 }
 
 /*
- * page_is_anon applies strict checks for an anonymous page belonging to
- * this vma at this address.  It is used on VM_UNPAGED vmas, which are
- * usually populated with shared originals (which must not be counted),
- * but occasionally contain private COWed copies (when !VM_SHARED, or
- * perhaps via ptrace when VM_SHARED).  An mmap of /dev/mem might window
- * free pages, pages from other processes, or from other parts of this:
- * it's tricky, but try not to be deceived by foreign anonymous pages.
+ * This function gets the "struct page" associated with a pte.
+ *
+ * NOTE! Some mappings do not have "struct pages". A raw PFN mapping
+ * will have each page table entry just pointing to a raw page frame
+ * number, and as far as the VM layer is concerned, those do not have
+ * pages associated with them - even if the PFN might point to memory
+ * that otherwise is perfectly fine and has a "struct page".
+ *
+ * The way we recognize those mappings is through the rules set up
+ * by "remap_pfn_range()": the vma will have the VM_PFNMAP bit set,
+ * and the vm_pgoff will point to the first PFN mapped: thus every
+ * page that is a raw mapping will always honor the rule
+ *
+ *     pfn_of_page == vma->vm_pgoff + ((addr - vma->vm_start) >> PAGE_SHIFT)
+ *
+ * and if that isn't true, the page has been COW'ed (in which case it
+ * _does_ have a "struct page" associated with it even if it is in a
+ * VM_PFNMAP range).
  */
-static inline int page_is_anon(struct page *page,
-                       struct vm_area_struct *vma, unsigned long addr)
+struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
 {
-       return page && PageAnon(page) && page_mapped(page) &&
-               page_address_in_vma(page, vma) == addr;
+       unsigned long pfn = pte_pfn(pte);
+
+       if (vma->vm_flags & VM_PFNMAP) {
+               unsigned long off = (addr - vma->vm_start) >> PAGE_SHIFT;
+               if (pfn == vma->vm_pgoff + off)
+                       return NULL;
+       }
+
+       /*
+        * Add some anal sanity checks for now. Eventually,
+        * we should just do "return pfn_to_page(pfn)", but
+        * in the meantime we check that we get a valid pfn,
+        * and that the resulting page looks ok.
+        *
+        * Remove this test eventually!
+        */
+       if (unlikely(!pfn_valid(pfn))) {
+               print_bad_pte(vma, pte, addr);
+               return NULL;
+       }
+
+       /*
+        * NOTE! We still have PageReserved() pages in the page 
+        * tables. 
+        *
+        * The PAGE_ZERO() pages and various VDSO mappings can
+        * cause them to exist.
+        */
+       return pfn_to_page(pfn);
 }
 
 /*
@@ -379,7 +416,6 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
        unsigned long vm_flags = vma->vm_flags;
        pte_t pte = *src_pte;
        struct page *page;
-       unsigned long pfn;
 
        /* pte contains position in swap or file, so copy. */
        if (unlikely(!pte_present(pte))) {
@@ -397,22 +433,6 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
                goto out_set_pte;
        }
 
-       pfn = pte_pfn(pte);
-       page = pfn_valid(pfn)? pfn_to_page(pfn): NULL;
-
-       if (unlikely(vm_flags & VM_UNPAGED))
-               if (!page_is_anon(page, vma, addr))
-                       goto out_set_pte;
-
-       /*
-        * If the pte points outside of valid memory but
-        * the region is not VM_UNPAGED, we have a problem.
-        */
-       if (unlikely(!page)) {
-               print_bad_pte(vma, pte, addr);
-               goto out_set_pte; /* try to do something sane */
-       }
-
        /*
         * If it's a COW mapping, write protect it both
         * in the parent and the child
@@ -429,9 +449,13 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
        if (vm_flags & VM_SHARED)
                pte = pte_mkclean(pte);
        pte = pte_mkold(pte);
-       get_page(page);
-       page_dup_rmap(page);
-       rss[!!PageAnon(page)]++;
+
+       page = vm_normal_page(vma, addr, pte);
+       if (page) {
+               get_page(page);
+               page_dup_rmap(page);
+               rss[!!PageAnon(page)]++;
+       }
 
 out_set_pte:
        set_pte_at(dst_mm, addr, dst_pte, pte);
@@ -543,7 +567,7 @@ int copy_page_range(struct mm_struct *dst_mm, struct mm_struct *src_mm,
         * readonly mappings. The tradeoff is that copy_page_range is more
         * efficient than faulting.
         */
-       if (!(vma->vm_flags & (VM_HUGETLB|VM_NONLINEAR|VM_UNPAGED))) {
+       if (!(vma->vm_flags & (VM_HUGETLB|VM_NONLINEAR|VM_PFNMAP))) {
                if (!vma->anon_vma)
                        return 0;
        }
@@ -584,19 +608,10 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
                }
                if (pte_present(ptent)) {
                        struct page *page;
-                       unsigned long pfn;
 
                        (*zap_work) -= PAGE_SIZE;
 
-                       pfn = pte_pfn(ptent);
-                       page = pfn_valid(pfn)? pfn_to_page(pfn): NULL;
-
-                       if (unlikely(vma->vm_flags & VM_UNPAGED)) {
-                               if (!page_is_anon(page, vma, addr))
-                                       page = NULL;
-                       } else if (unlikely(!page))
-                               print_bad_pte(vma, ptent, addr);
-
+                       page = vm_normal_page(vma, addr, ptent);
                        if (unlikely(details) && page) {
                                /*
                                 * unmap_shared_mapping_pages() wants to
@@ -852,7 +867,7 @@ unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address,
 /*
  * Do a quick page-table lookup for a single page.
  */
-struct page *follow_page(struct mm_struct *mm, unsigned long address,
+struct page *follow_page(struct vm_area_struct *vma, unsigned long address,
                        unsigned int flags)
 {
        pgd_t *pgd;
@@ -860,8 +875,8 @@ struct page *follow_page(struct mm_struct *mm, unsigned long address,
        pmd_t *pmd;
        pte_t *ptep, pte;
        spinlock_t *ptl;
-       unsigned long pfn;
        struct page *page;
+       struct mm_struct *mm = vma->vm_mm;
 
        page = follow_huge_addr(mm, address, flags & FOLL_WRITE);
        if (!IS_ERR(page)) {
@@ -897,11 +912,10 @@ struct page *follow_page(struct mm_struct *mm, unsigned long address,
                goto unlock;
        if ((flags & FOLL_WRITE) && !pte_write(pte))
                goto unlock;
-       pfn = pte_pfn(pte);
-       if (!pfn_valid(pfn))
+       page = vm_normal_page(vma, address, pte);
+       if (unlikely(!page))
                goto unlock;
 
-       page = pfn_to_page(pfn);
        if (flags & FOLL_GET)
                get_page(page);
        if (flags & FOLL_TOUCH) {
@@ -974,8 +988,10 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
                                return i ? : -EFAULT;
                        }
                        if (pages) {
-                               pages[i] = pte_page(*pte);
-                               get_page(pages[i]);
+                               struct page *page = vm_normal_page(gate_vma, start, *pte);
+                               pages[i] = page;
+                               if (page)
+                                       get_page(page);
                        }
                        pte_unmap(pte);
                        if (vmas)
@@ -1010,7 +1026,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
                                foll_flags |= FOLL_WRITE;
 
                        cond_resched();
-                       while (!(page = follow_page(mm, start, foll_flags))) {
+                       while (!(page = follow_page(vma, start, foll_flags))) {
                                int ret;
                                ret = __handle_mm_fault(mm, vma, start,
                                                foll_flags & FOLL_WRITE);
@@ -1130,6 +1146,129 @@ int zeromap_page_range(struct vm_area_struct *vma,
        return err;
 }
 
+pte_t * fastcall get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)
+{
+       pgd_t * pgd = pgd_offset(mm, addr);
+       pud_t * pud = pud_alloc(mm, pgd, addr);
+       if (pud) {
+               pmd_t * pmd = pmd_alloc(mm, pud, addr);
+               if (pmd)
+                       return pte_alloc_map_lock(mm, pmd, addr, ptl);
+       }
+       return NULL;
+}
+
+/*
+ * This is the old fallback for page remapping.
+ *
+ * For historical reasons, it only allows reserved pages. Only
+ * old drivers should use this, and they needed to mark their
+ * pages reserved for the old functions anyway.
+ */
+static int insert_page(struct mm_struct *mm, unsigned long addr, struct page *page, pgprot_t prot)
+{
+       int retval;
+       pte_t *pte;
+       spinlock_t *ptl;  
+
+       retval = -EINVAL;
+       if (PageAnon(page))
+               goto out;
+       retval = -ENOMEM;
+       flush_dcache_page(page);
+       pte = get_locked_pte(mm, addr, &ptl);
+       if (!pte)
+               goto out;
+       retval = -EBUSY;
+       if (!pte_none(*pte))
+               goto out_unlock;
+
+       /* Ok, finally just insert the thing.. */
+       get_page(page);
+       inc_mm_counter(mm, file_rss);
+       page_add_file_rmap(page);
+       set_pte_at(mm, addr, pte, mk_pte(page, prot));
+
+       retval = 0;
+out_unlock:
+       pte_unmap_unlock(pte, ptl);
+out:
+       return retval;
+}
+
+/*
+ * This allows drivers to insert individual pages they've allocated
+ * into a user vma.
+ *
+ * The page has to be a nice clean _individual_ kernel allocation.
+ * If you allocate a compound page, you need to have marked it as
+ * such (__GFP_COMP), or manually just split the page up yourself
+ * (which is mainly an issue of doing "set_page_count(page, 1)" for
+ * each sub-page, and then freeing them one by one when you free
+ * them rather than freeing it as a compound page).
+ *
+ * NOTE! Traditionally this was done with "remap_pfn_range()" which
+ * took an arbitrary page protection parameter. This doesn't allow
+ * that. Your vma protection will have to be set up correctly, which
+ * means that if you want a shared writable mapping, you'd better
+ * ask for a shared writable mapping!
+ *
+ * The page does not need to be reserved.
+ */
+int vm_insert_page(struct vm_area_struct *vma, unsigned long addr, struct page *page)
+{
+       if (addr < vma->vm_start || addr >= vma->vm_end)
+               return -EFAULT;
+       if (!page_count(page))
+               return -EINVAL;
+       return insert_page(vma->vm_mm, addr, page, vma->vm_page_prot);
+}
+EXPORT_SYMBOL_GPL(vm_insert_page);
+
+/*
+ * Somebody does a pfn remapping that doesn't actually work as a vma.
+ *
+ * Do it as individual pages instead, and warn about it. It's bad form,
+ * and very inefficient.
+ */
+static int incomplete_pfn_remap(struct vm_area_struct *vma,
+               unsigned long start, unsigned long end,
+               unsigned long pfn, pgprot_t prot)
+{
+       static int warn = 10;
+       struct page *page;
+       int retval;
+
+       if (!(vma->vm_flags & VM_INCOMPLETE)) {
+               if (warn) {
+                       warn--;
+                       printk("%s does an incomplete pfn remapping", current->comm);
+                       dump_stack();
+               }
+       }
+       vma->vm_flags |= VM_INCOMPLETE | VM_IO | VM_RESERVED;
+
+       if (start < vma->vm_start || end > vma->vm_end)
+               return -EINVAL;
+
+       if (!pfn_valid(pfn))
+               return -EINVAL;
+
+       page = pfn_to_page(pfn);
+       if (!PageReserved(page))
+               return -EINVAL;
+
+       retval = 0;
+       while (start < end) {
+               retval = insert_page(vma->vm_mm, start, page, prot);
+               if (retval < 0)
+                       break;
+               start += PAGE_SIZE;
+               page++;
+       }
+       return retval;
+}
+
 /*
  * maps a range of physical memory into the requested pages. the old
  * mappings are removed. any references to nonexistent pages results
@@ -1204,6 +1343,9 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
        struct mm_struct *mm = vma->vm_mm;
        int err;
 
+       if (addr != vma->vm_start || end != vma->vm_end)
+               return incomplete_pfn_remap(vma, addr, end, pfn, prot);
+
        /*
         * Physically remapped pages are special. Tell the
         * rest of the world about it:
@@ -1214,11 +1356,12 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
         *      in 2.6 the LRU scan won't even find its pages, so this
         *      flag means no more than count its pages in reserved_vm,
         *      and omit it from core dump, even when VM_IO turned off.
-        *   VM_UNPAGED tells the core MM not to "manage" these pages
-         *     (e.g. refcount, mapcount, try to swap them out): in
-        *      particular, zap_pte_range does not try to free them.
+        *   VM_PFNMAP tells the core MM that the base pages are just
+        *      raw PFN mappings, and do not have a "struct page" associated
+        *      with them.
         */
-       vma->vm_flags |= VM_IO | VM_RESERVED | VM_UNPAGED;
+       vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
+       vma->vm_pgoff = pfn;
 
        BUG_ON(addr >= end);
        pfn -= addr >> PAGE_SHIFT;
@@ -1273,6 +1416,33 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
        return pte;
 }
 
+static inline void cow_user_page(struct page *dst, struct page *src, unsigned long va)
+{
+       /*
+        * If the source page was a PFN mapping, we don't have
+        * a "struct page" for it. We do a best-effort copy by
+        * just copying from the original user address. If that
+        * fails, we just zero-fill it. Live with it.
+        */
+       if (unlikely(!src)) {
+               void *kaddr = kmap_atomic(dst, KM_USER0);
+               void __user *uaddr = (void __user *)(va & PAGE_MASK);
+
+               /*
+                * This really shouldn't fail, because the page is there
+                * in the page tables. But it might just be unreadable,
+                * in which case we just give up and fill the result with
+                * zeroes.
+                */
+               if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE))
+                       memset(kaddr, 0, PAGE_SIZE);
+               kunmap_atomic(kaddr, KM_USER0);
+               return;
+               
+       }
+       copy_user_highpage(dst, src, va);
+}
+
 /*
  * This routine handles present pages, when users try to write
  * to a shared page. It is done by copying the page to a new address
@@ -1295,35 +1465,19 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
                unsigned long address, pte_t *page_table, pmd_t *pmd,
                spinlock_t *ptl, pte_t orig_pte)
 {
-       struct page *old_page, *src_page, *new_page;
-       unsigned long pfn = pte_pfn(orig_pte);
+       struct page *old_page, *new_page;
        pte_t entry;
        int ret = VM_FAULT_MINOR;
 
-       if (unlikely(!pfn_valid(pfn))) {
-               /*
-                * Page table corrupted: show pte and kill process.
-                * Or it's an attempt to COW an out-of-map VM_UNPAGED
-                * entry, which copy_user_highpage does not support.
-                */
-               print_bad_pte(vma, orig_pte, address);
-               ret = VM_FAULT_OOM;
-               goto unlock;
-       }
-       old_page = pfn_to_page(pfn);
-       src_page = old_page;
-
-       if (unlikely(vma->vm_flags & VM_UNPAGED))
-               if (!page_is_anon(old_page, vma, address)) {
-                       old_page = NULL;
-                       goto gotten;
-               }
+       old_page = vm_normal_page(vma, address, orig_pte);
+       if (!old_page)
+               goto gotten;
 
        if (PageAnon(old_page) && !TestSetPageLocked(old_page)) {
                int reuse = can_share_swap_page(old_page);
                unlock_page(old_page);
                if (reuse) {
-                       flush_cache_page(vma, address, pfn);
+                       flush_cache_page(vma, address, pte_pfn(orig_pte));
                        entry = pte_mkyoung(orig_pte);
                        entry = maybe_mkwrite(pte_mkdirty(entry), vma);
                        ptep_set_access_flags(vma, address, page_table, entry, 1);
@@ -1343,7 +1497,7 @@ gotten:
 
        if (unlikely(anon_vma_prepare(vma)))
                goto oom;
-       if (src_page == ZERO_PAGE(address)) {
+       if (old_page == ZERO_PAGE(address)) {
                new_page = alloc_zeroed_user_highpage(vma, address);
                if (!new_page)
                        goto oom;
@@ -1351,7 +1505,7 @@ gotten:
                new_page = alloc_page_vma(GFP_HIGHUSER, vma, address);
                if (!new_page)
                        goto oom;
-               copy_user_highpage(new_page, src_page, address);
+               cow_user_page(new_page, old_page, address);
        }
 
        /*
@@ -1367,7 +1521,7 @@ gotten:
                        }
                } else
                        inc_mm_counter(mm, anon_rss);
-               flush_cache_page(vma, address, pfn);
+               flush_cache_page(vma, address, pte_pfn(orig_pte));
                entry = mk_pte(new_page, vma->vm_page_prot);
                entry = maybe_mkwrite(pte_mkdirty(entry), vma);
                ptep_establish(vma, address, page_table, entry);
@@ -1812,16 +1966,7 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
        spinlock_t *ptl;
        pte_t entry;
 
-       /*
-        * A VM_UNPAGED vma will normally be filled with present ptes
-        * by remap_pfn_range, and never arrive here; but it might have
-        * holes, or if !VM_DONTEXPAND, mremap might have expanded it.
-        * It's weird enough handling anon pages in unpaged vmas, we do
-        * not want to worry about ZERO_PAGEs too (it may or may not
-        * matter if their counts wrap): just give them anon pages.
-        */
-
-       if (write_access || (vma->vm_flags & VM_UNPAGED)) {
+       if (write_access) {
                /* Allocate our own private page. */
                pte_unmap(page_table);
 
@@ -1896,7 +2041,7 @@ static int do_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
        int anon = 0;
 
        pte_unmap(page_table);
-       BUG_ON(vma->vm_flags & VM_UNPAGED);
+       BUG_ON(vma->vm_flags & VM_PFNMAP);
 
        if (vma->vm_file) {
                mapping = vma->vm_file->f_mapping;
@@ -2149,6 +2294,12 @@ int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
        spin_unlock(&mm->page_table_lock);
        return 0;
 }
+#else
+/* Workaround for gcc 2.96 */
+int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
+{
+       return 0;
+}
 #endif /* __PAGETABLE_PUD_FOLDED */
 
 #ifndef __PAGETABLE_PMD_FOLDED
@@ -2177,6 +2328,12 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
        spin_unlock(&mm->page_table_lock);
        return 0;
 }
+#else
+/* Workaround for gcc 2.96 */
+int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
+{
+       return 0;
+}
 #endif /* __PAGETABLE_PMD_FOLDED */
 
 int make_pages_present(unsigned long addr, unsigned long end)
index 5609a31bdf229e51300474764c320d0404767fe5..bec88c81244e0d4f9541f4098f5f8c8409ba455b 100644 (file)
@@ -189,17 +189,15 @@ static int check_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
 
        orig_pte = pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
        do {
-               unsigned long pfn;
+               struct page *page;
                unsigned int nid;
 
                if (!pte_present(*pte))
                        continue;
-               pfn = pte_pfn(*pte);
-               if (!pfn_valid(pfn)) {
-                       print_bad_pte(vma, *pte, addr);
+               page = vm_normal_page(vma, addr, *pte);
+               if (!page)
                        continue;
-               }
-               nid = pfn_to_nid(pfn);
+               nid = page_to_nid(page);
                if (!node_isset(nid, *nodes))
                        break;
        } while (pte++, addr += PAGE_SIZE, addr != end);
@@ -269,8 +267,6 @@ check_range(struct mm_struct *mm, unsigned long start, unsigned long end,
        first = find_vma(mm, start);
        if (!first)
                return ERR_PTR(-EFAULT);
-       if (first->vm_flags & VM_UNPAGED)
-               return ERR_PTR(-EACCES);
        prev = NULL;
        for (vma = first; vma && vma->vm_start < end; vma = vma->vm_next) {
                if (!vma->vm_next && vma->vm_end < end)
index b3f4caf3010b3ae998e456ba99faeff335623e07..1b5b6f662dcfd40e3c27122a58c2c1a17e93e295 100644 (file)
@@ -27,7 +27,6 @@ static void msync_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
 again:
        pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
        do {
-               unsigned long pfn;
                struct page *page;
 
                if (progress >= 64) {
@@ -40,13 +39,9 @@ again:
                        continue;
                if (!pte_maybe_dirty(*pte))
                        continue;
-               pfn = pte_pfn(*pte);
-               if (unlikely(!pfn_valid(pfn))) {
-                       print_bad_pte(vma, *pte, addr);
+               page = vm_normal_page(vma, addr, *pte);
+               if (!page)
                        continue;
-               }
-               page = pfn_to_page(pfn);
-
                if (ptep_clear_flush_dirty(vma, addr, pte) ||
                    page_test_and_clear_dirty(page))
                        set_page_dirty(page);
@@ -97,9 +92,8 @@ static void msync_page_range(struct vm_area_struct *vma,
        /* For hugepages we can't go walking the page table normally,
         * but that's ok, hugetlbfs is memory based, so we don't need
         * to do anything more on an msync().
-        * Can't do anything with VM_UNPAGED regions either.
         */
-       if (vma->vm_flags & (VM_HUGETLB|VM_UNPAGED))
+       if (vma->vm_flags & VM_HUGETLB)
                return;
 
        BUG_ON(addr >= end);
index 6deb6ab3d6ada1a27cfcbc65303fa1403d498ac0..c1196812876be984920118078fd817dccbf771f8 100644 (file)
@@ -1045,7 +1045,7 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
 
 EXPORT_SYMBOL(find_vma);
 
-struct page *follow_page(struct mm_struct *mm, unsigned long address,
+struct page *follow_page(struct vm_area_struct *vma, unsigned long address,
                        unsigned int foll_flags)
 {
        return NULL;
index 1731236dec352ffd9dc3e21e11cc9ce27bd9bde2..b257720edfc83ce4d025159d05c82354b9dd220b 100644 (file)
@@ -773,9 +773,12 @@ again:
 }
 
 #define ALLOC_NO_WATERMARKS    0x01 /* don't check watermarks at all */
-#define ALLOC_HARDER           0x02 /* try to alloc harder */
-#define ALLOC_HIGH             0x04 /* __GFP_HIGH set */
-#define ALLOC_CPUSET           0x08 /* check for correct cpuset */
+#define ALLOC_WMARK_MIN                0x02 /* use pages_min watermark */
+#define ALLOC_WMARK_LOW                0x04 /* use pages_low watermark */
+#define ALLOC_WMARK_HIGH       0x08 /* use pages_high watermark */
+#define ALLOC_HARDER           0x10 /* try to alloc harder */
+#define ALLOC_HIGH             0x20 /* __GFP_HIGH set */
+#define ALLOC_CPUSET           0x40 /* check for correct cpuset */
 
 /*
  * Return 1 if free pages are above 'mark'. This takes into account the order
@@ -830,7 +833,14 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order,
                        continue;
 
                if (!(alloc_flags & ALLOC_NO_WATERMARKS)) {
-                       if (!zone_watermark_ok(*z, order, (*z)->pages_low,
+                       unsigned long mark;
+                       if (alloc_flags & ALLOC_WMARK_MIN)
+                               mark = (*z)->pages_min;
+                       else if (alloc_flags & ALLOC_WMARK_LOW)
+                               mark = (*z)->pages_low;
+                       else
+                               mark = (*z)->pages_high;
+                       if (!zone_watermark_ok(*z, order, mark,
                                    classzone_idx, alloc_flags))
                                continue;
                }
@@ -871,7 +881,7 @@ restart:
        }
 
        page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order,
-                               zonelist, ALLOC_CPUSET);
+                               zonelist, ALLOC_WMARK_LOW|ALLOC_CPUSET);
        if (page)
                goto got_pg;
 
@@ -888,7 +898,7 @@ restart:
         * cannot run direct reclaim, or if the caller has realtime scheduling
         * policy.
         */
-       alloc_flags = 0;
+       alloc_flags = ALLOC_WMARK_MIN;
        if ((unlikely(rt_task(p)) && !in_interrupt()) || !wait)
                alloc_flags |= ALLOC_HARDER;
        if (gfp_mask & __GFP_HIGH)
@@ -959,7 +969,7 @@ rebalance:
                 * under heavy pressure.
                 */
                page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order,
-                                               zonelist, ALLOC_CPUSET);
+                               zonelist, ALLOC_WMARK_HIGH|ALLOC_CPUSET);
                if (page)
                        goto got_pg;
 
index 2e034a0b89abff5ccc2bc310255f18c6e5ac165c..f853c6def15915602e484afdd3a741099d543887 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -226,8 +226,6 @@ vma_address(struct page *page, struct vm_area_struct *vma)
 /*
  * At what user virtual address is page expected in vma? checking that the
  * page matches the vma: currently only used on anon pages, by unuse_vma;
- * and by extraordinary checks on anon pages in VM_UNPAGED vmas, taking
- * care that an mmap of /dev/mem might window free and foreign pages.
  */
 unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma)
 {
@@ -292,7 +290,7 @@ pte_t *page_check_address(struct page *page, struct mm_struct *mm,
  * repeatedly from either page_referenced_anon or page_referenced_file.
  */
 static int page_referenced_one(struct page *page,
-       struct vm_area_struct *vma, unsigned int *mapcount, int ignore_token)
+       struct vm_area_struct *vma, unsigned int *mapcount)
 {
        struct mm_struct *mm = vma->vm_mm;
        unsigned long address;
@@ -313,7 +311,7 @@ static int page_referenced_one(struct page *page,
 
        /* Pretend the page is referenced if the task has the
           swap token and is in the middle of a page fault. */
-       if (mm != current->mm && !ignore_token && has_swap_token(mm) &&
+       if (mm != current->mm && has_swap_token(mm) &&
                        rwsem_is_locked(&mm->mmap_sem))
                referenced++;
 
@@ -323,7 +321,7 @@ out:
        return referenced;
 }
 
-static int page_referenced_anon(struct page *page, int ignore_token)
+static int page_referenced_anon(struct page *page)
 {
        unsigned int mapcount;
        struct anon_vma *anon_vma;
@@ -336,8 +334,7 @@ static int page_referenced_anon(struct page *page, int ignore_token)
 
        mapcount = page_mapcount(page);
        list_for_each_entry(vma, &anon_vma->head, anon_vma_node) {
-               referenced += page_referenced_one(page, vma, &mapcount,
-                                                       ignore_token);
+               referenced += page_referenced_one(page, vma, &mapcount);
                if (!mapcount)
                        break;
        }
@@ -356,7 +353,7 @@ static int page_referenced_anon(struct page *page, int ignore_token)
  *
  * This function is only called from page_referenced for object-based pages.
  */
-static int page_referenced_file(struct page *page, int ignore_token)
+static int page_referenced_file(struct page *page)
 {
        unsigned int mapcount;
        struct address_space *mapping = page->mapping;
@@ -394,8 +391,7 @@ static int page_referenced_file(struct page *page, int ignore_token)
                        referenced++;
                        break;
                }
-               referenced += page_referenced_one(page, vma, &mapcount,
-                                                       ignore_token);
+               referenced += page_referenced_one(page, vma, &mapcount);
                if (!mapcount)
                        break;
        }
@@ -412,13 +408,10 @@ static int page_referenced_file(struct page *page, int ignore_token)
  * Quick test_and_clear_referenced for all mappings to a page,
  * returns the number of ptes which referenced the page.
  */
-int page_referenced(struct page *page, int is_locked, int ignore_token)
+int page_referenced(struct page *page, int is_locked)
 {
        int referenced = 0;
 
-       if (!swap_token_default_timeout)
-               ignore_token = 1;
-
        if (page_test_and_clear_young(page))
                referenced++;
 
@@ -427,15 +420,14 @@ int page_referenced(struct page *page, int is_locked, int ignore_token)
 
        if (page_mapped(page) && page->mapping) {
                if (PageAnon(page))
-                       referenced += page_referenced_anon(page, ignore_token);
+                       referenced += page_referenced_anon(page);
                else if (is_locked)
-                       referenced += page_referenced_file(page, ignore_token);
+                       referenced += page_referenced_file(page);
                else if (TestSetPageLocked(page))
                        referenced++;
                else {
                        if (page->mapping)
-                               referenced += page_referenced_file(page,
-                                                               ignore_token);
+                               referenced += page_referenced_file(page);
                        unlock_page(page);
                }
        }
@@ -614,7 +606,6 @@ static void try_to_unmap_cluster(unsigned long cursor,
        struct page *page;
        unsigned long address;
        unsigned long end;
-       unsigned long pfn;
 
        address = (vma->vm_start + cursor) & CLUSTER_MASK;
        end = address + CLUSTER_SIZE;
@@ -643,21 +634,14 @@ static void try_to_unmap_cluster(unsigned long cursor,
        for (; address < end; pte++, address += PAGE_SIZE) {
                if (!pte_present(*pte))
                        continue;
-
-               pfn = pte_pfn(*pte);
-               if (unlikely(!pfn_valid(pfn))) {
-                       print_bad_pte(vma, *pte, address);
-                       continue;
-               }
-
-               page = pfn_to_page(pfn);
-               BUG_ON(PageAnon(page));
+               page = vm_normal_page(vma, address, *pte);
+               BUG_ON(!page || PageAnon(page));
 
                if (ptep_clear_flush_young(vma, address, pte))
                        continue;
 
                /* Nuke the page table entry. */
-               flush_cache_page(vma, address, pfn);
+               flush_cache_page(vma, address, pte_pfn(*pte));
                pteval = ptep_clear_flush(vma, address, pte);
 
                /* If nonlinear, store the file page offset in the pte. */
index eff3c18c33a10ba802b9743c514a83ccd04aaa09..f4c560b4a2b79862340fe7457af001f8e6141715 100644 (file)
@@ -57,14 +57,17 @@ void grab_swap_token(void)
        /* We have the token. Let others know we still need it. */
        if (has_swap_token(current->mm)) {
                current->mm->recent_pagein = 1;
+               if (unlikely(!swap_token_default_timeout))
+                       disable_swap_token();
                return;
        }
 
        if (time_after(jiffies, swap_token_check)) {
 
-               /* Can't get swapout protection if we exceed our RSS limit. */
-               // if (current->mm->rss > current->mm->rlimit_rss)
-               //      return;
+               if (!swap_token_default_timeout) {
+                       swap_token_check = jiffies + SWAP_TOKEN_CHECK_INTERVAL;
+                       return;
+               }
 
                /* ... or if we recently held the token. */
                if (time_before(jiffies, current->mm->swap_token_time))
@@ -95,6 +98,7 @@ void __put_swap_token(struct mm_struct *mm)
 {
        spin_lock(&swap_token_lock);
        if (likely(mm == swap_token_mm)) {
+               mm->swap_token_time = jiffies + SWAP_TOKEN_CHECK_INTERVAL;
                swap_token_mm = &init_mm;
                swap_token_check = jiffies;
        }
index 28130541270f5ad35b3e18ac878b349c61c6e01f..b0cd81c32de6ca0f601bb1be3c12764beb37a8af 100644 (file)
@@ -201,13 +201,25 @@ static int shrink_slab(unsigned long scanned, gfp_t gfp_mask,
        list_for_each_entry(shrinker, &shrinker_list, list) {
                unsigned long long delta;
                unsigned long total_scan;
+               unsigned long max_pass = (*shrinker->shrinker)(0, gfp_mask);
 
                delta = (4 * scanned) / shrinker->seeks;
-               delta *= (*shrinker->shrinker)(0, gfp_mask);
+               delta *= max_pass;
                do_div(delta, lru_pages + 1);
                shrinker->nr += delta;
-               if (shrinker->nr < 0)
-                       shrinker->nr = LONG_MAX;        /* It wrapped! */
+               if (shrinker->nr < 0) {
+                       printk(KERN_ERR "%s: nr=%ld\n",
+                                       __FUNCTION__, shrinker->nr);
+                       shrinker->nr = max_pass;
+               }
+
+               /*
+                * Avoid risking looping forever due to too large nr value:
+                * never try to free more than twice the estimate number of
+                * freeable entries.
+                */
+               if (shrinker->nr > max_pass * 2)
+                       shrinker->nr = max_pass * 2;
 
                total_scan = shrinker->nr;
                shrinker->nr = 0;
@@ -407,7 +419,7 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc)
                if (PageWriteback(page))
                        goto keep_locked;
 
-               referenced = page_referenced(page, 1, sc->priority <= 0);
+               referenced = page_referenced(page, 1);
                /* In active use or really unfreeable?  Activate it. */
                if (referenced && page_mapping_inuse(page))
                        goto activate_locked;
@@ -756,7 +768,7 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc)
                if (page_mapped(page)) {
                        if (!reclaim_mapped ||
                            (total_swap_pages == 0 && PageAnon(page)) ||
-                           page_referenced(page, 0, sc->priority <= 0)) {
+                           page_referenced(page, 0)) {
                                list_add(&page->lru, &l_active);
                                continue;
                        }
@@ -960,6 +972,8 @@ int try_to_free_pages(struct zone **zones, gfp_t gfp_mask)
                sc.nr_reclaimed = 0;
                sc.priority = priority;
                sc.swap_cluster_max = SWAP_CLUSTER_MAX;
+               if (!priority)
+                       disable_swap_token();
                shrink_caches(zones, &sc);
                shrink_slab(sc.nr_scanned, gfp_mask, lru_pages);
                if (reclaim_state) {
@@ -1056,6 +1070,10 @@ loop_again:
                int end_zone = 0;       /* Inclusive.  0 = ZONE_DMA */
                unsigned long lru_pages = 0;
 
+               /* The swap token gets in the way of swapout... */
+               if (!priority)
+                       disable_swap_token();
+
                all_zones_ok = 1;
 
                if (nr_pages == 0) {
@@ -1360,6 +1378,7 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
        sc.nr_reclaimed = 0;
        /* scan at the highest priority */
        sc.priority = 0;
+       disable_swap_token();
 
        if (nr_pages > SWAP_CLUSTER_MAX)
                sc.swap_cluster_max = nr_pages;
index 223c7ad5bd0f7a3d524e73667c11aa35edae6733..02cc7e71efea24e36fbe78a5e43ee6e7122f3b64 100644 (file)
@@ -74,11 +74,14 @@ struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size,
  */
 
 
-int atm_pcr_goal(struct atm_trafprm *tp)
+int atm_pcr_goal(const struct atm_trafprm *tp)
 {
-       if (tp->pcr && tp->pcr != ATM_MAX_PCR) return -tp->pcr;
-       if (tp->min_pcr && !tp->pcr) return tp->min_pcr;
-       if (tp->max_pcr != ATM_MAX_PCR) return -tp->max_pcr;
+       if (tp->pcr && tp->pcr != ATM_MAX_PCR)
+               return -tp->pcr;
+       if (tp->min_pcr && !tp->pcr)
+               return tp->min_pcr;
+       if (tp->max_pcr != ATM_MAX_PCR)
+               return -tp->max_pcr;
        return 0;
 }
 
index 63feea49fb139f6a0e96888c3f4f99c2325ac883..6656b111cc053de334c9885f0f6ccebe4cadd790 100644 (file)
@@ -221,6 +221,29 @@ void vcc_release_async(struct atm_vcc *vcc, int reply)
 EXPORT_SYMBOL(vcc_release_async);
 
 
+void atm_dev_release_vccs(struct atm_dev *dev)
+{
+       int i;
+
+       write_lock_irq(&vcc_sklist_lock);
+       for (i = 0; i < VCC_HTABLE_SIZE; i++) {
+               struct hlist_head *head = &vcc_hash[i];
+               struct hlist_node *node, *tmp;
+               struct sock *s;
+               struct atm_vcc *vcc;
+
+               sk_for_each_safe(s, node, tmp, head) {
+                       vcc = atm_sk(s);
+                       if (vcc->dev == dev) {
+                               vcc_release_async(vcc, -EPIPE);
+                               sk_del_node_init(s);
+                       }
+               }
+       }
+       write_unlock_irq(&vcc_sklist_lock);
+}
+
+
 static int adjust_tp(struct atm_trafprm *tp,unsigned char aal)
 {
        int max_sdu;
@@ -332,12 +355,13 @@ static int __vcc_connect(struct atm_vcc *vcc, struct atm_dev *dev, short vpi,
                return -EINVAL;
        if (vci > 0 && vci < ATM_NOT_RSV_VCI && !capable(CAP_NET_BIND_SERVICE))
                return -EPERM;
-       error = 0;
+       error = -ENODEV;
        if (!try_module_get(dev->ops->owner))
-               return -ENODEV;
+               return error;
        vcc->dev = dev;
        write_lock_irq(&vcc_sklist_lock);
-       if ((error = find_ci(vcc, &vpi, &vci))) {
+       if (test_bit(ATM_DF_REMOVED, &dev->flags) || 
+           (error = find_ci(vcc, &vpi, &vci))) {
                write_unlock_irq(&vcc_sklist_lock);
                goto fail_module_put;
        }
@@ -423,33 +447,23 @@ int vcc_connect(struct socket *sock, int itf, short vpi, int vci)
        if (vcc->qos.txtp.traffic_class == ATM_ANYCLASS ||
            vcc->qos.rxtp.traffic_class == ATM_ANYCLASS)
                return -EINVAL;
-       if (itf != ATM_ITF_ANY) {
-               dev = atm_dev_lookup(itf);
-               if (!dev)
-                       return -ENODEV;
-               error = __vcc_connect(vcc, dev, vpi, vci);
-               if (error) {
-                       atm_dev_put(dev);
-                       return error;
-               }
+       if (likely(itf != ATM_ITF_ANY)) {
+               dev = try_then_request_module(atm_dev_lookup(itf), "atm-device-%d", itf);
        } else {
-               struct list_head *p, *next;
-
                dev = NULL;
-               spin_lock(&atm_dev_lock);
-               list_for_each_safe(p, next, &atm_devs) {
-                       dev = list_entry(p, struct atm_dev, dev_list);
+               down(&atm_dev_mutex);
+               if (!list_empty(&atm_devs)) {
+                       dev = list_entry(atm_devs.next, struct atm_dev, dev_list);
                        atm_dev_hold(dev);
-                       spin_unlock(&atm_dev_lock);
-                       if (!__vcc_connect(vcc, dev, vpi, vci))
-                               break;
-                       atm_dev_put(dev);
-                       dev = NULL;
-                       spin_lock(&atm_dev_lock);
                }
-               spin_unlock(&atm_dev_lock);
-               if (!dev)
-                       return -ENODEV;
+               up(&atm_dev_mutex);
+       }
+       if (!dev)
+               return -ENODEV;
+       error = __vcc_connect(vcc, dev, vpi, vci);
+       if (error) {
+               atm_dev_put(dev);
+               return error;
        }
        if (vpi == ATM_VPI_UNSPEC || vci == ATM_VCI_UNSPEC)
                set_bit(ATM_VF_PARTIAL,&vcc->flags);
index e49ed41c0e337f4683ea0e58cb43b150e8248b29..4887c317cefe99365576c2812875dc730257aa13 100644 (file)
@@ -47,4 +47,6 @@ static inline void atm_proc_exit(void)
 /* SVC */
 int svc_change_qos(struct atm_vcc *vcc,struct atm_qos *qos);
 
+void atm_dev_release_vccs(struct atm_dev *dev);
+
 #endif
index 415d2615d475fa3c284d4a11cf565408d8c5c385..c8c459fcb0386a0e597f8b2d811a08b3055a0ef8 100644 (file)
@@ -25,7 +25,7 @@
 
 
 LIST_HEAD(atm_devs);
-DEFINE_SPINLOCK(atm_dev_lock);
+DECLARE_MUTEX(atm_dev_mutex);
 
 static struct atm_dev *__alloc_atm_dev(const char *type)
 {
@@ -52,7 +52,7 @@ static struct atm_dev *__atm_dev_lookup(int number)
 
        list_for_each(p, &atm_devs) {
                dev = list_entry(p, struct atm_dev, dev_list);
-               if ((dev->ops) && (dev->number == number)) {
+               if (dev->number == number) {
                        atm_dev_hold(dev);
                        return dev;
                }
@@ -64,12 +64,13 @@ struct atm_dev *atm_dev_lookup(int number)
 {
        struct atm_dev *dev;
 
-       spin_lock(&atm_dev_lock);
+       down(&atm_dev_mutex);
        dev = __atm_dev_lookup(number);
-       spin_unlock(&atm_dev_lock);
+       up(&atm_dev_mutex);
        return dev;
 }
 
+
 struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,
                                 int number, unsigned long *flags)
 {
@@ -81,11 +82,11 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,
                    type);
                return NULL;
        }
-       spin_lock(&atm_dev_lock);
+       down(&atm_dev_mutex);
        if (number != -1) {
                if ((inuse = __atm_dev_lookup(number))) {
                        atm_dev_put(inuse);
-                       spin_unlock(&atm_dev_lock);
+                       up(&atm_dev_mutex);
                        kfree(dev);
                        return NULL;
                }
@@ -105,19 +106,17 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,
                memset(&dev->flags, 0, sizeof(dev->flags));
        memset(&dev->stats, 0, sizeof(dev->stats));
        atomic_set(&dev->refcnt, 1);
-       list_add_tail(&dev->dev_list, &atm_devs);
-       spin_unlock(&atm_dev_lock);
 
        if (atm_proc_dev_register(dev) < 0) {
                printk(KERN_ERR "atm_dev_register: "
                       "atm_proc_dev_register failed for dev %s\n",
                       type);
-               spin_lock(&atm_dev_lock);
-               list_del(&dev->dev_list);
-               spin_unlock(&atm_dev_lock);
+               up(&atm_dev_mutex);
                kfree(dev);
                return NULL;
        }
+       list_add_tail(&dev->dev_list, &atm_devs);
+       up(&atm_dev_mutex);
 
        return dev;
 }
@@ -125,37 +124,22 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,
 
 void atm_dev_deregister(struct atm_dev *dev)
 {
-       unsigned long warning_time;
+       BUG_ON(test_bit(ATM_DF_REMOVED, &dev->flags));
+       set_bit(ATM_DF_REMOVED, &dev->flags);
+
+       /*
+        * if we remove current device from atm_devs list, new device 
+        * with same number can appear, such we need deregister proc, 
+        * release async all vccs and remove them from vccs list too
+        */
+       down(&atm_dev_mutex);
+       list_del(&dev->dev_list);
+       up(&atm_dev_mutex);
 
+       atm_dev_release_vccs(dev);
        atm_proc_dev_deregister(dev);
 
-       spin_lock(&atm_dev_lock);
-       list_del(&dev->dev_list);
-       spin_unlock(&atm_dev_lock);
-
-        warning_time = jiffies;
-        while (atomic_read(&dev->refcnt) != 1) {
-                msleep(250);
-                if ((jiffies - warning_time) > 10 * HZ) {
-                        printk(KERN_EMERG "atm_dev_deregister: waiting for "
-                               "dev %d to become free. Usage count = %d\n",
-                               dev->number, atomic_read(&dev->refcnt));
-                        warning_time = jiffies;
-                }
-        }
-
-       kfree(dev);
-}
-
-void shutdown_atm_dev(struct atm_dev *dev)
-{
-       if (atomic_read(&dev->refcnt) > 1) {
-               set_bit(ATM_DF_CLOSE, &dev->flags);
-               return;
-       }
-       if (dev->ops->dev_close)
-               dev->ops->dev_close(dev);
-       atm_dev_deregister(dev);
+       atm_dev_put(dev);
 }
 
 
@@ -211,16 +195,16 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg)
                                return -EFAULT;
                        if (get_user(len, &iobuf->length))
                                return -EFAULT;
-                       spin_lock(&atm_dev_lock);
+                       down(&atm_dev_mutex);
                        list_for_each(p, &atm_devs)
                                size += sizeof(int);
                        if (size > len) {
-                               spin_unlock(&atm_dev_lock);
+                               up(&atm_dev_mutex);
                                return -E2BIG;
                        }
                        tmp_buf = kmalloc(size, GFP_ATOMIC);
                        if (!tmp_buf) {
-                               spin_unlock(&atm_dev_lock);
+                               up(&atm_dev_mutex);
                                return -ENOMEM;
                        }
                        tmp_p = tmp_buf;
@@ -228,7 +212,7 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg)
                                dev = list_entry(p, struct atm_dev, dev_list);
                                *tmp_p++ = dev->number;
                        }
-                       spin_unlock(&atm_dev_lock);
+                       up(&atm_dev_mutex);
                        error = ((copy_to_user(buf, tmp_buf, size)) ||
                                        put_user(size, &iobuf->length))
                                                ? -EFAULT : 0;
@@ -245,7 +229,8 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg)
        if (get_user(number, &sioc->number))
                return -EFAULT;
 
-       if (!(dev = atm_dev_lookup(number)))
+       if (!(dev = try_then_request_module(atm_dev_lookup(number),
+                                           "atm-device-%d", number)))
                return -ENODEV;
        
        switch (cmd) {
@@ -414,13 +399,13 @@ static __inline__ void *dev_get_idx(loff_t left)
 
 void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos)
 {
-       spin_lock(&atm_dev_lock);
+       down(&atm_dev_mutex);
        return *pos ? dev_get_idx(*pos) : (void *) 1;
 }
 
 void atm_dev_seq_stop(struct seq_file *seq, void *v)
 {
-       spin_unlock(&atm_dev_lock);
+       up(&atm_dev_mutex);
 }
  
 void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
@@ -434,4 +419,3 @@ void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 EXPORT_SYMBOL(atm_dev_register);
 EXPORT_SYMBOL(atm_dev_deregister);
 EXPORT_SYMBOL(atm_dev_lookup);
-EXPORT_SYMBOL(shutdown_atm_dev);
index 12910619dbb6cdfed3cb5b56268769263125ad63..b7fb82a93b42951870a1e327b99b1f8a0f954391 100644 (file)
@@ -11,8 +11,7 @@
 
 
 extern struct list_head atm_devs;
-extern spinlock_t atm_dev_lock;
-
+extern struct semaphore atm_dev_mutex;
 
 int atm_dev_ioctl(unsigned int cmd, void __user *arg);
 
index 2a8c9afc3695d88a673e2f35cba900d0aa63c409..7ea0209cb1697ddd50bbf5a98b4cf8f89a5d484a 100644 (file)
@@ -975,7 +975,7 @@ static void fib_seq_stop(struct seq_file *seq, void *v)
 
 static unsigned fib_flag_trans(int type, u32 mask, struct fib_info *fi)
 {
-       static unsigned type2flags[RTN_MAX + 1] = {
+       static const unsigned type2flags[RTN_MAX + 1] = {
                [7] = RTF_REJECT, [8] = RTF_REJECT,
        };
        unsigned flags = type2flags[type];
index 186f20c4a45e06a65cfaee8cbfba41ab00dfbf00..6d2a6ac070e35d035a7401ca89cc8f8b53449743 100644 (file)
@@ -83,7 +83,7 @@ for (nhsel=0; nhsel < 1; nhsel++)
 #define endfor_nexthops(fi) }
 
 
-static struct 
+static const struct 
 {
        int     error;
        u8      scope;
index e3eceecd0496eeb752964ee276bdc2e0c79e4de3..92e23b2ad4d211c810341bc74389bc9ce32381cb 100644 (file)
@@ -220,7 +220,7 @@ struct icmp_control {
        short   error;          /* This ICMP is classed as an error message */
 };
 
-static struct icmp_control icmp_pointers[NR_ICMP_TYPES+1];
+static const struct icmp_control icmp_pointers[NR_ICMP_TYPES+1];
 
 /*
  *     The ICMP socket(s). This is the most convenient way to flow control
@@ -994,7 +994,7 @@ error:
 /*
  *     This table is the definition of how we handle ICMP.
  */
-static struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = {
+static const struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = {
        [ICMP_ECHOREPLY] = {
                .output_entry = ICMP_MIB_OUTECHOREPS,
                .input_entry = ICMP_MIB_INECHOREPS,
index 4e9c74b54b150b3cec895023b2489d104866c710..a4c347c3b8e3a169f9e1b37603ce02378cee1d55 100644 (file)
@@ -1217,7 +1217,7 @@ static int ipgre_tunnel_init(struct net_device *dev)
        return 0;
 }
 
-int __init ipgre_fb_tunnel_init(struct net_device *dev)
+static int __init ipgre_fb_tunnel_init(struct net_device *dev)
 {
        struct ip_tunnel *tunnel = (struct ip_tunnel*)dev->priv;
        struct iphdr *iph = &tunnel->parms.iph;
index 11c2f68254f0a8a04602222216a03578c0327d20..eba64e2bd397c2f219bb4c545a5704f5bf892630 100644 (file)
@@ -690,7 +690,7 @@ csum_page(struct page *page, int offset, int copy)
        return csum;
 }
 
-inline int ip_ufo_append_data(struct sock *sk,
+static inline int ip_ufo_append_data(struct sock *sk,
                        int getfrag(void *from, char *to, int offset, int len,
                               int odd, struct sk_buff *skb),
                        void *from, int length, int hh_len, int fragheaderlen,
index f828fa2eb7dea154ff534e342fc75cdf8217b1ba..2a3a8c59c6551f087e73d4007963055969fe8f7c 100644 (file)
@@ -771,7 +771,7 @@ static inline int todrop_entry(struct ip_vs_conn *cp)
         * The drop rate array needs tuning for real environments.
         * Called from timer bh only => no locking
         */
-       static char todrop_rate[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
+       static const char todrop_rate[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
        static char todrop_counter[9] = {0};
        int i;
 
index 2d66848e7aa06bb75df50aad715d6c45837535e7..9bdcf31b760eee5a35a0cba61c69f734b056f02c 100644 (file)
@@ -1909,7 +1909,7 @@ static int ip_vs_set_timeout(struct ip_vs_timeout_user *u)
 #define DAEMON_ARG_LEN         (sizeof(struct ip_vs_daemon_user))
 #define MAX_ARG_LEN            SVCDEST_ARG_LEN
 
-static unsigned char set_arglen[SET_CMDID(IP_VS_SO_SET_MAX)+1] = {
+static const unsigned char set_arglen[SET_CMDID(IP_VS_SO_SET_MAX)+1] = {
        [SET_CMDID(IP_VS_SO_SET_ADD)]           = SERVICE_ARG_LEN,
        [SET_CMDID(IP_VS_SO_SET_EDIT)]          = SERVICE_ARG_LEN,
        [SET_CMDID(IP_VS_SO_SET_DEL)]           = SERVICE_ARG_LEN,
@@ -2180,7 +2180,7 @@ __ip_vs_get_timeouts(struct ip_vs_timeout_user *u)
 #define GET_TIMEOUT_ARG_LEN    (sizeof(struct ip_vs_timeout_user))
 #define GET_DAEMON_ARG_LEN     (sizeof(struct ip_vs_daemon_user) * 2)
 
-static unsigned char get_arglen[GET_CMDID(IP_VS_SO_GET_MAX)+1] = {
+static const unsigned char get_arglen[GET_CMDID(IP_VS_SO_GET_MAX)+1] = {
        [GET_CMDID(IP_VS_SO_GET_VERSION)]       = 64,
        [GET_CMDID(IP_VS_SO_GET_INFO)]          = GET_INFO_ARG_LEN,
        [GET_CMDID(IP_VS_SO_GET_SERVICES)]      = GET_SERVICES_ARG_LEN,
index c19408973c091d12bb5d4e850c37af7aa3b64e37..0e878fd6215c16cd6b422c4e001d4dfefa7d0606 100644 (file)
@@ -251,7 +251,7 @@ tcp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp)
 #define TCP_DIR_OUTPUT         4
 #define TCP_DIR_INPUT_ONLY     8
 
-static int tcp_state_off[IP_VS_DIR_LAST] = {
+static const int tcp_state_off[IP_VS_DIR_LAST] = {
        [IP_VS_DIR_INPUT]               =       TCP_DIR_INPUT,
        [IP_VS_DIR_OUTPUT]              =       TCP_DIR_OUTPUT,
        [IP_VS_DIR_INPUT_ONLY]          =       TCP_DIR_INPUT_ONLY,
index fa3f914117ec20f66e18b27f92b2cc7e58e47d9a..e52847fa10f5d5ca61bf46107ae5212c25f541cc 100644 (file)
@@ -37,7 +37,7 @@ MODULE_LICENSE("GPL");
 module_param(master_timeout, int, 0600);
 MODULE_PARM_DESC(master_timeout, "timeout for the master connection");
 
-static char *conns[] = { "DATA ", "MESG ", "INDEX " };
+static const char *conns[] = { "DATA ", "MESG ", "INDEX " };
 
 /* This is slow, but it's simple. --RR */
 static char *amanda_buffer;
index 422ab68ee7fb62599cb410c0b8aac61bda4647d6..7a4ecddd597b4ea1760d7f936eb2a90fb0d3a2fb 100644 (file)
@@ -1354,7 +1354,7 @@ static void free_conntrack_hash(struct list_head *hash, int vmalloced,int size)
                           get_order(sizeof(struct list_head) * size));
 }
 
-void ip_conntrack_flush()
+void ip_conntrack_flush(void)
 {
        /* This makes sure all current packets have passed through
            netfilter framework.  Roll on, two-stage module
@@ -1408,7 +1408,7 @@ static struct list_head *alloc_hashtable(int size, int *vmalloced)
        return hash;
 }
 
-int set_hashsize(const char *val, struct kernel_param *kp)
+static int set_hashsize(const char *val, struct kernel_param *kp)
 {
        int i, bucket, hashsize, vmalloced;
        int old_vmalloced, old_size;
index 59e12b02b22ce82d31ae0c5769bdbce783ca5e24..68b173bcda602498a3b8572555e8a9638f33fd75 100644 (file)
@@ -55,7 +55,7 @@ static int try_rfc959(const char *, size_t, u_int32_t [], char);
 static int try_eprt(const char *, size_t, u_int32_t [], char);
 static int try_epsv_response(const char *, size_t, u_int32_t [], char);
 
-static struct ftp_search {
+static const struct ftp_search {
        enum ip_conntrack_dir dir;
        const char *pattern;
        size_t plen;
index 2dea1db14406a9a39b622dee4618b4401f4f86e6..d7c40421d0d17205fc1d6fcaba5eb0053f7c7477 100644 (file)
@@ -59,7 +59,7 @@ MODULE_PARM_DESC(max_dcc_channels, "max number of expected DCC channels per IRC
 module_param(dcc_timeout, int, 0400);
 MODULE_PARM_DESC(dcc_timeout, "timeout on for unestablished DCC channels");
 
-static char *dccprotos[] = { "SEND ", "CHAT ", "MOVE ", "TSEND ", "SCHAT " };
+static const char *dccprotos[] = { "SEND ", "CHAT ", "MOVE ", "TSEND ", "SCHAT " };
 #define MINMATCHLEN    5
 
 #if 0
index e4d6b268e8c4ec8abaaa68735839249a5668a590..5f9925db608ef3ab4255f266d0550aec421fc580 100644 (file)
@@ -51,7 +51,7 @@ static int icmp_invert_tuple(struct ip_conntrack_tuple *tuple,
                             const struct ip_conntrack_tuple *orig)
 {
        /* Add 1; spaces filled with 0. */
-       static u_int8_t invmap[]
+       static const u_int8_t invmap[]
                = { [ICMP_ECHO] = ICMP_ECHOREPLY + 1,
                    [ICMP_ECHOREPLY] = ICMP_ECHO + 1,
                    [ICMP_TIMESTAMP] = ICMP_TIMESTAMPREPLY + 1,
@@ -110,7 +110,7 @@ static int icmp_packet(struct ip_conntrack *ct,
        return NF_ACCEPT;
 }
 
-static u_int8_t valid_new[] = { 
+static const u_int8_t valid_new[] = { 
        [ICMP_ECHO] = 1,
        [ICMP_TIMESTAMP] = 1,
        [ICMP_INFO_REQUEST] = 1,
index 59a4a0111dd3fa9d91b2863a25069dbbfee56d8f..977fb59d4563361875826fec0817d92750af00da 100644 (file)
@@ -65,7 +65,7 @@ static unsigned long ip_ct_sctp_timeout_shutdown_sent     = 300 SECS / 1000;
 static unsigned long ip_ct_sctp_timeout_shutdown_recd     = 300 SECS / 1000;
 static unsigned long ip_ct_sctp_timeout_shutdown_ack_sent =   3 SECS;
 
-static unsigned long * sctp_timeouts[]
+static const unsigned long * sctp_timeouts[]
 = { NULL,                                  /* SCTP_CONNTRACK_NONE  */
     &ip_ct_sctp_timeout_closed,                   /* SCTP_CONNTRACK_CLOSED */
     &ip_ct_sctp_timeout_cookie_wait,       /* SCTP_CONNTRACK_COOKIE_WAIT */
@@ -118,7 +118,7 @@ cookie echoed to closed.
 */
 
 /* SCTP conntrack state transitions */
-static enum sctp_conntrack sctp_conntracks[2][9][SCTP_CONNTRACK_MAX] = {
+static const enum sctp_conntrack sctp_conntracks[2][9][SCTP_CONNTRACK_MAX] = {
        {
 /*     ORIGINAL        */
 /*                  sNO, sCL, sCW, sCE, sES, sSS, sSR, sSA */
index ee3b7d6c4d2efbb5c76012b0ed1e6a7fda26ef92..625981676776deea3994337863841bf29f262b2f 100644 (file)
@@ -99,7 +99,7 @@ unsigned long ip_ct_tcp_timeout_close =        10 SECS;
    to ~13-30min depending on RTO. */
 unsigned long ip_ct_tcp_timeout_max_retrans =     5 MINS;
  
-static unsigned long * tcp_timeouts[]
+static const unsigned long * tcp_timeouts[]
 = { NULL,                              /*      TCP_CONNTRACK_NONE */
     &ip_ct_tcp_timeout_syn_sent,       /*      TCP_CONNTRACK_SYN_SENT, */
     &ip_ct_tcp_timeout_syn_recv,       /*      TCP_CONNTRACK_SYN_RECV, */
@@ -170,7 +170,7 @@ enum tcp_bit_set {
  *     if they are invalid
  *     or we do not support the request (simultaneous open)
  */
-static enum tcp_conntrack tcp_conntracks[2][6][TCP_CONNTRACK_MAX] = {
+static const enum tcp_conntrack tcp_conntracks[2][6][TCP_CONNTRACK_MAX] = {
        {
 /* ORIGINAL */
 /*          sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI   */
@@ -817,7 +817,7 @@ void ip_conntrack_tcp_update(struct sk_buff *skb,
 #define        TH_CWR  0x80
 
 /* table of valid flag combinations - ECE and CWR are always valid */
-static u8 tcp_valid_flags[(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG) + 1] =
+static const u8 tcp_valid_flags[(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG) + 1] =
 {
        [TH_SYN]                        = 1,
        [TH_SYN|TH_ACK]                 = 1,
index 762f4d93936b93497a31c77415a77bc6b6b78568..c1a61462507fc5c5d38fd884b69a791d37a11ea7 100644 (file)
@@ -49,7 +49,7 @@ static unsigned int ip_nat_htable_size;
 static struct list_head *bysource;
 
 #define MAX_IP_NAT_PROTO 256
-struct ip_nat_protocol *ip_nat_protos[MAX_IP_NAT_PROTO];
+static struct ip_nat_protocol *ip_nat_protos[MAX_IP_NAT_PROTO];
 
 static inline struct ip_nat_protocol *
 __ip_nat_proto_find(u_int8_t protonum)
index 75c27e92f6abb521ac8f42ff28a2040177470503..45886c8475e84dbd25ab1da3eebb1a5562a20263 100644 (file)
@@ -1892,7 +1892,7 @@ static int ipt_get_matches(char *buffer, char **start, off_t offset, int length)
        return pos;
 }
 
-static struct { char *name; get_info_t *get_info; } ipt_proc_entry[] =
+static const struct { char *name; get_info_t *get_info; } ipt_proc_entry[] =
 { { "ip_tables_names", ipt_get_tables },
   { "ip_tables_targets", ipt_get_targets },
   { "ip_tables_matches", ipt_get_matches },
index 92ed050fac69bcce35424122c8a69c5d4ac5c48f..30be0f1dae370f6212de7955a972e87272854bef 100644 (file)
@@ -197,7 +197,7 @@ static void dump_packet(const struct nf_loginfo *info,
        }
        case IPPROTO_ICMP: {
                struct icmphdr _icmph, *ich;
-               static size_t required_len[NR_ICMP_TYPES+1]
+               static const size_t required_len[NR_ICMP_TYPES+1]
                        = { [ICMP_ECHOREPLY] = 4,
                            [ICMP_DEST_UNREACH]
                            = 8 + sizeof(struct iphdr),
@@ -351,7 +351,7 @@ static void dump_packet(const struct nf_loginfo *info,
        /* maxlen = 230+   91  + 230 + 252 = 803 */
 }
 
-struct nf_loginfo default_loginfo = {
+static struct nf_loginfo default_loginfo = {
        .type   = NF_LOG_TYPE_LOG,
        .u = {
                .log = {
index a65e508fbd40e4681bb9b5649c36d5ed8959b913..0d7dc668db46f53ae7cd4430c047233c00ae950e 100644 (file)
@@ -98,7 +98,7 @@ fold_field(void *mib[], int offt)
 }
 
 /* snmp items */
-static struct snmp_mib snmp4_ipstats_list[] = {
+static const struct snmp_mib snmp4_ipstats_list[] = {
        SNMP_MIB_ITEM("InReceives", IPSTATS_MIB_INRECEIVES),
        SNMP_MIB_ITEM("InHdrErrors", IPSTATS_MIB_INHDRERRORS),
        SNMP_MIB_ITEM("InAddrErrors", IPSTATS_MIB_INADDRERRORS),
@@ -119,7 +119,7 @@ static struct snmp_mib snmp4_ipstats_list[] = {
        SNMP_MIB_SENTINEL
 };
 
-static struct snmp_mib snmp4_icmp_list[] = {
+static const struct snmp_mib snmp4_icmp_list[] = {
        SNMP_MIB_ITEM("InMsgs", ICMP_MIB_INMSGS),
        SNMP_MIB_ITEM("InErrors", ICMP_MIB_INERRORS),
        SNMP_MIB_ITEM("InDestUnreachs", ICMP_MIB_INDESTUNREACHS),
@@ -149,7 +149,7 @@ static struct snmp_mib snmp4_icmp_list[] = {
        SNMP_MIB_SENTINEL
 };
 
-static struct snmp_mib snmp4_tcp_list[] = {
+static const struct snmp_mib snmp4_tcp_list[] = {
        SNMP_MIB_ITEM("RtoAlgorithm", TCP_MIB_RTOALGORITHM),
        SNMP_MIB_ITEM("RtoMin", TCP_MIB_RTOMIN),
        SNMP_MIB_ITEM("RtoMax", TCP_MIB_RTOMAX),
@@ -167,7 +167,7 @@ static struct snmp_mib snmp4_tcp_list[] = {
        SNMP_MIB_SENTINEL
 };
 
-static struct snmp_mib snmp4_udp_list[] = {
+static const struct snmp_mib snmp4_udp_list[] = {
        SNMP_MIB_ITEM("InDatagrams", UDP_MIB_INDATAGRAMS),
        SNMP_MIB_ITEM("NoPorts", UDP_MIB_NOPORTS),
        SNMP_MIB_ITEM("InErrors", UDP_MIB_INERRORS),
@@ -175,7 +175,7 @@ static struct snmp_mib snmp4_udp_list[] = {
        SNMP_MIB_SENTINEL
 };
 
-static struct snmp_mib snmp4_net_list[] = {
+static const struct snmp_mib snmp4_net_list[] = {
        SNMP_MIB_ITEM("SyncookiesSent", LINUX_MIB_SYNCOOKIESSENT),
        SNMP_MIB_ITEM("SyncookiesRecv", LINUX_MIB_SYNCOOKIESRECV),
        SNMP_MIB_ITEM("SyncookiesFailed", LINUX_MIB_SYNCOOKIESFAILED),
index 381dd6a6aebbedc10ac861b957cdd1a55932dc52..f701a136a6ae010c48fae0204b7e028aafb90c8f 100644 (file)
@@ -1371,7 +1371,7 @@ out:      kfree_skb(skb);
  *     are needed for AMPRnet AX.25 paths.
  */
 
-static unsigned short mtu_plateau[] =
+static const unsigned short mtu_plateau[] =
 {32000, 17914, 8166, 4352, 2002, 1492, 576, 296, 216, 128 };
 
 static __inline__ unsigned short guess_mtu(unsigned short old_mtu)
@@ -3149,8 +3149,7 @@ int __init ip_rt_init(void)
                                        sizeof(struct rt_hash_bucket),
                                        rhash_entries,
                                        (num_physpages >= 128 * 1024) ?
-                                               (27 - PAGE_SHIFT) :
-                                               (29 - PAGE_SHIFT),
+                                       15 : 17,
                                        HASH_HIGHMEM,
                                        &rt_hash_log,
                                        &rt_hash_mask,
index 9ac7a4f46bd84ef912f8bea32ce051a09f2bb611..ef98b14ac56d0f6dd2ed726689eccf3391e4e040 100644 (file)
@@ -1413,7 +1413,7 @@ recv_urg:
  *     closed.
  */
 
-static unsigned char new_state[16] = {
+static const unsigned char new_state[16] = {
   /* current state:        new state:      action:     */
   /* (Invalid)         */ TCP_CLOSE,
   /* TCP_ESTABLISHED   */ TCP_FIN_WAIT1 | TCP_ACTION_FIN,
@@ -2065,8 +2065,7 @@ void __init tcp_init(void)
                                        sizeof(struct inet_ehash_bucket),
                                        thash_entries,
                                        (num_physpages >= 128 * 1024) ?
-                                               (25 - PAGE_SHIFT) :
-                                               (27 - PAGE_SHIFT),
+                                       13 : 15,
                                        HASH_HIGHMEM,
                                        &tcp_hashinfo.ehash_size,
                                        NULL,
@@ -2082,8 +2081,7 @@ void __init tcp_init(void)
                                        sizeof(struct inet_bind_hashbucket),
                                        tcp_hashinfo.ehash_size,
                                        (num_physpages >= 128 * 1024) ?
-                                               (25 - PAGE_SHIFT) :
-                                               (27 - PAGE_SHIFT),
+                                       13 : 15,
                                        HASH_HIGHMEM,
                                        &tcp_hashinfo.bhash_size,
                                        NULL,
index a16064ba0caf2bee3bcc87ffa111811d44927d60..76ff9f4fe89d7258895df5bc32857f64d6d603cf 100644 (file)
@@ -985,6 +985,8 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
                        }
 
                        /* Rule 4: Prefer home address -- not implemented yet */
+                       if (hiscore.rule < 4)
+                               hiscore.rule++;
 
                        /* Rule 5: Prefer outgoing interface */
                        if (hiscore.rule < 5) {
index 1bdf0fb8bf8a05ac8fa44193a434c3fcad5a1dc6..34a332225c1749f215f126d46788404f5e5e9850 100644 (file)
@@ -751,7 +751,7 @@ void icmpv6_cleanup(void)
        inet6_del_protocol(&icmpv6_protocol, IPPROTO_ICMPV6);
 }
 
-static struct icmp6_err {
+static const struct icmp6_err {
        int err;
        int fatal;
 } tab_unreach[] = {
index c1fa693511a176c71f601cb3d78696ba83e25437..8523c76ebf768b9f2096a00fce912c14065c7562 100644 (file)
@@ -774,7 +774,8 @@ out_err_release:
        *dst = NULL;
        return err;
 }
-inline int ip6_ufo_append_data(struct sock *sk,
+
+static inline int ip6_ufo_append_data(struct sock *sk,
                        int getfrag(void *from, char *to, int offset, int len,
                        int odd, struct sk_buff *skb),
                        void *from, int length, int hh_len, int fragheaderlen,
index 25757ade989f50d23bf2e7d948d1286918678070..3620718defe61947040716fe3138478c3b49397c 100644 (file)
@@ -628,8 +628,8 @@ e_inval:
        return -EINVAL;
 }
 
-int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr,
-                          char __user *optval, int len)
+static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr,
+                                 char __user *optval, int len)
 {
        if (!hdr)
                return 0;
index 7d492226c16e8fef4c414872a0916e40e59d9fcc..95d469271c4d1879a75e6d9d3235b786f76f8691 100644 (file)
@@ -1972,7 +1972,7 @@ static int ip6t_get_matches(char *buffer, char **start, off_t offset, int length
        return pos;
 }
 
-static struct { char *name; get_info_t *get_info; } ip6t_proc_entry[] =
+static const struct { char *name; get_info_t *get_info; } ip6t_proc_entry[] =
 { { "ip6_tables_names", ip6t_get_tables },
   { "ip6_tables_targets", ip6t_get_targets },
   { "ip6_tables_matches", ip6t_get_matches },
index c7a0ab1cfda35aacd868504c3033417c58c9e9e7..4e9fa8be44b8e7071c75cb9f03ea5c2cb6d819bd 100644 (file)
@@ -526,7 +526,7 @@ key_ref_t __keyring_search_one(key_ref_t keyring_ref,
                            (!key->type->match ||
                             key->type->match(key, description)) &&
                            key_permission(make_key_ref(key, possessed),
-                                          perm) < 0 &&
+                                          perm) == 0 &&
                            !test_bit(KEY_FLAG_REVOKED, &key->flags)
                            )
                                goto found;